Tang 4 anni fa
parent
commit
cb93e4fb74

+ 3 - 1
common/api.js

@@ -18,6 +18,7 @@ import order from './httpList/order.js'
 import category from './httpList/category.js'
 import coupon from './httpList/coupon.js'
 import isHave from './httpList/isHave.js'
+import task from './httpList/task.js'
 export default {
 	...login,
 	...polyvVideo,
@@ -38,5 +39,6 @@ export default {
 	...order,
 	...category,
 	...coupon,
-	...isHave
+	...isHave,
+	...task
 }

+ 37 - 0
common/httpList/task.js

@@ -0,0 +1,37 @@
+import {
+	myRequest
+} from '../request.js'
+export default {
+	//邀请朋友
+	taskinvitation(data) {
+		return myRequest({
+			url: '/task/invitation',
+			method: 'post',
+			data: data
+		})
+	},
+	//查询任务積分列表
+	taskList(data) {
+		return myRequest({
+			url: '/task/list',
+			method: 'get',
+			data: data
+		})
+	},
+	//每日分享
+	taskShare(data) {
+		return myRequest({
+			url: '/task/share',
+			method: 'post',
+			data: data
+		})
+	},
+	//签到获得积分
+	taskSignIn(data) {
+		return myRequest({
+			url: '/task/signIn',
+			method: 'post',
+			data: data
+		})
+	},
+}

+ 2 - 2
common/request.js

@@ -1,7 +1,7 @@
 
-const BASE_URL = 'http://192.168.1.222:8088'
+// 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' 
 import store from '@/store/index.js'
 import api from './api.js'
 var num = 1

+ 214 - 235
components/my.vue

@@ -1,58 +1,39 @@
 <template>
 	<view>
-		<u-navbar  title="我的" :is-back="false">
-		</u-navbar>
+		<u-navbar title="我的" :is-back="false"></u-navbar>
 		<view class="head">
-			<u-row >
+			<u-row>
 				<u-col span="3" offset="1">
 					<navigator url="/pages2/wd/avatar" hover-class="none">
-						<image :src="userInfo!=null?$method.splitImgHost(userInfo.avatar):''" class="avatar"></image>
+						<image :src="userInfo != null ? $method.splitImgHost(userInfo.avatar) : ''" class="avatar"></image>
 					</navigator>
 				</u-col>
 				<u-col span="6">
 					<view style="display: flex;">
-						<navigator class="name" url="/pages2/wd/avatar" hover-class="none">
-							{{userInfo.nickname}}
-						</navigator>
-						<navigator class="tag" url="/pages2/wd/level" hover-class="none">
-							初出茅庐
-						</navigator>
+						<navigator class="name" url="/pages2/wd/avatar" hover-class="none">{{ userInfo.nickname }}</navigator>
+						<navigator class="tag" url="/pages2/wd/level" hover-class="none">初出茅庐</navigator>
 					</view>
 					<navigator url="/pages2/wd/level" hover-class="none" style="position: relative;margin-top: 20rpx;">
 						<view class="progress_text">0/1000</view>
 						<u-line-progress height="8" active-color="#2F4379" :percent="0" :show-percent="false"></u-line-progress>
 					</navigator>
 				</u-col>
-				<view class="qiandao" @click="qd()" v-if="!isQd">
-					签到
-				</view>
-				<view class="qiandao"  v-if="isQd">
-					已签到
-				</view>
+				<view class="qiandao" @click="qd" v-if="issue === 0">签到</view>
+				<view class="qiandao" v-if="issue === 1">已签到</view>
 			</u-row>
 			<view style="margin-top: 20rpx;">
-				<u-row >
-					<u-col span="4"  text-align="center">
+				<u-row>
+					<u-col span="4" text-align="center">
 						<navigator url="/pages2/wd/collect" hover-class="none">
-							<view class="head_t1">
-								收藏
-							</view>
-							<view class="head_t2">
-								{{collectTotal}}
-							</view>
+							<view class="head_t1">收藏</view>
+							<view class="head_t2">{{ collectTotal }}</view>
 						</navigator>
 					</u-col>
 					<u-col span="4" offset="4" text-align="center">
 						<navigator url="/pages2/wd/ranking" hover-class="none">
-						<view class="head_t1">
-							学习排名
-						</view>
-						<view  class="head_t2" v-if="rank>0">
-							NO.{{rank}}
-						</view>
-						<view  class="head_t2" v-else>
-							暂未上榜
-						</view>
+							<view class="head_t1">学习排名</view>
+							<view class="head_t2" v-if="rank > 0">NO.{{ rank }}</view>
+							<view class="head_t2" v-else>暂未上榜</view>
 						</navigator>
 					</u-col>
 				</u-row>
@@ -63,61 +44,66 @@
 			<view class="record">
 				<view class="r_t1">
 					最近学习记录
-					<u-icon name="arrow-right"  size="28"></u-icon>
+					<u-icon name="arrow-right" size="28"></u-icon>
 				</view>
-				<scroll-view class="r_sliper" scroll-x="true" >
-					<view v-for="(item,index) in list" :key="index" style="margin-right: 20rpx;display:inline-block" @click="jumpDetail(item)">
+				<scroll-view class="r_sliper" scroll-x="true">
+					<view v-for="(item, index) in list" :key="index" style="margin-right: 20rpx;display:inline-block" @click="jumpDetail(item)">
 						<image :src="$method.splitImgHost(item.coverUrl)" class="r_image"></image>
-						<view class="r_t2">
-							{{item.courseName}}
-						</view>
+						<view class="r_t2">{{ item.courseName }}</view>
 					</view>
 				</scroll-view>
 			</view>
 			<!-- 模块-->
 			<view class="module">
-				<u-row >
+				<u-row>
 					<u-col span="3" text-align="center">
 						<navigator url="/pages2/study/index" hover-class="none">
-							<image src="/static/tool_1.png" class="tool_img"></image><view class="tool_t">我的学习</view>
+							<image src="/static/tool_1.png" class="tool_img"></image>
+							<view class="tool_t">我的学习</view>
 						</navigator>
 					</u-col>
 					<u-col span="3" text-align="center">
 						<navigator url="/pages2/wd/menu" hover-class="none">
-							<image src="/static/tool_2.png" class="tool_img"></image><view class="tool_t">基本资料</view>
+							<image src="/static/tool_2.png" class="tool_img"></image>
+							<view class="tool_t">基本资料</view>
 						</navigator>
 					</u-col>
 					<u-col span="3" text-align="center">
 						<navigator url="/pages2/wd/help" hover-class="none">
-							<image src="/static/tool_3.png" class="tool_img"></image><view class="tool_t">助学活动</view>
+							<image src="/static/tool_3.png" class="tool_img"></image>
+							<view class="tool_t">助学活动</view>
 						</navigator>
 					</u-col>
 					<u-col span="3" text-align="center">
 						<navigator url="/pages2/wd/coupon" hover-class="none">
-							<image src="/static/tool_7.png" class="tool_img"></image><view class="tool_t">优惠券</view>
+							<image src="/static/tool_7.png" class="tool_img"></image>
+							<view class="tool_t">优惠券</view>
 						</navigator>
 					</u-col>
 				</u-row>
 				<view style="margin-top: 30rpx;">
-					<u-row >
+					<u-row>
 						<u-col span="3" text-align="center">
 							<navigator url="/pages2/wd/enroll" hover-class="none">
-								<image src="/static/tool_5.png" class="tool_img"></image><view class="tool_t">考试报名</view>
+								<image src="/static/tool_5.png" class="tool_img"></image>
+								<view class="tool_t">考试报名</view>
 							</navigator>
 						</u-col>
 						<u-col span="3" text-align="center">
 							<view @click="jumpPopup">
-								<image src="/static/tool_4.png" class="tool_img"></image><view class="tool_t">成长地图</view>
+								<image src="/static/tool_4.png" class="tool_img"></image>
+								<view class="tool_t">成长地图</view>
 							</view>
 						</u-col>
 					</u-row>
 				</view>
 			</view>
 			<view class="module2">
-				<u-row >
+				<u-row>
 					<u-col span="3" text-align="center">
 						<view @click="jumpPopup">
-							<image src="/static/tool_6.png" class="tool_img"></image><view class="tool_t">异常反馈</view>
+							<image src="/static/tool_6.png" class="tool_img"></image>
+							<view class="tool_t">异常反馈</view>
 						</view>
 					</u-col>
 				</u-row>
@@ -128,198 +114,191 @@
 </template>
 
 <script>
-	import {mapGetters} from 'vuex';
-	export default {
-		name:"my",
-		data() {
-			return {
-				list:[23,24,25,26,27,28,29],
-				content:'此功能暂未开放',
-				show:false,
-				collectTotal:0,
-				isQd:false,
-				rank:0
-			};
+import { mapGetters } from 'vuex';
+export default {
+	name: 'my',
+	data() {
+		return {
+			list: [23, 24, 25, 26, 27, 28, 29],
+			content: '此功能暂未开放',
+			show: false,
+			collectTotal: 0,
+			rank: 0,
+			issue: 0
+		};
+	},
+	mounted() {
+	},
+	methods: {
+		qd() {
+			var self = this
+			var data = {
+				taskType: 0
+			}
+			self.$api.taskSignIn(data).then(res => {
+				if(res.data.code === 200){
+					self.getInfoAttached()
+				}
+			})
 		},
-		mounted(){
-			this.haveQD()
+		jumpDetail(item) {
+			this.$navTo.togo('/pages2/course/detail', {
+				id: item.courseId
+			});
+			return;
 		},
-		methods: {
-			haveQD(){
-				let date = new Date()
-				let num_today = date.getDate()
-				let num = uni.getStorageSync("qd_day");
-				if(num==num_today){
-					this.isQd = true
-				}
-			},
-			qd(){
-				let date = new Date()
-				let num = date.getDate()
-				let key = "qd_day"
-				uni.setStorageSync(key, num);
-				this.isQd = true
-			},
-			jumpDetail(item){
-				this.$navTo.togo('/pages2/course/detail', {
-					id: item.courseId
-				});
-				return;
-			},
-			init(){
-				this.getInfoAttached()
-			},
-			jumpPopup(){
-				this.show = true
-			},
-			getInfoAttached(){
-				let self = this
-				this.$api.appInfoAttached().then(res => {
-					self.collectTotal = res.data.data.collectTotal
-					self.rank = res.data.data.rank
-				});
-				this.studyRecordList()
-			},
-			studyRecordList(){
-				let self = this
-				this.$api.studyRecordList().then(res => {
-					self.list = res.data.rows
-				});
-			},
-			
+		init() {
+			this.getInfoAttached();
 		},
-		computed: {...mapGetters(['userInfo'])}
-	}
+		jumpPopup() {
+			this.show = true;
+		},
+		getInfoAttached() {
+			let self = this;
+			this.$api.appInfoAttached().then(res => {
+				self.collectTotal = res.data.data.collectTotal;
+				self.rank = res.data.data.rank;
+				self.issue = res.data.data.issue
+			});
+			this.studyRecordList();
+		},
+		studyRecordList() {
+			let self = this;
+			this.$api.studyRecordList().then(res => {
+				self.list = res.data.rows;
+			});
+		}
+	},
+	computed: { ...mapGetters(['userInfo']) }
+};
 </script>
 
 <style>
-	::-webkit-scrollbar{
-		width: 0;
-		height: 0;
-		color: transparent;
-	}
+::-webkit-scrollbar {
+	width: 0;
+	height: 0;
+	color: transparent;
+}
 </style>
 <style scoped>
-	.module2{
-		width: 100%;
-		height: 130rpx;
-		background: #FFFFFF;
-		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-		border-radius: 32rpx;
-		margin-top: 30rpx;
-		padding: 30rpx 0;
-	}
-	.tool_t{
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #2F4379;
-	}
-	.tool_img{
-		width: 42rpx;
-		height: 42rpx;
-	}
-	.module{
-		width: 100%;
-		height: 260rpx;
-		background: #FFFFFF;
-		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-		border-radius: 32rpx;
-		margin-top: 30rpx;
-		padding: 30rpx 0;
-	}
-	
-	.r_sliper{
-		padding: 0 20rpx;
-	}
-	.r_t2{
-		font-size: 20rpx;
-		font-family: PingFang SC;
-		font-weight: 400;
-		color: #2F4379;
-	}
-	.r_image{
-		width: 278rpx;
-		height: 134rpx;
-	}
-	.r_t1{
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #2F4379;
-		padding: 20rpx;
-	}
-	.record{
-		width: 100%;
-		height: 260rpx;
-		background: #FFFFFF;
-		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-		border-radius: 32rpx;
-		white-space:nowrap;
-		overflow: hidden;
-	}
-	page {
-		background: #FDFDFD;
-	}
-	.head_t2{
-		font-size: 32rpx;
-		font-family: MF YiHei (Noncommercial);
-		font-weight: bold;
-		color: #2F4379;
-	}
-	.head_t1{
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #2F4379;
-		opacity: 0.6;
-	}
-	.qiandao{
-		float: right;
-		width: 100rpx;
-		height: 40rpx;
-		background: #2F4379;
-		border-radius: 20rpx 0rpx 0rpx 20rpx;
-		color: #FFFFFF;
-		text-align: center;
-	}
-	.progress_text{
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: 800;
-		color: #2F4379;
-		position: relative;
-		top: 15rpx;
-	}
-	.tag{
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #2F4379;
-		margin-left: 30rpx;
-		border: 1px solid #2F4379;
-		border-radius: 20px;
-		padding: 6rpx;
-	}
-	.name{
-		font-size: 32rpx;
-		font-family: PingFang SC;
-		font-weight: 800;
-		color: #2F4379;
-	}
-	.wrap {
-		padding: 24rpx;
-	}
-	.head{
-		padding-top: 30rpx;
-		background-color: #FFFFFF;
-		padding-bottom: 20rpx;
-	}
-	.avatar{
-		width: 140rpx;
-		height: 140rpx;
-		border-radius: 50%;
-	}
-	
-	
+.module2 {
+	width: 100%;
+	height: 130rpx;
+	background: #ffffff;
+	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+	border-radius: 32rpx;
+	margin-top: 30rpx;
+	padding: 30rpx 0;
+}
+.tool_t {
+	font-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #2f4379;
+}
+.tool_img {
+	width: 42rpx;
+	height: 42rpx;
+}
+.module {
+	width: 100%;
+	height: 260rpx;
+	background: #ffffff;
+	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+	border-radius: 32rpx;
+	margin-top: 30rpx;
+	padding: 30rpx 0;
+}
+
+.r_sliper {
+	padding: 0 20rpx;
+}
+.r_t2 {
+	font-size: 20rpx;
+	font-family: PingFang SC;
+	font-weight: 400;
+	color: #2f4379;
+}
+.r_image {
+	width: 278rpx;
+	height: 134rpx;
+}
+.r_t1 {
+	font-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #2f4379;
+	padding: 20rpx;
+}
+.record {
+	width: 100%;
+	height: 260rpx;
+	background: #ffffff;
+	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+	border-radius: 32rpx;
+	white-space: nowrap;
+	overflow: hidden;
+}
+page {
+	background: #fdfdfd;
+}
+.head_t2 {
+	font-size: 32rpx;
+	font-family: MF YiHei (Noncommercial);
+	font-weight: bold;
+	color: #2f4379;
+}
+.head_t1 {
+	font-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #2f4379;
+	opacity: 0.6;
+}
+.qiandao {
+	float: right;
+	width: 100rpx;
+	height: 40rpx;
+	background: #2f4379;
+	border-radius: 20rpx 0rpx 0rpx 20rpx;
+	color: #ffffff;
+	text-align: center;
+}
+.progress_text {
+	font-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: 800;
+	color: #2f4379;
+	position: relative;
+	top: 15rpx;
+}
+.tag {
+	font-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #2f4379;
+	margin-left: 30rpx;
+	border: 1px solid #2f4379;
+	border-radius: 20px;
+	padding: 6rpx;
+}
+.name {
+	font-size: 32rpx;
+	font-family: PingFang SC;
+	font-weight: 800;
+	color: #2f4379;
+}
+.wrap {
+	padding: 24rpx;
+}
+.head {
+	padding-top: 30rpx;
+	background-color: #ffffff;
+	padding-bottom: 20rpx;
+}
+.avatar {
+	width: 140rpx;
+	height: 140rpx;
+	border-radius: 50%;
+}
 </style>

+ 70 - 65
pages/index/index.vue

@@ -1,76 +1,81 @@
 <template>
 	<view>
-		<home v-show="current==0"></home>
-		<my v-show="current==1" ref="refMy"></my>
-		
-		<u-tabbar v-model="current" :list="list" active-color="#2F4379" :before-switch="beforeSwitch" ></u-tabbar>
+		<home v-show="current == 0"></home>
+		<my v-show="current == 1" ref="refMy"></my>
+
+		<u-tabbar v-model="current" :list="list" active-color="#2F4379" :before-switch="beforeSwitch"></u-tabbar>
 	</view>
 </template>
 
 <script>
-	import home from "@/components/home.vue"
-	import my from "@/components/my.vue"
-	import {mapState,mapMutations} from 'vuex';
-	export default {
-		components: {
-			home,my
-		},
-		data() {
-			return {
-				list: [{
-						iconPath: "/static/nav1.png",
-						selectedIconPath: "/static/nav1_on.png",
-						text: '学习中心',
-						customIcon: false,
-					},
-					{
-						iconPath: "/static/nav4.png",
-						selectedIconPath: "/static/nav4_on.png",
-						text: '我的',
-						customIcon: false,
-					},
+import home from '@/components/home.vue';
+import my from '@/components/my.vue';
+import { mapState, mapMutations } from 'vuex';
+export default {
+	components: {
+		home,
+		my
+	},
+	data() {
+		return {
+			list: [
+				{
+					iconPath: '/static/nav1.png',
+					selectedIconPath: '/static/nav1_on.png',
+					text: '学习中心',
+					customIcon: false
+				},
+				{
+					iconPath: '/static/nav4.png',
+					selectedIconPath: '/static/nav4_on.png',
+					text: '我的',
+					customIcon: false
+				}
+			],
+			current: 0
+		};
+	},
+	onLoad(option) {},
+	onShow() {},
+	onShareAppMessage: function(res) {
+		var self = this
+		return {
+			title: '中正',
+			path: `/pages/index/index`,
+			success: function(){
+				if(self.$store.state.userInfo !== null){
+					console.log('已登录')
+				var data = {
+					taskType : 3
+				}
+				self.$api.taskShare(data).then(result => {
 					
-				],
-				current:0
-
-			}
-		},
-		onLoad(option) {
-			
-		},
-		onShow(){
-			
-		},
-		methods: {
-			beforeSwitch(index) {
-				let that = this
-				if(index==this.current){
-					return false
+				})
 				}
-				if(!this.$method.isLogin()){
-					this.$navTo.togo('/pages/login/login');
-					return false
-				}else{
-					if(index==1){
-						this.$refs.refMy.init()
-					}
-					return true
+			}
+		};
+	},
+	methods: {
+		beforeSwitch(index) {
+			let that = this;
+			if (index == this.current) {
+				return false;
+			}
+			if (!this.$method.isLogin()) {
+				this.$navTo.togo('/pages/login/login');
+				return false;
+			} else {
+				if (index == 1) {
+					this.$refs.refMy.init();
 				}
-				
-			},
-			
-		},
-		onReachBottom() {
-			
-		},
-		onPullDownRefresh() {
-		       
-		},
-		computed: {...mapState(['login'])}
-
-	}
+				return true;
+			}
+		}
+	},
+	onReachBottom() {},
+	onPullDownRefresh() {},
+	computed: { ...mapState(['login']) }
+};
 </script>
 
-<style scoped>
-	
-</style>
+<style scoped></style>

+ 58 - 48
pages2/course/detail.vue

@@ -154,7 +154,8 @@
 					<view class="price_t1">¥{{ pageData.price }}</view>
 					<view class="price_t2">¥699</view>
 				</view>
-				<view class="buy" @click="jumpBuy">立即购买</view>
+				<view class="buy" @click="jumpBuy" v-if="payStatus === 0">立即购买</view>
+				<view class="buy" v-if="payStatus === 1" @click="startVideo">立即观看</view>
 			</view>
 		</view>
 		<u-popup v-model="showBox" mode="bottom" border-radius="14">
@@ -337,7 +338,7 @@ export default {
 		});
 		this.getChapter(this.id);
 		this.getcommendList(this.id);
-		this.getHaveThis()
+		this.getHaveThis();
 		let time = uni.getStorageSync('face');
 		if (time) {
 			let nowTime = new Date().getTime() / 1000;
@@ -378,72 +379,80 @@ export default {
 
 	methods: {
 		//检测是否已购买该课程
-		getHaveThis(){
-			var self = this
+		getHaveThis() {
+			var self = this;
 			var data = {
 				possessId: this.id,
 				typeId: 1
-			}
+			};
 			this.$api.systemuserowner(data).then(res => {
-				if(res.data.code === 200){
-				self.payStatus = res.data.data.payStatus
+				if (res.data.code === 200) {
+					self.payStatus = res.data.data.payStatus;
 				}
-			})
+			});
 		},
 		//提交订单
-		getorder(){
-			var self = this
+		getorder() {
+			var self = this;
 			var data = {
-				goodsList: [{
-					goodsId: self.pageData.courseId,
-					num: 1,
-					goodsType: 1
-				}]
-			}
-			if(self.activeCouponId.length !== 0){
-				if(self.activeCouponId[0] === 1){
-					data.couponId = self.activeCouponId[1]
+				goodsList: [
+					{
+						goodsId: self.pageData.courseId,
+						num: 1,
+						goodsType: 1
+					}
+				]
+			};
+			if (self.activeCouponId.length !== 0) {
+				if (self.activeCouponId[0] === 1) {
+					data.couponId = self.activeCouponId[1];
 				}
-				if(self.activeCouponId[0] === 2){
-					data.activityId = self.activeCouponId[1]
+				if (self.activeCouponId[0] === 2) {
+					data.activityId = self.activeCouponId[1];
 				}
 			}
 			self.$api.order(data).then(res => {
-				if(res.data.code === 200){
-					let objarr = res.data.data
+				if (res.data.code === 200) {
+					let objarr = res.data.data;
 					wx.requestPayment({
 						timeStamp: objarr.timeStamp,
 						nonceStr: objarr.nonceStr,
 						package: objarr.package,
 						signType: objarr.signType,
 						paySign: objarr.sign,
-						success (result) {
+						success(result) {
 							uni.showModal({
-							    title: '提示',
-							    content: '支付成功',
+								title: '提示',
+								content: '支付成功',
 								showCancel: false,
-							    success: function (resst) {
-									if(resst.confirm){
-									self.showPricePop = false
-									self.getHaveThis()
+								success: function(resst) {
+									if (resst.confirm) {
+										self.showPricePop = false;
+										self.getHaveThis();
 									}
-							    }
+								}
 							});
 						},
-						fail (err){
+						fail(err) {
 							uni.showModal({
-							    title: '提示',
-							    content: '支付失败',
+								title: '提示',
+								content: '支付失败',
 								showCancel: false,
-							    success: function (resst) {
-									self.showPricePop = false
-									self.getHaveThis()
-							    }
+								success: function(resst) {
+									self.showPricePop = false;
+									self.getHaveThis();
+								}
 							});
 						}
-					})
+					});
+				} else {
+					uni.showToast({
+						title: res.data.msg,
+						icon: 'none',
+						duration: 2000
+					});
 				}
-			})
+			});
 		},
 		//选择卷触发
 		activeCoupon(e) {
@@ -454,7 +463,7 @@ export default {
 		//计算价格
 		async computedPrice(arrs) {
 			var self = this;
-			const aites = await this.$api.courseInfo(this.id)
+			const aites = await this.$api.courseInfo(this.id);
 			self.prices = aites.data.data.price.toFixed(2);
 			if (arrs[0] === 1) {
 				self.configList.forEach((item, index) => {
@@ -478,7 +487,6 @@ export default {
 							self.prices = (self.prices * (item.price * 0.1)).toFixed(2);
 						}
 						if (item.activityType === '2') {
-							
 						}
 						if (item.activityType === '3') {
 							self.prices = item.price.toFixed(2);
@@ -492,7 +500,7 @@ export default {
 					}
 				});
 			}
-			console.log(self.prices)
+			console.log(self.prices);
 		},
 		//优惠卷
 		getConfiguration() {
@@ -823,11 +831,13 @@ export default {
 				key: 'union_id',
 				success: function(res) {
 					// 继续操作
-					self.$api.configurationlistCoupon({
-						courseId: self.id
-					}).then(configL => {
-						self.configList = configL.data.rows;
-					});
+					self.$api
+						.configurationlistCoupon({
+							courseId: self.id
+						})
+						.then(configL => {
+							self.configList = configL.data.rows;
+						});
 					self.$api
 						.configurationlistConfig({
 							courseId: self.id

+ 185 - 17
pages2/index/search.vue

@@ -1,32 +1,200 @@
 <template>
-	<view style="padding: 30rpx;" >
-		<u-search placeholder="搜索" ></u-search>
+	<view style="padding: 30rpx;">
+		<u-search
+			class="changes"
+			placeholder="搜索课程 题库"
+			v-model="searchData"
+			shape="square"
+			:show-action="true"
+			bg-color="#F3F4F6"
+			:adjust-position="false"
+			:focus="true"
+			height="70"
+			action-text="取消"
+			@clear="changeClear"
+			@search="getDatas"
+			@custom="backHome"
+		></u-search>
+		<view class="big_searchBox" v-if="searchStatus">
+			<view class="classword" v-if="list1.length">
+				<view class="titles">课程</view>
+				<view class="listWord">
+					<view class="listA" v-for="(item, index) in list1" :key="index" @click="jumpPage(1,item)">{{ item.courseName }}</view>
+				</view>
+				<view class="moreClassword" v-if="list1.length === 10">
+					<view class="left">查看更多课程</view>
+					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
+				</view>
+			</view>
+			<view class="classword" v-if="list2.length">
+				<view class="titles">题库</view>
+				<view class="listWord">
+					<view class="listA" v-for="(item, index) in list2" :key="index" @click="jumpPage(2,item)">{{ item.bankName }}</view>
+				</view>
+				<view class="moreClassword" v-if="list2.length === 10">
+					<view class="left">查看更多课程</view>
+					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
+				</view>
+			</view>
+			<view class="classword" v-if="list3.length">
+				<view class="titles">重点考点</view>
+				<view class="listWord">
+					<view class="listA" v-for="(item, index) in list3" :key="index" @click="jumpPage(3,item)">{{ item.name }}</view>
+				</view>
+				<view class="moreClassword" v-if="list3.length === 10">
+					<view class="left">查看更多课程</view>
+					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
+				</view>
+			</view>
+			<view v-if="list1.length === 0 && list2.length === 0 && list3.length === 0"><u-empty text="暂无搜索结果" mode="list"></u-empty></view>
+		</view>
+		<view v-else><u-empty text="暂无搜索结果" mode="list"></u-empty></view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-			}
+export default {
+	data() {
+		return {
+			searchData: '',
+			list1: [],
+			list2: [],
+			list3: [],
+			searchStatus: false
+		};
+	},
+	onLoad(option) {},
+	onShow() {},
+	methods: {
+		jumpPage(int,item){
+				if (int == 1) {
+					this.$navTo.togo('/pages2/course/detail', {
+						id: item.courseId
+					});
+					return;
+				}
+				if (int == 2) {
+						this.$navTo.togo('/pages2/bank/detail', {
+							id: item.bankId
+						});
+					return;
+				}
+				if (int == 3) {
+					this.$navTo.togo('/pages2/course/keynote', {
+						id: item.fileId
+					});
+					return;
+				}
 		},
-		onLoad(option) {
-			
+		// 取消
+		backHome() {
+			uni.navigateBack({
+				delta: 1
+			});
 		},
-		onShow(){
+		// 搜索框清空
+		changeClear() {},
+		getDatas() {
+				var self = this;
+				if(this.searchData.length === 0){
+					uni.showToast({
+						title: '请输入搜索内容',
+						icon: 'none'
+					})
+					return
+				}
+				this.gitCourseLists();
+				this.gitBankList();
+				this.gitNoteLists();
 		},
-		methods: {
-			
-		
+		gitCourseLists() {
+			var self = this;
+			this.$api
+				.courselist({
+					courseName: this.searchData,
+					pageNum: 1,
+					pageSize: 10
+				})
+				.then(res => {
+					self.list1 = res.data.rows;
+					if (res.data.rows.length > 0) {
+						self.searchStatus = true;
+					}
+				});
 		},
-		
+		gitBankList() {
+			var self = this;
+			this.$api
+				.banklist({
+					bankName: this.searchData,
+					pageNum: 1,
+					pageSize: 10
+				})
+				.then(res => {
+					self.list2 = res.data.rows;
+					if (res.data.rows.length > 0) {
+						self.searchStatus = true;
+					}
+				});
+		},
+		gitNoteLists() {
+			var self = this;
+			this.$api
+				.notelist({
+					name: this.searchData,
+					pageNum: 1,
+					pageSize: 10
+				})
+				.then(res => {
+					self.list3 = res.data.rows;
+					if (res.data.rows.length > 0) {
+						self.searchStatus = true;
+					}
+				});
+		}
 	}
+};
 </script>
 
 <style scope>
-	
+.classword {
+	color: #666;
+}
+.titles {
+	margin-top: 30upx;
+	padding-left: 32upx;
+	padding-bottom: 11upx;
+	border-bottom: 1upx solid #d6d6db;
+	color: #666;
+}
+.listWord {
+	border-bottom: 1upx solid #eee;
+}
+.listA {
+	margin-left: 32upx;
+	height: 88upx;
+	line-height: 88upx;
+	padding: 0upx 35upx;
+	border-bottom: 1upx solid #eee;
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	overflow: hidden;
+	word-break: break-all;
+}
+.listA:last-of-type {
+	border-bottom: none;
+}
+.moreClassword {
+	display: flex;
+	align-items: center;
+	justify-content: space-between;
+	padding-left: 65upx;
+	padding-right: 32upx;
+	height: 88upx;
+	border-bottom: 1upx solid #eee;
+	margin-bottom: 46upx;
+}
 page {
-		background: #FFFFFF;
-	}
+	background: #ffffff;
+}
 </style>

+ 17 - 19
pages2/plan/create.vue

@@ -56,7 +56,7 @@
 						<u-col span="3" offset="3"><view class="title_l" @click="submit">确认</view></u-col>
 					</u-row>
 				</view>
-				<view class="popup_list">
+				<view class="popup_list" v-if="list2.length !== 0">
 					<view class="popup_item" v-for="(item, index) in list2" :key="index">
 						<view style="display: flex;align-items: center;">
 							<u-checkbox
@@ -73,6 +73,7 @@
 						<view style="margin: 30rpx;">{{ item.courseName }}</view>
 					</view>
 				</view>
+				<view v-else><u-empty text="请前往购买课程" mode="list"></u-empty></view>
 			</view>
 		</u-popup>
 		<button @click="resultForm" class="submit_btn">提交</button>
@@ -94,11 +95,7 @@ export default {
 			},
 			calendar: 'range',
 			list: [],
-			list2: [
-				{ url: '/static/banner.png', id: 33, disabled: false, checked: false },
-				{ url: '/static/banner.png', id: 34, disabled: false, checked: false },
-				{ url: '/static/banner.png', id: 35, disabled: false, checked: false }
-			],
+			list2: [],
 			show: false,
 			calendar_show: false,
 			maxDate: '2023-01-01',
@@ -227,16 +224,17 @@ export default {
 			};
 			let self = this;
 			this.$api.getUserBuy(data).then(result => {
-				if (result.data.data.courseVoList.length > 0) {
-					for (let i = 0; i < result.data.data.courseVoList.length; i++) {
-						let item = result.data.data.courseVoList[i];
-						item.checked = false;
-						item.disabled = false;
-						item.coverUrl = self.$method.splitImgHost(item.coverUrl);
+				if (result.data.data.courseVoList !== null) {
+					if (result.data.data.courseVoList.length > 0) {
+						for (let i = 0; i < result.data.data.courseVoList.length; i++) {
+							let item = result.data.data.courseVoList[i];
+							item.checked = false;
+							item.disabled = false;
+							item.coverUrl = self.$method.splitImgHost(item.coverUrl);
+						}
+						self.list2 = result.data.data.courseVoList;
 					}
 				}
-				self.list2 = result.data.data.courseVoList;
-				console.log(self.list2);
 			});
 		},
 		bindPickerChangeReview(e) {
@@ -290,7 +288,7 @@ export default {
 			});
 			this.checkSameItem();
 			this.show = false;
-			this.form.category = this.list[0].categoryName
+			this.form.category = this.list[0].categoryName;
 		},
 		checkboxChange(e) {},
 		checkSameItem() {
@@ -306,10 +304,10 @@ export default {
 		},
 		delItem(index) {
 			this.list.splice(index, 1);
-			if(this.list.length === 0){
-				this.form.category = ''
-			}else{
-				this.form.category = this.list[0].categoryName
+			if (this.list.length === 0) {
+				this.form.category = '';
+			} else {
+				this.form.category = this.list[0].categoryName;
 			}
 		},
 		openSel() {

+ 11 - 6
pages2/plan/detail.vue

@@ -71,7 +71,7 @@
 					</view>
 					<template v-slot:right>
 						<view class="operate">
-							<image src="/static/operate_1.png" class="operate_img operate_img1"></image>
+							<image src="/static/operate_1.png" class="operate_img operate_img1" @click="delWorker(item)"></image>
 							<image src="/static/operate_2.png" class="operate_img operate_img2"></image>
 							<image @click="edit(item)" src="/static/operate_3.png" class="operate_img operate_img3"></image>
 						</view>
@@ -170,6 +170,16 @@ export default {
 		
 	},
 	methods: {
+		//删除计划
+		delWorker(option){
+			var data = {
+				planId: option.planId,
+				status: 0
+			}
+			this.$api.planupdateGenerate(data).then(res => {
+				this.getList()
+			})
+		},
 		swipeMonth(index){
 			this.isOpen = false;
 			this.haveNextMonth = false
@@ -227,7 +237,6 @@ export default {
 			for(let i = 0; i < this.calendarStudyVo.dayStudyList.length; i++) {
 			    let item = this.calendarStudyVo.dayStudyList[i]
 				item.color = 0
-	//			console.log(date.getMonth+1,66)
 				if (item.date == num) {
 					if(date.getMonth()+1 ==this.calendarStudyVo.month){
 						item.color = 3;
@@ -289,9 +298,6 @@ export default {
 				self.listItem = self.list[0]
 				self.dealMonth()
 	//			self.calendarStudyVo = result.data.data[0].calendarStudyVo[1];
-
-				
-				console.log(self.calendarStudyVo.dayStudyList)
 			});
 		},
 		newPlan() {
@@ -304,7 +310,6 @@ export default {
 		},
 		swipeChange(e, item) {
 			item.show = e;
-			console.log(item,66)
 		},
 		openShow(item) {
 			if (item.show == 'none') {

+ 129 - 126
pages2/plan/edit.vue

@@ -3,7 +3,7 @@
 		<view class="list_box">
 			<view class="item" v-for="(item, index) in list" :key="index">
 				<image :src="item.coverUrl"></image>
-				<text>{{item.courseName}}</text>
+				<text>{{ item.courseName }}</text>
 				<view class="del_icon"><u-icon name="minus-circle-fill" color="#EB4D3D" size="40" @click="delItem(index)"></u-icon></view>
 			</view>
 			<view class="item" style="vertical-align: top;">
@@ -56,7 +56,7 @@
 						<u-col span="3" offset="3"><view class="title_l" @click="submit">确认</view></u-col>
 					</u-row>
 				</view>
-				<view class="popup_list">
+				<view class="popup_list" v-if="list2.length !== 0">
 					<view class="popup_item" v-for="(item, index) in list2" :key="index">
 						<view style="display: flex;align-items: center;">
 							<u-checkbox
@@ -73,6 +73,7 @@
 						<view style="margin: 30rpx;">{{ item.courseName }}</view>
 					</view>
 				</view>
+				<view v-else><u-empty text="请前往购买课程" mode="list"></u-empty></view>
 			</view>
 		</u-popup>
 		<button @click="resultForm" class="submit_btn">提交</button>
@@ -148,79 +149,78 @@ export default {
 		};
 	},
 	onLoad(option) {
-		this.planId = option.id
-		this.getMyCourse()
+		this.planId = option.id;
+		this.getMyCourse();
 		this.getListForm(option.id);
 	},
 	onShow() {},
 	methods: {
-		resultForm(){
-			
-				if (this.list.length == 0) {
+		resultForm() {
+			if (this.list.length == 0) {
+				uni.showModal({
+					title: '提示',
+					content: '请选择课程',
+					showCancel: false
+				});
+				return;
+			}
+			let courseId = [];
+			for (let i = 0; i < this.list.length; i++) {
+				courseId.push(this.list[i].courseId);
+			}
+			let ss = this.form.week.split('、');
+			let weekArray = [];
+			for (let i = 0; i < ss.length; i++) {
+				if (ss[i] == '日') {
+					weekArray.push(0);
+				}
+				if (ss[i] == '一') {
+					weekArray.push(1);
+				}
+				if (ss[i] == '二') {
+					weekArray.push(2);
+				}
+				if (ss[i] == '三') {
+					weekArray.push(3);
+				}
+				if (ss[i] == '四') {
+					weekArray.push(4);
+				}
+				if (ss[i] == '五') {
+					weekArray.push(5);
+				}
+				if (ss[i] == '六') {
+					weekArray.push(6);
+				}
+			}
+			let data = {
+				planId: this.planId,
+				courseId: courseId,
+				reminderTime: this.form.time,
+				examDate: this.$method.TimeTotimestamp(this.form.date),
+				startTime: this.$method.TimeTotimestamp(this.form.startDate),
+				endTime: this.$method.TimeTotimestamp(this.form.endDate),
+				studyCount: weekArray,
+				studyDay: this.array_review[this.index_review],
+				status: 2
+			};
+			this.$api.planupdateGenerate(data).then(result => {
+				if (result.data.code == 200) {
 					uni.showModal({
 						title: '提示',
-						content: '请选择课程',
-						showCancel: false
+						content: '提交成功',
+						showCancel: false,
+						success: function(res) {
+							if (res.confirm) {
+								uni.navigateBack({
+									delta: 1
+								});
+							}
+						}
 					});
-					return;
-				}
-				let courseId = [];
-				for (let i = 0; i < this.list.length; i++) {
-					courseId.push(this.list[i].courseId);
 				}
-				let ss = this.form.week.split('、');
-				let weekArray = [];
-				for (let i = 0; i < ss.length; i++) {
-					if (ss[i] == '日') {
-						weekArray.push(0);
-					}
-					if (ss[i] == '一') {
-						weekArray.push(1);
-					}
-					if (ss[i] == '二') {
-						weekArray.push(2);
-					}
-					if (ss[i] == '三') {
-						weekArray.push(3);
-					}
-					if (ss[i] == '四') {
-						weekArray.push(4);
-					}
-					if (ss[i] == '五') {
-						weekArray.push(5);
-					}
-					if (ss[i] == '六') {
-						weekArray.push(6);
-					}
-				}
-				let data = {
-					planId: this.planId,
-					courseId: courseId,
-					reminderTime: this.form.time,
-					examDate: this.$method.TimeTotimestamp(this.form.date),
-					startTime: this.$method.TimeTotimestamp(this.form.startDate),
-					endTime: this.$method.TimeTotimestamp(this.form.endDate),
-					studyCount: weekArray,
-					studyDay: this.array_review[this.index_review],
-					status: 2
-				};
-				this.$api.planupdateGenerate(data).then(result => {
-					if (result.data.code == 200) {
-						uni.showModal({
-							title: '提示',
-							content: '提交成功',
-							showCancel:	false,
-							success: function (res) {
-							        if (res.confirm) {
-							            uni.navigateBack({
-							                delta: 1
-							            });
-							        }
-							    }
-						});
-					}
-					console.log(result);
-				});
+				console.log(result);
+			});
 		},
 		getMyCourse() {
 			let data = {
@@ -228,65 +228,68 @@ export default {
 			};
 			let self = this;
 			this.$api.getUserBuy(data).then(result => {
-				console.log(result)
-					self.form.courseId = result.data.data.courseVoList[0].courseId
-				if (result.data.data.courseVoList.length > 0) {
-					for (let i = 0; i < result.data.data.courseVoList.length; i++) {
-						let item = result.data.data.courseVoList[i];
-						item.checked = false;
-						item.disabled = false;
-						item.coverUrl = self.$method.splitImgHost(item.coverUrl);
+				if (result.data.data.courseVoList !== null) {
+					self.form.courseId = result.data.data.courseVoList[0].courseId;
+					if (result.data.data.courseVoList.length > 0) {
+						for (let i = 0; i < result.data.data.courseVoList.length; i++) {
+							let item = result.data.data.courseVoList[i];
+							item.checked = false;
+							item.disabled = false;
+							item.coverUrl = self.$method.splitImgHost(item.coverUrl);
+						}
 					}
+					self.list2 = result.data.data.courseVoList;
 				}
-				self.list2 = result.data.data.courseVoList;
 			});
 		},
 		getListForm(int) {
-			var self = this
-			this.$api.planUserPlan({
-				planId: int
-			}).then(res => {
-						this.form.date = this.$method.timestampToTime(res.data.data[0].examDate);
-						this.form.time = res.data.data[0].reminderTime;
-						this.form.startDate = this.$method.timestampToTime(res.data.data[0].startTime);
-						this.form.endDate = this.$method.timestampToTime(res.data.data[0].endTime);
-						this.index_review = res.data.data[0].studyDay;
-						this.form.week = res.data.data[0].studyCount;
-						this.form.category = res.data.data[0].coursePlanVo[0].categoryName
-						this.list = res.data.data[0].coursePlanVo;
-						var numWeek = []
-						this.form.week.forEach((items,indexs) => {
-							if(items === 1){
-								numWeek.push('一')
-								return
-							}
-							if(items === 2){
-								numWeek.push('二')
-								return
-							}
-							if(items === 3){
-								numWeek.push('三')
-								return
-							}
-							if(items === 4){
-								numWeek.push('四')
-								return
-							}
-							if(items === 5){
-								numWeek.push('五')
-								return
-							}
-							if(items === 6){
-								numWeek.push('六')
-								return
-							}
-							if(items === 0){
-								numWeek.push('日')
-								return
-							}
-						})
-						this.form.week = numWeek.join('、')
-			});
+			var self = this;
+			this.$api
+				.planUserPlan({
+					planId: int
+				})
+				.then(res => {
+					this.form.date = this.$method.timestampToTime(res.data.data[0].examDate);
+					this.form.time = res.data.data[0].reminderTime;
+					this.form.startDate = this.$method.timestampToTime(res.data.data[0].startTime);
+					this.form.endDate = this.$method.timestampToTime(res.data.data[0].endTime);
+					this.index_review = res.data.data[0].studyDay;
+					this.form.week = res.data.data[0].studyCount;
+					this.form.category = res.data.data[0].coursePlanVo[0].categoryName;
+					this.list = res.data.data[0].coursePlanVo;
+					var numWeek = [];
+					this.form.week.forEach((items, indexs) => {
+						if (items === 1) {
+							numWeek.push('一');
+							return;
+						}
+						if (items === 2) {
+							numWeek.push('二');
+							return;
+						}
+						if (items === 3) {
+							numWeek.push('三');
+							return;
+						}
+						if (items === 4) {
+							numWeek.push('四');
+							return;
+						}
+						if (items === 5) {
+							numWeek.push('五');
+							return;
+						}
+						if (items === 6) {
+							numWeek.push('六');
+							return;
+						}
+						if (items === 0) {
+							numWeek.push('日');
+							return;
+						}
+					});
+					this.form.week = numWeek.join('、');
+				});
 		},
 		bindPickerChangeReview(e) {
 			this.index_review = e.detail.value;
@@ -339,7 +342,7 @@ export default {
 			});
 			this.checkSameItem();
 			this.show = false;
-			this.form.category = this.list[0].categoryName
+			this.form.category = this.list[0].categoryName;
 		},
 		checkboxChange(e) {},
 		checkSameItem() {
@@ -355,10 +358,10 @@ export default {
 		},
 		delItem(index) {
 			this.list.splice(index, 1);
-			if(this.list.length === 0){
-				this.form.category = ''
-			}else{
-				this.form.category = this.list[0].categoryName
+			if (this.list.length === 0) {
+				this.form.category = '';
+			} else {
+				this.form.category = this.list[0].categoryName;
 			}
 		},
 		openSel() {

+ 171 - 178
pages2/study/index.vue

@@ -1,207 +1,200 @@
 <template>
-	<view style="padding: 30rpx;" >
+	<view style="padding: 30rpx;">
 		<view style="padding: 0 50rpx;">
-			<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#2F4379"></uni-segmented-control>       
+			<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#2F4379"></uni-segmented-control>
 		</view>
-		<view >
-		    <view v-show="current === 0">
-		        <view class="content" v-for="(item,index) in list1" :key="index" @click="jumpDetail(item)">
+		<view>
+			<view v-show="current === 0">
+				<view v-if="list1.length === 0" class="mar-t">
+					<u-empty text="未购买课程" mode="list"></u-empty>
+				</view>
+				<view v-else class="content" v-for="(item, index) in list1" :key="index" @click="jumpDetail(item)">
 					<view>
-						<u-row >
-							<u-col span="5" >
-								<view style="padding: 5rpx;">
-									<image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image>
+						<u-row>
+							<u-col span="5">
+								<view style="padding: 5rpx;"><image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image></view>
+							</u-col>
+							<u-col span="7">
+								<view style="position: relative;height: 134rpx;padding-left: 10rpx;">
+									<view class="c_title">{{ item.categoryName }}</view>
 								</view>
 							</u-col>
-							<u-col span="7" >
+						</u-row>
+					</view>
+				</view>
+			</view>
+			<view v-show="current === 1">
+				<view v-if="list2.length === 0" class="mar-t">
+					<u-empty text="未购买题库" mode="list"></u-empty>
+				</view>
+				<view v-else class="content" v-for="(item, index) in list2" :key="index" @click="jumpDetail(item)" >
+					<view>
+						<u-row>
+							<u-col span="5">
+								<view style="padding: 5rpx;"><image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image></view>
+							</u-col>
+							<u-col span="7">
+								<view style="position: relative;height: 134rpx;padding-left: 10rpx;">
+									<view class="c_title">{{ item.bankName }}</view>
+								</view>
+							</u-col>
+						</u-row>
+					</view>
+				</view>
+			</view>
+			<view v-show="current === 2">
+				<view v-if="list3.length === 0" class="mar-t">
+					<u-empty text="未购买考点重点" mode="list"></u-empty>
+				</view>
+				<view v-else class="content" v-for="(item, index) in list3" :key="index" @click="jumpDetail(item)" >
+					<view>
+						<u-row>
+							<u-col span="5">
+								<view style="padding: 5rpx;"><image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image></view>
+							</u-col>
+							<u-col span="7">
 								<view style="position: relative;height: 134rpx;padding-left: 10rpx;">
-									<view class="c_title">
-										{{item.categoryName}}
-									</view>
-									
+									<view class="c_title">{{ item.name }}</view>
 								</view>
 							</u-col>
 						</u-row>
 					</view>
-					
 				</view>
-		    </view>
-		    <view v-show="current === 1">
-		       <view class="content" v-for="(item,index) in list2" :key="index" @click="jumpDetail(item)">
-		       	<view>
-		       		<u-row >
-		       			<u-col span="5" >
-		       				<view style="padding: 5rpx;">
-		       					<image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image>
-		       				</view>
-		       			</u-col>
-		       			<u-col span="7" >
-		       				<view style="position: relative;height: 134rpx;padding-left: 10rpx;">
-		       					<view class="c_title">
-		       						{{item.bankName}}
-		       					</view>
-		       					
-		       				</view>
-		       			</u-col>
-		       		</u-row>
-		       	</view>
-		       	
-		       </view>
-		    </view>
-		    <view v-show="current === 2">
-		       <view class="content" v-for="(item,index) in list3" :key="index" @click="jumpDetail(item)">
-		       	<view>
-		       		<u-row >
-		       			<u-col span="5" >
-		       				<view style="padding: 5rpx;">
-		       					<image :src="$method.splitImgHost(item.coverUrl)" class="c_img"></image>
-		       				</view>
-		       			</u-col>
-		       			<u-col span="7" >
-		       				<view style="position: relative;height: 134rpx;padding-left: 10rpx;">
-		       					<view class="c_title">
-		       						{{item.name}}
-		       					</view>
-		       					
-		       				</view>
-		       			</u-col>
-		       		</u-row>
-		       	</view>
-		       	
-		       </view>
-		    </view>
+			</view>
 		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				current:0,
-				items: [
-					'课程', 
-					'刷题', 
-					'重点考点'
-				],
-				list:[1,1,1,1,1,1,1,1,1,1,1],
-				list1: [],
-				list2: [],
-				list3: [],
-				paramList: [
-					{
-						typeId:0
-					},
-					{
-						typeId:1
-					},
-					{
-						typeId:2
-					}
-				],
+export default {
+	data() {
+		return {
+			current: 0,
+			items: ['课程', '刷题', '重点考点'],
+			list1: [],
+			list2: [],
+			list3: [],
+			paramList: [
+				{
+					typeId: 1
+				},
+				{
+					typeId: 2
+				},
+				{
+					typeId: 3
+				}
+			]
+		};
+	},
+	onLoad(option) {
+		if (option.status !== undefined) {
+			this.current = parseInt(option.status);
+		}
+		this.getMyCourse();
+		this.getMyBank();
+		this.getMyNote();
+	},
+	onShow() {},
+	methods: {
+		jumpDetail(item) {
+			if (this.current == 0) {
+				this.$navTo.togo('/pages2/course/detail', {
+					id: item.courseId
+				});
+				return;
+			}
+			if (this.current == 1) {
+				this.$navTo.togo('/pages2/bank/detail', {
+					id: item.bankId
+				});
+				return;
+			}
+			if (this.current == 2) {
+				this.$navTo.togo('/pages2/course/keynote', {
+					id: item.fileId
+				});
+				return;
 			}
 		},
-		onLoad(option) {
-			this.getMyCourse()
-			this.getMyBank()
-			this.getMyNote()
-		},
-		onShow(){
+		onClickItem(e) {
+			this.current = e.currentIndex;
 		},
-		methods: {
-			jumpDetail(item) {
-				if (this.current == 0) {
-					this.$navTo.togo('/pages2/course/detail', {
-						id: item.courseId
-					});
-					return;
+		getMyCourse() {
+			var self = this;
+			var param = this.paramList[0];
+			this.$api.getUserBuy(param).then(result => {
+				if(result.data.data.courseVoList !== null){
+				self.list1.push.apply(self.list1, result.data.data.courseVoList);
 				}
-				if (this.current == 1) {
-						this.$navTo.togo('/pages2/bank/detail', {
-							id: item.bankId
-						});
-					return;
-				}
-				if (this.current == 2) {
-					this.$navTo.togo('/pages2/course/keynote', {
-						id: item.fileId
-					});
-					return;
-				}
-			},
-			onClickItem(e){
-				this.current = e.currentIndex
-			},
-			getMyCourse(){
-			   var self = this;
-			   var param = this.paramList[0];
-			    this.$api.getUserBuy(param).then(result => {
-					console.log(result.data.data.courseVoList,33)
-			     self.list1.push.apply(self.list1, result.data.data.courseVoList);
-			    });
-			},
-			getMyBank(){
-			   var self = this;
-			   var param = this.paramList[1];
-			    this.$api.getUserBuy(param).then(result => {
-			     self.list2.push.apply(self.list2, result.data.data.questionBankList);
-			    });
-			},
-			getMyNote(){
-			   var self = this;
-			   var param = this.paramList[2];
-			    this.$api.getUserBuy(param).then(result => {
-			     self.list3.push.apply(self.list3, result.data.data.examNoteList);
-			    });
-			},
-		
+			});
 		},
-		
+		getMyBank() {
+			var self = this;
+			var param = this.paramList[1];
+			this.$api.getUserBuy(param).then(result => {
+				if(result.data.data.questionBankList !== null){
+				self.list2.push.apply(self.list2, result.data.data.questionBankList);}
+			});
+		},
+		getMyNote() {
+			var self = this;
+			var param = this.paramList[2];
+			this.$api.getUserBuy(param).then(result => {
+				if(result.data.data.examNoteList !== null){
+				self.list3.push.apply(self.list3, result.data.data.examNoteList);
+				}
+			});
+		}
 	}
+};
 </script>
 
 <style scope>
-	.c_log{
-		font-size: 20rpx;
-		font-family: PingFang SC;
-		font-weight: 400;
-		color: #2F4379;
-		position: absolute;
-		bottom: 10rpx;
+	.mar-t{
+		margin-top: 30rpx;
 	}
-	.c_title{
-		font-size: 30rpx;
-		font-family: PingFang SC;
-		font-weight: bold;
-		color: #2F4379;
-		padding-top: 10rpx;
-	}
-	.c_img{
-		width: 278rpx;
-		height: 134rpx;
-	}
-	.c_t1{
-		font-size: 20rpx;
-		color: #2F4379;
-		padding: 15rpx;
-	}
-	.content{
-		margin-top: 20rpx;
-		width: 100%;
-		height: 225rpx;
-		background: #FFFFFF;
-		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-		border-radius: 32rpx;
-	}
-	.segmented-control__text{
-		font-size: 24rpx !important;
-	}
-	.segmented-control{
-		height: 56rpx !important;
-		background-color: #F8F9FF;
-	}
-	
+.c_log {
+	font-size: 20rpx;
+	font-family: PingFang SC;
+	font-weight: 400;
+	color: #2f4379;
+	position: absolute;
+	bottom: 10rpx;
+}
+.c_title {
+	font-size: 30rpx;
+	font-family: PingFang SC;
+	font-weight: bold;
+	color: #2f4379;
+	padding-top: 10rpx;
+}
+.c_img {
+	width: 278rpx;
+	height: 134rpx;
+}
+.c_t1 {
+	font-size: 20rpx;
+	color: #2f4379;
+	padding: 15rpx;
+}
+.content {
+	margin-top: 20rpx;
+	width: 100%;
+	height: 225rpx;
+	background: #ffffff;
+	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+	border-radius: 32rpx;
+}
+.segmented-control__text {
+	font-size: 24rpx !important;
+}
+.segmented-control {
+	height: 56rpx !important;
+	background-color: #f8f9ff;
+}
+
 page {
-		background: #FFFFFF;
-	}
+	background: #ffffff;
+}
 </style>

+ 2 - 1
pages2/wd/coupon.vue

@@ -189,7 +189,8 @@
 			}
 		},
 		onLoad(option) {
-			
+			this.current = parseInt(option.menuStatus) -1
+			console.log(this.current)
 		},
 		onShow(){
 		},

+ 93 - 73
pages2/wd/help.vue

@@ -1,96 +1,116 @@
 <template>
 	<view style="position: relative;">
-		<u-navbar  title="助学活动" background="{ background: '#ffffff',opacity:0.4; }"></u-navbar>
-		<view style="width: 100%;position: fixed;top: 0;z-index: 300;">
-			<image src="/static/bg_help.jpg" style="width: 100%;" mode="widthFix"></image>
-		</view>
-		<view style="padding: 20rpx;" :style="'margin-top:'+imgHeight+'px'">
-			<view class="activity_box" v-for="(item,index) in list" :key="index">
-				<view class="box_title">
-					“免费学”公益助学进行时
-				</view>
-				<view>
-					<image  src="http://192.168.0.222:8080/img/banner.png" style="width: 100%;height: 330rpx;"></image>
+		<u-navbar title="助学活动" background="{ background: '#ffffff',opacity:0.4; }"></u-navbar>
+		<view style="width: 100%;position: fixed;top: 0;z-index: 300;"><image src="/static/bg_help.jpg" style="width: 100%;" mode="widthFix"></image></view>
+		<view style="padding: 20rpx;" :style="'margin-top:' + imgHeight + 'px'">
+			<view class="activity_box" v-for="(item, index) in list" :key="index">
+				<view class="box_title" style="display: flex;align-items: center;justify-content: space-between;">
+					<view>{{ item.activityName }}</view>
+					<view><u-icon name="info-circle" color="#2F4379" size="28" @click="openActivesList(item)"></u-icon></view>
 				</view>
-				<u-row >
-					<u-col span="6" >
-						<view class="box_title">
-							2021-04-22至2021-05-01
-						</view>
+				<view><image :src="$method.splitImgHost()" style="width: 100%;height: 330rpx;"></image></view>
+				<u-row>
+					<u-col span="6">
+						<view class="box_title">{{ $method.timestampToTime(item.startTime) }}至{{ $method.timestampToTime(item.endTime) }}</view>
 					</u-col>
 					<u-col span="6" text-align="right">
-						<view style="padding: 8rpx;">
-							<view class="boxbtn">
-								立即参与
-							</view>
-						</view>
+						<view style="padding: 8rpx;"><view class="boxbtn" @click="uploadActives">立即参与</view></view>
 					</u-col>
 				</u-row>
-		
 			</view>
 		</view>
+		<u-popup v-model="show" mode="bottom" border-radius="14">
+			<header style="text-align: center;margin-top: 10rpx;color: #2F4379;font-size: 30rpx;font-weight: bold;">参与活动课程列表</header>
+			<view style="padding: 24rpx;">
+				<view v-for="(item,index) in activeSList" :key="index" style="padding: 12rpx;display: flex;margin-bottom: 8rpx;border-radius: 32rpx;box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145,156,178,0.1);background-color: #fff;" @click="jumpPages(item)">
+					<image style="width:278rpx;height:134rpx;margin-right: 23rpx;" :src="$method.splitImgHost(item.coverUrl)" mode=""></image>
+					<view style="font-size: 30rpx;color: #2f4379;font-weight: 500;">
+						{{item.courseName}}
+					</view>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				list:[],
-				imgHeight:0
-			}
-		},
-		onLoad(option) {
-			
+export default {
+	data() {
+		return {
+			list: [],
+			imgHeight: 0,
+			activeSList: [],
+			show: false
+		};
+	},
+	onLoad(option) {
+		this.getAtionlist();
+	},
+	onShow() {
+		let w = uni.getSystemInfoSync().windowWidth;
+		this.imgHeight = w / (750 / 375) - 68;
+	},
+	methods: {
+		getAtionlist() {
+			this.$api.configurationlist().then(res => {
+				this.list = res.data.rows;
+			});
 		},
-		onShow(){
-			let w = uni.getSystemInfoSync().windowWidth
-			this.imgHeight = w/(750/375)-68 
+		uploadActives() {},
+		openActivesList(option) {
+			console.log(option)
+			this.activeSList = option.courses
+			this.show = true
 		},
-		methods: {
-			
+		jumpPages(option){
+			this.$navTo.togo('/pages2/course/detail', {
+				id: option.courseId
+			});
+			return;
 		},
-		
 	}
+};
 </script>
 <style>
-	.u-border-bottom:after, .u-border-left:after, .u-border-right:after, .u-border-top-bottom:after, .u-border-top:after, .u-border:after{
-		border:none !important;
-	}
-
-	
+.u-border-bottom:after,
+.u-border-left:after,
+.u-border-right:after,
+.u-border-top-bottom:after,
+.u-border-top:after,
+.u-border:after {
+	border: none !important;
+}
 </style>
 <style scope>
-	.boxbtn{
-		width: 132rpx;
-		height: 40rpx;
-		background: rgba(249, 96, 10, 0.6);
-		border-radius: 20rpx;
-		font-size: 24rpx;
-		color: #FFFFFF;
-		float: right;
-		text-align: center;
-		line-height: 40rpx;
-		
-	}
-	.box_title{
-		font-size: 24rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #2F4379;
-		padding: 15rpx;
-	}
-	.activity_box{
-		width: 100%;
-		height: 466rpx;
-		background: #FFFFFF;
-		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-		border-radius: 32rpx;
-		position: relative;
-		margin-bottom: 20rpx;
-	}
-	
+.boxbtn {
+	width: 132rpx;
+	height: 40rpx;
+	background: rgba(249, 96, 10, 0.6);
+	border-radius: 20rpx;
+	font-size: 24rpx;
+	color: #ffffff;
+	float: right;
+	text-align: center;
+	line-height: 40rpx;
+}
+.box_title {
+	font-size: 24rpx;
+	font-family: PingFang SC;
+	font-weight: 500;
+	color: #2f4379;
+	padding: 15rpx;
+}
+.activity_box {
+	width: 100%;
+	height: 466rpx;
+	background: #ffffff;
+	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+	border-radius: 32rpx;
+	position: relative;
+	margin-bottom: 20rpx;
+}
+
 page {
-		background: #FFFFFF;
-	}
+	background: #ffffff;
+}
 </style>

+ 111 - 14
pages2/wd/level.vue

@@ -44,7 +44,7 @@
 				<u-row >
 					<u-col span="3">
 						<view class="menu_p">
-							<view class="menu_box">
+							<view class="menu_box" @click="jumpmenu(1)">
 								<image src="/static/level/menu1.png" class="menu_img"></image>
 								<view class="menu_t">优惠券</view>
 							</view>
@@ -52,7 +52,7 @@
 					</u-col>
 					<u-col span="3">
 						<view class="menu_p">
-							<view class="menu_box">
+							<view class="menu_box" @click="jumpmenu(2)">
 								<image src="/static/level/menu2.png" class="menu_img"></image>
 								<view class="menu_t">折扣券</view>
 							</view>
@@ -60,7 +60,7 @@
 					</u-col>
 					<u-col span="3">
 						<view class="menu_p">
-							<view class="menu_box">
+							<view class="menu_box" @click="jumpmenu(3)">
 								<image src="/static/level/menu3.png" class="menu_img"></image>
 								<view class="menu_t">解锁题库</view>
 							</view>
@@ -68,7 +68,7 @@
 					</u-col>
 					<u-col span="3">
 						<view class="menu_p">
-							<view class="menu_box">
+							<view class="menu_box" @click="jumpmenu(4)">
 								<image src="/static/level/menu4.png" class="menu_img"></image>
 								<view class="menu_t">解锁课程</view>
 							</view>
@@ -93,10 +93,13 @@
 									<view style="width: 95rpx;">签到</view>
 									<text style="margin-left: 20rpx;">经验 +2</text>
 								</view>
-								<view class="box_qd">每日签到</view>
+								<view class="box_qd" >每日签到</view>
 							</u-col>
 							<u-col offset="2" span="3" text-align="right">
-								<view class="box2_btn">去完成</view>
+								<view class="box2_btn" v-if="issue === 0" @click="qd">去完成</view>
+								<view class="box3_btn" v-if="issue === 1">
+									已完成
+								</view>
 							</u-col>
 						</u-row>
 					</view>
@@ -113,7 +116,10 @@
 								<view class="box_qd">观看课程视频5分钟</view>
 							</u-col>
 							<u-col offset="2" span="3" text-align="right">
-								<view class="box2_btn">去完成</view>
+								<view class="box2_btn" v-if="taskType4 === 0">去完成</view>
+								<view class="box3_btn" v-if="taskType4 === 1">
+									已完成
+								</view>
 							</u-col>
 						</u-row>
 					</view>
@@ -130,7 +136,10 @@
 								<view class="box_qd">完善学习档案信息</view>
 							</u-col>
 							<u-col offset="2" span="3" text-align="right">
-								<view class="box2_btn">去完成</view>
+								<view class="box2_btn" v-if="taskType1 === 0" @click="jumpZL">去完成</view>
+								<view class="box3_btn" v-if="taskType1 === 1">
+									已完成
+								</view>
 							</u-col>
 						</u-row>
 					</view>
@@ -147,11 +156,14 @@
 								<view class="box_qd">转发分享给好友</view>
 							</u-col>
 							<u-col offset="2" span="3" text-align="right">
-								<view class="box2_btn">去完成</view>
+								<view class="box2_btn" v-if="taskType3 === 0">去完成</view>
+								<view class="box3_btn" v-if="taskType3 === 1">
+									已完成
+								</view>
 							</u-col>
 						</u-row>
 					</view>
-					<view style="margin-top: 15rpx;">
+					<view style="margin-top: 15rpx;" v-if="false">
 						<u-row >
 							<u-col  span="2">
 								<image class="box2_img" src="/static/level/hdbaoming.png"></image>
@@ -168,8 +180,8 @@
 							</u-col>
 						</u-row>
 					</view>
+					
 				</view>
-				
 			</view>
 		</view>
 	</view>
@@ -223,16 +235,90 @@
 						tip:'您已解锁所有成就!',
 						bac:'linear-gradient(45deg, rgba(240, 157, 9, 0.4), rgba(251, 218, 56, 0.4));'
 					}
-				]
+				],
+				issue: 0,
+				taskType0: 0,
+				taskType1: 0,
+				taskType2: 0,
+				taskType3: 0,
+				taskType4: 0,
+				
 			}
 		},
 		onLoad(option) {
-			
+			this.getInit()
+			this.getInitList()
 		},
 		onShow(){
 		},
 		methods: {
-			
+			qd() {
+				var self = this
+				var data = {
+					taskType: 0
+				}
+				self.$api.taskSignIn(data).then(res => {
+					if(res.data.code === 200){
+						self.getInit()
+					}
+				})
+			},
+			jumpZL(){
+				this.$navTo.togo('/pages2/wd/info');
+			},
+			getInit(){
+				let self = this;
+				this.$api.appInfoAttached().then(res => {
+					self.issue = res.data.data.issue
+				});
+			},
+			getInitList(){
+				this.$api.taskList().then(res => {
+					res.data.rows.forEach((item,index) => {
+						if(item.taskType === 0){
+							this.taskType0 = item.userStatus
+						}
+						if(item.taskType === 1){
+							this.taskType1 = item.userStatus
+						}
+						if(item.taskType === 2){
+							this.taskType2 = item.userStatus
+						}
+						if(item.taskType === 3){
+							this.taskType3 = item.userStatus
+						}
+						if(item.taskType === 4){
+							this.taskType4 = item.userStatus
+						}
+					})
+				})
+			},
+			jumpmenu(int){
+				if(int === 1){
+					this.$navTo.togo('/pages2/wd/coupon', {
+						menuStatus:1
+					});
+					return
+				}
+				if(int === 2){
+					this.$navTo.togo('/pages2/wd/coupon', {
+						menuStatus:2
+					});
+					return
+				}
+				if(int === 3){
+					this.$navTo.togo('/pages2/study/index', {
+						status:1
+					});
+					return
+				}
+				if(int === 4){
+					this.$navTo.togo('/pages2/study/index', {
+						status:0
+					});
+					return
+				}
+			}
 		
 		},
 		computed: {...mapGetters(['userInfo'])},
@@ -305,6 +391,17 @@
 		line-height: 40rpx;
 		margin-right: 20rpx;
 	}
+	.box3_btn{
+		width: 132rpx;
+		height: 40rpx;
+		background: rgba(238, 238, 238, 0.6);
+		border-radius: 20rpx;
+		font-size: 24rpx;
+		color: #666;
+		text-align: center;
+		line-height: 40rpx;
+		margin-right: 20rpx;
+	}
 	.box2_img{
 		width: 83rpx;
 		height: 83rpx;