2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
|
"use strict";var e=(e,o,t)=>new Promise(((a,r)=>{var n=e=>{try{i(t.next(e))}catch(o){r(o)}},s=e=>{try{i(t.throw(e))}catch(o){r(o)}},i=e=>e.done?a(e.value):Promise.resolve(e.value).then(n,s);i((t=t.apply(e,o)).next())}));const o=require("../../../common/vendor.js"),t=require("../../../sheep/index.js"),a=require("../../../sheep/api/trade/brokerage.js");if(!Array){(o.resolveComponent("s-layout")+o.resolveComponent("layout-default-uni"))()}Math;const r={__name:"team",setup(r){o.useCssVars((e=>({"4dce50cd":o.unref(n)}))),t.sheep.$platform.device.statusBarHeight,o.computed((()=>t.sheep.$store("user").userInfo));const n=t.sheep.$url.css("/static/img/shop/user/withdraw_bg.png");o.onPageScroll((e=>{i.scrollTop=e.scrollTop<=100}));const s=o.ref(),i=o.reactive({summary:{},pagination:{pageNo:1,pageSize:8,list:[],total:0},loadStatus:"",level:1,nickname:o.ref(""),sortKey:"",isAsc:""});function l(){i.pagination.list=[],u()}function u(){return e(this,null,(function*(){i.loadStatus="loading";const{code:e,data:t}=yield a.BrokerageApi.getBrokerageUserChildSummaryPage({pageNo:i.pagination.pageNo,pageSize:i.pagination.pageSize,level:i.level,"sortingField.order":i.isAsc,"sortingField.field":i.sortKey,nickname:i.nickname});0===e&&(i.pagination.list=o.lodash.concat(i.pagination.list,t.list),i.pagination.total=t.total,i.loadStatus=i.pagination.list.length<i.pagination.total?"more":"noMore")}))}function c(e){i.pagination.list=[],i.level=e+"",u()}function p(e,o){i.pagination.list=[],s.value=e+o.toUpperCase(),i.isAsc=o,i.sortKey=e,u()}return o.onLoad((()=>e(this,null,(function*(){yield u();const{data:e}=yield a.BrokerageApi.getBrokerageUserSummary();i.summary=e})))),o.onReachBottom((()=>{"noMore"!==i.loadStatus&&(i.pagination.pageNo++,u())})),(e,a)=>o.e({a:o.t(i.summary.firstBrokerageUserCount+i.summary.secondBrokerageUserCount||0),b:o.t(i.summary.firstBrokerageUserCount||0),c:o.n(1==i.level?"item on":"item"),d:o.o((e=>c(1))),e:o.t(i.summary.secondBrokerageUserCount||0),f:o.n(2==i.level?"item on":"item"),g:o.o((e=>c(2))),h:o.o(l),i:i.nickname,j:o.o((e=>i.nickname=e.detail.value)),k:o.o(l),l:"userCountDESC"===s.value},"userCountDESC"===s.value?{m:o.o((e=>p("userCount","asc")))}:"userCountASC"===s.value?{o:o.o((e=>p("userCount","desc")))}:{p:o.o((e=>p("userCount","desc")))},{n:"userCountASC"===s.value,q:"priceDESC"===s.value},"priceDESC"===s.value?{r:o.o((e=>p("price","asc")))}:"priceASC"===s.value?{t:o.o((e=>p("price","desc")))}:{v:o.o((e=>p("price","desc")))},{s:"priceASC"===s.value,w:"orderCountDESC"===s.value},"orderCountDESC"===s.value?{x:o.o((e=>p("orderCount","asc")))}:"orderCountASC"===s.value?{z:o.o((e=>p("orderCount","desc")))}:{A:o.o((e=>p("orderCount","desc")))},{y:"orderCountASC"===s.value,B:o.f(i.pagination.list,((e,a,r)=>({a:e.avatar,b:o.t(e.nickname),c:o.t(o.unref(t.sheep).$helper.timeFormat(e.brokerageTime,"yyyy-mm-dd hh:MM:ss")),d:o.t(e.brokerageUserCount||0),e:o.t(e.orderCount||0),f:o.t(e.brokeragePrice||0),g:a}))),C:0===i.pagination.list.length},(i.pagination.list.length,{}),{D:o.n(i.scrollTop?"team-wrap":""),E:o.p({title:"我的团队",navbar:"inner"}),F:o.s(e.__cssVars())})}},n=o._export_sfc(r,[["__scopeId","data-v-c7d9df93"]]);r.__runtimeHooks=1,wx.createPage(n);
|