添加:文创豆兑换商品
This commit is contained in:
parent
6b280438ed
commit
adbd9a9c6a
|
|
@ -520,7 +520,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.menu_button.reverse().reverse(); //改变原始数组从而更新数组
|
this.menu_button.reverse().reverse(); //改变原始数组从而更新数组
|
||||||
console.log(this.menu_button);
|
// console.log(this.menu_button);
|
||||||
this.show = true;
|
this.show = true;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -386,11 +386,12 @@ export default {
|
||||||
getAddress() {
|
getAddress() {
|
||||||
$http.get("member.member-address.page", {page: this.page||1}, "获取中").then((response)=> {
|
$http.get("member.member-address.page", {page: this.page||1}, "获取中").then((response)=> {
|
||||||
if (response.result === 1) {
|
if (response.result === 1) {
|
||||||
this.addressData = this.addressData.concat(response.data.data);
|
let addressData = response.data || response.data.data;
|
||||||
|
this.addressData = this.addressData.concat(addressData);
|
||||||
this.total_page = response.data.last_page;
|
this.total_page = response.data.last_page;
|
||||||
this.page = response.data.current_page + 1;
|
this.page = response.data.current_page + 1;
|
||||||
if(response.data.last_page == response.data.current_page) this.finished = false;
|
if(response.data.last_page == response.data.current_page) this.finished = false;
|
||||||
let defaultAddress = response.data.data.filter(function(item) {
|
let defaultAddress = addressData.filter(function(item) {
|
||||||
return item.isdefault === 1;
|
return item.isdefault === 1;
|
||||||
});
|
});
|
||||||
this.defaultAddress = this.defaultAddress.concat(defaultAddress);
|
this.defaultAddress = this.defaultAddress.concat(defaultAddress);
|
||||||
|
|
|
||||||
|
|
@ -828,6 +828,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="price list" v-if="is_legumes_exchange && is_allow_use_legumes_exchange && use_legumes_exchange > 0">
|
||||||
|
<div class="left ">需要文创豆</div>
|
||||||
|
<div class="right">
|
||||||
|
<div class="right">
|
||||||
|
<span style="color: #e84e40;">{{ use_legumes_exchange }}豆</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="agreement" v-if="isRent">
|
<div class="agreement" v-if="isRent">
|
||||||
<div class="right">
|
<div class="right">
|
||||||
|
|
@ -854,6 +864,11 @@
|
||||||
|
|
||||||
<div style="height: 3.125rem;"></div>
|
<div style="height: 3.125rem;"></div>
|
||||||
<div class="detail_pay">
|
<div class="detail_pay">
|
||||||
|
<template v-if="is_legumes_exchange == 1">
|
||||||
|
<div v-if="is_allow_use_legumes_exchange" class="order_delete" :class="{ disabled: yz_subscribe_disabled }" @click="submit">立即兑换</div>
|
||||||
|
<div v-else class="order_delete" :class="{ disabled: yz_subscribe_disabled }">文创豆不足</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<ul class="total">
|
<ul class="total">
|
||||||
<li class="deposit" v-if="root_tag != 'yzlease'">
|
<li class="deposit" v-if="root_tag != 'yzlease'">
|
||||||
<small v-if="isRent">(押金{{ $i18n.t("money") }}{{ goodsInfo.total_deposit }}可退)</small>
|
<small v-if="isRent">(押金{{ $i18n.t("money") }}{{ goodsInfo.total_deposit }}可退)</small>
|
||||||
|
|
@ -864,12 +879,12 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="order_delete" :class="{ disabled: yz_subscribe_disabled }" @click="submit">
|
<div class="order_delete" :class="{ disabled: yz_subscribe_disabled }" @click="submit">
|
||||||
提交订单
|
提交订单
|
||||||
<!-- 订阅信息 -->
|
<!-- 订阅信息 -->
|
||||||
<yzSubscribe v-on:confirm="confirmSub" v-on:error="errorSub" :tagName="'submit_order'" :styleWidth="'150px'"></yzSubscribe>
|
<yzSubscribe v-on:confirm="confirmSub" v-on:error="errorSub" :tagName="'submit_order'" :styleWidth="'150px'"></yzSubscribe>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--自定义表单-->
|
<!--自定义表单-->
|
||||||
|
|
|
||||||
|
|
@ -341,6 +341,10 @@ export default {
|
||||||
},
|
},
|
||||||
isRentSetting:false,
|
isRentSetting:false,
|
||||||
storeTable: null,//门店餐桌扫码
|
storeTable: null,//门店餐桌扫码
|
||||||
|
|
||||||
|
is_legumes_exchange: 0,// 是否使用文创豆兑换
|
||||||
|
is_allow_use_legumes_exchange: 0,// 是否允许使用文创豆兑换
|
||||||
|
use_legumes_exchange: 0,// 使用的文创豆数量
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -356,12 +360,14 @@ export default {
|
||||||
this.initAdress();
|
this.initAdress();
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
|
// 判断:当前购买流程是否为文创豆兑换流程
|
||||||
|
this.is_legumes_exchange = !isNaN(parseInt(this.$route.query.is_legumes_exchange)) ? parseInt(this.$route.query.is_legumes_exchange) : 0;
|
||||||
|
|
||||||
this.initData();
|
this.initData();
|
||||||
this.handleQueryData();
|
this.handleQueryData();
|
||||||
if ((this.$route.query.orderShowDate ?? "") !== "") {
|
if ((this.$route.query.orderShowDate ?? "") !== "") {
|
||||||
this.orderShowDate = this.$route.query.orderShowDate;
|
this.orderShowDate = this.$route.query.orderShowDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重新计算
|
// 重新计算
|
||||||
if (this.selected == "10") {
|
if (this.selected == "10") {
|
||||||
// 定位
|
// 定位
|
||||||
|
|
@ -376,7 +382,6 @@ export default {
|
||||||
})
|
})
|
||||||
.catch(err => {});
|
.catch(err => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
let yz_basic_info = JSON.parse(window.localStorage.getItem("yz_basic_info"));
|
let yz_basic_info = JSON.parse(window.localStorage.getItem("yz_basic_info"));
|
||||||
if (yz_basic_info.plugin_setting.address_code && yz_basic_info.plugin_setting.address_code.enable) {
|
if (yz_basic_info.plugin_setting.address_code && yz_basic_info.plugin_setting.address_code.enable) {
|
||||||
this.address_codeEnable = true;
|
this.address_codeEnable = true;
|
||||||
|
|
@ -1625,6 +1630,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
json = this.handleDataActionBuyUrl(json);
|
json = this.handleDataActionBuyUrl(json);
|
||||||
|
json.is_legumes_exchange = this.is_legumes_exchange;
|
||||||
|
|
||||||
if (this.$route.query.orderType == "newRetail" && this.$route.query.retail_state == 2) {
|
if (this.$route.query.orderType == "newRetail" && this.$route.query.retail_state == 2) {
|
||||||
json.goods = JSON.parse(this.$route.query.goods) || []; // 自由发货
|
json.goods = JSON.parse(this.$route.query.goods) || []; // 自由发货
|
||||||
|
|
@ -1726,6 +1732,7 @@ export default {
|
||||||
|
|
||||||
this.order_other_json = {};
|
this.order_other_json = {};
|
||||||
json = this.handleDataActionCartUrl(json);
|
json = this.handleDataActionCartUrl(json);
|
||||||
|
json.is_legumes_exchange = this.is_legumes_exchange;
|
||||||
$http.get(this.pre_order_url, json, "生成中").then(
|
$http.get(this.pre_order_url, json, "生成中").then(
|
||||||
response => {
|
response => {
|
||||||
if (response.result === 1) {
|
if (response.result === 1) {
|
||||||
|
|
@ -2100,6 +2107,10 @@ export default {
|
||||||
},
|
},
|
||||||
// 设置界面
|
// 设置界面
|
||||||
setViewData(data, cart_ids) {
|
setViewData(data, cart_ids) {
|
||||||
|
|
||||||
|
this.use_legumes_exchange = data.use_legumes_exchange_total || 0;
|
||||||
|
this.is_allow_use_legumes_exchange = data.is_allow_exchange || 0;
|
||||||
|
|
||||||
if (data.discount && data.discount.default_deduction && data.discount.default_deduction != 0) {
|
if (data.discount && data.discount.default_deduction && data.discount.default_deduction != 0) {
|
||||||
// 获取第一次接口默认积分抵扣
|
// 获取第一次接口默认积分抵扣
|
||||||
this.default_deduction = data.discount.default_deduction;
|
this.default_deduction = data.discount.default_deduction;
|
||||||
|
|
@ -2592,6 +2603,8 @@ export default {
|
||||||
},
|
},
|
||||||
submitBtnPost() {
|
submitBtnPost() {
|
||||||
let json = this.assembleJson();
|
let json = this.assembleJson();
|
||||||
|
json.is_legumes_exchange = this.is_legumes_exchange;
|
||||||
|
|
||||||
if (this.$route.query.tag === "tourAround") {
|
if (this.$route.query.tag === "tourAround") {
|
||||||
if (this.orderShowIdCard && this.fun.isTextEmpty(this.idCard)) {
|
if (this.orderShowIdCard && this.fun.isTextEmpty(this.idCard)) {
|
||||||
Toast("身份证必填");
|
Toast("身份证必填");
|
||||||
|
|
@ -2782,7 +2795,9 @@ export default {
|
||||||
invoice: this.invoice_list,
|
invoice: this.invoice_list,
|
||||||
|
|
||||||
mark: this.$route.query.mark || 0,
|
mark: this.$route.query.mark || 0,
|
||||||
dispatch_type_id: this.selected //配送方式 ,1:快递 ||2:门店自提||3:门店配送(送货上门)||8:自提点
|
dispatch_type_id: this.selected, //配送方式 ,1:快递 ||2:门店自提||3:门店配送(送货上门)||8:自提点
|
||||||
|
|
||||||
|
is_legumes_exchange: this.is_legumes_exchange,
|
||||||
};
|
};
|
||||||
// 分销活动页面购买的商品,带活动id
|
// 分销活动页面购买的商品,带活动id
|
||||||
if (this.$route.query.activity_id) {
|
if (this.$route.query.activity_id) {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
<span class="need-num">{{ item.use_legumes }}</span>文创豆
|
<span class="need-num">{{ item.use_legumes }}</span>文创豆
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.is_allow_exchange" class="g-f-btn">立即兑换</div>
|
<div v-if="item.is_allow_exchange" class="g-f-btn" @click="exchangeGoods(item)">立即兑换</div>
|
||||||
<div v-else class="g-f-btn not-click">文创豆不足</div>
|
<div v-else class="g-f-btn not-click">文创豆不足</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -410,6 +410,18 @@ export default {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 点击兑换商品
|
||||||
|
exchangeGoods(item){
|
||||||
|
console.log('商品信息',item);
|
||||||
|
let json_data = {
|
||||||
|
goodsId: item.goods_id,
|
||||||
|
optionsId: 0,
|
||||||
|
total: "1",
|
||||||
|
tag: "-2",
|
||||||
|
is_legumes_exchange: 1,// 是否为文创豆兑换
|
||||||
|
};
|
||||||
|
this.$router.push(this.fun.getUrl("goodsorder", {}, json_data));
|
||||||
|
},
|
||||||
/****** 第三方代发相关操作 ********************/
|
/****** 第三方代发相关操作 ********************/
|
||||||
// 获取第三方银行卡配置信息
|
// 获取第三方银行卡配置信息
|
||||||
thirdPartyBankCardInfo(is_show = true){
|
thirdPartyBankCardInfo(is_show = true){
|
||||||
|
|
@ -431,6 +443,7 @@ export default {
|
||||||
let day = start.slice(6, 8);
|
let day = start.slice(6, 8);
|
||||||
_this.selectedTime = new Date(year, month, day).getTime();
|
_this.selectedTime = new Date(year, month, day).getTime();
|
||||||
}
|
}
|
||||||
|
_this.$forceUpdate();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue