DaMowang 3 lat temu
rodzic
commit
da5384af6a
2 zmienionych plików z 473 dodań i 548 usunięć
  1. 95 87
      src/pages/szw-order-details/index.vue
  2. 378 461
      src/pages/szw-order-list/index.vue

+ 95 - 87
src/pages/szw-order-details/index.vue

@@ -6,81 +6,78 @@
         </view>
         <view class="orderDetail_box" v-else>
             <view class="sec-wrap">
-                <!-- <view class="order-status">
+                <view class="order-status">
                     <view class="icon-box">
-                        <block v-if="orderInfo.orderDetail">
-                            <image v-if="orderInfo.orderDetail.status == 2" class="icon" src="@/static/order-details/icon-ddfk.png"></image>
-                            <image v-else-if="orderInfo.orderDetail.status == 3" class="icon" src="@/static/order-details/icon-ddfh.png"></image>
-                            <image v-else-if="orderInfo.orderDetail.status == 4" class="icon" src="@/static/order-details/icon-ddsh.png"></image>
-                            <image v-else-if="orderInfo.orderDetail.status == 5" class="icon" src="@/static/order-details/icon-jycg.png"></image>
-                            <image v-else-if="" class="icon" src="@/static/order-details/icon-ddgb.png"></image>
-                        </block>
+                        <image v-if="orderInfo.order_status === 0" class="icon" src="@/static/order-details/icon-ddfk.png"></image>
+                        <image v-else-if="orderInfo.order_status == 1" class="icon" src="@/static/order-details/icon-ddfh.png"></image>
+                        <image v-else-if="orderInfo.order_status == 2" class="icon" src="@/static/order-details/icon-ddsh.png"></image>
+                        <image v-else class="icon" src="@/static/order-details/icon-ddgb.png"></image>
                     </view>
                     <view class="right-text">
-                        <view class="status">{{ orderInfo.orderDetail ? orderInfo.orderDetail.statusMsg : "" }}</view>
+                        <view class="status">{{ tidyStatus([orderInfo.pay_status, orderInfo.order_status]) }}</view>
                     </view>
-                </view> -->
+                </view>
             </view>
             <!-- 配送 -->
-            <!-- <view class="address-box">
+            <view class="address-box">
                 <view class="show-address">
-                    <view class="name-tel">{{ orderInfo.address.name }} {{ orderInfo.address.mobile }}</view>
-                    <view class="addr-text">{{ orderInfo.address.province }} {{ orderInfo.address.city }} {{ orderInfo.address.county }} {{ orderInfo.address.address }}</view>
+                    <view class="name-tel">{{ orderInfo.consignee }} {{ orderInfo.mobile }}</view>
+                    <view class="addr-text">{{ orderInfo.address }}</view>
                 </view>
             </view>
-            <view class="logistics_btn" v-if="orderInfo.logistics && orderInfo.logistics.logistics_no && orderInfo.logistics.logistics_business" @tap="goLogistics">
+            <!-- <view class="logistics_btn" v-if="orderInfo.logistics && orderInfo.logistics.logistics_no && orderInfo.logistics.logistics_business" @tap="goLogistics">
                 <view class="l_box" v-if="orderInfo.logistics.statusMsg && orderInfo.logistics.statusMsg != ''">{{ orderInfo.logistics.statusMsg }}</view>
                 <view class="l_box" v-else>已发货:{{ orderInfo.logistics.logistics_business }},快递单号:{{ orderInfo.logistics.logistics_no }}</view>
             </view> -->
 
-            <!-- <view class="goods-list">
-                <view class="goods-info_box" v-for="(item, index) in orderInfo.mallGood" :key="index">
-                    <scroll-view class="goods-img-container" :data-id="item.goodsId" @tap="toGoodsDetails">
+            <view class="goods-list">
+                <view class="goods-info_box">
+                    <scroll-view class="goods-img-container">
                         <view class="img-box">
-                            <image :src="item.image" mode="" class="goods-img"></image>
+                            <image :src="orderInfo.goods.original_img" mode="" class="goods-img"></image>
                         </view>
                         <view class="goodsDetail_info">
-                            <view class="goods_name">{{ item.goodsName }}
-                                <view class="goods_num">×{{ item.buyCount }}</view>
+                            <view class="goods_name">{{ orderInfo.goods.goods_name }}
+                                <view class="goods_num">×{{ orderInfo.goods_num }}</view>
                             </view>
-                            <view class="goods_price r_color">¥{{ item.costPrice }}</view>
+                            <view class="goods_price r_color">¥{{ orderInfo.total_amount  }}</view>
                         </view>
                     </scroll-view>
                 </view>
-            </view> -->
+            </view>
 
-            <!-- <view class="order_info">
-                <view class="li_box" v-if="orderInfo.orderDetail.statusMsg">订单状态:
-                    <view class="info_data">{{ orderInfo.orderDetail.statusMsg }}</view>
+            <view class="order_info">
+                <view class="li_box">订单状态:
+                    <view class="info_data">{{ tidyStatus([orderInfo.pay_status, orderInfo.order_status]) }}</view>
                 </view>
-                <view class="li_box" v-if="orderInfo.orderDetail.orderNo">订单编号:
-                    <view class="info_data">{{ orderInfo.orderDetail.orderNo }}</view>
+                <view class="li_box" v-if="orderInfo.order_sn">订单编号:
+                    <view class="info_data">{{ orderInfo.order_sn }}</view>
                 </view>
-                <view class="li_box" v-if="orderInfo.orderDetail.createTime">订单创建:
-                    <view class="info_data">{{ orderInfo.orderDetail.createTime }}</view>
+                <view class="li_box" v-if="orderInfo.add_time">订单创建:
+                    <view class="info_data">{{ $day(orderInfo.add_time * 1000).format("YYYY-MM-DD HH:mm:ss") }}</view>
                 </view>
-                <view class="li_box">支付方式:
-                    <view class="info_data">{{ orderInfo.orderDetail.patTypeDesc }}</view>
+                <view class="li_box" v-if="orderInfo.pay_name">支付方式:
+                    <view class="info_data">{{ orderInfo.pay_name }}</view>
                 </view>
-                <view class="li_box" v-if="orderInfo.orderDetail.integral">商品合计:
-                    <view class="info_data">{{ orderInfo.orderDetail.integral }}</view>
+                <view class="li_box" v-if="orderInfo.total_amount">商品合计:
+                    <view class="info_data">{{ orderInfo.total_amount }}</view>
                 </view>
-                <view class="li_box" v-if="orderInfo.orderDetail.orderTypes == 2">批发积分:
-                    <view class="info_data">{{ orderInfo.orderDetail.totalPfInt }}</view>
-                </view>
-                <view class="li_box" v-if="orderInfo.orderDetail.orderTypes == 2">茶宝:
-                    <view class="info_data">{{ orderInfo.orderDetail.totalTeaInt }}</view>
-                </view>
-            </view> -->
+                <!-- <view class="li_box" v-if="orderInfo.orderTypes == 2">批发积分:
+                    <view class="info_data">{{ orderInfo.totalPfInt }}</view>
+                </view> -->
+                <!-- <view class="li_box" v-if="orderInfo.orderTypes == 2">茶宝:
+                    <view class="info_data">{{ orderInfo.totalTeaInt }}</view>
+                </view> -->
+            </view>
 
-            <!-- <view class="detail_btn-row-box">
+            <view class="detail_btn-row-box">
                 <view class="detail_btn-row">
-                    <view class="btn cancel-btn" @tap="toCancel" v-if="orderInfo.orderDetail.status == 2">取消订单</view>
-                    <view class="btn topay-btn" @tap="toPay" v-if="orderInfo.orderDetail.status == 2">立即支付</view>
-                    <view class="btn topay-btn" @tap="toTake" v-if="orderInfo.orderDetail.status == 4 || orderInfo.orderDetail.status == 3">确认收货</view>
+                    <view class="btn cancel-btn" @tap="toCancel" v-if="orderInfo.pay_status === 0">取消订单</view>
+                    <view class="btn topay-btn" @tap="toPay" v-if="orderInfo.pay_status === 0">立即支付</view>
+                    <view class="btn topay-btn" @tap="toTake" v-if="[0, 1].includes(orderInfo.order_status)">确认收货</view>
                     <view class="btn cancel-btn" @tap="goBack">返回</view>
                 </view>
-            </view> -->
+            </view>
         </view>
     </view>
 </template>
@@ -107,14 +104,16 @@ export default {
     },
     onLoad: function(e) {
         if (!e.id) {
-            uni.navigateBack({
-                delta: 1,
-            });
             uni.showToast({
                 title: "参数错误",
                 image: "/static/static/images/toast_nothing.png",
                 duration: 1200,
             });
+            setTimeout(() => {
+                uni.navigateBack({
+                    delta: 1,
+                });
+            }, 1200);
             return;
         }
         this.order_id = e.id;
@@ -125,32 +124,39 @@ export default {
         this.loadData();
     },
     methods: {
-        loadData: function() {
+        loadData() {
             post("my/orderDetail", {
               order_id: this.order_id,
             }).then(res => {
                 uni.hideLoading();
                 if (res.code === 0) {
-                    if (res) {
-                        this.orderInfo = res;
-                    } else {
-                        uni.showModal({
-                            title: "提示",
-                            content: "网络较慢,请稍后重试",
-                            success: function(res) {
-                                if (res) {
-                                    uni.navigateBack({
-                                        delta: 1,
-                                    });
-                                }
-                            },
-                        });
-                    }
+                    this.orderInfo = res.data.data;
                 }
             });
         },
         // 取消订单
-        toCancel() {},
+        toCancel() {
+            let that = this;
+            uni.showModal({
+                title: "温馨提示",
+                content: "发起拼单24小时后,若未拼单成功将自动取消订单并退款哦~",
+                showCancel: false,
+                confirmText: "知道了",
+                confirmColor: "#f02f2f",
+                success(res) {
+                    if (res.confirm) {
+                        post("my/orderCancel",{
+                            order_id: that.order_id
+                        }).then(res => {
+                            if(res.code === 0){
+                                appEv.errTips(res.msg);
+                                that.loadData();
+                            }
+                        })
+                    }
+                },
+            });
+        },
         // 立即支付
         toPay(e) {
             let data = {
@@ -179,34 +185,23 @@ export default {
         },
         // 确认收货
         toTake() {
-            var orderDetailId = this.orderId;
-            var that = this;
+            let that = this;
             uni.showModal({
-                content: "亲,“确定收货”代表着本订单的交付流程已经完成,不再支持任何形式的退换货。",
+                content: "亲,“确定收货”代表着本订单的交付流程已经完成,不再支持任何形式的退换货。",
                 confirmText: "确认收货",
                 confirmColor: "#fa2f2e",
                 cancelText: "取消",
                 cancelColor: "#bbb",
                 success(res) {
                     if (res.confirm) {
-                        const info = reqApi.takeOrder({
-                            orderDetailId: orderDetailId,
-                            type: 1,
-                        });
-                        if (info) {
-                            info.then((res) => {
-                                if (res.data.status == 200) {
-                                    appEv.errTips(res.data.msg);
-                                    setTimeout(function() {
-                                        that.loadData();
-                                    }, 1200);
-                                } else {
-                                    appEv.errTips(res.data.msg || "收货失败");
-                                }
-                            });
-                        }
-                    } else if (res.cancel) {
-                        // console.log('用户点击取消');
+                        post("goods/confirmOrder",{
+                            order_id: that.order_id
+                        }).then(res => {
+                            if(res.code === 0){
+                                appEv.errTips(res.msg);
+                                that.loadData();
+                            }
+                        })
                     }
                 },
             });
@@ -246,7 +241,7 @@ export default {
             }
         },
         goBack: function() {
-            uni.navigateBack({});
+            uni.navigateBack();
         },
         // 跳转商品详情
         toGoodsDetails(e) {
@@ -261,6 +256,19 @@ export default {
             });
         },
     },
+    computed: {
+        tidyStatus() {
+        return (da) => {
+            if (da[0] === 0) return "待支付";
+            if (da[1] === 0) return "待发货";
+            if (da[1] === 1) return "待收货";
+            if (da[1] === 2) return "已收货";
+            if (da[1] === 3) return "申请退货";
+            if (da[1] === 4) return "已退货";
+            if (da[1] === 5) return "已作废";
+        };
+        },
+    },
 };
 </script>
 <style lang="scss" scoped>

+ 378 - 461
src/pages/szw-order-list/index.vue

@@ -1,88 +1,46 @@
 <template>
-  <view class="container">
-    <view class="status-box">
-      <view class="status_tap_box" style="position: relative">
-        <view
-          @tap="statusTap"
-          class="status-label"
-          v-for="(item, index) in statusType"
-          :key="index"
-          :class="item[0] == currentType ? 'active' : ''"
-          :data-index="item[0]"
-        >
-          {{ item[1] }}
-        </view>
-      </view>
-    </view>
-    <not-goods v-if="haveGoods" textStr="抱歉!暂无相关订单" />
-    <view class="order-list" v-if="orderList && orderList.length > 0">
-      <view v-for="(li, index) in orderList" :key="index">
-        <!-- 未付款 -->
-        <view class="a-order">
-          <view class="overflow" :data-id="li.id">
-            <view class="list-title flex_r flex_ac flex_jb ellipsis">
-              <view class="fz_text">{{
-                tidyStatus([li.pay_status, li.order_status])
-              }}</view>
+    <view class="container">
+        <view class="status-box">
+            <view class="status_tap_box" style="position: relative">
+                <view @tap="statusTap" class="status-label" v-for="(item, index) in statusType" :key="index" :class="item[0] == currentType ? 'active' : ''" :data-index="item[0]">
+                    {{ item[1] }}
+                </view>
             </view>
-            <view
-              class="goods-info flex_r flex_ac flex_jb"
-              :data-type="li.type"
-              @tap="toDetails(li)"
-            >
-              <view class="goods-info-bar overflow flex_r flex_ac">
-                <view class="imgs_bar img-box">
-                  <image
-                    :src="li.original_img"
-                    mode=""
-                    class="goods-img"
-                  ></image>
+        </view>
+        <not-goods v-if="haveGoods" textStr="抱歉!暂无相关订单" />
+        <view class="order-list" v-if="orderList && orderList.length > 0">
+            <view v-for="(li, index) in orderList" :key="index">
+                <!-- 未付款 -->
+                <view class="a-order">
+                    <view class="overflow" :data-id="li.id">
+                        <view class="list-title flex_r flex_ac flex_jb ellipsis">
+                            <view class="fz_text">{{ tidyStatus([li.pay_status, li.order_status]) }}</view>
+                        </view>
+                        <view class="goods-info flex_r flex_ac flex_jb" :data-type="li.type" @tap="toDetails(li)">
+                            <view class="goods-info-bar overflow flex_r flex_ac">
+                                <view class="imgs_bar img-box">
+                                    <image :src="li.original_img" mode="" class="goods-img"></image>
+                                </view>
+                                <view class="goods_name ellipsis2">{{ li.goods_name || "" }}</view>
+                            </view>
+                            <view class="goodsDetail_info">
+                                <view class="goods_price r_color">¥<text class="r_color">{{ li.total_amount }}</text></view>
+                                <view class="unimport">共{{ li.goods_num }}件</view>
+                            </view>
+                        </view>
+                    </view>
+                    <view class="price-box flex_r flex_ac">
+                        <view class="btn cancel-btn" @tap="toCancel" v-if="li.pay_status === 0">取消订单</view>
+                        <view class="btn topay-btn" @tap="toPay" v-if="li.pay_status === 0">立即支付</view>
+                        <view class="btn cancel-btn" @click="toDetails(li)" v-if="li.pay_status != 0">查看订单</view>
+                        <view class="btn topay-btn" @tap="toTake(li)" v-if="[0, 1].includes(li.order_status)">确认收货</view>
+                    </view>
                 </view>
-                <view class="goods_name ellipsis2">{{
-                  li.goods_name || ""
-                }}</view>
-              </view>
-              <view class="goodsDetail_info">
-                <view class="goods_price r_color"
-                  >¥<text class="r_color">{{ li.total_amount }}</text></view
-                >
-                <view class="unimport">共{{ li.goods_num }}件</view>
-              </view>
+                <!-- 未付款 end -->
             </view>
-          </view>
-          <view class="price-box flex_r flex_ac">
-            <view
-              class="btn cancel-btn"
-              @tap="toCancel"
-              v-if="li.pay_status === 0"
-              >取消订单</view
-            >
-            <view class="btn topay-btn" @tap="toPay" v-if="li.pay_status === 0"
-              >立即支付</view
-            >
-            <view
-              class="btn cancel-btn"
-              @click="toDetails(li)"
-              v-if="li.pay_status != 0"
-              >查看订单</view
-            >
-            <view
-              class="btn topay-btn"
-              @tap="toTake"
-              v-if="[0, 1].includes(li.order_status)"
-              >确认收货</view
-            >
-          </view>
         </view>
-        <!-- 未付款 end -->
-      </view>
+        <view class="loading-indicator" :class="loadingMoreHidden ? 'opacity' : ''">{{ loadingTip }}</view>
     </view>
-    <view
-      class="loading-indicator"
-      :class="loadingMoreHidden ? 'opacity' : ''"
-      >{{ loadingTip }}</view
-    >
-  </view>
 </template>
 <script>
 // var reqApi = new ReqApi();
@@ -95,526 +53,485 @@ import { get, post, u_post } from "@/request/api.js";
 // import terraceTagbar from '@/components/terrace-tagbar/index'
 // import { ReqApi, ToPayOpre } from "../../utils/reqTools.js";
 export default {
-  components: {
-    notGoods,
-    // terraceTagbar
-  },
-  data() {
-    return {
-      statusType: [
-        ["0", "全部"],
-        ["1", "待付款"],
-        ["2", "待发货"],
-        ["3", "待收货"],
-        ["4", "已收货"],
-      ],
-      orderList: [],
-      currentType: "0",
-      haveGoods: false,
-      loadingMoreHidden: true,
-      loadingTip: "没有更多了",
-      userId: "",
-      isweixin: "",
-      pt: {},
-    };
-  },
-  onLoad(options) {
-    // this.currentType = options.status ? options.status : 1;
-  },
-  onShow() {
-    this.loadData();
-  },
-  methods: {
-    returnBtn: function () {
-      uni.navigateBack({});
+    components: {
+        notGoods,
+        // terraceTagbar
     },
-    clearData(isclearCat = true, callBack) {
-      page = 1;
-      this.orderList = [];
-      this.haveGoods = false;
-      if (callBack) {
-        callBack();
-      }
+    data() {
+        return {
+            statusType: [
+                ["0", "全部"],
+                ["1", "待付款"],
+                ["2", "待发货"],
+                ["3", "待收货"],
+                ["4", "已收货"],
+            ],
+            orderList: [],
+            currentType: "0",
+            haveGoods: false,
+            loadingMoreHidden: true,
+            loadingTip: "没有更多了",
+            userId: "",
+            isweixin: "",
+            pt: {},
+        };
     },
-    loadData() {
-      if (page == -1) {
-        return;
-      }
-      uni.showLoading({
-        title: "加载中…",
-        mask: true,
-      });
-      var data = {
-        page,
-        type: this.currentType,
-      };
-
-      post("my/order", data).then((res) => {
-        if (res.code === 0) {
-          if (res) {
-            setTimeout(() => {
-              uni.hideLoading();
-            }, 100);
-            uni.stopPullDownRefresh();
-            var resData = res.data.data.data;
-            if (resData && resData.length <= 0) {
-              if (page <= 1) {
-                this.haveGoods = true;
-                this.loadingMoreHidden = true;
-              } else {
-                this.loadingMoreHidden = false;
-              }
-            }
-          }
-          if (resData && resData.length > 0) {
-            var orderList = this.orderList;
-            var list = orderList.concat(resData);
-            this.pt = res.platform;
-            this.orderList = list;
-            this.haveGoods = false;
-            this.loadingMoreHidden = true;
-          }
-        } else {
-          appEv.errTips(res.msg || "");
-          if (res.status == 999) {
-            page = -1;
-            this.loadingMoreHidden = false;
-          }
-        }
-      });
-    },
-    toDetails(da) {
-      console.log(da);
-      uni.navigateTo({
-        url: "/pages/szw-order-details/index",
-      });
-      return
-      uni.navigateTo({
-        url: "/pages/autonym-submit/index",
-      });
-      // this.goto("/pages/szw-order-details/index",{id: data.order_id})
+    onLoad(options) {
+        // this.currentType = options.status ? options.status : 1;
     },
-
-    // 立即支付
-    toPay(e) {
-      var orderDetailIds = e.currentTarget.dataset.id;
-      var index = e.currentTarget.dataset.index;
-      var price = this.orderList[index].data.totalPrice;
-      var type = this.orderList[index].data.patType;
-      var teaIntegral = this.orderList[index].data.totalTeaInt;
-      var pfIntegral = this.orderList[index].data.totalPfInt;
-      var xfIntegral = this.orderList[index].data.totalXfInt;
-      var totalAccount = this.orderList[index].data.totalAccount;
-      var orderNo = this.orderList[index].data.orderNo;
-      let data = {
-        orderDetailIds: orderDetailIds,
-        types: 1,
-        price: price,
-        account: totalAccount,
-        teaIntegral: teaIntegral,
-        pfIntegral: pfIntegral,
-        xfIntegral: xfIntegral,
-        zfType: type,
-        ojsType: e.currentTarget.dataset.ojstype,
-      };
-      var info;
-      info = reqApi.payOrder(data);
-      var that = this;
-      if (info) {
-        info.then((res) => {
-          if (res.data.status == 200) {
-            toPayOpre.toPay(res.data.payParam);
-          } else {
-            appEv.errTips(res.data.msg || "支付失败");
-          }
-        });
-      }
+    onShow() {
+        this.loadData();
     },
-    // 取消订单
-    toCancel(e) {
-      var isTuan = e.currentTarget.dataset.tuan;
-      if (isTuan) {
-        uni.showModal({
-          title: "温馨提示",
-          content: "发起拼单24小时后,若未拼单成功将自动取消订单并退款哦~",
-          showCancel: false,
-          confirmText: "知道了",
-          confirmColor: "#f02f2f",
-        });
-      } else {
-        var orderDetailId = e.currentTarget.dataset.id,
-          type = e.currentTarget.dataset.type;
-        let types = e.currentTarget.dataset.types;
-        console.log(types);
-        if (types == 4) {
-          type = 1;
-        }
-        const info = reqApi.cancelOrder({ orderDetailId, type });
-        var that = this;
-        if (info) {
-          info.then((res) => {
-            if (res.data.status == 200) {
-              uni.showToast({
-                title: res.data.msg || "订单已取消",
-                duration: 1200,
-                mask: true,
-              });
-              setTimeout(function () {
-                that.clearData(false, () => {
-                  that.loadData();
-                });
-              }, 1200);
-            } else {
-              appEv.errTips(res.data.msg || "取消失败");
+    methods: {
+        returnBtn: function() {
+            uni.navigateBack({});
+        },
+        clearData(isclearCat = true, callBack) {
+            page = 1;
+            this.orderList = [];
+            this.haveGoods = false;
+            if (callBack) {
+                callBack();
             }
-          });
-        }
-      }
-    },
-    // 确认收货
-    toTake(e) {
-      let type = e.currentTarget.dataset.type;
-      var that = this;
-      uni.showModal({
-        content:
-          "亲,“确定收货”代表着本订单的交付流程已经完成,不再支持任何形式的退换货。",
-        confirmText: "确认收货",
-        confirmColor: "#fa2f2e",
-        cancelText: "取消",
-        cancelColor: "#bbb",
-        success(res) {
-          if (res.confirm) {
-            var orderDetailId = e.currentTarget.dataset.id;
-            const info = reqApi.takeOrder({
-              orderDetailId: orderDetailId,
-              type: type,
+        },
+        loadData() {
+            if (page == -1) {
+                return;
+            }
+            uni.showLoading({
+                title: "加载中…",
+                mask: true,
             });
-            if (info) {
-              info.then((res) => {
-                if (res.data.status == 200) {
-                  appEv.errTips(res.data.msg);
-                  setTimeout(function () {
-                    that.clearData(false, () => {
-                      that.loadData();
-                    });
-                  }, 1200);
+            var data = {
+                page,
+                type: this.currentType,
+            };
+
+            post("my/order", data).then((res) => {
+                if (res.code === 0) {
+                    if (res) {
+                        setTimeout(() => {
+                            uni.hideLoading();
+                        }, 100);
+                        uni.stopPullDownRefresh();
+                        var resData = res.data.data.data;
+                        if (resData && resData.length <= 0) {
+                            if (page <= 1) {
+                                this.haveGoods = true;
+                                this.loadingMoreHidden = true;
+                            } else {
+                                this.loadingMoreHidden = false;
+                            }
+                        }
+                    }
+                    if (resData && resData.length > 0) {
+                        var orderList = this.orderList;
+                        var list = orderList.concat(resData);
+                        this.pt = res.platform;
+                        this.orderList = list;
+                        this.haveGoods = false;
+                        this.loadingMoreHidden = true;
+                    }
                 } else {
-                  appEv.errTips(res.data.msg || "收货失败");
+                    appEv.errTips(res.msg || "");
+                    if (res.status == 999) {
+                        page = -1;
+                        this.loadingMoreHidden = false;
+                    }
                 }
-              });
+            });
+        },
+        toDetails(da) {
+            this.goto("/pages/szw-order-details/index", { id: da.order_id })
+        },
+
+        // 立即支付
+        toPay(e) {
+            var orderDetailIds = e.currentTarget.dataset.id;
+            var index = e.currentTarget.dataset.index;
+            var price = this.orderList[index].data.totalPrice;
+            var type = this.orderList[index].data.patType;
+            var teaIntegral = this.orderList[index].data.totalTeaInt;
+            var pfIntegral = this.orderList[index].data.totalPfInt;
+            var xfIntegral = this.orderList[index].data.totalXfInt;
+            var totalAccount = this.orderList[index].data.totalAccount;
+            var orderNo = this.orderList[index].data.orderNo;
+            let data = {
+                orderDetailIds: orderDetailIds,
+                types: 1,
+                price: price,
+                account: totalAccount,
+                teaIntegral: teaIntegral,
+                pfIntegral: pfIntegral,
+                xfIntegral: xfIntegral,
+                zfType: type,
+                ojsType: e.currentTarget.dataset.ojstype,
+            };
+            var info;
+            info = reqApi.payOrder(data);
+            var that = this;
+            if (info) {
+                info.then((res) => {
+                    if (res.data.status == 200) {
+                        toPayOpre.toPay(res.data.payParam);
+                    } else {
+                        appEv.errTips(res.data.msg || "支付失败");
+                    }
+                });
             }
-          } else if (res.cancel) {
-            // console.log('用户点击取消');
-          }
         },
-      });
+        // 取消订单
+        toCancel(e) {
+            let that = this;
+            uni.showModal({
+                title: "温馨提示",
+                content: "发起拼单24小时后,若未拼单成功将自动取消订单并退款哦~",
+                showCancel: false,
+                confirmText: "知道了",
+                confirmColor: "#f02f2f",
+                success(res) {
+                    if (res.confirm) {
+                        post("my/orderCancel",{
+                            order_id: e.order_id
+                        }).then(res => {
+                            if(res.code === 0){
+                                appEv.errTips(res.msg);
+                                that.loadData();
+                            }
+                        })
+                    }
+                },
+            });
+        },
+        // 确认收货
+        toTake(e) {
+            let that = this;
+            uni.showModal({
+                content: "亲,“确定收货”代表着本订单的交付流程已经完成,不再支持任何形式的退换货。",
+                confirmText: "确认收货",
+                confirmColor: "#fa2f2e",
+                cancelText: "取消",
+                cancelColor: "#bbb",
+                success(res) {
+                    if (res.confirm) {
+                        post("goods/confirmOrder",{
+                            order_id: e.order_id
+                        }).then(res => {
+                            if(res.code === 0){
+                                appEv.errTips(res.msg);
+                                that.loadData();
+                            }
+                        })
+                    }
+                },
+            });
+        },
+        // 整理数据
+        arrangeData(data = appEv.parameter("data")) {
+            var statusType = this.data.statusType;
+            statusType[0][2] = data.wholeCount;
+            statusType[1][2] = data.AlreadyPaymentCount;
+            statusType[2][2] = data.AlreadyCompleteCount;
+            statusType[3][2] = data.AlreadySettlementCount;
+            this.statusType = statusType;
+        },
+        //菜单切换
+        statusTap(e) {
+            //重置数据
+            var curType = e.currentTarget.dataset.index;
+            this.currentType = curType;
+            this.clearData(false, this.loadData);
+        },
     },
-    // 整理数据
-    arrangeData(data = appEv.parameter("data")) {
-      var statusType = this.data.statusType;
-      statusType[0][2] = data.wholeCount;
-      statusType[1][2] = data.AlreadyPaymentCount;
-      statusType[2][2] = data.AlreadyCompleteCount;
-      statusType[3][2] = data.AlreadySettlementCount;
-      this.statusType = statusType;
+    //上拉加载事件
+    onReachBottom() {
+        if (page != -1) {
+            var that = this;
+            setTimeout(() => {
+                // 为页数迭加1
+                ++page;
+                that.loadData();
+            }, 800);
+        }
     },
-    //菜单切换
-    statusTap(e) {
-      //重置数据
-      var curType = e.currentTarget.dataset.index;
-      this.currentType = curType;
-      this.clearData(false, this.loadData);
+    // 下拉刷新
+    onPullDownRefresh() {
+        var that = this;
+        that.clearData(false, () => {
+            that.loadData();
+        });
     },
-  },
-  //上拉加载事件
-  onReachBottom() {
-    if (page != -1) {
-      var that = this;
-      setTimeout(() => {
-        // 为页数迭加1
-        ++page;
-        that.loadData();
-      }, 800);
-    }
-  },
-  // 下拉刷新
-  onPullDownRefresh() {
-    var that = this;
-    that.clearData(false, () => {
-      that.loadData();
-    });
-  },
-  computed: {
-    tidyStatus() {
-      return (da) => {
-        if (da[0] === 0) return "待支付";
-        if (da[1] === 0) return "待发货";
-        if (da[1] === 1) return "待收货";
-        if (da[1] === 2) return "已收货";
-        if (da[1] === 3) return "申请退货";
-        if (da[1] === 4) return "已退货";
-        if (da[1] === 5) return "已作废";
-      };
+    computed: {
+        tidyStatus() {
+            return (da) => {
+                if (da[0] === 0) return "待支付";
+                if (da[1] === 0) return "待发货";
+                if (da[1] === 1) return "待收货";
+                if (da[1] === 2) return "已收货";
+                if (da[1] === 3) return "申请退货";
+                if (da[1] === 4) return "已退货";
+                if (da[1] === 5) return "已作废";
+            };
+        },
     },
-  },
 };
 </script>
 <style lang="scss">
 page {
-  background-color: #f3f5f7;
+    background-color: #f3f5f7;
 }
 
 .container {
-  width: 100%;
+    width: 100%;
 }
 
 .fl {
-  float: left;
+    float: left;
 }
 
 .fr {
-  float: right;
+    float: right;
 }
 
 .overflow {
-  overflow: hidden;
+    overflow: hidden;
 }
 
 .r_color {
-  color: #fa2f2e;
+    color: #fa2f2e;
 }
 
 .loading-indicator {
-  width: 100%;
-  text-align: center;
-  font-size: 24rpx;
-  color: #666;
-  margin: 20rpx 0;
-  line-height: 1.5;
+    width: 100%;
+    text-align: center;
+    font-size: 24rpx;
+    color: #666;
+    margin: 20rpx 0;
+    line-height: 1.5;
 }
 
 .opacity {
-  opacity: 0;
-  display: none;
+    opacity: 0;
+    display: none;
 }
 
 .terraceComp {
-  height: 84rpx;
+    height: 84rpx;
 }
 
 .terraceComp_fix {
-  position: fixed;
-  top: -12rpx;
-  left: 0;
-  right: 0;
-  z-index: 15;
+    position: fixed;
+    top: -12rpx;
+    left: 0;
+    right: 0;
+    z-index: 15;
 }
 
 .status-box {
-  width: 100%;
-  height: 94rpx;
+    width: 100%;
+    height: 94rpx;
 }
 
 .status_tap_box {
-  position: fixed;
-  left: 0;
-  top: 0;
-  width: 100%;
-  overflow: hidden;
-  line-height: 88rpx;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  background-color: #fff;
-  z-index: 300;
-  box-shadow: 0rpx 8rpx 8rpx rgba(0, 0, 0, 0.025);
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    overflow: hidden;
+    line-height: 88rpx;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    background-color: #fff;
+    z-index: 300;
+    box-shadow: 0rpx 8rpx 8rpx rgba(0, 0, 0, 0.025);
 }
 
 .status-box .status-label {
-  flex-grow: 1;
-  height: 100%;
-  text-align: center;
-  font-size: 28rpx;
-  color: #353535;
-  box-sizing: border-box;
-  position: relative;
-  border-bottom: 6rpx solid transparent;
+    flex-grow: 1;
+    height: 100%;
+    text-align: center;
+    font-size: 28rpx;
+    color: #353535;
+    box-sizing: border-box;
+    position: relative;
+    border-bottom: 6rpx solid transparent;
 }
 
 .status-box .status-label.active {
-  color: #e05f0b;
-  border-bottom-color: #e05f0b;
+    color: #e05f0b;
+    border-bottom-color: #e05f0b;
 }
 
 .order-list {
-  width: 100%;
-  overflow: hidden;
+    width: 100%;
+    overflow: hidden;
 }
 
 .order-list .a-order {
-  width: 100%;
-  background-color: #fff;
-  margin-top: 24rpx;
+    width: 100%;
+    background-color: #fff;
+    margin-top: 24rpx;
 }
 
 .order-list .a-order .order-date {
-  padding: 16rpx 30rpx 20rpx;
-  line-height: 40rpx;
-  font-size: 26rpx;
-  color: #000;
-  overflow: hidden;
+    padding: 16rpx 30rpx 20rpx;
+    line-height: 40rpx;
+    font-size: 26rpx;
+    color: #000;
+    overflow: hidden;
 }
 
 .order-list .a-order .order-date .red {
-  font-size: 26rpx;
-  color: #fa2f2e;
+    font-size: 26rpx;
+    color: #fa2f2e;
 }
 
 .order-list .a-order .order-date text.r_color {
-  font-weight: 600;
+    font-weight: 600;
 }
 
 .a-order .goods-info {
-  width: 100%;
-  overflow: hidden;
+    width: 100%;
+    overflow: hidden;
 }
 
 .a-order .list-title {
-  font-size: 28rpx;
-  font-weight: 600;
-  color: #000;
-  padding: 16rpx 24rpx;
+    font-size: 28rpx;
+    font-weight: 600;
+    color: #000;
+    padding: 16rpx 24rpx;
 }
 
 .avaImgs {
-  width: 54rpx;
-  height: 54rpx;
-  overflow: hidden;
-  border-radius: 50%;
-  background-color: #f3f5f7;
-  margin-right: 20rpx;
+    width: 54rpx;
+    height: 54rpx;
+    overflow: hidden;
+    border-radius: 50%;
+    background-color: #f3f5f7;
+    margin-right: 20rpx;
 }
 
 .goods-info {
-  width: 100%;
-  line-height: 39rpx;
-  font-size: 26rpx;
-  color: #000;
-  overflow: hidden;
-  padding: 30rpx;
-  background-color: #f3f5f7;
-  box-sizing: border-box;
+    width: 100%;
+    line-height: 39rpx;
+    font-size: 26rpx;
+    color: #000;
+    overflow: hidden;
+    padding: 30rpx;
+    background-color: #f3f5f7;
+    box-sizing: border-box;
 }
 
 .goods-info-bar {
-  width: calc(100% - 190rpx);
+    width: calc(100% - 190rpx);
 }
 
 .goods-info .img-box {
-  width: 172rpx;
-  height: 120rpx;
-  overflow: hidden;
-  background-color: #fff;
-  border-radius: 12rpx;
-  margin-right: 20rpx;
+    width: 172rpx;
+    height: 120rpx;
+    overflow: hidden;
+    background-color: #fff;
+    border-radius: 12rpx;
+    margin-right: 20rpx;
 }
 
 .goods-info .img-box .goods-img {
-  width: 100%;
-  display: block;
-  height: 100%;
+    width: 100%;
+    display: block;
+    height: 100%;
 }
 
 .goods-img-container {
-  overflow: hidden;
-  box-sizing: border-box;
-  width: 100%;
-  height: 172rpx;
-  white-space: nowrap;
+    overflow: hidden;
+    box-sizing: border-box;
+    width: 100%;
+    height: 172rpx;
+    white-space: nowrap;
 }
 
 .goods-img-container .img-box {
-  display: inline-block;
+    display: inline-block;
 }
 
 .goods-img-container .img-box:last-of-type {
-  margin-right: 0;
+    margin-right: 0;
 }
 
 .goods-info .goods_name {
-  width: calc(100% - 192rpx);
-  font-size: 28rpx;
-  font-weight: 500;
-  color: #121212;
+    width: calc(100% - 192rpx);
+    font-size: 28rpx;
+    font-weight: 500;
+    color: #121212;
 }
 
 .goodsDetail_info {
-  overflow: hidden;
-  width: 180rpx;
-  line-height: 1.5;
-  text-align: right;
+    overflow: hidden;
+    width: 180rpx;
+    line-height: 1.5;
+    text-align: right;
 }
 
 .goodsDetail_info .unimport {
-  font-size: 24rpx;
-  color: #999;
+    font-size: 24rpx;
+    color: #999;
 }
 
 .goodsDetail_info .goods_price {
-  font-size: 26rpx;
-  line-height: 1.2;
-  font-weight: 600;
-  margin-bottom: 10rpx;
+    font-size: 26rpx;
+    line-height: 1.2;
+    font-weight: 600;
+    margin-bottom: 10rpx;
 }
 
 .goodsDetail_info .goods_price text {
-  font-size: 36rpx;
+    font-size: 36rpx;
 }
 
 .order-list .a-order .price-box {
-  position: relative;
-  width: 100%;
-  box-sizing: border-box;
-  padding: 16rpx 30rpx;
-  display: flex;
-  justify-content: flex-end;
-  font-size: 26rpx;
+    position: relative;
+    width: 100%;
+    box-sizing: border-box;
+    padding: 16rpx 30rpx;
+    display: flex;
+    justify-content: flex-end;
+    font-size: 26rpx;
 }
 
 .a-order .price-box .btn {
-  box-sizing: border-box;
-  text-align: center;
-  border-radius: 40rpx;
-  margin-left: 20rpx;
-  border: 1rpx solid #ccc;
-  padding: 12rpx 24rpx;
+    box-sizing: border-box;
+    text-align: center;
+    border-radius: 40rpx;
+    margin-left: 20rpx;
+    border: 1rpx solid #ccc;
+    padding: 12rpx 24rpx;
 }
 
 .order-list .a-order .price-box .total-price {
-  color: #e05f0b;
+    color: #e05f0b;
 }
 
 .a-order .price-box .topay-btn {
-  border-color: #e05f0b;
-  color: #e05f0b;
+    border-color: #e05f0b;
+    color: #e05f0b;
 }
 
 .a-order .price-box .r_topay-btn {
-  border-color: #e05f0b;
-  background-color: #e05f0b;
-  color: #fff;
+    border-color: #e05f0b;
+    background-color: #e05f0b;
+    color: #fff;
 }
 
 //拼团金
 .flot_left {
-  // float: left;
-  margin-left: auto;
+    // float: left;
+    margin-left: auto;
 }
 
 .ptz {
-  color: #18bb88;
-  font-size: 30rpx;
-  position: absolute;
-  left: 30rpx;
+    color: #18bb88;
+    font-size: 30rpx;
+    position: absolute;
+    left: 30rpx;
 }
 </style>