You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

service.vue 4.9KB

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