dongmu 12 months ago
parent 8eb206d1b9
commit 300d74f502

File diff suppressed because it is too large Load Diff

@ -1,164 +0,0 @@
<script setup lang="ts">
// import { getHomeGoodsGuessLikeAPI } from '@/services/home'
// import type { PageParams } from '@/types/global'
// import type { GuessItem } from '@/types/home'
import { ref } from 'vue'
import { onMounted } from 'vue'
//
const guessList: any = ref([])
//
const pageParams: Required<any> = ref({
page: 1,
pageSize: 10,
})
//
const resetData = () => {
pageParams.value.page = 1
guessList.value = []
finish.value = false
}
//
const finish = ref(false)
//
// const getHomeGoodsGuessLikeData = async () => {
// // 退
// if (finish.value) {
// uni.showToast({
// icon: 'none',
// title: '~',
// })
// return
// }
// //
// const res = await getHomeGoodsGuessLikeAPI(pageParams)
// //
// guessList.value.push(...res.result.items)
// //
// if (pageParams.page < res.result.pages) {
// //
// pageParams.page++
// } else {
// finish.value = true
// }
// }
//
onMounted(() => {
// getHomeGoodsGuessLikeData()
})
// --
defineExpose({
// getMore: getHomeGoodsGuessLikeData,
resetData,
})
</script>
<template>
<!-- 猜你喜欢 -->
<view class="caption">
<text class="text">接单历史</text>
</view>
<view class="guess">
<navigator
class="guess-item"
v-for="item in guessList"
:key="item.id"
:url="`/pages/goods/goods?id=4007498`"
>
<image class="image" mode="aspectFill" :src="item.picture"></image>
<view class="name"> {{ item.name }}</view>
<view class="price">
<text class="small">¥</text>
<text>{{ item.price }}</text>
</view>
</navigator>
</view>
<view class="loading-text"> {{ finish ? '没有更多数据~' : '正在加载...' }} </view>
</template>
<style lang="scss">
:host {
display: block;
}
/* 分类标题 */
.caption {
display: flex;
justify-content: center;
line-height: 1;
padding: 36rpx 0 40rpx;
font-size: 32rpx;
color: #262626;
.text {
display: flex;
justify-content: center;
align-items: center;
padding: 0 28rpx 0 30rpx;
&::before,
&::after {
content: '';
width: 20rpx;
height: 20rpx;
background-image: url(@/static/images/bubble.png);
background-size: contain;
margin: 0 10rpx;
}
}
}
/* 猜你喜欢 */
.guess {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 20rpx;
.guess-item {
width: 345rpx;
padding: 24rpx 20rpx 20rpx;
margin-bottom: 20rpx;
border-radius: 10rpx;
overflow: hidden;
background-color: #fff;
}
.image {
width: 304rpx;
height: 304rpx;
}
.name {
height: 75rpx;
margin: 10rpx 0;
font-size: 26rpx;
color: #262626;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.price {
line-height: 1;
padding-top: 4rpx;
color: #cf4444;
font-size: 26rpx;
}
.small {
font-size: 80%;
}
}
//
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
</style>

@ -9,7 +9,6 @@ export const useGuessList = () => {
const guessRef = ref() const guessRef = ref()
const onScrolltolower = () => { const onScrolltolower = () => {
console.log('柴胡滴')
guessRef.value?.getMore() guessRef.value?.getMore()
} }

@ -117,12 +117,11 @@ const list = ref([
onLoad(() => { onLoad(() => {
feilUrl.value = ENV.APP_FILE_URL feilUrl.value = ENV.APP_FILE_URL
// getbaseInfo() getbaseInfo()
}) })
// --- // ---
const getbaseInfo = () => { const getbaseInfo = () => {
let _this = this
baseInfo().then((res: any) => { baseInfo().then((res: any) => {
console.log(res) console.log(res)
dataInfo.value = res.data dataInfo.value = res.data

@ -1,5 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { driverMemberInfo } from '@/services/home'
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
import { onLoad } from '@dcloudio/uni-app'
import { ENV } from '@/utils/env'
import { ref } from 'vue'
// //
const { safeAreaInsets } = uni.getSystemInfoSync() const { safeAreaInsets } = uni.getSystemInfoSync()
// //
@ -9,7 +13,23 @@ const orderTypes = [
{ type: 3, text: '待收货', icon: 'icon-check' }, { type: 3, text: '待收货', icon: 'icon-check' },
{ type: 4, text: '已评价', icon: 'icon-comment' }, { type: 4, text: '已评价', icon: 'icon-comment' },
] ]
//
const memberStore = useMemberStore() const memberStore = useMemberStore()
//
const avateInfo = ref<any>()
const getAvateInfo = () => {
driverMemberInfo().then((res) => {
feilUrl.value = ENV.APP_FILE_URL
avateInfo.value = res.data
})
}
// feilUrl + res.data.avatar
const feilUrl = ref()
//
onLoad(() => {
getAvateInfo()
})
</script> </script>
<template> <template>
@ -19,16 +39,12 @@ const memberStore = useMemberStore()
<!-- 情况1已登录 --> <!-- 情况1已登录 -->
<view class="overview" v-if="memberStore.profile"> <view class="overview" v-if="memberStore.profile">
<navigator url="/pagesMember/profile/profile" hover-class="none"> <navigator url="/pagesMember/profile/profile" hover-class="none">
<image <image class="avatar" mode="aspectFill" :src="feilUrl + avateInfo?.avatar"></image>
class="avatar"
mode="aspectFill"
src="https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/uploads/avatar_3.jpg"
></image>
</navigator> </navigator>
<view class="meta"> <view class="meta">
<view class="nickname"> 程序员 </view> <view class="nickname"> {{ avateInfo?.userName }} </view>
<navigator class="extra" url="/pagesMember/profile/profile" hover-class="none"> <navigator class="extra" url="/pagesMember/profile/profile" hover-class="none">
<text class="update">更新头像昵称</text> <text class="update">电话{{ avateInfo?.userPhone }}</text>
</navigator> </navigator>
</view> </view>
</view> </view>
@ -74,13 +90,76 @@ const memberStore = useMemberStore()
{{ item.text }} {{ item.text }}
</navigator> </navigator>
<!-- 客服 --> <!-- 客服 -->
<button class="contact icon-handset" open-type="contact">售后</button> <button class="contact icon-handset" open-type="contact">客服</button>
</view> </view>
</view> </view>
<!-- 猜你喜欢 --> <!-- 猜你喜欢 -->
<view> <view>
<view class="guess"> <view class="guess" style="position: relative">
<XtxGuess ref="guessRef" /> <!-- 箭头样式 -->
<view
style="
height: 150px;
width: 70vw;
background-color: #fff;
border-radius: 60%;
position: absolute;
top: -5px;
left: 0;
right: 0;
margin: auto;
"
></view>
<view class="guessItem" style="position: relative">
<!-- 其他服务 -->
<view class="others">其他服务</view>
<!-- 其他服务信息 -->
<view>
<!-- 司机认证 -->
<view class="navate">
<view style="">
<uni-icons type="wallet" size="20"></uni-icons>
<text style="margin-left: 5px">司机认证</text>
</view>
<view>
<uni-icons type="forward" size="16" color="#9e9e9ecc"></uni-icons>
</view>
</view>
<!-- 我的车辆 -->
<view class="navate">
<view>
<uni-icons type="wallet" size="20"></uni-icons>
<text style="margin-left: 5px">我的车辆</text>
</view>
<view>
<uni-icons type="forward" size="16" color="#9e9e9ecc"></uni-icons>
</view>
</view>
<!-- 我的车队 -->
<view class="navate">
<view>
<uni-icons type="wallet" size="20"></uni-icons>
<text style="margin-left: 5px">我的车队</text>
</view>
<view>
<uni-icons type="forward" size="16" color="#9e9e9ecc"></uni-icons>
</view>
</view>
<!-- 我的钱包 -->
<view class="navate" style="border-bottom: none; margin-bottom: 0">
<view>
<uni-icons type="wallet" size="20"></uni-icons>
<text style="margin-left: 5px">我的钱包</text>
</view>
<view>
<uni-icons type="forward" size="16" color="#9e9e9ecc"></uni-icons>
</view>
</view>
<!-- ---------------------------------- -->
</view>
</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -93,7 +172,28 @@ const memberStore = useMemberStore()
page { page {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
background-color: #f7f7f8; background-color: #eaeaea;
}
.others {
margin-bottom: 5px;
font-size: 16px;
}
.guessItem {
background-color: #fff;
padding: 10px;
font-size: 14px;
z-index: 999999;
}
.navate {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #9e9e9e52;
align-items: flex-end;
margin-bottom: 5px;
} }
.viewport { .viewport {
@ -200,7 +300,6 @@ page {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 40rpx 20rpx 10rpx; padding: 40rpx 20rpx 10rpx;
.navigator, .navigator,
.contact { .contact {
text-align: center; text-align: center;
@ -226,7 +325,8 @@ page {
/* 猜你喜欢 */ /* 猜你喜欢 */
.guess { .guess {
background-color: #f7f7f8; // background-color: #eaeaea;
margin: 20px 15px 0 15px; padding: 15px 10px 0 10px;
margin-top: 0px;
} }
</style> </style>

@ -133,3 +133,19 @@ export function updateBaseInfo(data: any) {
data: data, data: data,
}) })
} }
// 获取用户头像信息
export function driverMemberInfo() {
return http({
url: '/system/member/driverMemberInfo',
method: 'GET',
})
}
// 获取当前角色 查询订单全部信息 ---完成订单信息
export function getHomeGoodsGuessLikeAPI(data: any) {
return http({
url: '/order/waybill/waybillPage',
method: 'POST',
data: data,
})
}

@ -1,11 +1,11 @@
/** // src/components.d.ts 添加组件的类型声明
* declare module '@vue/runtime-core' import XtxSwiper from '@/components/XtxSwiper.vue'
* import XtxGuess from '@/components/XtxGuess.vue'
* declare module 'vue'
*/
import 'vue'
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
// //组件名XtxSwiper 付给的类型typeof XtxSwiper 这样鼠标移入组件名位置就显示出提示不是包unkon
XtxSwiper: typeof XtxSwiper
XtxGuess: typeof XtxGuess
} }
} }
// 组件实例类型 -- 其他的ref获取需要用 --定义公共实例类型InstanceType

@ -22,7 +22,6 @@ const httpInterceptor = {
// 4. 添加 token 请求头标识 // 4. 添加 token 请求头标识
const memberStore = useMemberStore() const memberStore = useMemberStore()
const token = memberStore.profile const token = memberStore.profile
console.log(memberStore.profile, 'memberStore')
if (token) { if (token) {
options.header.Authorization = 'Bearer ' + token // 让每个请求携带自定义token 请根据实际情况自行修改 options.header.Authorization = 'Bearer ' + token // 让每个请求携带自定义token 请根据实际情况自行修改
} }
@ -60,8 +59,6 @@ export const http = <T>(options: UniApp.RequestOptions) => {
}) })
// 1. 返回 Promise 对象 // 1. 返回 Promise 对象
return new Promise<Data<T>>((resolve, reject) => { return new Promise<Data<T>>((resolve, reject) => {
console.log(options, 'options请求数据')
uni.request({ uni.request({
...options, ...options,
// 响应成功 // 响应成功

Loading…
Cancel
Save