新增专区,调整分页bug
This commit is contained in:
96
pages/special/index.js
Normal file
96
pages/special/index.js
Normal file
@@ -0,0 +1,96 @@
|
||||
// pages/special/index.js
|
||||
import { getServicesList } from '../../service/system'
|
||||
import request from '../../utils/request'
|
||||
import { alertInfo } from '../../utils/index'
|
||||
const { OK } = request;
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
servicesList: []
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
async init() {
|
||||
const { code, message, data } = await getServicesList()
|
||||
if (code !== OK) {
|
||||
alertInfo(message);
|
||||
return;
|
||||
}
|
||||
this.setData({ servicesList: data })
|
||||
},
|
||||
clickService(e) {
|
||||
console.log('e', e)
|
||||
const { type, value } = e.currentTarget.dataset.data;
|
||||
switch(type) {
|
||||
case 0:
|
||||
const [appId, path] = value.split(",")
|
||||
wx.navigateToMiniProgram({
|
||||
appId: appId,
|
||||
path: path
|
||||
})
|
||||
break;
|
||||
case 1:
|
||||
wx.navigateTo({
|
||||
url: value,
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.init()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user