diff --git a/js/dist/admin.js b/js/dist/admin.js index 0aa58d4..364b93e 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 e=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 e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[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,s){for(var a,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),s="function"==typeof Symbol&&Symbol.for;s&&Symbol.for("react.element"),s&&Symbol.for("react.portal"),s&&Symbol.for("react.fragment"),s&&Symbol.for("react.strict_mode"),s&&Symbol.for("react.profiler"),s&&Symbol.for("react.provider"),s&&Symbol.for("react.context"),s&&Symbol.for("react.forward_ref"),s&&Symbol.for("react.suspense"),s&&Symbol.for("react.memo"),s&&Symbol.for("react.lazy"),"function"==typeof Symbol&&Symbol.iterator;function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i{"use strict";i(488)}},e={};function i(o){var s=e[o];if(void 0!==s)return s.exports;var a=e[o]={exports:{}};return t[o](a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),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 e=i.n(t);function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,s(t,e)}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["common/components/Switch"];var y=i.n(u);const h=flarum.core.compat["common/components/Select"];var f=i.n(h);const g=flarum.core.compat["common/utils/Stream"];var b=i.n(g),v=function(t){function i(){for(var e,i=arguments.length,o=new Array(i),s=0;s{var t={535:t=>{"use strict";var e=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 e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[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,s){for(var n,a,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),s="function"==typeof Symbol&&Symbol.for;s&&Symbol.for("react.element"),s&&Symbol.for("react.portal"),s&&Symbol.for("react.fragment"),s&&Symbol.for("react.strict_mode"),s&&Symbol.for("react.profiler"),s&&Symbol.for("react.provider"),s&&Symbol.for("react.context"),s&&Symbol.for("react.forward_ref"),s&&Symbol.for("react.suspense"),s&&Symbol.for("react.memo"),s&&Symbol.for("react.lazy"),"function"==typeof Symbol&&Symbol.iterator;function n(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,i=1;i{"use strict";i(488)}},e={};function i(o){var s=e[o];if(void 0!==s)return s.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),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 e=i.n(t);function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,s(t,e)}const a=flarum.core.compat["admin/components/ExtensionPage"];var r=i.n(a);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["common/components/Switch"];var y=i.n(u);const h=flarum.core.compat["common/components/Select"];var f=i.n(h);const g=flarum.core.compat["common/utils/Stream"];var b=i.n(g),v=function(t){function i(){for(var e,i=arguments.length,o=new Array(i),s=0;sQ.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['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/admin/app';\nimport Modal, {IInternalModalAttrs} from \"flarum/common/components/Modal\";\nimport Button from 'flarum/common/components/Button';\nimport Switch from \"flarum/common/components/Switch\";\nimport Select from \"flarum/common/components/Select\";\nimport Stream from 'flarum/common/utils/Stream';\nimport type Mithril from 'mithril';\n\ninterface ISubscriptionModalAttrs extends IInternalModalAttrs {\n code: string;\n title: string;\n}\n\nexport default class AddStoreCommodityDetail extends Modal {\n\n private params = {\n status: 1,\n code: Stream(),\n title: Stream(),\n desc: Stream(),\n price: Stream(),\n stock: Stream(),\n discount: Stream(),\n limit: Stream(),\n limitUnit: 'day',\n type: 'permanent',\n outtime: Stream(),\n icon: Stream(),\n hide: 0\n }\n\n static initAttrs(attrs: ISubscriptionModalAttrs) {\n super.initAttrs(attrs);\n }\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.params.code = Stream(this.attrs.code || '');\n this.params.title = Stream(this.attrs.title || '');\n }\n\n title() {\n return this.attrs.title;\n }\n\n className(): string {\n return \"\";\n }\n\n content() {\n return (\n
\n
\n
\n
\n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-status\")}\n \n {\n this.params.status = val\n }}\n > \n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-code\")}\n {this.attrs.code} \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-title\")}\n
\n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-desc\")}\n
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-price\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-stock\")}
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-discount\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-discount-limit\")}\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-discount-limit-unit\")}\n {Select.component({\n options: {\n 'day': app.translator.trans(\"mattoid-store.lib.item-limit-unit-day\"),\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.limitUnit,\n onchange: (val) => {\n this.params.limitUnit = val\n },\n })}\n \n\n
\n
{app.translator.trans(\"mattoid-store.admin.settings.commodity-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 = val\n },\n })}\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-outtime\")}
\n \n \n
\n\n \n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-icon\")}\n
\n
\n
\n \n
\n
\n {\n\n }}>\n {app.translator.trans('mattoid-store.admin.settings.commodity-upload-button') }\n \n
\n
\n \n\n
\n {\n this.params.hide = val\n }}\n >\n {app.translator.trans(\n \"mattoid-store.admin.settings.commodity-hide\"\n )}\n \n
\n \n\n
\n {\n this.loading = true;\n this.addCommodity().then(res => {\n this.hide();\n }).catch(() => {\n this.loading = false;\n m.redraw();\n });\n }}>\n {app.translator.trans('mattoid-store.admin.settings.add-store-commodity') }\n \n
\n \n \n \n \n )\n }\n\n addCommodity() {\n return app.request<{ userMatchCount: number }>({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/store/commodity',\n body: this.params\n });\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 AddStoreCommodityDetail from \"./AddStoreCommodityDetail\";\n\nexport default class AddStoreCommodity extends Modal {\n private commodityList: 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-commodity');\n }\n\n className(): string {\n return \"\";\n }\n\n content() {\n return (\n
\n {this.commodityList.map((item: object, index: number) => (\n
\n
\n
\n
\n {item.attributes.name}\n {\n app.modal.show(AddStoreCommodityDetail, {\n code: item.attributes.code,\n title: item.attributes.name\n });\n }}\n >\n {app.translator.trans('mattoid-store.admin.settings.add-store-commodity')}\n \n
\n
\n
\n
\n ))}\n\n {!this.loading && this.commodityList.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.commodityList.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.commodityList, 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/commodity\", {\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 Component from \"flarum/Component\";\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 this.storeData.id = this.attrs.item.id\n }\n\n view() {\n return (\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')}: {this.storeData.price} | \n {app.translator.trans('mattoid-store.lib.item-stock')}: {this.storeData.stock} | \n {app.translator.trans('mattoid-store.lib.item-discount')}: {this.storeData.discount || '无'} | \n {app.translator.trans('mattoid-store.lib.item-discount_limit')}: {this.storeData.discountLimit || 0} {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}\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 AddStoreCommodity from \"./AddStoreCommodity\";\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(AddStoreCommodity);\n },\n }, app.translator.trans('mattoid-store.admin.settings.add-store-commodity')));\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});\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","AddStoreCommodityDetail","_Modal","_this","_len","args","Array","_key","apply","concat","params","status","code","Stream","title","desc","price","stock","discount","limit","limitUnit","type","outtime","icon","hide","initAttrs","attrs","_proto","oninit","vnode","className","content","_this2","m","style","class","app","trans","Switch","state","onchange","required","bidi","step","min","Select","options","id","Button","onclick","loading","addCommodity","then","res","redraw","method","url","attribute","body","Modal","AddStoreCommodity","commodityList","moreResults","loadResults","item","index","attributes","name","show","hasMoreResults","disabled","loadMore","parseResults","results","payload","links","next","push","data","offset","find","filter","page","StoreListItem","_Component","storeData","view","discountLimit","discountLimitUnit","createdAt","src","Component","StoreListPage","_ExtensionPage","storeList","buildSettingComponent","setting","label","placeholder","help","submitButton","buttonClassName","e","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,UAAUE,qBAsDxCC,EAAOC,QA5CP,WACC,IACC,IAAKN,OAAOO,OACX,OAAO,EAMR,IAAIC,EAAQ,IAAIC,OAAO,OAEvB,GADAD,EAAM,GAAK,KACkC,MAAzCR,OAAOU,oBAAoBF,GAAO,GACrC,OAAO,EAKR,IADA,IAAIG,EAAQ,CAAC,EACJC,EAAI,EAAGA,EAAI,GAAIA,IACvBD,EAAM,IAAMF,OAAOI,aAAaD,IAAMA,EAKvC,GAAwB,eAHXZ,OAAOU,oBAAoBC,GAAOG,KAA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AAMjE,KAAKiE,OACXV,OAAQvD,KAAKuD,UAGf,OAAOyB,IAAAA,MACJ4C,KAAK,cAAe,CACnBC,OAAOwB,EACPvB,KAAM,CACJH,OAAAA,KAEF,OACK,WAAO,IACb3B,KAAKhG,KAAKoH,aAAa7E,KAAKvC,MACjC,EAACyI,CAAA,CAtJ+B,CAASa,KCL3CtE,IAAAA,aAAiBuE,IAAI,iBAAiB,WACpCvE,IAAAA,cAAiB,IAAK,iBAanBwE,aAAaf,GACbgB,mBACC,CACEtF,KAAM,iBACN2E,MAAO9D,IAAAA,WAAeC,MAAM,2CAC5ByE,WAAY,2BACZC,YAAY,GACX,OACT","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['common/components/Switch']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/components/Select']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@mattoid/store/./src/admin/components/AddStoreCommodityDetail.tsx","webpack://@mattoid/store/./src/admin/components/AddStoreCommodity.tsx","webpack://@mattoid/store/external root \"flarum.core.compat['Component']\"","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['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Select'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/admin/app';\nimport Modal, {IInternalModalAttrs} from \"flarum/common/components/Modal\";\nimport Button from 'flarum/common/components/Button';\nimport Switch from \"flarum/common/components/Switch\";\nimport Select from \"flarum/common/components/Select\";\nimport Stream from 'flarum/common/utils/Stream';\nimport type Mithril from 'mithril';\n\ninterface ISubscriptionModalAttrs extends IInternalModalAttrs {\n code: string;\n title: string;\n}\n\nexport default class AddStoreCommodityDetail extends Modal {\n\n private params = {\n status: 1,\n code: Stream(),\n title: Stream(),\n desc: Stream(),\n price: Stream(),\n stock: Stream(),\n discount: Stream(),\n limit: Stream(),\n limitUnit: 'day',\n type: 'permanent',\n outtime: Stream(),\n icon: Stream(),\n hide: 0\n }\n\n static initAttrs(attrs: ISubscriptionModalAttrs) {\n super.initAttrs(attrs);\n }\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.params.code = Stream(this.attrs.code || '');\n this.params.title = Stream(this.attrs.title || '');\n }\n\n title() {\n return this.attrs.title;\n }\n\n className(): string {\n return \"\";\n }\n\n content() {\n return (\n
\n
\n
\n
\n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-status\")}\n \n {\n this.params.status = val\n }}\n > \n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-code\")}\n {this.attrs.code} \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-title\")}\n
\n \n
\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-desc\")}\n
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-price\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-stock\")}
\n \n
\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-discount\")}
\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-discount-limit\")}\n \n\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-discount-limit-unit\")}\n {Select.component({\n options: {\n 'day': app.translator.trans(\"mattoid-store.lib.item-limit-unit-day\"),\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.limitUnit,\n onchange: (val) => {\n this.params.limitUnit = val\n },\n })}\n \n\n
\n
{app.translator.trans(\"mattoid-store.admin.settings.commodity-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 = val\n },\n })}\n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-outtime\")}
\n \n \n
\n\n \n\n
\n {app.translator.trans(\"mattoid-store.admin.settings.commodity-icon\")}\n
\n
\n
\n \n
\n
\n {\n\n }}>\n {app.translator.trans('mattoid-store.admin.settings.commodity-upload-button') }\n \n
\n
\n \n\n
\n {\n this.params.hide = val\n }}\n >\n {app.translator.trans(\n \"mattoid-store.admin.settings.commodity-hide\"\n )}\n \n
\n \n\n
\n {\n this.loading = true;\n this.addCommodity().then(res => {\n this.hide();\n }).catch(() => {\n this.loading = false;\n m.redraw();\n });\n }}>\n {app.translator.trans('mattoid-store.admin.settings.add-store-commodity') }\n \n
\n \n \n \n \n )\n }\n\n addCommodity() {\n return app.request<{ userMatchCount: number }>({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/store/commodity',\n body: this.params\n });\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 AddStoreCommodityDetail from \"./AddStoreCommodityDetail\";\n\nexport default class AddStoreCommodity extends Modal {\n private commodityList: 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-commodity');\n }\n\n className(): string {\n return \"\";\n }\n\n content() {\n return (\n
\n {this.commodityList.map((item: object, index: number) => (\n
\n
\n
\n
\n {item.attributes.name}\n {\n app.modal.show(AddStoreCommodityDetail, {\n code: item.attributes.code,\n title: item.attributes.name\n });\n }}\n >\n {app.translator.trans('mattoid-store.admin.settings.add-store-commodity')}\n \n
\n
\n
\n
\n ))}\n\n {!this.loading && this.commodityList.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.commodityList.length);\n }\n\n parseResults(results) {\n this.moreResults = !!results.payload.links && !!results.payload.links.next;\n [].push.apply(this.commodityList, 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/commodity\", {\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 Component from \"flarum/Component\";\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 this.storeData.id = this.attrs.item.id\n }\n\n view() {\n const moneyName = app.forum.attribute('antoinefr-money.moneyname') || '[money]';\n const price = moneyName.replace('[money]', this.storeData.price);\n\n return (\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} | \n {app.translator.trans('mattoid-store.lib.item-discount')}: {this.storeData.discount || '无'} | \n {app.translator.trans('mattoid-store.lib.item-discount_limit')}: {this.storeData.discountLimit || 0} {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}\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 AddStoreCommodity from \"./AddStoreCommodity\";\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(AddStoreCommodity);\n },\n }, app.translator.trans('mattoid-store.admin.settings.add-store-commodity')));\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});\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","AddStoreCommodityDetail","_Modal","_this","_len","args","Array","_key","apply","concat","params","status","code","Stream","title","desc","price","stock","discount","limit","limitUnit","type","outtime","icon","hide","initAttrs","attrs","_proto","oninit","vnode","className","content","_this2","m","style","class","app","trans","Switch","state","onchange","required","bidi","step","min","Select","options","id","Button","onclick","loading","addCommodity","then","res","redraw","method","url","attribute","body","Modal","AddStoreCommodity","commodityList","moreResults","loadResults","item","index","attributes","name","show","hasMoreResults","disabled","loadMore","parseResults","results","payload","links","next","push","data","offset","find","filter","page","StoreListItem","_Component","storeData","view","replace","discountLimit","discountLimitUnit","createdAt","src","Component","StoreListPage","_ExtensionPage","storeList","buildSettingComponent","setting","label","placeholder","help","submitButton","buttonClassName","e","component","filters","ExtensionPage","add","registerPage","registerPermission","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 27bdff6..c7543f0 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const o=flarum.core.compat["forum/app"];var r=t.n(o);const a=flarum.core.compat["common/extend"],n=flarum.core.compat["forum/components/IndexPage"];var s=t.n(n);const i=flarum.core.compat["common/components/LinkButton"];var c=t.n(i);function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}const u=flarum.core.compat["common/helpers/listItems"];var l=t.n(u),d=function(t){var e,o;function r(){return t.apply(this,arguments)||this}o=t,(e=r).prototype=Object.create(o.prototype),e.prototype.constructor=e,p(e,o);var a=r.prototype;return a.oncreate=function(e){t.prototype.oncreate.call(this,e),app.setTitle(app.forum.attribute("storeName")||app.translator.trans("mattoid-store.forum.tital")),app.setTitleCount(0)},a.view=function(){return m("div",{className:"IndexPage"},m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,l()(this.sidebarItems().toArray()))),m("div",{className:"StorePage-results sideNavOffset"},m("h2",{class:"BadgeOverviewTitle"},app.forum.attribute("storeName")||app.translator.trans("mattoid-store.forum.tital")),m("div",{className:"Store-Body"},"111111111111111")))))},r}(s());r().initializers.add("mattoid/store",(function(){r().routes.store={path:"/store",component:d},(0,a.extend)(s().prototype,"navItems",(function(t){t.add("store",c().component({href:r().route("store"),icon:"fas fa-store"},r().forum.attribute("storeName")||r().translator.trans("mattoid-store.forum.tital")))}))}))})(),module.exports=e})(); +(()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const o=flarum.core.compat["forum/app"];var a=t.n(o);const r=flarum.core.compat["common/extend"],s=flarum.core.compat["forum/components/IndexPage"];var n=t.n(s);const i=flarum.core.compat["common/components/LinkButton"];var l=t.n(i);function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,c(t,e)}const u=flarum.core.compat["common/helpers/listItems"];var d=t.n(u);const f=flarum.core.compat["common/components/Button"];var h=t.n(f);const v=flarum.core.compat["common/utils/Stream"];var y=t.n(v);const g=flarum.core.compat.Component;var b=function(t){function e(){for(var e,o=arguments.length,a=new Array(o),r=0;r {\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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","import IndexPage from \"flarum/forum/components/IndexPage\";\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport listItems from 'flarum/common/helpers/listItems';\nimport Mithril from 'mithril';\n\nexport interface IIndexPageAttrs extends IPageAttrs {}\n\nexport default class StorePage extends IndexPage {\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n app.setTitle(app.forum.attribute(\"storeName\") || app.translator.trans('mattoid-store.forum.tital'));\n app.setTitleCount(0);\n }\n\n view() {\n return (\n
\n
\n
\n \n
\n

{app.forum.attribute(\"storeName\") || app.translator.trans('mattoid-store.forum.tital')}

\n
\n 111111111111111\n
\n
\n
\n
\n
\n )\n }\n}\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}","import app from 'flarum/forum/app';\nimport {extend} from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport StorePage from \"./components/StorePage\";\n\napp.initializers.add('mattoid/store', () => {\n app.routes.store = {\n path: '/store',\n component: StorePage,\n };\n\n extend(IndexPage.prototype, 'navItems', function (items) {\n items.add('store', LinkButton.component({\n href: app.route('store'),\n icon: 'fas fa-store',\n }, app.forum.attribute(\"storeName\") || app.translator.trans('mattoid-store.forum.tital')));\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","StorePage","_IndexPage","subClass","superClass","apply","arguments","create","constructor","_proto","oncreate","vnode","app","setTitle","forum","attribute","translator","trans","setTitleCount","view","m","className","listItems","this","sidebarItems","toArray","class","IndexPage","add","store","path","component","extend","items","LinkButton","href","icon"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,8B,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAzC,SAASC,EAAgBhB,EAAGiB,GAKzC,OAJAD,EAAkBf,OAAOiB,eAAiBjB,OAAOiB,eAAeC,OAAS,SAAyBnB,EAAGiB,GAEnG,OADAjB,EAAEoB,UAAYH,EACPjB,CACT,EACOgB,EAAgBhB,EAAGiB,EAC5B,CCLe,SAASI,EAAeC,EAAUC,GAC/CD,EAASf,UAAYN,OAAOuB,OAAOD,EAAWhB,WAC9Ce,EAASf,UAAUkB,YAAcH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ack://@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['forum/app']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/extend']\"","webpack://@mattoid/store/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/components/LinkButton']\"","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['common/helpers/listItems']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/components/Button']\"","webpack://@mattoid/store/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@mattoid/store/external root \"flarum.core.compat['Component']\"","webpack://@mattoid/store/./src/forum/components/StoreItem.tsx","webpack://@mattoid/store/./src/forum/components/StorePage.tsx","webpack://@mattoid/store/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\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['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","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['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['Component'];","import app from 'flarum/forum/app';\nimport Component from \"flarum/Component\";\n\nexport default class StoreItem extends Component {\n private storeData: object = {}\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.storeData = this.attrs.item.attributes\n this.storeData.id = this.attrs.item.id\n }\n\n view() {\n const moneyName = app.forum.attribute('antoinefr-money.moneyname') || '[money]';\n const price = moneyName.replace('[money]', this.storeData.price);\n\n return (\n
\n
\n {this.storeData.title}\n
\n
\n {price}\n
\n
\n {app.translator.trans('mattoid-store.lib.item-stock')}: {this.storeData.stock} | {app.translator.trans('mattoid-store.lib.item-type-' + this.storeData.type)}\n
\n
\n {this.storeData.desc}\n
\n
\n \n
\n
\n )\n }\n}\n","import IndexPage from \"flarum/forum/components/IndexPage\";\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport listItems from 'flarum/common/helpers/listItems';\nimport Mithril from 'mithril';\nimport Button from \"flarum/common/components/Button\";\nimport Stream from \"flarum/common/utils/Stream\";\nimport StoreItem from \"./StoreItem\";\nimport StoreListItem from \"../../admin/components/StoreListItem\";\n\nexport interface IIndexPageAttrs extends IPageAttrs {}\n\nexport default class StorePage extends IndexPage {\n\n private storeList: any = []\n private moreResults: boolean = false\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n app.setTitle(app.forum.attribute(\"storeName\") || app.translator.trans('mattoid-store.forum.tital'));\n app.setTitleCount(0);\n\n this.status = Stream('1');\n this.type = Stream('-1');\n\n this.loadResults();\n }\n\n view() {\n return (\n
\n
\n
\n \n
\n

{app.forum.attribute(\"storeName\") || app.translator.trans('mattoid-store.forum.tital')}

\n
\n {\n this.storeList.map((item) => {\n return (\n
\n {StoreItem.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\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}\n","import app from 'flarum/forum/app';\nimport {extend} from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport StorePage from \"./components/StorePage\";\n\napp.initializers.add('mattoid/store', () => {\n app.routes.store = {\n path: '/store',\n component: StorePage,\n };\n\n extend(IndexPage.prototype, 'navItems', function (items) {\n items.add('store', LinkButton.component({\n href: app.route('store'),\n icon: 'fas fa-store',\n }, app.forum.attribute(\"storeName\") || app.translator.trans('mattoid-store.forum.tital')));\n });\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","StoreItem","_Component","_this","_len","arguments","length","args","Array","_key","apply","concat","storeData","_proto","oninit","vnode","this","attrs","item","attributes","id","view","price","app","attribute","replace","m","className","title","trans","stock","type","desc","src","icon","Component","StorePage","_IndexPage","storeList","moreResults","oncreate","setTitle","forum","translator","setTitleCount","status","Stream","loadResults","_this2","listItems","sidebarItems","toArray","class","map","component","loading","style","hasMoreResults","Button","disabled","onclick","loadMore","parseResults","results","payload","links","next","push","data","redraw","offset","filters","store","find","filter","page","then","IndexPage","add","path","extend","items","LinkButton","href"],"sourceRoot":""} \ No newline at end of file diff --git a/js/src/admin/components/StoreListItem.tsx b/js/src/admin/components/StoreListItem.tsx index 96311ae..b469f9e 100644 --- a/js/src/admin/components/StoreListItem.tsx +++ b/js/src/admin/components/StoreListItem.tsx @@ -12,6 +12,9 @@ export default class StoreListItem extends Component { } view() { + const moneyName = app.forum.attribute('antoinefr-money.moneyname') || '[money]'; + const price = moneyName.replace('[money]', this.storeData.price); + return (
@@ -24,7 +27,7 @@ export default class StoreListItem extends Component {
{app.translator.trans('mattoid-store.lib.item-status')}: { app.translator.trans('mattoid-store.lib.item-status-' + this.storeData.status) } |  - {app.translator.trans('mattoid-store.lib.item-price')}: {this.storeData.price} |  + {app.translator.trans('mattoid-store.lib.item-price')}: {price} |  {app.translator.trans('mattoid-store.lib.item-stock')}: {this.storeData.stock} |  {app.translator.trans('mattoid-store.lib.item-discount')}: {this.storeData.discount || '无'} |  {app.translator.trans('mattoid-store.lib.item-discount_limit')}: {this.storeData.discountLimit || 0} {this.storeData.discountLimitUnit} diff --git a/js/src/forum/components/StoreItem.tsx b/js/src/forum/components/StoreItem.tsx new file mode 100644 index 0000000..a546e0b --- /dev/null +++ b/js/src/forum/components/StoreItem.tsx @@ -0,0 +1,38 @@ +import app from 'flarum/forum/app'; +import Component from "flarum/Component"; + +export default class StoreItem extends Component { + private storeData: object = {} + + oninit(vnode) { + super.oninit(vnode); + + this.storeData = this.attrs.item.attributes + this.storeData.id = this.attrs.item.id + } + + view() { + const moneyName = app.forum.attribute('antoinefr-money.moneyname') || '[money]'; + const price = moneyName.replace('[money]', this.storeData.price); + + return ( +
+
+ {this.storeData.title} +
+
+ {price} +
+
+ {app.translator.trans('mattoid-store.lib.item-stock')}: {this.storeData.stock} | {app.translator.trans('mattoid-store.lib.item-type-' + this.storeData.type)} +
+
+ {this.storeData.desc} +
+
+ +
+
+ ) + } +} diff --git a/js/src/forum/components/StorePage.tsx b/js/src/forum/components/StorePage.tsx index 388fed6..558e2c0 100644 --- a/js/src/forum/components/StorePage.tsx +++ b/js/src/forum/components/StorePage.tsx @@ -2,16 +2,28 @@ import IndexPage from "flarum/forum/components/IndexPage"; import { IPageAttrs } from 'flarum/common/components/Page'; import listItems from 'flarum/common/helpers/listItems'; import Mithril from 'mithril'; +import Button from "flarum/common/components/Button"; +import Stream from "flarum/common/utils/Stream"; +import StoreItem from "./StoreItem"; +import StoreListItem from "../../admin/components/StoreListItem"; export interface IIndexPageAttrs extends IPageAttrs {} export default class StorePage extends IndexPage { + private storeList: any = [] + private moreResults: boolean = false + oncreate(vnode: Mithril.VnodeDOM) { super.oncreate(vnode); app.setTitle(app.forum.attribute("storeName") || app.translator.trans('mattoid-store.forum.tital')); app.setTitleCount(0); + + this.status = Stream('1'); + this.type = Stream('-1'); + + this.loadResults(); } view() { @@ -25,12 +37,73 @@ export default class StorePage

{app.forum.attribute("storeName") || app.translator.trans('mattoid-store.forum.tital')}

- 111111111111111 + { + this.storeList.map((item) => { + return ( +
+ {StoreItem.component({ item })} +
+ ); + }) + }
+ + {!this.loading && this.storeList.length === 0 && ( +
+
+ {app.translator.trans('mattoid-store.lib.list-empty')} +
+
+ )} + + {!this.loading && this.hasMoreResults() && ( +
+ +
+ )} +
) } + + hasMoreResults() { + return this.moreResults; + } + + loadMore() { + this.loading = true; + this.loadResults(this.storeList.length); + } + + parseResults(results) { + this.moreResults = !!results.payload.links && !!results.payload.links.next; + [].push.apply(this.storeList, results.payload.data); + this.loading = false; + m.redraw(); + + return results; + } + + loadResults(offset = 0) { + const filters = { + type: this.type(), + status: this.status() + }; + + return app.store + .find("/store/list", { + filter:filters, + page: { + offset, + }, + }) + .catch(() => {}) + .then(this.parseResults.bind(this)); + } + } diff --git a/less/forum.less b/less/forum.less index e69de29..01ca2cd 100644 --- a/less/forum.less +++ b/less/forum.less @@ -0,0 +1,43 @@ + +.storeItemContainer { + position: relative; + border: 1px solid #696969; + padding: 10px; + cursor: pointer; + width: 270px; + height: 285px; + border-radius: var(--border-radius); + color: var(--primary-color); + background-size: cover; + background-position: center; + background-repeat: no-repeat; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + margin: 5px; + background: var(--body-bg); + display: inline-block; +} + +.itemTitle { + font-size: 20px; + font-weight: bold; +} + +.price { + color: var(--alert-success-color); + font-size: 18px; +} + +.icon-size { + width: 80px; + height: 80px; +} + +.center { + text-align: center; +} + +.spacing { + margin-top: 10px; +} diff --git a/src/Controller/ListCommodityController.php b/src/Controller/ListCommodityController.php index 0eb4e4f..217767d 100644 --- a/src/Controller/ListCommodityController.php +++ b/src/Controller/ListCommodityController.php @@ -47,7 +47,7 @@ protected function data(ServerRequestInterface $request, Document $document) { $list->pop(); } $document->addPaginationLinks( - $this->url->to('api')->route('decorationStore.get'), + $this->url->to('api')->route('store.commodity.list'), $params, $offset, $limit, diff --git a/src/Controller/ListStoreController.php b/src/Controller/ListStoreController.php index dee9426..1a58ed1 100644 --- a/src/Controller/ListStoreController.php +++ b/src/Controller/ListStoreController.php @@ -54,7 +54,7 @@ protected function data(ServerRequestInterface $request, Document $document) { $list->pop(); } $document->addPaginationLinks( - $this->url->to('api')->route('decorationStore.get'), + $this->url->to('api')->route('store.list'), $params, $offset, $limit,