diff --git a/yudao-ui-admin/.env.dev b/yudao-ui-admin/.env.dev index cd578096a..dc7c069b3 100644 --- a/yudao-ui-admin/.env.dev +++ b/yudao-ui-admin/.env.dev @@ -5,8 +5,8 @@ ENV = 'development' VUE_APP_TITLE = 创盈商户管理系统 # 芋道管理系统/开发环境 -VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api' -#VUE_APP_BASE_API = 'http://192.168.1.147:48080' +#VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api' +VUE_APP_BASE_API = 'http://192.168.1.147:48080' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/yudao-ui-admin/src/views/system/tenant/index.vue b/yudao-ui-admin/src/views/system/tenant/index.vue index 232af1852..c7f5efcc3 100755 --- a/yudao-ui-admin/src/views/system/tenant/index.vue +++ b/yudao-ui-admin/src/views/system/tenant/index.vue @@ -83,7 +83,7 @@ trigger="click" popper-class="qrcode-wrap" > - + 推广码 @@ -345,9 +345,11 @@ export default { this.resetForm('form'); }, handleQRCode(row) { - const url =`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7e503d9cded34c07&redirect_uri= - http://192.168.1.149:8080?tenantId=${row.id}&response_type=code&scope=snsapi_base&state=123#wechat_redirect` - QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, function (error) { + const baseUrl = 'http://yuxy.perrymake.com' + const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${row.id}` + QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, { + scale: 2 + }, function (error) { if (error) console.error(error) console.log('success!'); }) diff --git a/yudao-ui-app/App.vue b/yudao-ui-app/App.vue index cb578f16b..4504c263c 100644 --- a/yudao-ui-app/App.vue +++ b/yudao-ui-app/App.vue @@ -31,11 +31,11 @@ id: 0 }, onLaunch: function(option) { - const res = memberGradeInfo().then((res) =>{ - if(res.data.some((item) => !!!parseInt(item.isExist))){ + const res = memberGradeInfo().then((res) => { + if (res.data.some((item) => !!!parseInt(item.isExist))) { uni.setTabBarItem({ index: 2, - text: 'text', + text: 'text', pagePath: '/pages/member_equity/index' }) } @@ -175,6 +175,7 @@ }, computed: mapGetters(['tenantId']), async mounted() { + this.isQRCode() if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) { await this.$store.dispatch('USERINFO'); } @@ -186,6 +187,7 @@ if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) { this.getWxChatCode() } + this.setSpreadId() setInterval(() => { if (this.$store.getters.isLogin) { this.setRefreshToken() @@ -193,6 +195,16 @@ }, 60000) }, methods: { + // 是否扫码跳转 + isQRCode() { + const redirectUrl = this.$route.query.redirectUrl || '' + if (redirectUrl) { + const tenantId = this.$route.query.tenantId || '' + const spreadId = this.$route.query.spreadId || '' + const wechatUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7e503d9cded34c07' + location.href =`${wechatUrl}&redirect_uri=${redirectUrl}/pages/member_application/index?tenantId=${tenantId}&spreadId=${spreadId}&response_type=code&scope=snsapi_base#wechat_redirect` + } + }, // 获取租户信息 getTenantInfo() { fetchTenantInfo(this.tenantId).then(res => { @@ -201,7 +213,7 @@ }, // 获取租户ID getTenantId() { - const tenantId = this.$route.query.tenantId + const tenantId = this.$route.query.tenantId || '' if (tenantId) { this.$store.commit("SET_TENANTID", tenantId); this.getTenantInfo() @@ -213,8 +225,8 @@ }, // 获取推广员ID setSpreadId() { - const spreadId = this.$route.query.spreadId - if (tenantId) { + const spreadId = this.$route.query.spreadId || '' + if (spreadId) { this.$store.commit("SET_SPREADID", spreadId); } }, diff --git a/yudao-ui-app/pages/user/index.vue b/yudao-ui-app/pages/user/index.vue index ebe3b9126..1a839a945 100644 --- a/yudao-ui-app/pages/user/index.vue +++ b/yudao-ui-app/pages/user/index.vue @@ -9,7 +9,7 @@ - + 请点击登录 @@ -286,8 +286,10 @@ }, // 打开授权 openAuto() { - Cache.set(BACK_URL, '') - toLogin(); + // Cache.set(BACK_URL, '') + uni.navigateTo({ + url: '/pages/users/login/index' + }) }, // 授权回调 onLoadFun() { diff --git a/yudao-ui-app/pages/users/register/index.vue b/yudao-ui-app/pages/users/register/index.vue index 1c0301517..9779eac34 100644 --- a/yudao-ui-app/pages/users/register/index.vue +++ b/yudao-ui-app/pages/users/register/index.vue @@ -90,7 +90,7 @@ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.registerForm.mobile)) return this.$util.Tips({ title: '请输入正确的手机号码' }); - if(that.checked.length === 0) return that.$util.Tips({ + if(this.checked.length === 0) return this.$util.Tips({ title: '请勾选同意用户协议' }); await registerVerify(this.registerForm.mobile, 4) diff --git a/yudao-ui-app/pages/users/user_spread_code/index.vue b/yudao-ui-app/pages/users/user_spread_code/index.vue index 12286c1b0..8aeb8bb6a 100644 --- a/yudao-ui-app/pages/users/user_spread_code/index.vue +++ b/yudao-ui-app/pages/users/user_spread_code/index.vue @@ -78,13 +78,13 @@ poster: '', isAuto: false, //没有授权的不会自动授权 isShowAuth: false, //是否隐藏授权 - qrcodeSize: 1000, + qrcodeSize: 3000, PromotionCode: '', base64List: [], canvasStatus: true //海报绘图标签 }; }, - computed: mapGetters(['isLogin', 'uid', 'userInfo']), + computed: mapGetters(['isLogin', 'uid', 'userInfo','tenantId']), watch: { isLogin: { handler: function(newV, oldV) { @@ -202,15 +202,17 @@ make() { let that = this; let href = ''; - // #ifdef H5 - href = window.location.href.split('/pages')[0]; - // #endif + // href = window.location.href.split('/pages')[0]; + const baseUrl = 'http://yuxy.perrymake.com'; + const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${that.tenantId}&spreadId=${that.uid}` uQRCode.make({ canvasId: 'qrcode', - text: href + '/pages/index/index?spreadId=' + that.uid, + // text: href + '/pages/index/index?spreadId=' + that.uid, + text: url, size: this.qrcodeSize, margin: 10, success: res => { + console.log('res', res) that.PromotionCode = res; setTimeout(() => { that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo