You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

387 lines
9.4 KiB

10 months ago
  1. <template>
  2. <view class="order-detail">
  3. <u-navbar :title="$t('page.orderDetail.order-detail')" placeholder @leftClick="leftClick()"></u-navbar>
  4. <!-- <view class="user-info white">
  5. <img src="../../static/orderDetail/position@3x.png" alt="" />
  6. <view class="user-base-info">
  7. <text class="name">{{ $t('page.orderDetail.receiving-information-name') }}</text>
  8. <text class="phone">159****2932</text>
  9. <text class="deliver-to">{{ $t('page.orderDetail.receiving-information-deliver') }}</text>
  10. <text class="address">{{ $t('page.orderDetail.receiving-information-address') }}</text>
  11. </view>
  12. <u-icon name="arrow-down"></u-icon>
  13. </view> -->
  14. <view class="order-info white">
  15. <view class="order-info-top white inside-margin">
  16. <view class="merchant">
  17. <!-- xxxxxx商家 -->
  18. <!-- <u-icon name="arrow-right"></u-icon> -->
  19. </view>
  20. <text class="order-status">{{ classifyList[productList.state] }}</text>
  21. </view>
  22. <view class="product-list">
  23. <orderProductList :product="productList"></orderProductList>
  24. </view>
  25. <view class="unknown inside-margin">
  26. <!-- TôngcÃng:<text class="unknown-price">5280.0</text>(baogòmcàvànchuyên¥0.0) -->
  27. {{ $t('page.orderDetail.total') }}<text
  28. class="unknown-price">{{ productList.sumPrice }}</text>
  29. </view>
  30. <view class="account-payable">
  31. <view class="account-payable-title">
  32. <text>{{ $t('page.orderDetail.account-payable') }}</text>
  33. <!-- <u-icon name="arrow-down"></u-icon> -->
  34. </view>
  35. <view class="account-payable-price">
  36. <view class="money-symbol">
  37. <!-- {{ $t('$') }} -->
  38. </view>
  39. <view class="num">{{ productList.sumPrice }}</text>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="order-number">
  44. <text class="order-number-title">{{ $t('page.orderDetail.order-number') }}</text>
  45. <view class="number">
  46. <text class="code">{{ productList.id }}</text>
  47. <text class="copy" @click="copy(productList.id)">{{ $t('page.orderDetail.copy') }}</text>
  48. </view>
  49. </view>
  50. <view v-if="productList.name && productList.state != '0'" class="receiving-information">
  51. <text class="receiving-information-title">{{ $t('page.orderDetail.receiving-information') }}</text>
  52. <!-- <text class="address">{{ productList.name + ", " + productList.phone + ", " +productList.detailAddress }}</text> -->
  53. <text
  54. class="address">{{ productList.name + ', ' + productList.phone + ', ' + productList.detailAddress }}</text>
  55. </view>
  56. <!-- <view class="transaction-number">
  57. <text class="transaction-number-title">{{ $t('page.orderDetail.transaction-number') }}</text>
  58. <text class="transaction-number-code">4750376583629697865656</text>
  59. </view> -->
  60. <view class="create-time">
  61. <text class="create-time-title">{{ $t('page.orderDetail.create-time') }}</text>
  62. <text class="create-time-detail">2024-04-27 12:23:22</text>
  63. </view>
  64. <!-- <view class="closing-time">
  65. <text class="closing-time-title">{{ $t('page.orderDetail.closing-time') }}</text>
  66. <text class="closing-time-detail">2024-04-27 12:23:56</text>
  67. </view> -->
  68. <!-- <view class="pack-more-information">
  69. <text>{{ $t('page.orderDetail.more') }}</text>
  70. <u-icon name="arrow-up"></u-icon>
  71. </view> -->
  72. </view>
  73. <view class="contact-seller white">
  74. <view @click="toServer()" class="box">
  75. <img src="../../static/orderDetail/server@3x.png" alt="" />
  76. <text>{{ $t('page.orderDetail.contact-seller') }}</text>
  77. </view>
  78. </view>
  79. <view class=" product-list">
  80. <productList :list="list"></productList>
  81. </view>
  82. <view v-if="productList.state != '0' && productList.state != '4'" class="order-detail-bottom">
  83. <view v-if="productList.state == '3'" @click="deleteOrder(productList)" class="btn">
  84. {{ $t('page.orderDetail.delete-order') }}
  85. </view>
  86. <view v-if="showRepurchase(productList.state)" @click="toRepurchase()" class="btn repurchaseBtn">
  87. {{ $t('page.orderDetail.repurchase') }}
  88. </view>
  89. </view>
  90. <orderPanel :open.sync="orderPanenOpen" @definiteExecution="definiteExecution" @closePanel="closePanel"
  91. :title="panelTitle" :desc="panelDesc" :num="panelNum" :url="imageUrl"></orderPanel>
  92. </view>
  93. </template>
  94. <script>
  95. import productList from '@/components/product/productList.vue'
  96. import orderProductList from '@/components/order-product/orderProductList.vue'
  97. import orderPanel from '../../components/order-panel/orderPanel.vue';
  98. export default {
  99. components: {
  100. orderProductList,
  101. productList,
  102. orderPanel
  103. },
  104. data() {
  105. return {
  106. classifyList: [
  107. this.$t('page.order.pendingPayment'),
  108. this.$t('page.order.pendingShipment'),
  109. this.$t('page.order.pendingReceipt'),
  110. this.$t('page.order.completed')
  111. ],
  112. //商品数据
  113. productList: {},
  114. orderPanenOpen: false,
  115. panelTitle: '',
  116. panelDesc: '',
  117. panelNum: '',
  118. list: [],
  119. imageUrl : '',
  120. queryParams: {
  121. }
  122. }
  123. },
  124. onShow() {
  125. this.getorderDetail();
  126. this.getProduct();
  127. },
  128. methods: {
  129. getorderDetail() { //获取订单详情
  130. this.request('getOrderOne', {}, {
  131. id: this.$route.query.id,
  132. }).then(res => {
  133. this.productList = res.result
  134. })
  135. },
  136. copy(e) {
  137. uni.setClipboardData({
  138. data: e + '',
  139. success: () => {
  140. uni.showToast({
  141. title: this.$t('success-operation'),
  142. icon: 'none'
  143. })
  144. }
  145. })
  146. },
  147. leftClick() {
  148. uni.switchTab({
  149. url: '/pages/order/order'
  150. })
  151. },
  152. toRepurchase() {
  153. uni.navigateTo({
  154. url: '/pages/repurchase/repurchase?id=' + this.$route.query.id
  155. })
  156. },
  157. closePanel() {
  158. this.orderPanenOpen = false;
  159. },
  160. definiteExecution() {
  161. this.$MyToast("操作成功!", {
  162. title: this.$t('myToactTitle'),
  163. icon: true //是否开启icon
  164. })
  165. this.orderPanenOpen = false;
  166. this.leftClick();
  167. },
  168. deleteOrder(item) { //删除订单
  169. this.panelTitle = this.$t('page.orderDetail.delete-order-title')
  170. this.panelDesc = this.$t('page.orderDetail.delete-order-desc')
  171. this.panelNum = this.$t('page.orderDetail.delete-product-num');
  172. this.imageUrl = item.image
  173. this.orderPanenOpen = true;
  174. },
  175. getProduct() { //获取商品列表
  176. this.request('getShopPage', {}, {
  177. "pageSize": 10,
  178. "currentPage": 1
  179. })
  180. .then(res => {
  181. this.list = parseList(res.result.records);
  182. })
  183. },
  184. showRepurchase(state) { //是否显示回购按钮
  185. return state != '4' && state == '1' || state == '2' || state == '3'
  186. },
  187. toServer(){ //找客服
  188. uni.navigateTo({
  189. url: `/pages/login/contactCustomerService?title=${this.$t('page.orderDetail.contact-seller')}&url=/pages/orderDetail/orderDetail&id=` + this.$route.query.id
  190. })
  191. }
  192. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. .order-detail {
  197. padding-bottom: 100rpx;
  198. .inside-margin {
  199. padding: 10px;
  200. }
  201. .white {
  202. background: white;
  203. }
  204. .in-block {
  205. display: inline-block;
  206. }
  207. .user-info {
  208. display: flex;
  209. align-items: center;
  210. margin-top: 56px;
  211. padding: 25px 10px;
  212. img,
  213. .u-icon {
  214. width: 30rpx;
  215. height: 30rpx;
  216. }
  217. .user-base-info {
  218. width: calc(100% - 60rpx);
  219. padding-left: 10px;
  220. font-size: 24rpx;
  221. text {
  222. margin: 0px 3px;
  223. }
  224. }
  225. }
  226. .order-info {
  227. margin-top: 10px;
  228. .order-info-top {
  229. display: flex;
  230. justify-content: space-between;
  231. background: white;
  232. font-size: 28rpx;
  233. .merchant {
  234. display: flex;
  235. }
  236. .order-status {
  237. color: #ED762F;
  238. }
  239. }
  240. .product-list {
  241. padding: 0px 5px;
  242. }
  243. .unknown {
  244. display: flex;
  245. justify-content: flex-end;
  246. font-size: 24rpx;
  247. .unknown-price {
  248. font-size: 30rpx;
  249. }
  250. }
  251. .account-payable,
  252. .order-number,
  253. .receiving-information,
  254. .transaction-number,
  255. .create-time,
  256. .closing-time {
  257. display: flex;
  258. flex-wrap: wrap;
  259. justify-content: space-between;
  260. padding: 12px 10px;
  261. >text,
  262. >view {
  263. width: 77%;
  264. font-size: 26rpx;
  265. &:nth-child(1) {
  266. width: 23%;
  267. font-weight: 600;
  268. }
  269. &:nth-child(2) {
  270. display: flex;
  271. justify-content: flex-end;
  272. text-align: right;
  273. color: #888;
  274. }
  275. }
  276. .account-payable-title {
  277. display: flex;
  278. align-items: center;
  279. }
  280. .number {
  281. display: flex;
  282. align-items: center;
  283. .copy {
  284. margin-left: 5px;
  285. border-left: 1px solid #ccc;
  286. padding-left: 5px;
  287. }
  288. }
  289. .account-payable-price {
  290. display: flex;
  291. .money-symbol {
  292. display: flex;
  293. align-items: center;
  294. }
  295. .num {
  296. display: flex;
  297. align-items: center;
  298. font-size: 35rpx;
  299. color: #E01717;
  300. text {
  301. font-size: 26rpx;
  302. }
  303. }
  304. }
  305. }
  306. .pack-more-information {
  307. display: flex;
  308. padding: 5px 10px;
  309. font-size: 25rpx;
  310. }
  311. }
  312. .contact-seller {
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. padding: 15px 10px;
  317. margin-top: 15px;
  318. font-size: 26rpx;
  319. img {
  320. width: 35rpx;
  321. height: 35rpx;
  322. vertical-align: middle;
  323. margin-right: 10rpx;
  324. }
  325. }
  326. .order-detail-bottom {
  327. position: fixed;
  328. display: flex;
  329. justify-content: flex-end;
  330. align-items: center;
  331. bottom: 0;
  332. left: 0;
  333. height: 100rpx;
  334. background: white;
  335. width: 100%;
  336. .btn {
  337. display: flex;
  338. align-items: center;
  339. justify-content: center;
  340. height: 70rpx;
  341. border-radius: 35rpx;
  342. padding: 0px 50rpx;
  343. border: 1px solid #ccc;
  344. margin: 0px 5px;
  345. text-align: center;
  346. font-size: 26rpx;
  347. }
  348. .repurchaseBtn {
  349. border: 1px solid #ED762F;
  350. color: #ED762F;
  351. }
  352. }
  353. }
  354. </style>