Commit 2a68d0f7 authored by wangxuelai's avatar wangxuelai

''

parent 898bec43
...@@ -75,12 +75,16 @@ Component({ ...@@ -75,12 +75,16 @@ Component({
wx.showLoading({ wx.showLoading({
title: '图片下载中', title: '图片下载中',
}) })
wxAuthorize('scope.writePhotosAlbum').then((res) => { // wxSaveImageToPhotosAlbum({
return wxGetImageInfo({ // filePath: path
src: this.data.canvasimagepath // })
}) // wxAuthorize('scope.writePhotosAlbum').then((res) => {
// return wxGetImageInfo({
// src: this.data.canvasimagepath
// })
wxGetImageInfo({
src: this.data.canvasimagepath
}).then((res) => { }).then((res) => {
console.log(res);
const {errMsg, path} = res; const {errMsg, path} = res;
if (errMsg == 'getImageInfo:ok') { if (errMsg == 'getImageInfo:ok') {
return wxSaveImageToPhotosAlbum({ return wxSaveImageToPhotosAlbum({
...@@ -109,15 +113,14 @@ Component({ ...@@ -109,15 +113,14 @@ Component({
}) })
} }
wx.hideLoading(); wx.hideLoading();
}).catch((e) => { }).catch((err) => {
wx.hideLoading(); wx.hideLoading();
if (e && e.errMsg == 'authorize:fail auth deny') { if (err && (err.errMsg == "saveImageToPhotosAlbum:fail:auth denied" || err.errMsg == "saveImageToPhotosAlbum:fail auth deny" || err.errMsg == "saveImageToPhotosAlbum:fail authorize no response")) {
this.setData({ this.setData({
showAuthSettingDia: true showAuthSettingDia: true
}) })
return; return;
} }
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '图片下载失败', content: '图片下载失败',
......
...@@ -49,7 +49,7 @@ function timeCompare (date) { ...@@ -49,7 +49,7 @@ function timeCompare (date) {
var timestampCompare = nowTimestamp - startTimestamp; var timestampCompare = nowTimestamp - startTimestamp;
var text = '时间'; var text = '时间';
if (timestampCompare < oneHourTimestamp) { // 一小时以内 if (timestampCompare < oneHourTimestamp) { // 一小时以内
text = (Math.round(timestampCompare / 1000 / 60) == 0 ? 1 : (Math.round(timestampCompare / 1000 / 60) == 60 ? 59 : Math.round(timestampCompare / 1000 / 60))) + '分钟前'; text = (timestampCompare <= 0 ? 1 : (Math.round(timestampCompare / 1000 / 60) == 60 ? 59 : Math.round(timestampCompare / 1000 / 60))) + '分钟前';
} else if (timestampCompare < oneDayTimestamp) { // 一小时到24小时之间 } else if (timestampCompare < oneDayTimestamp) { // 一小时到24小时之间
text = Math.round(timestampCompare / 1000 / 60 / 60) + '小时前'; text = Math.round(timestampCompare / 1000 / 60 / 60) + '小时前';
} else { // 一天以外 } else { // 一天以外
...@@ -69,7 +69,7 @@ function bulletTimeCompare (date) { ...@@ -69,7 +69,7 @@ function bulletTimeCompare (date) {
if (timestampCompare < oneMinuteTimestamp) { if (timestampCompare < oneMinuteTimestamp) {
text = '刚刚'; text = '刚刚';
} else if (timestampCompare < oneHourTimestamp) { // 一小时以内 } else if (timestampCompare < oneHourTimestamp) { // 一小时以内
text = (Math.round(timestampCompare / 1000 / 60) <= 0 ? 1 : (Math.round(timestampCompare / 1000 / 60) == 60 ? 59 : Math.round(timestampCompare / 1000 / 60))) + '分钟前'; text = (timestampCompare <= 0 ? 1 : (Math.round(timestampCompare / 1000 / 60) == 60 ? 59 : Math.round(timestampCompare / 1000 / 60))) + '分钟前';
} else if (timestampCompare < oneDayTimestamp) { // 一小时到24小时之间 } else if (timestampCompare < oneDayTimestamp) { // 一小时到24小时之间
text = Math.round(timestampCompare / 1000 / 60 / 60) + '小时前'; text = Math.round(timestampCompare / 1000 / 60 / 60) + '小时前';
} else { // 一天以外 } else { // 一天以外
......
...@@ -139,6 +139,7 @@ Page({ ...@@ -139,6 +139,7 @@ Page({
const visitor = LocalStorage.getItem('visitor'); const visitor = LocalStorage.getItem('visitor');
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器 this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
if (options.scene) { if (options.scene) {
console.log(options.scene);
let sceneQuery = scenQueryGet(options.scene); let sceneQuery = scenQueryGet(options.scene);
const { const {
t, t,
......
...@@ -1343,7 +1343,6 @@ Page({ ...@@ -1343,7 +1343,6 @@ Page({
title: '日签生成中...' title: '日签生成中...'
}) })
generateCustomerQrcode({ generateCustomerQrcode({
scene: `c=${clockDetail[0].id}&t=${this.data.themeSelect.id}`, scene: `c=${clockDetail[0].id}&t=${this.data.themeSelect.id}`,
page: `src/pages/clockdetail/newindex` page: `src/pages/clockdetail/newindex`
// scene: `ctd=${visitor && visitor.id}&t=${this.data.tid}`, // scene: `ctd=${visitor && visitor.id}&t=${this.data.tid}`,
......
...@@ -1429,7 +1429,6 @@ Page({ ...@@ -1429,7 +1429,6 @@ Page({
scene: `c=${clockDetail.id}&t=${this.data.tid}`, scene: `c=${clockDetail.id}&t=${this.data.tid}`,
page: `src/pages/clockdetail/newindex` page: `src/pages/clockdetail/newindex`
}).then((res) => { }).then((res) => {
console.log("res",res)
const { const {
code, code,
data data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment