From ba7e34e82ac1634db15f5bb0396ec65528738b9d Mon Sep 17 00:00:00 2001 From: TianYu <332368756@qq.com> Date: Mon, 5 Jun 2023 15:56:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=8E=A8=E5=B9=BF?= =?UTF-8?q?=E5=91=98=E7=94=B3=E8=AF=B7=E6=B3=A8=E5=86=8C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/tenant/index.vue | 2 +- yudao-ui-app/App.vue | 8 + yudao-ui-app/api/user.js | 5 + yudao-ui-app/config/cache.js | 2 + yudao-ui-app/libs/login.js | 1 - yudao-ui-app/pages/users/login/index.vue | 77 +++-- yudao-ui-app/pages/users/promoter/index.vue | 324 ++++-------------- yudao-ui-app/pages/users/register/success.vue | 8 +- yudao-ui-app/store/getters.js | 1 + yudao-ui-app/store/modules/app.js | 5 + 10 files changed, 138 insertions(+), 295 deletions(-) diff --git a/yudao-ui-admin/src/views/system/tenant/index.vue b/yudao-ui-admin/src/views/system/tenant/index.vue index 9b39e3b70..bb481684b 100755 --- a/yudao-ui-admin/src/views/system/tenant/index.vue +++ b/yudao-ui-admin/src/views/system/tenant/index.vue @@ -342,7 +342,7 @@ export default { this.resetForm('form'); }, 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, { scale: 2 }, function (error) { diff --git a/yudao-ui-app/App.vue b/yudao-ui-app/App.vue index 928d6f416..90948cb41 100644 --- a/yudao-ui-app/App.vue +++ b/yudao-ui-app/App.vue @@ -186,6 +186,7 @@ methods: { async initLoad() { this.isQRCode() + this.isProperty() this.setSpreadId() if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) { 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` } }, + // 是否扫物业二维码 + isProperty() { + const is_property = this.$route.query.isProperty || false + if(parseInt(is_property) === 1){ + this.$store.commit("SET_IS_PROPERTY", !!is_property) + } + }, // 获取租户信息 getTenantInfo() { fetchTenantInfo(this.tenantId).then(res => { diff --git a/yudao-ui-app/api/user.js b/yudao-ui-app/api/user.js index d329eedcc..fce6a308a 100644 --- a/yudao-ui-app/api/user.js +++ b/yudao-ui-app/api/user.js @@ -59,6 +59,11 @@ export function register(data) { 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 用户手机号 验证码 密码 diff --git a/yudao-ui-app/config/cache.js b/yudao-ui-app/config/cache.js index e211f4324..f5537916c 100644 --- a/yudao-ui-app/config/cache.js +++ b/yudao-ui-app/config/cache.js @@ -10,6 +10,8 @@ module.exports = { OPEN_ID: 'OPEN_ID', // 推广员ID SPREAD_ID: 'SPREAD_ID', + // 是否扫物业推广码 + IS_PROPERTY: 'IS_PROPERTY', //用户信息 USER_INFO: 'USER_INFO', //租户信息 diff --git a/yudao-ui-app/libs/login.js b/yudao-ui-app/libs/login.js index 6fbe9db3a..f2811b55d 100644 --- a/yudao-ui-app/libs/login.js +++ b/yudao-ui-app/libs/login.js @@ -75,7 +75,6 @@ export function _toLogin(push, pathLogin) { export function isWhiteList(){ let path = prePage(); - console.log('path111', path) return whiteListPage.indexOf(path) > -1 } diff --git a/yudao-ui-app/pages/users/login/index.vue b/yudao-ui-app/pages/users/login/index.vue index 00592da7c..cf1cdad4a 100644 --- a/yudao-ui-app/pages/users/login/index.vue +++ b/yudao-ui-app/pages/users/login/index.vue @@ -35,8 +35,10 @@ - 登录 - 登录 + 登录 + 登录
{{ current === 1 ? '账号密码登录' : '短信验证码登录' }}
@@ -44,7 +46,7 @@
- + 我已阅读并同意 《创盈商城用户协议》
@@ -79,7 +81,9 @@ import { VUE_APP_API_URL } from "@/utils"; - + import { + mapGetters + } from 'vuex' const BACK_URL = "login_back_url"; export default { @@ -97,6 +101,9 @@ loading: false }; }, + computed: { + ...mapGetters(['isProperty']) + }, mounted: function() { // this.getLogoImage(); }, @@ -104,7 +111,7 @@ }, methods: { - onLinkUserPrivacy(){ + onLinkUserPrivacy() { uni.navigateTo({ url: '/pages/users/privacy/index' }) @@ -120,16 +127,17 @@ 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 (!/^(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({ + if (that.checked.length === 0) return that.$util.Tips({ title: '请勾选同意用户协议' }); that.loading = true @@ -151,7 +159,7 @@ that.$util.Tips({ title: res }); - }).finally(()=>{ + }).finally(() => { that.loading = false }) }, @@ -161,9 +169,10 @@ 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 (!/^(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: '请填写验证码' }); @@ -209,9 +218,10 @@ 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 (!/^(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({ @@ -239,7 +249,7 @@ if (!that.password) return that.$util.Tips({ title: '请填写密码' }); - if(that.checked.length === 0) return that.$util.Tips({ + if (that.checked.length === 0) return that.$util.Tips({ title: '请勾选同意用户协议' }); that.loading = true @@ -261,7 +271,7 @@ that.$util.Tips({ title: e }); - }).finally(()=>{ + }).finally(() => { that.loading = false }) }, @@ -274,15 +284,20 @@ 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'; // } + let backUrl = '' + if (this.isProperty && !res.data.isPromoter) { + backUrl = "/pages/users/promoter/index" + } else { + backUrl = "/pages/member_application/index" + } uni.reLaunch({ url: backUrl }); - }).finally(()=>{ + }).finally(() => { uni.hideLoading() }) } @@ -381,14 +396,15 @@ .login-wrapper { padding: 30rpx 52rpx; background: url('@/static/images/bg-linear.png') center 0 no-repeat; - background-size:100% 672rpx; + background-size: 100% 672rpx; .logo-wrap { margin: 185rpx 0 85rpx 0; - display:flex; - align-items:center; - img{ - margin-right: 20rpx; + display: flex; + align-items: center; + + img { + margin-right: 20rpx; } } @@ -430,6 +446,7 @@ margin-bottom: 38rpx; height: 98rpx; display: flex; + &:last-child { margin-bottom: 0; } @@ -498,14 +515,16 @@ justify-content: space-between; } - .protocol-wrap{ - margin: 131rpx 0 80rpx 0; + .protocol-wrap { + margin: 131rpx 0 80rpx 0; display: flex; justify-content: center; - .text{ + + .text { font-size: 24rpx; color: #000; - .link{ + + .link { color: #F35981; } } diff --git a/yudao-ui-app/pages/users/promoter/index.vue b/yudao-ui-app/pages/users/promoter/index.vue index 00592da7c..60b836aa7 100644 --- a/yudao-ui-app/pages/users/promoter/index.vue +++ b/yudao-ui-app/pages/users/promoter/index.vue @@ -4,291 +4,83 @@ - 登录 + 注册推广员
-
- - -
-
- - +
+ 所属公司 +
-
+
- - + 手机号 +
-
+
- - + 姓名 +
-
- 登录 - 登录 -
- -
{{ current === 1 ? '账号密码登录' : '短信验证码登录' }}
-
找回密码
-
-
- - - - 我已阅读并同意 《创盈商城用户协议》 -
+
+ + \ No newline at end of file + diff --git a/yudao-ui-app/store/getters.js b/yudao-ui-app/store/getters.js index a993e1d18..1e6d20f53 100644 --- a/yudao-ui-app/store/getters.js +++ b/yudao-ui-app/store/getters.js @@ -8,6 +8,7 @@ export default { tenantId: state => state.app.tenantId, openId: state => state.app.openId, spreadId: state => state.app.spreadId, + isProperty: state => state.app.isProperty, homeActive: state => state.app.homeActive, home: state => state.app.home, chatUrl: state => state.app.chatUrl, diff --git a/yudao-ui-app/store/modules/app.js b/yudao-ui-app/store/modules/app.js index 536c1857d..e94883dfe 100644 --- a/yudao-ui-app/store/modules/app.js +++ b/yudao-ui-app/store/modules/app.js @@ -6,6 +6,7 @@ import { REFRESH_TOKEN, UID, TENANT_ID, + IS_PROPERTY, OPEN_ID, SPREAD_ID, PLATFORM @@ -26,6 +27,7 @@ const state = { tenantId: Cache.get(TENANT_ID) || '', spreadId: Cache.get(SPREAD_ID) || '', openId: Cache.get(OPEN_ID) || '', + isProperty: false, homeActive: false, chatUrl: Cache.get('chatUrl') || '', systemPlatform: Cache.get(PLATFORM)?Cache.get(PLATFORM):'', @@ -62,6 +64,9 @@ const mutations = { UPDATE_LOGIN(state, token) { state.token = token; }, + SET_IS_PROPERTY(state, value){ + state.isProperty = value + }, LOGOUT(state) { state.token = undefined; state.uid = undefined