Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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