index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view>
  3. </view>
  4. </template>
  5. <script>
  6. var _this;
  7. export default {
  8. data() {
  9. return {
  10. code: '',
  11. userinfo: '',
  12. }
  13. },
  14. onLoad: function(option) {
  15. _this = this;
  16. if (JSON.stringify(option) == "{}") {
  17. let code = uni.getStorageSync('out_code');
  18. _this.code = code;
  19. } else {
  20. const q = option.q;
  21. _this.code = q.replace('https%3A%2F%2Flinggong.jinjianghc.com%2Fapplet%2Foutactivity%2Findex%3Fcode%3D','');
  22. uni.setStorageSync('out_code', _this.code);
  23. }
  24. _this.userinfo = uni.getStorageSync('userinfo') || false;
  25. if (_this.userinfo == false) {
  26. uni.redirectTo({
  27. url: '/pages/login/login?backpage=/pages/outactivity/index',
  28. });
  29. } else {
  30. //二维码校验
  31. _this.$req.ajax({
  32. path: "Outactivity/checkCode",
  33. data: {
  34. code: _this.code
  35. }
  36. }).then((data) => {
  37. uni.redirectTo({
  38. url: '/pages/outactivity/resumelist'
  39. })
  40. }).catch((err) => {
  41. uni.showModal({
  42. title: '信息提示',
  43. content: err,
  44. showCancel: false,
  45. success: function() {
  46. uni.removeStorageSync('out_code');
  47. uni.redirectTo({
  48. url: '/pages/index/index'
  49. });
  50. }
  51. });
  52. });
  53. }
  54. },
  55. }
  56. </script>
  57. <style>
  58. </style>