fix 任务工单

This commit is contained in:
sdaduanbilei 2025-12-09 17:01:06 +08:00
parent dcfdb4707d
commit d00c299b1f
5 changed files with 58 additions and 59 deletions

View File

@ -12,7 +12,7 @@ Page({
id: '',
info: null,
content: '',
autoSize: {maxHeight: 300, minHeight: 60}
},
/**
@ -49,10 +49,10 @@ Page({
parentId: this.data.id,
rootId: this.data.id
}
console.log(data);
api('/comment/add', 'POST', data, 'json').then(res => {
if (res.code === 200) {
this.fetchInfo()
this.setData({content:''})
}
})
},

View File

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {
"t-textarea": "tdesign-miniprogram/textarea/textarea"
}
}

View File

@ -1,70 +1,67 @@
<!--pages/community/info.wxml-->
<view>
<view style="padding-bottom: 200rpx;">
<view style="padding-bottom: 250rpx;">
<view wx:if="{{info}}" class="padding row mb-32" data-id="{{item.id}}" bind:tap="goInfo">
<view class="flex flex-center flex-justify-start">
<image src="{{info.user.avatar.url}}" class="avatar"></image>
<view class="ml-16">
<view class="bold">{{info.user.name}}</view>
<view class="font-12 grey">{{info.createdAt}}</view>
<view class="flex flex-center flex-justify-start">
<image src="{{info.user.avatar.url}}" class="avatar"></image>
<view class="ml-16">
<view class="bold">{{info.user.name}}</view>
<view class="font-12 grey">{{info.createdAt}}</view>
</view>
</view>
<view class="mt-16">
<view>{{info.content}}</view>
</view>
<view class="mt-16">
<view wx:if="{{info.imgList.length == 1}}" data-url="{{info.imgList[0].url}}" bind:tap="goPreview">
<image src="{{info.imgList[0].url}}" style="border-radius: 16rpx; height: 50vw; width: 100%;" mode="aspectFill"></image>
</view>
<view wx:else class="grid">
<view class="item" wx:for="{{info.imgList}}" data-url="{{item.url}}" bind:tap="goPreview">
<view>
<image src="{{item.url}}" style="width: 100%;height: 30vw; border-radius: 16rpx;" mode="aspectFill" b></image>
</view>
</view>
</view>
</view>
<view class="mt-32 flex flex-center flex-justify-end">
<view class="flex flex-center" data-item="{{info}}" bind:tap="like">
<t-icon name="{{info.hasLiked === 1 ?'thumb-up-filled':'thumb-up'}}" style="color: {{info.hasLiked === 1 ?'red':''}};"></t-icon>
<view class="ml-16">{{info.likeCount}}</view>
</view>
<view class="flex flex-center ml-32">
<t-icon name="chat-bubble-smile"></t-icon>
<view class="ml-16">{{info.commentCount}}</view>
</view>
</view>
</view>
<view class="mt-16">
<view>{{info.content}}</view>
</view>
<view class="mt-16">
<view wx:if="{{info.imgList.length == 1}}" data-url="{{info.imgList[0].url}}" bind:tap="goPreview">
<image src="{{info.imgList[0].url}}" style="border-radius: 16rpx; height: 50vw; width: 100%;" mode="aspectFill"></image>
</view>
<view wx:else class="grid">
<view class="item" wx:for="{{info.imgList}}" data-url="{{item.url}}" bind:tap="goPreview">
<view>
<image src="{{item.url}}" style="width: 100%;height: 30vw; border-radius: 16rpx;" mode="aspectFill" b></image>
<view class="white-bg padding" style="border-bottom: #F6F6F6 1rpx solid;" wx:for="{{info.commentList}}">
<view class="flex flex-center flex-justify-start flex-aligin-start">
<t-avatar class="avatar-example" shape="round" wx:if="{{item.user.avatar}}" image="{{item.user.avatar.url}}" size="60rpx" />
<t-avatar class="avatar-example" shape="round" wx:else image="https://res.catter.cn/pub/2025/12/02/202512021046843.jpg" size="60rpx" />
<view class="full-width">
<view class="font-12 ml-16 flex flex-center flex-justify-between">
<view class="primary">
{{item.user.name}}
</view>
<view class="font-12 grey">
{{item.createdAt}}
</view>
</view>
<view class="mt-16 ml-16 font-12">
<view>{{item.content}}</view>
</view>
</view>
</view>
</view>
<view class="mt-32 flex flex-center flex-justify-end">
<view class="flex flex-center" data-item="{{info}}" bind:tap="like">
<t-icon name="{{info.hasLiked === 1 ?'thumb-up-filled':'thumb-up'}}" style="color: {{info.hasLiked === 1 ?'red':''}};"></t-icon>
<view class="ml-16">{{info.likeCount}}</view>
</view>
<view class="flex flex-center ml-32">
<t-icon name="chat-bubble-smile"></t-icon>
<view class="ml-16">{{info.commentCount}}</view>
</view>
</view>
</view>
<view class="white-bg padding" style="border-bottom: #F6F6F6 1rpx solid;" wx:for="{{info.commentList}}">
<view class="flex flex-center flex-justify-start flex-aligin-start">
<t-avatar class="avatar-example" shape="round" wx:if="{{item.user.avatar}}" image="{{item.user.avatar.url}}" size="60rpx" />
<t-avatar class="avatar-example" shape="round" wx:else image="https://res.catter.cn/pub/2025/12/02/202512021046843.jpg" size="60rpx" />
<view class="full-width">
<view class="font-12 ml-16 flex flex-center flex-justify-between">
<view class="primary">
{{item.user.name}}
</view>
<view class="font-12 grey">
{{item.createdAt}}
</view>
</view>
<view class="mt-16 ml-16 font-12">
<view>{{item.content}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="flex flex-center flex-justify-between">
<t-input borderless placeholder="发表评论:" bind:change="input"></t-input>
<view class="bottom white-bg" style="background-color: white;">
<view class="flex flex-center flex-justify-between" style="margin-bottom: 32rpx; padding-bottom: 50rpx;">
<t-textarea placeholder="发表评论..." value="{{content}}" placeholder-style="padding-top:10rpx;" autosize="{{ { minRows: 1, maxRows: 4 } }}" disableDefaultPadding="{{true}}" cursor-spacing="{{10}}" fixed="{{true}}" bind:change="input" style="background-color: #F6F6F6; border-radius: 8rpx; flex: 1; padding: 16rpx 24rpx; line-height: 60rpx;"></t-textarea>
<t-icon name="send" size="30" class="ml-32" bind:tap="add"></t-icon>
</view>
</view>
</view>
</view>

View File

@ -18,7 +18,7 @@
<view class="white-bg" style="border-radius: 16rpx;">
<view style="position: relative;">
<image src="{{item.pic}}" style="width: 100%; border-top-left-radius: 16rpx; border-top-right-radius: 16rpx;" mode="aspectFill"></image>
<view style="position: absolute ; bottom: 0; right: 0;" class="{{index === 0 ? 'price-tag-badge':'price-tag-badge2'}}" >
<view style="position: absolute ; bottom: 0; right: 0; margin-bottom: 8rpx;" class="{{index === 0 ? 'price-tag-badge':'price-tag-badge2'}}" >
<view wx:if="{{index === 0}}">已拥有</view>
<view wx:else >可兑换</view>
</view>

View File

@ -87,7 +87,7 @@
<view class="row" style="padding-top: 8rpx; padding-bottom: 8rpx;margin-bottom: 32rpx;">
<t-cell title="植物百科" hover arrow url="../knowlage/index"/>
<t-cell title="植物领养中心" hover arrow bind:tap="goStore" />
<t-cell title="提醒设置" hover arrow />
<t-cell title="关注公众号" hover arrow />
<t-cell title="加入微信群" hover arrow bind:tap="goAbout" />
<t-cell title="用户协议" hover arrow bind:tap="goPrivate" />
<button class="avatar-wrapper " style="width: 100%;" open-type="share">