227 lines
7.6 KiB
HTML
227 lines
7.6 KiB
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
<style>
|
|
.avatar {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.list-item {
|
|
display: flex;
|
|
}
|
|
|
|
.list-item .left-img {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.list-item .right-content {
|
|
flex: 2;
|
|
padding-left: 10px;
|
|
}
|
|
|
|
.right-content {
|
|
height: 90px;
|
|
width: calc(100% - 130px);
|
|
}
|
|
|
|
.right-content > div {
|
|
height: 30px;
|
|
line-height: 30px;
|
|
}
|
|
|
|
.right-content .r-title {
|
|
font-size: 15px;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.right-content .r-content {
|
|
font-size: 13px;
|
|
color: #7f8481;
|
|
}
|
|
|
|
.avatar .van-image__img {
|
|
border-radius: 10px;
|
|
|
|
}
|
|
|
|
|
|
.list-card {
|
|
margin: 10px 10px;
|
|
}
|
|
|
|
|
|
.list-card .van-cell {
|
|
border-radius: 10px;
|
|
padding: 18px 16px;
|
|
}
|
|
|
|
.van-cell-group {
|
|
border-radius: 10px;
|
|
}
|
|
|
|
|
|
</style>
|
|
|
|
<div id="app" v-cloak>
|
|
<m-page-loading v-if="mLoading"></m-page-loading>
|
|
<van-nav-bar
|
|
title="慈善捐款项目"
|
|
left-arrow
|
|
placeholder
|
|
fixed
|
|
@click-left="history.back()"
|
|
safe-area-inset-top
|
|
></van-nav-bar>
|
|
|
|
<div style="margin: 20px auto 0 auto">
|
|
<van-list :finished="finished" :finished-text="isNullTypeCodeData.length>0?'没有更多了':''">
|
|
<div class="list-card" @click="openContribution(o)" v-for="o in isNullTypeCodeData">
|
|
<van-cell-group>
|
|
<van-cell :border="false">
|
|
<div class="list-item">
|
|
<div class="left-img">
|
|
<van-image
|
|
class="avatar"
|
|
fit="cover"
|
|
:src=" FILE_DOMAIN + '/fileStreamPreview?id=' + o.contributionFiles[0].id"
|
|
></van-image>
|
|
</div>
|
|
<div class="right-content">
|
|
<div class="r-title">{{o.contributionName}}</div>
|
|
<div class="van-ellipsis r-content">
|
|
{{removeHTMLTag(o.contributionIntroduce)}}
|
|
</div>
|
|
<div>
|
|
<van-row type="flex" justify="space-between"
|
|
style="white-space: nowrap">
|
|
<van-col span="12">
|
|
已筹:
|
|
<sapn style="color: red">
|
|
{{o.totalMoney?o.totalMoney:0}}
|
|
</sapn>
|
|
元
|
|
</van-col>
|
|
<van-col span="12" class="text-right">
|
|
人次:
|
|
<sapn style="color: red">{{o.totalUser}}</sapn>
|
|
人
|
|
</van-col>
|
|
</van-row>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</van-cell>
|
|
</van-cell-group>
|
|
</div>
|
|
|
|
<div v-for="o in contributionTypeData" class="list-card" @click="openContribution(o)">
|
|
<van-cell-group inset>
|
|
<van-cell :border="false">
|
|
<div class="list-item">
|
|
<div class="left-img">
|
|
<van-image
|
|
class="avatar"
|
|
fit="cover"
|
|
:src=" FILE_DOMAIN + '/fileStreamPreview?id=' + o.contributionTypeFiles[0].id"
|
|
></van-image>
|
|
</div>
|
|
<div class="right-content">
|
|
<div class="r-title">{{o.typeName}}
|
|
<van-tag type="danger" round>专题</van-tag>
|
|
</div>
|
|
<div class="van-ellipsis r-content">
|
|
{{removeHTMLTag(o.contributionTypeIntroduce)}}
|
|
</div>
|
|
<div>
|
|
<van-row type="flex" justify="space-between">
|
|
<van-col span="24">
|
|
子项目数:
|
|
<sapn style="color: red">{{o.sonNum}}</sapn>
|
|
个
|
|
</van-col>
|
|
</van-row>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</van-cell>
|
|
</van-cell-group>
|
|
</div>
|
|
</van-list>
|
|
</div>
|
|
|
|
<van-empty v-if="mLoading==false&&isNullTypeCodeData.length==0&&contributionTypeData.length==0"
|
|
class="custom-image" image="/none.svg"
|
|
description="暂无数据">
|
|
</van-empty>
|
|
</div>
|
|
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
isNullTypeCodeData: [],
|
|
contributionTypeData: [],
|
|
viewData: {}
|
|
}
|
|
},
|
|
methods: {
|
|
openContribution(data) {
|
|
const time = moment().format('YYYY-MM-DD HH:mm:ss')
|
|
if (!data.sonNum) {
|
|
if (time < data.contributionStartTime) {
|
|
this.$toast(data.contributionStartTime + '开始捐款');
|
|
return;
|
|
}
|
|
if (time > data.contributionEndTime) {
|
|
this.$toast('捐款在' + data.contributionEndTime + '结束');
|
|
return;
|
|
}
|
|
}
|
|
if (data.contributionTypeCode == null && data.sonNum == 0) {
|
|
window.location.href = '/mobile/contribution/view/contributionView?id=' + data.id
|
|
} else if (data.sonNum > 0 && data.typeCode) {
|
|
window.location.href = '/mobile/contribution/son/sonList?typeCode=' + data.typeCode
|
|
} else {
|
|
this.$toast('暂无项目');
|
|
return
|
|
}
|
|
|
|
},
|
|
async isNullTypeCodePageData() {
|
|
const {data} = await $.post("/mobile/contribution/isNullTypeCodePageData")
|
|
data.forEach(v => {
|
|
v.sonNum = 0
|
|
v.contributionFiles = JSON.parse(v.contributionFiles)
|
|
})
|
|
this.isNullTypeCodeData = data
|
|
},
|
|
async pageData() {
|
|
await this.isNullTypeCodePageData()
|
|
const {data} = await $.get("/mobile/contribution/getContributionTypeData")
|
|
data.forEach(v => {
|
|
v.contributionTypeCode = v.typeCode
|
|
v.contributionTypeFiles = JSON.parse(v.contributionTypeFiles)
|
|
})
|
|
this.contributionTypeData = data
|
|
this.loading = false
|
|
}
|
|
},
|
|
created() {
|
|
this.pageData()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
|
|
<!--#
|
|
}
|
|
#--> |