property.vue 6.7 KB

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