applicationCenter.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="app-page">
  3. <view class="handle-wrap">
  4. <view class="title">快捷操作</view>
  5. <view class="tabs">
  6. <view class="tab-item" v-for="(item,quickIdx) in quickList" :key="quickIdx" @click="linkTo(item)">
  7. <div class="icon-box">
  8. <image class="icon" :src="item.miniLogo" mode="widthFix"></image>
  9. </div>
  10. <view class="name">{{item.miniTitle}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="app-category" v-for="(appList,appIdx) in items" :key="appIdx">
  15. <view class="title">{{appList.miniCatTitle}}</view>
  16. <view class="applist">
  17. <view class="app" v-for="(app,index) in appList.miniList" :key="index" @click="linkTo(app)">
  18. <image class="icon" :src="app.miniLogo"></image>
  19. <view class="info">
  20. <view class="app-title">{{app.miniTitle}}</view>
  21. <view class="tag" v-if="app.miniDesc">{{app.miniDesc}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {getAppList,getQuickList} from '@/api/system/app.js'
  30. export default {
  31. data() {
  32. return {
  33. items:[],
  34. quickList:[]
  35. }
  36. },
  37. onShow() {
  38. this.getData()
  39. },
  40. methods: {
  41. getData(){
  42. getAppList().then((res)=>{
  43. this.items=res.data
  44. })
  45. getQuickList().then((res)=>{
  46. this.quickList=res.data
  47. })
  48. },
  49. linkToTab(id,name){
  50. let href=""
  51. if(id===1){href="http://h5.xazhyc.com/danger/index.html"}
  52. if(id===2){href="http://h5.xazhyc.com/task/index.html"}
  53. if(id===3){href="http://h5.xazhyc.com/checkRecord/index.html"}
  54. if(id===4){href="http://h5.xazhyc.com/problem_feedback/problem_feedback.html"}
  55. uni.navigateTo({
  56. url:`/pages/webview/webview?href=${href}&name=${name}`
  57. })
  58. },
  59. linkTo(app){
  60. if(app.miniUrl===""||app.miniUrl==undefined||app.miniUrl===null){
  61. uni.showToast({
  62. icon:"none",
  63. title:"请联系管理员开放应用地址"
  64. })
  65. return
  66. }
  67. if(app.miniUrl.includes('http')){
  68. uni.navigateTo({
  69. url:`/pages/webview/webview?href=${app.miniUrl}&name=${app.miniTitle}`
  70. })
  71. }else{
  72. uni.showToast({
  73. icon:"none",
  74. title:"请联系管理员配置应用地址"
  75. })
  76. }
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .app-page{
  83. padding: 32rpx;
  84. background-color: rgba(243, 244, 247, 1);
  85. box-sizing: border-box;
  86. min-height: 100vh;
  87. .handle-wrap{
  88. background: linear-gradient(159.65deg, #FFF8E8 11.95%, #FFFFFF 20.49%, #FFFFFF 86.47%),
  89. linear-gradient(0deg, #FFFFFF, #FFFFFF);
  90. border-radius: 12rpx;
  91. padding: 32rpx 0;
  92. .title{
  93. color: #000;
  94. font-size: 32rpx;
  95. padding-left:24rpx;
  96. }
  97. .tabs{
  98. display: flex;
  99. justify-content: space-around;
  100. align-items: center;
  101. padding:0 32rpx;
  102. margin-top: 32rpx;
  103. .tab-item{
  104. width: 112rpx;
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. flex-direction: column;
  109. .icon-box{
  110. width: 96rpx;
  111. height: 96rpx;
  112. border-radius: 26rpx;
  113. background-color: #2a60f3;
  114. .icon{
  115. width: 96rpx;
  116. height: 96rpx;
  117. }
  118. }
  119. .name{
  120. width: 100%;
  121. padding-top: 12rpx;
  122. color: rgba(0, 0, 0, 0.9);
  123. font-size: 28rpx;
  124. overflow: hidden;
  125. text-overflow: ellipsis;
  126. white-space: nowrap;
  127. word-break: break-all;
  128. }
  129. }
  130. }
  131. }
  132. .app-category{
  133. .title{
  134. color: #000;
  135. font-size: 32rpx;
  136. line-height: 1;
  137. padding: 48rpx 24rpx 32rpx 24rpx;
  138. }
  139. .applist{
  140. display: flex;
  141. flex-wrap: wrap;
  142. .app{
  143. width: 330rpx;
  144. height: 160rpx;
  145. background-color: #fff;
  146. border-radius: 16rpx;
  147. margin-bottom: 20rpx;
  148. display: flex;
  149. padding: 32rpx 0 0 28rpx;
  150. box-sizing: border-box;
  151. &:nth-child(2n){
  152. margin-left: 18rpx;
  153. }
  154. .icon{
  155. width: 66rpx;
  156. height: 66rpx;
  157. border-radius: 50%;
  158. background-color:rgba(151, 179, 255, 1);
  159. img{
  160. border: 1px solid red;
  161. }
  162. }
  163. .info{
  164. padding-left: 20rpx;
  165. padding-top: 4rpx;
  166. .app-title{
  167. width: 200rpx;
  168. color: rgba(34, 34, 34, 1);
  169. font-size: 32rpx;
  170. overflow: hidden;
  171. text-overflow: ellipsis;
  172. white-space: nowrap;
  173. }
  174. .tag{
  175. max-width: 202rpx;
  176. height: 48rpx;
  177. display:inline-block;
  178. margin-top: 6rpx;
  179. color: rgba(255, 171, 8, 1);
  180. font-size:24rpx;
  181. background: rgba(255, 171, 8, 0.1);
  182. border-radius: 12rpx;
  183. padding: 4rpx 10rpx;
  184. box-sizing: border-box;
  185. text-overflow: ellipsis;
  186. overflow: hidden;
  187. white-space: nowrap;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. }
  194. </style>