|
@@ -5,19 +5,6 @@ Component({
|
|
|
},
|
|
|
data: {
|
|
|
list: [],
|
|
|
- sheet: {
|
|
|
- actions: [{
|
|
|
- name: "呼叫"
|
|
|
- }, {
|
|
|
- name: "详情"
|
|
|
- }, {
|
|
|
- name: "编辑"
|
|
|
- }, {
|
|
|
- name: "删除"
|
|
|
- }],
|
|
|
- item: {},
|
|
|
- show: false
|
|
|
- },
|
|
|
content: {
|
|
|
"nacache": true,
|
|
|
"pageNumber": 1,
|
|
@@ -37,7 +24,6 @@ Component({
|
|
|
content.pageNumber = 1
|
|
|
content.pageTotal = 1
|
|
|
}
|
|
|
- if (content.pageNumber > content.pageTotal) return;
|
|
|
_Http.basic({
|
|
|
"id": "20221018150602",
|
|
|
content
|
|
@@ -57,71 +43,10 @@ Component({
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- onClick(e) {
|
|
|
- const {
|
|
|
- item
|
|
|
- } = e.currentTarget.dataset;
|
|
|
- this.setData({
|
|
|
- "sheet.item": item,
|
|
|
- "sheet.show": true
|
|
|
- })
|
|
|
- },
|
|
|
- onCancel() {
|
|
|
+ changeTotal() {
|
|
|
this.setData({
|
|
|
- "sheet.item": null,
|
|
|
- "sheet.show": false
|
|
|
+ "content.total": this.data.content.total - 1
|
|
|
})
|
|
|
- },
|
|
|
- onSelect(e) {
|
|
|
- let item = this.data.sheet.item,
|
|
|
- that = this;
|
|
|
- switch (e.detail.name) {
|
|
|
- case "呼叫":
|
|
|
- wx.makePhoneCall({
|
|
|
- phoneNumber: item.phonenumber,
|
|
|
- })
|
|
|
- break;
|
|
|
- case "删除":
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: `是否确认删除"${item.name}"`,
|
|
|
- complete: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- _Http.basic({
|
|
|
- "id": "20221018145502",
|
|
|
- "content": {
|
|
|
- "contactsid": item.contactsid,
|
|
|
- "sys_enterpriseid": item.sys_enterpriseid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log(res)
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- that.setData({
|
|
|
- list: this.data.list.filter(v => v.contactsid != item.contactsid)
|
|
|
- });
|
|
|
- wx.showToast({
|
|
|
- title: `已删除"${item.name}"!`,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- break;
|
|
|
- case "编辑":
|
|
|
- wx.navigateTo({
|
|
|
- url: `/packageA/setclient/modules/contacts/add/index?data=${JSON.stringify(item)}`
|
|
|
- })
|
|
|
- break;
|
|
|
- default:
|
|
|
- console.log(e.detail.name)
|
|
|
- break;
|
|
|
- }
|
|
|
- console.log(e)
|
|
|
- this.onCancel()
|
|
|
}
|
|
|
}
|
|
|
})
|