合并冲突
This commit is contained in:
commit
a4a29feecb
|
@ -359,6 +359,7 @@ export function getinstallment(data) {
|
|||
});
|
||||
}
|
||||
|
||||
// 到首页查询ip地址
|
||||
|
||||
// 首页记录ip
|
||||
export function logoip() {
|
||||
|
@ -367,3 +368,10 @@ export function logoip() {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
// 查询签约是否成功
|
||||
// export function getqytrue(data) {
|
||||
// return request.get('order/getSignResult/',data,{
|
||||
// noAuth: true
|
||||
// })
|
||||
// }
|
|
@ -23,6 +23,7 @@ export function wechatAuth(code, spread,) {
|
|||
var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/
|
||||
spread = reg.test(spread) ? spread : 0;
|
||||
|
||||
channelId = reg.test(channelId) ? channelId : 0;
|
||||
return request.get(
|
||||
"wechat/authorize/login?code=" + code + "&spread_spid=" + spread , {},
|
||||
{ noAuth: true }
|
||||
|
|
|
@ -400,7 +400,7 @@ export function sendwxcodes(code)
|
|||
// return request.post('user/wxcode', data);
|
||||
// }
|
||||
/**
|
||||
// * 静默绑定推广人
|
||||
// * 静默绑定渠道
|
||||
// * @param {Object} channelId
|
||||
// */
|
||||
export function channel(channelId)
|
||||
|
|
|
@ -450,12 +450,18 @@
|
|||
|
||||
.periodization .returnthedate a {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
// display: block;
|
||||
margin-top: 20rpx;
|
||||
border: 1px solid rgb(255, 87, 51);
|
||||
color: #000;
|
||||
// width: 100% !important;
|
||||
padding: 0 20rpx;
|
||||
padding-right: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.returnthedate{
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.periodization .returnthedate a:nth-of-type(1) {
|
||||
width: 198rpx;
|
||||
height: 60rpx;
|
||||
|
|
|
@ -26,8 +26,8 @@ module.exports = {
|
|||
|
||||
TIPS_KEY: 'TIPS_KEY',
|
||||
|
||||
|
||||
SPREAD: 'SPREAD',
|
||||
CHANNELID: 'CHANNELID',
|
||||
//缓存经度
|
||||
CACHE_LONGITUDE: 'LONGITUDE',
|
||||
//缓存纬度
|
||||
|
|
|
@ -217,7 +217,7 @@ class AuthWechat {
|
|||
*/
|
||||
auth(code) {
|
||||
return new Promise((resolve, reject) => {
|
||||
wechatAuth(code, Cache.get('spread'))
|
||||
wechatAuth(code, Cache.get('spread'),Cache.get('channelId'))
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
|
|
12
main.js
12
main.js
|
@ -29,13 +29,13 @@ import {
|
|||
} from "./utils";
|
||||
import Auth from './libs/wechat';
|
||||
import {
|
||||
SPREAD
|
||||
SPREAD,CHANNELID
|
||||
} from './config/cache';
|
||||
Vue.prototype.$wechat = Auth;
|
||||
let cookieName = "VCONSOLE",
|
||||
query = parseQuery(),
|
||||
urlSpread = query["spread"],
|
||||
|
||||
urlChannelId = query["channelId"],
|
||||
vconsole = query[cookieName.toLowerCase()],
|
||||
md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
|
||||
md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
|
||||
|
@ -46,7 +46,13 @@ let cookieName = "VCONSOLE",
|
|||
value: urlSpread,
|
||||
})
|
||||
}
|
||||
|
||||
if (urlChannelId) {
|
||||
urlChannelId = parseInt(urlChannelId);
|
||||
Cache.setItem({
|
||||
name: 'channelId',
|
||||
value: urlChannelId,
|
||||
})
|
||||
}
|
||||
if (vconsole !== undefined) {
|
||||
if (vconsole === md5UnCrmeb && Cache.has(cookieName))
|
||||
Cache.clear(cookieName);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name" : "先享后付",
|
||||
"appid" : "__UNI__EA8F22D", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B
|
||||
"appid" : "__UNI__E7B7107", //wxb74514b47a2f29d4 wx46c3a73d8c4f7051 __UNI__EB8A7B
|
||||
"description" : "crmeb商城",
|
||||
"versionName" : "2.1",
|
||||
"versionCode" : 2,
|
||||
|
@ -219,8 +219,7 @@
|
|||
"async" : {
|
||||
"timeout" : 200000
|
||||
},
|
||||
"title" : "先享后付",
|
||||
"template" : "template.html"
|
||||
"title" : "先享后付"
|
||||
},
|
||||
"plus" : {
|
||||
"statusbar" : {
|
||||
|
|
|
@ -200,10 +200,10 @@
|
|||
</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP -->
|
||||
<!-- <view class="item skeleton-rect" @click="onClickService">
|
||||
<view class="item skeleton-rect" @click="onClickService">
|
||||
<view class="iconfont icon-kefu"></view>
|
||||
<view>客服</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<block v-if="type === 'normal'">
|
||||
<view @click="setCollect" class='item skeleton-rect'>
|
||||
|
@ -368,8 +368,7 @@
|
|||
import shareRedPackets from '@/components/shareRedPackets';
|
||||
import cusPreviewImg from '@/components/cus-previewImg/cus-previewImg.vue'
|
||||
import {
|
||||
silenceBindingSpread,
|
||||
|
||||
silenceBindingSpread,silenceBindingChannelId
|
||||
} from "@/utils";
|
||||
import parser from "@/components/jyf-parser/jyf-parser";
|
||||
import {
|
||||
|
@ -551,6 +550,8 @@
|
|||
this.getTokenIsExist();
|
||||
},
|
||||
onLoad(options) {
|
||||
// console.log(JSON.stringify(options),"options.spread")
|
||||
alert("options.spread"+JSON.stringify(options))
|
||||
//用户从分享卡片进入的场景下获取主题色配置
|
||||
this.$set(this, 'theme', this.$Cache.get('theme'));
|
||||
|
||||
|
@ -608,7 +609,7 @@
|
|||
// #endif
|
||||
|
||||
if (options.spread) app.globalData.spread = options.spread;
|
||||
|
||||
if (options.channelId) app.globalData.channelId = options.channelId;
|
||||
|
||||
this.getGoodsDetails(); //商品详情
|
||||
this.getCouponType(); //获取默认的 优惠券类型
|
||||
|
@ -647,8 +648,6 @@
|
|||
title: that.productInfo.storeName || '',
|
||||
imageUrl: that.productInfo.image || '',
|
||||
path: '/pages/goods_details/index?id=' + that.id + '&spread=' + that.uid,
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
// #endif
|
||||
|
@ -687,7 +686,7 @@
|
|||
this.getCartCount(true); //购物车数量
|
||||
//绑定关系
|
||||
if (parseInt(app.globalData.spread) > 0) silenceBindingSpread();
|
||||
|
||||
if (parseInt(app.globalData.channelId) > 0) silenceBindingChannelId();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -701,8 +700,6 @@
|
|||
scene: scene,
|
||||
type: 0,
|
||||
href: `${HTTP_H5_URL}${curRoute}&spread=${that.uid}`,
|
||||
|
||||
|
||||
title: that.productInfo.storeName,
|
||||
summary: app.globalData.companyName,
|
||||
imageUrl: that.productInfo.image,
|
||||
|
@ -1431,7 +1428,6 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
|
||||
getImageBase64: function(images) {
|
||||
let that = this;
|
||||
imageBase64({
|
||||
|
@ -1584,8 +1580,7 @@
|
|||
let data = this.productInfo;
|
||||
let href = location.href;
|
||||
if (this.$wechat.isWeixin()) {
|
||||
href = href.indexOf("?") === -1 ? href + "?spread=" + this.uid: href + "&spread=" + this.uid;
|
||||
|
||||
href = href.indexOf("?") === -1 ? href + "?spread=" + this.uid : href + "&spread=" + this.uid;
|
||||
let configAppMessage = {
|
||||
desc: app.globalData.companyName,
|
||||
title: data.storeName,
|
||||
|
|
|
@ -170,6 +170,7 @@
|
|||
setCouponReceive,
|
||||
getTheme,
|
||||
getAppVersion,
|
||||
getip
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
spread,
|
||||
|
@ -213,7 +214,7 @@
|
|||
getGroomList
|
||||
} from '@/api/store.js';
|
||||
import {
|
||||
silenceBindingSpread,
|
||||
silenceBindingSpread,silenceBindingChannelId,
|
||||
getCityList
|
||||
} from '@/utils';
|
||||
import animationType from '@/utils/animationType.js'
|
||||
|
@ -446,11 +447,10 @@
|
|||
let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
|
||||
let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
|
||||
app.globalData.spread = mapeMpQrCodeValue.spread;
|
||||
|
||||
|
||||
app.globalData.channelId = mapeMpQrCodeValue.channelId;
|
||||
}
|
||||
if (options.spread) app.globalData.spread = options.spread; //非小程序扫码进入情况下,直接获取url中的分销员id保存在globalDta中
|
||||
|
||||
if (options.channelId) app.globalData.channelId = options.channelId; //非小程序扫码进入情况下,直接获取url中的分销员id保存在globalDta中
|
||||
// #endif
|
||||
// #ifndef MP || APP-PLUS
|
||||
this.navH = 0;
|
||||
|
@ -462,10 +462,12 @@
|
|||
if (this.isLogin && parseInt(app.globalData.spread) > 0) {
|
||||
silenceBindingSpread()
|
||||
}
|
||||
|
||||
|
||||
// 调用记录ip
|
||||
// this.getip()
|
||||
if (this.isLogin && parseInt(app.globalData.channelId) > 0) {
|
||||
silenceBindingChannelId()
|
||||
}
|
||||
if (this.isLogin && parseInt(options.channelId) > 0) {
|
||||
silenceBindingChannelId()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
let currentUrl = window.location.href;
|
||||
|
@ -513,14 +515,14 @@
|
|||
// this.getip()
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 首页记录ip
|
||||
getip(){
|
||||
logoip().then(res => {
|
||||
|
||||
// 获取IP地址
|
||||
getipdz(){
|
||||
getip().then(res => {
|
||||
console.log(res,111)
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
menusTap(url) {
|
||||
goPage().then(res => {
|
||||
if (url == '/pages/goods_cate/goods_cate') {
|
||||
|
|
|
@ -386,8 +386,7 @@
|
|||
uid: this.$store.getters.uid
|
||||
}
|
||||
getidentity(data).then(res=>{
|
||||
// console.log(res.data)
|
||||
if (res.message == '操作成功') {
|
||||
if (res.message == '操作成功' && res.data != '') {
|
||||
this.realname = '已实名'
|
||||
this.identification = res.data
|
||||
}
|
||||
|
|
|
@ -145,8 +145,9 @@
|
|||
if (code && this.options.scope !== 'snsapi_base') {
|
||||
let spread = app.globalData.spread ? app.globalData.spread : 0;
|
||||
|
||||
let channelId = app.globalData.channelId ? app.globalData.channelId : 0;
|
||||
//公众号授权登录回调 wechatAuth(code, Cache.get("spread"), loginType)
|
||||
wechat.auth(code, spread).then(res => {
|
||||
wechat.auth(code, spread,channelId).then(res => {
|
||||
if (res.type === 'register') {
|
||||
this.authKey = res.key;
|
||||
this.isUp = true
|
||||
|
@ -251,6 +252,7 @@
|
|||
let userInfo = {};
|
||||
userInfo.code = code;
|
||||
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
|
||||
userInfo.channelId = app.globalData.channelId; //渠道ID
|
||||
userInfo.avatar = '';
|
||||
userInfo.nickName = '微信用户';
|
||||
userInfo.type = 'routine'
|
||||
|
@ -266,6 +268,7 @@
|
|||
let userInfo = res.userInfo;
|
||||
userInfo.code = code;
|
||||
userInfo.spread_spid = app.globalData.spread; //获取推广人ID
|
||||
userInfo.channelId = app.globalData.channelId; //渠道ID
|
||||
userInfo.avatar = userInfo.userInfo.avatarUrl;
|
||||
userInfo.city = userInfo.userInfo.city;
|
||||
userInfo.country = userInfo.userInfo.country;
|
||||
|
@ -305,6 +308,9 @@
|
|||
if (app.globalData.spread) {
|
||||
spread(app.globalData.spread).then(res => {}) //登录成功后读取spread绑定分销关系
|
||||
}
|
||||
if (app.globalData.channelId) {
|
||||
channelId(app.globalData.channelId).then(res => {}) //登录成功后读取渠道绑定关系
|
||||
}
|
||||
self.$util.Tips({
|
||||
title: res,
|
||||
icon: 'success'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
|
||||
import { spread } from "@/api/user";
|
||||
import { spread,channel } from "@/api/user";
|
||||
import Cache from "@/utils/cache";
|
||||
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() {
|
||||
return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user