deposit.js
2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var t = getApp(),
  a = t.request,
  o = t.globalData.setting,
  os = o,
  i = require("../../../utils/util.js"),
  ut = i,
  s = require("../../../utils/common.js");
var regeneratorRuntime = require('../../../utils/runtime.js');
Page({
  data:{
    yucun_money:0,
    parameter:true,
    iurl: o.imghost,
    is_show_yckcz:0,
  },
  /**
    * 生命周期函数--监听页面显示
    */
  onShow: function () {
  //  --先判断会员状态--
    var user_info = getApp().globalData.userInfo;
    if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
      wx.navigateTo({ url: '/pages/togoin/togoin', })
      return false;
    }
    wx.setNavigationBarTitle({
      title: "预存款",
    })
    var th = this;
    getApp().getConfig2(function (ee) {
      var json_d = JSON.parse(ee.switch_list);
      th.setData({ is_show_yckcz: json_d.yckcz_switch });
    },1)
  },
 
         /**
          * 生命周期函数--监听页面初次渲染完成
          */
  onReady: function () {
    this.yuck();
  },
  //预存款
  async yuck(){
    var user_id =getApp().globalData.user_id;
    var store_id = os.stoid;
    console.log(user_id, "有进来吗银行卡", store_id);
   
    await getApp().request.promiseGet("/api/weshop/users/listYuMoney", {
      data: { user_id: user_id, store_id: store_id  }
    }).then(res => {
      var a = res.data;
      console.log("在这了",a);
     var yucun_money = a.data.yucun_money;
     var list= a.data.list1;
      if (list.length != 0){
       console.log(list, "s1w" + yucun_money);
          list=list.map(item=>{
          item['EndDate']=item['EndDate'].replace('00:00:00','23:59:59');
          return item;
       });
        this.setData({ yucun_money: yucun_money, list: list, parameter: false });
     }else{
        console.log("在这里111", list.length);
        this.setData({ parameter:true});
     }
     
    })
   
  },
  jumPage: function () {
    wx.navigateTo({
      url: 'prepaid/prepaid',
    })
  },
  /**
      * 生命周期函数--监听页面加载
      */
  onLoad: function (options) {
  },
})