mineConfigurationSlot.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <!--
  2. 个人中心按钮匹配组件
  3. <mineConfigurationSlot :mineConfig="mineConfigData"></mineConfigurationSlot>
  4. import { mineConfigurationSlot } from '@/component/mineConfigurationSlot'
  5. import { getMineConfig } from '@/utils/mineConfig'
  6. components: {
  7. mineConfigurationSlot,
  8. },
  9. mineConfigData: [],
  10. //获取菜单配置
  11. async systemAppletLayoutSelect() {
  12. const {data} = await systemAppletLayoutSelect({module:'mine'})
  13. if(data.code == 200){
  14. let list = JSON.parse(JSON.stringify(data.data))
  15. for(let i=0;i<list.length;i++){
  16. list[i].layout = JSON.parse(list[i].layout);
  17. }
  18. this.$set(this,'mineConfigData',getMineConfig(list));
  19. console.log('mineConfigData',this.mineConfigData)
  20. }
  21. },
  22. -->
  23. <template>
  24. <view class="mineConfigurationSlot">
  25. <view class="button-max-big-box">
  26. <permissionsSlot class="button-for-box" v-for="(item,index) in mineConfig.layout" :key="item.id"
  27. :hasPermi="item.limits">
  28. <view class="button-max-box" @click="buttonClick(index)">
  29. <img class="left-img" :src="item.img">
  30. <view>{{item.name}}</view>
  31. <view class="view-three-one" v-if="item.route === 'mineWarningRecording' && securityAlertNum>0">
  32. {{securityAlertNum}}</view>
  33. <view class="view-three-two" v-if="item.route === 'laboratory' && adminSubCount>0">{{adminSubCount}}</view>
  34. <view class="view-three-two" v-if="item.route === 'PlanExecuteRecord' && wranDoCount>0">{{wranDoCount}}</view>
  35. <view class="view-three-type" v-if="item.route === 'faceImage'"
  36. :class="ifFaceFeature==''?'colorA':'marginType'">
  37. {{ifFaceFeature==''?'去认证':'已认证'}}
  38. </view>
  39. <img class="right-img" src="@/images/basicsModules/icon_04.png">
  40. </view>
  41. </permissionsSlot>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. fingerprintQueryList
  48. } from '@/api/basicsModules/index.js'
  49. export default {
  50. name: "mineConfigurationSlot",
  51. props: {
  52. mineConfig: {},
  53. // 人脸
  54. ifFaceFeature: "",
  55. //签名
  56. isUpload: "",
  57. Quantity: 0, //指纹录取数量
  58. //用户签名
  59. signatureUrl: "",
  60. //预案执行记录
  61. wranDoCount: 10,
  62. //我的实验室
  63. adminSubCount: 0,
  64. //预警记录
  65. securityAlertNum: 10,
  66. },
  67. data() {
  68. return {}
  69. },
  70. created() {
  71. // this.$set(this, 'ifFaceFeature', data.data.faceImg)
  72. },
  73. mounted() {
  74. },
  75. methods: {
  76. //按钮点击事件
  77. buttonClick(index) {
  78. if (this.mineConfig.layout[index].buttonType === 'page') {
  79. if (this.mineConfig.layout[index].route === 'mineWarningRecording') { //预警记录
  80. uni.navigateTo({
  81. url: this.mineConfig.layout[index].routeUrl,
  82. });
  83. }
  84. if (this.mineConfig.layout[index].route === 'laboratory') { //我的实验室
  85. uni.navigateTo({
  86. url: this.mineConfig.layout[index].routeUrl,
  87. });
  88. }
  89. if (this.mineConfig.layout[index].route === 'PlanExecuteRecord') { //预案执行记录
  90. uni.navigateTo({
  91. url: this.mineConfig.layout[index].routeUrl,
  92. });
  93. }
  94. if (this.mineConfig.layout[index].route === 'faceImage') { //身份验证
  95. uni.navigateTo({
  96. url: this.mineConfig.layout[index].routeUrl,
  97. });
  98. }
  99. } else if (this.mineConfig.layout[index].buttonType === 'button') {
  100. } else if (this.mineConfig.layout[index].buttonType === 'none') {
  101. uni.showToast({
  102. title: '暂未开放',
  103. icon: "none",
  104. mask: true,
  105. duration: 2000
  106. });
  107. }
  108. },
  109. },
  110. }
  111. </script>
  112. <style lang="stylus" scoped>
  113. .mineConfigurationSlot {
  114. margin: 0;
  115. background: #fff;
  116. padding: 0 20rpx;
  117. margin-top: 30rpx;
  118. .button-for-box:last-of-type {
  119. .button-max-box {
  120. border: none !important;
  121. }
  122. }
  123. .button-max-box {
  124. height: 100rpx;
  125. display flex;
  126. border-bottom: 1px solid #e0e0e0;
  127. .left-img {
  128. height: 30rpx;
  129. width: 30rpx;
  130. margin: 34rpx 44rpx 0 0;
  131. }
  132. view {
  133. line-height: 100rpx;
  134. }
  135. view:nth-child(2) {
  136. flex: 1;
  137. color: #333333;
  138. font-size: 30rpx;
  139. }
  140. .right-img {
  141. height: 24rpx;
  142. width: 12rpx;
  143. margin: 39rpx 0 0 0;
  144. }
  145. .colorA {
  146. color: #E45656 !important;
  147. }
  148. .marginType {
  149. margin-right: 12rpx;
  150. }
  151. .view-three-one {
  152. width: 30rpx;
  153. height: 30rpx;
  154. text-align center;
  155. background #FF4552;
  156. border-radius: 50%;
  157. font-size: 20rpx;
  158. line-height: 30rpx;
  159. color: #fff;
  160. margin: 36rpx 20rpx;
  161. }
  162. .view-three-two {
  163. width: 30rpx;
  164. height: 30rpx;
  165. text-align center;
  166. border-radius: 50%;
  167. font-size: 20rpx;
  168. line-height: 30rpx;
  169. color: #999;
  170. margin: 36rpx 20rpx;
  171. }
  172. .view-three-type {
  173. width: 120rpx;
  174. text-align center;
  175. color: #CCCCCC;
  176. font-size: 26rpx;
  177. }
  178. }
  179. }
  180. </style>