t-i-icon.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="content">
  3. <view class="list">
  4. <view class="item" v-for="(item,index) in iconList" :key="index" @click="go_link(item)">
  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>
  12. </template>
  13. <script>
  14. export default {
  15. name: "t-i-icon",
  16. props: [
  17. "iconList",
  18. "mine_code"
  19. ],
  20. data() {
  21. return {
  22. };
  23. },
  24. methods: {
  25. go_link(item) {
  26. let link = item.link
  27. console.log(link)
  28. // OA系统
  29. if(link.indexOf("oa_system.nxjiewei.com") != -1 ){
  30. uni.navigateTo({
  31. url:"../../origanization/OA/h5/h5",
  32. success: (res) =>{
  33. // 通过eventChannel向被打开页面传送数据
  34. res.eventChannel.emit('acceptDataFromOpenerPage', {
  35. url: link,
  36. title: item.title
  37. })
  38. }
  39. })
  40. return
  41. }
  42. // 二维码
  43. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  44. let pageId = ""
  45. function GetQueryString(name) {
  46. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  47. var r = link.match(reg);
  48. if (r != null) return unescape(r[2]);
  49. return null;
  50. }
  51. console.log(GetQueryString("pageId"))
  52. if (GetQueryString("pageId")) {
  53. pageId = GetQueryString("pageId")
  54. } else {
  55. pageId = link.split('=')[1]
  56. }
  57. uni.navigateTo({
  58. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  59. })
  60. }
  61. // h5
  62. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  63. uni.navigateTo({
  64. url:"../../index/h5/h5?url="+link
  65. })
  66. }
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. .content {
  73. margin-bottom: 30rpx;
  74. background-color: #FFFFFF;
  75. box-sizing: border-box;
  76. padding: 50rpx 25rpx 25rpx 25rpx;
  77. }
  78. .list {
  79. overflow: hidden;
  80. .item {
  81. float: left;
  82. margin-right: 25rpx;
  83. margin-bottom: 30rpx;
  84. width: 120rpx;
  85. .icon {
  86. width: 120rpx;
  87. text-align: center;
  88. image {
  89. width: 104rpx;
  90. height: 104rpx;
  91. border-radius: 50%;
  92. }
  93. }
  94. .name {
  95. width: 120rpx;
  96. text-align: center;
  97. font-size: 30rpx;
  98. white-space: nowrap;
  99. overflow: hidden;
  100. text-overflow: ellipsis;
  101. }
  102. }
  103. .item:nth-child(5n) {
  104. margin-right: 0;
  105. }
  106. }
  107. </style>