Commit 6c4f074f by weijiguang

1

parent 3572496b
...@@ -3,11 +3,14 @@ ...@@ -3,11 +3,14 @@
<u-popup :show="show" :round="10" closeable mode="bottom" @close="close"> <u-popup :show="show" :round="10" closeable mode="bottom" @close="close">
<div class="order_flow"> <div class="order_flow">
<div class="code">取单码 {{ orderInfo.orderNum }}</div> <div class="code">取单码 {{ orderInfo.orderNum }}</div>
<image mode="scaleToFill" :src="qrCode" class="qr_code"></image> <!-- <image mode="scaleToFill" :src="qrCode" class="qr_code"></image> -->
<div class="qr_code">
<image mode="scaleToFill" :src="qrCode" class="qr"></image>
<view class="status_text">{{ orderStatusText }}</view>
</div>
<div class="flow_describe"> <div class="flow_describe">
<h3>扫码流程 </h3> <h3>扫码流程</h3>
<image :mode="'aspectFit'" width="600px" class="flow_img" src="/static/imgs/order_flow.png"> <image :mode="'aspectFit'" width="600px" class="flow_img" src="/static/imgs/order_flow.png"></image>
</image>
</div> </div>
<div class="flow_describe"> <div class="flow_describe">
<h3>注意事项</h3> <h3>注意事项</h3>
...@@ -29,24 +32,57 @@ export default { ...@@ -29,24 +32,57 @@ export default {
orderInfo: {}, orderInfo: {},
qrCode: '', qrCode: '',
show: false, show: false,
}
},
computed: {
// 0 创建未校验
// 1 未支付
// 2 已支付
// 3 支付制作中
// 4 制作完成未取
// 5 取餐中
// 6 正常完成
// 7 待取超时
// 8 未支付取消
// 9 支付后制作前取消
// 10 制作中取消
// 11 制作完成取消
// 12 退款中
// 13 退款失败
// 14 部分退款
// 15 已退款
// 50 其他人工干预状态
showMask() {
return ['2', '3'].indexOf(this.orderInfo.state) != -1
},
orderStatusText() {
switch (this.orderInfo.state) {
case '2':
return '已支付'
case '3':
return '等待中'
default:
return ''
}
} }
}, },
onLoad() { onLoad() {
}, },
methods: { methods: {
close() { close() {
this.show = false this.show = false;
}, },
open(data, path) { open(data, path) {
this.show = true this.show = true;
this.orderInfo = data; this.orderInfo = data;
console.log("order:"+JSON.stringify(this.orderInfo));
this.qrCode = path
if(this.showMask) {
this.qrCode = '/static/imgs/noQr.png';
} else {
this.qrCode = path;
}
}, },
jsonParse(json) { jsonParse(json) {
return JSON.parse(json) return JSON.parse(json)
...@@ -127,13 +163,31 @@ export default { ...@@ -127,13 +163,31 @@ export default {
text-align: center; text-align: center;
} }
.qr_code { .qr_code {
width: 308rpx; width: 508rpx;
height: 310rpx; height: 510rpx;
display: block; display: block;
margin: 25rpx auto; margin: 25rpx auto;
background-color: #ccc; background-color: #ccc;
position: relative;
.status_text {
font-size: 48rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #FFFFFF;
line-height: 66rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.qr {
width: 100%;
height: 100%;
}
} }
.flow_describe { .flow_describe {
......
...@@ -55,7 +55,9 @@ export default { ...@@ -55,7 +55,9 @@ export default {
methods: { methods: {
getSku(data) { getSku(data) {
const { skus } = data; const { skus } = data;
if (!skus && skus.length == 0) return { discount: data.discount, price: data.price}; if (!skus || skus.length == 0) {
return { discount: data.discount, price: data.price};
}
const sku = data.skus.find(v => v.isDefault == 1 && v.state == 1) const sku = data.skus.find(v => v.isDefault == 1 && v.state == 1)
|| data.skus.find(v => v.state == 1) || data.skus.find(v => v.state == 1)
|| data.skus.find(v => v.isDefault == 1) || data.skus.find(v => v.isDefault == 1)
...@@ -64,7 +66,7 @@ export default { ...@@ -64,7 +66,7 @@ export default {
}, },
createList(data) { createList(data) {
this.classifyData = data; this.classifyData = data;
console.log(this.classifyData) // console.log(this.classifyData)
this.$nextTick(() => { this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this); const query = uni.createSelectorQuery().in(this);
query.selectAll('.box').boundingClientRect(data => { query.selectAll('.box').boundingClientRect(data => {
...@@ -416,7 +418,6 @@ export default { ...@@ -416,7 +418,6 @@ export default {
} }
.tags { .tags {
margin-top: -10rpx;
.tag-item { .tag-item {
height: 24rpx; height: 24rpx;
border-radius: 4rpx; border-radius: 4rpx;
...@@ -445,7 +446,6 @@ export default { ...@@ -445,7 +446,6 @@ export default {
} }
.mon { .mon {
margin-top: -10rpx;
.discount { .discount {
display: inline-block; display: inline-block;
height: 32rpx; height: 32rpx;
......
...@@ -26,15 +26,15 @@ ...@@ -26,15 +26,15 @@
</view> </view>
</view> </view>
<view class="order-banner" v-if="buied"> <view class="order-banner" v-if="buied" @click="openQrcode">
<view class="info"> <view class="info">
<view class="first">取单码:{{ orderInfo.orderNum }}</view> <view class="first">取单码:{{ orderInfo.orderNum }}</view>
<view class="second">请您耐心等候,剩余等候时间<text class="time">{{ orderInfo.waitTime }}</text>分钟</view> <view class="second">请您耐心等候,剩余等候时间<text class="time">{{ orderInfo.waitTime }}</text>分钟</view>
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="barCode-box"> <view class="barCode-box">
<view @click="openQrcode" class="barCode"> <view class="barCode">
<image :src="'../../static/imgs/icon-barcode.png'"></image> <image :src="'/static/imgs/icon-barcode.png'"></image>
</view> </view>
<view class="barCode-dis">点击二维码取单</view> <view class="barCode-dis">点击二维码取单</view>
</view> </view>
...@@ -99,6 +99,8 @@ export default { ...@@ -99,6 +99,8 @@ export default {
const res = await Order.getHomeOrder() const res = await Order.getHomeOrder()
const data = res?.data const data = res?.data
if (data?.data) { if (data?.data) {
// this.$set(data.data, 'state', '2');
console.log("getHomeOrder:"+JSON.stringify(data.data));
this.buied = true; this.buied = true;
this.orderInfo = data.data this.orderInfo = data.data
} else { } else {
...@@ -107,6 +109,11 @@ export default { ...@@ -107,6 +109,11 @@ export default {
}, },
methods: { methods: {
openQrcode() { openQrcode() {
// 不生成二维码
if(['2', '3'].indexOf(this.orderInfo.state) != -1){
this.$refs.OrderQrCode.open(this.orderInfo, "");
return;
}
new QRCode('myQrcode2', { new QRCode('myQrcode2', {
text: this.orderInfo.pickCode, text: this.orderInfo.pickCode,
width: 141, //canvas 画布的宽 width: 141, //canvas 画布的宽
...@@ -145,7 +152,7 @@ export default { ...@@ -145,7 +152,7 @@ export default {
const { value } = res; const { value } = res;
const shops = value[2].shops; const shops = value[2].shops;
this.show = false; this.show = false;
console.log(shops); // console.log(shops);
uni.setStorageSync('shops', shops); uni.setStorageSync('shops', shops);
uni.navigateTo({ url: '/menuSubPackage/pages/areaSelect/areaSelect' }) uni.navigateTo({ url: '/menuSubPackage/pages/areaSelect/areaSelect' })
}, },
......
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