lhl 4 år sedan
förälder
incheckning
177327734a
2 ändrade filer med 50 tillägg och 6 borttagningar
  1. 18 0
      api/apply.js
  2. 32 6
      pages/user/applyList.vue

+ 18 - 0
api/apply.js

@@ -15,4 +15,22 @@ export function getApplyList(data) {
 		method:'get',
 		data
 	})
+}
+
+//通过审核
+export function passApply(data,id) {
+	return request({
+		url: '/api/activity/pass/' + id,
+		method:'get',
+		data
+	})
+}
+
+//审核不通过
+export function cancelApply(data,id) {
+	return request({
+		url: '/api/activity/cancel/' + id,
+		method:'get',
+		data
+	})
 }

+ 32 - 6
pages/user/applyList.vue

@@ -9,7 +9,9 @@
 			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
 				<scroll-view scroll-y="true" class="list-scroll-content" :style="{'height':height}">
 					<!-- 申请列表 -->
-					<view class="apply-box" v-for="item in 20">
+					<!-- 空白页 -->
+					<!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
+					<view class="apply-box" v-for="item in tabItem.orderList">
 						<view class="box-top">
 							<image src="" mode="" class="user-img"></image>
 							<view class="user-info">
@@ -26,14 +28,15 @@
 								<image src="" mode="" class="upimg" v-for="item in 2"></image>
 							</view>
 							<view class="btn-wrap flex" v-if="tabCurrentIndex == 0">
-								<view class="btn btn-reject">拒绝</view>
-								<view class="btn btn-pass">通过</view>
+								<view class="btn btn-reject" @click="cancelApply()">拒绝</view>
+								<view class="btn btn-pass" @click="passApply()">通过</view>
 							</view>
 							<view class="btn-wrap" v-if="tabCurrentIndex == 1">
 								已通过
 							</view>
 						</view>
 					</view>
+					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
 				</scroll-view>
 			</swiper-item>
 		</swiper>
@@ -42,9 +45,14 @@
 
 <script>
 	import {
-		getApplyList
+		getApplyList, passApply, cancelApply
 	} from '../../api/apply.js'
+	
+	import empty from '@/components/empty';
 	export default {
+		components: {
+			empty
+		},
 		data() {
 			return {
 				height: '',
@@ -114,9 +122,27 @@
 					page: navItem.page,
 					limit: navItem.limit,
 					status: state
-				}).then( res => {
-					console.log(res)
+				}).then( ({data}) => {
+					let arr = data.list.map( item => {
+						return item
+					})
+					navItem.orderList =  navItem.orderList.concat(arr)
+					if(data.list.length == navItem.limit) {
+						navItem.page++
+						navItem.loadingType = 'more'
+					}else {
+						navItem.loadingType = 'noMore'
+					}
+					this.$set(navItem,'loaded',true)
 				})
+			},
+			cancelApply() {
+				console.log('cancelApply')
+				// cancelApply()
+			},
+			passApply() {
+				console.log('passApply')
+				// passApply()
 			}
 		}
 	}