From a3fddb3e814fbb659c577779e0938f0e086a0c94 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Tue, 25 Jun 2024 10:05:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 7 + pages/course/healthMarket.vue | 274 +++++++++++++++++++++++++++++++++ pages/course/myCourseLearn.vue | 9 +- pages/course/tryListen.vue | 25 ++- pages/peanut/home.vue | 62 ++++---- 5 files changed, 341 insertions(+), 36 deletions(-) create mode 100644 pages/course/healthMarket.vue diff --git a/pages.json b/pages.json index 616d0f6..185e3ab 100644 --- a/pages.json +++ b/pages.json @@ -510,6 +510,13 @@ "navigationBarTitleText": "医述详情", "enablePullDownRefresh": false } + }, + { + "path": "pages/course/healthMarket", + "style": { + "navigationBarTitleText": "健康超市", + "enablePullDownRefresh": false + } } ], "globalStyle": { 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 @@ + + + + \ No newline at end of file diff --git a/pages/course/myCourseLearn.vue b/pages/course/myCourseLearn.vue index 4b70ad6..212160b 100644 --- a/pages/course/myCourseLearn.vue +++ b/pages/course/myCourseLearn.vue @@ -42,16 +42,17 @@ 当前目录还未开始学习 - 课程观看有效期截止到:2025-06-14 00:00 + 课程观看有效期截止到:{{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/peanut/home.vue b/pages/peanut/home.vue index 31f3236..170b210 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -54,26 +54,9 @@ {{item.title}} - - - - - - - - - - - {{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; + } } From 7018a5c242d8d02e7095449ce3e5d563f702c6f3 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Tue, 25 Jun 2024 13:18:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B6=85V=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/buyPup.vue | 4 +- pages.json | 7 +++ pages/course/coursePrice.vue | 110 ++++++++++++++++++++++++++++++++--- pages/course/myCourse.vue | 8 ++- pages/course/vipCourse.vue | 13 ++--- pages/goods/order/index.vue | 4 +- pages/peanut/home.vue | 24 ++++---- pages/peanut/shopping.vue | 3 +- static/my_06.png | Bin 0 -> 7064 bytes static/nobg1.jpg | Bin 0 -> 1643 bytes 10 files changed, 139 insertions(+), 34 deletions(-) create mode 100644 static/my_06.png create mode 100644 static/nobg1.jpg 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 185e3ab..8036664 100644 --- a/pages.json +++ b/pages.json @@ -517,6 +517,13 @@ "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..7fc80b9 100644 --- a/pages/course/coursePrice.vue +++ b/pages/course/coursePrice.vue @@ -7,11 +7,7 @@ { + // 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/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/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 170b210..f1e42a7 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -22,10 +22,10 @@ 我的课程 - + @@ -44,7 +44,7 @@ 课程观看有效期截止到:{{librayList[curIndex].endTime}} - +