diff --git a/pages.json b/pages.json index 26a2601..6cb0218 100644 --- a/pages.json +++ b/pages.json @@ -523,6 +523,20 @@ "enablePullDownRefresh": false } }, + { + "path": "pages/prescript/CNMedicineSearch", + "style": { + "navigationBarTitleText": "中药检索", + "enablePullDownRefresh": false + } + }, + { + "path": "pages/prescript/CNMedicineSearchDetail", + "style": { + "navigationBarTitleText": "中药详情", + "enablePullDownRefresh": false + } + }, { "path": "pages/medicaldes/medicaldes", "style": { diff --git a/pages/prescript/CNMedicineSearch.vue b/pages/prescript/CNMedicineSearch.vue new file mode 100644 index 0000000..d202681 --- /dev/null +++ b/pages/prescript/CNMedicineSearch.vue @@ -0,0 +1,391 @@ + + + + + \ No newline at end of file diff --git a/pages/prescript/CNMedicineSearchDetail.vue b/pages/prescript/CNMedicineSearchDetail.vue new file mode 100644 index 0000000..e636741 --- /dev/null +++ b/pages/prescript/CNMedicineSearchDetail.vue @@ -0,0 +1,168 @@ + + + + + \ No newline at end of file diff --git a/pages/prescript/medicineSearch.vue b/pages/prescript/medicineSearch.vue index 776a185..46aebc3 100644 --- a/pages/prescript/medicineSearch.vue +++ b/pages/prescript/medicineSearch.vue @@ -5,9 +5,8 @@ {{item.title}} - - + + @@ -37,17 +36,16 @@ - + @@ -96,9 +94,12 @@ export default { limitContent: '' } }, + // onLoad() { + // this.getCNYao() + // }, methods: { setOneCateIndex(item, index) { - let id = item.prescriptCategoryId + // let id = item.prescriptCategoryId this.curOneCateIndex = index this.curTwoCateIndex = 0 this.searchValue = '' @@ -108,6 +109,7 @@ export default { this.getXiYao(1,1) } else { // 中药检索 // this.getTowCateList(id) + this.getCNYao() // book/materials/getMaterialsList } }, setTwoCateIndex(item, index) { @@ -152,6 +154,48 @@ export default { url: "./medicineSearchDetail?id=" + item.id }) }, + // 获取中药 + getCNYao(id, type) { + $http.request({ + url: "book/materials/getMaterialsList", + method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 + data: { + // loadAnimate: 'none', // 请求加载动画 + "limit": 10, + "current": 1, + "name":"", + "type": "", // 植物、矿物、动物 + "effect": "",//功效 + "taste": "", //味 + "property": "", //性 + "tropism":"" //归经 + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }).then(res => { + console.log(res, '内容获取成功') + if (res.code == 0 && res.result.records.length > 0) { + this.titleList = res.result.records + } else { + this.titleList = [] + } + }).catch(e => { + this.titleList = [] + console.log(e) + }) + }, + gotoCNDetail(item) { + console.log('2222') + uni.navigateTo({ + url: "./CNMedicineSearchDetail?id=" + item.id + }) + }, + checkDisable(){ + uni.navigateTo({ + url: "./CNMedicineSearch" + }) + } } }; diff --git a/pages/prescript/prescript.vue b/pages/prescript/prescript.vue index c30b111..7c8ea5a 100644 --- a/pages/prescript/prescript.vue +++ b/pages/prescript/prescript.vue @@ -58,8 +58,8 @@ - - + + @@ -221,6 +221,9 @@ if (index == 1) { // this.setOneCateIndex(id) + console.log(this.$refs) + console.log(this.$refs.mSearch) + this.$refs.mSearch.getCNYao() }else{ this.setOneCateIndex(this.oneCateList[0], 0) }