index.vue 5.2 KB

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