t-i-icon.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. })
  37. }
  38. })
  39. return
  40. }
  41. // 二维码
  42. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  43. let pageId = ""
  44. function GetQueryString(name) {
  45. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  46. var r = link.match(reg);
  47. if (r != null) return unescape(r[2]);
  48. return null;
  49. }
  50. console.log(GetQueryString("pageId"))
  51. if (GetQueryString("pageId")) {
  52. pageId = GetQueryString("pageId")
  53. } else {
  54. pageId = link.split('=')[1]
  55. }
  56. uni.navigateTo({
  57. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  58. })
  59. }
  60. // h5
  61. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  62. uni.navigateTo({
  63. url:"../../index/h5/h5?url="+link
  64. })
  65. }
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss">
  71. .content {
  72. margin-bottom: 30rpx;
  73. background-color: #FFFFFF;
  74. box-sizing: border-box;
  75. padding: 50rpx 25rpx 25rpx 25rpx;
  76. }
  77. .list {
  78. overflow: hidden;
  79. .item {
  80. float: left;
  81. margin-right: 25rpx;
  82. margin-bottom: 30rpx;
  83. width: 120rpx;
  84. .icon {
  85. width: 120rpx;
  86. text-align: center;
  87. image {
  88. width: 104rpx;
  89. height: 104rpx;
  90. border-radius: 50%;
  91. }
  92. }
  93. .name {
  94. width: 120rpx;
  95. text-align: center;
  96. font-size: 30rpx;
  97. white-space: nowrap;
  98. overflow: hidden;
  99. text-overflow: ellipsis;
  100. }
  101. }
  102. .item:nth-child(5n) {
  103. margin-right: 0;
  104. }
  105. }
  106. </style>