fenleiList - 副本.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view v-if="objList.length==6" class="item_list6">
  3. <view class="item_content">
  4. <view class="contentV" style="height: 360rpx;" @click="fenleixuanz(objList[0].id)">
  5. <view class="">
  6. <view class="title ztextfontB3">
  7. <text>{{objList[0].title}}</text>
  8. </view>
  9. <view class="detail towrow textfontB5" style="width: 260rpx;">
  10. <text>{{objList[0].detail}}</text>
  11. </view>
  12. </view>
  13. <view class="viewInRow">
  14. <netImage class="imagIconB" backgrS="1" width="190" height="190" :mysrc="objList[0].imageUrl" mymode="scaleToFill"></netImage>
  15. </view>
  16. </view>
  17. <view class="contentV" style="height: 220rpx;" @click="fenleixuanz(objList[1].id)">
  18. <view class="title textfontB5">
  19. <text>{{objList[1].title}}</text>
  20. </view>
  21. <view class="viewInRow">
  22. <text class="detail textfontB4">{{objList[1].detail}}</text>
  23. <netImage class="imagIconM" backgrS="1" width="136" height="136" :mysrc="objList[1].imageUrl" mymode="scaleToFill"></netImage>
  24. </view>
  25. </view>
  26. <view class="contentV" style="height: 150rpx;" @click="fenleixuanz(objList[2].id)">
  27. <view class="viewInRow">
  28. <view>
  29. <view class="title ztextfontB3">
  30. <text>{{objList[2].title}}</text>
  31. </view>
  32. <view class="detail textfontB5">
  33. <text >{{objList[2].detail}}</text>
  34. </view>
  35. </view>
  36. <netImage class="imagIconS" backgrS="1" width="120" height="120" :mysrc="objList[2].imageUrl" mymode="scaleToFill"></netImage>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="item_content">
  41. <view class="contentV" style="height: 220rpx;" @click="fenleixuanz(objList[3].id)">
  42. <view class="title ztextfontB3">
  43. <text>{{objList[3].title}}</text>
  44. </view>
  45. <view class="viewInRow">
  46. <view class="detail textfontB5">
  47. <text>{{objList[3].detail}}</text>
  48. </view>
  49. <netImage class="imagIconM" backgrS="1" width="126" height="126" :mysrc="objList[3].imageUrl" mymode="scaleToFill"></netImage>
  50. </view>
  51. </view>
  52. <view class="contentV" style="height: 270rpx;" @click="fenleixuanz(objList[4].id)">
  53. <view class="">
  54. <view class="title ztextfontB3">
  55. <text>{{objList[4].title}}</text>
  56. </view>
  57. <text class="detail onerow textfontB5">{{objList[4].detail}}</text>
  58. </view>
  59. <view class="viewInRow">
  60. <netImage class="imagIconBL" backgrS="1" width="130" height="130" :mysrc="objList[4].imageUrl" mymode="scaleToFill"></netImage>
  61. </view>
  62. </view>
  63. <view class="contentV" style="height: 240rpx;" @click="fenleixuanz(objList[5].id)">
  64. <view class="title ztextfontB3">
  65. <text>{{objList[5].title}}</text>
  66. </view>
  67. <view class="viewInRow">
  68. <text class="detail textfontB5">{{objList[5].detail}}</text>
  69. <netImage class="imagIconM" backgrS="1" width="140" height="140" :mysrc="objList[5].imageUrl" mymode="scaleToFill"></netImage>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import api from "@/pages/api/api.js"
  77. export default {
  78. data() {
  79. return {
  80. listsize:0,
  81. objList:[],
  82. fenleiList:[],
  83. };
  84. },
  85. methods:{
  86. getfenleiList(){
  87. api('fwlxlist',{
  88. pageNum:1,
  89. pageSize:20
  90. },res=>{
  91. if(res.data.code!=200){
  92. return;
  93. }
  94. this.initListObj(res.data.rows)
  95. //console.log('1111333333',res);
  96. },failc=>{
  97. //console.log('getadvertis----',failc)
  98. })
  99. },
  100. initListObj(list){
  101. this.listsize=list.length;
  102. this.objList=[];
  103. var tmpList=[];
  104. var language = uni.getStorageSync('language');
  105. if(language=='yuenan'){
  106. for(var i=0;i<this.listsize;i++){
  107. var obj={
  108. id:list[i].id,
  109. imageUrl:list[i].image,
  110. title:list[i].nameVi,
  111. detail:list[i].illustrateVi
  112. };
  113. tmpList.push(obj);
  114. }
  115. }
  116. else if(language=='zh-Hans'){
  117. for(var i=0;i<this.listsize;i++){
  118. var obj={
  119. id:list[i].id,
  120. imageUrl:list[i].image,
  121. title:list[i].nameCn,
  122. detail:list[i].illustrateCn
  123. };
  124. tmpList.push(obj);
  125. }
  126. }
  127. else if(language=='zh-Hant'){
  128. for(var i=0;i<this.listsize;i++){
  129. var obj={
  130. id:list[i].id,
  131. imageUrl:list[i].image,
  132. title:list[i].nameTw,
  133. detail:list[i].illustrateTw
  134. };
  135. tmpList.push(obj);
  136. }
  137. }
  138. this.objList=tmpList;
  139. },
  140. fenleixuanz(e){
  141. this.$emit('Efwflxuanze',e);
  142. },
  143. },
  144. }
  145. </script>
  146. <style lang="scss">
  147. @font-face {
  148. font-family: zrht;
  149. src: url('/uni_modules/font/zrht.otf');
  150. }
  151. .item_list6{
  152. padding: 0 40rpx;
  153. display: flex;
  154. flex-wrap: wrap;
  155. justify-content: space-between;
  156. background-color: #F2F3F7;
  157. }
  158. .item_content{
  159. width: 48%;
  160. margin: 20rpx 0;
  161. box-sizing: border-box;
  162. }
  163. .contentV{
  164. margin-top: 20rpx;
  165. background: white;
  166. align-items: center;
  167. border-radius: 12rpx;
  168. border: 1rpx solid lightgrey;
  169. box-shadow: 0rpx 0rpx 10rpx 0rpx lightgrey;
  170. }
  171. .viewInRow{
  172. display: flex;
  173. flex-direction: row;
  174. justify-content: space-between;
  175. }
  176. .title{
  177. margin: 14rpx;
  178. color:black;
  179. font-weight:bold;
  180. }
  181. .detail{
  182. margin-left: 14rpx;
  183. color:black;
  184. }
  185. .imagIconB{
  186. margin-left: auto;
  187. margin-top: 0rpx;
  188. margin-right: 6rpx;
  189. margin-bottom: 0rpx;
  190. width: 230rpx;
  191. height: 230rpx;
  192. }
  193. .imagIconBL{
  194. margin-left: auto;
  195. margin-top: 0rpx;
  196. margin-right: 6rpx;
  197. margin-bottom: 0rpx;
  198. width: 130rpx;
  199. height: 130rpx;
  200. }
  201. .imagIconM{
  202. margin-left: auto;
  203. margin-top: 0rpx;
  204. margin-right: 6rpx;
  205. margin-bottom: 0rpx;
  206. width: 136rpx;
  207. height: 136rpx;
  208. }
  209. .imagIconS{
  210. margin-left: auto;
  211. margin-right: 6rpx;
  212. margin-top: 10rpx;
  213. width: 120rpx;
  214. height: 120rpx;
  215. }
  216. .towrow{
  217. overflow: hidden;
  218. text-overflow: ellipsis;
  219. display: -webkit-box;
  220. -webkit-line-clamp: 2;
  221. -webkit-box-orient: vertical;
  222. }
  223. .onerow{
  224. overflow: hidden;
  225. text-overflow: ellipsis;
  226. display: -webkit-box;
  227. -webkit-line-clamp: 1;
  228. -webkit-box-orient: vertical;
  229. }
  230. </style>