t-w-ningdongyunying.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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("/news/news_win") != -1){
  94. console.log("通知公告")
  95. uni.navigateTo({
  96. url:"../../my/message-reminder/message-reminder"
  97. })
  98. }else if(link.indexOf("/workBench/getDuty") != -1){
  99. console.log("值班信息")
  100. uni.navigateTo({
  101. url:"../../workbench/duty_information/duty_information"
  102. })
  103. }else if (link.indexOf("/workBench/huiyiList") != -1) {
  104. uni.showToast({
  105. icon: "none",
  106. title: "暂时没有会议"
  107. })
  108. }
  109. }
  110. },
  111. getmodule(link) {
  112. console.log(link)
  113. console.log(this.mine_code)
  114. // 二维码
  115. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  116. let pageId = ""
  117. function GetQueryString(name) {
  118. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  119. var r = link.match(reg);
  120. if (r != null) return unescape(r[2]);
  121. return null;
  122. }
  123. console.log(GetQueryString("pageId"))
  124. if (GetQueryString("pageId")) {
  125. pageId = GetQueryString("pageId")
  126. } else {
  127. pageId = link.split('=')[1]
  128. }
  129. uni.navigateTo({
  130. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  131. })
  132. }
  133. // h5
  134. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  135. // uni.navigateTo({
  136. // url: "../../workbench/h5/h5?url=" + link
  137. // })
  138. if (plus.os.name == 'Android') {
  139. if (link.indexOf("cmb.pb") != -1) {
  140. plus.runtime.launchApplication({
  141. pname: 'cmb.pb'
  142. }, (e) => {
  143. console.log('Open system default browser failed: ' + e.message)
  144. uni.showToast({
  145. icon: "none",
  146. title: "未安装此应用"
  147. })
  148. })
  149. }
  150. if (link.indexOf("com.icbc") != -1) {
  151. plus.runtime.launchApplication({
  152. pname: 'com.icbc'
  153. }, (e) => {
  154. console.log('Open system default browser failed: ' + e.message)
  155. uni.showToast({
  156. icon: "none",
  157. title: "未安装此应用"
  158. })
  159. })
  160. }
  161. }
  162. }
  163. // 原生
  164. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  165. console.log("原生")
  166. console.log(link)
  167. // 发票助手
  168. if (link.indexOf("/workBench/invoice") != -1) {
  169. console.log("发票助手")
  170. uni.navigateTo({
  171. url: "../../workbench/invoice_assistant/invoice_assistant"
  172. })
  173. }
  174. // 生活圈
  175. if (link.indexOf("/workBench/lifeCircleWin") != -1) {
  176. console.log("生活圈")
  177. uni.showToast({
  178. icon:"none",
  179. title:"暂未开通"
  180. })
  181. }
  182. }
  183. }
  184. },
  185. }
  186. </script>
  187. <style>
  188. .headers {
  189. width: 100%;
  190. background-color: #F5F5F5;
  191. }
  192. .headers_img>image {
  193. width: 100%;
  194. height: 360rpx;
  195. }
  196. .headers_nav {
  197. width: 100%;
  198. background-color: #FFFFFF;
  199. margin-bottom: 25rpx;
  200. }
  201. .headers_ul {
  202. width: 100%;
  203. display: flex;
  204. flex-wrap: wrap;
  205. justify-content: space-around;
  206. margin-top: 10rpx;
  207. }
  208. .headers_ul::after {
  209. content: '';
  210. width: 25%;
  211. }
  212. .headers_title {
  213. margin-left: 40rpx;
  214. padding-top: 30rpx;
  215. padding-bottom: 5rpx;
  216. }
  217. .headers_li {
  218. width: 25%;
  219. text-align: center;
  220. margin-bottom: 25rpx;
  221. margin-top: 25rpx;
  222. }
  223. .headers_li_img>image {
  224. width: 100rpx;
  225. height: 100rpx;
  226. margin-bottom: 10rpx;
  227. }
  228. .headers_li_text {
  229. font-size: 14px;
  230. }
  231. .headers_title_h1 {
  232. font-weight: 800;
  233. }
  234. .headers_list {
  235. width: 100%;
  236. background-color: #fff;
  237. }
  238. .ly-tree-node__label {
  239. color: #000000;
  240. }
  241. </style>