弹窗
This commit is contained in:
@@ -251,6 +251,14 @@
|
||||
WF : "瓦利斯",
|
||||
}
|
||||
|
||||
const countryNamesArray = Object.values(NationalDictionary);
|
||||
function convertNationalDictToOptions(dict) {
|
||||
return Object.entries(dict).map(([code, name]) => ({
|
||||
label: name,
|
||||
value: name // 将 value 改为国家名称
|
||||
}));
|
||||
}
|
||||
|
||||
// 使用示例
|
||||
const optionsArray = convertNationalDictToOptions(NationalDictionary);
|
||||
|
||||
export default countryNamesArray;
|
||||
export default optionsArray;
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<scroll-view scroll-y="true" class="scroll">
|
||||
<scroll-view scroll-y="true" class="scroll" lower-threshold="100" @scrolltolower="onScrollToLower" >
|
||||
<uni-card class="content-list" v-for="(item, index) in list">
|
||||
<!-- `````````````````````````` -->
|
||||
<image class="headShot" src="../../static/logo.png" mode="scaleToFill" />
|
||||
@@ -23,11 +23,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "../../components/request.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: "Hello",
|
||||
Gender: true,
|
||||
page: 0,
|
||||
// 列表数据
|
||||
list: [
|
||||
{
|
||||
@@ -36,112 +38,45 @@ export default {
|
||||
gender: "男",
|
||||
score: 8.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界2",
|
||||
id: "9089",
|
||||
gender: "女",
|
||||
score: 7.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
{
|
||||
title: "极乐世界3",
|
||||
id: "9090",
|
||||
gender: "男",
|
||||
score: 9.8,
|
||||
},
|
||||
],
|
||||
// 列表数据结束
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// 页面加载时执行
|
||||
mounted() {
|
||||
// 页面加载完成后请求数据
|
||||
this.pkList()
|
||||
},
|
||||
methods: {
|
||||
// 方法定义
|
||||
async pkList(){
|
||||
const res = await request({
|
||||
url: "pk/pkList",
|
||||
method: "GET",
|
||||
data: {
|
||||
status: 0,
|
||||
page: this.page,
|
||||
Size: 10,
|
||||
},
|
||||
userInfo: false,
|
||||
});
|
||||
console.log(res);
|
||||
if (res.code === 200) {
|
||||
this.list.concat(res.data)
|
||||
console.log(this.list)
|
||||
}
|
||||
},
|
||||
onScrollToLower() {
|
||||
this.page++;
|
||||
this.pkList();
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scroll {
|
||||
height: 100%;
|
||||
height: 90%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
@@ -4,34 +4,38 @@ export default function request(urldata) {
|
||||
"http://192.168.0.218:8086/"
|
||||
+ url;
|
||||
if (userInfo) {
|
||||
uni.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
if (res.data) {
|
||||
if (res.data.nickName) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
if (res.data) {
|
||||
if (res.data.nickName) {
|
||||
uni.request({
|
||||
url: baseUrl,
|
||||
data: data,
|
||||
method: method,
|
||||
header: header,
|
||||
success: function (res) {
|
||||
console.log("请求成功1", res.data);
|
||||
resolve(res.data);
|
||||
},
|
||||
fail: function (res) {
|
||||
reject(res);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$global.lastPage = uni.page.route;
|
||||
uni.reLaunch({ url: "/pages/UserInformation/UserInformation" })
|
||||
}
|
||||
} else {
|
||||
this.$global.lastPage = uni.page.route;
|
||||
uni.reLaunch({ url: "/pages/UserInformation/UserInformation" })
|
||||
uni.navigateTo({ url: '/pages/login/login' })
|
||||
}
|
||||
} else {
|
||||
this.$global.lastPage = uni.page.route;
|
||||
uni.navigateTo({ url: '/pages/login/login' })
|
||||
},
|
||||
fail: function (res) {
|
||||
reject(res);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -41,6 +45,7 @@ export default function request(urldata) {
|
||||
method: method,
|
||||
header: header,
|
||||
success: function (res) {
|
||||
console.log("请求成功2", res);
|
||||
resolve(res.data);
|
||||
},
|
||||
fail: function (res) {
|
||||
|
||||
Reference in New Issue
Block a user