Browse Source

调整注册页面

master
453530270@qq.com 2 years ago
parent
commit
d39caeca1e
  1. 40
      common/model/Setting.js
  2. 89
      pages/login/components/main.vue
  3. 12
      pages/login/index.vue

40
common/model/Setting.js

@ -31,23 +31,23 @@ const getApiData = () => {
* 有缓存的情况下返回缓存, 没有缓存从后端api获取 * 有缓存的情况下返回缓存, 没有缓存从后端api获取
* @param {bool} isCache 是否从缓存中获取 [优点不用每次请求后端api 缺点后台更新设置后需等待时效性] * @param {bool} isCache 是否从缓存中获取 [优点不用每次请求后端api 缺点后台更新设置后需等待时效性]
*/ */
const data = isCache => { // const data = isCache => {
if (isCache == undefined) { // if (isCache == undefined) {
isCache = Config.get('enabledSettingCache') // isCache = Config.get('enabledSettingCache')
} // }
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
const cacheData = getStorage() // const cacheData = getStorage()
if (isCache && cacheData) { // if (isCache && cacheData) {
resolve(cacheData) // resolve(cacheData)
} else { // } else {
getApiData() // getApiData()
.then(data => { // .then(data => {
setStorage(data) // setStorage(data)
resolve(data) // resolve(data)
}) // })
} // }
}) // })
} // }
// 获取商城设置(指定项) // 获取商城设置(指定项)
const item = (key, isCache) => { const item = (key, isCache) => {
@ -71,7 +71,7 @@ const h5Url = (isCache = false) => {
} }
export default { export default {
data, // data,
item, // item,
h5Url // h5Url
} }

89
pages/login/components/main.vue

@ -18,22 +18,32 @@
<input class="form-item--input" type="password" v-model="vpass" autocomplete="off" placeholder="请输入密码" /> <input class="form-item--input" type="password" v-model="vpass" autocomplete="off" placeholder="请输入密码" />
</view> </view>
<!-- 选择机构个人 --> <!-- 选择机构个人 -->
<view class="form-item"> <radio-group @change="radioChange">
<label class="item-radio" @click.stop="handleCheckItem(item.id)"> <view class="form-item">
<radio class="radio" color="#fa2209" :checked="inArray(item.id, checkedIds)" /> <radio class="radio" color="#fa2209"/> 机构
</label> </view>
机构 <view class="form-item">
个人 <radio class="radio" color="#fa2209"/> 个人
</view>
</radio-group>
<input class="form-item--input" type="password" v-model="vpass" placeholder="请输入密码" />
</view>
<!-- 登录按钮 --> <!-- 登录按钮 -->
<view class="login-button" @click="handleLogin"> <view class="login-button" @click="handleLogin">
<text>登录</text> <text>登录</text>
</view> </view>
</view> </view>
<!-- 找回密码 注册 -->
<view class="fdreg">
<text class="findpass">找回密码</text>
<text class="regnow">立即注册</text>
</view>
<!-- 隐私政策等 -->
<view class="privacy">
<label>
<checkbox class="form-item--input" color="#fa2209"></checkbox>
我已阅读并同意网站的 隐私政策 用户注册协议
</label>
</view>
</view> </view>
@ -84,7 +94,11 @@
// //
captchaCode: '', captchaCode: '',
// //
smsCode: '' smsCode: '',
//
vpass:"",
//
tarr:["机构","个人"]
} }
}, },
@ -94,7 +108,7 @@
created() { created() {
console.log('main created') console.log('main created')
// //
this.getCaptcha() // this.getCaptcha()
}, },
methods: { methods: {
@ -113,6 +127,10 @@
app.sendSmsCaptcha() app.sendSmsCaptcha()
} }
}, },
//
radioChange(evt) {
console.log(evt)
},
// //
formValidation(scene = GET_CAPTCHA) { formValidation(scene = GET_CAPTCHA) {
@ -267,11 +285,6 @@
font-size: 54rpx; font-size: 54rpx;
} }
.sub-title {
margin-top: 20rpx;
color: #b3b3b3;
font-size: 28rpx;
}
} }
// //
@ -293,17 +306,14 @@
min-width: 100rpx; min-width: 100rpx;
height: 100%; height: 100%;
} }
&--radgrp{
display: flex;
flex:1;
height: 100%;
}
//
.captcha {
height: 100%;
.image {
display: block;
width: 192rpx;
height: 100%;
}
}
// //
.captcha-sms { .captcha-sms {
@ -336,4 +346,31 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
//
.fdreg{
display: flex;
margin-top: 26rpx;
line-height: 1.4;
color:#ff0000;
padding-left: 32rpx;
padding-right: 32rpx;
text{
display: block;
float: left;
width: 46%;
}
.findpass{
text-align: left;
}
.regnow{
text-align: right;
}
}
.privacy{
display: flex;
margin-top: 10rpx;
}
</style> </style>

12
pages/login/index.vue

@ -36,7 +36,7 @@
async onLoad(options) { async onLoad(options) {
console.log('login onLoad') console.log('login onLoad')
// //
await this.setShowUserInfo() // await this.setShowUserInfo()
// //
this.isLoad = true this.isLoad = true
console.log('isLoad', true) console.log('isLoad', true)
@ -56,11 +56,11 @@
const isMpWeixin = app.platform === 'MP-WEIXIN' && wx.canIUse('getUserProfile') const isMpWeixin = app.platform === 'MP-WEIXIN' && wx.canIUse('getUserProfile')
// //
await SettingModel.item(SettingKeyEnum.REGISTER.value, false) // await SettingModel.item(SettingKeyEnum.REGISTER.value, false)
.then(setting => { // .then(setting => {
app.isMpWeixinAuth = isMpWeixin && setting.isOauthMpweixin // app.isMpWeixinAuth = isMpWeixin && setting.isOauthMpweixin
console.log('setShowUserInfo complete') // console.log('setShowUserInfo complete')
}) // })
}, },
// //

Loading…
Cancel
Save