去除无用log;修改H5端登录无法重定向的问题
This commit is contained in:
@ -108,7 +108,6 @@
|
|||||||
// this.posterData.code,
|
// this.posterData.code,
|
||||||
// fail: function(res) {},
|
// fail: function(res) {},
|
||||||
// success: function(res) {
|
// success: function(res) {
|
||||||
// console.log(res);
|
|
||||||
// that.canvasStatus = true;
|
// that.canvasStatus = true;
|
||||||
// that.posterImage = res.tempFilePath;
|
// that.posterImage = res.tempFilePath;
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
|
@ -274,7 +274,6 @@ export function wechatEvevt(name, config) {
|
|||||||
let wx;
|
let wx;
|
||||||
let configDefault = {
|
let configDefault = {
|
||||||
fail(res) {
|
fail(res) {
|
||||||
console.log(res);
|
|
||||||
if (wx) return reject({ is_ready: true, wx: wx });
|
if (wx) return reject({ is_ready: true, wx: wx });
|
||||||
getWechatConfig().then(res => {
|
getWechatConfig().then(res => {
|
||||||
wechatObj.signSignature({
|
wechatObj.signSignature({
|
||||||
|
@ -276,6 +276,7 @@
|
|||||||
this.getBargainHelpCount();
|
this.getBargainHelpCount();
|
||||||
},
|
},
|
||||||
openAlone: function () {
|
openAlone: function () {
|
||||||
|
debugger
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/detail/" + this.bargain.productId
|
path: "/detail/" + this.bargain.productId
|
||||||
});
|
});
|
||||||
@ -305,6 +306,8 @@
|
|||||||
} else {
|
} else {
|
||||||
that.bargainPartake = parseInt(this.partake);
|
that.bargainPartake = parseInt(this.partake);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debugger;
|
||||||
that.getBargainHelpCountStart();
|
that.getBargainHelpCountStart();
|
||||||
that.getBargainDetail();
|
that.getBargainDetail();
|
||||||
that.getBargainShare(0);
|
that.getBargainShare(0);
|
||||||
@ -343,6 +346,7 @@
|
|||||||
goPoster: function () {
|
goPoster: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
that.getBargainShare(that.bargainId);
|
that.getBargainShare(that.bargainId);
|
||||||
|
debugger
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/activity/Poster/index",
|
path: "/pages/activity/Poster/index",
|
||||||
query: {
|
query: {
|
||||||
@ -352,6 +356,7 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
goList: function () {
|
goList: function () {
|
||||||
|
debugger
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/activity/GoodsBargain/index"
|
path: "/pages/activity/GoodsBargain/index"
|
||||||
});
|
});
|
||||||
@ -524,6 +529,7 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
debugger
|
||||||
debugger
|
debugger
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: "/pages/activity/DargainDetails/index",
|
path: "/pages/activity/DargainDetails/index",
|
||||||
|
@ -27,7 +27,7 @@ export default {
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
cId: 0,
|
id: 0,
|
||||||
img: '',
|
img: '',
|
||||||
title: '',
|
title: '',
|
||||||
info: '',
|
info: '',
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="group-box">
|
<view class="group-box">
|
||||||
<view class="goods-item" v-for="(groupon, index) in grouponList" :key="groupon.id">
|
<view class="goods-item" v-for="(groupon, index) in grouponList" :key="groupon.id">
|
||||||
<activity-card :cId="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image"
|
<activity-card :id="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image"
|
||||||
:price="groupon.price" :productPrice="groupon.productPrice">
|
:price="groupon.price" :productPrice="groupon.productPrice">
|
||||||
<block slot="tag">
|
<block slot="tag">
|
||||||
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
|
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
|
||||||
|
@ -207,7 +207,6 @@ export default {
|
|||||||
console.log(item);
|
console.log(item);
|
||||||
setAdminOrderDelivery(item)
|
setAdminOrderDelivery(item)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res);
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
|
@ -593,7 +593,7 @@
|
|||||||
//选择属性;
|
//选择属性;
|
||||||
ChangeAttr: function (res) {
|
ChangeAttr: function (res) {
|
||||||
// 修改了规格
|
// 修改了规格
|
||||||
console.log(res);
|
|
||||||
let productSelect = this.productValue[res.value];
|
let productSelect = this.productValue[res.value];
|
||||||
if (productSelect) {
|
if (productSelect) {
|
||||||
this.attr.productAttr[res.indexw].index = res.indexn;
|
this.attr.productAttr[res.indexw].index = res.indexn;
|
||||||
@ -754,10 +754,10 @@
|
|||||||
configAppMessage
|
configAppMessage
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
})
|
})
|
||||||
.catch((res) => {
|
.catch((res) => {
|
||||||
console.log(res);
|
|
||||||
if (res.is_ready) {
|
if (res.is_ready) {
|
||||||
res.wx.updateAppMessageShareData(configAppMessage);
|
res.wx.updateAppMessageShareData(configAppMessage);
|
||||||
res.wx.updateTimelineShareData(configAppMessage);
|
res.wx.updateTimelineShareData(configAppMessage);
|
||||||
@ -776,10 +776,10 @@
|
|||||||
configAppMessage
|
configAppMessage
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
})
|
})
|
||||||
.catch((res) => {
|
.catch((res) => {
|
||||||
console.log(res);
|
|
||||||
if (res.is_ready) {
|
if (res.is_ready) {
|
||||||
res.wx.updateAppMessageShareData(configAppMessage);
|
res.wx.updateAppMessageShareData(configAppMessage);
|
||||||
res.wx.updateTimelineShareData(configAppMessage);
|
res.wx.updateTimelineShareData(configAppMessage);
|
||||||
|
@ -165,7 +165,6 @@
|
|||||||
rechar_id: that.rechar_id,
|
rechar_id: that.rechar_id,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
var data = res.data.data;
|
var data = res.data.data;
|
||||||
weappPay(res.data.data)
|
weappPay(res.data.data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -228,7 +228,6 @@
|
|||||||
iv: e.mp.detail.iv
|
iv: e.mp.detail.iv
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res);
|
|
||||||
// this.User();
|
// this.User();
|
||||||
thit.$store.dispatch("userInfo", true);
|
thit.$store.dispatch("userInfo", true);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
142
utils/index.js
142
utils/index.js
@ -335,68 +335,96 @@ export const handleGetUserInfo = () => {
|
|||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
console.log('获取用户信息')
|
console.log('获取用户信息')
|
||||||
store.dispatch('setUserInfo', res.data)
|
store.dispatch('setUserInfo', res.data)
|
||||||
var pages = getCurrentPages() //获取加载的页面
|
|
||||||
|
|
||||||
var currentPage = pages[pages.length - 1] //获取当前页面的对象
|
console.log('获取用户信息后跳转回显的页面')
|
||||||
let url = "/pages/home/index"
|
|
||||||
let query = {}
|
let redirect = cookie.get('redirect')
|
||||||
if (currentPage) {
|
|
||||||
const {
|
|
||||||
redirect,
|
|
||||||
...querys
|
|
||||||
} = currentPage.options
|
|
||||||
// 获取到最后一个页面
|
|
||||||
if (
|
|
||||||
currentPage.route != 'pages/Loading/index' &&
|
|
||||||
currentPage.route != 'pages/user/Login/index'
|
|
||||||
) {
|
|
||||||
url = currentPage.route
|
|
||||||
query = {
|
|
||||||
...querys
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (currentPage.route == 'pages/authorization/index') {
|
|
||||||
|
|
||||||
url = redirect
|
if (redirect) {
|
||||||
query = {
|
|
||||||
...querys
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
console.log(url)
|
|
||||||
if (url == '/pages/home/index' || url == '/pages/shop/GoodsClass/index' || url == '/pages/shop/ShoppingCart/index' || url == '/pages/user/User/index') {
|
|
||||||
switchTab({
|
|
||||||
path: `${url}`,
|
|
||||||
query
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.log('获取用户信息后跳转回显的页面')
|
|
||||||
// 为了防止返回上一页是授权页面,先重定向到首页,再跳转
|
|
||||||
console.log({
|
|
||||||
path: `/${url}`,
|
|
||||||
query
|
|
||||||
})
|
|
||||||
reLaunch({
|
reLaunch({
|
||||||
path: '/pages/home/index',
|
path: redirect,
|
||||||
// query
|
// query
|
||||||
});
|
});
|
||||||
|
return
|
||||||
setTimeout(() => {
|
|
||||||
if (url.indexOf('/') == 0) {
|
|
||||||
url = url.slice(1)
|
|
||||||
}
|
|
||||||
push({
|
|
||||||
path: `/${url}`,
|
|
||||||
query
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// push({
|
|
||||||
// path: `${url}`,
|
|
||||||
// query
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reLaunch({
|
||||||
|
path: '/pages/home/index',
|
||||||
|
// query
|
||||||
|
});
|
||||||
|
|
||||||
|
// var pages = getCurrentPages() //获取加载的页面
|
||||||
|
// debugger
|
||||||
|
// var currentPage = pages[pages.length - 1] //获取当前页面的对象
|
||||||
|
// let url = "/pages/home/index"
|
||||||
|
// let query = {}
|
||||||
|
// if (currentPage) {
|
||||||
|
// const {
|
||||||
|
// redirect,
|
||||||
|
// ...querys
|
||||||
|
// } = currentPage.options
|
||||||
|
// // 获取到最后一个页面
|
||||||
|
// if (
|
||||||
|
// currentPage.route != 'pages/Loading/index' &&
|
||||||
|
// currentPage.route != 'pages/user/Login/index'
|
||||||
|
// ) {
|
||||||
|
// url = currentPage.route
|
||||||
|
// query = {
|
||||||
|
// ...querys
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (currentPage.route == 'pages/authorization/index') {
|
||||||
|
|
||||||
|
// url = redirect
|
||||||
|
// query = {
|
||||||
|
// ...querys
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// console.log(url)
|
||||||
|
// if (url == '/pages/home/index' || url == '/pages/shop/GoodsClass/index' || url == '/pages/shop/ShoppingCart/index' || url == '/pages/user/User/index') {
|
||||||
|
// switchTab({
|
||||||
|
// path: `${url}`,
|
||||||
|
// query
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// let redirect = cookie.get('redirect')
|
||||||
|
// debugger
|
||||||
|
// if (redirect) {
|
||||||
|
|
||||||
|
// reLaunch({
|
||||||
|
// path: redirect,
|
||||||
|
// // query
|
||||||
|
// });
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// console.log('获取用户信息后跳转回显的页面')
|
||||||
|
// // 为了防止返回上一页是授权页面,先重定向到首页,再跳转
|
||||||
|
// console.log({
|
||||||
|
// path: `/${url}`,
|
||||||
|
// query
|
||||||
|
// })
|
||||||
|
// reLaunch({
|
||||||
|
// path: '/pages/home/index',
|
||||||
|
// // query
|
||||||
|
// });
|
||||||
|
|
||||||
|
// setTimeout(() => {
|
||||||
|
// if (url.indexOf('/') == 0) {
|
||||||
|
// url = url.slice(1)
|
||||||
|
// }
|
||||||
|
// push({
|
||||||
|
// path: `/${url}`,
|
||||||
|
// query
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// // push({
|
||||||
|
// // path: `${url}`,
|
||||||
|
// // query
|
||||||
|
// // })
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -613,7 +641,6 @@ export function routerPermissions(url, type) {
|
|||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
// 如果不是小程序跳转到登录页
|
// 如果不是小程序跳转到登录页
|
||||||
console.log('当前无法自动登录,开始处理登录方法')
|
|
||||||
push({
|
push({
|
||||||
path: '/pages/user/Login/index',
|
path: '/pages/user/Login/index',
|
||||||
})
|
})
|
||||||
@ -962,7 +989,6 @@ export function chooseImage(callback) {
|
|||||||
},
|
},
|
||||||
name: "file",
|
name: "file",
|
||||||
success: res => {
|
success: res => {
|
||||||
console.log(res);
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(JSON.parse(res.data).link)
|
callback(JSON.parse(res.data).link)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user