This commit is contained in:
lemon橪
2021-06-03 11:47:34 +08:00
parent 020ddf0588
commit d55d53528e
37 changed files with 4760 additions and 419 deletions

View File

@@ -1,174 +1,197 @@
// 统一请求路径前缀在libs/axios.js中修改
import { getRequest, postRequest, putRequest, deleteRequest } from '@/libs/axios';
import {
getRequest,
postRequest,
putRequest,
deleteRequest
} from "@/libs/axios";
// 获取限时抢购申请列表
export const getPromotionSeckill = (params) => {
export const getPromotionSeckill = params => {
return getRequest(`/promotion/seckill/apply`, params);
};
return getRequest(`/promotion/seckill/apply`, params)
}
// 是否推荐直播间
export const whetherStar = params => {
return getRequest(`/broadcast/studio/id/${params.id}&recommend=${params.recommend}`);
};
// 获取店铺直播间列表
export const getLiveList = params => {
return getRequest("/broadcast/studio", params);
};
// 获取直播间详情
export const getLiveInfo = studioId => {
return getRequest(`/broadcast/studio/studioInfo/${studioId}`);
};
// 获取当前进行中的促销活动商品
export const getPromotionGoods = (promotionId,params) => {
return getRequest(`/promotion/${promotionId}/goods`, params)
}
export const getPromotionGoods = (promotionId, params) => {
return getRequest(`/promotion/${promotionId}/goods`, params);
};
// 获取当前进行中的促销活动
export const getAllPromotion = (params) => {
return getRequest('/promotion/current', params)
}
export const getAllPromotion = params => {
return getRequest("/promotion/current", params);
};
// 获取拼团数据
export const getPintuanList = (params) => {
return getRequest('/promotion/pintuan', params)
}
export const getPintuanList = params => {
return getRequest("/promotion/pintuan", params);
};
// 获取拼团详情
export const getPintuanDetail = (id) => {
return getRequest(`/promotion/pintuan/${id}`)
}
export const getPintuanDetail = id => {
return getRequest(`/promotion/pintuan/${id}`);
};
// 获取拼团商品数据
export const getPintuanGoodsList = (params) => {
return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`,params)
}
export const getPintuanGoodsList = params => {
return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`, params);
};
// 关闭拼团活动
export const closePintuan = (pintuanId) => {
return putRequest(`/promotion/pintuan/close/${pintuanId}`)
}
export const closePintuan = pintuanId => {
return putRequest(`/promotion/pintuan/close/${pintuanId}`);
};
// 保存平台优惠券
export const savePlatformCoupon = (params) => {
return postRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
}
export const savePlatformCoupon = params => {
return postRequest("/promotion/coupon", params, {
"Content-type": "application/json"
});
};
// 修改平台优惠券
export const editPlatformCoupon = (params) => {
return putRequest('/promotion/coupon', params,{'Content-type': 'application/json'})
}
export const editPlatformCoupon = params => {
return putRequest("/promotion/coupon", params, {
"Content-type": "application/json"
});
};
// 获取平台优惠券
export const getPlatformCouponList = (params) => {
return getRequest('/promotion/coupon', params)
}
export const getPlatformCouponList = params => {
return getRequest("/promotion/coupon", params);
};
// 作废优惠券
export const deletePlatformCoupon = (ids) => {
return deleteRequest(`/promotion/coupon/${ids}`)
}
export const deletePlatformCoupon = ids => {
return deleteRequest(`/promotion/coupon/${ids}`);
};
// 更新优惠券状态
export const updatePlatformCouponStatus = ( params) => {
return putRequest(`/promotion/coupon/status`, params)
}
export const updatePlatformCouponStatus = params => {
return putRequest(`/promotion/coupon/status`, params);
};
// 获取单个优惠券
export const getPlatformCoupon = (id) => {
return getRequest(`/promotion/coupon/${id}`)
}
export const getPlatformCoupon = id => {
return getRequest(`/promotion/coupon/${id}`);
};
// 获取优惠券领取详情
export const getMemberReceiveCouponList = (id) => {
return getRequest(`/promotion/coupon/member/${id}`)
}
export const getMemberReceiveCouponList = id => {
return getRequest(`/promotion/coupon/member/${id}`);
};
// 作废会员优惠券
export const deleteMemberReceiveCoupon = (id) => {
return putRequest(`/promotion/coupon/member/cancellation/${id}`)
}
export const deleteMemberReceiveCoupon = id => {
return putRequest(`/promotion/coupon/member/cancellation/${id}`);
};
// 获取限时抢购数据
export const getSeckillList = (params) => {
return getRequest('/promotion/seckill', params)
}
export const getSeckillList = params => {
return getRequest("/promotion/seckill", params);
};
// 获取限时抢购审核列表
export const seckillGoodsList = (params) => {
return getRequest('/promotion/seckill/apply', params)
}
export const seckillGoodsList = params => {
return getRequest("/promotion/seckill/apply", params);
};
// 获取限时抢购详情数据
export const seckillDetail = (id, params) => {
return getRequest(`/promotion/seckill/${id}`, params)
}
return getRequest(`/promotion/seckill/${id}`, params);
};
// 删除限时抢购
export const delSeckill = (id) => {
return deleteRequest(`/promotion/seckill/${id}`)
}
export const delSeckill = id => {
return deleteRequest(`/promotion/seckill/${id}`);
};
// 保存限时抢购
export const saveSeckill = (params) => {
return postRequest('/promotion/seckill', params)
}
export const saveSeckill = params => {
return postRequest("/promotion/seckill", params);
};
// 修改限时抢购
export const updateSeckill = (params) => {
return putRequest('/promotion/seckill', params)
}
export const updateSeckill = params => {
return putRequest("/promotion/seckill", params);
};
// 关闭限时抢购
export const closeSeckill = (id) => {
return putRequest(`/promotion/seckill/close/${id}`)
}
export const closeSeckill = id => {
return putRequest(`/promotion/seckill/close/${id}`);
};
// 审核限时抢购
export const auditApplySeckill = (params) => {
return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params)
}
export const auditApplySeckill = params => {
return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params);
};
// 满优惠列表
export const getFullDiscountList = (params) => {
return getRequest(`/promotion/fullDiscount`,params)
}
export const getFullDiscountList = params => {
return getRequest(`/promotion/fullDiscount`, params);
};
// 满优惠列表
export const getFullDiscountById = (id) => {
return getRequest(`/promotion/fullDiscount/${id}`)
}
export const getFullDiscountById = id => {
return getRequest(`/promotion/fullDiscount/${id}`);
};
// 积分商品列表
export const getPointsGoodsList = (params) => {
return getRequest(`/promotion/pointsGoods`,params)
}
export const getPointsGoodsList = params => {
return getRequest(`/promotion/pointsGoods`, params);
};
// 积分商品详情
export const getPointsGoodsById = (id) => {
return getRequest(`/promotion/pointsGoods/${id}`)
}
export const getPointsGoodsById = id => {
return getRequest(`/promotion/pointsGoods/${id}`);
};
// 添加积分商品
export const addPointsGoods = (params) => {
return postRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'})
}
export const addPointsGoods = params => {
return postRequest(`/promotion/pointsGoods`, params, {
"Content-type": "application/json"
});
};
// 修改积分商品
export const updatePointsGoods = (params) => {
return putRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'})
}
export const updatePointsGoods = params => {
return putRequest(`/promotion/pointsGoods`, params, {
"Content-type": "application/json"
});
};
// 修改积分商品状态
export const editPointsGoodsStatus = (id, params) => {
return putRequest(`/promotion/pointsGoods/${id}`,params)
}
return putRequest(`/promotion/pointsGoods/${id}`, params);
};
// 删除积分商品
export const deletePointsGoodsStatus = (id) => {
return deleteRequest(`/promotion/pointsGoods/${id}`)
}
export const deletePointsGoodsStatus = id => {
return deleteRequest(`/promotion/pointsGoods/${id}`);
};
// 积分商品分类列表
export const getPointsGoodsCategoryList = (params) => {
return getRequest(`/promotion/pointsGoodsCategory`,params)
}
export const getPointsGoodsCategoryList = params => {
return getRequest(`/promotion/pointsGoodsCategory`, params);
};
// 积分商品分类详情
export const getPointsGoodsCategoryById = (id) => {
return getRequest(`/promotion/pointsGoodsCategory/${id}`)
}
export const getPointsGoodsCategoryById = id => {
return getRequest(`/promotion/pointsGoodsCategory/${id}`);
};
// 添加积分商品分类
export const addPointsGoodsCategory = (params) => {
return postRequest(`/promotion/pointsGoodsCategory`, params)
}
export const addPointsGoodsCategory = params => {
return postRequest(`/promotion/pointsGoodsCategory`, params);
};
// 更新积分商品分类
export const updatePointsGoodsCategory = (params) => {
return putRequest(`/promotion/pointsGoodsCategory`, params)
}
export const updatePointsGoodsCategory = params => {
return putRequest(`/promotion/pointsGoodsCategory`, params);
};
// 删除积分商品分类
export const deletePointsGoodsCategoryById = (id) => {
return deleteRequest(`/promotion/pointsGoodsCategory/${id}`)
}
export const deletePointsGoodsCategoryById = id => {
return deleteRequest(`/promotion/pointsGoodsCategory/${id}`);
};

View File

@@ -17,10 +17,14 @@ export default {
* @description api请求基础路径
*/
api_dev: {
common: "http://192.168.0.103:8890",
buyer: "http://192.168.0.103:8888",
seller: "http://192.168.0.103:8889",
manager: "http://192.168.0.103:8887"
// common: "https://common-api.pickmall.cn",
// 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'
},
api_prod: {
common: "https://common-api.pickmall.cn",

View File

@@ -296,6 +296,12 @@ export const otherRouter = {
title: "短信签名",
name: "add-sms-sign",
component: () => import("@/views/sys/message/smsSign.vue")
},
{
path: "liveDetail",
title: "查看直播",
name: "liveDetail",
component: () => import("@/views/live/liveDetail.vue")
}
]
};

View File

@@ -18,6 +18,72 @@ export function unitPrice(val, unit, location) {
let timer, flag;
/**
* 节流原理:在一定时间内,只能触发一次
*
* @param {Function} func 要执行的回调函数
* @param {Number} wait 延时的时间
* @param {Boolean} immediate 是否立即执行
* @return null
*/
export function throttle(func, wait = 500, immediate = true) {
if (immediate) {
if (!flag) {
flag = true;
// 如果是立即执行则在wait毫秒内开始时执行
typeof func === 'function' && func();
timer = setTimeout(() => {
flag = false;
}, wait);
}
} else {
if (!flag) {
flag = true
// 如果是非立即执行则在wait毫秒内的结束处执行
timer = setTimeout(() => {
flag = false
typeof func === 'function' && func();
}, wait);
}
}
};
let timeout = null;
/**
* 防抖原理一定时间内只有最后一次操作再过wait毫秒后才执行函数
*
* @param {Function} func 要执行的回调函数
* @param {Number} wait 延时的时间
* @param {Boolean} immediate 是否立即执行
* @return null
*/
export function debounce(func, wait = 500, immediate = false) {
// 清除定时器
if (timeout !== null) clearTimeout(timeout);
// 立即执行,此类情况一般用不到
if (immediate) {
var callNow = !timeout;
timeout = setTimeout(function() {
timeout = null;
}, wait);
if (callNow) typeof func === 'function' && func();
} else {
// 设置定时器当最后一次操作后timeout不会再被清除所以在延时wait毫秒后执行func回调方法
timeout = setTimeout(function() {
typeof func === 'function' && func();
}, wait);
}
}
/**
* 货币格式化
* @param price
@@ -172,4 +238,4 @@ export function formatLinkType (item) {
break;
}
return url;
}
}

View File

@@ -10,67 +10,77 @@
<span slot="close">关闭</span>
</i-switch>
</FormItem>
<FormItem label="分销关系绑定天数" prop="distributionDay">
<InputNumber :min="1" style="width:100px;" v-model="form.distributionDay" @on-change="handleSubmit"></InputNumber>
</FormItem>
<FormItem label="分销结算天数" prop="cashDay">
<InputNumber :min="1" style="width:100px;" v-model="form.cashDay" @on-change="handleSubmit "></InputNumber>
</FormItem>
</Form>
</div>
</template>
<script>
import { setSetting, getSetting } from "@/api/index";
import {setSetting, getSetting} from "@/api/index";
export default {
name: "distributionSetting",
components: {},
data() {
return {
loading: true, // 表单加载状态
form: { // 添加或编辑表单对象初始化数据
isOpen: ""
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
data: [], // 表单数据
total: 0 // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
export default {
name: "distributionSetting",
components: {},
data() {
return {
loading: true, // 表单加载状态
form: {
// 添加或编辑表单对象初始化数据
isOpen: "",
distributionDay: "", //分销关系绑定天数
cashDay: "", //分销结算天数
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getSetting("DISTRIBUTION_SETTING").then(res => {
this.loading = false;
if (res.success) {
this.form = res.result;
}
});
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getSetting("DISTRIBUTION_SETTING").then((res) => {
this.loading = false;
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
setSetting("DISTRIBUTION_SETTING", this.form).then(res => {
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
}
})
}
if (res.success) {
this.form = res.result;
}
});
this.loading = false;
},
mounted() {
this.init();
}
};
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
// 防抖处理一下
this.$options.filters.debounce(this.submit(), 1500);
}
});
},
submit() {
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,249 @@
<template>
<div>
<Card>
<Tabs v-model="searchForm.status">
<!-- 标签栏 -->
<TabPane v-for="(item,index) in tabs" :key="index" :name="item.status" :label="item.title">
</TabPane>
</Tabs>
<Table :columns="liveColumns" :data="liveData"></Table>
<Row type="flex" style="margin:20px;" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePageNumber" @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 { getLiveList, whetherStar } from "@/api/promotion.js";
export default {
data() {
return {
// 查询数据的总数
total: "",
// 查询的form
searchForm: {
pageSize: 10,
pageNumber: 1,
status: "NEW",
},
// 直播tab选项栏
tabs: [
{
title: "直播中",
status: "START",
},
{
title: "未开始",
status: "NEW",
},
{
title: "已结束",
status: "END",
},
],
liveColumns: [
{
title: "直播标题",
key: "name",
},
{
title: "主播昵称",
key: "anchorName",
},
{
title: "直播开始时间",
key: "createTime",
render: (h, params) => {
return h(
"span",
this.$options.filters.unixToDate(params.row.startTime)
);
},
},
{
title: "直播结束时间",
key: "endTime",
render: (h, params) => {
return h(
"span",
this.$options.filters.unixToDate(params.row.endTime)
);
},
},
{
title: "是否推荐",
align: "center",
render: (h, params) => {
return h("div", [
h(
"i-switch",
{
// 数据库0 enabled,1 disabled
props: {
type: "primary",
size: "large",
value: params.row.recommend == true,
},
on: {
"on-change": () => {
this.star(params.row,params.index);
},
},
},
[
h("span", {
slot: "open",
domProps: {
innerHTML: "是",
},
}),
h("span", {
slot: "close",
domProps: {
innerHTML: "否",
},
}),
]
),
]);
},
},
{
title: "直播状态",
render: (h, params) => {
return h(
"span",
params.row.status == "NEW"
? "未开始"
: params.row.status == "START"
? "直播中"
: "已结束"
);
},
},
{
title: "操作",
key: "action",
render: (h, params) => {
return h(
"div",
{
style: {
display: "flex",
},
},
[
h(
"Button",
{
props: {
type: "error",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.getLiveDetail(params.row);
},
},
},
"查看"
),
]
);
},
},
], //table中显示的title
liveData: [], //table中显示的直播数据
};
},
watch: {
"searchForm.status": {
handler() {
this.liveData = [];
this.getStoreLives();
},
deep: true,
},
},
mounted() {
this.getStoreLives();
},
methods: {
/**
* 是否推荐
*/
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});
},
/**
* 页面数据大小分页回调
*/
changePageSize(val) {
this.searchForm.pageSize = val;
this.getStoreLives();
},
/**
* 分页回调
*/
changePageNumber(val) {
this.searchForm.pageNumber = val;
this.getStoreLives();
},
/**
* 获取店铺直播间列表
*/
async getStoreLives() {
let result = await getLiveList(this.searchForm);
if (result.success) {
this.liveData = result.result.records;
this.total = result.result.total;
}
},
/**
* 获取直播间详情
*/
getLiveDetail(val) {
this.$router.push({
path: "/liveDetail",
query: { ...val, liveStatus: this.searchForm.status },
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/table-common.scss";
.btns {
margin-bottom: 10px;
margin-top: 10px;
}
.page {
margin-top: 20px;
}
</style>

View File

@@ -0,0 +1,300 @@
<template>
<div>
<Card>
<Form :model="liveForm" ref="liveForm" :rules="liveRulesForm" :label-width="120">
<FormItem label="直播标题" prop="name">
<Input disabled v-model="liveForm.name" style="width:460px"></Input>
<div class="tips">直播间名字最短3个汉字最长17个汉字1个汉字相当于2个字符</div>
</FormItem>
<FormItem label="主播昵称" prop="anchorName">
<Input disabled v-model="liveForm.anchorName" style="width:360px"></Input>
<div class="tips">主播昵称最短2个汉字最长15个汉字1个汉字相当于2个字符</div>
</FormItem>
<FormItem label="直播时间" prop="startTime">
<DatePicker disabled format="yyyy-MM-dd HH:mm" type="datetimerange" v-model="times" @on-change="handleChangeTime" :options="optionsTime" placeholder="直播计划开始时间-直播计划结束时间" style="width: 300px">
</DatePicker>
<div class="tips">直播开播时间需要在当前时间的10分钟后 并且 开始时间不能在 6 个月后</div>
</FormItem>
<FormItem label="主播微信号" prop="anchorWechat">
<Input disabled v-model="liveForm.anchorWechat" style="width:360px" placeholder="主播微信号"></Input>
<div class="tips">主播微信号如果未实名认证需要先前往小程序直播小程序进行<a target="_black" href="https://res.wx.qq.com/op_res/9rSix1dhHfK4rR049JL0PHJ7TpOvkuZ3mE0z7Ou_Etvjf-w1J_jVX0rZqeStLfwh">实名验证</a></div>
</FormItem>
<!-- 分享卡片 -->
<FormItem label="分享卡片封面" prop="feedsImg">
<div class="upload-list" v-if="liveForm.feedsImg">
<template>
<img :src="liveForm.feedsImg">
<div class="upload-list-cover">
<Icon type="ios-eye-outline" @click.native="handleView(liveForm.feedsImg)"></Icon>
</div>
</template>
</div>
<Upload v-if="liveForm.feedsImg.length ==0" ref="upload" :show-upload-list="false" :on-success="handleFeedsImgSuccess" :default-file-list="defaultImgList" :format="['jpg','jpeg','png']"
:on-format-error="handleFormatError" :max-size="1024" :on-exceeded-size="handleMaxSize" type="drag" :action="action" :headers="accessToken" style="display: inline-block;width:58px;">
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-camera" size="20"></Icon>
</div>
</Upload>
<div class="tips">
直播间分享图图片规则建议像素800*640大小不超过1M
</div>
</FormItem>
<!-- 直播间背景墙 -->
<FormItem label="直播间背景墙" prop="coverImg">
<div class="upload-list" v-if="liveForm.coverImg">
<template>
<img :src="liveForm.coverImg">
<div class="upload-list-cover">
<Icon type="ios-eye-outline" @click.native="handleView(liveForm.coverImg)"></Icon>
</div>
</template>
</div>
<Upload v-if="liveForm.coverImg.length ==0" ref="upload" :show-upload-list="false" :on-success="handleCoverImgSuccess" :default-file-list="defaultImgList" :format="['jpg','jpeg','png']"
:on-format-error="handleFormatError" :max-size="2048" :on-exceeded-size="handleMaxSize" type="drag" :action="action" :headers="accessToken" style="display: inline-block;width:58px;">
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-camera" size="20"></Icon>
</div>
</Upload>
<div class="tips"> 直播间背景图图片规则建议像素1080*1920大小不超过2M</div>
</FormItem>
<!-- 直播间背景墙 -->
<FormItem label="直播间分享图" prop="shareImg">
<div class="upload-list" v-if="liveForm.shareImg">
<template>
<img :src="liveForm.shareImg">
<div class="upload-list-cover">
<Icon type="ios-eye-outline" @click.native="handleView(liveForm.shareImg)"></Icon>
</div>
</template>
</div>
<Upload v-if="liveForm.shareImg.length ==0" ref="upload" :show-upload-list="false" :on-success="handleShareImgSuccess" :default-file-list="defaultImgList" :format="['jpg','jpeg','png']"
:on-format-error="handleFormatError" :max-size="2048" :on-exceeded-size="handleMaxSize" type="drag" :action="action" :headers="accessToken" style="display: inline-block;width:58px;">
<div style="width: 58px;height:58px;line-height: 58px;">
<Icon type="ios-camera" size="20"></Icon>
</div>
</Upload>
<div class="tips"> 直播间分享图图片规则建议像素800*640大小不超过1M</div>
</FormItem>
<FormItem label="商品" v-if="$route.query.id">
<Table class="goods-table" :columns="liveColumns" :data="liveData">
<template slot-scope="{ row,index }" slot="goodsName">
<div class="flex-goods">
<Badge v-if="index == 0 || index ==1" color="volcano"></Badge>
<img class="thumbnail" :src="row.thumbnail || row.goodsImage">
{{ row.goodsName || row.name }}
</div>
</template>
<template slot-scope="{ row }" class="price" slot="price">
<div>
<div v-if="row.priceType == 1">{{row.price | unitPrice('')}}</div>
<div v-if="row.priceType == 2">{{row.price | unitPrice('')}}{{row.price2 | unitPrice('')}}</div>
<div v-if="row.priceType == 3">{{row.price | unitPrice('¥')}}<span class="original-price">{{row.price2 | unitPrice('')}}</span></div>
</div>
</template>
<template slot-scope="{ row }" slot="quantity">
<div>{{row.quantity}}</div>
</template>
</Table>
<div class="tips">
直播间商品中前两个商品将自动被选为封面伴随直播间在直播列表中显示
</div>
</FormItem>
<FormItem>
<Button type="primary" @click="createLives()">保存</Button>
</FormItem>
</Form>
</Card>
<!-- 浏览图片 -->
<Modal title="查看图片" v-model="imageVisible">
<img :src="imageSrc" v-if="imageVisible" style="width: 100%">
</Modal>
</div>
</template>
<script>
import { getLiveInfo } from "@/api/promotion";
export default {
data() {
return {
imageVisible: false, //查看图片的dailog
imageSrc: "", //查看图片的路径
liveForm: {
name: "", //直播标题
anchorName: "", //主播昵称
anchorWechat: "", //主播微信号
feedsImg: "", //分享卡片封面
coverImg: "", //直播间背景墙
shareImg: "", //分享图
startTime: "",
},
times: [], //接收直播时间数据
// 直播商品表格表头
liveColumns: [
{
title: "商品",
slot: "goodsName",
},
{
title: "价格",
slot: "price",
},
{
title: "库存",
slot: "quantity",
width: 100,
},
{
title: "操作",
slot: "action",
width: 250,
},
],
liveData: [], //直播商品集合
commodityList: "", //商品集合
};
},
mounted() {
/**
* 如果query.id有值说明是查看详情
* liveStatus 可以判断当前直播状态 从而区分数据 是否是未开始、已开启、已关闭、
*/
if (this.$route.query.id) {
// 获取直播间详情
this.getLiveDetail();
}
this.accessToken = {
accessToken: this.getStore("accessToken"),
};
},
methods: {
/**
* 上传图片查看图片
*/
handleView(src) {
this.imageVisible = true;
this.imageSrc = src;
},
/**
* 获取直播间详情
*/
async getLiveDetail() {
let result = await getLiveInfo(this.$route.query.id);
// 将数据回调到liveform里面
if (result.success) {
let data = result.result;
for (let key in data) {
this.liveForm[key] = data[key];
}
// 将选择的商品回调给表格
this.liveData = data.commodityList;
this.commodityList = data.commodityList;
// 将时间格式化
this.$set(
this.times,
[0],
this.$options.filters.unixToDate(data.startTime, "yyyy-MM-dd hh:mm")
);
this.$set(
this.times,
[1],
this.$options.filters.unixToDate(data.endTime, "yyyy-MM-dd hh:mm")
);
this.liveStatus = data.status;
}
},
},
};
</script>
<style lang="scss" scoped>
.action {
display: flex;
/deep/ .ivu-btn {
margin: 0 5px !important;
}
}
.original-price {
margin-left: 10px;
color: #999;
text-decoration: line-through;
}
.thumbnail {
width: 50px;
height: 50px;
border-radius: 0.4em;
}
.flex-goods {
margin: 10px;
display: flex;
align-items: center;
> img {
margin-right: 10px;
}
}
.tips {
color: #999;
font-size: 12px;
}
.goods-table {
width: 1000px;
margin: 10px 0;
}
.upload-list {
display: inline-block;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
margin-right: 4px;
}
.upload-list img {
width: 100%;
height: 100%;
}
.upload-list-cover {
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
}
.upload-list:hover .upload-list-cover {
display: block;
}
.upload-list-cover i {
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
</style>

View File

@@ -22,10 +22,17 @@
<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>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
<Button type="primary" ghost class="search-btn">导出Excel</Button>
</download-excel>
</Form>
</Row>
<Row class="padding-row">
@@ -43,12 +50,60 @@
<script>
import * as API_Order from "@/api/order";
import JsonExcel from "vue-json-excel";
export default {
name: "orderList",
components: {},
components: {
"download-excel": JsonExcel,
},
data() {
return {
// 表格的表头以及内容
fields:{
"订单编号":"sn",
"下单时间":"createTime",
"客户名称":"memberName",
"客户账号":"",
"收货人":"",
"收货人手机号":"",
"收货人地址":"",
"支付方式":{
field: "clientType",
callback:value=>{
if (value == "H5") {
return "移动端"
} else if (value == "PC") {
return "PC端"
} else if (value== "WECHAT_MP") {
return "小程序端"
} else if (value == "APP") {
return "移动应用端"
} else {
return value;
}
}
},
"配送方式":"",
"配送费用":"",
"订单商品金额":"",
"订单优惠金额":"",
"订单应付金额":"",
"商品SKU编号":"",
"商品数量":"groupNum",
"买家备注":"",
"订单状态":"",
"付款状态":{
field:"payStatus",
callback:value=>{
return value == "UNPAID" ? "未付款" : value == "PAID" ? "已付款" : ""
}
},
"发货状态":"",
"发票类型":"",
"发票抬头":"",
"店铺":"storeName",
},
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
@@ -95,16 +150,15 @@ export default {
width: 95,
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);
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);
}
},
},

View File

@@ -71,7 +71,7 @@
@click="edit(row)"
>编辑</Button
>
&nbsp;
<Button
type="info"
size="small"
@@ -80,7 +80,7 @@
@click="manage(row)"
>查看</Button
>
&nbsp;
<Button
type="primary"
size="small"
@@ -89,7 +89,7 @@
@click="manage(row)"
>管理</Button
>
&nbsp;
<!-- <Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW' || row.promotionStatus == 'END'" @click="upper(row)">上架</Button> -->
<Button
type="error"
@@ -313,4 +313,7 @@ export default {
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
.mr_5{
margin: 0 5px;
}
</style>

View File

@@ -66,7 +66,8 @@ export default {
uvs: 0, // 访客数
pvs: 0, // 浏览量
dateList: [ // 选择项
dateList: [
// 选择项
{
title: "今天",
selected: false,
@@ -90,7 +91,8 @@ export default {
],
orderChart: "", // 初始化图表
params: { // 请求参数
params: {
// 请求参数
searchType: "LAST_SEVEN",
year: "",
month: "",
@@ -117,6 +119,8 @@ export default {
watch: {
params: {
handler(val) {
this.uvs = 0;
this.pvs = 0;
this.init();
},
deep: true,