(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/user/tradeStats"],{254:function(e,n,t){"use strict";(function(e,n){var o=t(4);t(26);o(t(25));var a=o(t(255));e.__webpack_require_UNI_MP_PLUGIN__=t,n(a.default)}).call(this,t(1)["default"],t(2)["createPage"])},255:function(e,n,t){"use strict";t.r(n);var o=t(256),a=t(258);for(var r in a)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return a[e]}))}(r);t(260);var i,s=t(32),c=Object(s["default"])(a["default"],o["render"],o["staticRenderFns"],!1,null,"5e3da914",null,!1,o["components"],i);c.options.__file="pages/user/tradeStats.vue",n["default"]=c.exports},256:function(e,n,t){"use strict";t.r(n);var o=t(257);t.d(n,"render",(function(){return o["render"]})),t.d(n,"staticRenderFns",(function(){return o["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return o["recyclableRender"]})),t.d(n,"components",(function(){return o["components"]}))},257:function(e,n,t){"use strict";var o;t.r(n),t.d(n,"render",(function(){return a})),t.d(n,"staticRenderFns",(function(){return i})),t.d(n,"recyclableRender",(function(){return r})),t.d(n,"components",(function(){return o}));try{o={uLoadingPage:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-loading-page/u-loading-page")]).then(t.bind(null,411))},uIcon:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(t.bind(null,386))},lEchart:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/lime-echart/components/l-echart/l-echart")]).then(t.bind(null,419))},uDatetimePicker:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker")]).then(t.bind(null,428))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var a=function(){var e=this,n=e.$createElement,t=(e._self._c,e.load?null:e.totalEarnings.toFixed(2)),o=e.load?null:e.list.length;e._isMounted||(e.e0=function(n){e.startDateShow=!1},e.e1=function(n){e.endDateShow=!1}),e.$mp.data=Object.assign({},{$root:{g0:t,g1:o}})},r=!1,i=[];a._withStripped=!0},258:function(e,n,t){"use strict";t.r(n);var o=t(259),a=t.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=a.a},259:function(e,n,t){"use strict";(function(e){var o=t(13);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t(195));function r(e){if("function"!==typeof WeakMap)return null;var n=new WeakMap,t=new WeakMap;return(r=function(e){return e?t:n})(e)}function i(e,n){if(!n&&e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!==typeof e)return{default:e};var t=r(n);if(t&&t.has(e))return t.get(e);var a={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var c=i?Object.getOwnPropertyDescriptor(e,s):null;c&&(c.get||c.set)?Object.defineProperty(a,s,c):a[s]=e[s]}return a.default=e,t&&t.set(e,a),a}var s={data:function(){return{totalProfit:"",totalEarnings:"",bgcColor:{background:""},nav:[{name:"本月",is:!0,current:0},{name:"近三月",is:!1,current:1},{name:"近一年",is:!1,current:2},{name:"自定义",is:!1,current:0}],navIndex:0,list:[{name:"长城汽车",code:"601633",price:"2023-04-10",gains:"2023-04-10",suoshu:"5422.12万",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"},{name:"长城汽车",code:"601633",price:"33.21",gains:"10%",suoshu:"电子设备制造",color:"#D9001B"}],isEarnings:!0,startDate:"",startDateShow:!1,endDate:"",endDateShow:!1,minDate:null,load:!0}},onLoad:function(e){this.rending()},mounted:function(){var e=this;this.$nextTick((function(){e.initEchartsZ()}))},methods:{selectNav:function(e){var n=this;this.nav.forEach((function(t){t.name==e?(t.is=!0,n.navIndex=t.current,n.$nextTick((function(){n.initEchartsZ(),console.log("执行方法")}))):t.is=!1}))},selectMainNav:function(e){var n=this;this.isEarnings=e,this.$nextTick((function(){n.initEchartsZ()}))},confirmStartDate:function(e){var n=this;this.$nextTick((function(){n.minDate=new Date(e.value).getTime(),console.log(n.minDate),n.startDate=n.getTime(e.value)})),this.startDateShow=!1},confirmEndDate:function(e){var n=this;this.$nextTick((function(){n.endDate=n.getTime(e.value)})),this.endDateShow=!1},selectStartDate:function(){this.endDateShow||(this.startDateShow=!0)},selectEndDate:function(){this.startDate?this.startDateShow||(this.endDateShow=!0):e.showToast({title:"请先选择开始时间",icon:"none"})},toAllBreakeven:function(){e.navigateTo({url:"/pages/user/allBreakeven"})},toBreakevenDetail:function(n,t){e.navigateTo({url:"/pages/user/breakevenDetail?id=".concat(n,"&name=").concat(t)})},getTime:function(e){var n=new Date(e),t=n.getFullYear(),o=n.getMonth()+1,a=n.getDate(),r=n.getHours(),i=n.getMinutes(),s=n.getSeconds();return s<10&&(s="0"+s),r<10&&(r="0"+r),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),"".concat(t,"-").concat(o,"-").concat(a)},rending:function(){var n=this;this.$api.post("/transaction/totalEarnings",{securityCode:""}).then((function(t){t&&(n.totalProfit=t.totalEarnings,n.totalEarnings=t.earningsRate,t.earningsRate>0?setTimeout((function(){e.setNavigationBarColor({frontColor:"#ffffff",backgroundColor:"#F93938"})}),100):setTimeout((function(){e.setNavigationBarColor({frontColor:"#ffffff",backgroundColor:"#568EFF"})}),100),n.load=!1,console.log(t))})).catch((function(e){console.log(e)})),this.$api.post("/transaction/profitOrLoss",{endDate:"",keyWord:"",pageModel:{pageNo:0,pageSize:10,sortField:"",sortWay:""},securityType:"",sortAmount:1,startDate:"",type:""}).then((function(e){e&&(n.list=e.list)})).catch((function(e){console.log(e)}))},initEchartsZ:function(){var e=this;console.log("执行函数"),this.$api.post("/transaction/earningsLine",{endDate:this.endDate,securityCode:"",startDate:this.startDate,timeType:this.navIndex,type:this.isEarnings?"1":"2"}).then((function(n){n&&(console.log(n),e.$refs.chart.init(a,(function(e){var t={toolbox:{feature:{dataZoom:{yAxisIndex:"none"},restore:{},saveAsImage:{}}},xAxis:{type:"time",boundaryGap:!1},yAxis:{type:"value",boundaryGap:[0,"100%"]},dataZoom:[{type:"inside",start:0,end:100},{show:!1,start:0,end:100}],series:[{name:"数据",type:"line",smooth:!0,symbol:"none",data:n}]};e.setOption(t)}),{locale:"ZH"}),console.log(n))})).catch((function(e){console.log(e)}))}}};n.default=s}).call(this,t(2)["default"])},260:function(e,n,t){"use strict";t.r(n);var o=t(261),a=t.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(r);n["default"]=a.a},261:function(e,n,t){}},[[254,"common/runtime","common/vendor"]]]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/user/tradeStats.js.map