property.vue 6.8 KB

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