|
@@ -224,7 +224,11 @@ var _default = {
|
|
|
startDate: '',
|
|
|
endDate: '',
|
|
|
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ name: '',
|
|
|
+ card: '',
|
|
|
+ phone: ''
|
|
|
+ },
|
|
|
type: '身份证',
|
|
|
|
|
|
show: false,
|
|
@@ -242,10 +246,11 @@ var _default = {
|
|
|
errorMessage: '请填写手机号码'
|
|
|
}, {
|
|
|
validateFunction: function validateFunction(rule, value, data, callback) {
|
|
|
- var iphoneReg = /^(13[0-9]|14[1579]|15[0-3,5-9]|16[6]|17[0123456789]|18[0-9]|19[89])\d{8}$/;
|
|
|
+ var iphoneReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
|
|
if (!iphoneReg.test(value)) {
|
|
|
callback('手机号码格式不正确,请重新填写');
|
|
|
}
|
|
|
+ return true;
|
|
|
}
|
|
|
}]
|
|
|
},
|
|
@@ -257,7 +262,7 @@ var _default = {
|
|
|
validateFunction: function validateFunction(rule, value, data, callback) {
|
|
|
var iphoneReg = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9]||[Xx]$/;
|
|
|
if (!iphoneReg.test(value)) {
|
|
|
- callback('身份证号格式不正确,请重新填写');
|
|
|
+ callback('证件号格式不正确,请重新填写');
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -289,6 +294,10 @@ var _default = {
|
|
|
}
|
|
|
return onLoad;
|
|
|
}(),
|
|
|
+ onReady: function onReady() {
|
|
|
+
|
|
|
+ this.$refs.form.setRules(this.rules);
|
|
|
+ },
|
|
|
methods: {
|
|
|
|
|
|
change: function change(e) {
|
|
@@ -442,43 +451,34 @@ var _default = {
|
|
|
that.$set(that, "form", item);
|
|
|
that.$refs.popup.open();
|
|
|
},
|
|
|
-
|
|
|
- submit: function submit(ref) {
|
|
|
+
|
|
|
+ submit: function submit() {
|
|
|
var that = this;
|
|
|
- that.$refs[ref].validate().then( function () {
|
|
|
- var _ref = (0, _asyncToGenerator2.default)( _regenerator.default.mark(function _callee4(form) {
|
|
|
- var _iterator3, _step3, val;
|
|
|
- return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
|
- while (1) {
|
|
|
- switch (_context4.prev = _context4.next) {
|
|
|
- case 0:
|
|
|
-
|
|
|
- _iterator3 = _createForOfIteratorHelper(that.identityList);
|
|
|
- try {
|
|
|
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
|
- val = _step3.value;
|
|
|
- if (val.id == that.form.id) {
|
|
|
- form.id = that.form.id;
|
|
|
- val = form;
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- _iterator3.e(err);
|
|
|
- } finally {
|
|
|
- _iterator3.f();
|
|
|
- }
|
|
|
- that.toClose();
|
|
|
- case 3:
|
|
|
- case "end":
|
|
|
- return _context4.stop();
|
|
|
- }
|
|
|
+ that.$refs.form.validate().then(function (form) {
|
|
|
+
|
|
|
+ var _iterator3 = _createForOfIteratorHelper(that.identityList),
|
|
|
+ _step3;
|
|
|
+ try {
|
|
|
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
|
+ var val = _step3.value;
|
|
|
+ if (val.id == that.form.id) {
|
|
|
+ form.id = that.form.id;
|
|
|
+ val = form;
|
|
|
}
|
|
|
- }, _callee4);
|
|
|
- }));
|
|
|
- return function (_x2) {
|
|
|
- return _ref.apply(this, arguments);
|
|
|
- };
|
|
|
- }());
|
|
|
+ }
|
|
|
+ } catch (err) {
|
|
|
+ _iterator3.e(err);
|
|
|
+ } finally {
|
|
|
+ _iterator3.f();
|
|
|
+ }
|
|
|
+ that.toClose();
|
|
|
+ }).catch(function (err) {
|
|
|
+ uni.showToast({
|
|
|
+ title: err,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
toCoupon: function toCoupon() {
|
|
@@ -511,15 +511,15 @@ var _default = {
|
|
|
|
|
|
toOrder: function toOrder() {
|
|
|
var _this3 = this;
|
|
|
- return (0, _asyncToGenerator2.default)( _regenerator.default.mark(function _callee5() {
|
|
|
+ return (0, _asyncToGenerator2.default)( _regenerator.default.mark(function _callee4() {
|
|
|
var that, name, data, res;
|
|
|
- return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
|
+ return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
|
while (1) {
|
|
|
- switch (_context5.prev = _context5.next) {
|
|
|
+ switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
that = _this3;
|
|
|
if (that.date) {
|
|
|
- _context5.next = 4;
|
|
|
+ _context4.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
uni.showToast({
|
|
@@ -527,14 +527,14 @@ var _default = {
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
});
|
|
|
- return _context5.abrupt("return");
|
|
|
+ return _context4.abrupt("return");
|
|
|
case 4:
|
|
|
|
|
|
name = that.identityList.every(function (item) {
|
|
|
- return item.name;
|
|
|
+ return item.name && item.card && item.phone;
|
|
|
});
|
|
|
if (!name) {
|
|
|
- _context5.next = 13;
|
|
|
+ _context4.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
data = {
|
|
@@ -552,10 +552,10 @@ var _default = {
|
|
|
pay: [],
|
|
|
status: '1'
|
|
|
};
|
|
|
- _context5.next = 9;
|
|
|
+ _context4.next = 9;
|
|
|
return that.$api("/order", 'POST', data);
|
|
|
case 9:
|
|
|
- res = _context5.sent;
|
|
|
+ res = _context4.sent;
|
|
|
if (res.errcode == '0') {
|
|
|
uni.redirectTo({
|
|
|
url: "/pagesIndex/order/index?status=".concat('1')
|
|
@@ -566,7 +566,7 @@ var _default = {
|
|
|
icon: 'none'
|
|
|
});
|
|
|
}
|
|
|
- _context5.next = 15;
|
|
|
+ _context4.next = 15;
|
|
|
break;
|
|
|
case 13:
|
|
|
uni.showToast({
|
|
@@ -574,13 +574,13 @@ var _default = {
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
});
|
|
|
- return _context5.abrupt("return");
|
|
|
+ return _context4.abrupt("return");
|
|
|
case 15:
|
|
|
case "end":
|
|
|
- return _context5.stop();
|
|
|
+ return _context4.stop();
|
|
|
}
|
|
|
}
|
|
|
- }, _callee5);
|
|
|
+ }, _callee4);
|
|
|
}))();
|
|
|
}
|
|
|
}
|