|
@@ -31,6 +31,7 @@ Page({ |
|
@@ -31,6 +31,7 @@ Page({ |
|
31
|
this.setData({
|
31
|
this.setData({
|
|
32
|
packs:packs,
|
32
|
packs:packs,
|
|
33
|
activityId:this.activityId,
|
33
|
activityId:this.activityId,
|
|
|
|
34
|
+ current:this.getCurrent(this.activityId,packs)
|
|
34
|
})
|
35
|
})
|
|
35
|
this.getActivityDetail()
|
36
|
this.getActivityDetail()
|
|
36
|
})
|
37
|
})
|
|
@@ -84,13 +85,8 @@ Page({ |
|
@@ -84,13 +85,8 @@ Page({ |
|
84
|
onShareAppMessage: function () {
|
85
|
onShareAppMessage: function () {
|
|
85
|
|
86
|
|
|
86
|
},
|
87
|
},
|
|
87
|
- touchTab(e){
|
|
|
|
88
|
- this.activityId=util.attr(e,'id')
|
|
|
|
89
|
- let obj={
|
|
|
|
90
|
- activityId:this.activityId,
|
|
|
|
91
|
- }
|
|
|
|
92
|
- let id=util.attr(e,'id')
|
|
|
|
93
|
- let ps=Object.keys(this.data.packs)
|
88
|
+ getCurrent(id,packs){
|
|
|
|
89
|
+ let ps=Object.keys(packs)
|
|
94
|
let index=ps.indexOf(id)
|
90
|
let index=ps.indexOf(id)
|
|
95
|
let length=ps.length;
|
91
|
let length=ps.length;
|
|
96
|
let current=0
|
92
|
let current=0
|
|
@@ -99,7 +95,15 @@ Page({ |
|
@@ -99,7 +95,15 @@ Page({ |
|
99
|
}else{
|
95
|
}else{
|
|
100
|
current=index>0?(index-1):0
|
96
|
current=index>0?(index-1):0
|
|
101
|
}
|
97
|
}
|
|
102
|
- obj.current=current
|
98
|
+ return current
|
|
|
|
99
|
+ },
|
|
|
|
100
|
+ touchTab(e){
|
|
|
|
101
|
+ this.activityId=util.attr(e,'id')
|
|
|
|
102
|
+ let obj={
|
|
|
|
103
|
+ activityId:this.activityId,
|
|
|
|
104
|
+ }
|
|
|
|
105
|
+ let id=util.attr(e,'id')
|
|
|
|
106
|
+ obj.current=this.getCurrent(id,this.data.packs)
|
|
103
|
this.setData(obj)
|
107
|
this.setData(obj)
|
|
104
|
this.getActivityDetail();
|
108
|
this.getActivityDetail();
|
|
105
|
},
|
109
|
},
|