goodsDetail.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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="title-2" v-if="loading">{{ info.categoryName }} {{ info.name }}</view>
  15. <view class="name" v-if="loading">{{info.partsCode}} | {{info.factoryNumber}}</view>
  16. <view style="height: 20rpx;background: #F4F5F7;"></view>
  17. <view class="tdetail">
  18. <view class="spcx" @click="goSuit">
  19. <view class="spcxLeft">
  20. <view class="spcxTitle">适用车型</view>
  21. <view class="spcxCk">查看</view>
  22. </view>
  23. <img src="../../static/img/a28b1812de84495f7744583740df91bc.png" alt="" class="spcxjt">
  24. </view>
  25. </view>
  26. <view style="height: 20rpx;background: #F4F5F7;"></view>
  27. <view class="detail-container tdetail" v-if="info.extendDatas&&info.extendDatas.length"><!-- mt10 -->
  28. <!-- <h3 class="title-3">基本信息</h3>
  29. <p class="info-box-1 "><span class="box-title">配件品质</span> {{ info.partquality?info.partquality==='0'?'原厂件':info.partquality==='1'?'品牌件':'拆车件':'--' }}</p>
  30. <p class="info-box-1 "><span class="box-title">出厂编码</span> {{ info.factoryNumber }}</p>
  31. <p class="info-box-1 "><span class="box-title">是否OE件</span> {{ info.isoe==='1'?'是':'否' }}</p>
  32. <p class="info-box-1 "><span class="box-title">包装规格</span> {{ info.packagingSpecification }}</p>
  33. <p class="info-box-1 "><span class="box-title">产地</span> {{ info.placeProduction }}</p>
  34. <p class="info-box-1 "><span class="box-title">单位</span> {{ info.measurementUnit }}</p>
  35. <p class="info-box-1 tp1"><span class="box-title">车型备注</span> <span class="tpspan1">{{ info.modelRemark }}</span> </p> -->
  36. <view v-if="info.extendDatas&&info.extendDatas.length" class="extendDatasBox">
  37. <h3 class="title-3">规格参数</h3>
  38. <p v-for="item in info.extendDatas" :key="item.key" v-if="item.value" class="info-box-1 tp1">
  39. <span class="box-title ">{{ item.key }}</span> <span class="tpspan1"> {{ item.value }}</span>
  40. </p>
  41. </view>
  42. </view>
  43. <view style="height: 20rpx;background: #F4F5F7;"></view>
  44. <view class="detail">
  45. <view class="datailTitle">商品详情</view>
  46. <!-- <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> -->
  47. <!-- <player-component vid="f3310d4pktb"></player-component> -->
  48. <!-- <rich-text :nodes="html"></rich-text> -->
  49. <u-parse :content="html" ></u-parse>
  50. <!-- <view v-html="html"></view> -->
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import homenav from "../../components/homenav/nav.vue"
  56. import uParse from '@/components/u-parse/u-parse.vue'
  57. export default {
  58. components: {
  59. homenav,uParse
  60. },
  61. data() {
  62. return {
  63. id:'',
  64. info:'',
  65. iStatusBarHeight:'',
  66. html:'',
  67. loading:false,
  68. }
  69. },
  70. onLoad(opt) {
  71. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  72. this.id=opt.id;
  73. this.queryPartDetail()
  74. },
  75. methods: {
  76. goSuit(){
  77. uni.navigateTo({
  78. url:'suit?id='+this.id
  79. })
  80. },
  81. queryPartDetail(){
  82. uni.showLoading({ title: '加载中'});
  83. this.loading=false;
  84. this.$http('partsByOpen/queryPartDetail', {
  85. id:this.id,
  86. },'POST').then(res => {
  87. this.loading=true;
  88. uni.hideLoading();
  89. this.info=res.data;
  90. this.html = this.info.ozContent
  91. this.html = this.html.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
  92. this.html = this.html.replace(/\<iframe/gi, '<video style="width:750rpx;" ');
  93. this.html = this.html.replace(/\<\/iframe/gi, '</video');
  94. console.log(this.html)
  95. })
  96. },
  97. showImgList(img){
  98. var arr=[]
  99. arr.push(img)
  100. uni.previewImage({
  101. urls: arr,
  102. longPressActions: {
  103. itemList: ['发送给朋友', '保存图片'],
  104. success: function(data) {
  105. console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  106. },
  107. fail: function(err) {
  108. console.log(err.errMsg);
  109. }
  110. }
  111. });
  112. }
  113. },
  114. }
  115. </script>
  116. <style scoped>
  117. .tdetail{
  118. padding: 24rpx;
  119. }
  120. .swiper-itemImg{
  121. width: 750rpx;
  122. height: 750rpx;
  123. }
  124. .uni-margin-wrap{
  125. height: 750rpx;
  126. }
  127. .swiper{
  128. height: 750rpx;
  129. }
  130. .datailTitle{
  131. font-weight: 500;
  132. color: #1A1A1A;
  133. line-height: 40rpx;
  134. padding: 32rpx 24rpx;
  135. font-size: 28rpx;
  136. }
  137. .name{
  138. font-weight: 400;
  139. color: #999999;
  140. line-height: 40rpx;
  141. font-size: 28rpx;
  142. padding: 20rpx 24rpx;
  143. padding-top: 5rpx;
  144. }
  145. .detail img{
  146. width: 750rpx;
  147. }
  148. .detail image{
  149. width: 750rpx;
  150. }
  151. /deep/ video{
  152. width: 750rpx;
  153. }
  154. .title-2{
  155. font-size:30rpx;
  156. font-weight:500;
  157. color:#333333;
  158. padding: 0 24rpx;
  159. padding-top: 16rpx;
  160. }
  161. .spcxLeft{
  162. display: flex;line-height: 30rpx;
  163. }
  164. .spcxCk{
  165. font-weight: 400;
  166. color: #1A1A1A;
  167. padding-left: 24rpx;
  168. }
  169. .spcxTitle{
  170. font-size: 28rpx;
  171. font-weight: 500;
  172. color: #1A1A1A;
  173. }
  174. .spcxjt{
  175. width: 20rpx;height: 20rpx;
  176. margin-top: 10rpx;
  177. }
  178. .spcx{
  179. display: flex;color: #333333;font-size: 24rpx;
  180. justify-content: space-between;
  181. }
  182. .title-3{
  183. font-size:28rpx;
  184. font-weight:500;
  185. color: #1A1A1A;
  186. }
  187. .info-box-1{
  188. font-size:24rpx;
  189. font-weight:400;
  190. color:#1A1A1A;
  191. padding-top: 20rpx;
  192. display: inline-block;
  193. width: 100%;
  194. }
  195. .box-title{
  196. color: #999999;
  197. width: 140rpx;
  198. display: inline-block;
  199. }
  200. .extendDatasBox{
  201. /* padding-top: 24rpx; */
  202. }
  203. </style>