saoCode.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!--扫描二维码页面-->
  2. <template>
  3. <view id="saoCode">
  4. <web-view :src="'https://lab.sxitdlc.com/jndxlabSystem/admin/#/codeHtml?code='+code+'&type='+type"></web-view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. name: "saoCode",
  10. data() {
  11. return {
  12. code:"",
  13. type:"",
  14. }
  15. },
  16. onLoad(option) {
  17. let self = this;
  18. if(option.q){
  19. let text = decodeURIComponent(option.q)
  20. let list = text.split("?")[1].split("&");
  21. for(let i=0;i<list.length;i++){
  22. let newList = list[i].split("=");
  23. if(newList[0] == 'code'){
  24. self.code = newList[1];
  25. }else if(newList[0] == 'type'){
  26. self.type = newList[1];
  27. }
  28. }
  29. if(!uni.getStorageSync('token')){
  30. uni.setStorageSync('saoCode',this.code);
  31. uni.setStorageSync('saoType',this.type);
  32. uni.redirectTo({
  33. url: '/pages/login',
  34. });
  35. }
  36. }else{
  37. this.code = uni.getStorageSync('saoCode');
  38. this.type = uni.getStorageSync('saoType');
  39. uni.removeStorageSync('saoCode');
  40. uni.removeStorageSync('saoType');
  41. }
  42. },
  43. mounted(){
  44. },
  45. methods:{
  46. },
  47. }
  48. </script>
  49. <style lang="stylus" scoped>
  50. #saoCode{
  51. overflow scroll
  52. }
  53. </style>