报名工具小程序初始代码
This commit is contained in:
482
pages/find/ActivityDetail.vue
Normal file
482
pages/find/ActivityDetail.vue
Normal file
@@ -0,0 +1,482 @@
|
||||
<template>
|
||||
<RefreshView ref="mescrollRef" text="活动详情" :useDownScroll="false" :useUpScroll="false"
|
||||
:useTitleLeftBtn="parameter.userRoleId==1?1:0" titleLeftBtnSource=" 管理" :dropLeftList="page.manageList" @drop="selectManage">
|
||||
<view class="activity-detail">
|
||||
<!-- 广告 -->
|
||||
<view class="image-area">
|
||||
<swiper indicator-dots="true" autoplay="true">
|
||||
<swiper-item v-for="(item,index) in page.activityDetails.listCoverImageUrl" :key="index">
|
||||
<image class="image" :src="item" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- 名称和活动类型 -->
|
||||
<view class="name-category">
|
||||
<h1>{{page.activityDetails.name}}</h1>
|
||||
<text class="category">{{page.activityDetails.sportCategoryName}}</text>
|
||||
</view>
|
||||
|
||||
<!-- 报名截止和整体活动时间 -->
|
||||
<view class="row">
|
||||
<!-- <view style="display: flex;flex-direction: row;margin-top: 15rpx;align-items: center;margin-left: 20rpx;margin-right: 30rpx;"> -->
|
||||
<text class="field">报名截止:</text>
|
||||
<text>{{page.activityDetails.enrollEndTime}}</text>
|
||||
<text style="color: #E99D42;font-size: 26rpx;flex: 1;text-align: right;">还有1天</text>
|
||||
</view>
|
||||
|
||||
<view class="line-thin"></view>
|
||||
<view class="row">
|
||||
<text class="field">整体活动:</text>
|
||||
<view style="display: flex;flex-direction: column;">
|
||||
<text>{{page.activityDetails.startTime}}</text>
|
||||
<text class="margin-top20">{{page.activityDetails.endTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 活动项目 -->
|
||||
<view v-for="(item,index) in page.activityDetails.listActivityItem" :key="index" >
|
||||
<view class="item-area">
|
||||
<!-- 活动项目名称类型金额 -->
|
||||
<view class="item-name-mold-money">
|
||||
<h2>{{item.name}}</h2>
|
||||
<text class="mold-money">{{item.enrollMoldName}}/{{item.enrollMoney==0?"免费":item.enrollMoney+'元'}}</text>
|
||||
</view>
|
||||
<!-- 活动项目介绍 -->
|
||||
<view class="item-introduction">
|
||||
<text>{{item.introduction}}</text>
|
||||
</view>
|
||||
<view class="line-thin"></view>
|
||||
<!-- 日期地点 -->
|
||||
<view class="row">
|
||||
<text class="date">{{item.startTime}}</text>
|
||||
<text class="address">{{item.address}}</text>
|
||||
<image v-if="!showAddress(item.gymnasiumSid)" style="width: 30rpx;height: 30rpx;" src="../../static/img/public/more.png" @click="gymnasiumName(item.gymnasiumSid)"></image>
|
||||
</view>
|
||||
<view class="line-thin"></view>
|
||||
<view class="row">
|
||||
<text class="field">报名数</text>
|
||||
<text class="margin-left20 ">{{item.enrollNumbers==0?"暂无":item.enrollNumbers+'人'}}/{{item.enrollNumbersLimit==0?"不限":item.enrollNumbersLimit+'人'}}</text>
|
||||
<view v-if="item.listUserHeadImageUrl.length>0" style="display:flex;flex-direction: row; margin-left:10rpx;" @click="userList(item.sid)">
|
||||
<view v-for="(url,i) in item.listUserHeadImageUrl " :key="i">
|
||||
<view
|
||||
style="display:flex; width:100%;margin-left:2rpx;margin-right:2rpx;">
|
||||
<image style="border-radius: 50%; width: 50rpx;height: 50rpx;" :src="url" mode="aspectFill"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<image class="more" src="../../static/img/public/more.png" ></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-thin"></view>
|
||||
<!-- 活动介绍 -->
|
||||
<view class="row">
|
||||
<text class="field">活动介绍</text>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<text class="introduction">{{page.activityDetails.introduction}}</text>
|
||||
<!-- 奖品奖项 -->
|
||||
<view class="row">
|
||||
<text class="field">奖品奖项</text>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<text class="introduction">{{page.activityDetails.notes}}</text>
|
||||
<!-- 特别鸣谢 -->
|
||||
<view class="row">
|
||||
<text class="field">特别鸣谢</text>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view
|
||||
style="display: flex;margin-left: 40rpx;margin-right: 40rpx;flex-direction: column; margin-top: 30rpx;">
|
||||
<view v-for="(item,pos) in page.activityDetails.listSpecialThanks " :key="pos">
|
||||
<view
|
||||
style="display: flex; width: 100%; padding-top: 10rpx;padding-bottom: 10rpx;justify-content: center;">
|
||||
<text style="color: #898989;font: size 28rpx;flex: 1;">{{item.name}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="line-thin"></view>
|
||||
<!-- 主办方 -->
|
||||
<view class="row">
|
||||
<text class="field">主办方:</text>
|
||||
<text style="color: #898989;font-size: 25rpx;">{{page.activityDetails.organizer}}</text>
|
||||
</view>
|
||||
<view class="line-thin"></view>
|
||||
<!-- 联系人 -->
|
||||
<view class="row">
|
||||
<text class="field">联系人:</text>
|
||||
<view style="display: flex;flex-direction: row;">
|
||||
<text style="color: #898989;font-size: 25rpx;">{{page.activityDetails.linkerName}}</text>
|
||||
<view style="width: 30rpx;"></view>
|
||||
<text style="color: #898989; font-size: 25rpx;">{{page.activityDetails.linkerPhone}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="line-thin"></view>
|
||||
<view class="row">
|
||||
<text class="field">报名必填</text>
|
||||
<text>{{page.enrollRequiredName}}</text>
|
||||
<!-- <image class = "more" src="../../static/img/public/more.png" ></image> -->
|
||||
</view>
|
||||
<view class="line-wide"></view>
|
||||
<!-- 报名条款及按钮 -->
|
||||
<view class="agreeMent">
|
||||
<checkbox-group @change="checkboxChange">
|
||||
<checkbox style="transform:scale(0.7)" :checked="checked1"></checkbox>
|
||||
</checkbox-group>
|
||||
<text class="text2">我已阅读并同意</text>
|
||||
<text style="color: #007AFF;">《参赛须知》</text>
|
||||
<text style="display: flex;text-align: center; margin-left: 20rpx; padding: 5rpx 10rpx;background: #0081D5;
|
||||
color: #FFFFFF; font-size: 28rpx;" @click="enroll()"> 我要报名 </text>
|
||||
</view>
|
||||
<view style="height: 300rpx;"></view>
|
||||
</view>
|
||||
</RefreshView>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
parameter:{
|
||||
activitySid:"",
|
||||
userRoleId:0,
|
||||
userRoleName:"游客",
|
||||
passRequired : false,
|
||||
noPassMsg : ""
|
||||
},
|
||||
isCreate:0,
|
||||
checked1: true,
|
||||
page:{
|
||||
activityDetails:{},
|
||||
manageList: [{
|
||||
'name': '修改活动',
|
||||
'src': '../../static/game-icon/renyuanguanli.png',
|
||||
'id': 0
|
||||
}, {
|
||||
'name': '删除活动',
|
||||
'src': '../../static/game-icon/shanchu.png',
|
||||
'id': 1
|
||||
}],
|
||||
enrollRequiredName:""
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad: function(option) {
|
||||
// 为参数赋值
|
||||
this.parameter.activitySid = option.activitySid
|
||||
// 如果用户登陆则获取用户角色
|
||||
let _this = this
|
||||
if (getApp().globalData.isLogin){
|
||||
_this.parameter.userRoleId =1
|
||||
let sysUserSid = getApp().globalData.sysUserSid;
|
||||
let activitySid = _this.parameter.activitySid;
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/aosUser/getActivityRole',
|
||||
method: 'GET',
|
||||
data: {
|
||||
'sysUserSid': sysUserSid,
|
||||
'activitySid':activitySid
|
||||
},
|
||||
paramsType: "FORM",
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
if (200 == res.code) {
|
||||
_this.parameter.userRoleId = res.data.userRoleId
|
||||
_this.parameter.userRoleName = res.data.userRoleName
|
||||
// } else {
|
||||
// _this.Toast(res.msg)
|
||||
}
|
||||
});
|
||||
}else{
|
||||
_this.parameter.userRoleId = 0
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
let _this = this
|
||||
let activitySid = _this.parameter.activitySid;
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/activity/getActivityDetails/' + activitySid,
|
||||
method: 'GET',
|
||||
paramsType: "FORM",
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
if (200 == res.code) {
|
||||
_this.page.activityDetails = res.data
|
||||
_this.setEnrollRequiredName()
|
||||
} else {
|
||||
_this.Toast(res.msg)
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
setEnrollRequiredName(){
|
||||
let enrollRequiredName = ""
|
||||
if (this.page.activityDetails.enrollRequired.onRealName == 1){
|
||||
enrollRequiredName += "姓名"
|
||||
}
|
||||
if (this.page.activityDetails.enrollRequired.onSex == 1){
|
||||
if (this.page.activityDetails.enrollRequired.onRealName == 1){
|
||||
enrollRequiredName += " / "
|
||||
}
|
||||
enrollRequiredName += "性别"
|
||||
}
|
||||
if (this.page.activityDetails.enrollRequired.onBirthday == 1){
|
||||
if (this.page.activityDetails.enrollRequired.onSex == 1 || this.page.activityDetails.enrollRequired.onRealName == 1){
|
||||
enrollRequiredName += " / "
|
||||
}
|
||||
enrollRequiredName += "生日"
|
||||
}
|
||||
if (this.page.activityDetails.enrollRequired.onAdCode == 1){
|
||||
if (this.page.activityDetails.enrollRequired.onSex == 1 || this.page.activityDetails.enrollRequired.onRealName == 1 || this.page.activityDetails.enrollRequired.onBirthday == 1){
|
||||
enrollRequiredName += " / "
|
||||
}
|
||||
enrollRequiredName += "地区"
|
||||
}
|
||||
this.page.enrollRequiredName = enrollRequiredName
|
||||
},
|
||||
selectManage(index, isLeft, selectData) {
|
||||
let _this = this;
|
||||
let id = selectData.id
|
||||
if (id == 0) {
|
||||
// 修改活动
|
||||
uni.navigateTo({
|
||||
url: '../publish/CreateActivity?sid=' + _this.parameter.activitySid
|
||||
})
|
||||
} else if (id == 1) {
|
||||
// 删除活动
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '确定删除此赛事?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/activity/delActivity/' + _this.parameter.activitySid,
|
||||
method: 'DELETE',
|
||||
paramsType: "FORM",
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
if (200 == res.code) {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
} else {
|
||||
_this.Toast(res.msg)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (id == -1) {
|
||||
// 关闭
|
||||
}
|
||||
},
|
||||
toCreateActivity(){
|
||||
let activitySid = this.parameter.activitySid
|
||||
uni.navigateTo({
|
||||
url: '../publish/CreateActivity?sid=' + activitySid
|
||||
});
|
||||
},
|
||||
showAddress(s) {
|
||||
console.log("..." + s);
|
||||
return this.IsEmpty(s)
|
||||
},
|
||||
checkboxChange(e) {
|
||||
this.checked1 = !this.checked1
|
||||
console.log(this.checked1)
|
||||
},
|
||||
gymnasiumName(e) {
|
||||
uni.navigateTo({
|
||||
url: "ArenaDetailActivity?sid=" + e
|
||||
})
|
||||
console.log("gymnasiumName>>", e)
|
||||
},
|
||||
userList(sid) {
|
||||
console.log("userList>>", sid)
|
||||
uni.navigateTo({
|
||||
url: "BaoMingListActivity?activitySid=" + this.parameter.activitySid + "&activityItemSid=" + sid
|
||||
})
|
||||
|
||||
},
|
||||
enroll() {
|
||||
let _this = this;
|
||||
|
||||
// 勾选协议
|
||||
if (!this.checked1) {
|
||||
this.Toast("请认真阅读参赛须知,并勾选。")
|
||||
return
|
||||
}
|
||||
// 报名菜单赋值
|
||||
let listEnrollMenu = []
|
||||
let listActivityItem = this.page.activityDetails.listActivityItem
|
||||
for (var i = 0; i < listActivityItem.length; i++) {
|
||||
let enrollMenu = listActivityItem[i].name
|
||||
let enrollMold = listActivityItem[i].enrollMold
|
||||
if ( enrollMold = 1){
|
||||
enrollMenu += "(" + listActivityItem[i].enrollMoldName +")"
|
||||
}
|
||||
listEnrollMenu.push(enrollMenu)
|
||||
}
|
||||
|
||||
// 输出报名菜单
|
||||
uni.showActionSheet({
|
||||
itemList: listEnrollMenu,
|
||||
success: function(res) {
|
||||
console.log("itemList==" + listEnrollMenu)
|
||||
console.log("res==" + JSON.stringify(res))
|
||||
_this.selectMenu(res.tapIndex, listEnrollMenu)
|
||||
},
|
||||
fail(e) {
|
||||
console.log("reeees==" + JSON.stringify(e))
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
verifyEnrollRequired(){
|
||||
|
||||
},
|
||||
selectMenu(id, info) {
|
||||
// 用户如未登陆则进入授权登陆页面
|
||||
if (!getApp().globalData.isLogin){
|
||||
uni.navigateTo({
|
||||
url: "../me/AuthLogin"
|
||||
})
|
||||
}
|
||||
let _this = this
|
||||
let activitySid = _this.page.activityDetails.sid
|
||||
let sysUserSid = getApp().globalData.sysUserSid
|
||||
// console.log("报名模式=============",JSON.stringify(_this.page.activityDetails))
|
||||
// 校验报名必填项
|
||||
let onRealName = _this.page.activityDetails.enrollRequired.onRealName
|
||||
let onSex = _this.page.activityDetails.enrollRequired.onSex
|
||||
let onBirthday = _this.page.activityDetails.enrollRequired.onBirthday
|
||||
let onAdCode = _this.page.activityDetails.enrollRequired.onAdCode
|
||||
if (onRealName == 0 || onSex == 0 || onBirthday == 0 || onAdCode == 0){
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/activity/verifyEnrollRequired',
|
||||
method: 'GET',
|
||||
paramsType: "FORM",
|
||||
data: {
|
||||
'activitySid': activitySid,
|
||||
'sysUserSid': sysUserSid
|
||||
},
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
if ( res.code == "200") {
|
||||
_this.parameter.passRequired = true
|
||||
}else{
|
||||
// _this.parameter.noPassMsg = res.msg
|
||||
uni.showModal({
|
||||
title: '报名需要补充如下个人信息',
|
||||
content: res.msg,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '../me/RealInfo?sysUserSid=' + getApp().globalData.sysUserSid
|
||||
})
|
||||
}else
|
||||
{
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
// 获取参数
|
||||
console.log(id)
|
||||
console.log(info)
|
||||
let activityItemSid = _this.page.activityDetails.listActivityItem[id].sid // 活动项目SId
|
||||
let enrollMold = _this.page.activityDetails.listActivityItem[id].enrollMold // 报名模式(0为个人,1为团体)
|
||||
console.log("用户SID",getApp().globalData.sysUserSid)
|
||||
// 活动项目为个人
|
||||
if (enrollMold == 0){
|
||||
// 校验报名条件
|
||||
let passCondition = true
|
||||
let sex = _this.page.activityDetails.listActivityItem[id].activityItemCondition.sex
|
||||
let minAge = _this.page.activityDetails.listActivityItem[id].activityItemCondition.minAge
|
||||
let maxAge = _this.page.activityDetails.listActivityItem[id].activityItemCondition.maxAge
|
||||
if (sex > 0 || minAge > 0 || maxAge > 0){
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/activityItem/verifyPersonalEnrollCondition',
|
||||
method: 'GET',
|
||||
paramsType: "FORM",
|
||||
data: {
|
||||
'activityItemSid': activitySid,
|
||||
'sysUserSid': sysUserSid
|
||||
},
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
if ( res.code != "200") {
|
||||
return
|
||||
uni.showToast({
|
||||
title: '报名条件不符',
|
||||
content:res.msg,
|
||||
duration:3000
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
this.HTTP({
|
||||
url: 'aos/v1/activityItem/personalEnroll',
|
||||
method: 'POST',
|
||||
data: {
|
||||
'activityItemSid': activityItemSid,
|
||||
'sysUserSid': getApp().globalData.sysUserSid,
|
||||
'paymentMemberSid': getApp().globalData.sysUserSid,
|
||||
},
|
||||
paramsType: "JSON",
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.Toast("报名成功!")
|
||||
} else {
|
||||
this.Toast(res.msg)
|
||||
}
|
||||
}, (err) => {
|
||||
// 错误提示
|
||||
_this.Toast("出错了:" + err.data.errmsg)
|
||||
})
|
||||
}
|
||||
return
|
||||
// 活动项目为团体
|
||||
if (enrollMold == 1){
|
||||
// 获取我的队伍
|
||||
|
||||
uni.navigateTo({
|
||||
url: "../find/TeamEnroll?activityItemSid="+activityItemSid
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import url("../../static/columns.css");
|
||||
.items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.agreeMent {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-top: 50rpx;
|
||||
margin-left: 30rpx;
|
||||
|
||||
.text2 {
|
||||
color: #666666;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #FFFFFF;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
255
pages/find/ActivityList.vue
Normal file
255
pages/find/ActivityList.vue
Normal file
@@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<RefreshView id="mescrollRef" ref="mescrollRef" :pageBg="F1F2F5" @refresh="refresh" text="活动列表" :useDownScroll="true" :useUpScroll="true">
|
||||
<sl-filter id="header" ref="slLilter" v-if="menuList.length!=0" :color="fd6d2a" themeColor="#000000" :menuList.sync="menuList" @result="result"></sl-filter>
|
||||
<view v-for="(item,index) in page.listActivity " :key="index">
|
||||
<view class="activity-area" @click="clickItem(index)">
|
||||
<view class="summary">
|
||||
<view class=".name-category">
|
||||
<text class="name">{{item.name}}</text>
|
||||
<text class="category">{{item.sportCategoryName}}</text>
|
||||
</view>
|
||||
<text class="enroll">报名截止:{{item.enrollEndTime}}</text>
|
||||
</view>
|
||||
|
||||
<view class="image-area">
|
||||
<image class="image" mode="aspectFill" :src="item.firstCoverImage"></image>
|
||||
<view class="tips">
|
||||
<image class="icon" src="../../static/img/public/renqi.png"></image>
|
||||
<text class="popularity">{{item.popularity}}</text>
|
||||
<text :class="{'enroll-state enroll-no':item.enrollState ==1||item.enrollState ==3,'enroll-state enroll-yes':item.enrollState==2}" >{{item.enrollStateName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(info,pos) in item.listActivityItemsArea " :key="pos">
|
||||
<view class="item-area">
|
||||
<view class="item-name-mold-money">
|
||||
<text class="item-name">{{info.name}}</text>
|
||||
<text class="mold-money">{{info.enrollMoldName}}/{{info.enrollMoney==0?"免费":info.enrollMoney}}</text>
|
||||
</view>
|
||||
<view class="enroll-amount-date">
|
||||
<text class="amount">报名数:{{info.enrollNumbers==0?"暂无":info.enrollNumbersLimit+'人'}}{{info.enrollNumbersLimit==0?"不限":info.enrollNumbersLimit+'人'}}</text>
|
||||
<text class="date">{{info.startTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="item.listActivityItemsArea.length>pos+1" class="line-thin margin-top20"></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</RefreshView>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 必须
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||
export default {
|
||||
// 使用mixin (在main.js注册全局组件) 必须
|
||||
mixins: [MescrollMixin],
|
||||
data() {
|
||||
return {
|
||||
index: 0,
|
||||
list: [],
|
||||
page: {
|
||||
'sort': 0,
|
||||
'city': this.ReadPreference("find_city"),
|
||||
'adCode': this.ReadPreference("find_city_code").slice(0, -2),
|
||||
state: "",
|
||||
listActivity:[]
|
||||
},
|
||||
menuList: [{
|
||||
'title': '当前定位城市',
|
||||
'key': 'type',
|
||||
'reflexTitle': true,
|
||||
'defaultSelectedIndex': 0,
|
||||
detailList: [{
|
||||
'title': this.ReadPreference("find_city"),
|
||||
'value': this.ReadPreference("find_city_code").slice(0, -2)
|
||||
},
|
||||
{
|
||||
'title': '选择其他城市',
|
||||
'value': '0'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
'title': '默认活动类型',
|
||||
'key': 'state',
|
||||
'reflexTitle': true,
|
||||
'defaultSelectedIndex': 0,
|
||||
detailList: [{
|
||||
'title': '全部活动',
|
||||
'value': ""
|
||||
}]
|
||||
}, {
|
||||
'title': '默认排序',
|
||||
'key': 'sort',
|
||||
'reflexTitle': true,
|
||||
'defaultSelectedIndex': 0,
|
||||
'detailList': [{
|
||||
'title': '按发布时间排序',
|
||||
'value': 0
|
||||
},
|
||||
{
|
||||
'title': '按报名时间排序',
|
||||
'value': 1
|
||||
},
|
||||
{
|
||||
'title': '按人气从高到低',
|
||||
'value': 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
let that = this
|
||||
that.HTTP({
|
||||
url: 'aos/v1/activity/getActivityCreatePageParameter',
|
||||
method: 'GET',
|
||||
data: {
|
||||
"adcode": that.page.adCode
|
||||
},
|
||||
paramsType: "FORM",
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
console.log("that.menuList[1].detailList", that.menuList[1].detailList);
|
||||
if (200 == res.code) {
|
||||
// 为活动类型块查询条件赋值(直接获取活动类别接口)
|
||||
let listSportCategoryArea = [];
|
||||
for (var i = 0; i < res.data.listSportCategoryArea.length; i++) {
|
||||
listSportCategoryArea.push({
|
||||
title: res.data.listSportCategoryArea[i].sportCategoryName,
|
||||
value: res.data.listSportCategoryArea[i].sid
|
||||
})
|
||||
}
|
||||
// 必须用变量去接受
|
||||
that.menuList[1].detailList = that.menuList[1].detailList.concat(listSportCategoryArea)
|
||||
this.$refs.slLilter.setTitle(this.menuList)
|
||||
}
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
let backResult = this.OnActivityResult();
|
||||
if (backResult != undefined) {
|
||||
if (!this.IsEmpty(backResult.code)) {
|
||||
console.log("结果2>" + backResult.code)
|
||||
this.page.adCode = backResult.code
|
||||
this.page.city = backResult.city
|
||||
this.menuList[0].detailList[0].title = backResult.city
|
||||
this.menuList[0].detailList[0].value = backResult.code
|
||||
console.log("qqq", this.menuList[0].detailList);
|
||||
this.$refs.slLilter.setTitle(this.menuList)
|
||||
this.$refs.mescrollRef.resetPageOne();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
result(val) {
|
||||
|
||||
if (!this.IsEmpty(val.sort)) {
|
||||
this.page.sort = val.sort;
|
||||
this.list = []
|
||||
console.log("this.page.sort", this.page.sort);
|
||||
}
|
||||
if (!this.IsEmpty(val.type)) {
|
||||
if (val.type != 0) {
|
||||
this.page.game = val.type;
|
||||
this.list = []
|
||||
} else {
|
||||
console.log("===>1" + JSON.stringify(this.page))
|
||||
uni.navigateTo({
|
||||
url: "../../pages/city/CitySelectActivity?city=" + this.page.city +
|
||||
"&code=" + this.page.adCode
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.IsEmpty(val.state)) {
|
||||
this.page.state = val.state;
|
||||
this.list = []
|
||||
console.log("this.page.state", this.page.state);
|
||||
}
|
||||
|
||||
this.$refs.mescrollRef.resetPageOne();
|
||||
|
||||
},
|
||||
refresh(page) {
|
||||
let _this = this
|
||||
this.HTTP({
|
||||
url: 'aos/v1/activity/getActivityAreaPagerList',
|
||||
paramsType: "JSON",
|
||||
method: "POST",
|
||||
data: {
|
||||
current: page.num,
|
||||
size: 10,
|
||||
params: {
|
||||
name: "",
|
||||
adCode: _this.menuList[0].detailList[0].value,
|
||||
orderBy: _this.page.sort,
|
||||
sportCategorySid: _this.page.state
|
||||
}
|
||||
},
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
// 成功关闭刷新状态
|
||||
_this.$refs.mescrollRef.refreshFinished(res.data.records.length)
|
||||
if (page.num == 1) {
|
||||
// 第一页 先清空集合数据
|
||||
_this.page.listActivity = []
|
||||
}
|
||||
// 追加数据
|
||||
_this.page.listActivity = _this.page.listActivity.concat(res.data.records)
|
||||
|
||||
}).catch(function(err) {
|
||||
_this.$refs.mescrollRef.refreshError()
|
||||
});
|
||||
},
|
||||
clickItem(index) {
|
||||
let activitySid = this.page.listActivity[index].sid
|
||||
console.log(activitySid)
|
||||
uni.navigateTo({
|
||||
url: '../find/ActivityDetail?activitySid=' + activitySid
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import url("../../static/columns.css");
|
||||
.top {
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
height: 100rpx;
|
||||
background: #FFFFFF;
|
||||
opacity: 0.8;
|
||||
align-items: center;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
|
||||
.unselected {
|
||||
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
font-family: Adobe Heiti Std;
|
||||
font-weight: normal;
|
||||
color: #191919;
|
||||
line-height: 40rpx;
|
||||
|
||||
}
|
||||
.selected {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
font-family: Adobe Heiti Std;
|
||||
font-weight: normal;
|
||||
color: #2CAB69;
|
||||
line-height: 40rpx;
|
||||
border-bottom: 2rpx #2CAB69 solid;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
136
pages/find/BaoMingListActivity.vue
Normal file
136
pages/find/BaoMingListActivity.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<RefreshView ref="mescrollRef" @refresh="refresh" :hasBack="true" text="报名列表">
|
||||
|
||||
<view v-for="(item,index) in data.list" :key='index' class="list-item-layout">
|
||||
|
||||
<image :src="item.headImage" class="list-item-img" mode="aspectFill">
|
||||
</image>
|
||||
|
||||
<view class="list-item-right">
|
||||
<view class="list-item-name">{{item.userNickName}}</view>
|
||||
<view class="list-item-content">报名时间:{{item.enrollTime}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</RefreshView>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 必须
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||
|
||||
export default {
|
||||
// 使用mixin (在main.js注册全局组件) 必须
|
||||
mixins: [MescrollMixin],
|
||||
data() {
|
||||
return {
|
||||
page: {
|
||||
activitySid: '',
|
||||
activityItemSid: '',
|
||||
},
|
||||
data: {
|
||||
list: []
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
// 赋值
|
||||
this.page.activitySid = options.activitySid
|
||||
this.page.activityItemSid = options.activityItemSid
|
||||
|
||||
},
|
||||
methods: {
|
||||
refresh(page) {
|
||||
|
||||
let _this = this;
|
||||
|
||||
this.HTTP({
|
||||
url: 'aos/v1/participantRelation/getPageListPersonalParticipant',
|
||||
paramsType: "JSON",
|
||||
method: "POST",
|
||||
data: {
|
||||
current: page.num,
|
||||
size: 10,
|
||||
params: {
|
||||
activitySid: this.page.activitySid,
|
||||
activityItemSid: this.page.activityItemSid ,
|
||||
}
|
||||
},
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
|
||||
// 成功关闭刷新状态
|
||||
_this.$refs.mescrollRef.refreshFinished(res.data.records.length)
|
||||
|
||||
if (page.num == 1) {
|
||||
// 第一页 先清空集合数据
|
||||
_this.data.list = []
|
||||
|
||||
}
|
||||
|
||||
// 追加数据
|
||||
_this.data.list = _this.data.list.concat(res.data.records)
|
||||
|
||||
}).catch(function(err) {
|
||||
console.log("11111");
|
||||
_this.$refs.mescrollRef.refreshError()
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.list-item-layout {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
box-sizing: border-box;
|
||||
padding-top: 20rpx;
|
||||
padding-bottom: 10rpx;
|
||||
margin-left: 33rpx;
|
||||
margin-right: 33rpx;
|
||||
border-bottom: 0.1px #F1F1F1 solid;
|
||||
|
||||
.list-item-img {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
margin-right: 25rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.list-item-right {
|
||||
flex: 1;
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 140rpx;
|
||||
|
||||
.list-item-name {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
color: #333333;
|
||||
font-size: 27rpx;
|
||||
}
|
||||
|
||||
.list-item-content {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.list-item-time {
|
||||
width: 100%;
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
217
pages/find/TeamEnroll.vue
Normal file
217
pages/find/TeamEnroll.vue
Normal file
@@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<RefreshView ref="mescrollRef" :hasBack="true" text="队伍报名" :useDownScroll="false" :useUpScroll="false">
|
||||
<view class="top">
|
||||
<text class="top_lift">选中({{page.selectedMemberAmount}})</text>
|
||||
<text class="top_right" @click="enroll()" >比赛报名</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view>
|
||||
<view v-for="(item,index) in page.listTeamMemberArea " :key="index">
|
||||
<view class="item">
|
||||
<view class="line" style="height: 1px;"></view>
|
||||
<view class="item_content">
|
||||
<checkbox-group class="item_check" @change="checkboxChange($event, index)">
|
||||
<checkbox :checked="item.checked"></checkbox>
|
||||
</checkbox-group>
|
||||
<image class="item_img" :src="item.headImage" mode="aspectFill"></image>
|
||||
<text class="item_text">{{item.realName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</RefreshView>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
data:{
|
||||
activityItemSid:"", // 活动项目Sid
|
||||
teamSid:"", // 队伍Sid
|
||||
listTeamMemberSid:[], // 队伍成员Sid列表
|
||||
paymentMemberSid:"" // 付费会员Sid
|
||||
},
|
||||
page:{
|
||||
type: 1, // 队伍类型1为我创建的
|
||||
listTeamMemberArea:[], // 会员块列表
|
||||
selectedMemberAmount:0 // 选中成员数
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad:function(options) {
|
||||
// 接收队伍Sid
|
||||
this.data.activityItemSid = options.activityItemSid
|
||||
// 判断是否登陆
|
||||
if (!getApp().globalData.isLogin){
|
||||
// 进入登陆页面
|
||||
}
|
||||
let sysUserSid = getApp().globalData.sysUserSid
|
||||
let _teamSid =""
|
||||
// 获取我的队伍,如果为一个队伍在当前页,如果多个队伍则进入选择界面
|
||||
|
||||
let _this = this
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/aosUser/getMyTeamAreaPagerList',
|
||||
paramsType: "JSON",
|
||||
method: "POST",
|
||||
data: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
params: {
|
||||
sysUserSid: sysUserSid,
|
||||
type: 1
|
||||
}
|
||||
},
|
||||
loading: true
|
||||
})
|
||||
.then((res) => {
|
||||
// 未找到队伍返回
|
||||
if (!res.success){
|
||||
return
|
||||
}
|
||||
let listTeamArea = res.data.records
|
||||
if (listTeamArea.length > 1 ){
|
||||
console.log('队伍数大于1支跳转:', listTeamArea)
|
||||
}
|
||||
// 设置队伍Sid
|
||||
_this.data.teamSid = listTeamArea[0].sid
|
||||
console.log('最新的队伍Sid', _this.data.teamSid)
|
||||
// 获取列表
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/aosUser/getTeamArea',
|
||||
paramsType: "FORM",
|
||||
method: "GET",
|
||||
data: {
|
||||
teamSid: _this.data.teamSid
|
||||
},
|
||||
toast: true,
|
||||
loading: true
|
||||
})
|
||||
.then((res) => {
|
||||
console.log('res', res)
|
||||
_this.page.listTeamMemberArea = res.data.listTeamMemberArea
|
||||
});
|
||||
|
||||
|
||||
}, (err) => {
|
||||
// 错误提示
|
||||
_this.Toast("出错了:" + err.data.errmsg)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
enroll() {
|
||||
// 保存
|
||||
let _this = this
|
||||
console.log('=====', _this)
|
||||
let _activityItemSid = this.data.activityItemSid
|
||||
|
||||
let _teamSid = _this.data.teamSid
|
||||
let _listTeamMemberSid = _this.data.listTeamMemberSid
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/activityItem/teamEnroll',
|
||||
paramsType: "JSON",
|
||||
method: "POST",
|
||||
data: {
|
||||
'activityItemSid':_activityItemSid,
|
||||
'teamSid': _teamSid,
|
||||
'listTeamMemberSid': _listTeamMemberSid
|
||||
},
|
||||
loading: true
|
||||
})
|
||||
.then((res) => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
});
|
||||
},
|
||||
checkboxChange(e, index) {
|
||||
// 切换选择
|
||||
this.page.listTeamMemberArea[index].checked = !this.page.listTeamMemberArea[index].checked
|
||||
console.log("listTeamMemberArea" + JSON.stringify(this.page.listTeamMemberArea[0]))
|
||||
// 勾选后添加Sid,取消勾选后删除
|
||||
if (this.page.listTeamMemberArea[index].checked) {
|
||||
this.data.listTeamMemberSid.push(this.page.listTeamMemberArea[index].sid)
|
||||
}
|
||||
else {
|
||||
// 删除当前的Sid
|
||||
let sid = this.page.listTeamMemberArea[index].sid
|
||||
let pos = this.data.listTeamMemberSid.findIndex((x) => {
|
||||
return x == sid
|
||||
})
|
||||
this.data.listTeamMemberSid.splice(pos, 1)
|
||||
}
|
||||
this.page.selectedMemberAmount = this.data.listTeamMemberSid.length
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import url("../../static/master.css");
|
||||
.line {
|
||||
height: 10rpx;
|
||||
background: #eee;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
padding-top: 26rpx;
|
||||
padding-bottom: 26rpx;
|
||||
|
||||
.top_lift {
|
||||
margin-left: 30rpx;
|
||||
font-weight: 550;
|
||||
font-family: sans-serif;
|
||||
flex: 1;
|
||||
color: #101010;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.top_right {
|
||||
margin-right: 30rpx;
|
||||
background-color: #F4CE98;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.item_content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
padding: 20rpx 32rpx;
|
||||
flex-direction: row;
|
||||
|
||||
.item_check {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.item_img {
|
||||
margin-left: 40rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.item_text {
|
||||
font-size: 28rpx;
|
||||
color: #101010;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user