mine.js
2.0 KB
"use strict";const e=require("../../common/vendor.js"),p=require("../../api/index.js");require("../../utils/request.js");if(!Array){const s=e.resolveComponent("u-navbar"),t=e.resolveComponent("u-badge");(s+t)()}const v=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js",_=()=>"../../uni_modules/uview-plus/components/u-badge/u-badge.js";Math||(v+_)();const f={__name:"mine",setup(s){const t=e.ref({});e.onShow(()=>{l()});let i=e.reactive([{id:1,name:"待付款",num:0,ic:"/static/mineIc/obligation.png"},{id:2,name:"待发货",num:0,ic:"/static/mineIc/shipped.png"},{id:3,name:"待收货",num:0,ic:"/static/mineIc/received.png"},{id:4,name:"待评价",num:0,ic:"/static/mineIc/evaluated.png"},{id:5,name:"售后",num:0,ic:"/static/mineIc/afterSales.png"}]),u=e.reactive([{id:1,name:"我的余额",ic:"/static/mineIc/balance.png"},{id:2,name:"我的积分",ic:"/static/mineIc/collect.png"},{id:3,name:"我的地址",ic:"/static/mineIc/addressBlack.png"}]);e.ref({});const o=n=>{e.index.navigateTo({url:`/pages/mine/myOrder?status=${n==5?0:Number(n)+1}`})},m=n=>{n<2?e.index.navigateTo({url:`/pages/mine/myPoints?type=${n}`}):e.index.navigateTo({url:"/pages/mine/myAddress"})},d=()=>{e.index.navigateTo({url:"/pages/mine/recharge"})},l=async()=>{try{const n=await p.getMine();i[0].num=n.dfk,i[1].num=n.dfh,i[2].num=n.dsh,i[3].num=n.dpj,i[4].num=n.yth,t.value=n.userInfo,t.value.avatar=n.avatar,console.log("getMine",n)}catch(n){e.index.showToast({title:n,icon:"none"}),console.log("getMine",n)}};return(n,h)=>({a:e.p({title:"我的",bgColor:"transparent"}),b:t.value.avatar,c:e.t(t.value.nickname),d:e.o(d),e:e.o(a=>o(5)),f:e.f(e.unref(i),(a,c,r)=>({a:"6cbe0492-1-"+r,b:e.p({absolute:!0,offset:[-4,-10],color:"#FFFFFF",bgColor:"#F74637",max:"99",value:a.num}),c:a.ic,d:e.t(a.name),e:a.id,f:e.o(g=>o(c),a.id)})),g:e.f(e.unref(u),(a,c,r)=>({a:a.ic,b:e.t(a.name),c:a.id,d:e.o(g=>m(c),a.id)}))})}},b=e._export_sfc(f,[["__file","D:/vue/大健康商城/healthMall/pages/mine/mine.vue"]]);wx.createPage(b);