122 lines
2.1 KiB
JavaScript
122 lines
2.1 KiB
JavaScript
// packageH/toker/tokerSetMeal/tokerSetMeal.js
|
|
var app = getApp();
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
id:0,
|
|
active:0,
|
|
operationBoxIndex:null,
|
|
|
|
// page: 1, //分页数,当前页数
|
|
// isLoadMore: true, //判断是否要加载更多的标志
|
|
// total_page: 0, //总页数
|
|
|
|
info:{},
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
this.data.id = options.id;
|
|
this.getData();
|
|
},
|
|
|
|
setOperationBoxIndex(evt){
|
|
let index = evt.currentTarget.dataset.index;
|
|
if(index != this.data.operationBoxIndex){
|
|
this.setData({
|
|
operationBoxIndex:index
|
|
});
|
|
}else {
|
|
this.setData({
|
|
operationBoxIndex:null
|
|
});
|
|
}
|
|
},
|
|
|
|
changeTags(evt){
|
|
|
|
this.setData({
|
|
active:evt.detail.name
|
|
});
|
|
this.getData();
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
|
|
getData(){
|
|
let urlStr="";
|
|
if (this.data.active == 0) {
|
|
urlStr = app.getNetAddresss("plugin.customer-development.Frontend.controllers.detail.once");
|
|
} else {
|
|
urlStr = app.getNetAddresss("plugin.customer-development.Frontend.controllers.detail.many");
|
|
}
|
|
app._getNetWork({
|
|
url: urlStr,
|
|
data:{id:this.data.id},
|
|
success: (resdata) => {
|
|
var res = resdata.data;
|
|
if (res.result != 1) return app.tips(res.msg);
|
|
this.setData({
|
|
info:res.data.member_cards
|
|
});
|
|
wx.setNavigationBarTitle({
|
|
title: res.data.plugin_name ? res.data.plugin_name :'拓客卡',
|
|
});
|
|
}
|
|
});
|
|
},
|
|
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
}
|
|
}); |