me_order.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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: '/pages/common_tools/me_order/order_details?data=' + JSON.stringify(item)
  55. // // url: '/pages/customer/customer-datails?n=' + n
  56. // })
  57. },
  58. getInsurance: async function() {
  59. let res = await this.$request.post("/api/v1/order/orderList", {
  60. page: this.pageindex,
  61. list_type: 1,
  62. product_type: 6,
  63. })
  64. console.log(res)
  65. if (res.status == 0) {
  66. if (this.pageindex > res.data.last_page) {
  67. uni.showToast({
  68. title: "没有更多了",
  69. icon: "none"
  70. })
  71. } else {
  72. this.serviceList = this.serviceList.concat(res.data.data)
  73. this.pageindex++
  74. }
  75. }
  76. if (this.serviceList.length == 0) {
  77. this.show = true
  78. } else {
  79. this.show = false
  80. }
  81. }
  82. }
  83. }
  84. </script>
  85. <style>
  86. .list {
  87. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  88. border-radius: 12px;
  89. background: #FFFFFF;
  90. margin-bottom: 20rpx;
  91. display: flex;
  92. justify-content: center;
  93. align-items: center;
  94. padding: 48rpx 28rpx;
  95. }
  96. .left {
  97. width: 95%;
  98. display: initial;
  99. }
  100. .ringht {
  101. width: 5%;
  102. }
  103. </style>