jiazhipeng 4 months ago
parent
commit
83852248d0
  1. 6
      mixins/myMixins.js
  2. 7
      pages.json
  3. 20
      pages/index/index.vue
  4. 83
      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 { return {
title: 'CGC-ICH', title: 'CGC-ICH',
type: 0, type: 0,
summary: "edewdewdewf", summary: "",
imageUrl: "https://static.ticket.sz-trip.com/uploads/20250612/e022a1b7c8df621cb15082d0b0f5bba3.jpg" imageUrl: "https://cgc.js-dyyj.com/uploads/20250619/172a730c88bd8894dee1e64c703795eb.jpg"
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@ -35,7 +35,7 @@ export const myMixins ={
return { return {
title: 'CGC-ICH', // 分享的名称 title: 'CGC-ICH', // 分享的名称
path: `${view.route}?url=${url}`, // 将 url 作为参数传递 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 mpId: 'wx9d68934300b1fe90' // 此处配置微信小程序的 AppId
}; };
} }

7
pages.json

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

20
pages/index/index.vue

@ -1,10 +1,10 @@
<template> <template>
<view class="content" style="overflow-x: auto;"> <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="title">CGC-ICH</view>
<view class="subtitle">大运河非遗</view> <view class="subtitle">大运河非物质文化</view>
</view> </view>
<div :style="{'height':height+'px','flex-shrink':0}"></div> --> <div :style="{'height':height+'px','flex-shrink':0}"></div>
<!-- 头部banner --> <!-- 头部banner -->
<view class="top-box"> <view class="top-box">
<!-- 搜索 --> <!-- 搜索 -->
@ -26,8 +26,8 @@
<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/indexs/${index + 1}.png`" class="topImg" 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="`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}s.png`)" class="titleImg" mode="heightFix"></image>
</view> </view>
</view> </view>
<!-- <view class="menu-right flex-around"> <!-- <view class="menu-right flex-around">
@ -44,7 +44,7 @@
<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://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> <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">
@ -56,7 +56,7 @@
<!-- 非遗时光 --> <!-- 非遗时光 -->
<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://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> <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)">
@ -176,9 +176,9 @@
}, },
onReady() { onReady() {
// //
if(!uni.getStorageSync('location')) { // if(!uni.getStorageSync('location')) {
this.getLocation() // this.getLocation()
} // }
this.initRectInfo() this.initRectInfo()
this.getList() this.getList()

83
pages/login/login.vue

@ -1,24 +1,33 @@
<template> <template>
<div style="padding-top: 88rpx;"> <view class="content" style="overflow-x: auto;">
<div class="login-tip">大美非遗 申请获得</div> <view class="search-header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}">
<div class="login-tip2">以下权限</div> <view class="title">CGC-ICH</view>
<div class="login-tip-box"> <view class="subtitle">大运河非物质文化遗产</view>
<text>获得你的公开信息昵称头像地区及性别</text> </view>
</div> <view :style="{'height':height+'px','flex-shrink':0}"></view>
<div class="btn-box">
<button bindtap="cancel" type="default" @click="redirectIndex">取消</button> <div style="padding-top: 88rpx;">
<button type="primary" @click="getUserInfo">同意</button> <div class="login-tip">CGC-ICH 申请获得</div>
</div> <div class="login-tip2">以下权限</div>
<div class="flex-center article-box"> <div class="login-tip-box">
<radio-group @change="toggleAgreement"> <text>获得你的公开信息昵称头像地区及性别</text>
<radio value="1" :checked="isAgreed" style="transform:scale(0.7)"></radio> </div>
</radio-group> <div class="btn-box">
<div>同意<text @click="gotoInfo">用户服务协议隐私政策</text></div> <button bindtap="cancel" type="default" @click="redirectIndex">取消</button>
</div> <button type="primary" @click="getUserInfo">同意</button>
<uni-popup ref="popup" type="bottom" background-color="#fff"> </div>
<button type="default" open-type="getPhoneNumber" @getphonenumber="handlePhoneNumber" style="width: 100%;height: 12vh;line-height: 12vh;">点击授权手机号</button> <div class="flex-center article-box">
</uni-popup> <radio-group @change="toggleAgreement">
</div> <radio value="1" :checked="isAgreed" style="transform:scale(0.7)"></radio>
</radio-group>
<div>同意<text @click="gotoInfo">用户服务协议隐私政策</text></div>
</div>
<uni-popup ref="popup" type="bottom" background-color="#fff">
<button type="default" open-type="getPhoneNumber" @getphonenumber="handlePhoneNumber" style="width: 100%;height: 12vh;line-height: 12vh;">点击授权手机号</button>
</uni-popup>
</div>
</view>
</template> </template>
<script> <script>
@ -26,10 +35,14 @@ export default {
name: "login", name: "login",
data() { data() {
return { return {
//
height: 0,
statusBarHeight: 0,
isAgreed: false, isAgreed: false,
}; };
}, },
onLoad(options) { onLoad(options) {
this.initRectInfo()
// //
if (options.needAuth === '1') { if (options.needAuth === '1') {
setTimeout(() => { setTimeout(() => {
@ -38,6 +51,12 @@ export default {
} }
}, },
methods: { methods: {
initRectInfo () {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
//
this.height = sysInfo.statusBarHeight + 40
},
// //
handlePhoneNumber(e) { handlePhoneNumber(e) {
if (e.detail.errMsg === "getPhoneNumber:ok") { // if (e.detail.errMsg === "getPhoneNumber:ok") { //
@ -154,7 +173,29 @@ export default {
}; };
</script> </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 { .login-tip {
font-size: 28rpx; font-size: 28rpx;
margin: 0 60rpx; margin: 0 60rpx;

16
static/js/CommonFunction.js

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

4
subPackages/letter/index.vue

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

6
subPackages/shiguang/index.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="bg"> <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 class="box">
<view v-for="(item,index) in list" :key="index" class="item" @click="gotoVideo(item)"> <view v-for="(item,index) in list" :key="index" class="item" @click="gotoVideo(item)">
@ -23,10 +23,12 @@
export default { export default {
data() { data() {
return { return {
list: [] list: [],
headImg: '',
} }
}, },
onReady() { onReady() {
this.getHeadImg(10213).then(res => {this.headImg = res})
this.Post({ this.Post({
type_id: 2, type_id: 2,
offset: 0, offset: 0,

4
subPackages/techan/index.vue

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

Loading…
Cancel
Save