diff --git a/pages/setting/paper-detial/index.js b/pages/setting/paper-detial/index.js index 0dbccae..e556f07 100644 --- a/pages/setting/paper-detial/index.js +++ b/pages/setting/paper-detial/index.js @@ -47,9 +47,9 @@ Scene({ this.setData({ visible: true }) }, onSelect: function({detail}){ - this.data.form.categoryId = detail.categoryId - this.data.form.categoryName = detail.categoryName - this.setData({ ['form.productName']: detail.categoryName, ['form.categoryName']: detail.categoryName }) + this.data.form.categoryId = detail.id + this.data.form.categoryName = detail.name + this.setData({ ['form.productName']: detail.name, ['form.categoryName']: detail.name }) }, bindInput: function(e){ this.data.form[e.currentTarget.id] = e.detail diff --git a/pages/setting/paper-select/index.js b/pages/setting/paper-select/index.js index d4d3db4..38cda11 100644 --- a/pages/setting/paper-select/index.js +++ b/pages/setting/paper-select/index.js @@ -37,7 +37,12 @@ Component({ }, onConfirm: function(e){ this.data.cIndex = e.currentTarget.dataset.index - var item = this.data.paperList[this.data.activeIndex].smallProductCategoryInfoList[this.data.cIndex] + var item = null + if(this.data.singleList && this.data.singleList.length){ + item = this.data.singleList[this.data.cIndex] + } else { + item = this.data.paperList[this.data.activeIndex].smallProductCategoryInfoList[this.data.cIndex] + } wx.nextTick(() => { this.setData({ visible: false, cIndex: this.data.cIndex }) this.triggerEvent('select', item)