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 0000000..cd41438 Binary files /dev/null and b/subpages/images/md-error.png differ diff --git a/subpages/images/ze-checked.png b/subpages/images/ze-checked.png new file mode 100644 index 0000000..636dc1a Binary files /dev/null and b/subpages/images/ze-checked.png differ 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) }