text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["me.carbonAccount"],{"08ef":function(t,i,a){t.exports=a.p+"static/img/weeding-1.8c8ba6c5.png"},"0d0a":function(t,i,a){"use strict";var n=function(){var t=this,i=t.$createElement,a=t._self._c||i;return a("div",{staticClass:"item"},[a("div",{staticClass:"left"},[a("div",{staticClass:"img"},[a("img",{attrs:{src:t.getImg(t.item.footprintName),alt:""}})]),a("div",{staticClass:"content"},[a("div",{staticClass:"name"},[t._v(t._s(t.item.footprintName))]),a("div",{staticClass:"time"},[t._v(t._s(t.timeHandle(t.item.createTime)))])])]),a("div",{staticClass:"credits"},["c"==t.item.footprintCategory?a("span",[t._v("-")]):t._e(),"p"==t.item.footprintCategory?a("span",[t._v("+")]):t._e(),a("span",[t._v(t._s(t.item.carbonCredit))])])])},e=[],r=a("ed08"),o={name:"FootPrint",data(){return{}},props:{item:{type:Object,default:()=>{}}},methods:{getImg(t){return t.includes("Seed")?a("ae25"):t.includes("Water")?a("991e"):t.includes("Fertilize")?a("7842"):t.includes("Weed")?a("08ef"):t.includes("Harvest")?a("e630"):t.includes("Add")?a("3527"):t.includes("Irrigate")?a("991e"):t.includes("Pest Control")?a("aa66"):a("3527")},timeHandle(t){return Object(r["b"])(t)}}},s=o,c=(a("dec3"),a("2877")),u=Object(c["a"])(s,n,e,!1,null,"26d63608",null);i["a"]=u.exports},3527:function(t,i,a){t.exports=a.p+"static/img/farm-big-4.74e71070.png"},4129:function(t,i,a){},"4c1b":function(t,i,a){"use strict";a.r(i);var n=function(){var t=this,i=t.$createElement,a=t._self._c||i;return a("div",[a("div",{staticClass:"background"}),a("div",{staticClass:"part firstpart"},[a("div",{staticClass:"title"},[t._v("My Produce")]),a("div",{staticClass:"credit"},[a("div",{staticClass:"carbon-credit"},[a("div",{staticClass:"pic"}),a("div",{staticClass:"font"},[t._v(t._s(t.carbonCredit))])])])]),a("div",{staticClass:"part"},[a("div",{staticClass:"title"},[t._v("My Carbon Behavior")]),a("div",{staticClass:"behavior"},[t._m(0),a("div",{staticClass:"tabs"},[a("van-tabs",{attrs:{color:"#00B459","title-active-color":"#00B459"},on:{click:t.clickTab},model:{value:t.behaviorType,callback:function(i){t.behaviorType=i},expression:"behaviorType"}},[a("van-tab",{attrs:{title:"All"}}),a("van-tab",{attrs:{title:"Consume"}}),a("van-tab",{attrs:{title:"Plant"}})],1)],1),a("div",{staticClass:"content content-border"},t._l(t.carbonFootprintList,(function(t,i){return a("FootPrint",{key:i,attrs:{item:t}})})),1)])]),a("div",{staticClass:"part"},[a("div",{staticClass:"title"},[t._v("Account Authorization")]),a("div",{staticClass:"info"},[t._v(" “Green Farm” would like permission to share your carbon credit account data with institutions below, while we keep your data on our end using privacy-enhancing technology. Your data will be used to train the federated learning network and deliver personalized financial support to you. ")]),a("div",{staticClass:"content content-border"},[a("van-list",t._l(t.authorizationList,(function(i,n){return a("div",{key:n,staticClass:"authorization"},[a("div",{staticClass:"img"},[a("img",{attrs:{src:i.imgUrl}})]),a("div",{staticClass:"key"},[t._v(t._s(i.key))]),a("div",{staticClass:"switch"},[a("van-switch",{attrs:{"active-color":"#00B459","inactive-color":"#999999",size:"0.45rem"},on:{click:t.changeAuthorization},model:{value:i.authorization,callback:function(a){t.$set(i,"authorization",a)},expression:"item.authorization"}})],1)])})),0)],1)])])},e=[function(){var t=this,i=t.$createElement,a=t._self._c||i;return a("div",{staticClass:"verticalBar"},[a("div",{staticClass:"line1"}),a("div",{staticClass:"line2"})])}],r=a("c24f"),o=a("5fd4"),s=a("0d0a"),c={components:{FootPrint:s["a"]},data(){return{behaviorType:0,carbonCredit:"",carbonFootprintList:[],carbonFootprintListAll:[],carbonFootprintListConsume:[],carbonFootprintListPlant:[],authorizationList:[{key:"Agricultural Bank of China",imgUrl:a("a163"),authorization:!0},{key:"Citibank",imgUrl:a("d918"),authorization:!0},{key:"Standard Chartered Bank",imgUrl:a("95aa"),authorization:!0}]}},mounted(){this.queryUserInfo(),this.getCarbonFootprint()},methods:{async queryUserInfo(){try{const t=await Object(r["c"])({username:this.$store.state.user.username});this.carbonCredit=t.data.carbonCredit}catch(t){console.log(t)}},async getCarbonFootprint(){const t=await Object(o["a"])({username:this.$store.state.user.username});try{this.carbonFootprintList=t.data,this.carbonFootprintListAll=t.data,this.classificationFootprint(t.data)}catch(i){console.log(i)}},classificationFootprint(t){for(let i=0;i<t.length;i++)"c"==t[i].footprintCategory?this.carbonFootprintListConsume.push(t[i]):"p"==t[i].footprintCategory&&this.carbonFootprintListPlant.push(t[i])},clickTab(t){this.behaviorType=t;let i="";switch(t){case 0:i="All",this.carbonFootprintList=this.carbonFootprintListAll;break;case 1:i="Consume",this.carbonFootprintList=this.carbonFootprintListConsume;break;case 2:i="Plant",this.carbonFootprintList=this.carbonFootprintListPlant;break}},changeAuthorization(){}}},u=c,l=(a("4cb0"),a("2877")),d=Object(l["a"])(u,n,e,!1,null,"c101abaa",null);i["default"]=d.exports},"4cb0":function(t,i,a){"use strict";a("4129")},5806:function(t,i,a){},"5fd4":function(t,i,a){"use strict";a.d(i,"c",(function(){return e})),a.d(i,"b",(function(){return r})),a.d(i,"a",(function(){return o})),a.d(i,"d",(function(){return s})),a.d(i,"e",(function(){return c}));var n=a("b775");function e(t){return Object(n["a"])({url:"/plant-task/query",method:"get",params:t})}function r(t){return Object(n["a"])({url:"/carbon-footprint/queryFromDashboard",method:"get",params:t})}function o(t){return Object(n["a"])({url:"/carbon-footprint/query",method:"get",params:t})}function s(t){return Object(n["a"])({url:"/recommendation/queryFarms",method:"get",params:t})}function c(t){return Object(n["a"])({url:"/recommendation/queryProducts",method:"get",params:t})}},7842:function(t,i,a){t.exports=a.p+"static/img/picking-vegetables-1.0955e4fd.png"},"95aa":function(t,i,a){t.exports=a.p+"static/img/sc-bank-logo.d8c08b81.png"},"991e":function(t,i,a){t.exports=a.p+"static/img/irrigation-1.0dcc354f.png"},a163:function(t,i,a){t.exports=a.p+"static/img/abc-logo-2.cf39bf05.png"},aa66:function(t,i,a){t.exports=a.p+"static/img/pest-control.fb6a1d13.png"},ae25:function(t,i,a){t.exports=a.p+"static/img/seeding-1.3d1beb3f.png"},c24f:function(t,i,a){"use strict";a.d(i,"a",(function(){return e})),a.d(i,"b",(function(){return r})),a.d(i,"c",(function(){return o}));var n=a("b775");function e(t){return Object(n["a"])({url:"/user/login",method:"post",params:t})}function r(t){return Object(n["a"])({url:"/user/logout",method:"get",params:t})}function o(t){return Object(n["a"])({url:"/user/queryInfo",method:"get",params:t})}},d918:function(t,i,a){t.exports=a.p+"static/img/citibank-logo.c34f7d9d.png"},dec3:function(t,i,a){"use strict";a("5806")},e630:function(t,i,a){t.exports=a.p+"static/img/harvest-6.f9b48565.png"}}]);