yuminge-app/yun-min-program-plugin-master/packageI/independenceBalance/independenceBalance.js

121 lines
2.2 KiB
JavaScript

// packageI/independenceBalance/independenceBalance.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.store_id){
this.setData({
store_id:options.store_id
});
}
this.getData();
},
onClickleft(){
wx.navigateBack({
delta: 1,
});
},
goDetail(){
wx.navigateTo({
url: '/packageI/independenceBalance/storeBalanceDetail/storeBalanceDetail?store_id='+this.data.store_id,
});
},
goStoreBalance(){
wx.navigateTo({
url: '/packageI/independenceBalance/storeBalance/balance_recharge?store_id='+this.data.store_id,
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
getData(){
let urlStr = app.getNetAddresss("plugin.store-cashier.frontend.store.balance.home.index");
app._postNetWork({
url: urlStr,
data: {
store_id: this.data.store_id,
},
success: (resdata)=>{
let res = resdata.data;
if(res.result == 1) {
this.setData({
title:res.data.title,
store_name:res.data.store_name,
member_balance:res.data.member_balance,
show_button:res.data.show_button,
});
if(res.data.title) {
wx.setNavigationBarTitle({
title: res.data.title,
});
}
}else {
app.tips(res.msg);
}
},
fail: function(res){
wx.showToast({
title: res.data.msg,
duration:1000,
icon:'none'
});
}
});
}
});