合并冲突

This commit is contained in:
Sliverber 2024-02-27 09:59:51 +08:00
commit a4a29feecb
13 changed files with 154 additions and 101 deletions

View File

@ -359,6 +359,7 @@ export function getinstallment(data) {
}); });
} }
// 到首页查询ip地址
// 首页记录ip // 首页记录ip
export function logoip() { export function logoip() {
@ -367,3 +368,10 @@ export function logoip() {
}); });
} }
// 查询签约是否成功
// export function getqytrue(data) {
// return request.get('order/getSignResult/',data,{
// noAuth: true
// })
// }

View File

@ -23,6 +23,7 @@ export function wechatAuth(code, spread,) {
var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/ var reg=/^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 ,判断正整数用/^[1-9]+[0-9]*]*$/
spread = reg.test(spread) ? spread : 0; spread = reg.test(spread) ? spread : 0;
channelId = reg.test(channelId) ? channelId : 0;
return request.get( return request.get(
"wechat/authorize/login?code=" + code + "&spread_spid=" + spread , {}, "wechat/authorize/login?code=" + code + "&spread_spid=" + spread , {},
{ noAuth: true } { noAuth: true }
@ -31,7 +32,7 @@ export function wechatAuth(code, spread,) {
/** /**
* 获取登录授权login * 获取登录授权login
* *
*/ */
export function getLogo() export function getLogo()
{ {
@ -109,4 +110,4 @@ export function appleLogin(data) {
*/ */
export function iosBinding(data) { export function iosBinding(data) {
return request.post("ios/binding/phone", data, { noAuth : true }); return request.post("ios/binding/phone", data, { noAuth : true });
} }

View File

@ -5,7 +5,7 @@ import Cache from "@/utils/cache.js"
/** /**
* 获取用户信息 * 获取用户信息
* *
*/ */
export function getUserInfo(){ export function getUserInfo(){
return request.get('user'); return request.get('user');
@ -13,7 +13,7 @@ export function getUserInfo(){
/** /**
* 设置用户分享 * 设置用户分享
* *
*/ */
export function userShare(){ export function userShare(){
return request.post('user/share'); return request.post('user/share');
@ -83,7 +83,7 @@ export function postSignUser(sign) {
/** /**
* 获取签到配置 * 获取签到配置
* *
*/ */
export function getSignConfig(){ export function getSignConfig(){
return request.get('user/sign/config') return request.get('user/sign/config')
@ -107,7 +107,7 @@ export function setSignIntegral(){
/** /**
* 签到列表(年月) * 签到列表(年月)
* @param object data * @param object data
* *
*/ */
export function getSignMonthList(data){ export function getSignMonthList(data){
return request.get('user/sign/month',data) return request.get('user/sign/month',data)
@ -115,7 +115,7 @@ export function getSignMonthList(data){
/** /**
* 活动状态 * 活动状态
* *
*/ */
export function userActivity(){ export function userActivity(){
return request.get('user/activity'); return request.get('user/activity');
@ -136,7 +136,7 @@ export function getRecordApi(q) {
} }
/* /*
* 提现总金额 * 提现总金额
* */ * */
export function getCountApi() { export function getCountApi() {
return request.get("extract/totalMoney"); return request.get("extract/totalMoney");
@ -151,7 +151,7 @@ export function getIntegralList(q) {
/** /**
* 获取分销海报图片 * 获取分销海报图片
* *
*/ */
export function spreadBanner(data){ export function spreadBanner(data){
return request.get('user/spread/banner',data); return request.get('user/spread/banner',data);
@ -167,7 +167,7 @@ export function spreadPeople(data){
} }
/** /**
* *
* 推广佣金/提现总和 * 推广佣金/提现总和
* @param int type * @param int type
*/ */
@ -184,7 +184,7 @@ export function getSpreadInfo() {
/** /**
* *
* 推广订单 * 推广订单
* @param object data * @param object data
*/ */
@ -216,7 +216,7 @@ export function extractCash(data){
/** /**
* 提现银行/提现最低金额 * 提现银行/提现最低金额
* *
*/ */
export function extractBank(){ export function extractBank(){
return request.get('extract/bank'); return request.get('extract/bank');
@ -224,7 +224,7 @@ export function extractBank(){
/** /**
* 会员等级列表 * 会员等级列表
* *
*/ */
export function userLevelGrade(){ export function userLevelGrade(){
return request.get('user/level/grade'); return request.get('user/level/grade');
@ -240,14 +240,14 @@ export function userLevelTask(id){
/** /**
* 检查用户是否可以成为会员 * 检查用户是否可以成为会员
* *
*/ */
export function userLevelDetection(){ export function userLevelDetection(){
return request.get('user/level/detection'); return request.get('user/level/detection');
} }
/** /**
* *
* 地址列表 * 地址列表
* @param object data * @param object data
*/ */
@ -274,7 +274,7 @@ export function editAddress(data){
/** /**
* 删除地址 * 删除地址
* @param int id * @param int id
* *
*/ */
export function delAddress(id){ export function delAddress(id){
return request.post('address/del',{id:id}) return request.post('address/del',{id:id})
@ -282,7 +282,7 @@ export function delAddress(id){
/** /**
* 获取单个地址 * 获取单个地址
* @param int id * @param int id
*/ */
export function getAddressDetail(id){ export function getAddressDetail(id){
return request.get('address/detail/'+id); return request.get('address/detail/'+id);
@ -304,7 +304,7 @@ export function getLogout() {
} }
/** /**
* 小程序充值 * 小程序充值
* *
*/ */
export function rechargeRoutine(data){ export function rechargeRoutine(data){
return request.post('recharge/routine',data) return request.post('recharge/routine',data)
@ -339,7 +339,7 @@ export function alipayFull(data) {
/** /**
* 获取默认地址 * 获取默认地址
* *
*/ */
export function getAddressDefault(){ export function getAddressDefault(){
return request.get('address/default'); return request.get('address/default');
@ -400,7 +400,7 @@ export function sendwxcodes(code)
// return request.post('user/wxcode', data); // return request.post('user/wxcode', data);
// } // }
/** /**
// * 静默绑定推广人 // * 静默绑定渠道
// * @param {Object} channelId // * @param {Object} channelId
// */ // */
export function channel(channelId) export function channel(channelId)
@ -410,7 +410,7 @@ export function channel(channelId)
/** /**
* 当前用户在佣金排行第几名 * 当前用户在佣金排行第几名
* *
*/ */
export function brokerageRankNumber(data) export function brokerageRankNumber(data)
{ {
@ -419,7 +419,7 @@ export function brokerageRankNumber(data)
/** /**
* 会员等级经验值 * 会员等级经验值
* *
*/ */
export function getlevelInfo() export function getlevelInfo()
{ {
@ -428,7 +428,7 @@ export function getlevelInfo()
/** /**
* 经验值明细 * 经验值明细
* *
*/ */
export function getlevelExpList(data) export function getlevelExpList(data)
{ {
@ -437,7 +437,7 @@ export function getlevelExpList(data)
/** /**
* 经验值明细 * 经验值明细
* *
*/ */
export function getuserDalance() export function getuserDalance()
{ {
@ -465,7 +465,7 @@ export function computeUser(){
/** /**
* 账单记录 * 账单记录
* *
*/ */
export function getBillList(data) export function getBillList(data)
{ {
@ -498,4 +498,4 @@ export function spreadPeoCount() {
*/ */
export function copyrightApi(){ export function copyrightApi(){
return request.get(`copyright/info`,{},{noAuth:true}); return request.get(`copyright/info`,{},{noAuth:true});
} }

View File

@ -450,12 +450,18 @@
.periodization .returnthedate a { .periodization .returnthedate a {
text-decoration: none; text-decoration: none;
display: block; // display: block;
margin-top: 20rpx; margin-top: 20rpx;
border: 1px solid rgb(255, 87, 51); border: 1px solid rgb(255, 87, 51);
color: #000; 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) { .periodization .returnthedate a:nth-of-type(1) {
width: 198rpx; width: 198rpx;
height: 60rpx; height: 60rpx;

View File

@ -26,12 +26,12 @@ module.exports = {
TIPS_KEY: 'TIPS_KEY', TIPS_KEY: 'TIPS_KEY',
SPREAD: 'SPREAD',
SPREAD: 'SPREAD', CHANNELID: 'CHANNELID',
//缓存经度 //缓存经度
CACHE_LONGITUDE: 'LONGITUDE', CACHE_LONGITUDE: 'LONGITUDE',
//缓存纬度 //缓存纬度
CACHE_LATITUDE: 'LATITUDE', CACHE_LATITUDE: 'LATITUDE',
//app手机信息 //app手机信息
PLATFORM: 'systemPlatform' PLATFORM: 'systemPlatform'
} }

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
}) => { }) => {

12
main.js
View File

@ -29,13 +29,13 @@ import {
} from "./utils"; } from "./utils";
import Auth from './libs/wechat'; import Auth from './libs/wechat';
import { import {
SPREAD SPREAD,CHANNELID
} from './config/cache'; } from './config/cache';
Vue.prototype.$wechat = Auth; Vue.prototype.$wechat = Auth;
let cookieName = "VCONSOLE", let cookieName = "VCONSOLE",
query = parseQuery(), query = parseQuery(),
urlSpread = query["spread"], urlSpread = query["spread"],
urlChannelId = query["channelId"],
vconsole = query[cookieName.toLowerCase()], vconsole = query[cookieName.toLowerCase()],
md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式
md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式
@ -46,7 +46,13 @@ let cookieName = "VCONSOLE",
value: urlSpread, value: urlSpread,
}) })
} }
if (urlChannelId) {
urlChannelId = parseInt(urlChannelId);
Cache.setItem({
name: 'channelId',
value: urlChannelId,
})
}
if (vconsole !== undefined) { if (vconsole !== undefined) {
if (vconsole === md5UnCrmeb && Cache.has(cookieName)) if (vconsole === md5UnCrmeb && Cache.has(cookieName))
Cache.clear(cookieName); Cache.clear(cookieName);

View File

@ -1,6 +1,6 @@
{ {
"name" : "先享后付", "name" : "先享后付",
"appid" : "__UNI__EA8F22D", //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

@ -200,10 +200,10 @@
</button> </button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP --> <!-- #ifndef MP -->
<!-- <view class="item skeleton-rect" @click="onClickService"> <view class="item skeleton-rect" @click="onClickService">
<view class="iconfont icon-kefu"></view> <view class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</view> --> </view>
<!-- #endif --> <!-- #endif -->
<block v-if="type === 'normal'"> <block v-if="type === 'normal'">
<view @click="setCollect" class='item skeleton-rect'> <view @click="setCollect" class='item skeleton-rect'>
@ -252,7 +252,7 @@
@getImg="showImg" @installments="installments"> @getImg="showImg" @installments="installments">
</productWindow> </productWindow>
<couponListWindow :coupon='coupon' :typeNum="couponDeaultType[0].useType" <couponListWindow :coupon='coupon' :typeNum="couponDeaultType[0].useType"
@ChangCouponsClone="ChangCouponsClone" @ChangCoupons="ChangCoupons" @ChangCouponsClone="ChangCouponsClone" @ChangCoupons="ChangCoupons"
@ChangCouponsUseState="ChangCouponsUseState" @tabCouponType="tabCouponType"></couponListWindow> @ChangCouponsUseState="ChangCouponsUseState" @tabCouponType="tabCouponType"></couponListWindow>
<!-- 分享按钮 --> <!-- 分享按钮 -->
<view class="generate-posters" :class="posters ? 'on' : ''"> <view class="generate-posters" :class="posters ? 'on' : ''">
@ -368,8 +368,7 @@
import shareRedPackets from '@/components/shareRedPackets'; import shareRedPackets from '@/components/shareRedPackets';
import cusPreviewImg from '@/components/cus-previewImg/cus-previewImg.vue' import cusPreviewImg from '@/components/cus-previewImg/cus-previewImg.vue'
import { import {
silenceBindingSpread, silenceBindingSpread,silenceBindingChannelId
} from "@/utils"; } from "@/utils";
import parser from "@/components/jyf-parser/jyf-parser"; import parser from "@/components/jyf-parser/jyf-parser";
import { import {
@ -551,6 +550,8 @@
this.getTokenIsExist(); this.getTokenIsExist();
}, },
onLoad(options) { onLoad(options) {
// console.log(JSON.stringify(options),"options.spread")
alert("options.spread"+JSON.stringify(options))
// //
this.$set(this, 'theme', this.$Cache.get('theme')); this.$set(this, 'theme', this.$Cache.get('theme'));
@ -608,7 +609,7 @@
// #endif // #endif
if (options.spread) app.globalData.spread = options.spread; if (options.spread) app.globalData.spread = options.spread;
if (options.channelId) app.globalData.channelId = options.channelId;
this.getGoodsDetails(); // this.getGoodsDetails(); //
this.getCouponType(); // this.getCouponType(); //
@ -647,8 +648,6 @@
title: that.productInfo.storeName || '', title: that.productInfo.storeName || '',
imageUrl: that.productInfo.image || '', imageUrl: that.productInfo.image || '',
path: '/pages/goods_details/index?id=' + that.id + '&spread=' + that.uid, path: '/pages/goods_details/index?id=' + that.id + '&spread=' + that.uid,
} }
}, },
// #endif // #endif
@ -661,11 +660,11 @@
uni.$emit('scroll'); uni.$emit('scroll');
}, },
methods: { methods: {
// //
// //
// getfqList: function() { // getfqList: function() {
// let data = { // let data = {
@ -675,7 +674,7 @@
// } // }
// getfenqilist(data).then(res => { // getfenqilist(data).then(res => {
// this.fenqlist = res.data.list // this.fenqlist = res.data.list
// // localStorage.setItem('fqlist',JSON.stringify(this.fenqlist)) // // localStorage.setItem('fqlist',JSON.stringify(this.fenqlist))
// }) // })
// }, // },
@ -687,7 +686,7 @@
this.getCartCount(true); // this.getCartCount(true); //
// //
if (parseInt(app.globalData.spread) > 0) silenceBindingSpread(); if (parseInt(app.globalData.spread) > 0) silenceBindingSpread();
if (parseInt(app.globalData.channelId) > 0) silenceBindingChannelId();
} }
}); });
}, },
@ -701,8 +700,6 @@
scene: scene, scene: scene,
type: 0, type: 0,
href: `${HTTP_H5_URL}${curRoute}&spread=${that.uid}`, href: `${HTTP_H5_URL}${curRoute}&spread=${that.uid}`,
title: that.productInfo.storeName, title: that.productInfo.storeName,
summary: app.globalData.companyName, summary: app.globalData.companyName,
imageUrl: that.productInfo.image, imageUrl: that.productInfo.image,
@ -754,7 +751,7 @@
}, },
/** /**
* 购物车手动填写 * 购物车手动填写
* *
*/ */
iptCartNum: function(e) { iptCartNum: function(e) {
this.$set(this.attr.productSelect, 'cart_num', e ? e : 1); this.$set(this.attr.productSelect, 'cart_num', e ? e : 1);
@ -796,7 +793,7 @@
that.$set(that.sharePacket, 'touchstart', true); // that.$set(that.sharePacket, 'touchstart', true); //
}, },
/* /*
*去商品详情页 *去商品详情页
*/ */
goDetail(item) { goDetail(item) {
if (!item.activityH5) { if (!item.activityH5) {
@ -839,7 +836,7 @@
}, },
/** /**
* 购物车数量加和数量减 * 购物车数量加和数量减
* *
*/ */
ChangeCartNum: function(changeValue) { ChangeCartNum: function(changeValue) {
//changeValue: | //changeValue: |
@ -871,7 +868,7 @@
}, },
/** /**
* 属性变动赋值 * 属性变动赋值
* *
*/ */
ChangeAttr: function(res) { ChangeAttr: function(res) {
let productSelect = this.productValue[res]; let productSelect = this.productValue[res];
@ -920,7 +917,7 @@
}, },
/** /**
* 优品推荐 * 优品推荐
* *
*/ */
getGoods() { getGoods() {
getProductGood().then(res => { getProductGood().then(res => {
@ -955,7 +952,7 @@
}, },
/** /**
* 获取产品详情 * 获取产品详情
* *
*/ */
getGoodsDetails: function() { getGoodsDetails: function() {
let that = this; let that = this;
@ -1075,7 +1072,7 @@
}, },
/** /**
* 默认选中属性 * 默认选中属性
* *
*/ */
DefaultSelect: function() { DefaultSelect: function() {
let productAttr = this.attr.productAttr; let productAttr = this.attr.productAttr;
@ -1128,7 +1125,7 @@
}, },
/** /**
* 获取优惠券 * 获取优惠券
* *
*/ */
getCouponList(type) { getCouponList(type) {
let that = this; let that = this;
@ -1183,9 +1180,9 @@
that.$set(that.coupon, 'list', that.coupon.list); that.$set(that.coupon, 'list', that.coupon.list);
that.$set(that.coupon, 'coupon', false); that.$set(that.coupon, 'coupon', false);
}, },
/** /**
* *
* *
* 收藏商品 * 收藏商品
*/ */
setCollect: function() { setCollect: function() {
@ -1232,7 +1229,7 @@
}, },
/** /**
* 打开属性加入购物车 * 打开属性加入购物车
* *
*/ */
joinCart: function(e) { joinCart: function(e) {
// //
@ -1319,7 +1316,7 @@
/** /**
* 立即购买 * 立即购买
*/ */
goBuy: Debounce(function(e) { goBuy: Debounce(function(e) {
if (this.isLogin === false) { if (this.isLogin === false) {
toLogin(); toLogin();
} else { } else {
@ -1344,7 +1341,7 @@
}, },
/** /**
* 分享打开 * 分享打开
* *
*/ */
listenerActionSheet: function() { listenerActionSheet: function() {
if (this.isLogin === false) { if (this.isLogin === false) {
@ -1431,7 +1428,6 @@
} }
}) })
}, },
getImageBase64: function(images) { getImageBase64: function(images) {
let that = this; let that = this;
imageBase64({ imageBase64({
@ -1584,8 +1580,7 @@
let data = this.productInfo; let data = this.productInfo;
let href = location.href; let href = location.href;
if (this.$wechat.isWeixin()) { 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 = { let configAppMessage = {
desc: app.globalData.companyName, desc: app.globalData.companyName,
title: data.storeName, title: data.storeName,
@ -2538,7 +2533,7 @@
border-radius: 8rpx; border-radius: 8rpx;
text-align: center; text-align: center;
} }
</style> </style>

View File

@ -170,6 +170,7 @@
setCouponReceive, setCouponReceive,
getTheme, getTheme,
getAppVersion, getAppVersion,
getip
} from '@/api/api.js'; } from '@/api/api.js';
import { import {
spread, spread,
@ -182,7 +183,7 @@
} from '@/api/api.js'; } from '@/api/api.js';
// #endif // #endif
// #ifdef H5 // #ifdef H5
import { import {
follow follow
} from '@/api/public.js'; } from '@/api/public.js';
@ -213,7 +214,7 @@
getGroomList getGroomList
} from '@/api/store.js'; } from '@/api/store.js';
import { import {
silenceBindingSpread, silenceBindingSpread,silenceBindingChannelId,
getCityList getCityList
} from '@/utils'; } from '@/utils';
import animationType from '@/utils/animationType.js' import animationType from '@/utils/animationType.js'
@ -446,11 +447,10 @@
let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene)); let qrCodeValue = this.$util.getUrlParams(decodeURIComponent(options.scene));
let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue); let mapeMpQrCodeValue = this.$util.formatMpQrCodeData(qrCodeValue);
app.globalData.spread = mapeMpQrCodeValue.spread; app.globalData.spread = mapeMpQrCodeValue.spread;
app.globalData.channelId = mapeMpQrCodeValue.channelId;
} }
if (options.spread) app.globalData.spread = options.spread; //urlidglobalDta if (options.spread) app.globalData.spread = options.spread; //urlidglobalDta
if (options.channelId) app.globalData.channelId = options.channelId; //urlidglobalDta
// #endif // #endif
// #ifndef MP || APP-PLUS // #ifndef MP || APP-PLUS
this.navH = 0; this.navH = 0;
@ -462,10 +462,12 @@
if (this.isLogin && parseInt(app.globalData.spread) > 0) { if (this.isLogin && parseInt(app.globalData.spread) > 0) {
silenceBindingSpread() silenceBindingSpread()
} }
if (this.isLogin && parseInt(app.globalData.channelId) > 0) {
silenceBindingChannelId()
// ip }
// this.getip() if (this.isLogin && parseInt(options.channelId) > 0) {
silenceBindingChannelId()
}
}, },
onShow() { onShow() {
let currentUrl = window.location.href; let currentUrl = window.location.href;
@ -513,14 +515,14 @@
// this.getip() // this.getip()
}, },
methods: { methods: {
// IP
// ip getipdz(){
getip(){ getip().then(res => {
logoip().then(res => { console.log(res,111)
}) })
}, },
menusTap(url) { menusTap(url) {
goPage().then(res => { goPage().then(res => {
if (url == '/pages/goods_cate/goods_cate') { if (url == '/pages/goods_cate/goods_cate') {
@ -695,7 +697,7 @@
appVersionConfig(){ appVersionConfig(){
var that = this; var that = this;
//app //app
// //
getAppVersion().then(res => { getAppVersion().then(res => {
that.$set(that.appUpdate, 'androidAddress', res.data.androidAddress); that.$set(that.appUpdate, 'androidAddress', res.data.androidAddress);
that.$set(that.appUpdate, 'appVersion', res.data.appVersion); that.$set(that.appUpdate, 'appVersion', res.data.appVersion);
@ -1359,4 +1361,4 @@
height: 344rpx; height: 344rpx;
@include index-gradient(theme); @include index-gradient(theme);
} }
</style> </style>

View File

@ -386,8 +386,7 @@
uid: this.$store.getters.uid uid: this.$store.getters.uid
} }
getidentity(data).then(res=>{ getidentity(data).then(res=>{
// console.log(res.data) if (res.message == '操作成功' && res.data != '') {
if (res.message == '操作成功') {
this.realname = '已实名' this.realname = '已实名'
this.identification = res.data this.identification = res.data
} }

View File

@ -31,7 +31,7 @@
class='iconfont icon-weixin2' v-if="false"></text>手机号快捷登录</button> class='iconfont icon-weixin2' v-if="false"></text>手机号快捷登录</button>
<button v-if="routinePhoneVerification == 2 || routinePhoneVerification.length===3" hover-class="none" <button v-if="routinePhoneVerification == 2 || routinePhoneVerification.length===3" hover-class="none"
@click="onUserPhone('isPhone')" class="btn2">手动绑定手机号</button> @click="onUserPhone('isPhone')" class="btn2">手动绑定手机号</button>
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>
@ -74,7 +74,7 @@
data() { data() {
return { return {
isUp: false, // isUp: false, //
phone: '', phone: '',
statusBarHeight: statusBarHeight, statusBarHeight: statusBarHeight,
isHome: false, isHome: false,
isPhoneBox: false, // isPhoneBox: false, //
@ -145,8 +145,9 @@
if (code && this.options.scope !== 'snsapi_base') { if (code && this.options.scope !== 'snsapi_base') {
let spread = app.globalData.spread ? app.globalData.spread : 0; let spread = app.globalData.spread ? app.globalData.spread : 0;
let channelId = app.globalData.channelId ? app.globalData.channelId : 0;
// wechatAuth(code, Cache.get("spread"), loginType) // wechatAuth(code, Cache.get("spread"), loginType)
wechat.auth(code, spread).then(res => { wechat.auth(code, spread,channelId).then(res => {
if (res.type === 'register') { if (res.type === 'register') {
this.authKey = res.key; this.authKey = res.key;
this.isUp = true this.isUp = true
@ -251,6 +252,7 @@
let userInfo = {}; let userInfo = {};
userInfo.code = code; userInfo.code = code;
userInfo.spread_spid = app.globalData.spread; //广ID userInfo.spread_spid = app.globalData.spread; //广ID
userInfo.channelId = app.globalData.channelId; //ID
userInfo.avatar = ''; userInfo.avatar = '';
userInfo.nickName = '微信用户'; userInfo.nickName = '微信用户';
userInfo.type = 'routine' userInfo.type = 'routine'
@ -266,6 +268,7 @@
let userInfo = res.userInfo; let userInfo = res.userInfo;
userInfo.code = code; userInfo.code = code;
userInfo.spread_spid = app.globalData.spread; //广ID userInfo.spread_spid = app.globalData.spread; //广ID
userInfo.channelId = app.globalData.channelId; //ID
userInfo.avatar = userInfo.userInfo.avatarUrl; userInfo.avatar = userInfo.userInfo.avatarUrl;
userInfo.city = userInfo.userInfo.city; userInfo.city = userInfo.userInfo.city;
userInfo.country = userInfo.userInfo.country; userInfo.country = userInfo.userInfo.country;
@ -305,6 +308,9 @@
if (app.globalData.spread) { if (app.globalData.spread) {
spread(app.globalData.spread).then(res => {}) //spread spread(app.globalData.spread).then(res => {}) //spread
} }
if (app.globalData.channelId) {
channelId(app.globalData.channelId).then(res => {}) //
}
self.$util.Tips({ self.$util.Tips({
title: res, title: res,
icon: 'success' icon: 'success'
@ -457,4 +463,4 @@
height: 50rpx; height: 50rpx;
} }
} }
</style> </style>

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';
@ -11,7 +11,7 @@ import { getCity } from '@/api/api.js';
export function silenceBindingSpread() { export function silenceBindingSpread() {
//#ifdef H5 //#ifdef H5
let puid = Cache.get('spread'); let puid = Cache.get('spread');
//#endif //#endif
//#ifdef MP || APP-PLUS //#ifdef MP || APP-PLUS
let puid = getApp().globalData.spread; let puid = getApp().globalData.spread;
//#endif //#endif
@ -25,7 +25,7 @@ export function silenceBindingSpread() {
//#ifdef H5 //#ifdef H5
Cache.clear("spread"); Cache.clear("spread");
//#endif //#endif
//#ifdef MP || APP-PLUS //#ifdef MP || APP-PLUS
getApp().globalData.spread = 0; getApp().globalData.spread = 0;
//#endif //#endif
@ -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;
} }