Commit 54f7a147 by 张立顺

fix bug

1 parent db47cf12
......@@ -502,7 +502,7 @@ Page({
if ([5, 6, 7].includes(subVal.merchantGoodsPosition)) {
skylightArr.push(subVal)
}
if ([1, baseConfigData?.selfBuildFilmType].includes(val.goodsType)) {
if (![1, baseConfigData?.selfBuildFilmType].includes(val.goodsType)) {
otherGoodsArr.push(subVal)
}
})
......@@ -537,9 +537,10 @@ Page({
copyGoodsData: goodsData
})
// 仅有一件商品 默认选中
// if (goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1) {
this.defaultChoose(0)
// }
// console.log(goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1, 'goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1');
if (goodsData.length == 1 && goodsData[0].upgradeGoodsList.length == 1) {
this.defaultChoose(0)
}
} else {
wx.$util.showToast(message)
}
......@@ -549,6 +550,10 @@ Page({
defaultChoose(index) {
let { frontGearArr, sideRearGearArr, skylightArr, sideBeforeRearGearArr, sideAfterRearGearArr, otherGoodsArr } = this.data
// 仅有一个商品直接选中
otherGoodsArr = otherGoodsArr.map((item) => {
item.otherFlag = true
return item;
})
let arr = [].concat(
sideRearGearArr.length == 1 ? sideRearGearArr : [],
frontGearArr.length == 1 ? frontGearArr : [],
......@@ -557,6 +562,7 @@ Page({
sideAfterRearGearArr.length == 1 ? sideAfterRearGearArr : [],
otherGoodsArr.length == 1 ? otherGoodsArr : [],
)
console.log(arr, 'defaultChoose');
arr.forEach(val => {
val.count = 1
val.active = true
......
......@@ -285,12 +285,11 @@
<input
type="digit"
value="{{ item.price }}"
bindinput="changePrice"
disabled="{{ true }}"
data-item="{{ item }}"
bindblur="priceBlur"
data-index="{{ index }}"
class="{{ item.price < 0 && (orderObj.selectPayType !=0) ? 'error':'' }} 'disabled'"
class="disabled"
always-embed
/>
</view>
......@@ -347,12 +346,10 @@
<input
type="digit"
value="{{ item.price }}"
bindinput="changePrice"
disabled="{{ orderObj.selectPayType ==0 }}"
disabled="{{ true }}"
data-item="{{ item }}"
bindblur="priceBlur"
data-index="{{ index }}"
class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}"
class="disabled"
always-embed
/>
</view>
......@@ -409,12 +406,10 @@
<input
type="digit"
value="{{ item.price }}"
bindinput="changePrice"
disabled="{{ orderObj.selectPayType ==0 }}"
disabled="{{ true }}"
data-item="{{ item }}"
bindblur="priceBlur"
data-index="{{ index }}"
class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}"
class="disabled"
always-embed
/>
</view>
......@@ -468,22 +463,12 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input
type="digit"
value="{{ item.price }}"
bindinput="changePrice"
disabled="{{ orderObj.selectPayType ==0 }}"
data-item="{{ item }}"
bindblur="priceBlur"
data-index="{{ index }}"
class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':''}} {{orderObj.selectPayType ==0?'disabled':'' }}"
always-embed
/>
<input type="digit" value="{{ item.price }}" disabled="{{ true }}" class="disabled" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="2">x{{item.count}}</view>
</view>
</view>
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}">
<view class="icon" bindtap="delGoodsList" data-index="{{ index }}" data-custom-index="{{ ind }}">
<image src="../../images/del.png" />
</view>
</view>
......@@ -529,17 +514,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input
type="digit"
value="{{ item.price }}"
bindinput="changePrice"
disabled="{{ true }}"
data-item="{{ item }}"
bindblur="priceBlur"
data-index="{{ index }}"
class="{{ item.price < 0 && (orderObj.selectPayType !=0) ? 'error':'' }} 'disabled'"
always-embed
/>
<input type="digit" value="{{ item.price }}" disabled="{{ true }}" class="disabled" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-index="{{ ind }}" data-type="3">x{{item.count}}</view>
</view>
......@@ -590,17 +565,7 @@
<view class="price_count">
<view class="price">
<text>¥</text>
<input
type="digit"
value="{{ item.price }}"
bindinput="changePrice"
disabled="{{ true }}"
data-item="{{ item }}"
bindblur="priceBlur"
data-index="{{ index }}"
class="{{ item.errorTarget && (orderObj.selectPayType !=0) ? 'error':'' }} 'disabled'"
always-embed
/>
<input type="digit" value="{{ item.price }}" disabled="{{ true }}" class="disabled" always-embed />
</view>
<view class="count" catchtap="showPopup" data-show-name="goodsBox" data-type="4" data-positionnnum="other">x{{item.count}}</view>
</view>
......@@ -624,7 +589,6 @@
<input
type="digit"
value="{{ item.multipleSpecificationsGoods.price }}"
bindinput="changePrice"
disabled="{{ true }}"
data-item="{{ item }}"
bindblur="priceBlur"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!