interestsItem.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <script setup>
  2. import { ref, watch, onMounted, computed } from 'vue'
  3. import { getUserOrder } from '@/api/user'
  4. import Paging from '@/components/pc/Paging/index.vue'
  5. import { useI18n } from 'vue-i18n'
  6. import { PAYSIDMAP } from '../data.ts'
  7. const { locale: language, t } = useI18n()
  8. const props = defineProps({
  9. item: {
  10. type: Object,
  11. default: {}
  12. },
  13. i: {
  14. type: Number
  15. }
  16. })
  17. const showInvoice = ref(true)
  18. function changeIvoiceStatus(i, item) {
  19. // this.$bus.$emit('order/showInvoice', {
  20. // order: item,
  21. // orderId: item.id,
  22. // data: this.getItemInvoice(item),
  23. // invoiceId: item.invoice && item.invoice.id
  24. // })
  25. }
  26. function getStatus(item) {
  27. let temp = ''
  28. let sPay = function () {
  29. switch (item.shippingStatus) {
  30. case 'unshipped':
  31. temp = 'unshipped'
  32. break
  33. case 'partShipped':
  34. temp = 'partShipped'
  35. break
  36. case 'shipped':
  37. temp = 'shipped'
  38. break
  39. case 'received':
  40. temp = 'received'
  41. break
  42. default:
  43. break
  44. }
  45. }
  46. let pPay = function () {
  47. switch (item.paymentStatus) {
  48. case 'unpaid':
  49. temp = 'unpaid'
  50. break
  51. case 'paid':
  52. sPay()
  53. break
  54. default:
  55. break
  56. }
  57. }
  58. switch (item.orderStatus) {
  59. case 'unprocessed':
  60. pPay()
  61. break
  62. case 'completed':
  63. temp = 'finish'
  64. break
  65. case 'processed':
  66. sPay()
  67. break
  68. case 'expire':
  69. temp = 'expire'
  70. break
  71. default:
  72. break
  73. }
  74. return temp
  75. }
  76. function toPay(item) {
  77. this.$router.push({
  78. name: 'pay',
  79. query: {
  80. payType: 0,
  81. orderId: item.id,
  82. orderType: 0,
  83. orderSn: item.orderSn
  84. }
  85. })
  86. }
  87. </script>
  88. <template>
  89. <div class="order-item" :key="i">
  90. <!-- <div class="o-top"></div> -->
  91. <div class="o-title">
  92. <span>
  93. <span class="orderSn table-header">{{$t('manage.myOrders.numbers')}}{{item.orderSn}}</span>
  94. <span class="orderTime">{{ item.tradeTime }}</span>
  95. </span>
  96. <span class="table-header">{{$t('manage.myOrders.quantity')}}</span>
  97. <span class="table-header">{{$t('manage.myOrders.subtotal')}}</span>
  98. <span class="table-header">{{$t('manage.myOrders.total1')}}</span>
  99. </div>
  100. <div class="o-detail">
  101. <div class="od-name">
  102. <div>
  103. <p>{{$t('manage.myOrders.memerText')}}</p>
  104. <p>{{$t('manage.Spending.listLabel.payType')}}:{{ PAYSIDMAP[item.payType] }}</p>
  105. <p style="word-break: break-all;" v-if="item.incrementIds" :title="item.incrementIds">{{$t('manage.member.memberPackage')}}:{{ item.incrementIds.join(",") }}</p>
  106. <p v-else>{{$t('manage.member.memberPackage')}}:{{ item.incrementId }}</p>
  107. </div>
  108. </div>
  109. <div class="count">{{item.count}}</div>
  110. <div class="sum">{{item.amount}}</div>
  111. <div class="sum total-momey">{{item.amount}}</div>
  112. </div>
  113. <div class="inovice-con" :class="{'ic-active':item.showInvoice}">
  114. <div class="o-invoiceTitle">
  115. <span>{{$t('manage.myOrders.invoice')}}</span>
  116. <span v-if="getStatus(item) !== 'shipped'" @click="edit"><i class="iconfont icon-edit"></i>{{$t('manage.myOrders.edit')}}</span>
  117. <!-- <span v-else><i class="iconfont icon-choice"></i>发票已寄出</span> -->
  118. </div>
  119. <div class="o-invoice">
  120. <!-- <editInvoice :data="getItemInvoice(item)" :orderId='item.id' :invoiceId="item.invoice&&(item.invoice.id)"/> -->
  121. </div>
  122. </div>
  123. <div class="bottom-area">
  124. <div class="to-pay">
  125. <template v-if="getStatus(item) !== 'expire'">
  126. <span class="cancel btns" @click="changeIvoiceStatus(i,item)">{{item.invoice && item.invoice.type ? $t('manage.myOrders.invoiceInfo') : $t('manage.myOrders.invoice')}}</span>
  127. </template>
  128. </div>
  129. </div>
  130. </div>
  131. </template>
  132. <style lang="less" scoped>
  133. .text-ellipsis{
  134. overflow:hidden;
  135. white-space: nowrap;
  136. text-overflow: ellipsis;
  137. -o-text-overflow:ellipsis;
  138. }
  139. .order-item {
  140. margin-bottom: 40px;
  141. border: 1px solid #EBEBEB;
  142. .inovice-con{
  143. max-height: 0;
  144. overflow: hidden;
  145. }
  146. .ic-active{
  147. max-height: 500px;
  148. transition: 0.3s ease max-height;
  149. }
  150. .o-top {
  151. color: #68b8f1;
  152. line-height: 60px;
  153. height: 60px;
  154. font-size: 16px;
  155. padding: 0 20px;
  156. user-select: none;
  157. border-bottom: 1px solid #EBEBEB;
  158. }
  159. .o-title,.o-invoiceTitle {
  160. user-select: none;
  161. display: flex;
  162. height: 32px;
  163. padding: 0 20px;
  164. align-items: center;
  165. line-height: 32px;
  166. // border-bottom: 1px solid #EBEBEB;
  167. background: #F7F7F7;
  168. span {
  169. font-size: 14px;
  170. flex: 1;
  171. text-align: center;
  172. &:first-child {
  173. flex: 5;
  174. text-align: left;
  175. }
  176. }
  177. }
  178. .orderSn {
  179. color: #323233;
  180. margin-right: 15px;
  181. }
  182. .o-invoiceTitle{
  183. align-items: center;
  184. .iconfont{
  185. vertical-align: middle;
  186. font-size: 20px;
  187. margin-right: 5px;
  188. }
  189. .icon-edit{
  190. color: #15BEC8;
  191. }
  192. .icon-choice{
  193. color: #02e430;
  194. }
  195. span {
  196. display: inline-block;
  197. vertical-align: middle;
  198. &:last-child{
  199. transform: translateX(11px);
  200. cursor: pointer;
  201. }
  202. &:first-child {
  203. flex: 1;
  204. transform: translateX(0);
  205. text-align: left;
  206. }
  207. }
  208. }
  209. .o-invoice{
  210. display: flex;
  211. align-items: center;
  212. padding: 10px 20px 10px 85px;
  213. color: #4a4a4a;
  214. font-size: 14px;
  215. border-bottom: 1px solid #EBEBEB;
  216. }
  217. .o-detail {
  218. display: flex;
  219. align-items: center;
  220. min-height: 86px;
  221. line-height: 86px;
  222. padding: 0 20px;
  223. color: #4a4a4a;
  224. font-size: 14px;
  225. border-bottom: 1px solid #EBEBEB;
  226. .od-name {
  227. display: flex;
  228. align-items: center;
  229. flex: 5;
  230. .thumbnail {
  231. width: 55px;
  232. margin-right: 10px;
  233. }
  234. p {
  235. line-height: 1.5;
  236. font-size: 14px;
  237. color: #969696;
  238. &:first-of-type{
  239. font-weight: bold;
  240. color: #2d2d2d;
  241. }
  242. }
  243. }
  244. .count {
  245. flex: 1;
  246. text-align: center;
  247. }
  248. .sum {
  249. flex: 1;
  250. text-align: center;
  251. }
  252. }
  253. .sum-price {
  254. display: flex;
  255. height: 40px;
  256. line-height: 40px;
  257. padding: 0 40px;
  258. border-bottom: 1px solid #EBEBEB;
  259. div {
  260. flex: 2;
  261. color: #4a4a4a;
  262. font-size: 14px;
  263. &:last-child {
  264. flex: 1;
  265. text-align: right;
  266. }
  267. }
  268. }
  269. .bottom-area{
  270. position: relative;
  271. .bottom-left{
  272. position: absolute;
  273. top: 50%;
  274. left: 20px;
  275. color: #a0a0a0;
  276. transform: translateY(-50%);
  277. font-size: 14px;
  278. color: #323233;
  279. }
  280. .to-pay {
  281. text-align: right;
  282. height: 50px;
  283. line-height: 50px;
  284. padding: 0 25px;
  285. .cancel {
  286. font-size: 14px;
  287. // border: 1px solid #ccc;
  288. display: inline-block;
  289. text-align: center;
  290. cursor: pointer;
  291. background: #fff;
  292. color: #202020;
  293. border: 1px solid #323233;
  294. width: 104px;
  295. height: 32px;
  296. line-height: 32px;
  297. border-radius: 4px;
  298. }
  299. .pay {
  300. background: #15BEC8;
  301. font-size: 14px;
  302. display: inline-block;
  303. width: 104px;
  304. height: 32px;
  305. line-height: 32px;
  306. color: #fff;
  307. text-align: center;
  308. cursor: pointer;
  309. border-radius: 4px;
  310. }
  311. .expreeNum {
  312. margin-right: 60px;
  313. color: #323233;
  314. }
  315. }
  316. }
  317. }
  318. .table-header {
  319. font-weight: 600;
  320. color: #202020;
  321. }
  322. .total-momey {
  323. font-weight: 400;
  324. color: #202020;
  325. font-size: 20px;
  326. }
  327. </style>