|
@@ -80,16 +80,16 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="select_sku" >
|
|
|
- <view class="product_attr" v-for="(spec,spec_index) in productInfo.product_attr" :key="spec_index">
|
|
|
- <view class="spec_name">{{ spec.spec_name }}</view>
|
|
|
- <view class="arrt_list">
|
|
|
- <scroll-view scroll-y="true" class="scroll_y" >
|
|
|
- <view class="arrt_option" :class="option.active?'active':''" v-for="(option,attr_index) in spec.attr_list" :key="attr_index" @click="attrChange(spec_index,attr_index)">
|
|
|
- {{option.name}}
|
|
|
- </view>
|
|
|
- </scroll-view>
|
|
|
+ <scroll-view scroll-y="true" class="scroll_y" >
|
|
|
+ <view class="product_attr" v-for="(spec,spec_index) in productInfo.product_attr" :key="spec_index">
|
|
|
+ <view class="spec_name">{{ spec.spec_name }}</view>
|
|
|
+ <view class="arrt_list">
|
|
|
+ <view class="arrt_option" :class="option.active?'active':''" v-for="(option,attr_index) in spec.attr_list" :key="attr_index" @click="attrChange(spec_index,attr_index)">
|
|
|
+ {{option.name}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </scroll-view>
|
|
|
</view>
|
|
|
<!-- 选择优惠券 -->
|
|
|
<view class="to_select_coupon" v-if="specBtnType==1" @click="openCoupon()">
|
|
@@ -255,6 +255,12 @@
|
|
|
})
|
|
|
// #endif
|
|
|
},
|
|
|
+ onShareAppMessage(obj) {
|
|
|
+ return {
|
|
|
+ title: '为您提供优秀的数据营销服务和解决方案',
|
|
|
+ path: '/pages/index/index'
|
|
|
+ }
|
|
|
+ },
|
|
|
onShow() {
|
|
|
// 没有添加客服就不显示
|
|
|
this.isShowPrice = this.$checkAccess.checkShowPrice();
|
|
@@ -457,14 +463,15 @@
|
|
|
checkCoupon(){
|
|
|
// 如果存在的话
|
|
|
if( this.couponList.length ){
|
|
|
+ let hasIsStd = false;
|
|
|
// 循环优惠券
|
|
|
for (let i in this.couponList) {
|
|
|
/* 商品的总价格,决定是否可用 */
|
|
|
- var totalPrice = 0.00;
|
|
|
+ let totalPrice = 0.00;
|
|
|
// 如果是商品券
|
|
|
if( this.couponList[i].type_id == 1 ){
|
|
|
// 判断商品是不是在商品范围
|
|
|
- var isScope = false;
|
|
|
+ let isScope = false;
|
|
|
// 循环商品范围
|
|
|
for (let k in this.couponList[i].product_scope) {
|
|
|
// 如果存在商品范围
|
|
@@ -478,7 +485,9 @@
|
|
|
totalPrice = this.$decimal.add(totalPrice,this.$decimal.mul(this.productInfo.price,this.quantity));
|
|
|
}
|
|
|
// 判断价格到不到限额
|
|
|
- this.couponList[i].is_std = totalPrice.toFixed() >= this.$decimal.mul(this.couponList[i].std_pay,1).toFixed();
|
|
|
+ this.couponList[i].is_std = parseFloat(totalPrice.toFixed()) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay,1).toFixed());
|
|
|
+ // 如果不可用的话,该项已选择则不选
|
|
|
+ if( !this.couponList[i].is_std && this.couponList[i].checked ) this.checkedCoupon(i);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -540,7 +549,7 @@
|
|
|
totalPrice = this.$decimal.mul(this.productInfo.price,this.quantity);
|
|
|
}
|
|
|
// 如果是可以用的话
|
|
|
- if( totalPrice.toFixed() >= this.$decimal.mul(this.couponList[i].std_pay,1).toFixed() ){
|
|
|
+ if( parseFloat(totalPrice.toFixed()) >= parseFloat(this.$decimal.mul(this.couponList[i].std_pay,1).toFixed()) ){
|
|
|
// 扣减金额
|
|
|
let rebatePrice = this.$decimal.mul(1,0);
|
|
|
// 满减
|
|
@@ -677,6 +686,8 @@
|
|
|
this.sku_id = this.productInfo.product_sku[k].id;
|
|
|
// 计算价格
|
|
|
this.priceHandler();
|
|
|
+ // 优惠券是否可用
|
|
|
+ this.checkCoupon();
|
|
|
}else{
|
|
|
var attr_ids = this.productInfo.product_sku[0].attr_ids.split(",");
|
|
|
// 循环规格列表
|
|
@@ -702,6 +713,8 @@
|
|
|
this.sku_id = this.productInfo.product_sku[0].id;
|
|
|
// 计算价格
|
|
|
this.priceHandler();
|
|
|
+ // 优惠券是否可用
|
|
|
+ this.checkCoupon();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -775,6 +788,8 @@
|
|
|
this.sku_id = this.productInfo.product_sku[i].id;
|
|
|
// 计算价格
|
|
|
this.priceHandler();
|
|
|
+ // 优惠券是否可用
|
|
|
+ this.checkCoupon();
|
|
|
}
|
|
|
// 如果没有对应的SKU
|
|
|
if( !haveSku ){
|
|
@@ -1170,21 +1185,21 @@
|
|
|
font-size: 28rpx;
|
|
|
padding: 30rpx 35rpx;
|
|
|
margin-bottom: 20rpx;
|
|
|
- .product_attr{
|
|
|
- display: block;
|
|
|
- overflow: hidden;
|
|
|
- margin-bottom: 20rpx;
|
|
|
- .spec_name{
|
|
|
- display: block;
|
|
|
- font-size: 28rpx;
|
|
|
- line-height: 40rpx;
|
|
|
- margin-bottom: 20rpx;
|
|
|
- }
|
|
|
- .arrt_list{
|
|
|
+ .scroll_y{
|
|
|
+ height: 240rpx;
|
|
|
+ .product_attr{
|
|
|
display: block;
|
|
|
overflow: hidden;
|
|
|
- .scroll_y{
|
|
|
- height: 240rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ .spec_name{
|
|
|
+ display: block;
|
|
|
+ font-size: 28rpx;
|
|
|
+ line-height: 40rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ }
|
|
|
+ .arrt_list{
|
|
|
+ display: block;
|
|
|
+ overflow: hidden;
|
|
|
.arrt_option{
|
|
|
float: left;
|
|
|
height: 40rpx;
|