cpzq.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="content">
  3. <view class="" style="height: 20rpx;">
  4. </view>
  5. <view class="jj-tit" v-if="gsjjList.length > 0">
  6. <view class="left">
  7. <image src="../../static/icon/gsjj.png" mode="" class="jj-log"></image>
  8. <view class="jj-title">
  9. 公司简介
  10. </view>
  11. </view>
  12. <!-- <view class="right" @click="navto('/pages/index/artList?cid=1')">
  13. <view class="jj-more-tit">
  14. 更多
  15. </view>
  16. <image src="../../static/img/img39.png" mode="" class="jj-more"></image>
  17. </view> -->
  18. </view>
  19. <view class="jj-wrap" v-if="gsjjList.length > 0">
  20. <view class="jj" v-for="gs in gsjjList" @click="navto('/pages/index/artDetail?id=' + gs.id)">
  21. <image :src="gs.image_input[0]" mode="" class="jj-img"></image>
  22. <view class="jj-info">
  23. <view class="jj-tit-tit clamp">
  24. {{gs.title}}
  25. </view>
  26. <view class="jj-val clamp2">
  27. 更新时间{{gs.add_time}}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- 产品简介 -->
  33. <view class="jj-tit" style="margin-top: 20rpx;">
  34. <view class="left">
  35. <image src="../../static/icon/cpjj.png" mode="" class="jj-log"></image>
  36. <view class="jj-title">
  37. 商城简介
  38. </view>
  39. </view>
  40. <!-- <view class="right" @click="navto('/pages/index/artList?cid=2')">
  41. <view class="jj-more-tit">
  42. 更多
  43. </view>
  44. <image src="../../static/img/img39.png" mode="" class="jj-more"></image>
  45. </view> -->
  46. </view>
  47. <view class="scjj" style="padding: 20rpx;background-color: #fff;">
  48. <view class="" v-html="content">
  49. </view>
  50. </view>
  51. <!-- <view class="jj-wrap" v-if="cpjjList.length > 0">
  52. <view class="jj" v-for="cp in cpjjList" @click="navto('/pages/index/artDetail?id=' + cp.id)">
  53. <image :src="cp.image_input[0]" mode="" class="jj-img"></image>
  54. <view class="jj-info">
  55. <view class="jj-tit-tit clamp2">
  56. {{cp.title}}
  57. </view>
  58. <view class="jj-val clamp">
  59. 更新时间{{cp.add_time}}
  60. </view>
  61. </view>
  62. </view>
  63. </view> -->
  64. </view>
  65. </template>
  66. <script>
  67. import {
  68. loadIndexs,
  69. getArticleList,
  70. getArtDetai
  71. } from '@/api/index.js';
  72. export default {
  73. data() {
  74. return {
  75. cpjjList: [],
  76. gsjjList: [],
  77. content: ''
  78. }
  79. },
  80. onShow() {
  81. this.getArticleList()
  82. },
  83. methods: {
  84. navto(url) {
  85. console.log(url)
  86. uni.navigateTo({
  87. url: url
  88. })
  89. },
  90. getArticleList() {
  91. // getArticleList({
  92. // pages: 1,
  93. // limit: 3
  94. // },2).then(({data}) => {
  95. // console.log(data)
  96. // this.cpjjList = data
  97. // })
  98. let obj = this
  99. getArticleList({
  100. pages: 1,
  101. limit: 3
  102. },1).then(({data}) => {
  103. console.log(data)
  104. this.gsjjList = data
  105. })
  106. getArtDetai({},6).then(res => {
  107. console.log(res)
  108. obj.content = res.data.content
  109. if(obj.content != null){
  110. obj.content = obj.content.replace(/<img/g,"<img style='max-width:100%;height:auto;min-width:100%;'");
  111. }//小程序商品详情图超出屏幕问题
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss">
  118. .jj-tit {
  119. display: flex;
  120. // height: 50rpx;
  121. justify-content: space-between;
  122. background-color: #fff;
  123. padding-top: 20rpx;
  124. .left {
  125. padding-left: 20rpx;
  126. display: flex;
  127. .jj-log {
  128. width: 45rpx;
  129. height: 45rpx;
  130. }
  131. .jj-title {
  132. font-weight: bold;
  133. font-size: 32rpx;
  134. padding-left: 15rpx;
  135. }
  136. }
  137. .right {
  138. display: flex;
  139. width: 200rpx;
  140. font-size: 22rpx;
  141. // justify-content: sp;
  142. justify-content: flex-end;
  143. align-items: center;
  144. padding-right: 20rpx;
  145. color: #999;
  146. .jj-more {
  147. margin-left: 10rpx;
  148. width: 15rpx;
  149. height: 22rpx;
  150. }
  151. }
  152. }
  153. .jj-wrap {
  154. background-color: #fff;
  155. // margin: 20rpx 0;
  156. .jj {
  157. margin: auto;
  158. width: 689rpx;
  159. height: 202rpx;
  160. border-bottom: 1px solid #e5e5e5;
  161. padding: 20rpx;
  162. padding-left: 0;
  163. display: flex;
  164. &:last-of-type {
  165. border-bottom: none;
  166. }
  167. .jj-img {
  168. flex-shrink: 0;
  169. width: 222rpx;
  170. height: 158rpx;
  171. background-color: #bfa;
  172. border-radius: 10rpx;
  173. }
  174. .jj-info {
  175. width: 450rpx;
  176. // flex-shrink: 0;
  177. padding: 10rpx;
  178. padding-left: 15rpx;
  179. font-size: 32rpx;
  180. font-weight: bold;
  181. display: flex;
  182. flex-direction: column;
  183. justify-content: space-between;
  184. .jj-tit-tit {
  185. }
  186. .jj-val {
  187. padding-top: 20rpx;
  188. font-size: 28rpx;
  189. font-weight: 500;
  190. }
  191. }
  192. }
  193. }
  194. </style>