require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugin/tongue_diagnosis/index"],{1929:function(t,n,o){"use strict";o.r(n);var e=o("1b6d"),i=o("2885");for(var s in i)["default"].indexOf(s)<0&&function(t){o.d(n,t,(function(){return i[t]}))}(s);o("cff6");var u=o("828b"),r=Object(u["a"])(i["default"],e["b"],e["c"],!1,null,"b40ab298",null,!1,e["a"],void 0);n["default"]=r.exports},"1b6d":function(t,n,o){"use strict";o.d(n,"b",(function(){return i})),o.d(n,"c",(function(){return s})),o.d(n,"a",(function(){return e}));var e={goods:function(){return Promise.all([o.e("common/vendor"),o.e("components/goods/goods")]).then(o.bind(null,"b7f4"))},loginModal:function(){return Promise.all([o.e("common/vendor"),o.e("components/login-modal/login-modal")]).then(o.bind(null,"e34a"))}},i=function(){var t=this.$createElement,n=(this._self._c,this.$util.lightColor(this.mainColor,.25));this.$mp.data=Object.assign({},{$root:{g0:n}})},s=[]},2885:function(t,n,o){"use strict";o.r(n);var e=o("e649"),i=o.n(e);for(var s in e)["default"].indexOf(s)<0&&function(t){o.d(n,t,(function(){return e[t]}))}(s);n["default"]=i.a},6068:function(t,n,o){},a19c:function(t,n,o){"use strict";(function(t,n){var e=o("47a9");o("4c1a");e(o("3240"));var i=e(o("1929"));t.__webpack_require_UNI_MP_PLUGIN__=o,n(i.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},cff6:function(t,n,o){"use strict";var e=o("6068"),i=o.n(e);i.a},e649:function(t,n,o){"use strict";(function(t){var e=o("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=e(o("7ca3")),s=o("8f59");function u(t,n){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),o.push.apply(o,e)}return o}function r(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?u(Object(o),!0).forEach((function(n){(0,i.default)(t,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):u(Object(o)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))}))}return t}var a={components:{goods:function(){Promise.all([o.e("common/vendor"),o.e("components/goods/goods")]).then(function(){return resolve(o("b7f4"))}.bind(null,o)).catch(o.oe)},DirectBuy:function(){o.e("plugin/tongue_diagnosis/PageComponents/DirectBuy").then(function(){return resolve(o("422f2"))}.bind(null,o)).catch(o.oe)}},data:function(){return{showDirectBuy:!1,indexData:{goods:[]}}},computed:r(r({},(0,s.mapGetters)(["user","is_login","base"])),{},{canGoodsBuy:function(){var t=this.base&&this.base.tongue_diagnosis&&this.base.tongue_diagnosis.huoqu_num_method;return Array.isArray(t)?t.includes(1):1==t},canDirectBuy:function(){var t=this.base&&this.base.tongue_diagnosis&&this.base.tongue_diagnosis.huoqu_num_method;return Array.isArray(t)?t.includes(2):2==t}}),onLoad:function(){},onShow:function(){this.getUser(),this.getIndex()},methods:r(r({},(0,s.mapActions)(["getUser"])),{},{getIndex:function(){var t=this;this.$util.get("tongue_diagnosis/diagnose/index").then((function(n){1==n.code&&(t.indexData=n.data)}))},openDirectBuy:function(){this.showDirectBuy=!0},closeDirectBuy:function(){this.showDirectBuy=!1},goQuick:function(){return this.is_login?this.user.tongue_diagnosis_num<=0?this.handleNumNotEnough():void this.$util.jump("/plugin/tongue_diagnosis/submit?mode=quick"):this.$util.authLogin()},goSession:function(){return this.is_login?this.user.tongue_diagnosis_num<=1?this.handleNumNotEnough():void this.$util.jump("/plugin/tongue_diagnosis/submit?mode=session"):this.$util.authLogin()},handleNumNotEnough:function(){var n=this;if(this.canGoodsBuy){var o=this.indexData&&this.indexData.main_recommendation_goods;if(o)return void t.showModal({title:"提示",content:"次数不足，前往获取次数",showCancel:!0,success:function(t){var e=t.confirm;e&&n.$util.jump("/pages/goods/detail?id="+o.id)}});if(this.indexData&&Array.isArray(this.indexData.goods)&&this.indexData.goods.length)return void t.pageScrollTo({selector:"#goodsSection",duration:300})}this.canDirectBuy?this.openDirectBuy():this.$util.toast("次数不足")},goRecord:function(){if(!this.is_login)return this.$util.authLogin();this.$util.jump("/plugin/tongue_diagnosis/list")}})};n.default=a}).call(this,o("df3c")["default"])}},[["a19c","common/runtime","common/vendor"]]]);