goodsDetail.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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="name" v-if="loading">{{info.name}} | {{info.specificationModel}} | {{info.partsCode}}</view>
  15. <view style="height: 30rpx;background: #F4F5F7;"></view>
  16. <view class="detail">
  17. <view class="datailTitle">商品详情</view>
  18. <!-- <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> -->
  19. <!-- <player-component vid="f3310d4pktb"></player-component> -->
  20. <!-- <rich-text :nodes="html"></rich-text> -->
  21. <u-parse :content="html" ></u-parse>
  22. <!-- <view v-html="html"></view> -->
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import homenav from "../../components/homenav/nav.vue"
  28. import uParse from '@/components/u-parse/u-parse.vue'
  29. export default {
  30. components: {
  31. homenav,uParse
  32. },
  33. data() {
  34. return {
  35. id:'',
  36. info:'',
  37. iStatusBarHeight:'',
  38. html:'',
  39. loading:false,
  40. }
  41. },
  42. onLoad(opt) {
  43. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  44. this.id=opt.id;
  45. this.queryPartDetail()
  46. },
  47. methods: {
  48. queryPartDetail(){
  49. uni.showLoading({ title: '加载中'});
  50. this.loading=false;
  51. this.$http('partsByOpen/queryPartDetail', {
  52. id:this.id,
  53. },'POST').then(res => {
  54. this.loading=true;
  55. uni.hideLoading();
  56. this.info=res.data;
  57. this.html = this.info.ozContent
  58. this.html = this.html.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
  59. this.html = this.html.replace(/\<iframe/gi, '<video style="width:750rpx;" ');
  60. this.html = this.html.replace(/\<\/iframe/gi, '</video');
  61. console.log(this.html)
  62. })
  63. },
  64. showImgList(img){
  65. var arr=[]
  66. arr.push(img)
  67. uni.previewImage({
  68. urls: arr,
  69. longPressActions: {
  70. itemList: ['发送给朋友', '保存图片'],
  71. success: function(data) {
  72. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  73. },
  74. fail: function(err) {
  75. console.log(err.errMsg);
  76. }
  77. }
  78. });
  79. }
  80. },
  81. }
  82. </script>
  83. <style scoped>
  84. .swiper-itemImg{
  85. width: 750rpx;
  86. height: 750rpx;
  87. }
  88. .uni-margin-wrap{
  89. height: 750rpx;
  90. }
  91. .swiper{
  92. height: 750rpx;
  93. }
  94. .datailTitle{
  95. font-weight: 500;
  96. color: #1A1A1A;
  97. line-height: 40rpx;
  98. padding: 32rpx 24rpx;
  99. font-size: 28rpx;
  100. }
  101. .name{
  102. font-weight: 500;
  103. color: #1A1A1A;
  104. line-height: 40rpx;
  105. font-size: 28rpx;
  106. padding: 30rpx 24rpx;
  107. }
  108. .detail img{
  109. width: 750rpx;
  110. }
  111. .detail image{
  112. width: 750rpx;
  113. }
  114. /deep/ video{
  115. width: 750rpx;
  116. }
  117. </style>