index.js 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767
  1. exports.ids = [61,15,18];
  2. exports.modules = {
  3. /***/ 156:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 174:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. __webpack_require__.r(__webpack_exports__);
  13. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(156);
  14. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  15. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Pagination_vue_vue_type_style_index_0_id_044ef958_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  16. /***/ }),
  17. /***/ 175:
  18. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19. "use strict";
  20. /* unused harmony export formatPrice */
  21. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return round; });
  22. /* unused harmony export transformNumber */
  23. /* unused harmony export getUnit */
  24. /* unused harmony export getSetup */
  25. /* unused harmony export getPrint */
  26. /* unused harmony export getAddon */
  27. /* unused harmony export getPackaging */
  28. /* unused harmony export getFright */
  29. /* harmony import */ var number_precision__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(122);
  30. /* harmony import */ var number_precision__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(number_precision__WEBPACK_IMPORTED_MODULE_0__);
  31. // 商品价格计算相关
  32. // 价格格式化
  33. function formatPrice(value, needSymbol = true) {
  34. // 不能在最后一步显示之前格式化999 111, 否则可能出现单价1买999个得到999价格被格式化成poa的情况
  35. if (value === 0) {
  36. return needSymbol ? '£0.00' : '0.00';
  37. } else {
  38. return needSymbol ? `£${value}` : `${value}`;
  39. }
  40. }
  41. // 简单的乘法换算
  42. function multiply(value, ratio = 100) {
  43. return parseFloat((value * ratio).toPrecision(12));
  44. }
  45. // 小数处理, 四舍五入, 为toFixed做准备
  46. function round(number, ratio = 100) {
  47. return Math.round(multiply(number, ratio)) / ratio;
  48. }
  49. /**
  50. * 将字符串简单转换成数字, 并可数倍转换. 注意, 这个适用于整数倍(商品件数), 非整数的不能用这个处理小数.
  51. * @param {*} value 目标值
  52. * @param {*} ratio 倍数, 默认1
  53. * @returns number | origin, 转换后的数字, 无法转成数字的返回原值
  54. */
  55. function transformNumber(value, ratio = 1) {
  56. const v = Number(value);
  57. if (Number.isNaN(v)) {
  58. return value;
  59. } else {
  60. // 保留两位小数
  61. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Math.trunc(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(v, ratio), 100)), 100);
  62. }
  63. }
  64. // unit 单个商品的, 没有乘数量. 因为含有111 999 这些极端值, 没有格式化输出之前直接乘回出问题的.
  65. const getUnit = function (buyNum, index, attributeList, basePriceList) {
  66. // 算出购买数量位于 价格阶梯的 哪个区间
  67. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  68. let key = 'website_qty1';
  69. if (candidate.length) {
  70. key = candidate.pop()[0];
  71. }
  72. return transformNumber(basePriceList[index][key], buyNum);
  73. };
  74. // 打印和附加价格 的steup之和. 商品基础价格现在没有setup了.
  75. const getSetup = function (buyNum, form, additionList) {
  76. const sum = Object.entries(form).reduce((total, current) => {
  77. let s = 0;
  78. // 打印服务表单的数据跟附加服务表单的数据结构不一致, 以数字id字符串键名的是打印服务的数据
  79. if (/\d+/.test(current[0]) && current[1].enable) {
  80. const temp = current[1].colorForm.filter(i => i.id === current[1].printService);
  81. let colorNumber = 1;
  82. if (temp.length) {
  83. colorNumber = temp[0].colorNumber;
  84. }
  85. const decoration = current[1].decorationList.filter(i => i.id === current[1].printService);
  86. let setup = 0;
  87. if (decoration.length) {
  88. setup = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(Number(decoration[0].website_setup), Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(Number(decoration[0].supplier_setup), colorNumber - 1));
  89. }
  90. s = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(s, setup);
  91. } else if (current[1].length) {
  92. // 附加服务的表单数据, 有值说明该项有选中了附加服务
  93. const addition = additionList[current[0]].filter(addition => current[1].includes(addition.id));
  94. if (addition.length) {
  95. const temp = addition.reduce((t, c) => {
  96. let value = Number(c.website_setup);
  97. if ([5, 6].includes(c.website_setup_id)) {
  98. // 5是poa, 6是waived. 这种情况一般setup是留空的, 不留空大概是异常数据, 重置0保险一点.
  99. value = 0;
  100. }
  101. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, Number.isNaN(value) ? 0 : value);
  102. }, 0);
  103. s = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(s, temp);
  104. }
  105. }
  106. total = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, s);
  107. return total;
  108. }, 0);
  109. return transformNumber(sum);
  110. };
  111. // 打印价格的 阶梯基础价*购买数量.
  112. const getPrint = function (buyNum, form, attributeList) {
  113. // 算出购买数量位于 价格阶梯的 哪个区间
  114. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  115. const key = `website_qty${candidate.length}`;
  116. const key2 = `supplier_qty${candidate.length}`;
  117. // 如果其中一项为POA, 则‘和’都是POA
  118. const result = Object.entries(form).reduce((total, current) => {
  119. if (total === 'POA') {
  120. return total;
  121. }
  122. let sum = 0;
  123. if (/\d+/.test(current[0]) && current[1].enable) {
  124. const temp = current[1].colorForm.filter(i => i.id === current[1].printService);
  125. let colorNumber = 1;
  126. if (temp.length) {
  127. colorNumber = temp[0].colorNumber;
  128. }
  129. const decoration = current[1].decorationList.filter(i => i.id === current[1].printService);
  130. // 打印价格的基础价. 其中数字111(代表'-') 和999(代表'POA')
  131. const p1 = transformNumber(decoration[0][key]);
  132. if (p1 === 999 || p1 === 111 || typeof p1 !== 'number') {
  133. return 'POA';
  134. }
  135. // 打印价格的附加价
  136. const p2 = transformNumber(decoration[0][key2]);
  137. if (p2 === 999 || p2 === 111 || typeof p2 !== 'number') {
  138. return 'POA';
  139. }
  140. let price = 0;
  141. if (decoration.length) {
  142. price = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(p1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(p2, colorNumber - 1));
  143. }
  144. sum = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(sum, price);
  145. }
  146. total = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  147. return total;
  148. }, 0);
  149. return transformNumber(result, buyNum);
  150. };
  151. // 附加服务除了packing之外的总价
  152. const getAddon = function (buyNum, form, attributeList, additionList) {
  153. // 算出购买数量位于 价格阶梯的 哪个区间
  154. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  155. const key = `website_qty${candidate.length}`;
  156. const result = Object.entries(form).reduce((total, current) => {
  157. if (total === 'POA') {
  158. return total;
  159. }
  160. let sum = 0;
  161. if (!/\d+/.test(current[0]) && current[0] !== 'packaging') {
  162. sum = additionList[current[0]].filter(item => current[1].includes(item.id)).reduce((t, c) => {
  163. if (t === 'POA') {
  164. return t;
  165. }
  166. let temp = transformNumber(c[key]);
  167. if (temp === 999 || temp === 111 || typeof temp !== 'number') {
  168. temp = 0;
  169. return 'POA';
  170. }
  171. t = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, temp);
  172. return t;
  173. }, 0);
  174. }
  175. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  176. }, 0);
  177. return transformNumber(result, buyNum);
  178. };
  179. // 附加服务中 packing 的价格
  180. const getPackaging = function (buyNum, form, attributeList, additionList) {
  181. // 算出购买数量位于 价格阶梯的 哪个区间
  182. const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  183. const key = `website_qty${candidate.length}`;
  184. const result = Object.entries(form).reduce((total, current) => {
  185. if (total === 'POA') {
  186. return total;
  187. }
  188. let sum = 0;
  189. if (!/\d+/.test(current[0]) && current[0] === 'packaging') {
  190. sum = additionList[current[0]].filter(item => current[1].includes(item.id)).reduce((t, c) => {
  191. if (t === 'POA') {
  192. return t;
  193. }
  194. let temp = transformNumber(c[key]);
  195. if (temp === 999 || temp === 111 || typeof temp !== 'number') {
  196. temp = 0;
  197. return 'POA';
  198. }
  199. t = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, temp);
  200. return t;
  201. }, 0);
  202. }
  203. return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  204. }, 0);
  205. return transformNumber(result, buyNum);
  206. };
  207. // 运费计算. 从product页面抄过来的逻辑. +号是隐式类型转换
  208. const getFright = function (buyNum, config, freight, weight, ratio = 1) {
  209. // 单独批次数量的总重
  210. const totalWeight = Math.ceil(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(+weight.unit_w_local, buyNum));
  211. const expressFactor = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+config.express_freight, +config.fuel), 100));
  212. const AAEFactor = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+config.bag_freight, +config.fuel), 100));
  213. let frightCost = 0;
  214. if (freight.type === 1) {
  215. if (totalWeight > 20) {
  216. const a1 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["minus"])(totalWeight, 20);
  217. const a2 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a1, +freight.basic);
  218. const a3 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+freight.pickup, a2);
  219. frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a3, expressFactor);
  220. } else {
  221. frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(+freight.pickup, expressFactor);
  222. }
  223. } else if (freight.type === 2) {
  224. const a1 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(totalWeight, +freight.basic);
  225. const a2 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+freight.pickup, a1);
  226. frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a2, AAEFactor);
  227. } else {
  228. frightCost = 0;
  229. }
  230. return transformNumber(frightCost, ratio);
  231. };
  232. /***/ }),
  233. /***/ 182:
  234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  235. "use strict";
  236. // ESM COMPAT FLAG
  237. __webpack_require__.r(__webpack_exports__);
  238. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Pagination.vue?vue&type=template&id=044ef958&scoped=true
  239. var render = function render() {
  240. var _vm = this,
  241. _c = _vm._self._c;
  242. return _c('div', {
  243. staticClass: "pagination-container",
  244. class: {
  245. 'hidden': _vm.hidden
  246. }
  247. }, [_vm._t("slot"), _vm._ssrNode(" "), _c('el-pagination', _vm._b({
  248. attrs: {
  249. "background": _vm.background,
  250. "current-page": _vm.currentPage,
  251. "page-size": _vm.pageSize,
  252. "layout": _vm.layout,
  253. "total": _vm.total
  254. },
  255. on: {
  256. "update:currentPage": function ($event) {
  257. _vm.currentPage = $event;
  258. },
  259. "update:current-page": function ($event) {
  260. _vm.currentPage = $event;
  261. },
  262. "update:pageSize": function ($event) {
  263. _vm.pageSize = $event;
  264. },
  265. "update:page-size": function ($event) {
  266. _vm.pageSize = $event;
  267. },
  268. "size-change": _vm.handleSizeChange,
  269. "current-change": _vm.handleCurrentChange
  270. }
  271. }, 'el-pagination', _vm.$attrs, false))], 2);
  272. };
  273. var staticRenderFns = [];
  274. // CONCATENATED MODULE: ./components/Pagination.vue?vue&type=template&id=044ef958&scoped=true
  275. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Pagination.vue?vue&type=script&lang=js
  276. /* harmony default export */ var Paginationvue_type_script_lang_js = ({
  277. name: 'Pagination',
  278. props: {
  279. total: {
  280. required: true,
  281. type: Number
  282. },
  283. page: {
  284. type: Number,
  285. default: 0
  286. },
  287. limit: {
  288. type: Number,
  289. default: 10
  290. },
  291. // pageSizes: {
  292. // type: Array,
  293. // default() {
  294. // return [10, 20, 50, 100]
  295. // }
  296. // },
  297. layout: {
  298. type: String,
  299. default: 'prev, pager, next'
  300. },
  301. background: {
  302. type: Boolean,
  303. default: true
  304. },
  305. autoScroll: {
  306. type: Boolean,
  307. default: true
  308. },
  309. hidden: {
  310. type: Boolean,
  311. default: false
  312. }
  313. },
  314. computed: {
  315. currentPage: {
  316. get() {
  317. return this.page;
  318. },
  319. set(val) {
  320. this.$emit('update:page', val);
  321. }
  322. },
  323. pageSize: {
  324. get() {
  325. return this.limit;
  326. },
  327. set(val) {
  328. this.$emit('update:limit', val);
  329. }
  330. }
  331. },
  332. methods: {
  333. handleSizeChange(val) {
  334. this.$emit('pagination', {
  335. page: this.currentPage,
  336. limit: val
  337. });
  338. if (this.autoScroll) {
  339. scrollTo(0, 800);
  340. }
  341. },
  342. handleCurrentChange(val) {
  343. this.$emit('pagination', {
  344. page: val,
  345. limit: this.pageSize
  346. });
  347. if (this.autoScroll) {
  348. scrollTo(0, 800);
  349. }
  350. }
  351. }
  352. });
  353. // CONCATENATED MODULE: ./components/Pagination.vue?vue&type=script&lang=js
  354. /* harmony default export */ var components_Paginationvue_type_script_lang_js = (Paginationvue_type_script_lang_js);
  355. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  356. var componentNormalizer = __webpack_require__(2);
  357. // CONCATENATED MODULE: ./components/Pagination.vue
  358. function injectStyles (context) {
  359. var style0 = __webpack_require__(174)
  360. if (style0.__inject__) style0.__inject__(context)
  361. }
  362. /* normalize component */
  363. var component = Object(componentNormalizer["a" /* default */])(
  364. components_Paginationvue_type_script_lang_js,
  365. render,
  366. staticRenderFns,
  367. false,
  368. injectStyles,
  369. "044ef958",
  370. "230c7770"
  371. )
  372. /* harmony default export */ var Pagination = __webpack_exports__["default"] = (component.exports);
  373. /***/ }),
  374. /***/ 207:
  375. /***/ (function(module, exports) {
  376. // Exports
  377. module.exports = {
  378. };
  379. /***/ }),
  380. /***/ 228:
  381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  382. "use strict";
  383. __webpack_require__.r(__webpack_exports__);
  384. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(207);
  385. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  386. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ImageUpload_vue_vue_type_style_index_0_id_596f82bc_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  387. /***/ }),
  388. /***/ 245:
  389. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  390. "use strict";
  391. // ESM COMPAT FLAG
  392. __webpack_require__.r(__webpack_exports__);
  393. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ImageUpload.vue?vue&type=template&id=596f82bc&scoped=true
  394. var render = function render() {
  395. var _vm = this,
  396. _c = _vm._self._c;
  397. return _c('div', {
  398. staticClass: "com-image-upload"
  399. }, [_c('draggable', {
  400. staticClass: "flex start wrap",
  401. attrs: {
  402. "draggable": ".image-item"
  403. },
  404. on: {
  405. "end": _vm.end
  406. },
  407. model: {
  408. value: _vm.imageList,
  409. callback: function ($$v) {
  410. _vm.imageList = $$v;
  411. },
  412. expression: "imageList"
  413. }
  414. }, [_vm._l(_vm.imageList, function (item, index) {
  415. return _c('div', {
  416. key: item.uid || index,
  417. staticClass: "image-item flex",
  418. style: {
  419. width: _vm.width,
  420. height: _vm.height
  421. }
  422. }, [_c('img', {
  423. attrs: {
  424. "src": item.url,
  425. "alt": ""
  426. }
  427. }), _vm._v(" "), _c('div', {
  428. staticClass: "action-area flex center"
  429. }, [!_vm.disablePreview ? _c('span', {
  430. staticClass: "action-icon",
  431. on: {
  432. "click": function ($event) {
  433. return _vm.handlePictureCardPreview(item);
  434. }
  435. }
  436. }, [_c('i', {
  437. staticClass: "el-icon-zoom-in"
  438. })]) : _vm._e(), _vm._v(" "), _c('span', {
  439. staticClass: "action-icon",
  440. on: {
  441. "click": function ($event) {
  442. return _vm.handleRemove(index);
  443. }
  444. }
  445. }, [_c('i', {
  446. staticClass: "el-icon-delete"
  447. })])])]);
  448. }), _vm._v(" "), _c('el-progress', {
  449. directives: [{
  450. name: "show",
  451. rawName: "v-show",
  452. value: _vm.loading,
  453. expression: "loading"
  454. }],
  455. staticStyle: {
  456. "margin": "8px"
  457. },
  458. attrs: {
  459. "type": "circle",
  460. "percentage": _vm.uploadPercent,
  461. "width": Number(_vm.width.slice(0, _vm.width.length - 2))
  462. }
  463. }), _vm._v(" "), _c('div', {
  464. staticClass: "upload-wrap",
  465. class: {
  466. hide: _vm.loading || _vm.imageList.length >= _vm.max
  467. },
  468. style: {
  469. width: _vm.width,
  470. height: _vm.height
  471. }
  472. }, [_c('el-upload', {
  473. ref: "pictureUpload",
  474. staticClass: "custom-upload-item",
  475. attrs: {
  476. "multiple": true,
  477. "limit": _vm.max,
  478. "action": "",
  479. "drag": "",
  480. "accept": ".jpg,.png,.jpeg",
  481. "list-type": "picture-card",
  482. "file-list": _vm.imageList,
  483. "show-file-list": false,
  484. "auto-upload": false,
  485. "on-remove": _vm.handleRemove,
  486. "on-preview": _vm.handlePictureCardPreview,
  487. "on-change": (file, fileList) => {
  488. _vm.handleUpload(file, fileList);
  489. }
  490. }
  491. }, [_c('i', {
  492. staticClass: "el-icon-plus avatar-uploader-icon"
  493. })])], 1)], 2), _vm._ssrNode(" "), _c('el-dialog', {
  494. attrs: {
  495. "visible": _vm.imageDialogVisible
  496. },
  497. on: {
  498. "update:visible": function ($event) {
  499. _vm.imageDialogVisible = $event;
  500. }
  501. }
  502. }, [_c('img', {
  503. attrs: {
  504. "width": "100%",
  505. "src": _vm.imageUrl,
  506. "alt": ""
  507. }
  508. })])], 2);
  509. };
  510. var staticRenderFns = [];
  511. // CONCATENATED MODULE: ./components/ImageUpload.vue?vue&type=template&id=596f82bc&scoped=true
  512. // EXTERNAL MODULE: external "vuedraggable"
  513. var external_vuedraggable_ = __webpack_require__(143);
  514. var external_vuedraggable_default = /*#__PURE__*/__webpack_require__.n(external_vuedraggable_);
  515. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ImageUpload.vue?vue&type=script&lang=js
  516. // import { common } from '@/api'
  517. /* harmony default export */ var ImageUploadvue_type_script_lang_js = ({
  518. name: 'ImageUpload',
  519. components: {
  520. draggable: external_vuedraggable_default.a
  521. },
  522. props: {
  523. list: {
  524. type: Array,
  525. default: () => []
  526. },
  527. max: {
  528. type: Number,
  529. default: 16
  530. },
  531. disablePreview: {
  532. type: Boolean,
  533. default: false
  534. },
  535. width: {
  536. type: String,
  537. default: '150px'
  538. },
  539. height: {
  540. type: String,
  541. default: '150px'
  542. }
  543. },
  544. data() {
  545. return {
  546. // 组件内部数据.
  547. imageList: [],
  548. loading: false,
  549. uploadPercent: 0,
  550. imageDialogVisible: false,
  551. // 预览大图的url, 每次点击都会更新
  552. imageUrl: ''
  553. };
  554. },
  555. computed: {
  556. fulled() {
  557. return 0;
  558. }
  559. },
  560. watch: {
  561. list() {
  562. this.imageList = JSON.parse(JSON.stringify(this.list));
  563. }
  564. },
  565. mounted() {
  566. this.updateList();
  567. },
  568. methods: {
  569. handleUpload(file, fileList) {
  570. this.fileList = [];
  571. if (file.status === 'ready') {
  572. this.loading = true;
  573. const interval = setInterval(() => {
  574. if (this.uploadPercent >= 99) {
  575. clearInterval(interval);
  576. return;
  577. }
  578. this.uploadPercent += 1; // 进度条进度
  579. }, 100);
  580. }
  581. const formData = new FormData();
  582. fileList.forEach(file => {
  583. formData.append('file', file.raw);
  584. });
  585. formData.append('type', 1);
  586. this.$axios.post(`/uk-api/user_base/imagesUpload`, formData).then(response => {
  587. if (response.result.code === 200) {
  588. this.imageList.push({
  589. url: response.result.data,
  590. uid: file.uid
  591. });
  592. this.updateList();
  593. return;
  594. }
  595. this.$message({
  596. message: response.result.message,
  597. type: 'warning'
  598. });
  599. }).catch(error => {
  600. console.log(error, 'component upload image error');
  601. this.$message.error(error.response.data.msg);
  602. }).finally(() => {
  603. this.loading = false;
  604. // 进度条恢复到初始状态
  605. this.uploadPercent = 0;
  606. });
  607. },
  608. handleRemove(index) {
  609. this.imageList.splice(index, 1);
  610. this.updateList();
  611. },
  612. handlePictureCardPreview(file) {
  613. this.imageUrl = file.url;
  614. this.imageDialogVisible = true;
  615. },
  616. // 每次更新imageList后手动更新父组件的数据, 不能用watch自动更新, 因为同时要watch prop值更新iamgeList, 同时watch会死循环.
  617. // 直接把prop数据绑定到dragable 和 el-upload的话vue和eslint会报错, 也可能造成调试困难
  618. updateList() {
  619. this.$emit('update:list', JSON.parse(JSON.stringify(this.imageList)));
  620. },
  621. end() {
  622. this.updateList();
  623. }
  624. }
  625. });
  626. // CONCATENATED MODULE: ./components/ImageUpload.vue?vue&type=script&lang=js
  627. /* harmony default export */ var components_ImageUploadvue_type_script_lang_js = (ImageUploadvue_type_script_lang_js);
  628. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  629. var componentNormalizer = __webpack_require__(2);
  630. // CONCATENATED MODULE: ./components/ImageUpload.vue
  631. function injectStyles (context) {
  632. var style0 = __webpack_require__(228)
  633. if (style0.__inject__) style0.__inject__(context)
  634. }
  635. /* normalize component */
  636. var component = Object(componentNormalizer["a" /* default */])(
  637. components_ImageUploadvue_type_script_lang_js,
  638. render,
  639. staticRenderFns,
  640. false,
  641. injectStyles,
  642. "596f82bc",
  643. "7f6e537e"
  644. )
  645. /* harmony default export */ var ImageUpload = __webpack_exports__["default"] = (component.exports);
  646. /***/ }),
  647. /***/ 260:
  648. /***/ (function(module, exports) {
  649. // Exports
  650. module.exports = {
  651. };
  652. /***/ }),
  653. /***/ 261:
  654. /***/ (function(module, exports) {
  655. // Exports
  656. module.exports = {
  657. };
  658. /***/ }),
  659. /***/ 316:
  660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  661. "use strict";
  662. __webpack_require__.r(__webpack_exports__);
  663. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_799f5a64_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(260);
  664. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_799f5a64_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_799f5a64_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
  665. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_799f5a64_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_799f5a64_prod_lang_scss__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  666. /***/ }),
  667. /***/ 317:
  668. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  669. "use strict";
  670. __webpack_require__.r(__webpack_exports__);
  671. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_799f5a64_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(261);
  672. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_799f5a64_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_799f5a64_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  673. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_799f5a64_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_799f5a64_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  674. /***/ }),
  675. /***/ 358:
  676. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  677. "use strict";
  678. // ESM COMPAT FLAG
  679. __webpack_require__.r(__webpack_exports__);
  680. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/home/myDetail/index.vue?vue&type=template&id=799f5a64&scoped=true
  681. var render = function render() {
  682. var _vm$$store$state$user, _vm$$store$state$user2, _vm$$store$state$user3;
  683. var _vm = this,
  684. _c = _vm._self._c;
  685. return _c('div', {
  686. staticClass: "com-main com-margin-auto com-fixationwidth-1400"
  687. }, [_c('el-breadcrumb', {
  688. attrs: {
  689. "separator-class": "el-icon-arrow-right"
  690. }
  691. }, [_c('el-breadcrumb-item', {
  692. attrs: {
  693. "to": {
  694. path: '/'
  695. }
  696. }
  697. }, [_vm._v("Home")]), _vm._v(" "), _c('el-breadcrumb-item', [_vm._v(_vm._s(_vm.tabName))])], 1), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content\" data-v-799f5a64>", "</div>", [_c('el-menu', {
  698. ref: "menu",
  699. staticClass: "el-menu-vertical",
  700. attrs: {
  701. "background-color": "#e8eaee",
  702. "text-color": "#4a596c",
  703. "active-text-color": "#fff",
  704. "default-active": _vm.activeMenu
  705. },
  706. on: {
  707. "select": _vm.handleClick
  708. }
  709. }, [_c('el-menu-item', {
  710. attrs: {
  711. "index": "profile"
  712. }
  713. }, [_c('i', {
  714. staticClass: "iconfont"
  715. }, [_vm._v("")]), _vm._v(" "), _c('span', {
  716. attrs: {
  717. "slot": "title"
  718. },
  719. slot: "title"
  720. }, [_vm._v("My Profile")])]), _vm._v(" "), _c('el-submenu', {
  721. attrs: {
  722. "index": "order"
  723. }
  724. }, [_c('template', {
  725. slot: "title"
  726. }, [_c('i', {
  727. staticClass: "iconfont"
  728. }, [_vm._v("")]), _vm._v(" "), _c('span', {
  729. attrs: {
  730. "slot": "title"
  731. },
  732. slot: "title"
  733. }, [_vm._v("My Orders")])]), _vm._v(" "), _c('el-menu-item', {
  734. attrs: {
  735. "index": "all-orders"
  736. }
  737. }, [_vm._v("All Orders")]), _vm._v(" "), _c('el-menu-item', {
  738. attrs: {
  739. "index": "open-orders"
  740. }
  741. }, [_vm._v("Open Orders")]), _vm._v(" "), _c('el-menu-item', {
  742. attrs: {
  743. "index": "closed-orders"
  744. }
  745. }, [_vm._v("Closed Orders")])], 2)], 1), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-right\" data-v-799f5a64>", "</div>", [_vm._ssrNode("<div" + _vm._ssrStyle(null, null, {
  746. display: _vm.activeMenu === 'profile' ? '' : 'none'
  747. }) + " data-v-799f5a64>", "</div>", [_vm._ssrNode("<div class=\"content-form\" data-v-799f5a64>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-799f5a64>" + _vm._ssrEscape(_vm._s(_vm.tabName)) + "</p> "), _c('el-form', {
  748. ref: "form",
  749. attrs: {
  750. "model": _vm.profileform,
  751. "rules": _vm.rules,
  752. "label-width": "220px"
  753. }
  754. }, [_c('el-row', [_c('el-col', {
  755. attrs: {
  756. "span": 15
  757. }
  758. }, [_c('el-form-item', {
  759. attrs: {
  760. "label": "Email Address",
  761. "prop": "email"
  762. }
  763. }, [_c('el-input', {
  764. attrs: {
  765. "disabled": true
  766. },
  767. model: {
  768. value: _vm.profileform.email,
  769. callback: function ($$v) {
  770. _vm.$set(_vm.profileform, "email", $$v);
  771. },
  772. expression: "profileform.email"
  773. }
  774. })], 1)], 1), _vm._v(" "), _c('el-col', {
  775. attrs: {
  776. "span": 9
  777. }
  778. }, [_c('el-form-item', {
  779. staticClass: "upload-item",
  780. attrs: {
  781. "label": "Your Logo"
  782. }
  783. }, [_c('image-upload', {
  784. attrs: {
  785. "list": _vm.profileform.logo,
  786. "disablePreview": true,
  787. "max": 1
  788. },
  789. on: {
  790. "update:list": function ($event) {
  791. return _vm.$set(_vm.profileform, "logo", $event);
  792. }
  793. }
  794. })], 1)], 1)], 1), _vm._v(" "), _c('el-form-item', {
  795. attrs: {
  796. "label": "Company Name",
  797. "prop": "company"
  798. }
  799. }, [_c('el-input', {
  800. model: {
  801. value: _vm.profileform.company,
  802. callback: function ($$v) {
  803. _vm.$set(_vm.profileform, "company", $$v);
  804. },
  805. expression: "profileform.company"
  806. }
  807. })], 1), _vm._v(" "), _c('el-form-item', {
  808. attrs: {
  809. "label": "First Name",
  810. "prop": "contacts"
  811. }
  812. }, [_c('el-input', {
  813. model: {
  814. value: _vm.profileform.contacts,
  815. callback: function ($$v) {
  816. _vm.$set(_vm.profileform, "contacts", $$v);
  817. },
  818. expression: "profileform.contacts"
  819. }
  820. })], 1), _vm._v(" "), _c('el-form-item', {
  821. attrs: {
  822. "label": "Last Name",
  823. "prop": "last_name"
  824. }
  825. }, [_c('el-input', {
  826. model: {
  827. value: _vm.profileform.last_name,
  828. callback: function ($$v) {
  829. _vm.$set(_vm.profileform, "last_name", $$v);
  830. },
  831. expression: "profileform.last_name"
  832. }
  833. })], 1), _vm._v(" "), _c('el-form-item', {
  834. attrs: {
  835. "label": "Contact Phone Number",
  836. "prop": "phone"
  837. }
  838. }, [_c('el-input', {
  839. model: {
  840. value: _vm.profileform.phone,
  841. callback: function ($$v) {
  842. _vm.$set(_vm.profileform, "phone", $$v);
  843. },
  844. expression: "profileform.phone"
  845. }
  846. })], 1)], 1)], 2), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-form\" style=\"margin-top: 20px\" data-v-799f5a64>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-799f5a64>Account And Password</p> "), _c('el-form', {
  847. ref: "ruleForm",
  848. staticClass: "accountPasswordForm",
  849. attrs: {
  850. "model": _vm.accountPasswordForm,
  851. "label-width": "220px"
  852. }
  853. }, [_c('el-form-item', {
  854. attrs: {
  855. "label": "Enter the new password",
  856. "prop": "password"
  857. }
  858. }, [_c('el-input', {
  859. model: {
  860. value: _vm.accountPasswordForm.password,
  861. callback: function ($$v) {
  862. _vm.$set(_vm.accountPasswordForm, "password", $$v);
  863. },
  864. expression: "accountPasswordForm.password"
  865. }
  866. })], 1), _vm._v(" "), _c('el-form-item', {
  867. attrs: {
  868. "label": "Retype the password",
  869. "prop": "confirm_password"
  870. }
  871. }, [_c('el-input', {
  872. model: {
  873. value: _vm.accountPasswordForm.confirm_password,
  874. callback: function ($$v) {
  875. _vm.$set(_vm.accountPasswordForm, "confirm_password", $$v);
  876. },
  877. expression: "accountPasswordForm.confirm_password"
  878. }
  879. })], 1), _vm._v(" "), _c('el-form-item', [_c('el-button', {
  880. staticClass: "saveBtn",
  881. on: {
  882. "click": function ($event) {
  883. return _vm.onSave('form');
  884. }
  885. }
  886. }, [_vm._v("\n Save\n ")])], 1)], 1)], 2)], 2), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-form\"" + _vm._ssrStyle(null, null, {
  887. display: _vm.activeMenu === 'enquiry' ? '' : 'none'
  888. }) + " data-v-799f5a64>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-799f5a64>" + _vm._ssrEscape(_vm._s(_vm.tabName)) + "</p> "), _vm._ssrNode("<div class=\"searchInput\" data-v-799f5a64>", "</div>", [_c('el-input', {
  889. attrs: {
  890. "placeholder": "Search your job name",
  891. "clearable": ""
  892. },
  893. on: {
  894. "clear": _vm.getEnquiryList
  895. },
  896. nativeOn: {
  897. "keyup": function ($event) {
  898. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
  899. return _vm.getEnquiryList.apply(null, arguments);
  900. }
  901. },
  902. model: {
  903. value: _vm.enquiryKeyword,
  904. callback: function ($$v) {
  905. _vm.enquiryKeyword = $$v;
  906. },
  907. expression: "enquiryKeyword"
  908. }
  909. }, [_c('i', {
  910. staticClass: "el-input__icon el-icon-search",
  911. attrs: {
  912. "slot": "suffix"
  913. },
  914. on: {
  915. "click": _vm.getEnquiryList
  916. },
  917. slot: "suffix"
  918. })])], 1), _vm._ssrNode(" "), _c('el-table', {
  919. directives: [{
  920. name: "loading",
  921. rawName: "v-loading",
  922. value: _vm.tableLoading,
  923. expression: "tableLoading"
  924. }],
  925. staticStyle: {
  926. "width": "100%"
  927. },
  928. attrs: {
  929. "data": _vm.enquiryList,
  930. "stripe": "",
  931. "header-cell-style": {
  932. background: '#00213b',
  933. color: '#ffffff'
  934. }
  935. },
  936. on: {
  937. "row-click": _vm.goEnquiryDetail
  938. }
  939. }, [_c('el-table-column', {
  940. attrs: {
  941. "prop": "Auto_Number",
  942. "label": "Enquiry No"
  943. }
  944. }), _vm._v(" "), _c('el-table-column', {
  945. attrs: {
  946. "prop": "Enquiry_Title",
  947. "label": "Job Name",
  948. "width": "300"
  949. }
  950. }), _vm._v(" "), _c('el-table-column', {
  951. attrs: {
  952. "prop": "Customize_Pipeline_Stage",
  953. "label": "Status"
  954. }
  955. }), _vm._v(" "), _c('el-table-column', {
  956. attrs: {
  957. "prop": "Enquiry_Created",
  958. "label": "Date"
  959. },
  960. scopedSlots: _vm._u([{
  961. key: "default",
  962. fn: function (scope) {
  963. return [_c('div', [_vm._v("\n " + _vm._s(_vm.$utils.formatTime(scope.row.Sales_Order_Created, 'DD/MM/YYYY', true)) + "\n ")])];
  964. }
  965. }])
  966. }), _vm._v(" "), _c('el-table-column', {
  967. attrs: {
  968. "label": "Action",
  969. "width": "90",
  970. "align": "center"
  971. }
  972. }, [[_c('el-button', {
  973. staticStyle: {
  974. "background-color": "rgb(0, 33, 59)",
  975. "color": "#fff"
  976. },
  977. attrs: {
  978. "size": "small",
  979. "plain": ""
  980. }
  981. }, [_vm._v("View")])]], 2)], 1), _vm._ssrNode(" "), _c('pagination', {
  982. directives: [{
  983. name: "show",
  984. rawName: "v-show",
  985. value: _vm.enquiryTotal > 0,
  986. expression: "enquiryTotal > 0"
  987. }],
  988. attrs: {
  989. "total": _vm.enquiryTotal,
  990. "page": _vm.enquiryListQuery.page,
  991. "limit": _vm.enquiryListQuery.limit
  992. },
  993. on: {
  994. "update:page": function ($event) {
  995. return _vm.$set(_vm.enquiryListQuery, "page", $event);
  996. },
  997. "update:limit": function ($event) {
  998. return _vm.$set(_vm.enquiryListQuery, "limit", $event);
  999. },
  1000. "pagination": _vm.getEnquiryList
  1001. }
  1002. })], 2), _vm._ssrNode(" "), _vm._ssrNode("<div class=\"content-form\"" + _vm._ssrStyle(null, null, {
  1003. display: _vm.activeMenu.includes('orders') ? '' : 'none'
  1004. }) + " data-v-799f5a64>", "</div>", [_vm._ssrNode("<p class=\"content-title\" data-v-799f5a64>" + _vm._ssrEscape(_vm._s(_vm.tabName)) + "</p> "), _vm._ssrNode("<div class=\"searchInput\" data-v-799f5a64>", "</div>", [_c('el-input', {
  1005. attrs: {
  1006. "placeholder": "Search your job name",
  1007. "clearable": ""
  1008. },
  1009. on: {
  1010. "clear": _vm.getOrdersList
  1011. },
  1012. nativeOn: {
  1013. "keyup": function ($event) {
  1014. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
  1015. return _vm.getOrdersList.apply(null, arguments);
  1016. }
  1017. },
  1018. model: {
  1019. value: _vm.orderKeyword,
  1020. callback: function ($$v) {
  1021. _vm.orderKeyword = $$v;
  1022. },
  1023. expression: "orderKeyword"
  1024. }
  1025. }, [_c('i', {
  1026. staticClass: "el-input__icon el-icon-search",
  1027. attrs: {
  1028. "slot": "suffix"
  1029. },
  1030. on: {
  1031. "click": _vm.getOrdersList
  1032. },
  1033. slot: "suffix"
  1034. })]), _vm._ssrNode(" "), _vm.selShow ? _c('el-select', {
  1035. attrs: {
  1036. "filterable": "",
  1037. "clearable": "",
  1038. "default-first-option": "",
  1039. "placeholder": "Select the status"
  1040. },
  1041. model: {
  1042. value: _vm.selword,
  1043. callback: function ($$v) {
  1044. _vm.selword = $$v;
  1045. },
  1046. expression: "selword"
  1047. }
  1048. }, _vm._l(_vm.orderSelList, function (option) {
  1049. return _c('el-option', {
  1050. key: option,
  1051. attrs: {
  1052. "label": option,
  1053. "value": option
  1054. }
  1055. });
  1056. }), 1) : _vm._e(), _vm._ssrNode(" "), ((_vm$$store$state$user = _vm.$store.state.userInfo) === null || _vm$$store$state$user === void 0 ? void 0 : (_vm$$store$state$user2 = _vm$$store$state$user.memberCrmcomList) === null || _vm$$store$state$user2 === void 0 ? void 0 : _vm$$store$state$user2.length) > 1 ? _c('el-select', {
  1057. attrs: {
  1058. "filterable": "",
  1059. "clearable": "",
  1060. "default-first-option": "",
  1061. "placeholder": "Select the CRM"
  1062. },
  1063. model: {
  1064. value: _vm.accounts_id,
  1065. callback: function ($$v) {
  1066. _vm.accounts_id = $$v;
  1067. },
  1068. expression: "accounts_id"
  1069. }
  1070. }, _vm._l((_vm$$store$state$user3 = _vm.$store.state.userInfo) === null || _vm$$store$state$user3 === void 0 ? void 0 : _vm$$store$state$user3.memberCrmcomList, function (option) {
  1071. return _c('el-option', {
  1072. key: option.id,
  1073. attrs: {
  1074. "label": option.name,
  1075. "value": option.id
  1076. }
  1077. });
  1078. }), 1) : _vm._e(), _vm._ssrNode(" "), _c('el-button', {
  1079. staticStyle: {
  1080. "background-color": "rgb(0, 33, 59)",
  1081. "border-color": "rgb(0, 33, 59)"
  1082. },
  1083. attrs: {
  1084. "type": "primary"
  1085. },
  1086. on: {
  1087. "click": _vm.getOrdersList
  1088. }
  1089. }, [_vm._v("Submit")])], 2), _vm._ssrNode(" "), _c('el-table', {
  1090. directives: [{
  1091. name: "loading",
  1092. rawName: "v-loading",
  1093. value: _vm.tableLoading,
  1094. expression: "tableLoading"
  1095. }],
  1096. staticStyle: {
  1097. "width": "100%"
  1098. },
  1099. attrs: {
  1100. "data": _vm.tableData,
  1101. "stripe": "",
  1102. "header-cell-style": {
  1103. background: '#00213b',
  1104. color: '#ffffff'
  1105. }
  1106. }
  1107. }, [_c('el-table-column', {
  1108. attrs: {
  1109. "prop": "Sales_Order_Title_Job_Name",
  1110. "label": "Job Name"
  1111. }
  1112. }), _vm._v(" "), _c('el-table-column', {
  1113. attrs: {
  1114. "width": "100",
  1115. "prop": "Reference",
  1116. "label": "Order No"
  1117. }
  1118. }), _vm._v(" "), _c('el-table-column', {
  1119. attrs: {
  1120. "width": "120",
  1121. "prop": "Sales_Order_Created",
  1122. "label": "Order Date"
  1123. },
  1124. scopedSlots: _vm._u([{
  1125. key: "default",
  1126. fn: function (scope) {
  1127. return [_c('div', [_vm._v("\n " + _vm._s(_vm.$utils.formatTime(scope.row.Sales_Order_Created, 'DD/MM/YYYY')) + "\n ")])];
  1128. }
  1129. }])
  1130. }), _vm._v(" "), _c('el-table-column', {
  1131. attrs: {
  1132. "width": "140",
  1133. "prop": "Order_Stage_new",
  1134. "label": "Order Status"
  1135. }
  1136. }), _vm._v(" "), _c('el-table-column', {
  1137. attrs: {
  1138. "width": "160",
  1139. "prop": "Tracking_No_arr",
  1140. "label": "Tracking No#"
  1141. },
  1142. scopedSlots: _vm._u([{
  1143. key: "default",
  1144. fn: function (scope) {
  1145. return [_c('ul', {
  1146. staticClass: "location"
  1147. }, _vm._l(scope.row.Tracking_No_arr, function (item) {
  1148. return _c('li', {
  1149. key: item.Tracking_No,
  1150. on: {
  1151. "click": function ($event) {
  1152. return _vm.openTracking_URL(item.Tracking_URL);
  1153. }
  1154. }
  1155. }, [_c('i', {
  1156. staticClass: "el-icon-location"
  1157. }), _vm._v(_vm._s(item.Tracking_No) + "\n ")]);
  1158. }), 0)];
  1159. }
  1160. }])
  1161. }), _vm._v(" "), _c('el-table-column', {
  1162. attrs: {
  1163. "width": "110",
  1164. "prop": "Grand_Total",
  1165. "label": "Amount"
  1166. },
  1167. scopedSlots: _vm._u([{
  1168. key: "default",
  1169. fn: function (scope) {
  1170. return [_vm._v("\n $" + _vm._s(_vm.transformNumber(scope.row.Grand_Total)) + "\n ")];
  1171. }
  1172. }])
  1173. }), _vm._v(" "), _c('el-table-column', {
  1174. attrs: {
  1175. "label": "Action",
  1176. "width": "80",
  1177. "align": "center"
  1178. },
  1179. scopedSlots: _vm._u([{
  1180. key: "default",
  1181. fn: function (scope) {
  1182. return [_c('el-button', {
  1183. staticStyle: {
  1184. "background-color": "rgb(0, 33, 59)",
  1185. "color": "#fff"
  1186. },
  1187. attrs: {
  1188. "size": "small",
  1189. "plain": ""
  1190. },
  1191. on: {
  1192. "click": function ($event) {
  1193. return _vm.goOrderDetail(scope.row);
  1194. }
  1195. }
  1196. }, [_vm._v("View")])];
  1197. }
  1198. }])
  1199. })], 1), _vm._ssrNode(" "), _c('pagination', {
  1200. directives: [{
  1201. name: "show",
  1202. rawName: "v-show",
  1203. value: _vm.orderTotal > 0,
  1204. expression: "orderTotal > 0"
  1205. }],
  1206. attrs: {
  1207. "total": _vm.orderTotal,
  1208. "page": _vm.orderListQuery.page,
  1209. "limit": _vm.orderListQuery.limit
  1210. },
  1211. on: {
  1212. "update:page": function ($event) {
  1213. return _vm.$set(_vm.orderListQuery, "page", $event);
  1214. },
  1215. "update:limit": function ($event) {
  1216. return _vm.$set(_vm.orderListQuery, "limit", $event);
  1217. },
  1218. "pagination": _vm.getOrdersList
  1219. }
  1220. })], 2)], 2)], 2), _vm._ssrNode(" "), _c('dialog-XX-success', {
  1221. attrs: {
  1222. "visible": _vm.xxContentVisible,
  1223. "content": _vm.xxContent
  1224. },
  1225. on: {
  1226. "update:visible": function ($event) {
  1227. _vm.xxContentVisible = $event;
  1228. },
  1229. "notify-parent": _vm.handleNotification
  1230. }
  1231. }), _vm._ssrNode(" "), _c('el-dialog', {
  1232. attrs: {
  1233. "lock-scroll": false,
  1234. "visible": _vm.urlDialogShow,
  1235. "center": "",
  1236. "width": "850px",
  1237. "top": "20vh"
  1238. },
  1239. on: {
  1240. "update:visible": function ($event) {
  1241. _vm.urlDialogShow = $event;
  1242. }
  1243. }
  1244. }, [_c('iframe', {
  1245. staticStyle: {
  1246. "width": "100%",
  1247. "height": "500px"
  1248. },
  1249. attrs: {
  1250. "src": _vm.Tracking_URL,
  1251. "frameborder": "0"
  1252. }
  1253. })])], 2);
  1254. };
  1255. var staticRenderFns = [];
  1256. // CONCATENATED MODULE: ./pages/home/myDetail/index.vue?vue&type=template&id=799f5a64&scoped=true
  1257. // EXTERNAL MODULE: external "vuex"
  1258. var external_vuex_ = __webpack_require__(6);
  1259. // EXTERNAL MODULE: ./components/DIalogXXSuccess.vue + 4 modules
  1260. var DIalogXXSuccess = __webpack_require__(30);
  1261. // EXTERNAL MODULE: ./components/ImageUpload.vue + 4 modules
  1262. var ImageUpload = __webpack_require__(245);
  1263. // EXTERNAL MODULE: ./utils/price.js
  1264. var price = __webpack_require__(175);
  1265. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/home/myDetail/index.vue?vue&type=script&lang=js
  1266. // import addAddressDialog from '../../../components/addAddressDialog.vue'
  1267. /* harmony default export */ var myDetailvue_type_script_lang_js = ({
  1268. components: {
  1269. // addAddressDialog,
  1270. 'dialog-XX-success': DIalogXXSuccess["default"],
  1271. imageUpload: ImageUpload["default"]
  1272. },
  1273. data() {
  1274. return {
  1275. xxContentVisible: false,
  1276. xxContent: 'success',
  1277. componentVisible: 1,
  1278. // 2:add 3:edit 4:audit
  1279. tabName: '',
  1280. tableLoading: true,
  1281. // 表单配置项
  1282. profileform: {},
  1283. rules: {
  1284. email: [{
  1285. required: true,
  1286. message: 'Please enter the email',
  1287. trigger: 'blur'
  1288. }],
  1289. company: [{
  1290. required: true,
  1291. message: 'Please enter the company',
  1292. trigger: 'blur'
  1293. }],
  1294. contacts: [{
  1295. required: true,
  1296. message: 'Please enter first name',
  1297. trigger: 'blur'
  1298. }],
  1299. last_name: [{
  1300. required: true,
  1301. message: 'Please enter last name',
  1302. trigger: 'blur'
  1303. }],
  1304. phone: [{
  1305. required: true,
  1306. message: 'Please enter the phone',
  1307. trigger: 'blur'
  1308. }],
  1309. password: [{
  1310. required: true,
  1311. message: 'Please enter the password',
  1312. trigger: 'blur'
  1313. }],
  1314. confirm_password: [{
  1315. required: true,
  1316. message: 'Please enter the confirm_password',
  1317. trigger: 'blur'
  1318. }]
  1319. },
  1320. accountPasswordForm: {
  1321. password: '',
  1322. confirm_password: ''
  1323. },
  1324. orderKeyword: '',
  1325. selword: '',
  1326. accounts_id: '',
  1327. orderTotal: 0,
  1328. orderListQuery: {
  1329. page: 1,
  1330. limit: 20
  1331. },
  1332. tableData: [],
  1333. dialogVisible: false,
  1334. addressTotal: 0,
  1335. addressListQuery: {
  1336. page: 1,
  1337. limit: 8
  1338. },
  1339. addressList: [],
  1340. addressDetail: {},
  1341. enquiryKeyword: '',
  1342. enquiryList: [],
  1343. enquiryListQuery: {
  1344. page: 1,
  1345. limit: 20
  1346. },
  1347. enquiryTotal: 0,
  1348. orderSelList: [],
  1349. Tracking_URL: '',
  1350. urlDialogShow: false
  1351. };
  1352. },
  1353. computed: {
  1354. activeMenu() {
  1355. var _this$$route$query$ty;
  1356. return (_this$$route$query$ty = this.$route.query.type) !== null && _this$$route$query$ty !== void 0 ? _this$$route$query$ty : 'profile';
  1357. },
  1358. selShow() {
  1359. return this.activeMenu === 'all-orders' || this.activeMenu === 'open-orders';
  1360. }
  1361. },
  1362. watch: {
  1363. $route: {
  1364. handler(to) {
  1365. if (false) {}
  1366. }
  1367. },
  1368. orderKeyword() {
  1369. this.orderListQuery.page = 1;
  1370. },
  1371. enquiryKeyword() {
  1372. this.enquiryListQuery.page = 1;
  1373. }
  1374. },
  1375. mounted() {
  1376. if (this.$utils.checkLogin()) {
  1377. this.updateType();
  1378. } else {
  1379. this.$router.replace('/');
  1380. }
  1381. },
  1382. methods: {
  1383. transformNumber(value) {
  1384. return Object(price["a" /* round */])(Number(value)).toFixed(2);
  1385. },
  1386. handleClick(key, keyPath) {
  1387. if (key) {
  1388. this.$router.push({
  1389. path: '/home/myDetail',
  1390. query: {
  1391. type: key
  1392. }
  1393. });
  1394. }
  1395. },
  1396. updateType() {
  1397. if (this.activeMenu === 'profile') {
  1398. this.tabName = 'My Profile';
  1399. this.getMemberDetail();
  1400. } else if (this.activeMenu === 'enquiry') {
  1401. this.tabName = 'My Enquiry';
  1402. this.getEnquiryList();
  1403. } else if (this.activeMenu === 'address') {
  1404. // this.tabName = 'My Address'
  1405. // this.getAddressList()
  1406. } else {
  1407. this.selword = '';
  1408. if (this.activeMenu === 'all-orders') {
  1409. this.orderSelList = ['Order Confirmed', 'In Production', 'In Transit', 'Order Completed'];
  1410. }
  1411. if (this.activeMenu === 'open-orders') {
  1412. this.orderSelList = ['Order Confirmed', 'In Production', 'In Transit'];
  1413. }
  1414. this.tabName = 'My Orders';
  1415. this.getOrdersList();
  1416. }
  1417. },
  1418. closeAddressDialog() {
  1419. this.dialogVisible = false;
  1420. },
  1421. // 获取用户信息
  1422. getMemberDetail() {
  1423. this.$axios.get('/uk-api/uk/member/detail').then(res => {
  1424. if (res.code === 1) {
  1425. this.profileform = res.result;
  1426. this.profileform.logo = this.profileform.logo ? this.formatLogo(this.profileform.logo) : [];
  1427. }
  1428. }).catch(() => {});
  1429. },
  1430. formatLogo(params) {
  1431. return [{
  1432. url: params
  1433. }];
  1434. },
  1435. onSave(form) {
  1436. if (this.accountPasswordForm.confirm_password !== this.accountPasswordForm.password) {
  1437. this.$message.error('The second password is inconsistent!');
  1438. return;
  1439. }
  1440. this.$refs[form].validate(valid => {
  1441. if (valid) {
  1442. var _this$profileform$log, _this$profileform$log2;
  1443. const requestBody = {
  1444. email: this.profileform.email,
  1445. company: this.profileform.company,
  1446. contacts: this.profileform.contacts,
  1447. last_name: this.profileform.last_name,
  1448. phone: this.profileform.phone,
  1449. logo: (_this$profileform$log = (_this$profileform$log2 = this.profileform.logo[0]) === null || _this$profileform$log2 === void 0 ? void 0 : _this$profileform$log2.url) !== null && _this$profileform$log !== void 0 ? _this$profileform$log : ''
  1450. };
  1451. let needLogout = false;
  1452. if (this.accountPasswordForm.password.trim() !== '') {
  1453. requestBody.password = this.accountPasswordForm.password;
  1454. requestBody.confirm_password = this.accountPasswordForm.confirm_password;
  1455. needLogout = true;
  1456. }
  1457. this.$axios.post('/uk-api/uk/member/edit', requestBody).then(res => {
  1458. if (res.code === 1) {
  1459. this.$notify({
  1460. customClass: 'custom-notify-class',
  1461. title: 'success',
  1462. message: 'The profile information is modified successfully',
  1463. type: 'success'
  1464. });
  1465. if (needLogout) {
  1466. setTimeout(() => {
  1467. this.$store.dispatch('logout').then(() => {
  1468. this.$router.push('/');
  1469. });
  1470. }, 500);
  1471. }
  1472. }
  1473. }).catch(() => {});
  1474. } else {
  1475. console.log('error submit!!');
  1476. return false;
  1477. }
  1478. });
  1479. },
  1480. // 获取订单列表
  1481. getOrdersList() {
  1482. var _this$$store$state$us;
  1483. const accounts_id = this.accounts_id ? this.accounts_id : (_this$$store$state$us = this.$store.state.userInfo) === null || _this$$store$state$us === void 0 ? void 0 : _this$$store$state$us.memberCrmcomList.map(i => i.id).join();
  1484. const type = this.activeMenu === 'all-orders' ? '' : this.activeMenu === 'open-orders' ? 'Open Orders' : 'Closed Orders';
  1485. this.tableLoading = true;
  1486. this.$axios.post('/uk-api/crmdata/order_lists', {
  1487. keyword: this.orderKeyword,
  1488. page: this.orderListQuery.page,
  1489. limit: this.orderListQuery.limit,
  1490. accounts_id,
  1491. Order_Stage: this.selword,
  1492. type
  1493. }).then(res => {
  1494. if (res.code === 1) {
  1495. this.tableData = res.result.data;
  1496. this.orderTotal = res.result.total;
  1497. this.tableLoading = false;
  1498. }
  1499. if (false) {}
  1500. }).catch(() => {});
  1501. },
  1502. goOrderDetail(row) {
  1503. const routeUrl = this.$router.resolve({
  1504. path: '/home/myDetail/orderDetail',
  1505. query: {
  1506. id: row.sales_orders_id,
  1507. crm: row.Account_Name_id
  1508. }
  1509. });
  1510. window.open(routeUrl.href, '_blank');
  1511. },
  1512. getEnquiryList() {
  1513. var _this$$store$state$us2;
  1514. this.tableLoading = true;
  1515. this.$axios.post('/uk-api/crmdata/enquiries_lists', {
  1516. keyword: this.enquiryKeyword,
  1517. page: this.enquiryListQuery.page,
  1518. limit: this.enquiryListQuery.limit,
  1519. accounts_id: ((_this$$store$state$us2 = this.$store.state.userInfo) === null || _this$$store$state$us2 === void 0 ? void 0 : _this$$store$state$us2.crm_accounts_id) || ''
  1520. }).then(res => {
  1521. if (res.code === 1) {
  1522. this.enquiryList = res.result.data;
  1523. this.enquiryTotal = res.result.total;
  1524. this.tableLoading = false;
  1525. }
  1526. if (false) {}
  1527. });
  1528. },
  1529. goEnquiryDetail(row) {
  1530. const routeUrl = this.$router.resolve({
  1531. path: '/home/myDetail/enquiryDetail',
  1532. query: {
  1533. id: row.enquiries_id
  1534. }
  1535. });
  1536. window.open(routeUrl.href, '_blank');
  1537. },
  1538. // 获取地址列表
  1539. // getAddressList() {
  1540. // this.$axios
  1541. // .get('/api/address/list', {
  1542. // params: {
  1543. // page: this.addressListQuery.page,
  1544. // limit: this.addressListQuery.limit,
  1545. // },
  1546. // })
  1547. // .then(res => {
  1548. // if (res.code === 1) {
  1549. // this.addressList = res.result.data
  1550. // this.addressTotal = res.result.total
  1551. // }
  1552. // if (process.client) {
  1553. // this.$nextTick(() => {
  1554. // window.scroll(0, 0)
  1555. // })
  1556. // }
  1557. // })
  1558. // .catch(() => {})
  1559. // },
  1560. // addAddress(num) {
  1561. // this.addressDetail = {}
  1562. // this.componentVisible = num
  1563. // this.dialogVisible = true
  1564. // },
  1565. // editAddress(num, id) {
  1566. // this.$axios
  1567. // .get('/api/address/detail/' + id)
  1568. // .then(res => {
  1569. // this.addressDetail = res.result
  1570. // this.addressDetail.is_default = res.result.is_default === 1
  1571. // this.componentVisible = num
  1572. // this.dialogVisible = true
  1573. // })
  1574. // .catch(() => {})
  1575. // },
  1576. // delAddress(id) {
  1577. // this.$axios.get('/api/address/delete/' + id).then(res => {
  1578. // this.$notify({
  1579. // title: 'success',
  1580. // message: 'Deleted successfully',
  1581. // type: 'success',
  1582. // duration: 3000,
  1583. // })
  1584. // this.getAddressList()
  1585. // })
  1586. // },
  1587. // setDefault(id) {
  1588. // this.$axios.get('/api/address/set_default/' + id).then(res => {
  1589. // this.$notify({
  1590. // title: 'success',
  1591. // message: 'Default address is set successfully',
  1592. // type: 'success',
  1593. // duration: 3000,
  1594. // })
  1595. // this.getAddressList()
  1596. // })
  1597. // },
  1598. // update() {
  1599. // this.getAddressList()
  1600. // },
  1601. resetPassword() {
  1602. if (this.accountPasswordForm.confirm_password !== this.accountPasswordForm.password) {
  1603. this.$message.error('The second password is inconsistent!');
  1604. } else {
  1605. this.$axios({
  1606. url: '/uk-api/uk/member/reset',
  1607. method: 'POST',
  1608. data: this.accountPasswordForm
  1609. }).then(res => {
  1610. if (res.code === 1) {
  1611. this.xxContentVisible = true;
  1612. this.xxContent = 'Password Reset Successful';
  1613. }
  1614. }).catch(() => {
  1615. // this.$message.error(error.response.data.msg);
  1616. });
  1617. }
  1618. },
  1619. openTracking_URL(url) {
  1620. this.Tracking_URL = url;
  1621. this.urlDialogShow = true;
  1622. },
  1623. handleNotification() {
  1624. this.$router.push('/');
  1625. this.$store.dispatch('logout');
  1626. this.openDialog();
  1627. },
  1628. ...Object(external_vuex_["mapMutations"])(['openDialog'])
  1629. }
  1630. });
  1631. // CONCATENATED MODULE: ./pages/home/myDetail/index.vue?vue&type=script&lang=js
  1632. /* harmony default export */ var home_myDetailvue_type_script_lang_js = (myDetailvue_type_script_lang_js);
  1633. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1634. var componentNormalizer = __webpack_require__(2);
  1635. // CONCATENATED MODULE: ./pages/home/myDetail/index.vue
  1636. function injectStyles (context) {
  1637. var style0 = __webpack_require__(316)
  1638. if (style0.__inject__) style0.__inject__(context)
  1639. var style1 = __webpack_require__(317)
  1640. if (style1.__inject__) style1.__inject__(context)
  1641. }
  1642. /* normalize component */
  1643. var component = Object(componentNormalizer["a" /* default */])(
  1644. home_myDetailvue_type_script_lang_js,
  1645. render,
  1646. staticRenderFns,
  1647. false,
  1648. injectStyles,
  1649. "799f5a64",
  1650. "4153663a"
  1651. )
  1652. /* harmony default export */ var myDetail = __webpack_exports__["default"] = (component.exports);
  1653. /* nuxt-component-imports */
  1654. installComponents(component, {ImageUpload: __webpack_require__(245).default,Pagination: __webpack_require__(182).default})
  1655. /***/ })
  1656. };;
  1657. //# sourceMappingURL=index.js.map