junyuanz преди 5 години
родител
ревизия
eae24ab9ae

+ 1 - 0
app.json

@@ -39,6 +39,7 @@
         "pages/user/radishDetail/radishDetail",
         "pages/user/orders/orders",
         "pages/user/order/order",
+        "pages/user/logistics/logistics",
         "pages/user/safe/safe",
         "pages/user/exchange/exchange",
         "pages/user/exchangeSuccess/exchangeSuccess",

BIN
images/footer/logistics.png


+ 64 - 0
packageUser/pages/user/logistics/logistics.js

@@ -0,0 +1,64 @@
+var _request = require('../../../../utils/request.js')
+var rid
+Page({
+  data: {
+    order: {},
+    logistics:{}
+  },
+  onLoad: function (options) {
+    rid = options.id
+    this.getRadish()
+    console.log('rid',rid);
+  },
+  getRadish () {
+    var that = this
+    var url = 'v1/order/' + rid
+    var params = {
+    }
+    var success = function (res) {
+      var data = res.data
+      that.setData({
+        order: data
+      })
+      if(data.sign && data.order_id && data.express_code) that.getLogistics();
+      
+    }
+    _request.$get(url, params, success)
+  },
+  getLogistics(){
+  	var that = this
+    var url = 'v1/experess_info/query'
+    var params = {
+    	express_no:this.data.order.order_id,
+    	express_code:this.data.order.express_code,
+    	sign:this.data.order.sign
+    }
+    var success = function (res) {
+      var data = res.data.resp.result
+      data['list'] = data.list.reverse()
+      that.setData({
+        logistics: data
+      })
+    }
+    _request.$post(url, params, success)
+  },
+  copeOrder: function () {
+    var that = this
+    var id = this.data.order.express_order_no
+    wx.setClipboardData({
+      data: id,
+      success: function(res) {
+        wx.showToast({
+          title: '已成功复制到剪贴板',
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    })
+  },
+  onShareAppMessage: function (val) {
+    return _request.share({
+      sc: 'xcx_user_logistics'
+    })
+  }
+})

+ 7 - 0
packageUser/pages/user/logistics/logistics.json

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "查看物流",
+  "usingComponents": {
+    "currency": "../../../../component/currency/currency"
+  },
+  "backgroundColor": "#f3f3f3"
+}

+ 28 - 0
packageUser/pages/user/logistics/logistics.wxml

@@ -0,0 +1,28 @@
+<view class="bg" style="background: #FFF;">
+	<view class="logistics-tit">
+	  <image src="{{order.product_list[0].cover}}"></image>
+	  <view class="logistics-rbox">
+	    <h6 class="ellipsisLn">{{logistics.company}}快递</h6>
+		<p>快递单号:{{logistics.no}}</p>
+	  </view>
+	  <view class="clean"></view>
+	</view>
+	<hr class="hrline" />
+	<view class="logistics-tit">
+	  <image src="../../../../images/footer/logistics.png" style="padding: 20rpx 20rpx 0;width: 90rpx;height: 90rpx;"></image>
+	  <view class="logistics-rbox">
+	    <p style="margin-top:0">订单编号:{{order.order_id}}</p>
+		<p>收货地址:{{order.address}}</p>
+	  </view>
+	  <view class="clean"></view>
+	</view>
+	<hr class="hrline" />
+	<view class="logistics-list">
+		<ul>
+			<li wx:for="{{logistics.list}}" wx:id="id">
+				<p>{{item.remark}}</p>
+				<small>{{item.datetime}}</small>
+			</li>
+		</ul>
+	</view>
+</view>

+ 313 - 0
packageUser/pages/user/logistics/logistics.wxss

@@ -0,0 +1,313 @@
+.bg {
+  position: relative;
+  width: 100%;
+  min-height: 100%;
+  background-color: #f3f3f3;
+}
+.orderDetail-type {
+  width: 100%;
+  height: 170rpx;
+  background: -webkit-linear-gradient(left, #ff5c5c , #ff9b74);
+  background: linear-gradient(to right, #ff5c5c , #ff9b74);
+  line-height: 170rpx;
+  text-align: center;
+  font-size: 36rpx;
+  font-weight: bold;
+  color: #ffffff;
+}
+.orderDetail-address {
+  position: relative;
+  padding: 0 20rpx;
+  color: #4c4c4c;
+  font-size: 28rpx;
+  background-color: #fff;
+}
+.orderDetail-address__info {
+  padding-top: 25rpx;
+}
+.orderDetail-address__name {
+  float: left;
+}
+.orderDetail-address__tel {
+  float: right;
+}
+.orderDetail-address__more {
+  padding-top: 20rpx;
+  padding-bottom: 20rpx;
+  line-height: 50rpx;
+}
+.orderDetail-address__border {
+  position: absolute;
+  left: 0;
+  bottom: 2rpx;
+  width: 100%;
+  height: 2rpx;
+}
+.order-main {
+  width: 710rpx;
+  height: 200rpx;
+  background-color: #fcfcfc;
+  margin-bottom:5px;
+}
+.order-main__left {
+  width: 200rpx;
+  height: 200rpx;
+  display: block;
+  float: left;
+}
+.order-main__right {
+  position: relative;
+  width: 490rpx;
+  height: 200rpx;
+  float: right;
+}
+.order-info__title {
+  color: #4c4c4c;
+  padding-top: 5rpx;
+  font-size: 24rpx;
+  line-height: 36rpx;
+  height: 72rpx;
+  -webkit-line-clamp: 2;
+}
+.order-info__type {
+  padding-top: 12rpx;
+  font-size: 24rpx;
+  color: #bbbbbb;
+}
+.order-info__price {
+  position: absolute;
+  bottom: 16rpx;
+  left: 0;
+  font-size: 24rpx;
+  color: #eab86a;
+}
+.order-info__point {
+  color: #bbbbbb;
+}
+.order-info__count {
+  position: absolute;
+  bottom: 16rpx;
+  right: 0;
+  font-size: 24rpx;
+  color: #bbbbbb;
+}
+.orderDetail-project {
+  padding: 20rpx;
+  background-color: #fff;
+}
+.orderDetail-count {
+  padding-top: 50rpx;
+  line-height: 48rpx;
+  font-size: 28rpx;
+}
+.orderDetail-count__title {
+  color: #4c4c4c;
+  float: left;
+}
+.orderDetail-count__count {
+  color: #4c4c4c;
+  float: right;
+}
+.orderDetail-discount {
+  line-height: 48rpx;
+  font-size: 28rpx;
+}
+.orderDetail-discount__title {
+  color: #4c4c4c;
+  float: left;
+}
+.orderDetail-discount__count {
+  color: #eab86a;
+  float: right;
+}
+.orderDetail-discount__point {
+  color: #bbbbbb;
+}
+.orderDetail-payPrice {
+  line-height: 80rpx;
+}
+.orderDetail-payPrice__title {
+  float: left;
+  font-size: 28rpx;
+  color: #eab86a;
+}
+.orderDetail-payPrice__count {
+  float: right;
+  color: #eab86a;
+  font-size: 32rpx;
+}
+/*.orderDetail-payPrice__count text {
+  float: right;
+}*/
+.orderDetail-info {
+  padding: 30rpx 20rpx;
+  background-color: #ffffff;
+  margin-top: 16rpx;
+}
+.orderDetail-info__line {
+  line-height: 42rpx;
+  color: #bbbbbb;
+  font-size: 24rpx;
+}
+.orderDetail-btnbg {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  height: 88rpx;
+  background-color: #fff;
+  border-top: 1rpx solid #dddddd;
+}
+.orderDetail-btn__red {
+  width: 158rpx;
+  height: 58rpx;
+  border: 1rpx solid #eab86a;
+  font-size: 28rpx;
+  color: #eab86a;
+  text-align: center;
+  line-height: 58rpx;
+  border-radius: 5rpx;
+  margin-right: 20rpx;
+  margin-top: 14rpx;
+  float: right;
+}
+.orderDetail-btn__black {
+  width: 158rpx;
+  height: 58rpx;
+  border: 1rpx solid #cccccc;
+  font-size: 28rpx;
+  color: #4c4c4c;
+  text-align: center;
+  line-height: 58rpx;
+  border-radius: 5rpx;
+  margin-right: 20rpx;
+  margin-top: 14rpx;
+  float: right;
+}
+.orderDetail-express {
+  background-color: #fff;
+  margin: 20rpx 0;
+  padding: 20rpx 0;
+}
+.orderDetail-express__main {
+  background-color: #fffae4;
+  margin: 0 auto;
+  padding-bottom: 27rpx;
+}
+.orderDetail-express__title {
+  text-align: center;
+  font-size: 28rpx;
+  color: #f7ae87;
+  padding: 28rpx 0 16rpx;
+}
+.orderDetail-express__val {
+  color: #5b93c3;
+  text-align: center;
+  font-size: 28rpx;
+  font-weight: bold;
+}
+.orderDetail-express__btn {
+  width: 88rpx;
+  height: 40rpx;
+  border: 1rpx solid #f7ae87;
+  text-align: center;
+  margin: 16rpx auto 0;
+  line-height: 40rpx;
+  font-size: 24rpx;
+  color: #f7ae87;
+  border-radius: 5rpx;
+}
+.orderDetail-express__com {
+  padding-left: 5rpx;
+}
+.yunfei{
+width: 100%;
+overflow: hidden;
+margin: 5px 0;
+padding-top: 15px;
+font-size: 14px;
+}
+
+
+
+.logistics-tit{
+	margin:20rpx;
+	box-sizing:border-box;
+}
+.logistics-rbox{
+position: relative;
+min-height: 130rpx;
+display: inline-block;
+float: left;
+width: calc(100% - 150rpx);
+padding: 15rpx;
+box-sizing: border-box;
+}
+.logistics-tit image{
+width: 130rpx;
+height: 130rpx;
+float: left;
+}
+.logistics-tit h6{
+font-size: 35rpx;
+color: #eab86a;
+}
+.logistics-tit p{
+font-size: 30rpx;
+color: #666;
+margin-top: 20rpx;
+display: block;
+
+}
+.hrline{
+height: 0.5px;
+width: 100%;
+background: #dfdfdf;
+display: block;
+}
+.logistics-list{margin:25rpx}
+.logistics-list ul{
+overflow: hidden;
+display: block;
+position:relative;
+}
+.logistics-list ul::after{
+	content:'';
+height: 90%;
+left: 28rpx;
+width: 1rpx;
+background: #999;
+position: absolute;
+top: 5%;
+
+}
+.logistics-list ul li{
+padding-left: 60rpx;
+display: block;
+float: left;
+margin: 25rpx 0;
+color: #666;
+}
+.logistics-list ul li::before{
+	content:'';
+position: absolute;
+width: 20rpx;
+height: 20rpx;
+border-radius: 50%;
+background: #999;
+left: 19rpx;
+z-index: 999;
+margin-top: 10rpx;
+
+}
+.logistics-list ul li p{color: #666;}
+.logistics-list ul li small{
+display: block;
+color: #999;
+margin-top: 10rpx;
+
+}
+.logistics-list ul li:nth-child(1) p{color:#eab86a;}
+.logistics-list ul li:nth-child(2) p{color:#333}
+.logistics-list ul li:nth-child(1)::before{background:#eab86a}
+.logistics-list ul li:nth-child(2)::before{background:#333}

+ 3 - 0
packageUser/pages/user/order/order.wxml

@@ -1,5 +1,6 @@
 <view class="bg">
   <view class="orderDetail-type">{{order.status_cn}}</view>
+  
   <view class="orderDetail-address"  wx:if="{{order.status !== 'unpay' && order.status !== 'closed'}}">
     <view class="orderDetail-address__info">
       <view class="orderDetail-address__name">收件人:{{order.contact}}</view>
@@ -71,9 +72,11 @@
         <text wx:if="{{order.pay_way === 'balance'}}">{{(order.total_price+order.freight) / 100}}代金券</text>
         <text wx:if="{{order.pay_way === 'integral'}}">{{(order.total_price+order.freight) / 100}}代金券</text>
         <view class="clean"></view>
+        
       </view>
       <view class="clean"></view>
     </view>
+    <navigator wx:if="{{order.sign && order.order_id && order.express_code}}" url="/packageUser/pages/user/logistics/logistics?id={{order.order_id}}" style="text-align:right;padding: 25rpx 0;color: #333;" open-type="navigate">查看物流 ></navigator>
   </view>
 <!--   <view class="orderDetail-info">
     <view class="orderDetail-info__line">订单编号:6546a13f13sf54a6f4464f</view>

+ 2 - 2
utils/request.js

@@ -1,7 +1,7 @@
 // // 新正式(未审批)
-const apiHost = 'https://fohowapi.hiwavo.com/' 
+//const apiHost = 'https://fohowapi.hiwavo.com/' 
 // 测试
-// const apiHost = 'https://tfohowapi.hiwavo.com/'
+   const apiHost = 'https://tfohowapi.hiwavo.com/'
 
 function $get (url, params, success, fail) {
   wx.showNavigationBarLoading()