作者 Lijianheng

更新

... ... @@ -6,35 +6,167 @@ App({
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
//自动更新版本
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
})
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
wx.getUserInfo({
success: res => {
// 可以将 res 发送给后台解码出 unionId
this.globalData.userInfo = res.userInfo
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况
if (this.userInfoReadyCallback) {
this.userInfoReadyCallback(res)
}
}
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '更新提示',
content: '新版本下载失败',
showCancel: false
})
})
},
post: function (url, data, headerParams, showLoad) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data;
let baseUrl = 'http://elite.w.bronet.cn/api/';
//网络请求
let header = {
'content-type': 'application/x-www-form-urlencoded'
}
header = Object.assign(header, headerParams)
//网络请求
wx.request({
url: baseUrl + url,
data: postData,
method: 'POST',
header: header,
success: function (res) { //返回取得的数据
if (res.data.code == '20000') {
resolve(res.data);
} else if (res.data.code == '201') {
resolve(res.data);
}
// else if (res.data.code == '10001') {
// wx.showToast({
// title: res.data.msg,
// icon: 'none',
// duration: 1000,
// success: function (res) {
// let t = setInterval(function () {
// clearInterval(t)
// wx.navigateTo({
// url: '/pages/index/index',
// })
// }, 1000)
// }
// })
// }
else {
wx.showModal({
title: '提示',
content: res.data.msg,
showCancel: false
})
reject(res.data)
}
setTimeout(function () {
// if (show||show==undefined){
// wx.hideLoading()
// }
wx.hideNavigationBarLoading()
}, 600)
},
fail: function (e) {
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
}
})
});
return promise;
},
// pay(res, successData) {
// wx.requestPayment({
// "timeStamp": res.pay.timeStamp,
// "nonceStr": res.pay.nonceStr,
// "package": res.pay.package,
// "signType": "MD5",
// "paySign": res.pay.paySign,
// "success": function (res) {
// wx.showToast({
// title: '支付完成',
// icon: "success",
// duration: 1500,
// success: function (data) {
// successData(data)
// }
// })
// },
// "fail": function (res) {
// wx.showToast({
// title: '取消支付成功!',
// icon: "icon",
// duration: 1500,
// })
// }
// })
// },
// nowDate() {
// let date = new Date();
// let month = date.getMonth() + 1;
// let day = date.getDate();
// return date.getFullYear() + '-' + (month > 9 ? month : ('0' + month)) + '-' + (day > 9 ? day : ('0' + day));
// },
// minDate() {
// let date = new Date();
// date.setDate(date.getDate() - 287);
// let m = date.getMonth() + 1;
// return date.getFullYear() + '-' + m + '-' + date.getDate();
// },
// timeFormate(timestamp, timeType) {
// var timeStamp = timestamp.length == 13 ? timestamp : timestamp * 1000
// var date = new Date(timeStamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
// var Y = date.getFullYear() + '-';
// var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
// var D = date.getDate() + ' ';
// var h = date.getHours() + ':';
// var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
// var s = date.getSeconds();
// if (timeType == 'YYMMDD') {
// return Y + M + D;
// } else {
// return h + m;
// }
// },
// 接口管理
interface: {
// historyDelete: '/home/index/historyDelete',//删除
// shopClass: '/home/index/shopClass',//分类
// shopPage: '/home/index/shopPage',//分页
// history: '/home/index/history',//检索
// index: '/home/index/index', //首页
// login: '/wxapp/public/login', //小程序登录注册
getSessionKey: '/wxapp/public/getSessionKey', //获取sessionKey和openid
},
//全局变量
globalData: {
userInfo: null,
baseUrl: '../../img/'
cid: null,
class_id: null
}
})
\ No newline at end of file
... ...
{
"pages":[
"pages/personalData/personalData",
"pages/openIndex/openIndex",
"pages/publish/publish",
"pages/positionDetails/positionDetails",
"pages/goodWord/goodWord",
"pages/personalData/personalData",
"pages/easyPart/easyPart",
"pages/hotRecommend/hotRecommend",
... ... @@ -27,6 +29,7 @@
"pages/index/search_4/search_4",
"pages/index/search_2/search_2",
"pages/index/search_3/search_3",
"pages/index/url/url",
"pages/index/index",
"pages/mine/mine"
... ... @@ -62,5 +65,13 @@
"selectedIconPath": "img/nav_05@2x.png"
}
]
},
"permission":
{
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
}
}
\ No newline at end of file
... ...
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
industry: '',
categories_id: '',
},
/**
* 生命周期函数--监听页面加载
*/
regSuccess() {
wx.navigateTo({
url: '/pages/regSuccess/regSuccess',
})
},
toPosition(){
wx.navigateTo({
url: '/pages/positionDetails/positionDetails',
})
},
// 跳转招聘者信息
toRecruiter() {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
onLoad: function (options) {
console.log(options)
wx.setNavigationBarTitle({
title: options.categories_name //页面切换,更换页面标题
})
this.getIndustry()
},
// 岗位功能
getIndustry() {
let that = this;
let url = 'index/category/industry';
let params = {
categories_id : that.data.categories_id,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
// console.log(res.data)
// 获取值
that.setData({
industry: res.data
})
// console.log(that.data.industry)
}).catch((err) => {
})
},
// 获取多个工作
getJods() {
let that = this;
let url = 'index/job/jobs';
let params = {
categories_id: that.data.categories_id,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
// console.log(res.data)
// 获取值
that.setData({
industry: res.data
})
// console.log(that.data.industry)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
... ...
{
"navigationBarTitleText": "在家可做"
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<!-- 条目 -->
<view class='items'>
<view class='item'>
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -21,7 +21,7 @@
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
... ... @@ -37,78 +37,10 @@
</view>
</view>
</view>
<view class='item'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='/img/aicon_08@2x.png'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top'>酒店服务员</view>
<view class='text_bottom'>4000-5000元/月</view>
</view>
</view>
<view class='item_top_right' bindtap='regSuccess'>
报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>王思迪</view>
</view>
<view class='item_bottom_right'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>南开区 3.2km</view>
</view>
</view>
</view>
<view class='item'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='/img/aicon_08@2x.png'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top'>酒店服务员</view>
<view class='text_bottom'>4000-5000元/月</view>
</view>
</view>
<view class='item_top_right' bindtap='regSuccess'>
报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>王思迪</view>
</view>
<view class='item_bottom_right'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>南开区 3.2km</view>
</view>
</view>
</view>
<view class='item'>
<!-- 头部 -->
<!-- <view class='item' bindtap='toPosition'>
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
... ... @@ -124,13 +56,13 @@
报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>王思迪</view>
</view>
... ... @@ -141,7 +73,8 @@
<view>南开区 3.2km</view>
</view>
</view>
</view>
</view> -->
</view>
... ...
... ... @@ -16,6 +16,18 @@ Page({
url: '/pages/regSuccess/regSuccess',
})
},
toPosition() {
wx.navigateTo({
url: '/pages/positionDetails/positionDetails',
})
},
// 跳转招聘者信息
toRecruiter() {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
onLoad: function (options) {
},
... ...
... ... @@ -4,7 +4,7 @@
<!-- 条目 -->
<view class='items'>
<view class='item'>
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -23,7 +23,7 @@
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
... ...
... ... @@ -11,6 +11,18 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
// 跳转岗位信息
toPosition() {
wx.navigateTo({
url: '/pages/positionDetails/positionDetails',
})
},
// 跳转招聘者信息
toRecruiter() {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
onLoad: function (options) {
},
... ...
... ... @@ -33,7 +33,7 @@
相关岗位
</view>
<view class='item'>
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -52,7 +52,7 @@
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
... ... @@ -60,7 +60,7 @@
<view>王思迪</view>
</view>
<view class='item_bottom_right'>
<view class='item_bottom_right' >
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
... ... @@ -69,7 +69,7 @@
</view>
</view>
<view class='item'>
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -88,7 +88,7 @@
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
... ...
// pages/goodWord/goodWord.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
... ... @@ -18,56 +17,67 @@ Page({
})
},
toPosition() {
wx.navigateTo({
url: '/pages/positionDetails/positionDetails',
})
},
// 跳转招聘者信息
toRecruiter() {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@
<!-- 条目 -->
<view class='items'>
<view class='item'>
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -23,112 +23,7 @@
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>王思迪</view>
</view>
<view class='item_bottom_right'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>南开区 3.2km</view>
</view>
</view>
</view>
<view class='item'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='/img/aicon_08@2x.png'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top'>酒店服务员</view>
<view class='text_bottom'>4000-5000元/月</view>
</view>
</view>
<view class='item_top_right' bindtap='regSuccess'>
报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>王思迪</view>
</view>
<view class='item_bottom_right'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>南开区 3.2km</view>
</view>
</view>
</view>
<view class='item'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='/img/aicon_08@2x.png'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top'>酒店服务员</view>
<view class='text_bottom'>4000-5000元/月</view>
</view>
</view>
<view class='item_top_right' bindtap='regSuccess'>
报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>王思迪</view>
</view>
<view class='item_bottom_right'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>南开区 3.2km</view>
</view>
</view>
</view>
<view class='item'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='/img/aicon_08@2x.png'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top'>酒店服务员</view>
<view class='text_bottom'>4000-5000元/月</view>
</view>
</view>
<view class='item_top_right' bindtap='regSuccess'>
报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
... ... @@ -146,6 +41,7 @@
</view>
</view>
<!-- 提示 -->
... ...
// pages/index/index.js
const app = getApp();
var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
var qqmapsdk;
Page({
/**
* 页面的初始数据
*/
data: {
category: '',
slide: '',
industry_id: '',
city: '',
// 数据筛选
city_1: '',
industry_1: '',
station_1: '',
education_1: '',
salary_1: '',
categories_id:'',
district:'',
// 获取经纬度
latitude: '',
longitude: '',
imgUrls: [{
url: '/img/aicon_07@2x.png'
},
... ... @@ -22,7 +45,7 @@ Page({
currentSwiper: 0,
indicatorColor: "rgba(255,255,255,0.5)", //指示点颜色
indicatorActiveColor: "rgba(255,255,255,1)", //当前选中的指示点颜色
// 导航选择
navbar: [{
name: '地区'
},
... ... @@ -108,8 +131,6 @@ Page({
{
sort: '最新发布'
},
],
sortTab: 0,
// 筛选(学历)
... ... @@ -141,7 +162,6 @@ Page({
screen: '博士'
},
],
screenTab: 0,
// 筛选(酬薪范围)
... ... @@ -164,8 +184,6 @@ Page({
],
scopeTab: 0,
// 设置隐藏显示功能
mask: false,
... ... @@ -175,6 +193,7 @@ Page({
]
},
// 点击展示筛选mask
mask_show() {
this.setData({
... ... @@ -187,19 +206,44 @@ Page({
mask: false
})
},
// 跳转岗位信息
toPosition(){
wx.navigateTo({
url: '/pages/positionDetails/positionDetails',
})
},
// 跳转招聘者信息
toRecruiter() {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
qqmapsdk = new QQMapWX({
key: 'CUYBZ-AN7A5-TFMIS-QBFH2-3KZQT-PYBQG'
});
this.getCategories()
this.getSlide()
this.selectIndustry()
// this.selectStation()
this.selectEducation()
this.selectSalary()
// this.selectArea()
},
// 在家可做
atHome(){
atHome(e){
console.log(e)
let that = this;
let categories_name = e.currentTarget.dataset.cla
console.log(categories_name)
wx.navigateTo({
url: '/pages/atHome/atHome',
url: '/pages/atHome/atHome?categories_name='+categories_name,
})
},
// 好评工作
goodWord(){
... ... @@ -219,12 +263,16 @@ Page({
url: '/pages/easyPart/easyPart',
})
},
navbarTap: function(e) {
console.log(88)
let that = this;
this.setData({
currentTab: e.currentTarget.dataset.idx,
})
that.selectStation()
},
// 地区选择
area_Tap: function(e) {
... ... @@ -242,7 +290,7 @@ Page({
jobTab: e.currentTarget.dataset.idjob,
})
},
// 岗位选择(小类别)
// 行业选择
pro_Tap: function (e) {
console.log(88)
let that = this;
... ... @@ -295,8 +343,343 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
let vm = this;
vm.getUserLocation();
},
//----筛选地区数据功能---- 给后端传city
selectArea() {
let that = this;
let url = 'index/category/county';
// 通过parmas传值给后端
let params = {
city: that.data.city,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
that.setData({
city_1 : res.data
})
}).catch((err) => {
})
},
//----筛选行业分类功能---- 给后端传categories_id
selectIndustry() {
let that = this;
let url = 'index/category/industry';
console.log(url)
// 通过parmas传值给后端
let params = {
categories_id: that.data.categories_id,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
that.setData({
industry_1: res.data
})
}).catch((err) => {
// that.selectStation()
})
},
//----筛选岗位分类功能---- 给后端传industry_id
selectStation() {
let that = this;
let url = 'index/category/station';
console.log(url)
// 通过parmas传值给后端
let params = {
industry_id: that.data.industry_id,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
that.setData({
station_1: res.data
})
}).catch((err) => {
})
},
//-------学历要求-------
selectEducation() {
let that = this;
let url = 'index/category/education';
// 通过parmas传值给后端
let params = {
// city: that.data.city,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
that.setData({
// city_1: res.data
education_1:res.data
})
}).catch((err) => {
})
},
//-------酬薪范围-------
selectSalary() {
let that = this;
let url = 'index/category/salary';
// 通过parmas传值给后端
let params = {
// city: that.data.city,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
that.setData({
salary_1: res.data
})
}).catch((err) => {
})
},
// -----用户获得经纬度-----
getUserLocation(){
let vm = this;
wx.getSetting({
success:(res) => {
console.log(JSON.stringify(res))
if(res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true){
wx.showModal({
title: '请授权当前位置',
content: '需要获取您的地址位置,请确认授权',
success(res){
if(res.cancel){
wx.showToast({
title: '拒绝授权',
icon: 'none',
duration: 1000
})
}else if(res.confirm){
wx.openSetting({
success: function(dataAu){
if(dataAu.authSetting["scope.userLocation"]==true){
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 1000
})
// 再次授权,调用wx.getLocation的API
vm.getLocation();
}else{
wx.showToast({
title: '授权失败',
icon: 'none',
duration: 1000
})
}
}
})
}
}
})
}else if(res.authSetting['scope.userLocation'] == undefined){
// 调用wx.getLocation的API
vm.getLocation();
}else{
// 调用wx.getLocation的API
vm.getLocation();
}
}
})
},
// -----微信获得经纬度-----
getLocation(){
let vm = this;
// console.log(vm)
wx.getLocation({
type: 'wgs84',
// altitude: true,
success: function(res) {
console.log(JSON.stringify(res))
var latitude = res.latitude
var longitude = res.longitude
var speed = res.speed
var accuracy = res.accuracy;
vm.getLocal(latitude,longitude)
},
fail: function(res) {
console.log('fail'+JSON.stringify(res))
},
// complete: function(res) {},
})
},
// -----获取当前地理位置-----
getLocal(latitude,longitude){
let vm = this;
qqmapsdk.reverseGeocoder({
location: {
latitude: latitude,
longitude: longitude
},
success(res){
console.log(res)
// let province = res.result.ad_info.province
let city = res.result.ad_info.city;
console.log(city)
let district = res.result.ad_info.district
console.log('定位的市:'+city,'定位的区:'+district)
vm.setData({
// 转换地区
city: city,
district:district,
latitude: latitude,
longitude: longitude
})
vm.selectArea()
},
fail: function(res){
console.log(res);
},
complete:function(res){
}
})
},
// 存储当前用户所在城市
addLocal() {
let that = this;
let url = 'wxapp/public/location';
// 通过parmas传值给后端
let params = {
city : that.data.city,
county: that.data.county,
longitude: that.data.longitude,
latitude: that.data.latitude
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log('++++++++++++++')
console.log(res);
}).catch((err) => {
})
},
// 获取四大类
getCategories() {
let that = this;
let url = 'index/category/categories';
console.log(url)
let params = {
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
console.log(res.data)
// 获取值
that.setData({
category:res.data
})
console.log(that.data.category)
}).catch((err) => {
})
},
// 获取幻灯片
getSlide() {
let that = this;
let url = 'index/category/slide';
console.log(url)
let params = {
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
console.log(res.data)
// 获取值
that.setData({
slide: res.data
})
console.log(that.data.slide)
}).catch((err) => {
})
},
// 跳转Url
toUrl(e){
console.log(e)
let that = this;
let url = e.currentTarget.dataset.tourl;
console.log(url)
wx.navigateTo({
url: '/pages/index/url/url?url='+url,
})
},
/**
* 生命周期函数--监听页面隐藏
... ...
... ... @@ -4,7 +4,7 @@
<view class='top'>
<!-- 左边地区 -->
<view class='top_left'>
<view>天津</view>
<view class='top_left_text'>{{city}}</view>
<view class='top_left_img'>
<image src='/img/aicon_01@2x.png'></image>
</view>
... ... @@ -18,48 +18,62 @@
</view>
</view>
<!-- 中部选择 -->
<view class='mid'>
<view class='mid_list' bindtap='atHome'>
<view class='mid' >
<view class='mid_list' bindtap='atHome' data-cla='{{item.categories_name}}' wx:for='{{category}}' wx:key=''>
<!-- 图片 -->
<view class='mid_list_top'>
<image src='/img/aicon_03@2x.png'></image>
<image src='{{item.thumbnail}}'></image>
</view>
<!-- 底部文字 -->
<view class='mid_list_bottom'>
{{item.categories_name}}
</view>
</view>
<!-- <view class='mid_list' bindtap='atHome'>
<view class='mid_list_top'>
<image src='/img/aicon_03@2x.png'></image>
</view>
<view class='mid_list_bottom'>
在家可做
</view>
</view>
<view class='mid_list' bindtap='goodWord'>
<!-- 图片 -->
<view class='mid_list_top'>
<image src='/img/aicon_05@2x.png'></image>
</view>
<!-- 底部文字 -->
<view class='mid_list_bottom'>
好评推荐
好评工作
</view>
</view>
<view class='mid_list' bindtap='hotRecommend'>
<!-- 图片 -->
<view class='mid_list_top'>
<image src='/img/aicon_04@2x.png'></image>
</view>
<!-- 底部文字 -->
<view class='mid_list_bottom'>
热门推荐
</view>
</view>
<view class='mid_list' bindtap='easyPart'>
<!-- 图片 -->
<view class='mid_list_top'>
<image src='/img/aicon_06@2x.png'></image>
</view>
<!-- 底部文字 -->
<view class='mid_list_bottom'>
轻松兼职
</view>
</view>
</view> -->
</view>
<!-- 轮播图 -->
<!-- <view class='banner'>
<image src='/img/aicon_07@2x.png'></image>
... ... @@ -67,9 +81,9 @@
<swiper class='banner' indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-color="{{indicatorColor}}" indicator-active-color="{{indicatorActiveColor}}" bindchange="swiperChange">
<block wx:for="{{imgUrls}}" wx:key=''>
<block wx:for="{{slide}}" wx:key='' >
<swiper-item>
<image src="{{item.url}}" class="slide-image" />
<image src="{{item.image}}" class="slide-image" data-tourl="{{item.url}}" bindtap='toUrl' />
</swiper-item>
<!-- <view class="dot{{index == currentSwiper ? ' active' : ''}}"></view> -->
... ... @@ -113,7 +127,7 @@
</view>
<!-- 条目 -->
<view class='items'>
<view class='item' >
<view class='item' bindtap='toPosition' >
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -132,7 +146,7 @@
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
... ... @@ -148,7 +162,7 @@
</view>
</view>
</view>
<view class='item' >
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -183,7 +197,7 @@
</view>
</view>
</view>
<view class='item' >
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -218,7 +232,7 @@
</view>
</view>
</view>
<view class='item' >
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -256,35 +270,9 @@
</view>
<!-- 筛选弹层 -->
<!------- 筛选弹层------->
<view class='mask' wx:if='{{mask}}'>
<!-- <view class='select mask_select {{currentTab==index?}}' wx:key='unique' data-categ bindtap='select_btn' wx:for="{{navbar}}" data-idx="{{index}}">
<view class='select_list'>
<view>地区</view>
<view class='select_list_pic'>
<image src='/img/aicon_11@2x.png'></image>
</view>
</view>
<view class='select_list'>
<view>岗位</view>
<view class='select_list_pic'>
<image src='/img/aicon_11@2x.png'></image>
</view>
</view>
<view class='select_list'>
<view>推荐排序</view>
<view class='select_list_pic'>
<image src='/img/aicon_11@2x.png'></image>
</view>
</view>
<view class='select_list'>
<view>筛选</view>
<view class='select_list_pic_big'>
<image src='/img/aicon_12@2x.png'></image>
</view>
</view>
</view> -->
<view class="select mask_select">
<view wx:for="{{navbar}}" data-idx="{{index}}" class="select_list {{currentTab==index ? 'active' : ''}}" wx:key="unique" bindtap="navbarTap" data-categoryid="{{item.id}}">{{item.name}}
... ... @@ -294,7 +282,7 @@
<!-- 地区内容 -->
<view class='area' wx:if="{{currentTab==0}}">
<view class="area_item">
<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}}
<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}}
</view>
</view>
... ... @@ -323,7 +311,7 @@
<!-- 岗位内容 -->
<view class='job' wx:if="{{currentTab==1}}">
<view class="job_left">
<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}}
<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}}
</view>
</view>
... ... @@ -393,7 +381,7 @@
<view class='screen_item'>
<view class='screen_item_top'> 学历要求
<view class="screen_item_bottom">
<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}}
<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}}
</view>
</view>
... ... @@ -420,7 +408,7 @@
<view class='screen_item'>
<view class='screen_item_top'> 酬薪范围
<view class="screen_item_bottom">
<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}}
<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}}
</view>
</view>
... ...
... ... @@ -11,17 +11,22 @@ page{
.top{
/* width: 100%; */
display: flex;
justify-content: space-between;
background: #fff;
padding: 24rpx 32rpx;
}
.top_left{
display: flex;
/* justify-content: space-between; */
align-items: center;
font-size:28rpx;
/* font-size:28rpx; */
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(26,26,26,1);
}
.top_left_text{
font-size: 26rpx;
}
.top_left_img{
margin-left: 14rpx;
width:18rpx;
... ... @@ -33,7 +38,7 @@ page{
height: 100%;
}
.top_right{
margin-left: 30rpx;
/* margin-left: 30rpx; */
display: flex;
align-items: center;
... ...
// pages/index/url/url.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<!--pages/index/url/url.wxml-->
<web-view src="{{url}}"></web-view>
... ...
/* pages/index/url/url.wxss */
\ No newline at end of file
... ...
// pages/mine/mine.js
const app = getApp()
Page({
/**
... ... @@ -6,7 +9,8 @@ Page({
*/
data: {
callPhone:false,
show_apply:false
show_apply:false,
personal:''
},
/**
... ... @@ -95,7 +99,34 @@ Page({
})
},
onLoad: function (options) {
this.getPersonal()
},
getPersonal() {
let that = this;
let url = 'index/user/me';
let params = {
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
// 获取值
that.setData({
personal: res.data
})
}).catch((err) => {
})
},
/**
... ...
{
"usingComponents": {},
"navigationBarTitleText": "完善个人资料"
"navigationBarTitleText": "个人中心"
}
\ No newline at end of file
... ...
... ... @@ -5,10 +5,11 @@
<view class='head_top'>
<view class='head_top_left'>
<view class='head_top_left_pic'>
<image src='../../img/aicon_49@2x.png'></image>
<!-- <image src='../../img/aicon_49@2x.png'></image> -->
<image src='{{personal.avatar}}'></image>
</view>
<view class='head_top_left_text'>
宇宙无敌小可爱
{{personal.user_nickname}}
</view>
</view>
... ... @@ -30,8 +31,8 @@
<view class='mid_content'>
<view class='mid_content_top'>可提现金额(元)</view>
<view class='mid_content_mid'>245</view>
<view class='mid_content_bottom'>已提现金额(元)<span class='fontSize'>130</span></view>
<view class='mid_content_mid'>{{personal.balance}}</view>
<view class='mid_content_bottom'>已提现金额(元)<span class='fontSize'>{{personal.deposit}}</span></view>
</view>
<!-- 提现 -->
<view class='mid_deposit' bindtap='open_apply'>
... ...
// pages/myResume2/myResume2.js
const app = getApp();
Page({
/**
... ... @@ -12,7 +13,35 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
that.getResume2()
},
getResume2() {
let that = this;
let url = 'index/user/me_resume';
let params = {
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
// 获取值
that.setData({
personal: res.data
})
}).catch((err) => {
})
},
/**
... ...
{
"usingComponents": {},
"navigationBarTitleText": "报名记录"
"navigationBarTitleText": "我的简历"
}
\ No newline at end of file
... ...
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
},
getOpenId() {
let that = this
wx.login({
success: (res) => {
let url = 'wxapp/public/getSessionKey'
let param = {
code: res.code,
}
app.post(url, param).then((res) => {
console.log(res)
that.setData({
openid: res.data.openid,
session_key: res.data.session_key
})
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo'] === true) {
wx.getUserInfo({
success: reg => {
that.setData({
encrypted_data: reg.encryptedData,
iv: reg.iv
})
that.login()
}
})
}
}
})
}).catch((errMsg) => {
})
}
});
},
// 获取用户权限信息
getUserInfo(e) {
console.log(e)
let that = this;
if (e.detail.errMsg == "getUserInfo:ok") {
that.setData({
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv
})
that.login()
}
},
// 登录
login() {
let that = this;
let url = "wxapp/public/login";
let data = {
openid: that.data.openid,
session_key: that.data.session_key,
encrypted_data: that.data.encrypted_data,
iv: that.data.iv,
}
app.post(url, data).then((res) => {
wx.setStorageSync("token", res.data.token);
wx.showLoading({
title: '正在进入',
})
let t = setInterval(function () {
clearInterval(t)
wx.switchTab({
url: '/pages/index/index',
})
wx.hideLoading()
}, 1500)
}).catch((err) => {
})
// }).catch((errMsg) => { })
},
// 111
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getOpenId();
},
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class='box'>
<view class='cover'>
<!-- <image src="../../img/zhuzhi@3x.png"></image> -->
<text>asdlkjhnaisd</text>
<view class='go'>
<button open-type='getUserInfo' bindgetuserinfo="getUserInfo">立即启动</button>
</view>
</view>
</view>
\ No newline at end of file
... ...
/**index.wxss**/
.cover{
position: relative;
height: 100vh;
overflow:hidden;
box-sizing: border-box;
padding-top: 200rpx;
}
.cover image{
display: block;
width:300rpx;
height:300rpx;
margin: 0 auto;
}
.cover text{
display: block;
width: 500rpx;
margin: 0 auto;
text-align: center;
}
.go{
position: absolute;
bottom:26.41%;
left:0;
right: 0;
margin: auto;
width:400rpx;
height:80rpx;
border-radius:40rpx;
background: rgba(255,102,0,1);
/* border:1rpx solid #434343; */
}
.go button{
font-size:30rpx;
color:#fff;
text-align: center;
line-height:80rpx;
border-radius:40rpx;
display: block;
background:none;
}
\ No newline at end of file
... ...
// pages/personalData/personalData.js
const app = getApp()
Page({
/**
... ... @@ -12,6 +14,101 @@ Page({
genderMale:1
},
// 获取Open ID
getOpenId() {
let that = this
wx.login({
success: (res) => {
let url = 'wxapp/public/getSessionKey'
let param = {
code: res.code,
}
app.post(url, param).then((res) => {
console.log(res)
that.setData({
openid: res.data.openid,
session_key: res.data.session_key
})
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo'] === true) {
wx.getUserInfo({
success: reg => {
that.setData({
encrypted_data: reg.encryptedData,
iv: reg.iv
})
// 获取完后自动执行login 然后跳转至设置的url
// that.login()
}
})
}
}
})
}).catch((errMsg) => {
})
}
});
},
// 获取用户权限信息
getUserInfo(e) {
let that = this;
if (e.detail.errMsg == "getUserInfo:ok") {
that.setData({
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv
})
that.login()
}
},
// 登录
login() {
let that = this;
let url = "wxapp/public/login";
let data = {
openid: that.data.openid,
session_key: that.data.session_key,
encrypted_data: that.data.encrypted_data,
iv: that.data.iv,
}
app.post(url, data).then((res) => {
wx.setStorageSync("token", res.data.token);
wx.showLoading({
title: '正在进入',
})
let t = setInterval(function () {
clearInterval(t)
wx.switchTab({
url: '../index/index',
})
wx.hideLoading()
}, 1500)
}).catch((err) => {
})
// }).catch((errMsg) => { })
},
/**
* 生命周期函数--监听页面加载
*/
... ... @@ -48,9 +145,11 @@ Page({
},
onLoad: function (options) {
this.getOpenId();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -4,10 +4,12 @@
<view class='top_left_t'>完善个人资料</view>
<view class='top_left_b'>增加更多面试机会</view>
</view>
<view class='top_right'>
<!-- <view class='top_right'>
跳过
</view> -->
<view class='top_right'>
<button open-type='getUserInfo' bindgetuserinfo="getUserInfo">跳过</button>
</view>
</view>
<view class='mid'>
... ...
... ... @@ -34,7 +34,7 @@ page{
color:rgba(102,102,102,1);
}
.top_right{
width:100rpx;
/* width:100rpx;
height:100rpx;
line-height: 100rpx;
text-align: center;
... ... @@ -44,7 +44,17 @@ page{
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(102,102,102,1);
color:rgba(102,102,102,1); */
}
.top_right button{
width:100rpx;
height:100rpx;
line-height: 100rpx;
border:1px solid rgba(207,207,207,1);
border-radius:50%;
background: transparent;
font-size: 26rpx;
padding: 0;
}
.mid{
... ...
... ... @@ -24,6 +24,12 @@ Page({
share:false
})
},
// 跳转招聘者信息
toRecruiter(){
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
onLoad: function (options) {
},
... ...
... ... @@ -30,7 +30,7 @@
<!-- 招聘者信息 -->
<view class='item'>
<view class='item_top'>招聘者信息</view>
<view class='item_infor'>
<view class='item_infor' bindtap='toRecruiter'>
<view class='item_infor_left'>
<image src='../../img/aicon_18@2x.png'></image>
</view>
... ...
// pages/publish/publish.js
var that;
Page({
/**
... ... @@ -7,69 +9,21 @@ Page({
data: {
array: ['在家可做', '好评工作', '热门推荐', '轻松兼职'],
status:false,
// objectArray: [
// {
// id: 0,
// name: '美国'
// },
// {
// id: 1,
// name: '中国'
// },
// {
// id: 2,
// name: '巴西'
// },
// {
// id: 3,
// name: '日本'
// }
// ],
jobIndex: 0,
industry: ['餐饮', '金融', '计算机'],
// objectArray: [
// {
// id: 0,
// name: '美国'
// },
// {
// id: 1,
// name: '中国'
// },
// {
// id: 2,
// name: '巴西'
// },
// {
// id: 3,
// name: '日本'
// }
// ],
industryIndex: 0,
post: ['厨师', '医生', '程序员'],
// objectArray: [
// {
// id: 0,
// name: '美国'
// },
// {
// id: 1,
// name: '中国'
// },
// {
// id: 2,
// name: '巴西'
// },
// {
// id: 3,
// name: '日本'
// }
// ],
postIndex: 0,
switch_content:false
switch_content:false,
images: [],
bannerImage: [],
},
// 岗位分类
jobClass: function (e) {
... ... @@ -115,9 +69,57 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
that = this;
},
// 选择图片
chooseImage: function () {
// 选择图片
wx.chooseImage({
count: 3, // 默认9
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
// 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
console.log(res)
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
var tempFilePaths = res.tempFilePaths;
that.setData({
images: that.data.images.concat(tempFilePaths)
});
}
})
},
// 图片预览
previewImage: function (e) {
//console.log(this.data.images);
var current = e.target.dataset.src
wx.previewImage({
current: current,
urls: this.data.images
})
},
// 图片删除功能
delete: function (e) {
var index = e.currentTarget.dataset.index;
var images = that.data.images;
images.splice(index, 1);
that.setData({
images: images
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -63,41 +63,60 @@
<!-- 企业logo -->
<view class='item logo'>
<view class='item_left'>企业logo</view>
<view class='item_right'>
<view class='item_right_logo'>
<image src='../../img/logo.png'></image>
<!-- 关闭图标 -->
<view class='close_logo'>
<!-- <view class='item_right'> </view> -->
<!-- logo图片 -->
<view class='pic_box'>
<view class="btn-file" wx:for="{{images}}" wx:key="">
<image src="{{item}}" data-src="{{item}}" bindtap="previewImage" mode="aspectFill" />
<!-- 删除按钮 -->
<view class="delete" bindtap="delete" data-index="{{index}}">
<image src='../../img/icon.png'></image>
</view>
</view>
<view class='item_right_icon'>
<!-- <image src='../../img/right.png'></image> -->
<view class='gallery_pic' bindtap='chooseImage'>
<image src='../../img/btn-file.png'></image>
</view>
</view>
</view>
<!-- banner -->
<view class='item banner'>
<view class='item_left'>banner</view>
<view class='item_right'>
<view class='item_right_banner'>
<image src='../../img/logo.png'></image>
<!-- 关闭图标 -->
<view class='close_logo'>
<!-- logo图片 -->
<view class='pic_banner '>
<view class="banner_small" wx:for="{{images}}" wx:key="">
<image src="{{item}}" data-src="{{item}}" bindtap="previewImage" mode="aspectFill" />
<!-- 删除按钮 -->
<view class="delete" bindtap="delete" data-index="{{index}}">
<image src='../../img/icon.png'></image>
</view>
</view>
<view class='item_right_icon'>
<!-- <image src='../../img/right.png'></image> -->
<view class='banner_pic' bindtap='chooseImage'>
<image src='../../img/btn-file.png'></image>
</view>
</view>
</view>
<!-- 输入工资 -->
<view class='item'>
<view class='item_left'>输入工资</view>
<view class='item_right salary'>
<!-- 酬薪范围与固定薪资切换 -->
<view class='item_right_top' >
<view class='item_right_top'>
<view class='item_right_top_left {{status==true?"color_y":""}}' bindtap='switch_a'>酬薪范围</view>
<view class='item_right_top_right {{status==false?"color_y":""}}' bindtap='switch_a'>固定薪资</view>
</view>
... ...
... ... @@ -360,4 +360,65 @@ page{
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,255,255,1);
}
.pic_box{
display: flex;
width: 450rpx;
}
.btn-file{
width:72rpx;
height:72rpx;
border-radius:2rpx;
position: relative;
}
.btn-file image{
width: 100%;
height: 100%;
}
.gallery_pic{
width:72rpx;
height:72rpx;
border-radius:2rpx;
}
.gallery_pic image{
width: 100%;
height: 100%;
}
.delete{
width:26rpx;
height:26rpx;
display:flex;
position:absolute;
right:-10rpx;
top:-8rpx;
}
.delete image{
width: 100%;
height: 100%;
}
.pic_banner{
display: flex;
width: 450rpx
}
.banner_pic{
width:250rpx;
height:120rpx;
display: flex;
}
.banner_pic image{
width: 100%;
height: 100%;
}
.banner_small{
width:250rpx;
height:120rpx;
display: flex;
position: relative;
}
.banner_small image{
width: 100%;
height: 100%;
}
\ No newline at end of file
... ...
... ... @@ -11,10 +11,23 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
toPosition() {
wx.navigateTo({
url: '/pages/positionDetails/positionDetails',
})
},
// 跳转招聘者信息
toRecruiter() {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -5,7 +5,7 @@
<view class='underline'></view>
<!-- 条目 -->
<view class='items'>
<view class='item'>
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
... ... @@ -24,42 +24,7 @@
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>王思迪</view>
</view>
<view class='item_bottom_right'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>南开区 3.2km</view>
</view>
</view>
</view>
<view class='item'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='/img/aicon_08@2x.png'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top'>酒店服务员</view>
<view class='text_bottom'>4000-5000元/月</view>
</view>
</view>
<view class='item_top_right'>
已报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
... ... @@ -76,6 +41,7 @@
</view>
</view>
</view>
... ...
... ... @@ -5,14 +5,41 @@ Page({
* 页面的初始数据
*/
data: {
registrationList:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
that.registration()
},
// 报名名单功能
registration() {
let that = this;
let url = 'index/user/boss_job_apply_record';
let params = {
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
// 获取值
that.setData({
personal: res.data
})
}).catch((err) => {
})
},
/**
... ...
... ... @@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
... ... @@ -37,7 +37,7 @@
"list": []
},
"miniprogram": {
"current": 0,
"current": 25,
"list": [
{
"id": 0,
... ... @@ -213,6 +213,12 @@
"pathName": "pages/hotRecommend/hotRecommend",
"query": "",
"scene": null
},
{
"id": -1,
"name": "启动页",
"pathName": "pages/openIndex/openIndex",
"scene": null
}
]
}
... ...
/**
* 微信小程序JavaScriptSDK
*
* @version 1.0
* @date 2017-01-10
* @author jaysonzhou@tencent.com
*/
var ERROR_CONF = {
KEY_ERR: 311,
KEY_ERR_MSG: 'key格式错误',
PARAM_ERR: 310,
PARAM_ERR_MSG: '请求参数信息有误',
SYSTEM_ERR: 600,
SYSTEM_ERR_MSG: '系统错误',
WX_ERR_CODE: 1000,
WX_OK_CODE: 200
};
var BASE_URL = 'https://apis.map.qq.com/ws/';
var URL_SEARCH = BASE_URL + 'place/v1/search';
var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
var URL_CITY_LIST = BASE_URL + 'district/v1/list';
var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
var URL_DISTANCE = BASE_URL + 'distance/v1/';
var Utils = {
/**
* 得到终点query字符串
* @param {Array|String} 检索数据
*/
location2query(data) {
if (typeof data == 'string') {
return data;
}
var query = '';
for (var i = 0; i < data.length; i++) {
var d = data[i];
if (!!query) {
query += ';';
}
if (d.location) {
query = query + d.location.lat + ',' + d.location.lng;
}
if (d.latitude && d.longitude) {
query = query + d.latitude + ',' + d.longitude;
}
}
return query;
},
/**
* 使用微信接口进行定位
*/
getWXLocation(success, fail, complete) {
wx.getLocation({
type: 'gcj02',
success: success,
fail: fail,
complete: complete
});
},
/**
* 获取location参数
*/
getLocationParam(location) {
if (typeof location == 'string') {
var locationArr = location.split(',');
if (locationArr.length === 2) {
location = {
latitude: location.split(',')[0],
longitude: location.split(',')[1]
};
} else {
location = {};
}
}
return location;
},
/**
* 回调函数默认处理
*/
polyfillParam(param) {
param.success = param.success || function () { };
param.fail = param.fail || function () { };
param.complete = param.complete || function () { };
},
/**
* 验证param对应的key值是否为空
*
* @param {Object} param 接口参数
* @param {String} key 对应参数的key
*/
checkParamKeyEmpty(param, key) {
if (!param[key]) {
var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
param.fail(errconf);
param.complete(errconf);
return true;
}
return false;
},
/**
* 验证参数中是否存在检索词keyword
*
* @param {Object} param 接口参数
*/
checkKeyword(param){
return !this.checkParamKeyEmpty(param, 'keyword');
},
/**
* 验证location值
*
* @param {Object} param 接口参数
*/
checkLocation(param) {
var location = this.getLocationParam(param.location);
if (!location || !location.latitude || !location.longitude) {
var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误')
param.fail(errconf);
param.complete(errconf);
return false;
}
return true;
},
/**
* 构造错误数据结构
* @param {Number} errCode 错误码
* @param {Number} errMsg 错误描述
*/
buildErrorConfig(errCode, errMsg) {
return {
status: errCode,
message: errMsg
};
},
/**
* 构造微信请求参数,公共属性处理
*
* @param {Object} param 接口参数
* @param {Object} param 配置项
*/
buildWxRequestConfig(param, options) {
var that = this;
options.header = { "content-type": "application/json" };
options.method = 'GET';
options.success = function (res) {
var data = res.data;
if (data.status === 0) {
param.success(data);
} else {
param.fail(data);
}
};
options.fail = function (res) {
res.statusCode = ERROR_CONF.WX_ERR_CODE;
param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, result.errMsg));
};
options.complete = function (res) {
var statusCode = +res.statusCode;
switch(statusCode) {
case ERROR_CONF.WX_ERR_CODE: {
param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
break;
}
case ERROR_CONF.WX_OK_CODE: {
var data = res.data;
if (data.status === 0) {
param.complete(data);
} else {
param.complete(that.buildErrorConfig(data.status, data.message));
}
break;
}
default:{
param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
}
}
}
return options;
},
/**
* 处理用户参数是否传入坐标进行不同的处理
*/
locationProcess(param, locationsuccess, locationfail, locationcomplete) {
var that = this;
locationfail = locationfail || function (res) {
res.statusCode = ERROR_CONF.WX_ERR_CODE;
param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
};
locationcomplete = locationcomplete || function (res) {
if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
}
};
if (!param.location) {
that.getWXLocation(locationsuccess, locationfail, locationcomplete);
} else if (that.checkLocation(param)) {
var location = Utils.getLocationParam(param.location);
locationsuccess(location);
}
}
}
class QQMapWX {
/**
* 构造函数
*
* @param {Object} options 接口参数,key 为必选参数
*/
constructor(options) {
if (!options.key) {
throw Error('key值不能为空');
}
this.key = options.key;
}
/**
* POI周边检索
*
* @param {Object} options 接口参数对象
*
* 参数对象结构可以参考
* @see http://lbs.qq.com/webservice_v1/guide-search.html
*/
search(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (!Utils.checkKeyword(options)) {
return;
}
var requestParam = {
keyword: options.keyword,
orderby: options.orderby || '_distance',
page_size: options.page_size || 10,
page_index: options.page_index || 1,
output: 'json',
key: that.key
};
if (options.address_format) {
requestParam.address_format = options.address_format;
}
if (options.filter) {
requestParam.filter = options.filter;
}
var distance = options.distance || "1000";
var auto_extend = options.auto_extend || 1;
var locationsuccess = function (result) {
requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend +")";
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_SEARCH,
data: requestParam
}));
}
Utils.locationProcess(options, locationsuccess);
}
/**
* sug模糊检索
*
* @param {Object} options 接口参数对象
*
* 参数对象结构可以参考
* http://lbs.qq.com/webservice_v1/guide-suggestion.html
*/
getSuggestion(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (!Utils.checkKeyword(options)) {
return;
}
var requestParam = {
keyword: options.keyword,
region: options.region || '全国',
region_fix: options.region_fix || 0,
policy: options.policy || 0,
output: 'json',
key: that.key
};
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_SUGGESTION,
data: requestParam
}));
}
/**
* 逆地址解析
*
* @param {Object} options 接口参数对象
*
* 请求参数结构可以参考
* http://lbs.qq.com/webservice_v1/guide-gcoder.html
*/
reverseGeocoder(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
var requestParam = {
coord_type: options.coord_type || 5,
get_poi: options.get_poi || 0,
output: 'json',
key: that.key
};
if (options.poi_options) {
requestParam.poi_options = options.poi_options
}
var locationsuccess = function (result) {
requestParam.location = result.latitude + ',' + result.longitude;
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_GET_GEOCODER,
data: requestParam
}));
};
Utils.locationProcess(options, locationsuccess);
}
/**
* 地址解析
*
* @param {Object} options 接口参数对象
*
* 请求参数结构可以参考
* http://lbs.qq.com/webservice_v1/guide-geocoder.html
*/
geocoder(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (Utils.checkParamKeyEmpty(options, 'address')) {
return;
}
var requestParam = {
address: options.address,
output: 'json',
key: that.key
};
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_GET_GEOCODER,
data: requestParam
}));
}
/**
* 获取城市列表
*
* @param {Object} options 接口参数对象
*
* 请求参数结构可以参考
* http://lbs.qq.com/webservice_v1/guide-region.html
*/
getCityList(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
var requestParam = {
output: 'json',
key: that.key
};
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_CITY_LIST,
data: requestParam
}));
}
/**
* 获取对应城市ID的区县列表
*
* @param {Object} options 接口参数对象
*
* 请求参数结构可以参考
* http://lbs.qq.com/webservice_v1/guide-region.html
*/
getDistrictByCityId(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (Utils.checkParamKeyEmpty(options, 'id')) {
return;
}
var requestParam = {
id: options.id || '',
output: 'json',
key: that.key
};
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_AREA_LIST,
data: requestParam
}));
}
/**
* 用于单起点到多终点的路线距离(非直线距离)计算:
* 支持两种距离计算方式:步行和驾车。
* 起点到终点最大限制直线距离10公里。
*
* @param {Object} options 接口参数对象
*
* 请求参数结构可以参考
* http://lbs.qq.com/webservice_v1/guide-distance.html
*/
calculateDistance(options) {
var that = this;
options = options || {};
Utils.polyfillParam(options);
if (Utils.checkParamKeyEmpty(options, 'to')) {
return;
}
var requestParam = {
mode: options.mode || 'walking',
to: Utils.location2query(options.to),
output: 'json',
key: that.key
};
var locationsuccess = function (result) {
requestParam.from = result.latitude + ',' + result.longitude;
wx.request(Utils.buildWxRequestConfig(options, {
url: URL_DISTANCE,
data: requestParam
}));
}
if (options.from) {
options.location = options.from;
}
Utils.locationProcess(options, locationsuccess);
}
}
module.exports = QQMapWX;
\ No newline at end of file
... ...
const config = require('../config.js');
const app = getApp();
function POST(url, params, boo) {
if (arguments.length == 3) {
wx.showLoading({
title: '加载中...',
mask: true
});
}
let promise = new Promise(function (resolve, reject) {
wx.request({
url: `${config.host}${url}`,
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: params,
method: 'POST',
success: function (res) {
if (arguments.length == 3) {
wx.hideLoading();
}
if (res.data.code === 1) {
resolve(res.data);
} else {
reject(res.data);
}
},
fail: function (err) {
if (arguments.length == 3) {
wx.hideLoading();
}
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000
});
}
});
});
return promise
}
function GET(url, obj, boo) {
if (arguments.length == 3) {
wx.showLoading({
title: '加载中...',
mask: true
});
}
let promise = new Promise(function (resolve, reject) {
wx.request({
url: `${config.host}${url}`,
header: {
'content-type': 'application/x-www-form-urlencoded',
"xx-token": wx.getStorageSync("token") ? wx.getStorageSync("token") : ""
},
method: 'GET',
data: obj,
success: function (res) {
if (arguments.length == 3) {
wx.hideLoading();
}
if (res.data.code === 1) {
resolve(res.data);
} else {
reject(res.data);
}
},
fail: function (err) {
if (arguments.length == 3) {
wx.hideLoading();
}
wx.showToast({
title: err.errMsg,
icon: 'none',
duration: 2000
});
}
})
});
return promise
}
function showToast(msg, fn) {
let args = arguments.length;
wx.showToast({
title: msg,
icon: "none",
duration: 1500,
mask: true,
success: function () {
if (args == 2) {
setTimeout(function () {
fn();
}, 1500)
}
}
})
}
//显示提示框
function showmodel(text) {
wx.showModal({
title: '提示',
content: text,
showCancel: false
})
}
//将秒数变成想要的日期格式
function format(time, format) {
var t = new Date(time);
var tf = function (i) {
return (i < 10 ? '0' : '') + i
};
return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) {
switch (a) {
case 'yyyy':
return tf(t.getFullYear());
break;
case 'MM':
return tf(t.getMonth() + 1);
break;
case 'mm':
return tf(t.getMinutes());
break;
case 'dd':
return tf(t.getDate());
break;
case 'HH':
return tf(t.getHours());
break;
case 'ss':
return tf(t.getSeconds());
break;
}
})
}
function ChooseImage(num) {
var promise = new Promise(function (resolve, reject) {
wx.chooseImage({
count: num,
success: function (res) {
resolve(res.tempFilePaths);
},
})
});
return promise;
}
function upload(num, fn) {
ChooseImage(num).then(res => {
wx.showLoading({
title: '',
});
if (res.length != 0) {
let promiseList = [];
for (let value of res) {
let promise = new Promise((resolve, reject) => {
wx.uploadFile({
url: `${config.host}common/upWxappPic`,
filePath: value,
name: 'file',
success: function (res) {
var data = JSON.parse(res.data);
if (data.code == 1) {
resolve(data.data);
}
},
fail: function (err) {
wx.hideLoading();
console.log(err);
}
});
});
promiseList.push(promise);
}
Promise.all(promiseList).then(res => {
fn(res);
})
}
});
}
//预览图片
function previewImage(one, urls) {
wx.previewImage({
current: one,
urls: urls,
});
}
module.exports = {
post: POST,
get: GET,
ChooseImage: ChooseImage,
showmodel: showmodel,
upload: upload,
format: format,
showToast: showToast,
previewImage: previewImage
}
\ No newline at end of file
... ...