cms.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div style="width: 100%;height: 100%">
  3. <router-view class="bc" />
  4. <div class="footer">
  5. <b-nav fill class="tabBar">
  6. <b-nav-item to="/cms/home" @click="handleClick(1)" style="position: relative">
  7. <div v-show="state != 1" class="h5">
  8. <div>
  9. <img src="../assets/home/gn.png" style="width: 1.84rem;height: 1.84rem;" alt="">
  10. </div>
  11. </div>
  12. <div v-show="state == 1" class="h5">
  13. <div>
  14. <img src="../assets/home/gn.png" style="width: 1.84rem;height: 1.84rem;" alt="">
  15. </div>
  16. </div>
  17. <span style="font-size: 0.6rem" :class="state == 1 ? 'choose2' : ''">功能区</span>
  18. </b-nav-item>
  19. <b-nav-item @click="handleClick(2)" style="position: relative">
  20. <div v-show="state != 2" class="h5">
  21. <div>
  22. <img src="../assets/home/sm.png" style="width: 1.84rem;height: 1.84rem;" alt="">
  23. </div>
  24. </div>
  25. <div v-show="state == 2" class="h5">
  26. <div>
  27. <img src="../assets/home/smactive.png" style="width: 1.84rem;height: 1.84rem;" alt="">
  28. </div>
  29. </div>
  30. <span style="font-size: 0.6rem" :class="state == 2 ? 'choose2' : ''">扫描</span>
  31. </b-nav-item>
  32. <b-nav-item to="/cms/mine" @click="handleClick(3)" style="position: relative">
  33. <div v-show="state != 3" class="h5">
  34. <div>
  35. <img src="../assets/home/user.png" style="width: 1.84rem;height: 1.84rem;" alt="">
  36. </div>
  37. </div>
  38. <div v-show="state == 3" class="h5">
  39. <div>
  40. <img src="../assets/home/useractive.png" style="width: 1.84rem;height: 1.84rem;" alt="">
  41. </div>
  42. </div>
  43. <span style="font-size: 0.6rem" :class="state == 3 ? 'choose2' : ''">我的</span>
  44. </b-nav-item>
  45. </b-nav>
  46. </div>
  47. <Modal :closable="false" v-model="is_show" footer-hide>
  48. <div style="text-align: center">
  49. <Button type="primary" style="height: 4rem;width: 8rem" @click="handleGO">{{ !qrState ? "扫码枪扫描" : "停止扫描"
  50. }}</Button>
  51. <!-- <Button type="primary" style="height: 4rem" @click="handleGoQr"-->
  52. <!-- >二维码扫描</Button-->
  53. <!-- >-->
  54. </div>
  55. </Modal>
  56. </div>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. state: 1,
  63. is_show: false,
  64. qrState: false,
  65. target: [],
  66. }
  67. },
  68. mounted() {
  69. window.uploadEPC = this.uploadEPC;
  70. },
  71. methods: {
  72. handleGoQr() {
  73. this.is_show = false;
  74. this.$router.push('/cms/ceshi')
  75. },
  76. uploadEPC(e) {
  77. if (this.target.indexOf(JSON.stringify(e)) == -1) {
  78. this.target.push(JSON.stringify(e));
  79. }
  80. },
  81. handleGO () {
  82. const url = ['/cms/finish/detail', '/cms/dispatch/detail', '/cms/Inventory/detail']
  83. if (url.indexOf(this.$route.path) !== -1) {
  84. this.qrState = !this.qrState;
  85. if (this.qrState) {
  86. androidJs.startInventory();
  87. } else {
  88. androidJs.stopInventory();
  89. this.is_show = false;
  90. localStorage.setItem('fyy_target', JSON.stringify(this.target))
  91. this.target = []
  92. this.$router.replace('/cms/refresh')
  93. }
  94. }
  95. },
  96. handleClick(e) {
  97. this.state = e
  98. if (e == 2) {
  99. this.is_show = true;
  100. }
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss" scoped>
  106. .choose2 {
  107. color: #03FCD3;
  108. position: relative;
  109. }
  110. .bc {
  111. height: 100%;
  112. }
  113. .tabBar {
  114. width: 100%;
  115. color: #a8a2a2;
  116. }
  117. .footer {
  118. position: absolute;
  119. bottom: 0rem;
  120. width: 100%;
  121. height: 3.06rem;
  122. z-index: 1;
  123. background-image: url('../assets/home/tabbarlist.png');
  124. }
  125. .nav-link {
  126. color: #ABDFFF
  127. }
  128. .h5 {
  129. margin-bottom: 0;
  130. position: relative;
  131. top: 0.24rem;
  132. }
  133. .nav {
  134. --bs-nav-link-padding-x: 0rem;
  135. --bs-nav-link-padding-y: 0rem;
  136. }
  137. .choose {
  138. color: #03FCD3;
  139. }
  140. .circle {
  141. width: 3rem;
  142. height: 3rem;
  143. margin: 0 auto;
  144. position: absolute;
  145. }
  146. .choose_1 {
  147. border-radius: 50%;
  148. background: #03FCD3;
  149. top: -0.3rem;
  150. left: 50%;
  151. transform: translate(-50%, -50%);
  152. line-height: 2.3;
  153. z-index: 2;
  154. }
  155. .choose_3 {
  156. border-radius: 50%;
  157. background: #03FCD3;
  158. top: -0.3rem;
  159. left: 50%;
  160. transform: translate(-50%, -50%);
  161. line-height: 2.3;
  162. z-index: 2;
  163. }
  164. /deep/.ivu-modal {
  165. top: 42%;
  166. width: 8rem !important;
  167. left: 50%;
  168. transform: translate(-50%, -50%);
  169. margin: 0;
  170. }
  171. /deep/.ivu-modal-content{
  172. background-color:rgba(0, 0, 0, 0.6) !important;
  173. }
  174. /deep/.ivu-modal-body{
  175. padding: 0;
  176. }
  177. /deep/.ivu-btn-primary{
  178. background-color: #0f4680;
  179. }
  180. </style>