From c1e7e0ad1f62391cbd2660b3a8de70e6f757d26e Mon Sep 17 00:00:00 2001 From: wangyx <2838268875@qq.com> Date: Tue, 27 May 2025 10:16:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=88=BF=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.wxss | 3 + pages/index/index.js | 1 + project.private.config.json | 7 + subpages/OCRCard/pages/confirm/confirm.wxss | 5 +- subpages/images/md-error.png | Bin 0 -> 730 bytes subpages/images/ze-checked.png | Bin 0 -> 885 bytes subpages/index/checkOutConfirm/index/index.js | 257 +++++++++++++----- .../index/checkOutConfirm/index/index.json | 5 +- .../index/checkOutConfirm/index/index.wxml | 93 ++++++- .../index/checkOutConfirm/index/index.wxss | 120 +++++++- subpages/index/checkOutConfirm/sign/sign.js | 6 +- 11 files changed, 423 insertions(+), 74 deletions(-) create mode 100644 subpages/images/md-error.png create mode 100644 subpages/images/ze-checked.png diff --git a/app.wxss b/app.wxss index d723f07..333dea5 100644 --- a/app.wxss +++ b/app.wxss @@ -37,6 +37,9 @@ page{ .flex-wrap{ flex-wrap: wrap; } +.flex-x-end{ + justify-content: flex-end; +} .card{ background-color: #fff; border-radius: 20rpx; diff --git a/pages/index/index.js b/pages/index/index.js index c1e5277..04ab3b4 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -23,6 +23,7 @@ Page({ }, { name: "退房确认", + url: "/subpages/index/checkOutConfirm/index/index", }, { name: "续期申请", diff --git a/project.private.config.json b/project.private.config.json index b260d13..44cd6ff 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -14,6 +14,13 @@ "condition": { "miniprogram": { "list": [ + { + "name": "subpages/index/checkOutConfirm/index/index", + "pathName": "subpages/index/checkOutConfirm/index/index", + "query": "", + "launchMode": "default", + "scene": null + }, { "name": "subpages/index/checkOutConfirm/sign/sign", "pathName": "subpages/index/checkOutConfirm/sign/sign", diff --git a/subpages/OCRCard/pages/confirm/confirm.wxss b/subpages/OCRCard/pages/confirm/confirm.wxss index 2394f95..b9fd4d6 100644 --- a/subpages/OCRCard/pages/confirm/confirm.wxss +++ b/subpages/OCRCard/pages/confirm/confirm.wxss @@ -40,7 +40,4 @@ page { width: calc(100% - 10rpx); height: 80rpx; margin: auto; -} -.van-cell{ - /* line-height: 54rpx !important; */ -} +} \ No newline at end of file diff --git a/subpages/images/md-error.png b/subpages/images/md-error.png new file mode 100644 index 0000000000000000000000000000000000000000..cd41438a790044eaaf50a91c247009ddf1bb2aa0 GIT binary patch literal 730 zcmV<00ww*4P)Px%lu1NER9HvtnOkleF%*XXgNNtR9nck&9fYhP=?a?cfV@^9A%Xgu>>yzWlNF@d zLAruw3GfWYl|3e5W;~3qk%+LAhe)>P^YQO!X8d&`54$#>?0qEIoZaHs>ZRebRuU~BDTLFs+yMn-N0@xkn5`-I?@rO3( zR$vV)^_qSVuG^pw0wF2- z9zfsS_rQYY+~|pnz}nAB>v{}2r}^fOTqwrb5D?O{xR1ihwE$xV9y9q7&!7+q7|3bP ze^gIe0}ivU+&&sGknyioE!TkypBv!DA_5!SoC#PaDHrad+pUNS{75riN~-F>ViTv3cBd_NIicP^a|U~@K6`%b2U=cep^tM@ibP74SYdyYntq36Ee3)VUMyWZ|lfRR4{$;^%_4 zN?Sq#IT+7fELux9LmZ}2>#E9lAG@|ytnUO_I2MG^5xBvhE M07*qoM6N<$g0K`$cK`qY literal 0 HcmV?d00001 diff --git a/subpages/images/ze-checked.png b/subpages/images/ze-checked.png new file mode 100644 index 0000000000000000000000000000000000000000..636dc1a725672ed7e35752f298bab5c5bf25c63f GIT binary patch literal 885 zcmV-*1B(2KP)Px&FG)l}R9HvNn9Wt&KoH0OvnIL52b7m1R1hctqf}t2f|v?oDhR0nQvs#|$rZ#l z1;nW!Mt`Y^CZd$s$UnVtX4F5#6AdgXkm1^B@+4<3c=GSDWV z4d$cJU~$L9cLew?DMo+n@m*C%lm=`&W_wS_FT}6_L_mex&zRuuNpVvaRvRz@)`#*| zwc#^iu$1D;x5vKD5?X-!j%gA}rv_M>#V6*od;8Wcf-D3yoRc1iu8S6`^gp5Rb*ER` zzTFCFxTn_u_bP3!{Sgg4YjT!1Jr{7No=ed%^ZA2)JII2}1dPtycWoy$Fp-$;tTVX* zsIv79$zKg7gf70nU~!nv?hU~APUnINUv*b)avm|h-P_ZParOr#+7GJRWS(08ld5Jev~L*m7*JGY!t1(8H>z3YkIr^7!>|6Id(D_ z{F}ICdG>f_IOY*ZD)G;(j;M0B|eIu+6-L{DXC1g9h{x1J|;aRs=m z^OxLA2QD~wiELg08ct^j!siA(I0p+;g;cGn3#aBPk3ZN`)y_R7i81Po!8k1doP*&O z8bX*Xq_ASqEnPMV6R$fpO9RH`DDZ~hA(%g=4N8k`X}FLo15hi(>zzlGSW5Zd0hluj z>%kt6W9Uk7c_G$Ml66QWPZF~C4`Pt4qsFLn3C2or%be}ZBq<{^404xDXL)UV-99o? zW-18vY{BAF8nP~&@^q$92U0LPon;;TE#X-~hNX)yYj@y8KfUf`RbiTF7G^^5g_NX{ zMfVz-Z}YZhAquk+R+W`6GLqrl=w{Rp`q|t(e__L_wv5^!^;GfPUYsvj92B#qh#JZVO_tvj@y9 zD;4Y#kCp(nC2&L{ya=&`ukO7P?C+uFmW4|0Roa7fC8g~5uO9F}94EFo3xetJ00000 LNkvXXu0mjfr3{&0 literal 0 HcmV?d00001 diff --git a/subpages/index/checkOutConfirm/index/index.js b/subpages/index/checkOutConfirm/index/index.js index ee42168..f12bd74 100644 --- a/subpages/index/checkOutConfirm/index/index.js +++ b/subpages/index/checkOutConfirm/index/index.js @@ -1,66 +1,195 @@ // subpages/index/checkOutConfirm/index/index.js Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad(options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } -}) \ No newline at end of file + /** + * 页面的初始数据 + */ + data: { + deviceCheckList: new Array(8).fill(0), + toView: "item5", + mediaList: [ + { type: "image", src: "https://img.yzcdn.cn/vant/cat.jpeg" }, + { + type: "video", + src: "https://cdn.uviewui.com/uview/resources/video.mp4", + }, + { type: "image", src: "https://img.yzcdn.cn/vant/cat.jpeg" }, + ], + signImgSrc: "", // 签名图片路径 + canvasName: 'myCanvas', + ctx: '', + canvas: '', + canvasWidth: 0, + canvasHeight: 0, + }, + scrollToView: function () { + this.setData({ + toView: "item1", + }); + }, + gotoSign: function () { + wx.navigateTo({ + url: "/subpages/index/checkOutConfirm/sign/sign", + }); + }, + captureScrollArea() { + const query = wx.createSelectorQuery() + query.select("#contentTitle").boundingClientRect(); + query.select("#contentTitle").scrollOffset(); + + query.exec((res) => { + console.log('res',res) + const scrollArea = res[0] + const scrollOffset = res[1] + const { width, height } = scrollArea + + // 设置 canvas 尺寸 + this.setData({ + canvasWidth: width, + canvasHeight: height + }) + + const ctx = wx.createCanvasContext('myCanvas') + + // 绘制滚动区域内容到 canvas + ctx.drawImage(scrollArea.node, 0, 0, width, height) +console.log('area',scrollArea.node); + ctx.draw(false, () => { + // 生成图片 + wx.canvasToTempFilePath({ + canvasId: 'myCanvas', + success: (res) => { + console.log('截图路径:', res) + // 可以在这里处理截图,如保存到相册等 + }, + fail: (err) => { + console.error('截图失败:', err) + } + }) + }) + }) + }, + submit: function () { +// this.captureScrollArea() + wx.createSelectorQuery() + .select('#contentTitle') + .fields({ node: true, size: true }) + .exec(async res => { + const { posterSize } = this.data + wx.showLoading({ + title: '海报生成中', + mask: false, + }); + // Canvas 对象 + console.log('resq1',res); + const canvas = res[0].node + // Canvas 画布的实际绘制宽高 + const renderWidth = 300 * posterSize + const renderHeight = 4000 * posterSize + // Canvas 绘制上下文 + const ctx = canvas.getContext('2d') + + // 初始化画布大小 + const dpr = wx.getWindowInfo().pixelRatio + canvas.width = renderWidth * dpr + canvas.height = renderHeight * dpr + ctx.scale(dpr, dpr) + + // 插入直播间分享图 + await this.createdImg(canvas, ctx, 'https://resurl.fuchuang.com/aef734b0-0b5b-11ee-b3ac-abf6790ece2d-juxingbeifen%402x.png', [0, 0, 300, 240]); + + // 画个圆形将超出圆形部分的图片裁剪为圆形一样大 + // 保存当前 Canvas 画布状态 + ctx.save() + // 先画圆形 + ctx.beginPath(); + ctx.arc(235 * posterSize, 340 * posterSize, 48 * posterSize, 0, 2 * Math.PI * posterSize); + // 设置绘制圆形边框的颜色 + ctx.strokeStyle = '#ffffff'; + // 绘制圆形边框 + ctx.stroke(); + ctx.fillStyle = "#ffffff" + ctx.fill(); + // 插入小程序二维码 + ctx.clip() + await this.createdImg(canvas, ctx, 'https://wx.qlogo.cn/mmhead/Q3auHgzwzM7obwOicODY0ZfvZdp5VOoVLTxY0hibU7tq1UkFUUE7sC3Q/0', [200, 305, 70, 70]); + // 恢复到保存时的状态 + ctx.restore() + + ctx.fillStyle = '#333333'; + ctx.font = `bold ${16 * posterSize}px 苹方-简 中粗体`; + + + // 把当前画布指定区域的内容导出生成指定大小的图片 + wx.canvasToTempFilePath({ + canvas: canvas, + success: (res) => { + // 分享给朋友 + console.log('res',res); + wx.showShareImageMenu({ + path: res.tempFilePath, + success: (resShare) => { + console.log('showShareImageMenu调用成功:', resShare); + }, + fail: (err) => { + console.log('showShareImageMenu调用失败:', err); + } + }); + }, + fail: (err) => { + console.log('canvasToTempFilePath调用失败:', err); + }, + complete: () => { + wx.hideLoading(); + }, + }); + }) + + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + const imgSrc = decodeURIComponent(options.imgSrc); + console.log("接收到的签名图片地址:", imgSrc); + this.setData({ + signImgSrc: imgSrc, + }); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {}, +}); diff --git a/subpages/index/checkOutConfirm/index/index.json b/subpages/index/checkOutConfirm/index/index.json index 3e703bb..070eb88 100644 --- a/subpages/index/checkOutConfirm/index/index.json +++ b/subpages/index/checkOutConfirm/index/index.json @@ -6,6 +6,9 @@ "van-button": "@vant/weapp/button/index", "van-tab": "@vant/weapp/tab/index", "van-tabs": "@vant/weapp/tabs/index", - "van-divider": "@vant/weapp/divider/index" + "van-divider": "@vant/weapp/divider/index", + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index", + "van-icon": "@vant/weapp/icon/index" } } \ No newline at end of file diff --git a/subpages/index/checkOutConfirm/index/index.wxml b/subpages/index/checkOutConfirm/index/index.wxml index 2a83026..25cc454 100644 --- a/subpages/index/checkOutConfirm/index/index.wxml +++ b/subpages/index/checkOutConfirm/index/index.wxml @@ -1,2 +1,91 @@ - - \ No newline at end of file + + + + + + + + + + 国信棠樾云邸 三居室 + 1号楼2单元201 南卧1 + + + + + 居住人 + 王女士 + + + 联系电话 + 159****5678 + + + 居住日期 + 2025-05-26至2025-08-08 + + + + + + + + + + + + 完好 + + + + + + + + + + 所有设施完好,正常退房。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 请在以下区域手写签字 + + + + + 在此区域手写签字 + + + + + 提交 + + + + + \ No newline at end of file diff --git a/subpages/index/checkOutConfirm/index/index.wxss b/subpages/index/checkOutConfirm/index/index.wxss index 835a8a4..a01b867 100644 --- a/subpages/index/checkOutConfirm/index/index.wxss +++ b/subpages/index/checkOutConfirm/index/index.wxss @@ -1 +1,119 @@ -/* subpages/index/checkOutConfirm/index/index.wxss */ \ No newline at end of file +/* subpages/index/checkOutConfirm/index/index.wxss */ +.content { + background: #f8f8f8; +} + +.content-title { + position: relative; +} + +.content-title scroll-view { + height: calc(100vh + 80vh); +} + + + +.info { + background: #ffffff; + border-radius: 20rpx; + padding: 32rpx; + position: relative; + top: -30rpx; + z-index: 1; +} + +.title { + color: #000000; + font-size: 32rpx; + font-weight: bold; +} + +.des { + font-size: 28rpx; + line-height: 60rpx; +} + +.item-des { + color: #A9AFBA; + font-size: 30rpx; +} + +.name { + color: #000; + margin-left: 38rpx; +} + +.tit { + line-height: 50rpx; +} + +.checkstatus { + color: #101010; + font-size: 28rpx; + margin-left: 20rpx; +} +.media-item { + width: calc((100% / 3) - 20rpx); + margin-left: 20rpx; + margin-bottom: 20rpx; +} +.media-item video{ + height: 160rpx; + width: 236rpx; +} + +.media-item:nth-child(3n) { +} + +.bottom { + background: #ffffff; + +} + +.fixed-bottom { + position: fixed; + bottom: 0; + left: 0; + right: 0; + background-color: white; + z-index: 100; + margin: 0 30rpx; +} + +.sign { + margin: 34rpx; + +} + +.sign-title { + color: rgba(0, 0, 0, 1); + font-size: 32rpx; + margin-bottom: 30rpx; +} + +.sign-ara { + width: 630rpx; + height: 200rpx; + background-color: rgba(232, 233, 234, 1); +} + +.sign-img{ + width: 100%; + height: 100%; + +} + +.sign-txt { + color: rgba(187, 187, 187, 1); + font-size: 32rpx; + text-align: center; +} + +.btn { + + max-width: 440rpx; + width: calc(100% - 10rpx); + height: 80rpx; + margin: auto; + margin-top: 60rpx; +} \ No newline at end of file diff --git a/subpages/index/checkOutConfirm/sign/sign.js b/subpages/index/checkOutConfirm/sign/sign.js index 1be4ae1..d560f31 100644 --- a/subpages/index/checkOutConfirm/sign/sign.js +++ b/subpages/index/checkOutConfirm/sign/sign.js @@ -437,8 +437,10 @@ Page({ setTimeout(function () { wx.hideLoading() wx.navigateTo({ - url: '/subpages/index/checkOutConfirm/index/index', - }) + url: `/subpages/index/checkOutConfirm/index/index?imgSrc=${encodeURIComponent( + imgSrc + )}` + }); }, 1500) }