| | |
| | | if (bindingCode.code) { |
| | | let query = { |
| | | code: bindingCode.code, |
| | | isSocial: true // 公众号和开放平台是不同的主体,公众号绑定微信使用isSocial=true,开放平台(扫码绑定)使用isSocial=false; |
| | | isSocial: true, // 公众号和开放平台是不同的主体,公众号绑定微信使用isSocial=true,开放平台(扫码绑定)使用isSocial=false; |
| | | }; |
| | | MG.identity |
| | | .bindWeChat(query) |
| | | .then(res => { |
| | | .then((res) => { |
| | | const url = window.location.href; |
| | | const redirectUrl = url.split("?")[0]; |
| | | window.location.href = redirectUrl; |
| | | }) |
| | | .catch(res => { |
| | | .catch((res) => { |
| | | console.log(res); |
| | | }); |
| | | } else { |
| | |
| | | } else { |
| | | // 拦截如果是登录code |
| | | let loginCode = WeChat.getUrlInfo("weChatLogin"); |
| | | console.log(loginCode, "loginCode"); |
| | | if (loginCode.code) { |
| | | WeChat.login(loginCode.code, data => { |
| | | WeChat.login(loginCode.code, (data) => { |
| | | toolClass.setCookie(config.tokenKey, data); |
| | | const url = window.location.href; |
| | | const domian = url.split("?")[0]; |
| | | console.log(domian, 'domian'); |
| | | console.log(domian, "domian"); |
| | | const routeCode = url.split("#")[1]; |
| | | const redirectUrl = domian + "#" + routeCode; |
| | | window.location.href = redirectUrl; |
| | |
| | | */ |
| | | let query = { |
| | | code: checkCode.code, |
| | | appCode: config.appRefCode |
| | | appCode: config.appRefCode, |
| | | }; |
| | | MG.identity |
| | | .chechWechatAccount(query) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res == true) { |
| | | const url = window.location.href; |
| | | const domian = url.split("?")[0]; |
| | |
| | | } |
| | | } |
| | | }) |
| | | .catch(res => { |
| | | .catch((res) => { |
| | | console.log(res); |
| | | }); |
| | | } else { |
| | |
| | | if (ua.match(/MicroMessenger/i) == "micromessenger") { |
| | | toolClass.delCookie(config.tokenKey); |
| | | localStorage.fullPath = to.fullPath; |
| | | window.location.href = config.requestCtx + "/mobile/textbooks/#" + to.fullPath; |
| | | window.location.href = |
| | | config.requestCtx + "/mobile/textbooks/#" + to.fullPath; |
| | | WeChat.getCode("checkWeChat"); |
| | | } else { |
| | | WeChat.getCode("weChatLogin"); |
| | |
| | | new Vue({ |
| | | router, |
| | | store, |
| | | render: h => h(App) |
| | | render: (h) => h(App), |
| | | }).$mount("#app"); |
| | |
| | | // 创建 axios 实例 |
| | | const service = axios.create({ |
| | | baseURL: myConfig.requestCtx, |
| | | timeout: myConfig.requestTimeOut // 请求超时时间 |
| | | timeout: myConfig.requestTimeOut, // 请求超时时间 |
| | | }); |
| | | |
| | | // 请求拦截器 |
| | | service.interceptors.request.use( |
| | | config => { |
| | | (config) => { |
| | | // 在请求发送之前做一些处理 |
| | | // if (config.url !== "/api/account/loginByPassword") { |
| | | let token = toolClass.getCookie(myConfig.tokenKey); |
| | |
| | | // } |
| | | return config; |
| | | }, |
| | | error => { |
| | | (error) => { |
| | | // 发送失败 |
| | | Promise.reject(error); |
| | | } |
| | |
| | | |
| | | // 响应拦截器 |
| | | service.interceptors.response.use( |
| | | response => { |
| | | (response) => { |
| | | // dataAxios 是 axios 返回数据中的 data |
| | | const dataAxios = response.data; |
| | | |
| | | // 这个状态码是和后端约定的 |
| | | const { |
| | | success |
| | | } = dataAxios; |
| | | const { success } = dataAxios; |
| | | if (dataAxios.currentDate) { |
| | | sessionStorage.currentDate = new Date(dataAxios.currentDate).getTime(); |
| | | } |
| | | |
| | | // 根据 code 进行判断 |
| | | if (success) { |
| | | return dataAxios.data; |
| | |
| | | console.error(dataAxios.msg); |
| | | } |
| | | }, |
| | | error => { |
| | | (error) => { |
| | | if ((error.message = "Network Error")) { |
| | | let loginCode = WeChat.getUrlInfo("weChatLogin"); |
| | | if (loginCode.code) { |
| | | WeChat.login(loginCode.code, data => { |
| | | WeChat.login(loginCode.code, (data) => { |
| | | toolClass.setCookie(myConfig.tokenKey, data); |
| | | location.reload(); |
| | | }); |
| | |
| | | style="width: 100%; height: 300px" |
| | | ></div> |
| | | </div> |
| | | <div class="title" v-if="resourceData.length > 0"> |
| | | 资源明细 |
| | | </div> |
| | | <div class="title" v-if="resourceData.length > 0">资源明细</div> |
| | | <div class="resourceList" v-if="resourceData.length > 0"> |
| | | <div |
| | | v-for="(item, index) in resourceData" |
| | |
| | | <p v-else class="disable">申请试用</p> |
| | | </li> |
| | | <li class="btmBottom1"> |
| | | <img src="@/assets/images/textBook/shidu3.png" alt="" class="btnImg" /> |
| | | <img |
| | | src="@/assets/images/textBook/shidu3.png" |
| | | alt="" |
| | | class="btnImg" |
| | | /> |
| | | <p v-if="isBuy" @click="readBook()">阅读</p> |
| | | <p v-if="!isBuy" @click="readBook()">试读</p> |
| | | </li> |
| | |
| | | show-cancel-button |
| | | @confirm="onConfirm" |
| | | > |
| | | <van-field |
| | | v-model="code" |
| | | placeholder="请输入购书码" |
| | | class="message" |
| | | /> |
| | | <van-field v-model="code" placeholder="请输入购书码" class="message" /> |
| | | </van-dialog> |
| | | </div> |
| | | </template> |
| | |
| | | import { mapState } from "vuex"; |
| | | import toolClass from "@/assets/js/toolClass"; |
| | | import myConfig from "@/assets/js/config"; |
| | | import WeChat from "@/assets/js/weChat/weChat"; |
| | | import axios from "axios"; |
| | | var echarts = require("echarts"); |
| | | // 全局注册 |
| | |
| | | // 收藏图片 |
| | | collectIcon: { |
| | | star: require("@/assets/images/textBook/shoucang3.png"), |
| | | selected_star: require("@/assets/images/tab_collection_pre.png") |
| | | selected_star: require("@/assets/images/tab_collection_pre.png"), |
| | | }, |
| | | isBuy: false, |
| | | tabActive: 0, |
| | |
| | | teacherState: "", |
| | | shoppingCartGetId: [], |
| | | dialogCode: false, |
| | | code: "" |
| | | code: "", |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(["userInfo"]) |
| | | ...mapState(["userInfo"]), |
| | | }, |
| | | created() { |
| | | var that = this; |
| | |
| | | tourism_teachingLevel: [], |
| | | tourism_professionalCategory: [], |
| | | tourism_zone: [], |
| | | viewCount: [] |
| | | viewCount: [], |
| | | }, |
| | | coverSize: { |
| | | width: 880 |
| | | } |
| | | width: 880, |
| | | }, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | console.log(res.datas); |
| | | this.isBuy = res.datas.alreadyBuy; |
| | | that.detailsInfo = res.datas; |
| | |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.detailsInfo.defaultSaleMethodId, |
| | | count: 1 |
| | | } |
| | | ] |
| | | count: 1, |
| | | }, |
| | | ], |
| | | }) |
| | | .then(initRes => { |
| | | .then((initRes) => { |
| | | if (initRes.orderNumber) { |
| | | this.MG.store |
| | | .confirmOrder({ orderNum: initRes.orderNumber }) |
| | | .then(aRes => { |
| | | .then((aRes) => { |
| | | if (aRes) { |
| | | Toast.success("免费领取成功!"); |
| | | this.getDetail(id); |
| | |
| | | this.getBookResource(); |
| | | }); |
| | | }, |
| | | |
| | | getProductType() { |
| | | var that = this; |
| | | this.MG.store |
| | |
| | | refCodes: [ |
| | | "tourism_teachingLevel", |
| | | "tourism_professionalCategory", |
| | | "tourism_zone" |
| | | ] |
| | | "tourism_zone", |
| | | ], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res.length > 0) { |
| | | res.forEach(element => { |
| | | res.forEach((element) => { |
| | | let optionList = JSON.parse(element.config).option; |
| | | if (element.refCode == "tourism_teachingLevel") { |
| | | optionList.forEach(item => { |
| | | optionList.forEach((item) => { |
| | | if (that.detailsInfo.tourism_teachingLevel == item.value) { |
| | | that.teachingLevel = item.name; |
| | | } |
| | | }); |
| | | } |
| | | if (element.refCode == "tourism_professionalCategory") { |
| | | optionList.forEach(item => { |
| | | optionList.forEach((item) => { |
| | | if ( |
| | | that.detailsInfo.tourism_professionalCategory == item.value |
| | | ) { |
| | |
| | | }); |
| | | } |
| | | if (element.refCode == "tourism_zone") { |
| | | optionList.forEach(item => { |
| | | optionList.forEach((item) => { |
| | | if (that.detailsInfo.tourism_zone == item.value) { |
| | | that.zone = item.name; |
| | | } |
| | |
| | | this.MG.store |
| | | .delProductLink({ |
| | | productIds: [this.detailsInfo.id], |
| | | linkType: this.config.refCodes.LinkType.FavoriteTextBook |
| | | linkType: this.config.refCodes.LinkType.FavoriteTextBook, |
| | | }) |
| | | .then(() => { |
| | | this.detailsInfo.isFavourite = false; |
| | |
| | | } else { |
| | | let params = { |
| | | productIds: [this.detailsInfo.id], |
| | | linkType: this.config.refCodes.LinkType.FavoriteTextBook |
| | | linkType: this.config.refCodes.LinkType.FavoriteTextBook, |
| | | }; |
| | | this.MG.store.addProductLink(params).then(res => { |
| | | this.MG.store.addProductLink(params).then((res) => { |
| | | this.detailsInfo.isFavourite = true; |
| | | }); |
| | | } |
| | | }, |
| | | //获取教材资源信息 |
| | | getBookResource() { |
| | | console.log( |
| | | this.config.textBookResourceUrl + |
| | | this.detailsInfo.refCode + |
| | | "/resource.json" |
| | | ); |
| | | // console.log( |
| | | // this.config.textBookResourceUrl + |
| | | // this.detailsInfo.refCode + |
| | | // "/resource.json" |
| | | // ); |
| | | try { |
| | | axios |
| | | .get( |
| | |
| | | this.detailsInfo.refCode + |
| | | "/resource.json" |
| | | ) |
| | | .then(async res => { |
| | | .then(async (res) => { |
| | | if (res.data.length > 0) { |
| | | res.data.forEach(item => { |
| | | res.data.forEach((item) => { |
| | | if (item.resourceTypeShow == "图片") { |
| | | item.icon = this.imgIcon; |
| | | } else if (item.resourceTypeShow == "视频") { |
| | |
| | | } |
| | | if (this.resourceData.length > 0) { |
| | | this.resourceHave = true; |
| | | if (this.$refs.resourcesChart) { |
| | | this.initChart(this.resourceData); |
| | | } |
| | | } else { |
| | | this.resourceHave = false; |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | .catch((error) => { |
| | | console.log(error); |
| | | this.resourceData = []; |
| | | this.resourceHave = false; |
| | |
| | | this.resourceHave = false; |
| | | } |
| | | }, |
| | | |
| | | groupByResourceTypeShow(resources) { |
| | | const grouped = resources.reduce((acc, item) => { |
| | | const key = item.resourceTypeShow; |
| | | if (!acc[key]) { |
| | | acc[key] = { |
| | | resourceTypeShow: key, |
| | | list: [] |
| | | list: [], |
| | | }; |
| | | } |
| | | acc[key].list.push(item); |
| | |
| | | // 基于准备好的dom,初始化echarts实例 |
| | | let dataList = []; |
| | | let num = []; |
| | | data.forEach(item => { |
| | | data.forEach((item) => { |
| | | dataList.push(item.resourceTypeShow); |
| | | num.push(item.list.length); |
| | | }); |
| | |
| | | myChart.setOption({ |
| | | tooltip: {}, |
| | | xAxis: { |
| | | data: dataList |
| | | data: dataList, |
| | | }, |
| | | yAxis: {}, |
| | | series: [ |
| | |
| | | "#3DB0BF", |
| | | "#FBBB3B", |
| | | "#3B5EFB", |
| | | "#B1FB3B" |
| | | "#B1FB3B", |
| | | ]; |
| | | return colors[params.dataIndex % colors.length]; |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | }); |
| | | }, |
| | | |
| | | tabChange(val) { |
| | | console.log(val, 1); |
| | | if (val == 3) { |
| | |
| | | |
| | | //使用购书码 |
| | | useBookCode() { |
| | | if (this.token == "" || this.token == undefined || this.token == null) { |
| | | Dialog.confirm({ |
| | | title: "温馨提示", |
| | | message: "请您登录后使用购书码", |
| | | showCancelButton: true, |
| | | cancelButtonText: "取消", |
| | | confirmButtonText: "确定", |
| | | inputType: "text", |
| | | inputPlaceholder: "请输入购书码", |
| | | }) |
| | | .then((res) => { |
| | | if (res == "confirm") { |
| | | toolClass.delCookie(myConfig.tokenKey); |
| | | WeChat.getCode("weChatLogin"); |
| | | return false; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | } else { |
| | | this.code = ""; |
| | | this.dialogCode = true; |
| | | } |
| | | }, |
| | | |
| | | onConfirm() { |
| | | var that = this; |
| | | let lock = true; |
| | |
| | | lock = false; |
| | | that.MG.store |
| | | .getActiveCode({ |
| | | code: that.code |
| | | code: that.code, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | console.log(res); |
| | | if (res && res.saleMethodList) { |
| | | if ( |
| | |
| | | ) { |
| | | that.MG.store |
| | | .userActiveCode({ |
| | | code: that.code |
| | | code: that.code, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | Toast.success(res == "激活成功" ? "够买成功" : res); |
| | | lock = true; |
| | | that.dialogCode = false; |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | //到购买页面 |
| | | payNow() { |
| | | this.MG.store |
| | |
| | | requests: [ |
| | | { |
| | | saleMethodId: this.detailsInfo.defaultSaleMethodId, |
| | | count: 1 |
| | | } |
| | | ] |
| | | count: 1, |
| | | }, |
| | | ], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | this.$router.push({ |
| | | path: "/pay", |
| | | query: { |
| | | orderNum: res.orderNumber, |
| | | shopId: this.id |
| | | } |
| | | shopId: this.id, |
| | | }, |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | start: 0, |
| | | size: 999, |
| | | filterList: [], |
| | | searchList: [] |
| | | searchList: [], |
| | | }; |
| | | const res = await this.MG.store.getShoppingCartProductList(query); |
| | | res.datas.forEach(item => { |
| | | res.datas.forEach((item) => { |
| | | that.shoppingCartGetId.push(item.saleMethod.id); |
| | | }); |
| | | |
| | |
| | | { |
| | | saleMethodId: this.detailsInfo.defaultSaleMethodId, |
| | | storeEventId: null, |
| | | agentCode: "" |
| | | } |
| | | ] |
| | | agentCode: "", |
| | | }, |
| | | ], |
| | | }; |
| | | this.MG.store.addShoppingCart(data).then(res => { |
| | | this.MG.store.addShoppingCart(data).then((res) => { |
| | | if (res) { |
| | | Toast.success("加入购物车成功"); |
| | | } |
| | |
| | | |
| | | //申请试用 |
| | | applyBook() { |
| | | if (this.token == "" || this.token == undefined || this.token == null) { |
| | | Dialog.confirm({ |
| | | title: "温馨提示", |
| | | message: "请您登录后申请试用", |
| | | showCancelButton: true, |
| | | cancelButtonText: "关闭", |
| | | confirmButtonText: "确定", |
| | | inputType: "text", |
| | | }).then((res) => { |
| | | if (res == "confirm") { |
| | | toolClass.delCookie(myConfig.tokenKey); |
| | | WeChat.getCode("weChatLogin"); |
| | | return false; |
| | | } |
| | | }); |
| | | } else { |
| | | const role = this.userInfo.role; |
| | | if (role == "Teacher") { |
| | | this.getAlreadyBookList(this.detailsInfo); |
| | | } else { |
| | | Toast.fail("您还未通过教师审核"); |
| | | Dialog.confirm({ |
| | | title: "温馨提示", |
| | | message: "您不是教师用户,请进行教师认证后申请试用。", |
| | | messageAlign: "left", |
| | | showCancelButton: true, |
| | | cancelButtonText: "关闭", |
| | | confirmButtonText: "教师认证", |
| | | inputType: "text", |
| | | }) |
| | | .then((res) => { |
| | | if (res == "confirm") { |
| | | this.$router.replace({ |
| | | path: "/teacherCertificate", |
| | | query: { from: "bookDetail", ...this.$route.query }, |
| | | }); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | //获取已申请试用列表 |
| | | getAlreadyBookList(bookData) { |
| | | const data = { |
| | |
| | | appRefCode: this.config.appRefCode, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | } |
| | | field: "CreateDate", |
| | | }, |
| | | }; |
| | | this.MG.ugc.getTopicMessageList(data).then(res => { |
| | | this.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | if (res.datas.length > 0) { |
| | | res.datas.map(item => { |
| | | res.datas.map((item) => { |
| | | if (item.feedBack) { |
| | | item.feedBack = JSON.parse(item.feedBack); |
| | | if (item.feedBack.endDate) { |
| | |
| | | } |
| | | }); |
| | | let objVal = res.datas.find( |
| | | i => |
| | | (i) => |
| | | i.productId == bookData.id && |
| | | i.state != "Reject" && |
| | | i.state == "WaitAudit" |
| | |
| | | title: "提示", |
| | | message: "您已申请试用该书,是否前往查看", |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消" |
| | | cancelButtonText: "取消", |
| | | }).then(() => { |
| | | this.$router.push({ |
| | | name: "myApplyBook" |
| | | name: "myApplyBook", |
| | | }); |
| | | }); |
| | | } else { |
| | | this.$router.push({ |
| | | name: "bookApply", |
| | | query: { |
| | | bookInfo: JSON.stringify(this.detailsInfo) |
| | | } |
| | | bookInfo: JSON.stringify(this.detailsInfo), |
| | | }, |
| | | }); |
| | | } |
| | | } else { |
| | | this.$router.push({ |
| | | name: "bookApply", |
| | | query: { |
| | | bookInfo: JSON.stringify(this.detailsInfo) |
| | | } |
| | | bookInfo: JSON.stringify(this.detailsInfo), |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | contactUs() { |
| | | this.$router.push({ |
| | | name: "aboutUs" |
| | | name: "aboutUs", |
| | | }); |
| | | }, |
| | | |
| | | onClickLeft() { |
| | | this.$router.go(-1); |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | //挂载成功后给pop事件绑定一个方法 |
| | |
| | | //组件销毁后清除事件 |
| | | destroyed() { |
| | | window.removeEventListener("popstate", this.onClickLeft, false); //false阻止默认事件 |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | overflow: auto; |
| | | } |
| | | |
| | | .detailBox { |
| | | font-size: none; |
| | | font-family: none; |
| | | } |
| | | |
| | | .noData { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | |
| | | > |
| | | <div |
| | | :style="{ |
| | | background: 'url(' + item.icon + ') no-repeat 100%,center' |
| | | background: 'url(' + item.icon + ') no-repeat 100%,center', |
| | | }" |
| | | alt |
| | | class="banner" |
| | |
| | | <div class="more" @click="openBtn('true')" v-else>收起 -</div> |
| | | </div> |
| | | <div class="partnerList"> |
| | | <div |
| | | :class="isOpen ? 'list' : 'list1'" |
| | | v-if="!partnersLoading && partnersList.length > 0" |
| | | > |
| | | <div class="list" v-if="!partnersLoading && partnersList.length > 0"> |
| | | <div |
| | | class="partnerItem" |
| | | v-for="(item, index) in partnersList" |
| | |
| | | > |
| | | <div class="imgBox"> |
| | | <img class="autoImg" :src="item.icon" /> |
| | | </div> |
| | | <div class="bookInfo"> |
| | | <div class="title" :title="item.name"> |
| | | {{ item.name }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | img: require("@/assets/images/home/guanwang3.png"), |
| | | circleName: "官网主页", |
| | | url: "https://www.tepcb.com/mobile/website/", |
| | | itemN: "circle-one" |
| | | itemN: "circle-one", |
| | | }, |
| | | { |
| | | img: require("@/assets/images/home/shuzijiaocai3.png"), |
| | | circleName: "数字教材", |
| | | url: "/bookList", |
| | | itemN: "circle-two" |
| | | itemN: "circle-two", |
| | | }, |
| | | { |
| | | img: require("@/assets/images/home/jiaoshirenzheng3.png"), |
| | | circleName: "教师认证", |
| | | url: "/teacherCertificate", |
| | | itemN: "circle-three" |
| | | } |
| | | ] |
| | | itemN: "circle-three", |
| | | }, |
| | | ], |
| | | }, |
| | | bookRecommendList: [], |
| | | bookRecommendLoading: true, |
| | |
| | | partnersList: [], |
| | | partnersLoading: false, |
| | | isOpen: true, |
| | | token: "" |
| | | token: "", |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | that.getPartnersList(); |
| | | }, |
| | | computed: { |
| | | ...mapState(["userInfo"]) |
| | | ...mapState(["userInfo"]), |
| | | }, |
| | | methods: { |
| | | getUserRoleMine() { |
| | | let that = this; |
| | | that.MG.identity.getCurrentAppUser().then(res => { |
| | | that.MG.identity.getCurrentAppUser().then((res) => { |
| | | if (res) { |
| | | that.userId = res.userId; |
| | | let teacherRole = res.roleLinks.find( |
| | | item => item.role?.refCode == "teacher" |
| | | (item) => item.role?.refCode == "teacher" |
| | | ); |
| | | let teacherInfo = res.infoList.find( |
| | | item => item.type == "teacherInfo" |
| | | (item) => item.type == "teacherInfo" |
| | | ); |
| | | let wechatInfo = res.infoList.find(item => item.type == "WeChat"); |
| | | let wechatInfo = res.infoList.find((item) => item.type == "WeChat"); |
| | | let studentInfo = res.infoList.find( |
| | | item => item.type == "basicInfo" || item.type == "Default" |
| | | (item) => item.type == "basicInfo" || item.type == "Default" |
| | | ); |
| | | let phoneInfo = res.secretList.find( |
| | | item => item.type == "MobilePhone" |
| | | (item) => item.type == "MobilePhone" |
| | | ); |
| | | if (teacherRole && teacherInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | |
| | | phoneNumber: phoneInfo?.credential, |
| | | icon: wechatInfo?.icon, |
| | | role: "Teacher", |
| | | roleId: teacherRole.role.id |
| | | roleId: teacherRole.role.id, |
| | | }); |
| | | } else if (wechatInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...wechatInfo, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student" |
| | | role: "Student", |
| | | }); |
| | | } else if (studentInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...studentInfo, |
| | | icon: wechatInfo?.icon, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student" |
| | | role: "Student", |
| | | }); |
| | | } |
| | | } |
| | |
| | | getBanner() { |
| | | this.MG.resource |
| | | .getItem({ |
| | | path: "tourism_digitalTextbook\\tourism_digitalBannerMobile" |
| | | path: "tourism_digitalTextbook\\tourism_digitalBannerMobile", |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | this.educate.swipePic = res.datas; |
| | | console.log(res.datas); |
| | | }); |
| | |
| | | this.$router.push({ |
| | | path: "/bookList", |
| | | query: { |
| | | searchAllWords: this.searchAllWords |
| | | } |
| | | searchAllWords: this.searchAllWords, |
| | | }, |
| | | }); |
| | | }, |
| | | //推荐教材 |
| | |
| | | queryType: "*", |
| | | paging: { |
| | | start: 0, |
| | | size: 5 |
| | | size: 5, |
| | | }, |
| | | fields: { |
| | | tourism_author: [], |
| | | tourism_publicationDate: [], |
| | | viewCount: [] |
| | | viewCount: [], |
| | | }, |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | field: "CreateDate", |
| | | }, |
| | | coverSize: { |
| | | height: 560 |
| | | } |
| | | height: 560, |
| | | }, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | this.bookRecommendList = res.datas; |
| | | this.bookRecommendLoading = false; |
| | | }); |
| | |
| | | this.$router.push({ |
| | | path: "/bookDetail", |
| | | query: { |
| | | id: data.id |
| | | } |
| | | id: data.id, |
| | | }, |
| | | }); |
| | | }, |
| | | // 轮播图下方 列表跳转页面 |
| | |
| | | window.open(url); |
| | | } else { |
| | | this.$router.push({ |
| | | path: url |
| | | path: url, |
| | | }); |
| | | } |
| | | }, |
| | | showMore() { |
| | | this.$router.push({ |
| | | path: "/bookList" |
| | | path: "/bookList", |
| | | }); |
| | | }, |
| | | //视频说明 |
| | |
| | | path: "tourism_digitalTextbook\\tourism_digitalRecommendedTextbooks", |
| | | fields: { |
| | | tourism_file: [], |
| | | tourism_content: [] |
| | | } |
| | | tourism_content: [], |
| | | }, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res.datas.length > 0) { |
| | | res.datas.forEach(element => { |
| | | res.datas.forEach((element) => { |
| | | if ( |
| | | element.refCode == "tourism_digitalRecommendedTextbooksMobile" |
| | | ) { |
| | |
| | | }, |
| | | getManual() { |
| | | this.$router.push({ |
| | | path: "/manual" |
| | | path: "/manual", |
| | | }); |
| | | }, |
| | | //合作院校 |
| | |
| | | this.MG.resource |
| | | .getItem({ |
| | | path: "tourism_digitalTextbook\\tourism_digitalPartners", |
| | | fields: {} |
| | | fields: {}, |
| | | }) |
| | | .then(res => { |
| | | this.partnersList = res.datas; |
| | | .then((res) => { |
| | | const data = res.datas; |
| | | if (this.isOpen) { |
| | | this.partnersList = data.slice(0, 4); |
| | | } else { |
| | | this.partnersList = data; |
| | | } |
| | | |
| | | this.partnersLoading = false; |
| | | }); |
| | | }, |
| | |
| | | } else { |
| | | this.isOpen = false; |
| | | } |
| | | } |
| | | this.getPartnersList(); |
| | | }, |
| | | }, |
| | | components: { |
| | | Footer |
| | | } |
| | | Footer, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | |
| | | .partnerList { |
| | | margin-top: 10px; |
| | | overflow: hidden; |
| | | min-height: 180px; |
| | | min-height: 150px; |
| | | flex-wrap: wrap; |
| | | } |
| | | .list { |
| | | height: 160px; |
| | | min-height: 110px; |
| | | overflow: hidden; |
| | | } |
| | | .list1 { |
| | | /* .list1 { |
| | | line-height: 1.5; |
| | | min-height: 160px; |
| | | } |
| | | } */ |
| | | .partnerItem { |
| | | width: calc(100% / 4 - 10px); |
| | | width: 25%; |
| | | display: block; |
| | | box-sizing: border-box; |
| | | float: left; |
| | | padding: 5px 20px; |
| | | } |
| | | .partnerItem .imgBox { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100px; |
| | | min-height: 60px; |
| | | } |
| | | .partnerItem .bookInfo { |
| | | margin: 0; |
| | |
| | | left-arrow |
| | | @click-left="onClickLeft" |
| | | /> |
| | | <div style="padding-top: 20px;" v-html="manualCon"></div> |
| | | <div style="padding-top: 20px" v-html="manualCon"></div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | data() { |
| | | return { |
| | | manualCon: "", |
| | | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getOperating() |
| | | this.getOperating(); |
| | | }, |
| | | methods: { |
| | | onClickLeft() { |
| | |
| | | }) |
| | | .then((res) => { |
| | | if (res.datas.length > 0) { |
| | | res.datas.forEach((item) => { |
| | | item.tourism_content = item.tourism_content.replace( |
| | | /<img/g, |
| | | '<img style="max-width:100%;height:auto"' |
| | | ); |
| | | item.tourism_content = item.tourism_content.replace( |
| | | /\..\/file/g, |
| | | this.config.requestCtx + "/file" |
| | | ); |
| | | }); |
| | | this.manualCon = res.datas[0].tourism_content; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | |
| | | width:100%; |
| | | height:100%; |
| | | padding: 15px; |
| | | |
| | | } |
| | | |
| | | |
| | | </style> |
| | |
| | | label="联系电话" |
| | | :rules="[ |
| | | { required: true, message: '请填写您的手机号码!' }, |
| | | { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误!' } |
| | | { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误!' }, |
| | | ]" |
| | | placeholder="请输入您的联系电话" |
| | | /> |
| | |
| | | </div> |
| | | <div |
| | | v-if="!stateDisable" |
| | | style="background-color: rgb(240, 240, 240); padding-top: 25px; height: 175px" |
| | | style=" |
| | | background-color: rgb(240, 240, 240); |
| | | padding-top: 25px; |
| | | height: 175px; |
| | | " |
| | | > |
| | | <van-checkbox |
| | | v-model="approve.agree" |
| | |
| | | </div> |
| | | </div> |
| | | <div v-if="stateDisable && approve.state != 'WaitAudit'"> |
| | | <div style="margin:40px;"> |
| | | <div style="margin: 40px"> |
| | | <van-button round block type="info" @click="stateDisable = false" |
| | | >修 改</van-button |
| | | > |
| | |
| | | protocolTxt: "", |
| | | refCode: "", |
| | | headers: { |
| | | Authorization: "" |
| | | Authorization: "", |
| | | }, |
| | | submitDisabled: true, // 提交按钮,默认禁选 |
| | | showPicker: false, |
| | |
| | | //相关证件 |
| | | certificate: [], |
| | | // 教师同意勾选框 |
| | | checked: false |
| | | checked: false, |
| | | }, |
| | | isUpdate: false, |
| | | |
| | |
| | | // description: "", //个人简介 |
| | | relevantCertificates: [], //相关证件 |
| | | state: "", //审核状态默认待审核 |
| | | agree: false |
| | | agree: false, |
| | | }, |
| | | //picker选择列表 |
| | | colunmsJob: [ |
| | |
| | | "系副主任", |
| | | "专业负责人", |
| | | "主任", |
| | | "其他" |
| | | "其他", |
| | | ], |
| | | colunmsTitle: ["正高级", "高级", "一级", "二级", "三级", "无"], |
| | | colunmsEdu: ["大专", "本科", "硕士", "博士"], |
| | |
| | | fileList: [], |
| | | isWaitAudit: false, |
| | | userId: "", |
| | | isFree: false |
| | | isFree: false, |
| | | }; |
| | | }, |
| | | watch: { |
| | | "approve.agree": { |
| | | handler(val) { |
| | | this.submitDisabled = !val; |
| | | } |
| | | }, |
| | | }, |
| | | $route(to, from) { |
| | | if ( |
| | |
| | | ) { |
| | | this.getProtocol(); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | var that = this; |
| | |
| | | finishAddress({ selectedOptions }) { |
| | | this.showPicker3 = false; |
| | | this.approve.region = selectedOptions |
| | | .map(option => option.text) |
| | | .map((option) => option.text) |
| | | .join("/"); |
| | | }, |
| | | deleteFile(file) { |
| | |
| | | }, |
| | | getUserRole() { |
| | | let that = this; |
| | | that.MG.identity.getCurrentAppUser().then(res => { |
| | | that.MG.identity.getCurrentAppUser().then((res) => { |
| | | that.userId = res.userId; |
| | | let teacherRole = res.roleLinks.find(item => item.role?.refCode == "teacher"); |
| | | let teacherInfo = res.infoList.find(item => item.type == "teacherInfo") ?? {}; |
| | | let wechatInfo = res.infoList.find(item => item.type == "WeChat") ?? {}; |
| | | let studentInfo = res.infoList.find(item => item.type == "Default"); |
| | | let phoneInfo = res.secretList.find(item => item.type == "MobilePhone"); |
| | | let teacherRole = res.roleLinks.find( |
| | | (item) => item.role?.refCode == "teacher" |
| | | ); |
| | | let teacherInfo = |
| | | res.infoList.find((item) => item.type == "teacherInfo") ?? {}; |
| | | let wechatInfo = |
| | | res.infoList.find((item) => item.type == "WeChat") ?? {}; |
| | | let studentInfo = res.infoList.find((item) => item.type == "Default"); |
| | | let phoneInfo = res.secretList.find( |
| | | (item) => item.type == "MobilePhone" |
| | | ); |
| | | if (teacherRole && teacherInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...teacherInfo, |
| | | phoneNumber: phoneInfo?.credential, |
| | | icon: wechatInfo?.icon, |
| | | role: "Teacher", |
| | | roleId: teacherRole.role.id |
| | | roleId: teacherRole.role.id, |
| | | }); |
| | | } else if (wechatInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...wechatInfo, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student" |
| | | role: "Student", |
| | | }); |
| | | } else if (studentInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...studentInfo, |
| | | icon: wechatInfo?.icon, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student" |
| | | role: "Student", |
| | | }); |
| | | } |
| | | }); |
| | |
| | | |
| | | getType() { |
| | | const data = { |
| | | refCodes: ["tourism_teacherCertification"] |
| | | refCodes: ["tourism_teacherCertification"], |
| | | }; |
| | | this.MG.resource.getCmsTypeByRefCode(data).then(res => { |
| | | this.MG.resource.getCmsTypeByRefCode(data).then((res) => { |
| | | this.newGetTeacherInfo(); |
| | | this.worksInfo = res[0].cmsTypeLinks[0].children; |
| | | }); |
| | |
| | | appRefCode: "tourismWebsite", |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | } |
| | | field: "CreateDate", |
| | | }, |
| | | }; |
| | | that.MG.ugc.getTopicMessageList(data).then(res => { |
| | | that.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | | that.fileList = []; |
| | | const resData = res.datas.find( |
| | | i => i.appUserCreator.userId == that.userId |
| | | (i) => i.appUserCreator.userId == that.userId |
| | | ); |
| | | that.approve = that.tool.resultsBytool( |
| | | that.worksInfo, |
| | |
| | | } |
| | | if (that.approve.relevantCertificates.length > 0) { |
| | | if (typeof that.approve.relevantCertificates == "object") { |
| | | that.approve.relevantCertificates.forEach(ele => { |
| | | that.approve.relevantCertificates.forEach((ele) => { |
| | | let imgObj = { |
| | | md5: ele.file.md5, |
| | | url: |
| | |
| | | ele.file.md5, |
| | | linkType: "LinkFile", |
| | | linkProtectType: "Public", |
| | | isImage: true |
| | | isImage: true, |
| | | }; |
| | | that.fileList.push(imgObj); |
| | | }); |
| | |
| | | md5: that.approve.relevantCertificates, |
| | | linkType: "LinkFile", |
| | | linkProtectType: "Public", |
| | | isImage: true |
| | | isImage: true, |
| | | }; |
| | | that.fileList.push(imgObj); |
| | | } |
| | |
| | | .getItem({ |
| | | path: "tourism_protocol", |
| | | fields: { |
| | | tourism_content: [] |
| | | } |
| | | tourism_content: [], |
| | | }, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | try { |
| | | const data = res.datas.find( |
| | | e => e.refCode == "tourism_teacherCertificationAgreement" |
| | | (e) => e.refCode == "tourism_teacherCertificationAgreement" |
| | | ); |
| | | this.protocolTxt = data ? data.tourism_content : "暂无协议"; |
| | | } catch (error) { |
| | |
| | | this.worksInfo, |
| | | this.approve, |
| | | this.fileList |
| | | ) |
| | | ), |
| | | }; |
| | | let basicInfo = JSON.parse(JSON.stringify(this.approve)); |
| | | delete basicInfo.agree; |
| | |
| | | { |
| | | data: JSON.stringify(basicInfo), |
| | | name: basicInfo.fullName, |
| | | type: "teacherInfo" |
| | | } |
| | | ] |
| | | type: "teacherInfo", |
| | | }, |
| | | ], |
| | | }; |
| | | this.MG.identity.setAppUserInfo(userInfo).then(res => { |
| | | this.MG.identity.setAppUserInfo(userInfo).then((res) => { |
| | | this.MG.ugc.newTopicMessage(data).then(() => { |
| | | console.log(res); |
| | | this.subLoading = true; |
| | | const fromRouter = this.$route.query; |
| | | if (res !== false) { |
| | | that.newGetTeacherInfo(); |
| | | } |
| | | if (fromRouter.from && fromRouter.from == "bookDetail") { |
| | | this.$router.replace({ |
| | | name: "bookDetail", |
| | | query: { |
| | | id: this.$route.query.id, |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | |
| | | newDataRequests: fields.newData, |
| | | updateDataRequests: fields.updateData, |
| | | delDataRequest: { |
| | | ids: [] |
| | | } |
| | | ids: [], |
| | | }, |
| | | }; |
| | | delete basicInfo.tourism_relevantCertificates; |
| | | delete basicInfo.agree; |
| | |
| | | { |
| | | data: JSON.stringify(basicInfo), |
| | | name: basicInfo.fullName, |
| | | type: "newTeacherInfo" |
| | | } |
| | | ] |
| | | type: "newTeacherInfo", |
| | | }, |
| | | ], |
| | | }; |
| | | this.MG.identity.setAppUserInfo(userInfo).then(res => { |
| | | this.MG.identity.setAppUserInfo(userInfo).then((res) => { |
| | | if (res) { |
| | | this.MG.ugc.updateTopicMessage(data).then(res => { |
| | | this.MG.ugc.updateTopicMessage(data).then((res) => { |
| | | this.subLoading = false; |
| | | const fromRouter = this.$route.query; |
| | | if (res !== false) { |
| | | this.getUserRole(); |
| | | this.newGetTeacherInfo(); |
| | | } |
| | | if (fromRouter.from && fromRouter.from == "bookDetail") { |
| | | this.$router.replace({ |
| | | name: "bookDetail", |
| | | query: { |
| | | id: this.$route.query.id, |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | let size = 1024; |
| | | that.tool |
| | | .getFileMd5(file.file, size * 1024) |
| | | .then(e => { |
| | | .then((e) => { |
| | | const imgData = new FormData(); |
| | | that.fileMd5 = e; |
| | | imgData.append("Md5", e); |
| | |
| | | imgData.append("FileType", FileType); |
| | | imgData.append("MetaData", null); |
| | | imgData.append("file", file.file); |
| | | that.MG.file.upload(imgData).then(res => { |
| | | that.MG.file.upload(imgData).then((res) => { |
| | | if (res) { |
| | | this.fileList.push({ |
| | | md5: e, |
| | | url: this.config.requestCtx + `/file/GetPreViewImage?md5=` + e, |
| | | linkType: "LinkFile", |
| | | linkProtectType: "Public", |
| | | isImage: true |
| | | isImage: true, |
| | | }); |
| | | this.approve.relevantCertificates = this.fileList; |
| | | // this.fileList = this.approve.relevantCertificates |
| | |
| | | } |
| | | }); |
| | | }) |
| | | .catch(e => { |
| | | .catch((e) => { |
| | | that.isLoding = false; |
| | | console.error(e); |
| | | }); |
| | |
| | | } |
| | | this.MG.store |
| | | .getProductTypeField({ |
| | | refCodes: ["post"] |
| | | refCodes: ["post"], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res && res[0].config) { |
| | | let list = JSON.parse(res[0].config).option; |
| | | list.forEach(item => { |
| | | list.forEach((item) => { |
| | | item.text = item.name; |
| | | }); |
| | | this.colunmsJob = list; |
| | |
| | | } |
| | | this.MG.store |
| | | .getProductTypeField({ |
| | | refCodes: ["positionalTitle"] |
| | | refCodes: ["positionalTitle"], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res && res[0].config) { |
| | | let list = JSON.parse(res[0].config).option; |
| | | list.forEach(item => { |
| | | list.forEach((item) => { |
| | | item.text = item.name; |
| | | }); |
| | | this.colunmsTitle = list; |
| | |
| | | } |
| | | this.MG.store |
| | | .getProductTypeField({ |
| | | refCodes: ["education"] |
| | | refCodes: ["education"], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res && res[0].config) { |
| | | let list = JSON.parse(res[0].config).option; |
| | | list.forEach(item => { |
| | | list.forEach((item) => { |
| | | item.text = item.name; |
| | | }); |
| | | this.colunmsEdu = list; |
| | |
| | | onConfirm2(value) { |
| | | this.approve.education = value.text; |
| | | this.showPicker2 = false; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | name: "login", |
| | | data() { |
| | | return { |
| | | username: "15200000002", |
| | | username: "qiyunfeng", |
| | | password: "xA123456" |
| | | // username: "guest", |
| | | // password: "guest" |