parent
27e031ac1b
commit
4929b2cede
@ -0,0 +1,164 @@
|
||||
<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>
|
@ -1,72 +1,78 @@
|
||||
{
|
||||
"name": "鸿森通货运",
|
||||
"appid": "__UNI__D787228",
|
||||
"description": "",
|
||||
"versionName": "1.0.0",
|
||||
"versionCode": 1,
|
||||
"transformPx": false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus": {
|
||||
"usingComponents": true,
|
||||
"nvueStyleCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": true,
|
||||
"waiting": true,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
"name" : "鸿森通货运",
|
||||
"appid" : "__UNI__D787228",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : 1,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {
|
||||
"OAuth" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"oauth" : {
|
||||
"univerify" : {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules": {},
|
||||
/* 应用发布信息 */
|
||||
"distribute": {
|
||||
/* android打包配置 */
|
||||
"android": {
|
||||
"permissions": [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios": {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp": {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin": {
|
||||
"appid": "wx79b61e386979fc3a",
|
||||
"setting": {
|
||||
"urlCheck": false
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx79b61e386979fc3a",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"vueVersion": "3"
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "3"
|
||||
}
|
||||
|
@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<view>
|
||||
<view>
|
||||
<headTabbar tabbarName="个人设置"></headTabbar>
|
||||
<view>
|
||||
<!-- 外壳 -->
|
||||
<view class="main" style="">
|
||||
<!-- 内容区 -->
|
||||
<view class="content" style="">
|
||||
<!-- 头像区域 -->
|
||||
<view class="mainItem">
|
||||
<view>头像</view>
|
||||
<view>
|
||||
<uni-file-picker
|
||||
@select="(even) => imgSuccess(even)"
|
||||
limit="1"
|
||||
:del-icon="false"
|
||||
disable-preview
|
||||
:imageStyles="imageStyles"
|
||||
file-mediatype="image"
|
||||
>
|
||||
<image
|
||||
style="width: 50px; height: 50px"
|
||||
mode="scaleToFill"
|
||||
:src="feilUrl + dataInfo.avatar"
|
||||
></image>
|
||||
</uni-file-picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 昵称 -->
|
||||
<view class="mainItem">
|
||||
<view>昵称</view>
|
||||
<view>{{ dataInfo.userName }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 性别 -->
|
||||
<view class="mainItem" @click="showGender = true">
|
||||
<view>性别</view>
|
||||
<view style="display: flex">
|
||||
<text>{{ dataInfo.gender }}</text>
|
||||
<view style="padding-top: 1px">
|
||||
<uni-icons type="right" size="16" color="#b5b5b5"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 手机号 -->
|
||||
<view class="mainItem" style="border-bottom: none">
|
||||
<view>手机号</view>
|
||||
<view>{{ dataInfo.userPhone }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 保存信息 -->
|
||||
<view class="btnSave" style="" @click="getupdateBaseInfo">
|
||||
<view class="saveItem" style="">保存信息</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录 -->
|
||||
<view @click="goBack" class="btnSave" style="color: #878787">
|
||||
<view class="saveItem">退出登录</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view @click="clickNativeRule" style="text-align: center; color: #008bd1; font-size: 14px"
|
||||
>《鸿森通用户服务协议》</view
|
||||
>
|
||||
</view>
|
||||
|
||||
<!-- <u-action-sheet
|
||||
:closeOnClickOverlay="true"
|
||||
:closeOnClickAction="true"
|
||||
@select="selectClick"
|
||||
:actions="list"
|
||||
:show="showGender"
|
||||
></u-action-sheet> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { uploadAtt } from '@/services/common'
|
||||
import { baseInfo, logout, updateBaseInfo } from '@/services/home'
|
||||
import { ENV } from '@/utils/env'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const feilUrl = ref()
|
||||
const showGender = ref(false)
|
||||
const dataInfo = ref({
|
||||
gender: '男',
|
||||
avatar: '',
|
||||
userName: '',
|
||||
userPhone: '',
|
||||
})
|
||||
const imageStyles = ref({
|
||||
width: 50,
|
||||
height: 50,
|
||||
border: {
|
||||
radius: '50%',
|
||||
},
|
||||
})
|
||||
const list = ref([
|
||||
{
|
||||
name: '男',
|
||||
fontSize: '20',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: '女',
|
||||
fontSize: '20',
|
||||
value: 0,
|
||||
},
|
||||
])
|
||||
|
||||
onLoad(() => {
|
||||
feilUrl.value = ENV.APP_FILE_URL
|
||||
// getbaseInfo()
|
||||
})
|
||||
|
||||
// 获取信息-生日-头像-
|
||||
const getbaseInfo = () => {
|
||||
let _this = this
|
||||
baseInfo().then((res: any) => {
|
||||
console.log(res)
|
||||
dataInfo.value = res.data
|
||||
dataInfo.value.gender = '男'
|
||||
})
|
||||
}
|
||||
|
||||
// 更新信息
|
||||
const getupdateBaseInfo = () => {
|
||||
let obj = {
|
||||
avatar: dataInfo.value.avatar,
|
||||
birthday: '2023-10-31 20:24:00',
|
||||
userNickname: dataInfo.value.userName,
|
||||
}
|
||||
updateBaseInfo(obj).then((res: any) => {
|
||||
console.log('更新成功')
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 选择性别接受的数据
|
||||
const selectClick = (val: any) => {
|
||||
showGender.value = false
|
||||
dataInfo.value.gender = val.name
|
||||
}
|
||||
|
||||
// 上传照片成功回调函数
|
||||
const imgSuccess = async (event: any) => {
|
||||
const tempFilePaths = event.tempFilePaths
|
||||
uploadAtt(tempFilePaths[0]).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
dataInfo.value.avatar = res.data.url
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 规则跳转
|
||||
const clickNativeRule = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pageOthers/pageLoginAccent/pageLoginAccent',
|
||||
})
|
||||
}
|
||||
|
||||
// 退出登录
|
||||
const goBack = () => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否退出登录',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
logout().then((res: any) => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/OneClickLogin/OneClickLogin',
|
||||
})
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #eaeaea;
|
||||
}
|
||||
.main {
|
||||
width: 100vw;
|
||||
padding: 10px 10px;
|
||||
font-size: 14px;
|
||||
|
||||
.content {
|
||||
padding: 0 20px;
|
||||
border-radius: 5px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.mainItem {
|
||||
padding: 10px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
height: 45px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.btnSave {
|
||||
width: 100vw;
|
||||
font-size: 14px;
|
||||
padding: 0 10px 10px 10px;
|
||||
color: #ff557f;
|
||||
|
||||
.saveItem {
|
||||
border-radius: 5px;
|
||||
background-color: #fff;
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,13 @@
|
||||
// 存放路径: src/services/home.ts
|
||||
import { http, uploadRequest } from '@/utils/http'
|
||||
|
||||
/**
|
||||
* 上传图片接口
|
||||
* @param data
|
||||
*/
|
||||
export function uploadAtt(filePath: any) {
|
||||
return uploadRequest({
|
||||
url: '/file/upload',
|
||||
filePath: filePath,
|
||||
})
|
||||
}
|
Loading…
Reference in new issue