123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430 |
- <template>
- <!-- :class="{noVip : noVip}" -->
- <view class="my-box">
- <!-- <u-navbar leftIcon=" " titleStyle="font-size:36rpx;line-height: 36rpx;font-weight:bold;"
- :bgColor="noVip ? '#fff' : '#FACA2E'" title="我的" placeholder="">
- </u-navbar> -->
- <view class="user-top-box">
- <view class="user-info-box">
- <view class="info-box-l">
- <view class="img-box">
- <u-avatar :src="userInfo.avatar || ''" size="121rpx" mode="aspectFill"></u-avatar>
- </view>
- <view class="info-r">
- <span class="name" v-if="isLogin" @click="toUserInfo">{{userInfo.nickname || '-'}}</span>
- <span class="name" v-else @click="toLogin">登录/注册</span>
- </view>
- </view>
- </view>
- </view>
- <view class="func-box">
- <view class="func-item" @click="toPath('/pages/mine/patient/patient')">
- <view class="func-item-l">
- <image class="icon" src="/static/my/icon-01.png" mode="aspectFill"></image>
- <span class="name">就诊人信息</span>
- </view>
- <view class="func-item-r">
- <image class="icon" src="/static/my/right.png" mode="aspectFill"></image>
- </view>
- </view>
- <view class="func-item">
- <button open-type="contact" class="btn">
- <view class="func-item-l">
- <image class="icon" src="/static/my/icon-02.png" mode="aspectFill"></image>
- <span class="name">微信客服</span>
- </view>
- <view class="func-item-r">
- <image class="icon" src="/static/my/right.png" mode="aspectFill"></image>
- </view>
- </button>
- </view>
- <view class="func-item" @click="toPath('/pages/mine/helpCenter')">
- <view class="func-item-l">
- <image class="icon" src="/static/my/icon-03.png" mode="aspectFill"></image>
- <span class="name">帮助中心</span>
- </view>
- <view class="func-item-r">
- <image class="icon" src="/static/my/right.png" mode="aspectFill"></image>
- </view>
- </view>
- <view class="func-item" @click="toPath('/pages/mine/agreement?type=user_protocol')">
- <view class="func-item-l">
- <image class="icon" src="/static/my/icon-04.png" mode="aspectFill"></image>
- <span class="name">用户协议</span>
- </view>
- <view class="func-item-r">
- <image class="icon" src="/static/my/right.png" mode="aspectFill"></image>
- </view>
- </view>
- </view>
- <view class="logout-btn" v-if="isLogin">
- <span class="btn" @click="logOut">退出登录</span>
- </view>
- </view>
- </template>
- <script>
- import {
- UserInfo
- } from "@/utils/tools.js"
- export default {
- data() {
- return {
- // defaultImg: this.getImgSrc('shop/pro.jpg'),
- // more3: this.getImgSrc('my/more_3.png'),
- userInfo: {},
- funcList: [
- // {
- // icon: this.getImgSrc('my/icon-1.png'),
- // name: '会员礼包',
- // },
- // {
- // icon: this.getImgSrc('my/icon-2.png'),
- // name: '会员折扣',
- // },
- // {
- // icon: this.getImgSrc('my/icon-3.png'),
- // name: '极速派单',
- // },
- // {
- // icon: this.getImgSrc('my/icon-4.png'),
- // name: '专属客服',
- // },
- ],
- // bgImg: this.getImgSrc('my/bg-b.png'),
- // bgImg2: this.getImgSrc('my/bg-s.png'),
- // bgImg3: this.getImgSrc('my/w-bg.png'),
- noVip: false,
- isWork: false,
- accountBalance: '',
- isLogin: false,
- // text: '无头像'
- };
- },
- onLoad() {
- // if (this.$util.getStorageKey('accessToken')) {
- // this.isLogin = true;
- // }
- // uni.$on('login', () => {
- // this.isLogin = false;
- // this.init();
- // })
- },
- onUnload() {
- // 移除监听事件
- uni.$off('login');
- },
- onShow() {
- this.$nextTick(() => {
- this.init();
- })
- },
- methods: {
- //初始化
- init() {
- this.getUser();
- // this.getStoreUserInfo();
- },
- toPath(path) {
- uni.setStorageSync('patientType', 'mine')
- uni.navigateTo({
- url: path
- })
- },
- toLogin() {
- uni.navigateTo({
- url: '/pages/login/index'
- })
- },
- logOut() {
- uni.showModal({
- title: '提示',
- content: '确认是否退出?',
- success: (e) => {
- if (e.confirm) {
- uni.showLoading({
- title: '退出中'
- });
- uni.removeStorageSync('apiToken')
- uni.removeStorageSync('userInfo')
- setTimeout(() => {
- uni.reLaunch({
- url: '/pages/tabBar/index'
- })
- }, 1000);
- }
- }
- });
- },
- toPage(path) {
- if (!path) {
- uni.$u.toast('暂未开放,敬请期待');
- return
- }
- if (path == '/pages/address/list') {
- this.$util.setStorageKey('addressType', 'my')
- }
- uni.navigateTo({
- url: path
- })
- },
- toMember() {
- uni.navigateTo({
- url: '/pages/user/member'
- })
- },
- toApply() {
- uni.switchTab({
- url: '/pages/tabBar/case'
- })
- },
- toOrderList(item) {
- if (item.value != '100') {
- uni.navigateTo({
- url: `/pages/mineOrders/list?type=${item.value}`
- })
- } else {
- uni.$u.toast('暂未开放,敬请期待');
- }
- },
- toAllOrder() {
- uni.navigateTo({
- url: '/pages/mineOrders/list'
- })
- },
- toUserInfo() {
- if (this.isLogin) {
- uni.navigateTo({
- url: '/pages/user/info'
- })
- } else {
- uni.navigateTo({
- url: '/pages/login/quickLogin'
- })
- }
- },
- onPullDownRefresh() {
- console.log('下拉刷新回调函数');
- this.init();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- //查询门店账户余额
- // getStoreUserInfo() {
- // let that = this;
- // that.$http
- // .get(`/api/storeUserAccount/info/${that.$util.getStorageKey('storeInfo').id}`)
- // .then((res) => {
- // let data = res.data;
- // if (data) {
- // this.accountBalance = data.accountBalance;
- // }
- // })
- // .catch((err) => {});
- // },
- // 获取用户信息
- async getUser() {
- UserInfo().then(res => {
- this.userInfo = res;
- if (this.userInfo) {
- this.isLogin = true;
- } else {
- this.isLogin = false;
- }
- }).finally(() => {
- uni.stopPullDownRefresh();
- })
- // this.noVip = this.userInfo.type == 0 ? true : false;
- },
- // 跳转会员
- jumpMember() {
- uni.navigateTo({
- url: '/pages/handleMember/memberPage',
- });
- },
- //去充值页面
- toVoucher() {
- uni.navigateTo({
- url: '/pages/voucherCenter/voucher',
- });
- },
- //下拉刷新回调函数
- onPullDownRefresh() {
- // wx.setStorageSync('isChangeBanner', true);
- this.init();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .my-box {
- display: flex;
- flex-direction: column;
- background-color: #fff;
- min-height: 100%;
- overflow: hidden;
- padding: 0 30rpx;
- .user-top-box {
- display: flex;
- flex-direction: column;
- padding: 50rpx 0;
- // background-color: #046EB8;
- .user-info-box {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .info-box-l {
- display: flex;
- align-items: center;
- .info-r {
- display: flex;
- flex-direction: column;
- margin-left: 25rpx;
- .name {
- display: inline-flex;
- font-size: 36rpx;
- // margin-top: 21rpx;
- height: 36rpx;
- line-height: 36rpx;
- justify-content: center;
- // background-color: #FFF9D9;
- // color: #B16E55;
- // border-radius: 50rpx;
- }
- }
- }
- .info-box-r {
- display: flex;
- align-items: center;
- border-top-left-radius: 50rpx;
- border-bottom-left-radius: 50rpx;
- // background-color: #055B96;
- height: 60rpx;
- padding-left: 40rpx;
- .txt {
- font-size: 26rpx;
- // font-weight: bold;
- }
- image {
- width: 25rpx;
- height: 25rpx;
- margin: 0 20rpx
- }
- }
- }
- }
- .func-box {
- padding: 30rpx 0;
- box-shadow: 10rpx 5rpx 20rpx #f1f1f1;
- border-radius: 20rpx;
- .func-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin: 0 20rpx;
- height: 100rpx;
- border-bottom: 1rpx solid #F1F1F1;
- &:last-child {
- border-bottom: none;
- }
- .func-item-l {
- display: flex;
- align-items: center;
- .icon {
- width: 40rpx;
- height: 40rpx;
- margin-right: 20rpx;
- }
- .name {
- font-size: 30rpx;
- }
- }
- .func-item-r {
- display: flex;
- align-items: center;
- .icon {
- width: 14rpx;
- height: 22rpx;
- }
- }
- button {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- border: none;
- margin: 0;
- padding: 0;
- outline: none;
- border-radius: 0;
- background-color: transparent;
- line-height: normal;
- font-size: 30rpx;
- color: #1a1a1a;
- }
- button::after {
- border: none;
- }
- }
- }
- .logout-btn {
- .btn {
- display: block;
- width: 690rpx;
- height: 91rpx;
- line-height: 91rpx;
- color: #FF0F0F;
- font-size: 32rpx;
- border-radius: 45rpx;
- margin: 0 auto;
- margin-top: 63rpx;
- border: 1rpx solid #FF0000;
- text-align: center;
- }
- }
- }
- </style>
|