|
|
@@ -38,6 +38,10 @@
|
|
|
.item-name {
|
|
|
color: #666;
|
|
|
font-size: 28px;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ width:400rpx;
|
|
|
}
|
|
|
.item-price {
|
|
|
color: #333;
|
|
|
@@ -155,7 +159,18 @@
|
|
|
flex: 1;
|
|
|
text-align: right;
|
|
|
padding-right: 45upx;
|
|
|
- color: #ff2945;
|
|
|
+ .has-hb{
|
|
|
+ background:red;
|
|
|
+ color:white;
|
|
|
+ border:1rpx solid red;
|
|
|
+ border-radius: 30rpx;
|
|
|
+ font-size:20rpx;
|
|
|
+ padding:5rpx 15rpx 5rpx 15rpx;
|
|
|
+ }
|
|
|
+ .selected{
|
|
|
+ color:red;
|
|
|
+ float:left;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
@@ -201,7 +216,7 @@
|
|
|
<view class="summary-bar">
|
|
|
<view class="operate-view" @click="gobackEvent">
|
|
|
<text class="iconfont icongouwuche"></text>
|
|
|
- 重选花材
|
|
|
+ 修改花材
|
|
|
</view>
|
|
|
<view class="describe-view">共{{ allCountFun.bigLength }}/{{ allCountFun.smallLength }}种,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
|
|
|
</view>
|
|
|
@@ -232,26 +247,14 @@
|
|
|
<input type="number" placeholder="" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder" disabled>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
- <!--
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="toCoupon">
|
|
|
- <view class="tui-title ">红包/抵用券</view>
|
|
|
- <view class="coupon_box">{{couponText}}</view>
|
|
|
+ <tui-list-cell v-if="hasHb == 1" class="line-cell" :hover="false" :arrow="true" @click="goSelectCoupon">
|
|
|
+ <view class="tui-title ">红包</view>
|
|
|
+ <view class="coupon_box"><text class="selected" v-if="selectedHb.hbId && selectedHb.hbId>0">-{{selectedHb.couponAmount}}</text><text class="has-hb" v-else>有红包</text></view>
|
|
|
</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>
|
|
|
+ <text style="color: #3385FF">{{ modifyPrice }}</text>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
@@ -263,7 +266,7 @@
|
|
|
</view>
|
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
|
- <text class="price-title">金额</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>
|
|
|
@@ -331,15 +334,14 @@ export default {
|
|
|
sendCost: "",
|
|
|
customId: "",
|
|
|
product: "",
|
|
|
- couponId: '0'
|
|
|
+ hbId: '0'
|
|
|
},
|
|
|
showCustomer: false,
|
|
|
- couponSumText: '',
|
|
|
- couponText: '',
|
|
|
today:'',
|
|
|
monthLater:'',
|
|
|
modifyPrice:0,
|
|
|
- discountAmount:0
|
|
|
+ hasHb:0,
|
|
|
+ selectedHb:{couponAmount:0,hbId:0,couponSelInx:0}
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
@@ -366,14 +368,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.list = list;
|
|
|
- if(uni.getStorageSync('selectCouponInfo').couponSum) {
|
|
|
- this.couponSumText = uni.getStorageSync('selectCouponInfo').couponSum
|
|
|
- this.couponText = '-¥' + this.couponSumText
|
|
|
- this.form.couponId = uni.getStorageSync('selectCouponInfo').couponId
|
|
|
- } else {
|
|
|
- this.couponSumText = "0"
|
|
|
- this.form.couponId = '0'
|
|
|
+ if(this.selectedHb.hbId && this.selectedHb.hbId > 0) {
|
|
|
+ this.form.hbId = this.selectedHb.hbId
|
|
|
+ this.calcPrice()
|
|
|
+ }else{
|
|
|
+ this.form.hbId = 0
|
|
|
this.hasCoupon()
|
|
|
+ this.calcPrice()
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -383,43 +384,41 @@ export default {
|
|
|
...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)
|
|
|
+ if(this.selectedHb.hbId && this.selectedHb.hbId > 0) {
|
|
|
+ this.modifyPrice = (this.modifyPrice - Number(this.selectedHb.couponAmount)).toFixed(2)
|
|
|
}
|
|
|
- this.modifyPrice = (Number(allPrice) - Number(this.discountAmount)).toFixed(2)
|
|
|
this.modifyPrice = parseFloat(this.modifyPrice)
|
|
|
},
|
|
|
init() {
|
|
|
this._getDet()
|
|
|
},
|
|
|
bindDateChange(e){
|
|
|
- let date = e.detail.value;
|
|
|
+ let date = e.detail.value
|
|
|
this.sendTimeWant = date
|
|
|
},
|
|
|
toPhone(phone){
|
|
|
- let amount = this.form.sendType == 1 ? this.allPrice+Number(this.form.sendCost) : this.allPrice
|
|
|
uni.makePhoneCall({
|
|
|
phoneNumber: phone
|
|
|
});
|
|
|
},
|
|
|
- toCoupon() {
|
|
|
+ goSelectCoupon() {
|
|
|
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 query = {amount:amount,ghsId:this.option.id,...this.selectedHb}
|
|
|
+ this.pageTo({url: '/admin/coupon/selectCouponList',query:query})
|
|
|
},
|
|
|
- // 是否有可用优惠券、红包
|
|
|
+ // 是否有可用红包
|
|
|
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)
|
|
|
+ let amount = this.allPrice
|
|
|
+ shopHouponHas({amount:amount,ghsId:this.option.id}).then(res => {
|
|
|
+ this.hasHb = res.data.has
|
|
|
}).catch(err => {})
|
|
|
},
|
|
|
getGhsData(id) {
|
|
|
getGhsDataApi({id:id}).then(res => {
|
|
|
this.ghsInfo = res.data;
|
|
|
- this.purchaseFreight(this.ghsInfo);
|
|
|
+ //注释计算运费
|
|
|
+ //this.purchaseFreight(this.ghsInfo);
|
|
|
this.calcPrice()
|
|
|
});
|
|
|
},
|
|
|
@@ -427,8 +426,10 @@ export default {
|
|
|
this.allPrices = this.allPrices+Number(this.form.sendCost)
|
|
|
},
|
|
|
_getDet() {
|
|
|
- let data = uni.getStorageSync("modifyShopB");
|
|
|
- if (this.$util.isEmpty(data)) return;
|
|
|
+ let data = uni.getStorageSync("modifyShopB")
|
|
|
+ if (this.$util.isEmpty(data)){
|
|
|
+ return
|
|
|
+ }
|
|
|
Object.keys(this.form).forEach((i, index) => {
|
|
|
this.form[i] = data[i];
|
|
|
});
|
|
|
@@ -479,7 +480,7 @@ export default {
|
|
|
remark:this.remark,
|
|
|
product:JSON.stringify(product),
|
|
|
ghsId:this.ghsInfo.id,
|
|
|
- couponId: this.form.couponId,
|
|
|
+ hbId: this.form.hbId,
|
|
|
xj:JSON.stringify(xj)
|
|
|
}
|
|
|
let self = this;
|
|
|
@@ -492,7 +493,6 @@ export default {
|
|
|
const {data: { orderSn,realPrice,count,hasDebtPay }} = res;
|
|
|
self.pageTo({url: `/pagesPurchase/wechatPay?type=2&orderSn=${orderSn}&realPrice=${realPrice}&count=${count}&hasDebtPay=${hasDebtPay}`, type: 2})
|
|
|
setTimeout(() => {
|
|
|
- uni.removeStorageSync('selectCouponInfo')
|
|
|
self.removeMemory(self.ghsInfo.id)
|
|
|
//删除小菊的记忆
|
|
|
uni.removeStorageSync("ghsXj"+params.ghsId)
|
|
|
@@ -566,5 +566,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
-</script>
|
|
|
-
|
|
|
+</script>
|