62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
import ActionSheet, { ActionSheetTheme } from '../../../miniprogram_npm/tdesign-miniprogram/action-sheet/index';
|
|
let handler = null;
|
|
const app = getApp();
|
|
Page({
|
|
data: {
|
|
isAccount: 0,
|
|
isIncome: 0,
|
|
isAdd: 0,
|
|
showDeleteConfirm: false,
|
|
icon : null
|
|
},
|
|
onLoad: function (options) {
|
|
this.setData({
|
|
isAccount : options.isAccount,
|
|
isIncome : options.isIncome,
|
|
isAdd : options.isAdd
|
|
})
|
|
},
|
|
handleMultiAction(e) {
|
|
if (this.data.isAccount == 1) {
|
|
handler = ActionSheet.show({
|
|
theme: ActionSheetTheme.Grid,
|
|
selector: '#t-action-sheet',
|
|
context: this,
|
|
items: app.globalData.accountIcon
|
|
});
|
|
}else {
|
|
handler = ActionSheet.show({
|
|
theme: ActionSheetTheme.Grid,
|
|
selector: '#t-action-sheet',
|
|
context: this,
|
|
items: app.globalData.billIcon
|
|
});
|
|
}
|
|
},
|
|
onCancel(){
|
|
handler.close();
|
|
},
|
|
handleSelected(e) {
|
|
let {icon} = e.detail.selected
|
|
this.setData({icon})
|
|
},
|
|
saveSetting () {
|
|
wx.navigateBack();
|
|
},
|
|
deleteSetting() {
|
|
this.setData({
|
|
showDeleteConfirm: true
|
|
})
|
|
},
|
|
onConfirm (e) {
|
|
app.$api.deleteSetting();
|
|
wx.navigateBack();
|
|
this.closeDialog();
|
|
},
|
|
closeDialog() {
|
|
this.setData({
|
|
showDeleteConfirm: false
|
|
})
|
|
}
|
|
});
|