超V课程
This commit is contained in:
@@ -16,10 +16,10 @@
|
|||||||
<u-icon name="bag" color="#fff" size="28"></u-icon>
|
<u-icon name="bag" color="#fff" size="28"></u-icon>
|
||||||
<text>立即购买</text>
|
<text>立即购买</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="saveBtnss gouwuche flexbox" @click="oprate('gouwuche')">
|
<view class="saveBtnss gouwuche flexbox" @click="oprate('gouwuche')">
|
||||||
<uni-icons type="cart" size="28" style="color: #666;"></uni-icons>
|
<uni-icons type="cart" size="28" style="color: #666;"></uni-icons>
|
||||||
<text>加入购物车</text>
|
<text>加入购物车</text>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|||||||
@@ -517,6 +517,13 @@
|
|||||||
"navigationBarTitleText": "健康超市",
|
"navigationBarTitleText": "健康超市",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/course/vipCourse",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "超V课程",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|||||||
@@ -7,11 +7,7 @@
|
|||||||
<u-alert
|
<u-alert
|
||||||
v-if=""
|
v-if=""
|
||||||
style="
|
style="
|
||||||
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 10;
|
|
||||||
"
|
"
|
||||||
:title="goBuyTitle"
|
:title="goBuyTitle"
|
||||||
type="warning"
|
type="warning"
|
||||||
@@ -105,7 +101,8 @@
|
|||||||
},
|
},
|
||||||
proPriceList:[],
|
proPriceList:[],
|
||||||
pricespop:false,
|
pricespop:false,
|
||||||
userMsg:{},
|
userMsg:{},
|
||||||
|
cartList:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//第一次加载
|
//第一次加载
|
||||||
@@ -137,14 +134,111 @@
|
|||||||
},
|
},
|
||||||
//方法
|
//方法
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取购物车数据
|
||||||
|
addCart(val){
|
||||||
|
console.log(val)
|
||||||
|
if (val.productStock == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '商品库存不足',
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log(this.userInfo, '222')
|
||||||
|
this.$http
|
||||||
|
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
|
||||||
|
.then(res => {
|
||||||
|
// console.log(
|
||||||
|
this.cartList = res.cartList
|
||||||
|
this.isAddLink(val)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 加入到购物车
|
||||||
|
isAddLink(item) {
|
||||||
|
// 统计商品信息
|
||||||
|
let data = {
|
||||||
|
"userId": this.userInfo.id,
|
||||||
|
"productId": item.productId,
|
||||||
|
"productAmount": this.productAmount,
|
||||||
|
"price": item.price
|
||||||
|
}
|
||||||
|
// 判断列表是否为空
|
||||||
|
if (this.cartList.length > 0) {
|
||||||
|
let flag = ''
|
||||||
|
let shagnpin = {}
|
||||||
|
// 循环购物车列表
|
||||||
|
flag = this.cartList.some((item, index) => {
|
||||||
|
if (item.productId == data.productId) {
|
||||||
|
shagnpin = item
|
||||||
|
shagnpin.productAmount += 1
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (flag) {
|
||||||
|
// 已在购物车中添加
|
||||||
|
$http.request({
|
||||||
|
url: "book/ordercart/update",
|
||||||
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
|
data: shagnpin,
|
||||||
|
header: { //默认 无 说明:请求头
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.upoShow = false
|
||||||
|
uni.showToast({
|
||||||
|
title: '加入购物车成功',
|
||||||
|
duration: 1000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 加入购物车
|
||||||
|
$http.request({
|
||||||
|
url: "book/ordercart/save",
|
||||||
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
|
data,
|
||||||
|
header: { //默认 无 说明:请求头
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.upoShow = false
|
||||||
|
uni.showToast({
|
||||||
|
title: '加入购物车成功',
|
||||||
|
duration: 1000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// 购物车列表为空时直接加入购物车
|
||||||
|
$http.request({
|
||||||
|
url: "book/ordercart/save",
|
||||||
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
|
data,
|
||||||
|
header: { //默认 无 说明:请求头
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '加入购物车成功',
|
||||||
|
duration: 1000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
oprate(data){
|
oprate(data){
|
||||||
console.log(data,'得到的内容')
|
console.log(data,'得到的内容')
|
||||||
if(data.name == 'buy'){
|
if(data.name == 'buy'){
|
||||||
this.buy(data.item)
|
this.buy(data.item)
|
||||||
}
|
}
|
||||||
// else if(data.name == 'gouwuche'){
|
else if(data.name == 'gouwuche'){
|
||||||
// this.addCart(data.item)
|
this.addCart(data.item)
|
||||||
// }
|
}
|
||||||
},
|
},
|
||||||
buy(val){
|
buy(val){
|
||||||
var mynavData = JSON.stringify({
|
var mynavData = JSON.stringify({
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
|
||||||
<view class="imgcontainer" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
|
<view class="imgcontainer" @click="onPageJump('/pages/course/myCourseLearn',item.id)">
|
||||||
<image :src="item.image" mode="aspectFit"></image>
|
<image v-if="item.image && item.image != ''" :src="item.image" mode="aspectFit"></image>
|
||||||
|
<!-- <image :src="item.image" mode="" @click="goDetail(item.productId)"></image> -->
|
||||||
|
<!-- <image v-else src="/static/nobg.jpg" mode="widthFix"></image> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="buyItems">
|
<view class="buyItems">
|
||||||
<view class="txt555">
|
<view class="txt555">
|
||||||
@@ -300,7 +302,7 @@
|
|||||||
.then(res => {
|
.then(res => {
|
||||||
// console.log(
|
// console.log(
|
||||||
this.cartList = res.cartList
|
this.cartList = res.cartList
|
||||||
// this.isAddLink(val)
|
this.isAddLink(val)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -321,7 +323,7 @@
|
|||||||
flag = this.cartList.some((item, index) => {
|
flag = this.cartList.some((item, index) => {
|
||||||
if (item.productId == data.productId) {
|
if (item.productId == data.productId) {
|
||||||
shagnpin = item
|
shagnpin = item
|
||||||
shagnpin.productAmount = item.productAmount + 1
|
shagnpin.productAmount += 1
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 公共组件-每个页面必须引入 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
<public-module></public-module>
|
<public-module></public-module>
|
||||||
<z-nav-bar :title="pageTitle"></z-nav-bar>
|
<z-nav-bar title="超V专享课程"></z-nav-bar>
|
||||||
<view class="learnBox box" >
|
<view class="learnBox box" >
|
||||||
<view class="newBox">
|
<view class="newBox">
|
||||||
<view class="item flexbox" v-for="(item, index) in courseList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id, item.title)">
|
<view class="item flexbox" v-for="(item, index) in courseList" :key="index" @click="onPageJump('/pages/course/courseDetail',item.id, item.title)">
|
||||||
@@ -102,10 +102,9 @@
|
|||||||
this.status = 1
|
this.status = 1
|
||||||
this.flag = false
|
this.flag = false
|
||||||
$http.request({
|
$http.request({
|
||||||
url: "medical/home/getMarketCourseList",
|
url: "medical/course/getCourseByVip",
|
||||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
data: {
|
data: {
|
||||||
"id": this.tagId,
|
|
||||||
"limit": 12,
|
"limit": 12,
|
||||||
"page": this.page
|
"page": this.page
|
||||||
},
|
},
|
||||||
@@ -115,10 +114,10 @@
|
|||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
if (res.courseList.records.length > 0) {
|
if (res.data.records.length > 0) {
|
||||||
var list = res.courseList.records
|
var list = res.data.records
|
||||||
this.courseList = this.courseList.concat(list)
|
this.courseList = this.courseList.concat(list)
|
||||||
if(res.courseList.pages > this.page){
|
if(res.data.pages > this.page){
|
||||||
this.status = 0
|
this.status = 0
|
||||||
}else{
|
}else{
|
||||||
this.status = 2
|
this.status = 2
|
||||||
|
|||||||
@@ -59,8 +59,10 @@
|
|||||||
class="curriulum_title_box goods_item"
|
class="curriulum_title_box goods_item"
|
||||||
v-for="(v, i) in goodsDataList"
|
v-for="(v, i) in goodsDataList"
|
||||||
>
|
>
|
||||||
<image class="goods_item_img" :src="v.productImages" mode="aspectFit">
|
|
||||||
|
<image v-if="v.productImages && v.productImages != ''" class="goods_item_img" :src="v.productImages" mode="aspectFit">
|
||||||
</image>
|
</image>
|
||||||
|
<image v-else src="/static/nobg1.jpg" mode="widthFix" @click="goDetail(item.productId)"></image>
|
||||||
<view class="normal_box">
|
<view class="normal_box">
|
||||||
<view class="normal_box_top" style="justify-content: space-between">
|
<view class="normal_box_top" style="justify-content: space-between">
|
||||||
<view class="curriulum_title">{{ v.productName }} </view>
|
<view class="curriulum_title">{{ v.productName }} </view>
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
<image src="../../static/my_02.png" mode="aspectFit"></image>
|
<image src="../../static/my_02.png" mode="aspectFit"></image>
|
||||||
<text>我的课程</text>
|
<text>我的课程</text>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="item flexbox" @click="onPageJump()">
|
<div class="item flexbox" @click="onPageJump('/pages/course/vipCourse')">
|
||||||
<image src="../../static/my_03.png" mode="aspectFit"></image>
|
<image src="../../static/my_06.png" mode="aspectFit"></image>
|
||||||
<text>超V专享</text>
|
<text>超V专享</text>
|
||||||
</div> -->
|
</div>
|
||||||
<!-- <div class="item flexbox" @click="onPageJump()">
|
<!-- <div class="item flexbox" @click="onPageJump()">
|
||||||
<image src="../../static/my_03.png" mode="aspectFit"></image>
|
<image src="../../static/my_03.png" mode="aspectFit"></image>
|
||||||
<text>太湖讲堂</text>
|
<text>太湖讲堂</text>
|
||||||
@@ -1387,20 +1387,20 @@
|
|||||||
|
|
||||||
.hn_cl_tit.active {
|
.hn_cl_tit.active {
|
||||||
background-color: #e4eefa;
|
background-color: #e4eefa;
|
||||||
position: relative;
|
// position: relative;
|
||||||
text {
|
text {
|
||||||
color: #3361a5;
|
color: #3361a5;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.hn_cl_tit.active::after{
|
// .hn_cl_tit.active::after{
|
||||||
display: block;
|
// display: block;
|
||||||
transform: rotate(180deg);
|
// transform: rotate(180deg);
|
||||||
content: ''; position: absolute; bottom: -20rpx; left: calc(50% - 16rpx); z-index: 1;
|
// content: ''; position: absolute; bottom: -20rpx; left: calc(50% - 16rpx); z-index: 1;
|
||||||
border-right: 20rpx solid transparent;
|
// border-right: 20rpx solid transparent;
|
||||||
border-left: 20rpx solid transparent;
|
// border-left: 20rpx solid transparent;
|
||||||
border-bottom: 20rpx solid #ffff;
|
// border-bottom: 20rpx solid #ffff;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
class="round checkedItem" />
|
class="round checkedItem" />
|
||||||
</view>
|
</view>
|
||||||
<view class="cartContent">
|
<view class="cartContent">
|
||||||
<image :src="item.image" mode="" @click="goDetail(item.productId)"></image>
|
<image v-if="item.image && item.image != ''" :src="item.image" mode="" @click="goDetail(item.productId)"></image>
|
||||||
|
<image v-else src="/static/nobg1.jpg" mode="widthFix" @click="goDetail(item.productId)"></image>
|
||||||
<view class="itemCenter">
|
<view class="itemCenter">
|
||||||
<view class="cartTitle" @click="goDetail(item.productId)">
|
<view class="cartTitle" @click="goDetail(item.productId)">
|
||||||
<text>{{item.productName}}</text>
|
<text>{{item.productName}}</text>
|
||||||
|
|||||||
BIN
static/my_06.png
Normal file
BIN
static/my_06.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
BIN
static/nobg1.jpg
Normal file
BIN
static/nobg1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user