t-i-jinjiaqu.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. // 二维码
  80. if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
  81. let pageId = ""
  82. function GetQueryString(name) {
  83. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  84. var r = link.match(reg);
  85. if (r != null) return unescape(r[2]);
  86. return null;
  87. }
  88. console.log(GetQueryString("pageId"))
  89. if (GetQueryString("pageId")) {
  90. pageId = GetQueryString("pageId")
  91. } else {
  92. pageId = link.split('=')[1]
  93. }
  94. uni.navigateTo({
  95. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  96. })
  97. }else if(link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1){
  98. uni.navigateTo({
  99. url:"../../index/h5/h5?url=jinjiaqu_pingce"
  100. })
  101. }else if(link.indexOf("/wordorder/wordOrderGrid_win") != -1){
  102. console.log(link)
  103. uni.navigateTo({
  104. url:"../../index/business_approval/business_approval"
  105. })
  106. }else{
  107. console.log(link)
  108. }
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss">
  114. .content {
  115. margin-top: 20rpx;
  116. background-color: #FFFFFF;
  117. }
  118. .section_1 {
  119. box-sizing: border-box;
  120. padding: 25rpx;
  121. .tab {
  122. display: flex;
  123. justify-content: space-around;
  124. .title {
  125. line-height: 80rpx;
  126. font-weight: 700;
  127. }
  128. .active {
  129. color: #009fe8;
  130. border-bottom: 6rpx solid #009fe8;
  131. }
  132. }
  133. .list {
  134. margin-top: 30rpx;
  135. overflow: hidden;
  136. .item{
  137. float: left;
  138. margin-right: 20rpx;
  139. margin-bottom: 30rpx;
  140. width: 160rpx;
  141. box-sizing: border-box;
  142. border: 2rpx solid #009fe8;
  143. border-radius: 20rpx;
  144. font-size: 28rpx;
  145. line-height: 70rpx;
  146. //超过一行省略号
  147. overflow: hidden;
  148. white-space: nowrap;
  149. text-overflow: ellipsis;
  150. padding: 0 10rpx;
  151. background-color: #66C7F218;
  152. color: #009FE8;
  153. text-align: center;
  154. }
  155. .item:nth-child(4n){
  156. margin-right: 0;
  157. }
  158. }
  159. }
  160. .section_2{
  161. box-sizing: border-box;
  162. padding: 0 25rpx;
  163. .list{
  164. display: flex;
  165. flex-wrap: wrap;
  166. justify-content: space-between;
  167. .item{
  168. margin-bottom: 20rpx;
  169. width: 340rpx;
  170. height: 180rpx;
  171. border-radius: 20rpx;
  172. overflow: hidden;
  173. image{
  174. width: 340rpx;
  175. height: 180rpx;
  176. }
  177. }
  178. }
  179. }
  180. .section_3{
  181. box-sizing: border-box;
  182. padding: 0 25rpx;
  183. .title{
  184. line-height: 120rpx;
  185. font-size: 36rpx;
  186. font-weight: 700;
  187. }
  188. .list{
  189. display: flex;
  190. flex-wrap: wrap;
  191. justify-content: space-between;
  192. .item{
  193. margin-bottom: 20rpx;
  194. width: 340rpx;
  195. height: 220rpx;
  196. border-radius: 20rpx;
  197. overflow: hidden;
  198. image{
  199. width: 340rpx;
  200. height: 220rpx;
  201. }
  202. }
  203. }
  204. }
  205. </style>