feat: 新增推广员申请注册功能

pull/16/head
TianYu 2023-06-05 15:56:27 +08:00
parent 7c79be72d2
commit ba7e34e82a
10 changed files with 138 additions and 295 deletions

View File

@ -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) {

View File

@ -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 => {

View File

@ -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 用户手机号 验证码 密码

View File

@ -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',
//租户信息 //租户信息

View File

@ -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
} }

View File

@ -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>
@ -44,7 +46,7 @@
</div> </div>
<div class="protocol-wrap"> <div class="protocol-wrap">
<u-checkbox-group v-model="checked"> <u-checkbox-group v-model="checked">
<u-checkbox size="30" shape="circle" activeColor="#F35981" name="同意"></u-checkbox> <u-checkbox size="30" shape="circle" activeColor="#F35981" name="同意"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<view class="text">我已阅读并同意 <span class="link" @click="onLinkUserPrivacy"></span></view> <view class="text">我已阅读并同意 <span class="link" @click="onLinkUserPrivacy"></span></view>
</div> </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();
}, },
@ -104,7 +111,7 @@
}, },
methods: { methods: {
onLinkUserPrivacy(){ onLinkUserPrivacy() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/privacy/index' url: '/pages/users/privacy/index'
}) })
@ -120,16 +127,17 @@
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))
title: '请输入正确的手机号码' return that.$util.Tips({
}); title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({ if (!that.captcha) return that.$util.Tips({
title: '请填写验证码' title: '请填写验证码'
}); });
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({ if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码' title: '请输入正确的验证码'
}); });
if(that.checked.length === 0) return that.$util.Tips({ if (that.checked.length === 0) return that.$util.Tips({
title: '请勾选同意用户协议' title: '请勾选同意用户协议'
}); });
that.loading = true that.loading = true
@ -151,7 +159,7 @@
that.$util.Tips({ that.$util.Tips({
title: res title: res
}); });
}).finally(()=>{ }).finally(() => {
that.loading = false that.loading = false
}) })
}, },
@ -161,9 +169,10 @@
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))
title: '请输入正确的手机号码' return that.$util.Tips({
}); title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({ if (!that.captcha) return that.$util.Tips({
title: '请填写验证码' title: '请填写验证码'
}); });
@ -209,9 +218,10 @@
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))
title: '请输入正确的手机号码' return that.$util.Tips({
}); title: '请输入正确的手机号码'
});
await registerVerify(that.mobile, 1) await registerVerify(that.mobile, 1)
.then(res => { .then(res => {
that.$util.Tips({ that.$util.Tips({
@ -239,7 +249,7 @@
if (!that.password) return that.$util.Tips({ if (!that.password) return that.$util.Tips({
title: '请填写密码' title: '请填写密码'
}); });
if(that.checked.length === 0) return that.$util.Tips({ if (that.checked.length === 0) return that.$util.Tips({
title: '请勾选同意用户协议' title: '请勾选同意用户协议'
}); });
that.loading = true that.loading = true
@ -261,7 +271,7 @@
that.$util.Tips({ that.$util.Tips({
title: e title: e
}); });
}).finally(()=>{ }).finally(() => {
that.loading = false that.loading = false
}) })
}, },
@ -274,15 +284,20 @@
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
}); });
}).finally(()=>{ }).finally(() => {
uni.hideLoading() uni.hideLoading()
}) })
} }
@ -381,14 +396,15 @@
.login-wrapper { .login-wrapper {
padding: 30rpx 52rpx; padding: 30rpx 52rpx;
background: url('@/static/images/bg-linear.png') center 0 no-repeat; background: url('@/static/images/bg-linear.png') center 0 no-repeat;
background-size:100% 672rpx; background-size: 100% 672rpx;
.logo-wrap { .logo-wrap {
margin: 185rpx 0 85rpx 0; margin: 185rpx 0 85rpx 0;
display:flex; display: flex;
align-items:center; align-items: center;
img{
margin-right: 20rpx; img {
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;
} }
@ -498,14 +515,16 @@
justify-content: space-between; justify-content: space-between;
} }
.protocol-wrap{ .protocol-wrap {
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;
} }
} }

View File

@ -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"> <div class="acea-row row-middle">
<image src="/static/images/user_1.png" style="width: 40rpx; height: 40rpx;"></image> <text class="label">所属公司</text>
<input type="text" class="texts" placeholder="请输入您的账号" v-model="mobile" required /> <input type="text" disabled class="texts" :value="tenantInfo.name"/>
</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> </div>
<div class="item" v-if="current === 0"> <div class="item">
<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" class="texts" :value="userInfo.mobile" disabled />
</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" 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,
async getLogoImage() { mobile: this.userInfo.mobile,
let that = this; status: 1,
getLogo().then(res => { sourceType: 2
that.logoUrl = res.data.logoUrl ? res.data.logoUrl : '/static/images/logo2.png';
});
},
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 => { this.$util.Tips({
let data = res.data; title: res.code === 0 ? '注册成功' : res.msg
let newTime = Math.round(new Date() / 1000); }, {
this.$store.commit("LOGIN", { tab: 1,
'token': res.data.accessToken, url: '/pages/member_application/index'
'refreshToken': res.data.refreshToken
});
that.getUserInfo(data);
}) })
.catch(res => { } catch (err) {
that.$util.Tips({ //TODO handle the exception
title: res this.$util.Tips({
}); title: err
}).finally(()=>{
that.loading = false
}) })
}, } finally {
async register() { this.loading = false
}
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
});
})
},
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()
})
} }
} }
}; }
</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,29 +284,32 @@
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;
justify-content: space-between; justify-content: space-between;
} }
.protocol-wrap{ .protocol-wrap {
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;
} }
} }

View File

@ -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'
}) })
} }
} }
@ -53,4 +53,4 @@
border-radius: 44rpx; border-radius: 44rpx;
} }
} }
</style> </style>

View File

@ -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,

View File

@ -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