diff --git a/src/core/apis.js b/src/core/apis.js
index d66ef70..be8c955 100644
--- a/src/core/apis.js
+++ b/src/core/apis.js
@@ -89,6 +89,10 @@ const apis = {
showLoading: true,
auth: true,
}
+ },
+ registerType: {
+ url: "/wxapp/index/registertype",
+ showLoading: true,
}
},
service: {
diff --git a/src/core/models/user.js b/src/core/models/user.js
index c673804..918cd9f 100644
--- a/src/core/models/user.js
+++ b/src/core/models/user.js
@@ -121,6 +121,28 @@ export default {
}).catch(e => { });
});
},
+ /**
+ * 获取注册类型
+ */
+ getRegisterType() {
+ return new Promise((resolve, reject) => {
+ prototype.$request({
+ api: "user.registerType",
+ }).then(response => {
+ if (response.code == 1) {
+ let list = [];
+ response.data.forEach(item => {
+ list.push({
+ id: item.id,
+ name: item.name,
+ });
+ });
+ return resolve(list);
+ }
+ return reject(response.msg);
+ }).catch(e => { });
+ });
+ },
/**
* 用户注册
*/
@@ -142,6 +164,7 @@ export default {
password: user.password,
openid: user.openId,
verification_code: verificationCode,
+ register_type: user.registerType,
types: 2,
}
}).then((response) => {
diff --git a/src/pages/auth/auth.vue b/src/pages/auth/auth.vue
index a5505e7..d38776b 100644
--- a/src/pages/auth/auth.vue
+++ b/src/pages/auth/auth.vue
@@ -81,6 +81,15 @@
placeholder-class="placeholder-style-3"
/>
+
+
+
+
+ {{ currentRegisterType.name ? currentRegisterType.name : "请选择注册类型" }}
+
+
+
+
@@ -117,6 +126,11 @@ export default {
mobile: "",
password: "",
verificationCode: "",
+ registerType: [],
+ currentRegisterType: {
+ id: 0,
+ name: "",
+ },
isAgree: false,
};
},
@@ -129,12 +143,23 @@ export default {
openId: (state) => state.user.openId,
}),
},
- onLoad() {},
+ onLoad() {
+ this.$models.user.getRegisterType().then((list) => {
+ this.registerType = list;
+ });
+ },
onShow() {},
onReady() {},
onReachBottom() {},
onPullDownRefresh() {},
methods: {
+ /**
+ * 修改注册类型
+ */
+ changeRegisterType(e) {
+ let currentRegisterType = this.registerType[e.detail.value];
+ this.currentRegisterType = currentRegisterType;
+ },
/**
* 忘记密码
*/
@@ -228,12 +253,17 @@ export default {
this.$utils.toast("请先阅读并同意《服务协议》《隐私政策》");
return;
}
+ if (!this.currentRegisterType.id) {
+ this.$utils.toast("请选择注册类型");
+ return;
+ }
this.$models.user
.register(
{
mobile: this.mobile,
password: this.password,
openId: this.openId,
+ registerType: this.currentRegisterType.id,
},
this.verificationCode
)
@@ -348,4 +378,14 @@ export default {
margin: 160rpx auto 160rpx auto;
}
}
+.picker-view.register-type {
+ font-size: 32rpx;
+ padding: 30rpx 0;
+ .name {
+ color: #c9c9c9;
+ }
+ .name.active {
+ color: #666666;
+ }
+}
\ No newline at end of file