Browse Source

update: initApp、video

KELECHUAN 3 years ago
parent
commit
0ea80edfc8

+ 3 - 0
.vs/ProjectSettings.json

@@ -0,0 +1,3 @@
+{
+  "CurrentProjectSetting": null
+}

BIN
.vs/slnx.sqlite


+ 2 - 2
components/todayclass-box/todayclass-box.vue

@@ -102,7 +102,7 @@
 					if (this.classCurrent === this.classList.length) {
 						const arr = {
 							name: '结束',
-							teacher: '完成课程',
+							teacher: '完成今日课程',
 							time: '17:20'
 						}
 						this.third = '时间:'
@@ -115,7 +115,7 @@
 					this.state = ''
 					const arr = [{
 						name: '起始',
-						teacher: '开始课程',
+						teacher: '开始今日课程',
 						time: '8:30'
 					}]
 					this.before = '上学打卡'

+ 16 - 7
manifest.json

@@ -15,7 +15,9 @@
             "autoclose" : true,
             "delay" : 0
         },
-        "modules" : {},
+        "modules" : {
+            "Share" : {}
+        },
         /* 模块配置 */
         "distribute" : {
             /* 应用发布信息 */
@@ -41,7 +43,14 @@
             },
             "ios" : {},
             /* ios打包配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs" : {
+                "share" : {
+                    "weixin" : {
+                        "appid" : "wx5705da8747c77cfe",
+                        "UniversalLinks" : ""
+                    }
+                }
+            }
         }
     },
     /* SDK配置 */
@@ -55,10 +64,10 @@
             "checkSiteMap" : false,
             "postcss" : true
         },
-        "usingComponents" : true,
-				"optimization":{
-					"subPackages": true
-				},
-				"runmode" : "liberate"
+        "usingComponents" : true,
+        "optimization" : {
+            "subPackages" : true
+        },
+        "runmode" : "liberate"
     }
 }

+ 0 - 5
subpkg/classlist/classlist.vue

@@ -199,11 +199,6 @@
 		align-items: center;
 		flex-wrap: wrap;
 		margin: 10rpx 0 10rpx 0;
-
-		.t-icon {
-			width: 30rpx;
-			height: 30rpx;
-		}
 	}
 
 	.msg {

+ 2 - 1
subpkg/common/infopage.scss

@@ -97,5 +97,6 @@
 			display: flex;
 			align-items: center;
 			margin: 20rpx;
-		}
+		}
+
 	}

+ 1 - 1
subpkg/common/videopage.scss

@@ -153,7 +153,7 @@
 		.flex-icon{
 			display: flex;
 			justify-content: space-between;
-			padding: 80rpx 110rpx 100rpx 110rpx;
+			padding: 50rpx 100rpx 70rpx 100rpx;
 			.t-icon{
 				width: 80rpx;
 				height: 80rpx;

+ 8 - 8
subpkg/info/childrenpage.vue

@@ -39,9 +39,9 @@
 					<view class="avatar-box">
 						<view class="t-icon t-icon-xz-de"></view>
 					</view>
-					<view class="flex">
+					<!-- <view class="flex">
 						<view class="item-text">本月考勤: 优秀</view>
-					</view>
+					</view> -->
 				</view>
 
 				<view class="data-box-item">
@@ -52,9 +52,9 @@
 					<view class="avatar-box">
 						<view class="t-icon t-icon-xunzhang-mei"></view>
 					</view>
-					<view class="flex">
+					<!-- <view class="flex">
 						<view class="item-text">综合成绩: 优秀</view>
-					</view>
+					</view> -->
 				</view>
 
 				<view class="data-box-item">
@@ -65,9 +65,9 @@
 					<view class="avatar-box">
 						<view class="t-icon t-icon-xunzhang-zhi"></view>
 					</view>
-					<view class="flex">
+					<!-- <view class="flex">
 						<view class="item-text">作业完成: 优秀</view>
-					</view>
+					</view> -->
 				</view>
 				<view class="data-box-item">
 					<view class="flex">
@@ -77,9 +77,9 @@
 					<view class="avatar-box">
 						<view class="t-icon t-icon-xunzhang-ti"></view>
 					</view>
-					<view class="flex">
+					<!-- <view class="flex">
 						<view class="item-text">家庭表现: 优秀</view>
-					</view>
+					</view> -->
 				</view>
 			</view>
 		</view>

+ 11 - 25
subpkg/video/livepage.vue

@@ -31,9 +31,8 @@
 					</view>
 				</view>
 
-				<view class="flex" style="margin: 0 20rpx;">
-					<view class="t-icon t-icon-baocun" @click="saveVideo"></view>
-					<view class="t-icon t-icon-fenxiang" @click="shareVideo"></view>
+				<view class="flex">
+					<view class="t-icon t-icon-fenxiang" @click="shareVideo" style="margin-left: auto;"></view>
 				</view>
 			</view>
 		</view>
@@ -60,10 +59,14 @@
 					</view>
 			</view>
 			<!-- 按钮 -->
-			<view class="btn" :style="{backgroundColor: index<current? '#23b46c':(index===current? '#ff5959':'#aaa') }">
-				<view class="content-subtitle" v-if="index<current" @click="showVideo(index)">观看回放</view>
-				<view class="content-subtitle" v-if="index===current" @click="showLive(index)">正在直播</view>
-				<view class="content-subtitle" v-if="index>current">暂未开始</view>
+			<view class="btn" v-if="index<current" :style="{backgroundColor:'#23b46c'}" @click="showVideo(index)">
+				<view class="content-subtitle">观看回放</view>
+			</view>
+			<view class="btn" v-if="index===current" :style="{backgroundColor:'#ff5959'}" @click="showLive(index)">
+				<view class="content-subtitle">正在直播</view>
+			</view>
+			<view class="btn" v-if="index>current" :style="{backgroundColor:'#aaa'}">
+				<view class="content-subtitle" >暂未开始</view>
 			</view>
 		</view>
 		<!-- 缺省区域 -->
@@ -118,23 +121,6 @@
 			getToday() {
 				this.today = (new Date()).format("yyyy-MM-dd")
 			},
-			saveVideo() {
-				uni.downloadFile({
-					url: this.classInfo.resource, //仅为示例,并非真实的资源
-					success: (res) => {
-						if (res.statusCode === 200) {
-							this.tempFilePath = res.tempFilePath
-							console.log('下载成功');
-							uni.saveVideoToPhotosAlbum({
-								filePath: this.tempFilePath,
-								success: function() {
-									console.log('保存成功')
-								}
-							})
-						}
-					}
-				});
-			},
 			//分享界面
 			shareVideo(){
 				this.actionShow = true
@@ -146,7 +132,7 @@
 					type: 4,
 					title: "来自醍摩豆家长端的分享",
 					summary: `孩子正在上${this.classInfo.name}课程,快来围观吧!`,
-					mediaUrl: this.tempFilePath,
+					mediaUrl: this.classInfo.resource,
 					success: function(res) {
 						console.log("success:" + JSON.stringify(res));
 					},

+ 63 - 21
subpkg/video/videopage.vue

@@ -32,9 +32,9 @@
 					</view>
 				</view>
 
-				<view class="flex" style="margin: 0 20rpx;">
-					<view class="t-icon t-icon-baocun" @click="saveVideo"></view>
-					<view class="t-icon t-icon-fenxiang" @click="shareVideo"></view>
+				<view class="flex">
+					<view class="t-icon t-icon-baocun" @click="downLoadShow = true"></view>
+					<view class="t-icon t-icon-fenxiang" @click="actionShow = true"></view>
 				</view>
 			</view>
 		</view>
@@ -63,16 +63,21 @@
 				</view>
 			</view>
 			<!-- 按钮 -->
-			<view class="btn" :style="{backgroundColor: index<current? '#23b46c':(index===current? '#ff5959':'#aaa') }">
-				<view class="content-subtitle" v-if="index<current" @click="showVideo(index)">观看回放</view>
-				<view class="content-subtitle" v-if="index===current" @click="showLive(index)">正在直播</view>
-				<view class="content-subtitle" v-if="index>current">暂未开始</view>
+			<view class="btn" v-if="index<current" :style="{backgroundColor:'#23b46c'}" @click="showVideo(index)">
+				<view class="content-subtitle">观看回放</view>
+			</view>
+			<view class="btn" v-if="index===current" :style="{backgroundColor:'#ff5959'}" @click="showLive(index)">
+				<view class="content-subtitle">正在直播</view>
+			</view>
+			<view class="btn" v-if="index>current" :style="{backgroundColor:'#aaa'}">
+				<view class="content-subtitle" >暂未开始</view>
 			</view>
 		</view>
 		<!-- 缺省区域 -->
 		<!-- <view style="margin-top: 150rpx;">
 			<u-empty mode="data"></u-empty>
 		</view> -->
+		<!-- 分享 -->
 		<u-action-sheet :show="actionShow" @close="actionShow = false" title="——  分享视频到  ——" :round="10">
 			<view class="flex-icon">
 				<view class="flex-box">
@@ -89,6 +94,17 @@
 				</view>
 			</view>
 		</u-action-sheet>
+		<!-- 下载 -->
+		<u-action-sheet :show="downLoadShow" @close="downLoadShow = false" title="——  是否下载该视频  ——" :round="10">
+			<view class="flex-icon" style="padding: 50rpx 80rpx 70rpx 80rpx;">
+				<view class="confirm" @click="downLoadShow = false" style="background-color: #aaa;">
+					<view class="subtitle">取消</view>
+				</view>
+				<view class="confirm" @click="noMultipleClicks(saveVideo)" style="background-color: #23b46c;">
+					<view class="subtitle">确认</view>
+				</view>
+			</view>
+		</u-action-sheet>
 	</view>
 </template>
 
@@ -109,8 +125,8 @@
 				//正在播放第几个视频
 				tempIndex: '',
 				actionShow: false,
-				//下载临时路径
-				tempFilePath: '',
+				downLoadShow: false,
+				noClick: true
 			};
 		},
 		onLoad(options) {
@@ -121,30 +137,42 @@
 		},
 		methods: {
 			getToday() {
-				this.today = (new Date()).format("yyyy-MM-dd")
+				this.today = (new Date()).format("yyyy-M-d")
+			},
+			// 处理多次点击
+			noMultipleClicks(methods) {
+				this.downLoadShow = false
+				uni.$showMsg('开始下载', 500)
+				//复制this对象指向当时的this,防止找不到原来的对象
+				let that = this;
+				if (that.noClick) {
+					that.noClick = false;
+					//点击方法
+					methods();
+					setTimeout(function() {
+						that.noClick = true;
+					}, 2000)
+				} else {
+					uni.$showMsg('正在下载中', 500)
+				}
 			},
 			//保存video
 			saveVideo() {
 				uni.downloadFile({
-					url: this.classInfo.resource, //仅为示例,并非真实的资源
+					url: this.classInfo.resource, 
 					success: (res) => {
 						if (res.statusCode === 200) {
-							this.tempFilePath = res.tempFilePath
-							console.log('下载成功');
+							uni.$showMsg('下载成功')
 							uni.saveVideoToPhotosAlbum({
-								filePath: this.tempFilePath,
+								filePath: res.tempFilePath,
 								success: function() {
-									console.log('保存成功')
+									uni.$showMsg('保存成功')
 								}
 							})
-							
 						}
 					}
 				});
-			},
-			//分享界面
-			shareVideo() {
-				this.actionShow = true
+
 			},
 			shareToWeixin() {
 				uni.share({
@@ -153,7 +181,7 @@
 					type: 4,
 					title: "来自醍摩豆家长端的分享",
 					summary: `今日孩子已上${this.classInfo.name}课程,快来围观吧!`,
-					mediaUrl: this.tempFilePath,
+					mediaUrl: this.classInfo.resource,
 					success: function(res) {
 						console.log("success:" + JSON.stringify(res));
 					},
@@ -203,4 +231,18 @@
 
 <style lang="scss">
 	@import '@/subpkg/common/videopage.scss';
+	.confirm{
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		height: 70rpx;
+		width: 250rpx;
+		border-radius: 10rpx;
+		
+		.subtitle {
+			font-size: 30rpx;
+			font-weight: bold;
+			color: #FFF;
+		}
+	}
 </style>

+ 12 - 2
utils/APIHandler.js

@@ -801,7 +801,7 @@ function initApp(phoneNumber) {
 				icon: 't-icon t-icon-shuju',
 				title: '成绩通知',
 				msgTime: '12分钟前',
-				content: '您的孩子【张梅】在 【青城山学校】的【2020年语文期末测试】成绩已经生成,请点击查看详情 > ',
+				content: '您的孩子【张梅】在 【青城山学校】的【2020年语文期末测试】成绩已经生成',
 				image: 'https://image.meiye.art/pic_9ikZaVYnJE38Ao6AZlVIx?imageMogr2/thumbnail/450x/interlace/1'
 			},
 			{
@@ -815,7 +815,7 @@ function initApp(phoneNumber) {
 				icon: 't-icon t-icon-bianji',
 				title: '任务通知',
 				msgTime: '40分钟前',
-				content: '您的孩子【张梅】班主任李老师给您发布一个新的问卷活动【周末孩子表现问卷调查】,快去填写吧 ',
+				content: '您的孩子【张梅】班主任李老师给您发布一个新的问卷活动【周末孩子表现问卷调查】',
 				image: 'https://image.meiye.art/pic_1628927180566LfOmH3IV5i24Mmc65BGE0?imageMogr2/thumbnail/450x/interlace/1'
 			}
 		]
@@ -963,6 +963,16 @@ function initHome() {
 		month: 4,
 		year: 2022,
 		time: '08:06'
+	}, {
+		date: 5,
+		month: 5,
+		year: 2022,
+		time: '08:06'
+	}, {
+		date: 6,
+		month: 5,
+		year: 2022,
+		time: '08:06'
 	}]
 	this.$store.commit('m_children/updateRecords', records)
 	let homeChartData = {