diff --git a/components/buyPup.vue b/components/buyPup.vue
index 43aa968..1204329 100644
--- a/components/buyPup.vue
+++ b/components/buyPup.vue
@@ -16,10 +16,10 @@
立即购买
-
+
diff --git a/pages.json b/pages.json
index 616d0f6..8036664 100644
--- a/pages.json
+++ b/pages.json
@@ -510,6 +510,20 @@
"navigationBarTitleText": "医述详情",
"enablePullDownRefresh": false
}
+ },
+ {
+ "path": "pages/course/healthMarket",
+ "style": {
+ "navigationBarTitleText": "健康超市",
+ "enablePullDownRefresh": false
+ }
+ },
+ {
+ "path": "pages/course/vipCourse",
+ "style": {
+ "navigationBarTitleText": "超V课程",
+ "enablePullDownRefresh": false
+ }
}
],
"globalStyle": {
diff --git a/pages/course/coursePrice.vue b/pages/course/coursePrice.vue
index 6ce4387..f629626 100644
--- a/pages/course/coursePrice.vue
+++ b/pages/course/coursePrice.vue
@@ -7,18 +7,14 @@
-
+
开通VIP
@@ -105,7 +101,8 @@
},
proPriceList:[],
pricespop:false,
- userMsg:{},
+ userMsg:{},
+ cartList:[]
};
},
//第一次加载
@@ -137,14 +134,111 @@
},
//方法
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){
console.log(data,'得到的内容')
if(data.name == 'buy'){
this.buy(data.item)
}
- // else if(data.name == 'gouwuche'){
- // this.addCart(data.item)
- // }
+ else if(data.name == 'gouwuche'){
+ this.addCart(data.item)
+ }
},
buy(val){
var mynavData = JSON.stringify({
diff --git a/pages/course/healthMarket.vue b/pages/course/healthMarket.vue
new file mode 100644
index 0000000..73daed9
--- /dev/null
+++ b/pages/course/healthMarket.vue
@@ -0,0 +1,274 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{item.productName}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/course/myCourse.vue b/pages/course/myCourse.vue
index a44e02c..6bf4f4f 100644
--- a/pages/course/myCourse.vue
+++ b/pages/course/myCourse.vue
@@ -37,7 +37,9 @@
-
+
+
+
@@ -300,7 +302,7 @@
.then(res => {
// console.log(
this.cartList = res.cartList
- // this.isAddLink(val)
+ this.isAddLink(val)
})
}
},
@@ -321,7 +323,7 @@
flag = this.cartList.some((item, index) => {
if (item.productId == data.productId) {
shagnpin = item
- shagnpin.productAmount = item.productAmount + 1
+ shagnpin.productAmount += 1
return true
}
})
diff --git a/pages/course/myCourseLearn.vue b/pages/course/myCourseLearn.vue
index 6738b68..22361ac 100644
--- a/pages/course/myCourseLearn.vue
+++ b/pages/course/myCourseLearn.vue
@@ -33,7 +33,7 @@
{{item.title}}
-
+
@@ -43,16 +43,17 @@
- 课程观看有效期截止到:{{librayList[curIndex].endTime}}
+ 课程观看有效期截止到:{{librayList[curIndex].endTime}}
+
{{item.title}}
-
-
+
@@ -56,6 +57,15 @@
status:0, // 0 不显示, 1 加载中,2 加载全部完成,3 暂无数据
page:1,
flag:true, // 函数是否执行完
+ bgiStyle: {
+ background: '#fff'
+ },
+ scrollTop: 0,
+ iconStyle: {
+ fontSize: '40rpx',
+ fontWeight: 'bold',
+ color: '#258feb',
+ },
};
},
//第一次加载
@@ -67,8 +77,11 @@
console.log(e, '传入分类id')
this.getData();
},
+ onPageScroll(e) {
+ this.scrollTop = e.scrollTop;
+ },
onReachBottom() {
- if(this.status != 2){
+ if(this.status != 2 && this.flag){
this.page ++
this.getData() }
console.log('触底加载',this.page)
@@ -95,10 +108,10 @@
});
},
getData() {
- if(!this.flag){
- console.log('正在执行,未完成')
- return
- }
+ // if(!this.flag){
+ // console.log('正在执行,未完成')
+ // return
+ // }
this.status = 1
this.flag = false
$http.request({
diff --git a/pages/course/vipCourse.vue b/pages/course/vipCourse.vue
index e18a0c8..0d0ad07 100644
--- a/pages/course/vipCourse.vue
+++ b/pages/course/vipCourse.vue
@@ -2,7 +2,7 @@
-
+
@@ -102,10 +102,9 @@
this.status = 1
this.flag = false
$http.request({
- url: "medical/home/getMarketCourseList",
+ url: "medical/course/getCourseByVip",
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
- data: {
- "id": this.tagId,
+ data: {
"limit": 12,
"page": this.page
},
@@ -115,10 +114,10 @@
})
.then(res => {
if (res.code == 0) {
- if (res.courseList.records.length > 0) {
- var list = res.courseList.records
+ if (res.data.records.length > 0) {
+ var list = res.data.records
this.courseList = this.courseList.concat(list)
- if(res.courseList.pages > this.page){
+ if(res.data.pages > this.page){
this.status = 0
}else{
this.status = 2
diff --git a/pages/goods/order/index.vue b/pages/goods/order/index.vue
index 76e1900..b2e9681 100644
--- a/pages/goods/order/index.vue
+++ b/pages/goods/order/index.vue
@@ -59,8 +59,10 @@
class="curriulum_title_box goods_item"
v-for="(v, i) in goodsDataList"
>
-
+
+
+
{{ v.productName }}
diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue
index 31f3236..f1e42a7 100644
--- a/pages/peanut/home.vue
+++ b/pages/peanut/home.vue
@@ -22,10 +22,10 @@
我的课程
-
+
-
-
-
-
-
-
-
-
- {{item.title}}
-
-
-
-
-
-
+
-
+
-
+
健康超市
@@ -124,9 +107,9 @@
-
+
@@ -173,6 +156,24 @@
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
@@ -1347,7 +1348,8 @@
color: #333;
margin-bottom: 0;
- @include pleft_right(5px) .hn_cl_tit {
+ @include pleft_right(5px)
+ .hn_cl_tit {
display: block;
width: 100%;
background-color: #fff;
@@ -1356,6 +1358,7 @@
align-content: center;
justify-content: center;
margin-right: 8rpx;
+ border-bottom: 1px solid #fff;
// box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.3);
image {
@@ -1384,13 +1387,20 @@
.hn_cl_tit.active {
background-color: #e4eefa;
-
+ // position: relative;
text {
color: #3361a5;
font-weight: bold;
}
}
-
+ // .hn_cl_tit.active::after{
+ // display: block;
+ // transform: rotate(180deg);
+ // content: ''; position: absolute; bottom: -20rpx; left: calc(50% - 16rpx); z-index: 1;
+ // border-right: 20rpx solid transparent;
+ // border-left: 20rpx solid transparent;
+ // border-bottom: 20rpx solid #ffff;
+ // }
}
diff --git a/pages/peanut/shopping.vue b/pages/peanut/shopping.vue
index 7a48536..9cbd6ad 100644
--- a/pages/peanut/shopping.vue
+++ b/pages/peanut/shopping.vue
@@ -9,7 +9,8 @@
class="round checkedItem" />
-
+
+
{{item.productName}}
diff --git a/static/my_06.png b/static/my_06.png
new file mode 100644
index 0000000..1caf62e
Binary files /dev/null and b/static/my_06.png differ
diff --git a/static/nobg1.jpg b/static/nobg1.jpg
new file mode 100644
index 0000000..76b9e1e
Binary files /dev/null and b/static/nobg1.jpg differ