作者 wumengyu

注释掉console

... ... @@ -39,23 +39,23 @@ App({
return new Promise(function (resolve, reject) {
wx.getUserInfo({
success: function (user) {
console.log('获取用户信息', user);// gender:性别 0:未知、1:男、2:女
// console.log('获取用户信息', user);// gender:性别 0:未知、1:男、2:女
// 登录
let url = '/portal/Login/getToken';
wx.login({
success: function (res) {
if (self.loginCallback) {
console.log('onlaunch-callback');
// console.log('onlaunch-callback');
self.loginCallback(user)
}
console.log('获取code', res);
// console.log('获取code', res);
self.post(url, {
code: res.code,
user_nickname: user.userInfo.nickName,
avatar: user.userInfo.avatarUrl,
sex: user.userInfo.gender,
}, {}).then((ret) => {
console.log('获取token', ret);
// console.log('获取token', ret);
wx.setStorageSync('token', ret.data.token);
self.globalData.userInfo = user.userInfo;
resolve(ret.data);
... ... @@ -111,10 +111,10 @@ App({
if (+res.data.code == 1) {
resolve(res.data);
} else if (res.data.code == '20000') {
console.log('20000');
// console.log('20000');
resolve(res.data.data);
} else if (res.data.data.code == '10001') { //未获取授权
console.log('10001');
// console.log('10001');
wx.showModal({
title: '提示',
content: res.data.data.msg,
... ... @@ -130,8 +130,8 @@ App({
});
resolve(res.data.data);
} else if (+res.data.code === 0) {
console.log('code=0');
console.log(res.data);
// console.log('code=0');
// console.log(res.data);
wx.showModal({
title: '提示',
content: res.data.message,
... ... @@ -177,15 +177,15 @@ App({
let H = (hours > 9 ? hours : ('0' + hours)) + ':' + (minutes > 9 ? minutes : ('0' + minutes));
// let time = [];
// time.push(H);
console.log('time', H);
// console.log('time', H);
// let new_time = time.join(' ');
return H;
},
//获取截止时间的前几个小时
preTime(over_time, n) {
console.log('over_time', over_time);
// console.log('over_time', over_time);
var time = new Date(new Date(over_time).getTime() - n * 60 * 60 * 1000);
console.log('time', time);
// console.log('time', time);
var y = time.getFullYear(),
m = time.getMonth() + 1,
d = time.getDate(),
... ... @@ -195,7 +195,7 @@ App({
d = d < 10 ? '0' + d : d;
h = h < 10 ? '0' + h : h;
mi = mi < 10 ? '0' + mi : mi;
console.log('截止时间', time, m, d, h, mi);
// console.log('截止时间', time, m, d, h, mi);
return y + '-' + m + '-' + d + ' ' + h + ':' + mi;
},
timeFormat(param) { //小于10的格式化函数
... ...
... ... @@ -8,7 +8,7 @@ Page({
data: {},
//获取授权
login(e) {
console.log('e', e);
// console.log('e', e);
let url = '/portal/Login/getToken';
wx.login({
success: function (res) {
... ...
... ... @@ -32,7 +32,7 @@ Page({
keyword:self.data.searchValue,
};
app.post(url, params, header).then((res) => {
console.log('搜索历史列表', res);
// console.log('搜索历史列表', res);
// wx.hideLoading();
if(+res.code === 1) {
if(res.data.length === 0) {
... ... @@ -69,7 +69,7 @@ Page({
const self = this;
let url = '/portal/Index/cityList';
app.post(url, {}, {}).then((res) => {
console.log('获取城市列表', res);
// console.log('获取城市列表', res);
if (+res.code === 1) {
const arr = [];
res.data.list.forEach((item) => {
... ... @@ -93,7 +93,7 @@ Page({
token: wx.getStorageSync('token'),
};
app.post(url, params, {}).then((res) => {
console.log('获取国外列表', res);
// console.log('获取国外列表', res);
if (+res.code === 1) {
const arr = [];
res.data.forEach((item) => {
... ... @@ -113,7 +113,7 @@ Page({
const lat = this.data.cityList[current].latng.split(',')[1];
const lng = this.data.cityList[current].latng.split(',')[0];
const addr = this.data.cityList[current].title;
console.log('addr', addr);
// console.log('addr', addr);
this.setData({current_city:current});
wx.setStorageSync('lat',lat);
wx.setStorageSync('lng',lng);
... ...
... ... @@ -61,7 +61,7 @@ Page({
this.setData({show_gold_modal: false, show_normal_modal: false,is_showResult:false});
try {
wx.removeStorageSync('score');
console.log('删除后score', wx.getStorageSync('score'));
// console.log('删除后score', wx.getStorageSync('score'));
} catch (e) {
// Do something when catch error
}
... ... @@ -100,7 +100,6 @@ Page({
disableScroll() {
},
handleBackground() {
console.log('dianji');
this.setData({
is_showAnswer: false,
is_showUserInfo: false,
... ... @@ -150,7 +149,7 @@ Page({
},
//进入拼餐详情
goMealDetail(e) {
console.log('拼餐详情e', e);
// console.log('拼餐详情e', e);
const id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/meal/detail/detail?id=' + id,
... ... @@ -158,7 +157,7 @@ Page({
},
//进入拼活动详情
goActivityDetail(e) {
console.log('活动详情e', e);
// console.log('活动详情e', e);
const id = e.detail.activity_id;
wx.navigateTo({
url: '/pages/activity/detail/detail?id=' + id,
... ... @@ -171,7 +170,7 @@ Page({
})
},
bannerChange(e) {
console.log(e, 'current', current);
// console.log(e, 'current', current);
const current = e.detail.current;
this.setData({currentBannerIndex: current})
},
... ... @@ -190,7 +189,7 @@ Page({
_doRefreshMasonry(items) {
this.masonryListComponent = this.selectComponent('#masonry');
this.masonryListComponent.start(items).then(() => {
console.log('refresh completed')
// console.log('refresh completed')
})
},
... ... @@ -198,7 +197,7 @@ Page({
this.masonryListComponent = this.selectComponent('#masonry');
// 获取接口数据后使用瀑布流组件append方法,当append完成后调用then,是否可触底价在的标志位可以在这里处理
this.masonryListComponent.append(items).then(() => {
console.log('refresh completed,加载更多')
// console.log('refresh completed,加载更多')
})
},
//首页-导航
... ... @@ -206,10 +205,10 @@ Page({
var tindex = e.currentTarget.dataset.tindex;
var tabcurrent = this.data.tabcurrent.tab;
if (tabcurrent == tindex) {
console.log('点击本页');
// console.log('点击本页');
return false
} else {
console.log('其他页');
// console.log('其他页');
this.setData({
tabcurrent: tindex
})
... ... @@ -239,7 +238,7 @@ Page({
},
//发布按钮
release(e) {
console.log('发布', app.globalData.isLogin);
// console.log('发布', app.globalData.isLogin);
const self = this;
// self.setData({
// is_showAnswer: true, //弹出 去答题弹框
... ... @@ -266,7 +265,7 @@ Page({
is_showRelease: false,
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 1 && wx.getStorageSync('is_answer') === 1) { //已填写且可以发布 =>去发布
console.log('可以发布');
// console.log('可以发布');
self.setData({
is_showRelease: true //弹出 发布弹框
});
... ... @@ -331,25 +330,25 @@ Page({
// },
getPosition() {
const self = this;
console.log('2获取当前经纬度');
// console.log('2获取当前经纬度');
wx.getLocation({ //获取当前经纬度
type: 'wgs84', //返回可以用于wx.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息
success: function (res) {
console.log('获取当前经纬度', res);
// console.log('获取当前经纬度', res);
self.setData({lat: res.latitude, lng: res.longitude});
// app.loginCallback();
// app.loginCallback = res => {
// console.log('show-callback-res', res);
app.getLogin().then(function (res) {
console.log('res', res);
console.log('1');
// console.log('res', res);
// console.log('1');
self.getIndex(res.token);//获取首页
self.getIsWrite(); //判断是否已填写个人信息
});
// };
},
fail: function (res) {
console.log('定位失败', res)
// console.log('定位失败', res)
console.log('重新调起授权,获取当前城市');
wx.getSetting({
success: (res) => {
... ... @@ -407,17 +406,17 @@ Page({
//获取经纬度
getLat() {
const self = this;
console.log('没有经纬度', wx.getStorageSync('lat') === '');
// console.log('没有经纬度', wx.getStorageSync('lat') === '');
if (wx.getStorageSync('lat') !== '' &&
wx.getStorageSync('lng') !== '' &&
wx.getStorageSync('addr') !== '') {
return
} else {
console.log('1获取当前经纬度');
// console.log('1获取当前经纬度');
self.getPosition()
}
// wx.setStorageSync('score',30);
console.log('score', wx.getStorageSync('score'));
// console.log('score', wx.getStorageSync('score'));
if (wx.getStorageSync('score') !== '' && wx.getStorageSync('score') >= 80) {
self.setData({show_gold_modal: true,});
} else if (wx.getStorageSync('score') !== '' && wx.getStorageSync('score') < 80) {
... ... @@ -426,7 +425,7 @@ Page({
},
//获取首页内容
getIndex(res) {
console.log('token', res, wx.getStorageSync('token'));
// console.log('token', res, wx.getStorageSync('token'));
const self = this;
let url = '/portal/Index/index';
let params = {
... ... @@ -440,7 +439,7 @@ Page({
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('获取首页', res);
// console.log('获取首页', res);
if (+res.code === 1) {
wx.hideLoading();
self.setData({
... ... @@ -452,7 +451,7 @@ Page({
items: res.data.active,
is_canSend: res.data.is_canSend,
});
console.log('meal',res.data.meal);
// console.log('meal',res.data.meal);
wx.setStorageSync('is_canSend', res.data.is_canSend);//1:可以发布2:不可以发布
wx.setStorageSync('is_answer', res.data.is_answer);//1:已答题2:未答题
// is_answer
... ... @@ -472,7 +471,7 @@ Page({
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('是否填写个人信息', res);
// console.log('是否填写个人信息', res);
if (+res.code === 1) {
self.setData({
is_write: res.data.is_write,//1:已填写2:未填写
... ... @@ -497,7 +496,7 @@ Page({
if (wx.getStorageSync('lat') !== '' &&
wx.getStorageSync('lng') !== '' &&
wx.getStorageSync('addr') !== '') {
console.log('已选择城市');
// console.log('已选择城市');
this.setData({
is_city_change: true,
lat: wx.getStorageSync('lat'),
... ... @@ -521,7 +520,7 @@ Page({
// name: "",
// address: ""
// })
console.log('index-show-isLogin', wx.getStorageSync('isLogin'));
// console.log('index-show-isLogin', wx.getStorageSync('isLogin'));
// console.log(app.globalData.userInfo);
},
onPageScroll(e) {
... ...
... ... @@ -15,7 +15,7 @@ Page({
token: wx.getStorageSync('token'),
};
app.post(url, {}, {}).then((res) => {
console.log('获取推荐列表', res);
// console.log('获取推荐列表', res);
if (+res.code === 1) {
var article = res.data.content;
WxParse.wxParse('article', 'html', article, self, 5);
... ...
... ... @@ -22,7 +22,7 @@ Page({
},
//选择性别
sexPickerChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
// console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
current_sex: e.detail.value,
is_sex_change: true
... ... @@ -38,18 +38,18 @@ Page({
if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){
wx.showToast({title:'手机号格式错误',icon:'none'});
this.setData({is_wrong_phone:true,phone_number_params:''});
console.log('params', this.data.phone_number_params);
// console.log('params', this.data.phone_number_params);
}else {
this.setData({
phone_number_params: this.data.phone_number,
'user.tel':this.data.phone_number,
is_wrong_phone:false,
});
console.log('params', this.data.phone_number_params);
// console.log('params', this.data.phone_number_params);
}
}
if(e.detail.value === '') {
console.log('手机号为空',this.data.is_wrong_phone,this.data.phone_number_params,this.data.is_choose_phone);
// console.log('手机号为空',this.data.is_wrong_phone,this.data.phone_number_params,this.data.is_choose_phone);
this.setData({is_change:false});//按钮置灰
}
if((this.data.is_choose_phone&&this.data.phone_number_params !== '') &&
... ... @@ -57,7 +57,7 @@ Page({
this.data.user.city !== null &&
this.data.user.introduce !== null
){
console.log(2);
// console.log(2);
this.setData({is_change:true});
}
},
... ... @@ -67,7 +67,7 @@ Page({
if(!(/^1[0-9]{10}$/.test(this.data.phone_number))){
wx.showToast({title:'手机号格式错误',icon:'none'});
this.setData({is_wrong_phone:true,phone_number_params:''});
console.log('params', this.data.phone_number_params);
// console.log('params', this.data.phone_number_params);
}
// }
},
... ... @@ -83,7 +83,7 @@ Page({
iv:e.detail.iv,
};
app.post(url, params, {}).then((res) => {
console.log('自动获取手机号', res);
// console.log('自动获取手机号', res);
if (+res.code === 1) {
this.setData({'user.tel':res.data,phone_number:res.data,is_wrong_phone:false,is_choose_phone:true})
}
... ... @@ -103,7 +103,7 @@ Page({
this.data.user.tel !== null &&
this.data.user.introduce !== null
){
console.log(2);
// console.log(2);
this.setData({is_change:true});
}
},
... ... @@ -121,7 +121,7 @@ Page({
this.data.user.tel !== null &&
this.data.user.introduce !== null
){
console.log(2);
// console.log(2);
this.setData({is_change:true});
}
},
... ... @@ -139,7 +139,7 @@ Page({
this.data.user.tel !== null &&
this.data.user.introduce !== null
){
console.log(2);
// console.log(2);
this.setData({is_change:true});
}
},
... ... @@ -164,14 +164,14 @@ Page({
if(e.detail.value === '') {
this.setData({is_change:false});
}
console.log('textcontent', textcontent);
// console.log('textcontent', textcontent);
if((this.data.is_choose_introduce&&this.data.introduce !== '') &&
this.data.user.city !== null &&
this.data.user.tel !== null &&
this.data.user.country !== null &&
this.data.user.wx !== null
){
console.log(2);
// console.log(2);
this.setData({is_change:true});
}
if((this.data.is_choose_country&&this.data.country !== '')&&
... ... @@ -180,14 +180,14 @@ Page({
(this.data.is_choose_introduce&&this.data.introduce !== '') &&
(this.data.is_choose_wx&&this.data.wx_num !== '')
) {
console.log(1);
// console.log(1);
this.setData({is_change:true});
}
}
},
//保存
submit() {
console.log('this.data.phone_number.length', this.data.phone_number.length,this.data.is_sex_change);
// console.log('this.data.phone_number.length', this.data.phone_number.length,this.data.is_sex_change);
if(this.data.userInfo.gender == '未知' && this.data.is_sex_change === undefined) {
wx.showToast({title:'请选择性别',icon:'none'})
}else if(this.data.country === '' && this.data.user.country === null) {
... ... @@ -217,7 +217,7 @@ Page({
introduce:this.data.is_choose_introduce?this.data.introduce:this.data.user.introduce
};
app.post(url, params, {}).then((res) => {
console.log('保存', res);
// console.log('保存', res);
if (+res.code === 1) {
wx.showToast({title:res.message,icon:'none',
success:function () {
... ... @@ -236,7 +236,7 @@ Page({
token: wx.getStorageSync('token'),
};
app.post(url, params, {}).then((res) => {
console.log('获取个人信息', res);
// console.log('获取个人信息', res);
if (+res.code === 1) {
this.setData({user:res.data});
if(this.data.user.country === null ||
... ... @@ -263,7 +263,7 @@ Page({
if(this.data.userInfo.tel !== null) {
this.setData({is_wrong_phone:false})
}
console.log('userInfo', this.data.userInfo);
// console.log('userInfo', this.data.userInfo);
this.getDetail();
},
... ...
... ... @@ -13,7 +13,7 @@ Page({
goPostDetail(e) {
const id = +e.currentTarget.dataset.activity_id;
const type = +e.currentTarget.dataset.type;
console.log('type', type);
// console.log('type', type);
if(type === 1) { //1是活动,2是拼餐
wx.navigateTo({
url: '/pages/activity/detail/detail?id=' + id,
... ... @@ -31,7 +31,7 @@ Page({
token: wx.getStorageSync('token'),
};
app.post(url, params, {}).then((res) => {
console.log('获取收藏列表', res);
// console.log('获取收藏列表', res);
if (+res.code === 1) {
this.setData({
collectList: this.data.collectList.concat(res.data),
... ...
... ... @@ -20,7 +20,7 @@ Page({
token: wx.getStorageSync('token'),
};
app.post(url, params, {}).then((res) => {
console.log('获取我的钱包', res);
// console.log('获取我的钱包', res);
if (+res.code === 1) {
this.setData({
list: res.data.list,
... ...