From 52d1a09a57321f013a4e7102cc545f8936126a0b Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Fri, 7 Feb 2025 13:13:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api.js | 10 +- api/http.js | 12 +- api/model/contact.js | 49 ++++++- components/canvas-drag/index.vue | 18 ++- components/list/bossList/index.vue | 3 + components/list/userList/index.vue | 6 +- components/list/userList/userItem.vue | 3 +- components/list/userList/userListSwipe.vue | 2 + components/list/workList/index.vue | 3 +- components/list/workList/workItem.vue | 3 +- components/list/workList/workListSwipe.vue | 5 +- doc/5284.png_860.psd | Bin 0 -> 906634 bytes doc/j.psd | Bin 0 -> 695169 bytes pages/index/center.vue | 2 +- pages/index/index.vue | 2 +- pages_order/auth/certification.vue | 1 + pages_order/contract/contractManage.vue | 27 +++- pages_order/contract/contractManageEdit.vue | 211 +++++++++++++++++++++++----- pages_order/mine/collect.vue | 18 ++- pages_order/mine/seeMy.vue | 8 +- pages_order/static/contract/j.png | Bin 0 -> 86819 bytes pages_order/static/contract/jf.png | Bin 0 -> 101594 bytes pages_order/static/contract/yf.png | Bin 0 -> 102265 bytes utils/utils.js | 25 ++++ utils/wxBase64src.js | 29 ++++ 25 files changed, 374 insertions(+), 63 deletions(-) create mode 100644 doc/5284.png_860.psd create mode 100644 doc/j.psd create mode 100644 pages_order/static/contract/j.png create mode 100644 pages_order/static/contract/jf.png create mode 100644 pages_order/static/contract/yf.png create mode 100644 utils/wxBase64src.js diff --git a/api/api.js b/api/api.js index 8e4810f..61086ff 100644 --- a/api/api.js +++ b/api/api.js @@ -123,7 +123,7 @@ export function api(key, data, callback, loadingTitle) { if (!req) { console.error('无效key' + key); - return + return Promise.reject() } if (typeof callback == 'string') { @@ -140,7 +140,7 @@ export function api(key, data, callback, loadingTitle) { let storageKey = req.url let storage = limit[storageKey] if (storage && new Date().getTime() - storage < req.limit) { - return + return Promise.reject() } limit[storageKey] = new Date().getTime() } @@ -150,7 +150,7 @@ export function api(key, data, callback, loadingTitle) { if (!uni.getStorageSync('token')) { utils.toLogin() console.error('需要登录') - return + return Promise.reject() } } @@ -174,10 +174,10 @@ export function api(key, data, callback, loadingTitle) { loadingTitle || req.showLoading, loadingTitle || req.loadingTitle) }, req.debounce) - return + return Promise.reject() } - http.http(req.url, data, callback, req.method, + return http.http(req.url, data, callback, req.method, loadingTitle || req.showLoading, loadingTitle || req.loadingTitle) } diff --git a/api/http.js b/api/http.js index 3c18457..af88d0c 100644 --- a/api/http.js +++ b/api/http.js @@ -10,6 +10,12 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { title: title || '加载中...' }); } + let reject, resolve; + + let promise = new Promise((res, rej) => { + reject = rej + resolve = res + }) uni.request({ url: Vue.prototype.$config.baseUrl + uri, @@ -42,10 +48,12 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { }); } - callback(res.data) + callback && callback(res.data) + resolve(res.data) }, fail: () => { + reject() uni.showLoading({}) setTimeout(()=>{ uni.hideLoading() @@ -57,6 +65,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) { } } }); + + return promise } function deleted(uri, data, callback) { diff --git a/api/model/contact.js b/api/model/contact.js index 4c5b3b9..74fbdc5 100644 --- a/api/model/contact.js +++ b/api/model/contact.js @@ -33,13 +33,60 @@ const api = { method: 'GET', auth: true, }, - //电子合同-根据id查询电子合同详情 queryContracById: { url: '/employ/contract/queryContracById', method: 'GET', auth: true, }, + //电子合同-修改 + updateContract: { + url: '/employ/contract/updateContract', + method: 'POST', + auth: true, + }, + //电子合同-添加 + addContract: { + url: '/employ/contract/addContract', + method: 'POST', + auth: true, + }, + //电子合同模板-列表 + queryContractTemplateList: { + url: '/employ/contract/queryContractTemplateList', + method: 'GET', + auth: true, + }, + //电子合同模板-添加 + addContractTemplate: { + url: '/employ/contract/addContractTemplate', + method: 'POST', + auth: true, + }, + //电子合同模板-详情 + queryContractTemplateById: { + url: '/employ/contract/queryContractTemplateById', + method: 'GET', + auth: true, + }, + //电子合同模板-修改 + updateContractTemplate: { + url: '/employ/contract/updateContractTemplate', + method: 'POST', + auth: true, + }, + //工具-图片转pdf + image2pdf: { + url: '/employ/contract/image2pdf', + method: 'GET', + auth: true, + }, + //工具-pdf转图片base64 + pdf2imagebase64: { + url: '/employ/contract/pdf2imagebase64', + method: 'GET', + auth: true, + }, } diff --git a/components/canvas-drag/index.vue b/components/canvas-drag/index.vue index ee4f09b..4f3394c 100644 --- a/components/canvas-drag/index.vue +++ b/components/canvas-drag/index.vue @@ -10,12 +10,13 @@ let DRAG_ICON = '/static/components/canvas-drag/scale.png'; // 缩放按钮 // 缩放按钮 const STROKE_COLOR = 'red'; - const ROTATE_ENABLED = true; + const ROTATE_ENABLED = false; let isMove = false; // 标识触摸后是否有移动,用来判断是否需要增加操作历史 // 标识触摸后是否有移动,用来判断是否需要增加操作历史 const DEBUG_MODE = false; // 打开调试后会渲染操作区域边框(无背景时有效) // 打开调试后会渲染操作区域边框(无背景时有效) const dragGraph = function({ + id, x = 30, y = 30, w, @@ -44,7 +45,8 @@ this.w = w; this.h = h; } - + + this.id = id this.x = x; this.y = y; // 4个顶点坐标 this.permitSelected = permitSelected; // 4个顶点坐标 @@ -906,15 +908,21 @@ emitDrawArrChange(){ - let arr = this.drawArr.map(item => { - return { + let map = {} + + let arr = this.drawArr.map((item, index) => { + let p = { x : item.x, y : item.y, w : item.w, h : item.h, + id : item.id || index, } + map[p.id] = p + return p }) - this.$emit('onDrawArrChange', arr) + + this.$emit('onDrawArrChange', map) }, exportFun() { diff --git a/components/list/bossList/index.vue b/components/list/bossList/index.vue index 564de08..f218ec8 100644 --- a/components/list/bossList/index.vue +++ b/components/list/bossList/index.vue @@ -51,6 +51,9 @@ if(res.code == 200){ this.list = res.result.records || res.result this.total = res.result.total || res.result.length + this.$emit('total', this.total) + }else{ + this.$emit('total', 0) } }) }, diff --git a/components/list/userList/index.vue b/components/list/userList/index.vue index 0734aed..cec956f 100644 --- a/components/list/userList/index.vue +++ b/components/list/userList/index.vue @@ -5,7 +5,8 @@ @scrolltolower="loadMoreData"> - + diff --git a/components/list/userList/userListSwipe.vue b/components/list/userList/userListSwipe.vue index 2100c9d..3c67978 100644 --- a/components/list/userList/userListSwipe.vue +++ b/components/list/userList/userListSwipe.vue @@ -9,6 +9,8 @@ @click="e => clickSwipeAction(e, item)" :options="options"> diff --git a/components/list/workList/index.vue b/components/list/workList/index.vue index 9b20c11..ac41135 100644 --- a/components/list/workList/index.vue +++ b/components/list/workList/index.vue @@ -5,7 +5,8 @@ @scrolltolower="loadMoreData"> diff --git a/components/list/workList/workItem.vue b/components/list/workList/workItem.vue index 66a5b8e..fff3312 100644 --- a/components/list/workList/workItem.vue +++ b/components/list/workList/workItem.vue @@ -1,5 +1,6 @@