goodsDetail.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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}} | {{info.partsCode}}</view>
  15. <view class="goodsMs">附属型号:{{info.factoryNumber}}</view>
  16. <view class="goodsMs">电池型号:{{info.specificationModel}}</view>
  17. <view class="goodsMs">系列:{{info.GeneralpurposeName}} <span class="englishname" v-if="info.englishname">{{info.englishname}}</span> </view>
  18. <view class="goodsMs">适用车型:{{info.carmodelremark}}</view>
  19. <view style="height: 30rpx;background: #F4F5F7;" v-if="html"></view>
  20. <view class="detail" v-if="html">
  21. <view class="datailTitle">商品详情</view>
  22. <!-- <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> -->
  23. <!-- <player-component vid="f3310d4pktb"></player-component> -->
  24. <!-- <rich-text :nodes="html"></rich-text> -->
  25. <u-parse :content="html" ></u-parse>
  26. <!-- <view v-html="html"></view> -->
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import homenav from "../../components/homenav/nav.vue"
  32. import uParse from '@/components/u-parse/u-parse.vue'
  33. export default {
  34. components: {
  35. homenav,uParse
  36. },
  37. data() {
  38. return {
  39. id:'',
  40. info:'',
  41. iStatusBarHeight:'',
  42. html:'',
  43. loading:false,
  44. }
  45. },
  46. onLoad(opt) {
  47. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  48. this.id=opt.id;
  49. this.queryPartDetail()
  50. },
  51. methods: {
  52. queryPartDetail(){
  53. uni.showLoading({ title: '加载中'});
  54. this.loading=false;
  55. this.$http('partsByOpen/queryPartDetail', {
  56. id:this.id,
  57. },'POST').then(res => {
  58. this.loading=true;
  59. uni.hideLoading();
  60. this.info=res.data;
  61. this.html = this.info.ozContent
  62. this.html = this.html.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
  63. this.html = this.html.replace(/\<iframe/gi, '<video style="width:750rpx;" ');
  64. this.html = this.html.replace(/\<\/iframe/gi, '</video');
  65. console.log(this.html)
  66. })
  67. },
  68. showImgList(img){
  69. var arr=[]
  70. arr.push(img)
  71. uni.previewImage({
  72. urls: arr,
  73. longPressActions: {
  74. itemList: ['发送给朋友', '保存图片'],
  75. success: function(data) {
  76. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  77. },
  78. fail: function(err) {
  79. console.log(err.errMsg);
  80. }
  81. }
  82. });
  83. }
  84. },
  85. }
  86. </script>
  87. <style scoped>
  88. .swiper-itemImg{
  89. width: 750rpx;
  90. height: 750rpx;
  91. }
  92. .uni-margin-wrap{
  93. height: 750rpx;
  94. }
  95. .swiper{
  96. height: 750rpx;
  97. }
  98. .datailTitle{
  99. font-weight: 500;
  100. color: #1A1A1A;
  101. line-height: 40rpx;
  102. padding: 32rpx 24rpx;
  103. font-size: 28rpx;
  104. }
  105. .name{
  106. font-weight: 500;
  107. color: #1A1A1A;
  108. line-height: 40rpx;
  109. font-size: 28rpx;
  110. padding: 30rpx 24rpx;
  111. }
  112. .detail img{
  113. width: 750rpx;
  114. }
  115. .detail image{
  116. width: 750rpx;
  117. }
  118. /deep/ video{
  119. width: 750rpx;
  120. }
  121. .goodsMs{
  122. padding: 15rpx 24rpx;
  123. font-size: 26rpx;
  124. color: #222222;
  125. }
  126. .englishname{
  127. padding: 0 6rpx;
  128. border-radius: 8rpx;
  129. border:1px solid #254A90;
  130. margin-left: 10rpx;
  131. display: inline-block;
  132. }
  133. </style>