|
|
@ -56,7 +56,9 @@ |
|
|
<view v-for="(item,index) in formData.productGroupBuyPrices" :key="index" style="display: flex;margin-top:10rpx;"> |
|
|
<view v-for="(item,index) in formData.productGroupBuyPrices" :key="index" style="display: flex;margin-top:10rpx;"> |
|
|
<input type="number" min="2" class="content-input" v-model="item.groupCount" style="padding-right: 20rpx;margin-right: 20rpx;width: 100px;" placeholder="成团人数" /> |
|
|
<input type="number" min="2" class="content-input" v-model="item.groupCount" style="padding-right: 20rpx;margin-right: 20rpx;width: 100px;" placeholder="成团人数" /> |
|
|
<input type="digit" class="content-input" v-model="item.groupPrice" style="padding-right: 20rpx;width: 100px;" placeholder="拼团价格"/> |
|
|
<input type="digit" class="content-input" v-model="item.groupPrice" style="padding-right: 20rpx;width: 100px;" placeholder="拼团价格"/> |
|
|
<view @click="delGroup(index)" v-if="formData.productGroupBuyPrices.length>1" style="width: 240rpx;height: 60rpx;line-height: 60rpx;color: red;border:none;background: #fff;">删除</view> |
|
|
<view class="group-delete-btn" @tap.stop="delGroup(index)"> |
|
|
|
|
|
<uni-icons type="trash" size="20" color="#ff4d4f"></uni-icons> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view @click="addGroup()" style="margin-top: 10rpx;width: 160rpx;height: 60rpx;text-align: center;line-height: 60rpx;background: rgba(0, 35, 28, 1);border-radius: 60rpx;color: rgba(166, 255, 234, 1);"> |
|
|
<view @click="addGroup()" style="margin-top: 10rpx;width: 160rpx;height: 60rpx;text-align: center;line-height: 60rpx;background: rgba(0, 35, 28, 1);border-radius: 60rpx;color: rgba(166, 255, 234, 1);"> |
|
|
新增拼团 |
|
|
新增拼团 |
|
|
@ -436,7 +438,6 @@ |
|
|
submit() { |
|
|
submit() { |
|
|
let that = this; |
|
|
let that = this; |
|
|
this.syncLunchBoxByMoreBuy() |
|
|
this.syncLunchBoxByMoreBuy() |
|
|
this.normalizeGroupBuyPrices() |
|
|
|
|
|
if (!this.validateProductSpecs()) { |
|
|
if (!this.validateProductSpecs()) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
@ -532,17 +533,6 @@ |
|
|
} |
|
|
} |
|
|
return true |
|
|
return true |
|
|
}, |
|
|
}, |
|
|
normalizeGroupBuyPrices() { |
|
|
|
|
|
if (!Array.isArray(this.formData.productGroupBuyPrices)) { |
|
|
|
|
|
this.formData.productGroupBuyPrices = [] |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.formData.productGroupBuyPrices = this.formData.productGroupBuyPrices.filter((item) => { |
|
|
|
|
|
const groupCount = item && item.groupCount !== undefined && item.groupCount !== null ? String(item.groupCount).trim() : '' |
|
|
|
|
|
const groupPrice = item && item.groupPrice !== undefined && item.groupPrice !== null ? String(item.groupPrice).trim() : '' |
|
|
|
|
|
return groupCount !== '' || groupPrice !== '' |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
isValidPrice(value) { |
|
|
isValidPrice(value) { |
|
|
return /^\d+(\.\d{1,2})?$/.test(value) && Number(value) > 0 |
|
|
return /^\d+(\.\d{1,2})?$/.test(value) && Number(value) > 0 |
|
|
}, |
|
|
}, |
|
|
@ -1032,6 +1022,17 @@ |
|
|
box-sizing: border-box; |
|
|
box-sizing: border-box; |
|
|
min-width: 0; |
|
|
min-width: 0; |
|
|
} |
|
|
} |
|
|
|
|
|
.group-delete-btn { |
|
|
|
|
|
flex: 0 0 70rpx; |
|
|
|
|
|
width: 70rpx; |
|
|
|
|
|
height: 70rpx; |
|
|
|
|
|
margin-left: 20rpx; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
background: #fff; |
|
|
|
|
|
border-radius: 10rpx; |
|
|
|
|
|
} |
|
|
.keyboard-safe-bottom { |
|
|
.keyboard-safe-bottom { |
|
|
height: 260rpx; |
|
|
height: 260rpx; |
|
|
} |
|
|
} |
|
|
|