scenePopup.js
2.3 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
* @Description:
* @Author: huyue
* @Date: 2024-05-07 15:29:35
* @LastEditors: huyue
* @LastEditTime: 2024-05-22 14:01:16
*/
// packageEquity/pages/aiCheck/components/scenePopup/scenePopup.js
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean
},
popType: {
type: String
},
avatar:String,
// 话术攻防的数据列表
scriptList: {
type: Array
},
// 对话灵感内容
inspirationContent: {
type: String,
observer: function (n) {
this.setData({content:n})
}
}
},
/**
* 组件的初始数据
*/
data: {
customeTypeList: [
{
id: 1,
name: '独裁型',
imgUrl: '2'
},
{
id: 2,
name: '沉默型',
imgUrl: '1'
},
{
id: 3,
name: '理智型',
imgUrl: '5'
},
{
id: 4,
name: '人际型',
imgUrl: '7'
},
{
id: 5,
name: '犹豫型',
imgUrl: '9'
},
{
id: 6,
name: '价格型',
imgUrl: '3'
},
{
id: 7,
name: '新手司机',
imgUrl: '4'
},
{
id: 8,
name: '老手司机',
imgUrl: '1'
},
{
id: 9,
name: '女司机',
imgUrl: '6'
}
],
selectedIndex: 0,
config: {
heightObj: {
'scene': '960rpx',
'inspiration': '720rpx',
'script': '912rpx'
},
titleObj: {
'scene': '场景设置',
'inspiration': '',
'script': '话术攻防'
},
hasClose: {
'scene': true,
'inspiration': false,
'script': true
}
}
},
/**
* 组件的方法列表
*/
methods: {
selectScript:wx.$util.throttle(function (e) {
const {content,index} = e.currentTarget.dataset;
this.triggerEvent('handleScript',{content,index})
},2000),
selectCustomerType(e) {
this.setData({
selectedIndex: e.currentTarget.dataset.index
})
},
preserve() {
this.triggerEvent('scene', { selectedIndex: this.data.selectedIndex })
},
cancel() {
this.triggerEvent('cancel')
},
handleMask() {
this.triggerEvent('handleMask')
}
}
})