Commit ce63e9bd by weijiguang

修改状态

parent 0eef35e2
......@@ -6,14 +6,14 @@
<a type="primary" @click="cancelOrder" v-if="orderInfo.state == 1" class="btn_cancel">取消订单</a>
<a type="primary" @click="PayNow" v-if="orderInfo.state == 1" class="btn">立即支付</a>
<a type="primary" @click="toRefund" v-if="orderInfo.state == 2" class="btn">申请退款</a>
<a type="primary" @click="oneMoreOrder(orderInfo)" class="btn">再来一单</a>
<a type="primary" @click="oneMoreOrder(orderInfo)" v-if="orderInfo.state != 1" class="btn">再来一单</a>
</div>
</div>
<div class="order_flow">
<div v-if="qrShow" class="code">取单码 {{ orderInfo.orderNum }}</div>
<div v-if="qrShow" class="qr_code">
<image mode="aspectFit" :src="ewmImg" class="qr"></image>
<view class="status_text">{{ orderStatusText }}</view>
<view class="status_text">{{ qrText }}</view>
</div>
<canvas v-if="qrShow" class="canvas-code" canvas-id="myQrcode"
style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" />
......@@ -36,7 +36,7 @@
<div class="goods_text">
<div class="goods_name">
<div class="name">{{ item.goodsName }}</div>
<div class="price">¥{{ setPrice(item.amount) }}</div>
<div class="price">¥{{ setPrice(item.realAmount) }}</div>
</div>
<div class="goods_psce">
<div class="psce_name">
......@@ -105,10 +105,7 @@ export default {
onLoad() {
const resData = uni.getStorageSync('orderInfo');
this.orderInfo = resData
console.log("orderInfo:"+JSON.stringify(this.orderInfo));
this.ewmImg = '/static/imgs/noQr.png'
const isBuild = ['2', '3', '4', '5'].indexOf(this.orderInfo.state) != -1;
const isBuild = ['4', '5', '7'].indexOf(this.orderInfo.state) >= 0;
if (isBuild) {
new QRCode('myQrcode', {
text: this.orderInfo.pickCode,
......@@ -120,6 +117,8 @@ export default {
this.ewmImg = res.path
}
})
} else {
this.ewmImg = '/static/imgs/noQr.png'
}
},
data() {
......@@ -188,11 +187,8 @@ export default {
return totalNum;
},
qrShow() {
console.log("order state:"+this.orderInfo.state);
return ['2','3','4','5'].indexOf(this.orderInfo.state) != -1
},
isBuildQrcode() {
return
console.log(this.orderInfo.orderDetails);
return ['2','3','4','5', '7'].indexOf(this.orderInfo.state) >= 0;
},
// 1 未支付
// 2 已支付
......@@ -213,25 +209,21 @@ export default {
orderStatusText() {
switch (this.orderInfo.state) {
case '1':
return '未支付'
return '待付款'
case '2':
return '待制作'
case '3':
return '制作中'
case '4':
case '7':
return '待取餐'
case '5':
return '取餐中'
case '6':
return '已完成'
case '7':
return '待取超时'
case '8':
return '已取消'
case '9':
return '已取消'
case '10':
return '已取消'
case '11':
return '已取消'
case '12':
......@@ -245,6 +237,16 @@ export default {
default:
return '未知状态'
}
},
qrText() {
switch (this.orderInfo.state) {
case '2':
return '待制作'
case '3':
return '制作中'
default:
return ''
}
}
}
}
......
......@@ -4,7 +4,7 @@
<h3>门店确认</h3>
<div class="address">
<div class="address_1">{{ shopData.name }}</div>
<div v-if="shopData.distance" class="address_2">距您{{ shopData.distance }},请确定门店后下单</div>
<div v-if="shopData.distance && shopData.distance!=-1" class="address_2">距您{{ shopData.distance }},请确定门店后下单</div>
<div v-else class="address_2">请确定门店后下单</div>
</div>
<div class="take_order">
......
......@@ -34,8 +34,7 @@
</view>
</view>
<view class="box two">
<button v-if="!userms" class="payment" open-type="getPhoneNumber" @getphonenumber.stop="goToPage">
</button>
<button v-if="!userms" class="payment" open-type="getPhoneNumber" @getphonenumber.stop="goToPage"></button>
<view @click="goToPage('msg')" class="left">
<h3>我的消息</h3>
<view class="dec">点击查看我的消息</view>
......@@ -83,7 +82,6 @@ export default {
},
},
methods: {
// 手机号授权登录
getPhoneNumber(e) {
if (e.detail.errMsg == 'getPhoneNumber:ok') {
......
......@@ -93,25 +93,21 @@ export default {
state = '' + state;
switch (state) {
case '1':
return '未支付'
return '待付款'
case '2':
return '待制作'
case '3':
return '制作中'
case '4':
case '7':
return '待取餐'
case '5':
return '取餐中'
case '6':
return '已完成'
case '7':
return '待取超时'
case '8':
return '已取消'
case '9':
return '已取消'
case '10':
return '已取消'
case '11':
return '已取消'
case '12':
......
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