Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product
commit
59841c23b4
|
@ -174,27 +174,30 @@
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
computed: mapGetters(['tenantId']),
|
computed: mapGetters(['tenantId']),
|
||||||
async mounted() {
|
mounted() {
|
||||||
this.isQRCode()
|
this.initLoad()
|
||||||
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
|
||||||
await this.$store.dispatch('USERINFO');
|
|
||||||
}
|
|
||||||
if (!this.$Cache.get('TENANT_ID') || this.$route.query.tenantId) {
|
|
||||||
this.getTenantId()
|
|
||||||
} else {
|
|
||||||
this.getTenantInfo()
|
|
||||||
}
|
|
||||||
if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) {
|
|
||||||
this.getWxChatCode()
|
|
||||||
}
|
|
||||||
this.setSpreadId()
|
|
||||||
setInterval(() => {
|
|
||||||
if (this.$store.getters.isLogin) {
|
|
||||||
this.setRefreshToken()
|
|
||||||
}
|
|
||||||
}, 60000)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async initLoad(){
|
||||||
|
this.isQRCode()
|
||||||
|
this.setSpreadId()
|
||||||
|
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
|
||||||
|
await this.$store.dispatch('USERINFO');
|
||||||
|
}
|
||||||
|
if (!this.$Cache.get('TENANT_ID') || this.$route.query.tenantId) {
|
||||||
|
this.getTenantId()
|
||||||
|
} else {
|
||||||
|
this.getTenantInfo()
|
||||||
|
}
|
||||||
|
if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) {
|
||||||
|
this.getWxChatCode()
|
||||||
|
}
|
||||||
|
setInterval(() => {
|
||||||
|
if (this.$store.getters.isLogin) {
|
||||||
|
this.setRefreshToken()
|
||||||
|
}
|
||||||
|
}, 60000)
|
||||||
|
},
|
||||||
// 是否扫码跳转
|
// 是否扫码跳转
|
||||||
isQRCode() {
|
isQRCode() {
|
||||||
const redirectUrl = this.$route.query.redirectUrl || ''
|
const redirectUrl = this.$route.query.redirectUrl || ''
|
||||||
|
@ -226,6 +229,7 @@
|
||||||
// 获取推广员ID
|
// 获取推广员ID
|
||||||
setSpreadId() {
|
setSpreadId() {
|
||||||
const spreadId = this.$route.query.spreadId || ''
|
const spreadId = this.$route.query.spreadId || ''
|
||||||
|
console.log('spreadId', spreadId)
|
||||||
if (spreadId) {
|
if (spreadId) {
|
||||||
this.$store.commit("SET_SPREADID", spreadId);
|
this.$store.commit("SET_SPREADID", spreadId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ module.exports = {
|
||||||
TENANT_ID: 'TENANT_ID',
|
TENANT_ID: 'TENANT_ID',
|
||||||
// 微信openId
|
// 微信openId
|
||||||
OPEN_ID: 'OPEN_ID',
|
OPEN_ID: 'OPEN_ID',
|
||||||
|
// 推广员ID
|
||||||
|
SPREAD_ID: 'SPREAD_ID',
|
||||||
//用户信息
|
//用户信息
|
||||||
USER_INFO: 'USER_INFO',
|
USER_INFO: 'USER_INFO',
|
||||||
//租户信息
|
//租户信息
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
realName: '',
|
realName: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
code: '',
|
code: '',
|
||||||
spreadId: ''
|
promoterId: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
async onRegister() {
|
async onRegister() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
this.registerForm.spreadId = store.state.app.spreadId || ''
|
this.registerForm.promoterId = store.state.app.spreadId || ''
|
||||||
const res = await register(this.registerForm)
|
const res = await register(this.registerForm)
|
||||||
this.$util.Tips({
|
this.$util.Tips({
|
||||||
title: res.code === 0 ? '注册成功' : res.msg
|
title: res.code === 0 ? '注册成功' : res.msg
|
||||||
|
|
|
@ -59,10 +59,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
|
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
|
||||||
<!-- #ifdef H5 -->
|
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin">退出登录</view>
|
||||||
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin"
|
|
||||||
v-if="!this.$wechat.isWeixin()">退出登录</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
|
|
|
@ -203,8 +203,10 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
let href = '';
|
let href = '';
|
||||||
// href = window.location.href.split('/pages')[0];
|
// href = window.location.href.split('/pages')[0];
|
||||||
|
console.log('uid', that.uid)
|
||||||
const baseUrl = 'http://yuxy.perrymake.com';
|
const baseUrl = 'http://yuxy.perrymake.com';
|
||||||
const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${that.tenantId}&spreadId=${that.uid}`
|
const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${that.tenantId}&spreadId=${that.uid}`
|
||||||
|
console.log('url', url)
|
||||||
uQRCode.make({
|
uQRCode.make({
|
||||||
canvasId: 'qrcode',
|
canvasId: 'qrcode',
|
||||||
// text: href + '/pages/index/index?spreadId=' + that.uid,
|
// text: href + '/pages/index/index?spreadId=' + that.uid,
|
||||||
|
@ -212,7 +214,6 @@
|
||||||
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
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
UID,
|
UID,
|
||||||
TENANT_ID,
|
TENANT_ID,
|
||||||
OPEN_ID,
|
OPEN_ID,
|
||||||
|
SPREAD_ID,
|
||||||
PLATFORM
|
PLATFORM
|
||||||
} from '../../config/cache';
|
} from '../../config/cache';
|
||||||
import Cache from '../../utils/cache';
|
import Cache from '../../utils/cache';
|
||||||
|
@ -23,7 +24,7 @@ const state = {
|
||||||
tenantInfo: Cache.get(TENANT_INFO)?JSON.parse(Cache.get(TENANT_INFO)):null,
|
tenantInfo: Cache.get(TENANT_INFO)?JSON.parse(Cache.get(TENANT_INFO)):null,
|
||||||
uid: Cache.get(UID) || null,
|
uid: Cache.get(UID) || null,
|
||||||
tenantId: Cache.get(TENANT_ID) || '',
|
tenantId: Cache.get(TENANT_ID) || '',
|
||||||
spreadId: '',
|
spreadId: Cache.get(SPREAD_ID) || '',
|
||||||
openId: Cache.get(OPEN_ID) || '',
|
openId: Cache.get(OPEN_ID) || '',
|
||||||
homeActive: false,
|
homeActive: false,
|
||||||
chatUrl: Cache.get('chatUrl') || '',
|
chatUrl: Cache.get('chatUrl') || '',
|
||||||
|
@ -52,6 +53,7 @@ const mutations = {
|
||||||
},
|
},
|
||||||
SET_SPREADID(state, val){
|
SET_SPREADID(state, val){
|
||||||
state.spreadId = val;
|
state.spreadId = val;
|
||||||
|
Cache.set(SPREAD_ID, val);
|
||||||
},
|
},
|
||||||
SET_OPENID(state, val){
|
SET_OPENID(state, val){
|
||||||
state.openId = val;
|
state.openId = val;
|
||||||
|
|
Loading…
Reference in New Issue