Parcourir la source

1、增加视频列表
2、首页和积分商店广告图增加路由跳转
3、报名增加指导老师和指导机构字段,并通过guide字段控制显隐
4、活动详情页投票成功增加广告轮播图
5、修改配置文件的商户密码(MD5)

lyb il y a 4 ans
Parent
commit
541ce36e4f

+ 1 - 1
assets/http/service.js

@@ -6,7 +6,7 @@ let baseURL = config.baseURL
 
 
 let tokenUrl = baseURL +
-	"/blade-auth/oauth/token?tenantId=000000&password=929d394935cbe446b171e34db023456d&username=admin"
+	"/blade-auth/oauth/token?tenantId=000000&password=fd5ba907392066bc4fc27723a350b573&username=admin"
 
 //获取token
 const getTokenStorage = () => {

+ 36 - 20
components/alert/voteSuccess.vue

@@ -1,24 +1,30 @@
 <template>
 	<view>
-		<u-popup :custom-style="popupStyle" class="auth-point" v-model="show" mode="center" width="70%" border-radius="28" >
-			<view class="auth-bg">
-				<view class="auth-arc"></view>
-				<image style="width: 70%; margin-top: 56rpx;" src="../../static/poster/votesuccess.png" mode="widthFix"></image>
-				<view class="avatar-vote flex justify-center align-center">
-					<u-avatar size="159" :src="avatar"></u-avatar>
-				</view>
-				<view class="info-box">
-					<view class="main-info">成功为该作品助力{{activeVote}}票</view>
-					<view class="sub-info" style="padding: 0 20rpx;">
-						你已获得{{vuex_active_setting.voteAndPointRate * activeVote}}个平台积分,可用于"积分换礼"兑换礼品哦
+		<u-mask :show="show" @click="show = false">
+			<view class="u-flex" style="flex-direction: column; height: 100vh; justify-content: center; align-items: center;">
+				<view class="auth-bg">
+					<view class="auth-arc"></view>
+					<image style="width: 70%; position: absolute; top: 64rpx;" src="../../static/poster/votesuccess.png" mode="widthFix"></image>
+					<view class="avatar-vote flex justify-center align-center">
+						<u-avatar size="159" :src="avatar"></u-avatar>
 					</view>
-					<view class="flex justify-center" style="margin-top: 90rpx;">
-						<u-button  @click="show=false" shape="circle" :custom-style="customStyle">继续投票</u-button>
-						<u-button  shape="circle" :custom-style="customStyle" @click="support">花积分</u-button>
+					<view class="info-box">
+						<view class="main-info">成功为该作品助力{{activeVote}}票</view>
+						<view class="sub-info" style="padding: 0 20rpx;">
+							你已获得{{vuex_active_setting.voteAndPointRate * activeVote}}个平台积分,可用于"积分换礼"兑换礼品哦
+						</view>
+						<view class="flex justify-center" style="margin-top: 30rpx;">
+							<u-button  @click="show=false" shape="circle" :custom-style="customStyle">继续投票</u-button>
+							<u-button  shape="circle" :custom-style="customStyle" @click="support">花积分</u-button>
+						</view>
 					</view>
 				</view>
+				
+				<view style="width: 65%; margin: 60rpx auto 0;" v-if="list.length > 0">
+					<u-swiper :list="list" name="url" @click="click"></u-swiper>
+				</view>
 			</view>
-		</u-popup>
+		</u-mask>
 	</view>
 </template>
 
@@ -40,7 +46,8 @@
 					margin: '10rpx',
 					height:"60rpx",
 					fontSize:"26rpx"
-				}
+				},
+				list: []
 			};
 		},
 		created() {
@@ -48,6 +55,12 @@
 		},
 
 		methods: {
+			click(index){
+				let url = this.list[index].path;
+				if( !!url && (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) ){
+					window.location.href = url;
+				}
+			},
 			toIndex(){
 				uni.switchTab({
 					url:"/pages/index/home"
@@ -71,20 +84,23 @@
 
 <style lang="scss" scoped>
 	.auth-bg{
-		width: 100%;
-		background: transparent;
+		width: 65%;
+		background: #fff;
 		display: flex;
 		flex-direction: column;
+		justify-content: center;
 		align-items: center;
-		min-height: 688rpx;
+		min-height: 620rpx;
 		position: relative;
+		overflow: hidden;
+		border-radius: 20rpx;
+		margin: 0 auto;
 		.auth-arc{
 			position: absolute;
 			width: 140%;
 			height: 220rpx;
 			left: 50%;
 			top: 0;
-			z-index: -1;
 			transform: translateX(-50%);
 			background: var(--bgColor);
 			border-radius: 0 0 50% 50%;

+ 9 - 0
pages.json

@@ -274,6 +274,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/video/list",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "视频列表",
+                "navigationStyle": "custom"
+            }
+            
+        }
     ],
 	"tabBar": {
 		"list": [{

+ 5 - 2
pages/activity/activityDetail.vue

@@ -193,7 +193,7 @@
 				//活动设置
 				activitySetting: {},
 				//验证码图片
-				verificationCodeImg: ''
+				verificationCodeImg: '',
 			}
 		},
 		onShareAppMessage(res) {
@@ -486,10 +486,13 @@
 					this.$refs.toast.error(res.data.msg)
 				}
 			},
-			voteSuccess() {
+			async voteSuccess() {
 				try {
 					let avatar = this.$cache.get('userInfo').avatar || this.defaultAvatar
 					let activeVote = this.selectGoods.votePointRate 
+					let params = { platformSettingEnum: 'COMMON_SETTING' }
+					let adList = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data).indexImageList;
+					this.$refs.voteSuccess.list = adList;
 					this.$refs.voteSuccess.showSuccess(avatar, activeVote)
 				} catch (e) {
 					this.$refs.toast.info('助力成功')

+ 27 - 2
pages/apply/apply.vue

@@ -7,8 +7,7 @@
 		<view class="add-media" @click="handleUploadWork">
 			<view class="flex-direction flex justify-center" style="align-items: center;" v-show="!showUrl">
 				<u-icon name="plus-circle-fill" :color="vuex_theme.bgColor" size="90"></u-icon>
-				<text v-text="activeType == 'VIDEO_TEXT'?'上传视频作品':'上传图片作品'"
-					style="margin-top: 26rpx; color: #010101; font-size: 24rpx; font-weight: bold;">上传作品(图片或视频)</text>
+				<text style="margin-top: 26rpx; color: #010101; font-size: 24rpx; font-weight: bold; width: 70%; color: red;">{{tipsText}}</text>
 			</view>
 			<video v-if="activeType == 'VIDEO_TEXT' && showUrl" :src="showUrl"></video>
 			<image v-if="activeType == 'IMAGE_TEXT' && showUrl" :src="showUrl" mode="aspectFill"></image>
@@ -36,6 +35,20 @@
 					<u-input placeholder="请输入参赛者名称" v-model="applyInfo.player"></u-input>
 				</view>
 			</view>
+            
+            <view style="margin-bottom: 64rpx;" v-if="guide === 1">
+            	<text style="color: #010101; font-size: 28rpx; font-weight: bold;"> 指导老师</text>
+            	<view style="padding: 32rpx 0 0; border-bottom: 1rpx solid #E3E3E3;">
+            		<u-input placeholder="请输入指导老师" v-model="applyInfo.guideTeacher"></u-input>
+            	</view>
+            </view>
+            
+            <view style="margin-bottom: 64rpx;" v-if="guide === 1">
+            	<text style="color: #010101; font-size: 28rpx; font-weight: bold;"> 指导机构</text>
+            	<view style="padding: 32rpx 0 0; border-bottom: 1rpx solid #E3E3E3;">
+            		<u-input placeholder="请输入指导机构" v-model="applyInfo.guideSchool"></u-input>
+            	</view>
+            </view>
 
 			<view style="margin-bottom: 64rpx;">
 				<text style="color: #010101; font-size: 28rpx; font-weight: bold;"><text style="color: #f00;">*</text> 详细介绍</text>
@@ -95,6 +108,8 @@
 				applyInfo: {},
 				activeType: '', //活动类型: VIDEO_TEXT视频图文 IMAGE_TEXT图片文本
 				updateProgress: '', //上传进度
+				tipsText: '',
+				guide: null, //是否需要指导老师和指导机构
 			};
 		},
 		onLoad(options) {
@@ -107,14 +122,21 @@
 				return
 			}
 			this.initData(options)
+			
 		},
 		methods: {
 			/**
 			 * 初始化数据
 			 */
 			initData(options) {
+				this.guide = options.guide;
 				this.customStyle.background = this.vuex_theme.bgColor
 				this.activeType = options.activeType;
+				if(this.activeType === 'VIDEO_TEXT'){
+					this.tipsText = '提示:视频拍摄后,微信转发保存,即可压缩上传,上传速度可以更快哦!';
+				}else{
+					this.tipsText = '上传图片作品';
+				}
 				// this.activeType = 'IMAGE_TEXT';
 				this.applyInfo = {
 					userId: this.vuex_userId,
@@ -125,6 +147,9 @@
 					videoUrl: "",
 					content: "",
 					player: "",
+                    guideTeacher: "",
+                    guideSchool: ""
+
 				}
 			},
 			/**

+ 10 - 2
pages/index/home.vue

@@ -9,7 +9,7 @@
 				<u-notice-bar mode="horizontal" :list="noticeContent"></u-notice-bar>
 			</view>
 			<view style="padding: 30rpx 30rpx 10rpx;">
-				<u-swiper :list="swiperList" border-radius="12" name="url" mode="rect" height="300"></u-swiper>
+				<u-swiper :list="swiperList" border-radius="12" name="url" mode="rect" height="300" @click="handleSwiper"></u-swiper>
 			</view>
 
 			<view class="">
@@ -146,6 +146,13 @@
 			this.canReset = true;
 		},
 		methods: {
+			handleSwiper(index){
+				let url = this.swiperList[index].path;
+				if(!!url && (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) ){
+					window.location.href = url;
+				}
+				
+			},
 			/**
 			 * 更换主题
 			 */
@@ -263,6 +270,7 @@
 				}
 				// console.log(gridList, "gridList");
 				this.swiperList = this.vuex_active_setting.indexImageList
+				console.log(this.swiperList, "swiperList");
 			},
 			jump(item) {
 				if (item.path == '/pages/rank/rank') {
@@ -270,7 +278,7 @@
 				}
 				if (item.path == '/pages/apply/apply') {
 					//登录后才可以参赛
-					this.applyUrl = `${item.path}?activeId=${this.activeId}&activeType=${this.activeInfo.type}`
+					this.applyUrl = `${item.path}?activeId=${this.activeId}&activeType=${this.activeInfo.type}&guide=${this.activeInfo.guide}`
 					this.login()
 					return;
 				}

+ 7 - 1
pages/shop/shop.vue

@@ -31,7 +31,7 @@
 				</view>
 			</view>
 			<view class="swiper">
-				<u-swiper :list="swiperList" name="url" mode="rect" border-radius="12" height="270"></u-swiper>
+				<u-swiper :list="swiperList" name="url" mode="rect" border-radius="12" height="270" @click="handleSwiper"></u-swiper>
 			</view>
 			<filter-bar :currentIndex="currentIndex" ref="filterBar" @exchangeTag="handeExchangeTag"></filter-bar>
 			<view class="recommend-info">
@@ -114,6 +114,12 @@
 			}
 		},
 		methods: {
+			handleSwiper(index){
+				let url = this.swiperList[index].path;
+				if(!!url && (url.indexOf('http://') > -1 || url.indexOf('https://') > -1) ){
+					window.location.href = url;
+				}
+			},
 			fetchGoods(){
 				// #ifdef MP-WEIXIN
 				this.mescroll.resetUpScroll();

+ 81 - 0
pages/video/list.vue

@@ -0,0 +1,81 @@
+<template>
+	<view class="wrap">
+		<!-- #ifdef MP-WEIXIN -->
+		<u-navbar title-color="#000000" :is-back="fasle" title="视频列表"></u-navbar>
+		<!-- #endif -->
+		
+		<u-waterfall v-model="flowList" ref="uWaterfall" style="margin-top: 10rpx;">
+			<template v-slot:left="{leftList}">
+				<view class="demo-warter" v-for="(item, index) in leftList" :key="index">
+					<video v-show='item.$index==indexCurrent' :src="item.videoUrl" autoplay :id="'myVideo'+item.$index"></video>
+					<u-lazy-load v-show='item.$index!=indexCurrent' border-radius="10" :image="item.imageUrl" :index="index" @click="videoPlay(item.$index)"></u-lazy-load>
+					<u-icon v-show='item.$index!=indexCurrent' class="video-play" color="#fff" size="50" name="play-circle" @click="videoPlay(item.$index)"></u-icon>
+				</view>
+			</template>
+			<template v-slot:right="{rightList}">
+				<view class="demo-warter" v-for="(item, index) in rightList" :key="index">
+					<video v-show='item.$index==indexCurrent' :src="item.videoUrl" autoplay :id="'myVideo'+item.$index"></video>
+					<u-lazy-load v-show='item.$index!=indexCurrent' border-radius="10" :image="item.imageUrl" :index="index" @click="videoPlay(item.$index)"></u-lazy-load>
+					<u-icon v-show='item.$index!=indexCurrent' class="video-play" color="#fff" size="50" name="play-circle" @click="videoPlay(item.$index)"></u-icon>
+				</view>
+			</template>
+		</u-waterfall>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				flowList: [],
+				indexCurrent: null
+			}
+		},
+		async onLoad() {
+			let params = { 
+				activeId: this.vuex_active_setting.defaultActiveId,
+				platformSettingEnum: 'ACTIVE_SETTING' ,
+			}
+			this.flowList = JSON.parse((await this.$api.platform.getPlatformValue(params)).data.data).learnVideo;
+		},
+		methods: {
+			videoPlay(index){
+				let curIdx = index;
+				// 有播放时先将prev暂停,再播放当前点击的current
+				if (this.indexCurrent != null) {
+				  let videoContextPrev = uni.createVideoContext('myVideo' + this.indexCurrent)
+				  if (this.indexCurrent != curIdx) {
+					videoContextPrev.pause()
+				  }
+				  this.indexCurrent = curIdx;
+				  let videoContextCurrent = uni.createVideoContext('myVideo' + curIdx)
+				  videoContextCurrent.play()
+				} else {  // 没有播放时播放视频
+				  this.indexCurrent = curIdx
+				  let videoContext = uni.createVideoContext('myVideo' + curIdx) //这里对应的视频id
+				  videoContext.play()
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.demo-warter {
+		border-radius: 8px;
+		margin: 5px;
+		background-color: #ffffff;
+		padding: 8px;
+		position: relative;
+		.video-play{
+			position: absolute;
+			bottom: 20rpx;
+			left: 20rpx;
+		}
+	}
+	
+	video, image{
+		width: 330rpx;
+		max-height: 330rpx;
+	}
+</style>