You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
12 KiB
1 lines
12 KiB
import{C as e,A as a,s as t,D as s,S as n,z as l,J as i,K as o,o as u,c as r,w as d,n as c,e as f,i as m,a as g,f as p,t as h,b as k,d as y,F as x,g as _,r as T,l as L,k as v}from"./index-4ddb689d.js";import{A}from"./index.1169d7d7.js";import{R as b}from"./index.5efbe1fd.js";import{C}from"./index.cdfc996d.js";import{i as j,a as w}from"./user.2171e17f.js";import{t as D}from"./order.42b61037.js";import{_ as I}from"./_plugin-vue_export-helper.1b428a4d.js";import"./index.85d62ccb.js";const z=""+new URL("user-header2-307aec49.png",import.meta.url).href,P=[{id:"all",name:"全部订单",icon:"qpdingdan"},{id:"payment",name:"待支付",icon:"daifukuan",count:0},{id:"delivery",name:"待发货",icon:"daifahuo",count:0},{id:"received",name:"待收货",icon:"daishouhuo",count:0}],S=[{id:"address",name:"收货地址",icon:"shouhuodizhi",type:"link",url:"pages/address/index"},{id:"coupon",name:"领券中心",icon:"lingquan",type:"link",url:"pages/coupon/index",moduleKey:"market-coupon"},{id:"myCoupon",name:"优惠券",icon:"youhuiquan",type:"link",url:"pages/my-coupon/index",moduleKey:"market-coupon"},{id:"refund",name:"退换/售后",icon:"shouhou",type:"link",url:"pages/refund/index",count:0},{id:"contact",name:"在线客服",icon:"kefu",type:"contact"},{id:"points",name:"我的积分",icon:"jifen",type:"link",url:"pages/points/log",moduleKey:"market-coupon"},{id:"dealer",name:"分销中心",icon:"fenxiao",type:"link",url:"pages/dealer/index",moduleKey:"apps-dealer"},{id:"groupon",name:"我的拼团",icon:"pintuan",type:"link",url:"pages/groupon/index?tab=1",moduleKey:"apps-groupon"},{id:"bargain",name:"我的砍价",icon:"kanjia",type:"link",url:"pages/bargain/index?tab=1",moduleKey:"apps-bargain"},{id:"orderCenter",name:"订单中心",icon:"order-c",type:"link",url:"pages/order/center"},{id:"help",name:"我的帮助",icon:"bangzhu",type:"link",url:"pages/help/index",moduleKey:"content-help"}];const M=I({components:{AvatarImage:A,Recommended:b,CustomerBtn:C},data:()=>({inArray:e,SettingKeyEnum:a,isLoading:!0,isFirstload:!0,isLogin:!1,setting:{},userInfo:{},assets:{balance:"--",points:"--",coupon:"--"},service:S,orderNavbar:P,todoCounts:{payment:0,deliver:0,received:0}}),onLoad(e){},onShow(e){this.onRefreshPage()},methods:{onRefreshPage(){t(),this.isLogin=s(),this.getPageData()},getPageData(e){const a=this;a.isLoading=!0,Promise.all([a.getSetting(),a.getUserInfo(),a.getUserAssets(),a.getTodoCounts()]).then((t=>{a.isFirstload=!1,a.initService(),a.initOrderTabbar(),e&&e()})).catch((e=>console.log("catch",e))).finally((()=>a.isLoading=!1))},async initService(){const e=this,t=await n.isEnabledDealer(),s=await l.isShowCustomerBtn(),o=[];S.forEach((n=>{n.enabled=!0,"points"===n.id&&(n.name="我的"+e.setting[a.POINTS.value].points_name),"dealer"!==n.id||t||(n.enabled=!1),"contact"!==n.id||s||(n.enabled=!1),null!=n.count&&(n.count=e.todoCounts[n.id]),o.push(n)})),e.service=i(o)},initOrderTabbar(){const e=this,a=[];P.forEach((t=>{null!=t.count&&(t.count=e.todoCounts[t.id]),a.push(t)})),e.orderNavbar=a},getSetting(){const e=this;return new Promise(((a,t)=>{l.data().then((t=>{e.setting=t,a(t)})).catch(t)}))},getUserInfo(){const e=this;return new Promise(((a,t)=>{e.isLogin?j({},{load:e.isFirstload}).then((t=>{e.userInfo=t.data.userInfo,a(e.userInfo)})).catch((s=>{s.result&&401==s.result.status?(e.isLogin=!1,a(null)):t(s)})):a(null)}))},getUserAssets(){const e=this;return new Promise(((a,t)=>{e.isLogin?w({},{load:e.isFirstload}).then((t=>{e.assets=t.data.assets,a(e.assets)})).catch((s=>{s.result&&401==s.result.status?(e.isLogin=!1,a(null)):t(s)})):a(null)}))},getTodoCounts(){const e=this;return new Promise(((a,t)=>{e.isLogin?D({},{load:e.isFirstload}).then((t=>{e.todoCounts=t.data.counts,a(e.todoCounts)})).catch((s=>{s.result&&401==s.result.status?(e.isLogin=!1,a(null)):t(s)})):a(null)}))},handleLogin(){!this.isLogin&&this.$navTo("pages/login/index")},handleBindMobile(){this.$navTo("pages/user/bind/index")},handlePersonal(){this.$navTo("pages/user/personal/index")},handleLogout(){const e=this;uni.showModal({title:"友情提示",content:"您确定要退出登录吗?",success(a){a.confirm&&o.dispatch("Logout",{}).then((a=>e.onRefreshPage()))}})},onTargetWallet(){this.$navTo("pages/wallet/index")},onTargetOrder(e){this.$navTo("pages/order/index",{dataType:e.id})},onTargetPoints(){this.$navTo("pages/points/log")},onTargetMyCoupon(){this.$navTo("pages/my-coupon/index")},handleService({url:e}){this.$navTo(e)},handleContact(){const e=this.setting[a.CUSTOMER.value];if("wxqykf"==e.provider){if(!e.config.wxqykf.url||!e.config.wxqykf.corpId)return void this.$toast("客服链接和企业ID不能为空");window.open(e.config.wxqykf.url)}}},onPullDownRefresh(){this.getPageData((()=>{uni.stopPullDownRefresh()}))}},[["render",function(e,a,t,s,n,l){const i=_,o=T("avatar-image"),A=m,b=L,C=T("customer-btn"),j=T("recommended");return n.isFirstload?f("",!0):(u(),r(A,{key:0,class:"container",style:c(e.appThemeStyle)},{default:d((()=>[g(A,{class:"main-header",style:c({height:"H5"==e.platform?"260rpx":"320rpx",paddingTop:"H5"==e.platform?"0":"80rpx"})},{default:d((()=>[g(i,{class:"bg-image",src:z,mode:"scaleToFill"}),n.isLogin?(u(),r(A,{key:0,class:"user-info"},{default:d((()=>[g(A,{class:"user-avatar",onClick:a[0]||(a[0]=e=>l.handlePersonal())},{default:d((()=>[g(o,{url:n.userInfo.avatar_url,width:100},null,8,["url"])])),_:1}),g(A,{class:"user-content"},{default:d((()=>[g(A,{class:"nick-name oneline-hide",onClick:a[1]||(a[1]=e=>l.handlePersonal())},{default:d((()=>[p(h(n.userInfo.nick_name),1)])),_:1}),e.$checkModule("user-grade")&&n.userInfo.grade_id>0&&n.userInfo.grade?(u(),r(A,{key:0,class:"user-grade"},{default:d((()=>[g(A,{class:"user-grade_icon"},{default:d((()=>[g(i,{class:"image",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAA0lBMVEUAAAD/tjL/tzH/uDP/uC7/tjH/tzH/tzL/tTH+tTL+tjP/tDD/tTD+tzD/tjL/szD/uDH/tjL/tjL+tjD/tjT/szb/tzL/tTL+uTH+tjL/tjL/tjL/tTT/tjL/tjL+tjH/uTL/vDD/tjL/tjH/tzL9uS//tTL/nBr/sS7/tjH/ujL/szD/uTv+rzf/tzL+tzH+vDP+uzL+tjP+ry7+tDL9ki/7szf/sEX/tTL/tjL+tjL/tTH/tTT/tzH/tzL/tjP/sTX/uTP/wzX+rTn/vDX9vC8m8ckhAAAAOXRSTlMAlnAMB/vjxKWGMh0S6drMiVxPRkEY9PLy0ru0sKagmo5+dGtgVCMgBP716eXWyMGxqJGRe2o5KSmFNjaYAAABP0lEQVQ4y8XS13KDMBAF0AWDDe4t7r3ETu9lVxJgJ/n/X8rKAzHG5TE+Twz3zki7I/g/KXdghIbGJewrU4yzn08Ebgl6TuZzzuOC6W5es3HX6qsSz3NFShRU0MpucytDmOSpu3yULx3CA9RD1HjVedc0jSjqm6ZzhUjDsFDQhSp/OKj5GQvg0+ZCOixsbtDLAeTTOm/yGi8GyIphIVsgH737FEDV44LJa88IRKK/SetrwT9G/GUIr6vXjoy4GXn7+RboVXnghuSjaoGecwQxL2su3CwAKlO+QFoqxI4FMctHQhQd2OhxTu184jWUlI+rMTBTn1/IQcJHQ6GQdZ7pWiDaNdhTt330efISeiqYwQEzQpTlsURJLhzkEmpCPsERfeIUVyXr6MNuIyp5uziW6xURtt7hhGwzmMNJExfO4Bd9X0ZPqAxdNwAAAABJRU5ErkJggg=="})])),_:1}),g(A,{class:"user-grade_name"},{default:d((()=>[g(b,null,{default:d((()=>[p(h(n.userInfo.grade.name),1)])),_:1})])),_:1})])),_:1})):(u(),r(A,{key:1,class:"mobile"},{default:d((()=>[p(h(n.userInfo.mobile),1)])),_:1}))])),_:1})])),_:1})):(u(),r(A,{key:1,class:"user-info",onClick:l.handleLogin},{default:d((()=>[g(A,{class:"user-avatar"},{default:d((()=>[g(o,{width:100})])),_:1}),g(A,{class:"user-content"},{default:d((()=>[g(A,{class:"nick-name"},{default:d((()=>[p("未登录")])),_:1}),g(A,{class:"login-tips"},{default:d((()=>[p("点击登录账号")])),_:1})])),_:1})])),_:1},8,["onClick"]))])),_:1},8,["style"]),n.isLogin&&!n.userInfo.mobile&&n.setting[n.SettingKeyEnum.REGISTER.value].isManualBind?(u(),r(A,{key:0,class:"my-mobile",onClick:a[2]||(a[2]=e=>l.handleBindMobile())},{default:d((()=>[g(A,{class:"info"},{default:d((()=>[p("点击绑定手机号,确保账户安全")])),_:1}),g(A,{class:"btn-bind"},{default:d((()=>[p("去绑定")])),_:1})])),_:1})):f("",!0),e.$checkModules(["market-recharge","market-points","market-coupon"])?(u(),r(A,{key:1,class:"my-asset"},{default:d((()=>[g(A,{class:"asset-left flex-box dis-flex flex-x-around"},{default:d((()=>[e.$checkModule("market-recharge")?(u(),r(A,{key:0,class:"asset-left-item",style:{"max-width":"200rpx"},onClick:l.onTargetWallet},{default:d((()=>[g(A,{class:"item-value dis-flex flex-x-center"},{default:d((()=>[g(b,{class:"oneline-hide"},{default:d((()=>[p(h(n.isLogin?n.assets.balance:"--"),1)])),_:1})])),_:1}),g(A,{class:"item-name dis-flex flex-x-center"},{default:d((()=>[g(b,null,{default:d((()=>[p("账户余额")])),_:1})])),_:1})])),_:1},8,["onClick"])):f("",!0),e.$checkModule("market-points")?(u(),r(A,{key:1,class:"asset-left-item",onClick:l.onTargetPoints},{default:d((()=>[g(A,{class:"item-value dis-flex flex-x-center"},{default:d((()=>[g(b,{class:"oneline-hide"},{default:d((()=>[p(h(n.isLogin?n.assets.points:"--"),1)])),_:1})])),_:1}),g(A,{class:"item-name dis-flex flex-x-center"},{default:d((()=>[g(b,null,{default:d((()=>[p(h(n.setting[n.SettingKeyEnum.POINTS.value].points_name),1)])),_:1})])),_:1})])),_:1},8,["onClick"])):f("",!0),e.$checkModule("market-coupon")?(u(),r(A,{key:2,class:"asset-left-item",onClick:l.onTargetMyCoupon},{default:d((()=>[g(A,{class:"item-value dis-flex flex-x-center"},{default:d((()=>[g(b,{class:"oneline-hide"},{default:d((()=>[p(h(n.isLogin?n.assets.coupon:"--"),1)])),_:1})])),_:1}),g(A,{class:"item-name dis-flex flex-x-center"},{default:d((()=>[g(b,null,{default:d((()=>[p("优惠券")])),_:1})])),_:1})])),_:1},8,["onClick"])):f("",!0)])),_:1}),e.$checkModule("market-recharge")?(u(),r(A,{key:0,class:"asset-right"},{default:d((()=>[g(A,{class:"asset-right-item",onClick:l.onTargetWallet},{default:d((()=>[g(A,{class:"item-icon dis-flex flex-x-center"},{default:d((()=>[g(b,{class:"iconfont icon-qianbao"})])),_:1}),g(A,{class:"item-name dis-flex flex-x-center"},{default:d((()=>[g(b,null,{default:d((()=>[p("我的钱包")])),_:1})])),_:1})])),_:1},8,["onClick"])])),_:1})):f("",!0)])),_:1})):f("",!0),g(A,{class:"order-navbar"},{default:d((()=>[(u(!0),k(x,null,y(n.orderNavbar,((e,a)=>(u(),r(A,{class:"order-navbar-item",key:a,onClick:a=>l.onTargetOrder(e)},{default:d((()=>[g(A,{class:"item-icon"},{default:d((()=>[g(b,{class:v(["iconfont",[`icon-${e.icon}`]])},null,8,["class"])])),_:2},1024),g(A,{class:"item-name"},{default:d((()=>[p(h(e.name),1)])),_:2},1024),e.count&&e.count>0?(u(),r(A,{key:0,class:"item-badge"},{default:d((()=>[e.count<=99?(u(),r(b,{key:0,class:"text"},{default:d((()=>[p(h(e.count),1)])),_:2},1024)):(u(),r(b,{key:1,class:"text"},{default:d((()=>[p("99+")])),_:1}))])),_:2},1024)):f("",!0)])),_:2},1032,["onClick"])))),128))])),_:1}),g(A,{class:"my-service"},{default:d((()=>[g(A,{class:"service-title"},{default:d((()=>[p("我的服务")])),_:1}),g(A,{class:"service-content clearfix"},{default:d((()=>[(u(!0),k(x,null,y(n.service,((e,a)=>(u(),k(x,{key:a},["link"==e.type&&e.enabled?(u(),r(A,{key:0,class:"service-item",onClick:a=>l.handleService(e)},{default:d((()=>[g(A,{class:"item-icon"},{default:d((()=>[g(b,{class:v(["iconfont",[`icon-${e.icon}`]])},null,8,["class"])])),_:2},1024),g(A,{class:"item-name"},{default:d((()=>[p(h(e.name),1)])),_:2},1024),e.count&&e.count>0?(u(),r(A,{key:0,class:"item-badge"},{default:d((()=>[e.count<=99?(u(),r(b,{key:0,class:"text"},{default:d((()=>[p(h(e.count),1)])),_:2},1024)):(u(),r(b,{key:1,class:"text"},{default:d((()=>[p("99+")])),_:1}))])),_:2},1024)):f("",!0)])),_:2},1032,["onClick"])):f("",!0),"contact"==e.type&&e.enabled?(u(),r(A,{key:1,class:"service-item"},{default:d((()=>[g(C,null,{default:d((()=>[g(A,{class:"item-icon"},{default:d((()=>[g(b,{class:v(["iconfont",[`icon-${e.icon}`]])},null,8,["class"])])),_:2},1024),g(A,{class:"item-name"},{default:d((()=>[p(h(e.name),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)):f("",!0)],64)))),128))])),_:1})])),_:1}),n.isLogin?(u(),r(A,{key:2,class:"my-logout"},{default:d((()=>[g(A,{class:"logout-btn",onClick:a[3]||(a[3]=e=>l.handleLogout())},{default:d((()=>[g(b,null,{default:d((()=>[p("退出登录")])),_:1})])),_:1})])),_:1})):f("",!0),g(j)])),_:1},8,["style"]))}],["__scopeId","data-v-aa953ca8"]]);export{M as default};
|
|
|