addressManage.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/address/addressManage" ], {
  2. 217: function(e, n, t) {
  3. (function(e) {
  4. function n(e) {
  5. return e && e.__esModule ? e : {
  6. default: e
  7. };
  8. }
  9. t(4), n(t(2)), e(n(t(218)).default);
  10. }).call(this, t(1).createPage);
  11. },
  12. 218: function(e, n, t) {
  13. t.r(n);
  14. var i = t(219), o = t(221);
  15. for (var a in o) "default" !== a && function(e) {
  16. t.d(n, e, function() {
  17. return o[e];
  18. });
  19. }(a);
  20. t(223);
  21. var s = t(13), r = Object(s.default)(o.default, i.render, i.staticRenderFns, !1, null, null, null, !1, i.components, void 0);
  22. r.options.__file = "pages/address/addressManage.vue", n.default = r.exports;
  23. },
  24. 219: function(e, n, t) {
  25. t.r(n);
  26. var i = t(220);
  27. t.d(n, "render", function() {
  28. return i.render;
  29. }), t.d(n, "staticRenderFns", function() {
  30. return i.staticRenderFns;
  31. }), t.d(n, "recyclableRender", function() {
  32. return i.recyclableRender;
  33. }), t.d(n, "components", function() {
  34. return i.components;
  35. });
  36. },
  37. 220: function(e, n, t) {
  38. var i;
  39. t.r(n), t.d(n, "render", function() {
  40. return o;
  41. }), t.d(n, "staticRenderFns", function() {
  42. return s;
  43. }), t.d(n, "recyclableRender", function() {
  44. return a;
  45. }), t.d(n, "components", function() {
  46. return i;
  47. });
  48. try {
  49. i = {
  50. uniList: function() {
  51. return t.e("components/uni-list/uni-list").then(t.bind(null, 483));
  52. },
  53. uniListItem: function() {
  54. return t.e("components/uni-list-item/uni-list-item").then(t.bind(null, 490));
  55. }
  56. };
  57. } catch (e) {
  58. if (-1 === e.message.indexOf("Cannot find module") || -1 === e.message.indexOf(".vue")) throw e;
  59. console.error(e.message), console.error("1. 排查组件名称拼写是否正确"), console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),
  60. console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件");
  61. }
  62. var o = function() {
  63. var e = this;
  64. e.$createElement;
  65. e._self._c, e._isMounted || (e.e0 = function(n) {
  66. !e.loading && e.confirm();
  67. });
  68. }, a = !1, s = [];
  69. o._withStripped = !0;
  70. },
  71. 221: function(e, n, t) {
  72. t.r(n);
  73. var i = t(222), o = t.n(i);
  74. for (var a in i) "default" !== a && function(e) {
  75. t.d(n, e, function() {
  76. return i[e];
  77. });
  78. }(a);
  79. n.default = o.a;
  80. },
  81. 222: function(e, n, t) {
  82. (function(e) {
  83. Object.defineProperty(n, "__esModule", {
  84. value: !0
  85. }), n.default = void 0;
  86. var i = t(206), o = {
  87. components: {
  88. uniList: function() {
  89. t.e("components/uni-list/uni-list").then(function() {
  90. return resolve(t(483));
  91. }.bind(null, t)).catch(t.oe);
  92. },
  93. uniListItem: function() {
  94. t.e("components/uni-list-item/uni-list-item").then(function() {
  95. return resolve(t(490));
  96. }.bind(null, t)).catch(t.oe);
  97. },
  98. pickerAddress: function() {
  99. Promise.all([ t.e("common/vendor"), t.e("components/wangding-pickerAddress/wangding-pickerAddress") ]).then(function() {
  100. return resolve(t(528));
  101. }.bind(null, t)).catch(t.oe);
  102. },
  103. uniPopup: function() {
  104. Promise.all([ t.e("common/vendor"), t.e("components/uni-popup/uni-popup") ]).then(function() {
  105. return resolve(t(519));
  106. }.bind(null, t)).catch(t.oe);
  107. }
  108. },
  109. data: function() {
  110. return {
  111. addressDetail: "",
  112. addressData: {
  113. name: "",
  114. mobile: "",
  115. address: {
  116. province: "",
  117. city: "",
  118. district: ""
  119. },
  120. area: "",
  121. default: !1
  122. },
  123. loading: !1
  124. };
  125. },
  126. onLoad: function(n) {
  127. var t = "新增收货地址";
  128. if ("edit" === n.type) {
  129. t = "编辑收货地址";
  130. var i = JSON.parse(n.data);
  131. console.log(i), this.addressData = {
  132. name: i.real_name,
  133. mobile: i.phone,
  134. address: {
  135. province: i.province,
  136. city: i.city,
  137. district: i.district
  138. },
  139. area: i.detail,
  140. default: 1 == i.is_default,
  141. id: i.id
  142. }, this.addressDetail = i.province + i.city + i.district;
  143. }
  144. this.manageType = n.type, e.setNavigationBarTitle({
  145. title: t
  146. });
  147. },
  148. methods: {
  149. onCityClick: function(e) {
  150. var n = e.data, t = this.addressData.address;
  151. t.province = n[0], t.city = n[1], t.district = n[2], this.addressDetail = n.join("");
  152. },
  153. chooseLocation: function() {
  154. var n = this;
  155. e.chooseLocation({
  156. success: function(e) {
  157. console.log(e), n.addressData.addressName = e.name, n.addressData.address = e.name;
  158. }
  159. });
  160. },
  161. switchChange: function(e) {
  162. this.addressData.default = e.value;
  163. },
  164. confirm: function() {
  165. var n = this;
  166. console.log("1");
  167. var t = this, o = this.addressData;
  168. o.name ? /(^1[3|4|5|7|8][0-9]{9}$)/.test(o.mobile) ? o.address ? o.area ? (this.loading = !0,
  169. (0, i.addressEdit)({
  170. real_name: o.name,
  171. phone: o.mobile,
  172. address: {
  173. province: o.address.province,
  174. city: o.address.city,
  175. district: o.address.district
  176. },
  177. detail: o.area,
  178. is_default: o.default,
  179. id: o.id || "",
  180. type: 1
  181. }).then(function(n) {
  182. t.$api.prePage().refreshList(), e.showToast({
  183. title: "提交成功",
  184. duration: 2e3
  185. }), setTimeout(function() {
  186. this.loading = !1, e.navigateBack();
  187. }, 800);
  188. }).catch(function(e) {
  189. console.log(e), n.loading = !1;
  190. })) : this.$api.msg("请填写门牌号信息") : this.$api.msg("请在地图选择所在位置") : this.$api.msg("请输入正确的手机号码") : this.$api.msg("请填写收货人姓名");
  191. }
  192. }
  193. };
  194. n.default = o;
  195. }).call(this, t(1).default);
  196. },
  197. 223: function(e, n, t) {
  198. t.r(n);
  199. var i = t(224), o = t.n(i);
  200. for (var a in i) "default" !== a && function(e) {
  201. t.d(n, e, function() {
  202. return i[e];
  203. });
  204. }(a);
  205. n.default = o.a;
  206. },
  207. 224: function(e, n, t) {}
  208. }, [ [ 217, "common/runtime", "common/vendor" ] ] ]);