first commit

This commit is contained in:
2026-01-08 14:58:16 +08:00
commit 556e5d64aa
9575 changed files with 1621095 additions and 0 deletions
@@ -0,0 +1,217 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.table-card .van-image__img {
border-radius: 5%;
}
.benefitName {
font-weight: bold;
font-size: 17px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.collapse .van-cell__left-icon {
color: red;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="()=>this.$pjaxReplace('/platform/h5/home')" left-arrow left-text="返回" placeholder title="选择福利"></van-nav-bar>
<van-dropdown-menu>
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<div>
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
<div class="table-list">
<div :key="row.id" class="table-card" v-for="row in tableData">
<van-image :src="row.cover" fit="cover" height="200" width="100%"></van-image>
<div style="margin: 10px">
<div class="benefitName">{{row.benefitName}}</div>
<div style="font-size: 15px">选择开始时间:{{$moment(row.startChoiceTime).format('YYYY-MM-DD HH:mm')}}</div>
<div style="font-size: 15px">选择结束时间:{{$moment(row.endChoiceTime).format('YYYY-MM-DD HH:mm')}}</div>
<div style="display: flex; justify-content: flex-end">{{row.isChoice?'已选择':'未选择'}}</div>
<div class="van-hairline--bottom"></div>
</div>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<van-button @click="openView(row.benefitId)" round size="small" type="primary">查看详情</van-button>
</div>
</div>
</div>
</van-list>
<van-empty description="暂无数据" image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" v-else></van-empty>
</div>
<van-action-sheet title="查看详情" v-model="descPopup">
<van-collapse class="collapse" v-model="benefitViews">
<van-collapse-item icon="star" name="1" title="福利信息">
<div>
<van-cell-group>
<van-cell :value="viewData.name" title="福利名称"></van-cell>
<van-cell title="是否电子签字">
<dict-tag :options="dict.type.BENEFIT_SIGN_MODE" :value="viewData.signMode"></dict-tag>
</van-cell>
<van-cell title="发放形式">
<dict-tag :options="dict.type.BENEFIT_PROVIDE_MODE" :value="viewData.provideMode"></dict-tag>
</van-cell>
<van-cell title="选择开始时间" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
{{$moment(viewData.startChoiceTime).format("YYYY-MM-DD HH:mm")}}
</van-cell>
<van-cell title="选择结束时间" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
{{$moment(viewData.endChoiceTime).format("YYYY-MM-DD HH:mm")}}
</van-cell>
<van-cell title="逾期选择时间" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
<span v-if="viewData.endOverdueChoiceTime">{{ $moment(viewData.endOverdueChoiceTime).format("YYYY-MM-DD HH:mm") }}</span>
<span v-else>暂无</span>
</van-cell>
<van-cell title="福利总积分" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">{{viewData.totalMoney}}</van-cell>
<van-cell title="福利名称" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_ONE'">{{viewData.giftName}}</van-cell>
</van-cell-group>
</div>
</van-collapse-item>
</van-collapse>
<div class="van-cell-group--inset">
<div v-if="userSelection&&userSelection.length>0">
<van-cell>
<template #title>
<div style="font-weight: bold; font-size: 15px">已选福利</div>
</template>
</van-cell>
<div :key="item.id" v-for="item in userSelection">
<van-card
:num="item.selectNum"
:thumb="item.goods.imgUrl[0].url"
style="border-radius: 8px; background: #ffffff"
v-if="item.goods"
>
<template #title>
<div style="font-weight: bold; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
{{item.goods.name}}
</div>
</template>
<template #desc>
<div>{{item.goods.simpleDesc}}</div>
</template>
</van-card>
<div style="margin: 5px 20px 5px 20px">
<div v-if="item.specificationsName">所选规格:{{item.specificationsName}}</div>
<div class="van-hairline--bottom"></div>
<div v-if="item.receiveAddress">{{item.receiveAddress}}</div>
<div class="van-hairline--bottom"></div>
<div v-if="item.shopAddress">收货门店:{{item.shopAddress}}</div>
</div>
</div>
</div>
<van-cell>
<template #title>
<div style="font-weight: bold; font-size: 15px">电子签名</div>
</template>
</van-cell>
<van-cell title="">
<template #label>
<van-image :src="userSign" style="width: 100%; height: 150px; border: 1px dashed"></van-image>
</template>
</van-cell>
</div>
</van-action-sheet>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: "#app",
store,
dicts: ["BENEFIT_FESTIVAL", "BENEFIT_SIGN_MODE", "BENEFIT_PROVIDE_MODE", "BENEFIT_GOODS_PROVIDE_MODE"],
data() {
return {
tableData: [],
finished: false,
loading: false,
pageForm: {
pageNumber: 1,
pageSize: 5,
totalCount: 0,
year: new Date().getFullYear()
},
yearList: [],
descPopup: false,
benefitViews: [],
viewData: {},
userSelection: [],
userSign: ""
}
},
methods: {
doSearch() {
this.tableKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.tableData = []
this.pageData()
},
pageData() {
this.loading = true
this.$axios.post("/platform/benefit/userSelection/mine/pageData", this.pageForm).then((res) => {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
this.pageForm.totalCount = res.data.totalCount
this.loading = false
})
},
async findOneBenefit(id) {
const res = await this.$axios.post("/platform/benefit/userSelection/findOneBenefit", { id })
if (res.code === 0) {
this.viewData = res.data
}
},
async selectSelectionBenefit(benefitId) {
const res = await this.$axios.post("/platform/benefit/userSelection/selectSelectionBenefit", { benefitId })
if (res.code === 0) {
this.userSelection = res.data
}
},
async getUserSelectionSign(benefitId) {
const res = await this.$axios.post("/platform/h5/benefit/userSelection/getUserSelectionSign", { benefitId })
if (res.code === 0) {
this.userSign = res.data.userSign
}
},
async openView(id) {
await this.findOneBenefit(id)
if (this.viewData.provideMode === "BENEFIT_PROVIDE_MODE_ONE") {
this.benefitViews = ["1"]
this.userSelection = []
await this.getUserSelectionSign(id)
} else {
this.benefitViews = []
await this.selectSelectionBenefit(id)
this.userSelection.map((v) => {
const data = this.viewData.benefitGoodsList.find((b) => b.id === v.goodsId)
v.goods = data
if (v.specificationsId) {
const specifications = data.benefitGoodsSpecificationsList.find((x) => x.id === v.specificationsId)
v.specificationsName = specifications.name
}
this.userSign = v.userSign
})
}
this.descPopup = true
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->