consumeAmount.js 1.7 KB
// pages/me/consumeAmount.js
import App from '../../utils/api';
import util from '../../utils/util';
Page({

    /**
     * 页面的初始数据
     */
    data: {
        sellerList: [],
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.getInfo()
    },
    // 获取用户消费金商家余额列表
    getInfo() {
        App.Activity.GetConsumeSellerListByOpenid({
            openid: getApp().openid,
        }).then(res => {
            let sellerList = res.data;
            sellerList.forEach(i => {
                i.balance = (i.balance * 1).toFixed(2)
            })
            this.setData({
                sellerList
            })
        })
    },
    // 跳转用户商家消费金消费记录
    getSeller(event) {
        wx.navigateTo({
            url: util.http_build_query({
                sellerid: event.currentTarget.dataset.id
            }, '/pages/me/consumeDetails')
        })
    },
    // 换号查看
    switchAccount() {
        wx.redirectTo({
            url: util.http_build_query({
                types: '3'
            }, '/pages/customer/login')
        })
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {

    },
})