Commit c2e690d4 authored by 彭佳妮(贵阳日报)'s avatar 彭佳妮(贵阳日报)
parents bcb62b03 39d21d4a
...@@ -1018,10 +1018,10 @@ uni-page-body { ...@@ -1018,10 +1018,10 @@ uni-page-body {
} }
} }
.footer { .footer {
height: 196rpx; height: 90rpx;
border-radius: 16rpx 16rpx 0rpx 0rpx; border-radius: 16rpx 16rpx 0rpx 0rpx;
background: #ffffff; background: #ffffff;
padding: 20rpx 20rpx 0 42rpx; padding: 16rpx;
align-items: flex-start; align-items: flex-start;
.like { .like {
display: flex; display: flex;
......
...@@ -11,8 +11,11 @@ ...@@ -11,8 +11,11 @@
<img :src="item.avatar" alt="" /> <img :src="item.avatar" alt="" />
<p>{{ item.nickName }}</p> <p>{{ item.nickName }}</p>
</div> </div>
<div class="like"> <div class="like flex-align-center" @click="like(item)">
<wd-icon name="thumb-up"></wd-icon> <img
:src="`/static/assistingAgriculture/assets/${item.give == 0 ? 'like' : 'likeFilled'}.png`"
alt=""
/>
{{ item.giveCount }} {{ item.giveCount }}
</div> </div>
</div> </div>
...@@ -20,6 +23,7 @@ ...@@ -20,6 +23,7 @@
</template> </template>
<script setup> <script setup>
import { likeOrDislike } from '../../../api/photo';
const showMore = ref(false); const showMore = ref(false);
const props = defineProps({ const props = defineProps({
photoData: { photoData: {
...@@ -33,6 +37,24 @@ const toReviewDetails = (id) => { ...@@ -33,6 +37,24 @@ const toReviewDetails = (id) => {
url: `/pages/assistingAgriculture/reviewDetails/reviewDetails?evaluationId=${id}`, url: `/pages/assistingAgriculture/reviewDetails/reviewDetails?evaluationId=${id}`,
}); });
}; };
/* 点赞 */
let flag = false;
const like = (item) => {
if (flag) {
return;
} else {
flag = true;
}
likeOrDislike({ evaluationId: item.evaluationId }).then((res) => {
flag = false;
if (res.code === 0) {
// 成功
item.give = item.give === 0 ? 1 : 0;
item.giveCount = item.give === 0 ? item.giveCount - 1 : item.giveCount + 1;
}
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -86,8 +108,9 @@ const toReviewDetails = (id) => { ...@@ -86,8 +108,9 @@ const toReviewDetails = (id) => {
.like { .like {
font-size: 12px; font-size: 12px;
color: #767676; color: #767676;
.wd-icon { img {
font-size: 15px; width: 16px;
height: 16px;
} }
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
</scroll-view> </scroll-view>
<div class="back"> <div class="back">
<button>返回预订</button> <button @click="back">返回预订</button>
</div> </div>
</div> </div>
</template> </template>
...@@ -91,6 +91,9 @@ const getPhotoFn = () => { ...@@ -91,6 +91,9 @@ const getPhotoFn = () => {
photoData.value = [...photoData.value, ...res.data]; photoData.value = [...photoData.value, ...res.data];
}); });
}; };
const back = () => {
uni.navigateBack();
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -103,21 +106,21 @@ uni-page-body { ...@@ -103,21 +106,21 @@ uni-page-body {
flex-direction: column; flex-direction: column;
background-color: #f3f3f3; background-color: #f3f3f3;
.content { .content {
padding: 10px 5px; padding: 20rpx 10rpx;
box-sizing: border-box; box-sizing: border-box;
flex-grow: 1; flex-grow: 1;
height: 69px; height: 138rpx;
.filter-box { .filter-box {
display: flex; display: flex;
background-color: #fff; background-color: #fff;
padding: 10px; padding: 20rpx;
gap: 10px; gap: 20rpx;
flex-wrap: wrap; flex-wrap: wrap;
div { div {
padding: 8px; padding: 16rpx;
color: #3d3d3d; color: #3d3d3d;
font-size: 8px; font-size: 16rpx;
border-radius: 8px; border-radius: 16rpx;
background-color: #eeeeee; background-color: #eeeeee;
} }
.active { .active {
...@@ -126,23 +129,23 @@ uni-page-body { ...@@ -126,23 +129,23 @@ uni-page-body {
} }
} }
.card-wrap { .card-wrap {
// margin-top: 5px; // margin-top: 10rpx;
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
gap: 5px; gap: 10rpx;
} }
} }
} }
.back { .back {
background-color: #fff; background-color: #fff;
padding: 20px 0 34px; padding: 40rpx 0;
box-shadow: 0px -4px 8px 0px rgba(0, 0, 0, 0.12); box-shadow: 0rpx -8rpx 16rpx 0rpx rgba(0, 0, 0, 0.12);
button { button {
width: 345px; width: 690rpx;
height: 44px; height: 88rpx;
border-radius: 34px; border-radius: 68rpx;
background-color: #fa5151; background-color: #fa5151;
font-size: 16px; font-size: 32rpx;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment