/
goodsPage.js
executable file
·64 lines (63 loc) · 1.42 KB
/
goodsPage.js
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
const goodsCommands = {
switchTab: function(hashValue) {
return this.url.client.urlHash(hashValue)
}
}
module.exports = {
url: function() {
let goodsID = '21751464218102';
// Todo: 依照環境選擇不同的 goodsID
return this.rtUrl('goods', '/item/show?' + goodsID);
},
commands: [goodsCommands],
sections: {
auctionData: {
selector: '.auction-data',
elements: {
gallery: {
selector: '.item-gallery-main-image'
},
coverImage: {
selector: '.js-main-img'
},
selectedThumbnail: {
selector: '.imgSelected img'
},
imgPopup: {
selector: '.img-popup'
},
imgPopupCloseBtn: {
selector: '.img-popup .rt-jqmodal-jqmClose'
},
qtyBtnPlus: {
selector: '.item-qty-button-plus'
},
qtyBtnMinus: {
selector: '.item-qty-button-minus'
}
}
},
tabs: {
selector: '.rt-tab-wrap',
elements: {
tabGoodsDetail: {
selector: '.rt-tab-item:nth-of-type(1) a'
},
tabQnA: {
selector: '.rt-tab-item:nth-of-type(2) a'
},
tabHistory: {
selector: '.rt-tab-item:nth-of-type(3) a'
}
}
},
sidebar: {
selector: '.sidebar-wrap',
elements: {
sideAdvertise: {
selector: '.side-advertise'
}
}
}
}
};