index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="sort">
  3. <u-swipe-action>
  4. <u-swipe-action-item :options="options1" :key="index" v-for="(itm, index) of item"
  5. @click="handlerClearItem(itm,index)">
  6. <view class="list" @click="handlerRouterSkip(itm, index)">
  7. <view class="list-img">
  8. <image class="img" :src="error || !loaded ? 'https://cdn.uviewui.com/uview/album/10.jpg' : itm.logo"
  9. mode="scaleToFill"></image>
  10. </view>
  11. <view class="list-main">
  12. <view class="item-text">{{ itm.address }}</view>
  13. <view class="item-flex">
  14. <view class="star">
  15. <u-rate :count="itm.score" :size="14" />
  16. <text class="line">|</text>
  17. <text class="points">{{ itm.score }}分</text>
  18. </view>
  19. <view>{{ itm.sale }}单</view>
  20. </view>
  21. <view class="list-item">
  22. <view class="item-l">{{ itm.name }}</view>
  23. <view class="item-r">{{ itm.distance }}KM</view>
  24. </view>
  25. </view>
  26. </view>
  27. </u-swipe-action-item>
  28. </u-swipe-action>
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. cancelFavorite
  34. } from '@/api/client/business.js';
  35. export default {
  36. data() {
  37. return {
  38. show: false,
  39. showDate: false,
  40. value1: Number(new Date()),
  41. count: 2,
  42. value: 10,
  43. options1: [{
  44. text: '删除'
  45. }]
  46. };
  47. },
  48. props: ['item', 'skipType'],
  49. methods: {
  50. click(item) {},
  51. open() {},
  52. close() {
  53. this.show = false;
  54. },
  55. // 点击跳转1
  56. handlerRouterSkip(item) {
  57. // if (this.skipType == 0) {
  58. uni.navigateTo({
  59. url: `/pages/client/clientPackage/storeDetail?id=${item.id}`,
  60. });
  61. // } else if (this.skipType == 1) {
  62. // uni.navigateTo({
  63. // url: `/pages/client/clientPackage/serviceDetail/index?id=${item.id}`,
  64. // });
  65. // }
  66. },
  67. // 点击取消
  68. handlerClearItem(item, index) {
  69. cancelFavorite(item.id).then(res => {
  70. if (res.code == 200) {
  71. uni.showToast({
  72. title: '取消成功',
  73. icon: 'none'
  74. })
  75. this.$emit('uploadIniList', 0)
  76. } else {
  77. uni.showToast({
  78. title: res.msg,
  79. icon: 'none'
  80. })
  81. return
  82. }
  83. })
  84. }
  85. },
  86. };
  87. </script>
  88. <style lang="scss" scoped>
  89. /*商家服务分类的是实现 */
  90. .sort {
  91. min-height: 100vh;
  92. .list {
  93. height: 250rpx;
  94. background-color: #fff;
  95. padding: 20rpx;
  96. margin-bottom: 20rpx;
  97. display: flex;
  98. .list-img {
  99. width: 260rpx;
  100. height: 100%;
  101. background-color: #ec5729;
  102. margin-right: 20rpx;
  103. image {
  104. width: 100%;
  105. height: 100%;
  106. }
  107. }
  108. .list-main {
  109. width: calc(100% - 280rpx);
  110. }
  111. .item-text {
  112. font-weight: bold;
  113. margin: 10rpx 0 10rpx;
  114. color: #333;
  115. }
  116. .item-flex {
  117. display: flex;
  118. justify-content: space-between;
  119. font-size: 28rpx;
  120. margin: 0 20rpx 10rpx 0;
  121. color: #0d0d0d66;
  122. .star {
  123. display: flex;
  124. .line {
  125. margin-left: 16rpx;
  126. margin-top: 5rpx;
  127. font-size: 22rpx;
  128. }
  129. .points {
  130. color: #ff4b04;
  131. font-size: 22rpx;
  132. margin-top: 6rpx;
  133. margin-left: 10rpx;
  134. }
  135. }
  136. }
  137. .list-item {
  138. display: flex;
  139. justify-content: space-between;
  140. margin-top: 40rpx;
  141. .item-l {
  142. color: #cfcfcf;
  143. }
  144. .item-r {
  145. color: #252525;
  146. .Buy {
  147. width: 40px;
  148. height: 32px;
  149. color: #fff;
  150. line-height: 32px;
  151. text-align: center;
  152. display: inline-block;
  153. border-radius: 0 16px 16px 0;
  154. background-color: #ec5729;
  155. padding-bottom: 20rpx;
  156. }
  157. }
  158. }
  159. }
  160. }
  161. .u-page {
  162. padding: 0;
  163. }
  164. .u-demo-block__title {
  165. padding: 10px 0 2px 15px;
  166. }
  167. .swipe-action {
  168. &__content {
  169. padding: 25rpx 0;
  170. &__text {
  171. font-size: 15px;
  172. color: $u-main-color;
  173. padding-left: 30rpx;
  174. }
  175. }
  176. }
  177. </style>