dev
haoyuntao 7 months ago
parent 60762f9175
commit bfca340b72
  1. 5
      src/components/avatar-upload/avatar-upload.vue
  2. 3
      src/components/chat-scroll-view/chat-scroll-view.vue
  3. 1
      src/packages/pages/ai_talk/ai_talk.vue
  4. 6
      src/packages/pages/ai_talk/components/session-item.vue
  5. 14
      src/packages/pages/ai_talk/components/session-popup.vue
  6. 10
      src/packages/pages/user_set/user_set.vue
  7. 4
      src/pages/login/login.vue

@ -56,6 +56,7 @@ const props = defineProps({
const emit = defineEmits<{ const emit = defineEmits<{
(event: 'update:modelValue', value: string): void (event: 'update:modelValue', value: string): void
(event: 'upload', value: string): void (event: 'upload', value: string): void
(event: 'update', value: string): void
}>() }>()
const styles = computed<CSSProperties>(() => { const styles = computed<CSSProperties>(() => {
@ -73,6 +74,7 @@ const styles = computed<CSSProperties>(() => {
const chooseAvatar = async (e: any) => { const chooseAvatar = async (e: any) => {
console.log(props.modelValue) console.log(props.modelValue)
props.modelValue && emit('update', props.modelValue)
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (client == 6) { if (client == 6) {
// const res = await uni.showModal({ // const res = await uni.showModal({
@ -90,13 +92,12 @@ const chooseAvatar = async (e: any) => {
// #endif // #endif
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN
console.log(props)
router.navigateTo({ router.navigateTo({
path: '/uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-cropper?destWidth=300&rectWidth=200&fileType=jpg' path: '/uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-cropper?destWidth=300&rectWidth=200&fileType=jpg'
}) })
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
console.log(props)
const path = e.detail?.avatarUrl const path = e.detail?.avatarUrl
if (path) { if (path) {
uploadImageIng(path) uploadImageIng(path)

@ -69,7 +69,7 @@
<slot name="empty" /> <slot name="empty" />
</template> </template>
<template #bottom> <template #bottom>
<view class="send-area"> <view class="send-area" >
<view class="float-btn"> <view class="float-btn">
<view <view
v-if="chatList.length && !isReceiving" v-if="chatList.length && !isReceiving"
@ -822,6 +822,7 @@ defineExpose({
position: relative; position: relative;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
background-color: #fff; background-color: #fff;
box-shadow: 2px -3px 2px #f1f1f1;
.float-btn { .float-btn {
position: absolute; position: absolute;
left: 50%; left: 50%;

@ -137,7 +137,6 @@ const getProblemExample = async () => {
problem.value = await getSamplesLists() problem.value = await getSamplesLists()
} }
const handlerback=()=>{ const handlerback=()=>{
console.log(popup.value,'=====popup.value')
popup.value.showPopup() popup.value.showPopup()
} }
const getDecorateFunc = async () => { const getDecorateFunc = async () => {

@ -132,6 +132,12 @@ watch(
} }
.line-clamp-1{ .line-clamp-1{
font-size:28rpx; font-size:28rpx;
width:100%;
word-break:break-all;
display:-webkit-box;
-webkit-line-clamp:1;
-webkit-box-orient:vertical;
overflow:hidden;
} }
.border{ .border{
width:92%; width:92%;

@ -29,7 +29,7 @@
</scroll-view> </scroll-view>
</view> </view>
<view class="text-xs items-center create" @click="sessionAddTalk"> <view class="text-xs items-center create" @click="sessionAddTalk">
<u-icon name="plus" class="mt-[15rpx]" size="40" /> <u-icon name="plus" class="mt-[20rpx]" size="40" />
<view class="create-tx">新建</view> <view class="create-tx">新建</view>
</view> </view>
<!-- <u-button <!-- <u-button
@ -47,7 +47,7 @@ import { useAppStore } from '@/stores/app'
import { useSessionList } from './useSessionList' import { useSessionList } from './useSessionList'
import { useLockFn } from '@/hooks/useLockFn' import { useLockFn } from '@/hooks/useLockFn'
import SessionItem from './session-item.vue' import SessionItem from './session-item.vue'
import { watch,defineExpose } from 'vue' import { watch } from 'vue'
const props = defineProps({ const props = defineProps({
modelValue: { modelValue: {
type: Boolean type: Boolean
@ -70,7 +70,8 @@ const {
sessionEdit, sessionEdit,
sessionDelete, sessionDelete,
sessionClear, sessionClear,
sessionActive sessionActive,
getSessionLists
} = useSessionList() } = useSessionList()
const { lockFn: sessionAddLock, isLock } = useLockFn(async () => { const { lockFn: sessionAddLock, isLock } = useLockFn(async () => {
@ -83,7 +84,10 @@ const sessionAddTalk=()=>{
const sessionDetail=(val)=>{ const sessionDetail=(val)=>{
emit('update:modelValue', val) emit('update:modelValue', val)
} }
const showPopup=()=>emit('update:modelValue', true) const showPopup=()=>{
getSessionLists()
emit('update:modelValue', true)
}
const appStore = useAppStore() const appStore = useAppStore()
watch( watch(
() => appStore.getChatConfig, () => appStore.getChatConfig,
@ -109,7 +113,7 @@ defineExpose({
} }
.create{ .create{
position: fixed; position: fixed;
bottom:30rpx; bottom:50rpx;
right:20rpx; right:20rpx;
width:130rpx; width:130rpx;
height:130rpx; height:130rpx;

@ -15,6 +15,7 @@
v-model="userInfo.avatar" v-model="userInfo.avatar"
file-key="url" file-key="url"
:round="true" :round="true"
@update="handlerUpdate"
@upload="uploadImg" @upload="uploadImg"
> >
<template #footer> <template #footer>
@ -343,7 +344,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, shallowRef } from 'vue' import { ref, shallowRef,watch } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app' import { onShow, onLoad } from '@dcloudio/uni-app'
import { import {
getUserInfo, getUserInfo,
@ -413,6 +414,13 @@ const mobileCode = ref<string>('')
const codeTips = ref('') const codeTips = ref('')
const uCodeRef = shallowRef() const uCodeRef = shallowRef()
watch(()=> userInfo.value.avatar,(val,old)=>{
console.log(val,'=========头像',old)
},{deep: true})
const handlerUpdate=(val: string)=>{
console.log(val,'=========touxiang')
userInfo.value.avatar=val
}
// //
const getUser = async (): Promise<void> => { const getUser = async (): Promise<void> => {
userInfo.value = await getUserInfo() userInfo.value = await getUserInfo()

@ -57,7 +57,7 @@
/> />
<div class="text-sm mt-[10px]">手机号登录</div> <div class="text-sm mt-[10px]">手机号登录</div>
</div> </div>
<div <!-- <div
class="flex flex-col items-center" class="flex flex-col items-center"
v-if="hasMailboxLogin && !isMailboxLogin" v-if="hasMailboxLogin && !isMailboxLogin"
@click="changeLoginWay(LoginWayEnum.MAILBOX)" @click="changeLoginWay(LoginWayEnum.MAILBOX)"
@ -67,7 +67,7 @@
:size="80" :size="80"
/> />
<div class="text-sm mt-[10px]">邮箱登录</div> <div class="text-sm mt-[10px]">邮箱登录</div>
</div> </div> -->
</div> </div>
<!-- <agreement /> --> <!-- <agreement /> -->
</view> </view>

Loading…
Cancel
Save