提交 54b3d950 编写于 作者: R Renic1

Merge branch 'frontend' of https://gitcode.net/qq_50679803/great-teamwork into frontend

文件已添加
......@@ -72,6 +72,41 @@
}
},
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
},
"splashscreen" : {
"androidStyle" : "common"
}
},
"uniStatistics" : {
......
......@@ -160,6 +160,12 @@
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/post/message",
"style": {
"navigationStyle": "custom"
}
}],
"globalStyle": {
"navigationBarTextStyle": "black",
......
<template>
<view class="add-school-activity">
<view class="nav-bar-back">
<image class="nav-bar-back-icon" src="/static/discover/back.png" @click="goBack"></image>
<view class="nav-bar-title">发起赛事</view>
<image class="nav-bar-add" src="../../static/post/send.png" @click="submit" :disabled="btnDisabled"></image>
<image class="nav-bar-back-icon" src="/static/discover/back.png" @click="goBack"></image>
<view class="nav-bar-title">发起赛事</view>
<image class="nav-bar-add" src="../../static/post/send.png" @click="submit" :disabled="btnDisabled"></image>
</view>
<view class="school-activity-icon-wrapper">
<image class="school-activity-icon" src="/static/discover/activity-icon.png"></image>
</view>
<view class="school-activity-item-wrapper">
<view class="form-group">
<image class="form-icon" src="/static/discover/name.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动名称" v-model="name">
<view class="form-group">
<image class="form-icon" src="/static/discover/name.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动名称" v-model="name">
</view>
<view class="form-group">
<image class="form-icon" src="/static/discover/content.png"></image>
<textarea maxlength="200" class="form-input1" placeholder="请输入活动内容" v-model="content" ></textarea>
<image class="form-icon" src="/static/discover/content.png"></image>
<textarea maxlength="200" class="form-input1" placeholder="请输入活动内容" v-model="content"></textarea>
</view>
<view class="form-group">
<image class="form-icon" src="/static/discover/activity-time.png"></image>
<view class="input-wrapper">
<view class="form-input2-wrapper">
<view class="form-input2">
<picker mode="date" start="1970-01-01" end="2100-12-31" @change="handleDateChange1">
<view class="picker">{{ start_date }}</view>
</picker>
<picker mode="date" start="1970-01-01" end="2100-12-31" @change="handleDateChange1">
<view class="picker">{{ start_date }}</view>
</picker>
</view>
<view class="form-input2">
<picker mode="time" start="00:00" end="23:59" @change="handleTimeChange1">
<view class="picker">{{ start_time }}</view>
</picker>
</view>
</view>
<view class="form-input2-wrapper">
<view class="form-input2">
<picker mode="date" start="1970-01-01" end="2100-12-31" @change="handleDateChange2">
<view class="picker">{{ end_date }}</view>
</picker>
</view>
<view class="form-input2">
<picker mode="time" start="00:00" end="23:59" @change="handleTimeChange1">
<view class="picker">{{ start_time }}</view>
</picker>
<picker mode="time" start="00:00" end="23:59" @change="handleTimeChange2">
<view class="picker">{{ end_time }}</view>
</picker>
</view>
</view>
<view class="form-input2-wrapper">
<view class="form-input2">
<picker mode="date" start="1970-01-01" end="2100-12-31" @change="handleDateChange2">
<view class="picker">{{ end_date }}</view>
</picker>
</view>
<view class="form-input2">
<picker mode="time" start="00:00" end="23:59" @change="handleTimeChange2">
<view class="picker">{{ end_time }}</view>
</picker>
</view>
</view>
</view>
</view>
<view class="form-group">
<image class="form-icon" src="/static/discover/activity-object.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动对象" v-model="object">
<image class="form-icon" src="/static/discover/activity-object.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动对象" v-model="object">
</view>
<view class="form-group">
<image class="form-icon" src="/static/discover/activity-place.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动地点" v-model="place">
<image class="form-icon" src="/static/discover/activity-place.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动地点" v-model="place">
</view>
<view class="form-group">
<image class="form-icon" src="/static/discover/activity-contact.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动联系方式" v-model="contact">
<image class="form-icon" src="/static/discover/activity-contact.png"></image>
<input maxlength="20" class="form-input" type="text" placeholder="请输入活动联系方式" v-model="contact">
</view>
<view class="form-group1">
<text>请设置活动封面</text>
<uni-file-picker class="pic-content" v-model="imageValue" file-mediatype="image" mode="grid" file-extname="png,jpg" :limit="1"
@select="select" @progress="progress" @success="success" @fail="fail" />
<uni-file-picker class="pic-content" v-model="imageValue" file-mediatype="image" mode="grid"
file-extname="png,jpg" :limit="1" @select="select" @progress="progress" @success="success"
@fail="fail" />
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
btnDisabled: false,
name:'',
content:'',
object:'',
place:'',
contact:'',
start_date: '2023-05-04',
end_date: '2023-05-04',
start_time:'14:00',
end_time:'14:00',
imageValue:[],
teacherId:'',
}
},
methods: {
goBack() {
uni.navigateBack({
delta: 1
})
},
async submit() {
if (this.btnDisabled) {
return
}
this.btnDisabled = true
setTimeout(() => {
this.btnDisabled = false
}, 1000)
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
const reg2 = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
let time1=this.start_date+' '+this.start_time
let time2=this.end_date+' '+this.end_time
let obj1 = new Date(time1) //开始时间
let obj2 = new Date(time2) //结束时间
if(this.name==''||this.content==''||this.object==''||this.place=='') {
uni.showToast({
title: '输入内容不能为空',
icon: 'none'
});
return;
}
else if(this.imageValue.length==0) {
uni.showToast({
title: '输入图片不能为空',
icon: 'none'
});
return;
}
else if (obj1.getTime() >= obj2.getTime()) {
uni.showToast({
title: '开始时间不能大于等于结束时间',
icon: 'none'
});
return;
}else if (!(reg.test(this.contact))) {
uni.showToast({
title: '请输入正确的联系方式(手机号)',
icon: 'none'
});
return;
}else {
uniCloud.callFunction({
name: 'fe-find-teacher-createActivity',
data: { teacherId:this.teacherId,
picture:this.imageValue[0]["path"],
title:this.name,
content:this.content,
invitee:this.object,
startDate:this.start_date+' '+this.start_time,
endDate:this.end_date+' '+this.end_time,
place:this.place,
contact:this.contact
}
})
.then(res => {
console.log(res);
});
// console.log(this.teacherId);
// uni.showToast({
// title: '提交成功',
// icon: 'success',
// });
// this.goBack();
uni.showToast({
data() {
return {
btnDisabled: false,
name: '',
content: '',
object: '',
place: '',
contact: '',
start_date: '2023-05-04',
end_date: '2023-05-04',
start_time: '14:00',
end_time: '14:00',
imageValue: [],
teacherId: '',
}
},
methods: {
goBack() {
uni.navigateBack({
delta: 1
})
},
async submit() {
if (this.btnDisabled) {
return
}
this.btnDisabled = true
setTimeout(() => {
this.btnDisabled = false
}, 1000)
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
const reg2 = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
let time1 = this.start_date + ' ' + this.start_time
let time2 = this.end_date + ' ' + this.end_time
let obj1 = new Date(time1) //开始时间
let obj2 = new Date(time2) //结束时间
if (this.name == '' || this.content == '' || this.object == '' || this.place == '') {
uni.showToast({
title: '输入内容不能为空',
icon: 'none'
});
return;
} else if (this.imageValue.length == 0) {
uni.showToast({
title: '输入图片不能为空',
icon: 'none'
});
return;
} else if (obj1.getTime() >= obj2.getTime()) {
uni.showToast({
title: '开始时间不能大于等于结束时间',
icon: 'none'
});
return;
} else if (!(reg.test(this.contact))) {
uni.showToast({
title: '请输入正确的联系方式(手机号)',
icon: 'none'
});
return;
} else {
uniCloud.callFunction({
name: 'fe-find-teacher-createActivity',
data: {
teacherId: this.teacherId,
picture: this.imageValue[0]["path"],
title: this.name,
content: this.content,
invitee: this.object,
startDate: this.start_date + ' ' + this.start_time,
endDate: this.end_date + ' ' + this.end_time,
place: this.place,
contact: this.contact
}
})
.then(res => {
console.log(res);
});
uni.showToast({
title: '提交成功',
duration: 1000,
success: () => {
setTimeout(() => {
uni.navigateBack()
}, 1000)
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
})
}
},
handleDateChange1(event) {
this.start_date = event.detail.value
// uni.showToast({
// title: this.start_date,
// icon: 'none'
// })
},
handleDateChange2(event) {
this.end_date = event.detail.value
},
handleTimeChange1(event) {
this.start_time = event.detail.value
},
handleTimeChange2(event) {
this.end_time = event.detail.value
},
select(e) {
console.log('选择文件:', e)
},
// 获取上传进度
progress(e) {
console.log('上传进度:', e)
},
// 上传成功
success(e) {
console.log('上传成功',e)
},
// 上传失败
fail(e) {
console.log('上传失败:', e)
},
},onLoad(e) {
this.teacherId=e.teacherId;
})
}
},
handleDateChange1(event) {
this.start_date = event.detail.value
},
handleDateChange2(event) {
this.end_date = event.detail.value
},
handleTimeChange1(event) {
this.start_time = event.detail.value
},
handleTimeChange2(event) {
this.end_time = event.detail.value
},
select(e) {
console.log('选择文件:', e)
},
// 获取上传进度
progress(e) {
console.log('上传进度:', e)
},
// 上传成功
success(e) {
console.log('上传成功', e)
},
// 上传失败
fail(e) {
console.log('上传失败:', e)
},
},
onLoad(e) {
this.teacherId = e.teacherId;
}
}
}
</script>
<style>
......@@ -213,31 +198,35 @@
position: absolute;
width: 100%;
height: 100%;
background-color: #EDEEF0;
/* background-color: #EDEEF0; */
}
.nav-bar-back {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 60px;
background-color: #EDEEF0;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 60px;
background-color: #EDEEF0;
}
.nav-bar-back-icon {
width: 40px;
height: 30px;
margin-top: 10px;
margin-bottom: 10px;
float: left;
margin-left: 10px;
width: 40px;
height: 30px;
margin-top: 10px;
margin-bottom: 10px;
float: left;
margin-left: 10px;
}
.nav-bar-title {
flex: 1;
text-align: center;
font-size: 20px;
font-weight: bold;
color: #F1992D;
flex: 1;
text-align: center;
font-size: 20px;
font-weight: bold;
color: #F1992D;
}
.nav-bar-add {
width: 30px;
height: 30px;
......@@ -245,67 +234,79 @@
float: right;
margin-right: 10px;
}
.school-activity-icon-wrapper{
.school-activity-icon-wrapper {
margin-top: 20px;
display: flex;
justify-content: center;
align-items: center;
}
.school-activity-icon {
width: 50%;
height: 80px;
margin: 0px;
padding: 0px;
width: 50%;
height: 80px;
margin: 0px;
padding: 0px;
}
.school-activity-item-wrapper{
.school-activity-item-wrapper {
margin-top: 20px;
}
.form-group {
display: flex;
align-items: center;
display: flex;
align-items: center;
margin-top: 15px;
}
.form-icon {
width: 40px;
height: 30px;
margin-left: 10px;
}
.form-input {
}
.form-icon {
width: 40px;
height: 30px;
margin-left: 10px;
}
.form-input {
border-radius: 5px;
background-color: #EDEEF0;
margin-left: 5px;
width: 70%;
height: 35px;
border: none;
outline: none;
font-size: 14px;
color: #333;
background-color: #fff;
padding: 0 10px;
}
.form-input1 {
margin-left: 5px;
width: 70%;
height: 70px;
border: none;
outline: none;
font-size: 14px;
color: #333;
background-color: #fff;
padding: 0 10px;
}
height: 35px;
border: none;
outline: none;
font-size: 14px;
color: #333;
/* background-color: #fff; */
padding: 0 10px;
}
.form-input1 {
border-radius: 5px;
background-color: #EDEEF0;
margin-left: 5px;
width: 70%;
height: 70px;
border: none;
outline: none;
font-size: 14px;
color: #333;
/* background-color: #fff; */
padding: 0 10px;
}
.input-wrapper {
flex-direction: column;
display: flex;
width: 100%;
}
.form-input2-wrapper {
display: flex;
flex-direction: row;
display: flex;
flex-direction: row;
}
.form-input2 {
border-radius: 5px;
background-color: #EDEEF0;
margin-top: 5px;
margin-left: 10px;
width: 30%;
......@@ -314,32 +315,35 @@
outline: none;
font-size: 14px;
color: #333;
background-color: #fff;
/* background-color: #fff; */
padding: 0 10px;
}
.form-group1 {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.form-group1 text {
margin-bottom: 10px; /* 调整 text 和 pic-content 之间的距离 */
}
display: flex;
flex-direction: column;
align-items: center;
margin-top: 10px;
}
.form-group1 text {
margin-bottom: 10px;
/* 调整 text 和 pic-content 之间的距离 */
}
.pic-content {
height: 200px;
}
.picker{
margin-top: 10px;
}
.file-picker__box{
background-color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, 0%);
.picker {
margin-top: 10px;
}
.file-picker__box {
background-color: white;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, 0%);
}
</style>
\ No newline at end of file
<template>
<view class="detail">
<!-- <view class="nav-bar-back">
<image class="nav-bar-back-icon" src="/static/discover/back.png" @click="goBack"></image>
<view class="nav-bar-title">{{title}}</view>
</view> -->
<view v-if="from==1">
<view class="top">
<image @click="goBack" class="back" src="/static/discover/back.png"></image>
......@@ -21,7 +15,8 @@
</view>
</view>
<view class="school-activity-icon-wrapper">
<image class="school-activity-icon" :src="this.picture"></image>
<image class="school-activity-icon"
:style="'background: url('+this.picture+') no-repeat center/cover #eeeeee;'"></image>
</view>
<view class="activity-production">
<image class="activity-production-icon" src="/static/discover/production.png"></image>
......@@ -53,8 +48,6 @@
<uni-popup-dialog cancelText="取消" confirmText="确定" title="警告" content="确定删除该活动吗?"
@confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup>
<!-- <image @click="getData" class="activity-production-icon" src="/static/discover/place.png"></image> -->
</view>
</template>
......@@ -75,6 +68,16 @@
}
},
methods: {
// 图片放大
showPic(imgUrl) {
let arr = [];
arr.push(imgUrl)
console.log(arr, '图片的地址')
uni.previewImage({
current: 0,
urls: arr
});
},
goBack() {
uni.navigateBack({
delta: 1
......@@ -136,10 +139,6 @@
this.activityId = e.activityId;
this.getData();
}
// mounted() {
// this.activityId = this.$route.query.activityId
// }
}
</script>
......@@ -186,25 +185,6 @@
display: inline-block;
}
/* .nav-bar-back {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 60px;
background-color: #EDEEF0;
}
.nav-bar-back-icon {
width: 40px;
height: 30px;
}
.nav-bar-title {
flex: 1;
text-align: center;
font-size: 24px;
font-weight: bold;
color: #F1992D;
} */
.school-activity-icon-wrapper {
margin-top: 10px;
display: flex;
......@@ -262,8 +242,6 @@
/* 文字换行处理 */
word-wrap: break-word;
word-break: break-all;
padding-left: 7px;
padding-right: 7px;
padding-top: 5px;
padding: 10px;
}
</style>
\ No newline at end of file
......@@ -12,7 +12,6 @@
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" @click="tabChange" :current="current">
</u-tabs>
</view>
<view v-if=" id!='1'">
<u-tabs :list="list1" lineWidth="30" lineColor="#F1992D" :activeStyle="{
color: '#F1992D',
......@@ -21,27 +20,29 @@
}" :inactiveStyle="{
color: '#606266',
transform: 'scale(1)'
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" >
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
</u-tabs>
</view>
<!-- 校内活动 -->
<view v-if="current == 0">
<view v-for="activity in activityList">
<view class="one-school-activity" @click="goToDetail(activity.activityId)" >
<view class="one-school-activity" @click="goToDetail(activity.activityId)">
<text class="school-activity-title">{{activity.title}}</text>
<image class="school-activity-icon" :src="activity.picture"></image>
<image class="school-activity-icon"
:style="'background: url('+activity.picture+') no-repeat center/cover #eeeeee;'"></image>
</view>
</view>
<view @click="goActivityAdd(teacherId)" class="add-activity" v-if="showButton">
<u-icon name="edit-pen" color="#F1992D" size="40"></u-icon>
</view>
<view @click="goActivityAdd(teacherId)" class="add-activity" v-if="showButton">
<u-icon name="edit-pen" color="#F1992D" size="40"></u-icon>
</view>
</view>
<!-- 我的活动 -->
<view v-if="current == 1 &&id=='1'" >
<view v-if="current == 1 &&id=='1'">
<view v-for="activity in activityList1">
<view class="one-school-activity" @click="goToDetail(activity.activityId,1)">
<text class="school-activity-title">{{activity.title}}</text>
<image class="school-activity-icon" :src="activity.picture"></image>
<image class="school-activity-icon"
:style="'background: url('+activity.picture+') no-repeat center/cover #eeeeee;'"></image>
</view>
</view>
</view>
......@@ -54,89 +55,91 @@
return {
current: 0,
showButton: false, // 初始值为隐藏
id: '1' ,// 根据id控制显示和隐藏 后期改为判断用户身份
id: '1', // 根据id控制显示和隐藏 后期改为判断用户身份
teacherId: '',
list: [{
name: '发现'
},{
}, {
name: '我的活动',
}, ],
list1: [{
name: '发现'
}],
activityList:[],
activityList1:[],
title:'趣味篮球赛'
activityList: [],
activityList1: [],
title: '趣味篮球赛'
}
},
onPullDownRefresh(){
//刷新后的效果
this.onLoad1();
uni.stopPullDownRefresh();
},
onPullDownRefresh() {
//刷新后的效果
this.onLoad1();
uni.stopPullDownRefresh();
},
mounted() {
// 根据id值进行判断
if (this.id == 1) {
this.showButton = true;
}
// 根据id值进行判断
if (this.id == 1) {
this.showButton = true;
}
},
methods: {
goToDetail(activityId) {
uni.navigateTo({
url: '/pages/discover/discover-detail?activityId='+ activityId
})
},
goToDetail(activityId,from) {
url: '/pages/discover/discover-detail?activityId=' + activityId
})
},
goToDetail(activityId, from) {
uni.navigateTo({
url: '/pages/discover/discover-detail?activityId='+ activityId +'&from=' + from
})
},
goActivityAdd(teacherId) {
uni.navigateTo({
url: '/pages/discover/add-school-activity?teacherId=' + teacherId
})
},
tabChange(index) {
this.current = index.index;
},
getData() {
uniCloud.callFunction({
name: 'fe-find-activityList',
data: {}
})
.then(res => {
this.activityList=res.result.data.activityList,
url: '/pages/discover/discover-detail?activityId=' + activityId + '&from=' + from
})
},
goActivityAdd(teacherId) {
uni.navigateTo({
url: '/pages/discover/add-school-activity?teacherId=' + teacherId
})
},
tabChange(index) {
this.current = index.index;
},
getData() {
uniCloud.callFunction({
name: 'fe-find-activityList',
data: {}
})
.then(res => {
this.activityList = res.result.data.activityList,
console.log(res);
});
},
getData1() {
uniCloud.callFunction({
name: 'fe-find-teacher-ActivityList',
data: {teacherId:this.teacherId}
})
.then(res => {
this.activityList1=res.result.data.activityList,
console.log(this.activityList1);
});
});
},
getData1() {
uniCloud.callFunction({
name: 'fe-find-teacher-ActivityList',
data: {
teacherId: this.teacherId
}
})
.then(res => {
this.activityList1 = res.result.data.activityList,
console.log(this.activityList1);
});
},
onLoad1() {
let type = getApp().globalData.type;
if (type == "644a64c228064a7587cd79bf") this.id = 2;
else this.id = 1;
if (this.id == 1) this.teacherId = getApp().globalData.userId;
this.getData();
this.getData1();
}
},
onLoad1() {
let type =getApp().globalData.type;
if(type=="644a64c228064a7587cd79bf") this.id=2;
else this.id=1;
if(this.id==1) this.teacherId=getApp().globalData.userId;
this.getData();
this.getData1();
}
},
onLoad() {
let type =getApp().globalData.type;
if(type=="644a64c228064a7587cd79bf") this.id=2;
else this.id=1;
if(this.id==1) this.teacherId=getApp().globalData.userId;
let type = getApp().globalData.type;
if (type == "644a64c228064a7587cd79bf") this.id = 2;
else this.id = 1;
if (this.id == 1) this.teacherId = getApp().globalData.userId;
this.getData();
this.getData1();
},
......@@ -148,40 +151,45 @@
<style>
.one-school-activity {
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
background-color: rgb(245 154 35 / 30%);
margin: 20px auto;
border-radius: 15px;
overflow: auto;
display: flex;
flex-direction: column;
align-items: center;
width: 90%;
background-color: rgb(245 154 35 / 30%);
margin: 20px auto;
border-radius: 15px;
overflow: auto;
}
.school-activity-icon {
width: 90%;
height: 200px;
margin-top: 2px;
margin-bottom: 10px;
border-radius: 15px;
width: 90%;
height: 200px;
margin-top: 2px;
margin-bottom: 10px;
border-radius: 15px;
}
.school-activity-title {
color: #5e5e5e;
display: block;
margin-top: 10px;
margin-bottom: 8px;
text-align: center;
font-size: 20px;
font-weight: bold;
}
.add-activity {
position: fixed;
right: 20rpx;
bottom: 100rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
background-color: white;
box-shadow: 0 0 20rpx #999;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
right: 20rpx;
bottom: 100rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50%;
background-color: white;
box-shadow: 0 0 20rpx #999;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</style>
\ No newline at end of file
......@@ -14,7 +14,8 @@
<uni-easyinput type="number" :inputBorder="true" v-model="formData.captcha"
placeholder="请输入六位验证码"></uni-easyinput>
</uni-forms-item>
<button class="captchaButton" @click="sendCaptcha()">发送验证码</button>
<!-- <button class="captchaButton" @click="sendCaptcha()">发送验证码</button> -->
<button size="mini" class="captchaButton" :disabled="btnDis" @tap="sendCaptcha">{{btnText}}</button>
</view>
<uni-forms-item name="newPassword" required label="新密码">
<uni-easyinput type="password" :inputBorder="true" v-model="formData.newPassword"
......@@ -36,15 +37,15 @@
<canvas canvas-id="canvas" @click="updateImageCode" class="canvas"></canvas>
<input class="ginput" v-model="graphicVerifyCode" placeholder="请输入验证码" />
<button style="margin-top: 10px;" :loading="loading" @tap="submitFcha" class="btn-big">验证</button>
<view class="text" @click="updateImageCode">获取验证码</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
let code=200;
let code = 200;
import {
Fcaptcha
} from "@/common/fcaptcha.js"
......@@ -53,6 +54,8 @@
components: {},
data() {
return {
btnDis: false,// 发送验证码按钮不禁用
btnText: "发送验证码",// 提示
loading: false,
graphicVerifyCode: "",
formData: {
......@@ -71,13 +74,12 @@
if (value === '') {
callback(new Error('手机号不能为空'))
} else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
const reg2 = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
if ((reg.test(value) || reg2.test(value))) {
const reg = /^(13[0-9]|14[0-9]|15[0-9]|166|17[0-9]|18[0-9]|19[8|9])\d{8}$/
if (reg.test(value)) {
this.yzmshow = true
callback()
} else {
callback(new Error('请输入正确的手机号'))
callback('请输入正确的手机号')
}
}
}
......@@ -89,7 +91,7 @@
errorMessage: '请输入六位验证码'
}, {
validateFunction: function(rule, value, data, callback) {
if (value.length !=6) {
if (value.length != 6) {
callback('验证码为六位!')
} else {
callback();
......@@ -115,10 +117,8 @@
rules: [{
required: true,
errorMessage: '请确认密码'
}, {
validateFunction: function(rule, value, data, callback) {
// console.log(data.newPassword);
if (value.length > 20 || value.length < 8) {
callback('密码长度在8-20位!')
} else if (value != data.newPassword) {
......@@ -137,46 +137,69 @@
await this.$refs['popupDialog'].open()
await this.fcaptcha.refresh()
},
countDown() {
// 初始化定时器
let t = null;
// 倒计时1分钟
let timer = 300;
// 按钮禁用
this.btnDis = true;
// 计时器清零
clearInterval(t);
// 按钮显示时间
this.btnText = `${timer}s`;
t = setInterval(() => {
// 当倒计时完时,显示重新发送,按钮开启
if (timer == 0) {
clearInterval(t);
this.btnText = "重新发送";
this.btnDis = false;
return;
}
// 实现倒计时效果
timer--;
this.btnText = `${timer}s`;
}, 1000)
},
confirm(validateForm) {
this.$refs[validateForm].validate(valid=>{
if(!valid){
this.$refs[validateForm].validate(valid => {
if (!valid) {
this.calluniCloud()
}
})
})
},
async calluniCloud(){
async calluniCloud() {
await uniCloud.callFunction({
name: 'fe-retrievePassword',
data: {
phone:this.formData.phone,
password:this.formData.password,
code:this.formData.captcha
phone: this.formData.phone,
password: this.formData.newPassword,
code: this.formData.captcha
}
})
.then(res => {
this.code=res.result.code
this.code = res.result.code
console.log(res)
})
await this.showTorM()
await this.showTorM()
},
showTorM(){
showTorM() {
if (this.code == 200) {
console.log(this.code, 'this.code1')
uni.showToast({
title: '修改成功',
duration: 2000
});
} else if(this.code==400){
} else if (this.code == 400) {
uni.showToast({
title: '验证码错误或超时',
icon:"error",
icon: "error",
duration: 2000
});
}
else{
} else {
uni.showToast({
title: '错误',
icon:"error",
icon: "error",
duration: 2000
});
}
......@@ -200,16 +223,16 @@
if (!this.graphicVerifyCode) {
return uni.showToast({
title: '请输入图形验证码',
icon:'error'
icon: 'error'
})
}
let validate = this.fcaptcha.validate(this.graphicVerifyCode)
if (!validate) {
this.updateImageCode();
this.graphicVerifyCode=''
uni.showToast({
this.graphicVerifyCode = ''
uni.showToast({
title: '图形验证码错误',
icon:'error'
icon: 'error'
})
this.fcaptcha.refresh()
} else {
......@@ -220,13 +243,14 @@
uniCloud.callFunction({
name: 'fe-auth-code',
data: {
phone:this.formData.phone
phone: this.formData.phone
}
})
.then(res => {
this.code = res.result.code,
console.log(this.userId)
this.code = res.result.code
console.log(this.userId)
})
this.countDown();
}
}
},
......@@ -265,11 +289,6 @@
margin-right: auto;
}
/* .text-area {
display: flex;
justify-content: center;
} */
.confirmButton {
background-color: #f1992d;
color: #fff;
......@@ -288,7 +307,7 @@
height: 35px;
font-size: 0.7em;
border: 0;
border-radius: 20px;
border-radius: 18px;
}
.captchaButton::after {
......@@ -300,7 +319,7 @@
flex-direction: column;
background-color: #fff;
width: 270px;
height: 300px;
height: 200px;
border-radius: 10px;
}
......@@ -309,10 +328,17 @@
width: 200rpx;
height: 100rpx;
}
.btn-big {
background-color: #f1992d;
color: #fff;
border: 0;
border-radius: 20px;
}
.text{
margin-top: 12px;
font-size: 10px;
color: #f1992d;
}
</style>
\ No newline at end of file
......@@ -21,7 +21,6 @@
<text class="rgst" @click="goBack(1,'/pages/login/register')">注册账号</text>
<text class="fbpw" @click="goBack(2,'/pages/login/find')">找回密码</text>
</view>
</view>
</template>
......@@ -81,14 +80,14 @@
}
})
.then(res => {
if(res.result.code===200){
getApp().globalData.userId=res.result.data.userId
getApp().globalData.name=res.result.data.name
getApp().globalData.type=res.result.data.type
getApp().globalData.icon=res.result.data.icon
getApp().globalData.school=res.result.data.school
getApp().globalData.moblie=res.result.data.phone_num
getApp().globalData.gender=res.result.data.gender
if (res.result.code === 200) {
getApp().globalData.userId = res.result.data.userId
getApp().globalData.name = res.result.data.name
getApp().globalData.type = res.result.data.type
getApp().globalData.icon = res.result.data.icon
getApp().globalData.school = res.result.data.school
getApp().globalData.moblie = res.result.data.phone_num
getApp().globalData.gender = res.result.data.gender
console.log(res)
uni.showToast({
title: '登录成功',
......@@ -99,7 +98,7 @@
animationType: 'pop-in',
animationDuration: 300
})
}else{
} else {
uni.showToast({
title: '账号或密码错误',
icon: 'error'
......@@ -166,8 +165,6 @@
border: 0;
}
.rgst {
color: #f1992d;
display: inline-block;
......
......@@ -31,7 +31,6 @@
</uni-forms-item>
</uni-forms>
</view>
<!-- <helang-tab-bar-bubble :fixed-bottom="true"></helang-tab-bar-bubble> -->
</view>
</template>
......
......@@ -10,36 +10,37 @@
<script>
export default {
onReady() {
if (this.type=='跑步'){
if (this.type == '跑步') {
uniCloud.callFunction({
name: 'fe-my-runningDetail',
data: {runningId: this.id}
})
.then(res => {
this.getData(res);
});
name: 'fe-my-runningDetail',
data: {
runningId: this.id
}
})
.then(res => {
this.getData(res);
});
const subNVue = uni.getSubNVueById('popup1'); // 通过 id 获取 nvue 子窗体
subNVue.show('slide-in-top', 250); // 打开 nvue 子窗体
}
else if(this.type=='健走'){
} else if (this.type == '健走') {
uniCloud.callFunction({
name: 'fe-my-walkingDetail',
data: {walkingId: this.id}
})
.then(res => {
this.getData(res);
});
name: 'fe-my-walkingDetail',
data: {
walkingId: this.id
}
})
.then(res => {
this.getData(res);
});
const subNVue = uni.getSubNVueById('popup1'); // 通过 id 获取 nvue 子窗体
subNVue.show('slide-in-top', 250); // 打开 nvue 子窗体
}
},
data() {
return {
type:',',
type: ',',
id: '',
icon: '/static/sport/icon.jpg',
longitude: '',
......@@ -69,44 +70,42 @@
},
methods: {
goBack() {
var url
if (this.type === '跑步') {
url = '/pages/my/my-running-record'
} else {
url = '/pages/my/my-walking-record'
}
uni.reLaunch({
url: '/pages/my/my-running-record',
url: url,
animationType: 'pop-in',
animationDuration: 300
})
// uni.navigateBack({
// delta: 1, //返回层数,2则上上页
// })
},
getData(res){
getData(res) {
console.log(res);
uni.$emit('information', {
type: this.type,
startTime: res.result.data.StartDatetime,
distance: res.result.data.distance,
duration: res.result.data.duration,
pace: res.result.data.pace,
feeling:res.result.data.feeling,
id:this.id
feeling: res.result.data.feeling,
id: this.id
});
//this.id = res.result.data.id;
this.polyline[0].points = res.result.data.pathLine;
this.markers[0].latitude = res.result.data.startPoint.latitude;
this.markers[0].longitude = res.result.data.startPoint.longitude;
this.markers[1].latitude = this.polyline[0].points[this.polyline[0].points.length - 1].latitude;
this.markers[1].longitude = this.polyline[0].points[this.polyline[0].points.length - 1].longitude;
// this.markers[1].longitude = res.result.data.endPoint.longitude;
//this.markers[1].latitude = res.result.data.endPoint.latitude;
this.latitude = this.markers[1].latitude;
this.longitude = this.markers[1].longitude;
}
},
onLoad(e){
this.id=e.id;
this.type=e.type;
onLoad(e) {
this.id = e.id;
this.type = e.type;
console.log(this.type);
//console.log(this.id);
}
}
</script>
......
......@@ -5,17 +5,25 @@
</view>
<view class="info">
<view class="info1">
<view class="head-portrait" :style="'background: url('+headPortraitIcon+') no-repeat center/cover #eeeeee;'"></view>
<view class="head-portrait"
:style="'background: url('+headPortraitIcon+') no-repeat center/cover #eeeeee;'"
@click.stop="showPic(headPortraitIcon)"></view>
<view class="nickname">{{nickname}}</view>
</view>
<view class="info2">
<view class="school">
<view class="school-icon"></view>
<view class="school-name">&emsp;&emsp;校:{{schoolName}}</view>
<view class="school-name">
<view class="text">&emsp;&emsp;校:</view>
<view class="text1">{{schoolName}}</view>
</view>
</view>
<view class="team">
<view class="team-icon"></view>
<view class="team-name">运动小队:{{teamName}}</view>
<view class="team-name">
<view class="text">运动小队:</view>
<view class="text1">{{teamName}}</view>
</view>
</view>
</view>
</view>
......@@ -44,18 +52,26 @@
<script>
export default {
data () {
data() {
return {
headPortraitIcon:'',
nickname:'',
schoolName:'',
teamName:'',
// moblie:'',
// gender:'',
userId:'',
headPortraitIcon: '',
nickname: '',
schoolName: '',
teamName: '新野生动物营',
userId: '',
}
},
methods:{
methods: {
// 图片放大
showPic(imgUrl) {
let arr = [];
arr.push(imgUrl)
console.log(arr, '图片的地址')
uni.previewImage({
current: 0,
urls: arr
});
},
goToModify() {
uni.navigateTo({
url: '/pages/my/my-modify'
......@@ -77,163 +93,156 @@
})
},
goToWalkingRecord() {
uni.navigateTo({
url: '/pages/my/my-walking-record'
})
},
getData() {
uniCloud.callFunction({
name: 'fe-my-information',
data: {userId:this.userId}
})
.then(res => {
console.log(res);
this.teamName=res.result.data.team;
//this.activityList=res.result.data.activityList,
//console.log(res);
});
name: 'fe-my-information',
data: {
userId: this.userId
}
})
.then(res => {
console.log(res);
this.teamName = res.result.data.team;
});
},
},
onLoad() {
plus.navigator.setStatusBarBackground('#EDEEF0');
// this.headPortraitIcon=getApp().globalData.icon;
// this.nickname=getApp().globalData.name;
// this.schoolName=getApp().globalData.school;
// this.teamName=
},
onShow(){
this.headPortraitIcon=getApp().globalData.icon;
this.nickname=getApp().globalData.name;
this.schoolName=getApp().globalData.school;
this.userId=getApp().globalData.userId;
onShow() {
this.headPortraitIcon = getApp().globalData.icon;
this.nickname = getApp().globalData.name;
this.schoolName = getApp().globalData.school;
this.userId = getApp().globalData.userId;
this.getData();
// this.moblie=getApp().globalData.moblie;
// this.gender=getApp().globalData.gender;
}
}
</script>
<style>
.main {
position: absolute;
width: 100%;
height: 100%;
background-color: #EDEEF0;
}
.modify{
.modify {
height: 10%;
}
.modify-icon{
.modify-icon {
margin-top: 50rpx;
margin-left: 85%;
width: 70rpx;
height: 70rpx;
}
.info{
.info {
height: 60%;
}
.info1{
.info1 {
height: 30%;
}
.head-portrait {
margin-top: 50rpx;
margin-left: 15%;
width: 200rpx;
height: 200rpx;
width: 180rpx;
height: 180rpx;
border-radius: 50%;
background-size:100% 100%;
/* background-image:url("/static/my/main/head-portrait.png") ;
background-repeat:no-repeat; */
background-size: 100% 100%;
float: left;
}
.nickname{
.nickname {
width: 250rpx;
height: 50rpx;
font-size: 60rpx;
font-size: 50rpx;
text-align: left;
float: right;
margin-top: 100rpx;
margin-right: 100rpx;
font-weight: bold;
margin-top: 110rpx;
margin-right: 150rpx;
}
.info2{
.info2 {
border-radius: 20rpx;
background-color: #FFFFFF;
width:75%;
width: 75%;
height: 40%;
margin-top: 50px;
margin-left: auto;
margin-right: auto;
}
.school{
.school {
height: 50%;
}
.school-icon{
.school-icon {
width: 100rpx;
height: 100rpx;
margin-top: 30rpx;
margin-top: 45rpx;
margin-left: 50rpx;
background-size:100% 100%;
background-image:url("/static/my/main/school-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/main/school-icon.png");
background-repeat: no-repeat;
float: left;
}
.school-name{
.school-name {
width: 340rpx;
height: 30rpx;
margin-top: 60rpx;
margin-top: 80rpx;
margin-right: 45rpx;
font-size: 35rpx;
font-size: 36rpx;
text-align: left;
float: right;
}
.team{
.team {
height: 50%;
}
.team-icon{
.team-icon {
width: 100rpx;
height: 100rpx;
margin-top: 40rpx;
margin-top: 35rpx;
margin-left: 50rpx;
background-size:100% 100%;
background-image:url("/static/my/main/team-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/main/team-icon.png");
background-repeat: no-repeat;
float: left;
}
.team-name{
.team-name {
width: 340rpx;
height: 30rpx;
margin-top: 60rpx;
margin-top: 55rpx;
margin-right: 45rpx;
font-size: 35rpx;
font-size: 36rpx;
text-align: left;
float: right;
}
.func{
width:75%;
/* margin-top: 10rpx; */
.text{
float:left;
}
.text1{
float:right;
width: 75px;
}
.func {
width: 75%;
margin-left: auto;
margin-right: auto;
display: flex;
......@@ -241,68 +250,69 @@
text-align: center;
font-size: 20rpx;
}
.my-walking-record{
width:200rpx;
.my-walking-record {
width: 200rpx;
height: 250rpx;
}
.my-walking-record-icon{
.my-walking-record-icon {
width: 100rpx;
height: 100rpx;
margin-top: 50rpx;
margin-left: auto;
margin-right: auto;
background-size:100% 100%;
background-image:url("/static/my/main/walking-record-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/main/walking-record-icon.png");
background-repeat: no-repeat;
}
.running-record{
width:200rpx;
.running-record {
width: 200rpx;
height: 250rpx;
}
.running-record-icon{
.running-record-icon {
width: 100rpx;
height: 100rpx;
margin-top: 50rpx;
margin-left: auto;
margin-right: auto;
background-size:100% 100%;
background-image:url("/static/my/main/running-record-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/main/running-record-icon.png");
background-repeat: no-repeat;
}
.setting{
width:200rpx;
.setting {
width: 200rpx;
height: 250rpx;
}
.setting-icon{
.setting-icon {
width: 100rpx;
height: 100rpx;
margin-top: 50rpx;
margin-left: auto;
margin-right: auto;
background-size:100% 100%;
background-image:url("/static/my/main/setting-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/main/setting-icon.png");
background-repeat: no-repeat;
}
.reset-password{
width:200rpx;
.reset-password {
width: 200rpx;
height: 250rpx;
}
.reset-password-icon{
.reset-password-icon {
width: 100rpx;
height: 100rpx;
margin-top: 50rpx;
margin-left: auto;
margin-right: auto;
background-size:100% 100%;
background-image:url("/static/my/main/reset-password-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/main/reset-password-icon.png");
background-repeat: no-repeat;
}
</style>
\ No newline at end of file
......@@ -7,12 +7,10 @@
</view>
<view class="container">
<view class="ui-all">
<view class="avatar" @tap="avatarChoose">
<view class="imgAvatar">
<view class="iavatar" :style="'background: url('+avatar+') no-repeat center/cover #eeeeee;'">
</view>
</view>
<text>修改头像</text>
<button v-if="!avatar" open-type="getUserInfo" @tap="getUserInfo" class="getInfo"></button>
......@@ -57,7 +55,6 @@
<script>
export default {
data() {
return {
selectSex: [{
......@@ -71,9 +68,6 @@
school: [{
id: 1,
name: '福州大学'
}, {
id: 2,
name: 'xx大学'
}],
index2: '0',
avatar: '',
......@@ -83,26 +77,20 @@
userId: '',
sex: '',
}
},
methods: {
bindPickerChange(e) {
this.index1 = e.detail.value;
},
bindSchoolChange(e) {
this.index2 = e.detail.value;
},
bindnickName(e) {
this.nickName = e.detail.value;
},
bindmobile(e) {
this.mobile = e.detail.value;
},
avatarChoose() {
let that = this;
uniCloud.chooseAndUploadFile({
......@@ -115,7 +103,6 @@
});
},
dialogConfirm() {
let that = this;
let gender = that.selectSex[that.index1].name;
let school = that.school[that.index2].name;
......@@ -159,16 +146,12 @@
})
this.$refs.alertDialog.close();
},
dialogClose() {
this.$refsalertDialog.close();
},
savaInfo() {
this.$refs.alertDialog.open();
},
isPoneAvailable(poneInput) {
var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
if (!myreg.test(poneInput)) {
......@@ -177,14 +160,12 @@
return true;
}
},
goBack() {
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
},
Upload(updata) {
uniCloud.callFunction({
name: 'fe-my-modifyinformation',
data: {
......@@ -199,11 +180,9 @@
.then(res => {
console.log(res);
});
},
},
onLoad() {
plus.navigator.setStatusBarBackground('#EDEEF0');
this.nickName = getApp().globalData.name;
this.userId = getApp().globalData.userId;
......@@ -216,9 +195,7 @@
} else if (this.gender == '') {
this.index1 = 1;
}
//this.getData();
}
}
</script>
......
<template>
<view class="main">
<!-- <view class="return">
<view class="return-btn" @click="goBack"></view>
<text>重置密码</text>
</view> -->
<view class="top">
<image @click="goBack" class="back" src="/static/discover/back.png"></image>
<view class="title">重置密码</view>
<span class="empty"></span>
</view>
<view class="content">
<view class="password">
<span>&ensp;&ensp;码:</span>
<input placeholder="请输入原密码" @input="bindPassword" type="text" :password="showPassword" name="input"></input>
<!-- <text :class="[!showPassword ?'cuIcon-attentionfill' : 'cuIcon-attentionforbidfill']" class="text-gray" @click="showPwd" ></text> -->
<!-- <input type="safe-password" :value="originalPassword" :valplaceholder='请输入原密码'></input> -->
<view class="text-area">
<uni-forms :modelValue="formData" label-position="left" :labelWidth='90' :rules="confirmRules"
ref="form" validate-trigger="bind" err-show-type="undertext">
<uni-forms-item name="phone" required label="手机号">
<uni-easyinput type="text" :inputBorder="true" v-model="formData.phone"
placeholder="请输入注册使用的手机号"></uni-easyinput>
</uni-forms-item>
<view style="display: flex;flex-flow: row nowrap;">
<uni-forms-item name="captcha" required label="验证码">
<uni-easyinput type="number" :inputBorder="true" v-model="formData.captcha"
placeholder="请输入六位验证码"></uni-easyinput>
</uni-forms-item>
<button size="mini" class="captchaButton" :disabled="btnDis" @tap="sendCaptcha">{{btnText}}</button>
<!-- <button class="captchaButton" @click="sendCaptcha()">发送验证码</button> -->
</view>
<uni-forms-item name="newPassword" required label="新密码">
<uni-easyinput type="password" :inputBorder="true" v-model="formData.newPassword"
placeholder="请输入密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item name="confirmPassword" required label="确认密码">
<uni-easyinput type="password" :inputBorder="true" v-model="formData.confirmPassword"
placeholder="请确认新密码"></uni-easyinput>
</uni-forms-item>
<uni-forms-item>
<button class="confirmButton" @click="confirm('form')">确认</button>
</uni-forms-item>
</uni-forms>
</view>
<view class="password">
<span>&ensp;&ensp;码:</span>
<input placeholder="请输入新密码" type="text" @input="bindNewPassword" :password="showPassword"
name="input"></input>
</view>
<view class="password">
<span>确认密码:</span>
<input placeholder="请确认密码" type="text" @input="bindConfirmPassword" :password="showPassword"
name="input"></input>
</view>
</view>
<view class="confirm">
<button class="confirm-btn" @click="confirmModification()">确认修改</button>
</view>
<uni-popup ref="popupDialog" type="center">
<view class="mcaptcha">
<view style="padding: 30px 20px;text-align: center;">
<canvas canvas-id="canvas" @click="updateImageCode" class="canvas"></canvas>
<input class="ginput" v-model="graphicVerifyCode" placeholder="请输入验证码" />
<button style="margin-top: 10px;" :loading="loading" @tap="submitFcha" class="btn-big">验证</button>
<view class="text" @click="updateImageCode">获取验证码</view>
</view>
</view>
</uni-popup>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="取消" confirmText="确定" title="提示" content="确定修改你的密码吗?"
@confirm="dialogConfirm"></uni-popup-dialog>
......@@ -38,147 +54,251 @@
</template>
<script>
let code = 200;
import {
Fcaptcha
} from "@/common/fcaptcha.js"
export default {
name: 'login',
components: {},
data() {
return {
showPassword: true,
password:'',
newPassword: '',
confirmPassword: '',
btnDis: false,// 发送验证码按钮不禁用
btnText: "发送验证码",// 提示
loading: false,
graphicVerifyCode: "",
formData: {
phone: '',
password: '',
captcha: '',
newPassword: ''
},
confirmRules: {
phone: {
rules: [{
required: true,
errorMessage: '请输入手机号'
}, {
validateFunction: function(rule, value, data, callback) {
if (value === '') {
callback(new Error('手机号不能为空'))
} else {
const reg = /^(13[0-9]|14[0-9]|15[0-9]|166|17[0-9]|18[0-9]|19[8|9])\d{8}$/
if (reg.test(value)) {
this.yzmshow = true
callback()
} else {
callback('请输入正确的手机号')
}
}
}
}]
},
captcha: {
rules: [{
required: true,
errorMessage: '请输入六位验证码'
}, {
validateFunction: function(rule, value, data, callback) {
if (value.length != 6) {
callback('验证码为六位!')
} else {
callback();
}
}
}]
},
newPassword: {
rules: [{
required: true,
errorMessage: '请输入密码'
}, {
validateFunction: function(rule, value, data, callback) {
if (value.length > 20 || value.length < 8) {
callback('密码长度在8-20位!')
} else {
callback();
}
}
}]
},
confirmPassword: {
rules: [{
required: true,
errorMessage: '请确认密码'
}, {
validateFunction: function(rule, value, data, callback) {
if (value.length > 20 || value.length < 8) {
callback('密码长度在8-20位!')
} else if (value != data.newPassword) {
callback('密码不一致')
} else {
callback();
}
}
}]
}
}
}
},
methods: {
bindPassword(e) {
this.password = e.detail.value;
async sendCaptcha() {
await this.$refs['popupDialog'].open()
await this.fcaptcha.refresh()
},
bindNewPassword(e) {
this.newPassword = e.detail.value;
countDown() {
// 初始化定时器
let t = null;
// 倒计时1分钟
let timer = 300;
// 按钮禁用
this.btnDis = true;
// 计时器清零
clearInterval(t);
// 按钮显示时间
this.btnText = `${timer}s`;
t = setInterval(() => {
// 当倒计时完时,显示重新发送,按钮开启
if (timer == 0) {
clearInterval(t);
this.btnText = "重新发送";
this.btnDis = false;
return;
}
// 实现倒计时效果
timer--;
this.btnText = `${timer}s`;
}, 1000)
},
bindConfirmPassword(e) {
this.confirmPassword = e.detail.value;
confirm(validateForm) {
this.$refs.alertDialog.open();
},
dialogConfirm() {
let that = this;
let password = that.password;
let newPassword = that.newPassword;
let confirmPassword = that.confirmPassword;
let updata = {};
if (!that.isPasswordAvailable(newPassword)) {
this.$refs[validateForm].validate(valid => {
if (!valid) {
this.calluniCloud()
}
})
},
async calluniCloud() {
await uniCloud.callFunction({
name: 'fe-retrievePassword',
data: {
phone: this.formData.phone,
password: this.formData.newPassword,
code: this.formData.captcha
}
})
.then(res => {
this.code = res.result.code
console.log(res)
})
await this.showTorM()
},
showTorM() {
if (this.code == 200) {
console.log(this.code, 'this.code1')
uni.showToast({
title: '密码长度在8-20位!',
icon: 'none',
title: '修改成功',
duration: 2000
});
return;
} else if (!that.isConfirmPasswordAvailable(newPassword, confirmPassword)) {
} else if (this.code == 400) {
uni.showToast({
title: '两次密码不一致',
icon: 'none',
title: '验证码错误或超时',
icon: "error",
duration: 2000
});
return;
} else {
updata.password = password;
updata.newPassword = newPassword;
uni.showToast({
title: '错误',
icon: "error",
duration: 2000
});
}
this.Upload(updata);
this.$refs.alertDialog.close();
},
goBack() {
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
},
dialogClose() {
//console.log('点击关闭')
this.$refsalertDialog.close();
},
confirmModification() {
this.$refs.alertDialog.open();
// uni.showModal({
// title: '温馨提示', //提示标题
// content: '确认修改密码吗', //提示内容
// showCancel: true, //是否显示取消按钮
// success: res => {
// if (res.confirm) { //confirm为ture,代表用户点击确定
// let that = this;
// let password = that.password;
// let newPassword = that.newPassword;
// let confirmPassword = that.confirmPassword;
// let updata = {};
// if (!that.isPasswordAvailable(newPassword)) {
// uni.showToast({
// title: '密码长度在8-20位!',
// icon: 'none',
// duration: 2000
// });
// return;
// } else if (!that.isConfirmPasswordAvailable(newPassword, confirmPassword)) {
// uni.showToast({
// title: '两次密码不一致',
// icon: 'none',
// duration: 2000
// });
// return;
// } else {
// updata.password = password;
// updata.newPassword = newPassword;
// }
// this.Upload(updata);
// } else if (res.cancel) { //cancel为ture,代表用户点击取消
// console.log('点击了取消按钮');
// }
// }
// })
// 刷新验证码
updateImageCode() {
this.fcaptcha.refresh()
},
isPasswordAvailable(newPassword) {
if (newPassword.length > 20 || newPassword.length < 8) {
return false;
} else {
return true;
// 提交前校验图形验证码
submitFcha() {
if (!this.graphicVerifyCode) {
return uni.showToast({
title: '请输入图形验证码',
icon: 'error'
})
}
},
isConfirmPasswordAvailable(newPassword, confirmPassword) {
if (newPassword == confirmPassword) {
return true;
let validate = this.fcaptcha.validate(this.graphicVerifyCode)
if (!validate) {
this.updateImageCode();
this.graphicVerifyCode = ''
uni.showToast({
title: '图形验证码错误',
icon: 'error'
})
this.fcaptcha.refresh()
} else {
return false;
}
},
goBack() {
uni.navigateBack({
delta: 1, //返回层数,2则上上页
})
},
Upload(updata) {
uniCloud.callFunction({
name: 'fe-my-resetpassword',
data: {userId:getApp().globalData.userId,password:updata.password,newPassword:updata.newPassword},
})
.then(res => {
uni.showToast({
title: res.result.message,
icon: 'none',
duration: 2000
});
//if (res.result.data.code==)
console.log(res);
});
},
onload() {
plus.navigator.setStatusBarBackground('#EDEEF0');
title: '图形验证码通过'
})
this.$refs['popupDialog'].close();
uniCloud.callFunction({
name: 'fe-auth-code',
data: {
phone: this.formData.phone
}
})
.then(res => {
this.code = res.result.code
console.log(this.userId)
})
this.countDown();
}
}
}
},
onReady() {
this.fcaptcha = new Fcaptcha({
el: 'canvas',
width: 80,
height: 35,
createCodeImg: ""
});
},
}
</script>
<style>
.bg {
background-color: #edeef0;
}
.main {
position: absolute;
width: 100%;
height: 100%;
/* background-color: #EDEEF0; */
}
.content {
/* background-color: #edeef0; */
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
position: absolute;
width: 100%;
height: 100%;
}
.top {
......@@ -187,7 +307,7 @@
background-color: #EDEEF0;
text-align: center;
}
.back {
width: 40px;
height: 30px;
......@@ -196,7 +316,7 @@
float: left;
margin-left: 10px;
}
.empty {
width: 40px;
height: 30px;
......@@ -205,7 +325,7 @@
float: right;
margin-right: 10px;
}
.title {
font-size: 20px;
margin-top: 15px;
......@@ -214,46 +334,65 @@
display: inline-block;
}
.content {
width: 80%;
margin-top: 50%;
margin-left: auto;
.returnBack {
height: 55rpx;
width: 55rpx;
margin-top: 60rpx;
margin-left: 20rpx;
margin-right: auto;
}
.password {
.confirmButton {
background-color: #f1992d;
color: #fff;
border: 0;
border-radius: 20px;
}
margin-top: 50rpx;
height: 20%;
display: flex;
align-items: center;
.confirmButton::after {
border: 0;
}
/* border-bottom: 1px solid #ccc; */
.captchaButton {
background-color: #f1992d;
color: #fff;
width: 90px;
height: 35px;
font-size: 0.7em;
border: 0;
border-radius: 18px;
}
.password span {
font-size: 35rpx;
.captchaButton::after {
border: 0;
}
.password input {
border-bottom: 1px solid #ccc;
.mcaptcha {
display: flex;
flex-direction: column;
background-color: #fff;
width: 270px;
height: 200px;
border-radius: 10px;
}
.confirm {
height: 20%;
margin-top: 20%;
.canvas {
margin: auto;
width: 200rpx;
height: 100rpx;
}
.confirm-btn {
background-color: #F1992D;
color: #FFFFFF;
width: 70%;
height: 85rpx;
line-height: 85rpx;
margin-top: 100rpx;
margin-left: auto;
margin-right: auto;
border-radius: 20rpx;
.btn-big {
background-color: #f1992d;
color: #fff;
border: 0;
border-radius: 20px;
}
.text{
margin-top: 12px;
font-size: 10px;
color: #f1992d;
}
</style>
\ No newline at end of file
......@@ -5,11 +5,8 @@
<view class="title">跑步记录</view>
<span class="empty"></span>
</view>
<!-- v-for="(item,index) in allPost" :key="index" -->
<view class="record" v-for="(item,index) in runningrecordList" :key="index" @click="goToDetail(item.runningId)">
<view class="icon">
</view>
<view class="icon"></view>
<view class="content">
<view class="content1">
<view class="distance">
......@@ -40,14 +37,11 @@
data() {
return {
runningrecordList: [],
type:'跑步',
type: '跑步',
}
},
methods: {
goBack() {
// uni.navigateBack({
// delta: 1, //返回层数,2则上上页
// })
uni.reLaunch({
url: '/pages/my/main',
animationType: 'pop-in',
......@@ -55,20 +49,13 @@
})
},
goToDetail(runningId) {
// console.log('a');
// uni.navigateTo({
// url: '/pages/my/finish'
// })
//uni.setStorageSync('data-to-finish', item)
uni.reLaunch({
url: '/pages/my/finish?id=' + runningId +'&type=' + this.type,
url: '/pages/my/finish?id=' + runningId + '&type=' + this.type,
animationType: 'pop-in',
animationDuration: 300
})
},
getData() {
uniCloud.callFunction({
name: 'fe-my-runningList',
data: {
......@@ -76,10 +63,7 @@
}
})
.then(res => {
//console.log(res);
this.runningrecordList = res.result.data.runningList;
this.runningrecordList.forEach((item, index) => {
item.duration = this.formatSeconds(item.duration);
item.startDatetime = this.formatDate(item.startDatetime);
......@@ -105,7 +89,6 @@
minuteTime = parseInt(minuteTime % 60);
}
}
//var result = "" + parseInt(secondTime) + "";
if (secondTime >= 10) {
result = "" + parseInt(secondTime) + "";
} else {
......@@ -121,19 +104,14 @@
} else {
result = "0" + parseInt(hourTime) + ":" + result;
}
return result;
},
formatDate(value){
const str = value + ''; //转成字符串
formatDate(value) {
const str = value + ''; //转成字符串
let arr = str.split(' ');
return arr[0];
},
onLoad() {
//console.log(this.formatSeconds(10));
//plus.navigator.setStatusBarBackground('#EDEEF0');
this.getData();
}
}
......@@ -145,7 +123,6 @@
position: absolute;
width: 100%;
height: 100%;
/* background-color: #EDEEF0; */
}
.top {
......@@ -185,9 +162,6 @@
border-bottom: 2rpx solid #EDEEF0;
width: 100%;
height: 200rpx;
/* display: flex;
flex-direction: row; */
}
.icon {
......@@ -196,9 +170,9 @@
height: 150rpx;
margin-top: 20rpx;
margin-left: 30rpx;
background-size:100% 100%;
background-image:url("/static/my/my-record/run.png/");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/my-record/run.png/");
background-repeat: no-repeat;
float: left;
}
......
......@@ -2,7 +2,6 @@
<view class="main">
<view class="top">
<image @click="goBack" class="back" src="/static/discover/back.png"></image>
</view>
<view class="profile">
<view class="profile-title">
......@@ -36,11 +35,11 @@
export default {
data() {
return {
profileContent:' Must Go,本产品基于 Vue Uniapp开发,提供 Android 和iOS 端 APP,针对于“后疫情”时代的身体素质普遍下降的问题,恢复大学生们原有的朝气。该产品定位于帮助众多大学生,乃至更多青年人走出怠惰于运动的舒适圈,增强身体素质、培养积极向上的心理状态。通过该产品可以轻松且高效地搜集到周边、尤其是自身高校的赛事活动信息,及时报名参与,并突破现在运动类APP的圈子局限,不必局限于与远在天边的“朋友”分享运动成果,而可以召集小队发帖社交与近在咫尺的“队友”外出活动。',
aboutContent:'有问题或反馈请致电我们\n联系电话:18960545221'
profileContent: ' Must Go,本产品基于 Vue Uniapp开发,提供 Android 和iOS 端 APP,针对于“后疫情”时代的身体素质普遍下降的问题,恢复大学生们原有的朝气。该产品定位于帮助众多大学生,乃至更多青年人走出怠惰于运动的舒适圈,增强身体素质、培养积极向上的心理状态。通过该产品可以轻松且高效地搜集到周边、尤其是自身高校的赛事活动信息,及时报名参与,并突破现在运动类APP的圈子局限,不必局限于与远在天边的“朋友”分享运动成果,而可以召集小队发帖社交与近在咫尺的“队友”外出活动。',
aboutContent: '有问题或反馈请致电我们\n联系电话:18960545221'
}
},
methods:{
methods: {
dialogConfirm() {
uni.reLaunch({
url: '/pages/login/login',
......@@ -49,39 +48,18 @@
})
this.$refs.alertDialog.close();
},
dialogClose() {
//console.log('点击关闭')
this.$refsalertDialog.close();
},
confirmExit(){
confirmExit() {
this.$refs.alertDialog.open();
// uni.showModal({
// title: '温馨提示', //提示标题
// content: '确认退出你的账号吗', //提示内容
// showCancel: true, //是否显示取消按钮
// success: function (res) {
// if (res.confirm) { //confirm为ture,代表用户点击确定
// // uni.navigateTo({
// // url: '/pages/login/login'
// // })
// uni.reLaunch({
// url: '/pages/login/login',
// animationType: 'pop-in',
// animationDuration: 300
// })
// } else if (res.cancel) { //cancel为ture,代表用户点击取消
// }
// }
// })
},
goBack(){
goBack() {
uni.navigateBack({
delta:1,//返回层数,2则上上页
})
delta: 1, //返回层数,2则上上页
})
},
onload(){
onload() {
plus.navigator.setStatusBarBackground('#EDEEF0');
}
}
......@@ -95,12 +73,14 @@
height: 100%;
background-color: #EDEEF0;
}
.top {
width: 100%;
height: 50px;
background-color: #EDEEF0;
}
.back {
width: 40px;
height: 30px;
......@@ -109,9 +89,9 @@
float: left;
margin-left: 10px;
}
.profile{
/* border: 2rpx solid #000; */
width:80%;
.profile {
width: 80%;
height: 55%;
margin-top: 10rpx;
margin-left: auto;
......@@ -119,47 +99,53 @@
background-color: #FFFFFF;
border-radius: 20rpx;
}
.profile-title{
.profile-title {
height: 12%;
color: #F1992D;
}
.profile-icon{
.profile-icon {
width: 60rpx;
height: 60rpx;
margin-top: 10rpx;
margin-left: 20rpx;
background-size:100% 100%;
background-image:url("/static/my/my-setting/profile-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/my-setting/profile-icon.png");
background-repeat: no-repeat;
float: left;
}
.profile-name{
.profile-name {
width: 200rpx;
height: 50rpx;
margin-top: 10rpx;
margin-right: 280rpx;
font-size: 40rpx;
text-align: left;
float: right;
}
.profile-content{
.profile-content {
height: 88%;
}
.profile-content textarea{
.profile-content textarea {
width: 80%;
height: 100%;
margin-left: auto;
margin-right: auto;
}
.about{
width:80%;
.about {
width: 80%;
height: 15%;
margin-top: 5%;
margin-left: auto;
......@@ -167,52 +153,56 @@
background-color: #FFFFFF;
border-radius: 20rpx;
}
.about-title{
.about-title {
height: 40%;
color: #F1992D;
}
.about-icon{
.about-icon {
width: 60rpx;
height: 60rpx;
margin-top: 10rpx;
margin-left: 20rpx;
background-size:100% 100%;
background-image:url("/static/my/my-setting/about-icon.png");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/my-setting/about-icon.png");
background-repeat: no-repeat;
float: left;
}
.about-name{
.about-name {
width: 200rpx;
height: 50rpx;
margin-top: 10rpx;
margin-right: 280rpx;
font-size: 40rpx;
text-align: left;
float: right;
}
.about-content{
.about-content {
height: 60%;
}
.about-content textarea{
.about-content textarea {
width: 80%;
height: 100%;
margin-left: auto;
margin-right: auto;
}
.exit{
}
.exit-btn{
background-color:#F1992D ;
.exit {}
.exit-btn {
background-color: #F1992D;
color: #FFFFFF;
width:70%;
width: 70%;
height: 85rpx;
line-height: 85rpx;
margin-top: 50rpx;
......
......@@ -5,11 +5,8 @@
<view class="title">健走记录</view>
<span class="empty"></span>
</view>
<view class="record" v-for="(item,index) in walkingrecordList" :key="index" @click="goToDetail(item.walkingId)">
<view class="icon">
</view>
<view class="icon"></view>
<view class="content">
<view class="content1">
<view class="distance">
......@@ -40,7 +37,7 @@
data() {
return {
walkingrecordList: [],
type:'健走',
type: '健走',
}
},
methods: {
......@@ -52,15 +49,14 @@
})
},
goToDetail(walkingId) {
uni.reLaunch({
url: '/pages/my/finish?id=' + walkingId +'&type=' + this.type,
url: '/pages/my/finish?id=' + walkingId + '&type=' + this.type,
animationType: 'pop-in',
animationDuration: 300
})
},
getData() {
// console.log('a');
uniCloud.callFunction({
name: 'fe-my-walkingList',
data: {
......@@ -68,8 +64,6 @@
}
})
.then(res => {
//console.log(res);
this.walkingrecordList = res.result.data.walkingList;
this.walkingrecordList.forEach((item, index) => {
item.duration = this.formatSeconds(item.duration);
......@@ -77,8 +71,8 @@
});
});
},
formatDate(value){
const str = value + ''; //转成字符串
formatDate(value) {
const str = value + ''; //转成字符串
let arr = str.split(' ');
return arr[0];
},
......@@ -100,7 +94,6 @@
minuteTime = parseInt(minuteTime % 60);
}
}
//var result = "" + parseInt(secondTime) + "";
if (secondTime >= 10) {
result = "" + parseInt(secondTime) + "";
} else {
......@@ -116,12 +109,9 @@
} else {
result = "0" + parseInt(hourTime) + ":" + result;
}
return result;
},
onLoad() {
//plus.navigator.setStatusBarBackground('#EDEEF0');
this.getData();
}
}
......@@ -133,7 +123,6 @@
position: absolute;
width: 100%;
height: 100%;
/* background-color: #EDEEF0; */
}
.top {
......@@ -173,9 +162,6 @@
border-bottom: 2rpx solid #EDEEF0;
width: 100%;
height: 200rpx;
/* display: flex;
flex-direction: row; */
}
.icon {
......@@ -184,9 +170,9 @@
height: 150rpx;
margin-top: 20rpx;
margin-left: 30rpx;
background-size:100% 100%;
background-image:url("/static/my/my-record/walk.png/");
background-repeat:no-repeat;
background-size: 100% 100%;
background-image: url("/static/my/my-record/walk.png/");
background-repeat: no-repeat;
float: left;
}
......
......@@ -31,7 +31,6 @@
<text class="dot">●</text>
<text class="text">运动感受</text>
</view>
<view class="pic" v-if="!feeling">
<image class="good" :src="good" @click="choice(1)"></image>
<image class="normal" :src="normal" @click="choice(2)"></image>
......@@ -59,25 +58,22 @@
this.duration = res.duration
this.pace = res.pace
this.feeling = res.feeling
this.id=res.id;
this.id = res.id;
if (this.feeling == 'good') {
this.good = '/static/sport/good1.png'
} else if (this.feeling == 'normal') {
this.normal = '/static/sport/normal1.png'
} else if (this.feeling == 'bad') {
this.bad = '/static/sport/bad1.png'
}
})
},
onUnload() {
uni.$off('information')
},
data() {
return {
id:'',
id: '',
username: '不知道叫啥',
icon: '/static/sport/icon.jpg',
type: '',
......
......@@ -6,18 +6,15 @@
<view class="title">发布帖子</view>
<image class="add" :src="'../../static/post/send.png'" @click="addPost"></image>
</view>
<!-- 输入文字内容 -->
<view class="text-content">
<u--textarea v-model="value1" placeholder="发布运动相关的图文,分享你的运动生活" height="200px"></u--textarea>
</view>
<!-- 上传图片区域 -->
<view class="pic-content">
<uni-file-picker v-model="imageValue" file-mediatype="image" mode="grid" file-extname="png,jpg" :limit="9"
@select="select" @progress="progress" @success="success" @fail="fail" />
</view>
</view>
</template>
......@@ -32,24 +29,16 @@
img: []
}
},
methods: {
// 获取上传状态
select(e) {
},
// 获取上传进度
progress(e) {
},
// 上传成功
success(e) {
},
// 上传失败
fail(e) {
console.log('上传失败:', e)
......@@ -67,7 +56,6 @@
setTimeout(() => {
this.btnDisabled = false
}, 1000)
var length = this.imageValue.length;
for (var i = 0; i < length; i++) {
this.img.push(this.imageValue[i].path);
......@@ -100,10 +88,8 @@
}
})
}
// console.log(res.result);
});
}
}
}
}
......
<template>
<view>
<!-- 页头 -->
<view class="top">
<image @click="back" class="back" src="/static/discover/back.png"></image>
<view class="title">消息列表</view>
<span class="empty"></span>
</view>
<view class="one-post" >
<view class="icon-with-name">
<image :src="'https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/f692aaa2-45bc-42c3-af38-e0dff12d2eac.jpg'"
class="icon" />
<text class="name">用户姓名</text></br>
<text class="message">太6啦</text>
</view>
<image :src="'https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/f692aaa2-45bc-42c3-af38-e0dff12d2eac.jpg'"
class="post-img" />
<text class="text-content">2023年2月15日 5月20日 12:54</text>
</view>
</view>
</template>
<script>
</script>
<style>
.top {
width: 100%;
height: 50px;
background-color: #EDEEF0;
text-align: center;
}
.back {
width: 40px;
height: 30px;
margin-top: 10px;
margin-bottom: 10px;
float: left;
margin-left: 10px;
}
.empty {
width: 40px;
height: 30px;
margin-top: 10px;
margin-bottom: 10px;
float: right;
margin-right: 10px;
}
.title {
font-size: 20px;
margin-top: 15px;
font-weight: bold;
color: #f1992d;
display: inline-block;
}
.one-post {
width: 90%;
background-color: rgb(245 154 35 / 30%);
margin-left: auto;
margin-right: auto;
margin-top: 20px;
border-radius: 15px;
overflow: auto;
}
.icon-with-name {
width: 70%;
margin-left: 10px;
margin-top: 15px;
float: left;
overflow: auto;
}
.icon {
width: 40px;
height: 40px;
border-radius: 50%;
float: left;
}
.post-img{
width: 60px;
height: 60px;
border-radius: 15%;
float: right;
margin-top: 10px;
margin-right: 10px;
}
.name {
float: left;
margin-bottom: auto;
margin-left: 10px;
margin-top: 5px;
font-size: 12px;
font-weight: bold;
width: 60%;
color:#02A7F0;
}
.message {
float: left;
font-size: 12px;
margin-left: 10px;
width: 70%;
word-wrap: break-word;
}
.text-content {
float: left;
margin-top: 5px;
margin-left: 5%;
overflow: auto;
font-size: 12px;
transform: scale(0.7);
}
</style>
\ No newline at end of file
......@@ -17,46 +17,40 @@
<text class="text-content">{{postDetail.content}}</text>
<view class="img-conetent">
<!-- 多张图片 -->
<view class="one-img" v-for="img in postDetail.pictureList">
<image :src="img" class="post-pic" @click="showPic(img)"></image>
<view class="one-img" v-for="(img,imgIndex) in item.pictureList">
<view class="post-pic" @click.stop="showPic(imgIndex,item.pictureList)"
:style="'background: url('+img+') no-repeat center/cover #eeeeee;'"></view>
</view>
</view>
</view>
<!-- 点赞和评论 -->
<view class="like-and-comment">
<!-- 删除键,只有我的帖子可见该组件 -->
<text class="del" @click="delPost" v-if="userId==postDetail.ownerId">删除</text>
<view class="icon-and-num">
<image class="like-icon"
:src="postDetail.islike==1?'../../static/post/like2.png':'../../static/post/like.png'" :disabled="btnDisabled"
style="width: 20px;height:20px;float: left;" @click="changeLike" />
:src="postDetail.islike==1?'../../static/post/like2.png':'../../static/post/like.png'"
:disabled="btnDisabled" style="width: 20px;height:20px;float: left;" @click="changeLike" />
<text style="font-size: 15px;float: left;">{{postDetail.likes}}</text>
<image class="comment-icon" :src="'../../static/post/comment.png'"
style="width: 20px;height: 20px;margin-left: 10px;float: left;" @click="addComment()" />
<text style="font-size: 15px;float: left;">{{postDetail.comments}}</text>
</view>
</view>
</view>
<!-- 分隔线 -->
<view class="parting-line"></view>
<!-- 评论区 -->
<view class="comment-content">
<!-- 评论数 -->
<text class="comment-size">评论 {{postDetail.comments}}</text>
<!-- 点击进入评论 -->
<view class="comment">
<image
:src="icon"
class="icon-small" />
<image :src="icon" class="icon-small" />
<span @click="addComment" class="comment-buttun"><text
style="margin-left:8px;margin-top: 5px;float: left">写评论</text></span>
</view>
<!-- 评论内容 -->
<view v-for="(item,index) in postDetail.commentList">
<view class="one-comment">
......@@ -68,7 +62,7 @@
<text class="add-time">{{item.commentDatetime}}</text>
<view class="icon-and-num">
<image class="like-icon" :disabled="btnDisabled"
:src="item.islike==1?'../../static/post/like2.png':'../../static/post/like.png'"
:src="item.islike==1?'../../static/post/like2.png':'../../static/post/like.png'"
style="width: 16px;height:16px;" @click="changeCommentLike(index)" />
<text style="font-size: 12px;">{{item.commentLikes}}</text>
</view>
......@@ -77,27 +71,21 @@
</view>
</view>
</view>
<!-- 弹出的评论框 -->
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog mode="input" message="评论成功" title="评论" placeholder="请输入内容" :duration="2000"
:before-close="true" @close="close" @confirm="confirm"></uni-popup-dialog>
</uni-popup>
<!-- 是否删除 -->
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="取消" confirmText="确定" title="警告" content="确定删除该帖子吗?"
@confirm="dialogConfirm"></uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
btnDisabled: false,
......@@ -122,20 +110,17 @@
},
],
postDetail: [],
userId:'',
icon:'',
userId: '',
icon: '',
};
},
methods: {
onLoad(e) {
//this.from=e.from;
this.postId = e.postId;
this.userId=getApp().globalData.userId;
this.icon=getApp().globalData.icon;
this.userId = getApp().globalData.userId;
this.icon = getApp().globalData.icon;
this.getData();
},
getData() {
......@@ -184,36 +169,31 @@
console.log('点击关闭')
this.$refsalertDialog.close();
},
//发布评论
confirm(value) {
// 输入框的值
console.log(value)
if(value==''){
if (value == '') {
uni.showToast({
title: '空内容不能发布呦',
duration: 1000,
icon: 'error'
})
}
else{
} else {
uniCloud.callFunction({
name: 'fe-college-commentPost',
data: { //向云函数中传入的数据
userId: getApp().globalData.userId,
postId: this.postId,
content: value
},
})
.then(res => {
// this.postDetail = res.result.data;
this.getData();
console.log(res.result.data);
});
name: 'fe-college-commentPost',
data: { //向云函数中传入的数据
userId: getApp().globalData.userId,
postId: this.postId,
content: value
},
})
.then(res => {
this.getData();
console.log(res.result.data);
});
this.$refs.popup.close();
}
},
//评论窗口
addComment() {
......@@ -229,13 +209,11 @@
})
},
// 图片放大
showPic(imgUrl) {
let arr = [];
arr.push(imgUrl)
console.log(arr, '图片的地址')
showPic(index,list) {
uni.previewImage({
current: 0,
urls: arr
current: index,
urls: list
});
},
//点赞状态改变
......@@ -246,7 +224,6 @@
this.isLike = 1;
}
},
//点赞状态改变
changeLike() {
if (this.btnDisabled) {
......@@ -258,7 +235,6 @@
}, 1000)
//已经点赞
if (this.postDetail.islike == 1) {
// console.log(this.allPost[index].postId);
//取消点赞
uniCloud.callFunction({
name: 'fe-college-likePost',
......@@ -268,15 +244,11 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.postDetail.islike = 0;
this.postDetail.likes = res.result.data.newlikes;
}
// console.log(res.result);
});
} else {
//点赞
uniCloud.callFunction({
......@@ -287,18 +259,13 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.postDetail.islike = 1;
this.postDetail.likes = res.result.data.newlikes;
}
// console.log(res.result);
});
}
},
//改变评论的点赞状态
changeCommentLike(index) {
if (this.btnDisabled) {
......@@ -310,7 +277,6 @@
}, 1000)
//已经点赞
if (this.postDetail.commentList[index].islike == 1) {
// console.log(this.allPost[index].postId);
//取消点赞
uniCloud.callFunction({
name: 'fe-college-likeComment',
......@@ -320,16 +286,13 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.postDetail.commentList[index].islike = 0;
console.log(res.result);
this.postDetail.commentList[index].commentLikes = res.result.data.newlikes;
}
console.log(res.result);
});
} else {
//点赞
uniCloud.callFunction({
......@@ -340,18 +303,13 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.postDetail.commentList[index].islike = 1;
this.postDetail.commentList[index].commentLikes = res.result.data.newlikes;
}
// console.log(res.result);
});
}
}
}
}
</script>
......@@ -380,7 +338,6 @@
height: 25px;
border-radius: 15px;
font-size: 12px;
}
.top {
......@@ -451,12 +408,10 @@
margin-left: 10px;
}
.name {
float: left;
margin-bottom: auto;
margin-left: 10px;
margin-left: 15px;
margin-top: 5px;
font-size: 12px;
font-weight: bold;
......
<template>
<view>
<!-- 添加帖子按钮 -->
<add-post-tag></add-post-tag>
<!-- 标签栏 -->
<u-tabs :list="list" lineWidth="30" lineColor="#F1992D" :activeStyle="{
color: '#F1992D',
......@@ -14,7 +12,6 @@
transform: 'scale(1)'
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" @click="tabChange" :current="current">
</u-tabs>
<!-- 所有帖子 -->
<view v-if="current == 1">
<view v-for="(item,index) in allPost" :key="index">
......@@ -29,38 +26,41 @@
<text class="text-content">{{item.content}}</text>
<view class="img-conetent">
<!-- 多张图片 -->
<view v-if="item.pictureList.length!=1" class="one-img" v-for="img in item.pictureList">
<image :src="img" class="post-pic" @click.stop="showPic(img)"></image>
<view v-if="item.pictureList.length!=1" class="one-img"
v-for="(img,imgIndex) in item.pictureList">
<view class="post-pic" @click.stop="showPic(imgIndex,item.pictureList)"
:style="'background: url('+img+') no-repeat center/cover #eeeeee;'"></view>
</view>
<!-- 单张图片 -->
<view v-if="item.pictureList.length == 1">
<image :src="item.pictureList[0]" class="single-pic"
@click.stop="showPic(item.pictureList[0])"></image>
<view v-if="item.pictureList.length == 1" class="single-pic"
@click.stop="showPic(0,item.pictureList)"
:style="'background: url('+item.pictureList[0]+') no-repeat center/cover #eeeeee;'">
</view>
</view>
</view>
<!-- 点赞和评论 -->
<view class="like-and-comment">
<view class="icon-and-num">
<image class="like-icon"
:src="item.islike=='1'?'../../static/post/like2.png':'../../static/post/like.png'"
style="width: 20px;height:20px;float: left;" @click.stop="changeAllPostLike(index)" :disabled="btnDisabled" />
style="width: 20px;height:20px;float: left;" @click.stop="changeAllPostLike(index)"
:disabled="btnDisabled" />
<text style="font-size: 15px;float: left;">{{item.likes}}</text>
<image class="comment-icon" :src="'../../static/post/comment.png'"
style="width: 20px;height: 20px;margin-left: 10px;float: left;" />
<text style="font-size: 15px;float: left; ">{{item.comments}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 我的帖子 -->
<view v-if="current == 0">
<view class="message">
您一共收到{{messageNum}}条消息~
</view>
<!-- 单个帖子 -->
<view v-for="(item,index) in myPost" :key="index">
<!-- 单个帖子 -->
......@@ -74,23 +74,25 @@
<text class="text-content">{{item.content}}</text>
<view class="img-conetent">
<!-- 多张图片 -->
<view v-if="item.pictureList.length!=1" class="one-img" v-for="img in item.pictureList">
<image :src="img" class="post-pic" @click.stop="showPic(img)"></image>
<view v-if="item.pictureList.length!=1" class="one-img"
v-for="(img,imgIndex) in item.pictureList">
<view class="post-pic" @click.stop="showPic(imgIndex,item.pictureList)"
:style="'background: url('+img+') no-repeat center/cover #eeeeee;'"></view>
</view>
<!-- 单张图片 -->
<view v-if="item.pictureList.length == 1">
<image :src="item.pictureList[0]" class="single-pic"
@click.stop="showPic(item.pictureList[0])"></image>
<view v-if="item.pictureList.length == 1" class="single-pic"
@click.stop="showPic(0,item.pictureList)"
:style="'background: url('+item.pictureList[0]+') no-repeat center/cover #eeeeee;'">
</view>
</view>
</view>
<!-- 点赞和评论 -->
<view class="like-and-comment">
<view class="icon-and-num">
<image class="like-icon"
:src="item.islike=='1'?'../../static/post/like2.png':'../../static/post/like.png'"
style="width: 20px;height:20px;float: left;" @click.stop="changeMyPostLike(index)" :disabled="btnDisabled" />
style="width: 20px;height:20px;float: left;" @click.stop="changeMyPostLike(index)"
:disabled="btnDisabled" />
<text style="font-size: 15px;float: left;">{{item.likes}}</text>
<image class="comment-icon" :src="'../../static/post/comment.png'"
style="width: 20px;height: 20px;margin-left: 10px;float: left;" />
......@@ -101,26 +103,21 @@
</view>
</view>
</view>
</view>
</template>
<script>
export default {
//下拉刷新
onPullDownRefresh() {
this.getAllPost();
this.getMyPost();
uni.stopPullDownRefresh();
},
onLoad() {
this.getAllPost();
this.getMyPost();
},
onShow() {
this.getAllPost();
this.getMyPost();
......@@ -145,15 +142,12 @@
like: 200,
isLike: 1,
comment: 120,
messageNum:6,
pictureList: [{
picture: "https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/becea65c-89d7-4fe0-9c3f-2e08cdf911e8.jpg"
},
],
picture: "https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/becea65c-89d7-4fe0-9c3f-2e08cdf911e8.jpg"
}, ],
};
},
methods: {
toDetial(postId) {
uni.navigateTo({
......@@ -162,21 +156,13 @@
},
tabChange(index) {
this.current = index.index;
//console.log(this.current)
// this.followUserPost = [];
// this.lastPost = [];
if (index.index == 0) {
this.getMyPost();
}
if (index.index == 1) {
this.getAllPost();
}
},
//获得所有的帖子信息
getAllPost() {
//获得所有帖子
......@@ -191,10 +177,8 @@
//console.log(res.result.data);
});
},
//获得我的帖子
getMyPost() {
uniCloud.callFunction({
name: 'fe-college-myPostList',
data: { //向云函数中传入的数据
......@@ -206,15 +190,12 @@
console.log(res.result.data);
});
},
// 图片放大
showPic(imgUrl) {
let arr = [];
arr.push(imgUrl)
console.log(arr, '图片的地址')
showPic(index, list) {
uni.previewImage({
current: 0,
urls: arr
current: index,
urls: list
});
},
......@@ -229,7 +210,6 @@
}, 1000)
//已经点赞
if (this.allPost[index].islike == 1) {
// console.log(this.allPost[index].postId);
//取消点赞
uniCloud.callFunction({
name: 'fe-college-likePost',
......@@ -239,14 +219,11 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.allPost[index].islike = 0;
this.allPost[index].likes = res.result.data.newlikes;
}
// console.log(res.result);
});
} else {
//点赞
uniCloud.callFunction({
......@@ -257,19 +234,14 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.allPost[index].islike = 1;
this.allPost[index].likes = res.result.data.newlikes;
}
// console.log(res.result);
});
}
},
//点赞状态改变
//点赞状态改变(我的帖子部分)
changeMyPostLike(index) {
if (this.btnDisabled) {
return
......@@ -280,7 +252,6 @@
}, 1000)
//已经点赞
if (this.myPost[index].islike == 1) {
// console.log(this.allPost[index].postId);
//取消点赞
uniCloud.callFunction({
name: 'fe-college-likePost',
......@@ -290,14 +261,11 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.myPost[index].islike = 0;
this.myPost[index].likes = res.result.data.newlikes;
}
// console.log(res.result);
});
} else {
//点赞
uniCloud.callFunction({
......@@ -308,21 +276,33 @@
},
})
.then(res => {
// this.allPost=res.result.data.postList;
if (res.result.code == 200) {
this.myPost[index].islike = 1;
this.myPost[index].likes = res.result.data.newlikes;
}
// console.log(res.result);
});
}
}
}
}
</script>
<style>
.message {
/* border: 2px solid #000; */
width: 60%;
height: 40px;
border-radius: 15px;
margin-top: 15px;
margin-left: auto;
margin-right: auto;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
background-color: rgb(245 154 35 / 30%);
}
.one-post {
width: 90%;
background-color: rgb(245 154 35 / 30%);
......@@ -340,7 +320,6 @@
margin-top: 15px;
float: left;
overflow: auto;
}
.icon {
......@@ -397,6 +376,7 @@
width: 100%;
border-radius: 5px;
height: 250px;
background-size: 100% 100%;
}
.post-pic {
......
......@@ -13,7 +13,6 @@
//传从运动界面传数据过来
var data = uni.getStorageSync('data-to-finish')
var res = JSON.parse(data)
this.id = res.id;
this.polyline = res.polyline;
this.markers[0].latitude = this.polyline[0].points[0].latitude;
this.markers[0].longitude = this.polyline[0].points[0].longitude;
......@@ -26,25 +25,25 @@
startTime: res.startTime,
distance: res.distance,
duration: res.duration,
pace: res.duration / res.distance
pace: res.duration / res.distance,
id: res.id
});
const subNVue = uni.getSubNVueById('popup'); // 通过 id 获取 nvue 子窗体
subNVue.show('slide-in-top', 250); // 打开 nvue 子窗体
},
data() {
return {
id: '',
icon: '/static/sport/icon.jpg',
longitude: 121.44820869,
latitude: 37.48330837,
scale: 16,
polyline: [{
points: [],
color: "#00aa00", //线的颜色
arrowLine: true,
width: 20,
dottedLine: true
}],
points: [],
color: "#00aa00", //线的颜色
arrowLine: true,
width: 20,
dottedLine: true
}],
markers: [{
id: 0,
longitude: 121.44577861,
......
......@@ -28,7 +28,7 @@
export default {
data() {
return {
userId: '644a643a0c801ca878983559',
userId: '',
rank: 1,
distance: 99.99,
type: '',
......
......@@ -15,7 +15,6 @@
<image v-if="!is" class="finish" :src="finish" @click="click(3)"></image>
<image v-if="is" class="stop" :src="stop" @click="click(1)"></image>
</view>
</view>
</template>
......
......@@ -89,6 +89,9 @@
this.feeling = 'bad'
this.bad = '/static/sport/bad1.png'
}
console.log(this.id)
console.log(this.type)
console.log(this.feeling)
this.choose = true
uniCloud.callFunction({
name: 'fe-sport-feelings',
......@@ -99,14 +102,15 @@
}
})
.then(res => {
if (res.code === 200) {
console.log(res);
if (res.result.code === 200) {
uni.showToast({
title: '运动感受保存成功',
title: '保存成功',
icon: 'success'
})
} else {
uni.showToast({
title: '运动感受保存失败',
title: '保存失败',
icon: 'error'
})
}
......
......@@ -48,7 +48,7 @@
</template>
<script>
let applyCode=200;
let applyCode = 200;
export default {
data() {
return {
......@@ -72,40 +72,39 @@
animationDuration: 300
})
},
async apply(){
async apply() {
await uniCloud.callFunction({
name: 'fe-team-applyActivity',
data: {
userId:this.userId,
userId: this.userId,
activityId: this.activityId
}
})
.then(res => {
console.log(res),
this.applyCode = res.result.code,
console.log(res.result.message),
console.log(this.applyCode)
console.log(res)
this.applyCode = res.result.code
console.log(res.result.message)
console.log(this.applyCode)
})
await this.showTT();
await this.showTT();
},
showTT(){
if(this.applyCode==200){
showTT() {
if (this.applyCode == 200) {
uni.showToast({
title: '报名成功'
title: '报名成功'
});
}
else{
} else {
uni.showToast({
title: '您已报名,请勿重复报名',
icon: 'none'
title: '您已报名,请勿重复报名',
icon: 'none'
});
}
}
},
onLoad(option) {
this.userId=getApp().globalData.userId
this.activityId=option.activityId
this.userId = getApp().globalData.userId
this.activityId = option.activityId
console.log(option.activityId)
uniCloud.callFunction({
name: 'fe-team-activityDetail',
......@@ -114,25 +113,25 @@
}
})
.then(res => {
console.log(res),
this.name = res.result.data.username,
this.production = res.result.data.content,
this.startDate = res.result.data.startDate,
this.endDate = res.result.data.endDate,
this.object = res.result.data.participants,
this.place = res.result.data.place,
this.contact = res.result.data.contact,
this.icon = res.result.data.icon
console.log(res)
this.name = res.result.data.username
this.production = res.result.data.content
this.startDate = res.result.data.startDate
this.endDate = res.result.data.endDate
this.object = res.result.data.participants
this.place = res.result.data.place
this.contact = res.result.data.contact
this.icon = res.result.data.icon
})
}
}
</script>
<style>
.content{
.content {
padding-bottom: 30px;
}
.returnBack {
height: 55rpx;
width: 55rpx;
......@@ -222,7 +221,7 @@
margin-top: 10px;
}
.activity-object-text{
.activity-object-text {
font-weight: bold;
}
......@@ -286,7 +285,8 @@
.loginButton::after {
border: 0;
}
.btn{
.btn {
margin-bottom: 30px;
}
</style>
\ No newline at end of file
......@@ -33,7 +33,6 @@
</view>
</view>
<view class="form-input2-wrapper">
<view class="form-input2">
<picker mode="date" start="1970-01-01" end="2100-12-31" @change="handleDateChange2">
<view class="picker">{{ end_date }}</view>
......@@ -117,10 +116,19 @@
})
.then(res => {
console.log(res)
uni.showToast({
title: '提交成功',
icon: 'success'
});
if (res.result.code == 200) {
uni.showToast({
title: '提交成功',
icon: 'success'
});
this.goBack()
} else {
uni.showToast({
title: '提交失败',
icon: 'error'
});
}
})
},
handleDateChange1(event) {
......@@ -211,6 +219,7 @@
}
.form-input {
border-radius: 5px;
margin-left: 5px;
width: 70%;
height: 35px;
......@@ -223,6 +232,7 @@
}
.form-input1 {
border-radius: 5px;
margin-left: 5px;
width: 70%;
height: 70px;
......@@ -246,6 +256,7 @@
}
.form-input2 {
border-radius: 5px;
margin-top: 5px;
margin-left: 10px;
width: 30%;
......
......@@ -34,7 +34,7 @@
</view>
</template>
<script>
let code=200;
let code = 200;
export default {
data() {
return {
......@@ -45,7 +45,7 @@
}
},
onLoad() {
this.userId=getApp().globalData.userId
this.userId = getApp().globalData.userId
},
methods: {
goBack() {
......@@ -68,15 +68,16 @@
});
},
async create() {
if(this.name==''||this.content==''){
if (this.name == '' || this.content == '') {
uni.showToast({
title: '信息填写不完整',
icon: 'none'
});
return;
}
if(this.avatar==''){
this.avatar='https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/7d3feb79-8efe-4686-b745-3b7dc5d5df36.png'
if (this.avatar == '') {
this.avatar =
'https://mp-6f6feaec-a026-4402-8e8d-18f7572890da.cdn.bspapp.com/cloudstorage/7d3feb79-8efe-4686-b745-3b7dc5d5df36.png'
}
await uniCloud.callFunction({
name: 'fe-team-createTeam',
......@@ -94,14 +95,14 @@
})
await this.showTorM();
},
showTorM(){
showTorM() {
if (this.code == 200) {
console.log(this.code, 'this.code1')
uni.showToast({
title: '创建成功',
duration: 2000
});
} else{
} else {
uni.showModal({
title: '提示',
content: '您已加入一个小队,若要加入或创建小队,请先退出已加入的小队再进行相应的操作。',
......@@ -115,6 +116,7 @@
}
});
}
this.goBack()
}
}
}
......@@ -125,7 +127,6 @@
position: absolute;
width: 100%;
height: 100%;
}
.returnBack {
......@@ -202,6 +203,7 @@
}
.form-input {
border-radius: 5px;
margin-left: 5px;
width: 70%;
height: 35px;
......@@ -214,6 +216,7 @@
}
.form-input1 {
border-radius: 5px;
margin-left: 5px;
width: 70%;
height: 170px;
......@@ -287,6 +290,7 @@
}
.avatar {
border-radius: 5px;
margin-left: 5px;
background-color: #edeef0;
width: 70%;
......
<template>
<view class="bg">
<!-- 标签栏 -->
<u-tabs :list="list" lineWidth="30" lineColor="#F1992D" :activeStyle="{
color: '#F1992D',
......@@ -9,9 +8,9 @@
}" :inactiveStyle="{
color: '#606266',
transform: 'scale(1)'
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" @click="tabChange" :current="current" class="tabbg">
}" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;" @click="tabChange" :current="current"
class="tabbg">
</u-tabs>
<!-- 我的小队 -->
<view v-if="current == 0" class="content">
<view v-if="join==null">
......@@ -38,8 +37,6 @@
</view>
</view>
</view>
</view>
<!-- 加入小队 -->
<view v-if="current == 1" class="content">
......@@ -58,7 +55,6 @@
</view>
</view>
</view>
<uni-popup ref="popupDialog1" type="dialog">
<uni-popup-dialog title="提示" content="是否确定退出小队?" :before-close="true" @confirm="dialogConfirm"
......@@ -72,7 +68,7 @@
</template>
<script>
let code=200;
let code = 200;
export default {
data() {
return {
......@@ -95,8 +91,7 @@
name: '加入小队',
}, ],
name: '',
activityList: [
]
activityList: []
};
},
methods: {
......@@ -109,7 +104,7 @@
this.showMyTeam();
}
},
showJoinTeam(){
showJoinTeam() {
uniCloud.callFunction({
name: 'fe-team-teamList',
data: {}
......@@ -119,7 +114,7 @@
this.teamList = res.result.data.teamList
})
},
showMyTeam(){
showMyTeam() {
uniCloud.callFunction({
name: 'fe-team-activityList',
data: {
......@@ -127,11 +122,11 @@
}
})
.then(res => {
console.log(res),
this.name = res.result.data.teamname,
this.activityList = res.result.data.activityList,
this.join = res.result.join,
this.icon = res.result.data.teamicon
console.log(res)
this.name = res.result.data.teamname
this.activityList = res.result.data.activityList
this.join = res.result.join
this.icon = res.result.data.teamicon
console.log(this.join)
})
},
......@@ -179,7 +174,6 @@
async toggleMessage(index, teamId) {
if (index == 1) {
await this.$refs['popupDialog1'].open()
} else if (index == 2) {
console.log('2222222');
this.tID = teamId
......@@ -197,10 +191,18 @@
}
})
.then(res => {
console.log(res)
this.join = false
// this.code=200
console.log(this.join)
if (res.result.code == 200) {
this.join = false
console.log(this.join)
uni.showToast({
title: '退出成功'
});
} else {
uni.showToast({
title: '退出失败',
icon: 'error'
});
}
})
this.$refs['popupDialog1'].close();
},
......@@ -216,8 +218,8 @@
}
})
.then(res => {
this.code = res.result.code,
console.log(this.userId)
this.code = res.result.code
console.log(this.userId)
})
this.$refs['popupDialog2'].close();
await this.showTorM();
......@@ -225,11 +227,10 @@
dialogClose1() {
this.$refs['popupDialog2'].close();
},
showTorM(){
showTorM() {
if (this.code == 200) {
uni.showToast({
title: '加入成功',
duration: 2000
title: '加入成功'
});
} else {
uni.showModal({
......@@ -254,11 +255,10 @@
uni.stopPullDownRefresh();
},
onLoad(option) {
this.userId=getApp().globalData.userId
if(option.index==1){
this.userId = getApp().globalData.userId
if (option.index == 1) {
this.showJoinTeam()
}
else{
} else {
this.showMyTeam()
}
},
......@@ -270,18 +270,11 @@
</script>
<style>
.bg {
/* background-color: #edeef0; */
/* position: absolute;
width: 100%;
height: 100%; */
}
.tabbg{
/* background-color: #edeef0; */
}
.bg {}
.tabbg {}
.content {
/* background-color: #edeef0; */
position: absolute;
width: 100%;
height: 100%;
......@@ -320,7 +313,6 @@
margin-bottom: 15px;
float: left;
overflow: auto;
}
.icon {
......@@ -328,6 +320,7 @@
height: 45px;
border-radius: 50%;
float: left;
margin-left: 8px;
}
.search-team {
......@@ -351,7 +344,7 @@
float: left;
margin-bottom: auto;
margin-left: 10px;
margin-top: 9px;
margin-top: 12px;
font-size: 18px;
font-weight: bold;
width: 60%;
......
......@@ -16,14 +16,8 @@
export default {
data() {
return {
userId: '644a643a0c801ca878983559',
memList: [{
memberIcon: '/static/icon/1.png',
memberName: "不会取名字",
},{
memberIcon: '/static/sport/icon.jpg',
memberName: "不会取名字",
}]
userId: '',
memList: []
}
},
methods: {
......@@ -36,7 +30,7 @@
}
},
onLoad() {
this.userId=getApp().globalData.userId
this.userId = getApp().globalData.userId
uniCloud.callFunction({
name: 'fe-team-memberList',
data: {
......@@ -44,7 +38,7 @@
}
})
.then(res => {
console.log(res),
console.log(res)
this.memList = res.result.data
})
}
......@@ -92,20 +86,22 @@
color: #f1992d;
display: inline-block;
}
.memList{
.memList {
margin-top: 20px;
}
.icon{
.icon {
position: relative;
top:2px;
top: 2px;
left: 38px;
width: 50px;
height: 50px;
border-radius: 50%;
}
.membername{
display: inline;
.membername {
display: inline;
position: relative;
font-size: 20px;
font-weight: bold;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册