diff --git a/江可飞/小程序开发.rar b/江可飞/小程序开发.rar
new file mode 100644
index 0000000..dcbc1af
Binary files /dev/null and b/江可飞/小程序开发.rar differ
diff --git a/江可飞/小程序开发/app.js b/江可飞/小程序开发/app.js
index 841d482..d5d6acb 100644
--- a/江可飞/小程序开发/app.js
+++ b/江可飞/小程序开发/app.js
@@ -11,6 +11,8 @@ App({
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
+ var code = res.code
+
}
})
// 获取用户信息
diff --git a/江可飞/小程序开发/pages/detail/detail.js b/江可飞/小程序开发/pages/detail/detail.js
index 3e5544c..7042096 100644
--- a/江可飞/小程序开发/pages/detail/detail.js
+++ b/江可飞/小程序开发/pages/detail/detail.js
@@ -4,8 +4,8 @@ Page({
// banner
imgUrls: [
"/pages/index/image/suanfa.jpg"
-
],
+ 'book': [],
// 商品详情介绍
@@ -13,6 +13,26 @@ Page({
"/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;
@@ -22,8 +42,23 @@ Page({
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'
})
diff --git a/江可飞/小程序开发/pages/detail/detail.wxml b/江可飞/小程序开发/pages/detail/detail.wxml
index f02fbe4..2604474 100644
--- a/江可飞/小程序开发/pages/detail/detail.wxml
+++ b/江可飞/小程序开发/pages/detail/detail.wxml
@@ -1,27 +1,28 @@
-
+
-
+
- 算法设计
- ¥20
+ {{book[0].BookName}}
+ ¥{{book[0].Price}}
请选择购买数量
- 商品评价
+ 商品评价:{{book[0].Introduce}}
商品详情
-
+
+
diff --git a/江可飞/小程序开发/pages/fenlei/fenlei.js b/江可飞/小程序开发/pages/fenlei/fenlei.js
index 217be54..33cf5c8 100644
--- a/江可飞/小程序开发/pages/fenlei/fenlei.js
+++ b/江可飞/小程序开发/pages/fenlei/fenlei.js
@@ -1,113 +1,152 @@
// pages/fenlei/fenlei.js
Page({
data: {
+ 'book':[],
cateItems: [
{
cate_id: 1,
- cate_name: "小说",
+ cate_name: "玄幻",
ishaveChild: true,
- children:
- [
- {
- child_id: 1,
- name: '福尔摩斯',
- image: "/pages/index/image/xs1.jpg"
- },
- {
- child_id: 2,
- name: '莫泊桑',
- image: "/pages/index/image/xs2.jpg"
- },
- {
- child_id: 3,
- name: '盗墓笔记',
- image: "/pages/index/image/xs3.jpg"
- },
- {
- child_id: 4,
- name: '明朝那些事',
- image: "/pages/index/image/xs4.jpg"
- }
- ]
+ // children:
+ // [
+ // {
+ // child_id: 1,
+ // name: '福尔摩斯',
+ // image: "/pages/index/image/xs1.jpg"
+ // },
+ // {
+ // child_id: 2,
+ // name: '莫泊桑',
+ // image: "/pages/index/image/xs2.jpg"
+ // },
+ // {
+ // child_id: 3,
+ // name: '盗墓笔记',
+ // image: "/pages/index/image/xs3.jpg"
+ // },
+ // {
+ // child_id: 4,
+ // name: '明朝那些事',
+ // image: "/pages/index/image/xs4.jpg"
+ // }
+ // ]
},
{
cate_id: 2,
- cate_name: "科学期刊",
+ cate_name: "魔幻",
ishaveChild: true,
- children:
- [
- {
- child_id: 1,
- name: '世界百科',
- image: "/pages/index/image/kxqk1.jpg"
- },
- {
- child_id: 2,
- name: '动物百科',
- image: "/pages/index/image/kxqk2.jpg"
- },
- {
- child_id: 3,
- name: '趣味科学',
- image: "/pages/index/image/kxqk3.jpg"
- }
- ]
+ // children:
+ // [
+ // {
+ // child_id: 1,
+ // name: '世界百科',
+ // image: "/pages/index/image/kxqk1.jpg"
+ // },
+ // {
+ // child_id: 2,
+ // name: '动物百科',
+ // image: "/pages/index/image/kxqk2.jpg"
+ // },
+ // {
+ // child_id: 3,
+ // name: '趣味科学',
+ // image: "/pages/index/image/kxqk3.jpg"
+ // }
+ // ]
},
{
cate_id: 3,
- cate_name: "儿童书籍",
+ cate_name: "奇幻",
ishaveChild: true,
- children:
- [
- {
- child_id: 1,
- name: '父与子全集',
- image: "/pages/index/image/etsj1.jpg"
- },
- {
- child_id: 2,
- name: '丁丁历险记',
- image: "/pages/index/image/etsj2.jpg"
- },
- {
- child_id: 3,
- name: '美丽星空',
- image: "/pages/index/image/etsj3.jpg"
- },
- {
- child_id: 4,
- name: '小虎神探队',
- image: "/pages/index/image/etsj4.jpg"
- }
- ]
+ // children:
+ // [
+ // {
+ // child_id: 1,
+ // name: '父与子全集',
+ // image: "/pages/index/image/etsj1.jpg"
+ // },
+ // {
+ // child_id: 2,
+ // name: '丁丁历险记',
+ // image: "/pages/index/image/etsj2.jpg"
+ // },
+ // {
+ // child_id: 3,
+ // name: '美丽星空',
+ // image: "/pages/index/image/etsj3.jpg"
+ // },
+ // {
+ // child_id: 4,
+ // name: '小虎神探队',
+ // image: "/pages/index/image/etsj4.jpg"
+ // }
+ // ]
},
{
cate_id: 4,
- cate_name: "计算机",
+ cate_name: "都市",
ishaveChild: true,
- children: [
- {
- child_id: 1,
- name: 'Java Web',
- image: "/pages/index/image/java.jpg"
- },
- {
- child_id: 2,
- name: '计算机网络',
- image:"/pages/index/image/jsswl.jpg"
- },
- ]
+ // children: [
+ // {
+ // child_id: 1,
+ // name: 'Java Web',
+ // image: "/pages/index/image/java.jpg"
+ // },
+ // {
+ // child_id: 2,
+ // name: '计算机网络',
+ // image:"/pages/index/image/jsswl.jpg"
+ // },
+ // ]
}
],
curNav: 1,
curIndex: 0
},
+ onload:function(){
+ var thats = this
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do?type=" + 1,
+ header: {
+ "content-type": "json"
+ },
+ success: function (res) {
+ console.log(res.data)
+ if (res.statusCode == 200) {
+ thats.setData({
+ book: res.data,
+ })
+ //wx.hideNavigationBarLoading()
+ }
+ }
+ })
+ },
+
//事件处理函数
switchRightTab: function (e) {
// 获取item项的id,和数组的下标值
let id = e.target.dataset.id,
index = parseInt(e.target.dataset.index);
+ console.log(id)
+ var thats = this
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do?type="+id,
+ header: {
+ "content-type": "json"
+ },
+ success: function (res) {
+ console.log(res.data)
+ if (res.statusCode == 200) {
+ thats.setData({
+ book: res.data,
+ ppt: res.data
+ })
+ //wx.hideNavigationBarLoading()
+ }
+ }
+ })
+
// 把点击到的某一项,设为当前index
this.setData({
curNav: id,
diff --git a/江可飞/小程序开发/pages/fenlei/fenlei.wxml b/江可飞/小程序开发/pages/fenlei/fenlei.wxml
index 4a98c7d..2ddb9f0 100644
--- a/江可飞/小程序开发/pages/fenlei/fenlei.wxml
+++ b/江可飞/小程序开发/pages/fenlei/fenlei.wxml
@@ -13,12 +13,12 @@
-
+
-
-
- {{item.name}}
+
+
+ {{books.BookName}}
diff --git a/江可飞/小程序开发/pages/gouwu/gouwu.js b/江可飞/小程序开发/pages/gouwu/gouwu.js
index 5d97fd7..afdc8ee 100644
--- a/江可飞/小程序开发/pages/gouwu/gouwu.js
+++ b/江可飞/小程序开发/pages/gouwu/gouwu.js
@@ -5,8 +5,9 @@ Page({
* 页面的初始数据
*/
data: {
- 'goodList': [
- {
+ 'iscart': false,
+ 'checked': [],
+ 'goodList': [{
'cover': '/pages/index/image/suanfa.jpg',
'isbn': '9787535482051',
'desc': '计算机算法设计',
@@ -47,11 +48,12 @@ Page({
'checked': false
}
],
+ 'bookList': [],
'checkAll': false,
'totalCount': 0,
'totalPrice': 0,
- 'consignee':"杨盼成",
- 'phone':'12345678912'
+ 'consignee': "杨盼成",
+ 'phone': '12345678912'
},
/**
@@ -59,12 +61,12 @@ Page({
*/
deleteList(e) {
const index = e.currentTarget.dataset.index;
- let goodList = this.data.goodList;
- goodList.splice(index, 1);
+ let bookList = this.data.bookList;
+ bookList.splice(index, 1);
this.setData({
- goodList: goodList
+ bookList: bookList
});
- if (!goodList.length) {
+ if (!bookList.length) {
this.setData({
iscart: true
});
@@ -76,15 +78,15 @@ Page({
/**
* 计算商品总数
*/
- calculateTotal: function () {
- var goodList = this.data.goodList;
+ calculateTotal: function() {
+ var bookList = this.data.bookList;
var totalCount = 0;
var totalPrice = 0;
- for (var i = 0; i < goodList.length; i++) {
- var good = goodList[i];
- if (good.checked) {
- totalCount += good.count;
- totalPrice += good.count * good.price;
+ for (var i = 0; i < bookList.length; i++) {
+ var book = bookList[i];
+ if (book.checked) {
+ totalCount += book.count;
+ totalPrice += book.count * book.price;
}
}
totalPrice = totalPrice.toFixed(2);
@@ -97,16 +99,16 @@ Page({
/**
* 用户点击商品减1
*/
- subtracttap: function (e) {
+ subtracttap: function(e) {
var index = e.target.dataset.index;
- var goodList = this.data.goodList;
- var count = goodList[index].count;
+ var bookList = this.data.bookList;
+ var count = bookList[index].count;
if (count <= 1) {
return;
} else {
- goodList[index].count--;
+ bookList[index].Count--;
this.setData({
- 'goodList': goodList
+ 'bookList': bookList
});
this.calculateTotal();
}
@@ -115,27 +117,27 @@ Page({
/**
* 用户点击商品加1
*/
- addtap: function (e) {
+ addtap: function(e) {
var index = e.target.dataset.index;
- var goodList = this.data.goodList;
- var count = goodList[index].count;
- goodList[index].count++;
+ var bookList = this.data.bookList;
+ var count = bookList[index].count;
+ bookList[index].Count++;
this.setData({
- 'goodList': goodList
+ 'bookList': bookList
});
this.calculateTotal();
},
/**
* 用户选择购物车商品
*/
- checkboxChange: function (e) {
+ checkboxChange: function(e) {
console.log('checkbox发生change事件,携带value值为:', e.detail.value);
- var checkboxItems = this.data.goodList;
+ var checkboxItems = this.data.bookList;
var values = e.detail.value;
for (var i = 0; i < checkboxItems.length; ++i) {
checkboxItems[i].checked = false;
for (var j = 0; j < values.length; ++j) {
- if (checkboxItems[i].isbn == values[j]) {
+ if (checkboxItems[i].BookID == values[j]) {
checkboxItems[i].checked = true;
break;
}
@@ -148,7 +150,7 @@ Page({
}
this.setData({
- 'goodList': checkboxItems,
+ 'bookList': checkboxItems,
'checkAll': checkAll
});
this.calculateTotal();
@@ -157,7 +159,7 @@ Page({
/**
* 用户点击全选
*/
- selectalltap: function (e) {
+ selectalltap: function(e) {
// console.log('用户点击全选,携带value值为:', e.detail.value);
var value = e.detail.value;
var checkAll = false;
@@ -165,74 +167,124 @@ Page({
checkAll = true;
}
- var goodList = this.data.goodList;
- for (var i = 0; i < goodList.length; i++) {
- var good = goodList[i];
- good['checked'] = checkAll;
+ var bookList = this.data.bookList;
+ for (var i = 0; i < bookList.length; i++) {
+ var book = bookList[i];
+ book['checked'] = checkAll;
}
this.setData({
'checkAll': checkAll,
- 'goodList': goodList
+ 'bookList': bookList
});
this.calculateTotal();
},
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
+ todetail: function(e) {
+ var id = e.target.dataset.id
+ wx.navigateTo({
+ url: "/pages/detail/detail?id=" + id
+ })
+ },
+ /**
+ * 生命周期函数--监听页面加载
+ */
+ onLoad: function(options) {
+ var that = this
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
+ header: {
+ "content-type": "json"
+ },
+ success: function(res) {
+ for (var i = 0; i < res.data.length; i++) {
+ res.data[i].checked = false;
+ }
+ console.log(res.data)
+ if (res.statusCode == 200) {
+ that.setData({
+ bookList: res.data,
+ })
+ //wx.hideNavigationBarLoading()
+ }
+ }
+ })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
- onReady: function () {
+ onReady: function() {
this.calculateTotal();
},
/**
* 生命周期函数--监听页面显示
*/
- onShow: function () {
+ onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
- onHide: function () {
+ onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
- onUnload: function () {
+ onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
- onPullDownRefresh: function () {
+ onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
- onReachBottom: function () {
+ onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
- onShareAppMessage: function () {
+ onShareAppMessage: function() {
},
+ newAddress: function() {
+ var checkList = [];
+ if (!this.data.iscart) {
+ var bookList = this.data.bookList
+ for (var i = 0; i < bookList.length; i++) {
+ if (bookList[i].checked) {
+ checkList.push(this.data.bookList[i])
+ }
+ }
+ }
+ var checkLists = JSON.stringify(checkList)
+ console.log(checkLists)
+ //if (this.data.totalCount > 0) {
+ wx.navigateTo({
+ url: '/pages/order/order?typeId=0&checkLists=' + checkLists
+ })
+ // }
+ // else {
+ // wx.showToast({
+ // title: '没有选择商品',
+ // icon: 'success',
+ // duration: 2000
+ // })
+ // }
+ }
-})
+})
\ No newline at end of file
diff --git a/江可飞/小程序开发/pages/gouwu/gouwu.wxml b/江可飞/小程序开发/pages/gouwu/gouwu.wxml
index bd728a8..f7da28c 100644
--- a/江可飞/小程序开发/pages/gouwu/gouwu.wxml
+++ b/江可飞/小程序开发/pages/gouwu/gouwu.wxml
@@ -1,75 +1,80 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{good.desc}}
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
- 已选择
- {{totalCount}}件商品
-
- 总价:
- ¥{{totalPrice}}
+
+
+
+
+
+ {{book.BookName}}
+
+
-
- 去结算
-
+
+
+
+
+
+
+
+
+
+
+
+ 全选
+
+
+
+ 已选择
+ {{totalCount}}件商品
+
+ 总价:
+ ¥{{totalPrice}}
+
+
+
+ 去结算
+
+
+
-
-
-
- 购物车什么都没有,赶快去购物吧
-
+
+
+
+ 购物车什么都没有,赶快去购物吧
+
\ No newline at end of file
diff --git a/江可飞/小程序开发/pages/order/order.js b/江可飞/小程序开发/pages/order/order.js
index 17a98b4..580a9dd 100644
--- a/江可飞/小程序开发/pages/order/order.js
+++ b/江可飞/小程序开发/pages/order/order.js
@@ -9,10 +9,15 @@ Page({
'goodsDate': '2018-11-11',
'totalCount': 0,
'totalPrice': 0,
- 'address':'湖南师范大学理学院',
+ 'address': '湖南师范大学理学院',
'consignee': "杨盼成",
'phone': '12345678912',
- 'unpaidList': [//待付款
+ 'unpaidList': [], //待付款
+ 'dueinList': [], //待收货
+ 'deliverList': [], //待发货
+ 'checkList':[],
+
+ 'unpaidLists': [ //待付款
{
'cover': '../index/image/suanfa.jpg',
'isbn': '9787535482051',
@@ -35,7 +40,7 @@ Page({
'count': 5
}
],
- 'deliverList':[//待发货
+ 'deliverLists': [ //待发货
{
'cover': '../index/image/suanfa.jpg',
'isbn': '9787535482051',
@@ -55,7 +60,7 @@ Page({
'count': 5
}
],
- 'dueinList': [//待收货
+ 'dueinLists': [ //待收货
{
'cover': '../index/image/suanfa.jpg',
'isbn': '9787535482051',
@@ -77,32 +82,84 @@ Page({
],
},
- onLoad: function () {
- var unpaidList = this.data.unpaidList;
+ onLoad: function(options) {
+ var that = this
+ if (options.checkLists != null) {
+ that.data.ccheckList = JSON.parse(options.checkLists);
+ //console.log(checkList[0].BookName)
+ } else {
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
+ header: {
+ "content-type": "json"
+ },
+ success: function(res) {
+ if (res.statusCode == 200) {
+ console.log(res.data)
+ that.setData({
+ checkList :res.data
+ })
+ //wx.hideNavigationBarLoading()
+ }
+ }
+ })
+ }
+
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
+ header: {
+ "content-type": "json"
+ },
+ success: function(res) {
+ if (res.statusCode == 200) {
+ console.log(res.data)
+ that.setData({
+ dueinList: res.data
+ })
+ //wx.hideNavigationBarLoading()
+ }
+ }
+ })
+
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
+ header: {
+ "content-type": "json"
+ },
+ success: function (res) {
+ if (res.statusCode == 200) {
+ console.log(res.data)
+ that.setData({
+ deliverList: res.data
+ })
+ //wx.hideNavigationBarLoading()
+ }
+ }
+ })
+
+
+ that.setData({
+ currentTap: options.typeId,
+ unpaidList: that.data.checkList
+ })
+ var unpaidList = that.data.unpaidList;
var totalCount = 0;
var totalPrice = 0;
- for (var i = 0; i < unpaidList.length; i++) {
- var good = unpaidList[i];
- totalCount += good.count;
- totalPrice += good.count * good.price;
+ for (var i = 0; i < that.data.unpaidList.l; i++) {
+ var book = that.data.unpaidList[i];
+ totalCount += book.Count;
+ totalPrice += book.Count * book.Price;
}
totalPrice = totalPrice.toFixed(2);
- this.setData({
+ that.setData({
'totalCount': totalCount,
'totalPrice': totalPrice
})
},
- onLoad: function (options){
- var that = this
- this.setData({
- currentTap: options.typeId
- })
- },
-
- deleteList: function (e) {
+ deleteList: function(e) {
this.setData({
- 'unpaidList':null
+ 'unpaidList': null
});
},
@@ -112,5 +169,5 @@ Page({
currentTap: current
})
},
-
+
})
\ No newline at end of file
diff --git a/江可飞/小程序开发/pages/order/order.wxml b/江可飞/小程序开发/pages/order/order.wxml
index 3cfdde7..d081d25 100644
--- a/江可飞/小程序开发/pages/order/order.wxml
+++ b/江可飞/小程序开发/pages/order/order.wxml
@@ -12,26 +12,26 @@
-
+
订单创建时期:
- {{goodsDate}}
+ 2018-11-11
等待付款
-
+
-
+
- {{good.desc}}
+ {{book.BookName}}
- 数量:{{good.count}}
- {{good.price*good.count}}
+ 数量:{{book.Count}}
+ {{book.Price*book.Count}}
@@ -55,25 +55,25 @@
-
+
发货日期:
- {{goodsDate}}
+ 2018-11-11
正在配送中
-
+
-
+
- {{good.desc}}
+ {{book.BookName}}
- 数量:{{good.count}}
+ 数量:{{book.Count}}
@@ -83,7 +83,7 @@
收货地址:
- {{address}}
+ {{book.Addresss}}
@@ -91,7 +91,7 @@
收货人:
- {{consignee}}
+ {{book.consignee}}
@@ -99,7 +99,7 @@
电话:
- {{phone}}
+ {{book.phone}}
@@ -113,7 +113,7 @@
-
+
付款日期:
@@ -124,14 +124,14 @@
-
+
-
+
- {{good.desc}}
+ {{book.BookName}}
- 数量:{{good.count}}
+ 数量:{{book.Count}}
@@ -141,7 +141,7 @@
收货地址:
- {{address}}
+ {{book.Address}}
@@ -149,7 +149,7 @@
收货人:
- {{consignee}}
+ {{book.consignee}}
@@ -157,7 +157,7 @@
电话:
- {{phone}}
+ {{book.phone}}
diff --git a/江可飞/小程序开发/pages/shdz/shdz.js b/江可飞/小程序开发/pages/shdz/shdz.js
index 81d5896..76e687d 100644
--- a/江可飞/小程序开发/pages/shdz/shdz.js
+++ b/江可飞/小程序开发/pages/shdz/shdz.js
@@ -26,9 +26,19 @@ Page({
tapCurrent: current
})
},
- newAddress: function () {
- wx.navigateTo({
- url: "/pages/wode/wode"
- })
+ toWode: function () {
+ wx.showToast({
+ title: '保存成功!',
+ icon: 'success',
+ duration: 2000
+ })
+
+ setTimeout(function () {
+ //要延时执行的代码
+ wx.switchTab({
+ url: "/pages/wode/wode"
+ })
+ }, 2000)
+
},
})
diff --git a/江可飞/小程序开发/pages/shdz/shdz.wxml b/江可飞/小程序开发/pages/shdz/shdz.wxml
index 3cdb679..ee116f6 100644
--- a/江可飞/小程序开发/pages/shdz/shdz.wxml
+++ b/江可飞/小程序开发/pages/shdz/shdz.wxml
@@ -1,36 +1,43 @@
-
-
-
- 李雷
-
-
- 科技路高新大都荟
-
-
-
- 18888888888
-
-
-
-
-
- 默认地址
-
-
-
- 编辑
-
-
-
- 删除
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- 保存
-
-
+
+ 保存
+
+
\ No newline at end of file
diff --git a/江可飞/小程序开发/pages/shdz/shdz.wxss b/江可飞/小程序开发/pages/shdz/shdz.wxss
index 950ac09..631a7ea 100644
--- a/江可飞/小程序开发/pages/shdz/shdz.wxss
+++ b/江可飞/小程序开发/pages/shdz/shdz.wxss
@@ -1,52 +1,84 @@
/* pages/shdz/shdz.wxss */
-#address{
- width:100%;
- height:100%;
- background:#f5f5f5}
-.address_item{
- border-bottom:solid 1px #ececec;
- padding:40rpx 25rpx;
- background:#fff;
-}
-.address_left .text1{
- color:#262626;
- font-size:34rpx;}
-.text_other{
- margin-top:30rpx;
-}
-.address_right{
- font-size:30rpx;
- color:#262626;
-}
-.address_set{
- padding:20px 25rpx;
- border-bottom:solid 1px #ececec;
- background:#fff;
- justify-content:center;
- }
-.address_set text{font-size:24rpx;}
-.address_set .default{
- color:#2c9fe1;
- width:71%;
- align-items:center;
- height:30rpx;
- display:flex;
- align-items:center;
- }
-.address_set .default image{
- margin-right:15px;
- width:29rpx;
- height:29rpx;}
-.address_set .edit image{
- width:26rpx;
- height:26rpx;
- margin-right:10rpx;
-}
-.edit{color:#7d7d7d;width:15%;display:flex;
- align-items:center;}
-.de_color{color:#7d7d7d}
-.submit_info{
-margin-top:0rpx;
- position:absolute;
- bottom:120rpx;
+
+#address {
+ width: 100%;
+ height: 100%;
+ background: #f5f5f5;
+}
+
+.address_item {
+ border-bottom: solid 1px #ececec;
+ padding: 40rpx 25rpx;
+ background: #fff;
+}
+
+.address_left .text1 {
+ color: #262626;
+ font-size: 34rpx;
+}
+
+.text_other {
+ margin-top: 30rpx;
+}
+
+.address_right {
+ font-size: 30rpx;
+ color: #262626;
+}
+
+.address_set {
+ padding: 20px 25rpx;
+ border-bottom: solid 1px #ececec;
+ background: #fff;
+ justify-content: center;
+}
+
+.address_set text {
+ font-size: 24rpx;
+}
+
+.address_set .default {
+ color: #2c9fe1;
+ width: 71%;
+ align-items: center;
+ height: 30rpx;
+ display: flex;
+ align-items: center;
+}
+
+.address_set .default image {
+ margin-right: 15px;
+ width: 29rpx;
+ height: 29rpx;
+}
+
+.address_set .edit image {
+ width: 26rpx;
+ height: 26rpx;
+ margin-right: 10rpx;
+}
+
+.edit {
+ color: #7d7d7d;
+ width: 15%;
+ display: flex;
+ align-items: center;
+}
+
+.de_color {
+ color: #7d7d7d;
+}
+
+.submit_info {
+ margin-top: 0rpx;
+ position: absolute;
+ bottom: 120rpx;
+}
+
+.person-line {
+ width: 100%;
+ height: 2rpx;
+ background: rgb(211, 211, 211);
+ margin-left: 0rpx;
+
}
\ No newline at end of file
diff --git a/江可飞/小程序开发/pages/shouye/shouye.js b/江可飞/小程序开发/pages/shouye/shouye.js
index 7c5dfda..3853041 100644
--- a/江可飞/小程序开发/pages/shouye/shouye.js
+++ b/江可飞/小程序开发/pages/shouye/shouye.js
@@ -5,15 +5,14 @@ const api = require('../../utils/api.js');
Page({
data: {
- motto: 'Hello World',
+ search_txt:'',
+ url: '',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),
- imgUrls: [
- '../index/image/banner/banner1.jpg',
- '../index/image/banner/banner2.jpg',
- '../index/image/banner/banner3.jpg'
- ],
+ 'ppt':[],
+ 'book': [],
+
indicatorDots: true,
autoplay: true,
interval: 5000,
@@ -21,92 +20,137 @@ Page({
forumList: [],
},
//事件处理函数
- // bindViewTap: function () {
- // wx.navigateTo({
- // url: '../logs/logs'
- // })
+ // bindViewTap: function () {
+ // wx.navigateTo({
+ // url: '../logs/logs'
+ // })
//},
onShow() {
},
- onLoad: function () {
- let that = this;
- wx.getStorage({
- key: 'bbsProfile',
- fail: function (res) {
- that.login();
- }
- })
- this.getForum();
- if (app.globalData.userInfo) {
- this.setData({
- userInfo: app.globalData.userInfo,
- hasUserInfo: true
- })
- } else if (this.data.canIUse) {
- // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
- // 所以此处加入 callback 以防止这种情况
- app.userInfoReadyCallback = res => {
- this.setData({
- userInfo: res.userInfo,
- hasUserInfo: true
- })
- }
- } else {
- // 在没有 open-type=getUserInfo 版本的兼容处理
- wx.getUserInfo({
- success: res => {
- app.globalData.userInfo = res.userInfo
- this.setData({
- userInfo: res.userInfo,
- hasUserInfo: true
- })
- }
- })
- }
+
+ searchSubmit:function(e){
+ console.log("in formSubmit: "+e.detail.value)
+ var thats = this
- },
- getUserInfo: function (e) {
- console.log(e)
- app.globalData.userInfo = e.detail.userInfo
- this.setData({
- userInfo: e.detail.userInfo,
- hasUserInfo: true
+ thats.setData({
+
+ search_txt: e.detail.value
+
})
- },
- getForum() {
- let data = {
- pageNo: "0",
- pageSize: "5"
- };
- api.getForum({
- data,
- success: (res) => {
- this.setData({
- forumList: res.data.content
- })
+
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do?bookname="+e.detail.value+"&fuzzy=true",
+ header: {
+ "content-type": "json"
+ },
+ success: function (res) {
+ console.log(res.data)
+ if (res.statusCode == 200) {
+ thats.setData({
+ book: res.data,
+ })
+ //wx.hideNavigationBarLoading()
+ }
}
})
},
- login() {
- let data = {
- "username": "3f8bbbfaafda4d3e83e06b689d785e52",
- "password": "3f8bbbfaafda4d3e83e06b689d785e52"
- }
- api.login({
- data,
- success: (res) => {
- wx.setStorage({
- key: 'bbsProfile',
- data: res.data.item
- })
+
+ onLoad: function(options) {
+ var thats = this
+ wx.request({
+ url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
+ header: {
+ "content-type": "json"
+ },
+ success: function(res) {
+ console.log(res.data)
+ if (res.statusCode == 200) {
+ thats.setData({
+ book: res.data,
+ ppt:res.data
+ })
+ //wx.hideNavigationBarLoading()
+ }
}
})
+
+ // let that = this;
+ // wx.getStorage({
+ // key: 'bbsProfile',
+ // fail: function(res) {
+ // that.login();
+ // }
+ // })
+ // // this.getForum();
+ // if (app.globalData.userInfo) {
+ // this.setData({
+ // userInfo: app.globalData.userInfo,
+ // hasUserInfo: true
+ // })
+ // } else if (this.data.canIUse) {
+ // // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+ // // 所以此处加入 callback 以防止这种情况
+ // app.userInfoReadyCallback = res => {
+ // this.setData({
+ // userInfo: res.userInfo,
+ // hasUserInfo: true
+ // })
+ // }
+ // } else {
+ // // 在没有 open-type=getUserInfo 版本的兼容处理
+ // wx.getUserInfo({
+ // success: res => {
+ // app.globalData.userInfo = res.userInfo
+ // this.setData({
+ // userInfo: res.userInfo,
+ // hasUserInfo: true
+ // })
+ // }
+ // })
+ // }
+ // },
+ // getUserInfo: function(e) {
+ // console.log(e)
+ // app.globalData.userInfo = e.detail.userInfo
+ // this.setData({
+ // userInfo: e.detail.userInfo,
+ // hasUserInfo: true
+ // })
+ // },
+ // getForum() {
+ // let data = {
+ // pageNo: "0",
+ // pageSize: "5"
+ // };
+ // api.getForum({
+ // data,
+ // success: (res) => {
+ // this.setData({
+ // forumList: res.data.content
+ // })
+ // }
+ // })
+ // },
+ // login() {
+ // let data = {
+ // "username": "3f8bbbfaafda4d3e83e06b689d785e52",
+ // "password": "3f8bbbfaafda4d3e83e06b689d785e52"
+ // }
+ // api.login({
+ // data,
+ // success: (res) => {
+ // wx.setStorage({
+ // key: 'bbsProfile',
+ // data: res.data.item
+ // })
+ // }
+ // })
},
- toList(e) {
- wx.navigateTo({
- url: '../logs/logs?id=0',
- })
- }
+ // toList(e) {
+ // wx.navigateTo({
+ // url: '../logs/logs?id=0',
+ // })
+ // }
})
\ No newline at end of file
diff --git a/江可飞/小程序开发/pages/shouye/shouye.wxml b/江可飞/小程序开发/pages/shouye/shouye.wxml
index 56be061..a9fd359 100644
--- a/江可飞/小程序开发/pages/shouye/shouye.wxml
+++ b/江可飞/小程序开发/pages/shouye/shouye.wxml
@@ -1,55 +1,36 @@
-
-
+
-
+
-
+
-
推荐模块
-
+
-
+
- {{item.forum_name}}
- {{item.forum_description}}
+ {{books.BookName}}
+ {{books.Introduce}}
-
-
- 查看更多
-
-
-
\ No newline at end of file
diff --git a/江可飞/小程序开发/pages/wode/wode.js b/江可飞/小程序开发/pages/wode/wode.js
index f216f1c..4445557 100644
--- a/江可飞/小程序开发/pages/wode/wode.js
+++ b/江可飞/小程序开发/pages/wode/wode.js
@@ -22,12 +22,6 @@ Page({
name: '待发货',
url: 'bill',
imageurl: '/pages/index/image/fahuo.png',
- },
- {
- typeId: 3,
- name: '待评价',
- url: 'bill',
- imageurl: '/pages/index/image/pingjia.png'
}
],
},
@@ -40,23 +34,7 @@ Page({
})
},
onLoad: function() {
- console.log('onLoad')
- var that = this
- //调用应用实例的方法获取全局数据
- app.getUserInfo(function(userInfo) {
- //更新数据
- that.setData({
- userInfo: userInfo
- })
- })
- },
- getUserInfo: function(e) {
- console.log(e)
- app.globalData.userInfo = e.detail.userInfo
- this.setData({
- userInfo: e.detail.userInfo,
- hasUserInfo: true
- })
+
},
address: function() {
wx.navigateTo({
diff --git a/江可飞/小程序开发/pages/wode/wode.wxml b/江可飞/小程序开发/pages/wode/wode.wxml
index 6009c06..ac41ae2 100644
--- a/江可飞/小程序开发/pages/wode/wode.wxml
+++ b/江可飞/小程序开发/pages/wode/wode.wxml
@@ -17,11 +17,13 @@
+
我的订单
查看全部订单
+
@@ -35,16 +37,19 @@
+
我的收藏
+
收货地址
+
我的订单
@@ -54,6 +59,7 @@
我的评价
+
diff --git a/江可飞/小程序开发/project.config.json b/江可飞/小程序开发/project.config.json
index 76568dc..45ecf64 100644
--- a/江可飞/小程序开发/project.config.json
+++ b/江可飞/小程序开发/project.config.json
@@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
- "urlCheck": true,
+ "urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
diff --git a/江可飞/小程序开发/utils/api.js b/江可飞/小程序开发/utils/api.js
index 99a3ca3..2126254 100644
--- a/江可飞/小程序开发/utils/api.js
+++ b/江可飞/小程序开发/utils/api.js
@@ -1,18 +1,19 @@
-const apiURL = 'http://47.104.244.32:8100';
+const apiURL = 'http://45.76.158.31:8080';
+//http://localhost:8080/webapp/BookInfo.do?bookname=%E8%B5%B6&fuzzy=true
let headerData= {
}
headerData['Content-Type']= 'application/json';
let userData ={};
-wx.getStorage({
- key: 'bbsProfile',
- success: function(res) {
- userData = res.data;
- if(userData.token){
- headerData['Authorization']=userData.token;
- }
- }
-})
+// wx.getStorage({
+// key: 'bbsProfile',
+// success: function(res) {
+// userData = res.data;
+// if(userData.token){
+// headerData['Authorization']=userData.token;
+// }
+// }
+// })
const wxRequest = (params, url) => {
@@ -43,7 +44,9 @@ const wxRequest = (params, url) => {
};
const getForum = (params) => {
+ console.log(params)
wxRequest(params, `${apiURL}/forumManagement/getForum`);
+
};
const getQuestion = (params) => {
wxRequest(params, `${apiURL}/question/getQuestion`);