Commit d29f7afe authored by 姜立平's avatar 姜立平

小程序初版提交

parent 041105d7
......@@ -9,6 +9,7 @@ App({
console.log('App Hide')
},
globalData: {
hasLogin: false
hasLogin: false,
resumeData:{} //简历的内容
}
})
......@@ -56,7 +56,9 @@
"page/API/background-audio/background-audio",
"page/API/get-location/get-location",
"page/API/open-location/open-location",
"page/resume/resume"
"page/resume/resume",
"page/resumeOnline/resumeOnline",
"page/my/my"
],
"window": {
"navigationBarTextStyle": "black",
......@@ -72,26 +74,20 @@
"list": [
{
"pagePath": "page/component/index",
"iconPath": "image/wechat.png",
"selectedIconPath": "image/wechatHL.png",
"iconPath": "image/tap_bar_01.png",
"selectedIconPath": "image/tap_bar_01_active.png",
"text": "投简历"
},
{
"pagePath": "page/API/index/index",
"iconPath": "image/wechat.png",
"selectedIconPath": "image/wechatHL.png",
"iconPath": "image/tap_bar_02.png",
"selectedIconPath": "image/tap_bar_02_active.png",
"text": "招聘岗位"
},
{
"pagePath": "page/API/index/index",
"iconPath": "image/wechat.png",
"selectedIconPath": "image/wechatHL.png",
"text": "筛选评价"
},
{
"pagePath": "page/API/index/index",
"iconPath": "image/wechat.png",
"selectedIconPath": "image/wechatHL.png",
"pagePath": "page/my/my",
"iconPath": "image/tap_bar_03.png",
"selectedIconPath": "image/tap_bar_03_active.png",
"text": "我的"
}
]
......
<template name="footer">
<view class="page-footer">
</view>
</template>
<template name="header">
<view class="page-header">
<view class="title">{{data.title}}</view>
<view class="desc">{{data.desc}}</view>
</view>
</template>
var globalData = require('../../util/globalData.js');
var commonUtil = require('../../util/commonUtil.js');
var pageData = {},
type = [
'view', 'content', 'form', 'interact', 'nav', 'media', 'map', 'canvas'
];
type = [
'view', 'content', 'form', 'interact', 'nav', 'media', 'map', 'canvas'
];
pageData.widgetsToggle = function (e) {
var id = e.currentTarget.id, data = {};
for (var i = 0, len = type.length; i < len; ++i) {
data[type[i] + 'Show'] = false;
}
data[id + 'Show'] = !this.data[id + 'Show'];
this.setData(data);
var id = e.currentTarget.id, data = {};
for (var i = 0, len = type.length; i < len; ++i) {
data[type[i] + 'Show'] = false;
}
data[id + 'Show'] = !this.data[id + 'Show'];
this.setData(data);
};
/**
......@@ -28,9 +31,26 @@ pageData.scanToggle = function (e) {
* 创建一份简历
*/
pageData.mkdirToggle = function (e) {
var url = '/page/resume/resume';
wx.navigateTo({ url: url })
var syncFlg = false;
try {
// 同步接口立即返回值
var resumeData = globalData.getGlobalData('base');
console.log(resumeData);
console.log(!commonUtil.isEmptyObject(resumeData));
if (!commonUtil.isEmptyObject(resumeData)) {
syncFlg = true;
}
} catch (e) {
console.log('读取key2发生错误');
syncFlg = false;
}
var url = '/page/resume/resume?op=base';
if (syncFlg) {
url = '/page/resumeOnline/resumeOnline';
}
wx.navigateTo({ url: url });
};
......
Page({
/**
* 页面的初始数据
*/
data: {
historyList:[], //播放记录
localStorageSize:'0', //本地缓存大小
canIUse: wx.canIUse('button.open-type.getUserInfo')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this;
// // 查看是否授权
// wx.getSetting({
// success(res) {
// if (res.authSetting['scope.userInfo']) {
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称
// wx.getUserInfo({
// success: function (res) {
// console.log(res.userInfo)
// }
// })
// }
// }
// });
//查看历史播放记录
this.onShowStorage();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.onShowStorage();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 清空缓存
*/
onClearStorage:function() {
var that = this;
wx.clearStorageSync();
wx.showToast({
title: '已清除本地缓存',
});
//缓存大小
that.setData({
localStorageSize:0
});
//清空数据
this.onShowStorage();
},
/**
* 获取缓存
*/
onShowStorage:function() {
var that = this;
var storageArray = wx.getStorageSync("playList");
if (storageArray) {
var historyList = openBenkyoData.getHistoryData(storageArray);
for (var i = 0; i < historyList.length;i++) {
var history = historyList[i];
var tmpData = playData.getPlayDataByProdId(history.prodId);
history["prodId"] = tmpData["prodId"]
history["title"] = tmpData["title"]
history["authorDes"] = tmpData["authorDes"]
history["imageUrl"] = tmpData["imageUrl"]
}
//缓存大小
that.setData({
localStorageSize: historyList.length
});
that.setData({
historyList: historyList
});
}
},
bindGetUserInfo : function(e) {
console.log(e.detail.userInfo)
},
/**
* 获取用户信息
*/
getUserInfo:function() {//同意授权,获取用户信息,encryptedData是加密字符串,里面包含unionid和openid信息
wx.getUserInfo({
withCredentials: true,//此处设为true,才会返回encryptedData等敏感信息
success: res => {
// 可以将 res 发送给后台解码出 unionId
app.globalData.userInfo = res.userInfo;
app.globalData.encryptedData = res.encryptedData;
app.globalData.iv = res.iv;
this.saveUserInfo();
console.log(res)
}
})
},
getAuthorize: function() {//弹出授权窗函数
if (this.data.acceptAuthorize) {//判断是否已经授权过
// 获取用户信息
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
this.getUserInfo();
this.setData({
isShowAhturoizeWarning: false
})
} else {
this.setData({
isShowAhturoizeWarning: true
})
}
}
})
} else {//如果已经授权过直接登录
this.saveUserInfo()
}
},
cancelAuthroize: function(){
this.setData({
isShowAhturoizeWarning: false,
acceptAuthorize: false
});
app.globalData.unionid = null;
this.saveUserInfo();
}
})
function saveUserInfo() {
}
\ No newline at end of file
{
"navigationBarTitleText": "AI公开课",
"enablePullDownRefresh": false
}
\ No newline at end of file
<!--pages/my/my.wxml-->
<view class="container">
<view class="header-image">
<!-- <image src="../../images/user_photo.png" mode="widthFix"></image>
<text>Smart</text> -->
<open-data type="userAvatarUrl" class="icon" mode="aspectFit"></open-data>
<open-data type="userNickName" lang="zh_CN" class="text"></open-data>
</view>
<!-- 如果只是展示用户头像昵称,可以使用 <open-data /> 组件 -->
<!-- <open-data type="userAvatarUrl"></open-data>
<open-data type="userNickName"></open-data> -->
<!-- 需要使用 button 来授权登录 -->
<!-- <button wx:if="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">授权登录</button>
<view wx:else>请升级微信版本</view> -->
<text>简历</text>
<view class="history">
<text>在线简历</text>
<text class="fr">></text>
</view>
<view class="history">
<text>附件简历</text>
<text class="fr">></text>
</view>
<text>职位</text>
<view class="history">
<text>感兴趣的职位</text>
<text class="fr">></text>
</view>
<view class="history">
<text>简历审核(HR)</text>
<text class="fr">></text>
</view>
<view class="history">
<contact-button type="default-dark" size="20" session-from="weapp">
<text>意见反馈</text>
<text class="fr"></text>
</contact-button>
</view>
<button type="default" size="defaultSize" bindtap="nextEdu"> 退 出
</button>
</view>
\ No newline at end of file
/* pages/my/my.wxss */
.container {
width: 100%;
height: 100%;
padding: 0;
background: #f5f7f9;
justify-content: unset;
}
.container .header-image {
width: 100%;
height: 120px;
/*padding: 48rpx 0;*/
background: #fff;
text-align: center;
}
.container .header-image image {
width: 156rpx;
height: auto;
}
.container .header-image .icon {
position: absolute;
height: 100rpx;
width: 100rpx;
border-radius: 80%;
border: 20rpx solid #f1f1f1;
top:1%;
left:40%;
}
.container .header-image .text {
position: absolute;
display: block;
font-weight: bold;
top:12%;
left:45%;
}
.container .vip {
width: 100%;
height: auto;
padding: 43rpx 0 37rpx 0;
position: relative;
background: #fff;
border-top: 1rpx solid #e2e2e2;
}
.container .vip image {
width: 52rpx;
position: absolute;
left: 36rpx;
top: 61rpx;
}
.container .vip text {
display: block;
font-size: 26rpx;
margin-left: 119rpx;
}
.container .vip .h2 {
font-weight: bold;
font-size: 28rpx;
line-height: 52rpx;
}
.container .history {
width: 100%;
height: auto;
margin: 16rpx 0 0 0;
padding: 56rpx 0 56rpx 40rpx;
font-size: 28rpx;
font-weight: bold;
background: #fff;
border-bottom: 1rpx solid #e2e2e2;
}
.container .play-list {
width: 100%;
height: auto;
font-size: 28rpx;
font-weight: bold;
background: #fff;
}
.container .fr {
float: right;
margin-right: 40rpx;
}
/*--------------------------------*/
.font-area {
flex-wrap: warp;
white-space: pre-wrap;
}
/* .font-area text {
font-size: 24rpx;
line-height: 34rpx;
display: flex;
} */
.scroll_box {
width: 100%;
/*height: 200rpx;*/
overflow: hidden;
/*padding: 20rpx;*/
background: #fff;
white-space: nowrap;
}
.scroll-view_x {
width: auto;
overflow: hidden;
}
.item_list {
width: 260rpx;
height: auto;
margin-right: 23rpx;
display: inline-block;
}
.imgSize {
width: 200rpx;
height: 260rpx;
}
.note_item_text{
display: block;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp:3;
overflow: hidden;
text-overflow:ellipsis;
width:95%;
white-space: nowrap;
font-size: 24rpx;
}
/***********获取用户头像**************/
.page-body-info {
padding-bottom: 0;
height: 230px;
}
.userinfo-avatar {
border-radius: 128rpx;
width: 128rpx;
height: 128rpx;
}
.userinfo-nickname {
margin-top: 20rpx;
font-size: 38rpx;
}
\ No newline at end of file
<!--page/resume/resume.wxml-->
<view class="index">
<view class="head">
<view class="title">基本信息</view>
<view class="desc">请填写您的个人基本信息,正确并完整的信息,更有助于别人理解你。</view>
</view>
<view class="body">
<view class="widgets">
<view class="widgets__item">
<view id="view" class="widgets__info">
<text class="widgets__info-name">姓 名</text>
<input class="input" name="userName" placeholder="请输入姓名" bindinput="userNameInput" />
</view>
</view>
<view class="widgets__item">
<view id="content" class="widgets__info" bindtap="widgetsToggle">
<text class="widget__name">性 别</text>
<radio-group bindchange="radiochange" style="padding-left: 30px;">
<radio value='footerball'> 男 </radio>
<radio value='basketball' checked> 女 </radio>
</radio-group>
</view>
<!-- 共同页-头部 -->
<import src="/page/common/header.wxml" />
<!-- 共同页-底部 -->
<import src="/page/common/footer.wxml" />
<!-- 基本信息 -->
<import src="/page/resume/resume_base.wxml" />
<!-- 教育经历 -->
<import src="/page/resume/resume_edu.wxml" />
<!-- 工作经历 -->
<import src="/page/resume/resume_company.wxml" />
</view>
<view class="widgets__item">
<view id="form" class="widgets__info" bindtap="widgetsToggle">
<text class="widgets__info-name">出生日期</text>
<picker mode="date" value="{{date}}" start="1920-01-01" end="2050-01-01" bindchange="bindDateChange">
<view class="picker">
请选择 {{date}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view id="interact" class="widgets__info {{interactShow ? 'widgets__info_show' : ''}}" bindtap="widgetsToggle">
<text class="widgets__info-name">工作年限</text>
<!-- 下拉框 -->
<view class='top-selected' bindtap='bindShowMsg'>
<text>{{grade_name}}</text>
<image src='/images/icon/down.png'></image>
</view>
<!-- 下拉需要显示的列表 -->
<view class="select_box" wx:if="{{select}}">
<view wx:for="{{grades}}" wx:key="unique">
<view class="select_one" bindtap="mySelect" data-name="{{item}}">{{item}}</view>
</view>
</view>
</view>
</view>
<view class="widgets__item">
<view id="nav" class="widgets__info" bindtap="widgetsToggle">
<text class="widgets__info-name">所在城市</text>
<input class="input" name="userName" placeholder="请输入城市名称" />
</view>
</view>
</view>
<view class="index">
<view class="btn-area" id="buttonContainer">
<view class="button-wrapper">
<button type="default" size="{{defaultSize}}" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="nextButton"> 继 续
</button>
</view>
</view>
<template is="header" data="{{data:titleData}}" />
<block wx:if="{{baseShowFlg}}">
<template is="base" data="{{baseData : baseData}}" />
</block>
<modal class="modal" hidden="{{modalHidden2}}" no-cancel bindconfirm="modalChange2" bindcancel="modalChange2">
<view id="view" class="widgets__info">
<text class="widgets__info-name">手 机</text>
<input class="input" name="userName" placeholder="请输入手机号" bindinput="userNameInput" />
</view>
<view id="view" class="widgets__info">
<text class="widgets__info-name">验证 码</text>
<input class="input" name="userName" placeholder="请输入验证码" bindinput="userNameInput" />
</view>
</modal>
<block wx:if="{{eduShowFlg}}">
<template is="edu" data="{{eduData : eduData}}" />
</block>
</view>
<template is="footer" />
</view>
\ No newline at end of file
......@@ -8,16 +8,11 @@
font-size: 16px;
}
.head {
/************** head ********start*************/
.page-header {
/* padding: 40px;*/
display: block;
}
.body {
padding-left: 15px;
padding-right: 15px;
overflow: hidden;
}
.title {
font-size: 30px;
}
......@@ -27,6 +22,15 @@
color: #888;
font-size: 14px;
}
/************** head ********end*************/
.body {
padding-left: 15px;
padding-right: 15px;
overflow: hidden;
}
.widgets__item {
margin-top: 10px;
......@@ -187,4 +191,76 @@
right: 0rpx;
top: 20rpx;
}
/*------ 下拉框 ------------------------------END */
\ No newline at end of file
/*------ 下拉框 ------------------------------END */
.input{
/*width: 300rpx;
margin: 50rpx auto;
border-radius:10rpx;
border: 1rpx solid #888;
*/
border-radius: 11px;
border: 1rpx solid #888;
min-height: 0.8rem;
}
.widgets__infoShow {
display: flex;
padding: 2px;
align-items: center;
flex-direction: row;
}
.list-msg {
padding: 0 20rpx;
background-color: #fff;
position: relative;
}
.list-msg1 {
height: 60rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.list-msg .list-msg2 {
height: 60rpx;
display: flex;
align-items: center;
justify-content: space-between;
border: 1px solid #ccc;
padding: 0 10rpx;
}
.select_box {
background-color: #eee;
padding: 0 10rpx;
width: 93%;
position: absolute;
top: 130rpx;
z-index: 1;
overflow: hidden;
animation: myfirst 0.5s;
}
@keyframes myfirst {
from {
height: 0rpx;
}
to {
height: 210rpx;
}
}
.select_one {
height: 60rpx;
line-height: 60rpx;
border-bottom: 1px solid #ccc;
}
\ No newline at end of file
<!--page/resume/resume_base.wxml-->
<!-- 基本信息 -->
<template name="base">
<view class="body">
<view class="widgets">
<view class="widgets__item">
<view id="view" class="widgets__info">
<text class="widgets__info-name">姓 名</text>
<input class="input" id="userName" value="{{baseData.userName}}" placeholder="请输入姓名" bindinput="baseBindKeyInput"/>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info" >
<text class="widget__name">性 别</text>
<radio-group class="radio-group" bindchange="baseSexchange" style="padding-left: 30px;">
<label wx:key="sexRadio" class="radio" wx:for-items="{{baseData.sexItems}}">
<radio value="{{item.value}}" checked="{{item.checked}}"/>{{item.text}}
</label>
</radio-group>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info" >
<text class="widgets__info-name">出生日期</text>
<picker mode="date" value="{{baseData.birthday}}" start="1920-01-01" end="2050-01-01" bindchange="baseBirthdayPickerSelected">
<view class="picker">
{{baseData.birthday == ''? '请选择':baseData.birthday}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view id="view" class="widgets__info">
<text class="widgets__info-name">手机号</text>
<input class="input" id="telNum" value="{{baseData.telNum}}" placeholder="请输入手机号" bindinput="baseBindKeyInput"/>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info" >
<text class="widgets__info-name">工作年限</text>
<!-- 下拉框 -->
<picker mode="selector" range="{{baseData.jobYears}}" bindchange="baseJobPickerSelected">
<view class="picker">
{{baseData.jobYears[baseData.jobYearsIndex] == ''? '请选择':baseData.jobYears[baseData.jobYearsIndex]}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view id="nav" class="widgets__info" >
<text class="widgets__info-name">所在城市</text>
<input class="input" id="cityName" value="{{baseData.cityName}}" placeholder="请输入城市名称" bindinput="baseBindKeyInput"/>
</view>
</view>
</view>
<view class="btn-area" id="buttonContainer">
<view class="button-wrapper">
<button type="default" size="defaultSize" bindtap="nextEdu"> 继 续
</button>
</view>
</view>
<modal class="modal" hidden="{{baseData.modalHidden2}}" no-cancel bindconfirm="baseSMSChange">
<view>
<text>认证继续</text>
</view>
<view id="view" class="widgets__infoShow">
<text class="widgets__info-name">手 机</text>
<input class="input" id="telNum" value="{{baseData.telNum}}" placeholder="请输入手机号" placeholder-style="color:#e2e2e2;" bindinput="baseBindKeyInput"/>
</view>
<view id="view" class="widgets__infoShow">
<text class="widgets__info-name">验证码</text>
<input class="input" id="verCode" value="{{baseData.verCode}}" placeholder="请输入验证码" placeholder-style="color:#e2e2e2;" style="width:100px" bindinput="baseBindKeyInput"/>
<text>获取码</text>
</view>
</modal>
</view>
</template>
\ No newline at end of file
<!-- 工作经历-公司 -->
<template name="company">
<view class="widgets">
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">公司名称</text>
<input class="input" name="companyName" />
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">职位类型</text>
<picker mode="selector" range="{{eduData.jobType}}" value="" bindchange="eduLevelPickerSelected">
<view class="picker">
{{eduData.levelArray[eduData.levelIndex] == ''? '请选择':eduData.levelArray[eduData.levelIndex]}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">技能标签</text>
<picker mode="selector" range="{{eduData.learningArray}}" value="" bindchange="eduLearningPickerSelected">
<view class="picker">
{{eduData.learningArray[eduData.learningIndex].name == ''? '请选择':eduData.learningArray[eduData.learningIndex].name}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info {{eduData.interactShow ? 'widgets__info_show' : ''}}">
<text class="widgets__info-name">所属部门</text>
<input class="input" name="proName" value="{{eduData.proName}}" />
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">工作内容</text>
<input class="input" name="proName" value="{{eduData.schoolExperience}}" />
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">开始时间</text>
<picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange">
<view class="picker">
当前选择: {{date}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">结束时间</text>
<picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange">
<view class="picker">
当前选择: {{date}}
</view>
</picker>
</view>
</view>
</view>
<view class="btn-area">
<view class="button-wrapper">
<button type="default" size="default" bindtap="nextJob"> 继 续</button>
</view>
</view>
</template>
\ No newline at end of file
<!--page/resume/resume_edu.wxml-->
<!-- 教育经历 -->
<template name="edu">
<view class="widgets">
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">学校名称</text>
<input class="input" id="schoolName" value="{{eduData.schoolName}}" bindinput="eduBindKeyInput"/>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">学历水平</text>
<picker mode="selector" range="{{eduData.levelArray}}" bindchange="eduLevelPickerSelected">
<view class="picker">
{{eduData.levelArray[eduData.levelIndex] == ''? '请选择':eduData.levelArray[eduData.levelIndex]}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">时间段开始</text>
<picker mode="date" start="1920-01-01" end="2050-01-01" bindchange="eduLearningPickerSelected">
<view class="picker">
{{eduData.learningStart == ''? '请选择':eduData.learningStart}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">时间段结束</text>
<picker mode="date" start="1920-01-01" end="2050-01-01" bindchange="eduLearningPickerSelectedEnd">
<view class="picker">
{{eduData.learningEnd == ''? '请选择':eduData.learningEnd}}
</view>
</picker>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info {{eduData.interactShow ? 'widgets__info_show' : ''}}">
<text class="widgets__info-name">专业名称</text>
<input class="input" id="proName" value="{{eduData.proName}}" bindinput="eduBindKeyInput"/>
</view>
</view>
<view class="widgets__item">
<view class="widgets__info">
<text class="widgets__info-name">在校经历</text>
<input class="input" id="schoolExperience" value="{{eduData.schoolExperience}}" bindinput="eduBindKeyInput"/>
</view>
</view>
</view>
<view class="btn-area">
<view class="button-wrapper">
<button type="default" size="default" bindtap="saveEdu"> 保 存</button>
</view>
</view>
</template>
\ No newline at end of file
// page/resumeOnline/resumeOnline.js
var images = require('../../util/images.js');
var resumeData = require('../../util/resumeData.js');
Page({
/**
* 页面的初始数据
*/
data: {
avatorpath: images.avator,
menuList:[]
},
tapMenuItem: function (e) {
var menuItem = this.data.menuList[parseInt(e.currentTarget.id)]
if (menuItem.url) {
wx.navigateTo({ url: menuItem.url })
} else {
var changeData = {}
var opened = menuItem.opened
changeData['menuList[' + e.currentTarget.id + '].opened'] = !opened
this.setData(changeData)
}
},
/**
* 点击头像触发事件,修改头像源路径
*/
bindAvatorTap: function () {
var that = this;
function chooseImageSuccess(res) {
var tempFilePath = res.tempFilePaths[0]
that.setData({
avatorpath: tempFilePath
})
}
wx.chooseImage({
count: 1, // 默认9
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: chooseImageSuccess
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var _menuList = [];
_menuList.push(resumeData.getResumeData("base"));
// console.log("------_menuList-------------");
_menuList.push(resumeData.getResumeData("edu"));
_menuList.push(resumeData.getResumeData("company"));
_menuList.push(resumeData.getResumeData("item"));
// console.log(_menuList);
this.setData({
menuList: _menuList
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
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
<view class="container">
<view class="wx-avator">
<image class="wx-avator_img" src="{{avatorpath}}" bindtap="bindAvatorTap"></image>
</view>
<view class="menu-list">
<block wx:for-items="{{menuList}}" wx:for-item="menuItem" wx:key='menuId'>
<view class="menu-item">
<view class="menu-item-main" id="{{index}}" bindtap="tapMenuItem">
<text class="menu-item-name">{{menuItem.name}}</text>
<image
class="menu-item-arrow {{menuItem.opened ? 'open' : 'close'}} {{menuItem.url ? 'url' : ''}}"
src="/image/arrowright.png">
</image>
</view>
<view class="menu-item-api-list {{menuItem.opened ? 'open' : 'close'}}">
<block wx:for-items="{{menuItem.APIList}}" wx:for-item="APIItem" wx:key="sunItem">
<navigator url="{{APIItem.url}}">
<view class="menu-item-api-item" style="{{index === 0 ? 'border-top:none;' : ''}}">
<view class="menu-item-api-item-text">
<text class="menu-item-api-item-text-zhname">{{APIItem.zhName}}</text>
<text class="menu-item-api-item-text-enname">{{APIItem.enName}}</text>
</view>
<image class="menu-item-api-item-arrow" src="/image/arrowright.png"></image>
</view>
</navigator>
</block>
</view>
<view wx:if="{{menuItem.addUrl}}" style="border-top: 1px solid #d8d8d8; text-align: center;height: 70rpx;">
<navigator url="{{menuItem.addUrl}}">
+ 添加{{menuItem.name}}
</navigator>
</view>
</view>
</block>
</view>
</view>
.header {
padding: 40px;
}
.title {
font-size: 30px;
}
.desc {
margin-top: 5px;
color: #888888;
font-size: 14px;
line-height: 1.4;
}
.menu-list {
display: flex;
flex-direction: column;
background-color: #fbf9fe;
}
.menu-item {
color: #000000;
display: flex;
background-color: #fff;
margin: 10rpx 40rpx;
flex-direction: column;
}
.menu-item-main {
display: flex;
height: 100rpx;
padding: 20rpx;
border-radius: 10rpx;
align-items: center;
font-size: 32rpx;
justify-content: space-between;
}
.menu-item-arrow {
width: 32rpx;
height: 32rpx;
transition: 400ms;
}
.menu-item-arrow.open {
transform: rotate(-90deg);
}
.menu-item-arrow.close {
transform: rotate(90deg);
}
.menu-item-arrow.url {
transform: rotate(0deg);
}
.menu-item-api-list {
transition: 200ms;
height: auto;
border-top: 1px solid #d8d8d8;
}
.menu-item-api-list.close {
display: none;
height: 0;
}
.menu-item-api-item {
display: flex;
justify-content: space-between;
height: 80rpx;
padding: 20rpx 20rpx 20rpx 0;
margin-left: 20rpx;
align-items: center;
border-top: 1px solid #f0f0f0;
}
.menu-item-api-item-text {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
}
.menu-item-api-item-text-zhname {
font-size: 35rpx;
}
.menu-item-api-item-text-enname {
font-size: 26rpx;
color: #6b6b6b;
}
.menu-item-api-item-arrow {
width: 32rpx;
height: 32rpx;
}
/***********************************start***************************************/
/**
* avator组件样式
*/
.wx-avator{
background:rgb(235, 100, 100);
margin-bottom: 0px;
padding:20rpx;
}
.wx-avator_img{
display: block;
width:160rpx;
height:160rpx;
margin: 10rpx auto;
border-radius: 50%;
border: #E0E0E0 solid 4rpx;
margin-left:260rpx;
}
.wx-avator_text{
padding-top:10rpx;
text-align: left;
margin:10rpx auto;
font-size: 40rpx;
}
\ No newline at end of file
// pages/my/my.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/my/my.wxml-->
<text>pages/my/my.wxml</text>
/* pages/my/my.wxss */
\ No newline at end of file
function isEmptyObject(obj) {
console.log("is not empty Object");
console.log(obj);
// for (var key in obj) {
// break;
// return false;
// }
// return true;
if (obj === null) { //|| typeof obj !== "object" || Array.isArray(obj)
return true;
}
for (var key in obj) {
return false;
}
return true;
}
module.exports = {
isEmptyObject: isEmptyObject
}
//var _storage_key = 'resumeData';
function getGlobalData(keyName) {
var globalData = null;
try {
// 同步接口立即返回值
var globalData = wx.getStorageSync(keyName);
console.log("***********************************");
console.log(globalData);
// if (resumeData != null && resumeData != "") {
// if ("base" == keyName) {
// globalData= resumeData.baseData;
// } else if ("edu" == keyName) {
// globalData = resumeData.eduData;
// } else if ("company" == keyName) {
// globalData = resumeData.companyData;
// }
// }
} catch (e) {
console.log('读取key2发生错误');
}
return globalData;
}
module.exports = {
getGlobalData: getGlobalData
}
This diff is collapsed.
/**
* 计算年龄
*/
function getAge(strBirthday) {
console.log("--------" + strBirthday);
if ("" == strBirthday || undefined == strBirthday) {
return;
}
var returnAge;
var strBirthdayArr = strBirthday.split("-");
var birthYear = strBirthdayArr[0];
var birthMonth = strBirthdayArr[1];
var birthDay = strBirthdayArr[2];
var d = new Date();
var nowYear = d.getYear();
var nowMonth = d.getMonth() + 1;
var nowDay = d.getDate();
if (nowYear == birthYear) {
returnAge = 0; //同年 则为0岁
} else {
var ageDiff = nowYear - birthYear; //年之差
if (ageDiff > 0) {
if (nowMonth == birthMonth) {
var dayDiff = nowDay - birthDay; //日之差
if (dayDiff < 0) {
returnAge = ageDiff - 1;
} else {
returnAge = ageDiff;
}
} else {
var monthDiff = nowMonth - birthMonth; //月之差
if (monthDiff < 0) {
returnAge = ageDiff - 1;
} else {
returnAge = ageDiff;
}
}
} else {
returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
}
}
return returnAge; //返回周岁年龄
}
/**
* 获得简历数据
*/
function getResumeData(keyName) {
var globalData = {};
var returnData = {};
try {
//keyName = "base";
// keyName
var globalData = wx.getStorageSync(keyName);
console.log("===============globalData==========");
console.log(globalData);
if (globalData != null) {
if ("base" == keyName) {
returnData = {
id: 1,
opened: true,
name: '基本信息',
APIList: []
};
if (null != globalData) {
returnData.APIList.push(
{
key: "userName",
zhName: globalData.userName,
enName: '姓名',
url: "/page/resume/resume?op=base"
});
//apiList[apiKey].zhName = getAge(globalData.birthday);
returnData.APIList.push(
{
key: "birthday",
zhName: getAge(globalData.birthday),
enName: '年龄',
url: "/page/resume/resume?op=base"
});
//apiList[apiKey].zhName = globalData.telNum;
returnData.APIList.push(
{
key: "telNum",
zhName: globalData.telNum,
enName: '手机号',
url: "/page/resume/resume?op=base"
});
}
} else if ("edu" == keyName) {
returnData = {
id: 6,
name: '教育经历',
opened: true,
addUrl: "/page/resume/resume?op=edu&id=",
APIList: []
};
if (null != globalData && {} != globalData) {
for (var t in globalData) {
returnData.APIList.push({
zhName: globalData[t].schoolName,
enName: globalData[t].levelArray || "",
url: "/page/resume/resume?op=edu&id=" + globalData[t].eduId
});
}
}
} else if ("company" == keyName) {
//globalData = resumeData.companyData;
returnData = {
id: 2,
name: '工作经历',
opened: false,
addUrl: "/page/resume/resume?op=company&id=",
APIList: []
};
if (null != globalData && {} != globalData) {
for (var t in globalData) {
returnData.APIList.push({
zhName: globalData[t].schoolName,
enName: globalData[t].levelArray || "",
url: "/page/resume/resume?op=company&id=" + globalData[t].eduId
});
}
}
} else if ("item" == keyName) {
returnData = {
id: 3,
name: '项目经历',
opened: false,
addUrl: "/page/resume/resume?op=item",
APIList: []
};
if (null != globalData && {} != globalData) {
for (var t in globalData) {
returnData.APIList.push({
zhName: globalData[t].schoolName,
enName: globalData[t].levelArray || "",
url: "/page/resume/resume?op=item&id=" + globalData[t].eduId
});
}
}
}
}
} catch (e) {
console.log('读取key2发生错误');
console.error(e);
}
console.log('----------fanhui-------- ok ----');
console.log(returnData);
return returnData;
}
module.exports = {
getResumeData: getResumeData
}
//var _storage_key = 'resumeData';
// var _data = [{
// id: 1,
// name: '基本信息',
// addUrl: "",
// APIList: [{
// key: "userName",
// zhName: '张三',
// enName: '姓名',
// url: "/page/resume/resume?op=base"
// }, {
// key: "birthday",
// zhName: '5岁',
// enName: '年龄',
// url: "/page/resume/resume?op=base"
// }, {
// key: "jobYears",
// zhName: '20年以上',
// enName: '工作经验',
// url: "/page/resume/resume?op=base"
// }, {
// key: "telNum",
// zhName: '13312341234',
// enName: '手机号',
// url: "/page/resume/resume?op=base"
// }],
// opened: true
// },
// {
// id: 6,
// name: '教育经历',
// opened: false,
// addUrl: "/page/resume/resume?op=edu&id=",
// APIList: [{
// zhName: '复旦大学',
// enName: '',
// url: '../get-network-type/get-network-type'
// }, {
// zhName: '清华大学',
// enName: '',
// url: '../get-network-type/get-network-type'
// }
// ]
// },
// {
// id: 4,
// name: '求职岗位',
// opened: false,
// APIList: [{
// zhName: '架构师',
// enName: '',
// url: '../get-network-type/get-network-type'
// }, {
// zhName: '高级开发',
// enName: '',
// url: '../get-system-info/get-system-info'
// }, {
// zhName: '初级开发',
// enName: '',
// url: '../on-accelerometer-change/on-accelerometer-change'
// }, {
// zhName: '中级开发',
// enName: '',
// url: '../on-compass-change/on-compass-change'
// }]
// }, {
// id: 5,
// name: '工作经历',
// opened: false,
// APIList: [{
// zhName: '***大中华区总裁',
// enName: '',
// url: '../request/request'
// }, {
// zhName: 'IBM总监',
// enName: '',
// url: '../web-socket/web-socket'
// }, {
// zhName: 'Oracle高级工程师',
// enName: '',
// url: '../upload-file/upload-file'
// }, {
// zhName: 'BAT的算法工程师',
// enName: '',
// url: '../download-file/download-file'
// }]
// }, {
// id: 7,
// name: '项目经验',
// opened: false,
// url: '../storage/storage'
// }, {
// id: 8,
// name: '个人爱好',
// opened: false,
// APIList: [{
// zhName: '打篮球',
// enName: '',
// url: '../get-location/get-location'
// }, {
// zhName: '弹琴',
// enName: '',
// url: '../open-location/open-location'
// }]
// }
// ];
// {
// id: 2,
// name: '求职状态',
// addUrl: "../get-user-info/get-user-info",
// APIList: [{
// zhName: '到企业实习',
// enName: '',
// url: '../login/login'
// }, {
// zhName: '离职-随时到岗',
// enName: '',
// url: '../get-user-info/get-user-info'
// }, {
// zhName: '在职-暂不考虑',
// enName: '',
// url: '../request-payment/request-payment'
// }],
// opened: false
// }, {
// id: 3,
// name: '我的优势',
// opened: true,
// APIList: [{
// zhName: '积极乐观向上',
// enName: '',
// url: '../set-navigation-bar-title/set-navigation-bar-title'
// }]
// },
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment