From d5f2104fbbb97be040d19220b756a90352e46360 Mon Sep 17 00:00:00 2001 From: lym <16170814@qq.com> Date: Mon, 23 Mar 2026 18:13:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B6=E9=83=A8ui=E5=89=8D?= =?UTF-8?q?=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/details/index.js | 44 ++++++++++++++++++++++++++++++++++++- pages/detailsPoint/index.js | 1 + pages/mybusiness/index.js | 42 ++++++++++++++++++++++++++++++----- pages/mytgm/index.js | 43 +++++++++++++++++++++++++++++++----- 4 files changed, 117 insertions(+), 13 deletions(-) diff --git a/pages/details/index.js b/pages/details/index.js index 7b00272..3563289 100644 --- a/pages/details/index.js +++ b/pages/details/index.js @@ -456,7 +456,21 @@ Page({ url: "../login/index" }) return; - }else{ + } + if(that.data.fromHot != 1){ + + var userInfo = userInfodata ? JSON.parse(userInfodata) : null + if(!userInfo || !userInfo.iLevel || parseInt(userInfo.iLevel) < 2){ + wx.showToast({ + title: "会员等级不够", + icon: "none", + duration: 2000 + }) + return + } + } + + if(userId&&LoginId){ var userInfo = userInfodata ? JSON.parse(userInfodata) : null; if(userInfo && userInfo.Phone==""&&userInfo.FHEnable4=="0"){ ifdl=false; @@ -502,6 +516,22 @@ Page({ }) return; } + + if(that.data.fromHot != 1){ + var userInfodata = wx.getStorageSync("userInfo") + // console.log("fromHot:"+that.data.fromHot) + + var userInfo = userInfodata ? JSON.parse(userInfodata) : null + // console.log("iLevel:"+userInfodata) + if(!userInfo || !userInfo.iLevel || parseInt(userInfo.iLevel) < 2){ + wx.showToast({ + title: "会员等级不够", + icon: "none", + duration: 2000 + }) + return + } + } var t = e.currentTarget.dataset.id that.setData({ @@ -543,6 +573,18 @@ Page({ }) return; }else{ + if(that.data.fromHot != 1){ + + var userInfo = userInfodata ? JSON.parse(userInfodata) : null + if(!userInfo || !userInfo.iLevel || parseInt(userInfo.iLevel) < 2){ + wx.showToast({ + title: "会员等级不够", + icon: "none", + duration: 2000 + }) + return + } + } var userInfo = userInfodata ? JSON.parse(userInfodata) : null; if(userInfo && userInfo.Phone==""&&userInfo.FHEnable4=="0"){ ifdl=false; diff --git a/pages/detailsPoint/index.js b/pages/detailsPoint/index.js index c4ed0b2..45efed2 100644 --- a/pages/detailsPoint/index.js +++ b/pages/detailsPoint/index.js @@ -449,6 +449,7 @@ Page({ url: "../login/index" }) }else{ + var userInfo = JSON.parse(userInfodata); if(userInfo.Phone==""&&userInfo.FHEnable4=="0"){ ifdl=false; diff --git a/pages/mybusiness/index.js b/pages/mybusiness/index.js index ceac5bb..88d4250 100644 --- a/pages/mybusiness/index.js +++ b/pages/mybusiness/index.js @@ -115,7 +115,6 @@ Page( { destHeight: 720, canvas: mCanvas, success: function(res0) { - // 获取图片路径 const tempFilePath = res0.tempFilePath; wx.saveImageToPhotosAlbum({ @@ -138,17 +137,48 @@ Page( { }) } }) + }, + fail: function(err) { + console.log('saveImageToPhotosAlbum fail:', err); + if (err.errMsg.indexOf('auth deny') > -1 || err.errMsg.indexOf('authorize') > -1) { + wx.showModal({ + title: '提示', + content: '需要授权保存到相册权限', + confirmText: '去授权', + success: function (res) { + if (res.confirm) { + wx.openSetting({ + success: function(settingRes) { + if (settingRes.authSetting['scope.writePhotosAlbum']) { + that.onxz(e); + } + } + }) + } + } + }) + } else { + wx.showToast({ + title: '保存失败:' + err.errMsg, + icon: "none", + duration: 3000 + }) + } + that.setData({ + savetitle:"保存商家收款码到相册" + }) } }) - - - }, fail: function(err) { + console.log('canvasToTempFilePath fail:', err); wx.showToast({ - title: err, + title: '生成图片失败:' + err.errMsg, icon: "none", - duration: 10000 + duration: 3000 + }) + that.setData({ + savetitle:"保存商家收款码到相册" }) } }) diff --git a/pages/mytgm/index.js b/pages/mytgm/index.js index b101f1b..72798f9 100644 --- a/pages/mytgm/index.js +++ b/pages/mytgm/index.js @@ -158,13 +158,13 @@ Page( { }) var userId = wx.getStorageSync("userId") var LoginId = wx.getStorageSync("LoginId") + wx.canvasToTempFilePath({ canvasId: "myCanvas"+(that.data.selindex==0?"":(that.data.selindex==1?"0":"1")), destWidth: 405, destHeight: 720, canvas: (that.data.selindex==0?mCanvas:(that.data.selindex==1?mCanvas0:mCanvas1)), success: function(res0) { - // 获取图片路径 const tempFilePath = res0.tempFilePath; wx.saveImageToPhotosAlbum({ @@ -187,17 +187,48 @@ Page( { }) } }) + }, + fail: function(err) { + console.log('saveImageToPhotosAlbum fail:', err); + if (err.errMsg.indexOf('auth deny') > -1 || err.errMsg.indexOf('authorize') > -1) { + wx.showModal({ + title: '提示', + content: '需要授权保存到相册权限', + confirmText: '去授权', + success: function (res) { + if (res.confirm) { + wx.openSetting({ + success: function(settingRes) { + if (settingRes.authSetting['scope.writePhotosAlbum']) { + that.onsavepic(e); + } + } + }) + } + } + }) + } else { + wx.showToast({ + title: '保存失败:' + err.errMsg, + icon: "none", + duration: 3000 + }) + } + that.setData({ + savetitle:"保存二维码到相册" + }) } }) - - - }, fail: function(err) { + console.log('canvasToTempFilePath fail:', err); wx.showToast({ - title: err, + title: '生成图片失败:' + err.errMsg, icon: "none", - duration: 10000 + duration: 3000 + }) + that.setData({ + savetitle:"保存二维码到相册" }) } })