goodsReserve.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="container">
  3. <view class="appoint" :key="index" v-for="(item, index) of init_list">
  4. <view class="appoint-list">
  5. <view class="appoint-title">{{ item.simpleMerchantVO.name }}</view>
  6. <view class="appoint-address"></view>
  7. <view class="appoint-flex">
  8. <image class="img" :src=" item.simpleMerchantVO.logo" mode="scaleToFill"></image>
  9. <view class="appoint-text">
  10. <view>{{ item.goodsName }}</view>
  11. <view>时间:{{ $u.timeFormat(item.appointTime) }}</view>
  12. <view>联系方式:{{ item.mobile }}</view>
  13. </view>
  14. </view>
  15. <view class="appoint-goto">
  16. <u-button class="detail" text="详情" @click="handlerSkipGoodsDetail(item, index)"></u-button>
  17. <u-button class="cancel" text="取消" @click="handlerClearItem(item, index)"></u-button>
  18. </view>
  19. </view>
  20. </view>
  21. <u-empty v-if="init_list.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
  22. </u-empty>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. maintainReservations
  28. } from '@/api/client/mine.js';
  29. import {
  30. cancelReservation
  31. } from '@/api/client/business.js';
  32. export default {
  33. data() {
  34. return {
  35. queryParams: {
  36. size: 10,
  37. },
  38. init_list: [], //初始化列表
  39. };
  40. },
  41. mounted() {
  42. this.handlerInitList();
  43. },
  44. methods: {
  45. // 初始化列表
  46. handlerInitList() {
  47. maintainReservations(this.queryParams).then(res => {
  48. this.init_list = res.data;
  49. });
  50. },
  51. // 点击取消商品
  52. handlerClearItem(item) {
  53. cancelReservation(item.id).then(res => {
  54. if (res.code === 'OK') {
  55. uni.showToast({
  56. title: '取消成功',
  57. icon: 'none',
  58. });
  59. this.handlerInitList();
  60. } else {
  61. uni.showToast({
  62. title: res.msg,
  63. icon: 'none',
  64. });
  65. return;
  66. }
  67. });
  68. },
  69. // 点击跳转到商品详情
  70. handlerSkipGoodsDetail(item, index) {
  71. uni.navigateTo({
  72. // url: `/pages/client/clientPackage/serviceDetail/index?id=${item.merchantId}`,
  73. url: `/pagesHome/marketer/productDetail?id=${item.goodsId}&shopId=${item.merchantId}`,
  74. });
  75. },
  76. },
  77. };
  78. </script>
  79. <style lang="scss" scoped>
  80. page {
  81. background-color: #efefef;
  82. }
  83. .container {
  84. padding: 20rpx;
  85. }
  86. .appoint {
  87. .history {
  88. font-size: 38rpx;
  89. margin: 20rpx 10rpx;
  90. font-weight: bold;
  91. }
  92. }
  93. .appoint-list {
  94. padding: 20rpx;
  95. background-color: #fff;
  96. margin-bottom: 20rpx;
  97. box-sizing: border-box;
  98. border-radius: 20rpx;
  99. .appoint-title {
  100. font-size: 38rpx;
  101. font-weight: bold;
  102. margin-bottom: 10rpx;
  103. color: #090909;
  104. }
  105. .appoint-address {
  106. font-size: 32rpx;
  107. margin: 20rpx;
  108. padding-bottom: 20rpx;
  109. color: #000000;
  110. border-bottom: 2rpx solid #e5e5e5;
  111. }
  112. .appoint-flex {
  113. display: flex;
  114. .img {
  115. width: 210rpx;
  116. height: 160rpx;
  117. display: block;
  118. margin-right: 15rpx;
  119. }
  120. .appoint-text {
  121. font-size: 28rpx;
  122. >view {
  123. margin-bottom: 26rpx;
  124. }
  125. }
  126. }
  127. .appoint-goto {
  128. display: flex;
  129. .detail,
  130. .cancel {
  131. width: 45%;
  132. border-radius: 20rpx;
  133. }
  134. .detail {
  135. background-color: #6c9fc3;
  136. color: #fff;
  137. }
  138. }
  139. }
  140. </style>