goodsDetail.vue 4.0 KB

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