Tang 4 tahun lalu
induk
melakukan
44ded9d47a
2 mengubah file dengan 51 tambahan dan 24 penghapusan
  1. 35 21
      components/home.vue
  2. 16 3
      components/recruitment.vue

+ 35 - 21
components/home.vue

@@ -5,7 +5,7 @@
 				<view class="slot-wrap"><image src="/static/search.png" class="search" @click="jumpSearch"></image></view>
 			</u-navbar>
 		</view>
-		<scroll-view scroll-y="true" @scroll="scroll" :style="'height: ' + windowHeight + 'px;'" @scrolltolower="scrollTolower">
+		<scroll-view scroll-y="true" @scroll="scroll" :style="'height: ' + windowHeight + 'px;'" @scrolltolower="scrollTolower" refresher-enabled @refresherpulling="pulling" @refresherrefresh="refresher" @refresherrestore="restore" :refresher-triggered="triggered">
 			<view class="box">
 				<view class="my_swiper"><u-swiper :list="list" @click="swiperClick" height="330" border-radius="25" mode="none"></u-swiper></view>
 				<!-- 日历-->
@@ -130,28 +130,29 @@
 					</view>
 				</view>
 				<view v-if="paramList[current].showStatus" style="text-align: center;margin-top: 24rpx;">到底啦~</view>
-				<u-popup v-model="show" border-radius="14">
-					<view class="flex-d" style="width: 600rpx">
-						<view class="popup_t1">选择你需要的</view>
-						<view class="contentZ">
-							<view class="lzs">
-								<view class="tylsz" v-for="(item, index) in cateChild1" :key="index" @click="item.categoryId === 0 ? activeAll(1) : active1(item)" :class="item.categoryId === cateActiveIndex1 ? 'activeStys':''">{{ item.categoryName }}</view>
-							</view>
-							<view class="lzs">
-								<view class="tylsz" v-for="(item, index) in cateChild2" :key="index" @click="item.categoryId === 0 ? activeAll(2) : active2(item)" :class="item.categoryId === cateActiveIndex2 ? 'activeStys':''">{{ item.categoryName }}</view>
-							</view>
-							<view class="lzs">
-								<view class="tylsz" v-for="(item, index) in cateChild3" :key="index" @click="item.categoryId === 0 ? activeAll(3) : active3(item)" :class="item.categoryId === cateActiveIndex3 ? 'activeStys':''">{{ item.categoryName }}</view>
-							</view>
-						</view>
-						<view class="fots">
-							<view class="leftBtns" @click="initLists">重置筛选</view>
-							<view class="right_Btns" @click="searchPageInfos">确定筛选</view>
-						</view>
-					</view>
-				</u-popup>
 			</view>
+			
 		</scroll-view>
+		<u-popup v-model="show" border-radius="14">
+			<view class="flex-d" style="width: 600rpx">
+				<view class="popup_t1">选择你需要的</view>
+				<view class="contentZ">
+					<view class="lzs">
+						<view class="tylsz" v-for="(item, index) in cateChild1" :key="index" @click="item.categoryId === 0 ? activeAll(1) : active1(item)" :class="item.categoryId === cateActiveIndex1 ? 'activeStys':''">{{ item.categoryName }}</view>
+					</view>
+					<view class="lzs">
+						<view class="tylsz" v-for="(item, index) in cateChild2" :key="index" @click="item.categoryId === 0 ? activeAll(2) : active2(item)" :class="item.categoryId === cateActiveIndex2 ? 'activeStys':''">{{ item.categoryName }}</view>
+					</view>
+					<view class="lzs">
+						<view class="tylsz" v-for="(item, index) in cateChild3" :key="index" @click="item.categoryId === 0 ? activeAll(3) : active3(item)" :class="item.categoryId === cateActiveIndex3 ? 'activeStys':''">{{ item.categoryName }}</view>
+					</view>
+				</view>
+				<view class="fots">
+					<view class="leftBtns" @click="initLists">重置筛选</view>
+					<view class="right_Btns" @click="searchPageInfos">确定筛选</view>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -160,6 +161,7 @@ export default {
 	name: 'home',
 	data() {
 		return {
+			triggered: false,
 			courseItem: {},
 			cateList: [],
 			cateChild1: [],
@@ -224,6 +226,18 @@ export default {
 		this.initCateList();
 	},
 	methods: {
+		pulling(){
+			this.triggered = true
+		},
+		refresher(){
+			this.initList();
+			this.advertisingList();
+			this.initCateList();
+			this.triggered = false
+		},
+		restore(){
+			this.triggered = false
+		},
 		init() {
 			if (!this.$method.isLogin()) {
 				//未登录

+ 16 - 3
components/recruitment.vue

@@ -5,7 +5,7 @@
 				<view class="slot-wrap"><image src="/static/search.png" class="search" @click="jumpSearch"></image></view>
 			</u-navbar>
 		</view>
-		<scroll-view scroll-y="true" @scroll="scroll" style="padding-top: 20rpx;" :style="'height: ' + windowHeight + 'px;'" @scrolltolower="scrollTolower">
+		<scroll-view scroll-y="true" @scroll="scroll" style="padding-top: 20rpx;" :style="'height: ' + windowHeight + 'px;'" @scrolltolower="scrollTolower" refresher-enabled @refresherpulling="pulling" @refresherrefresh="refresher" @refresherrestore="restore" :refresher-triggered="triggered">
 			<swiper class="swiper" :autoplay="true" previous-margin="15px" next-margin="15px" :circular="true">
 				<swiper-item v-for="(item, index) in list" :key="index" style="padding: 0px 5px;box-sizing: border-box;">
 					<view style="height: 100%;border-radius: 8px;overflow: hidden;"><image :src="$method.splitImgHost(item.adverUrl)" mode="" style="width: 100%;height: 100%;" @click="swiperClick(index)"></image></view>
@@ -223,11 +223,12 @@ export default {
 			companyTypeList: [], //公司类型
 			companyTypeActiveBoxs: [], //选中公司类型
 			sxGW: false,
-			sxCM: false
+			sxCM: false,
+			triggered: false,
 		};
 	},
 	created() {
-		this.windowHeight = uni.getSystemInfoSync().windowHeight - 120;
+		this.windowHeight = uni.getSystemInfoSync().windowHeight - 100;
 	},
 	mounted() {
 		this.inits();
@@ -235,6 +236,18 @@ export default {
 		this.advertisingList();
 	},
 	methods: {
+		pulling(){
+			this.triggered = true
+		},
+		refresher(){
+			this.inits();
+			this.getDict();
+			this.advertisingList();
+			this.triggered = false
+		},
+		restore(){
+			this.triggered = false
+		},
 		swiperClick(index) {
 			let item = this.list[index];
 			uni.navigateTo({