|
|
@ -7,13 +7,17 @@ import commonApi from "../../utils/https/common" |
|
|
import userApi from "../../utils/https/user" |
|
|
import userApi from "../../utils/https/user" |
|
|
import util from "../../utils/util" |
|
|
import util from "../../utils/util" |
|
|
import https from "../../utils/https.js" |
|
|
import https from "../../utils/https.js" |
|
|
import { unix } from "dayjs" |
|
|
import { |
|
|
|
|
|
unix |
|
|
|
|
|
} from "dayjs" |
|
|
|
|
|
|
|
|
Page({ |
|
|
Page({ |
|
|
data: { |
|
|
data: { |
|
|
isTest: false, |
|
|
isTest: false, |
|
|
|
|
|
|
|
|
startList: {head_img: ''}, // 启动页广告
|
|
|
startList: { |
|
|
|
|
|
head_img: '' |
|
|
|
|
|
}, // 启动页广告
|
|
|
fullAdvTimer: null, // 全屏timer
|
|
|
fullAdvTimer: null, // 全屏timer
|
|
|
showFullAdv: true, //全屏广告开关
|
|
|
showFullAdv: true, //全屏广告开关
|
|
|
opacity: 1, // 全屏广告透明度
|
|
|
opacity: 1, // 全屏广告透明度
|
|
|
@ -42,13 +46,11 @@ Page({ |
|
|
activeBannerIndex: 0, |
|
|
activeBannerIndex: 0, |
|
|
smBannerIndex: 0, |
|
|
smBannerIndex: 0, |
|
|
ztBannerIndex: 0, |
|
|
ztBannerIndex: 0, |
|
|
bannerDataListFake: [ |
|
|
bannerDataListFake: [{ |
|
|
{ |
|
|
|
|
|
title: "景点门票", |
|
|
title: "景点门票", |
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/5934b8b77b058ce1de5943adbaf51739.png", |
|
|
img: "https://static.ticket.sz-trip.com/uploads/20250526/5934b8b77b058ce1de5943adbaf51739.png", |
|
|
path: "/pages/list/scene/index", |
|
|
path: "/pages/list/scene/index", |
|
|
}, |
|
|
}, ], |
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
// banner上的金刚区
|
|
|
// banner上的金刚区
|
|
|
bannerDataList: [ |
|
|
bannerDataList: [ |
|
|
@ -385,17 +387,17 @@ Page({ |
|
|
// "appid":"wxdaf3d5edd07dc7af"
|
|
|
// "appid":"wxdaf3d5edd07dc7af"
|
|
|
// },
|
|
|
// },
|
|
|
{ |
|
|
{ |
|
|
"name":"常享游", |
|
|
"name": "常享游", |
|
|
"icon":"https://static.ticket.sz-trip.com/uploads/20250604/5112dd50e7c175bf58416ba9d4e4b846.png", |
|
|
"icon": "https://static.ticket.sz-trip.com/uploads/20250604/5112dd50e7c175bf58416ba9d4e4b846.png", |
|
|
"type":"h5", |
|
|
"type": "h5", |
|
|
"url":"https://tour.wlczy.com/h5/" |
|
|
"url": "https://tour.wlczy.com/h5/" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"name":"畅游宿迁", |
|
|
"name": "畅游宿迁", |
|
|
"icon":"https://static.ticket.sz-trip.com/uploads/20250604/962f331b2319b9759363c3787ca8d088.png", |
|
|
"icon": "https://static.ticket.sz-trip.com/uploads/20250604/962f331b2319b9759363c3787ca8d088.png", |
|
|
"type":"mini", |
|
|
"type": "mini", |
|
|
"path":"/pages/index/index", |
|
|
"path": "/pages/index/index", |
|
|
"appid":"wxcb00a59c4fba136e" |
|
|
"appid": "wxcb00a59c4fba136e" |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
], |
|
|
], |
|
|
@ -421,15 +423,50 @@ Page({ |
|
|
// 页面图片
|
|
|
// 页面图片
|
|
|
// imageSourceList:imageSource,
|
|
|
// imageSourceList:imageSource,
|
|
|
|
|
|
|
|
|
|
|
|
recommendType: [{ |
|
|
|
|
|
id: 306, |
|
|
|
|
|
name: '必逛景点榜', |
|
|
|
|
|
img: 'https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/biguang.png', |
|
|
|
|
|
path: '/pages/list/scene/index', |
|
|
|
|
|
list: [] |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 307, |
|
|
|
|
|
name: '寻鲜美食榜', |
|
|
|
|
|
img: 'https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/biguang.png', |
|
|
|
|
|
path: '/subPackages/foodListNew/index', |
|
|
|
|
|
list: [] |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 308, |
|
|
|
|
|
name: '优选住宿榜', |
|
|
|
|
|
img: 'https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/biguang.png', |
|
|
|
|
|
path: '/pages/pbService/web/index?weburl=' + encodeURIComponent( |
|
|
|
|
|
'https://m.cloud.sz-trip.com/selectedHotels'), |
|
|
|
|
|
list: [] |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
id: 309, |
|
|
|
|
|
name: '必看演出榜', |
|
|
|
|
|
img: 'https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/biguang.png', |
|
|
|
|
|
path: '/pages/list/theatre/index', |
|
|
|
|
|
list: [] |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
activeIndex: 0, |
|
|
|
|
|
touchStartX: 0, |
|
|
|
|
|
// 用于存储计算好的样式字符串数组
|
|
|
|
|
|
cardStyles: [] |
|
|
}, |
|
|
}, |
|
|
onLoad: function(options) { |
|
|
onLoad: function(options) { |
|
|
|
|
|
// 初始化时计算一次样式
|
|
|
|
|
|
this.updateCardStyles(); |
|
|
// 相城小程序跳转获取用户信息
|
|
|
// 相城小程序跳转获取用户信息
|
|
|
if(options && options.szxcCode) { |
|
|
if (options && options.szxcCode) { |
|
|
commonApi._post("uservice/user/loginByXC", { |
|
|
commonApi._post("uservice/user/loginByXC", { |
|
|
code: options.szxcCode |
|
|
code: options.szxcCode |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
if(res.data && res.data.id && res.data.token) { |
|
|
if (res.data && res.data.id && res.data.token) { |
|
|
https.set_logininfo(res); |
|
|
https.set_logininfo(res); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -437,9 +474,6 @@ Page({ |
|
|
if (options.from) { |
|
|
if (options.from) { |
|
|
app.globalData.from = options.from; |
|
|
app.globalData.from = options.from; |
|
|
} |
|
|
} |
|
|
return |
|
|
|
|
|
console.log('options',options) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
onReady: function() { |
|
|
onReady: function() { |
|
|
@ -466,30 +500,193 @@ Page({ |
|
|
lon: res.longitude |
|
|
lon: res.longitude |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
fail: (err) => { |
|
|
fail: (err) => {} |
|
|
} |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this.getUrlToPage() |
|
|
this.getUrlToPage() |
|
|
this.getShowMore() |
|
|
this.getShowMore() |
|
|
|
|
|
|
|
|
|
|
|
const typeList = this.data.recommendType; |
|
|
|
|
|
|
|
|
|
|
|
// 遍历数组进行请求
|
|
|
|
|
|
typeList.forEach((item, index) => { |
|
|
|
|
|
// 1. 根据索引判断接口地址 (前两个用 scene 接口,后面用 product 接口)
|
|
|
|
|
|
let apiUrl = ''; |
|
|
|
|
|
if (index < 2) { |
|
|
|
|
|
apiUrl = 'scene/get_scene_by_tag_subject'; |
|
|
|
|
|
} else { |
|
|
|
|
|
apiUrl = 'product/get_product_by_tag_subject'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 2. 发起请求
|
|
|
|
|
|
commonApi._post(apiUrl, { |
|
|
|
|
|
offset: 0, |
|
|
|
|
|
limit: 3, |
|
|
|
|
|
tag_id: item.id |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
const key = `recommendType[${index}].list`; |
|
|
|
|
|
res.data.list.forEach(item => { |
|
|
|
|
|
// 手动增加一个 tagsArray 字段
|
|
|
|
|
|
if (item.display_tags) { |
|
|
|
|
|
item.tagsArray = item.display_tags.split(',').slice(0, 2); |
|
|
|
|
|
} else { |
|
|
|
|
|
item.tagsArray = []; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
[key]: res.data.list // 假设返回的数据里直接有 list 字段
|
|
|
|
|
|
}); |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.error(`请求第 ${index + 1} 个榜单失败`, err); |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
// 1. 点击 Tab 切换
|
|
|
|
|
|
handleTabClick(e) { |
|
|
|
|
|
const index = e.currentTarget.dataset.index; |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
activeIndex: index |
|
|
|
|
|
}); |
|
|
|
|
|
this.updateCardStyles(); // 更新样式
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 2. 点击卡片切换
|
|
|
|
|
|
handleCardClick(e) { |
|
|
|
|
|
const index = e.currentTarget.dataset.index; |
|
|
|
|
|
if (index !== this.data.activeIndex) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
activeIndex: index |
|
|
|
|
|
}); |
|
|
|
|
|
this.updateCardStyles(); // 更新样式
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 3. ★核心逻辑:在 JS 中计算所有卡片的样式
|
|
|
|
|
|
updateCardStyles() { |
|
|
|
|
|
const { |
|
|
|
|
|
activeIndex, |
|
|
|
|
|
recommendType |
|
|
|
|
|
} = this.data; |
|
|
|
|
|
const len = recommendType.length; |
|
|
|
|
|
|
|
|
|
|
|
// 偏移量配置 (单位 rpx)
|
|
|
|
|
|
const xStep = 24; |
|
|
|
|
|
const yStep = 14; |
|
|
|
|
|
|
|
|
|
|
|
// 遍历生成每个卡片的样式字符串
|
|
|
|
|
|
const newStyles = recommendType.map((item, index) => { |
|
|
|
|
|
// 计算距离
|
|
|
|
|
|
let diff = (index - activeIndex + len) % len; |
|
|
|
|
|
|
|
|
|
|
|
let zIndex = 0; |
|
|
|
|
|
let xOffset = 0; |
|
|
|
|
|
let yOffset = 0; |
|
|
|
|
|
let opacity = 1; |
|
|
|
|
|
let bgColor = '#fcf1e2'; |
|
|
|
|
|
let bgImage = 'none'; |
|
|
|
|
|
|
|
|
|
|
|
if (diff === 0) { |
|
|
|
|
|
// --- 第1层 (最上面) ---
|
|
|
|
|
|
zIndex = 10; |
|
|
|
|
|
xOffset = 0; |
|
|
|
|
|
yOffset = 0; |
|
|
|
|
|
bgImage = |
|
|
|
|
|
'url(https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/biguang.png)'; |
|
|
|
|
|
} else if (diff === 1) { |
|
|
|
|
|
// --- 第2层 ---
|
|
|
|
|
|
zIndex = 9; |
|
|
|
|
|
xOffset = xStep * 1; |
|
|
|
|
|
yOffset = yStep * 1; |
|
|
|
|
|
bgImage = |
|
|
|
|
|
'url(https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/hotBgs.png)'; |
|
|
|
|
|
} else if (diff === 2) { |
|
|
|
|
|
// --- 第3层 ---
|
|
|
|
|
|
zIndex = 8; |
|
|
|
|
|
xOffset = xStep * 2; |
|
|
|
|
|
yOffset = yStep * 2; |
|
|
|
|
|
bgImage = |
|
|
|
|
|
'url(https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/hotBgs.png)'; |
|
|
|
|
|
} else if (diff === 3) { |
|
|
|
|
|
// --- 第4层 ---
|
|
|
|
|
|
zIndex = 7; |
|
|
|
|
|
xOffset = xStep * 3; |
|
|
|
|
|
yOffset = yStep * 3; |
|
|
|
|
|
bgImage = |
|
|
|
|
|
'url(https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/hotBgs.png)'; |
|
|
|
|
|
} else { |
|
|
|
|
|
// --- 储备层 (隐藏在第4层后面) ---
|
|
|
|
|
|
zIndex = 1; |
|
|
|
|
|
xOffset = xStep * 3; |
|
|
|
|
|
yOffset = yStep * 3; |
|
|
|
|
|
bgImage = |
|
|
|
|
|
'url(https://static.ticket.sz-trip.com/jundaosuzhou/images/index2026/hotBgs.png)'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 构造样式字符串
|
|
|
|
|
|
return ` |
|
|
|
|
|
z-index: ${zIndex}; |
|
|
|
|
|
transform: translate(${xOffset}rpx, ${yOffset}rpx); |
|
|
|
|
|
opacity: ${opacity}; |
|
|
|
|
|
background-image: ${bgImage}; |
|
|
|
|
|
background-size: 100% 100%; |
|
|
|
|
|
background-repeat: no-repeat; |
|
|
|
|
|
`;
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 更新到视图
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
cardStyles: newStyles |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 4. 触摸开始
|
|
|
|
|
|
handleTouchStart(e) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
touchStartX: e.touches[0].clientX |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 5. 触摸结束
|
|
|
|
|
|
handleTouchEnd(e) { |
|
|
|
|
|
const touchEndX = e.changedTouches[0].clientX; |
|
|
|
|
|
const diff = this.data.touchStartX - touchEndX; |
|
|
|
|
|
const len = this.data.recommendType.length; |
|
|
|
|
|
let current = this.data.activeIndex; |
|
|
|
|
|
|
|
|
|
|
|
if (diff > 50) { |
|
|
|
|
|
// 左滑 -> 下一张
|
|
|
|
|
|
current = (current + 1) % len; |
|
|
|
|
|
} else if (diff < -50) { |
|
|
|
|
|
// 右滑 -> 上一张
|
|
|
|
|
|
current = (current - 1 + len) % len; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (current !== this.data.activeIndex) { |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
activeIndex: current |
|
|
|
|
|
}); |
|
|
|
|
|
this.updateCardStyles(); // 更新样式
|
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setAiStr :function () { |
|
|
setAiStr: function() { |
|
|
let str = "你好啊,我是卿卿,我来带你游苏州~"; |
|
|
let str = "你好啊,我是卿卿,我来带你游苏州~"; |
|
|
let i = 0; |
|
|
let i = 0; |
|
|
let timer = setInterval(()=>{ |
|
|
let timer = setInterval(() => { |
|
|
i++ |
|
|
i++ |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
aiStr: str.slice(0,i) |
|
|
aiStr: str.slice(0, i) |
|
|
}) |
|
|
}) |
|
|
if (i>str.length) { |
|
|
if (i > str.length) { |
|
|
clearInterval(timer) |
|
|
clearInterval(timer) |
|
|
} |
|
|
} |
|
|
},125) |
|
|
}, 125) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showImg (img) { |
|
|
showImg(img) { |
|
|
if (!img) { return img } |
|
|
if (!img) { |
|
|
|
|
|
return img |
|
|
|
|
|
} |
|
|
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) { |
|
|
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) { |
|
|
return img; |
|
|
return img; |
|
|
} else { |
|
|
} else { |
|
|
@ -499,9 +696,10 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
gotoPath(e) { |
|
|
gotoPath(e) { |
|
|
if (e.currentTarget.dataset.path){ |
|
|
console.log(e.currentTarget.dataset.item.path) |
|
|
|
|
|
if (e.currentTarget.dataset.item.path) { |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: e.currentTarget.dataset.path, |
|
|
url: e.currentTarget.dataset.item.path, |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
@ -525,7 +723,7 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
//获取季节配置
|
|
|
//获取季节配置
|
|
|
getIndexSeason() { |
|
|
getIndexSeason() { |
|
|
if (app.globalData.configJson&&app.globalData.configJson.indexSeason) { |
|
|
if (app.globalData.configJson && app.globalData.configJson.indexSeason) { |
|
|
console.log('app', app.globalData.configJson) |
|
|
console.log('app', app.globalData.configJson) |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
indexHot: app.globalData.configJson.indexHot, |
|
|
indexHot: app.globalData.configJson.indexHot, |
|
|
@ -534,51 +732,97 @@ Page({ |
|
|
bannerDataList: (app.globalData.configJson.nav_menu || []), |
|
|
bannerDataList: (app.globalData.configJson.nav_menu || []), |
|
|
mainTypeList: (app.globalData.configJson.menu_button || []), |
|
|
mainTypeList: (app.globalData.configJson.menu_button || []), |
|
|
publicSerivce: (app.globalData.configJson.service_data || []), |
|
|
publicSerivce: (app.globalData.configJson.service_data || []), |
|
|
travelData:(app.globalData.configJson.travel_data||[]), |
|
|
travelData: (app.globalData.configJson.travel_data || []), |
|
|
travelCulture:(app.globalData.configJson.number_data||[]), |
|
|
travelCulture: (app.globalData.configJson.number_data || []), |
|
|
SQSM:(app.globalData.configJson.city_data||[]), |
|
|
SQSM: (app.globalData.configJson.city_data || []), |
|
|
otherPlat: app.globalData.configJson.platform_data, |
|
|
otherPlat: app.globalData.configJson.platform_data, |
|
|
func_data: (app.globalData.configJson.func_data||{}) |
|
|
func_data: (app.globalData.configJson.func_data || {}) |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
// 小程序是3 测试H5 15
|
|
|
// 小程序是3 测试H5 15
|
|
|
commonApi._post("adv/get_home_ui", {type_id: 3}).then(res => { |
|
|
commonApi._post("adv/get_home_ui", { |
|
|
|
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
let obj = {}; |
|
|
let obj = {}; |
|
|
(res.data.content||[]).forEach(item => { |
|
|
(res.data.content || []).forEach(item => { |
|
|
obj[item.id] = item.image |
|
|
obj[item.id] = item.image |
|
|
}); |
|
|
}); |
|
|
app.globalData.configJson.indexSeason = obj |
|
|
app.globalData.configJson.indexSeason = obj |
|
|
app.globalData.loadIndexSeason = true |
|
|
app.globalData.loadIndexSeason = true |
|
|
app.globalData.configJson.nav_menu = (res.data.nav_menu || []).map((v,index)=>{ |
|
|
app.globalData.configJson.nav_menu = (res.data.nav_menu || []).map((v, index) => { |
|
|
return {...v, pagePoint: {classification: 'nav_menu', key_number: index}} |
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'nav_menu', |
|
|
|
|
|
key_number: index |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
app.globalData.configJson.menu_button = (res.data.menu_button || []).map((v,index)=>{ |
|
|
app.globalData.configJson.menu_button = (res.data.menu_button || []).map((v, index) => { |
|
|
return {...v, pagePoint: {classification: 'menu_button', key_number: index}} |
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'menu_button', |
|
|
|
|
|
key_number: index |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
// 公共服务 publicSerivce
|
|
|
// 公共服务 publicSerivce
|
|
|
app.globalData.configJson.service_data = (res.data.service_data || []).map((v,index)=>{ |
|
|
app.globalData.configJson.service_data = (res.data.service_data || []).map((v, |
|
|
return {...v, pagePoint: {classification: 'service_data', key_number: index}} |
|
|
index) => { |
|
|
|
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'service_data', |
|
|
|
|
|
key_number: index |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
// 旅游助手 travelData
|
|
|
// 旅游助手 travelData
|
|
|
app.globalData.configJson.travel_data = (res.data.travel_data || []).map((v,index)=>{ |
|
|
app.globalData.configJson.travel_data = (res.data.travel_data || []).map((v, index) => { |
|
|
return {...v, pagePoint: {classification: 'travel_data', key_number: index}} |
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'travel_data', |
|
|
|
|
|
key_number: index |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
// 数字文旅 travelCulture
|
|
|
// 数字文旅 travelCulture
|
|
|
app.globalData.configJson.number_data = (res.data.number_data || []).map((v,index)=>{ |
|
|
app.globalData.configJson.number_data = (res.data.number_data || []).map((v, index) => { |
|
|
return {...v, pagePoint: {classification: 'number_data', key_number: index}} |
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'number_data', |
|
|
|
|
|
key_number: index |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
// 十全十美 SQSM
|
|
|
// 十全十美 SQSM
|
|
|
app.globalData.configJson.city_data = (res.data.city_data || []).map((v,index)=>{ |
|
|
app.globalData.configJson.city_data = (res.data.city_data || []).map((v, index) => { |
|
|
return {...v, pagePoint: {classification: 'city_data', key_number: index}} |
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'city_data', |
|
|
|
|
|
key_number: index |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
// 其他平台otherPlat
|
|
|
// 其他平台otherPlat
|
|
|
app.globalData.configJson.platform_data = (res.data.platform_data || []).map((v,index)=>{ |
|
|
app.globalData.configJson.platform_data = (res.data.platform_data || []).map((v, |
|
|
return {...v, pagePoint: {classification: 'platform_data', key_number: index}} |
|
|
index) => { |
|
|
|
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'platform_data', |
|
|
|
|
|
key_number: index |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let func_data = {} |
|
|
let func_data = {} |
|
|
for(let item of (res.data.func_data || [])) { |
|
|
for (let item of (res.data.func_data || [])) { |
|
|
func_data[item.jump_type] = true |
|
|
func_data[item.jump_type] = true |
|
|
} |
|
|
} |
|
|
app.globalData.configJson.func_data = func_data |
|
|
app.globalData.configJson.func_data = func_data |
|
|
@ -591,17 +835,17 @@ Page({ |
|
|
bannerDataList: (app.globalData.configJson.nav_menu || []), |
|
|
bannerDataList: (app.globalData.configJson.nav_menu || []), |
|
|
mainTypeList: (app.globalData.configJson.menu_button || []), |
|
|
mainTypeList: (app.globalData.configJson.menu_button || []), |
|
|
publicSerivce: (app.globalData.configJson.service_data || []), |
|
|
publicSerivce: (app.globalData.configJson.service_data || []), |
|
|
travelData:(app.globalData.configJson.travel_data||[]), |
|
|
travelData: (app.globalData.configJson.travel_data || []), |
|
|
travelCulture:(app.globalData.configJson.number_data||[]), |
|
|
travelCulture: (app.globalData.configJson.number_data || []), |
|
|
SQSM:(app.globalData.configJson.city_data||[]), |
|
|
SQSM: (app.globalData.configJson.city_data || []), |
|
|
func_data: (app.globalData.configJson.func_data||{}) |
|
|
func_data: (app.globalData.configJson.func_data || {}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
console.log(this.data) |
|
|
console.log(this.data) |
|
|
}, |
|
|
}, |
|
|
// url跳转(不知道什么东西)
|
|
|
// url跳转(不知道什么东西)
|
|
|
getUrlToPage () { |
|
|
getUrlToPage() { |
|
|
commonApi._post("pbservice/Other/getClientConfig", { |
|
|
commonApi._post("pbservice/Other/getClientConfig", { |
|
|
unique_key: "urltopage" |
|
|
unique_key: "urltopage" |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
@ -612,78 +856,129 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getShowMore () { |
|
|
getShowMore() { |
|
|
commonApi._post("multimedia/detail", {id: 2462}).then(res => { |
|
|
commonApi._post("multimedia/detail", { |
|
|
|
|
|
id: 2462 |
|
|
|
|
|
}).then(res => { |
|
|
if (res && res.data) { |
|
|
if (res && res.data) { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
showMore: res.data.company_name ==1?true:false |
|
|
showMore: res.data.company_name == 1 ? true : false |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------banner 相关---------------------------
|
|
|
// --------------------banner 相关---------------------------
|
|
|
// 获取banner 和开屏广告
|
|
|
// 获取banner 和开屏广告
|
|
|
getBanner: function() { |
|
|
getBanner: function() { |
|
|
let _this = this |
|
|
let _this = this |
|
|
//全屏广告
|
|
|
//全屏广告
|
|
|
commonApi._post("adv/getAdv", {position: 2,type_id: 3}).then(res => { |
|
|
commonApi._post("adv/getAdv", { |
|
|
|
|
|
position: 2, |
|
|
|
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
if (res.data.length > 0) { |
|
|
if (res.data.length > 0) { |
|
|
let length = res.data.length |
|
|
let length = res.data.length |
|
|
let num = Math.floor(Math.random() * length); |
|
|
let num = Math.floor(Math.random() * length); |
|
|
this.setData({startList: res.data[num]}) |
|
|
this.setData({ |
|
|
|
|
|
startList: res.data[num] |
|
|
|
|
|
}) |
|
|
// 图片
|
|
|
// 图片
|
|
|
if (this.data.startList.media_type) { |
|
|
if (this.data.startList.media_type) { |
|
|
wx.hideTabBar() //这里隐藏了底部导航栏
|
|
|
wx.hideTabBar() //这里隐藏了底部导航栏
|
|
|
this.setData({showTime: true}) |
|
|
this.setData({ |
|
|
|
|
|
showTime: true |
|
|
|
|
|
}) |
|
|
this.data.fullAdvTimer = setInterval(() => { |
|
|
this.data.fullAdvTimer = setInterval(() => { |
|
|
_this.data.time-=0.5 |
|
|
_this.data.time -= 0.5 |
|
|
if (Number.isInteger(_this.data.time)) { |
|
|
if (Number.isInteger(_this.data.time)) { |
|
|
_this.setData({time: _this.data.time}) |
|
|
_this.setData({ |
|
|
|
|
|
time: _this.data.time |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
if (_this.data.time <= 0) { |
|
|
if (_this.data.time <= 0) { |
|
|
_this.setData({opacity: _this.data.opacity - 0.3}) |
|
|
_this.setData({ |
|
|
|
|
|
opacity: _this.data.opacity - 0.3 |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
if (_this.data.time <= -1) { |
|
|
if (_this.data.time <= -1) { |
|
|
clearInterval(_this.data.fullAdvTimer) |
|
|
clearInterval(_this.data.fullAdvTimer) |
|
|
wx.showTabBar() //倒计时结束清除定时器显示导航栏
|
|
|
wx.showTabBar() //倒计时结束清除定时器显示导航栏
|
|
|
_this.setData({showFullAdv: false}) |
|
|
_this.setData({ |
|
|
|
|
|
showFullAdv: false |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, 500) |
|
|
}, 500) |
|
|
} else { |
|
|
} else { |
|
|
// 视频
|
|
|
// 视频
|
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
this.setData({showFullAdv: false}) |
|
|
this.setData({ |
|
|
|
|
|
showFullAdv: false |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 顶部banner
|
|
|
// 顶部banner
|
|
|
commonApi._post("adv/getAdv", {position: 0,type_id: 3}).then(res => { |
|
|
commonApi._post("adv/getAdv", { |
|
|
let resData = (res.data || []).map((v,index)=>{ |
|
|
position: 0, |
|
|
return {...v, pagePoint: {classification: 'bigBanner', key_number: v.id}} |
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
let resData = (res.data || []).map((v, index) => { |
|
|
|
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'bigBanner', |
|
|
|
|
|
key_number: v.id |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
banner: resData |
|
|
}) |
|
|
}) |
|
|
this.setData({banner: resData}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
// 专题banner
|
|
|
// 专题banner
|
|
|
commonApi._post("adv/getAdv", {position: 6,type_id: 3}).then(res => { |
|
|
commonApi._post("adv/getAdv", { |
|
|
let resData = (res.data || []).map((v,index)=>{ |
|
|
position: 6, |
|
|
return {...v, pagePoint: {classification: 'specialBanner', key_number: v.id}} |
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
let resData = (res.data || []).map((v, index) => { |
|
|
|
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'specialBanner', |
|
|
|
|
|
key_number: v.id |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
ztbanner: resData |
|
|
}) |
|
|
}) |
|
|
this.setData({ztbanner:resData}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
// 小banner
|
|
|
// 小banner
|
|
|
commonApi._post("adv/getAdv", {position: 1,type_id: 3}).then(res => { |
|
|
commonApi._post("adv/getAdv", { |
|
|
let resData = (res.data || []).map((v,index)=>{ |
|
|
position: 1, |
|
|
return {...v, pagePoint: {classification: 'smallBanner', key_number: v.id}} |
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
let resData = (res.data || []).map((v, index) => { |
|
|
|
|
|
return { |
|
|
|
|
|
...v, |
|
|
|
|
|
pagePoint: { |
|
|
|
|
|
classification: 'smallBanner', |
|
|
|
|
|
key_number: v.id |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
xiaobanner: resData |
|
|
}) |
|
|
}) |
|
|
this.setData({xiaobanner: resData}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
//弹窗广告
|
|
|
//弹窗广告
|
|
|
commonApi._post("adv/getAdv", {position: 3,type_id: 3}).then(res => { |
|
|
commonApi._post("adv/getAdv", { |
|
|
|
|
|
position: 3, |
|
|
|
|
|
type_id: 3 |
|
|
|
|
|
}).then(res => { |
|
|
if (res.data.length > 0) { |
|
|
if (res.data.length > 0) { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
alertSwipeList: res.data || [], |
|
|
alertSwipeList: res.data || [], |
|
|
@ -705,9 +1000,13 @@ Page({ |
|
|
if (this.data.isTest) return; |
|
|
if (this.data.isTest) return; |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let source = e.currentTarget.dataset.source; |
|
|
let source = e.currentTarget.dataset.source; |
|
|
if (source) { util.setGlobalPagePoint(source); } |
|
|
if (source) { |
|
|
|
|
|
util.setGlobalPagePoint(source); |
|
|
|
|
|
} |
|
|
console.log(item) |
|
|
console.log(item) |
|
|
if (item.pagePoint) { this.newPagePoint(item.pagePoint) } |
|
|
if (item.pagePoint) { |
|
|
|
|
|
this.newPagePoint(item.pagePoint) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
switch (item.jump_type) { |
|
|
switch (item.jump_type) { |
|
|
case 0: |
|
|
case 0: |
|
|
@ -790,7 +1089,7 @@ Page({ |
|
|
return; |
|
|
return; |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
newPagePoint (param) { |
|
|
newPagePoint(param) { |
|
|
commonApi._post("browse/newBuryingPoint", { |
|
|
commonApi._post("browse/newBuryingPoint", { |
|
|
uuid: app.globalData.uuid, |
|
|
uuid: app.globalData.uuid, |
|
|
drive: "mini", |
|
|
drive: "mini", |
|
|
@ -824,7 +1123,7 @@ Page({ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 后台配置数据跳转
|
|
|
// 后台配置数据跳转
|
|
|
mainNavClick:function (e) { |
|
|
mainNavClick: function(e) { |
|
|
let item = e.currentTarget.dataset.item |
|
|
let item = e.currentTarget.dataset.item |
|
|
console.log(item) |
|
|
console.log(item) |
|
|
if (item.pagePoint) { |
|
|
if (item.pagePoint) { |
|
|
@ -835,13 +1134,13 @@ Page({ |
|
|
if (item.jump_type == "page") { |
|
|
if (item.jump_type == "page") { |
|
|
if (item.page.mini) { |
|
|
if (item.page.mini) { |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: "/"+item.page.mini, |
|
|
url: "/" + item.page.mini, |
|
|
}) |
|
|
}) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (item.page.tdata) { |
|
|
if (item.page.tdata) { |
|
|
//sph 视频号
|
|
|
//sph 视频号
|
|
|
if (item.page.tdata.appid&&item.page.tdata.appid.indexOf("sph")>=0) { |
|
|
if (item.page.tdata.appid && item.page.tdata.appid.indexOf("sph") >= 0) { |
|
|
// if (item.page.tdata.page) {
|
|
|
// if (item.page.tdata.page) {
|
|
|
// wx.openChannelsActivity({
|
|
|
// wx.openChannelsActivity({
|
|
|
// finderUserName: item.page.tdata.appid, // 视频号的原始ID
|
|
|
// finderUserName: item.page.tdata.appid, // 视频号的原始ID
|
|
|
@ -864,9 +1163,10 @@ Page({ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (item.page.tdata.ghid == "gh_b55e177a4069" || item.page.tdata.appid == 'wx4bb7b6050831f585') { |
|
|
if (item.page.tdata.ghid == "gh_b55e177a4069" || item.page.tdata.appid == |
|
|
|
|
|
'wx4bb7b6050831f585') { |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: "/"+item.page.tdata.page, |
|
|
url: "/" + item.page.tdata.page, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
@ -888,7 +1188,7 @@ Page({ |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: item.text, |
|
|
title: item.text, |
|
|
icon:'none', |
|
|
icon: 'none', |
|
|
duration: 2000, |
|
|
duration: 2000, |
|
|
}) |
|
|
}) |
|
|
}, 200); |
|
|
}, 200); |
|
|
@ -933,48 +1233,78 @@ Page({ |
|
|
typeId: 3, |
|
|
typeId: 3, |
|
|
type: 1, // 返回数组
|
|
|
type: 1, // 返回数组
|
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
console.log("resData",res.data.adv); |
|
|
console.log("resData", res.data.adv); |
|
|
(res.data.adv || []).forEach(v=>{ v.pagePoint = {classification: 'flashSales', key_number: v.id} }); |
|
|
(res.data.adv || []).forEach(v => { |
|
|
(res.data.list || []).forEach(v=>{ v.pagePoint = {classification: 'flashSales', key_number: v.id} }); |
|
|
v.pagePoint = { |
|
|
|
|
|
classification: 'flashSales', |
|
|
|
|
|
key_number: v.id |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
(res.data.list || []).forEach(v => { |
|
|
|
|
|
v.pagePoint = { |
|
|
|
|
|
classification: 'flashSales', |
|
|
|
|
|
key_number: v.id |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
this.setData({xpth: res.data}) |
|
|
this.setData({ |
|
|
|
|
|
xpth: res.data |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 更换新品特惠 当即热门
|
|
|
// 更换新品特惠 当即热门
|
|
|
changeXpthIndex:function (e) { |
|
|
changeXpthIndex: function(e) { |
|
|
let value = e.currentTarget.dataset.value |
|
|
let value = e.currentTarget.dataset.value |
|
|
this.setData({xpthIndex:value}) |
|
|
this.setData({ |
|
|
|
|
|
xpthIndex: value |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
productGotoDetail: function(e) { |
|
|
productGotoDetail: function(e) { |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let source = e.currentTarget.dataset.source; |
|
|
let source = e.currentTarget.dataset.source; |
|
|
if (source) { util.setGlobalPagePoint(source); } |
|
|
if (source) { |
|
|
if (item.pagePoint) { this.newPagePoint(item.pagePoint) } |
|
|
util.setGlobalPagePoint(source); |
|
|
|
|
|
} |
|
|
|
|
|
if (item.pagePoint) { |
|
|
|
|
|
this.newPagePoint(item.pagePoint) |
|
|
|
|
|
} |
|
|
util.gotoDetail(item) |
|
|
util.gotoDetail(item) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 热门推荐
|
|
|
// 热门推荐
|
|
|
getList: function() { |
|
|
getList: function() { |
|
|
commonApi._post("product/get_product_by_tag_subject", { |
|
|
commonApi._post("product/get_product_by_tag_subject", { |
|
|
tag_id: 85,offset: 0,limit: 5, |
|
|
tag_id: 85, |
|
|
}).then(res=>{ |
|
|
offset: 0, |
|
|
|
|
|
limit: 5, |
|
|
|
|
|
}).then(res => { |
|
|
let resData = res.data.list || [] |
|
|
let resData = res.data.list || [] |
|
|
resData.forEach(v=>{ |
|
|
resData.forEach(v => { |
|
|
v.pagePoint = {classification: 'hot', key_number: v.id}; |
|
|
v.pagePoint = { |
|
|
v.display_tags_arr = v.display_tags?v.display_tags.split(",") : [] |
|
|
classification: 'hot', |
|
|
|
|
|
key_number: v.id |
|
|
|
|
|
}; |
|
|
|
|
|
v.display_tags_arr = v.display_tags ? v.display_tags.split(",") : [] |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
list: resData |
|
|
}) |
|
|
}) |
|
|
this.setData({ list: resData}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 回购
|
|
|
// 回购
|
|
|
getRepurchaseList:function () { |
|
|
getRepurchaseList: function() { |
|
|
commonApi._post("repurchase/repurchase/getRepurchaseList", {}).then(res=>{ |
|
|
commonApi._post("repurchase/repurchase/getRepurchaseList", {}).then(res => { |
|
|
(res.data || []).forEach(v=>{ |
|
|
(res.data || []).forEach(v => { |
|
|
v.headimg = this.showImg(v.headimg) |
|
|
v.headimg = this.showImg(v.headimg) |
|
|
v.pagePoint={classification: 'repurchase', key_number: v.product_id} |
|
|
v.pagePoint = { |
|
|
|
|
|
classification: 'repurchase', |
|
|
|
|
|
key_number: v.product_id |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
repurchaseList: res.data || [] |
|
|
}) |
|
|
}) |
|
|
this.setData({ repurchaseList: res.data || []}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onReachBottom: function() { |
|
|
onReachBottom: function() { |
|
|
@ -989,13 +1319,27 @@ Page({ |
|
|
gotoDetail: function(e) { |
|
|
gotoDetail: function(e) { |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let source = e.currentTarget.dataset.source; |
|
|
let source = e.currentTarget.dataset.source; |
|
|
if (source) { util.setGlobalPagePoint(source); } |
|
|
let index = e.currentTarget.dataset.index; |
|
|
|
|
|
console.log(index) |
|
|
|
|
|
if (index == 1) { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: '/subPackages/foodNew/index?id=' + item.id |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (source) { |
|
|
|
|
|
util.setGlobalPagePoint(source); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
commonApi._post("repurchase/repurchase/recordClick", {product_id:item.product_id}) |
|
|
commonApi._post("repurchase/repurchase/recordClick", { |
|
|
|
|
|
product_id: item.product_id |
|
|
|
|
|
}) |
|
|
// item.id = item.type=='post'?item.product_id:item.scene_id
|
|
|
// item.id = item.type=='post'?item.product_id:item.scene_id
|
|
|
if (item.pagePoint) { this.newPagePoint(item.pagePoint) } |
|
|
if (item.pagePoint) { |
|
|
|
|
|
this.newPagePoint(item.pagePoint) |
|
|
|
|
|
} |
|
|
// util.gotoDetail(item);
|
|
|
// util.gotoDetail(item);
|
|
|
util.gotoDetail(item.goods); |
|
|
util.gotoDetail(item); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
pagePoint: function(e, type) { |
|
|
pagePoint: function(e, type) { |
|
|
@ -1014,10 +1358,14 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
//关闭全屏广告
|
|
|
//关闭全屏广告
|
|
|
closeFullAdv: function() { |
|
|
closeFullAdv: function() { |
|
|
this.setData({showFullAdv: false}) |
|
|
this.setData({ |
|
|
|
|
|
showFullAdv: false |
|
|
|
|
|
}) |
|
|
clearInterval(this.data.fullAdvTimer) |
|
|
clearInterval(this.data.fullAdvTimer) |
|
|
if (!this.data.alertSwipeList.length > 0) { |
|
|
if (!this.data.alertSwipeList.length > 0) { |
|
|
wx.showTabBar({animation: true}) |
|
|
wx.showTabBar({ |
|
|
|
|
|
animation: true |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 是否静音
|
|
|
// 是否静音
|
|
|
@ -1043,15 +1391,17 @@ Page({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
changeSimpleVal (e) { |
|
|
changeSimpleVal(e) { |
|
|
let keyname = e.currentTarget.dataset.keyname; |
|
|
let keyname = e.currentTarget.dataset.keyname; |
|
|
let val = e.currentTarget.dataset.val; |
|
|
let val = e.currentTarget.dataset.val; |
|
|
let param = {} |
|
|
let param = {} |
|
|
param[keyname] = val |
|
|
param[keyname] = val |
|
|
if (keyname == "cityIndex") { |
|
|
if (keyname == "cityIndex") { |
|
|
let scrollIndex = val-2 |
|
|
let scrollIndex = val - 2 |
|
|
if (scrollIndex<0) { scrollIndex = 0 } |
|
|
if (scrollIndex < 0) { |
|
|
param.scrollItem = "scrollItem-"+scrollIndex |
|
|
scrollIndex = 0 |
|
|
|
|
|
} |
|
|
|
|
|
param.scrollItem = "scrollItem-" + scrollIndex |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.setData(param) |
|
|
this.setData(param) |
|
|
@ -1059,7 +1409,9 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
onShow: function() { |
|
|
onShow: function() { |
|
|
this.pagePoint({event: 'home_view'}, 1) |
|
|
this.pagePoint({ |
|
|
|
|
|
event: 'home_view' |
|
|
|
|
|
}, 1) |
|
|
// 修复 首页广告点击后返回首页 tabbar不显示
|
|
|
// 修复 首页广告点击后返回首页 tabbar不显示
|
|
|
if (this.data.showTime && !this.data.showFullAdv) { |
|
|
if (this.data.showTime && !this.data.showFullAdv) { |
|
|
wx.showTabBar() |
|
|
wx.showTabBar() |
|
|
@ -1072,11 +1424,16 @@ Page({ |
|
|
app.globalData.isCartBuy = false |
|
|
app.globalData.isCartBuy = false |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
goAIUrl () { |
|
|
goAIUrl() { |
|
|
wx.switchTab({ |
|
|
wx.switchTab({ |
|
|
url: '/pages/pbService/aiHelpYou/index', |
|
|
url: '/pages/pbService/aiHelpYou/index', |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
goYjgl() { |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: '/pages/list/strategy/index' |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用户点击右上角分享 |
|
|
* 用户点击右上角分享 |
|
|
@ -1158,17 +1515,18 @@ Page({ |
|
|
// Ai避高峰
|
|
|
// Ai避高峰
|
|
|
gotoUrls() { |
|
|
gotoUrls() { |
|
|
// 判断是否登录
|
|
|
// 判断是否登录
|
|
|
var token = wx.getStorageSync("jstrip_token"), userId = wx.getStorageSync("jstrip_userid"); |
|
|
var token = wx.getStorageSync("jstrip_token"), |
|
|
if(!token || !userId) { |
|
|
userId = wx.getStorageSync("jstrip_userid"); |
|
|
|
|
|
if (!token || !userId) { |
|
|
let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html' |
|
|
let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html' |
|
|
|
|
|
|
|
|
app.globalData.weburl = url; |
|
|
app.globalData.weburl = url; |
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url), |
|
|
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(url), |
|
|
}) |
|
|
}) |
|
|
}else { |
|
|
} else { |
|
|
commonApi.user_post("uservice/user/userEncry").then(res => { |
|
|
commonApi.user_post("uservice/user/userEncry").then(res => { |
|
|
if(res.code == 1) { |
|
|
if (res.code == 1) { |
|
|
let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html?userEncry=' + res.data |
|
|
let url = 'https://wlsjzx.zdhxwl.cn/kt_h5/index.html?userEncry=' + res.data |
|
|
|
|
|
|
|
|
app.globalData.weburl = url; |
|
|
app.globalData.weburl = url; |
|
|
|