会员、福利

This commit is contained in:
Paidax
2024-12-25 11:09:17 +08:00
parent d78b9bbc8d
commit 0f6787c0cd
14 changed files with 277 additions and 58 deletions
@@ -132,6 +132,18 @@ layout("/mobile/platform.html"){
border: 1pt solid #000000 !important;
}
.top-text {
font-size: 19px;
width: inherit;
margin-top: -5px;
position: absolute;
font-family: "";
top: 0;
right: 0;
transform: rotate(23deg);
z-index: 1;
}
</style>
<div id="app" v-cloak>
@@ -149,38 +161,46 @@ layout("/mobile/platform.html"){
<!--基本信息-->
<van-cell-group class="van-cell-group--inset">
<van-cell>
<div style="font-weight: bold;font-size: 15px;display: flex;align-items: center">
福利信息
<div style="font-weight: bold;font-size: 15px;display: flex;align-items: center;justify-content: space-between">
<div>
<span>福利信息</span>
</div>
<div @click="clickUpOrDown=!clickUpOrDown">
<span>{{clickUpOrDown ? '点击收起' : '点击展开'}}</span>
<van-icon :name="clickUpOrDown?'arrow-up':'arrow-down'"></van-icon>
</div>
</div>
</van-cell>
<van-cell :border="false" :value="projectInfo.name" title="福利名称"></van-cell>
<van-cell :border="false" :value="projectInfo.festival" title="发放节日"></van-cell>
<van-cell :border="false" :value="projectInfo.gift" title="福利礼品"
v-if="!projectInfo.flexible"></van-cell>
<!--<van-cell :border="false" :value="projectInfo.provideAddress"
title="发放地点"></van-cell>-->
<van-cell :border="false" title="选择形式">
{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
</van-cell>
<van-cell :border="false" :value="projectInfo.multiSelectNum" title="最多选几个"
v-if="projectInfo.isCheckBox==='checkBox'"></van-cell>
<van-cell :border="false" title="发放形式">
<template>
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="签收形式">
<template>
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) &&
welfareSignMode.find(v=>v.code==projectInfo.signMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="选择时间">
<template #label>
{{projectInfo.choiceTimeStart + ' 至 ' + projectInfo.choiceTimeEnd}}
</template>
</van-cell>
<template v-if="clickUpOrDown">
<van-cell :border="false" :value="projectInfo.name" title="福利名称"></van-cell>
<van-cell :border="false" :value="projectInfo.festival" title="发放节日"></van-cell>
<van-cell :border="false" :value="projectInfo.gift" title="福利礼品"
v-if="!projectInfo.flexible"></van-cell>
<!--<van-cell :border="false" :value="projectInfo.provideAddress"
title="发放地点"></van-cell>-->
<van-cell :border="false" title="选择形式">
{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
</van-cell>
<van-cell :border="false" :value="projectInfo.multiSelectNum" title="最多选几个"
v-if="projectInfo.isCheckBox==='checkBox'"></van-cell>
<van-cell :border="false" title="发放形式">
<template>
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="签收形式">
<template>
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) &&
welfareSignMode.find(v=>v.code==projectInfo.signMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="选择时间">
<template #label>
{{projectInfo.choiceTimeStart + ' 至 ' + projectInfo.choiceTimeEnd}}
</template>
</van-cell>
</template>
</van-cell-group>
<!--礼品套餐-->
@@ -197,12 +217,17 @@ layout("/mobile/platform.html"){
<div class="selection" style="background: #FFF"
v-for="(subject,sidx) in projectInfo.welfareProjectSubjects">
<div style="display: flex;width: 100%;padding: 10px 0"
<div style="display: flex;width: 100%;padding: 10px 0;flex-wrap: wrap"
v-for="(option, oidx) in subject.options">
<div style="width: 120px;height: 100px;display: flex;justify-content: center;align-items: center">
<van-image :src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+option.imgUrl"
<div style="width: 120px;height: 100px;display: flex;justify-content: center;align-items: center;position:relative;">
<div v-if="[1,2,3].includes(option.rank)">
<div class="top-text" :style="'color:' + getRankColor(option.rank)">TOP{{option.rank}}</div>
</div>
<van-image src="https://s21.ax1x.com/2024/12/24/pAjYEGT.png"
asrc="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>
<!-- @click="vant.ImagePreview([CREATE_PREVIEW_URL(option.imgUrl)])"-->
</div>
@@ -219,7 +244,7 @@ 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"
<div style="width: 70px;font-size: 13px;color: #918a8a;text-align: right;"
@click="openViewDesc(option.description)">
套餐详情
</div>
@@ -388,7 +413,9 @@ layout("/mobile/platform.html"){
selectAddress: null,
userSelection: [],
descPopup: false,
signData: null
signData: null,
clickUpOrDown: false
}
},
computed: {
@@ -404,7 +431,7 @@ layout("/mobile/platform.html"){
}
return false
},
selectTime(){
selectTime() {
if (this.userSelection && this.userSelection.length > 0) {
return this.userSelection[0].selectTime
}
@@ -426,11 +453,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 +478,19 @@ layout("/mobile/platform.html"){
}
},
methods: {
// top字体颜色
getRankColor(rank) {
switch(rank) {
case 1:
return 'red';
case 2:
return 'yellow';
case 3:
return 'blue';
default:
return 'transparent';
}
},
//数量更改
numChange(value, option, optionIndex) {
const {
@@ -550,6 +590,7 @@ layout("/mobile/platform.html"){
this.$modal.msgError(msg)
}
this.confirmPopup = false
await this.getProjectInfo()
},
//查看详情
@@ -571,7 +612,7 @@ layout("/mobile/platform.html"){
//地址管理
openAddressManage() {
pjaxReplace('/mobile/welfare/mine/address?projectId='+this.projectId)
pjaxReplace('/mobile/welfare/mine/address?projectId=' + this.projectId)
window.sessionStorage.setItem('welfareProjectId', this.projectId)
},