buy.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view>
  3. <view class="cmain">
  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.goodsNo }}</text>
  12. </view>
  13. <view class="item">
  14. <text class="label">计价单位</text>
  15. <text class="desc">{{ item.goodsUnit }}</text>
  16. </view>
  17. <view class="item">
  18. <text class="label">发布商</text>
  19. <text class="desc">{{ item.createName }}</text>
  20. </view>
  21. <view class="item">
  22. <text class="label">发布时间</text>
  23. <text class="desc">{{ item.createTime }}</text>
  24. </view>
  25. <view class="item">
  26. <text class="label">接单人</text>
  27. <text class="desc">{{ user.name }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="mfooter">
  32. <view class="flex">
  33. <view class="f">
  34. <button class="btn" @click="pay()">立即购买</button>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. user: this.getUser(),
  45. item: {}
  46. };
  47. },
  48. onLoad(e) {
  49. if (e.item) {
  50. this.item = JSON.parse(e.item);
  51. }
  52. },
  53. methods: {
  54. pay() {
  55. uni.showModal({
  56. title: '提示',
  57. content: '我已核对订单信息无误',
  58. success: res => {
  59. if (res.confirm) {
  60. this.http.request({
  61. url: '/level-two-server/app/TbOrders/purchaserBuy',
  62. method: 'POST',
  63. data: { id: this.item.id},
  64. success: res => {
  65. uni.navigateTo({ url: '/pages/market/two/leader/success' });
  66. }
  67. });
  68. }
  69. }
  70. });
  71. }
  72. }
  73. };
  74. </script>
  75. <style lang="scss">
  76. page {
  77. background-color: $pg;
  78. }
  79. </style>