ld-goods.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <view class="goodsItem u-border-one-one u-flex-center">
  3. <image
  4. :src="`${value.productCover}?x-oss-process=style/w_150`"
  5. v-if="value.productCover"
  6. class="u-goods200 u-ml15 z-image"
  7. mode=""
  8. ></image>
  9. <view class="rightText u-ml30">
  10. <view class="u-text2 u-1A1A1A u-font28 textWidth">{{
  11. value.productTitle
  12. }}</view>
  13. <view class="sku-name-box">
  14. <view class="u-font24 u-999 sku-name u-text2" v-if="value.skuSetName"
  15. >规格: {{ value.skuSetName }}</view
  16. >
  17. <view class="u-font24 u-999 u-ml15 sku-num" v-if="value.productNum"
  18. >x {{ value.productNum }}</view
  19. >
  20. </view>
  21. <view class="u-flex-center botPrice">
  22. <template v-if="props.exchange">
  23. <view class="u-FF0000 u-font32" style="margin-left: 10rpx">
  24. {{ value.singlePoint || value.skuPrice || 0 }}
  25. 积分
  26. </view>
  27. <text class="discount u-333" v-if="value.singlePoint"
  28. >¥{{ value.realPrice }}</text
  29. >
  30. </template>
  31. <view class="u-FF0000 u-font32 u-flex-center" v-else>
  32. <rich-text
  33. :nodes="
  34. $mUtil.priceBigSmall(value.paymentAmount || value.realPrice || value.skuPrice || 0 )
  35. "
  36. ></rich-text>
  37. <text class="discount u-333" v-if="value.paymentAmount"
  38. >¥{{ value.totalOriginalRealPrice }}</text
  39. >
  40. </view>
  41. </view>
  42. <view v-if="props.item && props.item.orderNo" class="tagsView">
  43. <template v-if="value.rightsStatus == 0">
  44. <uv-tags
  45. type="primary"
  46. v-if="value.transactionStatus == 0 && value.rightsMethod == 0"
  47. text="待支付"
  48. ></uv-tags>
  49. <uv-tags
  50. type="warning"
  51. v-if="value.transactionStatus == 10"
  52. :text="shippingStatusHandle(props.item, value)"
  53. ></uv-tags>
  54. <uv-tags
  55. type="info"
  56. v-if="value.transactionStatus == 20"
  57. :text="rightsStatusHandle(props.item, value)"
  58. ></uv-tags>
  59. <uv-tags
  60. type="success"
  61. v-if="value.transactionStatus == 30"
  62. text="交易完成"
  63. ></uv-tags>
  64. <uv-tags
  65. type="info"
  66. v-if="value.transactionStatus == 100 && value.rightsMethod == 0"
  67. text="订单取消"
  68. ></uv-tags>
  69. </template>
  70. <uv-tags
  71. type="info"
  72. v-if="value.rightsMethod > 0"
  73. :text="receivingStatusHandle(value)"
  74. ></uv-tags>
  75. </view>
  76. </view>
  77. <view
  78. class="btnComment_status"
  79. v-if="value.transactionStatus == 30 && value.commentStatus == 0 && props.keys != null"
  80. @click="evaluation(value.orderDetailId)"
  81. >去评价</view
  82. >
  83. </view>
  84. </template>
  85. <script setup>
  86. import { ref, watch } from "vue";
  87. const emit = defineEmits(["parentevaluation"]);
  88. const props = defineProps({
  89. value: {
  90. type: Object,
  91. default: {},
  92. },
  93. position: {
  94. type: Number,
  95. default: 0,
  96. },
  97. exchange: {
  98. type: Boolean,
  99. default: false,
  100. },
  101. // 订单信息
  102. item: {
  103. type: Object,
  104. default: {},
  105. },
  106. keys: {
  107. type: Number,
  108. default: null,
  109. }
  110. });
  111. const value = ref(props.value);
  112. watch(
  113. () => props.value,
  114. (newValue) => {
  115. value.value = newValue;
  116. }
  117. );
  118. const shippingStatusHandle = (mainOrder, child) => {
  119. let text = "发";
  120. if (mainOrder.shippingMethod == 10) {
  121. text = "备";
  122. }
  123. if (child.shippingStatus == 0) {
  124. return "待" + text + "货";
  125. } else if (child.shippingStatus == 10) {
  126. return "部分" + text + "货";
  127. } else {
  128. return "已" + text + "货";
  129. }
  130. };
  131. const receivingStatusHandle = (mainOrder) => {
  132. if (mainOrder.rightsMethod == 0) {
  133. return "";
  134. } else if (mainOrder.rightsMethod == 5) {
  135. return mainOrder.rightsStatus == 5 ? "退款中" : "退款完成";
  136. } else {
  137. return mainOrder.rightsStatus == 5 ? "退货中" : "退货完成";
  138. }
  139. };
  140. const rightsStatusHandle = (mainOrder, child) => {
  141. let text = "收货";
  142. if (mainOrder.shippingMethod == 10) {
  143. text = "自提";
  144. }
  145. if (child.rightsStatus == 0) {
  146. return "待" + text;
  147. } else if (child.rightsStatus == 10) {
  148. return "部分" + text;
  149. } else {
  150. return "已" + text;
  151. }
  152. };
  153. const evaluation = (id) => {
  154. let data = {
  155. id: id,
  156. keys: props.keys,
  157. };
  158. emit("parentevaluation", data);
  159. };
  160. </script>
  161. <style scoped lang="scss">
  162. .bottext {
  163. /* margin-top: 44rpx; */
  164. }
  165. .rightText {
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: space-between;
  169. min-height: 200rpx;
  170. flex: 1;
  171. .tagsView {
  172. display: inherit;
  173. }
  174. }
  175. .goodsItem {
  176. /* align-items: flex-start; */
  177. padding: 40rpx 0;
  178. padding-right: 20rpx;
  179. position: relative;
  180. border-bottom: 1rpx solid #f7f7f7;
  181. .u-goods200 {
  182. flex-shrink: 0;
  183. }
  184. }
  185. .goodsItem .z-image {
  186. flex-shrink: 0;
  187. }
  188. .thirdTag {
  189. display: inline-block;
  190. background: #30b885;
  191. border-radius: 10rpx;
  192. line-height: 40rpx;
  193. text-align: center;
  194. margin-right: 10rpx;
  195. padding: 0 10rpx;
  196. color: #fff;
  197. font-size: 26rpx;
  198. }
  199. .textWidth {
  200. /* width: 420rpx; */
  201. /* height: 80rpx;
  202. line-height: 40rpx; */
  203. }
  204. .btnComment_status {
  205. position: absolute;
  206. right: 0;
  207. bottom: 30rpx;
  208. background-color: #fa6138;
  209. width: 180rpx;
  210. height: 60rpx;
  211. text-align: center;
  212. line-height: 60rpx;
  213. color: #fff;
  214. font-size: 28rpx;
  215. border-radius: 40rpx;
  216. }
  217. .back_status {
  218. position: absolute;
  219. right: 30rpx;
  220. bottom: 30rpx;
  221. text-align: center;
  222. line-height: 60rpx;
  223. }
  224. .sku-name-box {
  225. display: flex;
  226. }
  227. .sku-name {
  228. margin-right: 20rpx;
  229. /* height: 80rpx; */
  230. line-height: 1.5;
  231. }
  232. .sku-num {
  233. margin-left: auto;
  234. flex-shrink: 0;
  235. }
  236. .discount-box {
  237. margin-top: 10rpx;
  238. }
  239. .discount {
  240. margin-left: 20rpx;
  241. font-size: 24rpx;
  242. text-decoration: line-through;
  243. }
  244. </style>