Merge branch 'master' into wp

This commit is contained in:
邱贞招 2024-02-17 20:32:46 +08:00
commit 481bfba4bc
4 changed files with 61 additions and 31 deletions

View File

@ -382,7 +382,7 @@ export function spread(puid)
return request.get("user/bindSpread?spreadPid="+ puid); return request.get("user/bindSpread?spreadPid="+ puid);
} }
/** /**
// * 静默绑定推广人 // * 静默绑定渠道
// * @param {Object} channelId // * @param {Object} channelId
// */ // */
export function channel(channelId) export function channel(channelId)

View File

@ -217,7 +217,7 @@ class AuthWechat {
*/ */
auth(code) { auth(code) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
wechatAuth(code, Cache.get('spread')) wechatAuth(code, Cache.get('spread'),Cache.get('channelId'))
.then(({ .then(({
data data
}) => { }) => {

View File

@ -1,6 +1,6 @@
{ {
"name" : "先享后付", "name" : "先享后付",
"appid" : "__UNI__C7D69AA", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B "appid" : "__UNI__E7B7107", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B
"description" : "crmeb商城", "description" : "crmeb商城",
"versionName" : "2.1", "versionName" : "2.1",
"versionCode" : 2, "versionCode" : 2,
@ -219,8 +219,7 @@
"async" : { "async" : {
"timeout" : 200000 "timeout" : 200000
}, },
"title" : "先享后付", "title" : "先享后付"
"template" : "template.html"
}, },
"plus" : { "plus" : {
"statusbar" : { "statusbar" : {

View File

@ -1,6 +1,6 @@
import { spread } from "@/api/user"; import { spread,channel } from "@/api/user";
import Cache from "@/utils/cache"; import Cache from "@/utils/cache";
import { getCity } from '@/api/api.js'; import { getCity } from '@/api/api.js';
@ -35,6 +35,37 @@ export function silenceBindingSpread() {
} }
} }
/**
* 静默授权绑定渠道使用在已经登录后扫描了别人的推广二维码
* @param {Object} puid
*/
export function silenceBindingChannelId() {
//#ifdef H5
let puid = Cache.get('channelId');
//#endif
//#ifdef MP || APP-PLUS
let puid = getApp().globalData.channelId;
//#endif
puid = parseInt(puid);
if (Number.isNaN(puid)) {
puid = 0;
}
if (puid) {
channel(puid).then(res => {}).catch(res => {
//#ifdef H5
Cache.clear("channelId");
//#endif
//#ifdef MP || APP-PLUS
getApp().globalData.channelId = 0;
//#endif
});
} else {
Cache.set('channelId', 0);
}
}
export function isWeixin() { export function isWeixin() {
return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1; return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
} }