This commit is contained in:
Paidax
2025-04-28 08:40:55 +08:00
parent 9b9e53056f
commit d046c3be5d
144 changed files with 2559 additions and 1222 deletions
@@ -228,7 +228,7 @@ layout("/mobile/platform.html"){
<van-image :src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+option.imgUrl"
fit="contain"
style="width: 100px;height: 100px;border-radius: 10px"></van-image>
<span style="position: absolute; bottom: 0;left: 10px;right: 10px;height: 20px;background: rgb(0 0 0 / 50%);text-align:center;color: #FFF;">{{option.selectCount}}人已选</span>
<!--<span style="position: absolute; bottom: 0;left: 10px;right: 10px;height: 20px;background: rgb(0 0 0 / 50%);text-align:center;color: #FFF;">{{option.selectCount}}人已选</span>-->
<!-- @click="vant.ImagePreview([CREATE_PREVIEW_URL(option.imgUrl)])"-->
</div>
@@ -355,9 +355,26 @@ layout("/mobile/platform.html"){
desc=""
style="border-radius: 8px;background: #FFFFFF"
:thumb="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
v-for="item in selectedOptions"
></van-card>
v-for="(item,index) in selectedOptions"
>
<template #price>
<span v-if="item.specs && item.specs.length > 0" style="font-size: 15px;color: #0a84ff"
@click="openSelectSpecs(item)">
{{ item.selectSpecs ? ('规格:' + item.selectSpecs) : '点我选择规格参数' }}
</span>
</template>
</van-card>
</van-cell>
<van-popup v-model="selectSpecsPopup" position="bottom">
<van-picker
title="规格选择"
show-toolbar
:columns="specsPickerOptions"
@confirm="specsSelectConfirm"
@cancel="selectSpecsPopup = false"
></van-picker>
</van-popup>
</div>
<!--邮寄到家 填写收货地址-->
@@ -427,7 +444,12 @@ layout("/mobile/platform.html"){
descPopup: false,
signData: null,
clickUpOrDown: false
clickUpOrDown: false,
// 选择规格相关
selectSpecsPopup: false,
specsPickerOptions: [],
selectedOptionsId: null,
}
},
computed: {
@@ -490,6 +512,32 @@ layout("/mobile/platform.html"){
}
},
methods: {
/**
* 选择规格
* @param item
*/
openSelectSpecs(item) {
this.specsPickerOptions = []
this.selectedOptionsId = item.id
if (item.specs && item.specs.length > 0) {
this.specsPickerOptions = item.specs.map(v => {
return {text: v.value, value: v.value}
})
}
this.selectSpecsPopup = true
},
specsSelectConfirm(value) {
debugger
this.selectSpecsPopup = false
if (value) {
this.projectInfo.welfareProjectSubjects[0].options.forEach(v => {
if (v.id === this.selectedOptionsId) {
v.selectSpecs = value.value
}
})
// this.projectInfo.welfareProjectSubjects[0].options[this.selectedOptionsIndex].selectSpecs = value.value
}
},
editAddress(item) {
pjaxReplace('/mobile/welfare/mine/addressEdit?projectId=' + this.projectId + '&id=' + item.id)
window.sessionStorage.setItem('welfareProjectId', this.projectId)
@@ -629,14 +677,29 @@ layout("/mobile/platform.html"){
}
}
const formData = this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1).map(v => {
const options = this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1)
for (const option of options) {
// 检查是否有 specs
if (option.specs) {
// 检查 selectSpecs 是否为空或未定义
if (!option.selectSpecs) {
this.$toast.fail('请选择' + option.optionName + '的规格')
return
}
}
}
const formData = options.map(v => {
return {
welfareId: this.projectId,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.selectAddress,
userSign: this.signData,
selectNum: v.selectNum
selectNum: v.selectNum,
selectSpecs: v.selectSpecs
}
})
const {
@@ -655,7 +718,7 @@ layout("/mobile/platform.html"){
} else {
vant.Dialog.alert({
title: '温馨提示',
message: "您已完成本次福利选择。",
message: "您已完成本次选择。",
}).then(async () => {
this.confirmPopup = false
await this.getProjectInfo()
@@ -739,6 +802,9 @@ layout("/mobile/platform.html"){
if (option) {
v.selectNum = option.selectNum
selectNum = Number(selectNum) + Number(v.selectNum)
if (option.selectSpecs) {
v.selectSpecs = option.selectSpecs
}
}
})
this.selectNum = selectNum