fix: 修复bug

pull/2/head
TianYu 2023-05-19 16:10:03 +08:00
parent 02ff453ff1
commit 2925d35df8
6 changed files with 40 additions and 22 deletions

View File

@ -5,8 +5,8 @@ ENV = 'development'
VUE_APP_TITLE = 创盈商户管理系统 VUE_APP_TITLE = 创盈商户管理系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
VUE_APP_BASE_API = 'https://cmx.bskies.cc:8000/cyywl-api' #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 = 'http://192.168.1.147:48080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -83,7 +83,7 @@
trigger="click" trigger="click"
popper-class="qrcode-wrap" popper-class="qrcode-wrap"
> >
<canvas :id="`id-${scope.row.id}`"></canvas> <canvas :id="`id-${scope.row.id}`" width="120" height="120"></canvas>
<el-button slot="reference" size="mini" type="text" @click="handleQRCode(scope.row)" <el-button slot="reference" size="mini" type="text" @click="handleQRCode(scope.row)"
v-hasPermi="['system:tenant:delete']">推广码 v-hasPermi="['system:tenant:delete']">推广码
</el-button> </el-button>
@ -345,9 +345,11 @@ export default {
this.resetForm('form'); this.resetForm('form');
}, },
handleQRCode(row) { handleQRCode(row) {
const url =`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7e503d9cded34c07&redirect_uri= const baseUrl = 'http://yuxy.perrymake.com'
http://192.168.1.149:8080?tenantId=${row.id}&response_type=code&scope=snsapi_base&state=123#wechat_redirect` const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${row.id}`
QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, function (error) { QRCode.toCanvas(document.getElementById(`id-${row.id}`), url, {
scale: 2
}, function (error) {
if (error) console.error(error) if (error) console.error(error)
console.log('success!'); console.log('success!');
}) })

View File

@ -175,6 +175,7 @@
}, },
computed: mapGetters(['tenantId']), computed: mapGetters(['tenantId']),
async mounted() { async mounted() {
this.isQRCode()
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');
} }
@ -186,6 +187,7 @@
if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) { if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) {
this.getWxChatCode() this.getWxChatCode()
} }
this.setSpreadId()
setInterval(() => { setInterval(() => {
if (this.$store.getters.isLogin) { if (this.$store.getters.isLogin) {
this.setRefreshToken() this.setRefreshToken()
@ -193,6 +195,16 @@
}, 60000) }, 60000)
}, },
methods: { 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() { getTenantInfo() {
fetchTenantInfo(this.tenantId).then(res => { fetchTenantInfo(this.tenantId).then(res => {
@ -201,7 +213,7 @@
}, },
// ID // ID
getTenantId() { getTenantId() {
const tenantId = this.$route.query.tenantId const tenantId = this.$route.query.tenantId || ''
if (tenantId) { if (tenantId) {
this.$store.commit("SET_TENANTID", tenantId); this.$store.commit("SET_TENANTID", tenantId);
this.getTenantInfo() this.getTenantInfo()
@ -213,8 +225,8 @@
}, },
// 广ID // 广ID
setSpreadId() { setSpreadId() {
const spreadId = this.$route.query.spreadId const spreadId = this.$route.query.spreadId || ''
if (tenantId) { if (spreadId) {
this.$store.commit("SET_SPREADID", spreadId); this.$store.commit("SET_SPREADID", spreadId);
} }
}, },

View File

@ -9,7 +9,7 @@
<image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar && uid" @click="goEdit()"></image> <image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar && uid" @click="goEdit()"></image>
<image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()"></image> <image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()"></image>
<view class="info"> <view class="info">
<view class="name" v-if="!uid" @tap="openAuto"> <view class="name" v-if="!uid" @click="openAuto">
请点击登录 请点击登录
</view> </view>
<view class="name" v-if="uid"> <view class="name" v-if="uid">
@ -286,8 +286,10 @@
}, },
// //
openAuto() { openAuto() {
Cache.set(BACK_URL, '') // Cache.set(BACK_URL, '')
toLogin(); uni.navigateTo({
url: '/pages/users/login/index'
})
}, },
// //
onLoadFun() { onLoadFun() {

View File

@ -90,7 +90,7 @@
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.registerForm.mobile)) return this.$util.Tips({ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.registerForm.mobile)) return this.$util.Tips({
title: '请输入正确的手机号码' title: '请输入正确的手机号码'
}); });
if(that.checked.length === 0) return that.$util.Tips({ if(this.checked.length === 0) return this.$util.Tips({
title: '请勾选同意用户协议' title: '请勾选同意用户协议'
}); });
await registerVerify(this.registerForm.mobile, 4) await registerVerify(this.registerForm.mobile, 4)

View File

@ -78,13 +78,13 @@
poster: '', poster: '',
isAuto: false, // isAuto: false, //
isShowAuth: false, // isShowAuth: false, //
qrcodeSize: 1000, qrcodeSize: 3000,
PromotionCode: '', PromotionCode: '',
base64List: [], base64List: [],
canvasStatus: true // canvasStatus: true //
}; };
}, },
computed: mapGetters(['isLogin', 'uid', 'userInfo']), computed: mapGetters(['isLogin', 'uid', 'userInfo','tenantId']),
watch: { watch: {
isLogin: { isLogin: {
handler: function(newV, oldV) { handler: function(newV, oldV) {
@ -202,15 +202,17 @@
make() { make() {
let that = this; let that = this;
let href = ''; let href = '';
// #ifdef H5 // href = window.location.href.split('/pages')[0];
href = window.location.href.split('/pages')[0]; const baseUrl = 'http://yuxy.perrymake.com';
// #endif const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${that.tenantId}&spreadId=${that.uid}`
uQRCode.make({ uQRCode.make({
canvasId: 'qrcode', canvasId: 'qrcode',
text: href + '/pages/index/index?spreadId=' + that.uid, // text: href + '/pages/index/index?spreadId=' + that.uid,
text: url,
size: this.qrcodeSize, size: this.qrcodeSize,
margin: 10, margin: 10,
success: res => { success: res => {
console.log('res', res)
that.PromotionCode = res; that.PromotionCode = res;
setTimeout(() => { setTimeout(() => {
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo