beehole-store-server
Version:
www.bee-hole.com
1 lines • 3.57 kB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-482fc6fb"],{"775c":function(t,e,n){"use strict";n.r(e);var c=n("5530"),i=(n("d81d"),n("c740"),n("8d4c")),o=n("c7a1"),r=n("5880");e["default"]={name:"currencyPage",data:function(){return{formData:{exchange_rates:[],quote_currency:""},currency_disable:!1}},components:{HuoBi:i["a"]},computed:Object(c["a"])({},Object(r["mapGetters"])(["shopId"])),created:function(){this.init()},methods:{chushihuaHuoBi:function(){var t=this;Object(o["d"])().then((function(e){e.payment_supported_currency&&e.payment_supported_currency.map((function(e){var n=t._.findIndex(t.formData.exchange_rates,{currency:e});-1===n&&t.formData.exchange_rates.push({currency:e,rate:1})}))}))},init:function(){var t=this;this.$store.dispatch("GetShopList").then((function(e){var n=t.$store.getters.shopInfo(t.shopId);if(n)try{t.formData=JSON.parse(n.currency_setter),""!==t.formData.quote_currency&&(t.currency_disable=!0)}catch(c){}t.chushihuaHuoBi()}))},onSubmit:function(){var t=this;this._.map(this.formData.exchange_rates,(function(e){e.currency===t.formData.quote_currency&&(e.rate=1)})),Object(o["e"])(Object(c["a"])(Object(c["a"])({},this.formData),{},{shop_id:this.shopId})).then((function(e){t.init(),e.quote_currency&&t.$message.info("保存汇率配置成功")}))}}}},"8d4c":function(t,e,n){"use strict";n("b0c0");var c=function(){var t=this,e=t._self._c;return t.huobiList&&t.huobiList.length?e("a-select",{attrs:{placeholder:"请选择","allow-clear":"",disabled:t.disable,getPopupContainer:function(t){return t.parentNode}},on:{change:t.back},model:{value:t.checkedHuoBi,callback:function(e){t.checkedHuoBi=e},expression:"checkedHuoBi"}},t._l(t.huobiList,(function(n,c){return e("a-select-option",{key:c,attrs:{value:n.name}},[t._v(t._s(n.name))])})),1):t._e()},i=[],o=(n("d81d"),n("7db0"),n("d3b7"),n("c7a1")),r={name:"HuoBiSelect",props:{huobi:{type:String,default:""},disable:{type:Boolean,default:!1}},data:function(){return{huobiList:[],checkedHuoBi:this.huobi}},watch:{huobi:function(t,e){t!==e&&(this.checkedHuoBi=t)}},created:function(){this.initLit()},methods:{initLit:function(){var t=this;Object(o["d"])().then((function(e){e.quote_currency&&e.quote_currency.map((function(e){t.huobiList.push({name:e})}))}))},back:function(t){var e=this,n=this.huobiList.find((function(t){return t.name===e.checkedHuoBi}));this.$emit("change",this.checkedHuoBi),this.$emit("changeView",n)}}},u=r,a=n("2877"),s=Object(a["a"])(u,c,i,!1,null,null,null);e["a"]=s.exports},c7a1:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return r})),n.d(e,"d",(function(){return u})),n.d(e,"e",(function(){return a})),n.d(e,"f",(function(){return s})),n.d(e,"g",(function(){return h})),n.d(e,"c",(function(){return d}));var c=n("b775"),i={configAdd:"/mallconfig/save",configList:"/mallconfig/list",huobiGet:"/pmethod/currency/get",huobiSet:"/pmethod/currencyrates/set",systemGet:"/config/sys/get",systemSet:"/config/sys/set",copyrightApi:"/config/copyright"};function o(t){return Object(c["b"])({url:i.configAdd,method:"post",data:t})}function r(t){return Object(c["b"])({url:i.configList,method:"post",params:t})}function u(t){return Object(c["b"])({url:i.huobiGet,method:"get",params:t})}function a(t){return Object(c["b"])({url:i.huobiSet,method:"post",params:t})}function s(t){return Object(c["b"])({url:i.systemGet,method:"post",params:t})}function h(t){return Object(c["b"])({url:i.systemSet,method:"post",data:t})}function d(t){return Object(c["b"])({url:i.copyrightApi,method:"post",data:t})}}}]);