diff --git a/config/baseUrl.js b/config/baseUrl.js index 85c9219..8f97489 100644 --- a/config/baseUrl.js +++ b/config/baseUrl.js @@ -6,10 +6,11 @@ if (process.env.NODE_ENV === 'development') { // socketUrl = "ws://localhost:6001/"; // baseUrl = "https://twin-ui.com/demo/"; // baseUrl = "http://59.110.212.44:9200/pb/"; - // baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 + baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境 // baseUrl = "https://api.nuttyreading.com/"; // 线上正式 // baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑 - baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1 + // baseUrl = "http://192.168.110.110:9200/pb/"; + // baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1 // socketUrl = "ws://8.129.186.35:6001/"; } else if (process.env.NODE_ENV === 'production') { // 生产环境11 diff --git a/pages.json b/pages.json index df5d05e..9d1aa20 100644 --- a/pages.json +++ b/pages.json @@ -476,6 +476,15 @@ } } } + ,{ + "path" : "pages/bookShop/deliverLIst", + "style" : + { + "navigationBarTitleText": "快递列表", + "enablePullDownRefresh": false + } + + } ], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/pages/bookShop/deliverDetail.vue b/pages/bookShop/deliverDetail.vue index 68716f3..1568f99 100644 --- a/pages/bookShop/deliverDetail.vue +++ b/pages/bookShop/deliverDetail.vue @@ -2,33 +2,35 @@ - + - - + + - - - {{list.ShipperName}} {{list.LogisticCode}} - + + + {{expressCompanyName}} {{expressOrderSn}} + + - {{item.AcceptTime}} - {{item.AcceptStation}} + {{item.acceptTime}} + {{item.acceptStation}} - + - + - 暂无物流信息 - + @@ -50,16 +52,30 @@ deliverDetails: [{ Traces: [] }], + express:{}, // 面单 + consignee:{}, // 收件人信息 + expressOrderSn:'', // 运单号 + expressCompanyCode:'', //快递编码 + expressCompanyName:'' ,// 快递公司 + orderSn : '', current: 0, deliverList: [], - deliverDetailsLength: null + deliverDetailsLength: null, + orderContet:{}, + sheetList:[] } }, onLoad(e) { - this.orderId = e.objId + this.expressOrderSn = e.expressOrderSn + this.expressCompanyCode = e.expressCompanyCode + this.expressCompanyName = e.expressCompanyName + //this.express = e.express + //this.consignee = e.consignee + console.log(e,'传入的参数') + this.orderSn = e.orderSn }, onShow() { - this.getdeliverDetails() + this.getOrderList() }, computed: { ...mapState(['userInfo']), @@ -67,7 +83,60 @@ components:{ musicPlay }, - methods: { + methods: { + + // 获取订单列表 + getOrderList() { + console.log('this.orderType',this.orderType) + this.$http + // .get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`) + .get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`) + .then(res => { + console.log('订单详情',res) + var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间 + var nowSeconds = Math.floor(new Date().getTime() / 1000); + res.result.overTime = seconds - nowSeconds + + this.orderContet = res.result + //this.userRecordid = res.userRecordid + this.productIDs = res.result.goodsList.map(item => { + return item.buyOrderProductId + }) + // console.log(this.orderContet,'this.orderContet') + if (this.orderContet.orderStatus == 0) { + this.titleStat = '待支付' + } else if (this.orderContet.orderStatus == 1) { + this.titleStat = '待发货' + } else if (this.orderContet.orderStatus == 2) { + this.titleStat = '待收货' + } else if (this.orderContet.orderStatus == 3) { + this.titleStat = '已完成' + } + + + if(parseInt(this.orderContet.orderStatus) >= 2){ + this.getdeliverDetails() + // 查询快递信息 + // this.getSheetInfo() + } + console.log(this.orderContet,'订单详情') + }) + }, + // getSheetInfo(){ + // console.log('查询快递信息') + // this.$http + // .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`) + // .then(res => { + // if(res.code == 0){ + // this.sheetList = res.result.data + // console.log(res,'面单信息') + // this.getdeliverDetails() + // } + // }).catch(e => { + // console.log('e',e) + + // }) + // }, // 复制到剪切板 copyData(data){ uni.setClipboardData({ @@ -84,21 +153,30 @@ // 获取物流 getdeliverDetails() { this.deliverList = [] + var strLength = this.orderContet.consignee.consigneeMobile.length + var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength) + // this.expressOrderSn = 'SF1504651506851' + // this.expressCompanyCode = 'SF' + // subMobile = '9277' uni.showLoading() this.$http - .post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`) + //.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`) + .get(`/book/buyOrder/queryExpress?expressOrderSn=${this.expressOrderSn}&expressCompanyCode=${this.expressCompanyCode}&customerName=${subMobile}`) .then(res => { console.log(res, '物流信息') if (res && res.code === 0) { uni.hideLoading() - this.deliverDetails = res.rntStr - // console.log(res.rntStr,'物流信息') - res.rntStr.forEach((item, index) => { - item.Traces = item.Traces.reverse() - //console.log(item) - this.deliverList.push({'name':item.ShipperName}) - }) + // this.deliverDetails = res.result.traces + console.log(res.result.traces,'物流信息') + // res.rntStr.forEach((item, index) => { + this.deliverDetails = res.result.traces.reverse() + // item.Traces = item.Traces.reverse() + // //console.log(item) + // this.deliverList.push({'name':item.ShipperName}) + // }) } + }).catch(e => { + console.log(e,'e') }) }, @@ -154,8 +232,7 @@ .item { padding-left: 10px; position: relative; - } - + } .item:before { display: inline-block; width: 10px; @@ -173,18 +250,19 @@ font-size: 28rpx; margin-bottom: 5px } - + .first{ + color: #55aa7f; + } .content { padding-bottom: 14px; } } - .flexbox { display: flex; } .img_icon { - padding-right: 5px; + padding-right: 30rpx; } .moreBtnF { diff --git a/pages/bookShop/deliverLIst.vue b/pages/bookShop/deliverLIst.vue new file mode 100644 index 0000000..85bcfae --- /dev/null +++ b/pages/bookShop/deliverLIst.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/pages/bookShop/orderLCont.vue b/pages/bookShop/orderLCont.vue index f11c688..9036a27 100644 --- a/pages/bookShop/orderLCont.vue +++ b/pages/bookShop/orderLCont.vue @@ -2,46 +2,39 @@ - - - + + - {{orderContet.shippingUser}} + {{orderContet.consignee.consigneeName}} - {{orderContet.userPhone}} + {{orderContet.consignee.consigneeMobile}} - {{orderContet.province}} {{orderContet.city}} {{orderContet.district}} {{orderContet.address}} + {{orderContet.consignee.province}} {{orderContet.consignee.city}} {{orderContet.consignee.county}} {{orderContet.consignee.address}} - + + + 订单已被拆分成 {{sheetList.length}} 个包裹 + - - - + + 待支付 + 待发货 + 待收货 + 已完成 + 已超时 + + + {{item.productName}} @@ -53,6 +46,7 @@
+ @@ -78,19 +72,20 @@ 商品总价 : - {{orderContet.orderMoney}} + {{orderContet.orderPrice}} 运费 : - {{orderContet.shippingMoney}} + {{orderContet.shippingPrice}} 优惠券 : - -¥{{orderContet.districtMoney}} + -¥{{orderContet.coupon.couponAmount}} + -¥0 实付款 : - {{orderContet.realMoney}} + {{orderContet.realPrice}} 订单编号 : @@ -100,19 +95,26 @@ 创建时间 : {{orderContet.createTime}} + + 付款时间 : + {{orderContet.paymentDate}} + + + 发货时间 : + {{orderContet.shippingTime}} + - 查看物流 + 查看物流 确认收货 取消订单 去支付 - - + 联系客服 @@ -121,7 +123,7 @@ - + 添加评价 添加追评 @@ -168,6 +170,19 @@ + + + + 请选择要查看包裹 + + + + 包裹 {{index+1}} + + + + + @@ -217,7 +232,7 @@ logisticsData: [], // 快递信息列表 titleStat: '', orderID: 0, - orderSn:null, + orderSn:'', orderType: '', orderContet: {}, deliverDetails: [{ @@ -227,7 +242,9 @@ emoji:[], Files:[], pjType:'', - + sheetList: [], // 面单数据 + consigneeShow: false, + sheetListShow:false, } }, onLoad(e) { @@ -237,9 +254,11 @@ this.orderSn = e.orderSn console.log(this.orderID,'this.orderID') }, - + onHide() { + this.sheetList= [] + }, onShow() { - this.getOrderList() + this.getOrderList() }, components:{ emotion, @@ -250,6 +269,12 @@ }, methods: { + seeExpressDetails(item){ + console.log(item,'item') + uni.navigateTo({ + url: "./deliverDetail?orderSn=" + this.orderContet.orderSn + "&expressOrderSn=" + item.expressOrderSn + "&expressCompanyCode="+item.expressCompanyCode + "&expressCompanyName="+item.expressCompanyName + }) + }, // 倒计时回调 countDown(){ console.log('重新刷新订单') @@ -483,6 +508,18 @@ } }) }, + // 查看物流 + seeExpressDetail(item){ + console.log(item, this.sheetList.length) + if(this.sheetList.length > 1){ + this.sheetListShow = true + }else if(this.sheetList.length == 1){ + // 直接展示详情 + uni.navigateTo({ + url: "./deliverDetail?orderSn=" + item.orderSn + "&expressOrderSn=" + this.sheetList[0].expressOrderSn + "&expressCompanyCode="+this.sheetList[0].expressCompanyCode + "&expressCompanyName="+this.sheetList[0].expressCompanyName + }) + } + }, onPageJump(item) { uni.navigateTo({ url: "./deliverDetail?objId=" + item @@ -529,17 +566,19 @@ getOrderList() { console.log('this.orderType',this.orderType) this.$http - .get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`) + // .get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`) + .get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`) .then(res => { console.log('订单详情',res) var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间 var nowSeconds = Math.floor(new Date().getTime() / 1000); res.result.overTime = seconds - nowSeconds - this.orderContet = res.result - this.userRecordid = res.userRecordid - this.productIDs = res.result.products.map(item => { - return item.productId + this.orderContet = res.result + this.consigneeShow = true + //this.userRecordid = res.userRecordid + this.productIDs = res.result.goodsList.map(item => { + return item.buyOrderProductId }) // console.log(this.orderContet,'this.orderContet') if (this.orderContet.orderStatus == 0) { @@ -552,29 +591,62 @@ this.titleStat = '已完成' } + + if(parseInt(this.orderContet.orderStatus) >= 2){ + // 查询快递信息 + // this.getSheetInfo() + if(this.orderContet.goodsList.length > 0){ + this.sheetList = [] + // console.log('存在商品数据', this.orderContet.goodsList.length) + // var ids = [] + // ids.push(this.orderContet.goodsList[0].expressInfo.expressOrderSn) + // this.sheetList.push(this.orderContet.goodsList[0].expressInfo) + // for (let index = 1; index < this.orderContet.goodsList.length; index++) { + // // if (!ids.includes(this.orderContet.goodsList[index].expressInfo.expressOrder)) { + // ids.push(this.orderContet.goodsList[index].expressInfo.expressOrderSn) + // this.sheetList.push(this.orderContet.goodsList[index].expressInfo)} + // console.log(this.orderContet.goodsList[index].expressInfo.expressOrderSn,'expressOrderSn') + // // } + // console.log(ids,this.sheetList,'this.sheetList') + } + } console.log(this.orderContet,'订单详情') }) }, + // getSheetInfo(){ + // console.log('查询快递信息') + // this.$http + // .get(`express/getPrintTemplateList?expressOrderSn=${this.orderSn}`) + // .then(res => { + // if(res.code == 0){ + // this.sheetList = res.result.data + // console.log(res,'面单信息') + // } + // }).catch(e => { + // console.log('e',e) + + // }) + // }, // 获取物流 - getdeliverDetails() { - this.$http - .post(`/book/buyOrder/queryFMS?orderId=${this.orderID}`) - .then(res => { - if (res && res.code === 0) { - console.log(res, '物流信息') - // if(res.msg.indexOf('暂未查到物流信息') == -1){ - // this. - // } - res.rntStr.forEach(item => { - item.Traces = item.Traces.reverse() - }) - this.deliverDetails = res.rntStr - this.deliverDetailsLength = this.deliverDetails[0].Traces.length - } else { + // getdeliverDetails() { + // this.$http + // .post(`/book/buyOrder/queryFMS?orderId=${this.orderID}`) + // .then(res => { + // if (res && res.code === 0) { + // console.log(res, '物流信息') + // // if(res.msg.indexOf('暂未查到物流信息') == -1){ + // // this. + // // } + // res.rntStr.forEach(item => { + // item.Traces = item.Traces.reverse() + // }) + // this.deliverDetails = res.rntStr + // this.deliverDetailsLength = this.deliverDetails[0].Traces.length + // } else { - } - }) - }, + // } + // }) + // }, // 取消订单 canceOrder() { uni.showModal({ @@ -695,6 +767,23 @@ + \ No newline at end of file diff --git a/pages/bookShop/settlement.vue b/pages/bookShop/settlement.vue index 1826461..301c41e 100644 --- a/pages/bookShop/settlement.vue +++ b/pages/bookShop/settlement.vue @@ -21,7 +21,7 @@
- {{adressMoRen.province}} {{adressMoRen.city}} {{adressMoRen.county}} {{adressMoRen.useraddress}} + {{adressMoRen.province}} {{adressMoRen.city}} {{adressMoRen.county}} {{adressMoRen.detailAddress}} @@ -56,8 +56,8 @@ 优惠券 当前可选{{this.youhuiList.length}}张 - 当前可选{{this.youhuiList.length}}张 + 暂无优惠券 - ¥{{youhuiContent.coupons.couponAmount}} @@ -151,7 +151,7 @@ {{item.province}} {{item.city}} {{item.county}} - {{item.useraddress}} + {{item.detailAddress}}
@@ -166,7 +166,7 @@ 请选择优惠券 - + @@ -189,8 +189,11 @@
+ * 每笔订单只能使用一张优惠价
- * 每笔订单只能使用一张优惠价 + + +
@@ -357,7 +360,7 @@ this.addressList = res.list // console.log(this.addressList,'地址列表') this.adressMoRen = this.addressList[this.adressMoRIndex] - // console.log(this.adressMoRen, '默认') + console.log(this.adressMoRen, '默认') if(this.adressMoRen != {}){ // console.log('运费之前') this.getYunFei() @@ -459,7 +462,8 @@ console.log(key,'this.adressMoRen.areaidpath') $http.request({ - url: "book/buyOrder/calculateTransportPrice/", + // url: "book/buyOrder/calculateTransportPrice/", + url: "book/buyOrder/calculateTransportPrice", // url: "book/buyorder/getTransPrice/" + this.adressMoRen.areaidpath + "?" + dataToString, method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 data:{ @@ -473,11 +477,10 @@ }).then(res => { if (res.code == 0) { this.farePrice = res.result - }else{ - this.farePrice = 0 + console.log('需要的运费',res.result) + this.allPrice() } - console.log('需要的运费',res.result) - this.allPrice() + }) }, @@ -613,13 +616,13 @@ couponName: youPre.coupons.name, //优惠券名称 districtMoney: youPre.coupons.amount, //优惠金额 orderStatus: 0, //订单状态 - products: xiaBiao, //订单列表 + productList: xiaBiao, //订单列表商品 orderType: "order", //订单类型 addressId:this.adressMoRen.id // 地址ID } - $http.request({ - // url: "book/buyorder/save", - url: "book/buyOrder/buySave", + $http.request({ + // url: "book/buyOrder/buySave", + url: "book/buyOrder/placeOrder", method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 data, header: { //默认 无 说明:请求头 diff --git a/pages/user/addAddress.vue b/pages/user/addAddress.vue index 967b438..f96d1a2 100644 --- a/pages/user/addAddress.vue +++ b/pages/user/addAddress.vue @@ -20,9 +20,8 @@ {{addressForm.areaidpathtext}} - - + @confirm="addconfirm" @change="changeHandler" > + @@ -45,18 +44,26 @@ @confirm="deleteSub"> + +