...
|
...
|
@@ -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) {
|
...
|
...
|
|