Browse Source

修复学习中心时间转换

xuqiaoying 3 years ago
parent
commit
bd7c07ec76
4 changed files with 27 additions and 32 deletions
  1. 2 2
      common/request.js
  2. 4 7
      pages/index/index.vue
  3. 20 21
      pages/learn/index.vue
  4. 1 2
      pages3/course/detail.vue

+ 2 - 2
common/request.js

@@ -5,10 +5,10 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-// export const BASE_URL = 'https://test.xyyxt.net'   //预发布
+export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
-export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
+// export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 4 - 7
pages/index/index.vue

@@ -157,10 +157,10 @@
                         </view>
                         <view class="text">
 							<view class="c_title">{{item.goodsName}}</view>
-                            <!-- <view class="joins">
-								<image class="zan" src="/static/index/zan.png"></image>
-								<text>110人推荐</text>
-							</view> -->
+                            <view  v-if="item.buyUserNum" class="joins">
+								<image class="people" src="/static/index/people.png"></image>
+								<text>{{ item.buyUserNum }} 人参与</text>
+							</view>
                             <view class="desc">
                                 <view class="left">
                                     <text class="mon_t">¥ {{toFixed(item.standPrice)}}</text>
@@ -865,9 +865,6 @@ export default {
 					background-color: #3577E8;
 				}
 			}
-			// /deep/  .u-tabs {
-			// 	background:none!important;
-			// }
 		}
 		
 		.course-list {

+ 20 - 21
pages/learn/index.vue

@@ -228,7 +228,6 @@ export default {
 		}
 	},
 	onLoad() {
-		console.log('dsfdsf2222222222')
 		// 1668787200 ,2022.22.19的时间戳
 		this.leftDays = 1668787200 - parseInt(curTime/1000)
 		this.getCourseLiveQues()
@@ -236,38 +235,38 @@ export default {
 	async onShow() {
 		await this.commonSystemTime()
 		this.sysTime = +this.$method.timest()
-		console.log('this.sysTime', this.sysTime)
 	},
 	methods: {
 		bgShow(liveTime, watchStatus) {
-			// let curTime = new Date().getTime() // 当前时间的时间戳
 			let value = liveTime * 1000
 			if (curTime > value) { // 判断当前时间和直播开始时间
 				return watchStatus == 'live' ? true : false
 			}
 		},
 		lookTimeStatus(liveTime, watchStatus) {
-			// let curTime = new Date().getTime() // 当前时间的时间戳
-			let value = liveTime * 1000
-			var Y = value.getFullYear()
-			var M = value.getMonth() + 1 < 10 ? '0' + (value.getMonth() + 1) : value.getMonth() + 1
-			var D = value.getDate() < 10 ? '0' + value.getDate() : value.getDate()
-			var valZ = Y + '/' + M + '/' + D
-			let curZeroTime = new Date(valZ).getTime() // 获取开始直播时间当天的零点时间戳
-			if (curTime > value) { // 判断当前时间和直播开始时间
-				if (watchStatus == 'live') { // 
-					return 1
-				} else {
-					return 2
-				}
-			} else {
-				if (curZeroTime <= curTime && curTime <= value) { //当天
-					return 3
+			if (liveTime) {
+				let value = new Date(liveTime * 1000)
+				var Y = value.getFullYear()
+				var M = value.getMonth() + 1 < 10 ? '0' + (value.getMonth() + 1) : value.getMonth() + 1
+				var D = value.getDate() < 10 ? '0' + value.getDate() : value.getDate()
+				var valZ = Y + '/' + M + '/' + D
+				let curZeroTime = new Date(valZ).getTime() // 获取开始直播时间当天的零点时间戳
+				if (curTime > value) { // 判断当前时间和直播开始时间
+					if (watchStatus == 'live') { // 
+						return 1
+					} else {
+						return 2
+					}
 				} else {
-					return 4
+					if (curZeroTime <= curTime && curTime <= value) { //当天
+						return 3
+					} else {
+						return 4
+					}
+					
 				}
-				
 			}
+			
 		},
 		curTimeTamp(liveTime) {
 			let min = liveTime - parseInt(curTime / 1000)

+ 1 - 2
pages3/course/detail.vue

@@ -472,7 +472,6 @@ export default {
 		display: flex;
 		flex-direction: column;
 		justify-content: space-around;
-		border: 1rpx solid;
 	}
 	.prices {
 		.price_sym {
@@ -498,7 +497,7 @@ export default {
 		justify-content: space-between;
 		background-color: #E0E1E2;
 		border-radius: 38rpx;
-		margin: 34rpx 24rpx 24rpx;
+		margin: 24rpx;
 		padding: 0rpx 5rpx;
 		.tab_item {
 			width: 345rpx;