Commit 6bb656bc by 柳士祥

Merge branch 'nativehome_tst' of http://code.mayi888.com/chengmo/mayi-mp-shop into nativehome_tst

parents 2a0a5690 cc2df63b
...@@ -38,9 +38,24 @@ export default { ...@@ -38,9 +38,24 @@ export default {
showHideWrap : false, showHideWrap : false,
}; };
}, },
created(){ computed:{
globalDataShopInfo() {
return this.mpApp.globalData.shopInfo;
}
},
watch:{
globalDataShopInfo:{
handler(){
this.shopInfo = this.mpApp.globalData.shopInfo this.shopInfo = this.mpApp.globalData.shopInfo
this.shopInfo.logoUrl = DFSImg(this.shopInfo.logoUrl, 400, 400) this.shopInfo.logoUrl = DFSImg(this.shopInfo.logoUrl, 400, 400)
console.log(this.shopInfo,'this.shopInfo')
},
immediate: true,
}
},
created(){
// this.shopInfo = this.mpApp.globalData.shopInfo
// this.shopInfo.logoUrl = DFSImg(this.shopInfo.logoUrl, 400, 400)
console.log(this.shopInfo,'mpapp123') console.log(this.shopInfo,'mpapp123')
if(wx.getStorageSync('workBox')){ if(wx.getStorageSync('workBox')){
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
tabbar tabbar
--> -->
<template> <template>
<div> <div v-if="showPage">
<web-view :src="pageUrl" @error="handleError"></web-view> <web-view :src="pageUrl" @error="handleError"></web-view>
<div style="width: 100%;height: 90vh;display: flex;justify-content: center;align-items: center;" <div style="width: 100%;height: 90vh;display: flex;justify-content: center;align-items: center;"
> >
...@@ -33,7 +33,8 @@ export default { ...@@ -33,7 +33,8 @@ export default {
params: "?mixid=" + this.$store.state.mixid, params: "?mixid=" + this.$store.state.mixid,
ss: "", ss: "",
timestamp:"", timestamp:"",
isMiniPage : false isMiniPage : false,
showPage : true,
}; };
}, },
computed: { computed: {
...@@ -51,6 +52,7 @@ export default { ...@@ -51,6 +52,7 @@ export default {
}, },
}, },
onLoad(options) { onLoad(options) {
console.log('--onLoad')
let tabIndex = this.index>=this.mpApp.globalData.footerVal.componentData.list.length?this.mpApp.globalData.footerVal.componentData.list.length-1:this.index; let tabIndex = this.index>=this.mpApp.globalData.footerVal.componentData.list.length?this.mpApp.globalData.footerVal.componentData.list.length-1:this.index;
this.params = this.$options.data.call(this).params this.params = this.$options.data.call(this).params
let ss = wx.getStorageSync("sessionid"); let ss = wx.getStorageSync("sessionid");
...@@ -85,6 +87,18 @@ export default { ...@@ -85,6 +87,18 @@ export default {
} }
} }
}, },
onShow(){
console.log('--onShow--')
// 重载页面
let reloadTabbarPage = wx.getStorageSync("reloadTabbarPage") || 0;
if(reloadTabbarPage == 1){
this.showPage = false;
setTimeout(() => {
this.showPage = true;
}, 0);
wx.removeStorageSync("reloadTabbarPage");
}
},
methods: { methods: {
handleError(data) { handleError(data) {
wx.showLoading({ wx.showLoading({
......
...@@ -176,7 +176,8 @@ wx.onAppRoute(res => { ...@@ -176,7 +176,8 @@ wx.onAppRoute(res => {
let currentPage = getCurrentPages() let currentPage = getCurrentPages()
// let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath // let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath
new Promise((resolve) => { new Promise((resolve) => {
if (!spokesmanId) { // 冬奥会不调用分销接口
if (!spokesmanId && Store.state.mixid != 'CL') {
// 获取当前分销员 id // 获取当前分销员 id
spokesman.getSpokesmanidByShare().then(res => { spokesman.getSpokesmanidByShare().then(res => {
if (res.data.data.spokesmanId) { spokesmanId = res.data.data.spokesmanId } if (res.data.data.spokesmanId) { spokesmanId = res.data.data.spokesmanId }
......
...@@ -382,8 +382,11 @@ export default { ...@@ -382,8 +382,11 @@ export default {
this.themeColor = res this.themeColor = res
} }
} }
// 不是冬奥会项目不调用此接口
if(this.$store.state.mixid !='CL'){
// 新人有礼弹窗 // 新人有礼弹窗
this.newUserFun(); this.newUserFun();
}
}, },
onShow() { onShow() {
// 设置显示条件 // 设置显示条件
...@@ -396,7 +399,10 @@ export default { ...@@ -396,7 +399,10 @@ export default {
link:linkVal, link:linkVal,
}); });
} }
// 不是冬奥会项目不调用此接口
if(this.$store.state.mixid !='CL'){
this.getCartNum(); this.getCartNum();
}
if(checkTabbarPage('/')!=-1){ if(checkTabbarPage('/')!=-1){
this.active=checkTabbarPage('/') this.active=checkTabbarPage('/')
...@@ -521,7 +527,10 @@ export default { ...@@ -521,7 +527,10 @@ export default {
return JSON.stringify(pageData); return JSON.stringify(pageData);
}, },
init(pageList) { init(pageList) {
// 不是冬奥会项目不调用此接口
if(this.$store.state.mixid !='CL'){
this.getCartNum(); this.getCartNum();
}
this.active=checkTabbarPage('/'); this.active=checkTabbarPage('/');
this.setVisible(this.mpApp.globalData.pageList,(res)=>{ this.setVisible(this.mpApp.globalData.pageList,(res)=>{
this.pageInfo = res; this.pageInfo = res;
...@@ -859,7 +868,8 @@ export default { ...@@ -859,7 +868,8 @@ export default {
let newHref = '/pages/home/main'; let newHref = '/pages/home/main';
let title = app.globalData.shopInfo.shopName; let title = app.globalData.shopInfo.shopName;
let hasInvitationStatus = 0; let hasInvitationStatus = 0;
if(wx.getStorageSync("sessionid")) { // 不是冬奥会项目不调用此接口
if(wx.getStorageSync("sessionid") && this.$store.state.mixid !='CL') {
await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{ await app.fenxiaoModel.getSpokesmanidByShare().then(data=>{
hasInvitationStatus = data.hasInvitationStatus; hasInvitationStatus = data.hasInvitationStatus;
}) })
......
...@@ -71,14 +71,14 @@ export default { ...@@ -71,14 +71,14 @@ export default {
pageUrl(n,o) { pageUrl(n,o) {
//埋点未登录时进入文章 //埋点未登录时进入文章
// this.params+='&articleId=111' // this.params+='&articleId=111'
log.info(wx.getStorageSync("sessionid"),3333333,this.pageUrl) log.info('watch-pageUrl-sessionid',wx.getStorageSync("sessionid"))
log.info('watch-pageUrl-pageUrl',this.pageUrl)
if(!wx.getStorageSync("sessionid")&&this.pageUrl.indexOf('articleId')!=-1) { if(!wx.getStorageSync("sessionid")&&this.pageUrl.indexOf('articleId')!=-1) {
// wx.setStorageSync('articleId',true) // wx.setStorageSync('articleId',true)
var vars = this.pageUrl.split("&"); var vars = this.pageUrl.split("&");
log.info(vars,2222) log.info('watch-pageUrl.split("&")',vars)
for (var i = 0; i < vars.length; i++) { for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("="); var pair = vars[i].split("=");
log.info(pair,1111)
if (pair[0] == 'articleId') { if (pair[0] == 'articleId') {
wx.setStorageSync(this.$store.state.mixid+'articleId',pair[1]) wx.setStorageSync(this.$store.state.mixid+'articleId',pair[1])
} }
...@@ -92,15 +92,15 @@ export default { ...@@ -92,15 +92,15 @@ export default {
if (this.pageUrl.split('unionId=')[1]) { if (this.pageUrl.split('unionId=')[1]) {
unionId = this.pageUrl.split('unionId=')[1].split('&')[0] unionId = this.pageUrl.split('unionId=')[1].split('&')[0]
} }
indexApi.addRecord( let addRecordQuery = {
{
attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'), attractingCustomersChannelId: wx.getStorageSync('attractingCustomerChannelId'),
miniOpenId: openId, miniOpenId: openId,
unionId: unionId, unionId: unionId,
registerFlag: 1, registerFlag: 1,
newRegisterFlag: 0, newRegisterFlag: 0,
} }
).then(ele=>{ indexApi.addRecord(addRecordQuery).then(ele=>{
log.info('watch-pageUrl-addRecord',addRecordQuery,ele)
if (ele.data.data) { if (ele.data.data) {
//清空引客渠道id //清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId',''); wx.setStorageSync('attractingCustomerChannelId','');
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
this.code = res.code; this.code = res.code;
log.info(this.code,'-----------------------------110---code') log.info(this.code,'-----------------------------110---code')
login.get_open_id_by_code({ code: this.code}).then(res1 => { login.get_open_id_by_code({ code: this.code}).then(res1 => {
log.info('onLoad-api:get_open_id_by_code',this.code,res1)
if (res1.data.code == 200) { if (res1.data.code == 200) {
wx.setStorage({ wx.setStorage({
key: "openid", key: "openid",
...@@ -156,8 +157,10 @@ export default { ...@@ -156,8 +157,10 @@ export default {
this.checkLogin(); this.checkLogin();
this.options = options; this.options = options;
if (options.share) { if (options.share) {
log.info('options.share',options.share)
//来自分享 //来自分享
this.link = decodeURIComponent(options.share); this.link = decodeURIComponent(options.share);
log.info('options.share-link',this.link)
this.spokesmanGroupId = this.spokesmanGroupId =
getQueryVariable(this.link, "spokesmanGroupId") || ""; getQueryVariable(this.link, "spokesmanGroupId") || "";
this.spokesmanShopId = this.spokesmanShopId =
...@@ -166,11 +169,13 @@ export default { ...@@ -166,11 +169,13 @@ export default {
this.userId = getQueryVariable(this.link, "userId") || ""; this.userId = getQueryVariable(this.link, "userId") || "";
if (this.spokesmanGroupId != "") { if (this.spokesmanGroupId != "") {
//上级分销员信息 //上级分销员信息
this.$store.commit("setSpokesman", { let spokesmanInfo = {
spokesmanGroupId: this.spokesmanGroupId, spokesmanGroupId: this.spokesmanGroupId,
spokesmanShopId: this.spokesmanShopId, spokesmanShopId: this.spokesmanShopId,
spokesmanRelId: this.spokesmanRelId spokesmanRelId: this.spokesmanRelId
}); }
log.info('options.share-上级分销员信息',spokesmanInfo)
this.$store.commit("setSpokesman", spokesmanInfo);
} }
this.page = ""; this.page = "";
this.params = ""; this.params = "";
...@@ -193,6 +198,7 @@ export default { ...@@ -193,6 +198,7 @@ export default {
} }
options.params && (this.params += "&" + serialize(decodeURIComponent(options.params))); options.params && (this.params += "&" + serialize(decodeURIComponent(options.params)));
} else if (options.from && options.from == "themeLink") { } else if (options.from && options.from == "themeLink") {
log.info('options.from == "themeLink"')
// 多主题link // 多主题link
this.page = decodeURIComponent(options.backpath); this.page = decodeURIComponent(options.backpath);
this.params += "&" + decodeURIComponent(options.params); this.params += "&" + decodeURIComponent(options.params);
...@@ -201,10 +207,12 @@ export default { ...@@ -201,10 +207,12 @@ export default {
this.page = decodeURIComponent(options.backpath); this.page = decodeURIComponent(options.backpath);
this.params += "&" + serialize(options.params); this.params += "&" + serialize(options.params);
} else if (options.from && options.from == "login") { } else if (options.from && options.from == "login") {
log.info('options.from == "login"')
//来自小程序登录页面 //来自小程序登录页面
this.page = decodeURIComponent(options.backpath); this.page = decodeURIComponent(options.backpath);
this.params += "&" + decodeURIComponent(options.params); this.params += "&" + decodeURIComponent(options.params);
} else if (options.from && options.from == "logout") { } else if (options.from && options.from == "logout") {
log.info('options.from == "logout"')
//来自用户登出 //来自用户登出
wx.removeStorage({ wx.removeStorage({
key: "sessionid" key: "sessionid"
...@@ -213,34 +221,37 @@ export default { ...@@ -213,34 +221,37 @@ export default {
key: "openid" key: "openid"
}); });
} else if (options.from && options.from == "address") { } else if (options.from && options.from == "address") {
log.info('options.from == "address"')
// 来自小程序地址页面 // 来自小程序地址页面
this.link = decodeURIComponent(options.backpath); this.link = decodeURIComponent(options.backpath);
log.info("adress", options.backpath, this.link); log.info("adress", options.backpath, this.link);
this.page = ""; this.page = "";
this.params = ""; this.params = "";
} else if (options.from == "wxPay") { } else if (options.from == "wxPay") {
log.info('options.from == "wxPay"')
//来自支付页面 //来自支付页面
this.page = options.backpath; this.page = options.backpath;
this.params += "&" + serialize(options.params); this.params += "&" + serialize(options.params);
} else if (options.scene) { } else if (options.scene) {
log.info(options) log.info('options.scene',options)
log.info(222222)
if(options.scene.indexOf('_') == -1){ if(options.scene.indexOf('_') == -1){
log.info("新版本(scene参数)分享进入")
this.withoutScene = false; this.withoutScene = false;
//新二维码扫码进入 //新二维码扫码进入
wx.nextTick(() => { wx.nextTick(() => {
indexApi.getShareSceneRecord(options.scene).then(res=>{ indexApi.getShareSceneRecord(options.scene).then(res=>{
this.withoutScene = true; this.withoutScene = true;
log.info('getShareSceneRecord',res)
if(res.data.code == '200'){ if(res.data.code == '200'){
this.page = res.data.data.pageUri; this.page = res.data.data.pageUri;
let paramsObj = JSON.parse(res.data.data.scene); let paramsObj = JSON.parse(res.data.data.scene);
wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId); wx.setStorageSync('attractingCustomerChannelId',paramsObj.attractingCustomerChannelId);
wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId); wx.setStorageSync(this.$store.state.mixid+'storeId',paramsObj.storeId);
wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId); wx.setStorageSync(this.$store.state.mixid+'sellerId',paramsObj.sellerId);
log.info(res.data.data)
wx.login({ wx.login({
success: res => { success: res => {
login.get_open_id_by_code({ code: res.code}).then(res1 => { login.get_open_id_by_code({ code: res.code}).then(res1 => {
log.info('get_open_id_by_code',res1)
if (res1.data.code == 200) { if (res1.data.code == 200) {
wx.setStorageSync({ wx.setStorageSync({
key: "openid", key: "openid",
...@@ -249,14 +260,14 @@ export default { ...@@ -249,14 +260,14 @@ export default {
log.info('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。') log.info('判断是否登录过=登陆过直接调用..未登录过需要授权头像昵称信息。')
if (wx.getStorageSync('sessionid')) { if (wx.getStorageSync('sessionid')) {
log.info('已登陆了') log.info('已登陆了')
indexApi.addRecord( let addRecordQuery = {
{
attractingCustomersChannelId: paramsObj.attractingCustomerChannelId, attractingCustomersChannelId: paramsObj.attractingCustomerChannelId,
miniOpenId: res1.data.data, miniOpenId: res1.data.data,
registerFlag: 1, registerFlag: 1,
newRegisterFlag: 0, newRegisterFlag: 0,
} };
).then(ele=>{ indexApi.addRecord(addRecordQuery).then(ele=>{
log.info('addRecord',addRecordQuery,ele)
if (ele.data.data) { if (ele.data.data) {
//清空引客渠道id //清空引客渠道id
wx.setStorageSync('attractingCustomerChannelId',''); wx.setStorageSync('attractingCustomerChannelId','');
...@@ -288,6 +299,7 @@ export default { ...@@ -288,6 +299,7 @@ export default {
}); });
}else { }else {
log.info('老版本分享(下划线拼接参数)')
//来自扫码 //来自扫码
// options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene // options 中的scene需要使用decodeURIComponent才能获取到生成二维码时传入的scene
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数 var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
...@@ -408,7 +420,7 @@ export default { ...@@ -408,7 +420,7 @@ export default {
let getOpenid = wx.getStorageSync("openid"); let getOpenid = wx.getStorageSync("openid");
let getSessionid = wx.getStorageSync("sessionid"); let getSessionid = wx.getStorageSync("sessionid");
log.info('244',getOpenid,getSessionid); log.info('methods-checkLogin',getOpenid,getSessionid);
if (getOpenid == "" || getSessionid == "") { if (getOpenid == "" || getSessionid == "") {
// this.params += "&logOut=true"; // this.params += "&logOut=true";
} }
...@@ -430,6 +442,7 @@ export default { ...@@ -430,6 +442,7 @@ export default {
}, },
async getSpokesman() { async getSpokesman() {
await spokesman.getSpokesmanidByShare().then(res => { await spokesman.getSpokesmanidByShare().then(res => {
log.info('onShareAppMessage-getSpokesmanidByShare',res)
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.hasInvitationStatus == 1) { if (res.data.data.hasInvitationStatus == 1) {
this.hasInvitationStatus = 1; this.hasInvitationStatus = 1;
...@@ -445,7 +458,7 @@ export default { ...@@ -445,7 +458,7 @@ export default {
}else{ }else{
this.newHref=""; this.newHref="";
} }
log.info(this.newHref, "this.newHrefthis.newHrefthis.newHref"); log.info('onShareAppMessage-getSpokesmanidByShare',this.newHref);
} }
}); });
}, },
...@@ -460,7 +473,7 @@ export default { ...@@ -460,7 +473,7 @@ export default {
//右上角分享时触发 //右上角分享时触发
getMessage(res) { getMessage(res) {
let len = res.target.data.length - 1; let len = res.target.data.length - 1;
log.info(res, "h5消息", res.target.data[len]); log.info('右上角分享触发',res, res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || ""; this.shareShopName = res.target.data[len].shareShopName || "";
this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400); this.shareLogoUrl = DFSImg(res.target.data[len].shareLogoUrl, 500, 400);
...@@ -468,7 +481,7 @@ export default { ...@@ -468,7 +481,7 @@ export default {
this.shareOrderSn = res.target.data[len].orderSn; this.shareOrderSn = res.target.data[len].orderSn;
this.shareTid = res.target.data[len].shareTid; this.shareTid = res.target.data[len].shareTid;
this.newWindowHref = res.target.data[len].shareImgUrl + '&verifyShare=1';// + '&fromVisitorOpenId=' + wx.getStorageSync("openid") this.newWindowHref = res.target.data[len].shareImgUrl + '&verifyShare=1';// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
log.info("分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref); log.info("getMessage-分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref);
//文章详情分享埋点 //文章详情分享埋点
if(this.newWindowHref.indexOf('articleId')!=-1) { if(this.newWindowHref.indexOf('articleId')!=-1) {
var articleId = '' var articleId = ''
...@@ -490,6 +503,7 @@ export default { ...@@ -490,6 +503,7 @@ export default {
log.info('网页加载成功'); log.info('网页加载成功');
}, },
handleError(data){ handleError(data){
log.info('handleError',data)
wx.showLoading({ wx.showLoading({
title: "网页加载失败 请右上角刷新" title: "网页加载失败 请右上角刷新"
}); });
...@@ -553,6 +567,7 @@ export default { ...@@ -553,6 +567,7 @@ export default {
log.info("卸载----------------", this.options); log.info("卸载----------------", this.options);
}, },
async onShareAppMessage(res) { async onShareAppMessage(res) {
log.info('onShareAppMessage',res)
await this.getSpokesman(); await this.getSpokesman();
let url = '' let url = ''
log.info(this.newWindowHref + 'this.newWindowHref') log.info(this.newWindowHref + 'this.newWindowHref')
...@@ -584,7 +599,7 @@ export default { ...@@ -584,7 +599,7 @@ export default {
} }
log.info(this.shareUrl, "index12"); log.info('onShareAppMessage-shareUrl',this.shareUrl,);
log.info(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关') log.info(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
return { return {
title: this.shareShopName, // 默认是小程序的名称 title: this.shareShopName, // 默认是小程序的名称
......
...@@ -117,8 +117,9 @@ export default { ...@@ -117,8 +117,9 @@ export default {
}) })
}, },
onLoad(options) { onLoad(options) {
log.info(options,'----------------------login-options') log.info(options,'----------------------login-onload-options')
login.getShopUserProtocol().then(res => { login.getShopUserProtocol().then(res => {
log.info('获取用户协议',res)
if(res.data.code == '200') { if(res.data.code == '200') {
this.content = res.data.data; this.content = res.data.data;
} }
...@@ -157,6 +158,7 @@ export default { ...@@ -157,6 +158,7 @@ export default {
this.logoUrl = wx.getStorageSync("logoUrl"); this.logoUrl = wx.getStorageSync("logoUrl");
if (!(this.shopName && this.logoUrl)) { if (!(this.shopName && this.logoUrl)) {
shop.getShopInfo().then(res => { shop.getShopInfo().then(res => {
log.info('获取商城信息',res)
if (res.data.code == 200) { if (res.data.code == 200) {
this.shopName = res.data.data.shopName; this.shopName = res.data.data.shopName;
this.logoUrl = process.env.IMG_DOMAIN + res.data.data.logoUrl; this.logoUrl = process.env.IMG_DOMAIN + res.data.data.logoUrl;
...@@ -176,15 +178,18 @@ export default { ...@@ -176,15 +178,18 @@ export default {
init() { init() {
let _this = this; let _this = this;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login let query = {
.miniLogin({ code: this.code, code: this.code,
spokesmanRelId : '', spokesmanRelId : '',
spokesmanGroupId : '', spokesmanGroupId : '',
spokesmanShopId : '', spokesmanShopId : '',
nickname: _this.wxUserInfo.nickName, nickname: _this.wxUserInfo.nickName,
headImgUrl: _this.wxUserInfo.avatarUrl headImgUrl: _this.wxUserInfo.avatarUrl
}) };
login
.miniLogin(query)
.then(res => { .then(res => {
log.info('/wx/mini_login',query,res)
if (res.data.code == 200) { if (res.data.code == 200) {
resolve(res); resolve(res);
} else { } else {
...@@ -197,9 +202,9 @@ export default { ...@@ -197,9 +202,9 @@ export default {
}); });
}, },
addRecord(flag) { addRecord(flag) {
log.info(wx.getStorageSync('attractingCustomerChannelId')) log.info('attractingCustomerChannelId',wx.getStorageSync('attractingCustomerChannelId'))
log.info(this.openid) log.info('openid',this.openid)
log.info(99999) log.info('addRecord',flag)
//埋点引客渠道 //埋点引客渠道
if(wx.getStorageSync('attractingCustomerChannelId')) { if(wx.getStorageSync('attractingCustomerChannelId')) {
indexApi.addRecord( indexApi.addRecord(
...@@ -211,6 +216,7 @@ export default { ...@@ -211,6 +216,7 @@ export default {
newRegisterFlag: flag?1:0,//1是新注册用户 newRegisterFlag: flag?1:0,//1是新注册用户
} }
).then(ele=>{ ).then(ele=>{
log.info('addRecord',res)
if (ele.data.data) { if (ele.data.data) {
wx.setStorageSync('attractingCustomerChannelId','') wx.setStorageSync('attractingCustomerChannelId','')
} }
...@@ -218,6 +224,7 @@ export default { ...@@ -218,6 +224,7 @@ export default {
} }
}, },
getUserProfile() { getUserProfile() {
log.info('点击了微信一键登录');
let _this = this; let _this = this;
if(this.content&&!this.checked) { if(this.content&&!this.checked) {
wx.showToast({ wx.showToast({
...@@ -236,6 +243,7 @@ export default { ...@@ -236,6 +243,7 @@ export default {
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (e) => { success: (e) => {
_this.wxUserInfo = e.userInfo; _this.wxUserInfo = e.userInfo;
log.info('获取wx.getUserProfile用户信息',_this.wxUserInfo);
this.init() this.init()
.then(res => { .then(res => {
//存入openid //存入openid
...@@ -302,6 +310,7 @@ export default { ...@@ -302,6 +310,7 @@ export default {
}); });
}, },
fail: (e) => { fail: (e) => {
log.info('wx.getUserProfile-fail',e)
wx.hideLoading() wx.hideLoading()
} }
}) })
...@@ -320,6 +329,7 @@ export default { ...@@ -320,6 +329,7 @@ export default {
login login
.checkUnionid({ unionId: this.unionId, openId: this.openid }) .checkUnionid({ unionId: this.unionId, openId: this.openid })
.then(res => { .then(res => {
log.info('checkUnionid',res)
wx.hideLoading(); wx.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.isHaveUnion == "true") { if (res.data.data.isHaveUnion == "true") {
...@@ -446,6 +456,10 @@ export default { ...@@ -446,6 +456,10 @@ export default {
}); });
}, },
bindUser() { bindUser() {
wx.showLoading({
title: '绑定中...',
mask: true
})
let query = { let query = {
openId: this.openid, openId: this.openid,
phoneNumber: this.phoneNumber, phoneNumber: this.phoneNumber,
...@@ -469,11 +483,12 @@ export default { ...@@ -469,11 +483,12 @@ export default {
query.spokesmanShopId = this.$store.state.spokesmanShopId; query.spokesmanShopId = this.$store.state.spokesmanShopId;
} }
log.info(query, "query");
login login
.bindUser(query) .bindUser(query)
.then(res => { .then(res => {
//绑定成功 //绑定成功
log.info('bindUser',query,res)
wx.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
wx.setStorageSync(this.$store.state.mixid+'articleId',false) wx.setStorageSync(this.$store.state.mixid+'articleId',false)
this.NEED_CERTIFIED = res.data.data.NEED_CERTIFIED; this.NEED_CERTIFIED = res.data.data.NEED_CERTIFIED;
...@@ -513,6 +528,7 @@ export default { ...@@ -513,6 +528,7 @@ export default {
}); });
}, },
handbindHandle() { handbindHandle() {
log.info('点击手动绑定手机号')
log.info(this.queryOptions,'---------------options') log.info(this.queryOptions,'---------------options')
const query = { const query = {
openId: this.openid, openId: this.openid,
...@@ -526,7 +542,7 @@ export default { ...@@ -526,7 +542,7 @@ export default {
param: this.queryOptions.param, param: this.queryOptions.param,
back: this.queryOptions.back, back: this.queryOptions.back,
}; };
log.info(query,'-------------------519') log.info(query,'handbindHandle-query')
log.info( serialize(query),'------------------- serialize(query)') log.info( serialize(query),'------------------- serialize(query)')
if(wx.getStorageSync(this.$store.state.mixid+'storeId')) { if(wx.getStorageSync(this.$store.state.mixid+'storeId')) {
query.storeId = wx.getStorageSync(this.$store.state.mixid+'storeId') query.storeId = wx.getStorageSync(this.$store.state.mixid+'storeId')
...@@ -546,6 +562,7 @@ export default { ...@@ -546,6 +562,7 @@ export default {
// wx.reLaunch({ // wx.reLaunch({
// url : '/pages/home/main' // url : '/pages/home/main'
// }) // })
log.info('点击暂不登录')
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
}); });
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import index from "@/api/index"; import index from "@/api/index";
const app = getApp();
const { log } = app;
export default { export default {
name: "checkHistory", name: "checkHistory",
data() { data() {
...@@ -62,6 +64,7 @@ export default { ...@@ -62,6 +64,7 @@ export default {
checkOrVerified: 2, checkOrVerified: 2,
}; };
index.getHistoryByVerifier(query).then((res) => { index.getHistoryByVerifier(query).then((res) => {
log.info('getHistoryByVerifier',query,res)
this.loaded = true; this.loaded = true;
wx.hideLoading(); wx.hideLoading();
if (res.data.ok == "true") { if (res.data.ok == "true") {
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
console.log(options.src, "----------22"); console.log(options.src, "----------22");
const device = wx.getSystemInfoSync(); // 获取设备信息 const device = wx.getSystemInfoSync(); // 获取设备信息
const width = device.windowWidth; // 示例为一个与屏幕等宽的正方形裁剪框 const width = device.windowWidth; // 示例为一个与屏幕等宽的正方形裁剪框
const height = device.windowHeight-120; const height = device.windowHeight-200;
let cropperOptions = { let cropperOptions = {
src: "", src: "",
id: "canvasId", id: "canvasId",
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
zoom: 8, // 缩放系数 zoom: 8, // 缩放系数
cut: { cut: {
x: (width - 260) / 2, // 裁剪框x轴起点 x: (width - 260) / 2, // 裁剪框x轴起点
y: (height - 320) / 2, // 裁剪框y轴期起点 y: (height - 300) / 2, // 裁剪框y轴期起点
width: 260, // 裁剪框宽度 width: 260, // 裁剪框宽度
height: 320, // 裁剪框高度 height: 320, // 裁剪框高度
}, },
......
...@@ -93,6 +93,8 @@ ...@@ -93,6 +93,8 @@
import live from "@/api/live"; import live from "@/api/live";
import index from "@/api/index"; import index from "@/api/index";
import { DFSImg } from '@/utils/common.js' import { DFSImg } from '@/utils/common.js'
const app = getApp();
const { log } = app;
export default { export default {
name: "improveInformation", name: "improveInformation",
data() { data() {
...@@ -115,6 +117,7 @@ export default { ...@@ -115,6 +117,7 @@ export default {
}, },
onLoad(options) { onLoad(options) {
console.log("---onLoad"); console.log("---onLoad");
this.init();
}, },
onShow() { onShow() {
console.log("---onShow"); console.log("---onShow");
...@@ -136,6 +139,7 @@ export default { ...@@ -136,6 +139,7 @@ export default {
}); });
this.editImg = false; this.editImg = false;
live.getUserInfo().then(res=>{ live.getUserInfo().then(res=>{
log.info('getUserInfo',res)
wx.hideLoading(); wx.hideLoading();
if(res.data.ok=='true'){ if(res.data.ok=='true'){
this.userInfo = res.data.data; this.userInfo = res.data.data;
...@@ -201,9 +205,10 @@ export default { ...@@ -201,9 +205,10 @@ export default {
if(this.editImg == true) { if(this.editImg == true) {
console.log('----需要修改证件照') console.log('----需要修改证件照')
this.update_info(); this.update_info();
wx.setStorageSync("reloadTabbarPage", 1);
} }
if(getCurrentPages().length>1){ if(getCurrentPages().length>1){
wx.navigateBack(); wx.navigateBack({ delta: 1 });
} else { } else {
wx.reLaunch({ wx.reLaunch({
url: '/pages/home/main' // 指定页面的url url: '/pages/home/main' // 指定页面的url
...@@ -216,6 +221,7 @@ export default { ...@@ -216,6 +221,7 @@ export default {
headPortraitUrl: this.userInfo.headPortraitUrl headPortraitUrl: this.userInfo.headPortraitUrl
} }
index.update_info(query).then(res=>{ index.update_info(query).then(res=>{
log.info('update_info',query,res)
if(res.data.ok == 'true'){} if(res.data.ok == 'true'){}
}) })
}, },
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<image <image
v-else v-else
mode="aspectFill" mode="aspectFill"
src="http://mayi-newshop.oss-cn-shanghai.aliyuncs.com/public/jpeg/9e733736-3e9d-48d1-82a8-96d21ee014df.jpeg" src="http://cdn.mayi888.com/public/png/4660508a-ee25-4872-a3a8-da10a0fbaab1.png"
alt="" alt=""
></image> ></image>
</div> </div>
...@@ -63,6 +63,8 @@ import live from "@/api/live"; ...@@ -63,6 +63,8 @@ import live from "@/api/live";
import index from "@/api/index"; import index from "@/api/index";
import { DFSImg } from "@/utils/common.js"; import { DFSImg } from "@/utils/common.js";
import QRCode from "@/utils/weapp-qrcode.js"; import QRCode from "@/utils/weapp-qrcode.js";
const app = getApp();
const { log } = app;
export default { export default {
name: "showPassCheck", name: "showPassCheck",
data() { data() {
...@@ -141,6 +143,7 @@ export default { ...@@ -141,6 +143,7 @@ export default {
}, },
getQrCode() { getQrCode() {
index.generatorUniqueCodeByDynamic().then((res) => { index.generatorUniqueCodeByDynamic().then((res) => {
log.info('generatorUniqueCodeByDynamic',res)
if (res.data.ok == "true") { if (res.data.ok == "true") {
this.qrCode = res.data.data.uniqueCode; this.qrCode = res.data.data.uniqueCode;
this.updateTime = res.data.data.createDatetime; this.updateTime = res.data.data.createDatetime;
......
...@@ -90,6 +90,8 @@ ...@@ -90,6 +90,8 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import index from "@/api/index"; import index from "@/api/index";
import { DFSImg } from "@/utils/common.js"; import { DFSImg } from "@/utils/common.js";
const app = getApp();
const { log } = app;
export default { export default {
name: "verification", name: "verification",
data() { data() {
...@@ -154,6 +156,7 @@ export default { ...@@ -154,6 +156,7 @@ export default {
this.showInfo = false; this.showInfo = false;
this.loaded = false; this.loaded = false;
index.getInfoByUniqueCode(this.checkText).then((res) => { index.getInfoByUniqueCode(this.checkText).then((res) => {
log.info('getInfoByUniqueCode',this.checkText,res)
wx.hideLoading(); wx.hideLoading();
this.loaded = true; this.loaded = true;
if (res.data.ok == "true" && res.data.data) { if (res.data.ok == "true" && res.data.data) {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div class="text"> <div class="text">
<input <input
type="text" type="text"
maxlength="18" maxlength="255"
class="ipt" class="ipt"
placeholder="请输入身份证号码" placeholder="请输入身份证号码"
@input="input_id_number" @input="input_id_number"
...@@ -78,6 +78,8 @@ ...@@ -78,6 +78,8 @@
<script> <script>
import login from "@/api/login"; import login from "@/api/login";
const app = getApp();
const { log } = app;
export default { export default {
name: "writeInformation", name: "writeInformation",
data() { data() {
...@@ -166,14 +168,14 @@ export default { ...@@ -166,14 +168,14 @@ export default {
next() { next() {
console.log("--下一步--"); console.log("--下一步--");
// this.check_id_number(); // this.check_id_number();
// if (this.idPhoto == "") { if (this.idPhoto == "") {
// wx.showToast({ wx.showToast({
// title: "请上传证件照", title: "请上传证件照",
// icon: "error", icon: "error",
// duration: 1000, duration: 1000,
// }); });
// return; return;
// } }
if (this.name == "") { if (this.name == "") {
wx.showToast({ wx.showToast({
title: "请输入姓名", title: "请输入姓名",
...@@ -200,6 +202,7 @@ export default { ...@@ -200,6 +202,7 @@ export default {
}); });
let query = { customerName: this.name, identityCard: this.idNum }; let query = { customerName: this.name, identityCard: this.idNum };
login.get_certified_info(query).then((res) => { login.get_certified_info(query).then((res) => {
log.info('get_certified_info',query,res)
if (res.data.ok == "true") { if (res.data.ok == "true") {
let infoData = res.data.data; let infoData = res.data.data;
this.mini_certified(infoData); this.mini_certified(infoData);
...@@ -230,6 +233,7 @@ export default { ...@@ -230,6 +233,7 @@ export default {
code: this.code, code: this.code,
}; };
login.mini_certified(query).then((res) => { login.mini_certified(query).then((res) => {
log.info('mini_certified',query,res)
if (res.data.ok == "true") { if (res.data.ok == "true") {
wx.login({ wx.login({
success: (res) => { success: (res) => {
...@@ -242,6 +246,7 @@ export default { ...@@ -242,6 +246,7 @@ export default {
spokesmanShopId: "", spokesmanShopId: "",
}) })
.then((res) => { .then((res) => {
log.info('miniLogin',res)
if (res.data.code == 200 && res.data.data.sessionId) { if (res.data.code == 200 && res.data.data.sessionId) {
wx.showToast({ wx.showToast({
title: "认证通过", title: "认证通过",
...@@ -269,11 +274,17 @@ export default { ...@@ -269,11 +274,17 @@ export default {
}, },
fail: (err) => {}, fail: (err) => {},
}); //重新登录 }); //重新登录
} else {
wx.showToast({
title: res.data.msg,
icon: "none",
duration: 1000,
});
} }
}); });
}, },
input_id_number() { input_id_number() {
let n = this.idNum.match(/\d{0,17}(\d|x)/i); let n = this.idNum.match(/[0-9a-zA-Z]{0,255}/i);
this.idNum = n === null ? "" : n[0]; this.idNum = n === null ? "" : n[0];
// if (this.idNum.length == 18) { // if (this.idNum.length == 18) {
// this.check_id_number(); // this.check_id_number();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment