Commit 0393b2eb by 赵雅纹

优化

parent 9cf25111
......@@ -28,10 +28,6 @@ Component({
productName:''
},
attached() {
this.getProList()
},
observers: {
proGoods(val) {
for (var i in this.data.proList){
......@@ -44,6 +40,14 @@ Component({
})
}
}
},
show() {
const { show } = this.data
if (show) {
wxService.nextTick(() => {
this.getProList();
})
}
}
},
......@@ -80,15 +84,13 @@ Component({
// 点击键盘完成时触发
onTapConfirm(e){
console.log(e)
this.setData({
productName: e.detail.value
})
},
// search
// 搜索商品search
search(){
console.log(this.data.productName)
if(!this.data.productName){
wx.showToast({
title: '请输入商品名称',
......@@ -99,7 +101,7 @@ Component({
this.getProList()
},
// 搜索商品
// 商品列表
getProList() {
wxService.post(`/sale/product/buyer/listWithMember`,{
productName: this.data.productName
......
......@@ -109,14 +109,6 @@ wxService.page({
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
// 关联商品
handleRelatedGoods(){
console.log('关联商品')
......@@ -260,7 +252,21 @@ wxService.page({
// 发布笔记
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({
'params.headline': e.detail.value.headline,
'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