jiazhipeng 4 months ago
parent
commit
cef5331379
  1. 10
      mixins/myMixins.js
  2. 13
      pages.json
  3. 188
      pages/index/index.vue
  4. 47
      pages/stratIndex.vue
  5. 15
      subPackages/letter/index.vue

10
mixins/myMixins.js

@ -15,10 +15,10 @@ export const myMixins ={
// 分享到朋友圈 // 分享到朋友圈
onShareTimeline() { onShareTimeline() {
return { return {
title: '智游常熟', title: 'CGC-ICH',
type: 0, type: 0,
summary: "edewdewdewf", summary: "edewdewdewf",
imageUrl: "https://static.ticket.sz-trip.com/dongtai/images/index/share.jpg" imageUrl: "https://static.ticket.sz-trip.com/uploads/20250612/e022a1b7c8df621cb15082d0b0f5bba3.jpg"
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@ -33,10 +33,10 @@ export const myMixins ={
console.log(111,url,`${view.route}?url=${url}`) console.log(111,url,`${view.route}?url=${url}`)
return { return {
title: '智游常熟', // 分享的名称 title: 'CGC-ICH', // 分享的名称
path: `${view.route}?url=${url}`, // 将 url 作为参数传递 path: `${view.route}?url=${url}`, // 将 url 作为参数传递
imageUrl: "https://static.ticket.sz-trip.com/dongtai/images/index/share.jpg", imageUrl: "https://static.ticket.sz-trip.com/uploads/20250612/e022a1b7c8df621cb15082d0b0f5bba3.jpg",
mpId: 'wxb8f15afe2765976d' // 此处配置微信小程序的 AppId mpId: 'wx9d68934300b1fe90' // 此处配置微信小程序的 AppId
}; };
} }
} }

13
pages.json

@ -1,9 +1,16 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/stratIndex",
"style": {
"navigationStyle": "custom"
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "大美非遗" // "navigationStyle": "custom",
"navigationBarTitleText": "CGC-ICH"
} }
}, },
{ {
@ -16,7 +23,7 @@
{ {
"path": "pages/login/login", "path": "pages/login/login",
"style": { "style": {
"navigationBarTitleText": "大美非遗" "navigationBarTitleText": "CGC-ICH"
} }
} }
], ],
@ -26,7 +33,7 @@
{ {
"path": "index", "path": "index",
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "CGC-ICH"
} }
}, },
{ {

188
pages/index/index.vue

@ -1,5 +1,10 @@
<template> <template>
<view class="content"> <view class="content" style="overflow-x: auto;">
<!-- <view class="search-header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}">
<view class="title">CGC-ICH</view>
<view class="subtitle">大运河非遗</view>
</view>
<div :style="{'height':height+'px','flex-shrink':0}"></div> -->
<!-- 头部banner --> <!-- 头部banner -->
<view class="top-box"> <view class="top-box">
<!-- 搜索 --> <!-- 搜索 -->
@ -21,36 +26,37 @@
<view class="menu-box flex-between"> <view class="menu-box flex-between">
<view class="menu-left flex-around"> <view class="menu-left flex-around">
<view class="" v-for="(item,index) in menuList" :key="index" @click="gotoPath(item.path)"> <view class="" v-for="(item,index) in menuList" :key="index" @click="gotoPath(item.path)">
<image :src="`https://static.ticket.sz-trip.com/cgc/images/index/${index + 1}.png`" class="topImg" mode="heightFix"></image> <image :src="`https://static.ticket.sz-trip.com/cgc/images/indexs/${index + 1}.png`" class="topImg" mode="heightFix"></image>
<image :src="`https://static.ticket.sz-trip.com/cgc/images/index/${index + 1}s.png`" class="titleImg" mode="heightFix"></image> <image :src="`https://static.ticket.sz-trip.com/cgc/images/indexs/${index + 1}s.png`" class="titleImg" mode="heightFix"></image>
</view> </view>
</view> </view>
<view class="menu-right flex-around"> <!-- <view class="menu-right flex-around">
<swiper class="menu-right" :circular="true" :interval="6000" <swiper class="menu-right" :circular="true" :interval="6000"
:duration="800" :indicator-dots="false" :autoplay="true" v-if="smallBanner"> :duration="800" :indicator-dots="false" :autoplay="true" v-if="smallBanner">
<swiper-item v-for="(item, index) in smallBanner" :key="index" @click.stop="gotoUrlNew(item)"> <swiper-item v-for="(item, index) in smallBanner" :key="index" @click.stop="gotoUrlNew(item)">
<image class="menu-right" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image> <image class="menu-right" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view> -->
</view> </view>
<!-- 非遗手札 --> <!-- 非遗手札 -->
<view v-if="handwrittenList && handwrittenList.length > 0"> <view v-if="handwrittenList && handwrittenList.length > 0">
<view class="title-box flex-between"> <view class="title-box flex-between">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/title1.png" mode=""></image> <image src="https://cgc.js-dyyj.com/uploads/20250618/0cc227827073c9ab16dd2ce9b9e3b579.png" mode="heightFix"></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/letter/index')"></image> <image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/letter/index')"></image>
</view> </view>
<view class="handwritten-box flex-between"> <view class="handwritten-box flex-between">
<image :src="showImg(item.image)" mode="aspectFill" v-for="(item,index) in handwrittenList" :key="index" <image :src="showImg(item.image)" mode="aspectFill" v-for="(item,index) in handwrittenList" :key="index"
@click="gotoPath('/subPackages/letter/detail?id='+item.id)"></image> @click="viewDetail(item)"></image>
</view> </view>
</view> </view>
<!-- 非遗时光 --> <!-- 非遗时光 -->
<view v-if="shiguang && shiguang.image"> <view v-if="shiguang && shiguang.image">
<view class="title-box flex-between"> <view class="title-box flex-between">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/title2.png" mode=""></image> <image src="https://cgc.js-dyyj.com/uploads/20250618/496fdd2ccccc9f8a00ec698549532185.png" mode="heightFix"></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/shiguang/index')"></image> <image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/shiguang/index')"></image>
</view> </view>
<view class="time-box" :style="{backgroundImage: 'url('+showImg(shiguang.image)+')'}" @click="gotoVideo(shiguang)"> <view class="time-box" :style="{backgroundImage: 'url('+showImg(shiguang.image)+')'}" @click="gotoVideo(shiguang)">
@ -69,18 +75,20 @@
<view v-for="(item,indexs) in getColumnItems(index)" :key="indexs" class="hot-item" @click="gotoHotDetail(item)"> <view v-for="(item,indexs) in getColumnItems(index)" :key="indexs" class="hot-item" @click="gotoHotDetail(item)">
<view class="image-container"> <view class="image-container">
<image :src="item.src" mode="widthFix" class="hot-img" lazy-load="true"></image> <image :src="item.src" mode="widthFix" class="hot-img" lazy-load="true"></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/plays.png" mode="widthFix" class="play-img" v-if="hotIndex && item.genre == 'video'" lazy-load="true"></image> <!-- <image src="https://static.ticket.sz-trip.com/cgc/images/index/plays.png" mode="widthFix" class="play-img" v-if="hotIndex && item.genre == 'video'" lazy-load="true"></image> -->
</view> </view>
<view class="hot-content"> <view class="hot-content">
<view class="title text-overflowRows">{{item.title || item.goods.title}}</view> <view class="title text-overflowRows">{{item.title || item.goods.title}}</view>
<view class="subtitle" v-if="hotIndex && item.genre == 'video'"> <!-- <view class="subtitle" v-if="hotIndex && item.genre == 'video'">
<image src="https://static.ticket.sz-trip.com/tongli/images/index/user.png" mode="aspectFill"></image> <image src="https://static.ticket.sz-trip.com/tongli/images/index/user.png" mode="aspectFill"></image>
{{item.author}} {{item.author}}
</view> -->
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view> </view>
</template> </template>
@ -88,26 +96,36 @@
export default { export default {
data() { data() {
return { return {
//
height: 0,
statusBarHeight: 0,
topBanner: [], topBanner: [],
smallBanner: [], smallBanner: [],
menuList: [ menuList: [
{ {
path: '/subPackages/techan/index?idIndex=0' path: '/subPackages/techan/index?idIndex=0',
image: '',
}, },
{ {
path: '/subPackages/techan/index?idIndex=1' path: '/subPackages/techan/index?idIndex=1',
image: '',
}, },
{ {
path: '/subPackages/techan/index?idIndex=2' path: '/subPackages/techan/index?idIndex=2',
image: '',
}, },
{ {
path: '/subPackages/techan/index?idIndex=3' path: '/subPackages/techan/index?idIndex=3',
image: '',
}, },
{ {
path: '/subPackages/techan/index?idIndex=4' path: '/subPackages/techan/index?idIndex=4',
image: '',
}, },
{ {
path: '/subPackages/techan/index?idIndex=5' path: '/subPackages/techan/index?idIndex=5',
image: '',
} }
], ],
handwrittenList: [], handwrittenList: [],
@ -118,14 +136,14 @@
id: '41' id: '41'
}, },
{ {
title: '猜你喜欢', title: '苏州非遗',
id: '41' id: '41'
} }
], ],
hotIndex: 0, hotIndex: 0,
hotList: [], hotList: [],
isLoading: false, isLoading: false,
limit: 4 limit: 4,
} }
}, },
onLoad() { onLoad() {
@ -136,6 +154,7 @@
if(!uni.getStorageSync('location')) { if(!uni.getStorageSync('location')) {
this.getLocation() this.getLocation()
} }
this.initRectInfo()
this.getList() this.getList()
this.changeType(0) this.changeType(0)
@ -146,6 +165,23 @@
}, 1000); }, 1000);
}, },
methods: { methods: {
viewDetail(item) {
if (item.url) {
uni.navigateTo({
url:"/subPackages/webPage/webPage?url="+encodeURIComponent(item.url)
})
return
}
uni.navigateTo({
url:'/subPackages/letter/detail?id='+item.id
})
},
initRectInfo () {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
//
this.height = sysInfo.statusBarHeight + 40
},
getList() { getList() {
// //
this.Post({ this.Post({
@ -164,6 +200,7 @@
}, '/api/adv/getAdv').then(res => { }, '/api/adv/getAdv').then(res => {
if(res.data) { if(res.data) {
this.smallBanner = res.data; this.smallBanner = res.data;
this.screenPng = res.data[0]
} }
}); });
@ -171,7 +208,7 @@
this.Post({ this.Post({
type_id: 1, type_id: 1,
offset: 0, offset: 0,
limit: 4 limit: 1
}, '/api/article/getArticleByType').then(res => { }, '/api/article/getArticleByType').then(res => {
if(res.data) { if(res.data) {
this.handwrittenList = res.data this.handwrittenList = res.data
@ -229,13 +266,14 @@
getColumnItems(columnIndex) { getColumnItems(columnIndex) {
const columnItems = []; const columnItems = [];
this.hotList.forEach((item, index) => { this.hotList.forEach((item, index) => {
switch (this.hotIndex) { // switch (this.hotIndex) {
case 1: // case 1:
item.src = this.showImg(item.image); // item.src = this.showImg(item.image);
break; // break;
default: // default:
// item.src = this.showImg(item.goods.image);
// }
item.src = this.showImg(item.goods.image); item.src = this.showImg(item.goods.image);
}
if (index % 2 === columnIndex) { if (index % 2 === columnIndex) {
columnItems.push(item); columnItems.push(item);
@ -252,15 +290,23 @@
}, },
getHotList() { getHotList() {
if(this.hotIndex == 1) { if(this.hotIndex == 1) {
// this.Post({
// type_id: 3,
// offset: this.hotList.length,
// limit: this.limit
// },'/api/Article/getArticleByType').then(res => {
// if(res) {
// if(res.data.length < this.limit) this.isLoading = true
// this.hotList = this.hotList.concat(res.data)
// }
// })
this.Post({ this.Post({
type_id: 3, tag_id: 52,
offset: this.hotList.length, offset: this.hotList.length,
limit: this.limit limit: this.limit,
},'/api/Article/getArticleByType').then(res => { },'/api/tag/getGoodsByTagId').then(res => {
if(res) {
if(res.data.length < this.limit) this.isLoading = true if(res.data.length < this.limit) this.isLoading = true
this.hotList = this.hotList.concat(res.data) this.hotList = this.hotList.concat(res.data)
}
}) })
}else { }else {
this.Post({ this.Post({
@ -279,29 +325,50 @@
}) })
}, },
gotoHotDetail(item) { gotoHotDetail(item) {
if(this.hotIndex == 1) {
if(item.genre == 'video') {
//
this.gotoVideo(item)
}else {
//
uni.navigateTo({
url: '/subPackages/letter/detail?id=' + item.id
})
}
}else {
uni.navigateTo({ uni.navigateTo({
url: '/subPackages/techan/detail?id=' + item.goods_id url: '/subPackages/techan/detail?id=' + item.goods_id
}) })
} // if(this.hotIndex == 1) {
// if(item.genre == 'video') {
// //
// this.gotoVideo(item)
// }else {
// //
// uni.navigateTo({
// url: '/subPackages/letter/detail?id=' + item.id
// })
// }
// }else {
// uni.navigateTo({
// url: '/subPackages/techan/detail?id=' + item.goods_id
// })
// }
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.search-header{
width: 100%;
position: fixed;
top: 0;
left: 0;
right: 0;
background: white;
text-align: center;
z-index:99;
.title{
font-size: 30rpx
}
.subtitle{
font-size: 22rpx;
}
}
.content { .content {
min-height: 100vh; min-height: 100vh;
background: #F9F0EA; background: #F9F0EA;
@ -349,28 +416,33 @@
} }
.menu-box { .menu-box {
margin: 54rpx 33rpx 0; width: 100%;
padding: 54rpx 33rpx 0;
overflow: hidden;
box-sizing: border-box;
.menu-left { .menu-left {
flex-wrap: wrap; // flex-wrap: wrap;
width: 100%;
display: flex;
justify-content: space-between;
&>view { &>view {
width: 33%; flex: 1;
flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
&>view:nth-child(n+4) {
margin-top: 36rpx;
}
.topImg { .topImg {
height: 108rpx; height: 84rpx;
} }
.titleImg { .titleImg {
height: 22rpx; height: 21rpx;
margin-top: 8rpx; margin-top: 19rpx;
} }
} }
@ -400,13 +472,13 @@
flex-wrap: wrap; flex-wrap: wrap;
image { image {
width: 322rpx; width: 100%;
height: 181rpx; height: 181rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
&>image:nth-child(n+3) { // &>image:nth-child(n+3) {
margin-top: 13rpx; // margin-top: 13rpx;
} // }
} }
.time-box { .time-box {

47
pages/stratIndex.vue

@ -0,0 +1,47 @@
<template>
<view class="bg" @click="goIndex()">
<image :src="showImg(screenPng)"></image>
</view>
</template>
<script>
export default {
data() {
return {
screenPng: ""
}
},
onLoad() {
},
onReady () {
//
this.Post({
type_id: 3,
position: 5,
}, '/api/adv/getAdv').then(res => {
if(res.data && res.data.length>0) {
this.screenPng = res.data[0].head_img
}
});
},
methods: {
goIndex () {
uni.switchTab({
url:"/pages/index/index"
})
},
}
}
</script>
<style lang="scss" scoped>
.bg{
height: 100vh;
image{
width: 100%;
height: 100%;
}
}
</style>

15
subPackages/letter/index.vue

@ -3,7 +3,7 @@
<img :src="showImg(headImg)" class="topImg" /> <img :src="showImg(headImg)" class="topImg" />
<div class="article-container"> <div class="article-container">
<navigator :url="'/subPackages/letter/detail?id='+item.id" v-for="(item,index) in list" :key="index" class="item"> <view @click="viewDetail(item)" v-for="(item,index) in list" :key="index" class="item">
<image class="img" :src="showImg(item.image)" mode="aspectFill"></image> <image class="img" :src="showImg(item.image)" mode="aspectFill"></image>
<view class="content flex-column"> <view class="content flex-column">
<view class="title text-overflowRows">{{item.title}}</view> <view class="title text-overflowRows">{{item.title}}</view>
@ -22,7 +22,7 @@
</view> </view>
</view> </view>
</view> </view>
</navigator> </view>
</div> </div>
</view> </view>
@ -57,6 +57,17 @@
}, },
likeAricle (item) { likeAricle (item) {
},
viewDetail(item) {
if (item.url) {
uni.navigateTo({
url:"/subPackages/webPage/webPage?url="+encodeURIComponent(item.url)
})
return
}
uni.navigateTo({
url:'/subPackages/letter/detail?id='+item.id
})
}, },
handleNum (num) { handleNum (num) {
if (num<=0) { return 0 } if (num<=0) { return 0 }

Loading…
Cancel
Save