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