card-mini/packagecard/shop/index/shop.js

121 lines
2.5 KiB
JavaScript

// pages/shop/shop.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
type: app.globalData.servicePageType,
isPageBack: false,
active: 1
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// if (this.data.type == 1) {
// console.log("测试")
// wx.navigateTo({
// url: '../../shop/catalog/bannerlist/bannerlist'
// })
// } else if (this.data.type == 2) {
// wx.navigateTo({
// url: '../../shop/catalog/column/column',
// })
// } else if (this.data.type == 3) {
// wx.navigateTo({
// url: '../../shop/catalog/list/list',
// })
// } else if (this.data.type == 4) {
// wx.navigateTo({
// url: '../../shop/bespeak/bespeak',
// })
// }
},
tabChange(e) {
this.setData({
active: e.detail
})
if (this.data.active == 0) {
//首页
wx.redirectTo({
url: '/pages/index/index',
})
} else if (this.data.active == 1) {
// 服务
wx.redirectTo({
url: '/pages/shop/index/shop',
})
} else {
//我的
wx.redirectTo({
url: '/pages/mine/index/index',
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
// if (!this.data.isPageBack) {
// if (this.data.type == 1) {
// console.log("测试")
// wx.navigateTo({
// url: '../../shop/catalog/bannerlist/bannerlist'
// })
// } else if (this.data.type == 2) {
// wx.navigateTo({
// url: '../../shop/catalog/column/column',
// })
// } else if (this.data.type == 3) {
// wx.navigateTo({
// url: '../../shop/catalog/list/list',
// })
// } else if (this.data.type == 4) {
// wx.navigateTo({
// url: '../../shop/catalog/bannerlist/bannerlist'
// })
// }
// }
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
clickT: function () {
}
})