This commit is contained in:
liuye
2023-12-14 16:18:43 +08:00
parent 63cd10ccbf
commit fab3ee32d0
5 changed files with 608 additions and 759 deletions

View File

@@ -1,496 +0,0 @@
<template>
<div class="page">
<div class="header-content">
<u-navbar :is-back="false" title="积分" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar"></u-navbar>
<div class="header-bg">
<!-- <div class="weather-info" v-if="weatherInfo.wea">
<img :src="weatherInfo.icon" alt="" />
<p>今天{{weatherInfo.wea}}{{weatherInfo.tem2}}~{{weatherInfo.tem1}},{{weatherInfo.air_tips}}</p>
</div> -->
<div class="swiper-content">
<u-swiper :list="swiperList" mode="none" height="364" bg-color="none" @click="handleBannerClick"/>
</div>
<div class="user-info">
<p>张珊珊欢迎进入清风社区</p>
<div>签到</div>
</div>
</div>
</div>
<div class="banner-list">
<div class="item" v-for="(item, index) in bannerList" :key="index">
<img :src="item.imgUrl" alt="">
</div>
</div>
<tempalte>
<div class="title-wrap">
<span class="title">三务公开</span>
<div class="right" hover-class="text-hover"
@click="$linkTo(`/mods/AppContent/AppContent?names=三务公开&areaId=${areaId}`)">
<span class="title-more">更多专题</span>
<u-icon name="arrow-right" size="28" color="#687DA6"></u-icon>
</div>
</div>
<div class="list-news">
<div class="item">
<p class="title">关山街道关山社区第五网格</p>
<div class="user-flex">
<span>袁维宏</span>
<p>房前屋后打扫</p>
<div>
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan.png" alt="">8
</div>
</div>
<p class="item-content">百年征和波澜壮阔百年初心历争议弥坚7月1日上午庆祝中国共产党成立100周年</p>
<div class="img-list">
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan.png" alt="">
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan.png" alt="">
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan.png" alt="">
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan.png" alt="">
<img src="https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan.png" alt="">
</div>
</div>
</div>
</tempalte>
<!-- <div class="app-list" v-for="(item, index) in appList" :key="index">
<div class="title-content">
<h2>{{item.name}}</h2>
<div @click="toService()">更多<img src="https://cdn.cunwuyun.cn/wechat/wuxi/right-icon-blue.png" alt=""></div>
</div>
<div class="banner-flex" v-if="item.bannerApp && item.bannerApp.length">
<div class="item-banner" v-for="(banner, bannerIndex) in item.bannerApp" :key="bannerIndex" @click="openApp(banner)">
<img :src="banner.pictureUrl" alt="">
</div>
</div>
<div class="app-content" v-if="item.apps && item.apps.length">
<div class="item-app" v-for="(app, appIndex) in item.apps" :key="appIndex" @click="openApp(app)">
<img :src="app.pictureUrl">
<p>{{app.name}}</p>
</div>
</div>
</div>
<template v-if="categorys&&categorys.length>0">
<u-tabs :list="categorys.map(e=>({name:e.categoryName}))" font-size="40" bg-color="transparent"
inactive-color="#999999" :active-item-style="active"
:is-scroll="true" :current="index" @change="tabChange"/>
<div class="list-wrap" v-if="categoryList && categoryList.length>0">
<div class="list-card" v-for="(category,index) in categoryList" :key="index"
@click="$linkTo('/mods/AppContent/contentDetail?id='+category.id)">
<div class="header">{{ category.title }}</div>
<div class="content-wrap"
v-if="category.contentType==0 && category.files && category.files.length<3&&category.files.length>0">
<img class="img" :src="item.url" v-for="(item,index) in category.files.slice(0,1)" :key="index.id">
</div>
<div class="content-wrap" v-if="category.contentType==0 && category.files && category.files.length >= 3">
<img class="min-img" :src="item.url" v-for="(item,index) in category.files.slice(0,3)" :key="index.id">
</div>
<div class="content-wrap" v-if="category.contentType == 1">
<img class="img" :src="category.pictureUrl" alt=""/>
<img class="play-icon" :src="`${cdn}/play.png`" alt=""/>
</div>
<div class="bottom">
<div class="left">
<div class="tag">{{ category.categoryName }}</div>
{{ category.createTime }}
</div>
<div class="right">
<em>{{ category.viewCount }}</em>
人看过
</div>
</div>
</div>
</div>
<AiEmpty v-else/>
</template> -->
<AiLogin ref="login"/>
</div>
</template>
<script>
import {mapActions, mapState} from 'vuex'
export default {
customNavigation: true,
name: 'AppIntegral',
appName: "积分",
data() {
return {
cdn: "https://cdn.cunwuyun.cn/wxmp",
swiperList: ['https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-swiper1.png'],
index: 0,
grids: [],
activeList: [],
notices: [],
categorys: [],
categoryList: [],
search: {areaId: ''},
backgroundNavbar: {
background: 'url(https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-nav-bg.png) no-repeat',
backgroundSize: 'cover',
},
appList: [], //应用列表
weatherInfo: {},
bannerList: [
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfsq.png',
path: ''
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfrw.png',
path: ''
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfph.png',
path: ''
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfsc.png',
path: ''
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfgs.png',
path: ''
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-wdjf.png',
path: ''
}
]
}
},
computed: {
...mapState(['user', 'token']),
active() {
return {
fontSize: '22px',
color: '#333333',
}
},
noticeList() {
let {notices} = this
return notices?.length > 0 ? notices?.map(e => e.title) || ['暂无公告'] : ['暂无公告']
}
},
onReady() {
// uni.setNavigationBarTitle({title: "基层治理"})
},
onLoad() {
this.autoLogin().then(() => {
// this.getSwiperList();
this.getName();
// this.getGrids();
this.getActive();
this.getNotice();
this.getAppList()
this.getWeather()
})
},
methods: {
...mapActions(['autoLogin', 'authCheck']),
getName() {
this.$instance.post("/app/appcontentmoduleinfo/listByName", null, {
params: {names: "新闻发布"},
withoutToken: true
}).then(res => {
if (res?.data[0]?.categoryList?.length) {
this.categorys = res.data[0]["categoryList"];
this.search.moduleId = res.data[0]['id']
this.search.categoryId = res.data[0]['categoryList'][0]['id']
this.getCategoryList()
}
})
},
tabChange(idx) {
this.index = idx
this.search.categoryId = this.categorys[idx]['id']
this.getCategoryList()
},
getCategoryList() {
this.$instance.post("/app/appcontentinfo/list", null, {
params: {...this.search, size: 100}
}).then(res => {
if (res?.data) {
this.categoryList = res.data.records;
}
})
},
clickNotice(val) {
const id = this.notices[val]["id"];
if (id) {
uni.navigateTo({
url: "/mods/AppNotice/AppNotice?id=" + id
})
}
},
handleActive({type, appId, url}) {
if (type == 0) {
uni.navigateToMiniProgram({appId})
} else if (type == 1) {
this.$linkTo("/subPages/h5/webview?link=" + url);
}
},
getNotice() {
this.$instance.post("/app/appmininotice/list", null, {
params: {size: 999},
withoutToken: true
}).then(res => {
if (res?.data) {
this.notices = res.data.records;
}
})
},
getActive() {
this.$instance.post("/app/appminitopicconfig/list", null, {
params: {size: 999},
withoutToken: true
}).then(res => {
if (res?.data) {
this.activeList = res.data.records;
}
})
},
/**
* 获取顶部九宫格
*/
getGrids() {
this.$instance.post("/app/appminihomeconfig/list", null, {
params: {picked: 1},
withoutToken: true
}).then(res => {
if (res?.data) {
this.grids = res.data.records;
}
})
},
getSwiperList() {
this.$instance.post('/app/appbanner/listForWx', null, {
withoutToken: true
}).then((res) => {
if (res?.data) {
this.swiperList = res.data?.map((e) => ({...e, image: e.imgUrl})) || []
}
})
},
handleClick({type, appId, modulePath, url, checkType, corpId}) {
//先判读是不是系统应用
if (type != "0") {
if (type == "1") {
uni.navigateToMiniProgram({appId});
} else if (type == "2") {
uni.navigateTo({url: "/subPages/h5/webview?link=" + url});
} else if (type == "3") {
this.$linkTo(url);
} else if (type == "4") {
uni.openCustomerServiceChat({
extInfo: {url: url},
corpId: corpId,
fail: () => {
this.$u.toast('请使用普通微信打开小程序进行咨询');
}
});
}
} else if (type && type == "0") {
uni.showLoading({title: '正在进入应用...'})
this.authCheck({checkType, modulePath}).finally(() => uni.hideLoading())
}
},
handleBannerClick(index) {
if (!this.swiperList[index].linkUrl) return
if (this.swiperList[index].type == '0') { //0 h5链接 1 小程序链接; 2外部小程序
this.$linkTo(`/subPages/h5/webview?link=${this.swiperList?.[index]?.linkUrl}&title=${this.swiperList?.[index]?.title}`)
} else if (this.swiperList[index].type == '1') {
this.$linkTo(`${this.swiperList?.[index]?.linkUrl}`)
} else {
wx.navigateToMiniProgram({
appId: this.swiperList[index].linkUrl
})
}
},
getAppList() {
this.$instance.get("/wuxi_home.json", null, { withoutToken: true }).then(res => {
if (res.length) {
this.appList = res
}
})
},
toService() {
uni.switchTab({
url: '/pages/AppModules/AppModules'
})
},
openApp(row) {
if(row.type == 1) { //type 0:内置应用, 1:外链, 2tabbar页面
uni.navigateToMiniProgram({appId: row.appId});
}else if(row.type == 2) {
uni.switchTab({url: row.modulePath})
}else {
uni.navigateTo({url: row.modulePath})
}
},
getWeather() {
this.$instance.post("/app/weather/queryWeather", {cityId: 101041800}, { withoutToken: true }).then(res => {
if (res.data) {
this.weatherInfo = res.data
this.weatherInfo.icon = 'https://cdn.cunwuyun.cn/wuxi/home/weather-'+this.weatherInfo.wea_img+'.png'
}
})
},
},
onShareAppMessage() {
return {
title: '欢迎使用基层治理~',
path: `/pages/AppHome/AppHome`
}
},
}
</script>
<style scoped lang="scss">
@import "~dvcp-wui/common";
.page {
width: 100%;
min-height: 100%;
position: relative;
.header-content {
.header-bg {
background: url('https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-header-bg.png') center;
background-size: 100% 100%;
}
.swiper-content {
width: 686px;
height: 364px;
margin: 0 auto 24px;
}
.user-info {
display: flex;
justify-content: space-between;
padding: 14px 32px 18px;
p {
font-family: PingFangSC-Regular;
font-size: 28px;
color: #222;
line-height: 56px;
}
div {
font-family: PingFangSC-Regular;
font-size: 24px;
color: #0262F2;
line-height: 52px;
padding: 0 24px;
border: 1px solid #0262f280;
border-radius: 28px;
}
}
}
.banner-list {
padding: 32px 0 0 32px;
background-color: #fff;
.item {
display: inline-block;
width: 330px;
height: 160px;
margin: 0 26px 32px 0;
img {
width: 100%;
height: 100%;
}
}
}
.title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 32px 32px 24px;
.title {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 34px;
color: #222;
line-height: 40px;
}
.right {
.title-more {
font-size: 28px;
font-weight: 400;
line-height: 40px;
color: #687DA6;
}
}
}
.list-news {
width: 686px;
margin: 0 0 0 32px;
.item {
padding: 32px 24px 16px 24px;
background-color: #fff;
border-radius: 16px;
.title {
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
font-size: 34px;
color: #333;
line-height: 40px;
word-break: break-all;
margin-bottom: 16px;
}
.user-flex {
line-height: 40px;
font-family: PingFangSC-Regular;
span {
display: inline-block;
font-size: 34px;
color: #2D7DFF;
margin-right: 20px;
}
p {
display: inline-block;
font-size: 26px;
color: #666;
}
div {
float: right;
font-size: 28px;
color: #687DA6;
line-height: 40px;
img {
width: 40px;
height: 40px;
margin-right: 4px;
vertical-align: sub;
}
}
}
.item-content {
margin-top: 30px;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #333;
line-height: 42px;
word-break: break-all;
}
.img-list {
margin-top: 24px;
img {
width: 200px;
height: 200px;
margin: 0 16px 16px 0;
}
img:nth-of-type(3n) {
margin-right: 0;
}
}
}
}
}
</style>

View File

@@ -1,85 +1,94 @@
<template>
<div class="AppNewFarmerBank">
<div class="swiper-content">
<img src="https://cdn.cunwuyun.cn/fengdu/img-gongdeyinhang.png" alt="">
</div>
<div class="welcome">
<div class="welcome-user">
<span class="name">{{ user.realName || user.nickName }}</span>
<span v-if="!user.idNumber">欢迎来到功德银行</span>
<span v-else>欢迎进入{{ user.areaName }}</span>
</div>
<div class="signin" @click="toPages('./signIn',status)">{{ status==1? '已签到':'签到' }}</div>
</div>
<div class="card-list">
<div class="jfsq" @click="toPages('./integralApply')">
<p>积分申请</p>
<h4>好事自荐得积分</h4>
</div>
<div class="jsrw" @click="toPages('./integralTask')">
<p>积分任务</p>
<h4>完成任务得积分</h4>
</div>
<div class="jfph" @click="toPages('./integralRank')">
<p>积分排行</p>
<h4>社区荣誉榜</h4>
</div>
<div class="jfsc" @click="toPages('/mods/AppRedemptionPoints/AppRedemptionPoints')">
<p>积分商城</p>
<h4>兑换得好物</h4>
</div>
<div class="jfgs" @click="toPages('/mods/AppRedemptionPoints/pointsPublicity')">
<p>积分公示</p>
<h4>积分获取规则</h4>
</div>
<div class="wdjf" @click="toPages('/pages/AppMine/myIntegral')">
<p>我的积分</p>
<h4>积分获取一目了然</h4>
</div>
</div>
<div class="handpick" v-if="list.length">
<div class="title">
<h1>精选动态</h1>
<div class="more" v-if="allList.length > 3" @click="$linkTo('./handpick')">
<span>更多</span>
<u-icon name="arrow-right" color="#687DA6" size="28"></u-icon>
<div class="page">
<div class="header-content">
<u-navbar :is-back="false" title="积分" title-color="#000" title-width="300" title-size="32" :title-bold="true" :background="backgroundNavbar"></u-navbar>
<div class="header-bg">
<div class="swiper-content">
<u-swiper :list="swiperList" mode="none" height="364" bg-color="none" @click="handleBannerClick"/>
</div>
</div>
<div class="list" v-if="list.length">
<div class="card" v-for="(item,index) in list" :key="index" @click="$linkTo(`./pickDetail?id=${item.id}`)">
<div class="title-info" v-if="item.girdName">
{{item.girdName}}
</div>
<div class="top">
<div class="left" >
<div class="type-info">{{item.createUserName}}<span>{{item.title}}</span></div>
</div>
<div class="right" @click.stop="upCount(item.id,index)">
<img :src="item.upStatus==0? 'https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png':'https://cdn.cunwuyun.cn/wxmp/fengdu/zan-active.png'" alt="">
<span>{{ item.upCount || 0 }}</span><span v-if="item.upCount > 99">+</span>
</div>
</div>
<p class="content-info">{{item.content}}</p>
<div class="imgs" v-if="item.images.length">
<image v-for="(img, i) in item.images" :key="i" class="banner" :src="img.url"/>
</div>
<div class="imgs" v-if="!item.images.length && item.videos.length">
<image v-for="(video, ins) in item.videos" :key="ins" class="banner" :src="video.facePicture.toString()"/>
</div>
<div class="user-info">
<p>{{ user.realName || user.nickName }}欢迎进入{{user.areaName}}</p>
<div @click="toPages('./signIn',status)">{{ status==1? '已签到':'签到' }}</div>
</div>
</div>
</div>
<div class="banner-list">
<div class="item" v-for="(item, index) in bannerList" :key="index" @click="toPages(item.path)">
<img :src="item.imgUrl" alt="">
</div>
</div>
<tempalte>
<div class="title-wrap">
<span class="title">精选动态</span>
<div class="right" hover-class="text-hover" @click="$linkTo('./handpick')">
<span class="title-more">更多</span>
<u-icon name="arrow-right" size="28" color="#687DA6"></u-icon>
</div>
</div>
<div class="list-news" v-if="list.length">
<div class="item" v-for="(item,index) in list" :key="index" @click="$linkTo(`./pickDetail?id=${item.id}`)">
<p class="title" v-if="item.girdName">{{item.girdName}}</p>
<div class="user-flex">
<span>{{item.createUserName}}</span>
<p>{{item.title}}</p>
<div @click.stop="upCount(item.id,index)">
<img :src="item.upStatus==0? 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan.png':'https://cdn.cunwuyun.cn/wechat/biaopin/integral/dianzan-select.png'" alt="">{{ item.upCount || 0 }}<span v-if="item.upCount > 99">+</span>
</div>
</div>
<p class="item-content">{{item.content}}</p>
<div class="img-list" v-if="item.images.length">
<img v-for="(img, i) in item.images" :key="i" :src="img.url">
</div>
<div class="img-list" v-if="!item.images.length && item.videos.length">
<img v-for="(video, ins) in item.videos" :key="ins" :src="video.facePicture.toString()">
</div>
</div>
</div>
</tempalte>
<AiLogin ref="login"/>
</div>
</template>
<script>
import { mapState } from 'vuex'
import {mapActions, mapState} from 'vuex'
export default {
name: "AppNewFarmerBank",
appName: "功德银行",
customNavigation: true,
name: 'AppIntegral',
appName: "积分",
data() {
return {
cdn: "https://cdn.cunwuyun.cn/wxmp",
swiperList: ['https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-swiper1.png'],
backgroundNavbar: {
background: 'url(https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-nav-bg.png) no-repeat',
backgroundSize: 'cover',
},
bannerList: [
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfsq.png',
path: './integralApply'
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfrw.png',
path: './integralTask'
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfph.png',
path: './integralRank'
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfsc.png',
path: '/mods/AppRedemptionPoints/AppRedemptionPoints'
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-jfgs.png',
path: '/mods/AppRedemptionPoints/pointsPublicity'
},
{
imgUrl: 'https://cdn.cunwuyun.cn/wechat/biaopin/integral/integral-banner-wdjf.png',
path: '/pages/AppMine/myIntegral'
}
],
status: null,
current: 1,
list: [],
@@ -176,221 +185,161 @@ export default {
this.getStatus()
this.getModule()
},
onShareAppMessage() {
return {
title: '欢迎使用基层治理~',
path: `/pages/AppHome/AppHome`
}
},
}
</script>
<style lang="scss" scoped>
.AppNewFarmerBank {
padding-bottom: 20px;
box-sizing: border-box;
.swiper-content {
width: 100%;
height: 332px;
padding: 32px 32px 0;
box-sizing: border-box;
background: #FFF;
img {
width: 100%;
height: 100%;
border-radius: 16px;
}
}
<style scoped lang="scss">
@import "~dvcp-wui/common";
.welcome {
display: flex;
align-items: center;
width: 100%;
height: 120px;
padding: 0 32px;
box-sizing: border-box;
background: #FFF;
.signin {
width: 104px;
height: 52px;
line-height: 52px;
border: 2px solid #2D7DFF;
border-radius: 40px;
color: #2D7DFF;
text-align: center;
font-size: 22px;
font-weight: 400;
}
.welcome-user {
width: calc(100% - 60px);
font-size: 30px;
font-weight: 400;
font-family: "PingFang SC";
.name {
color: #2D7DFF;
font-weight: 500;
}
}
}
.page {
width: 100%;
min-height: 100%;
position: relative;
.card-list {
background: #FFF;
padding: 0 32px;
display: flex;
flex-wrap: wrap;
.jfsq {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenshenqing.png') no-repeat ;
color: #DF863E;
}
.jsrw {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenrenwu.png') no-repeat;
color: #2D7DFF;
}
.jfph {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenpaihang.png') no-repeat;
color: #338A77;
}
.jfsc {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenshangcheng.png') no-repeat;
color: #D9606E;
}
.jfgs {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifengongshi.png') no-repeat;
color: #484899;
}
.wdjf {
background: url('https://cdn.cunwuyun.cn/fengdu/img-wodejifen.png') no-repeat;
color: #DA9A07;
}
& > div:nth-child(2n+1) {
margin-right: 30px;
}
div {
.header-content {
.header-bg {
background: url('https://cdn.cunwuyun.cn/wechat/wuxi/wuxi-header-bg.png') center;
background-size: 100% 100%;
width: 328px;
height: 144px;
margin-bottom: 32px;
padding: 28px 32px;
box-sizing: border-box;
p {
font-size: 30px;
font-weight: 600;
}
h4 {
font-size: 20px;
font-weight: 400;
margin-top: 8px;
}
}
}
.handpick {
padding: 0 32px;
box-sizing: border-box;
.title {
margin: 32px 0;
.swiper-content {
width: 686px;
height: 364px;
margin: 0 auto 24px;
}
.user-info {
display: flex;
justify-content: space-between;
align-items: center;
h1 {
font-size: 34px;
font-weight: 500;
}
.more {
width: 200px;
color: #687DA6;
padding: 14px 32px 18px;
p {
font-family: PingFangSC-Regular;
font-size: 28px;
font-weight: 400;
text-align: right;
color: #222;
line-height: 56px;
}
div {
font-family: PingFangSC-Regular;
font-size: 24px;
color: #0262F2;
line-height: 52px;
padding: 0 24px;
border: 1px solid #0262f280;
border-radius: 28px;
}
}
}
.banner-list {
padding: 32px 0 0 32px;
background-color: #fff;
.item {
display: inline-block;
width: 330px;
height: 160px;
margin: 0 26px 32px 0;
img {
width: 100%;
height: 100%;
}
}
}
.list {
.card {
margin-bottom: 24px;
padding: 32px 24px;
box-sizing: border-box;
background: #FFF;
border-radius: 12px;
.title-info {
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
.title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 32px 32px 24px;
.title {
font-family: PingFangSC-Medium;
font-weight: 700;
font-size: 44px;
color: #222;
line-height: 44px;
}
.right {
.title-more {
font-size: 28px;
font-weight: 400;
line-height: 44px;
color: #687DA6;
}
}
}
.list-news {
width: 686px;
margin: 0 0 0 32px;
.item {
padding: 32px 24px 16px 24px;
background-color: #fff;
border-radius: 16px;
margin-bottom: 32px;
.title {
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
font-size: 34px;
color: #333;
line-height: 40px;
word-break: break-all;
margin-bottom: 16px;
}
.user-flex {
line-height: 40px;
font-family: PingFangSC-Regular;
span {
display: inline-block;
font-size: 34px;
color: #333;
letter-spacing: 0;
line-height: 40px;
margin-bottom: 16px;
color: #2D7DFF;
margin-right: 20px;
}
.type-info {
font-family: PingFangSC-Regular;
font-size: 34px;
p {
display: inline-block;
font-size: 26px;
color: #666;
}
div {
float: right;
font-size: 28px;
color: #687DA6;
line-height: 40px;
span {
display: inline-block;
font-family: PingFangSC-Regular;
font-size: 26px;
color: #666;
line-height: 40px;
margin-left: 20px;
img {
width: 40px;
height: 40px;
margin-right: 4px;
vertical-align: sub;
}
}
.top {
display: flex;
justify-content: space-between;
margin-bottom: 28px;
.left {
width: calc(100% - 100px);
p {
overflow:hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
.right {
width: 100px;
text-align: right;
img {
width: 40px;
height: 40px;
vertical-align: bottom;
}
span {
font-size: 28px;
font-weight: 400;
color: #687DA6;
}
}
}
.item-content {
margin-top: 30px;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #333;
line-height: 42px;
word-break: break-all;
}
.img-list {
margin-top: 24px;
img {
width: 200px;
height: 200px;
margin: 0 16px 16px 0;
}
.content-info {
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #333;
line-height: 42px;
margin-bottom: 24px;
}
.imgs {
display: flex;
flex-wrap: wrap;
background: #FFF;
image,
video {
width: 200px;
height: 200px;
margin: 0 12px 0 0;
}
image:nth-child(3n + 0),
video:nth-child(3n + 0) {
margin: 0;
}
img:nth-of-type(3n) {
margin-right: 0;
}
}
}
}
}
}
</style>

View File

@@ -0,0 +1,396 @@
<template>
<div class="AppNewFarmerBank">
<div class="swiper-content">
<img src="https://cdn.cunwuyun.cn/fengdu/img-gongdeyinhang.png" alt="">
</div>
<div class="welcome">
<div class="welcome-user">
<span class="name">{{ user.realName || user.nickName }}</span>
<span v-if="!user.idNumber">欢迎来到功德银行</span>
<span v-else>欢迎进入{{ user.areaName }}</span>
</div>
<div class="signin" @click="toPages('./signIn',status)">{{ status==1? '已签到':'签到' }}</div>
</div>
<div class="card-list">
<div class="jfsq" @click="toPages('./integralApply')">
<p>积分申请</p>
<h4>好事自荐得积分</h4>
</div>
<div class="jsrw" @click="toPages('./integralTask')">
<p>积分任务</p>
<h4>完成任务得积分</h4>
</div>
<div class="jfph" @click="toPages('./integralRank')">
<p>积分排行</p>
<h4>社区荣誉榜</h4>
</div>
<div class="jfsc" @click="toPages('/mods/AppRedemptionPoints/AppRedemptionPoints')">
<p>积分商城</p>
<h4>兑换得好物</h4>
</div>
<div class="jfgs" @click="toPages('/mods/AppRedemptionPoints/pointsPublicity')">
<p>积分公示</p>
<h4>积分获取规则</h4>
</div>
<div class="wdjf" @click="toPages('/pages/AppMine/myIntegral')">
<p>我的积分</p>
<h4>积分获取一目了然</h4>
</div>
</div>
<div class="handpick" v-if="list.length">
<div class="title">
<h1>精选动态</h1>
<div class="more" v-if="allList.length > 3" @click="$linkTo('./handpick')">
<span>更多</span>
<u-icon name="arrow-right" color="#687DA6" size="28"></u-icon>
</div>
</div>
<div class="list" v-if="list.length">
<div class="card" v-for="(item,index) in list" :key="index" @click="$linkTo(`./pickDetail?id=${item.id}`)">
<div class="title-info" v-if="item.girdName">
{{item.girdName}}
</div>
<div class="top">
<div class="left" >
<div class="type-info">{{item.createUserName}}<span>{{item.title}}</span></div>
</div>
<div class="right" @click.stop="upCount(item.id,index)">
<img :src="item.upStatus==0? 'https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png':'https://cdn.cunwuyun.cn/wxmp/fengdu/zan-active.png'" alt="">
<span>{{ item.upCount || 0 }}</span><span v-if="item.upCount > 99">+</span>
</div>
</div>
<p class="content-info">{{item.content}}</p>
<div class="imgs" v-if="item.images.length">
<image v-for="(img, i) in item.images" :key="i" class="banner" :src="img.url"/>
</div>
<div class="imgs" v-if="!item.images.length && item.videos.length">
<image v-for="(video, ins) in item.videos" :key="ins" class="banner" :src="video.facePicture.toString()"/>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: "AppNewFarmerBank",
appName: "功德银行",
data() {
return {
status: null,
current: 1,
list: [],
allList: [],
flag: false,
}
},
computed: {
...mapState(['user'])
},
methods: {
getList(moduleId) {
this.$instance.post(`/app/appcontentinfo/list-web`,null,{
params: {
moduleId: moduleId,
current: this.current,
girdId: this.user.girdId,
containContent: true,
}
}).then(res=> {
if(res?.data) {
this.allList = res.data.records
let newList = res.data.records.length > 3 ? res.data.records.slice(0,3) : res.data.records
let mapList = newList.map(e=> {
return {
...e,
images: e?.files.filter(i => (i.postfix == '.jpg' || i.postfix == '.jpeg' || i.postfix == '.png')),
videos: e?.files.filter(i => (i.postfix == '.mp4' || i.postfix == '.MP4')),
}
})
this.list = mapList.map(v=> {
return {
...v,
images: v.images.length > 3? v.images.slice(0, 3) : v.images,
videos: v.videos.length > 3? v.videos.slice(0, 3) : v.videos,
upStatus: 0
}
})
}
})
},
handleBannerClick() {
},
// 点赞
upCount(id,index) {
if (this.flag) return
this.flag = true
this.$instance.post(`/app/appcontentinfo/supportById?id=${id}`).then(res=> {
if(res?.code==0) {
this.flag = false
this.list[index].upStatus = 1
this.$u.toast(`点赞成功`)
}
}).finally(() => this.flag = false)
},
toPages(url,status) {
if(!this.user.areaId) {
this.$dialog.confirm({
content: '您只有完成信息认证后,才可进行相关操作。',
confirmText: '去认证'
}).then(() => {
this.$linkTo('/pages/AppMine/userInfo')
}).catch(() => {
})
} else {
if(!status) {
this.$linkTo(url)
} else {
// 停留
}
}
},
getStatus() {
this.$instance.post(`/app/appwechatsigninfo/checkSign`).then(res=> {
if(res?.data !== null) {
this.status = 1
}
})
},
getModule() {
this.$instance.post(`/app/appintegraluserapply/queryModuleByName`).then(res=> {
if(res?.data) {
this.getList(res.data)
}
})
}
},
onShow() {
this.getStatus()
this.getModule()
},
}
</script>
<style lang="scss" scoped>
.AppNewFarmerBank {
padding-bottom: 20px;
box-sizing: border-box;
.swiper-content {
width: 100%;
height: 332px;
padding: 32px 32px 0;
box-sizing: border-box;
background: #FFF;
img {
width: 100%;
height: 100%;
border-radius: 16px;
}
}
.welcome {
display: flex;
align-items: center;
width: 100%;
height: 120px;
padding: 0 32px;
box-sizing: border-box;
background: #FFF;
.signin {
width: 104px;
height: 52px;
line-height: 52px;
border: 2px solid #2D7DFF;
border-radius: 40px;
color: #2D7DFF;
text-align: center;
font-size: 22px;
font-weight: 400;
}
.welcome-user {
width: calc(100% - 60px);
font-size: 30px;
font-weight: 400;
font-family: "PingFang SC";
.name {
color: #2D7DFF;
font-weight: 500;
}
}
}
.card-list {
background: #FFF;
padding: 0 32px;
display: flex;
flex-wrap: wrap;
.jfsq {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenshenqing.png') no-repeat ;
color: #DF863E;
}
.jsrw {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenrenwu.png') no-repeat;
color: #2D7DFF;
}
.jfph {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenpaihang.png') no-repeat;
color: #338A77;
}
.jfsc {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifenshangcheng.png') no-repeat;
color: #D9606E;
}
.jfgs {
background: url('https://cdn.cunwuyun.cn/fengdu/img-jifengongshi.png') no-repeat;
color: #484899;
}
.wdjf {
background: url('https://cdn.cunwuyun.cn/fengdu/img-wodejifen.png') no-repeat;
color: #DA9A07;
}
& > div:nth-child(2n+1) {
margin-right: 30px;
}
div {
background-size: 100% 100%;
width: 328px;
height: 144px;
margin-bottom: 32px;
padding: 28px 32px;
box-sizing: border-box;
p {
font-size: 30px;
font-weight: 600;
}
h4 {
font-size: 20px;
font-weight: 400;
margin-top: 8px;
}
}
}
.handpick {
padding: 0 32px;
box-sizing: border-box;
.title {
margin: 32px 0;
display: flex;
justify-content: space-between;
align-items: center;
h1 {
font-size: 34px;
font-weight: 500;
}
.more {
width: 200px;
color: #687DA6;
font-size: 28px;
font-weight: 400;
text-align: right;
}
}
.list {
.card {
margin-bottom: 24px;
padding: 32px 24px;
box-sizing: border-box;
background: #FFF;
border-radius: 12px;
.title-info {
font-family: PingFangSC-SNaNpxibold;
font-weight: 600;
font-size: 34px;
color: #333;
letter-spacing: 0;
line-height: 40px;
margin-bottom: 16px;
}
.type-info {
font-family: PingFangSC-Regular;
font-size: 34px;
color: #687DA6;
line-height: 40px;
span {
display: inline-block;
font-family: PingFangSC-Regular;
font-size: 26px;
color: #666;
line-height: 40px;
margin-left: 20px;
}
}
.top {
display: flex;
justify-content: space-between;
margin-bottom: 28px;
.left {
width: calc(100% - 100px);
p {
overflow:hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
.right {
width: 100px;
text-align: right;
img {
width: 40px;
height: 40px;
vertical-align: bottom;
}
span {
font-size: 28px;
font-weight: 400;
color: #687DA6;
}
}
}
.content-info {
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #333;
line-height: 42px;
margin-bottom: 24px;
}
.imgs {
display: flex;
flex-wrap: wrap;
background: #FFF;
image,
video {
width: 200px;
height: 200px;
margin: 0 12px 0 0;
}
image:nth-child(3n + 0),
video:nth-child(3n + 0) {
margin: 0;
}
}
}
}
}
}
</style>

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB