|
@@ -9,63 +9,239 @@
|
|
|
<u-form :model="form" ref="uForm">
|
|
|
<view class="jpLogin-input">
|
|
|
<u-icon custom-prefix="custom-icon" name="user-2-fill" class="jpLogin-icon"></u-icon>
|
|
|
- <u-form-item><u-input v-model="form.name" placeholder="请填写您的真实姓名" /></u-form-item>
|
|
|
+ <u-form-item>
|
|
|
+ <u-input v-model="form.realName" placeholder="请填写您的真实姓名" />
|
|
|
+ </u-form-item>
|
|
|
<u-icon custom-prefix="custom-icon" name="information-line" class="jpLogin-warn"></u-icon>
|
|
|
</view>
|
|
|
<view class="jpLogin-input">
|
|
|
<u-icon custom-prefix="custom-icon" name="profile-fill" class="jpLogin-icon"></u-icon>
|
|
|
- <u-form-item><u-input v-model="form.name" placeholder="请填写18位身份证号" /></u-form-item>
|
|
|
+ <u-form-item>
|
|
|
+ <u-input v-model="form.idCard" placeholder="请填写18位身份证号" />
|
|
|
+ </u-form-item>
|
|
|
<u-icon custom-prefix="custom-icon" name="information-line" class="jpLogin-warn"></u-icon>
|
|
|
</view>
|
|
|
<view class="jpLogin-input">
|
|
|
<u-icon custom-prefix="custom-icon" name="building-fill" class="jpLogin-icon"></u-icon>
|
|
|
- <u-form-item><u-input v-model="form.sex" type="select" placeholder="请选择所属工会"/></u-form-item>
|
|
|
+ <u-form-item>
|
|
|
+ <u-input v-model="form.orgName" type="select" placeholder="请选择所属工会" @click="getSearch" />
|
|
|
+ </u-form-item>
|
|
|
</view>
|
|
|
<view class="jpLogin-input" style="margin-top:60px;">
|
|
|
<u-icon custom-prefix="custom-icon" name="cellphone-fill" class="jpLogin-icon"></u-icon>
|
|
|
- <u-form-item><u-input v-model="form.name" placeholder="请填写手机号码" /></u-form-item>
|
|
|
+ <u-form-item>
|
|
|
+ <u-input v-model="form.telephone" placeholder="请填写手机号码" />
|
|
|
+ </u-form-item>
|
|
|
</view>
|
|
|
<view class="jpLogin-input">
|
|
|
<u-icon custom-prefix="custom-icon" name="message-3-fill" class="jpLogin-icon"></u-icon>
|
|
|
- <u-form-item><u-input v-model="form.name" placeholder="请输入验证码" /></u-form-item>
|
|
|
+ <u-form-item>
|
|
|
+ <u-input v-model="form.verifyCode" placeholder="请输入验证码" />
|
|
|
+ </u-form-item>
|
|
|
</view>
|
|
|
</u-form>
|
|
|
<view class="jpLogin-link">
|
|
|
<view class="jpLogin-link-l">
|
|
|
<p>已有账号,</p>
|
|
|
- <span>登录</span>
|
|
|
+ <span @click="getLogin">登录</span>
|
|
|
</view>
|
|
|
- <span>获取验证码</span>
|
|
|
+ <span @click="getCode">获取验证码</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="margin-top: 60px;">
|
|
|
- <u-button type="error" shape="circle" :custom-style="customStyle">注册并登录</u-button>
|
|
|
+ <u-button type="error" shape="circle" :custom-style="customStyle" @click="finish">注册并登录</u-button>
|
|
|
</view>
|
|
|
<view class="jpLogin-radio">
|
|
|
<u-radio-group v-model="value">
|
|
|
- <u-radio activeColor="#ff5e5e"><view class="u-flex"><p>已阅读并同意</p><span>《会员服务协议》</span></view></u-radio>
|
|
|
+ <u-radio activeColor="#ff5e5e">
|
|
|
+ <view class="u-flex">
|
|
|
+ <p>已阅读并同意</p><span @click="getAgreement">《会员服务协议》</span>
|
|
|
+ </view>
|
|
|
+ </u-radio>
|
|
|
</u-radio-group>
|
|
|
</view>
|
|
|
+ <u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start">
|
|
|
+ </u-verification-code>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import * as loginApi from '@/apis/login.js'
|
|
|
+ import {
|
|
|
+ checkPhone
|
|
|
+ } from '@/utils'
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
form: {
|
|
|
- name: '',
|
|
|
+ verifyCode: '',
|
|
|
+ realName: '',
|
|
|
+ idCard: '',
|
|
|
+ orgId: '',
|
|
|
+ orgName: '',
|
|
|
+ telephone: '',
|
|
|
},
|
|
|
- value:'0',
|
|
|
- customStyle:{
|
|
|
+ value: '0',
|
|
|
+ customStyle: {
|
|
|
background: '#FF5E5E'
|
|
|
- }
|
|
|
+ },
|
|
|
+ isSendMsgIng: false,
|
|
|
+ sendMsgSecond: 60 * 2,
|
|
|
}
|
|
|
- methods: {
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ var item= this.carhelp.get("selectitem")
|
|
|
+ if(item){
|
|
|
+ console.log(item)
|
|
|
+ this.form.orgName = item.name;
|
|
|
+ this.form.orgId = item.id;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getSearch() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/login/search'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getLogin() {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/login/index'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goAgreement() {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/login/agreement'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ codeChange(text) {
|
|
|
+ this.codeTips = text;
|
|
|
+ },
|
|
|
+ start() {
|
|
|
+ if (!this.isSendMsgIng) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ loginApi.getVerifyCode(this.form.telephone).then((response) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.carhelp.set("getvcodetime", new Date().getTime());
|
|
|
|
|
|
- }
|
|
|
+ if (!"") {
|
|
|
+ //倒计时
|
|
|
+ uni.showToast({
|
|
|
+ title: "发送成功"
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "您的验证码已经发送[5分钟有效],请勿重复点击"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //倒计时
|
|
|
+ end() {
|
|
|
+ this.sendMsgSecond = 2 * 60;
|
|
|
+ this.isSendMsgIng = false;
|
|
|
+ },
|
|
|
+ // 获取验证码
|
|
|
+ getCode() {
|
|
|
+ if (this.$refs.uCode.canGetCode) {} else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '倒计时结束后再发送',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var checkPhoneResult = checkPhone(this.form.telephone);
|
|
|
|
|
|
+ if (false && checkPhoneResult !== true) {
|
|
|
+ uni.showToast({
|
|
|
+ title: checkPhoneResult,
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.uCode.start();
|
|
|
+ },
|
|
|
+ finish() {
|
|
|
+ if (!this.carhelp.getOpenId()) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请使用“微信”访问本系统登录"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.form.realName) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请输入姓名"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.form.idCard) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请输入身份证"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.form.orgName) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请选择工会"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.form.telephone) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请输入手机号"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.form.verifyCode) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "请输入验证码"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ var headImg = "";
|
|
|
+ var userInfo = this.carhelp.get("xpgj_wx_user_info")
|
|
|
+ if (userInfo) {
|
|
|
+ headImg = userInfo.headimgurl;
|
|
|
+ }
|
|
|
+
|
|
|
+ loginApi.register({
|
|
|
+ realName: this.form.realName,
|
|
|
+ idCard: this.form.idCard,
|
|
|
+ orgId: this.form.orgId,
|
|
|
+ verifyCode: this.form.verifyCode,
|
|
|
+ telephone: this.form.telephone,
|
|
|
+ openId: this.carhelp.getOpenId(),
|
|
|
+ headImg: headImg
|
|
|
+ }).then((response) => {
|
|
|
+ var token = response ? response.data.token : '';
|
|
|
+ this.carhelp.setToken(token);
|
|
|
+ this.carhelp.setPersonInfo(response.data.memberInfo);
|
|
|
+ //this.gotoUrl("pages/user/index")
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ })
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -105,25 +281,29 @@
|
|
|
padding: 0 20px;
|
|
|
margin-bottom: 20px;
|
|
|
position: relative;
|
|
|
- .u-form-item{
|
|
|
+
|
|
|
+ .u-form-item {
|
|
|
flex: 1;
|
|
|
}
|
|
|
- .jpLogin-icon{
|
|
|
+
|
|
|
+ .jpLogin-icon {
|
|
|
font-size: 20px;
|
|
|
- color:#FFC1C1;
|
|
|
+ color: #FFC1C1;
|
|
|
margin-right: 20px;
|
|
|
position: relative;
|
|
|
- &:after{
|
|
|
+
|
|
|
+ &:after {
|
|
|
content: '';
|
|
|
width: 1px;
|
|
|
height: 16px;
|
|
|
- background-color:#E6D6D6;
|
|
|
+ background-color: #E6D6D6;
|
|
|
position: absolute;
|
|
|
right: -10px;
|
|
|
top: 15px;
|
|
|
}
|
|
|
}
|
|
|
- .jpLogin-warn{
|
|
|
+
|
|
|
+ .jpLogin-warn {
|
|
|
position: absolute;
|
|
|
right: 20px;
|
|
|
top: 14px;
|
|
@@ -151,15 +331,18 @@
|
|
|
color: #1677FF;
|
|
|
}
|
|
|
}
|
|
|
- .jpLogin-radio{
|
|
|
+
|
|
|
+ .jpLogin-radio {
|
|
|
margin-top: 16px;
|
|
|
text-align: center;
|
|
|
- p{
|
|
|
+
|
|
|
+ p {
|
|
|
font-size: 14px;
|
|
|
color: #a0a4b8;
|
|
|
}
|
|
|
- span{
|
|
|
- color:#ff5e5e;
|
|
|
+
|
|
|
+ span {
|
|
|
+ color: #ff5e5e;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|