index.vue 5.7 KB

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