98 lines
1.7 KiB
JavaScript
98 lines
1.7 KiB
JavaScript
// pages/shop/product/product.js
|
|
const app = getApp()
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
isSticky: false,
|
|
titleBarHeight: 0,
|
|
statusBarHeight: 0,
|
|
swiperlist: [
|
|
'https://image.weilanwl.com/img/4x3-1.jpg',
|
|
'https://image.weilanwl.com/img/4x3-2.jpg',
|
|
'https://image.weilanwl.com/img/4x3-3.jpg',
|
|
'https://image.weilanwl.com/img/4x3-4.jpg',
|
|
],
|
|
tabList: [
|
|
"热门推荐",
|
|
"破尿酸",
|
|
"除皱瘦脸",
|
|
"眼部整形",
|
|
"水光华能"
|
|
],
|
|
TabCur: 0,
|
|
scrollLeft: 0
|
|
},
|
|
tabSelect(e) {
|
|
this.setData({
|
|
TabCur: e.currentTarget.dataset.id,
|
|
scrollLeft: (e.currentTarget.dataset.id - 1) * 60
|
|
})
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
let height = app.globalData.CustomBar
|
|
let statusHeight = app.globalData.StatusBar
|
|
this.setData({
|
|
titleBarHeight: height,
|
|
statusBarHeight: statusHeight
|
|
})
|
|
},
|
|
scrollSticky(event) {
|
|
this.setData({
|
|
isSticky: event.detail.isFixed
|
|
})
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
}
|
|
}) |