feat: 增加会员换绑推广员功能

pull/2/head
TianYu 2023-05-29 15:37:57 +08:00
parent bcfc0dba18
commit 950a9c2b62
3 changed files with 43 additions and 16 deletions

View File

@ -5,7 +5,8 @@
import {
refreshToken,
getWeChatOpenId,
fetchTenantInfo
fetchTenantInfo,
fetchMemberChangeSpreadId
} from "@/api/api";
import {
HTTP_REQUEST_URL
@ -163,10 +164,25 @@
}
// #endif
},
computed: mapGetters(['tenantId']),
computed: {
...mapGetters(['tenantId', 'uid', 'spreadId']),
spreadDataChange() {
return {
uid: this.uid,
spreadId: this.spreadId
}
}
},
mounted() {
this.initLoad()
},
watch: {
spreadDataChange: function() {
if (this.uid && this.spreadId) {
fetchMemberChangeSpreadId(this.spreadId)
}
}
},
methods: {
async initLoad() {
this.isQRCode()
@ -195,7 +211,8 @@
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`
location.href =
`${wechatUrl}&redirect_uri=${redirectUrl}/pages/member_application/index?tenantId=${tenantId}&spreadId=${spreadId}&response_type=code&scope=snsapi_base#wechat_redirect`
}
},
//

View File

@ -42,6 +42,15 @@ export function fetchTenantInfo(id) {
return request.get('tenant/get?id=' + id, {});
}
/**
* 会员换绑推广员ID
*/
export function fetchMemberChangeSpreadId(id) {
return request.post("api/order/member/memberChangeTie", {
promoterId: id
});
}
/**
* 保存form_id
* @param string formId

View File

@ -7,6 +7,7 @@ export default {
uid: state => state.app.uid,
tenantId: state => state.app.tenantId,
openId: state => state.app.openId,
spreadId: state => state.app.spreadId,
homeActive: state => state.app.homeActive,
home: state => state.app.home,
chatUrl: state => state.app.chatUrl,