|
|
@ -76,10 +76,11 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="new-box" v-for="(sku,index) in info.goods" :key="index"> |
|
|
|
<view class="box shop-name text-overflow"> |
|
|
|
店家名称店家名称店家名称店家名称店家名称店家名称店家名称 |
|
|
|
|
|
|
|
<template v-for="(merchantGroup,merchantIndex) in orderGoods"> |
|
|
|
<view class="new-box" v-for="(sku,index) in merchantGroup" :key="index"> |
|
|
|
<view class="box shop-name text-overflow" v-if="sku.goodsInfo.merchant_name"> |
|
|
|
{{sku.goodsInfo.merchant_name}} |
|
|
|
</view> |
|
|
|
<view class="commodity box"> |
|
|
|
<image class="img" :src="showImg(sku.goodsInfo.image)" mode="aspectFill"></image> |
|
|
@ -110,19 +111,24 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<view class="post top-line flex-between" v-show="sku.info.is_post===1"> |
|
|
|
<view class="post top-line flex-between" v-show="info.is_post==1"> |
|
|
|
<view class=""> |
|
|
|
运费 |
|
|
|
</view> |
|
|
|
<view style="font-weight: 500;" > |
|
|
|
{{sku.post==0?'免邮':sku.post/100}} |
|
|
|
{{!sku.post?'免邮':sku.post/100}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="remark top-line"> |
|
|
|
<view class="remark-title" >订单备注:</view> |
|
|
|
<input style="z-index:0;text-align: right;" type="text" placeholder="选填" v-model="sku.skuInfo.remark" maxlength="50"/> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<view class="tickets-box flex-between"> |
|
|
|
<view class="remark"> |
|
|
|
<view class="remark-title" >订单备注:</view> |
|
|
|
<input style="z-index:0;text-align: right;" type="text" placeholder="选填" v-model="remark" maxlength="50"/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 优惠券 --> |
|
|
@ -217,6 +223,9 @@ export default { |
|
|
|
contacts: null, |
|
|
|
info: null,//规格的信息 |
|
|
|
detail:null,//商品的信息 |
|
|
|
|
|
|
|
orderGoods: [], |
|
|
|
|
|
|
|
post: 0, |
|
|
|
flag: true, |
|
|
|
addressList: [], |
|
|
@ -241,6 +250,7 @@ export default { |
|
|
|
this.$store.commit("choseCoupon", ""); |
|
|
|
this.info = JSON.parse(uni.getStorageSync('teChanOrder')); |
|
|
|
|
|
|
|
|
|
|
|
if (!this.info) { |
|
|
|
uni.navigateBack(); |
|
|
|
return |
|
|
@ -252,6 +262,7 @@ export default { |
|
|
|
this.isPost = this.info.is_post || "1" |
|
|
|
// this.info.is_post = this.isPost==3?1:this.isPost |
|
|
|
} |
|
|
|
this.handleOrderGoods() |
|
|
|
console.log(this.isPost) |
|
|
|
}, |
|
|
|
onShow() { |
|
|
@ -274,6 +285,27 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleOrderGoods () { |
|
|
|
let merchantArray = new Set(this.info.goods.map(v=>v.goodsInfo.merchant_name)) |
|
|
|
this.orderGoods = [] |
|
|
|
merchantArray.forEach(x=>{ |
|
|
|
// let tempArray = this.info.goods.filter(v=>v.goodsInfo.merchant_name==x) |
|
|
|
// this.orderGoods.push(tempArray) |
|
|
|
|
|
|
|
// 不用filter 用for循环一个个找 可以用引用对象地址修改this.info的goods 这样下面的代码不用改 |
|
|
|
let tempArray = [] |
|
|
|
this.info.goods.forEach(v=>{ |
|
|
|
if(v.goodsInfo.merchant_name == x) { |
|
|
|
tempArray.push(v) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.orderGoods.push(tempArray) |
|
|
|
|
|
|
|
}) |
|
|
|
console.log(this.orderGoods) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
goOrderCoupon () { |
|
|
|
let allPrice = 0 |
|
|
|
let skuIds= [] |
|
|
@ -354,6 +386,7 @@ export default { |
|
|
|
if (this.flag) { |
|
|
|
this.getPost(); |
|
|
|
} |
|
|
|
this.handleOrderGoods() |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
@ -492,7 +525,6 @@ export default { |
|
|
|
let goodsItem = { |
|
|
|
specifications_id: v.skuInfo.id, |
|
|
|
num: v.skuInfo.buyNum, |
|
|
|
remark: v.skuInfo.remark |
|
|
|
// consignee_id: this.info.is_post == 1 ? this.contacts.id : null |
|
|
|
}; |
|
|
|
|
|
|
@ -1152,7 +1184,7 @@ view { |
|
|
|
min-height: 120rpx; |
|
|
|
background: #ffffff; |
|
|
|
margin: 0 auto; |
|
|
|
border-radius: 0 0 14rpx 14rpx; |
|
|
|
border-radius: 14rpx; |
|
|
|
.remark-title{ |
|
|
|
|
|
|
|
font-size: 31rpx; |
|
|
@ -1194,7 +1226,7 @@ view { |
|
|
|
.new-box{ |
|
|
|
background: #fff; |
|
|
|
width: 698rpx; |
|
|
|
margin: 0 auto; |
|
|
|
margin: 0 auto 20rpx; |
|
|
|
border-radius: 14rpx; |
|
|
|
} |
|
|
|
|
|
|
|