index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="item">
  3. <view @click="goOrderDetails(order.orderId)">
  4. <view class="title acea-row row-between-wrapper">
  5. <view class="acea-row row-middle">
  6. <text
  7. class="sign cart-color acea-row row-center-wrapper"
  8. v-if="
  9. order.activityType !== '普通' && order.activityType !== '核销'
  10. "
  11. >{{ order.activityType }}</text
  12. >
  13. <view>{{ order.createTime }}</view>
  14. </view>
  15. <view class="font-color">{{ order.orderStatus }}</view>
  16. </view>
  17. <view
  18. class="item-info acea-row row-between row-top"
  19. v-for="(items, idx) in order.orderInfoList"
  20. :key="idx"
  21. >
  22. <view class="pictrue">
  23. <image :src="items.image"></image>
  24. </view>
  25. <view class="text">
  26. <view class="name line2">{{ items.storeName }}</view>
  27. <view class="money">
  28. <view v-if="mallType === 0">¥{{ items.storePrice || 0 }}</view>
  29. <view>x{{ items.cartNum }}</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="totalPrice"
  34. >共{{ order.totalNum }}件商品,总金额
  35. <text class="money font-color" v-if="mallType === 0">¥{{ order.payPrice }}</text>
  36. <text class="money font-color" v-else>{{ order.useIntegral }}贝币</text>
  37. </view>
  38. </view>
  39. <view class="bottom acea-row row-right row-middle" v-if="mallType === '0'">
  40. <view class="bnt cancelBnt" v-if="!order.paid" @click.stop="cancelOrder"
  41. >取消订单</view
  42. >
  43. <view class="bnt bg-color" v-if="!order.paid" @click.stop="goPay"
  44. >立即付款</view
  45. >
  46. <view
  47. class="bnt bg-color"
  48. v-else-if="order.status == 0 || order.status == 1 || order.status == 3"
  49. @click.stop="goOrderDetails(order.orderId)"
  50. >查看详情</view
  51. >
  52. <view
  53. class="bnt bg-color"
  54. v-else-if="order.status == 2"
  55. @click.stop="goOrderDetails(order.orderId)"
  56. >去评价</view
  57. >
  58. <view
  59. class="bnt cancelBnt"
  60. v-if="order.status == 3"
  61. @click.stop="delOrder"
  62. >删除订单</view
  63. >
  64. </view>
  65. </view>
  66. </template>
  67. <script setup>
  68. const props = defineProps({
  69. order: Object,
  70. index: Number,
  71. mallType: {
  72. type: Number,
  73. default: 0,
  74. }, // 0: 水贝商城 1: 贝币商城
  75. });
  76. const emit = defineEmits([
  77. "cancelOrder",
  78. "goPay",
  79. "goOrderDetails",
  80. "delOrder",
  81. ]);
  82. function cancelOrder() {
  83. emit("cancelOrder", props.index, props.order.id);
  84. }
  85. function goPay() {
  86. emit("goPay", props.order.payPrice, props.order.orderId);
  87. }
  88. function goOrderDetails(orderId) {
  89. emit("goOrderDetails", orderId);
  90. }
  91. function delOrder() {
  92. emit("delOrder", props.order.id, props.index);
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. .item {
  97. background-color: #fff;
  98. border-radius: 14rpx;
  99. margin-bottom: 14rpx;
  100. .title {
  101. height: 84rpx;
  102. padding: 0 24rpx;
  103. border-bottom: 1rpx solid #eee;
  104. font-size: 28rpx;
  105. color: #282828;
  106. .sign {
  107. font-size: 24rpx;
  108. padding: 0 13rpx;
  109. height: 36rpx;
  110. margin-right: 15rpx;
  111. border-radius: 18rpx;
  112. }
  113. }
  114. .item-info {
  115. padding: 0 24rpx;
  116. margin-top: 22rpx;
  117. .pictrue {
  118. width: 120rpx;
  119. height: 120rpx;
  120. image {
  121. width: 100%;
  122. height: 100%;
  123. border-radius: 14rpx;
  124. }
  125. }
  126. .text {
  127. flex: 1;
  128. // width: 500rpx;
  129. font-size: 28rpx;
  130. color: #999;
  131. display: flex;
  132. justify-content: space-between;
  133. flex-wrap: nowrap;
  134. padding: 0 0 0 20rpx;
  135. .name {
  136. width: 350rpx;
  137. color: #282828;
  138. }
  139. .money {
  140. text-align: right;
  141. white-space: nowrap;
  142. text {
  143. white-space: nowrap;
  144. }
  145. }
  146. }
  147. }
  148. .totalPrice {
  149. font-size: 26rpx;
  150. color: #282828;
  151. text-align: right;
  152. margin: 27rpx 0 0 30rpx;
  153. padding: 0 30rpx 30rpx 0;
  154. border-bottom: 1rpx solid #eee;
  155. .money {
  156. font-size: 28rpx;
  157. font-weight: bold;
  158. }
  159. }
  160. .bottom {
  161. height: 107rpx;
  162. padding: 0 30rpx;
  163. .bnt {
  164. width: 176rpx;
  165. height: 60rpx;
  166. text-align: center;
  167. line-height: 60rpx;
  168. color: #fff;
  169. border-radius: 50rpx;
  170. font-size: 27rpx;
  171. &.cancelBnt {
  172. border: 1rpx solid #ddd;
  173. color: #aaa;
  174. }
  175. & ~ .bnt {
  176. margin-left: 17rpx;
  177. }
  178. }
  179. }
  180. }
  181. </style>