作者 lihongjuan

1

正在显示 100 个修改的文件 包含 2597 行增加0 行删除

要显示太多修改。

为保证性能只显示 100 of 100+ 个文件。

//app.js
const ald = require('./utils/ald-stat.js')
var xmad = require('./utils/dsp_sdk.js')
App({
onLaunch: function() {
this.getOpenId()
let token = wx.getStorageSync("token");
if (token != '') {
this.getrecord()
}
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
//自动更新版本
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function(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
})
})
},
getOpenId() {
console.log('我是openid')
let that = this
wx.login({
success: (res) => {
console.log(res)
let url = 'wxapp/public/getSessionKey'
let param = {
code: res.code,
}
let header = {
'content-type': 'application/x-www-form-urlencoded'
}
wx.request({
url: 'https://yxjingying.com/api/wxapp/public/getSessionKey',
data: param,
method: 'POST',
header: header,
success: function(res) { //返回取得的数据
console.log(res)
console.log(res.data.data.openid)
wx.setStorageSync('openid', res.data.data.openid);
let openid = wx.getStorageSync("openid");
wx.dsp.setOpenid(openid)
// else if (res.data.code == '42002') {
// }
// setTimeout(function () {
// wx.hideNavigationBarLoading()
// }, 600)
},
complete: function() {
wx.hideNavigationBarLoading()
},
fail: function(e) {
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
}
})
// app.post(url, param).then((res) => {
// console.log(res)
// that.setData({
// openid: res.data.openid,
// session_key: res.data.session_key
// })
// wx.setStorageSync("openid", res.data.openid)
// // this.isregister()
// 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()
// },
// fail(res) {
// console.log(res)
// }
// })
// }
// }
// })
// }).catch((errMsg) => {
// })
}
});
},
onshow() {
},
post: function(url, data, headerParams, showLoad) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data;
let baseUrl = 'https://yxjingying.com/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 {
console.log(res)
reject(res)
if (res.data.msg == "请完善简历") {
wx.showToast({
title: res.data.msg,
icon: 'none'
})
setTimeout(function() {
wx.switchTab({
url: '/pages/index/index',
})
}, 1500)
wx.setStorageSync('toisresume', 1)
}
}
// else if (res.data.code == '42002') {
// }
// setTimeout(function () {
// wx.hideNavigationBarLoading()
// }, 600)
},
complete: function() {
wx.hideNavigationBarLoading()
},
fail: function(e) {
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
}
})
});
return promise;
},
// 获取用户记录
getrecord() {
let that = this;
var url = 'index/user/visit';
var params = {
}
var header = {
'XX-Token': wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
that.post(url, params, header).then((res) => {
console.log('88990', res);
}).catch((err) => {
})
},
upload(filetype, file) {
var promise = new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
wx.showLoading({
title: '上传中',
})
let url = 'https://yxjingying.com/api/user/upload/one';
let head = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': ''
}
let typename = {
filetype: filetype
}
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: file,
name: 'file',
header: head,
formData: typename,
success: function(res) {
console.log('上传文件后', res)
let temdata = JSON.parse(res.data);
console.log(temdata)
let urlobj = {
url: temdata.data.url
//url: temdata.data.filepath
}
resolve(urlobj);
wx.hideNavigationBarLoading();
wx.hideLoading();
},
fail: function(res) {
reject('网络出错');
wx.hideNavigationBarLoading()
wx.hideLoading()
},
complete: () => {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
})
});
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;
// }
// },
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)) + '日';
},
newnowDate() {
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));
},
// 接口管理
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,
cid: null,
class_id: null
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/index/index",
"pages/personalData/personalData",
"pages/registration/registration",
"pages/myResume2/myResume2",
"pages/regSuccess/regSuccess",
"pages/myResume/myResume",
"pages/openIndex/openIndex",
"pages/publish/publish",
"pages/positionDetails/positionDetails",
"pages/goodWord/goodWord",
"pages/easyPart/easyPart",
"pages/hotRecommend/hotRecommend",
"pages/atHome/atHome",
"pages/employerDetails/employerDetails",
"pages/inviteFriends/inviteFriends",
"pages/recommend/recommend",
"pages/financialRecord/financialRecord",
"pages/feedback/feedback",
"pages/record2/record2",
"pages/record/record",
"pages/myMessage2/myMessage2",
"pages/myMessage/myMessage",
"pages/index/select/select",
"pages/index/search_4/search_4",
"pages/index/search_2/search_2",
"pages/index/url/url",
"pages/mine/mine",
"pages/date/date",
"pages/day/day"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle": "black"
},
"tabBar": {
"selectedColor": "#FF8839",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"selectedColor": "#6EAC3D",
"iconPath": "img/nav_02@2x.png",
"selectedIconPath": "img/nav_01@2x.png"
},
{
"pagePath": "pages/publish/publish",
"text": "发布",
"selectedColor": "#6EAC3D",
"iconPath": "img/nav_03@2x.png",
"selectedIconPath": "img/nav_03@2x.png"
},
{
"pagePath": "pages/mine/mine",
"text": "我的",
"selectedColor": "#6EAC3D",
"iconPath": "img/nav_04@2x.png",
"selectedIconPath": "img/nav_05@2x.png"
}
]
},
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...

873 字节

const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
industry: '',
categories_id: '',
jobs: '',
// 定义绑定跳转的id
id: '',
userid: '',
categories_name: ''
},
/**
* 生命周期函数--监听页面加载
*/
regSuccess(e) {
let that = this;
let id = e.currentTarget.dataset.id;
var url = 'index/job/job_apply';
var params = {
job_id: id
}
var header = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
wx.showToast({
title: '报名成功',
icon: 'none'
})
setTimeout(function() {
wx.navigateTo({
url: '/pages/regSuccess/regSuccess?id=' + id,
})
}, 1500)
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.data.msg,
icon: 'none'
})
// setTimeout(function () {
// wx.switchTab({
// url: 'pages/index/index?isresume=' + 1,
// })
// }, 1500)
})
},
// 上架下架
upshang(e) {
let that=this;
let id = e.currentTarget.dataset.id;
var url = 'index/job/job_up';
let params = {
job_id: id,
type: 2
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
wx.showToast({
title: '下架成功',
icon: "none"
})
setTimeout(function() {
console.log(88889999)
that.getfabu()
}, 1500)
// console.log(res.data)
// 获取值
// console.log(that.data.industry)
}).catch((err) => {
})
},
upxia(e) {
let that=this;
let id = e.currentTarget.dataset.id;
var url = 'index/job/job_up';
let params = {
job_id: id,
type: 1
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
wx.showToast({
title: '上架成功',
icon: "none"
})
setTimeout(function() {
that.getfabu()
}, 1500)
// console.log(res.data)
// 获取值
// console.log(that.data.industry)
}).catch((err) => {
})
},
//报名者详情
// peopledetail(e){
// let userid = e.currentTarget.dataset.userid
// },
toPosition(e) {
console.log(e)
// 绑定id跳转至工作详情
let that = this;
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/positionDetails/positionDetails?id=' + id,
})
},
// 跳转招聘者信息
toRecruiter(e) {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails?userid=' + e.currentTarget.dataset.userid + '&resumename=' + e.currentTarget.dataset.resumename,
})
},
onLoad: function(options) {
console.log(options)
//页面切换,更换页面标题
wx.setNavigationBarTitle({
title: options.categories_name
})
if (options.categories_id != undefined) {
this.setData({
categories_id: options.categories_id,
categories_name: options.categories_name
})
}
if (options.userid != undefined) {
this.setData({
userid: options.userid,
categories_name: options.categories_name
})
}
// 调用岗位功能参数
// this.getIndustry()
if (options.categories_name == '发布岗位') {
this.getfabu()
} else {
this.getJods()
}
},
// 获取多个工作
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({
jobs: res.data
})
// console.log(that.data.industry)
}).catch((err) => {
})
},
getfabu() {
let that = this;
let url = 'index/job/jobs';
let params = {
user_id: that.data.userid,
}
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({
jobs: res.data
})
// console.log(that.data.industry)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
}
\ No newline at end of file
... ...
<view class='container'>
<!-- 条目 -->
<view class='items' wx:if="{{categories_name!='发布岗位'}}">
<view class='item' bindtap='toPosition' wx:for="{{jobs}}" wx:key="" data-id="{{item.id}}">
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='{{item.logo}}'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top' catchtap='peopledetail'>{{item.station_name}}</view>
<view class='text_bottom '>{{item.min_money}}-{{item.max_money}}{{item.unit_name}}</view>
</view>
</view>
<!-- <view class='item_top_right' catchtap='regSuccess' data-id="{{item.id}}" wx:if="{{item.is_apply==0}}">
报名
</view>
<view class='item_top_right' wx:else>
已报名
</view> -->
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left' catchtap='toRecruiter' data-userid="{{item.user_id}}" data-resumename="{{item.resume_name}}">
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<!-- <view>{{item.resume_name}}</view> -->
<view style="margin-left:20rpx;">报名人数:{{item.apply}}</view>
</view>
<!-- <view class='item_bottom_right'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>{{item.work_county}} {{item.distance}}</view>
</view> -->
</view>
</view>
</view>
<view class='items' wx:else>
<view class='item' bindtap='toPosition' wx:for="{{jobs}}" wx:key="" data-id="{{item.id}}">
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='{{item.logo}}'></image>
</view>
<view class="jiatext">
<view class='item_top_left_text'>
<view class='text_top' catchtap='peopledetail'>{{item.station_name}}</view>
<view class='text_bottom cishu'>{{item.min_money}}-{{item.max_money}}{{item.unit_name}}</view>
</view>
<view class="jiak" wx:if="{{item.is_up==1}}" catchtap="upshang" data-id="{{item.id}}">下架</view>
<view class="jiaxia" wx:else catchtap="upxia" data-id="{{item.id}}">上架</view>
</view>
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left' catchtap='toRecruiter' data-userid="{{item.user_id}}" data-resumename="{{item.resume_name}}">
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>{{item.resume_name}}</view>
<view style="margin-left:20rpx;">报名人数:{{item.apply}}</view>
</view>
<view class='item_bottom_right' wx:if="{{item.categories_id==5}}">
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view >{{item.work_county}}{{item.distance}}</view>
</view>
</view>
</view>
</view>
<!-- 提示 -->
<view class='bottom'>
没有更多内容了
</view>
</view>
\ No newline at end of file
... ...
page {
line-height: 1;
/* background: #EBEBEB; */
}
.container {
display: flex;
flex-flow: column;
}
.top {
display: flex;
align-items: center;
justify-content: center;
background: #fff;
border-top: 1px solid #ebebeb;
border-bottom: 1px solid #ebebeb;
padding: 24rpx 0;
}
.top_box {
display: flex;
align-items: center;
width: 686rpx;
height: 60rpx;
background: rgba(237, 238, 242, 1);
border-radius: 10rpx;
box-sizing: border-box;
padding: 0 24rpx;
}
.top_pic {
width: 28rpx;
height: 28rpx;
display: flex;
}
.top_pic image {
width: 100%;
height: 100%;
}
.top_box input {
margin-left: 25rpx;
width: 100%;
height: 100%;
font-size: 26rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: #000;
}
.about {
font-size: 30rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(26, 26, 26, 1);
border-bottom: 1px solid #ebebeb;
padding: 24rpx 34rpx 24rpx 55rpx;
position: relative;
display: flex;
align-items: center;
}
.about::before {
content: "";
width: 6rpx;
height: 24rpx;
background: rgba(255, 102, 0, 1);
position: absolute;
left: 34rpx;
}
/* 条目 */
.items {
display: flex;
flex-flow: column;
}
.item {
/* margin-top: 1px; */
display: flex;
flex-flow: column;
background: #fff;
padding: 40rpx;
border-bottom: 1px solid #ebebeb;
}
.item:first-child {
border-top: 1px solid #ebebeb;
}
.item_top {
display: flex;
justify-content: space-between;
}
.item_top_left {
display: flex;
}
.item_top_left_pic {
width: 72rpx;
height: 72rpx;
border-radius: 2rpx;
display: flex;
}
.item_top_left_pic image {
width: 100%;
height: 100%;
}
.item_top_left_text {
width:580rpx;
margin-left: 23rpx;
display: flex;
align-items: center;
justify-content: space-between;
/* flex-flow: column; */
}
.text_top {
font-size: 32rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(26, 26, 26, 1);
}
.text_bottom {
/* margin-top: 17rpx; */
font-size: 28rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(255, 59, 40, 1);
margin-left:20rpx;
}
.item_top_right {
width: 140rpx;
height: 66rpx;
line-height: 66rpx;
text-align: center;
border: 1px solid rgba(255, 102, 0, 1);
border-radius: 33rpx;
font-size: 28rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(255, 102, 0, 1);
}
.item_bottom {
margin-top: 20rpx;
margin-left: 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 26rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: rgba(153, 153, 153, 1);
}
.item_bottom_left {
display: flex;
align-items: center;
}
.item_bottom_left_pic {
width: 22rpx;
height: 22rpx;
display: flex;
margin-right: 13rpx;
}
.item_bottom_left_pic image {
width: 100%;
height: 100%;
}
.item_bottom_right {
display: flex;
align-items: center;
}
.item_bottom_left_pic {
margin-left: 14rpx;
width: 20rpx;
height: 24rpx;
display: flex;
}
.item_bottom_left_pic image {
width: 100%;
height: 100%;
}
.bottom {
margin-top: 23rpx;
text-align: center;
font-size: 24rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.jiak {
width: 140rpx;
height: 66rpx;
border: 1px solid #FF6600;
/* background: linear-gradient(135deg, rgba(255, 136, 57, 1), rgba(255, 102, 0, 1)); */
border-radius: 33rpx;
color:#FF6600;
font-size: 28rpx;
text-align: center;
line-height: 66rpx;
}
.jiaxia{
width: 140rpx;
height: 66rpx;
border: 1px solid #999999;
/* background: linear-gradient(135deg, rgba(255, 136, 57, 1), rgba(255, 102, 0, 1)); */
border-radius: 33rpx;
color:#999999;
font-size: 28rpx;
text-align: center;
line-height: 66rpx;
}
.jiatext{
display:flex;
align-items: center;
justify-content: space-between;
width:606rpx;
}
.cishu{
margin-right:20rpx;
}
\ No newline at end of file
... ...
import qqmap from '../../utils/map.js';
const app = getApp()
Page({
data: {
//下面是字母排序
letter: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
cityListId: '',
//下面是城市列表信息,这里只是模拟数据
citylist: [{ "letter": "A", "data": [{ "id": "v7", "cityName": "安徽" }] }, { "letter": "B", "data": [{ "id": "v10", "cityName": "巴中" }, { "id": "v4", "cityName": "包头" }, { "id": "v1", "cityName": "北京" }] }, { "letter": "C", "data": [{ "id": "v15", "cityName": "成都" }] }, { "letter": "D", "data": [{ "id": "v21", "cityName": "稻城" }] }, { "letter": "G", "data": [{ "id": "v17", "cityName": "广州" }, { "id": "v29", "cityName": "桂林" }] }, { "letter": "H", "data": [{ "id": "v9", "cityName": "海南" }, { "id": "v3", "cityName": "呼和浩特" }] }, { "letter": "L", "data": [{ "id": "v24", "cityName": "洛阳" }, { "id": "v20", "cityName": "拉萨" }, { "id": "v14", "cityName": "丽江" }] }, { "letter": "M", "data": [{ "id": "v13", "cityName": "眉山" }] }, { "letter": "N", "data": [{ "id": "v27", "cityName": "南京" }] }, { "letter": "S", "data": [{ "id": "v18", "cityName": "三亚" }, { "id": "v2", "cityName": "上海" }] }, { "letter": "T", "data": [{ "id": "v5", "cityName": "天津" }] }, { "letter": "W", "data": [{ "id": "v12", "cityName": "乌鲁木齐" }, { "id": "v25", "cityName": "武汉" }] }, { "letter": "X", "data": [{ "id": "v23", "cityName": "西安" }, { "id": "v28", "cityName": "香港" }, { "id": "v19", "cityName": "厦门" }] }, { "letter": "Z", "data": [{ "id": "v8", "cityName": "张家口" }] }],
//下面是热门城市数据,模拟数据
newcity: ['北京', '上海', '广州', '深圳', '成都', '杭州'],
// citySel: '全国',
locateCity: ''
},
//点击城市
cityTap(e) {
console.log(e)
const val = e.currentTarget.dataset.val || '',
types = e.currentTarget.dataset.types || '',
Index = e.currentTarget.dataset.index || '',
that = this;
let city = this.data.citySel;
let newcity=e.currentTarget.dataset.val.name;
console.log(newcity)
if(newcity!=undefined){
wx.setStorageSync("cityname", newcity);
}
let newprovince = e.currentTarget.dataset.val.cityName;
if (newprovince!=undefined){
wx.setStorageSync("cityname", newprovince);
}
wx.switchTab({
url: '/pages/index/index',
})
switch (types) {
case 'locate':
//定位内容
city = this.data.locateCity;
break;
case 'national':
//全国
city = '全国';
break;
case 'new':
//热门城市
city = val;
break;
case 'list':
//城市列表
city = val.cityName;
break;
}
if (city) {
wx.setStorage({
key: 'city',
data: city
})
//点击后给父组件可以通过bindcitytap事件,获取到cityname的值,这是子组件给父组件传值和触发事件的方法
// this.triggerEvent('citytap', { cityname: city });
} else {
console.log('还没有');
this.getLocate();
}
},
//点击城市字母
letterTap(e) {
const Item = e.currentTarget.dataset.item;
this.setData({
cityListId: Item
});
console.log("..............." + this.data.cityListId);
},
//调用定位
getLocate() {
let that = this;
new qqmap().getLocateInfo().then(function (val) {//这个方法在另一个文件里,下面有贴出代码
console.log(val);
if (val.indexOf('市') !== -1) {//这里是去掉“市”这个字
console.log(val.indexOf('市') - 1);
val = val.slice(0, val.indexOf('市'));
console.log(val);
}
that.setData({
locateCity: val
});
//把获取的定位和获取的时间放到本地存储
wx.setStorageSync('locatecity', { city: val, time: new Date().getTime() });
});
},
//获取热门城市
gethotcity() {
let that = this;
var url = 'index/category/hot_city';
var params = {
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
newcity: res.data
})
console.log(that.data.newcity)
}).catch((err) => {
})
},
onShow() {
console.log(getApp());
let that = this,
cityOrTime = wx.getStorageSync('locatecity') || {},
time = new Date().getTime(),
city = '';
if (!cityOrTime.time || (time - cityOrTime.time > 1800000)) {//每隔30分钟请求一次定位
this.getLocate();
} else {//如果未满30分钟,那么直接从本地缓存里取值
that.setData({
locateCity: cityOrTime.city
})
}
that.gethotcity()
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "城市"
}
\ No newline at end of file
... ...
<view class='city_box'>
<view class='city_left'>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}'>
<view class='city_locate' data-types='locate' catchtap='cityTap'>
<text class='city_locate_title'>自动定位</text>
<text class='city_locate_text' style='{{!locateCity&&"color:#33b9ff;"}}'>{{locateCity||'点击定位'}}</text>
</view>
<view class='national' data-types='national' catchtap='cityTap'>全国</view>
<view class='new_city'>
<view class='new_city_title'>热门城市</view>
<view class='new_city_box'>
<text class='new_city_text' wx:for='{{newcity}}' wx:key='this' data-types='new' catchtap='cityTap' data-val='{{item}}'>{{item.name}}</text>
</view>
</view>
<view class='city_list_box'>
<block wx:for='{{citylist}}' wx:key='this' wx:for-item='letterItem' wx:for-index='letterIndex'>
<view class='city_first_letter' id='{{letterItem.letter}}'>{{letterItem.letter}}</view>
<text class='city_name' wx:for='{{letterItem.data}}' wx:key='this' data-types='list' catchtap='cityTap' data-index='{{index}}' data-val='{{item}}'>{{item.cityName}}</text>
</block>
</view>
</scroll-view>
</view>
<view class='city_right'>
<text class='letter_item' wx:for='{{letter}}' wx:key='this' catchtap='letterTap' data-item='{{item}}'>{{item}}</text>
</view>
</view>
\ No newline at end of file
... ...
page{
height:100%
}
.city_box{
height:100%;
background: #fff;
display: flex;
}
.city_left{
flex: 1;
}
.city_right{
width: 60rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.letter_item{
flex: 1;
display: block;
font-size: 24rpx;
color: #33B9FF;
text-align: center;
}
.city_locate,.national{
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #efefef;
font-size: 28rpx;
color: #333;
padding-left: 25rpx;
}
.city_locate_title{
color: #999;
margin-right: 20rpx;
}
.new_city{
background: #efefef;
font-size: 28rpx;
}
.new_city_title{
line-height: 50rpx;
color: #999;
padding-left: 25rpx;
margin-bottom: 20rpx;
}
.new_city_box{
display: flex;
flex-wrap: wrap;
}
.new_city_text{
width: 200rpx;
text-align: center;
line-height: 70rpx;
background: #fff;
border-radius: 35rpx;
margin:0 0 22rpx 22rpx;
}
.city_first_letter{
line-height: 40rpx;
height: 40rpx;
padding-left: 25rpx;
font-size: 28rpx;
background: #eee;
color: #999;
}
.city_name{
display: block;
line-height: 80rpx;
height: 80rpx;
border-bottom: 1px solid #efefef;
font-size: 28rpx;
color: #333;
padding-left: 25rpx;
}
\ No newline at end of file
... ...
// pages/day/day.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
winHeight: 0,
newcity:[],
city:'',
lat:'',
lng:''
},
cityTap(e) {
console.log('fasdfsdfsdfds');
console.log(e);
const cityName = e.detail.cityname.name;
console.log(cityName)
if (cityName==undefined){
this.setData({
city: e.detail.cityname
})
}else{
this.setData({
city: e.detail.cityname.name
})
}
console.log(this.data.city)
this.getjingwei();
setTimeout(function(){
wx.switchTab({
url: '/pages/index/index',
})
},1500)
// wx.navigateBack();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const win = wx.getSystemInfoSync();
console.log(win);
this.setData({
winHeight: win.windowHeight
});
// this.gethotcity()
},
//根据城市获取经纬度
getjingwei() {
let that = this;
var url = 'index/category/get_lng_lat';
var params = {
city: that.data.city,
}
app.post(url, params).then((res) => {
console.log(res);
that.setData({
lat:res.data.lat,
lng:res.data.lng
})
console.log(this.data.city);
console.log(this.data.lat);
console.log(this.data.lng)
wx.setStorageSync('city', this.data.city)
wx.setStorageSync('lat', this.data.lat)
wx.setStorageSync('lng', this.data.lng)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {
"citylist": "../date/date"
},
"navigationBarTitleText": "首页"
}
\ No newline at end of file
... ...
<citylist styles='max-height:100%;' bindcitytap='cityTap'></citylist>
... ...
/* pages/day/day.wxss */
\ No newline at end of file
... ...
// pages/easyPart/eastPart.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
regSuccess() {
wx.navigateTo({
url: '/pages/regSuccess/regSuccess',
})
},
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
... ...
{
"usingComponents": {},
"navigationBarTitleText": "轻松兼职"
}
\ No newline at end of file
... ...
<view class='container'>
<!-- 条目 -->
<view class='items'>
<view class='item' bindtap='toPosition'>
<!-- 头部 -->
<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' bindtap='toRecruiter'>
<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>
<!-- 提示 -->
<view class='bottom'>
没有更多内容了
</view>
</view>
... ...
page{
line-height: 1;
/* background: #EBEBEB; */
}
.container{
display: flex;
flex-flow: column;
}
.top{
display: flex;
align-items: center;
justify-content: center;
background: #fff;
border-top: 1px solid #EBEBEB;
border-bottom: 1px solid #EBEBEB;
padding: 24rpx 0;
}
.top_box{
display: flex;
align-items: center;
width:686rpx;
height:60rpx;
background:rgba(237,238,242,1);
border-radius:10rpx;
box-sizing: border-box;
padding: 0 24rpx;
}
.top_pic{
width:28rpx;
height:28rpx;
display: flex;
}
.top_pic image{
width: 100%;
height: 100%;
}
.top_box input{
margin-left: 25rpx;
width: 100%;
height: 100%;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:#000;
}
.about{
font-size:30rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(26,26,26,1);
border-bottom: 1px solid #EBEBEB;
padding: 24rpx 34rpx 24rpx 55rpx;
position: relative;
display: flex;
align-items: center;
}
.about::before{
content: "";
width:6rpx;
height:24rpx;
background:rgba(255,102,0,1);
position: absolute;
left: 34rpx;
}
/* 条目 */
.items{
display: flex;
flex-flow: column;
}
.item{
/* margin-top: 1px; */
display: flex;
flex-flow: column;
background: #fff;
padding: 40rpx;
border-bottom: 1px solid #EBEBEB;
}
.item:first-child{
border-top: 1px solid #EBEBEB
}
.item_top{
display: flex;
justify-content: space-between;
}
.item_top_left{
display: flex;
}
.item_top_left_pic{
width:72rpx;
height:72rpx;
border-radius:2rpx;
display: flex;
}
.item_top_left_pic image{
width: 100%;
height: 100%;
}
.item_top_left_text{
margin-left: 23rpx;
display: flex;
flex-flow: column;
}
.text_top{
font-size:32rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(26,26,26,1);
}
.text_bottom{
margin-top: 17rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,59,40,1);
}
.item_top_right{
width:140rpx;
height:66rpx;
line-height: 66rpx;
text-align: center;
border:1px solid rgba(255,102,0,1);
border-radius:33rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,102,0,1);
}
.item_bottom{
margin-top: 20rpx;
margin-left: 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(153,153,153,1);
}
.item_bottom_left{
display: flex;
align-items: center;
}
.item_bottom_left_pic{
width:22rpx;
height:22rpx;
display: flex;
margin-right: 13rpx;
}
.item_bottom_left_pic image{
width: 100%;
height: 100%;
}
.item_bottom_right{
display: flex;
align-items: center;
}
.item_bottom_left_pic{
margin-left: 14rpx;
width:20rpx;
height:24rpx;
display: flex;
}
.item_bottom_left_pic image{
width: 100%;
height: 100%;
}
.bottom{
margin-top: 23rpx;
text-align: center;
font-size:24rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(153,153,153,1);
}
\ No newline at end of file
... ...
// pages/employerDetails/employerDetails.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
employer: '',
id: '',
job_id: '',
user_id: '',
employerJ: [],
page:1,
page_num:10,
resume_name:'',
resumename:''
},
/**
* 生命周期函数--监听页面加载
*/
// 跳转岗位信息
toPosition(e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/positionDetails/positionDetails?id='+id,
})
},
// 跳转招聘者信息
toRecruiter() {
wx.navigateTo({
url: '/pages/employerDetails/employerDetails',
})
},
onLoad: function (options) {
console.log(options)
this.setData({
job_id: options.job_id,
user_id: options.userid,
resumename:options.resumename
})
this.employerDetails()
this.employerJobs()
},
//报名
regSuccess(e) {
let that = this;
let id = e.currentTarget.dataset.id;
var url = 'index/job/job_apply';
var params = {
job_id: id
}
var header = {
'XX-Token': wx.getStorageSync('token')
}
app.post(url, params, header).then((res) => {
wx.showToast({
title: '报名成功',
icon: 'none'
})
setTimeout(function () {
wx.navigateTo({
url: '/pages/regSuccess/regSuccess?id=' + id,
})
}, 1500)
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.data.msg,
icon: 'none'
})
setTimeout(function () {
wx.navigateBack({
checked: true
})
wx.switchTab({
url: 'pages/index/index?isresume='+1,
})
}, 1500)
})
},
employerDetails() {
let that = this;
let url = 'index/user/user_resume';
let params = {
job_id: that.data.job_id,
user_id: that.data.user_id
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
// 获取值
that.setData({
employer: res.data
})
}).catch((err) => {
})
},
// 获取多个工作
employerJobs() {
let that = this;
let url = 'index/job/jobs';
let params = {
page: that.data.page,
page_num: that.data.page_num,
resume_name: that.data.resumename
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
// 获取值
that.setData({
employerJ: that.data.employerJ.concat(res.data)
})
console.log(that.data.employerJ)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let page=this.data.page;
page++;
this.setData({
page:page
})
this.employerJobs()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {},
"navigationBarTitleText": "招聘者详情"
}
\ No newline at end of file
... ...
<view class='container'>
<view class='top'>
<view class='top_pic'>
<image src='{{employer.banner}}'></image>
</view>
<view class='top_text'>
<view class='top_text_left'>
{{employer.resume_name}}
</view>
<view class='top_text_right'>
<image src='{{employer.avatar}}'></image>
</view>
</view>
</view>
<!-- 地址 -->
<view class='addr'>
<view class='addr_left'>
{{employer.work_address}}
</view>
<view class='addr_right'>
<view class='addr_right_icon'>
<image src='../../img/aicon_09@2x.png'></image>
</view>
<view class='addr_right_distance'>{{employer.distance}}</view>
</view>
</view>
<!-- 相关岗位 -->
<view class='items'>
<view class='related'>
相关岗位
</view>
<view class='item' bindtap='toPosition' wx:for='{{employerJ}}' wx:key='' data-id='{{item.id}}'>
<!-- 头部 -->
<view class='item_top'>
<view class='item_top_left'>
<view class='item_top_left_pic'>
<image src='{{item.logo}}'></image>
</view>
<view class='item_top_left_text'>
<view class='text_top'>{{item.station_name}}</view>
<view class='text_bottom'>{{item.min_money}}-{{item.max_money}}{{item.unit_name}}</view>
</view>
</view>
<view class='item_top_right' catchtap='regSuccess' data-id="{{item.id}}" wx:if="{{item.is_apply==0}}">
报名
</view>
<view class='item_top_right' wx:else>
已报名
</view>
</view>
<!-- 底部 -->
<view class='item_bottom'>
<view class='item_bottom_left' bindtap='toRecruiter'>
<view class='item_bottom_left_pic'>
<image src='/img/aicon_10@2x.png'></image>
</view>
<!-- 名字 -->
<view>{{item.resume_name}}</view>
</view>
<view class='item_bottom_right' >
<view class='item_bottom_left_pic'>
<image src='/img/aicon_09@2x.png'></image>
</view>
<view>{{item.work_county}} {{item.distance}}</view>
</view>
</view>
</view>
<!-- <view class='item' bindtap='toPosition'>
<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' bindtap='toRecruiter'>
<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>
<!-- 没有更多内容了 -->
<view class='bottom'>
没有更多内容了
</view>
</view>
\ No newline at end of file
... ...
page{
line-height: 1;
background: #F5F5F5;
}
.container{
width: 750rpx;
display: flex;
flex-flow: column;
/* align-items: center; */
}
.top{
display: flex;
flex-flow: column;
background: #fff;
}
.top_pic{
width:750rpx;
height:360rpx;
display: flex;
}
.top_pic image{
width: 100%;
height: 100%;
}
.top_text{
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 20rpx 32rpx;
}
.top_text_left{
font-size:36rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(26,26,26,1);
}
.top_text_right{
width:72rpx;
height:72rpx;
border-radius:2rpx;
}
.top_text_right image{
width: 100%;
height: 100%;
border-radius:2rpx;
}
.addr{
margin-top: 14rpx;
display: flex;
justify-content: space-between;
background: #fff;
box-sizing: border-box;
padding: 40rpx 32rpx;
}
.addr_left{
width: 418rpx;
font-size:28rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(26,26,26,1);
line-height:42rpx;
}
.addr_right{
display: flex;
/* align-items: center; */
}
.addr_right_icon{
width:20rpx;
height:24rpx;
display: flex;
}
.addr_right_icon image{
width: 100%;
height: 100%;
}
.addr_right_distance{
margin-left: 15rpx;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(153,153,153,1);
}
.items{
margin-top: 14rpx;
display: flex;
flex-flow: column;
background: #fff;
}
.related{
font-size:30rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(26,26,26,1);
box-sizing: border-box;
padding: 40rpx 54rpx 25rpx 54rpx;
position: relative;
border-bottom: 1px solid #EBEBEB;
}
.related::before{
content: '';
position: absolute;
top: 42rpx;
left: 32rpx;
width:6rpx;
height:24rpx;
background:rgba(255,102,0,1);
}
.item{
margin-top: 1px;
display: flex;
flex-flow: column;
background: #fff;
padding: 40rpx 30rpx;
border-bottom: 1px solid #EBEBEB;
}
.item_top{
display: flex;
justify-content: space-between;
}
.item_top_left{
display: flex;
}
.item_top_left_pic{
width:72rpx;
height:72rpx;
border-radius:2rpx;
display: flex;
}
.item_top_left_pic image{
width: 100%;
height: 100%;
}
.item_top_left_text{
margin-left: 23rpx;
display: flex;
flex-flow: column;
}
.text_top{
font-size:32rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(26,26,26,1);
}
.text_bottom{
margin-top: 17rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,59,40,1);
}
.item_top_right{
width:140rpx;
height:66rpx;
line-height: 66rpx;
text-align: center;
border:1px solid rgba(255,102,0,1);
border-radius:33rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,102,0,1);
}
.item_bottom{
margin-top: 20rpx;
margin-left: 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size:26rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(153,153,153,1);
}
.item_bottom_left{
display: flex;
align-items: center;
}
.item_bottom_left_pic{
width:22rpx;
height:22rpx;
display: flex;
margin-right: 13rpx;
}
.item_bottom_left_pic image{
width: 100%;
height: 100%;
}
.item_bottom_right{
display: flex;
align-items: center;
}
.item_bottom_left_pic{
margin-left: 14rpx;
width:20rpx;
height:24rpx;
display: flex;
}
.item_bottom_left_pic image{
width: 100%;
height: 100%;
}
.bottom{
padding: 24rpx 0;
text-align: center;
font-size:24rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(153,153,153,1);
background: #fff;
}
\ No newline at end of file
... ...
// pages/feedback/feedback.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
content: '',
wordlen:0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.getFeedback
},
enterContent(e) {
console.log(e)
this.setData({
content: e.detail.value,
wordlen:e.detail.value.length
})
},
sub_btn() {
let that = this;
let content = that.data.content;
if (content == '') {
wx.showToast({
title: '请输入内容',
icon: 'none'
})
}
let url = 'index/share/submit_opinion';
let params = {
content : that.data.content,
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res);
wx.showToast({
title: '提交成功',
icon: 'none',
duration: 1500
})
setTimeout(function(){
wx.navigateBack({
checked:true
})
},1500)
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
{
"usingComponents": {},
"navigationBarTitleText": "意见反馈"
}
\ No newline at end of file
... ...
<view class='container'>
<view class='top'>
<textarea bindinput='enterContent' placeholder='请输入您的意见,我们会积极处理并改正的~'></textarea>
<view class='text_num'>{{wordlen}}/200</view>
</view>
<view class='bottom' bindtap='sub_btn' >
提交
</view>
</view>
\ No newline at end of file
... ...
page{
line-height: 1;
}
.container{
width: 750rpx;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
}
.top{
margin-top: 27rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.top textarea{
width:686rpx;
height:300rpx;
background:rgba(247,247,247,1);
border-radius:10rpx;
font-size: 28rpx;
box-sizing: border-box;
padding: 23rpx 25rpx;
}
.text_num{
font-size:24rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(153,153,153,1);
position: absolute;
bottom: 23rpx;
right: 25rpx
}
.bottom{
margin-top: 40rpx;
width:686rpx;
height:80rpx;
line-height: 80rpx;
text-align: center;
background:rgba(255,129,44,1);
border-radius:5rpx;
font-size:28rpx;
font-family:PingFang-SC-Medium;
font-weight:500;
color:rgba(255,255,255,1);
}
\ No newline at end of file
... ...
// pages/financialRecord/financialRecord.js
const app=getApp()
Page({
/**
* 页面的初始数据
*/
data: {
page:1,
page_num:20,
moneylist:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getmoneylist()
},
getmoneylist(){
let that = this;
var url = 'index/share/balance_record';
var params = {
page: that.data.page,
page_num: that.data.page_num
}
var header={
'XX-Token': wx.getStorageSync('token'),
}
app.post(url, params,header).then((res) => {
console.log(res);
that.setData({
moneylist:res.data
})
}).catch((err) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...