orderCard.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="order-card-main"
  3. @click.stop="clickCard">
  4. <view class="u-flex">
  5. <view class="icon-shop-wh icon-shop"></view>
  6. <view class="shop-name u-m-l-8 u-line-1 line-34">{{value.shop_name}}</view>
  7. <view class="u-flex-1 u-text-right u-primary-color line-34">{{value.join_status | statusFilter}}</view>
  8. </view>
  9. <view class="u-flex u-m-t-16 u-p-b-24">
  10. <image class="order-img"
  11. :src="value.imgs | imgFilter(3)"
  12. lazy-load
  13. mode="aspectFill"></image>
  14. <view class="u-flex-1 u-m-l-16">
  15. <view class="u-font-28 line-40 bold">{{value.title}}</view>
  16. <!-- <block v-if="value.activity_type * 1 === 1">
  17. <view class="u-font-28 line-40 bold">返利:实付全返</view>
  18. </block>
  19. <block v-if="value.activity_type * 1 === 2">
  20. <view class="u-font-28 line-40 bold">返利:¥{{(value.rebate_amount / 100).toFixed(2)}}</view>
  21. </block> -->
  22. <!-- <view class="u-font-22 u-m-t-8 line-32 u-content-color">平台:{{value.plat_type | platTypeFilter}}</view> -->
  23. <view class="u-font-22 u-m-t-8 line-32 u-content-color">报名时间:{{value.created_at}}</view>
  24. <block v-if="value.join_status * 1 === 4">
  25. <view class="reson-text u-m-t-8 u-font-22 line-32 u-other-color u-line-1">驳回原因:{{value.reject_reason}}</view>
  26. </block>
  27. </view>
  28. </view>
  29. <view class="u-border-top u-p-t-16 u-p-b-16"
  30. v-if="value.join_status * 1 === 1 || value.join_status * 1 === 4">
  31. <block v-if="value.join_status * 1 === 1">
  32. <view class="u-flex u-row-right">
  33. <button class="cancel-btn u-font-24"
  34. @click.stop="cancelSignUp"
  35. v-if="!isExpire()">取消报名</button>
  36. <button class="submit-btn u-font-24 u-m-l-24"
  37. @click.stop="submitResult">提交订单</button>
  38. </view>
  39. </block>
  40. <block v-if="value.join_status * 1 === 4">
  41. <view class="u-flex u-row-right">
  42. <button class="cancel-btn u-font-24"
  43. open-type="contact"
  44. @click.stop>联系客服</button>
  45. </view>
  46. </block>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. props: {
  53. value: {
  54. type: Object,
  55. default: () => { }
  56. }
  57. },
  58. methods: {
  59. isExpire () {
  60. const nowTime = this.$dayjs()
  61. const now = nowTime.format('HH:mm:ss')
  62. console.log(this.value)
  63. if (this.value.end_time < now) {
  64. return true
  65. }
  66. return false
  67. },
  68. clickCard () {
  69. this.$emit('click-card', this.value)
  70. },
  71. cancelSignUp () {
  72. this.$emit('cancel-sign-up', this.value)
  73. },
  74. submitResult () {
  75. this.$emit('submit-result', this.value)
  76. }
  77. },
  78. filters: {
  79. statusFilter (e) {
  80. const statusText = {
  81. 1: '已报名',
  82. 2: '已提交',
  83. 3: '已结算',
  84. 4: '已驳回',
  85. 5: '已取消',
  86. 6: '已过期'
  87. }
  88. return statusText[e] || ''
  89. },
  90. platTypeFilter (e) {
  91. const playType = {
  92. 8: '饿了么',
  93. 9: '美团'
  94. }
  95. return playType[e]
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .order-card-main {
  102. padding: 24px 24px 0;
  103. border-radius: 12px;
  104. background-color: #fff;
  105. .icon-shop-wh {
  106. width: 30px;
  107. height: 30px;
  108. }
  109. .shop-name {
  110. max-width: 512px;
  111. }
  112. .order-img {
  113. width: 108px;
  114. height: 108px;
  115. border-radius: 4px;
  116. }
  117. .reson-text {
  118. max-width: 426rpx;
  119. }
  120. .cancel-btn,
  121. .submit-btn {
  122. margin: 0;
  123. padding: 0;
  124. line-height: 48rpx;
  125. width: 144rpx;
  126. text-align: center;
  127. align-content: center;
  128. height: 48rpx;
  129. border-radius: 24rpx;
  130. background-color: #fff;
  131. }
  132. .cancel-btn {
  133. color: $u-main-color;
  134. &::after {
  135. content: '';
  136. display: flex;
  137. align-items: center;
  138. width: 200%;
  139. height: 200%;
  140. border: 2px solid $u-light-color;
  141. border-radius: 48px;
  142. box-sizing: border-box;
  143. pointer-events: none;
  144. transform-origin: 0 0;
  145. }
  146. }
  147. .submit-btn {
  148. color: $u-type-primary;
  149. &::after {
  150. content: '';
  151. display: flex;
  152. align-items: center;
  153. width: 200%;
  154. height: 200%;
  155. border: 2px solid $u-type-primary;
  156. border-radius: 48px;
  157. box-sizing: border-box;
  158. pointer-events: none;
  159. transform-origin: 0 0;
  160. }
  161. }
  162. }
  163. </style>