diff --git a/fastjson-1.2.54.jar b/fastjson-1.2.54.jar new file mode 100644 index 0000000..11a0230 Binary files /dev/null and b/fastjson-1.2.54.jar differ diff --git a/mysql-connector-java-8.0.13.jar b/mysql-connector-java-8.0.13.jar new file mode 100644 index 0000000..362fd6e Binary files /dev/null and b/mysql-connector-java-8.0.13.jar differ diff --git a/servlet-api.jar b/servlet-api.jar new file mode 100644 index 0000000..683cb08 Binary files /dev/null and b/servlet-api.jar differ diff --git a/yanzheng/Yanzheng.java b/yanzheng/Yanzheng.java new file mode 100644 index 0000000..e148b3d --- /dev/null +++ b/yanzheng/Yanzheng.java @@ -0,0 +1,134 @@ +package yanzheng; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.URL; +import java.net.URLConnection; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson.JSONObject; + + + + +@WebServlet("/Yanzheng") +public class Yanzheng extends HttpServlet { + private static final long serialVersionUID = 1L; + + public Yanzheng() { + super(); + // TODO Auto-generated constructor stub + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + doPost(request, response); + } + + public static String SendGET(String url,String param){ + String result="";//访问返回结果 + BufferedReader read=null;//读取访问结果 + URL realurl=null; + URLConnection connection=null; + try { + //创建url + realurl=new URL(new StringBuffer(url).toString()); + //打开连接 + connection=realurl.openConnection(); + // 设置通用的请求属性 + connection.setRequestProperty("accept", "*/*"); + connection.setRequestProperty("connection", "Keep-Alive"); + connection.setRequestProperty("user-agent", + "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); + //建立连接 + connection.connect(); + // 获取所有响应头字段 + Map> map = connection.getHeaderFields(); + // 遍历所有的响应头字段,获取到cookies等 + for (String key : map.keySet()) { + System.out.println(key + "--->" + map.get(key)); + } + // 定义 BufferedReader输入流来读取URL的响应 + read = new BufferedReader(new InputStreamReader( + connection.getInputStream(),"UTF-8")); + String line;//循环读取 + while ((line = read.readLine()) != null) { + result += line; + } + } catch (IOException e) { + e.printStackTrace(); + }finally{ + if(read!=null){//关闭流 + try { + read.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +// if(connection != null) { +// connection. +// } + } + + return result; + } + + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + response.setHeader("Content - Encoding","utf-8"); + response.setContentType("text/json; charset=utf-8"); + String code =request.getParameter("code"); + StringBuffer url = new StringBuffer("https://api.weixin.qq.com/sns/jscode2session?"); + url.append("appid=wxdc9f23490d56599c"); + url.append("&secret=c39052978a3e80d55ff53227013384ce"); + url.append("&js_code="); url.append(code); + url.append("&grant_type=authorization_code"); + String finalURL = url.toString(); + String res = SendGET(finalURL, ""); + JSONObject json = JSONObject.parseObject(res); + System.out.println(json.toString()); + int errcode = json.getIntValue("errcode"); + PrintWriter out = response.getWriter(); + JSONObject toxcx = new JSONObject(); + if(errcode == 0) { + String openid = json.getString("openid"); + String session_key = json.getString("session_key"); + //插入数据库中还没做 + + String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + Random random=new Random(); + StringBuffer sb=new StringBuffer(); + for(int i=0;i<20;i++){ + int number=random.nextInt(62); + sb.append(str.charAt(number)); + } + toxcx.put("errcode","成功"); + toxcx.put("verification",sb.toString()); + out.println(toxcx.toString()); + out.flush(); + } + else if(errcode == -1) { // 系统繁忙,此时请开发者稍候再试 + toxcx.put("errcode","-1 系统繁忙,请稍候再试"); + out.println(toxcx.toString()); + out.flush(); + } + else if(errcode == 40029) { // code 无效 + toxcx.put("errcode","40029 code无效"); + out.println(toxcx.toString()); + out.flush(); + } + else if(errcode == 45011){ //频率限制,每个用户每分钟100次 + toxcx.put("errcode","45011 操作过于频繁"); + out.println(toxcx.toString()); + out.flush(); + } + } +} 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 25ab6a8..8a0bb7e 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 2c96818..1ab4708 100644 --- a/江可飞/小程序开发/pages/gouwu/gouwu.js +++ b/江可飞/小程序开发/pages/gouwu/gouwu.js @@ -5,9 +5,15 @@ Page({ * 页面的初始数据 */ data: { +<<<<<<< HEAD 'iscart':false, 'goodList': [ { +======= + 'iscart': false, + 'checked': [], + 'goodList': [{ +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae 'cover': '/pages/index/image/suanfa.jpg', 'isbn': '9787535482051', 'desc': '计算机算法设计', @@ -48,11 +54,12 @@ Page({ 'checked': false } ], + 'bookList': [], 'checkAll': false, 'totalCount': 0, 'totalPrice': 0, - 'consignee':"杨盼成", - 'phone':'12345678912' + 'consignee': "杨盼成", + 'phone': '12345678912' }, /** @@ -60,12 +67,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 }); @@ -77,15 +84,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); @@ -98,16 +105,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(); } @@ -116,27 +123,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; } @@ -149,7 +156,7 @@ Page({ } this.setData({ - 'goodList': checkboxItems, + 'bookList': checkboxItems, 'checkAll': checkAll }); this.calculateTotal(); @@ -158,7 +165,7 @@ Page({ /** * 用户点击全选 */ - selectalltap: function (e) { + selectalltap: function(e) { // console.log('用户点击全选,携带value值为:', e.detail.value); var value = e.detail.value; var checkAll = false; @@ -166,15 +173,15 @@ 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(); }, @@ -185,61 +192,87 @@ Page({ }, - /** - * 生命周期函数--监听页面加载 - */ - 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() { }, +<<<<<<< HEAD newAddress: function () { if (this.data.totalCount >0) {wx.navigateTo({ @@ -255,3 +288,33 @@ Page({ } } }) +======= + + 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 + // }) + // } + } + +}) +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae diff --git a/江可飞/小程序开发/pages/gouwu/gouwu.wxml b/江可飞/小程序开发/pages/gouwu/gouwu.wxml index 607f06f..577eab9 100644 --- a/江可飞/小程序开发/pages/gouwu/gouwu.wxml +++ b/江可飞/小程序开发/pages/gouwu/gouwu.wxml @@ -1,5 +1,6 @@ +<<<<<<< HEAD @@ -37,38 +38,89 @@ +======= + + + + +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae + + + + + + - + + - - - - - - - 已选择 - {{totalCount}}件商品 - - 总价: - ¥{{totalPrice}} + + + + + + {{book.BookName}} + + + ¥{{book.Price}} + + - + + + + +<<<<<<< HEAD 去结算 +======= +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae + + + + + + + + + + + 已选择 + {{totalCount}}件商品 + + 总价: + ¥{{totalPrice}} + + + + 去结算 + + + - - + + \ No newline at end of file diff --git a/江可飞/小程序开发/pages/order/order.js b/江可飞/小程序开发/pages/order/order.js index 83f9177..ef030ac 100644 --- a/江可飞/小程序开发/pages/order/order.js +++ b/江可飞/小程序开发/pages/order/order.js @@ -9,10 +9,20 @@ Page({ 'goodsDate': '2018-11-11', 'totalCount': 0, 'totalPrice': 0, - 'address':'湖南师范大学理学院', + 'address': '湖南师范大学理学院', 'consignee': "杨盼成", +<<<<<<< HEAD 'phone': '123456789', 'unpaidList': [//待付款 +======= + 'phone': '12345678912', + 'unpaidList': [], //待付款 + 'dueinList': [], //待收货 + 'deliverList': [], //待发货 + 'checkList':[], + + 'unpaidLists': [ //待付款 +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae { 'cover': '../index/image/suanfa.jpg', 'isbn': '9787535482051', @@ -35,7 +45,7 @@ Page({ 'count': 5 } ], - 'deliverList':[//待发货 + 'deliverLists': [ //待发货 { 'cover': '../index/image/suanfa.jpg', 'isbn': '9787535482051', @@ -55,7 +65,7 @@ Page({ 'count': 5 } ], - 'dueinList': [//待收货 + 'dueinLists': [ //待收货 { 'cover': '../index/image/suanfa.jpg', 'isbn': '9787535482051', @@ -77,32 +87,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 +174,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 2fb4df5..8bf5a54 100644 --- a/江可飞/小程序开发/pages/shdz/shdz.js +++ b/江可飞/小程序开发/pages/shdz/shdz.js @@ -31,5 +31,24 @@ Page({ this.setData({ tapCurrent: current }) +<<<<<<< HEAD } +======= + }, + toWode: function () { + wx.showToast({ + title: '保存成功!', + icon: 'success', + duration: 2000 + }) + + setTimeout(function () { + //要延时执行的代码 + wx.switchTab({ + url: "/pages/wode/wode" + }) + }, 2000) + + }, +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae }) diff --git a/江可飞/小程序开发/pages/shdz/shdz.wxml b/江可飞/小程序开发/pages/shdz/shdz.wxml index e76e95a..a1787c9 100644 --- a/江可飞/小程序开发/pages/shdz/shdz.wxml +++ b/江可飞/小程序开发/pages/shdz/shdz.wxml @@ -1,5 +1,6 @@ +<<<<<<< HEAD @@ -30,4 +31,46 @@ 保存 +======= + + + + + + + + + + + + + + +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae + + + 保存 + + \ No newline at end of file diff --git a/江可飞/小程序开发/pages/shdz/shdz.wxss b/江可飞/小程序开发/pages/shdz/shdz.wxss index 8a7c4a5..f264649 100644 --- a/江可飞/小程序开发/pages/shdz/shdz.wxss +++ b/江可飞/小程序开发/pages/shdz/shdz.wxss @@ -1,4 +1,5 @@ /* pages/shdz/shdz.wxss */ +<<<<<<< HEAD #address{ width:100%; height:100%; @@ -49,4 +50,88 @@ 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; + +>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae } \ 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 d51cc38..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' } ], }, diff --git a/江可飞/小程序开发/pages/wode/wode.wxml b/江可飞/小程序开发/pages/wode/wode.wxml index e290697..7b782fa 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 2f2a60c..e4dca5b 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`);