wangfukang 2 weeks ago
parent
commit
b84208973a
  1. 4
      src/api/app.js
  2. 56
      src/views/app/shop/mernage.vue
  3. 40
      src/views/app/shopArea/shopArea.vue

4
src/api/app.js

@ -479,6 +479,10 @@ export const editShop = (params) => {
return putRequest('/app/shop/edit', params)
}
export const changeShopOwnerByMobile = (params) => {
return postRequest('/app/shop/changeOwnerByMobile', params)
}
export const bindShopPrinter = (params) => {
return postRequest('/app/shop/bindPrinter', params)
}

56
src/views/app/shop/mernage.vue

@ -6,6 +6,19 @@
<Form ref="form" :model="form" :rules="formValidate" label-position="top">
<Row :gutter="16" v-show="type != '0'">
<Col span="16">
<FormItem label="换绑商家账号手机号">
<Input v-model="changeOwnerMobile" placeholder="输入商家登录小程序绑定的手机号" :maxlength="11" />
</FormItem>
</Col>
<Col span="8">
<FormItem label=" ">
<Button type="warning" long :loading="changeOwnerLoading" @click="changeMerchantAccount">换绑账号</Button>
</FormItem>
</Col>
</Row>
<Divider v-show="type != '0'" />
<Row :gutter="32">
<Col span="8">
<FormItem label="拼团平台抽佣(%)" prop="commissionRateMore">
@ -103,7 +116,8 @@
import {
addShopTakeway,
editShopTakeway,
getByShopId
getByShopId,
changeShopOwnerByMobile
} from "@/api/app";
export default {
name: "mernage",
@ -138,6 +152,8 @@
submitLoading: false,
maxHeight: 510,
form: {},
changeOwnerMobile: "",
changeOwnerLoading: false,
takeData: {},
isAdd: true,
shopType: [],
@ -201,6 +217,7 @@
if (!data || !data.id) {
return;
}
this.changeOwnerMobile = "";
this.getRoleList();
getByShopId({
"shopId": data.id
@ -310,6 +327,43 @@
}
return periods;
},
changeMerchantAccount() {
const mobile = (this.changeOwnerMobile || "").trim();
const shopId = this.data && this.data.id ? this.data.id : (this.form.shopId || this.form.id);
const shopName = this.data && this.data.shopName ? this.data.shopName : this.form.shopName;
if (!shopId) {
this.$Message.warning("店铺id不能为空");
return;
}
if (!/^1\d{10}$/.test(mobile)) {
this.$Message.warning("请输入正确的手机号");
return;
}
this.$Modal.confirm({
title: "确认换绑",
content: "确认将店铺 " + (shopName || "") + " 换绑到手机号 " + mobile + " 对应的用户吗?",
loading: true,
onOk: () => {
this.changeOwnerLoading = true;
changeShopOwnerByMobile({
shopId,
mobile
}).then((res) => {
this.changeOwnerLoading = false;
this.$Modal.remove();
if (res.success) {
this.$Message.success("换绑成功");
this.changeOwnerMobile = "";
this.form.contactPhone = mobile;
this.$emit("on-submit", true);
}
}).catch(() => {
this.changeOwnerLoading = false;
this.$Modal.remove();
});
},
});
},
getRoleList() {
getUsersByRoleName("ROLE_OWNER").then((res) => {
if (res.success) {

40
src/views/app/shopArea/shopArea.vue

@ -184,6 +184,18 @@
</i-switch>
<div class="geo-tip">关闭后社会区域首页和底部栏不展示快递/跑腿入口</div>
</FormItem>
<FormItem v-if="showEditParentAgent" label="跑腿星球">
<i-switch
size="large"
v-model="form.errandPlanetVisible"
:true-value="1"
:false-value="0"
>
<span slot="open">显示</span>
<span slot="close">隐藏</span>
</i-switch>
<div class="geo-tip">关闭后用户端首页不展示跑腿星球入口</div>
</FormItem>
<FormItem v-if="showEditParentAgent" label="匹配范围">
<Map
id="shopAreaEditMap"
@ -336,6 +348,18 @@
</i-switch>
<div class="geo-tip">关闭后社会区域首页和底部栏不展示快递/跑腿入口</div>
</FormItem>
<FormItem v-if="showAddParentAgent" label="跑腿星球">
<i-switch
size="large"
v-model="formAdd.errandPlanetVisible"
:true-value="1"
:false-value="0"
>
<span slot="open">显示</span>
<span slot="close">隐藏</span>
</i-switch>
<div class="geo-tip">关闭后用户端首页不展示跑腿星球入口</div>
</FormItem>
<FormItem v-if="showAddParentAgent" label="匹配范围">
<Map
id="shopAreaAddMap"
@ -507,6 +531,7 @@ export default {
commissionRatio: 0,
areaKind: 1,
expressErrandEnabled: 1,
errandPlanetVisible: 1,
centerLng: null,
centerLat: null,
radiusMeters: "",
@ -789,6 +814,7 @@ export default {
this.clearGeoValue(target);
this.$set(target, "areaKind", 1);
this.$set(target, "expressErrandEnabled", 1);
this.$set(target, "errandPlanetVisible", 1);
} else {
if (
target.commissionRatio === "" ||
@ -806,6 +832,11 @@ export default {
"expressErrandEnabled",
areaKind === 2 && Number(target.expressErrandEnabled) === 0 ? 0 : 1
);
this.$set(
target,
"errandPlanetVisible",
Number(target.errandPlanetVisible) === 0 ? 0 : 1
);
}
},
syncGeoFromEntity(target) {
@ -946,6 +977,11 @@ export default {
"expressErrandEnabled",
areaKind === 2 && Number(this.form.expressErrandEnabled) === 0 ? 0 : 1
);
this.$set(
this.form,
"errandPlanetVisible",
Number(this.form.errandPlanetVisible) === 0 ? 0 : 1
);
this.syncGeoFromEntity(this.form);
} else {
this.cancelEdit();
@ -970,6 +1006,7 @@ export default {
commissionRatio: 0,
areaKind: 1,
expressErrandEnabled: 1,
errandPlanetVisible: 1,
centerLng: null,
centerLat: null,
radiusMeters: "",
@ -1079,6 +1116,7 @@ export default {
parentAgentId: "",
parentAgentName: "",
expressErrandEnabled: 1,
errandPlanetVisible: 1,
};
this.modalVisible = true;
return;
@ -1100,6 +1138,7 @@ export default {
parentAgentId: "",
parentAgentName: "",
expressErrandEnabled: 1,
errandPlanetVisible: 1,
};
this.modalVisible = true;
},
@ -1120,6 +1159,7 @@ export default {
commissionRatio: 0,
areaKind: 1,
expressErrandEnabled: 1,
errandPlanetVisible: 1,
centerLng: null,
centerLat: null,
radiusMeters: "",

Loading…
Cancel
Save