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

89
pages/login/components/main.vue

@ -18,22 +18,32 @@
<input class="form-item--input" type="password" v-model="vpass" autocomplete="off" placeholder="请输入密码" />
</view>
<!-- 选择机构个人 -->
<view class="form-item">
<label class="item-radio" @click.stop="handleCheckItem(item.id)">
<radio class="radio" color="#fa2209" :checked="inArray(item.id, checkedIds)" />
</label>
机构
个人
<input class="form-item--input" type="password" v-model="vpass" placeholder="请输入密码" />
</view>
<radio-group @change="radioChange">
<view class="form-item">
<radio class="radio" color="#fa2209"/> 机构
</view>
<view class="form-item">
<radio class="radio" color="#fa2209"/> 个人
</view>
</radio-group>
<!-- 登录按钮 -->
<view class="login-button" @click="handleLogin">
<text>登录</text>
</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>
@ -84,7 +94,11 @@
//
captchaCode: '',
//
smsCode: ''
smsCode: '',
//
vpass:"",
//
tarr:["机构","个人"]
}
},
@ -94,7 +108,7 @@
created() {
console.log('main created')
//
this.getCaptcha()
// this.getCaptcha()
},
methods: {
@ -113,6 +127,10 @@
app.sendSmsCaptcha()
}
},
//
radioChange(evt) {
console.log(evt)
},
//
formValidation(scene = GET_CAPTCHA) {
@ -267,11 +285,6 @@
font-size: 54rpx;
}
.sub-title {
margin-top: 20rpx;
color: #b3b3b3;
font-size: 28rpx;
}
}
//
@ -293,17 +306,14 @@
min-width: 100rpx;
height: 100%;
}
&--radgrp{
display: flex;
flex:1;
height: 100%;
}
//
.captcha {
height: 100%;
.image {
display: block;
width: 192rpx;
height: 100%;
}
}
//
.captcha-sms {
@ -336,4 +346,31 @@
justify-content: 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>

12
pages/login/index.vue

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

Loading…
Cancel
Save