邹能昇 преди 4 месеца
родител
ревизия
e906246ee9

+ 53 - 51
nova-tourism/pages/my/merchant/merchant-home/account/index.js

@@ -30,56 +30,56 @@ Page({
         address: '',
         locations: null,
     },
-    getHtml(e) { //从组件获取值
-        let html = e.detail.content.html
-        console.log(html);
-        // this.setData({ html: html })
-        // let field = event.currentTarget.dataset.field;
-        // let html = event.detail.content.html;
-        this.setData({
-            html: html
-        })
-    },
+    // getHtml(e) { //从组件获取值
+    //     let html = e.detail.content.html
+    //     console.log(html);
+    //     // this.setData({ html: html })
+    //     // let field = event.currentTarget.dataset.field;
+    //     // let html = event.detail.content.html;
+    //     this.setData({
+    //         html: html
+    //     })
+    // },
 
-    insertImage() { //图片上传插入示例
-        let that = this
-        wx.chooseImage({
-            count: 1,
-            success(res) {
-                // 本地测试图片插入
-                // this.selectComponent('#hf_editor').insertSrc(res.tempFilePaths[0]);
-                // console.log(res.tempFilePaths[0]);
-                let tempFilePaths = res.tempFilePaths[0];
-                console.log(tempFilePaths);
+    // insertImage() { //图片上传插入示例
+    //     let that = this
+    //     wx.chooseImage({
+    //         count: 1,
+    //         success(res) {
+    //             // 本地测试图片插入
+    //             // this.selectComponent('#hf_editor').insertSrc(res.tempFilePaths[0]);
+    //             // console.log(res.tempFilePaths[0]);
+    //             let tempFilePaths = res.tempFilePaths[0];
+    //             console.log(tempFilePaths);
 
 
-                qiniuUploader.upload(
-                    tempFilePaths,
-                    (res) => {
-                        let img = res.imageURL;
-                        that.selectComponent('#hf_editor').insertSrc(img); //调用组件insertSrc方法
-                    },
-                    (error) => {
-                        console.log("error: " + error);
-                    }, {
-                        region: "SCN",
-                        uploadURL: that.data.uploadURL,
-                        domain: that.data.domain,
-                        uptoken: that.data.uptokenURL,
-                    }
-                );
-            }
-        })
-    },
+    //             qiniuUploader.upload(
+    //                 tempFilePaths,
+    //                 (res) => {
+    //                     let img = res.imageURL;
+    //                     that.selectComponent('#hf_editor').insertSrc(img); //调用组件insertSrc方法
+    //                 },
+    //                 (error) => {
+    //                     console.log("error: " + error);
+    //                 }, {
+    //                     region: "SCN",
+    //                     uploadURL: that.data.uploadURL,
+    //                     domain: that.data.domain,
+    //                     uptoken: that.data.uptokenURL,
+    //                 }
+    //             );
+    //         }
+    //     })
+    // },
 
     changeFile(e) {
         if (e.detail && e.detail.length > 0) {
             this.setData({
-                cover: [e.detail[0].url]
+                cover:`${e.detail[0].url}`
             })
         } else {
             this.setData({
-                cover: []
+                cover: ''
                 // cover:this.data.imageList[0].url
             })
         }
@@ -160,7 +160,7 @@ Page({
         }
         ShopStore.set("desc", this.data.desc)
         ShopStore.set("workingTime", this.data.workingTime)
-        ShopStore.set("content", this.data.html)
+        // ShopStore.set("content", this.data.html)
         ShopStore.save().then(res => {
             console.log(res)
             wx.showToast({
@@ -221,7 +221,7 @@ Page({
         })
         console.log('首页', this.data.locations);
         this.Getlocation()
-        this.selectComponent('#hf_editor').setHtml(this.data.html);
+        // this.selectComponent('#hf_editor').setHtml(this.data.html);
         this.getQiniuOption()
     },
     async getQiniuOption() {
@@ -301,21 +301,23 @@ Page({
                     address,
                     name
                 } = res;
-                let locations = new Parse.GeoPoint(latitude, longitude)
+                let locations = new Parse.GeoPoint(latitude, longitude);
                 this.setData({
                     locations,
                     address: address
-                })
+                });
                 console.log(locations);
                 console.log(address + name);
-                // this.data.formData[field] = locations
-                // this.data.formData['address'] = address + name
-                //   this.data.formData['address'] = address
-                // this.setData({
-                //     formData: this.data.formData,
-                // })
+            },
+            fail: (error) => {
+                // 处理选择位置失败的情况
+                console.error('选择位置失败:', error);
+                wx.showToast({
+                    title: '选择位置失败,请重试',
+                    icon: 'none'
+                });
             }
-        })
+        });
     },
     //解析地理位置
     Getlocation() {

+ 1 - 1
nova-tourism/pages/my/merchant/merchant-home/index.js

@@ -300,7 +300,7 @@ Page({
      * 生命周期函数--监听页面显示
      */
     onShow: function () {
-
+        this.getShopStore()
     },
 
     /**

+ 34 - 34
nova-tourism/pages/my/merchant/room-manage/room-edit/index.js

@@ -119,7 +119,7 @@ Page({
         if (this.data.room) {
             this.data.route['editFields'].forEach(field => {
                 if (field["view"] == 'editor-tinymce') {
-                    this.selectComponent(`#editor${field["key"]}`).setHtml(room[field["key"]] || '');
+                    // this.selectComponent(`#editor${field["key"]}`).setHtml(room[field["key"]] || '');
                 }
             })
         }
@@ -255,39 +255,39 @@ Page({
             }
         })
     },
-    getHtml(event) {
-        let field = event.currentTarget.dataset.field;
-        let html = event.detail.content.html;
-        this.data.formData[field] = html;
-    },
-    insertImage(event) {
-        let field = event.currentTarget.dataset.field;
-        let that = this;
-        wx.chooseImage({
-            count: 1,
-            success(res) {
-                // 本地测试图片插入
-                // this.selectComponent('#hf_editor').insertSrc(res.tempFilePaths[0]);
-                // that.selectComponent(`#editor${field}`).insertSrc(res.tempFilePaths[0])
-                let tempFilePaths = res.tempFilePaths[0];
-                qiniuUploader.upload(
-                    tempFilePaths,
-                    (res) => {
-                        let img = res.imageURL;
-                        that.selectComponent(`#editor${field}`).insertSrc(img); //调用组件insertSrc方法
-                    },
-                    (error) => {
-                        console.log("error: " + error);
-                    }, {
-                        region: "SCN",
-                        uploadURL: that.data.uploadURL,
-                        domain: that.data.domain,
-                        uptoken: that.data.uptokenURL,
-                    }
-                );
-            }
-        })
-    },
+    // getHtml(event) {
+    //     let field = event.currentTarget.dataset.field;
+    //     let html = event.detail.content.html;
+    //     this.data.formData[field] = html;
+    // },
+    // insertImage(event) {
+    //     let field = event.currentTarget.dataset.field;
+    //     let that = this;
+    //     wx.chooseImage({
+    //         count: 1,
+    //         success(res) {
+    //             // 本地测试图片插入
+    //             // this.selectComponent('#hf_editor').insertSrc(res.tempFilePaths[0]);
+    //             // that.selectComponent(`#editor${field}`).insertSrc(res.tempFilePaths[0])
+    //             let tempFilePaths = res.tempFilePaths[0];
+    //             qiniuUploader.upload(
+    //                 tempFilePaths,
+    //                 (res) => {
+    //                     let img = res.imageURL;
+    //                     that.selectComponent(`#editor${field}`).insertSrc(img); //调用组件insertSrc方法
+    //                 },
+    //                 (error) => {
+    //                     console.log("error: " + error);
+    //                 }, {
+    //                     region: "SCN",
+    //                     uploadURL: that.data.uploadURL,
+    //                     domain: that.data.domain,
+    //                     uptoken: that.data.uptokenURL,
+    //                 }
+    //             );
+    //         }
+    //     })
+    // },
     async submit() {
         let checked = await this.checkForm()
         if (!checked) {