|
@@ -12,15 +12,23 @@
|
|
|
|
|
|
<view class="card">
|
|
|
<view class="card-left">
|
|
|
- <img class="avatar" src="/static/img/ic-buy.png" alt="用户头像">
|
|
|
- <view class="username">老番茄333 <image src="/static/img/ic-code.png" class="code"></image>
|
|
|
+ <view class="name" v-if="!isLogin" @tap="openAuto">
|
|
|
+ <img class="avatar" src="/static/img/ic-buy.png" alt="默认头像">
|
|
|
+ <view class="username">请点击登录</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="phone-info">
|
|
|
- <text>绑定手机号:185-7033-6037</text>
|
|
|
- <image src="/static/img/ic-copy.png">
|
|
|
- </image>
|
|
|
- </view>
|
|
|
+ <template v-else>
|
|
|
+ <img class="avatar" src="/static/img/ic-buy.png" alt="用户头像">
|
|
|
+ <view class="username">老番茄333 <image src="/static/img/ic-code.png" class="code"></image>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="phone-info">
|
|
|
+ <text>绑定手机号:185-7033-6037</text>
|
|
|
+ <image src="/static/img/ic-copy.png">
|
|
|
+ </image>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+
|
|
|
</view>
|
|
|
|
|
|
<view class="card-right">
|
|
@@ -29,7 +37,7 @@
|
|
|
<img class="content-icon" src="/static/img/ic-tickets.png" alt="我的票劵">
|
|
|
<view class="content-text1">我的票劵</view>
|
|
|
</view>
|
|
|
- <view class="content-item">
|
|
|
+ <view class="content-item" @click="menusTap('/pages/goods/order_list/index')">
|
|
|
<img class="content-icon" src="/static/img/ic-order.png" alt="我的订单">
|
|
|
<view class="content-text2">我的订单</view>
|
|
|
</view>
|
|
@@ -47,18 +55,20 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="item-settled">
|
|
|
- <image src="/static/img/ic-settled-left.png" style="width: 350rpx;height: 116rpx;"></image>
|
|
|
+ <image @tap="menusTap('/pages/users/settled/index')" src="/static/img/ic-settled-left.png"
|
|
|
+ style="width: 350rpx;height: 116rpx;"></image>
|
|
|
|
|
|
<image src="/static/img/ic-bg-line.png" style="width: 4rpx;height: 154rpx;margin: 0 20rpx;"></image>
|
|
|
|
|
|
- <image src="/static/img/ic-settled-right.png" style="width: 350rpx;height: 116rpx;"></image>
|
|
|
+ <image @tap="menusTap('')" src="/static/img/ic-settled-right.png"
|
|
|
+ style="width: 350rpx;height: 116rpx;"></image>
|
|
|
</view>
|
|
|
|
|
|
- <view class="item-features">
|
|
|
+ <view class="item-features" v-if="isLogin">
|
|
|
<view class="item-features-title">我的功能</view>
|
|
|
<div class="grid-container">
|
|
|
<!-- 示例:12 个格子(3行x4列) -->
|
|
|
- <div class="grid-item" v-for="item in featuresList" :key="item.id">
|
|
|
+ <div class="grid-item" v-for="item in featuresList" :key="item.id" @click="menusTap(item.url)">
|
|
|
<img class="grid-img" :src="item.icon">
|
|
|
<div class="grid-text">{{item.text}}</div>
|
|
|
</div>
|
|
@@ -73,7 +83,18 @@
|
|
|
<script>
|
|
|
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
|
|
let app = getApp();
|
|
|
+ import Cache from '@/utils/cache';
|
|
|
+ import {
|
|
|
+ toLogin
|
|
|
+ } from '@/libs/login.js';
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from "vuex";
|
|
|
+ import {
|
|
|
+ BACK_URL
|
|
|
+ } from '@/config/cache';
|
|
|
export default {
|
|
|
+ computed: mapGetters(['isLogin']),
|
|
|
data() {
|
|
|
return {
|
|
|
statusBarHeight: app.globalData.statusBarHeight,
|
|
@@ -81,52 +102,62 @@
|
|
|
featuresList: [{
|
|
|
id: 1,
|
|
|
icon: '/static/img/ic-express.png',
|
|
|
- text: '我的快递'
|
|
|
+ text: '我的快递',
|
|
|
+ url: ''
|
|
|
},
|
|
|
{
|
|
|
id: 2,
|
|
|
icon: '/static/img/ic-address.png',
|
|
|
- text: '通用地址'
|
|
|
+ text: '通用地址',
|
|
|
+ url: '/pages/address/user_address_list/index'
|
|
|
},
|
|
|
{
|
|
|
id: 3,
|
|
|
icon: '/static/img/ic-comments.png',
|
|
|
- text: '我的评论'
|
|
|
+ text: '我的评论',
|
|
|
+ url: ''
|
|
|
},
|
|
|
{
|
|
|
id: 4,
|
|
|
icon: '/static/img/ic-collection.png',
|
|
|
- text: '我的收藏'
|
|
|
+ text: '我的收藏',
|
|
|
+ url: '/pages/goods/user_goods_collection/index'
|
|
|
},
|
|
|
{
|
|
|
id: 5,
|
|
|
icon: '/static/img/ic-buy.png',
|
|
|
- text: '我的团购'
|
|
|
+ text: '我的团购',
|
|
|
+ url: ''
|
|
|
},
|
|
|
{
|
|
|
id: 6,
|
|
|
icon: '/static/img/ic-vouchers.png',
|
|
|
- text: '我的卡券'
|
|
|
+ text: '我的卡券',
|
|
|
+ url: '/pages/users/user_coupon/index'
|
|
|
},
|
|
|
{
|
|
|
id: 7,
|
|
|
icon: '/static/img/ic-distribution.png',
|
|
|
- text: '我的分销'
|
|
|
+ text: '我的分销',
|
|
|
+ url: '/pages/users/user_spread_user/index'
|
|
|
},
|
|
|
{
|
|
|
id: 8,
|
|
|
icon: '/static/img/ic-friend.png',
|
|
|
- text: '邀请好友'
|
|
|
+ text: '邀请好友',
|
|
|
+ url: ''
|
|
|
},
|
|
|
{
|
|
|
id: 9,
|
|
|
icon: '/static/img/ic-feedback.png',
|
|
|
- text: '帮助反馈'
|
|
|
+ text: '帮助反馈',
|
|
|
+ url: ''
|
|
|
},
|
|
|
{
|
|
|
id: 10,
|
|
|
icon: '/static/img/ic-security-settings.png',
|
|
|
- text: '安全设置'
|
|
|
+ text: '安全设置',
|
|
|
+ url: ''
|
|
|
}
|
|
|
],
|
|
|
}
|
|
@@ -144,7 +175,21 @@
|
|
|
// #endif
|
|
|
|
|
|
},
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ menusTap(url) {
|
|
|
+ if (!this.isLogin) {
|
|
|
+ this.openAuto();
|
|
|
+ } else {
|
|
|
+ if (url === '') return
|
|
|
+ this.$util.navigateTo(url);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 打开授权
|
|
|
+ openAuto() {
|
|
|
+ Cache.set(BACK_URL, '')
|
|
|
+ toLogin();
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|