12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- //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) {
- if (res.code == 200) {
- self.getDatas(res.datas.tabs[0].special_id);
- self.setData({
- tabs: res.datas.tabs
- });
- }
- })
- },
- onMyEvent: function (e) {
- this.getDatas(e.detail.special_id)
- },
- getDatas(special_id) {
- var self = this;
- getReq({
- act: 'special',
- op: 'index',
- special_id,
- page: 10,
- curpage: 1
- }, function (res) {
- if (res.code == 200) {
- console.log(res)
- self.setData({
- special_datas: res.datas,
- summery:res.datas.summary
- });
- }
- setTimeout(function () {
- wx.hideLoading()
- }, 2000)
- })
- }
- })
|