This commit is contained in:
2024-12-17 18:05:05 +08:00
parent 39d2bfe22e
commit 8fd04f131d
@@ -386,18 +386,24 @@ layout("/mobile/platform.html"){
<div style="margin-top: 45px">
<van-search
@search="onSearchShoppingAddress"
label="门店"
placeholder="请输入搜索关键词"
placeholder="请输入门店关键词"
show-action
v-model="shoppingAddress">
<template #action>
<div @click="onSearchShoppingAddress">搜索</div>
</template>
</van-search>
<div class="van-cell-group--inset">
<div class="van-cell-group--inset"
v-if="offlineStoresOption&&offlineStoresOption.length>0">
<van-cell @click="addShopping(item.address)" is-link
v-for="item in offlineStoresOption">{{item.address}}
v-for="item in offlineStoresOption"
>
{{item.address}}
</van-cell>
</div>
<div v-else>
<van-empty description="描述文字" style="height: calc(100% - 180px);"></van-empty>
</div>
</div>
@@ -434,6 +440,7 @@ layout("/mobile/platform.html"){
offlineStoresOption: [],
shoppingAddress: "",
optionIndex: null,
optionData: {},
}
},
computed: {
@@ -501,13 +508,23 @@ layout("/mobile/platform.html"){
this.$set(this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex], 'receiveAddress', address)
this.shoppingPopup = false
},
onSearchShoppingAddress() {
async onSearchShoppingAddress() {
const data = await this.getShoppingType()
const shopping = data.find(d => d.id === this.optionData.shoppingId)
if (this.shoppingAddress) {
this.offlineStoresOption = shopping.offlineStores.filter(s => s.address.includes(this.shoppingAddress))
} else {
this.offlineStoresOption = shopping.offlineStores
}
},
openShoppingPopup(item, optionIndex) {
this.optionData = item
const shopping = this.shoppingTypeOptions.find(v => v.id === item.shoppingId)
this.offlineStoresOption = shopping.offlineStores
this.optionIndex = optionIndex
this.shoppingAddress = ""
this.shoppingPopup = true
},
//数量更改
@@ -597,7 +614,7 @@ layout("/mobile/platform.html"){
selectNum: v.selectNum
}
})
if (notReceiveAddress.length > 0){
if (notReceiveAddress.length > 0) {
this.$modal.msg("请填写收货门店:" + notReceiveAddress.join(","))
return
}
@@ -680,15 +697,16 @@ layout("/mobile/platform.html"){
},
async getShoppingType() {
const resp = await $.get("/platform/shoppingType/apply/getShoppingType")
this.shoppingTypeOptions = resp.data
return resp.data
},
},
created() {
async created() {
const id = GetQueryString("projectId")
if (!id) return
this.projectId = id
this.getProjectInfo()
this.getShoppingType()
this.shoppingTypeOptions = await this.getShoppingType()
// this.getChoice()
getEnumOptions("WelfareProvideMode").then(res => {
this.welfareProvideMode = res