detailsWorn.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view>
  3. <!-- 图片及其他 -->
  4. <view class="imgAndOther">
  5. <view class="wrap">
  6. <u-swiper @click="upImg" height="450" :effect3d="true" :list="imgArr"></u-swiper>
  7. </view>
  8. <!-- 其他 -->
  9. <view class="other_box">
  10. <view class="other_boxLeft">
  11. <view class="other_boxLeft_name">
  12. {{ redata.name }}
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <!-- 详情列表 -->
  18. <view class="details_ul">
  19. <view class="details_list" v-if="item !== ''" v-for="item in redata.list">
  20. <view class="details_txtBox">
  21. <view class="details_txtBox_main">
  22. {{ item }}
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 弹框提示 -->
  28. <u-top-tips ref="uTips"></u-top-tips>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. redata: {},
  36. txtArr: [], //内容
  37. imgArr: [],
  38. }
  39. },
  40. methods: {
  41. information() {
  42. var centerTxt = this.redata.prevention
  43. var b = centerTxt.replace(/]/g, ":")
  44. var Adata = new Array();
  45. Adata = b.split("[");
  46. var arr = []
  47. for (var i = 0; i < Adata.length; i++) {
  48. if (Adata[i] !== '') {
  49. var obj = {}
  50. var index = Adata[i].lastIndexOf(':')
  51. obj['title']= Adata[i].substring(0, index)
  52. obj['txt']= Adata[i].substring(index + 1, obj.length)
  53. arr.push(obj)
  54. }
  55. }
  56. this.txtArr = arr
  57. },
  58. // 轮播图点击事件
  59. upImg(index) {
  60. var img = []
  61. img.push(this.imgArr[index])
  62. uni.previewImage({
  63. urls: img,
  64. })
  65. },
  66. },
  67. onLoad(options) {
  68. var data = JSON.parse(options.data)
  69. this.imgArr.push(data.img_ulrs)
  70. this.redata = data
  71. console.log(data)
  72. // this.information() //详情数据处理
  73. },
  74. }
  75. </script>
  76. <style lang="scss">
  77. page {
  78. background: #f7f8fc;
  79. padding: 25rpx 0 25rpx 0;
  80. }
  81. // 顶部导航左图标
  82. .navTopLeftIcon {
  83. width: 50rpx;
  84. height: 50rpx;
  85. margin: 0 0 0 25rpx;
  86. }
  87. // 顶部导航右
  88. .navRight {
  89. position: absolute;
  90. top: 23rpx;
  91. right: 18rpx;
  92. .navTopRigthIcon {
  93. width: 40rpx;
  94. height: 40rpx;
  95. }
  96. text {
  97. width: 100rpx;
  98. font-size: 13px;
  99. color: #fff;
  100. display: inline-block;
  101. text-overflow: ellipsis;
  102. }
  103. }
  104. // 图片及其他
  105. .imgAndOther {
  106. background: #fff;
  107. margin: -26rpx 0 0 0;
  108. // 图片
  109. .imgAndOther_img {
  110. display: block;
  111. margin: 0 auto;
  112. width: 730rpx;
  113. height: 450rpx;
  114. border-radius: 5px;
  115. }
  116. }
  117. // 其他
  118. .other_box {
  119. display: flex;
  120. justify-content: space-between;
  121. padding-bottom: 25rpx;
  122. width: 730rpx;
  123. margin: 25rpx auto;
  124. .other_boxLeft {
  125. display: flex;
  126. .other_boxLeft_name {
  127. font-size: 18px;
  128. font-weight: 550;
  129. color: #545454;
  130. }
  131. .other_boxLeft_subject {
  132. color: #9f9f9f;
  133. font-size: 13px;
  134. line-height: 52rpx;
  135. margin: 0 0 0 15rpx;
  136. }
  137. }
  138. .other_boxRight {
  139. button {
  140. margin: 0 5rpx 0 15rpx;
  141. }
  142. }
  143. }
  144. // 详情列表
  145. .details_ul {
  146. // border: 1px solid #000;
  147. .details_list {
  148. background: #fff;
  149. padding: 15rpx;
  150. margin: 15rpx 0 0 0;
  151. .details_txtBox {
  152. .details_txtBox_tlt {
  153. font-size: 16px;
  154. font-weight: 550;
  155. margin: 0 0 10rpx 0;
  156. }
  157. .details_txtBox_main {
  158. color: #868686;
  159. font-size: 13px;
  160. font-weight: 530;
  161. line-height: 40rpx;
  162. }
  163. }
  164. }
  165. }
  166. </style>