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.
|
|
|
Page({
|
|
|
|
data: {
|
|
|
|
isLike: true,
|
|
|
|
// banner
|
|
|
|
imgUrls: [
|
|
|
|
"/pages/index/image/suanfa.jpg"
|
|
|
|
],
|
|
|
|
'book': [],
|
|
|
|
|
|
|
|
|
|
|
|
// 商品详情介绍
|
|
|
|
detailImg: [
|
|
|
|
"/pages/index/image/suanfa.jpg"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
onload:function(options){
|
|
|
|
var thats = this
|
|
|
|
wx.request({
|
|
|
|
url: "http://45.76.158.31:8080/web/GetFrontInfo.do?bookid="+options.id,
|
|
|
|
header: {
|
|
|
|
"content-type": "json"
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res.data)
|
|
|
|
if (res.statusCode == 200) {
|
|
|
|
thats.setData({
|
|
|
|
book: res.data,
|
|
|
|
})
|
|
|
|
//wx.hideNavigationBarLoading()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
//预览图片
|
|
|
|
previewImage: function (e) {
|
|
|
|
var current = e.target.dataset.src;
|
|
|
|
|
|
|
|
wx.previewImage({
|
|
|
|
current: current, // 当前显示图片的http链接
|
|
|
|
urls: this.data.imgUrls // 需要预览的图片http链接列表
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
// 跳到购物车
|
|
|
|
addCar() {
|
|
|
|
var reqData="{'BookName':'','BookID':'','count':''}"
|
|
|
|
wx.request({
|
|
|
|
url: '',
|
|
|
|
data: {reqData:reqData},
|
|
|
|
header: {'Content-Type': 'application/x-www-form-urlencoded'},
|
|
|
|
method: 'POST',
|
|
|
|
dataType: 'json',
|
|
|
|
responseType: 'text',
|
|
|
|
success: function(res) {
|
|
|
|
console.log("sucess")
|
|
|
|
},
|
|
|
|
fail: function(res) {},
|
|
|
|
complete: function(res) {},
|
|
|
|
})
|
|
|
|
wx.switchTab({
|
|
|
|
url: '/pages/gouwu/gouwu'
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 立即购买
|
|
|
|
immeBuy() {
|
|
|
|
wx.showToast({
|
|
|
|
title: '购买成功',
|
|
|
|
icon: 'success',
|
|
|
|
duration: 2000
|
|
|
|
});
|
|
|
|
},
|
|
|
|
})
|