Commit c9598a8f by songbingqi

完成下单页面字段调整

parent e8d508a0
...@@ -43,11 +43,20 @@ export default { ...@@ -43,11 +43,20 @@ export default {
} }
}, },
async toRead(item) { async toRead(item) {
const { id } = item const { id,targetId,type } = item
const res = await Mine.read({ id, isRead: 2 }) const res = await Mine.read({ id, isRead: 2 })
if (res) { if (res) {
this.getList() this.getList()
} }
if(type==1) {
uni.setStorageSync('orderId', targetId);
let url = '/orderSubPackage/pages/orderInfo/index'
uni.navigateTo({ url })
} else {
let url = '/mineSubPackage/pages/coupon/index'
uni.navigateTo({ url })
}
}, },
goHome() { goHome() {
uni.switchTab({ url: '/pages/menu/menu' }); uni.switchTab({ url: '/pages/menu/menu' });
......
...@@ -76,6 +76,14 @@ ...@@ -76,6 +76,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="coupon" v-if="orderInfo.couponAmount">
<div class="title">HOOLOO券</div>
<div class="num-action">
<span class="price">-¥{{orderInfo.couponAmount}}</span>
</div>
</div>
<div class="total"> <div class="total">
<div class="size">{{ totalNum }}件商品</div> <div class="size">{{ totalNum }}件商品</div>
<div class="price"> <div class="price">
...@@ -704,6 +712,10 @@ export default { ...@@ -704,6 +712,10 @@ export default {
} }
} }
} }
.goods:last-child {
border-bottom: 1rpx solid #EEEEEE;
padding-bottom: 30rpx;
}
.discount { .discount {
margin-top: 24rpx; margin-top: 24rpx;
...@@ -745,18 +757,74 @@ export default { ...@@ -745,18 +757,74 @@ export default {
} }
} }
.coupon {
display: flex;
align-items: center;
display: flex;
justify-content: space-between;
margin-top: 24rpx;
padding-bottom: 23.57rpx;
border-bottom: 1rpx solid #EEEEEE;
.title {
font-size: 28rpx;
font-family: ArialMT;
color: #333333;
height: 40rpx;
line-height: 40rpx;
}
.num {
font-size: 28rpx;
height: 40rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 500;
display: flex;
align-items: center;
color: #999999;
height: 40rpx;
line-height: 40rpx;
.price {
font-family: Futura-Medium, Futura;
}
.arrow-right-select{
width: 15.27rpx;
height: 19.68rpx;
margin-left: 8rpx;
}
}
.num-action {
font-size: 28rpx;
height: 40rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
display: flex;
align-items: center;
color: #FF63BA;
height: 40rpx;
line-height: 40rpx;
.price{
font-family: Futura-Medium, Futura;
}
.arrow-right-select{
width: 15.27rpx;
height: 19.68rpx;
margin-left: 8rpx;
}
}
}
.total { .total {
display: flex; display: flex;
align-items: center; align-items: center;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 32rpx; // margin-top: 32rpx;
border-top: 1rpx solid #EEEEEE; padding-top: 24rpx;
padding-top: 23rpx;
.size { .size {
height: 40rpx; height: 40rpx;
line-height: 52rpx; line-height: 40rpx;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<div class="coupon" @click="goCouponSelect"> <div class="coupon" @click="goCouponSelect">
<div class="title">HOOLOO券</div> <div class="title">HOOLOO券</div>
<div :class="[ticketNum>0?'num-action':'num']"> <div :class="[ticketNum>0?'num-action':'num']">
<span v-if="selectPrice" class="price">-¥{{selectPrice}}</span> <span v-if="selectCoupon.couponAmount" class="price">-¥{{selectCoupon.couponAmount}}</span>
<span v-else>{{ticketNum>0?ticketNum+'张可用':'暂无可用优惠'}}</span> <span v-else>{{ticketNum>0?ticketNum+'张可用':'暂无可用优惠'}}</span>
<image v-if="!ticketNum>0" class="arrow-right-select" :src="'../../../static/imgs/jiantouhei.png'" /> <image v-if="!ticketNum>0" class="arrow-right-select" :src="'../../../static/imgs/jiantouhei.png'" />
<image v-else class="arrow-right-select" :src="'../../../static/imgs/jiantoufen.jpg'" /> <image v-else class="arrow-right-select" :src="'../../../static/imgs/jiantoufen.jpg'" />
...@@ -95,6 +95,8 @@ import User from '@/request/user' ...@@ -95,6 +95,8 @@ import User from '@/request/user'
import Order from '@/request/order' import Order from '@/request/order'
export default { export default {
onShow() { onShow() {
if (this.goods) { if (this.goods) {
Order.getWaitTine({ Order.getWaitTine({
shopId: uni.getStorageSync('shopData').id, shopId: uni.getStorageSync('shopData').id,
...@@ -107,8 +109,11 @@ export default { ...@@ -107,8 +109,11 @@ export default {
this.TermsStatus = uni.getStorageSync('TermsStatus') || false this.TermsStatus = uni.getStorageSync('TermsStatus') || false
}, },
onLoad(option) { onLoad(option) {
console.log(123)
// 清除优惠卷信息 // 清除优惠卷信息
this.$store.commit("cleanInfo") this.$store.commit("cleanInfo",{})
if(!this.userms){ if(!this.userms){
User.wxLoginAndGetOpenid(true).then(loginInfo=>{ User.wxLoginAndGetOpenid(true).then(loginInfo=>{
...@@ -184,12 +189,8 @@ export default { ...@@ -184,12 +189,8 @@ export default {
} }
}, },
computed: { computed: {
selectPrice() { selectCoupon() {
const data = this.$store.state.order.selectTicket.couponAmount const data = this.$store.state.order.selectTicket
return data
},
selectCouponId() {
const data = this.$store.state.order.selectTicket.id
return data return data
}, },
userms() { userms() {
...@@ -217,6 +218,16 @@ export default { ...@@ -217,6 +218,16 @@ export default {
}) })
return (price - discountNum).toFixed(2) return (price - discountNum).toFixed(2)
}, },
amountOld() {
let totalPrice = 0;
this.goods.forEach(item => {
const sku = item.sku;
item.flag ? totalPrice += (item.num * sku.discount) : (totalPrice += 0)
})
return totalPrice.toFixed(2)
},
totalPrice() { totalPrice() {
let totalPrice = 0; let totalPrice = 0;
...@@ -225,7 +236,7 @@ export default { ...@@ -225,7 +236,7 @@ export default {
item.flag ? totalPrice += (item.num * sku.discount) : (totalPrice += 0) item.flag ? totalPrice += (item.num * sku.discount) : (totalPrice += 0)
}) })
totalPrice-=this.selectPrice||0 totalPrice-=this.selectCoupon.couponAmount||0
return totalPrice.toFixed(2) return totalPrice.toFixed(2)
} }
...@@ -336,15 +347,21 @@ export default { ...@@ -336,15 +347,21 @@ export default {
let res = await Utils.AssemblyOrder(this.shopData, this.totalPrice, this.totalNum, this.buyType, list); let res = await Utils.AssemblyOrder(this.shopData, this.totalPrice, this.totalNum, this.buyType, list);
if (res) { if (res) {
const {amount,...resule} = res
const sendData = { const sendData = {
...res, ...resule,
couponId:this.selectCouponId||'', amount:this.amountOld,
paidAmount:amount,
lat, lat,
lng, lng,
sendMsgFlag1, sendMsgFlag1,
sendMsgFlag2, sendMsgFlag2,
sendMsgFlag3 sendMsgFlag3
} }
if(JSON.stringify(this.selectCoupon)!="{}"){
sendData.couponId = this.selectCoupon.id||'',
sendData.couponAmount = this.selectCoupon.couponAmount||0
}
let orderInfo = await Menu.saveReserve(sendData); let orderInfo = await Menu.saveReserve(sendData);
if (orderInfo && orderInfo.data.code == 200) { if (orderInfo && orderInfo.data.code == 200) {
await Menu.requestPayment(orderInfo.data.data, res, this.buyType); await Menu.requestPayment(orderInfo.data.data, res, this.buyType);
......
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