DaMoWang il y a 3 ans
Parent
commit
897809bd7a
2 fichiers modifiés avec 245 ajouts et 0 suppressions
  1. 6 0
      src/pages.json
  2. 239 0
      src/pagesB/invoice/invoiceList.vue

+ 6 - 0
src/pages.json

@@ -294,6 +294,12 @@
 					"navigationBarTitleText": "填写发票信息"
 				}
 			},
+			{
+				"path": "invoice/invoiceList",
+				"style": {
+					"navigationBarTitleText": "已开票"
+				}
+			},
 			{
 				"path": "invoice/Billingresult",
 				"style": {

+ 239 - 0
src/pagesB/invoice/invoiceList.vue

@@ -0,0 +1,239 @@
+<template>
+  <div class="iApp">
+    <div class="log_list" :style="{ height: height }">
+      <div class="list_box" v-for="(item, index) of list" :key="index">
+        <div class="list_item">
+            <div class="p1 flex_r flex_jb c05">
+              <span>订单号:{{ item.order_sn }}</span>
+              <span>{{ $day(item.add_time * 1000).format("YYYY-MM-DD") }}</span>
+            </div>
+            <div class="p2 flex_r flex_jb">
+              <img :src="item.original_img" class="odr_img" alt />
+              <div class="odr_info flex_c flex_jb">
+                <div class="tit ellipsis1">{{ item.goods_name }}</div>
+                <div class="num">数量 x{{ item.goods_num }}</div>
+                <div class="money flex_r flex_jb">
+                  <span>金额{{ item.total_amount }}</span>
+                </div>
+              </div>
+            </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { get, post } from "@/request/api.js";
+var app = getApp();
+var appEv = app.$vm.$options;
+export default {
+  name: "iApp",
+  components: {},
+  data() {
+    return {
+      list: [],
+      page: 1,
+      rows: 10,
+      selectedId: [],
+      selectedLi: [],
+      height: undefined,
+      trueTotal: 0,
+      money: 0,
+    };
+  },
+  onLoad(option) {
+    let that = this;
+    uni.getSystemInfo({
+      success: function (res) {
+        that.height = res.windowHeight * 2 - 150 + "rpx";
+        that.getList();
+      },
+    });
+  },
+  onLaunch() {},
+  onShow() {},
+  onHide() {},
+  //页面上拉触底事件的处理函数
+  onReachBottom() {
+    if (this.page != -1) {
+      var that = this;
+      setTimeout(function () {
+        that.page++;
+        that.getList();
+      }, 800);
+    }
+  },
+  methods: {
+    getList() {
+      let data = {
+        page: this.page,
+        rows: this.rows,
+      };
+      post("invoice/orderList", data).then((res) => {
+        if (res.code == 0) {
+          this.list = this.list.concat(res.data.data);
+          this.total = res.data.total;
+          if (Math.ceil(this.total / this.rows) <= this.page) {
+            this.page = -1;
+          }
+        }
+      });
+    },
+    checkboxChange(e, item) {
+      this.trueTotal = 0;
+      this.money = 0;
+      if (item.isclick == true) {
+        this.$set(item, "isclick", false);
+      } else {
+        this.$set(item, "isclick", true);
+      }
+      for (let i of this.list) {
+        if (i.isclick) {
+          this.trueTotal++;
+          this.money = this.money + i.total_amount * 1;
+        }
+      }
+    },
+    toEditinvoice() {
+      if (this.trueTotal == 0) {
+        appEv.errTips("请先选择订单");
+        return;
+      }
+      let list = []
+      ;
+      for (let i of this.list) {
+        if (i.isclick == true) {
+          list.push(i.order_sn);
+        }
+      }
+      console.log(list,"qqqq");
+      uni.navigateTo({
+        url: "/pagesB/invoice/editinvoice?icheckList="+ list.toString() + '&money=' + this.money,
+      });
+      // this.goto("/pagesB/invoice/editinvoice",{checkList : list.toString(),money:this.money});
+    },
+  },
+  computed: {},
+  watch: {},
+};
+</script>
+<style scoped lang='scss'>
+.iApp {
+  width: 100%;
+  height: 100%;
+  .log_list {
+    padding: 32rpx 32rpx;
+    overflow: scroll;
+    .log_title {
+      line-height: 40rpx;
+      margin-bottom: 20rpx;
+
+      .tit {
+        font-size: 36rpx;
+        font-weight: bold;
+
+        .log_num {
+          font-size: 28rpx;
+          margin-left: 10rpx;
+        }
+
+        .active {
+          border-bottom: 4rpx solid #3a88ff;
+        }
+      }
+
+      .mor {
+        font-size: 24rpx;
+        color: rgba($color: #000, $alpha: 0.5);
+
+        .icofont {
+          font-size: 22rpx;
+        }
+      }
+    }
+
+    .list_box {
+      margin-top: 20rpx;
+      .list_item {
+        background: #fff;
+        padding: 32rpx;
+        border-radius: 16rpx;
+        margin-bottom: 20rpx;
+        border: 1px solid #ddd;
+        .list_item_l {
+          width: 68rpx;
+          // text-align: center;
+          .iconfont {
+            font-size: 36rpx;
+          }
+        }
+        .list_item_r {
+          width: calc(100% - 68rpx);
+        }
+
+        &:last-child {
+          margin-bottom: 0;
+        }
+      }
+
+      .p1 {
+        font-size: 25rpx;
+        margin-bottom: 20rpx;
+      }
+
+      .p2 {
+        .odr_img {
+          object-fit: cover;
+          width: 120rpx;
+          height: 112rpx;
+        }
+
+        .odr_info {
+          width: calc(100% - 120rpx - 20rpx);
+          font-size: 24rpx;
+          color: rgba($color: #000, $alpha: 0.5);
+
+          .tit {
+            color: rgba($color: #000, $alpha: 0.9);
+          }
+        }
+      }
+    }
+  }
+
+  .bottom {
+    flex: 0 0 100rpx;
+    // background-color: red;
+    border-top: 1px solid #ddd;
+    height: 100rpx;
+    width: 100%;
+    z-index: 999;
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+    align-items: center;
+    padding: 0 32rpx;
+    .left {
+      display: flex;
+      flex-direction: row;
+      .green {
+        color: #2db389;
+        margin: 0 6rpx;
+      }
+    }
+    .right {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      .button {
+        padding: 10rpx 20rpx;
+        background-color: #2db389;
+        border-radius: 10rpx;
+        span {
+          color: #fff;
+        }
+      }
+    }
+  }
+}
+</style>