diff --git a/pages.json b/pages.json
index 75808b1..d27983e 100644
--- a/pages.json
+++ b/pages.json
@@ -250,6 +250,13 @@
}
}
}
+ },
+ {
+ "path" : "pages/webview/webview",
+ "style" :
+ {
+ "navigationBarTitleText" : ""
+ }
}
],
"globalStyle": {
diff --git a/pages/public/components/checkArea.vue b/pages/public/components/checkArea.vue
new file mode 100644
index 0000000..8e4d999
--- /dev/null
+++ b/pages/public/components/checkArea.vue
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+ {{'选择国家地/地区'}}
+
+
+
+ {{item.countryName}}
+ {{item.countryCode}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/public/login.vue b/pages/public/login.vue
index ea690d1..f04392c 100644
--- a/pages/public/login.vue
+++ b/pages/public/login.vue
@@ -12,8 +12,8 @@
{{tips.text}}
-
- {{area}}
+
+ {{checkData.checkedCode}}
@@ -23,7 +23,9 @@
@click="getCode">获取短信验证码
@@ -33,6 +35,7 @@
+
@@ -45,9 +48,11 @@
sendsms,
appLogin,
wxIdLogin,
- memberInfo
+ memberInfo,
+ supportedCountryCode,
} from '@/api/member.js';
import CheckCode from './components/checkCode.vue'
+ import CheckArea from './components/checkArea.vue'
import rule from '@/utils/rule.js'
export default {
data() {
@@ -75,11 +80,18 @@
deviceId: '',
mobileCheckCode: '',
deviceBrand: ''
+ },
+ // 是否显示区号选择页面
+ isShowAreaCheck: false,
+ checkData: {
+ areaList: [],
+ checkedCode: '+86'
}
}
},
components: {
- CheckCode
+ CheckCode,
+ CheckArea
},
computed: {
...mapState(['theme', 'deviceId', 'deviceBrand']),
@@ -87,7 +99,9 @@
return this.mobile.length === 11 && !this.isLogining
}
},
- onLoad() {},
+ onLoad() {
+ this.getCountryCode()
+ },
methods: {
...mapMutations(['login']),
navBack() {
@@ -105,9 +119,13 @@
this.regetCode()
},
closeModal(type) {
+ console.log('close', type)
if (type === 'code') {
this.isShowCode = false
}
+ if (type === 'area') {
+ this.isShowAreaCheck = false
+ }
},
async doLogin(data) {
uni.showLoading({
@@ -116,9 +134,9 @@
})
appLogin(data)
.then(res => {
- if(res.code === 200 && res.data) {
- uni.setStorageSync('token',res.data);
- memberInfo().then(response=>{
+ if (res.code === 200 && res.data) {
+ uni.setStorageSync('token', res.data);
+ memberInfo().then(response => {
this.login(response.data);
uni.navigateBack();
});
@@ -139,6 +157,8 @@
},
regetCode() {
this.isLogining = true
+ this.isShowCode = true
+ return
sendsms({
mobile: this.mobile,
deviceId: this.deviceId
@@ -166,7 +186,43 @@
.finally(() => {
this.isLogining = false
})
-
+ },
+ toRead(index) {
+ const item = [{
+ url: 'https://m.indie.cn/agreement/registrationAgreement.html',
+ webviewStyles: {
+ progress: true
+ }
+ },
+ {
+ url: 'https://m.indie.cn/agreement/privacyPolicy.html',
+ webviewStyles: {
+ progress: true
+ }
+ }
+ ]
+ uni.navigateTo({
+ url: '/pages/webview/webview?item=' + encodeURIComponent(JSON.stringify(item[index]))
+ })
+ },
+ getCountryCode() {
+ supportedCountryCode()
+ .then(res => {
+ console.log(res)
+ if(res.code === 200 && res.data) {
+ this.checkData = {
+ areaList: res.data,
+ checkedCode: '+86'
+ }
+ }
+ })
+ .catch(err => {
+ console.log(err)
+ })
+ },
+ checkedCode(item) {
+ this.checkData.checkedCode = item.countryCode
+ this.isShowAreaCheck = false
}
},
@@ -201,10 +257,10 @@
font-size: 40upx;
color: $font-color-dark;
z-index: 9;
-
+
image {
- width: 40rpx;
- height: 40rpx;
+ width: 40upx;
+ height: 40upx;
}
}
@@ -215,7 +271,7 @@
.tips {
width: 100%;
height: 136upx;
- padding: 0 48rpx;
+ padding: 0 48upx;
.tips_title {
font-size: 64upx;
@@ -288,6 +344,16 @@
.radio {
font-size: 24upx;
+ vertical-align: middle;
+
+ .textBtn {
+ display: inline-block;
+ height: 24upx;
+ line-height: 24upx;
+ font-size: 24upx;
+ margin: 0;
+ padding: 0;
+ }
}
radio {
diff --git a/pages/webview/webview.vue b/pages/webview/webview.vue
new file mode 100644
index 0000000..305f0c4
--- /dev/null
+++ b/pages/webview/webview.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
\ No newline at end of file