me_order.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template style="background: #F6F6F6;">
  2. <view style="height: 100%;width: 100%;padding: 20rpx 28rpx;">
  3. <view class="" v-for="(itm,idx) in serviceList" :key="idx">
  4. <view class="list" @click="list(itm)">
  5. <!-- 左边 -->
  6. <view class="left">
  7. <view style="font-size: 30rpx;font-weight: bold;margin-bottom: 20rpx;">{{itm.order_pack.insurance_policy}}</view>
  8. <view style="font-size: 26rpx;color: #999999;">{{itm.order_pack.pack_name}}</view>
  9. </view>
  10. <!-- 右边 -->
  11. <view class="ringht">
  12. <u-icon name="arrow-right" color="#C0C0C0"></u-icon>
  13. </view>
  14. </view>
  15. </view>
  16. <u-empty text="暂无数据" :show="show" mode="order" margin-top="250"></u-empty>
  17. <view class="cu-tabbar-height"></view>
  18. <view class="cu-tabbar-height"></view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. mounted() {
  24. this.getInsurance()
  25. },
  26. data() {
  27. return {
  28. pageindex: 1,
  29. serviceList: [],
  30. show: false
  31. }
  32. },
  33. methods: {
  34. //关注
  35. list(item) {
  36. uni.showLoading({
  37. title: "加载中,请等待"
  38. })
  39. uni.downloadFile({
  40. url: item.order_pack.insurance_img_url,
  41. success(res) {
  42. console.log(res)
  43. let data = res.tempFilePath;
  44. uni.openDocument({
  45. filePath: data,
  46. fileType: 'pdf',
  47. success: (res) => {
  48. uni.hideLoading()
  49. }
  50. })
  51. }
  52. })
  53. // uni.navigateTo({
  54. // url: "order_details?pdfurl=" + item.order_pack.insurance_img_url
  55. // })
  56. // uni.navigateTo({
  57. // url: '/pages/common_tools/me_order/order_details?data=' + JSON.stringify(item)
  58. // // url: '/pages/customer/customer-datails?n=' + n
  59. // })
  60. },
  61. getInsurance: async function() {
  62. let res = await this.$request.post("/api/v1/order/orderList", {
  63. page: this.pageindex,
  64. list_type: 1,
  65. product_type: 6,
  66. })
  67. console.log(res)
  68. if (res.status == 0) {
  69. if (this.pageindex > res.data.last_page) {
  70. uni.showToast({
  71. title: "没有更多了",
  72. icon: "none"
  73. })
  74. } else {
  75. this.serviceList = this.serviceList.concat(res.data.data)
  76. this.pageindex++
  77. }
  78. }
  79. if (this.serviceList.length == 0) {
  80. this.show = true
  81. } else {
  82. this.show = false
  83. }
  84. }
  85. }
  86. }
  87. </script>
  88. <style>
  89. .list {
  90. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  91. border-radius: 12px;
  92. background: #FFFFFF;
  93. margin-bottom: 20rpx;
  94. display: flex;
  95. justify-content: center;
  96. align-items: center;
  97. padding: 48rpx 28rpx;
  98. }
  99. .left {
  100. width: 95%;
  101. display: initial;
  102. }
  103. .ringht {
  104. width: 5%;
  105. }
  106. </style>