|
|
@@ -167,18 +167,18 @@
|
|
|
<form>
|
|
|
<view class="module-com">
|
|
|
<view class="flex-space ghs-msg">
|
|
|
- {{ghsMsg.name}} {{ ghsMsg.mobile }}
|
|
|
- <i class="iconfont icondianhua1" @tap="toPhone(ghsMsg.mobile)"></i>
|
|
|
+ {{ghsInfo.name}} {{ ghsInfo.mobile }}
|
|
|
+ <i class="iconfont icondianhua1" @tap="toPhone(ghsInfo.mobile)"></i>
|
|
|
</view>
|
|
|
<view class="flex ghs-msg active">
|
|
|
- {{ ghsMsg.fullAddress }}
|
|
|
+ {{ ghsInfo.fullAddress }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="module-com">
|
|
|
<view class="commodity-view">
|
|
|
<view class="commodity-list">
|
|
|
<view class="commodity-item" v-for="(item, index) in list" :key="index">
|
|
|
- <image class="item-icon" :src="item.cover" alt="商品图" />
|
|
|
+ <image class="item-icon" :src="item.cover" alt="" />
|
|
|
<view class="item-info">
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ item.itemName }}</text>
|
|
|
@@ -203,11 +203,7 @@
|
|
|
<text class="iconfont icongouwuche"></text>
|
|
|
重选花材
|
|
|
</view>
|
|
|
- <view class="describe-view">
|
|
|
- 共{{ allCountFun.bigLength }}/{{ allCountFun.smallLength }}种,
|
|
|
- <!-- 共16扎9支, -->
|
|
|
- 合计 ¥<text class="price">{{ allPriceFun }}</text>
|
|
|
- </view>
|
|
|
+ <view class="describe-view">共{{ allCountFun.bigLength }}/{{ allCountFun.smallLength }}种,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -243,6 +239,21 @@
|
|
|
</tui-list-cell>
|
|
|
-->
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <view class="tui-title">总金额</view>
|
|
|
+ <text style="color: #3385FF">{{ parseFloat(allPrice.toFixed(2)) }}</text>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="ghsInfo.giveDiscount && ghsInfo.giveDiscount < 1" >
|
|
|
+ <view class="tui-title">优惠</view>
|
|
|
+ <text style="color: red">-{{discountAmount}}<text style="margin-left:18rpx;">({{ghsInfo.giveDiscount*100}}折)</text></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>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<textarea style="height: 100rpx" v-model="remark" placeholder="这里写备注"/>
|
|
|
</tui-list-cell>
|
|
|
@@ -252,18 +263,11 @@
|
|
|
</view>
|
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
|
- <text class="price-title">总金额</text>
|
|
|
- <text class="price-number">
|
|
|
- ¥
|
|
|
- <text class="large" v-if="form.sendType==1 && !couponSumText">{{ numberAdd(allPrice, Number(form.sendCost)) }}</text>
|
|
|
- <text class="large" v-else-if="form.sendType==1 && couponSumText">{{ (allPrice + Number(form.sendCost) - Number(couponSumText)).toFixed(2) }}</text>
|
|
|
- <text class="large" v-else-if="form.sendType==2 && !couponSumText">{{ allPrice}}</text>
|
|
|
- <text class="large" v-else-if="form.sendType==2 && couponSumText">{{ NumberSub(allPrice, Number(couponSumText))}}</text>
|
|
|
- </text>
|
|
|
+ <text class="price-title">金额</text>
|
|
|
+ <text class="price-number">¥<text class="large">{{ modifyPrice}}</text></text>
|
|
|
</view>
|
|
|
<button class="admin-button-com blue middle" @click="affirmFormSubmit">提交</button>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -306,7 +310,7 @@ export default {
|
|
|
return {
|
|
|
list:[],
|
|
|
autoLoad: false,
|
|
|
- ghsMsg:'',
|
|
|
+ ghsInfo:'',
|
|
|
sendTimeWant:'',
|
|
|
remark:'',
|
|
|
form: {
|
|
|
@@ -332,7 +336,9 @@ export default {
|
|
|
couponSumText: '',
|
|
|
couponText: '',
|
|
|
today:'',
|
|
|
- monthLater:''
|
|
|
+ monthLater:'',
|
|
|
+ modifyPrice:0,
|
|
|
+ discountAmount:0
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
@@ -348,10 +354,8 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
this.getGhsData(e.id);
|
|
|
-
|
|
|
},
|
|
|
onShow() {
|
|
|
- console.log(this.selectList,'selectList')
|
|
|
let selectList = this.$util.copyObject(this.selectList);
|
|
|
let list = [];
|
|
|
for (let i=0;i<selectList.length;i++){
|
|
|
@@ -372,7 +376,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.list = list;
|
|
|
- console.log(list,'list')
|
|
|
if(uni.getStorageSync('selectCouponInfo').couponSum) {
|
|
|
this.couponSumText = uni.getStorageSync('selectCouponInfo').couponSum
|
|
|
this.couponText = '-¥' + this.couponSumText
|
|
|
@@ -388,8 +391,17 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
+ calcPrice(){
|
|
|
+ let allPrice = this.allPrice.toFixed(2)
|
|
|
+ if(this.ghsInfo.giveDiscount && this.ghsInfo.giveDiscount < 1){
|
|
|
+ this.discountAmount = ((1-Number(this.ghsInfo.giveDiscount))*allPrice).toFixed(2)
|
|
|
+ this.discountAmount = parseFloat(this.discountAmount)
|
|
|
+ }
|
|
|
+ this.modifyPrice = (Number(allPrice) - Number(this.discountAmount)).toFixed(2)
|
|
|
+ this.modifyPrice = parseFloat(this.modifyPrice)
|
|
|
+ },
|
|
|
init() {
|
|
|
- this._getDet();
|
|
|
+ this._getDet()
|
|
|
},
|
|
|
bindDateChange(e){
|
|
|
let date = e.detail.value;
|
|
|
@@ -402,23 +414,23 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
toCoupon() {
|
|
|
- let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
|
|
|
- console.log(amount)
|
|
|
- this.pageTo({url: '/admin/coupon/selectCouponList?price=' + amount})
|
|
|
+ let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
|
|
|
+ console.log(amount)
|
|
|
+ this.pageTo({url: '/admin/coupon/selectCouponList?price=' + amount})
|
|
|
},
|
|
|
// 是否有可用优惠券、红包
|
|
|
hasCoupon() {
|
|
|
- let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
|
|
|
- shopHouponHas({amount}).then(res => {
|
|
|
- this.couponText = res.data.has ? '有红包可用' : ''
|
|
|
- console.log(this.couponText)
|
|
|
- }).catch(err => {})
|
|
|
+ let amount = this.form.sendType == 1 ? this.numberAdd(this.allPrice, Number(this.form.sendCost)) : this.allPrice
|
|
|
+ shopHouponHas({amount}).then(res => {
|
|
|
+ this.couponText = res.data.has ? '有红包可用' : ''
|
|
|
+ console.log(this.couponText)
|
|
|
+ }).catch(err => {})
|
|
|
},
|
|
|
getGhsData(id) {
|
|
|
getGhsDataApi({id:id}).then(res => {
|
|
|
- this.ghsMsg = res.data;
|
|
|
- console.log('res.data',this.ghsMsg)
|
|
|
- this.purchaseFreight(this.ghsMsg);
|
|
|
+ this.ghsInfo = res.data;
|
|
|
+ this.purchaseFreight(this.ghsInfo);
|
|
|
+ this.calcPrice()
|
|
|
});
|
|
|
},
|
|
|
countAllPrices(e){
|
|
|
@@ -469,14 +481,14 @@ export default {
|
|
|
const product = this.list.map(ele => {
|
|
|
return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
|
|
|
});
|
|
|
- let xj = uni.getStorageSync("ghsXj"+this.ghsMsg.id)
|
|
|
+ let xj = uni.getStorageSync("ghsXj"+this.ghsInfo.id)
|
|
|
let params = {
|
|
|
getType:this.form.sendType,
|
|
|
sendTimeWant:this.sendTimeWant,
|
|
|
sendCost:this.form.sendType==2?'':this.form.sendCost,
|
|
|
remark:this.remark,
|
|
|
product:JSON.stringify(product),
|
|
|
- ghsId:this.ghsMsg.id,
|
|
|
+ ghsId:this.ghsInfo.id,
|
|
|
couponId: this.form.couponId,
|
|
|
xj:JSON.stringify(xj)
|
|
|
}
|