123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <template>
- <view class="pages">
- <view class="" :style="{height: navHeight+'px' }"></view>
- <view class="page-bg">
- <img class="img" :src="staticUrl+'/img/center-index-bg.png'" alt="">
- </view>
- <view class="base-info page-wrap u-flex u-row-between">
- <view class="left u-flex">
- <u-avatar :src="avatar||staticUrl+'/img/avatar.png'" size="110rpx"></u-avatar>
- <view class="info">
- <view class="name ellipsis-1">{{vuex_member_info.name}}</view>
- <view class="level u-flex">
- <u-icon :name="staticUrl+'/img/level-01.png'" color="#333333" size="30rpx"></u-icon>
- <text class="level-name">{{vuex_member_info.levelName}}</text>
- </view>
- </view>
- </view>
- <u-icon @click="$u.route('/center/memberinfo',{type:'redirectTo'})" name="setting-fill" color="#333333" size="38rpx"></u-icon>
- </view>
- <view class="property page-wrap u-flex u-row-between">
- <view class="property-item" @click="$u.route('/center/paycode')">
- <view class="up">
- <u-icon :name="staticUrl+'/img/paycode.png'" color="#333333" size="42rpx"></u-icon>
- </view>
- <view class="down">会员码</view>
- </view>
- <view class="property-item" @click="$u.route('/center/mybalance')">
- <view class="up">{{memberInfo.balance}}</view>
- <view class="down">余额</view>
- </view>
- <view class="property-item" @click="$u.route('/credits/creditslist')">
- <view class="up">{{memberInfo.credit}}</view>
- <view class="down">积分</view>
- </view>
- <view class="property-item">
- <view class="up">{{memberInfo.couponNum}}</view>
- <view class="down">优惠券</view>
- </view>
- </view>
- <view class="order-state">
- <view class="title">我的订单</view>
- <view class="u-flex u-row-between">
- <view class="state" @click="orderClick(item,index)" v-for="(item,index) in orderState" :key="index">
- <view class="up">
- <u-icon :name="item.ico" color="#333333" size="60rpx"></u-icon>
- <u-badge v-if="item.badge" type="error" max="99" :value="orderBadge[item.badge]" :absolute="true" :offset="[0,0]"></u-badge>
- </view>
- <view class="down">{{item.name}}</view>
- </view>
- </view>
- </view>
- <view class="tools page-wrap">
- <view class="title">常用工具</view>
- <view class="u-flex u-row-left">
- <view class="tool-item"
- v-for="(item,index) in tools"
- @click="toolsClick(item)"
- :key="index">
- <view class="up">
- <u-icon :name="item.ico" color="#333333" size="60rpx"></u-icon>
- </view>
- <view class="down">{{item.name}}</view>
- </view>
- </view>
- </view>
- <!-- <u-overlay :show="showPayCode" @click="showPayCode = false">
- <view class="pay-code-warp u-flex u-row-center">
- <view class="rect" @tap.stop>
- <u--image :showLoading="true" :src="payCodeImg" width="180px" height="180px"></u--image>
- </view>
- </view>
- </u-overlay> -->
- <tabbar :tabbarIndexProps="3" />
- </view>
- </template>
- <script>
- import { systemInfo } from "@/mixin.js";
- import tabbar from "../components/tabbar.vue"
- export default {
- components:{
- tabbar
- },
- mixins:[systemInfo],
- data() {
- return {
- staticUrl:this.$commonConfig.staticUrl,
- avatar:this.$commonConfig.staticUrl+'/img/avatar.png',
- showPayCode:false,
- payCodeImg:'https://cdn.uviewui.com/uview/album/1.jpg',
- memberInfo:{},
- orderState:[
- {name:'全部订单',status:'',ico:this.$commonConfig.staticUrl+'/img/orderstateico-all.png'},
- {name:'待付款',status:'0',ico:this.$commonConfig.staticUrl+'/img/orderstateico-01.png',badge:'noPayNum'},
- // {name:'待发货',status:'1',ico:this.$commonConfig.staticUrl+'/img/orderstateico-01.png',badge:'noPayNum'},
- {name:'待收货',status:'2',ico:this.$commonConfig.staticUrl+'/img/orderstateico-02.png',badge:'collectNum'},
- {name:'待评价',status:'3',ico:this.$commonConfig.staticUrl+'/img/orderstateico-03.png',badge:'commentNum'},
- {name:'退款/售后',status:'7',ico:this.$commonConfig.staticUrl+'/img/orderstateico-04.png',badge:'refundNum'},
- ],
- orderBadge:{
- noPayNum:'0',
- deliverNum:'0',
- collectNum:'0',
- commentNum:'0',
- refundNum:'0',
- },
- tools:[
- // {name:'充值中心',url:'/center/recharge',ico:this.$commonConfig.staticUrl+'/img/tool-chongzhi.png'},
- {name:'地址管理',url:'/center/addrlist',ico:this.$commonConfig.staticUrl+'/img/tool-map.png'},
- ]
- }
- },
- onShow() {
- this.getMemberInfo();
- this.statisticsOrder();
- },
- onLoad() {
- this.getSystemInfo();
- },
- methods: {
- getMemberInfo(){
- this.$u.api.memberInfo({id:this.vuex_member_info.id}).then(res=>{
- this.memberInfo = res.data;
- this.avatar = res.data.avatar;
- this.$u.vuex('vuex_member_info', res.data);
- // console.log('memberInfo',this.memberInfo);
- }).catch(err=>{
- console.log('memberInfo',err.data);
- })
- },
- toolsClick(item){
- console.log('item',item);
- uni.$u.route(item.url);
- },
- orderClick(item,index){
- console.log('item',item);
- uni.$u.route('/shopping/order', {
- // current: index,
- status: item.status,
- type: 'redirectTo'
- });
- },
- statisticsOrder(){
- this.$u.api.statisticsOrder().then(res=>{
- let data = res.data || {};
- this.orderBadge = Object.assign(this.orderBadge,data)
- // console.log('statisticsOrder',res.data);
- // console.log('this.orderBadge',this.orderBadge);
- }).catch(err=>{
- console.log('memberInfo',err.data);
- })
- }
- }
- }
- </script>
- <style>
- page{
- background-color: #F5F5F5;
- padding-top: 0;
- }
- </style>
- <style lang="scss" scoped>
- .title{
- font-size: 32rpx;
- font-weight: 600;
- color: #333333;
- line-height: 45rpx;
- margin-bottom: 30rpx;
- }
- .base-info{
- margin-bottom: 10rpx;
- .info{
- margin-left: 30rpx;
- .name{
- font-size: 40rpx;
- font-weight: 600;
- color: #333333;
- line-height: 56rpx;
- margin-bottom: 10rpx;
- }
- .level{
- width: fit-content;
- background: linear-gradient(131deg, #FFF2DB 0%, #FFD9A5 100%);
- border-radius: 2px;
- font-size: 22rpx;
- font-weight: 400;
- color: #333333;
- line-height: 30rpx;
- padding: 6rpx 16rpx;
- .level-name{
- margin-left: 10rpx;
- }
- }
- }
- }
- .property{
- text-align: center;
- .up{
- font-size: 32rpx;
- font-weight: 600;
- color: #333333;
- line-height: 45rpx;
- /deep/ .u-icon{
- display: block;
- }
- }
- .down{
- font-size: 26rpx;
- font-weight: 400;
- color: #666666;
- line-height: 37rpx;
- }
- }
- .order-state{
- .title{margin-bottom: 30rpx;}
- background-color: #fff;
- padding: 30rpx;
- margin: 0 20rpx 50rpx;
- .state{
- text-align: center;
- /deep/ .u-icon{
- display: block;
- }
- .up{
- position: relative;
- }
- .down{
- font-size: 24rpx;
- font-weight: 400;
- color: #666666;
- line-height: 31rpx;
- }
- }
- }
- .tools{
- .tool-item{
- margin-left: 40rpx;
- text-align: center;
- /deep/ .u-icon{
- display: block;
- }
- .down{
- font-size: 24rpx;
- font-weight: 400;
- color: #666666;
- line-height: 31rpx;
- }
- }
- }
- .pay-code-warp{
- height: 100vh;
- }
- </style>
|