This commit is contained in:
2024-12-17 14:53:38 +08:00
parent a453c6b0e3
commit 39d2bfe22e
8 changed files with 352 additions and 177 deletions
@@ -142,8 +142,9 @@ layout("/mobile/platform.html"){
<template v-show="vLoading && !vLoading.value">
<div>
<van-image :src="CREATE_PREVIEW_URL(projectInfo.cover)" style="width: 100%;height: 150px"
fit="cover"></van-image>
<van-image :src="CREATE_PREVIEW_URL(projectInfo.cover)"
fit="cover"
style="width: 100%;height: 150px"></van-image>
</div>
<!--基本信息-->
@@ -219,19 +220,19 @@ layout("/mobile/platform.html"){
备注:{{option.simpleDesc}}
</div>
<div style="position: absolute;right: 10px;bottom: 0;left: 0;display: flex;justify-content: space-between">
<div style="width: 70px;font-size: 13px;color: #918a8a;text-align: right"
@click="openViewDesc(option.description)">
<div @click="openViewDesc(option.description)"
style="width: 70px;font-size: 13px;color: #918a8a;text-align: right">
套餐详情
</div>
<van-stepper :default-value="0"
:disabled="confirmButtonInfo.disabled"
:min="0"
@change="(value)=>{numChange(value,option,oidx)}"
async-change
button-size="20"
theme="round"
:disabled="confirmButtonInfo.disabled"
integer
disable-input
integer
theme="round"
v-model="option.selectNum"></van-stepper>
</div>
</div>
@@ -241,8 +242,8 @@ layout("/mobile/platform.html"){
<van-submit-bar :button-text="confirmButtonInfo.text"
@submit="confirmSelect"
tip-icon="info-o"
tip="您可以在福利选择截至时间之前修改福利套餐">
tip="您可以在福利选择截至时间之前修改福利套餐"
tip-icon="info-o">
<div style="width: calc(100% - 110px);">
<div style="width: 25px;height: 25px;position: relative">
<van-icon name="shopping-cart-o" size="25"></van-icon>
@@ -261,7 +262,8 @@ layout("/mobile/platform.html"){
配送至
</div>
<template v-if="addressList && addressList.length>0">
<van-cell @click="addressClick(item);selectAddressPopup=false" clickable icon="location-o"
<van-cell @click="addressClick(item);selectAddressPopup=false" clickable
icon="location-o"
v-for="item in addressList">
<template #title>
{{item.address}}
@@ -294,10 +296,11 @@ layout("/mobile/platform.html"){
title="详情"></van-nav-bar>
</van-sticky>
<div class="desc" v-html="desc" @click="descImgClick" style="padding: 20px;"></div>
<div @click="descImgClick" class="desc" style="padding: 20px;" v-html="desc"></div>
</van-popup>
<van-popup :style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
<van-popup :close-on-click-overlay="false"
:style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
closeable
position="bottom"
round
@@ -312,16 +315,23 @@ layout("/mobile/platform.html"){
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">已选福利</div>
</van-cell>
<van-cell style="padding: 0">
<van-cell style="padding: 0" v-for="(item,index) in selectedOptions">
<van-card
:key="item.id"
:num="item.selectNum"
:thumb="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
:title="item.optionName"
desc=""
style="border-radius: 8px;background: #FFFFFF"
:thumb="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
v-for="item in selectedOptions"
></van-card>
<div class="van-hairline--top"></div>
<van-cell @click="openShoppingPopup(item,index)" is-link title="收货门店"
v-if="item.shoppingId">
<template #label>
{{item.receiveAddress?item.receiveAddress:'暂未选择'}}
</template>
</van-cell>
</van-cell>
</div>
@@ -352,8 +362,8 @@ layout("/mobile/platform.html"){
</van-cell>
<van-cell title="">
<template #label>
<mobile-sign :is_value_base64="false" v-model="signData" prefix="welfare"
ref="signature"></mobile-sign>
<mobile-sign :is_value_base64="false" prefix="welfare" ref="signature"
v-model="signData"></mobile-sign>
</template>
</van-cell>
</div>
@@ -365,6 +375,35 @@ layout("/mobile/platform.html"){
</div>
</van-popup>
<van-popup :style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="shoppingPopup">
<div>
<div style="margin-top: 45px">
<van-search
@search="onSearchShoppingAddress"
label="门店"
placeholder="请输入搜索关键词"
show-action
v-model="shoppingAddress">
<template #action>
<div @click="onSearchShoppingAddress">搜索</div>
</template>
</van-search>
<div class="van-cell-group--inset">
<van-cell @click="addShopping(item.address)" is-link
v-for="item in offlineStoresOption">{{item.address}}
</van-cell>
</div>
</div>
</div>
</van-popup>
</div>
<script>
@@ -388,10 +427,17 @@ layout("/mobile/platform.html"){
selectAddress: null,
userSelection: [],
descPopup: false,
signData: null
signData: null,
shoppingPopup: false,
shoppingTypeOptions: [],
offlineStoresOption: [],
shoppingAddress: "",
optionIndex: null,
}
},
computed: {
sumSelectNum() {
if (this.projectInfo && this.projectInfo.welfareProjectSubjects) {
return this.projectInfo.welfareProjectSubjects[0].options.map(v => v.selectNum).reduce((accumulator, currentValue) => accumulator + currentValue, 0)
@@ -404,7 +450,7 @@ layout("/mobile/platform.html"){
}
return false
},
selectTime(){
selectTime() {
if (this.userSelection && this.userSelection.length > 0) {
return this.userSelection[0].selectTime
}
@@ -426,11 +472,11 @@ layout("/mobile/platform.html"){
} else {
//已选择了不能再动了
if (this.isSelect) {
if(moment(this.selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()){
if (moment(this.selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
return {text: '确定修改', disabled: false}
}
return {text: '选择已结束', disabled: true}
}else{
} else {
if (now > moment(choiceTimeStart).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
return {text: this.isSelect ? '确定修改' : '确定选择', disabled: false}
} else if (now > moment(overdueChoiceTimeEnd).valueOf()) {
@@ -451,6 +497,19 @@ layout("/mobile/platform.html"){
}
},
methods: {
addShopping(address) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex], 'receiveAddress', address)
this.shoppingPopup = false
},
onSearchShoppingAddress() {
},
openShoppingPopup(item, optionIndex) {
const shopping = this.shoppingTypeOptions.find(v => v.id === item.shoppingId)
this.offlineStoresOption = shopping.offlineStores
this.optionIndex = optionIndex
this.shoppingPopup = true
},
//数量更改
numChange(value, option, optionIndex) {
const {
@@ -524,17 +583,24 @@ layout("/mobile/platform.html"){
return
}
}
const notReceiveAddress = []
const formData = this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1).map(v => {
if (v.shoppingId && !v.receiveAddress) {
notReceiveAddress.push(v.optionName)
}
return {
welfareId: this.projectId,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.selectAddress,
receiveAddress: this.projectInfo.provideMode === 3 ? this.selectAddress : v.receiveAddress,
userSign: this.signData,
selectNum: v.selectNum
}
})
if (notReceiveAddress.length > 0){
this.$modal.msg("请填写收货门店:" + notReceiveAddress.join(","))
return
}
const {
code,
msg,
@@ -608,15 +674,21 @@ layout("/mobile/platform.html"){
const option = this.userSelection.find(x => x.selectOptionId === v.id)
if (option) {
v.selectNum = option.selectNum
v.receiveAddress = option.receiveAddress
}
})
},
async getShoppingType() {
const resp = await $.get("/platform/shoppingType/apply/getShoppingType")
this.shoppingTypeOptions = resp.data
},
},
created() {
const id = GetQueryString("projectId")
if (!id) return
this.projectId = id
this.getProjectInfo()
this.getShoppingType()
// this.getChoice()
getEnumOptions("WelfareProvideMode").then(res => {
this.welfareProvideMode = res