Commit 6c4f074f by weijiguang

1

parent 3572496b
......@@ -3,11 +3,14 @@
<u-popup :show="show" :round="10" closeable mode="bottom" @close="close">
<div class="order_flow">
<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">
<h3>扫码流程 </h3>
<image :mode="'aspectFit'" width="600px" class="flow_img" src="/static/imgs/order_flow.png">
</image>
<h3>扫码流程</h3>
<image :mode="'aspectFit'" width="600px" class="flow_img" src="/static/imgs/order_flow.png"></image>
</div>
<div class="flow_describe">
<h3>注意事项</h3>
......@@ -29,24 +32,57 @@ export default {
orderInfo: {},
qrCode: '',
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() {
},
methods: {
close() {
this.show = false
this.show = false;
},
open(data, path) {
this.show = true
this.show = true;
this.orderInfo = data;
this.qrCode = path
console.log("order:"+JSON.stringify(this.orderInfo));
if(this.showMask) {
this.qrCode = '/static/imgs/noQr.png';
} else {
this.qrCode = path;
}
},
jsonParse(json) {
return JSON.parse(json)
......@@ -127,13 +163,31 @@ export default {
text-align: center;
}
.qr_code {
width: 308rpx;
height: 310rpx;
width: 508rpx;
height: 510rpx;
display: block;
margin: 25rpx auto;
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 {
......
......@@ -55,7 +55,9 @@ export default {
methods: {
getSku(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)
|| data.skus.find(v => v.state == 1)
|| data.skus.find(v => v.isDefault == 1)
......@@ -64,7 +66,7 @@ export default {
},
createList(data) {
this.classifyData = data;
console.log(this.classifyData)
// console.log(this.classifyData)
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this);
query.selectAll('.box').boundingClientRect(data => {
......@@ -416,7 +418,6 @@ export default {
}
.tags {
margin-top: -10rpx;
.tag-item {
height: 24rpx;
border-radius: 4rpx;
......@@ -445,7 +446,6 @@ export default {
}
.mon {
margin-top: -10rpx;
.discount {
display: inline-block;
height: 32rpx;
......
......@@ -26,15 +26,15 @@
</view>
</view>
<view class="order-banner" v-if="buied">
<view class="order-banner" v-if="buied" @click="openQrcode">
<view class="info">
<view class="first">取单码:{{ orderInfo.orderNum }}</view>
<view class="second">请您耐心等候,剩余等候时间<text class="time">{{ orderInfo.waitTime }}</text>分钟</view>
</view>
<view class="line"></view>
<view class="barCode-box">
<view @click="openQrcode" class="barCode">
<image :src="'../../static/imgs/icon-barcode.png'"></image>
<view class="barCode">
<image :src="'/static/imgs/icon-barcode.png'"></image>
</view>
<view class="barCode-dis">点击二维码取单</view>
</view>
......@@ -99,6 +99,8 @@ export default {
const res = await Order.getHomeOrder()
const data = res?.data
if (data?.data) {
// this.$set(data.data, 'state', '2');
console.log("getHomeOrder:"+JSON.stringify(data.data));
this.buied = true;
this.orderInfo = data.data
} else {
......@@ -107,6 +109,11 @@ export default {
},
methods: {
openQrcode() {
// 不生成二维码
if(['2', '3'].indexOf(this.orderInfo.state) != -1){
this.$refs.OrderQrCode.open(this.orderInfo, "");
return;
}
new QRCode('myQrcode2', {
text: this.orderInfo.pickCode,
width: 141, //canvas 画布的宽
......@@ -145,7 +152,7 @@ export default {
const { value } = res;
const shops = value[2].shops;
this.show = false;
console.log(shops);
// console.log(shops);
uni.setStorageSync('shops', shops);
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