init
This commit is contained in:
@@ -0,0 +1,229 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.list-card {
|
||||
position: relative;
|
||||
margin: 10px;
|
||||
background-color: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.list-card > .content {
|
||||
padding: 16px 10px;
|
||||
display: flex;
|
||||
max-height: 100px;
|
||||
}
|
||||
|
||||
.content-right {
|
||||
width: calc(100% - 150px);
|
||||
max-width: calc(100% - 150px);
|
||||
padding-left: 15px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.cr-title {
|
||||
/*max-height: 40px;*/
|
||||
line-height: 20px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.concat, .mobile, .union {
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.operateDiv {
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
.operateDiv .van-button {
|
||||
height: 28px;
|
||||
border-radius: 8px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.desc_info div {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
</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()"></van-nav-bar>
|
||||
<!--<van-dropdown-menu>
|
||||
<van-dropdown-item v-model="pageForm.typeId" :options="typeList"></van-dropdown-item>
|
||||
</van-dropdown-menu>-->
|
||||
|
||||
<van-tabs v-model="pageForm.typeId" @change="doSearch">
|
||||
<van-tab v-for="item in typeList" :title="item.typeName" :name="item.id"></van-tab>
|
||||
</van-tabs>
|
||||
|
||||
<template>
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
v-if="tableData && tableData.length>0"
|
||||
v-model="mLoading"
|
||||
@load="pageData">
|
||||
<template v-for="o in tableData">
|
||||
<div class="list-card">
|
||||
<div @click="showGoods(o)" class="content">
|
||||
<van-image
|
||||
height="100px"
|
||||
width="100px"
|
||||
radius="8"
|
||||
:src="CREATE_PREVIEW_URL(o.imgUrl)"
|
||||
class="van-image__img">
|
||||
</van-image>
|
||||
<div class="content-right">
|
||||
<div class="cr-title">
|
||||
<span>{{o.goodsName}}</span>
|
||||
</div>
|
||||
<div class="desc_info">
|
||||
<div class="concat">
|
||||
<span>货物价格:</span>
|
||||
{{o.goodsPrice}}
|
||||
</div>
|
||||
<div class="mobile">
|
||||
<span>厂商:</span>
|
||||
{{o.manufacturer}}
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="o.description" style="display: flex;color: #969799">
|
||||
{{removeHTMLTag(o.description).substr(0,25)+'...'}}
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<a @click.stop="viewDesc(o.id,o.description)"
|
||||
class="more" style="color:#1867b0"
|
||||
href="#">查看更多</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="mobile" style="display: flex">
|
||||
<span v-html="o.description"></span>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</van-list>
|
||||
</template>
|
||||
<van-empty
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据"
|
||||
></van-empty>
|
||||
|
||||
|
||||
<van-popup v-model="descPopup" position="right" :style="{ height: '100%',width: '100%'}"
|
||||
safe-area-inset-bottom>
|
||||
<van-sticky>
|
||||
<van-nav-bar @click-left="descPopup=false" left-arrow
|
||||
title="详情"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<div class="desc" v-html="desc" @click="descClick($event)"></div>
|
||||
</van-popup>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
desc: "",
|
||||
descPopup: false,
|
||||
pageForm:{
|
||||
projectId:null,
|
||||
goodsNAme:null,
|
||||
typeId:null,
|
||||
},
|
||||
typeList:[],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
descClick(e) {
|
||||
if (e.target.tagName === 'IMG') {
|
||||
vant.ImagePreview([e.target.src])
|
||||
}
|
||||
},
|
||||
doSearch(){
|
||||
this.pageForm.pageNumber=1
|
||||
this.pageData();
|
||||
},
|
||||
async pageData() {
|
||||
this.mLoading = true
|
||||
const resp = await $.post('/mobile/benefiting/onLoad', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
if (this.tableData.length === resp.data.totalCount) {
|
||||
this.finished = true
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
this.mLoading = false
|
||||
},
|
||||
async getAllType() {
|
||||
const resp = await $.get('/platform/benefiting/type/findAllType')
|
||||
if (resp.code === 0) {
|
||||
this.typeList = resp.data;
|
||||
this.pageForm.typeId = this.typeList[0].id
|
||||
}
|
||||
await this.pageData();
|
||||
},
|
||||
viewDesc(optionId, desc) {
|
||||
this.desc = desc
|
||||
this.descPopup = true
|
||||
},
|
||||
|
||||
},
|
||||
async created(){
|
||||
this.pageForm.projectId = GetQueryString("projectId")
|
||||
await this.getAllType();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,109 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.list-card {
|
||||
position: relative;
|
||||
margin: 10px;
|
||||
background-color: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.list-card > .content {
|
||||
padding: 16px 10px;
|
||||
display: flex;
|
||||
}
|
||||
</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()"></van-nav-bar>
|
||||
<van-search
|
||||
v-model="pageForm.projectName"
|
||||
shape="round"
|
||||
maxlength="10"
|
||||
@search="doSearch"
|
||||
placeholder="请输入项目名称查询"
|
||||
></van-search>
|
||||
|
||||
<template>
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
v-if="tableData && tableData.length>0"
|
||||
v-model="mLoading"
|
||||
@load="pageData">
|
||||
<template v-for="o in tableData">
|
||||
<div class="list-card" style="background-color: #FFFFFF;border-radius: 6px;">
|
||||
<van-card @click="showGoods(o)" class="content">
|
||||
<template #thumb>
|
||||
<img :src="CREATE_PREVIEW_URL(o.cover)"
|
||||
@click="preview(o.cover,o.cover)"
|
||||
class="van-image__img">
|
||||
</template>
|
||||
<template #title>
|
||||
<div class="van-ellipsis"
|
||||
style="font-size: 15px;font-weight: bold;line-height: 30px;">
|
||||
{{o.projectName}}
|
||||
</div>
|
||||
</template>
|
||||
<template #desc>
|
||||
<div>
|
||||
<template>
|
||||
<div>
|
||||
年度:{{o.year}}
|
||||
</div>
|
||||
<div style="flex: 1.5">
|
||||
创建时间:
|
||||
{{moment(o.createTime).format('YYYY/MM/DD HH:mm')}}
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</van-card>
|
||||
</div>
|
||||
</template>
|
||||
</van-list>
|
||||
</template>
|
||||
<van-empty
|
||||
v-if="mLoading==false&&tableData.length==0"
|
||||
class="custom-image"
|
||||
image="/none.svg"
|
||||
description="暂无数据"
|
||||
></van-empty>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm:{},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async pageData() {
|
||||
this.mLoading = true
|
||||
const resp = await $.post('/mobile/benefiting/pageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = this.tableData.concat(resp.data.list)
|
||||
if (this.tableData.length === resp.data.totalCount) {
|
||||
this.finished = true
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
this.mLoading = false
|
||||
},
|
||||
async showGoods(o){
|
||||
window.location.href='/mobile/benefiting/goods?projectId=' + o.id
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.pageData();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user