yujialong 4 months ago
parent 3d32d5436e
commit 5aeda75e21
  1. 81
      src/pages/account/redirect/index.vue
  2. 2
      src/pages/product/show/index.vue
  3. 15
      src/pages/station/list/index.vue
  4. 48
      src/pages/station/preview/index.vue

@ -5,50 +5,49 @@ import { mapActions, mapMutations } from "vuex";
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from "@/setting"; import Setting from "@/setting";
export default { export default {
data: function() { data: function () {
return { return {
token: this.$route.query.auth token: this.$route.query.auth
}; };
},
mounted () {
localStorage.removeItem('opened')
this.token ? this.setLogin() : this.$router.replace('/login')
},
methods: {
...mapMutations("user", [
"SET_ROLENAME", 'SET_FROM'
]),
...mapActions("user", [
"setCustomer", "setCustomerName"
]),
setLogin () {
this.SET_FROM(true)
util.local.set(Setting.tokenKey, window.atob(decodeURI(this.token)), Setting.tokenExpires);
this.getRole()
this.queryCustomer()
}, },
mounted() { //
this.token ? this.setLogin() : this.$router.replace('/login') getRole () {
this.$post(`${this.api.getUserAllRoleByToken}?platformId=${Setting.platformId}`).then(res => {
this.SET_ROLENAME(res)
}).catch(err => { })
}, },
methods: { queryCustomer () { //
...mapMutations("user", [ this.$get(this.api.isClient).then(res => {
"SET_ROLENAME", 'SET_FROM' util.successMsg('登录成功')
]), this.setCustomer(res.customer)
...mapActions("user", [ this.setCustomerName(res.customerName)
"setCustomer", "setCustomerName"
]), const path = '/product/list' //
setLogin() { this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
this.SET_FROM(true) const list = res.permissionMenu[0].children
util.local.set(Setting.tokenKey, window.atob(decodeURI(this.token)), Setting.tokenExpires); this.$router.push(list.find(e => e.path === path) ? path : list[0].path)
this.getRole() }).catch(err => { })
this.queryCustomer() }).catch(res => { })
},
//
getRole() {
this.$post(`${this.api.getUserAllRoleByToken}?platformId=${Setting.platformId}`).then(res => {
this.SET_ROLENAME(res)
}).catch(err => {})
},
queryCustomer() { //
this.$get(this.api.isClient).then(res => {
util.successMsg('登录成功')
this.setCustomer(res.customer)
this.setCustomerName(res.customerName)
const path = '/product/list' //
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const list = res.permissionMenu[0].children
this.$router.push(list.find(e => e.path === path) ? path : list[0].path)
}).catch(err => {})
}).catch(res => {})
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -128,6 +128,7 @@
</template> </template>
<script> <script>
import Util from "@/libs/util";
export default { export default {
data () { data () {
return { return {
@ -277,6 +278,7 @@ export default {
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
}) })
await this.$post(`${this.api.requestRenewalNotice}?mallId=${this.id}`) await this.$post(`${this.api.requestRenewalNotice}?mallId=${this.id}`)
Util.successMsg('续费申请提交成功!')
} catch (e) { } } catch (e) { }
}, },
// //

@ -21,7 +21,8 @@
<div v-else class="cover" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }"></div> <div v-else class="cover" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }"></div>
<div class="bottom"> <div class="bottom">
<p class="text"><span>{{ item.goodsName || item.curriculumName }}</span></p> <p class="text"><span>{{ item.goodsName || item.curriculumName }}</span></p>
<a>{{ item.isInEffect ? '进入实验' : '续费' }}</a> <a v-if="!item.isInEffect">续费</a>
<a v-else-if="item.cid">进入实验</a>
</div> </div>
</div> </div>
</template> </template>
@ -55,7 +56,7 @@ export default {
isZj: location.host === '10.60.32.76', // isZj: location.host === '10.60.32.76', //
isSq: Setting.isSq, isSq: Setting.isSq,
keyword: this.$route.query.keyword || '', keyword: this.$route.query.keyword || '',
active: +this.$route.query.active || '', active: +this.$route.query.active || 0,
searchTimer: null, searchTimer: null,
tabs: [], tabs: [],
products: [], products: [],
@ -78,15 +79,15 @@ export default {
async getTab () { async getTab () {
const { data } = await this.$get(this.api.getSchoolCourseAuthority) const { data } = await this.$get(this.api.getSchoolCourseAuthority)
this.tabs = [ this.tabs = [
{
classificationId: 0,
classificationName: '最近使用',
},
{ {
classificationId: '', classificationId: '',
classificationName: '全部', classificationName: '全部',
}, },
...data, ...data,
{
classificationId: 0,
classificationName: '最近使用',
},
] ]
this.getList() this.getList()
}, },
@ -99,7 +100,7 @@ export default {
pageSize: 100, pageSize: 100,
goodsName: this.keyword, goodsName: this.keyword,
}) })
this.curriculumList = page.records this.products = page.records
} else { } else {
const { data } = await this.$get(this.api.schoolCourse, { const { data } = await this.$get(this.api.schoolCourse, {
authority: this.active, authority: this.active,

@ -440,14 +440,16 @@ export default {
this.addRecord() this.addRecord()
}, },
async getData () { async getData () {
let { data } = await this.$post(`${this.api.curriculumDetail}?cid=${this.courseId}&mallId=${this.mallId}`); if (this.courseId) {
this.courseName = data.curriculumName; let { data } = await this.$post(`${this.api.curriculumDetail}?cid=${this.courseId}&mallId=${this.mallId}`);
// this.coverUrl = data.coverUrl; this.courseName = data.curriculumName;
this.briefIntroduction = data.briefIntroduction; // this.coverUrl = data.coverUrl;
this.teachingObjectives = data.teachingObjectives; this.briefIntroduction = data.briefIntroduction;
this.assessmentList = data.assessmentConfig; this.teachingObjectives = data.teachingObjectives;
this.systemIds = data.systemIds this.assessmentList = data.assessmentConfig;
this.queryProject() this.systemIds = data.systemIds
this.queryProject()
}
this.getStatus() this.getStatus()
}, },
// 使 // 使
@ -467,23 +469,27 @@ export default {
}, },
// //
async getChapter () { async getChapter () {
let res = await this.$get(`${this.api.curriculumChapter}/${this.courseId}`); if (this.courseId) {
this.chapterList = res.chapterList; let res = await this.$get(`${this.api.curriculumChapter}/${this.courseId}`);
const chapter = this.chapter === undefined ? 0 : +this.chapter this.chapterList = res.chapterList;
const section = this.section === undefined ? 0 : +this.section const chapter = this.chapter === undefined ? 0 : +this.chapter
const clist = this.chapterList[chapter] const section = this.section === undefined ? 0 : +this.section
if (this.chapterList.length && clist.subsectionList && clist.subsectionList.length && !this.commentId) { const clist = this.chapterList[chapter]
this.preview(clist.subsectionList[section], clist.name, 1); if (this.chapterList.length && clist.subsectionList && clist.subsectionList.length && !this.commentId) {
this.preview(clist.subsectionList[section], clist.name, 1);
}
} }
}, },
// //
async getProgress () { async getProgress () {
let res = await this.$post(`${this.api.courseLearningProgress}?courseId=${this.courseId}&systemId=${this.systemIds}&mallId=${this.mallId}`); if (this.courseId) {
this.progressList = res.list let res = await this.$post(`${this.api.courseLearningProgress}?courseId=${this.courseId}&systemId=${this.systemIds}&mallId=${this.mallId}`);
if (res.list.length) this.archProject = res.list[0].projectId this.progressList = res.list
this.maximumScores.length || this.getMaximumScore() if (res.list.length) this.archProject = res.list[0].projectId
this.plan = res.plan this.maximumScores.length || this.getMaximumScore()
this.schedule = +(res.schedule.replace('%', '')) this.plan = res.plan
this.schedule = +(res.schedule.replace('%', ''))
}
}, },
// //
async getMaximumScore () { async getMaximumScore () {

Loading…
Cancel
Save