|
@@ -37,17 +37,17 @@ Page({
|
|
tag: 0,
|
|
tag: 0,
|
|
latitude: null,
|
|
latitude: null,
|
|
longitude: null,
|
|
longitude: null,
|
|
- showRecommend:false
|
|
|
|
|
|
+ showRecommend: false
|
|
},
|
|
},
|
|
|
|
|
|
- onLoad: function() {
|
|
|
|
|
|
+ onLoad: function () {
|
|
this.setData({
|
|
this.setData({
|
|
serverName,
|
|
serverName,
|
|
defaultImg,
|
|
defaultImg,
|
|
noExhibitionImg,
|
|
noExhibitionImg,
|
|
imgServer,
|
|
imgServer,
|
|
closeImg,
|
|
closeImg,
|
|
- showRecommend:true
|
|
|
|
|
|
+ showRecommend: true
|
|
// isLogin
|
|
// isLogin
|
|
})
|
|
})
|
|
|
|
|
|
@@ -56,7 +56,7 @@ Page({
|
|
wx.hideTabBar()
|
|
wx.hideTabBar()
|
|
},
|
|
},
|
|
|
|
|
|
- loadMore: function() {
|
|
|
|
|
|
+ loadMore: function () {
|
|
if (!this.data.lastPage) {
|
|
if (!this.data.lastPage) {
|
|
console.log(this.data.currentPage + 1)
|
|
console.log(this.data.currentPage + 1)
|
|
this.getList(this.data.currentPage + 1);
|
|
this.getList(this.data.currentPage + 1);
|
|
@@ -65,14 +65,14 @@ Page({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- onReachBottom: function() {
|
|
|
|
|
|
+ onReachBottom: function () {
|
|
if (!this.data.loading) {
|
|
if (!this.data.loading) {
|
|
this.loadMore();
|
|
this.loadMore();
|
|
console.log('reach Bottom');
|
|
console.log('reach Bottom');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- onShow: function() {
|
|
|
|
|
|
+ onShow: function () {
|
|
let {
|
|
let {
|
|
collectedArr,
|
|
collectedArr,
|
|
collectedChange
|
|
collectedChange
|
|
@@ -112,7 +112,7 @@ Page({
|
|
app.globalData.collectedChange = false;
|
|
app.globalData.collectedChange = false;
|
|
|
|
|
|
},
|
|
},
|
|
- onPullDownRefresh: function() {
|
|
|
|
|
|
+ onPullDownRefresh: function () {
|
|
this.setData({
|
|
this.setData({
|
|
exhibitionList: [],
|
|
exhibitionList: [],
|
|
currentPage: 1
|
|
currentPage: 1
|
|
@@ -121,14 +121,14 @@ Page({
|
|
this.getList(1);
|
|
this.getList(1);
|
|
},
|
|
},
|
|
|
|
|
|
- hideRecommend:function(){
|
|
|
|
|
|
+ hideRecommend: function () {
|
|
this.setData({
|
|
this.setData({
|
|
- showRecommend:false
|
|
|
|
|
|
+ showRecommend: false
|
|
})
|
|
})
|
|
wx.showTabBar()
|
|
wx.showTabBar()
|
|
},
|
|
},
|
|
|
|
|
|
- fetchData: function (page){
|
|
|
|
|
|
+ fetchData: function (page) {
|
|
request["getExhibitionList"]({
|
|
request["getExhibitionList"]({
|
|
page: page,
|
|
page: page,
|
|
type: 0,
|
|
type: 0,
|
|
@@ -137,8 +137,7 @@ Page({
|
|
}, '', res => {
|
|
}, '', res => {
|
|
|
|
|
|
let tempContent = this.data.exhibitionList ?
|
|
let tempContent = this.data.exhibitionList ?
|
|
- this.data.exhibitionList :
|
|
|
|
- [];
|
|
|
|
|
|
+ this.data.exhibitionList : [];
|
|
let {
|
|
let {
|
|
last: lastPage,
|
|
last: lastPage,
|
|
totalPages,
|
|
totalPages,
|
|
@@ -151,7 +150,7 @@ Page({
|
|
console.log(res)
|
|
console.log(res)
|
|
exhibitionList.forEach((currentValue) => {
|
|
exhibitionList.forEach((currentValue) => {
|
|
currentValue.distance = Math.ceil(currentValue.distance);
|
|
currentValue.distance = Math.ceil(currentValue.distance);
|
|
- if (currentValue.product){
|
|
|
|
|
|
+ if (currentValue.product) {
|
|
currentValue.product.link = escape(currentValue.product.link);
|
|
currentValue.product.link = escape(currentValue.product.link);
|
|
currentValue.product.imageUrl = escape(currentValue.product.imageUrl);
|
|
currentValue.product.imageUrl = escape(currentValue.product.imageUrl);
|
|
}
|
|
}
|
|
@@ -173,12 +172,12 @@ Page({
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
- getList: function(page) {
|
|
|
|
|
|
+ getList: function (page) {
|
|
let type = this.data.tag;
|
|
let type = this.data.tag;
|
|
this.setData({
|
|
this.setData({
|
|
loading: true
|
|
loading: true
|
|
})
|
|
})
|
|
- if (this.data.latitude||this.data.longitude) {
|
|
|
|
|
|
+ if (this.data.latitude || this.data.longitude) {
|
|
this.fetchData(page)
|
|
this.fetchData(page)
|
|
} else {
|
|
} else {
|
|
wx.getLocation({
|
|
wx.getLocation({
|
|
@@ -197,7 +196,7 @@ Page({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- getBanner: function() {
|
|
|
|
|
|
+ getBanner: function () {
|
|
request["getBannerList"]({}, '', res => {
|
|
request["getBannerList"]({}, '', res => {
|
|
let {
|
|
let {
|
|
content: commodityImgs
|
|
content: commodityImgs
|
|
@@ -214,7 +213,7 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
- addLike: function(e) {
|
|
|
|
|
|
+ addLike: function (e) {
|
|
let {
|
|
let {
|
|
type,
|
|
type,
|
|
id,
|
|
id,
|
|
@@ -282,7 +281,7 @@ Page({
|
|
console.log(this.data.exhibitionList)
|
|
console.log(this.data.exhibitionList)
|
|
},
|
|
},
|
|
|
|
|
|
- tabClick: function(e) {
|
|
|
|
|
|
+ tabClick: function (e) {
|
|
// console.log(e.currentTarget.dataset)
|
|
// console.log(e.currentTarget.dataset)
|
|
|
|
|
|
// if (e.currentTarget.id == 1) {
|
|
// if (e.currentTarget.id == 1) {
|
|
@@ -304,12 +303,12 @@ Page({
|
|
this.getList(1);
|
|
this.getList(1);
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
- onShareAppMessage: function() {
|
|
|
|
|
|
+ onShareAppMessage: function () {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
- to_pay: function(e) {
|
|
|
|
|
|
+ to_pay: function (e) {
|
|
// console.log('dwdwdw', e.currentTarget.dataset)
|
|
// console.log('dwdwdw', e.currentTarget.dataset)
|
|
|
|
|
|
let {
|
|
let {
|
|
@@ -335,9 +334,9 @@ Page({
|
|
case 0:
|
|
case 0:
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../wv_page/index`,
|
|
url: `../wv_page/index`,
|
|
- success: function(res) {},
|
|
|
|
- fail: function(res) {},
|
|
|
|
- complete: function(res) {},
|
|
|
|
|
|
+ success: function (res) {},
|
|
|
|
+ fail: function (res) {},
|
|
|
|
+ complete: function (res) {},
|
|
})
|
|
})
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
@@ -345,25 +344,25 @@ Page({
|
|
case 0:
|
|
case 0:
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../cg_detail/index?id=${url}`,
|
|
url: `../cg_detail/index?id=${url}`,
|
|
- success: function(res) {},
|
|
|
|
- fail: function(res) {},
|
|
|
|
- complete: function(res) {},
|
|
|
|
|
|
+ success: function (res) {},
|
|
|
|
+ fail: function (res) {},
|
|
|
|
+ complete: function (res) {},
|
|
})
|
|
})
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
if (hasproduct) {
|
|
if (hasproduct) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../wv_page/index?&id=${url}`,
|
|
url: `../wv_page/index?&id=${url}`,
|
|
- success: function(res) {},
|
|
|
|
- fail: function(res) {},
|
|
|
|
- complete: function(res) {},
|
|
|
|
|
|
+ success: function (res) {},
|
|
|
|
+ fail: function (res) {},
|
|
|
|
+ complete: function (res) {},
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `../zl_detail/index?id=${url}`,
|
|
url: `../zl_detail/index?id=${url}`,
|
|
- success: function(res) {},
|
|
|
|
- fail: function(res) {},
|
|
|
|
- complete: function(res) {},
|
|
|
|
|
|
+ success: function (res) {},
|
|
|
|
+ fail: function (res) {},
|
|
|
|
+ complete: function (res) {},
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -376,9 +375,9 @@ Page({
|
|
app.globalData.bannerHtml = description;
|
|
app.globalData.bannerHtml = description;
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: `./html_detail/index?id=${id}&imageUrl=${imageurl}&relayUrl=${relayUrl||''}`,
|
|
url: `./html_detail/index?id=${id}&imageUrl=${imageurl}&relayUrl=${relayUrl||''}`,
|
|
- success: function (res) { },
|
|
|
|
- fail: function (res) { },
|
|
|
|
- complete: function (res) { },
|
|
|
|
|
|
+ success: function (res) {},
|
|
|
|
+ fail: function (res) {},
|
|
|
|
+ complete: function (res) {},
|
|
})
|
|
})
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|