更新:1. 优化注册页面逻辑 2. 更新API请求配置

This commit is contained in:
davy 2025-04-01 18:36:23 +08:00
parent 9c4f90af02
commit 30c802cd05
4 changed files with 930 additions and 572 deletions

View File

@ -1,6 +1,6 @@
<template>
<view>
<uni-popup ref="popup" type="bottom">
<uni-popup ref="popup" type="bottom" @change="handlePopupChange">
<view class="popup-content">
<view class="popup-header">
@ -49,19 +49,42 @@ export default {
},
created() {
this.provinces = areaData;
this.cities = this.provinces[0].children;
this.areas = this.cities[0].children;
this.initDefaultValue();
},
methods: {
initDefaultValue() {
const defaultProvince = this.provinces[0];
if (defaultProvince) {
const defaultCities = defaultProvince.children || [];
this.cities = defaultCities;
const defaultCity = defaultCities[0];
if (defaultCity) {
const defaultAreas = defaultCity.children || [];
this.areas = defaultAreas;
this.selectedProvince = defaultProvince;
this.selectedCity = defaultCity;
this.selectedArea = defaultAreas[0] || null;
}
}
},
bindChange(e) {
const val = e.detail.value;
this.pickerValue = val;
this.cities = this.provinces[val[0]].children;
this.areas = this.cities[val[1]].children;
const [provinceIndex, cityIndex, areaIndex] = val;
this.selectedProvince = this.provinces[val[0]];
this.selectedCity = this.cities[val[1]];
this.selectedArea = this.areas[val[2]];
const selectedProvince = this.provinces[provinceIndex];
const cities = selectedProvince?.children || [];
this.cities = cities;
const selectedCity = cities[cityIndex];
const areas = selectedCity?.children || [];
this.areas = areas;
this.pickerValue = val;
this.selectedProvince = selectedProvince;
this.selectedCity = selectedCity;
this.selectedArea = areas[areaIndex];
},
cancelSelection() {
this.$emit('update:show', false);
@ -69,6 +92,12 @@ export default {
confirmSelection() {
this.$emit('selected', this.selectedProvince, this.selectedCity, this.selectedArea);
this.$emit('update:show', false);
},
handlePopupChange(e) {
if (!e.show) {
this.$emit('update:show', false);
this.$emit('close');
}
}
},
watch: {
@ -86,36 +115,45 @@ export default {
</script>
<style scoped>
/* 样式可以根据需要调整 */
.popup-content {
background-color: #fff;
border-top-left-radius: 16px;
border-top-right-radius: 16px;
padding: 20px;
border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx;
padding: 32rpx;
box-sizing: border-box;
}
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
margin-bottom: 32rpx;
padding: 0 20rpx;
}
.cancel-button, .confirm-button {
padding: 10px 20px;
border: none;
border-radius: 5px;
color: #fff;
background-color: #007aff;
.popup-header view {
font-size: 32rpx;
padding: 10rpx 20rpx;
}
.cancel-button {
background-color: #ccc;
.popup-header view:first-child {
color: #999;
}
.popup-header view:last-child {
color: #D42E78;
font-weight: 500;
}
picker-view {
height: 300px;
height: 420rpx;
width: 100%;
}
picker-view-column view {
line-height: 84rpx;
text-align: center;
font-size: 32rpx;
color: #333;
}
</style>

View File

@ -51,7 +51,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxafc7be9f3ada44a0",
"appid" : "wx5de24df912a4834c",
"setting" : {
"urlCheck" : false,
"minified" : true

View File

@ -22,7 +22,7 @@
{
"navigationBarTitleText" : "认证登录",
"navigationBarBackgroundColor": "#19367A",
"navigationBarTextStyle": "#FFFFFF"
"navigationBarTextStyle": "white"
}
},
{
@ -381,7 +381,7 @@
{
"pagePath": "pages/index/myJoin",
"text": "我参与的",
"iconPath": "/static/tabbar/tick.png",
"iconPath": "static/tabbar/tick.png",
"selectedIconPath": "static/tabbar/tick-s.png"
},
{

File diff suppressed because it is too large Load Diff