app-reservation-form.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="app-reservation-form dir-left-wrap">
  3. <view>
  4. <app-jump-button form open_type="navigate" :url="`/plugins/book/orderDetails/orderDetails?id=${item.id}`">
  5. <image class="app-image" :src="item.detail[0].goods_info.pic_url"></image>
  6. <text class="app-status-text" v-if="item.cancel_status == 2">退款中</text>
  7. <text class="app-status-text" v-else-if="item.cancel_status == 1 && item.is_pay == 0">已取消</text>
  8. <text class="app-status-text" v-else-if="item.cancel_status == 1">已退款</text>
  9. <text class="app-status-text" v-else-if="item.is_pay == 0">待付款</text>
  10. <text class="app-status-text" v-else-if="item.is_confirm == 0">待使用</text>
  11. <text class="app-status-text" v-else-if="item.is_confirm == 1">已使用</text>
  12. <view class="app-title-price">
  13. <view class="app-title">
  14. {{item.detail[0].goods_info.name}}
  15. </view>
  16. <view class="app-price dir-left-wrap main-right cross-center">
  17. <view class="app-attr">
  18. <text v-for="(attr, i) in item.detail[0].goods_info.attr_list" :key="i">{{attr.attr_group_name}}: {{attr.attr_name}}</text>
  19. </view>
  20. <text class="app-old-price">{{item.total_goods_original_price}}</text>
  21. <text class="app-new-price">{{item.total_pay_price}}</text>
  22. </view>
  23. </view>
  24. </app-jump-button>
  25. </view>
  26. <view class="app-buttons dir-left-nowrap main-right" v-if="item.cancel_status == 0 && item.is_sale == 0">
  27. <view class="app-button" v-if="item.cancel_status != 2 && item.is_pay == 1 && item.is_confirm == 0" @click="refund('refund')">
  28. <app-form-id>
  29. <view class="button app-button-white">申请退款</view>
  30. </app-form-id>
  31. </view>
  32. <view class="app-button" v-if="item.cancel_status != 2 && item.is_pay == 1 && item.is_confirm == 0" @click="refund('use')">
  33. <app-form-id>
  34. <view class="button app-button-red">立即使用</view>
  35. </app-form-id>
  36. </view>
  37. <view class="app-button" v-if="item.is_sale == 0 && item.is_confirm == 1" @click="evaluation">
  38. <app-form-id>
  39. <view class="button app-button-red">去评价</view>
  40. </app-form-id>
  41. </view>
  42. <view class="app-button" v-if="item.is_pay == 0" @click="refund('cancel')">
  43. <app-form-id>
  44. <view class="button app-button-white">申请取消</view>
  45. </app-form-id>
  46. </view>
  47. <view class="app-button" v-if="item.is_pay == 0" @click="refund('pay')">
  48. <app-form-id>
  49. <view class="button app-button-red">去支付</view>
  50. </app-form-id>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. name: 'app-reservation-form',
  58. props: {
  59. item: {
  60. type: Object,
  61. default() {
  62. return {}
  63. }
  64. }
  65. },
  66. methods: {
  67. refund(data) {
  68. this.$emit('click', data, this.item);
  69. },
  70. evaluation() {
  71. this.$jump({
  72. open_type: 'navigate',
  73. url: `pages/order/appraise/appraise?id=${this.item.id}`
  74. })
  75. }
  76. }
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .app-reservation-form {
  81. width: 100%;
  82. margin-top: #{20rpx};
  83. position: relative;
  84. background-color:white;
  85. .app-image {
  86. width: #{208rpx};
  87. height: #{160rpx};
  88. border-radius: #{8rpx};
  89. margin: #{24rpx} #{24rpx} #{24rpx} #{24rpx};
  90. }
  91. .app-status-text {
  92. display: inline-block;
  93. width: #{100rpx};
  94. height: #{48rpx};
  95. line-height: #{48rpx};
  96. font-size: #{26rpx};
  97. color: #FFFFFF;
  98. background-color: #ff4544;
  99. border-top-left-radius: #{8rpx};
  100. text-align: center;
  101. position: absolute;
  102. top: #{24rpx};
  103. left: #{24rpx};
  104. }
  105. .app-title-price {
  106. width: #{470rpx};
  107. height: #{24+160+24rpx};
  108. margin-right: #{24rpx};
  109. .app-title {
  110. margin-top: #{32rpx};
  111. height: #{64rpx};
  112. width: #{470rpx};
  113. font-size: #{28rpx};
  114. line-height: #{32rpx};
  115. color: #353535;
  116. word-break: break-all;
  117. text-overflow: ellipsis;
  118. display: -webkit-box;
  119. -webkit-box-orient: vertical;
  120. -webkit-line-clamp: 2;
  121. overflow: hidden;
  122. }
  123. .app-attr {
  124. width: #{470rpx};
  125. margin-top: #{6rpx};
  126. font-size: 12px;
  127. color: #c9c9c9;
  128. }
  129. .app-price>text {
  130. margin-top: #{32rpx};
  131. margin-bottom: #{32rpx};
  132. }
  133. .app-price>text:before {
  134. content: '¥';
  135. }
  136. .app-old-price {
  137. text-decoration:line-through;
  138. font-size: #{26rpx};
  139. color: #999999;
  140. margin-right: #{24rpx};
  141. }
  142. .app-new-price {
  143. font-size: #{32rpx};
  144. color: #ff4544;
  145. }
  146. }
  147. .app-buttons {
  148. height: #{100rpx};
  149. width: 100%;
  150. border-top: #{1rpx} solid #e2e2e2;
  151. padding-right: #{8rpx};
  152. .app-button {
  153. width: #{180rpx};
  154. height: #{60rpx};
  155. margin-right: #{16rpx};
  156. padding-top: #{20rpx};
  157. .button {
  158. width: 100%;
  159. height: #{60rpx};
  160. line-height: #{60rpx};
  161. border-radius: #{30rpx};
  162. padding: 0;
  163. font-size: #{32rpx};
  164. border-width: #{1rpx};
  165. border-style: solid;
  166. text-align: center;
  167. border-color: transparent;
  168. }
  169. .app-button-white {
  170. background-color: white;
  171. border-color: #cdcdcd;
  172. color: #666666;
  173. }
  174. .app-button-red {
  175. background-color: #fff5f5;
  176. color: #ff4544;
  177. border-color: #ff4544;
  178. }
  179. }
  180. }
  181. }
  182. </style>