product.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="pages">
  3. <view class="swiper-wrap">
  4. <swiper class="swiper"
  5. :indicator-dots="swiper.indicatorDots"
  6. :indicator-color="swiper.indicatorColor"
  7. :indicator-active-color="swiper.indicatorActiveColor"
  8. :autoplay="swiper.autoplay"
  9. :interval="swiper.interval" :duration="swiper.duration">
  10. <swiper-item v-for="(item, index) in bannerList" :key="index">
  11. <view class="adv-item" @click="swiperClick"><image :src="'http://cqth.hw.hongweisoft.com/ht/' +item" class="pic" mode="scaleToFill"></image></view>
  12. </swiper-item>
  13. </swiper>
  14. </view>
  15. <view class="goods-name">
  16. <view class="name">{{product.goodsName ||'重庆市渝中区解放碑街道民生路成片林'}}</view>
  17. <view class="type">类别:{{product.goodsType || "T001"}}</view>
  18. </view>
  19. <view class="goods-base-info padding24">
  20. <view class="goods-base-info-item">产品编号:{{product.goodsCode || 'G0119000000000005468'}}</view>
  21. <view class="goods-base-info-item">认购期:{{time}}</view>
  22. <view class="goods-base-info-item">预估总释放量:{{product.carbonVal || "49330"}}kg</view>
  23. <view class="goods-price">
  24. <text class="rmb">¥</text>
  25. <text class="price">{{product.price || "3.00"}}/kg</text>
  26. </view>
  27. </view>
  28. <view class="main-body">
  29. <view class="main-body-til">
  30. <view class="til">碳汇研发主体</view>
  31. <view class="con">
  32. <text>青龙村</text>
  33. <text class="iconfont icon-jiantou"></text>
  34. </view>
  35. </view>
  36. <view class="main-body-info">
  37. <image :src="$getimg+'home-buy-now-img.png'" class="main-body-info-img" mode="scaleToFill"></image>
  38. <view class="main-body-info-text">
  39. <view class="text-item">
  40. <text class="text">家庭成员:5人</text>
  41. <text class="text">涉及产品数:3</text>
  42. </view>
  43. <view class="main-body-info-text">地址:重庆市渝中区解放碑街道民生路</view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="main-body product-info">
  48. <view class="main-body-til">
  49. <view class="til">产品信息</view>
  50. </view>
  51. <view class="main-body-info">
  52. <view class="product-info-item">
  53. 产品类型:
  54. </view>
  55. <view class="product-info-item">
  56. 村小组:
  57. </view>
  58. <view class="product-info-item">
  59. 造林主体:
  60. </view>
  61. <view class="product-info-item">
  62. 小地名:
  63. </view>
  64. </view>
  65. </view>
  66. <view class="bottom-btn-wrap">
  67. <view class="bottom-btn-wrap-bg">
  68. <view class="bottom-btn btn">
  69. 立即购碳
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. $getimg:this.$getimg,
  80. token:this.config.testToken,
  81. params:{
  82. goodsId:'',
  83. },
  84. bannerList:[],
  85. swiper: {
  86. indicatorDots: true,
  87. autoplay: true,
  88. interval: 9000,
  89. duration: 500,
  90. indicatorColor:"rgba(255, 255, 255, 0.7)",
  91. indicatorActiveColor:"rgba(255, 255, 255, 1)",
  92. },
  93. product:[],
  94. time:'2020',
  95. }
  96. },
  97. onShow() {
  98. },
  99. onLoad(option) {
  100. console.log('option',option);
  101. this.params.goodsId = option.guid;
  102. this.getdetails();
  103. },
  104. methods: {
  105. getdetails(){
  106. this.$api.http.get(this.config.apiBaseurl + '/carbon-h5/wap/goods/getById?goodsId='+this.params.goodsId,{
  107. header: {
  108. Accept:'application/json',
  109. Authorization: 'Bearer '+ this.token, //注意Bearer后面有一空格
  110. },
  111. }).then(res => {
  112. this.bannerList = res.data.retBody.goodsImages.split(';');
  113. this.product = res.data.retBody;
  114. console.log('res',JSON.parse(JSON.stringify(res.data.retBody)));
  115. }).catch(err =>{
  116. console.log('err',err)
  117. });
  118. },
  119. }
  120. }
  121. </script>
  122. <style>
  123. @import url("./product.css");
  124. </style>