From 648117b7a6aa9e08c1981b79b651c745e07c584e Mon Sep 17 00:00:00 2001
From: "@fawn-nine" <1271023382@qq.com>
Date: Wed, 20 Sep 2023 18:13:04 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=A5=E5=8D=A1=20?=
=?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/bookShop/commodityDetail.vue | 20 +++++++--
pages/clock/clock.vue | 67 ++++++++++++++++++++++++------
pages/comments/commentsDetail.vue | 50 ++++++++++++++--------
3 files changed, 104 insertions(+), 33 deletions(-)
diff --git a/pages/bookShop/commodityDetail.vue b/pages/bookShop/commodityDetail.vue
index d1919ac..371a44c 100644
--- a/pages/bookShop/commodityDetail.vue
+++ b/pages/bookShop/commodityDetail.vue
@@ -259,7 +259,7 @@
},
methods: {
gotoDetail(item){
- console.log(item,'gotoDetail')
+ // console.log(item,'gotoDetail')
uni.navigateTo({
url: '../bookShop/commodityDetail?id=' + item.productId
});
@@ -278,7 +278,9 @@
// 获取商品关联商品
getLinkPros(id){
this.$http
- .post('book/shopproduct/bookinfolists/'+id)
+ .post('book/shopproduct/getGlProductList',{
+ 'productId': id
+ })
.then(res => {
console.log('关联商品', res)
if(res.code == 0){
@@ -391,6 +393,18 @@
}
}
uni.hideLoading();
+ }).catch(e => {
+ console.log(e,'e')
+ uni.hideLoading();
+ if(e.msg == '该商品不存在,看看其他商品吧'){
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 1
+ });
+ },2000)
+ }
+
+
})
},
@@ -440,7 +454,7 @@
},
// 点击按钮组间
buttonClick(e) {
- console.log(e)
+ // console.log(e)
if(e.index == 0){
// 点击的是加入购物车
this.upoShow = true
diff --git a/pages/clock/clock.vue b/pages/clock/clock.vue
index 51dd9bf..bb3f2f7 100644
--- a/pages/clock/clock.vue
+++ b/pages/clock/clock.vue
@@ -11,13 +11,16 @@
返回今天
-
-
+
+
+ 补卡
+
+
签到
-
-
+
+
第{{item1}} 天
- 未签
+ 未签
未开始
签到
@@ -357,8 +360,7 @@
title:'未来日期不可签到',
icon: 'none'
})
- }else{
- this.linshiDay = index
+ }else{
this.getTask(index)
}
},
@@ -409,6 +411,7 @@
'days': index
}
console.log(data)
+ this.linshiDay = index
this.$http
.post('book/task/applist', data)
.then(res => {
@@ -430,10 +433,47 @@
uni.hideLoading()
})
},
-
+ // 补卡
+ buSign(day){
+ console.log('正在补卡',this.taskInfo)
+ if(!this.taskInfo.id){
+ uni.showToast({
+ title:'当天未发布打卡任务',
+ icon:'none'
+ })
+ return
+ }
+ let data = {
+ "bookId": this.bookid,
+ "userId": this.userInfo.id,
+ "tid": this.taskInfo.id,
+ "days":this.linshiDay
+ }
+ console.log(data,'data')
+ $http.request({
+ url : 'book/clockinPunch/save',
+ method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
+ data,
+ header: { //默认 无 说明:请求头
+ 'Content-Type': 'application/json'
+ },
+ }).then(res => {
+ if (res.code == 0) {
+ //console.log(res, '快捷签到')
+ uni.showToast({
+ title:'签到成功'
+ })
+ this.addTextShow = false
+ this.formData.content = ''
+ this.formData.images = []
+ this.getmySign()
+ this.getAllSign(this.taskInfo)
+ }
+
+ });
+ },
// 快捷签到
- kuickSign(){
- console.log()
+ kuickSign(){
let data = {
"bookId": this.bookid,
"userId": this.userInfo.id,
@@ -706,11 +746,12 @@
.buka {
font-size: 24rpx;
- display: inline-block; padding: 0 6rpx;
+ display: inline-block; padding: 0 12rpx;
color: #888;
// border: 1px solid #888;
+
margin: 10px 0;
- border-radius: 15rpx;
+ border-radius: 20rpx;
margin-bottom: 0; ;
}
diff --git a/pages/comments/commentsDetail.vue b/pages/comments/commentsDetail.vue
index e6d99e5..b04867f 100644
--- a/pages/comments/commentsDetail.vue
+++ b/pages/comments/commentsDetail.vue
@@ -52,9 +52,13 @@
暂无评论内容~
-
-
+
+
+
+ 努力加载中
+
+
@@ -102,6 +106,7 @@
bookid:null,
bfa_id:null, //书评id
productInfo:{},
+ status:3,
pingjiaShow:false, //添加评价
Pform:{ // 评价表单
//star:0,
@@ -112,6 +117,8 @@
emoji:[],
Files:[],
commentInfo:{},
+ pPage:1,
+ pTotal:0, // 评论的总条数
pinglunId:null,
plList:[], // 书评的评论list
}
@@ -120,11 +127,23 @@
this.windowWidth = uni.getSystemInfoSync().windowWidth;
console.log(e,'onload')
this.bookid = e.bookid
- this.bfa_id = e.bfa_id
- this.getProDetail(e)
+ this.bfa_id = e.bfa_id
+ },
+ onShow() {
+ this.getProDetail()
this.getbookComInfo()
this.getCommPL()
},
+ onReachBottom() {
+ console.log('到底了')
+ if(this.pPage+1 <= this.pTotal){
+ this.status = 0
+ this.pPage++
+ this.getCommPL()
+ }else{
+ this.status = 3
+ }
+ },
computed:{
...mapState(['userInfo']),
},
@@ -134,27 +153,24 @@
let data = {
'bfa_id':this.bfa_id,
'limit': 5,
- 'page': 1,
+ 'page': this.pPage,
}
- console.log(data,'data')
+ console.log(data,'data')
this.$http
.post('forum/comment/list', data)
.then(res => {
if(res.code == 0){
- console.log(res,'书评评论')
- this.plList = res.page.list
-
+ console.log(res,'书评评论')
+ this.plList = this.plList.concat(res.page.list)
+ this.pTotal = res.page.totalPage
+ this.status = 3
// 评论格式化
var newarr = []
this.plList.forEach((item1)=>{
- var pjstr = ''
- //var zpstr = ''
- pjstr = this.getHtmlComment(item1.content)
- //item1.followUpcontent == '' ? zpstr = '' : zpstr = this.getHtmlComment(item1.followUpcontent)
- //console.log(pjstr,'99999999999----------')
+ var pjstr = ''
+ pjstr = this.getHtmlComment(item1.content)
item1.phtml = pjstr
- console.log(pjstr)
- // item1.zphtml = zpstr
+ // console.log(pjstr)
newarr.push(item1)
})
@@ -178,7 +194,7 @@
console.log(e)
})
},
- getProDetail(e){
+ getProDetail(){
// 获取商品详情
uni.showLoading({
title: '加载中'