12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- ;
- var helpSuggestion = new Vue({
- el: "#dashboard",
- data: {
- btnLoading: false,
- isRequset:true,
- userId: 0,
- degree:'',
- userInfo:{},
- formData:new FormData(),
- unReadMessageCount:'',//消息数
- confirmedCount:'',//待確認數量
- paymentCount:'',//待付款
- waitShipmentsCount:'',//待发货
- shipmentsCount:'',//已发货
- salesReturnCount:'',//退货款
- productList:[],//推荐商品
- newsList:[],//新闻动态
- isShowBeansAlet:true,
- bgImagePath:'',//根据类型显示图片标记
- beanNumber:100,
- beansType:1
- },
- methods: {
- GetMyPcCenterInfo:function(){
- var _self = this;
- UserApi.GetMyPcCenterInfo({userId:_self.userId},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;
- _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);
- },
- handInitType:function(type){
- var _self = this;
- _self.bgImagePath ='/img/account/icon-beans-'+type+'@2x.png';
- console.log(this.bgImagePath)
- },
- handleClickCancel:function () {//关闭弹窗
- var _self = this;
- _self.isShowBeansAlet = false;
- }
- },
- mounted: function () {
- var _self = this;
- if(globalUserData){
- _self.userId = globalUserData.userId;
- _self.GetMyPcCenterInfo();
- _self.handInitType(_self.beansType)
- }
- }
- });
|