加上证书文件

master
201630126029 6 years ago
commit 80ff29e315

Binary file not shown.

Binary file not shown.

@ -1,7 +1,14 @@
//app.js
App({
globalData: {
UserID:null,
CodeID:null
},
onLaunch: function () {
var that = this
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
@ -11,9 +18,22 @@ App({
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
var code = res.code
console.log(res.code)
wx.request({
url: 'https://hunjianghu.xuanjis.com/web/Yanzheng',
data: {
"code": res.code
},
method: 'GET',
success: res1 => {
that.globalData.UserID = res1.data.UserID;
that.globalData.CodeID = res1.data.CodeID;
console.log(that.globalData.UserID)
}
})
}
})
// 获取用户信息
wx.getSetting({

@ -10,19 +10,23 @@ Page({
// 商品详情介绍
detailImg: [
"/pages/index/image/suanfa.jpg"
"/pages/index/image/suanfa.jpg"
],
},
onload:function(options){
onLoad: function (options) {
console.log("in detail")
var thats = this
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do?bookid="+options.id,
url: "http://45.76.158.31:8080/web/BookInfo.do?bookid=" + options.id,
header: {
"content-type": "json"
},
success: function (res) {
success: function(res) {
console.log(res.data)
for (var i = 0; i < res.data.length; i++) {
res.data[i].Count = 1;
}
if (res.statusCode == 200) {
thats.setData({
book: res.data,
@ -34,7 +38,7 @@ Page({
},
//预览图片
previewImage: function (e) {
previewImage: function(e) {
var current = e.target.dataset.src;
wx.previewImage({
@ -45,12 +49,19 @@ Page({
// 跳到购物车
addCar() {
var reqData="{'BookName':'','BookID':'','count':''}"
var that = this
wx.request({
url: '',
data: {reqData:reqData},
header: {'Content-Type': 'application/x-www-form-urlencoded'},
method: 'POST',
url: 'http://45.76.158.31:8080/web/AddCart.do',//?action=Modify&UserID=1&BookID=' + that.data.book[0].BookID + '&Count=' + that.data.book[0].Count,
data: {
'action':'Modify',
'UserID':1,
'BookID':that.data.book[0].BookID,
'Count':that.data.book[0].Count
},
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
// method: 'POST',
dataType: 'json',
responseType: 'text',
success: function(res) {

@ -1,30 +1,43 @@
<!--pages/detail/detail.wxml-->
<!-- banner -->
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{book}}" wx:for-item="books">
<swiper-item>
<image src="http://45.76.158.31:8080/web/BookImage/{{books.BookName}}.jpg" data-src="{{item}}" bindtap="previewImage"></image>
</swiper-item>
</block>
</swiper>
<scroll-view scroll-y="true">
<view class="detail">
<text class="title">{{book[0].BookName}}</text>
<text class="price">¥{{book[0].Price}}</text>
</view>
<view class="separate"></view>
<!-- sku选择 -->
<text bindtap="toggleDialog">请选择购买数量</text>
<view class="separate"></view>
<text>商品评价:{{book[0].Introduce}}</text>
<view class="separate"></view>
<text>商品详情</text>
<image class="image_detail" src="http://45.76.158.31:8080/web/BookImage/{{books.BookName}}.jpg" />
<!--<block wx:for-items="{{detailImg}}" wx:key="name">
<view wx:for="{{book}}" wx:for-item="books">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block>
<swiper-item>
<image src="http://45.76.158.31:8080/web/BookImage/{{books.BookName}}.jpg" data-src="{{item}}" bindtap="previewImage"></image>
</swiper-item>
</block>
</swiper>
<scroll-view scroll-y="true">
<view class="detail">
<text class="title">{{books.BookName}}</text>
<text class="price">¥{{books.Price}}</text>
</view>
<view class="separate"></view>
<!-- sku选择 -->
<text bindtap="toggleDialog">数量:1</text>
<!--
<view class='stepper'>
<view class='subtract {{book.Count == 1 ? "disabled": ""}}' data-index='{{index}}' catchtap='subtracttap'>-</view>
<input class='count' type='number' value='1'></input>
<view class='add' data-index="{{index}}" catchtap='addtap'>+</view>
</view>-->
<view class="separate"></view>
<view class="introduce">
<text>商品评价:{{books.Introduce}}</text>
</view>
<view class="separate"></view>
<view>
<text>商品详情</text>
<image class="image_detail" src="http://45.76.158.31:8080/web/BookImage/{{books.BookName}}.jpg" />
</view>
<!--<block wx:for-items="{{detailImg}}" wx:key="name">
<image class="image_detail" src="{{item}}" />
</block>-->
<view class="temp"></view>
</scroll-view>
<view class="temp"></view>
</scroll-view>
</view>
<!-- 底部悬浮栏 -->
<view class="detail-nav">
<view class="line_nav"></view>

@ -104,3 +104,61 @@ text {
font-size: 25rpx;
margin: 10rpx;
}
<<<<<<< HEAD
=======
.introduce{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.good_content .good_footer .stepper {
float: left;
margin-top: 10rpx;
width: 50%;
margin-left: 70rpx;
}
.good_content .stepper .add, .stepper .subtract {
float: left;
width: 50rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
font-size: 28rpx;
border: 1px solid #ccc;
box-sizing: border-box;
}
.good_content .stepper .disabled {
float: left;
color: #eee;
}
.good_content .stepper .count {
float: left;
width: 60rpx;
height: 50rpx;
line-height: 50rpx;
/* border: 1px solid #ccc; */
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
text-align: center;
box-sizing: border-box;
min-height: 1rem;
font-size: 28rpx;
}
.good_content .stepper .add, .stepper .subtract {
float: left;
width: 50rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
font-size: 28rpx;
border: 1px solid #ccc;
box-sizing: border-box;
}
>>>>>>> 1b33c170e75d0094eab32be499d7f94124a3b4ef

@ -98,16 +98,26 @@ Page({
// image:"/pages/index/image/jsswl.jpg"
// },
// ]
}
},
{
cate_id: 5,
cate_name: "修真",
ishaveChild: true,
},
{
cate_id: 6,
cate_name: "网游",
ishaveChild: true,
},
],
curNav: 1,
curIndex: 0
},
onload:function(){
onLoad: function (){
var thats = this
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.dotype=" + 1,
url: "http://45.76.158.31:8080/web/Classify.do?booktype=" + 1,
header: {
"content-type": "json"
},
@ -131,7 +141,7 @@ Page({
console.log(id)
var thats = this
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.dotype="+id,
url: "http://45.76.158.31:8080/web/Classify.do?booktype="+id,
header: {
"content-type": "json"
},

@ -1,3 +1,3 @@
{
"usingComponents": {}
"navigationBarTitleText": "分类"
}

@ -12,7 +12,7 @@
<!--右侧栏-->
<view class="nav_right">
<!--如果有数据,才遍历项-->
<view wx:if="{{cateItems[curIndex].ishaveChild}}">
<view wx:if="{{book!=null}}">
<block wx:for="{{book}}" wx:for-item="books">
<view class="nav_right_items">
<!--界面跳转 -->

@ -12,6 +12,7 @@ Page({
=======
'iscart': false,
'checked': [],
<<<<<<< HEAD
'goodList': [{
>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae
'cover': '/pages/index/image/suanfa.jpg',
@ -54,6 +55,49 @@ Page({
'checked': false
}
],
=======
// 'goodList': [{
// 'cover': '/pages/index/image/suanfa.jpg',
// 'isbn': '9787535482051',
// 'desc': '计算机算法设计',
// 'price': 20,
// 'count': 1,
// 'checked': false
// },
// {
// 'cover': '/pages/index/image/jichu.jpg',
// 'isbn': '9787540455958',
// 'desc': '计算机基础',
// 'price': 30,
// 'count': 1,
// 'checked': false
// },
// {
// 'cover': '/pages/index/image/rjgcdl.jpg',
// 'isbn': '9787539982830',
// 'desc': '软件工程导论',
// 'price': 25,
// 'count': 1,
// 'checked': false
// },
// {
// 'cover': '/pages/index/image/java.jpg',
// 'isbn': '9787550013247',
// 'desc': 'Java Web',
// 'price': 17,
// 'count': 1,
// 'checked': false
// },
// {
// 'cover': '/pages/index/image/byyl.jpg',
// 'isbn': '9787208061644',
// 'desc': '编译原理',
// 'price': 15,
// 'count': 1,
// 'checked': false
// }
// ],
>>>>>>> 1b33c170e75d0094eab32be499d7f94124a3b4ef
'bookList': [],
'checkAll': false,
'totalCount': 0,
@ -66,9 +110,29 @@ Page({
* 删除购物车当前商品
*/
deleteList(e) {
var that = this
const index = e.currentTarget.dataset.index;
let bookList = this.data.bookList;
wx.request({
url: "http://45.76.158.31:8080/web/AddCart.do?action=Delete&BookID=" + that.data.bookList[index].BookID + "&UserID=1",
header: {
"content-type": "json"
},
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
book: res.data,
})
//wx.hideNavigationBarLoading()
}
}
})
bookList.splice(index, 1);
console.log(index)
this.setData({
bookList: bookList
});
@ -91,8 +155,8 @@ Page({
for (var i = 0; i < bookList.length; i++) {
var book = bookList[i];
if (book.checked) {
totalCount += book.count;
totalPrice += book.count * book.price;
totalCount += book.Count * 1;
totalPrice += book.Count * book.Price;
}
}
totalPrice = totalPrice.toFixed(2);
@ -106,9 +170,10 @@ Page({
* 用户点击商品减1
*/
subtracttap: function(e) {
var that = this
var index = e.target.dataset.index;
var bookList = this.data.bookList;
var count = bookList[index].count;
var count = bookList[index].Count;
if (count <= 1) {
return;
} else {
@ -117,21 +182,59 @@ Page({
'bookList': bookList
});
this.calculateTotal();
wx.request({
url: "http://45.76.158.31:8080/web/AddCart.do?action=Modify&BookID=" + bookList[index].BookID + "&UserID=1&Count=" + bookList[index].Count,
header: {
"content-type": "json"
},
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
book: res.data,
})
//wx.hideNavigationBarLoading()
}
}
})
}
},
/**
* 用户点击商品加1
*/
addtap: function(e) {
var that = this
var index = e.target.dataset.index;
var bookList = this.data.bookList;
var count = bookList[index].count;
var count = bookList[index].Count;
bookList[index].Count++;
this.setData({
'bookList': bookList
});
this.calculateTotal();
wx.request({
url: "http://45.76.158.31:8080/web/AddCart.do?action=Modify&BookID=" + bookList[index].BookID + "&UserID=1&Count=" + bookList[index].Count,
header: {
"content-type": "json"
},
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
book: res.data,
})
//wx.hideNavigationBarLoading()
}
}
})
},
/**
* 用户选择购物车商品
@ -194,6 +297,7 @@ Page({
todetail: function(e) {
var id = e.target.dataset.id
console.log(id)
wx.navigateTo({
url: "/pages/detail/detail?id=" + id
})
@ -203,9 +307,23 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
this.calculateTotal();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function(options) {
var that = this
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
url: "http://45.76.158.31:8080/web/AddCart.do?action=getinfo&UserID=1",
header: {
"content-type": "json"
},
@ -224,25 +342,11 @@ Page({
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
this.calculateTotal();
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
@ -290,7 +394,11 @@ Page({
})
=======
/**
* 点击结算触发
*/
newAddress: function() {
var that = this
var checkList = [];
if (!this.data.iscart) {
var bookList = this.data.bookList
@ -300,20 +408,49 @@ Page({
}
}
}
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
// })
// }
// var checkLists = JSON.stringify(checkList)
// console.log(checkLists)
if (this.data.totalCount > 0) {
//向服务器传用户选中购买的东西生成订单
for (var i = 0; i < checkList.length; i++) {
wx.request({
url: "http://45.76.158.31:8080/web/Buy.do?UserID=1&BookID="+checkList[i].BookID+"&Count="+checkList[i].Count,
header: {
"content-type": "json"
},
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
book: res.data,
})
//wx.hideNavigationBarLoading()
wx.showToast({
title: '订单生成成功!',
icon: 'success',
duration: 2000
})
}
}
})
}
setTimeout(function() {
//要延时执行的代码
wx.navigateTo({
url: '/pages/order/order?typeId=0'
})
}, 3000)
} else {
wx.showToast({
title: '没有选择商品',
icon: 'success',
duration: 2000
})
}
}
})

@ -1,3 +1,3 @@
{
"usingComponents": {}
"navigationBarTitleText": "购物车"
}

@ -49,7 +49,7 @@
<view class='good_title'>
<view class='shangjia'></view>
<view class='shanchu'>
<view class='shanchu_trash' bindtap="deleteList">
<view class='shanchu_trash' data-index="{{index}}" bindtap="deleteList">
<image src='/pages/index/image/shanchu.png'></image>
</view>
<!-- 删除 -->
@ -65,7 +65,7 @@
</label>
</view>
<view class='good_img'>
<image class='cover' src='http://45.76.158.31:8080/web/BookImage/{{book.BookName}}.jpg' data-id='books.BookID' bindtap='todetail'></image>
<image class='cover' src='http://45.76.158.31:8080/web/BookImage/{{book.BookName}}.jpg' data-id='{{book.BookID}}' bindtap='todetail'></image>
</view>
<view class='content'>
<view class='titles'>{{book.BookName}}</view>

@ -21,6 +21,7 @@ Page({
'deliverList': [], //待发货
'checkList':[],
<<<<<<< HEAD
'unpaidLists': [ //待付款
>>>>>>> f23362a433f70f1876587a01c643e157b7e8b3ae
{
@ -85,16 +86,78 @@ Page({
'count': 5
}
],
=======
// 'unpaidLists': [ //待付款
// {
// 'cover': '../index/image/suanfa.jpg',
// 'isbn': '9787535482051',
// 'desc': '计算机算法设计',
// 'price': 20,
// 'count': 2
// },
// {
// 'cover': '../index/image/jichu.jpg',
// 'isbn': '9787540455958',
// 'desc': '计算机基础',
// 'price': 30,
// 'count': 1
// },
// {
// 'cover': '../index/image/rjgcdl.jpg',
// 'isbn': '9787539982830',
// 'desc': '软件工程导论',
// 'price': 25,
// 'count': 5
// }
// ],
// 'deliverLists': [ //待发货
// {
// 'cover': '../index/image/suanfa.jpg',
// 'isbn': '9787535482051',
// 'desc': '计算机算法设计',
// 'count': 2
// },
// {
// 'cover': '../index/image/jichu.jpg',
// 'isbn': '9787540455958',
// 'desc': '计算机基础',
// 'count': 1
// },
// {
// 'cover': '../index/image/rjgcdl.jpg',
// 'isbn': '9787539982830',
// 'desc': '软件工程导论',
// 'count': 5
// }
// ],
// 'dueinLists': [ //待收货
// {
// 'cover': '../index/image/suanfa.jpg',
// 'isbn': '9787535482051',
// 'desc': '计算机算法设计',
// 'count': 2
// },
// {
// 'cover': '../index/image/jichu.jpg',
// 'isbn': '9787540455958',
// 'desc': '计算机基础',
// 'count': 1
// },
// {
// 'cover': '../index/image/rjgcdl.jpg',
// 'isbn': '9787539982830',
// 'desc': '软件工程导论',
// 'count': 5
// }
// ],
>>>>>>> 1b33c170e75d0094eab32be499d7f94124a3b4ef
},
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",
url: "http://45.76.158.31:8080/web/CheckOrders.do?UserID=1&status=1",
header: {
"content-type": "json"
},
@ -102,14 +165,14 @@ Page({
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
checkList :res.data
unpaidList :res.data
})
//wx.hideNavigationBarLoading()
}
}
})
}
//获取待收货订单信息
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
header: {
@ -126,6 +189,7 @@ Page({
}
})
//获取待发货信息
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
header: {
@ -142,37 +206,121 @@ Page({
}
})
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 < that.data.unpaidList.l; i++) {
var book = that.data.unpaidList[i];
totalCount += book.Count;
totalPrice += book.Count * book.Price;
}
totalPrice = totalPrice.toFixed(2);
that.setData({
'totalCount': totalCount,
'totalPrice': totalPrice
// unpaidList: that.data.checkList
})
// var unpaidList = that.data.unpaidList;
// var totalCount = 0;
// var totalPrice = 0;
// for (var i = 0; i < that.data.unpaidList.length; i++) {
// var book = that.data.unpaidList[i];
// totalCount += book.Count*1;
// totalPrice += book.Count * book.Price;
// }
// totalPrice = totalPrice.toFixed(2);
// that.setData({
// 'totalCount': totalCount,
// 'totalPrice': totalPrice
// })
},
deleteList: function(e) {
var that = this
var index= e.currentTarget.dataset.index
this.setData({
'unpaidList': null
});
//删除订单
wx.request({
url: "http://45.76.158.31:8080/web/CheckOrders.do?UserID=1&OderId="+that.unpaidList[i].OrderID,
header: {
"content-type": "json"
},
success: function (res) {
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
checkList: res.data
})
//wx.hideNavigationBarLoading()
}
}
})
},
order_status: function(e) {
var that = this
var current = e.currentTarget.dataset.current
if(current==1){
wx.request({
url: "http://45.76.158.31:8080/web/CheckOrders.do?UserID=1&status=1",
header: {
"content-type": "json"
},
success: function (res) {
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
checkList: res.data
})
//wx.hideNavigationBarLoading()
}
}
})
}else if(current==2){
//获取待收货订单信息
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()
}
}
})
}else if(current==3){
//获取待发货信息
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()
}
}
})
}
this.setData({
currentTap: current
})
},
toPay: function () {
wx.showToast({
title: '付款成功!',
icon: 'success',
duration: 2000
})
this.deleteList()
}
})

@ -48,7 +48,7 @@
<view class="handle_order">
<view class="flexRowBetween">
<view class="handle_orders delete_order" bindtap='deleteList'>删除订单</view>
<view class="handle_orders comment_order">去付款</view>
<view class="handle_orders comment_order" bindtap='toPay' data-index="{{index}}">去付款</view>
</view>
</view>
</view>

@ -33,7 +33,7 @@ Page({
console.log("in formSubmit: "+e.detail.value)
var thats = this
var name = e.detail.value
thats.setData({
search_txt: e.detail.value
@ -41,13 +41,14 @@ Page({
})
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do?bookname="+e.detail.value+"&fuzzy=true",
url: "http://45.76.158.31:8080/web//BookInfo.do?bookname="+name+"&fuzzy=true",
header: {
"content-type": "json"
},
success: function (res) {
console.log(res.data)
if (res.statusCode == 200) {
console.log(res.data)
thats.setData({
book: res.data,
})
@ -57,6 +58,15 @@ Page({
})
},
toDetail: function(e){
var id = e.target.dataset.id
wx.switchTab({
url: "/pages/detail/detail?id="+id
})
},
onLoad: function(options) {
var thats = this
wx.request({

@ -34,7 +34,7 @@ Page({
})
},
onLoad: function() {
console.log("wode is onload")
},
address: function() {
wx.navigateTo({

@ -1,3 +1,3 @@
{
"usingComponents": {}
"navigationBarTitleText": "我的"
}

@ -13,8 +13,13 @@
},
"compileType": "miniprogram",
"libVersion": "2.4.4",
<<<<<<< HEAD
"appid": "wx18f06ad86d422b11",
"projectname": "%E5%B0%8F%E7%A8%8B%E5%BA%8F",
=======
"appid": "wxdc9f23490d56599c",
"projectname": "%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%E6%B5%8B%E8%AF%95111",
>>>>>>> 1b33c170e75d0094eab32be499d7f94124a3b4ef
"debugOptions": {
"hidedInDevtools": []
},

Loading…
Cancel
Save