|
@@ -153,6 +153,12 @@
|
|
|
width: 200px;
|
|
width: 200px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .coupon_box{
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+ padding-right: 45upx;
|
|
|
|
|
+ color: #ff2945;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
|
|
|
|
@@ -235,9 +241,14 @@
|
|
|
<view class="tui-title ">运费</view>
|
|
<view class="tui-title ">运费</view>
|
|
|
<input type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder">
|
|
<input type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder">
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="pageTo({url: '/admin/coupon/selectCouponList'})">
|
|
|
|
|
+ <view class="tui-title ">红包/抵用券</view>
|
|
|
|
|
+ <view class="coupon_box">{{couponText}}</view>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<textarea style="height: 100rpx" v-model="remark" placeholder="备注..."/>
|
|
<textarea style="height: 100rpx" v-model="remark" placeholder="备注..."/>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
+
|
|
|
<!-- <tui-list-cell class="line-cell" :hover="false" :arrow="false">-->
|
|
<!-- <tui-list-cell class="line-cell" :hover="false" :arrow="false">-->
|
|
|
<!-- <view class="tui-title ">结算方式</view>-->
|
|
<!-- <view class="tui-title ">结算方式</view>-->
|
|
|
<!-- <button @tap="form.debt=1" class="admin-button-com mini-btn" :class="form.debt==1?'blue':'default'">欠款</button>-->
|
|
<!-- <button @tap="form.debt=1" class="admin-button-com mini-btn" :class="form.debt==1?'blue':'default'">欠款</button>-->
|
|
@@ -254,7 +265,7 @@
|
|
|
<text class="price-title">总金额</text>
|
|
<text class="price-title">总金额</text>
|
|
|
<text class="price-number">
|
|
<text class="price-number">
|
|
|
¥
|
|
¥
|
|
|
- <text class="large" v-if="form.sendType==1">{{ allPrice+Number(form.sendCost) }}</text>
|
|
|
|
|
|
|
+ <text class="large" v-if="form.sendType==1">{{ this.numberAdd(allPrice, Number(form.sendCost)) }}</text>
|
|
|
<text class="large" v-else>{{ allPrice}}</text>
|
|
<text class="large" v-else>{{ allPrice}}</text>
|
|
|
</text>
|
|
</text>
|
|
|
</view>
|
|
</view>
|
|
@@ -282,6 +293,7 @@ const formUtil = require("@/utils/formValidation.js");
|
|
|
import { getGhsDataApi } from "@/api/ghs/index";
|
|
import { getGhsDataApi } from "@/api/ghs/index";
|
|
|
import { freight,createOrder } from "@/api/purchase/index";
|
|
import { freight,createOrder } from "@/api/purchase/index";
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
|
|
+import { shopHouponHas } from '@/api/coupon'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "BillingAffirm", // 开单确认
|
|
name: "BillingAffirm", // 开单确认
|
|
@@ -322,10 +334,11 @@ export default {
|
|
|
customId: "",
|
|
customId: "",
|
|
|
product: ""
|
|
product: ""
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
// 详细地址
|
|
// 详细地址
|
|
|
// showRegion: false,
|
|
// showRegion: false,
|
|
|
- showCustomer: false
|
|
|
|
|
|
|
+ showCustomer: false,
|
|
|
|
|
+ couponSumText: uni.getStorageSync('selectCouponInfo').couponSum ? uni.getStorageSync('selectCouponInfo').couponSum : '',
|
|
|
|
|
+ couponText: ''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
@@ -340,11 +353,20 @@ export default {
|
|
|
title: this.getMerchantInfo.name
|
|
title: this.getMerchantInfo.name
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ if(uni.getStorageSync('selectCouponInfo').couponSum) {
|
|
|
|
|
+ this.couponText = '-¥' + uni.getStorageSync('selectCouponInfo').couponSum
|
|
|
|
|
+ this.allPrice = this.allPrice - Number(uni.getStorageSync('selectCouponInfo').couponSum)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.hasCoupon()
|
|
|
|
|
+ }
|
|
|
this.getGhsData(e.id);
|
|
this.getGhsData(e.id);
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapGetters(["getMerchantInfo", "getLoginInfo"])
|
|
...mapGetters(["getMerchantInfo", "getLoginInfo"])
|
|
|
},
|
|
},
|
|
|
|
|
+ onUnload() {
|
|
|
|
|
+ uni.removeStorageSync('selectCouponInfo')
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
init() {
|
|
init() {
|
|
@@ -358,6 +380,15 @@ export default {
|
|
|
phoneNumber: phone
|
|
phoneNumber: phone
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ // 是否有可用优惠券
|
|
|
|
|
+ hasCoupon() {
|
|
|
|
|
+ let amount = this.form.sendType == 1 ? this.allPrice+Number(this.form.sendCost) : this.allPrice
|
|
|
|
|
+ shopHouponHas(amount).then(res => {
|
|
|
|
|
+ console.log(377, res)
|
|
|
|
|
+ this.couponText = res.data.has ? '有可用优惠券' : ''
|
|
|
|
|
+ console.log(this.couponText)
|
|
|
|
|
+ }).catch(err => {})
|
|
|
|
|
+ },
|
|
|
getGhsData(id) {
|
|
getGhsData(id) {
|
|
|
getGhsDataApi({id:id}).then(res => {
|
|
getGhsDataApi({id:id}).then(res => {
|
|
|
this.ghsMsg = res.data;
|
|
this.ghsMsg = res.data;
|
|
@@ -441,6 +472,22 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ numberAdd(arg1, arg2) {
|
|
|
|
|
+ var r1, r2, m, n;
|
|
|
|
|
+ try {
|
|
|
|
|
+ r1 = arg1.toString().split(".")[1].length
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ r1 = 0
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ r2 = arg2.toString().split(".")[1].length
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ r2 = 0
|
|
|
|
|
+ }
|
|
|
|
|
+ m = Math.pow(10, Math.max(r1, r2))
|
|
|
|
|
+ n = (r1 >= r2) ? r1 : r2;
|
|
|
|
|
+ return ((arg1 * m + arg2 * m) / m).toFixed(n);
|
|
|
|
|
+ },
|
|
|
// 表单验证
|
|
// 表单验证
|
|
|
async formSubmit(e) {
|
|
async formSubmit(e) {
|
|
|
try {
|
|
try {
|