Commit 9f432744 by songbingqi

修复部分bug

parent 7191f3c8
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
</view> </view>
</view> </view>
<!-- <div class="code">取单码 {{ orderInfo.orderNum }}</div> --> <!-- <div class="code">取单码 {{ orderInfo.orderNum }}</div> -->
<div class="qr_code_readly"> <div class="qr_code_readly" :style="{'background-image':`url(${ewmImg})`}">
<image mode="scaleToFill" :src="ewmImg" class="qr"></image> <!-- <image mode="scaleToFill" :src="ewmImg" class="qr"></image> -->
</div> </div>
<div class="ercodeTip">制作完成后,扫描此二维码取杯。</div> <div class="ercodeTip">制作完成后,扫描此二维码取杯。</div>
...@@ -134,7 +134,8 @@ export default { ...@@ -134,7 +134,8 @@ export default {
'transform':'translate(0rpx, 0rpx)' 'transform':'translate(0rpx, 0rpx)'
}, },
timer: '', timer: '',
ewmImg: "" ewmImg: "",
ScreenBrightness:""
} }
}, },
watch:{ watch:{
...@@ -184,6 +185,11 @@ export default { ...@@ -184,6 +185,11 @@ export default {
onShow() { onShow() {
console.log('onShow') console.log('onShow')
}, },
onHide() {
if(this.ScreenBrightness) {
wx.setScreenBrightness({value: this.ScreenBrightness})
}
},
async mounted() { async mounted() {
// console.log(123,this.shopInfo) // console.log(123,this.shopInfo)
// if (!this.userms) return; // if (!this.userms) return;
...@@ -252,11 +258,25 @@ export default { ...@@ -252,11 +258,25 @@ export default {
} }
}, },
close() { close() {
if(this.ScreenBrightness) {
wx.setScreenBrightness({value: this.ScreenBrightness})
}
this.show = false; this.show = false;
}, },
open(data, path) { open(data, path) {
this.popupStyle.transform = 'translateY(0px)' this.popupStyle.transform = 'translateY(0px)'
this.show = true; this.show = true;
wx.getScreenBrightness({
success:(res)=>{
this.ScreenBrightness = res.value
},
fail:()=>{
console.log('版本低')
}
})
wx.setScreenBrightness({
value: 1
});
this.getOrderInfo() this.getOrderInfo()
}, },
jsonParse(json) { jsonParse(json) {
...@@ -450,10 +470,12 @@ export default { ...@@ -450,10 +470,12 @@ export default {
} }
.qr_code_readly{ .qr_code_readly{
margin: 20rpx auto; margin: 20rpx auto;
margin-top: 50rpx; margin-top: 20rpx;
margin-bottom: 30rpx; margin-bottom: 20rpx;
width: 450rpx; height: 300rpx;
height: 450rpx; background-repeat: no-repeat;
background-position: center;
overflow: hidden;
.qr { .qr {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
...@@ -42,12 +42,10 @@ ...@@ -42,12 +42,10 @@
<div v-if="ShowIt(specItemRule.ruleId)" class="div_item"> <div v-if="ShowIt(specItemRule.ruleId)" class="div_item">
<div <div
v-if="specItemRule.isRecommend == '1'" v-if="specItemRule.isRecommend == '1'"
:class="[UseIt(specItemRule.ruleId) ? 'disabledStyle' : '']"
class="default" class="default"
></div> ></div>
<button <button
class="good-spec-rule-item" class="good-spec-rule-item"
:disabled="UseIt(specItemRule.ruleId)"
:class="{ active: isActvie(specItemRule) }" :class="{ active: isActvie(specItemRule) }"
> >
<view @click.prevent="checkSku(specItemRule)">{{ <view @click.prevent="checkSku(specItemRule)">{{
...@@ -125,7 +123,7 @@ ...@@ -125,7 +123,7 @@
<view v-if="size > 0" class="good-select-cont"> <view v-if="size > 0" class="good-select-cont">
<span <span
:class=" :class="
!orderState !orderState||!canUse
? 'good-select-btn1-close' ? 'good-select-btn1-close'
: 'good-select-btn1' : 'good-select-btn1'
" "
...@@ -137,7 +135,7 @@ ...@@ -137,7 +135,7 @@
<view> <view>
<a <a
:class=" :class="
!orderState !orderState||!canUse
? 'good-select-btn2-close' ? 'good-select-btn2-close'
: 'good-select-btn2' : 'good-select-btn2'
" "
...@@ -149,7 +147,7 @@ ...@@ -149,7 +147,7 @@
<button <button
v-if="!userms" v-if="!userms"
:class=" :class="
!orderState !orderState||!canUse
? 'good-select-btn2-close' ? 'good-select-btn2-close'
: 'good-select-btn2' : 'good-select-btn2'
" "
...@@ -194,6 +192,7 @@ export default { ...@@ -194,6 +192,7 @@ export default {
showSku: [], showSku: [],
// isInRange: true, // isInRange: true,
orderState: true, orderState: true,
canUse:true
}; };
}, },
onShow() { onShow() {
...@@ -201,7 +200,6 @@ export default { ...@@ -201,7 +200,6 @@ export default {
uni.removeStorageSync("goodsList"); uni.removeStorageSync("goodsList");
this.BottomSafeHeight = uni.getStorageSync("BottomSafeHeight"); this.BottomSafeHeight = uni.getStorageSync("BottomSafeHeight");
this.orderState = JSON.parse(uni.getStorageSync("shopInfo")).orderState this.orderState = JSON.parse(uni.getStorageSync("shopInfo")).orderState
console.log(this.orderState,'orderState')
// this.shopState = JSON.parse(uni.getStorageSync("shopState")); // this.shopState = JSON.parse(uni.getStorageSync("shopState"));
// this.isInRange = // this.isInRange =
// uni.getStorageSync("isInRange") === "" // uni.getStorageSync("isInRange") === ""
...@@ -322,18 +320,13 @@ export default { ...@@ -322,18 +320,13 @@ export default {
return selected; return selected;
}, },
checkSku(specItemRule) { checkSku(specItemRule) {
const value = this.UseIt(specItemRule.ruleId); // const value = this.UseIt(specItemRule.ruleId);
if (value) { // if (value) {
this.showToast({ title: "这款已经卖完啦", icon: "none" }); // this.showToast({ title: "这款已经卖完啦", icon: "none" });
return; // return;
} // }
}, },
selectRoles(specItemRule, parent) { selectRoles(specItemRule, parent) {
const value = this.UseIt(specItemRule.ruleId);
if (value) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
const { selected } = this; const { selected } = this;
selected.forEach((item, index) => { selected.forEach((item, index) => {
if (item.specId == parent.specId) { if (item.specId == parent.specId) {
...@@ -342,6 +335,13 @@ export default { ...@@ -342,6 +335,13 @@ export default {
}); });
this.selected.push({ ...specItemRule, specId: parent.specId }); this.selected.push({ ...specItemRule, specId: parent.specId });
this.buildGoods(); this.buildGoods();
// const value = this.UseIt(specItemRule.ruleId);
// if (value) {
// this.showToast({ title: "这款已经卖完啦", icon: "none" });
// return;
// }
}, },
isActvie(data) { isActvie(data) {
return ( return (
...@@ -363,10 +363,13 @@ export default { ...@@ -363,10 +363,13 @@ export default {
if (selStr === itemStr) selectedSku = item; if (selStr === itemStr) selectedSku = item;
} }
const [sku] = skus.filter((item) => item.skuId == selectedSku); const [sku] = skus.filter((item) => item.skuId == selectedSku);
if (!sku || skus.state == 2) { // console.log(sku,skus,'skus')
this.showToast({ title: "这款已经卖完啦", icon: "none" }); if (!sku || sku.state == 2) {
this.canUse = false
// this.showToast({ title: "这款已经卖完啦", icon: "none" });
callback && callback(); callback && callback();
} else { } else {
this.canUse = true
const { category, ...goods } = this.goodInfo; const { category, ...goods } = this.goodInfo;
goods.skus = [sku]; goods.skus = [sku];
goods.sku = sku; goods.sku = sku;
...@@ -393,18 +396,27 @@ export default { ...@@ -393,18 +396,27 @@ export default {
} }
}, },
addGood() { addGood() {
if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
if (this.checkNum("add")) { if (this.checkNum("add")) {
this.size = this.size + 1; this.size = this.size + 1;
} }
}, },
reduceGood() { reduceGood() {
if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return;
}
const { size } = this; const { size } = this;
if (size > 1) { if (size > 1) {
this.size = size - 1; this.size = size - 1;
} }
}, },
async shoppingCart() { async shoppingCart() {
if (!this.orderState) { if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return; return;
} }
if (this.checkNum("addShop")) { if (this.checkNum("addShop")) {
...@@ -429,7 +441,8 @@ export default { ...@@ -429,7 +441,8 @@ export default {
} }
}, },
async getallNum(e) { async getallNum(e) {
if (!this.orderState) { if (!this.orderState||!this.canUse) {
this.showToast({ title: "这款已经卖完啦", icon: "none" });
return; return;
} }
const gosettleFun = async () => { const gosettleFun = async () => {
...@@ -505,7 +518,7 @@ export default { ...@@ -505,7 +518,7 @@ export default {
} else { } else {
checkLocak(); checkLocak();
} }
if (!this.orderState) { if (!this.orderState||!this.canUse) {
return; return;
} }
...@@ -535,11 +548,6 @@ export default { ...@@ -535,11 +548,6 @@ export default {
}); });
} }
}, },
UseIt(ruleId) {
return (
this.available.indexOf(ruleId) == -1 && this.orderState
);
},
ShowIt(ruleId) { ShowIt(ruleId) {
return this.showSku.indexOf(ruleId) !== -1; return this.showSku.indexOf(ruleId) !== -1;
}, },
......
...@@ -31,15 +31,16 @@ ...@@ -31,15 +31,16 @@
</view> </view>
<view v-else class="status_text">{{ orderStatusText }}</view> <view v-else class="status_text">{{ orderStatusText }}</view>
<view class="tips"> <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" <view v-if="orderInfo.state == 2 || orderInfo.state == 3"
><text class="time">{{waitTime}}</text ><text class="time">{{waitTime}}</text
>分钟后可取,请稍等!</view >分钟后可取,请稍等!</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>
<view class="statusTip" v-if="isBuild"> <view class="statusTip" v-if="isBuild">
<view class="tip_box"> <view class="tip_box">
...@@ -163,7 +164,13 @@ ...@@ -163,7 +164,13 @@
:src="'../../../static/imgs/jiantouhui.png'" :src="'../../../static/imgs/jiantouhui.png'"
/> />
</div> </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> </div>
<div class="shop_info"> <div class="shop_info">
...@@ -809,9 +816,9 @@ export default { ...@@ -809,9 +816,9 @@ export default {
.realQrcodeBox { .realQrcodeBox {
margin: 0 auto; margin: 0 auto;
width: 450rpx; width: 450rpx;
margin-top: 38rpx; margin-top: 20rpx;
margin-bottom: 37rpx; margin-bottom: 20rpx;
height: 450rpx; height: 300rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
overflow: hidden; overflow: hidden;
......
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
data.data.map(item => { data.data.map(item => {
const list = [] const list = []
for(let i=0;i<=item.state;i++){ for(let i=0;i<=item.state;i++){
const time = '' let time = ''
if(i=== 0||i === 1){ if(i=== 0||i === 1){
time = item.createdAt time = item.createdAt
}else{ }else{
......
...@@ -489,6 +489,10 @@ export default { ...@@ -489,6 +489,10 @@ export default {
if (!res.authSetting["scope.userLocation"]) { if (!res.authSetting["scope.userLocation"]) {
console.log('拒绝位置授权,获取上次下单店铺') console.log('拒绝位置授权,获取上次下单店铺')
this.getShopMenus() 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