t-i-icon.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.link)">
  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(link){
  26. // console.log(link.split('=')[3].split('&')[0])
  27. // let pageId = link.split('=')[3].split('&')[0]
  28. console.log(link)
  29. let pageId = ""
  30. function GetQueryString(name) {
  31. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  32. var r = link.match(reg);
  33. if (r != null) return unescape(r[2]);
  34. return null;
  35. }
  36. console.log(GetQueryString("pageId"))
  37. if (GetQueryString("pageId")) {
  38. pageId = GetQueryString("pageId")
  39. } else {
  40. pageId = link.split('=')[1]
  41. }
  42. uni.navigateTo({
  43. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  44. })
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. .content{
  51. margin-bottom: 30rpx;
  52. background-color: #FFFFFF;
  53. box-sizing: border-box;
  54. padding: 50rpx 25rpx;
  55. }
  56. .list{
  57. display: flex;
  58. justify-content: space-between;
  59. align-items: center;
  60. .item{
  61. width: 120rpx;
  62. .icon{
  63. width: 120rpx;
  64. text-align: center;
  65. image{
  66. width: 104rpx;
  67. height: 104rpx;
  68. }
  69. }
  70. .name{
  71. width: 120rpx;
  72. text-align: center;
  73. font-size: 30rpx;
  74. white-space:nowrap;
  75. overflow:hidden;
  76. text-overflow:ellipsis;
  77. }
  78. }
  79. }
  80. </style>