From 2370c6059a07a3a719f7e6c4d4cf60b8b7ab300e Mon Sep 17 00:00:00 2001 From: liufei Date: Mon, 30 Sep 2024 22:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=85=83=E7=B4=A0=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0ID=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/dist/admin.js | 2 +- js/dist/admin.js.map | 2 +- js/src/admin/components/StoreListItem.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index a9b5d98..bc92907 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t={535:t=>{"use strict";var s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var s={},i=0;i<10;i++)s["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(s).map((function(t){return s[t]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(t){o[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}()?Object.assign:function(t,a){for(var e,n,r=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l{"use strict";var o=i(535),a="function"==typeof Symbol&&Symbol.for;a&&Symbol.for("react.element"),a&&Symbol.for("react.portal"),a&&Symbol.for("react.fragment"),a&&Symbol.for("react.strict_mode"),a&&Symbol.for("react.profiler"),a&&Symbol.for("react.provider"),a&&Symbol.for("react.context"),a&&Symbol.for("react.forward_ref"),a&&Symbol.for("react.suspense"),a&&Symbol.for("react.memo"),a&&Symbol.for("react.lazy"),"function"==typeof Symbol&&Symbol.iterator;function e(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i{"use strict";i(488)}},s={};function i(o){var a=s[o];if(void 0!==a)return a.exports;var e=s[o]={exports:{}};return t[o](e,e.exports,i),e.exports}i.n=t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return i.d(s,{a:s}),s},i.d=(t,s)=>{for(var o in s)i.o(s,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},i.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";i.r(o);const t=flarum.core.compat["admin/app"];var s=i.n(t);function a(t,s){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},a(t,s)}function e(t,s){t.prototype=Object.create(s.prototype),t.prototype.constructor=t,a(t,s)}const n=flarum.core.compat["admin/components/ExtensionPage"];var r=i.n(n);const l=flarum.core.compat["common/components/Button"];var d=i.n(l);const c=flarum.core.compat["common/components/Modal"];var p=i.n(c);i(684);const u=flarum.core.compat["components/Modal"];var h=i.n(u);const y=flarum.core.compat["components/Button"];var g=i.n(y);const f=flarum.core.compat["common/utils/Stream"];var b=i.n(f);const v=flarum.core.compat["common/components/Switch"];var x=i.n(v);const w=flarum.core.compat["common/components/Select"];var N=i.n(w),D=function(t){function i(){for(var s,i=arguments.length,o=new Array(i),a=0;a').appendTo("body").hide().trigger("click").on("change",(function(t){var o=new FormData;o.append("file",t.target.files[0]),s().request({url:s().forum.attribute("apiUrl")+"/store/upload/icon",method:"POST",body:o}).then((function(t){i.params.icon=b()(t.data.attributes.path),i.loading=!1,m.redraw()}))}))},o.onsubmit=function(t){var i=this;t.preventDefault(),this.loading=!0,s().request({method:this.method,url:s().forum.attribute("apiUrl")+"/store/goods",body:this.params}).then((function(){return location.reload()}),(function(t){i.loading=!1,i.handleErrors(t)}))},i}(h()),k=function(t){function i(){for(var s,i=arguments.length,o=new Array(i),a=0;a{var t={535:t=>{"use strict";var s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var s={},i=0;i<10;i++)s["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(s).map((function(t){return s[t]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(t){o[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}()?Object.assign:function(t,a){for(var e,n,r=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l{"use strict";var o=i(535),a="function"==typeof Symbol&&Symbol.for;a&&Symbol.for("react.element"),a&&Symbol.for("react.portal"),a&&Symbol.for("react.fragment"),a&&Symbol.for("react.strict_mode"),a&&Symbol.for("react.profiler"),a&&Symbol.for("react.provider"),a&&Symbol.for("react.context"),a&&Symbol.for("react.forward_ref"),a&&Symbol.for("react.suspense"),a&&Symbol.for("react.memo"),a&&Symbol.for("react.lazy"),"function"==typeof Symbol&&Symbol.iterator;function e(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i{"use strict";i(488)}},s={};function i(o){var a=s[o];if(void 0!==a)return a.exports;var e=s[o]={exports:{}};return t[o](e,e.exports,i),e.exports}i.n=t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return i.d(s,{a:s}),s},i.d=(t,s)=>{for(var o in s)i.o(s,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},i.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";i.r(o);const t=flarum.core.compat["admin/app"];var s=i.n(t);function a(t,s){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,s){return t.__proto__=s,t},a(t,s)}function e(t,s){t.prototype=Object.create(s.prototype),t.prototype.constructor=t,a(t,s)}const n=flarum.core.compat["admin/components/ExtensionPage"];var r=i.n(n);const l=flarum.core.compat["common/components/Button"];var d=i.n(l);const c=flarum.core.compat["common/components/Modal"];var p=i.n(c);i(684);const u=flarum.core.compat["components/Modal"];var h=i.n(u);const g=flarum.core.compat["components/Button"];var y=i.n(g);const f=flarum.core.compat["common/utils/Stream"];var b=i.n(f);const v=flarum.core.compat["common/components/Switch"];var x=i.n(v);const w=flarum.core.compat["common/components/Select"];var N=i.n(w),D=function(t){function i(){for(var s,i=arguments.length,o=new Array(i),a=0;a').appendTo("body").hide().trigger("click").on("change",(function(t){var o=new FormData;o.append("file",t.target.files[0]),s().request({url:s().forum.attribute("apiUrl")+"/store/upload/icon",method:"POST",body:o}).then((function(t){i.params.icon=b()(t.data.attributes.path),i.loading=!1,m.redraw()}))}))},o.onsubmit=function(t){var i=this;t.preventDefault(),this.loading=!0,s().request({method:this.method,url:s().forum.attribute("apiUrl")+"/store/goods",body:this.params}).then((function(){return location.reload()}),(function(t){i.loading=!1,i.handleErrors(t)}))},i}(h()),k=function(t){function i(){for(var s,i=arguments.length,o=new Array(i),a=0;aQ.length&&Q.push(a)}\nfunction T(a,b,c,e){var d=typeof a;if(\"undefined\"===d||\"boolean\"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,\"\"===b?\".\"+U(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var k=0;k {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\nimport Stream from \"flarum/common/utils/Stream\";\nimport Switch from \"flarum/common/components/Switch\";\nimport Select from \"flarum/common/components/Select\";\n\nexport default class StoreGoodsDetailModal extends Modal {\n\n private pageTitle: string = \"\"\n private moreResults: boolean = false\n private iconList: Array = [];\n private method: string = 'POST';\n private params: object = {\n status: Stream(1),\n code: Stream(),\n title: Stream(),\n desc: Stream(),\n price: Stream(0),\n stock: Stream(0),\n discount: Stream(0),\n discountLimit: Stream(0),\n discountLimitUnit: Stream('days'),\n type: Stream('permanent'),\n outtime: Stream(0),\n icon: Stream(),\n hide: Stream(0),\n repeat: Stream(1),\n autoDeduction: Stream(0),\n };\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.method = 'POST';\n this.moreResults = false;\n this.params.code = Stream(this.attrs.code || '');\n this.params.title = Stream(this.attrs.title || '');\n this.pageTitle = this.attrs.title;\n\n if (this.attrs.storeData) {\n this.method = 'PUT'\n this.params.id = Stream(this.attrs.storeData.id);\n this.params.status = Stream(this.attrs.storeData.status);\n this.params.code = Stream(this.attrs.storeData.code);\n this.params.title = Stream(this.attrs.storeData.title);\n this.params.desc = Stream(this.attrs.storeData.desc);\n this.params.price = Stream(this.attrs.storeData.price);\n this.params.stock = Stream(this.attrs.storeData.stock == -99 ? 0 : this.attrs.storeData.stock);\n this.params.discount = Stream(this.attrs.storeData.discount);\n this.params.discountLimit = Stream(this.attrs.storeData.discountLimit);\n this.params.discountLimitUnit = Stream(this.attrs.storeData.discountLimitUnit);\n this.params.type = Stream(this.attrs.storeData.type);\n this.params.outtime = Stream(this.attrs.storeData.outtime);\n this.params.icon = Stream(this.attrs.storeData.icon);\n this.params.hide = Stream(this.attrs.storeData.hide);\n this.params.repeat = Stream(this.attrs.storeData.repeat);\n this.params.autoDeduction = Stream(this.attrs.storeData.autoDeduction);\n }\n }\n\n className() {\n return '';\n }\n\n title() {\n return this.pageTitle;\n }\n\n onModalReady() {\n const _this = this;\n const closeButton = $(\".Modal-close .Button\");\n $(closeButton).prop('id', 'storeCloseButton');\n\n const closeButtonClone = closeButton.clone();\n $(closeButtonClone).prop('id', 'storeCloseIconButton');\n $(closeButtonClone).css('display', 'none');\n $(\".Modal-close\").append(closeButtonClone);\n\n $(closeButtonClone).on(\"click\", function(){\n _this.closeIcon();\n });\n }\n\n content() {\n return (\n
\n
\n
\n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-status\")}\n \n {\n this.params.status = Stream(Number(val))\n }}\n > \n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-code\")}\n {this.params.code()} \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-title\")}\n
\n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-desc\")}\n
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-price\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.goods-stock\")}
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-discount\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.goods-discount-limit\")}\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.goods-discount-limit-unit\")}\n {Select.component({\n options: {\n 'days': app.translator.trans(\"mattoid-store.lib.item-limit-unit-days\"),\n 'hour': app.translator.trans(\"mattoid-store.lib.item-limit-unit-hour\"),\n 'minute': app.translator.trans(\"mattoid-store.lib.item-limit-unit-minute\"),\n 'second': app.translator.trans(\"mattoid-store.lib.item-limit-unit-second\")\n },\n value: this.params.discountLimitUnit(),\n onchange: (val) => {\n this.params.discountLimitUnit = Stream(val)\n },\n })}\n \n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-type\")}
\n {Select.component({\n options: {\n 'permanent': app.translator.trans(\"mattoid-store.lib.item-type-permanent\"),\n 'limit': app.translator.trans(\"mattoid-store.lib.item-type-limit\")\n },\n value: this.params.type(),\n onchange: (val) => {\n this.params.type = Stream(val)\n },\n })}\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-outtime\")}
\n \n {app.translator.trans(\"mattoid-store.admin.settings.days\")}\n \n\n \n\n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-auto-deduction\")}\n \n {\n this.params.autoDeduction = Stream(Number(val))\n }}\n >\n \n \n
\n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-icon\")}\n
\n
\n
\n \n
\n
\n {\n this.uploadIcon(e)\n }}>\n {app.translator.trans('mattoid-store.admin.settings.goods-upload-button')}\n \n
\n
\n {\n this.showIcon(e);\n }}>\n {app.translator.trans('mattoid-store.admin.settings.show-icon-button')}\n \n
\n
\n \n\n
\n \n \n
\n\n
\n
\n {\n this.params.repeat = Stream(Number(val))\n }}\n >\n {app.translator.trans(\n \"mattoid-store.admin.settings.goods-repeat\"\n )}\n \n
\n
\n {\n this.params.hide = Stream(Number(val))\n }}\n >\n {app.translator.trans(\n \"mattoid-store.admin.settings.goods-hide\"\n )}\n \n
\n
\n \n\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n type: 'submit',\n loading: this.loading,\n },\n this.params.id ? app.translator.trans('mattoid-store.admin.settings.edit-store-goods') : app.translator.trans('mattoid-store.admin.settings.add-store-goods')\n )}\n
\n \n\n
\n
\n {\n this.iconList.map((item) => {\n return (\n
this.selectIconItem(item.attributes.url)}>\n \n \n
\n )\n })\n }\n
\n {!this.loading && this.iconList.length === 0 && (\n
\n {app.translator.trans(\"mattoid-store.lib.list-empty\")}
\n
\n )}\n\n {!this.loading && this.hasMoreResults() && (\n
\n \n
\n )}\n\n {this.loading &&
{this.loading}
}\n \n \n \n );\n }\n\n loadIconList(offset = 0) {\n this.loading = true;\n\n return app.store\n .find(\"/store/icon/list\", {\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.iconList, results.payload.data);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n loadMore() {\n this.loading = true;\n this.loadIconList(this.iconList.length);\n }\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n\n closeIcon() {\n this.pageTitle = this.attrs.title;\n $(\"#StoreGoods\").css(\"display\",\"block\");\n $(\"#storeCloseButton\").css(\"display\",\"block\");\n $(\"#StoreIcon\").css(\"display\",\"none\");\n $(\"#storeCloseIconButton\").css(\"display\",\"none\");\n m.redraw();\n }\n\n selectIconItem(url){\n this.pageTitle = this.attrs.title;\n $(\"#StoreGoods\").css(\"display\",\"block\");\n $(\"#storeCloseButton\").css(\"display\",\"block\");\n $(\"#StoreIcon\").css(\"display\",\"none\");\n $(\"#storeCloseIconButton\").css(\"display\",\"none\");\n this.params.icon(url);\n }\n\n showIcon(event) {\n $(\"#StoreGoods\").css(\"display\",\"none\");\n $(\"#storeCloseButton\").css(\"display\",\"none\");\n $(\"#StoreIcon\").css(\"display\",\"block\");\n $(\"#storeCloseIconButton\").css(\"display\",\"block\");\n this.pageTitle = app.translator.trans('mattoid-store.admin.settings.show-icon-button');\n this.iconList = [];\n this.loadIconList();\n }\n\n uploadIcon(event) {\n event.preventDefault();\n\n const $input = $('');\n\n $input.appendTo('body').hide().trigger('click').on('change', event => {\n const body = new FormData();\n body.append('file', event.target.files[0])\n\n app.request({\n url: `${app.forum.attribute('apiUrl')}/store/upload/icon`,\n method: 'POST',\n body,\n }).then((result) => {\n this.params.icon = Stream(result.data.attributes.path)\n this.loading = false;\n m.redraw();\n });\n })\n\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.request({\n method: this.method,\n url: app.forum.attribute('apiUrl') + '/store/goods',\n body: this.params\n }).then(\n () => location.reload(),\n (result) => {\n this.loading = false;\n this.handleErrors(result);\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Modal, {IInternalModalAttrs} from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport React from \"react\";\nimport StoreGoodsDetailModal from \"./StoreGoodsDetailModal\";\n\nexport default class AddStoreGoods extends Modal {\n private goodsList: any = []\n private moreResults: boolean = false\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadResults()\n }\n\n title() {\n return app.translator.trans('mattoid-store.admin.settings.add-store-goods');\n }\n\n className(): string {\n return \"\";\n }\n\n content() {\n return (\n
\n {this.goodsList.map((item: object, index: number) => (\n
\n
\n
\n
\n {item.attributes.name}\n {\n app.modal.show(StoreGoodsDetailModal, {\n code: item.attributes.code,\n title: item.attributes.name\n });\n }}\n >\n {app.translator.trans('mattoid-store.admin.settings.add-store-goods')}\n \n
\n
\n
\n
\n ))}\n\n {!this.loading && this.goodsList.length === 0 && (\n
\n {app.translator.trans(\"mattoid-store.lib.list-empty\")}
\n
\n )}\n\n {!this.loading && this.hasMoreResults() && (\n
\n \n
\n )}\n\n \n )\n }\n\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n loadMore() {\n this.loading = true;\n this.loadResults(this.goodsList.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.goodsList, results.payload.data);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n loadResults(offset = 0) {\n const filters = {\n };\n\n return app.store\n .find(\"/store/goods\", {\n filter:filters,\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Component'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nexport default class StoreModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.type = this.attrs.title;\n this.storeData = this.attrs.storeData;\n }\n\n className() {\n return 'Modal--small';\n }\n\n title() {\n return app.translator.trans('mattoid-store.admin.settings.goods-item-' + this.type);\n }\n\n content() {\n //\n return (\n
\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n type: 'submit',\n loading: this.loading,\n },\n app.translator.trans('mattoid-store.lib.confirm')\n )} \n {Button.component(\n {\n className: 'Button storeButton--gray',\n loading: this.loading,\n onclick: () => {\n this.hide();\n }\n },\n app.translator.trans('mattoid-store.lib.cancel')\n )}\n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n const status = this.storeData.status;\n this.storeData.status = Number(!this.storeData.status)\n\n const method = this.type === 'delete' ? 'DELETE' : 'PUT';\n app.request({\n method: method,\n url: app.forum.attribute('apiUrl') + '/store/goods',\n body: this.storeData\n }).then(\n () => location.reload(),\n (result) => {\n this.loading = false;\n this.storeData.status = status;\n this.handleErrors(result);\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from \"flarum/Component\";\nimport Button from 'flarum/components/Button';\nimport StoreModal from \"./StoreModal\";\nimport StoreGoodsDetailModal from \"./StoreGoodsDetailModal\";\n\nexport default class StoreListItem extends Component {\n private storeData: object = {}\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.storeData = this.attrs.item.attributes\n }\n\n view() {\n const moneyName = app.forum.attribute('antoinefr-money.moneyname') || '[money]';\n const price = moneyName.replace('[money]', this.storeData.price);\n const data = this.storeData;\n\n const LimitUnit = {'days': '天', 'hour': '小时', 'minute': '分钟', 'second': '秒'};\n\n return (\n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n
\n {app.translator.trans('mattoid-store.lib.item-id')}: {this.storeData.id} |  \n {app.translator.trans('mattoid-store.lib.item-title')}: {this.storeData.title}\n
\n
\n {app.translator.trans('mattoid-store.lib.item-desc')}: {this.storeData.desc}\n
\n
\n {app.translator.trans('mattoid-store.lib.item-status')}: { app.translator.trans('mattoid-store.lib.item-status-' + this.storeData.status) } | \n {app.translator.trans('mattoid-store.lib.item-price')}: {price} | \n {app.translator.trans('mattoid-store.lib.item-stock')}: { this.storeData.stock == -99 ? '无限' : this.storeData.stock } | \n {app.translator.trans('mattoid-store.lib.item-discount')}: {this.storeData.discount ? this.storeData.discount + ' %' : '无'} | \n {app.translator.trans('mattoid-store.lib.item-discount_limit')}: {this.storeData.discountLimit || 0} { LimitUnit[this.storeData.discountLimitUnit] }\n
\n
\n {app.translator.trans('mattoid-store.lib.item-type')}: {app.translator.trans('mattoid-store.lib.item-type-' + this.storeData.type)} | \n {app.translator.trans('mattoid-store.lib.item-created-at')}: {this.storeData.createdAt}\n
\n
\n
\n \n \n
\n
\n )\n }\n\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport Mithril from 'mithril';\nimport AddStoreGoods from \"./AddStoreGoods\";\nimport Select from \"flarum/common/components/Select\";\nimport Stream from 'flarum/common/utils/Stream';\nimport StoreListItem from \"./StoreListItem\";\n\nexport default class StoreListPage extends ExtensionPage {\n\n private storeList: any = []\n private moreResults: boolean = false\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.status = Stream('-1');\n this.type = Stream('-1');\n\n this.loadResults();\n }\n\n content() {\n return (\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'string',\n setting: 'mattoid-store.storeName',\n label: app.translator.trans('mattoid-store.admin.settings.store-name'),\n placeholder: app.translator.trans('mattoid-store.admin.settings.store-name'),\n help: app.translator.trans('mattoid-store.admin.settings.store-name-requirement'),\n })}\n {this.buildSettingComponent({\n type: 'string',\n setting: 'mattoid-store.storeTimezone',\n label: app.translator.trans('mattoid-store.admin.settings.store-timezone'),\n placeholder: 'Asia/Shanghai',\n help: app.translator.trans('mattoid-store.admin.settings.store-timezone-requirement'),\n })}\n {this.submitButton()}\n
\n
\n {this.buildSettingComponent(function () {\n return m('.Form-group', Button.component({\n className: 'Button',\n onclick() {\n app.modal.show(AddStoreGoods);\n },\n }, app.translator.trans('mattoid-store.admin.settings.add-store-goods')));\n })}\n
\n
\n
\n
\n {\n this.status(e)\n this.storeList = []\n this.loadResults()\n }}\n />\n
\n
\n {\n this.type(e)\n this.storeList = []\n this.loadResults()\n }}\n />\n
\n
\n
    \n {\n this.storeList.map((item) => {\n return (\n
  • \n {StoreListItem.component({ item })}\n
  • \n );\n })\n }\n
\n\n {!this.loading && this.storeList.length === 0 && (\n
\n
\n {app.translator.trans('mattoid-store.lib.list-empty')}\n
\n
\n )}\n\n {!this.loading && this.hasMoreResults() && (\n
\n \n
\n )}\n\n
\n
\n
\n )\n }\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n loadMore() {\n this.loading = true;\n this.loadResults(this.storeList.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.storeList, results.payload.data);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n loadResults(offset = 0) {\n const filters = {\n type: this.type(),\n status: this.status()\n };\n\n return app.store\n .find(\"/store/list\", {\n filter:filters,\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n}\n","import app from 'flarum/admin/app';\nimport StoreListPage from './components/StoreListPage';\nimport StorePage from \"./components/StorePage\";\n\napp.initializers.add('mattoid-store', () => {\n app.extensionData.for(\"mattoid-store\")\n // .registerSetting({\n // setting: 'mattoid-store.storeName',\n // help: app.translator.trans('mattoid-store.admin.settings.store-name-requirement'),\n // label: app.translator.trans('mattoid-store.admin.settings.store-name'),\n // type: 'string',\n // })\n // .registerSetting({\n // setting: 'mattoid-store.decorationStoreTimezone',\n // help: app.translator.trans('mattoid-store.admin.settings.decorationStoreTimezone-requirement'),\n // label: app.translator.trans('mattoid-store.admin.settings.decorationStoreTimezone'),\n // type: 'string',\n // })\n .registerPage(StoreListPage)\n .registerPermission(\n {\n icon: 'fas fa-id-card',\n label: app.translator.trans('mattoid-store.admin.settings.group-view'),\n permission: 'mattoid-store.group-view',\n allowGuest: true\n }, 'view')\n .registerPermission(\n {\n icon: 'fas fa-id-card',\n label: app.translator.trans('mattoid-store.admin.settings.group-view'),\n permission: 'mattoid-store.group-moderate',\n allowGuest: true\n }, 'moderate')\n});\n"],"names":["getOwnPropertySymbols","Object","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","module","exports","assign","test1","String","getOwnPropertyNames","test2","i","fromCharCode","map","n","join","test3","split","forEach","letter","keys","err","shouldUseNative","target","source","from","symbols","to","val","TypeError","toObject","s","arguments","length","key","call","l","require","Symbol","iterator","C","a","b","c","encodeURIComponent","D","isMounted","enqueueForceUpdate","enqueueReplaceState","enqueueSetState","E","F","this","props","context","refs","updater","G","H","isReactComponent","setState","Error","forceUpdate","I","constructor","isPureReactComponent","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","d","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","StoreGoodsDetailModal","_Modal","_this2","_len","args","Array","_key","apply","concat","pageTitle","moreResults","iconList","method","params","status","Stream","code","title","desc","price","stock","discount","discountLimit","discountLimitUnit","type","outtime","icon","hide","repeat","autoDeduction","_proto","oninit","vnode","attrs","storeData","id","className","onModalReady","_this","closeButton","$","closeButtonClone","clone","css","append","on","closeIcon","content","_this3","m","oncreate","style","class","app","trans","Switch","state","onchange","Number","required","bidi","step","min","Select","options","Button","onclick","e","uploadIcon","showIcon","src","slice","autoplay","loop","muted","playsinline","loading","item","selectIconItem","attributes","url","hasMoreResults","disabled","loadMore","loadIconList","offset","find","page","then","parseResults","results","payload","links","next","push","data","redraw","event","_this4","preventDefault","appendTo","trigger","body","FormData","files","attribute","result","path","onsubmit","_this5","location","reload","handleErrors","Modal","AddStoreGoods","goodsList","loadResults","index","name","show","filter","StoreModal","StoreListItem","_Component","view","replace","createdAt","Component","StoreListPage","_ExtensionPage","storeList","buildSettingComponent","setting","label","placeholder","help","submitButton","buttonClassName","component","filters","ExtensionPage","add","registerPage","registerPermission","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":";kCAQA,IAAIA,EAAwBC,OAAOD,sBAC/BE,EAAiBD,OAAOE,UAAUD,eAClCE,EAAmBH,OAAOE,UAA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,IACbG,KAAKrI,KAAKsI,aAAa/F,KAAKvC,MACjC,EAAC6K,CAAA,CAtJ+B,CAASY,KCL3CvF,IAAAA,aAAiBwF,IAAI,iBAAiB,WACpCxF,IAAAA,cAAiB,IAAK,iBAanByF,aAAad,GACbe,mBACC,CACErH,KAAM,iBACN2G,MAAOhF,IAAAA,WAAeC,MAAM,2CAC5B0F,WAAY,2BACZC,YAAY,GACX,QACJF,mBACC,CACErH,KAAM,iBACN2G,MAAOhF,IAAAA,WAAeC,MAAM,2CAC5B0F,WAAY,+BACZC,YAAY,GACX,WACT","sources":["webpack://@mattoid/store/./node_modules/object-assign/index.js","webpack://@mattoid/store/./node_modules/react/cjs/react.production.min.js","webpack://@mattoid/store/./node_modules/react/index.js","webpack://@mattoid/store/webpack/bootstrap","webpack://@mattoid/store/webpack/runtime/compat get default export","webpack://@mattoid/store/webpack/runtime/define property getters","webpack://@mattoid/store/webpack/runtime/hasOwnProperty shorthand","webpack://@mattoid/store/webpack/runtime/make namespace object","webpack://@mattoid/store/external root \"flarum.core.compat['admin/app']\"","webpack://@mattoid/store/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@mattoid/store/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@mattoid/store/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/components/Button']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@mattoid/store/external root \"flarum.core.compat['components/Modal']\"","webpack://@mattoid/store/external root \"flarum.core.compat['components/Button']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/components/Select']\"","webpack://@mattoid/store/./src/admin/components/StoreGoodsDetailModal.tsx","webpack://@mattoid/store/./src/admin/components/AddStoreGoods.tsx","webpack://@mattoid/store/external root \"flarum.core.compat['Component']\"","webpack://@mattoid/store/./src/admin/components/StoreModal.tsx","webpack://@mattoid/store/./src/admin/components/StoreListItem.tsx","webpack://@mattoid/store/./src/admin/components/StoreListPage.tsx","webpack://@mattoid/store/./src/admin/index.tsx"],"sourcesContent":["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/** @license React v16.14.0\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var l=require(\"object-assign\"),n=\"function\"===typeof Symbol&&Symbol.for,p=n?Symbol.for(\"react.element\"):60103,q=n?Symbol.for(\"react.portal\"):60106,r=n?Symbol.for(\"react.fragment\"):60107,t=n?Symbol.for(\"react.strict_mode\"):60108,u=n?Symbol.for(\"react.profiler\"):60114,v=n?Symbol.for(\"react.provider\"):60109,w=n?Symbol.for(\"react.context\"):60110,x=n?Symbol.for(\"react.forward_ref\"):60112,y=n?Symbol.for(\"react.suspense\"):60113,z=n?Symbol.for(\"react.memo\"):60115,A=n?Symbol.for(\"react.lazy\"):\n60116,B=\"function\"===typeof Symbol&&Symbol.iterator;function C(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cQ.length&&Q.push(a)}\nfunction T(a,b,c,e){var d=typeof a;if(\"undefined\"===d||\"boolean\"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,\"\"===b?\".\"+U(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var k=0;k {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\nimport Stream from \"flarum/common/utils/Stream\";\nimport Switch from \"flarum/common/components/Switch\";\nimport Select from \"flarum/common/components/Select\";\n\nexport default class StoreGoodsDetailModal extends Modal {\n\n private pageTitle: string = \"\"\n private moreResults: boolean = false\n private iconList: Array = [];\n private method: string = 'POST';\n private params: object = {\n status: Stream(1),\n code: Stream(),\n title: Stream(),\n desc: Stream(),\n price: Stream(0),\n stock: Stream(0),\n discount: Stream(0),\n discountLimit: Stream(0),\n discountLimitUnit: Stream('days'),\n type: Stream('permanent'),\n outtime: Stream(0),\n icon: Stream(),\n hide: Stream(0),\n repeat: Stream(1),\n autoDeduction: Stream(0),\n };\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.method = 'POST';\n this.moreResults = false;\n this.params.code = Stream(this.attrs.code || '');\n this.params.title = Stream(this.attrs.title || '');\n this.pageTitle = this.attrs.title;\n\n if (this.attrs.storeData) {\n this.method = 'PUT'\n this.params.id = Stream(this.attrs.storeData.id);\n this.params.status = Stream(this.attrs.storeData.status);\n this.params.code = Stream(this.attrs.storeData.code);\n this.params.title = Stream(this.attrs.storeData.title);\n this.params.desc = Stream(this.attrs.storeData.desc);\n this.params.price = Stream(this.attrs.storeData.price);\n this.params.stock = Stream(this.attrs.storeData.stock == -99 ? 0 : this.attrs.storeData.stock);\n this.params.discount = Stream(this.attrs.storeData.discount);\n this.params.discountLimit = Stream(this.attrs.storeData.discountLimit);\n this.params.discountLimitUnit = Stream(this.attrs.storeData.discountLimitUnit);\n this.params.type = Stream(this.attrs.storeData.type);\n this.params.outtime = Stream(this.attrs.storeData.outtime);\n this.params.icon = Stream(this.attrs.storeData.icon);\n this.params.hide = Stream(this.attrs.storeData.hide);\n this.params.repeat = Stream(this.attrs.storeData.repeat);\n this.params.autoDeduction = Stream(this.attrs.storeData.autoDeduction);\n }\n }\n\n className() {\n return '';\n }\n\n title() {\n return this.pageTitle;\n }\n\n onModalReady() {\n const _this = this;\n const closeButton = $(\".Modal-close .Button\");\n $(closeButton).prop('id', 'storeCloseButton');\n\n const closeButtonClone = closeButton.clone();\n $(closeButtonClone).prop('id', 'storeCloseIconButton');\n $(closeButtonClone).css('display', 'none');\n $(\".Modal-close\").append(closeButtonClone);\n\n $(closeButtonClone).on(\"click\", function(){\n _this.closeIcon();\n });\n }\n\n content() {\n return (\n
\n
\n
\n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-status\")}\n \n {\n this.params.status = Stream(Number(val))\n }}\n > \n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-code\")}\n {this.params.code()} \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-title\")}\n
\n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-desc\")}\n
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-price\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.goods-stock\")}
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-discount\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.goods-discount-limit\")}\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.goods-discount-limit-unit\")}\n {Select.component({\n options: {\n 'days': app.translator.trans(\"mattoid-store.lib.item-limit-unit-days\"),\n 'hour': app.translator.trans(\"mattoid-store.lib.item-limit-unit-hour\"),\n 'minute': app.translator.trans(\"mattoid-store.lib.item-limit-unit-minute\"),\n 'second': app.translator.trans(\"mattoid-store.lib.item-limit-unit-second\")\n },\n value: this.params.discountLimitUnit(),\n onchange: (val) => {\n this.params.discountLimitUnit = Stream(val)\n },\n })}\n \n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-type\")}
\n {Select.component({\n options: {\n 'permanent': app.translator.trans(\"mattoid-store.lib.item-type-permanent\"),\n 'limit': app.translator.trans(\"mattoid-store.lib.item-type-limit\")\n },\n value: this.params.type(),\n onchange: (val) => {\n this.params.type = Stream(val)\n },\n })}\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-outtime\")}
\n \n {app.translator.trans(\"mattoid-store.admin.settings.days\")}\n \n\n \n\n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-auto-deduction\")}\n \n {\n this.params.autoDeduction = Stream(Number(val))\n }}\n >\n \n \n
\n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.goods-icon\")}\n
\n
\n
\n \n
\n
\n {\n this.uploadIcon(e)\n }}>\n {app.translator.trans('mattoid-store.admin.settings.goods-upload-button')}\n \n
\n
\n {\n this.showIcon(e);\n }}>\n {app.translator.trans('mattoid-store.admin.settings.show-icon-button')}\n \n
\n
\n \n\n
\n \n \n
\n\n
\n
\n {\n this.params.repeat = Stream(Number(val))\n }}\n >\n {app.translator.trans(\n \"mattoid-store.admin.settings.goods-repeat\"\n )}\n \n
\n
\n {\n this.params.hide = Stream(Number(val))\n }}\n >\n {app.translator.trans(\n \"mattoid-store.admin.settings.goods-hide\"\n )}\n \n
\n
\n \n\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n type: 'submit',\n loading: this.loading,\n },\n this.params.id ? app.translator.trans('mattoid-store.admin.settings.edit-store-goods') : app.translator.trans('mattoid-store.admin.settings.add-store-goods')\n )}\n
\n \n\n
\n
\n {\n this.iconList.map((item) => {\n return (\n
this.selectIconItem(item.attributes.url)}>\n \n \n
\n )\n })\n }\n
\n {!this.loading && this.iconList.length === 0 && (\n
\n {app.translator.trans(\"mattoid-store.lib.list-empty\")}
\n
\n )}\n\n {!this.loading && this.hasMoreResults() && (\n
\n \n
\n )}\n\n {this.loading &&
{this.loading}
}\n \n \n \n );\n }\n\n loadIconList(offset = 0) {\n this.loading = true;\n\n return app.store\n .find(\"/store/icon/list\", {\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.iconList, results.payload.data);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n loadMore() {\n this.loading = true;\n this.loadIconList(this.iconList.length);\n }\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n\n closeIcon() {\n this.pageTitle = this.attrs.title;\n $(\"#StoreGoods\").css(\"display\",\"block\");\n $(\"#storeCloseButton\").css(\"display\",\"block\");\n $(\"#StoreIcon\").css(\"display\",\"none\");\n $(\"#storeCloseIconButton\").css(\"display\",\"none\");\n m.redraw();\n }\n\n selectIconItem(url){\n this.pageTitle = this.attrs.title;\n $(\"#StoreGoods\").css(\"display\",\"block\");\n $(\"#storeCloseButton\").css(\"display\",\"block\");\n $(\"#StoreIcon\").css(\"display\",\"none\");\n $(\"#storeCloseIconButton\").css(\"display\",\"none\");\n this.params.icon(url);\n }\n\n showIcon(event) {\n $(\"#StoreGoods\").css(\"display\",\"none\");\n $(\"#storeCloseButton\").css(\"display\",\"none\");\n $(\"#StoreIcon\").css(\"display\",\"block\");\n $(\"#storeCloseIconButton\").css(\"display\",\"block\");\n this.pageTitle = app.translator.trans('mattoid-store.admin.settings.show-icon-button');\n this.iconList = [];\n this.loadIconList();\n }\n\n uploadIcon(event) {\n event.preventDefault();\n\n const $input = $('');\n\n $input.appendTo('body').hide().trigger('click').on('change', event => {\n const body = new FormData();\n body.append('file', event.target.files[0])\n\n app.request({\n url: `${app.forum.attribute('apiUrl')}/store/upload/icon`,\n method: 'POST',\n body,\n }).then((result) => {\n this.params.icon = Stream(result.data.attributes.path)\n this.loading = false;\n m.redraw();\n });\n })\n\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.request({\n method: this.method,\n url: app.forum.attribute('apiUrl') + '/store/goods',\n body: this.params\n }).then(\n () => location.reload(),\n (result) => {\n this.loading = false;\n this.handleErrors(result);\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Modal, {IInternalModalAttrs} from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport React from \"react\";\nimport StoreGoodsDetailModal from \"./StoreGoodsDetailModal\";\n\nexport default class AddStoreGoods extends Modal {\n private goodsList: any = []\n private moreResults: boolean = false\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loadResults()\n }\n\n title() {\n return app.translator.trans('mattoid-store.admin.settings.add-store-goods');\n }\n\n className(): string {\n return \"\";\n }\n\n content() {\n return (\n
\n {this.goodsList.map((item: object, index: number) => (\n
\n
\n
\n
\n {item.attributes.name}\n {\n app.modal.show(StoreGoodsDetailModal, {\n code: item.attributes.code,\n title: item.attributes.name\n });\n }}\n >\n {app.translator.trans('mattoid-store.admin.settings.add-store-goods')}\n \n
\n
\n
\n
\n ))}\n\n {!this.loading && this.goodsList.length === 0 && (\n
\n {app.translator.trans(\"mattoid-store.lib.list-empty\")}
\n
\n )}\n\n {!this.loading && this.hasMoreResults() && (\n
\n \n
\n )}\n\n \n )\n }\n\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n loadMore() {\n this.loading = true;\n this.loadResults(this.goodsList.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.goodsList, results.payload.data);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n loadResults(offset = 0) {\n const filters = {\n };\n\n return app.store\n .find(\"/store/goods\", {\n filter:filters,\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Component'];","import app from 'flarum/admin/app';\nimport Modal from 'flarum/components/Modal';\nimport Button from 'flarum/components/Button';\n\nexport default class StoreModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.type = this.attrs.title;\n this.storeData = this.attrs.storeData;\n }\n\n className() {\n return 'Modal--small';\n }\n\n title() {\n return app.translator.trans('mattoid-store.admin.settings.goods-item-' + this.type);\n }\n\n content() {\n //\n return (\n
\n
\n {Button.component(\n {\n className: 'Button Button--primary',\n type: 'submit',\n loading: this.loading,\n },\n app.translator.trans('mattoid-store.lib.confirm')\n )} \n {Button.component(\n {\n className: 'Button storeButton--gray',\n loading: this.loading,\n onclick: () => {\n this.hide();\n }\n },\n app.translator.trans('mattoid-store.lib.cancel')\n )}\n
\n
\n );\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n const status = this.storeData.status;\n this.storeData.status = Number(!this.storeData.status)\n\n const method = this.type === 'delete' ? 'DELETE' : 'PUT';\n app.request({\n method: method,\n url: app.forum.attribute('apiUrl') + '/store/goods',\n body: this.storeData\n }).then(\n () => location.reload(),\n (result) => {\n this.loading = false;\n this.storeData.status = status;\n this.handleErrors(result);\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from \"flarum/Component\";\nimport Button from 'flarum/components/Button';\nimport StoreModal from \"./StoreModal\";\nimport StoreGoodsDetailModal from \"./StoreGoodsDetailModal\";\n\nexport default class StoreListItem extends Component {\n private storeData: object = {}\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.storeData = this.attrs.item.attributes\n }\n\n view() {\n const moneyName = app.forum.attribute('antoinefr-money.moneyname') || '[money]';\n const price = moneyName.replace('[money]', this.storeData.price);\n const data = this.storeData;\n\n const LimitUnit = {'days': '天', 'hour': '小时', 'minute': '分钟', 'second': '秒'};\n\n return (\n
\n
\n
\n \n \n \n \n \n \n \n \n \n
\n
\n {app.translator.trans('mattoid-store.lib.item-id')}: {this.storeData.id} |  \n {app.translator.trans('mattoid-store.lib.item-title')}: {this.storeData.title}\n
\n
\n {app.translator.trans('mattoid-store.lib.item-desc')}: {this.storeData.desc}\n
\n
\n {app.translator.trans('mattoid-store.lib.item-status')}: { app.translator.trans('mattoid-store.lib.item-status-' + this.storeData.status) } | \n {app.translator.trans('mattoid-store.lib.item-price')}: {price} | \n {app.translator.trans('mattoid-store.lib.item-stock')}: { this.storeData.stock == -99 ? '无限' : this.storeData.stock } | \n {app.translator.trans('mattoid-store.lib.item-discount')}: {this.storeData.discount ? this.storeData.discount + ' %' : '无'} | \n {app.translator.trans('mattoid-store.lib.item-discount_limit')}: {this.storeData.discountLimit || 0} { LimitUnit[this.storeData.discountLimitUnit] }\n
\n
\n {app.translator.trans('mattoid-store.lib.item-type')}: {app.translator.trans('mattoid-store.lib.item-type-' + this.storeData.type)} | \n {app.translator.trans('mattoid-store.lib.item-created-at')}: {this.storeData.createdAt}\n
\n
\n
\n \n \n
\n
\n )\n }\n\n}\n","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport Mithril from 'mithril';\nimport AddStoreGoods from \"./AddStoreGoods\";\nimport Select from \"flarum/common/components/Select\";\nimport Stream from 'flarum/common/utils/Stream';\nimport StoreListItem from \"./StoreListItem\";\n\nexport default class StoreListPage extends ExtensionPage {\n\n private storeList: any = []\n private moreResults: boolean = false\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.status = Stream('-1');\n this.type = Stream('-1');\n\n this.loadResults();\n }\n\n content() {\n return (\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'string',\n setting: 'mattoid-store.storeName',\n label: app.translator.trans('mattoid-store.admin.settings.store-name'),\n placeholder: app.translator.trans('mattoid-store.admin.settings.store-name'),\n help: app.translator.trans('mattoid-store.admin.settings.store-name-requirement'),\n })}\n {this.buildSettingComponent({\n type: 'string',\n setting: 'mattoid-store.storeTimezone',\n label: app.translator.trans('mattoid-store.admin.settings.store-timezone'),\n placeholder: 'Asia/Shanghai',\n help: app.translator.trans('mattoid-store.admin.settings.store-timezone-requirement'),\n })}\n {this.submitButton()}\n
\n
\n {this.buildSettingComponent(function () {\n return m('.Form-group', Button.component({\n className: 'Button',\n onclick() {\n app.modal.show(AddStoreGoods);\n },\n }, app.translator.trans('mattoid-store.admin.settings.add-store-goods')));\n })}\n
\n
\n
\n
\n {\n this.status(e)\n this.storeList = []\n this.loadResults()\n }}\n />\n
\n
\n {\n this.type(e)\n this.storeList = []\n this.loadResults()\n }}\n />\n
\n
\n
    \n {\n this.storeList.map((item) => {\n return (\n
  • \n {StoreListItem.component({ item })}\n
  • \n );\n })\n }\n
\n\n {!this.loading && this.storeList.length === 0 && (\n
\n
\n {app.translator.trans('mattoid-store.lib.list-empty')}\n
\n
\n )}\n\n {!this.loading && this.hasMoreResults() && (\n
\n \n
\n )}\n\n
\n
\n
\n )\n }\n\n hasMoreResults() {\n return this.moreResults;\n }\n\n loadMore() {\n this.loading = true;\n this.loadResults(this.storeList.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.storeList, results.payload.data);\n this.loading = false;\n m.redraw();\n\n return results;\n }\n\n loadResults(offset = 0) {\n const filters = {\n type: this.type(),\n status: this.status()\n };\n\n return app.store\n .find(\"/store/list\", {\n filter:filters,\n page: {\n offset,\n },\n })\n .catch(() => {})\n .then(this.parseResults.bind(this));\n }\n}\n","import app from 'flarum/admin/app';\nimport StoreListPage from './components/StoreListPage';\nimport StorePage from \"./components/StorePage\";\n\napp.initializers.add('mattoid-store', () => {\n app.extensionData.for(\"mattoid-store\")\n // .registerSetting({\n // setting: 'mattoid-store.storeName',\n // help: app.translator.trans('mattoid-store.admin.settings.store-name-requirement'),\n // label: app.translator.trans('mattoid-store.admin.settings.store-name'),\n // type: 'string',\n // })\n // .registerSetting({\n // setting: 'mattoid-store.decorationStoreTimezone',\n // help: app.translator.trans('mattoid-store.admin.settings.decorationStoreTimezone-requirement'),\n // label: app.translator.trans('mattoid-store.admin.settings.decorationStoreTimezone'),\n // type: 'string',\n // })\n .registerPage(StoreListPage)\n .registerPermission(\n {\n icon: 'fas fa-id-card',\n label: app.translator.trans('mattoid-store.admin.settings.group-view'),\n permission: 'mattoid-store.group-view',\n allowGuest: true\n }, 'view')\n .registerPermission(\n {\n icon: 'fas fa-id-card',\n label: app.translator.trans('mattoid-store.admin.settings.group-view'),\n permission: 'mattoid-store.group-moderate',\n allowGuest: true\n }, 'moderate')\n});\n"],"names":["getOwnPropertySymbols","Object","hasOwnProperty","prototype","propIsEnumerable","propertyIsEnumerable","module","exports","assign","test1","String","getOwnPropertyNames","test2","i","fromCharCode","map","n","join","test3","split","forEach","letter","keys","err","shouldUseNative","target","source","from","symbols","to","val","TypeError","toObject","s","arguments","length","key","call","l","require","Symbol","iterator","C","a","b","c","encodeURIComponent","D","isMounted","enqueueForceUpdate","enqueueReplaceState","enqueueSetState","E","F","this","props","context","refs","updater","G","H","isReactComponent","setState","Error","forceUpdate","I","constructor","isPureReactComponent","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","d","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","StoreGoodsDetailModal","_Modal","_this2","_len","args","Array","_key","apply","concat","pageTitle","moreResults","iconList","method","params","status","Stream","code","title","desc","price","stock","discount","discountLimit","discountLimitUnit","type","outtime","icon","hide","repeat","autoDeduction","_proto","oninit","vnode","attrs","storeData","id","className","onModalReady","_this","closeButton","$","closeButtonClone","clone","css","append","on","closeIcon","content","_this3","m","oncreate","style","class","app","trans","Switch","state","onchange","Number","required","bidi","step","min","Select","options","Button","onclick","e","uploadIcon","showIcon","src","slice","autoplay","loop","muted","playsinline","loading","item","selectIconItem","attributes","url","hasMoreResults","disabled","loadMore","loadIconList","offset","find","page","then","parseResults","results","payload","links","next","push","data","redraw","event","_this4","preventDefault","appendTo","trigger","body","FormData","files","attribute","result","path","onsubmit","_this5","location","reload","handleErrors","Modal","AddStoreGoods","goodsList","loadResults","index","name","show","filter","StoreModal","StoreListItem","_Component","view","replace","createdAt","Component","StoreListPage","_ExtensionPage","storeList","buildSettingComponent","setting","label","placeholder","help","submitButton","buttonClassName","component","filters","ExtensionPage","add","registerPage","registerPermission","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file diff --git a/js/src/admin/components/StoreListItem.tsx b/js/src/admin/components/StoreListItem.tsx index baabb9a..7c30969 100644 --- a/js/src/admin/components/StoreListItem.tsx +++ b/js/src/admin/components/StoreListItem.tsx @@ -21,7 +21,7 @@ export default class StoreListItem extends Component { const LimitUnit = {'days': '天', 'hour': '小时', 'minute': '分钟', 'second': '秒'}; return ( -
+