project init
This commit is contained in:
60
pages/settings/edit/index.js
Normal file
60
pages/settings/edit/index.js
Normal file
@@ -0,0 +1,60 @@
|
||||
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) {
|
||||
wx.navigateBack();
|
||||
this.closeDialog()
|
||||
},
|
||||
closeDialog() {
|
||||
this.setData({
|
||||
showDeleteConfirm: false
|
||||
})
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user