index.vue 6.5 KB

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