同步资源

This commit is contained in:
aixianling
2022-07-15 19:16:43 +08:00
parent 729a3eb8ee
commit d9e5f2bf43
2 changed files with 54 additions and 69 deletions

View File

@@ -14,8 +14,7 @@
<div class="grid-content">
<u-grid :col="4" hover-class="text-hover" :border="false">
<u-grid-item v-for="(item, index) in grids" :key="index" :custom-style="{padding:'8px 0'}" bg-color="none"
class="grid-item"
@click="handleClick(item)">
class="grid-item" @click="handleClick(item)">
<img :src="item.pictureUrl" alt=""/>
<div class="grid-text">{{ item.name }}</div>
</u-grid-item>
@@ -49,9 +48,9 @@
<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 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">
@@ -485,6 +484,5 @@ export default {
}
}
}
}
</style>

View File

@@ -11,7 +11,7 @@
</div>
</div>
<div class="header-bg"></div>
<img class="border" src="../../static/img/border.png" alt=""/>
<img class="border" :src="`${cdn}/border.png`" alt="">
<div class="swiper-content">
<u-swiper :list="swiperList" mode="none" height="240" bg-color="none" @click="handleBannerClick"/>
</div>
@@ -54,7 +54,7 @@
</div>
<div class="content-wrap" v-if="category.contentType == 1">
<img class="img" :src="category.pictureUrl" alt=""/>
<img class="play-icon" src="../../static/img/play.png" alt=""/>
<img class="play-icon" :src="`${cdn}/play.png`" alt=""/>
</div>
<div class="bottom">
<div class="left">
@@ -81,6 +81,7 @@ export default {
appName: "首页",
data() {
return {
cdn: "https://cdn.cunwuyun.cn/wxmp",
areaName: '',
swiperList: [],
index: 0,
@@ -93,7 +94,7 @@ export default {
}
},
computed: {
...mapState(['global', 'user', 'token']),
...mapState(['user', 'token']),
active() {
return {
fontSize: '22px',
@@ -102,8 +103,8 @@ export default {
},
noticeList() {
let {notices} = this
return notices?.length > 0 ? notices?.map((e) => e.title) || ['暂无公告'] : ['暂无公告']
},
return notices?.length > 0 ? notices?.map(e => e.title) || ['暂无公告'] : ['暂无公告']
}
},
onLoad() {
this.autoLogin().then(() => {
@@ -117,14 +118,12 @@ export default {
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.$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()
@@ -136,23 +135,20 @@ export default {
this.search.categoryId = this.categorys[idx]['id']
this.getCategoryList()
},
getCategoryList() {
this.$instance
.post('/app/appcontentinfo/list', null, {
params: {...this.search, size: 100},
})
.then((res) => {
this.$instance.post("/app/appcontentinfo/list", null, {
params: {...this.search, size: 100}
}).then(res => {
if (res?.data) {
this.categoryList = res.data.records
this.categoryList = res.data.records;
}
})
},
clickNotice(val) {
const id = this.notices[val]['id']
const id = this.notices[val]["id"];
if (id) {
uni.navigateTo({
url: '/mods/AppNotice/AppNotice?id=' + id,
url: "/mods/AppNotice/AppNotice?id=" + id
})
}
},
@@ -160,30 +156,26 @@ export default {
if (type == 0) {
uni.navigateToMiniProgram({appId})
} else if (type == 1) {
this.$linkTo('/subPages/h5/webview?link=' + url)
this.$linkTo("/subPages/h5/webview?link=" + url);
}
},
getNotice() {
this.$instance
.post('/app/appmininotice/list', null, {
this.$instance.post("/app/appmininotice/list", null, {
params: {size: 999},
withoutToken: true,
})
.then((res) => {
withoutToken: true
}).then(res => {
if (res?.data) {
this.notices = res.data.records
this.notices = res.data.records;
}
})
},
getActive() {
this.$instance
.post('/app/appminitopicconfig/list', null, {
this.$instance.post("/app/appminitopicconfig/list", null, {
params: {size: 999},
withoutToken: true,
})
.then((res) => {
withoutToken: true
}).then(res => {
if (res?.data) {
this.activeList = res.data.records
this.activeList = res.data.records;
}
})
},
@@ -191,23 +183,19 @@ export default {
* 获取顶部九宫格
*/
getGrids() {
this.$instance
.post('/app/appminihomeconfig/list', null, {
this.$instance.post("/app/appminihomeconfig/list", null, {
params: {picked: 1},
withoutToken: true,
})
.then((res) => {
withoutToken: true
}).then(res => {
if (res?.data) {
this.grids = res.data.records
this.grids = res.data.records;
}
})
},
getSwiperList() {
this.$instance
.post('/app/appbanner/listForWx', null, {
withoutToken: true,
})
.then((res) => {
this.$instance.post('/app/appbanner/listForWx', null, {
withoutToken: true
}).then((res) => {
if (res?.data) {
this.swiperList = res.data?.map((e) => ({...e, image: e.imgUrl})) || []
}
@@ -215,21 +203,21 @@ export default {
},
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') {
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('请使用普通微信打开小程序进行咨询')
},
})
this.$u.toast('请使用普通微信打开小程序进行咨询');
}
});
}
} else if (type && type == "0") {
uni.showLoading({title: '正在进入应用...'})
@@ -239,14 +227,13 @@ export default {
handleBannerClick(index) {
if (!this.swiperList[index].linkUrl) return
if (this.swiperList[index].type == '0') {
//0 h5链接 1 小程序链接; 2外部小程序
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,
appId: this.swiperList[index].linkUrl
})
}
},
@@ -255,19 +242,19 @@ export default {
onShareAppMessage() {
return {
title: '欢迎使用数字乡村治理服务一体化平台~',
path: `/pages/home/home`,
path: `/pages/home/home`
}
},
}
</script>
<style scoped lang="scss">
@import '~dvcp-wui/common';
@import "~dvcp-wui/common";
.page {
width: 100%;
min-height: 100%;
background-color: #f3f6f9;
background-color: #F3F6F9;
position: relative;
.search-wrap {