diff --git a/src/components/avatar-upload/avatar-upload.vue b/src/components/avatar-upload/avatar-upload.vue index 4c75c27..02d588d 100644 --- a/src/components/avatar-upload/avatar-upload.vue +++ b/src/components/avatar-upload/avatar-upload.vue @@ -72,6 +72,7 @@ const styles = computed(() => { }) const chooseAvatar = async (e: any) => { + console.log(props.modelValue) // #ifdef APP-PLUS if (client == 6) { // const res = await uni.showModal({ @@ -89,11 +90,13 @@ const chooseAvatar = async (e: any) => { // #endif // #ifndef MP-WEIXIN + console.log(props) router.navigateTo({ path: '/uni_modules/vk-uview-ui/components/u-avatar-cropper/u-avatar-cropper?destWidth=300&rectWidth=200&fileType=jpg' }) // #endif // #ifdef MP-WEIXIN + console.log(props) const path = e.detail?.avatarUrl if (path) { uploadImageIng(path) diff --git a/src/manifest.json b/src/manifest.json index 2d4d405..f438efa 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -139,7 +139,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wxba391e34eddf2cc7", + "appid" : "wx15c8046399298d65", "optimization" : { "subPackages" : true }, diff --git a/src/pages/ai_creation/ai_creation.vue b/src/packages/pages/ai_creation/ai_creation.vue similarity index 99% rename from src/pages/ai_creation/ai_creation.vue rename to src/packages/pages/ai_creation/ai_creation.vue index add4cb7..cf34855 100644 --- a/src/pages/ai_creation/ai_creation.vue +++ b/src/packages/pages/ai_creation/ai_creation.vue @@ -7,6 +7,7 @@ /> + diff --git a/src/packages/pages/ai_talk/ai_talk.vue b/src/packages/pages/ai_talk/ai_talk.vue new file mode 100644 index 0000000..eb4cd2e --- /dev/null +++ b/src/packages/pages/ai_talk/ai_talk.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/src/packages/pages/ai_talk/components/follow-official.vue b/src/packages/pages/ai_talk/components/follow-official.vue new file mode 100644 index 0000000..0ea9254 --- /dev/null +++ b/src/packages/pages/ai_talk/components/follow-official.vue @@ -0,0 +1,55 @@ + + diff --git a/src/packages/pages/ai_talk/components/ios-privacy-popup.vue b/src/packages/pages/ai_talk/components/ios-privacy-popup.vue new file mode 100644 index 0000000..cf8a19b --- /dev/null +++ b/src/packages/pages/ai_talk/components/ios-privacy-popup.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/src/packages/pages/ai_talk/components/mp-privacy-popup.vue b/src/packages/pages/ai_talk/components/mp-privacy-popup.vue new file mode 100644 index 0000000..d82af77 --- /dev/null +++ b/src/packages/pages/ai_talk/components/mp-privacy-popup.vue @@ -0,0 +1,158 @@ + + + + + diff --git a/src/packages/pages/ai_talk/components/problem-example-popup.vue b/src/packages/pages/ai_talk/components/problem-example-popup.vue new file mode 100644 index 0000000..a64febe --- /dev/null +++ b/src/packages/pages/ai_talk/components/problem-example-popup.vue @@ -0,0 +1,89 @@ + + diff --git a/src/packages/pages/ai_talk/components/problem-example.vue b/src/packages/pages/ai_talk/components/problem-example.vue new file mode 100644 index 0000000..e549c5c --- /dev/null +++ b/src/packages/pages/ai_talk/components/problem-example.vue @@ -0,0 +1,76 @@ + + diff --git a/src/packages/pages/ai_talk/components/session-item.vue b/src/packages/pages/ai_talk/components/session-item.vue new file mode 100644 index 0000000..b2c5b46 --- /dev/null +++ b/src/packages/pages/ai_talk/components/session-item.vue @@ -0,0 +1,102 @@ + + diff --git a/src/packages/pages/ai_talk/components/session-popup.vue b/src/packages/pages/ai_talk/components/session-popup.vue new file mode 100644 index 0000000..75a9e72 --- /dev/null +++ b/src/packages/pages/ai_talk/components/session-popup.vue @@ -0,0 +1,90 @@ + + + diff --git a/src/packages/pages/ai_talk/components/session.vue b/src/packages/pages/ai_talk/components/session.vue new file mode 100644 index 0000000..4c81719 --- /dev/null +++ b/src/packages/pages/ai_talk/components/session.vue @@ -0,0 +1,31 @@ + + diff --git a/src/packages/pages/ai_talk/components/useSessionList.ts b/src/packages/pages/ai_talk/components/useSessionList.ts new file mode 100644 index 0000000..95527ce --- /dev/null +++ b/src/packages/pages/ai_talk/components/useSessionList.ts @@ -0,0 +1,81 @@ +import { + chatCategoryAdd, + chatCategoryClear, + chatCategoryDelete, + chatCategoryEdit, + getChatCategoryLists +} from '@/api/chat' +import { computed, ref } from 'vue' +const sessionActive = ref(0) +const sessionLists = ref([]) +export function useSessionList() { + const getSessionLists = async () => { + try { + const data = await getChatCategoryLists({ page_type: 0 }) + sessionLists.value = data?.lists || [] + if (sessionActive.value === 0) { + initSessionActive() + } + return sessionLists.value + } catch (error) { + sessionLists.value = [] + initSessionActive() + } + } + + const sessionAdd = async () => { + await chatCategoryAdd({}) + await getSessionLists() + initSessionActive() + } + + const sessionDelete = async (id: number) => { + const res = await uni.showModal({ + title: '确定删除该会话?' + }) + if (res.confirm) { + await chatCategoryDelete({ id }) + await getSessionLists() + initSessionActive() + } + } + + const sessionClear = async () => { + const res = await uni.showModal({ + title: '确定清除所有会话?' + }) + if (res.confirm) { + await chatCategoryClear() + await getSessionLists() + initSessionActive() + } + } + + const sessionEdit = async (id: number, name: string) => { + await chatCategoryEdit({ id, name }) + getSessionLists() + } + + const initSessionActive = () => { + sessionActive.value = sessionLists.value[0]?.id || 0 + } + + const currentSession = computed(() => { + return ( + sessionLists.value.find( + (session) => session.id === sessionActive.value + )?.name || '' + ) + }) + + return { + getSessionLists, + sessionActive, + sessionLists, + sessionAdd, + sessionEdit, + sessionDelete, + sessionClear, + currentSession + } +} diff --git a/src/pages.json b/src/pages.json index bc69eaa..cc73062 100644 --- a/src/pages.json +++ b/src/pages.json @@ -10,16 +10,16 @@ "share": true } }, - { - "path": "pages/ai_creation/ai_creation", - "style": { - "navigationBarTitleText": "AI创作", - "enablePullDownRefresh": true - }, - "meta": { - "share": true - } - }, + // { + // "path": "pages/ai_creation/ai_creation", + // "style": { + // "navigationBarTitleText": "AI创作", + // "enablePullDownRefresh": true + // }, + // "meta": { + // "share": true + // } + // }, { "path": "pages/skills/skills", "style": { @@ -102,6 +102,15 @@ "share": true } }, + { + "path": "pages/ai_talk/ai_talk", + "style": { + "navigationBarTitleText": "AI对话" + }, + "meta": { + "share": true + } + }, { "path": "pages/drawing/drawing", "style": { @@ -408,6 +417,16 @@ "share": false, "auth": false } + }, + { + "path" : "pages/ai_creation/ai_creation", + "style" : + { + "navigationBarTitleText" : "AI创作" + }, + "meta": { + "auth": false + } } ] } @@ -429,10 +448,10 @@ "pagePath": "pages/index/index", "text": "首页" }, - { - "pagePath": "pages/ai_creation/ai_creation", - "text": "创作" - }, + // { + // "pagePath": "pages/ai_creation/ai_creation", + // "text": "创作" + // }, { "pagePath": "pages/skills/skills", "text": "技能" diff --git a/src/pages/app/app.vue b/src/pages/app/app.vue index cd2912c..f38a28c 100644 --- a/src/pages/app/app.vue +++ b/src/pages/app/app.vue @@ -48,6 +48,7 @@ const decorate = ref([]) const getData = async () => { const data = await getDecorate({ id: 7 }) decorate.value = JSON.parse(data.data) + } const showList = computed(() => { return ( @@ -71,7 +72,7 @@ const onJump = (row: any) => { const navigateType = nativeTabList.includes(row.link.path) ? 'switchTab' : 'navigateTo' - navigateTo(row.link, false, navigateType) + navigateTo(row.link, false, 'navigateTo') } onShow(() => { diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 5517693..79e91b0 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -7,170 +7,213 @@ /> - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + {{ item.title }} + + + {{ item.desc }} + + - + - + diff --git a/src/pages/index/index1.vue b/src/pages/index/index1.vue new file mode 100644 index 0000000..5517693 --- /dev/null +++ b/src/pages/index/index1.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/pages/login/components/update-user-info.vue b/src/pages/login/components/update-user-info.vue index c1dcb78..1276a20 100644 --- a/src/pages/login/components/update-user-info.vue +++ b/src/pages/login/components/update-user-info.vue @@ -23,13 +23,14 @@ - + import { uploadImage } from '@/api/app' -import { computed, ref } from 'vue' +import { computed, ref,onMounted } from 'vue' const props = defineProps({ show: { type: Boolean @@ -90,7 +91,14 @@ const showPopup = computed({ }) const avatar = ref() - +const nickname=ref('') +onMounted(()=>{ + console.log(props.userInfo,'====props') + if(props.userInfo?.avatar){ + avatar.value=props.userInfo.avatar + nickname.value=props.userInfo.nickname + } +}) const uploadImg = async (file: string) => { uni.showLoading({ title: '正在上传中...' @@ -108,7 +116,7 @@ const uploadImg = async (file: string) => { } const handleSubmit = (e: any) => { - const { nickname } = e.detail.value + const { nickname } = props.userInfo// e.detail.value if (!avatar.value) return uni.$u.toast('请添加头像') if (!nickname) return uni.$u.toast('请输入昵称') emit('update', { diff --git a/src/pages/login/login.vue b/src/pages/login/login.vue index f33dcd8..5c8a532 100644 --- a/src/pages/login/login.vue +++ b/src/pages/login/login.vue @@ -73,6 +73,7 @@