Commit 7191f3c8 by songbingqi

修复部分bug

parent 215403c9
......@@ -63,7 +63,7 @@
</view>
<!-- <div class="code">取单码 {{ orderInfo.orderNum }}</div> -->
<div class="qr_code_readly">
<image mode="scaleToFill" :src="orderInfo.pickCode" class="qr"></image>
<image mode="scaleToFill" :src="ewmImg" class="qr"></image>
</div>
<div class="ercodeTip">制作完成后,扫描此二维码取杯。</div>
......@@ -119,6 +119,7 @@
<script>
import Order from "@/request/order";
import Utils from "@/utils/utils";
export default {
data() {
return {
......@@ -132,7 +133,8 @@ export default {
popupStyle:{
'transform':'translate(0rpx, 0rpx)'
},
timer: ''
timer: '',
ewmImg: ""
}
},
watch:{
......@@ -214,6 +216,7 @@ export default {
}, 5000);
}
this.orderInfo ={...data.data};
this.ewmImg = Utils.svgToBase64(this.orderInfo.pickCode);
} else {
clearTimeout(this.timer)
this.buied = false;
......
......@@ -546,7 +546,7 @@ export default {
}
.tag-item-recommend {
font-family: PingFangSC-Regular, PingFang SC;
border: 1rpx solid #EA58DD;
border: 2rpx solid #EA58DD;
padding: 0rpx 8rpx;
font-size: 20rpx;
color: #EA58DD;
......
......@@ -478,6 +478,9 @@ export default {
uni.setStorageSync("updataLoadtion", true);
console.log(res);
if (res.authSetting["scope.userLocation"] == true) {
User.getLocation((state, params) => {
console.log(params)
});
//判断res.authsetting的值是true还是false
gosettleFun();
} else {
......
......@@ -25,14 +25,14 @@
'margin-top': statusBarHeight + navigationBarHeight + getPx(32) + 'px',
}"
>
<view class="code" v-if="isBulid">
<view class="code" v-if="isBuild">
<view class="code_label">取单号:</view>
<view class="code_content">{{orderInfo.orderNum}}</view>
</view>
<view v-else class="status_text">订单状态:{{ orderStatusText }}</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">制作完成请取杯,享用愉快!</view>
<view v-if="orderInfo.state == 4||orderInfo.state == 5">制作完成请取杯,享用愉快!</view>
<view v-if="orderInfo.state >= 8 && orderInfo.state <= 15"
>非常抱歉,我们会继续努力的~</view
>
......@@ -45,17 +45,17 @@
<view class="tip_box">
<view class="tip">
<view class="icon">
<image v-if="[1].indexOf(Number(orderInfo.state))!=-1" mode="aspectFit" :src="'/static/imgs/daizhizuo_action.png'"/>
<image v-if="[2].indexOf(Number(orderInfo.state))!=-1" mode="aspectFit" :src="'/static/imgs/daizhizuo_action.png'"/>
<image v-else mode="aspectFit" :src="'/static/imgs/daizhizuo.png'"/>
</view>
<view :class="[1].indexOf(Number(orderInfo.state))!=-1?'tip_titile_action':'tip_tittle'">1待制作</view>
<view :class="[2].indexOf(Number(orderInfo.state))!=-1?'tip_titile_action':'tip_tittle'">1待制作</view>
</view>
<view class="tip">
<view class="icon">
<image v-if="[2, 3].indexOf(Number(orderInfo.state))!=-1" mode="aspectFit" :src="'/static/imgs/zhizuozhong_action.png'"/>
<image v-if="[3].indexOf(Number(orderInfo.state))!=-1" mode="aspectFit" :src="'/static/imgs/zhizuozhong_action.png'"/>
<image v-else mode="aspectFit" :src="'/static/imgs/zhizuozhong.png'"/>
</view>
<view :class="[2, 3].indexOf(Number(orderInfo.state))!=-1?'tip_titile_action':'tip_tittle'">2制作中</view>
<view :class="[3].indexOf(Number(orderInfo.state))!=-1?'tip_titile_action':'tip_tittle'">2制作中</view>
</view>
<view class="tip">
<view class="icon">
......@@ -84,7 +84,7 @@
<a
type="primary"
@click="oneMoreOrder(orderInfo)"
v-if="orderInfo.state != 1&&orderInfo.state != 2"
v-if="orderInfo.state != 1&&orderInfo.state != 2&&orderInfo.state != 4&&orderInfo.state != 5"
class="btn"
>再来一单</a
>
......@@ -100,8 +100,8 @@
<div class="order_flow" v-if="qrShow"> -->
<!-- <div v-if="qrShow" class="code">取单码 {{ orderInfo.orderNum }}</div> -->
<!-- <div class="realQrcodeBox" :style="{'background-image':`url(${ewmImg})`}" v-if="isBuild"> -->
<div class="realQrcodeBox" v-if="isBuild">
<image mode="aspectFit" :src="ewmImg" />
<div class="realQrcodeBox" :style="{'background-image':`url(${ewmImg})`}" v-if="isBuild">
<!-- <image mode="aspectFit" :src="ewmImg" /> -->
</div>
<!-- <div v-else class="qr_code">
<image
......@@ -110,7 +110,7 @@
class="qr"
/>
</div> -->
<div class="ercodeTip" v-if="isBuild">制作完成后,扫描此二维码取杯。</div>
<div class="ercodeTip" v-if="isBuild">制作完成后扫描此二维码取杯。</div>
<!-- <view class="scan_tips" v-if="qrTextShow">——制作完成后才能扫哦——</view> -->
<canvas
v-if="qrShow"
......@@ -288,11 +288,24 @@ export default {
uni.setStorageSync("allow", true);
uni.setStorageSync("goodsList", {});
// this.backToMneu = false
if(this.ScreenBrightness) {
wx.setScreenBrightness({
value: 1
});
}
},
onUnload() {
if(this.ScreenBrightness) {
wx.setScreenBrightness({value: this.ScreenBrightness})
}
clearTimeout(this.timer)
console.log('onUnload')
},
onHide() {
if(this.ScreenBrightness) {
wx.setScreenBrightness({value: this.ScreenBrightness})
}
},
// onUnload(){
// this.goBack()
// },
......@@ -306,26 +319,26 @@ export default {
backFlag: false,
backToMneu: false,
Authorization: "",
timer:""
timer:"",
ScreenBrightness: ''
};
},
methods: {
svgToBase64(svgString) {
return `data:image/svg+xml;charset=utf-8,${encodeURI(svgString)}`;
},
startTimeOut() {
this.timer = setTimeout(async () => {
const { data = {} } = await Order.getOrderDetail({ orderId: this.orderInfo.id, nodLoading:true })
this.orderInfo = data?.data
const getTime = [2,3].indexOf(Number(this.orderInfo.state)) >= 0;
const isBuild = [2,3].indexOf(Number(this.orderInfo.state)) >= 0;
const isBuild = [2,3,4,5].indexOf(Number(this.orderInfo.state)) >= 0;
if (getTime) {
const { data = {} } = (await Order.getOrderWaiteTime({ orderId: this.orderInfo.id, nodLoading:true })) || {};
this.waitTime = data?.data;
}
if (isBuild) {
this.ewmImg = this.svgToBase64(this.orderInfo.pickCode);
this.ewmImg = Utils.svgToBase64(this.orderInfo.pickCode);
}
this.isBuild = isBuild
clearTimeout(this.timer)
this.startTimeOut()
}, 5000);
......@@ -445,16 +458,18 @@ export default {
}
this.startTimeOut()
if (isBuild) {
// new QRCode('myQrcode', {
// text: this.orderInfo.pickCode+'###',
// width: 141, //canvas 画布的宽
// height: 141, //canvas 画布的高
// padding: 0, // 生成二维码四周自动留边宽度,不传入默认为0
// correctLevel: QRCode.CorrectLevel.L, // 二维码可辨识度
// callback: (res) => {
this.ewmImg = this.svgToBase64(this.orderInfo.pickCode);
// }
// })
wx.getScreenBrightness({
success:(res)=>{
this.ScreenBrightness = res.value
},
fail:()=>{
console.log('版本低')
}
})
wx.setScreenBrightness({
value: 1
});
this.ewmImg = Utils.svgToBase64(this.orderInfo.pickCode);
}
this.isBuild = isBuild;
},
......@@ -614,14 +629,14 @@ export default {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
color: #000000;
margin-left: 20rpx;
.time {
font-size: 25rpx;
font-weight: bolder;
font-family: Futura Medium, Arial, sans-serif;
color: #353535;
color: #000000;
margin-right: 5rpx;
// margin-left: 20rpx;
}
......@@ -699,7 +714,7 @@ export default {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
color: #000000;
display: flex;
align-items: center;
......
......@@ -418,6 +418,7 @@ export default {
totalPrice() {
if (JSON.stringify(this.goods) == "{}") return 0;
let totalPrice = 0;
console.log(this.goods,'goods')
this.goods.forEach((item) => {
const sku = item.sku;
item.flag ? (totalPrice += item.num * sku.discount) : (totalPrice += 0);
......
......@@ -253,9 +253,9 @@ export default {
statusFillter(state) {
switch (state) {
case "1":
return "待制作";
return "未支付";
case "2":
return "制作中";
return "待制作";
case "3":
return "制作中";
case "4":
......@@ -285,5 +285,9 @@ export default {
default:
return "未知状态";
}
}
},
// 处理二维码图片
svgToBase64(svgString) {
return `data:image/svg+xml;charset=utf-8,${encodeURI(svgString)}`;
},
};
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