diff --git a/src/api/https/login.ts b/src/api/https/login.ts index 625dd4e..3532e18 100644 --- a/src/api/https/login.ts +++ b/src/api/https/login.ts @@ -88,7 +88,27 @@ const login = { */ queryAccountBalance: async (): Promise => { return await request.api('/jx_horizon/wechat/balance', 'GET') - } + }, + + + /** + * 注册和修改密码 + * Password string `p:"password"` // 密码 + * OldPassword string `p:"old_password"` // 旧密码 + */ + changePassword: async (params:AnyObject): Promise => { + return await request.api('/jx_horizon/wechat/changePassword', 'POST',params) + }, + + + /** + * 注册和修改密码 + * Password string `p:"password"` // 密码 + * OldPassword string `p:"old_password"` // 旧密码 + */ + ressss: async (): Promise => { + return await request.api('/api/register', 'POST') + }, } diff --git a/src/pages.json b/src/pages.json index 8dc586e..9a672ca 100644 --- a/src/pages.json +++ b/src/pages.json @@ -31,6 +31,12 @@ "style": { "navigationBarTitleText": "登录" } + }, + { + "path":"passMan", + "style": { + "navigationBarTitleText": "密码管理" + } } ] }, diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index e17fe4a..7666814 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -18,7 +18,8 @@ 白菜妖精 --> - + {{ item.usertType === 'sys' && index !== 0 ? `根据【${item.content}】生成的图片信息如下:`: item.content }} - - - 图片加载中... + + + + + + 图片加载中... + + + @@ -70,6 +83,7 @@ 发送 + + @@ -117,14 +132,16 @@ import order from '@/api/https/order' import { onLoad, onShow } from '@dcloudio/uni-app' import useGlobalFunc from '@/composables/useGlobalFunc' import { qiniuyun } from '@/utils/qiniuUploader' +import { timeFormatD, timeFormatDateHMS } from '@/utils/tools' const { previewImage, // 预览图片 } = useGlobalFunc() let isLoadingImg = ref(false) -const keyWord = ref('') +const keyWord = ref('') let isShowDrawer = ref(false) +const scrollToView = ref('') onLoad((query) => { console.log('初始化,query',query) @@ -136,10 +153,13 @@ onLoad((query) => { * 加载图片信息 */ const defaultImg = 'https://image.jxc4.com/image/7f8c15f44bbcdbd9174df1797dfe74dd.jpg' -function handleImgError(index:number){ +function handleImgError(index:number,i:number | string){ // 防止无限循环:如果已经是默认图,不再替换 - if (historyList.value[index].vendorDescription !== defaultImg) { - historyList.value[index].vendorDescription = defaultImg + // if (historyList.value[index].vendorDescription !== defaultImg) { + // historyList.value[index].vendorDescription = defaultImg + // } + if(historyList.value[index].vendorDescription[i] !== defaultImg ){ + historyList.value[index].vendorDescription[i] = defaultImg } // console.log('加载图片信息',e,'number',index) } @@ -147,12 +167,21 @@ function handleImgError(index:number){ /************************************************* * 预览图片 */ - function previewImg(url:string) { + function previewImg(url:string[]) { // let arr = [skuName.img,skuName.img2,skuName.img3,skuName.img4,skuName.img5].filter(item => { return item && item.length > 0 }) previewImage(url) } +let arr = ['两只老虎'] + +/** + * 密码管理 + */ +function passwodMan(){ + uni.navigateTo({url:'/subPages/login/passMan'}) +} + /** * 联系客服 */ @@ -334,22 +363,30 @@ const historyList = ref([{ // } ]) async function getAccountInvoice(){ + historyList.value = [{ + usertType:'sys', + nickName:'惊喜视界', + content:'嘿,好久不见,甚是想念。', + }] try { - if(!isLogin.value) return + // if(!isLogin.value) return + let time = new Date() let obj = { rank:'desc', // desc/asc orderBy:'created_at', // keyword:keyword.value, - // beginTime:date1.value, - // endTime:date2.value, + beginTime:timeFormatDateHMS(+new Date(time.getTime() - 1000 * 60 * 60 * 24 * 1)), + endTime:timeFormatDateHMS(time.getTime()), // pageNum:page.value, // pageSize:pageSize.value } let res = await order.queryAccountInvoice(obj) if(res.code == 0 && res.data.total){ - console.log('查询用户的使用记录',res) - let newArr = await combine(res.data.list || []) + + let newArr = await combine(res.data.list.reverse() || []) historyList.value = historyList.value.concat(newArr || []) + scrollToView.value = 'msg' + (historyList.value.length -1) + console.log(historyList.value,'查询用户的使用记录',res) // totalCount.value = res.data.total || 0 // [ // { @@ -393,6 +430,7 @@ function combine(arr:AnyObject[]){ usertType:'sys', nickName:'惊喜视界', content:item.userDescription, + vendorDescription:item.vendorDescription.includes(',') ? item.vendorDescription.split(',') : [item.vendorDescription] }) }) return brr @@ -404,7 +442,7 @@ function combine(arr:AnyObject[]){ async function sendText(){ try { // let url = uni.getStorageSync('uploadImgUrl') - if(!isLogin.value) return toast('请登录') + // if(!isLogin.value) return toast('请登录') if(keyWord.value.length === 0) return toast('请输入文字内容') isLoadingImg.value = true console.log('发送文本的内容111111111111111',keyWord.value) @@ -415,6 +453,7 @@ async function sendText(){ nickName:userInfo.nickName, content:keyWord.value, }) + scrollToView.value = 'msg' + (historyList.value.length -1) let obj:AnyObject = { vendorModel:'doubao', @@ -429,14 +468,24 @@ async function sendText(){ let res = await order.useText2Msg(obj) toast('发送成功,请等待......') if(res.code == 0){ - console.log('打印返回图片的信息',res) - historyList.value.push({ - usertType:'sys', + let arr = [{ + usertType:'sys', nickName:'惊喜视界', content:keyWord.value, - vendorDescription:res.data.imgs[0] - }) + vendorDescription:res.data.imgs + }] + + // historyList.value.push({ + // usertType:'sys', + // nickName:'惊喜视界', + // content:keyWord.value, + // vendorDescription:res.data.imgs[0] + // }) + historyList.value = historyList.value.concat(arr) + scrollToView.value = 'msg' + (historyList.value.length -1) + console.log(historyList.value,'打印返回图片的信息',res) isLoadingImg.value = false + keyWord.value = '' delImg(url) // getAccountInvoice }else{ @@ -459,6 +508,7 @@ async function sendText(){ * 删除图片 */ async function delImg(urls:string){ + if(urls.length === 0) return let res = await order.del_qiniu_img(urls) uni.setStorageSync('uploadImgUrl','') console.log('删除图片的结果',res) @@ -477,7 +527,7 @@ async function delImg(urls:string){ flex-direction: column; justify-content: space-between; border: none; - height: calc(100vh - 76rpx); + height: calc(100vh - 100rpx); // border: 1rpx solid red; .navi{ @@ -578,6 +628,13 @@ async function delImg(urls:string){ } } + .moreImg{ + overflow: hidden; + overflow-x: auto; + width: 700rpx; + box-sizing: border-box; + } + // .content_cell_sys,.content_cell_user{ // // display: flex; @@ -629,6 +686,12 @@ async function delImg(urls:string){ margin-bottom: 20rpx; } +.AILogo{ + // border:1rpx solid red; + text-align: center; + color: #808080; +} + .drawer{ border: none; diff --git a/src/subPages/agreement/user.vue b/src/subPages/agreement/user.vue index d2ab37e..f8fc728 100644 --- a/src/subPages/agreement/user.vue +++ b/src/subPages/agreement/user.vue @@ -6,7 +6,7 @@ 惊喜视界账号使用协议 欢迎您注册、使用惊喜视界账号! -本协议系您与成都若溪科技有限公司就惊喜视界账号的注册和使用而订立的。成都若溪科技有限公司(如下简称“惊喜视界”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制惊喜视界责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用惊喜视界账号。您的注册和使用惊喜视界账号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。 +本协议系您与京西(成都)科技有限公司就惊喜视界账号的注册和使用而订立的。京西(成都)科技有限公司(如下简称“惊喜视界”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制惊喜视界责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用惊喜视界账号。您的注册和使用惊喜视界账号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。 一、 关于惊喜视界账号 1.惊喜视界账号系由惊喜视界所有的用于识别您身份的标识。账号的所有权属于惊喜视界,您作为初始申请注册人仅拥有您所注册账号的使用权。 diff --git a/src/subPages/login/codeLogin/codeLogin.vue b/src/subPages/login/codeLogin/codeLogin.vue index cc2127d..027ea14 100644 --- a/src/subPages/login/codeLogin/codeLogin.vue +++ b/src/subPages/login/codeLogin/codeLogin.vue @@ -76,12 +76,6 @@ async function codeLogin() { auth_id_type:'phone_number' } await store.dispatch('serveInfo/wxLogin',{authType:'yzm',isJudg:false,obj:data}) - // let res = await login.applets_login(data) - // if (res.code == 0) { - // emit('codeLogin', res.data) - // } else { - // toast(res.desc) - // } } /** diff --git a/src/subPages/login/index.vue b/src/subPages/login/index.vue index 8484e23..62f73fe 100644 --- a/src/subPages/login/index.vue +++ b/src/subPages/login/index.vue @@ -136,7 +136,7 @@ 用户协议及隐私协议 - 本协议系您与成都若溪科技有限公司就京西菜市帐号的注册和使用而订立的。成都若溪科技有限公司(如下简称“京西菜市”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制京西菜市责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用京西菜市帐号。您的注册和使用京西菜市帐号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。 + 本协议系您与京西(成都)科技有限公司就京西菜市帐号的注册和使用而订立的。京西(成都)科技有限公司(如下简称“京西菜市”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制京西菜市责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用京西菜市帐号。您的注册和使用京西菜市帐号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。 点击同意即代表您已阅读并同意 diff --git a/src/subPages/login/passMan.vue b/src/subPages/login/passMan.vue new file mode 100644 index 0000000..f8b023a --- /dev/null +++ b/src/subPages/login/passMan.vue @@ -0,0 +1,181 @@ + + + + + \ No newline at end of file diff --git a/src/subPages/login/paswordLogin/paswordLogin.vue b/src/subPages/login/paswordLogin/paswordLogin.vue index 710be5a..0357a44 100644 --- a/src/subPages/login/paswordLogin/paswordLogin.vue +++ b/src/subPages/login/paswordLogin/paswordLogin.vue @@ -69,12 +69,7 @@ async function pwdLogin() { authID: phone.value, authSecret: md5(pwd.value), } - let res = await login.applets_login(data) - if (res.code == 0) { - emit('pwdLogin', res.data) - } else { - toast(res.desc) - } + await store.dispatch('serveInfo/wxLogin',{authType:'pwd',isJudg:false,obj:data}) } diff --git a/src/subPages/mine/historyTopic.vue b/src/subPages/mine/historyTopic.vue index 63b9d50..bc208fb 100644 --- a/src/subPages/mine/historyTopic.vue +++ b/src/subPages/mine/historyTopic.vue @@ -21,7 +21,7 @@ @scrolltolower="scrolltolower" class="list" @refresherrefresh="refresherrefresh"> - + 话题:{{ item.userDescription }} 创建时间:{{ item.createdAt }} @@ -30,8 +30,14 @@ ¥{{ (item.jxPrice / 100).toFixed(2) }} - - 加载中... + + + 加载中... + + {{ item.vendorDescription.length>1 ? '+' + item.vendorDescription.length : '' }} + + + { return store.getters['serveInfo/isLogin'] }) onLoad(async () => { - if(!isLogin.value) return + // if(!isLogin.value) return await getAccountInvoice() }) @@ -219,15 +225,16 @@ async function getAccountInvoice(){ rank:sortArr.value[sortIndex.value].id, // desc/asc orderBy:vendorArr.value[vendor.value].id, keyword:keyword.value, - beginTime:date1.value, - endTime:date2.value, + beginTime:date1.value + ' 00:00:00', + endTime:date2.value + ' 23:59:59', pageNum:page.value, pageSize:pageSize.value } let res = await order.queryAccountInvoice(obj) if(res.code == 0){ console.log('查询用户的使用记录',res) - historyList.value = historyList.value.concat(res.data.list || []) + let newArr = await combine(res.data.list.reverse() || []) + historyList.value = historyList.value.concat(newArr.reverse() || []) totalCount.value = res.data.total || 0 } popup.value.close() @@ -237,6 +244,18 @@ async function getAccountInvoice(){ } + +function combine(arr:AnyObject[]){ + let brr:AnyObject = [] + arr.forEach(item => { + brr.push({ + ...item, + vendorDescription:item.vendorDescription.includes(',') ? item.vendorDescription.split(',') : [item.vendorDescription] + }) + }) + return brr +} + // const totalCount = ref<>(0) function dataHoming(){ historyList.value = [] @@ -355,7 +374,7 @@ async function changeIpt(keywords: string) { .desc{ width: calc(100% - 200rpx); - height: 200rpx; + height: 240rpx; display: flex; flex-direction: column; justify-content: space-between; diff --git a/src/utils/tools.ts b/src/utils/tools.ts index f4d6862..875e1f3 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -91,3 +91,14 @@ export const timeFormatD = (time?: number | string) => { let timer = time ? new Date(time) : new Date() return `${timer.getFullYear()}-${(timer.getMonth() + 1) < 10 ? '0' + (timer.getMonth() + 1) : (timer.getMonth() + 1)}-${timer.getDate() < 10 ? '0' + timer.getDate() : timer.getDate()}` } + + +/************************************************* + * @desc 处理时间 YYY-M-D + * @param {time}-需要处理的时间 + * @return {time} - YYYY-MM-DD HH:mm:ss + */ +export const timeFormatDateHMS = (time?: number | string) => { + let timer = time ? new Date(time) : new Date() + return `${timer.getFullYear()}-${(timer.getMonth() + 1) < 10 ? '0' + (timer.getMonth() + 1) : (timer.getMonth() + 1)}-${timer.getDate() < 10 ? '0' + timer.getDate() : timer.getDate()} ${timer.getHours() < 10 ? '0' + timer.getHours() : timer.getHours() }:${timer.getMinutes()<10 ? '0' + timer.getMinutes() : timer.getMinutes()}:${timer.getSeconds() < 10 ? '0' + timer.getSeconds() : timer.getSeconds()}` +} \ No newline at end of file