我的课程-购买 未完成

This commit is contained in:
@fawn-nine
2024-06-21 17:33:11 +08:00
parent c8d7b5f271
commit ccc4e5d72a
7 changed files with 618 additions and 233 deletions

198
components/buyPup.vue Normal file
View File

@@ -0,0 +1,198 @@
<template>
<view>
<u-popup key="1" :show="pricespop" :round="10" @close="closePup">
<view class="proListPrice" v-if="proPriceList.length > 0">
<view class="title">
请选择
</view>
<view class="list">
<view :class="['item',curProId == item.productId ? 'active' : '']"
v-for="(item,index) in proPriceList" :key="index" @click="choosePrice(item)">
{{item.productName}} - {{item.price}}
</view>
</view>
<view class="tbn flexbox" style="padding-bottom: 20px;">
<view class="saveBtnss buybtn flexbox" @click="oprate('buy')">
<u-icon name="bag" color="#fff" size="28"></u-icon>
<text>立即购买</text>
</view>
<view class="saveBtnss gouwuche flexbox" @click="oprate('gouwuche')">
<uni-icons type="cart" size="28" style="color: #666;"></uni-icons>
<text>加入购物车</text>
</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
name:"buyPup",
props:['proPriceList'],
data() {
return {
pricespop:true,
curProId:null,
};
},methods:{
closePup() {
this.pricespop = false
this.$emit('closePup')
// this.proPriceList = []
},
choosePrice(item) {
// console.log(item, 'choosePrice')
this.curProId = item.productId
},
oprate(val){
if(!this.curProId){
uni.showToast({
title:'请选择您的课程',
icon:'none'
})
return
}
if(val=='buy'){
console.log('直接购买');
this.$emit('oprate',{name:val,id:this.curProId})
}else if(val == 'gouwuche'){
console.log('加入购物车');
this.$emit('oprate',{name:val,id:this.curProId})
}
this.closePup()
}
}
}
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.flexbox {
display: flex;
}
.saveBtn {
align-items: center;
justify-content: center;
height: 80rpx;
background-color: #00d8df;
// width: 46%;
overflow: hidden;
border-radius: 30rpx;
text {
padding-left: 10rpx;
font-size: 28rpx;
color: #fff;
}
}
.vipBtn {
@include theme("vipbtnbg");
border-radius: 100rpx;
justify-content: center;
width: 150px;
color: #fff;
margin: 10rpx auto;
}
.buyBox {
// position: fixed;
// z-index: 2;
// bottom: 100rpx;
// left: 0;
@include pleft_right(4px);
// @include mshadow(10px, 1);
padding: 20rpx 10rpx;
width: 100%;
font-size: 28rpx;
flex-wrap: wrap;
background-image: linear-gradient(60deg, #e0e9f6 0%,#ece6fa 30%,#d7e8f0 60%, #fff 100%);
// background: rgba(255, 255, 255, 0.9);
.item {
width: 100%;
text-align: center; line-height: 70rpx !important;
}
.tbn {
align-items: center;
}
.buybtn {
color: #fff;
}
}
.proListPrice {
text-align: center;
.title {
font-size: 28rpx;
margin: 10px 0;
}
.list {
padding: 0 10px;
padding-bottom: 20rpx;
.item {
font-size: 26rpx;
color: #333;
margin-bottom: 10rpx;
line-height: 80rpx;
border-radius: 50rpx;
border: 1px solid #eee;
}
.item.active {
color: $themeColor;
border: 1px solid $themeColor;
}
.item:last-child {
// border-bottom: none
}
}
.tbn {
justify-content: center;
}
.buybtn { padding: 0 20rpx;
background-color: #00d8df;
margin: 0;
margin-right: 20rpx;
text {
color: #fff;
}
}
.saveBtnss {
align-items: center;
justify-content: center;
height: 80rpx;
// width: 46%;
overflow: hidden;
border-radius: 50rpx;
text {
padding-left: 10rpx;
font-size: 28rpx;
}
}
.gouwuche {
border: 1px solid #666;
padding-right: 20rpx;
text {
// color: #fff;
}
}
}
</style>

View File

@@ -86,12 +86,12 @@ export default {
selectedIconPath: "static/tab/tab_cur_02.png",
text: "购物车",
},
{
pagePath: "pages/taihu/index",
iconPath: "static/tab/tab_nor_03.png",
selectedIconPath: "static/tab/tab_cur_03.png",
text: "太湖公益",
},
// {
// pagePath: "pages/taihu/index",
// iconPath: "static/tab/tab_nor_03.png",
// selectedIconPath: "static/tab/tab_cur_03.png",
// text: "太湖公益",
// },
{
pagePath: "pages/bookShop/orderList",
iconPath: "static/tab/order.png",

View File

@@ -467,12 +467,12 @@
"selectedIconPath": "static/tab/tab_cur_02.png",
"text": "购物车"
},
{
"pagePath": "pages/taihu/index",
"iconPath": "static/tab/tab_nor_03.png",
"selectedIconPath": "static/tab/tab_cur_03.png",
"text": "太湖公益"
},
// {
// "pagePath": "pages/taihu/index",
// "iconPath": "static/tab/tab_nor_03.png",
// "selectedIconPath": "static/tab/tab_cur_03.png",
// "text": "太湖公益"
// },
{
"pagePath": "pages/bookShop/orderList",
"iconPath": "static/tab/order.png",

View File

@@ -8,12 +8,12 @@
<image v-else :src="course.image" mode="widthFix"></image>
</view>
<view class="containerBg1">
<!-- <view class="vipSee"> -->
<view class="vipSee" v-if="userInfo.vip != 0">
<!-- <view class="vipSee"> -->
<view class="vipSee" v-if="userMsg.vip != 0">
<text>VIP畅学权益生效中</text>
</view>
<view class="courseTitle flexbox" v-if="course.id">
<view class="" v-if="userInfo.vip != 0">
<view class="" v-if="userMsg.vip != 0">
<view class="" style="width: calc(100% - 170rpx);">
<text class="title">{{course.title}}</text>
</view>

View File

@@ -9,47 +9,51 @@
itemStyle="padding-left: 15px; padding-right: 15px; height: 50px;"></u-tabs>
</view>
<view class="containerBg1">
<!-- 我的课程 -->
<view class="MyCourseBox" v-show="this.curTagId == 0">
<view class="search" style="margin-top: 20rpx;">
<u-search placeholder="请输入课程名" @clear="clear" v-model="searchValue"
<u-search placeholder="请输入课程名" @focus="focus" @clear="clear" v-model="searchValue" @blur="blur"
@search="search" @custom="search"></u-search>
</view>
<uni-section class="mb-10" title="课程列表" type="line">
<template v-slot:right>
<u-icon name="grid" color="#2979ff" size="28" @click="showDrawer"></u-icon>
</template>
</uni-section>
<view class="selectCateText" v-if="selectCat != ''">
<text>已选中分类{{selectCat}}</text>
<text class="del" @click="delselectCat">清除</text>
<view class="sectionTitle flexbox">
<view class="selectCateText" >
<view class="" >
<text v-if="selectCat == ''">已显示全部课程</text>
<text v-else>已选中分类{{selectCat}}</text>
<text class="del" @click="delselectCat" v-if="selectCat != ''">清除</text>
</view>
</view>
<view class="flexbox rightIcon" @click="showDrawer">
<u-icon name="grid" color="#2979ff" size="28" ></u-icon><text>按分类筛选</text>
</view>
</view>
<!-- <view class="containerBg"> -->
<view class="newBox">
<view class="item flexbox" v-for="(item, index) in MyCourseList.list" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
<view :class="['item','flexbox', userMsg.vip != '0'&& item.isBuy != 1 ? 'blueBorder':'']" v-for="(item, index) in MyCourseList.list" :key="index"
>
<view class="vipTag" v-if="userMsg.vip != '0' && item.isBuy != 1">
VIP畅学
</view>
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<view class="imgcontainer" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555">
{{item.title}}
</view>
<view class="" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
{{item.title}}
</view>
</view>
<view class="jianjie" v-html="item.content">
</view>
<view class="tag-view">
<uni-tag v-if="item.level != 0" style="margin-right: 10rpx;"
:text="item.level == 1 ? '初级':'高级'" type="primary" size="small" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;"
text="必修" size="small" type="warning" />
<uni-tag v-if="item.selective != 0 && item.selective == 2" style="margin-right: 10rpx;"
text="选修" size="small" type="success" />
</view>
<view class="btn_box">
<text>了解课程</text>
</view>
<view class="collection">
<!-- 收藏状态{{item.isStudying}} -->
<text class="add citem" v-if="item.isStudying == 0" @click="addCollection(item,index)">加入在学习</text>
<text class="del citem" v-else @click="delCollection(item,index)">取消在学习</text>
<text class="citem btn_box" @click="onPageJump('/pages/course/myCourseLearn',item.id)">去学习</text>
</view>
</view>
</view>
@@ -58,39 +62,32 @@
<u-divider v-show="MyCourseList.status == 3" text="暂无数据"></u-divider>
<u-divider v-show="MyCourseList.status == 1" text="加载中..."></u-divider>
</view>
<view class="LearningCourseBox" v-show="this.curTagId == 1">
<uni-section class="mb-10" title="在学习课程列表" type="line">
<!-- <template v-slot:right>
<u-icon name="grid" color="#2979ff" size="28" @click="showDrawer"></u-icon>
</template> -->
</uni-section>
<!-- 在学习 -->
<view class="LearningCourseBox" v-show="this.curTagId == 1">
<!-- <view class="containerBg"> -->
<view class="newBox">
<view class="item flexbox" v-for="(item, index) in LearningCourseList.list" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
<view :class="['item','flexbox', userMsg.vip != '0' && item.isBuy != 1 ? 'blueBorder':'']" v-for="(item, index) in LearningCourseList.list" :key="index"
>
<view class="vipTag" v-if="userMsg.vip != '0' && item.isBuy != 1">
VIP畅学
</view>
<!-- {{userMsg}} -->
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<view class="imgcontainer" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555">
<view class="txt555" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
{{item.title}}
</view>
<view class="jianjie" v-html="item.content">
</view>
<view class="tag-view">
<uni-tag v-if="item.level != 0" style="margin-right: 10rpx;"
:text="item.level == 1 ? '初级':'高级'" type="primary" size="small" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;"
text="必修" size="small" type="warning" />
<uni-tag v-if="item.selective != 0 && item.selective == 2" style="margin-right: 10rpx;"
text="选修" size="small" type="success" />
</view>
<view class="btn_box">
<text>了解课程</text>
</view>
</view>
<view class="jianjie" v-html="item.content">
</view>
<view class="collection">
<!-- <text class="add citem" v-if="item.isStudying == 0" @click="addCollection(item,index)">加入在学习</text> -->
<text class="del citem" @click="delCollection(item,index)">取消在学习</text>
<text class="citem btn_box" @click="onPageJump('/pages/course/myCourseLearn',item.id)">去学习</text>
</view>
</view>
</view>
@@ -99,38 +96,25 @@
<u-divider v-show="LearningCourseList.status == 3" text="暂无数据"></u-divider>
<u-divider v-show="LearningCourseList.status == 1" text="加载中..."></u-divider>
</view>
<view class="ExpiredCourseBox" v-show="this.curTagId == 2">
<uni-section class="mb-10" title="过期课程列表" type="line">
<!-- <template v-slot:right>
<u-icon name="grid" color="#2979ff" size="28" @click="showDrawer"></u-icon>
</template> -->
</uni-section>
<!-- 已过期 -->
<view class="ExpiredCourseBox" v-show="this.curTagId == 2">
<!-- <view class="containerBg"> -->
<view class="newBox">
<view class="item flexbox" v-for="(item, index) in ExpiredCourseList.list" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id)">
>
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer">
<view class="imgcontainer" @click="onPageJump('/pages/course/courseDetail',item.id)">
<image :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems">
<view class="txt555">
{{item.title}}
<view class="txt555" @click="onPageJump('/pages/course/courseDetail',item.id)">
{{item.title}}
</view>
<view class="jianjie" v-html="item.content">
</view>
<view class="tag-view">
<uni-tag v-if="item.level != 0" style="margin-right: 10rpx;"
:text="item.level == 1 ? '初级':'高级'" type="primary" size="small" />
<uni-tag v-if="item.selective != 0 && item.selective == 1" style="margin-right: 10rpx;"
text="必修" size="small" type="warning" />
<uni-tag v-if="item.selective != 0 && item.selective == 2" style="margin-right: 10rpx;"
text="选修" size="small" type="success" />
</view>
<view class="btn_box">
<text>了解课程</text>
</view>
<view class="btn_box" @click="xufei(item)">
<text>续费课程</text>
</view>
</view>
@@ -150,7 +134,7 @@
<!-- 评论弹出 -->
<public-module></public-module>
<tree-list ref="treeList" v-if="treeListVisible" @clickCourseInfo="clickCourseInfo"></tree-list>
<buy-pup v-if="pricespop" :proPriceList="proPriceList" @closePup="closePup" @oprate="oprate"></buy-pup>
<z-navigation></z-navigation>
<!-- <music-play :playData="playData"></music-play> -->
</view>
@@ -159,6 +143,7 @@
<script>
// import musicPlay from '@/components/music.vue'
import buyPup from '@/components/buyPup.vue'
import treeList from '@/components/tagTree.vue'
import commentsList from '@/components/commentsList.vue'
import emojiList1 from '../../bkhumor-emojiplus/emoji/biaoqin.js'
@@ -171,6 +156,8 @@
export default {
data() {
return {
proPriceList: [],
pricespop:false,
curTagId: 0,
playData: {},
searchValue:'',
@@ -227,7 +214,8 @@
status: 88,
page: 1,
flag: false
}
},
oldValue : ''
};
},
@@ -240,9 +228,7 @@
console.log(e, '传入分类id')
this.getUserInfo()
// this.fatherClick()
this.getMyCourseList()
this.getLearningCourseList()
this.getExpiredCourseList()
this.getMyCourseList()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
@@ -284,14 +270,37 @@
components: {
// musicPlay
emotion,
treeList
treeList,
buyPup
// commentsList
},
//方法
methods: {
oprate(data){
console.log(data,'得到的内容')
if(data.name == 'buy'){
this.buy(data)
}else if(data.name == 'gouwuche'){
this.addCart(data)
}
},
// 购物车
addCart(){
},
// 直接购买
buy(val){
uni.navigateTo({
url:`/pages/bookShop/settlement?type=2&list=${val.id}`
})
},
closePup(e){
this.pricespop = false
},
delselectCat(){
this.selectCat = ''
this.medicalId = ''
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
@@ -302,16 +311,28 @@
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
// this.curTagId = 0
// }else if(this.curTagId == 1){
// this.getLearningCourseList()
// }else if(this.curTagId == 2){
// this.getExpiredCourseList()
// }
console.log(this.searchValue,'searchValue')
},
focus(res){
this.oldValue = res
// console.log(res,this.oldValue,'聚焦');
},
blur(res){
// console.log(res,this.searchValue,'res');
if(this.oldValue != res){ // 重新请求
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
this.oldValue = ''
}
},
cancel(res){},
clear(){
// console.log('++++++++++++++++++++++')
this.searchValue = ''
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
},
clickCourseInfo(val){
console.log(val,'选择的分类数据');
@@ -327,7 +348,7 @@
console.log(e,'tabitem')
this.curTagId = e.index
},
showDrawer(){
showDrawer(){
this.treeListVisible = true
this.$nextTick( ()=> {
this.$refs['treeList'].getData()
@@ -381,7 +402,7 @@
url: "medical/course/getUserCourseStudying",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"userId": this.userInfo.id
"userId": this.userMsg.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -417,7 +438,7 @@
url: "medical/course/getCourseExpire",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"userId": this.userInfo.id
"userId": this.userMsg.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -449,10 +470,115 @@
.post('book/user/info/' + this.userInfo.id)
.then(res => {
this.userMsg = res.user
// this.userInfo = res.user
this.getLearningCourseList()
this.getExpiredCourseList()
});
// }
},
addCollection(val,index){
$http.request({
url: "medical/course/addUserCourseStudying",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"userId": this.userInfo.id,
"courseId": val.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if(res.code == 0){
uni.showToast({
title:'加入成功',
icon:'success'
})
if(this.curTagId == 0){
console.log(this.MyCourseList.list[index],'this.MyCourseList[index]')
this.MyCourseList.list[index].isStudying = 1
this.getLearningCourseList() // 刷新收藏列表
}
}
})
.catch(e => {
console.log('加入在学习', e)
})
},
delCollection(val, index){
// console.log(val,'val');
$http.request({
url: "medical/course/delUserCourseStudying",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
// "userId": this.userInfo.id,
"courseId": val.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if(res.code == 0){
uni.showToast({
title:'取消成功',
icon:'success'
})
if(this.curTagId == 0){
console.log(this.MyCourseList.list[index],'this.MyCourseList[index]')
this.MyCourseList.list[index].isStudying = 0
this.getLearningCourseList() // 刷新收藏列表
}else if(this.curTagId == 1){
this.LearningCourseList.list.splice(index,1)
this.MyCourseList.page = 1
this.MyCourseList.list = []
this.getMyCourseList()
}
}
})
.catch(e => {
console.log('取消收藏报错', e)
uni.showToast({
title:'取消失败',
icon:'error'
})
})
},
xufei(val){
console.log('去续费,获取商品列表')
$http.request({
url: "sociology/product/getProductListForCourse",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"id": val.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.productList.length > 0) {
this.proPriceList = res.productList
// this.curProId = this.proPriceList[0].productId
} else {
this.proPriceList = []
}
}
}).catch(e => {
console.log(e, '获取商品列表报错')
});
this.pricespop = true
},
// 获取续费商品
getCourseProList(){
},
// 跳转
onPageJump(url, id) {
uni.navigateTo({
@@ -465,7 +591,27 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.selectCateText{ margin-bottom: 20rpx;
.LearningCourseBox,.ExpiredCourseBox{margin-top: 20rpx;}
.collection{ margin-top: 20rpx; overflow: hidden; text-align: right;
.btn_box{border: 1px solid $themeColor !important; color:$themeColor !important; margin-left: 20rpx;}
.citem{ display: inline-block;
border-radius: 10rpx;
// background-color: #ff7446;
border: 1px solid #ff7446;
padding: 10rpx; font-size:24rpx;
color: #ff7446;
}
.del{
background-color: #ffe6db; color: #ff7446;
}
}
.sectionTitle{
justify-content: space-between; margin-bottom: 20rpx; margin-top: 20rpx;
.rightIcon{color:#2979ff ; align-items: center;}
}
.selectCateText{ min-width:20rpx ;
.del{color: #ff7446; padding-left: 20rpx;}
}
.search{background-color: $containerColor; padding: 10rpx; }
@@ -478,12 +624,23 @@
.curseSet{margin-right: 20rpx; font-size: 28rpx; display: flex; align-items: center;}
.fixed {
position: fixed;
z-index: 1; width: 100%; background-color: #fff;
z-index: 2; width: 100%; background-color: #fff;
}
.newBox {
.item {
.blueBorder{border: 1px solid #2979ff !important;}
.item { overflow: hidden;
border: #fff 1px solid ;
.vipTag{position: absolute; padding:10rpx 80rpx;
left: -60rpx; top: 10rpx;
transform: rotate(-30deg);
-o-transform: rotate(-30deg);
-webkit-transform: rotate(-30deg);
-moz-transform: rotate(-30deg);
z-index: 1;
@include theme("btn_bg") ;
color: #fff;}
position: relative;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 20rpx;
@@ -506,6 +663,7 @@
width: 100%;
height: 200rpx;
}
}
.btn_box{ text-align: right;
text{

View File

@@ -2,13 +2,13 @@
<view style="background-color: #f4f7ff;">
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar :title="pageTitle ? pageTitle : '课程详情'"></z-nav-bar>
<z-nav-bar title="在学习"></z-nav-bar>
<view class="containerBg1">
<!-- <view class="vipSee"> -->
<view :class="[userInfo.vip != 0 ? 'vipBox' : '']" style="padding:0 10px;">
<view :class="[userMsg && userMsg.vip != 0 ? 'vipBox' : '']" style="padding:0 10px;">
<view class="courseTitle flexbox" v-if="course.id">
<view class="vipSee" v-if="userInfo.vip != 0">
<view class="vipSee" v-if="userMsg && userMsg.vip != 0">
<text>VIP畅学权益生效中</text>
</view>
<view class="curseImg flexbox imgcontainer" style="align-items: center;">

View File

@@ -11,16 +11,20 @@
@click="onPageJump('/pages/peanut/searchFor')"></image>
</view>
</view>
</view>
</view>
<view class="fourBox">
<view class="fourIcon flexbox" style="justify-content: space-around;">
<view class="fourIcon flexbox" style="justify-content: space-around;">
<div class="item flexbox" @click="onPageJump('/pages/course/outline')">
<image src="../../static/my_01.png" mode="aspectFit"></image>
<text>学习大纲</text>
</div>
<div class="item flexbox" @click="onPageJump('/pages/course/myCourse')">
<image src="../../static/my_02.png" mode="aspectFit"></image>
<text>我的课程</text>
</div>
<div class="item flexbox" @click="onPageJump('/pages/course/outline')">
<image src="../../static/my_01.png" mode="aspectFit"></image>
<text>学习大纲</text>
<div class="item flexbox" @click="onPageJump('/pages/taihu/index')">
<image src="../../static/my_05.png" mode="aspectFit"></image>
<text>太湖公益</text>
</div>
<!-- <div class="item flexbox" @click="onPageJump()">
<image src="../../static/my_03.png" mode="aspectFit"></image>
@@ -29,7 +33,7 @@
<div class="item flexbox" @click="onPageJump()">
<image src="../../static/my_04.png" mode="aspectFit"></image>
<text>吴门医述</text>
</div>
</div>
</view>
</view>
<view class="home_nar ">
@@ -103,7 +107,8 @@
<view class="borderbb">
<view class=" main">
<view class="flexbox">
<view class="item" v-for="(item, index) in tjProList" :key="index" @click="onPageJump('/pages/bookShop/commodityDetail',item.productId)">
<view class="item" v-for="(item, index) in tjProList" :key="index"
@click="onPageJump('/pages/bookShop/commodityDetail',item.productId)">
<view class="imgcontainer">
<image :src="item.productImages" mode="aspectFit"></image>
</view>
@@ -141,7 +146,8 @@
</view>
<scroll-view class="scroll-view_H" scroll-x="true">
<!-- <view class=""> -->
<view class="item" v-for="(item, index) in seckillList" :key="index" @click="onPageJump('/pages/bookShop/commodityDetail',item.productId)">
<view class="item" v-for="(item, index) in seckillList" :key="index"
@click="onPageJump('/pages/bookShop/commodityDetail',item.productId)">
<view class="imgcontainer">
<image :src="item.productImages" mode="aspectFit"></image>
</view>
@@ -167,34 +173,35 @@
</view>
</view>
</view>
<view class="fourBox" v-if="tryListenList.length > 0">
<view class="learnBox" >
<view class="titleBox flexbox">
<image src="../../static/try_listen.png" mode="aspectFit"></image>
<text>精彩试听</text>
</view>
<view class="learn flexbox shiting">
<view class="item" v-for="(item, index) in tryListenList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id, item.title)">
<view class="imgcontainer">
<image v-if="item.image==''" src="@/static/nobg.jpg" mode="aspectFit"></image>
<image v-else :src="item.image" mode="aspectFit"></image>
</view>
<view class="buyItems flexbox">
<view class="txt555">
{{item.title}}
<view class="fourBox" v-if="tryListenList.length > 0">
<view class="learnBox">
<view class="titleBox flexbox">
<image src="../../static/try_listen.png" mode="aspectFit"></image>
<text>精彩试听</text>
</view>
<view class="learn flexbox shiting">
<view class="item" v-for="(item, index) in tryListenList" :key="index"
@click="onPageJump('/pages/course/courseDetail',item.id, item.title)">
<view class="imgcontainer">
<image v-if="item.image==''" src="@/static/nobg.jpg" mode="aspectFit"></image>
<image v-else :src="item.image" mode="aspectFit"></image>
</view>
<view class="buybtn" @click.stop="onPageJump()">
<span>购买</span>
<view class="buyItems flexbox">
<view class="txt555">
{{item.title}}
</view>
<view class="buybtn" @click.stop="onPageJump()">
<span>购买</span>
</view>
</view>
</view>
</view>
</view>
<view class="moreBox shiting">
<text @click="onPageJump('/pages/course/tryListen',1,'精彩试听')">更多试听</text>
</view>
</view>
<view class="moreBox shiting">
<text @click="onPageJump('/pages/course/tryListen',1,'精彩试听')">更多试听</text>
</view>
</view>
</view>
<view>
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
</view>
@@ -215,8 +222,8 @@
<text>众妙之门</text>
</view>
</view>
</view>
<!-- 公共组件-每个页面必须引入 -->
</view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-navigation></z-navigation>
<music-play :playList="myList"></music-play>
@@ -248,7 +255,7 @@
data() {
return {
myList: [],
showEbook: false, // 显示电子书相关
transaction: { // 成功回调
@@ -372,28 +379,28 @@
id ? ftag = id : ftag = 0
this.$http
.post('medical/home/getCourseMedicalTree')
.then(res => {
console.log(res)
if (res.code == 0) {
if (res.labels.length > 0) {
this.curseTagList = res.labels
this.tabsid = res.labels[0].id
// this.curseClick(res.labels[0])
if (res.labels[0].isLast == 0) { // 非终极
if (res.labels[0].children && res.labels[0].children.length > 0) {
this.sbuMedicalTagsList = res.labels[0].children
} else {
this.sbuMedicalTagsList = []
.then(res => {
console.log(res)
if (res.code == 0) {
if (res.labels.length > 0) {
this.curseTagList = res.labels
this.tabsid = res.labels[0].id
// this.curseClick(res.labels[0])
if (res.labels[0].isLast == 0) { // 非终极
if (res.labels[0].children && res.labels[0].children.length > 0) {
this.sbuMedicalTagsList = res.labels[0].children
} else {
this.sbuMedicalTagsList = []
}
}
} else {
this.tabsid = null
this.curseTagList = []
}
} else {
this.tabsid = null
this.curseTagList = []
}
}
}).catch(e => {
console.log(e, '获取医学标签列表报错')
});
}).catch(e => {
console.log(e, '获取医学标签列表报错')
});
},
// 获取精彩试听课程列表
getTryListenList() {
@@ -511,11 +518,11 @@
});
},
newsClick(item) {
console.log('item',item)
uni.navigateTo({
url: `/pages/news/news?newsId=${item.id}&url=${item.url}&type=${item.type}`
})
newsClick(item) {
console.log('item', item)
uni.navigateTo({
url: `/pages/news/news?newsId=${item.id}&url=${item.url}&type=${item.type}`
})
// }
},
openURL(url) {
@@ -540,7 +547,7 @@
});
}
},
curseClickJump(item){
curseClickJump(item) {
uni.navigateTo({
// url: `/pages/course/index?id=${item.id}&title=中医学`
url: `/pages/course/index?id=${item.id}&title=${item.title}&pid=${item.pid}`
@@ -559,11 +566,11 @@
},
// 跳转
onPageJump(url,thatId,title) {
onPageJump(url, thatId, title) {
uni.navigateTo({
url: `${url}?id=${thatId}&title=${title}`
});
},
},
onPageJumpData(url, data) {
uni.navigateTo({
@@ -603,58 +610,58 @@
url: '../bookShop/bookShopType?type=' + e
});
},
appjumpfun(name){
let bagName = ''
let schemes = ''
if(name == 'zmzm'){
bagName = 'com.cn.zmzm'
schemes = 'zmzm'
}
if(name == 'nuttyreading'){
bagName = 'com.cn.nuttyreading'
schemes = 'nuttyreading'
}
appjumpfun(name) {
let bagName = ''
let schemes = ''
if (name == 'zmzm') {
bagName = 'com.cn.zmzm'
schemes = 'zmzm'
}
if (name == 'nuttyreading') {
bagName = 'com.cn.nuttyreading'
schemes = 'nuttyreading'
}
// if(name == 'everhealth'){
if (plus.os.name == "Android") { //安卓
if (plus.runtime.isApplicationExist({ //查看安卓系统手机有没有下载这款app
pname: bagName, //B款app云打包的包名
})) { //安装了app
plus.runtime.launchApplication({ //打开app
pname: bagName, //B款app云打包的包名
extra: {
url: `${schemes}://${bagName}` //B款app配置的schemes+云打包的包名
},
function(e) {
console.log("Open system default browser failed: " + e.message);
}
})
}
else { //未安装app
plus.runtime.openURL(`https://a.app.qq.com/o/simple.jsp?pkgname=${bagName}`, function(res) {
//进入后台小哥哥给我的应用宝下载链接,让你们后台给你
//这链接会判断你手机是ios还是AndroidAndroid进入应用宝下载app
//跟下面的是一个链接
console.log(res);
});
}
} else if (plus.os.name == "iOS") { //苹果
//因为ios查不到B款app在ios系统手机里面其实下载了也是检测不到所以就不检测了
//直接打开B款appB款app没有的话会进入回调报错我们在回调去打开下载链接
plus.runtime.launchApplication({
action: "${schemes}://"
}, function(e) {
plus.runtime.openURL(`https://a.app.qq.com/o/simple.jsp?pkgname=${bagName}`, function(res) {
//进入后台小哥哥给我的appStore下载app链接让你们后台给你
//这链接会判断你手机是ios还是Androidios进入应用宝下载app
//跟上面的是一个链接
console.log(res);
});
});
// }
}
if (plus.os.name == "Android") { //安卓
if (plus.runtime.isApplicationExist({ //查看安卓系统手机有没有下载这款app
pname: bagName, //B款app云打包的包名
})) { //安装了app
plus.runtime.launchApplication({ //打开app
pname: bagName, //B款app云打包的包名
extra: {
url: `${schemes}://${bagName}` //B款app配置的schemes+云打包的包名
},
function(e) {
console.log("Open system default browser failed: " + e.message);
}
})
} else { //未安装app
plus.runtime.openURL(`https://a.app.qq.com/o/simple.jsp?pkgname=${bagName}`, function(res) {
//进入后台小哥哥给我的应用宝下载链接,让你们后台给你
//这链接会判断你手机是ios还是AndroidAndroid进入应用宝下载app
//跟下面的是一个链接
console.log(res);
});
}
} else if (plus.os.name == "iOS") { //苹果
//因为ios查不到B款app在ios系统手机里面其实下载了也是检测不到所以就不检测了
//直接打开B款appB款app没有的话会进入回调报错我们在回调去打开下载链接
plus.runtime.launchApplication({
action: "${schemes}://"
}, function(e) {
plus.runtime.openURL(`https://a.app.qq.com/o/simple.jsp?pkgname=${bagName}`, function(
res) {
//进入后台小哥哥给我的appStore下载app链接让你们后台给你
//这链接会判断你手机是ios还是Androidios进入应用宝下载app
//跟上面的是一个链接
console.log(res);
});
});
// }
}
},
// 三个列表跳页
onBookMore(e) {
uni.navigateTo({
@@ -670,16 +677,36 @@
</script>
<style lang="scss" scoped>
@import '@/style/mixin.scss';
.appJump{position: fixed; right: 0; top: 8%; z-index: 1;
.item{background: rgba(255, 255, 255, .6); margin-bottom: 20rpx; border: 1px solid #fff;
align-items: center; padding-right: 10rpx;
overflow: hidden; border-radius: 50rpx 0 0 50rpx;
text{font-size: 20rpx;}
.img{
.appJump {
position: fixed;
right: 0;
top: 8%;
z-index: 1;
.item {
background: rgba(255, 255, 255, .6);
margin-bottom: 20rpx;
border: 1px solid #fff;
align-items: center;
padding-right: 10rpx;
overflow: hidden;
border-radius: 50rpx 0 0 50rpx;
text {
font-size: 20rpx;
}
.img {
// width: 60rpx; height: 60rpx;
padding: 6rpx; overflow: hidden;
image{width: 36rpx; height: 36rpx; border-radius: 100%;}
padding: 6rpx;
overflow: hidden;
image {
width: 36rpx;
height: 36rpx;
border-radius: 100%;
}
}
}
}
@@ -958,10 +985,12 @@
.learnBox {
background-color: #fff;
margin-top: 10px; border-radius: 20rpx;
margin-top: 10px;
border-radius: 20rpx;
@include ptop_bottm(10px);
@include pleft_right(10px);
@include mshadow(10px, 1);margin-bottom: 10px;
@include mshadow(10px, 1);
margin-bottom: 10px;
.learn {
justify-content: space-between;
@@ -1204,7 +1233,7 @@
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
padding: 20rpx;
padding:30rpx 20rpx;
position: relative;
// margin-bottom:60rpx;