he2802 %!s(int64=4) %!d(string=hai) anos
pai
achega
62df9232d6
Modificáronse 7 ficheiros con 130 adicións e 23 borrados
  1. 1 1
      common/request.js
  2. 29 0
      components/home.vue
  3. 1 1
      components/my.vue
  4. 1 1
      pages2/plan/create.vue
  5. 1 1
      pages2/plan/edit.vue
  6. 3 3
      pages2/study/index.vue
  7. 94 16
      pages2/wd/coupon.vue

+ 1 - 1
common/request.js

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

+ 29 - 0
components/home.vue

@@ -167,8 +167,37 @@ 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++)
+		{
+		arr.push(d.getFullYear()+'年'+(d.getMonth()+1)+'月'+d.getDate()+'日 ('+getDayName(d.getDay())+')');
+		d.setDate(d.getDate()+1);
+		}
 	},
 	methods: {
+		getMonDate()
+		{
+			var d=new Date(),
+			day=d.getDay(),
+			date=d.getDate();
+			if(day==1)
+			return d;
+			if(day==0)
+			d.setDate(date-6);
+			else
+			d.setDate(date-day+1);
+			return d;
+		},
+		getDayName(day)
+		{
+			var day=parseInt(day);
+			if(isNaN(day) || day<0 || day>6)
+			return false;
+			var weekday=["星期天","星期一","星期二","星期三","星期四","星期五","星期六"];
+			return weekday[day];
+		},
 		swiperClick(index){
 			let item = this.list[index]
 			uni.navigateTo({

+ 1 - 1
components/my.vue

@@ -23,7 +23,7 @@
 						<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 class="qiandao" @click="qd" v-if="!isQd">
 					签到
 				</view>
 				<view class="qiandao"  v-if="isQd">

+ 1 - 1
pages2/plan/create.vue

@@ -223,7 +223,7 @@ export default {
 		},
 		getMyCourse() {
 			let data = {
-				typeId: 0
+				typeId: 1
 			};
 			let self = this;
 			this.$api.getUserBuy(data).then(result => {

+ 1 - 1
pages2/plan/edit.vue

@@ -224,7 +224,7 @@ export default {
 		},
 		getMyCourse() {
 			let data = {
-				typeId: 0
+				typeId: 1
 			};
 			let self = this;
 			this.$api.getUserBuy(data).then(result => {

+ 3 - 3
pages2/study/index.vue

@@ -89,14 +89,14 @@
 				list2: [],
 				list3: [],
 				paramList: [
-					{
-						typeId:0
-					},
 					{
 						typeId:1
 					},
 					{
 						typeId:2
+					},
+					{
+						typeId:3
 					}
 				],
 			}

+ 94 - 16
pages2/wd/coupon.vue

@@ -6,12 +6,12 @@
 		<view class="box">
 			<view >
 			    <view v-show="current === 0">
-			        <view class="content" v-for="(item,index) in list" :key="index">
+			        <view class="content" v-for="(item,index) in list1" :key="index">
 						<view>
 							<u-row >
 								<u-col span="4" >
 									<view class="price_box">
-										<text class="price_num">20</text>
+										<text class="price_num">{{item.price}}</text>
 										<text class="price_unit">元</text>
 									</view>
 								</u-col>
@@ -34,10 +34,10 @@
 										有效期:
 									</view>
 									<view class="time">
-										2021-03-23 ~ 2021-04-22
+										{{ $method.timestampToTime(item.createTime) }} ~ {{ $method.timestampToTime(item.endTime) }}
 									</view>
 									<view class="tip">
-										所有题库均可使用
+										仅部分课程使用
 									</view>
 								</u-col>
 							</u-row>
@@ -45,12 +45,12 @@
 					</view>
 			    </view>
 			    <view v-show="current === 1">
-			        <view class="content" v-for="(item,index) in list" :key="index">
+			        <view class="content" v-for="(item,index) in list2" :key="index">
 			        	<view>
 			        		<u-row >
 			        			<u-col span="4" >
 			        				<view class="price_box">
-			        					<text class="price_num">8.8</text>
+			        					<text class="price_num">{{item.price}}</text>
 			        					<text class="price_unit">折</text>
 			        				</view>
 			        			</u-col>
@@ -59,7 +59,7 @@
 			        					<u-row >
 			        						<u-col span="6" >
 			        							<view class="coupon_title">
-			        								题库折扣券
+			        								课程折扣券
 			        							</view>
 			        						</u-col>
 			        						<u-col span="4" offset="2">
@@ -73,10 +73,10 @@
 			        					有效期:
 			        				</view>
 			        				<view class="time">
-			        					2021-03-23 ~ 2021-04-22
+			        					{{ $method.timestampToTime(item.createTime) }} ~ {{ $method.timestampToTime(item.endTime) }}
 			        				</view>
 			        				<view class="tip">
-			        					所有题库均可使用
+			        					仅部分课程可使用
 			        				</view>
 			        			</u-col>
 			        		</u-row>
@@ -93,7 +93,7 @@
 		<u-popup v-model="show" mode="bottom" :safe-area-inset-bottom="true">
 			<view class="popup_box" >
 				<scroll-view scroll-y="true" class="popup_list" >
-				<view class="content" v-for="(item,index) in list1" :key="index" v-show="current === 0">
+				<view class="content" v-for="(item,index) in list3" :key="index" v-show="current === 0">
 					<view style="position: relative;">
 						<u-row >
 							<u-col span="4" >
@@ -117,10 +117,10 @@
 									有效期:
 								</view>
 								<view class="time">
-									2021-03-23 ~ 2021-04-22
+									{{ $method.timestampToTime(item.createTime) }} ~ {{ $method.timestampToTime(item.endTime) }}
 								</view>
 								<view class="tip">
-									所有题库均可使用
+									仅部分课程可使用
 								</view>
 							</u-col>
 						</u-row>
@@ -129,7 +129,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="content" v-for="(item,index) in list2" :key="index" v-show="current === 1">
+				<view class="content" v-for="(item,index) in list4" :key="index" v-show="current === 1">
 					<view style="position: relative;">
 						<u-row >
 							<u-col span="4" >
@@ -153,10 +153,10 @@
 									有效期:
 								</view>
 								<view class="time">
-									2021-03-23 ~ 2021-04-22
+									{{ $method.timestampToTime(item.createTime) }} ~ {{ $method.timestampToTime(item.endTime) }}
 								</view>
 								<view class="tip">
-									所有题库均可使用
+									仅部分课程可使用
 								</view>
 							</u-col>
 						</u-row>
@@ -186,14 +186,92 @@
 				list1:['/static/coupon/overdue.png',
 				'/static/coupon/used.png','/static/coupon/used.png',
 				'/static/coupon/overdue.png','/static/coupon/overdue.png'],
+				paramList: [
+					{
+						pageNum: 1,
+						pageSize: 10,
+						total: 0,
+						showStatus: 0,
+						couponType:0,
+						userStatus:0
+					},
+					{
+						pageNum: 1,
+						pageSize: 10,
+						total: 0,
+						showStatus: 0,
+						couponType:1,
+						userStatus:0
+					}
+				],
+				list1: [],
+				list2: [],
+				list3: [],
+				list4: [],
+				userParamList: [
+					{
+						pageNum: 1,
+						pageSize: 10,
+						total: 0,
+						couponType:0,
+						userStatus:2
+					},
+					{
+						pageNum: 1,
+						pageSize: 10,
+						total: 0,
+						couponType:1,
+						userStatus:2
+					}
+				],
 			}
 		},
+		onReachBottom() {
+			console.log(32423)
+		},
 		onLoad(option) {
-			
+			this.getList1()
+			this.getList2()
+			this.getList3()
+			this.getList4()
 		},
 		onShow(){
 		},
 		methods: {
+			getList1(){
+				let self = this
+				let param = this.paramList[0]
+				self.$api.configurationlistCoupon(param).then(res => {
+					self.list1 = res.data.rows;
+					self.paramList[0].total = res.data.total;
+					self.items[0] = '现金券('+res.data.total+')'
+				});
+			},
+			getList2(){
+				let self = this
+				let param = this.paramList[1]
+				self.$api.configurationlistCoupon(param).then(res => {
+					self.list2 = res.data.rows;
+					self.paramList[1].total = res.data.total;
+					self.items[1] = '折扣券('+res.data.total+')'
+				});
+			},
+			getList3(){
+				let self = this
+				let param = this.userParamList[0]
+				self.$api.configurationlistCoupon(param).then(res => {
+					self.list3 = res.data.rows;
+					self.userParamList[0].total = res.data.total;
+				});
+			},
+			getList4(){
+				let self = this
+				let param = this.userParamList[1]
+				self.$api.configurationlistCoupon(param).then(res => {
+					self.list4 = res.data.rows;
+					self.userParamList[1].total = res.data.total;
+				});
+			},
 			onClickItem(e){
 				this.current = e.currentIndex
 			},