Files
Smart-Farm/front/home/pages/farm/detail.js
2025-12-22 17:13:05 +08:00

1 line
5.3 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["home/pages/farm/detail"],{"0a08":function(t,e,n){"use strict";n.r(e);var i=n("1290"),a=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},1290:function(t,e,n){"use strict";(function(t){var i=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("2eee")),o=i(n("c973")),r=i(n("9523")),s=n("26cb");function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){(0,r.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var u={components:{},data:function(){return{options:{},detail:{},activeIndex:0,tabList:[{id:1,title:"商品"},{id:2,title:"土地"},{id:3,title:"认养"},{id:4,title:"监控"}],param:{page:1},list:{data:[]},loading:!0,popupInfo:{},lockTap:!1}},computed:(0,s.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},subColor:function(t){return t.config.configInfo.subColor},configInfo:function(t){return t.config.configInfo},userInfo:function(t){return t.user.userInfo}}),onLoad:function(t){this.$util.showLoading(),this.options=t,this.initIndex()},onPullDownRefresh:function(){t.showNavigationBarLoading(),this.initRefresh(),t.stopPullDownRefresh()},onReachBottom:function(){this.list.current_page>=this.list.last_page||this.loading||(this.param.page=this.param.page+1,this.loading=!0,this.getList())},onShareAppMessage:function(t){var e=this.userInfo.id,n=this.detail,i=n.id,a=n.title,o=n.cover,r="/home/pages/farm/detail?id=".concat(i,"&pid=").concat(e);return this.$util.log(r),{title:a,imageUrl:o,path:r}},methods:l(l({},(0,s.mapActions)(["getConfigInfo"])),{},{initIndex:function(){var t=this;return(0,o.default)(a.default.mark((function e(){var n,i;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.options.id,e.next=3,t.$api.home.farmerInfo({id:n});case 3:i=e.sent,i.is_open=1,i.star_percent=(1*i.star/5*100).toFixed(2)+"%",t.detail=i,t.getList(),t.$util.hideAll();case 9:case"end":return e.stop()}}),e)})))()},initRefresh:function(){this.param.page=1,this.initIndex()},handerTabChange:function(t){this.activeIndex=t,this.$util.showLoading(),this.param.page=1,this.list.data=[],this.getList()},getList:function(){var t=this;return(0,o.default)(a.default.mark((function e(){var n,i,o,r,s,c,l,u,d,f,p;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.list,i=t.tabList,o=t.activeIndex,r=t.$util.deepCopy(t.param),s=t.options.id,c=i[o].id,4===c&&(r.sort=1),r=Object.assign({},r,{farmer_id:s}),l={1:{key:"shop",model:"goodsList"},2:{key:"land",model:"landList"},3:{key:"claim",model:"claimList"},4:{key:"home",model:"monitorList"}},u=l[c],d=u.key,f=u.model,e.next=10,t.$api[d][f](r);case 10:p=e.sent,3==c&&p.data.map((function(t){var e=t.stock,n=t.sale_num;t.precent=(n/(e+n)*100).toFixed(2)+"%"})),1==t.param.page||(p.data=n.data.concat(p.data)),t.list=p,t.loading=!1,t.$util.hideAll();case 15:case"end":return e.stop()}}),e)})))()},toMap:function(){var e=this;return(0,o.default)(a.default.mark((function n(){var i,o,r,s;return a.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=e.detail,o=i.lat,r=i.lng,s=i.address,n.next=3,e.$util.checkAuth({type:"userLocation"});case 3:return n.next=5,t.getLocation({type:"gcj02"});case 5:return n.next=7,t.openLocation({latitude:1*o,longitude:1*r,name:s,scale:28});case 7:case"end":return n.stop()}}),n)})))()},goDetail:function(t){var e=this.list.data[t].id,n=this.tabList[this.activeIndex].id,i="".concat({1:"/shop/pages/detail",2:"/land/pages/detail",3:"/claim/pages/detail",4:"/home/pages/monitor/detail"}[n],"?id=").concat(e);this.$util.goUrl({url:i})}})};e.default=u}).call(this,n("543d")["default"])},"8e73":function(t,e,n){"use strict";var i=n("a701"),a=n.n(i);a.a},"96a2":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.detail.id?t.tabList.length:null),i=t.detail.id&&t.loading?t.list.current_page>=t.list.last_page&&t.list.data.length>0:null,a=t.detail.id?!t.loading&&t.list.data.length<=0&&1==t.list.current_page:null;t._isMounted||(t.e0=function(e){return e.stopPropagation(),t.$util.goUrl({url:"/home/pages/farm/info?id="+t.options.id})}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:i,g2:a}})},a=[]},a701:function(t,e,n){},b816:function(t,e,n){"use strict";n.r(e);var i=n("96a2"),a=n("0a08");for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("8e73");var r=n("f0c5"),s=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=s.exports},b913:function(t,e,n){"use strict";(function(t,e){var i=n("4ea4");n("b03e");i(n("66fd"));var a=i(n("b816"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])}},[["b913","common/runtime","common/vendor"]]]);