Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

436 linhas
16 KiB

  1. (function() {
  2. var exports = {};
  3. exports.id = 215;
  4. exports.ids = [215];
  5. exports.modules = {
  6. /***/ 578:
  7. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  8. "use strict";
  9. // ESM COMPAT FLAG
  10. __webpack_require__.r(__webpack_exports__);
  11. // EXPORTS
  12. __webpack_require__.d(__webpack_exports__, {
  13. "default": function() { return /* binding */ Product_Motor; },
  14. "getServerSideProps": function() { return /* binding */ getServerSideProps; }
  15. });
  16. // EXTERNAL MODULE: external "react/jsx-runtime"
  17. var jsx_runtime_ = __webpack_require__(5282);
  18. // EXTERNAL MODULE: external "react"
  19. var external_react_ = __webpack_require__(9297);
  20. // EXTERNAL MODULE: ./components/_App/NavbarYamaha.js
  21. var NavbarYamaha = __webpack_require__(2478);
  22. // EXTERNAL MODULE: ./components/_App/FooterYamaha.js
  23. var FooterYamaha = __webpack_require__(362);
  24. // EXTERNAL MODULE: ./components/Common/PageBanner.js
  25. var PageBanner = __webpack_require__(1288);
  26. // EXTERNAL MODULE: ./node_modules/next/link.js
  27. var next_link = __webpack_require__(1664);
  28. // EXTERNAL MODULE: external "react-feather"
  29. var external_react_feather_ = __webpack_require__(9337);
  30. // EXTERNAL MODULE: external "react-redux"
  31. var external_react_redux_ = __webpack_require__(79);
  32. // EXTERNAL MODULE: ./components/Shop/AddToCartBtn.js
  33. var AddToCartBtn = __webpack_require__(2337);
  34. // EXTERNAL MODULE: external "react-number-format"
  35. var external_react_number_format_ = __webpack_require__(3230);
  36. var external_react_number_format_default = /*#__PURE__*/__webpack_require__.n(external_react_number_format_);
  37. ;// CONCATENATED MODULE: ./components/Yamaha/Product/Motor.js
  38. 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; }
  39. 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; }
  40. 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; }
  41. 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; }
  42. 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; }
  43. const ProductCard = function (_ref) {
  44. let {
  45. product,
  46. backend,
  47. user
  48. } = _ref,
  49. props = _objectWithoutProperties(_ref, ["product", "backend", "user"]);
  50. const products = (0,external_react_redux_.useSelector)(state => state.products);
  51. console.log(product);
  52. const Product = product.map(data => {
  53. return /*#__PURE__*/jsx_runtime_.jsx("div", {
  54. className: "col-lg-3 col-md-6 col-sm-6",
  55. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  56. className: "single-products",
  57. children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  58. className: "products-image",
  59. children: [/*#__PURE__*/jsx_runtime_.jsx("img", {
  60. src: `${backend}${data.img[0]["url"]}`
  61. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
  62. children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
  63. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  64. href: "#",
  65. children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Search, {})
  66. })
  67. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  68. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  69. href: "#",
  70. children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Heart, {})
  71. })
  72. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  73. children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, {
  74. href: "/products/[id]",
  75. as: `/products/${product.id}`,
  76. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  77. children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Link, {})
  78. })
  79. })
  80. })]
  81. })]
  82. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  83. className: "products-content",
  84. children: [/*#__PURE__*/jsx_runtime_.jsx("h3", {
  85. children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, {
  86. href: "/yamaha/Product/Motor_Detail?s=" + data.id,
  87. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  88. children: data.name
  89. })
  90. })
  91. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("span", {
  92. children: [/*#__PURE__*/jsx_runtime_.jsx((external_react_number_format_default()), {
  93. value: data.price,
  94. displayType: 'text',
  95. thousandSeparator: true,
  96. prefix: 'Rp.'
  97. }), " s/d ", /*#__PURE__*/jsx_runtime_.jsx((external_react_number_format_default()), {
  98. value: data.price2,
  99. displayType: 'text',
  100. thousandSeparator: true,
  101. prefix: 'Rp.'
  102. })]
  103. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
  104. children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
  105. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  106. className: "flaticon-star-1"
  107. })
  108. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  109. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  110. className: "flaticon-star-1"
  111. })
  112. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  113. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  114. className: "flaticon-star-1"
  115. })
  116. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  117. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  118. className: "flaticon-star-1"
  119. })
  120. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  121. children: /*#__PURE__*/jsx_runtime_.jsx("i", {
  122. className: "flaticon-star-1"
  123. })
  124. })]
  125. }), /*#__PURE__*/jsx_runtime_.jsx(AddToCartBtn/* default */.Z, _objectSpread({}, product))]
  126. })]
  127. })
  128. }, product.id);
  129. });
  130. return /*#__PURE__*/jsx_runtime_.jsx("div", {
  131. className: "shop-area ptb-80",
  132. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  133. className: "container",
  134. children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
  135. className: "woocommerce-topbar",
  136. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  137. className: "row align-items-center",
  138. children: [/*#__PURE__*/jsx_runtime_.jsx("div", {
  139. className: "col-lg-9 col-md-7 col-sm-7",
  140. children: /*#__PURE__*/jsx_runtime_.jsx("div", {
  141. className: "woocommerce-result-count",
  142. children: /*#__PURE__*/jsx_runtime_.jsx("p", {
  143. children: "Showing 1-8 of 14 results"
  144. })
  145. })
  146. }), /*#__PURE__*/jsx_runtime_.jsx("div", {
  147. className: "col-lg-3 col-md-5 col-sm-5",
  148. children: /*#__PURE__*/jsx_runtime_.jsx("div", {
  149. className: "woocommerce-topbar-ordering",
  150. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("select", {
  151. className: "form-select",
  152. children: [/*#__PURE__*/jsx_runtime_.jsx("option", {
  153. value: "1",
  154. children: "Sort by Popularity"
  155. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  156. value: "2",
  157. children: "Sort by Average Rating"
  158. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  159. value: "3",
  160. children: "Sort by Latest"
  161. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  162. value: "4",
  163. children: "Sort by price: Low to High"
  164. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  165. value: "5",
  166. children: "Sort by price: High to Low"
  167. }), /*#__PURE__*/jsx_runtime_.jsx("option", {
  168. value: "6",
  169. children: "Sort by New"
  170. })]
  171. })
  172. })
  173. })]
  174. })
  175. }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", {
  176. className: "row justify-content-md-center",
  177. children: [Product, /*#__PURE__*/jsx_runtime_.jsx("div", {
  178. className: "col-lg-12 col-md-12 col-sm-12",
  179. children: /*#__PURE__*/jsx_runtime_.jsx("div", {
  180. className: "pagination-area",
  181. children: /*#__PURE__*/jsx_runtime_.jsx("nav", {
  182. "aria-label": "Page navigation",
  183. children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", {
  184. className: "pagination justify-content-center",
  185. children: [/*#__PURE__*/jsx_runtime_.jsx("li", {
  186. className: "page-item",
  187. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  188. className: "page-link",
  189. href: "#",
  190. children: "Prev"
  191. })
  192. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  193. className: "page-item active",
  194. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  195. className: "page-link",
  196. href: "#",
  197. children: "1"
  198. })
  199. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  200. className: "page-item",
  201. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  202. className: "page-link",
  203. href: "#",
  204. children: "2"
  205. })
  206. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  207. className: "page-item",
  208. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  209. className: "page-link",
  210. href: "#",
  211. children: "3"
  212. })
  213. }), /*#__PURE__*/jsx_runtime_.jsx("li", {
  214. className: "page-item",
  215. children: /*#__PURE__*/jsx_runtime_.jsx("a", {
  216. className: "page-link",
  217. href: "#",
  218. children: "Next"
  219. })
  220. })]
  221. })
  222. })
  223. })
  224. })]
  225. })]
  226. })
  227. });
  228. };
  229. /* harmony default export */ var Motor = (ProductCard);
  230. // EXTERNAL MODULE: ./api/product/product.js
  231. var product_product = __webpack_require__(9965);
  232. var product_default = /*#__PURE__*/__webpack_require__.n(product_product);
  233. // EXTERNAL MODULE: external "cookies"
  234. var external_cookies_ = __webpack_require__(9038);
  235. var external_cookies_default = /*#__PURE__*/__webpack_require__.n(external_cookies_);
  236. ;// CONCATENATED MODULE: ./pages/yamaha/Product/Motor.js
  237. function Motor_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Motor_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; }
  238. function Motor_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; }
  239. const Shop = function (_ref) {
  240. let {
  241. product,
  242. backend,
  243. user
  244. } = _ref,
  245. props = Motor_objectWithoutProperties(_ref, ["product", "backend", "user"]);
  246. return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
  247. children: [/*#__PURE__*/jsx_runtime_.jsx(NavbarYamaha/* default */.Z, {}), /*#__PURE__*/jsx_runtime_.jsx(PageBanner/* default */.Z, {
  248. pageTitle: "Products"
  249. }), /*#__PURE__*/jsx_runtime_.jsx(Motor, {
  250. product: product,
  251. backend: backend,
  252. user: user
  253. }), /*#__PURE__*/jsx_runtime_.jsx(FooterYamaha/* default */.Z, {})]
  254. });
  255. };
  256. /* harmony default export */ var Product_Motor = (Shop);
  257. async function getServerSideProps(context) {
  258. var product = [];
  259. const backend = process.env.BACKEND_SERVER_URI;
  260. var {
  261. req,
  262. resp
  263. } = context;
  264. const cookies = new (external_cookies_default())(req, resp);
  265. var user = "";
  266. var userObj = (await cookies.get("user")) ? JSON.parse(await cookies.get("user")) : null;
  267. if (userObj) {
  268. let sessionId = userObj["partners_login_states"].filter(function (i) {
  269. return i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA";
  270. });
  271. if (sessionId.length != 0) user = userObj["username"];
  272. }
  273. var res = await product_default().GetProduct();
  274. if (res["STATUS"] === 1) {
  275. product = res["DATA"]["products"];
  276. }
  277. return {
  278. props: {
  279. product,
  280. backend,
  281. user
  282. } // will be passed to the page component as props
  283. };
  284. }
  285. /***/ }),
  286. /***/ 8074:
  287. /***/ (function(module) {
  288. "use strict";
  289. module.exports = require("@apollo/client");;
  290. /***/ }),
  291. /***/ 9038:
  292. /***/ (function(module) {
  293. "use strict";
  294. module.exports = require("cookies");;
  295. /***/ }),
  296. /***/ 1683:
  297. /***/ (function(module) {
  298. "use strict";
  299. module.exports = require("cross-fetch");;
  300. /***/ }),
  301. /***/ 8417:
  302. /***/ (function(module) {
  303. "use strict";
  304. module.exports = require("next/dist/next-server/lib/router-context.js");;
  305. /***/ }),
  306. /***/ 2238:
  307. /***/ (function(module) {
  308. "use strict";
  309. module.exports = require("next/dist/next-server/lib/router/utils/get-asset-path-from-route.js");;
  310. /***/ }),
  311. /***/ 6731:
  312. /***/ (function(module) {
  313. "use strict";
  314. module.exports = require("next/router");;
  315. /***/ }),
  316. /***/ 9297:
  317. /***/ (function(module) {
  318. "use strict";
  319. module.exports = require("react");;
  320. /***/ }),
  321. /***/ 9337:
  322. /***/ (function(module) {
  323. "use strict";
  324. module.exports = require("react-feather");;
  325. /***/ }),
  326. /***/ 3230:
  327. /***/ (function(module) {
  328. "use strict";
  329. module.exports = require("react-number-format");;
  330. /***/ }),
  331. /***/ 79:
  332. /***/ (function(module) {
  333. "use strict";
  334. module.exports = require("react-redux");;
  335. /***/ }),
  336. /***/ 9614:
  337. /***/ (function(module) {
  338. "use strict";
  339. module.exports = require("react-toast-notifications");;
  340. /***/ }),
  341. /***/ 5282:
  342. /***/ (function(module) {
  343. "use strict";
  344. module.exports = require("react/jsx-runtime");;
  345. /***/ })
  346. };
  347. ;
  348. // load runtime
  349. var __webpack_require__ = require("../../../webpack-runtime.js");
  350. __webpack_require__.C(exports);
  351. var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
  352. var __webpack_exports__ = __webpack_require__.X(0, [1664,4755,6371,7798,6120,9965], function() { return __webpack_exec__(578); });
  353. module.exports = __webpack_exports__;
  354. })();