liukang 2 năm trước cách đây
mục cha
commit
e75b0a68d9
4 tập tin đã thay đổi với 117 bổ sung242 xóa
  1. 16 0
      manifest.json
  2. 71 221
      pages/detail/detail.vue
  3. 29 18
      pages/index/index.vue
  4. 1 3
      static/js/api.js

+ 16 - 0
manifest.json

@@ -1,6 +1,22 @@
 {
     "name" : "rrx-H5",
     "appid" : "__UNI__A6486CD",
+	"h5": {
+		"devServer": {
+			"port": 80,
+			"disableHostCheck": true,
+			"proxy": {
+				"/api": {
+					"target": "https://daydayu.com",
+					"changeOrigin": true,
+					"secure":false,
+					"pathRewrite": {
+						"^/api": ""
+					}
+				}
+			}
+		}
+	},
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 71 - 221
pages/detail/detail.vue

@@ -10,114 +10,112 @@
 		</view>
 		<view class="video">
 			<view class="top_label hflex acenter jcenter">會員免費試看此課程,立即下載APP註冊</view>
-			<video :src="video"></video>
+			<video :src="pageData.video"></video>
 		</view>
 		<view class="box">
-			<view class="box_title">香港中小企業網絡轉型全面實戰課程-自家網店篇-來自學者半島鐵幕的贈言(廣東話-自家網店)<span class="title_text">線上課程</span></view>
+			<view class="box_title">{{pageData.title}}<span class="title_text">線上課程</span></view>
 			<view class="hflex acenter">
-				<image class="avatar" :src="pageData.avatar"></image>
+				<image class="avatar" :src="pageData.headimg"></image>
 				<view class="user_name">{{pageData.name}}</view>
 			</view>
-			<view class="info">{{pageData.intro}}</view>
+			<!-- <view class="info">{{pageData.intro}}</view> -->
 			<view class="hflex acenter ">
-				<view class="text_style1">{{pageData.score}}評分</view>
-				<u-rate count="5" v-model="pageData.score" active-color="#f7b500"></u-rate>
-				<image src="/static/image/index1/watch.png" style="margin: 0 1rpx 0 2rpx;width: 32rpx;height: 32rpx;"></image>
-				<view class="text_style1">{{pageData.watch}}觀看</view>
+				<view class="text_style1">{{evaluate.evaluate_avg}}評分</view>
+				<u-rate count="5" v-model="evaluate.evaluate_avg" active-color="#f7b500"></u-rate>
+				<!-- <image src="/static/image/index1/watch.png" style="margin: 0 1rpx 0 2rpx;width: 32rpx;height: 32rpx;"></image>
+				<view class="text_style1">{{pageData.target_num}}觀看</view> -->
 			</view>
 			<view class=" hflex aend">
 				<view class="text_blue">HK $ </view>
-				<view class="price">{{pageData.price_now}}</view>
-				<view class="text_style1 line">HK ${{pageData.price_old}}</view>
+				<view class="price">{{pageData.price}}</view>
+				<view class="text_style1 line">HK ${{pageData.original_price}}</view>
 				<view class="text_style1" style="font-size: 28rpx;padding-left: 20rpx;"> {{pageData.discount}}折扣</view>
 			</view>
 			<view class="hflex acenter jcenter buy_btn">立即購買</view>
 			<view class="list">
 				<view class="title" style="padding: 32rpx 0;">你將學會</view>
 				<view class="vflex">
-					<block v-for="(item,index) in pageData.learn" :key="index">
+					<block v-for="(item,index) in pageData.synopsis" :key="index">
 						<view class="hflex acenter" style="padding: 0 0 24rpx;"> 
 							<image src="/static/image/index1/checked.png" class="checked"></image>
-							<view class="checked_text">{{item.name}}</view>
+							<view class="checked_text">{{item}}</view>
 						</view>
 					</block>
 				</view>
 			</view>
 			<view class="title" style="padding: 48rpx 0 32rpx;">此課程包括</view>
 			<view class="hflex acenter fwrap" style="padding: 0 24rpx;">
-				<block v-for="(item,index) in pageData.includes" :key="index">
-					<view class="text_style2">{{item.name}}</view>
+				<block v-for="(item,index) in pageData.include" :key="index">
+					<view class="text_style2">{{item}}</view>
 				</block>
 			</view>
 			<view class="course_content">
 				<view class="course_top hflex acenter jbetween">
 					<view class="course_title">課程內容</view>
-					<view class="title_right">{{pageData.course.chapter_num}}章節·{{pageData.course.unit_num}}單元·總長{{pageData.course.totalDuration}}分鐘</view>
+					<view class="title_right">{{pageData.section_num}}章節·{{pageData.classroom_num}}單元·總長{{pageData.duration}}分鐘</view>
 				</view>
 				<view class="course_list">
-					<block v-for="(item,index) in pageData.course.chapter.slice(0,3)" :key="index">
+					<block v-for="(item,index) in pageData.section_info.slice(0,3)" :key="index">
 						<view class="list_item">
 							<view class="hflex acenter jbetween">
-								<view class="item_left">{{item.name}}</view>
+								<view class="item_left">{{item.section_name}}</view>
 								<view class="hflex acenter" @click="open(index)">
-									<view class="item_right">長度·{{item.length}}分鐘</view>
+									<!-- <view class="item_right">長度·{{item.length}}分鐘</view> -->
 									<u-icon name="arrow-down" color="#000" size="18" v-if="item.open"></u-icon>
 									<u-icon name="arrow-right" color="#000" size="18" v-else></u-icon>
 								</view>
 							</view>
 							<view class="children" v-show="item.open">
-								<block v-for="(item2,index2) in item.children" :key="index2">
+								<block v-for="(item2,index2) in item.element_info" :key="index2">
 									<view class="hflex acenter jbetween" style="padding: 15rpx 0pt 0pt;">
 										<view class="hflex acenter">
-											<image src="/static/image/index1/stop.png" class="stop" v-if="item2.type !== 'zuoye'"></image>
-											<image src="/static/image/index1/task.png" class="stop" v-else></image>
-											<view class="label" v-if="item2.type !== 'zuoye'">單元{{index2 + 1}}-{{item2.name}}</view>
-											<view class="label" v-else>作業{{index2 + 1}}-{{item2.name}}</view>
+											<image src="/static/image/index1/task.png" class="stop" v-if="item2.job_name !== ''"></image>
+											<image src="/static/image/index1/stop.png" class="stop"></image>
+											<view class="label">單元{{index2 + 1}}-{{item2.element_name}}</view>
+											<view class="label" v-if="item2.job_name !== ''">作業1-{{item2.job_name}}</view>
 										</view>
-										<view class="item_right" v-if="item2.length">{{item2.length}}分鐘</view>
+										<view class="item_right">{{item2.time}}分鐘</view>
 									</view>
 								</block>
 							</view>
 						</view>
 					</block>
 					<view class="hflex acenter jcenter" style="padding-top: 32rpx;">
-						<view class="hflex acenter jcenter list_btn">還有{{pageData.course.chapter_num - 3}}章節</view>
+						<view class="hflex acenter jcenter list_btn">還有{{pageData.section_num - 3}}章節</view>
 					</view>
 				</view>
 				
 			</view>
 			<view class="title" style="padding: 48rpx 0 32rpx;">課程要求和說明</view>
 			<view class="vflex">
-				<block v-for="(item,index) in pageData.requir" :key="index">
-					<view class="text_style2" style="width: 100%;">{{item.name}}</view>
-				</block>
-				<view class="hflex acenter jcenter">
+				<u-parse :content="pageData.detail"></u-parse>
+				<!-- <view class="hflex acenter jcenter">
 					<view class="show_btn hflex acenter jcenter">顯示更多</view>
-				</view>
+				</view> -->
 			</view>
 			<view class="course_content">
 				<view class="course_top hflex acenter jbetween">
 					<view class="hflex acenter">
 						<u-icon name="star-fill" color="#f7b500" size="21"></u-icon>
-						<view class="score_text">{{pageData.score}}</view>
+						<view class="score_text">{{evaluate.evaluate_avg}}</view>
 						<view class="score_text" style="font-size: 24rpx;">課程評分</view>
 					</view>
 				</view>
 				<view class="course_list">
-					<block v-for="(item,index) in pageData.evaluate.slice(0,3)" :key="index">
+					<block v-for="(item,index) in evaluate.evaluate_list.slice(0,3)" :key="index">
 						<view class="list_item hflex acenter">
-							<image :src="item.avatar" class="item_avatar"></image>
+							<image :src="item.headimg" class="item_avatar"></image>
 							<view class="img_right">
 								<view class="hflex acenter">
 									<view class="item_name2">{{item.name}}</view>
-									<u-rate count="5" v-model="item.score" active-color="#f7b500"></u-rate>
+									<u-rate count="5" v-model="item.content" active-color="#f7b500"></u-rate>
 								</view>
 								<view class="text_content">{{item.content}}</view>
 							</view>
 						</view>
 					</block>
 					<view class="hflex acenter jcenter" style="padding-top: 32rpx;">
-						<view class="hflex acenter jcenter list_btn">顯示更多</view>
+						<view class="hflex acenter jcenter list_btn">{{evaluate.evaluate_list.length == 0? '暫無評分' : '顯示更多'}}</view>
 					</view>
 				</view>
 			</view>
@@ -139,205 +137,56 @@
 	export default {
 		data() {
 			return {
-				video: 'https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4',
 				pageData: {
-					avatar: '',
-					name: '環球功課教育團隊',
-					intro: '半宅職業18歲放棄香港大學錄取·踏入社會由低做起·曾經深深崇尚文憑資質…',
-					score: '4.9',
-					watch: '195',
-					price_now: '299.00',
-					price_old: 599,
-					discount: '66%',
-					learn: [
-						{
-							name: '12章節課程'
-						},
-						{
-							name: '永久訪問權限'
-						},
-						{
-							name: '12章節課程'
-						},
-						{
-							name: '永久訪問權限'
-						},
-						{
-							name: '三套練習測試'
-						},
-						{
-							name: '移動端和手機端觀看'
-						}
-					],
-					includes: [
-						{
-							name: '12章節課程'
-						},
-						{
-							name: '三套練習測試'
-						},
-						{
-							name: '永久訪問權限'
-						},
-						{
-							name: '移動端和手機端觀看'
-						},
-						{
-							name: '結業證書'
-						}
-					],
-					course: {
-						chapter_num: 14,
-						unit_num: 23,
-						totalDuration: 120,
-						chapter: [
-							{
-								name: '第一章·章節名稱',
-								length: '84',
-								children: [
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是名稱',
-										type: 'zuoye'
-									}
-								]
-							},
-							{
-								name: '第二章·章節名稱',
-								length: '84',
-								children: [
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									}
-								]
-							},
-							{
-								name: '第三章·章節名稱',
-								length: '84',
-								children: [
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									}
-								]
-							},
-							{
-								name: '第四章·章節名稱',
-								length: '84',
-								children: [
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									},
-									{
-										name: '我是單元名稱',
-										length: '4',
-									}
-								]
-							}
-						]
-					},
-					requir: [
-						{
-							name: '自己準備一台電腦;'
-						},
-						{
-							name: '用戶看視頻和做練習;'
-						},
-						{
-							name: '需要安裝部分軟件,用於操作。'
-						},
-						{
-							name: '自己準備一台電腦,用戶看視頻和做練習;'
-						},
-						{
-							name: '需要安裝部分軟件,用於操作。'
-						},
-						{
-							name: '需要安裝部分軟件,用於操作。'
-						},
-					],
-					evaluate: [
-						{
-							avatar: '',
-							name: '班岚',
-							score: '5',
-							content: '不要在你家裏放一件你不知其用,或你認為不美的東西。',
-						},
-						{
-							avatar: '',
-							name: '班岚',
-							score: '5',
-							content: '不要在你家裏放一件你不知其用,或你認為不美的東西。',
-						},
-						{
-							avatar: '',
-							name: '班岚',
-							score: '5',
-							content: '不要在你家裏放一件你不知其用,或你認為不美的東西。',
-						},
-						{
-							avatar: '',
-							name: '班岚',
-							score: '5',
-							content: '不要在你家裏放一件你不知其用,或你認為不美的東西。',
-						},
-						{
-							avatar: '',
-							name: '班岚',
-							score: '5',
-							content: '不要在你家裏放一件你不知其用,或你認為不美的東西。',
-						}
-					]
+					
 				},
 				bottom: {
 					img1: '/static/image/index1/bottom_img1.png',
 					img2: '/static/image/index1/bottom_img2.png',
 					img3: '/static/image/index1/bottom_img3.png',
-				}
+				},
+				evaluate:'',
+				id: ''
 			}
 		},
-		onLoad() {
+		onLoad(options) {
 			that = this
+			that.id = options.id
+			that.getData()
+			that.getEvaluate()
 		},
 		methods: {
+			getData() {
+				$api.req({
+					url: '/api/Online_course/course_detail',
+					data: {
+						id: that.id
+					}
+				}, function(res) {
+					if(res.code == 1) {
+						that.pageData = res.data
+					}
+				})
+			},
+			getEvaluate() {
+				$api.req({
+					url: '/api/Online_course/evaluate_list',
+					data: {
+						page: 1,
+						page_size: 3,
+						course_id: that.id
+					}
+				}, function(res) {
+					if(res.code == 1) {
+						that.evaluate = res.data
+					}
+				})
+			},
 			open(index) {
-				if(that.pageData.course.chapter[index].open) {
-					that.pageData.course.chapter[index].open = false
+				if(that.pageData.section_info[index].open) {
+					that.pageData.section_info[index].open = false
 				} else {
-					that.$set(that.pageData.course.chapter[index],'open',true)
+					that.$set(that.pageData.section_info[index],'open',true)
 				}
 			}
 		},
@@ -427,6 +276,7 @@
 				width: 78rpx;
 				height: 78rpx;
 				margin: 0 12rpx 0 0;
+				border-radius: 50%;
 			}
 			.user_name {
 				font-size: 34rpx;

+ 29 - 18
pages/index/index.vue

@@ -2,18 +2,18 @@
 	<view class="content">
 		<view class="top_bg">
 			<view class="hflex acenter jbetween top">
-				<image src="/static/image/index1/logo.png" class="logo" @click="detail"></image>
+				<image src="/static/image/index1/logo.png" class="logo"></image>
 				<view class="vflex">
 					<view class="top_title">線上課程,直播,活動,求職,補習,一應俱全</view>
 					<view class="top_title2">「Day Day U」APP開啟更多功能</view>
 				</view>
-				<view class="top_btn hflex acenter jcenter">下載</view>
+				<view class="top_btn hflex acenter jcenter" @click="detail">下載</view>
 			</view>
 			<view class="hflex acenter jcenter logo_box">
 				<image src="/static/image/index1/logo.png" class="logo"></image>
 			</view>
 			<view class="banner">
-				<u-swiper :list="bannerList" keyName="url" height="250" @change="changeBanner" @click="clickBanner">
+				<u-swiper :list="bannerList" keyName="logo" height="250" @change="changeBanner" @click="clickBanner">
 					<view slot="indicator" class="indicator">
 						<view class="indicator_dot" v-for="(item,index) in bannerList" :key="index" :class="index === current ? 'indicator_dot--active': ''"> </view>
 					</view>
@@ -72,18 +72,6 @@
 		data() {
 			return {
 				bannerList: [
-					{
-						index: 0,
-						url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg'
-					},
-					{
-						index: 1,
-						url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg'
-					},
-					{
-						index: 2,
-						url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg'
-					}
 				],
 				current: 0,
 				tabs: [
@@ -104,7 +92,7 @@
 						name: '招聘信息'
 					},
 				],
-				video: 'https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4',
+				video: '',
 				pageList: [
 					{
 						img: '/static/image/index1/img1.png',
@@ -171,13 +159,36 @@
 					img1: '/static/image/index1/bottom_img1.png',
 					img2: '/static/image/index1/bottom_img2.png',
 					img3: '/static/image/index1/bottom_img3.png',
-				}
+				},
+				video_id: ''
 			}
 		},
 		onLoad() {
 			that = this
+			that.getBanner()
+			that.getVideo()
 		},
 		methods: {
+			getBanner() {
+				$api.req({
+					url: '/api/Index/banner',
+				}, function(res) {
+					if(res.code == 1) {
+						that.bannerList = res.data
+					}
+				})
+			},
+			getVideo() {
+				$api.req({
+					url: '/api/Index/recommend_course',
+					
+				},function(res) {
+					if(res.code == 1) {
+						that.video = res.data[0].video
+						that.video_id = res.data[0].id
+					}
+				})
+			},
 			changeBanner(e) {
 				that.current = e.current
 			},
@@ -195,7 +206,7 @@
 				}).exec();
 			},
 			detail() {
-				$api.jump('/pages/detail/detail')
+				$api.jump('/pages/detail/detail?id=' + that.video_id)
 			}
 		},
 	}

+ 1 - 3
static/js/api.js

@@ -18,7 +18,7 @@ module.exports = {
 		name: '日日学',
 		debug: false, //开发模式true,生产环境改为false;
 		version: 'xcx',
-		baseUrl: 'https://ship-expert.zhousi.hdlkeji.com',
+		baseUrl: 'https://daydayu.com',
 		qqMap: false,
 		loading: false
 	},
@@ -257,8 +257,6 @@ module.exports = {
 				data: option.data,
 				header: {
 					'content-type': 'application/x-www-form-urlencoded',
-					'api-token': uni.getStorageSync('token').token?uni.getStorageSync('token').token:'',
-					'api-name': 'wxapp'
 				},
 				method: option.method?option.method:'GET',
 				dataType: 'json',