12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <template>
- <div class="disk-page">
- <disk :user-card-id="userCardId"></disk>
- </div>
- </template>
- <script>
- import qs from 'qs';
- const isNew = false;
- export default {
- name: 'DiskPage',
- middleware: [
- async ({ base, route, $axios, $auth, redirect, $userAgent }) => {
- if (isNew) {
- return;
- }
- const res = await $axios.$get(
- '/resources/v5/client/disk/info/userCard/single',
- {
- params: {
- userCardId: route.params.id,
- },
- },
- );
- const {
- userCardId,
- userName,
- room,
- buyVipType,
- sourceType,
- authPhone,
- validTime,
- } = res.data;
- const token = $auth.strategy.token.get();
- const url = `${location.origin}${base}${
- $userAgent.isIos ? 'screenIos' : 'screenAndroid'
- }/WXtrialInterface.html${qs.stringify(
- {
- userCardId,
- username: $auth.user.username,
- token,
- rm: room,
- mealType: buyVipType,
- sourceType,
- authPhone: authPhone ? 'huo' : 'none',
- validTime,
- },
- {
- addQueryPrefix: true,
- },
- )}`;
- redirect(url);
- },
- ],
- data() {
- return {
- userCardId: null,
- };
- },
- fetch() {
- this.userCardId = +this.$route.params.id;
- },
- methods: {},
- };
- </script>
- <style lang="scss" scoped>
- .disk-page {
- height: 100vh;
- position: relative;
- }
- </style>
|