账户登录

master
dongmu 11 months ago
parent a433a2b7b4
commit 3a2ccd4a4c

@ -64,6 +64,7 @@
"@dcloudio/uni-mp-xhs": "3.0.0-alpha-3081220230802001",
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3081220230802001",
"@dcloudio/uni-ui": "^1.4.28",
"crypto-js": "^4.2.0",
"pinia": "2.0.27",
"pinia-plugin-persistedstate": "^3.2.0",
"vue": "^3.2.47",
@ -77,6 +78,7 @@
"@dcloudio/uni-vue-devtools": "3.0.0-alpha-3080220230511001",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3081220230802001",
"@rushstack/eslint-patch": "^1.1.4",
"@types/crypto-js": "^4.2.1",
"@types/node": "^18.11.9",
"@uni-helper/uni-app-types": "^0.5.8",
"@uni-helper/uni-ui-types": "^0.5.11",

@ -46,6 +46,9 @@ dependencies:
'@dcloudio/uni-ui':
specifier: ^1.4.28
version: registry.npmmirror.com/@dcloudio/uni-ui@1.4.28
crypto-js:
specifier: ^4.2.0
version: registry.npmmirror.com/crypto-js@4.2.0
pinia:
specifier: 2.0.27
version: 2.0.27(typescript@5.1.6)(vue@3.3.4)
@ -81,6 +84,9 @@ devDependencies:
'@rushstack/eslint-patch':
specifier: ^1.1.4
version: 1.2.0
'@types/crypto-js':
specifier: ^4.2.1
version: registry.npmmirror.com/@types/crypto-js@4.2.1
'@types/node':
specifier: ^18.11.9
version: 18.11.10
@ -7003,6 +7009,12 @@ packages:
'@babel/types': registry.npmmirror.com/@babel/types@7.22.10
dev: true
registry.npmmirror.com/@types/crypto-js@4.2.1:
resolution: {integrity: sha512-FSPGd9+OcSok3RsM0UZ/9fcvMOXJ1ENE/ZbLfOPlBWj7BgXtEAM8VYfTtT760GiLbQIMoVozwVuisjvsVwqYWw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/crypto-js/-/crypto-js-4.2.1.tgz}
name: '@types/crypto-js'
version: 4.2.1
dev: true
registry.npmmirror.com/@types/graceful-fs@4.1.6:
resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz}
name: '@types/graceful-fs'
@ -7641,6 +7653,12 @@ packages:
which: registry.npmmirror.com/which@2.0.2
dev: true
registry.npmmirror.com/crypto-js@4.2.0:
resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz}
name: crypto-js
version: 4.2.0
dev: false
registry.npmmirror.com/cssom@0.3.8:
resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/cssom/-/cssom-0.3.8.tgz}
name: cssom

@ -14,7 +14,16 @@ onHide(() => {
<style lang="scss">
//
@import '@/styles/fonts.scss';
// @import '@/styles/fonts.scss';
@import '@/static/scss/index.scss';
// 使 vw rem
html {
// 375 16px 4.2666vw
font-size: 4.26666666vw;
//
height: auto;
}
view,
navigator,

@ -0,0 +1,21 @@
// import type { XtxGuessInstance } from '@/types/component'
import { ref } from 'vue'
/**
*
*/
export const useGuessList = () => {
// 获取猜你喜欢实例
const guessRef = ref()
const onScrolltolower = () => {
console.log('柴胡滴')
guessRef.value?.getMore()
}
// 返回
return {
onScrolltolower,
guessRef,
}
}

@ -14,27 +14,20 @@
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
"navigationBarTitleText": "抢单"
}
},
{
"path": "pages/my/my",
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/cart/cart",
"path": "pages/category/category",
"style": {
"navigationBarTitleText": "购物车"
"navigationBarTitleText": "运单"
}
},
{
"path": "pages/category/category",
"path": "pages/my/my",
"style": {
"navigationBarTitleText": "分类"
"navigationBarTitleText": "我的"
}
},
{
@ -58,23 +51,17 @@
"borderStyle": "white",
"list": [
{
"text": "首页",
"text": "抢单",
"pagePath": "pages/index/index",
"iconPath": "static/tabs/home_default.png",
"selectedIconPath": "static/tabs/home_selected.png"
},
{
"text": "分类",
"text": "运单",
"pagePath": "pages/category/category",
"iconPath": "static/tabs/category_default.png",
"selectedIconPath": "static/tabs/category_selected.png"
},
{
"text": "购物车",
"pagePath": "pages/cart/cart",
"iconPath": "static/tabs/cart_default.png",
"selectedIconPath": "static/tabs/cart_selected.png"
},
{
"text": "我的",
"pagePath": "pages/my/my",

@ -1,11 +0,0 @@
<script setup lang="ts">
//
</script>
<template>
<view class="cart">cart</view>
</template>
<style lang="scss">
//
</style>

@ -0,0 +1,315 @@
<!-- 指派订单 -->
<template>
<!-- 待装车 -->
<view>
<view class="content" v-for="(item, index) in userAppointedList" :key="index">
<!-- 第一行 -->
<view class="oneMain" style="">
<view class="oneAddress" style="">
<!-- 起始地址 -->
<view class="beginAdd">
<text>{{ item.beginAdd }}</text>
</view>
<!-- ---图标 -->
<view class="" style="padding: 0 5px">
<uni-icons custom-prefix="iconfont" type="icon-daoda" size="30"></uni-icons>
</view>
<!-- 结束地址 -->
<view class="arriveAdd">
<text>{{ item.arriveAdd }}</text>
</view>
</view>
<!-- <text style="font-size: 16px;color: orangered;">{{ item.transportFee }}</text> -->
</view>
<!-- 第二行 -->
<view class="" style="display: flex; padding: 10px 0 0 0.8rem">
<!-- 标签 -->
<view class="">
<uni-tag text="整车" size="mini" type="primary"></uni-tag>
</view>
<!-- 预计里程 运费 -->
<view class="twoMain" style="">
<text>预计运输里程{{ item.estimateMileage }}km</text>
</view>
</view>
<!-- 第三行 -->
<view class="threeMain" style="">
<!-- 预估装车 -->
<view class="">
<uni-icons
custom-prefix="iconfont"
type="icon-daodashijian"
size="16"
style="margin: 0 10px"
></uni-icons>
<text>预估装车</text>
<text> {{ parseTime(item.packageTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</text>
</view>
<!-- 预估到达 -->
<view class="">
<uni-icons
custom-prefix="iconfont"
type="icon-zhuangcherenwu"
size="20"
style="margin: 0 8px"
></uni-icons>
<text>预估到达</text>
<text> {{ parseTime(item.arriveTime, '{y}-{m}-{d} {h}:{i}:{s}') || '' }}</text>
</view>
<view class="">
<uni-icons
custom-prefix="iconfont"
type="icon-icon_xinyong_xianxing_jijin-259"
size="16"
style="margin: 0 10px"
></uni-icons>
<text>预估价</text>
<text> {{ item.transportFee }}</text>
</view>
<!-- 货物 -->
<view class="" style="display: flex">
<uni-icons type="wallet" size="20" style="margin: 0 8px"></uni-icons>
<view class="" style="display: flex; width: 100%">
<text> 货物</text>
<view class="" style="display: flex; width: 80%; justify-content: flex-start">
<text> {{ item.goodsName }}</text>
<text style="margin: 0 5px"> {{ item.weight }}千克</text>
<text> {{ item.volume }}</text>
</view>
</view>
</view>
<!-- 车型 -->
<view
class=""
style="display: flex; justify-content: space-between; flex-wrap: wrap; padding-right: 3px"
>
<view class="" style="margin-bottom: 5px">
<uni-icons
custom-prefix="iconfont"
type="icon-transport"
size="16"
style="margin: 0 10px"
></uni-icons>
<text>车型</text>
<text> {{ item.vehicleName }}</text>
</view>
<view class="" style="display: flex; margin-left: 16rpx">
<button
@click="btnTrue(item.id)"
type="primary"
size="mini"
plain="true"
style="margin-right: 10px"
>
接单
</button>
<button @click="btnNo(item.id)" type="primary" size="mini" plain="true" style="">
拒单
</button>
</view>
</view>
</view>
<!-- 在最后一列显示 动画 -->
<view
class="u-demo-block__content"
v-show="index == userAppointedList.length - 1"
style="padding-top: 20px; height: 60px; background-color: #eaeaea"
>
<u-loadmore v-if="isLoading == 1" :line="true" status="loading"></u-loadmore
><!-- 正在加载 -->
<u-loadmore
v-else-if="isLoading == 2"
:line="true"
status="loadmore"
loadmoreText="点击加载更多..."
@loadmore="LoadMore"
></u-loadmore
><!-- 加载更多 -->
<u-loadmore v-else :line="true" status="nomore"></u-loadmore
><!-- 没有更多了 -->
</view>
</view>
</view>
</template>
<script>
import { userAppointed, updStatus, updStatusRefuse } from '@/services/home'
export default {
name: 'deiverPendingOrders',
data() {
return {
// --- ---
isLoading: 2, //1- 2- 3-
queryUserAppointed: {},
userAppointedList: [],
}
},
//
mounted() {
//
this.formatTheList()
},
methods: {
//
formatTheList() {
//
this.queryUserAppointed = {
total: 0,
current: 1,
size: 2,
pages: null,
}
this.userAppointedList = []
// -
this.getUserAppointed()
},
// -
getUserAppointed() {
let than = this
// 1- 2- 3-
than.isLoading = 1
userAppointed(than.queryUserAppointed).then((res) => {
if (200 == res.code) {
console.log(res)
//
than.queryUserAppointed.current += 1
than.queryUserAppointed.pages = res.data.pages
than.queryUserAppointed.total = res.data.total
//
than.userAppointedList = [...than.userAppointedList, ...res.data.records]
if (res.data.current >= res.data.pages) {
than.isLoading = 3
} else {
than.isLoading = 2
}
}
})
},
//
LoadMore() {
this.getUserAppointed()
},
anomaly() {
uni.navigateTo({
url: '/pagesDriver/driverAnomaly/driverAnomaly',
})
},
btnTrue(id) {
let than = this
updStatus({
orderAppointId: id,
}).then((res) => {
if (200 == res.code) {
uni.showToast({
title: '抢单成功',
icon: 'none',
duration: 2000,
})
this.formatTheList()
}
})
},
btnNo(id) {
updStatusRefuse({
orderAppointId: id,
}).then((res) => {
if (200 == res.code) {
uni.showToast({
title: '已拒单',
icon: 'none',
duration: 2000,
})
this.formatTheList()
}
})
},
},
}
</script>
<style lang="scss" scoped>
.content {
// background-color: #9e9e9e00;
background-image: linear-gradient(to top, #df89b5 0%, #bfd9fe 100%);
margin-bottom: 1rem;
// border-radius: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
box-shadow: 0 0 3px 3px #ccc;
}
.oneMain {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 16px;
padding: 0.8rem 0.8rem 0 0.8rem;
.oneAddress {
display: flex;
justify-content: space-around;
font-weight: bold;
// align-items: center;
.beginAdd {
// width: 50%;
}
.oneAddress {
// width: 20%;
}
.arriveAdd {
width: 50%;
}
}
.oneText {
line-height: 16px;
}
}
.twoMain {
display: flex;
font-size: 16px;
margin-left: 15px;
// justify-content: space-between;
}
.threeMain {
// background-color: #f5f5f5;
background-image: linear-gradient(to top, #fff1eb 0%, #ace0f9 100%);
margin-top: 10px;
padding: 10px 5px;
// border-radius: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
display: flex;
flex-direction: column;
justify-content: space-around;
height: 200px;
font-size: 16px;
}
.fourMain {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 30px;
button {
border-radius: 15px;
width: 150px;
background-color: #f5f5f5;
}
}
</style>

@ -1,9 +1,73 @@
<template>
<view>
<view style="padding: 1px 1rem; padding-bottom: 100px">
<!-- 导航头部图片 -->
<view class="head">
<image
:webp="true"
:src="
feilUrl1 +
'hhkj-dev/2023/09/14/1xlTlRFx9YiS03f2a2a7222c38eb5a12521a0097b362_20230914113620A002.png'
"
></image>
</view>
<view class="">
<u-notice-bar :text="textList" color="#795548" bgColor="#fdf6ec"></u-notice-bar>
</view>
<!-- 局部按钮 -->
<view class="" style="height: 50px; display: flex; margin-top: 4px">
<view class="leftScanCode" @click="btnSancode" style="">
<uni-icons color="#606266" type="scan" size="25"></uni-icons>
<text>扫码接单</text>
</view>
<view class="rightMyDriver" @click="goMyDriver" style="">
<u-icon name="car" size="28"></u-icon>
<text>我的车辆</text>
</view>
</view>
<!-- 内容区 指派订单 -->
<view class="">
<view class="content">
<view style="display: flex; align-items: center">
<text class="textIcon"></text>
<text class="textItem">指派订单</text>
</view>
</view>
<view class="" style="margin-top: 10px">
<deiverPendingOrders ref="deiverPendingOrdersRef"></deiverPendingOrders>
</view>
</view>
<!-- 内容区 抢单大厅 -->
<view class="">
<view class="content">
<view style="display: flex; align-items: center">
<text class="textIcon"></text>
<text class="textItem">抢单大厅</text>
</view>
</view>
<view class="" style="margin-top: 10px">
<!-- <grabOrders ref="grabOrdersRef"></grabOrders> -->
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { getHomeBannerAPI, queryList } from '@/services/home'
import CustomNavbar from './componets/CustomNavbar.vue'
// import grabOrders from './componets/grabOrders.vue'
import deiverPendingOrders from './componets/deiverPendingOrders.vue'
import { queryList } from '@/services/home'
import { ENV } from '@/utils/env'
import { onLoad } from '@dcloudio/uni-app' // -----
import { onMounted } from 'vue'
import { ref } from 'vue'
import type { BannerItem } from '@/types/home'
import { decrypt } from '@/utils/decrypt'
// --
onLoad(() => {
@ -11,35 +75,111 @@ onLoad(() => {
queryLists()
})
//
const feilUrl = ref()
const feilUrl1 = ref()
const textList = ref()
onMounted(() => {
feilUrl.value = ENV.APP_FILE_URL + 'hhkj-dev'
feilUrl1.value = ENV.APP_FILE_URL
})
//
const queryLists = async () => {
const res = await queryList()
console.log(res)
}
//
// queryLists() {
// queryList().then((res) => {
// this.VicItems = res.data;
// // console.log(res, 'queryList')
// if (res.data.length != 0) {
// let e = this.VicItems[0];
// this.vehicle = e; //
// this.vehicleId = e.id;
// }
// });
// },
//
const btnSancode = () => {
uni.scanCode({
success: function (res) {
// json--
let result = JSON.parse(res.result)
console.log(result, 'result')
//
if (result.name == 'home') {
//
//
let deptId = result.deptId
uni.navigateTo({
url: `/pagesDriver/sacnOrders/sacnOrders?sacnCode=` + JSON.stringify(deptId),
})
} else {
//
let decrypta = decrypt(result.id)
// //
uni.navigateTo({
url: `/pagesDriver/scanDetail/scanDetail?sacnCode=` + JSON.stringify(decrypta),
})
}
},
})
}
//
const goMyDriver = () => {
// uni.navigateTo({
// url: `/pagesDriver/myCars/myCars`,
// })
}
</script>
<template>
<CustomNavbar></CustomNavbar>
<style lang="scss">
.leftScanCode {
background-color: #ffc107e0;
width: 50%;
display: flex;
justify-content: center;
align-items: center;
// border-bottom-left-radius: 15px;
// border-top-left-radius: 15px;
}
<!-- 自定义轮播图 ctrl+点击 后先进入的是组件类型 声明文件 可以看到组件引入的路径-->
.rightMyDriver {
background-color: #3d98f2;
width: 50%;
display: flex;
justify-content: center;
align-items: center;
// border-top-right-radius: 15px;
// border-bottom-right-radius: 15px;
}
<view class="index">index</view>
</template>
.head {
width: 100%;
margin-top: 5px;
<style lang="scss">
//
image {
width: 100%;
height: 9.375rem;
// border-radius: 20px;
}
}
.headItem {
width: 100%;
height: 5.625rem;
margin-top: 15px;
background-size: 100% 100%;
}
.content {
width: 100%;
margin-top: 35px;
background-color: #e6e6e6;
margin-bottom: 15px;
.textIcon {
width: 6px;
height: 22px;
background-color: blue;
border-radius: 20px;
}
.textItem {
margin-left: 8px;
font-size: 1.2rem;
}
}
</style>

@ -1,11 +1,403 @@
<script setup lang="ts">
//
</script>
<template>
<view class="login">login</view>
<view class="">
<HeadTabbar :isShowIcon="false" tabbarName="登录页面"></HeadTabbar>
<view class="normal-login-container" style="">
<!--鸿森通货运 标题 -->
<view
class="logo-content align-center justify-center flex"
style="position: relative; z-index: 9999"
>
<text class="title">鸿森通货运</text>
</view>
<view class="login-form-content">
<view class="login_menu"> </view>
<!-- 账号登录 -->
<view class="">
<view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view>
<input
v-model="loginForm.account"
class="input"
type="number"
placeholder="请输入手机号"
:maxlength="11"
/>
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input
v-model="loginForm.password"
type="password"
class="input"
placeholder="请输入密码"
:maxlength="15"
/>
</view>
<view>
<uni-row>
<uni-col :span="16">
<view class="input-item flex align-center">
<view class="iconfont icon-code icon"></view>
<input
v-model="loginForm.smsCode"
type="number"
class="input"
placeholder="请输入验证码"
:maxlength="6"
/>
</view>
</uni-col>
<uni-col :span="8">
<view class="login-code">
<button
:class="{ 'login-code-verification': canclick, disabled: !canclick }"
plain
@click="countdown"
>
{{ content }}
</button>
</view>
</uni-col>
</uni-row>
</view>
<view class="action-btn">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">
登录
</button>
</view>
<view class="text-center">
<text @click="handleUserAgrement" class="text-blue">忘记密码</text>
<text class="border_class"></text>
<text @click="handlePrivacy" class="text-blue">注册账号</text>
</view>
<!-- ---------------用户协议---------------- -->
<view style="display: flex; justify-content: center; margin-right: 66rpx">
<view style="margin: 20rpx 0 10rpx 30rpx; display: flex; align-items: center">
<view>
<uni-data-checkbox
v-model="agreementSearch"
@change="agreementSearchItem"
multiple
:localdata="agreement"
></uni-data-checkbox>
</view>
<view @click="clickNativeRule" style="margin-left: -25px"
>鸿森通用户服务协议</view
>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { loginSmsCode, loginUser } from '@/services/home'
import { ENV } from '@/utils/env'
import { useMemberStore } from '@/stores'
import { onMounted } from 'vue'
import { ref } from 'vue'
const feilUrl = ref()
const feilUrl1 = ref()
const agreementSearch = ref([]) //
const showGetPhoneNumber = ref(false) //
const agreement = ref([
{
value: 1,
},
])
const loginForm = ref({
account: '',
password: '',
smsCode: '',
jsCode: '',
})
const content = ref('获取验证码') //
const totaltime = ref(60) //
const UniCode = ref() //
const canclick = ref(true) //
const clock = ref() //
//
const agreementSearchItem = (e: any) => {
if (agreementSearch.value[0]) {
showGetPhoneNumber.value = true
} else {
showGetPhoneNumber.value = false
}
}
//
const clickNativeRule = () => {
uni.navigateTo({
url: '/pageOthers/pageLoginAccent/pageLoginAccent',
})
}
//
const handlePrivacy = () => {
uni.navigateTo({
url: '/pages/login/appleId/appleId',
})
}
//
const handleUserAgrement = () => {
uni.navigateTo({
url: '/pages/login/loginPassword/loginPassword',
})
}
//
const handleLogin = async () => {
if (!agreementSearch.value[0]) {
uni.showToast({
title: '请先阅读协议',
icon: 'error',
})
return
}
if (loginForm.value.account === '') {
uni.showToast({
title: '请输入您的账号',
icon: 'error',
})
return
} else if (loginForm.value.password === '') {
uni.showToast({
title: '请输入您的密码',
icon: 'error',
})
return
} else if (loginForm.value.smsCode === '') {
uni.showToast({
title: '请输入验证码',
icon: 'error',
})
return
} else {
//
// loginForm.value.jsCode = UniCode.value
let URL = '/pages/index/index'
loginUser(loginForm.value)
.then((res: any) => {
if (res.code == 200) {
// vuex token
// setToken(res.data.access_token)
// setExpiresIn(res.data.expires_in)
//
const memberStore = useMemberStore()
memberStore.setProfile(res.data.access_token)
//
uni.showToast({
title: '登录成功',
icon: 'success',
})
uni.reLaunch({
//
url: URL,
})
}
})
.catch(() => {
// loginCode.value()
console.log('重新请求login-ui')
})
}
}
//
const countdown = () => {
//false
if (!canclick.value) {
return
}
if (loginForm.value.account === '') {
uni.showToast({
title: '请输入手机号码',
icon: 'error',
})
return
}
if (loginForm.value.password === '') {
uni.showToast({
title: '请输入登录密码',
icon: 'error',
})
return
}
smsVerif()
}
//
const smsVerif = () => {
//
// SmsVerificationCode( loginForm.username)
loginSmsCode(loginForm.value.account, 1, loginForm.value.password)
.then((res) => {
uni.showToast({
title: '发送验证码成功',
icon: 'success',
})
canclick.value = false
content.value = totaltime.value + 's后重新发送'
clock.value = setInterval(() => {
totaltime.value--
content.value = totaltime.value + 's后重新发送'
if (totaltime.value < 0) {
//
// resend = true
clearInterval(clock.value)
content.value = '重新发送验证码'
totaltime.value = 60
canclick.value = true
}
}, 1000)
})
.catch((err) => {
canclick.value = true //
// resend = true
clearInterval(clock.value)
content.value = '重新发送验证码'
totaltime.value = 60
// isBTn = false
})
}
onMounted(() => {
feilUrl.value = ENV.APP_FILE_URL + 'hhkj-dev'
feilUrl1.value = ENV.APP_FILE_URL
})
</script>
<style lang="scss">
//
page {
background-color: #55aaff;
background: url('http://106.58.179.30:19005/hhkj-dev/2023/10/29/JmDFnTCUxWmd67e2e3bcbbf32e092742c002d20acc9c_20231029155526A008.png');
background-size: 100% 100%;
}
.border_class {
display: inline-block;
width: 20px;
height: 20px;
margin-top: 10px;
}
.normal-login-container {
width: 100%;
.login_menu {
font-size: 16px;
display: flex;
justify-content: space-between;
.grid-text_active {
color: #000;
font-size: 20px;
// font-weight: 555;
}
.rounded_corners {
margin-top: 0.4rem;
border-bottom: 4px solid #f3d4a8;
width: 2rem;
}
}
.logo-content {
width: 100%;
font-size: 21px;
text-align: center;
padding-top: 25%;
//height: 12rem;
//bottom: 0;
image {
border-radius: 4px;
}
.title {
margin-left: 10px;
font-size: 25px;
}
}
.login-form-content {
text-align: center;
margin: 20px auto;
margin-top: 15%;
width: 80%;
.input-item {
margin: 20px auto 0;
background-color: #f5f6f7;
height: 45px;
border-radius: 20px;
.icon {
font-size: 38 rpx;
margin-left: 10px;
color: #999;
}
.input {
width: 100%;
font-size: 14px;
line-height: 20px;
text-align: left;
padding-left: 15px;
}
}
.login-btn {
margin-top: 20px;
height: 45px;
// border-radius: 50px;
}
.login-code {
height: 45px;
.login-code-verification {
margin-top: 20px;
height: 45px;
line-height: 45px;
border: 1px #8bd70f solid;
border-radius: 20px;
color: black;
font-size: 0.9rem;
background-color: #96e811;
}
}
}
}
.text-blue {
color: #707070;
}
.disabled {
margin-top: 20px;
height: 45px;
line-height: 45px;
border: 1px #b9b9b9 solid !important;
border-radius: 20px;
color: black;
font-size: 0.75rem;
background-color: #d0d0d0 !important;
color: #57a3f3;
cursor: not-allowed;
}
</style>

@ -1,39 +1,224 @@
<script setup lang="ts">
import { useMemberStore } from '@/stores'
import { http } from '@/utils/http'
const memberStore = useMemberStore()
//
const getData = async () => {
const res = await http<string[]>({
url: '/home/banner',
method: 'GET',
})
console.log(res, 'res')
}
//
const { safeAreaInsets } = uni.getSystemInfoSync()
//
const orderTypes = [
{ type: 1, text: '待付款', icon: 'icon-currency' },
{ type: 2, text: '待发货', icon: 'icon-gift' },
{ type: 3, text: '待收货', icon: 'icon-check' },
{ type: 4, text: '已评价', icon: 'icon-comment' },
]
</script>
<template>
<view class="my">
<view>会员信息{{ memberStore.profile }}</view>
<button
@tap="
memberStore.setProfile({
nickname: '先锋',
})
"
size="mini"
plain
type="primary"
>
保存用户信息
</button>
<button @tap="memberStore.clearProfile()" size="mini" plain type="warn">清理用户信息</button>
<button @click="getData" size="mini" plain type="warn">请求测试</button>
</view>
<scroll-view class="viewport" scroll-y enable-back-to-top>
<!-- 个人资料 -->
<view class="profile" :style="{ paddingTop: safeAreaInsets!.top + 'px' }">
<!-- 情况1已登录 -->
<view class="overview" v-if="false">
<navigator url="/pagesMember/profile/profile" hover-class="none">
<image
class="avatar"
mode="aspectFill"
src="https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/uploads/avatar_3.jpg"
></image>
</navigator>
<view class="meta">
<view class="nickname"> 程序员 </view>
<navigator class="extra" url="/pagesMember/profile/profile" hover-class="none">
<text class="update">更新头像昵称</text>
</navigator>
</view>
</view>
<!-- 情况2未登录 -->
<view class="overview" v-else>
<navigator url="/pages/login/login" hover-class="none">
<image
class="avatar gray"
mode="aspectFill"
src="http://yjy-xiaotuxian-dev.oss-cn-beijing.aliyuncs.com/picture/2021-04-06/db628d42-88a7-46e7-abb8-659448c33081.png"
></image>
</navigator>
<view class="meta">
<navigator url="/pages/login/login" hover-class="none" class="nickname">
未登录
</navigator>
<view class="extra">
<text class="tips">点击登录账号</text>
</view>
</view>
</view>
<navigator class="settings" url="/pagesMember/settings/settings" hover-class="none">
设置
</navigator>
</view>
<!-- 我的订单 -->
<view class="orders">
<view class="title">
我的订单
<navigator class="navigator" url="/pagesOrder/list/list?type=0" hover-class="none">
查看全部订单<text class="icon-right"></text>
</navigator>
</view>
<view class="section">
<!-- 订单 -->
<navigator
v-for="item in orderTypes"
:key="item.type"
:class="item.icon"
:url="`/pagesOrder/list/list?type=${item.type}`"
class="navigator"
hover-class="none"
>
{{ item.text }}
</navigator>
<!-- 客服 -->
<button class="contact icon-handset" open-type="contact">售后</button>
</view>
</view>
<!-- 猜你喜欢 -->
<view class="guess">
<!-- <XtxGuess ref="guessRef" /> -->
<view> 其他信息 </view>
</view>
</scroll-view>
</template>
<style lang="scss">
//
page {
height: 100%;
overflow: hidden;
background-color: #f7f7f8;
}
.viewport {
height: 100%;
background-repeat: no-repeat;
background-image: url(https://pcapi-xiaotuxian-front-devtest.itheima.net/miniapp/images/center_bg.png);
background-size: 100% auto;
}
/* 用户信息 */
.profile {
margin-top: 20rpx;
position: relative;
.overview {
display: flex;
height: 120rpx;
padding: 0 36rpx;
color: #fff;
}
.avatar {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
background-color: #eee;
}
.gray {
filter: grayscale(100%);
}
.meta {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
line-height: 30rpx;
padding: 16rpx 0;
margin-left: 20rpx;
}
.nickname {
max-width: 350rpx;
margin-bottom: 16rpx;
font-size: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.extra {
display: flex;
font-size: 20rpx;
}
.tips {
font-size: 22rpx;
}
.update {
padding: 3rpx 10rpx 1rpx;
color: rgba(255, 255, 255, 0.8);
border: 1rpx solid rgba(255, 255, 255, 0.8);
margin-right: 10rpx;
border-radius: 30rpx;
}
.settings {
position: absolute;
bottom: 0;
right: 40rpx;
font-size: 30rpx;
color: #fff;
}
}
/* 我的订单 */
.orders {
position: relative;
z-index: 99;
padding: 30rpx;
margin: 50rpx 20rpx 0;
background-color: #fff;
border-radius: 10rpx;
box-shadow: 0 4rpx 6rpx rgba(240, 240, 240, 0.6);
.title {
height: 40rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #1e1e1e;
.navigator {
font-size: 24rpx;
color: #939393;
float: right;
}
}
.section {
width: 100%;
display: flex;
justify-content: space-between;
padding: 40rpx 20rpx 10rpx;
.navigator,
.contact {
text-align: center;
font-size: 24rpx;
color: #333;
&::before {
display: block;
font-size: 60rpx;
color: #ff9545;
}
}
.contact {
padding: 0;
margin: 0;
border: 0;
background-color: transparent;
line-height: inherit;
}
}
}
/* 猜你喜欢 */
.guess {
background-color: #f7f7f8;
margin: 20px 15px 0 15px;
}
</style>

@ -6,15 +6,15 @@ import { http } from '@/utils/http'
* -广-
* @param distributionSite 广 12 1
*/
export const getHomeBannerAPI = (distributionSite = 1) => {
return http<BannerItem[]>({
method: 'GET',
url: '/home/banner',
data: {
distributionSite,
},
})
}
// export const getHomeBannerAPI = (distributionSite = 1) => {
// return http<BannerItem[]>({
// method: 'GET',
// url: '/home/banner',
// data: {
// distributionSite,
// },
// })
// }
// 查询车型
export const queryList = () => {
@ -23,11 +23,75 @@ export const queryList = () => {
url: '/system/vehicleDic/queryList',
})
}
/**
* -
* @param data
*/
export function memberVehicle(data: any) {
return http({
method: 'GET',
url: '/system/vehicle/memberVehicle',
data,
})
}
// 查询车型
// export function queryList() {
// return requests({
// method: 'get',
// url: "/system/vehicleDic/queryList"
// })
// }
/**
* -
* @param data
*/
export function userAppointed(data: any) {
return http({
method: 'GET',
url: '/order/appoint/userAppointed',
data,
})
}
/**
*
* @param data
* @returns {*}
*/
export function updStatus(data: any) {
return http({
method: 'GET',
url: '/order/appoint/DriverAgree',
data: data,
})
}
/**
*
* @param data
* @returns {*}
*/
export function updStatusRefuse(data: any) {
return http({
method: 'GET',
url: '/order/appoint/DriverReject',
data: data,
})
}
export const loginUser = (data: any) => {
// 如果index是1 就是登录/找回密码
return http({
method: 'GET',
url: '/auth/weiXin/login',
data,
})
}
// 获取验证码
export const loginSmsCode = (username: any, index: any, password: any) => {
// 如果index是1 就是登录/找回密码
return http({
method: 'GET',
url: '/auth/mobile/smsCode',
data: {
account: username,
type: index,
password: password,
},
})
}

@ -0,0 +1,90 @@
@font-face {
font-family: "iconfont";
src: url('@/static/font/iconfont.ttf') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
display: inline-block;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-user:before {
content: "\e7ae";
}
.icon-password:before {
content: "\e8b2";
}
.icon-code:before {
content: "\e699";
}
.icon-setting:before {
content: "\e6cc";
}
.icon-share:before {
content: "\e739";
}
.icon-edit:before {
content: "\e60c";
}
.icon-version:before {
content: "\e63f";
}
.icon-service:before {
content: "\e6ff";
}
.icon-friendfill:before {
content: "\e726";
}
.icon-community:before {
content: "\e741";
}
.icon-people:before {
content: "\e736";
}
.icon-dianzan:before {
content: "\ec7f";
}
.icon-right:before {
content: "\e7eb";
}
.icon-logout:before {
content: "\e61d";
}
.icon-help:before {
content: "\e616";
}
.icon-github:before {
content: "\e628";
}
.icon-aixin:before {
content: "\e601";
}
.icon-clean:before {
content: "\e607";
}
.icon-refresh:before {
content: "\e604";
}

Binary file not shown.

@ -0,0 +1,33 @@
@font-face {
font-family: "iconfont";
src: url('/static/iconfont.ttf') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-icon:before {
content: "\e658";
}
.icon-h:before {
content: "\e819";
}
.icon-tuichu:before {
content: "\e60d";
}
.icon-tuichu1:before {
content: "\e6b6";
}
.icon-jine:before {
content: "\e84f";
}

Binary file not shown.

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="shortcut icon" type="image/x-icon" href="<%= BASE_URL %>pageOthers/static/favicon.ico">
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
</head>
<body>
<noscript>
<strong>本站点必须要开启JavaScript才能运行.</strong>
</noscript>
<div id="app"></div>
</html>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,90 @@
.text-center {
text-align: center;
}
.font-13 {
font-size: 13px;
}
.font-12 {
font-size: 12px;
}
.font-11 {
font-size: 11px;
}
.text-grey1 {
color: #888;
}
.text-grey2 {
color: #aaa;
}
.list-cell-arrow::before {
content: ' ';
height: 10px;
width: 10px;
border-width: 2px 2px 0 0;
border-color: #c0c0c0;
border-style: solid;
-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
position: absolute;
top: 50%;
margin-top: -6px;
right: 30rpx;
}
.list-cell {
position: relative;
width: 100%;
box-sizing: border-box;
background-color: #fff;
color: #333;
padding: 26rpx 30rpx;
}
.list-cell:first-child {
border-radius: 8rpx 8rpx 0 0;
}
.list-cell:last-child {
border-radius: 0 0 8rpx 8rpx;
}
.list-cell::after {
content: '';
position: absolute;
border-bottom: 1px solid #eaeef1;
-webkit-transform: scaleY(0.5) translateZ(0);
transform: scaleY(0.5) translateZ(0);
transform-origin: 0 100%;
bottom: 0;
right: 0;
left: 0;
pointer-events: none;
}
.menu-list {
margin: 15px 15px;
.menu-item-box {
width: 100%;
display: flex;
align-items: center;
.menu-icon {
color: #007AFF;
font-size: 16px;
margin-right: 5px;
}
.text-right {
margin-left: auto;
margin-right: 34rpx;
color: #999;
}
}
}

@ -0,0 +1,6 @@
/* global */
@import "./global.scss";
/* color-ui */
@import "@/static/scss/colorui.css";
/* iconfont */
@import "@/static/font/iconfont.css";

@ -0,0 +1,19 @@
/** 封装通用信息 */
type BaseProfile = {
/** 用户ID */
id: number
/** 头像 */
avatar: string
/** 账户名 */
account: string
/** 昵称 */
nickname?: string
}
/** 小程序登录 登录用户信息 */
export type LoginResult = BaseProfile & {
/** 手机号 */
mobile: string
/** 登录凭证 */
token: string
}

@ -0,0 +1,28 @@
// 解密文件
// 解密数据
import { ENV } from '@/utils/env'
import CryptoJS from 'crypto-js'
/**
*
* @param data
* @returns {string}
*/
// 解密 文件
// 十六位十六进制数作为密钥
const SECRET_KEY = CryptoJS.enc.Utf8.parse('51841198448000058485')
// 十六位十六进制数作为密钥偏移量
const SECRET_IV = CryptoJS.enc.Utf8.parse('12388922426123465154')
export function decrypt(data: any) {
const encryptedHexStr = CryptoJS.enc.Hex.parse(data)
const str = CryptoJS.enc.Base64.stringify(encryptedHexStr)
const decrypt = CryptoJS.AES.decrypt(str, SECRET_KEY, {
iv: SECRET_IV,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7,
})
const decryptedStr = decrypt.toString(CryptoJS.enc.Utf8)
return decryptedStr.toString()
}

@ -23,7 +23,7 @@ const httpInterceptor = {
const memberStore = useMemberStore()
const token = memberStore.profile?.token
if (token) {
options.header.Authorization = token
options.header.Authorization = 'Bearer ' + token // 让每个请求携带自定义token 请根据实际情况自行修改
}
},
}

Loading…
Cancel
Save