宜轩到家/服务到家第三版,换个颜色
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

389 lines
8.4 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="collect">
  3. <mNavbar title="我的收藏" :leftClick="leftClick"></mNavbar>
  4. <view v-if="collectList.length > 0" class="collect-list">
  5. <view @click="gototechnicianDetail(item.technician)" v-for="item in collectList" :key="item.id" class="collect-item">
  6. <view class="collect-main">
  7. <view class="technician-head b-relative">
  8. <view class="img-box">
  9. <image :src="item.technician.image" mode="aspectFill" class="bg"></image>
  10. <image v-if="item.technician.icon" :src="item.technician.icon" mode="aspectFit" class="hot">
  11. </image>
  12. <view v-if="item.technician.bookable == 'Y'" class="available-for-service">
  13. <image src="@/static/address/lightning-icon.png" mode="aspectFit"></image>
  14. <text class="desc">可服务</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="detail-info">
  19. <view class="technician-base-info">
  20. <view class="name-and-level">
  21. <view class="technician-name">{{ item.technician.title }}</view>
  22. <van-icon name="star" color="#E8615E" size="25rpx" />
  23. <text class="score">{{ item.technician.level }}</text>
  24. </view>
  25. <view @click.stop="calcelCollect(item.technician.id)" class="alert-collect">
  26. <image src="@/static/collect/alert-collect-icon.png"></image>
  27. <text class="alert-add-collect">取消收藏</text>
  28. </view>
  29. </view>
  30. <view class="appointed-time">
  31. <view class="capsule">
  32. <view class="earliest-reducible">最早可约</view>
  33. <view class="today">今天{{ item.technician.useTime}}</view>
  34. </view>
  35. </view>
  36. <view class="technician-desc">
  37. {{ item.technician.notes }}
  38. </view>
  39. </view>
  40. </view>
  41. <view class="public-praise">
  42. <view class="server-num">已服务{{ item.technician.isFw }}+</view>
  43. <view class="evaluate-collect-subscribe">
  44. <view class="evaluate-collect">
  45. <image src="@/static/collect/review-icon.png" mode="aspectFit"></image>
  46. <view class="evaluate-num">{{item.technician.pinNum}}评价</view>
  47. <image src="@/static/collect/alert-collect-icon.png" mode="aspectFit"></image>
  48. <view class="collect-num">{{ item.technician.collectNum }}收藏</view>
  49. </view>
  50. <view @click="gototechnicianDetail(item.technician)" class="subscribe"
  51. :class="{ notAvailable : item.technician.bookable != 'Y' }">立即预约</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <van-empty v-else image="/static/empty/collect.png" image-size="400rpx" description="暂无收藏技师"/>
  57. </view>
  58. </template>
  59. <script>
  60. import mNavbar from '../../components/base/m-navbar.vue'
  61. import {
  62. showConfirmDialog
  63. } from 'vant';
  64. export default {
  65. components: {
  66. mNavbar
  67. },
  68. data() {
  69. return {
  70. queryParams: {
  71. pageNo: 1,
  72. pageSize: 10
  73. },
  74. collectList: [],
  75. }
  76. },
  77. onShow() {
  78. this.getList()
  79. },
  80. methods: {
  81. //list列表滑动到底部自动新增数据列表
  82. onLoad() {
  83. this.queryParams.pageSize += 10
  84. this.getAddressList()
  85. },
  86. //返回个人中心
  87. leftClick() {
  88. uni.switchTab({
  89. url: '/pages/index/center'
  90. })
  91. },
  92. //获取收藏列表
  93. getList() {
  94. this.$api('getCollectList', this.queryParams, res => {
  95. if (res.code == 200) {
  96. this.collectList = res.result.records
  97. }
  98. })
  99. },
  100. //跳转技师详情
  101. gototechnicianDetail(technician) {
  102. uni.navigateTo({
  103. url: '/pages/technician/technicianDetail?id=' + technician.id
  104. })
  105. },
  106. //取消收藏
  107. calcelCollect(tenId) {
  108. showConfirmDialog({
  109. title: '删除收藏',
  110. message: '确认取消此收藏?取消后数据不可恢复',
  111. }).then(() => {
  112. this.$api('calcelCollect', {
  113. tenId
  114. }, res => {
  115. if (res.code == 200) {
  116. uni.showToast({
  117. title: '取消成功',
  118. icon: 'none'
  119. })
  120. this.getList()
  121. }
  122. })
  123. }).catch(() => {});
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .collect {
  130. width: 750rpx;
  131. margin: 0 auto;
  132. background: #F5F5F5;
  133. min-height: 100vh;
  134. box-sizing: border-box;
  135. .collect-list {
  136. padding: 20rpx;
  137. .collect-item {
  138. background: white;
  139. border-radius: 20rpx;
  140. padding: 20rpx;
  141. margin-bottom: 20rpx;
  142. .collect-main {
  143. display: flex;
  144. .technician-head {
  145. width: 150rpx;
  146. height: 150rpx;
  147. border-radius: 10rpx;
  148. border: 1px solid #5EBAA2;
  149. .img-box {
  150. .bg {
  151. width: 150rpx;
  152. height: 150rpx;
  153. border-radius: 10rpx;
  154. overflow: hidden;
  155. &::v-deep div {
  156. background-position: center top !important;
  157. background-size: 100% !important;
  158. }
  159. image {
  160. width: 100%;
  161. }
  162. }
  163. .hot {
  164. position: absolute;
  165. left: -28rpx;
  166. top: -34rpx;
  167. width: 80rpx;
  168. height: 80rpx;
  169. }
  170. .available-for-service {
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. position: absolute;
  175. left: 50%;
  176. bottom: -13rpx;
  177. width: 70%;
  178. height: 40rpx;
  179. border-radius: 10rpx;
  180. transform: translate(-50%);
  181. background: linear-gradient(178deg, #ffe6ed, #ecb978);
  182. color: $uni-color;
  183. .desc {
  184. font-size: 18rpx;
  185. }
  186. image {
  187. width: 23rpx;
  188. height: 23rpx;
  189. vertical-align: middle;
  190. }
  191. }
  192. }
  193. }
  194. .detail-info {
  195. display: flex;
  196. flex-direction: column;
  197. justify-content: space-between;
  198. width: calc(100% - 150rpx);
  199. padding-left: 15rpx;
  200. .technician-base-info {
  201. display: flex;
  202. justify-content: space-between;
  203. height: 45rpx;
  204. .name-and-level {
  205. display: flex;
  206. align-items: center;
  207. .technician-name {
  208. color: #333;
  209. font-size: 28rpx;
  210. font-weight: 500;
  211. margin-right: 10rpx;
  212. }
  213. .score {
  214. color: #E8615E;
  215. margin-left: 5rpx;
  216. font-size: 20rpx;
  217. }
  218. }
  219. .alert-collect {
  220. display: flex;
  221. align-items: center;
  222. color: #6E6E6E;
  223. font-size: 20rpx;
  224. .alert-add-collect {
  225. margin-left: 5rpx;
  226. color: #FC9A37;
  227. }
  228. }
  229. text {
  230. display: block;
  231. }
  232. }
  233. .appointed-time {
  234. width: 48%;
  235. background: #E7FDF7;
  236. height: 40rpx;
  237. border-radius: 22.5rpx;
  238. font-size: 20rpx;
  239. color: #5DB9A3;
  240. background: $uni-color;
  241. color: #fff;
  242. .capsule {
  243. display: flex;
  244. height: 100%;
  245. align-items: center;
  246. .earliest-reducible {
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. width: 50%;
  251. height: 100%;
  252. border-radius: 20rpx;
  253. background: linear-gradient(178deg, #ffe6ed, #ecb978);
  254. color: $uni-color;
  255. }
  256. .today {
  257. width: 50%;
  258. text-align: center;
  259. }
  260. }
  261. }
  262. .technician-desc {
  263. color: #666666;
  264. overflow: hidden;
  265. min-height: 2em;
  266. font-size: 22rpx;
  267. display: -webkit-box;
  268. -webkit-box-orient: vertical;
  269. -webkit-line-clamp: 2;
  270. text-overflow: ellipsis;
  271. }
  272. image {
  273. width: 25rpx;
  274. height: 25rpx;
  275. }
  276. }
  277. }
  278. .public-praise {
  279. display: flex;
  280. align-items: center;
  281. margin-top: 20rpx;
  282. font-size: 26rpx;
  283. .server-num {
  284. width: 170rpx;
  285. font-size: 22rpx;
  286. color: #666666;
  287. white-space: nowrap;
  288. overflow: hidden;
  289. text-overflow: ellipsis;
  290. }
  291. .evaluate-collect-subscribe {
  292. width: calc(100% - 170rpx);
  293. display: flex;
  294. justify-content: space-between;
  295. padding-left: 15rpx;
  296. .evaluate-collect {
  297. display: flex;
  298. align-items: center;
  299. .evaluate-num {
  300. color: #B6B6B6;
  301. margin-right: 20rpx;
  302. }
  303. .collect-num {
  304. color: #B6B6B6;
  305. }
  306. image {
  307. margin-right: 5rpx;
  308. }
  309. }
  310. .subscribe {
  311. display: flex;
  312. align-items: center;
  313. justify-content: center;
  314. height: 60rpx;
  315. width: 180rpx;
  316. border-radius: 40rpx;
  317. background: linear-gradient(178deg, #ffe6ed, #ecb978);
  318. color: $uni-color;
  319. }
  320. .notAvailable {
  321. background: #ccc;
  322. }
  323. }
  324. image {
  325. width: 25rpx;
  326. height: 25rpx;
  327. }
  328. }
  329. }
  330. }
  331. }
  332. </style>