home.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view id="hazardousWasteRecyclingHome">
  3. <view class="max-big-button-box" v-if="buttonTypeA" @click="goPage(1)">
  4. <img class="left-box" :src="imagesUrl('hazardousWasteRecycling/wfhs_hsbb.png')">
  5. <view class="right-box">
  6. <view>回收报备</view>
  7. <view>可在回收日前填写报备单</view>
  8. </view>
  9. </view>
  10. <view class="max-big-button-box" v-if="buttonTypeB" @click="goPage(2)">
  11. <img class="left-box" :src="imagesUrl('hazardousWasteRecycling/wfhs_czdj.png')">
  12. <view class="right-box">
  13. <view>登记称重</view>
  14. <view>请在回收日等待回收,完成称重登记</view>
  15. </view>
  16. </view>
  17. <view class="max-big-button-box" @click="goPage(3)">
  18. <img class="left-box" :src="imagesUrl('hazardousWasteRecycling/wfhs_lsjl.png')">
  19. <view class="right-box">
  20. <view>历史记录</view>
  21. <view>查看我的危废回收记录</view>
  22. </view>
  23. </view>
  24. <view class="max-big-button-box" @click="goPage(4)">
  25. <img class="left-box" :src="imagesUrl('hazardousWasteRecycling/wfhs_qxsq.png')">
  26. <view class="right-box">
  27. <view>权限申请</view>
  28. <view>查看我的申请,提交新申请</view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. hwmsAppRegisterApprovalMenuShow,
  36. hwmsRecycleConfigList,
  37. } from '@/pages_hazardousWasteRecycling/api/index.js'
  38. export default {
  39. data() {
  40. return {
  41. buttonTypeA:false,
  42. buttonTypeB:false,
  43. switchType:false,
  44. }
  45. },
  46. onLoad(option) {
  47. },
  48. onShow() {
  49. this.hwmsRecycleConfigList();
  50. this.hwmsAppRegisterApprovalMenuShow();
  51. },
  52. mounted() {
  53. },
  54. methods: {
  55. async hwmsRecycleConfigList(){
  56. let self = this;
  57. const {
  58. data
  59. } = await hwmsRecycleConfigList()
  60. if (data.code == 200) {
  61. for(let i=0;i<data.data.length;i++){
  62. if(data.data[i].configKey == 'HWMS_MASTER_SWITCH'){
  63. self.$set(self,'switchType',data.data[i].configValue == 1?true:false);
  64. }
  65. }
  66. }
  67. },
  68. async hwmsAppRegisterApprovalMenuShow(){
  69. const {
  70. data
  71. } = await hwmsAppRegisterApprovalMenuShow()
  72. if (data.code == 200) {
  73. if(data.data == 1){
  74. this.$set(this,'buttonTypeA',true);
  75. this.$set(this,'buttonTypeB',true);
  76. }else if(data.data == 2){
  77. this.$set(this,'buttonTypeA',true);
  78. this.$set(this,'buttonTypeB',false);
  79. }else if(data.data == 3){
  80. this.$set(this,'buttonTypeA',false);
  81. this.$set(this,'buttonTypeB',true);
  82. }else if(data.data == 4){
  83. this.$set(this,'buttonTypeA',false);
  84. this.$set(this,'buttonTypeB',false);
  85. }
  86. }
  87. },
  88. goPage(type){
  89. if(type == 1){
  90. if(!this.switchType){
  91. uni.showToast({
  92. title: '危废回收已关闭 , 如有疑问请联系管理员',
  93. icon: "none",
  94. mask: true,
  95. duration: 2000
  96. });
  97. return
  98. }
  99. uni.navigateTo({
  100. url: "/pages_hazardousWasteRecycling/views/recyclingReportRecord/index",
  101. });
  102. }else if(type == 2){
  103. uni.navigateTo({
  104. url: "/pages_hazardousWasteRecycling/views/weighingRegistration/index",
  105. });
  106. }else if(type == 3){
  107. uni.navigateTo({
  108. url: "/pages_hazardousWasteRecycling/views/historicalRecords/index",
  109. });
  110. }else if(type == 4){
  111. // uni.navigateTo({
  112. // url: "/pages_hazardousWasteRecycling/views/permissionApply/index",
  113. // });
  114. uni.navigateTo({
  115. url: "/pages_hazardousWasteRecycling/views/permissionApply/listPage",
  116. });
  117. }
  118. },
  119. },
  120. }
  121. </script>
  122. <style lang="stylus" scoped>
  123. #hazardousWasteRecyclingHome {
  124. height: 100%;
  125. display flex;
  126. flex-direction column;
  127. .max-big-button-box{
  128. background-color: #fff;
  129. border-radius:20rpx;
  130. margin:40rpx 40rpx 0;
  131. display: flex;
  132. .left-box{
  133. margin:40rpx 40rpx 40rpx 60rpx;
  134. width:160rpx;
  135. height:160rpx;
  136. border-radius:20rpx;
  137. }
  138. .right-box{
  139. view:nth-child(1){
  140. font-size:28rpx;
  141. color:#333;
  142. margin-top:70rpx;
  143. }
  144. view:nth-child(2){
  145. font-size:22rpx;
  146. color:#999;
  147. margin-top:20rpx;
  148. }
  149. }
  150. }
  151. }
  152. </style>