he2802 3 yıl önce
ebeveyn
işleme
41382c8cb5

+ 1 - 0
.gitignore

@@ -16,3 +16,4 @@ selenium-debug.log
 *.ntvs*
 *.njsproj
 *.sln
+.hbuilderx

+ 3 - 1
common/api.js

@@ -5,6 +5,7 @@ import userInfo from './httpList/userInfo.js'
 import wxpay from './httpList/wxpay.js'
 import system from './httpList/system.js'
 import goods from './httpList/goods.js'
+import business from './httpList/business.js'
 export default {
 	...login,
 	...polyvVideo,
@@ -12,5 +13,6 @@ export default {
 	...userInfo,
 	...system,
 	...wxpay,
-	...goods
+	...goods,
+	...business
 }

+ 29 - 0
common/httpList/business.js

@@ -0,0 +1,29 @@
+import {
+	myRequest
+} from '../request.js'
+export default {
+	educationTypeList(data) {
+		return myRequest({
+			url: '/app/common/course/educationType/list',
+			method: 'get',
+			data: data,
+			noToken: true
+		})
+	},
+	businessList(data) {
+		return myRequest({
+			url: '/app/common/course/business/list',
+			method: 'get',
+			data: data,
+			noToken: true
+		})
+	},
+	subjectList(data) {
+		return myRequest({
+			url: '/app/common/course/subject/list',
+			method: 'get',
+			data: data,
+			noToken: true
+		})
+	}
+}

+ 7 - 1
common/httpList/goods.js

@@ -9,6 +9,12 @@ export default {
 			data: data,
 			noToken: true
 		})
+	},
+	goodsDetail(data) {
+		return myRequest({
+			url: '/app/common/goods/'+ data,
+			method: 'get',
+			noToken: true
+		})
 	}
-	
 }

+ 8 - 0
common/methodTool.js

@@ -2,6 +2,14 @@ import store from '@/store/index.js'
 import * as baseUrls from '@/common/request.js'
 // export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'
 export default {
+	isGoLogin() {
+		if (!uni.getStorageSync('user_account')) {
+			uni.navigateTo({url:'/pages/login/login'});
+			return true;
+		} else {
+			return false
+		}
+	},
 	isLogin() {
 		if (uni.getStorageSync('user_account')) {
 			return true;

+ 1 - 1
manifest.json

@@ -75,7 +75,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx57536ef2a9a48f42",
+        "appid" : "wx8295c6fa6b0b3106",
         "setting" : {
             "urlCheck" : false,
             "postcss" : true,

+ 205 - 20
pages/course/index.vue

@@ -1,36 +1,37 @@
 <template>
-	<view>
+	<view >
 		<u-navbar :is-back="false" title="选课中心" :border-bottom="false"  title-color="#333333" back-icon-color="#ffffff">
 			<view class="slot-wrap">
 				<image  src="/static/logo2.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image>
 			</view>
 		</u-navbar>
-		<view>
+		<view v-show="!show">
 			<view style="position: fixed;width: 100%;z-index: 999;background-color: #FFFFFF;">
 				<u-line color="#D6D6DB" />
 				<view style="display: flex;justify-content: space-between;height: 78rpx;line-height: 78rpx;padding: 0 30rpx;font-size: 32rpx;">
-					<view style="color: #666666;">考前培训:建造师-二级</view>
-					<view style="color: #007AFF;">重新选择</view>
+					<view style="color: #666666;">{{selObj.eName}}:{{selObj.pName}}-{{selObj.bName}}</view>
+					<view style="color: #007AFF;" @click="openLeft()">重新选择</view>
 				</view>
 				<u-line color="#D6D6DB" />
-				<view>
-					<view style="width: 160px;margin: 0 auto;"><u-tabs :list="list" item-width="150" font-size="24" bar-width="110" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
+				<view style="display: flex;align-items:center;">
+					<view style="margin: 0 auto;"><u-tabs :list="list"  :current="current" @change="change" :scrollable="false"></u-tabs></view>
+				<!--	<view style="width: 160px;margin: 0 auto;"><u-tabs :list="list" item-width="150" font-size="24" bar-width="110" :current="current" @change="change" active-color="#007AFF"></u-tabs></view> -->
 				</view>
 				<u-line color="#D6D6DB" />
 				<view class="menuSel" v-show="current==0">
 					<scroll-view class="r_sliper" scroll-x="true" >
-						<view v-for="(item,index) in array" :key="index" style="margin-right: 20rpx;display:inline-block">
-							<view :class="menuIndex==index?'r_t1':'r_t2'" @click="cMenu(index)">
-								{{item}}
+						<view v-for="(item,index) in sList" :key="index" style="margin-right: 20rpx;display:inline-block">
+							<view :class="paramList[0].subjectId==item.id?'r_t1':'r_t2'" @click="cMenu(item.id)">
+								{{item.subjectName}}
 							</view>
 						</view>
 					</scroll-view>
 				</view>
 				<view class="menuSel" v-show="current==1">
 					<scroll-view class="r_sliper" scroll-x="true" >
-						<view v-for="(item,index) in array" :key="index" style="margin-right: 20rpx;display:inline-block">
-							<view :class="menuIndex1==index?'r_t1':'r_t2'" @click="cMenu1(index)">
-								{{item}}
+						<view v-for="(item,index) in sList" :key="index" style="margin-right: 20rpx;display:inline-block">
+							<view :class="paramList[1].subjectId==item.id?'r_t1':'r_t2'" @click="cMenu1(item.id)">
+								{{item.subjectName}}
 							</view>
 						</view>
 					</scroll-view>
@@ -38,7 +39,7 @@
 			</view>
 			<view v-show="current==0">
 				<view class="listBox">
-					<navigator url="/pages2/course/detail" v-for="(item,index) in list1" :key="index" >
+					<navigator :url="'/pages2/course/detail?id='+item.goodsId" v-for="(item,index) in list1" :key="index" >
 						<view class="itemBox">
 							<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
 							<view style="display: flex;margin-top: 13rpx;">
@@ -56,7 +57,7 @@
 			</view>
 			<view v-show="current==1">
 				<view class="listBox">
-					<navigator url="/pages2/bank/detail" v-for="(item,index) in list2" :key="index" >
+					<navigator :url="'/pages2/bank/detail'+item.goodsId" v-for="(item,index) in list2" :key="index" >
 						<view class="itemBox">
 							<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
 							<view style="display: flex;margin-top: 13rpx;">
@@ -73,6 +74,22 @@
 				</view>
 			</view>
 		</view>
+		<view v-show="show" class="popuBox">
+			<view class="flex-d" >
+				<view class="contentZ">
+					<view class="lzs">
+						<view class="tylsz" v-for="(item, index) in eList" :key="index" @click="item.id === 0 ? activeAll(1) : active1(item)" :class="item.id === selObj.eId ? 'activeStys':''">{{ item.educationName }}</view>
+					</view>
+					<view class="lzs">
+						<view class="tylszB" v-for="(item, index) in bList" :key="index" @click="item.id === 0 ? activeAll(2) : active2(item)" :class="item.id === selObj.bId ? 'activeStys2':''">{{ item.projectName }}-{{ item.businessName }}</view>
+					</view>
+				</view>
+			<!--	<view class="fots">
+					<view class="leftBtns" @click="initLists">重置筛选</view> 
+				
+				</view>-->
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -85,6 +102,7 @@ export default {
 	},
 	data() {
 		return {
+			show:false,
 			list:[
 				{
 					name: '网课'
@@ -103,18 +121,31 @@ export default {
 					pageSize: 10,
 					total: 0,
 					showStatus: 0,
-					goodsType:1
+					goodsType:1,
+					subjectId:0
 				},
 				{
 					pageNum: 1,
 					pageSize: 10,
 					total: 0,
 					showStatus: 0,
-					goodsType:2
+					goodsType:2,
+					subjectId:0
 				}
 			],
 			list1: [],
 			list2: [],
+			eList:[],
+			bList:[],
+			sList:[],
+			selObj:{
+				eName:'',
+				pName:'',
+				bName:'',
+				eId:0,
+				bId:0,
+				pId:0,
+			}
 		};
 	},
 	onPullDownRefresh(){
@@ -125,9 +156,74 @@ export default {
 		},500)
 	},
 	onLoad(option) {
+		let eduStr = uni.getStorageSync('eduObj')
+		if(eduStr){
+			this.selObj = JSON.parse(eduStr)
+			this.subjectList({businessId:this.selObj.bId,projectId:this.selObj.pId,educationId:this.selObj.eId})
+			this.mergeBusiness()
+		}else{
+			this.show = true
+		}
 		this.initList();
 	},
 	methods: {
+		mergeBusiness(){
+			this.paramList[0].educationTypeId = this.selObj.eId
+			this.paramList[0].businessId = this.selObj.bId
+			this.paramList[0].subjectId = 0
+			this.paramList[1].educationTypeId = this.selObj.eId
+			this.paramList[1].businessId = this.selObj.bId
+			this.paramList[1].subjectId = 0
+		},
+		subjectList(data) {
+			var self = this;
+			this.$api.subjectList(data).then(res => {
+				if(res.data.code==200){
+					self.sList = res.data.rows
+					let allItem = {id:0,subjectName:'全部'}
+					self.sList.unshift(allItem)
+				}
+			});
+		},
+		active2(item){
+			this.selObj.bId = item.id
+			this.show = false
+			this.selObj.pId = item.projectId
+			this.selObj.bName = item.businessName
+			this.selObj.pName = item.projectName
+			uni.setStorageSync('eduObj', JSON.stringify(this.selObj));
+			this.subjectList({businessId:item.id,projectId:item.projectId,educationId:this.selObj.eId})
+			this.mergeBusiness()
+			//初始化
+			this.initList();
+		},
+		businessList(data) {
+			var self = this;
+			this.$api.businessList(data).then(res => {
+				if(res.data.code==200){
+					self.bList = res.data.rows
+				}
+			});
+		},
+		active1(item){
+			this.selObj.eId = item.id
+			this.selObj.eName = item.educationName
+			this.businessList({educationId:item.id})
+		},
+		educationList() {
+			var self = this;
+			this.$api.educationTypeList().then(res => {
+				if(res.data.code==200){
+					self.eList = res.data.rows
+					if(self.selObj.eId){
+						self.businessList({educationId:self.selObj.eId})
+					}
+				}
+			});
+		},
+		openLeft(){
+			this.show = true
+		},
 		initList() {
 			this.paramList[0].pageNum = 1
 			this.paramList[1].pageNum = 1
@@ -135,12 +231,21 @@ export default {
 			this.list2 = []
 			this.courseList();
 			this.bankList();
+			this.educationList()
 		},
 		cMenu(index){
-			this.menuIndex = index;
+			this.paramList[0].pageNum = 1
+			this.paramList[0].subjectId= index;
+			this.list1 = []
+		//	this.menuIndex 
+			this.courseList();
 		},
 		cMenu1(index){
-			this.menuIndex1 = index;
+			this.paramList[1].pageNum = 1
+			this.paramList[1].subjectId= index;
+			this.list2 = []
+		//	this.menuIndex1 = index;
+			this.bankList();
 		},
 		change(index){
 			this.current = index;
@@ -171,7 +276,6 @@ export default {
 		},
 	},
 	onReachBottom() {
-		console.log(34535)
 		if (this.current == 0) {
 			if (this.list1.length < this.paramList[0].total) {
 				this.paramList[0].pageNum++;
@@ -200,6 +304,87 @@ export default {
 	
 </style>
 <style scoped>
+	.popuBox{
+		position: fixed;
+		width: 100%;
+		height: 100%;
+		background-color: #FFFFFF;
+	}
+	.activeStys2{
+		background: #007AFF !important;
+		color: #FFFFFF;
+	}
+	.tylszB{
+		height: 66rpx;
+		line-height: 66rpx;
+		background: #FFFFFF;
+		border: 2rpx solid #EEEEEE;
+		border-radius: 16rpx;
+		padding: 0 10rpx;
+		margin-top: 15rpx;
+	}
+	.activeStys{
+		background: linear-gradient(90deg, rgba(1,94,234,0.2),rgba(255,255,255,.6));
+		border-radius: 16rpx;
+		color: #007AFF!important;
+	}
+	.tylsz{
+		height: 66rpx;
+		line-height: 66rpx;
+		color: #666;
+		font-weight: 400;
+
+		font-weight: bold;
+		padding:0 30rpx;
+		margin-top: 15rpx;
+	}
+	.popup_t1 {
+		padding-left: 35rpx;
+		border-bottom: 1rpx solid #eee;
+		height: 57rpx;
+		margin-top: 86rpx;
+		font-weight: bold;
+		color: #007AFF;
+		font-size: 30rpx;
+	}
+	.flex-d {
+		height: 130%;
+		background-color: #FFFFFF;
+		padding: 0 5%;
+		font-size: 30rpx;
+	}
+	.contentZ {
+		overflow-y: auto;
+		display: flex;
+		
+		padding: 10rpx;
+	}
+	.contentZ::-webkit-scrollbar {
+		display: none;
+	}
+	.fots {
+		height: 100rpx;
+		display: flex;
+		align-items: center;
+		justify-content: space-around;
+		border-top: 1rpx solid #eee;
+	}
+	.leftBtns {
+		font-size: 30rpx;
+		color: #007AFF;
+		font-weight: 500;
+	}
+	.right_Btns {
+		font-size: 30rpx;
+		color: #fff;
+		background-color: #007AFF;
+		border-radius: 24rpx;
+		height: 60rpx;
+		line-height: 60rpx;
+		text-align: center;
+		padding: 0rpx 23rpx;
+		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+	}
 	.blackFont{
 		color: #333333;
 		margin: 0 4rpx;
@@ -251,7 +436,7 @@ export default {
 		background-color: #EAEEF1;
 		padding: 30rpx;
 		position: relative;
-		top: 240rpx;
+		top: 235rpx;
 	}
 	.menuSel{
 		width: 100%;

+ 6 - 0
pages2/bank/detail.vue

@@ -65,9 +65,15 @@ export default {
 	},
 	methods: {
 		buy(){
+			if(this.$method.isGoLogin()){
+				return
+			}
 			this.$navTo.togo('/pages2/order/confirm_list');
 		},
 		addCart(){
+			if(this.$method.isGoLogin()){
+				return
+			}
 			uni.showToast({
 			    title: '添加成功',
 			    duration: 1000

+ 27 - 9
pages2/course/detail.vue

@@ -2,11 +2,11 @@
 	<view>
 		<view style="background-color: #FFFFFF;">
 			<view >
-				<image src="/static/login_bg.jpg" style="height: 461rpx;width: 100%;"></image>
+				<image :src="$method.splitImgHost(detail.coverUrl)" style="height: 461rpx;width: 100%;"></image>
 				<view style="padding:20rpx">
 					<view style="display: flex;margin-top: 13rpx;">
-						<view class="yearTag">2020</view>
-						<view class="titleTag">2020年二建建筑工程管理与实务(实务专题班)</view>
+						<view class="yearTag">{{detail.year}}</view>
+						<view class="titleTag">{{detail.goodsName}}</view>
 					</view>
 					<view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
 						<view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
@@ -23,12 +23,11 @@
 		</view>
 		<view style="padding: 20rpx;">
 			<view class="content">
-				10月18日起,每周一20:00上直播课,课程持续到
-				10月30日止。
+				<view v-html="detail.mobileDetailHtml"></view>
 			</view>
 		</view>
 		<view class="bottomBox">
-			<view class="priceTag">¥ 999.00</view>
+			<view class="priceTag">¥ {{detail.standPrice}}</view>
 			<view style="display: flex;color: #FFFFFF;align-items: center;">
 				<view class="btn1" @click="addCart">加购物车</view>
 				<view class="btn2" @click="buy">立即购买</view>
@@ -42,6 +41,7 @@ import { mapGetters } from 'vuex';
 export default {
 	data() {
 		return {
+			id:0,
 			list: [
 				{
 					name: '详情'
@@ -50,7 +50,9 @@ export default {
 					name: '大纲'
 				}
 			],
-			current:0
+			current:0,
+			detail:{}
+					
 		};
 	},
 	onUnload() {
@@ -58,16 +60,33 @@ export default {
 	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
-
+		this.id = option.id;
+		this.getDetail()
 	},
 	onShow() {
 		
 	},
 	methods: {
+		getDetail() {
+			let self = this
+			this.$api.goodsDetail(this.id).then(res => {
+				console.log(res)
+				if(res.data.code==200){
+					self.detail = res.data.data
+					console.log(self.detail.mobileDetailHtml)
+				}
+			});
+		},
 		buy(){
+			if(this.$method.isGoLogin()){
+				return
+			}
 			this.$navTo.togo('/pages2/order/confirm_list');
 		},
 		addCart(){
+			if(this.$method.isGoLogin()){
+				return
+			}
 			uni.showToast({
 			    title: '添加成功',
 			    duration: 1000
@@ -91,7 +110,6 @@ export default {
 <style scope>
 	.content{
 		background-color: #FFFFFF;
-
 	}
 	.btn2{
 		width: 200rpx;