# Conflicts:
#	manager/src/config/index.js
#	seller/src/config/index.js
master
mabo 2021-06-28 11:25:30 +08:00
commit 10fc7d4dd0
15 changed files with 595 additions and 301 deletions

View File

@ -188,10 +188,10 @@ export default {
}, },
formValidate: { formValidate: {
price: [ price: [
{ required: true, message: '请输入大于0小于9999的合法充值金额' }, { required: true, message: '请输入大于等于1小于9999的合法充值金额' },
{ {
pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/, pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/,
message: '请输入大于0小于9999的合法充值金额', message: '请输入大于等于1小于9999的合法充值金额',
trigger: 'change' trigger: 'change'
} }
] ]
@ -200,11 +200,13 @@ export default {
logColumns: [ logColumns: [
{ {
title: '时间', title: '时间',
width: 190,
key: 'createTime' key: 'createTime'
}, },
{ {
title: '金额', title: '金额',
key: 'money', key: 'money',
width: 180,
render: (h, params) => { render: (h, params) => {
if (params.row.money > 0) { if (params.row.money > 0) {
return h('div', [ return h('div', [
@ -241,20 +243,29 @@ export default {
logColumnsData: {}, // logColumnsData: {}, //
// //
rechargeListColumns: [ rechargeListColumns: [
{
title: '充值时间',
key: 'createTime',
width: 168
},
{ {
title: '支付单号', title: '支付单号',
key: 'rechargeSn', key: 'rechargeSn',
width: 200 width: 200
}, },
{
title: '支付方式',
key: 'rechargeWay'
},
{ {
title: '充值金额', title: '充值金额',
key: 'rechargeMoney', key: 'rechargeMoney',
render: (h, params) => { render: (h, params) => {
return h('div', [h('span', this.$options.filters.unitPrice(params.row.rechargeMoney, '¥'))]); if (params.row.payStatus === 'PAID') {
return h('div', [h('span', {
style: {
color: 'green'
}
}, this.$options.filters.unitPrice(params.row.rechargeMoney, '+ ¥'))]);
} else {
return h('div', [h('span', this.$options.filters.unitPrice(params.row.rechargeMoney, '¥'))]);
}
} }
}, },
{ {
@ -268,29 +279,60 @@ export default {
} }
} }
}, },
{
title: '支付方式',
key: 'rechargeWay',
render: (h, params) => {
if (params.row.rechargeWay === 'ALIPAY') {
return h('div', [h('span', {}, '支付宝')]);
} else if (params.row.rechargeWay === 'WECHAT') {
return h('div', [h('span', {}, '微信')]);
} else if (params.row.rechargeWay === 'BANK_TRANSFER') {
return h('div', [h('span', {}, '线下转账')]);
} else {
return h('div', [h('span', {}, '')]);
}
}
},
{ {
title: '支付时间', title: '支付时间',
key: 'payTime' key: 'payTime',
width: 180
} }
], ],
rechargeListData: {}, // rechargeListData: {}, //
// //
withdrawApplyColumns: [ withdrawApplyColumns: [
{
title: '申请时间',
key: 'createTime',
width: 168
},
{ {
title: '提现单号', title: '提现单号',
key: 'sn', key: 'sn',
width: 215 width: 200
}, },
{ {
title: '提现金额', title: '提现金额',
key: 'applyMoney', key: 'applyMoney',
width: 110,
render: (h, params) => { render: (h, params) => {
return h('div', [h('span', this.$options.filters.unitPrice(params.row.applyMoney, '¥'))]); if (params.row.applyStatus === 'VIA_AUDITING') {
return h('div', [h('span', {
style: {
color: 'green'
}
}, this.$options.filters.unitPrice(params.row.applyMoney, '+ ¥'))]);
} else {
return h('div', [h('span', this.$options.filters.unitPrice(params.row.applyMoney, '¥'))]);
}
} }
}, },
{ {
title: '提现状态', title: '提现状态',
key: 'applyStatus', key: 'applyStatus',
width: 95,
render: (h, params) => { render: (h, params) => {
if (params.row.applyStatus === 'APPLY') { if (params.row.applyStatus === 'APPLY') {
return h('div', [h('span', {}, '申请中')]); return h('div', [h('span', {}, '申请中')]);
@ -302,12 +344,14 @@ export default {
} }
}, },
{ {
title: '提现时间', title: '审核时间',
key: 'inspectTime' key: 'inspectTime',
width: 168
}, },
{ {
title: '审核备注', title: '审核备注',
key: 'inspectRemark' key: 'inspectRemark'
} }
], ],
withdrawApplyColumnsListData: {} // withdrawApplyColumnsListData: {} //

View File

@ -69,7 +69,7 @@ service.interceptors.request.use(
config.headers['accessToken'] = accessToken; config.headers['accessToken'] = accessToken;
// 解析当前token时间 // 解析当前token时间
let jwtData = JSON.parse( let jwtData = JSON.parse(
decodeURIComponent(escape(window.atob(accessToken.split('.')[1]))) decodeURIComponent(escape(window.atob(accessToken.split('.')[1].replace(/-/g, '+').replace(/_/g, '/'))))
); );
if (jwtData.exp < Math.round(new Date() / 1000)) { if (jwtData.exp < Math.round(new Date() / 1000)) {
refresh(config) refresh(config)

View File

@ -2621,12 +2621,12 @@ dom-serializer@0:
domelementtype "^2.0.1" domelementtype "^2.0.1"
entities "^2.0.0" entities "^2.0.0"
dom7@^3.0.0: dom7@^2.1.5:
version "3.0.0" version "2.1.5"
resolved "https://registry.npm.taobao.org/dom7/download/dom7-3.0.0.tgz#b861ce5d67a6becd7aaa3ad02942ff14b1240331" resolved "https://registry.yarnpkg.com/dom7/-/dom7-2.1.5.tgz#a79411017800b31d8400070cdaebbfc92c1f6377"
integrity sha1-uGHOXWemvs16qjrQKUL/FLEkAzE= integrity sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==
dependencies: dependencies:
ssr-window "^3.0.0-alpha.1" ssr-window "^2.0.0"
domain-browser@^1.1.1: domain-browser@^1.1.1:
version "1.2.0" version "1.2.0"
@ -7487,10 +7487,10 @@ sshpk@^1.7.0:
safer-buffer "^2.0.2" safer-buffer "^2.0.2"
tweetnacl "~0.14.0" tweetnacl "~0.14.0"
ssr-window@^3.0.0, ssr-window@^3.0.0-alpha.1: ssr-window@^2.0.0:
version "3.0.0" version "2.0.0"
resolved "https://registry.npm.taobao.org/ssr-window/download/ssr-window-3.0.0.tgz#fd5b82801638943e0cc704c4691801435af7ac37" resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-2.0.0.tgz#98c301aef99523317f8d69618f0010791096efc4"
integrity sha1-/VuCgBY4lD4MxwTEaRgBQ1r3rDc= integrity sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==
ssri@^5.2.4: ssri@^5.2.4:
version "5.3.0" version "5.3.0"
@ -7753,14 +7753,13 @@ svgo@^1.0.0:
unquote "~1.1.1" unquote "~1.1.1"
util.promisify "~1.0.0" util.promisify "~1.0.0"
swiper@^6.4.1: swiper@^5.2.0:
version "6.4.1" version "5.4.5"
resolved "https://registry.npm.taobao.org/swiper/download/swiper-6.4.1.tgz?cache=0&sync_timestamp=1607518804170&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fswiper%2Fdownload%2Fswiper-6.4.1.tgz#6d4e9252ed4226821d4005e77924e929848de8af" resolved "https://registry.yarnpkg.com/swiper/-/swiper-5.4.5.tgz#a350f654bf68426dbb651793824925512d223c0f"
integrity sha1-bU6SUu1CJoIdQAXneSTpKYSN6K8= integrity sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA==
dependencies: dependencies:
dom7 "^3.0.0" dom7 "^2.1.5"
ssr-window "^3.0.0" ssr-window "^2.0.0"
tslib "^2.0.0"
table@4.0.2: table@4.0.2:
version "4.0.2" version "4.0.2"
@ -7942,11 +7941,6 @@ tslib@^1.10.0:
resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.14.1.tgz?cache=0&sync_timestamp=1602286724979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" resolved "https://registry.npm.taobao.org/tslib/download/tslib-1.14.1.tgz?cache=0&sync_timestamp=1602286724979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha1-zy04vcNKE0vK8QkcQfZhni9nLQA= integrity sha1-zy04vcNKE0vK8QkcQfZhni9nLQA=
tslib@^2.0.0:
version "2.0.3"
resolved "https://registry.npm.taobao.org/tslib/download/tslib-2.0.3.tgz?cache=0&sync_timestamp=1602286724979&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
integrity sha1-jgdBrEX8DCJuWKF7/D5kubxsphw=
tty-browserify@0.0.0: tty-browserify@0.0.0:
version "0.0.0" version "0.0.0"
resolved "https://registry.npm.taobao.org/tty-browserify/download/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" resolved "https://registry.npm.taobao.org/tty-browserify/download/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"

View File

@ -86,4 +86,9 @@ export const getMemberFeedbackDetail = (id) => {
return getRequest(`/feedback/${id}`); return getRequest(`/feedback/${id}`);
}; };
//管理员获取发送详情列表
export const getMemberMessage = (params) => {
return getRequest(`/message/member`, params);
};

View File

@ -122,6 +122,17 @@
title: "充值方式", title: "充值方式",
key: "rechargeWay", key: "rechargeWay",
width: 120, width: 120,
render: (h, params) => {
if (params.row.rechargeWay === 'ALIPAY') {
return h('div', [h('span', {}, '支付宝')]);
} else if (params.row.rechargeWay === 'WECHAT') {
return h('div', [h('span', {}, '微信')]);
} else if (params.row.rechargeWay === 'BANK_TRANSFER') {
return h('div', [h('span', {}, '线下转账')]);
} else {
return h('div', [h('span', {}, '')]);
}
}
}, },
{ {
title: "支付状态", title: "支付状态",
@ -137,6 +148,13 @@
} }
}, },
}, },
{
title: "充值时间",
key: "createTime",
align: "left",
width: 190,
sortable: false,
},
{ {
title: "支付时间", title: "支付时间",
key: "payTime", key: "payTime",

View File

@ -78,7 +78,7 @@ export default {
color: "red", color: "red",
}, },
}, },
this.$options.filters.unitPrice(params.row.money, "¥") this.$options.filters.unitPrice(-params.row.money, "- ¥")
), ),
]); ]);
} }

View File

@ -39,9 +39,11 @@
</FormItem> </FormItem>
<FormItem label="发放数量" prop="publishNum" v-if="form.getType==='FREE'"> <FormItem label="发放数量" prop="publishNum" v-if="form.getType==='FREE'">
<Input v-model="form.publishNum" placeholder="发放数量" style="width: 260px"/> <Input v-model="form.publishNum" placeholder="发放数量" style="width: 260px"/>
<div class="tips">如果发放数量为0时,则代表不限制发放数量</div>
</FormItem> </FormItem>
<FormItem label="领取数量限制" prop="couponLimitNum" v-if="form.getType==='FREE'"> <FormItem label="领取数量限制" prop="couponLimitNum" v-if="form.getType==='FREE'">
<Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px"/> <Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px"/>
<div class="tips">如果领取数量为0时,则代表不限制领取数量</div>
</FormItem> </FormItem>
<FormItem label="范围描述" prop="description"> <FormItem label="范围描述" prop="description">
<Input v-model="form.description" type="textarea" :rows="4" maxlength="50" show-word-limit clearable <Input v-model="form.description" type="textarea" :rows="4" maxlength="50" show-word-limit clearable
@ -576,5 +578,9 @@ h4 {
margin: 0 4px; margin: 0 4px;
} }
} }
.tips {
font-size: 12px;
color: #999;
}
</style> </style>

View File

@ -44,7 +44,7 @@ export default {
// //
pageNumber: 0, // pageNumber: 0, //
pageSize: 10, // pageSize: 10, //
sort: "startTime", // sort: "createTime", //
order: "desc", // order: "desc", //
}, },
form: { form: {

View File

@ -35,16 +35,18 @@
<Row class="operation" style="margin-top: 20px"> <Row class="operation" style="margin-top: 20px">
<Button @click="sendMessage" type="primary">发送消息</Button> <Button @click="sendMessage" type="primary">发送消息</Button>
</Row> </Row>
<Table <Row>
:loading="loading" <Table
border :loading="loading"
:columns="messageColumns" border
:data="messageData" :columns="messageColumns"
ref="table" :data="messageData"
sortable="custom" ref="table"
@on-sort-change="messageChangeSort" sortable="custom"
@on-selection-change="messageChangeSelect" @on-sort-change="messageChangeSort"
></Table> @on-selection-change="messageChangeSelect"
></Table>
</Row>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page <Page
:current="searchMessageForm.pageNumber" :current="searchMessageForm.pageNumber"
@ -62,16 +64,18 @@
</TabPane> </TabPane>
<TabPane label="通知类站内信" name="SETTING"> <TabPane label="通知类站内信" name="SETTING">
<Table <Row>
:loading="loading" <Table
border :loading="loading"
:columns="noticeColumns" border
:data="noticeData" :columns="noticeColumns"
ref="table" :data="noticeData"
sortable="custom" ref="table"
@on-sort-change="changeSort" sortable="custom"
@on-selection-change="changeSelect" @on-sort-change="changeSort"
></Table> @on-selection-change="changeSelect"
></Table>
</Row>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page <Page
:current="searchForm.pageNumber" :current="searchForm.pageNumber"
@ -106,21 +110,22 @@
</div> </div>
<div class="send-setting"> <div class="send-setting">
<div class="left-show"> <div class="left-show">
<div v-for="(item, index) in form.variables" > <div v-for="(item, index) in form.variables">
#{<span>{{item}}</span>} #{<span>{{item}}</span>}
</div> </div>
</div> </div>
<div class="send-form"> <div class="send-form">
<Form ref="form" :model="form" :label-width="100" :rules="formValidate"> <Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<FormItem label="通知节点" prop="noticeNode"> <FormItem label="通知节点" prop="noticeNode">
<Input v-model="form.noticeNode" clearable type="text" style="width: 90%" maxlength="20" disabled /> <Input v-model="form.noticeNode" clearable type="text" style="width: 90%" maxlength="20" disabled/>
</FormItem> </FormItem>
<FormItem label="消息标题" prop="noticeTitle"> <FormItem label="消息标题" prop="noticeTitle">
<Input v-model="form.noticeTitle" clearable type="text" style="width: 90%" maxlength="20"/> <Input v-model="form.noticeTitle" clearable type="text" style="width: 90%" maxlength="20"/>
</FormItem> </FormItem>
<FormItem label="消息内容" prop="noticeContent"> <FormItem label="消息内容" prop="noticeContent">
<Input v-model="form.noticeContent" clearable type="textarea" style="width: 90%" maxlength="50" :autosize="{maxRows:4,minRows: 4}" show-word-limit /> <Input v-model="form.noticeContent" clearable type="textarea" style="width: 90%" maxlength="50"
:autosize="{maxRows:4,minRows: 4}" show-word-limit/>
</FormItem> </FormItem>
</Form> </Form>
</div> </div>
@ -137,24 +142,34 @@
:title="messageModalTitle" :title="messageModalTitle"
v-model="messageModalVisible" v-model="messageModalVisible"
:mask-closable="false" :mask-closable="false"
:width="500" :width="800"
> >
<Form ref="messageSendForm" :model="messageSendForm" :label-width="100" :rules="messageFormValidate"> <Form ref="messageSendForm" :model="messageSendForm" :label-width="100" :rules="messageFormValidate">
<FormItem label="消息标题" prop="title"> <FormItem label="消息标题" prop="title">
<Input v-model="messageSendForm.title" maxlength="15" clearable style="width: 90%"/> <Input v-model="messageSendForm.title" maxlength="15" clearable style="width: 70%"/>
</FormItem> </FormItem>
<FormItem label="消息内容" prop="content"> <FormItem label="消息内容" prop="content">
<Input <Input
v-model="messageSendForm.content" v-model="messageSendForm.content"
:rows="4" :rows="4"
type="textarea" type="textarea"
style="max-height:60vh;overflow:auto;width: 90%" style="max-height:60vh;overflow:auto;width: 70%"
/> />
</FormItem> </FormItem>
<FormItem label="发送对象">
<RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageClient"
@on-change="selectObject">
<Radio label="member">会员</Radio>
<Radio label="store">商家</Radio>
</RadioGroup>
</FormItem>
<FormItem label="发送范围"> <FormItem label="发送范围">
<RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageRange" @on-change="selectShop"> <RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageRange" @on-change="selectShop">
<Radio label="ALL">全站</Radio> <Radio label="ALL">全站</Radio>
<Radio label="APPOINT">指定商家</Radio> <Radio v-if="messageSendForm.messageClient == 'store'" label="APPOINT"></Radio>
<Radio v-if="messageSendForm.messageClient == 'member'" label="MEMBER"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="指定商家" v-if="shopShow"> <FormItem label="指定商家" v-if="shopShow">
@ -165,6 +180,17 @@
</Option> </Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem label="选择会员" prop="scopeType"
v-if="memberShow">
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
<div style="margin-top:24px;" v-if="messageSendForm.messageClient == 'member'">
<Table border :columns="userColumns" :data="this.selectedMember">
</Table>
</div>
</FormItem>
<Modal width="1200" v-model="checkUserList">
<userList v-if="checkUserList" @callback="callbackSelectUser" :selectedList="selectedMember" ref="memberLayout"/>
</Modal>
</Form> </Form>
<div slot="footer"> <div slot="footer">
<Button type="text" @click="messageModalVisible = false">取消</Button> <Button type="text" @click="messageModalVisible = false">取消</Button>
@ -180,7 +206,7 @@
:title="modalTitle" :title="modalTitle"
v-model="messageDetailModalVisible" v-model="messageDetailModalVisible"
:mask-closable="false" :mask-closable="false"
:width="700" :width="800"
> >
<Form ref="messageSendForm" :model="messageSendForm" :label-width="100" :rules="messageFormValidate"> <Form ref="messageSendForm" :model="messageSendForm" :label-width="100" :rules="messageFormValidate">
<FormItem label="消息标题" prop="title"> <FormItem label="消息标题" prop="title">
@ -195,30 +221,65 @@
style="max-height:60vh;overflow:auto;width: 50%" style="max-height:60vh;overflow:auto;width: 50%"
/> />
</FormItem> </FormItem>
<FormItem label="发送对象">
<RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageClient">
<Radio disabled label="member">会员</Radio>
<Radio disabled label="store">商家</Radio>
</RadioGroup>
</FormItem>
<FormItem label="发送范围"> <FormItem label="发送范围">
<RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageRange"> <RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageRange">
<Radio disabled label="ALL">全站</Radio> <Radio disabled label="ALL">全站</Radio>
<Radio disabled label="APPOINT">指定商家</Radio> <Radio v-if="messageSendForm.messageClient == 'store'" disabled label="APPOINT"></Radio>
<Radio v-if="messageSendForm.messageClient == 'member'" disabled label="MEMBER"></Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem label="指定商家"> <FormItem label="指定商家" v-if="messageSendForm.messageClient == 'store'">
<Table <Row>
:loading="loading" <Table
border :loading="loading"
:columns="messageDetailColumns" border
:data="shopMessageData" :columns="messageDetailColumns"
ref="table" :data="shopMessageData"
sortable="custom" ref="table"
@on-sort-change="messageChangeSort" sortable="custom"
@on-selection-change="messageChangeSelect" @on-sort-change="shopMessageChangeSort"
></Table> ></Table>
</Row>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page <Page
:current="searchShopMessageForm.pageNumber" :current="searchShopMessageForm.pageNumber"
:total="shopMessageDataTotal" :total="shopMessageDataTotal"
:page-size="searchShopMessageForm.pageSize" :page-size="searchShopMessageForm.pageSize"
@on-change="messageChangePage" @on-change="shopMessageChangePage"
@on-page-size-change="messageChangePageSize" @on-page-size-change="shopMessageChangePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row>
</FormItem>
<FormItem label="指定会员" v-if="messageSendForm.messageClient == 'member'">
<Row>
<Table
:loading="loading"
border
:columns="memberMessageDetailColumns"
:data="memberMessageData"
ref="table"
sortable="custom"
@on-sort-change="memberMessageChangeSort"
></Table>
</Row>
<Row type="flex" justify="end" class="page">
<Page
:current="searchMemberMessageForm.pageNumber"
:total="memberMessageDataTotal"
:page-size="searchMemberMessageForm.pageSize"
@on-change="memberMessageChangePage"
@on-page-size-change="memberMessageChangePageSize"
:page-size-opts="[10, 20, 50]" :page-size-opts="[10, 20, 50]"
size="small" size="small"
show-total show-total
@ -239,14 +300,18 @@
import * as API_Setting from "@/api/setting.js"; import * as API_Setting from "@/api/setting.js";
import * as API_Other from "@/api/other.js"; import * as API_Other from "@/api/other.js";
import * as API_Shop from "@/api/shops.js"; import * as API_Shop from "@/api/shops.js";
import userList from "@/views/member/list/index";
export default { export default {
name: "bill", name: "bill",
components: {}, components: {
userList
},
data() { data() {
return { return {
openSearch: true, // openSearch: true, //
checkUserList: false, //
selectedMember: [], //
openTip: true, // openTip: true, //
loading: true, // loading: true, //
modalVisible: false, // modalVisible: false, //
@ -255,6 +320,7 @@
messageModalTitle: "", // messageModalTitle: "", //
messageDetailModalVisible: false, // messageDetailModalVisible: false, //
shopShow: false, // shopShow: false, //
memberShow: false, //
shopList: [],// shopList: [],//
searchForm: { searchForm: {
// //
@ -283,6 +349,12 @@
pageNumber: 1, // pageNumber: 1, //
pageSize: 10, // pageSize: 10, //
}, },
//
searchMemberMessageForm: {
//
pageNumber: 1, //
pageSize: 10, //
},
form: { form: {
noticeNode: "", noticeNode: "",
noticeTitle: "" noticeTitle: ""
@ -290,6 +362,7 @@
// //
messageSendForm: { messageSendForm: {
messageRange: "ALL", messageRange: "ALL",
messageClient: "member",
userIds: [], userIds: [],
userNames: [], userNames: [],
}, },
@ -413,6 +486,45 @@
} }
}, },
], ],
//
userColumns: [
{
title: "用户名称",
key: "nickName",
minWidth: 120,
},
{
title: "手机号",
key: "mobile",
render: (h, params) => {
return h("div", params.row.mobile || "暂未填写");
},
},
{
title: "操作",
key: "action",
minWidth: 50,
align: "center",
render: (h, params) => {
return h(
"Button",
{
props: {
size: "small",
type: "error",
ghost: true,
},
on: {
click: () => {
this.delUser(params.index);
},
},
},
"删除"
);
},
},
],
noticeData: [], // noticeData: [], //
noticeDataTotal: 0, // noticeDataTotal: 0, //
messageColumns: [ messageColumns: [
@ -427,7 +539,22 @@
minWidth: 350, minWidth: 350,
tooltip: true tooltip: true
}, },
{
title: "发送对象",
key: "messageClient",
width: 100,
render: (h, params) => {
if (params.row.messageClient == "member") {
return h('div', [
h('span', {}, '会员'),
]);
} else if (params.row.messageClient == "store") {
return h('div', [
h('span', {}, '商家'),
]);
}
}
},
{ {
title: "发送类型", title: "发送类型",
key: "messageRange", key: "messageRange",
@ -439,7 +566,11 @@
]); ]);
} else if (params.row.messageRange == "APPOINT") { } else if (params.row.messageRange == "APPOINT") {
return h('div', [ return h('div', [
h('span', {}, '指定用户'), h('span', {}, '指定商家'),
]);
} else if (params.row.messageRange == "MEMBER") {
return h('div', [
h('span', {}, '指定会员'),
]); ]);
} }
} }
@ -499,7 +630,7 @@
} }
}, },
], ],
messageData: [], // messageData: [], //
messageDataTotal: 0, // messageDataTotal: 0, //
messageDetailColumns: [ messageDetailColumns: [
{ {
@ -518,17 +649,47 @@
key: "status", key: "status",
render: (h, params) => { render: (h, params) => {
if (params.row.status == "ALREADY_READY") { if (params.row.status == "ALREADY_READY") {
return h( "Badge", {props: { status: "success",text: "已读" } }) return h("Badge", {props: {status: "success", text: "已读"}})
} else if (params.row.status == "UN_READY") { } else if (params.row.status == "UN_READY") {
return h( "Badge", {props: { status: "processing",text: "未读" } }) return h("Badge", {props: {status: "processing", text: "未读"}})
}else{ } else {
return h( "Badge", {props: { status: "processing",text: "回收站" } }) return h("Badge", {props: {status: "processing", text: "回收站"}})
} }
} }
}, },
], ],
shopMessageData: [], // shopMessageData: [], //
shopMessageDataTotal: 0, // shopMessageDataTotal: 0, //
memberMessageDetailColumns: [
{
title: "会员ID",
key: "memberId",
maxWidth: 300,
sortable: false,
},
{
title: "会员名称",
key: "memberName",
sortable: false,
},
{
title: "是否已读",
key: "status",
maxWidth: 120,
render: (h, params) => {
if (params.row.status == "ALREADY_READY") {
return h("Badge", {props: {status: "success", text: "已读"}})
} else if (params.row.status == "UN_READY") {
return h("Badge", {props: {status: "processing", text: "未读"}})
} else {
return h("Badge", {props: {status: "processing", text: "回收站"}})
}
}
},
],
memberMessageData: [], //
memberMessageDataTotal: 0, //
}; };
}, },
methods: { methods: {
@ -536,6 +697,41 @@
this.getMessage(); this.getMessage();
}, },
//
callbackSelectUser(val) {
//
let findUser = this.selectedMember.find((item) => {
return item.id === val.id;
});
//
if (!findUser) {
this.selectedMember.push(val);
} else {
//
this.selectedMember.map((item, index) => {
if (item.id === findUser.id) {
this.selectedMember.splice(index, 1);
}
});
}
this.reSelectMember();
},
//
delUser(index) {
this.selectedMember.splice(index, 1);
this.reSelectMember();
},
//
reSelectMember() {
this.form.memberDTOS = this.selectedMember.map((item) => {
return {
nickName: item.nickName,
id: item.id
}
});
},
// //
getShopList() { getShopList() {
this.loading = true; this.loading = true;
@ -548,6 +744,13 @@
this.loading = false; this.loading = false;
}, },
//
addVip() {
this.checkUserList = true;
this.$nextTick(() => {
this.$refs.memberLayout.selectedMember = true;
});
},
paneChange(v) { paneChange(v) {
if (v == "SETTING") { if (v == "SETTING") {
this.getNoticeMessage() this.getNoticeMessage()
@ -582,6 +785,42 @@
this.getMessage(); this.getMessage();
this.clearSelectAll(); this.clearSelectAll();
}, },
//
memberMessageChangePageSize(v) {
this.searchMemberMessageForm.pageSize = v;
this.messageDetail();
},
//
memberMessageChangePage(v) {
this.searchMemberMessageForm.pageNumber = v;
this.messageDetail();
this.clearSelectAll();
},
//
memberMessageChangeSort(e) {
this.searchMemberMessageForm.sort = e.key;
this.searchMemberMessageForm.order = e.order;
this.messageDetail()
},
//
shopMessageChangePageSize(v) {
this.searchShopMessageForm.pageSize = v;
this.messageDetail();
},
//
shopMessageChangePage(v) {
this.searchShopMessageForm.pageNumber = v;
this.messageDetail();
this.clearSelectAll();
},
//
shopMessageChangeSort(e) {
this.searchShopMessageForm.sort = e.key;
this.searchShopMessageForm.order = e.order;
this.messageDetail()
},
// //
messageChangeSort(e) { messageChangeSort(e) {
this.searchMessageForm.sort = e.key; this.searchMessageForm.sort = e.key;
@ -622,7 +861,7 @@
}) })
}, },
// //
delete(id){ delete(id) {
console.warn(id) console.warn(id)
this.$Modal.confirm({ this.$Modal.confirm({
title: "确认删除", title: "确认删除",
@ -647,9 +886,11 @@
this.messageModalVisible = true this.messageModalVisible = true
this.messageModalTitle = "发送站内信" this.messageModalTitle = "发送站内信"
this.shopShow = false this.shopShow = false
this.memberShow = false
this.messageSendForm = this.messageSendForm =
{ {
messageRange: "ALL", messageRange: "ALL",
messageClient: "member",
content: "", content: "",
title: "", title: "",
userIds: [], userIds: [],
@ -658,6 +899,18 @@
}, },
// //
sendMessageSubmit() { sendMessageSubmit() {
let userIds = [];
let userNames = [];
console.warn(this.selectedMember)
if (this.messageSendForm.messageClient == 'member' && this.messageSendForm.messageRange == 'MEMBER'){
this.selectedMember.forEach(function(item, index) {
userIds.push(item.id)
userNames.push(item.username)
})
this.messageSendForm.userIds = userIds
this.messageSendForm.userNames = userNames
}
if (this.messageSendForm.userIds.length <= 0 && this.messageSendForm.messageRange == "APPOINT") { if (this.messageSendForm.userIds.length <= 0 && this.messageSendForm.messageRange == "APPOINT") {
this.$Message.error("请选择发送对象"); this.$Message.error("请选择发送对象");
return return
@ -677,14 +930,27 @@
}) })
}, },
//
selectObject(v) {
this.messageSendForm.messageRange = "ALL"
this.shopShow = false
this.memberShow =false
},
// //
selectShop(v) { selectShop(v) {
if (v == "APPOINT") { if (v == "APPOINT") {
this.getShopList() this.getShopList()
this.shopShow = true this.shopShow = true
this.memberShow = false
} }
if (v == "ALL") { if (v == "ALL") {
this.shopShow = false this.shopShow = false
this.memberShow = false
}
if (v == "MEMBER") {
this.shopShow = false
this.memberShow = true
this.selectedMember = []
} }
}, },
// //
@ -715,9 +981,9 @@
handleSubmit() { handleSubmit() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
let params ={ let params = {
noticeContent:this.form.noticeContent, noticeContent: this.form.noticeContent,
noticeTitle:this.form.noticeTitle noticeTitle: this.form.noticeTitle
} }
API_Setting.editNoticeMessage(this.form.id, params).then((res) => { API_Setting.editNoticeMessage(this.form.id, params).then((res) => {
this.submitLoading = false; this.submitLoading = false;
@ -731,19 +997,38 @@
}); });
}, },
// //
detail(v) { messageDetail() {
this.searchShopMessageForm.messageId = v.id if (this.messageSendForm.messageClient == 'member') {
API_Other.getShopMessage(this.searchShopMessageForm).then((res) => { API_Other.getMemberMessage(this.searchMemberMessageForm).then((res) => {
if (res.success) { if (res.success) {
this.messageDetailModalVisible = true; this.memberMessageData = res.result.records;
this.modalTitle = "消息详情" this.memberMessageDataTotal = res.result.total;
this.messageSendForm = v }
this.shopMessageData = res.result.records; });
this.shopMessageDataTotal = res.result.total; } else {
} console.warn(this.searchShopMessageForm)
}); API_Other.getShopMessage(this.searchShopMessageForm).then((res) => {
if (res.success) {
this.shopMessageData = res.result.records;
this.shopMessageDataTotal = res.result.total;
}
});
}
}, },
//
detail(v) {
console.warn(this.searchShopMessageForm)
this.messageSendForm = v
if (this.messageSendForm.messageClient == 'member') {
this.searchMemberMessageForm.messageId = v.id
} else {
this.searchShopMessageForm.messageId = v.id
}
this.messageDetail();
this.messageDetailModalVisible = true;
this.modalTitle = "消息详情"
},
edit(v) { edit(v) {
API_Setting.getNoticeMessageDetail(v.id).then((res) => { API_Setting.getNoticeMessageDetail(v.id).then((res) => {
if (res.success) { if (res.success) {
@ -755,7 +1040,7 @@
}, },
// //
disable(v) { disable(v) {
API_Setting.updateMessageStatus(v.id,"CLOSE").then((res) => { API_Setting.updateMessageStatus(v.id, "CLOSE").then((res) => {
if (res.success) { if (res.success) {
this.$Message.success("禁用成功"); this.$Message.success("禁用成功");
this.getNoticeMessage(); this.getNoticeMessage();
@ -764,7 +1049,7 @@
}, },
// //
enable(v) { enable(v) {
API_Setting.updateMessageStatus(v.id,"OPEN").then((res) => { API_Setting.updateMessageStatus(v.id, "OPEN").then((res) => {
if (res.success) { if (res.success) {
this.$Message.success("启用成功"); this.$Message.success("启用成功");
this.getNoticeMessage(); this.getNoticeMessage();

View File

@ -7,6 +7,7 @@ import Vue from 'vue';
const app = { const app = {
state: { state: {
shipTemplates:"", shipTemplates:"",
regions:[], //此处是在地区选择器时赋值一次
styleStore:"", //移动端楼层装修中选择风格存储 styleStore:"", //移动端楼层装修中选择风格存储
loading: false, // 全局加载动画 loading: false, // 全局加载动画
added: false, // 加载路由标识 added: false, // 加载路由标识

View File

@ -44,23 +44,27 @@ export default {
*/ */
open(val, index) { open(val, index) {
if (val) { if (val) {
// console.warn(val);
// //
let checkedData = this.$store.state.shipTemplate; let checkedData = this.$store.state.shipTemplate;
// console.warn(this.$store.state.shipTemplate);
// //
let disabledData = checkedData.filter((item, i) => { let disabledData = checkedData.filter((item, i) => {
return i != index; return i != index;
}); });
disabledData.forEach((dis) => { disabledData.forEach((dis) => {
console.log(dis)
// id // id
dis.areaId.split(",").forEach((ids) => { dis.areaId.split(",").forEach((ids) => {
// //
this.data.forEach((item) => { this.data.forEach((item) => {
// //
if (dis.selectedAll) { if (dis.selectedAll) {
dis.area.split(",").forEach((area) => { dis.area.split(",").forEach((area) => {
if (area == item.name) { if (area == item.name) {
console.log(item.name +"选中")
this.$set(item, "disabled", true); this.$set(item, "disabled", true);
} }
}); });
@ -99,7 +103,11 @@ export default {
// //
sort.forEach((sortItem, sortIndex) => { sort.forEach((sortItem, sortIndex) => {
if (item.level != "province" && sortItem.id == item.parentId && !item.disabled) { if (
item.level != "province" &&
sortItem.id == item.parentId &&
!item.disabled
) {
sortItem.selectedList.push({ sortItem.selectedList.push({
...item, ...item,
}); });
@ -147,6 +155,7 @@ export default {
this.selectedWay.push({ name: data.title, id: data.id }); this.selectedWay.push({ name: data.title, id: data.id });
}); });
console.log(this.data); console.log(this.data);
this.$store.state.regions = this.data;
} }
}); });
}, },

View File

@ -6,22 +6,10 @@
<h4>基本信息</h4> <h4>基本信息</h4>
<div class="form-item-view"> <div class="form-item-view">
<FormItem label="活动名称" prop="promotionName"> <FormItem label="活动名称" prop="promotionName">
<Input <Input type="text" v-model="form.promotionName" placeholder="活动名称" clearable style="width: 260px" />
type="text"
v-model="form.promotionName"
placeholder="活动名称"
clearable
style="width: 260px"
/>
</FormItem> </FormItem>
<FormItem label="优惠券名称" prop="couponName"> <FormItem label="优惠券名称" prop="couponName">
<Input <Input type="text" v-model="form.couponName" placeholder="优惠券名称" clearable style="width: 260px" />
type="text"
v-model="form.couponName"
placeholder="优惠券名称"
clearable
style="width: 260px"
/>
</FormItem> </FormItem>
<FormItem label="优惠券类型" prop="couponType"> <FormItem label="优惠券类型" prop="couponType">
<Select v-model="form.couponType" style="width: 260px"> <Select v-model="form.couponType" style="width: 260px">
@ -29,32 +17,12 @@
<Option value="PRICE">减免现金</Option> <Option value="PRICE">减免现金</Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem <FormItem label="折扣" prop="discount" v-if="form.couponType == 'DISCOUNT'">
label="折扣" <Input type="number" v-model="form.couponDiscount" placeholder="折扣" clearable style="width: 260px" />
prop="discount"
v-if="form.couponType == 'DISCOUNT'"
>
<Input
type="number"
v-model="form.couponDiscount"
placeholder="折扣"
clearable
style="width: 260px"
/>
<span class="describe">请输入0-10之间数字可以输入一位小数</span> <span class="describe">请输入0-10之间数字可以输入一位小数</span>
</FormItem> </FormItem>
<FormItem <FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
label="面额" <Input type="text" v-model="form.price" placeholder="面额" clearable style="width: 260px" />
prop="price"
v-if="form.couponType == 'PRICE'"
>
<Input
type="text"
v-model="form.price"
placeholder="面额"
clearable
style="width: 260px"
/>
</FormItem> </FormItem>
<FormItem label="活动类型" prop="getType"> <FormItem label="活动类型" prop="getType">
<Select v-model="form.getType" style="width: 260px"> <Select v-model="form.getType" style="width: 260px">
@ -63,42 +31,22 @@
</Select> </Select>
</FormItem> </FormItem>
<FormItem label="发放数量" prop="publishNum"> <FormItem label="发放数量" v-if="form.getType == 'FREE'" prop="publishNum">
<Input <Input v-model="form.publishNum" placeholder="发放数量" style="width: 260px" />
v-model="form.publishNum" <div class="tips">如果发放数量为0时,则代表不限制发放数量</div>
placeholder="发放数量"
style="width: 260px"
/>
</FormItem> </FormItem>
</div> </div>
<h4>使用限制</h4> <h4>使用限制</h4>
<div class="form-item-view"> <div class="form-item-view">
<FormItem label="消费门槛" prop="consumeThreshold"> <FormItem label="消费门槛" prop="consumeThreshold">
<Input <Input type="text" v-model="form.consumeThreshold" placeholder="消费门槛" clearable style="width: 260px" />
type="text"
v-model="form.consumeThreshold"
placeholder="消费门槛"
clearable
style="width: 260px"
/>
</FormItem> </FormItem>
<FormItem label="领取限制" prop="couponLimitNum"> <FormItem label="领取限制" v-if="form.getType == 'FREE'" prop="couponLimitNum">
<Input <Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px" />
v-model="form.couponLimitNum" <div class="tips">如果领取限制为0时,则代表不限制领取数量</div>
placeholder="领取限制"
clearable
style="width: 260px"
/>
</FormItem> </FormItem>
<FormItem label="有效期" prop="rangeTime"> <FormItem label="有效期" prop="rangeTime">
<DatePicker <DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" style="width: 260px">
type="datetimerange"
v-model="form.rangeTime"
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择"
:options="options"
style="width: 260px"
>
</DatePicker> </DatePicker>
</FormItem> </FormItem>
<FormItem label="使用范围" prop="scopeType"> <FormItem label="使用范围" prop="scopeType">
@ -109,34 +57,14 @@
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem <FormItem style="width: 100%" v-if="form.scopeType == 'PORTION_GOODS'">
style="width: 100%"
v-if="form.scopeType == 'PORTION_GOODS'"
>
<div style="display: flex; margin-bottom: 10px"> <div style="display: flex; margin-bottom: 10px">
<Button type="primary" @click="openSkuList" <Button type="primary" @click="openSkuList"></Button>
>选择商品</Button> <Button type="error" ghost style="margin-left: 10px" @click="delSelectGoods"></Button>
<Button
type="error"
ghost
style="margin-left: 10px"
@click="delSelectGoods"
>批量删除</Button
>
</div> </div>
<Table <Table border :columns="columns" :data="form.promotionGoodsList" @on-selection-change="changeSelect">
border
:columns="columns"
:data="form.promotionGoodsList"
@on-selection-change="changeSelect"
>
<template slot-scope="{ row }" slot="QRCode"> <template slot-scope="{ row }" slot="QRCode">
<img <img :src="row.QRCode || '../../../assets/lili.png'" width="50px" height="50px" alt="" />
:src="row.QRCode || '../../../assets/lili.png'"
width="50px"
height="50px"
alt=""
/>
</template> </template>
</Table> </Table>
</FormItem> </FormItem>
@ -147,35 +75,17 @@
</FormItem> </FormItem>
<FormItem label="范围描述" prop="description"> <FormItem label="范围描述" prop="description">
<Input <Input v-model="form.description" type="textarea" :rows="4" maxlength="50" show-word-limit clearable style="width: 260px" />
v-model="form.description"
type="textarea"
:rows="4"
maxlength="50"
show-word-limit
clearable
style="width: 260px"
/>
</FormItem> </FormItem>
<div> <div>
<Button type="text" @click="$router.push({ name: 'coupon' })" <Button type="text" @click="$router.push({ name: 'coupon' })">返回</Button>
>返回</Button <Button type="primary" :loading="submitLoading" @click="handleSubmit"></Button>
>
<Button
type="primary"
:loading="submitLoading"
@click="handleSubmit"
>提交</Button
>
</div> </div>
</div> </div>
</div> </div>
</Form> </Form>
</Card> </Card>
<sku-select <sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
ref="skuSelect"
@selectedGoodsData="selectedGoodsData"
></sku-select>
</div> </div>
</template> </template>
@ -212,7 +122,7 @@ export default {
callback(); callback();
} }
}; };
return { return {
modalType: 0, // 0 1 modalType: 0, // 0 1
categoryId: 0, // id categoryId: 0, // id
@ -232,6 +142,7 @@ export default {
getType: "FREE", getType: "FREE",
promotionGoodsList: [], promotionGoodsList: [],
scopeIdGoods: [], scopeIdGoods: [],
rangeDayType: "FIXEDTIME",
}, },
id: this.$route.query.id, id: this.$route.query.id,
submitLoading: false, // submitLoading: false, //
@ -392,7 +303,11 @@ export default {
params.endTime = this.$options.filters.unixToDate( params.endTime = this.$options.filters.unixToDate(
this.form.rangeTime[1] / 1000 this.form.rangeTime[1] / 1000
); );
delete params.rangeTime if (params.getType == "ACTIVITY") {
params.couponLimitNum = 0;
params.publishNum = 0;
}
delete params.rangeTime;
let scopeId = []; let scopeId = [];
if ( if (
params.scopeType == "PORTION_GOODS" && params.scopeType == "PORTION_GOODS" &&
@ -465,12 +380,13 @@ export default {
name: "coupon", name: "coupon",
}); });
}, },
openSkuList() { // openSkuList() {
//
this.$refs.skuSelect.open("goods"); this.$refs.skuSelect.open("goods");
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList)) let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
data.forEach(e => { data.forEach((e) => {
e.id = e.skuId e.id = e.skuId;
}) });
this.$refs.skuSelect.goodsData = data; this.$refs.skuSelect.goodsData = data;
}, },
changeSelect(e) { changeSelect(e) {
@ -507,15 +423,15 @@ export default {
// //
let list = []; let list = [];
item.forEach((e) => { item.forEach((e) => {
list.push({ list.push({
goodsName: e.goodsName, goodsName: e.goodsName,
price: e.price, price: e.price,
originalPrice: e.price, originalPrice: e.price,
quantity: e.quantity, quantity: e.quantity,
storeId: e.storeId, storeId: e.storeId,
sellerName: e.sellerName, sellerName: e.sellerName,
skuId: e.id, skuId: e.id,
}); });
}); });
this.form.promotionGoodsList = list; this.form.promotionGoodsList = list;
}, },
@ -598,11 +514,15 @@ h4 {
margin-left: 10px; margin-left: 10px;
color: #999; color: #999;
} }
.ivu-form-item{ .ivu-form-item {
margin-bottom: 24px !important; margin-bottom: 24px !important;
} }
.wrapper{ .wrapper {
min-height: 1000px; min-height: 1000px;
} }
.tips {
font-size: 12px;
color: #999;
}
</style> </style>

View File

@ -97,7 +97,7 @@
</FormItem> </FormItem>
<FormItem label="商品" v-if="$route.query.id"> <FormItem label="商品" v-if="$route.query.id">
<Button type="primary" :disabled="liveStatus!='NEW'" ghost @click="liveGoodsVisible=true" icon="md-add">添加商品</Button> <Button type="primary" ghost @click="liveGoodsVisible=true" :disabled="liveStatus!='NEW'" icon="md-add">添加商品</Button>
<Table class="goods-table" :columns="liveColumns" :data="liveData"> <Table class="goods-table" :columns="liveColumns" :data="liveData">
<template slot-scope="{ row,index }" slot="goodsName"> <template slot-scope="{ row,index }" slot="goodsName">
<div class="flex-goods"> <div class="flex-goods">
@ -140,8 +140,8 @@
<img :src="imageSrc" v-if="imageVisible" style="width: 100%"> <img :src="imageSrc" v-if="imageVisible" style="width: 100%">
</Modal> </Modal>
<Modal width="800" v-model="liveGoodsVisible" @on-ok="addGoods"> <Modal width="800" v-model="liveGoodsVisible" footer-hide>
<liveGoods :init="liveData" @selectedGoods="callBackData" reviewed /> <liveGoods @selectedGoods="callBackData" reviewed />
</Modal> </Modal>
</div> </div>
</template> </template>
@ -259,10 +259,14 @@ export default {
* 删除直播间商品 * 删除直播间商品
*/ */
async deleteGoods(val, index) { async deleteGoods(val, index) {
this.$Spin.show();
let res = await delRoomLiveGoods(this.liveForm.roomId, val.liveGoodsId); let res = await delRoomLiveGoods(this.liveForm.roomId, val.liveGoodsId);
if (res.success) { if (res.success) {
this.$Message.success("删除成功!"); this.$Message.success("删除成功!");
this.liveData.splice(index, 1); this.liveData.splice(index, 1);
this.$Spin.hide();
} else {
this.$Spin.hide();
} }
}, },
/** /**
@ -325,35 +329,19 @@ export default {
* 回调的商品选择数据 * 回调的商品选择数据
*/ */
callBackData(way) { callBackData(way) {
this.$set(this, "liveData", way); console.log(way);
}, this.liveGoodsVisible = false;
this.$Spin.show();
/**
* 提交直播间商品
*/
addGoods() {
addLiveGoods({ addLiveGoods({
roomId: this.$route.query.roomId, roomId: this.$route.query.roomId,
liveGoodsId: item.liveGoodsId, liveGoodsId: way.liveGoodsId,
}); }).then((res) => {
}, if (res.success) {
this.liveData.push(way);
/** this.$Spin.hide();
* dialog点击确定时判断 console.log(this.liveData);
*/
addGoods() {
this.liveData.forEach((item) => {
if (this.commodityList.length == 1 && this.liveData.length == 1) {
addLiveGoods({
roomId: this.$route.query.roomId,
liveGoodsId: item.liveGoodsId,
});
} else { } else {
this.commodityList.forEach((oldVal, i) => { this.$Spin.hide();
//
if (oldVal.liveGoodsId != item.liveGoodsId) {
}
});
} }
}); });
}, },

View File

@ -208,20 +208,20 @@ export default {
* 回调参数补充 * 回调参数补充
*/ */
selectedLiveGoods(val, index) { selectedLiveGoods(val, index) {
if (!val.___selected) { // if (!val.___selected) {
val.___selected = true; // val.___selected = true;
this.$set(this.liveGoodsData[index], "___selected", true); // this.$set(this.liveGoodsData[index], "___selected", true);
this.selectedGoods.push(this.liveGoodsData[index]); // this.selectedGoods.push(this.liveGoodsData[index]);
} else { // } else {
this.$nextTick(() => { // this.$nextTick(() => {
val.___selected = false; // val.___selected = false;
this.$set(this.liveGoodsData[index], "___selected", true); // this.$set(this.liveGoodsData[index], "___selected", true);
this.selectedGoods.splice(index, 1); // this.selectedGoods.splice(index, 1);
}); // });
} // }
this.$emit("selectedGoods", this.selectedGoods); this.$emit("selectedGoods", val);
}, },
/** /**
* 解决radio数据不回显问题 * 解决radio数据不回显问题
@ -279,7 +279,7 @@ export default {
console.log(element); console.log(element);
return { return {
goodsId: element.goodsId, //id goodsId: element.goodsId, //id
goodsImage: element.small, // 300 * 300 goodsImage: element.small, // 300 * 300
name: element.goodsName, // name: element.goodsName, //
price: parseInt(element.price), // price: parseInt(element.price), //
quantity: element.quantity, // quantity: element.quantity, //

View File

@ -95,8 +95,8 @@
<Input class="text w40" type="text" v-model="item.firstCompany" maxlength="3" clearable /> <Input class="text w40" type="text" v-model="item.firstCompany" maxlength="3" clearable />
</td> </td>
<td> <td>
<Input class="text w60" type="text" v-model="item.firstPrice" maxlength="6" clearable > <Input class="text w60" type="text" v-model="item.firstPrice" maxlength="6" clearable>
<span slot="append"></span> <span slot="append"></span>
</Input> </Input>
</td> </td>
<td> <td>
@ -104,7 +104,7 @@
</td> </td>
<td> <td>
<Input class="text w60" type="text" v-model="item.continuedPrice" maxlength="6" clearable> <Input class="text w60" type="text" v-model="item.continuedPrice" maxlength="6" clearable>
<span slot="append"></span> <span slot="append"></span>
</Input> </Input>
</td> </td>
<td class="nscs-table-handle"> <td class="nscs-table-handle">
@ -135,7 +135,7 @@
</div> </div>
</FormItem> </FormItem>
<Form-item> <Form-item>
<Button @click="addShipTemplateChildren(index)" v-if="form.pricingMethod !== 'FREE'" icon="ios-create-outline" >为指定城市设置运费模 <Button @click="addShipTemplateChildren(index)" v-if="form.pricingMethod !== 'FREE'" icon="ios-create-outline">
</Button> </Button>
<Button @click="handleSubmit" :loading="submitLoading" type="primary" style="margin-right:5px">保存 <Button @click="handleSubmit" :loading="submitLoading" type="primary" style="margin-right:5px">保存
</Button> </Button>
@ -163,7 +163,7 @@ export default {
data() { data() {
return { return {
selectedIndex:0, // selectedIndex: 0, //
item: "", // item: "", //
shipInfo: {}, // shipInfo: {}, //
title: "添加运费模板", // title: "添加运费模板", //
@ -195,6 +195,11 @@ export default {
}, },
}; };
}, },
computed: {
regions() {
return this.$store.state.regions;
},
},
methods: { methods: {
init() { init() {
this.getData(); this.getData();
@ -224,7 +229,7 @@ export default {
firstPrice: "", firstPrice: "",
continuedCompany: "1", continuedCompany: "1",
continuedPrice: "", continuedPrice: "",
selectedAll:false selectedAll: false,
}, },
], ],
}; };
@ -240,12 +245,24 @@ export default {
this.form = item; this.form = item;
}, },
// //
editRegion(item,index) { editRegion(item, index) {
this.selectedIndex = index this.selectedIndex = index;
this.item = item; this.item = item;
this.$store.state.shipTemplate = this.form.freightTemplateChildList this.regions.forEach((addr) => {
this.$refs.region.open(item,index); this.form.freightTemplateChildList.forEach((child) => {
child.area.split(",").forEach((area) => {
if (addr.name == area) {
addr.selectedAll = true;
this.$set(child, "selectedAll", true);
}
});
});
});
this.$store.state.shipTemplate = this.form.freightTemplateChildList;
this.$refs.region.open(item, index);
}, },
// //
refresh() { refresh() {
@ -273,9 +290,11 @@ export default {
if (child.selectedList != "") { if (child.selectedList != "") {
// //
if(child.selectedAll ){ if (child.selectedAll) {
area += child.name + "," area += child.name + ",";
this.form.freightTemplateChildList[this.selectedIndex].selectedAll = true this.form.freightTemplateChildList[
this.selectedIndex
].selectedAll = true;
} }
child.selectedList.forEach((son) => { child.selectedList.forEach((son) => {
@ -302,11 +321,16 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
const regNumber = /^\+?[1-9][0-9]*$/; const regNumber = /^\+?[1-9][0-9]*$/;
const regMoney = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; const regMoney =
/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
if (valid) { if (valid) {
if (this.form.pricingMethod != 'FREE') { if (this.form.pricingMethod != "FREE") {
// //
for (let i = 0; i < this.form.freightTemplateChildList.length; i++) { for (
let i = 0;
i < this.form.freightTemplateChildList.length;
i++
) {
if ( if (
this.form.freightTemplateChildList[i].area == "" || this.form.freightTemplateChildList[i].area == "" ||
this.form.freightTemplateChildList[i].firstCompany == "" || this.form.freightTemplateChildList[i].firstCompany == "" ||
@ -324,8 +348,9 @@ export default {
regNumber.test( regNumber.test(
this.form.freightTemplateChildList[i].continuedCompany this.form.freightTemplateChildList[i].continuedCompany
) == false || ) == false ||
regMoney.test(this.form.freightTemplateChildList[i].firstPrice) == regMoney.test(
false || this.form.freightTemplateChildList[i].firstPrice
) == false ||
regMoney.test( regMoney.test(
this.form.freightTemplateChildList[i].continuedPrice this.form.freightTemplateChildList[i].continuedPrice
) == false ) == false
@ -335,7 +360,6 @@ export default {
} }
} }
} }
if (this.operation == "ADD") { if (this.operation == "ADD") {
API_Shop.addShipTemplate(this.form, headers).then((res) => { API_Shop.addShipTemplate(this.form, headers).then((res) => {
@ -372,7 +396,7 @@ export default {
firstPrice: "", firstPrice: "",
continuedCompany: "1", continuedCompany: "1",
continuedPrice: "", continuedPrice: "",
selectedAll:false selectedAll: false,
}; };
this.form.freightTemplateChildList.push(params); this.form.freightTemplateChildList.push(params);
}, },