正在显示
42 个修改的文件
包含
2051 行增加
和
417 行删除
@@ -6,35 +6,167 @@ App({ | @@ -6,35 +6,167 @@ App({ | ||
6 | logs.unshift(Date.now()) | 6 | logs.unshift(Date.now()) |
7 | wx.setStorageSync('logs', logs) | 7 | wx.setStorageSync('logs', logs) |
8 | 8 | ||
9 | - // 登录 | ||
10 | - wx.login({ | ||
11 | - success: res => { | ||
12 | - // 发送 res.code 到后台换取 openId, sessionKey, unionId | ||
13 | - } | 9 | + //自动更新版本 |
10 | + const updateManager = wx.getUpdateManager() | ||
11 | + updateManager.onCheckForUpdate(function (res) { | ||
12 | + // 请求完新版本信息的回调 | ||
14 | }) | 13 | }) |
15 | - // 获取用户信息 | ||
16 | - wx.getSetting({ | ||
17 | - success: res => { | ||
18 | - if (res.authSetting['scope.userInfo']) { | ||
19 | - // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 | ||
20 | - wx.getUserInfo({ | ||
21 | - success: res => { | ||
22 | - // 可以将 res 发送给后台解码出 unionId | ||
23 | - this.globalData.userInfo = res.userInfo | ||
24 | 14 | ||
25 | - // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 | ||
26 | - // 所以此处加入 callback 以防止这种情况 | ||
27 | - if (this.userInfoReadyCallback) { | ||
28 | - this.userInfoReadyCallback(res) | ||
29 | - } | ||
30 | - } | ||
31 | - }) | 15 | + updateManager.onUpdateReady(function () { |
16 | + wx.showModal({ | ||
17 | + title: '更新提示', | ||
18 | + content: '新版本已经准备好,是否重启应用?', | ||
19 | + success: function (res) { | ||
20 | + if (res.confirm) { | ||
21 | + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 | ||
22 | + updateManager.applyUpdate() | ||
23 | + } | ||
32 | } | 24 | } |
33 | - } | 25 | + }) |
26 | + }) | ||
27 | + updateManager.onUpdateFailed(function () { | ||
28 | + // 新的版本下载失败 | ||
29 | + wx.showModal({ | ||
30 | + title: '更新提示', | ||
31 | + content: '新版本下载失败', | ||
32 | + showCancel: false | ||
33 | + }) | ||
34 | }) | 34 | }) |
35 | }, | 35 | }, |
36 | + post: function (url, data, headerParams, showLoad) { | ||
37 | + wx.showNavigationBarLoading() | ||
38 | + var promise = new Promise((resolve, reject) => { | ||
39 | + //init | ||
40 | + let that = this; | ||
41 | + let postData = data; | ||
42 | + let baseUrl = 'http://elite.w.bronet.cn/api/'; | ||
43 | + //网络请求 | ||
44 | + let header = { | ||
45 | + 'content-type': 'application/x-www-form-urlencoded' | ||
46 | + } | ||
47 | + header = Object.assign(header, headerParams) | ||
48 | + //网络请求 | ||
49 | + wx.request({ | ||
50 | + url: baseUrl + url, | ||
51 | + data: postData, | ||
52 | + method: 'POST', | ||
53 | + header: header, | ||
54 | + | ||
55 | + success: function (res) { //返回取得的数据 | ||
56 | + if (res.data.code == '20000') { | ||
57 | + resolve(res.data); | ||
58 | + } else if (res.data.code == '201') { | ||
59 | + resolve(res.data); | ||
60 | + } | ||
61 | + | ||
62 | + // else if (res.data.code == '10001') { | ||
63 | + // wx.showToast({ | ||
64 | + // title: res.data.msg, | ||
65 | + // icon: 'none', | ||
66 | + // duration: 1000, | ||
67 | + // success: function (res) { | ||
68 | + // let t = setInterval(function () { | ||
69 | + // clearInterval(t) | ||
70 | + // wx.navigateTo({ | ||
71 | + // url: '/pages/index/index', | ||
72 | + // }) | ||
73 | + // }, 1000) | ||
74 | + // } | ||
75 | + // }) | ||
76 | + // } | ||
77 | + | ||
78 | + else { | ||
79 | + wx.showModal({ | ||
80 | + title: '提示', | ||
81 | + content: res.data.msg, | ||
82 | + showCancel: false | ||
83 | + }) | ||
84 | + reject(res.data) | ||
85 | + } | ||
86 | + setTimeout(function () { | ||
87 | + // if (show||show==undefined){ | ||
88 | + // wx.hideLoading() | ||
89 | + // } | ||
90 | + wx.hideNavigationBarLoading() | ||
91 | + }, 600) | ||
92 | + }, | ||
93 | + fail: function (e) { | ||
94 | + reject('网络出错'); | ||
95 | + // wx.hideLoading() | ||
96 | + wx.hideNavigationBarLoading() | ||
97 | + } | ||
98 | + }) | ||
99 | + }); | ||
100 | + return promise; | ||
101 | + }, | ||
102 | + // pay(res, successData) { | ||
103 | + // wx.requestPayment({ | ||
104 | + // "timeStamp": res.pay.timeStamp, | ||
105 | + // "nonceStr": res.pay.nonceStr, | ||
106 | + // "package": res.pay.package, | ||
107 | + // "signType": "MD5", | ||
108 | + // "paySign": res.pay.paySign, | ||
109 | + // "success": function (res) { | ||
110 | + // wx.showToast({ | ||
111 | + // title: '支付完成', | ||
112 | + // icon: "success", | ||
113 | + // duration: 1500, | ||
114 | + // success: function (data) { | ||
115 | + // successData(data) | ||
116 | + // } | ||
117 | + // }) | ||
118 | + // }, | ||
119 | + // "fail": function (res) { | ||
120 | + // wx.showToast({ | ||
121 | + // title: '取消支付成功!', | ||
122 | + // icon: "icon", | ||
123 | + // duration: 1500, | ||
124 | + // }) | ||
125 | + // } | ||
126 | + // }) | ||
127 | + // }, | ||
128 | + // nowDate() { | ||
129 | + // let date = new Date(); | ||
130 | + // let month = date.getMonth() + 1; | ||
131 | + // let day = date.getDate(); | ||
132 | + // return date.getFullYear() + '-' + (month > 9 ? month : ('0' + month)) + '-' + (day > 9 ? day : ('0' + day)); | ||
133 | + // }, | ||
134 | + // minDate() { | ||
135 | + // let date = new Date(); | ||
136 | + // date.setDate(date.getDate() - 287); | ||
137 | + // let m = date.getMonth() + 1; | ||
138 | + // return date.getFullYear() + '-' + m + '-' + date.getDate(); | ||
139 | + // }, | ||
140 | + // timeFormate(timestamp, timeType) { | ||
141 | + // var timeStamp = timestamp.length == 13 ? timestamp : timestamp * 1000 | ||
142 | + // var date = new Date(timeStamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000 | ||
143 | + // var Y = date.getFullYear() + '-'; | ||
144 | + // var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; | ||
145 | + // var D = date.getDate() + ' '; | ||
146 | + // var h = date.getHours() + ':'; | ||
147 | + // var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()); | ||
148 | + // var s = date.getSeconds(); | ||
149 | + // if (timeType == 'YYMMDD') { | ||
150 | + // return Y + M + D; | ||
151 | + // } else { | ||
152 | + // return h + m; | ||
153 | + // } | ||
154 | + // }, | ||
155 | + | ||
156 | + // 接口管理 | ||
157 | + interface: { | ||
158 | + // historyDelete: '/home/index/historyDelete',//删除 | ||
159 | + // shopClass: '/home/index/shopClass',//分类 | ||
160 | + // shopPage: '/home/index/shopPage',//分页 | ||
161 | + // history: '/home/index/history',//检索 | ||
162 | + // index: '/home/index/index', //首页 | ||
163 | + // login: '/wxapp/public/login', //小程序登录注册 | ||
164 | + getSessionKey: '/wxapp/public/getSessionKey', //获取sessionKey和openid | ||
165 | + }, | ||
166 | + //全局变量 | ||
36 | globalData: { | 167 | globalData: { |
37 | userInfo: null, | 168 | userInfo: null, |
38 | - baseUrl: '../../img/' | 169 | + cid: null, |
170 | + class_id: null | ||
39 | } | 171 | } |
40 | }) | 172 | }) |
1 | { | 1 | { |
2 | "pages":[ | 2 | "pages":[ |
3 | + "pages/personalData/personalData", | ||
4 | + "pages/openIndex/openIndex", | ||
3 | "pages/publish/publish", | 5 | "pages/publish/publish", |
4 | "pages/positionDetails/positionDetails", | 6 | "pages/positionDetails/positionDetails", |
5 | "pages/goodWord/goodWord", | 7 | "pages/goodWord/goodWord", |
6 | - "pages/personalData/personalData", | 8 | + |
7 | "pages/easyPart/easyPart", | 9 | "pages/easyPart/easyPart", |
8 | "pages/hotRecommend/hotRecommend", | 10 | "pages/hotRecommend/hotRecommend", |
9 | 11 | ||
@@ -27,6 +29,7 @@ | @@ -27,6 +29,7 @@ | ||
27 | "pages/index/search_4/search_4", | 29 | "pages/index/search_4/search_4", |
28 | "pages/index/search_2/search_2", | 30 | "pages/index/search_2/search_2", |
29 | "pages/index/search_3/search_3", | 31 | "pages/index/search_3/search_3", |
32 | + "pages/index/url/url", | ||
30 | "pages/index/index", | 33 | "pages/index/index", |
31 | 34 | ||
32 | "pages/mine/mine" | 35 | "pages/mine/mine" |
@@ -62,5 +65,13 @@ | @@ -62,5 +65,13 @@ | ||
62 | "selectedIconPath": "img/nav_05@2x.png" | 65 | "selectedIconPath": "img/nav_05@2x.png" |
63 | } | 66 | } |
64 | ] | 67 | ] |
68 | + }, | ||
69 | + | ||
70 | + | ||
71 | + "permission": | ||
72 | + { | ||
73 | + "scope.userLocation": { | ||
74 | + "desc": "你的位置信息将用于小程序位置接口的效果展示" | ||
75 | + } | ||
65 | } | 76 | } |
66 | } | 77 | } |
img/btn-file.png
0 → 100644
139 字节
1 | +const app = getApp(); | ||
2 | + | ||
1 | Page({ | 3 | Page({ |
2 | 4 | ||
3 | /** | 5 | /** |
4 | * 页面的初始数据 | 6 | * 页面的初始数据 |
5 | */ | 7 | */ |
6 | data: { | 8 | data: { |
7 | - | 9 | + industry: '', |
10 | + categories_id: '', | ||
8 | }, | 11 | }, |
9 | 12 | ||
10 | /** | 13 | /** |
11 | * 生命周期函数--监听页面加载 | 14 | * 生命周期函数--监听页面加载 |
12 | */ | 15 | */ |
13 | - | ||
14 | regSuccess() { | 16 | regSuccess() { |
15 | wx.navigateTo({ | 17 | wx.navigateTo({ |
16 | url: '/pages/regSuccess/regSuccess', | 18 | url: '/pages/regSuccess/regSuccess', |
17 | }) | 19 | }) |
18 | }, | 20 | }, |
19 | 21 | ||
22 | + toPosition(){ | ||
23 | + wx.navigateTo({ | ||
24 | + url: '/pages/positionDetails/positionDetails', | ||
25 | + }) | ||
26 | + }, | ||
27 | + // 跳转招聘者信息 | ||
28 | + toRecruiter() { | ||
29 | + wx.navigateTo({ | ||
30 | + url: '/pages/employerDetails/employerDetails', | ||
31 | + }) | ||
32 | + }, | ||
20 | onLoad: function (options) { | 33 | onLoad: function (options) { |
34 | + console.log(options) | ||
21 | 35 | ||
36 | + wx.setNavigationBarTitle({ | ||
37 | + title: options.categories_name //页面切换,更换页面标题 | ||
38 | + }) | ||
39 | + | ||
40 | + this.getIndustry() | ||
41 | + | ||
42 | + | ||
22 | }, | 43 | }, |
44 | + | ||
45 | + // 岗位功能 | ||
46 | + getIndustry() { | ||
47 | + let that = this; | ||
48 | + let url = 'index/category/industry'; | ||
49 | + | ||
50 | + let params = { | ||
51 | + categories_id : that.data.categories_id, | ||
52 | + } | ||
53 | + let header = { | ||
54 | + "XX-Token": wx.getStorageSync('token'), | ||
55 | + "XX-Device-Type": 'wxapp' | ||
56 | + } | ||
57 | + app.post(url, params, header).then((res) => { | ||
58 | + console.log(res); | ||
59 | + // console.log(res.data) | ||
60 | + | ||
61 | + // 获取值 | ||
62 | + that.setData({ | ||
63 | + industry: res.data | ||
64 | + }) | ||
65 | + // console.log(that.data.industry) | ||
66 | + | ||
67 | + }).catch((err) => { | ||
68 | + | ||
69 | + }) | ||
70 | + }, | ||
71 | + // 获取多个工作 | ||
72 | + getJods() { | ||
73 | + let that = this; | ||
74 | + let url = 'index/job/jobs'; | ||
75 | + | ||
76 | + let params = { | ||
77 | + categories_id: that.data.categories_id, | ||
78 | + } | ||
79 | + let header = { | ||
80 | + "XX-Token": wx.getStorageSync('token'), | ||
81 | + "XX-Device-Type": 'wxapp' | ||
82 | + } | ||
83 | + app.post(url, params, header).then((res) => { | ||
84 | + console.log(res); | ||
85 | + // console.log(res.data) | ||
86 | + | ||
87 | + // 获取值 | ||
88 | + that.setData({ | ||
89 | + industry: res.data | ||
90 | + }) | ||
91 | + // console.log(that.data.industry) | ||
92 | + | ||
93 | + }).catch((err) => { | ||
94 | + | ||
95 | + }) | ||
96 | + }, | ||
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | ||
23 | 102 | ||
24 | /** | 103 | /** |
25 | * 生命周期函数--监听页面初次渲染完成 | 104 | * 生命周期函数--监听页面初次渲染完成 |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <!-- 条目 --> | 3 | <!-- 条目 --> |
4 | <view class='items'> | 4 | <view class='items'> |
5 | - <view class='item'> | 5 | + <view class='item' bindtap='toPosition'> |
6 | <!-- 头部 --> | 6 | <!-- 头部 --> |
7 | <view class='item_top'> | 7 | <view class='item_top'> |
8 | <view class='item_top_left'> | 8 | <view class='item_top_left'> |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | </view> | 21 | </view> |
22 | <!-- 底部 --> | 22 | <!-- 底部 --> |
23 | <view class='item_bottom'> | 23 | <view class='item_bottom'> |
24 | - <view class='item_bottom_left'> | 24 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
25 | <view class='item_bottom_left_pic'> | 25 | <view class='item_bottom_left_pic'> |
26 | <image src='/img/aicon_10@2x.png'></image> | 26 | <image src='/img/aicon_10@2x.png'></image> |
27 | </view> | 27 | </view> |
@@ -37,78 +37,10 @@ | @@ -37,78 +37,10 @@ | ||
37 | </view> | 37 | </view> |
38 | </view> | 38 | </view> |
39 | </view> | 39 | </view> |
40 | - <view class='item'> | ||
41 | - <!-- 头部 --> | ||
42 | - <view class='item_top'> | ||
43 | - <view class='item_top_left'> | ||
44 | - <view class='item_top_left_pic'> | ||
45 | - <image src='/img/aicon_08@2x.png'></image> | ||
46 | - </view> | ||
47 | - <view class='item_top_left_text'> | ||
48 | - <view class='text_top'>酒店服务员</view> | ||
49 | - <view class='text_bottom'>4000-5000元/月</view> | ||
50 | - </view> | ||
51 | - </view> | ||
52 | - | ||
53 | - <view class='item_top_right' bindtap='regSuccess'> | ||
54 | - 报名 | ||
55 | - </view> | ||
56 | - </view> | ||
57 | - <!-- 底部 --> | ||
58 | - <view class='item_bottom'> | ||
59 | - <view class='item_bottom_left'> | ||
60 | - <view class='item_bottom_left_pic'> | ||
61 | - <image src='/img/aicon_10@2x.png'></image> | ||
62 | - </view> | ||
63 | - <!-- 名字 --> | ||
64 | - <view>王思迪</view> | ||
65 | - </view> | ||
66 | - | ||
67 | - <view class='item_bottom_right'> | ||
68 | - <view class='item_bottom_left_pic'> | ||
69 | - <image src='/img/aicon_09@2x.png'></image> | ||
70 | - </view> | ||
71 | - <view>南开区 3.2km</view> | ||
72 | - </view> | ||
73 | - </view> | ||
74 | - </view> | ||
75 | - <view class='item'> | ||
76 | - <!-- 头部 --> | ||
77 | - <view class='item_top'> | ||
78 | - <view class='item_top_left'> | ||
79 | - <view class='item_top_left_pic'> | ||
80 | - <image src='/img/aicon_08@2x.png'></image> | ||
81 | - </view> | ||
82 | - <view class='item_top_left_text'> | ||
83 | - <view class='text_top'>酒店服务员</view> | ||
84 | - <view class='text_bottom'>4000-5000元/月</view> | ||
85 | - </view> | ||
86 | - </view> | ||
87 | 40 | ||
88 | - <view class='item_top_right' bindtap='regSuccess'> | ||
89 | - 报名 | ||
90 | - </view> | ||
91 | - </view> | ||
92 | - <!-- 底部 --> | ||
93 | - <view class='item_bottom'> | ||
94 | - <view class='item_bottom_left'> | ||
95 | - <view class='item_bottom_left_pic'> | ||
96 | - <image src='/img/aicon_10@2x.png'></image> | ||
97 | - </view> | ||
98 | - <!-- 名字 --> | ||
99 | - <view>王思迪</view> | ||
100 | - </view> | ||
101 | 41 | ||
102 | - <view class='item_bottom_right'> | ||
103 | - <view class='item_bottom_left_pic'> | ||
104 | - <image src='/img/aicon_09@2x.png'></image> | ||
105 | - </view> | ||
106 | - <view>南开区 3.2km</view> | ||
107 | - </view> | ||
108 | - </view> | ||
109 | - </view> | ||
110 | - <view class='item'> | ||
111 | - <!-- 头部 --> | 42 | + <!-- <view class='item' bindtap='toPosition'> |
43 | + | ||
112 | <view class='item_top'> | 44 | <view class='item_top'> |
113 | <view class='item_top_left'> | 45 | <view class='item_top_left'> |
114 | <view class='item_top_left_pic'> | 46 | <view class='item_top_left_pic'> |
@@ -124,13 +56,13 @@ | @@ -124,13 +56,13 @@ | ||
124 | 报名 | 56 | 报名 |
125 | </view> | 57 | </view> |
126 | </view> | 58 | </view> |
127 | - <!-- 底部 --> | 59 | + |
128 | <view class='item_bottom'> | 60 | <view class='item_bottom'> |
129 | - <view class='item_bottom_left'> | 61 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
130 | <view class='item_bottom_left_pic'> | 62 | <view class='item_bottom_left_pic'> |
131 | <image src='/img/aicon_10@2x.png'></image> | 63 | <image src='/img/aicon_10@2x.png'></image> |
132 | </view> | 64 | </view> |
133 | - <!-- 名字 --> | 65 | + |
134 | <view>王思迪</view> | 66 | <view>王思迪</view> |
135 | </view> | 67 | </view> |
136 | 68 | ||
@@ -141,7 +73,8 @@ | @@ -141,7 +73,8 @@ | ||
141 | <view>南开区 3.2km</view> | 73 | <view>南开区 3.2km</view> |
142 | </view> | 74 | </view> |
143 | </view> | 75 | </view> |
144 | - </view> | 76 | + </view> --> |
77 | + | ||
145 | 78 | ||
146 | </view> | 79 | </view> |
147 | 80 |
@@ -16,6 +16,18 @@ Page({ | @@ -16,6 +16,18 @@ Page({ | ||
16 | url: '/pages/regSuccess/regSuccess', | 16 | url: '/pages/regSuccess/regSuccess', |
17 | }) | 17 | }) |
18 | }, | 18 | }, |
19 | + | ||
20 | + toPosition() { | ||
21 | + wx.navigateTo({ | ||
22 | + url: '/pages/positionDetails/positionDetails', | ||
23 | + }) | ||
24 | + }, | ||
25 | + // 跳转招聘者信息 | ||
26 | + toRecruiter() { | ||
27 | + wx.navigateTo({ | ||
28 | + url: '/pages/employerDetails/employerDetails', | ||
29 | + }) | ||
30 | + }, | ||
19 | onLoad: function (options) { | 31 | onLoad: function (options) { |
20 | 32 | ||
21 | }, | 33 | }, |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | 4 | ||
5 | <!-- 条目 --> | 5 | <!-- 条目 --> |
6 | <view class='items'> | 6 | <view class='items'> |
7 | - <view class='item'> | 7 | + <view class='item' bindtap='toPosition'> |
8 | <!-- 头部 --> | 8 | <!-- 头部 --> |
9 | <view class='item_top'> | 9 | <view class='item_top'> |
10 | <view class='item_top_left'> | 10 | <view class='item_top_left'> |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | </view> | 23 | </view> |
24 | <!-- 底部 --> | 24 | <!-- 底部 --> |
25 | <view class='item_bottom'> | 25 | <view class='item_bottom'> |
26 | - <view class='item_bottom_left'> | 26 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
27 | <view class='item_bottom_left_pic'> | 27 | <view class='item_bottom_left_pic'> |
28 | <image src='/img/aicon_10@2x.png'></image> | 28 | <image src='/img/aicon_10@2x.png'></image> |
29 | </view> | 29 | </view> |
@@ -11,6 +11,18 @@ Page({ | @@ -11,6 +11,18 @@ Page({ | ||
11 | /** | 11 | /** |
12 | * 生命周期函数--监听页面加载 | 12 | * 生命周期函数--监听页面加载 |
13 | */ | 13 | */ |
14 | + // 跳转岗位信息 | ||
15 | + toPosition() { | ||
16 | + wx.navigateTo({ | ||
17 | + url: '/pages/positionDetails/positionDetails', | ||
18 | + }) | ||
19 | + }, | ||
20 | + // 跳转招聘者信息 | ||
21 | + toRecruiter() { | ||
22 | + wx.navigateTo({ | ||
23 | + url: '/pages/employerDetails/employerDetails', | ||
24 | + }) | ||
25 | + }, | ||
14 | onLoad: function (options) { | 26 | onLoad: function (options) { |
15 | 27 | ||
16 | }, | 28 | }, |
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | 相关岗位 | 33 | 相关岗位 |
34 | </view> | 34 | </view> |
35 | 35 | ||
36 | - <view class='item'> | 36 | + <view class='item' bindtap='toPosition'> |
37 | <!-- 头部 --> | 37 | <!-- 头部 --> |
38 | <view class='item_top'> | 38 | <view class='item_top'> |
39 | <view class='item_top_left'> | 39 | <view class='item_top_left'> |
@@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
52 | </view> | 52 | </view> |
53 | <!-- 底部 --> | 53 | <!-- 底部 --> |
54 | <view class='item_bottom'> | 54 | <view class='item_bottom'> |
55 | - <view class='item_bottom_left'> | 55 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
56 | <view class='item_bottom_left_pic'> | 56 | <view class='item_bottom_left_pic'> |
57 | <image src='/img/aicon_10@2x.png'></image> | 57 | <image src='/img/aicon_10@2x.png'></image> |
58 | </view> | 58 | </view> |
@@ -60,7 +60,7 @@ | @@ -60,7 +60,7 @@ | ||
60 | <view>王思迪</view> | 60 | <view>王思迪</view> |
61 | </view> | 61 | </view> |
62 | 62 | ||
63 | - <view class='item_bottom_right'> | 63 | + <view class='item_bottom_right' > |
64 | <view class='item_bottom_left_pic'> | 64 | <view class='item_bottom_left_pic'> |
65 | <image src='/img/aicon_09@2x.png'></image> | 65 | <image src='/img/aicon_09@2x.png'></image> |
66 | </view> | 66 | </view> |
@@ -69,7 +69,7 @@ | @@ -69,7 +69,7 @@ | ||
69 | </view> | 69 | </view> |
70 | </view> | 70 | </view> |
71 | 71 | ||
72 | - <view class='item'> | 72 | + <view class='item' bindtap='toPosition'> |
73 | <!-- 头部 --> | 73 | <!-- 头部 --> |
74 | <view class='item_top'> | 74 | <view class='item_top'> |
75 | <view class='item_top_left'> | 75 | <view class='item_top_left'> |
@@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
88 | </view> | 88 | </view> |
89 | <!-- 底部 --> | 89 | <!-- 底部 --> |
90 | <view class='item_bottom'> | 90 | <view class='item_bottom'> |
91 | - <view class='item_bottom_left'> | 91 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
92 | <view class='item_bottom_left_pic'> | 92 | <view class='item_bottom_left_pic'> |
93 | <image src='/img/aicon_10@2x.png'></image> | 93 | <image src='/img/aicon_10@2x.png'></image> |
94 | </view> | 94 | </view> |
1 | -// pages/goodWord/goodWord.js | ||
2 | Page({ | 1 | Page({ |
3 | 2 | ||
4 | /** | 3 | /** |
5 | * 页面的初始数据 | 4 | * 页面的初始数据 |
6 | */ | 5 | */ |
7 | data: { | 6 | data: { |
8 | - | 7 | + |
9 | }, | 8 | }, |
10 | 9 | ||
11 | /** | 10 | /** |
@@ -18,56 +17,67 @@ Page({ | @@ -18,56 +17,67 @@ Page({ | ||
18 | }) | 17 | }) |
19 | }, | 18 | }, |
20 | 19 | ||
20 | + toPosition() { | ||
21 | + wx.navigateTo({ | ||
22 | + url: '/pages/positionDetails/positionDetails', | ||
23 | + }) | ||
24 | + }, | ||
25 | + // 跳转招聘者信息 | ||
26 | + toRecruiter() { | ||
27 | + wx.navigateTo({ | ||
28 | + url: '/pages/employerDetails/employerDetails', | ||
29 | + }) | ||
30 | + }, | ||
21 | onLoad: function (options) { | 31 | onLoad: function (options) { |
22 | - | 32 | + |
23 | }, | 33 | }, |
24 | 34 | ||
25 | /** | 35 | /** |
26 | * 生命周期函数--监听页面初次渲染完成 | 36 | * 生命周期函数--监听页面初次渲染完成 |
27 | */ | 37 | */ |
28 | onReady: function () { | 38 | onReady: function () { |
29 | - | 39 | + |
30 | }, | 40 | }, |
31 | 41 | ||
32 | /** | 42 | /** |
33 | * 生命周期函数--监听页面显示 | 43 | * 生命周期函数--监听页面显示 |
34 | */ | 44 | */ |
35 | onShow: function () { | 45 | onShow: function () { |
36 | - | 46 | + |
37 | }, | 47 | }, |
38 | 48 | ||
39 | /** | 49 | /** |
40 | * 生命周期函数--监听页面隐藏 | 50 | * 生命周期函数--监听页面隐藏 |
41 | */ | 51 | */ |
42 | onHide: function () { | 52 | onHide: function () { |
43 | - | 53 | + |
44 | }, | 54 | }, |
45 | 55 | ||
46 | /** | 56 | /** |
47 | * 生命周期函数--监听页面卸载 | 57 | * 生命周期函数--监听页面卸载 |
48 | */ | 58 | */ |
49 | onUnload: function () { | 59 | onUnload: function () { |
50 | - | 60 | + |
51 | }, | 61 | }, |
52 | 62 | ||
53 | /** | 63 | /** |
54 | * 页面相关事件处理函数--监听用户下拉动作 | 64 | * 页面相关事件处理函数--监听用户下拉动作 |
55 | */ | 65 | */ |
56 | onPullDownRefresh: function () { | 66 | onPullDownRefresh: function () { |
57 | - | 67 | + |
58 | }, | 68 | }, |
59 | 69 | ||
60 | /** | 70 | /** |
61 | * 页面上拉触底事件的处理函数 | 71 | * 页面上拉触底事件的处理函数 |
62 | */ | 72 | */ |
63 | onReachBottom: function () { | 73 | onReachBottom: function () { |
64 | - | 74 | + |
65 | }, | 75 | }, |
66 | 76 | ||
67 | /** | 77 | /** |
68 | * 用户点击右上角分享 | 78 | * 用户点击右上角分享 |
69 | */ | 79 | */ |
70 | onShareAppMessage: function () { | 80 | onShareAppMessage: function () { |
71 | - | 81 | + |
72 | } | 82 | } |
73 | }) | 83 | }) |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | 4 | ||
5 | <!-- 条目 --> | 5 | <!-- 条目 --> |
6 | <view class='items'> | 6 | <view class='items'> |
7 | - <view class='item'> | 7 | + <view class='item' bindtap='toPosition'> |
8 | <!-- 头部 --> | 8 | <!-- 头部 --> |
9 | <view class='item_top'> | 9 | <view class='item_top'> |
10 | <view class='item_top_left'> | 10 | <view class='item_top_left'> |
@@ -23,112 +23,7 @@ | @@ -23,112 +23,7 @@ | ||
23 | </view> | 23 | </view> |
24 | <!-- 底部 --> | 24 | <!-- 底部 --> |
25 | <view class='item_bottom'> | 25 | <view class='item_bottom'> |
26 | - <view class='item_bottom_left'> | ||
27 | - <view class='item_bottom_left_pic'> | ||
28 | - <image src='/img/aicon_10@2x.png'></image> | ||
29 | - </view> | ||
30 | - <!-- 名字 --> | ||
31 | - <view>王思迪</view> | ||
32 | - </view> | ||
33 | - | ||
34 | - <view class='item_bottom_right'> | ||
35 | - <view class='item_bottom_left_pic'> | ||
36 | - <image src='/img/aicon_09@2x.png'></image> | ||
37 | - </view> | ||
38 | - <view>南开区 3.2km</view> | ||
39 | - </view> | ||
40 | - </view> | ||
41 | - </view> | ||
42 | - <view class='item'> | ||
43 | - <!-- 头部 --> | ||
44 | - <view class='item_top'> | ||
45 | - <view class='item_top_left'> | ||
46 | - <view class='item_top_left_pic'> | ||
47 | - <image src='/img/aicon_08@2x.png'></image> | ||
48 | - </view> | ||
49 | - <view class='item_top_left_text'> | ||
50 | - <view class='text_top'>酒店服务员</view> | ||
51 | - <view class='text_bottom'>4000-5000元/月</view> | ||
52 | - </view> | ||
53 | - </view> | ||
54 | - | ||
55 | - <view class='item_top_right' bindtap='regSuccess'> | ||
56 | - 报名 | ||
57 | - </view> | ||
58 | - </view> | ||
59 | - <!-- 底部 --> | ||
60 | - <view class='item_bottom'> | ||
61 | - <view class='item_bottom_left'> | ||
62 | - <view class='item_bottom_left_pic'> | ||
63 | - <image src='/img/aicon_10@2x.png'></image> | ||
64 | - </view> | ||
65 | - <!-- 名字 --> | ||
66 | - <view>王思迪</view> | ||
67 | - </view> | ||
68 | - | ||
69 | - <view class='item_bottom_right'> | ||
70 | - <view class='item_bottom_left_pic'> | ||
71 | - <image src='/img/aicon_09@2x.png'></image> | ||
72 | - </view> | ||
73 | - <view>南开区 3.2km</view> | ||
74 | - </view> | ||
75 | - </view> | ||
76 | - </view> | ||
77 | - <view class='item'> | ||
78 | - <!-- 头部 --> | ||
79 | - <view class='item_top'> | ||
80 | - <view class='item_top_left'> | ||
81 | - <view class='item_top_left_pic'> | ||
82 | - <image src='/img/aicon_08@2x.png'></image> | ||
83 | - </view> | ||
84 | - <view class='item_top_left_text'> | ||
85 | - <view class='text_top'>酒店服务员</view> | ||
86 | - <view class='text_bottom'>4000-5000元/月</view> | ||
87 | - </view> | ||
88 | - </view> | ||
89 | - | ||
90 | - <view class='item_top_right' bindtap='regSuccess'> | ||
91 | - 报名 | ||
92 | - </view> | ||
93 | - </view> | ||
94 | - <!-- 底部 --> | ||
95 | - <view class='item_bottom'> | ||
96 | - <view class='item_bottom_left'> | ||
97 | - <view class='item_bottom_left_pic'> | ||
98 | - <image src='/img/aicon_10@2x.png'></image> | ||
99 | - </view> | ||
100 | - <!-- 名字 --> | ||
101 | - <view>王思迪</view> | ||
102 | - </view> | ||
103 | - | ||
104 | - <view class='item_bottom_right'> | ||
105 | - <view class='item_bottom_left_pic'> | ||
106 | - <image src='/img/aicon_09@2x.png'></image> | ||
107 | - </view> | ||
108 | - <view>南开区 3.2km</view> | ||
109 | - </view> | ||
110 | - </view> | ||
111 | - </view> | ||
112 | - <view class='item'> | ||
113 | - <!-- 头部 --> | ||
114 | - <view class='item_top'> | ||
115 | - <view class='item_top_left'> | ||
116 | - <view class='item_top_left_pic'> | ||
117 | - <image src='/img/aicon_08@2x.png'></image> | ||
118 | - </view> | ||
119 | - <view class='item_top_left_text'> | ||
120 | - <view class='text_top'>酒店服务员</view> | ||
121 | - <view class='text_bottom'>4000-5000元/月</view> | ||
122 | - </view> | ||
123 | - </view> | ||
124 | - | ||
125 | - <view class='item_top_right' bindtap='regSuccess'> | ||
126 | - 报名 | ||
127 | - </view> | ||
128 | - </view> | ||
129 | - <!-- 底部 --> | ||
130 | - <view class='item_bottom'> | ||
131 | - <view class='item_bottom_left'> | 26 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
132 | <view class='item_bottom_left_pic'> | 27 | <view class='item_bottom_left_pic'> |
133 | <image src='/img/aicon_10@2x.png'></image> | 28 | <image src='/img/aicon_10@2x.png'></image> |
134 | </view> | 29 | </view> |
@@ -146,6 +41,7 @@ | @@ -146,6 +41,7 @@ | ||
146 | </view> | 41 | </view> |
147 | 42 | ||
148 | 43 | ||
44 | + | ||
149 | </view> | 45 | </view> |
150 | 46 | ||
151 | <!-- 提示 --> | 47 | <!-- 提示 --> |
1 | // pages/index/index.js | 1 | // pages/index/index.js |
2 | +const app = getApp(); | ||
3 | +var QQMapWX = require('../../utils/qqmap-wx-jssdk.js'); | ||
4 | +var qqmapsdk; | ||
2 | Page({ | 5 | Page({ |
3 | - | 6 | + |
4 | /** | 7 | /** |
5 | * 页面的初始数据 | 8 | * 页面的初始数据 |
6 | */ | 9 | */ |
7 | data: { | 10 | data: { |
11 | + category: '', | ||
12 | + slide: '', | ||
13 | + industry_id: '', | ||
14 | + | ||
15 | + city: '', | ||
16 | + // 数据筛选 | ||
17 | + city_1: '', | ||
18 | + industry_1: '', | ||
19 | + station_1: '', | ||
20 | + education_1: '', | ||
21 | + salary_1: '', | ||
22 | + categories_id:'', | ||
23 | + | ||
24 | + | ||
25 | + district:'', | ||
26 | + // 获取经纬度 | ||
27 | + latitude: '', | ||
28 | + longitude: '', | ||
29 | + | ||
30 | + | ||
8 | imgUrls: [{ | 31 | imgUrls: [{ |
9 | url: '/img/aicon_07@2x.png' | 32 | url: '/img/aicon_07@2x.png' |
10 | }, | 33 | }, |
@@ -22,7 +45,7 @@ Page({ | @@ -22,7 +45,7 @@ Page({ | ||
22 | currentSwiper: 0, | 45 | currentSwiper: 0, |
23 | indicatorColor: "rgba(255,255,255,0.5)", //指示点颜色 | 46 | indicatorColor: "rgba(255,255,255,0.5)", //指示点颜色 |
24 | indicatorActiveColor: "rgba(255,255,255,1)", //当前选中的指示点颜色 | 47 | indicatorActiveColor: "rgba(255,255,255,1)", //当前选中的指示点颜色 |
25 | - | 48 | + // 导航选择 |
26 | navbar: [{ | 49 | navbar: [{ |
27 | name: '地区' | 50 | name: '地区' |
28 | }, | 51 | }, |
@@ -108,8 +131,6 @@ Page({ | @@ -108,8 +131,6 @@ Page({ | ||
108 | { | 131 | { |
109 | sort: '最新发布' | 132 | sort: '最新发布' |
110 | }, | 133 | }, |
111 | - | ||
112 | - | ||
113 | ], | 134 | ], |
114 | sortTab: 0, | 135 | sortTab: 0, |
115 | // 筛选(学历) | 136 | // 筛选(学历) |
@@ -141,7 +162,6 @@ Page({ | @@ -141,7 +162,6 @@ Page({ | ||
141 | screen: '博士' | 162 | screen: '博士' |
142 | }, | 163 | }, |
143 | 164 | ||
144 | - | ||
145 | ], | 165 | ], |
146 | screenTab: 0, | 166 | screenTab: 0, |
147 | // 筛选(酬薪范围) | 167 | // 筛选(酬薪范围) |
@@ -164,8 +184,6 @@ Page({ | @@ -164,8 +184,6 @@ Page({ | ||
164 | ], | 184 | ], |
165 | scopeTab: 0, | 185 | scopeTab: 0, |
166 | 186 | ||
167 | - | ||
168 | - | ||
169 | // 设置隐藏显示功能 | 187 | // 设置隐藏显示功能 |
170 | mask: false, | 188 | mask: false, |
171 | 189 | ||
@@ -175,6 +193,7 @@ Page({ | @@ -175,6 +193,7 @@ Page({ | ||
175 | ] | 193 | ] |
176 | }, | 194 | }, |
177 | 195 | ||
196 | + | ||
178 | // 点击展示筛选mask | 197 | // 点击展示筛选mask |
179 | mask_show() { | 198 | mask_show() { |
180 | this.setData({ | 199 | this.setData({ |
@@ -187,19 +206,44 @@ Page({ | @@ -187,19 +206,44 @@ Page({ | ||
187 | mask: false | 206 | mask: false |
188 | }) | 207 | }) |
189 | }, | 208 | }, |
190 | - | ||
191 | - | 209 | + // 跳转岗位信息 |
210 | + toPosition(){ | ||
211 | + wx.navigateTo({ | ||
212 | + url: '/pages/positionDetails/positionDetails', | ||
213 | + }) | ||
214 | + }, | ||
215 | + // 跳转招聘者信息 | ||
216 | + toRecruiter() { | ||
217 | + wx.navigateTo({ | ||
218 | + url: '/pages/employerDetails/employerDetails', | ||
219 | + }) | ||
220 | + }, | ||
192 | /** | 221 | /** |
193 | * 生命周期函数--监听页面加载 | 222 | * 生命周期函数--监听页面加载 |
194 | */ | 223 | */ |
195 | onLoad: function(options) { | 224 | onLoad: function(options) { |
196 | - | 225 | + qqmapsdk = new QQMapWX({ |
226 | + key: 'CUYBZ-AN7A5-TFMIS-QBFH2-3KZQT-PYBQG' | ||
227 | + }); | ||
228 | + this.getCategories() | ||
229 | + this.getSlide() | ||
230 | + this.selectIndustry() | ||
231 | + // this.selectStation() | ||
232 | + this.selectEducation() | ||
233 | + this.selectSalary() | ||
234 | + // this.selectArea() | ||
197 | }, | 235 | }, |
236 | + | ||
198 | // 在家可做 | 237 | // 在家可做 |
199 | - atHome(){ | 238 | + atHome(e){ |
239 | + console.log(e) | ||
240 | + let that = this; | ||
241 | + let categories_name = e.currentTarget.dataset.cla | ||
242 | + console.log(categories_name) | ||
200 | wx.navigateTo({ | 243 | wx.navigateTo({ |
201 | - url: '/pages/atHome/atHome', | 244 | + url: '/pages/atHome/atHome?categories_name='+categories_name, |
202 | }) | 245 | }) |
246 | + | ||
203 | }, | 247 | }, |
204 | // 好评工作 | 248 | // 好评工作 |
205 | goodWord(){ | 249 | goodWord(){ |
@@ -219,12 +263,16 @@ Page({ | @@ -219,12 +263,16 @@ Page({ | ||
219 | url: '/pages/easyPart/easyPart', | 263 | url: '/pages/easyPart/easyPart', |
220 | }) | 264 | }) |
221 | }, | 265 | }, |
266 | + | ||
267 | + | ||
268 | + | ||
222 | navbarTap: function(e) { | 269 | navbarTap: function(e) { |
223 | console.log(88) | 270 | console.log(88) |
224 | let that = this; | 271 | let that = this; |
225 | this.setData({ | 272 | this.setData({ |
226 | currentTab: e.currentTarget.dataset.idx, | 273 | currentTab: e.currentTarget.dataset.idx, |
227 | }) | 274 | }) |
275 | + that.selectStation() | ||
228 | }, | 276 | }, |
229 | // 地区选择 | 277 | // 地区选择 |
230 | area_Tap: function(e) { | 278 | area_Tap: function(e) { |
@@ -242,7 +290,7 @@ Page({ | @@ -242,7 +290,7 @@ Page({ | ||
242 | jobTab: e.currentTarget.dataset.idjob, | 290 | jobTab: e.currentTarget.dataset.idjob, |
243 | }) | 291 | }) |
244 | }, | 292 | }, |
245 | - // 岗位选择(小类别) | 293 | + // 行业选择 |
246 | pro_Tap: function (e) { | 294 | pro_Tap: function (e) { |
247 | console.log(88) | 295 | console.log(88) |
248 | let that = this; | 296 | let that = this; |
@@ -295,8 +343,343 @@ Page({ | @@ -295,8 +343,343 @@ Page({ | ||
295 | * 生命周期函数--监听页面显示 | 343 | * 生命周期函数--监听页面显示 |
296 | */ | 344 | */ |
297 | onShow: function() { | 345 | onShow: function() { |
346 | + let vm = this; | ||
347 | + vm.getUserLocation(); | ||
348 | + }, | ||
349 | + | ||
350 | + //----筛选地区数据功能---- 给后端传city | ||
351 | + selectArea() { | ||
352 | + | ||
353 | + let that = this; | ||
354 | + let url = 'index/category/county'; | ||
355 | + | ||
356 | + // 通过parmas传值给后端 | ||
357 | + let params = { | ||
358 | + city: that.data.city, | ||
359 | + } | ||
360 | + let header = { | ||
361 | + "XX-Token": wx.getStorageSync('token'), | ||
362 | + "XX-Device-Type": 'wxapp' | ||
363 | + } | ||
364 | + app.post(url, params, header).then((res) => { | ||
365 | + | ||
366 | + console.log(res); | ||
367 | + that.setData({ | ||
368 | + city_1 : res.data | ||
369 | + }) | ||
370 | + | ||
371 | + }).catch((err) => { | ||
372 | + | ||
373 | + }) | ||
374 | + }, | ||
298 | 375 | ||
376 | + //----筛选行业分类功能---- 给后端传categories_id | ||
377 | + selectIndustry() { | ||
378 | + | ||
379 | + let that = this; | ||
380 | + let url = 'index/category/industry'; | ||
381 | + console.log(url) | ||
382 | + // 通过parmas传值给后端 | ||
383 | + let params = { | ||
384 | + categories_id: that.data.categories_id, | ||
385 | + } | ||
386 | + let header = { | ||
387 | + "XX-Token": wx.getStorageSync('token'), | ||
388 | + "XX-Device-Type": 'wxapp' | ||
389 | + } | ||
390 | + app.post(url, params, header).then((res) => { | ||
391 | + console.log(res); | ||
392 | + that.setData({ | ||
393 | + industry_1: res.data | ||
394 | + }) | ||
395 | + | ||
396 | + }).catch((err) => { | ||
397 | + // that.selectStation() | ||
398 | + }) | ||
299 | }, | 399 | }, |
400 | + //----筛选岗位分类功能---- 给后端传industry_id | ||
401 | + selectStation() { | ||
402 | + | ||
403 | + let that = this; | ||
404 | + let url = 'index/category/station'; | ||
405 | + console.log(url) | ||
406 | + // 通过parmas传值给后端 | ||
407 | + let params = { | ||
408 | + industry_id: that.data.industry_id, | ||
409 | + } | ||
410 | + let header = { | ||
411 | + "XX-Token": wx.getStorageSync('token'), | ||
412 | + "XX-Device-Type": 'wxapp' | ||
413 | + } | ||
414 | + app.post(url, params, header).then((res) => { | ||
415 | + console.log(res); | ||
416 | + that.setData({ | ||
417 | + station_1: res.data | ||
418 | + }) | ||
419 | + | ||
420 | + }).catch((err) => { | ||
421 | + | ||
422 | + }) | ||
423 | + }, | ||
424 | + | ||
425 | + | ||
426 | + //-------学历要求------- | ||
427 | + selectEducation() { | ||
428 | + | ||
429 | + let that = this; | ||
430 | + let url = 'index/category/education'; | ||
431 | + | ||
432 | + // 通过parmas传值给后端 | ||
433 | + let params = { | ||
434 | + // city: that.data.city, | ||
435 | + } | ||
436 | + let header = { | ||
437 | + "XX-Token": wx.getStorageSync('token'), | ||
438 | + "XX-Device-Type": 'wxapp' | ||
439 | + } | ||
440 | + app.post(url, params, header).then((res) => { | ||
441 | + | ||
442 | + console.log(res); | ||
443 | + that.setData({ | ||
444 | + // city_1: res.data | ||
445 | + education_1:res.data | ||
446 | + }) | ||
447 | + | ||
448 | + }).catch((err) => { | ||
449 | + | ||
450 | + }) | ||
451 | + }, | ||
452 | + //-------酬薪范围------- | ||
453 | + selectSalary() { | ||
454 | + | ||
455 | + let that = this; | ||
456 | + let url = 'index/category/salary'; | ||
457 | + | ||
458 | + // 通过parmas传值给后端 | ||
459 | + let params = { | ||
460 | + // city: that.data.city, | ||
461 | + } | ||
462 | + let header = { | ||
463 | + "XX-Token": wx.getStorageSync('token'), | ||
464 | + "XX-Device-Type": 'wxapp' | ||
465 | + } | ||
466 | + app.post(url, params, header).then((res) => { | ||
467 | + | ||
468 | + console.log(res); | ||
469 | + that.setData({ | ||
470 | + salary_1: res.data | ||
471 | + }) | ||
472 | + | ||
473 | + }).catch((err) => { | ||
474 | + | ||
475 | + }) | ||
476 | + }, | ||
477 | + | ||
478 | + | ||
479 | + | ||
480 | + // -----用户获得经纬度----- | ||
481 | + getUserLocation(){ | ||
482 | + let vm = this; | ||
483 | + wx.getSetting({ | ||
484 | + success:(res) => { | ||
485 | + console.log(JSON.stringify(res)) | ||
486 | + if(res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true){ | ||
487 | + wx.showModal({ | ||
488 | + title: '请授权当前位置', | ||
489 | + content: '需要获取您的地址位置,请确认授权', | ||
490 | + success(res){ | ||
491 | + if(res.cancel){ | ||
492 | + wx.showToast({ | ||
493 | + title: '拒绝授权', | ||
494 | + icon: 'none', | ||
495 | + duration: 1000 | ||
496 | + }) | ||
497 | + }else if(res.confirm){ | ||
498 | + wx.openSetting({ | ||
499 | + success: function(dataAu){ | ||
500 | + if(dataAu.authSetting["scope.userLocation"]==true){ | ||
501 | + wx.showToast({ | ||
502 | + title: '授权成功', | ||
503 | + icon: 'success', | ||
504 | + duration: 1000 | ||
505 | + }) | ||
506 | + // 再次授权,调用wx.getLocation的API | ||
507 | + vm.getLocation(); | ||
508 | + }else{ | ||
509 | + wx.showToast({ | ||
510 | + title: '授权失败', | ||
511 | + icon: 'none', | ||
512 | + duration: 1000 | ||
513 | + }) | ||
514 | + } | ||
515 | + } | ||
516 | + }) | ||
517 | + } | ||
518 | + } | ||
519 | + }) | ||
520 | + }else if(res.authSetting['scope.userLocation'] == undefined){ | ||
521 | + // 调用wx.getLocation的API | ||
522 | + vm.getLocation(); | ||
523 | + }else{ | ||
524 | + // 调用wx.getLocation的API | ||
525 | + vm.getLocation(); | ||
526 | + } | ||
527 | + } | ||
528 | + }) | ||
529 | + }, | ||
530 | + | ||
531 | + // -----微信获得经纬度----- | ||
532 | + getLocation(){ | ||
533 | + let vm = this; | ||
534 | + // console.log(vm) | ||
535 | + wx.getLocation({ | ||
536 | + type: 'wgs84', | ||
537 | + // altitude: true, | ||
538 | + success: function(res) { | ||
539 | + console.log(JSON.stringify(res)) | ||
540 | + var latitude = res.latitude | ||
541 | + var longitude = res.longitude | ||
542 | + var speed = res.speed | ||
543 | + var accuracy = res.accuracy; | ||
544 | + vm.getLocal(latitude,longitude) | ||
545 | + }, | ||
546 | + fail: function(res) { | ||
547 | + console.log('fail'+JSON.stringify(res)) | ||
548 | + }, | ||
549 | + // complete: function(res) {}, | ||
550 | + }) | ||
551 | + }, | ||
552 | + | ||
553 | + // -----获取当前地理位置----- | ||
554 | + getLocal(latitude,longitude){ | ||
555 | + let vm = this; | ||
556 | + qqmapsdk.reverseGeocoder({ | ||
557 | + location: { | ||
558 | + latitude: latitude, | ||
559 | + longitude: longitude | ||
560 | + }, | ||
561 | + | ||
562 | + success(res){ | ||
563 | + | ||
564 | + console.log(res) | ||
565 | + // let province = res.result.ad_info.province | ||
566 | + let city = res.result.ad_info.city; | ||
567 | + console.log(city) | ||
568 | + let district = res.result.ad_info.district | ||
569 | + | ||
570 | + console.log('定位的市:'+city,'定位的区:'+district) | ||
571 | + vm.setData({ | ||
572 | + // 转换地区 | ||
573 | + | ||
574 | + city: city, | ||
575 | + district:district, | ||
576 | + latitude: latitude, | ||
577 | + longitude: longitude | ||
578 | + }) | ||
579 | + vm.selectArea() | ||
580 | + | ||
581 | + | ||
582 | + }, | ||
583 | + fail: function(res){ | ||
584 | + console.log(res); | ||
585 | + }, | ||
586 | + complete:function(res){ | ||
587 | + | ||
588 | + } | ||
589 | + }) | ||
590 | + }, | ||
591 | + | ||
592 | + // 存储当前用户所在城市 | ||
593 | + addLocal() { | ||
594 | + | ||
595 | + let that = this; | ||
596 | + let url = 'wxapp/public/location'; | ||
597 | + // 通过parmas传值给后端 | ||
598 | + let params = { | ||
599 | + city : that.data.city, | ||
600 | + county: that.data.county, | ||
601 | + longitude: that.data.longitude, | ||
602 | + latitude: that.data.latitude | ||
603 | + } | ||
604 | + let header = { | ||
605 | + "XX-Token": wx.getStorageSync('token'), | ||
606 | + "XX-Device-Type": 'wxapp' | ||
607 | + } | ||
608 | + app.post(url, params, header).then((res) => { | ||
609 | + console.log('++++++++++++++') | ||
610 | + console.log(res); | ||
611 | + | ||
612 | + | ||
613 | + }).catch((err) => { | ||
614 | + | ||
615 | + }) | ||
616 | + }, | ||
617 | + | ||
618 | + | ||
619 | + // 获取四大类 | ||
620 | + getCategories() { | ||
621 | + let that = this; | ||
622 | + let url = 'index/category/categories'; | ||
623 | + console.log(url) | ||
624 | + let params = { | ||
625 | + | ||
626 | + } | ||
627 | + let header = { | ||
628 | + "XX-Token": wx.getStorageSync('token'), | ||
629 | + "XX-Device-Type": 'wxapp' | ||
630 | + } | ||
631 | + app.post(url, params, header).then((res) => { | ||
632 | + console.log(res); | ||
633 | + console.log(res.data) | ||
634 | + | ||
635 | + // 获取值 | ||
636 | + that.setData({ | ||
637 | + category:res.data | ||
638 | + }) | ||
639 | + console.log(that.data.category) | ||
640 | + | ||
641 | + }).catch((err) => { | ||
642 | + | ||
643 | + }) | ||
644 | + }, | ||
645 | + // 获取幻灯片 | ||
646 | + getSlide() { | ||
647 | + let that = this; | ||
648 | + let url = 'index/category/slide'; | ||
649 | + console.log(url) | ||
650 | + let params = { | ||
651 | + | ||
652 | + } | ||
653 | + let header = { | ||
654 | + "XX-Token": wx.getStorageSync('token'), | ||
655 | + "XX-Device-Type": 'wxapp' | ||
656 | + } | ||
657 | + app.post(url, params, header).then((res) => { | ||
658 | + console.log(res); | ||
659 | + console.log(res.data) | ||
660 | + | ||
661 | + // 获取值 | ||
662 | + that.setData({ | ||
663 | + slide: res.data | ||
664 | + }) | ||
665 | + console.log(that.data.slide) | ||
666 | + | ||
667 | + }).catch((err) => { | ||
668 | + | ||
669 | + }) | ||
670 | + }, | ||
671 | + // 跳转Url | ||
672 | + toUrl(e){ | ||
673 | + console.log(e) | ||
674 | + let that = this; | ||
675 | + let url = e.currentTarget.dataset.tourl; | ||
676 | + console.log(url) | ||
677 | + wx.navigateTo({ | ||
678 | + url: '/pages/index/url/url?url='+url, | ||
679 | + }) | ||
680 | + }, | ||
681 | + | ||
682 | + | ||
300 | 683 | ||
301 | /** | 684 | /** |
302 | * 生命周期函数--监听页面隐藏 | 685 | * 生命周期函数--监听页面隐藏 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <view class='top'> | 4 | <view class='top'> |
5 | <!-- 左边地区 --> | 5 | <!-- 左边地区 --> |
6 | <view class='top_left'> | 6 | <view class='top_left'> |
7 | - <view>天津</view> | 7 | + <view class='top_left_text'>{{city}}</view> |
8 | <view class='top_left_img'> | 8 | <view class='top_left_img'> |
9 | <image src='/img/aicon_01@2x.png'></image> | 9 | <image src='/img/aicon_01@2x.png'></image> |
10 | </view> | 10 | </view> |
@@ -18,48 +18,62 @@ | @@ -18,48 +18,62 @@ | ||
18 | </view> | 18 | </view> |
19 | </view> | 19 | </view> |
20 | <!-- 中部选择 --> | 20 | <!-- 中部选择 --> |
21 | - <view class='mid'> | ||
22 | - <view class='mid_list' bindtap='atHome'> | 21 | + <view class='mid' > |
22 | + | ||
23 | + <view class='mid_list' bindtap='atHome' data-cla='{{item.categories_name}}' wx:for='{{category}}' wx:key=''> | ||
23 | <!-- 图片 --> | 24 | <!-- 图片 --> |
24 | <view class='mid_list_top'> | 25 | <view class='mid_list_top'> |
25 | - <image src='/img/aicon_03@2x.png'></image> | 26 | + <image src='{{item.thumbnail}}'></image> |
26 | </view> | 27 | </view> |
27 | <!-- 底部文字 --> | 28 | <!-- 底部文字 --> |
28 | <view class='mid_list_bottom'> | 29 | <view class='mid_list_bottom'> |
30 | + {{item.categories_name}} | ||
31 | + </view> | ||
32 | + </view> | ||
33 | + | ||
34 | + <!-- <view class='mid_list' bindtap='atHome'> | ||
35 | + | ||
36 | + <view class='mid_list_top'> | ||
37 | + <image src='/img/aicon_03@2x.png'></image> | ||
38 | + </view> | ||
39 | + | ||
40 | + <view class='mid_list_bottom'> | ||
29 | 在家可做 | 41 | 在家可做 |
30 | </view> | 42 | </view> |
31 | </view> | 43 | </view> |
32 | <view class='mid_list' bindtap='goodWord'> | 44 | <view class='mid_list' bindtap='goodWord'> |
33 | - <!-- 图片 --> | 45 | + |
34 | <view class='mid_list_top'> | 46 | <view class='mid_list_top'> |
35 | <image src='/img/aicon_05@2x.png'></image> | 47 | <image src='/img/aicon_05@2x.png'></image> |
36 | </view> | 48 | </view> |
37 | - <!-- 底部文字 --> | 49 | + |
38 | <view class='mid_list_bottom'> | 50 | <view class='mid_list_bottom'> |
39 | - 好评推荐 | 51 | + 好评工作 |
40 | </view> | 52 | </view> |
41 | </view> | 53 | </view> |
42 | <view class='mid_list' bindtap='hotRecommend'> | 54 | <view class='mid_list' bindtap='hotRecommend'> |
43 | - <!-- 图片 --> | 55 | + |
44 | <view class='mid_list_top'> | 56 | <view class='mid_list_top'> |
45 | <image src='/img/aicon_04@2x.png'></image> | 57 | <image src='/img/aicon_04@2x.png'></image> |
46 | </view> | 58 | </view> |
47 | - <!-- 底部文字 --> | 59 | + |
48 | <view class='mid_list_bottom'> | 60 | <view class='mid_list_bottom'> |
49 | 热门推荐 | 61 | 热门推荐 |
50 | </view> | 62 | </view> |
51 | </view> | 63 | </view> |
52 | <view class='mid_list' bindtap='easyPart'> | 64 | <view class='mid_list' bindtap='easyPart'> |
53 | - <!-- 图片 --> | 65 | + |
54 | <view class='mid_list_top'> | 66 | <view class='mid_list_top'> |
55 | <image src='/img/aicon_06@2x.png'></image> | 67 | <image src='/img/aicon_06@2x.png'></image> |
56 | </view> | 68 | </view> |
57 | - <!-- 底部文字 --> | 69 | + |
58 | <view class='mid_list_bottom'> | 70 | <view class='mid_list_bottom'> |
59 | 轻松兼职 | 71 | 轻松兼职 |
60 | </view> | 72 | </view> |
61 | - </view> | 73 | + </view> --> |
62 | </view> | 74 | </view> |
75 | + | ||
76 | + | ||
63 | <!-- 轮播图 --> | 77 | <!-- 轮播图 --> |
64 | <!-- <view class='banner'> | 78 | <!-- <view class='banner'> |
65 | <image src='/img/aicon_07@2x.png'></image> | 79 | <image src='/img/aicon_07@2x.png'></image> |
@@ -67,9 +81,9 @@ | @@ -67,9 +81,9 @@ | ||
67 | <swiper class='banner' indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-color="{{indicatorColor}}" indicator-active-color="{{indicatorActiveColor}}" bindchange="swiperChange"> | 81 | <swiper class='banner' indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-color="{{indicatorColor}}" indicator-active-color="{{indicatorActiveColor}}" bindchange="swiperChange"> |
68 | 82 | ||
69 | 83 | ||
70 | - <block wx:for="{{imgUrls}}" wx:key=''> | 84 | + <block wx:for="{{slide}}" wx:key='' > |
71 | <swiper-item> | 85 | <swiper-item> |
72 | - <image src="{{item.url}}" class="slide-image" /> | 86 | + <image src="{{item.image}}" class="slide-image" data-tourl="{{item.url}}" bindtap='toUrl' /> |
73 | </swiper-item> | 87 | </swiper-item> |
74 | 88 | ||
75 | <!-- <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view> --> | 89 | <!-- <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view> --> |
@@ -113,7 +127,7 @@ | @@ -113,7 +127,7 @@ | ||
113 | </view> | 127 | </view> |
114 | <!-- 条目 --> | 128 | <!-- 条目 --> |
115 | <view class='items'> | 129 | <view class='items'> |
116 | - <view class='item' > | 130 | + <view class='item' bindtap='toPosition' > |
117 | <!-- 头部 --> | 131 | <!-- 头部 --> |
118 | <view class='item_top'> | 132 | <view class='item_top'> |
119 | <view class='item_top_left'> | 133 | <view class='item_top_left'> |
@@ -132,7 +146,7 @@ | @@ -132,7 +146,7 @@ | ||
132 | </view> | 146 | </view> |
133 | <!-- 底部 --> | 147 | <!-- 底部 --> |
134 | <view class='item_bottom'> | 148 | <view class='item_bottom'> |
135 | - <view class='item_bottom_left'> | 149 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
136 | <view class='item_bottom_left_pic'> | 150 | <view class='item_bottom_left_pic'> |
137 | <image src='/img/aicon_10@2x.png'></image> | 151 | <image src='/img/aicon_10@2x.png'></image> |
138 | </view> | 152 | </view> |
@@ -148,7 +162,7 @@ | @@ -148,7 +162,7 @@ | ||
148 | </view> | 162 | </view> |
149 | </view> | 163 | </view> |
150 | </view> | 164 | </view> |
151 | - <view class='item' > | 165 | + <view class='item' bindtap='toPosition'> |
152 | <!-- 头部 --> | 166 | <!-- 头部 --> |
153 | <view class='item_top'> | 167 | <view class='item_top'> |
154 | <view class='item_top_left'> | 168 | <view class='item_top_left'> |
@@ -183,7 +197,7 @@ | @@ -183,7 +197,7 @@ | ||
183 | </view> | 197 | </view> |
184 | </view> | 198 | </view> |
185 | </view> | 199 | </view> |
186 | - <view class='item' > | 200 | + <view class='item' bindtap='toPosition'> |
187 | <!-- 头部 --> | 201 | <!-- 头部 --> |
188 | <view class='item_top'> | 202 | <view class='item_top'> |
189 | <view class='item_top_left'> | 203 | <view class='item_top_left'> |
@@ -218,7 +232,7 @@ | @@ -218,7 +232,7 @@ | ||
218 | </view> | 232 | </view> |
219 | </view> | 233 | </view> |
220 | </view> | 234 | </view> |
221 | - <view class='item' > | 235 | + <view class='item' bindtap='toPosition'> |
222 | <!-- 头部 --> | 236 | <!-- 头部 --> |
223 | <view class='item_top'> | 237 | <view class='item_top'> |
224 | <view class='item_top_left'> | 238 | <view class='item_top_left'> |
@@ -256,35 +270,9 @@ | @@ -256,35 +270,9 @@ | ||
256 | 270 | ||
257 | </view> | 271 | </view> |
258 | 272 | ||
259 | - <!-- 筛选弹层 --> | 273 | + <!------- 筛选弹层-------> |
260 | <view class='mask' wx:if='{{mask}}'> | 274 | <view class='mask' wx:if='{{mask}}'> |
261 | - <!-- <view class='select mask_select {{currentTab==index?}}' wx:key='unique' data-categ bindtap='select_btn' wx:for="{{navbar}}" data-idx="{{index}}"> | ||
262 | - <view class='select_list'> | ||
263 | - <view>地区</view> | ||
264 | - <view class='select_list_pic'> | ||
265 | - <image src='/img/aicon_11@2x.png'></image> | ||
266 | - </view> | ||
267 | - </view> | ||
268 | - <view class='select_list'> | ||
269 | - <view>岗位</view> | ||
270 | - <view class='select_list_pic'> | ||
271 | - <image src='/img/aicon_11@2x.png'></image> | ||
272 | - </view> | ||
273 | - </view> | ||
274 | - <view class='select_list'> | ||
275 | - <view>推荐排序</view> | ||
276 | - <view class='select_list_pic'> | ||
277 | - <image src='/img/aicon_11@2x.png'></image> | ||
278 | - </view> | ||
279 | - </view> | ||
280 | - <view class='select_list'> | ||
281 | - <view>筛选</view> | ||
282 | - <view class='select_list_pic_big'> | ||
283 | - <image src='/img/aicon_12@2x.png'></image> | ||
284 | - </view> | ||
285 | - </view> | ||
286 | - </view> --> | ||
287 | - | 275 | + |
288 | <view class="select mask_select"> | 276 | <view class="select mask_select"> |
289 | <view wx:for="{{navbar}}" data-idx="{{index}}" class="select_list {{currentTab==index ? 'active' : ''}}" wx:key="unique" bindtap="navbarTap" data-categoryid="{{item.id}}">{{item.name}} | 277 | <view wx:for="{{navbar}}" data-idx="{{index}}" class="select_list {{currentTab==index ? 'active' : ''}}" wx:key="unique" bindtap="navbarTap" data-categoryid="{{item.id}}">{{item.name}} |
290 | 278 | ||
@@ -294,7 +282,7 @@ | @@ -294,7 +282,7 @@ | ||
294 | <!-- 地区内容 --> | 282 | <!-- 地区内容 --> |
295 | <view class='area' wx:if="{{currentTab==0}}"> | 283 | <view class='area' wx:if="{{currentTab==0}}"> |
296 | <view class="area_item"> | 284 | <view class="area_item"> |
297 | -<view wx:for="{{areabar}}" data-idarea="{{index}}" class="area_item_name {{areaTab==index ? 'active' : ''}}" wx:key="unique" bindtap="area_Tap" data-categoryid="{{item.id}}">{{item.area}} | 285 | +<view wx:for="{{city_1}}" data-idarea="{{index}}" class="area_item_name {{areaTab==index ? 'active' : ''}}" wx:key="unique" bindtap="area_Tap" data-categoryid="{{item.id}}">{{item.name}} |
298 | 286 | ||
299 | </view> | 287 | </view> |
300 | </view> | 288 | </view> |
@@ -323,7 +311,7 @@ | @@ -323,7 +311,7 @@ | ||
323 | <!-- 岗位内容 --> | 311 | <!-- 岗位内容 --> |
324 | <view class='job' wx:if="{{currentTab==1}}"> | 312 | <view class='job' wx:if="{{currentTab==1}}"> |
325 | <view class="job_left"> | 313 | <view class="job_left"> |
326 | - <view wx:for="{{jobbar}}" data-idjob="{{index}}" class="job_left_item {{jobTab==index ? 'pitch_on' : ''}}" wx:key="unique" bindtap="job_Tap" data-categoryid="{{item.id}}">{{item.job}} | 314 | + <view wx:for="{{industry_1}}" data-idjob="{{index}}" class="job_left_item {{jobTab==index ? 'pitch_on' : ''}}" wx:key="unique" bindtap="job_Tap" data-categoryid="{{item.id}}">{{item.industry_name}} |
327 | 315 | ||
328 | </view> | 316 | </view> |
329 | </view> | 317 | </view> |
@@ -393,7 +381,7 @@ | @@ -393,7 +381,7 @@ | ||
393 | <view class='screen_item'> | 381 | <view class='screen_item'> |
394 | <view class='screen_item_top'> 学历要求 | 382 | <view class='screen_item_top'> 学历要求 |
395 | <view class="screen_item_bottom"> | 383 | <view class="screen_item_bottom"> |
396 | - <view wx:for="{{screenbar}}" data-idscreen="{{index}}" class="screen_item_bottom_i {{screenTab==index ? 'yellow_color' : ''}}" wx:key="unique" bindtap="screen_Tap" data-categoryid="{{item.id}}">{{item.screen}} | 384 | + <view wx:for="{{education_1}}" data-idscreen="{{index}}" class="screen_item_bottom_i {{screenTab==index ? 'yellow_color' : ''}}" wx:key="unique" bindtap="screen_Tap" data-categoryid="{{item.id}}">{{item.education_name}} |
397 | 385 | ||
398 | </view> | 386 | </view> |
399 | </view> | 387 | </view> |
@@ -420,7 +408,7 @@ | @@ -420,7 +408,7 @@ | ||
420 | <view class='screen_item'> | 408 | <view class='screen_item'> |
421 | <view class='screen_item_top'> 酬薪范围 | 409 | <view class='screen_item_top'> 酬薪范围 |
422 | <view class="screen_item_bottom"> | 410 | <view class="screen_item_bottom"> |
423 | - <view wx:for="{{scopebar}}" data-idscope="{{index}}" class="screen_item_bottom_i {{scopeTab==index ? 'yellow_color' : ''}}" wx:key="unique" bindtap="scope_Tap" data-categoryid="{{item.id}}">{{item.scope}} | 411 | + <view wx:for="{{salary_1}}" data-idscope="{{index}}" class="screen_item_bottom_i {{scopeTab==index ? 'yellow_color' : ''}}" wx:key="unique" bindtap="scope_Tap" data-categoryid="{{item.id}}">{{item.salary_name}} |
424 | 412 | ||
425 | </view> | 413 | </view> |
426 | </view> | 414 | </view> |
@@ -11,17 +11,22 @@ page{ | @@ -11,17 +11,22 @@ page{ | ||
11 | .top{ | 11 | .top{ |
12 | /* width: 100%; */ | 12 | /* width: 100%; */ |
13 | display: flex; | 13 | display: flex; |
14 | + justify-content: space-between; | ||
14 | background: #fff; | 15 | background: #fff; |
15 | padding: 24rpx 32rpx; | 16 | padding: 24rpx 32rpx; |
16 | } | 17 | } |
17 | .top_left{ | 18 | .top_left{ |
18 | display: flex; | 19 | display: flex; |
20 | + /* justify-content: space-between; */ | ||
19 | align-items: center; | 21 | align-items: center; |
20 | - font-size:28rpx; | 22 | + /* font-size:28rpx; */ |
21 | font-family:PingFang-SC-Medium; | 23 | font-family:PingFang-SC-Medium; |
22 | font-weight:500; | 24 | font-weight:500; |
23 | color:rgba(26,26,26,1); | 25 | color:rgba(26,26,26,1); |
24 | } | 26 | } |
27 | +.top_left_text{ | ||
28 | + font-size: 26rpx; | ||
29 | +} | ||
25 | .top_left_img{ | 30 | .top_left_img{ |
26 | margin-left: 14rpx; | 31 | margin-left: 14rpx; |
27 | width:18rpx; | 32 | width:18rpx; |
@@ -33,7 +38,7 @@ page{ | @@ -33,7 +38,7 @@ page{ | ||
33 | height: 100%; | 38 | height: 100%; |
34 | } | 39 | } |
35 | .top_right{ | 40 | .top_right{ |
36 | - margin-left: 30rpx; | 41 | + /* margin-left: 30rpx; */ |
37 | display: flex; | 42 | display: flex; |
38 | align-items: center; | 43 | align-items: center; |
39 | 44 |
pages/index/url/url.js
0 → 100644
1 | +// pages/index/url/url.js | ||
2 | +Page({ | ||
3 | + | ||
4 | + /** | ||
5 | + * 页面的初始数据 | ||
6 | + */ | ||
7 | + data: { | ||
8 | + | ||
9 | + }, | ||
10 | + | ||
11 | + /** | ||
12 | + * 生命周期函数--监听页面加载 | ||
13 | + */ | ||
14 | + onLoad: function (options) { | ||
15 | + | ||
16 | + }, | ||
17 | + | ||
18 | + /** | ||
19 | + * 生命周期函数--监听页面初次渲染完成 | ||
20 | + */ | ||
21 | + onReady: function () { | ||
22 | + | ||
23 | + }, | ||
24 | + | ||
25 | + /** | ||
26 | + * 生命周期函数--监听页面显示 | ||
27 | + */ | ||
28 | + onShow: function () { | ||
29 | + | ||
30 | + }, | ||
31 | + | ||
32 | + /** | ||
33 | + * 生命周期函数--监听页面隐藏 | ||
34 | + */ | ||
35 | + onHide: function () { | ||
36 | + | ||
37 | + }, | ||
38 | + | ||
39 | + /** | ||
40 | + * 生命周期函数--监听页面卸载 | ||
41 | + */ | ||
42 | + onUnload: function () { | ||
43 | + | ||
44 | + }, | ||
45 | + | ||
46 | + /** | ||
47 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
48 | + */ | ||
49 | + onPullDownRefresh: function () { | ||
50 | + | ||
51 | + }, | ||
52 | + | ||
53 | + /** | ||
54 | + * 页面上拉触底事件的处理函数 | ||
55 | + */ | ||
56 | + onReachBottom: function () { | ||
57 | + | ||
58 | + }, | ||
59 | + | ||
60 | + /** | ||
61 | + * 用户点击右上角分享 | ||
62 | + */ | ||
63 | + onShareAppMessage: function () { | ||
64 | + | ||
65 | + } | ||
66 | +}) |
pages/index/url/url.json
0 → 100644
pages/index/url/url.wxml
0 → 100644
pages/index/url/url.wxss
0 → 100644
1 | +/* pages/index/url/url.wxss */ |
1 | // pages/mine/mine.js | 1 | // pages/mine/mine.js |
2 | + | ||
3 | +const app = getApp() | ||
4 | + | ||
2 | Page({ | 5 | Page({ |
3 | 6 | ||
4 | /** | 7 | /** |
@@ -6,7 +9,8 @@ Page({ | @@ -6,7 +9,8 @@ Page({ | ||
6 | */ | 9 | */ |
7 | data: { | 10 | data: { |
8 | callPhone:false, | 11 | callPhone:false, |
9 | - show_apply:false | 12 | + show_apply:false, |
13 | + personal:'' | ||
10 | }, | 14 | }, |
11 | 15 | ||
12 | /** | 16 | /** |
@@ -95,7 +99,34 @@ Page({ | @@ -95,7 +99,34 @@ Page({ | ||
95 | }) | 99 | }) |
96 | }, | 100 | }, |
97 | onLoad: function (options) { | 101 | onLoad: function (options) { |
102 | + this.getPersonal() | ||
103 | + }, | ||
104 | + | ||
105 | + getPersonal() { | ||
106 | + | ||
107 | + let that = this; | ||
108 | + let url = 'index/user/me'; | ||
109 | + let params = { | ||
110 | + | ||
111 | + } | ||
112 | + let header = { | ||
113 | + "XX-Token": wx.getStorageSync('token'), | ||
114 | + "XX-Device-Type": 'wxapp' | ||
115 | + } | ||
116 | + app.post(url, params, header).then((res) => { | ||
117 | + console.log(res); | ||
118 | + // 获取值 | ||
119 | + that.setData({ | ||
120 | + personal: res.data | ||
121 | + }) | ||
98 | 122 | ||
123 | + | ||
124 | + | ||
125 | + | ||
126 | + | ||
127 | + }).catch((err) => { | ||
128 | + | ||
129 | + }) | ||
99 | }, | 130 | }, |
100 | 131 | ||
101 | /** | 132 | /** |
@@ -5,10 +5,11 @@ | @@ -5,10 +5,11 @@ | ||
5 | <view class='head_top'> | 5 | <view class='head_top'> |
6 | <view class='head_top_left'> | 6 | <view class='head_top_left'> |
7 | <view class='head_top_left_pic'> | 7 | <view class='head_top_left_pic'> |
8 | - <image src='../../img/aicon_49@2x.png'></image> | 8 | + <!-- <image src='../../img/aicon_49@2x.png'></image> --> |
9 | + <image src='{{personal.avatar}}'></image> | ||
9 | </view> | 10 | </view> |
10 | <view class='head_top_left_text'> | 11 | <view class='head_top_left_text'> |
11 | - 宇宙无敌小可爱 | 12 | + {{personal.user_nickname}} |
12 | </view> | 13 | </view> |
13 | </view> | 14 | </view> |
14 | 15 | ||
@@ -30,8 +31,8 @@ | @@ -30,8 +31,8 @@ | ||
30 | 31 | ||
31 | <view class='mid_content'> | 32 | <view class='mid_content'> |
32 | <view class='mid_content_top'>可提现金额(元)</view> | 33 | <view class='mid_content_top'>可提现金额(元)</view> |
33 | - <view class='mid_content_mid'>245</view> | ||
34 | - <view class='mid_content_bottom'>已提现金额(元)<span class='fontSize'>130</span></view> | 34 | + <view class='mid_content_mid'>{{personal.balance}}</view> |
35 | + <view class='mid_content_bottom'>已提现金额(元)<span class='fontSize'>{{personal.deposit}}</span></view> | ||
35 | </view> | 36 | </view> |
36 | <!-- 提现 --> | 37 | <!-- 提现 --> |
37 | <view class='mid_deposit' bindtap='open_apply'> | 38 | <view class='mid_deposit' bindtap='open_apply'> |
1 | // pages/myResume2/myResume2.js | 1 | // pages/myResume2/myResume2.js |
2 | +const app = getApp(); | ||
2 | Page({ | 3 | Page({ |
3 | 4 | ||
4 | /** | 5 | /** |
@@ -12,7 +13,35 @@ Page({ | @@ -12,7 +13,35 @@ Page({ | ||
12 | * 生命周期函数--监听页面加载 | 13 | * 生命周期函数--监听页面加载 |
13 | */ | 14 | */ |
14 | onLoad: function (options) { | 15 | onLoad: function (options) { |
16 | + that.getResume2() | ||
17 | + }, | ||
18 | + | ||
19 | + getResume2() { | ||
20 | + | ||
21 | + let that = this; | ||
22 | + let url = 'index/user/me_resume'; | ||
23 | + let params = { | ||
24 | + | ||
25 | + } | ||
26 | + let header = { | ||
27 | + "XX-Token": wx.getStorageSync('token'), | ||
28 | + "XX-Device-Type": 'wxapp' | ||
29 | + } | ||
30 | + app.post(url, params, header).then((res) => { | ||
31 | + console.log(res); | ||
32 | + // 获取值 | ||
33 | + that.setData({ | ||
34 | + personal: res.data | ||
35 | + }) | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + }).catch((err) => { | ||
15 | 43 | ||
44 | + }) | ||
16 | }, | 45 | }, |
17 | 46 | ||
18 | /** | 47 | /** |
pages/openIndex/openIndex.js
0 → 100644
1 | +//index.js | ||
2 | +//获取应用实例 | ||
3 | +const app = getApp() | ||
4 | + | ||
5 | +Page({ | ||
6 | + data: { | ||
7 | + | ||
8 | + }, | ||
9 | + | ||
10 | + getOpenId() { | ||
11 | + let that = this | ||
12 | + wx.login({ | ||
13 | + success: (res) => { | ||
14 | + let url = 'wxapp/public/getSessionKey' | ||
15 | + let param = { | ||
16 | + code: res.code, | ||
17 | + } | ||
18 | + | ||
19 | + app.post(url, param).then((res) => { | ||
20 | + console.log(res) | ||
21 | + that.setData({ | ||
22 | + openid: res.data.openid, | ||
23 | + session_key: res.data.session_key | ||
24 | + }) | ||
25 | + wx.getSetting({ | ||
26 | + success: res => { | ||
27 | + if (res.authSetting['scope.userInfo'] === true) { | ||
28 | + wx.getUserInfo({ | ||
29 | + success: reg => { | ||
30 | + that.setData({ | ||
31 | + encrypted_data: reg.encryptedData, | ||
32 | + iv: reg.iv | ||
33 | + }) | ||
34 | + that.login() | ||
35 | + } | ||
36 | + }) | ||
37 | + } | ||
38 | + | ||
39 | + } | ||
40 | + }) | ||
41 | + | ||
42 | + }).catch((errMsg) => { | ||
43 | + }) | ||
44 | + | ||
45 | + | ||
46 | + } | ||
47 | + }); | ||
48 | + }, | ||
49 | + | ||
50 | + // 获取用户权限信息 | ||
51 | + getUserInfo(e) { | ||
52 | + console.log(e) | ||
53 | + let that = this; | ||
54 | + if (e.detail.errMsg == "getUserInfo:ok") { | ||
55 | + that.setData({ | ||
56 | + encrypted_data: e.detail.encryptedData, | ||
57 | + iv: e.detail.iv | ||
58 | + }) | ||
59 | + that.login() | ||
60 | + } | ||
61 | + }, | ||
62 | + // 登录 | ||
63 | + login() { | ||
64 | + let that = this; | ||
65 | + let url = "wxapp/public/login"; | ||
66 | + let data = { | ||
67 | + openid: that.data.openid, | ||
68 | + session_key: that.data.session_key, | ||
69 | + encrypted_data: that.data.encrypted_data, | ||
70 | + iv: that.data.iv, | ||
71 | + } | ||
72 | + app.post(url, data).then((res) => { | ||
73 | + wx.setStorageSync("token", res.data.token); | ||
74 | + wx.showLoading({ | ||
75 | + title: '正在进入', | ||
76 | + }) | ||
77 | + | ||
78 | + let t = setInterval(function () { | ||
79 | + clearInterval(t) | ||
80 | + wx.switchTab({ | ||
81 | + url: '/pages/index/index', | ||
82 | + }) | ||
83 | + wx.hideLoading() | ||
84 | + }, 1500) | ||
85 | + | ||
86 | + }).catch((err) => { | ||
87 | + | ||
88 | + }) | ||
89 | + | ||
90 | + | ||
91 | + | ||
92 | + // }).catch((errMsg) => { }) | ||
93 | + | ||
94 | + }, | ||
95 | + | ||
96 | + | ||
97 | + | ||
98 | + | ||
99 | + // 111 | ||
100 | + /** | ||
101 | + * 生命周期函数--监听页面加载 | ||
102 | + */ | ||
103 | + onLoad: function (options) { | ||
104 | + this.getOpenId(); | ||
105 | + }, | ||
106 | + | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | + | ||
113 | + | ||
114 | +}) |
pages/openIndex/openIndex.json
0 → 100644
pages/openIndex/openIndex.wxml
0 → 100644
pages/openIndex/openIndex.wxss
0 → 100644
1 | +/**index.wxss**/ | ||
2 | +.cover{ | ||
3 | + position: relative; | ||
4 | + height: 100vh; | ||
5 | + overflow:hidden; | ||
6 | + box-sizing: border-box; | ||
7 | + padding-top: 200rpx; | ||
8 | +} | ||
9 | +.cover image{ | ||
10 | + display: block; | ||
11 | + width:300rpx; | ||
12 | + height:300rpx; | ||
13 | + margin: 0 auto; | ||
14 | +} | ||
15 | +.cover text{ | ||
16 | + display: block; | ||
17 | + width: 500rpx; | ||
18 | + margin: 0 auto; | ||
19 | + text-align: center; | ||
20 | +} | ||
21 | +.go{ | ||
22 | + position: absolute; | ||
23 | + bottom:26.41%; | ||
24 | + left:0; | ||
25 | + right: 0; | ||
26 | + margin: auto; | ||
27 | + width:400rpx; | ||
28 | + height:80rpx; | ||
29 | + border-radius:40rpx; | ||
30 | + background: rgba(255,102,0,1); | ||
31 | + /* border:1rpx solid #434343; */ | ||
32 | +} | ||
33 | +.go button{ | ||
34 | + font-size:30rpx; | ||
35 | + color:#fff; | ||
36 | + text-align: center; | ||
37 | + line-height:80rpx; | ||
38 | + border-radius:40rpx; | ||
39 | + display: block; | ||
40 | + background:none; | ||
41 | +} |
1 | -// pages/personalData/personalData.js | 1 | + |
2 | +const app = getApp() | ||
3 | + | ||
2 | Page({ | 4 | Page({ |
3 | 5 | ||
4 | /** | 6 | /** |
@@ -12,6 +14,101 @@ Page({ | @@ -12,6 +14,101 @@ Page({ | ||
12 | genderMale:1 | 14 | genderMale:1 |
13 | }, | 15 | }, |
14 | 16 | ||
17 | + // 获取Open ID | ||
18 | + getOpenId() { | ||
19 | + let that = this | ||
20 | + wx.login({ | ||
21 | + success: (res) => { | ||
22 | + let url = 'wxapp/public/getSessionKey' | ||
23 | + let param = { | ||
24 | + code: res.code, | ||
25 | + } | ||
26 | + | ||
27 | + app.post(url, param).then((res) => { | ||
28 | + console.log(res) | ||
29 | + that.setData({ | ||
30 | + openid: res.data.openid, | ||
31 | + session_key: res.data.session_key | ||
32 | + }) | ||
33 | + wx.getSetting({ | ||
34 | + success: res => { | ||
35 | + if (res.authSetting['scope.userInfo'] === true) { | ||
36 | + wx.getUserInfo({ | ||
37 | + success: reg => { | ||
38 | + that.setData({ | ||
39 | + encrypted_data: reg.encryptedData, | ||
40 | + iv: reg.iv | ||
41 | + }) | ||
42 | + // 获取完后自动执行login 然后跳转至设置的url | ||
43 | + // that.login() | ||
44 | + } | ||
45 | + }) | ||
46 | + } | ||
47 | + | ||
48 | + } | ||
49 | + }) | ||
50 | + | ||
51 | + }).catch((errMsg) => { | ||
52 | + }) | ||
53 | + | ||
54 | + | ||
55 | + } | ||
56 | + }); | ||
57 | + }, | ||
58 | + | ||
59 | + // 获取用户权限信息 | ||
60 | + getUserInfo(e) { | ||
61 | + | ||
62 | + let that = this; | ||
63 | + if (e.detail.errMsg == "getUserInfo:ok") { | ||
64 | + that.setData({ | ||
65 | + encrypted_data: e.detail.encryptedData, | ||
66 | + iv: e.detail.iv | ||
67 | + }) | ||
68 | + | ||
69 | + that.login() | ||
70 | + } | ||
71 | + | ||
72 | + | ||
73 | + }, | ||
74 | + | ||
75 | + // 登录 | ||
76 | + login() { | ||
77 | + let that = this; | ||
78 | + let url = "wxapp/public/login"; | ||
79 | + let data = { | ||
80 | + openid: that.data.openid, | ||
81 | + session_key: that.data.session_key, | ||
82 | + encrypted_data: that.data.encrypted_data, | ||
83 | + iv: that.data.iv, | ||
84 | + } | ||
85 | + app.post(url, data).then((res) => { | ||
86 | + wx.setStorageSync("token", res.data.token); | ||
87 | + wx.showLoading({ | ||
88 | + title: '正在进入', | ||
89 | + }) | ||
90 | + | ||
91 | + let t = setInterval(function () { | ||
92 | + clearInterval(t) | ||
93 | + wx.switchTab({ | ||
94 | + url: '../index/index', | ||
95 | + }) | ||
96 | + wx.hideLoading() | ||
97 | + }, 1500) | ||
98 | + | ||
99 | + }).catch((err) => { | ||
100 | + | ||
101 | + }) | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | + // }).catch((errMsg) => { }) | ||
106 | + | ||
107 | + }, | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
15 | /** | 112 | /** |
16 | * 生命周期函数--监听页面加载 | 113 | * 生命周期函数--监听页面加载 |
17 | */ | 114 | */ |
@@ -48,9 +145,11 @@ Page({ | @@ -48,9 +145,11 @@ Page({ | ||
48 | }, | 145 | }, |
49 | 146 | ||
50 | onLoad: function (options) { | 147 | onLoad: function (options) { |
51 | - | 148 | + this.getOpenId(); |
52 | }, | 149 | }, |
53 | 150 | ||
151 | + | ||
152 | + | ||
54 | /** | 153 | /** |
55 | * 生命周期函数--监听页面初次渲染完成 | 154 | * 生命周期函数--监听页面初次渲染完成 |
56 | */ | 155 | */ |
@@ -4,10 +4,12 @@ | @@ -4,10 +4,12 @@ | ||
4 | <view class='top_left_t'>完善个人资料</view> | 4 | <view class='top_left_t'>完善个人资料</view> |
5 | <view class='top_left_b'>增加更多面试机会</view> | 5 | <view class='top_left_b'>增加更多面试机会</view> |
6 | </view> | 6 | </view> |
7 | - <view class='top_right'> | 7 | + <!-- <view class='top_right'> |
8 | 跳过 | 8 | 跳过 |
9 | + </view> --> | ||
10 | + <view class='top_right'> | ||
11 | + <button open-type='getUserInfo' bindgetuserinfo="getUserInfo">跳过</button> | ||
9 | </view> | 12 | </view> |
10 | - | ||
11 | </view> | 13 | </view> |
12 | 14 | ||
13 | <view class='mid'> | 15 | <view class='mid'> |
@@ -34,7 +34,7 @@ page{ | @@ -34,7 +34,7 @@ page{ | ||
34 | color:rgba(102,102,102,1); | 34 | color:rgba(102,102,102,1); |
35 | } | 35 | } |
36 | .top_right{ | 36 | .top_right{ |
37 | - width:100rpx; | 37 | + /* width:100rpx; |
38 | height:100rpx; | 38 | height:100rpx; |
39 | line-height: 100rpx; | 39 | line-height: 100rpx; |
40 | text-align: center; | 40 | text-align: center; |
@@ -44,7 +44,17 @@ page{ | @@ -44,7 +44,17 @@ page{ | ||
44 | font-size:26rpx; | 44 | font-size:26rpx; |
45 | font-family:PingFang-SC-Regular; | 45 | font-family:PingFang-SC-Regular; |
46 | font-weight:400; | 46 | font-weight:400; |
47 | - color:rgba(102,102,102,1); | 47 | + color:rgba(102,102,102,1); */ |
48 | +} | ||
49 | +.top_right button{ | ||
50 | + width:100rpx; | ||
51 | + height:100rpx; | ||
52 | + line-height: 100rpx; | ||
53 | + border:1px solid rgba(207,207,207,1); | ||
54 | + border-radius:50%; | ||
55 | + background: transparent; | ||
56 | + font-size: 26rpx; | ||
57 | + padding: 0; | ||
48 | } | 58 | } |
49 | 59 | ||
50 | .mid{ | 60 | .mid{ |
@@ -24,6 +24,12 @@ Page({ | @@ -24,6 +24,12 @@ Page({ | ||
24 | share:false | 24 | share:false |
25 | }) | 25 | }) |
26 | }, | 26 | }, |
27 | + // 跳转招聘者信息 | ||
28 | + toRecruiter(){ | ||
29 | + wx.navigateTo({ | ||
30 | + url: '/pages/employerDetails/employerDetails', | ||
31 | + }) | ||
32 | + }, | ||
27 | onLoad: function (options) { | 33 | onLoad: function (options) { |
28 | 34 | ||
29 | }, | 35 | }, |
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | <!-- 招聘者信息 --> | 30 | <!-- 招聘者信息 --> |
31 | <view class='item'> | 31 | <view class='item'> |
32 | <view class='item_top'>招聘者信息</view> | 32 | <view class='item_top'>招聘者信息</view> |
33 | - <view class='item_infor'> | 33 | + <view class='item_infor' bindtap='toRecruiter'> |
34 | <view class='item_infor_left'> | 34 | <view class='item_infor_left'> |
35 | <image src='../../img/aicon_18@2x.png'></image> | 35 | <image src='../../img/aicon_18@2x.png'></image> |
36 | </view> | 36 | </view> |
1 | // pages/publish/publish.js | 1 | // pages/publish/publish.js |
2 | + | ||
3 | +var that; | ||
2 | Page({ | 4 | Page({ |
3 | 5 | ||
4 | /** | 6 | /** |
@@ -7,69 +9,21 @@ Page({ | @@ -7,69 +9,21 @@ Page({ | ||
7 | data: { | 9 | data: { |
8 | array: ['在家可做', '好评工作', '热门推荐', '轻松兼职'], | 10 | array: ['在家可做', '好评工作', '热门推荐', '轻松兼职'], |
9 | status:false, | 11 | status:false, |
10 | - // objectArray: [ | ||
11 | - // { | ||
12 | - // id: 0, | ||
13 | - // name: '美国' | ||
14 | - // }, | ||
15 | - // { | ||
16 | - // id: 1, | ||
17 | - // name: '中国' | ||
18 | - // }, | ||
19 | - // { | ||
20 | - // id: 2, | ||
21 | - // name: '巴西' | ||
22 | - // }, | ||
23 | - // { | ||
24 | - // id: 3, | ||
25 | - // name: '日本' | ||
26 | - // } | ||
27 | - // ], | 12 | + |
28 | jobIndex: 0, | 13 | jobIndex: 0, |
29 | 14 | ||
30 | industry: ['餐饮', '金融', '计算机'], | 15 | industry: ['餐饮', '金融', '计算机'], |
31 | - // objectArray: [ | ||
32 | - // { | ||
33 | - // id: 0, | ||
34 | - // name: '美国' | ||
35 | - // }, | ||
36 | - // { | ||
37 | - // id: 1, | ||
38 | - // name: '中国' | ||
39 | - // }, | ||
40 | - // { | ||
41 | - // id: 2, | ||
42 | - // name: '巴西' | ||
43 | - // }, | ||
44 | - // { | ||
45 | - // id: 3, | ||
46 | - // name: '日本' | ||
47 | - // } | ||
48 | - // ], | 16 | + |
49 | industryIndex: 0, | 17 | industryIndex: 0, |
50 | 18 | ||
51 | post: ['厨师', '医生', '程序员'], | 19 | post: ['厨师', '医生', '程序员'], |
52 | - // objectArray: [ | ||
53 | - // { | ||
54 | - // id: 0, | ||
55 | - // name: '美国' | ||
56 | - // }, | ||
57 | - // { | ||
58 | - // id: 1, | ||
59 | - // name: '中国' | ||
60 | - // }, | ||
61 | - // { | ||
62 | - // id: 2, | ||
63 | - // name: '巴西' | ||
64 | - // }, | ||
65 | - // { | ||
66 | - // id: 3, | ||
67 | - // name: '日本' | ||
68 | - // } | ||
69 | - // ], | 20 | + |
70 | postIndex: 0, | 21 | postIndex: 0, |
71 | 22 | ||
72 | - switch_content:false | 23 | + switch_content:false, |
24 | + | ||
25 | + images: [], | ||
26 | + bannerImage: [], | ||
73 | }, | 27 | }, |
74 | // 岗位分类 | 28 | // 岗位分类 |
75 | jobClass: function (e) { | 29 | jobClass: function (e) { |
@@ -115,9 +69,57 @@ Page({ | @@ -115,9 +69,57 @@ Page({ | ||
115 | * 生命周期函数--监听页面加载 | 69 | * 生命周期函数--监听页面加载 |
116 | */ | 70 | */ |
117 | onLoad: function (options) { | 71 | onLoad: function (options) { |
72 | + that = this; | ||
73 | + }, | ||
118 | 74 | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + // 选择图片 | ||
79 | + chooseImage: function () { | ||
80 | + // 选择图片 | ||
81 | + wx.chooseImage({ | ||
82 | + count: 3, // 默认9 | ||
83 | + sizeType: ['compressed'], | ||
84 | + sourceType: ['album', 'camera'], | ||
85 | + // 可以指定来源是相册还是相机,默认二者都有 | ||
86 | + success: function (res) { | ||
87 | + console.log(res) | ||
88 | + // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 | ||
89 | + var tempFilePaths = res.tempFilePaths; | ||
90 | + that.setData({ | ||
91 | + images: that.data.images.concat(tempFilePaths) | ||
92 | + }); | ||
93 | + | ||
94 | + } | ||
95 | + }) | ||
119 | }, | 96 | }, |
120 | 97 | ||
98 | + // 图片预览 | ||
99 | + previewImage: function (e) { | ||
100 | + //console.log(this.data.images); | ||
101 | + var current = e.target.dataset.src | ||
102 | + wx.previewImage({ | ||
103 | + current: current, | ||
104 | + urls: this.data.images | ||
105 | + }) | ||
106 | + }, | ||
107 | + | ||
108 | + // 图片删除功能 | ||
109 | + delete: function (e) { | ||
110 | + var index = e.currentTarget.dataset.index; | ||
111 | + var images = that.data.images; | ||
112 | + images.splice(index, 1); | ||
113 | + that.setData({ | ||
114 | + images: images | ||
115 | + }); | ||
116 | + }, | ||
117 | + | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | ||
121 | /** | 123 | /** |
122 | * 生命周期函数--监听页面初次渲染完成 | 124 | * 生命周期函数--监听页面初次渲染完成 |
123 | */ | 125 | */ |
@@ -63,41 +63,60 @@ | @@ -63,41 +63,60 @@ | ||
63 | <!-- 企业logo --> | 63 | <!-- 企业logo --> |
64 | <view class='item logo'> | 64 | <view class='item logo'> |
65 | <view class='item_left'>企业logo</view> | 65 | <view class='item_left'>企业logo</view> |
66 | - <view class='item_right'> | ||
67 | - <view class='item_right_logo'> | ||
68 | - <image src='../../img/logo.png'></image> | ||
69 | - <!-- 关闭图标 --> | ||
70 | - <view class='close_logo'> | 66 | + <!-- <view class='item_right'> </view> --> |
67 | + | ||
68 | + | ||
69 | + <!-- logo图片 --> | ||
70 | + <view class='pic_box'> | ||
71 | + <view class="btn-file" wx:for="{{images}}" wx:key=""> | ||
72 | + <image src="{{item}}" data-src="{{item}}" bindtap="previewImage" mode="aspectFill" /> | ||
73 | + | ||
74 | + <!-- 删除按钮 --> | ||
75 | + <view class="delete" bindtap="delete" data-index="{{index}}"> | ||
71 | <image src='../../img/icon.png'></image> | 76 | <image src='../../img/icon.png'></image> |
72 | </view> | 77 | </view> |
73 | </view> | 78 | </view> |
74 | - <view class='item_right_icon'> | ||
75 | - <!-- <image src='../../img/right.png'></image> --> | 79 | + |
80 | + <view class='gallery_pic' bindtap='chooseImage'> | ||
81 | + <image src='../../img/btn-file.png'></image> | ||
76 | </view> | 82 | </view> |
83 | + | ||
84 | + | ||
77 | </view> | 85 | </view> |
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | ||
78 | </view> | 90 | </view> |
79 | <!-- banner --> | 91 | <!-- banner --> |
80 | <view class='item banner'> | 92 | <view class='item banner'> |
81 | <view class='item_left'>banner</view> | 93 | <view class='item_left'>banner</view> |
82 | - <view class='item_right'> | ||
83 | - <view class='item_right_banner'> | ||
84 | - <image src='../../img/logo.png'></image> | ||
85 | - <!-- 关闭图标 --> | ||
86 | - <view class='close_logo'> | 94 | + <!-- logo图片 --> |
95 | + <view class='pic_banner '> | ||
96 | + <view class="banner_small" wx:for="{{images}}" wx:key=""> | ||
97 | + <image src="{{item}}" data-src="{{item}}" bindtap="previewImage" mode="aspectFill" /> | ||
98 | + | ||
99 | + <!-- 删除按钮 --> | ||
100 | + <view class="delete" bindtap="delete" data-index="{{index}}"> | ||
87 | <image src='../../img/icon.png'></image> | 101 | <image src='../../img/icon.png'></image> |
88 | </view> | 102 | </view> |
89 | </view> | 103 | </view> |
90 | - <view class='item_right_icon'> | ||
91 | - <!-- <image src='../../img/right.png'></image> --> | 104 | + |
105 | + <view class='banner_pic' bindtap='chooseImage'> | ||
106 | + <image src='../../img/btn-file.png'></image> | ||
92 | </view> | 107 | </view> |
108 | + | ||
109 | + | ||
93 | </view> | 110 | </view> |
111 | + | ||
112 | + | ||
94 | </view> | 113 | </view> |
95 | <!-- 输入工资 --> | 114 | <!-- 输入工资 --> |
96 | <view class='item'> | 115 | <view class='item'> |
97 | <view class='item_left'>输入工资</view> | 116 | <view class='item_left'>输入工资</view> |
98 | <view class='item_right salary'> | 117 | <view class='item_right salary'> |
99 | <!-- 酬薪范围与固定薪资切换 --> | 118 | <!-- 酬薪范围与固定薪资切换 --> |
100 | - <view class='item_right_top' > | 119 | + <view class='item_right_top'> |
101 | <view class='item_right_top_left {{status==true?"color_y":""}}' bindtap='switch_a'>酬薪范围</view> | 120 | <view class='item_right_top_left {{status==true?"color_y":""}}' bindtap='switch_a'>酬薪范围</view> |
102 | <view class='item_right_top_right {{status==false?"color_y":""}}' bindtap='switch_a'>固定薪资</view> | 121 | <view class='item_right_top_right {{status==false?"color_y":""}}' bindtap='switch_a'>固定薪资</view> |
103 | </view> | 122 | </view> |
@@ -360,4 +360,65 @@ page{ | @@ -360,4 +360,65 @@ page{ | ||
360 | font-family:PingFang-SC-Medium; | 360 | font-family:PingFang-SC-Medium; |
361 | font-weight:500; | 361 | font-weight:500; |
362 | color:rgba(255,255,255,1); | 362 | color:rgba(255,255,255,1); |
363 | +} | ||
364 | +.pic_box{ | ||
365 | + display: flex; | ||
366 | + width: 450rpx; | ||
367 | +} | ||
368 | + | ||
369 | +.btn-file{ | ||
370 | + width:72rpx; | ||
371 | + height:72rpx; | ||
372 | + border-radius:2rpx; | ||
373 | + position: relative; | ||
374 | +} | ||
375 | +.btn-file image{ | ||
376 | + width: 100%; | ||
377 | + height: 100%; | ||
378 | +} | ||
379 | +.gallery_pic{ | ||
380 | + width:72rpx; | ||
381 | + height:72rpx; | ||
382 | + border-radius:2rpx; | ||
383 | +} | ||
384 | +.gallery_pic image{ | ||
385 | + width: 100%; | ||
386 | + height: 100%; | ||
387 | +} | ||
388 | +.delete{ | ||
389 | + width:26rpx; | ||
390 | + height:26rpx; | ||
391 | + display:flex; | ||
392 | + position:absolute; | ||
393 | + right:-10rpx; | ||
394 | + top:-8rpx; | ||
395 | + | ||
396 | +} | ||
397 | +.delete image{ | ||
398 | + width: 100%; | ||
399 | + height: 100%; | ||
400 | +} | ||
401 | + | ||
402 | +.pic_banner{ | ||
403 | + display: flex; | ||
404 | + width: 450rpx | ||
405 | +} | ||
406 | +.banner_pic{ | ||
407 | + width:250rpx; | ||
408 | + height:120rpx; | ||
409 | + display: flex; | ||
410 | +} | ||
411 | +.banner_pic image{ | ||
412 | + width: 100%; | ||
413 | + height: 100%; | ||
414 | +} | ||
415 | +.banner_small{ | ||
416 | + width:250rpx; | ||
417 | + height:120rpx; | ||
418 | + display: flex; | ||
419 | + position: relative; | ||
420 | +} | ||
421 | +.banner_small image{ | ||
422 | + width: 100%; | ||
423 | + height: 100%; | ||
363 | } | 424 | } |
@@ -11,10 +11,23 @@ Page({ | @@ -11,10 +11,23 @@ Page({ | ||
11 | /** | 11 | /** |
12 | * 生命周期函数--监听页面加载 | 12 | * 生命周期函数--监听页面加载 |
13 | */ | 13 | */ |
14 | + | ||
15 | + toPosition() { | ||
16 | + wx.navigateTo({ | ||
17 | + url: '/pages/positionDetails/positionDetails', | ||
18 | + }) | ||
19 | + }, | ||
20 | + // 跳转招聘者信息 | ||
21 | + toRecruiter() { | ||
22 | + wx.navigateTo({ | ||
23 | + url: '/pages/employerDetails/employerDetails', | ||
24 | + }) | ||
25 | + }, | ||
14 | onLoad: function (options) { | 26 | onLoad: function (options) { |
15 | 27 | ||
16 | }, | 28 | }, |
17 | 29 | ||
30 | + | ||
18 | /** | 31 | /** |
19 | * 生命周期函数--监听页面初次渲染完成 | 32 | * 生命周期函数--监听页面初次渲染完成 |
20 | */ | 33 | */ |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <view class='underline'></view> | 5 | <view class='underline'></view> |
6 | <!-- 条目 --> | 6 | <!-- 条目 --> |
7 | <view class='items'> | 7 | <view class='items'> |
8 | - <view class='item'> | 8 | + <view class='item' bindtap='toPosition'> |
9 | <!-- 头部 --> | 9 | <!-- 头部 --> |
10 | <view class='item_top'> | 10 | <view class='item_top'> |
11 | <view class='item_top_left'> | 11 | <view class='item_top_left'> |
@@ -24,42 +24,7 @@ | @@ -24,42 +24,7 @@ | ||
24 | </view> | 24 | </view> |
25 | <!-- 底部 --> | 25 | <!-- 底部 --> |
26 | <view class='item_bottom'> | 26 | <view class='item_bottom'> |
27 | - <view class='item_bottom_left'> | ||
28 | - <view class='item_bottom_left_pic'> | ||
29 | - <image src='/img/aicon_10@2x.png'></image> | ||
30 | - </view> | ||
31 | - <!-- 名字 --> | ||
32 | - <view>王思迪</view> | ||
33 | - </view> | ||
34 | - | ||
35 | - <view class='item_bottom_right'> | ||
36 | - <view class='item_bottom_left_pic'> | ||
37 | - <image src='/img/aicon_09@2x.png'></image> | ||
38 | - </view> | ||
39 | - <view>南开区 3.2km</view> | ||
40 | - </view> | ||
41 | - </view> | ||
42 | - </view> | ||
43 | - <view class='item'> | ||
44 | - <!-- 头部 --> | ||
45 | - <view class='item_top'> | ||
46 | - <view class='item_top_left'> | ||
47 | - <view class='item_top_left_pic'> | ||
48 | - <image src='/img/aicon_08@2x.png'></image> | ||
49 | - </view> | ||
50 | - <view class='item_top_left_text'> | ||
51 | - <view class='text_top'>酒店服务员</view> | ||
52 | - <view class='text_bottom'>4000-5000元/月</view> | ||
53 | - </view> | ||
54 | - </view> | ||
55 | - | ||
56 | - <view class='item_top_right'> | ||
57 | - 已报名 | ||
58 | - </view> | ||
59 | - </view> | ||
60 | - <!-- 底部 --> | ||
61 | - <view class='item_bottom'> | ||
62 | - <view class='item_bottom_left'> | 27 | + <view class='item_bottom_left' bindtap='toRecruiter'> |
63 | <view class='item_bottom_left_pic'> | 28 | <view class='item_bottom_left_pic'> |
64 | <image src='/img/aicon_10@2x.png'></image> | 29 | <image src='/img/aicon_10@2x.png'></image> |
65 | </view> | 30 | </view> |
@@ -76,6 +41,7 @@ | @@ -76,6 +41,7 @@ | ||
76 | </view> | 41 | </view> |
77 | </view> | 42 | </view> |
78 | 43 | ||
44 | + | ||
79 | 45 | ||
80 | </view> | 46 | </view> |
81 | 47 |
@@ -5,14 +5,41 @@ Page({ | @@ -5,14 +5,41 @@ Page({ | ||
5 | * 页面的初始数据 | 5 | * 页面的初始数据 |
6 | */ | 6 | */ |
7 | data: { | 7 | data: { |
8 | - | 8 | + registrationList:'' |
9 | }, | 9 | }, |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * 生命周期函数--监听页面加载 | 12 | * 生命周期函数--监听页面加载 |
13 | */ | 13 | */ |
14 | onLoad: function (options) { | 14 | onLoad: function (options) { |
15 | + that.registration() | ||
16 | + }, | ||
17 | + // 报名名单功能 | ||
18 | + registration() { | ||
19 | + | ||
20 | + let that = this; | ||
21 | + let url = 'index/user/boss_job_apply_record'; | ||
22 | + let params = { | ||
23 | + | ||
24 | + } | ||
25 | + let header = { | ||
26 | + "XX-Token": wx.getStorageSync('token'), | ||
27 | + "XX-Device-Type": 'wxapp' | ||
28 | + } | ||
29 | + app.post(url, params, header).then((res) => { | ||
30 | + console.log(res); | ||
31 | + // 获取值 | ||
32 | + that.setData({ | ||
33 | + personal: res.data | ||
34 | + }) | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + }).catch((err) => { | ||
15 | 41 | ||
42 | + }) | ||
16 | }, | 43 | }, |
17 | 44 | ||
18 | /** | 45 | /** |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | "ignore": [] | 4 | "ignore": [] |
5 | }, | 5 | }, |
6 | "setting": { | 6 | "setting": { |
7 | - "urlCheck": true, | 7 | + "urlCheck": false, |
8 | "es6": true, | 8 | "es6": true, |
9 | "postcss": true, | 9 | "postcss": true, |
10 | "minified": true, | 10 | "minified": true, |
@@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
37 | "list": [] | 37 | "list": [] |
38 | }, | 38 | }, |
39 | "miniprogram": { | 39 | "miniprogram": { |
40 | - "current": 0, | 40 | + "current": 25, |
41 | "list": [ | 41 | "list": [ |
42 | { | 42 | { |
43 | "id": 0, | 43 | "id": 0, |
@@ -213,6 +213,12 @@ | @@ -213,6 +213,12 @@ | ||
213 | "pathName": "pages/hotRecommend/hotRecommend", | 213 | "pathName": "pages/hotRecommend/hotRecommend", |
214 | "query": "", | 214 | "query": "", |
215 | "scene": null | 215 | "scene": null |
216 | + }, | ||
217 | + { | ||
218 | + "id": -1, | ||
219 | + "name": "启动页", | ||
220 | + "pathName": "pages/openIndex/openIndex", | ||
221 | + "scene": null | ||
216 | } | 222 | } |
217 | ] | 223 | ] |
218 | } | 224 | } |
utils/qqmap-wx-jssdk.js
0 → 100644
1 | +/** | ||
2 | + * 微信小程序JavaScriptSDK | ||
3 | + * | ||
4 | + * @version 1.0 | ||
5 | + * @date 2017-01-10 | ||
6 | + * @author jaysonzhou@tencent.com | ||
7 | + */ | ||
8 | + | ||
9 | +var ERROR_CONF = { | ||
10 | + KEY_ERR: 311, | ||
11 | + KEY_ERR_MSG: 'key格式错误', | ||
12 | + PARAM_ERR: 310, | ||
13 | + PARAM_ERR_MSG: '请求参数信息有误', | ||
14 | + SYSTEM_ERR: 600, | ||
15 | + SYSTEM_ERR_MSG: '系统错误', | ||
16 | + WX_ERR_CODE: 1000, | ||
17 | + WX_OK_CODE: 200 | ||
18 | +}; | ||
19 | +var BASE_URL = 'https://apis.map.qq.com/ws/'; | ||
20 | +var URL_SEARCH = BASE_URL + 'place/v1/search'; | ||
21 | +var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; | ||
22 | +var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; | ||
23 | +var URL_CITY_LIST = BASE_URL + 'district/v1/list'; | ||
24 | +var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; | ||
25 | +var URL_DISTANCE = BASE_URL + 'distance/v1/'; | ||
26 | +var Utils = { | ||
27 | + /** | ||
28 | + * 得到终点query字符串 | ||
29 | + * @param {Array|String} 检索数据 | ||
30 | + */ | ||
31 | + location2query(data) { | ||
32 | + if (typeof data == 'string') { | ||
33 | + return data; | ||
34 | + } | ||
35 | + var query = ''; | ||
36 | + for (var i = 0; i < data.length; i++) { | ||
37 | + var d = data[i]; | ||
38 | + if (!!query) { | ||
39 | + query += ';'; | ||
40 | + } | ||
41 | + if (d.location) { | ||
42 | + query = query + d.location.lat + ',' + d.location.lng; | ||
43 | + } | ||
44 | + if (d.latitude && d.longitude) { | ||
45 | + query = query + d.latitude + ',' + d.longitude; | ||
46 | + } | ||
47 | + } | ||
48 | + return query; | ||
49 | + }, | ||
50 | + | ||
51 | + /** | ||
52 | + * 使用微信接口进行定位 | ||
53 | + */ | ||
54 | + getWXLocation(success, fail, complete) { | ||
55 | + wx.getLocation({ | ||
56 | + type: 'gcj02', | ||
57 | + success: success, | ||
58 | + fail: fail, | ||
59 | + complete: complete | ||
60 | + }); | ||
61 | + }, | ||
62 | + | ||
63 | + /** | ||
64 | + * 获取location参数 | ||
65 | + */ | ||
66 | + getLocationParam(location) { | ||
67 | + if (typeof location == 'string') { | ||
68 | + var locationArr = location.split(','); | ||
69 | + if (locationArr.length === 2) { | ||
70 | + location = { | ||
71 | + latitude: location.split(',')[0], | ||
72 | + longitude: location.split(',')[1] | ||
73 | + }; | ||
74 | + } else { | ||
75 | + location = {}; | ||
76 | + } | ||
77 | + } | ||
78 | + return location; | ||
79 | + }, | ||
80 | + | ||
81 | + /** | ||
82 | + * 回调函数默认处理 | ||
83 | + */ | ||
84 | + polyfillParam(param) { | ||
85 | + param.success = param.success || function () { }; | ||
86 | + param.fail = param.fail || function () { }; | ||
87 | + param.complete = param.complete || function () { }; | ||
88 | + }, | ||
89 | + | ||
90 | + /** | ||
91 | + * 验证param对应的key值是否为空 | ||
92 | + * | ||
93 | + * @param {Object} param 接口参数 | ||
94 | + * @param {String} key 对应参数的key | ||
95 | + */ | ||
96 | + checkParamKeyEmpty(param, key) { | ||
97 | + if (!param[key]) { | ||
98 | + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误'); | ||
99 | + param.fail(errconf); | ||
100 | + param.complete(errconf); | ||
101 | + return true; | ||
102 | + } | ||
103 | + return false; | ||
104 | + }, | ||
105 | + | ||
106 | + /** | ||
107 | + * 验证参数中是否存在检索词keyword | ||
108 | + * | ||
109 | + * @param {Object} param 接口参数 | ||
110 | + */ | ||
111 | + checkKeyword(param){ | ||
112 | + return !this.checkParamKeyEmpty(param, 'keyword'); | ||
113 | + }, | ||
114 | + | ||
115 | + /** | ||
116 | + * 验证location值 | ||
117 | + * | ||
118 | + * @param {Object} param 接口参数 | ||
119 | + */ | ||
120 | + checkLocation(param) { | ||
121 | + var location = this.getLocationParam(param.location); | ||
122 | + if (!location || !location.latitude || !location.longitude) { | ||
123 | + var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误') | ||
124 | + param.fail(errconf); | ||
125 | + param.complete(errconf); | ||
126 | + return false; | ||
127 | + } | ||
128 | + return true; | ||
129 | + }, | ||
130 | + | ||
131 | + /** | ||
132 | + * 构造错误数据结构 | ||
133 | + * @param {Number} errCode 错误码 | ||
134 | + * @param {Number} errMsg 错误描述 | ||
135 | + */ | ||
136 | + buildErrorConfig(errCode, errMsg) { | ||
137 | + return { | ||
138 | + status: errCode, | ||
139 | + message: errMsg | ||
140 | + }; | ||
141 | + }, | ||
142 | + | ||
143 | + /** | ||
144 | + * 构造微信请求参数,公共属性处理 | ||
145 | + * | ||
146 | + * @param {Object} param 接口参数 | ||
147 | + * @param {Object} param 配置项 | ||
148 | + */ | ||
149 | + buildWxRequestConfig(param, options) { | ||
150 | + var that = this; | ||
151 | + options.header = { "content-type": "application/json" }; | ||
152 | + options.method = 'GET'; | ||
153 | + options.success = function (res) { | ||
154 | + var data = res.data; | ||
155 | + if (data.status === 0) { | ||
156 | + param.success(data); | ||
157 | + } else { | ||
158 | + param.fail(data); | ||
159 | + } | ||
160 | + }; | ||
161 | + options.fail = function (res) { | ||
162 | + res.statusCode = ERROR_CONF.WX_ERR_CODE; | ||
163 | + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, result.errMsg)); | ||
164 | + }; | ||
165 | + options.complete = function (res) { | ||
166 | + var statusCode = +res.statusCode; | ||
167 | + switch(statusCode) { | ||
168 | + case ERROR_CONF.WX_ERR_CODE: { | ||
169 | + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); | ||
170 | + break; | ||
171 | + } | ||
172 | + case ERROR_CONF.WX_OK_CODE: { | ||
173 | + var data = res.data; | ||
174 | + if (data.status === 0) { | ||
175 | + param.complete(data); | ||
176 | + } else { | ||
177 | + param.complete(that.buildErrorConfig(data.status, data.message)); | ||
178 | + } | ||
179 | + break; | ||
180 | + } | ||
181 | + default:{ | ||
182 | + param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)); | ||
183 | + } | ||
184 | + | ||
185 | + } | ||
186 | + } | ||
187 | + return options; | ||
188 | + }, | ||
189 | + | ||
190 | + /** | ||
191 | + * 处理用户参数是否传入坐标进行不同的处理 | ||
192 | + */ | ||
193 | + locationProcess(param, locationsuccess, locationfail, locationcomplete) { | ||
194 | + var that = this; | ||
195 | + locationfail = locationfail || function (res) { | ||
196 | + res.statusCode = ERROR_CONF.WX_ERR_CODE; | ||
197 | + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); | ||
198 | + }; | ||
199 | + locationcomplete = locationcomplete || function (res) { | ||
200 | + if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { | ||
201 | + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); | ||
202 | + } | ||
203 | + }; | ||
204 | + if (!param.location) { | ||
205 | + that.getWXLocation(locationsuccess, locationfail, locationcomplete); | ||
206 | + } else if (that.checkLocation(param)) { | ||
207 | + var location = Utils.getLocationParam(param.location); | ||
208 | + locationsuccess(location); | ||
209 | + } | ||
210 | + } | ||
211 | +} | ||
212 | + | ||
213 | + | ||
214 | +class QQMapWX { | ||
215 | + | ||
216 | + /** | ||
217 | + * 构造函数 | ||
218 | + * | ||
219 | + * @param {Object} options 接口参数,key 为必选参数 | ||
220 | + */ | ||
221 | + constructor(options) { | ||
222 | + if (!options.key) { | ||
223 | + throw Error('key值不能为空'); | ||
224 | + } | ||
225 | + this.key = options.key; | ||
226 | + } | ||
227 | + | ||
228 | + /** | ||
229 | + * POI周边检索 | ||
230 | + * | ||
231 | + * @param {Object} options 接口参数对象 | ||
232 | + * | ||
233 | + * 参数对象结构可以参考 | ||
234 | + * @see http://lbs.qq.com/webservice_v1/guide-search.html | ||
235 | + */ | ||
236 | + search(options) { | ||
237 | + var that = this; | ||
238 | + options = options || {}; | ||
239 | + | ||
240 | + Utils.polyfillParam(options); | ||
241 | + | ||
242 | + if (!Utils.checkKeyword(options)) { | ||
243 | + return; | ||
244 | + } | ||
245 | + | ||
246 | + var requestParam = { | ||
247 | + keyword: options.keyword, | ||
248 | + orderby: options.orderby || '_distance', | ||
249 | + page_size: options.page_size || 10, | ||
250 | + page_index: options.page_index || 1, | ||
251 | + output: 'json', | ||
252 | + key: that.key | ||
253 | + }; | ||
254 | + | ||
255 | + if (options.address_format) { | ||
256 | + requestParam.address_format = options.address_format; | ||
257 | + } | ||
258 | + | ||
259 | + if (options.filter) { | ||
260 | + requestParam.filter = options.filter; | ||
261 | + } | ||
262 | + | ||
263 | + var distance = options.distance || "1000"; | ||
264 | + var auto_extend = options.auto_extend || 1; | ||
265 | + | ||
266 | + var locationsuccess = function (result) { | ||
267 | + requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend +")"; | ||
268 | + wx.request(Utils.buildWxRequestConfig(options, { | ||
269 | + url: URL_SEARCH, | ||
270 | + data: requestParam | ||
271 | + })); | ||
272 | + } | ||
273 | + Utils.locationProcess(options, locationsuccess); | ||
274 | + } | ||
275 | + | ||
276 | + /** | ||
277 | + * sug模糊检索 | ||
278 | + * | ||
279 | + * @param {Object} options 接口参数对象 | ||
280 | + * | ||
281 | + * 参数对象结构可以参考 | ||
282 | + * http://lbs.qq.com/webservice_v1/guide-suggestion.html | ||
283 | + */ | ||
284 | + getSuggestion(options) { | ||
285 | + var that = this; | ||
286 | + options = options || {}; | ||
287 | + Utils.polyfillParam(options); | ||
288 | + | ||
289 | + if (!Utils.checkKeyword(options)) { | ||
290 | + return; | ||
291 | + } | ||
292 | + | ||
293 | + var requestParam = { | ||
294 | + keyword: options.keyword, | ||
295 | + region: options.region || '全国', | ||
296 | + region_fix: options.region_fix || 0, | ||
297 | + policy: options.policy || 0, | ||
298 | + output: 'json', | ||
299 | + key: that.key | ||
300 | + }; | ||
301 | + wx.request(Utils.buildWxRequestConfig(options, { | ||
302 | + url: URL_SUGGESTION, | ||
303 | + data: requestParam | ||
304 | + })); | ||
305 | + } | ||
306 | + | ||
307 | + /** | ||
308 | + * 逆地址解析 | ||
309 | + * | ||
310 | + * @param {Object} options 接口参数对象 | ||
311 | + * | ||
312 | + * 请求参数结构可以参考 | ||
313 | + * http://lbs.qq.com/webservice_v1/guide-gcoder.html | ||
314 | + */ | ||
315 | + reverseGeocoder(options) { | ||
316 | + var that = this; | ||
317 | + options = options || {}; | ||
318 | + Utils.polyfillParam(options); | ||
319 | + var requestParam = { | ||
320 | + coord_type: options.coord_type || 5, | ||
321 | + get_poi: options.get_poi || 0, | ||
322 | + output: 'json', | ||
323 | + key: that.key | ||
324 | + }; | ||
325 | + if (options.poi_options) { | ||
326 | + requestParam.poi_options = options.poi_options | ||
327 | + } | ||
328 | + | ||
329 | + var locationsuccess = function (result) { | ||
330 | + requestParam.location = result.latitude + ',' + result.longitude; | ||
331 | + wx.request(Utils.buildWxRequestConfig(options, { | ||
332 | + url: URL_GET_GEOCODER, | ||
333 | + data: requestParam | ||
334 | + })); | ||
335 | + }; | ||
336 | + Utils.locationProcess(options, locationsuccess); | ||
337 | + } | ||
338 | + | ||
339 | + /** | ||
340 | + * 地址解析 | ||
341 | + * | ||
342 | + * @param {Object} options 接口参数对象 | ||
343 | + * | ||
344 | + * 请求参数结构可以参考 | ||
345 | + * http://lbs.qq.com/webservice_v1/guide-geocoder.html | ||
346 | + */ | ||
347 | + geocoder(options) { | ||
348 | + var that = this; | ||
349 | + options = options || {}; | ||
350 | + Utils.polyfillParam(options); | ||
351 | + | ||
352 | + if (Utils.checkParamKeyEmpty(options, 'address')) { | ||
353 | + return; | ||
354 | + } | ||
355 | + | ||
356 | + var requestParam = { | ||
357 | + address: options.address, | ||
358 | + output: 'json', | ||
359 | + key: that.key | ||
360 | + }; | ||
361 | + | ||
362 | + wx.request(Utils.buildWxRequestConfig(options, { | ||
363 | + url: URL_GET_GEOCODER, | ||
364 | + data: requestParam | ||
365 | + })); | ||
366 | + } | ||
367 | + | ||
368 | + | ||
369 | + /** | ||
370 | + * 获取城市列表 | ||
371 | + * | ||
372 | + * @param {Object} options 接口参数对象 | ||
373 | + * | ||
374 | + * 请求参数结构可以参考 | ||
375 | + * http://lbs.qq.com/webservice_v1/guide-region.html | ||
376 | + */ | ||
377 | + getCityList(options) { | ||
378 | + var that = this; | ||
379 | + options = options || {}; | ||
380 | + Utils.polyfillParam(options); | ||
381 | + var requestParam = { | ||
382 | + output: 'json', | ||
383 | + key: that.key | ||
384 | + }; | ||
385 | + | ||
386 | + wx.request(Utils.buildWxRequestConfig(options, { | ||
387 | + url: URL_CITY_LIST, | ||
388 | + data: requestParam | ||
389 | + })); | ||
390 | + } | ||
391 | + | ||
392 | + /** | ||
393 | + * 获取对应城市ID的区县列表 | ||
394 | + * | ||
395 | + * @param {Object} options 接口参数对象 | ||
396 | + * | ||
397 | + * 请求参数结构可以参考 | ||
398 | + * http://lbs.qq.com/webservice_v1/guide-region.html | ||
399 | + */ | ||
400 | + getDistrictByCityId(options) { | ||
401 | + var that = this; | ||
402 | + options = options || {}; | ||
403 | + Utils.polyfillParam(options); | ||
404 | + | ||
405 | + if (Utils.checkParamKeyEmpty(options, 'id')) { | ||
406 | + return; | ||
407 | + } | ||
408 | + | ||
409 | + var requestParam = { | ||
410 | + id: options.id || '', | ||
411 | + output: 'json', | ||
412 | + key: that.key | ||
413 | + }; | ||
414 | + | ||
415 | + wx.request(Utils.buildWxRequestConfig(options, { | ||
416 | + url: URL_AREA_LIST, | ||
417 | + data: requestParam | ||
418 | + })); | ||
419 | + } | ||
420 | + | ||
421 | + /** | ||
422 | + * 用于单起点到多终点的路线距离(非直线距离)计算: | ||
423 | + * 支持两种距离计算方式:步行和驾车。 | ||
424 | + * 起点到终点最大限制直线距离10公里。 | ||
425 | + * | ||
426 | + * @param {Object} options 接口参数对象 | ||
427 | + * | ||
428 | + * 请求参数结构可以参考 | ||
429 | + * http://lbs.qq.com/webservice_v1/guide-distance.html | ||
430 | + */ | ||
431 | + calculateDistance(options) { | ||
432 | + var that = this; | ||
433 | + options = options || {}; | ||
434 | + Utils.polyfillParam(options); | ||
435 | + | ||
436 | + if (Utils.checkParamKeyEmpty(options, 'to')) { | ||
437 | + return; | ||
438 | + } | ||
439 | + | ||
440 | + var requestParam = { | ||
441 | + mode: options.mode || 'walking', | ||
442 | + to: Utils.location2query(options.to), | ||
443 | + output: 'json', | ||
444 | + key: that.key | ||
445 | + }; | ||
446 | + | ||
447 | + var locationsuccess = function (result) { | ||
448 | + requestParam.from = result.latitude + ',' + result.longitude; | ||
449 | + wx.request(Utils.buildWxRequestConfig(options, { | ||
450 | + url: URL_DISTANCE, | ||
451 | + data: requestParam | ||
452 | + })); | ||
453 | + } | ||
454 | + if (options.from) { | ||
455 | + options.location = options.from; | ||
456 | + } | ||
457 | + | ||
458 | + Utils.locationProcess(options, locationsuccess); | ||
459 | + } | ||
460 | +} | ||
461 | + | ||
462 | +module.exports = QQMapWX; |
utils/util.js
0 → 100644
1 | +const config = require('../config.js'); | ||
2 | +const app = getApp(); | ||
3 | + | ||
4 | +function POST(url, params, boo) { | ||
5 | + if (arguments.length == 3) { | ||
6 | + wx.showLoading({ | ||
7 | + title: '加载中...', | ||
8 | + mask: true | ||
9 | + }); | ||
10 | + } | ||
11 | + let promise = new Promise(function (resolve, reject) { | ||
12 | + wx.request({ | ||
13 | + url: `${config.host}${url}`, | ||
14 | + header: { | ||
15 | + 'content-type': 'application/x-www-form-urlencoded' | ||
16 | + }, | ||
17 | + data: params, | ||
18 | + method: 'POST', | ||
19 | + success: function (res) { | ||
20 | + if (arguments.length == 3) { | ||
21 | + wx.hideLoading(); | ||
22 | + } | ||
23 | + if (res.data.code === 1) { | ||
24 | + resolve(res.data); | ||
25 | + } else { | ||
26 | + reject(res.data); | ||
27 | + } | ||
28 | + }, | ||
29 | + fail: function (err) { | ||
30 | + if (arguments.length == 3) { | ||
31 | + wx.hideLoading(); | ||
32 | + } | ||
33 | + wx.showToast({ | ||
34 | + title: err.errMsg, | ||
35 | + icon: 'none', | ||
36 | + duration: 2000 | ||
37 | + }); | ||
38 | + } | ||
39 | + }); | ||
40 | + }); | ||
41 | + return promise | ||
42 | +} | ||
43 | + | ||
44 | +function GET(url, obj, boo) { | ||
45 | + if (arguments.length == 3) { | ||
46 | + wx.showLoading({ | ||
47 | + title: '加载中...', | ||
48 | + mask: true | ||
49 | + }); | ||
50 | + } | ||
51 | + let promise = new Promise(function (resolve, reject) { | ||
52 | + wx.request({ | ||
53 | + url: `${config.host}${url}`, | ||
54 | + header: { | ||
55 | + 'content-type': 'application/x-www-form-urlencoded', | ||
56 | + "xx-token": wx.getStorageSync("token") ? wx.getStorageSync("token") : "" | ||
57 | + }, | ||
58 | + method: 'GET', | ||
59 | + data: obj, | ||
60 | + success: function (res) { | ||
61 | + if (arguments.length == 3) { | ||
62 | + wx.hideLoading(); | ||
63 | + } | ||
64 | + if (res.data.code === 1) { | ||
65 | + resolve(res.data); | ||
66 | + } else { | ||
67 | + reject(res.data); | ||
68 | + } | ||
69 | + }, | ||
70 | + fail: function (err) { | ||
71 | + if (arguments.length == 3) { | ||
72 | + wx.hideLoading(); | ||
73 | + } | ||
74 | + wx.showToast({ | ||
75 | + title: err.errMsg, | ||
76 | + icon: 'none', | ||
77 | + duration: 2000 | ||
78 | + }); | ||
79 | + } | ||
80 | + }) | ||
81 | + }); | ||
82 | + return promise | ||
83 | +} | ||
84 | + | ||
85 | +function showToast(msg, fn) { | ||
86 | + let args = arguments.length; | ||
87 | + wx.showToast({ | ||
88 | + title: msg, | ||
89 | + icon: "none", | ||
90 | + duration: 1500, | ||
91 | + mask: true, | ||
92 | + success: function () { | ||
93 | + if (args == 2) { | ||
94 | + setTimeout(function () { | ||
95 | + fn(); | ||
96 | + }, 1500) | ||
97 | + } | ||
98 | + } | ||
99 | + }) | ||
100 | +} | ||
101 | +//显示提示框 | ||
102 | +function showmodel(text) { | ||
103 | + wx.showModal({ | ||
104 | + title: '提示', | ||
105 | + content: text, | ||
106 | + showCancel: false | ||
107 | + }) | ||
108 | +} | ||
109 | +//将秒数变成想要的日期格式 | ||
110 | +function format(time, format) { | ||
111 | + var t = new Date(time); | ||
112 | + var tf = function (i) { | ||
113 | + return (i < 10 ? '0' : '') + i | ||
114 | + }; | ||
115 | + return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) { | ||
116 | + switch (a) { | ||
117 | + case 'yyyy': | ||
118 | + return tf(t.getFullYear()); | ||
119 | + break; | ||
120 | + case 'MM': | ||
121 | + return tf(t.getMonth() + 1); | ||
122 | + break; | ||
123 | + case 'mm': | ||
124 | + return tf(t.getMinutes()); | ||
125 | + break; | ||
126 | + case 'dd': | ||
127 | + return tf(t.getDate()); | ||
128 | + break; | ||
129 | + case 'HH': | ||
130 | + return tf(t.getHours()); | ||
131 | + break; | ||
132 | + case 'ss': | ||
133 | + return tf(t.getSeconds()); | ||
134 | + break; | ||
135 | + } | ||
136 | + }) | ||
137 | +} | ||
138 | + | ||
139 | +function ChooseImage(num) { | ||
140 | + var promise = new Promise(function (resolve, reject) { | ||
141 | + wx.chooseImage({ | ||
142 | + count: num, | ||
143 | + success: function (res) { | ||
144 | + resolve(res.tempFilePaths); | ||
145 | + }, | ||
146 | + }) | ||
147 | + }); | ||
148 | + return promise; | ||
149 | +} | ||
150 | + | ||
151 | +function upload(num, fn) { | ||
152 | + ChooseImage(num).then(res => { | ||
153 | + wx.showLoading({ | ||
154 | + title: '', | ||
155 | + }); | ||
156 | + if (res.length != 0) { | ||
157 | + let promiseList = []; | ||
158 | + for (let value of res) { | ||
159 | + let promise = new Promise((resolve, reject) => { | ||
160 | + wx.uploadFile({ | ||
161 | + url: `${config.host}common/upWxappPic`, | ||
162 | + filePath: value, | ||
163 | + name: 'file', | ||
164 | + success: function (res) { | ||
165 | + var data = JSON.parse(res.data); | ||
166 | + if (data.code == 1) { | ||
167 | + resolve(data.data); | ||
168 | + } | ||
169 | + }, | ||
170 | + fail: function (err) { | ||
171 | + wx.hideLoading(); | ||
172 | + console.log(err); | ||
173 | + } | ||
174 | + }); | ||
175 | + }); | ||
176 | + promiseList.push(promise); | ||
177 | + } | ||
178 | + Promise.all(promiseList).then(res => { | ||
179 | + fn(res); | ||
180 | + }) | ||
181 | + } | ||
182 | + }); | ||
183 | +} | ||
184 | +//预览图片 | ||
185 | +function previewImage(one, urls) { | ||
186 | + wx.previewImage({ | ||
187 | + current: one, | ||
188 | + urls: urls, | ||
189 | + }); | ||
190 | +} | ||
191 | +module.exports = { | ||
192 | + post: POST, | ||
193 | + get: GET, | ||
194 | + ChooseImage: ChooseImage, | ||
195 | + showmodel: showmodel, | ||
196 | + upload: upload, | ||
197 | + format: format, | ||
198 | + showToast: showToast, | ||
199 | + previewImage: previewImage | ||
200 | +} |
-
请 注册 或 登录 后发表评论