12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- let app = getApp();
- const getReq = require('./../../config.js').getReq;
- Page({
- data: {
- tabs: [],
- special_datas: {},
- summery: []
- },
- onShow: function() {
- if (app.globalData.backLogin) {
- app.globalData.backLogin = false;
- wx.reLaunch({
- url: "/pages/index/index"
- });
- }
- },
- onLoad: function () {
- this.req_tabs();
- },
- req_tabs(){
- let 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.setData({
- special_datas: {},
- summery: []
- });
- this.getDatas(e.detail.item.special_id)
- },
- getDatas(special_id) {
- wx.showLoading({
- title: '加载中'
- });
- let self = this;
- getReq({
- act: 'special',
- op: 'index',
- special_id,
- page: 10,
- curpage: 1
- }, function (res) {
- console.log(res);
- if (res.code == 200) {
- self.setData({
- special_datas: res.datas,
- summery: res.datas.summary
- });
- }
- setTimeout(function () {
- wx.hideLoading()
- }, 1000)
- })
- }
- })
|