guhongwei 2 yıl önce
ebeveyn
işleme
5a8a2c821a

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "益智游戏",
     "appid" : "__UNI__2080341",
     "description" : "",
-    "versionName" : "1.0.7",
-    "versionCode" : 107,
+    "versionName" : "1.0.8",
+    "versionCode" : 108,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 15 - 1
pages.json

@@ -29,11 +29,25 @@
 					}
 				},
 				{
-					"path": "home/video",
+					"path": "video/index",
+					"style": {
+						"navigationBarTitleText": "电视节目",
+						"enablePullDownRefresh": true //是否启用下拉刷新
+					}
+				},
+				{
+					"path": "video/info",
 					"style": {
 						"navigationBarTitleText": "详细信息",
 						"enablePullDownRefresh": true //是否启用下拉刷新
 					}
+				},
+				{
+					"path": "prize/index",
+					"style": {
+						"navigationBarTitleText": "抽奖",
+						"enablePullDownRefresh": true //是否启用下拉刷新
+					}
 				}
 			]
 		}

+ 12 - 208
pagesHome/home/index.vue

@@ -1,37 +1,8 @@
 <template>
 	<view class="content">
 		<view class="one">
-			<input type="text" v-model="searchInfo.name" @blur="toInput" placeholder="搜索名称">
-		</view>
-		<view class="two">
-			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
-				<view class="list-scroll-view">
-					<view class="list" v-for="(item, index) in list" :key="index">
-						<view class="name">
-							<text>{{ index + 1 }}.</text>
-							<text>{{ item.name }}</text>
-						</view>
-						<view class="other">
-							<view class="other_1">
-								<text>节目类型:</text>
-								<text>{{ getDict(item.type,'typeList') }}</text>
-							</view>
-							<view class="other_1">
-								<text>视频流:</text>
-								<text>{{ item.path||'暂无视频流' }}</text>
-							</view>
-						</view>
-						<view class="btn">
-							<button type="primary" size="mini" @tap="toPlay(item)">
-								播放视频
-							</button>
-						</view>
-					</view>
-				</view>
-			</scroll-view>
-		</view>
-		<view class="is_bottom" v-if="is_bottom">
-			<text>到底了,嘻嘻!</text>
+			<button type="primary" size="mini" @tap="toCommon('pagesHome/video/index')">电视节目</button>
+			<button type="primary" size="mini" @tap="toCommon('pagesHome/prize/index')">抽奖</button>
 		</view>
 	</view>
 </template>
@@ -40,112 +11,18 @@
 	export default {
 		data() {
 			return {
-				// 查询
-				searchInfo: {},
-				list: [],
-				total: 0,
-				page: 0,
-				skip: 0,
-				limit: 10,
-				// 数据是否触底
-				is_bottom: false,
-				scrollTop: 0,
-				// 节目类型
-				typeList: this.$config.pro_type
+
 			};
 		},
 		onLoad() {
 			const that = this;
-			that.search();
-		},
-		onPullDownRefresh: async function() {
-			const that = this;
-			that.clearPage();
-			await that.search();
-			uni.stopPullDownRefresh();
+			// that.toCommon('pagesHome/prize/index')
 		},
 		methods: {
-			async search() {
-				const that = this;
-				let info = {
-					skip: that.skip,
-					limit: that.limit,
-					is_use: "0"
-				};
-				let res = await that.$api("program", "GET", {
-					...info,
-					...that.searchInfo
-				});
-				if (res.errcode == '0') {
-					let list = [...that.list, ...res.data]
-					that.$set(that, `list`, list)
-					that.$set(that, `total`, res.total)
-				} else {
-					uni.showToast({
-						title: res.errmsg,
-						icon: 'icon'
-					});
-				}
-			},
-			// 分页
-			toPage() {
-				const that = this;
-				let list = that.list;
-				let limit = that.limit;
-				if (that.total > list.length) {
-					uni.showLoading({
-						title: '加载中',
-						mask: true
-					})
-					let page = that.page + 1;
-					that.$set(that, `page`, page)
-					let skip = page * limit;
-					that.$set(that, `skip`, skip)
-					that.search();
-					uni.hideLoading();
-
-				} else that.$set(that, `is_bottom`, true)
-			},
-			toScroll(e) {
-				const that = this;
-				let up = that.scrollTop;
-				that.$set(that, `scrollTop`, e.detail.scrollTop);
-				let num = Math.sign(up - e.detail.scrollTop);
-				if (num == 1) that.$set(that, `is_bottom`, false);
-			},
-			// 输入框
-			toInput(e) {
-				const that = this;
-				if (e.detail.value) that.$set(that.searchInfo, `name`, e.detail.value);
-				else that.$set(that, `searchInfo`, {});
-				that.clearPage();
-				that.search();
-			},
-			toPlay(e) {
-				if (e.path) {
-					uni.navigateTo({
-						url: `/pagesHome/home/video?id=${e._id}`,
-					});
-				} else {
-					uni.showToast({
-						title: '暂无视频流,无法播放',
-						icon: 'none'
-					});
-				}
-			},
-			getDict(value, model) {
-				const that = this;
-				let data = that[model].find(i => i.dict_value == value);
-				if (data) return data.dict_label
-				else return '暂无'
-			},
-			// 清空列表
-			clearPage() {
-				const that = this;
-				that.$set(that, `list`, [])
-				that.$set(that, `skip`, 0)
-				that.$set(that, `limit`, 10)
-				that.$set(that, `page`, 0)
+			toCommon(e) {
+				uni.navigateTo({
+					url: `/${e}`
+				})
 			}
 		},
 	};
@@ -154,85 +31,12 @@
 <style lang="scss">
 	.content {
 		.one {
-			border-bottom: 1px solid #000000;
-
-			input {
-				padding: 2vw;
-				background-color: #f1f1f1;
-				font-size: 14px;
-				border-radius: 5px;
-			}
-		}
-
-		.two {
-			position: relative;
-			flex-grow: 1;
-			padding: 0 10px;
-
-			.list {
-				// width: 90%;
-				margin: 10px 0 0 0;
-				padding: 10px;
-				border-radius: 5px;
-				box-shadow: 0 0 5px #cccccc;
-
-				.name {
-					font-size: 16px;
-					font-weight: bold;
-					margin: 0 0 5px 0;
-				}
-
-				.other {
-					margin: 0 0 10px 0;
+			margin: 2vw;
+			text-align: center;
 
-					.other_1 {
-						margin: 0 0 5px 0;
-
-						text {
-							font-size: 14px;
-							color: #858585;
-						}
-
-						text:last-child {
-							color: #000000;
-							word-break: break-all;
-						}
-					}
-				}
-
-				.btn {
-					text-align: center;
-				}
+			button {
+				margin: 0.5vw;
 			}
-
-			.list:last-child {
-				margin: 10px 0;
-			}
-		}
-	}
-
-	.scroll-view {
-		position: absolute;
-		top: 0;
-		left: 0;
-		right: 0;
-		bottom: 0;
-
-		.list-scroll-view {
-			display: flex;
-			flex-direction: column;
-			padding: 0 10px;
-		}
-	}
-
-	.is_bottom {
-		text-align: center;
-
-		text {
-			padding: 2vw 0;
-			display: inline-block;
-			color: #858585;
-			font-size: 14px;
 		}
 	}
 </style>

+ 142 - 0
pagesHome/prize/index.vue

@@ -0,0 +1,142 @@
+<template>
+	<view class="content">
+		<view class="one">
+			<view class="one_1">
+				<text :style="{background:`${prizeInfo.color}`}">{{prizeInfo.name||'待开奖中'}}</text>
+			</view>
+			<view class="one_2">
+				<button :type="is_start==true?'warn':'primary'" size="mini"
+					@tap="toCommon()">{{is_start==true?'结束':'开始'}}</button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 是否开始抽奖
+				is_start: false,
+				// 抽奖名单
+				list: [ //
+					{
+						"name": "小夫妻麻辣烫",
+						"color": "#3d582f"
+					},
+					{
+						"name": "稻花香盒饭",
+						"color": "#c4ef4c"
+					},
+					{
+						"name": "三品阁米线",
+						"color": "#27b92b"
+					},
+					{
+						"name": "新天地超市",
+						"color": "#5d653c"
+					},
+					{
+						"name": "福苑粥铺",
+						"color": "#7e102d"
+					},
+					{
+						"name": "1949豆腐脑",
+						"color": "#51ccf"
+					},
+					{
+						"name": "干锅鸭头",
+						"color": "#332893"
+					},
+					{
+						"name": "水饺",
+						"color": "#164365"
+					},
+					{
+						"name": "酱大骨头",
+						"color": "#6dfdb4"
+					},
+					{
+						"name": "青山砂锅麻辣烫",
+						"color": "#d920e1"
+					},
+					{
+						"name": "黄焖鸡米饭",
+						"color": "#7c9d9b"
+					},
+					{
+						"name": "沈老头包子",
+						"color": "#b3dc5e"
+					},
+					{
+						"name": "兰州拉面",
+						"color": "#398fce"
+					},
+					{
+						"name": "田记抻面",
+						"color": "#d476e3"
+					},
+					{
+						"name": "裤带面",
+						"color": "#8cb2d1"
+					},
+					{
+						"name": "板面",
+						"color": "#4dfd51"
+					}
+
+				],
+				// 倒计时
+				timer: null,
+				// 中奖信息
+				prizeInfo: {},
+			};
+		},
+		methods: {
+			toCommon() {
+				const that = this;
+				let list = that.list;
+				if (that.is_start) {
+					that.is_start = false;
+					clearInterval(this.timer)
+					uni.showModal({
+						title: '中奖项',
+						content: `恭喜${that.prizeInfo.name}获得大奖,感谢参与!`
+					})
+				} else {
+					that.is_start = true;
+					that.timer = setInterval(function() {
+						var index = Math.floor(Math.random() * list.length)
+						that.prizeInfo = list[index]
+					}, 200)
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.content {
+		.one {
+			text-align: center;
+
+			.one_1 {
+				margin: 2vw 0;
+
+				text {
+					display: inline-block;
+					width: 50vw;
+					height: 50vw;
+					text-align: center;
+					line-height: 50vw;
+					border-radius: 90%;
+					background-color: #000000;
+					color: #ffffff;
+					font-weight: bold;
+					font-size: 30px;
+					font-family: cursive;
+				}
+			}
+		}
+	}
+</style>

+ 238 - 0
pagesHome/video/index.vue

@@ -0,0 +1,238 @@
+<template>
+	<view class="content">
+		<view class="one">
+			<input type="text" v-model="searchInfo.name" @blur="toInput" placeholder="搜索名称">
+		</view>
+		<view class="two">
+			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
+				<view class="list-scroll-view">
+					<view class="list" v-for="(item, index) in list" :key="index">
+						<view class="name">
+							<text>{{ index + 1 }}.</text>
+							<text>{{ item.name }}</text>
+						</view>
+						<view class="other">
+							<view class="other_1">
+								<text>节目类型:</text>
+								<text>{{ getDict(item.type,'typeList') }}</text>
+							</view>
+							<view class="other_1">
+								<text>视频流:</text>
+								<text>{{ item.path||'暂无视频流' }}</text>
+							</view>
+						</view>
+						<view class="btn">
+							<button type="primary" size="mini" @tap="toPlay(item)">
+								播放视频
+							</button>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+		<view class="is_bottom" v-if="is_bottom">
+			<text>到底了,嘻嘻!</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				// 查询
+				searchInfo: {},
+				list: [],
+				total: 0,
+				page: 0,
+				skip: 0,
+				limit: 10,
+				// 数据是否触底
+				is_bottom: false,
+				scrollTop: 0,
+				// 节目类型
+				typeList: this.$config.pro_type
+			};
+		},
+		onLoad() {
+			const that = this;
+			that.search();
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
+		},
+		methods: {
+			async search() {
+				const that = this;
+				let info = {
+					skip: that.skip,
+					limit: that.limit,
+					is_use: "0"
+				};
+				let res = await that.$api("program", "GET", {
+					...info,
+					...that.searchInfo
+				});
+				if (res.errcode == '0') {
+					let list = [...that.list, ...res.data]
+					that.$set(that, `list`, list)
+					that.$set(that, `total`, res.total)
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+						icon: 'icon'
+					});
+				}
+			},
+			// 分页
+			toPage() {
+				const that = this;
+				let list = that.list;
+				let limit = that.limit;
+				if (that.total > list.length) {
+					uni.showLoading({
+						title: '加载中',
+						mask: true
+					})
+					let page = that.page + 1;
+					that.$set(that, `page`, page)
+					let skip = page * limit;
+					that.$set(that, `skip`, skip)
+					that.search();
+					uni.hideLoading();
+
+				} else that.$set(that, `is_bottom`, true)
+			},
+			toScroll(e) {
+				const that = this;
+				let up = that.scrollTop;
+				that.$set(that, `scrollTop`, e.detail.scrollTop);
+				let num = Math.sign(up - e.detail.scrollTop);
+				if (num == 1) that.$set(that, `is_bottom`, false);
+			},
+			// 输入框
+			toInput(e) {
+				const that = this;
+				if (e.detail.value) that.$set(that.searchInfo, `name`, e.detail.value);
+				else that.$set(that, `searchInfo`, {});
+				that.clearPage();
+				that.search();
+			},
+			toPlay(e) {
+				if (e.path) {
+					uni.navigateTo({
+						url: `/pagesHome/video/info?id=${e._id}`,
+					});
+				} else {
+					uni.showToast({
+						title: '暂无视频流,无法播放',
+						icon: 'none'
+					});
+				}
+			},
+			getDict(value, model) {
+				const that = this;
+				let data = that[model].find(i => i.dict_value == value);
+				if (data) return data.dict_label
+				else return '暂无'
+			},
+			// 清空列表
+			clearPage() {
+				const that = this;
+				that.$set(that, `list`, [])
+				that.$set(that, `skip`, 0)
+				that.$set(that, `limit`, 10)
+				that.$set(that, `page`, 0)
+			}
+		},
+	};
+</script>
+
+<style lang="scss">
+	.content {
+		.one {
+			border-bottom: 1px solid #000000;
+
+			input {
+				padding: 2vw;
+				background-color: #f1f1f1;
+				font-size: 14px;
+				border-radius: 5px;
+			}
+		}
+
+		.two {
+			position: relative;
+			flex-grow: 1;
+			padding: 0 10px;
+
+			.list {
+				// width: 90%;
+				margin: 10px 0 0 0;
+				padding: 10px;
+				border-radius: 5px;
+				box-shadow: 0 0 5px #cccccc;
+
+				.name {
+					font-size: 16px;
+					font-weight: bold;
+					margin: 0 0 5px 0;
+				}
+
+				.other {
+					margin: 0 0 10px 0;
+
+					.other_1 {
+						margin: 0 0 5px 0;
+
+						text {
+							font-size: 14px;
+							color: #858585;
+						}
+
+						text:last-child {
+							color: #000000;
+							word-break: break-all;
+						}
+					}
+				}
+
+				.btn {
+					text-align: center;
+				}
+			}
+
+			.list:last-child {
+				margin: 10px 0;
+			}
+		}
+	}
+
+	.scroll-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+
+		.list-scroll-view {
+			display: flex;
+			flex-direction: column;
+			padding: 0 10px;
+		}
+	}
+
+	.is_bottom {
+		text-align: center;
+
+		text {
+			padding: 2vw 0;
+			display: inline-block;
+			color: #858585;
+			font-size: 14px;
+		}
+	}
+</style>

pagesHome/home/video.vue → pagesHome/video/info.vue


Dosya farkı çok büyük olduğundan ihmal edildi
+ 2 - 2
unpackage/dist/build/app-plus/app-config-service.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 2 - 2
unpackage/dist/build/app-plus/app-service.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/build/app-plus/manifest.json


Dosya farkı çok büyük olduğundan ihmal edildi
+ 2 - 2
unpackage/dist/dev/app-plus/app-config-service.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 296 - 45
unpackage/dist/dev/app-plus/app-service.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 519 - 72
unpackage/dist/dev/app-plus/app-view.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
unpackage/dist/dev/app-plus/manifest.json