wangxin 5 rokov pred
rodič
commit
de53e7da30

+ 1 - 0
api/api.js

@@ -73,6 +73,7 @@ const url = {
   saveHpComplaintAdvice: '/f/api/hpComplaintAdvice/saveHpComplaintAdvice',//保存投诉建议
   saveHpUserLog: '/f/api/hpComplaintAdvice/saveHpUserLog',//保存日志
   logout_new: '/f/api/login/logout_new',//注销账户
+  getCompanyStatus: '/f/api/hpinterview/getCompanyStatus',//面试登记获取企业状态
   /** +++++++++++++++++++++++++++  废弃接口 ++++++++++++++++++++++++++++++++++++++ */
   // userLogin: '/wxAppletsLogin/wxVoteLogin', // post ,根据微信CODE获取微信用户信息
   // userLogin: '/f/api/wxAppletsLogin/decodeUserInfo',

+ 5 - 2
app.js

@@ -10,7 +10,9 @@ import {
 import {
   wxLogin,
 } from './services/wx.js'
-import { saveHpUserLog } from './services/index'
+import {
+  saveHpUserLog
+} from './services/index'
 var startTime = Date.now(); //启动时间
 App({
   onLaunch: function (options) {
@@ -115,7 +117,8 @@ App({
     userToken: '',
     memberId: "",
     sessionKey: '',
-    city: updataStorageData('city') || '无锡'
+    city: updataStorageData('city') || '无锡',
+    version: '3.3.6'
   },
   //页面分享
   onShareAppMessage: function () {

+ 4 - 7
app.json

@@ -22,7 +22,6 @@
     "pages/user-job/index",
     "pages/user-works/index",
     "pages/apply-list/index",
- 
     "pages/share/index",
     "pages/check-iphone/index",
     "pages/bind-pt/index",
@@ -52,13 +51,13 @@
     "pages/pt-tip/index",
     "pages/collection-list/index",
     "pages/interview/index",
-   
     "pages/address/index",
     "pages/bind-phone/index",
     "pages/bind-phone/bind",
     "pages/select-info/index",
     "pages/choose-city/index",
     "pages/jinali-info/index",
+    "pages/interview-registration/index",
     "pages/payment-details/payment-details",
     "pages/integral/pages/integral/integral",
     "pages/integral/pages/task/task",
@@ -69,8 +68,7 @@
     "pages/integral/pages/exchange-detail/exchange-detail",
     "pages/integral/pages/integral-pay/integral-pay"
   ],
-  "subpackages": [
-    {
+  "subpackages": [{
       "root": "pages/expense",
       "pages": [
         "pages/wages/index",
@@ -89,7 +87,7 @@
     },
     {
       "root": "pages/setting",
-      "pages":[
+      "pages": [
         "pages/set/index",
         "pages/suggestions/suggestions",
         "pages/about/index"
@@ -105,8 +103,7 @@
   "tabBar": {
     "selectedColor": "#0177FF",
     "color": "#999",
-    "list": [
-      {
+    "list": [{
         "pagePath": "pages/index/index",
         "text": "主页",
         "iconPath": "/images/tabs/home.png",

+ 7 - 1
components/city/city.js

@@ -47,6 +47,13 @@ Component({
 						"countryCode": "0",
 						"countryName": "所有地区",
 					})
+				} else {
+					val.areaList = [
+						{
+							"countryCode": "0",
+							"countryName": "所有地区",
+						}
+					]
 				}
 			})
 		});
@@ -78,7 +85,6 @@ Component({
 						const cityCode = that.data.cityCode || '320200'
 						if (element.cityCode === cityCode) {
 							const areaList = element.areaList;
-							console.log(areaList)
 							that.setData({
 								areaList,
 								cityName: element.cityName,

+ 19 - 17
pages/agent/index.js

@@ -29,21 +29,21 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function(options) {
+  onLoad: function (options) {
     this.getNodePos();
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function() {
+  onReady: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function() {
+  onShow: function () {
     //获取用户user_id和member_id,判断是否处于登录态
     var userId = wx.getStorageSync("user_id");
     var userToken = wx.getStorageSync("user_token");
@@ -66,13 +66,15 @@ Page({
     query.select('.agent2').boundingClientRect()
     query.select('.agent3').boundingClientRect()
     query.select('.agent4').boundingClientRect()
-    query.exec(function(res) {
-      that.setData({
-        swiperH: res[0].height,
-        swiperH2: res[1].height,
-        swiperH3: res[2].height,
-        swiperH4: res[3].height
-      })
+    query.exec(function (res) {
+      if (res[0]) {
+        that.setData({
+          swiperH: res[0].height,
+          swiperH2: res[1].height,
+          swiperH3: res[2].height,
+          swiperH4: res[3].height
+        })
+      }
     })
   },
   //获取位置
@@ -80,7 +82,7 @@ Page({
     var query = wx.createSelectorQuery()
     query.select('#agentJoin').boundingClientRect()
     var that = this;
-    query.exec(function(res) {
+    query.exec(function (res) {
       that.setData({
         basePos: res[0].top + 500,
       })
@@ -94,12 +96,12 @@ Page({
       duration: 0
     })
   },
-  changeName: function(e) {
+  changeName: function (e) {
     this.setData({
       name: e.detail.value
     })
   },
-  changeContact: function(e) {
+  changeContact: function (e) {
     this.setData({
       contact: e.detail.value
     })
@@ -113,7 +115,7 @@ Page({
       sex_index: value
     })
   },
-  changeYear: function(e) {
+  changeYear: function (e) {
     this.setData({
       year: e.detail.value
     })
@@ -147,14 +149,14 @@ Page({
     }
     var regNum = new RegExp('[0-9]', 'g');
     var rsNum = regNum.exec(year);
-    if (!rsNum){
+    if (!rsNum) {
       showToast("年龄请输入正确的数字")
       return;
     }
     wx.showModal({
       title: '提示',
       content: '确定提交吗?',
-      success: function(res) {
+      success: function (res) {
         if (res.confirm) {
           let paramsObj = {
             user_id: app.globalData.userId,
@@ -168,7 +170,7 @@ Page({
           Object.assign(paramsObj);
           saveAgent(paramsObj).then(data => {
             showToast('提交成功', 'success')
-            setTimeout(function() {
+            setTimeout(function () {
               wx.navigateBack();
             }, 1000)
           })

+ 10 - 3
pages/bind-phone/bind.js

@@ -47,9 +47,16 @@ Page({
 			wx.setStorageSync("phone", data.data.hpUser.phone);
 			showToast("绑定成功");
 			setTimeout(function () {
-				wx.switchTab({
-					url: '/pages/index/index',
-				});
+				const pages = getCurrentPages();
+				if (pages.length <= 3) {
+					wx.switchTab({
+						url: '/pages/index/index',
+					});
+				} else {
+					wx.navigateBack({
+						delta: 3,
+					})
+				}
 			}, 500)
 		})
 	},

+ 1 - 1
pages/expense/pages/return-fee/detail.json

@@ -1,6 +1,6 @@
 {
   "usingComponents": {
-    "i-modal": "../../ui/modal/index"
+    "i-modal": "../../../../ui/modal/index"
   },
   "navigationBarTitleText": "入职奖励"
 }

+ 10 - 9
pages/index/index.js

@@ -60,15 +60,6 @@ Page({
         }
       })
     }
-  },
-  reload() {
-    this.onPullDownRefresh();
-  },
-  start() {
-    this.fetchBanner();
-    this.fetchList();
-  },
-  onShow: function () {
     this.setData({
       cityName: wx.getStorageSync('city') || '无锡',
       cityCode: wx.getStorageSync('cityCode') || '320200',
@@ -80,6 +71,16 @@ Page({
       this.start();
     })
   },
+  reload() {
+    this.onPullDownRefresh();
+  },
+  start() {
+    this.fetchBanner();
+    this.fetchList();
+  },
+  onShow: function () {
+
+  },
   //下拉刷新
   onPullDownRefresh: function () {
     this.setData({

+ 1 - 1
pages/integral/pages/integral/integral.wxml

@@ -7,7 +7,7 @@
     <image class="header-bg" src="../../images/sign_background.jpeg"></image>
     <view class="header-content">
       <view class="score">
-        <text class="fen">{{mpMemberAccount.pointsBalance}}</text>
+        <text class="fen">{{mpMemberAccount.pointsBalance || 0}}</text>
         <text>分</text>
       </view>
       <navigator url="/pages/payment-details/payment-details?type=integral" hover-class="none" class="score-detail">查看我的积分明细 >></navigator>

+ 70 - 0
pages/interview-registration/index.js

@@ -0,0 +1,70 @@
+// pages/interview-registration/index.js
+import { getCompanyStatus } from '../../services/index'
+Page({
+
+	/**
+	 * 页面的初始数据
+	 */
+	data: {
+		show: false,
+		options: {}
+	},
+
+	/**
+	 * 生命周期函数--监听页面加载
+	 */
+	onLoad: function (options) {
+		this.setData({
+			options
+		})
+	},
+	onShow: function (data) {
+		let user_token = wx.getStorageSync('user_token');
+		let user_id = wx.getStorageSync('user_id');
+		let member_id = wx.getStorageSync('member_id');
+		if (user_id && user_token && member_id) {
+			const options = this.data.options;
+			getCompanyStatus({ registerCompanyId: options.registerCompanyId }).then(data => {
+				if (data.data.isOn) {
+					let url = options.url;
+					url = url + `?registerCompanyId=${options.registerCompanyId}`
+					url = url + `&&user_token=${user_token}`
+					url = url + `&&user_id=${user_id}`
+					url = url + `&&member_id=${member_id}`
+					this.setData({
+						url,
+						show: true
+					})
+				} else {
+					wx.showModal({
+						title: '提示',
+						confirmText: '确定',
+						content: '二维码已停用',
+						showCancel: false,
+						success: (result) => {
+							if (result.confirm) {
+								wx.switchTab({
+									url: '/pages/index/index',
+								})
+							}
+						},
+					})
+				}
+			})
+		} else {
+			wx.showModal({
+				title: '提示',
+				confirmText: '确定',
+				content: '请先登录',
+				showCancel: false,
+				success: res => {
+					if (res.confirm) {
+						wx.navigateTo({
+							url: '/pages/login/login',
+						})
+					}
+				}
+			})
+		}
+	}
+})

+ 3 - 0
pages/interview-registration/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
pages/interview-registration/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/interview-registration/index.wxml-->
+<web-view wx:if='{{show}}' src="{{url}}"></web-view>

+ 1 - 0
pages/interview-registration/index.wxss

@@ -0,0 +1 @@
+/* pages/interview-registration/index.wxss */

+ 30 - 15
pages/setting/pages/set/index.js

@@ -4,8 +4,12 @@ import {
 import {
   showToast
 } from '../../../../utils/tips.js'
-import { logout_new } from '../../../../services/index'
-import { rootUrl } from '../../../../config/config'
+import {
+  logout_new
+} from '../../../../services/index'
+import {
+  rootUrl
+} from '../../../../config/config'
 var app = getApp()
 Page({
 
@@ -16,24 +20,33 @@ Page({
     rootUrl,
     imgServerUrl: imgServerUrl,
     visible: false,
-    actions: [
-      {
-        name: '确定注销',
-        color: '#0177FF',
-        fontWeight: 500
-      },
-      {
-        name: '取消',
-        color: '#0177FF',
-      },
-    ]
+    actions: [{
+      name: '确定注销',
+      color: '#0177FF',
+      fontWeight: 500
+    },
+    {
+      name: '取消',
+      color: '#0177FF',
+    },
+    ],
+    version: ''
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    if (wx.getAccountInfoSync) {
+      const info = wx.getAccountInfoSync()
+      this.setData({
+        version: info.miniProgram.version || app.globalData.version
+      })
+    } else {
+      this.setData({
+        version: app.globalData.version
+      })
+    }
   },
   toclear() {
     wx.showModal({
@@ -116,7 +129,9 @@ Page({
     }
   },
   toPage(e) {
-    const { url } = e.currentTarget.dataset;
+    const {
+      url
+    } = e.currentTarget.dataset;
     wx.navigateTo({
       url,
     })

+ 1 - 1
pages/setting/pages/set/index.json

@@ -1,5 +1,5 @@
 {
   "usingComponents": {
-    "i-modal": "../../ui/modal/index"
+    "i-modal": "../../../../ui/modal/index"
   }
 }

+ 1 - 1
pages/setting/pages/set/index.wxml

@@ -5,7 +5,7 @@
 <view class='cell' hover-class="hover" bindtap='toabout'>
 	<view class='content'>
 		<text>关于我们</text>
-		<text class="version">v3.3.5</text>
+		<text class="version">v{{version}}</text>
 	</view>
 	<image class='jiantou' src='{{imgServerUrl}}/images/happyjob/rightwjt.png'></image>
 </view>

+ 4 - 0
pages/user-works/index.wxss

@@ -94,6 +94,10 @@ icon {
   background: #D8D8D8;
 }
 
+button::after {
+  border: none;
+}
+
 .arrow {
   width: 17rpx;
   height: 29rpx;

+ 1 - 1
pages/wallet/pages/index/index.json

@@ -1,6 +1,6 @@
 {
   "navigationBarTitleText": "我的钱包",
   "usingComponents": {
-    "i-icon": "../../ui/icon/index"
+    "i-icon": "../../../../ui/icon/index"
   }
 }

+ 5 - 17
project.config.json

@@ -13,7 +13,7 @@
 		]
 	},
 	"setting": {
-		"urlCheck": false,
+		"urlCheck": true,
 		"es6": true,
 		"enhance": true,
 		"postcss": true,
@@ -33,10 +33,12 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"bundle": true
+		"bundle": true,
+		"useCompilerModule": true,
+		"userConfirmedUseCompilerModuleSwitch": false
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.8.3",
+	"libVersion": "2.10.2",
 	"appid": "wx1e8ed93850777ffb",
 	"projectname": "kaixin",
 	"debugOptions": {
@@ -341,20 +343,6 @@
 					"pathName": "pages/expense/pages/return-fee/detail",
 					"query": "hpUserResumeId=56629&index=0",
 					"scene": null
-				},
-				{
-					"id": 39,
-					"name": "pages/setting/pages/set/index",
-					"pathName": "pages/setting/pages/set/index",
-					"query": "",
-					"scene": null
-				},
-				{
-					"id": -1,
-					"name": "投诉建议",
-					"pathName": "pages/suggestions/suggestions",
-					"query": "",
-					"scene": null
 				}
 			]
 		}

+ 8 - 0
services/index.js

@@ -559,6 +559,14 @@ module.exports = {
       header: {}
     })
   },
+  getCompanyStatus(params){
+    return http({
+      url: url.getCompanyStatus,
+      data: params,
+      method: 'GET',
+      header: {}
+    })
+  },
   /**************************废弃接口**************************** */
   //post 用户简历:用户教育背景编辑、新增
   resumeEdu(params) {

+ 28 - 81
utils/http.js

@@ -2,7 +2,9 @@ var config = require('../config/config.js')
 import {
   showToast
 } from '../utils/tips.js'
-
+const noRelaunch = [
+  'pages/interview-registration/index'
+]
 //model状态
 let model = true;
 let loading = true;
@@ -48,6 +50,7 @@ const http = (params) => {
       });
     }
     const pages = getCurrentPages();
+
     wx.request({
       url: apiUrl + params.url, //服务器url+参数中携带的接口具体地址
       data: getData(params.data), //请求参数
@@ -72,7 +75,7 @@ const http = (params) => {
             wx.setStorageSync('sessionKey', res.data.data.sessionKey);
             wx.setStorageSync('unionId', res.data.data.unionId);
             //前往绑定手机号
-            wx.redirectTo({
+            wx.navigateTo({
               url: '/pages/bind-phone/index',
             })
           } else if (errorCode == 4000) {
@@ -81,17 +84,7 @@ const http = (params) => {
               confirmText: '好的',
               content: res.data.errmsg,
               showCancel: false,
-              success: () => {
-                // wx.setClipboardData({
-                //   data: '4009960099',
-                //   success: (res) => {
-                //     // wx.showToast({
-                //     //   icon: 'none',
-                //     //   title: '客服电话已复制',
-                //     // })
-                //   },
-                // })
-              }
+              success: () => { }
             })
             return
           } else if (errorCode == 1005) {
@@ -109,55 +102,30 @@ const http = (params) => {
           } else if (errorCode == 2008) {
             //账号不存在,或token无效
             if (model && params.data.task_id !== 10) {
-              const _type = pages.length === 1 ? 'reLaunch' : 'navigateTo';
-              wx[_type]({
-                url: '/pages/login/login',
+              wx.showModal({
+                title: '提示',
+                content: '登录失效请重新登录',
+                // showCancel: false,
                 success: res => {
-                  wx.showModal({
-                    title: '提示',
-                    content: '登录失效请重新登录',
-                    showCancel: false,
-                    success: res => {
-                      if (res.confirm) {
-                        model = true;
+                  if (res.confirm) {
+                    model = true;
+                    wx.navigateTo({
+                      url: '/pages/login/login',
+                    })
+                  }
+                  if (res.cancel) {
+                    model = true;
+                    wx.navigateBack({
+                      delta: 1,
+                      fail: res => {
+                        wx.switchTab({
+                          url: '/pages/index/index',
+                        })
                       }
-                    }
-                  })
+                    })
+                  }
                 }
               })
-              // if (pages.length === 1) {
-              //   wx.reLaunch({
-              //     url: '/pages/login/login',
-              //     success: res => {
-              //       wx.showModal({
-              //         title: '提示',
-              //         content: '登录失效请重新登录',
-              //         showCancel: false,
-              //         success: res => {
-              //           if (res.confirm) {
-              //             model = true;
-              //           }
-              //         }
-              //       })
-              //     }
-              //   })
-              // } else {
-              //   wx.navigateTo({
-              //     url: '/pages/login/login',
-              //     success: res => {
-              //       wx.showModal({
-              //         title: '提示',
-              //         content: '登录失效请重新登录',
-              //         showCancel: false,
-              //         success: res => {
-              //           if (res.confirm) {
-              //             model = true;
-              //           }
-              //         }
-              //       })
-              //     }
-              //   })
-              // }
               model = false
             }
             return
@@ -184,27 +152,6 @@ const http = (params) => {
                 })
               }
             })
-            // 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);
@@ -238,11 +185,11 @@ const http = (params) => {
       complete: (res) => {
         wx.stopPullDownRefresh({
           success: () => {
-            console.log(`${pages[pages.length - 1] ? pages[pages.length - 1].route : pages} => stopPullDownRefresh`);
+            console.log(`${pages.length ? pages[pages.length - 1].route : '应用加载中...'} => stopPullDownRefresh`);
           }
         });
         try {
-          console.log('当前页面=>', pages[pages.length - 1].route)
+          console.log('当前页面=>', pages.length ? pages[pages.length - 1].route : '初始化中...')
           console.log("请求参数=>", params);
           console.log(`请求状态码=>${res.statusCode}`, `状态信息=>${res.errMsg}`);
           console.log("返回结果=>", res.data);