更新:1. 优化注册页面逻辑 2. 更新API请求配置
This commit is contained in:
parent
9c4f90af02
commit
30c802cd05
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<uni-popup ref="popup" type="bottom">
|
<uni-popup ref="popup" type="bottom" @change="handlePopupChange">
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<view class="popup-header">
|
<view class="popup-header">
|
||||||
|
|
||||||
@ -49,19 +49,42 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.provinces = areaData;
|
this.provinces = areaData;
|
||||||
this.cities = this.provinces[0].children;
|
this.initDefaultValue();
|
||||||
this.areas = this.cities[0].children;
|
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
bindChange(e) {
|
||||||
const val = e.detail.value;
|
const val = e.detail.value;
|
||||||
|
const [provinceIndex, cityIndex, areaIndex] = val;
|
||||||
|
|
||||||
|
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.pickerValue = val;
|
||||||
this.cities = this.provinces[val[0]].children;
|
this.selectedProvince = selectedProvince;
|
||||||
this.areas = this.cities[val[1]].children;
|
this.selectedCity = selectedCity;
|
||||||
|
this.selectedArea = areas[areaIndex];
|
||||||
this.selectedProvince = this.provinces[val[0]];
|
|
||||||
this.selectedCity = this.cities[val[1]];
|
|
||||||
this.selectedArea = this.areas[val[2]];
|
|
||||||
},
|
},
|
||||||
cancelSelection() {
|
cancelSelection() {
|
||||||
this.$emit('update:show', false);
|
this.$emit('update:show', false);
|
||||||
@ -69,6 +92,12 @@ export default {
|
|||||||
confirmSelection() {
|
confirmSelection() {
|
||||||
this.$emit('selected', this.selectedProvince, this.selectedCity, this.selectedArea);
|
this.$emit('selected', this.selectedProvince, this.selectedCity, this.selectedArea);
|
||||||
this.$emit('update:show', false);
|
this.$emit('update:show', false);
|
||||||
|
},
|
||||||
|
handlePopupChange(e) {
|
||||||
|
if (!e.show) {
|
||||||
|
this.$emit('update:show', false);
|
||||||
|
this.$emit('close');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -86,36 +115,45 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 样式可以根据需要调整 */
|
|
||||||
.popup-content {
|
.popup-content {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-top-left-radius: 16px;
|
border-top-left-radius: 24rpx;
|
||||||
border-top-right-radius: 16px;
|
border-top-right-radius: 24rpx;
|
||||||
padding: 20px;
|
padding: 32rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-header {
|
.popup-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 32rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancel-button, .confirm-button {
|
.popup-header view {
|
||||||
padding: 10px 20px;
|
font-size: 32rpx;
|
||||||
border: none;
|
padding: 10rpx 20rpx;
|
||||||
border-radius: 5px;
|
|
||||||
color: #fff;
|
|
||||||
background-color: #007aff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancel-button {
|
.popup-header view:first-child {
|
||||||
background-color: #ccc;
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup-header view:last-child {
|
||||||
|
color: #D42E78;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
picker-view {
|
picker-view {
|
||||||
height: 300px;
|
height: 420rpx;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
picker-view-column view {
|
||||||
|
line-height: 84rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"sassImplementationName": "node-sass",
|
"sassImplementationName" : "node-sass",
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"usingComponents" : true,
|
"usingComponents" : true,
|
||||||
@ -51,7 +51,7 @@
|
|||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wxafc7be9f3ada44a0",
|
"appid" : "wx5de24df912a4834c",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false,
|
"urlCheck" : false,
|
||||||
"minified" : true
|
"minified" : true
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
{
|
{
|
||||||
"navigationBarTitleText" : "认证登录",
|
"navigationBarTitleText" : "认证登录",
|
||||||
"navigationBarBackgroundColor": "#19367A",
|
"navigationBarBackgroundColor": "#19367A",
|
||||||
"navigationBarTextStyle": "#FFFFFF"
|
"navigationBarTextStyle": "white"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -381,7 +381,7 @@
|
|||||||
{
|
{
|
||||||
"pagePath": "pages/index/myJoin",
|
"pagePath": "pages/index/myJoin",
|
||||||
"text": "我参与的",
|
"text": "我参与的",
|
||||||
"iconPath": "/static/tabbar/tick.png",
|
"iconPath": "static/tabbar/tick.png",
|
||||||
"selectedIconPath": "static/tabbar/tick-s.png"
|
"selectedIconPath": "static/tabbar/tick-s.png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user