| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- const app = getApp();
- Page({
- data: {
- },
- onLoad: function () {
- app.globalData.userInfo={};
- app.globalData.userInfo.UserID=1;
- var that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- });
- },
- onShow:function(){
- var that = this;
- main.getLocalHost(function () {
- common.getStorageValue(that, "CardMaxNumberNew", 10, function () {
- common.getStorageValue(that, "CardMaxNumberHistory", 30, function () {
- that.getList();
- wx.stopPullDownRefresh();
- });
- });
- });
- },
- onPullDownRefresh:function(){
- this.onShow();
- },
- goto:function(e){
- var url=e.currentTarget.dataset.url;
- wx.navigateTo({
- url: './'+url,
- })
- },
- getList: function () {
- var that = this;
- var url = 'GetMiaoguoCardToday?UserID=' + app.globalData.userInfo.UserID;
- url += "&New=" + this.data.CardMaxNumberNew;
- url += "&History=" + this.data.CardMaxNumberHistory;
- main.getData(url, function (data) {
- if (data) {
- var TodayTaskNumber=data.ListNew.length+data.ListReview.length+data.ListHistory.length;
- that.setData({
- List: data,
- TodayTaskNumber: TodayTaskNumber
- });
- wx.setStorageSync("TaskToday", data);
- main.getData("GetBaiduToken",function(data){
- app.globalData.BaiduToken = data;
- });
- }
- });
- },
- gotoCard: function () {
- wx.redirectTo({
- url: './searchCard',
- })
- },
- onShareAppMessage: function () {
- return {
- title: '',
- path: 'pages/miaoguo/default',
- success: function (res) {
- },
- fail: function (err) {
- console.log(err);
- },
- complete: function (res) {
- console.log(res);
- },
- }
- },
- })
|