Commit f5829ce9 authored by LiZongLin's avatar LiZongLin

bug修改

parent 228173ed
......@@ -26,7 +26,7 @@
let menuWidth = menuButtonInfo.width + 'px'
let menuHeight = menuButtonInfo.height + 'px'
let menuBorderRadius = menuButtonInfo.height / 2 + 'px'
let menuRight = result.screenWidth - menuButtonInfo.right + 'px'
let menuRight = result.screenWidth - menuButtonInfo.right + 'px'
let menuTop = menuButtonInfo.top + 'px'
let contentTop = result.statusBarHeight + 44 + 'px'
......@@ -38,7 +38,7 @@
menuRight: menuRight, //右侧的胶囊距离右侧屏幕距离--用来给自定义导航条页面的左侧胶囊设置使用
menuTop: menuTop, //右侧的胶囊顶部距离屏幕顶部的距离--用来给自定义导航条页面的左侧胶囊设置使用
contentTop: contentTop, //内容区距离页面最上方的高度--用来给自定义导航条页面的内容区定位距离使用
}
}
uni.setStorageSync('menuInfo', menuInfo)
},
fail: (error) => {
......
......@@ -42,21 +42,13 @@
},
methods: {
goToBack() {
console.log("hehe");
console.log("page",this.pages);
if(this.pages === 'activity'){
uni.reLaunch({
url:'/pages/index/index'
// delta: 1
if (uni.getSystemInfoSync('pages') === 'activityDetail') {
uni.navigateBack({
delta: 1
})
}else if(this.pages === 'activityDetail'){
uni.navigateTo({
url:'/pages_activity/activity/activity'
})
}else{
uni.reLaunch({
url:'/pages_activity/activity/activity'
// delta: 1
} else {
uni.navigateBack({
delta: 2
})
}
}
......
<template>
<!-- 上传视频或者图片 -->
<view class="up-page">
<!--图片-->
<view class="show-box" v-for="(item,index) in imageList" :key="index">
<view class="delect-icon" @tap="delect(index)">
<image class="full" :src="clearIcon" mode=""></image>
<!--图片或者视频上传成功了,点击右上角叉号-->
</view>
<image class="full" :src="item" :data-src="image" @tap="previewImage(item)">
</image>
</view>
<!--视频-->
<view class="show-box" v-for="(item1, index1) in videoList" :key="index1">
<video class="full" :src="item1"></video>
<view class="delect-icon" @tap="delectVideo(index1)">
<image class="full" :src="clearIcon" mode=""></image>
</view>
</view>
<view v-if="VideoOfImagesShow" @tap="chooseVideoImage" class="box-mode">
<image class="full" :src="selectfile" mode=""></image>
<!-- 上传图标 懒得写,整个的图 -->
</view>
</view>
</template>
<script>
var sourceType = [
['camera'],
['album'],
['camera', 'album']
];
export default {
name: "uploadFile",
data() {
return {
// 图标
clearIcon: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCAwaDE2YTQgNCAwIDAgMSA0IDR2MTZINGE0IDQgMCAwIDEtNC00VjB6IiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXIpIiBmaWxsLW9wYWNpdHk9Ii45OCIgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfYikiLz48cGF0aCBkPSJNMTAuOTQgOS45OTlsMi44NjMtMi44NTdhLjY2OS42NjkgMCAxIDAtLjk0Ni0uOTQ2TDEwIDkuMDYgNy4xNDMgNi4xOTZhLjY2OS42NjkgMCAwIDAtLjk0Ni45NDZsMi44NjQgMi44NTctMi44NjQgMi44NTdhLjY2Ni42NjYgMCAwIDAgLjIxNyAxLjA5Mi42NjQuNjY0IDAgMCAwIC43MjktLjE0NkwxMCAxMC45MzhsMi44NTcgMi44NjRhLjY2Ny42NjcgMCAwIDAgMS4wOTItLjIxNy42NjYuNjY2IDAgMCAwLS4xNDYtLjcyOUwxMC45MzkgMTB6IiBmaWxsPSIjZmZmIi8+PGRlZnM+PGZpbHRlciBpZD0iZmlsdGVyMF9iIiB4PSItNCIgeT0iLTQiIHdpZHRoPSIyOCIgaGVpZ2h0PSIyOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZ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MiIHk9IjE2IiB3aWR0aD0iMzIiIGhlaWdodD0iMiIgcng9IjEiIHRyYW5zZm9ybT0icm90YXRlKDkwIDMzIDE2KSIgZmlsbD0iI0JGQkZCRiIvPjwvc3ZnPg==',
VideoOfImagesShow: true, // 页面图片或视频数量超出后,拍照按钮隐藏
imageList: [], //存放图片的地址
videoList: [], //视频存放的地址
sourceType: ['拍摄', '相册', '拍摄或相册'],
sourceTypeIndex: 2,
cameraList: [{
value: 'back',
name: '后置摄像头',
checked: 'true'
}, {
value: 'front',
name: '前置摄像头'
}],
cameraIndex: 0, //上传视频时的数量
maxCount: 3 //图片和视频允许上传的总数
}
},
onUnload() {
(this.imageList = []), (this.sourceTypeIndex = 2), (this.sourceType = ['拍摄', '相册', '拍摄或相册']);
},
methods: {
//点击上传图片或视频
chooseVideoImage() {
uni.showActionSheet({
title: '选择上传类型',
itemList: ['图片', '视频'],
success: res => {
console.log(res);
if (res.tapIndex == 0) {
this.chooseImages();
} else {
this.chooseVideo();
}
}
});
},
//上传图片
chooseImages() {
console.log("进入图片上传:", this.imageList)
uni.chooseImage({
count: this.maxCount, //允许选择的数量
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: res => {
this.imageList = this.imageList.concat(res.tempFilePaths);
console.log("上传的图片:", this.imageList)
if (this.imageList.length + this.videoList.length == this.maxCount) {
this.VideoOfImagesShow = false; //图片上传数量和count一样时,让点击拍照按钮消失
}
}
})
},
//上传视频
chooseVideo(index) {
uni.chooseVideo({
maxDuration: 60, //拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
count: this.maxCount,
camera: this.cameraList[this.cameraIndex].value, //'front'、'back',默认'back'
sourceType: sourceType[this.sourceTypeIndex],
success: res => {
this.videoList = this.videoList.concat(res.tempFilePath);
if (this.imageList.length + this.videoList.length == this.maxCount) {
this.VideoOfImagesShow = false;
}
console.log("上传的视频:", this.videoList);
}
})
},
//预览图片
previewImage: function(e) {
console.log(e)
uni.previewImage({
current: e,
urls: this.imageList
});
},
// 删除图片
delect(index) {
uni.showModal({
title: '提示',
content: '是否要删除该图片',
success: res => {
if (res.confirm) {
this.imageList.splice(index, 1);
}
if (this.imageList.length + this.videoList.length == this.maxCount) {
this.VideoOfImagesShow = false;
} else {
this.VideoOfImagesShow = true;
}
}
});
},
// 删除视频
delectVideo(index) {
uni.showModal({
title: '提示',
content: '是否要删除此视频',
success: res => {
if (res.confirm) {
this.videoList.splice(index, 1);
}
if (this.imageList.length + this.videoList.length == this.maxCount) {
this.VideoOfImagesShow = false;
} else {
this.VideoOfImagesShow = true;
}
}
});
},
}
}
</script>
<style lang="scss">
/* 统一上传后显示的盒子宽高比 */
.box-mode {
width: 176rpx;
height: 176rpx;
border-radius: 8rpx;
overflow: hidden;
}
.full {
width: 100%;
height: 100%;
}
.up-page {
display: flex;
flex-wrap: wrap;
display: flex;
width: 100%;
.show-box:nth-child(3n) {
margin-right: 0;
}
.show-box {
position: relative;
margin-bottom: 4vw;
margin-right: 4vw;
@extend .box-mode;
.delect-icon {
height: 40rpx;
width: 40rpx;
position: absolute;
right: 0rpx;
top: 0rpx;
z-index: 1000;
}
}
}
</style>
......@@ -51,8 +51,8 @@
"path": "tjty_ans_detail/tjty_ans_detail",
"style": {
"navigationBarTitleText": "赛事活动详情",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"enablePullDownRefresh": false
// "navigationStyle": "custom"
}
},
{
......@@ -79,8 +79,8 @@
"path": "activity/activity",
"style": {
"navigationBarTitleText": "赛事活动",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
"enablePullDownRefresh": false
// "navigationStyle": "custom"
}
},
{
......@@ -287,7 +287,8 @@
"path": "tjty_dailyAnswer/tjty_dailyAnswer",
"style": {
"navigationBarTitleText": "每日答题",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}]
......
<template>
<view>
<navTop></navTop>
<noData v-if="activityList.length === 0"></noData>
<view class="activityContainer" v-if="activityList.length !== 0">
<view class="activity_item" v-for="(item,index) in activityList" :key="index" @click="gotoDetail(item)">
......@@ -53,7 +52,8 @@
activityList: [],
total: 0,
type:'',
url:'/pages_activity/activity/activity'
url:'/pages_activity/activity/activity',
flag:true
};
},
computed: {
......@@ -63,18 +63,19 @@
onLoad() {
this.login()
this.getList()
console.log(pages);
},
created() {
uni.setStorageSync("title", '赛事活动')
// uni.setStorageSync("title", '赛事活动')
},
onShow() {
uni.setStorageSync('pages','activity')
uni.setStorageSync("title", '赛事活动')
// uni.setStorageSync('pages','activity')
// uni.setStorageSync("title", '赛事活动')
},
onHide() {
// uni.setStorageSync("title", '')
this.flag = true
},
// onHide() {
// uni.setStorageSync("title", '')
// },
methods: {
...mapMutations('m_user', ['updateToken']),
...mapMutations('m_user', ['updateUserInfo']),
......@@ -124,18 +125,21 @@
});
},
gotoDetail(activity) {
if (activity.type === '1') {
if(!this.flag) return
console.log("activity",activity);
console.log(activity.type);
if (activity.type == '1') {
uni.navigateTo({
url: '/pages_activity/activity_detail/activity_detail?activity_id=' + activity.activityId
})
} else {
}
if (activity.type == '2'){
uni.navigateTo({
url: `/pages_events/tjty_ans_detail/tjty_ans_detail?activityId=${activity.activityId}`
})
}
this.flag = false
}
},
//触底的事件
......@@ -165,7 +169,7 @@
<style lang="scss">
.activityContainer {
margin-top: 180rpx;
// margin-top: 180rpx;
.activity_item {
margin: 30rpx;
......
<template>
<view class="answer-page">
<navTop></navTop>
<view style="height: auto;position: relative;padding-bottom: 160rpx;">
<view class="answer-top">
<view class="answer-image">
......@@ -141,10 +142,19 @@
let flag = this.getDaysBetween(this.flagTime, today)
console.log("天数", flag);
if (flag === 1) {
uni.redirectTo({
url: '/pages_events/tjty_ans_detail/tjty_ans_detail?activityId=' + this.activityId
})
if (uni.getSystemInfoSync('pages') === 'activityDetail') {
uni.navigateBack({
// url: '/pages_events/tjty_ans_detail/tjty_ans_detail?activityId=' + this.activityId
delta: 1
})
} else {
uni.navigateBack({
// url: '/pages_events/tjty_ans_detail/tjty_ans_detail?activityId=' + this.activityId
delta: 2
})
}
} else {
// uni.setStorageSync('pages', 'dailyActivity')
console.log(flag);
this.getFinishSituation()
this.$refs.popup.close()
......@@ -167,14 +177,16 @@
},
//改变当前选中的选项字体颜色,显示解析,总分变化
selectMe(item, index) {
if (this.selectColor === 'color: #e02424;') return
if (this.selectColor === 'color: #e02424;' || this.selectColor === 'color: #36b25b;') return
this.flag = index
this.selectColor = 'color: #e02424;'
this.selectItem = item.substr(0, 1)
if (this.question[this.questionNumber].answer === this.selectItem) {
this.selectColor = 'color: #36b25b;'
this.score += 10
this.rightNumber++
this.cumulativeScore += 10
} else {
this.selectColor = 'color: #e02424;'
}
this.show = true
},
......@@ -198,8 +210,10 @@
},
// 结束计时,并显示弹出层
pause() {
this.$refs.popup.open('center')
console.log("hehe");
if (this.timer) {
this.$refs.popup.open('center')
clearInterval(this.timer)
// this.timer = null
}
......@@ -514,10 +528,11 @@
this.begin()
this.getFinishSituation() //判断是否完成答题
this.getDailyQuestion()
uni.setStorageSync('title','每日答题')
// this.getActivityDetail()
},
onShow() {
uni.setStorageSync('pages', 'dailyActivity')
},
onHide() {
console.log("haha");
......@@ -746,14 +761,14 @@
}
image {
margin: 5% 30% 0 30%;
width: 40%;
margin: 5% 30% 0 25%;
width: 50%;
height: 30%;
border: 1px dashed #009DFF;
}
.popup-scores {
margin-top: 6%;
margin-top: 8%;
margin-left: calc(100%-45px);
font-size: 20px;
font-family: Source Han Sans CN, Source Han Sans CN-Bold;
......@@ -767,7 +782,7 @@
height: 15%;
width: 80%;
margin-left: 10%;
margin-top: 6%;
margin-top: 8%;
display: flex;
.popup-item {
......
......@@ -66,7 +66,7 @@
})
return
}
uni.reLaunch({
uni.navigateTo({
url:`/pages_daily_answer/tjty_dailyAnswer/tjty_dailyAnswer?signupId=${this.signupId}&activityId=${this.activityId}`
})
},
......@@ -88,6 +88,9 @@
this.wechatId = this.userInfo.wechatId
this.activityId = options.activityId
this.getRegisterList()
},
onShow() {
uni.setStorageSync('pages','ans_choose')
}
}
</script>
......
<template>
<view class="ans_detail-page">
<navTop></navTop>
<view class="detail-page-content">
<view class="content-image">
<image class="image" :src="activityInfo.bannerImage"></image>
<image class="image-status" src="../../static/oper-icon/content_tag_weikaishi@2x.png"
v-if="activityInfo.activityStatus==='0'"></image>
v-if="activityInfo.activityStatus=='0'"></image>
<image class="image-status" src="../../static/oper-icon/content_tag_jinxingzhong@2x.png"
v-else-if="activityInfo.activityStatus==='1'"></image>
v-else-if="activityInfo.activityStatus=='1'"></image>
<image v-else class="image-status" src="../../static/oper-icon/content_tag_yijieshu@2x.png"></image>
<view class="activity_title"><view style="padding: 2% 4%;">{{activityInfo.activityName}}</view></view>
</view>
<view class="info">
<view class="item" v-if="activityInfo.signupTime">报名截止:<uni-dateformat format="yyyy-MM-dd"
:date="activityInfo.signupTime"></uni-dateformat>
<view class="item" style="height: 75rpx;display: flex;justify-content: space-between;" v-if="activityInfo.signupTime">
<view style="width: 25%;">报名截止: </view>
<view style="width: 70%;margin-right: 46rpx;font-size: 30rpx;">{{activityInfo.signupTime}}</view>
</view>
<view class="item" v-if="!activityInfo.signupTime">报名截止: <text
style="margin-left: 34rpx;font-size: 30rpx;"></text></view>
<view class="item" style="height: 75rpx;display: flex;justify-content: space-between;">
<view style="width: 25%;">活动时间:</view>
<view style="width: 70%;margin-right: 46rpx;">{{activityInfo.activityTime}}</view>
<view style="width: 70%;margin-right: 46rpx;font-size: 30rpx;">{{activityInfo.activityTime}}</view>
</view>
<view class="item" style="height: 75rpx;display: flex;justify-content: space-between;margin-bottom: 40rpx;">
<view style="width: 25%;">组织机构:</view>
<view style="width: 70%;margin-right: 46rpx;overflow: hidden;height: 90rpx;">{{activityInfo.mechanismName}}</view>
<view style="width: 70%;margin-right: 46rpx;overflow: hidden;height: 90rpx;font-size: 30rpx;">{{activityInfo.mechanismName}}</view>
</view>
</view>
<view style="height: 80rpx;margin-top: 40rpx;">
......@@ -58,6 +57,7 @@
export default {
data() {
return {
activityId:'',
day: -1, //还有几天结束报名
registerFlag: '', //是否报名判断
activityInfo: {},
......@@ -73,22 +73,22 @@
},
onShow() {
uni.setStorageSync('pages','activityDetail')
uni.setStorageSync("title", '赛事活动详情')
this.getRegister(options.activityId)
// uni.setStorageSync("title", '赛事活动详情')
this.getRegister(this.activityId)
// this.getRegister(+this.activityInfo.activityId)
},
onHide() {
uni.setStorageSync('pages','activity')
uni.setStorageSync("title", '赛事活动')
// uni.setStorageSync('pages','activity')
// uni.setStorageSync("title", '赛事活动')
},
onLoad(options) {
this.activityId = options.activityId
this.getActivityDetial(this.activityId)
this.wechatId = this.userInfo.wechatId
// console.log(options);
this.getActivityDetial(options.activityId)
this.getRegister(options.activityId)
},
created() {
uni.setStorageSync("title", '赛事活动详情')
uni.setStorageSync('pages','activityDetail')
// uni.setStorageSync("title", '赛事活动详情')
// uni.setStorageSync('pages','activityDetail')
},
methods: {
......@@ -184,6 +184,7 @@
console.log(res);
if (res.code === 200) {
this.activityInfo = res.data
console.log(this.activityInfo);
//时间格式处理
let index = this.activityInfo.activityEnd.indexOf(' ')
// this.activityInfo.activityEnd = this.activityInfo.activityEnd.substr(0, index)
......@@ -218,11 +219,11 @@
height: auto;
padding-bottom: 75px;
position: relative;
overflow-x:hidden;
.detail-page-content {
margin: 180rpx 20rpx 20rpx 20rpx;
margin: 20rpx 20rpx 20rpx 20rpx;
.content-image {
border-radius: 30rpx 30rpx 0 0;
......@@ -241,16 +242,32 @@
position: absolute;
// padding-left: 84%;
right: 20rpx;
top: 0;
top: 20rpx;
width: 120rpx;
height: 120rpx;
z-index: 9;
}
.activity_title{
position: relative;
width: 100%;
height: 72rpx;
opacity: 0.6;
background: #000000;
top: -86rpx;
z-index: 9;
font-size: 18px;
font-family: Source Han Sans CN, Source Han Sans CN-Medium;
font-weight: 500;
text-align: left;
color: #ffffff;
// line-height: 22px;
}
}
.info {
margin-top: -1%;
min-height: 127px;
min-height: 90px;
height: auto;
background: #ffffff;
border-radius: 0px 0px 16px 16px;
......
......@@ -133,7 +133,7 @@
validateFunction: function(rule, value, data, callback) {
let nameReg = /^[A-z]{2,16}$|^[\u4E00-\u9FA5]{2,16}$/
if (!nameReg.test(value)) {
callback('名字格式不正确,请重新填写')
callback('姓名只能输入汉字或字母,请重新填写')
}
return true
}
......@@ -147,7 +147,7 @@
validateFunction: function(rule, value, data, callback) {
let nameReg = /^[A-z]{2,16}$|^[\u4E00-\u9FA5]{2,16}$/
if (!nameReg.test(value)) {
callback('名字格式不正确,请重新填写')
callback('姓名只能输入汉字或字母,请重新填写')
}
return true
}
......@@ -222,6 +222,7 @@
this.getArea()
this.getActivityDetial(options.activityId)
this.getPerson()
uni.setStorageSync('pages','ans_info')
},
onReady() {
this.$refs.form.setRules(this.rules)
......
......@@ -77,11 +77,8 @@
getPersonnelListAxios,
submitOpusAxios
} from '../../api/personnel';
import uploadFile from '@/components/video-or-img-upload/video-or-img-upload.vue';
export default {
components: {
uploadFile
},
data() {
return {
......
......@@ -5,9 +5,9 @@ const url_all = {
// 'DEV': 'http://192.168.1.13:8080', // 英伟姐
// DEV: "http://116.205.136.218:8088/api", //线上服务
// 'DEV': 'http://127.0.0.1:8080', // 开发
// 'DEV': 'http://192.168.1.4:8080'
'DEV': 'http://192.168.1.4:8080'
// 'DEV': 'http://192.168.0.72:8080'
'DEV':'https://www.aiwanyundong.com/api'
// 'DEV':'https://www.aiwanyundong.com/api'
};
let BASEURL = url_all["DEV"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment