Skip to content

Commit

Permalink
Merge pull request #128 from GIS142857/master
Browse files Browse the repository at this point in the history
贡献部分代码
  • Loading branch information
zyronon authored Dec 10, 2024
2 parents 31d889d + e199ed9 commit 4d04427
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"libarchive-wasm": "^1.1.0",
"mockjs": "^1.1.0",
"pinia": "^2.1.7",
"vue": "3.4.21",
"vue": "^3.5.13",
"vue-router": "4.3.0"
},
"devDependencies": {
Expand Down
37 changes: 27 additions & 10 deletions src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ export default {
_time,
_formatNumber,
_checkImgUrl,
// 评论发送成功后调用此方法
resetSelectStatus() {
this.friends.all.forEach((item) => {
item.select = false // 重置选中状态
})
},
async handShowChildren(item) {
this.loadChildrenItemCId = item.comment_id
this.loadChildren = true
Expand All @@ -268,18 +274,29 @@ export default {
}
},
send() {
this.comments.push({
id: '2',
avatar: new URL('../assets/img/icon/avatar/4.png', import.meta.url).href,
name: '成都旅行',
text: this.comment,
loveNum: 27,
isLoved: false,
time: '2021-08-24 20:33',
children: []
})
if (!this.comment.trim()) {
return // 如果评论内容为空,直接返回
}
const baseStore = useBaseStore()
const commentData = {
ip_location: baseStore.userinfo.ip_location,
aweme_id: this.videoId,
content: this.comment,
create_time: Date.now(),
uid: String(baseStore.userinfo.uid),
short_id: String(baseStore.userinfo.short_id),
unique_id: baseStore.userinfo.unique_id,
signature: baseStore.userinfo.signature,
nickname: baseStore.userinfo.nickname,
avatar: baseStore.userinfo.avatar_168x168['url_list'][0]
// 其他必要的字段可以根据你的需求添加
}
// this.$props.item.statistics.comment_count++
// _updateItem(this.$props, 'isLoved', !props.item.isLoved)
this.comments.unshift(commentData)
this.comment = ''
this.isCall = false
this.resetSelectStatus()
},
async getData() {
let res: any = await videoComments({ id: this.videoId })
Expand Down
9 changes: 7 additions & 2 deletions src/components/Share.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
<div class="share2friend" v-if="store.selectFriends.length">
<div class="line"></div>
<div class="comment">
<textarea placeholder="有什么想和好友说的..."></textarea>
<textarea v-model="store.message" placeholder="有什么想和好友说的..."></textarea>
<img class="poster" src="../assets/img/poster/1.jpg" alt="" />
</div>
<div class="btns">
<dy-button type="dark2" radius="7" v-if="store.selectFriends.length > 1" @click="_no"
>建群并发送
</dy-button>
<dy-button type="primary" radius="7" @click="_no"
<dy-button type="primary" radius="7" @click="shared"
>{{ store.selectFriends.length > 1 ? '分别发送' : '发送' }}
</dy-button>
</div>
Expand Down Expand Up @@ -226,6 +226,11 @@ function closeShare() {
})
emit('update:modelValue', false)
}
function shared() {
_notice('分享成功!')
store.message = ''
closeShare()
}
</script>

<style lang="less" scoped>
Expand Down
28 changes: 25 additions & 3 deletions src/components/slide/ItemToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,29 @@ function _updateItem(props, key, val) {
}
function loved() {
_updateItem(props, 'isLoved', !props.item.isLoved)
setTimeout(() => {
_updateItem(props, 'isLoved', !props.item.isLoved)
}, 100)
if (!props.item.isLoved) {
// eslint-disable-next-line vue/no-mutating-props
props.item.statistics.digg_count++
} else {
// eslint-disable-next-line vue/no-mutating-props
props.item.statistics.digg_count--
}
}
function collected() {
setTimeout(() => {
_updateItem(props, 'isCollect', !props.item.isCollect)
}, 100)
if (!props.item.isCollect) {
// eslint-disable-next-line vue/no-mutating-props
props.item.statistics.collect_count++
} else {
// eslint-disable-next-line vue/no-mutating-props
props.item.statistics.collect_count--
}
}
function attention(e) {
Expand Down Expand Up @@ -78,15 +100,15 @@ const vClick = useClick()
<span>{{ _formatNumber(item.statistics.comment_count) }}</span>
</div>
<!--TODO -->
<div class="message mb2r" v-click="() => _updateItem(props, 'isCollect', !item.isCollect)">
<div class="message mb2r" v-click="collected">
<Icon
v-if="item.isCollect"
icon="ic:round-star"
class="icon"
style="color: rgb(252, 179, 3)"
/>
<Icon v-else icon="ic:round-star" class="icon" style="color: white" />
<span>{{ _formatNumber(item.statistics.comment_count) }}</span>
<span>{{ _formatNumber(item.statistics.collect_count) }}</span>
</div>
<div v-if="!props.isMy" class="share mb2r" v-click="() => bus.emit(EVENT_KEY.SHOW_SHARE)">
<img src="../../assets/img/icon/share-white-full.png" alt="" class="share-image" />
Expand Down
79 changes: 65 additions & 14 deletions src/pages/login/OtherLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,29 +144,80 @@ export default {
font-size: 14rem;
background: white;
.block-dialog {
color: black;
.content {
padding: 60rem 30rem;
.item {
height: 50rem;
.desc {
margin-bottom: 60rem;
margin-top: 120rem;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid gainsboro;
flex-direction: column;
img {
height: 25rem;
margin-right: 10rem;
.title {
margin-bottom: 20rem;
font-size: 20rem;
}
&:nth-last-child(1) {
border-top: none;
.phone-number {
letter-spacing: 3rem;
font-size: 30rem;
margin-bottom: 10rem;
}
.sub-title {
font-size: 12rem;
color: var(--second-text-color);
}
}
.button {
width: 100%;
margin-bottom: 5rem;
}
.protocol {
position: relative;
color: gray;
margin-top: 20rem;
font-size: 12rem;
display: flex;
.left {
padding-top: 1rem;
margin-right: 5rem;
}
}
.space {
height: 10rem;
background: whitesmoke;
.options {
position: relative;
font-size: 14rem;
display: flex;
}
.block-dialog {
color: black;
.item {
height: 50rem;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid gainsboro;
img {
height: 25rem;
margin-right: 10rem;
}
&:nth-last-child(1) {
border-top: none;
}
}
.space {
height: 10rem;
background: whitesmoke;
}
}
}
}
Expand Down
51 changes: 51 additions & 0 deletions src/pages/login/PasswordLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,56 @@ export default {
color: black;
font-size: 14rem;
background: white;
.content {
padding: 60rem 30rem;
.desc {
margin-bottom: 60rem;
margin-top: 120rem;
display: flex;
align-items: center;
flex-direction: column;
.title {
margin-bottom: 20rem;
font-size: 20rem;
}
.phone-number {
letter-spacing: 3rem;
font-size: 30rem;
margin-bottom: 10rem;
}
.sub-title {
font-size: 12rem;
color: var(--second-text-color);
}
}
.button {
width: 100%;
margin-bottom: 5rem;
}
.protocol {
position: relative;
color: gray;
margin-top: 20rem;
font-size: 12rem;
display: flex;
.left {
padding-top: 1rem;
margin-right: 5rem;
}
}
.options {
position: relative;
font-size: 14rem;
display: flex;
}
}
}
</style>
50 changes: 50 additions & 0 deletions src/pages/login/RetrievePassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,55 @@ export default {
color: black;
font-size: 14rem;
background: white;
.content {
padding: 60rem 30rem;
.desc {
margin-bottom: 60rem;
margin-top: 120rem;
display: flex;
align-items: center;
flex-direction: column;
.title {
margin-bottom: 20rem;
font-size: 20rem;
}
.phone-number {
letter-spacing: 3rem;
font-size: 30rem;
margin-bottom: 10rem;
}
.sub-title {
font-size: 12rem;
color: var(--second-text-color);
}
}
.button {
width: 100%;
margin-bottom: 5rem;
}
.protocol {
position: relative;
color: gray;
margin-top: 20rem;
font-size: 12rem;
display: flex;
.left {
padding-top: 1rem;
margin-right: 5rem;
}
}
.options {
position: relative;
font-size: 14rem;
display: flex;
}
}
}
</style>
Loading

0 comments on commit 4d04427

Please sign in to comment.