Commit c9598a8f by songbingqi

完成下单页面字段调整

parent e8d508a0
......@@ -43,11 +43,20 @@ export default {
}
},
async toRead(item) {
const { id } = item
const { id,targetId,type } = item
const res = await Mine.read({ id, isRead: 2 })
if (res) {
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() {
uni.switchTab({ url: '/pages/menu/menu' });
......
......@@ -76,6 +76,14 @@
</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="size">{{ totalNum }}件商品</div>
<div class="price">
......@@ -704,6 +712,10 @@ export default {
}
}
}
.goods:last-child {
border-bottom: 1rpx solid #EEEEEE;
padding-bottom: 30rpx;
}
.discount {
margin-top: 24rpx;
......@@ -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 {
display: flex;
align-items: center;
display: flex;
justify-content: space-between;
margin-top: 32rpx;
border-top: 1rpx solid #EEEEEE;
padding-top: 23rpx;
// margin-top: 32rpx;
padding-top: 24rpx;
.size {
height: 40rpx;
line-height: 52rpx;
line-height: 40rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
......
......@@ -41,7 +41,7 @@
<div class="coupon" @click="goCouponSelect">
<div class="title">HOOLOO券</div>
<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>
<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'" />
......@@ -95,6 +95,8 @@ import User from '@/request/user'
import Order from '@/request/order'
export default {
onShow() {
if (this.goods) {
Order.getWaitTine({
shopId: uni.getStorageSync('shopData').id,
......@@ -107,8 +109,11 @@ export default {
this.TermsStatus = uni.getStorageSync('TermsStatus') || false
},
onLoad(option) {
console.log(123)
// 清除优惠卷信息
this.$store.commit("cleanInfo")
this.$store.commit("cleanInfo",{})
if(!this.userms){
User.wxLoginAndGetOpenid(true).then(loginInfo=>{
......@@ -184,12 +189,8 @@ export default {
}
},
computed: {
selectPrice() {
const data = this.$store.state.order.selectTicket.couponAmount
return data
},
selectCouponId() {
const data = this.$store.state.order.selectTicket.id
selectCoupon() {
const data = this.$store.state.order.selectTicket
return data
},
userms() {
......@@ -217,6 +218,16 @@ export default {
})
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() {
let totalPrice = 0;
......@@ -225,7 +236,7 @@ export default {
item.flag ? totalPrice += (item.num * sku.discount) : (totalPrice += 0)
})
totalPrice-=this.selectPrice||0
totalPrice-=this.selectCoupon.couponAmount||0
return totalPrice.toFixed(2)
}
......@@ -336,15 +347,21 @@ export default {
let res = await Utils.AssemblyOrder(this.shopData, this.totalPrice, this.totalNum, this.buyType, list);
if (res) {
const {amount,...resule} = res
const sendData = {
...res,
couponId:this.selectCouponId||'',
...resule,
amount:this.amountOld,
paidAmount:amount,
lat,
lng,
sendMsgFlag1,
sendMsgFlag2,
sendMsgFlag3
}
if(JSON.stringify(this.selectCoupon)!="{}"){
sendData.couponId = this.selectCoupon.id||'',
sendData.couponAmount = this.selectCoupon.couponAmount||0
}
let orderInfo = await Menu.saveReserve(sendData);
if (orderInfo && orderInfo.data.code == 200) {
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