|
|
@@ -34,7 +34,7 @@ Page({
|
|
|
storeAction: [],
|
|
|
showJoinPt: false, //显示加入拼工
|
|
|
showAllPt: false, //显示所有拼工
|
|
|
- allPtList: [{}, {}],
|
|
|
+ allPtList: [],
|
|
|
leftTime: 0,
|
|
|
isEnd: 0, //岗位是否已结束0:未结束;1:结束
|
|
|
},
|
|
|
@@ -48,13 +48,15 @@ Page({
|
|
|
onShow: function() {
|
|
|
if (app.globalData.userInfo) {
|
|
|
console.log('有info===', app.globalData)
|
|
|
- this.fetchData()
|
|
|
+ this.fetchData();
|
|
|
+ this.fetchPtList();
|
|
|
} else if (this.data.canIUse) {
|
|
|
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
|
|
|
// 所以此处加入 callback 以防止这种情况
|
|
|
app.userInfoReadyCallback = res => {
|
|
|
console.log('userInfoReadyCallback===', app.globalData)
|
|
|
this.fetchData()
|
|
|
+ this.fetchPtList();
|
|
|
}
|
|
|
} else {
|
|
|
// 在没有 open-type=getUserInfo 版本的兼容处理
|
|
|
@@ -63,6 +65,7 @@ Page({
|
|
|
app.globalData.userInfo = res.userInfo
|
|
|
console.log('兼容处理===', app.globalData)
|
|
|
this.fetchData()
|
|
|
+ this.fetchPtList();
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -160,15 +163,17 @@ Page({
|
|
|
showToast('拼团已结束')
|
|
|
return false
|
|
|
}
|
|
|
- groupList(this.data.hpPositionId).then(data => {
|
|
|
- console.log(data)
|
|
|
+ let paramsObj = {
|
|
|
+ positionCategory: this.data.positionCategory,
|
|
|
+ positionId: this.data.hpPositionId,
|
|
|
+ user_id: app.globalData.userId,
|
|
|
+ user_token: app.globalData.userToken
|
|
|
+ }
|
|
|
+ Object.assign(paramsObj);
|
|
|
+ groupList(paramsObj).then(data => {
|
|
|
+ console.log("allpt", data)
|
|
|
this.setData({
|
|
|
- isShowList: true,
|
|
|
- ptList: data.list.map(item => {
|
|
|
- item.leftTime = new Date().getTime() + item.leftTime * 1000
|
|
|
- item.leaderName = decodeURIComponent(item.leaderName)
|
|
|
- return item
|
|
|
- })
|
|
|
+ allPtList: data.data.groupList
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
@@ -340,13 +345,25 @@ Page({
|
|
|
// 加入拼工
|
|
|
joinPt(e) {
|
|
|
var index = e.currentTarget.dataset.index;
|
|
|
- console.log("joinptindex",index)
|
|
|
+ console.log("joinptindex", index)
|
|
|
this.setData({
|
|
|
showAllPt: false,
|
|
|
showJoinPt: true,
|
|
|
joinPtList: this.data.storeAction[index]
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 加入拼工(所有拼工)
|
|
|
+ joinPt_1(e) {
|
|
|
+ var index = e.currentTarget.dataset.index;
|
|
|
+ console.log("joinptindex", index)
|
|
|
+ this.setData({
|
|
|
+ showAllPt: false,
|
|
|
+ showJoinPt: true,
|
|
|
+ joinPtList: this.data.allPtList[index]
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
hideJoinPt() {
|
|
|
this.setData({
|
|
|
showJoinPt: false
|