|
@@ -8,13 +8,13 @@ Page({
|
|
|
*/
|
|
|
data: {
|
|
|
|
|
|
- imageList: [],
|
|
|
- licenseList: [],
|
|
|
+ imageList: [],//商店首页
|
|
|
+ licenseList: [],//店铺图片
|
|
|
merchant: null,
|
|
|
store: null,
|
|
|
stores: null,
|
|
|
perCapita: null,
|
|
|
- cover: [],
|
|
|
+ cover: '',
|
|
|
image: [],
|
|
|
storeName: null,
|
|
|
perCapita: null,
|
|
@@ -77,6 +77,7 @@ Page({
|
|
|
} else {
|
|
|
this.setData({
|
|
|
cover: []
|
|
|
+ // cover:this.data.imageList[0].url
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -85,6 +86,7 @@ Page({
|
|
|
this.setData({
|
|
|
image: e.detail
|
|
|
})
|
|
|
+ console.log('图片',this.data.image);
|
|
|
} else {
|
|
|
this.setData({
|
|
|
image: []
|
|
@@ -115,19 +117,35 @@ Page({
|
|
|
},
|
|
|
async determine() {
|
|
|
let image = []
|
|
|
- for (let index = 0; index < this.data.image.length; index++) {
|
|
|
- let item = this.data.image[index];
|
|
|
- image.push(item.url)
|
|
|
+ if(this.data.image[0].url){
|
|
|
+ for (let index = 0; index < this.data.image.length; index++) {
|
|
|
+ let item = this.data.image[index];
|
|
|
+ image.push(item.url)
|
|
|
+ }
|
|
|
+ // 设置图片格式判断
|
|
|
+ console.log('店铺图片',image);
|
|
|
+ }else{
|
|
|
+ image=this.data.image
|
|
|
}
|
|
|
- console.log(this.data.perCapita, this.data.name, image, this.data.storeName, this.data.perCapita, this.data.desc, this.data.workingTime, this.data.html);
|
|
|
+
|
|
|
+ console.log(this.data.name, image, this.data.storeName, this.data.perCapita, this.data.desc, this.data.workingTime, this.data.html);
|
|
|
let query = new Parse.Query("ShopStore")
|
|
|
|
|
|
let ShopStore = await query.get(this.data.id)
|
|
|
- ShopStore.set("perCapita", this.data.perCapita)
|
|
|
+ // ShopStore.set("perCapita", this.data.perCapita)
|
|
|
ShopStore.set("name", this.data.name)
|
|
|
+ ShopStore.set("cover", this.data.cover)
|
|
|
ShopStore.set("image", image)
|
|
|
ShopStore.set("storeName", this.data.storeName)
|
|
|
- ShopStore.set("perCapita", this.data.perCapita)
|
|
|
+ if(Number(this.data.perCapita)){
|
|
|
+ ShopStore.set("perCapita", Number(this.data.perCapita))
|
|
|
+ }else{
|
|
|
+ wx.showToast({
|
|
|
+ title: '请输入正确人均消费',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
ShopStore.set("desc", this.data.desc)
|
|
|
ShopStore.set("workingTime", this.data.workingTime)
|
|
|
ShopStore.set("content", this.data.html)
|
|
@@ -176,7 +194,7 @@ Page({
|
|
|
store: store,
|
|
|
cover: store.cover,
|
|
|
image: store.image,
|
|
|
- perCapita: store.perCapita,
|
|
|
+ // perCapita: store.perCapita,
|
|
|
storeName: store.storeName,
|
|
|
perCapita: store.perCapita,
|
|
|
desc: store.desc,
|
|
@@ -186,7 +204,7 @@ Page({
|
|
|
id: store.objectId,
|
|
|
licenseList: licenseList,
|
|
|
})
|
|
|
- console.log(this.data.html);
|
|
|
+ console.log('首页',this.data.perCapita);
|
|
|
this.selectComponent('#hf_editor').setHtml(this.data.html);
|
|
|
this.getQiniuOption()
|
|
|
},
|