@@ -464,7 +421,7 @@ export default {
if (value.charAt(0) == 0) {
// charAt查找第一个字符方法,用来判断输入的是座机还是手机号
regPone = tel
- }else if(value.charAt(0) == 4){
+ } else if (value.charAt(0) == 4) {
regPone = tels
} else {
regPone = mobile
@@ -476,38 +433,38 @@ export default {
}
}
- // const checkPhone= (rule, value, callback) =>{
- // const phoneExp = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/;
- // setTimeout(()=>{
- // if(value !== undefined && value !==''){
- // if ((!phoneExp.test(value)) && value !== '') {
- // callback(new Error('请输入正确的格式!'));
- // } else {
- // callback();
- // }
- // }else{
- // callback()
- // }
- // },100)
- // }
+ // const checkPhone= (rule, value, callback) =>{
+ // const phoneExp = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/;
+ // setTimeout(()=>{
+ // if(value !== undefined && value !==''){
+ // if ((!phoneExp.test(value)) && value !== '') {
+ // callback(new Error('请输入正确的格式!'));
+ // } else {
+ // callback();
+ // }
+ // }else{
+ // callback()
+ // }
+ // },100)
+ // }
-// var checkPhone = (rule, value, callback) => {
-// if (value === '') {
-// callback(new Error('请输入电话号码'))
-// }
-// if (value.length !== 11) {
-// callback(new Error('请输入正确电话号码'))
-// }
-// if (value.length !== 11) {
-// callback(new Error('请输入正确电话号码'))
-// }
-// // 验证电话号码手机号码,包含至今所有号段? ?
-// var ab = /^[1][3,4,5,7,8][0-9]{9}$/
-// if (ab.test(value) === false) {
-// callback(new Error('请输入正确电话号码'))
-// }
-// callback()
-// }
+ // var checkPhone = (rule, value, callback) => {
+ // if (value === '') {
+ // callback(new Error('请输入电话号码'))
+ // }
+ // if (value.length !== 11) {
+ // callback(new Error('请输入正确电话号码'))
+ // }
+ // if (value.length !== 11) {
+ // callback(new Error('请输入正确电话号码'))
+ // }
+ // // 验证电话号码手机号码,包含至今所有号段? ?
+ // var ab = /^[1][3,4,5,7,8][0-9]{9}$/
+ // if (ab.test(value) === false) {
+ // callback(new Error('请输入正确电话号码'))
+ // }
+ // callback()
+ // }
const validatePhone = (rule, value, callback) => {
if (!value) {
@@ -549,7 +506,8 @@ export default {
mer_take_day: [],
mer_take_location: '',
id: 0,
- mer_take_status: 0 }, // 默认数据
+ mer_take_status: 0
+ }, // 默认数据
myHeaders: { 'X-Token': getToken() },
uploadedQualifications: [], // 资质图片列表
mapKey: '', // 地图key
@@ -570,10 +528,9 @@ export default {
{ value: '2', name: '快递配送' }
],
rules: {
- mer_banner: [{ required: true, message: '请上传店铺banner' }],
mer_avatar: [{ required: true, message: '请上传店铺头像' }],
mer_info: [{ required: true, message: '请输入商户简介', trigger: 'blur' },
- { min: 3, max: 200, message: '长度在 3 到 200 个字符', trigger: 'blur' }
+ { min: 3, max: 200, message: '长度在 3 到 200 个字符', trigger: 'blur' }
],
mer_keyword: [{ required: false, message: '请输入商户关键字', trigger: 'blur' }],
mer_address: [{ required: true, message: '请输入商户地址', trigger: 'blur' }],
@@ -605,9 +562,9 @@ export default {
keyUrl: '',
infoType: '1',
tabList: [
- {value: '1',title: '基本信息'},
- {value: '2',title: '店铺信息'},
- {value: '3',title: '功能信息'}
+ { value: '1', title: '基本信息' },
+ { value: '2', title: '店铺信息' },
+ { value: '3', title: '功能信息' }
]
}
},
@@ -631,10 +588,10 @@ export default {
},
- mounted: function() {
+ mounted: function () {
window.addEventListener(
'message',
- function(event) {
+ function (event) {
// 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息
var loc = event.data
if (loc && loc.module === 'locationPicker') {
@@ -653,7 +610,7 @@ export default {
this.value1 = e;
this.merData.mer_take_time[0] = e
},
- onchangeTime2(e) {
+ onchangeTime2(e) {
this.value2 = e;
this.merData.mer_take_time[1] = e
},
@@ -694,9 +651,9 @@ export default {
that.marginPrice = info.is_margin
that.merData.margin = info.margin
that.merData.mer_take_location =
- info.mer_take_location && info.mer_take_location.length
- ? info.mer_take_location[0] + ',' + info.mer_take_location[1]
- : ''
+ info.mer_take_location && info.mer_take_location.length
+ ? info.mer_take_location[0] + ',' + info.mer_take_location[1]
+ : ''
that.merData.mer_take_status = info.mer_take_status || 0
that.merData.refundMarginOrder = info.refundMarginOrder
that.merData.marginStatus = info.ot_margin > info.margin
@@ -708,11 +665,11 @@ export default {
} else {
that.uploadedQualifications = []
}
- if(that.merData.is_margin == 1)(this.getCode())
+ if (that.merData.is_margin == 1) (this.getCode())
})
},
// 提交线下转账信息
- bankConfirm(name){
+ bankConfirm(name) {
this.$refs[name].validate(valid => {
if (valid) {
marginRefundApply(this.bankValidate)
@@ -732,7 +689,7 @@ export default {
},
// 提交/修改
submitForm(formName) {
- if(this.infoType == 2){
+ if (this.infoType == 2) {
this.$refs[formName].validate(valid => {
if (valid) {
const dataKey = Object.keys(this.rules)
@@ -765,12 +722,12 @@ export default {
return false
}
})
- }else{
+ } else {
let data = {
mer_state: this.merData.mer_state,
type: this.infoType
}
- merchantUpdate(data)
+ merchantUpdate(data)
.then((res) => {
console.log(res)
this.submitLoading = false
@@ -779,32 +736,32 @@ export default {
.catch((rej) => {
this.submitLoading = false
this.$message.error(rej.data.message)
- })
+ })
}
},
// 获取支付二维码
getCode() {
let that = this
- if(this.merData.marginStatus){
+ if (this.merData.marginStatus) {
marginMakeCode()
- .then((res) => {
- that.qrCode = res.data.config
- that.qrEndTime = res.data.endtime
- that.marginPrice = res.data.price
- })
- .catch(function(res) {
- that.$message.error(res.message)
- })
- }else{
+ .then((res) => {
+ that.qrCode = res.data.config
+ that.qrEndTime = res.data.endtime
+ that.marginPrice = res.data.price
+ })
+ .catch(function (res) {
+ that.$message.error(res.message)
+ })
+ } else {
marginCode()
- .then((res) => {
- that.qrCode = res.data.config
- that.qrEndTime = res.data.endtime
- that.marginPrice = res.data.price
- })
- .catch(function(res) {
- that.$message.error(res.message)
- })
+ .then((res) => {
+ that.qrCode = res.data.config
+ that.qrEndTime = res.data.endtime
+ that.marginPrice = res.data.price
+ })
+ .catch(function (res) {
+ that.$message.error(res.message)
+ })
}
},
// 查看保证金记录
@@ -814,7 +771,7 @@ export default {
this.getRecordList()
},
// 保证金记录列表
- getRecordList(){
+ getRecordList() {
let that = this
that.loading = true;
marginRecordLst(that.tableFrom).then(async (res) => {
@@ -843,26 +800,26 @@ export default {
type: 'warning'
}).then(() => {
marginRefund()
- .then((res) => {
- that.bankValidate = res.data.info
- that.offline = res.data.offline
- that.online = res.data.online
- if(Number(res.data.offline) <= 0){
- marginRefundApply(this.bankValidate)
- .then((res) => {
- this.$message.success(res.message)
- this.getInfo()
- })
- .catch((res) => {
- this.$message.error(res.message)
- })
- }else{
- that.modalBank = true
- }
- })
- .catch(function(res) {
- that.$message.error(res.message)
- })
+ .then((res) => {
+ that.bankValidate = res.data.info
+ that.offline = res.data.offline
+ that.online = res.data.online
+ if (Number(res.data.offline) <= 0) {
+ marginRefundApply(this.bankValidate)
+ .then((res) => {
+ this.$message.success(res.message)
+ this.getInfo()
+ })
+ .catch((res) => {
+ this.$message.error(res.message)
+ })
+ } else {
+ that.modalBank = true
+ }
+ })
+ .catch(function (res) {
+ that.$message.error(res.message)
+ })
})
},
// 查找位置
@@ -878,7 +835,7 @@ export default {
console.log(res)
this.mapKey = res.data.tx_map_key
})
- .catch(function(res) {
+ .catch(function (res) {
that.$message.error(res.message)
})
},
@@ -928,26 +885,30 @@ export default {