introduction.js
3.04 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
130
/*
* @Description:
* @Author: huyue
* @Date: 2024-05-16 10:43:18
* @LastEditors: huyue
* @LastEditTime: 2024-10-22 15:22:57
*/
// packageEquity/pages/aiCheck/start/components/introduction.js
import aiApi from "~/packageStudy/aiApi"
import util from "~/utils/util"
Component({
lifetimes: {
attached: function () {
let userInfo = util.getStorageSync('dj_boutique_user_info')
let username = userInfo.name.length < 5 ? userInfo.name : userInfo.name.slice(0, 4) + '...'
this.setData({
username
})
}
},
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
productList: [
{
id: 1,
name: '驻店延保',
description: '模拟驻店人员向车主推销延保产品',
type: 1,
imgName: 'product-1',
isAvailable: true,
bg: 'bg1',
eventCode: 'storeExtended_warranty'
},
{
id: 2,
name: '延保',
description: '模拟客户在驻店售卖延保过程中的各类问题',
type: 2,
imgName: 'product-2',
isAvailable: true,
bg: 'bg2',
eventCode: 'extended_warranty'
},
{
id: 3,
name: '安心包',
description: '模拟客户在驻店售卖安心包过程中的各类问题',
type: 2,
imgName: 'product-3',
isAvailable: true,
bg: 'bg2',
eventCode: 'peace_pack'
},
{
id: 4,
name: '权益升级',
description: '快速获取车主需求,推荐权益产品',
type: 1,
imgName: 'product-4',
isAvailable: false,
bg: 'bg3',
eventCode: 'benefit_upgrades'
},
{
id: 5,
name: '轻改升级',
description: '通过精品礼券,引导客户到店轻改升级',
type: 1,
imgName: 'product-5',
isAvailable: false,
bg: 'bg3',
eventCode: 'modification_upgrades'
}
],
popVisible: false,
userName: null
},
/**
* 组件的方法列表
*/
methods: {
// 我知道了
confirm() {
this.setData({
popVisible: false
})
},
toExperience: wx.$util.throttle(function (e) {
console.log(11, e)
const { id, available, type, eventcode } = e.currentTarget.dataset
wx.$track.setTrackData(0, eventcode, {
id
}, '', 0)
if (type == 1) {
if (available) {
// 调用接口
this.setSparringVerify(id)
} else {
this.setData({
popVisible: true
})
// wx.showToast({
// title: '更多功能正在开发中...',
// icon: 'none',
// duration: 2000
// })
}
} else if (type == 2) {
wx.navigateTo({
url: `/packageStudy/pages/aiCheck/defense/defense?id=${id}`
})
}
}, 1000),
setSparringVerify(id) {
wx.navigateTo({
url: `/packageStudy/pages/aiCheck/scene/scene?id=${id}`
})
},
}
})