|
|
@@ -151,6 +151,7 @@ export default {
|
|
|
street: "",
|
|
|
},
|
|
|
userAddress: "",
|
|
|
+ submitType: 0, //0新增 1修改
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -159,14 +160,26 @@ export default {
|
|
|
this.$refs.form.validate().then((res) => {
|
|
|
let da = Object.assign({},this.formData);
|
|
|
da.discount = this.$h.Div(da.discount, 100);
|
|
|
- post("v1/merchant/apply",da).then(res=>{
|
|
|
- if (res.code == 0) {
|
|
|
- that.$toast("提交成功,请关注审核状态")
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack({ delta: 1 })
|
|
|
- }, 1500);
|
|
|
- }
|
|
|
- })
|
|
|
+ if(this.submitType == 1){
|
|
|
+ post("v1/merchant/edit",{ ...res,shop_id: this.formData.id }).then(res=>{
|
|
|
+ if (res.code == 0) {
|
|
|
+ that.$toast("修改成功,请关注审核状态")
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack({ delta: 1 })
|
|
|
+ }, 1500);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ post("v1/merchant/apply",da).then(res=>{
|
|
|
+ if (res.code == 0) {
|
|
|
+ that.$toast("提交成功,请关注审核状态")
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack({ delta: 1 })
|
|
|
+ }, 1500);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.log("表单错误信息:", err);
|
|
|
@@ -202,6 +215,14 @@ export default {
|
|
|
this.$refs.form.setRules(this.rules);
|
|
|
},
|
|
|
onLoad(da) {
|
|
|
+ if (da && da.id) {
|
|
|
+ this.submitType = 1
|
|
|
+ post("v1/merchant/shopInfo", { shop_id: da.id }).then((res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.formData = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
this.getLocation()
|
|
|
this.getTypeDesc()
|
|
|
},
|