master
王文杰 7 months ago
parent 5c237bcfb0
commit 44aa2ed215

@ -2,7 +2,7 @@
* @Author: 王文杰 * @Author: 王文杰
* @Date: 2024-01-04 12:54:56 * @Date: 2024-01-04 12:54:56
* @LastEditors: 王文杰 * @LastEditors: 王文杰
* @LastEditTime: 2024-03-13 13:47:12 * @LastEditTime: 2024-03-13 15:19:50
* @FilePath: /app-nx-recycle/src/App.vue * @FilePath: /app-nx-recycle/src/App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->

@ -30,7 +30,7 @@ const getMemberProfileData = async () => {
const res = await getMemberProfileAPI() const res = await getMemberProfileAPI()
if (res.code == 200) { if (res.code == 200) {
const obj = res.data const obj = res.data
const avatar = domain + JSON.parse(obj.headIcon).url const avatar = domain + JSON.parse(obj.headIcon)[0].url
info.value = { info.value = {
orderTotal: obj.orderTotal, orderTotal: obj.orderTotal,
recycleMiles: obj.recycleMiles, recycleMiles: obj.recycleMiles,
@ -48,12 +48,12 @@ const getMemberProfileData = async () => {
const handleOrderList = () => { const handleOrderList = () => {
uni.navigateTo({ url: '/pages/orderList/orderList' }) uni.navigateTo({ url: '/pages/orderList/orderList' })
} }
const handleOrderAuto = () => { // const handleOrderAuto = () => {
uni.navigateTo({ url: '/pages/orderAuto/orderAuto' }) // uni.navigateTo({ url: '/pages/orderAuto/orderAuto' })
} // }
const handleNewsList = () => { // const handleNewsList = () => {
uni.navigateTo({ url: '/pages/newsList/newsList' }) // uni.navigateTo({ url: '/pages/newsList/newsList' })
} // }
</script> </script>
<template> <template>
<view class="viewport"> <view class="viewport">

@ -6,13 +6,9 @@ import { useMemberStore } from '@/stores'
// //
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
const memberStore = useMemberStore()
const staffId = memberStore.profile?.id
const location = uni.getStorageSync('location') const location = uni.getStorageSync('location')
// //
const queryParams = { const queryParams = {
id: staffId,
// stationId: '521612939661154757',
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
location: location, location: location,
@ -36,7 +32,12 @@ const getMemberOrderData = async () => {
isLoading.value = true isLoading.value = true
// //
const res = await getListOrderAPI(queryParams) const res = await getListOrderAPI(queryParams)
// debugger res.data.list.forEach((e) => {
const str = e.appointmentTimeStart.slice(0, 10)
const start = e.appointmentTimeStart.slice(11, 16)
const end = e.appointmentTimeEnd.slice(11, 16)
e.appointmentTime = str + ' ' + start + '-' + end
})
// //
isLoading.value = false isLoading.value = false
// //
@ -87,23 +88,33 @@ const onRefresherrefresh = async () => {
<view class="card" v-for="item in orderList" :key="item.id"> <view class="card" v-for="item in orderList" :key="item.id">
<!-- 订单信息 --> <!-- 订单信息 -->
<view class="hd"> <view class="hd">
<text class="locationNum">订单编号HG201604052233</text> <text class="locationNum">订单编号{{ item.orderNumber }}</text>
</view> </view>
<navigator class="goods" :url="`/pagesOrder/detail/detail?id=${item.id}`" hover-class="none"> <navigator class="goods" :url="`/pagesOrder/detail/detail?id=${item.id}`" hover-class="none">
<view class="meta"> <view class="meta">
<view class="location ellipsis"> <view class="meta-item">
<image src="/static/images/loction.png" mode="aspectFit" class="icon" /> <view class="icon">
{{ item.loction }}</view <uni-icons type="location" color="#3775F6" size="20"></uni-icons>
> </view>
<view class="people ellipsis"> <view class="text ellipsis">{{ item.recycleAddress }}</view>
<image src="/static/images/iphone.png" mode="aspectFit" class="icon" /> </view>
{{ item.people }}</view <view class="meta-item">
> <view class="icon">
<uni-icons type="calendar" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text ellipsis">{{ item.appointmentTime }}</view>
</view>
<view class="meta-item">
<view class="icon">
<uni-icons type="phone" color="#3775F6" size="20"></uni-icons>
</view>
<view class="text phone">{{ item.clientName }} <text class="iphone">{{ item.clientMobile }}</text></view>
</view>
</view> </view>
</navigator> </navigator>
<!-- 订单操作按钮 --> <!-- 订单操作按钮 -->
<view class="action"> <view class="action">
<text class="label">订单完成时间2024-01-16 13:25:22</text> <text class="label">订单完成时间{{ item.completeTime }}</text>
</view> </view>
<image src="/static/images/order_completed.png" mode="aspectFit" class="img"></image> <image src="/static/images/order_completed.png" mode="aspectFit" class="img"></image>
</view> </view>
@ -167,6 +178,24 @@ const onRefresherrefresh = async () => {
margin-right: 6rpx; margin-right: 6rpx;
} }
} }
.meta-item {
display: flex;
margin: 10rpx 0;
align-items: center;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 20rpx;
}
.text {
font-size: 28rpx;
color: #3D3D3D;
}
.iphone {
color: #3775f6;
margin-left: 10rpx;
}
}
} }
} }
.action { .action {
@ -174,11 +203,11 @@ const onRefresherrefresh = async () => {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 20rpx 0; padding: 20rpx 0;
font-size: 28rpx;
.label { .label {
flex: 1; flex: 1;
align-items: center; align-items: center;
color: #999a9f; color: #3d3d3d;
font-size: 32rpx;
} }
} }
.img { .img {

@ -2,7 +2,7 @@
* @Author: 王文杰 * @Author: 王文杰
* @Date: 2024-01-08 09:15:12 * @Date: 2024-01-08 09:15:12
* @LastEditors: 王文杰 * @LastEditors: 王文杰
* @LastEditTime: 2024-03-07 17:39:16 * @LastEditTime: 2024-03-13 14:47:48
* @FilePath: /app-nx-recycle/src/pages/orerdList/orerdList.vue * @FilePath: /app-nx-recycle/src/pages/orerdList/orerdList.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
@ -12,7 +12,6 @@ import OrderItem from './components/OrderItem.vue'
// //
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
</script> </script>
<template> <template>
@ -40,6 +39,7 @@ page {
// swiper // swiper
.cont { .cont {
background-color: #f7f7f8; background-color: #f7f7f8;
height: 100%;
// margin-top: 128rpx; // margin-top: 128rpx;
} }
</style> </style>

@ -8,7 +8,7 @@ import { computed, ref } from 'vue'
// //
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
const isDev = import.meta.env.DEV const isDev = import.meta.env.DEV
const memberStore = useMemberStore()
const domain = isDev ? 'http://192.168.0.166:8808' : 'http://222.71.165.188:8808' const domain = isDev ? 'http://192.168.0.166:8808' : 'http://222.71.165.188:8808'
// //
@ -17,24 +17,20 @@ const headIcon = ref()
const getMemberProfileData = async () => { const getMemberProfileData = async () => {
const res = await getMemberProfileAPI() const res = await getMemberProfileAPI()
const obj = res.data const obj = res.data
const avatar = domain + JSON.parse(obj.headIcon).url const avatar = domain + JSON.parse(obj.headIcon)[0].url
profile.value = { profile.value = {
avatar, avatar,
gender: obj.gender + '', gender: obj.gender + '',
mobilePhone: obj.mobilePhone, mobilePhone: obj.mobilePhone,
nickName: obj.nickName, staffsName: obj.staffsName || '',
birthday: obj.birthday?.slice(0, 10),
} }
//
headIcon.value = obj.headIcon
// Store // Store
memberStore.profile!.avatar = avatar memberStore.profile!.avatar = avatar
memberStore.profile!.nickName = obj.nickName memberStore.profile!.staffsName = obj.staffsName
} }
onLoad(() => {
getMemberProfileData()
})
const memberStore = useMemberStore()
// //
const onAvatarChange = () => { const onAvatarChange = () => {
uni.chooseMedia({ uni.chooseMedia({
@ -59,7 +55,8 @@ const uploadFile = (file: string) => {
filePath: file, filePath: file,
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
headIcon.value = JSON.stringify(JSON.parse(res.data).data) const target = [JSON.parse(res.data).data]
headIcon.value = JSON.stringify(target)
const avatar = JSON.parse(res.data).data.url const avatar = JSON.parse(res.data).data.url
// //
const imgUrl = domain + avatar const imgUrl = domain + avatar
@ -79,28 +76,26 @@ const onGenderChange: UniHelper.RadioGroupOnChange = (ev) => {
profile.value.gender = ev.detail.value as Gender profile.value.gender = ev.detail.value as Gender
} }
//
const onBirthdayChange: UniHelper.DatePickerOnChange = (ev) => {
profile.value.birthday = ev.detail.value
}
// //
const onSubmit = async () => { const onSubmit = async () => {
const { nickName, gender, birthday } = profile.value const { staffsName, gender } = profile.value
const params = { const params = {
headIcon: headIcon.value, headIcon: headIcon.value,
nickName, staffsName,
gender, gender,
birthday: birthday + ' ' + '00:00:01',
} }
const res = await postMemberProfileAPI(params) const res = await postMemberProfileAPI(params)
// Store // Store
memberStore.profile!.nickName = nickName memberStore.profile!.staffsName = staffsName
uni.showToast({ icon: 'success', title: '保存成功' }) uni.showToast({ icon: 'success', title: '保存成功' })
setTimeout(() => { setTimeout(() => {
uni.navigateBack() uni.navigateBack()
}, 400) }, 400)
} }
onLoad(() => {
getMemberProfileData()
})
</script> </script>
<template> <template>
@ -127,7 +122,7 @@ const onSubmit = async () => {
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">昵称</text> <text class="label">昵称</text>
<input class="input" type="text" placeholder="请填写昵称" v-model="profile.nickName" /> <input class="input" type="text" placeholder="请填写昵称" v-model="profile.staffsName" />
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">性别</text> <text class="label">性别</text>
@ -142,20 +137,6 @@ const onSubmit = async () => {
</label> </label>
</radio-group> </radio-group>
</view> </view>
<view class="form-item">
<text class="label">生日</text>
<picker
@change="onBirthdayChange"
mode="date"
class="picker"
:value="profile?.birthday"
start="1900-01-01"
:end="formatDate(new Date())"
>
<view v-if="profile?.birthday">{{ profile?.birthday }}</view>
<view class="placeholder" v-else></view>
</picker>
</view>
</view> </view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<button @tap="onSubmit" class="form-button"> </button> <button @tap="onSubmit" class="form-button"> </button>
@ -292,5 +273,4 @@ page {
background: linear-gradient(158deg, #51B6FF -10%, #3775F6 129%); background: linear-gradient(158deg, #51B6FF -10%, #3775F6 129%);
} }
} }
</style>import type { parse } from 'path' </style>

@ -31,5 +31,5 @@ export const orderStateList = [
{ id: 5, text: '已完成' }, { id: 5, text: '已完成' },
{ id: 6, text: '已取消' }, { id: 6, text: '已取消' },
] ]
export const storage_token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1c2VyIjp7InVzZXJUeXBlIjoiUkVDWUNMRVIiLCJpZCI6IjUzMzI0Mjk5NTY0Njk1MTY4NSIsInVzZXJuYW1lIjoiMTM2MDE5MjE3NDUiLCJwaG9uZSI6IjEzNjAxOTIxNzQ1Iiwib3BlbmlkIjoib2dZMm82X01waThuemsyWlFPQllsa1lhZWVNRSIsInRpbWVFeHBpcmUiOjI1OTIwMDAwMDB9LCJleHAiOjE3MTI3MjczOTd9.ZzqEbPayoiv4L36R6vYwQVWZcxoeSoM2g_-S1kyQoj32R6a2wFvBSqAOLafk-xbZ3RgUqgmgcB_QH5shOgQXUXamt-GEW8XP75j5314YpPgR3uFSQhKcOLFwPWbMK2jPHs72rjHlIpydLV0YSrRVKtws8a_bmkRMULx7naSFvdXa-nhF0SPYpjgSGHRHACjs3Mx1_ycewF8p0vw0iNpn5Dk0s-msM373_QUw7LAAPEKFHNTswFk6Rb0K0hmK6Axs0GLCv1Dl_F52NsNSRRU2UUBdBcnwOn__7oCfPj-lQDh7ob97b3koVEzmN-KZGuTfl76gc__B7EndghSzb9cnrw' export const storage_token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1c2VyIjp7InVzZXJUeXBlIjoiUkVDWUNMRVIiLCJpZCI6IjUzMzI0Mjk5NTY0Njk1MTY4NSIsInN0YXRpb25JZCI6IjUyMTYxMjkzOTY2MTE1NDc1NyIsInVzZXJuYW1lIjoiMTM2MDE5MjE3NDUiLCJwaG9uZSI6IjEzNjAxOTIxNzQ1Iiwib3BlbmlkIjoib2dZMm82X01waThuemsyWlFPQllsa1lhZWVNRSIsInRpbWVFeHBpcmUiOjI1OTIwMDAwMDB9LCJleHAiOjE3MTI5MDQyNjh9.gcGTxIfpJrptg6yCJykT2EGHw8UzOUK2wu-iBOiIYn2U9IU7wFTrEm_nfBKz7pPx_mTORs7rklRIa7qwt3JU05aacJE0KL1pDLMD41fe9BmtpFLLO2aoQDr0r1sYaQyz8RQGTL2VmxsQaGk_dwIQIShrLIVF2RdcgHLVzibS_SLQNNhf7GeelQFmS7pAYG9odCd4fH_LCLSQoe99_Ik6LX9clvLNlYyvDhSQNEpqpaYI5aWuCylQSItST7jZQi3wimO2Nd1mhhJR1lDWgiTtdBzcMY6TYvjF5chkTwL5vUBF-0O2JUs6QZk6LnTAnh3dI-9lf-HU4lZihS-Ab5IKFw'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

@ -2,7 +2,7 @@
* @Author: * @Author:
* @Date: 2024-01-04 12:54:56 * @Date: 2024-01-04 12:54:56
* @LastEditors: * @LastEditors:
* @LastEditTime: 2024-02-22 10:12:46 * @LastEditTime: 2024-03-13 14:35:47
* @FilePath: /app-nx-recycle/src/stores/modules/member.ts * @FilePath: /app-nx-recycle/src/stores/modules/member.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -17,11 +17,13 @@ export const useMemberStore = defineStore('member', () => {
// 保存会员信息,登录时使用 // 保存会员信息,登录时使用
const setProfile = (val: LoginResult) => { const setProfile = (val: LoginResult) => {
profile.value = val profile.value = val
uni.setStorageSync('storage_token', val.token)
} }
// 清理会员信息,退出时使用 // 清理会员信息,退出时使用
const clearProfile = () => { const clearProfile = () => {
profile.value = undefined profile.value = undefined
uni.setStorageSync('storage_token', '')
} }
// 记得 return // 记得 return

@ -2,7 +2,7 @@
* @Author: * @Author:
* @Date: 2024-01-04 12:54:56 * @Date: 2024-01-04 12:54:56
* @LastEditors: * @LastEditors:
* @LastEditTime: 2024-03-13 10:11:48 * @LastEditTime: 2024-03-13 14:24:26
* @FilePath: /app-nx-recycle/src/utils/http.ts * @FilePath: /app-nx-recycle/src/utils/http.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -17,9 +17,7 @@
* 3. * 3.
* 4. token * 4. token
*/ */
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
// const baseURL = 'http://192.168.0.166:8808/api' // const baseURL = 'http://192.168.0.166:8808/api'
const baseURL = 'http://222.71.165.188:8808/api' const baseURL = 'http://222.71.165.188:8808/api'
// 添加拦截器 // 添加拦截器

Loading…
Cancel
Save