property.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view class="total-page page-env-160 page-box container task-bg">
  3. <Nav :title="title" :genre="4" is_fixed :opacity="scrollTop"></Nav>
  4. <view class="m-t30" :style="{top:`${$tools.topHeight()+10}px`}">
  5. <view class="m-lr30">
  6. <!-- <view class="">
  7. <view class="collapse-title page-box-bg-fff r-30 p-30 m-lr30" @click="show = !show">
  8. <view class="row-justify-sb center">
  9. <view class="row-c">
  10. <image class="wh-60" src="/page_task/static/img/information/house.png" mode=""></image>
  11. <text class="size-28 sys-weight-600 m-l20">房产信息</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="content sys-list-background-color p-lr30" v-if="show">
  16. <House></House>
  17. </view>
  18. </view> -->
  19. <uni-collapse ref="collapse" accordion class="sys-from-background-color">
  20. <uni-collapse-item titleBorder="none" :border="true" :open="true" :rightLength="houseList.length"
  21. v-show="propertyKey.indexOf('house_item')>=0"
  22. class="collapse-item-house page-box-bg-fff p-30 r-30">
  23. <template v-slot:title>
  24. <view class="row-justify-sb center">
  25. <view class="row-c">
  26. <image class="wh-60" src="/page_task/static/img/information/house.png" mode="">
  27. </image>
  28. <text class="size-28 sys-weight-600 m-l20">房产信息</text>
  29. </view>
  30. </view>
  31. </template>
  32. <view class="content">
  33. <House v-model="houseList" :show-keys="propertyKey" @onResize="onResizeInit"></House>
  34. </view>
  35. </uni-collapse-item>
  36. <uni-collapse-item titleBorder="none" :border="true" :rightLength="carList.length"
  37. v-show="propertyKey.indexOf('car_item')>=0" class="collapse-item-car p-30 r-30">
  38. <template v-slot:title class="page-box-bg-fff">
  39. <view class="row-justify-sb center">
  40. <view class="row-c">
  41. <image class="wh-60" src="/page_task/static/img/information/car.png" mode="">
  42. </image>
  43. <text class="size-28 sys-weight-600 m-l20">车辆信息</text>
  44. </view>
  45. </view>
  46. </template>
  47. <view class="content">
  48. <property-car v-model="carList" :show-keys="propertyKey"
  49. @onResize="onResizeInit"></property-car>
  50. </view>
  51. </uni-collapse-item>
  52. <uni-collapse-item titleBorder="none" :border="true" :rightLength="insuranceList.length"
  53. v-show="propertyKey.indexOf('insurance_item')>=0"
  54. class="collapse-item-guarantee page-box-bg-fff p-30 r-30">
  55. <template v-slot:title>
  56. <view class="row-justify-sb center">
  57. <view class="row-c">
  58. <image class="wh-60" src="/page_task/static/img/information/car.png" mode="">
  59. </image>
  60. <text class="size-28 sys-weight-600 m-l20">保单信息</text>
  61. </view>
  62. </view>
  63. </template>
  64. <view class="content">
  65. <property-guarantee v-model="insuranceList" :show-keys="propertyKey"
  66. @onResize="onResizeInit"></property-guarantee>
  67. </view>
  68. </uni-collapse-item>
  69. <uni-collapse-item titleBorder="none" :border="true" v-show="propertyKey.indexOf('firm_item')>=0"
  70. :rightLength="firmList.length" class="collapse-item-company page-box-bg-fff p-30 r-30">
  71. <template v-slot:title>
  72. <view class="row-justify-sb center">
  73. <view class="row-c">
  74. <image class="wh-60" src="/page_task/static/img/information/car.png" mode="">
  75. </image>
  76. <text class="size-28 sys-weight-600 m-l20">企业信息</text>
  77. </view>
  78. </view>
  79. </template>
  80. <view class="content">
  81. <property-company v-model="firmList" :show-keys="propertyKey"
  82. @onResize="onResizeInit"></property-company>
  83. </view>
  84. </uni-collapse-item>
  85. </uni-collapse>
  86. </view>
  87. </view>
  88. <EnButton :text="'保存'" @onSubmit="onSubmit">
  89. </EnButton>
  90. </view>
  91. </template>
  92. <script>
  93. import House from "./components/house.vue"
  94. import PropertyCar from "@/page_task/property/components/car.vue";
  95. import PropertyGuarantee from "@/page_task/property/components/guarantee.vue";
  96. import PropertyCompany from "@/page_task/property/components/company.vue";
  97. import tools from "@/service/tools";
  98. export default {
  99. components: {
  100. PropertyCompany,
  101. PropertyGuarantee,
  102. PropertyCar,
  103. House,
  104. },
  105. data() {
  106. return {
  107. title: '',
  108. fixedHeight: 0,
  109. scrollTop: 0,
  110. propertyKey: [],
  111. propertyData: [],
  112. houseList: [],
  113. insuranceList: [],
  114. firmList: [],
  115. carList: [],
  116. }
  117. },
  118. onPageScroll(res) {
  119. this.scrollTop = res.scrollTop / 120
  120. },
  121. onLoad(options) {
  122. this.title = options.title
  123. let propertyData = uni.getStorageSync('propertyData')
  124. let propertyKey = uni.getStorageSync('propertyKey')
  125. this.propertyData = propertyData
  126. this.propertyKey = propertyKey
  127. this.setPropertyData()
  128. },
  129. methods: {
  130. setPropertyData() {
  131. if (this.propertyData.length > 0) {
  132. this.propertyData.forEach(item => {
  133. if (item.property_type * 1 === 1) {
  134. this.houseList.push(item)
  135. } else if (item.property_type * 1 === 2) {
  136. this.carList.push(item)
  137. } else if (item.property_type * 1 === 3) {
  138. this.insuranceList.push(item)
  139. } else if (item.property_type * 1 === 4) {
  140. this.firmList.push(item)
  141. }
  142. })
  143. }
  144. },
  145. onResizeInit() {
  146. setTimeout(() => {
  147. this.$nextTick(() => {
  148. this.$refs.collapse.resize()
  149. })
  150. }, 200)
  151. },
  152. onSubmit() {
  153. let propertyData = []
  154. for (let i in this.houseList) {
  155. propertyData.push(this.houseList[i])
  156. }
  157. for (let i in this.carList) {
  158. propertyData.push(this.carList[i])
  159. }
  160. for (let i in this.insuranceList) {
  161. propertyData.push(this.insuranceList[i])
  162. }
  163. for (let i in this.firmList) {
  164. propertyData.push(this.firmList[i])
  165. }
  166. uni.$emit('putPropertyInfo', propertyData)
  167. setTimeout(() => {
  168. tools.leftClick()
  169. }, 50)
  170. },
  171. }
  172. }
  173. </script>
  174. <style lang="scss" scoped>
  175. .info_button {
  176. width: 130rpx;
  177. height: 60rpx;
  178. border: none;
  179. line-height: 60rpx;
  180. }
  181. .property_content {
  182. width: 100%;
  183. position: absolute;
  184. }
  185. /deep/ .uni-collapse {
  186. background-color: #EEF1F7 !important;
  187. border-radius: 30rpx;
  188. }
  189. uni-collapse-item {
  190. margin-bottom: 20rpx;
  191. }
  192. button::after {
  193. border: none;
  194. }
  195. .collapse-item-house {
  196. background: linear-gradient(180deg, rgba(255, 92, 0, 0.1) 0%, rgba(255, 255, 255, 1) 60rpx);
  197. }
  198. .collapse-item-car {
  199. background: linear-gradient(180deg, rgba(0, 163, 255, 0.1) 0%, rgba(255, 255, 255, 1) 60rpx);
  200. }
  201. .collapse-item-guarantee {
  202. background: linear-gradient(180deg, rgba(0, 255, 194, 0.1) 0%, rgba(255, 255, 255, 1) 60rpx);
  203. }
  204. .collapse-item-company {
  205. background: linear-gradient(180deg, rgba(255, 0, 0, 0.1) 0%, rgba(255, 255, 255, 1) 60rpx);
  206. }
  207. </style>