jiazhipeng 4 months ago
parent
commit
83852248d0
  1. 6
      mixins/myMixins.js
  2. 7
      pages.json
  3. 20
      pages/index/index.vue
  4. 45
      pages/login/login.vue
  5. 16
      static/js/CommonFunction.js
  6. 4
      subPackages/letter/index.vue
  7. 6
      subPackages/shiguang/index.vue
  8. 4
      subPackages/techan/index.vue

6
mixins/myMixins.js

@ -17,8 +17,8 @@ export const myMixins ={
return {
title: 'CGC-ICH',
type: 0,
summary: "edewdewdewf",
imageUrl: "https://static.ticket.sz-trip.com/uploads/20250612/e022a1b7c8df621cb15082d0b0f5bba3.jpg"
summary: "",
imageUrl: "https://cgc.js-dyyj.com/uploads/20250619/172a730c88bd8894dee1e64c703795eb.jpg"
}
},
onShareAppMessage() {
@ -35,7 +35,7 @@ export const myMixins ={
return {
title: 'CGC-ICH', // 分享的名称
path: `${view.route}?url=${url}`, // 将 url 作为参数传递
imageUrl: "https://static.ticket.sz-trip.com/uploads/20250612/e022a1b7c8df621cb15082d0b0f5bba3.jpg",
imageUrl: "https://cgc.js-dyyj.com/uploads/20250619/172a730c88bd8894dee1e64c703795eb.jpg",
mpId: 'wx9d68934300b1fe90' // 此处配置微信小程序的 AppId
};
}

7
pages.json

@ -9,8 +9,8 @@
{
"path": "pages/index/index",
"style": {
// "navigationStyle": "custom",
"navigationBarTitleText": "CGC-ICH"
"navigationStyle": "custom"
// "navigationBarTitleText": "CGC-ICH"
}
},
{
@ -23,7 +23,8 @@
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "CGC-ICH"
// "navigationBarTitleText": "CGC-ICH"
"navigationStyle": "custom"
}
}
],

20
pages/index/index.vue

@ -1,10 +1,10 @@
<template>
<view class="content" style="overflow-x: auto;">
<!-- <view class="search-header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}">
<view class="search-header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}">
<view class="title">CGC-ICH</view>
<view class="subtitle">大运河非遗</view>
<view class="subtitle">大运河非物质文化</view>
</view>
<div :style="{'height':height+'px','flex-shrink':0}"></div> -->
<div :style="{'height':height+'px','flex-shrink':0}"></div>
<!-- 头部banner -->
<view class="top-box">
<!-- 搜索 -->
@ -26,8 +26,8 @@
<view class="menu-box flex-between">
<view class="menu-left flex-around">
<view class="" v-for="(item,index) in menuList" :key="index" @click="gotoPath(item.path)">
<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/indexs/${index + 1}s.png`" class="titleImg" mode="heightFix"></image>
<image :src="showImg(`https://static.ticket.sz-trip.com/cgc/images/indexs/${index + 1}.png`)" class="topImg" mode="heightFix"></image>
<image :src="showImg(`https://static.ticket.sz-trip.com/cgc/images/indexs/${index + 1}s.png`)" class="titleImg" mode="heightFix"></image>
</view>
</view>
<!-- <view class="menu-right flex-around">
@ -44,7 +44,7 @@
<view v-if="handwrittenList && handwrittenList.length > 0">
<view class="title-box flex-between">
<image src="https://cgc.js-dyyj.com/uploads/20250618/0cc227827073c9ab16dd2ce9b9e3b579.png" mode="heightFix"></image>
<image src="https://cgc.js-dyyj.com/uploads/20250619/d0cfd5cd7253d8ce6a747842a40be020.png" mode="heightFix"></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">
@ -56,7 +56,7 @@
<!-- 非遗时光 -->
<view v-if="shiguang && shiguang.image">
<view class="title-box flex-between">
<image src="https://cgc.js-dyyj.com/uploads/20250618/496fdd2ccccc9f8a00ec698549532185.png" mode="heightFix"></image>
<image src="https://cgc.js-dyyj.com/uploads/20250619/b10ed22a2e5b2187d88352869575fb16.png" mode="heightFix"></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="{backgroundImage: 'url('+showImg(shiguang.image)+')'}" @click="gotoVideo(shiguang)">
@ -176,9 +176,9 @@
},
onReady() {
//
if(!uni.getStorageSync('location')) {
this.getLocation()
}
// if(!uni.getStorageSync('location')) {
// this.getLocation()
// }
this.initRectInfo()
this.getList()

45
pages/login/login.vue

@ -1,6 +1,13 @@
<template>
<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>
<view :style="{'height':height+'px','flex-shrink':0}"></view>
<div style="padding-top: 88rpx;">
<div class="login-tip">大美非遗 申请获得</div>
<div class="login-tip">CGC-ICH 申请获得</div>
<div class="login-tip2">以下权限</div>
<div class="login-tip-box">
<text>获得你的公开信息昵称头像地区及性别</text>
@ -19,6 +26,8 @@
<button type="default" open-type="getPhoneNumber" @getphonenumber="handlePhoneNumber" style="width: 100%;height: 12vh;line-height: 12vh;">点击授权手机号</button>
</uni-popup>
</div>
</view>
</template>
<script>
@ -26,10 +35,14 @@ export default {
name: "login",
data() {
return {
//
height: 0,
statusBarHeight: 0,
isAgreed: false,
};
},
onLoad(options) {
this.initRectInfo()
//
if (options.needAuth === '1') {
setTimeout(() => {
@ -38,6 +51,12 @@ export default {
}
},
methods: {
initRectInfo () {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
//
this.height = sysInfo.statusBarHeight + 40
},
//
handlePhoneNumber(e) {
if (e.detail.errMsg === "getPhoneNumber:ok") { //
@ -154,7 +173,29 @@ export default {
};
</script>
<style>
<style scoped lang="scss">
.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 {
min-height: 100vh;
}
.login-tip {
font-size: 28rpx;
margin: 0 60rpx;

16
static/js/CommonFunction.js

@ -87,15 +87,17 @@ Vue.prototype.IsCode = code => {
// 图片显示判断
Vue.prototype.showImg = img => {
if (!img) return;
let timeStamp = new Date().getTime()
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) {
return img;
return img+"?timestamp="+timeStamp;
} else {
return Vue.prototype.NEWAPIURL + img;
return Vue.prototype.NEWAPIURL + img +"?timestamp="+timeStamp;
}
}
// 获取经纬度
Vue.prototype.getLocation = function(callback) {
return
// 检查权限状态
uni.getSetting({
success: (res) => {
@ -269,13 +271,9 @@ Vue.prototype.getSubscribeMessage = () => {
}
// 金刚区头图
Vue.prototype.getHeadImg = type => {
return Vue.prototype.Post({
type,
},
'/api/public_service/getKumgangHeadImgList'
).then(res => {
return res.data[0].image
Vue.prototype.getHeadImg = id => {
return Vue.prototype.Post({id: id},'/api/article/getArticleById').then(res => {
return res.data.image
});
}
// 判断是否去外部链接

4
subPackages/letter/index.vue

@ -34,12 +34,12 @@
return {
list: [],
finished: false,
headImg: 'https://cgc.js-dyyj.com/uploads/20250513/b9f5f5b2b90d8df29247c6aa4f452eaa.png'
headImg: ''
}
},
onReady() {
// this.getHeadImg('shuhui').then(res => {this.headImg = res})
this.getArticleByType()
this.getHeadImg(10212).then(res => {this.headImg = res})
},
methods: {
//

6
subPackages/shiguang/index.vue

@ -1,6 +1,6 @@
<template>
<view class="bg">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/shiguang.png" mode="aspectFill" class="topImg"></image>
<image :src="showImg(headImg)" mode="aspectFill" class="topImg"></image>
<view class="box">
<view v-for="(item,index) in list" :key="index" class="item" @click="gotoVideo(item)">
@ -23,10 +23,12 @@
export default {
data() {
return {
list: []
list: [],
headImg: '',
}
},
onReady() {
this.getHeadImg(10213).then(res => {this.headImg = res})
this.Post({
type_id: 2,
offset: 0,

4
subPackages/techan/index.vue

@ -184,7 +184,7 @@
//
height: 0,
statusBarHeight: 0,
headImg: "https://cgc.js-dyyj.com/uploads/20250513/f8b255f965efcd71b6843e4b72c3f1f3.png",
headImg: "",
typeParam: [
{id: 45, title: '味 | WEI'},
@ -213,7 +213,7 @@
}
},
onLoad(options) {
// this.getHeadImg("techan").then(res => {this.headImg = res})
this.getHeadImg(10211).then(res => {this.headImg = res})
if (options.idIndex) {
try {
this.typeIndex = Number(options.idIndex)

Loading…
Cancel
Save