index.vue 5.0 KB

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