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;
}) })
......
...@@ -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