299 lines
10 KiB
HTML
299 lines
10 KiB
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
<style>
|
|
.van-card {
|
|
background: #ffffff;
|
|
margin: 10px auto 0;
|
|
width: 96%;
|
|
border-radius: 10px;
|
|
padding: 14px 12px;
|
|
}
|
|
|
|
.van-card__thumb {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.van-card__content > div {
|
|
height: 100%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.train-title {
|
|
flex: 0.6;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.van-doc-card {
|
|
margin: 14px;
|
|
padding: 12px;
|
|
background-color: #fff;
|
|
border-radius: 10px;
|
|
box-shadow: 0 8px 12px #ebedf0;
|
|
line-height: 20px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.van-divider {
|
|
margin: 6px 0 5px 0px;
|
|
border-color: #1867b0;
|
|
}
|
|
|
|
.van-image__img {
|
|
max-height: 200px;
|
|
}
|
|
|
|
.cus_button {
|
|
height: 26px;
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.card_title {
|
|
margin: 5px 0 5px 16px;
|
|
}
|
|
|
|
.van-cell-group__title {
|
|
padding-left: 0 !important;
|
|
}
|
|
|
|
.van-sidebar-item {
|
|
font-size: 16px !important;
|
|
text-indent: 4px !important;
|
|
}
|
|
|
|
.van-sidebar-item--select::before {
|
|
left: 5px !important;
|
|
}
|
|
|
|
.van-cell-group--inset {
|
|
margin: 0 8px;
|
|
}
|
|
|
|
.pre_text {
|
|
white-space: break-spaces;
|
|
padding-left: 7px;
|
|
/*margin-top: 30px;*/
|
|
}
|
|
|
|
</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.activityStatus" @change="tabChange">
|
|
<van-tab title="全部" :name="0"></van-tab>
|
|
<van-tab title="进行中" :name="1"></van-tab>
|
|
<van-tab title="已结束" :name="2"></van-tab>
|
|
</van-tabs>
|
|
</van-sticky>
|
|
|
|
<div>
|
|
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
|
v-if="tableData && tableData.length>0"
|
|
v-model="loading"
|
|
@load="pageData">
|
|
<div v-for="o in tableData" class="van-doc-card">
|
|
<div>
|
|
<div>
|
|
<div class="van-ellipsis"
|
|
style="margin-top: 6px; font-size: 15px;font-weight: bold;flex: 1">
|
|
{{o.name}}
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="train-title"><span
|
|
style="color: grey">年  度:</span>{{moment(o.startTime).format('YYYY')}}
|
|
</div>
|
|
<div class="train-title"><span style="color: grey">登记范围:</span>{{o.activityGroupName}}
|
|
</div>
|
|
<van-divider></van-divider>
|
|
</div>
|
|
<div class="train-title"><span style="color: grey">登记时间:</span>
|
|
{{moment(o.stratTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
|
|
moment(o.endTime).format('YYYY-MM-DD HH:mm')}}
|
|
</div>
|
|
|
|
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
|
|
<div>
|
|
<van-button @click.stop="openView(o)" class="cus_button"
|
|
type="primary" size="small" color="#1867b0"
|
|
style="margin-right: 8px; width: auto;">详细信息
|
|
</van-button>
|
|
<van-button v-if="o.count === 0" @click.stop="needChoose(o)"
|
|
class="cus_button"
|
|
type="primary" size="small" color="#1867b0"
|
|
style="margin-right: 8px; width: auto;">我要选择
|
|
</van-button>
|
|
<van-button v-if="o.count > 0" @click.stop="cancelChoose(o)"
|
|
class="cus_button"
|
|
type="primary" size="small" color="#1867b0"
|
|
style="margin-right: 8px; width: auto;">取消选择
|
|
</van-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</van-list>
|
|
<van-empty v-else description="暂无数据"></van-empty>
|
|
</div>
|
|
|
|
<van-popup v-model="infoShow" position="right"
|
|
:style="{ height: '100%', width: '100%', 'background-color': '#f6f7f9' }">
|
|
<van-nav-bar
|
|
title="详细信息"
|
|
left-arrow
|
|
placeholder
|
|
fixed
|
|
@click-left="infoShow = false">
|
|
</van-nav-bar>
|
|
<van-tabs v-model="active">
|
|
<van-tab v-if="viewData.moreInfo" title="通知内容">
|
|
<div class="pre_text" v-html="viewData.moreInfo"></div>
|
|
</van-tab>
|
|
<van-tab title="基础信息">
|
|
<van-cell-group inset style="margin-top: 10px">
|
|
<van-cell title="保险名称" :value="viewData.name"></van-cell>
|
|
<van-cell title="登记开始时间" :value="viewData.startTime"></van-cell>
|
|
<van-cell title="登记结束时间" :value="viewData.endTime"></van-cell>
|
|
<van-cell title="登记范围" :value="viewData.activityGroupName"></van-cell>
|
|
<van-cell title="创建人" :value="viewData.username"></van-cell>
|
|
<van-cell title="创建时间" :value="viewData.createTime"></van-cell>
|
|
<van-cell title="介绍链接">
|
|
<template #right-icon>
|
|
<span style="cursor: pointer; color: #236eb4"
|
|
@click="window.open(viewData.href.indexOf('http') !== -1 ? viewData.href : 'https://' + viewData.href)">{{viewData.href}}</span>
|
|
</template>
|
|
</van-cell>
|
|
<van-cell title="支付二维码" is-link value="点击查看"
|
|
@click="showPic"></van-cell>
|
|
|
|
</van-cell-group>
|
|
</van-tab>
|
|
</van-tabs>
|
|
|
|
</van-popup>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
active: 1,
|
|
pageForm: {
|
|
activityStatus: 1
|
|
},
|
|
infoShow: false,
|
|
viewData: {},
|
|
}
|
|
},
|
|
methods: {
|
|
showPic() {
|
|
if (this.viewData.payCode && this.viewData.payCode.length > 0) {
|
|
const url = FILE_DOMAIN + '/fileStreamPreview?id=' + this.viewData.payCode[0].id
|
|
vant.ImagePreview([url])
|
|
}
|
|
},
|
|
openView(row) {
|
|
this.viewData = clone(row)
|
|
if (this.viewData.payCode) {
|
|
this.viewData.payCode = JSON.parse(this.viewData.payCode)
|
|
}
|
|
this.active = this.viewData.moreInfo ? 1 : 2
|
|
this.infoShow = true
|
|
},
|
|
cancelChoose(row) {
|
|
vant.Dialog.confirm({
|
|
title: '温馨提示',
|
|
message: '您确定要取消【' + row.name + '】吗?',
|
|
}).then(async () => {
|
|
const resp = await $.post('/mobile/insurance/manage/cancelChoose', {
|
|
id: row.id
|
|
})
|
|
vant.Toast(resp.msg)
|
|
if (resp.code === 0) {
|
|
this.doSearch()
|
|
}
|
|
}).catch(() => {
|
|
})
|
|
},
|
|
async needChoose(row) {
|
|
if (row.groupId != null) {
|
|
const isExist = await getScopeUser(row.groupId)
|
|
if (!isExist) {
|
|
vant.Dialog.alert({
|
|
title: '参加人员范围',
|
|
message: row.activityGroupName,
|
|
confirmButtonColor: '#1867b0'
|
|
})
|
|
return
|
|
}
|
|
}
|
|
vant.Dialog.confirm({
|
|
title: '温馨提示',
|
|
message: '您确定要选择【' + row.name + '】吗?',
|
|
}).then(async () => {
|
|
const resp = await $.post('/mobile/insurance/manage/needChoose', {
|
|
id: row.id
|
|
})
|
|
vant.Toast(resp.msg)
|
|
if (resp.code === 0) {
|
|
this.doSearch()
|
|
}
|
|
}).catch(() => {
|
|
})
|
|
},
|
|
tabChange() {
|
|
this.doSearch()
|
|
},
|
|
doSearch() {
|
|
this.tableData = []
|
|
this.pageForm.pageNumber = 1
|
|
this.pageData()
|
|
},
|
|
async pageData() {
|
|
this.mLoading = true
|
|
const resp = await $.post('/mobile/insurance/manage/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
|
|
},
|
|
},
|
|
created() {
|
|
this.pageData()
|
|
}
|
|
})
|
|
window.onload = () => {
|
|
window.addEventListener('pageshow', e => {
|
|
if (e.persisted) {
|
|
window.location.reload();
|
|
}
|
|
});
|
|
};
|
|
</script>
|
|
<!--#
|
|
}
|
|
#-->
|