wesmiler 2 роки тому
батько
коміт
da0b57a489

+ 4 - 0
addons/xlapp/common/locales/en.js

@@ -956,5 +956,9 @@ export default {
 	"仅自己可见": "visible oneself",
 	"是否可评论": "comment open",
 	"打开": "open",
+	"发布成功": "publish success",
+	"私信": "private letter",
+	"确定退出发布吗?": "确定退出发布吗?",
+	"没有什么可说的": "没有什么可说的",
 
 }

+ 12 - 0
addons/xlapp/common/locales/zh-cn.js

@@ -890,6 +890,18 @@ export default {
 	"仅自己可见": "仅自己可见",
 	"是否可评论": "是否可评论",
 	"打开": "打开",
+	"发布成功": "发布成功",
+	"私信": "私信",
+	"确定退出发布吗?": "确定退出发布吗?",
+	"没有什么可说的": "没有什么可说的",
+	"商户名称": "商户名称",
+	"请输入商户名称": "请输入商户名称",
+	"商户姓名": "商户姓名",
+	"请输入商户姓名": "请输入商户姓名",
+	"telegram": "telegram",
+	"支付方式": "支付方式",
+	"请选择支持的支付方式": "请选择支持的支付方式",
+	"请输入商户姓名": "请输入商户姓名",
 
 
 }

+ 5 - 0
addons/xlapp/components/index/push.nvue

@@ -197,6 +197,11 @@
 
 			})
 		},
+		onHide() {
+			if (this.page >= 0) {
+				uni.createVideoContext('video-' + this.page, this).pause();
+			}
+		},
 		methods: {
 			$tt(text, arr = {}) {
 				return app.$t(text, arr);

+ 206 - 140
addons/xlapp/components/video/play.nvue

@@ -1,6 +1,5 @@
 <template>
 	<view class="push" :style="'width: 100%;height: '+boxHeight+'px;flex:1;'">
-		<!-- <view id="navbar"> -->
 		<u-navbar :height="'146rpx'" :titleStyle="{width: '100%'}" bgColor="transparent" :autoBack="false"
 			:placeholder="false" :safeAreaInsetTop="true">
 			<view slot="left" @click="goBack()">
@@ -21,43 +20,48 @@
 				:text="$tt('暂无数据')">
 			</u-empty>
 		</view>
-		<swiper class="swiper" :style="'width: '+boxWidth+'px;height: '+boxHeight+'px;flex:1;'" :vertical="true"
-			@change="changeplay" @touchstart="touchStart" @touchend="touchEnd">
-			<swiper-item class="swiper-item-box" v-for="(item,index) in videoList" :key="'v'+item.id"
+		<swiper v-else class="swiper" :style="'width: '+boxWidth+'px;height: '+boxHeight+'px;flex:1;'" :vertical="true"
+			@change="changeplay">
+			<swiper-item :id="'swiper-'+item.id" class="swiper-item-box" v-for="(item,index) in videoList" :key="index"
 				:style="'width: '+boxWidth+'px;height: '+boxHeight+'px;flex:1;'">
-				<view class="swiper-item" :style="'width: '+boxWidth+'px;flesx:1;'">
-
-					<view class="album-swiper" v-if="videoInfo.type==2"
+				<view class="swiper-item" :style="'width: '+boxWidth+'px;flex:1;'">
+					<view class="album-swiper" v-if="item.type==2"
 						:style="'width: '+boxWidth+'px;height: '+boxHeight+'px;flex:1;'">
-						<u-swiper class="albumPlayer" :list="videoInfo.albums" keyName="url" :autoplay="true" circular
-							bgColor="#303030" :height="boxHeight"
-							:style="'width: '+boxWidth+'px;height: '+boxHeight+'px;flex:1;'"></u-swiper>
+						<u-swiper class="albumPlayer" :list="item.albums" keyName="url" :autoplay="true" circular
+							bgColor="#303030" :height="boxHeight" indicatorMode="dot" :indicator="true"
+							:indicatorStyle="{bottom: '120px'}"
+							:style="'width: '+boxWidth+'px;height: '+boxHeight+'px;flex:2;'"></u-swiper>
+					</view>
+					<view class="video-box" v-else :style="'width: '+boxWidth+'px;height: '+boxHeight+'px;'">
+						<video :id="'video-'+index" class="video" :src="item.file_url" :loop="true"
+							:autoplay="page==index?true:false" :controls="false" @click="changeClick" :muted="false"
+							:style="'width: '+boxWidth+'px;height: '+boxHeight+'px;flex:1;'" object-fit="cover"></video>
 					</view>
-					<videoPlay v-else @changeClick='changeClick' ref="player" :video="videoInfo" :index="index"
-						:width="boxWidth" :height="boxHeight" :objectFit="'cover'">
-					</videoPlay>
+					<!-- <videoPlay v-else @changeClick='changeClick' ref="player" :video="item" :index="index"
+						:width="boxWidth" :height="(boxHeight-120)" :objectFit="'cover'">
+					</videoPlay> -->
 
-					<view class="video-box" :style="'width: '+boxWidth+'px;'" v-show="showInfo">
+					<view class="video-box" :style="'width: '+boxWidth+'px;'" v-if="page==index">
 						<view :class="'video-info-box video-info-'+device" :style="'width: '+boxWidth+'px;'">
 							<view class="video-info-nicknl
 								lme">
-								<view class="is-live" v-if="videoInfo.live_id>0">
+								<view class="is-live" v-if="item.live_id>0">
 									<image class="is-live-icon" src="../../static/icons/user/icon-live-player.png"
 										mode="aspectFill"></image>
 									<text class="is-live-text">{{$tt('直播中')}}</text>
 								</view>
 								<text class="follow-type"
-									v-if="videoInfo.is_follow==1 && videoInfo.is_fans==1">{{$tt('你的朋友')}}</text>
-								<text class="follow-type" v-else-if="videoInfo.is_fans==1">{{$tt('你的粉丝')}}</text>
-								<text class="follow-type" v-else-if="videoInfo.is_follow==1">{{$tt('你的关注')}}</text>
-								<text class="nickname-text">@{{videoInfo.member.nickname}}</text>
+									v-if="item.is_follow==1 && item.is_fans==1">{{$tt('你的朋友')}}</text>
+								<text class="follow-type" v-else-if="item.is_fans==1">{{$tt('你的粉丝')}}</text>
+								<text class="follow-type" v-else-if="item.is_follow==1">{{$tt('你的关注')}}</text>
+								<text class="nickname-text">@{{item.member.nickname}}</text>
 							</view>
 							<view class="video-info">
 								<view class="desc">
-									<text class="desc-text">{{videoInfo.description}}</text>
+									<text class="desc-text">{{item.description}}</text>
 								</view>
-								<view class="tags" v-if="videoInfo.tags">
-									<text class="tag" v-for="(vv,kk) in videoInfo.tags" :key="kk">#{{vv}}</text>
+								<view class="tags" v-if="item.tags">
+									<text class="tag" v-for="(vv,kk) in item.tags" :key="kk">#{{vv}}</text>
 								</view>
 							</view>
 
@@ -65,59 +69,58 @@
 						<view class="video-menus">
 							<view class="menu-item video-author">
 								<view class="author-avatar">
-									<image v-if="videoInfo.live_id>0" class="author-avatar-image live-image"
-										@click="gotoPage('/pages/live/index?id='+videoInfo.live_id)"
-										:src="videoInfo.member.avatar" mode="aspectFill">
+									<image v-if="item.live_id>0" class="author-avatar-image live-image"
+										@click="gotoPage('/pages/live/index?id='+item.live_id)"
+										:src="item.member.avatar" mode="aspectFill">
 										<image v-else class="author-avatar-image"
-											@click="gotoPage('/pages/user/home?id='+videoInfo.user_id)"
-											:src="videoInfo.member.avatar" mode="aspectFill">
+											@click="gotoPage('/pages/user/home?id='+item.user_id)"
+											:src="item.member.avatar" mode="aspectFill">
 										</image>
 
 										<view
-											v-if="!videoInfo.is_publisher && (videoInfo.is_follow != 1 || (videoInfo.is_follow == 1 && videoInfo.is_fans==1))"
-											:class="'follow-user'+(videoInfo.is_follow == 1 && videoInfo.is_fans==1?' followed-user':'')">
-											<image v-if="videoInfo.is_follow == 1 && videoInfo.is_fans==1"
+											v-if="!item.is_publisher && (item.is_follow != 1 || (item.is_follow == 1 && item.is_fans==1))"
+											:class="'follow-user'+(item.is_follow == 1 && item.is_fans==1?' followed-user':'')">
+											<image v-if="item.is_follow == 1 && item.is_fans==1"
 												class="follow-user-image followed"
 												src="../../static/icons/user/follow.-back.png" mode="aspectFill">
 											</image>
-											<image v-else-if="videoInfo.is_follow != 1"
-												@click="follow(index, videoInfo)" class="follow-user-image no-follow"
+											<image v-else-if="item.is_follow != 1" @click="follow(index, item)"
+												class="follow-user-image no-follow"
 												src="../../static/icons/user/add.png" mode="aspectFill">
 											</image>
 										</view>
 								</view>
 							</view>
 							<view class="menu-item video-like">
-								<image v-if="videoInfo.is_like!=1" class="menu-icon like-image"
-									@click="like(index,videoInfo)" src="../../static/icons/user/follow.png"
-									mode="aspectFill">
+								<image v-if="item.is_like!=1" class="menu-icon like-image" @click="like(index,item)"
+									src="../../static/icons/user/follow.png" mode="aspectFill">
 								</image>
-								<image v-else class="menu-icon like-image checked" @click="like(index,videoInfo)"
+								<image v-else class="menu-icon like-image checked" @click="like(index,item)"
 									src="../../static/icons/user/follow-active.png" mode="aspectFill">
 								</image>
-								<text class="icon-text">{{getNumText(videoInfo.like_num)||0}}</text>
+								<text class="icon-text">{{getNumText(item.like_num)||0}}</text>
 							</view>
 							<view class="menu-item video-comment">
 								<image class="menu-icon comment-image" @click="showCommentPopup"
 									src="../../static/icons/user/comment.png" mode="aspectFill">
 								</image>
-								<text class="icon-text">{{getNumText(videoInfo.comment_num)||'0'}}</text>
+								<text class="icon-text">{{getNumText(item.comment_num)||'0'}}</text>
 							</view>
 							<view class="menu-item video-collect">
-								<image v-if="videoInfo.is_collect!=1" class="menu-icon collect-image"
-									@click="collect(index,videoInfo)" src="../../static/icons/user/collect.png"
+								<image v-if="item.is_collect!=1" class="menu-icon collect-image"
+									@click="collect(index,item)" src="../../static/icons/user/collect.png"
 									mode="aspectFill">
 								</image>
-								<image v-else class="menu-icon collect-image checked" @click="collect(index,videoInfo)"
+								<image v-else class="menu-icon collect-image checked" @click="collect(index,item)"
 									src="../../static/icons/user/collect-active.png" mode="aspectFill">
 								</image>
-								<text class="icon-text">{{getNumText(videoInfo.collect_num)||0}}</text>
+								<text class="icon-text">{{getNumText(item.collect_num)||0}}</text>
 							</view>
 
 							<view class="video-music" @click="playerMusic">
 								<image :class="'music-pic' + (playMusic?' rotate':'')+(device=='h5'?' music-pic-h5':'')"
-									:src="videoInfo.music_pic?videoInfo.music_pic:videoInfo.member.avatar"
-									mode="aspectFill" :style="musicStyle"></image>
+									:src="item.music_pic?item.music_pic:item.member.avatar" mode="aspectFill"
+									:style="musicStyle"></image>
 							</view>
 						</view>
 					</view>
@@ -125,25 +128,32 @@
 			</swiper-item>
 		</swiper>
 
-		<u-loading-icon class="loading" :show="loading" size="48" color="#14ECCC"
-			custom-style="position:absolute; top: 40%;z-index: 99;left:0;right:0;margin: 0 auto;">
+		<!-- 评论 -->
+		<comment v-if="showComment" :show="showComment" :id="videoInfo.id" :videoIndex="page"
+			:liveUserId="videoInfo.user_id"></comment>
+
+		<u-loading-icon class="loading" :show="loading" size="80" color="#14ECCC"
+			custom-style="position:absolute; top: 360rpx;z-index: 10099;left:0;right:0;margin: 0 auto;">
 		</u-loading-icon>
 	</view>
 </template>
 
 <script>
 	import videoPlay from '../video/videoPlay.vue'
+	import comment from '../video/comment.vue'
 	import request from '../../config/request.js'
 	let app = getApp().globalData;
 	export default {
-		name: "play",
+		name: "push",
 		components: {
-			videoPlay
+			videoPlay,
+			comment
 		},
-		props: ['id'],
+		props: ['id', 'type'],
 		data() {
 			return {
 				loading: false,
+				loaded: false,
 				device: 'android',
 				boxHeight: 800,
 				boxWidth: 360,
@@ -158,20 +168,24 @@
 				musicStyle: 'transform: rotate(0deg);',
 				playMusic: true,
 				showInfo: true,
+				showComment: false,
 				videoList: [],
 				params: {
+					id: 0,
 					page: 1,
-					uid: 0,
-					pageSize: 20,
+					pageSize: 30,
 				},
 				pageStatrY: 0,
 				pageEndY: 0,
 				page: 0,
 				deg: 0,
 				timeId: null,
+				videoContext: null,
+				submitting: false,
 			}
 		},
 		created() {
+			let _this = this
 			const windowInfo = uni.getWindowInfo();
 			this.boxHeight = windowInfo.windowHeight
 			this.boxWidth = windowInfo.windowWidth
@@ -179,19 +193,47 @@
 			// #ifdef H5 || MP-WEIXIN
 			this.device = 'h5'
 			// #endif
+
 			this.getVideoInfo();
 
+			// this.getList()
 			this.musicAnimation()
 			if (this.music) {
 				this.music.destroy();
 			}
+
+			uni.$on('close-comment', function() {
+				console.log('关闭')
+				_this.showComment = false
+			})
+
+			uni.$on('load.comment_num', function(data) {
+				if (typeof(_this.videoList[data.index]) != 'undefined') {
+					_this.videoList[data.index].comment_num += data.num;
+					_this.videoList[data.index].comment_num = _this.videoList[data.index].comment_num > 0 ? _this
+						.videoList[data.index].comment_num : 0
+				}
+
+			})
+		},
+		onHide() {
+			if (this.page >= 0) {
+				uni.createVideoContext('video-' + this.page, this).pause();
+			}
 		},
 		methods: {
 			$tt(text, arr = {}) {
 				return app.$t(text, arr);
 			},
 			goBack() {
-				uni.navigateBack();
+				if (this.type == 2) {
+					uni.navigateTo({
+						url: '/pages/index/index'
+					})
+				} else {
+					uni.navigateBack();
+				}
+
 			},
 			playerMusic() {
 				if (this.playMusic) {
@@ -199,15 +241,15 @@
 					console.log(this.videoInfo)
 					clearInterval(this.musicTimerId)
 					if (this.videoInfo.type == 1) {
-						this.$refs.player[this.page].pause()
-						this.$refs.player[this.page].muted = true
+						uni.createVideoContext('video-' + this.page, this).pause();
 					} else {
 						this.music.pause();
 					}
 				} else {
 					this.playMusic = true
 					if (this.videoInfo.type == 1) {
-						this.$refs.player[this.page].player()
+						uni.createVideoContext('video-' + this.page, this).seek(0);
+						uni.createVideoContext('video-' + this.page, this).play();
 					} else {
 						this.music.play();
 					}
@@ -223,21 +265,26 @@
 			getNumText(num) {
 				return num > 10000 ? (num / 10000).toFixed(1) + 'w' : num;
 			},
+			showCommentPopup() {
+				this.showComment = true
+				uni.$emit('show-comment', true)
+			},
 			changeClick(e) {
+				console.log(uni.createVideoContext('video-' + this.page, this))
 				if (!e) {
 					this.playMusic = false
 					console.log(this.videoInfo)
 					clearInterval(this.musicTimerId)
 					if (this.videoInfo.type == 1) {
-						this.$refs.player[this.page].muted = false
-						this.$refs.player[this.page].pause()
+
+						uni.createVideoContext('video-' + this.page, this).pause();
 					} else {
 						this.music.pause();
 					}
 				} else {
 					this.playMusic = true
 					if (this.videoInfo.type == 1) {
-						this.$refs.player[this.page].player()
+						uni.createVideoContext('video-' + this.page, this).play();
 					} else {
 						this.music.play();
 					}
@@ -251,84 +298,46 @@
 				if (this.music) {
 					this.music.destroy();
 				}
+				let scrollType = res.detail.current > this.page ? 1 : 0
 				this.page = res.detail.current
-				this.$forceUpdate()
-
-				this.showInfo = false
-				this.timeId = setTimeout(() => {
-					let videoInfo = this.videoList[this.page]
-					if (this.pageStatrY < this.pageEndY) {
-						if (videoInfo.type == 2) {
-							if (videoInfo.music_url) {
-								_this.music = uni.createInnerAudioContext();
-								_this.music.autoplay = true
-								_this.music.loop = true
-								_this.music.src = videoInfo.music_url;
-								_this.music.play()
-							}
-						} else {
-							let lastPlayer = typeof(this.$refs.player[this.page + 1]) != 'undefined' ? this.$refs
-								.player[this.page + 1] : null;
-							let player = typeof(this.$refs.player[this.page]) != 'undefined' ? this.$refs.player[
-								this.page] : null;
-
-							if (lastPlayer) {
-								lastPlayer.muted = true
-								lastPlayer.pause()
-							}
-							if (player) {
-								player.player()
-							}
-
-						}
+				this.videoContext = uni.createVideoContext('video-' + this.page, this)
+				for (let i = 0; i < this.videoList.length; i++) {
+					if (i != this.page) {
+						this.videoList[i].play = false
+						uni.createVideoContext('video-' + i, _this).pause();
+					}
+				}
 
-						console.log('向上滑动')
-						// setTimeout(() => {
-						// 	this.$refs.player[this.page].play()
-						// }, 10)
-						this.pageStatrY = 0
-						this.pageEndY = 0
-					} else {
-						console.log('向下滑动')
-						if (videoInfo.type == 2) {
-							if (videoInfo.music_url) {
-								_this.music = uni.createInnerAudioContext();
-								_this.music.src = videoInfo.music_url;
-								_this.music.autoplay = true
-								_this.music.loop = true
-								_this.music.play()
-							}
-						} else {
-							let lastPlayer = typeof(this.$refs.player[this.page - 1]) != 'undefined' ? this.$refs
-								.player[this.page - 1] : null;
-							let player = typeof(this.$refs.player[this.page]) != 'undefined' ? this.$refs.player[
-								this.page] : null;
-							if (lastPlayer) {
-								lastPlayer.muted = true
-								lastPlayer.pause()
-							}
-							if (player) {
-								player.player()
-							}
+				setTimeout(function() {
+					let videoInfo = _this.videoList[_this.page]
+					_this.videoList[_this.page].play = true
+					_this.videoContext.seek(0)
+					_this.videoContext.play()
+					if (videoInfo.type == 2) {
+						if (videoInfo.music_url) {
+							_this.music = uni.createInnerAudioContext();
+							_this.music.autoplay = true
+							_this.music.loop = true
+							_this.music.src = videoInfo.music_url;
+							_this.music.play()
 						}
-
-						// setTimeout(() => {
-						// 	this.$refs.player[this.page].play()
-						// }, 10)
-
-						this.pageStatrY = 0
-						this.pageEndY = 0
 					}
-					_this.deg = 0
+
 					_this.videoInfo = videoInfo
 					_this.musicAnimation()
-				}, 1)
-
-				setTimeout(function() {
-					_this.showInfo = true
-
+					_this.updatePlay(_this.page, _this.videoInfo)
 				}, 5)
 			},
+			// 播放浏览数据更新
+			async updatePlay(index, video) {
+				console.log('更新浏览')
+				const res = request.api('/video/play', {
+					id: video.id
+				});
+				if (res.success = true) {
+					this.videoList[index].views += 1;
+				}
+			},
 			// 图标动画
 			musicAnimation() {
 				let _this = this
@@ -377,7 +386,6 @@
 						icon: 'none'
 					})
 				}
-
 			},
 			// 列表
 			async getList() {
@@ -391,6 +399,9 @@
 			},
 			// 关注
 			async follow(index, row) {
+				if (this.loading) {
+					return false;
+				}
 				this.loading = true;
 				const res = await request.api('/user/follow', {
 					id: row.user_id,
@@ -418,6 +429,9 @@
 			},
 			// 点赞
 			async like(index, row) {
+				if (this.loading) {
+					return false;
+				}
 				this.loading = true;
 				const res = await request.api('/video/like', {
 					id: row.id,
@@ -426,14 +440,36 @@
 				})
 				this.loading = false;
 				if (res.success == true) {
-					if (this.videoInfo.is_like == 1) {
-						this.videoList[index].like_num -= 1;
+					if (row.is_like == 1) {
+						this.videoList[index].is_like = this.videoList[index].is_like == 1 ? 2 : 1;
+						this.videoList[index].like_num = row.like_num - 1 > 0 ? row.like_num - 1 : 0;
 					} else {
-						this.videoList[index].like_num += 1;
+						this.videoList[index].is_like = this.videoList[index].is_like == 1 ? 2 : 1;
+						this.videoList[index].like_num = row.like_num + 1;
+						this.updateTask(res.data)
 					}
 
-					this.videoList[index].is_like = this.videoList[index].is_like == 1 ? 2 : 1;
+
 					this.$forceUpdate()
+				} else if (res.code == 403) {
+					uni.showModal({
+						title: this.$tt('操作提示'),
+						content: this.$tt('请先登录账号后使用'),
+						cancelText: this.$tt('暂不登录'),
+						confirmText: this.$tt('立即登录'),
+						confirmColor: '#14ECCC',
+						success: function(result) {
+							if (result.confirm) {
+								uni.navigateTo({
+									url: '/pages/login/login'
+								})
+							} else {
+								uni.navigateTo({
+									url: '/pages/index/index'
+								})
+							}
+						}
+					})
 				} else {
 					uni.showToast({
 						title: this.$tt(res.msg),
@@ -441,8 +477,15 @@
 					})
 				}
 			},
+			// 任务检测
+			async updateTask(params) {
+				const res = await request.api('/task/check', params)
+			},
 			// 收藏
 			async collect(index, row) {
+				if (this.loading) {
+					return false;
+				}
 				this.loading = true;
 				const res = await request.api('/video/collect', {
 					id: row.id,
@@ -452,13 +495,35 @@
 				this.loading = false;
 				if (res.success == true) {
 
-					if (this.videoInfo.is_collect == 1) {
-						this.videoList[index].collect_num -= 1;
+					if (this.videoList[index].is_collect == 1) {
+						this.videoList[index].is_collect = row.is_collect == 1 ? 2 : 1;
+						this.videoList[index].collect_num = row.collect_num - 1 > 0 ? row.collect_num - 1 : 0;
 					} else {
-						this.videoList[index].collect_num += 1;
+						this.videoList[index].is_collect = row.is_collect == 1 ? 2 : 1;
+						this.videoList[index].collect_num = row.collect_num + 1;
+						this.updateTask(res.data)
 					}
-					this.videoList[index].is_collect = this.videoList[index].is_collect == 1 ? 2 : 1;
+
 					this.$forceUpdate()
+				} else if (res.code == 403) {
+					uni.showModal({
+						title: this.$tt('操作提示'),
+						content: this.$tt('请先登录账号后使用'),
+						cancelText: this.$tt('暂不登录'),
+						confirmText: this.$tt('立即登录'),
+						confirmColor: '#14ECCC',
+						success: function(result) {
+							if (result.confirm) {
+								uni.navigateTo({
+									url: '/pages/login/login'
+								})
+							} else {
+								uni.navigateTo({
+									url: '/pages/index/index'
+								})
+							}
+						}
+					})
 				} else {
 					uni.showToast({
 						title: this.$tt(res.msg),
@@ -511,12 +576,13 @@
 		position: fixed;
 		z-index: 992;
 		padding: 20rpx 30rpx;
-		bottom: 20rpx;
+		bottom: 30px;
+		/* bottom: 200rpx; */
 		right: 0;
 	}
 
 	.video-info-android {
-		bottom: 110rpx;
+		bottom: 130rpx;
 	}
 
 	.video-info-h5 {
@@ -598,7 +664,7 @@
 		width: 120rpx;
 		position: fixed;
 		right: 20rpx;
-		bottom: 180rpx;
+		bottom: 40px;
 		z-index: 993;
 		flex-direction: column;
 		align-items: center;

+ 2 - 3
addons/xlapp/pages/live/index.nvue

@@ -14,7 +14,6 @@
 				:style="'width: '+(liveWidth+60)+'px;height: '+(liveHeight+60)+'px;z-index:'+(liveError?8:1)+';'"
 				src="../../static/images/live-bg.png" mode="aspectFill"></image>
 
-
 			<!-- 视频直播区 -->
 			<view v-show="liveInfo && liveInfo.status==1 && liveInfo.user_id != userInfo.id" class="live-player-box"
 				:style="'width: '+liveWidth+'px;height:'+liveHeight+'px'">
@@ -3603,8 +3602,8 @@
 	.live-player-box {
 		top: 0;
 		left: 0;
-		z-index: 8;
-		position: fixed;
+		z-index: 66;
+		position: absolute;
 		flex-direction: row;
 		align-items: center;
 		justify-content: center;

+ 5 - 0
addons/xlapp/pages/merchant/apply.vue

@@ -712,4 +712,9 @@
 		}
 
 	}
+
+
+	/deep/ .u-action-sheet .u-icon__icon {
+		font-size: 30rpx !important;
+	}
 </style>

+ 3 - 1
addons/xlapp/pages/merchant/list.vue

@@ -302,7 +302,7 @@
 	.main {
 		width: 100%;
 		height: 100%;
-		padding-top: 380rpx;
+		padding-top: 410rpx;
 
 		.list-box {
 
@@ -377,6 +377,8 @@
 
 	}
 
+
+
 	.main-h5 {
 		padding-top: 320rpx;
 	}

+ 8 - 1
addons/xlapp/pages/shop/order/index.vue

@@ -22,7 +22,7 @@
 				</view>
 			</view>
 		</view>
-		<view :class="['main',(isH5?'main-h5':'main-app')]">
+		<view :class="['main',(isH5?'main-h5':'main-'+device)]">
 			<view class="main-box">
 				<view class="order-list">
 					<u-empty v-if="!dataList || dataList.length<=0" class="empty" marginTop="320rpx" textSize="28rpx"
@@ -181,6 +181,7 @@
 				loading: false,
 				boxHeight: 1200,
 				isH5: false,
+				device: '',
 				showPayModal: false,
 				showRefundModal: false,
 				showRefundType: false,
@@ -255,6 +256,8 @@
 			const windowInfo = uni.getWindowInfo();
 			this.boxHeight = windowInfo.windowHeight
 
+			this.device = uni.getSystemInfoSync().osName;
+
 			// #ifdef H5 ||MP-WEIXIN
 			this.isH5 = true;
 			// #endif
@@ -741,6 +744,10 @@
 		}
 	}
 
+	.main-android {
+		padding-top: 280rpx;
+	}
+
 	.modal-box {
 		width: auto;
 

+ 339 - 3
addons/xlapp/pages/trade/apply.vue

@@ -1,22 +1,358 @@
 <template>
-	<view>
-		承兑商入驻
+	<view class="app">
+		<u-navbar :title="$t('承兑商入驻')" :height="'90rpx'" :titleStyle="{color: '#fff','fontSize':'36rpx'}"
+			bgColor="#303030" :autoBack="false" :placeholder="true" :safeAreaInsetTop="true">
+			<view slot="left" @click="goBack()">
+				<u-icon class="icon" name="arrow-left" size="46" color="#fff"></u-icon>
+			</view>
+		</u-navbar>
+		<view class="main">
+			<view class="logo-box">
+				<view class="tips" v-if="formData.status == 1">
+					{{$t("进度:入驻审核中")}}
+				</view>
+				<view class="tips" v-else-if="formData.status == 3">
+					{{$t("已驳回")}}:{{formData.audit_remark}}
+				</view>
+			</view>
+			<view class="shop-box">
+				<u--form labelPosition="left" :model="formData" ref="form" labelWidth="180rpx">
+					<u-form-item :label="$t('商户名称')" class="bg">
+						<u-input v-model="formData.name" type="text" fontSize="28rpx" maxlength="20" clearable
+							border="none" :placeholder="$t('请输入商户名称')">
+							<u-icon class="icon" slot="suffix" name="arrow-right" size="36" color="#999"></u-icon>
+						</u-input>
+					</u-form-item>
+					<u-form-item :label="$t('联系方式')" class="bg">
+						<u-input v-model="formData.mobile" type="text" fontSize="28rpx" maxlength="16" clearable
+							border="none" :placeholder="$t('请输入联系方式')">
+							<u-icon class="icon" slot="suffix" name="arrow-right" size="36" color="#999"></u-icon>
+						</u-input>
+					</u-form-item>
+					<u-form-item :label="$t('Telegram')" class="bg">
+						<u-input v-model="formData.telegram" type="text" fontSize="28rpx" maxlength="20" clearable
+							border="none" :placeholder="$t('请输入telegram账号')">
+							<u-icon class="icon" slot="suffix" name="arrow-right" size="36" color="#999"></u-icon>
+						</u-input>
+					</u-form-item>
+					<u-form-item :label="$t('支付方式')" class="bg" @click="showPayment=true">
+						<view class="text-box">
+							<text
+								:class="[(formData.pay_type?'':'no'),'text']">{{$t(formData.pay_name||'请选择支付方式')}}</text>
+							<u-icon class="icon" name="arrow-right" size="36" color="#999"></u-icon>
+						</view>
+					</u-form-item>
+				</u--form>
+				<view class="submit-box" v-if="formData.status == 1">
+					<view class="btn" @click="submit()">
+						{{$t('继续提交')}}
+					</view>
+				</view>
+				<view class="submit-box" v-else-if="formData.status == 2">
+					<view class="btn">
+						{{$t('已入驻成功')}}
+					</view>
+				</view>
+				<view class="submit-box" v-else-if="formData.status == 3">
+					<view class="btn" @click="submit()">
+						{{$t('重新提交')}}
+					</view>
+				</view>
+				<view class="submit-box" v-else>
+					<view class="btn" @click="submit()">
+						{{$t('提交申请')}}
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 支付 -->
+		<u-action-sheet :actions="payments" @select="selectPayment" :title="$t('请选择支持的支付方式')" :closeOnClickAction="true"
+			:closeOnClickOverlay="true" :keyName="'id'" @close="showPayment = false" :cancelText="$t('取消')"
+			:show="showPayment"></u-action-sheet>
+
+		<u-loading-icon class="loading" :show="loading" size="48" color="#14ECCC"
+			custom-style="position:absolute;top:40%;left:0;right:0;margin:0 auto;z-index: 10099;">
+		</u-loading-icon>
 	</view>
 </template>
 
 <script>
+	import {
+		getToken
+	} from '../../config/cache'
 	export default {
 		data() {
 			return {
+				loading: false,
+				showPayment: false,
+				showTime: false,
+				acceptorInfo: {
+					id: 0
+				},
 
+				formData: {
+					id: 0,
+					name: '',
+					realname: '',
+					mobile: '',
+					telagram: '',
+					pay_type: '',
+					pay_name: '',
+					audit_remark: '',
+					status: 0,
+				},
+				payments: [{
+						id: 1,
+						name: '微信支付'
+					},
+					{
+						id: 2,
+						name: '支付宝支付'
+					},
+					{
+						id: 3,
+						name: '银行卡支付'
+					},
+				],
 			}
 		},
+		created() {
+			this.getApplyInfo()
+
+		},
 		methods: {
+			goBack() {
+				uni.navigateBack()
+			},
+			// 支付
+			selectPayment(e) {
+				this.formData.pay_type = e.id
+				this.formData.pay_name = e.name
+				this.showPayment = false
+			},
+			// 申请信息
+			async getApplyInfo() {
+				let _this = this
+				this.loading = true;
+				const res = await this.$request.api('/acceptor/applyInfo')
+				this.loading = false;
+
+				if (res.success == true) {
+					this.formData = res.data
+				} else if (res.code == '403') {
+					uni.showToast({
+						title: this.$t('请先登录'),
+						icon: 'none'
+					})
+					setTimeout(function() {
+						uni.navigateTo({
+							url: '/pages/login/login'
+						})
+					}, 800)
+					return false;
+				}
+
+			},
+			// 提交
+			async submit() {
+				let _this = this
+
+				if (this.formData.name == '') {
+					uni.showToast({
+						title: this.$t('请输入商户名称'),
+						style: 'z-index:10078',
+						icon: 'none',
+					})
+					return false;
+				}
 
+				if (this.formData.mobile == '' && this.formData.telegram == '') {
+					uni.showToast({
+						title: this.$t('请输入至少一种联系方式'),
+						style: 'z-index:10078',
+						icon: 'none',
+					})
+					return false;
+				}
+
+				if (this.formData.pay_type <= 0) {
+					uni.showToast({
+						title: this.$t('请选择支持的支付方式'),
+						style: 'z-index:10078',
+						icon: 'none',
+					})
+					return false;
+				}
+
+				_this.loading = true
+				const res = await this.$request.api('/acceptor/apply', this.formData);
+				_this.loading = false
+				if (res.success == true) {
+					let msg = typeof(res.msg) != 'undefined' ? res.msg : this.$t('请求失败')
+					uni.showToast({
+						title: this.$t(msg),
+						style: 'z-index:10078',
+						icon: 'none'
+					})
+					setTimeout(function() {
+						_this.getApplyInfo();
+					}, 1200)
+				} else {
+					let msg = typeof(res.msg) != 'undefined' ? res.msg : this.$t('申请失败')
+					uni.showToast({
+						title: this.$t(msg),
+						style: 'z-index:10078',
+						icon: 'none'
+					})
+				}
+			},
 		}
 	}
 </script>
 
-<style>
+<style lang="scss" scoped>
+	page {
+		height: 100%;
+		width: 100%;
+		min-height: 800rpx;
+
+	}
+
+	.app {
+		height: 100%;
+		padding-bottom: 120rpx;
+		// background: linear-gradient(to bottom, #333, #f2f2f2);
+		overflow: hidden;
+		z-index: 1;
+	}
+
+	.nav-right-btn {
+		color: #000;
+		font-size: 24rpx;
+		background-color: #14ECCC;
+		padding: 10rpx 20rpx;
+		border-radius: 10rpx;
+	}
+
+	.main {
+		width: 100%;
+		height: 100%;
+		// overflow: hidden;
+		position: relative;
+		overflow-y: scroll;
+
+		.logo-box {
+			padding: 30rpx 30rpx;
+			text-align: center;
+			position: relative;
+			border-bottom: 20rpx solid #f2f2f2;
+
+			.logo {
+				width: 150rpx;
+				height: 150rpx;
+				margin: 0 auto;
+				text-align: center;
+				position: relative;
+
+				.upload {
+					margin: 0 auto;
+				}
+
 
+			}
+
+			.text {
+				padding: 20rpx 0rpx;
+				color: #666;
+				border-radius: 10rpx;
+				font-size: 24rpx;
+			}
+
+			.tips {
+				padding-top: 10rpx;
+				font-size: 28rpx;
+				color: #ee2e56;
+
+			}
+
+		}
+
+		.shop-box {
+			padding: 20rpx 0rpx;
+
+			.u-form {
+				padding: 0rpx 30rpx;
+
+				/deep/ .u-input__content__field-wrapper__field {
+					text-align: right !important;
+				}
+
+				.bg /deep/ .u-input__content__field-wrapper__field {
+					border-bottom: 1px solid #f2f2f2;
+				}
+
+				.text-box {
+					// flex: 1;
+					width: 100%;
+					display: inline-block;
+					// float: right;
+					text-align: right;
+
+					.text {
+						max-width: 400rpx;
+						display: inline-block;
+						vertical-align: middle;
+						overflow: hidden;
+						color: #333;
+						font-size: 28rpx;
+					}
+
+					.text.no {
+						color: rgb(192, 196, 204);
+						;
+					}
+
+					.icon {
+						margin-left: 10rpx;
+						display: inline-block;
+						vertical-align: middle;
+					}
+				}
+
+
+			}
+
+			.upload-box {
+				padding: 20rpx 30rpx 120rpx;
+				border-top: 20rpx solid #f2f2f2;
+
+				.label {
+					padding: 20rpx 0;
+				}
+			}
+
+
+
+			.submit-box {
+				width: 100%;
+				position: fixed;
+				bottom: 30rpx;
+				z-index: 99;
+
+				.btn {
+					margin: 0 60rpx;
+					padding: 20rpx 0;
+					border-radius: 100rpx;
+					background-color: #14ECCC;
+					text-align: center;
+					font-size: 32rpx;
+				}
+			}
+		}
+	}
+
+	/deep/ .u-action-sheet .u-icon__icon {
+		font-size: 30rpx !important;
+	}
 </style>

+ 13 - 2
addons/xlapp/pages/trade/index.vue

@@ -97,7 +97,7 @@
 				</view>
 			</view>
 		</view>
-		<view :class="['main',(isH5?'main-h5':'main-app')]">
+		<view :class="['main',(isH5?'main-h5':'main-'+device)]">
 			<view class="main-box">
 				<view class="list-box">
 					<view class="list-item" v-for="(v,k) in dataList" :key="k">
@@ -172,6 +172,7 @@
 				showLang: false,
 				lang: 'zh-cn',
 				isH5: false,
+				device: '',
 				boxHeight: 1200,
 				userInfo: {
 					id: 0,
@@ -201,6 +202,8 @@
 
 			this.lang = getSycCache('lang')
 
+			this.device = uni.getSystemInfoSync().osName;
+
 			// #ifdef H5 ||MP-WEIXIN
 			this.isH5 = true;
 			// #endif
@@ -536,7 +539,7 @@
 
 	.main {
 		width: 100%;
-		padding-top: 200rpx;
+		padding-top: 290rpx;
 		padding-bottom: 120rpx;
 
 		.main-box {
@@ -668,4 +671,12 @@
 			}
 		}
 	}
+
+	.main-android {
+		padding-top: 260rpx;
+	}
+
+	.main-h5 {
+		padding-top: 200rpx;
+	}
 </style>

+ 10 - 5
addons/xlapp/pages/video/index.vue

@@ -77,7 +77,8 @@
 					</video>
 					<view v-else class="swiper">
 						<u-swiper class="albumPlayer" :list="params.albums" :autoplay="true" circular bgColor="#303030"
-							:style="'height: '+(liveHeight-200)+'px;flex:1;'" :height="(liveHeight-200)">
+							:style="'width:'+liveWidth+'px;height: '+(liveHeight)+'px;'" imgMode="scaleToFill"
+							:height="(liveHeight)">
 						</u-swiper>
 						<view class="video-music" @click="showMusicPopup()">
 							<image class="icon" src="../../static/icons/user/icon-music.png" mode="aspectFill"
@@ -349,6 +350,7 @@
 					type: 1,
 					visible_type: 1,
 					title: '',
+					thumb_url: '',
 					thumb: '',
 					file_url: '',
 					albums: [],
@@ -772,6 +774,7 @@
 					});
 					return false;
 				} else if (this.params.thumb_url == '') {
+					console.log('上传封面')
 					const res = await this.uploadImage(this.params.thumb);
 					this.params.thumb = res
 					this.params.thumb_url = res
@@ -822,7 +825,7 @@
 					})
 					setTimeout(function() {
 						uni.navigateTo({
-							url: '/pages/video/play?id=' + res.data.id
+							url: '/pages/video/play?type=2&id=' + res.data.id
 						});
 					}, 1200);
 				} else {
@@ -974,12 +977,14 @@
 
 	.swiper {
 		position: relative;
-		height: calc(100% - 380rpx);
+		height: calc(100% - 20rpx);
+		// height: calc(100% - 120rpx);
 		width: 100%;
-		margin-top: 180rpx;
+		margin-top: 0rpx;
+		// margin-top: 180rpx;
 
 		.video-music {
-			top: 120rpx;
+			top: 240rpx;
 		}
 	}
 

+ 3 - 1
addons/xlapp/pages/video/play.nvue

@@ -2,7 +2,7 @@
 	<view class="app" :style="'width: '+boxWidth+'px;height: '+boxHeight+'px'">
 		<u-toast ref="uToast"></u-toast>
 		<view class="main" :style="'width: '+boxWidth+'px;height: '+boxHeight+'px'">
-			<play :id="id"></play>
+			<play :id="id" :type="type"></play>
 		</view>
 		<u-loading-icon class="loading" :show="loading" size="48" color="#14ECCC"
 			custom-style="position:absolute; top: 40%;left:0;right:0;margin:0 auto;z-index: 99;">
@@ -25,11 +25,13 @@
 				boxHeight: 800,
 				boxWidth: 360,
 				loading: false,
+				type: 1,
 				id: 0,
 			}
 		},
 		onLoad(e) {
 			this.id = typeof(e.id) != 'undefined' && e.id > 0 ? e.id : 0;
+			this.type = typeof(e.type) != 'undefined' && e.type > 0 ? e.type : 0;
 			if (this.id <= 0) {
 				uni.showToast({
 					title: this.$t('抱歉参数错误,请返回重试'),

Різницю між файлами не показано, бо вона завелика
+ 484 - 34
addons/xlapp/unpackage/dist/dev/app-plus/app-service.js


Різницю між файлами не показано, бо вона завелика
+ 394 - 35
addons/xlapp/unpackage/dist/dev/app-plus/app-view.js


Різницю між файлами не показано, бо вона завелика
+ 1 - 1
addons/xlapp/unpackage/dist/dev/app-plus/pages/index/index.js


Різницю між файлами не показано, бо вона завелика
+ 3 - 3
addons/xlapp/unpackage/dist/dev/app-plus/pages/live/index.js


Різницю між файлами не показано, бо вона завелика
+ 3308 - 431
addons/xlapp/unpackage/dist/dev/app-plus/pages/video/play.js


+ 5 - 4
app/Http/Controllers/Api/v1/AcceptorController.php

@@ -3,6 +3,7 @@
 namespace App\Http\Controllers\Api\v1;
 
 use App\Http\Controllers\Api\webApp;
+use App\Http\Validator\AcceptorValidator;
 use App\Http\Validator\MemberValidator;
 use App\Http\Validator\MerchantValidator;
 use App\Services\Api\AcceptorService;
@@ -50,7 +51,7 @@ class AcceptorController extends webApp
      * 申请入驻
      * @return array
      */
-    public function apply(MerchantValidator $validator)
+    public function apply(AcceptorValidator $validator)
     {
         $params = request()->all();
         $params = $validator->check($params, 'apply');
@@ -58,10 +59,10 @@ class AcceptorController extends webApp
             return showJson($params, false);
         }
 
-        if(!$result = MerchantService::make()->apply($this->userId, $params)){
-            return showJson(MerchantService::make()->getError(), false);
+        if(!$result = AcceptorService::make()->apply($this->userId, $params)){
+            return showJson(AcceptorService::make()->getError(), false);
         }else{
-            return showJson(MerchantService::make()->getError(), true, $result);
+            return showJson(AcceptorService::make()->getError(), true, $result);
         }
     }
 

+ 5 - 12
app/Http/Validator/AcceptorValidator.php

@@ -1,6 +1,6 @@
 <?php
 namespace App\Http\Validator;
-class MerchantValidator extends BaseValidator
+class AcceptorValidator extends BaseValidator
 {
     // 当前模型所有验证规则
     public static $rules = [
@@ -23,25 +23,18 @@ class MerchantValidator extends BaseValidator
     // 当前模型所有验证字段
     public static $fields = [
         'id' => 'ID',
-        'name' => '商家名称',
-        'logo' => '商家logo',
+        'name' => '商户名称',
         'type' => '商家类别',
-        'category_id' => '行业类目',
-        'service_time' => '营业时间',
-        'country' => '商家所在国家',
-        'city' => '商家所在城市',
-        'address' => '商家所在地址',
         'mobile' => '联系方式',
-        'currency' => '交易货币',
-        'business_img' => '店铺营业执照',
+        'pay_type' => '支付方式',
         'status' => '状态',
     ];
 
     // 当前模型所有验证场景
     public static $scenes = [
         'info'=> ['id'],
-        'modify'=> ['name','logo','type','country','city','business_img','service_time','currency'],
-        'apply'=> ['name','logo','type','country','city','business_img','service_time','currency'],
+        'modify'=> ['name','realname'],
+        'apply'=> ['name','realname','pay_type'],
 
     ];
 

+ 0 - 1
app/Services/Api/AcceptorService.php

@@ -312,7 +312,6 @@ class AcceptorService extends BaseService
 
 
         // 入驻数据
-        // 入驻数据
         $data = [
             'realname' => isset($params['realname']) ? $params['realname'] : '',
             'user_id' => $userId,

+ 5 - 6
routes/api.php

@@ -139,10 +139,6 @@ Route::prefix('v1')->group(function(){
     Route::post('/message/setting', [\App\Http\Controllers\Api\v1\MessageController::class, 'setSetting']);
     Route::post('/message/getSetting', [\App\Http\Controllers\Api\v1\MessageController::class, 'getSetting']);
 
-    // 承兑商
-    Route::match(['get','post'],'/acceptor/index', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'index']);
-    Route::match(['get','post'],'/acceptor/info', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'info']);
-
     // 商家
     Route::post('/merchant/category', [\App\Http\Controllers\Api\v1\MerchantController::class, 'category']);
     Route::post('/merchant/apply', [\App\Http\Controllers\Api\v1\MerchantController::class, 'apply']);
@@ -175,8 +171,11 @@ Route::prefix('v1')->group(function(){
     Route::post('/order/after', [\App\Http\Controllers\Api\v1\OrderController::class, 'after']);
 
     // 承兑商
-    Route::match(['get','post'],'/acceptor/index', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'index']);
-    Route::match(['get','post'],'/acceptor/info', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'info']);
+    Route::post('/acceptor/index', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'index']);
+    Route::post('/acceptor/info', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'info']);
+    Route::post('/acceptor/apply', [\App\Http\Controllers\Api\v1\AcceptorController::class, 'apply']);
+    Route::post('/acceptor/applyInfo', [\App\Http\Controllers\Api\v1\MerchantController::class, 'applyInfo']);
+
 
     // 承兑商交易
     Route::match(['get','post'],'/trade/sell', [\App\Http\Controllers\Api\v1\TradeController::class, 'sell']);