t-w-application.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="headers">
  3. <view class="headers_img">
  4. <image :src="header" mode=""></image>
  5. </view>
  6. <view class="headers_nav">
  7. <view class="headers_ul">
  8. <view class="headers_li" v-for="(item,index) in nav" :key="index" @click="getnav(item.link)">
  9. <view class="headers_li_img">
  10. <image :src="item.icon" mode=""></image>
  11. </view>
  12. <view class="headers_li_text">
  13. {{item.title}}
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="headers_list" v-for="(item,index) in module" :key="index">
  19. <view class="headers_title">
  20. <text class="headers_title_h1">
  21. {{item.title}}
  22. </text>
  23. <!-- <text class="headers_title_h2">
  24. {{item.titles}}
  25. </text> -->
  26. </view>
  27. <view class="headers_ul" >
  28. <view class="headers_li" v-for="(items,index) in item.children" :key="index" @click="getmodule(items.link)">
  29. <view class="headers_li_img">
  30. <image :src="items.icon" mode=""></image>
  31. </view>
  32. <view class="headers_li_text">
  33. {{items.title}}
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. props: [
  43. "mine_code"
  44. ],
  45. data() {
  46. return {
  47. module:[],
  48. nav:[],
  49. header:"",
  50. };
  51. },
  52. created() {
  53. this.getworkbench()
  54. },
  55. methods:{
  56. getworkbench(){
  57. this.$api.workbench_index({
  58. }).then((res)=>{
  59. this.header=res.data.data.header
  60. this.nav=res.data.data.nav
  61. this.module=res.data.data.module
  62. })
  63. },
  64. getnav(link){
  65. console.log(link)
  66. // 二维码
  67. if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
  68. let pageId = ""
  69. function GetQueryString(name) {
  70. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  71. var r = link.match(reg);
  72. if (r != null) return unescape(r[2]);
  73. return null;
  74. }
  75. console.log(GetQueryString("pageId"))
  76. if (GetQueryString("pageId")) {
  77. pageId = GetQueryString("pageId")
  78. } else {
  79. pageId = link.split('=')[1]
  80. }
  81. uni.navigateTo({
  82. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  83. })
  84. }
  85. // h5
  86. if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
  87. uni.navigateTo({
  88. url:"../../workbench/h5/h5?url=" + link
  89. })
  90. }
  91. // 原生
  92. if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
  93. console.log("原生")
  94. }
  95. },
  96. getmodule(link){
  97. console.log(link)
  98. console.log(this.mine_code)
  99. // 二维码
  100. if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
  101. let pageId = ""
  102. function GetQueryString(name) {
  103. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  104. var r = link.match(reg);
  105. if (r != null) return unescape(r[2]);
  106. return null;
  107. }
  108. console.log(GetQueryString("pageId"))
  109. if (GetQueryString("pageId")) {
  110. pageId = GetQueryString("pageId")
  111. } else {
  112. pageId = link.split('=')[1]
  113. }
  114. uni.navigateTo({
  115. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  116. })
  117. }
  118. // h5
  119. if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
  120. uni.navigateTo({
  121. url:"../../workbench/h5/h5?url=" + link
  122. })
  123. }
  124. // 原生
  125. if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
  126. console.log("原生")
  127. }
  128. }
  129. },
  130. }
  131. </script>
  132. <style>
  133. .headers{
  134. width: 100%;
  135. background-color: #F5F5F5;
  136. }
  137. .headers_img>image{
  138. width: 100%;
  139. height: 360rpx;
  140. }
  141. .headers_nav{
  142. width: 100%;
  143. background-color: #FFFFFF;
  144. margin-bottom: 25rpx;
  145. }
  146. .headers_ul{
  147. width: 100%;
  148. display: flex;
  149. flex-wrap:wrap;
  150. justify-content: space-around;
  151. margin-top: 10rpx;
  152. }
  153. .headers_ul::after{
  154. content: '';
  155. width: 25%;
  156. }
  157. .headers_title{
  158. margin-left: 40rpx;
  159. padding-top: 30rpx;
  160. padding-bottom: 5rpx;
  161. }
  162. .headers_li{
  163. width: 25%;
  164. text-align: center;
  165. margin-bottom: 25rpx;
  166. margin-top: 25rpx;
  167. }
  168. .headers_li_img>image{
  169. width: 100rpx;
  170. height: 100rpx;
  171. margin-bottom: 20rpx;
  172. }
  173. .headers_li_text{
  174. font-size: 14px;
  175. }
  176. .headers_title_h1{
  177. font-weight: 800;
  178. }
  179. .headers_list{
  180. width: 100%;
  181. background-color: #fff;
  182. }
  183. .ly-tree-node__label{
  184. color: #000000;
  185. }
  186. </style>