Browse Source

新增订单管理

shenjj 7 years ago
parent
commit
5200a212be
5 changed files with 523 additions and 127 deletions
  1. 331 91
      pages/mobile/order/details.vue
  2. 130 17
      pages/mobile/order/index.vue
  3. 31 19
      pages/mobile/order/logistics.vue
  4. 16 0
      store/order.js
  5. 15 0
      store/order/order.js

+ 331 - 91
pages/mobile/order/details.vue

@@ -9,70 +9,83 @@
       <div class="order-details-top">
         <div class="clearfix top-t-wrap">
           <div class="pull-left">
-            待收货
-            <span>剩余6天2时自动确认</span>
+            <template v-if="orderList.status === 404 && vendorType === 'buyer'">待收货</template>
+            <template v-else-if="orderList.status === 404 || orderList.status === 520 || orderList.status === 405 || orderList.status === 503 || orderList.status === 514">
+              请耐心等待买家确认收货
+            </template>
+            <span v-if="vendorType === 'buyer'">{{restTime()}}</span>
           </div>
-          <div class="pull-right">
-            <div class="concat">
+          <div class="pull-right" v-if="vendorType !== 'buyer'">
+            <div class="concat" @click="cancatAlert()">
               <i class="iconfont icon-kefu1"></i>联系买家
             </div>
           </div>
+          <div class="pull-right" v-if="vendorType === 'buyer'">
+            <div class="concat" @click="cancatAlert()">
+              <i class="iconfont icon-kefu1"></i>联系卖家
+            </div>
+          </div>
         </div>
         <div class="sendGoods_buyer">
           <div class="sendGoods_buyer_top">
-            <span class="name">{{sendGoodsInfo.area.name || '收货人'}}</span>
-            <span class="tel">{{sendGoodsInfo.area.tel || '收货人电话'}}</span>
+            <span class="name">{{orderList.area.name || '收货人'}}</span>
+            <span class="tel">{{orderList.area.tel || '收货人电话'}}</span>
           </div>
           <div class="sendGoods_buyer_bottom">
             <img src="/images/order/address_icon.png"/>
-            <span>{{sendGoodsInfo.area.area}}{{sendGoodsInfo.area.detailAddress}}</span>
+            <span>{{orderList.area.area}}{{orderList.area.detailAddress}}</span>
           </div>
         </div>
         <div class="clearfix top-w-wrap">
           <div class="name pull-left">订单备注</div>
-          <div class="detailsinfo pull-left">啦啦啦啦</div>
+          <div class="detailsinfo pull-left">{{orderList.purchaseRemark || '无'}}</div>
         </div>
       </div>
       <ul class="order-list-wrap">
-        <li class="clearfix" v-for="item in orderList">
+        <li class="clearfix">
           <div class="list-wrap-title clearfix">
-            <div class="pull-left" v-if="vendorType !== 'buyer'">{{item.buyername}}&nbsp;|&nbsp;{{item.buyentername}}</div>
-            <div class="pull-left" v-else>
-              <span>{{(item.uuid !== underfined && item.storeid === shopuuid.uuid && item.sellername.indexOf('优软测试二') < 0 && item.sellername.indexOf('优软商城') < 0) ? '' : '寄售'}}</span>
-              {{item.sellername}}</div>
+            <div class="pull-left" v-if="vendorType !== 'buyer'" @click="toShopdetails(orderList)">
+              <template v-if="orderList.buyentername">
+                <span class="labelInfo_ForItem" v-if="orderList.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>
+              </template>
+              {{orderList.buyername}}&nbsp;|&nbsp;{{orderList.buyentername || '个人账户'}}
+            </div>
+            <div class="pull-left" v-else @click="toShopdetails(orderList)">
+              <span class="labelInfo_ForItem" v-if="orderList.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>
+              {{orderList.sellername}}</div>
             <div class="pull-right">
               <template v-if="vendorType === 'buyer'">
-                <span class="red" v-if="item.status === 505 || item.status === 406 || item.status === 407 || item.status === 403 || item.status === 408">待卖家发货</span>
-                <span class="red" v-else-if="item.status === 501 || item.status === 502 || item.status === 503 || item.status === 524">待付款</span>
-                <span class="red" v-else-if="item.status === 404">待收货</span>
-                <span class="red" v-else-if="item.status === 602 || item.status === 603 || item.status === 315 || item.status === 604 || item.status === 605 || item.status === 606">已取消</span>
-                <span class="red" v-else-if="item.status === 504">付款确认中</span>
-                <span class="red" v-else-if="item.status === 520 || item.status === 405">交易已完成</span>
-                <span class="red" v-else-if="item.status === 525">卖家请求取消</span>
+                <span class="red" v-if="orderList.status === 505 || orderList.status === 406 || orderList.status === 407 || orderList.status === 403 || orderList.status === 408">待卖家发货</span>
+                <span class="red" v-else-if="orderList.status === 501 || orderList.status === 502 || orderList.status === 503 || orderList.status === 524">待付款</span>
+                <span class="red" v-else-if="orderList.status === 404">待收货</span>
+                <span class="red" v-else-if="orderList.status === 602 || orderList.status === 603 || orderList.status === 315 || orderList.status === 604 || orderList.status === 605 || orderList.status === 606">已取消</span>
+                <span class="red" v-else-if="orderList.status === 504">付款确认中</span>
+                <span class="red" v-else-if="orderList.status === 520 || orderList.status === 405">交易已完成</span>
+                <span class="red" v-else-if="orderList.status === 525">卖家请求取消</span>
               </template>
               <template v-else>
-                <span class="red" v-if="item.status === 502 || item.status === 406">买家已付款</span>
+                <span class="red" v-if="orderList.status === 502 || orderList.status === 406">买家已付款</span>
                 <!--<span class="red">待发货</span>-->
-                <span class="red" v-else-if="item.status === 602 || item.status === 603 || item.status === 315 || item.status === 604 || item.status === 605 || item.status === 606">订单已取消</span>
-                <span class="red" v-else-if="item.status === 501 || item.status === 524">待买家付款</span>
-                <span class="red" v-else-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 503 || item.status === 514">待买家收货</span>
-                <span class="red" v-else-if="item.status === 405 || item.status === 514 || item.status === 503 || item.status === 506">待商城付款</span>
-                <span class="red" v-else-if="item.status === 606">交易关闭</span>
-                <span class="red" v-else-if="item.status === 520">交易完成</span>
-                <span class="red" v-else-if="item.status === 525">卖家发起取消,待确认</span>
-                <span class="red" v-else-if="item.status === 504">付款确认中</span>
+                <span class="red" v-else-if="orderList.status === 602 || orderList.status === 603 || orderList.status === 315 || orderList.status === 604 || orderList.status === 605 || orderList.status === 606">订单已取消</span>
+                <span class="red" v-else-if="orderList.status === 501 || orderList.status === 524">待买家付款</span>
+                <span class="red" v-else-if="orderList.status === 404 || orderList.status === 520 || orderList.status === 405 || orderList.status === 503 || orderList.status === 514">待买家收货</span>
+                <span class="red" v-else-if="orderList.status === 405 || orderList.status === 514 || orderList.status === 503 || orderList.status === 506">待商城付款</span>
+                <span class="red" v-else-if="orderList.status === 606">交易关闭</span>
+                <span class="red" v-else-if="orderList.status === 520">交易完成</span>
+                <span class="red" v-else-if="orderList.status === 525">卖家发起取消,待确认</span>
+                <span class="red" v-else-if="orderList.status === 504">付款确认中</span>
               </template>
             </div>
           </div>
-          <div class="list-wrap-content" v-for="(details, index) in item.purchaseDetails" v-if="index < showItem">
+          <div class="list-wrap-content" @click="toproductdetails(details)" v-for="(details, index) in orderList.purchaseDetails" v-if="index < showItem">
             <div class="list-item clearfix">
               <div class="list-wrap-content-brand clearfix pull-left">
                 <div class="name pull-left">品牌:</div>
                 <div class="pull-left">{{details.brName || '-'}}</div>
               </div>
-              <div class="pull-right lab">
-                自定义标签
-              </div>
+              <!--<div class="pull-right lab">-->
+                <!--{{details.goodsnumber || ''}}-->
+              <!--</div>-->
             </div>
             <div class="list-item clearfix">
               <div class="list-wrap-content-brand clearfix pull-left">
@@ -100,76 +113,134 @@
             </div>
             <div class="list-item clearfix">
               <div class="list-wrap-content-brand clearfix pull-left blue">
-                <div class="name pull-left">物料编码:</div>
-                <div class="pull-left">{{details.spec || '这里是物料编码'}}</div>
+                <div class="name pull-left blue">物料编码:</div>
+                <div class="pull-left">{{details.goodsnumber || '-'}}</div>
               </div>
             </div>
           </div>
         </li>
       </ul>
-      <div class="lookMorePro" v-if="orderList.purchaseDetails && orderList.purchaseDetails.length > 3">查看剩余产品<img src="/images/mobile/user/icon-right.png"/></div>
+      <div class="lookMorePro" @click="showItem = orderList.purchaseDetails.length" v-if="showItem === 3 && orderList.purchaseDetails && orderList.purchaseDetails.length > 3">查看剩余产品<img src="/images/mobile/user/icon-right.png"/></div>
       <div class="order-details-priInfo">
         <div class="clearfix">
           <div class="pull-left">商品金额总计:</div>
-          <div class="pull-right">¥13212.32132</div>
+          <div class="pull-right">¥{{orderList.ensurePrice - orderList.fare | priceFiter}}</div>
         </div>
         <div class="clearfix">
           <div class="pull-left">运费:</div>
-          <div class="pull-right">¥13212.32132</div>
-        </div>
-        <div class="clearfix">
-          <div class="pull-left">促销优惠:</div>
-          <div class="pull-right">-¥13212.32132</div>
-        </div>
-        <div class="clearfix small">
-          <div class="pull-left">积分冲抵:</div>
-          <div class="pull-right">-¥13212.32132</div>
+          <div class="pull-right">¥{{orderList.fare | priceFiter}}</div>
         </div>
+        <!--<div class="clearfix">-->
+          <!--<div class="pull-left">促销优惠:</div>-->
+          <!--<div class="pull-right">-¥13212.32132</div>-->
+        <!--</div>-->
+        <!--<div class="clearfix small">-->
+          <!--<div class="pull-left">积分冲抵:</div>-->
+          <!--<div class="pull-right">-¥13212.32132</div>-->
+        <!--</div>-->
       </div>
       <div class="list-all-info clearfix">
         <div>共<span>{{orderList.batchQty}}</span>件商品&nbsp;&nbsp;合计:
           <span class="pri"><a class="red">¥</a>{{orderList.ensurePrice}}</span>
           <span class="lab">(含运费:<a class="red">¥</a><a class="red">{{orderList.fare | priceFiter}}</a>)</span></div>
-        <div>手续费:<a class="red">¥9.99</a><span class="del">(¥0.55)</span></div>
+        <div>手续费:<a class="red">¥0.00</a><span class="del">(¥{{parseFloat(orderList.ensurePrice * 0.0045).toFixed(2)}})</span></div>
       </div>
       <div class="order-details-info">
         <div class="clearfix">
           <div class="name pull-left">配送方式</div>
           <div class="pull-right">
-            <!--{{sendGoodsInfo.sendType === 1301 ? '第三方配送' : (sendGoodsInfo.sendType === 1302 ? '卖家配送': '上门自提')}}-->
-            第三方配送
+            {{orderList.sendType === 1301 ? '第三方配送' : (orderList.sendType === 1302 ? '卖家配送': '上门自提')}}
+            <!--第三方配送-->
           </div>
         </div>
         <div class="clearfix">
           <div class="name pull-left">配送规则</div>
           <div class="pull-right">
-            配送规则
+            ({{orderList.rule.ruleName ? orderList.rule.ruleName : ''}})
           </div>
         </div>
         <div class="clearfix">
           <div class="name pull-left">付款方式</div>
           <div class="pull-right">
-            线下支付
+            {{orderList.paytype === 1103 ? '线下付款' : '网上支付'}}
           </div>
         </div>
         <div class="clearfix">
           <div class="name pull-left">发票信息</div>
           <div class="pull-right">
-            暂不开票
+            {{(orderList.invoicetype === 1205 || orderList.invoicetype === 1206) ? '查看更多信息' : '暂不开票'}}
+            <img src="/images/mobile/user/icon-right.png" @click="showinvoiceType = true" v-if="orderList.invoicetype === 1205 || orderList.invoicetype === 1206"/>
           </div>
         </div>
       </div>
+      <!-- 发票信息 -->
+      <div class="order-details-invoiceinfo" v-if="orderList.invoicetype === 1205 || orderList.invoicetype === 1206" v-show="showinvoiceType">
+        <div class="invoiceList clearfix" >
+          <div class="pull-left">发票类型:</div>
+          <div class="pull-right">{{orderList.purchaseRemark || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix">
+          <div class="pull-left">发票抬头:</div>
+          <div class="pull-right">{{orderList.invoicetitle || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix" v-if="orderList.invoicetype === 1205">
+          <div class="pull-left">单位地址:</div>
+          <div class="pull-right">{{invoiceAddress.companyAddress || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix" v-if="orderList.invoicetype === 1205">
+          <div class="pull-left">单位电话:</div>
+          <div class="pull-right">{{invoiceAddress.companyPhone || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix" v-if="orderList.invoicetype === 1205">
+          <div class="pull-left">税务登记号:</div>
+          <div class="pull-right">{{invoiceAddress.companyTaxNumber || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix" v-if="orderList.invoicetype === 1205">
+          <div class="pull-left">开户银行:</div>
+          <div class="pull-right">{{invoiceAddress.bankName || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix" v-if="orderList.invoicetype === 1205">
+          <div class="pull-left">开户银行账户:</div>
+          <div class="pull-right">{{invoiceAddress.bankAccount || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix" v-if="orderList.invoicetype === 1205">
+          <div class="pull-left">收票人:</div>
+          <div class="pull-right">{{invoiceAddress.name || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix">
+          <div class="pull-left">联系电话:</div>
+          <div class="pull-right">{{invoiceAddress.telephone || '空'}}</div>
+        </div>
+        <div class="invoiceList clearfix">
+          <div class="pull-left">详细地址:</div>
+          <div class="pull-right">{{invoiceAddress.area}}{{invoiceAddress.detailAddress}}</div>
+        </div>
+      </div>
       <div class="order-details-moreinfo clearfix">
-        <div class="clearfix">
+        <div class="clearfix moreinfoList">
           <div class="pull-left">
-            <div class="">订单编号:123131321sdf12</div>
-            <div class="">创建时间:123131321sdf12</div>
-            <div class="">付款时间:123131321sdf12</div>
-            <div class="">发货时间:123131321sdf12</div>
+            <div class="">订单编号:
+              <span id="orderNumber">{{orderList.orderid}}</span>
+              <textarea id="input" cols="1" rows="1" style="position: fixed;left: 0px;top: 0px;">这是幕后黑手</textarea>
+            </div>
+            <div class="">创建时间:
+              {{orderList.createtime || orderList.creattime | time}}</div>
+            <div class="" v-if="vendorType === 'buyer'">付款时间:
+              <template v-if="getOverTiem(505) > 0">{{getOverTiem(505) | time }}</template>
+              <template v-else>暂未付款</template>
+            </div>
+            <div class="" v-else>付款时间:
+              <template v-if="getOverTiem(502) > 0">{{getOverTiem(502) | time }}</template>
+              <template v-else>暂未付款</template>
+            </div>
+            <div class="">发货时间:
+              <template v-if="getOverTiem(404) > 0">{{getOverTiem(404) | time }}</template>
+              <template v-else>暂未发货</template>
+            </div>
           </div>
           <div class="pull-right copyBtn" @click="copyBtn()">复制</div>
         </div>
-        <div class="list-btn">
+        <div class="list-btn clearfix">
           <template v-if="vendorType === 'buyer'">
             <div class="sendGoods" v-if="orderList.status === 404" @click="buyerGetGoods(orderList)">确认收货</div>
             <div class="sendGoods" v-if="!orderList.installmentId && (orderList.status === 503 || orderList.status === 501)" @click="onMind('跳到上传水印地址')">确认付款</div>
@@ -181,7 +252,7 @@
           </template>
           <template v-else>
             <div class="sendGoods" v-if="(orderList.status === 502 || orderList.status === 406) && !orderList.uasPurcid" @click="sendGoods(orderList)">点击发货</div>
-            <div @click="changelogistics(orderList)" class="sendGoods" v-if="orderList.status === 404 && !orderList.uasPurcid">修改物流</div>
+            <div @click="changelogistics(orderList)" class="sendGoods" v-if="orderList.status === 404 && !orderList.uasPurcid && status === ''">修改物流</div>
             <div @click="lookLogisticsInfo(orderList)" class="" v-if="orderList.status === 404 || orderList.status === 520 || orderList.status === 405 || orderList.status === 503 || orderList.status === 514">查看物流</div>
             <div @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" class="" v-if="orderList.installmentId && ((orderList.installment.status === 503 && orderList.Overtime) || orderList.installment.status === 504) && orderList.status !== 606 && orderList.status !== 525">
               取消订单
@@ -194,7 +265,7 @@
       </div>
     </div>
     <!-- 发货弹窗 -->
-    <div class="mobile-modal" v-if="showSend">
+    <div class="mobile-modal" v-if="showSend" @touchmove="preventTouchMove($event)">
       <div class="sendGoods_Alert">
         <div class="sendGoods_title">发货信息<span><i class="iconfont icon-guanbi1" @click="showSend = false"></i></span></div>
         <div class="sendGoods_buyer">
@@ -253,7 +324,7 @@
     <!-- /end 选择配送商 -->
     <!-- 删除订单 -->
     <!-- 删除提示框 -->
-    <div class="deleteKuang" v-if="showDeleteAlert">
+    <div class="deleteKuang" v-if="showDeleteAlert" @touchmove="preventTouchMove($event)">
       <div class="kuangContent">
         <div class="title">删除信息</div>
         <div class="titleinfo">是否删除此订单</div>
@@ -266,7 +337,7 @@
     </div>
     <!-- /end 删除订单 -->
     <!-- 取消订单原因弹窗 -->
-    <div class="mobile-modal" v-if="showBuyerAlert">
+    <div class="mobile-modal" v-if="showBuyerAlert" @touchmove="preventTouchMove($event)">
       <div class="cancelOrder">
         <div class="sendGoods_title">取消订单<span><i class="iconfont icon-guanbi1" @click="showBuyerAlert = false"></i></span></div>
         <div class="cancelOrder_title">请选择取消订单的原因(必选):</div>
@@ -280,10 +351,33 @@
       </div>
     </div>
     <!-- /end 取消订单原因弹窗 -->
+
+    <!-- 联系卖买家 -->
+    <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
+      <div class="mobile-modal-box mobile-link-en">
+        <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
+        <div class="mobile-modal-content">
+          <div v-if="vendorType === 'buyer'">
+            <div v-if="checkInfo(cancatInfo.enterprise.enTel)" class="clearfix"><span class="pull-left">电话:</span><a :href="'tel:' + cancatInfo.enterprise.enTel" target="_blank" class="content-line link-url pull-left">{{cancatInfo.enterprise.enTel}}</a></div>
+            <div v-if="checkInfo(cancatInfo.enterprise.enPhone)" class="clearfix"><span class="pull-left">手机:</span><a :href="'tel:' + cancatInfo.enterprise.enPhone" target="_blank" class="content-line link-url pull-left">{{cancatInfo.enterprise.enPhone}}</a></div>
+            <div v-if="checkInfo(cancatInfo.enterprise.enWeixin)" class="clearfix"><span class="pull-left">微信:</span><span class="content-line pull-left">{{cancatInfo.enterprise.enWeixin}}</span></div>
+            <div v-if="checkInfo(cancatInfo.enterprise.enQQ)" class="clearfix"><span class="pull-left">Q&nbsp;Q:</span><span class="content-line pull-left">{{cancatInfo.enterprise.enQQ}}</span></div>
+            <div v-if="!empty">暂无联系方式</div>
+          </div>
+          <div v-else>
+            <div class="clearfix"><span class="pull-left"></span>抱歉,暂时无法与买家在线沟通!</div>
+            <div v-if="checkInfo(cancatInfo.entel)" class="clearfix"><span class="pull-left">电话:</span><a :href="'tel:' + cancatInfo.entel" target="_blank" class="content-line link-url pull-left">{{cancatInfo.entel}}</a></div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <!-- /联系买卖家 -->
+
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 <script>
+    import axios from '~plugins/axios'
     import { EncryptionFilter } from '~utils/tools.js'
     import { RemindBox } from '~components/mobile/common'
     export default {
@@ -292,6 +386,11 @@
       middleware: 'authenticated',
       data() {
         return {
+          showStoreInfo: false, // 联系信息弹窗
+          showinvoiceType: false, // 是否展示发票信息
+          cancatInfo: {
+            enterprise: ''
+          }, // 联系信息
           isSearchSearchingMore: false,
           collectResult: '',
           timeoutCount: 0,
@@ -300,6 +399,7 @@
           sendGoodsInfo: { // 发货弹窗对象
             area: {}
           },
+          status: '', // 物流状态
           peisongShow: false, // 是否显示配送商选择弹窗
           seekKeyword: '',
           peisongChooseIndex: '', // 配送商选择下标
@@ -312,7 +412,35 @@
           $CancenOrderId: '', // 取消订单id
           $Orderreason: '', // 取消订单原因
           OrderCancelIndex: '', // 取消订单原因下标
-          showItem: 3 // 允许展示多个产品
+          showItem: 3, // 允许展示多个产品
+          invoiceAddress: {} // 发票信息
+        }
+      },
+      async asyncData({route}) {
+        if (route.query.type === 'buyer') {
+          let sellsendGoodsTime
+          let { data } = await axios.get(`/trade/order/${route.query.uuid}`)
+          data[0].area = JSON.parse(data[0].jsonAddress)
+          data[0].rule = JSON.parse(data[0].jsonRule)
+          data[0].paytype = route.query.paytype
+          data[0].historyS = JSON.parse(data[0].statushistory)
+          data[0].purchaseDetails = data[0].orderDetails
+          if (route.query.type === 'buyer') {
+            sellsendGoodsTime = await axios.get(`/trade/tradebasicproperties/get/1054`)
+          }
+          return {
+            orderList: data[0],
+            sellsendGoodsTime: parseInt(sellsendGoodsTime.data.info)
+          }
+        }
+        let { data } = await axios.get(`/trade/purchase/purchaseId/${route.query.uuid}`)
+        data.data.area = JSON.parse(data.data.jsonAddress)
+        data.data.rule = JSON.parse(data.data.jsonRule)
+        data.data.paytype = route.query.paytype
+        data.data.historyS = JSON.parse(data.data.statushistory)
+        return {
+          orderList: data.data,
+          invoiceAddress: JSON.parse(data.data.invoiceAddress)
         }
       },
       computed: {
@@ -321,6 +449,9 @@
         },
         shopuuid() {
           return this.$store.state.option.storeStatus.data
+        },
+        empty () {
+          return this.checkInfo(this.cancatInfo.enterprise.enTel) || this.checkInfo(this.cancatInfo.enterprise.enPhone) || this.checkInfo(this.cancatInfo.enterprise.enWeixin) || this.checkInfo(this.cancatInfo.enterprise.enQQ)
         }
       },
       filters: {
@@ -329,7 +460,70 @@
           return val.toFixed(2)
         }
       },
+      created() {
+        if (this.orderList.lgtId && this.vendorType !== 'buyer') {
+          this.$http.get(`/trade/logistics/${this.orderList.lgtId}`).then(data => {
+            this.$http.get(`/kdn/logistics/query?companyName=${data.data.companyName}&logisticsCode=${data.data.number}`).then(res => {
+              let str = res.data.traces
+              if (str.indexOf('揽件') !== -1 || str.indexOf('收件') !== -1 || str.indexOf('转运') !== -1 || str.indexOf('运输') !== -1 || str.indexOf('发往') !== -1 ||
+                str.indexOf('发出') !== -1 || str.indexOf('收入') !== -1 || str.indexOf('扫描') !== -1 || str.indexOf('到达') !== -1) {
+                this.status = 'transit'
+              }
+              if (str.indexOf('派送') !== -1 || str.indexOf('派件') !== -1) {
+                this.status = 'send'
+              }
+              if (str.indexOf('签收') !== -1) {
+                this.status = 'signin'
+              }
+            })
+          })
+        }
+      },
       methods: {
+        // 店铺详情页
+        toShopdetails(item) {
+          this.$router.push(`/mobile/shop/${item.storeid}`)
+        },
+        // 产品详情页
+        toproductdetails(item) {
+          this.$router.push(`/mobile/product/${item.batchCode}`)
+        },
+        // 返回剩余时间
+        restTime() {
+          for (let i = 0; i < this.orderList.historyS.length; i++) {
+            if (this.orderList.historyS[i].status === 404) {
+              let h = 360 - this._getHoursFromNow(this.orderList.historyS[i].time)
+              let day = parseInt(h) / 24
+              let hours = parseInt(h) % 24
+              return '还剩 ' + parseInt(day) + '天' + parseInt(hours) + '小时自动确认'
+            }
+          }
+          return ''
+        },
+        checkInfo: function (str) {
+          return str && str.trim() !== ''
+        },
+        // 联系买卖家
+        cancatAlert() {
+          this.showStoreInfo = true
+          if (this.vendorType === 'buyer') {
+            this.$http.get(`/api/store-service/stores?uuid=${this.orderList.storeid}&condition=store_uuid`).then(res => {
+              this.cancatInfo = res.data
+            })
+          } else {
+            this.$http.get(`/basic/enterprise/${this.orderList.buyerenuu}/tels`).then(res => {
+              this.cancatInfo = res.data.data
+            })
+          }
+        },
+        getOverTiem(status) {
+          for (let j = 0; j < this.orderList.historyS.length; j++) {
+            if (this.orderList.historyS[j].status === status) {
+              return this.orderList.historyS[j].time
+            }
+          }
+          return ''
+        },
         // 是否为分期付款
         installmentDetailPaid(item) {
           if (!item.installment) return false
@@ -406,7 +600,7 @@
                 if (res.data.success) {
                   this.onMind('发货成功')
                   setTimeout(() => {
-                    this.ChangeList(this.activeType)
+                    location.reload()
                     this.showSend = false
                     this.peisongChooseIndex = 0
                     this.peisongChooseItem = {companyName: '请选择配送商'}
@@ -440,7 +634,7 @@
                 if (res.data.success) {
                   this.onMind('物流信息保存成功')
                   setTimeout(() => {
-                    this.ChangeList(this.activeType)
+                    location.reload()
                     this.peisongChooseIndex = 0
                     this.peisongChooseItem = {companyName: '请选择配送商'}
                     this.showSend = false
@@ -468,7 +662,7 @@
                   if (res.data.success) {
                     this.onMind('修改物流信息成功')
                     setTimeout(() => {
-                      this.ChangeList(this.activeType)
+                      location.reload()
                       this.peisongChooseIndex = 0
                       this.peisongChooseItem = {companyName: '请选择配送商'}
                       this.showSend = false
@@ -482,7 +676,7 @@
                     if (res.data.success) {
                       this.onMind('修改物流信息成功')
                       setTimeout(() => {
-                        this.ChangeList(this.activeType)
+                        location.reload()
                         this.peisongChooseIndex = 0
                         this.peisongChooseItem = {companyName: '请选择配送商'}
                         this.showSend = false
@@ -519,7 +713,7 @@
             let returnResult = res.data
             if (returnResult.status === 505 || returnResult.status === 406 || returnResult.status === 407 || returnResult.status === 403 || returnResult.status === 408) {
               this.onMind('提醒成功')
-              this.ChangeList(this.activeType)
+              location.reload()
             }
           })
         },
@@ -534,7 +728,7 @@
             this.$http.put(`/trade/order/simpleinfo/ones/${this.$CancenOrderId}/release`, reason).then(res => {
               this.onMind('取消订单成功,等待买家确认')
               this.$Orderreason = ''
-              this.ChangeList(this.activeType)
+              location.reload()
               this.showBuyerAlert = false
             })
           }
@@ -588,13 +782,14 @@
         },
         // 查看物流信息
         lookLogisticsInfo(item) {
-          this.$router.push(`/mobile/order/logistics?uuid=${EncryptionFilter(item.purchaseid)}`)
+          let id = item.purchaseid || item.orderid
+          this.$router.push(`/mobile/order/logistics?uuid=${EncryptionFilter(id)}&type=${this.vendorType}`)
         },
         // 买家确认收货
         buyerGetGoods(item) {
           this.$http.put(`/trade/order/simpleinfo/ones/${item.id}?_status=ensureaccept`).then(res => {
             this.onMind('确认收货成功')
-            this.ChangeList(this.activeType)
+            location.reload()
           })
         },
         // 买卖家中心字段同步化
@@ -623,9 +818,13 @@
         },
         // 拷贝
         copyBtn() {
-          let t = document.getElementById('txt')
-          t.select()
-          window.clipboardData.setData('text', t.createTextRange().text)
+          let text = document.getElementById('orderNumber').innerText
+          let input = document.getElementById('input')
+          input.value = text // 修改文本框的内容
+          input.select() // 选中文本
+          if (document.execCommand('copy', false, null)) {
+            this.onMind('复制成功')
+          }
         },
         onMind(str) {
           this.collectResult = str
@@ -660,7 +859,7 @@
   .order-wrapper {
     background: #f1f3f6;
     margin: 0.88rem 0 0.98rem 0;
-    height: calc(100vh - 0.88rem - 0.98rem);
+    height: calc(100vh - 0.88rem - 0.96rem);
     overflow-y: scroll;
     .order-details-wrap {
       .order-details-top {
@@ -764,10 +963,10 @@
             color: #333;
             line-height: 0.6rem;
             .list-wrap-content-brand {
-              width: 4.8rem;
               @include overFlowHidden();
-              &.blue {
-                color: #3f84f6
+              .spec {
+                width: 4rem;
+                @include overFlowHidden()
               }
             }
             .name {
@@ -776,6 +975,8 @@
             .lab {
               color: #999;
               font-size: 0.24rem;
+              max-width: 2.2rem;
+              @include overFlowHidden();
               span {
                 font-size: 0.16rem;
               }
@@ -783,10 +984,15 @@
             .pri {
               font-size: 0.32rem;
               color: #f43938;
+              max-width: 2.2rem;
+              @include overFlowHidden();
               span {
                 font-size: 0.24rem;
               }
             }
+            .blue {
+              color: #3f84f6
+            }
           }
         }
         .list-btn {
@@ -874,11 +1080,24 @@
         background: #fff;
         margin-top: 0.2rem;
         .clearfix{
+          img {
+            transform: rotate(90deg);
+            width: 0.16rem;
+            height: 0.26rem;
+            vertical-align: top;
+            margin-top: 0.3rem;
+            margin-left: 0.1rem;
+            margin-right: 0.1rem;
+          }
           padding: 0 0.2rem;
           font-size: 0.28rem;
           color: #666;
           @include lineHeight(0.89rem);
-          border-bottom: 1px solid #e4e4e4
+          border-bottom: 1px solid #e4e4e4;
+          .pull-right {
+            @include overFlowHidden();
+            max-width: 5rem;
+          }
         }
       }
       .order-details-moreinfo {
@@ -886,9 +1105,10 @@
         font-size: 0.24rem;
         color: #999;
         padding: 0.2rem 0;
-       .clearfix {
+        margin-bottom: 0.3rem;
+       .clearfix.moreinfoList {
          padding: 0 0.2rem;
-         border-bottom: 1px solid #e4e4e4;
+         /*border-bottom: 1px solid #e4e4e4;*/
          .pull-left {
            div {
              @include lineHeight(0.5rem);
@@ -905,16 +1125,18 @@
           padding: 0 0.2rem;
         }
         .list-btn {
-          float: right;
-          width: 1.5rem;
-          @include lineHeight(0.56rem);
-          background: #3f84f6;
-          color: #fff;
-          border-radius: 3px;
-          text-align: center;
-          font-size: 0.26rem;
-          margin-top: 0.2rem;
-          margin-right: 0.2rem;
+          div {
+            float: right;
+            width: 1.5rem;
+            @include lineHeight(0.56rem);
+            background: #3f84f6;
+            color: #fff;
+            border-radius: 3px;
+            text-align: center;
+            font-size: 0.26rem;
+            margin-top: 0.2rem;
+            margin-right: 0.2rem;
+          }
         }
       }
     }
@@ -1269,5 +1491,23 @@
         background: #3f84f6;
       }
     }
+    .labelInfo_ForItem {
+      color: #fff;
+      font-size: 0.24rem;
+      padding: 0.05rem 0.1rem;
+      background: #15b262;
+      margin-right: 0.1rem;
+      border-radius: 3px;
+    }
+    .order-details-invoiceinfo {
+      padding: 0.1rem 0.4rem;
+      background: #fff;
+      .invoiceList {
+        font-size: 0.24rem;
+        color: #999;
+        height: 0.5rem;
+        line-height: 0.5rem;
+      }
+    }
   }
 </style>

+ 130 - 17
pages/mobile/order/index.vue

@@ -14,9 +14,11 @@
     <ul class="order-list-wrap">
       <li class="clearfix" v-for="item in orderList">
         <div class="list-wrap-title clearfix">
-          <div class="pull-left" v-if="vendorType !== 'buyer'">{{item.buyername}}&nbsp;|&nbsp;{{item.buyentername}}</div>
-          <div class="pull-left" v-else>
-            <span>{{(item.uuid !== underfined && item.storeid === shopuuid.uuid && item.sellername.indexOf('优软测试二') < 0 && item.sellername.indexOf('优软商城') < 0) ? '' : '寄售'}}</span>
+          <div class="pull-left" v-if="vendorType !== 'buyer'" @click="toShopdetails(item)">
+            <span class="labelInfo_ForItem" v-if="item.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>
+            {{item.buyername}}&nbsp;|&nbsp;{{item.buyentername}}</div>
+          <div class="pull-left" v-else @click="toShopdetails(item)">
+            <span class="labelInfo_ForItem" v-if="item.storeid === '33069557578d44e69bd91ad12d28a8d4'">寄售</span>
             {{item.sellername}}</div>
           <div class="pull-right">
             <template v-if="vendorType === 'buyer'">
@@ -42,20 +44,20 @@
             </template>
           </div>
         </div>
-        <div class="list-wrap-content" v-for="(details, index) in item.purchaseDetails" v-if="index < 3">
+        <div class="list-wrap-content" @click="toproductdetails(details)" v-for="(details, index) in item.purchaseDetails" v-if="index < 3">
           <div class="list-item clearfix">
             <div class="list-wrap-content-brand clearfix pull-left">
               <div class="name pull-left">品牌:</div>
-              <div class="pull-left">{{details.brName || '-'}}</div>
+              <div class="pull-left spec">{{details.brName || '-'}}</div>
             </div>
             <div class="pull-right lab">
-              自定义标签
+              {{details.goodsnumber || '-'}}
             </div>
           </div>
           <div class="list-item clearfix">
             <div class="list-wrap-content-brand clearfix pull-left">
               <div class="name pull-left">类目:</div>
-              <div class="pull-left">{{details.kiName || '-'}}</div>
+              <div class="pull-left spec">{{details.kiName || '-'}}</div>
             </div>
             <div class="pull-right pri">
               <span>¥</span>{{details.ensurePrice}}
@@ -64,7 +66,7 @@
           <div class="list-item clearfix">
             <div class="list-wrap-content-brand clearfix pull-left">
               <div class="name pull-left">型号:</div>
-              <div class="pull-left">{{details.cmpCode || '-'}}</div>
+              <div class="pull-left spec">{{details.cmpCode || '-'}}</div>
             </div>
             <div class="pull-right lab">
               <span>x</span>{{details.number}}
@@ -73,7 +75,7 @@
           <div class="list-item clearfix">
             <div class="list-wrap-content-brand clearfix pull-left">
               <div class="name pull-left">规格:</div>
-              <div class="pull-left">{{details.spec || '-'}}</div>
+              <div class="pull-left spec">{{details.spec || '-'}}</div>
             </div>
           </div>
         </div>
@@ -94,6 +96,9 @@
               删除订单</div>
             <div @click="paidTime(item)" class="pull-right" v-if="_getHoursFromNow(item.paytime) > sellsendGoodsTime - 1">提醒发货</div>
             <div @click="lookLogisticsInfo(item)" class="pull-right" v-if="item.status === 404 || item.status === 520 || item.status === 405 || item.status === 521">查看物流</div>
+            <div class="pull-right cancat" @click="cancatAlert(item)">
+              <i class="iconfont icon-kefu1"></i>联系卖家
+            </div>
           </template>
           <template v-else>
             <div class="pull-right sendGoods" v-if="(item.status === 502 || item.status === 406) && !item.uasPurcid" @click="sendGoods(item)">点击发货</div>
@@ -108,13 +113,16 @@
             <div @click="onMind('此订单为分期付款,请前往【PC】端进行相关操作')" class="pull-right" v-if="installmentDetailPaid(item) && item.status !== 525 && item.status !== 606">
               确认收款
             </div>
+            <div class="pull-right cancat"  @click="cancatAlert(item)">
+              <i class="iconfont icon-kefu1"></i>联系买家
+            </div>
           </template>
         </div>
       </li>
     </ul>
     <div v-if="getOrderList && false"></div>
     <!-- 发货弹窗 -->
-    <div class="mobile-modal" v-if="showSend">
+    <div class="mobile-modal" v-if="showSend" @touchmove="preventTouchMove($event)">
       <div class="sendGoods_Alert">
         <div class="sendGoods_title">发货信息<span><i class="iconfont icon-guanbi1" @click="showSend = false"></i></span></div>
         <div class="sendGoods_buyer">
@@ -173,7 +181,7 @@
     <!-- /end 选择配送商 -->
     <!-- 删除订单 -->
     <!-- 删除提示框 -->
-    <div class="deleteKuang" v-if="showDeleteAlert">
+    <div class="deleteKuang" v-if="showDeleteAlert" @touchmove="preventTouchMove($event)">
       <div class="kuangContent">
         <div class="title">删除信息</div>
         <div class="titleinfo">是否删除此订单</div>
@@ -186,7 +194,7 @@
     </div>
     <!-- /end 删除订单 -->
     <!-- 取消订单原因弹窗 -->
-    <div class="mobile-modal" v-if="showBuyerAlert">
+    <div class="mobile-modal" v-if="showBuyerAlert" @touchmove="preventTouchMove($event)">
      <div class="cancelOrder">
        <div class="sendGoods_title">取消订单<span><i class="iconfont icon-guanbi1" @click="showBuyerAlert = false"></i></span></div>
        <div class="cancelOrder_title">请选择取消订单的原因(必选):</div>
@@ -200,6 +208,27 @@
      </div>
     </div>
     <!-- /end 取消订单原因弹窗 -->
+
+    <!-- 联系卖买家 -->
+    <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
+      <div class="mobile-modal-box mobile-link-en">
+        <div class="mobile-modal-header">联系方式<i @click="showStoreInfo = false" class="icon-guanbi iconfont"></i></div>
+        <div class="mobile-modal-content">
+          <div v-if="vendorType === 'buyer'">
+            <div v-if="checkInfo(cancatInfo.enterprise.enTel)" class="clearfix"><span class="pull-left">电话:</span><a :href="'tel:' + cancatInfo.enterprise.enTel" target="_blank" class="content-line link-url pull-left">{{cancatInfo.enterprise.enTel}}</a></div>
+            <div v-if="checkInfo(cancatInfo.enterprise.enPhone)" class="clearfix"><span class="pull-left">手机:</span><a :href="'tel:' + cancatInfo.enterprise.enPhone" target="_blank" class="content-line link-url pull-left">{{cancatInfo.enterprise.enPhone}}</a></div>
+            <div v-if="checkInfo(cancatInfo.enterprise.enWeixin)" class="clearfix"><span class="pull-left">微信:</span><span class="content-line pull-left">{{cancatInfo.enterprise.enWeixin}}</span></div>
+            <div v-if="checkInfo(cancatInfo.enterprise.enQQ)" class="clearfix"><span class="pull-left">Q&nbsp;Q:</span><span class="content-line pull-left">{{cancatInfo.enterprise.enQQ}}</span></div>
+            <div v-if="!empty">暂无联系方式</div>
+          </div>
+          <div v-else>
+            <div class="clearfix"><span class="pull-left"></span>抱歉,暂时无法与买家在线沟通!</div>
+            <div v-if="checkInfo(cancatInfo.entel)" class="clearfix"><span class="pull-left">电话:</span><a :href="'tel:' + cancatInfo.entel" target="_blank" class="content-line link-url pull-left">{{cancatInfo.entel}}</a></div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <!-- /联系买卖家 -->
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
     <pull-up :fixId="'order-wrapper'"
              :searchMore="isSearchSearchingMore"
@@ -239,8 +268,12 @@
     },
     data() {
       return {
+        showStoreInfo: false,
         isSearchSearchingMore: false,
         page: 1,
+        cancatInfo: {
+          enterprise: {}
+        }, // 联系信息
         collectResult: '',
         timeoutCount: 0,
         activeType: '', // 选择类型
@@ -252,7 +285,7 @@
         },
         peisongShow: false, // 是否显示配送商选择弹窗
         seekKeyword: '',
-        peisongChooseIndex: '', // 配送商选择下标
+        peisongChooseIndex: 0, // 配送商选择下标
         peisongList: [], // 配送商数组
         peisongShowName: '', // 选择完后的配送
         showDeleteAlert: false, // 是否显示删除订单
@@ -277,6 +310,9 @@
       },
       shopuuid() {
         return this.$store.state.option.storeStatus.data
+      },
+      empty () {
+        return this.checkInfo(this.cancatInfo.enterprise.enTel) || this.checkInfo(this.cancatInfo.enterprise.enPhone) || this.checkInfo(this.cancatInfo.enterprise.enWeixin) || this.checkInfo(this.cancatInfo.enterprise.enQQ)
       }
     },
     async asyncData({route}) {
@@ -288,6 +324,30 @@
       }
     },
     methods: {
+      // 店铺详情页
+      toShopdetails(item) {
+        this.$router.push(`/mobile/shop/${item.storeid}`)
+      },
+      // 产品详情页
+      toproductdetails(item) {
+        this.$router.push(`/mobile/product/${item.batchCode}`)
+      },
+      checkInfo: function (str) {
+        return str && str.trim() !== ''
+      },
+      // 联系买卖家
+      cancatAlert(item) {
+        this.showStoreInfo = true
+        if (this.vendorType === 'buyer') {
+          this.$http.get(`/api/store-service/stores?uuid=${item.storeid}&condition=store_uuid`).then(res => {
+            this.cancatInfo = res.data
+          })
+        } else {
+          this.$http.get(`/basic/enterprise/${item.buyerenuu}/tels`).then(res => {
+            this.cancatInfo = res.data.data
+          })
+        }
+      },
       getMoreSearch() {
         this.page++
         this.isSearchSearchingMore = true
@@ -399,11 +459,14 @@
       },
       // 选择配送商
       choosePeisong() {
+        this.seekKeyword = ''
         if (this.peisongList.length > 0) {
+          this.peisongList = this.AllpeisongList.slice()
           this.peisongShow = true
           return
         }
         this.$http.get('/trade/distributor/selected').then(res => {
+          this.AllpeisongList = res.data
           this.peisongList = res.data
           this.peisongList.splice(0, 0, {
             companyName: '请选择配送商'
@@ -623,7 +686,23 @@
       },
       // 搜索
       searchSeek() {
-        this.seekKeyword
+        let _arr = this.AllpeisongList.slice()
+        let addrPatt = /^[\u4e00-\u9fa5]+$/
+        if (addrPatt.test(this.seekKeyword) && this.seekKeyword.length > 0) {
+          this.peisongList = []
+          this.peisongList = _arr.filter((data) => {
+            if (data.companyName.indexOf(this.seekKeyword) >= 0) {
+              return data
+            }
+          })
+          this.peisongList.splice(0, 0, {
+            companyName: '请选择配送商'
+          })
+        } else if (this.seekKeyword === '' || !this.seekKeyword) {
+          this.peisongList = _arr
+        }
+        this.peisongChooseIndex = 0
+        this.peisongChooseItem = {companyName: '请选择配送商'}
       },
       // 获取物流提交信息
       getLogisticsInfo(_type) {
@@ -641,10 +720,17 @@
       },
       // 查看物流信息
       lookLogisticsInfo(item) {
-        this.$router.push(`/mobile/order/logistics?uuid=${EncryptionFilter(item.purchaseid)}`)
+        let id = item.purchaseid || item.orderid
+        this.$router.push(`/mobile/order/logistics?uuid=${EncryptionFilter(id)}&type=${this.vendorType}`)
       },
       // 查看订单详情
-      lookOrderDetail(item) {},
+      lookOrderDetail(item) {
+        let id = EncryptionFilter(item.purchaseid)
+        if (this.vendorType === 'buyer') {
+          id = EncryptionFilter(item.orderid)
+        }
+        this.$router.push(`/mobile/order/details?uuid=${id}&type=${this.vendorType}&paytype=${item.paytype}`)
+      },
       // 买家确认收货
       buyerGetGoods(item) {
         this.$http.put(`/trade/order/simpleinfo/ones/${item.id}?_status=ensureaccept`).then(res => {
@@ -766,8 +852,11 @@
         color: #333;
         line-height: 0.6rem;
         .list-wrap-content-brand {
-          width: 4.8rem;
           @include overFlowHidden();
+          .spec {
+            width: 4rem;
+            @include overFlowHidden()
+          }
         }
         .name {
           color: #666;
@@ -775,6 +864,8 @@
         .lab {
           color: #999;
           font-size: 0.24rem;
+          max-width: 2.2rem;
+          @include overFlowHidden();
           span {
             font-size: 0.16rem;
           }
@@ -782,6 +873,8 @@
         .pri {
           font-size: 0.32rem;
           color: #f43938;
+          max-width: 2.2rem;
+          @include overFlowHidden();
           span {
             font-size: 0.24rem;
           }
@@ -829,6 +922,18 @@
           color: #f43938;
           border: 0.01rem solid #f43938;
         }
+        &.cancat {
+          height: 0.56rem;
+          line-height: 0.56rem;
+          border: 0.01rem solid #3f84f6;
+          color: #3f84f6;
+          font-size: 0.26rem;
+          text-align: center;
+          border-radius: 3px;
+          padding: 0 0.1rem;
+          overflow: hidden;
+          width: auto;
+        }
       }
     }
   }
@@ -1183,5 +1288,13 @@
       background: #3f84f6;
     }
   }
+  .labelInfo_ForItem {
+    color: #fff;
+    font-size: 0.24rem;
+    padding: 0.05rem 0.1rem;
+    background: #15b262;
+    margin-right: 0.1rem;
+    border-radius: 3px;
+  }
 }
 </style>

+ 31 - 19
pages/mobile/order/logistics.vue

@@ -49,30 +49,42 @@
           detailsInfo: {},
           logistics: {},
           logisticsInfo: {},
-          status: '',
+          status: ''
         }
       },
       async asyncData ({route}) {
-        let res = await axios.get(`/trade/purchase/purchaseId/${route.query.uuid}`)
-        let logistics = await axios.get(`/trade/logistics/${res.data.data.lgtId}`)
-        let logisticsInfo = await axios.get(`/kdn/logistics/query?companyName=${logistics.data.companyName}&logisticsCode=${logistics.data.number}`)
-        let str = logisticsInfo.data.traces
-        let status = ''
-        if (str.indexOf('揽件') !== -1 || str.indexOf('收件') !== -1 || str.indexOf('转运') !== -1 || str.indexOf('运输') !== -1 || str.indexOf('发往') !== -1 ||
-          str.indexOf('发出') !== -1 || str.indexOf('收入') !== -1 || str.indexOf('扫描') !== -1 || str.indexOf('到达') !== -1) {
-          status = 'transit'
-        }
-        if (str.indexOf('派送') !== -1 || str.indexOf('派件') !== -1) {
-          status = 'send'
-        }
-        if (str.indexOf('签收') !== -1) {
-          status = 'signin'
+        let res
+        let resultInfo
+        if (route.query.type === 'buyer') {
+          res = await axios.get(`/trade/order/${route.query.uuid}`)
+          resultInfo = res.data[0]
+        } else {
+          res = await axios.get(`/trade/purchase/purchaseId/${route.query.uuid}`)
+          resultInfo = res.data.data
         }
         return {
-          detailsInfo: res.data.data,
-          logistics: logistics.data,
-          logisticsInfo: JSON.parse(logisticsInfo.data.traces).reverse(),
-          status: status
+          detailsInfo: resultInfo
+        }
+      },
+      created() {
+        if (this.detailsInfo.lgtId) {
+          this.$http.get(`/trade/logistics/${this.detailsInfo.lgtId}`).then(data => {
+            this.logistics = data.data
+            this.$http.get(`/kdn/logistics/query?companyName=${data.data.companyName}&logisticsCode=${data.data.number}`).then(res => {
+              let str = res.data.traces
+              this.logisticsInfo = JSON.parse(res.data.traces).reverse()
+              if (str.indexOf('揽件') !== -1 || str.indexOf('收件') !== -1 || str.indexOf('转运') !== -1 || str.indexOf('运输') !== -1 || str.indexOf('发往') !== -1 ||
+                str.indexOf('发出') !== -1 || str.indexOf('收入') !== -1 || str.indexOf('扫描') !== -1 || str.indexOf('到达') !== -1) {
+                this.status = 'transit'
+              }
+              if (str.indexOf('派送') !== -1 || str.indexOf('派件') !== -1) {
+                this.status = 'send'
+              }
+              if (str.indexOf('签收') !== -1) {
+                this.status = 'signin'
+              }
+            })
+          })
         }
       }
     }

+ 16 - 0
store/order.js

@@ -21,4 +21,20 @@ export const actions = {
         commit('order/GET_ORDERLIST_FAILURE', err)
       })
   },
+
+  // 获取买家中心订单列表
+  getLogisticsInfo ({ commit }, params = {}) {
+    let id = params.id
+    commit('order/REQUEST_LOGISTICS')
+    return axios.get(`/trade/logistics/${id}`)
+      .then(response => {
+        axios.get(`/kdn/logistics/query?companyName=${response.data.companyName}&logisticsCode=${response.data.number}`).then(res => {
+          commit('order/GET_LOGISTICS_SUCCESS', res.data)
+        }, err => {
+          commit('order/GET_LOGISTICS_FAILURE', err)
+        })
+      }, err => {
+        commit('order/GET_LOGISTICS_FAILURE', err)
+      })
+  }
 }

+ 15 - 0
store/order/order.js

@@ -2,6 +2,10 @@ export const state = () => ({
   orderList: {
     fetching: false,
     data: []
+  },
+  logisticsInfo: {
+    fetching: false,
+    data: []
   }
 })
 
@@ -15,6 +19,17 @@ export const mutations = {
   GET_ORDERLIST_SUCCESS (state, result) {
     state.orderList.fetching = false
     state.orderList.data = result
+  },
+
+  REQUEST_LOGISTICS (state) {
+    state.logisticsInfo.fetching = true
+  },
+  GET_LOGISTICS_FAILURE (state) {
+    state.logisticsInfo.fetching = false
+  },
+  GET_LOGISTICS_SUCCESS (state, result) {
+    state.logisticsInfo.fetching = false
+    state.logisticsInfo.data = result
   }
 }