wangfukang 3 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) return putRequest('/app/shop/edit', params)
} }
export const changeShopOwnerByMobile = (params) => {
return postRequest('/app/shop/changeOwnerByMobile', params)
}
export const bindShopPrinter = (params) => { export const bindShopPrinter = (params) => {
return postRequest('/app/shop/bindPrinter', 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"> <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"> <Row :gutter="32">
<Col span="8"> <Col span="8">
<FormItem label="拼团平台抽佣(%)" prop="commissionRateMore"> <FormItem label="拼团平台抽佣(%)" prop="commissionRateMore">
@ -103,7 +116,8 @@
import { import {
addShopTakeway, addShopTakeway,
editShopTakeway, editShopTakeway,
getByShopId getByShopId,
changeShopOwnerByMobile
} from "@/api/app"; } from "@/api/app";
export default { export default {
name: "mernage", name: "mernage",
@ -138,6 +152,8 @@
submitLoading: false, submitLoading: false,
maxHeight: 510, maxHeight: 510,
form: {}, form: {},
changeOwnerMobile: "",
changeOwnerLoading: false,
takeData: {}, takeData: {},
isAdd: true, isAdd: true,
shopType: [], shopType: [],
@ -201,6 +217,7 @@
if (!data || !data.id) { if (!data || !data.id) {
return; return;
} }
this.changeOwnerMobile = "";
this.getRoleList(); this.getRoleList();
getByShopId({ getByShopId({
"shopId": data.id "shopId": data.id
@ -310,6 +327,43 @@
} }
return periods; 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() { getRoleList() {
getUsersByRoleName("ROLE_OWNER").then((res) => { getUsersByRoleName("ROLE_OWNER").then((res) => {
if (res.success) { if (res.success) {

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

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

Loading…
Cancel
Save