t-i-icon.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="content">
  3. <view class="nav">
  4. <view class="item" v-for="(item,index) in iconList.arr" :key="index">
  5. <view class="icon">
  6. <image :src="item.icon" mode=""></image>
  7. </view>
  8. <view class="name">{{item.title}}</view>
  9. </view>
  10. </view>
  11. <view class="section" v-for="(item,index) in iconList.data" :key="index">
  12. <view v-if="item.data.length > 0">
  13. <view class="title">{{item.category_name}}</view>
  14. <view class="list">
  15. <view class="item" v-for="(item_2,index_2) in item.data" :key="index_2" @click="go_link(item_2)">
  16. <view class="icon">
  17. <image :src="item_2.icon" mode=""></image>
  18. </view>
  19. <view class="name">{{item_2.title}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. name: "t-i-icon",
  29. props: [
  30. "iconList",
  31. "mine_code"
  32. ],
  33. data() {
  34. return {
  35. };
  36. },
  37. methods: {
  38. go_link(item) {
  39. let link = item.link
  40. console.log(link)
  41. // OA系统
  42. if (link.indexOf("oa_system.nxjiewei.com") != -1) {
  43. uni.navigateTo({
  44. url: "../../origanization/OA/h5/h5",
  45. success: (res) => {
  46. // 通过eventChannel向被打开页面传送数据
  47. res.eventChannel.emit('acceptDataFromOpenerPage', {
  48. url: link,
  49. title: item.title
  50. })
  51. }
  52. })
  53. return
  54. }
  55. // 二维码
  56. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  57. let pageId = ""
  58. function GetQueryString(name) {
  59. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  60. var r = link.match(reg);
  61. if (r != null) return unescape(r[2]);
  62. return null;
  63. }
  64. console.log(GetQueryString("pageId"))
  65. if (GetQueryString("pageId")) {
  66. pageId = GetQueryString("pageId")
  67. } else {
  68. pageId = link.split('=')[1]
  69. }
  70. uni.navigateTo({
  71. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  72. })
  73. }
  74. // h5
  75. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  76. uni.navigateTo({
  77. url: "../../index/h5/h5?url=" + link
  78. })
  79. }
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. .content {
  86. margin-bottom: 30rpx;
  87. background-color: #FFFFFF;
  88. box-sizing: border-box;
  89. padding: 50rpx 25rpx 15rpx;
  90. }
  91. .nav {
  92. overflow: hidden;
  93. .item {
  94. float: left;
  95. width: 120rpx;
  96. margin-right: 25rpx;
  97. margin-bottom: 30rpx;
  98. .icon {
  99. width: 120rpx;
  100. text-align: center;
  101. image {
  102. width: 100rpx;
  103. height: 100rpx;
  104. }
  105. }
  106. .name {
  107. width: 120rpx;
  108. text-align: center;
  109. font-size: 30rpx;
  110. white-space: nowrap;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. }
  114. }
  115. .item:nth-child(5n) {
  116. margin-right: 0;
  117. }
  118. }
  119. .section {
  120. margin-top: 20rpx;
  121. .title {
  122. font-size: 36rpx;
  123. margin-bottom: 40rpx;
  124. }
  125. .list {
  126. overflow: hidden;
  127. .item {
  128. float: left;
  129. width: 148rpx;
  130. margin-right: 36rpx;
  131. margin-bottom: 30rpx;
  132. .icon {
  133. width: 148rpx;
  134. text-align: center;
  135. image {
  136. width: 104rpx;
  137. height: 104rpx;
  138. }
  139. }
  140. .name {
  141. width: 148rpx;
  142. text-align: center;
  143. font-size: 30rpx;
  144. white-space: nowrap;
  145. overflow: hidden;
  146. text-overflow: ellipsis;
  147. }
  148. }
  149. .item:nth-child(4n) {
  150. margin-right: 0;
  151. }
  152. }
  153. }
  154. </style>