t-i-icon.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="content">
  3. <view class="list">
  4. <view class="item" v-for="item in 5">
  5. <view class="icon">
  6. <image src="./icon/gaikuang.png" mode=""></image>
  7. </view>
  8. <view class="name">概况</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name:"t-i-icon",
  16. props: [
  17. "base_url"
  18. ],
  19. data() {
  20. return {
  21. list:[]
  22. };
  23. },
  24. created() {
  25. this.get_list()
  26. },
  27. methods:{
  28. get_list(){
  29. uni.request({
  30. url: this.base_url + "/homeNav/list",
  31. method: "GET",
  32. success: (res) => {
  33. // console.log(res.data.data.data)
  34. this.list = res.data.data.data.slice(0,5)
  35. console.log(this.list)
  36. }
  37. })
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="scss">
  43. .content{
  44. margin-bottom: 30rpx;
  45. background-color: #FFFFFF;
  46. box-sizing: border-box;
  47. padding: 50rpx 25rpx;
  48. }
  49. .list{
  50. display: flex;
  51. justify-content: space-between;
  52. .item{
  53. width: 104rpx;
  54. .icon{
  55. image{
  56. width: 104rpx;
  57. height: 104rpx;
  58. }
  59. }
  60. .name{
  61. text-align: center;
  62. }
  63. }
  64. }
  65. </style>