修改
17
pages.json
@ -4,6 +4,14 @@
|
||||
},
|
||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||
{
|
||||
"path": "pages/Personal/Personal",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},{
|
||||
"path": "pages/startup/startup",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
@ -124,14 +132,7 @@
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "pages/Personal/Personal",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
|
||||
177
pages/Personal/Personal.scss
Normal file
@ -0,0 +1,177 @@
|
||||
.app {
|
||||
font-size: 35rpx;
|
||||
padding: 0 0 200rpx 0;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
.service {
|
||||
position: absolute;
|
||||
top:985rpx;
|
||||
left:2%;
|
||||
width: 96%;
|
||||
height: 100rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0,0,0,0.03);
|
||||
border-radius: 10rpx;
|
||||
image {
|
||||
width: 13rpx;
|
||||
height: 23rpx;
|
||||
position: absolute;
|
||||
right:40rpx;
|
||||
top:50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.serviceorder {
|
||||
font-size: 32rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
position: absolute;
|
||||
left: 31rpx;
|
||||
}
|
||||
}
|
||||
.content {
|
||||
position: absolute;
|
||||
top:670rpx;
|
||||
left:2%;
|
||||
width: 96%;
|
||||
height: 300rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0,0,0,0.03);
|
||||
border-radius: 10rpx;
|
||||
.center {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding-top: 50rpx;
|
||||
.OrderStatus {
|
||||
position: relative;
|
||||
height: 180rpx;
|
||||
width: 25%;
|
||||
.title{
|
||||
position: absolute;
|
||||
top: 80rpx;
|
||||
width:100%;
|
||||
left:50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
image {
|
||||
width: 71rpx;
|
||||
height: 63rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.orderCount {
|
||||
background-color: red;
|
||||
color: #FFFFFF;
|
||||
border-radius: 50%;
|
||||
// padding: 0 5rpx ;
|
||||
line-height: 30rpx;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
font-size: 18rpx;
|
||||
// display: inline-block;
|
||||
position: absolute;
|
||||
top: -20rpx;
|
||||
right: 35rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.CommodityOrder {
|
||||
font-size: 32rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
position: relative;
|
||||
.title{
|
||||
position: absolute;
|
||||
left: 31rpx;
|
||||
}
|
||||
.text{
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
font-size: 26rpx;
|
||||
color: #969494;
|
||||
image{
|
||||
position: absolute;
|
||||
top:50%;
|
||||
transform: translateY(-50%);
|
||||
padding-left: 10rpx;
|
||||
width: 13rpx;
|
||||
height: 23rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.userinfo{
|
||||
position: absolute;
|
||||
top:420rpx;
|
||||
left:2%;
|
||||
display: flex;
|
||||
width: 96%;
|
||||
height: 220rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101,176,249,0.41);
|
||||
.item{
|
||||
width: 33%;
|
||||
height: 100%;
|
||||
padding-top: 40rpx;
|
||||
.text{
|
||||
font-size: 30rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
image{
|
||||
// margin-left: 50%;
|
||||
// transform: translateX(-50%);
|
||||
width: 85rpx;
|
||||
height: 74rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.user {
|
||||
width: 100%;
|
||||
height: 550rpx;
|
||||
position: relative;
|
||||
color: #FFFFFF;
|
||||
font-size: 39rpx;
|
||||
.modify {
|
||||
position: absolute;
|
||||
right: 3%;
|
||||
top:220rpx;
|
||||
font-size:28rpx;
|
||||
image{
|
||||
width: 23rpx;
|
||||
height: 23rpx;
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.nickname {
|
||||
position: absolute;
|
||||
top: 265rpx;
|
||||
left: 35%;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.phone {
|
||||
position: absolute;
|
||||
top: 200rpx;
|
||||
left: 35%;
|
||||
}
|
||||
.bjimg{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.img {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
border-radius: 50%;
|
||||
background: #F6F6F6;
|
||||
position: absolute;
|
||||
top: 180rpx;
|
||||
left: 8%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,164 +1,261 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<view class="item" @tap='gouser'>
|
||||
<image src="../../static/user.png" mode=""></image>
|
||||
<view class="title">
|
||||
个人信息
|
||||
<view class="user">
|
||||
<image v-if="appPersonallist.headPictureUrl" class="img" :src="baseurl+appPersonallist.headPictureUrl"
|
||||
mode=""></image>
|
||||
<image class="img" v-else src="../../static/user.png" mode=""></image>
|
||||
<image class="bjimg" src="../../static/userbeijing.png" mode=""></image>
|
||||
<view class="phone" v-if="appPersonallist.patientName">
|
||||
{{appPersonallist.patientName}}
|
||||
</view>
|
||||
<view class="nickname">
|
||||
{{appPersonallist.phone}}
|
||||
</view>
|
||||
<view class="modify" @tap='updatainfo()'>
|
||||
修改信息
|
||||
<image src="../../static/xg.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class=" item" @tap='goorder'>
|
||||
<image src="../../static/dingdan.png" mode=""></image>
|
||||
<view class="title">
|
||||
我的订单
|
||||
<view class="userinfo">
|
||||
<view class="item">
|
||||
<image src="../../static/jkda.png" mode=""></image>
|
||||
<view class="text">
|
||||
健康档案
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<image src="../../static/jifen.png" mode=""></image>
|
||||
<view class="text">
|
||||
积分
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<image src="../../static/yhj.png" mode=""></image>
|
||||
<view class="text">
|
||||
优惠卷
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="CommodityOrder" @tap="goorder">
|
||||
<view class="title">
|
||||
商品订单
|
||||
</view>
|
||||
<view class="text">
|
||||
查看全部
|
||||
<image src="../../static/huijiantou.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="center">
|
||||
<view class="OrderStatus" @tap="gopaid('WAIT_PAY')">
|
||||
<image src="/static/Tobepaid.png" mode=""></image>
|
||||
<view class="title">待付款</view>
|
||||
<view class="orderCount" v-if="list.waitPayCount>0&&list.waitPayCount<100">
|
||||
{{list.waitPayCount}}
|
||||
</view>
|
||||
<view class="orderCount" style="font-size :14rpx;" v-if="list.waitPayCount>=100">
|
||||
99+
|
||||
</view>
|
||||
</view>
|
||||
<view class="OrderStatus" @tap="goreceive('WAIT_RECEIVED_GOODS')">
|
||||
<image src="/static/received.png" mode=""></image>
|
||||
<view class="title">待收货</view>
|
||||
<view class="orderCount" v-if="list.waitReceivedGoodsCount>0&&list.waitReceivedGoodsCount<100">
|
||||
{{list.waitReceivedGoodsCount}}
|
||||
</view>
|
||||
<view class="orderCount" style="font-size :14rpx;" v-if="list.waitReceivedGoodsCount>=100">
|
||||
99+
|
||||
</view>
|
||||
</view>
|
||||
<view class="OrderStatus" @tap="gocompleted('RECEIVED_GOODS')">
|
||||
<image src="/static/evaluated.png" mode=""></image>
|
||||
<view class="title">待评价</view>
|
||||
<view class="orderCount" v-if="list.receivedGoodsCount>0&&list.receivedGoodsCount<100">
|
||||
{{list.receivedGoodsCount}}
|
||||
</view>
|
||||
<view class="orderCount" style="font-size :14rpx;" v-if="list.receivedGoodsCount>=100">
|
||||
99+
|
||||
</view>
|
||||
</view>
|
||||
<view class="OrderStatus" @tap="goEVALUATED('EVALUATED')">
|
||||
<image src="/static/finished.png" mode=""></image>
|
||||
<view class="title">已完成</view>
|
||||
<!-- <view class="orderCount" v-if="list.evaluatedCount>0&&list.evaluatedCount<100">
|
||||
{{list.evaluatedCount}}
|
||||
</view>
|
||||
<view class="orderCount" v-if="list.evaluatedCount>=100">
|
||||
99+
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="service" @tap="gonursestation">
|
||||
<view class="serviceorder">护理站服务订单</view>
|
||||
<image src="../../static/huijiantou.png" mode=""></image>
|
||||
</view>
|
||||
<view class="service" style="top:1100rpx">
|
||||
<view class="serviceorder">设置</view>
|
||||
<image src="../../static/huijiantou.png" mode=""></image>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
appPersonal,
|
||||
} from '@/api/user/user.js';
|
||||
import {
|
||||
existPatientInfo
|
||||
} from '@/api/startup/index.js'
|
||||
import {
|
||||
orderCount
|
||||
} from '@/api/order/index.js'
|
||||
import baseurl from '@/api/baseurl.js'
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
baseurl: '',
|
||||
appPersonallist: [], //获取个人信息
|
||||
timer: null,
|
||||
list: {},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
var that = this
|
||||
try {
|
||||
const value = uni.getStorageSync('openid');
|
||||
const value3 = uni.getStorageSync('token');
|
||||
if (value && value3) {
|
||||
const value2 = uni.getStorageSync('patientId');
|
||||
if (value2) {} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
uni.navigateTo({
|
||||
onShow() {
|
||||
let that = this
|
||||
this.baseurl = baseurl
|
||||
this.myInfo()
|
||||
const value = uni.getStorageSync('patientId');
|
||||
if (value) {
|
||||
orderCount(value).then(res => {
|
||||
this.list = res.data
|
||||
})
|
||||
} else {
|
||||
that.$refs.uToast.show({
|
||||
title: '请登录',
|
||||
type: 'error',
|
||||
duration: '1000',
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(options) {},
|
||||
methods: {
|
||||
goorder() {
|
||||
var that = this
|
||||
try {
|
||||
const value = uni.getStorageSync('openid');
|
||||
const value3 = uni.getStorageSync('token');
|
||||
var that = this
|
||||
if (value && value3) {
|
||||
existPatientInfo(value).then(res => {
|
||||
if (res.code == 200 && res.msg == 'LOGIN') {
|
||||
const value2 = uni.getStorageSync('patientId');
|
||||
if (value2) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/order'
|
||||
})
|
||||
} else {
|
||||
that.remove()
|
||||
}
|
||||
} else {
|
||||
that.remove()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.remove()
|
||||
}
|
||||
} catch {
|
||||
that.remove()
|
||||
}
|
||||
},
|
||||
//跳转个人信息页面
|
||||
gouser() {
|
||||
try {
|
||||
const value = uni.getStorageSync('openid');
|
||||
const value3 = uni.getStorageSync('token');
|
||||
var that = this
|
||||
if (value && value3) {
|
||||
existPatientInfo(value).then(res => {
|
||||
if (res.code == 200 && res.msg == 'LOGIN') {
|
||||
const value2 = uni.getStorageSync('patientId');
|
||||
if (value2) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/user'
|
||||
})
|
||||
} else {
|
||||
that.remove()
|
||||
}
|
||||
} else {
|
||||
that.remove()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.remove()
|
||||
}
|
||||
} catch {
|
||||
that.remove()
|
||||
}
|
||||
},
|
||||
remove() {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认要退出此账号吗',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.removeStorageSync('patientId');
|
||||
uni.removeStorageSync('openid');
|
||||
uni.removeStorageSync('phone');
|
||||
uni.removeStorageSync('token');
|
||||
that.$refs.uToast.show({
|
||||
title: '退出账号成功',
|
||||
type: 'success',
|
||||
duration: '1000'
|
||||
})
|
||||
if (that.timer) {
|
||||
clearTimeout(that.timer)
|
||||
}
|
||||
that.timer = setTimeout(e => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1000)
|
||||
} else if (res.cancel) {
|
||||
that.$refs.uToast.show({
|
||||
title: '退出账号失败',
|
||||
type: 'error',
|
||||
duration: '1000'
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
removes() {
|
||||
uni.removeStorageSync('patientId');
|
||||
uni.removeStorageSync('openid');
|
||||
uni.removeStorageSync('phone');
|
||||
uni.removeStorageSync('Refresh');
|
||||
uni.removeStorageSync('token');
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
},
|
||||
//获取个人信息
|
||||
myInfo() {
|
||||
var that = this
|
||||
const value = uni.getStorageSync('openid');
|
||||
const value2 = uni.getStorageSync('patientId');
|
||||
if (value && value2) {
|
||||
existPatientInfo(value).then(res => {
|
||||
if (res.code == 200 && res.msg == 'LOGIN') {
|
||||
appPersonal(value2).then(Response => {
|
||||
if (Response.code == 200) {
|
||||
that.appPersonallist = Response.data
|
||||
that.appPersonallist.homeLatitude = Number(that.appPersonallist
|
||||
.homeLatitude)
|
||||
that.appPersonallist.homeLongitude = Number(that.appPersonallist
|
||||
.homeLongitude)
|
||||
} else if (Response.code == 9999) {} else {
|
||||
that.removes();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.removes();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.removes();
|
||||
}
|
||||
},
|
||||
updatainfo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
url: `/pages/modify/modify`
|
||||
})
|
||||
},
|
||||
//护理站服务订单
|
||||
gonursestation() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/Nursingstationserviceorder/Nursingstationserviceorder'
|
||||
})
|
||||
},
|
||||
//待收货
|
||||
goreceive(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/CommodityOrder/CommodityOrder?orderStatus=${item}`
|
||||
})
|
||||
},
|
||||
//全部订单
|
||||
goorder() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/CommodityOrder/CommodityOrder'
|
||||
})
|
||||
},
|
||||
//已完成
|
||||
goEVALUATED(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/CommodityOrder/CommodityOrder?orderStatus=${item}`
|
||||
})
|
||||
},
|
||||
//待评价
|
||||
gocompleted(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/CommodityOrder/CommodityOrder?orderStatus=${item}`
|
||||
})
|
||||
},
|
||||
//待付款
|
||||
gopaid(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/CommodityOrder/CommodityOrder?orderStatus=${item}`
|
||||
})
|
||||
},
|
||||
},
|
||||
//1.分享给朋友
|
||||
onShareAppMessage(res) {
|
||||
let pages = getCurrentPages();
|
||||
let url = pages[pages.length - 1].$page.fullPath
|
||||
return {
|
||||
title: '泉医到家',
|
||||
path: url,
|
||||
}
|
||||
},
|
||||
//2.分享到朋友圈
|
||||
onShareTimeline(res) {
|
||||
let pages = getCurrentPages();
|
||||
let url = pages[pages.length - 1].$page.fullPath
|
||||
return {
|
||||
title: '泉医到家',
|
||||
path: url,
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.app {
|
||||
padding: 0;
|
||||
.item {
|
||||
width: 94%;
|
||||
margin: 20rpx auto 0;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
height: 100rpx;
|
||||
border-radius: 5rpx;
|
||||
.title {
|
||||
position: absolute;
|
||||
left: 150rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
font-size: 44rpx;
|
||||
}
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
left: 40rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 55rpx;
|
||||
height: 55rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@import "./Personal.scss";
|
||||
</style>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
static/jifen.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
static/jkda.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
static/user.png
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
static/userbeijing.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
static/xg.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
static/yhj.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |