| | |
| | | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } |
| | | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } |
| | | var _default = { |
| | | computed: _objectSpread({}, (0, _vuex.mapState)(['userInfo'])), |
| | | computed: _objectSpread(_objectSpread({}, (0, _vuex.mapState)(['userInfo'])), {}, { |
| | | fullAreaName: function fullAreaName() { |
| | | var arr = [this.form.provinceName, this.form.cityName, this.form.areaName].filter(Boolean); |
| | | return arr.join('/'); |
| | | } |
| | | }), |
| | | data: function data() { |
| | | return { |
| | | form: { |
| | | telephone: '', |
| | | companyType: 0, |
| | | name: '', |
| | | provinceName: '', |
| | | cityName: '', |
| | | areaName: '', |
| | | areaId: '', |
| | | longitude: '', |
| | | latitude: '', |
| | |
| | | legalPersonName: '', |
| | | legalPersonPhone: '', |
| | | aliAccount: '', |
| | | aliName: '', |
| | | businessImg: '' |
| | | }, |
| | | previewMode: 'filled', |
| | | imgPrefix: '', |
| | | currentStep: 1, |
| | | qualificationType: 'company', |
| | | showAreaPicker: false, |
| | |
| | | switch (_context.prev = _context.next) { |
| | | case 0: |
| | | if (!(_this.form.companyType === 0)) { |
| | | _context.next = 15; |
| | | _context.next = 21; |
| | | break; |
| | | } |
| | | if (_this.form.idcardImg) { |
| | |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 7: |
| | | if (!(!_this.form.laborContractImgs || _this.form.laborContractImgs.length === 0)) { |
| | | if (_this.form.aliAccount) { |
| | | _context.next = 10; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: '请输入个人支付宝账号', |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 10: |
| | | if (_this.form.aliName) { |
| | | _context.next = 13; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: '请输入支付宝姓名', |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 13: |
| | | if (!(!_this.form.laborContractImgs || _this.form.laborContractImgs.length === 0)) { |
| | | _context.next = 16; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 10: |
| | | case 16: |
| | | if (!(!_this.form.socialSecurityImgs || _this.form.socialSecurityImgs.length === 0)) { |
| | | _context.next = 13; |
| | | _context.next = 19; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 13: |
| | | _context.next = 30; |
| | | case 19: |
| | | _context.next = 39; |
| | | break; |
| | | case 15: |
| | | case 21: |
| | | if (_this.form.legalPersonName) { |
| | | _context.next = 18; |
| | | _context.next = 24; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 18: |
| | | case 24: |
| | | if (_this.form.aliAccount) { |
| | | _context.next = 21; |
| | | _context.next = 27; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 21: |
| | | case 27: |
| | | if (_this.form.aliName) { |
| | | _context.next = 30; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: '请输入支付宝姓名', |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 30: |
| | | if (_this.form.legalPersonCard) { |
| | | _context.next = 24; |
| | | _context.next = 33; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 24: |
| | | case 33: |
| | | if (_this.form.legalPersonCardBack) { |
| | | _context.next = 27; |
| | | _context.next = 36; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 27: |
| | | case 36: |
| | | if (_this.form.businessImg) { |
| | | _context.next = 30; |
| | | _context.next = 39; |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | |
| | | icon: 'none' |
| | | }); |
| | | return _context.abrupt("return"); |
| | | case 30: |
| | | case 39: |
| | | uni.showLoading({ |
| | | title: '提交中...', |
| | | mask: true |
| | | }); |
| | | _context.prev = 31; |
| | | _context.next = 34; |
| | | _context.prev = 40; |
| | | _context.next = 43; |
| | | return _this.$u.api.applyShop(_this.form); |
| | | case 34: |
| | | case 43: |
| | | res = _context.sent; |
| | | uni.hideLoading(); |
| | | if (res.code === 200) { |
| | |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | _context.next = 43; |
| | | _context.next = 52; |
| | | break; |
| | | case 39: |
| | | _context.prev = 39; |
| | | _context.t0 = _context["catch"](31); |
| | | case 48: |
| | | _context.prev = 48; |
| | | _context.t0 = _context["catch"](40); |
| | | uni.hideLoading(); |
| | | uni.showToast({ |
| | | title: '提交失败', |
| | | icon: 'none' |
| | | }); |
| | | case 43: |
| | | case 52: |
| | | case "end": |
| | | return _context.stop(); |
| | | } |
| | | } |
| | | }, _callee, null, [[31, 39]]); |
| | | }, _callee, null, [[40, 48]]); |
| | | }))(); |
| | | }, |
| | | getMyShopData: function getMyShopData() { |
| | | var _this2 = this; |
| | | return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { |
| | | var res, data, imgPrefix, storeFrontImgs, storeInteriorImgs, otherMaterialImgs, laborContractImgs, socialSecurityImgs; |
| | | var res, data, imgPrefix; |
| | | return _regenerator.default.wrap(function _callee2$(_context2) { |
| | | while (1) { |
| | | switch (_context2.prev = _context2.next) { |
| | |
| | | if (res.code === 200 && res.data) { |
| | | data = res.data; |
| | | imgPrefix = data.imgPrefix || ''; |
| | | _this2.imgPrefix = data.imgPrefix || ''; |
| | | _this2.form.name = data.name || ''; |
| | | _this2.form.areaId = data.areaId || ''; |
| | | _this2.form.provinceName = data.provinceName || ''; |
| | | _this2.form.cityName = data.cityName || ''; |
| | | _this2.form.areaName = data.areaName || ''; |
| | | _this2.form.areaId = data.areaId || ''; |
| | | _this2.form.address = data.address || ''; |
| | | _this2.form.longitude = data.longitude || ''; |
| | | _this2.form.latitude = data.latitude || ''; |
| | |
| | | _this2.form.linkPhone = data.linkPhone || ''; |
| | | _this2.form.idcard = data.idcard || ''; |
| | | _this2.form.aliAccount = data.aliAccount || ''; |
| | | _this2.form.aliName = data.aliName || ''; |
| | | _this2.form.companyType = data.companyType || 0; |
| | | _this2.form.telephone = data.telephone || _this2.userInfo.telephone || ''; |
| | | _this2.form.legalPersonName = data.legalPersonName || ''; |
| | | _this2.form.legalPersonPhone = data.legalPersonPhone || ''; |
| | | _this2.qualificationType = data.companyType === 0 ? 'personal' : 'company'; |
| | | if (data.storeFrontImgs) { |
| | | storeFrontImgs = data.storeFrontImgs; |
| | | if (typeof storeFrontImgs === 'string') { |
| | | storeFrontImgs = storeFrontImgs.split(','); |
| | | } |
| | | _this2.storeFrontImages = storeFrontImgs; |
| | | _this2.uploadedImagesStoreFront = storeFrontImgs.map(function (url) { |
| | | _this2.storeFrontImages = data.storeFrontImgUrls; |
| | | _this2.uploadedImagesStoreFront = data.storeFrontImgUrls.map(function (url) { |
| | | return { |
| | | url: imgPrefix + url |
| | | url: url |
| | | }; |
| | | }); |
| | | _this2.form.storeFrontImgs = storeFrontImgs; |
| | | _this2.form.storeFrontImgs = data.storeFrontImgs; |
| | | } |
| | | if (data.storeInteriorImgs) { |
| | | storeInteriorImgs = data.storeInteriorImgs; |
| | | if (typeof storeInteriorImgs === 'string') { |
| | | storeInteriorImgs = storeInteriorImgs.split(','); |
| | | } |
| | | _this2.idCardImages = storeInteriorImgs; |
| | | _this2.uploadedImagesIdCard = storeInteriorImgs.map(function (url) { |
| | | _this2.idCardImages = data.storeInteriorImgUrls; |
| | | _this2.uploadedImagesIdCard = data.storeInteriorImgUrls.map(function (url) { |
| | | return { |
| | | url: imgPrefix + url |
| | | url: url |
| | | }; |
| | | }); |
| | | _this2.form.storeInteriorImgs = storeInteriorImgs; |
| | | _this2.form.storeInteriorImgs = data.storeInteriorImgs; |
| | | } |
| | | if (data.otherMaterialImgs) { |
| | | otherMaterialImgs = data.otherMaterialImgs; |
| | | if (typeof otherMaterialImgs === 'string') { |
| | | otherMaterialImgs = otherMaterialImgs.split(','); |
| | | } |
| | | _this2.permitImages = otherMaterialImgs; |
| | | _this2.uploadedImagesPermit = otherMaterialImgs.map(function (url) { |
| | | _this2.permitImages = data.otherMaterialImgUrls; |
| | | _this2.uploadedImagesPermit = data.otherMaterialImgUrls.map(function (url) { |
| | | return { |
| | | url: imgPrefix + url |
| | | url: url |
| | | }; |
| | | }); |
| | | _this2.form.otherMaterialImgs = otherMaterialImgs; |
| | | _this2.form.otherMaterialImgs = data.otherMaterialImgs; |
| | | } |
| | | _this2.form.idcardImg = data.idcardImg ? imgPrefix + data.idcardImg : ''; |
| | | _this2.form.idcardImgBack = data.idcardImgBack ? imgPrefix + data.idcardImgBack : ''; |
| | | _this2.form.idcardImg = data.idcardImg || ''; |
| | | _this2.form.idcardImgBack = data.idcardImgBack || ''; |
| | | if (data.laborContractImgs) { |
| | | laborContractImgs = data.laborContractImgs; |
| | | if (typeof laborContractImgs === 'string') { |
| | | laborContractImgs = laborContractImgs.split(','); |
| | | } |
| | | _this2.laborContractImages = laborContractImgs; |
| | | _this2.uploadedLaborContractImages = laborContractImgs.map(function (url) { |
| | | _this2.laborContractImages = data.laborContractImgUrls; |
| | | _this2.uploadedLaborContractImages = data.laborContractImgUrls.map(function (url) { |
| | | return { |
| | | url: imgPrefix + url |
| | | url: url |
| | | }; |
| | | }); |
| | | _this2.form.laborContractImgs = laborContractImgs; |
| | | _this2.form.laborContractImgs = data.laborContractImgs; |
| | | } |
| | | if (data.socialSecurityImgs) { |
| | | socialSecurityImgs = data.socialSecurityImgs; |
| | | if (typeof socialSecurityImgs === 'string') { |
| | | socialSecurityImgs = socialSecurityImgs.split(','); |
| | | } |
| | | _this2.socialSecurityImages = socialSecurityImgs; |
| | | _this2.uploadedSocialSecurityImages = socialSecurityImgs.map(function (url) { |
| | | _this2.socialSecurityImages = data.socialSecurityImgUrls; |
| | | _this2.uploadedSocialSecurityImages = data.socialSecurityImgUrls.map(function (url) { |
| | | return { |
| | | url: imgPrefix + url |
| | | url: url |
| | | }; |
| | | }); |
| | | _this2.form.socialSecurityImgs = socialSecurityImgs; |
| | | _this2.form.socialSecurityImgs = data.socialSecurityImgs; |
| | | } |
| | | _this2.form.legalPersonCard = data.legalPersonCard ? imgPrefix + data.legalPersonCard : ''; |
| | | _this2.form.legalPersonCardBack = data.legalPersonCardBack ? imgPrefix + data.legalPersonCardBack : ''; |
| | | _this2.form.businessImg = data.businessImg ? imgPrefix + data.businessImg : ''; |
| | | _this2.form.legalPersonCard = data.legalPersonCard || ''; |
| | | _this2.form.legalPersonCardBack = data.legalPersonCardBack || ''; |
| | | _this2.form.businessImg = data.businessImg || ''; |
| | | if (data.businessImg) { |
| | | _this2.businessImages = [data.businessImg]; |
| | | _this2.businessImages = [data.businessImgUrl]; |
| | | } |
| | | } |
| | | _context2.next = 10; |
| | |
| | | }, |
| | | getShortPath: function getShortPath(url) { |
| | | if (!url) return ''; |
| | | var baseUrl = this.$baseUrl || ''; |
| | | if (url.startsWith('http')) { |
| | | return url; |
| | | return url.replace(this.imgPrefix, ''); |
| | | } |
| | | return url.replace(baseUrl, ''); |
| | | return url; |
| | | }, |
| | | getFullPath: function getFullPath(url) { |
| | | if (!url) return ''; |