更改项目

This commit is contained in:
yziiy
2025-08-13 10:51:01 +08:00
parent 7e21160e13
commit e33b97fc90
23 changed files with 3685 additions and 1046 deletions

View File

@@ -127,7 +127,6 @@
id
} = options
uni.setStorageSync('token', id)
// this.statusBarHeight = h
this.errorPage = id ? false : true
},
onReachBottom() {

View File

@@ -1,5 +1,5 @@
<template>
<view class="view-page">
<view class="view-page" :style="{backgroundImage : `url('${ThemeData?.app_bg ?? 'https://vespa.qxmier.com/image/bg.png'}')`}">
<!-- <headerHeight /> -->
<navBar :style="{marginTop: `${statusBarHeight}${uni.getSystemInfoSync().platform === 'ios' ? 'px': 'dp'}`}" :navTitle="'帮助与反馈'" :emitBack="true" @backEvent="back">
</navBar>
@@ -100,6 +100,7 @@
limit: 10,
typeData: null,
typeId: null,
ThemeData:null
}
},
onLoad(options) {
@@ -110,6 +111,9 @@
if (uni.getStorageSync('token')) this.getHelpList()
this.statusBarHeight = h
uni.setStorageSync('BarHeight', h)
if(uni.getStorageSync('Theme_Data')) {
this.ThemeData = JSON.parse(uni.getStorageSync('Theme_Data'))
}
},
methods: {
async getHelpList() {
@@ -220,7 +224,6 @@
// padding: 32rpx;
width: 100vw;
height: 100vh;
background-image: url('@/static/image/help/bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;

View File

@@ -54,15 +54,6 @@
} = options
if (id) this.getDetail(id)
},
// onShow() {
// if(uni.getStorageSync('statusBarHeight')) {
// this.statusBarHeight = uni.getStorageSync('statusBarHeight')
// } else {
// const systemInfo = uni.getSystemInfoSync(); // 获取系统信息
// this.statusBarHeight = systemInfo.statusBarHeight
// uni.setStorageSync('statusBarHeight', this.statusBarHeight)
// }
// },
methods: {
getDetail(id) {
http.get('/api/Help/help_detail', {

View File

@@ -1,5 +1,5 @@
<template>
<view class="view-page">
<view class="view-page" :style="backgroundStyle">
<headerHeight />
<navBar :navTitle="'青少年模式'" :emitBack="true" @backEvent="back">
</navBar>
@@ -9,13 +9,13 @@
</NavigationTabs>
</view>
<view class="">
<view class="flex-line flex-spaceB w-fill new-box" v-for="(item,index) in dataList" :key="index">
<view class="flex-line flex-spaceB w-fill new-box" v-for="(item, index) in dataList" :key="index">
<view class="">
<view class="color-3 font-32 font-w500">
{{item.title}}
{{ item.title }}
</view>
<view class="color-6 mt-24 font-28 font-w400 multi-line">
{{item.introduced}}
{{ item.introduced }}
</view>
</view>
<view class="new-box-image">
@@ -30,148 +30,165 @@
</template>
<script>
import http from '@/until/http.js';
import headerHeight from '@/component/headerHeight.vue';
import navBar from '@/component/nav.vue';
import NavigationTabs from '@/component/tab.vue';
export default {
components: {
headerHeight,
navBar,
NavigationTabs
},
data() {
return {
errorPage: true,
currentIndex: 0,
pageConfig: {
pageSize: 10,
currentPage: 1,
total: 0
},
loading: false,
noMore: false,
tabs: [],
dataList: []
}
},
onReachBottom() {
if (!this.loading && !this.noMore) {
this.getUnderageModeList(this.tabs[0].type)
}
},
onLoad(options) {
this.errorPage = true
this.dataList = []
const {
id
} = options
uni.setStorageSync('token', id)
if (uni.getStorageSync('token')) this.getUnderageTypeList()
},
methods: {
back() {
this.closeWeb()
import http from '@/until/http.js';
import headerHeight from '@/component/headerHeight.vue';
import navBar from '@/component/nav.vue';
import NavigationTabs from '@/component/tab.vue';
export default {
components: {
headerHeight,
navBar,
NavigationTabs
},
data() {
return {
errorPage: true,
currentIndex: 0,
pageConfig: {
pageSize: 10,
currentPage: 1,
total: 0
},
closeWeb() {
const platform = uni.getSystemInfoSync().platform;
if (platform === 'ios') {
window.webkit.messageHandlers.nativeHandler.postMessage({
'action': 'closeWeb'
});
} else if (platform === 'android') {
window.Android.closeWeb();
loading: false,
noMore: false,
tabs: [],
dataList: [],
ThemeData: null
}
},
computed: {
backgroundStyle() {
if (this.ThemeData.app_bg) {
return {
backgroundImage: `url(${this.ThemeData.app_bg})`
}
} else {
return {
background: 'linear-gradient(180deg, #B3FAEB 2%, #FFFFFF 40%)'
}
},
async getUnderageTypeList() {
http.get('/api/Usermode/getUnderageTypeList', {
token: uni.getStorageSync('token') ?? ''
}).then(response => {
const {
data,
code
} = response
if (code) {
this.tabs = data.map(ele => {
return {
type: ele.id,
value: ele.type_name
}
})
}
this.errorPage = false
this.$nextTick(() => {
this.getUnderageModeList(this.tabs[0].type)
})
}).catch(error => {
this.tabs = []
this.errorPage = true
});
},
async getUnderageModeList(type) {
http.get('/api/Usermode/getUnderageModeList', {
token: uni.getStorageSync('token') ?? '',
type: type,
page: this.pageConfig.currentPage,
page_limit: this.pageConfig.pageSize
}).then(response => {
const {
code,
data
} = response
if (code) {
this.pageConfig.total = data.total
this.loading = false
const newData = data.data || []
if (newData.length === 0) {
this.noMore = true
return
}
this.dataList = [...this.dataList, ...newData]
this.pageConfig.currentPage++
if (this.dataList.length === this.pageConfig.total) {
this.noMore = true
return
}
}
})
},
handleTabChange(data) {
this.dataList = []
this.noMore = false
this.loading = false
this.pageConfig.currentPage = 1
this.pageConfig.pageSize = 10
this.getUnderageModeList(data.tab.type)
}
}
},
onReachBottom() {
if (!this.loading && !this.noMore) {
this.getUnderageModeList(this.tabs[0].type)
}
},
onLoad(options) {
this.errorPage = true
this.dataList = []
const {
id
} = options
uni.setStorageSync('token', id)
if (uni.getStorageSync('token')) this.getUnderageTypeList()
if (uni.getStorageSync('Theme_Data')) {
this.ThemeData = JSON.parse(uni.getStorageSync('Theme_Data'))
}
},
methods: {
back() {
this.closeWeb()
},
closeWeb() {
const platform = uni.getSystemInfoSync().platform;
if (platform === 'ios') {
window.webkit.messageHandlers.nativeHandler.postMessage({
'action': 'closeWeb'
});
} else if (platform === 'android') {
window.Android.closeWeb();
}
},
async getUnderageTypeList() {
http.get('/api/Usermode/getUnderageTypeList', {
token: uni.getStorageSync('token') ?? ''
}).then(response => {
const {
data,
code
} = response
if (code) {
this.tabs = data.map(ele => {
return {
type: ele.id,
value: ele.type_name
}
})
}
this.errorPage = false
this.$nextTick(() => {
this.getUnderageModeList(this.tabs[0].type)
})
}).catch(error => {
this.tabs = []
this.errorPage = true
});
},
async getUnderageModeList(type) {
http.get('/api/Usermode/getUnderageModeList', {
token: uni.getStorageSync('token') ?? '',
type: type,
page: this.pageConfig.currentPage,
page_limit: this.pageConfig.pageSize
}).then(response => {
const {
code,
data
} = response
if (code) {
this.pageConfig.total = data.total
this.loading = false
const newData = data.data || []
if (newData.length === 0) {
this.noMore = true
return
}
this.dataList = [...this.dataList, ...newData]
this.pageConfig.currentPage++
if (this.dataList.length === this.pageConfig.total) {
this.noMore = true
return
}
}
})
},
handleTabChange(data) {
this.dataList = []
this.noMore = false
this.loading = false
this.pageConfig.currentPage = 1
this.pageConfig.pageSize = 10
this.getUnderageModeList(data.tab.type)
}
}
}
</script>
<style lang="scss" scoped>
.view-page {
// padding: 32rpx;
background: linear-gradient(180deg, #B3FAEB 2%, #FFFFFF 40%);
background-size: 100% 100%;
min-height: 100vh;
.view-page {
// padding: 32rpx;
background: linear-gradient(180deg, #B3FAEB 2%, #FFFFFF 40%);
background-size: 100% 100%;
min-height: 100vh;
.content-view {
padding: 0 32rpx;
}
.content-view {
padding: 0 32rpx;
}
.new-box {
margin-top: 32rpx;
.new-box {
margin-top: 32rpx;
.new-box-image {
width: 240rpx;
height: 144rpx;
.new-box-image {
width: 240rpx;
height: 144rpx;
border-radius: 12rpx;
img {
border-radius: 12rpx;
img {
border-radius: 12rpx;
}
}
}
}
}
</style>