buyWhole.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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">{{ item.veNo }}</text>
  8. </view>
  9. <view class="item">
  10. <text class="label">商品</text>
  11. <text class="desc omit">{{ item.goodsNames }}</text>
  12. </view>
  13. <view class="item">
  14. <text class="label">数量</text>
  15. <text class="desc omit">{{ item.packNo }}</text>
  16. </view>
  17. <view class="item">
  18. <text class="label">店主</text>
  19. <text class="desc">{{ item.shopName }}</text>
  20. </view>
  21. <view class="item">
  22. <text class="label">互市区</text>
  23. <text class="desc">{{ item.fieldName }}</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 price">¥ {{ item.sumUpPrice }}</text>
  32. </view>
  33. </view>
  34. </view>
  35. <view style="height: 80px;"></view>
  36. <view class="mfooter">
  37. <view class="flex">
  38. <view class="total-price price">¥{{totalPrice}}</view>
  39. <view class="f">
  40. <button class="btn" @click="pay()">立即购买</button>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. user: this.getUser(),
  51. list: [],
  52. ids: ''
  53. };
  54. },
  55. onLoad(e) {
  56. if (e.ids) {
  57. this.ids = e.ids;
  58. this.http.request({
  59. url: '/level-one-server/app/HtTradeSettlement/getByIds',
  60. method: 'POST',
  61. data: {
  62. ids: this.ids
  63. },
  64. success: res => {
  65. this.list = res.data.data;
  66. }
  67. });
  68. }
  69. },
  70. computed: {
  71. totalPrice() {
  72. let list = this.list;
  73. let total = 0;
  74. list.map(item => total = Number(item.sumUpPrice) + Number(total));
  75. return Math.round(total * 100) / 100;
  76. }
  77. },
  78. methods: {
  79. pay() {
  80. uni.showModal({
  81. title: '提示',
  82. content: '我已核对订单信息无误',
  83. success: res => {
  84. if (res.confirm) {
  85. this.http.request({
  86. url: '/level-two-server/app/TbOrders/purchaserBuyWhole',
  87. method: 'POST',
  88. data: {
  89. ids: this.ids
  90. },
  91. success: res => {
  92. console.log(res);
  93. return;
  94. uni.redirectTo({
  95. url: '/pages/market/two/leader/success'
  96. });
  97. }
  98. });
  99. }
  100. }
  101. });
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="scss">
  107. page {
  108. background-color: $pg;
  109. }
  110. .price {
  111. color: red;
  112. font-weight: bold;
  113. }
  114. .total-price {
  115. line-height: 66px;
  116. padding: 0 0 0 10px;
  117. font-size: 18px;
  118. }
  119. </style>