You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zx/chazhao/chazhao.js

64 lines
1.4 KiB

Page({
shujichzhao: function (e) {
var that = this
wx.request({
<<<<<<< Updated upstream
url: 'http://localhost:9528/zxbook/find1',
=======
url: 'http://localhost:9527/zxbook/find1',
>>>>>>> Stashed changes
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);
}
})