123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <template>
- <g-toast :is-show="isShowToast">
- <scroll-view class="courseDialog" scroll-y="true">
- <image
- :src="serverUserInfo.link"
- mode="widthFix"
- class="courseImg"
- @click="toCourseList"
- />
- </scroll-view>
- </g-toast>
- </template>
- <script>
- import { toCourseToast } from "../../utils/api/toast.js"
- import GToast from "../../components/global/toast.vue"
- export default {
- components: {
- GToast
- },
- data() {
- return {
- serverUserInfo: uni.getStorageSync("serverUserInfo"),
- initToast: true
- }
- },
- computed: {
- isShowToast() {
- let { link } = this.serverUserInfo
- return this.initToast && link
- }
- },
- methods: {
- // 跳转课程
- toCourseList() {
- toCourseToast().then(res => {
- if(res.code === 200) {
- let { end_time:e, start_time:s } = this.userServerInfo
- let w = Math.ceil((e - s) / (7 * 24 * 60 * 60 * 1000))
- uni.navigateTo({
- url: '../course/list?week=' + w
- })
- } else {
- uni.showModal({
- title: '失败',
- content: '课程确认失败',
- showCancel: false
- })
- }
- }).catch(() => {
- uni.showModal({
- title: '失败',
- content: '课程确认失败',
- showCancel: false
- })
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .courseDialog {
- width: 80%;
- margin: 0 auto;
- height: 700rpx;
- .courseImg {
- display: block;
- width: 100%;
- }
- }
- </style>
|