Merge branch 'master' into ma
|
@ -36,7 +36,7 @@ export function goodsSkuDetail (params) {
|
|||
return request({
|
||||
url: `/buyer/goods/sku/${params.goodsId}/${params.skuId}`,
|
||||
method: Method.GET,
|
||||
needToken: false,
|
||||
needToken: true,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ export function getCateById (id) {
|
|||
// 店铺入驻协议
|
||||
export function agreement () {
|
||||
return request({
|
||||
url: `/buyer/article/get/1349291301250293760`,
|
||||
url: `/buyer/article/type/STORE_REGISTER`,
|
||||
needToken: true,
|
||||
method: Method.GET
|
||||
})
|
||||
|
|
|
@ -2,26 +2,10 @@
|
|||
<div class="box">
|
||||
<div class="nav">
|
||||
<ul class="location">
|
||||
<li><router-link to="/" v-if="$route.path !== '/'" class="home-page" ><Icon type="md-home" />首页</router-link></li>
|
||||
<li>
|
||||
<Dropdown placement="bottom-start">
|
||||
<a href="javascript:void(0)">
|
||||
<Icon type="ios-pin" class="icon"></Icon>
|
||||
{{ 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>
|
||||
<router-link to="/" v-if="$route.path !== '/'" class="home-page">
|
||||
<Icon type="md-home" />首页
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="detail">
|
||||
|
@ -56,7 +40,7 @@
|
|||
<li v-if="$route.name !== 'Cart'" style="position:relative;">
|
||||
<i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i>
|
||||
<Dropdown placement="bottom-start">
|
||||
<router-link to="cart" target="_blank" >
|
||||
<router-link to="/cart" target="_blank">
|
||||
<span @mouseenter="getCartList">
|
||||
<Icon
|
||||
size="18"
|
||||
|
@ -64,7 +48,7 @@
|
|||
></Icon>
|
||||
购物车
|
||||
</span>
|
||||
|
||||
|
||||
</router-link>
|
||||
|
||||
<DropdownMenu slot="list">
|
||||
|
@ -74,12 +58,7 @@
|
|||
<span>赶快去添加商品吧~</span>
|
||||
</div>
|
||||
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
|
||||
<div
|
||||
class="shopping-cart-box"
|
||||
v-for="(item, index) in shoppingCart"
|
||||
@click="goToPay"
|
||||
:key="index"
|
||||
>
|
||||
<div class="shopping-cart-box" v-for="(item, index) in shoppingCart" @click="goToPay" :key="index">
|
||||
<div class="shopping-cart-img">
|
||||
<img :src="item.goodsSku.thumbnail" class="hover-pointer" />
|
||||
</div>
|
||||
|
@ -116,35 +95,28 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import storage from '@/plugins/storage.js';
|
||||
import {cartGoodsAll} from '@/api/cart.js'
|
||||
import storage from "@/plugins/storage.js";
|
||||
import { cartGoodsAll } from "@/api/cart.js";
|
||||
export default {
|
||||
name: 'M-Header',
|
||||
created () {
|
||||
if (storage.getItem('userInfo')) {
|
||||
this.userInfo = JSON.parse(storage.getItem('userInfo'));
|
||||
name: "M-Header",
|
||||
created() {
|
||||
if (storage.getItem("userInfo")) {
|
||||
this.userInfo = JSON.parse(storage.getItem("userInfo"));
|
||||
}
|
||||
},
|
||||
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
// 主题颜色切换
|
||||
themeType: 'light',
|
||||
city: '珠海', // 展示城市
|
||||
cityArr: [
|
||||
['北京', '上海', '天津', '重庆', '广州'],
|
||||
['深圳', '河南', '辽宁', '吉林', '江苏'],
|
||||
['江西', '四川', '海南', '贵州', '云南'],
|
||||
['西藏', '陕西', '甘肃', '青海', '珠海']
|
||||
],
|
||||
themeType: "light",
|
||||
userInfo: {}, // 用户信息
|
||||
shoppingCart: [] // 购物车
|
||||
shoppingCart: [], // 购物车
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
cartNum () {
|
||||
return this.$store.state.cartNum
|
||||
}
|
||||
cartNum() {
|
||||
return this.$store.state.cartNum;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeCity (city) { // 选择所在城市
|
||||
|
@ -152,15 +124,15 @@ export default {
|
|||
},
|
||||
goToPay () { // 跳转购物车
|
||||
let url = this.$router.resolve({
|
||||
path: '/cart'
|
||||
})
|
||||
window.open(url.href, '_blank')
|
||||
path: "/cart",
|
||||
});
|
||||
window.open(url.href, "_blank");
|
||||
},
|
||||
myInfo () { // 跳转会员中心
|
||||
let url = this.$router.resolve({
|
||||
path: '/home'
|
||||
})
|
||||
window.open(url.href, '_blank')
|
||||
path: "/home",
|
||||
});
|
||||
window.open(url.href, "_blank");
|
||||
},
|
||||
signOutFun () { // 退出登录
|
||||
storage.removeItem('accessToken');
|
||||
|
@ -170,49 +142,51 @@ export default {
|
|||
this.$store.commit('SET_CARTNUM', 0)
|
||||
this.$router.push('/login');
|
||||
},
|
||||
goUserCenter (path) { // 跳转我的订单,我的足迹
|
||||
goUserCenter(path) {
|
||||
// 跳转我的订单,我的足迹
|
||||
if (this.userInfo.username) {
|
||||
this.$router.push({path: path})
|
||||
this.$router.push({ path: path });
|
||||
} else {
|
||||
this.$Modal.confirm({
|
||||
title: '请登录',
|
||||
content: '<p>请登录后执行此操作</p>',
|
||||
okText: '立即登录',
|
||||
cancelText: '继续浏览',
|
||||
title: "请登录",
|
||||
content: "<p>请登录后执行此操作</p>",
|
||||
okText: "立即登录",
|
||||
cancelText: "继续浏览",
|
||||
onOk: () => {
|
||||
this.$router.push({
|
||||
path: '/login',
|
||||
path: "/login",
|
||||
query: {
|
||||
rePath: this.$router.history.current.path,
|
||||
query: JSON.stringify(this.$router.history.current.query)
|
||||
}
|
||||
query: JSON.stringify(this.$router.history.current.query),
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
shopEntry () { // 店铺入驻
|
||||
if (storage.getItem('accessToken')) {
|
||||
shopEntry() {
|
||||
// 店铺入驻
|
||||
if (storage.getItem("accessToken")) {
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/shopEntry',
|
||||
query: {id: 1}
|
||||
path: "/shopEntry",
|
||||
query: { id: 1 },
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
window.open(routeUrl.href, "_blank");
|
||||
} else {
|
||||
this.$router.push('login');
|
||||
this.$router.push("login");
|
||||
}
|
||||
},
|
||||
getCartList () { // 获取购物车列表
|
||||
getCartList() {
|
||||
// 获取购物车列表
|
||||
if (this.userInfo.username) {
|
||||
|
||||
cartGoodsAll().then(res => {
|
||||
this.shoppingCart = res.result.skuList
|
||||
this.$store.commit('SET_CARTNUM', this.shoppingCart.length)
|
||||
this.Cookies.setItem('cartNum', this.shoppingCart.length)
|
||||
})
|
||||
cartGoodsAll().then((res) => {
|
||||
this.shoppingCart = res.result.skuList;
|
||||
this.$store.commit("SET_CARTNUM", this.shoppingCart.length);
|
||||
this.Cookies.setItem("cartNum", this.shoppingCart.length);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -253,7 +227,8 @@ export default {
|
|||
margin-right: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.nav a,.nav-item {
|
||||
.nav a,
|
||||
.nav-item {
|
||||
text-decoration: none;
|
||||
padding-left: 10px;
|
||||
border-left: 1px solid #ccc;
|
||||
|
@ -396,7 +371,6 @@ export default {
|
|||
.sign-out p {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.goods-title:hover {
|
||||
color: $theme_color;
|
||||
}
|
||||
|
|
|
@ -69,8 +69,8 @@ export default {
|
|||
receiptContent: '不开发票', // 发票内容
|
||||
type: 1 // 1 个人 2 单位
|
||||
},
|
||||
ruleInline: { // 验证规则
|
||||
receiptTitle: [{ required: true, message: '请填写公司名称' }],
|
||||
type: 1, // 1 个人 2 单位
|
||||
ruleInline: {
|
||||
taxpayerId: [
|
||||
{ required: true, message: '请填写纳税人识别号' },
|
||||
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
|
||||
|
@ -78,21 +78,11 @@ export default {
|
|||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
save () { // 保存发票
|
||||
if (this.invoiceForm.type === 1) {
|
||||
// 个人
|
||||
let flag = true;
|
||||
this.receiptItems.forEach((e) => {
|
||||
if (
|
||||
e.receiptTitle === '个人' &&
|
||||
e.receiptContent === this.invoiceForm.receiptContent
|
||||
) {
|
||||
this.$emit('change', e);
|
||||
flag = false;
|
||||
this.invoiceAvailable = false;
|
||||
}
|
||||
});
|
||||
props: ["invoiceData"],
|
||||
watch: {
|
||||
invoiceData: {
|
||||
handler(val) {
|
||||
this.invoiceForm = { ...val };
|
||||
|
||||
if (flag) {
|
||||
let params = {
|
||||
|
|
|
@ -93,6 +93,11 @@ export default {
|
|||
getCategory(0).then(res => {
|
||||
if (res.success) {
|
||||
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))
|
||||
}
|
||||
});
|
||||
|
@ -117,7 +122,12 @@ export default {
|
|||
}
|
||||
},
|
||||
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'))
|
||||
} else {
|
||||
this.getCate()
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<div class="promotion-notice">{{shop.promotionNotice}}</div>
|
||||
</div>
|
||||
<template v-for="(goods, goodsIndex) in shop.skuList">
|
||||
<div class="goods-item" :key="goodsIndex">
|
||||
<div class="goods-item" :key="goodsIndex">
|
||||
<div class="width_60">
|
||||
<Checkbox v-model="goods.checked" @on-change="changeChecked(goods.checked, 'goods', goods.goodsSku.id)"></Checkbox>
|
||||
</div>
|
||||
|
@ -93,7 +93,7 @@
|
|||
</div>
|
||||
<div class="error-goods" v-if="goods.errorMessage">
|
||||
<div>{{goods.errorMessage}}</div>
|
||||
<Button type="primary" @click="delGoods(goods.goodsSku.id)">删除</Button>
|
||||
<Button type="primary" @click="delGoods(goods.goodsSku.id)">删除</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -117,7 +117,7 @@
|
|||
已节省<span>{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span>
|
||||
</div>
|
||||
<div class="ml_20 total-price">
|
||||
总价(不含运费):<span>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</span>
|
||||
总价(不含运费):<div>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</div>
|
||||
</div>
|
||||
<div class="pay ml_20" @click="pay">去结算</div>
|
||||
</div>
|
||||
|
@ -136,26 +136,26 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Promotion from '@/components/goodsDetail/Promotion'
|
||||
import Search from '@/components/Search';
|
||||
import ShowLikeGoods from '@/components/like';
|
||||
import * as APICart from '@/api/cart';
|
||||
import * as APIMember from '@/api/member';
|
||||
import {getLogo} from '@/api/common.js'
|
||||
import Promotion from "@/components/goodsDetail/Promotion";
|
||||
import Search from "@/components/Search";
|
||||
import ShowLikeGoods from "@/components/like";
|
||||
import * as APICart from "@/api/cart";
|
||||
import * as APIMember from "@/api/member";
|
||||
import { getLogo } from "@/api/common.js";
|
||||
export default {
|
||||
name: 'Cart',
|
||||
beforeRouteEnter (to, from, next) {
|
||||
name: "Cart",
|
||||
beforeRouteEnter(to, from, next) {
|
||||
window.scrollTo(0, 0);
|
||||
next();
|
||||
},
|
||||
components: {
|
||||
Search,
|
||||
ShowLikeGoods,
|
||||
Promotion
|
||||
Promotion,
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
logoImg: '', // logo图
|
||||
logoImg: "", // logo图
|
||||
couponAvailable: false, // 展示优惠券
|
||||
stepIndex: 0, // 当前处于哪一步,购物车==0,填写订单信息==1,成功提交订单==2
|
||||
goodsTotal: 1, // 商品数量
|
||||
|
@ -165,45 +165,45 @@ export default {
|
|||
cartList: [], // 购物车列表
|
||||
couponList: [], // 优惠券列表
|
||||
priceDetailDTO: {}, // 价格明细
|
||||
skuList: [] // sku列表
|
||||
skuList: [], // sku列表
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
// 跳转商品详情
|
||||
goGoodsDetail (skuId, goodsId) {
|
||||
goGoodsDetail(skuId, goodsId) {
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: { skuId, goodsId }
|
||||
path: "/goodsDetail",
|
||||
query: { skuId, goodsId },
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
window.open(routeUrl.href, "_blank");
|
||||
},
|
||||
// 跳转店铺首页
|
||||
goShopPage (id) {
|
||||
goShopPage(id) {
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/Merchant',
|
||||
query: { id }
|
||||
path: "/Merchant",
|
||||
query: { id },
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
window.open(routeUrl.href, "_blank");
|
||||
},
|
||||
// 收藏商品
|
||||
collectGoods (id) {
|
||||
collectGoods(id) {
|
||||
this.$Modal.confirm({
|
||||
title: '收藏',
|
||||
content: '<p>商品收藏后可在个人中心我的收藏查看</p>',
|
||||
title: "收藏",
|
||||
content: "<p>商品收藏后可在个人中心我的收藏查看</p>",
|
||||
onOk: () => {
|
||||
APIMember.collectGoods('GOODS', id).then((res) => {
|
||||
APIMember.collectGoods("GOODS", id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('收藏商品成功');
|
||||
this.$Message.success("收藏商品成功");
|
||||
this.getCartList();
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => { }
|
||||
onCancel: () => {},
|
||||
});
|
||||
},
|
||||
// 删除商品
|
||||
delGoods (id) {
|
||||
delGoods(id) {
|
||||
const idArr = [];
|
||||
if (!id) {
|
||||
const list = this.cartList;
|
||||
|
@ -216,49 +216,50 @@ export default {
|
|||
idArr.push(id);
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: '删除',
|
||||
content: '<p>确定要删除该商品吗?</p>',
|
||||
title: "删除",
|
||||
content: "<p>确定要删除该商品吗?</p>",
|
||||
onOk: () => {
|
||||
APICart.delCartGoods({ skuIds: idArr.toString() }).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('删除成功');
|
||||
this.$Message.success("删除成功");
|
||||
this.getCartList();
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
clearCart () { // 清空购物车
|
||||
clearCart() {
|
||||
// 清空购物车
|
||||
this.$Modal.confirm({
|
||||
title: '提示',
|
||||
content: '<p>确定要清空购物车吗?清空后不可恢复</p>',
|
||||
title: "提示",
|
||||
content: "<p>确定要清空购物车吗?清空后不可恢复</p>",
|
||||
onOk: () => {
|
||||
APICart.clearCart().then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('清空购物车成功');
|
||||
this.$Message.success("清空购物车成功");
|
||||
this.getCartList();
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
// 跳转支付页面
|
||||
pay () {
|
||||
pay() {
|
||||
if (this.checkedNum) {
|
||||
this.$router.push({ path: '/pay', query: { way: 'CART' } });
|
||||
this.$router.push({ path: "/pay", query: { way: "CART" } });
|
||||
} else {
|
||||
this.$Message.warning('请至少选择一件商品');
|
||||
this.$Message.warning("请至少选择一件商品");
|
||||
}
|
||||
},
|
||||
// 展示优惠券
|
||||
showCoupon (storeId, index) {
|
||||
showCoupon(storeId, index) {
|
||||
this.couponAvailable = index;
|
||||
},
|
||||
changeNum (val, id) {
|
||||
changeNum(val, id) {
|
||||
// 设置购买数量
|
||||
console.log(val, id);
|
||||
APICart.setCartGoodsNum({ skuId: id, num: val }).then((res) => {
|
||||
|
@ -268,13 +269,13 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
async changeChecked (status, type, id) {
|
||||
async changeChecked(status, type, id) {
|
||||
// 设置商品选中状态
|
||||
const check = status ? 1 : 0;
|
||||
if (type === 'all') {
|
||||
if (type === "all") {
|
||||
// 全选
|
||||
await APICart.setCheckedAll({ checked: check });
|
||||
} else if (type === 'shop') {
|
||||
} else if (type === "shop") {
|
||||
// 选中店铺所有商品
|
||||
await APICart.setCheckedSeller({ checked: check, storeId: id });
|
||||
} else {
|
||||
|
@ -285,16 +286,17 @@ export default {
|
|||
this.getCartList();
|
||||
},
|
||||
|
||||
async receiveShopCoupon (item) { // 领取优惠券
|
||||
let res = await APIMember.receiveCoupon(item.id)
|
||||
async receiveShopCoupon(item) {
|
||||
// 领取优惠券
|
||||
let res = await APIMember.receiveCoupon(item.id);
|
||||
if (res.success) {
|
||||
this.$set(item, 'disabled', true)
|
||||
this.$Message.success('领取成功')
|
||||
this.$set(item, "disabled", true);
|
||||
this.$Message.success("领取成功");
|
||||
} else {
|
||||
this.$Message.error(res.message)
|
||||
this.$Message.error(res.message);
|
||||
}
|
||||
},
|
||||
async getCartList () {
|
||||
async getCartList() {
|
||||
// 购物车列表
|
||||
this.loading = true;
|
||||
try {
|
||||
|
@ -307,9 +309,9 @@ export default {
|
|||
this.checkedNum = 0;
|
||||
let allChecked = true;
|
||||
for (let k = 0; k < this.cartList.length; k++) {
|
||||
let shop = this.cartList[k]
|
||||
let list = await APIMember.couponList({storeId: shop.storeId})
|
||||
shop.couponList.push(...list.result.records)
|
||||
let shop = this.cartList[k];
|
||||
let list = await APIMember.couponList({ storeId: shop.storeId });
|
||||
shop.couponList.push(...list.result.records);
|
||||
}
|
||||
for (let i = 0; i < this.skuList.length; i++) {
|
||||
if (this.skuList[i].checked) {
|
||||
|
@ -318,30 +320,31 @@ export default {
|
|||
allChecked = false;
|
||||
}
|
||||
}
|
||||
this.$forceUpdate()
|
||||
this.$forceUpdate();
|
||||
this.allChecked = allChecked;
|
||||
}
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
mounted() {
|
||||
this.getCartList();
|
||||
APICart.cartCount().then(res => { // 购物车商品数量
|
||||
APICart.cartCount().then((res) => {
|
||||
// 购物车商品数量
|
||||
if (res.success) this.goodsTotal = res.result;
|
||||
});
|
||||
if (!this.Cookies.getItem('logo')) {
|
||||
getLogo().then(res => {
|
||||
if (!this.Cookies.getItem("logo")) {
|
||||
getLogo().then((res) => {
|
||||
if (res.success) {
|
||||
let logoObj = JSON.parse(res.result.settingValue)
|
||||
this.Cookies.setItem('logo', logoObj.buyerSideLogo)
|
||||
let logoObj = JSON.parse(res.result.settingValue);
|
||||
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.logoImg = this.Cookies.getItem('logo')
|
||||
this.logoImg = this.Cookies.getItem("logo");
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -544,7 +547,7 @@ export default {
|
|||
width: 70px;
|
||||
height: 70px;
|
||||
}
|
||||
>div>p {
|
||||
> div > p {
|
||||
@include content_color($light_content_color);
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
|
@ -567,12 +570,12 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
.error-goods{
|
||||
.error-goods {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-left: -20px;
|
||||
background-color: rgba($color: #999, $alpha: .5);
|
||||
background-color: rgba($color: #999, $alpha: 0.5);
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -603,7 +606,7 @@ export default {
|
|||
.save-price span {
|
||||
color: #000;
|
||||
}
|
||||
.total-price span {
|
||||
.total-price div {
|
||||
color: $theme_color;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
@ -651,23 +654,31 @@ export default {
|
|||
display: flex;
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
>span{
|
||||
> span {
|
||||
border: 1px solid $theme_color;
|
||||
color: $theme_color;
|
||||
font-size: 12px;
|
||||
border-radius: 2px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
>p{
|
||||
> p {
|
||||
font-size: 12px;
|
||||
margin-left: 10px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.cart-goods-footer > div{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.total-price{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.ivu-input-number-input {
|
||||
text-align: center;
|
||||
}
|
||||
.ivu-input-number-input {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -9,23 +9,11 @@
|
|||
<Step title="其他信息"></Step>
|
||||
<Step title="提交审核"></Step>
|
||||
</Steps>
|
||||
<first-apply
|
||||
v-if="currentIndex == 0 && dataReview"
|
||||
:content="firstData"
|
||||
@change="nextPage"
|
||||
></first-apply>
|
||||
<first-apply v-if="currentIndex == 0 && dataReview" :content="firstData" @change="nextPage"></first-apply>
|
||||
|
||||
<second-apply
|
||||
v-if="currentIndex == 1 && dataReview"
|
||||
:content="secondData"
|
||||
@change="nextPage"
|
||||
></second-apply>
|
||||
<second-apply v-if="currentIndex == 1 && dataReview" :content="secondData" @change="nextPage"></second-apply>
|
||||
|
||||
<third-apply
|
||||
v-if="currentIndex == 2 && dataReview"
|
||||
:content="thirdData"
|
||||
@change="nextPage"
|
||||
></third-apply>
|
||||
<third-apply v-if="currentIndex == 2 && dataReview" :content="thirdData" @change="nextPage"></third-apply>
|
||||
|
||||
<div class="success-page" v-if="currentIndex == 3">
|
||||
<span v-if="storeDisable == '' || storeDisable == 'APPLYING'">入驻申请提交成功,等待平台审核</span>
|
||||
|
@ -37,62 +25,51 @@
|
|||
<Button type="primary" @click='currentIndex = 0' v-if="storeDisable === 'REFUSED' && currentIndex === 3">重新申请</Button>
|
||||
</div>
|
||||
|
||||
<Modal
|
||||
title="店铺入驻协议"
|
||||
v-model="showAgreement"
|
||||
width="1200"
|
||||
:closable="false"
|
||||
:mask-closable="false"
|
||||
>
|
||||
<Modal title="店铺入驻协议" v-model="showAgreement" width="1200" :closable="false" :mask-closable="false">
|
||||
<div class="agreeent-con" v-html="agreementCon"></div>
|
||||
|
||||
<div slot="footer" style="text-align: center">
|
||||
<p><Checkbox v-model="checked">我已同意以上协议</Checkbox></p>
|
||||
<Button
|
||||
type="primary"
|
||||
:disabled="!checked"
|
||||
class="margin"
|
||||
@click="showAgreement = false"
|
||||
>同意协议填写资质信息</Button
|
||||
>
|
||||
<p>
|
||||
<Checkbox v-model="checked">我已同意以上协议</Checkbox>
|
||||
</p>
|
||||
<Button type="primary" :disabled="!checked" class="margin" @click="showAgreement = false">同意协议填写资质信息</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { agreement, applyStatus } from '@/api/shopentry';
|
||||
import firstApply from './first-apply';
|
||||
import secondApply from './second-apply';
|
||||
import thirdApply from './third-apply';
|
||||
import { agreement, applyStatus } from "@/api/shopentry";
|
||||
import firstApply from "./first-apply";
|
||||
import secondApply from "./second-apply";
|
||||
import thirdApply from "./third-apply";
|
||||
export default {
|
||||
components: {
|
||||
firstApply,
|
||||
secondApply,
|
||||
thirdApply
|
||||
thirdApply,
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
currentIndex: 0, // 当前步骤
|
||||
showAgreement: false, // 协议显示
|
||||
agreementCon: '', // 协议内容
|
||||
agreementCon: "", // 协议内容
|
||||
checked: false, // 选中协议
|
||||
applyData: {}, // 申请数据
|
||||
firstData: {}, // 第一步数据
|
||||
secondData: {}, // 第二步数据
|
||||
thirdData: {}, // 第三步数据
|
||||
storeDisable: '', // APPLY OPEN 开店中 CLOSED 关闭 REFUSED 拒绝 APPLYING 申请中,审核
|
||||
dataReview: true // 根据接口返回判断是否可展示数据
|
||||
storeDisable: "", // APPLY OPEN 开店中 CLOSED 关闭 REFUSED 拒绝 APPLYING 申请中,审核
|
||||
dataReview: true, // 根据接口返回判断是否可展示数据
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getArticle () {
|
||||
getArticle() {
|
||||
// 入驻协议
|
||||
agreement().then((res) => {
|
||||
console.log(res);
|
||||
this.agreementCon = res.result;
|
||||
this.agreementCon = res.result.content;
|
||||
});
|
||||
},
|
||||
getData () {
|
||||
getData() {
|
||||
applyStatus().then((res) => {
|
||||
if (res.success) {
|
||||
if (!res.result) {
|
||||
|
@ -101,34 +78,34 @@ export default {
|
|||
this.dataReview = false;
|
||||
let data = res.result;
|
||||
let first = [
|
||||
'addressIdPath',
|
||||
'addressPath',
|
||||
'companyAddress',
|
||||
'companyEmail',
|
||||
'companyName',
|
||||
'employeeNum',
|
||||
'legalId',
|
||||
'legalName',
|
||||
'licencePhoto',
|
||||
'legalPhoto',
|
||||
'licenseNum',
|
||||
'linkName',
|
||||
'linkPhone',
|
||||
'registeredCapital',
|
||||
'scope'
|
||||
"addressIdPath",
|
||||
"addressPath",
|
||||
"companyAddress",
|
||||
"companyEmail",
|
||||
"companyName",
|
||||
"employeeNum",
|
||||
"legalId",
|
||||
"legalName",
|
||||
"licencePhoto",
|
||||
"legalPhoto",
|
||||
"licenseNum",
|
||||
"linkName",
|
||||
"linkPhone",
|
||||
"registeredCapital",
|
||||
"scope",
|
||||
];
|
||||
let second = [
|
||||
'settlementBankAccountName',
|
||||
'settlementBankAccountNum',
|
||||
'settlementBankBranchName',
|
||||
'settlementBankJointName'
|
||||
"settlementBankAccountName",
|
||||
"settlementBankAccountNum",
|
||||
"settlementBankBranchName",
|
||||
"settlementBankJointName",
|
||||
];
|
||||
let third = [
|
||||
'goodsManagementCategory',
|
||||
'storeCenter',
|
||||
'storeDesc',
|
||||
'storeLogo',
|
||||
'storeName'
|
||||
"goodsManagementCategory",
|
||||
"storeCenter",
|
||||
"storeDesc",
|
||||
"storeLogo",
|
||||
"storeName",
|
||||
];
|
||||
|
||||
this.storeDisable = data.storeDisable;
|
||||
|
@ -143,7 +120,7 @@ export default {
|
|||
this.thirdData[e] = data[e];
|
||||
});
|
||||
|
||||
if (this.storeDisable === 'APPLY') {
|
||||
if (this.storeDisable === "APPLY") {
|
||||
this.currentIndex = 0;
|
||||
} else {
|
||||
this.currentIndex = 3;
|
||||
|
@ -154,13 +131,14 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
nextPage (step) {
|
||||
nextPage(step) {
|
||||
this.currentIndex = step;
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
mounted() {
|
||||
this.getData();
|
||||
}
|
||||
this.getArticle();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div class="user-img">
|
||||
<img :src="userInfo.face" />
|
||||
</div>
|
||||
<p>{{userInfo.username | secrecyMobile}}</p>
|
||||
<p>{{userInfo.nickName}}</p>
|
||||
</div>
|
||||
|
||||
<!-- 循环导航栏 -->
|
||||
|
|
|
@ -1,77 +1,133 @@
|
|||
// import Vue from 'vue';
|
||||
import axios from 'axios';
|
||||
import https from 'https';
|
||||
import {
|
||||
Message,
|
||||
Spin,
|
||||
Modal
|
||||
} from 'view-design';
|
||||
import { Message, Spin, Modal } from 'view-design';
|
||||
import Storage from './storage';
|
||||
import config from '@/config';
|
||||
import router from '../router/index.js';
|
||||
import store from '../vuex/store';
|
||||
import {
|
||||
handleRefreshToken
|
||||
} from '@/api/index';
|
||||
import { handleRefreshToken } from '@/api/index';
|
||||
const qs = require('qs');
|
||||
|
||||
export const buyerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.buyer : config.api_prod.buyer);
|
||||
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);
|
||||
export const buyerUrl =
|
||||
process.env.NODE_ENV === 'development'
|
||||
? config.api_dev.buyer
|
||||
: config.api_prod.buyer;
|
||||
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实例
|
||||
var isRefreshToken = 0;
|
||||
const refreshToken = getTokenDebounce()
|
||||
const refreshToken = getTokenDebounce();
|
||||
const service = axios.create({
|
||||
timeout: 10000, // 请求超时时间
|
||||
baseURL: buyerUrl, // API
|
||||
httpsAgent: new https.Agent({
|
||||
rejectUnauthorized: false
|
||||
}),
|
||||
paramsSerializer: params => qs.stringify(params, {
|
||||
arrayFormat: 'repeat'
|
||||
})
|
||||
paramsSerializer: params =>
|
||||
qs.stringify(params, {
|
||||
arrayFormat: 'repeat'
|
||||
})
|
||||
});
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
const {
|
||||
loading
|
||||
} = config;
|
||||
// 如果是put/post请求,用qs.stringify序列化参数
|
||||
const isPutPost = config.method === 'put' || config.method === 'post';
|
||||
const isJson = config.headers['Content-Type'] === 'application/json';
|
||||
const isFile = config.headers['Content-Type'] === 'multipart/form-data';
|
||||
if (isPutPost && isJson) {
|
||||
config.data = JSON.stringify(config.data);
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
const { loading } = config;
|
||||
// 如果是put/post请求,用qs.stringify序列化参数
|
||||
const isPutPost = config.method === 'put' || config.method === 'post';
|
||||
const isJson = config.headers['Content-Type'] === 'application/json';
|
||||
const isFile = config.headers['Content-Type'] === 'multipart/form-data';
|
||||
if (isPutPost && isJson) {
|
||||
config.data = JSON.stringify(config.data);
|
||||
}
|
||||
if (isPutPost && !isFile && !isJson) {
|
||||
config.data = qs.stringify(config.data, {
|
||||
arrayFormat: 'repeat'
|
||||
});
|
||||
}
|
||||
/** 配置全屏加载 */
|
||||
if (process.client && loading !== false) {
|
||||
config.loading = Spin.show();
|
||||
}
|
||||
|
||||
const uuid = Storage.getItem('uuid');
|
||||
config.headers['uuid'] = uuid;
|
||||
|
||||
// 获取访问Token
|
||||
let accessToken = Storage.getItem('accessToken');
|
||||
if (accessToken && config.needToken) {
|
||||
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;
|
||||
},
|
||||
error => {
|
||||
Promise.reject(error);
|
||||
}
|
||||
if (isPutPost && !isFile && !isJson) {
|
||||
config.data = qs.stringify(config.data, {
|
||||
arrayFormat: 'repeat'
|
||||
);
|
||||
|
||||
async function refresh () {
|
||||
const getTokenRes = await refreshToken();
|
||||
if (getTokenRes === 'success') {
|
||||
// 刷新token
|
||||
if (isRefreshToken === 1) {
|
||||
error.response.config.headers.accessToken = Storage.getItem(
|
||||
'accessToken'
|
||||
);
|
||||
return service(error.response.config);
|
||||
} else {
|
||||
router.go(0);
|
||||
}
|
||||
} else {
|
||||
Storage.removeItem('accessToken');
|
||||
Storage.removeItem('refreshToken');
|
||||
Storage.removeItem('userInfo');
|
||||
Storage.setItem('cartNum', 0);
|
||||
store.commit('SET_CARTNUM', 0);
|
||||
console.log('1111');
|
||||
Modal.confirm({
|
||||
title: '请登录',
|
||||
content: '<p>请登录后执行此操作</p>',
|
||||
okText: '立即登录',
|
||||
cancelText: '继续浏览',
|
||||
onOk: () => {
|
||||
router.push({
|
||||
path: '/login',
|
||||
query: {
|
||||
rePath: router.history.current.path,
|
||||
query: JSON.stringify(router.history.current.query)
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
Modal.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 配置全屏加载 */
|
||||
if (process.client && loading !== false) {
|
||||
config.loading = Spin.show();
|
||||
}
|
||||
|
||||
const uuid = Storage.getItem('uuid');
|
||||
config.headers['uuid'] = uuid;
|
||||
|
||||
// 获取访问Token
|
||||
let accessToken = Storage.getItem('accessToken');
|
||||
if (accessToken && config.needToken) {
|
||||
config.headers['accessToken'] = accessToken;
|
||||
}
|
||||
return config;
|
||||
}, error => {
|
||||
Promise.reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
// respone拦截器
|
||||
service.interceptors.response.use(
|
||||
async response => {
|
||||
await closeLoading(response);
|
||||
|
||||
return response.data;
|
||||
},
|
||||
async error => {
|
||||
|
@ -84,45 +140,15 @@ service.interceptors.response.use(
|
|||
isRefreshToken++;
|
||||
|
||||
if (isRefreshToken === 1) {
|
||||
const getTokenRes = await refreshToken();
|
||||
if (getTokenRes === 'success') { // 刷新token
|
||||
if (isRefreshToken === 1) {
|
||||
error.response.config.headers.accessToken = Storage.getItem('accessToken')
|
||||
return service(error.response.config)
|
||||
} else {
|
||||
router.go(0)
|
||||
}
|
||||
} else {
|
||||
Storage.removeItem('accessToken');
|
||||
Storage.removeItem('refreshToken');
|
||||
Storage.removeItem('userInfo');
|
||||
Storage.setItem('cartNum', 0)
|
||||
store.commit('SET_CARTNUM', 0)
|
||||
console.log('1111');
|
||||
Modal.confirm({
|
||||
title: '请登录',
|
||||
content: '<p>请登录后执行此操作</p>',
|
||||
okText: '立即登录',
|
||||
cancelText: '继续浏览',
|
||||
onOk: () => {
|
||||
router.push({
|
||||
path: '/login',
|
||||
query: {
|
||||
rePath: router.history.current.path,
|
||||
query: JSON.stringify(router.history.current.query)
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
Modal.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
isRefreshToken = 0
|
||||
refresh()
|
||||
isRefreshToken = 0;
|
||||
}
|
||||
} else {
|
||||
if (error.message) {
|
||||
let _message = error.code === 'ECONNABORTED' ? '连接超时,请稍候再试!' : '网络错误,请稍后再试!';
|
||||
let _message =
|
||||
error.code === 'ECONNABORTED'
|
||||
? '连接超时,请稍候再试!'
|
||||
: '网络错误,请稍后再试!';
|
||||
Message.error(errorData.message || _message);
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +160,7 @@ service.interceptors.response.use(
|
|||
* 关闭全局加载
|
||||
* @param target
|
||||
*/
|
||||
const closeLoading = (target) => {
|
||||
const closeLoading = target => {
|
||||
if (!target.config || !target.config.loading) return true;
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
|
@ -161,46 +187,45 @@ export default function request (options) {
|
|||
|
||||
// 防抖闭包来一波
|
||||
function getTokenDebounce () {
|
||||
let lock = false
|
||||
let success = false
|
||||
let lock = false;
|
||||
let success = false;
|
||||
return function () {
|
||||
if (!lock) {
|
||||
lock = true
|
||||
lock = true;
|
||||
let oldRefreshToken = Storage.getItem('refreshToken');
|
||||
handleRefreshToken(oldRefreshToken).then(res => {
|
||||
if (res.success) {
|
||||
let {
|
||||
accessToken,
|
||||
refreshToken
|
||||
} = res.result;
|
||||
Storage.setItem('accessToken', accessToken);
|
||||
Storage.setItem('refreshToken', refreshToken);
|
||||
handleRefreshToken(oldRefreshToken)
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
let { accessToken, refreshToken } = res.result;
|
||||
Storage.setItem('accessToken', accessToken);
|
||||
Storage.setItem('refreshToken', refreshToken);
|
||||
|
||||
success = true
|
||||
lock = false
|
||||
} else {
|
||||
success = false
|
||||
lock = false
|
||||
// router.push('/login')
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
success = false
|
||||
lock = false
|
||||
})
|
||||
success = true;
|
||||
lock = false;
|
||||
} else {
|
||||
success = false;
|
||||
lock = false;
|
||||
// router.push('/login')
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
success = false;
|
||||
lock = false;
|
||||
});
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
// 一直看lock,直到请求失败或者成功
|
||||
const timer = setInterval(() => {
|
||||
if (!lock) {
|
||||
clearInterval(timer)
|
||||
clearInterval(timer);
|
||||
if (success) {
|
||||
resolve('success')
|
||||
resolve('success');
|
||||
} else {
|
||||
resolve('fail')
|
||||
resolve('fail');
|
||||
}
|
||||
}
|
||||
}, 500) // 轮询时间间隔
|
||||
})
|
||||
}
|
||||
}, 500); // 轮询时间间隔
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,10 +5,21 @@ import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios'
|
|||
export const getManagerBrandPage = (params) => {
|
||||
return getRequest('/goods/brand/getByPage', params)
|
||||
}
|
||||
// 添加或修改品牌设置
|
||||
|
||||
// 批量删除
|
||||
export const delBrand = (ids) =>{
|
||||
return deleteRequest(`/goods/brand/delByIds/${ids}`)
|
||||
}
|
||||
|
||||
|
||||
// 添加
|
||||
export const addBrand = (params) => {
|
||||
return postRequest('/goods/brand', params)
|
||||
}
|
||||
// 修改品牌设置
|
||||
export const updateBrand = (params) => {
|
||||
return putRequest(`/goods/brand/${params.id}`, params)
|
||||
}
|
||||
// 禁用品牌
|
||||
export const disableBrand = (id, params) => {
|
||||
return putRequest(`/goods/brand/disable/${id}`, params)
|
||||
|
|
|
@ -14,7 +14,7 @@ export const getPromotionSeckill = 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);
|
||||
};
|
||||
// 作废优惠券
|
||||
export const deleteCouponActivity = ids => {
|
||||
return deleteRequest(`/promotion/couponActivity/${ids}`);
|
||||
export const closeActivity = id => {
|
||||
return deleteRequest(`/promotion/couponActivity/${id}`);
|
||||
};
|
||||
// 更新优惠券活动
|
||||
export const updateCouponActivity = params => {
|
||||
|
|
|
@ -21,10 +21,10 @@ export default {
|
|||
// buyer: "https://buyer-api.pickmall.cn",
|
||||
// seller: "https://store-api.pickmall.cn",
|
||||
// manager: "https://admin-api.pickmall.cn"
|
||||
common: 'http://192.168.0.100:8890',
|
||||
buyer: 'http://192.168.0.100:8888',
|
||||
seller: 'http://192.168.0.100:8889',
|
||||
manager: 'http://192.168.0.100:8887'
|
||||
common: 'http://192.168.0.109:8890',
|
||||
buyer: 'http://192.168.0.109:8888',
|
||||
seller: 'http://192.168.0.109:8889',
|
||||
manager: 'http://192.168.0.109:8887'
|
||||
},
|
||||
api_prod: {
|
||||
common: "https://common-api.pickmall.cn",
|
||||
|
|
|
@ -251,10 +251,16 @@ export const otherRouter = {
|
|||
},
|
||||
{
|
||||
path: "coupon-activity/edit",
|
||||
title: "编辑平台优惠券",
|
||||
title: "编辑平台优惠券活动",
|
||||
name: "edit-coupon-activity",
|
||||
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",
|
||||
title: "领取详情",
|
||||
|
@ -332,7 +338,7 @@ export const otherRouter = {
|
|||
path: "liveDetail",
|
||||
title: "查看直播",
|
||||
name: "liveDetail",
|
||||
component: () => import("@/views/live/liveDetail.vue")
|
||||
component: () => import("@/views/promotion/live/liveDetail.vue")
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
@ -147,21 +147,13 @@ export default {
|
|||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.distributionStatus == "PASS") {
|
||||
return h("Badge", {
|
||||
props: { status: "success", text: "审核通过" },
|
||||
});
|
||||
return h("Tag", {props: {color: "green",},},"通过");
|
||||
} else if (params.row.distributionStatus == "APPLY") {
|
||||
return h("Badge", {
|
||||
props: { status: "processing", text: "申请中" },
|
||||
});
|
||||
return h("Tag", {props: {color: "geekblue",},},"待审核");
|
||||
} else if (params.row.distributionStatus == "RETREAT") {
|
||||
return h("Badge", {
|
||||
props: { status: "warning", text: "已清退" },
|
||||
});
|
||||
return h("Tag", {props: {color: "volcano",},},"清退");
|
||||
} else if (params.row.distributionStatus == "REFUSE") {
|
||||
return h("Badge", {
|
||||
props: { status: "error", text: "审核拒绝" },
|
||||
});
|
||||
return h("Tag", {props: {color: "red",},},"拒绝");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -38,6 +38,12 @@
|
|||
<Option value="DOWN">下架</Option>
|
||||
</Select>
|
||||
</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>
|
||||
</Form>
|
||||
</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: "状态",
|
||||
key: "marketEnable",
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.marketEnable == "DOWN") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "下架",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "green"},},"上架");
|
||||
} else if (params.row.marketEnable == "UPPER") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "上架",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "volcano",},},"下架");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -206,36 +212,14 @@ export default {
|
|||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.isAuth == "TOBEAUDITED") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "待审核",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "volcano",},},"待审核");
|
||||
} else if (params.row.isAuth == "PASS") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "审核通过",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "green"},},"通过");
|
||||
} else if (params.row.isAuth == "REFUSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "审核拒绝",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "red",},},"拒绝");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
|
|
|
@ -1,25 +1,13 @@
|
|||
<style lang="scss">
|
||||
@import "@/styles/table-common.scss";
|
||||
@import "@/styles/table-common.scss";
|
||||
</style>
|
||||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<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="name">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.name"
|
||||
placeholder="请输入品牌名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
|
@ -28,370 +16,361 @@
|
|||
<Row class="operation padding-row">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
</Row>
|
||||
<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">
|
||||
<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>
|
||||
<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>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<FormItem label="品牌名称" prop="name">
|
||||
<Input v-model="form.name" clearable style="width: 100%"/>
|
||||
<Input v-model="form.name" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
<FormItem label="品牌图标" prop="logo">
|
||||
<upload-pic-input
|
||||
v-model="form.logo"
|
||||
style="width: 100%"
|
||||
></upload-pic-input>
|
||||
<upload-pic-input v-model="form.logo" style="width: 100%"></upload-pic-input>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||
>提交
|
||||
</Button
|
||||
>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getManagerBrandPage, addBrand, disableBrand} from "@/api/goods";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
import {
|
||||
getManagerBrandPage,
|
||||
addBrand,
|
||||
updateBrand,
|
||||
disableBrand,
|
||||
delBrand,
|
||||
} from "@/api/goods";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
|
||||
export default {
|
||||
name: "brand",
|
||||
components: {
|
||||
uploadPicInput,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
export default {
|
||||
name: "brand",
|
||||
components: {
|
||||
uploadPicInput,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
name: "",
|
||||
logo: "",
|
||||
deleteFlag: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
title: "品牌名称",
|
||||
key: "name",
|
||||
width: 200,
|
||||
resizable: true,
|
||||
sortable: false,
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
name: "",
|
||||
logo: "",
|
||||
deleteFlag: "",
|
||||
{
|
||||
title: "品牌图标",
|
||||
key: "logo",
|
||||
align: "left",
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.logo,
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
title: "品牌名称",
|
||||
key: "name",
|
||||
width: 200,
|
||||
resizable: true,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "品牌图标",
|
||||
key: "logo",
|
||||
align: "left",
|
||||
render: (h, params) => {
|
||||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.logo,
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "deleteFlag",
|
||||
align: "left",
|
||||
render: (h, params) => {
|
||||
if (params.row.deleteFlag == 0) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "启用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.deleteFlag == 1) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
label: "启用",
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: "禁用",
|
||||
value: 1,
|
||||
},
|
||||
],
|
||||
filterMultiple: false,
|
||||
filterMethod(value, row) {
|
||||
if (value == 0) {
|
||||
return row.deleteFlag == 0;
|
||||
} else if (value == 1) {
|
||||
return row.deleteFlag == 1;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 180,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let enableOrDisable = "";
|
||||
if (params.row.deleteFlag == 0) {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: "error",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.disable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"禁用"
|
||||
);
|
||||
} else {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.enable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"启用"
|
||||
);
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
enableOrDisable,
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
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();
|
||||
},
|
||||
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() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getManagerBrandPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
console.warn(12)
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
addBrand(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
addBrand(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
{
|
||||
title: "状态",
|
||||
key: "deleteFlag",
|
||||
align: "left",
|
||||
render: (h, params) => {
|
||||
if (params.row.deleteFlag == 0) {
|
||||
return h("Tag", {props: {color: "green",},},"启用");
|
||||
} else if (params.row.deleteFlag == 1) {
|
||||
return h("Tag", {props: {color: "volcano",},},"禁用");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
label: "启用",
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: "禁用",
|
||||
value: 1,
|
||||
},
|
||||
],
|
||||
filterMultiple: false,
|
||||
filterMethod(value, row) {
|
||||
if (value == 0) {
|
||||
return row.deleteFlag == 0;
|
||||
} else if (value == 1) {
|
||||
return row.deleteFlag == 1;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 180,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let enableOrDisable = "";
|
||||
if (params.row.deleteFlag == 0) {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: "error",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.disable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"禁用"
|
||||
);
|
||||
} else {
|
||||
enableOrDisable = h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.enable(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"启用"
|
||||
);
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
enableOrDisable,
|
||||
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.delBrand(params.row.id);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 删除品牌
|
||||
async delBrand(id) {
|
||||
let res = await delBrand(id);
|
||||
|
||||
if (res.success) {
|
||||
this.$Message.success("品牌删除成功!");
|
||||
this.getDataList();
|
||||
}
|
||||
},
|
||||
|
||||
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();
|
||||
},
|
||||
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() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getManagerBrandPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
console.warn(12);
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
addBrand(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
updateBrand(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
enable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
content: "您确认要启用品牌 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
disableBrand(v.id, {disable: false}).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用品牌 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
disableBrand(v.id, {disable: true}).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.$refs.form.resetFields();
|
||||
delete this.form.id;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
};
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
enable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认启用",
|
||||
content: "您确认要启用品牌 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
disableBrand(v.id, { disable: false }).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
disable(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认禁用",
|
||||
content: "您确认要禁用品牌 " + v.name + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
disableBrand(v.id, { disable: true }).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<tree-table ref="treeTable" size="default" :loading="loading" :data="tableData" :columns="columns" :border="true" :show-index="false" :is-fold="true" :expand-type="false" primary-key="id">
|
||||
|
||||
<template slot="action" slot-scope="scope">
|
||||
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
|
||||
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
|
||||
<Button size="small">
|
||||
绑定
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
|
@ -106,7 +106,7 @@
|
|||
|
||||
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
|
||||
<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>
|
||||
</Select>
|
||||
|
@ -134,7 +134,6 @@ import {
|
|||
} from "@/api/goods";
|
||||
import TreeTable from "@/views/my-components/tree-table/Table/Table";
|
||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||
import * as filters from "@/utils/filters";
|
||||
|
||||
export default {
|
||||
name: "lili-components",
|
||||
|
@ -153,7 +152,7 @@ export default {
|
|||
specifications: [], //规格集合
|
||||
categoryId: "", // 分类id
|
||||
category_brands: [], //已经选择的品牌
|
||||
category_specs: [], //已经选择的规格
|
||||
categorySpecs: [], //已经选择的规格
|
||||
expandLevel: 1, // 展开层级
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
|
@ -212,13 +211,17 @@ export default {
|
|||
},
|
||||
],
|
||||
tableData: [],
|
||||
categoryIndex: 0,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
changeSortCate(val) {
|
||||
let way = this.categoryList.find((item) => {
|
||||
return item.name == val;
|
||||
let way = this.categoryList.find((item, index) => {
|
||||
if (item.name == val) {
|
||||
this.categoryIndex = index;
|
||||
console.log((this.categoryIndex = index));
|
||||
return item.name == val;
|
||||
}
|
||||
});
|
||||
this.tableData = [way];
|
||||
},
|
||||
|
@ -236,7 +239,8 @@ export default {
|
|||
//获取所有规格
|
||||
getSpecList() {
|
||||
getSpecificationList().then((res) => {
|
||||
if (res.success) {
|
||||
if (res.length != 0) {
|
||||
|
||||
this.specifications = res;
|
||||
}
|
||||
});
|
||||
|
@ -244,7 +248,7 @@ export default {
|
|||
//弹出品牌关联框
|
||||
brandOperation(v) {
|
||||
getCategoryBrandListData(v.id).then((res) => {
|
||||
console.warn(res)
|
||||
console.warn(res);
|
||||
this.categoryId = v.id;
|
||||
this.modalBrandTitle = "品牌关联";
|
||||
this.brandForm.categoryBrands = res.result.map((item) => item.id);
|
||||
|
@ -257,7 +261,8 @@ export default {
|
|||
getCategorySpecListData(v.id).then((res) => {
|
||||
this.categoryId = v.id;
|
||||
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;
|
||||
});
|
||||
},
|
||||
|
@ -337,7 +342,7 @@ export default {
|
|||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("添加成功");
|
||||
this.getAllList(0);
|
||||
this.getAllList(this.categoryIndex);
|
||||
this.modalVisible = false;
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
|
@ -348,7 +353,7 @@ export default {
|
|||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("修改成功");
|
||||
this.getAllList(0);
|
||||
this.getAllList(this.categoryIndex);
|
||||
this.modalVisible = false;
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
|
@ -376,12 +381,11 @@ export default {
|
|||
});
|
||||
},
|
||||
getAllList(parent_id) {
|
||||
this.sortCateList = [];
|
||||
this.loading = true;
|
||||
getCategoryTree(parent_id).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
// 仅展开指定级数 默认后台已展开所有
|
||||
let expandLevel = this.expandLevel;
|
||||
localStorage.setItem("category", JSON.stringify(res.result));
|
||||
res.result.forEach((e, index, arr) => {
|
||||
this.sortCateList.push({
|
||||
|
@ -389,65 +393,13 @@ export default {
|
|||
value: e.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.tableData = [res.result[0]];
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$set(this, "tableData", [res.result[this.categoryIndex]]);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -507,22 +459,8 @@ export default {
|
|||
background: #fff;
|
||||
padding: 20px;
|
||||
}
|
||||
.article {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.href-text {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.operation {
|
||||
margin-bottom: 2vh;
|
||||
}
|
||||
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -135,35 +135,11 @@ export default {
|
|||
width: 90,
|
||||
render: (h, params) => {
|
||||
if (params.row.grade == "GOOD") {
|
||||
return h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "success",
|
||||
},
|
||||
},
|
||||
"好评"
|
||||
);
|
||||
return h("Tag", {props: {color: "green",},}, "好评");
|
||||
} else if (params.row.grade == "MODERATE") {
|
||||
return h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "warning",
|
||||
},
|
||||
},
|
||||
"中评"
|
||||
);
|
||||
return h("Tag", {props: {color: "orange",},}, "中评");
|
||||
} else {
|
||||
return h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "error",
|
||||
},
|
||||
},
|
||||
"差评"
|
||||
);
|
||||
return h("Tag", {props: {color: "red",},}, "差评");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<Input type="text" @keyup="handleLink(linkItem,linkList.length)" v-model="linkItem.url" placeholder="https://"></Input>
|
||||
</div>
|
||||
</Poptip>
|
||||
|
||||
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
@ -74,7 +74,12 @@ export default {
|
|||
icon: "md-happy",
|
||||
___type: "sign",
|
||||
},
|
||||
|
||||
{
|
||||
title: "小程序直播",
|
||||
icon: "ios-videocam",
|
||||
___type: "live",
|
||||
},
|
||||
|
||||
],
|
||||
linkItem: {
|
||||
title: "外部链接",
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<span slot="close">关</span>
|
||||
</i-switch>
|
||||
<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">
|
||||
<Button type="error" size="small">删除</Button>
|
||||
</Poptip>
|
||||
|
@ -139,9 +139,9 @@ export default {
|
|||
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() {
|
||||
|
|
|
@ -1,172 +1,174 @@
|
|||
<template>
|
||||
<div class="renovation">
|
||||
<!-- 左侧模块列表 -->
|
||||
<div class="model-list">
|
||||
<div class="classification-title">基础模块</div>
|
||||
<draggable tag="ul" :list="modelData"
|
||||
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">
|
||||
<Icon :type="model.icon" />
|
||||
<span>{{model.name}}</span>
|
||||
</li>
|
||||
</draggable>
|
||||
</div>
|
||||
<!-- 中间展示模块 -->
|
||||
<div class="show-content">
|
||||
<model-form ref="modelForm" :data="modelForm"></model-form>
|
||||
</div>
|
||||
<!-- 保存按钮 -->
|
||||
<div class="btn-bar"><Button type="primary" @click="saveTemplate">保存模板</Button> <Button @click="resetTemplate">还原模板</Button></div>
|
||||
<div class="renovation">
|
||||
<!-- 左侧模块列表 -->
|
||||
<div class="model-list">
|
||||
<div class="classification-title">基础模块</div>
|
||||
<draggable tag="ul" :list="modelData" 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">
|
||||
<Icon :type="model.icon" />
|
||||
<span>{{model.name}}</span>
|
||||
</li>
|
||||
</draggable>
|
||||
</div>
|
||||
<!-- 中间展示模块 -->
|
||||
<div class="show-content">
|
||||
<model-form ref="modelForm" :data="modelForm"></model-form>
|
||||
</div>
|
||||
<!-- 保存按钮 -->
|
||||
<div class="btn-bar"><Button type="primary" @click="saveTemplate">保存模板</Button> <Button @click="resetTemplate">还原模板</Button></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { modelData } from './modelConfig';
|
||||
import { modelData } from "./modelConfig";
|
||||
import Draggable from "vuedraggable";
|
||||
import ModelForm from './modelForm.vue';
|
||||
import * as API_floor from '@/api/other.js';
|
||||
import ModelForm from "./modelForm.vue";
|
||||
import * as API_floor from "@/api/other.js";
|
||||
export default {
|
||||
components:{
|
||||
Draggable, ModelForm
|
||||
components: {
|
||||
Draggable,
|
||||
ModelForm,
|
||||
},
|
||||
mounted() {
|
||||
this.getTemplateItem(this.$route.query.id);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modelData, // 可选模块数据
|
||||
modelForm: { list: [] }, // 模板数据
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
saveTemplate() {
|
||||
// 保存模板
|
||||
this.submitTemplate(this.$route.query.pageShow ? 'OPEN' : 'CLOSE')
|
||||
},
|
||||
mounted(){
|
||||
this.getTemplateItem(this.$route.query.id)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modelData, // 可选模块数据
|
||||
modelForm:{list:[]} // 模板数据
|
||||
// 提交模板
|
||||
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 = {
|
||||
id: this.$route.query.id,
|
||||
pageData: modelForm,
|
||||
pageShow,
|
||||
};
|
||||
API_floor.updateHome(this.$route.query.id, data).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("保存模板成功");
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
saveTemplate(){ // 保存模板
|
||||
this.modelForm.list.unshift(this.$refs.modelForm.navList)
|
||||
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert)
|
||||
const modelForm = JSON.stringify(this.modelForm)
|
||||
const data = {
|
||||
id:this.$route.query.id,
|
||||
pageData:modelForm,
|
||||
resetTemplate() {
|
||||
// 还原模板
|
||||
this.getTemplateItem(this.$route.query.id);
|
||||
},
|
||||
getTemplateItem(id) {
|
||||
// 获取模板数据
|
||||
API_floor.getHomeData(id).then((res) => {
|
||||
if (res.success) {
|
||||
let pageData = res.result.pageData;
|
||||
if (pageData) {
|
||||
pageData = JSON.parse(pageData);
|
||||
if (pageData.list[0].type === "topAdvert") {
|
||||
// topAdvert 为顶部广告 navList为导航栏
|
||||
this.$refs.modelForm.topAdvert = pageData.list[0];
|
||||
this.$refs.modelForm.navList = pageData.list[1];
|
||||
pageData.list.splice(0, 2);
|
||||
this.modelForm = pageData;
|
||||
} else {
|
||||
this.modelForm = { list: [] };
|
||||
}
|
||||
API_floor.updateHome(this.$route.query.id, data).then(res=> {
|
||||
if(res.success) {
|
||||
this.$Message.success('保存模板成功');
|
||||
} else {
|
||||
this.$Message.error(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
resetTemplate(){ // 还原模板
|
||||
this.getTemplateItem(this.$route.query.id)
|
||||
},
|
||||
getTemplateItem(id){ // 获取模板数据
|
||||
API_floor.getHomeData(id).then(res => {
|
||||
if (res.success) {
|
||||
let pageData = res.result.pageData;
|
||||
if(pageData) {
|
||||
pageData = JSON.parse(pageData);
|
||||
if (pageData.list[0].type === 'topAdvert') { // topAdvert 为顶部广告 navList为导航栏
|
||||
this.$refs.modelForm.topAdvert = pageData.list[0];
|
||||
this.$refs.modelForm.navList = pageData.list[1];
|
||||
pageData.list.splice(0,2)
|
||||
this.modelForm = pageData;
|
||||
} else {
|
||||
this.modelForm = {list:[]}
|
||||
}
|
||||
|
||||
} else {
|
||||
this.modelForm = {list:[]}
|
||||
}
|
||||
}
|
||||
|
||||
// this.$refs.modelForm.topAdvert = {};
|
||||
// this.$refs.modelForm.navList = {}
|
||||
})
|
||||
} else {
|
||||
this.modelForm = { list: [] };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// this.$refs.modelForm.topAdvert = {};
|
||||
// this.$refs.modelForm.navList = {}
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
modelForm: {
|
||||
deep: true,
|
||||
handler: function (val) {
|
||||
console.log(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelForm: {
|
||||
deep: true,
|
||||
handler: function (val) {
|
||||
console.log(val);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.renovation{
|
||||
position: relative;
|
||||
display: flex;
|
||||
.renovation {
|
||||
position: relative;
|
||||
display: flex;
|
||||
}
|
||||
.model-list{
|
||||
width: 120px;
|
||||
height:auto;
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
margin-top: 60px;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
box-shadow: 1px 1px 10px #999;
|
||||
.classification-title{
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.model-item{
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
background: #eee;
|
||||
margin-top: 10px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
&:hover{
|
||||
border: 1px dashed #409EFF;
|
||||
color: #409EFF;
|
||||
cursor: move;
|
||||
}
|
||||
}
|
||||
.ghost::after{
|
||||
border:none;
|
||||
height: 0;
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
.show-content{
|
||||
margin-left: 150px;
|
||||
margin-top: 60px;
|
||||
}
|
||||
.ghost{
|
||||
background: #fff;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
&::after{
|
||||
content: '松开鼠标添加模块';
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
border: 1px dashed #409EFF;
|
||||
color: #409EFF;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
}
|
||||
}
|
||||
.btn-bar{
|
||||
position: fixed;
|
||||
.model-list {
|
||||
width: 120px;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
margin-top: 60px;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
box-shadow: 1px 1px 10px #999;
|
||||
.classification-title {
|
||||
width: 100%;
|
||||
background:#fff;
|
||||
height: 50px;
|
||||
padding: 10px;
|
||||
box-shadow: 1px 1px 10px #999;
|
||||
z-index: 99;
|
||||
top: 100px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.model-item {
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
background: #eee;
|
||||
margin-top: 10px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
&:hover {
|
||||
border: 1px dashed #409eff;
|
||||
color: #409eff;
|
||||
cursor: move;
|
||||
}
|
||||
}
|
||||
.ghost::after {
|
||||
border: none;
|
||||
height: 0;
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
.show-content {
|
||||
margin-left: 150px;
|
||||
margin-top: 60px;
|
||||
}
|
||||
.ghost {
|
||||
background: #fff;
|
||||
height: 30px;
|
||||
position: relative;
|
||||
&::after {
|
||||
content: "松开鼠标添加模块";
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
border: 1px dashed #409eff;
|
||||
color: #409eff;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
}
|
||||
}
|
||||
.btn-bar {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
height: 50px;
|
||||
padding: 10px;
|
||||
box-shadow: 1px 1px 10px #999;
|
||||
z-index: 99;
|
||||
top: 100px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -3,35 +3,22 @@
|
|||
<div class="model-title">
|
||||
<div>店铺装修</div>
|
||||
<div class="btns">
|
||||
<Button
|
||||
@click="clickBtn(item)"
|
||||
size="small"
|
||||
v-for="(item, index) in way"
|
||||
:key="index"
|
||||
:type="item.selected ? 'primary' : ''"
|
||||
>
|
||||
<Button @click="clickBtn(item)" size="small" v-for="(item, index) in way" :key="index" :type="item.selected ? 'primary' : ''">
|
||||
{{ item.title }}
|
||||
</Button>
|
||||
</div>
|
||||
<div class="model-title-view-btn">
|
||||
<Poptip placement="bottom" width="100">
|
||||
<!-- TODO 后期会补全 目前版本暂无 -->
|
||||
<!-- <Poptip placement="bottom" width="100">
|
||||
<Button size="default" @click="creatQrCode">预览模板</Button>
|
||||
<div slot="content" class="default-view-content">
|
||||
<div>临时预览</div>
|
||||
<div ref="qrCodeUrl"></div>
|
||||
</div>
|
||||
</Poptip>
|
||||
<Button size="default" type="primary" @click="handleSpinShow"
|
||||
>保存模板</Button
|
||||
>
|
||||
</Poptip> -->
|
||||
<Button size="default" type="primary" @click="handleSpinShow">保存模板</Button>
|
||||
|
||||
<Modal
|
||||
title="保存中"
|
||||
v-model="saveDialog"
|
||||
:closable="true"
|
||||
:mask-closable="false"
|
||||
:footer-hide="true"
|
||||
>
|
||||
<Modal title="保存中" v-model="saveDialog" :closable="true" :mask-closable="false" :footer-hide="true">
|
||||
<div v-if="progress">
|
||||
<div class="model-item">
|
||||
模板名称 <Input style="width: 200px" v-model="submitWay.name" />
|
||||
|
@ -61,7 +48,8 @@ export default {
|
|||
progress: true, // 展示进度
|
||||
num: 20, // 提交进度
|
||||
saveDialog: false, // 加载状态
|
||||
way: [ // 装修tab栏切换
|
||||
way: [
|
||||
// 装修tab栏切换
|
||||
{
|
||||
title: "首页",
|
||||
name: "index",
|
||||
|
@ -80,7 +68,8 @@ export default {
|
|||
},
|
||||
],
|
||||
qrcode: "", // 二维码
|
||||
submitWay: { // 表单信息
|
||||
submitWay: {
|
||||
// 表单信息
|
||||
pageShow: this.$route.query.type || false,
|
||||
name: this.$route.query.name || "模板名称",
|
||||
pageClientType: "H5",
|
||||
|
@ -124,11 +113,13 @@ export default {
|
|||
|
||||
// 更新
|
||||
update() {
|
||||
this.progress = false;
|
||||
this.progress = false;
|
||||
API_Other.updateHome(this.$route.query.id, {
|
||||
pageData: JSON.stringify(this.$store.state.styleStore),
|
||||
name: this.submitWay.name,
|
||||
pageShow: this.submitWay.pageShow,
|
||||
pageType: "INDEX",
|
||||
pageClientType: "H5",
|
||||
})
|
||||
.then((res) => {
|
||||
this.num = 50;
|
||||
|
@ -171,7 +162,7 @@ export default {
|
|||
this.goback();
|
||||
}, 1000);
|
||||
} else {
|
||||
this.progress = true;
|
||||
this.progress = true;
|
||||
this.saveDialog = false;
|
||||
this.$Message.error("保存失败,请稍后重试");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.image-mode {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
padding: 1px;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
|
||||
<template>
|
||||
<div class="layout">
|
||||
<img class="image-mode" :src="res.list[0].img" alt="">
|
||||
<img class="image-mode" :src="res.list[1].img" alt="">
|
||||
<img class="image-mode" :src="res.list[2].img" alt="">
|
||||
<img class="image-mode" :src="res.list[3].img" alt="">
|
||||
<img class="image-mode" :src="res.list[4].img" alt="">
|
||||
<img class="image-mode" :src="res.list[0].img" alt="">
|
||||
<img class="image-mode" :src="res.list[1].img" alt="">
|
||||
<img class="image-mode" :src="res.list[2].img" alt="">
|
||||
<img class="image-mode" :src="res.list[3].img" alt="">
|
||||
<img class="image-mode" :src="res.list[4].img" alt="">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -13,21 +13,18 @@
|
|||
export default {
|
||||
title: "五列单行图片模块",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.layout {
|
||||
|
||||
background: #e8e8e8;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-size: cover;
|
||||
}
|
||||
img{
|
||||
img {
|
||||
width: 67px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -12,21 +12,22 @@
|
|||
export default {
|
||||
title: "四列单行图片模块",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.layout {
|
||||
height: 84px;
|
||||
// background: #e8e8e8;
|
||||
// height: 84px;
|
||||
display: flex;
|
||||
padding: 0 8px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
img{
|
||||
width: 84px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -11,14 +11,12 @@
|
|||
export default {
|
||||
title: "三列单行图片模块",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.layout {
|
||||
background: #e8e8e8;
|
||||
height: 110px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -28,4 +26,4 @@ export default {
|
|||
img{
|
||||
width: 111px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -20,7 +20,7 @@ export default {
|
|||
title: "左一右二",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -34,4 +34,4 @@ export default {
|
|||
background-size: cover;
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</template>
|
||||
|
@ -21,18 +21,22 @@ export default {
|
|||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./tpl.scss";
|
||||
.layout {
|
||||
height: 167px;
|
||||
height: 150px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
</style>
|
||||
.view-height-75 {
|
||||
.image-mode {
|
||||
height: 75px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -23,12 +23,7 @@
|
|||
|
||||
</Row>
|
||||
<!-- 拼图验证码 -->
|
||||
<verify
|
||||
ref="verify"
|
||||
class="verify-con"
|
||||
verifyType="LOGIN"
|
||||
@change="verifyChange"
|
||||
></verify>
|
||||
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||
<div v-if="socialLogining">
|
||||
<RectLoading />
|
||||
</div>
|
||||
|
@ -48,7 +43,7 @@ import LangSwitch from "@/views/main-components/lang-switch";
|
|||
import RectLoading from "@/views/my-components/lili/rect-loading";
|
||||
import CountDownButton from "@/views/my-components/lili/count-down-button";
|
||||
import util from "@/libs/util.js";
|
||||
import verify from '@/views/my-components/verify';
|
||||
import verify from "@/views/my-components/verify";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -57,18 +52,20 @@ export default {
|
|||
LangSwitch,
|
||||
Header,
|
||||
Footer,
|
||||
verify
|
||||
verify,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, // 加载状态
|
||||
form: { // 表单数据
|
||||
form: {
|
||||
// 表单数据
|
||||
username: "",
|
||||
password: "",
|
||||
mobile: "",
|
||||
code: "",
|
||||
},
|
||||
rules: { // 验证规则
|
||||
rules: {
|
||||
// 验证规则
|
||||
username: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -88,7 +85,8 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
mounted() {},
|
||||
afterLogin(res) { // 登录成功后处理
|
||||
afterLogin(res) {
|
||||
// 登录成功后处理
|
||||
let accessToken = res.result.accessToken;
|
||||
let refreshToken = res.result.refreshToken;
|
||||
this.setStore("accessToken", accessToken);
|
||||
|
@ -109,28 +107,35 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
submitLogin() { // 登录操作
|
||||
submitLogin() {
|
||||
// 登录操作
|
||||
this.$refs.usernameLoginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.verify.show = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
verifyChange (con) { // 拼图验证码回显
|
||||
verifyChange(con) {
|
||||
// 拼图验证码回显
|
||||
if (!con.status) return;
|
||||
|
||||
|
||||
this.loading = true;
|
||||
login({
|
||||
username: this.form.username,
|
||||
password: this.md5(this.form.password),
|
||||
}).then((res) => {
|
||||
if (res && res.success) {
|
||||
this.afterLogin(res);
|
||||
} else {
|
||||
})
|
||||
.then((res) => {
|
||||
if (res && res.success) {
|
||||
this.afterLogin(res);
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
}
|
||||
}).catch(()=>{this.loading = false});
|
||||
}
|
||||
});
|
||||
this.$refs.verify.show = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -154,7 +159,7 @@ export default {
|
|||
position: relative;
|
||||
zoom: 1;
|
||||
}
|
||||
.verify-con{
|
||||
.verify-con {
|
||||
position: absolute;
|
||||
top: 90px;
|
||||
z-index: 10;
|
||||
|
@ -198,5 +203,4 @@ export default {
|
|||
.flex {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<div>
|
||||
<Row class="header">
|
||||
<img src="../../assets/logo.png" class="logo" width="220px">
|
||||
<!-- <div class="description">{{ $t('LILISHOP-ADMIN') }}</div> -->
|
||||
</Row>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -15,13 +14,13 @@ export default {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.header {
|
||||
|
||||
margin-bottom: 6vh;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center !important;
|
||||
}
|
||||
.logo {
|
||||
transform: scale(2);
|
||||
width: 440px;
|
||||
height: 158px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -55,6 +55,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
changeMenu(name) { //二级路由点击
|
||||
console.log(name)
|
||||
this.$router.push({
|
||||
name: name
|
||||
});
|
||||
|
|
|
@ -131,23 +131,9 @@
|
|||
sortable: false,
|
||||
render: (h, params) => {
|
||||
if (params.row.payStatus == "PAID") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "已付款",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.payStatus == "UNPAID") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "未付款",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "green",},}, "已付款");
|
||||
} else {
|
||||
return h("Tag", {props: {color: "red",},}, "未付款");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -312,6 +312,7 @@ export default {
|
|||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
selectMember: [], //保存选中的用户
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -320,18 +321,66 @@ export default {
|
|||
type: Boolean,
|
||||
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: {
|
||||
// 回调给父级
|
||||
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);
|
||||
},
|
||||
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) {
|
||||
this.searchForm.pageNumber = v;
|
||||
// 此处如果是父子级传值的时候需要做一下处理
|
||||
//selectedMember
|
||||
|
||||
this.getData();
|
||||
},
|
||||
changePageSize(v) {
|
||||
|
@ -387,15 +436,13 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
//查询会员列表
|
||||
getData() {
|
||||
API_Member.getMemberListData(this.searchForm).then((res) => {
|
||||
if (res.result.records) {
|
||||
this.loading = false;
|
||||
res.result.records.forEach((item) => {
|
||||
item.___selected = false;
|
||||
});
|
||||
this.data = res.result.records;
|
||||
this.init(res.result.records);
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
|
@ -484,7 +531,7 @@ export default {
|
|||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
this.getData();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -15,20 +15,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Modal
|
||||
title="编辑html代码"
|
||||
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;"
|
||||
/>
|
||||
<Modal title="编辑html代码" 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" />
|
||||
<div slot="footer">
|
||||
<Button @click="full=!full" icon="md-expand">全屏开/关</Button>
|
||||
|
@ -56,21 +44,21 @@ export default {
|
|||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: "editor"
|
||||
default: "editor",
|
||||
},
|
||||
value: String,
|
||||
base64: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
default: false,
|
||||
},
|
||||
showExpand: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
openXss: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -79,16 +67,17 @@ export default {
|
|||
dataEdit: "", // 编辑数据
|
||||
showHTMLModal: false, // 显示html
|
||||
full: false, // html全屏开关
|
||||
fullscreenModal: false // 显示全屏预览
|
||||
fullscreenModal: false, // 显示全屏预览
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
initEditor() {
|
||||
let that = this;
|
||||
// 详见wangeditor3官网文档 https://www.kancloud.cn/wangfupeng/wangeditor3/332599
|
||||
editor = new E(`#${this.id}`);
|
||||
// 编辑内容绑定数据
|
||||
editor.config.onchange = html => {
|
||||
editor.config.onchange = (html) => {
|
||||
if (this.openXss) {
|
||||
this.data = xss(html);
|
||||
} else {
|
||||
|
@ -108,30 +97,30 @@ export default {
|
|||
editor.config.uploadImgServer = uploadFile;
|
||||
// lili如要header中传入token鉴权
|
||||
editor.config.uploadImgHeaders = {
|
||||
accessToken: that.getStore("accessToken")
|
||||
accessToken: that.getStore("accessToken"),
|
||||
};
|
||||
editor.config.uploadFileName = "file";
|
||||
editor.config.uploadImgHooks = {
|
||||
before: function(xhr, editor, files) {
|
||||
before: function (xhr, editor, files) {
|
||||
// 图片上传之前触发
|
||||
},
|
||||
success: function(xhr, editor, result) {
|
||||
success: function (xhr, editor, result) {
|
||||
// 图片上传并返回结果,图片插入成功之后触发
|
||||
},
|
||||
fail: function(xhr, editor, result) {
|
||||
fail: function (xhr, editor, result) {
|
||||
// 图片上传并返回结果,但图片插入错误时触发
|
||||
that.$Message.error("上传图片失败");
|
||||
},
|
||||
error: function(xhr, editor) {
|
||||
error: function (xhr, editor) {
|
||||
// 图片上传出错时触发
|
||||
that.$Message.error("上传图片出错");
|
||||
},
|
||||
timeout: function(xhr, editor) {
|
||||
timeout: function (xhr, editor) {
|
||||
// 图片上传超时时触发
|
||||
that.$Message.error("上传图片超时");
|
||||
},
|
||||
// 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置
|
||||
customInsert: function(insertImg, result, editor) {
|
||||
customInsert: function (insertImg, result, editor) {
|
||||
if (result.success == true) {
|
||||
let url = result.result;
|
||||
insertImg(url);
|
||||
|
@ -139,10 +128,11 @@ export default {
|
|||
} else {
|
||||
that.$Message.error(result.message);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
editor.config.customAlert = function(info) {
|
||||
|
||||
editor.config.customAlert = function (info) {
|
||||
// info 是需要提示的内容
|
||||
// that.$Message.info(info);
|
||||
};
|
||||
|
@ -156,8 +146,8 @@ export default {
|
|||
// type -> 'emoji' / 'image'
|
||||
type: "image",
|
||||
// content -> 数组
|
||||
content: sina
|
||||
}
|
||||
content: sina,
|
||||
},
|
||||
];
|
||||
editor.create();
|
||||
if (this.value) {
|
||||
|
@ -187,7 +177,7 @@ export default {
|
|||
editor.txt.html(this.data);
|
||||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
setData(value) {
|
||||
|
@ -200,22 +190,21 @@ export default {
|
|||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.setData(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.initEditor();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.e-menu {
|
||||
|
||||
z-index: 101;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
|
|
|
@ -216,11 +216,11 @@
|
|||
width: 100,
|
||||
render: (h, params) => {
|
||||
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") {
|
||||
return h('div', [h('span', {}, '退货'),]);
|
||||
return h('div', [h('tag', {props: {color: "volcano"}}, '退货'),]);
|
||||
} 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,
|
||||
render: (h, params) => {
|
||||
if (params.row.serviceStatus == "APPLY") {
|
||||
return h('div', [h('span', {}, '申请中'),]);
|
||||
return h('div', [h('tag', {props: {color: "blue"}}, '申请中'),]);
|
||||
} 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") {
|
||||
return h('div', [h('span', {}, '拒绝售后'),]);
|
||||
return h('div', [h('tag', {props: {color: "volcano"}}, '拒绝售后'),]);
|
||||
} else if (params.row.serviceStatus == "BUYER_RETURN") {
|
||||
return h('div', [h('span', {}, '买家退货,待卖家收货'),]);
|
||||
} else if (params.row.serviceStatus == "SELLER_RE_DELIVERY") {
|
||||
return h('div', [h('span', {}, '商家换货/补发'),]);
|
||||
return h('div', [h('tag', {props: {color: "orange"}}, '买家退货,待卖家收货'),]);
|
||||
} 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") {
|
||||
return h('div', [h('span', {}, '卖家终止售后'),]);
|
||||
} else if (params.row.serviceStatus == "BUYER_CONFIRM") {
|
||||
return h('div', [h('span', {}, '买家确认收货'),]);
|
||||
return h('div', [h('tag', {props: {color: "lime"}}, '卖家终止售后'),]);
|
||||
} 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") {
|
||||
return h('div', [h('span', {}, '完成售后'),]);
|
||||
return h('div', [h('tag', {props: {color: "green"}}, '完成售后'),]);
|
||||
}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,
|
||||
render: (h, params) => {
|
||||
if (params.row.complainStatus == "NEW") {
|
||||
return h('div', [h('span', { }, '新投诉'),]);
|
||||
return h('div', [h('tag',{props: {color: "purple"}}, '新投诉'),]);
|
||||
} 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") {
|
||||
return h('div', [h('span', { }, '待申诉'),]);
|
||||
return h('div', [h('tag', {props: {color: "volcano"}}, '待申诉'),]);
|
||||
} 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") {
|
||||
return h('div', [h('span', { }, '等待仲裁'),]);
|
||||
return h('div', [h('tag', {props: {color: "blue"}}, '等待仲裁'),]);
|
||||
}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",
|
||||
render: (h, params) => {
|
||||
if (params.row.paymentMethod === "WECHAT") {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "green",
|
||||
},
|
||||
},
|
||||
"微信"
|
||||
),
|
||||
]);
|
||||
return h("div", [h("Tag", {props: {color: "green",},}, "微信"),]);
|
||||
} else if (params.row.paymentMethod === "ALIPAY") {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "blue",
|
||||
},
|
||||
},
|
||||
"支付宝"
|
||||
),
|
||||
]);
|
||||
return h("div", [h("Tag", {props: {color: "blue",},}, "支付宝"),]);
|
||||
} else if (params.row.paymentMethod === "WALLET") {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {},
|
||||
},
|
||||
"余额支付"
|
||||
),
|
||||
]);
|
||||
return h("div", [h("Tag", {props: {color: "geekblue",},}, "余额支付"),]);
|
||||
} else if (params.row.paymentMethod === "BANK_TRANSFER") {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "orange",
|
||||
},
|
||||
},
|
||||
"银行转帐"
|
||||
),
|
||||
]);
|
||||
return h("div", [h("Tag", {props: {color: "orange",},}, "银行转帐"),]);
|
||||
} else {
|
||||
return h("div", [h("Tag", {}, "暂未付款")]);
|
||||
}
|
||||
|
|
|
@ -100,9 +100,9 @@ export default {
|
|||
width: 95,
|
||||
render: (h, params) => {
|
||||
if (params.row.isRefund == "1") {
|
||||
return h("div", [h("span", {}, "已退款")]);
|
||||
return h("div", [h("Tag", {props: {color: "green",},}, "已退款")]);
|
||||
} else {
|
||||
return h("div", [h("span", {}, "未退款")]);
|
||||
return h("div", [h("Tag", {props: {color: "orange",},}, "未退款")]);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
sort: "", // 默认排序字段
|
||||
order: "", // 默认排序方式
|
||||
startDate: "", // 起始时间
|
||||
endDate: "", // 终止时间
|
||||
orderType: "FICTITIOUS",
|
||||
|
@ -118,8 +118,6 @@
|
|||
title: "下单时间",
|
||||
key: "createTime",
|
||||
width: 200,
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
},
|
||||
{
|
||||
title: "订单来源",
|
||||
|
@ -150,19 +148,15 @@
|
|||
width:95,
|
||||
render: (h, params) => {
|
||||
if (params.row.orderStatus == "UNPAID") {
|
||||
return h('div', [h('span', { }, '未付款'),]);
|
||||
return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]);
|
||||
} 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', { }, '已取消'),]);
|
||||
return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]);
|
||||
} else if (params.row.orderStatus == "COMPLETED") {
|
||||
return h("div", [h("tag", {props: {color: "green"}}, "已完成")]);
|
||||
} else if (params.row.orderStatus == "TAKE") {
|
||||
return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]);
|
||||
} else if (params.row.orderStatus == "CANCELLED") {
|
||||
return h("div", [h("tag", {props: {color: "red"}}, "已取消")]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<div class="div-item">
|
||||
<div class="div-item-left">订单来源:</div>
|
||||
<div class="div-item-right">
|
||||
{{ orderInfo.order.clientType }}
|
||||
{{ orderInfo.order.clientType | clientTypeWay}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,47 +1,58 @@
|
|||
<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" placeholder="请输入订单号" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="会员名称" prop="buyerName">
|
||||
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="订单状态" prop="orderStatus">
|
||||
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
<Option value="UNPAID">未付款</Option>
|
||||
<Option value="PAID">已付款</Option>
|
||||
<Option value="UNDELIVERED">待发货</Option>
|
||||
<Option value="DELIVERED">已发货</Option>
|
||||
<Option value="COMPLETED">已完成</Option>
|
||||
<Option value="TAKE">待核验</Option>
|
||||
<Option value="CANCELLED">已取消</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Card>
|
||||
|
||||
<Form-item label="下单时间">
|
||||
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
<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" placeholder="请输入订单号" clearable style="width: 160px" />
|
||||
</Form-item>
|
||||
<Form-item label="会员名称" prop="buyerName">
|
||||
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 160px" />
|
||||
</Form-item>
|
||||
|
||||
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
|
||||
<Button type="primary" ghost class="search-btn">导出Excel</Button>
|
||||
</download-excel>
|
||||
<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 label="订单状态" prop="orderStatus">
|
||||
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
|
||||
<Option value="UNPAID">未付款</Option>
|
||||
<Option value="PAID">已付款</Option>
|
||||
<Option value="UNDELIVERED">待发货</Option>
|
||||
<Option value="DELIVERED">已发货</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>
|
||||
</Form>
|
||||
</Row>
|
||||
<div>
|
||||
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
|
||||
<Button type="primary" class="export">
|
||||
导出Excel
|
||||
</Button>
|
||||
</download-excel>
|
||||
</div>
|
||||
|
||||
</Form>
|
||||
</Row>
|
||||
<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">
|
||||
<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>
|
||||
<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>
|
||||
|
@ -56,53 +67,54 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
// 表格的表头以及内容
|
||||
|
||||
|
||||
fields:{
|
||||
"订单编号":"sn",
|
||||
"下单时间":"createTime",
|
||||
"客户名称":"memberName",
|
||||
"客户账号":"",
|
||||
"收货人":"",
|
||||
"收货人手机号":"",
|
||||
"收货人地址":"",
|
||||
"支付方式":{
|
||||
fields: {
|
||||
订单编号: "sn",
|
||||
下单时间: "createTime",
|
||||
客户名称: "memberName",
|
||||
客户账号: "",
|
||||
收货人: "",
|
||||
收货人手机号: "",
|
||||
收货人地址: "",
|
||||
支付方式: {
|
||||
field: "clientType",
|
||||
callback:value=>{
|
||||
callback: (value) => {
|
||||
if (value == "H5") {
|
||||
return "移动端"
|
||||
return "移动端";
|
||||
} else if (value == "PC") {
|
||||
return "PC端"
|
||||
} else if (value== "WECHAT_MP") {
|
||||
return "小程序端"
|
||||
return "PC端";
|
||||
} else if (value == "WECHAT_MP") {
|
||||
return "小程序端";
|
||||
} else if (value == "APP") {
|
||||
return "移动应用端"
|
||||
return "移动应用端";
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"配送方式":"",
|
||||
"配送费用":"",
|
||||
"订单商品金额":"",
|
||||
"订单优惠金额":"",
|
||||
"订单应付金额":"",
|
||||
"商品SKU编号":"",
|
||||
"商品数量":"groupNum",
|
||||
"买家备注":"",
|
||||
"订单状态":"",
|
||||
"付款状态":{
|
||||
field:"payStatus",
|
||||
callback:value=>{
|
||||
return value == "UNPAID" ? "未付款" : value == "PAID" ? "已付款" : ""
|
||||
}
|
||||
配送方式: "",
|
||||
配送费用: "",
|
||||
订单商品金额: "",
|
||||
订单优惠金额: "",
|
||||
订单应付金额: "",
|
||||
商品SKU编号: "",
|
||||
商品数量: "groupNum",
|
||||
买家备注: "",
|
||||
订单状态: "",
|
||||
付款状态: {
|
||||
field: "payStatus",
|
||||
callback: (value) => {
|
||||
return value == "UNPAID"
|
||||
? "未付款"
|
||||
: value == "PAID"
|
||||
? "已付款"
|
||||
: "";
|
||||
},
|
||||
},
|
||||
"发货状态":"",
|
||||
"发票类型":"",
|
||||
"发票抬头":"",
|
||||
"店铺":"storeName",
|
||||
发货状态: "",
|
||||
发票类型: "",
|
||||
发票抬头: "",
|
||||
店铺: "storeName",
|
||||
},
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
|
@ -126,18 +138,14 @@ export default {
|
|||
{
|
||||
title: "订单号",
|
||||
key: "sn",
|
||||
minWidth: 230,
|
||||
minWidth: 240,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "下单时间",
|
||||
key: "createTime",
|
||||
width: 200,
|
||||
},
|
||||
|
||||
{
|
||||
title: "订单来源",
|
||||
key: "clientType",
|
||||
width: 95,
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.clientType == "H5") {
|
||||
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: "买家名称",
|
||||
key: "memberName",
|
||||
width: 130,
|
||||
minWidth: 130,
|
||||
tooltip: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "订单金额",
|
||||
key: "flowPrice",
|
||||
minWidth: 120,
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
|
@ -172,31 +199,38 @@ export default {
|
|||
{
|
||||
title: "订单状态",
|
||||
key: "orderStatus",
|
||||
width: 95,
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.orderStatus == "UNPAID") {
|
||||
return h("div", [h("span", {}, "未付款")]);
|
||||
return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]);
|
||||
} 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", {}, "待发货")]);
|
||||
return h("div", [h("tag", {props: {color: "geekblue"}}, "待发货")]);
|
||||
} 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") {
|
||||
return h("div", [h("span", {}, "已完成")]);
|
||||
return h("div", [h("tag", {props: {color: "green"}}, "已完成")]);
|
||||
} 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") {
|
||||
return h("div", [h("span", {}, "已取消")]);
|
||||
return h("div", [h("tag", {props: {color: "red"}}, "已取消")]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "下单时间",
|
||||
key: "createTime",
|
||||
width: 170,
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 180,
|
||||
width: 150,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
|
@ -340,4 +374,11 @@ export default {
|
|||
<style lang="scss" scoped>
|
||||
// 建议引入通用样式 可删除下面样式代码
|
||||
@import "@/styles/table-common.scss";
|
||||
.export {
|
||||
margin: 10px 20px 10px 0;
|
||||
}
|
||||
.export-excel-wrapper {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
<Input type="number" v-model="form.sort" clearable style="width: 10%" />
|
||||
</FormItem>
|
||||
<FormItem class="form-item-view-el" label="文章内容" prop="content">
|
||||
<editor v-model="form.content"></editor>
|
||||
<editor openXss v-model="form.content"></editor>
|
||||
</FormItem>
|
||||
<FormItem label="是否展示" prop="openStatus">
|
||||
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
|
||||
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
|
@ -123,7 +123,7 @@ export default {
|
|||
searchTreeValue: "", // 切换
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
openStatus:false,
|
||||
openStatus: false,
|
||||
title: "",
|
||||
categoryId: "",
|
||||
sort: 1,
|
||||
|
@ -380,7 +380,6 @@ export default {
|
|||
//为了在是否展示一列展示开关 需要改一下数据类型,最终提交再次更改
|
||||
this.data = [];
|
||||
if (res.result.records.length > 0) {
|
||||
|
||||
this.data = res.result.records;
|
||||
}
|
||||
}
|
||||
|
@ -390,7 +389,6 @@ export default {
|
|||
},
|
||||
|
||||
handleSubmit() {
|
||||
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
|
@ -403,7 +401,6 @@ export default {
|
|||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@ -414,8 +411,6 @@ export default {
|
|||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -440,10 +435,25 @@ export default {
|
|||
this.form.categoryId = res.result.categoryId;
|
||||
this.treeValue = data.articleCategoryName;
|
||||
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.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 """;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<Row>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="活动名称" prop="couponName">
|
||||
<Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px"/>
|
||||
<Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="活动状态" prop="promotionStatus">
|
||||
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
|
@ -15,8 +15,7 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间"
|
||||
style="width: 200px"></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
|
@ -26,21 +25,17 @@
|
|||
<Button @click="delAll">批量下架</Button>
|
||||
<!-- <Button @click="upAll" >批量上架</Button> -->
|
||||
</Row>
|
||||
<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-select-cancel="cancelSelect" @on-selection-change="changeSelect">
|
||||
<template slot-scope="{ row,index }" slot="action">
|
||||
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary"
|
||||
size="small" style="margin-right: 10px" @click="edit(row)">编辑
|
||||
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary" size="small" style="margin-right: 10px" @click="edit(row)">编辑
|
||||
</Button>
|
||||
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error"
|
||||
size="small" style="margin-right: 10px" @click="remove(row)">下架
|
||||
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" style="margin-right: 10px" @click="remove(row)">下架
|
||||
</Button>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="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]"
|
||||
size="small" show-total show-elevator show-sizer></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>
|
||||
|
@ -64,11 +59,11 @@ export default {
|
|||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 0, // 当前页数
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "startTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
getType: '', // 默认排序方式
|
||||
getType: "", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
|
@ -77,7 +72,7 @@ export default {
|
|||
// 表单验证规则
|
||||
formValidate: {
|
||||
promotionName: [
|
||||
{required: true, message: "不能为空", trigger: "blur"},
|
||||
{ required: true, message: "不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
@ -94,19 +89,19 @@ export default {
|
|||
{
|
||||
title: "活动名称",
|
||||
key: "promotionName",
|
||||
|
||||
minWidth: 100,
|
||||
fixed: "left",
|
||||
},
|
||||
{
|
||||
title: "优惠券名称",
|
||||
key: "couponName",
|
||||
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "面额/折扣",
|
||||
key: "price",
|
||||
width: 120,
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.price) {
|
||||
return h(
|
||||
|
@ -122,26 +117,28 @@ export default {
|
|||
{
|
||||
title: "领取数量/总数量",
|
||||
key: "publishNum",
|
||||
width: 150,
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
params.row.receivedNum + "/" + params.row.publishNum
|
||||
);
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
title: "优惠券类型",
|
||||
key: "couponType",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
let text = "未知";
|
||||
let text = "";
|
||||
if (params.row.couponType === "DISCOUNT") {
|
||||
text = "打折";
|
||||
return h("Tag", {props: {color: "blue",},}, "打折");
|
||||
} 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: "活动时间",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
|
||||
render: (h, params) => {
|
||||
if (params.row.getType === "ACTIVITY") {
|
||||
return h("div", "长期有效");
|
||||
} else {
|
||||
return h("div", {
|
||||
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";
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
text = "未开始";
|
||||
color = "default";
|
||||
color = "geekblue";
|
||||
} else if (params.row.promotionStatus == "START") {
|
||||
text = "已开始";
|
||||
color = "green";
|
||||
|
@ -211,17 +208,19 @@ export default {
|
|||
),
|
||||
]);
|
||||
},
|
||||
minWidth: 70,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
slot: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 100,
|
||||
maxWidth: 140,
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
selectCoupon: [], //本级选中的优惠券
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -233,13 +232,13 @@ export default {
|
|||
//优惠券类型 查询参数
|
||||
getType: {
|
||||
type: String,
|
||||
default: ''
|
||||
default: "",
|
||||
},
|
||||
//已选择优惠券
|
||||
selectList: {
|
||||
selectedList: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
default: [],
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
|
@ -250,26 +249,37 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
// 选中优惠券 父级传值
|
||||
selectedList: {
|
||||
handler(val) {
|
||||
// 判断是否是父级回调给自己已选择优惠券
|
||||
if (val.length != 0) {
|
||||
this.selectCoupon = val;
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
check() {
|
||||
this.$emit("selected", this.selectList);
|
||||
// this.selectCoupon.push(this.selectList)
|
||||
this.$emit("selected", this.selectCoupon);
|
||||
},
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
add() {
|
||||
this.$router.push({name: "add-platform-coupon"});
|
||||
this.$router.push({ name: "add-platform-coupon" });
|
||||
},
|
||||
/** 跳转至领取详情页面 */
|
||||
receiveInfo(v) {
|
||||
this.$router.push({name: "member-receive-coupon", query: {id: v.id}});
|
||||
this.$router.push({ name: "member-receive-coupon", query: { id: v.id } });
|
||||
},
|
||||
info(v) {
|
||||
this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
|
||||
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v - 1;
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
// this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
|
@ -291,10 +301,37 @@ export default {
|
|||
clearSelectAll() {
|
||||
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) {
|
||||
if (this.checked && e.length != 0) {
|
||||
this.selectCoupon.push(...e);
|
||||
this.check();
|
||||
}
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
this.checked ? this.check() : '';
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
|
@ -309,9 +346,18 @@ export default {
|
|||
getPlatformCouponList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
res.result.records.forEach(item => {
|
||||
item.___selected = false
|
||||
})
|
||||
res.result.records.forEach((item) => {
|
||||
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.total = res.result.total;
|
||||
}
|
||||
|
@ -353,7 +399,7 @@ export default {
|
|||
});
|
||||
},
|
||||
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) {
|
||||
this.$Modal.confirm({
|
||||
|
|
|
@ -4,8 +4,17 @@
|
|||
<Row class="operation padding-row">
|
||||
<Button @click="add" type="primary">添加活动</Button>
|
||||
</Row>
|
||||
<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">
|
||||
|
||||
<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>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
|
||||
|
@ -19,11 +28,11 @@
|
|||
<script>
|
||||
import {
|
||||
getCouponActivityList,
|
||||
updatePlatformCouponStatus,
|
||||
closeActivity,
|
||||
} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "coupon",
|
||||
name: "couponActivity",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
|
@ -148,63 +157,36 @@ export default {
|
|||
default: false,
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
if (to.fullPath == "/promotion/manager-coupon") {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 选中优惠券 父级传值
|
||||
check(val, index) {
|
||||
|
||||
this.data[index].___selected = !this.data[index].___selected
|
||||
|
||||
this.$emit("selected", val);
|
||||
},
|
||||
//获取数据 初始化
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
//增加券活动
|
||||
add() {
|
||||
this.$router.push({name: "add-coupon-activity"});
|
||||
},
|
||||
/** 跳转至领取详情页面 */
|
||||
receiveInfo(v) {
|
||||
this.$router.push({name: "member-receive-coupon", query: {id: v.id}});
|
||||
},
|
||||
//查看详情
|
||||
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) {
|
||||
this.searchForm.pageNumber = v - 1;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
//修改分页
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
//搜索活动
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 0;
|
||||
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;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
//数据获取
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||
|
@ -218,133 +200,32 @@ export default {
|
|||
getCouponActivityList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
res.result.records.forEach(item => {
|
||||
item.___selected = false
|
||||
})
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
this.total = this.data.length;
|
||||
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) {
|
||||
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
|
||||
},
|
||||
//下架活动
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认下架",
|
||||
// 记得确认修改此处
|
||||
content: "确认要下架此优惠券么?",
|
||||
content: "确认要下架此优惠券活动么?下架活动只能重新创建",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
updatePlatformCouponStatus({
|
||||
couponIds: v.id,
|
||||
promotionStatus: "CLOSE",
|
||||
})
|
||||
.then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("优惠券已作废");
|
||||
this.getDataList();
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
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();
|
||||
closeActivity(v.id).then((res) => {
|
||||
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.$Message.success("优惠券活动已作废");
|
||||
this.getDataList();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$Modal;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -3,81 +3,37 @@
|
|||
<div class="content-goods-publish">
|
||||
<Form ref="form" :model="form" :label-width="130">
|
||||
<div class="base-info-item">
|
||||
<h4>平台券活动详情</h4>
|
||||
<h4>优惠券活动详情</h4>
|
||||
<div class="form-item-view">
|
||||
<FormItem label="活动名称">
|
||||
<span class="goods-category-name">{{ form.promotionName }}</span>
|
||||
<span>{{ couponActivity.promotionName }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动类型">
|
||||
<span class="goods-category-name">{{
|
||||
getCouponType(form.couponType)
|
||||
}}</span>
|
||||
<span v-if="couponActivity.couponActivityType === 'REGISTERED'" >新人发券</span>
|
||||
<spin v-else>精确发券</spin>
|
||||
</FormItem>
|
||||
<FormItem label="面额">
|
||||
<span class="goods-category-name"> ¥{{ form.price | unitPrice }}</span>
|
||||
<FormItem label="活动范围" v-if="couponActivity.couponActivityType === 'SPECIFY'" >
|
||||
<span v-if="couponActivity.activityScope === 'ALL'" >全部会员</span>
|
||||
<spin v-else>指定会员</spin>
|
||||
</FormItem>
|
||||
<FormItem label="活动说明">
|
||||
<span class="goods-category-name">{{ form.description }}</span>
|
||||
<FormItem label="活动时间">
|
||||
<span>{{ couponActivity.startTime }}~{{ couponActivity.endTime }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="发放总数">
|
||||
<span class="goods-category-name">{{ form.publishNum }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="领取限制">
|
||||
<span class="goods-category-name">{{ form.limitNum }}</span>
|
||||
</FormItem>
|
||||
<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 label="活动状态">
|
||||
|
||||
<span v-if="couponActivity.promotionStatus==='NEW'">新建</span>
|
||||
<span v-if="couponActivity.promotionStatus==='START'">已开始</span>
|
||||
<span v-if="couponActivity.promotionStatus==='END'">已结束</span>
|
||||
<span v-if="couponActivity.promotionStatus==='CLOSE'">已废弃</span>
|
||||
</FormItem>
|
||||
</div>
|
||||
<h4>适用品类范围</h4>
|
||||
<div>
|
||||
<Table :loading="loading" border :columns="columns1" :data="data1" 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>
|
||||
</div>
|
||||
<h4>优惠券列表</h4>
|
||||
<Table :columns="couponColumn" :data="couponData" ref="table">
|
||||
</Table>
|
||||
<h4 v-if="couponActivity.activityScopeInfo && memberData.length>0">会员列表列表</h4>
|
||||
<Table :columns="memberColumn" :data="memberData">
|
||||
|
||||
</Table>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
|
@ -89,145 +45,78 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getPlatformCoupon } from "@/api/promotion";
|
||||
|
||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
||||
import editor from "@/views/my-components/lili/editor";
|
||||
import {getCouponActivity} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "addCoupon",
|
||||
components: {
|
||||
uploadPicThumb,
|
||||
editor,
|
||||
},
|
||||
name: "couponActivityInfo",
|
||||
data() {
|
||||
return {
|
||||
modalType: 0, // 当前类型
|
||||
loading: false, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
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: [
|
||||
id: this.$route.query.id,//表单id
|
||||
couponActivity: "",//券活动
|
||||
couponColumn: [
|
||||
{
|
||||
title: "一级类目",
|
||||
key: "name",
|
||||
title: "优惠券名称",
|
||||
key: 'couponName'
|
||||
},
|
||||
{
|
||||
title: "二级类目",
|
||||
key: "age",
|
||||
title: "优惠券金额",
|
||||
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: "三级类目",
|
||||
key: "address",
|
||||
title: "优惠券类型",
|
||||
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: [
|
||||
{
|
||||
name: "王小明",
|
||||
age: 18,
|
||||
address: "北京市朝阳区芍药居",
|
||||
},
|
||||
{
|
||||
name: "张小刚",
|
||||
age: 25,
|
||||
address: "北京市海淀区西二旗",
|
||||
},
|
||||
{
|
||||
name: "李小红",
|
||||
age: 30,
|
||||
address: "上海市浦东新区世纪大道",
|
||||
},
|
||||
{
|
||||
name: "周小伟",
|
||||
age: 26,
|
||||
address: "深圳市南山区深南大道",
|
||||
},
|
||||
],
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
memberData: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 如果id不为空则查询信息
|
||||
if (this.id) {
|
||||
this.getCoupon();
|
||||
this.modalType = 1;
|
||||
}
|
||||
this.getCouponActivity();
|
||||
},
|
||||
methods: {
|
||||
getCouponType(value) {
|
||||
switch (value) {
|
||||
case "POINT":
|
||||
return "打折";
|
||||
case "PRICE":
|
||||
return "减免现金";
|
||||
}
|
||||
},
|
||||
/** 获取状态 */
|
||||
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;
|
||||
//获取优惠券活动
|
||||
getCouponActivity() {
|
||||
getCouponActivity(this.id).then((res) => {
|
||||
this.couponActivity = res.result;
|
||||
this.couponData = this.couponActivity.couponActivityItems;
|
||||
this.memberData = JSON.parse(this.couponActivity.activityScopeInfo);
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$store.commit("removeTag", "platform-coupon-info");
|
||||
this.$store.commit("removeTag", "coupon-activity");
|
||||
this.$router.go(-1);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -123,10 +123,6 @@ div.base-info-item {
|
|||
}
|
||||
|
||||
|
||||
/** 审核信息-拒绝原因 */
|
||||
.auth-info {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
width: 30%;
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
</FormItem>
|
||||
|
||||
<FormItem label="活动时间">
|
||||
<DatePicker type="datetimerange" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"
|
||||
:options="options" style="width: 260px">
|
||||
<DatePicker type="datetimerange" :options="options" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择" style="width: 260px">
|
||||
</DatePicker>
|
||||
</FormItem>
|
||||
|
||||
|
@ -30,12 +30,10 @@
|
|||
<FormItem label="选择会员" prop="scopeType"
|
||||
v-if="form.couponActivityType==='SPECIFY' && form.activityScope==='DESIGNATED'">
|
||||
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
|
||||
</FormItem>
|
||||
{{ selectedMember }}
|
||||
|
||||
<FormItem label="活动描述" prop="activityScopeInfo">
|
||||
<Input v-model="form.activityScopeInfo" type="textarea" :rows="4" maxlength="50" show-word-limit clearable
|
||||
style="width: 260px"/>
|
||||
<div style="margin-top:24px;" v-if="form.activityScope == 'DESIGNATED'">
|
||||
<Table border :columns="userColumns" :data="this.selectedMember">
|
||||
</Table>
|
||||
</div>
|
||||
</FormItem>
|
||||
</div>
|
||||
<h4>配置优惠券</h4>
|
||||
|
@ -61,12 +59,13 @@
|
|||
</div>
|
||||
</Form>
|
||||
</Card>
|
||||
<Modal v-model="showCouponSelect" width="80%">
|
||||
<couponTemplate :checked="true" :selectList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon"/>
|
||||
<Modal @on-ok="()=>{this.showCouponSelect = false}" @on-cancel="()=>{this.showCouponSelect = false}"
|
||||
v-model="showCouponSelect" width="80%">
|
||||
<couponTemplate :checked="true" :selectedList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon"/>
|
||||
</Modal>
|
||||
|
||||
<Modal width="1200" v-model="checkUserList">
|
||||
<userList @callback="callbackSelectUser" ref="memberLayout"/>
|
||||
<userList v-if="checkUserList" @callback="callbackSelectUser" :selectedList="selectedMember" ref="memberLayout"/>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -76,10 +75,7 @@ import couponTemplate from "@/views/promotion/coupon/coupon";
|
|||
|
||||
import userList from "@/views/member/list/index";
|
||||
|
||||
import {
|
||||
saveActivityCoupon,
|
||||
updateCouponActivity,
|
||||
} from "@/api/promotion";
|
||||
import {saveActivityCoupon, updateCouponActivity} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "addCouponActivity",
|
||||
|
@ -89,30 +85,75 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
showCouponSelect: false,//显示优惠券选择框
|
||||
modalType: 0, // 是否编辑
|
||||
rangeTime: '',//时间区间
|
||||
checkUserList: false,//会员选择器
|
||||
selectedMember: [],//选择的会员
|
||||
options: {
|
||||
disabledDate(date) {
|
||||
return date && date.valueOf() < Date.now() - 86400000;
|
||||
},
|
||||
},
|
||||
showCouponSelect: false, //显示优惠券选择框
|
||||
rangeTime: "", //时间区间
|
||||
checkUserList: false, //会员选择器
|
||||
selectedMember: [], //选择的会员
|
||||
form: {
|
||||
promotionName: '', //活动名称
|
||||
activityScope: 'ALL', //活动范围
|
||||
couponActivityType: 'REGISTERED', //触发活动方式
|
||||
activityScopeInfo: '', //活动描述
|
||||
startTime: '', //开始时间
|
||||
endTime: '', //结束时间
|
||||
couponActivityItems: []
|
||||
|
||||
}, // 表单
|
||||
id: this.$route.query.id, // 优惠券活动id
|
||||
promotionName: "", //活动名称
|
||||
activityScope: "ALL", //活动范围 ,默认全体发券
|
||||
couponActivityType: "REGISTERED", //触发活动方式 默认新人赠券
|
||||
startTime: "", //开始时间
|
||||
endTime: "", //结束时间
|
||||
memberDTOS: [], //指定会员范围
|
||||
couponActivityItems: [],//优惠券列表
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectCouponList: [],//选择的优惠券列表
|
||||
selectCouponList: [], //选择的优惠券列表
|
||||
formRule: {
|
||||
promotionName: [{required: true, message: "活动名称不能为空"}],
|
||||
rangeTime: [{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: [
|
||||
{
|
||||
title: "优惠券名称",
|
||||
|
@ -175,7 +216,7 @@ export default {
|
|||
},
|
||||
on: {
|
||||
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: {
|
||||
|
||||
// 返回已选择的用户
|
||||
callbackSelectUser(val) {
|
||||
let index = this.selectedMember.indexOf(val)
|
||||
if (index > 0) {
|
||||
this.selectedMember.remove(val);
|
||||
// 每次将返回的数据回调判断
|
||||
let findUser = this.selectedMember.find((item) => {
|
||||
return item.id === val.id;
|
||||
});
|
||||
// 如果没有则添加
|
||||
if (!findUser) {
|
||||
this.selectedMember.push(val);
|
||||
} else {
|
||||
// 有重复数据就删除
|
||||
this.selectedMember.map((item, index) => {
|
||||
if (item.id === findUser.id) {
|
||||
this.selectedMember.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.selectedMember.push(val);
|
||||
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() {
|
||||
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() {
|
||||
|
||||
this.form.startTime = this.$options.filters.unixToDate(
|
||||
this.rangeTime[0] / 1000
|
||||
);
|
||||
|
@ -287,27 +308,17 @@ export default {
|
|||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
console.log(params)
|
||||
console.log(params);
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete params.id;
|
||||
saveActivityCoupon(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("优惠券活动创建成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
updateCouponActivity(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("优惠券活动修改成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
}
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete params.id;
|
||||
saveActivityCoupon(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.$router.go(-1);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</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,
|
||||
render: (h, params) => {
|
||||
let text = "未知",
|
||||
color = "default";
|
||||
color = "purple";
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
text = "未开始";
|
||||
color = "default";
|
||||
color = "geekblue";
|
||||
} else if (params.row.promotionStatus == "START") {
|
||||
text = "已开始";
|
||||
color = "green";
|
||||
color = "blue";
|
||||
} else if (params.row.promotionStatus == "END") {
|
||||
text = "已结束";
|
||||
color = "blue";
|
||||
color = "green";
|
||||
} else if (params.row.promotionStatus == "CLOSE") {
|
||||
text = "已关闭";
|
||||
color = "red";
|
||||
color = "volcano";
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
|
|
|
@ -93,7 +93,7 @@ export default {
|
|||
},
|
||||
on: {
|
||||
"on-change": () => {
|
||||
this.star(params.row,params.index);
|
||||
this.star(params.row, params.index);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -183,19 +183,19 @@ export default {
|
|||
/**
|
||||
* 是否推荐
|
||||
*/
|
||||
async star(val,index) {
|
||||
let switched
|
||||
if(this.liveData[index].recommend){
|
||||
this.$set(this.liveData[index],'recommend',false)
|
||||
switched = false
|
||||
}
|
||||
else{
|
||||
|
||||
this.$set(this.liveData[index],'recommend',true)
|
||||
switched = true
|
||||
async star(val, index) {
|
||||
let switched;
|
||||
if (this.liveData[index].recommend) {
|
||||
this.$set(this.liveData[index], "recommend", false);
|
||||
switched = false;
|
||||
} else {
|
||||
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 = "";
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
text = "未开始";
|
||||
color = "default";
|
||||
color = "geekblue";
|
||||
} else if (params.row.promotionStatus == "START") {
|
||||
text = "已开始";
|
||||
color = "green";
|
||||
color = "blue";
|
||||
} else if (params.row.promotionStatus == "END") {
|
||||
text = "已结束";
|
||||
color = "blue";
|
||||
color = "green";
|
||||
} else if (params.row.promotionStatus == "CLOSE") {
|
||||
text = "已关闭";
|
||||
color = "red";
|
||||
color = "volcano";
|
||||
}
|
||||
return h("div", [
|
||||
h(
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<div>{{ row.startTime }}</div>
|
||||
<div>{{ row.endTime }}</div>
|
||||
</template>
|
||||
|
||||
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button
|
||||
v-if="row.promotionStatus == 'NEW'"
|
||||
|
@ -213,16 +213,16 @@ export default {
|
|||
color = "";
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
text = "未开始";
|
||||
color = "default";
|
||||
color = "geekblue";
|
||||
} else if (params.row.promotionStatus == "START") {
|
||||
text = "已开始";
|
||||
color = "green";
|
||||
color = "blue";
|
||||
} else if (params.row.promotionStatus == "END") {
|
||||
text = "已结束";
|
||||
color = "blue";
|
||||
color = "green";
|
||||
} else if (params.row.promotionStatus == "CLOSE") {
|
||||
text = "已关闭";
|
||||
color = "red";
|
||||
color = "volcano";
|
||||
}
|
||||
return h("div", [h("Tag", { props: { color: color } }, text)]);
|
||||
},
|
||||
|
|
|
@ -102,41 +102,13 @@ export default {
|
|||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "新建",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "volcano",},},"新建");
|
||||
} else if (params.row.promotionStatus == "START") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "开始",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "blue",},},"开始");
|
||||
} else if (params.row.promotionStatus == "END") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "结束",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "green",},},"结束");
|
||||
} else if (params.row.promotionStatus == "CLOSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "废弃",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "volcano",},},"结束");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<div v-if="templateShow">
|
||||
<Form :model="form" :label-width="120">
|
||||
<FormItem label="每日场次设置">
|
||||
<Row :gutter="16" class="row">
|
||||
|
@ -27,6 +27,7 @@ import { getSetting, setSetting } from "@/api/index";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
templateShow:false,
|
||||
submitLoading: false,
|
||||
selectedTime: [],
|
||||
times: [], //时间集合 1-24点
|
||||
|
@ -81,6 +82,7 @@ export default {
|
|||
async init() {
|
||||
let result = await getSetting("SECKILL_SETTING");
|
||||
if (result.success) {
|
||||
this.templateShow = true
|
||||
this.form.seckillRule = result.result.seckillRule;
|
||||
this.times=[]
|
||||
for (let i = 0; i < 24; i++) {
|
||||
|
|
|
@ -303,7 +303,7 @@ export default {
|
|||
content: "更新后店铺以及用户地区绑定数据将全部错乱",
|
||||
onOk: () => {
|
||||
let timer;
|
||||
let numer;
|
||||
let number;
|
||||
|
||||
this.asyncLoading = true
|
||||
|
||||
|
@ -319,7 +319,8 @@ export default {
|
|||
click: () => {
|
||||
this.$Message.destroy();
|
||||
this.asyncLoading = false
|
||||
clearInterval(timer, numer);
|
||||
clearInterval(number);
|
||||
clearTimeout(timer)
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -329,11 +330,12 @@ export default {
|
|||
},
|
||||
});
|
||||
|
||||
numer = setInterval(() => {
|
||||
number = setInterval(() => {
|
||||
this.num--;
|
||||
}, 1000);
|
||||
|
||||
timer = setTimeout(() => {
|
||||
clearInterval(number)
|
||||
asyncRegion().then((res) => {
|
||||
this.asyncLoading = false
|
||||
this.$Message.loading("地区数据正在更新中!");
|
||||
|
|
|
@ -95,13 +95,13 @@ export default {
|
|||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.billStatus == "OUT") {
|
||||
return h("div", "已出账");
|
||||
return h("Tag", {props: {color: "blue",},},"已出账");
|
||||
} else if (params.row.billStatus == "CHECK") {
|
||||
return h("div", "已对账");
|
||||
return h("Tag", {props: {color: "geekblue",},},"已对账");
|
||||
} else if (params.row.billStatus == "EXAMINE") {
|
||||
return h("div", "已审核");
|
||||
return h("Tag", {props: {color: "purple",},},"已审核");
|
||||
} 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 / 1000
|
||||
));
|
||||
this.searchForm.billStatus = "OUT";
|
||||
this.searchForm.billStatus = "CHECK";
|
||||
API_Shop.getBuyBillPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
|
|
|
@ -106,13 +106,13 @@ export default {
|
|||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.billStatus == "OUT") {
|
||||
return h("div", "已出账");
|
||||
return h("Tag", {props: {color: "blue",},},"已出账");
|
||||
} else if (params.row.billStatus == "CHECK") {
|
||||
return h("div", "已对账");
|
||||
return h("Tag", {props: {color: "geekblue",},},"已对账");
|
||||
} else if (params.row.billStatus == "EXAMINE") {
|
||||
return h("div", "已审核");
|
||||
return h("Tag", {props: {color: "purple",},},"已审核");
|
||||
} else {
|
||||
return h("div", "已付款");
|
||||
return h("Tag", {props: {color: "green",},},"已付款");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -126,7 +126,7 @@ export default {
|
|||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: params.row.selfOperated ? "error" : "success",
|
||||
color: params.row.selfOperated ? "volcano" : "green",
|
||||
},
|
||||
},
|
||||
params.row.selfOperated ? "自营" : "非自营"
|
||||
|
@ -141,50 +141,15 @@ export default {
|
|||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.storeDisable == "OPEN") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "开启中",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "green",},},"开启中");
|
||||
} else if (params.row.storeDisable == "CLOSED") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "已关闭",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "volcano",},},"已关闭");
|
||||
} else if (params.row.storeDisable == "APPLY") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "申请中",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "geekblue",},},"申请中");
|
||||
} else if (params.row.storeDisable == "APPLYING") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "审核中",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "purple",},},"审核中");
|
||||
} else if (params.row.storeDisable == "REFUSED") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "审核拒绝",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
return h("Tag", {props: {color: "red",},},"审核拒绝");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="shop-item">
|
||||
<div class="label-item">
|
||||
<span>订单来源</span>
|
||||
<span>{{res.clientType}}</span>
|
||||
<span>{{res.clientType | clientTypeWay}}</span>
|
||||
</div>
|
||||
<div class="label-item">
|
||||
<span>订单状态</span>
|
||||
|
|
|
@ -347,6 +347,7 @@ export default {
|
|||
this.form.versionUpdateDate / 1000
|
||||
);
|
||||
this.form.versionUpdateDate = versionUpdateDate;
|
||||
|
||||
this.form.updateTime = versionUpdateDate;
|
||||
if (this.modalType == 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
"swiper": "^6.3.5",
|
||||
"vue-qr": "^2.3.0",
|
||||
"uuid": "^8.3.2",
|
||||
"view-design": "^4.2.0",
|
||||
"vue": "^2.6.10",
|
||||
"vue-awesome": "^4.0.2",
|
||||
|
@ -37,15 +37,16 @@
|
|||
"vue-clipboard2": "^0.3.0",
|
||||
"vue-cropper": "^0.4.9",
|
||||
"vue-i18n": "^8.15.1",
|
||||
"vue-json-excel": "^0.3.0",
|
||||
"vue-json-pretty": "^1.4.1",
|
||||
"vue-lazyload": "^1.3.3",
|
||||
"vue-qr": "^2.3.0",
|
||||
"vue-router": "^3.1.3",
|
||||
"vuedraggable": "^2.23.2",
|
||||
"vuex": "^3.4.0",
|
||||
"wangeditor": "^4.6.13",
|
||||
"xlsx": "^0.16.2",
|
||||
"xss": "^1.0.7",
|
||||
"uuid": "^8.3.2"
|
||||
"xss": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.4.4",
|
||||
|
|
|
@ -1,116 +1,130 @@
|
|||
// 统一请求路径前缀在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) => {
|
||||
return getRequest(`/orders`, params)
|
||||
}
|
||||
export const getOrderList = params => {
|
||||
return getRequest(`/orders`, params);
|
||||
};
|
||||
|
||||
// 获取普通订单详细信息
|
||||
export const getOrderDetail = (sn) => {
|
||||
return getRequest(`/orders/${sn}`)
|
||||
}
|
||||
export const getOrderDetail = sn => {
|
||||
return getRequest(`/orders/${sn}`);
|
||||
};
|
||||
|
||||
// 调整订单金额
|
||||
export const modifyOrderPrice = (sn, params) => {
|
||||
return putRequest(`/orders/update/${sn}/price`, params)
|
||||
}
|
||||
return putRequest(`/orders/update/${sn}/price`, params);
|
||||
};
|
||||
|
||||
// 取消订单
|
||||
export const cancelOrder = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/cancel`, params)
|
||||
}
|
||||
return postRequest(`/orders/${sn}/cancel`, params);
|
||||
};
|
||||
|
||||
// 修改收货地址
|
||||
export const editOrderConsignee = (sn, params) => {
|
||||
return postRequest(`/orders/update/${sn}/consignee`, params)
|
||||
}
|
||||
return postRequest(`/orders/update/${sn}/consignee`, params);
|
||||
};
|
||||
//获取投诉列表
|
||||
export const getComplainPage = (params) => {
|
||||
return getRequest(`/complain`, params)
|
||||
}
|
||||
export const getComplainPage = params => {
|
||||
return getRequest(`/complain`, params);
|
||||
};
|
||||
|
||||
//获取投诉详情
|
||||
export const getComplainDetail = (id) => {
|
||||
return getRequest(`/complain/${id}`)
|
||||
}
|
||||
export const getComplainDetail = id => {
|
||||
return getRequest(`/complain/${id}`);
|
||||
};
|
||||
|
||||
//添加交易投诉对话
|
||||
export const addOrderComplaint = (params) => {
|
||||
return postRequest(`/complain/communication/`, params)
|
||||
}
|
||||
export const addOrderComplaint = params => {
|
||||
return postRequest(`/complain/communication/`, params);
|
||||
};
|
||||
|
||||
//添加交易投诉对话
|
||||
export const appeal = (params) => {
|
||||
return putRequest(`/complain/appeal`, params)
|
||||
}
|
||||
export const appeal = params => {
|
||||
return putRequest(`/complain/appeal`, params);
|
||||
};
|
||||
|
||||
//获取订单日志
|
||||
export const getOrderLog = (sn, params) => {
|
||||
return getRequest(`/orderLog/${sn}`, params)
|
||||
}
|
||||
return getRequest(`/orderLog/${sn}`, params);
|
||||
};
|
||||
|
||||
// 订单发货
|
||||
export const orderDelivery = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/delivery`, params)
|
||||
}
|
||||
return postRequest(`/orders/${sn}/delivery`, params);
|
||||
};
|
||||
|
||||
// 获取商家选中的物流公司
|
||||
export const getLogisticsChecked = () => {
|
||||
return getRequest(`/logistics/getChecked`)
|
||||
}
|
||||
return getRequest(`/logistics/getChecked`);
|
||||
};
|
||||
|
||||
// 订单核验
|
||||
export const orderTake = (sn, params) => {
|
||||
return postRequest(`/orders/${sn}/take`, params)
|
||||
}
|
||||
export const orderTake = (sn, verificationCode) => {
|
||||
return putRequest(`/orders/take/${sn}/${verificationCode}`);
|
||||
};
|
||||
|
||||
// 售后服务单
|
||||
export const afterSaleOrderPage = (params) => {
|
||||
return getRequest(`/afterSale/page`, params)
|
||||
}
|
||||
export const afterSaleOrderPage = params => {
|
||||
return getRequest(`/afterSale/page`, params);
|
||||
};
|
||||
|
||||
// 售后服务单详情
|
||||
export const afterSaleOrderDetail = (sn) => {
|
||||
return getRequest(`/afterSale/${sn}`)
|
||||
}
|
||||
export const afterSaleOrderDetail = sn => {
|
||||
return getRequest(`/afterSale/${sn}`);
|
||||
};
|
||||
|
||||
// 商家审核
|
||||
export const afterSaleSellerReview = (sn, params) => {
|
||||
return putRequest(`/afterSale/review/${sn}`, params)
|
||||
}
|
||||
return putRequest(`/afterSale/review/${sn}`, params);
|
||||
};
|
||||
|
||||
// 商家确认收货
|
||||
export const afterSaleSellerConfirm = (sn, params) => {
|
||||
return putRequest(`/afterSale/confirm/${sn}`, params)
|
||||
}
|
||||
return putRequest(`/afterSale/confirm/${sn}`, params);
|
||||
};
|
||||
|
||||
// 商家换货业务发货
|
||||
export const afterSaleSellerDelivery = (sn, params) => {
|
||||
return postRequest(`/afterSale/${sn}/delivery`, params)
|
||||
}
|
||||
return postRequest(`/afterSale/${sn}/delivery`, params);
|
||||
};
|
||||
//查询物流
|
||||
export const getTraces = (sn, params) => {
|
||||
return postRequest(`/orders/getTraces/${sn}`, params)
|
||||
}
|
||||
return postRequest(`/orders/getTraces/${sn}`, params);
|
||||
};
|
||||
//售后单查询物流
|
||||
export const getSellerDeliveryTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getSellerDeliveryTraces/${sn}`, params)
|
||||
}
|
||||
return getRequest(`/afterSale/getSellerDeliveryTraces/${sn}`, params);
|
||||
};
|
||||
//售后单查询物流
|
||||
export const getAfterSaleTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getDeliveryTraces/${sn}`, params)
|
||||
}
|
||||
return getRequest(`/afterSale/getDeliveryTraces/${sn}`, params);
|
||||
};
|
||||
//获取发票列表
|
||||
export const getReceiptPage = (params) => {
|
||||
return getRequest(`/receipt`, params)
|
||||
}
|
||||
export const getReceiptPage = params => {
|
||||
return getRequest(`/receipt`, params);
|
||||
};
|
||||
|
||||
//获取发票列表
|
||||
export const invoicing = (id) => {
|
||||
return postRequest(`receipt/${id}/invoicing`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const invoicing = id => {
|
||||
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',
|
||||
seller: 'https://store-api.pickmall.cn',
|
||||
manager: 'https://admin-api.pickmall.cn',
|
||||
common: 'http://192.168.0.109:8890',
|
||||
buyer: 'http://192.168.0.109:8888',
|
||||
seller: 'http://192.168.0.109:8889',
|
||||
manager: 'http://192.168.0.109:8887'
|
||||
// common: 'http://192.168.0.109:8890',
|
||||
// buyer: 'http://192.168.0.109:8888',
|
||||
// seller: 'http://192.168.0.109:8889',
|
||||
// manager: 'http://192.168.0.109:8887'
|
||||
},
|
||||
api_prod: {
|
||||
common: 'https://common-api.pickmall.cn',
|
||||
|
|
|
@ -4,28 +4,34 @@ import { getStore, setStore } from "./storage";
|
|||
import { router } from "../router/index";
|
||||
import { Message } from "view-design";
|
||||
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 commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common);
|
||||
export const baseUrl =
|
||||
(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;
|
||||
const refreshToken = getTokenDebounce()
|
||||
const refreshToken = getTokenDebounce();
|
||||
const service = axios.create({
|
||||
timeout: 10000,
|
||||
baseURL: baseUrl
|
||||
})
|
||||
});
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
if (config.method == 'get') {
|
||||
if (config.method == "get") {
|
||||
config.params = {
|
||||
_t: Date.parse(new Date()) / 1000,
|
||||
...config.params
|
||||
}
|
||||
};
|
||||
}
|
||||
const uuid = getStore('uuid');
|
||||
config.headers['uuid'] = uuid;
|
||||
const uuid = getStore("uuid");
|
||||
config.headers["uuid"] = uuid;
|
||||
return config;
|
||||
},
|
||||
err => {
|
||||
|
@ -85,30 +91,32 @@ service.interceptors.response.use(
|
|||
},
|
||||
async error => {
|
||||
// 返回状态码不为200时候的错误处理
|
||||
|
||||
if (error.response) {
|
||||
if (error.response.status === 401) {
|
||||
// 这种情况一般调到登录页
|
||||
} else if (error.response.status === 403) {
|
||||
isRefreshToken++;
|
||||
if(isRefreshToken === 1) {
|
||||
if (isRefreshToken === 1) {
|
||||
const getTokenRes = await refreshToken();
|
||||
if (getTokenRes === 'success') { // 刷新token
|
||||
if (getTokenRes === "success") {
|
||||
// 刷新token
|
||||
if (isRefreshToken === 1) {
|
||||
error.response.config.headers.accessToken = getStore('accessToken')
|
||||
return service(error.response.config)
|
||||
error.response.config.headers.accessToken = getStore(
|
||||
"accessToken"
|
||||
);
|
||||
return service(error.response.config);
|
||||
} else {
|
||||
router.go(0)
|
||||
router.go(0);
|
||||
}
|
||||
} else {
|
||||
Cookies.set("userInfo", "");
|
||||
router.push('/login')
|
||||
router.push("/login");
|
||||
}
|
||||
isRefreshToken = 0
|
||||
isRefreshToken = 0;
|
||||
}
|
||||
} else {
|
||||
// 其他错误处理
|
||||
Message.error(error.response.data.message)
|
||||
Message.error(error.response.data.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,59 +127,65 @@ service.interceptors.response.use(
|
|||
|
||||
// 防抖闭包来一波
|
||||
function getTokenDebounce() {
|
||||
let lock = false
|
||||
let success = false
|
||||
return function () {
|
||||
let lock = false;
|
||||
let success = false;
|
||||
return function() {
|
||||
if (!lock) {
|
||||
lock = true
|
||||
lock = true;
|
||||
let oldRefreshToken = getStore("refreshToken");
|
||||
handleRefreshToken(oldRefreshToken).then(res => {
|
||||
if (res.success) {
|
||||
let {
|
||||
accessToken,
|
||||
refreshToken
|
||||
} = res.result;
|
||||
setStore("accessToken", accessToken);
|
||||
setStore("refreshToken", refreshToken);
|
||||
handleRefreshToken(oldRefreshToken)
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
let { accessToken, refreshToken } = res.result;
|
||||
setStore("accessToken", accessToken);
|
||||
setStore("refreshToken", refreshToken);
|
||||
|
||||
success = true
|
||||
lock = false
|
||||
} else {
|
||||
success = false
|
||||
lock = false
|
||||
// router.push('/login')
|
||||
}
|
||||
}).catch((err) => {
|
||||
success = false
|
||||
lock = false
|
||||
})
|
||||
success = true;
|
||||
lock = false;
|
||||
} else {
|
||||
success = false;
|
||||
lock = false;
|
||||
// router.push('/login')
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
success = false;
|
||||
lock = false;
|
||||
});
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
// 一直看lock,直到请求失败或者成功
|
||||
const timer = setInterval(() => {
|
||||
if (!lock) {
|
||||
clearInterval(timer)
|
||||
clearInterval(timer);
|
||||
if (success) {
|
||||
resolve('success')
|
||||
resolve("success");
|
||||
} else {
|
||||
resolve('fail')
|
||||
resolve("fail");
|
||||
}
|
||||
}
|
||||
}, 500) // 轮询时间间隔
|
||||
})
|
||||
}
|
||||
}, 500); // 轮询时间间隔
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export const getRequest = (url, params) => {
|
||||
export const getRequest = (url, params, resBlob) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
let data = {
|
||||
method: "get",
|
||||
url: `${url}`,
|
||||
params: params,
|
||||
headers: {
|
||||
accessToken: accessToken
|
||||
}
|
||||
});
|
||||
},
|
||||
responseType: "blob"
|
||||
};
|
||||
if (resBlob != "blob") {
|
||||
delete data.responseType;
|
||||
}
|
||||
|
||||
|
||||
return service(data);
|
||||
};
|
||||
|
||||
export const postRequest = (url, params, headers) => {
|
||||
|
@ -232,29 +246,28 @@ export const postRequestWithHeaders = (url, params) => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
export const putRequest = (url, params,headers) => {
|
||||
export const putRequest = (url, params, headers) => {
|
||||
let accessToken = getStore("accessToken");
|
||||
return service({
|
||||
method: "put",
|
||||
url: `${url}`,
|
||||
data: params,
|
||||
transformRequest: headers
|
||||
? undefined
|
||||
: [
|
||||
function(data) {
|
||||
let ret = "";
|
||||
for (let it in data) {
|
||||
ret +=
|
||||
encodeURIComponent(it) +
|
||||
"=" +
|
||||
encodeURIComponent(data[it]) +
|
||||
"&";
|
||||
? undefined
|
||||
: [
|
||||
function(data) {
|
||||
let ret = "";
|
||||
for (let it in data) {
|
||||
ret +=
|
||||
encodeURIComponent(it) +
|
||||
"=" +
|
||||
encodeURIComponent(data[it]) +
|
||||
"&";
|
||||
}
|
||||
ret = ret.substring(0, ret.length - 1);
|
||||
return ret;
|
||||
}
|
||||
ret = ret.substring(0, ret.length - 1);
|
||||
return ret;
|
||||
}
|
||||
],
|
||||
],
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
accessToken: accessToken,
|
||||
|
@ -337,4 +350,3 @@ export const postRequestWithNoToken = (url, params) => {
|
|||
params: params
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -143,6 +143,20 @@ export const result = [
|
|||
url: "",
|
||||
children: null,
|
||||
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",
|
||||
showAlways: true,
|
||||
|
@ -422,34 +479,7 @@ export const result = [
|
|||
permTypes: [],
|
||||
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",
|
||||
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",
|
||||
title: "订单详情",
|
||||
name: "order-detail",
|
||||
component: () => import("@/views/order/order/orderDetail.vue")
|
||||
},
|
||||
|
||||
// {
|
||||
// path: "/*",
|
||||
// name: "error-404",
|
||||
|
|
|
@ -6,17 +6,32 @@
|
|||
* @returns {*}
|
||||
*/
|
||||
export function unitPrice(val, unit, location) {
|
||||
let price = formatPrice(val)
|
||||
if (location === 'before') {
|
||||
return price.substr(0, price.length - 3)
|
||||
let price = formatPrice(val);
|
||||
if (location === "before") {
|
||||
return price.substr(0, price.length - 3);
|
||||
}
|
||||
if (location === 'after') {
|
||||
return price.substr(-2)
|
||||
if (location === "after") {
|
||||
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}
|
||||
*/
|
||||
export function formatPrice(price) {
|
||||
if (typeof price !== 'number') return price
|
||||
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
if (typeof price !== "number") return price;
|
||||
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,51 +50,60 @@ export function formatPrice(price) {
|
|||
* @returns {*|string}
|
||||
*/
|
||||
export function unixToDate(unix, format) {
|
||||
let _format = format || 'yyyy-MM-dd hh:mm:ss'
|
||||
const d = new Date(unix * 1000)
|
||||
let _format = format || "yyyy-MM-dd hh:mm:ss";
|
||||
const d = new Date(unix * 1000);
|
||||
const o = {
|
||||
'M+': d.getMonth() + 1,
|
||||
'd+': d.getDate(),
|
||||
'h+': d.getHours(),
|
||||
'm+': d.getMinutes(),
|
||||
's+': d.getSeconds(),
|
||||
'q+': Math.floor((d.getMonth() + 3) / 3),
|
||||
"M+": d.getMonth() + 1,
|
||||
"d+": d.getDate(),
|
||||
"h+": d.getHours(),
|
||||
"m+": d.getMinutes(),
|
||||
"s+": d.getSeconds(),
|
||||
"q+": Math.floor((d.getMonth() + 3) / 3),
|
||||
S: d.getMilliseconds()
|
||||
}
|
||||
if (/(y+)/.test(_format)) _format = _format.replace(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
|
||||
};
|
||||
if (/(y+)/.test(_format))
|
||||
_format = _format.replace(
|
||||
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) {
|
||||
switch (status) {
|
||||
case 'YES':
|
||||
return "是"
|
||||
case 'NO':
|
||||
return "否"
|
||||
case "YES":
|
||||
return "是";
|
||||
case "NO":
|
||||
return "否";
|
||||
}
|
||||
}
|
||||
|
||||
export function unixSellerBillStatus(status_code) {
|
||||
switch (status_code) {
|
||||
case 'OUT':
|
||||
return '已出账'
|
||||
case 'CHECK':
|
||||
return '已对账'
|
||||
case 'EXAMINE':
|
||||
return '已审核'
|
||||
case 'PAY':
|
||||
return '已结算'
|
||||
case 'COMPLETE':
|
||||
return '已完成'
|
||||
case "OUT":
|
||||
return "已出账";
|
||||
case "CHECK":
|
||||
return "已对账";
|
||||
case "EXAMINE":
|
||||
return "已审核";
|
||||
case "PAY":
|
||||
return "已结算";
|
||||
case "COMPLETE":
|
||||
return "已完成";
|
||||
}
|
||||
}
|
||||
export function unixSwitchStatus(status_code) {
|
||||
switch (status_code) {
|
||||
case 'OPEN':
|
||||
return '开启'
|
||||
case 'CLOSE':
|
||||
return '关闭'
|
||||
case "OPEN":
|
||||
return "开启";
|
||||
case "CLOSE":
|
||||
return "关闭";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,30 +113,35 @@ export function unixSwitchStatus(status_code) {
|
|||
* @returns {*}
|
||||
*/
|
||||
export function secrecyMobile(mobile) {
|
||||
mobile = String(mobile)
|
||||
mobile = String(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) {
|
||||
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 = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
"M+": date.getMonth() + 1,
|
||||
"d+": date.getDate(),
|
||||
"h+": date.getHours(),
|
||||
"m+": date.getMinutes(),
|
||||
"s+": date.getSeconds()
|
||||
};
|
||||
for (let k in o) {
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
let str = o[k] + '';
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
||||
}
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
let str = o[k] + "";
|
||||
fmt = fmt.replace(
|
||||
RegExp.$1,
|
||||
RegExp.$1.length === 1 ? str : padLeftZero(str)
|
||||
);
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,22 +3,25 @@
|
|||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
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;
|
||||
|
||||
/*商品品类*/
|
||||
.goods-category {
|
||||
min-height: 500px;
|
||||
border-radius: 0.8em;
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
background: #fafafa;
|
||||
border: 1px solid #e6e6e6;
|
||||
background: #ededed;
|
||||
|
||||
ul {
|
||||
padding: 8px 4px 8px 8px;
|
||||
padding: 12px 8px;
|
||||
list-style: none;
|
||||
width: 300px;
|
||||
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;
|
||||
letter-spacing: normal;
|
||||
margin-right: 15px;
|
||||
|
@ -27,7 +30,7 @@
|
|||
|
||||
li {
|
||||
line-height: 20px;
|
||||
padding: 5px;
|
||||
padding: 10px 5px;
|
||||
cursor: pointer;
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
|
@ -42,9 +45,10 @@
|
|||
|
||||
/** 当前品类被选中的样式 */
|
||||
.activeClass {
|
||||
background-color: #d9edf7;
|
||||
border: 1px solid #bce8f1;
|
||||
color: #3a87ad;
|
||||
border-radius: 0.4em;
|
||||
background-color: rgba($color: $theme_color, $alpha: 0.2);
|
||||
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 {
|
||||
line-height: 40;
|
||||
|
@ -223,12 +240,16 @@ div.base-info-item {
|
|||
/** 底部步骤 */
|
||||
.footer {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
padding: 10px;
|
||||
background-color: #ffc;
|
||||
position: sticky;
|
||||
bottom: 0px;
|
||||
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;
|
||||
}
|
||||
|
||||
/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 {
|
||||
width: 33%;
|
||||
height: 40px;
|
||||
flex: 1;
|
||||
height: 60px;
|
||||
font-size: 19px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
|
@ -271,6 +303,14 @@ div.base-info-item {
|
|||
justify-content: 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 {
|
||||
margin-top: 10px;
|
||||
|
@ -374,14 +414,67 @@ div.base-info-item {
|
|||
|
||||
right: 0;
|
||||
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 {
|
||||
display: block;
|
||||
display:flex;
|
||||
}
|
||||
.demo-upload-list-cover i {
|
||||
width: 50%;
|
||||
margin-top: 8px;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
.demo-upload-list-cover div {
|
||||
margin: 10% 0;
|
||||
width: 100%;
|
||||
|
||||
> i {
|
||||
width: 50%;
|
||||
margin-top: 8px;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<Row @keydown.enter.native="handleSearch">
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
|
||||
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px"/>
|
||||
</Form-item>
|
||||
<Form-item label="状态" prop="status">
|
||||
<Select v-model="searchForm.marketEnable" placeholder="请选择" clearable style="width: 200px">
|
||||
|
@ -12,8 +12,14 @@
|
|||
<Option value="UPPER">上架</Option>
|
||||
</Select>
|
||||
</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">
|
||||
<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>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
<Button @click="handleReset" class="search-btn">重置</Button>
|
||||
|
@ -45,11 +51,12 @@
|
|||
|
||||
<div style="margin-left: 13px;">
|
||||
<div class="div-zoom">
|
||||
<a @click="linkTo(row.id,row.skuId)">{{row.goodsName}}</a>
|
||||
<a @click="linkTo(row.id,row.skuId)">{{ row.goodsName }}</a>
|
||||
</div>
|
||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||
<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>
|
||||
<img src="../../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||
</Poptip>
|
||||
|
@ -60,13 +67,14 @@
|
|||
</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>
|
||||
<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>
|
||||
|
||||
<Modal title="更新库存" v-model="updateStockModalVisible" :mask-closable="false" :width="500">
|
||||
<Input type="number" v-model="stockAllUpdate" placeholder="全部修改,如不需全部修改,则不需输入" />
|
||||
<Input type="number" v-model="stockAllUpdate" placeholder="全部修改,如不需全部修改,则不需输入"/>
|
||||
<Table :columns="updateStockColumns" :data="stockList" border :span-method="handleSpan"></Table>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="updateStockModalVisible = false">取消</Button>
|
||||
|
@ -78,7 +86,8 @@
|
|||
<Modal title="批量设置运费模板" v-model="shipTemplateModal" :mask-closable="false" :width="500">
|
||||
<Form ref="shipTemplateForm" :model="shipTemplateForm" :label-width="120">
|
||||
<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">
|
||||
<span>卖家承担运费</span>
|
||||
</Radio>
|
||||
|
@ -224,7 +233,7 @@ export default {
|
|||
{
|
||||
title: "商品编号",
|
||||
key: "sn",
|
||||
width: 200,
|
||||
width: 100,
|
||||
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: "商品价格",
|
||||
key: "price",
|
||||
|
@ -336,6 +359,7 @@ export default {
|
|||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
let enableOrDisable = "";
|
||||
|
@ -431,10 +455,10 @@ export default {
|
|||
this.getDataList();
|
||||
},
|
||||
addGoods() {
|
||||
this.$router.push({ name: "goods-operation" });
|
||||
this.$router.push({name: "goods-operation"});
|
||||
},
|
||||
editGoods(v) {
|
||||
this.$router.push({ name: "goods-operation-edit", query: { id: v.id } });
|
||||
this.$router.push({name: "goods-operation-edit", query: {id: v.id}});
|
||||
},
|
||||
|
||||
//批量操作
|
||||
|
@ -457,7 +481,7 @@ export default {
|
|||
}
|
||||
},
|
||||
getStockDetail(id) {
|
||||
getGoodsSkuListDataSeller({ goodsId: id, pageSize: 1000 }).then((res) => {
|
||||
getGoodsSkuListDataSeller({goodsId: id, pageSize: 1000}).then((res) => {
|
||||
if (res.success) {
|
||||
this.updateStockModalVisible = true;
|
||||
this.stockAllUpdate = undefined;
|
||||
|
@ -467,7 +491,7 @@ export default {
|
|||
},
|
||||
updateStock() {
|
||||
let updateStockList = this.stockList.map((i) => {
|
||||
let j = { skuId: i.id, quantity: i.quantity };
|
||||
let j = {skuId: i.id, quantity: i.quantity};
|
||||
if (this.stockAllUpdate) {
|
||||
j.quantity = this.stockAllUpdate;
|
||||
}
|
||||
|
@ -480,28 +504,28 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
changePage (v) {
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize (v) {
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch () {
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset () {
|
||||
handleReset() {
|
||||
this.searchForm = {};
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort (e) {
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
|
@ -509,15 +533,15 @@ export default {
|
|||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll () {
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect (e) {
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
//保存运费模板信息
|
||||
saveShipTemplate () {
|
||||
saveShipTemplate() {
|
||||
if (this.shipTemplateForm.freightPayer == "STORE") {
|
||||
{
|
||||
this.shipTemplateForm.templateId = 0;
|
||||
|
@ -715,10 +739,10 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.init();
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
activated () {
|
||||
activated() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,67 +1,29 @@
|
|||
<template>
|
||||
<div class="login">
|
||||
<Row
|
||||
type="flex"
|
||||
class="row"
|
||||
justify="center"
|
||||
align="middle"
|
||||
@keydown.enter.native="submitLogin"
|
||||
>
|
||||
<Row type="flex" @keydown.enter.native="submitLogin">
|
||||
<Col style="width: 368px">
|
||||
<Header />
|
||||
<Header />
|
||||
<Row style="flex-direction: column;">
|
||||
<Form ref="usernameLoginForm" :model="form" :rules="rules" class="form">
|
||||
<FormItem prop="username">
|
||||
<Input v-model="form.username" prefix="ios-contact" size="large" clearable placeholder="请输入用户名" autocomplete="off" />
|
||||
</FormItem>
|
||||
<FormItem prop="password">
|
||||
<Input type="password" v-model="form.password" prefix="ios-lock" size="large" password placeholder="请输入密码" autocomplete="off" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
<Row>
|
||||
<Form
|
||||
ref="usernameLoginForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
class="form"
|
||||
>
|
||||
<FormItem prop="username">
|
||||
<Input
|
||||
v-model="form.username"
|
||||
prefix="ios-contact"
|
||||
size="large"
|
||||
clearable
|
||||
placeholder="请输入用户名"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem prop="password">
|
||||
<Input
|
||||
type="password"
|
||||
v-model="form.password"
|
||||
prefix="ios-lock"
|
||||
size="large"
|
||||
password
|
||||
placeholder="请输入密码"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
<Row>
|
||||
<Button
|
||||
class="login-btn"
|
||||
type="primary"
|
||||
size="large"
|
||||
:loading="loading"
|
||||
@click="submitLogin"
|
||||
long
|
||||
>
|
||||
<span v-if="!loading">{{ $t("login") }}</span>
|
||||
<span v-else>{{ $t("logining") }}</span>
|
||||
</Button>
|
||||
</Row>
|
||||
|
||||
<Button class="login-btn" type="primary" size="large" :loading="loading" @click="submitLogin" long>
|
||||
<span v-if="!loading">{{ $t("login") }}</span>
|
||||
<span v-else>{{ $t("logining") }}</span>
|
||||
</Button>
|
||||
</Row>
|
||||
<Footer />
|
||||
<!-- 拼图验证码 -->
|
||||
<verify
|
||||
ref="verify"
|
||||
class="verify-con"
|
||||
verifyType="LOGIN"
|
||||
@change="verifyChange"
|
||||
></verify>
|
||||
|
||||
</Row>
|
||||
<Footer />
|
||||
<!-- 拼图验证码 -->
|
||||
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||
</Col>
|
||||
<!-- <LangSwitch /> -->
|
||||
</Row>
|
||||
|
@ -69,35 +31,34 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
login,
|
||||
userMsg,
|
||||
} from "@/api/index";
|
||||
import { login, userMsg } from "@/api/index";
|
||||
import { validateMobile } from "@/libs/validate";
|
||||
import Cookies from "js-cookie";
|
||||
import Header from "@/views/main-components/header";
|
||||
import Footer from "@/views/main-components/footer";
|
||||
import LangSwitch from "@/views/main-components/lang-switch";
|
||||
import util from "@/libs/util.js";
|
||||
import verify from '@/views/my-components/verify';
|
||||
import verify from "@/views/my-components/verify";
|
||||
export default {
|
||||
components: {
|
||||
LangSwitch,
|
||||
Header,
|
||||
Footer,
|
||||
verify
|
||||
verify,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
saveLogin: true, // 保存登录状态
|
||||
loading: false, // 加载状态
|
||||
form: { // 表单数据
|
||||
form: {
|
||||
// 表单数据
|
||||
username: "",
|
||||
password: "",
|
||||
mobile: "",
|
||||
code: "",
|
||||
},
|
||||
rules: { // 验证规则
|
||||
rules: {
|
||||
// 验证规则
|
||||
username: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -163,35 +124,41 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
submitLogin() { // 登录提交
|
||||
submitLogin() {
|
||||
// 登录提交
|
||||
this.$refs.usernameLoginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.verify.show = true;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
verifyChange (con) { // 拼图验证码回显
|
||||
verifyChange(con) {
|
||||
// 拼图验证码回显
|
||||
if (!con.status) return;
|
||||
|
||||
|
||||
this.loading = true;
|
||||
login({
|
||||
username: this.form.username,
|
||||
password: this.md5(this.form.password),
|
||||
}).then((res) => {
|
||||
this.loading = false;
|
||||
if (res && res.success) {
|
||||
this.afterLogin(res);
|
||||
}
|
||||
}).catch(()=>{this.loading = false})
|
||||
}
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
if (res && res.success) {
|
||||
this.afterLogin(res);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
this.$refs.verify.show = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.row {
|
||||
.row {
|
||||
padding: 70px 50px;
|
||||
border-radius: .8em;
|
||||
|
||||
border-radius: 0.8em;
|
||||
}
|
||||
.login {
|
||||
height: 100%;
|
||||
|
@ -212,11 +179,11 @@ export default {
|
|||
position: relative;
|
||||
zoom: 1;
|
||||
}
|
||||
/deep/ .ivu-row{
|
||||
/deep/ .ivu-row {
|
||||
display: flex;
|
||||
flex-direction: column !important;
|
||||
|
||||
}
|
||||
.verify-con{
|
||||
.verify-con {
|
||||
position: absolute;
|
||||
top: 126px;
|
||||
z-index: 10;
|
||||
|
@ -260,5 +227,4 @@ export default {
|
|||
.flex {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<Row class="header">
|
||||
<img src="../../assets/lili.png" class="logo" width="220px">
|
||||
<img class="logo" src="../../assets/logo.png" >
|
||||
</Row>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -14,13 +14,13 @@ export default {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.header {
|
||||
|
||||
margin-bottom: 6vh;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center !important;
|
||||
}
|
||||
.logo {
|
||||
transform: scale(3);
|
||||
width: 440px;
|
||||
height: 158px;
|
||||
}
|
||||
</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-left">订单来源:</div>
|
||||
<div class="div-item-right">
|
||||
{{ orderInfo.order.clientType }}
|
||||
{{ orderInfo.order.clientType | clientTypeWay }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -94,7 +94,7 @@
|
|||
<div class="div-item-right">{{ orderInfo.order.remark }}</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-right">
|
||||
{{
|
||||
|
@ -521,13 +521,14 @@ export default {
|
|||
},
|
||||
//弹出订单核销框
|
||||
orderTake() {
|
||||
this.orderTakeForm.qrCode = this.orderInfo.order.verificationCode
|
||||
this.orderTakeModal = true;
|
||||
},
|
||||
//订单核销提交
|
||||
orderTakeSubmit() {
|
||||
this.$refs.orderTakeForm.validate((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) {
|
||||
this.$Message.success("订单核销成功");
|
||||
this.orderTakeModal = false;
|
||||
|
|
|
@ -4,308 +4,283 @@
|
|||
<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: 200px"
|
||||
/>
|
||||
<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: 200px"
|
||||
/>
|
||||
<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: 200px">
|
||||
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
|
||||
<Option value="UNPAID">未付款</Option>
|
||||
<Option value="PAID">已付款</Option>
|
||||
<Option value="UNDELIVERED">待发货</Option>
|
||||
<Option value="DELIVERED">已发货</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: 200px"
|
||||
></DatePicker>
|
||||
<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>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<div>
|
||||
<Button type="primary" class="export" @click="expressOrderDeliver">
|
||||
批量发货
|
||||
</Button>
|
||||
</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>
|
||||
<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";
|
||||
export default {
|
||||
name: "orderList",
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
startDate: "", // 起始时间
|
||||
endDate: "", // 终止时间
|
||||
orderSn:"",
|
||||
buyerName:"",
|
||||
orderStatus:""
|
||||
import * as API_Order from "@/api/order";
|
||||
import { verificationCode } from "@/api/order";
|
||||
export default {
|
||||
name: "orderList",
|
||||
data() {
|
||||
return {
|
||||
orderCode: "",
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
startDate: "", // 起始时间
|
||||
endDate: "", // 终止时间
|
||||
orderSn: "",
|
||||
buyerName: "",
|
||||
orderStatus: "",
|
||||
orderType: "NORMAL",
|
||||
},
|
||||
selectDate: null,
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
sn: "",
|
||||
sellerName: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
billPrice: "",
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
title: "订单号",
|
||||
key: "sn",
|
||||
minWidth: 240,
|
||||
tooltip: true,
|
||||
},
|
||||
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: "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: "订单来源",
|
||||
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: "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: "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: "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);
|
||||
},
|
||||
{
|
||||
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: {
|
||||
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.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();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
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;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 核验订单
|
||||
*/
|
||||
async orderVerification() {
|
||||
let result = await verificationCode(this.orderCode);
|
||||
|
||||
detail(v) {
|
||||
let sn = v.sn;
|
||||
if (result.success) {
|
||||
this.$router.push({
|
||||
name: "order-detail",
|
||||
query: { sn: sn },
|
||||
query: { sn: result.result.sn || this.orderCode },
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 批量发货
|
||||
*/
|
||||
expressOrderDeliver() {
|
||||
this.$router.push({
|
||||
path: "/export-order-deliver",
|
||||
});
|
||||
},
|
||||
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;
|
||||
},
|
||||
activated () {
|
||||
this.init();
|
||||
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 },
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
activated() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
// 建议引入通用样式 可删除下面样式代码
|
||||
@import "@/styles/table-common.scss";
|
||||
// 建议引入通用样式 可删除下面样式代码
|
||||
@import "@/styles/table-common.scss";
|
||||
.export {
|
||||
margin: 10px 20px 10px 0;
|
||||
}
|
||||
</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">
|
||||
<Card>
|
||||
<Row>
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="100"
|
||||
class="search-form"
|
||||
>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="100" class="search-form">
|
||||
<Form-item label="优惠券名称">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.couponName"
|
||||
placeholder="请输入优惠券名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.couponName" placeholder="请输入优惠券名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="活动状态" prop="promotionStatus">
|
||||
<Select
|
||||
v-model="searchForm.promotionStatus"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
<Option value="NEW">未开始</Option>
|
||||
<Option value="START">已开始/上架</Option>
|
||||
<Option value="END">已结束/下架</Option>
|
||||
|
@ -32,21 +15,9 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker
|
||||
v-model="selectDate"
|
||||
type="daterange"
|
||||
clearable
|
||||
placeholder="选择起始时间"
|
||||
style="width: 200px"
|
||||
></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||
</Form-item>
|
||||
<Button
|
||||
@click="handleSearch"
|
||||
type="primary"
|
||||
class="search-btn"
|
||||
icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
<Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
|
||||
<Button @click="handleReset" class="search-btn">重置</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
|
@ -55,57 +26,22 @@
|
|||
<Button @click="delAll" class="ml_10">批量下架</Button>
|
||||
<!-- <Button @click="upAll">批量上架</Button> -->
|
||||
</Row>
|
||||
<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">
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button
|
||||
v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'"
|
||||
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
|
||||
>
|
||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" 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>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="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]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></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]"
|
||||
size="small" show-total show-elevator show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getShopCouponList,
|
||||
updateCouponStatus,
|
||||
} from "@/api/promotion";
|
||||
import { getShopCouponList, updateCouponStatus } from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "coupon",
|
||||
|
@ -143,18 +79,19 @@ export default {
|
|||
{
|
||||
title: "活动名称",
|
||||
key: "promotionName",
|
||||
minWidth: 120,
|
||||
minWidth: 100,
|
||||
fixed: "left",
|
||||
},
|
||||
{
|
||||
title: "优惠券名称",
|
||||
key: "couponName",
|
||||
minWidth: 120,
|
||||
tooltip: true
|
||||
}, {
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "面额/折扣",
|
||||
key: "price",
|
||||
width: 120,
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.price) {
|
||||
return h(
|
||||
|
@ -170,11 +107,13 @@ export default {
|
|||
{
|
||||
title: "领取数量/总数量",
|
||||
key: "publishNum",
|
||||
width: 100,
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div", params.row.receivedNum + "/" + params.row.publishNum)
|
||||
}
|
||||
"div",
|
||||
params.row.receivedNum + "/" + params.row.publishNum
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "优惠券类型",
|
||||
|
@ -210,22 +149,28 @@ export default {
|
|||
},
|
||||
{
|
||||
title: "活动时间",
|
||||
minWidth: 120,
|
||||
|
||||
render: (h, params) => {
|
||||
return h("div", {
|
||||
domProps:
|
||||
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime}
|
||||
});
|
||||
if (params.row.getType === "ACTIVITY") {
|
||||
return h("div", "长期有效");
|
||||
} else {
|
||||
return h("div", {
|
||||
domProps: {
|
||||
innerHTML:
|
||||
params.row.startTime + "<br/>" + params.row.endTime,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "promotionStatus",
|
||||
width: 100,
|
||||
key: "promotionStatus",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let text = "未知",
|
||||
color = "";
|
||||
color = "red";
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
text = "未开始";
|
||||
color = "default";
|
||||
|
@ -248,16 +193,17 @@ export default {
|
|||
},
|
||||
},
|
||||
text
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
},
|
||||
minWidth: 70,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
slot: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
minWidth: 80,
|
||||
maxWidth: 140,
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
|
@ -292,8 +238,8 @@ export default {
|
|||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.searchForm = {}
|
||||
this.selectDate = ''
|
||||
this.searchForm = {};
|
||||
this.selectDate = "";
|
||||
this.searchForm.pageNumber = 0;
|
||||
this.getDataList();
|
||||
},
|
||||
|
@ -423,7 +369,7 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
activated () {
|
||||
activated() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -153,7 +153,6 @@ import {
|
|||
addLiveGoods,
|
||||
editLive,
|
||||
getLiveInfo,
|
||||
delLiveGoods,
|
||||
delRoomLiveGoods,
|
||||
} from "@/api/promotion";
|
||||
import liveGoods from "./liveGoods";
|
||||
|
@ -173,6 +172,7 @@ export default {
|
|||
// 不能选择今天以前的时间
|
||||
optionsTime: {
|
||||
disabledDate(date) {
|
||||
// console.log(data)
|
||||
return date && date.valueOf() < Date.now() - 86400000;
|
||||
},
|
||||
},
|
||||
|
@ -192,7 +192,7 @@ export default {
|
|||
startTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入开始时间以及结束时间",
|
||||
message: "请正确输入开始时间以及结束时间",
|
||||
},
|
||||
],
|
||||
feedsImg: [
|
||||
|
@ -328,19 +328,34 @@ export default {
|
|||
this.$set(this, "liveData", way);
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交直播间商品
|
||||
*/
|
||||
addGoods() {
|
||||
addLiveGoods({
|
||||
roomId: this.$route.query.roomId,
|
||||
liveGoodsId: item.liveGoodsId,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* dialog点击确定时判断
|
||||
*/
|
||||
addGoods() {
|
||||
this.liveData.forEach((item) => {
|
||||
this.commodityList.forEach((oldVal) => {
|
||||
if (oldVal.liveGoodsId != item.liveGoodsId) {
|
||||
addLiveGoods({
|
||||
roomId: this.$route.query.roomId,
|
||||
liveGoodsId: item.liveGoodsId,
|
||||
});
|
||||
}
|
||||
});
|
||||
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,21 +405,66 @@ export default {
|
|||
this.liveForm.coverImg = res.result;
|
||||
},
|
||||
|
||||
tipsDateError() {
|
||||
this.$Message.error({
|
||||
content:
|
||||
"直播开播时间需要在当前时间的10分钟后并且,开始时间不能在6个月后,直播计划结束时间(开播时间和结束时间间隔不得短于30分钟,不得超过24小时)",
|
||||
duration: 5,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 选择时间后的回调
|
||||
*/
|
||||
handleChangeTime(daterange) {
|
||||
this.times = daterange;
|
||||
this.$set(
|
||||
this.liveForm,
|
||||
"startTime",
|
||||
new Date(daterange[0]).getTime() / 1000
|
||||
);
|
||||
this.$set(
|
||||
this.liveForm,
|
||||
"endTime",
|
||||
new Date(daterange[1]).getTime() / 1000
|
||||
);
|
||||
/**
|
||||
* 直播开播时间需要在当前时间的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.liveForm,
|
||||
"startTime",
|
||||
new Date(daterange[0]).getTime() / 1000
|
||||
);
|
||||
this.$set(
|
||||
this.liveForm,
|
||||
"endTime",
|
||||
new Date(daterange[1]).getTime() / 1000
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -449,7 +509,9 @@ export default {
|
|||
// 需判断当前是否是添加商品
|
||||
if (this.$route.query.id && this.liveData.length != 0) {
|
||||
this.spinShow = true;
|
||||
this.liveForm.commodityList = JSON.stringify(this.liveForm.commodityList);
|
||||
this.liveForm.commodityList = JSON.stringify(
|
||||
this.liveForm.commodityList
|
||||
);
|
||||
// 将当前直播间修改
|
||||
editLive(this.liveForm).then((res) => {
|
||||
if (res.success) {
|
||||
|
|
|
@ -276,10 +276,10 @@ export default {
|
|||
async saveLiveGoods() {
|
||||
this.saveGoodsLoading = true;
|
||||
let submit = this.liveGoodsData.map((element) => {
|
||||
console.log(element.priceType);
|
||||
console.log(element);
|
||||
return {
|
||||
goodsId: element.goodsId, //商品id
|
||||
goodsImage: element.small, //商品图片
|
||||
goodsImage: element.small, //商品图片 必须为 300 * 300
|
||||
name: element.goodsName, //商品昵称
|
||||
price: parseInt(element.price), //商品价格
|
||||
quantity: element.quantity, //库存
|
||||
|
|
|
@ -225,7 +225,7 @@
|
|||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
this.searchForm.billStatus = "CHECK"
|
||||
this.searchForm.billStatus = "OUT"
|
||||
API_Shop.getBillPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
|
|