diff --git a/assets/css/common.wxss b/assets/css/common.wxss index dd1b5c9..2718991 100644 --- a/assets/css/common.wxss +++ b/assets/css/common.wxss @@ -838,4 +838,12 @@ color: #2A2A2A; } .form-item .count{ background-color: #aaa; +} +.no-data{ + width: 100%; + height:200px; + display: flex; + justify-content: center; + align-items: center; + color: #999; } \ No newline at end of file diff --git a/assets/images/tx.png b/assets/images/tx.png new file mode 100644 index 0000000..b5faf96 Binary files /dev/null and b/assets/images/tx.png differ diff --git a/assets/images/warning.png b/assets/images/warning.png new file mode 100644 index 0000000..2d29378 Binary files /dev/null and b/assets/images/warning.png differ diff --git a/assets/images/xgmm.png b/assets/images/xgmm.png new file mode 100644 index 0000000..c68bac2 Binary files /dev/null and b/assets/images/xgmm.png differ diff --git a/assets/js/http/api.js b/assets/js/http/api.js index b6aed76..3b2d071 100644 --- a/assets/js/http/api.js +++ b/assets/js/http/api.js @@ -3,6 +3,7 @@ import http from './http.js' // let baseUrl = 'https://share.hzwlsoft.com' // let baseUrl = 'http://localhost:8080' let baseUrl = 'http://10.0.1.9:8080' +let URL_CONFIG = '/jero-boot/' // let baseUrl = 'http://192.168.1.110:8080' /* 配置路径 */ @@ -14,6 +15,7 @@ let apiUrl = { export default { baseUrl, + URL_CONFIG, //微信账号密码登陆--1 wxLoginByUserName(option, success, error) { http.post1(baseUrl + apiUrl.wxLoginByUserName, option).then(res => { diff --git a/assets/js/http/userApi.js b/assets/js/http/userApi.js index 4000b50..5bac7a7 100644 --- a/assets/js/http/userApi.js +++ b/assets/js/http/userApi.js @@ -21,27 +21,30 @@ const UserApi = { // 短信登录 codeLogin: (params) => http.post(`${URL_CONFIG}company/smsLogin`, params), // 设置密码 - setPassword: (params) => http.post(`${URL_CONFIG}company/changePassword`, params), + setPassword: (params) => http.post(`${URL_CONFIG}company/changePasswordWithToken`, params), + // 修改密码 + updatePassword: (params) => http.post(`${URL_CONFIG}company/changePassword`, params), + // 扫码签到 + scanCode: (params) => http.post(`${URL_CONFIG}company/changePassword`, params), // 退出 logout: (params) => http.post(`${URL_CONFIG}sys/logout`, params), - // 短信验证码修改密码 - updatePassword: (params) => http.post(`${URL_CONFIG}company/verificationChangePassword`, params), // 个人信息 mineInfo: (params) => http.get(`${URL_CONFIG}company/payContactsManagement/queryByIdMeeting`, params), // 编辑个人信息提交 editMineInfo: (params) => http.post(`${URL_CONFIG}company/payContactsManagement/companyEdit`, params), // 我的资料 dataList: (params) => http.get(`${URL_CONFIG}project/payWorkingGroupDistributionRecord/listForFile`, params), - + // 我的合同 + contractList: (params) => http.get(`${URL_CONFIG}contract/payIncomeContract/queryCompanyPageList`, params), + // 合同详情 + contractDetail: (params) => http.get(`${URL_CONFIG}contract/payIncomeContract/queryCompanyById`, params), + // 预览文件 + previewFile: (params) => http.get(`${URL_CONFIG}sys/common/download/${params.fileId}`), // 首页接口 // 来款项目分页 projectList: (params) => http.get(`${URL_CONFIG}project/payCommonProject/queryCompanyPageList`, params), // 来款项目详情 projectDetail: (params) => http.get(`${URL_CONFIG}project/payCommonProject/queryCompanyById`, params), - // 会议活动分页 - meetingList: (params) => http.get(`${URL_CONFIG}meeting/payMeeting/pageContract`, params), - // 会议活动详情 - meetingDetail: (params) => http.get(`${URL_CONFIG}meeting/payMeeting/queryById`, params), } export default UserApi diff --git a/assets/js/preview.js b/assets/js/preview.js index b87f942..41852d5 100644 --- a/assets/js/preview.js +++ b/assets/js/preview.js @@ -44,7 +44,7 @@ export function previewFile(fileId,fileName) { } // 截取文件类型的方法 - function sliceFileTypeByFileName(fileName){ + export function sliceFileTypeByFileName(fileName){ // 获取 . 的索引 let index = fileName.lastIndexOf('.') // 截取文件类型 diff --git a/components/dateMonth/dateMonth.js b/components/dateMonth/dateMonth.js index 3e78082..6895949 100644 --- a/components/dateMonth/dateMonth.js +++ b/components/dateMonth/dateMonth.js @@ -10,7 +10,31 @@ for (let i = 1; i <= 12; i++) { months.push(i) } -Page({ +Component({ + /** + * 组件的属性列表 + */ + properties: { + // 是否弹出显示 + visible: { + type: Boolean, + value: false + }, + //点击外部的遮罩层是否允许关闭 + outClickCanClose: { + type: Boolean, + value: false + }, + // 模式,年或者月,默认只有年 + mode: { + type: String, + value: 'year' + } + }, + + /** + * 组件的初始数据 + */ data: { years: years, year: date.getFullYear(), @@ -18,12 +42,39 @@ Page({ month: 2, value: [9999, 1, 1], }, - bindChange: function (e) { - const val = e.detail.value - this.setData({ - year: this.data.years[val[0]], - month: this.data.months[val[1]], - }) - console.log(this.data) + + /** + * 组件的方法列表 + */ + methods: { + closePopup() { + this.triggerEvent("close", { + visible: this.data.visible + }) + }, + outClick(){ + if (this.data.outClickCanClose){ + this.triggerEvent("close", { + visible: this.data.visible + }) + } + }, + // 日期改变 + bindChange: function (e) { + const val = e.detail.value + this.setData({ + year: this.data.years[val[0]], + month: this.data.months[val[1]], + }) + }, + ok(e){ + let value = '' + if(this.properties.mode === 'month'){ + value = this.data.year + '-' + this.data.month + }else { + value = this.data.year + } + this.triggerEvent("ok", value) + } } -}) \ No newline at end of file +}) diff --git a/components/dateMonth/dateMonth.wxml b/components/dateMonth/dateMonth.wxml index 9641485..b5c9d4f 100644 --- a/components/dateMonth/dateMonth.wxml +++ b/components/dateMonth/dateMonth.wxml @@ -1,12 +1,12 @@ {{year}}年{{month}}月 - {{item}}年 - + {{item}}月 diff --git a/components/dateMonth/dateMonth.wxss b/components/dateMonth/dateMonth.wxss index 8688561..f8a35a3 100644 --- a/components/dateMonth/dateMonth.wxss +++ b/components/dateMonth/dateMonth.wxss @@ -1,5 +1,30 @@ .box{ - height: 300px; + width: 85%; + height: 360px; + background-color: #fff; +} +.i-modal-mask { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.7); + z-index: 1000; + transition: all 0.2s ease-in-out; + opacity: 0; + visibility: hidden; + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.i-modal-mask-show { + opacity: 1; + visibility: visible; } .title{ width: 100%; diff --git a/contractDetail/contractDetail.wxml b/contractDetail/contractDetail.wxml deleted file mode 100644 index 46c9876..0000000 --- a/contractDetail/contractDetail.wxml +++ /dev/null @@ -1,26 +0,0 @@ - - 基本信息 - - - 合同编号 - arff4ds8a3s6651 - - - 合同名称 - 找找 - - - 负责人 - 张三 - - - 合同金额 - 500元 - - - 邮寄信息 - - diff --git a/contractDetail/contractDetail.wxss b/contractDetail/contractDetail.wxss deleted file mode 100644 index fcab94c..0000000 --- a/contractDetail/contractDetail.wxss +++ /dev/null @@ -1,34 +0,0 @@ -page{ - box-sizing: border-box; -} -.title{ - height: 40px; - padding-left: 10px; - line-height: 40px; - color: #999; - font-size: 14px; - background-color: #f5f5f5; -} -.basic-info view{ - padding: 15px; - height: 40px; - display: flex; - justify-content: space-between; - align-items: center; - color: #333; - font-size: 14px; -} -.email-info text:nth-child(1){ - color: #333; - font-size: 14px; -} -.email-info{ - padding: 15px; -} -.email-info text:nth-child(2){ - color: #069F99; - font-size: 14px; - display: block; - margin-top: 10px; - text-align: center; -} \ No newline at end of file diff --git a/pages/contractDetail/contractDetail.js b/pages/contractDetail/contractDetail.js index 3349a12..a5f0984 100644 --- a/pages/contractDetail/contractDetail.js +++ b/pages/contractDetail/contractDetail.js @@ -1,10 +1,14 @@ -// pages/meeting/meeting.js +import UserApi from '../../assets/js/http/userApi' Page({ /** * 页面的初始数据 */ data: { + form: {} + }, + // 查看物流 + track(){ }, @@ -12,7 +16,16 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + console.log(options) + let id = options.id // 合同id + UserApi.contractDetail({id}).then(res=>{ + console.log(res) + if(res.success){ + this.setData({ + form: res.result + }) + } + }) }, /** diff --git a/pages/contractDetail/contractDetail.wxml b/pages/contractDetail/contractDetail.wxml index 46c9876..df3044c 100644 --- a/pages/contractDetail/contractDetail.wxml +++ b/pages/contractDetail/contractDetail.wxml @@ -3,24 +3,30 @@ 合同编号 - arff4ds8a3s6651 + {{form.contractNum}} 合同名称 - 找找 + {{form.contractName}} 负责人 - 张三 + {{form.principalName}} 合同金额 - 500元 + {{form.contractAmount ? form.contractAmount + '元' : 0}} + + + 关联项目 + + {{item.chargeUse_dictText}} + 邮寄信息 diff --git a/pages/contractDetail/contractDetail.wxss b/pages/contractDetail/contractDetail.wxss index fcab94c..a7cdbe5 100644 --- a/pages/contractDetail/contractDetail.wxss +++ b/pages/contractDetail/contractDetail.wxss @@ -10,6 +10,7 @@ page{ background-color: #f5f5f5; } .basic-info view{ + background-color: #FFF; padding: 15px; height: 40px; display: flex; @@ -17,6 +18,11 @@ page{ align-items: center; color: #333; font-size: 14px; + border-bottom: 0.5px solid #f5f5f5; + position: relative; +} +.basic-info view:last-child{ + border-bottom: 0; } .email-info text:nth-child(1){ color: #333; @@ -31,4 +37,17 @@ page{ display: block; margin-top: 10px; text-align: center; +} +.ass-project{ + height: auto !important; + padding: 0 !important; + display: flex; + flex-direction: column; + justify-content: flex-end; + align-items: flex-end; +} +.ass-project text{ + color: #069F99; + display: block; + line-height: 25px; } \ No newline at end of file diff --git a/pages/login/login.js b/pages/login/login.js index 5deea2f..9fc4e34 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -18,6 +18,7 @@ Page({ }, // 获取验证码 getVerCode() { + countdown = 60 if (/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.data.phone)) { UserApi.sendCode({ phone: this.data.phone @@ -27,8 +28,8 @@ Page({ this.countDown() } else { wx.showToast({ - title: '获取验证码失败', - icon: 'error', + title: res.message, + icon: 'none', duration: 2000 }) } @@ -74,9 +75,9 @@ Page({ // 请求短信登录start UserApi.codeLogin(params).then(res => { if (res.success) { - // 存token和userInfo + // 存临时token和userInfo wx.setStorage({ - key: 'X-Access-Token', + key: 'token-temp', data: res.result.token }) wx.setStorage({ @@ -89,15 +90,19 @@ Page({ url: '../setPassword/setPassword', }) }else{ - // 跳转设置密码页 + // 存token和userInfo + wx.setStorage({ + key: 'X-Access-Token', + data: res.result.token + }) + // 跳转首页 wx.switchTab({ url: '../home/home', }) } - } else { wx.showToast({ - title: '登录失败', + title: res.message, icon: 'error', duration: 2000 }) @@ -157,4 +162,4 @@ Page({ onReachBottom: function () { } -}) \ No newline at end of file +}) diff --git a/pages/login/login.wxml b/pages/login/login.wxml index 58c08e9..ae55b63 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -17,5 +17,6 @@ + - \ No newline at end of file + diff --git a/pages/login/login.wxss b/pages/login/login.wxss index 2779408..e6de0c6 100644 --- a/pages/login/login.wxss +++ b/pages/login/login.wxss @@ -5,4 +5,10 @@ page { } .form-box{ transform: translateY(100%); -} \ No newline at end of file +} +/* .forget{ + color: #999; + font-size: 14px; + text-align: right; + margin-top: 20px; +} */ diff --git a/pages/mine/mine.js b/pages/mine/mine.js index 4d6dae2..7f32d6d 100644 --- a/pages/mine/mine.js +++ b/pages/mine/mine.js @@ -6,7 +6,9 @@ Page({ * 页面的初始数据 */ data: { - userId: '' + userId: '', + name: '昵称', + phone: '' }, // 个人信息 mineInfo(){ @@ -25,10 +27,19 @@ Page({ wx.scanCode({ onlyFromCamera: false, scanType: [], - success: (result) => {}, - fail: (res) => {}, - complete: (res) => {}, + success: (result) => { + console.log(result) + }, + fail: (res) => { + console.log(result) + }, + complete: (res) => { + console.log(result) + }, }) + // wx.navigateTo({ + // url: '../scanSign/scanSign', + // }) }, // 我的资料 mineData(){ @@ -56,6 +67,11 @@ Page({ wx.redirectTo({ url: '../login/login', }) + }else{ + wx.clearStorage() + wx.redirectTo({ + url: '../login/login', + }) } }) } else if (res.cancel) {} @@ -66,14 +82,11 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - + let userInfo = wx.getStorageSync('userInfo') + this.setData({ + name: userInfo.name, + phone: userInfo.phone.substr(0, 3) + '-' + userInfo.phone.substr(3, 4) + '-' + userInfo.phone.substr(7, 4) + }) }, /** @@ -81,40 +94,5 @@ Page({ */ onShow: function () { - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - } -}) \ No newline at end of file +}) diff --git a/pages/mine/mine.wxml b/pages/mine/mine.wxml index 5331f1b..2cece1b 100644 --- a/pages/mine/mine.wxml +++ b/pages/mine/mine.wxml @@ -1,25 +1,14 @@ - + - + - 昵称 - 185-2207-4910 - - - - - - 412 - 我的项目 - - - 2 - 我的会议 + {{name}} + {{phone}} @@ -36,7 +25,7 @@ - + 修改密码 @@ -62,16 +51,9 @@ - - - - 设置 - - - 退出登录 - \ No newline at end of file + diff --git a/pages/mine/mine.wxss b/pages/mine/mine.wxss index fdd5237..f482013 100644 --- a/pages/mine/mine.wxss +++ b/pages/mine/mine.wxss @@ -6,7 +6,7 @@ page{ height: 200pt; } .select-box{ - transform: translateY(-100pt); + transform: translateY(-75pt); padding: 0 15pt; } .select-box .avator{ @@ -48,7 +48,7 @@ page{ width: 35px; height: 35px; } -.select-box .select{ +.select-box .select{ height: 90pt; background-color: #fff; border-radius: 10px; @@ -76,7 +76,7 @@ page{ } /* 个人信息选项栏 */ .list-info{ - margin-top: -100pt; + margin-top: -65pt; padding: 15pt; } .list-info .title{ @@ -122,4 +122,4 @@ page{ border-radius: 5px; font-size: 13px; color: #069F99; -} \ No newline at end of file +} diff --git a/pages/mineContract/mineContract.js b/pages/mineContract/mineContract.js index 1134c57..ac7ce5b 100644 --- a/pages/mineContract/mineContract.js +++ b/pages/mineContract/mineContract.js @@ -1,71 +1,48 @@ -// pages/minedata/minedata.js +import UserApi from '../../assets/js/http/userApi' Page({ /** * 页面的初始数据 */ data: { - list: [,1,1,1,1,1,1,1,1] + list: [], + pageNo: 1, + pageSize: 10 }, // 合同详情 - contractDetail(){ + contractDetail(e){ + let id = e.currentTarget.dataset.meeting.id wx.navigateTo({ - url: '../contractDetail/contractDetail', + url: `../contractDetail/contractDetail?id=${id}`, }) }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - + loadData(){ + let params = { + pageNo: this.data.pageNo, + pageSize: this.data.pageSize + } + UserApi.contractList(params).then(res=>{ + if(res.success && res.result.records && res.result.records.length){ + console.log(res.result.records) + this.setData({ + list: [...this.data.list, ...res.result.records] + }) + } + }) }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - + /** * 生命周期函数--监听页面显示 */ onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - + this.loadData() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - + this.data.pageNo++ + this.loadData() } }) \ No newline at end of file diff --git a/pages/mineContract/mineContract.wxml b/pages/mineContract/mineContract.wxml index 2f3b461..f77dc0c 100644 --- a/pages/mineContract/mineContract.wxml +++ b/pages/mineContract/mineContract.wxml @@ -1,13 +1,16 @@ - - + + - 合同名称 - 合同金额:5000元 + {{item.contractName}} + 合同金额:{{item.contractAmount ? item.contractAmount + '元' : '0'}} - 合同编号:002 - 负责人:张三 + 合同编号:{{item.contractNum}} + 负责人:{{item.principalName}} + + 暂无数据 + diff --git a/pages/mineData/mineData.js b/pages/mineData/mineData.js index 7bbc726..a8217c1 100644 --- a/pages/mineData/mineData.js +++ b/pages/mineData/mineData.js @@ -1,4 +1,5 @@ import UserApi from '../../assets/js/http/userApi' +import { previewFile, sliceFileTypeByFileName } from '../../assets/js/preview' Page({ /** @@ -16,14 +17,25 @@ Page({ pageSize: this.data.pageSize } UserApi.dataList(params).then(res=>{ - if(res.success){ + if(res.success && res.result.records && res.result.records.length){ console.log(res.result.records) this.setData({ - list: res.result.records + list: [...this.data.list, ...res.result.records] }) } }) }, + // 预览 + previewFile(e) { + const fileObj = e.currentTarget.dataset.file + let fileType = sliceFileTypeByFileName(fileObj.fileName) + // 文件类型不是docx,doc,pdf时,已邮件形式发送到参会人的邮箱 + if(fileType !== 'docx' && fileType !== 'doc' && fileType !== 'pdf') { + + }else { + previewFile(fileObj.filId, fileObj.fileName) + } + }, /** * 生命周期函数--监听页面显示 */ @@ -38,4 +50,4 @@ Page({ this.data.pageNo++ this.loadData() } -}) \ No newline at end of file +}) diff --git a/pages/mineData/mineData.wxml b/pages/mineData/mineData.wxml index 86dbad9..fd6510f 100644 --- a/pages/mineData/mineData.wxml +++ b/pages/mineData/mineData.wxml @@ -1,8 +1,11 @@ - - + + {{item.uploadTime}} - {{item.fileName}} + {{item.fileName}} + + 暂无数据 + diff --git a/pages/project/project.js b/pages/project/project.js index 8eba712..e3ec9b3 100644 --- a/pages/project/project.js +++ b/pages/project/project.js @@ -6,12 +6,14 @@ Page({ */ data: { visible: false, + visibleDate: false, index: 0, + list: [], // 项目列表 searchParams: { pageNo: 1, pageSize: 10, - needInvoice: 0, // 是否需要发票 0 4 - pack: 0, // 是否打包 0 1 + needInvoice: '', // 是否需要发票 0 4 + pack: '', // 是否打包 0 1 year: '', // 运行年份 }, selects: [ // 自定义选择框参数 @@ -45,6 +47,9 @@ Page({ changeTab(e){ this.data.index = e.currentTarget.dataset.index if(this.data.index === 0){ + this.setData({ + visible: true + }) this.setData({ data: [ { @@ -57,6 +62,9 @@ Page({ ] }) }else if(this.data.index === 1){ + this.setData({ + visible: true + }) this.setData({ data: [ { @@ -68,18 +76,29 @@ Page({ } ] }) + }else{ + this.setData({ + visibleDate: true + }) } - this.setData({ - visible: true - }) }, - // 关闭弹出层 + // 关闭发票和打包的弹出层 close() { this.setData({ visible: false }) }, + // 日期选中 + dateOk(value){ + this.data.pageNo = 1 + this.setData({ + "searchParams.year": value.detail, + visibleDate: false + }) + this.loadData() + }, ok(e){ + this.data.pageNo = 1 if(this.data.index === 0){ this.setData({ 'searchParams.needInvoice': e.detail @@ -89,8 +108,7 @@ Page({ 'searchParams.pack': e.detail }) } - // this.loadData() - console.log(this.data.searchParams) + this.loadData() }, // 项目详情 projectDetail(){ @@ -100,8 +118,19 @@ Page({ }, loadData(){ UserApi.projectList(this.data.searchParams).then(res=>{ - console.log(res) - + if(res.success){ + // 搜索时,把原数据清空,重新筛选 + if(this.data.pageNo === 1) { + this.setData({ + list: [] + }) + } + if(res.result.records && res.result.records.length){ + this.setData({ + list: [...this.data.list, ...res.result.records] + }) + } + } }).catch(err=>{ wx.showToast({ title: '加载失败', @@ -114,13 +143,13 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - // this.loadData() + this.loadData() }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { this.data.pageNo++ - // this.loadData() + this.loadData() }, }) \ No newline at end of file diff --git a/pages/project/project.json b/pages/project/project.json index bac8bb4..08ac634 100644 --- a/pages/project/project.json +++ b/pages/project/project.json @@ -1,6 +1,7 @@ { "navigationBarTitleText": "项目", "usingComponents": { - "popup": "../../components/popup/popup" + "popup": "../../components/popup/popup", + "dateMonth": "../../components/dateMonth/dateMonth" } } \ No newline at end of file diff --git a/pages/project/project.wxml b/pages/project/project.wxml index 3560161..4f55e6e 100644 --- a/pages/project/project.wxml +++ b/pages/project/project.wxml @@ -7,17 +7,21 @@ - + - 项目名称文字占位符项目名称文字占位符项目名称文字占位符 - 2021-12-12 + {{item.chargeUse_dictText}} + {{item.year}}年 - 需要发票 - 到账 - 开票 - 邮寄 + {{item.needInvoice === 0 ? '不需要发票' : '需要发票'}} + 到账 + 开票 + 邮寄 + + 暂无数据 + + diff --git a/pages/project/project.wxss b/pages/project/project.wxss index c249d29..809b31c 100644 --- a/pages/project/project.wxss +++ b/pages/project/project.wxss @@ -71,3 +71,9 @@ page { justify-content: space-between; align-items: center; } +.half{ + color: burlywood; +} +.all{ + color: #069F99; +} diff --git a/contractDetail/contractDetail.js b/pages/scanSign/scanSign.js similarity index 58% rename from contractDetail/contractDetail.js rename to pages/scanSign/scanSign.js index 3349a12..6a9270f 100644 --- a/contractDetail/contractDetail.js +++ b/pages/scanSign/scanSign.js @@ -1,13 +1,31 @@ -// pages/meeting/meeting.js +import UserApi from '../../assets/js/http/userApi' Page({ /** * 页面的初始数据 */ data: { - + isSigned: false, // 默认未报名 + meetingId: '', // 会议id + fileId: '', // 图片id + src: null // 签名之后,保存签名的图片地址 }, + // 去签到页 + scanSign(){ + wx.navigateTo({ + url: '../writtenSign/writtenSign', + }) + }, + // 确定签到 + sureSign(){ + }, + // 去报名 + goSignUp(){ + wx.navigateTo({ + url: 'url', + }) + }, /** * 生命周期函数--监听页面加载 */ @@ -26,7 +44,13 @@ Page({ * 生命周期函数--监听页面显示 */ onShow: function () { + let params = { + fileId: this.data.fileId, + meetingId: this.data.meetingId + } + // UserApi.scanCode(params).then(res=>{ + // }) }, /** @@ -63,4 +87,4 @@ Page({ onShareAppMessage: function () { } -}) \ No newline at end of file +}) diff --git a/pages/scanSign/scanSign.json b/pages/scanSign/scanSign.json new file mode 100644 index 0000000..75a11b2 --- /dev/null +++ b/pages/scanSign/scanSign.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "扫码签到", + "usingComponents": {} +} diff --git a/pages/scanSign/scanSign.wxml b/pages/scanSign/scanSign.wxml new file mode 100644 index 0000000..66122fc --- /dev/null +++ b/pages/scanSign/scanSign.wxml @@ -0,0 +1,48 @@ + + + 会议名称 + 会议名称会议名称 + + + 会议类型 + arff4ds8a3s6651 + + + 召开时间 + 找找 + + + + 参会单位 + 张三张三张三张三张三张三张三张三张三张三张三张三张三 + + + 参会人 + 500元 + + + 是否签到 + 500元 + + + 手动签到 + 签到 + + + + + 签到 + + + +、 + + + + 很抱歉,未查询到您的报名信息 + + + 去报名 + diff --git a/pages/scanSign/scanSign.wxss b/pages/scanSign/scanSign.wxss new file mode 100644 index 0000000..29462f6 --- /dev/null +++ b/pages/scanSign/scanSign.wxss @@ -0,0 +1,72 @@ +.basic-info .title{ + height: 40px; +} +.basic-info .title text{ + display: block; + border-left: 3px solid #069F99; + height: 14px; + padding-left: 10px; + border-radius: 2px; + display: flex; + justify-content: center; + align-items: center; + color: #333; + font-size: 15px; + font-weight: 500; +} +.basic-info view text:nth-child(1){ + flex-shrink: 0; + margin-right: 10px; +} +.basic-info view{ + background-color: #FFF; + padding: 15px; + height: 40px; + display: flex; + justify-content: space-between; + align-items: center; + color: #333; + font-size: 14px; + border-bottom: 0.5px solid #f5f5f5; + position: relative; +} +.basic-info view:last-child{ + border-bottom: 0; +} +.scanSign{ + padding: 0 15px; + margin: 10px 0; +} +.scanSign text{ + display: flex; + justify-content: center; + align-items: center; + height: 45px; + background-color: #069F99; + border-radius: 5px; + font-size: 13px; + color: #fff; +} +.imageBox { + border: 1px solid #dedede; + margin: 10px; + height: 160px +} +.imageBox image { + width: 100%; + height: 160px +} +.warning-text{ + margin-bottom: 10px; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + color: #999; + font-size: 12px; +} +.warning-text image{ + width: 100px; + height: 100px; + margin-bottom: 15px; +} diff --git a/pages/setPassword/setPassword.js b/pages/setPassword/setPassword.js index 075aab2..e9a56c2 100644 --- a/pages/setPassword/setPassword.js +++ b/pages/setPassword/setPassword.js @@ -6,16 +6,18 @@ Page({ * 页面的初始数据 */ data: { - newPassword: '', - verifyPassword: '', + password: '', // token + newPassword: '', // 密码 + verifyPassword: '', // 确认密码 rsaPublicKey: '', flag: false }, bindBlurInput(e){ - + }, // 登录 formSubmit(e) { + const that = this if(!e.detail.value.newPassword){ this.data.flag = false wx.showToast({ @@ -68,6 +70,7 @@ Page({ } if (this.data.flag) { let params = { + password: this.data.password, newPassword: encrypt(this.data.rsaPublicKey, e.detail.value.newPassword), verifyPassword: encrypt(this.data.rsaPublicKey, e.detail.value.verifyPassword), rsaPublicKey: this.data.rsaPublicKey @@ -76,7 +79,11 @@ Page({ UserApi.setPassword(params).then(res => { if (res.success) { // 成功设置密码,跳转首页 - wx.navigateTo({ + wx.setStorage({ + key: 'X-Access-Token', + data: that.data.password + }) + wx.switchTab({ url: '../home/home', }) } else { @@ -90,19 +97,6 @@ Page({ // 登录失败 } }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, /** * 生命周期函数--监听页面显示 @@ -115,45 +109,16 @@ Page({ that.setData({ rsaPublicKey: res.data }) - }, - fail: function(){ - // 缓存中没有登录过默认app.json的登录页 } }) - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - + wx.getStorage({ + key: 'token-temp', + success (res) { + that.setData({ + password: res.data + }) + console.log(that.data.password) + } + }) } -}) \ No newline at end of file +}) diff --git a/pages/upDateInfo/upDateInfo.js b/pages/upDateInfo/upDateInfo.js index d7e59ac..af7838b 100644 --- a/pages/upDateInfo/upDateInfo.js +++ b/pages/upDateInfo/upDateInfo.js @@ -1,7 +1,7 @@ // pages/meeting/meeting.js import UserApi from '../../assets/js/http/userApi' import { encrypt } from '../../assets/js/jsencrypt/rsa' -var countdown = 60; // 倒计时秒数 +// var countdown = 60; // 倒计时秒数 Page({ @@ -10,79 +10,114 @@ Page({ */ data: { form: { - phone: '', // 手机号 - verifyCode: '', // 验证码 - newPassword: '', // 新密码 - verifyPassword: '', // 确认密码 - count: 60, // 倒计时秒 + oldpassword: '', // 旧密码 + password: '', // 新密码 + confirmpassword: '', // 确认新密码 + // count: 60, // 倒计时秒 rsaPublicKey: '', // 公钥 }, - showGetCaptcha: true - }, - bindInputPhone(e) { - this.setData({ - "form.phone": e.detail.value - }) - }, - // 获取验证码 - getVerCode() { - if (/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.data.form.phone)) { - UserApi.sendCode({ - phone: this.data.form.phone - }).then(res => { - // 获取成功,倒计时 start - if (res.success) { - this.countDown() - } else { - wx.showToast({ - title: '获取验证码失败', - icon: 'error', - duration: 2000 - }) - } - }) - } else { - wx.showToast({ - title: '请输入正确的手机号', - icon: 'none', - duration: 2000 - }) - } + // showGetCaptcha: true }, + + // // 获取验证码 + // getVerCode() { + // if (/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.data.form.phone)) { + // UserApi.sendCode({ + // phone: this.data.form.phone + // }).then(res => { + // // 获取成功,倒计时 start + // if (res.success) { + // this.countDown() + // } else { + // wx.showToast({ + // title: '获取验证码失败', + // icon: 'error', + // duration: 2000 + // }) + // } + // }) + // } else { + // wx.showToast({ + // title: '请输入正确的手机号', + // icon: 'none', + // duration: 2000 + // }) + // } + // }, // 倒计时 - countDown() { - if (countdown === 0) { - this.setData({ - showGetCaptcha: true - }) - countdown = 60; - return; - } else { - this.setData({ - showGetCaptcha: false - }) - countdown--; - this.setData({ - count: countdown - }) - } - setTimeout(() => { - this.countDown() - }, 1000) - // 倒计时 end - }, + // countDown() { + // if (countdown === 0) { + // this.setData({ + // showGetCaptcha: true + // }) + // countdown = 60; + // return; + // } else { + // this.setData({ + // showGetCaptcha: false + // }) + // countdown--; + // this.setData({ + // count: countdown + // }) + // } + // setTimeout(() => { + // this.countDown() + // }, 1000) + // // 倒计时 end + // }, // 提交 formSubmit(e) { - if(!e.detail.value.newPassword){ + if(!e.detail.value.oldpassword){ this.data.flag = false wx.showToast({ - title: '请输入密码', + title: '请输入旧密码', icon: 'none' }) return } else { let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/ - if(!pattern.test(e.detail.value.newPassword)){ + if(!pattern.test(e.detail.value.oldpassword)){ + wx.showToast({ + title: '旧密码由8位数字、大小写字母和特殊符号组成!!', + icon: 'none' + }) + this.data.flag = false + return + } else { + this.data.flag = true + } + } + if(!e.detail.value.password){ + this.data.flag = false + wx.showToast({ + title: '请输入新密码', + icon: 'none' + }) + return + } else { + let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/ + if(!pattern.test(e.detail.value.password)){ + wx.showToast({ + title: '新密码由8位数字、大小写字母和特殊符号组成!!', + icon: 'none' + }) + this.data.flag = false + return + } else { + this.data.flag = true + } + } + if(!e.detail.value.confirmpassword){ + this.data.flag = false + wx.showToast({ + title: '请输入确认新密码', + icon: 'none' + }) + return + } else { + let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/ + if(!pattern.test(e.detail.value.confirmpassword)){ wx.showToast({ title: '密码由8位数字、大小写字母和特殊符号组成!!', icon: 'none' @@ -93,27 +128,7 @@ Page({ this.data.flag = true } } - if(!e.detail.value.verifyPassword){ - this.data.flag = false - wx.showToast({ - title: '请输入确认密码', - icon: 'none' - }) - return - } else { - let pattern = /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/ - if(!pattern.test(e.detail.value.verifyPassword)){ - wx.showToast({ - title: '密码由8位数字、大小写字母和特殊符号组成!!', - icon: 'none' - }) - this.data.flag = false - return - } else { - this.data.flag = true - } - } - if(e.detail.value.newPassword === e.detail.value.verifyPassword) { + if(e.detail.value.password === e.detail.value.confirmpassword) { this.data.flag = true } else { this.data.flag = false @@ -125,10 +140,9 @@ Page({ } console.log('form发生了submit事件,携带数据为:', e.detail.value) let params = { - phone: encrypt(this.data.rsaPublicKey, e.detail.value.phone), - newPassword: encrypt(this.data.rsaPublicKey, e.detail.value.newPassword), - verifyPassword: encrypt(this.data.rsaPublicKey, e.detail.value.verifyPassword), - verifyCode: e.detail.value.verifyCode, + password: encrypt(this.data.rsaPublicKey, e.detail.value.oldpassword), + newPassword: encrypt(this.data.rsaPublicKey, e.detail.value.password), + verifyPassword: encrypt(this.data.rsaPublicKey, e.detail.value.confirmpassword), rsaPublicKey: this.data.rsaPublicKey, } console.log(params) @@ -150,7 +164,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - + }, /** @@ -172,9 +186,9 @@ Page({ rsaPublicKey: res.data }) }, - fail: function(){ + fail: function(){ // 缓存中没有登录过默认app.json的登录页 } }) } -}) \ No newline at end of file +}) diff --git a/pages/upDateInfo/upDateInfo.wxml b/pages/upDateInfo/upDateInfo.wxml index c6039bd..e1a9482 100644 --- a/pages/upDateInfo/upDateInfo.wxml +++ b/pages/upDateInfo/upDateInfo.wxml @@ -2,29 +2,29 @@
- 手机号 + 旧密码 - + - + - 密码 + 新密码 - + - 确认密码 + 确认新密码 - + diff --git a/pages/upDateInfo/upDateInfo.wxss b/pages/upDateInfo/upDateInfo.wxss index 3c2b3ac..f18450f 100644 --- a/pages/upDateInfo/upDateInfo.wxss +++ b/pages/upDateInfo/upDateInfo.wxss @@ -1,4 +1,7 @@ /* pages/meeting/meeting.wxss */ .form-box{ transform: translateY(110pt); -} \ No newline at end of file +} +.text-label { + width: 80px !important; +} diff --git a/pages/writtenSign/writtenSign.js b/pages/writtenSign/writtenSign.js new file mode 100644 index 0000000..bb26f93 --- /dev/null +++ b/pages/writtenSign/writtenSign.js @@ -0,0 +1,86 @@ +import Api from '../../assets/js/http/api' +Page({ + data: { + context1: null, + hasDraw:false, //默认没有画 + id: '', + }, + onLoad: function() { + var context1 = wx.createCanvasContext('handWriting1'); + context1.setStrokeStyle("#000000") // 画笔的颜色 + context1.setLineWidth(3); // 画笔的线条宽度 + this.setData({ + context1: context1, + }) + }, + touchstart1: function(e) { + var context1 = this.data.context1; + context1.moveTo(e.touches[0].x, e.touches[0].y); // 把画笔的开始点移到当前触摸点 + this.setData({ + // context1: context1, + hasDraw : true, //要签字了 + }); + }, + touchmove1: function(e) { + var x = e.touches[0].x; + var y = e.touches[0].y; + var context1 = this.data.context1; + context1.setLineWidth(3); + context1.lineTo(x, y); // 移动绘制的点(关键步骤) + context1.stroke(); // 画出当前路径的边框====创建线条 + context1.setLineCap('round'); // 设置线条的端点样式 + context1.draw(true); // 将之前在绘图上下文中的描述(路径、变形、样式)画到 canvas 中 + context1.moveTo(x, y); // 把路径移动到画布中的指定点,不创建线条 + }, + reSign1: function() { //重新画 + var that = this; + var context1 = that.data.context1; + context1.draw(); //清空画布 + that.setData({ + hasDraw: false, //没有画 + src: null + }); + }, + sign1ok: function () { + const that = this; + if(!that.data.hasDraw){ + console.log("签字是空白的 没有签字") + }else{ + var context1 = that.data.context1; + context1.draw(true, wx.canvasToTempFilePath({ // 把当前画布指定区域的内容导出生成指定大小的图片。在 draw() 回调里调用该方法才能保证图片导出成功 + canvasId: 'handWriting1', + success(res) { // 完成签字 + //得到了图片 上传到服务器 + wx.uploadFile({ + url: Api.baseUrl + Api.URL_CONFIG + "/sys/common/upload", + filePath: res.tempFilePath, + name: "file", + formData: { + filetype: "image", + }, + success: function (result) { + let data = JSON.parse(result.data) + that.setData({ + id: data.result.id + }) + let pages = getCurrentPages(); + let prevPage = pages[pages.length - 2]; + //将数值信息赋值给上一页面id变量 + prevPage.setData({ + fileId: data.result.id + }); + wx.navigateBack({ + delta: 1, + }) + }, + fail: function(err){ + wx.showToast({ + title: '上传失败', + }) + } + }) + } + })) + } + }, +}); diff --git a/contractDetail/contractDetail.json b/pages/writtenSign/writtenSign.json similarity index 92% rename from contractDetail/contractDetail.json rename to pages/writtenSign/writtenSign.json index 8835af0..a97367d 100644 --- a/contractDetail/contractDetail.json +++ b/pages/writtenSign/writtenSign.json @@ -1,3 +1,3 @@ { "usingComponents": {} -} \ No newline at end of file +} diff --git a/pages/writtenSign/writtenSign.wxml b/pages/writtenSign/writtenSign.wxml new file mode 100644 index 0000000..dbda11c --- /dev/null +++ b/pages/writtenSign/writtenSign.wxml @@ -0,0 +1,16 @@ + + + 参会人签字 + + + + + + + + + + + diff --git a/pages/writtenSign/writtenSign.wxss b/pages/writtenSign/writtenSign.wxss new file mode 100644 index 0000000..3b35e67 --- /dev/null +++ b/pages/writtenSign/writtenSign.wxss @@ -0,0 +1,38 @@ +.paper { + border: 1px solid #dedede; + margin: 10px; + height: 160px +} + +.imageBox { + border: 1px solid #dedede; + margin: 10px; + height: 160px +} + +.signBtn { + display: flex; + margin-top: 20px; +} + +.signTitle { + text-align: center; + font-size: 1.2em; + margin: 10px auto; +} + +.handWriting { + width: 100%; + height: 100%; +} + +.imageBox image { + width: 100%; + height: 160px +} +button[type='primary']{ + background-color: #069F99 !important; +} +button[type='warn']{ + color: #999 !important; +}