This commit is contained in:
Paidax
2024-11-29 09:03:59 +08:00
commit 2ffadd89a7
3480 changed files with 879405 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,29 @@
const welfareMixins = {
data() {
return {
tarBarActive: '',
addressList: [],
isReceive: false,
isChoice: false,
isAutoSelect: false
}
},
methods: {
async selectAddressList() {
const resp = await $.get('/mobile/welfare/mine/selectUserAddress')
this.addressList = resp.data
},
async getReceive() {
const resp = await $.get('/mobile/welfare/mine/isReceive', {projectId: this.projectId})
this.isReceive = resp.data
},
async getChoice() {
const resp = await $.get('/mobile/welfare/mine/isChoice', {projectId: this.projectId})
this.isChoice = resp.data
},
async getAutoSelect() {
const resp = await $.get('/mobile/welfare/mine/isAutoSelect', {projectId: this.projectId})
this.isAutoSelect = resp.data
}
}
}
@@ -0,0 +1,4 @@
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" url="/mobile/welfare/list/index">首页</van-tabbar-item>
<van-tabbar-item icon="manager-o" url="/mobile/welfare/mine/index">我的</van-tabbar-item>
</van-tabbar>
@@ -0,0 +1,23 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-cell-group inset>
<van-cell title="单元格" value="内容"></van-cell>
<van-cell title="单元格" value="内容" label="描述信息"></van-cell>
</van-cell-group>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,224 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.welfare_card {
margin: 10px 10px 0px;
padding: 20px 10px;
background-color: rgb(255, 255, 255);
border-radius: 10px;
position: relative;
}
.welfare_card .cover .van-image {
width: 100%;
height: 150px;
}
.welfare_card .cover img {
border-radius: 10px;
}
.welfare_card .name {
margin-top: 10px;
display: flex;
align-items: center
}
.welfare_card .footer {
margin-top: 10px;
display: flex;
align-items: center;
}
.welfare_card .footer .time {
width: calc(100% - 100px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
color: #8b8b8b;
}
.welfare_card .footer .status {
width: 100px;
text-align: right;
font-size: 12px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" left-arrow
title="福利列表"></van-nav-bar>
</van-sticky>
<van-sticky>
<van-tabs @change="tabChange" v-model="pageForm.tabName">
<van-tab name="ing" title="进行中"></van-tab>
<van-tab name="end" title="已结束"></van-tab>
</van-tabs>
</van-sticky>
<template v-if="vLoading && !vLoading.value">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
@load="pageData"
v-if="tableData && tableData.length>0"
v-model="loading">
<template :key="item.id" v-for="item in tableData">
<div @click="welfareClick(item)" class="welfare_card">
<div class="cover">
<van-image :src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.cover"
v-if="item.cover"></van-image>
<van-image fit="contain" src="/assets/mobile/svg/welfare/welfareHome.svg"
v-else></van-image>
</div>
<div class="name">
<svg class="icon" height="20" p-id="4175" t="1715150952924"
version="1.1" viewBox="0 0 1024 1024" width="20"
xmlns="http://www.w3.org/2000/svg">
<path d="M513.2288 510.72m-450.816 0a450.816 450.816 0 1 0 901.632 0 450.816 450.816 0 1 0-901.632 0Z"
fill="#FFE1E9" p-id="4176"></path>
<path d="M777.8304 321.6896h-198.4512l62.6176-60.7744a29.2864 29.2864 0 0 0 0.6144-41.4208 29.2864 29.2864 0 0 0-41.4208-0.6144L514.4576 303.104 436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.712 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 19.712 15.9744 35.6352 35.6352 35.6352h27.2384v238.7456c0 45.1072 36.608 81.7152 81.7152 81.7152h301.2096c45.1072 0 81.7152-36.608 81.7152-81.7152V476.3136h27.2384c19.712 0 35.6352-15.9744 35.6352-35.6352V357.376a35.6864 35.6864 0 0 0-35.6864-35.6864z m-230.2464 342.0672c0 16.1792-13.1072 29.2864-29.2864 29.2864s-29.2864-13.1072-29.2864-29.2864v-97.7408c0-16.1792 13.1072-29.2864 29.2864-29.2864s29.2864 13.1072 29.2864 29.2864v97.7408z"
fill="#FF3369" p-id="4177"></path>
<path d="M776.6016 321.6896h-197.2224l62.6176-60.7744a29.2864 29.2864 0 0 0 0.6144-41.4208 29.2864 29.2864 0 0 0-41.4208-0.6144L514.4576 303.104 436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.6608 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 19.712 15.9744 35.6352 35.6352 35.6352h27.2384v238.7456c0 45.1072 36.608 81.7152 81.7152 81.7152H432.64c146.6368-31.8976 265.9328-136.7552 318.0032-274.7392v-45.7216h14.4896a442.2656 442.2656 0 0 0 11.4688-154.5728z m-229.0176 342.0672c0 16.1792-13.1072 29.2864-29.2864 29.2864-16.1792 0-29.2864-13.1072-29.2864-29.2864v-97.7408c0-16.1792 13.1072-29.2864 29.2864-29.2864 16.1792 0 29.2864 13.1072 29.2864 29.2864v97.7408z"
fill="#FF4D7C" p-id="4178"></path>
<path d="M579.3792 321.6896l62.6176-60.7744a29.2864 29.2864 0 0 0 0.6144-41.4208 29.2864 29.2864 0 0 0-41.4208-0.6144L514.4576 303.104 436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.6608 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 19.712 15.9744 35.6352 35.6352 35.6352h27.2384v169.0624c76.6464-11.8272 146.688-43.52 204.9024-89.4976a29.27616 29.27616 0 0 1 22.1696-18.5856c62.8224-56.6784 109.2096-131.1744 131.1744-215.552h-64.8704z"
fill="#FF5F89" p-id="4179"></path>
<path d="M488.3456 275.3024L436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.6608 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 14.4384 8.6016 26.8288 20.8896 32.4096 103.68-33.7408 190.464-105.0112 244.3264-197.7344z"
fill="#FF7196" p-id="4180"></path>
</svg>
{{item.name}}
</div>
<div class="footer">
<div class="time">
{{moment(item.choiceTimeStart).format('YYYY/MM/DD HH:mm')}}
~
{{moment(item.choiceTimeEnd).format('YYYY/MM/DD HH:mm')}}
</div>
<div class="status">
<span style="color: green" v-if="item.isSelect">已选择</span>
<span style="color:red;" v-else>未选择</span>
</div>
</div>
</div>
</template>
</van-list>
<van-empty description="暂无数据" v-else></van-empty>
</template>
<!-- <div>-->
<!-- <van-tabbar v-model="tarBarActive">-->
<!-- <van-tabbar-item icon="home-o" replace url="/mobile/welfare/list/index">职工福利</van-tabbar-item>-->
<!-- <van-tabbar-item icon="manager-o" replace url="/mobile/welfare/mine/index">我的</van-tabbar-item>-->
<!-- </van-tabbar>-->
<!-- </div>-->
</div>
<script>
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, welfareMixins],
data() {
return {
tabName: 'ing',
tarBarActive: 0
}
},
methods: {
async welfareClick(o) {
const {
id,
provideMode,
flexible,
provideTimeEnd,
provideTimeStart,
choiceTimeEnd,
choiceTimeStart
} = o
/* const resp = await $.get('/mobile/welfare/mine/isReceive', {projectId: id})
const isReceive = resp.data*/
if (this.tabName === 'ing') {
if (flexible) {
if (moment().valueOf() < moment(provideTimeEnd).valueOf() &&
moment().valueOf() > moment(provideTimeStart).valueOf()) {
if (moment().valueOf() > moment(choiceTimeEnd).valueOf()) {
if (!o.isSelect) {
vant.Dialog.alert({
title: '提醒',
message: '您在规定时间内没有选择,无法领取!',
}).then(() => {
});
return
}
}
}
pjaxReplace('/mobile/welfare/list/receive?projectId=' + id)
} else {
pjaxReplace('/mobile/welfare/list/receive_success?projectId=' + id + '&provideMode=' + provideMode)
}
} else if (this.tabName === 'end') {
pjaxReplace('/mobile/welfare/list/receive?projectId=' + id + "&type=view")
}
},
async pageData() {
this.mLoading = true
const resp = await $.post('/mobile/welfare/list/pageData', this.pageForm)
if (resp.code === 0) {
if (resp.data.list.length === 0) {
this.tableData = []
this.loading = false
this.finished = true
} else {
this.tableData = this.tableData.concat(resp.data.list)
}
if (this.tableData.length === resp.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false;
this.mLoading = false
},
tabChange(val) {
this.tabName = val
this.startLoading()
this.tableData = []
this.pageForm.pageNumber = 1
this.pageData()
this.closeLoading()
},
init() {
this.startLoading()
this.tarBarActive = Number(GetQueryString("tarBarActive"))
this.pageForm.tabName = 'ing'
this.pageData()
this.closeLoading()
}
},
created() {
this.init()
},
})
window.addEventListener('pageshow', e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.onRefresh()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,57 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
background: #ffffff;
}
.desc {
padding: 10px;
word-wrap: break-word;
word-break: normal;
}
@media (max-width: 750px) {
img {
background-size: contain;
width: 90%;
height: auto;
margin: 0 auto;
display: block;
}
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" left-arrow
title="详情"></van-nav-bar>
</van-sticky>
<div class="desc" v-html="desc"></div>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
desc: null
}
},
methods: {},
created() {
const id = GetQueryString("optionId")
if (id) {
this.desc = window.localStorage.getItem('welfare_option_desc_' + id)
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,633 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
padding-bottom: 90px;
}
.van-cell-group--inset {
margin: 10px 16px !important;
overflow: hidden;
/*border-radius: 8px;*/
}
.selection:not(:last-child) {
border-bottom: 1px dashed lightgrey;
}
.selection .van-checkbox-group .van-cell, .selection .van-radio-group .van-cell {
flex-direction: row-reverse;
}
.selection .van-checkbox-group .van-cell .van-cell__title, .selection .van-radio-group .van-cell .van-cell__title {
padding-left: 20px;
}
.address-cell .van-cell__title {
flex: unset;
width: 70px;
overflow: hidden;
}
.address-cell .van-cell__value {
text-align: left;
display: flex;
align-items: baseline;
}
.van-empty {
position: absolute;
}
.van-collapse-item .van-collapse-item__title {
}
.selection .van-radio {
display: flex;
align-items: baseline;
}
.selection .van-cell__label {
max-height: 80px;
margin-left: 20px;
}
.selection .van-cell__label .welfare_img {
width: 100px;
height: 80px;
}
.welfare_img .van-image__error, .welfare_img .van-image__img, .welfare_img .van-image__loading {
border-radius: 10px;
margin-left: -35px;
}
.selection .van-cell__label .welfare_desc {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
width: calc(100% - 25px);
padding: 0 20px;
line-height: 20px;
max-height: 80px;
/*position: relative;*/
}
.selection .van-cell__label .welfare_desc .more {
/*content:"更多";*/
position: absolute;
bottom: 0;
right: 10px;
color: #1867b0;
}
#signature {
height: 30vh;
background: #fff;
border: 1px dashed grey;
position: relative;
}
#signature .signature_reset {
position: absolute;
bottom: 2px;
right: 2px;
}
.welfare_optionType {
margin-left: 35px;
}
.desc img {
width: 100%;
}
.address-cell .van-cell__title {
width: 0 !important;
}
.right_content {
width: calc(100% - 150px);
padding-left: 20px;
padding-right: 10px;
position: relative;
height: 100px
}
.optionDesc {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
color: #868282;
}
.desc td {
border: 1pt solid #000000 !important;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="pjaxReplace('/mobile/welfare/list/index')" left-arrow
title="福利详情"></van-nav-bar>
</van-sticky>
<template v-show="vLoading && !vLoading.value">
<div>
<van-image :src="CREATE_PREVIEW_URL(projectInfo.cover)" style="width: 100%;height: 150px"
fit="cover"></van-image>
</div>
<!--基本信息-->
<van-cell-group class="van-cell-group--inset">
<van-cell>
<div style="font-weight: bold;font-size: 15px;display: flex;align-items: center">
福利信息
</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>
</van-cell-group>
<!--礼品套餐-->
<div class="van-cell-group--inset"
style="margin:10px auto"
v-if="projectInfo.flexible && [2,3].includes(projectInfo.provideMode)
&& projectInfo.welfareProjectSubjects
&& projectInfo.welfareProjectSubjects.length>0">
<van-cell>
<div style="font-weight: bold;font-size: 15px;display: flex;align-items: center">
选择套餐
</div>
</van-cell>
<div class="selection" style="background: #FFF"
v-for="(subject,sidx) in projectInfo.welfareProjectSubjects">
<div style="display: flex;width: 100%;padding: 10px 0"
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"
fit="contain"
style="width: 100px;height: 100px;border-radius: 10px"></van-image>
<!-- @click="vant.ImagePreview([CREATE_PREVIEW_URL(option.imgUrl)])"-->
</div>
<div class="right_content">
<div style="display: flex;justify-content: space-between;align-items: center;font-size: 14px">
<div style="width: 100%">{{option.optionName}}</div>
</div>
<div class="optionDesc">
<template v-if="option.supplier">
{{option.supplier}}
</template>
</div>
<div class="optionDesc" v-if="option.simpleDesc">
备注:{{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>
<van-stepper :default-value="0"
:min="0"
@change="(value)=>{numChange(value,option,oidx)}"
async-change
button-size="20"
theme="round"
:disabled="confirmButtonInfo.disabled"
integer
disable-input
v-model="option.selectNum"></van-stepper>
</div>
</div>
</div>
</div>
</div>
<van-submit-bar :button-text="confirmButtonInfo.text"
@submit="confirmSelect"
tip-icon="info-o"
tip="您可以在福利选择截至时间之前修改福利套餐">
<div style="width: calc(100% - 110px);">
<div style="width: 25px;height: 25px;position: relative">
<van-icon name="shopping-cart-o" size="25"></van-icon>
<div class="van-info">
{{sumSelectNum}}
</div>
</div>
</div>
</van-submit-bar>
</template>
<van-popup :style="{ height: '70%' }" closeable position="bottom" safe-area-inset-bottom
v-model="selectAddressPopup">
<div style="height: 100%">
<div style="font-size: 15px;font-weight: bold;text-align: center;padding-top: 16px;">
配送至
</div>
<template v-if="addressList && addressList.length>0">
<van-cell @click="addressClick(item);selectAddressPopup=false" clickable icon="location-o"
v-for="item in addressList">
<template #title>
{{item.address}}
</template>
<template #label>
<div>{{"地区:" + item.province + item.city + item.county}}</div>
<div>{{"收件人:" + item.name}}</div>
<div>{{"联系方式:" + item.tel}}</div>
</template>
</van-cell>
</template>
<van-empty description="暂无地址" v-else></van-empty>
<div style="position: absolute;bottom: 0;left: 0;box-sizing: border-box;width: 100%;padding: 0 16px;background: #fff">
<van-button @click="openAddressManage" block round
style="height: 40px;margin: 5px 0"
type="danger">
地址管理
</van-button>
</div>
</div>
</van-popup>
<van-popup :style="{ height: '100%',width: '100%'}" position="right" safe-area-inset-bottom
v-model="descPopup">
<van-sticky>
<van-nav-bar @click-left="descPopup=false" left-arrow
title="详情"></van-nav-bar>
</van-sticky>
<div class="desc" v-html="desc" @click="descImgClick" style="padding: 20px;"></div>
</van-popup>
<van-popup :style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="confirmPopup">
<div>
<!--选择的信息-->
<div class="van-cell-group--inset">
<van-cell>
<van-icon class="van-cell__left-icon" color="red" name="location"
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">已选福利</div>
</van-cell>
<van-cell style="padding: 0">
<van-card
:key="item.id"
:num="item.selectNum"
: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>
</van-cell>
</div>
<!--邮寄到家 填写收货地址-->
<div class="van-cell-group--inset" v-if="projectInfo.provideMode===3">
<van-cell>
<van-icon class="van-cell__left-icon" color="red" name="location"
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">收货地址</div>
</van-cell>
<van-cell @click="clickSelectAddressPopup" class="address-cell" is-link
title="">
<template>
<span v-if="$.isEmptyObject(selectAddress)">请选择地址</span>
<span v-else>
{{selectAddress}}
</span>
</template>
</van-cell>
</div>
<!--电子签字-->
<div class="van-cell-group--inset" v-if="projectInfo.signMode===2">
<van-cell>
<template #title>
<div style="font-weight: bold;font-size: 15px">电子签名</div>
</template>
</van-cell>
<van-cell title="">
<template #label>
<mobile-sign :is_value_base64="false" v-model="signData" prefix="welfare"
ref="signature"></mobile-sign>
</template>
</van-cell>
</div>
<div style="padding: 10px 16px;left: 0;right: 0;bottom: 0;background: #FFFFFF">
<van-button @click="submitSelect" round style="width: 100%" type="danger">提交
</van-button>
</div>
</div>
</van-popup>
</div>
<script>
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, welfareMixins],
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
},
data() {
return {
confirmPopup: false,
desc: null,
projectId: null,
projectInfo: {},
welfareProvideMode: [],
welfareSignMode: [],
selectAddressPopup: false,
selectAddress: null,
userSelection: [],
descPopup: false,
signData: 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)
}
return 0
},
isSelect() {
if (this.userSelection && this.userSelection.length > 0) {
return true
}
return false
},
selectTime(){
if (this.userSelection && this.userSelection.length > 0) {
return this.userSelection[0].selectTime
}
return null
},
confirmButtonInfo() {
if (this.projectInfo) {
const {choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd} = this.projectInfo
const now = moment().valueOf()
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === '') {
if (now > moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) {
return {text: this.isSelect ? '确定修改' : '确定选择', disabled: false}
} else if (now > moment(choiceTimeEnd).valueOf()) {
return {text: '选择已结束', disabled: true}
} else if (now < moment(choiceTimeStart).valueOf()) {
return {text: '选择未开始', disabled: true}
}
} else {
//已选择了不能再动了
if (this.isSelect) {
if(moment(this.selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()){
return {text: '确定修改', disabled: false}
}
return {text: '选择已结束', disabled: true}
}else{
if (now > moment(choiceTimeStart).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
return {text: this.isSelect ? '确定修改' : '确定选择', disabled: false}
} else if (now > moment(overdueChoiceTimeEnd).valueOf()) {
return {text: '选择已结束', disabled: true}
} else if (now < moment(choiceTimeStart).valueOf()) {
return {text: '选择未开始', disabled: true}
}
}
}
}
return {text: '', disabled: true}
},
selectedOptions() {
if (this.projectInfo && this.projectInfo.welfareProjectSubjects) {
return this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1)
}
return []
}
},
methods: {
//数量更改
numChange(value, option, optionIndex) {
const {
isCheckBox,
multiSelectNum,
singleOptionSupportMultipleSelection
} = this.projectInfo
if (isCheckBox === 'checkBox') {
//判断是否支持单个多选
if (!singleOptionSupportMultipleSelection && value > 1) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', 1)
this.$toast('此套餐最多只能选择1份')
return;
}
}
//获取用户当前选择的数量
const selectNums = this.projectInfo.welfareProjectSubjects[0].options.map(v => v.selectNum)
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum > multiSelectNum) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', value - 1)
this.$toast('此次福利最多只能选择' + multiSelectNum + '份')
}
},
//确定选择
async confirmSelect() {
if (this.confirmButtonInfo.disabled) {
this.$modal.msg("当前时间段无法选择")
return
}
const {
isCheckBox,
multiSelectNum,
singleOptionSupportMultipleSelection
} = this.projectInfo
if (isCheckBox === "checkBox") {
if (this.sumSelectNum < multiSelectNum) {
//用户没有选择完
this.$toast('一共可以选择' + multiSelectNum + '份,您目前只选择了' + this.sumSelectNum + '份,快去选择吧!')
return
}
}
this.confirmPopup = true
//回显用户的地址
if (this.projectInfo.provideMode === 3 && this.isSelect && this.userSelection) {
this.selectAddress = this.userSelection[0].receiveAddress
}
//回显用户签名
if (this.projectInfo.signMode === 2 && this.isSelect && this.userSelection) {
this.signData = this.userSelection[0].userSign
}
},
//提交选择
async submitSelect() {
if (this.projectInfo.provideMode === 3) {
if (this.selectAddress == null || this.selectAddress === '') {
this.$modal.msg("请填写您的收货地址")
return
}
}
if (this.projectInfo.signMode === 2) {
if (this.signData == null || this.signData === '') {
this.$modal.msg("请签名")
return
}
}
const formData = this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1).map(v => {
return {
welfareId: this.projectId,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.selectAddress,
userSign: this.signData,
selectNum: v.selectNum
}
})
const {
code,
msg,
data
} = await $.post('/platform/welfare/userChoose/confirmSelect', {
welfareUserSelections: JSON.stringify(formData),
projectId: this.projectId
})
if (code === 0) {
this.getUserSelection(this.projectId)
this.$modal.msgSuccess(msg)
} else {
this.$modal.msgError(msg)
}
this.confirmPopup = false
},
//查看详情
openViewDesc(desc) {
if (desc == null || desc.length === 0) {
this.$toast('没有更多了')
return
}
this.desc = desc
this.descPopup = true
},
descImgClick(e) {
if (e.target.tagName === 'IMG') {
vant.ImagePreview([e.target.src])
}
},
//地址管理
openAddressManage() {
pjaxReplace('/mobile/welfare/mine/address?projectId='+this.projectId)
window.sessionStorage.setItem('welfareProjectId', this.projectId)
},
clickSelectAddressPopup() {
this.selectAddressList()
this.selectAddressPopup = true
},
//地址列表点击
addressClick(item) {
const {province, city, county, address, name, tel} = item
this.selectAddress = "收货地址:" + province + city + county + address + "," + "收件人:" + name + "," + "联系方式:" + tel
},
async getProjectInfo() {
const resp = await $.get('/platform/welfare/common/findOne', {projectId: this.projectId})
if (resp.code === 0) {
resp.data.multiSelectNum = resp.data.multiSelectNum ? resp.data.multiSelectNum : 1
this.projectInfo = resp.data
this.getUserSelection(this.projectId)
}
},
//获取用户选择的数据
async getUserSelection(projectId) {
const resp = await $.get('/platform/welfare/mine/getUserSelection', {projectId: projectId})
this.userSelection = resp.data
this.echoUserSelection()
},
//回显用户选择的数据
echoUserSelection() {
this.projectInfo.welfareProjectSubjects[0].options.forEach(v => {
const option = this.userSelection.find(x => x.selectOptionId === v.id)
if (option) {
v.selectNum = option.selectNum
}
})
},
},
created() {
const id = GetQueryString("projectId")
if (!id) return
this.projectId = id
this.getProjectInfo()
// this.getChoice()
getEnumOptions("WelfareProvideMode").then(res => {
this.welfareProvideMode = res
})
getEnumOptions("WelfareSignMode").then(res => {
this.welfareSignMode = res
})
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,72 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
background: #ffffff;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar :title="title" left-arrow
@click-left="history.back()"></van-nav-bar>
</van-sticky>
<div style="text-align: center;margin-top: 200px;">
<svg t="1642388297798" class="icon" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="3082" width="80" height="80">
<path d="M37.36963 583.753525a440.246475 430.879529 90 1 0 861.759058 0 440.246475 430.879529 90 1 0-861.759058 0Z"
fill="#07C160" p-id="3083"></path>
<path d="M247.376566 529.799914L391.065522 674.425565l299.742281-299.742281 59.948456 59.948456-359.690737 358.754043L187.240771 589.748371z"
fill="#FFFFFF" p-id="3084"></path>
<path d="M955.330366 240.548613h-83.927839a30.723584 30.723584 0 0 0-31.472939 30.161567v1.124034a30.910923 30.910923 0 0 0 30.348906 31.472939H955.330366a30.723584 30.723584 0 0 0 31.2856-30.348906v-1.124033A30.536245 30.536245 0 0 0 955.330366 240.548613z m-72.125487-168.605033a32.222295 32.222295 0 0 0-43.837308 4.121457L786.725333 141.071644a31.285601 31.285601 0 0 0 48.146104 39.903191l52.080221-64.819268a30.536245 30.536245 0 0 0-2.810084-42.900614zM683.126907 0.005433a30.910923 30.910923 0 0 0-31.47294 30.161567v84.864533a30.723584 30.723584 0 0 0 30.348906 31.285601h1.124034a30.536245 30.536245 0 0 0 31.2856-30.161567V31.291033A30.723584 30.723584 0 0 0 684.25094 0.005433z"
fill="#07C160" p-id="3085"></path>
</svg>
<div style="margin-top: 20px;">{{code=='2' ? '您已领取' : '您已选择'}}</div>
<div style="margin: 20px auto 0px auto;width: 300px;word-break: break-all">
福利品: {{selectOptionNames}}
</div>
<van-button style="margin-top: 20px;width: 100px" size="small" hairline type="primary"
@click="back">返回
</van-button>
</div>
</div>
<script>
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, welfareMixins],
data() {
return {
selectOptionNames: null
}
},
methods: {
async getUserSelection() {
const resp = await $.get('/mobile/welfare/mine/getUserSelect', {projectId: this.projectId})
this.selectOptionNames = resp.data
},
back() {
window.history.go(-1)
}
},
created() {
const id = GetQueryString("projectId")
if (id) {
this.projectId = id
this.getUserSelection()
}
this.provideMode = GetQueryString("provideMode")
this.code = GetQueryString("code")
this.title = this.code === '1' ? "选择结果" : '领取结果'
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,79 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-cell-group--inset {
margin: 0 16px;
overflow: hidden;
border-radius: 8px;
}
.bottom-button {
width: 160px;
height: 40px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="地址管理" left-arrow
@click-left="back"></van-nav-bar>
</van-sticky>
<div v-if="vLoading && !vLoading.value">
<van-address-list
v-if="addressList && addressList.length>0 "
v-model="chosenAddressId"
:list="addressList"
default-tag-text="默认"
@add="onAdd"
@edit="onEdit"
></van-address-list>
<van-empty v-else description="暂无地址">
<van-button round type="danger" class="bottom-button" @click="onAdd">新增地址</van-button>
</van-empty>
</div>
</div>
<script>
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, welfareMixins],
data() {
return {
projectId:GetQueryString("projectId"),
chosenAddressId: null
}
},
methods: {
back() {
if (this.projectId) {
location.replace("/mobile/welfare/list/receive?projectId=" + this.projectId)
} else {
pjaxReplace("/mobile/index")
}
},
onAdd() {
pjaxReplace("/mobile/welfare/mine/addressEdit?projectId=" + this.projectId)
},
onEdit(item, index) {
pjaxReplace("/mobile/welfare/mine/addressEdit?id=" + item.id)
}
},
async created() {
this.startLoading()
await this.selectAddressList()
this.closeLoading()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,114 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-cell-group--inset {
margin: 0 16px;
overflow: hidden;
border-radius: 8px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="地址管理" left-arrow placeholder fixed
@click-left="back"></van-nav-bar>
</van-sticky>
<div v-if="vLoading && !vLoading.value">
<van-address-edit
ref="address"
:area-list="areaList"
:show-delete="addressId"
:address-info="addressInfo"
show-set-default
show-search-result
tel-maxlength="11"
:area-columns-placeholder="['请选择', '请选择', '请选择']"
@save="onSave"
@delete="onDelete"
></van-address-edit>
</div>
</div>
<script>
<!--#include("/mobile/welfare/include/areaList.js"){};include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, welfareMixins],
data() {
return {
projectId:GetQueryString("projectId"),
areaList: areaList,
addressInfo: {},
addressId: null
};
},
methods: {
back() {
if (this.projectId) {
pjaxReplace("/mobile/welfare/mine/address?projectId=" + this.projectId)
} else {
pjaxReplace("/mobile/welfare/mine/address")
}
},
async onSave(content) {
const loading = this.$toast.loading({
message: '保存中...',
forbidClick: true,
overlay: true,
duration: 0
})
content.userName = content.name
const resp = await $.post('/mobile/welfare/mine/doSaveUserAddress', content)
loading.close()
if (resp.code === 0) {
this.$toast.success(resp.msg)
setTimeout(() => {
this.back()
}, 500)
}
},
async onDelete(content) {
const loading = this.$toast.loading({
message: '删除中...',
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post('/mobile/welfare/mine/deleteAddress', {id: content.id})
loading.close()
if (resp.code === 0) {
this.$toast.success(resp.msg)
setTimeout(() => {
this.back()
}, 500)
}
}
},
async created() {
this.startLoading()
this.addressId = GetQueryString("id") === '' ? null : GetQueryString("id")
if (this.addressId) {
const resp = await $.get('/mobile/welfare/mine/findOneUserAddress', {id: this.addressId})
if (resp.code === 0) {
this.addressInfo = resp.data
}
this.closeLoading()
} else {
this.addressInfo.name = "${@shiro.getPrincipalProperty('username')}";
this.closeLoading()
}
/* this.areaList.province_list = {320000: "江苏省"}
this.areaList.city_list = {320200: "无锡市"}*/
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,64 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-cell-group--inset {
margin: 0 16px;
overflow: hidden;
border-radius: 8px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="个人信息" left-arrow placeholder fixed
@click-left="history.back()"></van-nav-bar>
</van-sticky>
<div class="mt10" v-if="vLoading && !vLoading.value">
<van-cell-group class="van-cell-group--inset">
<van-cell>
<template #title>
<div style="font-weight: bold;font-size: 15px">个人信息</div>
</template>
</van-cell>
<van-cell :border="false" is-link title="我选择的福利" url="/mobile/welfare/mine/myWelfare">
<template #icon>
<van-icon class="van-cell__left-icon" color="red" name="star"></van-icon>
</template>
</van-cell>
<van-cell :border="false" is-link title="我的收货地址" url="/mobile/welfare/mine/address">
<template #icon>
<van-icon class="van-cell__left-icon" color="red" name="location"></van-icon>
</template>
</van-cell>
<!-- <van-cell :border="false" is-link title="我的签名" url="/mobile/welfare/mine/sign">-->
<!-- <template #icon>-->
<!-- <van-icon class="van-cell__left-icon" color="red" name="coupon"></van-icon>-->
<!-- </template>-->
<!-- </van-cell>-->
</van-cell-group>
</div>
</div>
<script>
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, welfareMixins],
data() {
return {
tarBarActive: 1
}
},
created() {
this.startLoading()
this.closeLoading()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,557 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-card {
background: transparent;
}
.address-cell .van-cell__title {
width: 0 !important;
}
.van-cell-group--inset {
margin: 10px 16px !important;
overflow: hidden;
}
.logistics_cell {
flex-direction: column;
}
.logistics_cell .van-step__title {
text-align: left;
}
.logistics_cell .van-step__title h3 {
margin: 0;
font-weight: normal;
font-size: inherit;
}
.evaluateForm .evaluateTextField .van-field__label {
margin-right: 0;
}
.evaluateForm .evaluateTextField .van-field__value textarea {
padding: 10px;
background-color: #f3f3f3;
}
.van-action-sheet__header {
font-weight: bold;
}
.courierNumberSheet .van-empty {
position: relative;
left: unset !important;
top: unset !important;
transform: unset !important;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="pjaxReplace('/mobile//index')" left-arrow
title="我的福利"></van-nav-bar>
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item :options="yearOption" @change="yearChange"
v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<template v-if="vLoading && !vLoading.value">
<van-list
:finished="finished"
@load="pageData"
finished-text="没有更多了"
v-if="tableData.length>=0"
v-model="loading">
<template v-for="item in tableData">
<div style="padding: 10px;margin:10px 10px 0 10px;position: relative;background: #FFFFFF;border-radius: 10px">
<div style="font-weight: bold;display: flex;align-items: center">
<svg class="icon" height="20" p-id="4175" t="1715150952924"
version="1.1" viewBox="0 0 1024 1024" width="20"
xmlns="http://www.w3.org/2000/svg">
<path d="M513.2288 510.72m-450.816 0a450.816 450.816 0 1 0 901.632 0 450.816 450.816 0 1 0-901.632 0Z"
fill="#FFE1E9" p-id="4176"></path>
<path d="M777.8304 321.6896h-198.4512l62.6176-60.7744a29.2864 29.2864 0 0 0 0.6144-41.4208 29.2864 29.2864 0 0 0-41.4208-0.6144L514.4576 303.104 436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.712 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 19.712 15.9744 35.6352 35.6352 35.6352h27.2384v238.7456c0 45.1072 36.608 81.7152 81.7152 81.7152h301.2096c45.1072 0 81.7152-36.608 81.7152-81.7152V476.3136h27.2384c19.712 0 35.6352-15.9744 35.6352-35.6352V357.376a35.6864 35.6864 0 0 0-35.6864-35.6864z m-230.2464 342.0672c0 16.1792-13.1072 29.2864-29.2864 29.2864s-29.2864-13.1072-29.2864-29.2864v-97.7408c0-16.1792 13.1072-29.2864 29.2864-29.2864s29.2864 13.1072 29.2864 29.2864v97.7408z"
fill="#FF3369" p-id="4177"></path>
<path d="M776.6016 321.6896h-197.2224l62.6176-60.7744a29.2864 29.2864 0 0 0 0.6144-41.4208 29.2864 29.2864 0 0 0-41.4208-0.6144L514.4576 303.104 436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.6608 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 19.712 15.9744 35.6352 35.6352 35.6352h27.2384v238.7456c0 45.1072 36.608 81.7152 81.7152 81.7152H432.64c146.6368-31.8976 265.9328-136.7552 318.0032-274.7392v-45.7216h14.4896a442.2656 442.2656 0 0 0 11.4688-154.5728z m-229.0176 342.0672c0 16.1792-13.1072 29.2864-29.2864 29.2864-16.1792 0-29.2864-13.1072-29.2864-29.2864v-97.7408c0-16.1792 13.1072-29.2864 29.2864-29.2864 16.1792 0 29.2864 13.1072 29.2864 29.2864v97.7408z"
fill="#FF4D7C" p-id="4178"></path>
<path d="M579.3792 321.6896l62.6176-60.7744a29.2864 29.2864 0 0 0 0.6144-41.4208 29.2864 29.2864 0 0 0-41.4208-0.6144L514.4576 303.104 436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.6608 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 19.712 15.9744 35.6352 35.6352 35.6352h27.2384v169.0624c76.6464-11.8272 146.688-43.52 204.9024-89.4976a29.27616 29.27616 0 0 1 22.1696-18.5856c62.8224-56.6784 109.2096-131.1744 131.1744-215.552h-64.8704z"
fill="#FF5F89" p-id="4179"></path>
<path d="M488.3456 275.3024L436.3264 219.8528a29.28128 29.28128 0 0 0-41.3696-1.3312 29.2352 29.2352 0 0 0-1.28 41.3696L451.584 321.6896H258.7648c-19.6608 0-35.6352 15.9744-35.6352 35.6352v83.3024c0 14.4384 8.6016 26.8288 20.8896 32.4096 103.68-33.7408 190.464-105.0112 244.3264-197.7344z"
fill="#FF7196" p-id="4180"></path>
</svg>
{{item.name}}
</div>
<van-card>
<template #thumb>
<img :src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.cover" alt=""
style="width: 88px;height: 88px"
v-if="item.cover">
<img src="/assets/mobile/svg/welfare/welfareHome.svg"
style="width: 88px;height: 88px"
v-else/>
</template>
<div slot="tags" style="margin-top: 5px;padding-left: 30px;"
v-if="item.gifts">
<div :key="item.name" class="van-card__bottom"
v-for="gift in item.gifts">
<div class="van-card__price">
{{gift.name}}
</div>
<div class="van-card__num">x{{gift.num}}</div>
</div>
</div>
<div slot="footer" style="margin-top: 10px;">
<van-button @click="openEvaluate(item)" plain round size="small">评价商品
</van-button>
<!-- <van-button @click="openExpress(item)" plain round size="small"-->
<!-- v-if="item.provideMode==3">-->
<!-- 物流信息-->
<!-- </van-button>-->
<van-button @click="openView(item)" plain round size="small">查看详情
</van-button>
</div>
</van-card>
</div>
</template>
</van-list>
</template>
<!--查看详情-->
<!-- :style="{ height: '80%', background:'#f9f9f9','padding-top':'30px'}"-->
<!-- closeable-->
<!-- position="bottom"-->
<!-- round-->
<!-- safe-area-inset-bottom-->
<van-action-sheet title="查看详情" v-model="descPopup">
<div class="van-cell-group--inset">
<van-cell>
<van-icon class="van-cell__left-icon" color="red" name="location"
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">已选福利</div>
</van-cell>
<van-cell style="padding: 0">
<van-card
:key="item.id"
:num="item.selectNum"
:thumb="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
:title="item.optionName"
style="border-radius: 8px;background: #FFFFFF"
v-for="item in selectedOptions"
>
<template #desc>
<div>{{item.supplier}}</div>
<div>{{item.simpleDesc}}</div>
</template>
</van-card>
</van-cell>
</div>
<!--邮寄到家 填写收货地址-->
<div class="van-cell-group--inset" v-if="provideMode===3">
<van-cell>
<van-icon class="van-cell__left-icon" color="red" name="location"
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">收货地址</div>
</van-cell>
<van-cell :value="receiveAddress" class="address-cell">
</van-cell>
</div>
<!--电子签字-->
<div class="van-cell-group--inset" v-if="signMode===2">
<van-cell>
<template #title>
<div style="font-weight: bold;font-size: 15px">电子签名</div>
</template>
</van-cell>
<van-cell title="">
<template #label>
<van-image :src="'/signature/getSignData?path=' + userSign"
style="width: 100%;height: 150px;border: 1px dashed"></van-image>
</template>
</van-cell>
</div>
</van-action-sheet>
<!--评价-->
<van-popup :style="{ height: '60%',background:'#f9f9f9','padding-top':'30px'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="evaluatePopup">
<div style="margin-top: 20px">
<van-radio-group v-model="evaluateFormData.optionId">
<van-cell-group>
<van-cell
:key="item.selectOptionId"
@click="optionIdClick(item.selectOptionId)"
clickable v-for="item in selectedOptions">
<template #title>
{{item.optionName}}
<span style="color: red" v-if="!item.isPj">未评价</span>
</template>
<template #right-icon>
<van-radio :name="item.selectOptionId"></van-radio>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</div>
<div class="evaluateForm">
<div style="text-align: center;margin: 20px 0;font-size: 20px;color: #f18d8d;font-weight: bold;">
您的评价让我们做的更好
</div>
<div style="display: flex;justify-content: center;flex-direction: column;align-items: center">
<div style="text-align: center;font-size: 13px;color: rgb(139 134 134)">为本次福利打分
</div>
<van-rate
:gutter="10"
:readonly="evaluateFormData.id"
:size="40"
color="#ffd21e"
v-model="evaluateFormData.evaluateScore"
void-color="#eee"
void-icon="star"
></van-rate>
</div>
<van-field
:readonly="evaluateFormData.id"
autosize
class="evaluateTextField"
label="评价"
label-width="0"
maxlength="100"
placeholder="请输入评价"
rows="5"
type="textarea"
v-model="evaluateFormData.evaluateText"
>
<div slot="label"></div>
</van-field>
</div>
<div style="padding: 10px 16px">
<van-button @click="doSubmitEvaluate"
block
type="primary"
v-if="!evaluateFormData.id">提交
</van-button>
<div style="display: flex;align-items: center;color: #52c41a;justify-content: center;font-size: 20px"
v-else>
<svg class="icon" height="32" p-id="2914" t="1715150529722"
version="1.1" viewBox="0 0 1024 1024" width="32"
xmlns="http://www.w3.org/2000/svg">
<path d="M596.48 113.024a142.848 142.848 0 0 0-169.024 0l-49.472 36.288a62.848 62.848 0 0 1-27.648 11.52l-60.8 9.28a142.848 142.848 0 0 0-119.424 119.488l-9.344 60.8a62.848 62.848 0 0 1-11.52 27.648l-36.224 49.472a142.848 142.848 0 0 0 0 169.088l36.288 49.472a62.336 62.336 0 0 1 11.456 27.648l9.344 60.672a142.848 142.848 0 0 0 119.488 119.488l60.672 9.344a62.656 62.656 0 0 1 27.648 11.52l49.472 36.224a142.848 142.848 0 0 0 169.088 0l49.472-36.288a62.4 62.4 0 0 1 27.648-11.52l60.672-9.28a142.912 142.912 0 0 0 119.552-119.552l9.344-60.672a62.656 62.656 0 0 1 11.52-27.648l36.224-49.472a142.848 142.848 0 0 0 0-169.088l-36.288-49.472a62.848 62.848 0 0 1-11.456-27.648l-9.28-60.8a142.848 142.848 0 0 0-119.488-119.424l-60.672-9.344a62.912 62.912 0 0 1-27.648-11.52l-49.536-36.224zM474.88 177.472a62.72 62.72 0 0 1 74.368 0l49.472 36.288c18.56 13.632 40.128 22.528 62.976 26.048l60.544 9.28a62.848 62.848 0 0 1 52.672 52.672l9.28 60.608c3.52 22.784 12.416 44.352 26.048 62.976l36.288 49.408a62.72 62.72 0 0 1 0 74.368l-36.288 49.472c-13.632 18.56-22.592 40.192-26.048 62.976l-9.28 60.608a62.848 62.848 0 0 1-52.672 52.608l-60.608 9.28a142.784 142.784 0 0 0-62.976 26.112l-49.408 36.224a62.72 62.72 0 0 1-74.368 0l-49.472-36.224a142.784 142.784 0 0 0-62.976-26.112l-60.544-9.28a62.784 62.784 0 0 1-52.672-52.608l-9.28-60.672a142.848 142.848 0 0 0-26.112-62.912l-36.224-49.472a62.848 62.848 0 0 1 0-74.368l36.224-49.472a142.72 142.72 0 0 0 26.112-62.912l9.28-60.608a62.848 62.848 0 0 1 52.672-52.672l60.608-9.28c22.784-3.456 44.352-12.416 62.912-26.048l49.472-36.288z m212.096 269.44A40 40 0 0 0 630.4 390.4L458.688 562.112 393.6 497.088a40 40 0 0 0-56.576 56.512l93.376 93.312a40 40 0 0 0 56.512 0l200-200z"
fill="#52C41A" p-id="2915"></path>
</svg>
评价完成
</div>
</div>
</van-popup>
<!--快递单号-->
<van-popup :style="{ height: '80%', background:'#f9f9f9','padding-top':'30px'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="expressPopup">
<div class="van-cell-group--inset">
<van-cell>
<van-icon class="van-cell__left-icon" color="red" name="location"
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">物流信息</div>
</van-cell>
<van-cell :value="logisticsTrace.courierNumber" class="address-cell"
title="快递单号"></van-cell>
<van-cell class="logistics_cell" title="物流跟踪">
<van-steps :active="0"
direction="vertical">
<van-step v-for="(item, index) in logisticsTrace.logisticsTraceDetailList">
<h3> {{item.desc}}</h3>
<p>{{moment(item.time).format('YYYY-MM-DD HH:mm:ss')}}</p>
</van-step>
</van-steps>
</van-cell>
</div>
</van-popup>
<!--快递物流信息-->
<van-action-sheet class="courierNumberSheet"
title=快递物流信息
v-model="courierNumberShow">
<div style="padding: 16px 16px 16px">
<div v-for="(v,k) in optionCourierNumberInfo">
<van-cell :title="k">
<div slot="title" style="font-weight: bold">
{{k}}
</div>
</van-cell>
<van-collapse accordion v-model="activeName">
<van-collapse-item :key="item.courierNumber" :name="item.courierNumber"
:title="item.courierNumber" v-for="item in v">
<template>
<van-cell :value="item.courierNumber" class="address-cell"
title="快递单号">
<div>
{{item.courierNumber || '暂无'}}
</div>
</van-cell>
<van-cell class="logistics_cell" title="物流跟踪">
<van-steps :active="0"
direction="vertical"
v-if="item.logisticsTrace && item.logisticsTrace.logisticsTraceDetailList">
<van-step
v-for="(timeline, timelineIndex) in item.logisticsTrace.logisticsTraceDetailList">
<h3> {{timeline.desc}}</h3>
<p>{{moment(timeline.time)
.format('YYYY-MM-DD HH:mm:ss')}}</p>
</van-step>
</van-steps>
<van-empty v-else></van-empty>
</van-cell>
<van-divider :hairline="false"></van-divider>
</template>
</van-collapse-item>
</van-collapse>
</div>
</div>
</van-action-sheet>
</div>
<script>
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, welfareMixins],
data() {
return {
pageDataUrl: '/platform/welfare/mine/pageData',
fullWelfareList: [],
welfareList: [],
tabActive: 0,
descPopup: false,
evaluatePopup: false,
selectedOptions: [],
provideMode: null,
signMode: null,
signData: null,
selectAddress: null,
evaluateFormData: {},
expressPopup: false,
logisticsTrace: {},
stepsActive: 0,
yearOption: [],
courierNumberShow: false,
courierNumberActions: [],
activeName: null,
optionCourierNumberInfo: []
}
},
computed: {
receiveAddress() {
if (this.selectedOptions && this.selectedOptions.length > 0) {
return this.selectedOptions[0].receiveAddress
}
return null
},
userSign() {
if (this.selectedOptions && this.selectedOptions.length > 0) {
return this.selectedOptions[0].userSign
}
return null
},
},
methods: {
optionIdClick(selectOptionId) {
this.$set(this.evaluateFormData, 'optionId', selectOptionId)
this.finOneWelfareEvaluate(this.evaluateFormData.projectId, selectOptionId);
},
async getUserSelection(projectId) {
const resp = await $.get('/platform/welfare/mine/getUserSelection', {projectId})
return resp
},
//查看选择详情
async openView(item) {
const {projectId, provideMode, signMode} = item
this.provideMode = provideMode
this.signMode = signMode
const {code, data, msg} = await this.getUserSelection(projectId)
if (code === 0) {
if (data.length === 0) {
this.$modal.msg('您还没有选择福利,请先到职工福利->福利列表下选择')
return
}
this.descPopup = true
this.selectedOptions = data
}
},
//打开评价
async openEvaluate(item) {
if (item.isChoose !== 1) {
this.$modal.msg("选择后才能评价")
return
}
const resp = await this.getUserSelection(item.projectId)
this.selectedOptions = resp.data
if (this.selectedOptions && this.selectedOptions.length > 0) {
await this.finOneWelfareEvaluate(item.id, this.selectedOptions[0].selectOptionId)
}
this.evaluatePopup = true
},
async finOneWelfareEvaluate(projectId, optionId) {
const {
data,
code,
msg
} = await $.post("/platform/welfare/mine/finOneWelfareEvaluate", {
projectId: projectId,
optionId: optionId
})
if (code === 0) {
if (data) {
this.evaluateFormData = data
} else {
this.evaluateFormData = {
projectId: projectId,
optionId: optionId
}
}
} else {
this.$message.warning(msg)
}
},
//评价
async doSubmitEvaluate() {
if (!this.evaluateFormData.evaluateScore) {
this.$modal.msg("请为本次福利评分")
return
}
const {
code,
data,
msg
} = await $.post('/platform/welfare/mine/doEvaluate', this.evaluateFormData)
if (code === 0) {
this.$modal.msgSuccess("评价成功")
this.evaluatePopup = false
} else {
this.$modal.msgError(msg)
}
},
tabChange(val) {
if (val === 0) {
this.welfareList = this.fullWelfareList
}
switch (val) {
case 0: {
this.welfareList = this.fullWelfareList
break
}
case 1: {
this.welfareList = this.fullWelfareList.filter(v => v.isReceive || [1].includes(v.provideMode))
break
}
case 2: {
this.welfareList = this.fullWelfareList.filter(v => !v.isReceive)
break
}
}
},
//获取物流信息
async getExpressInfo(row) {
const resp = await $.get('/platform/welfare/mine/getExpressInfo', {courierNumber: row.courierNumber})
if (resp.code === 0) {
resp.data.courierNumber = row.courierNumber
resp.data.logisticsTraceDetailList.sort((a, b) => {
return b.time - a.time;
})
this.logisticsTrace = resp.data
} else {
this.$message.error(resp.msg);
}
},
//打开物流
async openExpress(item) {
const {
code,
data,
msg
} = await $.get('/platform/welfare/common/courierNumberInfo', {
welfareId: item.projectId,
userId: item.userId
})
if (code === 0) {
if (data == null || data.length === 0) {
this.$modal.msg('您还没有选择福利套餐')
return
}
this.optionCourierNumberInfo = data
const keys = Object.keys(this.optionCourierNumberInfo)
this.activeName = this.optionCourierNumberInfo[keys[0]][0].courierNumber
this.courierNumberShow = true
} else {
this.$modal.msgError(msg)
}
},
yearChange(val) {
this.pageForm.year = val
this.onRefresh()
},
},
created() {
this.startLoading()
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearOption.unshift({value: i, text: i + '年'},)
}
this.$set(this.pageForm, "year", this.yearOption[0].value)
this.closeLoading()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,106 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
background: #FFFFFF;
}
#signature {
/*height: calc(100vh - 136px);*/
height: 300px;
background: #fff;
border: 1px dashed grey;
margin: 10px;
}
.button-operation {
/* display: flex;
height: 50px;
align-items: center;
position: fixed;
!*bottom: 0;*!
width: 100%;
margin: 10px 0;*/
margin: 10px;
}
.button-operation > div {
flex: 1;
text-align: center;
margin: 0 10px;
}
.button-operation > div > button {
width: 100%;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.go(-1)" left-arrow
title="我的签名"></van-nav-bar>
</van-sticky>
<van-cell>
<template #title>
<div style="font-weight: bold;font-size: 15px">电子签名</div>
</template>
</van-cell>
<van-cell title="">
<template #label>
<mobile-sign :is_value_base64="false" prefix="welfare"
ref="signature" v-model="signData"></mobile-sign>
</template>
</van-cell>
<div class="button-operation">
<van-button @click="save" round size="large" type="info">保存</van-button>
</div>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
signData: null
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
},
methods: {
async save() {
if (!this.signData) {
this.$toast('请先签字!')
return
}
const loading = this.$toast.loading({
message: '保存中...',
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post('/mobile/welfare/mine/saveMySignature', {
signData: this.signData,
prefix: "welfare"
})
loading.close()
if (resp.code === 0) {
this.signData = resp.data
this.$toast.success('保存成功!')
}
},
},
created() {
}
})
</script>
<!--#
}
#-->