浏览代码

修改部分bug

ZhangWenQiang 6 年之前
父节点
当前提交
37c9d58361
共有 2 个文件被更改,包括 19 次插入7 次删除
  1. 2 1
      pages/detail/index.wxss
  2. 17 6
      pages/user-job/index.js

+ 2 - 1
pages/detail/index.wxss

@@ -25,6 +25,7 @@
   display: flex;
   align-items: center;
   margin-bottom: 40rpx;
+  justify-content: space-between;
 }
 
 .panel .job {
@@ -44,6 +45,7 @@
   margin-left: 10rpx;
   color: #6a9fe8;
   font-size: 28rpx;
+  width: 80%;
 }
 
 .panel .money {
@@ -53,7 +55,6 @@
 }
 
 .panel .rule {
-  margin-left: 100rpx;
   height: 40rpx;
   line-height: 36rpx;
   color: #bdbaba;

+ 17 - 6
pages/user-job/index.js

@@ -13,6 +13,10 @@ Page({
   data: {
     imgServerUrl: imgServerUrl,
     salaryList: [{
+        "expectationSalary": null,
+        "hightNum": '请选择'
+      },
+      {
         "expectationSalary": -1,
         "hightNum": '不限'
       },
@@ -58,8 +62,8 @@ Page({
     ],
     expectationPosition: ["普工", "客服", "销售", "服务员", "物流仓储", "司机", "才艺技能", "文员助理", "快递配送", "促销导购", "展会演出", "家教培训", "模特", "贸易采购", "厨师", "编辑", "线上推广", "设计", "技工", "保洁", "其它"],
     region: {
-      code:[],
-      value:[]
+      code: [],
+      value: []
     }, //省市区
     name: '',
     expectationPositionIndex: 0,
@@ -80,15 +84,15 @@ Page({
 
     if (hpUserResumeId) {
       let userResume = wx.getStorageSync('userResume')
-      
+
       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);
       var expectationArray = userResume.expectationPosition;
       var lengthSalary = this.data.salaryList.length;
       var salaryIndex;
-      for (var i = 0; i < lengthSalary;i++){
-        if (userResume.expectationSalary == this.data.salaryList[i].hightNum){
+      for (var i = 0; i < lengthSalary; i++) {
+        if (userResume.expectationSalary == this.data.salaryList[i].hightNum) {
           salaryIndex = i;
         }
       }
@@ -107,6 +111,7 @@ Page({
 
   //改变薪资水平
   bindSalaryChange(e) {
+    console.log('picker改变薪资水平,携带值为', e.detail)
     this.setData({
       salaryIndex: e.detail.value
     })
@@ -161,8 +166,14 @@ Page({
   //验证
   check() {
     let {
-      region
+      region,
+      salaryList,
+      salaryIndex
     } = this.data
+    if (salaryList[salaryIndex].expectationSalary == null) {
+      showToast('请选择期望薪资');
+      return false
+    }
     if (region.value.length == 0) {
       showToast('请选择期望地点');
       return false