anchor.js
1.4 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
import event from '../../../utils/event';
// const router = global.router;
import { jumpByUrl } from '../../../libs/urlRoute';
Component({
properties: {
url: {
type: String,
value: ''
},
hasUrl: {
type: Boolean,
value: true
},
isFloor: {
type: Number,
value: 0
},
floorData: Object,
floorIdx: Number,
itemIdx: Number,
},
methods: {
jumpTo: function() {
if (this.data.isFloor) {
const {
template_id,
template_name,
} = this.data.floorData;
let reportParams = {
F_ID: template_id || '0',
F_NAME: template_name || '',
F_URL: this.data.url || '',
F_INDEX: (this.data.floorIdx || 0) + 1 ,
I_INDEX: (this.data.itemIdx || 0) + 1
};
event.emit('anchor-click', reportParams);
}
// this.data.url && router.goUrl(this.data.url);
if(this.data.hasUrl) {
this.data.url && jumpByUrl(this.data.url, 'home');
} else {
wx.navigateTo({
url: this.data.url
});
}
}
}
});