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.

142 lines
3.1 KiB

10 months ago
  1. <template>
  2. <view class="repurchase">
  3. <u-navbar :title="$t('page.repurchase.repurchase')" @rightClick="rightClick"
  4. @leftClick="leftClick()"></u-navbar>
  5. <view class="product-list">
  6. <orderProductListVue :product="orderInfo"></orderProductListVue>
  7. </view>
  8. <div class="price-count">
  9. <text>{{ $t('page.repurchase.totalPrice') }}</text>
  10. <text>{{ $t('$') + orderInfo.price }}</text>
  11. </div>
  12. <u--form labelPosition="left" :model="model1" :rules="rules" class="line" ref="uForm">
  13. <u-form-item :label="$t('page.productDetail.payOrder.pay-password')" prop="payPassword" borderBottom
  14. labelWidth="80px">
  15. <u--input v-model="model1.payPassword" type="password"
  16. :placeholder="$t('page.productDetail.payOrder.pay-input-placeholder')"></u--input>
  17. </u-form-item>
  18. </u--form>
  19. <u-button @click="submit()" type="primary" :text="$t('page.repurchase.repurchaseNow')"
  20. shape="circle"></u-button>
  21. </view>
  22. </template>
  23. <script>
  24. import orderProductListVue from '../../components/order-product/orderProductList.vue'
  25. export default {
  26. components: {
  27. orderProductListVue,
  28. },
  29. data() {
  30. return {
  31. productList: [{
  32. productName: 'Huawei Enjoy 70/ ProHuaweiPro/Huawei',
  33. price: '1236.00',
  34. num: 1
  35. }],
  36. model1: {
  37. payPassword: ''
  38. },
  39. rules: {
  40. 'payPassword': {
  41. type: 'string',
  42. required: true,
  43. message: this.$t('page.productDetail.payOrder.pay-input-placeholder'),
  44. trigger: ['blur', 'change']
  45. },
  46. },
  47. orderInfo: {}
  48. }
  49. },
  50. onShow() {
  51. this.getOrderDetail();
  52. },
  53. methods: {
  54. leftClick() {
  55. uni.navigateTo({
  56. url: '/pages/orderDetail/orderDetail?id=' + this.$route.query.id
  57. })
  58. },
  59. toPay() { //支付
  60. uni.redirectTo({
  61. url: '/pages/payOrder/payOrder'
  62. })
  63. },
  64. getOrderDetail() { //获取订单详情
  65. this.request("getOrderOne", {}, {
  66. id: this.$route.query.id
  67. }).then(res => {
  68. this.orderInfo = res.result;
  69. })
  70. },
  71. submit() {
  72. this.$refs.uForm.validate().then(res => {
  73. this.request("return", {
  74. id: this.$route.query.id,
  75. money: this.orderInfo.price,
  76. payPass: this.model1.payPassword
  77. }).then(res => {
  78. if (res.code == 200) {
  79. this.$u.toast(this.$t('page.repurchase.repurchase-now-succes'));
  80. setTimeout(() => {
  81. uni.switchTab({
  82. url: '/pages/order/order'
  83. })
  84. }, 500)
  85. }
  86. })
  87. })
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .repurchase {
  94. box-sizing: border-box;
  95. &::v-deep .product-list {
  96. margin-top: 54px;
  97. .order-body {
  98. background: white;
  99. .selling-price {
  100. color: black !important;
  101. }
  102. }
  103. }
  104. .price-count {
  105. height: 50px;
  106. line-height: 50px;
  107. background: white;
  108. padding: 0px 20px;
  109. text {
  110. &:nth-child(2) {
  111. color: #666;
  112. margin-left: 10px;
  113. }
  114. }
  115. }
  116. .u-button {
  117. height: 45px;
  118. margin-top: 15px;
  119. background: linear-gradient(to right, #ff7601, #ff4901);
  120. border: none;
  121. }
  122. .line {
  123. background-color: #fff;
  124. padding: 10px;
  125. margin-top: 10px;
  126. .celi {
  127. background-color: #F8F8F8;
  128. border-radius: 10px;
  129. margin: 10px 0;
  130. }
  131. }
  132. }
  133. </style>