|
@@ -508,11 +508,6 @@ Page({
|
|
|
_this.data._imgNext = 0
|
|
|
wx.hideLoading()
|
|
|
if (showToast) {
|
|
|
- // todo 测试注释的
|
|
|
- // wx.showModal({
|
|
|
- // title: '壁纸上传失败了',
|
|
|
- // showCancel: false
|
|
|
- // })
|
|
|
wx.showToast({
|
|
|
title: '发送图片失败',
|
|
|
icon: 'error'
|
|
@@ -525,6 +520,7 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
hasImage(image) {
|
|
|
+ console.log("有图片", image.pic)
|
|
|
let that = this;
|
|
|
that.cropper.imgReset();
|
|
|
// 有图片的进制缩放
|
|
@@ -558,17 +554,18 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
+ let _this = this;
|
|
|
|
|
|
this.cropper = this.selectComponent("#image-cropper");
|
|
|
this.cropper.imgReset();
|
|
|
let image = options.param
|
|
|
let json = JSON.parse(image)
|
|
|
- console.log("裁剪页:", image)
|
|
|
+ console.log("裁剪页:", json)
|
|
|
let topImg = json.topImg ?? {}
|
|
|
- let deviceId = json.deviceId;
|
|
|
+ let deviceId = json.deviceId ?? "";
|
|
|
_this.data._deviceId = deviceId
|
|
|
if (topImg.pic) {
|
|
|
- this.hasImage(json)
|
|
|
+ this.hasImage(topImg)
|
|
|
} else {
|
|
|
console.log("没有图片")
|
|
|
this.checkAndRequestImagePermission()
|
|
@@ -577,7 +574,6 @@ Page({
|
|
|
// scr:json,
|
|
|
// })
|
|
|
|
|
|
- let _this = this;
|
|
|
EventManager.addNotification(CmdEvent.eventName, function (event) {
|
|
|
let name = event.cmdEvent;
|
|
|
let value = event.wallpaper;
|