123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- //index.js
- //获取应用实例
- const getReq = require('./../../config.js').getReq;
- const app = getApp();
- Page({
- data: {
- tabs: [],
- special_datas:{},
- summery:[]
- },
- onLoad: function () {
- var self = this
- getReq({
- act: 'index',
- op: 'tabs'
- }, function (res) {
- console.log(res);
- if (res.code == 200) {
- self.getDatas(res.datas.tabs[0].special_id);
- self.setData({
- tabs: res.datas.tabs
- });
- }
- })
- },
- onMyEvent: function (e) {
- this.setData({
- special_datas: {},
- summery: []
- });
- this.getDatas(e.detail.item.special_id)
- },
- getDatas(special_id) {
- wx.showLoading({
- title: '加载中'
- });
- var self = this;
- getReq({
- act: 'special',
- op: 'index',
- special_id,
- page: 10,
- curpage: 1
- }, function (res) {
- if (res.code == 200) {
- self.setData({
- special_datas: res.datas,
- summery:res.datas.summary
- });
- }
- setTimeout(function () {
- wx.hideLoading()
- }, 1000)
- })
- }
- })
|