Card.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view class="card">
  3. <view class="card-list" v-if="list">
  4. <view v-for='(item,index) in list' class="item flex">
  5. <view class="card-list-item"
  6. :style="'background:url('+item.currentBackground+');background-size:100% 100%;width:100%'">
  7. <view class="card-content style1" v-if="item.cuttentTemplate==1">
  8. <view class="left">
  9. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  10. shape="circle"></u--image>
  11. </view>
  12. <view class="right">
  13. <view class="row1">
  14. <text class="name">{{item.name}}</text>
  15. <text class="post">{{item.post}}</text>
  16. </view>
  17. <view class="row2">
  18. {{item.companyName}}
  19. </view>
  20. <view class="row3 flex">
  21. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  22. color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  23. </view>
  24. <view class="row4 flex">
  25. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  26. color="#5e6d82"></uni-icons>{{ item.phone }}
  27. </view>
  28. <!-- <view class="">
  29. 备注
  30. </view> -->
  31. </view>
  32. </view>
  33. <view class="card-content style1 flex-between" v-if="item.cuttentTemplate==2">
  34. <view class="right">
  35. <view class="row1">
  36. <text class="name">{{item.name}}</text>
  37. <text class="post">{{item.post}}</text>
  38. </view>
  39. <view class="row2">
  40. {{item.companyName}}
  41. </view>
  42. <view class="row3 flex">
  43. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  44. color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  45. </view>
  46. <view class="row4 flex">
  47. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  48. color="#5e6d82"></uni-icons>{{ item.phone }}
  49. </view>
  50. <!-- <view class="">
  51. 备注
  52. </view> -->
  53. </view>
  54. <view class="left">
  55. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  56. shape="circle" v-if="item.headSculpture"></u--image>
  57. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px" height="66px"
  58. shape="circle" v-else></u--image>
  59. </view>
  60. </view>
  61. <view class="card-content style2" v-if="item.cuttentTemplate==3">
  62. <view class="top">
  63. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  64. shape="circle" v-if="item.headSculpture"></u--image>
  65. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px" height="66px"
  66. shape="circle" v-else></u--image>
  67. </view>
  68. <view class="bottom flex">
  69. <view class="left">
  70. <view class="row1">
  71. <text class="name">{{item.name}}</text>
  72. <text class="post">{{item.post}}</text>
  73. </view>
  74. <view class="row2">
  75. {{item.companyName}}
  76. </view>
  77. </view>
  78. <view class="right">
  79. <view class="row1 flex">
  80. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  81. color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  82. </view>
  83. <view class="row2 flex">
  84. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  85. color="#5e6d82"></uni-icons>{{ item.phone }}
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="card-content style2" v-if="item.cuttentTemplate==4">
  91. <view class="top">
  92. <view class="row1">
  93. <text class="name">{{item.name}}</text>
  94. <text class="post">{{item.post}}</text>
  95. </view>
  96. <view class="row2">
  97. {{item.companyName}}
  98. </view>
  99. </view>
  100. <view class="bottom flex">
  101. <view class="left">
  102. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  103. shape="circle" v-if="item.headSculpture"></u--image>
  104. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px" height="66px"
  105. shape="circle" v-else></u--image>
  106. </view>
  107. <view class="right">
  108. <view class="row1 flex">
  109. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  110. color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  111. </view>
  112. <view class="row2 flex">
  113. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  114. color="#5e6d82"></uni-icons>{{ item.phone }}
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="car-bottom flex">
  120. <view class="left" :style='styleList[0]'>
  121. </view>
  122. <view class="right" :style='styleList[1]'>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="card-obj" v-if="obj">
  129. <view class="card-list-item" :style="obj.currentBackground?'background:url('+obj.currentBackground+');background-size:100% 100%':''">
  130. <view class="card-content style1" v-if="obj.cuttentTemplate==1">
  131. <view class="left">
  132. <u--image :showLoading="true" :src="obj.headSculpture" width="66px" height="66px"
  133. shape="circle"></u--image>
  134. </view>
  135. <view class="right">
  136. <view class="row1">
  137. <text class="name">{{obj.name}}</text>
  138. <text class="post">{{obj.post}}</text>
  139. </view>
  140. <view class="row2">
  141. {{obj.companyName}}
  142. </view>
  143. <view class="row3 flex">
  144. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  145. color="#5e6d82"></uni-icons>{{ obj.province }}{{ obj.city }}{{ obj.area }}
  146. </view>
  147. <view class="row4 flex">
  148. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  149. color="#5e6d82"></uni-icons>{{ obj.phone }}
  150. </view>
  151. </view>
  152. </view>
  153. <view class="card-content style1 flex-between" v-if="obj.cuttentTemplate==2">
  154. <view class="right">
  155. <view class="row1">
  156. <text class="name">{{obj.name}}</text>
  157. <text class="post">{{obj.post}}</text>
  158. </view>
  159. <view class="row2">
  160. {{obj.companyName}}
  161. </view>
  162. <view class="row3 flex">
  163. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  164. color="#5e6d82"></uni-icons>{{ obj.province }}{{ obj.city }}{{ obj.area }}
  165. </view>
  166. <view class="row4 flex">
  167. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  168. color="#5e6d82"></uni-icons>{{ obj.phone }}
  169. </view>
  170. </view>
  171. <view class="left">
  172. <u--image :showLoading="true" :src="obj.headSculpture" width="66px" height="66px" shape="circle"
  173. v-if="obj.headSculpture"></u--image>
  174. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px" height="66px" shape="circle"
  175. v-else></u--image>
  176. </view>
  177. </view>
  178. <view class="card-content style2" v-if="obj.cuttentTemplate==3">
  179. <view class="top">
  180. <u--image :showLoading="true" :src="obj.headSculpture" width="66px" height="66px" shape="circle"
  181. v-if="obj.headSculpture"></u--image>
  182. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px" height="66px" shape="circle"
  183. v-else></u--image>
  184. </view>
  185. <view class="bottom flex">
  186. <view class="left">
  187. <view class="row1">
  188. <text class="name">{{obj.name}}</text>
  189. <text class="post">{{obj.post}}</text>
  190. </view>
  191. <view class="row2">
  192. {{obj.companyName}}
  193. </view>
  194. </view>
  195. <view class="right">
  196. <view class="row1 flex">
  197. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  198. color="#5e6d82"></uni-icons>{{ obj.province }}{{ obj.city }}{{ obj.area }}
  199. </view>
  200. <view class="row2 flex">
  201. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  202. color="#5e6d82"></uni-icons>{{ obj.phone }}
  203. </view>
  204. </view>
  205. </view>
  206. </view>
  207. <view class="card-content style2" v-if="obj.cuttentTemplate==4">
  208. <view class="top">
  209. <view class="row1">
  210. <text class="name">{{obj.name}}</text>
  211. <text class="post">{{obj.post}}</text>
  212. </view>
  213. <view class="row2">
  214. {{obj.companyName}}
  215. </view>
  216. </view>
  217. <view class="bottom flex">
  218. <view class="left">
  219. <u--image :showLoading="true" :src="obj.headSculpture" width="66px" height="66px"
  220. shape="circle" v-if="obj.headSculpture"></u--image>
  221. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  222. height="66px" shape="circle" v-else></u--image>
  223. </view>
  224. <view class="right">
  225. <view class="row1 flex">
  226. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;"
  227. color="#5e6d82"></uni-icons>{{ obj.province }}{{ obj.city }}{{ obj.area }}
  228. </view>
  229. <view class="row2 flex">
  230. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;"
  231. color="#5e6d82"></uni-icons>{{ obj.phone }}
  232. </view>
  233. </view>
  234. </view>
  235. </view>
  236. <view class="car-bottom flex">
  237. <view class="left" :style='styleList[0]'>
  238. </view>
  239. <view class="right" :style='styleList[1]'>
  240. </view>
  241. </view>
  242. </view>
  243. </view>
  244. </view>
  245. </template>
  246. <script>
  247. export default {
  248. name: "Card",
  249. props: {
  250. obj: {
  251. type: Object,
  252. required: true
  253. },
  254. list: {
  255. type: Array,
  256. required: true
  257. },
  258. styleList: {
  259. type: Array,
  260. required: true
  261. },
  262. page: {
  263. type: String,
  264. required: true
  265. }
  266. },
  267. data() {
  268. return {
  269. };
  270. },
  271. watch: {
  272. list(newVal, oldVal) {
  273. }
  274. },
  275. mounted() {},
  276. methods: {}
  277. }
  278. </script>
  279. <style lang="scss" scoped>
  280. .style1 {
  281. display: flex;
  282. padding: 20rpx 30rpx;
  283. width: 85%;
  284. margin-bottom: 90rpx;
  285. .left {
  286. width: 132rpx;
  287. height: 132rpx;
  288. border-radius: 50%;
  289. }
  290. .right {
  291. margin-left: 40rpx;
  292. .row1 {
  293. .name {
  294. font-size: 38rpx;
  295. font-weight: bold;
  296. color: #040000;
  297. margin-right: 20rpx;
  298. }
  299. .post {
  300. font-size: 26rpx;
  301. font-weight: 500;
  302. color: #666666;
  303. }
  304. }
  305. .row2 {
  306. margin-top: 20rpx;
  307. font-size: 24rpx;
  308. font-weight: bold;
  309. color: #323333;
  310. }
  311. .row3 {
  312. margin-top: 30rpx;
  313. font-size: 24rpx;
  314. font-weight: 500;
  315. color: #323333;
  316. }
  317. }
  318. }
  319. .style2 {
  320. padding: 50rpx 30rpx;
  321. margin-bottom: 100rpx;
  322. .top {
  323. .row1 {
  324. .name {
  325. font-size: 38rpx;
  326. font-weight: bold;
  327. color: #040000;
  328. margin-right: 20rpx;
  329. }
  330. .post {
  331. font-size: 26rpx;
  332. font-weight: 500;
  333. color: #666666;
  334. }
  335. }
  336. .row2 {
  337. margin-top: 20rpx;
  338. font-size: 24rpx;
  339. font-weight: bold;
  340. color: #323333;
  341. }
  342. }
  343. .bottom {
  344. margin-top: 48rpx;
  345. .left {
  346. margin-right: 40rpx;
  347. .row1 {
  348. .name {
  349. font-size: 38rpx;
  350. font-weight: bold;
  351. color: #040000;
  352. margin-right: 20rpx;
  353. }
  354. .post {
  355. font-size: 26rpx;
  356. font-weight: 500;
  357. color: #666666;
  358. }
  359. }
  360. .row2 {
  361. margin-top: 20rpx;
  362. font-size: 24rpx;
  363. font-weight: bold;
  364. color: #323333;
  365. }
  366. }
  367. .right {
  368. .row1,
  369. .row2 {
  370. font-size: 24rpx;
  371. font-weight: 500;
  372. color: #323333;
  373. }
  374. .row2 {
  375. margin-top: 20rpx;
  376. }
  377. }
  378. }
  379. }
  380. .card-list-item {
  381. position: relative;
  382. border-radius: 30rpx;
  383. padding: 40rpx 40rpx 0 40rpx;
  384. box-sizing: border-box;
  385. .car-bottom {
  386. position: relative;
  387. bottom: 60rpx;
  388. left: -20rpx;
  389. }
  390. .left {
  391. width: 30%;
  392. .top {
  393. margin-bottom: 20rpx;
  394. }
  395. .img {
  396. width: 80%;
  397. }
  398. .bottom {}
  399. }
  400. .right {
  401. .row1 {
  402. .line {
  403. width: 1px;
  404. height: 20px;
  405. margin: 0 20rpx;
  406. background: black;
  407. }
  408. }
  409. }
  410. }
  411. </style>