123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- const app = getApp()
- const util = require("../../../utils/util");
- const api = require('../../../api/api.js');
- const user = require('../../../utils/user.js');
- // const update = require('../../../api/update.js');
- Page({
- data: {
- activeTab:1,
- ticketList:[
-
- ]
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.selectComponent('#tabs').resize();
- this.getList(1);
- },
- onTabChange(e) {
- this.setData({
- activeTab: e.detail.name,
- });
- if (this.data.activeTab == 1) {
- this.getList(1);
- }else{
- this.getList(2);
- }
- },
- getList(status){
- wx.showLoading({
- title: '加载中...',
- });
- util.request(api.crmTicket, {
- status:status
- }, 'GET').then(res=> {
- wx.hideLoading();
- if (res.errno === 0) {
- console.log(res);
- this.setData({
- ticketList:res.data.ticketList
- });
- }
- }).catch(err=>{
- wx.hideLoading();
- });
- },
- goDetail(e){
- let id=e.currentTarget.dataset.id;
- if(id){
- wx.navigateTo({
- url: '/pages/upgrade/ticketDetail/ticketDetail?bookTradeNo=' + id,
- });
- }
-
- },
- onReachBottom() {
- // if (this.data.totalPages > this.data.page) {
- // this.setData({
- // page: this.data.page + 1
- // });
- // this.getGoodsList();
- // } else {
- // wx.showToast({
- // title: '没有更多商品了',
- // icon: 'none',
- // duration: 2000
- // });
- // return false;
- // }
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
-
-
- },
-
- onHide: function () {
- },
- onUnload: function () {
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- },
-
- })
|