'!'
This commit is contained in:
@@ -88,7 +88,27 @@ const login = {
|
||||
*/
|
||||
queryAccountBalance: async (): Promise<AnyObject> => {
|
||||
return await request.api('/jx_horizon/wechat/balance', 'GET')
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 注册和修改密码
|
||||
* Password string `p:"password"` // 密码
|
||||
* OldPassword string `p:"old_password"` // 旧密码
|
||||
*/
|
||||
changePassword: async (params:AnyObject): Promise<AnyObject> => {
|
||||
return await request.api('/jx_horizon/wechat/changePassword', 'POST',params)
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 注册和修改密码
|
||||
* Password string `p:"password"` // 密码
|
||||
* OldPassword string `p:"old_password"` // 旧密码
|
||||
*/
|
||||
ressss: async (): Promise<AnyObject> => {
|
||||
return await request.api('/api/register', 'POST')
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,12 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path":"passMan",
|
||||
"style": {
|
||||
"navigationBarTitleText": "密码管理"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
<view class="cell_text">白菜妖精</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view v-for="(item,index) in historyList" :key="index" class="cell"
|
||||
<scroll-view scroll-y style="height: calc(100vh - 400rpx);" :scroll-into-view="scrollToView" scroll-with-animation>
|
||||
<view v-for="(item,index) in historyList" :key="index" class="cell" :id="'msg' + index"
|
||||
:class="{
|
||||
'cell_sys' : item.usertType === 'sys',
|
||||
'cell_user': item.usertType === 'user'
|
||||
@@ -41,15 +42,27 @@
|
||||
<view class="content">
|
||||
<text>{{ item.usertType === 'sys' && index !== 0 ? `根据【${item.content}】生成的图片信息如下:`: item.content }}</text>
|
||||
</view>
|
||||
<view v-if=" item.usertType === 'sys' && index !==0 " class="backImg">
|
||||
<!-- <view > -->
|
||||
<image :src="item.vendorDescription" alt="图片加载中..." class="img" @tap="previewImg(item.vendorDescription)" @error="handleImgError(index)"/>
|
||||
<!-- :style="{
|
||||
overflow:item.vendorDescription.length >1 ? 'hidden' : '',
|
||||
overflowX:item.vendorDescription.length >1 ? 'auto': '',
|
||||
width:item.vendorDescription.length >1 ? '600rpx': '400rpx'
|
||||
}" -->
|
||||
<view v-if=" item.usertType === 'sys' && index !==0 " class="backImg"
|
||||
:class="{'moreImg':item.vendorDescription.length >1}"
|
||||
>
|
||||
<!-- <view > .split(',') -->
|
||||
<view v-for="(url,i) in item.vendorDescription">
|
||||
<!-- {{ url }} -->
|
||||
<image :src="url" alt="图片加载中..." class="img" @tap="previewImg(item.vendorDescription)" @error="handleImgError(index,i)" />
|
||||
</view>
|
||||
<!-- </view> -->
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
<view class="productImgTip" v-show="isLoadingImg">
|
||||
<text class="txt" style="--i: 1">拼</text>
|
||||
@@ -70,6 +83,7 @@
|
||||
<input v-model="keyWord" placeholder="说点什么吧......" style="width: 100%;" >
|
||||
<view style="border-radius: 20rpx;margin-right: 20rpx;width: 160rpx;height: 60rpx;display: flex;background-color: #007aff;color:#fff;align-items: center;justify-content: center;" @click="sendText">发送</view>
|
||||
</view>
|
||||
<view class="AILogo">内容由AI生成,仅供参考</view>
|
||||
</view>
|
||||
<!-- {{ isShowDrawer }} -->
|
||||
<jx-drawer
|
||||
@@ -95,6 +109,7 @@
|
||||
<jx-cell :text="'充值记录'" @jumpTo="jumpMyOrder"></jx-cell>
|
||||
<jx-cell :text="'我的推广码'" @jumpTo="myPromte"></jx-cell>
|
||||
<jx-cell :text="'查看历史话题'" @jumpTo="queryHistoryChat"></jx-cell>
|
||||
<jx-cell :text="'密码管理'" @jumpTo="passwodMan"></jx-cell>
|
||||
<jx-cell :text="'联系客服'" @jumpTo="callPhone"></jx-cell>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -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<boolean>(false)
|
||||
const keyWord = ref('')
|
||||
const keyWord = ref<string>('')
|
||||
let isShowDrawer = ref(false)
|
||||
const scrollToView = ref<string>('')
|
||||
|
||||
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<AnyObject[]>([{
|
||||
// }
|
||||
])
|
||||
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;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
惊喜视界账号使用协议
|
||||
欢迎您注册、使用惊喜视界账号!
|
||||
|
||||
本协议系您与成都若溪科技有限公司就惊喜视界账号的注册和使用而订立的。成都若溪科技有限公司(如下简称“惊喜视界”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制惊喜视界责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用惊喜视界账号。您的注册和使用惊喜视界账号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。
|
||||
本协议系您与京西(成都)科技有限公司就惊喜视界账号的注册和使用而订立的。京西(成都)科技有限公司(如下简称“惊喜视界”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制惊喜视界责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用惊喜视界账号。您的注册和使用惊喜视界账号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。
|
||||
|
||||
一、 关于惊喜视界账号
|
||||
1.惊喜视界账号系由惊喜视界所有的用于识别您身份的标识。账号的所有权属于惊喜视界,您作为初始申请注册人仅拥有您所注册账号的使用权。
|
||||
|
||||
@@ -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)
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
<view class="text">
|
||||
<view class="agreement-title">用户协议及隐私协议</view>
|
||||
<view class="content">
|
||||
本协议系您与成都若溪科技有限公司就京西菜市帐号的注册和使用而订立的。成都若溪科技有限公司(如下简称“京西菜市”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制京西菜市责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用京西菜市帐号。您的注册和使用京西菜市帐号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。
|
||||
本协议系您与京西(成都)科技有限公司就京西菜市帐号的注册和使用而订立的。京西(成都)科技有限公司(如下简称“京西菜市”)在此特别提醒您认真阅读、充分理解本协议各条款,特别是涉及服务费用条款,免除或者限制京西菜市责任的条款,对您的权利限制条款,争议解决和法律适用条款等,此类条款将以加粗的形式提示您注意。请您审慎阅读并选择接受或不接受本协议(限制民事行为能力人应在监护人或法定代理人陪同下阅读)。除非您接受本协议所有条款,否则您无权注册、使用京西菜市帐号。您的注册和使用京西菜市帐号行为将视为您已充分理解本协议(即本协议及后续更新版本或开通或使用某项服务的单项协议),并同意接受本协议各项条款的约束。
|
||||
</view>
|
||||
<view class="agreement">
|
||||
点击同意即代表您已阅读并同意
|
||||
|
||||
181
src/subPages/login/passMan.vue
Normal file
181
src/subPages/login/passMan.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<view style="padding: 20rpx 40rpx; margin-top: 100rpx;" v-if="isLogin">
|
||||
<view style="width: 100%;text-align: center;font-weight: bold;font-size: 40rpx;">修改密码</view>
|
||||
<view class="pwd-from-root" style="">
|
||||
<jx-input>
|
||||
<template #left>
|
||||
<jx-icon icon="shoujihao" color="#aaa" :size="36"></jx-icon>
|
||||
</template>
|
||||
<template #middle>
|
||||
<uni-easyinput
|
||||
style="background-color:#efefef ;"
|
||||
primaryColor="#aaa"
|
||||
:inputBorder="false"
|
||||
class="input"
|
||||
type="text"
|
||||
v-model="userName"
|
||||
placeholder="请输入用户名"
|
||||
/>
|
||||
</template>
|
||||
</jx-input>
|
||||
</view>
|
||||
<view class="pwd-from-root" style="">
|
||||
<jx-input>
|
||||
<template #left>
|
||||
<jx-icon icon="mima" color="#aaa" :size="36"></jx-icon>
|
||||
</template>
|
||||
<template #middle>
|
||||
<uni-easyinput
|
||||
style="background-color:#efefef ;"
|
||||
primaryColor="#aaa"
|
||||
:inputBorder="false"
|
||||
class="input"
|
||||
type="password"
|
||||
v-model="password1"
|
||||
placeholder="请输入原密码(首次可不填)"
|
||||
/>
|
||||
</template>
|
||||
</jx-input>
|
||||
</view>
|
||||
|
||||
<view class="pwd-from-root">
|
||||
<jx-input>
|
||||
<template #left>
|
||||
<jx-icon icon="mima" color="#aaa"></jx-icon>
|
||||
</template>
|
||||
<template #middle>
|
||||
<uni-easyinput
|
||||
primaryColor="#aaa"
|
||||
:inputBorder="false"
|
||||
class="input"
|
||||
type="password"
|
||||
v-model="passwordNew"
|
||||
placeholder="请输入新密码"
|
||||
/>
|
||||
</template>
|
||||
</jx-input>
|
||||
</view>
|
||||
|
||||
<view class="pwd-from-root">
|
||||
<jx-input>
|
||||
<template #left>
|
||||
<jx-icon icon="mima" color="#aaa"></jx-icon>
|
||||
</template>
|
||||
<template #middle>
|
||||
<uni-easyinput
|
||||
primaryColor="#aaa"
|
||||
:inputBorder="false"
|
||||
class="input"
|
||||
type="password"
|
||||
v-model="passwordNew2"
|
||||
placeholder="请再输入一遍新密码"
|
||||
/>
|
||||
</template>
|
||||
</jx-input>
|
||||
</view>
|
||||
|
||||
<button class="pwd-login-btn" @tap="changePass">修改密码</button>
|
||||
</view>
|
||||
<jx-empty v-else title="您还未登录"></jx-empty>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import login from '@/api/https/login';
|
||||
import { computed, ref } from 'vue';
|
||||
import { md5 } from 'js-md5'
|
||||
import toast from '@/utils/toast';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { store } from '@/store';
|
||||
import JxEmpty from '@/components/jx-empty/jx-empty.vue';
|
||||
|
||||
const userName = ref<string>('') // 用户名
|
||||
const password1 = ref<string>('') // 原密码
|
||||
const passwordNew = ref<string>('')
|
||||
const passwordNew2 = ref<string>('')
|
||||
const mobile = computed(() => {
|
||||
return '' + uni.getStorageSync('mobile')
|
||||
})
|
||||
|
||||
const userInfo:AnyObject = computed(() => {
|
||||
return uni.getStorageSync('userInfo')
|
||||
})
|
||||
|
||||
/**
|
||||
* 登录状态
|
||||
*/
|
||||
const isLogin = computed(() => {
|
||||
return store.getters['serveInfo/isLogin']
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
console.log('userInfo',userInfo)
|
||||
userName.value = userInfo.value.userId2 ? userInfo.value.userId2 : '' + uni.getStorageSync('mobile')
|
||||
})
|
||||
/**
|
||||
* 确认修改密码
|
||||
*/
|
||||
async function changePass(){
|
||||
try {
|
||||
// console.log(mobile.value,'userName.value',userName.value,'判断')
|
||||
if(passwordNew.value && passwordNew.value !== passwordNew2.value) return toast('新密码不一致')
|
||||
let data:AnyObject = {}
|
||||
if(passwordNew.value){
|
||||
data.password = md5(passwordNew.value)
|
||||
data.oldPassword = password1.value ? md5(password1.value) : md5(passwordNew.value) // 首次和新密码保持一致
|
||||
}
|
||||
if(userInfo.value.userId2 ? userName.value !== userInfo.value.userId2 : userName.value !== mobile.value) data.userName = userName.value
|
||||
if(JSON.stringify(data) === '{}') return toast('没有要修改的信息')
|
||||
console.log('修改密码的参数信息',data)
|
||||
let res = await login.changePassword(data)
|
||||
console.log('设置密码,成功了没',res)
|
||||
if(res.code == 0){
|
||||
toast('修改成功')
|
||||
let userInfoNew = JSON.parse(JSON.stringify(userInfo.value))
|
||||
console.log(userInfoNew,'用户信息',userInfoNew)
|
||||
userInfoNew.userId2 = userName.value
|
||||
|
||||
// if(userInfo.value.userId2 ? userName.value !== userInfo.value.userId2 : userName.value !== mobile.value)
|
||||
uni.setStorageSync('userInfo',userInfoNew)
|
||||
// await store.dispatch('serveInfo/wxLogin',{authType:'wx',isJudg:false}) // 查看当前用户是否为新用户
|
||||
}else toast('修改失败')
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.pwd-from-root {
|
||||
border-bottom: 2rpx solid rgb(234, 234, 234);
|
||||
line-height: 70rpx;
|
||||
margin-bottom: 30rpx;
|
||||
margin-top: 40rpx;
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.pwd-login-btn {
|
||||
border-radius: 100rpx;
|
||||
margin-top: 60rpx;
|
||||
color: rgb(255, 255, 255);
|
||||
background-color: $jx-login;
|
||||
}
|
||||
|
||||
::v-deep .uni-easyinput__content-input {
|
||||
background-color: #efefef !important;
|
||||
// font-size: 44rpx;
|
||||
}
|
||||
|
||||
::v-deep .uni-easyinput__content,.uni-easyinput__content > .content-clear-icon{
|
||||
background-color: #efefef !important;
|
||||
|
||||
// .content-clear-icon{
|
||||
// background-color: #efefef;
|
||||
// }
|
||||
}
|
||||
</style>
|
||||
@@ -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})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
@scrolltolower="scrolltolower"
|
||||
class="list"
|
||||
@refresherrefresh="refresherrefresh">
|
||||
<view v-for="(item,index) in historyList" :key="index" class="list_item">
|
||||
<view v-for="(item,index) in historyList" :key="index" class="list_item">
|
||||
<view class="desc">
|
||||
<view>话题:{{ item.userDescription }}</view>
|
||||
<view>创建时间:{{ item.createdAt }}</view>
|
||||
@@ -30,8 +30,14 @@
|
||||
<text style="text-decoration: line-through;">¥{{ (item.jxPrice / 100).toFixed(2) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- / -->
|
||||
<image :src="item.vendorDescription" alt="加载中..." class="img" @tap="previewImg(item.vendorDescription)" @error="handleImgError(index)"></image>
|
||||
<view style="height: 240rpx;">
|
||||
<view style="width: 200rpx;height: 200rpx;overflow: hidden;overflow-x: auto;">
|
||||
<image v-for="(url,i) in item.vendorDescription" :key="i" :src="url" alt="加载中..." class="img" @tap="previewImg(item.vendorDescription)" @error="handleImgError(index,i)"></image>
|
||||
</view>
|
||||
<view style="text-align: center;height: 20rpx;">{{ item.vendorDescription.length>1 ? '+' + item.vendorDescription.length : '' }}</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<jx-load-more
|
||||
v-show="totalCount >= 4"
|
||||
@@ -160,10 +166,10 @@ const {
|
||||
* 加载图片信息
|
||||
*/
|
||||
const defaultImg = 'https://image.jxc4.com/image/0d2cc478f955889455861fe519e02d15.png'
|
||||
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[i] !== defaultImg ){
|
||||
historyList.value[index].vendorDescription[i] = defaultImg
|
||||
}
|
||||
// console.log('加载图片信息',e,'number',index)
|
||||
}
|
||||
@@ -209,7 +215,7 @@ const isLogin = computed(() => {
|
||||
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;
|
||||
|
||||
@@ -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()}`
|
||||
}
|
||||
Reference in New Issue
Block a user