瀏覽代碼

修复求职意向无法选择的bug

wangxin 5 年之前
父節點
當前提交
f92ff073dd

+ 5 - 4
components/jianli/jianli.wxml

@@ -53,11 +53,11 @@
 		</view>
 		<view class="cell">
 			<view class="cell-title">期望地点:</view>
-			<view class="cell-content">{{userResume.expectationAddress}}</view>
+			<view class="cell-content">{{userResume.expectationAddress || ''}}</view>
 		</view>
 		<view class="cell">
 			<view class="cell-title">期望薪资:</view>
-			<view class="cell-content">{{userResume.expectationSalary}}</view>
+			<view class="cell-content">{{userResume.expectationSalary || ''}}</view>
 		</view>
 	</view>
 	<!-- 求职意向结束 -->
@@ -78,9 +78,10 @@
 	</view>
 	<!-- 工作经历结束 -->
 
-	<view class="add-experience" wx:if='{{edit}}' bindtap="addNew">
-		<image src="{{imgServerUrl}}/images/happyjob/jianli_add.png"></image>
+	<view class="add-experience" wx:if='{{edit}}'>
+		<image class="add-experience-image" src="{{imgServerUrl}}/images/happyjob/jianli_add.png"></image>
 		<text>添加工作经历</text>
+		<view class="add-experience-content" bindtap="addNew"></view>
 	</view>
 
 

+ 11 - 4
components/jianli/jianli.wxss

@@ -1,7 +1,4 @@
 /* components/jianli/jianli.wxss */
-page {
-	background: #f5f5f5;
-}
 
 .edit {
 	color: #0177FF;
@@ -109,10 +106,20 @@ page {
 	display: flex;
 	align-items: center;
 	justify-content: center;
+	position: relative;
 }
 
-.add-experience image {
+.add-experience-image {
 	height: 35rpx;
 	width: 35rpx;
 	margin-right: 30rpx;
+}
+
+.add-experience-content {
+	height: 100%;
+	width: 100%;
+	position: absolute;
+	left: 0;
+	top: 0;
+	z-index: 99;
 }

+ 1 - 1
components/send-code/send-code.js

@@ -40,7 +40,7 @@ Component({
     auto_send: {
       type: Boolean,
       value: false,
-      observer() {
+      observer(data) {
         if (data === true) {
           this.send()
         }

+ 5 - 2
pages/bind-phone/bind.js

@@ -5,6 +5,7 @@ import {
 import {
 	saveMinaPhone
 } from '../../services/wx';
+import { showToast } from '../../utils/tips'
 Page({
 
 	/**
@@ -44,9 +45,11 @@ Page({
 			wx.setStorageSync("member_id", data.data.hpMember.id);
 			wx.setStorageSync("user_token", data.data.hpUser.userToken);
 			wx.setStorageSync("phone", data.data.hpUser.phone);
-			showToast("登录成功");
+			showToast("绑定成功");
 			setTimeout(function () {
-				wx.navigateBack();
+				wx.switchTab({
+					url: '/pages/index/index',
+				});
 			}, 500)
 		})
 	},

+ 1 - 1
pages/city/index.wxml

@@ -42,7 +42,7 @@
       <block wx:if="{{index===0}}">
         <!-- <view class='panel'>定位城市</view> -->
         <view class='location_city'>
-          <view data-text="{{currcity}}" data-code="{{currcityCode}}" bindtap="wxSortPickerViewItemTap">
+          <view data-text="{{currcity}}" data-code="{{currcityCode}}">
             <text>{{currcity}}</text>
             <text class="active">当前定位</text>
           </view>

+ 1 - 1
pages/detail/index.js

@@ -442,7 +442,7 @@ Page({
       if (postitionDetail.applyCondition) {
         WxParse.wxParse('applyCondition', 'html', postitionDetail.applyCondition, this);
       }
-      this.getNodePos();
+      // this.getNodePos();
     })
   },
 

+ 5 - 1
pages/jianli/index.wxss

@@ -1,3 +1,7 @@
+page {
+  background: #f5f5f5;
+}
+
 .card {
   display: flex;
   flex-direction: row;
@@ -168,4 +172,4 @@
 .wx {
   padding-top: 29rpx;
   width: 100%;
-}
+}

+ 5 - 1
pages/jinali-info/index.wxss

@@ -1,3 +1,7 @@
+page {
+  background: #f5f5f5;
+}
+
 .card {
   display: flex;
   flex-direction: row;
@@ -165,4 +169,4 @@
 .wx {
   padding-top: 29rpx;
   width: 100%;
-}
+}

+ 0 - 4
pages/mine/index.js

@@ -68,10 +68,6 @@ Page({
         app.globalData.userInfo = userInfo;
       }
       this.start();
-    } else {
-      wx.navigateTo({
-        url: '/pages/login/login',
-      })
     }
     this.setData({
       avatar: (app.globalData.userInfo && app.globalData.userInfo.avatarUrl) ? app.globalData.userInfo.avatarUrl : `${imgServerUrl}/images/avatar/man.png`,

+ 3 - 3
pages/mine/index.wxml

@@ -53,16 +53,16 @@
 
 	<view class='jianli' wx:if="{{isLogin}}">
 		<view class="jianli-left">
-			<view class="jianli-title">
+			<view class="jianli-title" bindtap='tojianli'>
 				<text>我的简历</text>
-				<view class="edit" wx:if='{{percent === "100"}}' bindtap='tojianli'>
+				<view class="edit" wx:if='{{percent === "100"}}' >
 					<image class="edit1" src="{{imgServerUrl}}/images/happyjob/edit1.png" />
 					<text>编辑简历</text>
 				</view>
 			</view>
 			<view class="tips color" wx:if='{{percent === "100"}}'>快去看看有没有心仪的岗位吧!</view>
 			<view class="tips" wx:else>完善简历可以获得更多面试机会!</view>
-			<i-tag i-class="tag-class" color='#0177FF' bindtap='{{percent === "100"?"toPosition":"tojianli"}}'>{{percent === "100"?'去看看':'去完善'}}</i-tag>
+			<i-tag i-class="tag-class" color='#0177FF'  catchtap='{{percent === "100"?"toPosition":"tojianli"}}'>{{percent === "100"?'去看看':'去完善'}}</i-tag>
 		</view>
 		<view class="jianli-right">
 			<view class="circle">

+ 48 - 25
pages/user-job/index.js

@@ -1,5 +1,6 @@
 import {
-  resumeIntent} from '../../services/index.js'
+  resumeIntent
+} from '../../services/index.js'
 import {
   imgServerUrl
 } from '../../config/config.js'
@@ -64,7 +65,7 @@ Page({
       value: []
     }, //省市区
     name: '',
-    expectationPositionIndex: 0,
+    expectationPositionIndex: [],
     salaryIndex: 0,
     hpUserIntentionId: '',
     hpUserResumeId: '',
@@ -86,39 +87,56 @@ Page({
 
     if (hpUserResumeId) {
       let userResume = wx.getStorageSync('userResume')
+      let region = {
+        code: [],
+        value: []
+      };
 
-      this.data.region.code = this.data.region.code.concat(userResume.expectationProvinceId);
-      this.data.region.code = this.data.region.code.concat(userResume.expectationCityId);
-      this.data.region.code = this.data.region.code.concat(userResume.expectationCountryId);
+      let salaryIndex = 0;
+      let expectationArray = [];
       const expectationPosition = this.data.expectationPosition;
-      let arr = userResume.expectationAddress.split("-");
-      for (let i = 0; i < arr.length; i++) {
-        this.data.region.value = this.data.region.value.concat(arr[i]);
-      }
-      let expectationArray = userResume.expectationPosition;
-      let lengthSalary = this.data.salaryList.length;
-      let salaryIndex;
-      for (let i = 0; i < lengthSalary; i++) {
-        if (userResume.expectationSalary == this.data.salaryList[i].hightNum) {
-          salaryIndex = i;
+
+      if (userResume && userResume.id) {
+        if (userResume.expectationAddress) {
+          region.code.push(userResume.expectationProvinceId);
+          region.code.push(userResume.expectationCityId);
+          region.code.push(userResume.expectationCountryId);
+          let arr = userResume.expectationAddress.split("-");
+          for (let i = 0; i < arr.length; i++) {
+            region.value.push(arr[i]);
+          }
+        }
+        if (userResume.expectationPosition) {
+          expectationArray = userResume.expectationPosition.split(',');
+          let lengthSalary = this.data.salaryList.length;
+          for (let i = 0; i < lengthSalary; i++) {
+            if (userResume.expectationSalary == this.data.salaryList[i].hightNum) {
+              salaryIndex = i;
+            }
+          }
+          expectationArray.forEach(value => {
+            if(value){
+              expectationPosition[value].active = true
+            }
+          })
         }
-      }
-      expectationArray.split(',').forEach(value => {
-        expectationPosition[value].active = true
-      })
-      if (userResume.id) {
         this.setData({
           hpUserResumeId: userResume.id,
           expectationPositionIndex: expectationArray,
           salaryIndex: salaryIndex,
-          region: this.data.region,
+          region,
           expectationPosition
         }, _ => {
           this.check()
         })
       }
     }
-
+  },
+  changeSalary() {
+    this.setData({
+      cover: false,
+      salary: false
+    })
   },
   changeCover(e) {
     const { type } = e.currentTarget.dataset;
@@ -148,7 +166,7 @@ Page({
   //改变期望岗位
   changeName(e) {
     const { index } = e.currentTarget.dataset;
-    let expectationPositionIndex = this.data.expectationPositionIndex.split(',');
+    let expectationPositionIndex = this.data.expectationPositionIndex;
     const expectationPosition = this.data.expectationPosition;
     if (expectationPosition[index].active) {
       expectationPosition[index].active = false;
@@ -160,8 +178,13 @@ Page({
       expectationPosition[index].active = true;
       expectationPositionIndex.push(index)
     }
+    expectationPositionIndex.forEach((value, index) => {
+      if (!value && value !== 0) {
+        expectationPositionIndex.splice(index, 1)
+      }
+    })
     this.setData({
-      expectationPositionIndex: expectationPositionIndex.join(','),
+      expectationPositionIndex: expectationPositionIndex,
       expectationPosition
     }, _ => {
       this.check()
@@ -194,7 +217,7 @@ Page({
       salaryList
     } = this.data
     let paramsObj = {
-      expectationPosition: expectationPositionIndex,
+      expectationPosition: expectationPositionIndex.join(','),
       expectationSalary: salaryList[salaryIndex].expectationSalary,
       expectationProvinceId: region.code[0],
       expectationCityId: region.code[1],

+ 19 - 13
pages/user-job/index.wxml

@@ -4,33 +4,39 @@
 	<view class="list-content">
 		<!-- <picker bindchange="changeName" value="{{expectationPositionIndex}}" range="{{expectationPosition}}"> -->
 		<view class="picker" bindtap="changeCover" data-type="position">
-			<block wx:if='{{expectationPositionIndex}}'>
-				<block wx:for="{{globalTools.splitStr1(expectationPositionIndex,',')}}" wx:key='index'>{{expectationPosition[item].name}}</block>
-			</block>
-			<block wx:else>
-				<text>请选择</text>
-			</block>
+			<view class="pick-view">
+				<block wx:if='{{expectationPositionIndex.length}}'>
+					<view>
+						<block wx:for="{{expectationPositionIndex}}" wx:key='index'>
+							<text space="nbsp">{{expectationPosition[item].name}} </text>
+						</block>
+					</view>
+				</block>
+				<block wx:else>
+					<text>请选择</text>
+				</block>
+			</view>
 			<image class='arrow' src='{{imgServerUrl}}/images/happyjob/rightwjt.png'></image>
 		</view>
 	</view>
 </view>
 <view class='list'>
 	<text>期望地点:</text>
-	<view class="list-content">
+	<view class="list-content" bindtap="bindRegionChange">
 		<!-- <picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}"> -->
-		<view wx:if='{{region.value.length}}' class="picker" bindtap="bindRegionChange" data-type="address">
-			{{region.value[0]}},{{region.value[1]}},{{region.value[2]}}
+		<view wx:if='{{region.value.length}}' class="picker" data-type="address">
+			<text>{{region.value[0]}},{{region.value[1]}},{{region.value[2]}}</text>
 		</view>
-		<text wx:else>请选择</text>
+		<text  wx:else>请选择</text>
 		<image class='arrow' src='{{imgServerUrl}}/images/happyjob/rightwjt.png'></image>
 	</view>
 </view>
 <view class='list'>
 	<text>期望薪资:</text>
-	<view class="list-content">
+	<view class="list-content" bindtap="changeSalary">
 		<!-- <view bindtap="changeCover" value="{{salaryIndex}}" range="{{salaryList}}" range-key='hightNum'> -->
-		<view wx:if='{{salaryIndex}}' data-type="salary" bindtap="changeCover" class="picker">
-			{{salaryList[salaryIndex].hightNum}}
+		<view wx:if='{{salaryIndex}}' data-type="salary" class="picker">
+			<text>{{salaryList[salaryIndex].hightNum}}</text>
 		</view>
 		<text wx:else>请选择</text>
 		<image class='arrow' src='{{imgServerUrl}}/images/happyjob/rightwjt.png'></image>

+ 8 - 1
pages/user-job/index.wxss

@@ -54,7 +54,14 @@ page {
   justify-content: flex-end;
 }
 
-
+.list view .picker .pick-view {
+  flex: 1;
+  height: 100%;
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  justify-content: flex-end;
+}
 
 /* btn */
 

+ 8 - 1
project.config.json

@@ -36,7 +36,7 @@
 		"bundle": true
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.8.2",
+	"libVersion": "2.8.3",
 	"appid": "wx5ae6908ae55edcb7",
 	"projectname": "kaixin",
 	"debugOptions": {
@@ -348,6 +348,13 @@
 					"pathName": "pages/ence_push/ence_push",
 					"query": "",
 					"scene": null
+				},
+				{
+					"id": -1,
+					"name": "pages/detail/index",
+					"pathName": "pages/detail/index",
+					"query": "hpPositionId=361&cate=0",
+					"scene": null
 				}
 			]
 		}

+ 23 - 10
utils/http.js

@@ -121,15 +121,28 @@ const http = (params) => {
             //后台接口异常
           } else if (errorCode == 2010) {
             //用户未登录
-            wx.navigateTo({
-              url: '/pages/login/login',
-              success: data => {
-                wx.showToast({
-                  icon: 'none',
-                  title: '请先登录',
-                })
-              }
-            })
+            if (pages.length === 1) {
+              wx.reLaunch({
+                url: '/pages/login/login',
+                success: data => {
+                  wx.showToast({
+                    icon: 'none',
+                    title: '请先登录',
+                  })
+                }
+              })
+            } else {
+              wx.navigateTo({
+                url: '/pages/login/login',
+                success: data => {
+                  wx.showToast({
+                    icon: 'none',
+                    title: '请先登录',
+                  })
+                }
+              })
+            }
+
             return
           }
           params.data.task_id !== 10 && showToast(res.data.errmsg);
@@ -163,7 +176,7 @@ const http = (params) => {
       complete: (res) => {
         wx.stopPullDownRefresh({
           success: () => {
-            console.log(`${pages[pages.length - 1].route} => stopPullDownRefresh`);
+            console.log(`${pages[pages.length - 1] ? pages[pages.length - 1].route : pages} => stopPullDownRefresh`);
           }
         });
         try {