更新页面

master
Eridani11579 6 years ago
parent 1b33c170e7
commit 07cc8819d2

@ -4,7 +4,8 @@ App({
globalData: {
UserID:null,
CodeID:null
CodeID:null,
url:"http://45.76.158.31:8080/web"
},
onLaunch: function () {
@ -19,18 +20,18 @@ App({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
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.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)
// }
// })
}

@ -18,7 +18,7 @@ Page({
console.log("in detail")
var thats = this
wx.request({
url: "http://45.76.158.31:8080/web/BookInfo.do?bookid=" + options.id,
url: "https://hunjianghu.xuanjis.com/web/BookInfo.do?bookid=" + options.id,
header: {
"content-type": "json"
},
@ -51,7 +51,7 @@ Page({
addCar() {
var that = this
wx.request({
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,
url: 'https://hunjianghu.xuanjis.com/web/AddCart.do',//?action=Modify&UserID=1&BookID=' + that.data.book[0].BookID + '&Count=' + that.data.book[0].Count,
data: {
'action':'Modify',
'UserID':1,
@ -76,10 +76,23 @@ Page({
},
// 立即购买
immeBuy() {
var that = this
wx.showToast({
title: '购买成功',
icon: 'success',
duration: 2000
});
wx.request({
url: 'https://hunjianghu.xuanjis.com/web/Buy.do?UserID=1&BookID=' + that.data.book[0].BookID + '&Count=' + 1 + '&MessageID=' + 1,
header: {
},
success: function (res) {
if (res.statusCode == 200) {
}
}
})
},
})

@ -4,7 +4,7 @@
<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>
<image src="https://hunjianghu.xuanjis.com/web/BookImage/{{books.BookName}}.jpg" data-src="{{item}}" bindtap="previewImage"></image>
</swiper-item>
</block>
</swiper>
@ -30,7 +30,7 @@
<view class="separate"></view>
<view>
<text>商品详情</text>
<image class="image_detail" src="http://45.76.158.31:8080/web/BookImage/{{books.BookName}}.jpg" />
<image class="image_detail" src="https://hunjianghu.xuanjis.com/web/BookImage/{{books.BookName}}.jpg" />
</view>
<!--<block wx:for-items="{{detailImg}}" wx:key="name">
<image class="image_detail" src="{{item}}" />

@ -117,7 +117,7 @@ Page({
onLoad: function (){
var thats = this
wx.request({
url: "http://45.76.158.31:8080/web/Classify.do?booktype=" + 1,
url: "https://hunjianghu.xuanjis.com/web/Classify.do?booktype=" + 1,
header: {
"content-type": "json"
},
@ -141,7 +141,7 @@ Page({
console.log(id)
var thats = this
wx.request({
url: "http://45.76.158.31:8080/web/Classify.do?booktype="+id,
url: "https://hunjianghu.xuanjis.com/web/Classify.do?booktype="+id,
header: {
"content-type": "json"
},

@ -17,7 +17,7 @@
<view class="nav_right_items">
<!--界面跳转 -->
<navigator url="/pages/detail/detail?id={{books.BookID}}">
<image src="http://45.76.158.31:8080/web/BookImage/{{books.BookName}}.jpg"></image>
<image src="https://hunjianghu.xuanjis.com/web/BookImage/{{books.BookName}}.jpg"></image>
<text>{{books.BookName}}</text>
</navigator>
</view>

@ -65,14 +65,13 @@ Page({
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",
url: "https://hunjianghu.xuanjis.com/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,
})
@ -82,7 +81,6 @@ Page({
})
bookList.splice(index, 1);
console.log(index)
this.setData({
bookList: bookList
});
@ -134,14 +132,13 @@ Page({
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,
url: "https://hunjianghu.xuanjis.com/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,
})
@ -169,14 +166,13 @@ Page({
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,
url: "https://hunjianghu.xuanjis.com/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,
})
@ -190,7 +186,7 @@ Page({
* 用户选择购物车商品
*/
checkboxChange: function(e) {
console.log('checkbox发生change事件携带value值为', e.detail.value);
//console.log('checkbox发生change事件携带value值为', e.detail.value);
var checkboxItems = this.data.bookList;
var values = e.detail.value;
for (var i = 0; i < checkboxItems.length; ++i) {
@ -241,7 +237,7 @@ Page({
todetail: function(e) {
var id = e.target.dataset.id
console.log(id)
//console.log(id)
wx.navigateTo({
url: "/pages/detail/detail?id=" + id
})
@ -267,7 +263,7 @@ Page({
onShow: function(options) {
var that = this
wx.request({
url: "http://45.76.158.31:8080/web/AddCart.do?action=getinfo&UserID=1",
url: "https://hunjianghu.xuanjis.com/web/AddCart.do?action=getinfo&UserID=1",
header: {
"content-type": "json"
},
@ -275,22 +271,28 @@ Page({
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,
iscart: false
})
if (res.data.length == 0) {
that.setData({
iscart: true
})
}
//wx.hideNavigationBarLoading()
}
}
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
@ -327,50 +329,72 @@ Page({
newAddress: function() {
var that = this
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)
// var flag = false
if (this.data.totalCount > 0) {
if (!this.iscart) { //购物车不空
var bookLists = this.data.bookList
for (var i = 0; i < bookLists.length; i++) {
if (bookLists[i].checked) {
var bookid = bookLists[i].BookID
var count = bookLists[i].Count
wx.request({
url: 'https://hunjianghu.xuanjis.com/web/Buy.do?UserID=1&BookID=' + bookid + '&Count=' + count + '&MessageID=' + 1,
header: {
},
success: function(res) {
if (res.statusCode == 200) {
// that.setData({
// // book: res.data,
// flag :true
// })
//wx.hideNavigationBarLoading()
wx.showToast({
title: '订单生成成功!',
icon: 'success',
duration: 2000
})
}
}
})
wx.request({
url: "https://hunjianghu.xuanjis.com/web/AddCart.do?action=Delete&BookID=" + bookid + "&UserID=1",
header: {
"content-type": "json"
},
success: function (res) {
if (res.statusCode == 200) {
// that.setData({
// book: res.data,
// })
//wx.hideNavigationBarLoading()
}
}
})
//向服务器传用户选中购买的东西生成订单
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)
// if (flag) {
setTimeout(function() {
//要延时执行的代码
wx.navigateTo({
url: '/pages/order/order?typeId=0'
})
}, 3000)
// } else {
// wx.showToast({
// title: '订单创建失败',
// icon: 'success',
// duration: 2000
// })
// }
} else {
wx.showToast({
title: '没有选择商品',

@ -25,7 +25,7 @@
</label>
</view>
<view class='good_img'>
<image class='cover' src='http://45.76.158.31:8080/web/BookImage/{{book.BookName}}.jpg' data-id='{{book.BookID}}' bindtap='todetail'></image>
<image class='cover' src='https://hunjianghu.xuanjis.com/web/BookImage/{{book.BookName}}.jpg' data-id='{{book.BookID}}' bindtap='todetail'></image>
</view>
<view class='content'>
<view class='titles'>{{book.BookName}}</view>

@ -15,7 +15,7 @@ Page({
'unpaidList': [], //待付款
'dueinList': [], //待收货
'deliverList': [], //待发货
'checkList':[],
'checkList': [],
// 'unpaidLists': [ //待付款
// {
@ -85,25 +85,25 @@ Page({
onLoad: function(options) {
var that = this
//获取待付款订单信息
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({
unpaidList :res.data
})
//wx.hideNavigationBarLoading()
}
wx.request({
url: "https://hunjianghu.xuanjis.com/web/CheckOrders.do?UserID=1&status=1",
header: {
"content-type": "json"
},
success: function(res) {
console.log(res.data)
if (res.statusCode == 200) {
that.setData({
unpaidList: res.data
})
//wx.hideNavigationBarLoading()
}
})
}
})
//获取待收货订单信息
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
url: "https://hunjianghu.xuanjis.com/web/CheckOrders.do?UserID=1&status=3",
header: {
"content-type": "json"
},
@ -120,11 +120,11 @@ Page({
//获取待发货信息
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
url: "https://hunjianghu.xuanjis.com/web/CheckOrders.do?UserID=1&status=2",
header: {
"content-type": "json"
},
success: function (res) {
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
that.setData({
@ -154,62 +154,63 @@ Page({
// })
},
deleteList: function(e) {
var that = this
var index= e.currentTarget.dataset.index
this.setData({
'unpaidList': null
});
// 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()
}
}
})
// //删除订单
// wx.request({
// url: "https://hunjianghu.xuanjis.com/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){
console.log("current=")
console.log(current)
if (current == 0) {
wx.request({
url: "http://45.76.158.31:8080/web/CheckOrders.do?UserID=1&status=1",
url: "https://hunjianghu.xuanjis.com/web/CheckOrders.do?UserID=1&status=1",
header: {
"content-type": "json"
},
success: function (res) {
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
// console.log(res.data)
that.setData({
checkList: res.data
unpaidList: res.data
})
//wx.hideNavigationBarLoading()
}
}
})
}else if(current==2){
} else if (current == 1) {
//获取待收货订单信息
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
url: "https://hunjianghu.xuanjis.com/web/CheckOrders.do?UserID=1&status=3",
header: {
"content-type": "json"
},
success: function (res) {
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
// console.log(res.data)
that.setData({
dueinList: res.data
})
@ -217,20 +218,21 @@ Page({
}
}
})
}else if(current==3){
} else if (current == 2) {
//获取待发货信息
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
url: "https://hunjianghu.xuanjis.com/web/CheckOrders.do?UserID=1&status=2",
header: {
"content-type": "json"
},
success: function (res) {
success: function(res) {
if (res.statusCode == 200) {
console.log(res.data)
// console.log(res.data)
that.setData({
deliverList: res.data
})
//wx.hideNavigationBarLoading()
console.log(that.data.deliverList)
wx.hideNavigationBarLoading()
}
}
})
@ -241,13 +243,47 @@ Page({
})
},
toPay: function () {
toPay: function(e) {
var that = this
var id = e.currentTarget.dataset.id
wx.showToast({
title: '付款成功!',
icon: 'success',
duration: 2000
})
this.deleteList()
wx.request({
url: "https://hunjianghu.xuanjis.com/web/ModifyStatus.do?OrderID=" + id + "&status=2",
header: {
"content-type": "json"
},
success: function(res) {
if (res.statusCode == 200) {
// console.log(res.data)
// that.setData({
// deliverList: res.data
// })
//wx.hideNavigationBarLoading()
}
}
})
wx.request({
url: "https://hunjianghu.xuanjis.com/web/CheckOrders.do?UserID=1&status=1",
header: {
"content-type": "json"
},
success: function (res) {
if (res.statusCode == 200) {
// console.log(res.data)
that.setData({
unpaidList: res.data
})
//wx.hideNavigationBarLoading()
}
}
})
}

@ -25,13 +25,13 @@
<view class="same_stroe">
<view class="flexRowBetween orderlistShow">
<view class="order_left">
<image src="http://45.76.158.31:8080/web/BookImage/{{book.BookName}}.jpg"></image>
<image src="https://hunjianghu.xuanjis.com/web/BookImage/{{book.BookName}}.jpg"></image>
</view>
<view class="order_name">
<view class="text1">{{book.BookName}}</view>
<view class="orders flexRowBetween">
<text class="order_type">数量:{{book.Count}}</text>
<text class="order_price">{{book.Price*book.Count}}</text>
<!--<text class="order_price">{{book.Price*book.Count}}</text>-->
</view>
</view>
</view>
@ -41,14 +41,14 @@
<view class="flexRowBetween">
<view class="total_money">
<text>合计:</text>
<text class="text2">¥{{totalPrice}}</text>
<text class="text2">¥{{book.Price*book.Count}}</text>
</view>
</view>
</view>
<view class="handle_order">
<view class="flexRowBetween">
<view class="handle_orders delete_order" bindtap='deleteList'>删除订单</view>
<view class="handle_orders comment_order" bindtap='toPay' data-index="{{index}}">去付款</view>
<!--<view class="handle_orders delete_order" bindtap='deleteList'>删除订单</view>-->
<view class="handle_orders comment_order" bindtap='toPay' data-index="{{index}}" data-id="{{book.OrderID}}">去付款</view>
</view>
</view>
</view>
@ -68,7 +68,7 @@
<view class="same_stroe">
<view class="flexRowBetween orderlistShow">
<view class="order_left">
<image src="http://45.76.158.31:8080/web/BookImage/{{book.BookName}}.jpg"></image>
<image src="https://hunjianghu.xuanjis.com/web/BookImage/{{book.BookName}}.jpg"></image>
</view>
<view class="order_name">
<view class="text1">{{book.BookName}}</view>
@ -83,10 +83,11 @@
<view class="flexRowBetween">
<view class="total_money">
<text>收货地址:</text>
<text class="text2">{{book.Addresss}}</text>
<text class="text2">{{book.Address}}</text>
</view>
</view>
</view>
<!--
<view class="total_order">
<view class="flexRowBetween">
<view class="total_money">
@ -94,7 +95,8 @@
<text class="text2">{{book.consignee}}</text>
</view>
</view>
</view>
</view>-->
<!--
<view class="total_order">
<view class="flexRowBetween">
<view class="total_money">
@ -102,7 +104,7 @@
<text class="text2">{{book.phone}}</text>
</view>
</view>
</view>
</view>-->
<!--
<view class="handle_order">
<view class="flexRowBetween">
@ -112,8 +114,9 @@
</view>-->
</view>
<!--待发货-->
</view>
<view class="order_all {{currentTap ==2?'order_show':''}}" wx:if="{{deliverList!=null}}" wx:for='{{dueinList}}' wx:for-item="book" wx:key="book.BookID">
<view class="order_all {{currentTap ==2?'order_show':''}}" wx:if="{{deliverList!=null}}" wx:for='{{deliverList}}' wx:for-item="book" wx:key="book.BookID">
<view class="order_tlt flexRowBetween">
<view class="tlt_left">
<text>付款日期:</text>
@ -126,7 +129,7 @@
<view class="same_stroe">
<view class="flexRowBetween orderlistShow">
<view class="order_left">
<image src="http://45.76.158.31:8080/web/BookImage/{{book.BookName}}.jpg"></image>
<image src="https://hunjianghu.xuanjis.com/web/BookImage/{{book.BookName}}.jpg"></image>
</view>
<view class="order_name">
<view class="text1">{{book.BookName}}</view>
@ -145,6 +148,7 @@
</view>
</view>
</view>
<!--
<view class="total_order">
<view class="flexRowBetween">
<view class="total_money">
@ -152,7 +156,8 @@
<text class="text2">{{book.consignee}}</text>
</view>
</view>
</view>
</view>-->
<!--
<view class="total_order">
<view class="flexRowBetween">
<view class="total_money">
@ -160,7 +165,7 @@
<text class="text2">{{book.phone}}</text>
</view>
</view>
</view>
</view>-->
</view>
</view>
</view>

@ -10,11 +10,7 @@ Page({
onLoad: function () {
},
userInfo: function () {
wx.navigateTo({
url: '/pages/userInfo/userInfo'
})
},
bindDateChange: function (e) {
this.setData({
date: e.detail.value
@ -32,7 +28,7 @@ Page({
icon: 'success',
duration: 2000
})
setTimeout(function () {
//要延时执行的代码
wx.switchTab({

@ -41,7 +41,8 @@ Page({
})
wx.request({
url: "http://45.76.158.31:8080/web//BookInfo.do?bookname="+name+"&fuzzy=true",
url: "https://hunjianghu.xuanjis.com/web/BookInfo.do?bookname="+name+"&fuzzy=true",
// url: getApp.globalData.url + "/BookInfo.do?bookname="+name+"&fuzzy=true",
header: {
"content-type": "json"
},
@ -70,7 +71,8 @@ Page({
onLoad: function(options) {
var thats = this
wx.request({
url: "http://45.76.158.31:8080/web/GetFrontInfo.do",
url: "https://hunjianghu.xuanjis.com/web/GetFrontInfo.do",
// url: getApp.globalData.url + "GetFrontInfo.do",
header: {
"content-type": "json"
},

@ -3,7 +3,7 @@
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{ppt}}" wx:for-item="ppts">
<swiper-item>
<image src="http://45.76.158.31:8080/web/BookImage/{{ppts.BookName}}.jpg" class="slide-image" width="355" height="240" />
<image src="https://hunjianghu.xuanjis.com/web/BookImage/{{ppts.BookName}}.jpg" class="slide-image" width="355" height="240" />
</swiper-item>
</block>
</swiper>
@ -24,7 +24,7 @@
<view class="weui-panel__bd">
<navigator wx:for="{{book}}" wx:for-item="books" url="../detail/detail?id={{books.BookID}}" data-id="{{books.BookID}}" class="weui-media-box weui-media-box_appmsg" hover-class="weui-cell_active">
<view class="weui-media-box__hd weui-media-box__hd_in-appmsg" style="width:120px;height:80px;">
<image class="weui-media-box__thumb" src="http://45.76.158.31:8080/web/BookImage/{{books.BookName}}.jpg" />
<image class="weui-media-box__thumb" src="https://hunjianghu.xuanjis.com/web/BookImage/{{books.BookName}}.jpg" />
</view>
<view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
<view class="weui-media-box__title">{{books.BookName}}</view>

@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": false,
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,

Loading…
Cancel
Save