detail.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view>
  3. <view class="product_detail">
  4. <image src="../../../static/news.jpg" mode="widthFix" class="pic"></image>
  5. <view class="box">
  6. <view class="title">{{ item.goodsName }}</view>
  7. <view class="clear"></view>
  8. <u-divider text="规格参数"></u-divider>
  9. <view class="item">
  10. <text class="desc">商品价格:</text>
  11. <text>{{ item.resalePrice }}</text>
  12. <view class="clear"></view>
  13. </view>
  14. <view class="item">
  15. <text class="desc">车牌号:</text>
  16. <text>{{ item.veNo }}</text>
  17. <view class="clear"></view>
  18. </view>
  19. <view class="item">
  20. <text class="desc">发布商:</text>
  21. <text>{{ item.createName }}</text>
  22. </view>
  23. <view class="item">
  24. <text class="desc">互市区:</text>
  25. <text>{{ item.tradeAreaName }}</text>
  26. <view class="clear"></view>
  27. </view>
  28. <view class="item">
  29. <text class="desc">发布时间:</text>
  30. <text>{{ item.createTime }}</text>
  31. <view class="clear"></view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="mfooter">
  36. <view class="flex">
  37. <view class="f">
  38. <button class="btn" v-if="user.userType == 3" @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. item: {},
  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. let data = res.data.data;
  62. this.item = data[0];
  63. }
  64. });
  65. }
  66. },
  67. methods: {
  68. pay() {
  69. uni.showModal({
  70. title: '提示',
  71. content: '我已核对订单信息无误',
  72. success: res => {
  73. if (res.confirm) {
  74. this.http.request({
  75. url: '/level-two-server/app/TbOrders/purchaserBuy',
  76. method: 'POST',
  77. data: { ids: this.orderIds},
  78. success: res => {
  79. uni.navigateTo({ url: '/pages/market/two/leader/success' });
  80. }
  81. });
  82. }
  83. }
  84. });
  85. }
  86. }
  87. };
  88. </script>
  89. <style lang="scss">
  90. page {
  91. background-color: $pg;
  92. }
  93. </style>