微信API 账单处理
This commit is contained in:
@@ -1,15 +1,41 @@
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
sid: null,
|
||||
showDeleteConfirm: false,
|
||||
title : "账单名称",
|
||||
money : "2000"
|
||||
|
||||
name : null,
|
||||
money : null,
|
||||
balance : null,
|
||||
date : null,
|
||||
billType: null,
|
||||
moneyName: null,
|
||||
fromAccountName: null,
|
||||
accountName: null,
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
let sid = options.id
|
||||
this.setData({sid})
|
||||
},
|
||||
onShow() {
|
||||
app.$api.getBill(this.data.sid).then(res => {
|
||||
if (res.data) {
|
||||
let sid = res.data.id
|
||||
let name = res.data.name
|
||||
let money = res.data.money
|
||||
let balance = res.data.balance
|
||||
let date = res.data.date
|
||||
let billType = res.data.billType
|
||||
let moneyName = res.data.moneyName
|
||||
let fromAccountName = res.data.fromAccountName
|
||||
let accountName = res.data.accountName
|
||||
this.setData({sid,name,money,balance,date,billType,moneyName,fromAccountName,accountName})
|
||||
}
|
||||
})
|
||||
},
|
||||
editBill() {
|
||||
wx.navigateTo({
|
||||
url: './edit/index'
|
||||
url: './edit/index?id=' + this.data.sid
|
||||
})
|
||||
},
|
||||
deleteBill() {
|
||||
@@ -18,8 +44,12 @@ Page({
|
||||
})
|
||||
},
|
||||
onConfirm (e) {
|
||||
wx.navigateBack();
|
||||
this.closeDialog()
|
||||
app.$api.deleteBill(this.data.sid).then(res => {
|
||||
if (res){
|
||||
wx.navigateBack();
|
||||
this.closeDialog()
|
||||
}
|
||||
})
|
||||
},
|
||||
closeDialog() {
|
||||
this.setData({
|
||||
|
||||
Reference in New Issue
Block a user