選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

678 行
20 KiB

  1. (function() {
  2. var exports = {};
  3. exports.id = 5891;
  4. exports.ids = [5891];
  5. exports.modules = {
  6. /***/ 3920:
  7. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  8. "use strict";
  9. var _apollo = _interopRequireDefault(__webpack_require__(6371));
  10. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11. async function GetSparepartYGP(token = "") {
  12. var res = await _apollo.default.query(`
  13. query{
  14. ygParts{
  15. id
  16. name
  17. img{
  18. url
  19. }
  20. price1
  21. price2
  22. ygp_units{
  23. name
  24. part_code
  25. price
  26. }
  27. }
  28. }
  29. `, token);
  30. return res;
  31. }
  32. async function GetSparepartYamalube(token = "") {
  33. var res = await _apollo.default.query(`
  34. query {
  35. yamalubes {
  36. id
  37. name
  38. part_code
  39. price
  40. description
  41. stock
  42. img{
  43. url
  44. }
  45. }
  46. }
  47. `, token);
  48. return res;
  49. }
  50. async function GetHelmet(token = "") {
  51. var res = await _apollo.default.query(`
  52. query {
  53. helmets{
  54. id
  55. name
  56. price
  57. img {
  58. url
  59. }
  60. }
  61. }`, token);
  62. return res;
  63. }
  64. async function GetApparel(token = "") {
  65. var res = await _apollo.default.query(`
  66. query {
  67. apparels{
  68. id
  69. name
  70. price
  71. img {
  72. url
  73. }
  74. }
  75. }`, token);
  76. return res;
  77. }
  78. async function GetAcc(token = "") {
  79. var res = await _apollo.default.query(`
  80. query {
  81. accessories{
  82. id
  83. name
  84. price
  85. img {
  86. url
  87. }
  88. }
  89. }`, token);
  90. return res;
  91. }
  92. async function GetYGPDetail(id, token = "") {
  93. var res = await _apollo.default.query(`
  94. query($input: ID!){
  95. ygParts(where:{id:$input})
  96. {
  97. id
  98. name
  99. img{
  100. url
  101. }
  102. description
  103. price1
  104. price2
  105. ygp_units{
  106. name
  107. part_code
  108. price
  109. description
  110. }
  111. }
  112. } `, token, {
  113. "input": id
  114. });
  115. return res;
  116. }
  117. async function GetYamalubeDetail(id, token = "") {
  118. var res = await _apollo.default.query(`
  119. query($input: ID!){
  120. yamalubes(where:{id:$input})
  121. {
  122. id
  123. name
  124. description
  125. price
  126. part_code
  127. img {
  128. url
  129. }
  130. stock
  131. }
  132. } `, token, {
  133. "input": id
  134. });
  135. return res;
  136. }
  137. async function GetHelmetDetail(id, token = "") {
  138. var res = await _apollo.default.query(`
  139. query($input: ID!){
  140. helmets(where:{id:$input})
  141. {
  142. id
  143. name
  144. description
  145. price
  146. part_code
  147. img {
  148. url
  149. }
  150. stock
  151. }
  152. } `, token, {
  153. "input": id
  154. });
  155. return res;
  156. }
  157. async function GetApparelDetail(id, token = "") {
  158. var res = await _apollo.default.query(`
  159. query($input: ID!){
  160. apparels(where:{id:$input})
  161. {
  162. id
  163. name
  164. description
  165. price
  166. part_code
  167. img {
  168. url
  169. }
  170. stock
  171. }
  172. } `, token, {
  173. "input": id
  174. });
  175. return res;
  176. }
  177. async function GetAccDetail(id, token = "") {
  178. var res = await _apollo.default.query(`
  179. query($input: ID!){
  180. accessories(where:{id:$input})
  181. {
  182. id
  183. name
  184. description
  185. price
  186. part_code
  187. img {
  188. url
  189. }
  190. stock
  191. }
  192. } `, token, {
  193. "input": id
  194. });
  195. return res;
  196. }
  197. module.exports = {
  198. //collection type YGP
  199. GetSparepartYGP: GetSparepartYGP,
  200. GetSparepartYamalube: GetSparepartYamalube,
  201. GetHelmet: GetHelmet,
  202. GetApparel: GetApparel,
  203. GetAcc: GetAcc,
  204. //Detail
  205. GetYGPDetail: GetYGPDetail,
  206. GetYamalubeDetail: GetYamalubeDetail,
  207. GetHelmetDetail: GetHelmetDetail,
  208. GetApparelDetail: GetApparelDetail,
  209. GetAccDetail: GetAccDetail
  210. };
  211. /***/ }),
  212. /***/ 9280:
  213. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  214. "use strict";
  215. // ESM COMPAT FLAG
  216. __webpack_require__.r(__webpack_exports__);
  217. // EXPORTS
  218. __webpack_require__.d(__webpack_exports__, {
  219. "default": function() { return /* binding */ Product_Sparepart; },
  220. "getServerSideProps": function() { return /* binding */ getServerSideProps; }
  221. });
  222. // EXTERNAL MODULE: external "react/jsx-runtime"
  223. var jsx_runtime_ = __webpack_require__(5282);
  224. // EXTERNAL MODULE: external "react"
  225. var external_react_ = __webpack_require__(9297);
  226. // EXTERNAL MODULE: ./components/_App/NavbarYamaha.js
  227. var NavbarYamaha = __webpack_require__(2478);
  228. // EXTERNAL MODULE: ./components/_App/FooterYamaha.js
  229. var FooterYamaha = __webpack_require__(362);
  230. // EXTERNAL MODULE: ./components/Common/PageBanner.js
  231. var PageBanner = __webpack_require__(1288);
  232. // EXTERNAL MODULE: ./node_modules/next/link.js
  233. var next_link = __webpack_require__(1664);
  234. // EXTERNAL MODULE: external "react-feather"
  235. var external_react_feather_ = __webpack_require__(9337);
  236. // EXTERNAL MODULE: external "react-redux"
  237. var external_react_redux_ = __webpack_require__(79);
  238. // EXTERNAL MODULE: ./components/Shop/AddToCartBtn.js
  239. var AddToCartBtn = __webpack_require__(2337);
  240. // EXTERNAL MODULE: external "react-number-format"
  241. var external_react_number_format_ = __webpack_require__(3230);
  242. var external_react_number_format_default = /*#__PURE__*/__webpack_require__.n(external_react_number_format_);
  243. ;// CONCATENATED MODULE: ./components/Yamaha/Product/Sparepart.js
  244. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  245. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  246. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  247. function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
  248. function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  249. const ProductCard = function (_ref) {
  250. let {
  251. ygp,
  252. yamalube,
  253. helmet,
  254. apparel,
  255. accessories,
  256. backend
  257. } = _ref,
  258. props = _objectWithoutProperties(_ref, ["ygp", "yamalube", "helmet", "apparel", "accessories", "backend"]);
  259. const products = (0,external_react_redux_.useSelector)(state => state.products);
  260. console.log(ygp);
  261. const Product = ygp.map(data => {
  262. return /*#__PURE__*/jsx_runtime_.jsx("div", {
  263. className: "col-lg-3 col-md-6 col-sm-6",
  264. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  265. className: "single-products",
  266. children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  267. className: "products-image",
  268. children: [/*#__PURE__*/jsx_runtime_.jsx("img", {
  269. src: `${backend}${data.img["url"]}`
  270. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
  271. children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
  272. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  273. href: "#",
  274. children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Search, {})
  275. })
  276. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  277. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  278. href: "#",
  279. children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Heart, {})
  280. })
  281. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  282. children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, {
  283. href: "/products/[id]",
  284. as: `/products/${ygp.id}`,
  285. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  286. children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Link, {})
  287. })
  288. })
  289. })]
  290. })]
  291. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  292. className: "products-content",
  293. children: [/*#__PURE__*/jsx_runtime_.jsx("h3", {
  294. children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, {
  295. href: "/yamaha/Product/Motor_Detail?s=" + data.id,
  296. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  297. children: data.name
  298. })
  299. })
  300. }), /*#__PURE__*/jsx_runtime_.jsx("span", {
  301. children: /*#__PURE__*/jsx_runtime_.jsx((external_react_number_format_default()), {
  302. value: data.price2,
  303. displayType: 'text',
  304. thousandSeparator: true,
  305. prefix: 'Rp.'
  306. })
  307. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
  308. children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
  309. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  310. className: "flaticon-star-1"
  311. })
  312. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  313. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  314. className: "flaticon-star-1"
  315. })
  316. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  317. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  318. className: "flaticon-star-1"
  319. })
  320. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  321. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  322. className: "flaticon-star-1"
  323. })
  324. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  325. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  326. className: "flaticon-star-1"
  327. })
  328. })]
  329. }), /*#__PURE__*/jsx_runtime_.jsx(AddToCartBtn/* default */.Z, _objectSpread({}, ygp))]
  330. })]
  331. })
  332. }, ygp.id);
  333. });
  334. return /*#__PURE__*/jsx_runtime_.jsx("div", {
  335. className: "shop-area ptb-80",
  336. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  337. className: "container",
  338. children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
  339. className: "woocommerce-topbar",
  340. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  341. className: "row align-items-center",
  342. children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
  343. className: "col-lg-9 col-md-7 col-sm-7",
  344. children: /*#__PURE__*/jsx_runtime_.jsx("div", {
  345. className: "woocommerce-result-count",
  346. children: /*#__PURE__*/jsx_runtime_.jsx("p", {
  347. children: "Showing 1-8 of 14 results"
  348. })
  349. })
  350. }), /*#__PURE__*/jsx_runtime_.jsx("div", {
  351. className: "col-lg-3 col-md-5 col-sm-5",
  352. children: /*#__PURE__*/jsx_runtime_.jsx("div", {
  353. className: "woocommerce-topbar-ordering",
  354. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("select", {
  355. className: "form-select",
  356. children: [/*#__PURE__*/jsx_runtime_.jsx("option", {
  357. value: "1",
  358. children: "Sort by Popularity"
  359. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  360. value: "2",
  361. children: "Sort by Average Rating"
  362. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  363. value: "3",
  364. children: "Sort by Latest"
  365. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  366. value: "4",
  367. children: "Sort by price: Low to High"
  368. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  369. value: "5",
  370. children: "Sort by price: High to Low"
  371. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  372. value: "6",
  373. children: "Sort by New"
  374. })]
  375. })
  376. })
  377. })]
  378. })
  379. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  380. className: "row justify-content-md-center",
  381. children: [Product, /*#__PURE__*/jsx_runtime_.jsx("div", {
  382. className: "col-lg-12 col-md-12 col-sm-12",
  383. children: /*#__PURE__*/jsx_runtime_.jsx("div", {
  384. className: "pagination-area",
  385. children: /*#__PURE__*/jsx_runtime_.jsx("nav", {
  386. "aria-label": "Page navigation",
  387. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
  388. className: "pagination justify-content-center",
  389. children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
  390. className: "page-item",
  391. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  392. className: "page-link",
  393. href: "#",
  394. children: "Prev"
  395. })
  396. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  397. className: "page-item active",
  398. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  399. className: "page-link",
  400. href: "#",
  401. children: "1"
  402. })
  403. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  404. className: "page-item",
  405. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  406. className: "page-link",
  407. href: "#",
  408. children: "2"
  409. })
  410. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  411. className: "page-item",
  412. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  413. className: "page-link",
  414. href: "#",
  415. children: "3"
  416. })
  417. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  418. className: "page-item",
  419. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  420. className: "page-link",
  421. href: "#",
  422. children: "Next"
  423. })
  424. })]
  425. })
  426. })
  427. })
  428. })]
  429. })]
  430. })
  431. });
  432. };
  433. /* harmony default export */ var Sparepart = (ProductCard);
  434. // EXTERNAL MODULE: ./api/sparepart/sparepart.js
  435. var sparepart = __webpack_require__(3920);
  436. var sparepart_default = /*#__PURE__*/__webpack_require__.n(sparepart);
  437. // EXTERNAL MODULE: external "cookies"
  438. var external_cookies_ = __webpack_require__(9038);
  439. ;// CONCATENATED MODULE: ./pages/yamaha/Product/Sparepart.js
  440. function Sparepart_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Sparepart_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
  441. function Sparepart_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  442. const Shop = function (_ref) {
  443. let {
  444. ygp,
  445. yamalube,
  446. helmet,
  447. apparel,
  448. accessories,
  449. backend
  450. } = _ref,
  451. props = Sparepart_objectWithoutProperties(_ref, ["ygp", "yamalube", "helmet", "apparel", "accessories", "backend"]);
  452. return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
  453. children: [/*#__PURE__*/jsx_runtime_.jsx(NavbarYamaha/* default */.Z, {}), /*#__PURE__*/jsx_runtime_.jsx(PageBanner/* default */.Z, {
  454. pageTitle: "Sparepart"
  455. }), /*#__PURE__*/jsx_runtime_.jsx(Sparepart, {
  456. ygp: ygp,
  457. yamalube: yamalube,
  458. helmet: helmet,
  459. apparel: apparel,
  460. accessories: accessories,
  461. backend: backend
  462. }), /*#__PURE__*/jsx_runtime_.jsx(FooterYamaha/* default */.Z, {})]
  463. });
  464. };
  465. /* harmony default export */ var Product_Sparepart = (Shop);
  466. async function getServerSideProps(context) {
  467. var ygp = [];
  468. var yamalube = [];
  469. var helmet = [];
  470. var apparel = [];
  471. var accessories = [];
  472. const backend = process.env.BACKEND_SERVER_URI;
  473. var res = await sparepart_default().GetSparepartYGP();
  474. if (res["STATUS"] === 1) {
  475. ygp = res["DATA"]["ygParts"];
  476. }
  477. var res = await sparepart_default().GetSparepartYamalube();
  478. if (res["STATUS"] === 1) {
  479. yamalube = res["DATA"]["yamalubes"];
  480. }
  481. var res = await sparepart_default().GetHelmet();
  482. if (res["STATUS"] === 1) {
  483. helmet = res["DATA"]["helmets"];
  484. }
  485. var res = await sparepart_default().GetApparel();
  486. if (res["STATUS"] === 1) {
  487. apparel = res["DATA"]["apparels"];
  488. }
  489. var res = await sparepart_default().GetAcc();
  490. if (res["STATUS"] === 1) {
  491. accessories = res["DATA"]["accessories"];
  492. }
  493. return {
  494. props: {
  495. ygp,
  496. yamalube,
  497. helmet,
  498. apparel,
  499. accessories,
  500. backend
  501. } // will be passed to the page component as props
  502. };
  503. }
  504. /***/ }),
  505. /***/ 8074:
  506. /***/ (function(module) {
  507. "use strict";
  508. module.exports = require("@apollo/client");;
  509. /***/ }),
  510. /***/ 9038:
  511. /***/ (function(module) {
  512. "use strict";
  513. module.exports = require("cookies");;
  514. /***/ }),
  515. /***/ 1683:
  516. /***/ (function(module) {
  517. "use strict";
  518. module.exports = require("cross-fetch");;
  519. /***/ }),
  520. /***/ 8417:
  521. /***/ (function(module) {
  522. "use strict";
  523. module.exports = require("next/dist/next-server/lib/router-context.js");;
  524. /***/ }),
  525. /***/ 2238:
  526. /***/ (function(module) {
  527. "use strict";
  528. module.exports = require("next/dist/next-server/lib/router/utils/get-asset-path-from-route.js");;
  529. /***/ }),
  530. /***/ 6731:
  531. /***/ (function(module) {
  532. "use strict";
  533. module.exports = require("next/router");;
  534. /***/ }),
  535. /***/ 9297:
  536. /***/ (function(module) {
  537. "use strict";
  538. module.exports = require("react");;
  539. /***/ }),
  540. /***/ 9337:
  541. /***/ (function(module) {
  542. "use strict";
  543. module.exports = require("react-feather");;
  544. /***/ }),
  545. /***/ 3230:
  546. /***/ (function(module) {
  547. "use strict";
  548. module.exports = require("react-number-format");;
  549. /***/ }),
  550. /***/ 79:
  551. /***/ (function(module) {
  552. "use strict";
  553. module.exports = require("react-redux");;
  554. /***/ }),
  555. /***/ 9614:
  556. /***/ (function(module) {
  557. "use strict";
  558. module.exports = require("react-toast-notifications");;
  559. /***/ }),
  560. /***/ 5282:
  561. /***/ (function(module) {
  562. "use strict";
  563. module.exports = require("react/jsx-runtime");;
  564. /***/ })
  565. };
  566. ;
  567. // load runtime
  568. var __webpack_require__ = require("../../../webpack-runtime.js");
  569. __webpack_require__.C(exports);
  570. var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
  571. var __webpack_exports__ = __webpack_require__.X(0, [1664,4755,6371,7798,6120], function() { return __webpack_exec__(9280); });
  572. module.exports = __webpack_exports__;
  573. })();