Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product

pull/2/head
tangqian 2023-05-19 17:35:37 +08:00
commit 59841c23b4
6 changed files with 33 additions and 27 deletions

View File

@ -174,8 +174,13 @@
// #endif
},
computed: mapGetters(['tenantId']),
async mounted() {
mounted() {
this.initLoad()
},
methods: {
async initLoad(){
this.isQRCode()
this.setSpreadId()
if (this.$store.getters.isLogin && !this.$Cache.get('USER_INFO')) {
await this.$store.dispatch('USERINFO');
}
@ -187,14 +192,12 @@
if (!this.$Cache.get('OPEN_ID') && this.$route.query.code) {
this.getWxChatCode()
}
this.setSpreadId()
setInterval(() => {
if (this.$store.getters.isLogin) {
this.setRefreshToken()
}
}, 60000)
},
methods: {
//
isQRCode() {
const redirectUrl = this.$route.query.redirectUrl || ''
@ -226,6 +229,7 @@
// 广ID
setSpreadId() {
const spreadId = this.$route.query.spreadId || ''
console.log('spreadId', spreadId)
if (spreadId) {
this.$store.commit("SET_SPREADID", spreadId);
}

View File

@ -8,6 +8,8 @@ module.exports = {
TENANT_ID: 'TENANT_ID',
// 微信openId
OPEN_ID: 'OPEN_ID',
// 推广员ID
SPREAD_ID: 'SPREAD_ID',
//用户信息
USER_INFO: 'USER_INFO',
//租户信息

View File

@ -61,7 +61,7 @@
realName: '',
mobile: '',
code: '',
spreadId: ''
promoterId: ''
}
}
},
@ -69,7 +69,7 @@
async onRegister() {
this.loading = true
try {
this.registerForm.spreadId = store.state.app.spreadId || ''
this.registerForm.promoterId = store.state.app.spreadId || ''
const res = await register(this.registerForm)
this.$util.Tips({
title: res.code === 0 ? '注册成功' : res.msg

View File

@ -59,10 +59,7 @@
</view>
</view>
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
<!-- #ifdef H5 -->
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin"
v-if="!this.$wechat.isWeixin()">退出登录</view>
<!-- #endif -->
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin">退</view>
</view>
</form>
<!-- #ifdef MP -->

View File

@ -203,8 +203,10 @@
let that = this;
let href = '';
// href = window.location.href.split('/pages')[0];
console.log('uid', that.uid)
const baseUrl = 'http://yuxy.perrymake.com';
const url =`${baseUrl}/pages/index/index?redirectUrl=${baseUrl}&tenantId=${that.tenantId}&spreadId=${that.uid}`
console.log('url', url)
uQRCode.make({
canvasId: 'qrcode',
// text: href + '/pages/index/index?spreadId=' + that.uid,
@ -212,7 +214,6 @@
size: this.qrcodeSize,
margin: 10,
success: res => {
console.log('res', res)
that.PromotionCode = res;
setTimeout(() => {
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo

View File

@ -7,6 +7,7 @@ import {
UID,
TENANT_ID,
OPEN_ID,
SPREAD_ID,
PLATFORM
} from '../../config/cache';
import Cache from '../../utils/cache';
@ -23,7 +24,7 @@ const state = {
tenantInfo: Cache.get(TENANT_INFO)?JSON.parse(Cache.get(TENANT_INFO)):null,
uid: Cache.get(UID) || null,
tenantId: Cache.get(TENANT_ID) || '',
spreadId: '',
spreadId: Cache.get(SPREAD_ID) || '',
openId: Cache.get(OPEN_ID) || '',
homeActive: false,
chatUrl: Cache.get('chatUrl') || '',
@ -52,6 +53,7 @@ const mutations = {
},
SET_SPREADID(state, val){
state.spreadId = val;
Cache.set(SPREAD_ID, val);
},
SET_OPENID(state, val){
state.openId = val;