Tang 4 سال پیش
والد
کامیت
03aafffb99
11فایلهای تغییر یافته به همراه259 افزوده شده و 49 حذف شده
  1. 8 0
      common/httpList/plan.js
  2. 1 2
      common/request.js
  3. 170 14
      components/home.vue
  4. 2 0
      main.js
  5. 7 4
      pages/index/index.vue
  6. 8 5
      pages2/bank/detail.vue
  7. 8 5
      pages2/course/detail.vue
  8. 8 5
      pages2/course/keynote.vue
  9. 16 5
      pages2/plan/create.vue
  10. 17 9
      pages2/plan/detail.vue
  11. 14 0
      pages2/wd/coupon.vue

+ 8 - 0
common/httpList/plan.js

@@ -26,4 +26,12 @@ export default {
 			data: data
 		})
 	},
+	//本周用户学习计划
+	userPlanSeven(data) {
+		return myRequest({
+			url: '/plan/userPlanSeven',
+			method: 'get',
+			data: data
+		})
+	},
 }

+ 1 - 2
common/request.js

@@ -1,7 +1,6 @@
 
 const BASE_URL = 'http://192.168.1.222:8088'
- // const BASE_URL = 'http://192.168.1.104:8088' 
-// const BASE_URL = 'https://api.xyyxt.net' 
+ // const BASE_URL = 'https://api.xyyxt.net' 
 // const BASE_URL = 'http://127.0.0.1:8088' 
 // const BASE_URL = 'https://api.xyyxt.net'  //
 import store from '@/store/index.js'

+ 170 - 14
components/home.vue

@@ -31,16 +31,37 @@
 						<view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
 					</view>
 					<view style="width: 100%;display: flex;justify-content:center;margin-top: 40rpx;">
-						<view v-for="(item, index) in date_num" :key="index" class="date_num">{{ item }}</view>
+						<view v-for="(item, index) in date_num" :key="index" class="date_num">
+							<view v-if="item.color == 0" class="date_num_color0" v-show="item.date>0">
+								{{ item.date }}
+								<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+								<view v-if="item.dot" class="date_dot"></view>
+							</view>
+							<view v-if="item.color == 1" class="date_num_color1">
+								{{ item.date }}
+								<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+								<view v-if="item.dot" class="date_dot"></view>
+							</view>
+							<view v-if="item.color == 2" class="date_num_color2">
+								{{ item.date }}
+								<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+								<view v-if="item.dot" class="date_dot"></view>
+							</view>
+							<view v-if="item.color == 3" class="date_num_color3">
+								{{ item.date }}
+								<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+								<view v-if="item.dot" class="date_dot"></view>
+							</view>
+						</view>
 					</view>
-					<view style="width: 100%;margin-top: 20rpx;" v-if="false">
+					<view style="width: 100%;margin-top: 20rpx;" v-if="workList.length>0" >
 						<u-row gutter="16">
 							<u-col span="2" text-align="center">
-								<view><image src="/static/left.png" class="arr-icon"></image></view>
+								<view><image src="/static/left.png" class="arr-icon" @click="preveItem"></image></view>
 							</u-col>
-							<u-col span="8" text-align="center"><view class="course_title">二级建造师市政公用工程</view></u-col>
+							<u-col span="8" text-align="center"><view class="course_title" @click="jumpCourseDetail()">{{ courseItem.courseName }}</view></u-col>
 							<u-col span="2" text-align="center">
-								<view><image src="/static/right.png" class="arr-icon"></image></view>
+								<view><image src="/static/right.png" class="arr-icon" @click="nextItem"></image></view>
 							</u-col>
 						</u-row>
 					</view>
@@ -120,6 +141,11 @@ export default {
 	name: 'home',
 	data() {
 		return {
+			courseItem:{},
+			courseIndex:0,
+			vertical:"vertical",
+			workList: [],
+			workTextList: [],
 			show: false,
 			tab_list: [
 				{
@@ -167,17 +193,97 @@ export default {
 		this.windowHeight = uni.getSystemInfoSync().windowHeight;
 		this.initList();
 		this.advertisingList();
-		// d是当前星期一的日期对象
-		var d=this.getMonDate();
-		var arr=[];
-		for(var i=0; i<7; i++)
-		{
-			this.date_num.push(d.getDate())
-			d.setDate(d.getDate()+1);
-		}
-		console.log(arr)
+		
 	},
 	methods: {
+		init(){
+			if(!this.$method.isLogin()){
+				//未登录
+				this.date_num = []
+				this.workList = []
+				this.initDay()
+			}else{
+				this.date_num = []
+				this.workList = []
+				this.userPlanSeven()
+			}
+		},
+		initDay(){
+			// d是当前星期一的日期对象
+			var d=this.getMonDate();
+			var arr=[];
+			let date = new Date();
+			let num = date.getDate();
+			for(var i=0; i<7; i++)
+			{
+				let item = {date:d.getDate()}
+				item.color = 0
+				if(d.getDate()==num){
+					item.color = 3;
+				}
+				this.date_num.push(item)
+				d.setDate(d.getDate()+1);
+			}
+			console.log(this.date_num,66)
+		},
+		preveItem(){
+			if(self.courseIndex>0){
+				self.courseIndex  = self.courseIndex-1
+				self.courseItem = self.workList[self.courseIndex]
+			}
+		},
+		nextItem(){
+			if(self.courseIndex<self.workList.length-1){
+				self.courseIndex  = self.courseIndex+1
+				self.courseItem = self.workList[self.courseIndex]
+			}
+		},
+		jumpCourseDetail(){
+			this.$navTo.togo('/pages2/course/detail', {
+				id: this.courseItem.courseId
+			});
+		},
+		noticeBar(index){
+			let item = this.workList[index]
+			this.$navTo.togo('/pages2/course/detail', {
+				id: item.courseId
+			});
+		},
+		userPlanSeven() {
+			let self = this;
+			this.$api.userPlanSeven().then(result => {
+				if(result.data.data.coursePlanVo!=null){
+					self.workList = result.data.data.coursePlanVo;
+					if(self.workList!=null&&self.workList.length>0){
+						self.courseItem = self.workList[self.courseIndex]
+					}
+					let date = new Date();
+					let num = date.getDate();
+					let list = result.data.data.calendarStudyVo[0].dayStudyList;
+					for(let i = 0; i < list.length; i++) {
+					    let item = list[i]
+						item.color = 0
+						if (item.date == num) {
+							item.color = 3;
+						}
+						if (item.perform == 1) {
+							item.color = 1;
+						}
+						if (item.perform == 2) {
+							item.color = 2;
+						}
+						item.note = item.studyCourseKnob
+						if(item.note>0){
+							item.dot = true
+						}
+						self.date_num.push(item)
+					}
+				}else{
+					self.initDay()
+				}
+				 
+			});
+		},
 		getMonDate()
 		{
 			var d=new Date(),
@@ -384,11 +490,61 @@ export default {
 .u-row {
 	margin: 40rpx 0;
 }
+.date_dot {
+	width: 6rpx;
+	height: 6rpx;
+	background: #ffcc00;
+	border-radius: 50%;
+	margin: 0 auto;
+}
+.date_note {
+	border-radius: 50%;
+	width: 29rpx;
+	height: 29rpx;
+	border: 1px solid #ffcc00;
+	font-size: 18rpx;
+	color: #ffcc00;
+	text-align: center;
+	display: inline-block;
+	position: absolute;
+	top: -19rpx;
+	right: 9rpx;
+}
+.circle_num {
+	border-radius: 50%;
+	width: 29rpx;
+	height: 29rpx;
+	border: 1px solid #ffcc00;
+	font-size: 18rpx;
+	color: #ffcc00;
+	text-align: center;
+	display: inline-block;
+	margin: 5rpx;
+}
 .date_num {
 	width: 14%;
 	text-align: center;
+	position: relative;
+	display: inline-block;
+	margin-top: 20rpx;
+}
+.date_num_color0 {
+	color: #32467b;
+}
+.date_num_color1 {
 	color: #34c759;
 }
+.date_num_color2 {
+	color: #ff3b30;
+}
+.date_num_color3 {
+	color: #ffffff;
+	background-color: #ffcc00;
+	border-radius: 50%;
+	width: 40rpx;
+	height: 40rpx;
+	display: inline-block;
+}
 .card_date {
 	width: 14%;
 	text-align: center;

+ 2 - 0
main.js

@@ -15,6 +15,8 @@ Vue.prototype.$navTo = navTo
 import method from '@/common/methodTool'
 Vue.prototype.$method = method
 
+//import share from '@/js_sdk/share.js'
+//Vue.mixin(share)
 import uView from "uview-ui";
 Vue.use(uView);
 

+ 7 - 4
pages/index/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<home v-show="current == 0"></home>
+		<home v-show="current == 0" ref="home"></home>
 		<my v-show="current == 1" ref="refMy"></my>
 
 		<u-tabbar v-model="current" :list="list" active-color="#2F4379" :before-switch="beforeSwitch"></u-tabbar>
@@ -36,11 +36,14 @@ export default {
 		};
 	},
 	onLoad(option) {},
-	onShow() {},
-	onShareAppMessage: function(res) {
+	onShow() {
+		this.$refs.home.init();
+	},
+	onShareAppMessage(res) {
+		var self = this;
 		return {
 			title: '中正',
-			path: `/pages/index/index?inviteCode`
+			path: `/pages/index/index`,
 		};
 	},
 	methods: {

+ 8 - 5
pages2/bank/detail.vue

@@ -326,11 +326,14 @@ export default {
 				possessId: this.id,
 				typeId: 2
 			}
-			this.$api.systemuserowner(data).then(res => {
-				if(res.data.code === 200){
-				self.payStatus = res.data.data.payStatus
-				}
-			})
+			if (this.$method.isLogin()) {
+				this.$api.systemuserowner(data).then(res => {
+					if(res.data.code === 200){
+					self.payStatus = res.data.data.payStatus
+					}
+				})
+			}
+			
 		},
 		//提交订单
 		getorder(){

+ 8 - 5
pages2/course/detail.vue

@@ -385,11 +385,14 @@ export default {
 				possessId: this.id,
 				typeId: 1
 			};
-			this.$api.systemuserowner(data).then(res => {
-				if (res.data.code === 200) {
-					self.payStatus = res.data.data.payStatus;
-				}
-			});
+			if (this.$method.isLogin()) {
+				this.$api.systemuserowner(data).then(res => {
+					if (res.data.code === 200) {
+						self.payStatus = res.data.data.payStatus;
+					}
+				});
+			}
+			
 		},
 		//提交订单
 		getorder() {

+ 8 - 5
pages2/course/keynote.vue

@@ -226,11 +226,14 @@
 					possessId: this.id,
 					typeId: 3
 				}
-				this.$api.systemuserowner(data).then(res => {
-					if(res.data.code === 200){
-					self.payStatus = res.data.data.payStatus
-					}
-				})
+				if (this.$method.isLogin()) {
+					this.$api.systemuserowner(data).then(res => {
+						if(res.data.code === 200){
+						self.payStatus = res.data.data.payStatus
+						}
+					})
+				}
+				
 			},
 			//提交订单
 			getorder(){

+ 16 - 5
pages2/plan/create.vue

@@ -36,7 +36,7 @@
 				</u-form-item>
 			</u-form>
 		</view>
-		<u-calendar v-model="calendar_show" :mode="calendar" @change="change" :max-date="maxDate"></u-calendar>
+		<u-calendar v-model="calendar_show" :min-date="minDate" :mode="calendar" @change="change" :max-date="maxDate"></u-calendar>
 		<!-- 弹框-->
 		<u-popup v-model="week_show" mode="bottom">
 			<view style="height: 400rpx;text-align: center">
@@ -91,7 +91,7 @@ export default {
 				time: '20:30',
 				startDate: '2021-05-07',
 				endDate: '2021-05-31',
-				week: '一'
+				week: '一,三,五'
 			},
 			calendar: 'range',
 			list: [],
@@ -99,6 +99,7 @@ export default {
 			show: false,
 			calendar_show: false,
 			maxDate: '2023-01-01',
+			minDate:'',
 			list3: [
 				{
 					name: '一',
@@ -149,8 +150,9 @@ export default {
 		};
 	},
 	onLoad(option) {
-		this.form.startDate = this.$method.timestampToTime(new Date().getTime() / 1000);
-		this.form.endDate = this.$method.timestampToTime(new Date().getTime() / 1000 + 24 * 3600 * 10);
+		this.minDate = this.$method.timestampToTime(new Date().getTime() / 1000);
+		this.form.startDate = this.minDate;
+		this.form.endDate = this.$method.timestampToTime(new Date().getTime() / 1000 + 24 * 3600 * 30);
 		this.getMyCourse();
 	},
 	onShow() {},
@@ -208,7 +210,16 @@ export default {
 				if (result.data.code == 200) {
 					uni.showModal({
 						title: '提示',
-						content: '提交成功'
+						content: '提交成功',
+						success: function(resst) {
+							uni.navigateBack()
+						}
+					});
+				}else{
+					uni.showToast({
+						title: result.data.msg,
+						icon: 'none',
+						duration: 2000
 					});
 				}
 				console.log(result);

+ 17 - 9
pages2/plan/detail.vue

@@ -167,6 +167,9 @@ export default {
 		this.date_use = this.date_num;
 	},
 	onShow() {
+		this.workList = []
+		this.showDayList = []
+		this.calendarStudyVo = {}
 		this.getList();
 	},
 	methods: {
@@ -176,9 +179,10 @@ export default {
 				planId: option.planId,
 				status: 0
 			};
+			let self = this
 			this.$api.planupdateGenerate(data).then(res => {
-				this.getList();
-			});
+				self.getList()
+			})
 		},
 		swipeMonth(index) {
 			this.isOpen = false;
@@ -296,14 +300,18 @@ export default {
 					item.show = 'none';
 				});
 				self.list = result.data.data;
-				self.listItem = self.list[0];
-				self.dealMonth();
-				//			self.calendarStudyVo = result.data.data[0].calendarStudyVo[1];
-				if (self.list.length > 0) {
-					self.listItem = self.list[0];
-					self.dealMonth();
-					self.havePlan = true;
+				if(result.data.data.length>0){
+					self.listItem = self.list[0]
+					self.dealMonth()
+					if(self.list.length>0){
+						self.listItem = self.list[0]
+						self.dealMonth()
+						self.havePlan = true
+					}
+				}else{
+					self.havePlan = false
 				}
+
 			});
 		},
 		newPlan() {

+ 14 - 0
pages2/wd/coupon.vue

@@ -192,6 +192,20 @@ export default {
 				self.items[1] = '折扣券(' + res.data.total + ')';
 			});
 		},
+		onReachBottom() {
+			if (this.current == 0) {
+				if (this.list1.length < this.paramList[0].total) {
+					this.paramList[0].pageNum++;
+					this.getList1()
+				}
+			}
+			if (this.current == 1) {
+				if (this.list1.length < this.paramList[1].total) {
+					this.paramList[1].pageNum++;
+					this.getList2()
+				}
+			}
+		},
 		getList3() {
 			let self = this;
 			let param = this.userParamList[0];