goodsDetail.vue 4.7 KB

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