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