buy.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.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. list: [],
  46. orderIds: ''
  47. };
  48. },
  49. onLoad(e) {
  50. if (e.orderId) {
  51. this.orderIds = e.orderId;
  52. this.http.request({
  53. url: '/level-two-server/app/TbOrders/getDetailById',
  54. method: 'POST',
  55. data: { ids: this.orderIds},
  56. success: res => {
  57. this.list = res.data.data;
  58. }
  59. });
  60. }
  61. },
  62. methods: {
  63. pay() {
  64. uni.showModal({
  65. title: '提示',
  66. content: '我已核对订单信息无误',
  67. success: res => {
  68. if (res.confirm) {
  69. this.http.request({
  70. url: '/level-two-server/app/TbOrders/purchaserBuy',
  71. method: 'POST',
  72. data: { ids: this.orderIds},
  73. success: res => {
  74. uni.redirectTo({url:'/pages/market/two/leader/success'});
  75. }
  76. });
  77. }
  78. }
  79. });
  80. }
  81. }
  82. };
  83. </script>
  84. <style lang="scss">
  85. page {
  86. background-color: $pg;
  87. }
  88. </style>