Browse Source

去除多余console

zyh
gaoxs 5 years ago
parent
commit
e08d2a6fa7
  1. 2
      components/CountDown.vue
  2. 1
      components/ProductWindow.vue
  3. 1
      components/PromotionGood.vue
  4. 3
      libs/wechat.js
  5. 3
      main.js
  6. 3
      pages/Loading/index.vue
  7. 1
      pages/activity/GoodsSeckill/index.vue
  8. 1
      pages/activity/GroupDetails/index.vue
  9. 2
      pages/activity/SeckillDetails/index.vue
  10. 2
      pages/home/index.vue
  11. 2
      pages/launch/index.vue
  12. 1
      pages/order/OrderDetails/index.vue
  13. 19
      pages/order/OrderSubmission/index.vue
  14. 4
      pages/shop/GoodsCon/index.vue
  15. 1
      pages/shop/GoodsList/index.vue
  16. 3
      pages/shop/ShoppingCart/index.vue
  17. 1
      pages/user/Login/index.vue
  18. 2
      pages/user/PersonalData/index.vue
  19. 4
      pages/user/User/index.vue
  20. 1
      pages/user/address/AddAddress/index.vue
  21. 3
      pages/user/signIn/Integral/index.vue
  22. 46
      utils/index.js
  23. 2
      utils/request.js

2
components/CountDown.vue

@ -43,7 +43,6 @@ export default {
// this.show_time();
},
mounted: function() {
console.log(this)
this.rtipText = this.$props.tipText;
this.rdayText = this.$props.dayText;
this.rhourText = this.$props.hourText;
@ -51,7 +50,6 @@ export default {
this.rsecondText = this.$props.secondText;
this.rdatatime = this.$props.datatime;
this.risDay = this.$props.isDay;
console.log(this.rdayText)
this.show_time();
},
methods: {

1
components/ProductWindow.vue

@ -66,7 +66,6 @@ export default {
return {};
},
mounted: function() {
console.log(this.attr);
},
methods: {
closeAttr: function() {

1
components/PromotionGood.vue

@ -31,7 +31,6 @@ export default {
}
},
mounted() {
console.log(this, 999);
}
};
</script>

3
libs/wechat.js

@ -1,8 +1,7 @@
// 支付模块
export const weappPay = (option) => {
return new Promise((resolve, reject) => {
// 吊起微信支付
console.log(option,9999)
// 吊起微信支付
uni.requestPayment({
...option,
timeStamp: option.timeStamp + '',

3
main.js

@ -50,7 +50,6 @@ Vue.mixin({
const {
$mp
} = this.$root
console.log($mp)
this._route = parseRoute($mp)
// this.$VUE_APP_RESOURCES_URL = VUE_APP_RESOURCES_URL;
this._data.$VUE_APP_RESOURCES_URL = VUE_APP_RESOURCES_URL;
@ -84,7 +83,6 @@ store.commit('UPDATE_DEVICETYPE','h5')
// #ifdef APP-PLUS
// App平台编译的代码
console.log('App平台编译的代码')
Vue.prototype.$deviceType = 'app'
store.commit('UPDATE_DEVICETYPE','app')
Vue.prototype.$platform = uni.getSystemInfoSync().platform
@ -92,7 +90,6 @@ Vue.prototype.$platform = uni.getSystemInfoSync().platform
// #ifdef MP-WEIXIN
// 微信小程序编译的代码
console.log('微信小程序编译的代码')
Vue.prototype.$deviceType = 'weixin'
store.commit('UPDATE_DEVICETYPE','weixin')
// #endif

3
pages/Loading/index.vue

@ -41,8 +41,6 @@ export default {
this.toLaunch();
return;
}
console.log(this.$store.getters.token, '获取store里面的 token');
console.log(this.$store.getters.userInfo, '获取store里面的 userInfo');
cookie.get("spread");
// this.toLaunch();
if (this.$deviceType == 'app') {
@ -61,7 +59,6 @@ export default {
methods: {
...mapActions(["changeAuthorization", "setUserInfo"]),
toLaunch() {
console.log(this);
this.changeAuthorization(false);
this.$yrouter.switchTab({
path: "/pages/home/index"

1
pages/activity/GoodsSeckill/index.vue

@ -114,7 +114,6 @@ export default {
},
methods: {
changeTime: function(index) {
console.log(index);
this.active = index;
this.getSeckillList();
},

1
pages/activity/GroupDetails/index.vue

@ -235,7 +235,6 @@ export default {
},
mountedStart: function() {
var that = this;
console.log(that);
let id = that.$yroute.query.id;
getCombinationDetail(id).then(res => {
that.userCollect = res.data.userCollect;

2
pages/activity/SeckillDetails/index.vue

@ -199,7 +199,6 @@ export default {
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.attrcartAttr;
} else {
console.log(that.storeInfo);
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
@ -208,7 +207,6 @@ export default {
data.new = 1;
postCartAdd(data)
.then(res => {
console.log(res);
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }

2
pages/home/index.vue

@ -213,7 +213,6 @@ export default {
title: '加载中'
});
getHomeData().then(res => {
console.log(res);
that.logoUrl = res.data.logoUrl;
that.$set(that, 'banner', res.data.banner);
that.$set(that, 'menus', res.data.menus);
@ -246,7 +245,6 @@ export default {
});
},
goGoodsCon(item) {
console.log(item);
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: { id: item.id }

2
pages/launch/index.vue

@ -46,7 +46,6 @@ export default {
},
mounted() {
let type = this.$yroute.query.type;
console.log(2222)
if (type) {
}
@ -54,7 +53,6 @@ export default {
// }
},
onHide() {
console.log("清除状态");
}
};
</script>

1
pages/order/OrderDetails/index.vue

@ -514,7 +514,6 @@ export default {
});
},
goGroupRule(orderInfo) {
console.log(orderInfo)
this.$yrouter.push({
path: "/pages/activity/GroupRule/index",
query: {

19
pages/order/OrderSubmission/index.vue

@ -345,7 +345,6 @@
},
changeUseIntegral: function(e) {
// this.computedPrice();
console.log(e)
this.useIntegral = e.mp.detail.value[0];
},
computedPrice() {
@ -486,22 +485,6 @@
if (this.$deviceType == 'app') {
form.form = 'app'
}
console.log(this.orderGroupInfo.orderKey, {
realName: this.contacts,
phone: this.contactsTel,
addressId: this.addressInfo.id,
useIntegral: this.useIntegral ? 1 : 0,
couponId: this.usableCoupon.id || 0,
payType: this.active,
pinkId: this.pinkId,
seckillId: this.orderGroupInfo.seckill_id,
combinationId: this.orderGroupInfo.combination_id,
bargainId: this.orderGroupInfo.bargain_id,
from: this.from,
mark: this.mark || "",
shippingType: parseInt(shipping_type) + 1,
...form
})
createOrder(this.orderGroupInfo.orderKey, {
realName: this.contacts,
phone: this.contactsTel,
@ -519,7 +502,6 @@
...form
})
.then(res => {
console.log(res)
uni.hideLoading();
const data = res.data;
switch (data.status) {
@ -565,7 +547,6 @@
break;
case "WECHAT_PAY":
weappPay(data.result.jsConfig).then(res => {
console.log(res)
this.$yrouter.replace({
path: "/pages/order/OrderDetails/index",
query: {

4
pages/shop/GoodsCon/index.vue

@ -257,9 +257,7 @@ export default {
},
computed: mapGetters(["isLogin"]),
mounted: function() {
console.log(this);
let url = handleQrCode();
console.log(url);
if (url && url.productId) {
this.id = url.productId;
} else {
@ -329,7 +327,6 @@ export default {
if (this.$deviceType == "app") {
form.form = "app";
}
console.log(form, 2222);
getProductDetail(that.id, form)
.then(res => {
that.$set(that, "storeInfo", res.data.storeInfo);
@ -500,7 +497,6 @@ export default {
},
changeattr: function(msg) {
this.attr.cartAttr = msg;
console.log(this.attr, msg);
this.isOpen = false;
},
//

1
pages/shop/GoodsList/index.vue

@ -177,7 +177,6 @@ export default {
// document.title = this.title || this.$yroute.meta.title;
},
get_product_list() {
console.log("请求李贝奥");
var that = this;
this.setWhere();
// if (to.name !== "GoodsList") return;

3
pages/shop/ShoppingCart/index.vue

@ -193,7 +193,6 @@ export default {
// },
watch: {
userInfo(user) {
console.log(user, '用户信息,8585');
if (user.uid) {
this.carnum();
this.countMoney();
@ -202,7 +201,6 @@ export default {
}
},
token(token) {
console.log(token, '用户token,8585');
if (this.userInfo.uid) {
this.carnum();
this.countMoney();
@ -348,7 +346,6 @@ export default {
});
return;
}
console.log(id);
this.$yrouter.push({
path: '/pages/order/OrderSubmission/index',
query: {

1
pages/user/Login/index.vue

@ -285,7 +285,6 @@
this.current = index;
},
async submit() {
console.log("spread:" + cookie.get("spread"));
const {
account,
password

2
pages/user/PersonalData/index.vue

@ -235,7 +235,7 @@ export default {
})
.catch(err => {});
} else if (res.cancel) {
console.log("用户点击取消");
// console.log("");
}
}
});

4
pages/user/User/index.vue

@ -220,7 +220,6 @@ export default {
this.$yrouter.push("/pages/user/PersonalData/index");
},
getPhoneNumber: function(e) {
console.log(e.mp.detail);
//
if (e.mp.detail.errMsg == "getPhoneNumber:ok") {
uni.showLoading({
@ -230,7 +229,6 @@ export default {
uni.getProvider({
service: "oauth",
success: function(res) {
console.log(res.provider);
// h5
if (res.provider) {
uni.login({
@ -324,8 +322,6 @@ export default {
}
},
onShow() {
console.log(this.$store.getters.token);
console.log(this.userInfo);
if (this.$store.getters.token) {
this.User();
this.MenuUser();

1
pages/user/address/AddAddress/index.vue

@ -133,7 +133,6 @@ export default {
this.address.province = e.labelArr[0] || "";
this.address.city = e.labelArr[1] || "";
this.address.district = e.labelArr[2] || "";
console.log(this.pickerText);
},
getUserAddress: function() {
if (!this.id) return false;

3
pages/user/signIn/Integral/index.vue

@ -131,8 +131,7 @@ export default {
that.loaded = res.data.length < that.where.limit;
that.loadTitle = that.loaded ? "人家是有底线的" : "上拉加载更多";
that.where.page = that.where.page + 1;
that.list.push.apply(that.list, res.data);
console.log(that.list)
that.list.push.apply(that.list, res.data);
},
err => {
uni.showToast({

46
utils/index.js

@ -119,7 +119,6 @@ export const replaceLogin = (msg) => {
});
// 这里代表已经失去登录状态以及401强制推出登录了
store.commit('LOGOUT')
console.log(uni, 989)
if (Vue.prototype.$deviceType == 'weixin') {
// 如果是微信小程序,跳转到授权页
login({
@ -152,7 +151,6 @@ export const getProvider = () => {
uni.getProvider({
service: 'oauth',
success: function (res) {
console.log(`当前环境的服务商为 | ${res.provider}`)
// 此处可以排除h5
if (res.provider) {
resolve(res.provider[0])
@ -185,7 +183,6 @@ export const authorize = (authorizeStr) => {
}
export const login = (option) => {
console.log('调用登录')
return new Promise((resolve, reject) => {
getProvider().then(provider => {
// 调用登录接口
@ -193,16 +190,12 @@ export const login = (option) => {
provider: provider,
success: function (loginRes) {
// 微信登录
console.log(`获取code | ${loginRes.code}`)
let code = loginRes.code;
// 检查授权, 检查用户信息授权
authorize('userInfo').then(() => {
uni.getUserInfo({
provider: provider,
success: function (user) {
console.log(user)
console.log(`用户昵称为 | ${user.userInfo.nickName}`);
console.log(`当前的环境 | ${Vue.prototype.$deviceType}`)
if (Vue.prototype.$deviceType == 'weixin') {
wxappAuth({
encryptedData: user.encryptedData,
@ -212,23 +205,14 @@ export const login = (option) => {
}).then(({
data
}) => {
console.log('登录成功')
console.log(data)
console.log('登录成功1')
resolve(data)
console.log('登录成功3')
uni.hideLoading();
console.log('登录成功4')
store.commit("LOGIN", data.token, dayjs(data.expires_time));
console.log('登录成功5')
console.log(store)
handleGetUserInfo()
}).catch(error => {
reject()
console.log('微信登录失败')
console.log(error)
handleFail(option, '微信登录失败')
});
@ -264,19 +248,13 @@ export const login = (option) => {
}
export const handleGetUserInfo = () => {
console.log('登录后请求用户信息')
getUser().then(res => {
console.log(res.data, '登录后的样式')
store.dispatch('setUserInfo', res.data)
console.log('登录成功6')
var pages = getCurrentPages() //获取加载的页面
console.log('登录成功7')
var currentPage = pages[pages.length - 1] //获取当前页面的对象
let url = "/pages/home/index"
let query = {}
console.log('登录成功8')
console.log(currentPage)
if (currentPage) {
// 获取到最后一个页面
@ -297,11 +275,6 @@ export const handleGetUserInfo = () => {
}
}
}
console.log('登录成功9')
console.log({
path: url,
query
})
if (url == '/pages/home/index' || url == '/pages/shop/GoodsClass/index' || url == '/pages/shop/ShoppingCart/index' || url == '/pages/user/User/index') {
switchTab({
path: `${url}`,
@ -363,7 +336,6 @@ export function auth() {
* userInfo只是用来限时用户信息作用并不是很大
* ps只需要判断 token 是否存在即可
*/
console.log(cookie.get('login_status'), 'token')
if (cookie.get('login_status')) {
return true
}
@ -372,7 +344,6 @@ export function auth() {
export const handleLoginStatus = (location, complete, fail, success) => {
console.log(location, '开始检验权限')
// 不登录可访问的页面
let page = [{
path: '/pages/Loading/index',
@ -405,7 +376,6 @@ export const handleLoginStatus = (location, complete, fail, success) => {
if (!auth()) {
page.map((item) => {
console.log(item.path == path)
if (item.path == path) {
isAuth = true
}
@ -416,14 +386,7 @@ export const handleLoginStatus = (location, complete, fail, success) => {
return new Promise((resolve, reject) => {
if (isAuth) {
console.log('有权限')
// 登录了有权限
console.log({
url: parseUrl(location),
complete,
fail,
success
})
resolve({
url: parseUrl(location),
complete,
@ -431,7 +394,6 @@ export const handleLoginStatus = (location, complete, fail, success) => {
success
})
} else {
console.log('无权限')
// 未登录没有权限
replaceLogin()
reject()
@ -443,7 +405,6 @@ export const handleLoginStatus = (location, complete, fail, success) => {
export function push(location, complete, fail, success) {
handleLoginStatus(location, complete, fail, success).then(params => {
console.log(params)
uni.navigateTo(params)
}).catch(error => {
// 没有权限
@ -453,7 +414,6 @@ export function push(location, complete, fail, success) {
export function replace(location, complete, fail, success) {
handleLoginStatus(location, complete, fail, success).then(params => {
console.log(params)
uni.redirectTo(params)
}).catch(error => {
// 没有权限
@ -476,9 +436,7 @@ export function back() {
}
export function switchTab(location, complete, fail, success) {
console.log(location)
handleLoginStatus(location, complete, fail, success).then(params => {
console.log(params)
uni.switchTab(params)
}).catch(error => {
// 没有权限
@ -529,14 +487,12 @@ const getImageInfo = (images) => {
src: item,
fail: function (res) {
imageAry[index] = null
console.log(res)
if (imageAry.length == images.length) {
resolve(imageAry)
}
},
success: function (res) {
imageAry[index] = res
console.log(res)
if (Object.keys(imageAry).length == images.length) {
resolve(imageAry)
}
@ -562,7 +518,6 @@ export const PosterCanvas = (store, successCallBack) => {
mask: true
});
getImageInfo([store.image, store.code]).then(res => {
console.log(res)
let contentHh = 48 * 1.3
const ctx = uni.createCanvasContext('myCanvas')
ctx.clearRect(0, 0, 0, 0);
@ -591,7 +546,6 @@ export const PosterCanvas = (store, successCallBack) => {
ctx.setTextAlign('center')
ctx.setFontSize(22);
ctx.setFillStyle('#333333');
console.log('长按识别二维码立即购买')
ctx.fillText('长按识别二维码立即购买', WIDTH / 2, 1167);
ctx.save();
ctx.draw(true, () => {

2
utils/request.js

@ -55,8 +55,6 @@ function baseRequest(options) {
return fly.request(url, params || data, {
...option
}).then(res => {
console.log(res)
// console.log(url,params,data, ...option)
const data = res.data || {};
if (res.status !== 200) {
return Promise.reject({ msg: "请求失败", res, data });

Loading…
Cancel
Save