property.vue 6.8 KB

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