goodsDetail.vue 4.5 KB

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