初始化
This commit is contained in:
@@ -0,0 +1,161 @@
|
||||
const {
|
||||
etmsPost
|
||||
} = require("../../com");
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
|
||||
data: {
|
||||
activityBag: {},
|
||||
myActivityRoutes: [],
|
||||
pageSize: 20,
|
||||
pageCurrent: 1,
|
||||
tenantId: null,
|
||||
activityMainId: null,
|
||||
isFinish: false,
|
||||
recordCount: 0,
|
||||
isSubJoinLoading: false,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
var currentActivityBag = app.globalData.currentActivityBag;
|
||||
var myActivityBascInfo = currentActivityBag.bascInfo;
|
||||
wx.setNavigationBarTitle({
|
||||
title: currentActivityBag.bascInfo.title
|
||||
})
|
||||
this.setData({
|
||||
activityBag: currentActivityBag,
|
||||
tenantId: myActivityBascInfo.tenantId,
|
||||
activityMainId: myActivityBascInfo.activityMainId
|
||||
});
|
||||
this.getActivityRouteItem();
|
||||
},
|
||||
|
||||
getActivityRouteItem() {
|
||||
etmsPost(
|
||||
app.globalData,
|
||||
"openParent2/WxMiniActivityRouteItemMoreGetPaging", {
|
||||
pageSize: this.data.pageSize,
|
||||
pageCurrent: this.data.pageCurrent,
|
||||
tenantId: this.data.tenantId,
|
||||
activityMainId: this.data.activityMainId,
|
||||
},
|
||||
(data) => {
|
||||
this.analysisActivityRouteItem(data);
|
||||
}
|
||||
);
|
||||
},
|
||||
analysisActivityRouteItem(resData) {
|
||||
var tempList = this.data.myActivityRoutes.concat(resData.dataItems);
|
||||
this.setData({
|
||||
recordCount: resData.recordCount,
|
||||
myActivityRoutes: tempList
|
||||
})
|
||||
if (tempList.length >= resData.recordCount) {
|
||||
this.setData({
|
||||
isFinish: true
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
changeRouteItem(event) {
|
||||
var mydata = event.currentTarget.dataset;
|
||||
var index = mydata.index;
|
||||
var currentindex = mydata.currentindex;
|
||||
var items = this.data.myActivityRoutes[index].joinRouteItems;
|
||||
if (currentindex >= items.length - 1) {
|
||||
currentindex = 0;
|
||||
} else {
|
||||
currentindex++;
|
||||
}
|
||||
var tempjoinRouteItems = this.data.myActivityRoutes;
|
||||
tempjoinRouteItems[index].currentAvatarUrl = items[currentindex].avatarUrl;
|
||||
tempjoinRouteItems[index].currentStudentNameDesc = items[currentindex].studentNameDesc;
|
||||
tempjoinRouteItems[index].currentIndex = currentindex;
|
||||
this.setData({
|
||||
myActivityRoutes: tempjoinRouteItems
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
console.log("111")
|
||||
console.log(this.data.isFinish)
|
||||
if (!this.data.isFinish) {
|
||||
this.setData({
|
||||
pageCurrent: this.data.pageCurrent + 1
|
||||
});
|
||||
this.getActivityRouteItem();
|
||||
}
|
||||
},
|
||||
goJoin(event) {
|
||||
this.setData({
|
||||
isSubJoinLoading: true
|
||||
});
|
||||
var mydata = event.currentTarget.dataset;
|
||||
var activityRouteId = mydata.rid;
|
||||
console.log(activityRouteId)
|
||||
var mydata = this.data.activityBag;
|
||||
var tenantId = mydata.bascInfo.tenantId;
|
||||
var activityMainId = mydata.bascInfo.activityMainId;
|
||||
etmsPost(
|
||||
app.globalData,
|
||||
"openParent2/WxMiniGroupPurchaseJoinCheck", {
|
||||
tenantId: tenantId,
|
||||
activityMainId: activityMainId,
|
||||
ActivityRouteId: activityRouteId
|
||||
},
|
||||
(data) => {
|
||||
this.setData({
|
||||
isSubJoinLoading: false
|
||||
});
|
||||
wx.navigateTo({
|
||||
url: `../gosubmitGroupPurchase/index?type=1&activityRouteId=${activityRouteId}&tenantId=${tenantId}&&activityMainId=${activityMainId}`,
|
||||
})
|
||||
}, () => {
|
||||
this.setData({
|
||||
isSubJoinLoading: false
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar",
|
||||
"t-avatar-group": "tdesign-miniprogram/avatar/avatar-group",
|
||||
"t-button": "tdesign-miniprogram/button/button",
|
||||
"t-button-group": "tdesign-miniprogram/button-group/button-group",
|
||||
"t-badge": "tdesign-miniprogram/badge/badge"
|
||||
},
|
||||
"navigationBarTitleText": "拼团记录"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<view class="ec_route_main">
|
||||
<view class="ec_route_item" wx:for="{{myActivityRoutes}}" wx:key="activityRouteId">
|
||||
<view class="ec_route_item_img">
|
||||
<t-badge t-class="ec_route_item_img_tp" color="#67C23A" count="{{item.countFinish}}">
|
||||
<t-avatar bindtap="changeRouteItem" data-index="{{index}}" data-currentIndex="{{item.currentIndex}}" data-routeId="{{item.activityRouteId}}" shape="circle" image="{{item.currentAvatarUrl}}" />
|
||||
</t-badge>
|
||||
</view>
|
||||
<view class="ec_route_item_text">{{item.currentStudentNameDesc}}(<label wx:if="{{item.countShortStatus===0}}">还差<label class="ec_route_item_text_limit">{{item.countShort}}</label>人成团</label>
|
||||
<label wx:if="{{item.countShortStatus===1}}">还差<label class="ec_route_item_text_limit">{{item.countShort}}</label>满团</label>
|
||||
<label wx:if="{{item.countShortStatus===2}}">已满团</label>)
|
||||
</view>
|
||||
<view class="ec_route_item_sub">
|
||||
<t-button disabled="{{isSubJoinLoading}}" loading="{{isSubJoinLoading}}" theme="danger" data-rid="{{item.activityRouteId}}" bindtap="goJoin" wx:if="{{item.countShortStatus!=2&&!activityBag.isActivitying}}" t-class="ec_route_item_sub_btn" shape="round" size="small">去成团</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,55 @@
|
||||
.ec_route_main{
|
||||
padding: 20px;
|
||||
}
|
||||
.ec_route_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.ec_route_item_text {
|
||||
flex: 1 1 auto;
|
||||
font-size: 14px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ec_route_item_sub_btn {
|
||||
background: -webkit-linear-gradient(left, #FF123C, #FE2A38, #FD5028) !important;
|
||||
width: 50px !important;
|
||||
font-size: 12px !important;
|
||||
height: 34px !important;
|
||||
width: 80px !important;
|
||||
font-weight: normal !important;
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
.ec_route_item_text_limit {
|
||||
color: #FF123C;
|
||||
}
|
||||
|
||||
.ec_route_tag {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 0px;
|
||||
background-color: #FFC234;
|
||||
font-size: 14px;
|
||||
color: #FF123C;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
.ac_ks_inter {
|
||||
background:rgba(0, 0, 0, 0.4);
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
border-radius: 50px;
|
||||
color: white;
|
||||
z-index: 999;
|
||||
font-size: 12px;
|
||||
overflow: hidden
|
||||
}
|
||||
Reference in New Issue
Block a user