Merge branch 'master-xie'

This commit is contained in:
@fawn-nine
2023-09-20 18:14:43 +08:00
3 changed files with 104 additions and 33 deletions

View File

@@ -259,7 +259,7 @@
}, },
methods: { methods: {
gotoDetail(item){ gotoDetail(item){
console.log(item,'gotoDetail') // console.log(item,'gotoDetail')
uni.navigateTo({ uni.navigateTo({
url: '../bookShop/commodityDetail?id=' + item.productId url: '../bookShop/commodityDetail?id=' + item.productId
}); });
@@ -278,7 +278,9 @@
// 获取商品关联商品 // 获取商品关联商品
getLinkPros(id){ getLinkPros(id){
this.$http this.$http
.post('book/shopproduct/bookinfolists/'+id) .post('book/shopproduct/getGlProductList',{
'productId': id
})
.then(res => { .then(res => {
console.log('关联商品', res) console.log('关联商品', res)
if(res.code == 0){ if(res.code == 0){
@@ -391,6 +393,18 @@
} }
} }
uni.hideLoading(); 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) { buttonClick(e) {
console.log(e) // console.log(e)
if(e.index == 0){ if(e.index == 0){
// 点击的是加入购物车 // 点击的是加入购物车
this.upoShow = true this.upoShow = true

View File

@@ -12,12 +12,15 @@
<text>返回今天</text> <text>返回今天</text>
</view> </view>
<!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> --> <!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> -->
<view class="dakaBtn" @tap="kuickSign()" v-if="signList.indexOf(currentDay) == -1"> <view class="dakaBtn" @tap="buSign()" v-if="signList.indexOf(currentDay) == -1 && currentDay > linshiDay">
<text style="font-size: 24rpx;">补卡</text>
</view>
<view class="dakaBtn" @tap="kuickSign()" v-if="signList.indexOf(currentDay) == -1 && currentDay == linshiDay">
<text style="font-size: 24rpx;">签到</text> <text style="font-size: 24rpx;">签到</text>
</view> </view>
<view v-else class="dakaBtn" style="border-color: #fff;"> <!-- <view v-else class="dakaBtn" style="border-color: #fff;">
<text style=" color:#a3a3a3;">今天已签到</text> <text style=" color:#a3a3a3;">今天已签到</text>
</view> </view> -->
</view> </view>
</view> </view>
<swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" <swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
@@ -30,7 +33,7 @@
linshiDay == item1 ? 'linshiDay':'']" @click="getInfo(item1)"> linshiDay == item1 ? 'linshiDay':'']" @click="getInfo(item1)">
<span class="day"><em>{{item1}}</em> </span> <span class="day"><em>{{item1}}</em> </span>
<u-icon v-if="signList.indexOf(item1) != -1" name="checkbox-mark" color="#fff" size="28" style="margin: 0 auto; width: 28px; text-align: center;"></u-icon> <u-icon v-if="signList.indexOf(item1) != -1" name="checkbox-mark" color="#fff" size="28" style="margin: 0 auto; width: 28px; text-align: center;"></u-icon>
<span v-if="signList.indexOf(item1) == -1 && currentDay > item1" class="buka">未签</span> <span v-if="signList.indexOf(item1) == -1 && currentDay > item1" class="buka" >未签</span>
<span v-if="currentDay < item1" class="weidaka">未开始</span> <span v-if="currentDay < item1" class="weidaka">未开始</span>
<span v-if="currentDay == item1 && signList.indexOf(item1) == -1" class="daka" @click="kuickSign()">签到</span> <span v-if="currentDay == item1 && signList.indexOf(item1) == -1" class="daka" @click="kuickSign()">签到</span>
</view> </view>
@@ -358,7 +361,6 @@
icon: 'none' icon: 'none'
}) })
}else{ }else{
this.linshiDay = index
this.getTask(index) this.getTask(index)
} }
}, },
@@ -409,6 +411,7 @@
'days': index 'days': index
} }
console.log(data) console.log(data)
this.linshiDay = index
this.$http this.$http
.post('book/task/applist', data) .post('book/task/applist', data)
.then(res => { .then(res => {
@@ -430,10 +433,47 @@
uni.hideLoading() 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(){ kuickSign(){
console.log()
let data = { let data = {
"bookId": this.bookid, "bookId": this.bookid,
"userId": this.userInfo.id, "userId": this.userInfo.id,
@@ -706,11 +746,12 @@
.buka { .buka {
font-size: 24rpx; font-size: 24rpx;
display: inline-block; padding: 0 6rpx; display: inline-block; padding: 0 12rpx;
color: #888; color: #888;
// border: 1px solid #888; // border: 1px solid #888;
margin: 10px 0; margin: 10px 0;
border-radius: 15rpx; border-radius: 20rpx;
margin-bottom: 0; ; margin-bottom: 0; ;
} }

View File

@@ -53,8 +53,12 @@
<view class="quesheng" v-else> <view class="quesheng" v-else>
<text>暂无评论内容~</text> <text>暂无评论内容~</text>
</view> </view>
</view> </view>
<view v-if="status==0" style="text-align: center;">
<u-loading-icon style="display: inline-block;"></u-loading-icon>
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
</view>
<u-divider v-if="status == 1" text="已加载全部评论"></u-divider>
<!-- 评价对话框 --> <!-- 评价对话框 -->
<u-popup :show="pingjiaShow" :round="10" @close="closePingjia"> <u-popup :show="pingjiaShow" :round="10" @close="closePingjia">
<view class="tanchu"> <view class="tanchu">
@@ -102,6 +106,7 @@
bookid:null, bookid:null,
bfa_id:null, //书评id bfa_id:null, //书评id
productInfo:{}, productInfo:{},
status:3,
pingjiaShow:false, //添加评价 pingjiaShow:false, //添加评价
Pform:{ // 评价表单 Pform:{ // 评价表单
//star:0, //star:0,
@@ -112,6 +117,8 @@
emoji:[], emoji:[],
Files:[], Files:[],
commentInfo:{}, commentInfo:{},
pPage:1,
pTotal:0, // 评论的总条数
pinglunId:null, pinglunId:null,
plList:[], // 书评的评论list plList:[], // 书评的评论list
} }
@@ -121,10 +128,22 @@
console.log(e,'onload') console.log(e,'onload')
this.bookid = e.bookid this.bookid = e.bookid
this.bfa_id = e.bfa_id this.bfa_id = e.bfa_id
this.getProDetail(e) },
onShow() {
this.getProDetail()
this.getbookComInfo() this.getbookComInfo()
this.getCommPL() this.getCommPL()
}, },
onReachBottom() {
console.log('到底了')
if(this.pPage+1 <= this.pTotal){
this.status = 0
this.pPage++
this.getCommPL()
}else{
this.status = 3
}
},
computed:{ computed:{
...mapState(['userInfo']), ...mapState(['userInfo']),
}, },
@@ -134,7 +153,7 @@
let data = { let data = {
'bfa_id':this.bfa_id, 'bfa_id':this.bfa_id,
'limit': 5, 'limit': 5,
'page': 1, 'page': this.pPage,
} }
console.log(data,'data') console.log(data,'data')
this.$http this.$http
@@ -142,19 +161,16 @@
.then(res => { .then(res => {
if(res.code == 0){ if(res.code == 0){
console.log(res,'书评评论') console.log(res,'书评评论')
this.plList = res.page.list this.plList = this.plList.concat(res.page.list)
this.pTotal = res.page.totalPage
this.status = 3
// 评论格式化 // 评论格式化
var newarr = [] var newarr = []
this.plList.forEach((item1)=>{ this.plList.forEach((item1)=>{
var pjstr = '' var pjstr = ''
//var zpstr = ''
pjstr = this.getHtmlComment(item1.content) pjstr = this.getHtmlComment(item1.content)
//item1.followUpcontent == '' ? zpstr = '' : zpstr = this.getHtmlComment(item1.followUpcontent)
//console.log(pjstr,'99999999999----------')
item1.phtml = pjstr item1.phtml = pjstr
console.log(pjstr) // console.log(pjstr)
// item1.zphtml = zpstr
newarr.push(item1) newarr.push(item1)
}) })
@@ -178,7 +194,7 @@
console.log(e) console.log(e)
}) })
}, },
getProDetail(e){ getProDetail(){
// 获取商品详情 // 获取商品详情
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'