lsw 11 kuukautta sitten
vanhempi
commit
b46b1e8a58
4 muutettua tiedostoa jossa 46 lisäystä ja 24 poistoa
  1. 10 1
      app/common/common.scss
  2. 4 0
      app/components/job/job.vue
  3. 6 13
      app/pages/index/index.scss
  4. 26 10
      app/pages/index/index.vue

+ 10 - 1
app/common/common.scss

@@ -153,7 +153,7 @@
 	margin-top: 12px;
 	overflow: hidden;
 	background-color: white;
-	border-radius: 10px;
+	border-radius: 7px;
 	box-shadow: $box-shadow;
 	.cd {
 		float: left;
@@ -248,6 +248,15 @@
 			float: right;
 		}
 	}
+	.con{
+		padding-top: 3px;
+		padding-bottom: 10px;
+		font-size: 13px;
+		color: $font-c;
+		.desc{
+			padding-right: 10px;
+		}
+	}
 	.bot {
 		border-top: 1px solid $line;
 		font-size: 13px;

+ 4 - 0
app/components/job/job.vue

@@ -5,6 +5,10 @@
 				<view class="title omit">{{ item.title }}</view>
 				<view class="salary">{{ item.salary }}</view>
 			</view>
+			<view class="con">
+				<text class="desc">{{ item.experience }}</text>
+				<text class="desc">{{ item.type == 0 ? '全职' : '兼职' }}</text>
+			</view>
 			<view class="bot">
 				<view class="address omit">
 					<text>{{ item.regionName || '地点不限' }}</text>

+ 6 - 13
app/pages/index/index.scss

@@ -1,14 +1,7 @@
-.main {
-	padding: 5px 20px 55px 20px;
-	position: relative;
-	.banner {
-		margin-top: 15px;
-		box-shadow:$box-shadow;
-	}
-	.tab {
-		background-color: white;
-		border-radius: 7px;
-		margin-top: 15px;
-		box-shadow:$box-shadow;
-	}
+.banner {
+	margin-top: 15px;
+	box-shadow: $box-shadow;
+}
+.menu {
+	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0);
 }

+ 26 - 10
app/pages/index/index.vue

@@ -3,7 +3,7 @@
 		<!--搜索-->
 		<view class="search">
 			<view class="usearch">
-				<u-search placeholder="请输入职位名称" bgColor="white" :showAction="false"></u-search>
+				<u-search placeholder="搜索工作" :disabled="true" bgColor="white" :showAction="false" @click="go('/pages/job/search')"></u-search>
 			</view>
 			<view class="address">
 				<text class="icon">&#xe62e;</text>
@@ -49,21 +49,25 @@
 				</view>
 			</view>
 		</view>
-		<!--找工作-->
-		<!-- 		<view class="tab">
-			<u-tabs :inactiveStyle="{ fontSize: '15px' }" :activeStyle="{ color: '#3c9cff', fontSize: '17px' }" :list="tab" :current="current" @click="click"></u-tabs>
-		</view> -->
-		<view class="jobs" v-if="current == 0"></view>
+		<view class="tab">
+			<u-tabs :list="tab" @click="click"></u-tabs>
+			<view class="filters" @click="show = true">
+				<text class="icon">&#xe68c;</text>
+				<text>更多</text>
+			</view>
+		</view>
+		<view class="list">
+			<job :list="list"></job>
+		</view>
 	</view>
 </template>
 <script>
 export default {
 	data() {
 		return {
-			ip: this.http.ip,
-			current: 0,
-			tab: [{ name: '最新工作' }, { name: '身边工作' }, { name: '现结工作' }],
-			user: {},
+			tab: [{ name: '推荐' }, { name: '最新' }, { name: '附近' }],
+			list: [],
+			param: { pageNum: 1, pageSize: 20, orderBy: 'id', type: 0 },
 			bannerList: [],
 			noticeList: []
 		};
@@ -71,6 +75,7 @@ export default {
 	onShow() {},
 	onLoad() {
 		this.initData();
+		this.getData();
 	},
 	methods: {
 		initData() {
@@ -92,6 +97,7 @@ export default {
 					uni.setStorageSync('city_all', res.data.data);
 				}
 			});
+			// #ifdef MP-WEIXIN
 			//授权获取位置
 			uni.authorize({
 				scope: 'scope.userLocation',
@@ -107,6 +113,16 @@ export default {
 					uni.showModal({ title: '提示', content: '定位失败,请检查是否允许定位', showCancel: false });
 				}
 			});
+			// #endif
+		},
+		getData() {
+			this.http.request({
+				url: '/app/position/list',
+				data: this.param,
+				success: (res) => {
+					this.list.push(...res.data.rows);
+				}
+			});
 		},
 		click(e) {
 			this.current = e.index;