Page({ shujichzhao: function (e) { var that = this wx.request({ url: 'http://localhost:9528/zxbook/find1', data: { 'search': e.detail.value.search, }, header: { "Content-Type": "pplication/json" }, methods: { method: "POST", }, success: function (res) { if(res.data=='zhaobudao'){ wx.showModal({ title: '书籍查询', content: '未找到该书籍', confirmColor: "rgba(253, 153, 65, 1)" }) } else{ var book=res.data let bookstr = JSON.stringify(book); console.log(book); wx.navigateTo({ url: '../shuji/shuji?bookstr=' + bookstr, }) } } }) }, fenlei:function(e){ wx.request({ url: 'http://localhost:9527/zxbook/find2', data:{ 'search':e.target.id, }, header: { "Content-Type": "application/json" }, methods: { method: "POST", }, }) console.log(e.target.id); var book = res.data let bookstr = JSON.stringify(book); console.log(book); } })