|
|
@@ -14,7 +14,7 @@
|
|
|
<view class="module-com">
|
|
|
<view class="commodity-view">
|
|
|
<view class="commodity-list">
|
|
|
- <view class="commodity-item" v-for="(item, index) in list" :key="index">
|
|
|
+ <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
|
|
|
<image class="item-icon" :src="item.cover" alt="" />
|
|
|
<view class="item-info">
|
|
|
<view class="info-line">
|
|
|
@@ -37,15 +37,29 @@
|
|
|
</view>
|
|
|
<view class="summary-bar">
|
|
|
<view class="operate-view" @click="gobackEvent">
|
|
|
- <text class="iconfont icongouwuche"></text>修改花材
|
|
|
+ <text class="iconfont icongouwuche"></text>返回修改
|
|
|
</view>
|
|
|
- <view class="describe-view">共{{ allCountFun.bigLength }}扎,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
|
|
|
+ <view class="describe-view">共{{ allCountFun.bigLength }}扎,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="module-com input-line-wrap">
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <button class="admin-button-com big" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(0)">有车到店</button>
|
|
|
+ <button class="admin-button-com big" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(1)">上门自取</button>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view v-if="form.sendType == 0">
|
|
|
+ <text style="color: #3385FF;width:100%;">本店有出车到您店,请选此项,免配送费</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="form.sendType == 1">
|
|
|
+ <text style="color: #3385FF;width:100%;">您自己来店里取花,没有配送费</text>
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true">
|
|
|
<view class="tui-title ">配送时间</view>
|
|
|
<picker mode="date" :value="sendTimeWant" @change="bindDateChange" style="width:400upx;">
|
|
|
@@ -54,27 +68,6 @@
|
|
|
</picker>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
- <view class="tui-title">花材(预付)</view>
|
|
|
- <text style="color: #3385FF">¥{{ parseFloat(productPrice) }}</text>
|
|
|
- </tui-list-cell>
|
|
|
-
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
- <view class="tui-title">重量(公斤)</view>
|
|
|
- <text style="color: #3385FF">
|
|
|
- {{ currentWeight }}
|
|
|
- <text v-if="currentWeight < miniKilo" style="margin-left:16upx;color:#CCCCCC;font-size:24upx;">不足{{miniKilo}}KG按{{miniKilo}}KG算</text>
|
|
|
- <text style="margin-left:16upx;color:#CCCCCC;font-size:24upx;">{{parseFloat(kiloFee)}}元/公斤</text>
|
|
|
- </text>
|
|
|
- </tui-list-cell>
|
|
|
-
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
- <view class="tui-title">服务费</view>
|
|
|
- <text style="color: #3385FF">
|
|
|
- ¥{{ totalFee }}
|
|
|
- </text>
|
|
|
- </tui-list-cell>
|
|
|
-
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
<view class="tui-title">合计</view>
|
|
|
<text style="color: #3385FF">¥{{ modifyPrice }}</text>
|
|
|
@@ -148,11 +141,11 @@ export default {
|
|
|
receiveAddress: "",
|
|
|
receiveLong: "",
|
|
|
receiveLat: "",
|
|
|
- sendType: 2,
|
|
|
- sendSide: "2",
|
|
|
+ sendType: 0,
|
|
|
sendDate: "",
|
|
|
sendTimeWant: "",
|
|
|
- sendCost: "",
|
|
|
+ sendCost: 0,
|
|
|
+ packCost:0,
|
|
|
customId: "",
|
|
|
product: "",
|
|
|
hbId: '0'
|
|
|
@@ -160,19 +153,8 @@ export default {
|
|
|
showCustomer: false,
|
|
|
today:'',
|
|
|
monthLater:'',
|
|
|
- modifyPrice:0,
|
|
|
hasHb:0,
|
|
|
- selectedHb:{couponAmount:0,hbId:0,couponSelInx:0},
|
|
|
- currentWeight:0,
|
|
|
- //预订单最低公斤数
|
|
|
- miniKilo:0,
|
|
|
- //用于计算的重量
|
|
|
- calcWeight:0,
|
|
|
- //每公斤服务费
|
|
|
- kiloFee:0,
|
|
|
- //总服务费
|
|
|
- totalFee:0,
|
|
|
- productPrice:0
|
|
|
+ selectedHb:{couponAmount:0,hbId:0,couponSelInx:0}
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
@@ -180,62 +162,30 @@ export default {
|
|
|
},
|
|
|
onShow() {
|
|
|
|
|
|
- this.miniKilo = this.option.miniKilo || 0
|
|
|
- this.kiloFee = this.option.kiloFee || 0
|
|
|
-
|
|
|
- let selectList = this.$util.copyObject(this.selectList);
|
|
|
- let list = [];
|
|
|
- if (!this.$util.isEmpty(selectList)){
|
|
|
- for (let i=0;i<selectList.length;i++){
|
|
|
- if(list==''){
|
|
|
- list.push(selectList[i])
|
|
|
- }else{
|
|
|
- let has = false
|
|
|
- list.map(res=>{
|
|
|
- if(res.id == selectList[i].id){
|
|
|
- res.bigCount = (res.bigCount+selectList[i].bigCount)
|
|
|
- res.smallCount = (res.smallCount+selectList[i].smallCount)
|
|
|
- has = true
|
|
|
- }
|
|
|
- })
|
|
|
- if(has == false){
|
|
|
- list.push(selectList[i])
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getMerchantInfo", "getLoginInfo"]),
|
|
|
+ modifyPrice(){
|
|
|
+ let allPrice = this.allPrice.toFixed(2)
|
|
|
+ let price = Number(allPrice)
|
|
|
+ if(this.form.sendType == 2){
|
|
|
+ price = price + this.form.sendCost
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- //计算重量
|
|
|
- this.currentWeight = 0
|
|
|
- for (let i=0;i<list.length;i++){
|
|
|
- let small = Number(list[i].smallCount) / Number(list[i].ratio)
|
|
|
- small = small.toFixed(2)
|
|
|
- let count = Number(small) + Number(list[i].bigCount)
|
|
|
- count = count.toFixed(2)
|
|
|
- let thisWeight = Number(list[i].weight)*Number(count)
|
|
|
- thisWeight = thisWeight.toFixed(2)
|
|
|
- this.currentWeight = Number(this.currentWeight) + Number(thisWeight)
|
|
|
- this.currentWeight = parseFloat(this.currentWeight.toFixed(2))
|
|
|
+ if(this.form.sendType == 2 || this.form.sendType == 0){
|
|
|
+ price = price + this.form.packCost
|
|
|
}
|
|
|
- this.calcWeight = Number(this.currentWeight) > Number(this.miniKilo) ? Number(this.currentWeight) : Number(this.miniKilo)
|
|
|
- this.totalFee = Number(this.calcWeight) * Number(this.kiloFee)
|
|
|
- this.totalFee = parseFloat(this.totalFee.toFixed(2))
|
|
|
+ price = parseFloat(price)
|
|
|
+ return price
|
|
|
}
|
|
|
- this.list = list;
|
|
|
-
|
|
|
- this.productPrice = this.allPrice.toFixed(2)
|
|
|
- this.modifyPrice = Number(this.productPrice) + Number(this.totalFee)
|
|
|
- this.modifyPrice = parseFloat(this.modifyPrice.toFixed(2))
|
|
|
-
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters(["getMerchantInfo", "getLoginInfo"])
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
init() {
|
|
|
this._getDet()
|
|
|
},
|
|
|
+ changeSendType(num){
|
|
|
+ this.form.sendType = num
|
|
|
+ },
|
|
|
bindDateChange(e){
|
|
|
let date = e.detail.value
|
|
|
this.sendTimeWant = date
|
|
|
@@ -309,14 +259,17 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
affirmFormSubmit(){
|
|
|
- const product = this.list.map(ele => {
|
|
|
+ const product = this.selectList.map(ele => {
|
|
|
return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
|
|
|
});
|
|
|
+ if (this.$util.isEmpty(product)){
|
|
|
+ this.$msg('请选择花材')
|
|
|
+ return false
|
|
|
+ }
|
|
|
if(this.sendTimeWant==''){
|
|
|
this.$msg('请选择配送时间')
|
|
|
return false
|
|
|
}
|
|
|
-
|
|
|
let xj = []
|
|
|
this.selectList.forEach((item) => {
|
|
|
let hasItem = uni.getStorageSync("ghsColorItem"+this.ghsInfo.id+"_"+item.itemId)
|
|
|
@@ -324,11 +277,10 @@ export default {
|
|
|
xj.push(hasItem)
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
let params = {
|
|
|
- getType:this.form.sendType,
|
|
|
+ sendType:this.form.sendType,
|
|
|
sendTimeWant:this.sendTimeWant,
|
|
|
- sendCost:this.form.sendType==2?'':this.form.sendCost,
|
|
|
+ sendCost:0,
|
|
|
remark:this.remark,
|
|
|
product:JSON.stringify(product),
|
|
|
ghsId:this.ghsInfo.id,
|
|
|
@@ -411,9 +363,7 @@ export default {
|
|
|
} else {
|
|
|
this.$msg(checkRes);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- console.log(999999, error);
|
|
|
- }
|
|
|
+ } catch (error) { }
|
|
|
},
|
|
|
gobackEvent() {
|
|
|
this.$util.pageTo({url: "/pagesPurchase/bookProduct",query: {id:this.options.id},type: 2})
|
|
|
@@ -496,12 +446,12 @@ export default {
|
|
|
border-top: 1px solid #eeeeee;
|
|
|
.operate-view {
|
|
|
display: flex;
|
|
|
-
|
|
|
align-items: center;
|
|
|
color: #3385ff;
|
|
|
- font-size: 26upx;
|
|
|
+ font-size: 30upx;
|
|
|
+ font-weight:bold;
|
|
|
.iconfont {
|
|
|
- margin-right: 20upx;
|
|
|
+ margin-right:16upx;
|
|
|
font-size: 40upx;
|
|
|
}
|
|
|
}
|