初始化
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
const {
|
||||
etmsPost
|
||||
} = require("../../com");
|
||||
const app = getApp();
|
||||
import Dialog from 'tdesign-miniprogram/dialog/index';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
myActivityRoute: [],
|
||||
pageSize: 10,
|
||||
pageCurrent: 1,
|
||||
isInit: false,
|
||||
isLoadFinish: false,
|
||||
isFinish: false,
|
||||
recordCount: 0,
|
||||
isTopLoading: false,
|
||||
isDownLoading: false,
|
||||
isLoadNew: false
|
||||
},
|
||||
onLoad(options) {
|
||||
this.initFirstActivityRouteItem();
|
||||
},
|
||||
onReady() {},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onHide() {},
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log(123)
|
||||
this.setData({
|
||||
isFinish: false,
|
||||
isTopLoading: true,
|
||||
isLoadNew: true,
|
||||
pageCurrent: 1
|
||||
});
|
||||
this.getActivityRouteItem();
|
||||
},
|
||||
onReachBottom() {
|
||||
if (!this.data.isFinish) {
|
||||
this.setData({
|
||||
pageCurrent: this.data.pageCurrent + 1
|
||||
});
|
||||
this.getActivityRouteItem();
|
||||
}
|
||||
},
|
||||
initFirstActivityRouteItem() {
|
||||
if (this.data.isInit) {
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
isInit: true
|
||||
})
|
||||
if (!app.globalData.s) {
|
||||
setTimeout(() => {
|
||||
this.setData({
|
||||
isInit: false
|
||||
})
|
||||
this.initFirstActivityRouteItem();
|
||||
}, 2000);
|
||||
return;
|
||||
}
|
||||
this.getActivityRouteItem();
|
||||
},
|
||||
getActivityRouteItem() {
|
||||
etmsPost(
|
||||
app.globalData,
|
||||
"openParent2/WxMiniActivityRouteItemGetPaging", {
|
||||
pageSize: this.data.pageSize,
|
||||
pageCurrent: this.data.pageCurrent,
|
||||
},
|
||||
(data) => {
|
||||
this.analysisActivityRouteItem(data);
|
||||
}
|
||||
);
|
||||
},
|
||||
analysisActivityRouteItem(resData) {
|
||||
var tempIsLoadNew = this.data.isLoadNew
|
||||
this.setData({
|
||||
isLoadFinish: true,
|
||||
isTopLoading: false,
|
||||
isDownLoading: false,
|
||||
isLoadNew: false
|
||||
})
|
||||
var tempList;
|
||||
if (tempIsLoadNew) {
|
||||
tempList = resData.dataItems
|
||||
} else {
|
||||
tempList = this.data.myActivityRoute.concat(resData.dataItems);
|
||||
}
|
||||
this.setData({
|
||||
recordCount: resData.recordCount,
|
||||
myActivityRoute: tempList
|
||||
})
|
||||
if (tempList.length >= resData.recordCount) {
|
||||
this.setData({
|
||||
isFinish: true
|
||||
})
|
||||
}
|
||||
},
|
||||
goItem(event) {
|
||||
var mydata = event.currentTarget.dataset;
|
||||
var activityId = mydata.activityid;
|
||||
var routeitemId = mydata.routeitemid;
|
||||
var tenantId = mydata.tenantid;
|
||||
var activityType = mydata.activitytype;
|
||||
if (activityType === 0) {
|
||||
wx.navigateTo({
|
||||
url: `../acdetail1/index?activityId=${activityId}&routeitemId=${routeitemId}&tenantId=${tenantId}`,
|
||||
})
|
||||
} else if (activityType === 1) {
|
||||
wx.navigateTo({
|
||||
url: `../acdetail2/index?activityId=${activityId}&routeitemId=${routeitemId}&tenantId=${tenantId}`,
|
||||
})
|
||||
} else if (activityType === 2) {
|
||||
wx.navigateTo({
|
||||
url: `../acdetail4/index?activityId=${activityId}&routeitemId=${routeitemId}&tenantId=${tenantId}`,
|
||||
})
|
||||
} else if (activityType === 3) {
|
||||
wx.navigateTo({
|
||||
url: `../acdetail3/index?activityId=${activityId}&routeitemId=${routeitemId}&tenantId=${tenantId}`,
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"mp-loading": "../../components/loading/loading",
|
||||
"t-loading": "tdesign-miniprogram/loading/loading",
|
||||
"t-swiper": "tdesign-miniprogram/swiper/swiper",
|
||||
"t-swiper-item": "tdesign-miniprogram/swiper/swiper-item",
|
||||
"t-swiper-nav": "tdesign-miniprogram/swiper/swiper-nav",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-tag": "tdesign-miniprogram/tag/tag",
|
||||
"t-check-tag": "tdesign-miniprogram/tag/check-tag",
|
||||
"t-dialog": "tdesign-miniprogram/dialog/dialog",
|
||||
"t-toast": "tdesign-miniprogram/toast/toast",
|
||||
"t-steps": "tdesign-miniprogram/steps/steps",
|
||||
"t-step": "tdesign-miniprogram/steps/step-item",
|
||||
"t-button": "tdesign-miniprogram/button/button",
|
||||
"t-button-group": "tdesign-miniprogram/button-group/button-group",
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar",
|
||||
"t-avatar-group": "tdesign-miniprogram/avatar/avatar-group",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"t-badge": "tdesign-miniprogram/badge/badge",
|
||||
"t-count-down": "tdesign-miniprogram/count-down/count-down"
|
||||
},
|
||||
"navigationBarTitleText": "我的活动",
|
||||
"enablePullDownRefresh":true
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<view class="hm_body">
|
||||
<view wx:if="{{isLoadFinish}}" class="hm_content">
|
||||
<view wx:if="{{myActivityRoute&&myActivityRoute.length>0}}" class="hm_content_main">
|
||||
<view wx:if="{{isTopLoading}}" class="hm_top_loading">
|
||||
<t-loading theme="spinner" size="30rpx" loading></t-loading>
|
||||
</view>
|
||||
<view wx:for="{{myActivityRoute}}" wx:key="item" data-activitytype="{{item.activityType}}" data-activityid="{{item.activityId}}" data-routeitemid="{{item.etActivityRouteItemId}}" data-tenantId="{{item.tenantId}}" bindtap="goItem" class="hm_item">
|
||||
<view class="hm_item_img">
|
||||
<t-image t-class="hm_item_img_value" src="{{item.activityCoverImage}}"></t-image>
|
||||
</view>
|
||||
<view class="hm_item_content">
|
||||
<viw class="hm_item_content_tag">
|
||||
<view class="hm_item_content_tag_item {{item.activityTypeStyleClass}}">{{item.activityTypeDesc}}</view>
|
||||
<view class="hm_item_content_tag_item {{item.scenetypeStyleClass}}">{{item.activityScenetypeDesc}}</view>
|
||||
</viw>
|
||||
<view class="hm_item_content_title">{{item.activityTitle}}</view>
|
||||
</view>
|
||||
|
||||
<view class="hm_status" wx:if="{{item.activityType===3}}">
|
||||
<view class="hm_status_count hm_shouyi">收益 {{item.distributionGet}}</view>
|
||||
</view>
|
||||
<view class="hm_status" wx:elif="{{item.activityType===2}}">
|
||||
</view>
|
||||
<view class="hm_status" wx:else="">
|
||||
<view class="hm_status_count">{{item.countFinish}}/{{item.countLimit}}</view>
|
||||
<view class="hm_status_mystatus hm_status_vie_{{item.status}}">
|
||||
{{item.statusDesc}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{item.status!=2&&item.status!=1}}" class="hm_exTime">
|
||||
<view wx:if="{{item.exTimeCountDown>0}}">
|
||||
<t-count-down content="default" time="{{item.exTimeCountDown}}" theme="square" size="small" />
|
||||
</view>
|
||||
<view wx:else>
|
||||
截止:{{item.activityEndTime}}
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{item.activityIsOpenPay}}" class="hm_price">
|
||||
<text class="hm_price_desc">{{item.activityPayTypeDesc}}</text>
|
||||
<text class="hm_price_buyCount" wx:if="{{item.buyCount>1}}">{{item.buyCount}}份</text>
|
||||
¥{{item.paySum}}
|
||||
</view>
|
||||
<view wx:else class="hm_price_not">
|
||||
<view wx:if="{{item.paySum>0||item.activityType===0}}">先用后付<text class="hm_price_desc">¥{{item.paySum}}</text></view>
|
||||
<view class="hm_free" wx:else>免费报名</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{isFinish}}" class="hm_isfinish">
|
||||
没有更多了~
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="hm_content_empty">
|
||||
<view class="hm_content_empty_img">
|
||||
<t-image src="https://xiaohebang.oss-cn-beijing.aliyuncs.com/system/material/activity/mini/empty.png" mode="widthFix"></t-image>
|
||||
</view>
|
||||
<view class="hm_content_empty_txt">
|
||||
未参与任何活动
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:else class="hm_content_loading">
|
||||
<view>
|
||||
<t-loading theme="dots" size="80rpx" loading></t-loading>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,368 @@
|
||||
page {
|
||||
background-color: #f4f6fa;
|
||||
color: rgba(0, 0, 0, 0.9);
|
||||
font-family: Microsoft YaHei;
|
||||
}
|
||||
|
||||
.hm_item {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
background-color: #fff;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
height: 100px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hm_item_img {
|
||||
width: 100px;
|
||||
height: 90px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.hm_item_img_value {
|
||||
width: 100px;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.hm_item_content {
|
||||
flex: 1 1 auto;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hm_item_content_title {
|
||||
margin-top: 5px;
|
||||
font-size: 13px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.hm_content_loading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hm_content_empty {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.hm_content_empty_txt {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.hm_content_empty_img {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hm_item_content_tag {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.hm_item_content_tag_item {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.activityStyle1 {
|
||||
color: #FF4F4F;
|
||||
border: #FF4F4F 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
.activityStyle2 {
|
||||
color: #FF4133;
|
||||
border: #FF4133 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
.activityStyle3 {
|
||||
color: #FF6670;
|
||||
border: #FF6670 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
.activityStyle4 {
|
||||
color: #FF123C;
|
||||
border: #FF123C 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
.activityStyle111 {
|
||||
color: #ccc;
|
||||
border: #ccc 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
.hm_status {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.hm_status_count {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.hm_status_mystatus {
|
||||
color: #fff;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
}
|
||||
|
||||
.hm_status_vie_0 {
|
||||
background-color: #409EFF;
|
||||
}
|
||||
|
||||
.hm_status_vie_1 {
|
||||
background-color: #67C23A;
|
||||
}
|
||||
|
||||
.hm_status_vie_2 {
|
||||
background-color: #07c160;
|
||||
}
|
||||
|
||||
.hm_status_vie_3 {
|
||||
background-color: #E6A23C;
|
||||
}
|
||||
|
||||
.hm_exTime {
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
right: 0px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.hm_price {
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
left: 130px;
|
||||
font-size: 12px;
|
||||
color: #e34d59;
|
||||
}
|
||||
|
||||
.hm_price_not {
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
left: 130px;
|
||||
font-size: 12px;
|
||||
color: #67C23A;
|
||||
}
|
||||
|
||||
.hm_price_desc {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.hm_top_loading {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hm_isfinish {
|
||||
text-align: center;
|
||||
margin-top: 5px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.hm_free {
|
||||
color: #409EFF;
|
||||
}
|
||||
.hm_shouyi{
|
||||
margin-top: 2px;
|
||||
color: #F56C6C;
|
||||
}
|
||||
.activityScene1 {
|
||||
color: #FF6666;
|
||||
border: #FF6666 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene2 {
|
||||
color: #663366;
|
||||
border: #663366 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene3 {
|
||||
color: #FF99CC;
|
||||
border: #FF99CC 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene4 {
|
||||
color: #336633;
|
||||
border: #336633 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene5 {
|
||||
color: #0066CC;
|
||||
border: #0066CC 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene6 {
|
||||
color: #FF9900;
|
||||
border: #FF9900 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene7 {
|
||||
color: #FFFFCC;
|
||||
border: #FFFFCC 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene8 {
|
||||
color: #336699;
|
||||
border: #336699 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.activityScene9 {
|
||||
color: #990066;
|
||||
border: #990066 1px solid;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-right: 3px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
border-radius: 2px;
|
||||
height: 20px;
|
||||
padding: 0 5px;
|
||||
line-height: 19px;
|
||||
}
|
||||
.hm_price_buyCount{
|
||||
margin-left: 2px;
|
||||
color: #BE3B83;
|
||||
}
|
||||
Reference in New Issue
Block a user