_id.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class="disk-page">
  3. <disk :user-card-id="userCardId"></disk>
  4. </div>
  5. </template>
  6. <script>
  7. import qs from 'qs';
  8. const isNew = false;
  9. export default {
  10. name: 'DiskPage',
  11. middleware: [
  12. async ({ base, route, $axios, $auth, redirect, $userAgent }) => {
  13. if (isNew) {
  14. return;
  15. }
  16. const res = await $axios.$get(
  17. '/resources/v5/client/disk/info/userCard/single',
  18. {
  19. params: {
  20. userCardId: route.params.id,
  21. },
  22. },
  23. );
  24. const {
  25. userCardId,
  26. userName,
  27. room,
  28. buyVipType,
  29. sourceType,
  30. authPhone,
  31. validTime,
  32. id,
  33. } = res.data;
  34. const token = $auth.strategy.token.get();
  35. const url = `${location.origin}${base}${
  36. $userAgent.isIos ? 'screenIos' : 'screenAndroid'
  37. }/WXtrialInterface.html${qs.stringify(
  38. {
  39. userCardId,
  40. username: $auth.user.username,
  41. token,
  42. rm: room,
  43. mealType: buyVipType,
  44. sourceType,
  45. authPhone: authPhone ? 'huo' : 'none',
  46. validTime,
  47. record: id,
  48. },
  49. {
  50. addQueryPrefix: true,
  51. },
  52. )}`;
  53. redirect(url);
  54. },
  55. ],
  56. data() {
  57. return {
  58. userCardId: null,
  59. };
  60. },
  61. fetch() {
  62. this.userCardId = +this.$route.params.id;
  63. },
  64. methods: {},
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .disk-page {
  69. height: 100vh;
  70. position: relative;
  71. }
  72. </style>