Browse Source

去除无用log;修改H5端登录无法重定向的问题

master
Gaoxs 4 years ago
parent
commit
6a33c4ec80
  1. 1
      components/StorePoster.vue
  2. 1
      libs/wechat.js
  3. 6
      pages/activity/DargainDetails/index.vue
  4. 2
      pages/activity/GoodsGroup/children/activity-card.vue
  5. 2
      pages/activity/GoodsGroup/index.vue
  6. 1
      pages/orderAdmin/GoodsDeliver/index.vue
  7. 10
      pages/shop/GoodsCon/index.vue
  8. 1
      pages/user/Recharge/index.vue
  9. 1
      pages/user/User/index.vue
  10. 140
      utils/index.js

1
components/StorePoster.vue

@ -108,7 +108,6 @@
// this.posterData.code,
// fail: function(res) {},
// success: function(res) {
// console.log(res);
// that.canvasStatus = true;
// that.posterImage = res.tempFilePath;
// uni.hideLoading();

1
libs/wechat.js

@ -274,7 +274,6 @@ export function wechatEvevt(name, config) {
let wx;
let configDefault = {
fail(res) {
console.log(res);
if (wx) return reject({ is_ready: true, wx: wx });
getWechatConfig().then(res => {
wechatObj.signSignature({

6
pages/activity/DargainDetails/index.vue

@ -276,6 +276,7 @@
this.getBargainHelpCount();
},
openAlone: function () {
debugger
this.$yrouter.push({
path: "/detail/" + this.bargain.productId
});
@ -305,6 +306,8 @@
} else {
that.bargainPartake = parseInt(this.partake);
}
debugger;
that.getBargainHelpCountStart();
that.getBargainDetail();
that.getBargainShare(0);
@ -343,6 +346,7 @@
goPoster: function () {
var that = this;
that.getBargainShare(that.bargainId);
debugger
this.$yrouter.push({
path: "/pages/activity/Poster/index",
query: {
@ -352,6 +356,7 @@
});
},
goList: function () {
debugger
this.$yrouter.push({
path: "/pages/activity/GoodsBargain/index"
});
@ -524,6 +529,7 @@
})
.catch(() => {
debugger
debugger
this.$yrouter.push({
path: "/pages/activity/DargainDetails/index",

2
pages/activity/GoodsGroup/children/activity-card.vue

@ -27,7 +27,7 @@ export default {
return {};
},
props: {
cId: 0,
id: 0,
img: '',
title: '',
info: '',

2
pages/activity/GoodsGroup/index.vue

@ -9,7 +9,7 @@
</view>
<view class="group-box">
<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">
<block slot="tag">
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>

1
pages/orderAdmin/GoodsDeliver/index.vue

@ -207,7 +207,6 @@ export default {
console.log(item);
setAdminOrderDelivery(item)
.then(res => {
console.log(res);
uni.showToast({
title: res.msg,
icon: "none",

10
pages/shop/GoodsCon/index.vue

@ -593,7 +593,7 @@
//
ChangeAttr: function (res) {
//
console.log(res);
let productSelect = this.productValue[res.value];
if (productSelect) {
this.attr.productAttr[res.indexw].index = res.indexn;
@ -754,10 +754,10 @@
configAppMessage
)
.then((res) => {
console.log(res);
})
.catch((res) => {
console.log(res);
if (res.is_ready) {
res.wx.updateAppMessageShareData(configAppMessage);
res.wx.updateTimelineShareData(configAppMessage);
@ -776,10 +776,10 @@
configAppMessage
)
.then((res) => {
console.log(res);
})
.catch((res) => {
console.log(res);
if (res.is_ready) {
res.wx.updateAppMessageShareData(configAppMessage);
res.wx.updateTimelineShareData(configAppMessage);

1
pages/user/Recharge/index.vue

@ -165,7 +165,6 @@
rechar_id: that.rechar_id,
})
.then((res) => {
console.log(res);
var data = res.data.data;
weappPay(res.data.data)
.then(() => {

1
pages/user/User/index.vue

@ -228,7 +228,6 @@
iv: e.mp.detail.iv
})
.then(res => {
console.log(res);
// this.User();
thit.$store.dispatch("userInfo", true);
uni.hideLoading();

140
utils/index.js

@ -335,68 +335,96 @@ export const handleGetUserInfo = () => {
getUserInfo().then(res => {
console.log('获取用户信息')
store.dispatch('setUserInfo', res.data)
var pages = getCurrentPages() //获取加载的页面
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('获取用户信息后跳转回显的页面')
let redirect = cookie.get('redirect')
}
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
})
if (redirect) {
reLaunch({
path: '/pages/home/index',
path: redirect,
// query
});
return
}
reLaunch({
path: '/pages/home/index',
// query
});
setTimeout(() => {
if (url.indexOf('/') == 0) {
url = url.slice(1)
}
push({
path: `/${url}`,
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
// }
// }
// push({
// path: `${url}`,
// query
// })
}
// }
// 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 {
// 如果不是小程序跳转到登录页
console.log('当前无法自动登录,开始处理登录方法')
push({
path: '/pages/user/Login/index',
})
@ -962,7 +989,6 @@ export function chooseImage(callback) {
},
name: "file",
success: res => {
console.log(res);
if (callback) {
callback(JSON.parse(res.data).link)
}

Loading…
Cancel
Save