修复已知问题

This commit is contained in:
bobobobo
2026-01-29 00:27:31 +08:00
parent 990f2df972
commit 41c1e5ba89
36 changed files with 1353 additions and 169 deletions

View File

@@ -93,6 +93,7 @@
}
onLoad(e => {
formData.defaultAddress = e?.defaultAddress == 1
if (props.type === 'edit') {
getData(e.id)
}

View File

@@ -21,7 +21,9 @@
}
const onAdd = () => {
navigateTo('/pages/address/add')
navigateTo('/pages/address/add', {
defaultAddress: listData.value.length === 0 ? '1' : ''
})
}
const onGo = id => {

View File

@@ -33,6 +33,8 @@
const isBlack = ref(false)
/** 点击备注弹框 */
const showRemark = ref(false)
/** 好友详情进入状态C2C 个人 GROUP 群组 */
const isDetailState = ref('')
/** 点击查看头像 */
const onViewAvatar = url => {
uni.previewImage({
@@ -87,8 +89,11 @@
})
}
/** 获取好友信息 */
const getFriendInfo = async () => {
/**
* 获取好友信息
* @param state 99 为自己
*/
const getFriendInfo = async state => {
loading.value = true
showLoading()
if (isDetail.value) {
@@ -97,10 +102,10 @@
})
.then(res => {
const data = res.data.friendList[0]
friendInfo.value = data.profile
friendInfo.value = { ...data.profile, cbType: 'C2C' }
confirmRemark.value = data.remark
remark.value = data.remark
console.log('好友信息==', data)
console.log('好友信息==', friendInfo.value)
})
.finally(() => {
loading.value = false
@@ -111,7 +116,10 @@
userIDList: [userId.value]
})
.then(res => {
friendInfo.value = res.data[0]
friendInfo.value = {
...res.data[0],
cbType: state == 99 ? 'me' : 'C2C'
}
console.log('获取好友信息成功', friendInfo.value)
})
.finally(() => {
@@ -291,31 +299,38 @@
/** 发送消息 */
const onSendMessage = () => {
if (isDetailState.value == 'C2C') {
navigateBack()
return
}
const data =
friendInfo.value?.cbType === 'group'
? `GROUP${friendInfo.value?.groupID}`
: `C2C${friendInfo.value.userID}`
TUIConversationService.switchConversation(data).then(() => {
TUIGlobal?.navigateTo({
url: `/TUIKit/components/TUIChat/index`
url: `/TUIKit/components/TUIChat/index?type=${
isDetailState.value == 'GROUP' ? 'GROUP' : ''
}`
})
})
}
onLoad(e => {
isDetailState.value = e?.state || ''
userId.value = e?.id || ''
/** type: 不传为添加 1 为详情页 9 为群信息 */
/** type: 不传为添加 1 为详情页 9 为群信息 99 为自己 */
if (e?.type == 9) {
uni.setNavigationBarTitle({
title: '群聊信息'
})
getGroupInfo()
} else {
isDetail.value = e?.type == 1 || false
isDetail.value = ['1'].includes(e?.type) || false
uni.setNavigationBarTitle({
title: isDetail.value ? '好友信息' : '发送好友申请'
})
getFriendInfo()
getFriendInfo(e?.type)
}
})
</script>
@@ -334,18 +349,23 @@
<uni-icons v-else type="contact-filled" size="80"></uni-icons>
<view class="right-box">
<text>{{ friendInfo.nick || '未知名称' }}</text>
<text v-if="!friendInfo?.cbType == 'group'">
<text v-if="friendInfo?.cbType !== 'group'">
手机号: {{ friendInfo.userID }}
</text>
<text v-if="!friendInfo?.cbType == 'group'">
<text v-if="friendInfo?.cbType !== 'group'">
个性签名: {{ friendInfo.selfSignature || '暂无个性签名' }}
</text>
<text v-else>ID: {{ friendInfo.groupID }}</text>
<text v-else>
ID: {{ friendInfo.groupID || friendInfo.userID }}
</text>
</view>
</view>
<!-- 验证信息输入 -->
<view v-if="!isDetail" class="input-wrapper">
<view
v-if="!isDetail && friendInfo.cbType !== 'me'"
class="input-wrapper"
>
<text class="title">请填写验证信息</text>
<textarea
v-model="verificationInfo"
@@ -357,7 +377,7 @@
<!-- 备注 -->
<view
v-if="!friendInfo?.cbType == 'group' && !isDetail"
v-if="!['group', 'me'].includes(friendInfo?.cbType) && !isDetail"
class="remark"
>
<text>备注名</text>
@@ -370,13 +390,33 @@
</view>
<!-- 发送申请按钮 -->
<view v-if="!isDetail" class="send-btn" @tap="submit">
<view
v-if="!isDetail && friendInfo.cbType !== 'me'"
class="send-btn"
@tap="submit"
>
<text>发送申请</text>
</view>
<!-- 去朋友圈 -->
<view
v-if="friendInfo?.cbType == 'me'"
class="remark"
@click="
navigateTo('/pages/discover/dynamic/dynamic', {
id: friendInfo.userID
})
"
>
<text>朋友圈</text>
<view style="display: flex; align-items: center">
<uni-icons type="right" color="#999999" size="36rpx"></uni-icons>
</view>
</view>
<!-- 修改好友信息======================== -->
<view
v-if="!friendInfo?.cbType == 'group' && isDetail"
v-if="friendInfo?.cbType !== 'group' && isDetail"
class="remark"
@click="showRemark = true"
>
@@ -391,15 +431,14 @@
</view>
</view>
<view
v-if="!friendInfo?.cbType == 'group' && isDetail"
v-if="friendInfo?.cbType !== 'group' && isDetail"
class="remark"
>
<text>加入黑名单</text>
<SwitchBar :value="isBlack" @click="switchChange" />
</view>
<view
v-if="!friendInfo?.cbType == 'group' && isDetail"
v-if="friendInfo?.cbType !== 'group' && isDetail"
class="send-btn"
@tap="onDeleteFriend"
>

View File

@@ -7,7 +7,9 @@
TUIFriendService,
TUIGroupService
} from '@tencentcloud/chat-uikit-engine-lite'
import { useAuthUser } from '../../composables/useAuthUser'
const { tencentUserSig } = useAuthUser()
const { showLoading, hideLoading } = useUI()
const loading = ref(false)
const searchValue = ref('')
@@ -97,7 +99,10 @@
}
const onAdd = item => {
navigateTo('/pages/adduser/details', { id: item.userID })
navigateTo('/pages/adduser/details', {
id: item.userID,
type: item.userID == tencentUserSig.value.userId ? '99' : ''
})
}
const onDetails = (item, state) => {
@@ -155,8 +160,10 @@
<text>{{ item.nick || '未知名称' }}</text>
<text>{{ item.userID }}</text>
</view>
<text v-if="isFriend" class="tag">已添加</text>
<button v-else @click.stop="onAdd(item)">添加</button>
<view v-if="item.userID !== tencentUserSig.userId">
<text v-if="isFriend" class="tag">添加</text>
<button v-else @click.stop="onAdd(item)">添加</button>
</view>
</view>
</view>
<!-- 群列表 -->
@@ -180,7 +187,8 @@
<text>{{ item.name || '未知名称' }}</text>
<text>{{ item.groupID }}</text>
</view>
<text class="tag-but">群聊</text>
<!-- <text class="tag-but">群聊</text> -->
<button style="background: #828bff">群聊</button>
<!-- <text v-if="isFriend" class="tag">已添加</text>
<button v-else @click.stop="onAdd(item)">添加</button> -->
</view>

View File

@@ -40,6 +40,7 @@
const contentData = ref('')
const inputId = ref('')
const isType = ref('')
const targetUserId = ref('')
const onScroll = e => {
cbNavBar.value?.updateScroll(e.detail.scrollTop)
@@ -57,7 +58,7 @@
const res = await getUserMomentsList({
pageNum,
pageSize,
targetUserId: isType.value == 1 ? userInfo.value.userId : ''
targetUserId: isType.value == 1 ? userInfo.value.userId : targetUserId.value
})
const list = res.rows.map(item => {
return {
@@ -123,6 +124,7 @@
})
onLoad(async e => {
targetUserId.value = e?.id || ''
isType.value = e?.type || ''
})
</script>

View File

@@ -84,12 +84,13 @@
const getData = async productId => {
const res = await getProductDetail(productId)
viewData.value = res.data
const {
id,
price,
stockQuantity,
originalPrice: nub
} = res.data.skuList.find(v => v.isDefault == 1)
} = res.data.skuList[0]
originalPrice.value = nub
formData.maxNum = stockQuantity
formData.spec = id
@@ -142,7 +143,7 @@
const res = await addOrder(data)
await refreshUserInfo()
await showToast('订单提交成功', 'success')
navigateBack()
navigateTo('/pages/shop-together/detail', { id: res.data.groupId })
}
onShow(() => {

View File

@@ -1,8 +1,13 @@
<script setup>
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getProductDetail, getProductCommentList } from '@/api/mall'
import {
getProductDetail,
getProductCommentList,
getParticipateList
} from '@/api/mall'
import { ref, computed } from 'vue'
import { navigateTo } from '@/utils/router'
import { navigateTo, navigateBack } from '@/utils/router'
import { getRemainingTime, parseDateTime } from '../../utils/dateUtils'
const viewData = ref({})
const productId = ref('')
@@ -12,9 +17,31 @@
const commentNum = ref(0)
/** 分享弹窗 */
const shareDialog = ref(false)
/** 是否显示拼团数据 */
const isPingTuan = ref(false)
/** 拼团列表 */
const pingtuanList = ref([])
const getData = async productId => {
const res = await getProductDetail(productId)
viewData.value = res.data
try {
const res = await getProductDetail(productId)
viewData.value = res.data
if (res.data.groupActivities.length > 0) {
const c = await getParticipateList(res.data.groupActivities[0].id)
console.log(c.data, '====')
console.log(getRemainingTime('2026-01-28 23:46:40'))
pingtuanList.value = c.data.map(v => {
return {
...v,
showDate: true
}
})
isPingTuan.value = c.data.length > 0
} else {
isPingTuan.value = false
}
} catch (error) {
navigateBack()
}
}
/** 评论数量获取 */
@@ -36,14 +63,6 @@
return viewData.value.groupActivities[0].totalPeople
})
/**
* 顶部导航按钮点击事件
* @param index 0 返回 1 分享
*/
const onTopNav = index => {
console.log(index)
}
const onConfirm = () => {
navigateTo('/pages/mall/confirm-order', {
productId: productId.value,
@@ -82,11 +101,21 @@
</nav-bar>
<!-- 顶部图片 -->
<view class="top-img">
<image
:src="viewData.mainImage"
mode="scaleToFill"
class="img"
></image>
<swiper
class="swiper"
circular
indicator-dots
autoplay
:interval="4000"
:duration="500"
>
<swiper-item
v-for="(item, index) in viewData.imageGallery"
:key="index"
>
<image :src="item" mode="scaleToFill" class="img"></image>
</swiper-item>
</swiper>
</view>
<!-- 商品详情 -->
@@ -100,37 +129,64 @@
<text>拼单数量:{{ viewData.salesCount }}</text>
<text>好评率:99%</text>
</view>
<!-- 拼单量 -->
<view class="line-box">
<view class="left-img">
<text>拼单</text>
<image
src="/static/images/public/random1.png"
mode="scaleToFill"
class="avatar"
></image>
<image
src="/static/images/public/random2.png"
mode="scaleToFill"
class="avatar"
></image>
<image
src="/static/images/public/random3.png"
mode="scaleToFill"
class="avatar"
></image>
</view>
<text class="right-name">还需{{ getPeople }}人拼单</text>
</view>
<!-- 去拼团 -->
<!-- <view class="bottom-name">
<view class="count-down">
<text>拼单倒计时:</text>
<text>23:53:00</text>
</view>
<button>去拼单</button>
</view>-->
<view v-if="!groupId && isPingTuan" class="ping-box">
<view v-for="(item, index) in pingtuanList" :key="index">
<!-- 拼单量 -->
<view class="line-box">
<view class="left-img">
<text>拼单</text>
<image
src="/static/images/public/random1.png"
mode="scaleToFill"
class="avatar"
></image>
<image
src="/static/images/public/random2.png"
mode="scaleToFill"
class="avatar"
></image>
<image
src="/static/images/public/random3.png"
mode="scaleToFill"
class="avatar"
></image>
</view>
<text class="right-name">
还需{{ item.needPeople }}人拼单
</text>
</view>
<!-- 去拼团 -->
<view class="bottom-name">
<view class="count-down">
<text>拼单倒计时:</text>
<uni-countdown
:day="parseDateTime(item.endTime).day"
:hour="parseDateTime(item.endTime).hour"
:minute="parseDateTime(item.endTime).minute"
:second="parseDateTime(item.endTime).second"
:show-colon="false"
@timeup="
() => {
item.showDate = false
}
"
/>
</view>
<button
v-if="item.showDate"
@click="
navigateTo('/pages/mall/confirm-order', {
productId: productId,
groupId: item.id
})
"
>
去拼单
</button>
</view>
</view>
</view>
<!-- 评论入口 -->
<view
class="comment-box"
@@ -168,11 +224,17 @@
:id="productId"
:text="viewData.productName"
:cover="viewData.mainImage"
:price="viewData.minPrice"
></share-popup>
</view>
</template>
<style lang="scss" scoped>
.ping-box {
max-height: 500rpx;
overflow-y: auto;
}
.left-icon,
.right-icon {
height: 64rpx;
@@ -183,13 +245,17 @@
&::after {
content: '';
position: absolute;
bottom: 0;
bottom: -2rpx;
left: 0;
width: 100%;
height: 56rpx;
background: #fff;
border-radius: 32rpx 32rpx 0 0;
}
.swiper {
width: 100%;
height: 628rpx;
}
.img {
width: 100%;
height: 628rpx;
@@ -197,9 +263,7 @@
}
.detail-box {
padding: 0 58rpx 150rpx;
font-family:
PingFang SC,
PingFang SC;
font-family: PingFang SC, PingFang SC;
font-style: normal;
text-transform: none;
.title {
@@ -257,7 +321,8 @@
}
.bottom-name {
display: flex;
justify-content: flex-end;
justify-content: space-between;
align-items: center;
font-weight: 500;
.count-down {
display: flex;
@@ -307,9 +372,7 @@
display: flex;
justify-content: space-between;
align-items: center;
font-family:
PingFang SC,
PingFang SC;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-style: normal;
text-transform: none;

View File

@@ -5,10 +5,10 @@
const { userInfo } = useAuthUser()
const inviteLink = computed(() => {
const { href } = window.location
return `${href}/pages/login/phone-register/phone-register?invitationCode=${userInfo.value.invitationCode}`
const { origin } = window.location
return `${origin}/pages/login/phone-register/phone-register?invitationCode=${userInfo.value.invitationCode}`
})
// 复制文本通用函数
const copyText = text => {
uni.setClipboardData({

View File

@@ -1,6 +1,6 @@
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { ref, computed } from 'vue'
import { useUI } from '../../utils/use-ui'
const { showToast } = useUI()
@@ -9,13 +9,29 @@
const productId = ref('')
const qrcodeRef = ref(null)
const BASE_URL = computed(() => {
const { origin } = window.location
return `${origin}/pages/mall/detail?productId=${productId.value}&groupId=${groupId.value}`
})
// 复制文本通用函数
const copyText = text => {
uni.setClipboardData({
data: BASE_URL.value,
success: () => {
console.log('已复制到剪贴板')
},
fail: () => {
console.log('复制失败')
}
})
}
onLoad(e => {
groupId.value = e.id
productId.value = e.productId
// /pages/mall/detail
})
</script>
<template>
@@ -36,10 +52,60 @@
</view> -->
</view>
</view>
<!-- 复制连接 -->
<!-- #ifdef H5 -->
<view class="copy-box">
<text class="link">拼单链接:{{ BASE_URL }}</text>
<button @click="copyText">复制</button>
</view>
<!-- #endif -->
</view>
</template>
<style lang="scss" scoped>
.copy-box {
margin-top: 118rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.link {
// 超过宽度显示省略号
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 544rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 32rpx;
font-style: normal;
text-transform: none;
color: #00d993;
}
button {
margin-top: 48rpx;
width: 256rpx;
height: 64rpx;
line-height: 60rpx;
border-radius: 100rpx;
border: 2rpx solid #00d993;
color: #00d993;
padding: 0;
background: none;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 28rpx;
text-align: center;
font-style: normal;
text-transform: none;
&::after {
display: none !important;
}
}
}
.share-box {
height: 100vh;
width: 100vw;