article.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="page">
  3. <view class="page-content" style="margin-top: 1px;">
  4. <uni-list class="page-list">
  5. <!-- 水平排列,右图左文 -->
  6. <uni-list-item @tap="toDetails(item)" class="page-list-item" :thumb="staticPic+item.small_pic" :title="item.article_name"
  7. v-for="(item,index) in list">
  8. </uni-list-item>
  9. </uni-list>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import _get from "../../common/_get";
  15. import _data from "../../common/_data";
  16. import _hook from "../../common/_hook";
  17. export default {
  18. data() {
  19. return {
  20. list: [
  21. ]
  22. }
  23. },
  24. computed: {
  25. staticPic() {
  26. return _data.domainUrl()
  27. }
  28. },
  29. onShow() {
  30. let _this = this;
  31. _hook.routeSonHook();
  32. _get.getArticleList({}, function (ret) {
  33. _this.list = ret
  34. });
  35. },
  36. methods: {
  37. toDetails(item){
  38. uni.navigateTo({url:'detail?id='+item.id})
  39. }
  40. }
  41. }
  42. </script>
  43. <style>
  44. .page-head-img {
  45. height: 200px;
  46. width: 100%;
  47. }
  48. uni-view {
  49. line-height: normal !important;
  50. }
  51. </style>