t-w-ningdongyunying.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="headers">
  3. <view class="headers_img">
  4. <image :src="header" mode="aspectFill"></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. </view>
  24. <view class="headers_ul">
  25. <view class="headers_li" v-for="(items,index) in item.children" :key="index"
  26. @click="getmodule(items.link)">
  27. <view class="headers_li_img">
  28. <image :src="items.icon" mode=""></image>
  29. </view>
  30. <view class="headers_li_text">
  31. {{items.title}}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. props: [
  41. "mine_code"
  42. ],
  43. data() {
  44. return {
  45. module: [],
  46. nav: [],
  47. header: "",
  48. };
  49. },
  50. created() {
  51. this.getworkbench()
  52. },
  53. methods: {
  54. getworkbench() {
  55. this.$api.workbench_index({
  56. }).then((res) => {
  57. // console.log(res)
  58. this.header = res.data.data.header
  59. this.nav = res.data.data.nav
  60. this.module = res.data.data.module
  61. })
  62. },
  63. getnav(link) {
  64. console.log(link)
  65. // 二维码
  66. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  67. let pageId = ""
  68. function GetQueryString(name) {
  69. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  70. var r = link.match(reg);
  71. if (r != null) return unescape(r[2]);
  72. return null;
  73. }
  74. console.log(GetQueryString("pageId"))
  75. if (GetQueryString("pageId")) {
  76. pageId = GetQueryString("pageId")
  77. } else {
  78. pageId = link.split('=')[1]
  79. }
  80. // uni.navigateTo({
  81. // url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  82. // })
  83. }
  84. // h5
  85. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  86. // uni.navigateTo({
  87. // url: "../../workbench/h5/h5?url=" + link
  88. // })
  89. }
  90. // 原生
  91. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  92. console.log("原生")
  93. if (link.indexOf("/workBench/huiyiList") != -1) {
  94. uni.showToast({
  95. icon: "none",
  96. title: "暂时没有会议"
  97. })
  98. }
  99. }
  100. },
  101. getmodule(link) {
  102. console.log(link)
  103. console.log(this.mine_code)
  104. // 二维码
  105. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  106. let pageId = ""
  107. function GetQueryString(name) {
  108. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  109. var r = link.match(reg);
  110. if (r != null) return unescape(r[2]);
  111. return null;
  112. }
  113. console.log(GetQueryString("pageId"))
  114. if (GetQueryString("pageId")) {
  115. pageId = GetQueryString("pageId")
  116. } else {
  117. pageId = link.split('=')[1]
  118. }
  119. uni.navigateTo({
  120. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  121. })
  122. }
  123. // h5
  124. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  125. // uni.navigateTo({
  126. // url: "../../workbench/h5/h5?url=" + link
  127. // })
  128. if (plus.os.name == 'Android') {
  129. if (link.indexOf("cmb.pb") != -1) {
  130. plus.runtime.launchApplication({
  131. pname: 'cmb.pb'
  132. }, (e) => {
  133. console.log('Open system default browser failed: ' + e.message)
  134. uni.showToast({
  135. icon: "none",
  136. title: "未安装此应用"
  137. })
  138. })
  139. }
  140. if (link.indexOf("com.icbc") != -1) {
  141. plus.runtime.launchApplication({
  142. pname: 'com.icbc'
  143. }, (e) => {
  144. console.log('Open system default browser failed: ' + e.message)
  145. uni.showToast({
  146. icon: "none",
  147. title: "未安装此应用"
  148. })
  149. })
  150. }
  151. }
  152. }
  153. // 原生
  154. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  155. console.log("原生")
  156. console.log(link)
  157. // 发票助手
  158. if (link.indexOf("/workBench/invoice") != -1) {
  159. console.log("发票助手")
  160. uni.navigateTo({
  161. url: "../../workbench/invoice_assistant/invoice_assistant"
  162. })
  163. }
  164. // 生活圈
  165. if (link.indexOf("/workBench/lifeCircleWin") != -1) {
  166. console.log("生活圈")
  167. uni.showToast({
  168. icon:"none",
  169. title:"暂未开通"
  170. })
  171. }
  172. }
  173. }
  174. },
  175. }
  176. </script>
  177. <style>
  178. .headers {
  179. width: 100%;
  180. background-color: #F5F5F5;
  181. }
  182. .headers_img>image {
  183. width: 100%;
  184. height: 360rpx;
  185. }
  186. .headers_nav {
  187. width: 100%;
  188. background-color: #FFFFFF;
  189. margin-bottom: 25rpx;
  190. }
  191. .headers_ul {
  192. width: 100%;
  193. display: flex;
  194. flex-wrap: wrap;
  195. justify-content: space-around;
  196. margin-top: 10rpx;
  197. }
  198. .headers_ul::after {
  199. content: '';
  200. width: 25%;
  201. }
  202. .headers_title {
  203. margin-left: 40rpx;
  204. padding-top: 30rpx;
  205. padding-bottom: 5rpx;
  206. }
  207. .headers_li {
  208. width: 25%;
  209. text-align: center;
  210. margin-bottom: 25rpx;
  211. margin-top: 25rpx;
  212. }
  213. .headers_li_img>image {
  214. width: 100rpx;
  215. height: 100rpx;
  216. margin-bottom: 20rpx;
  217. }
  218. .headers_li_text {
  219. font-size: 14px;
  220. }
  221. .headers_title_h1 {
  222. font-weight: 800;
  223. }
  224. .headers_list {
  225. width: 100%;
  226. background-color: #fff;
  227. }
  228. .ly-tree-node__label {
  229. color: #000000;
  230. }
  231. </style>