index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="HTodo-v" :key="key">
  3. <view class="HTodo-box u-flex">
  4. <view class="HTodo-list u-flex" :style="{'flex-wrap':option.appStyleType==1?'nowrap':'wrap'}">
  5. <view class="u-flex-col HTodo-list-item" v-for="(item,index) in option.appDefaultValue" :key="index"
  6. @click="jump(item)" :style="option.style">
  7. <view class="" style="position: relative;margin-bottom: 8rpx;">
  8. <view :class="item.icon" class="icon"
  9. :style="{'background-color':item.iconColor||item.iconBgColor || '#008cff'}"></view>
  10. </view>
  11. <view class="u-line-1 title"
  12. :style="{'font-size':option.labelFontSize,'color':option.labelFontColor,'font-weight':option.labelFontWeight?700:400}">
  13. {{item.fullName}}
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: {
  23. config: {
  24. type: Object,
  25. default: () => {}
  26. }
  27. },
  28. data() {
  29. return {
  30. option: {},
  31. key: +new Date()
  32. }
  33. },
  34. created() {
  35. this.initData()
  36. },
  37. methods: {
  38. initData() {
  39. this.option = JSON.parse(JSON.stringify(this.config.option))
  40. this.option.appDefaultValue.map((o) => {
  41. if (o.fullNameI18nCode) o.fullName = this.$t(o.fullNameI18nCode)
  42. })
  43. let style;
  44. style = {
  45. 'width': '240rpx'
  46. }
  47. if (this.option.appStyleType == 2) {
  48. style = {
  49. 'width': this.option.appDefaultValue.lenght < 2 ? "" : 100 / this.option.appRowNumber + '%'
  50. }
  51. if (this.option.appShowBorder) {
  52. style['border-right'] = '2rpx solid #f0f2f6'
  53. style['border-bottom'] = '2rpx solid #f0f2f6'
  54. }
  55. }
  56. this.option.style = style
  57. this.option.labelFontSize = this.option.labelFontSize * 2 + 'rpx'
  58. this.key = +new Date()
  59. },
  60. jump(item) {
  61. if (this.config.platform === 'mp') return
  62. let url;
  63. if (item.linkType == 1 && item.type == 3) {
  64. let data = {
  65. id: item.moduleId,
  66. moduleId: item.moduleId,
  67. urlAddress: item.urlAddress,
  68. ...JSON.parse(item.propertyJson)
  69. }
  70. url = '/pages/apply/dynamicModel/index?config=' +
  71. this.jnpf.base64.encode(JSON.stringify(data))
  72. } else if (item.linkType == 1 && item.type == 2) {
  73. url = item.urlAddress
  74. } else if (item.linkType == 1 && item.type == 8) {
  75. let propertyJson = JSON.parse(item.propertyJson)
  76. uni.navigateTo({
  77. url: "/pages/portal/scanPortal/index?id=" + propertyJson.moduleId +
  78. "&portalType=1&fullName=" +
  79. item.fullName,
  80. fail: (err) => {},
  81. });
  82. return
  83. } else {
  84. if (!item.urlAddress) return
  85. url = '/pages/apply/externalLink/index?url=' + encodeURIComponent(item.urlAddress) +
  86. '&fullName= ' + item.fullName
  87. }
  88. uni.navigateTo({
  89. url: url,
  90. fail: (err) => {
  91. // this.$u.toast("暂无此页面")
  92. }
  93. })
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .HTodo-v {
  100. width: 100%;
  101. height: 100%;
  102. .HTodo-box {
  103. width: 100%;
  104. overflow-x: scroll;
  105. .HTodo-list {
  106. width: 100%;
  107. .HTodo-list-item {
  108. align-items: center;
  109. padding: 16rpx 20rpx;
  110. .title {
  111. width: 100%;
  112. text-align: center;
  113. }
  114. .icon {
  115. width: 90rpx;
  116. height: 90rpx;
  117. font-size: 60rpx;
  118. color: #fff;
  119. text-align: center;
  120. line-height: 90rpx;
  121. border-radius: 16rpx;
  122. }
  123. }
  124. }
  125. }
  126. }
  127. </style>