goodsDetail.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="content">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'商品详情'"></homenav>
  4. <view class="uni-margin-wrap">
  5. <swiper class="swiper" circular :indicator-dots="true" :autoplay="false" :interval="3000"
  6. :duration="duration" indicator-active-color="rgba(0, 0, 0, .3)" indicator-color="#EAEAEA">
  7. <swiper-item v-for="(item,index) in info.imgList">
  8. <view class="swiper-item">
  9. <image @click="showImgList(item.imgPath)" :src="item.imgPath" mode="aspectFit" class="swiper-itemImg"></image>
  10. </view>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. <view class="name" v-if="loading">{{info.name}} | {{info.specificationModel}} </view>
  15. <view style="height: 30rpx;background: #F4F5F7;"></view>
  16. <view class="detail">
  17. <view class="datailTitle">商品详情</view>
  18. <!-- <video style="width:750rpx;" class="edui-faked-video twtcs" src="https://66km.oss-cn-beijing.aliyuncs.com/yanghuziliao/shachepan/%E6%AC%A7%E6%B4%B2%E7%BB%B4%E4%BF%AE%E5%88%B9%E8%BD%A6%E7%9B%98%E7%89%87%E6%A0%87%E5%87%86%E6%9B%B4%E6%8D%A2SOP%E6%B5%81%E7%A8%8B.mp4" width="420" height="280" enable-danmu danmu-btn controls></video> -->
  19. <!-- <player-component vid="f3310d4pktb"></player-component> -->
  20. <!-- <rich-text :nodes="html"></rich-text> -->
  21. <!-- <view v-html="html"></view> -->
  22. <view class="contLine">
  23. 出厂编码: {{ info.factoryNumber }}
  24. </view>
  25. <view class="contLine">
  26. 包装规格: {{ info.packagingSpecification }}
  27. </view>
  28. <view class="contLine">
  29. 单位: {{ info.measurementUnit }}
  30. </view>
  31. <view class="contLine">
  32. 车型备注: {{ info.modelRemark }}
  33. </view>
  34. <u-parse :content="html" ></u-parse>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import homenav from "../../components/homenav/nav.vue"
  40. import uParse from '@/components/u-parse/u-parse.vue'
  41. export default {
  42. components: {
  43. homenav,uParse
  44. },
  45. data() {
  46. return {
  47. id:'',
  48. info:'',
  49. iStatusBarHeight:'',
  50. html:'',
  51. loading:false,
  52. }
  53. },
  54. onLoad(opt) {
  55. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  56. this.id=opt.id;
  57. this.queryPartDetail()
  58. },
  59. methods: {
  60. queryPartDetail(){
  61. uni.showLoading({ title: '加载中'});
  62. this.loading=false;
  63. this.$http('partsByOpen/queryPartDetail', {
  64. id:this.id,
  65. },'POST').then(res => {
  66. this.loading=true;
  67. uni.hideLoading();
  68. this.info=res.data;
  69. this.html = this.info.ozContent
  70. this.html = this.html.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
  71. this.html = this.html.replace(/\<iframe/gi, '<video style="width:750rpx;" ');
  72. this.html = this.html.replace(/\<\/iframe/gi, '</video');
  73. console.log(this.html)
  74. })
  75. },
  76. showImgList(img){
  77. var arr=[]
  78. arr.push(img)
  79. uni.previewImage({
  80. urls: arr,
  81. longPressActions: {
  82. itemList: ['发送给朋友', '保存图片'],
  83. success: function(data) {
  84. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  85. },
  86. fail: function(err) {
  87. console.log(err.errMsg);
  88. }
  89. }
  90. });
  91. }
  92. },
  93. }
  94. </script>
  95. <style scoped>
  96. .swiper-itemImg{
  97. width: 750rpx;
  98. height: 750rpx;
  99. }
  100. .uni-margin-wrap{
  101. height: 750rpx;
  102. }
  103. .swiper{
  104. height: 750rpx;
  105. }
  106. .datailTitle{
  107. font-weight: 500;
  108. color: #1A1A1A;
  109. line-height: 40rpx;
  110. padding: 32rpx 24rpx;
  111. font-size: 28rpx;
  112. }
  113. .name{
  114. font-weight: 500;
  115. color: #1A1A1A;
  116. line-height: 40rpx;
  117. font-size: 28rpx;
  118. padding: 30rpx 24rpx;
  119. }
  120. .detail img{
  121. width: 750rpx;
  122. }
  123. .detail image{
  124. width: 750rpx;
  125. }
  126. /deep/ video{
  127. width: 750rpx;
  128. }
  129. .contLine{
  130. font-size: 26rpx;
  131. color: #666;
  132. padding: 10rpx 24rpx;
  133. }
  134. </style>