Selaa lähdekoodia

账户余额页面修复

zhengjinyi 3 vuotta sitten
vanhempi
commit
eae12aaf97

+ 2 - 2
src/main/resources/config/dev/application-dev.yml

@@ -54,8 +54,8 @@ logging:
 caimei:
   siteEnv: 0 #网站环境,(2:正式环境,1:测试环境,0:开发环境)
   spiServer: http://192.168.2.68:8008
-  coreServer: https://core-b.caimei365.com
-#  coreServer: http://192.168.2.67:18002
+#  coreServer: https://core-b.caimei365.com
+  coreServer: http://192.168.2.67:18002
 #  coreServer: http://192.168.2.75:18002
   imageDomain: https://img-b.caimei365.com
   wwwDomain: http:localhost:8009

+ 12 - 0
src/main/resources/static/js/common/serviceapi/user.service.js

@@ -307,6 +307,18 @@ var UserApi = {
                 callback(res)
             });
         },
+        GetUserBalanceList : function(params,callback) {//机构采美豆收支明细
+            Http.AjaxService({
+                url:'/user/center/balance',
+                type:'get',
+                data:params,
+                json:false,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res)
+            });
+        },
         GetSuperCenterInfo: function (params, callback) {//会员中心数据
             Http.AjaxService({
                 url: '/user/super/center',

+ 170 - 57
src/main/resources/static/js/user-center/account/account.js

@@ -1,76 +1,189 @@
 ;
-var helpSuggestion = new Vue({
-    el: "#dashboard",
+var orderPage = new Vue({
+    el: "#beansPage",
     data: {
-        btnLoading: false,
         isRequset:true,
-        userId: 0,
-        degree:'',
-        userInfo:{},
-        formData:new FormData(),
-        unReadMessageCount:'',//消息数
-        confirmedCount:'',//待確認數量
-        paymentCount:'',//待付款
-        waitShipmentsCount:'',//待发货
-        shipmentsCount:'',//已发货
-        salesReturnCount:'',//退货款
-        productList:[],//推荐商品
-        newsList:[],//新闻动态
+        noMore: false,
+        tabsListIndex:0,
+        tabsList: [
+            {value: 0,text: '全部'},
+            {value: 1,text: '收入'},
+            {value: 2,text: '支出'}
+        ],
+        listQuery:{
+            userId: 0,
+            year:'',
+            month:'',
+            type:'',
+            pageNum:1,
+            pageSize:10
+        },
+        balanceList:[],
+        listRecord: 0,
+        pageInput: '1',
+        ableUserMoney:0,
+        modelType:0,
+        orderIdentificationId:0,
+        payModelData:{},
+        hanldOrderData:{},//监听点击的单个订单项的按钮
+        confrimsBtn:true,
+    },
+    filters: {
+        NumFormat:function(text) {//处理金额
+            return Number(text).toFixed(2);
+        },
+        NumBadge:function(n){//处理
+            var num ='';
+            if(n>100){num = 99}else{num = n;}
+            return num;
+        },
+        stateTypeText:function(type){
+            var stateText = '',
+                stateTextObject={
+                    1:'收入',
+                    2:'支出'
+                };
+            Object.keys(stateTextObject).forEach(function(key){
+                if(key == type){
+                    stateText = stateTextObject[key]
+                }
+            });
+            return stateText;
+        },
+        stateText:function (state){ //账户余额类型文字
+            var stateText = '',
+                stateTextObject={
+                    1:'余额抵扣',
+                    2:'多收退款到余额',
+                    3:'申请退款',
+                    4:'余额充值',
+                    5:'余额提现',
+                    6:'订金订单充值',
+                    7:'余额订单充值',
+                    8:'订金订单退款',
+                    9:'余额订单退款'
+                };
+            Object.keys(stateTextObject).forEach(function(key){
+                if(key == state){
+                    stateText = stateTextObject[key]
+                }
+            });
+            return stateText;
+        }
+    },
+    computed: {
+        pageTotal: function () {
+            var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
+            return total > 0 ? total : 1;
+        },
+        showPageBtn: function () {
+            var total = Math.ceil(this.listRecord / this.listQuery.pageSize);
+            total = total > 0 ? total : 1;
+            var index = this.listQuery.pageNum, arr = [];
+            if (total <= 6) {
+                for (var i = 1; i <= total; i++) {
+                    arr.push(i);
+                }
+                return arr;
+            }
+            if (index <= 3) return [1, 2, 3, 4, 5, 0, total];
+            if (index >= total - 2) return [1, 0, total - 4, total - 3, total - 2, total - 1, total];
+            return [1, 0, index - 2, index - 1, index, index + 1, index + 2, 0, total];
+        }
     },
     methods: {
-        GetMyPcCenterInfo:function(){
+        tabClick:function(index){//点击Tab切换查询列表
+            var  _self = this;
+            _self.tabsListIndex = index;
+            if(index == 0){
+                _self.listQuery.type = '';
+            }else{
+                _self.listQuery.type = index;
+            }
+            _self.GetQueryBalanceListData();
+        },
+        initDate:function(){//初始化获取当前年月
             var _self = this;
-            UserApi.GetMyPcCenterInfo({userId:_self.userId},function (response) {
+            var _Date = new Date();
+            _self.listQuery.year = _Date.getFullYear();
+            _self.listQuery.month = _Date.getMonth()+1;
+            console.log('当前年份==========>', _self.listQuery.year);
+            console.log('当前月份==========>', _self.listQuery.month);
+        },
+        reduceMonth:function(){//减月份
+            var _self = this;
+            _self.listQuery.month--;
+            if(_self.listQuery.month == 0){
+                _self.listQuery.year--;
+                _self.listQuery.month = 12;
+            }
+            _self.GetQueryBalanceListData();
+            console.log('年==========>', _self.listQuery.year);
+            console.log('月==========>', _self.listQuery.month);
+        },
+        addMonth:function(){//加月份
+            var _self = this;
+            _self.listQuery.month++;
+            if(_self.listQuery.month > 12){
+                _self.listQuery.year++;
+                _self.listQuery.month = 1;
+            }
+            _self.GetQueryBalanceListData();
+        },
+        toPagination: function (pageNum) {//点击切换分页
+            if (pageNum <= this.pageTotal) {
+                this.listQuery.pageNum = pageNum;
+                this.GetQueryBalanceListData();
+            }
+        },
+        checkNum: function () {//输入跳转分页
+            if (this.pageInput > this.pageTotal) {
+                this.pageInput = this.pageTotal;
+            } else if (this.pageInput < 1) {
+                this.pageInput = 1;
+            }
+        },
+        changeOrderFn:function(index,status){
+            var  _self = this;
+            _self.orderTabBarIndex = index;
+            _self.listQuery.orderState = status;
+            _self.listQuery.searchNo = '';
+            _self.listQuery.beginTime = '';
+            _self.listQuery.endTime = '';
+            _self.listQuery.pageNum = 1;
+            _self.isRequset = true;
+            _self.GetQueryBalanceListData()
+        },
+        GetQueryBalanceListData:function(){//查询列表
+            var _self = this;
+            UserApi.GetUserBalanceList(_self.listQuery,function (response) {
                 if(response.code == 0){
                     var data = response.data;
-                    _self.userInfo = data.user;
-                    _self.degree = data.degree;
-                    _self.unReadMessageCount = _self.showBadge(data.unReadMessageCount);
-                    _self.confirmedCount = _self.showBadge(data.confirmedCount);
-                    _self.paymentCount = _self.showBadge(data.paymentCount);
-                    _self.waitShipmentsCount = _self.showBadge(data.waitShipmentsCount);
-                    _self.shipmentsCount = _self.showBadge(data.shipmentsCount);
-                    _self.salesReturnCount = _self.showBadge(data.salesReturnCount);
-                    _self.productList = data.homePageAdvertiseList;
-                    _self.newsList = data.homePageInfoList;
+                    var pageDate = data.pageDate;
+                    _self.ableUserMoney = data.ableUserMoney;
+                    if( pageDate.results && pageDate.results.length>0) {
+                        _self.balanceList = [];
+                        _self.balanceList = pageDate.results;
+                        _self.listRecord = pageDate.total;
+                    }else{
+                        _self.balanceList = [];
+                        _self.balanceList = pageDate.results;
+                        _self.listRecord = pageDate.total;
+                    }
                     _self.isRequset = false;
                 }else{
                     CAIMEI.Alert(response.msg, '确定', false);
-                    _self.isRequset = false;
                 }
             })
-        },
-        uploadUserPuploadAvatar: function(event){//上传头像
-            var _self = this;
-            var inputDOM = _self.$refs.clubUseLogo;
-            var file = inputDOM.files;
-            _self.formData.append('file', file[0]);
-            PublicApi.uploadimg(_self.formData,function(response){
-                _self.userInfo.image = response.data;
-                event.target.value = '';
-                UserApi.UserPuploadAvatar({userId:_self.userId,image:response.data},function(res){
-                    if(res.code==0){
-                        _self.GetMyPcCenterInfo();
-                    }
-                })
-            });
-        },
-        orderListPath:function(index){
-            window.location.href='/user/order/list.html?state='+index;
-        },
-        showBadge:function(n){//处理标签
-            var num ='';
-            if(n>100){num = 99}else{num = n;}
-            return num;
-        },
-        toFixedFn:function(text){//处理小数点后两位数
-            return Number(text).toFixed(2);
-        },
+        }
     },
     mounted: function () {
+        var _self = this;
         if(globalUserData){
-            this.userId = globalUserData.userId;
-            this.GetMyPcCenterInfo();
+            _self.userId = globalUserData.userId;
+            _self.listQuery.userId = this.userId;
+            _self.initDate();
+            _self.GetQueryBalanceListData();
         }
     }
 });

+ 178 - 177
src/main/resources/templates/product/list.html

@@ -13,206 +13,207 @@
 
 <!-- 商品列表 -->
 <div id="productList">
-    <!-- 面包屑 -->
-    <div v-if="isPC && listData && listData.length>0" class="crumbs">
-        <span>搜索结果</span>
-        <span>&gt;</span> <a href="javascript:void(0);" @click="toPagination(1)" v-text="params.keyword"></a>
-    </div>
     <div v-if="listLoading" class="loading">
         <img src="/img/base/loading.gif">
     </div>
     <template v-else>
-        <!--数据为空-->
-        <div v-if="isListEmpty" class="empty">
-            <img src="/img/common/empty.png">
-            <div class="msg">
-                <p>暂未找到你搜索的商品,去<a href="/">商城</a>,逛逛吧~</p>
-            </div>
+        <!-- 面包屑 -->
+        <div v-if="isPC && !listLoading && listData && listData.length>0" class="crumbs">
+            <span>搜索结果</span>
+            <span>&gt;</span> <a href="javascript:void(0);" @click="toPagination(1)" v-text="params.keyword"></a>
         </div>
+        <!--品牌选择-->
+        <template v-if="isPC">
+            <div class="product-brand clear">
+                <div class="product-brand-name" :class="isShowAllBrands ? 'show' : ''">
+                    <p class="title">品牌</p>
+                </div>
+                <div class="product-brand-list" :class="isShowAllBrands ? 'show' : ''">
+                    <div class="brand-list" @click="choiceBrandAllHref" :class="hrefBrandId ? '' : 'checked'"><a href="javascript:void(0)">全部</a></div>
+                    <div class="brand-list" @click="choiceBrandHref(brand, index)" v-for="(brand,index) in brandLists"
+                         :key="index" :class="brand.isChecked ? 'checked' : ''">
+                        <a href="javascript:void(0)" :title="brand.name" v-html="brand.name"></a>
+                    </div>
+                </div>
+                <div class="product-brand-more" v-if="defaultBrandLists.length>8" :class="isShowAllBrands ? 'show' : ''"
+                     @click="showMoreItem">{{
+                    isShowAllBrands ? '收起' : '更多' }} <i class="icon mIcon"></i></div>
+            </div>
+        </template>
         <template v-else>
-            <!--品牌选择-->
-            <template v-if="isPC">
+            <div class="product-brand-fiexd" v-if="isProductScreen">
                 <div class="product-brand clear">
+                    <div class="product-screen">
+                        <div class="sortBox-new" @click="hanldCheckedActivi">
+                            <span>促销商品</span>
+                            <span class="coll-checked" :class="[isActiviChecked ? 'checked': '']"></span>
+                        </div>
+                        <div class="sortBox-new" @click="hanldCheckedNews">
+                            <span>新品</span>
+                            <span class="coll-checked" :class="[isNewsChecked ? 'checked': '']"></span>
+                        </div>
+                    </div>
                     <div class="product-brand-name" :class="isShowAllBrands ? 'show' : ''">
                         <p class="title">品牌</p>
+                        <p v-if="!isPC" class="num">已选中<span>{{ checkedBrandLength }}</span>个品牌</p>
                     </div>
                     <div class="product-brand-list" :class="isShowAllBrands ? 'show' : ''">
-                        <div class="brand-list" @click="choiceBrandAllHref" :class="hrefBrandId ? '' : 'checked'"><a href="javascript:void(0)">全部</a></div>
-                        <div class="brand-list" @click="choiceBrandHref(brand, index)" v-for="(brand,index) in brandLists"
-                             :key="index" :class="brand.isChecked ? 'checked' : ''">
+                        <div class="brand-list" @click="choiceBrandAll" :class="isAllcheckedBrand ? 'checked' : ''"><a href="javascript:void(0)">全部</a></div>
+                        <div class="brand-list" v-for="(brand,index) in brandLists" :key="index"
+                             @click="choiceBrand(brand, index)" :class="brand.isChecked ? 'checked' : ''">
                             <a href="javascript:void(0)" :title="brand.name" v-html="brand.name"></a>
                         </div>
                     </div>
-                    <div class="product-brand-more" v-if="defaultBrandLists.length>8" :class="isShowAllBrands ? 'show' : ''"
-                         @click="showMoreItem">{{
-                        isShowAllBrands ? '收起' : '更多' }} <i class="icon mIcon"></i></div>
-                </div>
-            </template>
-            <template v-else>
-                <div class="product-brand-fiexd" v-if="isProductScreen">
-                    <div class="product-brand clear">
-                        <div class="product-screen">
-                            <div class="sortBox-new" @click="hanldCheckedActivi">
-                                <span>促销商品</span>
-                                <span class="coll-checked" :class="[isActiviChecked ? 'checked': '']"></span>
-                            </div>
-                            <div class="sortBox-new" @click="hanldCheckedNews">
-                                <span>新品</span>
-                                <span class="coll-checked" :class="[isNewsChecked ? 'checked': '']"></span>
-                            </div>
-                        </div>
-                        <div class="product-brand-name" :class="isShowAllBrands ? 'show' : ''">
-                            <p class="title">品牌</p>
-                            <p v-if="!isPC" class="num">已选中<span>{{ checkedBrandLength }}</span>个品牌</p>
-                        </div>
-                        <div class="product-brand-list" :class="isShowAllBrands ? 'show' : ''">
-                            <div class="brand-list" @click="choiceBrandAll" :class="isAllcheckedBrand ? 'checked' : ''"><a href="javascript:void(0)">全部</a></div>
-                            <div class="brand-list" v-for="(brand,index) in brandLists" :key="index"
-                                 @click="choiceBrand(brand, index)" :class="brand.isChecked ? 'checked' : ''">
-                                <a href="javascript:void(0)" :title="brand.name" v-html="brand.name"></a>
-                            </div>
-                        </div>
-                        <div class="product-brand-more" v-if="defaultBrandLists.length>8" :class="isShowAllBrands ? 'show' : ''" @click="showMoreItem">{{
-                            isShowAllBrands ? '收起' : '查看全部' }} <i
-                                    class="icon mIcon"></i></div>
-                        <div class="product-screen-btn" @click="handleConfirmScreen">
-                            <div class="sub-button">确定</div>
-                        </div>
+                    <div class="product-brand-more" v-if="defaultBrandLists.length>8" :class="isShowAllBrands ? 'show' : ''" @click="showMoreItem">{{
+                        isShowAllBrands ? '收起' : '查看全部' }} <i
+                                class="icon mIcon"></i></div>
+                    <div class="product-screen-btn" @click="handleConfirmScreen">
+                        <div class="sub-button">确定</div>
                     </div>
                 </div>
-            </template>
-            <!--排序-->
-            <div class="sortBox">
-                <ul class="mfc clear">
-                    <li :class="{'on':params.sortField == ''}" @click="toSortList('',1)">综合</li>
-                    <template>
-                        <li v-if="params.sortField == 'sales' && params.sortType == 1" class="down"
-                            @click="toSortList('sales',0)"><span>销量</span></li>
-                        <li v-else-if="params.sortField == 'sales' && params.sortType == 0" class="up"
-                            @click="toSortList('sales',1)"><span>销量</span></li>
-                        <li v-else @click="toSortList('sales',0)"><span>销量</span></li>
-                    </template>
-                    <template>
-                        <li v-if="params.sortField == 'favorite' && params.sortType == 1" class="down"
-                            @click="toSortList('favorite',0)"><span>人气</span></li>
-                        <li v-else-if="params.sortField == 'favorite' && params.sortType == 0" class="up"
-                            @click="toSortList('favorite',1)"><span>人气</span></li>
-                        <li v-else @click="toSortList('favorite',0)"><span>人气</span></li>
-                    </template>
-                    <template>
-                        <li v-if="params.sortField == 'price' && params.sortType == 1" class="down"
-                            @click="toSortList('price',0)"><span>价格</span></li>
-                        <li v-else-if="params.sortField == 'price' && params.sortType == 0" class="up"
-                            @click="toSortList('price',1)"><span>价格</span></li>
-                        <li v-else @click="toSortList('price',0)"><span>价格</span></li>
-                    </template>
-                    <template v-if="!isPC">
-                        <li class="screen" @click="showIsProductScreen">
-                            <span>筛选</span>
-                            <i class="mIcon"></i>
-                        </li>
-                    </template>
-                </ul>
-                <div class="sortBox-checked" v-if="isPC">
-                    <div class="sortBox-new" @click="hanldCheckedActiviHref">
-                        <span class="coll-checked" :class="[isActiviChecked ? 'checked': '']"></span>
-                        <span>促销商品</span>
-                    </div>
-                    <div class="sortBox-new" @click="hanldCheckedNewsHref">
-                        <span class="coll-checked" :class="[isNewsChecked ? 'checked': '']"></span>
-                        <span>新品</span>
-                    </div>
+            </div>
+        </template>
+        <!--排序-->
+        <div class="sortBox">
+            <ul class="mfc clear">
+                <li :class="{'on':params.sortField == ''}" @click="toSortList('',1)">综合</li>
+                <template>
+                    <li v-if="params.sortField == 'sales' && params.sortType == 1" class="down"
+                        @click="toSortList('sales',0)"><span>销量</span></li>
+                    <li v-else-if="params.sortField == 'sales' && params.sortType == 0" class="up"
+                        @click="toSortList('sales',1)"><span>销量</span></li>
+                    <li v-else @click="toSortList('sales',0)"><span>销量</span></li>
+                </template>
+                <template>
+                    <li v-if="params.sortField == 'favorite' && params.sortType == 1" class="down"
+                        @click="toSortList('favorite',0)"><span>人气</span></li>
+                    <li v-else-if="params.sortField == 'favorite' && params.sortType == 0" class="up"
+                        @click="toSortList('favorite',1)"><span>人气</span></li>
+                    <li v-else @click="toSortList('favorite',0)"><span>人气</span></li>
+                </template>
+                <template>
+                    <li v-if="params.sortField == 'price' && params.sortType == 1" class="down"
+                        @click="toSortList('price',0)"><span>价格</span></li>
+                    <li v-else-if="params.sortField == 'price' && params.sortType == 0" class="up"
+                        @click="toSortList('price',1)"><span>价格</span></li>
+                    <li v-else @click="toSortList('price',0)"><span>价格</span></li>
+                </template>
+                <template v-if="!isPC">
+                    <li class="screen" @click="showIsProductScreen">
+                        <span>筛选</span>
+                        <i class="mIcon"></i>
+                    </li>
+                </template>
+            </ul>
+            <div class="sortBox-checked" v-if="isPC">
+                <div class="sortBox-new" @click="hanldCheckedActiviHref">
+                    <span class="coll-checked" :class="[isActiviChecked ? 'checked': '']"></span>
+                    <span>促销商品</span>
+                </div>
+                <div class="sortBox-new" @click="hanldCheckedNewsHref">
+                    <span class="coll-checked" :class="[isNewsChecked ? 'checked': '']"></span>
+                    <span>新品</span>
                 </div>
             </div>
-            <!--商品列表-->
-            <ul class="productList clear mfw">
-                <li class="productItem " v-for="p in listData">
-                    <a class="image" :href="'/product-'+p.productId+'.html'">
-                        <img src="/img/base/placeholder.png" :data-original="p.image" :alt="p.name">
-                        <p class="name" v-html="addhtml + p.name" v-if="p.beautyActFlag==1"></p>
-                        <p class="name" v-html="p.name" v-else></p>
-                        <div class="price">
-                            <!--用户身份 0、个人 1、协销 2、会员机构 3、供应商 4,普通机构-->
-                            <template v-if="GLOBAL_USER_ID && GLOBAL_USER_ID>0">
-                                <div class="price_text_tag clear">
-                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
-                                    <template v-if="p.svipProductFlag === 1">
-                                        <div class="svip-tag">
-                                            <div class="svip-icon">SVIP</div>
-                                            <template v-if="showVipPriceTag(p)">
-                                                <div class="svip-price">
-                                                    <span v-html="p.svipPriceTag"></span>
-                                                </div>
-                                            </template>
+        </div>
+        <div class="productList-content">
+            <!--数据为空-->
+            <div v-if="isListEmpty" class="empty">
+                <img src="/img/common/empty.png">
+                <div class="msg">
+                    <p>暂未找到你搜索的商品,去<a href="/">商城</a>,逛逛吧~</p>
+                </div>
+            </div>
+            <template v-else>
+                <ul class="productList clear mfw">
+                    <li class="productItem " v-for="p in listData">
+                        <a class="image" :href="'/product-'+p.productId+'.html'">
+                            <img src="/img/base/placeholder.png" :data-original="p.image" :alt="p.name">
+                            <p class="name" v-html="addhtml + p.name" v-if="p.beautyActFlag==1"></p>
+                            <p class="name" v-html="p.name" v-else></p>
+                            <div class="price">
+                                <!--用户身份 0、个人 1、协销 2、会员机构 3、供应商 4,普通机构-->
+                                <template v-if="GLOBAL_USER_ID && GLOBAL_USER_ID>0">
+                                    <div class="price_text_tag clear">
+                                        <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
+                                        <template v-if="p.svipProductFlag === 1">
+                                            <div class="svip-tag">
+                                                <div class="svip-icon">SVIP</div>
+                                                <template v-if="showVipPriceTag(p)">
+                                                    <div class="svip-price">
+                                                        <span v-html="p.svipPriceTag"></span>
+                                                    </div>
+                                                </template>
+                                            </div>
+                                        </template>
+                                        <template v-else>
+                                            <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}
+                                                <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
+                                            </p>
+                                        </template>
+                                    </div>
+                                    <!--0公开价格 1不公开价格 2仅对会员机构公开-->
+                                    <div class="main_price_unde" v-if="p.priceFlag==1">¥价格未公开</div>
+                                    <!--机构价仅会员可见 && 用户是普通机构-->
+                                    <div class="main_price_unde" v-else-if="p.priceFlag==2 && GLOBAL_USER_IDENTITY === 4 && GLOBAL_VIP_FLAG!=1">
+                                        ¥会员可见
+                                    </div>
+                                    <!--机构价仅会员可见 && 用户是普通机构-->
+                                    <div class="main_price_unde" v-else-if="p.priceFlag==3 && (GLOBAL_CLUB_TYPE !=1)">
+                                        ¥仅医美机构可见
+                                    </div>
+                                    <!-- 资质机构 || (价格全部机构可见 && 普通机构) || (供应商 && 商品为供应商下的商品) || 超级会员用户 -->
+                                    <template
+                                            v-else-if="GLOBAL_USER_IDENTITY === 2 || (p.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) || (GLOBAL_USER_IDENTITY === 3 && p.shopId === GLOBAL_SHOP_ID) || GLOBAL_VIP_FLAG === 1">
+                                        <div class="main_price_show"
+                                             :class="{none: PromotionsFormat(p.promotions) || (p.svipProductFlag === 1 && showVipPriceTag(p))}">
+                                            ¥{{ (PromotionsFormat(p.promotions) || showVipPriceTag(p) ? p.originalPrice :
+                                            p.price ) | NumFormat }}
                                         </div>
                                     </template>
-                                    <template v-else>
-                                        <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}
-                                            <span v-if="p.priceFlag != 1 && PromotionsFormat(p.promotions)">:¥{{p.price | NumFormat}}</span>
-                                        </p>
-                                    </template>
-                                </div>
-                                <!--0公开价格 1不公开价格 2仅对会员机构公开-->
-                                <div class="main_price_unde" v-if="p.priceFlag==1">¥价格未公开</div>
-                                <!--机构价仅会员可见 && 用户是普通机构-->
-                                <div class="main_price_unde" v-else-if="p.priceFlag==2 && GLOBAL_USER_IDENTITY === 4 && GLOBAL_VIP_FLAG!=1">
-                                    ¥会员可见
-                                </div>
-                                <!--机构价仅会员可见 && 用户是普通机构-->
-                                <div class="main_price_unde" v-else-if="p.priceFlag==3 && (GLOBAL_CLUB_TYPE !=1)">
-                                    ¥仅医美机构可见
-                                </div>
-                                <!-- 资质机构 || (价格全部机构可见 && 普通机构) || (供应商 && 商品为供应商下的商品) || 超级会员用户 -->
-                                <template
-                                        v-else-if="GLOBAL_USER_IDENTITY === 2 || (p.priceFlag === 0 && GLOBAL_USER_IDENTITY === 4) || (GLOBAL_USER_IDENTITY === 3 && p.shopId === GLOBAL_SHOP_ID) || GLOBAL_VIP_FLAG === 1">
-                                    <div class="main_price_show"
-                                         :class="{none: PromotionsFormat(p.promotions) || (p.svipProductFlag === 1 && showVipPriceTag(p))}">
-                                        ¥{{ (PromotionsFormat(p.promotions) || showVipPriceTag(p) ? p.originalPrice :
-                                        p.price ) | NumFormat }}
+                                    <!--供应商除自己的商品外,也显示价格等级-->
+                                    <div class="price_grade" v-else><span class="bold">¥</span><i
+                                            :class="'icon mIcon i'+p.priceGrade"></i></div>
+                                </template>
+                                <template v-else>
+                                    <div class="price_text_tag">
+                                        <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
+                                        <template v-if="p.svipProductFlag === 1">
+                                            <div class="svip-tag">
+                                                <div class="svip-icon">SVIP</div>
+                                            </div>
+                                        </template>
+                                        <template v-else>
+                                            <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
+                                        </template>
                                     </div>
+                                    <div class="price_grade"><span class="bold">¥</span><i
+                                            :class="'icon mIcon i'+p.priceGrade"></i></div>
                                 </template>
-                                <!--供应商除自己的商品外,也显示价格等级-->
-                                <div class="price_grade" v-else><span class="bold">¥</span><i
-                                        :class="'icon mIcon i'+p.priceGrade"></i></div>
-                            </template>
-                            <template v-else>
-                                <div class="price_text_tag">
-                                    <p class="couponTag" v-if="p.couponsLogo">优惠券</p>
-                                    <template v-if="p.svipProductFlag === 1">
-                                        <div class="svip-tag">
-                                            <div class="svip-icon">SVIP</div>
-                                        </div>
-                                    </template>
-                                    <template v-else>
-                                        <p class="listTag" v-if="p.actStatus==1">{{p.promotions.name}}</p>
-                                    </template>
-                                </div>
-                                <div class="price_grade"><span class="bold">¥</span><i
-                                        :class="'icon mIcon i'+p.priceGrade"></i></div>
-                            </template>
-                        </div>
-                    </a>
-                </li>
-            </ul>
-        </template>
+                            </div>
+                        </a>
+                    </li>
+                </ul>
+            </template>
+        </div>
+        <!--分页-->
+        <div v-if="(!isPC) && noMore" class="noMore">---- 没有更多了 ----</div>
+        <div v-if="isPC && pageTotal>1" class="pageWrap clear">
+            <a v-if="params.num>1" class="prev" @click="toPagination(params.num*1-1)" href="javascript:void(0);"></a>
+            <template v-for="n in showPageBtn">
+                <a v-if="n" :class="{'on':(n==params.num)}" @click="toPagination(n)" href="javascript:void(0);"
+                   v-text="n"></a>
+                <span v-else>···</span>
+            </template>
+            <a v-if="params.num<pageTotal" class="next" @click="toPagination(params.num*1+1)"
+               href="javascript:void(0);"></a>
+            <span>共<b v-text="pageTotal>1?pageTotal:1"></b>页</span>
+            <span>跳至</span>
+            <input v-model="pageInput" @blur="checkNum()"/>
+            <span>页</span>&nbsp;
+            <a class="btn" href="javascript:void(0);" @click="toPagination(pageInput)">点击跳转</a>
+        </div>
     </template>
-    <!--分页-->
-    <div v-if="(!isPC) && noMore" class="noMore">---- 没有更多了 ----</div>
-    <div v-if="isPC && pageTotal>1" class="pageWrap clear">
-        <a v-if="params.num>1" class="prev" @click="toPagination(params.num*1-1)" href="javascript:void(0);"></a>
-        <template v-for="n in showPageBtn">
-            <a v-if="n" :class="{'on':(n==params.num)}" @click="toPagination(n)" href="javascript:void(0);"
-               v-text="n"></a>
-            <span v-else>···</span>
-        </template>
-        <a v-if="params.num<pageTotal" class="next" @click="toPagination(params.num*1+1)"
-           href="javascript:void(0);"></a>
-        <span>共<b v-text="pageTotal>1?pageTotal:1"></b>页</span>
-        <span>跳至</span>
-        <input v-model="pageInput" @blur="checkNum()"/>
-        <span>页</span>&nbsp;
-        <a class="btn" href="javascript:void(0);" @click="toPagination(pageInput)">点击跳转</a>
-    </div>
 </div>
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>

+ 62 - 128
src/main/resources/templates/user-center/account/account.html

@@ -5,168 +5,102 @@
     <title>采美365网</title>
     <template th:replace="components/head-link"></template>
     <link th:href="@{/css/base/center.css(v=${version})}" rel="stylesheet" type="text/css">
-    <link th:href="@{/css/user-center/dashboard.css(v=${version})}" rel="stylesheet" type="text/css">
+    <link th:href="@{/css/user-center/account/beans.css(v=${version})}" rel="stylesheet" type="text/css">
     <template th:replace="components/analysis"></template>
 </head>
 <body>
 <!-- 引用头部 -->
 <template th:replace="components/header"></template>
-
-<!-- 我的采美 -->
-<div id="dashboard">
+<!-- 采美豆明细 -->
+<div id="beansPage" v-cloak>
     <div class="navLayout" v-cloak>
         <div v-if="isPC" class="crumbs">
             <span>我的采美</span>
+            <span>&gt;</span>
+            <span>账户余额</span>
         </div>
         <div class="wrap clear">
             <!--左侧导航-->
             <template th:replace="user-center/components/tableft"></template>
             <div class="right">
+                <div class="beans-header">
+                    <div class="beans-header-l">
+                        <span>余额:</span>
+                        <span class="big">{{ ableUserMoney | NumFormat }}元</span>
+                    </div>
+                </div>
                 <!--loading-->
                 <div v-if="isRequset" class="loading">
                     <img src="/img/base/loading.gif">
                 </div>
-                <template v-else>
-                    <div class="user-header mfbt">
-                        <div class="logo">
-                            <input ref="clubUseLogo"  class="logo-file" type="file" accept="image/png,image/jpeg,image/gif,image/jpg"  @change="uploadUserPuploadAvatar">
-                            <i class="file icon mIcon" v-if="userInfo.image == null"></i>
-                            <img v-else :src="userInfo.image == null ? '' : userInfo.image" alt="">
-                        </div>
-                        <div class="account">
-                            <div class="name">
-                                <span>{{userInfo.name}}</span>
-                                <a href="/user/setting/upgrade.html" v-if="userInfo.userIdentity === 4">
-                                    去升级会员机构
-                                    <div class="name-tips">采美豆</div>
-                                </a>
-                            </div>
-                            <div class="msg"><span>资料完整度:<em class="red">{{degree}}</em></span><a href="/user/setting/information.html">立即完善</a></div>
-                        </div>
-                        <div class="message">
-                            <a href="/user/message/list.html">
-                                <i class="icon mIcon">
-                                    <span  v-if="unReadMessageCount>0" :class="[unReadMessageCount < 10 ? 'circular':'ellipse']">{{unReadMessageCount >= 99 ? '99+' : unReadMessageCount}}</span>
-                                </i>
-                            </a>
-                        </div>
-                    </div>
-                    <div class="user-content clear">
-                        <div class="title order">我的资产</div>
-                        <div class="section">
-                            <div class="user-main account">
-                                <a href="javascript:void(0);" class="account-cell">
-                                    <span>账户余额:</span>
-                                    <span class="red">{{toFixedFn(userInfo.ableUserMoney)}}</span>
-                                </a>
-                                <a href="" class="account-cell">
-                                    <span>采美豆:</span>
-                                    <span class="red">30000</span>
-                                </a>
+                <div class="beans-container clear" v-else>
+                    <div class="beans-content-tabs clearfix">
+                        <div class="tabs-main">
+                            <div class="time-template">
+                                <div class="time-pre" @click="reduceMonth">
+                                    <i class="icon mIcon"></i>
+                                </div>
+                                <div class="time-text">
+                                    {{ ( listQuery.year ||'') +'年'+( listQuery.month ||'') +'月'}}
+                                </div>
+                                <div class="time-next" @click="addMonth">
+                                    <i class="icon mIcon"></i>
+                                </div>
                             </div>
-                        </div>
-                    </div>
-                    <div class="user-content clear">
-                        <div class="title order">我的订单</div>
-                        <div class="section">
-                            <div class="user-main tabs">
-                                <div class="tabs-left mfw">
-                                    <div v-if="!isPC" class="item">
-                                        <a href="javascript:void(0);" @click="orderListPath(0)">
-                                            <span class="p">全部订单</span>
-                                        </a>
-                                    </div>
-                                    <div class="item">
-                                        <a href="javascript:void(0);" @click="orderListPath(1)">
-                                            <i class="icon icon-1">
-                                                <span v-if="confirmedCount>0" :class="[confirmedCount < 10 ? 'circular':'ellipse']">{{confirmedCount >= 99 ? '99+' : confirmedCount}}</span>
-                                            </i>
-                                            <span class="p">待确认</span>
-                                        </a>
-                                    </div>
-                                    <div class="item">
-                                        <a href="javascript:void(0);" @click="orderListPath(2)">
-                                            <i class="icon icon-2">
-                                                <span v-if="paymentCount>0" :class="[paymentCount < 10 ? 'circular':'ellipse']">{{paymentCount >= 99 ? '99+' : paymentCount}}</span>
-                                            </i>
-                                            <span class="p">待付款</span>
-                                        </a>
-                                    </div>
-                                    <div class="item">
-                                        <a href="javascript:void(0);" @click="orderListPath(3)">
-                                            <i class="icon icon-3">
-                                                <span v-if="waitShipmentsCount>0" :class="[waitShipmentsCount < 10 ? 'circular':'ellipse']">{{waitShipmentsCount >= 99 ? '99+' : waitShipmentsCount}}</span>
-                                            </i>
-                                            <span class="p">待发货</span>
-                                        </a>
-                                    </div>
-                                    <div class="item">
-                                        <a href="javascript:void(0);" @click="orderListPath(4)">
-                                            <i class="icon icon-4">
-                                                <span v-if="shipmentsCount>0" :class="[shipmentsCount < 10 ? 'circular':'ellipse']">{{shipmentsCount >= 99 ? '99+' : shipmentsCount}}</span>
-                                            </i>
-                                            <span class="p">已发货</span>
-                                        </a>
-                                    </div>
-                                    <div class="item">
-                                        <a href="javascript:void(0);" @click="orderListPath(5)">
-                                            <i class="icon icon-5">
-                                                <span v-if="salesReturnCount>0" :class="[salesReturnCount < 10 ? 'circular':'ellipse']">{{salesReturnCount >= 99 ? '99+' : salesReturnCount}}</span>
-                                            </i>
-                                            <span class="p">退货/款</span>
-                                        </a>
-                                    </div>
+                            <div class="time-tabs">
+                                <div   class="time-tabs-cell"
+                                       v-for="(tabs, index) in tabsList"
+                                       :key="index"
+                                       :class="tabsListIndex == index ? 'active' : ''"
+                                       @click="tabClick(index)"
+                                >
+                                    {{ tabs.text }}
                                 </div>
-                                <div v-if="isPC" class="tabs-right"><a href="javascript:void(0);" @click="orderListPath(0)">全部订单<span class="icon mIcon"></span></a></div>
                             </div>
                         </div>
                     </div>
-                    <!--美博会活动标题-->
-<!--                    <div class=" user-content coupon">-->
-<!--                        <a href="/user/beautyfair.html" id="meibohui" onclick="_czc.push(['_trackEvent','美博会','点击','用户访问','','meibohui'])">-->
-<!--                            <img src="https://static.caimei365.com/app/meibohui/www/activity-in-pc.jpg" class="coupon_img" v-if="isPC"/>-->
-<!--                            <img src="https://static.caimei365.com/app/meibohui/www/activity-in-h5.jpg" class="coupon_img" v-else>-->
-<!--                        </a>-->
-<!--		            </div>-->
-                    <div class="user-content">
-                        <div class="title">今日推荐</div>
-                        <div class="section">
-                            <div class="user-main product clear">
-                                <a class="product-item" v-for="(item, index) in productList" :key="index" :href="item.link" target="_blank">
-                                    <div class="product-img">
-                                        <img :src="item.image" :alt="item.title">
-                                    </div>
-                                    <div class="product-name"><p>{{item.title}}</p></div>
-                                </a>
+                    <!--数据为空-->
+                    <div class="beans-content-list" v-if="balanceList.length > 0">
+                        <div class="beans-list-cell" v-for="(balance, index) in balanceList" :key="index">
+                            <div class="list-cell-left">
+                                <p class="black">{{ balance.balanceType | stateText }}</p>
+                                <p class="none">{{ balance.addDate }}</p>
                             </div>
-                        </div>
-                    </div>
-                    <div class="user-content">
-                        <div class="title">最新动态<a href="/info/center-3-1.html" target="_blank">全部动态<i class="icon mIcon"></i></a></div>
-                        <div class="section">
-                            <div class="user-main news">
-                                <a class="new-list" v-for="(item, index) in newsList" :key="index" :href="item.link" target="_blank">
-                                    <p class="text">{{item.title}}</p>
-                                    <p class="time">{{item.addTime}}</p>
-                                </a>
+                            <div class="list-cell-right">
+                                <p class="black">{{ balance.type | stateTypeText }}</p>
+                                <p class="blod" :style="{color:balance.type == 1 ? '#ff2a2a' : '#15C47A'}"><span>{{balance.type =='1'? '+' : '-'}}</span>{{ balance.amount }}</p>
                             </div>
                         </div>
                     </div>
-                </template>
+                    <div v-else class="empty">
+                        <img src="/img/account/icon-emptybeans@2x.png">
+                        <div class="msg"><p>暂无数据</p></div>
+                    </div>
+                </div>
+                <!--分页-->
+                <div v-if="(!isPC) && noMore" class="noMore">---- 没有更多了 ----</div>
+                <div v-if="isPC && pageTotal>1" class="pageWrap clear">
+                    <a v-if="listQuery.pageNum>1" class="prev" @click="toPagination(listQuery.pageNum*1-1)" href="javascript:void(0);"></a>
+                    <template v-for="n in showPageBtn">
+                        <a v-if="n" :class="{'on':(n==listQuery.pageNum)}" @click="toPagination(n)" href="javascript:void(0);" v-text="n"></a>
+                        <span v-else>···</span>
+                    </template>
+                    <a v-if="listQuery.pageNum<pageTotal" class="next" @click="toPagination(listQuery.pageNum*1+1)" href="javascript:void(0);"></a>
+                    <span>共<b v-text="pageTotal>1?pageTotal:1"></b>页</span>
+                    <span>跳至</span>
+                    <input v-model="pageInput" @blur="checkNum()"/>
+                    <span>页</span>&nbsp;
+                    <a class="btn" href="javascript:void(0);" @click="toPagination(pageInput)">点击跳转</a>
+                </div>
             </div>
         </div>
     </div>
-    <!--loading-->
-    <div v-else class="loading">
-        <img src="/img/base/loading.gif">
-    </div>
 </div>
-
 <!-- 引入底部 -->
 <template th:replace="components/footer"></template>
 <template th:replace="components/foot-link"></template>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/center.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/user.service.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/dashboard.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/user-center/account/account.js(v=${version})}"></script>
 </body>
 </html>