修改顶部ui前备份
This commit is contained in:
@@ -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;
|
||||
@@ -503,6 +517,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({
|
||||
IFDJPD:0,
|
||||
@@ -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;
|
||||
|
||||
@@ -449,6 +449,7 @@ Page({
|
||||
url: "../login/index"
|
||||
})
|
||||
}else{
|
||||
|
||||
var userInfo = JSON.parse(userInfodata);
|
||||
if(userInfo.Phone==""&&userInfo.FHEnable4=="0"){
|
||||
ifdl=false;
|
||||
|
||||
@@ -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,
|
||||
title: '保存失败:' + err.errMsg,
|
||||
icon: "none",
|
||||
duration: 10000
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
savetitle:"保存商家收款码到相册"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('canvasToTempFilePath fail:', err);
|
||||
wx.showToast({
|
||||
title: '生成图片失败:' + err.errMsg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
that.setData({
|
||||
savetitle:"保存商家收款码到相册"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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,
|
||||
title: '保存失败:' + err.errMsg,
|
||||
icon: "none",
|
||||
duration: 10000
|
||||
duration: 3000
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
savetitle:"保存二维码到相册"
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('canvasToTempFilePath fail:', err);
|
||||
wx.showToast({
|
||||
title: '生成图片失败:' + err.errMsg,
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
})
|
||||
that.setData({
|
||||
savetitle:"保存二维码到相册"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user