Commit 7191f3c8 by songbingqi

修复部分bug

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