|
@@ -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() {
|