修改顶部ui前备份
This commit is contained in:
@@ -456,7 +456,21 @@ Page({
|
|||||||
url: "../login/index"
|
url: "../login/index"
|
||||||
})
|
})
|
||||||
return;
|
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;
|
var userInfo = userInfodata ? JSON.parse(userInfodata) : null;
|
||||||
if(userInfo && userInfo.Phone==""&&userInfo.FHEnable4=="0"){
|
if(userInfo && userInfo.Phone==""&&userInfo.FHEnable4=="0"){
|
||||||
ifdl=false;
|
ifdl=false;
|
||||||
@@ -502,6 +516,22 @@ Page({
|
|||||||
})
|
})
|
||||||
return;
|
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
|
var t = e.currentTarget.dataset.id
|
||||||
that.setData({
|
that.setData({
|
||||||
@@ -543,6 +573,18 @@ Page({
|
|||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}else{
|
}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;
|
var userInfo = userInfodata ? JSON.parse(userInfodata) : null;
|
||||||
if(userInfo && userInfo.Phone==""&&userInfo.FHEnable4=="0"){
|
if(userInfo && userInfo.Phone==""&&userInfo.FHEnable4=="0"){
|
||||||
ifdl=false;
|
ifdl=false;
|
||||||
|
|||||||
@@ -449,6 +449,7 @@ Page({
|
|||||||
url: "../login/index"
|
url: "../login/index"
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
var userInfo = JSON.parse(userInfodata);
|
var userInfo = JSON.parse(userInfodata);
|
||||||
if(userInfo.Phone==""&&userInfo.FHEnable4=="0"){
|
if(userInfo.Phone==""&&userInfo.FHEnable4=="0"){
|
||||||
ifdl=false;
|
ifdl=false;
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ Page( {
|
|||||||
destHeight: 720,
|
destHeight: 720,
|
||||||
canvas: mCanvas,
|
canvas: mCanvas,
|
||||||
success: function(res0) {
|
success: function(res0) {
|
||||||
// 获取图片路径
|
|
||||||
const tempFilePath = res0.tempFilePath;
|
const tempFilePath = res0.tempFilePath;
|
||||||
|
|
||||||
wx.saveImageToPhotosAlbum({
|
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) {
|
fail: function(err) {
|
||||||
|
console.log('canvasToTempFilePath fail:', err);
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: err,
|
title: '生成图片失败:' + err.errMsg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 10000
|
duration: 3000
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
savetitle:"保存商家收款码到相册"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -158,13 +158,13 @@ Page( {
|
|||||||
})
|
})
|
||||||
var userId = wx.getStorageSync("userId")
|
var userId = wx.getStorageSync("userId")
|
||||||
var LoginId = wx.getStorageSync("LoginId")
|
var LoginId = wx.getStorageSync("LoginId")
|
||||||
|
|
||||||
wx.canvasToTempFilePath({
|
wx.canvasToTempFilePath({
|
||||||
canvasId: "myCanvas"+(that.data.selindex==0?"":(that.data.selindex==1?"0":"1")),
|
canvasId: "myCanvas"+(that.data.selindex==0?"":(that.data.selindex==1?"0":"1")),
|
||||||
destWidth: 405,
|
destWidth: 405,
|
||||||
destHeight: 720,
|
destHeight: 720,
|
||||||
canvas: (that.data.selindex==0?mCanvas:(that.data.selindex==1?mCanvas0:mCanvas1)),
|
canvas: (that.data.selindex==0?mCanvas:(that.data.selindex==1?mCanvas0:mCanvas1)),
|
||||||
success: function(res0) {
|
success: function(res0) {
|
||||||
// 获取图片路径
|
|
||||||
const tempFilePath = res0.tempFilePath;
|
const tempFilePath = res0.tempFilePath;
|
||||||
|
|
||||||
wx.saveImageToPhotosAlbum({
|
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) {
|
fail: function(err) {
|
||||||
|
console.log('canvasToTempFilePath fail:', err);
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
title: err,
|
title: '生成图片失败:' + err.errMsg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 10000
|
duration: 3000
|
||||||
|
})
|
||||||
|
that.setData({
|
||||||
|
savetitle:"保存二维码到相册"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user