index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view style="width: 100%; height: 100vh; background: rgb(247, 248, 255)">
  3. <zj-page-container>
  4. <view class="toubuyangs">
  5. <view class="toubuyangsTab">
  6. <view class="toubuyangsTabItem" @click="tabQiehuan('AC')">
  7. <view>意外险</view>
  8. <view :class="{ hengxian: true, xuanzhong: tab == 'AC' }"> </view>
  9. </view>
  10. <view class="toubuyangsTabItem" @click="tabQiehuan('DS')">
  11. <view>第三者责任险</view>
  12. <view :class="{ hengxian: true, xuanzhong: tab == 'DS' }"></view>
  13. </view>
  14. </view>
  15. </view>
  16. <zj-page-fill>
  17. <zj-page-layout
  18. :isScroll="true"
  19. :refresherTriggered="refresherTriggered"
  20. @refresherrefresh="refresherrefresh"
  21. :hasFooter="true"
  22. >
  23. <view class="myInsurance">
  24. <view class="myInsuranceCart" v-for="(item, index) in list" :key="index" @click="gopage(item)">
  25. <view class="myInsuranceCartbuju xiangxia">
  26. <view class="">
  27. {{ item.policyName }}
  28. </view>
  29. <view class="" style="color: red">
  30. {{ { BZZ: '保障中', YSX: '失效', DSX: '待生效' }[item.policyOrderStatus] }}
  31. </view>
  32. </view>
  33. <view class="">
  34. <view class="xiangxia"> 所属网点:{{ item.websitName }} </view>
  35. <view class="xiangxia">
  36. 保单类型:{{ { AC: '意外险', EM: '雇主险', IN: '工伤险', DS: '第三者责任险' }[item.type] }}
  37. </view>
  38. <view class="xiangxia"> 保单编号:{{ item.policyNumber }} </view>
  39. <view class="xiangxia"> 保单金额:{{ item.payAmount }} </view>
  40. <view class="xiangxia" v-if="item.startTime && item.endTime">
  41. 有效时间:{{ item.startTime ? item.startTime.split(' ')[0] : '' }}~{{
  42. item.endTime ? item.endTime.split(' ')[0] : ''
  43. }}
  44. </view>
  45. <view class="xiangxia" v-else> 有效时间: </view>
  46. </view>
  47. </view>
  48. </view>
  49. <Loading :loadStatus="loadStatus" :dataList="list" />
  50. <zjDialogPicker
  51. ref="websitDialog"
  52. :isShow="isShowWebsitDialog"
  53. :multiple="false"
  54. :styleType="2"
  55. :title="'选择对应网点购买保险'"
  56. :list="baoxiandangqianxianxitishi"
  57. :keyName="'name'"
  58. @cancel="isShowWebsitDialog = false"
  59. @confirm="confirmWebsitDialog"
  60. >
  61. </zjDialogPicker>
  62. <template slot="footer" v-if="!!baoxiandangqianxianxitishi.length">
  63. <view class="bottom-container" style="box-sizing: border-box; padding: 20rpx">
  64. <u-button text="去购买" shape="circle" type="primary" @click="qugoumai"> </u-button>
  65. </view>
  66. </template>
  67. </zj-page-layout>
  68. </zj-page-fill>
  69. </zj-page-container>
  70. </view>
  71. </template>
  72. <script>
  73. import zjDialogPicker from '@/components/zj-dialog/zj-dialog-picker.vue'
  74. import zjPageContainer from '@/components/zj-page-container/zj-page-container.vue'
  75. import zjPageFill from '@/components/zj-page-container/zj-page-fill.vue'
  76. export default {
  77. components: {
  78. zjDialogPicker,
  79. zjPageContainer,
  80. zjPageFill
  81. },
  82. data() {
  83. return {
  84. loadStatus: 0,
  85. list: [],
  86. websitId: '',
  87. baoxiandangqianxianxitishi: [],
  88. isShowWebsitDialog: false,
  89. refresherTriggered: false,
  90. tab: 'AC'
  91. }
  92. },
  93. onShow() {
  94. uni.showLoading({
  95. title: '加载中'
  96. })
  97. this.loadStatus = 1
  98. this.$api.post('/worker/myPolicy', { pageNum: 1, pageSize: -1, type: this.tab }).then(res => {
  99. this.$nextTick(() => {
  100. uni.hideLoading()
  101. })
  102. this.loadStatus = 2
  103. this.list = res?.data?.records || []
  104. })
  105. },
  106. methods: {
  107. qugoumai() {
  108. this.baoxiandangqianxianxitishi = []
  109. if (this.tab == 'DS') {
  110. this.$api.post('/worker/myDsWebsit').then(res => {
  111. this.baoxiandangqianxianxitishi = res.data
  112. this.isShowWebsitDialog = true
  113. })
  114. } else {
  115. this.$api.post('/worker/myWebsit').then(res => {
  116. this.baoxiandangqianxianxitishi = res.data
  117. this.isShowWebsitDialog = true
  118. })
  119. }
  120. },
  121. tabQiehuan(index) {
  122. this.tab = index
  123. this.loadStatus = 1
  124. this.$api.post('/worker/myPolicy', { pageNum: 1, pageSize: -1, type: this.tab }).then(res => {
  125. this.loadStatus = 2
  126. this.list = res?.data?.records || []
  127. })
  128. },
  129. // 触发下拉刷新
  130. refresherrefresh(e) {
  131. this.refresherTriggered = true
  132. this.loadStatus = 1
  133. this.$api.post('/worker/myPolicy', { pageNum: 1, pageSize: -1, type: this.tab }).then(res => {
  134. this.$nextTick(() => {
  135. this.refresherTriggered = false
  136. })
  137. this.loadStatus = 2
  138. this.list = res?.data?.records || []
  139. })
  140. },
  141. confirmWebsitDialog(e) {
  142. this.isShowWebsitDialog = false
  143. this.$navToPage({
  144. url:
  145. '/packageEnter/pages/insurance/myInsuranceBuy/index?websitId=' +
  146. this?.baoxiandangqianxianxitishi?.[e[0]]?.websitId +
  147. '&xzType=' +
  148. this.tab
  149. })
  150. },
  151. gopage(item) {
  152. this.$navToPage({
  153. url: `/packageEnter/pages/insurance/policyParticulars/index?id=${item.id}`
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .myInsurance {
  161. box-sizing: border-box;
  162. padding: 20rpx;
  163. padding-top: 40rpx;
  164. .myInsuranceCart {
  165. width: 100%;
  166. height: auto;
  167. box-sizing: border-box;
  168. padding: 20rpx;
  169. margin-bottom: 20rpx;
  170. box-shadow: 2.8px 2.8px 2.2px rgba(0, 0, 0, 0.02), 6.7px 6.7px 5.3px rgba(0, 0, 0, 0.028),
  171. 12.5px 12.5px 10px rgba(0, 0, 0, 0.035), 22.3px 22.3px 17.9px rgba(0, 0, 0, 0.042),
  172. 41.8px 41.8px 33.4px rgba(0, 0, 0, 0.05), 100px 100px 80px rgba(0, 0, 0, 0.07);
  173. border-radius: 10rpx;
  174. background: #ffffff;
  175. .myInsuranceCartbuju {
  176. display: flex;
  177. justify-content: space-between;
  178. }
  179. .xiangxia {
  180. margin-bottom: 10rpx;
  181. }
  182. }
  183. }
  184. .toubuyangs {
  185. width: 100%;
  186. height: auto;
  187. box-sizing: border-box;
  188. padding: 30rpx 30rpx 15rpx 30rpx;
  189. .toubuyangsTab {
  190. width: 100%;
  191. height: auto;
  192. padding: 30rpx;
  193. box-sizing: border-box;
  194. background: #fff;
  195. border-radius: 20rpx;
  196. display: flex;
  197. align-items: center;
  198. justify-content: space-around;
  199. .toubuyangsTabItem {
  200. box-sizing: border-box;
  201. font-size: 32rpx;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. flex-direction: column;
  206. .hengxian {
  207. margin-top: 20rpx;
  208. width: 100rpx;
  209. }
  210. .xuanzhong {
  211. border-bottom: 4rpx solid #000;
  212. }
  213. }
  214. }
  215. }
  216. </style>