沙盘演示系统应用的微信小程序
zuoxiao
2024-10-18 35cd1fc2e97ee8c8ec93d632cfc6b8b90e7a6e2b
pages/rechargeCard/rechargeCard.js
@@ -9,19 +9,81 @@
   * 页面的初始数据
   */
  data: {
    confirmBtn: { content: '确认', variant: 'base' },
    confirmBtn: {
      content: '确认'
    },
    currentTab: 0, // 当前显示的表格,默认为第一个表格
    allCardPoints: [],
    allWaterPoints:[],
    showDialog:false
    allCardPoints: [{
      "id": "string",
      "inUse": 0,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    }, {
      "id": "string",
      "inUse": 0,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    }, {
      "id": "string",
      "inUse": 0,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    }, {
      "id": "string",
      "inUse": 0,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    }, {
      "id": "string",
      "inUse": 1,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    }],
    allWaterPoints: [{
      "id": "string",
      "inUse": 1,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    },{
      "id": "string",
      "inUse": 1,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    },{
      "id": "string",
      "inUse": 1,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    },{
      "id": "string",
      "inUse": 1,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    },{
      "id": "string",
      "inUse": 1,
      "inUseName": "string",
      "money": 110,
      "vcNum": "200030000000"
    }],
    showDialog: false
  },
 // 切换 Tabs
 switchTab: function (e) {
  const tab = parseInt(e.currentTarget.dataset.tab);
  this.setData({
    currentTab: tab
  });
},
  // 切换 Tabs
  switchTab: function (e) {
    const tab = parseInt(e.currentTarget.dataset.tab);
    this.setData({
      currentTab: tab
    });
  },
  /**
   * 生命周期函数--监听页面加载
   */
@@ -77,58 +139,67 @@
   */
  onShareAppMessage() {
  },//获取虚拟卡列表
  getCardList(){
    get({url:'https://d4x9787456.vicp.fun/sell/virtual_card/get', data: {
      operator: getApp().globalData.sessionId
    }})
    .then((data) => {
      if(data.success&&data.code==="0001"){
        this.setData({
          allCardPoints:  data.content
        });
      }else{
        wx.showToast({
          title: data.msg,
        })
      }
      console.log('Failed to add item:');
    })
    .catch((error) => {
      console.error('Failed to add item:', error);
    });
  }, //获取虚拟卡列表
  getCardList() {
    get({
        url: 'wx/virtual_card/get',
        data: {
          clientId: getApp().globalData.clientId
        }
      })
      .then((data) => {
        if (data.success && data.code === "0001") {
          this.setData({
            allCardPoints: data.content
          });
          this.updateDisplayText();
        } else {
          wx.showToast({
            title: data.msg,
          })
        }
        console.log('Failed to add item:');
      })
      .catch((error) => {
        console.error('Failed to add item:', error);
      });
  },
  getWaterCardList(){
    get({url:'https://d4x9787456.vicp.fun/sell/virtual_card/get', data: {
      operator: getApp().globalData.sessionId
    }})
    .then((data) => {
      if(data.success&&data.code==="0001"){
        this.setData({
          allWaterPoints:  data.content
        });
      }else{
        wx.showToast({
          title: data.msg,
        })
      }
      console.log('Failed to add item:');
    })
    .catch((error) => {
      console.error('Failed to add item:', error);
    });
  getWaterCardList() {
    get({
        url: 'https://d4x9787456.vicp.fun/sell/virtual_card/get',
        data: {
          operator: getApp().globalData.sessionId
        }
      })
      .then((data) => {
        if (data.success && data.code === "0001") {
          this.setData({
            allWaterPoints: data.content
          });
        } else {
          wx.showToast({
            title: data.msg,
          })
        }
        console.log('Failed to add item:');
      })
      .catch((error) => {
        console.error('Failed to add item:', error);
      });
  },
  rechargeCard(item){
  rechargeCard(item) {
    wx.navigateTo({
      url: '/pages/rechargeMoney/rechargMoney' // 首页的路径,根据实际情况填写
    });
  },
  ruinCard(){
  },
  closeDialog(){
  ruinCard() {
    this.setData({
      showDialog:false
      showDialog: true
    })
  },
  closeDialog() {
    this.setData({
      showDialog: false
    })
  }