first commit
This commit is contained in:
@@ -0,0 +1,243 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.van-card {
|
||||
background: #ffffff;
|
||||
margin: 10px 10px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.van-card__thumb {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.van-card__content > div {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.welfare_card {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.welfare_card .receive_img {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.van-card__header {
|
||||
height: 102px;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<van-sticky>
|
||||
<van-nav-bar title="福利列表" left-arrow
|
||||
@click-left="history.go(-1)"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<van-sticky>
|
||||
<van-tabs v-model="pageForm.tabName" @change="tabChange">
|
||||
<van-tab title="进行中" name="ing"></van-tab>
|
||||
<van-tab title="已结束" name="end"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
|
||||
<template v-if="vLoading && !vLoading.value">
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
v-if="tableData && tableData.length>0"
|
||||
v-model="loading"
|
||||
@load="pageData">
|
||||
<template v-for="o in tableData">
|
||||
<div class="welfare_card">
|
||||
<van-card @click="welfareClick(o)">
|
||||
<template #thumb>
|
||||
<img :src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+o.cover" alt=""
|
||||
class="van-image__img"
|
||||
v-if="o.cover">
|
||||
<image v-else src="/assets/mobile/svg/welfare/welfareHome.svg"></image>
|
||||
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="van-ellipsis"
|
||||
style="font-size: 15px;font-weight: bold;line-height: 30px;">
|
||||
{{o.name}}
|
||||
</div>
|
||||
</template>
|
||||
<template #desc>
|
||||
<div>
|
||||
<template v-if="new Date().getTime()>moment(o.choiceTimeStart).valueOf()
|
||||
&&new Date().getTime()<moment(o.choiceTimeEnd).valueOf()">
|
||||
<div style="flex: 1.5">
|
||||
选择开始时间:
|
||||
{{moment(o.choiceTimeStart).format('YYYY/MM/DD HH:mm')}}
|
||||
</div>
|
||||
<div style="flex: 1.5">
|
||||
选择结束时间:
|
||||
{{moment(o.choiceTimeEnd).format('YYYY/MM/DD HH:mm')}}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div style="flex: 1.5">
|
||||
选择开始时间:
|
||||
{{moment(o.choiceTimeStart).format('YYYY/MM/DD HH:mm')}}
|
||||
</div>
|
||||
<div style="flex: 1.5">
|
||||
选择结束时间:
|
||||
{{moment(o.choiceTimeEnd).format('YYYY/MM/DD HH:mm')}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- <div class="van-ellipsis" style="flex: 1">福 利 名 称:{{o.gift}}</div>-->
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</van-card>
|
||||
<div class="receive_img">
|
||||
<template v-if="new Date().getTime()>moment(o.choiceTimeStart).valueOf()
|
||||
&&new Date().getTime()<moment(o.choiceTimeEnd).valueOf()">
|
||||
<image v-if="o.isSelect&&!o.isReceive"
|
||||
src="/assets/mobile/svg/welfare/yxz.png"></image>
|
||||
<image v-else-if="!o.isSelect&&!o.isReceive"
|
||||
src="/assets/mobile/svg/welfare/wxz.png"></image>
|
||||
<image v-else-if="o.isSelect&&o.isReceive"
|
||||
src="/assets/mobile/svg/welfare/yxz.png"></image>
|
||||
<image v-else-if="o.isSelect&&!o.isReceive"
|
||||
src="/assets/mobile/svg/welfare/wxz.png"></image>
|
||||
</template>
|
||||
<template v-else>
|
||||
<!-- <div class="van-ellipsis"
|
||||
style="font-size: 15px;font-weight: bold;flex: 2;color: rgb(24,103,179)"
|
||||
v-if="o.isReceive">已发放
|
||||
</div>
|
||||
<div class="van-ellipsis"
|
||||
style="font-size: 15px;font-weight: bold;flex: 2;color: rgb(24,103,179)"
|
||||
v-else>未发放
|
||||
</div>-->
|
||||
<div style="size: 10px">
|
||||
<image v-if="o.isReceive"
|
||||
src="/assets/mobile/svg/welfare/ylq.png"></image>
|
||||
<image v-else src="/assets/mobile/svg/welfare/wlq.png"></image>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</van-list>
|
||||
<van-empty v-else description="暂无数据"></van-empty>
|
||||
</template>
|
||||
</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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
location.href = '/mobile/welfare/list/receive?projectId=' + id
|
||||
|
||||
} else {
|
||||
location.href = '/mobile/welfare/list/receive_success?projectId=' + id + '&provideMode=' + provideMode
|
||||
}
|
||||
} else if (this.tabName === 'end') {
|
||||
if (isReceive) {
|
||||
location.href = '/mobile/welfare/list/receive_success?projectId=' + id + '&provideMode=' + provideMode
|
||||
} else {
|
||||
this.$toast('福利发放已结束')
|
||||
}
|
||||
}
|
||||
},
|
||||
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.onRefresh()
|
||||
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>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user