feat: 新增推广员申请注册功能
parent
7c79be72d2
commit
ba7e34e82a
|
@ -342,7 +342,7 @@ export default {
|
||||||
this.resetForm('form');
|
this.resetForm('form');
|
||||||
},
|
},
|
||||||
handleQRCode(row) {
|
handleQRCode(row) {
|
||||||
const url =`${config.spreadDomain}${config.spreadLink}?redirectUrl=${config.spreadDomain}&tenantId=${row.id}`
|
const url =`${config.spreadDomain}${config.spreadLink}?redirectUrl=${config.spreadDomain}&tenantId=${row.id}&isProperty=1`
|
||||||
QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, {
|
QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, {
|
||||||
scale: 2
|
scale: 2
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
|
|
|
@ -186,6 +186,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
async initLoad() {
|
async initLoad() {
|
||||||
this.isQRCode()
|
this.isQRCode()
|
||||||
|
this.isProperty()
|
||||||
this.setSpreadId()
|
this.setSpreadId()
|
||||||
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
||||||
await this.$store.dispatch('USERINFO');
|
await this.$store.dispatch('USERINFO');
|
||||||
|
@ -215,6 +216,13 @@
|
||||||
`${wechatUrl}&redirect_uri=${redirectUrl}/pages/member_application/index?tenantId=${tenantId}&spreadId=${spreadId}&response_type=code&scope=snsapi_base#wechat_redirect`
|
`${wechatUrl}&redirect_uri=${redirectUrl}/pages/member_application/index?tenantId=${tenantId}&spreadId=${spreadId}&response_type=code&scope=snsapi_base#wechat_redirect`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 是否扫物业二维码
|
||||||
|
isProperty() {
|
||||||
|
const is_property = this.$route.query.isProperty || false
|
||||||
|
if(parseInt(is_property) === 1){
|
||||||
|
this.$store.commit("SET_IS_PROPERTY", !!is_property)
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取租户信息
|
// 获取租户信息
|
||||||
getTenantInfo() {
|
getTenantInfo() {
|
||||||
fetchTenantInfo(this.tenantId).then(res => {
|
fetchTenantInfo(this.tenantId).then(res => {
|
||||||
|
|
|
@ -59,6 +59,11 @@ export function register(data) {
|
||||||
return request.post("member/auth/register", data, { noAuth : true });
|
return request.post("member/auth/register", data, { noAuth : true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 注册推广员
|
||||||
|
export function registerPromoter(data) {
|
||||||
|
return request.post("member/user/create", data, { noAuth : true });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户手机号修改密码
|
* 用户手机号修改密码
|
||||||
* @param data object 用户手机号 验证码 密码
|
* @param data object 用户手机号 验证码 密码
|
||||||
|
|
|
@ -10,6 +10,8 @@ module.exports = {
|
||||||
OPEN_ID: 'OPEN_ID',
|
OPEN_ID: 'OPEN_ID',
|
||||||
// 推广员ID
|
// 推广员ID
|
||||||
SPREAD_ID: 'SPREAD_ID',
|
SPREAD_ID: 'SPREAD_ID',
|
||||||
|
// 是否扫物业推广码
|
||||||
|
IS_PROPERTY: 'IS_PROPERTY',
|
||||||
//用户信息
|
//用户信息
|
||||||
USER_INFO: 'USER_INFO',
|
USER_INFO: 'USER_INFO',
|
||||||
//租户信息
|
//租户信息
|
||||||
|
|
|
@ -75,7 +75,6 @@ export function _toLogin(push, pathLogin) {
|
||||||
|
|
||||||
export function isWhiteList(){
|
export function isWhiteList(){
|
||||||
let path = prePage();
|
let path = prePage();
|
||||||
console.log('path111', path)
|
|
||||||
return whiteListPage.indexOf(path) > -1
|
return whiteListPage.indexOf(path) > -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,10 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<u-button class="logon" @click="loginMobile" v-if="current !== 0" :loading="loading" loading-text="登录中" :disabled="loading">登录</u-button>
|
<u-button class="logon" @click="loginMobile" v-if="current !== 0" :loading="loading" loading-text="登录中"
|
||||||
<u-button class="logon" @click="submit" v-if="current === 0" :loading="loading" loading-text="登录中" :disabled="loading">登录</u-button>
|
:disabled="loading">登录</u-button>
|
||||||
|
<u-button class="logon" @click="submit" v-if="current === 0" :loading="loading" loading-text="登录中"
|
||||||
|
:disabled="loading">登录</u-button>
|
||||||
<div class="tips">
|
<div class="tips">
|
||||||
<!-- <div @click="jumpRegister">注册账号</div> -->
|
<!-- <div @click="jumpRegister">注册账号</div> -->
|
||||||
<div @click="current = current === 1 ? 0 : 1">{{ current === 1 ? '账号密码登录' : '短信验证码登录' }}</div>
|
<div @click="current = current === 1 ? 0 : 1">{{ current === 1 ? '账号密码登录' : '短信验证码登录' }}</div>
|
||||||
|
@ -79,7 +81,9 @@
|
||||||
import {
|
import {
|
||||||
VUE_APP_API_URL
|
VUE_APP_API_URL
|
||||||
} from "@/utils";
|
} from "@/utils";
|
||||||
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from 'vuex'
|
||||||
const BACK_URL = "login_back_url";
|
const BACK_URL = "login_back_url";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -97,6 +101,9 @@
|
||||||
loading: false
|
loading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['isProperty'])
|
||||||
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
// this.getLogoImage();
|
// this.getLogoImage();
|
||||||
},
|
},
|
||||||
|
@ -120,7 +127,8 @@
|
||||||
if (!that.mobile) return that.$util.Tips({
|
if (!that.mobile) return that.$util.Tips({
|
||||||
title: '请填写手机号码'
|
title: '请填写手机号码'
|
||||||
});
|
});
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile))
|
||||||
|
return that.$util.Tips({
|
||||||
title: '请输入正确的手机号码'
|
title: '请输入正确的手机号码'
|
||||||
});
|
});
|
||||||
if (!that.captcha) return that.$util.Tips({
|
if (!that.captcha) return that.$util.Tips({
|
||||||
|
@ -161,7 +169,8 @@
|
||||||
if (!that.mobile) return that.$util.Tips({
|
if (!that.mobile) return that.$util.Tips({
|
||||||
title: '请填写手机号码'
|
title: '请填写手机号码'
|
||||||
});
|
});
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile))
|
||||||
|
return that.$util.Tips({
|
||||||
title: '请输入正确的手机号码'
|
title: '请输入正确的手机号码'
|
||||||
});
|
});
|
||||||
if (!that.captcha) return that.$util.Tips({
|
if (!that.captcha) return that.$util.Tips({
|
||||||
|
@ -209,7 +218,8 @@
|
||||||
if (!that.mobile) return that.$util.Tips({
|
if (!that.mobile) return that.$util.Tips({
|
||||||
title: '请填写手机号码'
|
title: '请填写手机号码'
|
||||||
});
|
});
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile))
|
||||||
|
return that.$util.Tips({
|
||||||
title: '请输入正确的手机号码'
|
title: '请输入正确的手机号码'
|
||||||
});
|
});
|
||||||
await registerVerify(that.mobile, 1)
|
await registerVerify(that.mobile, 1)
|
||||||
|
@ -274,11 +284,16 @@
|
||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
this.$store.commit("UPDATE_USERINFO", res.data);
|
this.$store.commit("UPDATE_USERINFO", res.data);
|
||||||
// let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
|
// let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||||
let backUrl = "/pages/member_application/index";
|
|
||||||
// let backUrl = "/pages/index/index";
|
// let backUrl = "/pages/index/index";
|
||||||
// if (backUrl.indexOf('/pages/users/login/index') !== -1) {
|
// if (backUrl.indexOf('/pages/users/login/index') !== -1) {
|
||||||
// backUrl = '/pages/index/index';
|
// backUrl = '/pages/index/index';
|
||||||
// }
|
// }
|
||||||
|
let backUrl = ''
|
||||||
|
if (this.isProperty && !res.data.isPromoter) {
|
||||||
|
backUrl = "/pages/users/promoter/index"
|
||||||
|
} else {
|
||||||
|
backUrl = "/pages/member_application/index"
|
||||||
|
}
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: backUrl
|
url: backUrl
|
||||||
});
|
});
|
||||||
|
@ -387,6 +402,7 @@
|
||||||
margin: 185rpx 0 85rpx 0;
|
margin: 185rpx 0 85rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
@ -430,6 +446,7 @@
|
||||||
margin-bottom: 38rpx;
|
margin-bottom: 38rpx;
|
||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -502,9 +519,11 @@
|
||||||
margin: 131rpx 0 80rpx 0;
|
margin: 131rpx 0 80rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: #F35981;
|
color: #F35981;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,291 +4,83 @@
|
||||||
<img src="/static/images/mallLogo.png" style="width:105rpx;height:105rpx;"></image>
|
<img src="/static/images/mallLogo.png" style="width:105rpx;height:105rpx;"></image>
|
||||||
<img src="/static/images/mall.png" style="width:233rpx;height:43rpx;"></image>
|
<img src="/static/images/mall.png" style="width:233rpx;height:43rpx;"></image>
|
||||||
</div>
|
</div>
|
||||||
<view class="title">登录</view>
|
<view class="title">注册推广员</view>
|
||||||
<div class="whiteBg">
|
<div class="whiteBg">
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<form @submit.prevent="submit">
|
<form @submit.prevent="submit">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="acea-row row-middle" v-if="current === 0">
|
|
||||||
<image src="/static/images/user_1.png" style="width: 40rpx; height: 40rpx;"></image>
|
|
||||||
<input type="text" class="texts" placeholder="请输入您的账号" v-model="mobile" required />
|
|
||||||
</div>
|
|
||||||
<div class="acea-row row-middle" v-else>
|
|
||||||
<image src="/static/images/phone_2.png" style="width: 40rpx; height: 40rpx;"></image>
|
|
||||||
<input type="text" class="texts" placeholder="请输入您的手机号" v-model="mobile" required />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="item" v-if="current === 0">
|
|
||||||
<div class="acea-row row-middle">
|
<div class="acea-row row-middle">
|
||||||
<image src="/static/images/code_3.png" style="width: 40rpx; height: 40rpx;"></image>
|
<text class="label">所属公司</text>
|
||||||
<input type="password" class="texts" placeholder="填写登录密码" v-model="password" required />
|
<input type="text" disabled class="texts" :value="tenantInfo.name"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item" v-else>
|
<div class="item">
|
||||||
<div class="acea-row row-middle">
|
<div class="acea-row row-middle">
|
||||||
<image src="/static/images/code_4.png" style="width: 40rpx; height: 40rpx;"></image>
|
<text class="label">手机号</text>
|
||||||
<input type="text" maxlength="6" placeholder="请输入您的验证码" class="texts" v-model="captcha" />
|
<input type="text" class="texts" :value="userInfo.mobile" disabled />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item">
|
||||||
|
<div class="acea-row row-middle">
|
||||||
|
<text class="label">姓名</text>
|
||||||
|
<input type="text" v-model="nickname" class="texts" placeholder="请输入" />
|
||||||
</div>
|
</div>
|
||||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
|
|
||||||
{{ text }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<u-button class="logon" @click="loginMobile" v-if="current !== 0" :loading="loading" loading-text="登录中" :disabled="loading">登录</u-button>
|
<button class="logon" @click="onRegister" :disabled="loading" :loading="loading">注册推广员</button>
|
||||||
<u-button class="logon" @click="submit" v-if="current === 0" :loading="loading" loading-text="登录中" :disabled="loading">登录</u-button>
|
|
||||||
<div class="tips">
|
|
||||||
<!-- <div @click="jumpRegister">注册账号</div> -->
|
|
||||||
<div @click="current = current === 1 ? 0 : 1">{{ current === 1 ? '账号密码登录' : '短信验证码登录' }}</div>
|
|
||||||
<div @click="jumpRetrievePassword">找回密码</div>
|
|
||||||
</div>
|
|
||||||
<div class="protocol-wrap">
|
|
||||||
<u-checkbox-group v-model="checked">
|
|
||||||
<u-checkbox size="30" shape="circle" activeColor="#F35981" name="同意"></u-checkbox>
|
|
||||||
</u-checkbox-group>
|
|
||||||
<view class="text">我已阅读并同意 <span class="link" @click="onLinkUserPrivacy">《创盈商城用户协议》</span></view>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom"></div>
|
<div class="bottom"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import dayjs from "@/plugin/dayjs/dayjs.min.js";
|
|
||||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
|
||||||
import {
|
import {
|
||||||
loginH5,
|
mapGetters
|
||||||
loginMobile,
|
} from 'vuex'
|
||||||
registerVerify,
|
|
||||||
register,
|
|
||||||
// getCodeApi,
|
|
||||||
getUserInfo
|
|
||||||
} from "@/api/user";
|
|
||||||
import attrs, {
|
|
||||||
required,
|
|
||||||
alpha_num,
|
|
||||||
chs_phone
|
|
||||||
} from "@/utils/validate";
|
|
||||||
import {
|
import {
|
||||||
validatorDefaultCatch
|
registerPromoter
|
||||||
} from "@/utils/dialog";
|
} from "@/api/user"
|
||||||
import {
|
|
||||||
getLogo,
|
|
||||||
appAuth,
|
|
||||||
appleLogin
|
|
||||||
} from "@/api/public";
|
|
||||||
import {
|
|
||||||
VUE_APP_API_URL
|
|
||||||
} from "@/utils";
|
|
||||||
|
|
||||||
const BACK_URL = "login_back_url";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Login",
|
name: 'Register',
|
||||||
mixins: [sendVerifyCode],
|
data() {
|
||||||
data: function() {
|
|
||||||
return {
|
return {
|
||||||
current: 1,
|
loading: false,
|
||||||
mobile: "",
|
nickname: ''
|
||||||
password: "",
|
}
|
||||||
captcha: "",
|
|
||||||
type: "login",
|
|
||||||
logoUrl: "",
|
|
||||||
checked: [],
|
|
||||||
loading: false
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
mounted: function() {
|
computed: {
|
||||||
// this.getLogoImage();
|
...mapGetters(['tenantInfo', 'userInfo'])
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onLinkUserPrivacy(){
|
async onRegister() {
|
||||||
uni.navigateTo({
|
this.loading = true
|
||||||
url: '/pages/users/privacy/index'
|
try {
|
||||||
|
const res = await registerPromoter({
|
||||||
|
nickname: this.nickname,
|
||||||
|
mobile: this.userInfo.mobile,
|
||||||
|
status: 1,
|
||||||
|
sourceType: 2
|
||||||
})
|
})
|
||||||
},
|
this.$util.Tips({
|
||||||
async getLogoImage() {
|
title: res.code === 0 ? '注册成功' : res.msg
|
||||||
let that = this;
|
}, {
|
||||||
getLogo().then(res => {
|
tab: 1,
|
||||||
that.logoUrl = res.data.logoUrl ? res.data.logoUrl : '/static/images/logo2.png';
|
url: '/pages/member_application/index'
|
||||||
});
|
|
||||||
},
|
|
||||||
async loginMobile() {
|
|
||||||
let that = this;
|
|
||||||
if (!that.mobile) return that.$util.Tips({
|
|
||||||
title: '请填写手机号码'
|
|
||||||
});
|
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
|
||||||
title: '请输入正确的手机号码'
|
|
||||||
});
|
|
||||||
if (!that.captcha) return that.$util.Tips({
|
|
||||||
title: '请填写验证码'
|
|
||||||
});
|
|
||||||
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
|
||||||
title: '请输入正确的验证码'
|
|
||||||
});
|
|
||||||
if(that.checked.length === 0) return that.$util.Tips({
|
|
||||||
title: '请勾选同意用户协议'
|
|
||||||
});
|
|
||||||
that.loading = true
|
|
||||||
loginMobile({
|
|
||||||
mobile: that.mobile,
|
|
||||||
code: that.captcha,
|
|
||||||
spread_spid: that.$Cache.get("spread")
|
|
||||||
})
|
})
|
||||||
.then(res => {
|
} catch (err) {
|
||||||
let data = res.data;
|
//TODO handle the exception
|
||||||
let newTime = Math.round(new Date() / 1000);
|
this.$util.Tips({
|
||||||
this.$store.commit("LOGIN", {
|
|
||||||
'token': res.data.accessToken,
|
|
||||||
'refreshToken': res.data.refreshToken
|
|
||||||
});
|
|
||||||
that.getUserInfo(data);
|
|
||||||
})
|
|
||||||
.catch(res => {
|
|
||||||
that.$util.Tips({
|
|
||||||
title: res
|
|
||||||
});
|
|
||||||
}).finally(()=>{
|
|
||||||
that.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async register() {
|
|
||||||
|
|
||||||
let that = this;
|
|
||||||
if (!that.mobile) return that.$util.Tips({
|
|
||||||
title: '请填写手机号码'
|
|
||||||
});
|
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
|
||||||
title: '请输入正确的手机号码'
|
|
||||||
});
|
|
||||||
if (!that.captcha) return that.$util.Tips({
|
|
||||||
title: '请填写验证码'
|
|
||||||
});
|
|
||||||
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
|
||||||
title: '请输入正确的验证码'
|
|
||||||
});
|
|
||||||
if (!that.password) return that.$util.Tips({
|
|
||||||
title: '请填写密码'
|
|
||||||
});
|
|
||||||
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
|
|
||||||
title: '您输入的密码过于简单'
|
|
||||||
});
|
|
||||||
register({
|
|
||||||
mobile: that.mobile,
|
|
||||||
captcha: that.captcha,
|
|
||||||
password: that.password,
|
|
||||||
spread: that.$Cache.get("spread")
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
that.$util.Tips({
|
|
||||||
title: res
|
|
||||||
});
|
|
||||||
that.formItem = 1;
|
|
||||||
})
|
|
||||||
.catch(res => {
|
|
||||||
that.$util.Tips({
|
|
||||||
title: res
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
jumpRegister() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/users/register/index'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
jumpRetrievePassword() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/users/retrievePassword/index'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async code() {
|
|
||||||
let that = this;
|
|
||||||
if (!that.mobile) return that.$util.Tips({
|
|
||||||
title: '请填写手机号码'
|
|
||||||
});
|
|
||||||
if (!/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(that.mobile)) return that.$util.Tips({
|
|
||||||
title: '请输入正确的手机号码'
|
|
||||||
});
|
|
||||||
await registerVerify(that.mobile, 1)
|
|
||||||
.then(res => {
|
|
||||||
that.$util.Tips({
|
|
||||||
title: res.message
|
|
||||||
});
|
|
||||||
that.sendCode();
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
return that.$util.Tips({
|
|
||||||
title: err
|
title: err
|
||||||
});
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navTap: function(index) {
|
|
||||||
this.current = index;
|
|
||||||
},
|
|
||||||
async submit() {
|
|
||||||
let that = this;
|
|
||||||
if (!that.mobile) return that.$util.Tips({
|
|
||||||
title: '请填写账号'
|
|
||||||
});
|
|
||||||
if (!/^[\w\d]{5,16}$/i.test(that.mobile)) return that.$util.Tips({
|
|
||||||
title: '请输入正确的账号'
|
|
||||||
});
|
|
||||||
if (!that.password) return that.$util.Tips({
|
|
||||||
title: '请填写密码'
|
|
||||||
});
|
|
||||||
if(that.checked.length === 0) return that.$util.Tips({
|
|
||||||
title: '请勾选同意用户协议'
|
|
||||||
});
|
|
||||||
that.loading = true
|
|
||||||
loginH5({
|
|
||||||
mobile: that.mobile,
|
|
||||||
password: that.password,
|
|
||||||
spread: that.$Cache.get("spread")
|
|
||||||
})
|
|
||||||
.then(({
|
|
||||||
data
|
|
||||||
}) => {
|
|
||||||
this.$store.commit("LOGIN", {
|
|
||||||
'token': data.accessToken,
|
|
||||||
'refreshToken': data.refreshToken
|
|
||||||
});
|
|
||||||
that.getUserInfo(data);
|
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
that.$util.Tips({
|
|
||||||
title: e
|
|
||||||
});
|
|
||||||
}).finally(()=>{
|
|
||||||
that.loading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUserInfo(data) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '正在获取用户信息...',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
this.$store.commit("SETUID", data.userId);
|
|
||||||
getUserInfo().then(res => {
|
|
||||||
this.$store.commit("UPDATE_USERINFO", res.data);
|
|
||||||
// let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
|
|
||||||
let backUrl = "/pages/member_application/index";
|
|
||||||
// let backUrl = "/pages/index/index";
|
|
||||||
// if (backUrl.indexOf('/pages/users/login/index') !== -1) {
|
|
||||||
// backUrl = '/pages/index/index';
|
|
||||||
// }
|
|
||||||
uni.reLaunch({
|
|
||||||
url: backUrl
|
|
||||||
});
|
|
||||||
}).finally(()=>{
|
|
||||||
uni.hideLoading()
|
|
||||||
})
|
})
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
page {
|
page {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
@ -420,7 +212,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.whiteBg {
|
.whiteBg {
|
||||||
|
|
||||||
margin-top: 46rpx;
|
margin-top: 46rpx;
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
|
@ -430,6 +221,7 @@
|
||||||
margin-bottom: 38rpx;
|
margin-bottom: 38rpx;
|
||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -453,6 +245,14 @@
|
||||||
border: 1px solid #BFBFBF;
|
border: 1px solid #BFBFBF;
|
||||||
border-radius: 15rpx;
|
border-radius: 15rpx;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
&.clear{
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label{
|
||||||
|
width: 120rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.texts {
|
.texts {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
@ -473,6 +273,7 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -483,15 +284,16 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 87rpx;
|
height: 87rpx;
|
||||||
margin-top: 137rpx;
|
margin-top: 99rpx;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);
|
background: linear-gradient(0deg, #E63163 0%, #FF819F 100%);
|
||||||
border-radius: 44rpx;
|
border-radius: 44rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tips {
|
.tips {
|
||||||
margin: 60rpx 20rpx 0 20rpx;
|
margin: 125rpx 20rpx 0 20rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -502,9 +304,11 @@
|
||||||
margin: 131rpx 0 80rpx 0;
|
margin: 131rpx 0 80rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
color: #F35981;
|
color: #F35981;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="register-success-wrap">
|
<view class="register-success-wrap">
|
||||||
<image src="@/static/images/logo.png" class="icon"></image>
|
<image src="@/static/images/mallLogo.png" class="icon"></image>
|
||||||
<view class="text">恭喜您,注册成功</view>
|
<view class="text">恭喜您,注册成功</view>
|
||||||
<u-button class="logon" @click="onBackLogin">返回登录</u-button>
|
<u-button class="logon" @click="onBackLogin">进入首页</u-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
onBackLogin() {
|
onBackLogin() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/login/index'
|
url: '/pages/member_application/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ export default {
|
||||||
tenantId: state => state.app.tenantId,
|
tenantId: state => state.app.tenantId,
|
||||||
openId: state => state.app.openId,
|
openId: state => state.app.openId,
|
||||||
spreadId: state => state.app.spreadId,
|
spreadId: state => state.app.spreadId,
|
||||||
|
isProperty: state => state.app.isProperty,
|
||||||
homeActive: state => state.app.homeActive,
|
homeActive: state => state.app.homeActive,
|
||||||
home: state => state.app.home,
|
home: state => state.app.home,
|
||||||
chatUrl: state => state.app.chatUrl,
|
chatUrl: state => state.app.chatUrl,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
REFRESH_TOKEN,
|
REFRESH_TOKEN,
|
||||||
UID,
|
UID,
|
||||||
TENANT_ID,
|
TENANT_ID,
|
||||||
|
IS_PROPERTY,
|
||||||
OPEN_ID,
|
OPEN_ID,
|
||||||
SPREAD_ID,
|
SPREAD_ID,
|
||||||
PLATFORM
|
PLATFORM
|
||||||
|
@ -26,6 +27,7 @@ const state = {
|
||||||
tenantId: Cache.get(TENANT_ID) || '',
|
tenantId: Cache.get(TENANT_ID) || '',
|
||||||
spreadId: Cache.get(SPREAD_ID) || '',
|
spreadId: Cache.get(SPREAD_ID) || '',
|
||||||
openId: Cache.get(OPEN_ID) || '',
|
openId: Cache.get(OPEN_ID) || '',
|
||||||
|
isProperty: false,
|
||||||
homeActive: false,
|
homeActive: false,
|
||||||
chatUrl: Cache.get('chatUrl') || '',
|
chatUrl: Cache.get('chatUrl') || '',
|
||||||
systemPlatform: Cache.get(PLATFORM)?Cache.get(PLATFORM):'',
|
systemPlatform: Cache.get(PLATFORM)?Cache.get(PLATFORM):'',
|
||||||
|
@ -62,6 +64,9 @@ const mutations = {
|
||||||
UPDATE_LOGIN(state, token) {
|
UPDATE_LOGIN(state, token) {
|
||||||
state.token = token;
|
state.token = token;
|
||||||
},
|
},
|
||||||
|
SET_IS_PROPERTY(state, value){
|
||||||
|
state.isProperty = value
|
||||||
|
},
|
||||||
LOGOUT(state) {
|
LOGOUT(state) {
|
||||||
state.token = undefined;
|
state.token = undefined;
|
||||||
state.uid = undefined
|
state.uid = undefined
|
||||||
|
|
Loading…
Reference in New Issue