Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

service.vue 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="wrapper">
  3. <navBar title="九州ETC"></navBar>
  4. <view class="search-box">
  5. <image :src="`${$imgUrl}service/icon-search.png`" class="icon"></image>
  6. <input class="search" placeholder="请输入业务名称" />
  7. </view>
  8. <view class="content">
  9. <view class="left">
  10. <view v-for="(item,index) in menu.list" :key="index"
  11. :class="activeTab === item.name ? 'menu active' : 'menu'" @click="tabHandle(item.name,index)">
  12. <view :class="activeTab === item.name ? 'border on' : 'border'"></view>
  13. <view class="menu-text">{{item.name}}</view>
  14. </view>
  15. </view>
  16. <view class="right">
  17. <view class="right-content">
  18. <block v-if="menu.list.length >0">
  19. <view v-for="(item,index) in menu.list[tableSelectIndex].subMenus" :key='index' class="item-box" @click="toNext(item.link)">
  20. <view class="item bg-blue" :style="{ '--background': bgBlue }">
  21. <image :src="`${$imgUrl}${item.iconPath}`" />
  22. </view>
  23. <view class="text">{{item.name}}</view>
  24. </view>
  25. <view class="item-box" @click="toNext('/subpackage/service/statistics/index')">
  26. <view class="item bg-blue" :style="{ '--background': bgBlue }">
  27. <image src="" />
  28. </view>
  29. <view class="text">数据统计</view>
  30. </view>
  31. </block>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script lang="ts" setup>
  38. import navBar from "@/components/nav-bar/nav-bar.vue";
  39. import {
  40. ref,
  41. reactive,
  42. } from "vue";
  43. import {
  44. onLoad
  45. } from "@dcloudio/uni-app";
  46. import {
  47. fileURL
  48. } from "@/datas/fileURL.js";
  49. import {
  50. msg
  51. } from "@/utils/utils";
  52. import {
  53. queryMenuConfig
  54. } from "@/utils/network/api.js";
  55. import {
  56. request
  57. } from "@/utils/network/request.js";
  58. import {
  59. getItem,
  60. StorageKeys,
  61. } from "@/utils/storage";
  62. import {
  63. stringToJson
  64. } from "@/utils/network/encryption";
  65. const bgOrange = `url(${fileURL}image/service/bg-orange.png) center center no-repeat`;
  66. const bgBlue = `url(${fileURL}image/service/bg-blue.png) center center no-repeat`;
  67. const activeTab = ref("业务服务");
  68. const tableSelectIndex = ref(0);
  69. // 切换
  70. function tabHandle(val, index) {
  71. activeTab.value = val;
  72. tableSelectIndex.value = index
  73. console.log(tableSelectIndex.value)
  74. }
  75. const menu = reactive({
  76. list: []
  77. });
  78. onLoad(() => {
  79. queryMenuConfigAction().then((val : any) => {
  80. menu.list = val.menuList??[]
  81. })
  82. });
  83. const queryMenuConfigAction = () => {
  84. var data = {
  85. openId: getItem(StorageKeys.OpenId),
  86. systemType: '6',
  87. loginSource: '69af303ba2eb4608a099163f0d2a5dbd'
  88. };
  89. const options = {
  90. type: 2,
  91. data: data,
  92. method: "POST",
  93. showLoading: true,
  94. };
  95. return new Promise(async (resolve, reject) => {
  96. const res = await request(queryMenuConfig, options);
  97. const data = stringToJson(res.bizContent);
  98. resolve(data);
  99. }).catch((error) => {
  100. reject(error);
  101. });
  102. }
  103. function toNext(url) {
  104. uni.navigateTo({
  105. url: url,
  106. });
  107. }
  108. </script>
  109. <style>
  110. page {
  111. height: 100%;
  112. }
  113. .wrapper {
  114. display: flex;
  115. background: linear-gradient(to left, #43a1e0 0%, #13e7c1 100%);
  116. flex-direction: column;
  117. height: 100%;
  118. }
  119. .search-box {
  120. margin: 50rpx 40rpx;
  121. height: 72rpx;
  122. border-radius: 36rpx;
  123. background: #f7f7f7;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. }
  128. .search-box .icon {
  129. width: 48rpx;
  130. height: 48rpx;
  131. margin: 0 20rpx;
  132. }
  133. .search-box .search {
  134. flex: 1;
  135. margin-right: 20rpx;
  136. height: 100%;
  137. padding: 0 10rpx;
  138. font-size: 28rpx;
  139. color: #00b38b;
  140. }
  141. .content {
  142. display: flex;
  143. flex: 1;
  144. flex-grow: 1;
  145. background: #fff;
  146. border-radius: 30rpx 30rpx 0 0;
  147. padding-top: 40rpx;
  148. }
  149. .left {
  150. width: 180rpx;
  151. border-right: 1px solid #dcdcdc;
  152. margin-right: 29rpx;
  153. }
  154. .left .menu-text {
  155. font-size: 26rpx;
  156. color: #666666;
  157. width: 120rpx;
  158. }
  159. .left .menu {
  160. padding-left: 15rpx;
  161. display: flex;
  162. align-items: center;
  163. margin: 20rpx 0 60rpx 0;
  164. }
  165. .left .active .menu-text {
  166. font-weight: bold;
  167. color: #00b38b;
  168. font-size: 28rpx;
  169. line-height: 32rpx;
  170. }
  171. .left .border {
  172. width: 9rpx;
  173. height: 26rpx;
  174. border-radius: 4rpx;
  175. margin-right: 20rpx;
  176. }
  177. .left .on {
  178. background: linear-gradient(0deg, #43a1e0 0%, #13e7c1 100%);
  179. font-size: 28rpx;
  180. }
  181. .right {
  182. flex: 1;
  183. }
  184. .right-content {
  185. display: flex;
  186. flex-wrap: wrap;
  187. }
  188. .right .item-box {
  189. display: flex;
  190. flex-direction: column;
  191. justify-content: center;
  192. align-items: center;
  193. margin-right: 30rpx;
  194. margin-bottom: 39rpx;
  195. }
  196. .item {
  197. width: 105rpx;
  198. height: 105rpx;
  199. display: flex;
  200. justify-content: center;
  201. align-items: center;
  202. border-radius: 20rpx;
  203. }
  204. .item image {
  205. width: 64rpx;
  206. height: 64rpx;
  207. }
  208. .right .text {
  209. width: 105rpx;
  210. font-size: 22rpx;
  211. text-align: center;
  212. height: 60rpx;
  213. display: flex;
  214. justify-content: center;
  215. align-items: center;
  216. margin-top: 19rpx;
  217. color: #666666;
  218. }
  219. .bg-blue {
  220. background: var(--background);
  221. }
  222. .bg-orange {
  223. background: var(--background);
  224. }
  225. .right .text-orange {
  226. color: #fd8362;
  227. }
  228. </style>