mineConfigurationSlot.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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(mineConfig.layout)">
  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(item) {
  78. console.log(item)
  79. if (item.buttonType === 'page') {
  80. if (item.route === 'mineWarningRecording') { //预警记录
  81. uni.navigateTo({
  82. url: item.routeUrl,
  83. });
  84. }
  85. if (item.route === 'laboratory') { //我的实验室
  86. uni.navigateTo({
  87. url: item.routeUrl,
  88. });
  89. }
  90. if (item.route === 'PlanExecuteRecord') { //预案执行记录
  91. uni.navigateTo({
  92. url: item.routeUrl,
  93. });
  94. }
  95. if (item.route === 'faceImage') { //身份验证
  96. uni.navigateTo({
  97. url: item.routeUrl,
  98. });
  99. }
  100. } else if (item.buttonType === 'button') {
  101. } else if (item.buttonType === 'none') {
  102. uni.showToast({
  103. title: '暂未开放',
  104. icon: "none",
  105. mask: true,
  106. duration: 2000
  107. });
  108. }
  109. },
  110. },
  111. }
  112. </script>
  113. <style lang="stylus" scoped>
  114. .mineConfigurationSlot {
  115. margin: 0;
  116. background: #fff;
  117. padding: 0 20rpx;
  118. margin-top: 30rpx;
  119. .button-for-box:last-of-type {
  120. .button-max-box {
  121. border: none !important;
  122. }
  123. }
  124. .button-max-box {
  125. height: 100rpx;
  126. display flex;
  127. border-bottom: 1px solid #e0e0e0;
  128. .left-img {
  129. height: 30rpx;
  130. width: 30rpx;
  131. margin: 34rpx 44rpx 0 0;
  132. }
  133. view {
  134. line-height: 100rpx;
  135. }
  136. view:nth-child(2) {
  137. flex: 1;
  138. color: #333333;
  139. font-size: 30rpx;
  140. }
  141. .right-img {
  142. height: 24rpx;
  143. width: 12rpx;
  144. margin: 39rpx 0 0 0;
  145. }
  146. .colorA {
  147. color: #E45656 !important;
  148. }
  149. .marginType {
  150. margin-right: 12rpx;
  151. }
  152. .view-three-one {
  153. width: 30rpx;
  154. height: 30rpx;
  155. text-align center;
  156. background #FF4552;
  157. border-radius: 50%;
  158. font-size: 20rpx;
  159. line-height: 30rpx;
  160. color: #fff;
  161. margin: 36rpx 20rpx;
  162. }
  163. .view-three-two {
  164. width: 30rpx;
  165. height: 30rpx;
  166. text-align center;
  167. border-radius: 50%;
  168. font-size: 20rpx;
  169. line-height: 30rpx;
  170. color: #999;
  171. margin: 36rpx 20rpx;
  172. }
  173. .view-three-type {
  174. width: 120rpx;
  175. text-align center;
  176. color: #CCCCCC;
  177. font-size: 26rpx;
  178. }
  179. }
  180. }
  181. </style>