Commit 9f432744 by songbingqi

修复部分bug

parent 7191f3c8
......@@ -62,8 +62,8 @@
</view>
</view>
<!-- <div class="code">取单码 {{ orderInfo.orderNum }}</div> -->
<div class="qr_code_readly">
<image mode="scaleToFill" :src="ewmImg" class="qr"></image>
<div class="qr_code_readly" :style="{'background-image':`url(${ewmImg})`}">
<!-- <image mode="scaleToFill" :src="ewmImg" class="qr"></image> -->
</div>
<div class="ercodeTip">制作完成后,扫描此二维码取杯。</div>
......@@ -134,7 +134,8 @@ export default {
'transform':'translate(0rpx, 0rpx)'
},
timer: '',
ewmImg: ""
ewmImg: "",
ScreenBrightness:""
}
},
watch:{
......@@ -184,6 +185,11 @@ export default {
onShow() {
console.log('onShow')
},
onHide() {
if(this.ScreenBrightness) {
wx.setScreenBrightness({value: this.ScreenBrightness})
}
},
async mounted() {
// console.log(123,this.shopInfo)
// if (!this.userms) return;
......@@ -252,11 +258,25 @@ export default {
}
},
close() {
if(this.ScreenBrightness) {
wx.setScreenBrightness({value: this.ScreenBrightness})
}
this.show = false;
},
open(data, path) {
this.popupStyle.transform = 'translateY(0px)'
this.show = true;
wx.getScreenBrightness({
success:(res)=>{
this.ScreenBrightness = res.value
},
fail:()=>{
console.log('版本低')
}
})
wx.setScreenBrightness({
value: 1
});
this.getOrderInfo()
},
jsonParse(json) {
......@@ -450,10 +470,12 @@ export default {
}
.qr_code_readly{
margin: 20rpx auto;
margin-top: 50rpx;
margin-bottom: 30rpx;
width: 450rpx;
height: 450rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
height: 300rpx;
background-repeat: no-repeat;
background-position: center;
overflow: hidden;
.qr {
width: 100%;
height: 100%;
......
......@@ -42,12 +42,10 @@
<div v-if="ShowIt(specItemRule.ruleId)" class="div_item">
<div
v-if="specItemRule.isRecommend == '1'"
:class="[UseIt(specItemRule.ruleId) ? 'disabledStyle' : '']"
class="default"
></div>
<button
class="good-spec-rule-item"
:disabled="UseIt(specItemRule.ruleId)"
:class="{ active: isActvie(specItemRule) }"
>
<view @click.prevent="checkSku(specItemRule)">{{
......@@ -125,7 +123,7 @@
<view v-if="size > 0" class="good-select-cont">
<span
:class="
!orderState
!orderState||!canUse
? 'good-select-btn1-close'
: 'good-select-btn1'
"
......@@ -137,7 +135,7 @@
<view>
<a
:class="
!orderState
!orderState||!canUse
? 'good-select-btn2-close'
: 'good-select-btn2'
"
......@@ -149,7 +147,7 @@
<button
v-if="!userms"
:class="
!orderState
!orderState||!canUse
? 'good-select-btn2-close'
: 'good-select-btn2'
"
......@@ -194,6 +192,7 @@ export default {
showSku: [],
// isInRange: true,
orderState: true,
canUse:true
};
},
onShow() {
......@@ -201,7 +200,6 @@ export default {
uni.removeStorageSync("goodsList");
this.BottomSafeHeight = uni.getStorageSync("BottomSafeHeight");
this.orderState = JSON.parse(uni.getStorageSync("shopInfo")).orderState
console.log(this.orderState,'orderState')
// this.shopState = JSON.parse(uni.getStorageSync("shopState"));
// this.isInRange =
// uni.getStorageSync("isInRange") === ""
......@@ -322,18 +320,13 @@ export default {
return selected;
},
checkSku(specItemRule) {
const value = this.UseIt(specItemRule.ruleId);
if (value) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
// const value = this.UseIt(specItemRule.ruleId);
// if (value) {
// this.showToast({ title: "这款已经卖完啦", icon: "none" });
// return;
// }
},
selectRoles(specItemRule, parent) {
const value = this.UseIt(specItemRule.ruleId);
if (value) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
const { selected } = this;
selected.forEach((item, index) => {
if (item.specId == parent.specId) {
......@@ -342,6 +335,13 @@ export default {
});
this.selected.push({ ...specItemRule, specId: parent.specId });
this.buildGoods();
// const value = this.UseIt(specItemRule.ruleId);
// if (value) {
// this.showToast({ title: "这款已经卖完啦", icon: "none" });
// return;
// }
},
isActvie(data) {
return (
......@@ -363,10 +363,13 @@ export default {
if (selStr === itemStr) selectedSku = item;
}
const [sku] = skus.filter((item) => item.skuId == selectedSku);
if (!sku || skus.state == 2) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
// console.log(sku,skus,'skus')
if (!sku || sku.state == 2) {
this.canUse = false
// this.showToast({ title: "这款已经卖完啦", icon: "none" });
callback && callback();
} else {
this.canUse = true
const { category, ...goods } = this.goodInfo;
goods.skus = [sku];
goods.sku = sku;
......@@ -393,18 +396,27 @@ export default {
}
},
addGood() {
if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
if (this.checkNum("add")) {
this.size = this.size + 1;
}
},
reduceGood() {
if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
const { size } = this;
if (size > 1) {
this.size = size - 1;
}
},
async shoppingCart() {
if (!this.orderState) {
if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
if (this.checkNum("addShop")) {
......@@ -429,7 +441,8 @@ export default {
}
},
async getallNum(e) {
if (!this.orderState) {
if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
const gosettleFun = async () => {
......@@ -505,7 +518,7 @@ export default {
} else {
checkLocak();
}
if (!this.orderState) {
if (!this.orderState||!this.canUse) {
return;
}
......@@ -535,11 +548,6 @@ export default {
});
}
},
UseIt(ruleId) {
return (
this.available.indexOf(ruleId) == -1 && this.orderState
);
},
ShowIt(ruleId) {
return this.showSku.indexOf(ruleId) !== -1;
},
......
......@@ -31,15 +31,16 @@
</view>
<view v-else class="status_text">{{ orderStatusText }}</view>
<view class="tips">
<view v-if="orderInfo.state == 7">制作完成请取杯,享用愉快!</view>
<view v-if="orderInfo.state == 4||orderInfo.state == 5">制作完成请取杯,享用愉快!</view>
<view v-if="orderInfo.state >= 8 && orderInfo.state <= 15"
>非常抱歉,我们会继续努力的~</view
>
<view v-if="orderInfo.state == 2 || orderInfo.state == 3"
><text class="time">{{waitTime}}</text
>分钟后可取,请稍等!</view
>
<view v-if="orderInfo.state == 4||orderInfo.state == 5">制作完成请取杯,享用愉快!</view>
<view v-if="orderInfo.state == 6"> 订单完成 请搅拌后尽快引用哦~ </view>
<view v-if="orderInfo.state == 7"> 待取超时 品质不佳已丢弃,请联系客服重做!</view>
<view v-if="orderInfo.state >= 8 && orderInfo.state <= 15"
>非常抱歉,我们会继续努力的~</view
>
</view>
<view class="statusTip" v-if="isBuild">
<view class="tip_box">
......@@ -163,7 +164,13 @@
:src="'../../../static/imgs/jiantouhui.png'"
/>
</div>
<div class="btn" @click="refundInfo" v-if="checkStatus(orderInfo.state, [12, 13, 14, 15])">退款</div>
<div class="btn" @click="toRefund" v-if="checkStatus(orderInfo.state, [2])">退款</div>
<div
type="primary"
@click="oneMoreOrder(orderInfo)"
v-else-if="orderInfo.state != 1&&orderInfo.state != 2&&orderInfo.state != 4&&orderInfo.state != 5"
class="btn"
>再来一单</div>
</div>
</div>
<div class="shop_info">
......@@ -809,9 +816,9 @@ export default {
.realQrcodeBox {
margin: 0 auto;
width: 450rpx;
margin-top: 38rpx;
margin-bottom: 37rpx;
height: 450rpx;
margin-top: 20rpx;
margin-bottom: 20rpx;
height: 300rpx;
background-repeat: no-repeat;
background-position: center;
overflow: hidden;
......
......@@ -114,7 +114,7 @@ export default {
data.data.map(item => {
const list = []
for(let i=0;i<=item.state;i++){
const time = ''
let time = ''
if(i=== 0||i === 1){
time = item.createdAt
}else{
......
......@@ -489,6 +489,10 @@ export default {
if (!res.authSetting["scope.userLocation"]) {
console.log('拒绝位置授权,获取上次下单店铺')
this.getShopMenus()
} else {
User.getLocation((state, params) => {
this.getShopMenus(params);
});
}
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment