|
@@ -9,7 +9,6 @@ Page({
|
|
|
*/
|
|
|
data: {
|
|
|
bannerList:[],
|
|
|
- newNoticeTitle:'',
|
|
|
naxiImgUrl:'',
|
|
|
macunImgUrl:'',
|
|
|
hotScenicList:[],
|
|
@@ -30,51 +29,6 @@ Page({
|
|
|
this.setData({
|
|
|
bannerList:banners
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
- let result = await request('/front/notificationFront')
|
|
|
-
|
|
|
-
|
|
|
- if(result.length == 0){
|
|
|
- this.setData({
|
|
|
- newNoticeTitle:'暂无公告内容'
|
|
|
- })
|
|
|
- }else if(result.length == 1 && result[0].status == 1){
|
|
|
- this.setData({
|
|
|
- newNoticeTitle:result[0].title
|
|
|
- })
|
|
|
- }else if(result.length == 1 && result[0].status == 0){
|
|
|
- this.setData({
|
|
|
- newNoticeTitle:'暂无公告内容'
|
|
|
- })
|
|
|
- }
|
|
|
- else{
|
|
|
- for(let i = 0;i < result.length-1;i++){
|
|
|
- for(let j = 0;j < result.length-1-i;j++){
|
|
|
- if(result[j].id < result[j+1].id){
|
|
|
- let temp = result[j]
|
|
|
- result[j] = result[j+1]
|
|
|
- result[j+1] = temp
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- for(let i = 0;i < result.length;i++){
|
|
|
- if(result[i].status == 1){
|
|
|
- this.setData({
|
|
|
- newNoticeTitle:result[0].title
|
|
|
- })
|
|
|
- break;
|
|
|
- }else{
|
|
|
- console.log();
|
|
|
- this.setData({
|
|
|
- newNoticeTitle:'暂无公告内容'
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
let naxiImg = await request('/front/introduce/files/1')
|
|
@@ -90,23 +44,10 @@ Page({
|
|
|
macunImgUrl:macunImg[0].iconPath
|
|
|
})
|
|
|
|
|
|
-
|
|
|
+
|
|
|
let sceneryImgList = await request('/front/scenicSpotAndCallout')
|
|
|
|
|
|
- let imagePath = []
|
|
|
- let imageList = []
|
|
|
-
|
|
|
- for(let i = 0;i < sceneryImgList.length;i++){
|
|
|
- let id = sceneryImgList[i].id
|
|
|
-
|
|
|
- imagePath = await request('/front/findAllScenicSpotFilesPath/'+id)
|
|
|
-
|
|
|
- imageList[i] = imagePath
|
|
|
-
|
|
|
-
|
|
|
- Object.assign(sceneryImgList[i],imagePath)
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
for(let i = 0;i < sceneryImgList.length - 1;i++){
|
|
|
for(let j = 0;j < sceneryImgList.length - 1 - i;j++){
|
|
@@ -140,18 +81,7 @@ Page({
|
|
|
|
|
|
|
|
|
let foodList = await request('/front/merchantAndCallout')
|
|
|
-
|
|
|
- let foodImagePath = []
|
|
|
- for(let i = 0;i < foodList.length;i++){
|
|
|
- let id = foodList[i].id
|
|
|
- foodImagePath = await request('/front/findAllMerchantFilesPath/'+id)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- foodList[i].iconPath = foodImagePath
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+ console.log(foodList);
|
|
|
|
|
|
|
|
|
for(let i = 0;i < foodList.length - 1;i++){
|
|
@@ -174,7 +104,7 @@ Page({
|
|
|
this.setData({
|
|
|
hotFoodList
|
|
|
})
|
|
|
-
|
|
|
+ console.log(this.data.hotFoodList);
|
|
|
|
|
|
},
|
|
|
|