scene.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view>
  3. <navbar ref="navbar" :config="config" backColor="#333333"></navbar>
  4. <view class="Body">
  5. <u-collapse :body-style="{padding:'30rpx',fontSize: '24rpx',color:'#808080'}" arrow-color="#666666">
  6. <u-collapse-item :index="index" :class="{active:index==activeIndex}" v-for="(item , index) in kongLimList" :key="index" @change="activeChange">
  7. <view slot="title">
  8. <view class="collapse_title">
  9. <image :src="item.icon" mode=""></image>
  10. {{item.name}}
  11. </view>
  12. </view>
  13. <view class="collapse-text">
  14. {{item.remark}}
  15. </view>
  16. </u-collapse-item>
  17. </u-collapse>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. getAPPList,
  24. } from "@/api/government.js"
  25. export default {
  26. data() {
  27. return {
  28. config: {
  29. back: true, //false是tolbar页面 是则不写
  30. title: '已接入场景',
  31. color: '#1A1A1A',
  32. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  33. backgroundColor: [1, '#fff'],
  34. },
  35. kongLimList: [],
  36. activeIndex:null
  37. }
  38. },
  39. onLoad() {
  40. this.getKongKim()
  41. },
  42. methods: {
  43. getKongKim() {
  44. getAPPList(this.$keys.LM_KONGKIM).then(res => {
  45. this.kongLimList = res.data;
  46. }).catch(err => {}).finally(() => {
  47. uni.stopPullDownRefresh();
  48. })
  49. },
  50. activeChange(e){
  51. this.activeIndex=e.show?e.index:null
  52. }
  53. }
  54. }
  55. </script>
  56. <style>
  57. page{
  58. background: #f6f6f6;
  59. }
  60. </style>
  61. <style lang="scss">
  62. .Body{
  63. padding: 30rpx;
  64. ::v-deep .u-collapse-head{
  65. padding:24rpx 30rpx;
  66. border-radius: 20rpx;
  67. }
  68. .collapse_title{
  69. display: flex;
  70. align-items: center;
  71. font-size: 28rpx;
  72. color: #1A1A1A;
  73. image{
  74. width: 70rpx;
  75. height: 70rpx;
  76. margin-right: 20rpx;
  77. }
  78. }
  79. .u-collapse-item{
  80. background: #fff;
  81. border-radius: 20rpx;
  82. margin-bottom: 30rpx;
  83. }
  84. .active{
  85. ::v-deep .u-collapse-head{
  86. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  87. }
  88. }
  89. }
  90. </style>