diff --git a/pages.json b/pages.json index deb249e..0e4428d 100644 --- a/pages.json +++ b/pages.json @@ -126,6 +126,18 @@ "style" : { "navigationBarTitleText" : "修改昵称" } + }, + { + "path" : "webPage/webPage", + "style" : { + "navigationBarTitleText" : "" + } + }, + { + "path" : "video/video", + "style" : { + "navigationBarTitleText" : "" + } } ] }], diff --git a/pages/index/index.vue b/pages/index/index.vue index e54d71f..3875ea4 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -27,8 +27,8 @@ - + :duration="800" :indicator-dots="false" :autoplay="true" v-if="smallBanner"> + @@ -38,10 +38,11 @@ - + - + @@ -49,7 +50,7 @@ - + @@ -69,7 +70,7 @@ {{item.title || item.name}} - + {{item.author}} @@ -83,14 +84,8 @@ export default { data() { return { - topBanner: [ - { - head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg' - }, - { - head_img: 'https://changshu.js-dyyj.com/uploads/20250418/8a7631a1955ca05e619c0a25ad5ac1d1.jpg' - } - ], + topBanner: [], + smallBanner: [], menuList: [ { path: '' @@ -111,12 +106,8 @@ path: '' } ], - handwrittenList: [ - {head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'}, - {head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'}, - {head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'}, - {head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'}, - ], + handwrittenList: [], + shiguang: {}, hotType: [ { title: '好物推荐', @@ -142,7 +133,7 @@ this.getLocation() } - this.topBanner() + this.getList() this.changeType(0) }, onReachBottom() { @@ -151,16 +142,84 @@ }, 1000); }, methods: { - getBanner() { + getList() { // 大轮播 - // this.Post({ - // type_id: 3, - // position: 6, - // }, '/api/adv/getAdv').then(res => { - // if (res.data) { - // // this.topBanner = res.data; - // } - // }); + this.Post({ + type_id: 3, + position: 1, + }, '/api/adv/getAdv').then(res => { + if(res.data) { + this.topBanner = res.data; + } + }); + + // 小轮播 + this.Post({ + type_id: 3, + position: 2, + }, '/api/adv/getAdv').then(res => { + if(res.data) { + this.smallBanner = res.data; + } + }); + + // 非遗手札 + this.Post({ + type_id: 1, + offset: 0, + limit: 4 + }, '/api/article/getArticleByType').then(res => { + if(res.data) { + this.handwrittenList = res.data + } + }) + + // 非遗拾光 + this.Post({ + type_id: 2, + offset: 0, + limit: 1 + }, '/api/article/getArticleByType').then(res => { + if(res.data) { + this.shiguang = res.data[0] + } + }) + }, + // 2是各种详情页,3是列表专题页面,4是小程序 + gotoUrlNew(item) { + console.log(item); + let that = this; + let url = ''; + switch (item.jump_type) { + case 0: + break; + case 2: + uni.navigateTo({ + url: item.tdata + }); + break; + case 3: + uni.navigateTo({ + url: '/subPackages/webPage/webPage?url=' + item.tdata + }); + break; + case 4: + uni.navigateToMiniProgram({ + appId: item.tdata.appid, // 此为appid + path: item.tdata.page, // 此为首页路径 + envVersion: 'release', + success: res => { + // 打开成功 + console.log('打开成功', res); + }, + fail: err => { + console.log(err); + } + }); + break; + default: + break; + } }, // 瀑布流 getColumnItems(columnIndex) { @@ -188,9 +247,9 @@ this.getHotList() }, getHotList() { - if(this.typeIndex == 1) { + if(this.hotIndex == 1) { this.Post({ - type_id: this.hotType[this.hotIndex].id, + type_id: 3, offset: this.hotList.length, limit: this.limit },'/api/Article/getArticleByType').then(res => { @@ -212,12 +271,15 @@ }) } }, + gotoVideo(item) { + uni.navigateTo({ + url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item)) + }) + }, gotoHotDetail(item) { - if(this.typeIndex == 1) { + if(this.hotIndex == 1) { // 视频 - uni.navigateTo({ - url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item)) - }) + this.gotoVideo(item) }else { } @@ -439,7 +501,6 @@ width: 48rpx; height: 48rpx; border-radius: 50%; - border: 1rpx solid #000000; display: block; margin-right: 15rpx; } diff --git a/static/images/home.png b/static/images/home.png new file mode 100644 index 0000000..adfa5be Binary files /dev/null and b/static/images/home.png differ diff --git a/static/images/mine.png b/static/images/mine.png new file mode 100644 index 0000000..386baa3 Binary files /dev/null and b/static/images/mine.png differ diff --git a/static/images/selectHome.png b/static/images/selectHome.png new file mode 100644 index 0000000..5800170 Binary files /dev/null and b/static/images/selectHome.png differ diff --git a/static/images/selectMine.png b/static/images/selectMine.png new file mode 100644 index 0000000..69b7f19 Binary files /dev/null and b/static/images/selectMine.png differ diff --git a/subPackages/video/video.vue b/subPackages/video/video.vue new file mode 100644 index 0000000..ce70ace --- /dev/null +++ b/subPackages/video/video.vue @@ -0,0 +1,59 @@ + + + + + \ No newline at end of file diff --git a/subPackages/webPage/webPage.vue b/subPackages/webPage/webPage.vue new file mode 100644 index 0000000..56e98a3 --- /dev/null +++ b/subPackages/webPage/webPage.vue @@ -0,0 +1,28 @@ + + + + + + + \ No newline at end of file