Files
yusheng-h5/pages/other/test.vue

79 lines
1.8 KiB
Vue
Raw Normal View History

2025-10-23 16:04:28 +08:00
<template>
<view class="view-page" :style="{backgroundImage: `url('${ThemeData?.app_bg || baseBgUrl}')`}">
<navBar :style="{marginTop: `${statusBarHeight}${uni.getSystemInfoSync().platform === 'ios' ? 'px': 'dp'}`}"
:navTitle="'测试页面'">
</navBar>
<view class="content">
{{content}}
</view>
</view>
</template>
<script>
import navBar from '@/component/nav.vue';
import http from '@/until/http.js';
import baseBgUrl from '@/static/image/general/fy_bg.jpg';
export default {
components: {
navBar
},
data() {
return {
content: '测试一下',
statusBarHeight: 0,
ThemeData: {},
baseBgUrl
}
},
onLoad(options) {
const {
id
} = options
uni.setStorageSync('token', id)
http.get('/api/Guild/guild_list', {
page: 1,
limit: 10,
search_id: '',
token: uni.getStorageSync('token') || ''
}).then(response => {
this.content = `token:${id}+++++++++++++${JSON.stringify(response)}`
}).catch(error => {
this.content = `token:${id}+++++++++++++${JSON.stringify(response)}`
});
// uni.request({
// url: 'https://md.xscmmidi.site/api/Guild/guild_list',
// data:{
// page: 1,
// limit: 5,
// search_id: '',
// token: id || ''
// },
// method: 'GET',
// success: (res) => {
// this.content = `token:${id}+++++++++++++${JSON.stringify(res)}`
// },
// fail: (err) => {
// this.content = `token:${id}+++++++++++++${JSON.stringify(res)}`
// }
// });
// const {
// id
// } = options
// uni.setStorageSync('token', id)
// this.content = id
// if (uni.getStorageSync('token')) {
// this.getList()
// }
},
methods: {}
}
</script>
<style scoped>
.view-page {
min-height: 100vh;
font-family: Source Han Sans CN, Source Han Sans CN;
background-repeat: no-repeat;
background-size: 100% 100%;
}
</style>