Commit 0393b2eb by 赵雅纹

优化

parent 9cf25111
...@@ -28,10 +28,6 @@ Component({ ...@@ -28,10 +28,6 @@ Component({
productName:'' productName:''
}, },
attached() {
this.getProList()
},
observers: { observers: {
proGoods(val) { proGoods(val) {
for (var i in this.data.proList){ for (var i in this.data.proList){
...@@ -44,6 +40,14 @@ Component({ ...@@ -44,6 +40,14 @@ Component({
}) })
} }
} }
},
show() {
const { show } = this.data
if (show) {
wxService.nextTick(() => {
this.getProList();
})
}
} }
}, },
...@@ -80,15 +84,13 @@ Component({ ...@@ -80,15 +84,13 @@ Component({
// 点击键盘完成时触发 // 点击键盘完成时触发
onTapConfirm(e){ onTapConfirm(e){
console.log(e)
this.setData({ this.setData({
productName: e.detail.value productName: e.detail.value
}) })
}, },
// search // 搜索商品search
search(){ search(){
console.log(this.data.productName)
if(!this.data.productName){ if(!this.data.productName){
wx.showToast({ wx.showToast({
title: '请输入商品名称', title: '请输入商品名称',
...@@ -99,7 +101,7 @@ Component({ ...@@ -99,7 +101,7 @@ Component({
this.getProList() this.getProList()
}, },
// 搜索商品 // 商品列表
getProList() { getProList() {
wxService.post(`/sale/product/buyer/listWithMember`,{ wxService.post(`/sale/product/buyer/listWithMember`,{
productName: this.data.productName productName: this.data.productName
......
...@@ -109,14 +109,6 @@ wxService.page({ ...@@ -109,14 +109,6 @@ wxService.page({
}) })
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
// 关联商品 // 关联商品
handleRelatedGoods(){ handleRelatedGoods(){
console.log('关联商品') console.log('关联商品')
...@@ -260,7 +252,21 @@ wxService.page({ ...@@ -260,7 +252,21 @@ wxService.page({
// 发布笔记 // 发布笔记
formSubmit(e){ formSubmit(e){
console.log(e) if (!this.data.params.sspList || this.data.params.sspList.length < 1) {
wx.showToast({
title: '请上传至少一张图片',
icon: 'none'
})
return;
}
if (!e.detail.value.headline){
wx.showToast({
title: '请添加标题',
icon: 'none'
})
return;
}
this.setData({ this.setData({
'params.headline': e.detail.value.headline, 'params.headline': e.detail.value.headline,
'params.article': e.detail.value.article 'params.article': e.detail.value.article
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment