Browse Source

提交

master
chenkainan 5 months ago
parent
commit
2053a9b333
  1. 12
      pages.json
  2. 133
      pages/index/index.vue
  3. BIN
      static/images/home.png
  4. BIN
      static/images/mine.png
  5. BIN
      static/images/selectHome.png
  6. BIN
      static/images/selectMine.png
  7. 59
      subPackages/video/video.vue
  8. 28
      subPackages/webPage/webPage.vue

12
pages.json

@ -126,6 +126,18 @@
"style" : {
"navigationBarTitleText" : "修改昵称"
}
},
{
"path" : "webPage/webPage",
"style" : {
"navigationBarTitleText" : ""
}
},
{
"path" : "video/video",
"style" : {
"navigationBarTitleText" : ""
}
}
]
}],

133
pages/index/index.vue

@ -27,8 +27,8 @@
</view>
<view class="menu-right flex-around">
<swiper class="menu-right" :circular="true" :interval="6000"
:duration="800" :indicator-dots="false" :autoplay="true" v-if="topBanner">
<swiper-item v-for="(item, index) in topBanner" :key="index" @click.stop="gotoUrlNew(item)">
:duration="800" :indicator-dots="false" :autoplay="true" v-if="smallBanner">
<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>
</swiper-item>
</swiper>
@ -38,10 +38,11 @@
<!-- 非遗手札 -->
<view class="title-box flex-between">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/title1.png" mode=""></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode=""></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/letter/index')"></image>
</view>
<view class="handwritten-box flex-between">
<image :src="showImg(item.head_img)" mode="aspectFill" v-for="(item,index) in handwrittenList" :key="index"></image>
<image :src="showImg(item.image)" mode="aspectFill" v-for="(item,index) in handwrittenList" :key="index"
@click="gotoPath('/subPackages/letter/detail?id='+item.id)"></image>
</view>
<!-- 非遗时光 -->
@ -49,7 +50,7 @@
<image src="https://static.ticket.sz-trip.com/cgc/images/index/title2.png" mode=""></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode="" @click="gotoPath('/subPackages/shiguang/index')"></image>
</view>
<view class="time-box" style="background-image: url('https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg')">
<view class="time-box" :style="{backgroundImage: 'url('+showImg(shiguang.image)+')'}" @click="gotoVideo(shiguang)">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/play.png" class="play"></image>
</view>
@ -69,7 +70,7 @@
<view class="hot-content">
<view class="title text-overflowRows">{{item.title || item.name}}</view>
<view class="subtitle" v-if="hotIndex">
<image :src="item.src" mode="aspectFill"></image>
<image src="https://static.ticket.sz-trip.com/tongli/images/index/user.png" mode="aspectFill"></image>
{{item.author}}
</view>
</view>
@ -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]
}
})
},
// 234
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 @@
})
}
},
gotoHotDetail(item) {
if(this.typeIndex == 1) {
//
gotoVideo(item) {
uni.navigateTo({
url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item))
})
},
gotoHotDetail(item) {
if(this.hotIndex == 1) {
//
this.gotoVideo(item)
}else {
}
@ -439,7 +501,6 @@
width: 48rpx;
height: 48rpx;
border-radius: 50%;
border: 1rpx solid #000000;
display: block;
margin-right: 15rpx;
}

BIN
static/images/home.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
static/images/mine.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
static/images/selectHome.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
static/images/selectMine.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

59
subPackages/video/video.vue

@ -0,0 +1,59 @@
<template>
<view class="bg">
<video :src="showImg(src)" controls class="myVideo" :poster="poster"></video>
<view class="title">
{{title}}
</view>
</view>
</template>
<script>
export default {
data() {
return {
src: '',
poster: '',
title: ''
}
},
onLoad(option) {
const item = JSON.parse(decodeURIComponent(option.item));
this.src = item.video_file
this.poster = item.image
this.title = item.title
},
onReady() {
uni.setNavigationBarTitle({
title: this.title
})
}
}
</script>
<style scoped lang="scss">
.bg {
width: 100%;
height: 100vh;
position: relative;
}
.myVideo {
width: 100%;
height: 100vh;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.title {
width: 699rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 29rpx;
color: #FFFFFF;
position: fixed;
left: 28rpx;
bottom: 140rpx;
}
</style>

28
subPackages/webPage/webPage.vue

@ -0,0 +1,28 @@
<template>
<web-view :src="url"></web-view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
onLoad(option) {
if (option.url) {
this.url = decodeURIComponent(option.url)
}else{
this.url = uni.getStorageSync('webUrl')
}
console.log(this.url)
// 使web-view
}
}
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save