MCPcopy Create free account
hub / github.com/coderwhy/HYMiniMall / tabClick

Function tabClick

pages/home/home.js:65–85  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

63 onPageScroll(res) {
64 },
65 tabClick(e) {
66 // 1.根据当前的点击赋值最新的currentType
67 let currentType = ''
68 switch(e.detail.index) {
69 case 0:
70 currentType = POP
71 break
72 case 1:
73 currentType = NEW
74 break
75 case 2:
76 currentType = SELL
77 break
78 }
79 this.setData({
80 currentType: currentType
81 })
82 console.log(this.selectComponent('.tab-control'));
83 this.selectComponent('.tab-control').setCurrentIndex(e.detail.index)
84 this.selectComponent('.tab-control-temp').setCurrentIndex(e.detail.index)
85 },
86
87 onBackTop() {
88 // wx.pageScrollTo({

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected