Merge branch 'master' into ma
|
@ -36,7 +36,7 @@ export function goodsSkuDetail (params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/buyer/goods/sku/${params.goodsId}/${params.skuId}`,
|
url: `/buyer/goods/sku/${params.goodsId}/${params.skuId}`,
|
||||||
method: Method.GET,
|
method: Method.GET,
|
||||||
needToken: false,
|
needToken: true,
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ export function getCateById (id) {
|
||||||
// 店铺入驻协议
|
// 店铺入驻协议
|
||||||
export function agreement () {
|
export function agreement () {
|
||||||
return request({
|
return request({
|
||||||
url: `/buyer/article/get/1349291301250293760`,
|
url: `/buyer/article/type/STORE_REGISTER`,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
method: Method.GET
|
method: Method.GET
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,26 +2,10 @@
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<ul class="location">
|
<ul class="location">
|
||||||
<li><router-link to="/" v-if="$route.path !== '/'" class="home-page" ><Icon type="md-home" />首页</router-link></li>
|
|
||||||
<li>
|
<li>
|
||||||
<Dropdown placement="bottom-start">
|
<router-link to="/" v-if="$route.path !== '/'" class="home-page">
|
||||||
<a href="javascript:void(0)">
|
<Icon type="md-home" />首页
|
||||||
<Icon type="ios-pin" class="icon"></Icon>
|
</router-link>
|
||||||
{{ city }}
|
|
||||||
</a>
|
|
||||||
<DropdownMenu slot="list">
|
|
||||||
<div class="city">
|
|
||||||
<p v-for="(items, index) in cityArr" :key="index">
|
|
||||||
<span
|
|
||||||
v-for="(item, index) in items"
|
|
||||||
class="city-item"
|
|
||||||
:key="index"
|
|
||||||
@click="changeCity(item)"
|
|
||||||
>{{ item }}</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</DropdownMenu>
|
|
||||||
</Dropdown>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="detail">
|
<ul class="detail">
|
||||||
|
@ -56,7 +40,7 @@
|
||||||
<li v-if="$route.name !== 'Cart'" style="position:relative;">
|
<li v-if="$route.name !== 'Cart'" style="position:relative;">
|
||||||
<i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i>
|
<i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i>
|
||||||
<Dropdown placement="bottom-start">
|
<Dropdown placement="bottom-start">
|
||||||
<router-link to="cart" target="_blank" >
|
<router-link to="/cart" target="_blank">
|
||||||
<span @mouseenter="getCartList">
|
<span @mouseenter="getCartList">
|
||||||
<Icon
|
<Icon
|
||||||
size="18"
|
size="18"
|
||||||
|
@ -74,12 +58,7 @@
|
||||||
<span>赶快去添加商品吧~</span>
|
<span>赶快去添加商品吧~</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
|
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
|
||||||
<div
|
<div class="shopping-cart-box" v-for="(item, index) in shoppingCart" @click="goToPay" :key="index">
|
||||||
class="shopping-cart-box"
|
|
||||||
v-for="(item, index) in shoppingCart"
|
|
||||||
@click="goToPay"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<div class="shopping-cart-img">
|
<div class="shopping-cart-img">
|
||||||
<img :src="item.goodsSku.thumbnail" class="hover-pointer" />
|
<img :src="item.goodsSku.thumbnail" class="hover-pointer" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -116,35 +95,28 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import storage from '@/plugins/storage.js';
|
import storage from "@/plugins/storage.js";
|
||||||
import {cartGoodsAll} from '@/api/cart.js'
|
import { cartGoodsAll } from "@/api/cart.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'M-Header',
|
name: "M-Header",
|
||||||
created() {
|
created() {
|
||||||
if (storage.getItem('userInfo')) {
|
if (storage.getItem("userInfo")) {
|
||||||
this.userInfo = JSON.parse(storage.getItem('userInfo'));
|
this.userInfo = JSON.parse(storage.getItem("userInfo"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 主题颜色切换
|
// 主题颜色切换
|
||||||
themeType: 'light',
|
themeType: "light",
|
||||||
city: '珠海', // 展示城市
|
|
||||||
cityArr: [
|
|
||||||
['北京', '上海', '天津', '重庆', '广州'],
|
|
||||||
['深圳', '河南', '辽宁', '吉林', '江苏'],
|
|
||||||
['江西', '四川', '海南', '贵州', '云南'],
|
|
||||||
['西藏', '陕西', '甘肃', '青海', '珠海']
|
|
||||||
],
|
|
||||||
userInfo: {}, // 用户信息
|
userInfo: {}, // 用户信息
|
||||||
shoppingCart: [] // 购物车
|
shoppingCart: [], // 购物车
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
cartNum() {
|
cartNum() {
|
||||||
return this.$store.state.cartNum
|
return this.$store.state.cartNum;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeCity (city) { // 选择所在城市
|
changeCity (city) { // 选择所在城市
|
||||||
|
@ -152,15 +124,15 @@ export default {
|
||||||
},
|
},
|
||||||
goToPay () { // 跳转购物车
|
goToPay () { // 跳转购物车
|
||||||
let url = this.$router.resolve({
|
let url = this.$router.resolve({
|
||||||
path: '/cart'
|
path: "/cart",
|
||||||
})
|
});
|
||||||
window.open(url.href, '_blank')
|
window.open(url.href, "_blank");
|
||||||
},
|
},
|
||||||
myInfo () { // 跳转会员中心
|
myInfo () { // 跳转会员中心
|
||||||
let url = this.$router.resolve({
|
let url = this.$router.resolve({
|
||||||
path: '/home'
|
path: "/home",
|
||||||
})
|
});
|
||||||
window.open(url.href, '_blank')
|
window.open(url.href, "_blank");
|
||||||
},
|
},
|
||||||
signOutFun () { // 退出登录
|
signOutFun () { // 退出登录
|
||||||
storage.removeItem('accessToken');
|
storage.removeItem('accessToken');
|
||||||
|
@ -170,49 +142,51 @@ export default {
|
||||||
this.$store.commit('SET_CARTNUM', 0)
|
this.$store.commit('SET_CARTNUM', 0)
|
||||||
this.$router.push('/login');
|
this.$router.push('/login');
|
||||||
},
|
},
|
||||||
goUserCenter (path) { // 跳转我的订单,我的足迹
|
goUserCenter(path) {
|
||||||
|
// 跳转我的订单,我的足迹
|
||||||
if (this.userInfo.username) {
|
if (this.userInfo.username) {
|
||||||
this.$router.push({path: path})
|
this.$router.push({ path: path });
|
||||||
} else {
|
} else {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '请登录',
|
title: "请登录",
|
||||||
content: '<p>请登录后执行此操作</p>',
|
content: "<p>请登录后执行此操作</p>",
|
||||||
okText: '立即登录',
|
okText: "立即登录",
|
||||||
cancelText: '继续浏览',
|
cancelText: "继续浏览",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/login',
|
path: "/login",
|
||||||
query: {
|
query: {
|
||||||
rePath: this.$router.history.current.path,
|
rePath: this.$router.history.current.path,
|
||||||
query: JSON.stringify(this.$router.history.current.query)
|
query: JSON.stringify(this.$router.history.current.query),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shopEntry () { // 店铺入驻
|
shopEntry() {
|
||||||
if (storage.getItem('accessToken')) {
|
// 店铺入驻
|
||||||
|
if (storage.getItem("accessToken")) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/shopEntry',
|
path: "/shopEntry",
|
||||||
query: {id: 1}
|
query: { id: 1 },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('login');
|
this.$router.push("login");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getCartList () { // 获取购物车列表
|
getCartList() {
|
||||||
|
// 获取购物车列表
|
||||||
if (this.userInfo.username) {
|
if (this.userInfo.username) {
|
||||||
|
cartGoodsAll().then((res) => {
|
||||||
cartGoodsAll().then(res => {
|
this.shoppingCart = res.result.skuList;
|
||||||
this.shoppingCart = res.result.skuList
|
this.$store.commit("SET_CARTNUM", this.shoppingCart.length);
|
||||||
this.$store.commit('SET_CARTNUM', this.shoppingCart.length)
|
this.Cookies.setItem("cartNum", this.shoppingCart.length);
|
||||||
this.Cookies.setItem('cartNum', this.shoppingCart.length)
|
});
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -253,7 +227,8 @@ export default {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.nav a,.nav-item {
|
.nav a,
|
||||||
|
.nav-item {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
|
@ -396,7 +371,6 @@ export default {
|
||||||
.sign-out p {
|
.sign-out p {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-title:hover {
|
.goods-title:hover {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,8 +69,8 @@ export default {
|
||||||
receiptContent: '不开发票', // 发票内容
|
receiptContent: '不开发票', // 发票内容
|
||||||
type: 1 // 1 个人 2 单位
|
type: 1 // 1 个人 2 单位
|
||||||
},
|
},
|
||||||
ruleInline: { // 验证规则
|
type: 1, // 1 个人 2 单位
|
||||||
receiptTitle: [{ required: true, message: '请填写公司名称' }],
|
ruleInline: {
|
||||||
taxpayerId: [
|
taxpayerId: [
|
||||||
{ required: true, message: '请填写纳税人识别号' },
|
{ required: true, message: '请填写纳税人识别号' },
|
||||||
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
|
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
|
||||||
|
@ -78,21 +78,11 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
props: ["invoiceData"],
|
||||||
save () { // 保存发票
|
watch: {
|
||||||
if (this.invoiceForm.type === 1) {
|
invoiceData: {
|
||||||
// 个人
|
handler(val) {
|
||||||
let flag = true;
|
this.invoiceForm = { ...val };
|
||||||
this.receiptItems.forEach((e) => {
|
|
||||||
if (
|
|
||||||
e.receiptTitle === '个人' &&
|
|
||||||
e.receiptContent === this.invoiceForm.receiptContent
|
|
||||||
) {
|
|
||||||
this.$emit('change', e);
|
|
||||||
flag = false;
|
|
||||||
this.invoiceAvailable = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
let params = {
|
let params = {
|
||||||
|
|
|
@ -93,6 +93,11 @@ export default {
|
||||||
getCategory(0).then(res => {
|
getCategory(0).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.cateList = res.result;
|
this.cateList = res.result;
|
||||||
|
// 过期时间
|
||||||
|
var expirationTime = new Date().setHours(new Date().getHours() + 1);
|
||||||
|
// 存放过期时间
|
||||||
|
localStorage.setItem('category_expiration_time', expirationTime);
|
||||||
|
// 存放分类信息
|
||||||
localStorage.setItem('category', JSON.stringify(res.result))
|
localStorage.setItem('category', JSON.stringify(res.result))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -117,7 +122,12 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
if (localStorage.getItem('category')) {
|
if (localStorage.getItem('category') && localStorage.getItem('category_expiration_time')) {
|
||||||
|
// 如果缓存过期,则获取最新的信息
|
||||||
|
if (new Date() > localStorage.getItem('category_expiration_time')) {
|
||||||
|
this.getCate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.cateList = JSON.parse(localStorage.getItem('category'))
|
this.cateList = JSON.parse(localStorage.getItem('category'))
|
||||||
} else {
|
} else {
|
||||||
this.getCate()
|
this.getCate()
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
已节省<span>{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span>
|
已节省<span>{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml_20 total-price">
|
<div class="ml_20 total-price">
|
||||||
总价(不含运费):<span>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</span>
|
总价(不含运费):<div>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pay ml_20" @click="pay">去结算</div>
|
<div class="pay ml_20" @click="pay">去结算</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -136,14 +136,14 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Promotion from '@/components/goodsDetail/Promotion'
|
import Promotion from "@/components/goodsDetail/Promotion";
|
||||||
import Search from '@/components/Search';
|
import Search from "@/components/Search";
|
||||||
import ShowLikeGoods from '@/components/like';
|
import ShowLikeGoods from "@/components/like";
|
||||||
import * as APICart from '@/api/cart';
|
import * as APICart from "@/api/cart";
|
||||||
import * as APIMember from '@/api/member';
|
import * as APIMember from "@/api/member";
|
||||||
import {getLogo} from '@/api/common.js'
|
import { getLogo } from "@/api/common.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'Cart',
|
name: "Cart",
|
||||||
beforeRouteEnter(to, from, next) {
|
beforeRouteEnter(to, from, next) {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
next();
|
next();
|
||||||
|
@ -151,11 +151,11 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
Search,
|
Search,
|
||||||
ShowLikeGoods,
|
ShowLikeGoods,
|
||||||
Promotion
|
Promotion,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
logoImg: '', // logo图
|
logoImg: "", // logo图
|
||||||
couponAvailable: false, // 展示优惠券
|
couponAvailable: false, // 展示优惠券
|
||||||
stepIndex: 0, // 当前处于哪一步,购物车==0,填写订单信息==1,成功提交订单==2
|
stepIndex: 0, // 当前处于哪一步,购物车==0,填写订单信息==1,成功提交订单==2
|
||||||
goodsTotal: 1, // 商品数量
|
goodsTotal: 1, // 商品数量
|
||||||
|
@ -165,7 +165,7 @@ export default {
|
||||||
cartList: [], // 购物车列表
|
cartList: [], // 购物车列表
|
||||||
couponList: [], // 优惠券列表
|
couponList: [], // 优惠券列表
|
||||||
priceDetailDTO: {}, // 价格明细
|
priceDetailDTO: {}, // 价格明细
|
||||||
skuList: [] // sku列表
|
skuList: [], // sku列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -173,33 +173,33 @@ export default {
|
||||||
// 跳转商品详情
|
// 跳转商品详情
|
||||||
goGoodsDetail(skuId, goodsId) {
|
goGoodsDetail(skuId, goodsId) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/goodsDetail',
|
path: "/goodsDetail",
|
||||||
query: { skuId, goodsId }
|
query: { skuId, goodsId },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
// 跳转店铺首页
|
// 跳转店铺首页
|
||||||
goShopPage(id) {
|
goShopPage(id) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/Merchant',
|
path: "/Merchant",
|
||||||
query: { id }
|
query: { id },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
// 收藏商品
|
// 收藏商品
|
||||||
collectGoods(id) {
|
collectGoods(id) {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '收藏',
|
title: "收藏",
|
||||||
content: '<p>商品收藏后可在个人中心我的收藏查看</p>',
|
content: "<p>商品收藏后可在个人中心我的收藏查看</p>",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
APIMember.collectGoods('GOODS', id).then((res) => {
|
APIMember.collectGoods("GOODS", id).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('收藏商品成功');
|
this.$Message.success("收藏商品成功");
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCancel: () => { }
|
onCancel: () => {},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 删除商品
|
// 删除商品
|
||||||
|
@ -216,42 +216,43 @@ export default {
|
||||||
idArr.push(id);
|
idArr.push(id);
|
||||||
}
|
}
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '删除',
|
title: "删除",
|
||||||
content: '<p>确定要删除该商品吗?</p>',
|
content: "<p>确定要删除该商品吗?</p>",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
APICart.delCartGoods({ skuIds: idArr.toString() }).then((res) => {
|
APICart.delCartGoods({ skuIds: idArr.toString() }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('删除成功');
|
this.$Message.success("删除成功");
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error(res.message);
|
this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
clearCart () { // 清空购物车
|
});
|
||||||
|
},
|
||||||
|
clearCart() {
|
||||||
|
// 清空购物车
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '提示',
|
title: "提示",
|
||||||
content: '<p>确定要清空购物车吗?清空后不可恢复</p>',
|
content: "<p>确定要清空购物车吗?清空后不可恢复</p>",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
APICart.clearCart().then((res) => {
|
APICart.clearCart().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('清空购物车成功');
|
this.$Message.success("清空购物车成功");
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error(res.message);
|
this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 跳转支付页面
|
// 跳转支付页面
|
||||||
pay() {
|
pay() {
|
||||||
if (this.checkedNum) {
|
if (this.checkedNum) {
|
||||||
this.$router.push({ path: '/pay', query: { way: 'CART' } });
|
this.$router.push({ path: "/pay", query: { way: "CART" } });
|
||||||
} else {
|
} else {
|
||||||
this.$Message.warning('请至少选择一件商品');
|
this.$Message.warning("请至少选择一件商品");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 展示优惠券
|
// 展示优惠券
|
||||||
|
@ -271,10 +272,10 @@ export default {
|
||||||
async changeChecked(status, type, id) {
|
async changeChecked(status, type, id) {
|
||||||
// 设置商品选中状态
|
// 设置商品选中状态
|
||||||
const check = status ? 1 : 0;
|
const check = status ? 1 : 0;
|
||||||
if (type === 'all') {
|
if (type === "all") {
|
||||||
// 全选
|
// 全选
|
||||||
await APICart.setCheckedAll({ checked: check });
|
await APICart.setCheckedAll({ checked: check });
|
||||||
} else if (type === 'shop') {
|
} else if (type === "shop") {
|
||||||
// 选中店铺所有商品
|
// 选中店铺所有商品
|
||||||
await APICart.setCheckedSeller({ checked: check, storeId: id });
|
await APICart.setCheckedSeller({ checked: check, storeId: id });
|
||||||
} else {
|
} else {
|
||||||
|
@ -285,13 +286,14 @@ export default {
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
},
|
},
|
||||||
|
|
||||||
async receiveShopCoupon (item) { // 领取优惠券
|
async receiveShopCoupon(item) {
|
||||||
let res = await APIMember.receiveCoupon(item.id)
|
// 领取优惠券
|
||||||
|
let res = await APIMember.receiveCoupon(item.id);
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$set(item, 'disabled', true)
|
this.$set(item, "disabled", true);
|
||||||
this.$Message.success('领取成功')
|
this.$Message.success("领取成功");
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error(res.message)
|
this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getCartList() {
|
async getCartList() {
|
||||||
|
@ -307,9 +309,9 @@ export default {
|
||||||
this.checkedNum = 0;
|
this.checkedNum = 0;
|
||||||
let allChecked = true;
|
let allChecked = true;
|
||||||
for (let k = 0; k < this.cartList.length; k++) {
|
for (let k = 0; k < this.cartList.length; k++) {
|
||||||
let shop = this.cartList[k]
|
let shop = this.cartList[k];
|
||||||
let list = await APIMember.couponList({storeId: shop.storeId})
|
let list = await APIMember.couponList({ storeId: shop.storeId });
|
||||||
shop.couponList.push(...list.result.records)
|
shop.couponList.push(...list.result.records);
|
||||||
}
|
}
|
||||||
for (let i = 0; i < this.skuList.length; i++) {
|
for (let i = 0; i < this.skuList.length; i++) {
|
||||||
if (this.skuList[i].checked) {
|
if (this.skuList[i].checked) {
|
||||||
|
@ -318,30 +320,31 @@ export default {
|
||||||
allChecked = false;
|
allChecked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$forceUpdate()
|
this.$forceUpdate();
|
||||||
this.allChecked = allChecked;
|
this.allChecked = allChecked;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
APICart.cartCount().then(res => { // 购物车商品数量
|
APICart.cartCount().then((res) => {
|
||||||
|
// 购物车商品数量
|
||||||
if (res.success) this.goodsTotal = res.result;
|
if (res.success) this.goodsTotal = res.result;
|
||||||
});
|
});
|
||||||
if (!this.Cookies.getItem('logo')) {
|
if (!this.Cookies.getItem("logo")) {
|
||||||
getLogo().then(res => {
|
getLogo().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let logoObj = JSON.parse(res.result.settingValue)
|
let logoObj = JSON.parse(res.result.settingValue);
|
||||||
this.Cookies.setItem('logo', logoObj.buyerSideLogo)
|
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.logoImg = this.Cookies.getItem('logo')
|
this.logoImg = this.Cookies.getItem("logo");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -572,7 +575,7 @@ export default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-left: -20px;
|
margin-left: -20px;
|
||||||
background-color: rgba($color: #999, $alpha: .5);
|
background-color: rgba($color: #999, $alpha: 0.5);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -603,7 +606,7 @@ export default {
|
||||||
.save-price span {
|
.save-price span {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.total-price span {
|
.total-price div {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
@ -664,7 +667,15 @@ export default {
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.cart-goods-footer > div{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.total-price{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.ivu-input-number-input {
|
.ivu-input-number-input {
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
<span @click="goAddressManage">管理收货人地址</span>
|
<span @click="goAddressManage">管理收货人地址</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="address-manage">
|
<div class="address-manage">
|
||||||
<div class="address-item" v-show="moreAddr ? true : index < 3" :class="selectedAddress.id === item.id?'border-red':''" @mouseenter="showEditBtn = index" @mouseleave="showEditBtn = ''" @click="selectAddress(item)" v-for="(item,index) in addressList" :key="index">
|
<div class="address-item" v-show="moreAddr ? true : index < 3" :class="selectedAddress.id === item.id?'border-red':''" @mouseenter="showEditBtn = index" @mouseleave="showEditBtn = ''"
|
||||||
|
@click="selectAddress(item)" v-for="(item,index) in addressList" :key="index">
|
||||||
<div>
|
<div>
|
||||||
<span>{{item.name}}</span>
|
<span>{{item.name}}</span>
|
||||||
<Tag class="ml_10" v-if="item.isDefault" color="red">默认</Tag>
|
<Tag class="ml_10" v-if="item.isDefault" color="red">默认</Tag>
|
||||||
|
@ -92,7 +93,9 @@
|
||||||
<!-- 发票信息 -->
|
<!-- 发票信息 -->
|
||||||
<div class="invoice">
|
<div class="invoice">
|
||||||
<div class="card-head mt_20 mb_20">
|
<div class="card-head mt_20 mb_20">
|
||||||
<span class="relative">发票信息<span class="inv-tips"><Icon type="ios-alert-outline" />开企业抬头发票须填写纳税人识别号,以免影响报销</span></span>
|
<span class="relative">发票信息<span class="inv-tips">
|
||||||
|
<Icon type="ios-alert-outline" />开企业抬头发票须填写纳税人识别号,以免影响报销
|
||||||
|
</span></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="inovice-content">
|
<div class="inovice-content">
|
||||||
<span>{{invoiceData.receiptTitle}}</span>
|
<span>{{invoiceData.receiptTitle}}</span>
|
||||||
|
@ -135,7 +138,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span>使用积分:</span><Input type="text" style="width:100px;" v-model.number="otherMsgForm.point" placeholder="请输入使用积分" /> <span style="color:#999;">您当前的可用积分为 {{otherMsgForm.totalPoint}} ,本订单最多可以使用{{otherMsgForm.availablePoint}}</span>
|
<span>使用积分:</span><Input type="text" style="width:100px;" v-model.number="otherMsgForm.point" placeholder="请输入使用积分" /> <span style="color:#999;">您当前的可用积分为 {{otherMsgForm.totalPoint}}
|
||||||
|
,本订单最多可以使用{{otherMsgForm.availablePoint}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -159,45 +163,56 @@
|
||||||
<!-- 底部支付栏 -->
|
<!-- 底部支付栏 -->
|
||||||
<div class="order-footer width_1200">
|
<div class="order-footer width_1200">
|
||||||
<div class="pay ml_20" @click="pay">提交订单</div>
|
<div class="pay ml_20" @click="pay">提交订单</div>
|
||||||
<div class="pay-address" v-if="addressList.length">配送至:{{ selectedAddress.consigneeAddressPath | unitAddress }} {{selectedAddress.detail}} 收货人:{{selectedAddress.name}} {{selectedAddress.mobile}}</div>
|
<div class="pay-address" v-if="addressList.length">配送至:{{ selectedAddress.consigneeAddressPath | unitAddress }}
|
||||||
|
{{selectedAddress.detail}} 收货人:{{selectedAddress.name}} {{selectedAddress.mobile}}</div>
|
||||||
</div>
|
</div>
|
||||||
<BaseFooter></BaseFooter>
|
<BaseFooter></BaseFooter>
|
||||||
<!-- 添加发票模态框 -->
|
<!-- 添加发票模态框 -->
|
||||||
<invoice-modal ref="invModal" @change="getInvMsg" />
|
<invoice-modal ref="invModal" :invoiceData="invoiceData" @change="getInvMsg" />
|
||||||
<!-- 选择地址模态框 -->
|
<!-- 选择地址模态框 -->
|
||||||
<address-manage ref="address" :id="addrId" @change="addrChange"></address-manage>
|
<address-manage ref="address" :id="addrId" @change="addrChange"></address-manage>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import invoiceModal from '@/components/invoiceModal';
|
import invoiceModal from "@/components/invoiceModal";
|
||||||
import addressManage from '@/components/addressManage';
|
import addressManage from "@/components/addressManage";
|
||||||
import {memberAddress, delMemberAddress} from '@/api/address';
|
import { memberAddress, delMemberAddress } from "@/api/address";
|
||||||
import {cartGoodsPay, createTrade, selectAddr, shippingMethod, receiptSelect, selectCoupon, couponNum} from '@/api/cart';
|
import {
|
||||||
import { canUseCouponList } from '@/api/member.js';
|
cartGoodsPay,
|
||||||
import {getLogo} from '@/api/common.js'
|
createTrade,
|
||||||
|
selectAddr,
|
||||||
|
shippingMethod,
|
||||||
|
selectCoupon,
|
||||||
|
couponNum,
|
||||||
|
} from "@/api/cart";
|
||||||
|
import { canUseCouponList } from "@/api/member.js";
|
||||||
|
import { getLogo } from "@/api/common.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'Pay',
|
name: "Pay",
|
||||||
components: { invoiceModal, addressManage },
|
components: { invoiceModal, addressManage },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
stepIndex: 1, // 顶部步骤条状态
|
stepIndex: 1, // 顶部步骤条状态
|
||||||
invoiceAvailable: false, // 发票编辑按钮
|
invoiceAvailable: false, // 发票编辑按钮
|
||||||
showEditBtn: '', // 鼠标移入显示编辑按钮
|
showEditBtn: "", // 鼠标移入显示编辑按钮
|
||||||
orderMark: '', // 订单备注
|
orderMark: "", // 订单备注
|
||||||
invoiceData: { // 发票数据
|
invoiceData: {
|
||||||
receiptTitle: '个人',
|
// 发票数据
|
||||||
receiptContent: '不开发票'
|
receiptTitle: "个人",
|
||||||
|
receiptContent: "不开发票",
|
||||||
},
|
},
|
||||||
otherMsgForm: { // 其他信息模块数据
|
otherMsgForm: {
|
||||||
|
// 其他信息模块数据
|
||||||
point: 0,
|
point: 0,
|
||||||
availablePoint: 10,
|
availablePoint: 10,
|
||||||
totalPoint: 100,
|
totalPoint: 100,
|
||||||
noGoods: 0
|
noGoods: 0,
|
||||||
},
|
},
|
||||||
deliveryList: [ // 物流
|
deliveryList: [
|
||||||
|
// 物流
|
||||||
// {value: 'SELF_PICK_UP', label: '自提'},
|
// {value: 'SELF_PICK_UP', label: '自提'},
|
||||||
{value: 'LOGISTICS', label: '物流'}
|
{ value: "LOGISTICS", label: "物流" },
|
||||||
// {value: 'LOCAL_TOWN_DELIVERY', label: '同城配送'}
|
// {value: 'LOCAL_TOWN_DELIVERY', label: '同城配送'}
|
||||||
],
|
],
|
||||||
addressList: [], // 地址列表
|
addressList: [], // 地址列表
|
||||||
|
@ -205,257 +220,277 @@ export default {
|
||||||
goodsList: [], // 商品列表
|
goodsList: [], // 商品列表
|
||||||
priceDetailDTO: {}, // 商品价格
|
priceDetailDTO: {}, // 商品价格
|
||||||
totalNum: 0, // 购买数量
|
totalNum: 0, // 购买数量
|
||||||
addrId: '', // 编辑地址传入的id
|
addrId: "", // 编辑地址传入的id
|
||||||
moreAddr: false, // 更多地址
|
moreAddr: false, // 更多地址
|
||||||
canUseCouponNum: 0, // 可用优惠券数量
|
canUseCouponNum: 0, // 可用优惠券数量
|
||||||
couponList: [], // 可用优惠券列表
|
couponList: [], // 可用优惠券列表
|
||||||
logoImg: '', // 平台logo
|
logoImg: "", // 平台logo
|
||||||
usedCouponId: [], // 已使用优惠券id
|
usedCouponId: [], // 已使用优惠券id
|
||||||
selectedCoupon: {} // 已选优惠券对象
|
selectedCoupon: {}, // 已选优惠券对象
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
if (!this.Cookies.getItem('logo')) {
|
if (!this.Cookies.getItem("logo")) {
|
||||||
getLogo().then(res => {
|
getLogo().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let logoObj = JSON.parse(res.result.settingValue)
|
let logoObj = JSON.parse(res.result.settingValue);
|
||||||
this.Cookies.setItem('logo', logoObj.buyerSideLogo)
|
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.logoImg = this.Cookies.getItem('logo')
|
this.logoImg = this.Cookies.getItem("logo");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.getGoodsDetail();
|
this.getGoodsDetail();
|
||||||
},
|
},
|
||||||
goAddressManage () { // 跳转地址管理页面
|
goAddressManage() {
|
||||||
this.$router.push('/home/MyAddress');
|
// 跳转地址管理页面
|
||||||
|
this.$router.push("/home/MyAddress");
|
||||||
},
|
},
|
||||||
getAddress () { // 获取收货地址列表
|
getAddress() {
|
||||||
memberAddress().then(res => {
|
// 获取收货地址列表
|
||||||
|
memberAddress().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.addressList = res.result.records;
|
this.addressList = res.result.records;
|
||||||
this.addressList.forEach((e, index) => {
|
this.addressList.forEach((e, index) => {
|
||||||
if (e.id === this.selectedAddress.id && index > 2) {
|
if (e.id === this.selectedAddress.id && index > 2) {
|
||||||
this.moreAddr = true
|
this.moreAddr = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getGoodsDetail () { // 订单商品详情
|
getGoodsDetail() {
|
||||||
|
// 订单商品详情
|
||||||
this.$Spin.show();
|
this.$Spin.show();
|
||||||
cartGoodsPay({way: this.$route.query.way}).then(res => {
|
cartGoodsPay({ way: this.$route.query.way })
|
||||||
|
.then((res) => {
|
||||||
this.$Spin.hide();
|
this.$Spin.hide();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.goodsList = res.result.cartList;
|
this.goodsList = res.result.cartList;
|
||||||
this.priceDetailDTO = res.result.priceDetailDTO;
|
this.priceDetailDTO = res.result.priceDetailDTO;
|
||||||
this.skuList = res.result.skuList;
|
this.skuList = res.result.skuList;
|
||||||
|
|
||||||
|
res.result.receiptVO
|
||||||
|
? (this.invoiceData = res.result.receiptVO)
|
||||||
|
: "";
|
||||||
|
|
||||||
let notSupArea = res.result.notSupportFreight;
|
let notSupArea = res.result.notSupportFreight;
|
||||||
this.selectedCoupon = {}
|
this.selectedCoupon = {};
|
||||||
if (res.result.platformCoupon) this.selectedCoupon.platformCoupon = res.result.platformCoupon
|
if (res.result.platformCoupon)
|
||||||
Object.assign(this.selectedCoupon, res.result.storeCoupons)
|
this.selectedCoupon.platformCoupon = res.result.platformCoupon;
|
||||||
|
Object.assign(this.selectedCoupon, res.result.storeCoupons);
|
||||||
if (notSupArea) {
|
if (notSupArea) {
|
||||||
let content = [];
|
let content = [];
|
||||||
let title = ''
|
let title = "";
|
||||||
notSupArea.forEach(e => {
|
notSupArea.forEach((e) => {
|
||||||
title = e.errorMessage
|
title = e.errorMessage;
|
||||||
content.push(e.goodsSku.goodsName)
|
content.push(e.goodsSku.goodsName);
|
||||||
})
|
});
|
||||||
this.$Modal.warning({
|
this.$Modal.warning({
|
||||||
title: '以下商品超出配送区域' || title,
|
title: "以下商品超出配送区域" || title,
|
||||||
content: content.toString()
|
content: content.toString(),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (res.result.memberAddress) {
|
if (res.result.memberAddress) {
|
||||||
this.selectedAddress = res.result.memberAddress
|
this.selectedAddress = res.result.memberAddress;
|
||||||
}
|
}
|
||||||
this.getAddress()
|
this.getAddress();
|
||||||
this.totalNum = 0;
|
this.totalNum = 0;
|
||||||
for (let i = 0; i < this.skuList.length; i++) {
|
for (let i = 0; i < this.skuList.length; i++) {
|
||||||
this.totalNum += this.skuList[i].num;
|
this.totalNum += this.skuList[i].num;
|
||||||
}
|
}
|
||||||
this.getCouponNum()
|
this.getCouponNum();
|
||||||
}
|
}
|
||||||
}).catch(() => { this.$Spin.hide() });
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$Spin.hide();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getCouponNum () { // 获取可用优惠券数量
|
getCouponNum() {
|
||||||
couponNum({way: this.$route.query.way}).then(res => {
|
// 获取可用优惠券数量
|
||||||
this.canUseCouponNum = res.result
|
couponNum({ way: this.$route.query.way }).then((res) => {
|
||||||
|
this.canUseCouponNum = res.result;
|
||||||
if (res.result) {
|
if (res.result) {
|
||||||
let storeArr = []
|
let storeArr = [];
|
||||||
let skuArr = []
|
let skuArr = [];
|
||||||
this.goodsList.forEach(e => {
|
this.goodsList.forEach((e) => {
|
||||||
storeArr.push(e.storeId)
|
storeArr.push(e.storeId);
|
||||||
e.skuList.forEach(i => {
|
e.skuList.forEach((i) => {
|
||||||
skuArr.push(i.goodsSku.id)
|
skuArr.push(i.goodsSku.id);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
let params = {
|
let params = {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
memberCouponStatus: 'NEW',
|
memberCouponStatus: "NEW",
|
||||||
scopeId: skuArr.toString(),
|
scopeId: skuArr.toString(),
|
||||||
storeId: storeArr.toString(),
|
storeId: storeArr.toString(),
|
||||||
totalPrice: this.priceDetailDTO.goodsPrice
|
totalPrice: this.priceDetailDTO.goodsPrice,
|
||||||
}
|
};
|
||||||
canUseCouponList(params).then(res => { // 可用优惠券列表
|
canUseCouponList(params).then((res) => {
|
||||||
if (res.success) this.couponList = res.result.records
|
// 可用优惠券列表
|
||||||
const couponKeys = Object.keys(this.selectedCoupon)
|
if (res.success) this.couponList = res.result.records;
|
||||||
this.usedCouponId = []
|
const couponKeys = Object.keys(this.selectedCoupon);
|
||||||
|
this.usedCouponId = [];
|
||||||
if (couponKeys.length) {
|
if (couponKeys.length) {
|
||||||
this.couponList.forEach(e => {
|
this.couponList.forEach((e) => {
|
||||||
if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) {
|
if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) {
|
||||||
this.usedCouponId.push(e.id)
|
this.usedCouponId.push(e.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$forceUpdate()
|
this.$forceUpdate();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
selectAddress (item) { // 选择地址
|
selectAddress(item) {
|
||||||
|
// 选择地址
|
||||||
let params = {
|
let params = {
|
||||||
way: this.$route.query.way,
|
way: this.$route.query.way,
|
||||||
shippingAddressId: item.id
|
shippingAddressId: item.id,
|
||||||
};
|
};
|
||||||
selectAddr(params).then(res => {
|
selectAddr(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('选择收货地址成功');
|
this.$Message.success("选择收货地址成功");
|
||||||
this.selectedAddress = item;
|
this.selectedAddress = item;
|
||||||
this.getGoodsDetail();
|
this.getGoodsDetail();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editAddress (id) { // 编辑地址
|
editAddress(id) {
|
||||||
|
// 编辑地址
|
||||||
this.addrId = id;
|
this.addrId = id;
|
||||||
this.$refs.address.show();
|
this.$refs.address.show();
|
||||||
},
|
},
|
||||||
addrChange (item) { // 添加,编辑地址回显
|
addrChange(item) {
|
||||||
|
// 添加,编辑地址回显
|
||||||
this.getAddress();
|
this.getAddress();
|
||||||
},
|
},
|
||||||
delAddress(item) {
|
delAddress(item) {
|
||||||
// 删除地址
|
// 删除地址
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '提示',
|
title: "提示",
|
||||||
content: '你确定删除这个收货地址',
|
content: "你确定删除这个收货地址",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
delMemberAddress(item.id).then((res) => {
|
delMemberAddress(item.id).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('删除成功');
|
this.$Message.success("删除成功");
|
||||||
this.getAddress();
|
this.getAddress();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCancel: () => {}
|
onCancel: () => {},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
goGoodsDetail(skuId, goodsId) {
|
||||||
|
// 跳转商品详情
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/goodsDetail',
|
path: "/goodsDetail",
|
||||||
query: { skuId, goodsId }
|
query: { skuId, goodsId },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
// 跳转店铺首页
|
// 跳转店铺首页
|
||||||
goShopPage(id) {
|
goShopPage(id) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/Merchant',
|
path: "/Merchant",
|
||||||
query: {id: id}
|
query: { id: id },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
selectDelivery (delivery) { // 选择配送方式
|
selectDelivery(delivery) {
|
||||||
|
// 选择配送方式
|
||||||
let params = {
|
let params = {
|
||||||
way: this.$route.query.way,
|
way: this.$route.query.way,
|
||||||
shippingMethod: delivery.value
|
shippingMethod: delivery.value,
|
||||||
};
|
};
|
||||||
shippingMethod(params).then(res => {
|
shippingMethod(params).then((res) => {});
|
||||||
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
useCoupon (id, used) { // 使用优惠券
|
useCoupon(id, used) {
|
||||||
|
// 使用优惠券
|
||||||
let params = {
|
let params = {
|
||||||
way: this.$route.query.way,
|
way: this.$route.query.way,
|
||||||
memberCouponId: id,
|
memberCouponId: id,
|
||||||
used: used // true 为使用, false为弃用
|
used: used, // true 为使用, false为弃用
|
||||||
}
|
};
|
||||||
selectCoupon(params).then(res => {
|
selectCoupon(params).then((res) => {
|
||||||
if (res.success) this.init()
|
if (res.success) this.init();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
editInvoice () { // 编辑发票信息
|
editInvoice() {
|
||||||
|
|
||||||
|
// 编辑发票信息
|
||||||
this.$refs.invModal.invoiceAvailable = true;
|
this.$refs.invModal.invoiceAvailable = true;
|
||||||
},
|
},
|
||||||
getInvMsg (item) { // 获取发票信息
|
getInvMsg(item) {
|
||||||
console.log(item);
|
// 获取发票信息
|
||||||
this.invoiceData = item;
|
if (item) {
|
||||||
this.selectReceipt(item.id)
|
this.init();
|
||||||
},
|
this.$refs.invModal.invoiceAvailable = false;
|
||||||
selectReceipt (id) { // 选择发票
|
|
||||||
let params = {
|
|
||||||
way: this.$route.query.way,
|
|
||||||
receiptId: id
|
|
||||||
}
|
}
|
||||||
receiptSelect(params).then(res => {
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
pay () { // 结算
|
|
||||||
|
pay() {
|
||||||
|
// 结算
|
||||||
const params = {
|
const params = {
|
||||||
client: 'PC',
|
client: "PC",
|
||||||
remark: [],
|
remark: [],
|
||||||
way: this.$route.query.way
|
way: this.$route.query.way,
|
||||||
};
|
};
|
||||||
this.goodsList.forEach(e => {
|
this.goodsList.forEach((e) => {
|
||||||
if (e.remark) {
|
if (e.remark) {
|
||||||
params.remark.push({
|
params.remark.push({
|
||||||
remark: e.remark,
|
remark: e.remark,
|
||||||
storeId: e.storeId
|
storeId: e.storeId,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
if (!params.remark.length) delete params.remark;
|
if (!params.remark.length) delete params.remark;
|
||||||
|
|
||||||
this.$Spin.show();
|
this.$Spin.show();
|
||||||
createTrade(params).then(res => {
|
createTrade(params)
|
||||||
|
.then((res) => {
|
||||||
this.$Spin.hide();
|
this.$Spin.hide();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$router.push({path: '/payment', query: {orderType: 'TRADE', sn: res.result.sn}});
|
this.$router.push({
|
||||||
|
path: "/payment",
|
||||||
|
query: { orderType: "TRADE", sn: res.result.sn },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
})
|
||||||
this.$Spin.hide()
|
.catch(() => {
|
||||||
|
this.$Spin.hide();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
useScope(type) {
|
useScope(type) {
|
||||||
let goods = '全部商品'
|
let goods = "全部商品";
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'ALL':
|
case "ALL":
|
||||||
goods = '全部商品'
|
goods = "全部商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS':
|
case "PORTION_GOODS":
|
||||||
goods = '部分商品'
|
goods = "部分商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS_CATEGORY':
|
case "PORTION_GOODS_CATEGORY":
|
||||||
goods = '部分分类商品'
|
goods = "部分分类商品";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return `${goods}可用`
|
return `${goods}可用`;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '../../assets/styles/coupon.scss';
|
@import "../../assets/styles/coupon.scss";
|
||||||
/** logo start */
|
/** logo start */
|
||||||
.logo {
|
.logo {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
@ -596,7 +631,9 @@ export default {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
.ivu-icon {
|
.ivu-icon {
|
||||||
color: #ff8f23;
|
color: #ff8f23;
|
||||||
&:hover {color: $theme_color;}
|
&:hover {
|
||||||
|
color: $theme_color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
> span:nth-child(2) {
|
> span:nth-child(2) {
|
||||||
|
@ -636,7 +673,9 @@ export default {
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
margin: 0 20px;
|
margin: 0 20px;
|
||||||
border-bottom: 1px dotted #999;
|
border-bottom: 1px dotted #999;
|
||||||
&:last-child{border:none;}
|
&:last-child {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
img {
|
img {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
@ -672,9 +711,9 @@ export default {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
margin: 0 0 0 10px;
|
margin: 0 0 0 10px;
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
box-shadow: 0 0 3px rgba(0,0,0,.15);
|
box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
|
||||||
&::before {
|
&::before {
|
||||||
content: '';
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 17px;
|
height: 17px;
|
||||||
|
@ -697,7 +736,9 @@ export default {
|
||||||
> span:last-child {
|
> span:last-child {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
&:hover{border-bottom: 1px solid $theme_color;}
|
&:hover {
|
||||||
|
border-bottom: 1px solid $theme_color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -771,7 +812,9 @@ export default {
|
||||||
background: $theme_color;
|
background: $theme_color;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
}
|
}
|
||||||
.pay-address{font-size: 12px;}
|
.pay-address {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
.more-addr {
|
.more-addr {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
@ -787,10 +830,11 @@ export default {
|
||||||
padding: 10px 7px;
|
padding: 10px 7px;
|
||||||
}
|
}
|
||||||
b {
|
b {
|
||||||
background: url('../../assets/images/small-circle.png') top left repeat-y;
|
background: url("../../assets/images/small-circle.png") top left repeat-y;
|
||||||
right: 28px;
|
right: 28px;
|
||||||
}
|
}
|
||||||
.circle-top,.circle-bottom{
|
.circle-top,
|
||||||
|
.circle-bottom {
|
||||||
right: 22px;
|
right: 22px;
|
||||||
}
|
}
|
||||||
.used {
|
.used {
|
||||||
|
|
|
@ -9,23 +9,11 @@
|
||||||
<Step title="其他信息"></Step>
|
<Step title="其他信息"></Step>
|
||||||
<Step title="提交审核"></Step>
|
<Step title="提交审核"></Step>
|
||||||
</Steps>
|
</Steps>
|
||||||
<first-apply
|
<first-apply v-if="currentIndex == 0 && dataReview" :content="firstData" @change="nextPage"></first-apply>
|
||||||
v-if="currentIndex == 0 && dataReview"
|
|
||||||
:content="firstData"
|
|
||||||
@change="nextPage"
|
|
||||||
></first-apply>
|
|
||||||
|
|
||||||
<second-apply
|
<second-apply v-if="currentIndex == 1 && dataReview" :content="secondData" @change="nextPage"></second-apply>
|
||||||
v-if="currentIndex == 1 && dataReview"
|
|
||||||
:content="secondData"
|
|
||||||
@change="nextPage"
|
|
||||||
></second-apply>
|
|
||||||
|
|
||||||
<third-apply
|
<third-apply v-if="currentIndex == 2 && dataReview" :content="thirdData" @change="nextPage"></third-apply>
|
||||||
v-if="currentIndex == 2 && dataReview"
|
|
||||||
:content="thirdData"
|
|
||||||
@change="nextPage"
|
|
||||||
></third-apply>
|
|
||||||
|
|
||||||
<div class="success-page" v-if="currentIndex == 3">
|
<div class="success-page" v-if="currentIndex == 3">
|
||||||
<span v-if="storeDisable == '' || storeDisable == 'APPLYING'">入驻申请提交成功,等待平台审核</span>
|
<span v-if="storeDisable == '' || storeDisable == 'APPLYING'">入驻申请提交成功,等待平台审核</span>
|
||||||
|
@ -37,59 +25,48 @@
|
||||||
<Button type="primary" @click='currentIndex = 0' v-if="storeDisable === 'REFUSED' && currentIndex === 3">重新申请</Button>
|
<Button type="primary" @click='currentIndex = 0' v-if="storeDisable === 'REFUSED' && currentIndex === 3">重新申请</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal
|
<Modal title="店铺入驻协议" v-model="showAgreement" width="1200" :closable="false" :mask-closable="false">
|
||||||
title="店铺入驻协议"
|
|
||||||
v-model="showAgreement"
|
|
||||||
width="1200"
|
|
||||||
:closable="false"
|
|
||||||
:mask-closable="false"
|
|
||||||
>
|
|
||||||
<div class="agreeent-con" v-html="agreementCon"></div>
|
<div class="agreeent-con" v-html="agreementCon"></div>
|
||||||
|
|
||||||
<div slot="footer" style="text-align: center">
|
<div slot="footer" style="text-align: center">
|
||||||
<p><Checkbox v-model="checked">我已同意以上协议</Checkbox></p>
|
<p>
|
||||||
<Button
|
<Checkbox v-model="checked">我已同意以上协议</Checkbox>
|
||||||
type="primary"
|
</p>
|
||||||
:disabled="!checked"
|
<Button type="primary" :disabled="!checked" class="margin" @click="showAgreement = false">同意协议填写资质信息</Button>
|
||||||
class="margin"
|
|
||||||
@click="showAgreement = false"
|
|
||||||
>同意协议填写资质信息</Button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { agreement, applyStatus } from '@/api/shopentry';
|
import { agreement, applyStatus } from "@/api/shopentry";
|
||||||
import firstApply from './first-apply';
|
import firstApply from "./first-apply";
|
||||||
import secondApply from './second-apply';
|
import secondApply from "./second-apply";
|
||||||
import thirdApply from './third-apply';
|
import thirdApply from "./third-apply";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
firstApply,
|
firstApply,
|
||||||
secondApply,
|
secondApply,
|
||||||
thirdApply
|
thirdApply,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentIndex: 0, // 当前步骤
|
currentIndex: 0, // 当前步骤
|
||||||
showAgreement: false, // 协议显示
|
showAgreement: false, // 协议显示
|
||||||
agreementCon: '', // 协议内容
|
agreementCon: "", // 协议内容
|
||||||
checked: false, // 选中协议
|
checked: false, // 选中协议
|
||||||
applyData: {}, // 申请数据
|
applyData: {}, // 申请数据
|
||||||
firstData: {}, // 第一步数据
|
firstData: {}, // 第一步数据
|
||||||
secondData: {}, // 第二步数据
|
secondData: {}, // 第二步数据
|
||||||
thirdData: {}, // 第三步数据
|
thirdData: {}, // 第三步数据
|
||||||
storeDisable: '', // APPLY OPEN 开店中 CLOSED 关闭 REFUSED 拒绝 APPLYING 申请中,审核
|
storeDisable: "", // APPLY OPEN 开店中 CLOSED 关闭 REFUSED 拒绝 APPLYING 申请中,审核
|
||||||
dataReview: true // 根据接口返回判断是否可展示数据
|
dataReview: true, // 根据接口返回判断是否可展示数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getArticle() {
|
getArticle() {
|
||||||
// 入驻协议
|
// 入驻协议
|
||||||
agreement().then((res) => {
|
agreement().then((res) => {
|
||||||
console.log(res);
|
this.agreementCon = res.result.content;
|
||||||
this.agreementCon = res.result;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getData() {
|
getData() {
|
||||||
|
@ -101,34 +78,34 @@ export default {
|
||||||
this.dataReview = false;
|
this.dataReview = false;
|
||||||
let data = res.result;
|
let data = res.result;
|
||||||
let first = [
|
let first = [
|
||||||
'addressIdPath',
|
"addressIdPath",
|
||||||
'addressPath',
|
"addressPath",
|
||||||
'companyAddress',
|
"companyAddress",
|
||||||
'companyEmail',
|
"companyEmail",
|
||||||
'companyName',
|
"companyName",
|
||||||
'employeeNum',
|
"employeeNum",
|
||||||
'legalId',
|
"legalId",
|
||||||
'legalName',
|
"legalName",
|
||||||
'licencePhoto',
|
"licencePhoto",
|
||||||
'legalPhoto',
|
"legalPhoto",
|
||||||
'licenseNum',
|
"licenseNum",
|
||||||
'linkName',
|
"linkName",
|
||||||
'linkPhone',
|
"linkPhone",
|
||||||
'registeredCapital',
|
"registeredCapital",
|
||||||
'scope'
|
"scope",
|
||||||
];
|
];
|
||||||
let second = [
|
let second = [
|
||||||
'settlementBankAccountName',
|
"settlementBankAccountName",
|
||||||
'settlementBankAccountNum',
|
"settlementBankAccountNum",
|
||||||
'settlementBankBranchName',
|
"settlementBankBranchName",
|
||||||
'settlementBankJointName'
|
"settlementBankJointName",
|
||||||
];
|
];
|
||||||
let third = [
|
let third = [
|
||||||
'goodsManagementCategory',
|
"goodsManagementCategory",
|
||||||
'storeCenter',
|
"storeCenter",
|
||||||
'storeDesc',
|
"storeDesc",
|
||||||
'storeLogo',
|
"storeLogo",
|
||||||
'storeName'
|
"storeName",
|
||||||
];
|
];
|
||||||
|
|
||||||
this.storeDisable = data.storeDisable;
|
this.storeDisable = data.storeDisable;
|
||||||
|
@ -143,7 +120,7 @@ export default {
|
||||||
this.thirdData[e] = data[e];
|
this.thirdData[e] = data[e];
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.storeDisable === 'APPLY') {
|
if (this.storeDisable === "APPLY") {
|
||||||
this.currentIndex = 0;
|
this.currentIndex = 0;
|
||||||
} else {
|
} else {
|
||||||
this.currentIndex = 3;
|
this.currentIndex = 3;
|
||||||
|
@ -156,11 +133,12 @@ export default {
|
||||||
},
|
},
|
||||||
nextPage(step) {
|
nextPage(step) {
|
||||||
this.currentIndex = step;
|
this.currentIndex = step;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
this.getArticle();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<div class="user-img">
|
<div class="user-img">
|
||||||
<img :src="userInfo.face" />
|
<img :src="userInfo.face" />
|
||||||
</div>
|
</div>
|
||||||
<p>{{userInfo.username | secrecyMobile}}</p>
|
<p>{{userInfo.nickName}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 循环导航栏 -->
|
<!-- 循环导航栏 -->
|
||||||
|
|
|
@ -1,43 +1,48 @@
|
||||||
// import Vue from 'vue';
|
// import Vue from 'vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import {
|
import { Message, Spin, Modal } from 'view-design';
|
||||||
Message,
|
|
||||||
Spin,
|
|
||||||
Modal
|
|
||||||
} from 'view-design';
|
|
||||||
import Storage from './storage';
|
import Storage from './storage';
|
||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
import router from '../router/index.js';
|
import router from '../router/index.js';
|
||||||
import store from '../vuex/store';
|
import store from '../vuex/store';
|
||||||
import {
|
import { handleRefreshToken } from '@/api/index';
|
||||||
handleRefreshToken
|
|
||||||
} from '@/api/index';
|
|
||||||
const qs = require('qs');
|
const qs = require('qs');
|
||||||
|
export const buyerUrl =
|
||||||
export const buyerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.buyer : config.api_prod.buyer);
|
process.env.NODE_ENV === 'development'
|
||||||
export const commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common);
|
? config.api_dev.buyer
|
||||||
export const managerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.manager : config.api_prod.manager);
|
: config.api_prod.buyer;
|
||||||
export const sellerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.seller : config.api_prod.seller);
|
export const commonUrl =
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? config.api_dev.common
|
||||||
|
: config.api_prod.common;
|
||||||
|
export const managerUrl =
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? config.api_dev.manager
|
||||||
|
: config.api_prod.manager;
|
||||||
|
export const sellerUrl =
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? config.api_dev.seller
|
||||||
|
: config.api_prod.seller;
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
var isRefreshToken = 0;
|
var isRefreshToken = 0;
|
||||||
const refreshToken = getTokenDebounce()
|
const refreshToken = getTokenDebounce();
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
timeout: 10000, // 请求超时时间
|
timeout: 10000, // 请求超时时间
|
||||||
baseURL: buyerUrl, // API
|
baseURL: buyerUrl, // API
|
||||||
httpsAgent: new https.Agent({
|
httpsAgent: new https.Agent({
|
||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
}),
|
}),
|
||||||
paramsSerializer: params => qs.stringify(params, {
|
paramsSerializer: params =>
|
||||||
|
qs.stringify(params, {
|
||||||
arrayFormat: 'repeat'
|
arrayFormat: 'repeat'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
// request拦截器
|
// request拦截器
|
||||||
service.interceptors.request.use(config => {
|
service.interceptors.request.use(
|
||||||
const {
|
config => {
|
||||||
loading
|
const { loading } = config;
|
||||||
} = config;
|
|
||||||
// 如果是put/post请求,用qs.stringify序列化参数
|
// 如果是put/post请求,用qs.stringify序列化参数
|
||||||
const isPutPost = config.method === 'put' || config.method === 'post';
|
const isPutPost = config.method === 'put' || config.method === 'post';
|
||||||
const isJson = config.headers['Content-Type'] === 'application/json';
|
const isJson = config.headers['Content-Type'] === 'application/json';
|
||||||
|
@ -62,42 +67,40 @@ service.interceptors.request.use(config => {
|
||||||
let accessToken = Storage.getItem('accessToken');
|
let accessToken = Storage.getItem('accessToken');
|
||||||
if (accessToken && config.needToken) {
|
if (accessToken && config.needToken) {
|
||||||
config.headers['accessToken'] = accessToken;
|
config.headers['accessToken'] = accessToken;
|
||||||
|
// 解析当前token时间
|
||||||
|
let jwtData = JSON.parse(
|
||||||
|
decodeURIComponent(escape(window.atob(accessToken.split('.')[1].replace(/-/g, '+').replace(/_/g, '/'))))
|
||||||
|
);
|
||||||
|
if (jwtData.exp < Math.round(new Date() / 1000)) {
|
||||||
|
refresh()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}, error => {
|
|
||||||
Promise.reject(error);
|
|
||||||
});
|
|
||||||
|
|
||||||
// respone拦截器
|
|
||||||
service.interceptors.response.use(
|
|
||||||
async response => {
|
|
||||||
await closeLoading(response);
|
|
||||||
return response.data;
|
|
||||||
},
|
},
|
||||||
async error => {
|
error => {
|
||||||
if (process.server) return Promise.reject(error);
|
Promise.reject(error);
|
||||||
await closeLoading(error);
|
}
|
||||||
const errorResponse = error.response || {};
|
);
|
||||||
const errorData = errorResponse.data || {};
|
|
||||||
|
|
||||||
if (errorResponse.status === 403) {
|
async function refresh () {
|
||||||
isRefreshToken++;
|
|
||||||
|
|
||||||
if (isRefreshToken === 1) {
|
|
||||||
const getTokenRes = await refreshToken();
|
const getTokenRes = await refreshToken();
|
||||||
if (getTokenRes === 'success') { // 刷新token
|
if (getTokenRes === 'success') {
|
||||||
|
// 刷新token
|
||||||
if (isRefreshToken === 1) {
|
if (isRefreshToken === 1) {
|
||||||
error.response.config.headers.accessToken = Storage.getItem('accessToken')
|
error.response.config.headers.accessToken = Storage.getItem(
|
||||||
return service(error.response.config)
|
'accessToken'
|
||||||
|
);
|
||||||
|
return service(error.response.config);
|
||||||
} else {
|
} else {
|
||||||
router.go(0)
|
router.go(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Storage.removeItem('accessToken');
|
Storage.removeItem('accessToken');
|
||||||
Storage.removeItem('refreshToken');
|
Storage.removeItem('refreshToken');
|
||||||
Storage.removeItem('userInfo');
|
Storage.removeItem('userInfo');
|
||||||
Storage.setItem('cartNum', 0)
|
Storage.setItem('cartNum', 0);
|
||||||
store.commit('SET_CARTNUM', 0)
|
store.commit('SET_CARTNUM', 0);
|
||||||
console.log('1111');
|
console.log('1111');
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '请登录',
|
title: '请登录',
|
||||||
|
@ -118,11 +121,34 @@ service.interceptors.response.use(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
isRefreshToken = 0
|
}
|
||||||
|
|
||||||
|
// respone拦截器
|
||||||
|
service.interceptors.response.use(
|
||||||
|
async response => {
|
||||||
|
await closeLoading(response);
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
},
|
||||||
|
async error => {
|
||||||
|
if (process.server) return Promise.reject(error);
|
||||||
|
await closeLoading(error);
|
||||||
|
const errorResponse = error.response || {};
|
||||||
|
const errorData = errorResponse.data || {};
|
||||||
|
|
||||||
|
if (errorResponse.status === 403) {
|
||||||
|
isRefreshToken++;
|
||||||
|
|
||||||
|
if (isRefreshToken === 1) {
|
||||||
|
refresh()
|
||||||
|
isRefreshToken = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (error.message) {
|
if (error.message) {
|
||||||
let _message = error.code === 'ECONNABORTED' ? '连接超时,请稍候再试!' : '网络错误,请稍后再试!';
|
let _message =
|
||||||
|
error.code === 'ECONNABORTED'
|
||||||
|
? '连接超时,请稍候再试!'
|
||||||
|
: '网络错误,请稍后再试!';
|
||||||
Message.error(errorData.message || _message);
|
Message.error(errorData.message || _message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,7 +160,7 @@ service.interceptors.response.use(
|
||||||
* 关闭全局加载
|
* 关闭全局加载
|
||||||
* @param target
|
* @param target
|
||||||
*/
|
*/
|
||||||
const closeLoading = (target) => {
|
const closeLoading = target => {
|
||||||
if (!target.config || !target.config.loading) return true;
|
if (!target.config || !target.config.loading) return true;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -161,46 +187,45 @@ export default function request (options) {
|
||||||
|
|
||||||
// 防抖闭包来一波
|
// 防抖闭包来一波
|
||||||
function getTokenDebounce () {
|
function getTokenDebounce () {
|
||||||
let lock = false
|
let lock = false;
|
||||||
let success = false
|
let success = false;
|
||||||
return function () {
|
return function () {
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
lock = true
|
lock = true;
|
||||||
let oldRefreshToken = Storage.getItem('refreshToken');
|
let oldRefreshToken = Storage.getItem('refreshToken');
|
||||||
handleRefreshToken(oldRefreshToken).then(res => {
|
handleRefreshToken(oldRefreshToken)
|
||||||
|
.then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let {
|
let { accessToken, refreshToken } = res.result;
|
||||||
accessToken,
|
|
||||||
refreshToken
|
|
||||||
} = res.result;
|
|
||||||
Storage.setItem('accessToken', accessToken);
|
Storage.setItem('accessToken', accessToken);
|
||||||
Storage.setItem('refreshToken', refreshToken);
|
Storage.setItem('refreshToken', refreshToken);
|
||||||
|
|
||||||
success = true
|
success = true;
|
||||||
lock = false
|
lock = false;
|
||||||
} else {
|
} else {
|
||||||
success = false
|
success = false;
|
||||||
lock = false
|
lock = false;
|
||||||
// router.push('/login')
|
// router.push('/login')
|
||||||
}
|
}
|
||||||
}).catch((err) => {
|
|
||||||
console.log(err);
|
|
||||||
success = false
|
|
||||||
lock = false
|
|
||||||
})
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
success = false;
|
||||||
|
lock = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// 一直看lock,直到请求失败或者成功
|
// 一直看lock,直到请求失败或者成功
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
clearInterval(timer)
|
clearInterval(timer);
|
||||||
if (success) {
|
if (success) {
|
||||||
resolve('success')
|
resolve('success');
|
||||||
} else {
|
} else {
|
||||||
resolve('fail')
|
resolve('fail');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 500) // 轮询时间间隔
|
}, 500); // 轮询时间间隔
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,21 @@ import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios'
|
||||||
export const getManagerBrandPage = (params) => {
|
export const getManagerBrandPage = (params) => {
|
||||||
return getRequest('/goods/brand/getByPage', params)
|
return getRequest('/goods/brand/getByPage', params)
|
||||||
}
|
}
|
||||||
// 添加或修改品牌设置
|
|
||||||
|
// 批量删除
|
||||||
|
export const delBrand = (ids) =>{
|
||||||
|
return deleteRequest(`/goods/brand/delByIds/${ids}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 添加
|
||||||
export const addBrand = (params) => {
|
export const addBrand = (params) => {
|
||||||
return postRequest('/goods/brand', params)
|
return postRequest('/goods/brand', params)
|
||||||
}
|
}
|
||||||
|
// 修改品牌设置
|
||||||
|
export const updateBrand = (params) => {
|
||||||
|
return putRequest(`/goods/brand/${params.id}`, params)
|
||||||
|
}
|
||||||
// 禁用品牌
|
// 禁用品牌
|
||||||
export const disableBrand = (id, params) => {
|
export const disableBrand = (id, params) => {
|
||||||
return putRequest(`/goods/brand/disable/${id}`, params)
|
return putRequest(`/goods/brand/disable/${id}`, params)
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const getPromotionSeckill = params => {
|
||||||
|
|
||||||
// 是否推荐直播间
|
// 是否推荐直播间
|
||||||
export const whetherStar = params => {
|
export const whetherStar = params => {
|
||||||
return getRequest(`/broadcast/studio/id/${params.id}&recommend=${params.recommend}`);
|
return putRequest(`/broadcast/studio/recommend/${params.id}`,params);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加优惠券活动
|
// 添加优惠券活动
|
||||||
|
@ -119,8 +119,8 @@ export const getCouponActivityList = params => {
|
||||||
return getRequest("/promotion/couponActivity", params);
|
return getRequest("/promotion/couponActivity", params);
|
||||||
};
|
};
|
||||||
// 作废优惠券
|
// 作废优惠券
|
||||||
export const deleteCouponActivity = ids => {
|
export const closeActivity = id => {
|
||||||
return deleteRequest(`/promotion/couponActivity/${ids}`);
|
return deleteRequest(`/promotion/couponActivity/${id}`);
|
||||||
};
|
};
|
||||||
// 更新优惠券活动
|
// 更新优惠券活动
|
||||||
export const updateCouponActivity = params => {
|
export const updateCouponActivity = params => {
|
||||||
|
|
|
@ -21,10 +21,10 @@ export default {
|
||||||
// buyer: "https://buyer-api.pickmall.cn",
|
// buyer: "https://buyer-api.pickmall.cn",
|
||||||
// seller: "https://store-api.pickmall.cn",
|
// seller: "https://store-api.pickmall.cn",
|
||||||
// manager: "https://admin-api.pickmall.cn"
|
// manager: "https://admin-api.pickmall.cn"
|
||||||
common: 'http://192.168.0.100:8890',
|
common: 'http://192.168.0.109:8890',
|
||||||
buyer: 'http://192.168.0.100:8888',
|
buyer: 'http://192.168.0.109:8888',
|
||||||
seller: 'http://192.168.0.100:8889',
|
seller: 'http://192.168.0.109:8889',
|
||||||
manager: 'http://192.168.0.100:8887'
|
manager: 'http://192.168.0.109:8887'
|
||||||
},
|
},
|
||||||
api_prod: {
|
api_prod: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
|
|
|
@ -251,10 +251,16 @@ export const otherRouter = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "coupon-activity/edit",
|
path: "coupon-activity/edit",
|
||||||
title: "编辑平台优惠券",
|
title: "编辑平台优惠券活动",
|
||||||
name: "edit-coupon-activity",
|
name: "edit-coupon-activity",
|
||||||
component: () => import("@/views/promotion/couponActivity/couponPublish.vue")
|
component: () => import("@/views/promotion/couponActivity/couponPublish.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "promotion/coupon-activity-info",
|
||||||
|
title: "券活动详情",
|
||||||
|
name: "coupon-activity-info",
|
||||||
|
component: () => import("@/views/promotion/couponActivity/couponInfo.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "promotion/member-receive-coupon",
|
path: "promotion/member-receive-coupon",
|
||||||
title: "领取详情",
|
title: "领取详情",
|
||||||
|
@ -332,7 +338,7 @@ export const otherRouter = {
|
||||||
path: "liveDetail",
|
path: "liveDetail",
|
||||||
title: "查看直播",
|
title: "查看直播",
|
||||||
name: "liveDetail",
|
name: "liveDetail",
|
||||||
component: () => import("@/views/live/liveDetail.vue")
|
component: () => import("@/views/promotion/live/liveDetail.vue")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -147,21 +147,13 @@ export default {
|
||||||
sortable: false,
|
sortable: false,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.distributionStatus == "PASS") {
|
if (params.row.distributionStatus == "PASS") {
|
||||||
return h("Badge", {
|
return h("Tag", {props: {color: "green",},},"通过");
|
||||||
props: { status: "success", text: "审核通过" },
|
|
||||||
});
|
|
||||||
} else if (params.row.distributionStatus == "APPLY") {
|
} else if (params.row.distributionStatus == "APPLY") {
|
||||||
return h("Badge", {
|
return h("Tag", {props: {color: "geekblue",},},"待审核");
|
||||||
props: { status: "processing", text: "申请中" },
|
|
||||||
});
|
|
||||||
} else if (params.row.distributionStatus == "RETREAT") {
|
} else if (params.row.distributionStatus == "RETREAT") {
|
||||||
return h("Badge", {
|
return h("Tag", {props: {color: "volcano",},},"清退");
|
||||||
props: { status: "warning", text: "已清退" },
|
|
||||||
});
|
|
||||||
} else if (params.row.distributionStatus == "REFUSE") {
|
} else if (params.row.distributionStatus == "REFUSE") {
|
||||||
return h("Badge", {
|
return h("Tag", {props: {color: "red",},},"拒绝");
|
||||||
props: { status: "error", text: "审核拒绝" },
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -38,6 +38,12 @@
|
||||||
<Option value="DOWN">下架</Option>
|
<Option value="DOWN">下架</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
<Form-item label="商品类型" prop="status">
|
||||||
|
<Select v-model="searchForm.goodsType" placeholder="请选择" clearable style="width: 200px">
|
||||||
|
<Option value="PHYSICAL_GOODS">实物商品</Option>
|
||||||
|
<Option value="VIRTUAL_GOODS">虚拟商品</Option>
|
||||||
|
</Select>
|
||||||
|
</Form-item>
|
||||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button>
|
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -174,29 +180,29 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "商品类型",
|
||||||
|
key: "goodsType",
|
||||||
|
width: 130,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.goodsType === 'PHYSICAL_GOODS') {
|
||||||
|
return h("Tag", {props: {color: "green",},}, "实物商品");
|
||||||
|
} else if (params.row.goodsType === 'VIRTUAL_GOODS') {
|
||||||
|
return h("Tag", {props: {color: "volcano",},}, "虚拟商品");
|
||||||
|
} else {
|
||||||
|
return h("Tag", {props: {color: "geekblue",},}, "电子卡券");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "状态",
|
title: "状态",
|
||||||
key: "marketEnable",
|
key: "marketEnable",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.marketEnable == "DOWN") {
|
if (params.row.marketEnable == "DOWN") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "green"},},"上架");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "下架",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.marketEnable == "UPPER") {
|
} else if (params.row.marketEnable == "UPPER") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "volcano",},},"下架");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "success",
|
|
||||||
text: "上架",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -206,36 +212,14 @@ export default {
|
||||||
width: 130,
|
width: 130,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.isAuth == "TOBEAUDITED") {
|
if (params.row.isAuth == "TOBEAUDITED") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "volcano",},},"待审核");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "待审核",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.isAuth == "PASS") {
|
} else if (params.row.isAuth == "PASS") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "green"},},"通过");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "success",
|
|
||||||
text: "审核通过",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.isAuth == "REFUSE") {
|
} else if (params.row.isAuth == "REFUSE") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "red",},},"拒绝");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "审核拒绝",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "店铺名称",
|
title: "店铺名称",
|
||||||
key: "storeName",
|
key: "storeName",
|
||||||
|
|
|
@ -5,21 +5,9 @@
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<Card>
|
<Card>
|
||||||
<Row @keydown.enter.native="handleSearch">
|
<Row @keydown.enter.native="handleSearch">
|
||||||
<Form
|
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||||
ref="searchForm"
|
|
||||||
:model="searchForm"
|
|
||||||
inline
|
|
||||||
:label-width="70"
|
|
||||||
class="search-form"
|
|
||||||
>
|
|
||||||
<Form-item label="品牌名称" prop="name">
|
<Form-item label="品牌名称" prop="name">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.name"
|
|
||||||
placeholder="请输入品牌名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
|
@ -28,61 +16,38 @@
|
||||||
<Row class="operation padding-row">
|
<Row class="operation padding-row">
|
||||||
<Button @click="add" type="primary">添加</Button>
|
<Button @click="add" type="primary">添加</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||||
:loading="loading"
|
|
||||||
border
|
|
||||||
:columns="columns"
|
|
||||||
:data="data"
|
|
||||||
ref="table"
|
|
||||||
sortable="custom"
|
|
||||||
@on-sort-change="changeSort"
|
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
></Table>
|
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||||
:current="searchForm.pageNumber"
|
show-total show-elevator show-sizer></Page>
|
||||||
:total="total"
|
|
||||||
:page-size="searchForm.pageSize"
|
|
||||||
@on-change="changePage"
|
|
||||||
@on-page-size-change="changePageSize"
|
|
||||||
:page-size-opts="[10, 20, 50]"
|
|
||||||
size="small"
|
|
||||||
show-total
|
|
||||||
show-elevator
|
|
||||||
show-sizer
|
|
||||||
></Page>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
<Modal
|
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||||
:title="modalTitle"
|
|
||||||
v-model="modalVisible"
|
|
||||||
:mask-closable="false"
|
|
||||||
:width="500"
|
|
||||||
>
|
|
||||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||||
<FormItem label="品牌名称" prop="name">
|
<FormItem label="品牌名称" prop="name">
|
||||||
<Input v-model="form.name" clearable style="width: 100%" />
|
<Input v-model="form.name" clearable style="width: 100%" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="品牌图标" prop="logo">
|
<FormItem label="品牌图标" prop="logo">
|
||||||
<upload-pic-input
|
<upload-pic-input v-model="form.logo" style="width: 100%"></upload-pic-input>
|
||||||
v-model="form.logo"
|
|
||||||
style="width: 100%"
|
|
||||||
></upload-pic-input>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交
|
||||||
>提交
|
</Button>
|
||||||
</Button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getManagerBrandPage, addBrand, disableBrand} from "@/api/goods";
|
import {
|
||||||
|
getManagerBrandPage,
|
||||||
|
addBrand,
|
||||||
|
updateBrand,
|
||||||
|
disableBrand,
|
||||||
|
delBrand,
|
||||||
|
} from "@/api/goods";
|
||||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -148,23 +113,9 @@
|
||||||
align: "left",
|
align: "left",
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.deleteFlag == 0) {
|
if (params.row.deleteFlag == 0) {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "green",},},"启用");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "success",
|
|
||||||
text: "启用",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.deleteFlag == 1) {
|
} else if (params.row.deleteFlag == 1) {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "volcano",},},"禁用");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "禁用",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: [
|
filters: [
|
||||||
|
@ -253,6 +204,24 @@
|
||||||
"编辑"
|
"编辑"
|
||||||
),
|
),
|
||||||
enableOrDisable,
|
enableOrDisable,
|
||||||
|
|
||||||
|
h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
this.delBrand(params.row.id);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"删除"
|
||||||
|
),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -262,6 +231,16 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 删除品牌
|
||||||
|
async delBrand(id) {
|
||||||
|
let res = await delBrand(id);
|
||||||
|
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("品牌删除成功!");
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
@ -300,7 +279,7 @@
|
||||||
getManagerBrandPage(this.searchForm).then((res) => {
|
getManagerBrandPage(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.warn(12)
|
console.warn(12);
|
||||||
this.data = res.result.records;
|
this.data = res.result.records;
|
||||||
this.total = res.result.total;
|
this.total = res.result.total;
|
||||||
}
|
}
|
||||||
|
@ -323,7 +302,7 @@
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 编辑
|
// 编辑
|
||||||
addBrand(this.form).then((res) => {
|
updateBrand(this.form).then((res) => {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("操作成功");
|
this.$Message.success("操作成功");
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
|
|
||||||
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
|
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
|
||||||
<Form ref="specForm" :model="specForm" :label-width="100">
|
<Form ref="specForm" :model="specForm" :label-width="100">
|
||||||
<Select v-model="specForm.category_specs" multiple>
|
<Select v-model="specForm.categorySpecs" multiple>
|
||||||
<Option v-for="item in specifications" :value="item.id" :key="item.id" :label="item.specName">
|
<Option v-for="item in specifications" :value="item.id" :key="item.id" :label="item.specName">
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
|
@ -134,7 +134,6 @@ import {
|
||||||
} from "@/api/goods";
|
} from "@/api/goods";
|
||||||
import TreeTable from "@/views/my-components/tree-table/Table/Table";
|
import TreeTable from "@/views/my-components/tree-table/Table/Table";
|
||||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||||
import * as filters from "@/utils/filters";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "lili-components",
|
name: "lili-components",
|
||||||
|
@ -153,7 +152,7 @@ export default {
|
||||||
specifications: [], //规格集合
|
specifications: [], //规格集合
|
||||||
categoryId: "", // 分类id
|
categoryId: "", // 分类id
|
||||||
category_brands: [], //已经选择的品牌
|
category_brands: [], //已经选择的品牌
|
||||||
category_specs: [], //已经选择的规格
|
categorySpecs: [], //已经选择的规格
|
||||||
expandLevel: 1, // 展开层级
|
expandLevel: 1, // 展开层级
|
||||||
modalType: 0, // 添加或编辑标识
|
modalType: 0, // 添加或编辑标识
|
||||||
modalVisible: false, // 添加或编辑显示
|
modalVisible: false, // 添加或编辑显示
|
||||||
|
@ -212,13 +211,17 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
categoryIndex: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
changeSortCate(val) {
|
changeSortCate(val) {
|
||||||
let way = this.categoryList.find((item) => {
|
let way = this.categoryList.find((item, index) => {
|
||||||
|
if (item.name == val) {
|
||||||
|
this.categoryIndex = index;
|
||||||
|
console.log((this.categoryIndex = index));
|
||||||
return item.name == val;
|
return item.name == val;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.tableData = [way];
|
this.tableData = [way];
|
||||||
},
|
},
|
||||||
|
@ -236,7 +239,8 @@ export default {
|
||||||
//获取所有规格
|
//获取所有规格
|
||||||
getSpecList() {
|
getSpecList() {
|
||||||
getSpecificationList().then((res) => {
|
getSpecificationList().then((res) => {
|
||||||
if (res.success) {
|
if (res.length != 0) {
|
||||||
|
|
||||||
this.specifications = res;
|
this.specifications = res;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -244,7 +248,7 @@ export default {
|
||||||
//弹出品牌关联框
|
//弹出品牌关联框
|
||||||
brandOperation(v) {
|
brandOperation(v) {
|
||||||
getCategoryBrandListData(v.id).then((res) => {
|
getCategoryBrandListData(v.id).then((res) => {
|
||||||
console.warn(res)
|
console.warn(res);
|
||||||
this.categoryId = v.id;
|
this.categoryId = v.id;
|
||||||
this.modalBrandTitle = "品牌关联";
|
this.modalBrandTitle = "品牌关联";
|
||||||
this.brandForm.categoryBrands = res.result.map((item) => item.id);
|
this.brandForm.categoryBrands = res.result.map((item) => item.id);
|
||||||
|
@ -257,7 +261,8 @@ export default {
|
||||||
getCategorySpecListData(v.id).then((res) => {
|
getCategorySpecListData(v.id).then((res) => {
|
||||||
this.categoryId = v.id;
|
this.categoryId = v.id;
|
||||||
this.modalSpecTitle = "规格关联";
|
this.modalSpecTitle = "规格关联";
|
||||||
this.specForm.category_specs = res.map((item) => item.id);
|
console.log(res);
|
||||||
|
this.specForm.categorySpecs = res.map((item) => item.id);
|
||||||
this.modalSpecVisible = true;
|
this.modalSpecVisible = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -337,7 +342,7 @@ export default {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("添加成功");
|
this.$Message.success("添加成功");
|
||||||
this.getAllList(0);
|
this.getAllList(this.categoryIndex);
|
||||||
this.modalVisible = false;
|
this.modalVisible = false;
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
}
|
}
|
||||||
|
@ -348,7 +353,7 @@ export default {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("修改成功");
|
this.$Message.success("修改成功");
|
||||||
this.getAllList(0);
|
this.getAllList(this.categoryIndex);
|
||||||
this.modalVisible = false;
|
this.modalVisible = false;
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
}
|
}
|
||||||
|
@ -376,12 +381,11 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getAllList(parent_id) {
|
getAllList(parent_id) {
|
||||||
|
this.sortCateList = [];
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getCategoryTree(parent_id).then((res) => {
|
getCategoryTree(parent_id).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// 仅展开指定级数 默认后台已展开所有
|
|
||||||
let expandLevel = this.expandLevel;
|
|
||||||
localStorage.setItem("category", JSON.stringify(res.result));
|
localStorage.setItem("category", JSON.stringify(res.result));
|
||||||
res.result.forEach((e, index, arr) => {
|
res.result.forEach((e, index, arr) => {
|
||||||
this.sortCateList.push({
|
this.sortCateList.push({
|
||||||
|
@ -389,65 +393,13 @@ export default {
|
||||||
value: e.name,
|
value: e.name,
|
||||||
});
|
});
|
||||||
this.sortCate = arr[0].name;
|
this.sortCate = arr[0].name;
|
||||||
if (expandLevel == 1) {
|
|
||||||
if (e.level == 0) {
|
|
||||||
e.expand = false;
|
|
||||||
}
|
|
||||||
if (e.children && e.children.length > 0) {
|
|
||||||
e.children.forEach(function (c) {
|
|
||||||
if (c.level == 1) {
|
|
||||||
c.expand = false;
|
|
||||||
}
|
|
||||||
if (c.children && c.children.length > 0) {
|
|
||||||
c.children.forEach(function (b) {
|
|
||||||
if (b.level == 2) {
|
|
||||||
b.expand = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (expandLevel == 2) {
|
|
||||||
if (e.level == 0) {
|
|
||||||
e.expand = true;
|
|
||||||
}
|
|
||||||
if (e.children && e.children.length > 0) {
|
|
||||||
e.children.forEach(function (c) {
|
|
||||||
if (c.level == 1) {
|
|
||||||
c.expand = false;
|
|
||||||
}
|
|
||||||
if (c.children && c.children.length > 0) {
|
|
||||||
c.children.forEach(function (b) {
|
|
||||||
if (b.level == 2) {
|
|
||||||
b.expand = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else if (expandLevel == 3) {
|
|
||||||
if (e.level == 0) {
|
|
||||||
e.expand = true;
|
|
||||||
}
|
|
||||||
if (e.children && e.children.length > 0) {
|
|
||||||
e.children.forEach(function (c) {
|
|
||||||
if (c.level == 1) {
|
|
||||||
c.expand = true;
|
|
||||||
}
|
|
||||||
if (c.children && c.children.length > 0) {
|
|
||||||
c.children.forEach(function (b) {
|
|
||||||
if (b.level == 2) {
|
|
||||||
b.expand = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.categoryList = res.result;
|
this.categoryList = res.result;
|
||||||
this.tableData = [res.result[0]];
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$set(this, "tableData", [res.result[this.categoryIndex]]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -507,22 +459,8 @@ export default {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
.article {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 400;
|
|
||||||
margin: 12px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.href-text {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.operation {
|
.operation {
|
||||||
margin-bottom: 2vh;
|
margin-bottom: 2vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-count {
|
|
||||||
font-weight: 600;
|
|
||||||
color: #40a9ff;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -135,35 +135,11 @@ export default {
|
||||||
width: 90,
|
width: 90,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.grade == "GOOD") {
|
if (params.row.grade == "GOOD") {
|
||||||
return h(
|
return h("Tag", {props: {color: "green",},}, "好评");
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: "success",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"好评"
|
|
||||||
);
|
|
||||||
} else if (params.row.grade == "MODERATE") {
|
} else if (params.row.grade == "MODERATE") {
|
||||||
return h(
|
return h("Tag", {props: {color: "orange",},}, "中评");
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: "warning",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"中评"
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
return h(
|
return h("Tag", {props: {color: "red",},}, "差评");
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: "error",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"差评"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -74,6 +74,11 @@ export default {
|
||||||
icon: "md-happy",
|
icon: "md-happy",
|
||||||
___type: "sign",
|
___type: "sign",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "小程序直播",
|
||||||
|
icon: "ios-videocam",
|
||||||
|
___type: "live",
|
||||||
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
linkItem: {
|
linkItem: {
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<span slot="close">关</span>
|
<span slot="close">关</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
<Button type="info" placement="right" @click="Template(item)" size="small">编辑</Button>
|
<Button type="info" placement="right" @click="Template(item)" size="small">编辑</Button>
|
||||||
<Button type="success" placement="right" @click="decorate(item.id)" size="small">装修</Button>
|
<Button type="success" placement="right" @click="decorate(item)" size="small">装修</Button>
|
||||||
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)" @on-cancel="cancel">
|
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)" @on-cancel="cancel">
|
||||||
<Button type="error" size="small">删除</Button>
|
<Button type="error" size="small">删除</Button>
|
||||||
</Poptip>
|
</Poptip>
|
||||||
|
@ -139,9 +139,9 @@ export default {
|
||||||
this.showModal = true;
|
this.showModal = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
decorate(id) {
|
decorate(val) {
|
||||||
// 装修
|
// 装修
|
||||||
this.$router.push({ name: "renovation", query: { id: id } });
|
this.$router.push({ name: "renovation", query: { id: val.id,pageShow:val.pageShow } });
|
||||||
},
|
},
|
||||||
|
|
||||||
getTemplateList() {
|
getTemplateList() {
|
||||||
|
|
|
@ -3,12 +3,7 @@
|
||||||
<!-- 左侧模块列表 -->
|
<!-- 左侧模块列表 -->
|
||||||
<div class="model-list">
|
<div class="model-list">
|
||||||
<div class="classification-title">基础模块</div>
|
<div class="classification-title">基础模块</div>
|
||||||
<draggable tag="ul" :list="modelData"
|
<draggable tag="ul" :list="modelData" v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" @end="handleMoveEnd" @start="handleMoveStart" :move="handleMove">
|
||||||
v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}"
|
|
||||||
@end="handleMoveEnd"
|
|
||||||
@start="handleMoveStart"
|
|
||||||
:move="handleMove"
|
|
||||||
>
|
|
||||||
<li v-for="(model, index) in modelData" :key="index" class="model-item">
|
<li v-for="(model, index) in modelData" :key="index" class="model-item">
|
||||||
<Icon :type="model.icon" />
|
<Icon :type="model.icon" />
|
||||||
<span>{{model.name}}</span>
|
<span>{{model.name}}</span>
|
||||||
|
@ -24,78 +19,86 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { modelData } from './modelConfig';
|
import { modelData } from "./modelConfig";
|
||||||
import Draggable from "vuedraggable";
|
import Draggable from "vuedraggable";
|
||||||
import ModelForm from './modelForm.vue';
|
import ModelForm from "./modelForm.vue";
|
||||||
import * as API_floor from '@/api/other.js';
|
import * as API_floor from "@/api/other.js";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Draggable, ModelForm
|
Draggable,
|
||||||
|
ModelForm,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getTemplateItem(this.$route.query.id)
|
this.getTemplateItem(this.$route.query.id);
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
modelData, // 可选模块数据
|
modelData, // 可选模块数据
|
||||||
modelForm:{list:[]} // 模板数据
|
modelForm: { list: [] }, // 模板数据
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveTemplate(){ // 保存模板
|
saveTemplate() {
|
||||||
this.modelForm.list.unshift(this.$refs.modelForm.navList)
|
// 保存模板
|
||||||
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert)
|
this.submitTemplate(this.$route.query.pageShow ? 'OPEN' : 'CLOSE')
|
||||||
const modelForm = JSON.stringify(this.modelForm)
|
},
|
||||||
|
// 提交模板
|
||||||
|
submitTemplate(pageShow) {
|
||||||
|
this.modelForm.list.unshift(this.$refs.modelForm.navList);
|
||||||
|
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert);
|
||||||
|
const modelForm = JSON.stringify(this.modelForm);
|
||||||
const data = {
|
const data = {
|
||||||
id: this.$route.query.id,
|
id: this.$route.query.id,
|
||||||
pageData: modelForm,
|
pageData: modelForm,
|
||||||
}
|
pageShow,
|
||||||
API_floor.updateHome(this.$route.query.id, data).then(res=> {
|
};
|
||||||
|
API_floor.updateHome(this.$route.query.id, data).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('保存模板成功');
|
this.$Message.success("保存模板成功");
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error(res.message)
|
this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
resetTemplate(){ // 还原模板
|
resetTemplate() {
|
||||||
this.getTemplateItem(this.$route.query.id)
|
// 还原模板
|
||||||
|
this.getTemplateItem(this.$route.query.id);
|
||||||
},
|
},
|
||||||
getTemplateItem(id){ // 获取模板数据
|
getTemplateItem(id) {
|
||||||
API_floor.getHomeData(id).then(res => {
|
// 获取模板数据
|
||||||
|
API_floor.getHomeData(id).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let pageData = res.result.pageData;
|
let pageData = res.result.pageData;
|
||||||
if (pageData) {
|
if (pageData) {
|
||||||
pageData = JSON.parse(pageData);
|
pageData = JSON.parse(pageData);
|
||||||
if (pageData.list[0].type === 'topAdvert') { // topAdvert 为顶部广告 navList为导航栏
|
if (pageData.list[0].type === "topAdvert") {
|
||||||
|
// topAdvert 为顶部广告 navList为导航栏
|
||||||
this.$refs.modelForm.topAdvert = pageData.list[0];
|
this.$refs.modelForm.topAdvert = pageData.list[0];
|
||||||
this.$refs.modelForm.navList = pageData.list[1];
|
this.$refs.modelForm.navList = pageData.list[1];
|
||||||
pageData.list.splice(0,2)
|
pageData.list.splice(0, 2);
|
||||||
this.modelForm = pageData;
|
this.modelForm = pageData;
|
||||||
} else {
|
} else {
|
||||||
this.modelForm = {list:[]}
|
this.modelForm = { list: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.modelForm = {list:[]}
|
this.modelForm = { list: [] };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.$refs.modelForm.topAdvert = {};
|
// this.$refs.modelForm.topAdvert = {};
|
||||||
// this.$refs.modelForm.navList = {}
|
// this.$refs.modelForm.navList = {}
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
modelForm: {
|
modelForm: {
|
||||||
deep: true,
|
deep: true,
|
||||||
handler: function (val) {
|
handler: function (val) {
|
||||||
console.log(val)
|
console.log(val);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.renovation {
|
.renovation {
|
||||||
|
@ -125,15 +128,15 @@ export default {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #999;
|
color: #999;
|
||||||
&:hover {
|
&:hover {
|
||||||
border: 1px dashed #409EFF;
|
border: 1px dashed #409eff;
|
||||||
color: #409EFF;
|
color: #409eff;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ghost::after {
|
.ghost::after {
|
||||||
border: none;
|
border: none;
|
||||||
height: 0;
|
height: 0;
|
||||||
content: '';
|
content: "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.show-content {
|
.show-content {
|
||||||
|
@ -145,11 +148,11 @@ export default {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
position: relative;
|
position: relative;
|
||||||
&::after {
|
&::after {
|
||||||
content: '松开鼠标添加模块';
|
content: "松开鼠标添加模块";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px dashed #409EFF;
|
border: 1px dashed #409eff;
|
||||||
color: #409EFF;
|
color: #409eff;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -168,5 +171,4 @@ export default {
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
top: 100px;
|
top: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -3,35 +3,22 @@
|
||||||
<div class="model-title">
|
<div class="model-title">
|
||||||
<div>店铺装修</div>
|
<div>店铺装修</div>
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<Button
|
<Button @click="clickBtn(item)" size="small" v-for="(item, index) in way" :key="index" :type="item.selected ? 'primary' : ''">
|
||||||
@click="clickBtn(item)"
|
|
||||||
size="small"
|
|
||||||
v-for="(item, index) in way"
|
|
||||||
:key="index"
|
|
||||||
:type="item.selected ? 'primary' : ''"
|
|
||||||
>
|
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="model-title-view-btn">
|
<div class="model-title-view-btn">
|
||||||
<Poptip placement="bottom" width="100">
|
<!-- TODO 后期会补全 目前版本暂无 -->
|
||||||
|
<!-- <Poptip placement="bottom" width="100">
|
||||||
<Button size="default" @click="creatQrCode">预览模板</Button>
|
<Button size="default" @click="creatQrCode">预览模板</Button>
|
||||||
<div slot="content" class="default-view-content">
|
<div slot="content" class="default-view-content">
|
||||||
<div>临时预览</div>
|
<div>临时预览</div>
|
||||||
<div ref="qrCodeUrl"></div>
|
<div ref="qrCodeUrl"></div>
|
||||||
</div>
|
</div>
|
||||||
</Poptip>
|
</Poptip> -->
|
||||||
<Button size="default" type="primary" @click="handleSpinShow"
|
<Button size="default" type="primary" @click="handleSpinShow">保存模板</Button>
|
||||||
>保存模板</Button
|
|
||||||
>
|
|
||||||
|
|
||||||
<Modal
|
<Modal title="保存中" v-model="saveDialog" :closable="true" :mask-closable="false" :footer-hide="true">
|
||||||
title="保存中"
|
|
||||||
v-model="saveDialog"
|
|
||||||
:closable="true"
|
|
||||||
:mask-closable="false"
|
|
||||||
:footer-hide="true"
|
|
||||||
>
|
|
||||||
<div v-if="progress">
|
<div v-if="progress">
|
||||||
<div class="model-item">
|
<div class="model-item">
|
||||||
模板名称 <Input style="width: 200px" v-model="submitWay.name" />
|
模板名称 <Input style="width: 200px" v-model="submitWay.name" />
|
||||||
|
@ -61,7 +48,8 @@ export default {
|
||||||
progress: true, // 展示进度
|
progress: true, // 展示进度
|
||||||
num: 20, // 提交进度
|
num: 20, // 提交进度
|
||||||
saveDialog: false, // 加载状态
|
saveDialog: false, // 加载状态
|
||||||
way: [ // 装修tab栏切换
|
way: [
|
||||||
|
// 装修tab栏切换
|
||||||
{
|
{
|
||||||
title: "首页",
|
title: "首页",
|
||||||
name: "index",
|
name: "index",
|
||||||
|
@ -80,7 +68,8 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
qrcode: "", // 二维码
|
qrcode: "", // 二维码
|
||||||
submitWay: { // 表单信息
|
submitWay: {
|
||||||
|
// 表单信息
|
||||||
pageShow: this.$route.query.type || false,
|
pageShow: this.$route.query.type || false,
|
||||||
name: this.$route.query.name || "模板名称",
|
name: this.$route.query.name || "模板名称",
|
||||||
pageClientType: "H5",
|
pageClientType: "H5",
|
||||||
|
@ -129,6 +118,8 @@ export default {
|
||||||
pageData: JSON.stringify(this.$store.state.styleStore),
|
pageData: JSON.stringify(this.$store.state.styleStore),
|
||||||
name: this.submitWay.name,
|
name: this.submitWay.name,
|
||||||
pageShow: this.submitWay.pageShow,
|
pageShow: this.submitWay.pageShow,
|
||||||
|
pageType: "INDEX",
|
||||||
|
pageClientType: "H5",
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.num = 50;
|
this.num = 50;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.image-mode {
|
.image-mode {
|
||||||
max-width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,12 @@
|
||||||
export default {
|
export default {
|
||||||
title: "五列单行图片模块",
|
title: "五列单行图片模块",
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
mounted() {
|
|
||||||
console.log(this.res);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
.layout {
|
.layout {
|
||||||
|
background: #e8e8e8;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
@ -12,20 +12,21 @@
|
||||||
export default {
|
export default {
|
||||||
title: "四列单行图片模块",
|
title: "四列单行图片模块",
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
mounted() {
|
|
||||||
console.log(this.res);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
.layout {
|
.layout {
|
||||||
height: 84px;
|
// background: #e8e8e8;
|
||||||
|
// height: 84px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
padding: 0 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
img{
|
img{
|
||||||
width: 84px;
|
width: 84px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,12 @@
|
||||||
export default {
|
export default {
|
||||||
title: "三列单行图片模块",
|
title: "三列单行图片模块",
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
mounted() {
|
|
||||||
console.log(this.res);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
.layout {
|
.layout {
|
||||||
|
background: #e8e8e8;
|
||||||
height: 110px;
|
height: 110px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default {
|
||||||
title: "左一右二",
|
title: "左一右二",
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.res);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="view-height-150">
|
<div class="view-height-150">
|
||||||
<img class="image-mode" :src="res.list[2].img" />
|
<img class="image-mode" style="height:150px;" :src="res.list[2].img" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -21,18 +21,22 @@ export default {
|
||||||
props: ["res"],
|
props: ["res"],
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.res);
|
console.log(this.res);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./tpl.scss";
|
@import "./tpl.scss";
|
||||||
.layout {
|
.layout {
|
||||||
height: 167px;
|
height: 150px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
.view-height-75 {
|
||||||
|
.image-mode {
|
||||||
|
height: 75px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -23,12 +23,7 @@
|
||||||
|
|
||||||
</Row>
|
</Row>
|
||||||
<!-- 拼图验证码 -->
|
<!-- 拼图验证码 -->
|
||||||
<verify
|
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||||
ref="verify"
|
|
||||||
class="verify-con"
|
|
||||||
verifyType="LOGIN"
|
|
||||||
@change="verifyChange"
|
|
||||||
></verify>
|
|
||||||
<div v-if="socialLogining">
|
<div v-if="socialLogining">
|
||||||
<RectLoading />
|
<RectLoading />
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,7 +43,7 @@ import LangSwitch from "@/views/main-components/lang-switch";
|
||||||
import RectLoading from "@/views/my-components/lili/rect-loading";
|
import RectLoading from "@/views/my-components/lili/rect-loading";
|
||||||
import CountDownButton from "@/views/my-components/lili/count-down-button";
|
import CountDownButton from "@/views/my-components/lili/count-down-button";
|
||||||
import util from "@/libs/util.js";
|
import util from "@/libs/util.js";
|
||||||
import verify from '@/views/my-components/verify';
|
import verify from "@/views/my-components/verify";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -57,18 +52,20 @@ export default {
|
||||||
LangSwitch,
|
LangSwitch,
|
||||||
Header,
|
Header,
|
||||||
Footer,
|
Footer,
|
||||||
verify
|
verify,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false, // 加载状态
|
loading: false, // 加载状态
|
||||||
form: { // 表单数据
|
form: {
|
||||||
|
// 表单数据
|
||||||
username: "",
|
username: "",
|
||||||
password: "",
|
password: "",
|
||||||
mobile: "",
|
mobile: "",
|
||||||
code: "",
|
code: "",
|
||||||
},
|
},
|
||||||
rules: { // 验证规则
|
rules: {
|
||||||
|
// 验证规则
|
||||||
username: [
|
username: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -88,7 +85,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
mounted() {},
|
mounted() {},
|
||||||
afterLogin(res) { // 登录成功后处理
|
afterLogin(res) {
|
||||||
|
// 登录成功后处理
|
||||||
let accessToken = res.result.accessToken;
|
let accessToken = res.result.accessToken;
|
||||||
let refreshToken = res.result.refreshToken;
|
let refreshToken = res.result.refreshToken;
|
||||||
this.setStore("accessToken", accessToken);
|
this.setStore("accessToken", accessToken);
|
||||||
|
@ -109,28 +107,35 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
submitLogin() { // 登录操作
|
submitLogin() {
|
||||||
|
// 登录操作
|
||||||
this.$refs.usernameLoginForm.validate((valid) => {
|
this.$refs.usernameLoginForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$refs.verify.show = true;
|
this.$refs.verify.show = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
verifyChange (con) { // 拼图验证码回显
|
verifyChange(con) {
|
||||||
|
// 拼图验证码回显
|
||||||
if (!con.status) return;
|
if (!con.status) return;
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
login({
|
login({
|
||||||
username: this.form.username,
|
username: this.form.username,
|
||||||
password: this.md5(this.form.password),
|
password: this.md5(this.form.password),
|
||||||
}).then((res) => {
|
})
|
||||||
|
.then((res) => {
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
this.afterLogin(res);
|
this.afterLogin(res);
|
||||||
} else {
|
} else {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
}).catch(()=>{this.loading = false});
|
})
|
||||||
}
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
this.$refs.verify.show = false;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -198,5 +203,4 @@ export default {
|
||||||
.flex {
|
.flex {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<div>
|
<div>
|
||||||
<Row class="header">
|
<Row class="header">
|
||||||
<img src="../../assets/logo.png" class="logo" width="220px">
|
<img src="../../assets/logo.png" class="logo" width="220px">
|
||||||
<!-- <div class="description">{{ $t('LILISHOP-ADMIN') }}</div> -->
|
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -15,13 +14,13 @@ export default {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.header {
|
.header {
|
||||||
|
|
||||||
margin-bottom: 6vh;
|
margin-bottom: 6vh;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
}
|
}
|
||||||
.logo {
|
.logo {
|
||||||
transform: scale(2);
|
width: 440px;
|
||||||
|
height: 158px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -55,6 +55,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeMenu(name) { //二级路由点击
|
changeMenu(name) { //二级路由点击
|
||||||
|
console.log(name)
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: name
|
name: name
|
||||||
});
|
});
|
||||||
|
|
|
@ -131,23 +131,9 @@
|
||||||
sortable: false,
|
sortable: false,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.payStatus == "PAID") {
|
if (params.row.payStatus == "PAID") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "green",},}, "已付款");
|
||||||
h("Badge", {
|
} else {
|
||||||
props: {
|
return h("Tag", {props: {color: "red",},}, "未付款");
|
||||||
status: "success",
|
|
||||||
text: "已付款",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.payStatus == "UNPAID") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "未付款",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -312,6 +312,7 @@ export default {
|
||||||
],
|
],
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
total: 0, // 表单数据总数
|
total: 0, // 表单数据总数
|
||||||
|
selectMember: [], //保存选中的用户
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -320,18 +321,66 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
// 已选择用户数据
|
||||||
|
selectedList: {
|
||||||
|
type: null,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
selectedList: {
|
||||||
|
handler(val) {
|
||||||
|
this.$set(this, "selectMember", JSON.parse(JSON.stringify(val)));
|
||||||
|
this.init(this.data);
|
||||||
|
// 将父级数据与当前组件数据进行匹配
|
||||||
|
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 回调给父级
|
// 回调给父级
|
||||||
callback(val, index) {
|
callback(val, index) {
|
||||||
val.___selected = !val.___selected;
|
this.$set(val, "___selected", !val.___selected);
|
||||||
|
console.log(val.___selected);
|
||||||
|
let findUser = this.selectMember.find((item) => {
|
||||||
|
return item.id == val.id;
|
||||||
|
});
|
||||||
|
// 如果没有则添加
|
||||||
|
if (!findUser) {
|
||||||
|
this.selectMember.push(val);
|
||||||
|
} else {
|
||||||
|
// 有重复数据就删除
|
||||||
|
this.selectMember.map((item, index) => {
|
||||||
|
if (item.id == findUser.id) {
|
||||||
|
this.selectMember.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit("callback", val);
|
this.$emit("callback", val);
|
||||||
},
|
},
|
||||||
init() {
|
// 初始化信息
|
||||||
this.getData();
|
init(data) {
|
||||||
|
data.forEach((item) => {
|
||||||
|
if (this.selectMember.length != 0) {
|
||||||
|
this.selectMember.forEach((member) => {
|
||||||
|
if (member.id == item.id) {
|
||||||
|
this.$set(item, "___selected", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$set(item, "___selected", false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.data = data;
|
||||||
},
|
},
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v;
|
this.searchForm.pageNumber = v;
|
||||||
|
// 此处如果是父子级传值的时候需要做一下处理
|
||||||
|
//selectedMember
|
||||||
|
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
|
@ -387,15 +436,13 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//查询会员列表
|
//查询会员列表
|
||||||
getData() {
|
getData() {
|
||||||
API_Member.getMemberListData(this.searchForm).then((res) => {
|
API_Member.getMemberListData(this.searchForm).then((res) => {
|
||||||
if (res.result.records) {
|
if (res.result.records) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
res.result.records.forEach((item) => {
|
this.init(res.result.records);
|
||||||
item.___selected = false;
|
|
||||||
});
|
|
||||||
this.data = res.result.records;
|
|
||||||
this.total = res.result.total;
|
this.total = res.result.total;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -484,7 +531,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.getData();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -15,20 +15,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal
|
<Modal title="编辑html代码" v-model="showHTMLModal" :mask-closable="false" :width="900" :fullscreen="full">
|
||||||
title="编辑html代码"
|
<Input v-if="!full" v-model="dataEdit" :rows="15" type="textarea" style="max-height:60vh;overflow:auto;" />
|
||||||
v-model="showHTMLModal"
|
|
||||||
:mask-closable="false"
|
|
||||||
:width="900"
|
|
||||||
:fullscreen="full"
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
v-if="!full"
|
|
||||||
v-model="dataEdit"
|
|
||||||
:rows="15"
|
|
||||||
type="textarea"
|
|
||||||
style="max-height:60vh;overflow:auto;"
|
|
||||||
/>
|
|
||||||
<Input v-if="full" v-model="dataEdit" :rows="32" type="textarea" />
|
<Input v-if="full" v-model="dataEdit" :rows="32" type="textarea" />
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<Button @click="full=!full" icon="md-expand">全屏开/关</Button>
|
<Button @click="full=!full" icon="md-expand">全屏开/关</Button>
|
||||||
|
@ -56,21 +44,21 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "editor"
|
default: "editor",
|
||||||
},
|
},
|
||||||
value: String,
|
value: String,
|
||||||
base64: {
|
base64: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
},
|
},
|
||||||
showExpand: {
|
showExpand: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true,
|
||||||
},
|
},
|
||||||
openXss: {
|
openXss: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -79,16 +67,17 @@ export default {
|
||||||
dataEdit: "", // 编辑数据
|
dataEdit: "", // 编辑数据
|
||||||
showHTMLModal: false, // 显示html
|
showHTMLModal: false, // 显示html
|
||||||
full: false, // html全屏开关
|
full: false, // html全屏开关
|
||||||
fullscreenModal: false // 显示全屏预览
|
fullscreenModal: false, // 显示全屏预览
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
initEditor() {
|
initEditor() {
|
||||||
let that = this;
|
let that = this;
|
||||||
// 详见wangeditor3官网文档 https://www.kancloud.cn/wangfupeng/wangeditor3/332599
|
// 详见wangeditor3官网文档 https://www.kancloud.cn/wangfupeng/wangeditor3/332599
|
||||||
editor = new E(`#${this.id}`);
|
editor = new E(`#${this.id}`);
|
||||||
// 编辑内容绑定数据
|
// 编辑内容绑定数据
|
||||||
editor.config.onchange = html => {
|
editor.config.onchange = (html) => {
|
||||||
if (this.openXss) {
|
if (this.openXss) {
|
||||||
this.data = xss(html);
|
this.data = xss(html);
|
||||||
} else {
|
} else {
|
||||||
|
@ -108,7 +97,7 @@ export default {
|
||||||
editor.config.uploadImgServer = uploadFile;
|
editor.config.uploadImgServer = uploadFile;
|
||||||
// lili如要header中传入token鉴权
|
// lili如要header中传入token鉴权
|
||||||
editor.config.uploadImgHeaders = {
|
editor.config.uploadImgHeaders = {
|
||||||
accessToken: that.getStore("accessToken")
|
accessToken: that.getStore("accessToken"),
|
||||||
};
|
};
|
||||||
editor.config.uploadFileName = "file";
|
editor.config.uploadFileName = "file";
|
||||||
editor.config.uploadImgHooks = {
|
editor.config.uploadImgHooks = {
|
||||||
|
@ -139,9 +128,10 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
that.$Message.error(result.message);
|
that.$Message.error(result.message);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.config.customAlert = function (info) {
|
editor.config.customAlert = function (info) {
|
||||||
// info 是需要提示的内容
|
// info 是需要提示的内容
|
||||||
// that.$Message.info(info);
|
// that.$Message.info(info);
|
||||||
|
@ -156,8 +146,8 @@ export default {
|
||||||
// type -> 'emoji' / 'image'
|
// type -> 'emoji' / 'image'
|
||||||
type: "image",
|
type: "image",
|
||||||
// content -> 数组
|
// content -> 数组
|
||||||
content: sina
|
content: sina,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
editor.create();
|
editor.create();
|
||||||
if (this.value) {
|
if (this.value) {
|
||||||
|
@ -187,7 +177,7 @@ export default {
|
||||||
editor.txt.html(this.data);
|
editor.txt.html(this.data);
|
||||||
this.$emit("input", this.data);
|
this.$emit("input", this.data);
|
||||||
this.$emit("on-change", this.data);
|
this.$emit("on-change", this.data);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
setData(value) {
|
setData(value) {
|
||||||
|
@ -200,22 +190,21 @@ export default {
|
||||||
this.$emit("input", this.data);
|
this.$emit("input", this.data);
|
||||||
this.$emit("on-change", this.data);
|
this.$emit("on-change", this.data);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(val) {
|
value(val) {
|
||||||
this.setData(val);
|
this.setData(val);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initEditor();
|
this.initEditor();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.e-menu {
|
.e-menu {
|
||||||
|
|
||||||
z-index: 101;
|
z-index: 101;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
@ -216,11 +216,11 @@
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.serviceType == "RETURN_MONEY") {
|
if (params.row.serviceType == "RETURN_MONEY") {
|
||||||
return h('div', [h('span', {}, '退款'),]);
|
return h('div', [h('tag', {props: {color: "blue"}}, '退款'),]);
|
||||||
} else if (params.row.serviceType == "RETURN_GOODS") {
|
} else if (params.row.serviceType == "RETURN_GOODS") {
|
||||||
return h('div', [h('span', {}, '退货'),]);
|
return h('div', [h('tag', {props: {color: "volcano"}}, '退货'),]);
|
||||||
} else if (params.row.serviceType == "EXCHANGE_GOODS") {
|
} else if (params.row.serviceType == "EXCHANGE_GOODS") {
|
||||||
return h('div', [h('span', {}, '换货'),]);
|
return h('div', [h('tag', {props: {color: "green"}}, '换货'),]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -231,27 +231,23 @@
|
||||||
width: 110,
|
width: 110,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.serviceStatus == "APPLY") {
|
if (params.row.serviceStatus == "APPLY") {
|
||||||
return h('div', [h('span', {}, '申请中'),]);
|
return h('div', [h('tag', {props: {color: "blue"}}, '申请中'),]);
|
||||||
} else if (params.row.serviceStatus == "PASS") {
|
} else if (params.row.serviceStatus == "PASS") {
|
||||||
return h('div', [h('span', {}, '通过售后'),]);
|
return h('div', [h('tag', {props: {color: "cyan"}}, '通过售后'),]);
|
||||||
} else if (params.row.serviceStatus == "REFUSE") {
|
} else if (params.row.serviceStatus == "REFUSE") {
|
||||||
return h('div', [h('span', {}, '拒绝售后'),]);
|
return h('div', [h('tag', {props: {color: "volcano"}}, '拒绝售后'),]);
|
||||||
} else if (params.row.serviceStatus == "BUYER_RETURN") {
|
} else if (params.row.serviceStatus == "BUYER_RETURN") {
|
||||||
return h('div', [h('span', {}, '买家退货,待卖家收货'),]);
|
return h('div', [h('tag', {props: {color: "orange"}}, '买家退货,待卖家收货'),]);
|
||||||
} else if (params.row.serviceStatus == "SELLER_RE_DELIVERY") {
|
|
||||||
return h('div', [h('span', {}, '商家换货/补发'),]);
|
|
||||||
} else if (params.row.serviceStatus == "SELLER_CONFIRM") {
|
} else if (params.row.serviceStatus == "SELLER_CONFIRM") {
|
||||||
return h('div', [h('span', {}, '卖家确认收货'),]);
|
return h('div', [h('tag', {props: {color: "gold"}}, '卖家确认收货'),]);
|
||||||
} else if (params.row.serviceStatus == "SELLER_TERMINATION") {
|
} else if (params.row.serviceStatus == "SELLER_TERMINATION") {
|
||||||
return h('div', [h('span', {}, '卖家终止售后'),]);
|
return h('div', [h('tag', {props: {color: "lime"}}, '卖家终止售后'),]);
|
||||||
} else if (params.row.serviceStatus == "BUYER_CONFIRM") {
|
|
||||||
return h('div', [h('span', {}, '买家确认收货'),]);
|
|
||||||
} else if (params.row.serviceStatus == "BUYER_CANCEL") {
|
} else if (params.row.serviceStatus == "BUYER_CANCEL") {
|
||||||
return h('div', [h('span', {}, '买家取消售后'),]);
|
return h('div', [h('tag', {props: {color: "purple"}}, '买家取消售后'),]);
|
||||||
} else if (params.row.serviceStatus == "COMPLETE") {
|
} else if (params.row.serviceStatus == "COMPLETE") {
|
||||||
return h('div', [h('span', {}, '完成售后'),]);
|
return h('div', [h('tag', {props: {color: "green"}}, '完成售后'),]);
|
||||||
}else if (params.row.serviceStatus == "WAIT_REFUND") {
|
}else if (params.row.serviceStatus == "WAIT_REFUND") {
|
||||||
return h('div', [h('span', {}, '待平台退款'),]);
|
return h('div', [h('tag', {props: {color: "geekblue"}}, '待平台退款'),]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -191,17 +191,17 @@
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.complainStatus == "NEW") {
|
if (params.row.complainStatus == "NEW") {
|
||||||
return h('div', [h('span', { }, '新投诉'),]);
|
return h('div', [h('tag',{props: {color: "purple"}}, '新投诉'),]);
|
||||||
} else if (params.row.complainStatus == "CANCEL") {
|
} else if (params.row.complainStatus == "CANCEL") {
|
||||||
return h('div', [h('span', { }, '已撤销'),]);
|
return h('div', [h('tag', {props: {color: "cyan"}}, '已撤销'),]);
|
||||||
} else if (params.row.complainStatus == "WAIT_APPEAL") {
|
} else if (params.row.complainStatus == "WAIT_APPEAL") {
|
||||||
return h('div', [h('span', { }, '待申诉'),]);
|
return h('div', [h('tag', {props: {color: "volcano"}}, '待申诉'),]);
|
||||||
} else if (params.row.complainStatus == "COMMUNICATION") {
|
} else if (params.row.complainStatus == "COMMUNICATION") {
|
||||||
return h('div', [h('span', { }, '对话中'),]);
|
return h('div', [h('tag', {props: {color: "orange"}}, '对话中'),]);
|
||||||
}else if (params.row.complainStatus == "WAIT_ARBITRATION") {
|
}else if (params.row.complainStatus == "WAIT_ARBITRATION") {
|
||||||
return h('div', [h('span', { }, '等待仲裁'),]);
|
return h('div', [h('tag', {props: {color: "blue"}}, '等待仲裁'),]);
|
||||||
}else if (params.row.complainStatus == "COMPLETE") {
|
}else if (params.row.complainStatus == "COMPLETE") {
|
||||||
return h('div', [h('span', { }, '已完成'),]);
|
return h('div', [h('tag', {props: {color: "green"}}, '已完成'),]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -72,51 +72,13 @@ export default {
|
||||||
align: "center",
|
align: "center",
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.paymentMethod === "WECHAT") {
|
if (params.row.paymentMethod === "WECHAT") {
|
||||||
return h("div", [
|
return h("div", [h("Tag", {props: {color: "green",},}, "微信"),]);
|
||||||
h(
|
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: "green",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"微信"
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
} else if (params.row.paymentMethod === "ALIPAY") {
|
} else if (params.row.paymentMethod === "ALIPAY") {
|
||||||
return h("div", [
|
return h("div", [h("Tag", {props: {color: "blue",},}, "支付宝"),]);
|
||||||
h(
|
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: "blue",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"支付宝"
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
} else if (params.row.paymentMethod === "WALLET") {
|
} else if (params.row.paymentMethod === "WALLET") {
|
||||||
return h("div", [
|
return h("div", [h("Tag", {props: {color: "geekblue",},}, "余额支付"),]);
|
||||||
h(
|
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {},
|
|
||||||
},
|
|
||||||
"余额支付"
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
} else if (params.row.paymentMethod === "BANK_TRANSFER") {
|
} else if (params.row.paymentMethod === "BANK_TRANSFER") {
|
||||||
return h("div", [
|
return h("div", [h("Tag", {props: {color: "orange",},}, "银行转帐"),]);
|
||||||
h(
|
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: "orange",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"银行转帐"
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
} else {
|
} else {
|
||||||
return h("div", [h("Tag", {}, "暂未付款")]);
|
return h("div", [h("Tag", {}, "暂未付款")]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,9 +100,9 @@ export default {
|
||||||
width: 95,
|
width: 95,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.isRefund == "1") {
|
if (params.row.isRefund == "1") {
|
||||||
return h("div", [h("span", {}, "已退款")]);
|
return h("div", [h("Tag", {props: {color: "green",},}, "已退款")]);
|
||||||
} else {
|
} else {
|
||||||
return h("div", [h("span", {}, "未退款")]);
|
return h("div", [h("Tag", {props: {color: "orange",},}, "未退款")]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -94,8 +94,8 @@
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
pageNumber: 1, // 当前页数
|
pageNumber: 1, // 当前页数
|
||||||
pageSize: 10, // 页面大小
|
pageSize: 10, // 页面大小
|
||||||
sort: "createTime", // 默认排序字段
|
sort: "", // 默认排序字段
|
||||||
order: "desc", // 默认排序方式
|
order: "", // 默认排序方式
|
||||||
startDate: "", // 起始时间
|
startDate: "", // 起始时间
|
||||||
endDate: "", // 终止时间
|
endDate: "", // 终止时间
|
||||||
orderType: "FICTITIOUS",
|
orderType: "FICTITIOUS",
|
||||||
|
@ -118,8 +118,6 @@
|
||||||
title: "下单时间",
|
title: "下单时间",
|
||||||
key: "createTime",
|
key: "createTime",
|
||||||
width: 200,
|
width: 200,
|
||||||
sortable: true,
|
|
||||||
sortType: "desc",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "订单来源",
|
title: "订单来源",
|
||||||
|
@ -150,19 +148,15 @@
|
||||||
width:95,
|
width:95,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.orderStatus == "UNPAID") {
|
if (params.row.orderStatus == "UNPAID") {
|
||||||
return h('div', [h('span', { }, '未付款'),]);
|
return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]);
|
||||||
} else if (params.row.orderStatus == "PAID") {
|
} else if (params.row.orderStatus == "PAID") {
|
||||||
return h('div', [h('span', { }, '已付款'),]);
|
return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]);
|
||||||
} else if (params.row.orderStatus == "UNDELIVERED") {
|
|
||||||
return h('div', [h('span', { }, '待发货'),]);
|
|
||||||
} else if (params.row.orderStatus == "DELIVERED") {
|
|
||||||
return h('div', [h('span', { }, '已发货'),]);
|
|
||||||
} else if (params.row.orderStatus == "COMPLETED") {
|
} else if (params.row.orderStatus == "COMPLETED") {
|
||||||
return h('div', [h('span', { }, '已完成'),]);
|
return h("div", [h("tag", {props: {color: "green"}}, "已完成")]);
|
||||||
} else if (params.row.orderStatus == "TAKE") {
|
} else if (params.row.orderStatus == "TAKE") {
|
||||||
return h('div', [h('span', { }, '待核验'),]);
|
return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]);
|
||||||
} else if (params.row.orderStatus == "CANCELLED") {
|
} else if (params.row.orderStatus == "CANCELLED") {
|
||||||
return h('div', [h('span', { }, '已取消'),]);
|
return h("div", [h("tag", {props: {color: "red"}}, "已取消")]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<div class="div-item">
|
<div class="div-item">
|
||||||
<div class="div-item-left">订单来源:</div>
|
<div class="div-item-left">订单来源:</div>
|
||||||
<div class="div-item-right">
|
<div class="div-item-right">
|
||||||
{{ orderInfo.order.clientType }}
|
{{ orderInfo.order.clientType | clientTypeWay}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,26 @@
|
||||||
<div class="search">
|
<div class="search">
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
|
|
||||||
<Row @keydown.enter.native="handleSearch">
|
<Row @keydown.enter.native="handleSearch">
|
||||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||||
<Form-item label="订单号" prop="orderSn">
|
<Form-item label="订单号" prop="orderSn">
|
||||||
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 200px" />
|
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 160px" />
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="会员名称" prop="buyerName">
|
<Form-item label="会员名称" prop="buyerName">
|
||||||
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 200px" />
|
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 160px" />
|
||||||
|
</Form-item>
|
||||||
|
|
||||||
|
<Form-item label="订单类型" prop="orderType">
|
||||||
|
<Select v-model="searchForm.orderType" placeholder="请选择" clearable style="width: 160px">
|
||||||
|
<Option value="NORMAL">普通订单</Option>
|
||||||
|
<Option value="PINTUAN">拼团订单</Option>
|
||||||
|
<Option value="GIFT">赠品订单</Option>
|
||||||
|
<Option value="VIRTUAL">核验订单</Option>
|
||||||
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="订单状态" prop="orderStatus">
|
<Form-item label="订单状态" prop="orderStatus">
|
||||||
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 200px">
|
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
|
||||||
<Option value="UNPAID">未付款</Option>
|
<Option value="UNPAID">未付款</Option>
|
||||||
<Option value="PAID">已付款</Option>
|
<Option value="PAID">已付款</Option>
|
||||||
<Option value="UNDELIVERED">待发货</Option>
|
<Option value="UNDELIVERED">待发货</Option>
|
||||||
|
@ -23,23 +33,24 @@
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
|
||||||
<Form-item label="下单时间">
|
<Form-item label="下单时间">
|
||||||
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 160px"></DatePicker>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
|
|
||||||
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
|
|
||||||
<Button type="primary" ghost class="search-btn">导出Excel</Button>
|
|
||||||
</download-excel>
|
|
||||||
|
|
||||||
|
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
|
<div>
|
||||||
|
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
|
||||||
|
<Button type="primary" class="export">
|
||||||
|
导出Excel
|
||||||
|
</Button>
|
||||||
|
</download-excel>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||||
|
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||||
size="small" show-total show-elevator show-sizer></Page>
|
show-total show-elevator show-sizer></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
@ -56,53 +67,54 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
// 表格的表头以及内容
|
// 表格的表头以及内容
|
||||||
|
|
||||||
|
|
||||||
fields: {
|
fields: {
|
||||||
"订单编号":"sn",
|
订单编号: "sn",
|
||||||
"下单时间":"createTime",
|
下单时间: "createTime",
|
||||||
"客户名称":"memberName",
|
客户名称: "memberName",
|
||||||
"客户账号":"",
|
客户账号: "",
|
||||||
"收货人":"",
|
收货人: "",
|
||||||
"收货人手机号":"",
|
收货人手机号: "",
|
||||||
"收货人地址":"",
|
收货人地址: "",
|
||||||
"支付方式":{
|
支付方式: {
|
||||||
field: "clientType",
|
field: "clientType",
|
||||||
callback:value=>{
|
callback: (value) => {
|
||||||
if (value == "H5") {
|
if (value == "H5") {
|
||||||
return "移动端"
|
return "移动端";
|
||||||
} else if (value == "PC") {
|
} else if (value == "PC") {
|
||||||
return "PC端"
|
return "PC端";
|
||||||
} else if (value == "WECHAT_MP") {
|
} else if (value == "WECHAT_MP") {
|
||||||
return "小程序端"
|
return "小程序端";
|
||||||
} else if (value == "APP") {
|
} else if (value == "APP") {
|
||||||
return "移动应用端"
|
return "移动应用端";
|
||||||
} else {
|
} else {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"配送方式":"",
|
},
|
||||||
"配送费用":"",
|
配送方式: "",
|
||||||
"订单商品金额":"",
|
配送费用: "",
|
||||||
"订单优惠金额":"",
|
订单商品金额: "",
|
||||||
"订单应付金额":"",
|
订单优惠金额: "",
|
||||||
"商品SKU编号":"",
|
订单应付金额: "",
|
||||||
"商品数量":"groupNum",
|
商品SKU编号: "",
|
||||||
"买家备注":"",
|
商品数量: "groupNum",
|
||||||
"订单状态":"",
|
买家备注: "",
|
||||||
"付款状态":{
|
订单状态: "",
|
||||||
|
付款状态: {
|
||||||
field: "payStatus",
|
field: "payStatus",
|
||||||
callback:value=>{
|
callback: (value) => {
|
||||||
return value == "UNPAID" ? "未付款" : value == "PAID" ? "已付款" : ""
|
return value == "UNPAID"
|
||||||
}
|
? "未付款"
|
||||||
|
: value == "PAID"
|
||||||
|
? "已付款"
|
||||||
|
: "";
|
||||||
},
|
},
|
||||||
"发货状态":"",
|
},
|
||||||
"发票类型":"",
|
发货状态: "",
|
||||||
"发票抬头":"",
|
发票类型: "",
|
||||||
"店铺":"storeName",
|
发票抬头: "",
|
||||||
|
店铺: "storeName",
|
||||||
},
|
},
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: {
|
searchForm: {
|
||||||
|
@ -126,18 +138,14 @@ export default {
|
||||||
{
|
{
|
||||||
title: "订单号",
|
title: "订单号",
|
||||||
key: "sn",
|
key: "sn",
|
||||||
minWidth: 230,
|
minWidth: 240,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "下单时间",
|
|
||||||
key: "createTime",
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "订单来源",
|
title: "订单来源",
|
||||||
key: "clientType",
|
key: "clientType",
|
||||||
width: 95,
|
width: 120,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.clientType == "H5") {
|
if (params.row.clientType == "H5") {
|
||||||
return h("div", {}, "移动端");
|
return h("div", {}, "移动端");
|
||||||
|
@ -152,15 +160,34 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "订单类型",
|
||||||
|
key: "orderType",
|
||||||
|
width: 120,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.orderType == "NORMAL") {
|
||||||
|
return h("div", [h("tag", {props: {color: "blue"}}, "普通订单")]);
|
||||||
|
} else if (params.row.orderType == "PINTUAN") {
|
||||||
|
return h("div", [h("tag", {props: {color: "volcano"}}, "拼团订单")]);
|
||||||
|
} else if (params.row.orderType == "GIFT") {
|
||||||
|
return h("div", [h("tag", {props: {color: "green"}}, "赠品订单")]);
|
||||||
|
} else if (params.row.orderType == "VIRTUAL") {
|
||||||
|
return h("div", [h("tag", {props: {color: "geekblue"}}, "核验订单")]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "买家名称",
|
title: "买家名称",
|
||||||
key: "memberName",
|
key: "memberName",
|
||||||
width: 130,
|
minWidth: 130,
|
||||||
|
tooltip: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "订单金额",
|
title: "订单金额",
|
||||||
key: "flowPrice",
|
key: "flowPrice",
|
||||||
minWidth: 120,
|
minWidth: 100,
|
||||||
|
tooltip: true,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h(
|
return h(
|
||||||
"div",
|
"div",
|
||||||
|
@ -172,31 +199,38 @@ export default {
|
||||||
{
|
{
|
||||||
title: "订单状态",
|
title: "订单状态",
|
||||||
key: "orderStatus",
|
key: "orderStatus",
|
||||||
width: 95,
|
minWidth: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.orderStatus == "UNPAID") {
|
if (params.row.orderStatus == "UNPAID") {
|
||||||
return h("div", [h("span", {}, "未付款")]);
|
return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]);
|
||||||
} else if (params.row.orderStatus == "PAID") {
|
} else if (params.row.orderStatus == "PAID") {
|
||||||
return h("div", [h("span", {}, "已付款")]);
|
return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]);
|
||||||
} else if (params.row.orderStatus == "UNDELIVERED") {
|
} else if (params.row.orderStatus == "UNDELIVERED") {
|
||||||
return h("div", [h("span", {}, "待发货")]);
|
return h("div", [h("tag", {props: {color: "geekblue"}}, "待发货")]);
|
||||||
} else if (params.row.orderStatus == "DELIVERED") {
|
} else if (params.row.orderStatus == "DELIVERED") {
|
||||||
return h("div", [h("span", {}, "已发货")]);
|
return h("div", [h("tag", {props: {color: "cyan"}}, "已发货")]);
|
||||||
} else if (params.row.orderStatus == "COMPLETED") {
|
} else if (params.row.orderStatus == "COMPLETED") {
|
||||||
return h("div", [h("span", {}, "已完成")]);
|
return h("div", [h("tag", {props: {color: "green"}}, "已完成")]);
|
||||||
} else if (params.row.orderStatus == "TAKE") {
|
} else if (params.row.orderStatus == "TAKE") {
|
||||||
return h("div", [h("span", {}, "待核验")]);
|
return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]);
|
||||||
} else if (params.row.orderStatus == "CANCELLED") {
|
} else if (params.row.orderStatus == "CANCELLED") {
|
||||||
return h("div", [h("span", {}, "已取消")]);
|
return h("div", [h("tag", {props: {color: "red"}}, "已取消")]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "下单时间",
|
||||||
|
key: "createTime",
|
||||||
|
width: 170,
|
||||||
|
sortable: true,
|
||||||
|
sortType: "desc",
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
align: "center",
|
align: "center",
|
||||||
width: 180,
|
width: 150,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h("div", [
|
return h("div", [
|
||||||
h(
|
h(
|
||||||
|
@ -340,4 +374,11 @@ export default {
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
// 建议引入通用样式 可删除下面样式代码
|
// 建议引入通用样式 可删除下面样式代码
|
||||||
@import "@/styles/table-common.scss";
|
@import "@/styles/table-common.scss";
|
||||||
|
.export {
|
||||||
|
margin: 10px 20px 10px 0;
|
||||||
|
}
|
||||||
|
.export-excel-wrapper {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<Input type="number" v-model="form.sort" clearable style="width: 10%" />
|
<Input type="number" v-model="form.sort" clearable style="width: 10%" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem class="form-item-view-el" label="文章内容" prop="content">
|
<FormItem class="form-item-view-el" label="文章内容" prop="content">
|
||||||
<editor v-model="form.content"></editor>
|
<editor openXss v-model="form.content"></editor>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="是否展示" prop="openStatus">
|
<FormItem label="是否展示" prop="openStatus">
|
||||||
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
|
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
|
||||||
|
@ -380,7 +380,6 @@ export default {
|
||||||
//为了在是否展示一列展示开关 需要改一下数据类型,最终提交再次更改
|
//为了在是否展示一列展示开关 需要改一下数据类型,最终提交再次更改
|
||||||
this.data = [];
|
this.data = [];
|
||||||
if (res.result.records.length > 0) {
|
if (res.result.records.length > 0) {
|
||||||
|
|
||||||
this.data = res.result.records;
|
this.data = res.result.records;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -390,7 +389,6 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.submitLoading = true;
|
this.submitLoading = true;
|
||||||
|
@ -403,7 +401,6 @@ export default {
|
||||||
this.$Message.success("操作成功");
|
this.$Message.success("操作成功");
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.modalVisible = false;
|
this.modalVisible = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -414,8 +411,6 @@ export default {
|
||||||
this.$Message.success("操作成功");
|
this.$Message.success("操作成功");
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.modalVisible = false;
|
this.modalVisible = false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -440,10 +435,25 @@ export default {
|
||||||
this.form.categoryId = res.result.categoryId;
|
this.form.categoryId = res.result.categoryId;
|
||||||
this.treeValue = data.articleCategoryName;
|
this.treeValue = data.articleCategoryName;
|
||||||
this.form.id = data.id;
|
this.form.id = data.id;
|
||||||
this.form.content = res.result.content;
|
this.form.content = htmlEscape(res.result.content);
|
||||||
this.form.title = res.result.title;
|
this.form.title = res.result.title;
|
||||||
this.form.sort = res.result.sort;
|
this.form.sort = res.result.sort;
|
||||||
this.form.openStatus = res.result.openStatus
|
this.form.openStatus = res.result.openStatus;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
htmlEscape(text) {
|
||||||
|
return text.replace(/[<>"&]/g, function (match, pos, originalText) {
|
||||||
|
switch (match) {
|
||||||
|
case "<":
|
||||||
|
return "<";
|
||||||
|
case ">":
|
||||||
|
return ">";
|
||||||
|
case "&":
|
||||||
|
return "&";
|
||||||
|
case '"':
|
||||||
|
return """;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -15,8 +15,7 @@
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动时间">
|
<Form-item label="活动时间">
|
||||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间"
|
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||||
style="width: 200px"></DatePicker>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -26,21 +25,17 @@
|
||||||
<Button @click="delAll">批量下架</Button>
|
<Button @click="delAll">批量下架</Button>
|
||||||
<!-- <Button @click="upAll" >批量上架</Button> -->
|
<!-- <Button @click="upAll" >批量上架</Button> -->
|
||||||
</Row>
|
</Row>
|
||||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-select-cancel="cancelSelect" @on-selection-change="changeSelect">
|
||||||
@on-sort-change="changeSort" @on-selection-change="changeSelect">
|
|
||||||
<template slot-scope="{ row,index }" slot="action">
|
<template slot-scope="{ row,index }" slot="action">
|
||||||
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary"
|
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary" size="small" style="margin-right: 10px" @click="edit(row)">编辑
|
||||||
size="small" style="margin-right: 10px" @click="edit(row)">编辑
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error"
|
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" style="margin-right: 10px" @click="remove(row)">下架
|
||||||
size="small" style="margin-right: 10px" @click="remove(row)">下架
|
|
||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||||
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
|
show-total show-elevator show-sizer></Page>
|
||||||
size="small" show-total show-elevator show-sizer></Page>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -64,11 +59,11 @@ export default {
|
||||||
modalTitle: "", // 添加或编辑标题
|
modalTitle: "", // 添加或编辑标题
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
pageNumber: 0, // 当前页数
|
pageNumber: 1, // 当前页数
|
||||||
pageSize: 10, // 页面大小
|
pageSize: 10, // 页面大小
|
||||||
sort: "startTime", // 默认排序字段
|
sort: "startTime", // 默认排序字段
|
||||||
order: "desc", // 默认排序方式
|
order: "desc", // 默认排序方式
|
||||||
getType: '', // 默认排序方式
|
getType: "", // 默认排序方式
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
// 添加或编辑表单对象初始化数据
|
// 添加或编辑表单对象初始化数据
|
||||||
|
@ -94,19 +89,19 @@ export default {
|
||||||
{
|
{
|
||||||
title: "活动名称",
|
title: "活动名称",
|
||||||
key: "promotionName",
|
key: "promotionName",
|
||||||
|
minWidth: 100,
|
||||||
fixed: "left",
|
fixed: "left",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "优惠券名称",
|
title: "优惠券名称",
|
||||||
key: "couponName",
|
key: "couponName",
|
||||||
|
minWidth: 100,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "面额/折扣",
|
title: "面额/折扣",
|
||||||
key: "price",
|
key: "price",
|
||||||
width: 120,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.price) {
|
if (params.row.price) {
|
||||||
return h(
|
return h(
|
||||||
|
@ -122,26 +117,28 @@ export default {
|
||||||
{
|
{
|
||||||
title: "领取数量/总数量",
|
title: "领取数量/总数量",
|
||||||
key: "publishNum",
|
key: "publishNum",
|
||||||
width: 150,
|
width: 130,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h(
|
return h(
|
||||||
"div",
|
"div",
|
||||||
params.row.receivedNum + "/" + params.row.publishNum
|
params.row.receivedNum + "/" + params.row.publishNum
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "优惠券类型",
|
title: "优惠券类型",
|
||||||
key: "couponType",
|
key: "couponType",
|
||||||
width: 120,
|
width: 120,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
let text = "未知";
|
let text = "";
|
||||||
if (params.row.couponType === "DISCOUNT") {
|
if (params.row.couponType === "DISCOUNT") {
|
||||||
text = "打折";
|
return h("Tag", {props: {color: "blue",},}, "打折");
|
||||||
} else if (params.row.couponType === "PRICE") {
|
} else if (params.row.couponType === "PRICE") {
|
||||||
text = "减免现金";
|
return h("Tag", {props: {color: "geekblue",},}, "减免现金");
|
||||||
|
}else {
|
||||||
|
return h("Tag", {props: {color: "purple",},}, "未知");
|
||||||
}
|
}
|
||||||
return h("div", [text]);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -164,15 +161,15 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动时间",
|
title: "活动时间",
|
||||||
width: 120,
|
|
||||||
render: (h, params) => {
|
|
||||||
|
|
||||||
|
render: (h, params) => {
|
||||||
if (params.row.getType === "ACTIVITY") {
|
if (params.row.getType === "ACTIVITY") {
|
||||||
return h("div", "长期有效");
|
return h("div", "长期有效");
|
||||||
} else {
|
} else {
|
||||||
return h("div", {
|
return h("div", {
|
||||||
domProps: {
|
domProps: {
|
||||||
innerHTML: params.row.startTime + "<br/>" + params.row.endTime,
|
innerHTML:
|
||||||
|
params.row.startTime + "<br/>" + params.row.endTime,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -188,7 +185,7 @@ export default {
|
||||||
color = "red";
|
color = "red";
|
||||||
if (params.row.promotionStatus == "NEW") {
|
if (params.row.promotionStatus == "NEW") {
|
||||||
text = "未开始";
|
text = "未开始";
|
||||||
color = "default";
|
color = "geekblue";
|
||||||
} else if (params.row.promotionStatus == "START") {
|
} else if (params.row.promotionStatus == "START") {
|
||||||
text = "已开始";
|
text = "已开始";
|
||||||
color = "green";
|
color = "green";
|
||||||
|
@ -211,17 +208,19 @@ export default {
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
minWidth: 70,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
slot: "action",
|
slot: "action",
|
||||||
align: "center",
|
align: "center",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 100,
|
maxWidth: 140,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
total: 0, // 表单数据总数
|
total: 0, // 表单数据总数
|
||||||
|
selectCoupon: [], //本级选中的优惠券
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -233,13 +232,13 @@ export default {
|
||||||
//优惠券类型 查询参数
|
//优惠券类型 查询参数
|
||||||
getType: {
|
getType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: "",
|
||||||
},
|
},
|
||||||
//已选择优惠券
|
//已选择优惠券
|
||||||
selectList: {
|
selectedList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: [],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(to, from) {
|
$route(to, from) {
|
||||||
|
@ -250,8 +249,19 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 选中优惠券 父级传值
|
// 选中优惠券 父级传值
|
||||||
|
selectedList: {
|
||||||
|
handler(val) {
|
||||||
|
// 判断是否是父级回调给自己已选择优惠券
|
||||||
|
if (val.length != 0) {
|
||||||
|
this.selectCoupon = val;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
check() {
|
check() {
|
||||||
this.$emit("selected", this.selectList);
|
// this.selectCoupon.push(this.selectList)
|
||||||
|
this.$emit("selected", this.selectCoupon);
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
@ -267,9 +277,9 @@ export default {
|
||||||
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
|
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
|
||||||
},
|
},
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v - 1;
|
this.searchForm.pageNumber = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.clearSelectAll();
|
// this.clearSelectAll();
|
||||||
},
|
},
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
this.searchForm.pageSize = v;
|
this.searchForm.pageSize = v;
|
||||||
|
@ -291,10 +301,37 @@ export default {
|
||||||
clearSelectAll() {
|
clearSelectAll() {
|
||||||
this.$refs.table.selectAll(false);
|
this.$refs.table.selectAll(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消已选择的数据
|
||||||
|
*/
|
||||||
|
cancelSelect(selection, row) {
|
||||||
|
console.log(row)
|
||||||
|
let findCoupon = this.selectCoupon.find((item) => {
|
||||||
|
return item.id == row.id;
|
||||||
|
});
|
||||||
|
// 如果没有则添加
|
||||||
|
if (!findCoupon) {
|
||||||
|
this.selectCoupon.push(row);
|
||||||
|
} else {
|
||||||
|
// 有重复数据就删除
|
||||||
|
this.selectCoupon.map((item, index) => {
|
||||||
|
if (item.id == findCoupon.id) {
|
||||||
|
this.selectCoupon.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择优惠券
|
||||||
|
*/
|
||||||
changeSelect(e) {
|
changeSelect(e) {
|
||||||
|
if (this.checked && e.length != 0) {
|
||||||
|
this.selectCoupon.push(...e);
|
||||||
|
this.check();
|
||||||
|
}
|
||||||
this.selectList = e;
|
this.selectList = e;
|
||||||
this.selectCount = e.length;
|
this.selectCount = e.length;
|
||||||
this.checked ? this.check() : '';
|
|
||||||
},
|
},
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -309,9 +346,18 @@ export default {
|
||||||
getPlatformCouponList(this.searchForm).then((res) => {
|
getPlatformCouponList(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
res.result.records.forEach(item => {
|
res.result.records.forEach((item) => {
|
||||||
item.___selected = false
|
if (this.selectCoupon.length != 0) {
|
||||||
})
|
this.selectCoupon.forEach((child) => {
|
||||||
|
if (item.id == child.id) {
|
||||||
|
item.___selected = true;
|
||||||
|
item._checked = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
item.___selected = false;
|
||||||
|
});
|
||||||
|
|
||||||
this.data = res.result.records;
|
this.data = res.result.records;
|
||||||
this.total = res.result.total;
|
this.total = res.result.total;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,17 @@
|
||||||
<Row class="operation padding-row">
|
<Row class="operation padding-row">
|
||||||
<Button @click="add" type="primary">添加活动</Button>
|
<Button @click="add" type="primary">添加活动</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom">
|
||||||
@on-sort-change="changeSort" @on-selection-change="changeSelect">
|
|
||||||
|
<template slot-scope="{ row,index }" slot="action">
|
||||||
|
<Button type="primary"
|
||||||
|
size="small" style="margin-right: 10px" @click="info(row)">查看
|
||||||
|
</Button>
|
||||||
|
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error"
|
||||||
|
size="small" style="margin-right: 10px" @click="remove(row)">停止
|
||||||
|
</Button>
|
||||||
|
</template>
|
||||||
|
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
|
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
|
||||||
|
@ -19,11 +28,11 @@
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getCouponActivityList,
|
getCouponActivityList,
|
||||||
updatePlatformCouponStatus,
|
closeActivity,
|
||||||
} from "@/api/promotion";
|
} from "@/api/promotion";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "coupon",
|
name: "couponActivity",
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -148,63 +157,36 @@ export default {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
$route(to, from) {
|
|
||||||
if (to.fullPath == "/promotion/manager-coupon") {
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 选中优惠券 父级传值
|
//获取数据 初始化
|
||||||
check(val, index) {
|
|
||||||
|
|
||||||
this.data[index].___selected = !this.data[index].___selected
|
|
||||||
|
|
||||||
this.$emit("selected", val);
|
|
||||||
},
|
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
//增加券活动
|
||||||
add() {
|
add() {
|
||||||
this.$router.push({name: "add-coupon-activity"});
|
this.$router.push({name: "add-coupon-activity"});
|
||||||
},
|
},
|
||||||
/** 跳转至领取详情页面 */
|
//查看详情
|
||||||
receiveInfo(v) {
|
|
||||||
this.$router.push({name: "member-receive-coupon", query: {id: v.id}});
|
|
||||||
},
|
|
||||||
info(v) {
|
info(v) {
|
||||||
this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
|
this.$router.push({name: "coupon-activity-info", query: {id: v.id}});
|
||||||
},
|
},
|
||||||
|
//跳转页面
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v - 1;
|
this.searchForm.pageNumber = v - 1;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.clearSelectAll();
|
|
||||||
},
|
},
|
||||||
|
//修改分页
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
this.searchForm.pageSize = v;
|
this.searchForm.pageSize = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
//搜索活动
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
this.searchForm.pageNumber = 0;
|
this.searchForm.pageNumber = 0;
|
||||||
this.searchForm.pageSize = 10;
|
this.searchForm.pageSize = 10;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
changeSort(e) {
|
//数据获取
|
||||||
this.searchForm.sort = e.key;
|
|
||||||
this.searchForm.order = e.order;
|
|
||||||
if (e.order === "normal") {
|
|
||||||
this.searchForm.order = "";
|
|
||||||
}
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
clearSelectAll() {
|
|
||||||
this.$refs.table.selectAll(false);
|
|
||||||
},
|
|
||||||
changeSelect(e) {
|
|
||||||
this.selectList = e;
|
|
||||||
this.selectCount = e.length;
|
|
||||||
},
|
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||||
|
@ -218,137 +200,36 @@ export default {
|
||||||
getCouponActivityList(this.searchForm).then((res) => {
|
getCouponActivityList(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
res.result.records.forEach(item => {
|
|
||||||
item.___selected = false
|
|
||||||
})
|
|
||||||
this.data = res.result.records;
|
this.data = res.result.records;
|
||||||
this.total = res.result.total;
|
this.total = res.result.total;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.total = this.data.length;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
//跳转编辑
|
||||||
this.$refs.form.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.submitLoading = true;
|
|
||||||
if (this.modalType === 0) {
|
|
||||||
// 添加 避免编辑后传入id等数据 记得删除
|
|
||||||
delete this.form.id;
|
|
||||||
this.postRequest("/coupon/insertOrUpdate", this.form).then(
|
|
||||||
(res) => {
|
|
||||||
this.submitLoading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("操作成功");
|
|
||||||
this.getDataList();
|
|
||||||
this.modalVisible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// 编辑
|
|
||||||
this.postRequest("/coupon/insertOrUpdate", this.form).then(
|
|
||||||
(res) => {
|
|
||||||
this.submitLoading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("操作成功");
|
|
||||||
this.getDataList();
|
|
||||||
this.modalVisible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
edit(v) {
|
edit(v) {
|
||||||
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
|
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
|
||||||
},
|
},
|
||||||
|
//下架活动
|
||||||
remove(v) {
|
remove(v) {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: "确认下架",
|
title: "确认下架",
|
||||||
// 记得确认修改此处
|
// 记得确认修改此处
|
||||||
content: "确认要下架此优惠券么?",
|
content: "确认要下架此优惠券活动么?下架活动只能重新创建",
|
||||||
loading: true,
|
loading: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
// 删除
|
// 删除
|
||||||
updatePlatformCouponStatus({
|
closeActivity(v.id).then((res) => {
|
||||||
couponIds: v.id,
|
|
||||||
promotionStatus: "CLOSE",
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
this.$Modal.remove();
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("优惠券已作废");
|
this.$Message.success("优惠券活动已作废");
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
}
|
}
|
||||||
})
|
}).catch(() => {
|
||||||
.catch(() => {
|
|
||||||
this.$Modal;
|
this.$Modal;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
delAll() {
|
|
||||||
if (this.selectCount <= 0) {
|
|
||||||
this.$Message.warning("您还未选择要下架的优惠券");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$Modal.confirm({
|
|
||||||
title: "确认下架",
|
|
||||||
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
|
|
||||||
loading: true,
|
|
||||||
onOk: () => {
|
|
||||||
let ids = [];
|
|
||||||
this.selectList.forEach(function (e) {
|
|
||||||
ids.push(e.id);
|
|
||||||
});
|
|
||||||
let params = {
|
|
||||||
couponIds: ids.toString(),
|
|
||||||
promotionStatus: "CLOSE",
|
|
||||||
};
|
|
||||||
// 批量删除
|
|
||||||
updatePlatformCouponStatus(params).then((res) => {
|
|
||||||
this.$Modal.remove();
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("下架成功");
|
|
||||||
this.clearSelectAll();
|
|
||||||
this.getDataList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
upAll() {
|
|
||||||
if (this.selectCount <= 0) {
|
|
||||||
this.$Message.warning("请选择要上架的优惠券");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$Modal.confirm({
|
|
||||||
title: "确认上架",
|
|
||||||
content: "您确认要上架所选的 " + this.selectCount + " 条数据?",
|
|
||||||
loading: true,
|
|
||||||
onOk: () => {
|
|
||||||
let ids = [];
|
|
||||||
this.selectList.forEach(function (e) {
|
|
||||||
ids.push(e.id);
|
|
||||||
});
|
|
||||||
let params = {
|
|
||||||
couponIds: ids.toString(),
|
|
||||||
promotionStatus: "START",
|
|
||||||
};
|
|
||||||
// 批量上架
|
|
||||||
updatePlatformCouponStatus(params).then((res) => {
|
|
||||||
this.$Modal.remove();
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("上架成功");
|
|
||||||
this.clearSelectAll();
|
|
||||||
this.getDataList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
|
|
|
@ -3,81 +3,37 @@
|
||||||
<div class="content-goods-publish">
|
<div class="content-goods-publish">
|
||||||
<Form ref="form" :model="form" :label-width="130">
|
<Form ref="form" :model="form" :label-width="130">
|
||||||
<div class="base-info-item">
|
<div class="base-info-item">
|
||||||
<h4>平台券活动详情</h4>
|
<h4>优惠券活动详情</h4>
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<FormItem label="活动名称">
|
<FormItem label="活动名称">
|
||||||
<span class="goods-category-name">{{ form.promotionName }}</span>
|
<span>{{ couponActivity.promotionName }}</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="活动类型">
|
<FormItem label="活动类型">
|
||||||
<span class="goods-category-name">{{
|
<span v-if="couponActivity.couponActivityType === 'REGISTERED'" >新人发券</span>
|
||||||
getCouponType(form.couponType)
|
<spin v-else>精确发券</spin>
|
||||||
}}</span>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="面额">
|
<FormItem label="活动范围" v-if="couponActivity.couponActivityType === 'SPECIFY'" >
|
||||||
<span class="goods-category-name"> ¥{{ form.price | unitPrice }}</span>
|
<span v-if="couponActivity.activityScope === 'ALL'" >全部会员</span>
|
||||||
|
<spin v-else>指定会员</spin>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="活动说明">
|
<FormItem label="活动时间">
|
||||||
<span class="goods-category-name">{{ form.description }}</span>
|
<span>{{ couponActivity.startTime }}~{{ couponActivity.endTime }}</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="发放总数">
|
<FormItem label="活动状态">
|
||||||
<span class="goods-category-name">{{ form.publishNum }}</span>
|
|
||||||
</FormItem>
|
<span v-if="couponActivity.promotionStatus==='NEW'">新建</span>
|
||||||
<FormItem label="领取限制">
|
<span v-if="couponActivity.promotionStatus==='START'">已开始</span>
|
||||||
<span class="goods-category-name">{{ form.limitNum }}</span>
|
<span v-if="couponActivity.promotionStatus==='END'">已结束</span>
|
||||||
</FormItem>
|
<span v-if="couponActivity.promotionStatus==='CLOSE'">已废弃</span>
|
||||||
<FormItem label="活动开始时间">
|
|
||||||
<span class="goods-category-name">{{ form.startTime }}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="消费限额">
|
|
||||||
<span class="goods-category-name">{{
|
|
||||||
form.consumptionLimit
|
|
||||||
}}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="使用有效期">
|
|
||||||
<span class="goods-category-name">{{ form.startTime }} 至 {{ form.endTime }}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="适用品类范围">
|
|
||||||
<span class="goods-category-name">{{
|
|
||||||
getScopeType(form.scopeType)
|
|
||||||
}}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="品类范围描述">
|
|
||||||
<span class="goods-category-name">{{ form.couponName }}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="状态">
|
|
||||||
<span class="goods-category-name">{{
|
|
||||||
getStatus(form.status)
|
|
||||||
}}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="优惠券类型">
|
|
||||||
<span class="goods-category-name">{{
|
|
||||||
getType(form.getType)
|
|
||||||
}}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="活动创建时间">
|
|
||||||
<span class="goods-category-name">{{ form.createTime }}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="活动最后更新时间">
|
|
||||||
<span class="goods-category-name">{{ form.updateTime }}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="更新管理员名称">
|
|
||||||
<span class="goods-category-name">{{ form.updateBy }}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="已发放数量">
|
|
||||||
<span class="goods-category-name">{{ form.receivedNum }}</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="已使用数量">
|
|
||||||
<span class="goods-category-name">{{ form.usedNum }}</span>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</div>
|
</div>
|
||||||
<h4>适用品类范围</h4>
|
<h4>优惠券列表</h4>
|
||||||
<div>
|
<Table :columns="couponColumn" :data="couponData" ref="table">
|
||||||
<Table :loading="loading" border :columns="columns1" :data="data1" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="page">
|
<h4 v-if="couponActivity.activityScopeInfo && memberData.length>0">会员列表列表</h4>
|
||||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
|
<Table :columns="memberColumn" :data="memberData">
|
||||||
size="small" show-total show-elevator show-sizer></Page>
|
|
||||||
</Row>
|
</Table>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -89,145 +45,78 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPlatformCoupon } from "@/api/promotion";
|
import {getCouponActivity} from "@/api/promotion";
|
||||||
|
|
||||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
|
||||||
import editor from "@/views/my-components/lili/editor";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "addCoupon",
|
name: "couponActivityInfo",
|
||||||
components: {
|
|
||||||
uploadPicThumb,
|
|
||||||
editor,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
modalType: 0, // 当前类型
|
id: this.$route.query.id,//表单id
|
||||||
loading: false, // 表单加载状态
|
couponActivity: "",//券活动
|
||||||
searchForm: {
|
couponColumn: [
|
||||||
// 搜索框初始化对象
|
|
||||||
pageNumber: 1, // 当前页数
|
|
||||||
pageSize: 10, // 页面大小
|
|
||||||
sort: "createTime", // 默认排序字段
|
|
||||||
order: "desc", // 默认排序方式
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
/** 店铺承担比例 */
|
|
||||||
sellerCommission: 0,
|
|
||||||
/** 发行数量 */
|
|
||||||
publishNum: 1,
|
|
||||||
/** 运费承担者 */
|
|
||||||
scopeType: "ALL",
|
|
||||||
/** 消费限额 */
|
|
||||||
consumptionLimit: "",
|
|
||||||
/** 限领数量 */
|
|
||||||
limitNum: 1,
|
|
||||||
/** 活动类型 */
|
|
||||||
couponType: "",
|
|
||||||
/** 优惠券名称 */
|
|
||||||
couponName: "",
|
|
||||||
/** 已被使用数量 */
|
|
||||||
usedNum: 0,
|
|
||||||
/** 已被领取的数量 */
|
|
||||||
receivedNum: 0,
|
|
||||||
},
|
|
||||||
id: this.$route.query.id,
|
|
||||||
columns1: [
|
|
||||||
{
|
{
|
||||||
title: "一级类目",
|
title: "优惠券名称",
|
||||||
key: "name",
|
key: 'couponName'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "二级类目",
|
title: "优惠券金额",
|
||||||
key: "age",
|
key: 'price',
|
||||||
|
render: (h, params) => {
|
||||||
|
let text = "未知";
|
||||||
|
if (params.row.couponType === "DISCOUNT") {
|
||||||
|
text = params.row.price + "折";
|
||||||
|
} else if (params.row.couponType === "PRICE") {
|
||||||
|
text = "¥" + params.row.price;
|
||||||
|
}
|
||||||
|
return h("div", [text]);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "三级类目",
|
title: "优惠券类型",
|
||||||
key: "address",
|
key: 'couponType',
|
||||||
|
render: (h, params) => {
|
||||||
|
let text = "未知";
|
||||||
|
if (params.row.couponType == "DISCOUNT") {
|
||||||
|
text = "打折";
|
||||||
|
} else if (params.row.couponType == "PRICE") {
|
||||||
|
text = "减免现金";
|
||||||
|
}
|
||||||
|
return h("div", [text]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "赠送数量",
|
||||||
|
key: "num",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
couponData: [],
|
||||||
|
memberColumn: [
|
||||||
|
{
|
||||||
|
title: "会员id",
|
||||||
|
key: "id",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "昵称",
|
||||||
|
key: "nickName",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
data1: [
|
memberData: [],
|
||||||
{
|
|
||||||
name: "王小明",
|
|
||||||
age: 18,
|
|
||||||
address: "北京市朝阳区芍药居",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "张小刚",
|
|
||||||
age: 25,
|
|
||||||
address: "北京市海淀区西二旗",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "李小红",
|
|
||||||
age: 30,
|
|
||||||
address: "上海市浦东新区世纪大道",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "周小伟",
|
|
||||||
age: 26,
|
|
||||||
address: "深圳市南山区深南大道",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 如果id不为空则查询信息
|
this.getCouponActivity();
|
||||||
if (this.id) {
|
|
||||||
this.getCoupon();
|
|
||||||
this.modalType = 1;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCouponType(value) {
|
//获取优惠券活动
|
||||||
switch (value) {
|
getCouponActivity() {
|
||||||
case "POINT":
|
getCouponActivity(this.id).then((res) => {
|
||||||
return "打折";
|
this.couponActivity = res.result;
|
||||||
case "PRICE":
|
this.couponData = this.couponActivity.couponActivityItems;
|
||||||
return "减免现金";
|
this.memberData = JSON.parse(this.couponActivity.activityScopeInfo);
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 获取状态 */
|
|
||||||
getStatus(value) {
|
|
||||||
switch (value) {
|
|
||||||
case "NEW":
|
|
||||||
return "新建";
|
|
||||||
case "START":
|
|
||||||
return "开始";
|
|
||||||
case "LOWER":
|
|
||||||
return "结束";
|
|
||||||
case "CANCEL":
|
|
||||||
return "作废";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 关联范围类型 */
|
|
||||||
getScopeType(value) {
|
|
||||||
switch (value) {
|
|
||||||
case "PORTION_CATEGORY":
|
|
||||||
return "部分商品分类";
|
|
||||||
case "PORTION_GOODS":
|
|
||||||
return "指定商品";
|
|
||||||
case "ALL":
|
|
||||||
return "全品类";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 优惠券类型 */
|
|
||||||
getType(value) {
|
|
||||||
switch (value) {
|
|
||||||
case "FREE":
|
|
||||||
return "免费获取";
|
|
||||||
case "ACTIVITY":
|
|
||||||
return "活动获取";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getCoupon() {
|
|
||||||
getPlatformCoupon(this.id).then((res) => {
|
|
||||||
this.form = res.result;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
this.$store.commit("removeTag", "platform-coupon-info");
|
this.$store.commit("removeTag", "coupon-activity");
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -123,10 +123,6 @@ div.base-info-item {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 审核信息-拒绝原因 */
|
|
||||||
.auth-info {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem label="活动时间">
|
<FormItem label="活动时间">
|
||||||
<DatePicker type="datetimerange" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"
|
<DatePicker type="datetimerange" :options="options" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss"
|
||||||
:options="options" style="width: 260px">
|
placeholder="请选择" style="width: 260px">
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
|
@ -30,12 +30,10 @@
|
||||||
<FormItem label="选择会员" prop="scopeType"
|
<FormItem label="选择会员" prop="scopeType"
|
||||||
v-if="form.couponActivityType==='SPECIFY' && form.activityScope==='DESIGNATED'">
|
v-if="form.couponActivityType==='SPECIFY' && form.activityScope==='DESIGNATED'">
|
||||||
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
|
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
|
||||||
</FormItem>
|
<div style="margin-top:24px;" v-if="form.activityScope == 'DESIGNATED'">
|
||||||
{{ selectedMember }}
|
<Table border :columns="userColumns" :data="this.selectedMember">
|
||||||
|
</Table>
|
||||||
<FormItem label="活动描述" prop="activityScopeInfo">
|
</div>
|
||||||
<Input v-model="form.activityScopeInfo" type="textarea" :rows="4" maxlength="50" show-word-limit clearable
|
|
||||||
style="width: 260px"/>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</div>
|
</div>
|
||||||
<h4>配置优惠券</h4>
|
<h4>配置优惠券</h4>
|
||||||
|
@ -61,12 +59,13 @@
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
<Modal v-model="showCouponSelect" width="80%">
|
<Modal @on-ok="()=>{this.showCouponSelect = false}" @on-cancel="()=>{this.showCouponSelect = false}"
|
||||||
<couponTemplate :checked="true" :selectList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon"/>
|
v-model="showCouponSelect" width="80%">
|
||||||
|
<couponTemplate :checked="true" :selectedList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon"/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal width="1200" v-model="checkUserList">
|
<Modal width="1200" v-model="checkUserList">
|
||||||
<userList @callback="callbackSelectUser" ref="memberLayout"/>
|
<userList v-if="checkUserList" @callback="callbackSelectUser" :selectedList="selectedMember" ref="memberLayout"/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -76,10 +75,7 @@ import couponTemplate from "@/views/promotion/coupon/coupon";
|
||||||
|
|
||||||
import userList from "@/views/member/list/index";
|
import userList from "@/views/member/list/index";
|
||||||
|
|
||||||
import {
|
import {saveActivityCoupon, updateCouponActivity} from "@/api/promotion";
|
||||||
saveActivityCoupon,
|
|
||||||
updateCouponActivity,
|
|
||||||
} from "@/api/promotion";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "addCouponActivity",
|
name: "addCouponActivity",
|
||||||
|
@ -89,22 +85,24 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
options: {
|
||||||
|
disabledDate(date) {
|
||||||
|
return date && date.valueOf() < Date.now() - 86400000;
|
||||||
|
},
|
||||||
|
},
|
||||||
showCouponSelect: false, //显示优惠券选择框
|
showCouponSelect: false, //显示优惠券选择框
|
||||||
modalType: 0, // 是否编辑
|
rangeTime: "", //时间区间
|
||||||
rangeTime: '',//时间区间
|
|
||||||
checkUserList: false, //会员选择器
|
checkUserList: false, //会员选择器
|
||||||
selectedMember: [], //选择的会员
|
selectedMember: [], //选择的会员
|
||||||
form: {
|
form: {
|
||||||
promotionName: '', //活动名称
|
promotionName: "", //活动名称
|
||||||
activityScope: 'ALL', //活动范围
|
activityScope: "ALL", //活动范围 ,默认全体发券
|
||||||
couponActivityType: 'REGISTERED', //触发活动方式
|
couponActivityType: "REGISTERED", //触发活动方式 默认新人赠券
|
||||||
activityScopeInfo: '', //活动描述
|
startTime: "", //开始时间
|
||||||
startTime: '', //开始时间
|
endTime: "", //结束时间
|
||||||
endTime: '', //结束时间
|
memberDTOS: [], //指定会员范围
|
||||||
couponActivityItems: []
|
couponActivityItems: [],//优惠券列表
|
||||||
|
},
|
||||||
}, // 表单
|
|
||||||
id: this.$route.query.id, // 优惠券活动id
|
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
selectCouponList: [], //选择的优惠券列表
|
selectCouponList: [], //选择的优惠券列表
|
||||||
formRule: {
|
formRule: {
|
||||||
|
@ -112,7 +110,50 @@ export default {
|
||||||
rangeTime: [{required: true, message: "请选择活动有效期"}],
|
rangeTime: [{required: true, message: "请选择活动有效期"}],
|
||||||
description: [{required: true, message: "请输入范围描述"}],
|
description: [{required: true, message: "请输入范围描述"}],
|
||||||
},
|
},
|
||||||
//优惠券表哥
|
// 用户表格
|
||||||
|
userColumns: [
|
||||||
|
{
|
||||||
|
title: "用户名称",
|
||||||
|
key: "nickName",
|
||||||
|
minWidth: 120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "手机号",
|
||||||
|
key: "mobile",
|
||||||
|
render: (h, params) => {
|
||||||
|
return h("div", params.row.mobile || "暂未填写");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "最后登录时间",
|
||||||
|
key: "lastLoginDate",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"删除"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
//优惠券表格
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: "优惠券名称",
|
title: "优惠券名称",
|
||||||
|
@ -175,7 +216,7 @@ export default {
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
click: () => {
|
click: () => {
|
||||||
// this.delGoods(params.index);
|
this.delCoupon(params.index);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -186,22 +227,62 @@ export default {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async mounted() {
|
|
||||||
// 如果id不为空则查询信息
|
|
||||||
if (this.id) {
|
|
||||||
this.getCoupon();
|
|
||||||
this.modalType = 1;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 返回已选择的用户
|
// 返回已选择的用户
|
||||||
callbackSelectUser(val) {
|
callbackSelectUser(val) {
|
||||||
let index = this.selectedMember.indexOf(val)
|
// 每次将返回的数据回调判断
|
||||||
if (index > 0) {
|
let findUser = this.selectedMember.find((item) => {
|
||||||
this.selectedMember.remove(val);
|
return item.id === val.id;
|
||||||
}
|
});
|
||||||
|
// 如果没有则添加
|
||||||
|
if (!findUser) {
|
||||||
this.selectedMember.push(val);
|
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
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 返回优惠券*/
|
||||||
|
selectedCoupon(val) {
|
||||||
|
this.selectCouponList = val;
|
||||||
|
this.reSelectCoupon();
|
||||||
|
},
|
||||||
|
// 删除选择的优惠券
|
||||||
|
delCoupon(index) {
|
||||||
|
this.selectCouponList.splice(index, 1);
|
||||||
|
this.reSelectCoupon();
|
||||||
|
},
|
||||||
|
reSelectCoupon() {
|
||||||
|
//清空原有数据
|
||||||
|
this.form.couponActivityItems = this.selectCouponList.map((item) => {
|
||||||
|
return {
|
||||||
|
num: 0,
|
||||||
|
couponId: item.id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(this.form.couponActivityItems)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 添加指定用户
|
// 添加指定用户
|
||||||
|
@ -215,68 +296,8 @@ export default {
|
||||||
showSelector() {
|
showSelector() {
|
||||||
this.showCouponSelect = true;
|
this.showCouponSelect = true;
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 返回优惠券*/
|
|
||||||
selectedCoupon(val) {
|
|
||||||
this.selectCouponList = val
|
|
||||||
//清空原有数据
|
|
||||||
this.form.couponActivityItems = [];
|
|
||||||
val.forEach((item, index) => {
|
|
||||||
|
|
||||||
this.form.couponActivityItems.push({
|
|
||||||
num: 0,
|
|
||||||
couponId: item.id
|
|
||||||
})
|
|
||||||
})
|
|
||||||
console.log(val)
|
|
||||||
},
|
|
||||||
|
|
||||||
getCoupon() {
|
|
||||||
/**
|
|
||||||
* 获取优惠券活动详情
|
|
||||||
*/
|
|
||||||
getPlatformCoupon(this.id).then((res) => {
|
|
||||||
let data = res.result;
|
|
||||||
if (!data.promotionGoodsList) data.promotionGoodsList = [];
|
|
||||||
if (data.scopeType == "PORTION_GOODS_CATEGORY") {
|
|
||||||
let prevCascader = data.scopeId.split(",");
|
|
||||||
|
|
||||||
// console.log(prevCascader);
|
|
||||||
function next(params, prev) {
|
|
||||||
for (let i = 0; i < params.length; i++) {
|
|
||||||
const item = params[i];
|
|
||||||
console.log(item);
|
|
||||||
if (item.children) {
|
|
||||||
next(item.children, [...prev, item]);
|
|
||||||
} else {
|
|
||||||
if (prevCascader.includes(item.id)) {
|
|
||||||
prevCascader = prevCascader.map((key) => {
|
|
||||||
if (key === item.id) {
|
|
||||||
let result = prev.map((item) => item.id);
|
|
||||||
|
|
||||||
return [...result, item.id];
|
|
||||||
} else {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
i === params.length - 1 && (prev = []);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
next(this.goodsCategoryList, []);
|
|
||||||
data.scopeIdGoods = prevCascader;
|
|
||||||
}
|
|
||||||
data.rangeTime = [];
|
|
||||||
data.rangeTime.push(new Date(data.startTime), new Date(data.endTime));
|
|
||||||
this.form = data;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 保存平台优惠券 */
|
/** 保存平台优惠券 */
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
|
||||||
this.form.startTime = this.$options.filters.unixToDate(
|
this.form.startTime = this.$options.filters.unixToDate(
|
||||||
this.rangeTime[0] / 1000
|
this.rangeTime[0] / 1000
|
||||||
);
|
);
|
||||||
|
@ -287,9 +308,8 @@ export default {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const params = JSON.parse(JSON.stringify(this.form));
|
const params = JSON.parse(JSON.stringify(this.form));
|
||||||
console.log(params)
|
console.log(params);
|
||||||
this.submitLoading = true;
|
this.submitLoading = true;
|
||||||
if (this.modalType === 0) {
|
|
||||||
// 添加 避免编辑后传入id等数据 记得删除
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
delete params.id;
|
delete params.id;
|
||||||
saveActivityCoupon(params).then((res) => {
|
saveActivityCoupon(params).then((res) => {
|
||||||
|
@ -299,15 +319,6 @@ export default {
|
||||||
this.closeCurrentPage();
|
this.closeCurrentPage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
updateCouponActivity(params).then((res) => {
|
|
||||||
this.submitLoading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("优惠券活动修改成功");
|
|
||||||
this.closeCurrentPage();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -318,7 +329,7 @@ export default {
|
||||||
this.$store.state.app.pageOpenedList
|
this.$store.state.app.pageOpenedList
|
||||||
);
|
);
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,172 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<Card>
|
|
||||||
<Form ref="form" :model="form" :label-width="120">
|
|
||||||
<div class="base-info-item">
|
|
||||||
<h4>优惠券将在指定发放时间发放到用户账号中</h4>
|
|
||||||
<div class="form-item-view">
|
|
||||||
<FormItem label="活动名称" prop="promotionName">
|
|
||||||
<Input type="text" v-model="form.promotionName" placeholder="活动名称" clearable style="width: 260px" />
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="目标客户" prop="vipType">
|
|
||||||
<RadioGroup v-model="vipType">
|
|
||||||
<Radio :label="0">全平台客户</Radio>
|
|
||||||
<Radio :label="1">指定客户</Radio>
|
|
||||||
</RadioGroup>
|
|
||||||
<Button type="primary" v-if="vipType==1" icon="ios-add" @click="addVip" ghost>添加客户</Button>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="发放时间" prop="couponDiscount">
|
|
||||||
<DatePicker type="datetime" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" style="width: 260px">
|
|
||||||
</DatePicker>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="选择优惠券" prop="couponType">
|
|
||||||
<Button type="primary" icon="ios-add" @click="checkCoupon=!checkCoupon" ghost>选择优惠券</Button>
|
|
||||||
<Table class="table" :columns="couponColumns" :data="couponData"></Table>
|
|
||||||
</FormItem>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="margin-left:100px">
|
|
||||||
<Button type="text" @click="closeCurrentPage">返回</Button>
|
|
||||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</Form>
|
|
||||||
<Modal width="1200" v-model="checkCoupon">
|
|
||||||
<couponList checked @selected="callbackSelectCoupon" />
|
|
||||||
</Modal>
|
|
||||||
<Modal width="1200" v-model="checkUserList">
|
|
||||||
<userList @selected="callbackSelectUser" ref="memberLayout" />
|
|
||||||
</Modal>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { addCouponActivity } from "@/api/promotion";
|
|
||||||
|
|
||||||
import couponList from "./coupon";
|
|
||||||
import userList from "@/views/member/list/index";
|
|
||||||
// import userList from ''
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
couponList,
|
|
||||||
userList,
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 选择优惠券
|
|
||||||
checkCoupon: false,
|
|
||||||
// 选择用户
|
|
||||||
checkUserList: false,
|
|
||||||
// 优惠券表格title
|
|
||||||
couponColumns: [
|
|
||||||
{
|
|
||||||
title: "优惠券名称",
|
|
||||||
key: "name",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "有效期",
|
|
||||||
key: "age",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "优惠券数量",
|
|
||||||
key: "address",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
key: "action",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// datpicker时间设置
|
|
||||||
options: {
|
|
||||||
disabledDate(date) {
|
|
||||||
return date && date.valueOf() < Date.now() - 86400000;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
//
|
|
||||||
vipType: 0, //客户会员类型 0全平台客户 1指定客户
|
|
||||||
form: {},
|
|
||||||
formRule: {},
|
|
||||||
id: this.$route.query.id, // 优惠券id
|
|
||||||
|
|
||||||
callbackCoupon: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
// 添加指定用户
|
|
||||||
addVip() {
|
|
||||||
this.checkUserList = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.memberLayout.selectedMember = true;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 返回已选择的用户
|
|
||||||
callbackSelectUser(val){
|
|
||||||
console.log(val)
|
|
||||||
},
|
|
||||||
|
|
||||||
// 返回已选择的优惠券
|
|
||||||
callbackSelectCoupon(val) {
|
|
||||||
if (val.___selected) {
|
|
||||||
this.callbackCoupon.forEach((item, index) => {
|
|
||||||
if (item.id == val.id) this.callbackCoupon.splice(index, 1);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.callbackCoupon.push(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 关闭当前页面
|
|
||||||
closeCurrentPage() {
|
|
||||||
this.$store.commit("removeTag", "add-coupon-specify");
|
|
||||||
localStorage.pageOpenedList = JSON.stringify(
|
|
||||||
this.$store.state.app.pageOpenedList
|
|
||||||
);
|
|
||||||
this.$router.go(-1);
|
|
||||||
},
|
|
||||||
|
|
||||||
async handleSubmit() {
|
|
||||||
let res = await addCouponActivity();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scpoed>
|
|
||||||
.table {
|
|
||||||
width: 800px;
|
|
||||||
margin: 20px 0;
|
|
||||||
}
|
|
||||||
h4 {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
padding: 0 10px;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 40px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.form-item-view {
|
|
||||||
margin: 20px 0;
|
|
||||||
}
|
|
||||||
.describe {
|
|
||||||
font-size: 12px;
|
|
||||||
margin-left: 10px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.effectiveDays {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #999;
|
|
||||||
> * {
|
|
||||||
margin: 0 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -1,250 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="search">
|
|
||||||
<Card>
|
|
||||||
<Table
|
|
||||||
:loading="loading"
|
|
||||||
border
|
|
||||||
:columns="columns"
|
|
||||||
:data="data"
|
|
||||||
ref="table"
|
|
||||||
sortable="custom"
|
|
||||||
@on-sort-change="changeSort"
|
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
>
|
|
||||||
<template slot-scope="{ row }" slot="rangeTime">
|
|
||||||
<div>{{ row.startTime }} ~ {{ row.endTime }}</div>
|
|
||||||
</template>
|
|
||||||
<template slot-scope="{ row }" slot="action">
|
|
||||||
<Button
|
|
||||||
type="error"
|
|
||||||
ghost
|
|
||||||
size="small"
|
|
||||||
:disabled="row.memberCouponStatus != 'NEW'"
|
|
||||||
@click="remove(row)"
|
|
||||||
>作废</Button
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</Table>
|
|
||||||
<Row type="flex" justify="end" class="page">
|
|
||||||
<Page
|
|
||||||
:current="searchForm.pageNumber"
|
|
||||||
:total="total"
|
|
||||||
:page-size="searchForm.pageSize"
|
|
||||||
@on-change="changePage"
|
|
||||||
@on-page-size-change="changePageSize"
|
|
||||||
:page-size-opts="[10, 20, 50]"
|
|
||||||
size="small"
|
|
||||||
show-total
|
|
||||||
show-elevator
|
|
||||||
show-sizer
|
|
||||||
></Page>
|
|
||||||
</Row>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
getMemberReceiveCouponList,
|
|
||||||
deleteMemberReceiveCoupon,
|
|
||||||
} from "@/api/promotion";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "memberReceiveCoupon",
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: true, // 表单加载状态
|
|
||||||
|
|
||||||
searchForm: {
|
|
||||||
// 搜索框初始化对象
|
|
||||||
pageNumber: 1, // 当前页数
|
|
||||||
pageSize: 10, // 页面大小
|
|
||||||
sort: "createTime", // 默认排序字段
|
|
||||||
order: "desc", // 默认排序方式
|
|
||||||
},
|
|
||||||
id: this.$route.query.id, // 优惠券id
|
|
||||||
|
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
|
||||||
selectList: [], // 多选数据
|
|
||||||
columns: [
|
|
||||||
// 表头
|
|
||||||
{
|
|
||||||
title: "优惠券编号",
|
|
||||||
key: "couponId",
|
|
||||||
minWidth: 120,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "面额",
|
|
||||||
key: "price",
|
|
||||||
render: (h, params) => {
|
|
||||||
return h(
|
|
||||||
"div",
|
|
||||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "消费门槛",
|
|
||||||
key: "consumeThreshold",
|
|
||||||
render: (h, params) => {
|
|
||||||
return h(
|
|
||||||
"div",
|
|
||||||
this.$options.filters.unitPrice(params.row.consumeThreshold, "¥")
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "有效期",
|
|
||||||
slot: "rangeTime",
|
|
||||||
minWidth: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "会员名称",
|
|
||||||
key: "memberName",
|
|
||||||
minWidth: 120
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "适用范围",
|
|
||||||
key: "couponType",
|
|
||||||
minWidth: 50,
|
|
||||||
render: (h, params) => {
|
|
||||||
let text = "未知";
|
|
||||||
if (params.row.scopeType == "ALL") {
|
|
||||||
text = "全品类";
|
|
||||||
} else if (params.row.scopeType == "PORTION_CATEGORY") {
|
|
||||||
text = "部分商品分类";
|
|
||||||
} else if (params.row.scopeType == "PORTION_GOODS") {
|
|
||||||
text = "指定商品";
|
|
||||||
}
|
|
||||||
return h("div", [text]);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "会员名称",
|
|
||||||
key: "memberName",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "状态",
|
|
||||||
key: "memberCouponStatus",
|
|
||||||
minWidth: 50,
|
|
||||||
render: (h, params) => {
|
|
||||||
let text = "未知",
|
|
||||||
color = "";
|
|
||||||
if (params.row.memberCouponStatus == "NEW") {
|
|
||||||
text = "未使用";
|
|
||||||
color = "default";
|
|
||||||
} else if (params.row.memberCouponStatus == "USED") {
|
|
||||||
text = "已使用";
|
|
||||||
color = "green";
|
|
||||||
} else if (params.row.memberCouponStatus == "EXPIRE") {
|
|
||||||
text = "已过期";
|
|
||||||
color = "red";
|
|
||||||
} else if (params.row.memberCouponStatus == "CLOSED") {
|
|
||||||
text = "已作废";
|
|
||||||
color = "red";
|
|
||||||
}
|
|
||||||
return h("div", [
|
|
||||||
h(
|
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: color,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
text
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
slot: "action",
|
|
||||||
align: "center",
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
data: [], // 表单数据
|
|
||||||
total: 0, // 表单数据总数
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
changePage(v) {
|
|
||||||
this.searchForm.pageNumber = v;
|
|
||||||
this.getDataList();
|
|
||||||
this.clearSelectAll();
|
|
||||||
},
|
|
||||||
changePageSize(v) {
|
|
||||||
this.searchForm.pageSize = v;
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
handleSearch() {
|
|
||||||
this.searchForm.pageNumber = 1;
|
|
||||||
this.searchForm.pageSize = 10;
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
handleReset() {
|
|
||||||
this.$refs.searchForm.resetFields();
|
|
||||||
this.searchForm.pageNumber = 1;
|
|
||||||
this.searchForm.pageSize = 10;
|
|
||||||
// 重新加载数据
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
changeSort(e) {
|
|
||||||
this.searchForm.sort = e.key;
|
|
||||||
this.searchForm.order = e.order;
|
|
||||||
if (e.order === "normal") {
|
|
||||||
this.searchForm.order = "";
|
|
||||||
}
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
clearSelectAll() {
|
|
||||||
this.$refs.table.selectAll(false);
|
|
||||||
},
|
|
||||||
changeSelect(e) {
|
|
||||||
this.selectList = e;
|
|
||||||
},
|
|
||||||
/** 查询单个优惠券领取详情 */
|
|
||||||
getDataList() {
|
|
||||||
this.loading = true;
|
|
||||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
|
||||||
getMemberReceiveCouponList(this.id).then((res) => {
|
|
||||||
this.loading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.data = res.result.records;
|
|
||||||
this.total = res.result.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.total = this.data.length;
|
|
||||||
this.loading = false;
|
|
||||||
},
|
|
||||||
/** 作废优惠券 */
|
|
||||||
remove(v) {
|
|
||||||
this.$Modal.confirm({
|
|
||||||
title: "确认作废",
|
|
||||||
content: "您确认要作废此优惠券?",
|
|
||||||
loading: true,
|
|
||||||
onOk: () => {
|
|
||||||
// 删除
|
|
||||||
deleteMemberReceiveCoupon(v.id).then((res) => {
|
|
||||||
this.$Modal.remove();
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("作废成功");
|
|
||||||
this.getDataList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
@import "@/styles/table-common.scss";
|
|
||||||
</style>
|
|
|
@ -132,19 +132,19 @@ export default {
|
||||||
minWidth: 60,
|
minWidth: 60,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
let text = "未知",
|
let text = "未知",
|
||||||
color = "default";
|
color = "purple";
|
||||||
if (params.row.promotionStatus == "NEW") {
|
if (params.row.promotionStatus == "NEW") {
|
||||||
text = "未开始";
|
text = "未开始";
|
||||||
color = "default";
|
color = "geekblue";
|
||||||
} else if (params.row.promotionStatus == "START") {
|
} else if (params.row.promotionStatus == "START") {
|
||||||
text = "已开始";
|
text = "已开始";
|
||||||
color = "green";
|
color = "blue";
|
||||||
} else if (params.row.promotionStatus == "END") {
|
} else if (params.row.promotionStatus == "END") {
|
||||||
text = "已结束";
|
text = "已结束";
|
||||||
color = "blue";
|
color = "green";
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
} else if (params.row.promotionStatus == "CLOSE") {
|
||||||
text = "已关闭";
|
text = "已关闭";
|
||||||
color = "red";
|
color = "volcano";
|
||||||
}
|
}
|
||||||
return h("div", [
|
return h("div", [
|
||||||
h(
|
h(
|
||||||
|
|
|
@ -184,18 +184,18 @@ export default {
|
||||||
* 是否推荐
|
* 是否推荐
|
||||||
*/
|
*/
|
||||||
async star(val, index) {
|
async star(val, index) {
|
||||||
let switched
|
let switched;
|
||||||
if (this.liveData[index].recommend) {
|
if (this.liveData[index].recommend) {
|
||||||
this.$set(this.liveData[index],'recommend',false)
|
this.$set(this.liveData[index], "recommend", false);
|
||||||
switched = false
|
switched = false;
|
||||||
}
|
} else {
|
||||||
else{
|
this.$set(this.liveData[index], "recommend", true);
|
||||||
|
switched = true;
|
||||||
this.$set(this.liveData[index],'recommend',true)
|
|
||||||
switched = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await whetherStar({ id: val.id, recommend: switched });
|
await whetherStar({ id: val.id, recommend: switched });
|
||||||
|
|
||||||
|
this.getStoreLives();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -122,16 +122,16 @@ export default {
|
||||||
color = "";
|
color = "";
|
||||||
if (params.row.promotionStatus == "NEW") {
|
if (params.row.promotionStatus == "NEW") {
|
||||||
text = "未开始";
|
text = "未开始";
|
||||||
color = "default";
|
color = "geekblue";
|
||||||
} else if (params.row.promotionStatus == "START") {
|
} else if (params.row.promotionStatus == "START") {
|
||||||
text = "已开始";
|
text = "已开始";
|
||||||
color = "green";
|
color = "blue";
|
||||||
} else if (params.row.promotionStatus == "END") {
|
} else if (params.row.promotionStatus == "END") {
|
||||||
text = "已结束";
|
text = "已结束";
|
||||||
color = "blue";
|
color = "green";
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
} else if (params.row.promotionStatus == "CLOSE") {
|
||||||
text = "已关闭";
|
text = "已关闭";
|
||||||
color = "red";
|
color = "volcano";
|
||||||
}
|
}
|
||||||
return h("div", [
|
return h("div", [
|
||||||
h(
|
h(
|
||||||
|
|
|
@ -213,16 +213,16 @@ export default {
|
||||||
color = "";
|
color = "";
|
||||||
if (params.row.promotionStatus == "NEW") {
|
if (params.row.promotionStatus == "NEW") {
|
||||||
text = "未开始";
|
text = "未开始";
|
||||||
color = "default";
|
color = "geekblue";
|
||||||
} else if (params.row.promotionStatus == "START") {
|
} else if (params.row.promotionStatus == "START") {
|
||||||
text = "已开始";
|
text = "已开始";
|
||||||
color = "green";
|
color = "blue";
|
||||||
} else if (params.row.promotionStatus == "END") {
|
} else if (params.row.promotionStatus == "END") {
|
||||||
text = "已结束";
|
text = "已结束";
|
||||||
color = "blue";
|
color = "green";
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
} else if (params.row.promotionStatus == "CLOSE") {
|
||||||
text = "已关闭";
|
text = "已关闭";
|
||||||
color = "red";
|
color = "volcano";
|
||||||
}
|
}
|
||||||
return h("div", [h("Tag", { props: { color: color } }, text)]);
|
return h("div", [h("Tag", { props: { color: color } }, text)]);
|
||||||
},
|
},
|
||||||
|
|
|
@ -102,41 +102,13 @@ export default {
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.promotionStatus == "NEW") {
|
if (params.row.promotionStatus == "NEW") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "volcano",},},"新建");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "新建",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "START") {
|
} else if (params.row.promotionStatus == "START") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "blue",},},"开始");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "success",
|
|
||||||
text: "开始",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "END") {
|
} else if (params.row.promotionStatus == "END") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "green",},},"结束");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "结束",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
} else if (params.row.promotionStatus == "CLOSE") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "volcano",},},"结束");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "废弃",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div v-if="templateShow">
|
||||||
<Form :model="form" :label-width="120">
|
<Form :model="form" :label-width="120">
|
||||||
<FormItem label="每日场次设置">
|
<FormItem label="每日场次设置">
|
||||||
<Row :gutter="16" class="row">
|
<Row :gutter="16" class="row">
|
||||||
|
@ -27,6 +27,7 @@ import { getSetting, setSetting } from "@/api/index";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
templateShow:false,
|
||||||
submitLoading: false,
|
submitLoading: false,
|
||||||
selectedTime: [],
|
selectedTime: [],
|
||||||
times: [], //时间集合 1-24点
|
times: [], //时间集合 1-24点
|
||||||
|
@ -81,6 +82,7 @@ export default {
|
||||||
async init() {
|
async init() {
|
||||||
let result = await getSetting("SECKILL_SETTING");
|
let result = await getSetting("SECKILL_SETTING");
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
this.templateShow = true
|
||||||
this.form.seckillRule = result.result.seckillRule;
|
this.form.seckillRule = result.result.seckillRule;
|
||||||
this.times=[]
|
this.times=[]
|
||||||
for (let i = 0; i < 24; i++) {
|
for (let i = 0; i < 24; i++) {
|
||||||
|
|
|
@ -303,7 +303,7 @@ export default {
|
||||||
content: "更新后店铺以及用户地区绑定数据将全部错乱",
|
content: "更新后店铺以及用户地区绑定数据将全部错乱",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
let timer;
|
let timer;
|
||||||
let numer;
|
let number;
|
||||||
|
|
||||||
this.asyncLoading = true
|
this.asyncLoading = true
|
||||||
|
|
||||||
|
@ -319,7 +319,8 @@ export default {
|
||||||
click: () => {
|
click: () => {
|
||||||
this.$Message.destroy();
|
this.$Message.destroy();
|
||||||
this.asyncLoading = false
|
this.asyncLoading = false
|
||||||
clearInterval(timer, numer);
|
clearInterval(number);
|
||||||
|
clearTimeout(timer)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -329,11 +330,12 @@ export default {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
numer = setInterval(() => {
|
number = setInterval(() => {
|
||||||
this.num--;
|
this.num--;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
|
clearInterval(number)
|
||||||
asyncRegion().then((res) => {
|
asyncRegion().then((res) => {
|
||||||
this.asyncLoading = false
|
this.asyncLoading = false
|
||||||
this.$Message.loading("地区数据正在更新中!");
|
this.$Message.loading("地区数据正在更新中!");
|
||||||
|
|
|
@ -95,13 +95,13 @@ export default {
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.billStatus == "OUT") {
|
if (params.row.billStatus == "OUT") {
|
||||||
return h("div", "已出账");
|
return h("Tag", {props: {color: "blue",},},"已出账");
|
||||||
} else if (params.row.billStatus == "CHECK") {
|
} else if (params.row.billStatus == "CHECK") {
|
||||||
return h("div", "已对账");
|
return h("Tag", {props: {color: "geekblue",},},"已对账");
|
||||||
} else if (params.row.billStatus == "EXAMINE") {
|
} else if (params.row.billStatus == "EXAMINE") {
|
||||||
return h("div", "已审核");
|
return h("Tag", {props: {color: "purple",},},"已审核");
|
||||||
} else {
|
} else {
|
||||||
return h("div", "已付款");
|
return h("Tag", {props: {color: "green",},},"已付款");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -189,7 +189,7 @@ export default {
|
||||||
(this.searchForm.endTime = this.$options.filters.unixToDate(
|
(this.searchForm.endTime = this.$options.filters.unixToDate(
|
||||||
this.searchForm.endTime / 1000
|
this.searchForm.endTime / 1000
|
||||||
));
|
));
|
||||||
this.searchForm.billStatus = "OUT";
|
this.searchForm.billStatus = "CHECK";
|
||||||
API_Shop.getBuyBillPage(this.searchForm).then((res) => {
|
API_Shop.getBuyBillPage(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
@ -106,13 +106,13 @@ export default {
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.billStatus == "OUT") {
|
if (params.row.billStatus == "OUT") {
|
||||||
return h("div", "已出账");
|
return h("Tag", {props: {color: "blue",},},"已出账");
|
||||||
} else if (params.row.billStatus == "CHECK") {
|
} else if (params.row.billStatus == "CHECK") {
|
||||||
return h("div", "已对账");
|
return h("Tag", {props: {color: "geekblue",},},"已对账");
|
||||||
} else if (params.row.billStatus == "EXAMINE") {
|
} else if (params.row.billStatus == "EXAMINE") {
|
||||||
return h("div", "已审核");
|
return h("Tag", {props: {color: "purple",},},"已审核");
|
||||||
} else {
|
} else {
|
||||||
return h("div", "已付款");
|
return h("Tag", {props: {color: "green",},},"已付款");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -126,7 +126,7 @@ export default {
|
||||||
"Tag",
|
"Tag",
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
color: params.row.selfOperated ? "error" : "success",
|
color: params.row.selfOperated ? "volcano" : "green",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
params.row.selfOperated ? "自营" : "非自营"
|
params.row.selfOperated ? "自营" : "非自营"
|
||||||
|
@ -141,50 +141,15 @@ export default {
|
||||||
width: 130,
|
width: 130,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.storeDisable == "OPEN") {
|
if (params.row.storeDisable == "OPEN") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "green",},},"开启中");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "success",
|
|
||||||
text: "开启中",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.storeDisable == "CLOSED") {
|
} else if (params.row.storeDisable == "CLOSED") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "volcano",},},"已关闭");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "已关闭",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.storeDisable == "APPLY") {
|
} else if (params.row.storeDisable == "APPLY") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "geekblue",},},"申请中");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "申请中",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.storeDisable == "APPLYING") {
|
} else if (params.row.storeDisable == "APPLYING") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "purple",},},"审核中");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "审核中",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.storeDisable == "REFUSED") {
|
} else if (params.row.storeDisable == "REFUSED") {
|
||||||
return h("div", [
|
return h("Tag", {props: {color: "red",},},"审核拒绝");
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "审核拒绝",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div class="shop-item">
|
<div class="shop-item">
|
||||||
<div class="label-item">
|
<div class="label-item">
|
||||||
<span>订单来源</span>
|
<span>订单来源</span>
|
||||||
<span>{{res.clientType}}</span>
|
<span>{{res.clientType | clientTypeWay}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="label-item">
|
<div class="label-item">
|
||||||
<span>订单状态</span>
|
<span>订单状态</span>
|
||||||
|
|
|
@ -347,6 +347,7 @@ export default {
|
||||||
this.form.versionUpdateDate / 1000
|
this.form.versionUpdateDate / 1000
|
||||||
);
|
);
|
||||||
this.form.versionUpdateDate = versionUpdateDate;
|
this.form.versionUpdateDate = versionUpdateDate;
|
||||||
|
|
||||||
this.form.updateTime = versionUpdateDate;
|
this.form.updateTime = versionUpdateDate;
|
||||||
if (this.modalType == 0) {
|
if (this.modalType == 0) {
|
||||||
// 添加 避免编辑后传入id等数据 记得删除
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
"sockjs-client": "^1.4.0",
|
"sockjs-client": "^1.4.0",
|
||||||
"stompjs": "^2.3.3",
|
"stompjs": "^2.3.3",
|
||||||
"swiper": "^6.3.5",
|
"swiper": "^6.3.5",
|
||||||
"vue-qr": "^2.3.0",
|
"uuid": "^8.3.2",
|
||||||
"view-design": "^4.2.0",
|
"view-design": "^4.2.0",
|
||||||
"vue": "^2.6.10",
|
"vue": "^2.6.10",
|
||||||
"vue-awesome": "^4.0.2",
|
"vue-awesome": "^4.0.2",
|
||||||
|
@ -37,15 +37,16 @@
|
||||||
"vue-clipboard2": "^0.3.0",
|
"vue-clipboard2": "^0.3.0",
|
||||||
"vue-cropper": "^0.4.9",
|
"vue-cropper": "^0.4.9",
|
||||||
"vue-i18n": "^8.15.1",
|
"vue-i18n": "^8.15.1",
|
||||||
|
"vue-json-excel": "^0.3.0",
|
||||||
"vue-json-pretty": "^1.4.1",
|
"vue-json-pretty": "^1.4.1",
|
||||||
"vue-lazyload": "^1.3.3",
|
"vue-lazyload": "^1.3.3",
|
||||||
|
"vue-qr": "^2.3.0",
|
||||||
"vue-router": "^3.1.3",
|
"vue-router": "^3.1.3",
|
||||||
"vuedraggable": "^2.23.2",
|
"vuedraggable": "^2.23.2",
|
||||||
"vuex": "^3.4.0",
|
"vuex": "^3.4.0",
|
||||||
"wangeditor": "^4.6.13",
|
"wangeditor": "^4.6.13",
|
||||||
"xlsx": "^0.16.2",
|
"xlsx": "^0.16.2",
|
||||||
"xss": "^1.0.7",
|
"xss": "^1.0.7"
|
||||||
"uuid": "^8.3.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^4.4.4",
|
"@vue/cli-plugin-babel": "^4.4.4",
|
||||||
|
|
|
@ -1,116 +1,130 @@
|
||||||
// 统一请求路径前缀在libs/axios.js中修改
|
// 统一请求路径前缀在libs/axios.js中修改
|
||||||
import {getRequest, postRequest, putRequest} from '@/libs/axios';
|
import { getRequest, postRequest, putRequest ,postRequestWithNoForm } from "@/libs/axios";
|
||||||
|
|
||||||
|
import { baseUrl } from "@/libs/axios.js";
|
||||||
|
|
||||||
|
// 下载待发货的订单列表
|
||||||
|
export const verificationCode = verificationCode => {
|
||||||
|
return getRequest(`/orders/getOrderByVerificationCode/${verificationCode}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 下载待发货的订单列表
|
||||||
|
export const downLoadDeliverExcel = params => {
|
||||||
|
return getRequest(`/orders/downLoadDeliverExcel`, params, 'blob');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 上传待发货的订单列表
|
||||||
|
export const uploadDeliverExcel = params => {
|
||||||
|
return postRequestWithNoForm(`/orders/batchDeliver`, params );
|
||||||
|
};
|
||||||
|
|
||||||
// 获取普通订单列表
|
// 获取普通订单列表
|
||||||
export const getOrderList = (params) => {
|
export const getOrderList = params => {
|
||||||
return getRequest(`/orders`, params)
|
return getRequest(`/orders`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 获取普通订单详细信息
|
// 获取普通订单详细信息
|
||||||
export const getOrderDetail = (sn) => {
|
export const getOrderDetail = sn => {
|
||||||
return getRequest(`/orders/${sn}`)
|
return getRequest(`/orders/${sn}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 调整订单金额
|
// 调整订单金额
|
||||||
export const modifyOrderPrice = (sn, params) => {
|
export const modifyOrderPrice = (sn, params) => {
|
||||||
return putRequest(`/orders/update/${sn}/price`, params)
|
return putRequest(`/orders/update/${sn}/price`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 取消订单
|
// 取消订单
|
||||||
export const cancelOrder = (sn, params) => {
|
export const cancelOrder = (sn, params) => {
|
||||||
return postRequest(`/orders/${sn}/cancel`, params)
|
return postRequest(`/orders/${sn}/cancel`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 修改收货地址
|
// 修改收货地址
|
||||||
export const editOrderConsignee = (sn, params) => {
|
export const editOrderConsignee = (sn, params) => {
|
||||||
return postRequest(`/orders/update/${sn}/consignee`, params)
|
return postRequest(`/orders/update/${sn}/consignee`, params);
|
||||||
}
|
};
|
||||||
//获取投诉列表
|
//获取投诉列表
|
||||||
export const getComplainPage = (params) => {
|
export const getComplainPage = params => {
|
||||||
return getRequest(`/complain`, params)
|
return getRequest(`/complain`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
//获取投诉详情
|
//获取投诉详情
|
||||||
export const getComplainDetail = (id) => {
|
export const getComplainDetail = id => {
|
||||||
return getRequest(`/complain/${id}`)
|
return getRequest(`/complain/${id}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
//添加交易投诉对话
|
//添加交易投诉对话
|
||||||
export const addOrderComplaint = (params) => {
|
export const addOrderComplaint = params => {
|
||||||
return postRequest(`/complain/communication/`, params)
|
return postRequest(`/complain/communication/`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
//添加交易投诉对话
|
//添加交易投诉对话
|
||||||
export const appeal = (params) => {
|
export const appeal = params => {
|
||||||
return putRequest(`/complain/appeal`, params)
|
return putRequest(`/complain/appeal`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
//获取订单日志
|
//获取订单日志
|
||||||
export const getOrderLog = (sn, params) => {
|
export const getOrderLog = (sn, params) => {
|
||||||
return getRequest(`/orderLog/${sn}`, params)
|
return getRequest(`/orderLog/${sn}`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 订单发货
|
// 订单发货
|
||||||
export const orderDelivery = (sn, params) => {
|
export const orderDelivery = (sn, params) => {
|
||||||
return postRequest(`/orders/${sn}/delivery`, params)
|
return postRequest(`/orders/${sn}/delivery`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 获取商家选中的物流公司
|
// 获取商家选中的物流公司
|
||||||
export const getLogisticsChecked = () => {
|
export const getLogisticsChecked = () => {
|
||||||
return getRequest(`/logistics/getChecked`)
|
return getRequest(`/logistics/getChecked`);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 订单核验
|
// 订单核验
|
||||||
export const orderTake = (sn, params) => {
|
export const orderTake = (sn, verificationCode) => {
|
||||||
return postRequest(`/orders/${sn}/take`, params)
|
return putRequest(`/orders/take/${sn}/${verificationCode}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 售后服务单
|
// 售后服务单
|
||||||
export const afterSaleOrderPage = (params) => {
|
export const afterSaleOrderPage = params => {
|
||||||
return getRequest(`/afterSale/page`, params)
|
return getRequest(`/afterSale/page`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 售后服务单详情
|
// 售后服务单详情
|
||||||
export const afterSaleOrderDetail = (sn) => {
|
export const afterSaleOrderDetail = sn => {
|
||||||
return getRequest(`/afterSale/${sn}`)
|
return getRequest(`/afterSale/${sn}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 商家审核
|
// 商家审核
|
||||||
export const afterSaleSellerReview = (sn, params) => {
|
export const afterSaleSellerReview = (sn, params) => {
|
||||||
return putRequest(`/afterSale/review/${sn}`, params)
|
return putRequest(`/afterSale/review/${sn}`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 商家确认收货
|
// 商家确认收货
|
||||||
export const afterSaleSellerConfirm = (sn, params) => {
|
export const afterSaleSellerConfirm = (sn, params) => {
|
||||||
return putRequest(`/afterSale/confirm/${sn}`, params)
|
return putRequest(`/afterSale/confirm/${sn}`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
// 商家换货业务发货
|
// 商家换货业务发货
|
||||||
export const afterSaleSellerDelivery = (sn, params) => {
|
export const afterSaleSellerDelivery = (sn, params) => {
|
||||||
return postRequest(`/afterSale/${sn}/delivery`, params)
|
return postRequest(`/afterSale/${sn}/delivery`, params);
|
||||||
}
|
};
|
||||||
//查询物流
|
//查询物流
|
||||||
export const getTraces = (sn, params) => {
|
export const getTraces = (sn, params) => {
|
||||||
return postRequest(`/orders/getTraces/${sn}`, params)
|
return postRequest(`/orders/getTraces/${sn}`, params);
|
||||||
}
|
};
|
||||||
//售后单查询物流
|
//售后单查询物流
|
||||||
export const getSellerDeliveryTraces = (sn, params) => {
|
export const getSellerDeliveryTraces = (sn, params) => {
|
||||||
return getRequest(`/afterSale/getSellerDeliveryTraces/${sn}`, params)
|
return getRequest(`/afterSale/getSellerDeliveryTraces/${sn}`, params);
|
||||||
}
|
};
|
||||||
//售后单查询物流
|
//售后单查询物流
|
||||||
export const getAfterSaleTraces = (sn, params) => {
|
export const getAfterSaleTraces = (sn, params) => {
|
||||||
return getRequest(`/afterSale/getDeliveryTraces/${sn}`, params)
|
return getRequest(`/afterSale/getDeliveryTraces/${sn}`, params);
|
||||||
}
|
};
|
||||||
//获取发票列表
|
//获取发票列表
|
||||||
export const getReceiptPage = (params) => {
|
export const getReceiptPage = params => {
|
||||||
return getRequest(`/receipt`, params)
|
return getRequest(`/receipt`, params);
|
||||||
}
|
};
|
||||||
|
|
||||||
//获取发票列表
|
//获取发票列表
|
||||||
export const invoicing = (id) => {
|
export const invoicing = id => {
|
||||||
return postRequest(`receipt/${id}/invoicing`)
|
return postRequest(`receipt/${id}/invoicing`);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 754 B |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 234 KiB After Width: | Height: | Size: 390 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 2.4 KiB |
|
@ -22,10 +22,10 @@ export default {
|
||||||
buyer: 'https://buyer-api.pickmall.cn',
|
buyer: 'https://buyer-api.pickmall.cn',
|
||||||
seller: 'https://store-api.pickmall.cn',
|
seller: 'https://store-api.pickmall.cn',
|
||||||
manager: 'https://admin-api.pickmall.cn',
|
manager: 'https://admin-api.pickmall.cn',
|
||||||
common: 'http://192.168.0.109:8890',
|
// common: 'http://192.168.0.109:8890',
|
||||||
buyer: 'http://192.168.0.109:8888',
|
// buyer: 'http://192.168.0.109:8888',
|
||||||
seller: 'http://192.168.0.109:8889',
|
// seller: 'http://192.168.0.109:8889',
|
||||||
manager: 'http://192.168.0.109:8887'
|
// manager: 'http://192.168.0.109:8887'
|
||||||
},
|
},
|
||||||
api_prod: {
|
api_prod: {
|
||||||
common: 'https://common-api.pickmall.cn',
|
common: 'https://common-api.pickmall.cn',
|
||||||
|
|
|
@ -4,28 +4,34 @@ import { getStore, setStore } from "./storage";
|
||||||
import { router } from "../router/index";
|
import { router } from "../router/index";
|
||||||
import { Message } from "view-design";
|
import { Message } from "view-design";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import {handleRefreshToken} from "@/api/index"
|
import { handleRefreshToken } from "@/api/index";
|
||||||
|
|
||||||
// 统一请求路径前缀
|
// 统一请求路径前缀
|
||||||
export const baseUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.seller : config.api_prod.seller) + config.baseUrlPrefix;
|
export const baseUrl =
|
||||||
export const commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common);
|
(process.env.NODE_ENV === "development"
|
||||||
|
? config.api_dev.seller
|
||||||
|
: config.api_prod.seller) + config.baseUrlPrefix;
|
||||||
|
export const commonUrl =
|
||||||
|
process.env.NODE_ENV === "development"
|
||||||
|
? config.api_dev.common
|
||||||
|
: config.api_prod.common;
|
||||||
|
|
||||||
var isRefreshToken = 0;
|
var isRefreshToken = 0;
|
||||||
const refreshToken = getTokenDebounce()
|
const refreshToken = getTokenDebounce();
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
baseURL: baseUrl
|
baseURL: baseUrl
|
||||||
})
|
});
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
if (config.method == 'get') {
|
if (config.method == "get") {
|
||||||
config.params = {
|
config.params = {
|
||||||
_t: Date.parse(new Date()) / 1000,
|
_t: Date.parse(new Date()) / 1000,
|
||||||
...config.params
|
...config.params
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
const uuid = getStore("uuid");
|
||||||
const uuid = getStore('uuid');
|
config.headers["uuid"] = uuid;
|
||||||
config.headers['uuid'] = uuid;
|
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -85,7 +91,6 @@ service.interceptors.response.use(
|
||||||
},
|
},
|
||||||
async error => {
|
async error => {
|
||||||
// 返回状态码不为200时候的错误处理
|
// 返回状态码不为200时候的错误处理
|
||||||
|
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
if (error.response.status === 401) {
|
if (error.response.status === 401) {
|
||||||
// 这种情况一般调到登录页
|
// 这种情况一般调到登录页
|
||||||
|
@ -93,22 +98,25 @@ service.interceptors.response.use(
|
||||||
isRefreshToken++;
|
isRefreshToken++;
|
||||||
if (isRefreshToken === 1) {
|
if (isRefreshToken === 1) {
|
||||||
const getTokenRes = await refreshToken();
|
const getTokenRes = await refreshToken();
|
||||||
if (getTokenRes === 'success') { // 刷新token
|
if (getTokenRes === "success") {
|
||||||
|
// 刷新token
|
||||||
if (isRefreshToken === 1) {
|
if (isRefreshToken === 1) {
|
||||||
error.response.config.headers.accessToken = getStore('accessToken')
|
error.response.config.headers.accessToken = getStore(
|
||||||
return service(error.response.config)
|
"accessToken"
|
||||||
|
);
|
||||||
|
return service(error.response.config);
|
||||||
} else {
|
} else {
|
||||||
router.go(0)
|
router.go(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Cookies.set("userInfo", "");
|
Cookies.set("userInfo", "");
|
||||||
router.push('/login')
|
router.push("/login");
|
||||||
}
|
}
|
||||||
isRefreshToken = 0
|
isRefreshToken = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 其他错误处理
|
// 其他错误处理
|
||||||
Message.error(error.response.data.message)
|
Message.error(error.response.data.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,59 +127,65 @@ service.interceptors.response.use(
|
||||||
|
|
||||||
// 防抖闭包来一波
|
// 防抖闭包来一波
|
||||||
function getTokenDebounce() {
|
function getTokenDebounce() {
|
||||||
let lock = false
|
let lock = false;
|
||||||
let success = false
|
let success = false;
|
||||||
return function() {
|
return function() {
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
lock = true
|
lock = true;
|
||||||
let oldRefreshToken = getStore("refreshToken");
|
let oldRefreshToken = getStore("refreshToken");
|
||||||
handleRefreshToken(oldRefreshToken).then(res => {
|
handleRefreshToken(oldRefreshToken)
|
||||||
|
.then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let {
|
let { accessToken, refreshToken } = res.result;
|
||||||
accessToken,
|
|
||||||
refreshToken
|
|
||||||
} = res.result;
|
|
||||||
setStore("accessToken", accessToken);
|
setStore("accessToken", accessToken);
|
||||||
setStore("refreshToken", refreshToken);
|
setStore("refreshToken", refreshToken);
|
||||||
|
|
||||||
success = true
|
success = true;
|
||||||
lock = false
|
lock = false;
|
||||||
} else {
|
} else {
|
||||||
success = false
|
success = false;
|
||||||
lock = false
|
lock = false;
|
||||||
// router.push('/login')
|
// router.push('/login')
|
||||||
}
|
}
|
||||||
}).catch((err) => {
|
|
||||||
success = false
|
|
||||||
lock = false
|
|
||||||
})
|
})
|
||||||
|
.catch(err => {
|
||||||
|
success = false;
|
||||||
|
lock = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// 一直看lock,直到请求失败或者成功
|
// 一直看lock,直到请求失败或者成功
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
clearInterval(timer)
|
clearInterval(timer);
|
||||||
if (success) {
|
if (success) {
|
||||||
resolve('success')
|
resolve("success");
|
||||||
} else {
|
} else {
|
||||||
resolve('fail')
|
resolve("fail");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 500) // 轮询时间间隔
|
}, 500); // 轮询时间间隔
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getRequest = (url, params) => {
|
export const getRequest = (url, params, resBlob) => {
|
||||||
let accessToken = getStore("accessToken");
|
let accessToken = getStore("accessToken");
|
||||||
return service({
|
let data = {
|
||||||
method: "get",
|
method: "get",
|
||||||
url: `${url}`,
|
url: `${url}`,
|
||||||
params: params,
|
params: params,
|
||||||
headers: {
|
headers: {
|
||||||
accessToken: accessToken
|
accessToken: accessToken
|
||||||
|
},
|
||||||
|
responseType: "blob"
|
||||||
|
};
|
||||||
|
if (resBlob != "blob") {
|
||||||
|
delete data.responseType;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
|
return service(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const postRequest = (url, params, headers) => {
|
export const postRequest = (url, params, headers) => {
|
||||||
|
@ -232,7 +246,6 @@ export const postRequestWithHeaders = (url, params) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const putRequest = (url, params, headers) => {
|
export const putRequest = (url, params, headers) => {
|
||||||
let accessToken = getStore("accessToken");
|
let accessToken = getStore("accessToken");
|
||||||
return service({
|
return service({
|
||||||
|
@ -337,4 +350,3 @@ export const postRequestWithNoToken = (url, params) => {
|
||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,20 @@ export const result = [
|
||||||
url: "",
|
url: "",
|
||||||
children: null,
|
children: null,
|
||||||
permTypes: []
|
permTypes: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "virtualOrderList",
|
||||||
|
showAlways: true,
|
||||||
|
level: 2,
|
||||||
|
type: 0,
|
||||||
|
title: "虚拟订单",
|
||||||
|
path: "virtualOrderList",
|
||||||
|
component: "order/order/virtualOrderList",
|
||||||
|
icon: "md-person",
|
||||||
|
isMenu: true,
|
||||||
|
url: "",
|
||||||
|
children: null,
|
||||||
|
permTypes: []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -381,6 +395,49 @@ export const result = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "lives",
|
||||||
|
showAlways: true,
|
||||||
|
level: 1,
|
||||||
|
type: 0,
|
||||||
|
title: "直播活动",
|
||||||
|
path: "/promotion",
|
||||||
|
component: "Main",
|
||||||
|
icon: "md-person",
|
||||||
|
isMenu: true,
|
||||||
|
url: "",
|
||||||
|
permTypes: [],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: "live",
|
||||||
|
showAlways: true,
|
||||||
|
level: 2,
|
||||||
|
type: 0,
|
||||||
|
title: "直播管理",
|
||||||
|
path: "live",
|
||||||
|
component: "promotion/live/live",
|
||||||
|
icon: "md-person",
|
||||||
|
isMenu: true,
|
||||||
|
url: "",
|
||||||
|
permTypes: [],
|
||||||
|
children: null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "liveGoods",
|
||||||
|
showAlways: true,
|
||||||
|
level: 2,
|
||||||
|
type: 0,
|
||||||
|
title: "直播商品",
|
||||||
|
path: "liveGoods",
|
||||||
|
component: "promotion/live/liveGoods",
|
||||||
|
icon: "md-person",
|
||||||
|
isMenu: true,
|
||||||
|
url: "",
|
||||||
|
permTypes: [],
|
||||||
|
children: null
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "storePromotion",
|
name: "storePromotion",
|
||||||
showAlways: true,
|
showAlways: true,
|
||||||
|
@ -422,34 +479,7 @@ export const result = [
|
||||||
permTypes: [],
|
permTypes: [],
|
||||||
children: null
|
children: null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "live",
|
|
||||||
showAlways: true,
|
|
||||||
level: 2,
|
|
||||||
type: 0,
|
|
||||||
title: "直播管理",
|
|
||||||
path: "live",
|
|
||||||
component: "promotion/live/live",
|
|
||||||
icon: "md-person",
|
|
||||||
isMenu: true,
|
|
||||||
url: "",
|
|
||||||
permTypes: [],
|
|
||||||
children: null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "liveGoods",
|
|
||||||
showAlways: true,
|
|
||||||
level: 2,
|
|
||||||
type: 0,
|
|
||||||
title: "直播商品",
|
|
||||||
path: "liveGoods",
|
|
||||||
component: "promotion/live/liveGoods",
|
|
||||||
icon: "md-person",
|
|
||||||
isMenu: true,
|
|
||||||
url: "",
|
|
||||||
permTypes: [],
|
|
||||||
children: null
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,12 +127,19 @@ export const otherRouter = {
|
||||||
name: "full-cut-detail",
|
name: "full-cut-detail",
|
||||||
component: () => import("@/views/promotion/fullCut/newFullCut.vue")
|
component: () => import("@/views/promotion/fullCut/newFullCut.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "export-order-deliver",
|
||||||
|
title: "发货",
|
||||||
|
name: "export-order-deliver",
|
||||||
|
component: () => import("@/views/order/order/exportOrderDeliver.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "order-detail",
|
path: "order-detail",
|
||||||
title: "订单详情",
|
title: "订单详情",
|
||||||
name: "order-detail",
|
name: "order-detail",
|
||||||
component: () => import("@/views/order/order/orderDetail.vue")
|
component: () => import("@/views/order/order/orderDetail.vue")
|
||||||
},
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// path: "/*",
|
// path: "/*",
|
||||||
// name: "error-404",
|
// name: "error-404",
|
||||||
|
|
|
@ -6,17 +6,32 @@
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function unitPrice(val, unit, location) {
|
export function unitPrice(val, unit, location) {
|
||||||
let price = formatPrice(val)
|
let price = formatPrice(val);
|
||||||
if (location === 'before') {
|
if (location === "before") {
|
||||||
return price.substr(0, price.length - 3)
|
return price.substr(0, price.length - 3);
|
||||||
}
|
}
|
||||||
if (location === 'after') {
|
if (location === "after") {
|
||||||
return price.substr(-2)
|
return price.substr(-2);
|
||||||
}
|
}
|
||||||
return (unit || '') + price
|
return (unit || "") + price;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单来源
|
||||||
|
*/
|
||||||
|
export function clientTypeWay(val) {
|
||||||
|
if (val == "H5") {
|
||||||
|
return "移动端";
|
||||||
|
} else if (val == "PC") {
|
||||||
|
return "PC端";
|
||||||
|
} else if (val == "WECHAT_MP") {
|
||||||
|
return "小程序端";
|
||||||
|
} else if (val == "APP") {
|
||||||
|
return "移动应用端";
|
||||||
|
} else {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 货币格式化
|
* 货币格式化
|
||||||
|
@ -24,8 +39,8 @@ export function unitPrice(val, unit, location) {
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export function formatPrice(price) {
|
export function formatPrice(price) {
|
||||||
if (typeof price !== 'number') return price
|
if (typeof price !== "number") return price;
|
||||||
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,51 +50,60 @@ export function formatPrice(price) {
|
||||||
* @returns {*|string}
|
* @returns {*|string}
|
||||||
*/
|
*/
|
||||||
export function unixToDate(unix, format) {
|
export function unixToDate(unix, format) {
|
||||||
let _format = format || 'yyyy-MM-dd hh:mm:ss'
|
let _format = format || "yyyy-MM-dd hh:mm:ss";
|
||||||
const d = new Date(unix * 1000)
|
const d = new Date(unix * 1000);
|
||||||
const o = {
|
const o = {
|
||||||
'M+': d.getMonth() + 1,
|
"M+": d.getMonth() + 1,
|
||||||
'd+': d.getDate(),
|
"d+": d.getDate(),
|
||||||
'h+': d.getHours(),
|
"h+": d.getHours(),
|
||||||
'm+': d.getMinutes(),
|
"m+": d.getMinutes(),
|
||||||
's+': d.getSeconds(),
|
"s+": d.getSeconds(),
|
||||||
'q+': Math.floor((d.getMonth() + 3) / 3),
|
"q+": Math.floor((d.getMonth() + 3) / 3),
|
||||||
S: d.getMilliseconds()
|
S: d.getMilliseconds()
|
||||||
}
|
};
|
||||||
if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length))
|
if (/(y+)/.test(_format))
|
||||||
for (const k in o) if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
|
_format = _format.replace(
|
||||||
return _format
|
RegExp.$1,
|
||||||
|
(d.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||||
|
);
|
||||||
|
for (const k in o)
|
||||||
|
if (new RegExp("(" + k + ")").test(_format))
|
||||||
|
_format = _format.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
|
||||||
|
);
|
||||||
|
return _format;
|
||||||
}
|
}
|
||||||
//是否格式化
|
//是否格式化
|
||||||
export function unixWhether(status) {
|
export function unixWhether(status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'YES':
|
case "YES":
|
||||||
return "是"
|
return "是";
|
||||||
case 'NO':
|
case "NO":
|
||||||
return "否"
|
return "否";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function unixSellerBillStatus(status_code) {
|
export function unixSellerBillStatus(status_code) {
|
||||||
switch (status_code) {
|
switch (status_code) {
|
||||||
case 'OUT':
|
case "OUT":
|
||||||
return '已出账'
|
return "已出账";
|
||||||
case 'CHECK':
|
case "CHECK":
|
||||||
return '已对账'
|
return "已对账";
|
||||||
case 'EXAMINE':
|
case "EXAMINE":
|
||||||
return '已审核'
|
return "已审核";
|
||||||
case 'PAY':
|
case "PAY":
|
||||||
return '已结算'
|
return "已结算";
|
||||||
case 'COMPLETE':
|
case "COMPLETE":
|
||||||
return '已完成'
|
return "已完成";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export function unixSwitchStatus(status_code) {
|
export function unixSwitchStatus(status_code) {
|
||||||
switch (status_code) {
|
switch (status_code) {
|
||||||
case 'OPEN':
|
case "OPEN":
|
||||||
return '开启'
|
return "开启";
|
||||||
case 'CLOSE':
|
case "CLOSE":
|
||||||
return '关闭'
|
return "关闭";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,30 +113,35 @@ export function unixSwitchStatus(status_code) {
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function secrecyMobile(mobile) {
|
export function secrecyMobile(mobile) {
|
||||||
mobile = String(mobile)
|
mobile = String(mobile);
|
||||||
if (!/\d{11}/.test(mobile)) {
|
if (!/\d{11}/.test(mobile)) {
|
||||||
return mobile
|
return mobile;
|
||||||
}
|
}
|
||||||
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
|
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function formatDate(date, fmt) {
|
export function formatDate(date, fmt) {
|
||||||
if (/(y+)/.test(fmt)) {
|
if (/(y+)/.test(fmt)) {
|
||||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
fmt = fmt.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
let o = {
|
let o = {
|
||||||
'M+': date.getMonth() + 1,
|
"M+": date.getMonth() + 1,
|
||||||
'd+': date.getDate(),
|
"d+": date.getDate(),
|
||||||
'h+': date.getHours(),
|
"h+": date.getHours(),
|
||||||
'm+': date.getMinutes(),
|
"m+": date.getMinutes(),
|
||||||
's+': date.getSeconds()
|
"s+": date.getSeconds()
|
||||||
};
|
};
|
||||||
for (let k in o) {
|
for (let k in o) {
|
||||||
if (new RegExp(`(${k})`).test(fmt)) {
|
if (new RegExp(`(${k})`).test(fmt)) {
|
||||||
let str = o[k] + '';
|
let str = o[k] + "";
|
||||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
fmt = fmt.replace(
|
||||||
|
RegExp.$1,
|
||||||
|
RegExp.$1.length === 1 ? str : padLeftZero(str)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fmt;
|
return fmt;
|
||||||
};
|
}
|
||||||
|
|
|
@ -3,22 +3,25 @@
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px solid #ddd;
|
border-radius: 0.8em;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
background: none repeat 0 0 #fff;
|
background: none repeat 0 0 #fff;
|
||||||
|
|
||||||
/*商品品类*/
|
/*商品品类*/
|
||||||
.goods-category {
|
.goods-category {
|
||||||
|
min-height: 500px;
|
||||||
|
border-radius: 0.8em;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background: #fafafa;
|
background: #ededed;
|
||||||
border: 1px solid #e6e6e6;
|
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
padding: 8px 4px 8px 8px;
|
padding: 12px 8px;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
background: none repeat 0 0 #fff;
|
background: none repeat 0 0 #fff;
|
||||||
border: 1px solid #e6e6e6;
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||||
|
border-radius: 0.4em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
letter-spacing: normal;
|
letter-spacing: normal;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
|
@ -27,7 +30,7 @@
|
||||||
|
|
||||||
li {
|
li {
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
padding: 5px;
|
padding: 10px 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
@ -42,9 +45,10 @@
|
||||||
|
|
||||||
/** 当前品类被选中的样式 */
|
/** 当前品类被选中的样式 */
|
||||||
.activeClass {
|
.activeClass {
|
||||||
background-color: #d9edf7;
|
border-radius: 0.4em;
|
||||||
border: 1px solid #bce8f1;
|
background-color: rgba($color: $theme_color, $alpha: 0.2);
|
||||||
color: #3a87ad;
|
border: 1px solid rgba($color: $theme_color, $alpha: 0.8);
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!*当前选择的商品品类文字*!*/
|
/*!*当前选择的商品品类文字*!*/
|
||||||
|
@ -215,6 +219,19 @@ div.base-info-item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.success {
|
||||||
|
> h1 {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
> * {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.operation {
|
||||||
|
> * {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
/*商品描述*/
|
/*商品描述*/
|
||||||
.goods-intro {
|
.goods-intro {
|
||||||
line-height: 40;
|
line-height: 40;
|
||||||
|
@ -223,12 +240,16 @@ div.base-info-item {
|
||||||
/** 底部步骤 */
|
/** 底部步骤 */
|
||||||
.footer {
|
.footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: #ffc;
|
background-color: #ffc;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index: 9;
|
z-index: 999;
|
||||||
|
> .ivu-btn {
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*图片上传组件第一张图设置封面*/
|
/*图片上传组件第一张图设置封面*/
|
||||||
|
@ -261,9 +282,20 @@ div.base-info-item {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/deep/ .ivu-steps {
|
||||||
|
width: 100% !important;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.step-list {
|
||||||
|
height: 60px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border-radius: 0.8em;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
// box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)
|
||||||
|
}
|
||||||
.step-view {
|
.step-view {
|
||||||
width: 33%;
|
flex: 1;
|
||||||
height: 40px;
|
height: 60px;
|
||||||
font-size: 19px;
|
font-size: 19px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -271,6 +303,14 @@ div.base-info-item {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.step-view:nth-of-type(1) {
|
||||||
|
border-top-left-radius: 0.4em;
|
||||||
|
border-bottom-left-radius: 0.4em;
|
||||||
|
}
|
||||||
|
.step-view:nth-last-child(1) {
|
||||||
|
border-top-right-radius: 0.4em;
|
||||||
|
border-bottom-right-radius: 0.4em;
|
||||||
|
}
|
||||||
|
|
||||||
.add-sku-btn {
|
.add-sku-btn {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
@ -374,14 +414,67 @@ div.base-info-item {
|
||||||
|
|
||||||
right: 0;
|
right: 0;
|
||||||
background: rgba(0, 0, 0, 0.6);
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.demo-upload-list:hover .demo-upload-list-cover {
|
.demo-upload-list:hover .demo-upload-list-cover {
|
||||||
display: block;
|
display:flex;
|
||||||
}
|
}
|
||||||
.demo-upload-list-cover i {
|
.demo-upload-list-cover div {
|
||||||
|
margin: 10% 0;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
> i {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.active-goods-type {
|
||||||
|
background: #e8e8e8;
|
||||||
|
}
|
||||||
|
.goods-type-list {
|
||||||
|
max-height: 500px;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
> .goods-type-item {
|
||||||
|
padding: 20px 0;
|
||||||
|
width: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 0.35s;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
/deep/ img {
|
||||||
|
margin-right: 20px;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
/deep/ h2 {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 21px;
|
||||||
|
padding: 10px 0;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
/deep/ p {
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
> .goods-type-item:hover {
|
||||||
|
transform: translateY(-10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.template-item {
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-bar{
|
||||||
|
height: auto !important;
|
||||||
|
max-height: auto !important;
|
||||||
|
min-height: 240px !important;
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,12 @@
|
||||||
<Option value="UPPER">上架</Option>
|
<Option value="UPPER">上架</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
<Form-item label="商品类型" prop="status">
|
||||||
|
<Select v-model="searchForm.goodsType" placeholder="请选择" clearable style="width: 200px">
|
||||||
|
<Option value="PHYSICAL_GOODS">实物商品</Option>
|
||||||
|
<Option value="VIRTUAL_GOODS">虚拟商品</Option>
|
||||||
|
</Select>
|
||||||
|
</Form-item>
|
||||||
<Form-item label="商品编号" prop="sn">
|
<Form-item label="商品编号" prop="sn">
|
||||||
<Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px"/>
|
<Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px"/>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
@ -49,7 +55,8 @@
|
||||||
</div>
|
</div>
|
||||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<vue-qr :text="wapLinkTo(row.id,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150"></vue-qr>
|
<vue-qr :text="wapLinkTo(row.id,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
|
||||||
|
:size="150"></vue-qr>
|
||||||
</div>
|
</div>
|
||||||
<img src="../../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
<img src="../../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||||
</Poptip>
|
</Poptip>
|
||||||
|
@ -60,7 +67,8 @@
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||||
|
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||||
show-total show-elevator show-sizer></Page>
|
show-total show-elevator show-sizer></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -78,7 +86,8 @@
|
||||||
<Modal title="批量设置运费模板" v-model="shipTemplateModal" :mask-closable="false" :width="500">
|
<Modal title="批量设置运费模板" v-model="shipTemplateModal" :mask-closable="false" :width="500">
|
||||||
<Form ref="shipTemplateForm" :model="shipTemplateForm" :label-width="120">
|
<Form ref="shipTemplateForm" :model="shipTemplateForm" :label-width="120">
|
||||||
<FormItem class="form-item-view-el" label="运费" prop="freightPayer">
|
<FormItem class="form-item-view-el" label="运费" prop="freightPayer">
|
||||||
<RadioGroup type="button" button-style="solid" @on-change="logisticsTemplateUndertakerChange" v-model="shipTemplateForm.freightPayer">
|
<RadioGroup type="button" button-style="solid" @on-change="logisticsTemplateUndertakerChange"
|
||||||
|
v-model="shipTemplateForm.freightPayer">
|
||||||
<Radio label="STORE">
|
<Radio label="STORE">
|
||||||
<span>卖家承担运费</span>
|
<span>卖家承担运费</span>
|
||||||
</Radio>
|
</Radio>
|
||||||
|
@ -224,7 +233,7 @@ export default {
|
||||||
{
|
{
|
||||||
title: "商品编号",
|
title: "商品编号",
|
||||||
key: "sn",
|
key: "sn",
|
||||||
width: 200,
|
width: 100,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -245,6 +254,20 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "商品类型",
|
||||||
|
key: "goodsType",
|
||||||
|
width: 130,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.goodsType === 'PHYSICAL_GOODS') {
|
||||||
|
return h("div", "实物商品");
|
||||||
|
} else if (params.row.goodsType === 'VIRTUAL_GOODS') {
|
||||||
|
return h("div", "虚拟商品");
|
||||||
|
} else {
|
||||||
|
return h("div", "电子卡券");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "商品价格",
|
title: "商品价格",
|
||||||
key: "price",
|
key: "price",
|
||||||
|
@ -336,6 +359,7 @@ export default {
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
fixed: "right",
|
||||||
width: 200,
|
width: 200,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
let enableOrDisable = "";
|
let enableOrDisable = "";
|
||||||
|
|
|
@ -1,53 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<Row
|
<Row type="flex" @keydown.enter.native="submitLogin">
|
||||||
type="flex"
|
|
||||||
class="row"
|
|
||||||
justify="center"
|
|
||||||
align="middle"
|
|
||||||
@keydown.enter.native="submitLogin"
|
|
||||||
>
|
|
||||||
<Col style="width: 368px">
|
<Col style="width: 368px">
|
||||||
<Header />
|
<Header />
|
||||||
<Row>
|
<Row style="flex-direction: column;">
|
||||||
<Form
|
<Form ref="usernameLoginForm" :model="form" :rules="rules" class="form">
|
||||||
ref="usernameLoginForm"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
class="form"
|
|
||||||
>
|
|
||||||
<FormItem prop="username">
|
<FormItem prop="username">
|
||||||
<Input
|
<Input v-model="form.username" prefix="ios-contact" size="large" clearable placeholder="请输入用户名" autocomplete="off" />
|
||||||
v-model="form.username"
|
|
||||||
prefix="ios-contact"
|
|
||||||
size="large"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入用户名"
|
|
||||||
autocomplete="off"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem prop="password">
|
<FormItem prop="password">
|
||||||
<Input
|
<Input type="password" v-model="form.password" prefix="ios-lock" size="large" password placeholder="请输入密码" autocomplete="off" />
|
||||||
type="password"
|
|
||||||
v-model="form.password"
|
|
||||||
prefix="ios-lock"
|
|
||||||
size="large"
|
|
||||||
password
|
|
||||||
placeholder="请输入密码"
|
|
||||||
autocomplete="off"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Button
|
<Button class="login-btn" type="primary" size="large" :loading="loading" @click="submitLogin" long>
|
||||||
class="login-btn"
|
|
||||||
type="primary"
|
|
||||||
size="large"
|
|
||||||
:loading="loading"
|
|
||||||
@click="submitLogin"
|
|
||||||
long
|
|
||||||
>
|
|
||||||
<span v-if="!loading">{{ $t("login") }}</span>
|
<span v-if="!loading">{{ $t("login") }}</span>
|
||||||
<span v-else>{{ $t("logining") }}</span>
|
<span v-else>{{ $t("logining") }}</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -56,12 +23,7 @@
|
||||||
</Row>
|
</Row>
|
||||||
<Footer />
|
<Footer />
|
||||||
<!-- 拼图验证码 -->
|
<!-- 拼图验证码 -->
|
||||||
<verify
|
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||||
ref="verify"
|
|
||||||
class="verify-con"
|
|
||||||
verifyType="LOGIN"
|
|
||||||
@change="verifyChange"
|
|
||||||
></verify>
|
|
||||||
</Col>
|
</Col>
|
||||||
<!-- <LangSwitch /> -->
|
<!-- <LangSwitch /> -->
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -69,35 +31,34 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { login, userMsg } from "@/api/index";
|
||||||
login,
|
|
||||||
userMsg,
|
|
||||||
} from "@/api/index";
|
|
||||||
import { validateMobile } from "@/libs/validate";
|
import { validateMobile } from "@/libs/validate";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import Header from "@/views/main-components/header";
|
import Header from "@/views/main-components/header";
|
||||||
import Footer from "@/views/main-components/footer";
|
import Footer from "@/views/main-components/footer";
|
||||||
import LangSwitch from "@/views/main-components/lang-switch";
|
import LangSwitch from "@/views/main-components/lang-switch";
|
||||||
import util from "@/libs/util.js";
|
import util from "@/libs/util.js";
|
||||||
import verify from '@/views/my-components/verify';
|
import verify from "@/views/my-components/verify";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
LangSwitch,
|
LangSwitch,
|
||||||
Header,
|
Header,
|
||||||
Footer,
|
Footer,
|
||||||
verify
|
verify,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
saveLogin: true, // 保存登录状态
|
saveLogin: true, // 保存登录状态
|
||||||
loading: false, // 加载状态
|
loading: false, // 加载状态
|
||||||
form: { // 表单数据
|
form: {
|
||||||
|
// 表单数据
|
||||||
username: "",
|
username: "",
|
||||||
password: "",
|
password: "",
|
||||||
mobile: "",
|
mobile: "",
|
||||||
code: "",
|
code: "",
|
||||||
},
|
},
|
||||||
rules: { // 验证规则
|
rules: {
|
||||||
|
// 验证规则
|
||||||
username: [
|
username: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -163,35 +124,41 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
submitLogin() { // 登录提交
|
submitLogin() {
|
||||||
|
// 登录提交
|
||||||
this.$refs.usernameLoginForm.validate((valid) => {
|
this.$refs.usernameLoginForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$refs.verify.show = true;
|
this.$refs.verify.show = true;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
verifyChange (con) { // 拼图验证码回显
|
verifyChange(con) {
|
||||||
|
// 拼图验证码回显
|
||||||
if (!con.status) return;
|
if (!con.status) return;
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
login({
|
login({
|
||||||
username: this.form.username,
|
username: this.form.username,
|
||||||
password: this.md5(this.form.password),
|
password: this.md5(this.form.password),
|
||||||
}).then((res) => {
|
})
|
||||||
|
.then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
this.afterLogin(res);
|
this.afterLogin(res);
|
||||||
}
|
}
|
||||||
}).catch(()=>{this.loading = false})
|
})
|
||||||
}
|
.catch(() => {
|
||||||
}
|
this.loading = false;
|
||||||
|
});
|
||||||
|
this.$refs.verify.show = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.row {
|
.row {
|
||||||
padding: 70px 50px;
|
padding: 70px 50px;
|
||||||
border-radius: .8em;
|
border-radius: 0.8em;
|
||||||
|
|
||||||
}
|
}
|
||||||
.login {
|
.login {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -214,7 +181,7 @@ export default {
|
||||||
}
|
}
|
||||||
/deep/ .ivu-row {
|
/deep/ .ivu-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column !important;
|
|
||||||
}
|
}
|
||||||
.verify-con {
|
.verify-con {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -260,5 +227,4 @@ export default {
|
||||||
.flex {
|
.flex {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Row class="header">
|
<Row class="header">
|
||||||
<img src="../../assets/lili.png" class="logo" width="220px">
|
<img class="logo" src="../../assets/logo.png" >
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -14,13 +14,13 @@ export default {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.header {
|
.header {
|
||||||
|
|
||||||
margin-bottom: 6vh;
|
margin-bottom: 6vh;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center !important;
|
justify-content: center !important;
|
||||||
}
|
}
|
||||||
.logo {
|
.logo {
|
||||||
transform: scale(3);
|
width: 440px;
|
||||||
|
height: 158px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,210 @@
|
||||||
|
<template>
|
||||||
|
<Card>
|
||||||
|
<div class="step-list">
|
||||||
|
<div class="step-item" @click="handleCheckStep(item)" :class="{'active':item.checked}" v-for="(item,index) in stepList" :key="index">
|
||||||
|
<img class="img" :src="item.img" alt="">
|
||||||
|
<div>
|
||||||
|
<h2>{{item.title}}</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-for="(item,index) in stepList" :key="index">
|
||||||
|
<!-- 下载 -->
|
||||||
|
<div v-if="item.checked && index ==0" class="tpl">
|
||||||
|
|
||||||
|
<Button @click="downLoad">下载导入模板</Button>
|
||||||
|
</div>
|
||||||
|
<!-- 上传 -->
|
||||||
|
<div v-if="item.checked && index ==1" class="tpl">
|
||||||
|
<Upload :before-upload="handleUpload" name="files" style="width:50%; height:400px;" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||||
|
multiple type="drag" :action="action" :headers="accessToken">
|
||||||
|
<div style="padding: 50px 0">
|
||||||
|
<Icon type="ios-cloud-upload" size="102" style="color: #3399ff"></Icon>
|
||||||
|
<h2>选择或拖拽文件上传</h2>
|
||||||
|
</div>
|
||||||
|
</Upload>
|
||||||
|
</div>
|
||||||
|
<!-- 上传 -->
|
||||||
|
<div v-if="item.checked && index ==2" class="tpl success">
|
||||||
|
|
||||||
|
<h1>发货完成</h1>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Button class="btn" @click="close">关闭页面</Button>
|
||||||
|
<Button class="btn" type="primary" @click="navigationToGoodsOrder">商品订单</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</Card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import JsonExcel from "vue-json-excel";
|
||||||
|
import { downLoadDeliverExcel, uploadDeliverExcel } from "@/api/order.js";
|
||||||
|
import { baseUrl } from "@/libs/axios.js";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
"download-excel": JsonExcel,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
file: "",
|
||||||
|
action: baseUrl + "/orders/batchDeliver", // 上传接口
|
||||||
|
accessToken: {}, // 验证token
|
||||||
|
// 步骤集合
|
||||||
|
stepList: [
|
||||||
|
{
|
||||||
|
img: require("@/assets/download.png"),
|
||||||
|
title: "1.下载批量发货导入模板",
|
||||||
|
checked: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
img: require("@/assets/upload.png"),
|
||||||
|
title: "2.上传数据",
|
||||||
|
checked: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
img: require("@/assets/success.png"),
|
||||||
|
title: "3.完成",
|
||||||
|
checked: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.accessToken.accessToken = this.getStore("accessToken");
|
||||||
|
console.log(this.accessToken.accessToken);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 点击选择步骤
|
||||||
|
handleCheckStep(val) {
|
||||||
|
if (val.title.search("3") == -1) {
|
||||||
|
console.warn(val);
|
||||||
|
this.stepList.map((item) => {
|
||||||
|
item.checked = false;
|
||||||
|
});
|
||||||
|
val.checked = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleUpload(file) {
|
||||||
|
this.file = file;
|
||||||
|
this.upload();
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
navigationToGoodsOrder() {
|
||||||
|
this.$router.push({
|
||||||
|
path: "/order/orderList",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.$store.commit("removeTag", "export-order-deliver");
|
||||||
|
localStorage.storeOpenedList = JSON.stringify(
|
||||||
|
this.$store.state.app.storeOpenedList
|
||||||
|
);
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件
|
||||||
|
*/
|
||||||
|
async upload() {
|
||||||
|
let fd = new FormData();
|
||||||
|
fd.append("files", this.file);
|
||||||
|
let res = await uploadDeliverExcel(fd);
|
||||||
|
if (res.success) {
|
||||||
|
this.stepList.map((item) => {
|
||||||
|
item.checked = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.stepList[2].checked = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载excel
|
||||||
|
*/
|
||||||
|
downLoad() {
|
||||||
|
downLoadDeliverExcel()
|
||||||
|
.then((res) => {
|
||||||
|
const blob = new Blob([res], {
|
||||||
|
type: "application/vnd.ms-excel;charset=utf-8",
|
||||||
|
});
|
||||||
|
//对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
|
||||||
|
//IE10以上支持blob但是依然不支持download
|
||||||
|
if ("download" in document.createElement("a")) {
|
||||||
|
//支持a标签download的浏览器
|
||||||
|
const link = document.createElement("a"); //创建a标签
|
||||||
|
link.download = "批量发货导入模板.xls"; //a标签添加属性
|
||||||
|
link.style.display = "none";
|
||||||
|
link.href = URL.createObjectURL(blob);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click(); //执行下载
|
||||||
|
URL.revokeObjectURL(link.href); //释放url
|
||||||
|
document.body.removeChild(link); //释放标签
|
||||||
|
} else {
|
||||||
|
navigator.msSaveBlob(blob, fileName);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.step-list {
|
||||||
|
width: 80%;
|
||||||
|
min-width: 500px;
|
||||||
|
max-width: 1160px;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: flex;
|
||||||
|
padding: 40px;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
text-align: center;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
.tpl {
|
||||||
|
margin: 50px 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
background: #efefef;
|
||||||
|
border-radius: 0.8em;
|
||||||
|
}
|
||||||
|
.step-item {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
transition: 0.35s;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.success {
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
> h1 {
|
||||||
|
font-size: 28px;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
/deep/ .btn {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -21,7 +21,7 @@
|
||||||
<div class="div-item">
|
<div class="div-item">
|
||||||
<div class="div-item-left">订单来源:</div>
|
<div class="div-item-left">订单来源:</div>
|
||||||
<div class="div-item-right">
|
<div class="div-item-right">
|
||||||
{{ orderInfo.order.clientType }}
|
{{ orderInfo.order.clientType | clientTypeWay }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
<div class="div-item-right">{{ orderInfo.order.remark }}</div>
|
<div class="div-item-right">{{ orderInfo.order.remark }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="div-item">
|
<div class="div-item" v-if="orderInfo.order.orderType != 'VIRTUAL'">
|
||||||
<div class="div-item-left">配送方式:</div>
|
<div class="div-item-left">配送方式:</div>
|
||||||
<div class="div-item-right">
|
<div class="div-item-right">
|
||||||
{{
|
{{
|
||||||
|
@ -521,13 +521,14 @@ export default {
|
||||||
},
|
},
|
||||||
//弹出订单核销框
|
//弹出订单核销框
|
||||||
orderTake() {
|
orderTake() {
|
||||||
|
this.orderTakeForm.qrCode = this.orderInfo.order.verificationCode
|
||||||
this.orderTakeModal = true;
|
this.orderTakeModal = true;
|
||||||
},
|
},
|
||||||
//订单核销提交
|
//订单核销提交
|
||||||
orderTakeSubmit() {
|
orderTakeSubmit() {
|
||||||
this.$refs.orderTakeForm.validate((valid) => {
|
this.$refs.orderTakeForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
API_Order.orderTake(this.sn, this.orderTakeForm).then((res) => {
|
API_Order.orderTake(this.sn, this.orderTakeForm.qrCode).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("订单核销成功");
|
this.$Message.success("订单核销成功");
|
||||||
this.orderTakeModal = false;
|
this.orderTakeModal = false;
|
||||||
|
|
|
@ -4,73 +4,37 @@
|
||||||
<Row @keydown.enter.native="handleSearch">
|
<Row @keydown.enter.native="handleSearch">
|
||||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||||
<Form-item label="订单编号" prop="orderSn">
|
<Form-item label="订单编号" prop="orderSn">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.orderSn" clearable placeholder="请输入订单编号" style="width: 160px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.orderSn"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入订单编号"
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="会员名称" prop="buyerName">
|
<Form-item label="会员名称" prop="buyerName">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.buyerName" clearable placeholder="请输入会员名称" style="width: 160px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.buyerName"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入会员名称"
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="订单状态" prop="orderStatus">
|
<Form-item label="订单状态" prop="orderStatus">
|
||||||
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 200px">
|
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
|
||||||
<Option value="UNPAID">未付款</Option>
|
<Option value="UNPAID">未付款</Option>
|
||||||
<Option value="PAID">已付款</Option>
|
<Option value="PAID">已付款</Option>
|
||||||
<Option value="UNDELIVERED">待发货</Option>
|
<Option value="UNDELIVERED">待发货</Option>
|
||||||
<Option value="DELIVERED">已发货</Option>
|
<Option value="DELIVERED">已发货</Option>
|
||||||
<Option value="COMPLETED">已完成</Option>
|
<Option value="COMPLETED">已完成</Option>
|
||||||
<Option value="TAKE">待核验</Option>
|
|
||||||
<Option value="CANCELLED">已取消</Option>
|
<Option value="CANCELLED">已取消</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="下单时间">
|
<Form-item label="下单时间">
|
||||||
<DatePicker
|
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 160px"></DatePicker>
|
||||||
v-model="selectDate"
|
|
||||||
type="datetimerange"
|
|
||||||
format="yyyy-MM-dd"
|
|
||||||
clearable
|
|
||||||
@on-change="selectDateRange"
|
|
||||||
placeholder="选择起始时间"
|
|
||||||
style="width: 200px"
|
|
||||||
></DatePicker>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
<Button @click="handleReset" class="search-btn">重置</Button>
|
<Button @click="handleReset" class="search-btn">重置</Button>
|
||||||
|
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<div>
|
||||||
:loading="loading"
|
<Button type="primary" class="export" @click="expressOrderDeliver">
|
||||||
border
|
批量发货
|
||||||
:columns="columns"
|
</Button>
|
||||||
:data="data"
|
</div>
|
||||||
ref="table"
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||||
sortable="custom"
|
|
||||||
@on-sort-change="changeSort"
|
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
></Table>
|
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||||
:current="searchForm.pageNumber"
|
show-total show-elevator show-sizer></Page>
|
||||||
:total="total"
|
|
||||||
:page-size="searchForm.pageSize"
|
|
||||||
@on-change="changePage"
|
|
||||||
@on-page-size-change="changePageSize"
|
|
||||||
:page-size-opts="[10, 20, 50]"
|
|
||||||
size="small"
|
|
||||||
show-total
|
|
||||||
show-elevator
|
|
||||||
show-sizer
|
|
||||||
></Page>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -78,10 +42,12 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
|
import { verificationCode } from "@/api/order";
|
||||||
export default {
|
export default {
|
||||||
name: "orderList",
|
name: "orderList",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
orderCode: "",
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
|
@ -93,7 +59,8 @@
|
||||||
endDate: "", // 终止时间
|
endDate: "", // 终止时间
|
||||||
orderSn: "",
|
orderSn: "",
|
||||||
buyerName: "",
|
buyerName: "",
|
||||||
orderStatus:""
|
orderStatus: "",
|
||||||
|
orderType: "NORMAL",
|
||||||
},
|
},
|
||||||
selectDate: null,
|
selectDate: null,
|
||||||
form: {
|
form: {
|
||||||
|
@ -114,7 +81,7 @@
|
||||||
title: "订单号",
|
title: "订单号",
|
||||||
key: "sn",
|
key: "sn",
|
||||||
minWidth: 240,
|
minWidth: 240,
|
||||||
tooltip: true
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "订单来源",
|
title: "订单来源",
|
||||||
|
@ -129,31 +96,16 @@
|
||||||
return h("div", {}, "小程序端");
|
return h("div", {}, "小程序端");
|
||||||
} else if (params.row.clientType == "APP") {
|
} else if (params.row.clientType == "APP") {
|
||||||
return h("div", {}, "移动应用端");
|
return h("div", {}, "移动应用端");
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return h("div", {}, params.row.clientType);
|
return h("div", {}, params.row.clientType);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "订单类型",
|
|
||||||
key: "orderType",
|
|
||||||
width: 120,
|
|
||||||
render: (h, params) => {
|
|
||||||
if (params.row.orderType == "NORMAL") {
|
|
||||||
return h('div', [h('span', { }, '普通订单'),]);
|
|
||||||
} else if (params.row.orderType == "PINTUAN") {
|
|
||||||
return h('div', [h('span', { }, '拼团订单'),]);
|
|
||||||
} else if (params.row.orderType == "GIFT") {
|
|
||||||
return h('div', [h('span', { }, '赠品订单'),]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "买家名称",
|
title: "买家名称",
|
||||||
key: "memberName",
|
key: "memberName",
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
tooltip: true
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "订单金额",
|
title: "订单金额",
|
||||||
|
@ -174,22 +126,22 @@
|
||||||
minWidth: 100,
|
minWidth: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.orderStatus == "UNPAID") {
|
if (params.row.orderStatus == "UNPAID") {
|
||||||
return h('div', [h('span', { }, '未付款'),]);
|
return h("div", [h("span", {}, "未付款")]);
|
||||||
} else if (params.row.orderStatus == "PAID") {
|
} else if (params.row.orderStatus == "PAID") {
|
||||||
return h('div', [h('span', { }, '已付款'),]);
|
return h("div", [h("span", {}, "已付款")]);
|
||||||
} else if (params.row.orderStatus == "UNDELIVERED") {
|
} else if (params.row.orderStatus == "UNDELIVERED") {
|
||||||
return h('div', [h('span', { }, '待发货'),]);
|
return h("div", [h("span", {}, "待发货")]);
|
||||||
} else if (params.row.orderStatus == "DELIVERED") {
|
} else if (params.row.orderStatus == "DELIVERED") {
|
||||||
return h('div', [h('span', { }, '已发货'),]);
|
return h("div", [h("span", {}, "已发货")]);
|
||||||
} else if (params.row.orderStatus == "COMPLETED") {
|
} else if (params.row.orderStatus == "COMPLETED") {
|
||||||
return h('div', [h('span', { }, '已完成'),]);
|
return h("div", [h("span", {}, "已完成")]);
|
||||||
} else if (params.row.orderStatus == "TAKE") {
|
} else if (params.row.orderStatus == "TAKE") {
|
||||||
return h('div', [h('span', { }, '待核验'),]);
|
return h("div", [h("span", {}, "待核验")]);
|
||||||
} else if (params.row.orderStatus == "CANCELLED") {
|
} else if (params.row.orderStatus == "CANCELLED") {
|
||||||
return h('div', [h('span', { }, '已取消'),]);
|
return h("div", [h("span", {}, "已取消")]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "下单时间",
|
title: "下单时间",
|
||||||
key: "createTime",
|
key: "createTime",
|
||||||
|
@ -232,13 +184,33 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 核验订单
|
||||||
|
*/
|
||||||
|
async orderVerification() {
|
||||||
|
let result = await verificationCode(this.orderCode);
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
this.$router.push({
|
||||||
|
name: "order-detail",
|
||||||
|
query: { sn: result.result.sn || this.orderCode },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 批量发货
|
||||||
|
*/
|
||||||
|
expressOrderDeliver() {
|
||||||
|
this.$router.push({
|
||||||
|
path: "/export-order-deliver",
|
||||||
|
});
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v;
|
this.searchForm.pageNumber = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.clearSelectAll();
|
|
||||||
},
|
},
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
this.searchForm.pageSize = v;
|
this.searchForm.pageSize = v;
|
||||||
|
@ -267,9 +239,7 @@
|
||||||
}
|
}
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
clearSelectAll() {
|
|
||||||
this.$refs.table.selectAll(false);
|
|
||||||
},
|
|
||||||
changeSelect(e) {
|
changeSelect(e) {
|
||||||
this.selectList = e;
|
this.selectList = e;
|
||||||
this.selectCount = e.length;
|
this.selectCount = e.length;
|
||||||
|
@ -297,9 +267,11 @@
|
||||||
name: "order-detail",
|
name: "order-detail",
|
||||||
query: { sn: sn },
|
query: { sn: sn },
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
activated() {
|
activated() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
@ -308,4 +280,7 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// 建议引入通用样式 可删除下面样式代码
|
// 建议引入通用样式 可删除下面样式代码
|
||||||
@import "@/styles/table-common.scss";
|
@import "@/styles/table-common.scss";
|
||||||
|
.export {
|
||||||
|
margin: 10px 20px 10px 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,286 @@
|
||||||
|
<template>
|
||||||
|
<div class="search">
|
||||||
|
<Card>
|
||||||
|
<Row @keydown.enter.native="handleSearch">
|
||||||
|
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||||
|
<Form-item label="订单编号" prop="orderSn">
|
||||||
|
<Input type="text" v-model="searchForm.orderSn" clearable placeholder="请输入订单编号" style="width: 160px" />
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="会员名称" prop="buyerName">
|
||||||
|
<Input type="text" v-model="searchForm.buyerName" clearable placeholder="请输入会员名称" style="width: 160px" />
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="订单状态" prop="orderStatus">
|
||||||
|
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
|
||||||
|
<Option value="UNPAID">未付款</Option>
|
||||||
|
<Option value="PAID">已付款</Option>
|
||||||
|
<Option value="COMPLETED">已完成</Option>
|
||||||
|
<Option value="TAKE">待核验</Option>
|
||||||
|
<Option value="CANCELLED">已取消</Option>
|
||||||
|
</Select>
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="下单时间">
|
||||||
|
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 160px"></DatePicker>
|
||||||
|
</Form-item>
|
||||||
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
|
<Button @click="handleReset" class="search-btn">重置</Button>
|
||||||
|
</Form>
|
||||||
|
</Row>
|
||||||
|
<div>
|
||||||
|
<Poptip @keydown.enter.native="orderVerification" placement="bottom-start" width="400">
|
||||||
|
<Button class="export">
|
||||||
|
核验订单
|
||||||
|
</Button>
|
||||||
|
<div class="api" slot="content">
|
||||||
|
<h2>核验码</h2>
|
||||||
|
<div style="margin:10px 0;">
|
||||||
|
<Input v-model="orderCode" style="width:300px; margin-right:10px;" />
|
||||||
|
<Button style="primary" @click="orderVerification">核验</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Poptip>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||||
|
<Row type="flex" justify="end" class="page">
|
||||||
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||||
|
show-total show-elevator show-sizer></Page>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as API_Order from "@/api/order";
|
||||||
|
import { verificationCode } from "@/api/order";
|
||||||
|
export default {
|
||||||
|
name: "virtualOrderList",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
orderCode: "",
|
||||||
|
loading: true, // 表单加载状态
|
||||||
|
searchForm: {
|
||||||
|
// 搜索框初始化对象
|
||||||
|
pageNumber: 1, // 当前页数
|
||||||
|
pageSize: 10, // 页面大小
|
||||||
|
sort: "createTime", // 默认排序字段
|
||||||
|
order: "desc", // 默认排序方式
|
||||||
|
startDate: "", // 起始时间
|
||||||
|
endDate: "", // 终止时间
|
||||||
|
orderSn: "",
|
||||||
|
buyerName: "",
|
||||||
|
orderStatus: "",
|
||||||
|
orderType:"VIRTUAL"
|
||||||
|
},
|
||||||
|
selectDate: null,
|
||||||
|
form: {
|
||||||
|
// 添加或编辑表单对象初始化数据
|
||||||
|
sn: "",
|
||||||
|
sellerName: "",
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
billPrice: "",
|
||||||
|
},
|
||||||
|
// 表单验证规则
|
||||||
|
formValidate: {},
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
selectList: [], // 多选数据
|
||||||
|
selectCount: 0, // 多选计数
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: "订单号",
|
||||||
|
key: "sn",
|
||||||
|
minWidth: 240,
|
||||||
|
tooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "订单来源",
|
||||||
|
key: "clientType",
|
||||||
|
width: 120,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.clientType == "H5") {
|
||||||
|
return h("div", {}, "移动端");
|
||||||
|
} else if (params.row.clientType == "PC") {
|
||||||
|
return h("div", {}, "PC端");
|
||||||
|
} else if (params.row.clientType == "WECHAT_MP") {
|
||||||
|
return h("div", {}, "小程序端");
|
||||||
|
} else if (params.row.clientType == "APP") {
|
||||||
|
return h("div", {}, "移动应用端");
|
||||||
|
} else {
|
||||||
|
return h("div", {}, params.row.clientType);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "买家名称",
|
||||||
|
key: "memberName",
|
||||||
|
minWidth: 130,
|
||||||
|
tooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "订单金额",
|
||||||
|
key: "flowPrice",
|
||||||
|
minWidth: 100,
|
||||||
|
tooltip: true,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h(
|
||||||
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.flowPrice, "¥")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: "订单状态",
|
||||||
|
key: "orderStatus",
|
||||||
|
minWidth: 100,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (params.row.orderStatus == "UNPAID") {
|
||||||
|
return h("div", [h("span", {}, "未付款")]);
|
||||||
|
} else if (params.row.orderStatus == "PAID") {
|
||||||
|
return h("div", [h("span", {}, "已付款")]);
|
||||||
|
} else if (params.row.orderStatus == "UNDELIVERED") {
|
||||||
|
return h("div", [h("span", {}, "待发货")]);
|
||||||
|
} else if (params.row.orderStatus == "DELIVERED") {
|
||||||
|
return h("div", [h("span", {}, "已发货")]);
|
||||||
|
} else if (params.row.orderStatus == "COMPLETED") {
|
||||||
|
return h("div", [h("span", {}, "已完成")]);
|
||||||
|
} else if (params.row.orderStatus == "TAKE") {
|
||||||
|
return h("div", [h("span", {}, "待核验")]);
|
||||||
|
} else if (params.row.orderStatus == "CANCELLED") {
|
||||||
|
return h("div", [h("span", {}, "已取消")]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "下单时间",
|
||||||
|
key: "createTime",
|
||||||
|
width: 170,
|
||||||
|
sortable: true,
|
||||||
|
sortType: "desc",
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
align: "center",
|
||||||
|
width: 100,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h("div", [
|
||||||
|
h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
type: "info",
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
this.detail(params.row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"查看"
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
data: [], // 表单数据
|
||||||
|
total: 0, // 表单数据总数
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 核验订单
|
||||||
|
*/
|
||||||
|
async orderVerification() {
|
||||||
|
let result = await verificationCode(this.orderCode);
|
||||||
|
|
||||||
|
if (result.success) {
|
||||||
|
|
||||||
|
|
||||||
|
this.$router.push({
|
||||||
|
name: "order-detail",
|
||||||
|
query: { sn: result.result.sn || this.orderCode },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
changePage(v) {
|
||||||
|
this.searchForm.pageNumber = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
changePageSize(v) {
|
||||||
|
this.searchForm.pageSize = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
handleSearch() {
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = 10;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
handleReset() {
|
||||||
|
this.searchForm = {};
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = 10;
|
||||||
|
this.selectDate = null;
|
||||||
|
this.searchForm.startDate = "";
|
||||||
|
this.searchForm.endDate = "";
|
||||||
|
// 重新加载数据
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
changeSort(e) {
|
||||||
|
this.searchForm.sort = e.key;
|
||||||
|
this.searchForm.order = e.order;
|
||||||
|
if (e.order === "normal") {
|
||||||
|
this.searchForm.order = "";
|
||||||
|
}
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
|
||||||
|
changeSelect(e) {
|
||||||
|
this.selectList = e;
|
||||||
|
this.selectCount = e.length;
|
||||||
|
},
|
||||||
|
selectDateRange(v) {
|
||||||
|
if (v) {
|
||||||
|
this.searchForm.startDate = v[0];
|
||||||
|
this.searchForm.endDate = v[1];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDataList() {
|
||||||
|
this.loading = true;
|
||||||
|
API_Order.getOrderList(this.searchForm).then((res) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.data = res.result.records;
|
||||||
|
this.total = res.result.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
detail(v) {
|
||||||
|
let sn = v.sn;
|
||||||
|
this.$router.push({
|
||||||
|
name: "order-detail",
|
||||||
|
query: { sn: sn },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
// 建议引入通用样式 可删除下面样式代码
|
||||||
|
@import "@/styles/table-common.scss";
|
||||||
|
.export {
|
||||||
|
margin: 10px 20px 10px 0;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -2,29 +2,12 @@
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<Card>
|
<Card>
|
||||||
<Row>
|
<Row>
|
||||||
<Form
|
<Form ref="searchForm" :model="searchForm" inline :label-width="100" class="search-form">
|
||||||
ref="searchForm"
|
|
||||||
:model="searchForm"
|
|
||||||
inline
|
|
||||||
:label-width="100"
|
|
||||||
class="search-form"
|
|
||||||
>
|
|
||||||
<Form-item label="优惠券名称">
|
<Form-item label="优惠券名称">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.couponName" placeholder="请输入优惠券名称" clearable style="width: 200px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.couponName"
|
|
||||||
placeholder="请输入优惠券名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动状态" prop="promotionStatus">
|
<Form-item label="活动状态" prop="promotionStatus">
|
||||||
<Select
|
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||||
v-model="searchForm.promotionStatus"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
<Option value="NEW">未开始</Option>
|
<Option value="NEW">未开始</Option>
|
||||||
<Option value="START">已开始/上架</Option>
|
<Option value="START">已开始/上架</Option>
|
||||||
<Option value="END">已结束/下架</Option>
|
<Option value="END">已结束/下架</Option>
|
||||||
|
@ -32,21 +15,9 @@
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动时间">
|
<Form-item label="活动时间">
|
||||||
<DatePicker
|
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||||
v-model="selectDate"
|
|
||||||
type="daterange"
|
|
||||||
clearable
|
|
||||||
placeholder="选择起始时间"
|
|
||||||
style="width: 200px"
|
|
||||||
></DatePicker>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button
|
<Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
|
||||||
@click="handleSearch"
|
|
||||||
type="primary"
|
|
||||||
class="search-btn"
|
|
||||||
icon="ios-search"
|
|
||||||
>搜索</Button
|
|
||||||
>
|
|
||||||
<Button @click="handleReset" class="search-btn">重置</Button>
|
<Button @click="handleReset" class="search-btn">重置</Button>
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
|
@ -55,57 +26,22 @@
|
||||||
<Button @click="delAll" class="ml_10">批量下架</Button>
|
<Button @click="delAll" class="ml_10">批量下架</Button>
|
||||||
<!-- <Button @click="upAll">批量上架</Button> -->
|
<!-- <Button @click="upAll">批量上架</Button> -->
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||||
:loading="loading"
|
|
||||||
border
|
|
||||||
:columns="columns"
|
|
||||||
:data="data"
|
|
||||||
ref="table"
|
|
||||||
sortable="custom"
|
|
||||||
@on-sort-change="changeSort"
|
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
>
|
|
||||||
<template slot-scope="{ row }" slot="action">
|
<template slot-scope="{ row }" slot="action">
|
||||||
<Button
|
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="info" size="small" style="margin-right: 10px" @click="edit(row)">编辑</Button>
|
||||||
v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'"
|
<Button v-if="row.promotionStatus !== 'CLOSE'" type="error" size="small" @click="remove(row)">下架</Button>
|
||||||
type="info"
|
|
||||||
size="small"
|
|
||||||
style="margin-right: 10px"
|
|
||||||
@click="edit(row)"
|
|
||||||
>编辑</Button
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
v-if="row.promotionStatus !== 'CLOSE'"
|
|
||||||
type="error"
|
|
||||||
size="small"
|
|
||||||
@click="remove(row)"
|
|
||||||
>下架</Button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page
|
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
|
||||||
:current="searchForm.pageNumber + 1"
|
size="small" show-total show-elevator show-sizer></Page>
|
||||||
:total="total"
|
|
||||||
:page-size="searchForm.pageSize"
|
|
||||||
@on-change="changePage"
|
|
||||||
@on-page-size-change="changePageSize"
|
|
||||||
:page-size-opts="[10, 20, 50]"
|
|
||||||
size="small"
|
|
||||||
show-total
|
|
||||||
show-elevator
|
|
||||||
show-sizer
|
|
||||||
></Page>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { getShopCouponList, updateCouponStatus } from "@/api/promotion";
|
||||||
getShopCouponList,
|
|
||||||
updateCouponStatus,
|
|
||||||
} from "@/api/promotion";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "coupon",
|
name: "coupon",
|
||||||
|
@ -143,18 +79,19 @@ export default {
|
||||||
{
|
{
|
||||||
title: "活动名称",
|
title: "活动名称",
|
||||||
key: "promotionName",
|
key: "promotionName",
|
||||||
minWidth: 120,
|
minWidth: 100,
|
||||||
fixed: "left",
|
fixed: "left",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "优惠券名称",
|
title: "优惠券名称",
|
||||||
key: "couponName",
|
key: "couponName",
|
||||||
minWidth: 120,
|
minWidth: 100,
|
||||||
tooltip: true
|
tooltip: true,
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
title: "面额/折扣",
|
title: "面额/折扣",
|
||||||
key: "price",
|
key: "price",
|
||||||
width: 120,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.price) {
|
if (params.row.price) {
|
||||||
return h(
|
return h(
|
||||||
|
@ -170,11 +107,13 @@ export default {
|
||||||
{
|
{
|
||||||
title: "领取数量/总数量",
|
title: "领取数量/总数量",
|
||||||
key: "publishNum",
|
key: "publishNum",
|
||||||
width: 100,
|
width: 130,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h(
|
return h(
|
||||||
"div", params.row.receivedNum + "/" + params.row.publishNum)
|
"div",
|
||||||
}
|
params.row.receivedNum + "/" + params.row.publishNum
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "优惠券类型",
|
title: "优惠券类型",
|
||||||
|
@ -210,22 +149,28 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动时间",
|
title: "活动时间",
|
||||||
minWidth: 120,
|
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
|
if (params.row.getType === "ACTIVITY") {
|
||||||
|
return h("div", "长期有效");
|
||||||
|
} else {
|
||||||
return h("div", {
|
return h("div", {
|
||||||
domProps:
|
domProps: {
|
||||||
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime}
|
innerHTML:
|
||||||
|
params.row.startTime + "<br/>" + params.row.endTime,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "状态",
|
title: "状态",
|
||||||
key: "promotionStatus",
|
|
||||||
width: 100,
|
width: 100,
|
||||||
|
key: "promotionStatus",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
let text = "未知",
|
let text = "未知",
|
||||||
color = "";
|
color = "red";
|
||||||
if (params.row.promotionStatus == "NEW") {
|
if (params.row.promotionStatus == "NEW") {
|
||||||
text = "未开始";
|
text = "未开始";
|
||||||
color = "default";
|
color = "default";
|
||||||
|
@ -248,16 +193,17 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
text
|
text
|
||||||
)
|
),
|
||||||
]);
|
]);
|
||||||
}
|
},
|
||||||
|
minWidth: 70,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
slot: "action",
|
slot: "action",
|
||||||
align: "center",
|
align: "center",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
minWidth: 80,
|
maxWidth: 140,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
|
@ -292,8 +238,8 @@ export default {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
handleReset() {
|
handleReset() {
|
||||||
this.searchForm = {}
|
this.searchForm = {};
|
||||||
this.selectDate = ''
|
this.selectDate = "";
|
||||||
this.searchForm.pageNumber = 0;
|
this.searchForm.pageNumber = 0;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
|
|
@ -153,7 +153,6 @@ import {
|
||||||
addLiveGoods,
|
addLiveGoods,
|
||||||
editLive,
|
editLive,
|
||||||
getLiveInfo,
|
getLiveInfo,
|
||||||
delLiveGoods,
|
|
||||||
delRoomLiveGoods,
|
delRoomLiveGoods,
|
||||||
} from "@/api/promotion";
|
} from "@/api/promotion";
|
||||||
import liveGoods from "./liveGoods";
|
import liveGoods from "./liveGoods";
|
||||||
|
@ -173,6 +172,7 @@ export default {
|
||||||
// 不能选择今天以前的时间
|
// 不能选择今天以前的时间
|
||||||
optionsTime: {
|
optionsTime: {
|
||||||
disabledDate(date) {
|
disabledDate(date) {
|
||||||
|
// console.log(data)
|
||||||
return date && date.valueOf() < Date.now() - 86400000;
|
return date && date.valueOf() < Date.now() - 86400000;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -192,7 +192,7 @@ export default {
|
||||||
startTime: [
|
startTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入开始时间以及结束时间",
|
message: "请正确输入开始时间以及结束时间",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
feedsImg: [
|
feedsImg: [
|
||||||
|
@ -329,18 +329,33 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dialog点击确定时判断
|
* 提交直播间商品
|
||||||
*/
|
*/
|
||||||
addGoods() {
|
addGoods() {
|
||||||
this.liveData.forEach((item) => {
|
|
||||||
this.commodityList.forEach((oldVal) => {
|
|
||||||
if (oldVal.liveGoodsId != item.liveGoodsId) {
|
|
||||||
addLiveGoods({
|
addLiveGoods({
|
||||||
roomId: this.$route.query.roomId,
|
roomId: this.$route.query.roomId,
|
||||||
liveGoodsId: item.liveGoodsId,
|
liveGoodsId: item.liveGoodsId,
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dialog点击确定时判断
|
||||||
|
*/
|
||||||
|
addGoods() {
|
||||||
|
console.log(this.commodityList);
|
||||||
|
this.liveData.forEach((item, index) => {
|
||||||
|
if (this.commodityList.length == 1 && this.liveData.length == 1) {
|
||||||
|
addLiveGoods({
|
||||||
|
roomId: this.$route.query.roomId,
|
||||||
|
liveGoodsId: item.liveGoodsId,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.commodityList.forEach((oldVal, i) => {
|
||||||
|
// 如果商品里面没有商品,以及添加商品为第一次的话
|
||||||
|
if (oldVal.liveGoodsId != item.liveGoodsId) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -390,11 +405,55 @@ export default {
|
||||||
this.liveForm.coverImg = res.result;
|
this.liveForm.coverImg = res.result;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
tipsDateError() {
|
||||||
|
this.$Message.error({
|
||||||
|
content:
|
||||||
|
"直播开播时间需要在当前时间的10分钟后并且,开始时间不能在6个月后,直播计划结束时间(开播时间和结束时间间隔不得短于30分钟,不得超过24小时)",
|
||||||
|
duration: 5,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择时间后的回调
|
* 选择时间后的回调
|
||||||
*/
|
*/
|
||||||
handleChangeTime(daterange) {
|
handleChangeTime(daterange) {
|
||||||
this.times = daterange;
|
/**
|
||||||
|
* 直播开播时间需要在当前时间的10分钟后
|
||||||
|
* 此处设置默认为15分钟方便调整
|
||||||
|
*/
|
||||||
|
let siteTime = new Date().getTime() / 1000;
|
||||||
|
let selectTime = new Date(daterange[0]).getTime() / 1000;
|
||||||
|
let currentTime = this.$options.filters.unixToDate(siteTime);
|
||||||
|
/**
|
||||||
|
* 开播时间和结束时间间隔不得短于30分钟,不得超过24小时
|
||||||
|
* 判断用户设置的结束时间
|
||||||
|
*/
|
||||||
|
let endTime = new Date(daterange[1]).getTime() / 1000;
|
||||||
|
if (selectTime <= siteTime + 15 * 60) {
|
||||||
|
this.tipsDateError();
|
||||||
|
return false;
|
||||||
|
} else if (selectTime + 30 * 60 >= endTime) {
|
||||||
|
// 不能小于30分钟
|
||||||
|
|
||||||
|
this.tipsDateError();
|
||||||
|
return false;
|
||||||
|
} else if (selectTime + 24 * 60 * 60 <= endTime) {
|
||||||
|
// 不能超过24小时
|
||||||
|
|
||||||
|
this.tipsDateError();
|
||||||
|
return false;
|
||||||
|
} else if (
|
||||||
|
// 不能超过6个月
|
||||||
|
siteTime >=
|
||||||
|
new Date().getTime() + 6 * 31 * 24 * 3600 * 1000 + 86400000
|
||||||
|
) {
|
||||||
|
this.tipsDateError();
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
this.$set(this.times, [0], currentTime);
|
||||||
|
this.times[1] = daterange[1];
|
||||||
|
|
||||||
|
// this.times = daterange;
|
||||||
this.$set(
|
this.$set(
|
||||||
this.liveForm,
|
this.liveForm,
|
||||||
"startTime",
|
"startTime",
|
||||||
|
@ -405,6 +464,7 @@ export default {
|
||||||
"endTime",
|
"endTime",
|
||||||
new Date(daterange[1]).getTime() / 1000
|
new Date(daterange[1]).getTime() / 1000
|
||||||
);
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -449,7 +509,9 @@ export default {
|
||||||
// 需判断当前是否是添加商品
|
// 需判断当前是否是添加商品
|
||||||
if (this.$route.query.id && this.liveData.length != 0) {
|
if (this.$route.query.id && this.liveData.length != 0) {
|
||||||
this.spinShow = true;
|
this.spinShow = true;
|
||||||
this.liveForm.commodityList = JSON.stringify(this.liveForm.commodityList);
|
this.liveForm.commodityList = JSON.stringify(
|
||||||
|
this.liveForm.commodityList
|
||||||
|
);
|
||||||
// 将当前直播间修改
|
// 将当前直播间修改
|
||||||
editLive(this.liveForm).then((res) => {
|
editLive(this.liveForm).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
@ -276,10 +276,10 @@ export default {
|
||||||
async saveLiveGoods() {
|
async saveLiveGoods() {
|
||||||
this.saveGoodsLoading = true;
|
this.saveGoodsLoading = true;
|
||||||
let submit = this.liveGoodsData.map((element) => {
|
let submit = this.liveGoodsData.map((element) => {
|
||||||
console.log(element.priceType);
|
console.log(element);
|
||||||
return {
|
return {
|
||||||
goodsId: element.goodsId, //商品id
|
goodsId: element.goodsId, //商品id
|
||||||
goodsImage: element.small, //商品图片
|
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, //库存
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
},
|
},
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.searchForm.billStatus = "CHECK"
|
this.searchForm.billStatus = "OUT"
|
||||||
API_Shop.getBillPage(this.searchForm).then((res) => {
|
API_Shop.getBillPage(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|