|
@@ -1,9 +1,11 @@
|
|
|
-// pages/piano/wallpaper/wallpaper.js
|
|
|
-const { deviceWallPaper } = require('../../../request/deviceListRequest')
|
|
|
+const {
|
|
|
+ deviceWallPaper
|
|
|
+} = require('../../../request/deviceListRequest')
|
|
|
// const sharp = require('sharp');
|
|
|
// const fs = require('fs');
|
|
|
|
|
|
import routeUtil from '../../../utils/routeUtil';
|
|
|
+import routePath from '../../../utils/routePath';
|
|
|
import store from '../../../utils/store';
|
|
|
|
|
|
Page({
|
|
@@ -11,8 +13,7 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- topImg:
|
|
|
- {
|
|
|
+ topImg: {
|
|
|
// pic: "",
|
|
|
// id: "",
|
|
|
},
|
|
@@ -37,8 +38,8 @@ Page({
|
|
|
"deviceId": this.data._device.deviceId,
|
|
|
"topImg": this.data.topImg
|
|
|
}
|
|
|
- var param = "?param=" + JSON.stringify(p);
|
|
|
- routeUtil.jumpParam("../cropper/cropper", param);
|
|
|
+ var param = "?param=" + JSON.stringify(p);
|
|
|
+ routeUtil.jumpParam(routePath.cropper, param);
|
|
|
},
|
|
|
imageTopTap() {
|
|
|
this.setData({
|
|
@@ -99,7 +100,8 @@ Page({
|
|
|
let _this = this;
|
|
|
|
|
|
let newImg = {
|
|
|
- "pic": topUrl, "id": "0"
|
|
|
+ "pic": topUrl,
|
|
|
+ "id": "0"
|
|
|
}
|
|
|
let myImgList = store.getStore(_this.data._localImgPicKey)
|
|
|
myImgList = myImgList ?? []
|
|
@@ -111,7 +113,9 @@ Page({
|
|
|
|
|
|
let imgList = _this.data._netImageList
|
|
|
// 移除网络的重复图片
|
|
|
- let findImg = imgList.find(function (img) { return img.pic === topUrl })
|
|
|
+ let findImg = imgList.find(function (img) {
|
|
|
+ return img.pic === topUrl
|
|
|
+ })
|
|
|
console.log("updateTopImg3", findImg)
|
|
|
if (findImg) {
|
|
|
// 官方不动位置
|
|
@@ -152,7 +156,9 @@ Page({
|
|
|
|
|
|
this.setData({
|
|
|
showCropImg: true,
|
|
|
- topImg: { "pic": img.path }
|
|
|
+ topImg: {
|
|
|
+ "pic": img.path
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
},
|
|
@@ -196,8 +202,7 @@ Page({
|
|
|
/**
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
*/
|
|
|
- onUnload() {
|
|
|
- },
|
|
|
+ onUnload() {},
|
|
|
|
|
|
/**
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|