QYF-GitLab1
昨天 0e1ba4ddfd16602cc73d30b23679fd8772b7ada7
Merge branch 'master' of http://182.92.203.7:2001/r/xiehe_website
7个文件已修改
218 ■■■■ 已修改文件
src/assets/main.css 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/footerPage.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/headerPage.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/login.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bookStore/detail.vue 148 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bookStore/textBookApply.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/main.css
@@ -195,6 +195,8 @@
  align-items: stretch !important;
}
.el-select__wrapper {
  height: 40px !important;
}
src/layout/components/footerPage.vue
@@ -48,8 +48,7 @@
        >中国协和医科大学出版社有限公司 丨 备案序号:<span class="beian" @click="toLink"
          >京ICP备 05029104号-4互联网出版许可证 新出网证 (京 )</span
        >
        丨 增值电信业务经营许可证:京B2-20224426</span
      >
      </span>
      <span style="display: block">Copyright©2013 中国协和医科大学出版社有限公司 版权所有!</span>
    </div>
    <teacherCertification :isShow="teacherDialog" @dialog-Change="dialogChange" />
src/layout/components/headerPage.vue
@@ -149,6 +149,8 @@
  }
  if (item === 'logout') {
    localStorage.clear()
    userStore.delteUserInfo()
    userInfo.value = null
    router.push({
      path: '/home',
    })
src/layout/components/login.vue
@@ -223,11 +223,6 @@
    })
}
watchEffect(() => {
  if (dialogFormVisible.value) {
  }
})
//登录
const loginBtn = () => {
@@ -818,20 +813,5 @@
.selectPhone {
  background: #fff;
}
::v-deep(.el-select) {
  width: 100px;
  height: 30px;
  color: red;
  border: none !important;
  ::v-deep(.select-trigger) {
    height: 100%;
    .el-input--suffix {
      height: 100%;
      background-color: #fff;
    }
  }
}
</style>
src/views/bookStore/detail.vue
@@ -35,6 +35,9 @@
                {{ bookInfo.seriesName }}
              </div>
              <div class="collectBox">
                <div class="collectText" @click="collectBook" v-if="bookInfo.isFavourite">
                  已收藏
                </div>
                <img
                  @click="collectBook"
                  v-if="bookInfo.isFavourite"
@@ -43,17 +46,15 @@
                  style="margin-right: 10px"
                />
                <span v-else class="iconfont icon-shoucang" style="margin-right: 10px"> </span>
                <div class="collectText" @click="collectBook" v-if="bookInfo.isFavourite">
                  已收藏
                </div>
                <div class="collectText" @click="collectBook" v-else>
                  收藏
                  <img
                    class="buyIcon"
                    src="@/assets/images/xiehe/detail/Collection.png"
                    style="margin-right: 10px"
                  />
                  收藏
                </div>
              </div>
            </div>
@@ -89,18 +90,16 @@
            </div>
            <div class="authorBox" style="box-sizing: border-box">
              <div class="titleBox1">
                <div>一级分类:</div>
                <div>二级分类:</div>
                <div>分类:</div>
              </div>
              <div class="valueBox">
                <div>全国高等职业教育预防医学专业规划教材</div>
                <div>高等职业教育</div>
              </div>
            </div>
            <div class="purchaseBox">
              <div class="priceBox">
                <span v-if="bookInfo.price && bookInfo.price > 0">
                  <span>定价:</span><span>¥</span> <span>{{ bookInfo.price || '-' }}</span
                  <span>数字教材</span><span>¥</span> <span>{{ bookInfo.price || '-' }}</span
                  ><span v-if="bookInfo.VirtualPrice">原价:¥{{ bookInfo.VirtualPrice }}</span>
                </span>
@@ -169,13 +168,27 @@
              <el-button v-if="currentRoute == 'teachingServices'" plain @click="addPaperBook"
                >纸质样书</el-button
              >
              <el-button plain @click="applyTextBook">申请试用</el-button>
              <el-button plain @click="applyTextBook" v-if="!bookInfo.alreadyBuy"
                >申请试用</el-button
              >
              <el-button plain @click="useCode" v-if="!bookInfo.alreadyBuy">使用购书码</el-button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <el-dialog v-model="buyBookCodeDialog" title="购书" width="30%">
      <div class="buyBookCode">
        <div style="line-height: 30px">购书码 :</div>
        <el-input style="width: 70%" v-model="activateCode" clearable />
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="buyBookCodeDialog = false">取消</el-button>
          <el-button type="primary" @click="userActiveCodeGet"> 激活 </el-button>
        </span>
      </template>
    </el-dialog>
    <div class="detailContent contentBox">
      <div class="resourceBox">
        <div class="tabsBox">
@@ -263,6 +276,7 @@
        </div>
      </div>
    </div>
    <teacherCertification :isShow="teacherDialog" @dialog-Change="dialogChange" />
  </div>
</template>
@@ -281,10 +295,17 @@
import videoIcon from '@/assets/images/digitalTextbooks/video.png'
import VRIcon from '@/assets/images/digitalTextbooks/VR.png'
import ziliaoIcon from '@/assets/images/digitalTextbooks/ziliao.png'
import teacherCertification from '@/views/personalCenter/teacherCertification.vue'
import { ElMessage } from 'element-plus'
import { ref, onBeforeMount, inject, reactive, onMounted, watchEffect } from 'vue'
const MG = inject('MG')
const config = inject('config')
const logIn = inject('logIn')
import { useUserStore } from '@/store'
const userStore = useUserStore()
let teacherDialog = ref(false)
import { useRouter, useRoute } from 'vue-router'
import { applyBookStore } from '@/store'
const route = useRoute()
@@ -294,8 +315,10 @@
let resourceData = ref([])
let recommendBookListData = ref([])
let editableTabsValue = ref('1')
let activateCode = ref('')
let resourceHave = ref(true)
let loading = ref(false)
let buyBookCodeDialog = ref(false)
var chartDom = null
var myChart = {}
var option = null
@@ -339,6 +362,78 @@
  }
})
const userActiveCodeGet = () => {
  let lock = true
  console.log(activateCode.value, 'activateCode.value')
  if (activateCode.value == '') {
    ElMessage({
      type: 'error',
      message: '请输入激活码!',
    })
  } else {
    if (lock) {
      lock = false
      MG.store
        .getActiveCode({
          code: activateCode.value,
        })
        .then((res) => {
          console.log(res, 'res')
          const cfg = JSON.parse(res.config)
          console.log(cfg, 'cfg')
          if (cfg && cfg.length > 0) {
            const isActive = cfg.findIndex((item) => item.id == digitalTextId.value)
            if (isActive > -1) {
              MG.store
                .userActiveCode({
                  code: activateCode.value,
                })
                .then((res) => {
                  ElMessage({
                    type: res == '激活成功' ? 'success' : 'error',
                    message: res,
                  })
                  activateCode.value = ''
                  buyBookCodeDialog.value = false
                  getBookDetail(digitalTextId.value)
                  lock = true
                })
            } else {
              ElMessage({
                type: 'error',
                message: '您输入的购书码有误',
              })
            }
          } else {
            ElMessage({
              type: 'error',
              message: '您输入的购书码有误',
            })
          }
        })
    }
  }
}
const useCode = () => {
  if (localStorage.getItem(config.tokenKey)) {
    buyBookCodeDialog.value = true
  } else {
    logIn()
  }
}
const dialogChange = (val) => {
  if (val == false) {
    teacherDialog.value = false
  } else {
    teacherDialog.value = true
  }
}
//收藏书籍
const collectBook = () => {
  if (localStorage.getItem(config.tokenKey)) {
@@ -368,10 +463,20 @@
//申请试用
const applyTextBook = () => {
  localStorage.setItem('applyBookInfo', JSON.stringify(bookInfo.value))
  router.push({
    path: '/textBookApply',
  })
  console.log(userStore.userInfo, 'userInfo')
  if (localStorage.getItem(config.tokenKey)) {
    if (userStore.userInfo && userStore.userInfo.role == 'Teacher') {
      localStorage.setItem('applyBookInfo', JSON.stringify(bookInfo.value))
      router.push({
        path: '/textBookApply',
      })
    } else {
      teacherDialog.value = true
    }
  } else {
    logIn()
  }
}
const getRecommendBookList = () => {
@@ -624,8 +729,8 @@
  box-sizing: border-box;
}
.collectText {
  font-size: 16px;
  line-height: 25px;
  font-size: 18px;
  line-height: 18px;
  display: inline-block;
}
.bookName {
@@ -926,4 +1031,15 @@
  margin-top: 20px;
  line-height: 28px;
}
.buyBookCode {
  width: 100%;
  display: flex;
  padding: 40px 10px;
  text-align: center;
  align-items: center;
}
.tab-name {
  width: 100px;
  height: 40px;
}
</style>
src/views/bookStore/textBookApply.vue
@@ -4,7 +4,7 @@
      <div class="crumbBox">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <span style="float: left">当前位置:</span>
          <el-breadcrumb-item :to="{ path: '/textbooks' }">数字教材</el-breadcrumb-item>
          <el-breadcrumb-item :to="{}" @click="backRouet">数字教材</el-breadcrumb-item>
          <el-breadcrumb-item>申请试用</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
@@ -63,6 +63,7 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import { useRouter } from 'vue-router'
import router from '@/router'
const toolClass = inject('toolClass')
const userStore = useUserStore()
onMounted(() => {
@@ -90,6 +91,14 @@
  teachingMaterials: [{ required: true, message: '请填写所用教材' }],
}
const backRouet = () => {
  router.push({
    path: '/bookdetail',
    query: {
      bookId: textBookInfo.value.id,
    },
  })
}
const getType = () => {
  const data = {
    refCodes: ['sampleBook'],
@@ -125,17 +134,19 @@
      MG.ugc.newTopicMessage(data).then((res) => {
        loading.value = false
        if (res) {
          ElMessageBox.confirm('您的试用申请已提交,管理员审核中!', 'success', {
          ElMessageBox.confirm('您的试用申请已提交,管理员审核中!', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'success',
          })
            .then(() => {
              this.$router.go(-1)
              router.push({
                path: '/myApply',
              })
              formEl.resetFields()
            })
            .catch(() => {
              this.$router.go(-1)
              backRouet()
              formEl.resetFields()
            })
        }
@@ -143,7 +154,9 @@
    }
  })
}
const toSelectBook = () => {}
const toSelectBook = () => {
  backRouet()
}
</script>
<style scoped>
src/views/home/index.vue
@@ -124,10 +124,11 @@
import moment from 'moment'
import { ElMessage } from 'element-plus'
import teacherCertification from '@/views/personalCenter/teacherCertification.vue'
import { ref, onBeforeMount, inject, reactive, onMounted } from 'vue'
import { ref, onBeforeMount, inject, reactive, onMounted, watch } from 'vue'
let screenheight = ref(document.documentElement.clientHeight / 2)
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
const MG = inject('MG')
const config = inject('config')
@@ -138,6 +139,7 @@
const informationList = reactive([])
let classfeild = ref([])
let activeName = ref('A1')
let callbackLink = ref(null)
let bookListData = ref([])
let navBookList = ref([])
@@ -180,6 +182,13 @@
  getBookList()
  getNavBookList()
})
watch(
  () => route, // 监听 path 变化
  (newPath, oldPath) => {
    console.log('路由路径从', oldPath, '变为', newPath)
  },
)
const toMore = () => {
  router.push({
@@ -512,7 +521,7 @@
.titleTabs {
  margin-left: 50px;
  width: 75%;
  width: 85%;
}
.bookListTitle {
  display: flex;
@@ -548,4 +557,11 @@
    margin-top: 10px;
  }
}
::v-deep(.el-tabs__item) {
  align-items: stretch;
  height: 50px !important;
  white-space: pre-wrap !important;
  width: 40% !important;
}
</style>