Card.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <template>
  2. <view class="card-view">
  3. <view class="classHead">
  4. <view class="classBorder">
  5. </view>
  6. <view class="classTitle">
  7. {{titles}}
  8. </view>
  9. </view>
  10. <view class="classBody" @tap="routerTo(titles)">
  11. <view style="display: flex;align-items: center;">
  12. <view style="display: flex;align-items: center;" v-if="titles=='附近门店' || titles=='服务门店'">
  13. <image v-if="data.logoUrl" class="classImg" :src="baseImagePath + data.logoUrl"></image>
  14. <image v-else class="classImg" :src="require('../static/moren-mendian.png')"></image>
  15. </view>
  16. <view style="display: flex;align-items: center;" v-else>
  17. <image v-if="data.brandLogo" class="classImg" :src="baseImagePath+data.brandLogo"></image>
  18. <image v-else class="classImg" :src="require('../static/morentu.png')"></image>
  19. </view>
  20. <view style="padding: 0 0 0 30rpx;display: flex;flex-direction: column;"
  21. v-if="titles=='附近门店' || titles=='服务门店'">
  22. <view v-if="data.name">
  23. <view class="classBodyHead">
  24. {{data.name}}
  25. </view>
  26. <view v-if="titles=='服务门店'" class="classBodyContent"
  27. style="display: flex;align-items: baseline;">
  28. <image class="location" :src="require('../static/address.png')"></image>
  29. <view class="locationNum">
  30. 据您{{data.distance}}km
  31. </view>
  32. </view>
  33. <view v-else-if="titles=='附近门店'" class="classBodyContent">
  34. {{data.contacts}}
  35. </view>
  36. </view>
  37. <view v-else style="height: 100%;display: flex;align-items: center;">
  38. <view class="chooseView">
  39. 请选择门店
  40. </view>
  41. </view>
  42. </view>
  43. <view style="padding: 0 0 0 30rpx;" v-else>
  44. <view v-if="data.carNumber!=null">
  45. <view class="carBodyHead classBodyHead">
  46. <view style="display: flex;justify-content: left;">
  47. <image class="carImg" :src="require('../static/car.png')"></image>
  48. <span>{{data.carNumber}}</span>
  49. </view>
  50. <view class="vehicleBorder"></view><span>{{data.carMadelLevel}}</span>
  51. </view>
  52. <view class="classBodyContent">
  53. {{data.carModelName}}
  54. </view>
  55. </view>
  56. <view v-else style="height: 100%;display: flex;align-items: center;">
  57. <view class="chooseView">
  58. 请选择车辆
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="viewRight">
  64. <image class="classChoose" :src="require('../static/choose.png')">
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. export default {
  71. components: {},
  72. data() {
  73. return {
  74. categoryCurrent: 0, //分类轮播下标
  75. baseImagePath: this.baseImagePath
  76. };
  77. },
  78. props: {
  79. data: {
  80. type: Object,
  81. default: function() {
  82. return {};
  83. }
  84. },
  85. titles: {
  86. type: String,
  87. default: ""
  88. },
  89. page: {
  90. type: String,
  91. default: ''
  92. }
  93. },
  94. methods: {
  95. // 路由跳转
  96. routerTo(item) {
  97. console.log(item);
  98. console.log('page', this.page);
  99. if (item == "附近门店" || item == "服务门店") {
  100. this.$yrouter.push({
  101. path: "/pages/preCarWash/chooseShop/index?type=" + this.page
  102. });
  103. } else if (item == "车辆信息" || item == "预约车辆" || item == "使用车辆") {
  104. this.$yrouter.push({
  105. path: "/pages/preCarWash/chooseCar/index?id=" + this.data.id
  106. });
  107. }
  108. }
  109. }
  110. }
  111. </script>
  112. <style>
  113. .location {
  114. width: 23rpx;
  115. height: 23rpx;
  116. padding-right: 10rpx;
  117. }
  118. .locationNum {
  119. font-size: 24rpx;
  120. font-family: PingFang SC;
  121. font-weight: 500;
  122. color: #333333;
  123. line-height: 31rpx;
  124. }
  125. .card-view {
  126. width: 94%;
  127. height: 239rpx;
  128. margin-left: 3%;
  129. background: #FFFFFF;
  130. border-radius: 10rpx;
  131. margin-top: 28rpx;
  132. }
  133. .classHead {
  134. display: flex;
  135. padding-top: 28rpx;
  136. width: 100%;
  137. height: 28rpx;
  138. }
  139. .classBorder {
  140. width: 5rpx;
  141. height: 28rpx;
  142. background: linear-gradient(0deg, #005AFF 0%, #0078FF 100%);
  143. border-radius: 3rpx;
  144. }
  145. .classTitle {
  146. height: 25rpx;
  147. font-size: 26rpx;
  148. font-family: PingFang SC;
  149. font-weight: 500;
  150. color: #666666;
  151. padding-left: 28rpx;
  152. line-height: 28rpx;
  153. }
  154. .classBody {
  155. display: flex;
  156. justify-content: space-between;
  157. padding: 28rpx;
  158. padding-top: 0rpx;
  159. align-items: center;
  160. margin-top: 36rpx;
  161. }
  162. .classImg {
  163. width: 120rpx;
  164. height: 120rpx;
  165. /* background: linear-gradient(135deg, #D10498 0%, #D21728 100%); */
  166. border-radius: 8rpx;
  167. }
  168. .classBodyHead {
  169. height: 31rpx;
  170. font-size: 32rpx;
  171. font-family: PingFang SC;
  172. font-weight: bold;
  173. color: #333333;
  174. line-height: 31rpx;
  175. }
  176. .classBodyContent {
  177. width: 370rpx;
  178. height: 23rpx;
  179. font-size: 24rpx;
  180. font-family: PingFang SC;
  181. font-weight: 500;
  182. color: #666666;
  183. line-height: 31rpx;
  184. padding-top: 22rpx;
  185. }
  186. .viewRight {
  187. height: 100%;
  188. /* line-height: 183rpx;
  189. margin-top: -28rpx;
  190. margin-left: 100rpx; */
  191. }
  192. .classChoose {
  193. width: 15rpx;
  194. height: 23rpx;
  195. }
  196. .carBodyHead {
  197. display: flex;
  198. justify-content: left;
  199. align-items: center;
  200. }
  201. .vehicleBorder {
  202. width: 1rpx;
  203. height: 20rpx;
  204. background: #DBDBDB;
  205. margin-left: 15rpx;
  206. margin-right: 18rpx;
  207. }
  208. .carImg {
  209. width: 33rpx;
  210. height: 27rpx;
  211. margin-right: 13rpx;
  212. }
  213. .chooseView {
  214. font-size: 32rpx;
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. color: #666666;
  218. line-height: 42rpx;
  219. }
  220. </style>