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