buy.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view>
  3. <view class="cmain" v-for="(item,index) in list">
  4. <view class="box order_detail">
  5. <view class="item">
  6. <text class="label">收购商品</text>
  7. <text class="desc omit">{{ item.goodsName }}</text>
  8. </view>
  9. <view class="item">
  10. <text class="label">商品价格</text>
  11. <text class="desc">{{ item.resalePrice }}</text>
  12. </view>
  13. <view class="item">
  14. <text class="label">车牌号</text>
  15. <text class="desc">{{ item.veNo }}</text>
  16. </view>
  17. <view class="item">
  18. <text class="label">接单人</text>
  19. <text class="desc">{{ user.name }}</text>
  20. </view>
  21. <view class="item">
  22. <text class="label">发布商</text>
  23. <text class="desc">{{ item.createName }}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">发布时间</text>
  27. <text class="desc">{{ item.createTime }}</text>
  28. </view>
  29. <view class="item">
  30. <text class="label">互市区</text>
  31. <text class="desc">{{ item.tradeAreaName }}</text>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="mfooter">
  36. <view class="flex">
  37. <view class="f">
  38. <button class="btn" @click="pay()">立即购买</button>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. user: this.getUser(),
  49. list: [],
  50. orderIds: ''
  51. };
  52. },
  53. onLoad(e) {
  54. if (e.orderId) {
  55. this.orderIds = e.orderId;
  56. this.http.request({
  57. url: '/level-two-server/app/TbOrders/getDetailById',
  58. method: 'POST',
  59. data: { ids: this.orderIds},
  60. success: res => {
  61. this.list = res.data.data;
  62. }
  63. });
  64. }
  65. },
  66. methods: {
  67. pay() {
  68. uni.showModal({
  69. title: '提示',
  70. content: '我已核对订单信息无误',
  71. success: res => {
  72. if (res.confirm) {
  73. this.http.request({
  74. url: '/level-two-server/app/TbOrders/purchaserBuy',
  75. method: 'POST',
  76. data: { ids: this.orderIds},
  77. success: res => {
  78. uni.redirectTo({url:'/pages/market/two/leader/success'});
  79. }
  80. });
  81. }
  82. }
  83. });
  84. }
  85. }
  86. };
  87. </script>
  88. <style lang="scss">
  89. page {
  90. background-color: $pg;
  91. }
  92. </style>