goodsDetail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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: 740rpx;
  93. height: 740rpx;
  94. border: 1px solid #eaeaea;
  95. }
  96. .swiper-item{
  97. text-align: center;
  98. }
  99. .uni-margin-wrap{
  100. height: 750rpx;
  101. }
  102. .swiper{
  103. height: 750rpx;
  104. }
  105. .datailTitle{
  106. font-weight: 500;
  107. color: #1A1A1A;
  108. line-height: 40rpx;
  109. padding: 32rpx 24rpx;
  110. font-size: 28rpx;
  111. }
  112. .name{
  113. font-weight: 500;
  114. color: #254A90;
  115. line-height: 40rpx;
  116. font-size: 28rpx;
  117. padding: 20rpx 24rpx;
  118. padding-bottom: 6rpx;
  119. }
  120. .detail img{
  121. width: 750rpx;
  122. }
  123. .detail image{
  124. width: 750rpx;
  125. }
  126. /deep/ video{
  127. width: 750rpx;
  128. }
  129. .goodsMs{
  130. padding: 10rpx 24rpx;
  131. font-size: 26rpx;
  132. color: #222222;
  133. display: flex;
  134. }
  135. .englishname{
  136. padding: 0 6rpx;
  137. border-radius: 8rpx;
  138. /* border:1px solid #254A90; */
  139. margin-left: 10rpx;
  140. display: inline-block;
  141. background: #254A90;
  142. color: #ffffff;
  143. font-size: 22rpx;
  144. }
  145. .msBox{
  146. background: #F8F8F8;
  147. padding-bottom: 10rpx;
  148. margin-top: 16rpx;
  149. }
  150. .dian{
  151. display: inline-block;
  152. width: 10rpx;
  153. height: 10rpx;
  154. background: #A3A3A3;
  155. border-radius: 6rpx;
  156. margin-top: 14rpx;
  157. margin-right: 6rpx;
  158. }
  159. </style>