Commit ce63e9bd by weijiguang

修改状态

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