recordApply.js
2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// components/recordApply/recordApply.js
import {
businessApi
} from "../../api/api";
import {
componentsMixin
} from "../../mixins/index";
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
applyData: {
type: Array,
default: [],
observer(n) {
this.setData({
dataList: n
})
}
}
},
/**
* 组件的初始数据
*/
data: {
dataList: [],
recordList: [],
popShow: false,
isClick: false
},
/**
* 组件的方法列表
*/
methods: {
getRecord(e) {
this.setData({
popShow: true
})
console.log(e);
const {activityId} = e.currentTarget.dataset.info
const params = {
activityId
}
businessApi.getApplyRecord(params).then(res => {
console.log(res, '000');
if(res&&res.code == 0) {
this.setData({
recordList: res.data
})
} else {
wx.showToast({
title: res.message || '系统异常',
icon: 'none'
})
}
})
},
// 关闭pop
closePop() {
this.setData({
popShow: false
})
},
// 切换跟进状态
changeFollow(e) {
this.setData({
isClick: true
})
const {activityId, followType} = e.currentTarget.dataset.follow
let data = {
activityId: activityId,
followType: followType == 0 ? 1 : 0
}
businessApi.activityFollow(data).then(res => {
if (res.code == 0) {
this.triggerEvent('changeApplyData', activityId)
wx.showToast({
title: '跟进状态修改成功',
icon: 'none'
})
} else {
wx.showToast({
title: res.message || '系统异常',
icon: 'none'
})
}
})
},
// 打电话
callApply(e) {
console.log(e);
const phoneNumber = e.currentTarget.dataset.phone
wx.makePhoneCall({
phoneNumber: phoneNumber,
});
}
}
})