Commit c7182879 by 宋冰琦
parents ca810acf 4bf5da33
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </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> <image :mode="'aspectFit'" class="flow_img" src="/static/imgs/order_flow.png"></image>
</div> </div>
<div class="flow_describe"> <div class="flow_describe">
<h3>注意事项</h3> <h3>注意事项</h3>
...@@ -126,8 +126,6 @@ export default { ...@@ -126,8 +126,6 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.btn { .btn {
...@@ -144,16 +142,14 @@ export default { ...@@ -144,16 +142,14 @@ export default {
color: #FFFFFF; color: #FFFFFF;
font-size: 20rpx; font-size: 20rpx;
text-align: center; text-align: center;
} }
} }
.order_flow { .order_flow {
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 32rpx; padding-top: 25rpx;
padding-top: 65rpx; padding-bottom: 25rpx;
.code { .code {
font-size: 36rpx; font-size: 36rpx;
...@@ -161,7 +157,6 @@ export default { ...@@ -161,7 +157,6 @@ export default {
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
text-align: center; text-align: center;
} }
.qr_code { .qr_code {
...@@ -191,15 +186,14 @@ export default { ...@@ -191,15 +186,14 @@ export default {
} }
.flow_describe { .flow_describe {
width: 686rpx; width: 590rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(166, 166, 166, 0.5); box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(166, 166, 166, 0.5);
border-radius: 10rpx; border-radius: 10rpx;
margin: 0 auto; margin: 0 auto;
margin-top: 20rpx;
padding: 30rpx; padding: 30rpx;
h3 { h3 {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
...@@ -208,8 +202,8 @@ export default { ...@@ -208,8 +202,8 @@ export default {
} }
.flow_img { .flow_img {
width: 600rpx; width: 590rpx;
height: 214rpx; height: 211rpx;
display: block; display: block;
margin: 24rpx auto; margin: 24rpx auto;
} }
......
...@@ -116,7 +116,6 @@ export default { ...@@ -116,7 +116,6 @@ export default {
.shop-box { .shop-box {
min-width: 300rpx; min-width: 300rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
display: flex; display: flex;
...@@ -132,7 +131,6 @@ export default { ...@@ -132,7 +131,6 @@ export default {
.distance { .distance {
height: 46rpx; height: 46rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
line-height: 42rpx; line-height: 42rpx;
...@@ -189,7 +187,6 @@ export default { ...@@ -189,7 +187,6 @@ export default {
.user-name { .user-name {
height: 28rpx; height: 28rpx;
font-size: 20rpx; font-size: 20rpx;
font-family: ArialMT;
color: #FFFFFF; color: #FFFFFF;
line-height: 22rpx; line-height: 22rpx;
} }
...@@ -198,7 +195,6 @@ export default { ...@@ -198,7 +195,6 @@ export default {
display: flex; display: flex;
height: 22rpx; height: 22rpx;
font-size: 16rpx; font-size: 16rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
line-height: 22rpx; line-height: 22rpx;
...@@ -224,7 +220,6 @@ export default { ...@@ -224,7 +220,6 @@ export default {
background: #006ECF; background: #006ECF;
border-radius: 4rpx; border-radius: 4rpx;
font-size: 20rpx; font-size: 20rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
line-height: 48rpx; line-height: 48rpx;
...@@ -254,7 +249,6 @@ export default { ...@@ -254,7 +249,6 @@ export default {
.first { .first {
height: 44rpx; height: 44rpx;
font-size: 32rpx; font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #323232; color: #323232;
line-height: 44rpx; line-height: 44rpx;
...@@ -265,14 +259,12 @@ export default { ...@@ -265,14 +259,12 @@ export default {
margin-top: 20rpx; margin-top: 20rpx;
height: 34rpx; height: 34rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #323232; color: #323232;
line-height: 34rpx; line-height: 34rpx;
.time { .time {
font-size: 28rpx; font-size: 28rpx;
font-family: Arial-BoldMT, Arial;
font-weight: normal; font-weight: normal;
color: #006ECF; color: #006ECF;
margin: 0 16rpx; margin: 0 16rpx;
...@@ -314,7 +306,6 @@ export default { ...@@ -314,7 +306,6 @@ export default {
text-align: center; text-align: center;
margin-top: 14rpx; margin-top: 14rpx;
font-size: 16rpx; font-size: 16rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #666666; color: #666666;
line-height: 22rpx; line-height: 22rpx;
...@@ -346,7 +337,6 @@ export default { ...@@ -346,7 +337,6 @@ export default {
height: 170rpx; height: 170rpx;
line-height: 170rpx; line-height: 170rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
display: flex; display: flex;
...@@ -383,7 +373,6 @@ export default { ...@@ -383,7 +373,6 @@ export default {
margin-bottom: 40rpx; margin-bottom: 40rpx;
height: 44rpx; height: 44rpx;
font-size: 32rpx; font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
line-height: 44rpx; line-height: 44rpx;
...@@ -411,7 +400,6 @@ export default { ...@@ -411,7 +400,6 @@ export default {
.goods-name { .goods-name {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #000000; color: #000000;
} }
...@@ -424,7 +412,6 @@ export default { ...@@ -424,7 +412,6 @@ export default {
margin-right: 10rpx; margin-right: 10rpx;
padding: 4rpx 6rpx; padding: 4rpx 6rpx;
font-size: 16rpx; font-size: 16rpx;
font-family: ArialMT;
color: #006ECF; color: #006ECF;
line-height: 24rpx; line-height: 24rpx;
display: inline-block; display: inline-block;
...@@ -434,7 +421,6 @@ export default { ...@@ -434,7 +421,6 @@ export default {
.desc-box { .desc-box {
display: flex; display: flex;
font-size: 20rpx; font-size: 20rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
line-height: 40rpx; line-height: 40rpx;
...@@ -449,10 +435,10 @@ export default { ...@@ -449,10 +435,10 @@ export default {
display: inline-block; display: inline-block;
height: 32rpx; height: 32rpx;
font-size: 24rpx; font-size: 24rpx;
font-family: Arial-BoldMT, Arial;
color: #EB5F17; color: #EB5F17;
line-height: 32rpx; line-height: 32rpx;
margin-right: 6rpx; margin-right: 6rpx;
font-weight: 800;
} }
.price { .price {
...@@ -460,7 +446,6 @@ export default { ...@@ -460,7 +446,6 @@ export default {
display: inline-block; display: inline-block;
height: 22rpx; height: 22rpx;
font-size: 20rpx; font-size: 20rpx;
font-family: ArialMT;
color: #666666; color: #666666;
line-height: 22rpx; line-height: 22rpx;
......
...@@ -89,8 +89,8 @@ export default { ...@@ -89,8 +89,8 @@ export default {
allchecked: true, allchecked: true,
// checked:true, // checked:true,
goods: [],//购物车商品信息 goods: [],//购物车商品信息
loginInfo:"", loginInfo: "",
imgPath: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.51yuansu.com%2Fpic3%2Fcover%2F01%2F82%2F40%2F596fa6dc00bb4_610.jpg&refer=http%3A%2F%2Fpic.51yuansu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633499781&t=d37222e32213957ddbdd01d62e071309' imgPath: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.51yuansu.com%2Fpic3%2Fcover%2F01%2F82%2F40%2F596fa6dc00bb4_610.jpg&refer=http%3A%2F%2Fpic.51yuansu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633499781&t=d37222e32213957ddbdd01d62e071309',
} }
}, },
created() { created() {
...@@ -128,9 +128,13 @@ export default { ...@@ -128,9 +128,13 @@ export default {
}, },
//跳转到结算 //跳转到结算
saveReserve(e) { saveReserve(e) {
if(this.totalPrice < 0 || this.totalNum <= 0) {
uni.showToast({ title: '请选择商品', icon: 'error' })
return;
}
let Authorization = uni.getStorageSync('Authorization'); let Authorization = uni.getStorageSync('Authorization');
let shopCarInfo = uni.getStorageSync('shopCarInfo').filter(v => v.flag == true); let shopCarInfo = uni.getStorageSync('shopCarInfo').filter(v => v.flag == true);
if (shopCarInfo && this.totalPrice > 0 && this.totalNum > 0) { if (shopCarInfo) {
if (Authorization) { if (Authorization) {
uni.navigateTo({ uni.navigateTo({
url: `/orderSubPackage/pages/settlement/index?buyType=1` url: `/orderSubPackage/pages/settlement/index?buyType=1`
...@@ -192,9 +196,10 @@ export default { ...@@ -192,9 +196,10 @@ export default {
this.goods.forEach(function (val) { this.goods.forEach(function (val) {
s += Number(val.num); s += Number(val.num);
}, 0); }, 0);
if (s >= 9) { let countOfOrder = uni.getStorageSync('countOfOrder');
if (s >= countOfOrder) {
uni.showToast({ uni.showToast({
title: '最多可一次购买9杯', title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none' icon: 'none'
}); });
return; return;
...@@ -211,7 +216,7 @@ export default { ...@@ -211,7 +216,7 @@ export default {
totalNum() { totalNum() {
let totalNum = 0; let totalNum = 0;
this.goods.map(item => { this.goods.map(item => {
item.flag ? totalNum += item.num : totalNum += 0 item.flag ? totalNum += parseInt(item.num) : totalNum += 0
}) })
return totalNum return totalNum
}, },
......
...@@ -191,11 +191,12 @@ export default { ...@@ -191,11 +191,12 @@ export default {
} }
}, },
addGood() { addGood() {
if (this.size < 9) { let countOfOrder = uni.getStorageSync('countOfOrder');
if (this.size < countOfOrder) {
this.size = this.size + 1; this.size = this.size + 1;
} else { } else {
uni.showToast({ uni.showToast({
title: '最多可一次购买9杯', title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none', icon: 'none',
}); });
} }
......
...@@ -15,12 +15,11 @@ ...@@ -15,12 +15,11 @@
<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">{{ orderStatusText }}</view>
</div> </div>
<canvas 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;" />
<div v-if="qrShow" class="flow_describe"> <div v-if="qrShow" class="flow_describe">
<h3>扫码流程 </h3> <h3>扫码流程</h3>
<image :mode="'aspectFit'" width="600px" class="flow_img" src="../../../static/imgs/order_flow.png"> <image :mode="'aspectFit'" class="flow_img" src="/static/imgs/order_flow.png"></image>
</image>
</div> </div>
<div class="shop_info"> <div class="shop_info">
<div class="address"> <div class="address">
...@@ -33,10 +32,7 @@ ...@@ -33,10 +32,7 @@
<image mode="aspectFit" v-if="jsonParse(item.goods.pics).thumbnailApplet" <image mode="aspectFit" v-if="jsonParse(item.goods.pics).thumbnailApplet"
:src="jsonParse(item.goods.pics).thumbnailApplet" class="goods_img"> :src="jsonParse(item.goods.pics).thumbnailApplet" class="goods_img">
</image> </image>
<image mode="aspectFit" v-else :src="jsonParse(item.goods.pics).thumbnail" <image mode="aspectFit" v-else :src="jsonParse(item.goods.pics).thumbnail" class="goods_img"></image>
class="goods_img">
</image>
<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>
...@@ -44,16 +40,17 @@ ...@@ -44,16 +40,17 @@
</div> </div>
<div class="goods_psce"> <div class="goods_psce">
<div class="psce_name"> <div class="psce_name">
<span v-for="rule in jsonParse(item.specRuleDetail)" :key="rule.specId"> <span v-for="(rule, index) in jsonParse(item.specRuleDetail)" :key="rule.specId">
{{ rule.ruleName }}/ {{ rule.ruleName }}
<text v-if="index != jsonParse(item.specRuleDetail).length - 1">/</text>
</span> </span>
</div> </div>
<div class="size">*{{ item.num }}</div> <div class="size">x{{ item.num }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="discount"> <!-- <div class="discount">
<div class="discount_1"> <div class="discount_1">
<div class="name">优惠免减</div> <div class="name">优惠免减</div>
<div class="price">¥{{ setPrice(item.amount - item.realAmount) }}</div> <div class="price">¥{{ setPrice(item.amount - item.realAmount) }}</div>
...@@ -62,10 +59,10 @@ ...@@ -62,10 +59,10 @@
<div class="name">特惠价</div> <div class="name">特惠价</div>
<div class="price">¥{{ setPrice(item.realAmount) }}</div> <div class="price">¥{{ setPrice(item.realAmount) }}</div>
</div> </div>
</div> </div> -->
</div> </div>
<div class="total"> <div class="total">
<div class="size">件商品</div> <div class="size">{{ totalNum }}件商品</div>
<div> <div>
<span class="paid_in">实付</span> <span class="paid_in">实付</span>
<span class="money">{{ setPrice(orderInfo.amount) }}</span> <span class="money">{{ setPrice(orderInfo.amount) }}</span>
...@@ -108,6 +105,7 @@ export default { ...@@ -108,6 +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));
this.ewmImg = '/static/imgs/noQr.png' this.ewmImg = '/static/imgs/noQr.png'
const isBuild = ['2', '3', '4', '5'].indexOf(this.orderInfo.state) != -1; const isBuild = ['2', '3', '4', '5'].indexOf(this.orderInfo.state) != -1;
...@@ -171,7 +169,6 @@ export default { ...@@ -171,7 +169,6 @@ export default {
} }
}) })
}, },
jsonParse(json) { jsonParse(json) {
return JSON.parse(json) return JSON.parse(json)
...@@ -183,6 +180,13 @@ export default { ...@@ -183,6 +180,13 @@ export default {
}, },
}, },
computed: { computed: {
totalNum() {
let totalNum = 0;
this.orderInfo.orderDetails.map(item => {
totalNum += parseInt(item.num);
})
return totalNum;
},
qrShow() { qrShow() {
console.log("order state:"+this.orderInfo.state); console.log("order state:"+this.orderInfo.state);
return ['2','3','4','5'].indexOf(this.orderInfo.state) != -1 return ['2','3','4','5'].indexOf(this.orderInfo.state) != -1
...@@ -253,8 +257,8 @@ export default { ...@@ -253,8 +257,8 @@ export default {
} }
.order_status { .order_status {
width: 686rpx; width: 590rpx;
max-height: 174rpx; // max-height: 174rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
margin: 32rpx auto 0; margin: 32rpx auto 0;
...@@ -273,8 +277,6 @@ export default { ...@@ -273,8 +277,6 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.btn { .btn {
...@@ -283,7 +285,8 @@ export default { ...@@ -283,7 +285,8 @@ export default {
background: #006ECF; background: #006ECF;
border-radius: 6rpx; border-radius: 6rpx;
display: inline-block; display: inline-block;
margin: 20rpx; margin: 0rpx 20rpx;
margin-top: 20rpx;
padding: 0; padding: 0;
line-height: 52rpx; line-height: 52rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
...@@ -295,10 +298,11 @@ export default { ...@@ -295,10 +298,11 @@ export default {
.btn_cancel { .btn_cancel {
width: 160rpx; width: 160rpx;
height: 52rpx; height: 52rpx;
border: 1rpx solid #CCCCCC; border: 1rpx solid #EEEEEE;
border-radius: 6rpx; border-radius: 6rpx;
display: inline-block; display: inline-block;
margin: 20rpx; margin: 0rpx 20rpx;
margin-top: 20rpx;
padding: 0; padding: 0;
line-height: 52rpx; line-height: 52rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
...@@ -313,7 +317,6 @@ export default { ...@@ -313,7 +317,6 @@ export default {
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
margin-top: 32rpx; margin-top: 32rpx;
padding-top: 65rpx;
.code { .code {
font-size: 36rpx; font-size: 36rpx;
...@@ -321,7 +324,7 @@ export default { ...@@ -321,7 +324,7 @@ export default {
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
text-align: center; text-align: center;
padding-top: 30rpx;
} }
.qr_code { .qr_code {
...@@ -351,15 +354,13 @@ export default { ...@@ -351,15 +354,13 @@ export default {
} }
.flow_describe { .flow_describe {
width: 686rpx; width: 590rpx;
height: 340rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(166, 166, 166, 0.5); box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(166, 166, 166, 0.5);
border-radius: 10rpx; border-radius: 10rpx;
margin: 0 auto; margin: 0 auto;
padding: 30rpx; padding: 30rpx;
margin-bottom: 10rpx;
h3 { h3 {
font-size: 28rpx; font-size: 28rpx;
...@@ -369,10 +370,9 @@ export default { ...@@ -369,10 +370,9 @@ export default {
} }
.flow_img { .flow_img {
width: 600rpx; width: 590rpx;
height: 214rpx; height: 211rpx;
display: block; display: block;
margin: 24rpx auto;
} }
} }
} }
...@@ -382,11 +382,9 @@ export default { ...@@ -382,11 +382,9 @@ export default {
background: #FFFFFF; background: #FFFFFF;
border-radius: 10rpx; border-radius: 10rpx;
margin: 0 auto; margin: 0 auto;
margin-top: 32rpx; padding: 0rpx 32rpx;
padding: 24rpx 32rpx;
box-sizing: border-box; box-sizing: border-box;
h3 { h3 {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
...@@ -395,10 +393,11 @@ export default { ...@@ -395,10 +393,11 @@ export default {
} }
.address { .address {
margin-top: 16rpx; padding-top: 20rpx;
border-bottom: 1rpx solid #EEEEEE;
padding-bottom: 20rpx;
.address_1 { .address_1 {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
...@@ -414,10 +413,8 @@ export default { ...@@ -414,10 +413,8 @@ export default {
} }
} }
.goods { .goods {
margin-top: 10rpx; padding-top: 20rpx;
padding-top: 15rpx;
.goods_item { .goods_item {
display: flex; display: flex;
...@@ -429,7 +426,7 @@ export default { ...@@ -429,7 +426,7 @@ export default {
height: 80rpx; height: 80rpx;
width: 80rpx; width: 80rpx;
background-color: #eee; background-color: #eee;
margin-right: 50rpx; margin-right: 30rpx;
} }
.goods_text { .goods_text {
...@@ -473,14 +470,12 @@ export default { ...@@ -473,14 +470,12 @@ export default {
margin-top: 10rpx; margin-top: 10rpx;
} }
} }
} }
.discount { .discount {
margin-top: 24rpx; margin-top: 24rpx;
padding-bottom: 24rpx; padding-bottom: 24rpx;
border-bottom: 1rpx solid #CCCCCC; border-bottom: 1rpx solid #EEEEEE;
.discount_1 { .discount_1 {
display: flex; display: flex;
...@@ -510,7 +505,6 @@ export default { ...@@ -510,7 +505,6 @@ export default {
margin-top: 18rpx; margin-top: 18rpx;
.price { .price {
font-family: Arial-BoldMT, Arial; font-family: Arial-BoldMT, Arial;
font-weight: 700; font-weight: 700;
color: #000; color: #000;
...@@ -524,6 +518,9 @@ export default { ...@@ -524,6 +518,9 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 52rpx; margin-top: 52rpx;
border-top: 1rpx solid #EEEEEE;
padding-bottom: 20rpx;
padding-top: 20rpx;
.size { .size {
font-size: 24rpx; font-size: 24rpx;
...@@ -561,7 +558,7 @@ export default { ...@@ -561,7 +558,7 @@ export default {
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
border-bottom: 1rpx solid #CCCCCC; border-bottom: 1rpx solid #EEEEEE;
} }
.item { .item {
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<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 class="address_2">距您{{ shopData.distance }},请确定门店后下单</div> <div v-if="shopData.distance" class="address_2">距您{{ shopData.distance }},请确定门店后下单</div>
<div v-else class="address_2">请确定门店后下单</div>
</div> </div>
<div class="take_order"> <div class="take_order">
<div class="title">取单时间</div> <div class="title">取单时间</div>
...@@ -26,7 +27,10 @@ ...@@ -26,7 +27,10 @@
</div> </div>
<div class="goods_psce"> <div class="goods_psce">
<div class="psce_name"> <div class="psce_name">
<span v-for="rule in item.sku.rules" :key="rule.ruleId">{{ rule.ruleName }}/</span> <span v-for="(rule,index) in item.sku.rules" :key="rule.ruleId">
{{ rule.ruleName }}
<span v-if="index!=item.sku.rules.length-1">/</span>
</span>
</div> </div>
<div class="size">x {{ item.num }}</div> <div class="size">x {{ item.num }}</div>
</div> </div>
...@@ -304,7 +308,7 @@ export default { ...@@ -304,7 +308,7 @@ export default {
.take_order { .take_order {
margin-top: 28rpx; margin-top: 28rpx;
padding-top: 28rpx; padding-top: 28rpx;
border-top: 1rpx solid #CCCCCC; border-top: 1rpx solid #EEEEEE;
.title { .title {
font-size: 28rpx; font-size: 28rpx;
...@@ -349,8 +353,8 @@ export default { ...@@ -349,8 +353,8 @@ export default {
.goods { .goods {
margin-top: 42rpx; margin-top: 42rpx;
border-bottom: 1rpx solid #CCCCCC; border-bottom: 1rpx solid #EEEEEE;
padding-bottom: 20rpx; padding-bottom: 30rpx;
.goods_item { .goods_item {
display: flex; display: flex;
...@@ -361,7 +365,7 @@ export default { ...@@ -361,7 +365,7 @@ export default {
height: 80rpx; height: 80rpx;
width: 80rpx; width: 80rpx;
background-color: #eee; background-color: #eee;
margin-right: 50rpx; margin-right: 30rpx;
} }
.goods_text { .goods_text {
...@@ -405,15 +409,12 @@ export default { ...@@ -405,15 +409,12 @@ export default {
margin-top: 10rpx; margin-top: 10rpx;
} }
} }
} }
.discount { .discount {
margin-top: 15rpx; margin-top: 15rpx;
padding-top: 15rpx; padding-top: 15rpx;
.discount_1 { .discount_1 {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -424,7 +425,6 @@ export default { ...@@ -424,7 +425,6 @@ export default {
color: #333333; color: #333333;
.price { .price {
font-family: Arial-BoldMT, Arial; font-family: Arial-BoldMT, Arial;
font-weight: normal; font-weight: normal;
color: #EB5F17; color: #EB5F17;
...@@ -455,7 +455,7 @@ export default { ...@@ -455,7 +455,7 @@ export default {
align-items: center; align-items: center;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 52rpx; margin-top: 30rpx;
.size { .size {
font-size: 24rpx; font-size: 24rpx;
...@@ -469,7 +469,6 @@ export default { ...@@ -469,7 +469,6 @@ export default {
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
} }
.money { .money {
......
...@@ -126,6 +126,12 @@ export default { ...@@ -126,6 +126,12 @@ export default {
getShopMenus(params) { getShopMenus(params) {
$EventBus.$off('getMenuList'); $EventBus.$off('getMenuList');
$EventBus.$on('getMenuList', (data) => { $EventBus.$on('getMenuList', (data) => {
console.log("shop:"+JSON.stringify(data));
if(this.shopInfo && this.shopInfo.id != data.id) {
// 切换店铺清空购物车
uni.removeStorageSync('shopCarInfo');
$EventBus.$emit('updateCar');
}
this.shopInfo = data; this.shopInfo = data;
this.getMenuList(data.id); this.getMenuList(data.id);
}); });
...@@ -228,9 +234,11 @@ export default { ...@@ -228,9 +234,11 @@ export default {
}, },
async getMenuList(id) { async getMenuList(id) {
let { data } = await Menu.getMenuList(id); let { data } = await Menu.getMenuList(id);
console.log("menus:"+JSON.stringify(data));
if (data.code == 200) { if (data.code == 200) {
data.data = data.data; data.data = data.data;
this.$store.commit('setMenuAllInfo', data.data); this.$store.commit('setMenuAllInfo', data.data);
uni.setStorageSync('countOfOrder', parseInt(data.data.countOfOrder));
this.$refs.MenuAssembly.createList(data.data.categorys) this.$refs.MenuAssembly.createList(data.data.categorys)
} }
}, },
......
...@@ -18,23 +18,7 @@ ...@@ -18,23 +18,7 @@
<h3 class="order_adrass">{{ item.shop.name }}</h3> <h3 class="order_adrass">{{ item.shop.name }}</h3>
<text class="order_time">{{ item.createdAt }}</text> <text class="order_time">{{ item.createdAt }}</text>
</view> </view>
<view class="order_status" v-if="item.state == 0">创建未校验</view> <view class="order_status">{{ getStateText(item.state) }}></view>
<view class="order_status" v-if="item.state == 1">未支付</view>
<view class="order_status" v-if="item.state == 2">待制作</view>
<view class="order_status" v-if="item.state == 3">制作中</view>
<view class="order_status" v-if="item.state == 4">待取餐</view>
<view class="order_status" v-if="item.state == 5">取餐中</view>
<view class="order_status" v-if="item.state == 6">已完成</view>
<view class="order_status" v-if="item.state == 7">待取超时</view>
<view class="order_status" v-if="item.state == 8">已取消</view>
<view class="order_status" v-if="item.state == 9">已取消</view>
<view class="order_status" v-if="item.state == 10">已取消</view>
<view class="order_status" v-if="item.state == 11">已取消</view>
<view class="order_status" v-if="item.state == 12">退款中</view>
<view class="order_status" v-if="item.state == 13">退款失败</view>
<view class="order_status" v-if="item.state == 14">部分退款</view>
<view class="order_status" v-if="item.state == 15">已退款</view>
<view class="order_status" v-if="item.state == 50">未知状态</view>
</view> </view>
<div class="order_content"> <div class="order_content">
<view> <view>
...@@ -102,26 +86,78 @@ export default { ...@@ -102,26 +86,78 @@ export default {
computed: { computed: {
userms() { userms() {
return this.$store.getters.Authorization; return this.$store.getters.Authorization;
}, }
}, },
methods: { methods: {
getStateText(state) {
state = '' + state;
switch (state) {
case '1':
return '未支付'
case '2':
return '待制作'
case '3':
return '制作中'
case '4':
return '待取餐'
case '5':
return '取餐中'
case '6':
return '已完成'
case '7':
return '待取超时'
case '8':
return '已取消'
case '9':
return '已取消'
case '10':
return '已取消'
case '11':
return '已取消'
case '12':
return '退款中'
case '13':
return '退款失败'
case '14':
return '部分退款'
case '15':
return '已退款'
default:
return '未知状态'
}
},
async oneMoreOrder(item) { async oneMoreOrder(item) {
// 清空购物车
uni.removeStorageSync('shopCarInfo'); uni.removeStorageSync('shopCarInfo');
$EventBus.$emit('updateCar'); $EventBus.$emit('updateCar');
//
const numObj = {} const numObj = {}
const { id, shopId, orderDetails } = item; const { id, shopId, orderDetails } = item;
orderDetails.forEach(item => { orderDetails.forEach(item => {
orderDetails[item.skuId] = item.num orderDetails[item.skuId] = item.num
}) })
const { data } = await order.moreOrder({ orderId: id, shopId }); const { data } = await order.moreOrder({ orderId: id, shopId });
if(!data || !data.data){
uni.showToast({ title: "该订单中的商品已经售罄了" });
return;
}
let list = new Array();
data.data.forEach(item => { data.data.forEach(item => {
const skuId = item.skus[0].skuId const skuId = item.skus[0].skuId
const nextData = { ...item, skuId, num: orderDetails[skuId], flag: true, sku: item.skus[0] } const nextData = { ...item, skuId, num: orderDetails[skuId], flag: true, sku: item.skus[0] }
if (nextData.sku.state == 1) { if (nextData.sku.state == 1) {
Utils.getallNum(nextData) list.push(nextData);
} }
}); });
uni.switchTab({ url: '/pages/menu/menu' }) if(!list || list.length<=0) {
uni.showToast({ title: "该订单中的商品已经售罄了", icon: 'error' });
return;
}
list.forEach(nextData => {
Utils.getallNum(nextData);
})
uni.switchTab({ url: '/pages/menu/menu' });
}, },
async getList() { async getList() {
if (!this.userms) return if (!this.userms) return
......
...@@ -47,9 +47,10 @@ export default { ...@@ -47,9 +47,10 @@ export default {
let shopCarInfo = uni.getStorageSync('shopCarInfo') || []; let shopCarInfo = uni.getStorageSync('shopCarInfo') || [];
let size = 0; let size = 0;
shopCarInfo.forEach((item) => (size += item.num)); shopCarInfo.forEach((item) => (size += item.num));
if (size >= 9) { let countOfOrder = uni.getStorageSync('countOfOrder');
if (size >= countOfOrder) {
uni.showToast({ uni.showToast({
title: '最多可一次购买9杯', title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none', icon: 'none',
}); });
return false; return false;
...@@ -77,9 +78,10 @@ export default { ...@@ -77,9 +78,10 @@ export default {
let goodsList = []; let goodsList = [];
let size = 0; let size = 0;
goodsList.forEach((item) => (size += item.num)); goodsList.forEach((item) => (size += item.num));
if (size >= 9) { let countOfOrder = uni.getStorageSync('countOfOrder');
if (size >= countOfOrder) {
uni.showToast({ uni.showToast({
title: '最多可一次购买9杯', title: '最多可一次购买'+countOfOrder+'杯',
icon: 'none', icon: 'none',
}); });
return false; return false;
......
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