添加:商品详情及购买流程修改 - 兼容积分商品可用使用积分+现金进行购买
This commit is contained in:
parent
9a73f6a4e5
commit
0116317c59
|
|
@ -73,6 +73,7 @@ Component({
|
|||
popStock: 0,
|
||||
// 价格
|
||||
popPrice: 0,
|
||||
popMoney: 0,
|
||||
popThumb: "", // 商品图片
|
||||
optionsMaxCount: 1,
|
||||
submitActionTag: "-2",
|
||||
|
|
@ -148,7 +149,7 @@ Component({
|
|||
}
|
||||
}else{
|
||||
that.data.goodsInfo.has_many_specs[i].description = that.data.goodsInfo.has_many_specs[i].specitem[0].id;
|
||||
that.selectSpecs(that.data.goodsInfo.has_many_specs[i].specitem[0], "first", i);
|
||||
that.selectSpecs(that.data.goodsInfo.has_many_specs[i].specitem[0], "first", i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -265,8 +266,10 @@ Component({
|
|||
}
|
||||
|
||||
let popPrice = "";
|
||||
let popMoney = 0;
|
||||
if (this.data.goods_plugin.point_goods) {
|
||||
popPrice = this.data.goods_plugin.point_goods.point_option[_activeSkuIndex].goods_point; //设置默认价格
|
||||
popMoney = this.data.goods_plugin.point_goods.point_option[_activeSkuIndex].use_money; //设置默认价格
|
||||
} else {
|
||||
popPrice = this.data.goodsInfo.has_many_options[_activeSkuIndex].product_price; //设置默认价格
|
||||
}
|
||||
|
|
@ -277,6 +280,7 @@ Component({
|
|||
popupSpecs: true,
|
||||
popupModeshow: false,
|
||||
popPrice: popPrice, //设置价格
|
||||
popMoney: popMoney,
|
||||
popThumb: app._isTextEmpty(this.data.goodsInfo.has_many_options[_activeSkuIndex].thumb) ? this.data.goodsInfo.thumb : this.data.goodsInfo.has_many_options[_activeSkuIndex].thumb, //设置图片
|
||||
popStock: this.data.goodsInfo.has_many_options[_activeSkuIndex].stock, //设置库存
|
||||
optionsId: this.data.goodsInfo.has_many_options[_activeSkuIndex].id, //设置规格ID,用于生成订单
|
||||
|
|
@ -286,14 +290,17 @@ Component({
|
|||
//初始化弹窗view
|
||||
initPopView() {
|
||||
let popPrice = "";
|
||||
let popMoney = 0;
|
||||
if (this.data.goodsInfo.has_option == 1) {
|
||||
if (this.data.goods_plugin.point_goods) {
|
||||
popPrice = this.data.goods_plugin.point_goods.min_point + "-" + this.data.goods_plugin.point_goods.max_point; //设置默认价格
|
||||
popMoney = this.data.goods_plugin.point_goods.use_moeny; //设置默认价格
|
||||
} else {
|
||||
popPrice = this.data.goodsInfo.min_price + "-" + this.data.goodsInfo.max_price; //设置默认价格
|
||||
}
|
||||
this.setData({
|
||||
popPrice: popPrice, //设置默认价格
|
||||
popMoney: popMoney,
|
||||
popThumb: this.data.goodsInfo.thumb, //设置默认图片
|
||||
popStock: this.data.goodsInfo.stock, //设置默认库存
|
||||
goodsDescription: "选择",
|
||||
|
|
@ -317,6 +324,7 @@ Component({
|
|||
|
||||
if (this.data.goods_plugin.point_goods) {
|
||||
popPrice = this.data.goods_plugin.point_goods.point; //设置默认价格
|
||||
popMoney = this.data.goods_plugin.point_goods.use_money;
|
||||
} else {
|
||||
popPrice = this.data.goodsInfo.price; //设置默认价格
|
||||
}
|
||||
|
|
@ -324,6 +332,7 @@ Component({
|
|||
popThumb: this.data.goodsInfo.thumb, //设置默认图片
|
||||
popStock: this.data.goodsInfo.stock, //设置默认库存
|
||||
popPrice: popPrice, //设置默认价格
|
||||
popMoney: popMoney,
|
||||
goodsDescription: "",
|
||||
optionsMaxCount: this.data.goodsInfo.stock,
|
||||
skuImages: __optionArr2,
|
||||
|
|
@ -678,6 +687,7 @@ Component({
|
|||
setGoodsSpecsChangeInfo() {
|
||||
let specsManage = this.data.specsManage;
|
||||
let popPrice = "";
|
||||
let popMoney = 0;
|
||||
//根据ID 排序 specsManage.sort();
|
||||
specsManage.sort(function (a, b) {
|
||||
return a.id - b.id;
|
||||
|
|
@ -692,12 +702,14 @@ Component({
|
|||
if (goodsSpecs == this.setGoodsSpecsBySort(this.data.goodsInfo.has_many_options[i].specs)) {
|
||||
if (this.data.goods_plugin.point_goods) {
|
||||
popPrice = this.data.goods_plugin.point_goods.point_option[i].goods_point; //设置默认价格
|
||||
popMoney = this.data.goods_plugin.point_goods.point_option[i].use_money; //设置默认价格
|
||||
} else {
|
||||
popPrice = this.data.goodsInfo.has_many_options[i].product_price; //设置默认价格
|
||||
}
|
||||
this.setData({
|
||||
activeSkuIndex: i,
|
||||
popPrice: popPrice, //设置价格
|
||||
popMoney: popMoney,
|
||||
popThumb: app._isTextEmpty(this.data.goodsInfo.has_many_options[i].thumb) ? this.data.goodsInfo.thumb : this.data.goodsInfo.has_many_options[i].thumb, //设置图片
|
||||
popStock: this.data.goodsInfo.has_many_options[i].stock, //设置库存
|
||||
optionsId: this.data.goodsInfo.has_many_options[i].id, //设置规格ID,用于生成订单
|
||||
|
|
@ -783,7 +795,7 @@ Component({
|
|||
this.setData({specsVIPPrc});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
//******************** 加入购物车网络操作 ***************
|
||||
addCartRequest(_goodsId, _optionsId, _total) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@
|
|||
</view>
|
||||
<view class="right">
|
||||
<view class="price" wx:if="{{goods_plugin.point_goods}}">
|
||||
<text wx:if="{{popMoney > 0}}">
|
||||
<text id="option_price">{{popMoney}}</text>
|
||||
<text class="point-text" style="font-size: 13px">元</text>
|
||||
<text id="option_price">+</text>
|
||||
</text>
|
||||
<text id="option_price">{{popPrice}}</text>
|
||||
<text class="point-text" style="font-size: 13px">{{integral}}</text>
|
||||
</view>
|
||||
|
|
@ -102,6 +107,11 @@
|
|||
</view>
|
||||
<view class="right">
|
||||
<view class="price" wx:if="{{goods_plugin.point_goods}}">
|
||||
<text wx:if="{{popMoney > 0}}">
|
||||
<text id="option_price">{{popMoney}}</text>
|
||||
<text class="point-text" style="font-size: 13px">元</text>
|
||||
<text id="option_price">+</text>
|
||||
</text>
|
||||
<text id="option_price">{{popPrice}}</text>
|
||||
<text class="point-text" style="font-size: 13px">{{integral}}</text>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@
|
|||
<icon class="iconfont icon-goods_kefu"></icon>
|
||||
</view>
|
||||
</van-goods-action-icon>
|
||||
<van-goods-action-button type="warning" text="加入购物车" bindtap="addCart" disabled="{{!isAddCart}}"
|
||||
wx:if="{{ !debtId && !nocart && !isBegTime && !activityid && goodsInfo && goodsInfo.plugin_id != 72 && goodsType !== 'appointment_goods'&& goodsType!='store_projects_goods' && goodsType !== 'yunqian_api' && goods_plugin.is_special != 1 && goodsInfo.plugin_id != 140}}" />
|
||||
|
||||
<van-goods-action-button type="warning" text="加入购物车" bindtap="addCart" disabled="{{!isAddCart}}" wx:if="{{ !debtId && !nocart && !isBegTime && !activityid && goodsInfo && goodsInfo.plugin_id != 72 && goodsType !== 'appointment_goods'&& goodsType!='store_projects_goods' && goodsType !== 'yunqian_api' && goods_plugin.is_special != 1 && goodsInfo.plugin_id != 140 && !goods_plugin.point_goods}}" />
|
||||
|
||||
<block wx:if="{{!isRent}}">
|
||||
<van-goods-action-button type="danger" text="立即购买" disabled="{{is_yz_supplyGoods}}" wx:if="{{!isBuy || isTime}}"
|
||||
catchtap="buyNow" />
|
||||
|
|
|
|||
|
|
@ -16,13 +16,31 @@
|
|||
<block wx:if="{{goods_plugin.point_goods}}">
|
||||
<!-- goods_plugin.point_goods积分商城 ==> 积分全抵扣 不显示其他价格或者爱心值-->
|
||||
<view class="goods-price-box">
|
||||
<text class="goods-price-num">
|
||||
<text class="goods-price-num-style-2">{{ goodsInfo.has_option == 1 ? (goods_plugin.point_goods.min_point == goods_plugin.point_goods.max_point ?
|
||||
goods_plugin.point_goods.min_point : goods_plugin.point_goods.min_point + "-" + goods_plugin.point_goods.max_point) : goods_plugin.point_goods.point
|
||||
}}</text>
|
||||
<!-- 金额 -->
|
||||
<view style="display:inline-block;" wx:if="{{goods_plugin.point_goods.use_money > 0}}">
|
||||
<text class="goods-price-num" style="margin-right:0 !important;">
|
||||
<text class="goods-price-num-style-2">{{ goods_plugin.point_goods.use_money }}</text>
|
||||
</text>
|
||||
<text class="goods-price-text">元</text>
|
||||
</view>
|
||||
<!-- 加号 -->
|
||||
<text class="goods-price-num" wx:if="{{goods_plugin.point_goods.use_money > 0 && goods_plugin.point_goods.point > 0}}" style="margin: 0 10rpx !important;">
|
||||
<text class="goods-price-num-style-2">+</text>
|
||||
</text>
|
||||
<text class="goods-price-text">{{integral}}</text>
|
||||
<text class="goods-price-text" wx:if="{{isRent}}">/天</text>
|
||||
<!-- 积分 -->
|
||||
<view style="display:inline-block;" wx:if="{{goods_plugin.point_goods.point > 0}}">
|
||||
<text class="goods-price-num" style="margin-right:0 !important;">
|
||||
<text class="goods-price-num-style-2">{{ goods_plugin.point_goods.point }}</text>
|
||||
</text>
|
||||
<text class="goods-price-text">{{integral}}</text>
|
||||
<!-- <text class="goods-price-num" style="margin-right:0 !important;">
|
||||
<text class="goods-price-num-style-2">
|
||||
{{ goodsInfo.has_option == 1 ? (goods_plugin.point_goods.min_point == goods_plugin.point_goods.max_point ? goods_plugin.point_goods.min_point : goods_plugin.point_goods.min_point + "~" + goods_plugin.point_goods.max_point) : goods_plugin.point_goods.point }}
|
||||
</text>
|
||||
</text>
|
||||
<text class="goods-price-text">{{integral}}</text>
|
||||
<text class="goods-price-text" wx:if="{{isRent}}">/天</text>-->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
|
|
|
|||
|
|
@ -875,7 +875,8 @@ Component({
|
|||
skuImages: __optionArr2,
|
||||
});
|
||||
}
|
||||
} else if (this.data.goodsType == "grabGroup") {
|
||||
}
|
||||
else if (this.data.goodsType == "grabGroup") {
|
||||
// 抢团的初始化
|
||||
try {
|
||||
this.setData({
|
||||
|
|
@ -917,11 +918,14 @@ Component({
|
|||
optionsMaxCount: this.data.gooddatas.stock,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
let popPrice = "";
|
||||
let popMoney = 0;
|
||||
if (this.data.goodsInfo.has_option == 1) {
|
||||
if (this.data.goods_plugin.point_goods) {
|
||||
popPrice = this.data.goods_plugin.point_goods.min_point + "-" + this.data.goods_plugin.point_goods.max_point; //设置默认价格
|
||||
popMoney = this.data.goods_plugin.point_goods.use_money; //设置默认价格
|
||||
} else {
|
||||
popPrice = this.data.goodsInfo.min_price + "-" + this.data.goodsInfo.max_price; //设置默认价格
|
||||
}
|
||||
|
|
@ -940,6 +944,7 @@ Component({
|
|||
popStock: this.data.goodsInfo.stock,
|
||||
popThumb: this.data.goodsInfo.thumb,
|
||||
popPrice: popPrice,
|
||||
popMoney: popMoney,
|
||||
goodsDescription: "选择",
|
||||
optionsMaxCount: this.data.goodsInfo.stock,
|
||||
skuImages: _optionArr,
|
||||
|
|
@ -950,6 +955,7 @@ Component({
|
|||
|
||||
if (this.data.goods_plugin.point_goods) {
|
||||
popPrice = this.data.goods_plugin.point_goods.point; //设置默认价格
|
||||
popMoney = this.data.goods_plugin.point_goods.use_money;
|
||||
} else {
|
||||
popPrice = this.data.goodsInfo.price; //设置默认价格
|
||||
}
|
||||
|
|
@ -958,6 +964,7 @@ Component({
|
|||
popStock: this.data.goodsInfo.stock,
|
||||
popThumb: this.data.goodsInfo.thumb,
|
||||
popPrice: popPrice,
|
||||
popMoney: popMoney,
|
||||
goodsDescription: "",
|
||||
optionsMaxCount: this.data.goodsInfo.stock,
|
||||
skuImages: __optionArr2,
|
||||
|
|
|
|||
|
|
@ -291,6 +291,7 @@ Page({
|
|||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
console.log('=== 调试中... ===',options);
|
||||
wx.getStorage({
|
||||
key: "yz_basic_info",
|
||||
success: (res) => {
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@
|
|||
"city-delivery-day":"../../mycomponent/city-delivery-day/city-delivery-day",
|
||||
"invoice-pop":"../../mycomponent/invoice-pop/invoice-pop",
|
||||
"agency-saleman": "../../mycomponent/agency-saleman/agency-saleman"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -496,22 +496,41 @@
|
|||
<view wx:if="{{reserve_deduction_love}}" class="dResrve">
|
||||
预约扣除<view class="span" >{{ reserve_deduction_love }}{{ love_name }}</view>
|
||||
</view>
|
||||
<!-- 抵扣信息 -->
|
||||
<block wx:if="{{item.order_deductions}}">
|
||||
<view class="score list" wx:for="{{item.order_deductions}}" wx:for-item="d" wx:for-index="dindex" wx:key="dindex">
|
||||
<view class="left">
|
||||
可用{{d.coin}}{{d.name || integral}}
|
||||
<text class="span">{{deduction_lang?deduction_lang:'抵扣'}}{{d.amount}}{{language['元']}}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<van-switch size='23px' data-orindex="{{orindex}}" loading="{{clicktag == 1}}" active-color="#ee0a24" data-dindex="{{dindex}}" checked="{{d.checked}}" bind:change="discountHandle" data-tag="discount" />
|
||||
</view>
|
||||
<!--积分抵扣-->
|
||||
<block wx:if="{{d.code == 'point'}}">
|
||||
<block wx:if="{{d.coin > 0 && d.amount <= 0}}">
|
||||
<view class="left">需要额外支付{{d.coin}}{{d.name || integral}}</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="left">
|
||||
可用{{d.coin}}{{d.name || integral}}
|
||||
<text class="span">{{deduction_lang?deduction_lang:'抵扣'}}{{d.amount}}{{language['元']}}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<van-switch size='23px' data-orindex="{{orindex}}" loading="{{clicktag == 1}}" active-color="#ee0a24" data-dindex="{{dindex}}" checked="{{d.checked}}" bind:change="discountHandle" data-tag="discount" />
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
<!--其他抵扣-->
|
||||
<block wx:else>
|
||||
<view class="left">
|
||||
可用{{d.coin}}{{d.name || integral}}
|
||||
<text class="span">{{deduction_lang?deduction_lang:'抵扣'}}{{d.amount}}{{language['元']}}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<van-switch size='23px' data-orindex="{{orindex}}" loading="{{clicktag == 1}}" active-color="#ee0a24" data-dindex="{{dindex}}" checked="{{d.checked}}" bind:change="discountHandle" data-tag="discount" />
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<blcok wx:if="{{item.order_coin_exchanges}}" wx:for-item="d" wx:for-index="dindex" wx:key="dindex" wx:for="{{item.order_coin_exchanges}}">
|
||||
<view class="score list" wx:if="{{!d.no_show}}">
|
||||
<view class="left ">
|
||||
{{ d.coin }}{{d.name || integral}}
|
||||
<text class="span">{{deduction_lang?deduction_lang:'抵扣'}}{{ d.amount }}{{language['元']}}</text>
|
||||
{{ d.name ? '' : '需要支付' }}{{ d.coin }}{{d.name || integral}}
|
||||
<text class="span" wx:if="{{d.amount > 0}}">{{deduction_lang?deduction_lang:'抵扣'}}{{ d.amount }}{{language['元']}}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
</view>
|
||||
|
|
|
|||
Loading…
Reference in New Issue