t-i-jinjiaqu.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <view class="content">
  3. <view class="section_1">
  4. <view class="tab">
  5. <view class="title" @click="change_active(1)" :class="active==1?'active':''">机关部室</view>
  6. <view class="title" @click="change_active(2)" :class="active==2?'active':''">基层区队</view>
  7. </view>
  8. <view class="list">
  9. <view class="item" v-for="(item,index) in list.children" :key="index" @click="go_record(item.link)">
  10. {{item.title}}
  11. </view>
  12. </view>
  13. </view>
  14. <!-- 图片链接 -->
  15. <view class="section_2">
  16. <view class="list">
  17. <view class="item" v-for="(item,index) in list_3.children" :key="index" @click="go_record(item.link)">
  18. <image :src="item.thumb" mode=""></image>
  19. </view>
  20. </view>
  21. </view>
  22. <!-- 快速通道 -->
  23. <view class="section_3">
  24. <view class="title">快速通道</view>
  25. <view class="list">
  26. <view class="item" v-for="(item,index) in list_4.children" :key="index" @click="go_record(item.link)">
  27. <image :src="item.thumb" mode=""></image>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. name: "t-i-jinjiaqu",
  36. props: [
  37. "mine_code"
  38. ],
  39. data() {
  40. return {
  41. active: 1,
  42. list: [],
  43. list_1: [],
  44. list_2: [],
  45. // 图片链接
  46. list_3: [],
  47. // 快速通道
  48. list_4: []
  49. };
  50. },
  51. created() {
  52. this.get_home_link()
  53. },
  54. methods: {
  55. change_active(item) {
  56. this.active = item
  57. if (item == 1) {
  58. this.list = this.list_1
  59. } else if (item == 2) {
  60. this.list = this.list_2
  61. }
  62. },
  63. get_home_link() {
  64. this.$api.home_link({
  65. }).then((res) => {
  66. // console.log(res.data.data)
  67. // 机关部室
  68. this.list = res.data.data[2]
  69. this.list_1 = res.data.data[2]
  70. // 基层区队
  71. this.list_2 = res.data.data[3]
  72. // 图片链接
  73. this.list_3 = res.data.data[1]
  74. // 快速通道
  75. this.list_4 = res.data.data[0]
  76. })
  77. },
  78. go_record(link) {
  79. console.log(link)
  80. // 二维码
  81. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  82. let pageId = ""
  83. function GetQueryString(name) {
  84. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  85. var r = link.match(reg);
  86. if (r != null) return unescape(r[2]);
  87. return null;
  88. }
  89. console.log(GetQueryString("pageId"))
  90. if (GetQueryString("pageId")) {
  91. pageId = GetQueryString("pageId")
  92. } else {
  93. pageId = link.split('=')[1]
  94. }
  95. uni.navigateTo({
  96. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  97. })
  98. }
  99. // h5
  100. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  101. console.log("H5")
  102. // #ifdef APP
  103. if (plus.os.name == 'Android') {
  104. if (link.indexOf("cmb.pb") != -1) {
  105. plus.runtime.launchApplication({
  106. pname: 'cmb.pb'
  107. }, (e) => {
  108. console.log('Open system default browser failed: ' + e.message)
  109. uni.showToast({
  110. icon: "none",
  111. title: "未安装此应用"
  112. })
  113. })
  114. } else if (link.indexOf("com.icbc") != -1) {
  115. plus.runtime.launchApplication({
  116. pname: 'com.icbc'
  117. }, (e) => {
  118. console.log('Open system default browser failed: ' + e.message)
  119. uni.showToast({
  120. icon: "none",
  121. title: "未安装此应用"
  122. })
  123. })
  124. } else if (link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1) {
  125. uni.navigateTo({
  126. url: "../../index/h5/h5?url=jinjiaqu_pingce"
  127. })
  128. } else if (link.indexOf("/yinhuanpaicha/yinhuaninfo") != -1) {
  129. uni.navigateTo({
  130. url: "../../index/h5/h5?url="+link
  131. })
  132. }
  133. }
  134. // #endif
  135. // #ifdef H5
  136. if (link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1) {
  137. uni.navigateTo({
  138. url: "../../index/h5/h5?url=jinjiaqu_pingce"
  139. })
  140. } else if (link.indexOf("/yinhuanpaicha/yinhuaninfo") != -1) {
  141. uni.navigateTo({
  142. url: "../../index/h5/h5?url="+link
  143. })
  144. }
  145. // #endif
  146. }
  147. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  148. console.log("原生")
  149. if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) {
  150. console.log("网格排查")
  151. uni.navigateTo({
  152. url: "../../workbench/gridding/gridding"
  153. })
  154. } else if (link.indexOf("/wordorder/wordOrderGrid_win") != -1) {
  155. console.log(link)
  156. uni.navigateTo({
  157. url: "../../index/business_approval/business_approval"
  158. })
  159. }
  160. } else {
  161. console.log(link)
  162. }
  163. }
  164. }
  165. }
  166. </script>
  167. <style lang="scss">
  168. .content {
  169. margin-top: 20rpx;
  170. background-color: #FFFFFF;
  171. }
  172. .section_1 {
  173. box-sizing: border-box;
  174. padding: 25rpx;
  175. .tab {
  176. display: flex;
  177. justify-content: space-around;
  178. .title {
  179. line-height: 80rpx;
  180. font-weight: 700;
  181. }
  182. .active {
  183. color: #009fe8;
  184. border-bottom: 6rpx solid #009fe8;
  185. }
  186. }
  187. .list {
  188. margin-top: 30rpx;
  189. overflow: hidden;
  190. .item {
  191. float: left;
  192. margin-right: 20rpx;
  193. margin-bottom: 30rpx;
  194. width: 160rpx;
  195. box-sizing: border-box;
  196. border: 2rpx solid #009fe8;
  197. border-radius: 20rpx;
  198. font-size: 28rpx;
  199. line-height: 70rpx;
  200. //超过一行省略号
  201. overflow: hidden;
  202. white-space: nowrap;
  203. text-overflow: ellipsis;
  204. padding: 0 10rpx;
  205. background-color: #66C7F218;
  206. color: #009FE8;
  207. text-align: center;
  208. }
  209. .item:nth-child(4n) {
  210. margin-right: 0;
  211. }
  212. }
  213. }
  214. .section_2 {
  215. box-sizing: border-box;
  216. padding: 0 25rpx;
  217. .list {
  218. display: flex;
  219. flex-wrap: wrap;
  220. justify-content: space-between;
  221. .item {
  222. margin-bottom: 20rpx;
  223. width: 340rpx;
  224. height: 180rpx;
  225. border-radius: 20rpx;
  226. overflow: hidden;
  227. image {
  228. width: 340rpx;
  229. height: 180rpx;
  230. }
  231. }
  232. }
  233. }
  234. .section_3 {
  235. box-sizing: border-box;
  236. padding: 0 25rpx;
  237. .title {
  238. line-height: 120rpx;
  239. font-size: 36rpx;
  240. font-weight: 700;
  241. }
  242. .list {
  243. display: flex;
  244. flex-wrap: wrap;
  245. justify-content: space-between;
  246. .item {
  247. margin-bottom: 20rpx;
  248. width: 340rpx;
  249. height: 220rpx;
  250. border-radius: 20rpx;
  251. overflow: hidden;
  252. image {
  253. width: 340rpx;
  254. height: 220rpx;
  255. }
  256. }
  257. }
  258. }
  259. </style>