detail.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.goodsNo }}</text>
  12. <view class="clear"></view>
  13. </view>
  14. <view class="item">
  15. <text class="desc">计量单位:</text>
  16. <text>{{ item.goodsUnit }}</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. };
  51. },
  52. onLoad(e) {
  53. if (e.item) {
  54. this.item = JSON.parse(e.item);
  55. }
  56. },
  57. methods: {
  58. pay() {
  59. uni.showModal({
  60. title: '提示',
  61. content: '我已核对订单信息无误',
  62. success: res => {
  63. if (res.confirm) {
  64. this.http.request({
  65. url: '/level-two-server/app/TbOrders/purchaserBuy',
  66. method: 'POST',
  67. data: { id: this.item.id},
  68. success: res => {
  69. uni.navigateTo({ url: '/pages/market/two/leader/success' });
  70. }
  71. });
  72. }
  73. }
  74. });
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="scss">
  80. page {
  81. background-color: $pg;
  82. }
  83. </style>