报名工具小程序初始代码
This commit is contained in:
364
pages/home/AddFragment.vue
Normal file
364
pages/home/AddFragment.vue
Normal file
@@ -0,0 +1,364 @@
|
||||
<template>
|
||||
<view>
|
||||
<RefreshView ref="mescrollRef" text="首页" :useDownScroll="false" :useUpScroll="false" pageBg="#F1F2F5">
|
||||
|
||||
<view style="display: flex;flex-direction: column;align-items: center;width: 100vw;">
|
||||
|
||||
<view style="display: flex;flex-direction: column;width: 100vw;align-items: center;background-color: #2fa1f0;padding-top: 80rpx;
|
||||
border-bottom-right-radius: 30rpx;border-bottom-left-radius: 30rpx;">
|
||||
|
||||
<view style="width: 100vw;text-align: center;font-size: 40px;font-weight: 700;color: #fff;" >
|
||||
<!-- <view style="left: 100px;
|
||||
top: 79px;
|
||||
font-weight: 700;
|
||||
width: 160px;
|
||||
height: 58px;
|
||||
color: rgba(255, 255, 255, 100);
|
||||
font-size: 40px;
|
||||
text-align: center;
|
||||
font-family: SourceHanSansSC-bold;">-->
|
||||
体育活动
|
||||
</view>
|
||||
<view
|
||||
style="width: 100vw;text-align: center;font-size: 22px;font-weight: 600;color: #fff;margin-top: 10rpx;">
|
||||
<!-- <view style="left: 114px;
|
||||
top: 139px;
|
||||
font-weight: 600;
|
||||
width: 132px;
|
||||
height: 32px;
|
||||
color: rgba(255, 255, 255, 100);
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
font-family: SourceHanSansSC-bold;"> -->
|
||||
组织报名工具
|
||||
</view>
|
||||
|
||||
<text style="margin-top: 80rpx;color:#fff;font-size: 16px;">一分钟创建 轻松组织活动</text>
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: row;margin-top: 40rpx;justify-content: center;margin-bottom: 100rpx;align-items: center;">
|
||||
|
||||
<image src="../../static/home-icon/visits.png" style="width: 35rpx;height: 35rpx;"></image>
|
||||
<text style="margin-left: 20rpx;color: #fff;font-size: 12px;">访问量:{{visits}}</text>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;margin-top: 60rpx;margin-left: 30rpx;align-items:baseline">
|
||||
<text style="font-weight: 400; color: #E99D42 ;font-size: 36rpx;">发布活动类别</text>
|
||||
<text style="margin-left: 20rpx;font-weight: 400; color: #E99D42;font-size: 28rpx;">(点击体育活动标签发布)</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view style="display: flex; margin-left: 10rpx;margin-right: 30rpx;margin-top: 40rpx;
|
||||
justify-content: center;">
|
||||
<grid>
|
||||
<view style="display: flex; margin-bottom: 10rpx; margin-left: 10rpx;margin-right: 10rpx;"
|
||||
v-for="(item,index) in SportCategoryList">
|
||||
<text class="labelLayout" @click="onClick(index)">{{item.sportCategoryName}}</text>
|
||||
</view>
|
||||
</grid>
|
||||
</view>
|
||||
|
||||
<view class="line" style=" margin-top: 100rpx;margin-left: 30rpx;margin-right: 30rpx;"></view>
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: column;margin-top: 40rpx;margin-bottom: 20rpx;margin-left: 30rpx;margin-right: 30rpx;">
|
||||
<text style="font-size: 32rpx;color: #666666;font-weight: 600">友情提示:</text>
|
||||
<text style="font-size: 30rpx;color: #666666;margin-top: 40rpx;font-weight: 500;">{{notices}}</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="line" style=" margin-left: 30rpx;margin-right: 30rpx;margin-top: 40rpx;"></view>
|
||||
|
||||
<view style="margin-top: 30rpx;margin-left: 30rpx;margin-right: 30rpx;">
|
||||
|
||||
<text style="font-size: 40rpx;color: #4095E5;font-weight: 600" @click="jump()">{{page.city}}</text>
|
||||
<text
|
||||
style="font-size: 32rpx;color: #666666;font-weight: 500;margin-left: 20rpx;">共有{{activityAmount}}场活动</text>
|
||||
</view>
|
||||
<view style="height: 150px;"></view>
|
||||
</RefreshView>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 必须
|
||||
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
||||
export default {
|
||||
// 使用mixin (在main.js注册全局组件) 必须
|
||||
mixins: [MescrollMixin],
|
||||
data() {
|
||||
return {
|
||||
index: 0,
|
||||
notices: "\u3000\u3000您注册的帐号可以在宇运动主体下的子平台一号通行,同时您发布的活动将会按类别发布到各子平台。(点击查看宇运动子平台)",
|
||||
list: [],
|
||||
SportCategoryList: [],
|
||||
page: {
|
||||
city: "正在获取...",
|
||||
code: ""
|
||||
},
|
||||
visits: "...",
|
||||
activityAmount: "..."
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.HTTP({
|
||||
url: 'aos/v1/activityManagement/add1PointOnVisits',
|
||||
method: 'GET',
|
||||
data: {},
|
||||
paramsType: "FORM",
|
||||
loading: false
|
||||
}).then((res) => {
|
||||
|
||||
});
|
||||
let that = this
|
||||
|
||||
let find_city_code = this.ReadPreference("find_city_code")
|
||||
let find_city = this.ReadPreference("find_city")
|
||||
|
||||
if (this.IsEmpty(find_city_code)) {
|
||||
// 首次进入
|
||||
find_city_code = 0;
|
||||
|
||||
// 获取定位
|
||||
let _this = this;
|
||||
// 获取定位
|
||||
uni.getLocation({
|
||||
type: 'gcj02',
|
||||
success: function(res) {
|
||||
|
||||
let locat = res
|
||||
console.log("latitude", res.longitude);
|
||||
console.log("longitude", res.latitude);
|
||||
// 先写入定位
|
||||
_this.location = {
|
||||
latitude: locat.latitude,
|
||||
longitude: locat.longitude
|
||||
}
|
||||
|
||||
let url =
|
||||
"https://restapi.amap.com/v3/geocode/regeo?key=59970402d1c3f7dc1efff17d4dfcff21&location=" +
|
||||
res.longitude + "," + res.latitude +
|
||||
"&poitype=&radius=1000&extensions=all&batch=false&roadlevel=0";
|
||||
|
||||
_this.HttpOtherUrl({
|
||||
url: url
|
||||
}).then((res) => {
|
||||
|
||||
let json = JSON.stringify(res);
|
||||
let info = JSON.parse(json).regeocode.addressComponent;
|
||||
// 城市
|
||||
let city = info.city;
|
||||
// 城市编码
|
||||
let code = info.adcode;
|
||||
|
||||
// 获取到正确的城市编码
|
||||
if (code > 0) {
|
||||
console.log("find_city1", city);
|
||||
console.log("find_city_code1", code);
|
||||
// 保存本次定位
|
||||
_this.WritePreference("find_city", city)
|
||||
_this.WritePreference("find_city_code", code)
|
||||
|
||||
_this.page.code = code
|
||||
_this.page.city = city
|
||||
_this.getCode()
|
||||
} else {
|
||||
console.log("find_city2", city);
|
||||
console.log("find_city_code2", code);
|
||||
// 未获取到正确的城市编码
|
||||
_this.WritePreference("find_city", "石家庄")
|
||||
_this.WritePreference("find_city_code", "130104")
|
||||
|
||||
_this.page.code = "130104"
|
||||
_this.page.city = "石家庄"
|
||||
_this.getCode()
|
||||
}
|
||||
}, (err) => {
|
||||
console.log("find_city3", "石家庄");
|
||||
console.log("find_city_code3", "130104");
|
||||
//获取当前城市失败
|
||||
_this.WritePreference("find_city", "石家庄")
|
||||
_this.WritePreference("find_city_code", "130104")
|
||||
|
||||
_this.page.code = "130104"
|
||||
_this.page.city = "石家庄"
|
||||
_this.getCode()
|
||||
|
||||
})
|
||||
},
|
||||
fail(err) {
|
||||
console.log("find_city4", "石家庄");
|
||||
console.log("find_city_code4", "130104");
|
||||
// 定位失败
|
||||
_this.WritePreference("find_city", "石家庄")
|
||||
_this.WritePreference("find_city_code", "130104")
|
||||
|
||||
_this.page.code = "130104"
|
||||
_this.page.city = "石家庄"
|
||||
_this.getCode()
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.page.code = find_city_code
|
||||
this.page.city = find_city
|
||||
this.getCode()
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onShow() {
|
||||
let find_city_code = this.ReadPreference("find_city_code")
|
||||
|
||||
let find_city = this.ReadPreference("find_city")
|
||||
|
||||
if (!this.IsEmpty(find_city_code)) {
|
||||
this.getCode()
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
// wwww(){
|
||||
// uni.navigateTo({
|
||||
// url: "../team/CreateTeam"
|
||||
// })
|
||||
// },
|
||||
getCode() {
|
||||
let that = this
|
||||
that.HTTP({
|
||||
url: 'aos/v1/activityManagement/getActivityCreatePageParameter',
|
||||
method: 'GET',
|
||||
data: {
|
||||
"adcode": this.page.code
|
||||
},
|
||||
paramsType: "FORM",
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
that.SportCategoryList = res.data.listSportCategoryArea
|
||||
that.activityAmount = res.data.activityAmount
|
||||
that.visits = res.data.visits
|
||||
|
||||
});
|
||||
},
|
||||
onClick(index) {
|
||||
uni.navigateTo({
|
||||
url: "../index/activity?sportCategoryName=" + this.SportCategoryList[index].sportCategoryName +
|
||||
"&sportCategorySid=" + this.SportCategoryList[index].sid + "&isCreate=0&sid="
|
||||
})
|
||||
},
|
||||
jump() {
|
||||
console.log('this.page.code', this.page.code)
|
||||
uni.switchTab({
|
||||
url: "../home/FindFragment"
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.line {
|
||||
height: 5rpx;
|
||||
background-color: #eee
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
width: 80%;
|
||||
height: 80rpx;
|
||||
flex-direction: column;
|
||||
background-color: $uni-base-color;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.nav-bar {
|
||||
height: 92rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.bar-text {
|
||||
font-size: 32rpx;
|
||||
height: 100%;
|
||||
line-height: 92rpx;
|
||||
padding-left: 28rpx;
|
||||
}
|
||||
|
||||
.bar-img {
|
||||
width: 90rpx;
|
||||
height: 92rpx;
|
||||
padding-right: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
background: #BBBBBB;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
background: #0081D5;
|
||||
}
|
||||
|
||||
.labelLayout {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
background-color: #F2BF5C;
|
||||
color: #FFFFFF;
|
||||
padding-top: 8rpx;
|
||||
padding-bottom: 8rpx;
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
</style>
|
||||
326
pages/home/FindFragment.vue
Normal file
326
pages/home/FindFragment.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<view style="background: #F1F2F5;">
|
||||
<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>
|
||||
<view v-for="(item,index) in list " :key="index">
|
||||
<view
|
||||
style="display: flex;flex-direction: column;margin-bottom: 30rpx; padding: 30rpx;background: #FFFFFF;"
|
||||
@click="clickItem(index)">
|
||||
<view style="display: flex;flex-direction: column;">
|
||||
<view style="display: flex; flex-direction: row;">
|
||||
<text style="color: #101010; font-size: 32rpx; display:-webkit-box;-webkit-line-clamp:1;
|
||||
overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical;
|
||||
word-break:break-all;flex: 1;">{{item.name}}</text>
|
||||
<text
|
||||
style="color: #fff; font-size: 24rpx; background-color: #F2BF5C; padding: 5rpx 10rpx;">{{item.sportCategoryName}}</text>
|
||||
</view>
|
||||
<text
|
||||
style="color: #898989 ; font-size: 28rpx; margin-top: 10rpx;">报名截止:{{item.enrollEndTime}}</text>
|
||||
</view>
|
||||
<view style="width: 100%;height: 300rpx; margin-top: 20rpx;margin-bottom: 20rpx;">
|
||||
<image style="width: 100%;height: 100%; border-radius: 30rpx;" mode="aspectFill"
|
||||
:src="item.firstCoverImage"></image>
|
||||
|
||||
<view style="display: flex; height: 50rpx;width: 100%; margin-top: -80rpx; ">
|
||||
<view style=" display: flex;align-items: center;width: 100%;">
|
||||
<image style="width: 28px;height: 48rpx;margin-left: 30rpx;"
|
||||
src="../../static/renqi.png"></image>
|
||||
<text style="color: #fff; margin-left: 15rpx;flex: 1;">{{item.popularity}}</text>
|
||||
<text
|
||||
:class="{'btn1':item.enrollState ==1||item.enrollState ==3,'btn2':item.enrollState==2}"
|
||||
style="display: flex;text-align: center; padding: 8rpx 15rpx;
|
||||
color: #FFFFFF; font-size: 28rpx; margin-right:30rpx; border-radius: 10rpx;">{{item.enrollStateName}}</text>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view v-for="(info,pos) in item.listActivityItemsArea " :key="pos">
|
||||
<view style="display: flex;flex-direction: column;">
|
||||
|
||||
<view
|
||||
style="display: flex;flex-direction: row; align-items: center; margin-top: 10rpx;">
|
||||
<text style="color: #101010; font-size: 28rpx; flex: 1;">{{info.name}}</text>
|
||||
<view style=" align-items: center;">
|
||||
|
||||
<text style="color: #ff0000 ; font-size: 24rpx;">{{info.enrollMoldName}}</text>
|
||||
<text
|
||||
style="color: #ff0000 ; font-size: 24rpx;margin-left: 10rpx;margin-right: 10rpx;">/</text>
|
||||
<text
|
||||
style="color: #ff0000 ; font-size: 24rpx;">{{info.enrollMoney==0?"免费":info.enrollMoney}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;margin-top: 5rpx;">
|
||||
<view style="flex: 1; align-items: center;">
|
||||
|
||||
<text style="color: #919191; font-size: 24rpx;">报名数:</text>
|
||||
<text
|
||||
style="color: #919191 ; font-size: 24rpx;">{{info.enrollNumbers==0?"暂无":info.enrollNumbersLimit+'人'}}</text>
|
||||
<text
|
||||
style="color: #919191 ; font-size: 24rpx;margin-left: 10rpx;margin-right: 10rpx;">/</text>
|
||||
<text
|
||||
style="color: #919191 ; font-size: 24rpx;">{{info.enrollNumbersLimit==0?"不限":info.enrollNumbersLimit+'人'}}</text>
|
||||
</view>
|
||||
|
||||
<text
|
||||
style="margin-top: 10rpx; color: #919191; font-size: 24rpx;">{{info.startTime}}</text>
|
||||
|
||||
</view>
|
||||
|
||||
<view v-if="item.listActivityItemsArea.length>pos+1"
|
||||
style="width: 100%; height: 2rpx;background-color: #efefef; margin-top: 10rpx;">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</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 {
|
||||
index: 0,
|
||||
list: [],
|
||||
page: {
|
||||
'sort': 0,
|
||||
'city': this.ReadPreference("find_city"),
|
||||
'adCode': this.ReadPreference("find_city_code").slice(0, -2),
|
||||
state: ""
|
||||
},
|
||||
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/activityManagement/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 list = [];
|
||||
|
||||
for (var i = 0; i < res.data.listSportCategoryArea.length; i++) {
|
||||
list.push({
|
||||
title: res.data.listSportCategoryArea[i].sportCategoryName,
|
||||
value: res.data.listSportCategoryArea[i].sid
|
||||
})
|
||||
}
|
||||
// 必须用变量去接受
|
||||
that.menuList[1].detailList = that.menuList[1].detailList.concat(list)
|
||||
|
||||
this.$refs.slLilter.setTitle(this.menuList)
|
||||
console.log("qqq", that.menuList[1].detailList);
|
||||
}
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
|
||||
let backResult = this.OnActivityResult();
|
||||
if (backResult != undefined) {
|
||||
console.log("结果>" + JSON.stringify(backResult))
|
||||
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/activityManagement/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.list = []
|
||||
}
|
||||
|
||||
// 追加数据
|
||||
_this.list = _this.list.concat(res.data.records)
|
||||
|
||||
}).catch(function(err) {
|
||||
console.log("11111");
|
||||
_this.$refs.mescrollRef.refreshError()
|
||||
});
|
||||
},
|
||||
|
||||
clickItem(index) {
|
||||
|
||||
let raceSid = this.list[index].sid
|
||||
console.log(raceSid)
|
||||
uni.navigateTo({
|
||||
url: '../index/DetailActivity?raceSid=' + raceSid
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
background: #BBBBBB;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
background: #0081D5;
|
||||
}
|
||||
</style>
|
||||
299
pages/home/UserFragment.vue
Normal file
299
pages/home/UserFragment.vue
Normal file
@@ -0,0 +1,299 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
|
||||
<RefreshView ref="mescrollRef" :pageBg="EDEDED" text="个人中心" :useUpScroll="false" :useDownScroll="false"
|
||||
:useTitleLeftBtn="1" titleLeftBtnSource="管理" :dropLeftList="page.btnList" @drop="drop">
|
||||
|
||||
<view class="top">
|
||||
|
||||
<image class="touxiang" :src="page.headImage" mode="aspectFill"></image>
|
||||
|
||||
<view class="top-right">
|
||||
<text class="name" @click="bind()">{{page.userNickName}}</text>
|
||||
<view style="display: flex;align-items: center;margin-right: 30rpx; margin-top: 35rpx;"
|
||||
@click="baseInfo()" v-if="!this.IsEmpty(page.loginName)">
|
||||
<text class="name2" style="flex: 1;">{{page.loginName}}</text>
|
||||
<image src="../../static/home-icon/more.png" style="width: 35rpx;height: 35rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="click(2)" class="menu-item">
|
||||
<image class = "icon" src="../../static/home-icon/game.png" ></image>
|
||||
<text class="text">我的活动</text>
|
||||
<text class="explain">{{page.participateInActivityExplain}}</text>
|
||||
<image class = "more" src="../../static/home-icon/more.png" ></image>
|
||||
</view>
|
||||
<view class="line-wide"></view>
|
||||
<view @click="click(3)" class="menu-item">
|
||||
<image class = "icon" src="../../static/home-icon/game.png" ></image>
|
||||
<text class="text">我的队伍</text>
|
||||
<image class = "more" src="../../static/home-icon/more.png" ></image>
|
||||
</view>
|
||||
<view class="line-wide"></view>
|
||||
<view @click="click(4)" class="menu-item">
|
||||
<image class = "icon" src="../../static/home-icon/about.png" ></image>
|
||||
<text class="text">实名信息</text>
|
||||
<image class = "more" src="../../static/home-icon/more.png" ></image>
|
||||
</view>
|
||||
<view class="line-thin"></view>
|
||||
<view @click="click(5)" class="menu-item">
|
||||
<image class = "icon" src="../../static/home-icon/shezhi.png" ></image>
|
||||
<text class="text">设置</text>
|
||||
<image class = "more" src="../../static/home-icon/more.png" ></image>
|
||||
</view>
|
||||
</RefreshView>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
page: {
|
||||
btnList: [{
|
||||
'name': '报名管理',
|
||||
'src': '../../static/game-icon/renyuanguanli.png',
|
||||
'id': 0
|
||||
}, {
|
||||
'name': '删除活动',
|
||||
'src': '../../static/game-icon/shanchu.png',
|
||||
'id': 1
|
||||
}, {
|
||||
'name': '取消关闭',
|
||||
'src': '../../static/game-icon/fanhui.png',
|
||||
'id': -1
|
||||
}],
|
||||
userNickName: "微信登录/注册",
|
||||
headImage: "http://www.ourpyw.com/upload//touxiang/default_tx.jpg",
|
||||
isRealAttestation: "",
|
||||
participateInActivityExplain: "",
|
||||
realAttestationExplain: "认证后可发布活动。未认证",
|
||||
loginName: ""
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
drop(index, isLeft, selectData) {
|
||||
let _this = this;
|
||||
|
||||
let id = selectData.id
|
||||
|
||||
if (id == 0) {
|
||||
// 报名管理
|
||||
uni.navigateTo({
|
||||
url: './ManagerHappyGameMembersActivity?gameSid=' + this.page.gameSid
|
||||
})
|
||||
} else if (id == 1) {
|
||||
// 删除活动
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '确定删除此赛事?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
_this.confirm()
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (id == -1) {
|
||||
// 关闭
|
||||
}
|
||||
},
|
||||
baseInfo() {
|
||||
// 信息中心
|
||||
let _this = this
|
||||
this.Login()
|
||||
.then((res) => {
|
||||
getApp().globalData.memberSid = res
|
||||
_this.WritePreference("memberSid", res)
|
||||
getApp().globalData.isLogin = true
|
||||
// // 真实信息
|
||||
// uni.navigateTo({
|
||||
// url: '../info/RealMessageActivity'
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: '../user/baseInfo'
|
||||
})
|
||||
})
|
||||
},
|
||||
click(id) {
|
||||
let _this = this
|
||||
switch (id) {
|
||||
case 1:
|
||||
// 信息中心
|
||||
this.Login()
|
||||
.then((res) => {
|
||||
getApp().globalData.memberSid = res
|
||||
_this.WritePreference("memberSid", res)
|
||||
getApp().globalData.isLogin = true
|
||||
// // 真实信息
|
||||
// uni.navigateTo({
|
||||
// url: '../info/RealMessageActivity'
|
||||
// })
|
||||
console.log("asdasdas")
|
||||
uni.navigateTo({
|
||||
url: '../user/baseInfo'
|
||||
})
|
||||
})
|
||||
|
||||
break;
|
||||
case 2:
|
||||
// 我的活动
|
||||
this.Login()
|
||||
.then((res) => {
|
||||
getApp().globalData.memberSid = res
|
||||
_this.WritePreference("memberSid", res)
|
||||
getApp().globalData.isLogin = true
|
||||
uni.navigateTo({
|
||||
url: '../games/MyGamesActivity'
|
||||
})
|
||||
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url: '../web/WebActivity?url=' + this.putWEBExtra("https://www.ourpyw.com/hide/#/")
|
||||
// })
|
||||
break;
|
||||
case 3:
|
||||
// 我的队伍
|
||||
uni.navigateTo({
|
||||
url: "../me/myteam/CreateTeam"
|
||||
})
|
||||
case 4:
|
||||
uni.navigateTo({
|
||||
url: '../index/UserAuthentication'
|
||||
})
|
||||
// // 分享
|
||||
// this.$refs.popup.open()
|
||||
break;
|
||||
case 5:
|
||||
// 设置
|
||||
this.Login()
|
||||
.then((res) => {
|
||||
getApp().globalData.memberSid = res
|
||||
_this.WritePreference("memberSid", res)
|
||||
getApp().globalData.isLogin = true
|
||||
uni.navigateTo({
|
||||
url: '../setup/setUp'
|
||||
})
|
||||
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
bind() {
|
||||
if (!this.IsEmpty(getApp().globalData.memberSid)) {
|
||||
return;
|
||||
}
|
||||
// 进入登录页面
|
||||
uni.navigateTo({
|
||||
url: '../me/Login'
|
||||
})
|
||||
// 绑定手机号
|
||||
// uni.navigateTo({
|
||||
// url: '../index/BindPhone?sysUserLoginAuthSid=' +
|
||||
// getApp().globalData.sysUserLoginAuthSid
|
||||
// })
|
||||
},
|
||||
refresh() {
|
||||
let _this = this
|
||||
if (this.IsEmpty(getApp().globalData.memberSid)) {
|
||||
_this.page.userNickName = "微信登录/注册",
|
||||
_this.page.headImage = "http://www.ourpyw.com/upload//touxiang/default_tx.jpg",
|
||||
_this.page.isRealAttestation = "",
|
||||
_this.page.participateInActivityExplain = "",
|
||||
_this.page.realAttestationExplain = "认证后可发布活动。未认证",
|
||||
_this.page.loginName = ""
|
||||
return;
|
||||
}
|
||||
_this.HTTP({
|
||||
url: 'aos/v1/aosUserManagement/getMyPage/' + getApp().globalData.memberSid,
|
||||
method: 'GET',
|
||||
data: {},
|
||||
paramsType: "FORM",
|
||||
loading: true
|
||||
}).then((res) => {
|
||||
|
||||
console.log("我的页面初始化", res);
|
||||
if (res.code == 200) {
|
||||
_this.page = res.data
|
||||
_this.page.loginName = "用户号:" + res.data.loginName
|
||||
// 成功关闭刷新状态
|
||||
_this.$refs.mescrollRef.refreshFinished()
|
||||
|
||||
}
|
||||
|
||||
}, (err) => {
|
||||
// 失败重置刷新状态
|
||||
_this.$refs.mescrollRef.refreshError()
|
||||
|
||||
});;
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.refresh()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import url("../../styles/master.css");
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
background-color: #EDEDED;
|
||||
box-sizing: border-box;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding-bottom: 35rpx;
|
||||
padding-top: 55rpx;
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
box-sizing: border-box;
|
||||
|
||||
.touxiang {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 10%;
|
||||
margin-left: 35rpx;
|
||||
margin-right: 35rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.top-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
|
||||
.name {
|
||||
font-family: sans-serif;
|
||||
font-weight: 500;
|
||||
color: #101010;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.name2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
color: #828282;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user-item-bg {
|
||||
background-color: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user