master
commit
0b64122c41
|
@ -4,7 +4,7 @@
|
|||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="./static/logo.ico" type="image/x-icon">
|
||||
<!-- <script src = 'https://webapi.amap.com/maps?v=2.0&key=b440952723253aa9fe483e698057bf7d'></script> -->
|
||||
<script src="https://yzf.qq.com/xv/web/static/chat_sdk/yzf_chat.min.js"></script>
|
||||
<title>LILI</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -441,3 +441,39 @@ export function memberPointHistory (params) {
|
|||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 分页获取会员站内信
|
||||
* @param {Object} params 请求参数,包括pageNumber、pageSize、status
|
||||
*/
|
||||
export function memberMsgList (params) {
|
||||
return request({
|
||||
url: `/buyer/member/message`,
|
||||
method: Method.GET,
|
||||
needToken: true,
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 设置消息为已读
|
||||
* @param {String} messageId 消息id
|
||||
*/
|
||||
export function readMemberMsg (params) {
|
||||
return request({
|
||||
url: `/buyer/member/message`,
|
||||
method: Method.PUT,
|
||||
needToken: true,
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除会员消息
|
||||
* @param {String} messageId 消息id
|
||||
*/
|
||||
export function delMemberMsg (params) {
|
||||
return request({
|
||||
url: `/buyer/member/message`,
|
||||
method: Method.DELETE,
|
||||
needToken: true,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
|
@ -63,17 +63,17 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
selectTags (item) {
|
||||
selectTags (item) { // 选择热门标签
|
||||
this.searchData = item;
|
||||
this.search();
|
||||
},
|
||||
search () {
|
||||
search () { // 全平台搜索商品
|
||||
this.$router.push({
|
||||
path: '/goodsList',
|
||||
query: { keyword: this.searchData }
|
||||
});
|
||||
},
|
||||
searchStore () {
|
||||
searchStore () { // 店铺搜索商品
|
||||
this.$emit('search', this.searchData)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -57,7 +57,7 @@ import {
|
|||
export default {
|
||||
name: 'addressManage',
|
||||
props: {
|
||||
id: {
|
||||
id: { // 传入的地址id
|
||||
defalut: '',
|
||||
type: String
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
save () {
|
||||
save () { // 保存地址
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.formData));
|
||||
|
@ -138,15 +138,15 @@ export default {
|
|||
this.formData.lat = item.position.lat;
|
||||
this.formData.lon = item.position.lng;
|
||||
},
|
||||
show () {
|
||||
show () { // 地址模态框显示
|
||||
this.showAddr = true;
|
||||
},
|
||||
hide () {
|
||||
hide () { // 地址模态框隐藏
|
||||
this.showAddr = false;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
id: {
|
||||
id: { // 传入的地址id
|
||||
handler: function (v) {
|
||||
if (v) {
|
||||
this.getAddrById(v);
|
||||
|
|
|
@ -59,7 +59,6 @@ export default {
|
|||
isActive: 0 // 已激活tab栏下标
|
||||
};
|
||||
},
|
||||
mounted () {},
|
||||
methods: {
|
||||
// 点击右侧的回调
|
||||
callBack () {
|
||||
|
|
|
@ -44,7 +44,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
getList () {
|
||||
getList () { // 获取优惠券列表
|
||||
this.loading = true
|
||||
memberCouponList(this.params).then(res => {
|
||||
this.loading = false
|
||||
|
@ -67,18 +67,18 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
changePageNum (val) {
|
||||
changePageNum (val) { // 分页改变页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 分页改变页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
},
|
||||
|
||||
useScope (type, storeName) {
|
||||
useScope (type, storeName) { // 根据字段返回 优惠券适用范围
|
||||
let shop = '平台';
|
||||
let goods = '全部商品'
|
||||
if (storeName !== 'platform') shop = storeName
|
||||
|
@ -104,7 +104,7 @@ export default {
|
|||
|
||||
<style scoped lang="scss">
|
||||
@import '../../assets/styles/coupon.scss';
|
||||
.pageration{
|
||||
.pageration {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -151,8 +151,6 @@ export default {
|
|||
]
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
mounted () {},
|
||||
methods: {
|
||||
getCartList () { // 获取购物车列表
|
||||
this.loading = true
|
||||
|
|
|
@ -44,12 +44,12 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
showCartNum (item) {
|
||||
showCartNum (item) { // 获取购物车数量
|
||||
if (this.userInfo && item.title === '购物车') {
|
||||
this.getCartList()
|
||||
}
|
||||
},
|
||||
clickBar (val) {
|
||||
clickBar (val) { // tabbar点击操作
|
||||
if (!this.userInfo) {
|
||||
this.$Modal.confirm({
|
||||
title: '请登录',
|
||||
|
@ -83,7 +83,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
openBlank (path) {
|
||||
openBlank (path) { // 新页面打开地址
|
||||
let routerUrl = this.$router.resolve({
|
||||
path: path
|
||||
})
|
||||
|
|
|
@ -13,11 +13,6 @@
|
|||
<script>
|
||||
export default {
|
||||
name: 'Main',
|
||||
data () {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
props: {
|
||||
_Title: { // 描述内容
|
||||
type: null,
|
||||
|
|
|
@ -62,7 +62,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
goArticle () { // 跳转
|
||||
goArticle () { // 跳转文章页
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/article'
|
||||
})
|
||||
|
|
|
@ -19,7 +19,7 @@ export default {
|
|||
time: { // 传入的初始时间
|
||||
default: 1718977559428
|
||||
},
|
||||
type: {
|
||||
type: { // 区分是在详情还是购物车调用
|
||||
default: 'goodsDetail', // 设置两个值,goodsDetail和cart,样式不同
|
||||
type: String
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export default {
|
|||
this.init()
|
||||
},
|
||||
methods: {
|
||||
countDown (val) {
|
||||
countDown (val) { // 倒计时方法
|
||||
function addZero (i) {
|
||||
return i < 10 ? '0' + i : i + '';
|
||||
}
|
||||
|
@ -58,8 +58,8 @@ export default {
|
|||
clearInterval(this.interval)
|
||||
}
|
||||
},
|
||||
init () {
|
||||
this.interval = setInterval((item) => {
|
||||
init () { // 初始化
|
||||
this.interval = setInterval(() => {
|
||||
this.countDown(this.time);
|
||||
}, 1000);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
<div class="goodsConfig mt_10">
|
||||
<span @click="collect" ><Icon type="ios-heart" :color="isCollected ? '#ed3f14' : '#666'" />{{isCollected?'已收藏':'收藏'}}</span>
|
||||
<!-- <span>举报</span> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右侧商品信息、活动信息、操作展示 -->
|
||||
|
@ -60,7 +59,7 @@
|
|||
:key="index"
|
||||
@click="receiveCoupon(item.id)"
|
||||
>
|
||||
<span v-if="item.couponType == 'PRICE'">满{{ item.consumeThreshold }}减{{item.price | unitPrice}}</span>
|
||||
<span v-if="item.couponType == 'PRICE'">满{{ item.consumeThreshold }}减{{item.price}}</span>
|
||||
<span v-if="item.couponType == 'DISCOUNT'">满{{ item.consumeThreshold }}打{{item.couponDiscount}}折</span>
|
||||
</span>
|
||||
</p>
|
||||
|
@ -120,38 +119,16 @@
|
|||
<span class="inventory"> {{skuDetail.weight}}kg</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-buy-car">
|
||||
<div class="add-buy-car" v-if="$route.query.way === 'POINT'">
|
||||
<Button type="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="pointPay">积分购买</Button>
|
||||
</div>
|
||||
<div class="add-buy-car" v-else>
|
||||
<Button type="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="addShoppingCartBtn">加入购物车</Button>
|
||||
<Button type="warning" :loading="loading1" :disabled="skuDetail.quantity === 0" @click="buyNow">立即购买</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="item-detail-see">
|
||||
<Divider>更多推荐</Divider>
|
||||
<Row>
|
||||
<Col :span="24" class="see-Item">
|
||||
<img class="see-Img" src="https://demo.dscmall.cn/storage/images/201703/thumb_img/0_thumb_G_1489099128797.jpg" alt="" />
|
||||
<p>
|
||||
名龙堂i7 6700升7700 GTX1060 6G台式电脑主机DIY游戏组装整机
|
||||
升6GB独显 送正版WIN10 一年上门
|
||||
</p>
|
||||
<p class="global_color">¥2500.00</p>
|
||||
</Col>
|
||||
<Col :span="24" class="see-Item">
|
||||
<img
|
||||
class="see-Img"
|
||||
src="https://demo.dscmall.cn/storage/images/201703/thumb_img/0_thumb_G_1489099128797.jpg"
|
||||
alt=""
|
||||
/>
|
||||
<p>
|
||||
名龙堂i7 6700升7700 GTX1060 6G台式电脑主机DIY游戏组装整机
|
||||
升6GB独显 送正版WIN10 一年上门
|
||||
</p>
|
||||
<p class="global_color">¥2500.00</p>
|
||||
</Col>
|
||||
</Row>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -247,6 +224,22 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
pointPay () { // 积分购买
|
||||
const params = {
|
||||
num: this.count,
|
||||
skuId: this.skuDetail.id,
|
||||
cartType: 'BUY_NOW'
|
||||
};
|
||||
this.loading1 = true;
|
||||
addCartGoods(params).then(res => {
|
||||
this.loading1 = false;
|
||||
if (res.success) {
|
||||
this.$router.push({path: '/pay', query: {way: 'POINT'}});
|
||||
} else {
|
||||
this.$Message.warning(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
async collect () { // 收藏商品
|
||||
if (this.isCollected) {
|
||||
let cancel = await cancelCollect('GOODS', this.skuDetail.id)
|
||||
|
@ -338,6 +331,7 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
// 用户登录才会判断是否收藏
|
||||
if (this.Cookies.getItem('userInfo')) {
|
||||
isCollection('GOODS', this.skuDetail.id).then(res => {
|
||||
if (res.success && res.result) {
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="remarks-bar">
|
||||
<span @click="searchByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span>
|
||||
<span @click="searchByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span>
|
||||
<span @click="searchByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span>
|
||||
<span @click="searchByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span>
|
||||
<span @click="viewByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span>
|
||||
<span @click="viewByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span>
|
||||
<span @click="viewByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span>
|
||||
<span @click="viewByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span>
|
||||
</div>
|
||||
<div style="text-align: center;margin-top: 20px;" v-if="commentList.length === 0">
|
||||
暂无评价数据
|
||||
|
@ -86,9 +86,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</TabPane>
|
||||
<!-- <TabPane label="商品问答">
|
||||
<ShowGoodsQuestion/>
|
||||
</TabPane> -->
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -97,7 +94,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import ShowGoodsQuestion from '@/components/goodsDetail/ShowGoodsQuestion';
|
||||
import { goodsComment, goodsCommentNum } from '@/api/member.js';
|
||||
export default {
|
||||
name: 'ShowGoodsDetail',
|
||||
|
@ -122,21 +118,21 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
skuDetail () {
|
||||
skuDetail () { // skuId
|
||||
return this.detail.data;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeHeight (name) {
|
||||
changeHeight (name) { // 设置商品详情高度
|
||||
let heightCss = window.getComputedStyle(this.$refs[name]).height;
|
||||
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
|
||||
this.$refs.itemIntroDetail.style.height = heightCss + 'px';
|
||||
},
|
||||
changePageNum (val) {
|
||||
changePageNum (val) { // 修改评论页码
|
||||
this.commentParams.pageNumber = val;
|
||||
this.getList();
|
||||
},
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 修改评论页数
|
||||
this.commentParams.pageNumber = 1;
|
||||
this.commentParams.pageSize = val;
|
||||
this.getList();
|
||||
|
@ -155,12 +151,12 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
searchByGrade (grade) {
|
||||
viewByGrade (grade) { // 好中差评切换
|
||||
this.$set(this.commentParams, 'grade', grade);
|
||||
this.commentParams.pageNumber = 1;
|
||||
this.getList();
|
||||
},
|
||||
tabClick (name) {
|
||||
tabClick (name) { // 商品详情和评价之间的tab切换
|
||||
if (name === 0) {
|
||||
this.$nextTick(() => {
|
||||
this.changeHeight('itemIntroGoods')
|
||||
|
@ -198,7 +194,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
handleScroll () {
|
||||
handleScroll () { // 监听页面滚动
|
||||
if (this.onceFlag) {
|
||||
this.$nextTick(() => {
|
||||
this.changeHeight('itemIntroGoods')
|
||||
|
@ -208,15 +204,12 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$nextTick(() => {
|
||||
this.$nextTick(() => { // 手动设置详情高度,解决无法撑开问题
|
||||
setTimeout(this.changeHeight('itemIntroGoods'), 2000);
|
||||
});
|
||||
window.addEventListener('scroll', this.handleScroll)
|
||||
this.getList();
|
||||
},
|
||||
components: {
|
||||
ShowGoodsQuestion
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -283,14 +276,12 @@ export default {
|
|||
}
|
||||
.item-intro-detail{
|
||||
margin: 0 30px;
|
||||
// min-height: 1500px;
|
||||
width: 100%;
|
||||
}
|
||||
.item-intro-nav{
|
||||
width: 100%;
|
||||
height: 38px;
|
||||
background-color: #F7F7F7;
|
||||
// border-bottom: 1px solid $theme_color;
|
||||
}
|
||||
.item-intro-nav ul{
|
||||
margin: 0px;
|
||||
|
@ -329,8 +320,6 @@ export default {
|
|||
width: 240px;
|
||||
height: 36px;
|
||||
font-size: 14px;
|
||||
/* text-align: center; */
|
||||
/* background-color: #ccc; */
|
||||
}
|
||||
.item-param-title {
|
||||
color: #232323;
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
<template>
|
||||
<div class="wrapper">
|
||||
<div v-if="true" class="question-list">
|
||||
<div class="-item" v-for="index in 6" :key="index">
|
||||
<!-- 提问 -->
|
||||
<div class="-item-put -item-div">
|
||||
<div class="-item-div-l blod">
|
||||
<Tag color="warning">问</Tag>
|
||||
有屏幕调节亮度吗
|
||||
</div>
|
||||
<div class="-item-div-r">2020年10月21日17:03:35</div>
|
||||
</div>
|
||||
<!-- 解答 -->
|
||||
<div class="-item-reply -item-div">
|
||||
<div class="-item-div-l">
|
||||
<Tag color="success">答</Tag>
|
||||
能调节,点屏幕上方有一条调整带,可正负2调整。
|
||||
</div>
|
||||
<div class="-item-div-r">2020年10月21日17:03:35</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="question-empty">
|
||||
<empty></empty>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.-item-div {
|
||||
padding: 10px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.-item-div-l {
|
||||
display: flex;
|
||||
@include content_color($light_content_color);
|
||||
}
|
||||
.-item-div-r {
|
||||
@include sub_color($light_content_color);
|
||||
}
|
||||
.blod {
|
||||
font-weight: bold;
|
||||
}
|
||||
.-item {
|
||||
margin: 10px 0;
|
||||
border-bottom: 1px solid $border_color;
|
||||
}
|
||||
</style>
|
|
@ -1,85 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="remarks-title">
|
||||
<span>售后保障</span>
|
||||
</div>
|
||||
<div class="item-protect-container">
|
||||
<div class="item-protect-box">
|
||||
<p class="item-protect-title-box">
|
||||
<Avatar style="background-color: #e4393c" icon="ribbon-a" />
|
||||
<span class="item-protect-title">卖家服务</span>
|
||||
</p>
|
||||
<p class="item-protect-detail">
|
||||
高品质敢承诺:7天无理由退货,30天免费换新,质量问题商家承担来回运费换新;如需发票,请在确认收货无误后联系商家开出。(注*发票不随货品一同发出)
|
||||
</p>
|
||||
</div>
|
||||
<div class="item-protect-box">
|
||||
<p class="item-protect-title-box">
|
||||
<Avatar style="background-color: #e4393c" icon="cash" />
|
||||
<span class="item-protect-title">平台承诺</span>
|
||||
</p>
|
||||
<p class="item-protect-detail">
|
||||
平台卖家销售并发货的商品,由平台卖家提供发票和相应的售后服务。请您放心购买!<br> 注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
|
||||
</p>
|
||||
</div>
|
||||
<div class="item-protect-box">
|
||||
<p class="item-protect-title-box">
|
||||
<Avatar style="background-color: #e4393c" icon="locked" />
|
||||
<span class="item-protect-title">正品行货</span>
|
||||
</p>
|
||||
<p class="item-protect-detail">
|
||||
BIT商城向您保证所售商品均为正品行货,BIT自营商品开具机打发票或电子发票。
|
||||
</p>
|
||||
</div>
|
||||
<div class="item-protect-box">
|
||||
<p class="item-protect-title-box">
|
||||
<Avatar style="background-color: #e4393c" icon="settings" />
|
||||
<span class="item-protect-title">全国联保</span>
|
||||
</p>
|
||||
<p class="item-protect-detail">
|
||||
凭质保证书及BIT商城发票,可享受全国联保服务(奢侈品、钟表除外;奢侈品、钟表由BIT联系保修,享受法定三包售后服务),与您亲临商场选购的商品享受相同的质量保证。BIT商城还为您提供具有竞争力的商品价格和运费政策,请您放心购买!<br><br> 注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ShowProductWarranty'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.remarks-title {
|
||||
padding-left: 15px;
|
||||
height: 36px;
|
||||
font-size: 16px;
|
||||
font-weight: bolder;
|
||||
line-height: 36px;
|
||||
color: #666666;
|
||||
background-color: #F7F7F7;
|
||||
}
|
||||
.item-protect-container {
|
||||
padding: 15px;
|
||||
}
|
||||
.item-protect-box {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.item-protect-title-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.item-protect-title {
|
||||
padding-left: 15px;
|
||||
font-size: 20px;
|
||||
font-weight: bolder;
|
||||
color: $theme_color;
|
||||
}
|
||||
.item-protect-detail {
|
||||
padding-top: 5px;
|
||||
padding-left: 46px;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
|
@ -9,7 +9,6 @@
|
|||
</li>
|
||||
</ul>
|
||||
<ul class="detail">
|
||||
<!-- <li class="first hover-pointer" @click="handleClickTheme()">切换主题</li> -->
|
||||
<li class="first" v-show="!userInfo.username">
|
||||
<router-link :to="`/login?rePath=${$route.path}&query=${JSON.stringify($route.query)}`">
|
||||
<span style="border:none" class="tipsLogin">请登录</span>
|
||||
|
@ -35,14 +34,27 @@
|
|||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</li>
|
||||
<<<<<<< HEAD
|
||||
<li class="hover-color" @click="goUserCenter('/home/MyOrder')"><span class="nav-item">我的订单</span></li>
|
||||
<li class="hover-color" @click="goUserCenter('/home/MyTracks')"><span class="nav-item">我的足迹</span></li>
|
||||
=======
|
||||
<li @click="goUserCenter('/home/MyOrder')"><span class="nav-item hover-color">我的订单</span></li>
|
||||
<li @click="goUserCenter('/home/MyTracks')"><span class="nav-item hover-color">我的足迹</span></li>
|
||||
<li @click="goUserCenter('/home/MsgList')"><span class="nav-item hover-color">我的消息</span></li>
|
||||
>>>>>>> dev-ryan
|
||||
<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">
|
||||
<span @mouseenter="getCartList">
|
||||
<<<<<<< HEAD
|
||||
<Icon size="18" class="cart-icon" type="ios-cart-outline"></Icon>
|
||||
=======
|
||||
<Icon
|
||||
size="18"
|
||||
type="ios-cart-outline"
|
||||
></Icon>
|
||||
>>>>>>> dev-ryan
|
||||
购物车
|
||||
</span>
|
||||
|
||||
|
@ -116,6 +128,7 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
<<<<<<< HEAD
|
||||
handleClickTheme() {
|
||||
this.themeType === "light"
|
||||
? (this.themeType = "dark")
|
||||
|
@ -129,17 +142,28 @@ export default {
|
|||
this.city = city;
|
||||
},
|
||||
goToPay() {
|
||||
=======
|
||||
changeCity (city) { // 选择所在城市
|
||||
this.city = city;
|
||||
},
|
||||
goToPay () { // 跳转购物车
|
||||
>>>>>>> dev-ryan
|
||||
let url = this.$router.resolve({
|
||||
path: "/cart",
|
||||
});
|
||||
window.open(url.href, "_blank");
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
myInfo() {
|
||||
=======
|
||||
myInfo () { // 跳转会员中心
|
||||
>>>>>>> dev-ryan
|
||||
let url = this.$router.resolve({
|
||||
path: "/home",
|
||||
});
|
||||
window.open(url.href, "_blank");
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
signOutFun() {
|
||||
storage.removeItem("accessToken");
|
||||
storage.removeItem("refreshToken");
|
||||
|
@ -147,6 +171,15 @@ export default {
|
|||
storage.removeItem("cartNum");
|
||||
this.$store.commit("SET_CARTNUM", 0);
|
||||
this.$router.push("/login");
|
||||
=======
|
||||
signOutFun () { // 退出登录
|
||||
storage.removeItem('accessToken');
|
||||
storage.removeItem('refreshToken');
|
||||
storage.removeItem('userInfo');
|
||||
storage.removeItem('cartNum');
|
||||
this.$store.commit('SET_CARTNUM', 0)
|
||||
this.$router.push('/login');
|
||||
>>>>>>> dev-ryan
|
||||
},
|
||||
goUserCenter(path) {
|
||||
// 跳转我的订单,我的足迹
|
||||
|
@ -230,13 +263,13 @@ export default {
|
|||
float: left;
|
||||
font-size: 14px;
|
||||
line-height: 35px;
|
||||
margin-right: 15px;
|
||||
margin-right: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.nav a,
|
||||
.nav-item {
|
||||
text-decoration: none;
|
||||
padding-left: 15px;
|
||||
padding-left: 10px;
|
||||
border-left: 1px solid #ccc;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
|
@ -377,9 +410,13 @@ export default {
|
|||
.sign-out p {
|
||||
font-size: 12px;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
.cart-icon {
|
||||
padding: 0 6px;
|
||||
}
|
||||
=======
|
||||
|
||||
>>>>>>> dev-ryan
|
||||
.goods-title:hover {
|
||||
color: $theme_color;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<div class="shop-box">
|
||||
<div class="shop-container">
|
||||
<div class="shop-title">
|
||||
<div class="shop-title-content">
|
||||
<p><router-link :to="`/merchant?id=${skuDetail.storeId}`">{{ skuDetail.storeName }}</router-link></p>
|
||||
</div>
|
||||
<img class="hover-pointer" @click="linkTo(`/merchant?id=${storeDetail.storeId}`)" :src="storeDetail.storeLogo" height="40" alt="">
|
||||
<p><router-link :to="`/merchant?id=${storeDetail.storeId}`">{{ storeDetail.storeName }}</router-link></p>
|
||||
<div class="ml_20" v-html="storeDetail.storeDesc"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -20,7 +20,7 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
skuDetail () {
|
||||
storeDetail () { // 店铺详情
|
||||
return this.detail;
|
||||
}
|
||||
}
|
||||
|
@ -46,57 +46,17 @@ export default {
|
|||
color: #fff;
|
||||
}
|
||||
|
||||
.shop-title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.shop-title-icon {
|
||||
font-size: 46px;
|
||||
}
|
||||
|
||||
.shop-title-content {
|
||||
padding-top: 8px;
|
||||
margin-left: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.shop-title-content p {
|
||||
line-height: 26px;
|
||||
font-size: 20px;
|
||||
|
||||
}
|
||||
.shop-title-content p:nth-child(2) {
|
||||
font-size: 16px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.shop-title-content a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.shop-another-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.shop-another-item-detail {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.shop-another-item-img {
|
||||
height: 80px;
|
||||
border-radius: 40px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.shop-another-item-img img {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.shop-anoter-item-intro {
|
||||
margin-left: 15px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
goCartList () {
|
||||
goCartList () { // 跳转购物车页面
|
||||
let routerUrl = this.$router.resolve({
|
||||
path: '/cart'
|
||||
})
|
||||
|
|
|
@ -67,14 +67,14 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
getArticleList () {
|
||||
getArticleList () { // 获取常见问题列表
|
||||
articleList(this.params).then(res => {
|
||||
if (res.success) {
|
||||
this.articleList = res.result.records
|
||||
}
|
||||
})
|
||||
},
|
||||
goArticle (id) {
|
||||
goArticle (id) { // 跳转文章详情
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/article',
|
||||
query: {id}
|
||||
|
|
|
@ -32,7 +32,6 @@ export default {
|
|||
options: this.data.options // 装修数据
|
||||
};
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -50,9 +50,8 @@ export default {
|
|||
this.$emit('content', val);
|
||||
}
|
||||
},
|
||||
mounted () {},
|
||||
methods: {
|
||||
changeCurr (index) {
|
||||
changeCurr (index) { // 选择分类
|
||||
this.currentIndex = index;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ export default {
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
diffSeconds (val) {
|
||||
diffSeconds (val) { // 秒杀倒计时
|
||||
const hours = Math.floor(val / 3600);
|
||||
// 当前秒数 / 60,向下取整
|
||||
// 获取到所有分钟数 3600 / 60 = 60分钟
|
||||
|
@ -139,7 +139,7 @@ export default {
|
|||
}, 1000);
|
||||
}
|
||||
},
|
||||
goPromotion () {
|
||||
goPromotion () { // 跳转秒杀页面
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/seckill'
|
||||
});
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
## 此组件为结算页面修改发票信息使用 后续可以复用到个人信息添加发票页面
|
||||
|
||||
### 目前没有参数,之后会设置一个参数接收历史的单位发票数据
|
|
@ -69,7 +69,7 @@ export default {
|
|||
receiptContent: '不开发票', // 发票内容
|
||||
type: 1 // 1 个人 2 单位
|
||||
},
|
||||
ruleInline: {
|
||||
ruleInline: { // 验证规则
|
||||
receiptTitle: [{ required: true, message: '请填写公司名称' }],
|
||||
taxpayerId: [
|
||||
{ required: true, message: '请填写纳税人识别号' },
|
||||
|
@ -79,7 +79,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
save () {
|
||||
save () { // 保存发票
|
||||
if (this.invoiceForm.type === 1) {
|
||||
// 个人
|
||||
let flag = true;
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
this.$emit('getAddress', this.addrContent);
|
||||
}
|
||||
},
|
||||
init () {
|
||||
init () { // 初始化地图
|
||||
AMapLoader.load({
|
||||
key: 'b440952723253aa9fe483e698057bf7d', // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: '', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
|
|
|
@ -21,7 +21,7 @@ export default {
|
|||
props: ['addressId'],
|
||||
mounted () {},
|
||||
methods: {
|
||||
change (val, selectedData) {
|
||||
change (val, selectedData) { // 选择地区
|
||||
/**
|
||||
* @returns [regionId,region]
|
||||
*/
|
||||
|
@ -30,7 +30,7 @@ export default {
|
|||
selectedData[selectedData.length - 1].__label.split('/')
|
||||
]);
|
||||
},
|
||||
loadData (item, callback) {
|
||||
loadData (item, callback) { // 加载数据
|
||||
item.loading = true;
|
||||
getRegion(item.value).then((res) => {
|
||||
if (res.result.length <= 0) {
|
||||
|
@ -59,7 +59,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
async init () {
|
||||
async init () { // 初始化地图数据
|
||||
let data = await getRegion(0);
|
||||
let arr = [];
|
||||
data.result.forEach((item) => {
|
||||
|
|
|
@ -209,7 +209,7 @@ export default {
|
|||
},
|
||||
deep: true
|
||||
},
|
||||
'$route': {
|
||||
'$route': { // 监听路由
|
||||
handler (val, oVal) {
|
||||
if (this.$route.query.categoryId) {
|
||||
let cateId = this.$route.query.categoryId.split(',')
|
||||
|
@ -373,6 +373,7 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
// 有分类id就根据id搜索
|
||||
if (this.$route.query.categoryId) {
|
||||
let cateId = this.$route.query.categoryId.split(',')
|
||||
Object.assign(this.params, this.$route.query)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#### 在组件上添加v-if来判断组件显隐
|
||||
|
||||
#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ]等,详情看接口文档
|
||||
#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ]
|
||||
|
||||
#### @change方法 获取回调,参数为对象 {status:false,distance:100} status 为回调状态,distance为移动距离
|
||||
|
||||
|
|
|
@ -43,11 +43,11 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
mouseDown (e) {
|
||||
mouseDown (e) { // 鼠标按下操作,
|
||||
this.downX = e.clientX;
|
||||
this.flag = true;
|
||||
},
|
||||
mouseMove (e) {
|
||||
mouseMove (e) { // 鼠标移动
|
||||
if (this.flag) {
|
||||
let offset = e.clientX - this.downX;
|
||||
|
||||
|
@ -60,7 +60,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
mouseUp () {
|
||||
mouseUp () { // 鼠标抬起
|
||||
if (!this.flag) return false;
|
||||
this.flag = false;
|
||||
let params = {
|
||||
|
@ -83,7 +83,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
refresh () {
|
||||
refresh () { // 刷新验证图片
|
||||
this.flag = false;
|
||||
this.downX = 0;
|
||||
this.distance = 0;
|
||||
|
@ -91,7 +91,7 @@ export default {
|
|||
this.verifyText = '拖动滑块解锁';
|
||||
this.getImg();
|
||||
},
|
||||
getImg () {
|
||||
getImg () { // 获取验证图片
|
||||
getVerifyImg(this.type).then(res => {
|
||||
this.data = res.result;
|
||||
});
|
||||
|
|
|
@ -26,7 +26,3 @@ export function postVerifyImg (params) {
|
|||
headers: {uuid: storage.getItem('uuid')}
|
||||
});
|
||||
}
|
||||
|
||||
export function mouseup () {
|
||||
console.log(111);
|
||||
}
|
||||
|
|
|
@ -17,10 +17,10 @@ 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: '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: 'https://common-api.pickmall.cn',
|
||||
buyer: 'https://buyer-api.pickmall.cn',
|
||||
|
|
|
@ -37,6 +37,11 @@ Vue.prototype.linkTo = function (url) {
|
|||
window.open(url, '_blank')
|
||||
}
|
||||
}
|
||||
// 联系客服
|
||||
Vue.prototype.connectCs = function (sign = '37ef9b97807d03c6741298ed4eb5b536d2d238e08a3c00fb01fe48f03a569974c99ad767e72c04b3165ef29aca2c488b505fe4ca') {
|
||||
const url = 'https://yzf.qq.com/xv/web/static/chat/index.html?sign=' + sign
|
||||
window.open(url, '_blank')
|
||||
}
|
||||
Vue.prototype.Cookies = storage
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<BaseHeader></BaseHeader>
|
||||
<Search></Search>
|
||||
<drawer></drawer>
|
||||
<ShopHeader v-if="goodsMsg.data" :detail="goodsMsg.data"></ShopHeader>
|
||||
<ShopHeader :detail="storeMsg"></ShopHeader>
|
||||
<div class="shop-item-path">
|
||||
<div class="shop-nav-container">
|
||||
<Breadcrumb>
|
||||
|
@ -11,8 +11,9 @@
|
|||
<BreadcrumbItem v-for="(item, index) in categoryBar" :to="goGoodsList(index)" target="_blank" :key="index">{{item.name}}</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
<div class="store-collect">
|
||||
<span class="mr_10"><router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{goodsMsg.data.storeName}}</router-link></span>
|
||||
<span class="mr_10" v-if="goodsMsg.data"><router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{goodsMsg.data.storeName}}</router-link></span>
|
||||
<span @click="collect" ><Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />{{storeCollected?'已收藏店铺':'收藏店铺'}}</span>
|
||||
<span @click="connectCs(storeMsg.yzfSign)" class="ml_10"><Icon custom="icomoon icon-customer-service" />联系客服</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -40,6 +41,7 @@ import ShowGoodsDetail from '@/components/goodsDetail/ShowGoodsDetail';
|
|||
import ShowLikeGoods from '@/components/like';
|
||||
import { goodsSkuDetail } from '@/api/goods';
|
||||
import { cancelCollect, collectGoods, isCollection } from '@/api/member';
|
||||
import {getDetailById} from '@/api/shopentry'
|
||||
export default {
|
||||
name: 'GoodsDetail',
|
||||
beforeRouteEnter (to, from, next) {
|
||||
|
@ -48,20 +50,15 @@ export default {
|
|||
},
|
||||
created () {
|
||||
this.getGoodsDetail();
|
||||
if (this.Cookies.getItem('userInfo')) {
|
||||
isCollection('STORE', this.goodsMsg.data.storeId).then(res => {
|
||||
if (res.success && res.result) {
|
||||
this.storeCollected = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
goodsMsg: {}, // 商品信息
|
||||
isLoading: false, // 加载状态
|
||||
categoryBar: [], // 分类
|
||||
storeCollected: false // 商品收藏
|
||||
storeCollected: false, // 商品收藏
|
||||
storeMsg: {} // 店铺信息
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -81,8 +78,23 @@ export default {
|
|||
name: cateName[index]
|
||||
});
|
||||
});
|
||||
console.log(cateArr);
|
||||
this.categoryBar = cateArr;
|
||||
this.goodsMsg = res.result;
|
||||
// 判断是否收藏
|
||||
if (this.Cookies.getItem('userInfo')) {
|
||||
isCollection('STORE', this.goodsMsg.data.storeId).then(res => {
|
||||
if (res.success && res.result) {
|
||||
this.storeCollected = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取店铺信息
|
||||
getDetailById(this.goodsMsg.data.storeId).then(res => {
|
||||
if (res.success) {
|
||||
this.storeMsg = res.result
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$Message.error(res.message)
|
||||
this.$router.push('/')
|
||||
|
@ -91,7 +103,7 @@ export default {
|
|||
this.$router.push('/')
|
||||
});
|
||||
},
|
||||
goGoodsList (currIndex) {
|
||||
goGoodsList (currIndex) { // 跳转商品列表
|
||||
const arr = []
|
||||
this.categoryBar.forEach((e, index) => {
|
||||
if (index <= currIndex) {
|
||||
|
@ -132,7 +144,6 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shop-item-path {
|
||||
height: 38px;
|
||||
|
@ -146,6 +157,7 @@ export default {
|
|||
padding: 20px 0;
|
||||
@include white_background_color();
|
||||
}
|
||||
|
||||
.shop-nav-container {
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
<img :src="storeMsg.storeLogo" height="50" alt="">
|
||||
<div>
|
||||
<p>{{storeMsg.storeName || 'xx店铺'}}</p>
|
||||
<p>{{storeMsg.storeDesc || 'xx店铺描述'}}</p>
|
||||
<p v-html="storeMsg.storeDesc"></p>
|
||||
</div>
|
||||
<div class="store-collect" @click="collect"><Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#fff'" />{{storeCollected?'已收藏店铺':'收藏店铺'}}</div>
|
||||
<span class="hover-pointer ml_10" @click="connectCs(storeMsg.yzfSign)"><Icon custom="icomoon icon-customer-service" />联系客服</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="store-category">
|
||||
|
@ -204,7 +205,7 @@ export default {
|
|||
}
|
||||
}
|
||||
.store-collect{
|
||||
margin-left: 20px!important;
|
||||
margin-left: 750px!important;
|
||||
&:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<Search></Search>
|
||||
<cateNav></cateNav>
|
||||
<ul class="category">
|
||||
<li @click="selectCate(cate.id)" v-for="(cate, index) in cateList" :key="index">{{cate.name}}</li>
|
||||
<li @click="selectCate(cate.id)" :class="{'selected-cate': cate.id === params.pointsGoodsCategoryId}" v-for="(cate, index) in cateList" :key="index">{{cate.name}}</li>
|
||||
</ul>
|
||||
<h3 class="promotion-decorate">积分商品</h3>
|
||||
<!-- 列表 -->
|
||||
|
@ -39,6 +39,13 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-size">
|
||||
<Page :total="total" @on-change="changePageNum"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size="params.pageSize"
|
||||
show-sizer>
|
||||
</Page>
|
||||
</div>
|
||||
<BaseFooter></BaseFooter>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -56,7 +63,8 @@ export default {
|
|||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
pointsGoodsCategoryId: ''
|
||||
}
|
||||
},
|
||||
total: 0 // 商品总数
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
@ -69,6 +77,7 @@ export default {
|
|||
pointGoods(this.params).then(res => {
|
||||
if (res.success) {
|
||||
this.goodsList = res.result.records
|
||||
this.total = res.result.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -79,11 +88,27 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
selectCate (id) {
|
||||
selectCate (id) { // 选择商品分类
|
||||
this.params.pointsGoodsCategoryId = id
|
||||
this.getList()
|
||||
this.$router.push({query: {categoryId: id}})
|
||||
}
|
||||
},
|
||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||
let routerUrl = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: {skuId, goodsId, way: 'POINT'}
|
||||
})
|
||||
window.open(routerUrl.href, '_blank')
|
||||
},
|
||||
changePageNum (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) { // 修改页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -104,8 +129,19 @@ export default {
|
|||
margin: 0 10px;
|
||||
&:hover{
|
||||
cursor: pointer;
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
.selected-cate{
|
||||
color: $theme_color;
|
||||
}
|
||||
|
||||
}
|
||||
.page-size {
|
||||
width: 1200px;
|
||||
margin: 10px auto;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.promotion-decorate::before,.promotion-decorate::after{
|
||||
background-image: url('../../static/sprite@2x.png');
|
||||
|
|
|
@ -34,33 +34,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="other-user-buy-box">
|
||||
<div class="other-user-buy-title">
|
||||
<p>可以顺便看下其他商品哦 ~</p>
|
||||
</div>
|
||||
<div class="other-user-buy-row" v-for="(items,index1) in recommend" :key="index1">
|
||||
<div class="other-user-buy-item-box" v-for="(item,index2) in items" :key="index2">
|
||||
<div class="other-user-buy-item-img">
|
||||
<a href="item_detail.html"><img :src="item.img" alt=""></a>
|
||||
</div>
|
||||
<div class="other-buy-detail-box">
|
||||
<div class="other-buy-title">
|
||||
<a href="item_detail.html">
|
||||
<p>{{item.intro}}</p>
|
||||
</a>
|
||||
</div>
|
||||
<div class="other-buy-price">
|
||||
<p>¥{{item.price}}</p>
|
||||
</div>
|
||||
<div class="other-buy-btn-box">
|
||||
<router-link to="/goodsDetail">
|
||||
<button class="other-buy-btn"><Icon type="ios-cart"></Icon> 加入购物车</button>
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<BaseFooter></BaseFooter>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -25,13 +25,6 @@
|
|||
<script>
|
||||
export default {
|
||||
name: 'AccountBind',
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div class="wrapper">
|
||||
<card _Title="账户安全"/>
|
||||
|
||||
<div class="safeList">
|
||||
<!-- 密码 -->
|
||||
<Row class="safeItem">
|
||||
|
@ -16,102 +15,11 @@
|
|||
<Button @click="modifyPwd">修改密码</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
<!-- 邮箱 -->
|
||||
<!-- <Row class="safeItem">
|
||||
<Col :span="2">
|
||||
<Icon size="40" type="md-mail" />
|
||||
</Col>
|
||||
<Col :span="16">
|
||||
<div class="setDivItem">
|
||||
邮箱验证
|
||||
</div>
|
||||
<div class="setDivItem " v-if="true">
|
||||
您的验证邮箱:<span>xxxxx</span>
|
||||
</div>
|
||||
<div class="setDivItem " v-else>
|
||||
|
||||
</div>
|
||||
</Col>
|
||||
<Col :span="4">
|
||||
<Button>修改邮箱</Button>
|
||||
</Col>
|
||||
</Row> -->
|
||||
<!-- 手机验证 -->
|
||||
<!-- <Row class="safeItem">
|
||||
<Col :span="2">
|
||||
<Icon size="40" type="ios-phone-portrait" />
|
||||
</Col>
|
||||
<Col :span="16">
|
||||
<div class="setDivItem">
|
||||
手机验证
|
||||
</div>
|
||||
<div class="setDivItem " v-if="true">
|
||||
您的手机号:<span>xxxxx</span>
|
||||
</div>
|
||||
<div class="setDivItem " v-else>
|
||||
|
||||
</div>
|
||||
</Col>
|
||||
<Col :span="4">
|
||||
<Button>立即验证</Button>
|
||||
</Col>
|
||||
</Row> -->
|
||||
<!-- 支付密码 -->
|
||||
<!-- <Row class="safeItem">
|
||||
<Col :span="2">
|
||||
<Icon size="40" type="md-lock" />
|
||||
</Col>
|
||||
<Col :span="16">
|
||||
<div class="setDivItem">
|
||||
支付密码
|
||||
</div>
|
||||
<div class="setDivItem " v-if="true">
|
||||
安全认证:<span>xxxxx</span>
|
||||
</div>
|
||||
<div class="setDivItem " v-else>
|
||||
|
||||
</div>
|
||||
</Col>
|
||||
<Col :span="4">
|
||||
<Button @click="goModifyPwd" v-if="pwdStatus == '设置密码'" type="error">{{pwdStatus}}</Button>
|
||||
<Dropdown style="margin-left: 20px" v-if="pwdStatus == '修改密码'" @on-click="selectPwd">
|
||||
<Button type="primary">
|
||||
修改密码
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
</Button>
|
||||
<DropdownMenu slot="list" on-click="selectPwd">
|
||||
<DropdownItem name = "1">修改密码</DropdownItem>
|
||||
<DropdownItem name = "2">重置密码</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</Col>
|
||||
</Row> -->
|
||||
<!-- 实名 -->
|
||||
<!-- <Row class="safeItem">
|
||||
<Col :span="2">
|
||||
<Icon size="40" type="md-card" />
|
||||
</Col>
|
||||
<Col :span="16">
|
||||
<div class="setDivItem">
|
||||
实名认证
|
||||
</div>
|
||||
<div class="setDivItem " v-if="true">
|
||||
已认证:<span>xxxxx</span>
|
||||
</div>
|
||||
<div class="setDivItem " v-else>
|
||||
您还未实名认证该账户,立即实名认证可加快提现速度。
|
||||
</div>
|
||||
</Col>
|
||||
<Col :span="4">
|
||||
<Button>立即认证</Button>
|
||||
</Col>
|
||||
</Row> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import card from '@/components/card'
|
||||
import {
|
||||
getPwdStatus
|
||||
} from '@/api/account';
|
||||
|
@ -122,7 +30,6 @@ export default {
|
|||
pwdStatus: '' // 密码状态
|
||||
}
|
||||
},
|
||||
components: {card},
|
||||
mounted () {
|
||||
this.getPwdStatus()
|
||||
},
|
||||
|
@ -131,10 +38,7 @@ export default {
|
|||
goModifyPwd () {
|
||||
this.$router.push({name: 'ModifyPwd', query: { status: 2 }})
|
||||
},
|
||||
selectPwd (value) {
|
||||
this.$router.push({name: 'ModifyPwd', query: { status: value }})
|
||||
},
|
||||
modifyPwd () {
|
||||
modifyPwd () { // 修改密码
|
||||
this.$router.push({name: 'ModifyPwd', query: { status: 1 }})
|
||||
},
|
||||
// 获取密码状态
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<div class="title order-item-title">
|
||||
<span>订单号:{{item.orderNo}}</span>
|
||||
<span class="color999 ml_10">{{item.createTime}}</span>
|
||||
<span class="hover-pointer fontsize_12 eval-detail" @click="evaluate(item.id)">评价详情</span>
|
||||
<span class="hover-pointer fontsize_12 eval-detail" @click="evaluateDetail(item.id)">评价详情</span>
|
||||
</div>
|
||||
<Row class="order-item-view">
|
||||
<i-col span="12" class="item-view-name">
|
||||
|
@ -80,7 +80,7 @@ export default {
|
|||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList () {
|
||||
getList () { // 获取评价列表
|
||||
evolutionList(this.params).then(res => {
|
||||
if (res.success) {
|
||||
const list = res.result.records;
|
||||
|
@ -92,19 +92,16 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
changePageNum (val) {
|
||||
changePageNum (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 修改页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
},
|
||||
changeIndex (index) {
|
||||
console.log(index);
|
||||
},
|
||||
evaluate (id) {
|
||||
evaluateDetail (id) { // 跳转评价详情
|
||||
this.$router.push({path: '/home/evalDetail', query: { id }})
|
||||
}
|
||||
}
|
||||
|
@ -112,6 +109,10 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.page-size {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.order-img {
|
||||
> img {
|
||||
width: 60px;
|
||||
|
|
|
@ -141,23 +141,23 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail () {
|
||||
getDetail () { // 获取投诉详情
|
||||
getComplainDetail(this.$route.query.id).then(res => {
|
||||
if (res.success) this.detail = res.result
|
||||
})
|
||||
},
|
||||
goGoodsDetail (skuId, goodsId) {
|
||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||
let routerUrl = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: {skuId, goodsId}
|
||||
})
|
||||
window.open(routerUrl.href, '_blank')
|
||||
},
|
||||
handleView (name) {
|
||||
handleView (name) { // 预览图片
|
||||
this.previewImage = name;
|
||||
this.visible = true;
|
||||
},
|
||||
// 回复
|
||||
// 回复消息
|
||||
handleSubmit () {
|
||||
if (this.params.content === '') {
|
||||
this.$Message.error('请填写对话内容');
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<div class="title order-item-title">
|
||||
<span>投诉单号:{{item.id}}</span>
|
||||
<span class="color999 ml_10">{{item.createTime}}</span>
|
||||
<span class="hover-pointer fontsize_12 eval-detail" @click="detail(item.id)">投诉详情</span>
|
||||
<span class="hover-pointer fontsize_12 eval-detail" @click="goDetail(item.id)">投诉详情</span>
|
||||
<span class="hover-pointer fontsize_12 eval-detail" style="right: 90px" v-if="item.complainStatus != 'EXPIRED' && item.complainStatus != 'CANCEL'" @click="cancel(item.id)">取消投诉</span>
|
||||
</div>
|
||||
<Row class="order-item-view">
|
||||
|
@ -93,7 +93,7 @@ export default {
|
|||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList () {
|
||||
getList () { // 获取投诉列表
|
||||
complainList(this.params).then(res => {
|
||||
if (res.success) {
|
||||
const list = res.result.records;
|
||||
|
@ -102,16 +102,16 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
changePageNum (val) {
|
||||
changePageNum (val) { // 改变页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 改变页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
},
|
||||
cancel (id) {
|
||||
cancel (id) { // 取消投诉
|
||||
this.$Modal.confirm({
|
||||
title: '取消投诉',
|
||||
content: '<p>确定取消投诉吗?</p>',
|
||||
|
@ -126,7 +126,7 @@ export default {
|
|||
onCancel: () => { }
|
||||
});
|
||||
},
|
||||
detail (id) {
|
||||
goDetail (id) { // 跳转投诉详情
|
||||
this.$router.push({path: '/home/complainDetail', query: { id }})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ export default {
|
|||
this.distribution()
|
||||
},
|
||||
methods: {
|
||||
apply () {
|
||||
apply () { // 申请成为分销商
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.applyLoading = true
|
||||
|
@ -239,10 +239,10 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
qrcodeData (data64) {
|
||||
qrcodeData (data64) { // 二维码base64地址
|
||||
this.base64Img = data64
|
||||
},
|
||||
downloadQrcode () {
|
||||
downloadQrcode () { // 下载二维码
|
||||
let a = document.createElement('a'); // 生成一个a元素
|
||||
let event = new MouseEvent('click'); // 创建一个单击事件
|
||||
a.download = this.goodsNameCurr || 'photo'
|
||||
|
@ -265,11 +265,11 @@ export default {
|
|||
this.getLog()
|
||||
}
|
||||
},
|
||||
changePage (val) {
|
||||
changePage (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getGoodsData()
|
||||
},
|
||||
changePageLog (val) {
|
||||
changePageLog (val) { // 修改页码 日志
|
||||
this.logParams.pageNumber = val;
|
||||
this.getLog()
|
||||
},
|
||||
|
|
|
@ -68,19 +68,19 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
getList () {
|
||||
getList () { // 获取收藏列表
|
||||
this.spinShow = true
|
||||
collectList(this.params).then(res => {
|
||||
this.spinShow = false
|
||||
if (res.success) this.list = res.result.records;
|
||||
})
|
||||
},
|
||||
change (index) {
|
||||
change (index) { // tab栏切换
|
||||
if (index === 0) { this.params.type = 'GOODS' }
|
||||
if (index === 1) { this.params.type = 'SHOP' }
|
||||
this.getList()
|
||||
},
|
||||
cancel (id) {
|
||||
cancel (id) { // 取消收藏
|
||||
let typeName = this.params.type === 'GOODS' ? '商品' : '店铺'
|
||||
this.$Modal.confirm({
|
||||
title: 'Title',
|
||||
|
@ -94,23 +94,23 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
changePageNum (val) {
|
||||
changePageNum (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 修改页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
},
|
||||
buynow (skuId, goodsId) {
|
||||
buynow (skuId, goodsId) { // 跳转详情
|
||||
let url = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: {skuId, goodsId}
|
||||
})
|
||||
window.open(url.href, '_blank')
|
||||
},
|
||||
goShop (id) {
|
||||
goShop (id) { // 跳转店铺页面
|
||||
let url = this.$router.resolve({
|
||||
path: '/merchant',
|
||||
query: {id}
|
||||
|
|
|
@ -78,12 +78,12 @@ export default {
|
|||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList () {
|
||||
getList () { // 获取发票列表
|
||||
receiptList().then(res => {
|
||||
this.list = res.result.records;
|
||||
})
|
||||
},
|
||||
save () {
|
||||
save () { // 保存发票
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
|
@ -105,7 +105,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
resetData () {
|
||||
resetData () { // 重置表单数据
|
||||
this.$refs.form.resetFields();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ export default {
|
|||
againPassword: '',
|
||||
newPassword: ''
|
||||
},
|
||||
ruleInLines: {
|
||||
ruleInLines: { // 验证规则
|
||||
picture: [
|
||||
{required: true, message: '请输入图片验证码', trigger: 'blur'}
|
||||
],
|
||||
|
@ -107,7 +107,7 @@ export default {
|
|||
{required: true, message: '请输入短信验证码', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
ruleIn: {
|
||||
ruleIn: { // 验证规则
|
||||
newPassword: [
|
||||
{required: true, message: '请输入新密码', trigger: 'blur'},
|
||||
{type: 'string', min: 6, message: '密码不能少于6位'}
|
||||
|
@ -117,7 +117,7 @@ export default {
|
|||
{type: 'string', min: 6, message: '密码不能少于6位'}
|
||||
]
|
||||
},
|
||||
ruleInline: {
|
||||
ruleInline: { // 验证规则
|
||||
password: [
|
||||
{required: true, message: '请输入旧密码', trigger: 'blur'}
|
||||
],
|
||||
|
|
|
@ -63,7 +63,7 @@ export default {
|
|||
this.getPoint()
|
||||
},
|
||||
methods: {
|
||||
getHistory () {
|
||||
getHistory () { // 获取积分历史
|
||||
memberPointHistory(this.params).then(res => {
|
||||
this.logData = res.result;
|
||||
})
|
||||
|
@ -73,11 +73,11 @@ export default {
|
|||
if (res.success) this.pointObj = res.result
|
||||
})
|
||||
},
|
||||
changePage (val) {
|
||||
changePage (val) { // 修改页码
|
||||
this.pageNumber = val
|
||||
this.getHistory()
|
||||
},
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 修改页数
|
||||
this.param.pageSize = val
|
||||
this.params.pageNumber = 1
|
||||
this.getHistory()
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<Upload
|
||||
:show-upload-list="false"
|
||||
:on-success="handleSuccess"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:format="['jpg','jpeg','png']"
|
||||
:action="action"
|
||||
:headers="accessToken"
|
||||
|
@ -58,7 +57,7 @@ export default {
|
|||
this.accessToken.accessToken = storage.getItem('accessToken');
|
||||
},
|
||||
methods: {
|
||||
save () {
|
||||
save () { // 保存
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
let params = {
|
||||
|
@ -76,10 +75,9 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
handleSuccess (res, file) {
|
||||
handleSuccess (res, file) { // 上传成功
|
||||
this.$set(this.formItem, 'face', res.result)
|
||||
},
|
||||
handleBeforeUpload () {}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getOrderDetail () {
|
||||
getOrderDetail () { // 获取订单详情
|
||||
orderDetail(this.$route.query.sn).then(res => {
|
||||
this.order = res.result
|
||||
this.orderGoods = res.result.orderItems[this.$route.query.index]
|
||||
|
@ -96,7 +96,7 @@ export default {
|
|||
this.orderGoods.uploadList = []
|
||||
})
|
||||
},
|
||||
save () {
|
||||
save () { // 保存评价
|
||||
if (!this.form.serviceScore || !this.form.deliveryScore) {
|
||||
this.$Message.warning('物流服务评价不能为空')
|
||||
return false;
|
||||
|
@ -129,26 +129,26 @@ export default {
|
|||
this.loading = false;
|
||||
})
|
||||
},
|
||||
goGoodsDetail (skuId, goodsId) {
|
||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||
let routerUrl = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: {skuId, goodsId}
|
||||
})
|
||||
window.open(routerUrl.href, '_blank')
|
||||
},
|
||||
handleView (name) {
|
||||
handleView (name) { // 预览图片
|
||||
this.previewImage = name;
|
||||
this.visible = true;
|
||||
},
|
||||
handleRemove (index) {
|
||||
handleRemove (index) { // 移除图片
|
||||
this.orderGoods.uploadList.splice(index, 1)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
handleSuccess (res, file) {
|
||||
handleSuccess (res, file) { // 上传成功回调
|
||||
this.orderGoods.uploadList.push(res.result)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
handleBeforeUpload () {
|
||||
handleBeforeUpload () { // 上传之前钩子
|
||||
const check = this.orderGoods.uploadList.length < 10;
|
||||
if (!check) {
|
||||
this.$Notice.warning({
|
||||
|
|
|
@ -65,19 +65,19 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail () {
|
||||
getDetail () { // 获取评价详情
|
||||
evaluationDetail(this.$route.query.id).then(res => {
|
||||
if (res.success) this.orderGoods = res.result
|
||||
})
|
||||
},
|
||||
goGoodsDetail (skuId, goodsId) {
|
||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||
let routerUrl = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: {skuId, goodsId}
|
||||
})
|
||||
window.open(routerUrl.href, '_blank')
|
||||
},
|
||||
handleView (name) {
|
||||
handleView (name) { // 预览图片
|
||||
this.previewImage = name;
|
||||
this.visible = true;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<template>
|
||||
<div class="msg-list">
|
||||
会员消息详情
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
detail: {}, // 消息详情
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,41 @@
|
|||
<template>
|
||||
<div class="msg-list">
|
||||
<card _Title="我的消息" :_Tabs="status" :_Size="16" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {memberMsgList, readMemberMsg, delMemberMsg} from '@/api/member.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [], // 会员列表
|
||||
status: ['未读', '已读', '回收站'],
|
||||
params: { // 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
status: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList () { // 获取消息列表
|
||||
memberMsgList(this.params).then(res => {
|
||||
if (res.success) {
|
||||
this.list = res.result.records;
|
||||
}
|
||||
})
|
||||
},
|
||||
setRead (id) { // 设置消息已读
|
||||
readMemberMsg(id).then(res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
|
@ -79,7 +79,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
save () {
|
||||
save () { // 保存地址
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.formData));
|
||||
|
|
|
@ -133,7 +133,7 @@ export default {
|
|||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
},
|
||||
getList () {
|
||||
getList () { // 获取售后列表
|
||||
this.spinShow = true;
|
||||
let params = JSON.parse(JSON.stringify(this.params))
|
||||
afterSaleList(params).then(res => {
|
||||
|
@ -144,11 +144,11 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
changePageNum (val) {
|
||||
changePageNum (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 修改页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
|
|
|
@ -75,7 +75,7 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
getLog () {
|
||||
getLog () { // 获取售后日志
|
||||
afterSaleLog(this.$route.query.sn).then(res => {
|
||||
this.logList = res.result;
|
||||
})
|
||||
|
|
|
@ -139,7 +139,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getInfo () {
|
||||
getInfo () { // 获取售后信息
|
||||
afterSaleInfo(this.$route.query.sn).then(res => {
|
||||
if (res.success) {
|
||||
this.info = res.result
|
||||
|
@ -147,15 +147,15 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
getReason (type) {
|
||||
getReason (type) { // 获取售后原因
|
||||
afterSaleReason(type).then(res => {
|
||||
if (res.success) this.reasonList = res.result
|
||||
})
|
||||
},
|
||||
changeReason (type) {
|
||||
changeReason (type) { // 改变售后原因列表
|
||||
this.getReason(type)
|
||||
},
|
||||
apply () {
|
||||
apply () { // 售后申请提交
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
let params = Object.assign(this.info, this.form)
|
||||
|
@ -170,19 +170,19 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
handleView (name) {
|
||||
handleView (name) { // 预览图片
|
||||
this.previewImage = name;
|
||||
this.visible = true;
|
||||
},
|
||||
handleRemove (index) {
|
||||
handleRemove (index) { // 移除图片
|
||||
this.uploadList.splice(index, 1)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
handleSuccess (res, file) {
|
||||
handleSuccess (res, file) { // 上传成功回调
|
||||
this.uploadList.push(res.result)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
handleBeforeUpload () {
|
||||
handleBeforeUpload () { // 上传之前钩子函数
|
||||
const check = this.uploadList.length < 6;
|
||||
if (!check) {
|
||||
this.$Notice.warning({
|
||||
|
|
|
@ -78,7 +78,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getOrderDetail () {
|
||||
getOrderDetail () { // 获取订单详情
|
||||
orderDetail(this.$route.query.sn).then(res => {
|
||||
this.order = res.result
|
||||
this.orderGoods = res.result.orderItems[this.$route.query.index]
|
||||
|
@ -92,7 +92,7 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
save () {
|
||||
save () { // 提交投诉信息
|
||||
let params = {
|
||||
goodsId: this.orderGoods.goodsId,
|
||||
complainTopic: this.form.complainTopic,
|
||||
|
@ -108,26 +108,26 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
goGoodsDetail (skuId, goodsId) {
|
||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||
let routerUrl = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: {skuId, goodsId}
|
||||
})
|
||||
window.open(routerUrl.href, '_blank')
|
||||
},
|
||||
handleView (name) {
|
||||
handleView (name) { // 预览图片
|
||||
this.previewImage = name;
|
||||
this.visible = true;
|
||||
},
|
||||
handleRemove (index) {
|
||||
handleRemove (index) { // 移除图片
|
||||
this.orderGoods.uploadList.splice(index, 1)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
handleSuccess (res, file) {
|
||||
handleSuccess (res, file) { // 上传成功回调
|
||||
this.orderGoods.uploadList.push(res.result)
|
||||
this.$forceUpdate()
|
||||
},
|
||||
handleBeforeUpload () {
|
||||
handleBeforeUpload () { // 上传之前钩子函数
|
||||
const check = this.orderGoods.uploadList.length < 6;
|
||||
if (!check) {
|
||||
this.$Notice.warning({
|
||||
|
|
|
@ -240,7 +240,7 @@ export default {
|
|||
complainResult (sn) { // 投诉结果
|
||||
|
||||
},
|
||||
delOrder (sn) {
|
||||
delOrder (sn) { // 删除订单
|
||||
this.$Modal.confirm({
|
||||
title: '删除订单',
|
||||
content: '<p>确认删除当前订单吗?</p>',
|
||||
|
@ -255,7 +255,7 @@ export default {
|
|||
onCancel: () => {}
|
||||
});
|
||||
},
|
||||
getList () {
|
||||
getList () { // 获取订单列表
|
||||
this.spinShow = true;
|
||||
let params = JSON.parse(JSON.stringify(this.params))
|
||||
if (params.orderStatus === 'ALL') {
|
||||
|
@ -269,11 +269,11 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
changePageNum (val) {
|
||||
changePageNum (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) {
|
||||
changePageSize (val) { // 修改页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
|
@ -289,7 +289,7 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
sureCancel () {
|
||||
sureCancel () { // 确定取消
|
||||
cancelOrder(this.cancelParams).then(res => {
|
||||
if (res.success) {
|
||||
this.$Message.success('取消订单成功')
|
||||
|
|
|
@ -128,7 +128,7 @@ export default {
|
|||
}
|
||||
})
|
||||
},
|
||||
traces () {
|
||||
traces () { // 物流信息
|
||||
getTraces(this.$route.query.sn).then(res => {
|
||||
if (res.success) {
|
||||
this.logistics = res.result
|
||||
|
|
|
@ -41,6 +41,11 @@ const member = [{
|
|||
title: '账户安全',
|
||||
path: 'AccountSafe'
|
||||
},
|
||||
{
|
||||
icon: '',
|
||||
title: '我的消息',
|
||||
path: 'MsgList'
|
||||
},
|
||||
{
|
||||
icon: '',
|
||||
title: '我的足迹',
|
||||
|
|
|
@ -1,53 +1,58 @@
|
|||
// import Vue from 'vue';
|
||||
import axios from 'axios';
|
||||
import https from 'https';
|
||||
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';
|
||||
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);
|
||||
import axios from "axios";
|
||||
import https from "https";
|
||||
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";
|
||||
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;
|
||||
// 创建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;
|
||||
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';
|
||||
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'
|
||||
arrayFormat: "repeat"
|
||||
});
|
||||
}
|
||||
/** 配置全屏加载 */
|
||||
|
@ -55,23 +60,74 @@ service.interceptors.request.use(config => {
|
|||
config.loading = Spin.show();
|
||||
}
|
||||
|
||||
const uuid = Storage.getItem('uuid');
|
||||
config.headers['uuid'] = uuid;
|
||||
const uuid = Storage.getItem("uuid");
|
||||
config.headers["uuid"] = uuid;
|
||||
|
||||
// 获取访问Token
|
||||
let accessToken = Storage.getItem('accessToken');
|
||||
let accessToken = Storage.getItem("accessToken");
|
||||
if (accessToken && config.needToken) {
|
||||
config.headers['accessToken'] = accessToken;
|
||||
config.headers["accessToken"] = accessToken;
|
||||
// 解析当前token时间
|
||||
let jwtData = JSON.parse(
|
||||
decodeURIComponent(escape(window.atob(accessToken.split(".")[1])))
|
||||
);
|
||||
if (jwtData.exp < Math.round(new Date() / 1000)) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
}, error => {
|
||||
},
|
||||
error => {
|
||||
Promise.reject(error);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 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(() => {
|
||||
|
@ -145,13 +171,13 @@ const closeLoading = (target) => {
|
|||
};
|
||||
|
||||
export const Method = {
|
||||
GET: 'get',
|
||||
POST: 'post',
|
||||
PUT: 'put',
|
||||
DELETE: 'delete'
|
||||
GET: "get",
|
||||
POST: "post",
|
||||
PUT: "put",
|
||||
DELETE: "delete"
|
||||
};
|
||||
|
||||
export default function request (options) {
|
||||
export default function request(options) {
|
||||
// 如果是服务端或者是请求的刷新token,不需要检查token直接请求。
|
||||
// if (process.server || options.url.indexOf('passport/token') !== -1) {
|
||||
return service(options);
|
||||
|
@ -160,47 +186,46 @@ export default function request (options) {
|
|||
}
|
||||
|
||||
// 防抖闭包来一波
|
||||
function getTokenDebounce () {
|
||||
let lock = false
|
||||
let success = false
|
||||
return function () {
|
||||
function getTokenDebounce() {
|
||||
let lock = false;
|
||||
let success = false;
|
||||
return function() {
|
||||
if (!lock) {
|
||||
lock = true
|
||||
let oldRefreshToken = Storage.getItem('refreshToken');
|
||||
handleRefreshToken(oldRefreshToken).then(res => {
|
||||
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);
|
||||
let { accessToken, refreshToken } = res.result;
|
||||
Storage.setItem("accessToken", accessToken);
|
||||
Storage.setItem("refreshToken", refreshToken);
|
||||
|
||||
success = true
|
||||
lock = false
|
||||
success = true;
|
||||
lock = false;
|
||||
} else {
|
||||
success = false
|
||||
lock = false
|
||||
success = false;
|
||||
lock = false;
|
||||
// router.push('/login')
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
success = false
|
||||
lock = false
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
success = false;
|
||||
lock = false;
|
||||
});
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
// 一直看lock,直到请求失败或者成功
|
||||
const timer = setInterval(() => {
|
||||
if (!lock) {
|
||||
clearInterval(timer)
|
||||
clearInterval(timer);
|
||||
if (success) {
|
||||
resolve('success')
|
||||
resolve("success");
|
||||
} else {
|
||||
resolve('fail')
|
||||
resolve("fail");
|
||||
}
|
||||
}
|
||||
}, 500) // 轮询时间间隔
|
||||
})
|
||||
}
|
||||
}, 500); // 轮询时间间隔
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ const ComplainList = resolve => require(['@/pages/home/memberCenter/ComplainList
|
|||
const ComplainDetail = resolve => require(['@/pages/home/memberCenter/ComplainDetail'], resolve);
|
||||
const Invoice = resolve => require(['@/pages/home/memberCenter/Invoice'], resolve);
|
||||
const Point = resolve => require(['@/pages/home/memberCenter/Point'], resolve);
|
||||
const MsgList = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgList'], resolve);
|
||||
const MsgDetail = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgDetail'], resolve);
|
||||
|
||||
/*
|
||||
* 会员中心
|
||||
|
@ -316,6 +318,18 @@ export default new Router({
|
|||
name: 'AddAddress',
|
||||
component: AddAddress
|
||||
},
|
||||
{
|
||||
path: 'MsgList',
|
||||
name: 'MsgList',
|
||||
component: MsgList,
|
||||
meta: {title: '我的消息'}
|
||||
},
|
||||
{
|
||||
path: 'MsgDetail',
|
||||
name: 'MsgDetail',
|
||||
component: MsgDetail,
|
||||
meta: {title: '我的消息'}
|
||||
},
|
||||
{
|
||||
path: 'MyOrder',
|
||||
name: 'MyOrder',
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
"print-js": "^1.0.63",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"quill": "^1.3.7",
|
||||
"vue-qr": "^2.3.0",
|
||||
"sass-loader": "^8.0.2",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
|
@ -40,14 +39,17 @@
|
|||
"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.5.3",
|
||||
"xlsx": "^0.16.2",
|
||||
"xss": "^1.0.7"
|
||||
"xss": "^1.0.7",
|
||||
"uuid": "^8.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.4.4",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {v4 as uuidv4} from 'uuid';
|
||||
import {getCategoryTree} from '@/api/goods.js'
|
||||
export default {
|
||||
updated() {
|
||||
|
@ -15,7 +16,14 @@ export default {
|
|||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let uuid = this.getStore('uuid');
|
||||
if (!uuid) {
|
||||
uuid = uuidv4();
|
||||
this.setStore('uuid', uuid);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {commonUrl, getRequest} from '@/libs/axios';
|
||||
import {commonUrl, getRequest, getRequestWithNoToken, postRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
// 通过id获取子地区
|
||||
export const getChildRegion = (id) => {
|
||||
|
@ -6,6 +6,16 @@ export const getChildRegion = (id) => {
|
|||
};
|
||||
|
||||
// 点地图获取地址信息
|
||||
export const getRegion = (parpams) => {
|
||||
return getRequest(`${commonUrl}/common/region/region`, parpams);
|
||||
export const getRegion = (params) => {
|
||||
return getRequest(`${commonUrl}/common/region/region`, params);
|
||||
};
|
||||
|
||||
// 获取拼图验证
|
||||
export const getVerifyImg = (verificationEnums) => {
|
||||
return getRequestWithNoToken(`${commonUrl}/common/slider/${verificationEnums}`);
|
||||
};
|
||||
|
||||
// 拼图验证
|
||||
export const postVerifyImg = (params) => {
|
||||
return postRequestWithNoToken(`${commonUrl}/common/slider/${params.verificationEnums}`, params);
|
||||
};
|
||||
|
|
|
@ -86,4 +86,9 @@ export const getMemberFeedbackDetail = (id) => {
|
|||
return getRequest(`/feedback/${id}`);
|
||||
};
|
||||
|
||||
//管理员获取发送详情列表
|
||||
export const getMemberMessage = (params) => {
|
||||
return getRequest(`/message/member`, params);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,174 +1,231 @@
|
|||
// 统一请求路径前缀在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 putRequest(`/broadcast/studio/recommend/${params.id}`,params);
|
||||
};
|
||||
|
||||
// 添加优惠券活动
|
||||
export const addCouponActivity = params => {
|
||||
return postRequest(`/promotion/couponActivity/addCouponActivity`, params);
|
||||
};
|
||||
|
||||
|
||||
// 获取店铺直播间列表
|
||||
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 saveActivityCoupon = params => {
|
||||
return postRequest("/promotion/couponActivity", params, {
|
||||
"Content-type": "application/json"
|
||||
});
|
||||
};
|
||||
// 获取活动优惠券列表
|
||||
export const getActivityCouponList = params => {
|
||||
return getRequest("/promotion/couponActivity/activityCoupons", params);
|
||||
};
|
||||
// 获取平台优惠券活动
|
||||
export const getCouponActivityList = params => {
|
||||
return getRequest("/promotion/couponActivity", params);
|
||||
};
|
||||
// 作废优惠券
|
||||
export const closeActivity = id => {
|
||||
return deleteRequest(`/promotion/couponActivity/${id}`);
|
||||
};
|
||||
// 更新优惠券活动
|
||||
export const updateCouponActivity = params => {
|
||||
return putRequest(`/promotion/couponActivity/status`, params);
|
||||
};
|
||||
// 获取单个优惠券活动
|
||||
export const getCouponActivity = id => {
|
||||
return getRequest(`/promotion/couponActivity/${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}`);
|
||||
};
|
||||
|
|
|
@ -24,6 +24,8 @@ service.interceptors.request.use(
|
|||
...config.params
|
||||
}
|
||||
}
|
||||
const uuid = getStore('uuid');
|
||||
config.headers['uuid'] = uuid;
|
||||
return config;
|
||||
},
|
||||
err => {
|
||||
|
|
|
@ -5,7 +5,7 @@ export const loginRouter = {
|
|||
path: "/login",
|
||||
name: "login",
|
||||
meta: {
|
||||
title: "登录 - lili "
|
||||
title: "登录 - lili运营后台"
|
||||
},
|
||||
component: () => import("@/views/login.vue")
|
||||
};
|
||||
|
@ -243,6 +243,43 @@ export const otherRouter = {
|
|||
name: "platform-coupon-info",
|
||||
component: () => import("@/views/promotion/coupon/couponInfo.vue")
|
||||
},
|
||||
{
|
||||
path: "coupon-activity/add",
|
||||
title: "添加优惠券活动",
|
||||
name: "add-coupon-activity",
|
||||
component: () => import("@/views/promotion/couponActivity/couponPublish.vue")
|
||||
},
|
||||
{
|
||||
path: "coupon-activity/edit",
|
||||
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: "领取详情",
|
||||
name: "member-coupon-activity",
|
||||
component: () =>
|
||||
import("@/views/promotion/coupon/memberReceiveCoupon.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/platform-coupon-info",
|
||||
title: "详情",
|
||||
name: "platform-coupon-activity",
|
||||
component: () => import("@/views/promotion/coupon/couponInfo.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/add-coupon-specify",
|
||||
title: "精准发劵",
|
||||
name: "add-coupon-specify",
|
||||
component: () => import("@/views/promotion/coupon/couponSpecify.vue")
|
||||
},
|
||||
{
|
||||
path: "promotion/manager-pintuan",
|
||||
title: "平台拼团",
|
||||
|
@ -296,6 +333,12 @@ export const otherRouter = {
|
|||
title: "短信签名",
|
||||
name: "add-sms-sign",
|
||||
component: () => import("@/views/sys/message/smsSign.vue")
|
||||
},
|
||||
{
|
||||
path: "liveDetail",
|
||||
title: "查看直播",
|
||||
name: "liveDetail",
|
||||
component: () => import("@/views/promotion/live/liveDetail.vue")
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -10,22 +10,30 @@
|
|||
<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 {
|
||||
export default {
|
||||
name: "distributionSetting",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
form: { // 添加或编辑表单对象初始化数据
|
||||
isOpen: ""
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
isOpen: "",
|
||||
distributionDay: "", //分销关系绑定天数
|
||||
cashDay: "", //分销结算天数
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
|
@ -33,7 +41,7 @@
|
|||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
data: [], // 表单数据
|
||||
total: 0 // 表单数据总数
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -43,7 +51,7 @@
|
|||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getSetting("DISTRIBUTION_SETTING").then(res => {
|
||||
getSetting("DISTRIBUTION_SETTING").then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.form = res.result;
|
||||
|
@ -52,25 +60,27 @@
|
|||
this.loading = false;
|
||||
},
|
||||
handleSubmit() {
|
||||
|
||||
this.$refs.form.validate(valid => {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
setSetting("DISTRIBUTION_SETTING", this.form).then(res => {
|
||||
// 防抖处理一下
|
||||
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>
|
||||
|
|
|
@ -211,10 +211,8 @@
|
|||
import { homeStatistics, hotGoods, hotShops, getNoticePage } from "@/api/index";
|
||||
import show from "./show.vue";
|
||||
import * as API_Goods from "@/api/goods";
|
||||
|
||||
import { Chart } from "@antv/g2";
|
||||
import * as API_Member from "@/api/member";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "home",
|
||||
components: {
|
||||
|
@ -502,11 +500,13 @@ export default {
|
|||
let data = this.chartList;
|
||||
|
||||
data.forEach((item) => {
|
||||
|
||||
item.title = "历史在线人数";
|
||||
item.date = item.date.substring(5)
|
||||
|
||||
});
|
||||
this.historyMemberChart.data(data);
|
||||
|
||||
console.error(data)
|
||||
this.historyMemberChart.tooltip({
|
||||
showCrosshairs: true,
|
||||
shared: true,
|
||||
|
|
|
@ -0,0 +1,246 @@
|
|||
<template>
|
||||
<div class="wrapper">
|
||||
<div class="wap-content">
|
||||
<div class="query-wrapper">
|
||||
<div class="query-item">
|
||||
<div>搜索范围</div>
|
||||
<Input placeholder="商品名称" @on-clear="goodsData=[]; goodsParams.goodsName=''; goodsParams.pageNumber = 1; getQueryGoodsList()" @on-enter="()=>{goodsData=[];goodsParams.pageNumber =1; getQueryGoodsList();}" icon="ios-search" clearable
|
||||
style="width: 150px" v-model="goodsParams.goodsName" />
|
||||
</div>
|
||||
<div class="query-item">
|
||||
<Cascader v-model="category" placeholder="请选择商品分类" style="width: 250px" :data="skuList"></Cascader>
|
||||
</div>
|
||||
<div class="query-item">
|
||||
<Button type="primary" @click="goodsData=[]; getQueryGoodsList();" icon="ios-search">搜索</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="positon:retavle;">
|
||||
<Scroll class="wap-content-list" :on-reach-bottom="handleReachBottom" :distance-to-edge="[3,3]">
|
||||
<div class="wap-content-item" :class="{ active: item.selected }" @click="checkedGoods(item, index)" v-for="(item, index) in goodsData" :key="index">
|
||||
<div>
|
||||
<img :src="item.thumbnail" alt="" />
|
||||
</div>
|
||||
<div class="wap-content-desc">
|
||||
<div class="wap-content-desc-title">{{ item.goodsName }}</div>
|
||||
<div class="wap-sku">{{ item.goodsUnit }}</div>
|
||||
<div class="wap-content-desc-bottom">
|
||||
<div>¥{{ item.price | unitPrice }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Spin size="large" fix v-if="loading"></Spin>
|
||||
|
||||
<div v-if="empty" class="empty">暂无商品信息</div>
|
||||
</Scroll>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as API_Goods from "@/api/goods";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: "multiple", //单选或者多选 single multiple
|
||||
|
||||
skuList: [], // 商品sku列表
|
||||
total: "", // 商品总数
|
||||
goodsParams: { // 商品请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 18,
|
||||
order: "desc",
|
||||
goodsName: "",
|
||||
sn: "",
|
||||
categoryPath: "",
|
||||
marketEnable: "UPPER",
|
||||
isAuth: "PASS",
|
||||
},
|
||||
category: [], // 分类
|
||||
goodsData: [], // 商品数据
|
||||
empty: false, // 空数据
|
||||
loading: false, // 加载状态
|
||||
};
|
||||
},
|
||||
props: {
|
||||
selectedWay: {
|
||||
type: Array,
|
||||
default: new Array()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
category(val) {
|
||||
this.goodsParams.categoryPath = val[0];
|
||||
},
|
||||
selectedWay: {
|
||||
handler() {
|
||||
this.$emit("selected", this.selectedWay);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
|
||||
"goodsParams.categoryPath": {
|
||||
handler: function () {
|
||||
this.goodsData = [];
|
||||
(this.goodsParams.pageNumber = 0), this.getQueryGoodsList();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
handleReachBottom() {
|
||||
setTimeout(() => {
|
||||
if (
|
||||
this.goodsParams.pageNumber * this.goodsParams.pageSize <=
|
||||
this.total
|
||||
) {
|
||||
this.goodsParams.pageNumber++;
|
||||
this.getQueryGoodsList();
|
||||
}
|
||||
}, 1500);
|
||||
},
|
||||
getQueryGoodsList() {
|
||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
||||
this.initGoods(res);
|
||||
});
|
||||
},
|
||||
|
||||
initGoods(res) {
|
||||
if (res.result.records.length !=0) {
|
||||
res.result.records.forEach((item) => {
|
||||
item.selected = false;
|
||||
item.___type = "goods"; //设置为goods让pc wap知道标识
|
||||
|
||||
this.selectedWay.forEach(e => {
|
||||
if (e.id === item.id) {
|
||||
item.selected = true
|
||||
}
|
||||
})
|
||||
});
|
||||
/**
|
||||
* 解决数据请求中,滚动栏会一直上下跳动
|
||||
*/
|
||||
this.total = res.result.total;
|
||||
this.goodsData.push(...res.result.records);
|
||||
|
||||
} else {
|
||||
this.empty = true;
|
||||
}
|
||||
},
|
||||
// 查询商品
|
||||
init() {
|
||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
||||
// 商品
|
||||
this.initGoods(res);
|
||||
});
|
||||
if (localStorage.getItem('category')) {
|
||||
this.deepGroup(JSON.parse(localStorage.getItem('category')))
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.deepGroup(JSON.parse(localStorage.getItem('category')))
|
||||
},3000)
|
||||
}
|
||||
},
|
||||
|
||||
deepGroup(val) {
|
||||
val.forEach((item) => {
|
||||
let childWay = []; //第二级
|
||||
// 第二层
|
||||
if (item.children) {
|
||||
item.children.forEach((child) => {
|
||||
// // 第三层
|
||||
if (child.children) {
|
||||
child.children.forEach((grandson, index, arr) => {
|
||||
arr[index] = {
|
||||
value: grandson.id,
|
||||
label: grandson.name,
|
||||
children: "",
|
||||
};
|
||||
});
|
||||
}
|
||||
let children = {
|
||||
value: child.id,
|
||||
label: child.name,
|
||||
children: child.children,
|
||||
};
|
||||
childWay.push(children);
|
||||
});
|
||||
}
|
||||
// 第一层
|
||||
let way = {
|
||||
value: item.id,
|
||||
label: item.name,
|
||||
children: childWay,
|
||||
};
|
||||
|
||||
this.skuList.push(way);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击商品
|
||||
*/
|
||||
checkedGoods(val, index) {
|
||||
// 如果单选的话
|
||||
if (this.type != "multiple") {
|
||||
this.goodsData.forEach((item) => {
|
||||
item.selected = false;
|
||||
});
|
||||
this.selectedWay = [];
|
||||
val.selected = true;
|
||||
this.selectedWay.push(val);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (val.selected == false) {
|
||||
val.selected = true;
|
||||
this.selectedWay.push(val);
|
||||
} else {
|
||||
val.selected = false;
|
||||
for (let i = 0; i<this.selectedWay.length; i++ ) {
|
||||
if (this.selectedWay[i].id===val.id) {
|
||||
this.selectedWay.splice(i,1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "./style.scss";
|
||||
.wap-content {
|
||||
width: 100%;
|
||||
}
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 8px 0;
|
||||
width: 100%;
|
||||
}
|
||||
.wap-content {
|
||||
flex: 1;
|
||||
padding: 0;
|
||||
}
|
||||
.wap-content-list {
|
||||
position: relative;
|
||||
}
|
||||
.wap-content-item {
|
||||
width: 210px;
|
||||
margin: 10px 7px;
|
||||
padding: 6px 0;
|
||||
}
|
||||
// .wap-content-item{
|
||||
|
||||
// }
|
||||
.active {
|
||||
background: url("../../assets/selected.png") no-repeat;
|
||||
background-position: right;
|
||||
background-size: 10%;
|
||||
}
|
||||
</style>
|
|
@ -14,10 +14,12 @@
|
|||
<script>
|
||||
import goodsDialog from "./goods-dialog";
|
||||
import linkDialog from "./link-dialog";
|
||||
import couponDialog from "./coupon-dialog";
|
||||
export default {
|
||||
components: {
|
||||
goodsDialog,
|
||||
linkDialog,
|
||||
couponDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -1,254 +0,0 @@
|
|||
<template>
|
||||
<div class="floor-list">
|
||||
<div class="list">
|
||||
<div class="template-saved" v-for="item in templateList" :key="item.id">
|
||||
<div class="template-title">
|
||||
<span>{{ item.name }}</span>
|
||||
<span :class="{ 'theme-color': item.pageShow == 'OPEN' }">{{
|
||||
item.pageShow == "OPEN" ? "已发布" : "未发布"
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="template-content">
|
||||
<!-- <img :src="item.img || require(`@/assets/img-error.png`)" alt=""> -->
|
||||
<div class="cover">
|
||||
<Button icon="md-color-palette" @click="decorate(item.id)"
|
||||
>装修</Button
|
||||
>
|
||||
<Button icon="md-pricetags" @click="Template(item)">编辑</Button>
|
||||
<Button
|
||||
icon="md-send"
|
||||
v-if="item.pageShow == 'CLOSE'"
|
||||
@click="releaseTemplate(item.id)"
|
||||
>发布</Button
|
||||
>
|
||||
<Button
|
||||
icon="md-trash"
|
||||
v-if="item.pageShow == 'CLOSE'"
|
||||
@click="delTemplate(item.id)"
|
||||
>删除</Button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="new-template" @click="createTemp">
|
||||
<Icon type="md-add" />
|
||||
<div>新建模板</div>
|
||||
</div>
|
||||
</div>
|
||||
<Modal
|
||||
v-model="showModal"
|
||||
title="模板设置"
|
||||
draggable
|
||||
width="600"
|
||||
:z-index="100"
|
||||
:loading="loading"
|
||||
mask-closable="false"
|
||||
@on-ok="newTemplate"
|
||||
@on-cancel="showModal = false"
|
||||
>
|
||||
<Form ref="form" :model="formData" :rules="rules" :label-width="80">
|
||||
<FormItem label="模板名称" prop="name">
|
||||
<Input v-model="formData.name" placeholder="请输入模板名称" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as API_floor from "@/api/other.js";
|
||||
export default {
|
||||
name: "floorList",
|
||||
data() {
|
||||
return {
|
||||
showModal: false,
|
||||
templateList: [],
|
||||
formData: {
|
||||
status: false,
|
||||
name: "",
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入模板名称", trigger: "blur" }],
|
||||
},
|
||||
loading: true,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let height = window.innerHeight - 150;
|
||||
document.querySelector(".floor-list").style.height = height + "px";
|
||||
this.getTemplateList();
|
||||
},
|
||||
methods: {
|
||||
newTemplate() {
|
||||
// 添加,编辑模板
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const data = this.formData;
|
||||
data.status ? (data.pageShow = "OPEN") : (data.pageShow = "CLOSE");
|
||||
delete data.status;
|
||||
(data.pageType = "INDEX"), (data.pageClientType = "PC");
|
||||
if (data.id) {
|
||||
API_floor.updateHome(data.id, data).then((res) => {
|
||||
this.$Message.success("编辑模板成功");
|
||||
this.showModal = false;
|
||||
this.getTemplateList();
|
||||
});
|
||||
} else {
|
||||
API_floor.setHomeSetup(data).then((res) => {
|
||||
this.$Message.success("新建模板成功");
|
||||
this.showModal = false;
|
||||
this.getTemplateList();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
createTemp() {
|
||||
// 新建表单
|
||||
this.$refs.form.resetFields();
|
||||
this.showModal = true;
|
||||
},
|
||||
|
||||
Template(item) {
|
||||
// 编辑表单
|
||||
item.pageShow == "OPEN" ? (item.status = true) : (item.status = false);
|
||||
this.formData = item;
|
||||
this.showModal = true;
|
||||
},
|
||||
|
||||
decorate(id) {
|
||||
// 装修
|
||||
this.$router.push({ name: "renovation", query: { id: id } });
|
||||
},
|
||||
|
||||
getTemplateList() {
|
||||
//模板列表
|
||||
let params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 999,
|
||||
pageType: "INDEX",
|
||||
pageClientType: "PC",
|
||||
};
|
||||
API_floor.getHomeList(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.templateList = res.result.records;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
releaseTemplate(id) {
|
||||
//发布模板
|
||||
API_floor.releasePageHome(id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("发布模板成功");
|
||||
this.getTemplateList();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
delTemplate(id) {
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
content: "<p>确定删除该模板吗?</p>",
|
||||
onOk: () => {
|
||||
API_floor.removePageHome(id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("删除模板成功");
|
||||
this.getTemplateList();
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => {},
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.floor-list {
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
}
|
||||
.list {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
> div {
|
||||
width: 260px;
|
||||
height: 450px;
|
||||
margin: 10px 15px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.new-template {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
border: 2px dashed $theme_color;
|
||||
color: $theme_color;
|
||||
background: #f88c7138;
|
||||
.ivu-icon {
|
||||
font-size: 30px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
.template-saved {
|
||||
overflow: hidden;
|
||||
.template-title {
|
||||
padding: 10px;
|
||||
background: #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.theme-color {
|
||||
color: $theme_color;
|
||||
}
|
||||
}
|
||||
}
|
||||
.template-content {
|
||||
height: 407px;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
background: #ddd;
|
||||
&:hover {
|
||||
.cover {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.cover {
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
height: 407px;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.ivu-btn {
|
||||
margin-bottom: 10px;
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
border-color: #fff;
|
||||
&:hover {
|
||||
background-color: $theme_color;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -79,11 +79,11 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { btnWay } from "./btn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
btnWay, // 按钮类型
|
||||
|
||||
type: "full", // 是否全屏
|
||||
|
||||
//全屏广告
|
||||
|
@ -100,7 +100,7 @@ export default {
|
|||
},
|
||||
methods: {},
|
||||
mounted() {
|
||||
console.log(this.btnWay);
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
@ -109,12 +109,7 @@ export default {
|
|||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
|
||||
// 关闭
|
||||
closeDecorate(index) {
|
||||
this.$nextTick(() => {
|
||||
this.btnWay.splice(index, 1);
|
||||
});
|
||||
},
|
||||
|
||||
//点击图片解析成base64
|
||||
changeFile(item, index) {
|
||||
const file = document.getElementById("files" + index).files[0];
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { btnWay } from "./btn.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -95,7 +95,7 @@ export default {
|
|||
},
|
||||
methods: {},
|
||||
mounted() {
|
||||
console.log(this.btnWay);
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 点击链接
|
||||
|
@ -103,12 +103,7 @@ export default {
|
|||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
|
||||
// 关闭
|
||||
closeDecorate(index) {
|
||||
this.$nextTick(() => {
|
||||
this.btnWay.splice(index, 1);
|
||||
});
|
||||
},
|
||||
|
||||
//点击图片解析成base64
|
||||
changeFile(item, index) {
|
||||
const file = document.getElementById("files" + index).files[0];
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* btnWay 设置悬浮按钮功能
|
||||
*/
|
||||
|
||||
export const btnWay = [
|
||||
{
|
||||
img: require('@/assets/icon.png'),
|
||||
title: "",
|
||||
size:"80*80"
|
||||
},
|
||||
{
|
||||
img: require('@/assets/icon.png'),
|
||||
title: "",
|
||||
size:"80*80"
|
||||
},
|
||||
{
|
||||
img: require('@/assets/icon.png'),
|
||||
title: "",
|
||||
size:"80*80"
|
||||
},
|
||||
];
|
|
@ -1,147 +0,0 @@
|
|||
<template>
|
||||
<div class="model-view">
|
||||
<div class="model-view-content">
|
||||
<div class="content">
|
||||
<div class="wap-title">首页</div>
|
||||
<div class="draggable">
|
||||
<div class="position">
|
||||
<div class="btn-item">
|
||||
<img
|
||||
src="https://shopro-1253949872.file.myqcloud.com/uploads/20200704/f6b9c9d20d21df541ac52e9548486e1a.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div class="btn-item" v-for="(item, index) in btnWay" :key="index">
|
||||
<img :src="item.img" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="model-config">
|
||||
<div class="decorate">
|
||||
<div class="decorate-title">悬浮按钮</div>
|
||||
|
||||
<div class="decorate-list">
|
||||
<div
|
||||
class="decorate-item"
|
||||
v-for="(item, index) in btnWay"
|
||||
:key="index"
|
||||
>
|
||||
<div class="decorate-item-title">
|
||||
<div>图标{{ index + 1 }}</div>
|
||||
<Icon
|
||||
@click="closeDecorate(index)"
|
||||
size="20"
|
||||
color="#e1251b"
|
||||
type="md-close-circle"
|
||||
/>
|
||||
</div>
|
||||
<div class="decorate-item-box">
|
||||
<!-- 选择照片 -->
|
||||
<div class="decorate-view">
|
||||
<div class="decorate-view-title">选择图标</div>
|
||||
<div>
|
||||
<img class="show-image" :src="item.img" alt />
|
||||
<input
|
||||
type="file"
|
||||
class="hidden-input"
|
||||
@change="changeFile(item, index)"
|
||||
ref="files"
|
||||
:id="'files' + index"
|
||||
/>
|
||||
<div class="tips">
|
||||
建议尺寸
|
||||
<span>{{ item.size }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="selectBtn">
|
||||
<Button
|
||||
size="small"
|
||||
@click="handleClickFile(item, index)"
|
||||
ghost
|
||||
type="primary"
|
||||
>选择照片</Button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Button type="primary" @click="addDecorate()" ghost>添加</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { btnWay } from "./btn.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
btnWay, // 按钮类型
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
mounted() {
|
||||
console.log(this.btnWay);
|
||||
},
|
||||
methods: {
|
||||
//添加设置
|
||||
addDecorate() {
|
||||
let way = {
|
||||
img: "https://picsum.photos/id/264/200/200",
|
||||
title: "标题",
|
||||
size: this.btnWay[0].size,
|
||||
};
|
||||
this.btnWay.push(way);
|
||||
},
|
||||
|
||||
// 关闭
|
||||
closeDecorate(index) {
|
||||
this.$nextTick(() => {
|
||||
this.btnWay.splice(index, 1);
|
||||
});
|
||||
},
|
||||
//点击图片解析成base64
|
||||
changeFile(item, index) {
|
||||
const file = document.getElementById("files" + index).files[0];
|
||||
if (file == void 0) return false;
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
this.$nextTick((res) => {
|
||||
reader.onload = (e) => {
|
||||
item.img = e.target.result;
|
||||
};
|
||||
});
|
||||
},
|
||||
// 点击选择照片
|
||||
handleClickFile(item, index) {
|
||||
document.getElementById("files" + index).click();
|
||||
// console.log(let files = files)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "./style.scss";
|
||||
@import "./decorate.scss";
|
||||
.draggable {
|
||||
position: relative;
|
||||
}
|
||||
.position {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
bottom: 50px;
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
.btn-item {
|
||||
> img {
|
||||
margin: 4px 0;
|
||||
border-radius: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,5 +1,5 @@
|
|||
import index from './index.vue' //首页
|
||||
import btn from './btn.vue' //按钮
|
||||
|
||||
import advertising from './advertising.vue' //全屏活动
|
||||
import alertAdvertising from './alertAdvertising.vue' //弹窗活动
|
||||
|
||||
|
@ -7,7 +7,7 @@ import alertAdvertising from './alertAdvertising.vue' //弹窗活动
|
|||
|
||||
const templates = {
|
||||
index,
|
||||
btn,
|
||||
|
||||
advertising,
|
||||
alertAdvertising
|
||||
}
|
||||
|
|
|
@ -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,17 +48,14 @@ export default {
|
|||
progress: true, // 展示进度
|
||||
num: 20, // 提交进度
|
||||
saveDialog: false, // 加载状态
|
||||
way: [ // 装修tab栏切换
|
||||
way: [
|
||||
// 装修tab栏切换
|
||||
{
|
||||
title: "首页",
|
||||
name: "index",
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
title: "悬浮按钮",
|
||||
name: "btn",
|
||||
selected: false,
|
||||
},
|
||||
|
||||
{
|
||||
title: "全屏广告",
|
||||
name: "advertising",
|
||||
|
@ -84,7 +68,8 @@ export default {
|
|||
},
|
||||
],
|
||||
qrcode: "", // 二维码
|
||||
submitWay: { // 表单信息
|
||||
submitWay: {
|
||||
// 表单信息
|
||||
pageShow: this.$route.query.type || false,
|
||||
name: this.$route.query.name || "模板名称",
|
||||
pageClientType: "H5",
|
||||
|
@ -133,6 +118,8 @@ export default {
|
|||
pageData: JSON.stringify(this.$store.state.styleStore),
|
||||
name: this.submitWay.name,
|
||||
pageShow: this.submitWay.pageShow,
|
||||
pageType: "INDEX",
|
||||
pageClientType: "H5",
|
||||
})
|
||||
.then((res) => {
|
||||
this.num = 50;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.image-mode {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
padding: 1px;
|
||||
}
|
||||
|
|
|
@ -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>
|
|
@ -12,20 +12,21 @@
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -20,7 +20,7 @@ export default {
|
|||
title: "左一右二",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
.view-height-75 {
|
||||
.image-mode {
|
||||
height: 75px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -22,6 +22,8 @@
|
|||
</Row>
|
||||
|
||||
</Row>
|
||||
<!-- 拼图验证码 -->
|
||||
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||
<div v-if="socialLogining">
|
||||
<RectLoading />
|
||||
</div>
|
||||
|
@ -41,6 +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";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -49,17 +52,20 @@ export default {
|
|||
LangSwitch,
|
||||
Header,
|
||||
Footer,
|
||||
verify,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, // 加载状态
|
||||
form: { // 表单数据
|
||||
form: {
|
||||
// 表单数据
|
||||
username: "",
|
||||
password: "",
|
||||
mobile: "",
|
||||
code: "",
|
||||
},
|
||||
rules: { // 验证规则
|
||||
rules: {
|
||||
// 验证规则
|
||||
username: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -80,6 +86,7 @@ export default {
|
|||
methods: {
|
||||
mounted() {},
|
||||
afterLogin(res) {
|
||||
// 登录成功后处理
|
||||
let accessToken = res.result.accessToken;
|
||||
let refreshToken = res.result.refreshToken;
|
||||
this.setStore("accessToken", accessToken);
|
||||
|
@ -101,21 +108,33 @@ export default {
|
|||
});
|
||||
},
|
||||
submitLogin() {
|
||||
// 登录操作
|
||||
this.$refs.usernameLoginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$refs.verify.show = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
verifyChange(con) {
|
||||
// 拼图验证码回显
|
||||
if (!con.status) return;
|
||||
|
||||
this.loading = true;
|
||||
login({
|
||||
username: this.form.username,
|
||||
password: this.md5(this.form.password),
|
||||
}).then((res) => {
|
||||
})
|
||||
.then((res) => {
|
||||
if (res && res.success) {
|
||||
this.afterLogin(res);
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
this.$refs.verify.show = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -140,7 +159,12 @@ export default {
|
|||
position: relative;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.verify-con {
|
||||
position: absolute;
|
||||
top: 90px;
|
||||
z-index: 10;
|
||||
left: 20px;
|
||||
}
|
||||
.form {
|
||||
padding-top: 1vh;
|
||||
|
||||
|
@ -179,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
|
||||
});
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
<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>
|
||||
|
||||
|
@ -137,12 +137,14 @@ export default {
|
|||
loading: true, // 表单加载状态
|
||||
addFlag: false, // modal显隐控制
|
||||
updateRegion: false, // 地区
|
||||
addMemberForm: { // 添加用户表单
|
||||
addMemberForm: {
|
||||
// 添加用户表单
|
||||
mobile: "",
|
||||
username: "",
|
||||
password: "",
|
||||
},
|
||||
searchForm: { // 请求参数
|
||||
searchForm: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
order: "desc",
|
||||
|
@ -152,7 +154,8 @@ export default {
|
|||
},
|
||||
picModelFlag: false, // 选择图片
|
||||
formValidate: {}, // 表单数据
|
||||
addRule: { // 验证规则
|
||||
addRule: {
|
||||
// 验证规则
|
||||
mobile: [
|
||||
{ required: true, message: "请输入手机号码" },
|
||||
{
|
||||
|
@ -229,6 +232,7 @@ export default {
|
|||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: params.row.___selected ? "primary" : "",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
@ -236,11 +240,11 @@ export default {
|
|||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.callback(params.row);
|
||||
this.callback(params.row, params.index);
|
||||
},
|
||||
},
|
||||
},
|
||||
"选择"
|
||||
params.row.___selected ? "已选择" : "选择"
|
||||
),
|
||||
|
||||
h(
|
||||
|
@ -251,7 +255,8 @@ export default {
|
|||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px", display: this.selectedMember ? "none" : "block",
|
||||
marginRight: "5px",
|
||||
display: this.selectedMember ? "none" : "block",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
|
@ -270,7 +275,8 @@ export default {
|
|||
ghost: true,
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px", display: this.selectedMember ? "none" : "block",
|
||||
marginRight: "5px",
|
||||
display: this.selectedMember ? "none" : "block",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
|
@ -306,18 +312,75 @@ export default {
|
|||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
selectMember: [], //保存选中的用户
|
||||
};
|
||||
},
|
||||
props: {
|
||||
// 是否为选中模式
|
||||
selectedMember: {
|
||||
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) {
|
||||
callback(val, index) {
|
||||
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) {
|
||||
|
@ -373,12 +436,13 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
//查询会员列表
|
||||
getData() {
|
||||
API_Member.getMemberListData(this.searchForm).then((res) => {
|
||||
if (res.result.records) {
|
||||
this.loading = false;
|
||||
this.data = res.result.records;
|
||||
this.init(res.result.records);
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
|
@ -467,7 +531,7 @@ export default {
|
|||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
this.getData();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -476,7 +540,7 @@ export default {
|
|||
/deep/ .ivu-table-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
/deep/ .ivu-card{
|
||||
/deep/ .ivu-card {
|
||||
width: 100%;
|
||||
}
|
||||
.face {
|
||||
|
|
|
@ -0,0 +1,346 @@
|
|||
<template>
|
||||
<div class="sku-choose">
|
||||
<Button @click="showDrawer=true" :icon="icon">{{ text }}</Button>
|
||||
<span @click="clearSelectData" class="clear">清空已选</span>
|
||||
<Collapse simple class="collapse">
|
||||
<Panel name="1">
|
||||
已选择
|
||||
<span class="select-count">{{ selectObj.length }}</span> 件
|
||||
<p slot="content">
|
||||
<Tag
|
||||
v-for="(item, i) in selectObj"
|
||||
:key="i"
|
||||
:name="item.id"
|
||||
color="default"
|
||||
closable
|
||||
@on-close="handleCancelObj"
|
||||
>{{ createName(item) }}
|
||||
</Tag>
|
||||
</p>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
<Drawer title="选择活动优惠券" closable v-model="showDrawer" :width="width" draggable>
|
||||
<Table
|
||||
:loading="showLoading"
|
||||
border
|
||||
:columns="tableColumns"
|
||||
:data="tableData"
|
||||
:height="height"
|
||||
ref="tableData"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" style="margin: 10px 0;">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="tableTotal"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changeDataPage"
|
||||
@on-page-size-change="changeDataPageSize"
|
||||
:page-size-opts="[10,20,50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
<div class="my-drawer-footer">
|
||||
已选择
|
||||
<span class="select-count">{{ selectObj.length }}</span> 件
|
||||
<Button @click="clearSelectData" style="margin-left:10px">清空已选</Button>
|
||||
<Button @click="showDrawer=false" type="primary" style="margin-left:10px">关闭</Button>
|
||||
</div>
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPlatformCouponList
|
||||
} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "userChoose",
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: "选择SKU"
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: "md-basket"
|
||||
},
|
||||
initData: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
createName: {
|
||||
type: Function,
|
||||
default: function (item) {
|
||||
return item.goodsName
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.selectObj = this.initData
|
||||
console.log(JSON.stringify(this.initData))
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//默认值后续计算
|
||||
height: 500,
|
||||
width: 500,
|
||||
//加载状态
|
||||
showLoading: true,
|
||||
//展示抽屉
|
||||
showDrawer: false,
|
||||
selectObj: [], // 选择数据
|
||||
searchForm: { // 请求参数
|
||||
getType: "ACTIVITY",// 活动优惠券
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
|
||||
},
|
||||
tableColumns: [ // 表头
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 140
|
||||
},
|
||||
{
|
||||
title: "规格",
|
||||
key: "specName",
|
||||
minWidth: 140,
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
key: "thumbnail",
|
||||
width: 80,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("Avatar", {
|
||||
props: {
|
||||
src: params.row.face
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
align: "center",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.delFlag == 0) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "正常"
|
||||
}
|
||||
})
|
||||
]);
|
||||
} else if (params.row.delFlag == -1) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 130,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let select;
|
||||
this.selectObj.forEach(item => {
|
||||
if (item.id === params.row.id) {
|
||||
select = params.row
|
||||
}
|
||||
});
|
||||
|
||||
if (select) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseCancel(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"取消选择"
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseObj(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"选择"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
tableData: [], // 表格数据
|
||||
tableTotal: 0 // 总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeDataPage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.searchData();
|
||||
},
|
||||
changeDataPageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.searchData();
|
||||
},
|
||||
searchData() {
|
||||
this.showLoading = true;
|
||||
getPlatformCouponList(this.searchForm).then(res => {
|
||||
this.showLoading = false;
|
||||
if (res.success) {
|
||||
this.tableData = res.result.records;
|
||||
this.tableTotal = res.result.total;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSearchData() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchData();
|
||||
},
|
||||
handleResetObj() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 9;
|
||||
this.searchForm.departmentId = "";
|
||||
// 重新加载数据
|
||||
this.searchData();
|
||||
},
|
||||
setData(v) {
|
||||
this.selectObj = v;
|
||||
this.$emit("on-change", this.selectObj);
|
||||
},
|
||||
chooseCancel(v) {
|
||||
let _index;
|
||||
this.selectObj.forEach((e, index) => {
|
||||
if (v.id == e.id) {
|
||||
_index = index;
|
||||
}
|
||||
});
|
||||
|
||||
if (_index || _index == 0) {
|
||||
this.selectObj.splice(_index, 1);
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
chooseObj(v) {
|
||||
// 去重
|
||||
let that = this;
|
||||
let flag = true;
|
||||
this.selectObj.forEach(e => {
|
||||
if (v.id == e.id) {
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
if (flag) {
|
||||
this.selectObj.push(v);
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
clearSelectData() {
|
||||
this.selectObj = [];
|
||||
this.$emit("on-change", this.selectObj);
|
||||
},
|
||||
handleCancelObj(e, id) {
|
||||
// 删除所选用户
|
||||
let newArray = [];
|
||||
this.selectObj.forEach(e => {
|
||||
if (id != e.id) {
|
||||
newArray.push(e);
|
||||
}
|
||||
});
|
||||
this.selectObj = newArray;
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 计算高度
|
||||
this.height = Number(document.documentElement.clientHeight - 230);
|
||||
this.width = Number(document.documentElement.clientWidth / 2) > 900 ? 900 : Number(document.documentElement.clientWidth / 2)
|
||||
this.searchData();
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sku-choose {
|
||||
.clear {
|
||||
font-size: 12px;
|
||||
margin-left: 15px;
|
||||
color: #40a9ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collapse {
|
||||
font-size: 12px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
}
|
||||
|
||||
.my-drawer-footer {
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
### 滑动拼图验证
|
||||
|
||||
### 在页面中引入 .vue文件
|
||||
|
||||
#### 参数
|
||||
|
||||
#### 在组件上添加v-if来判断组件显隐
|
||||
|
||||
#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ]
|
||||
|
||||
#### @change方法 获取回调,参数为对象 {status:false,distance:100} status 为回调状态,distance为移动距离
|
||||
|
||||
|
||||
#### <Verify class="verify-content" verifyType='LOGIN' @change="verifyChange"></Verify>
|
|
@ -0,0 +1,185 @@
|
|||
<template>
|
||||
<div class="verify-content" v-if="show" @mousemove="mouseMove" @mouseup="mouseUp">
|
||||
<div class="imgBox" :style="{width:data.originalWidth+'px',height:data.originalHeight + 'px'}">
|
||||
<img :src="data.backImage" style="width:100%;height:100%" alt="">
|
||||
<img class="slider" :src="data.slidingImage" :style="{left:distance+'px',top:data.randomY+'px'}" :width="data.sliderWidth" :height="data.sliderHeight" alt="">
|
||||
<Icon type="md-refresh" class="refresh" @click="refresh" />
|
||||
</div>
|
||||
<div class="handle" :style="{width:data.originalWidth+'px'}">
|
||||
<span class="bgcolor" :style="{width:distance + 'px',background:bgColor}"></span>
|
||||
<span class="swiper" :style="{left:distance + 'px'}" @mousedown="mouseDown">
|
||||
<Icon type="md-arrow-round-forward" />
|
||||
</span>
|
||||
<span class="text">{{verifyText}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getVerifyImg, postVerifyImg } from './verify.js';
|
||||
export default {
|
||||
props: {
|
||||
verifyType: {
|
||||
defalut: 'LOGIN',
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
show: false, // 验证码显隐
|
||||
type: 'LOGIN', // 请求类型
|
||||
data: { // 验证码数据
|
||||
backImage: '',
|
||||
slidingImage: '',
|
||||
originalHeight: 150,
|
||||
originalWidth: 300,
|
||||
sliderWidth: 60,
|
||||
sliderHeight: 60
|
||||
},
|
||||
distance: 0, // 拼图移动距离
|
||||
flag: false, // 判断滑块是否按下
|
||||
downX: 0, // 鼠标按下位置
|
||||
bgColor: 'aqua', // 滑动背景颜色
|
||||
verifyText: '拖动滑块解锁' // 文字提示
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
mouseDown (e) {
|
||||
this.downX = e.clientX;
|
||||
this.flag = true;
|
||||
},
|
||||
mouseMove (e) {
|
||||
if (this.flag) {
|
||||
let offset = e.clientX - this.downX;
|
||||
|
||||
if (offset > this.data.originalWidth - 43) {
|
||||
this.distance = this.data.originalWidth - 43;
|
||||
} else if (offset < 0) {
|
||||
this.distance = 0;
|
||||
} else {
|
||||
this.distance = offset;
|
||||
}
|
||||
}
|
||||
},
|
||||
mouseUp () {
|
||||
if (!this.flag) return false;
|
||||
this.flag = false;
|
||||
let params = {
|
||||
verificationEnums: this.type,
|
||||
xPos: this.distance
|
||||
};
|
||||
postVerifyImg(params).then(res => {
|
||||
if (res.result) {
|
||||
this.bgColor = 'green';
|
||||
this.verifyText = '解锁成功';
|
||||
this.$emit('change', { status: true, distance: this.distance });
|
||||
} else {
|
||||
this.bgColor = 'red';
|
||||
this.verifyText = '解锁失败';
|
||||
let that = this;
|
||||
setTimeout(() => {
|
||||
that.refresh();
|
||||
}, 1000);
|
||||
this.$emit('change', { status: false, distance: this.distance });
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh () {
|
||||
this.flag = false;
|
||||
this.downX = 0;
|
||||
this.distance = 0;
|
||||
this.bgColor = 'aqua';
|
||||
this.verifyText = '拖动滑块解锁';
|
||||
this.getImg();
|
||||
},
|
||||
getImg () {
|
||||
getVerifyImg(this.type).then(res => {
|
||||
this.data = res.result;
|
||||
});
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getImg();
|
||||
},
|
||||
watch: {
|
||||
verifyType: {
|
||||
immediate: true,
|
||||
handler: function (v) {
|
||||
this.type = v;
|
||||
this.refresh();
|
||||
}
|
||||
},
|
||||
show (v) {
|
||||
if (v) this.refresh();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.verify-content{
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 5px;
|
||||
box-shadow: 1px 1px 3px #999;
|
||||
}
|
||||
.imgBox {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.refresh {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.handle {
|
||||
border: 1px solid rgb(134, 134, 134);
|
||||
margin-top: 5px;
|
||||
height: 42px;
|
||||
background: #ddd;
|
||||
position: relative;
|
||||
|
||||
.bgcolor {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
opacity: 0.5;
|
||||
background: aqua;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
position: absolute;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.ivu-icon {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
display: inline-block;
|
||||
width: inherit;
|
||||
text-align: center;
|
||||
line-height: 42px;
|
||||
font-size: 14px;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
import {commonUrl, getRequestWithNoToken, postRequestWithNoToken} from '@/libs/axios';
|
||||
|
||||
|
||||
// 获取拼图验证
|
||||
export const getVerifyImg = (verificationEnums) => {
|
||||
return getRequestWithNoToken(`${commonUrl}/common/slider/${verificationEnums}`);
|
||||
};
|
||||
|
||||
// 拼图验证
|
||||
export const postVerifyImg = (params) => {
|
||||
return postRequestWithNoToken(`${commonUrl}/common/slider/${params.verificationEnums}`, params);
|
||||
};
|
|
@ -1,16 +1,27 @@
|
|||
<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" />
|
||||
<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: 200px" />
|
||||
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 160px" />
|
||||
</Form-item>
|
||||
|
||||
<Form-item label="订单类型" prop="orderType">
|
||||
<Select v-model="searchForm.orderType" placeholder="请选择" clearable style="width: 160px">
|
||||
<Option value="NORMAL">普通订单</Option>
|
||||
<Option value="PINTUAN">拼团订单</Option>
|
||||
<Option value="GIFT">赠品订单</Option>
|
||||
<Option value="VIRTUAL">核验订单</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item 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>
|
||||
|
@ -20,29 +31,91 @@
|
|||
<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>
|
||||
</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>
|
||||
|
||||
<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";
|
||||
|
||||
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: {
|
||||
// 搜索框初始化对象
|
||||
|
@ -65,42 +138,56 @@ 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",{},"移动端");
|
||||
}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",{},"移动应用端");
|
||||
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);
|
||||
}
|
||||
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", {}, "赠品订单")]);
|
||||
} else if (params.row.orderType == "VIRTUAL") {
|
||||
return h("div", [h("tag", {}, "核验订单")]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "买家名称",
|
||||
key: "memberName",
|
||||
width: 130,
|
||||
minWidth: 130,
|
||||
tooltip: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: "订单金额",
|
||||
key: "flowPrice",
|
||||
minWidth: 120,
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
|
@ -112,7 +199,7 @@ export default {
|
|||
{
|
||||
title: "订单状态",
|
||||
key: "orderStatus",
|
||||
width: 95,
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.orderStatus == "UNPAID") {
|
||||
return h("div", [h("span", {}, "未付款")]);
|
||||
|
@ -131,12 +218,19 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "下单时间",
|
||||
key: "createTime",
|
||||
width: 170,
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 180,
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
|
@ -280,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">
|
||||
|
@ -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,21 +4,10 @@
|
|||
<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"
|
||||
>
|
||||
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
<Option value="NEW">未开始</Option>
|
||||
<Option value="START">已开始/上架</Option>
|
||||
<Option value="END">已结束/下架</Option>
|
||||
|
@ -26,66 +15,27 @@
|
|||
</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>
|
||||
</Row>
|
||||
<Row class="operation padding-row">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
<Button @click="add" type="primary">添加优惠券</Button>
|
||||
<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"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button
|
||||
v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'"
|
||||
type="primary"
|
||||
size="small"
|
||||
style="margin-right: 10px"
|
||||
@click="edit(row)"
|
||||
>编辑
|
||||
</Button
|
||||
>
|
||||
<Button
|
||||
v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'"
|
||||
type="error"
|
||||
size="small"
|
||||
style="margin-right: 10px"
|
||||
@click="remove(row)"
|
||||
>下架
|
||||
</Button
|
||||
>
|
||||
<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>
|
||||
<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>
|
||||
|
@ -94,13 +44,13 @@
|
|||
<script>
|
||||
import {
|
||||
getPlatformCouponList,
|
||||
deletePlatformCoupon,
|
||||
updatePlatformCouponStatus,
|
||||
} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "coupon",
|
||||
components: {},
|
||||
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -109,10 +59,11 @@ export default {
|
|||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 0, // 当前页数
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "startTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
getType: "", // 默认排序方式
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
|
@ -121,7 +72,7 @@ export default {
|
|||
// 表单验证规则
|
||||
formValidate: {
|
||||
promotionName: [
|
||||
{required: true, message: "不能为空", trigger: "blur"},
|
||||
{ required: true, message: "不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
@ -138,15 +89,16 @@ export default {
|
|||
{
|
||||
title: "活动名称",
|
||||
key: "promotionName",
|
||||
width: 120,
|
||||
minWidth: 100,
|
||||
fixed: "left",
|
||||
},
|
||||
{
|
||||
title: "优惠券名称",
|
||||
key: "couponName",
|
||||
width: 120,
|
||||
tooltip: true
|
||||
}, {
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "面额/折扣",
|
||||
key: "price",
|
||||
width: 120,
|
||||
|
@ -165,11 +117,14 @@ export default {
|
|||
{
|
||||
title: "领取数量/总数量",
|
||||
key: "publishNum",
|
||||
width: 150,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div", params.row.receivedNum + "/" + params.row.publishNum)
|
||||
"div",
|
||||
params.row.receivedNum + "/" + params.row.publishNum
|
||||
);
|
||||
},
|
||||
minWidth:130,
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
title: "优惠券类型",
|
||||
|
@ -205,21 +160,28 @@ export default {
|
|||
},
|
||||
{
|
||||
title: "活动时间",
|
||||
|
||||
render: (h, params) => {
|
||||
if (params.row.getType === "ACTIVITY") {
|
||||
return h("div", "长期有效");
|
||||
} else {
|
||||
return h("div", {
|
||||
domProps:
|
||||
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime}
|
||||
});
|
||||
domProps: {
|
||||
innerHTML:
|
||||
params.row.startTime + "<br/>" + params.row.endTime,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
minWidth:150,
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
width: 100,
|
||||
key: "promotionStatus",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let text = "未知",
|
||||
color = "";
|
||||
color = "red";
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
text = "未开始";
|
||||
color = "default";
|
||||
|
@ -245,20 +207,38 @@ export default {
|
|||
),
|
||||
]);
|
||||
},
|
||||
minWidth:70,
|
||||
minWidth: 70,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
slot: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
minWidth: 140
|
||||
maxWidth: 140,
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
selectCoupon: [], //本级选中的优惠券
|
||||
};
|
||||
},
|
||||
props: {
|
||||
// 是否为选中模式
|
||||
checked: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
//优惠券类型 查询参数
|
||||
getType: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
//已选择优惠券
|
||||
selectedList: {
|
||||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
if (to.fullPath == "/promotion/manager-coupon") {
|
||||
|
@ -267,23 +247,38 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
// 选中优惠券 父级传值
|
||||
selectedList: {
|
||||
handler(val) {
|
||||
// 判断是否是父级回调给自己已选择优惠券
|
||||
if (val.length != 0) {
|
||||
this.selectCoupon = val;
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
check() {
|
||||
// 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;
|
||||
|
@ -305,7 +300,35 @@ 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;
|
||||
},
|
||||
|
@ -322,6 +345,18 @@ export default {
|
|||
getPlatformCouponList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
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;
|
||||
}
|
||||
|
@ -363,7 +398,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({
|
||||
|
@ -373,7 +408,10 @@ export default {
|
|||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
updatePlatformCouponStatus({couponIds: v.id, promotionStatus: "CLOSE"})
|
||||
updatePlatformCouponStatus({
|
||||
couponIds: v.id,
|
||||
promotionStatus: "CLOSE",
|
||||
})
|
||||
.then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
|
@ -449,6 +487,10 @@ export default {
|
|||
},
|
||||
},
|
||||
mounted() {
|
||||
//如果作为组件方式,传入了类型值,则搜索参数附加类型
|
||||
if (this.getType) {
|
||||
this.searchForm.getType = this.getType;
|
||||
}
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
<h4>基本信息</h4>
|
||||
<div class="form-item-view">
|
||||
<FormItem label="活动名称" prop="promotionName">
|
||||
<Input type="text" v-model="form.promotionName" placeholder="活动名称" clearable style="width: 260px" />
|
||||
<Input type="text" v-model="form.promotionName" placeholder="活动名称" clearable style="width: 260px"/>
|
||||
</FormItem>
|
||||
<FormItem label="优惠券名称" prop="couponName">
|
||||
<Input type="text" v-model="form.couponName" placeholder="优惠券名称" clearable style="width: 260px" />
|
||||
<Input type="text" v-model="form.couponName" placeholder="优惠券名称" clearable style="width: 260px"/>
|
||||
</FormItem>
|
||||
<FormItem label="优惠券类型" prop="couponType">
|
||||
<Select v-model="form.couponType" style="width: 260px">
|
||||
|
@ -18,11 +18,11 @@
|
|||
</Select>
|
||||
</FormItem>
|
||||
<FormItem label="折扣" prop="couponDiscount" v-if="form.couponType == 'DISCOUNT'">
|
||||
<Input type="number" v-model="form.couponDiscount" placeholder="折扣" clearable style="width: 260px" />
|
||||
<Input type="number" v-model="form.couponDiscount" placeholder="折扣" clearable style="width: 260px"/>
|
||||
<span class="describe">请输入0-10之间数字,可以输入一位小数</span>
|
||||
</FormItem>
|
||||
<FormItem label="面额" prop="price" v-if="form.couponType == 'PRICE'">
|
||||
<Input type="text" v-model="form.price" placeholder="面额" clearable style="width: 260px" />
|
||||
<Input type="text" v-model="form.price" placeholder="面额" clearable style="width: 260px"/>
|
||||
</FormItem>
|
||||
<FormItem label="活动类型" prop="getType">
|
||||
<Select v-model="form.getType" style="width: 260px">
|
||||
|
@ -37,29 +37,45 @@
|
|||
</Input>
|
||||
<span class="describe">店铺承担比例,输入0-100之间数值</span>
|
||||
</FormItem>
|
||||
<FormItem label="发放数量" prop="publishNum">
|
||||
<Input v-model="form.publishNum" placeholder="发放数量" style="width: 260px" />
|
||||
<FormItem label="发放数量" prop="publishNum" v-if="form.getType==='FREE'">
|
||||
<Input v-model="form.publishNum" placeholder="发放数量" style="width: 260px"/>
|
||||
</FormItem>
|
||||
<FormItem label="领取数量限制" prop="couponLimitNum" v-if="form.getType==='FREE'">
|
||||
<Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px"/>
|
||||
</FormItem>
|
||||
<FormItem label="范围描述" prop="description">
|
||||
<Input v-model="form.description" type="textarea" :rows="4" maxlength="50" show-word-limit clearable
|
||||
style="width: 260px"/>
|
||||
</FormItem>
|
||||
</div>
|
||||
<h4>使用限制</h4>
|
||||
<div class="form-item-view">
|
||||
<FormItem label="消费门槛" prop="consumeThreshold">
|
||||
<Input type="text" v-model="form.consumeThreshold" placeholder="消费门槛" clearable style="width: 260px" />
|
||||
</FormItem>
|
||||
<FormItem label="领取限制" prop="couponLimitNum">
|
||||
<Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px" />
|
||||
<Input type="text" v-model="form.consumeThreshold" placeholder="消费门槛" clearable style="width: 260px"/>
|
||||
</FormItem>
|
||||
<FormItem label="有效期" prop="rangeTime">
|
||||
<DatePicker
|
||||
type="datetimerange"
|
||||
v-model="form.rangeTime"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择"
|
||||
:options="options"
|
||||
style="width: 260px"
|
||||
>
|
||||
<div v-if="form.getType == 'ACTIVITY'">
|
||||
<RadioGroup v-model="rangeTimeType">
|
||||
|
||||
<Radio :label="1">
|
||||
起止时间
|
||||
</Radio>
|
||||
<Radio :label="0">固定时间</Radio>
|
||||
|
||||
</RadioGroup>
|
||||
</div>
|
||||
<div v-if="rangeTimeType == 1">
|
||||
<DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"
|
||||
:options="options" style="width: 260px">
|
||||
</DatePicker>
|
||||
</div>
|
||||
<div class="effectiveDays" v-if="rangeTimeType == 0">
|
||||
领取当天开始
|
||||
<InputNumber v-model="form.effectiveDays" :min="1" style="width:100px;" :max="365"/>
|
||||
天内有效(1-365间的整数)
|
||||
</div>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="使用范围" prop="scopeType">
|
||||
<RadioGroup type="button" button-style="solid" v-model="form.scopeType">
|
||||
<Radio label="ALL">全品类</Radio>
|
||||
|
@ -75,20 +91,17 @@
|
|||
</div>
|
||||
<Table border :columns="columns" :data="form.promotionGoodsList" @on-selection-change="changeSelect">
|
||||
<template slot-scope="{ row }" slot="QRCode">
|
||||
<img :src="row.QRCode || '../../../assets/lili.png'" width="50px" height="50px" alt="" />
|
||||
<img :src="row.QRCode || '../../../assets/lili.png'" width="50px" height="50px" alt=""/>
|
||||
</template>
|
||||
</Table>
|
||||
</FormItem>
|
||||
|
||||
<FormItem v-if="form.scopeType == 'PORTION_GOODS_CATEGORY'">
|
||||
|
||||
<Cascader @on-change="getGoodsCategory" :data="goodsCategoryList" style="width:300px;" v-model="form.scopeIdGoods"></Cascader>
|
||||
<Cascader @on-change="getGoodsCategory" :data="goodsCategoryList" style="width:300px;"
|
||||
v-model="form.scopeIdGoods"></Cascader>
|
||||
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="范围描述" prop="description">
|
||||
<Input v-model="form.description" type="textarea" :rows="4" maxlength="50" show-word-limit clearable style="width: 260px" />
|
||||
</FormItem>
|
||||
<div>
|
||||
<Button type="text" @click="closeCurrentPage">返回</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
||||
|
@ -107,8 +120,8 @@ import {
|
|||
getPlatformCoupon,
|
||||
editPlatformCoupon,
|
||||
} from "@/api/promotion";
|
||||
import { getCategoryTree } from "@/api/goods";
|
||||
import { regular } from "@/utils";
|
||||
import {getCategoryTree} from "@/api/goods";
|
||||
import {regular} from "@/utils";
|
||||
import skuSelect from "@/views/lili-dialog";
|
||||
|
||||
export default {
|
||||
|
@ -116,6 +129,16 @@ export default {
|
|||
components: {
|
||||
skuSelect,
|
||||
},
|
||||
watch: {
|
||||
"form.getType": {
|
||||
handler(val) {
|
||||
if (val == "FREE") {
|
||||
this.rangeTimeType = 1;
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
const checkPrice = (rule, value, callback) => {
|
||||
if (!value && value !== 0) {
|
||||
|
@ -140,12 +163,13 @@ export default {
|
|||
}
|
||||
};
|
||||
return {
|
||||
rangeTimeType: 1,
|
||||
modalType: 0, // 是否编辑
|
||||
form: {
|
||||
/** 店铺承担比例 */
|
||||
storeCommission: 0,
|
||||
/** 发行数量 */
|
||||
publishNum: 1,
|
||||
publishNum: 0,
|
||||
/** 运费承担者 */
|
||||
scopeType: "ALL",
|
||||
/** 限领数量 */
|
||||
|
@ -154,9 +178,11 @@ export default {
|
|||
couponType: "PRICE",
|
||||
/** 优惠券名称 */
|
||||
couponName: "",
|
||||
promotionName: "",
|
||||
getType: "FREE",
|
||||
promotionGoodsList: [],
|
||||
scopeIdGoods: [],
|
||||
rangeDayType: "",
|
||||
},
|
||||
id: this.$route.query.id, // 优惠券id
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
@ -169,38 +195,37 @@ export default {
|
|||
value: "id",
|
||||
}, // 级联选择器配置项
|
||||
formRule: {
|
||||
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||
couponName: [{ required: true, message: "优惠券名称不能为空" }],
|
||||
couponLimitNum: [{ required: true, message: "领取限制不能为空" }],
|
||||
promotionName: [{required: true, message: "活动名称不能为空"}],
|
||||
couponName: [{required: true, message: "优惠券名称不能为空"}],
|
||||
price: [
|
||||
{ required: true, message: "请输入面额" },
|
||||
{ validator: checkPrice },
|
||||
{required: true, message: "请输入面额"},
|
||||
{validator: checkPrice},
|
||||
],
|
||||
rangeTime: [{ required: true, message: "请选择优惠券有效期" }],
|
||||
rangeTime: [{required: true, message: "请选择优惠券有效期"}],
|
||||
consumeThreshold: [
|
||||
{ required: true, message: "请输入消费门槛" },
|
||||
{ validator: checkWeight },
|
||||
{required: true, message: "请输入消费门槛"},
|
||||
{validator: checkWeight},
|
||||
],
|
||||
couponDiscount: [
|
||||
{ required: true, message: "请输入折扣" },
|
||||
{required: true, message: "请输入折扣"},
|
||||
{
|
||||
pattern: regular.discount,
|
||||
message: "请输入0-10的数字,可有一位小数",
|
||||
},
|
||||
],
|
||||
storeCommission: [
|
||||
{ required: true, message: "请输入店铺承担比例" },
|
||||
{ pattern: regular.rate, message: "请输入0-100的正整数" },
|
||||
{required: true, message: "请输入店铺承担比例"},
|
||||
{pattern: regular.rate, message: "请输入0-100的正整数"},
|
||||
],
|
||||
publishNum: [
|
||||
{ required: true, message: "请输入发放数量" },
|
||||
{ pattern: regular.integer, message: "请输入正整数" },
|
||||
{required: true, message: "请输入发放数量"},
|
||||
{pattern: regular.integer, message: "请输入正整数"},
|
||||
],
|
||||
couponLimitNum: [
|
||||
{ required: true, message: "请输入领取限制" },
|
||||
{ pattern: regular.integer, message: "请输入正整数" },
|
||||
{required: true, message: "领取限制不能为空"},
|
||||
{pattern: regular.integer, message: "请输入正整数"},
|
||||
],
|
||||
description: [{ required: true, message: "请输入范围描述" }],
|
||||
description: [{required: true, message: "请输入范围描述"}],
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
|
@ -277,6 +302,7 @@ export default {
|
|||
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++) {
|
||||
|
@ -301,6 +327,7 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
next(this.goodsCategoryList, []);
|
||||
data.scopeIdGoods = prevCascader;
|
||||
}
|
||||
|
@ -314,13 +341,24 @@ export default {
|
|||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
// 判断当前活动类型
|
||||
params.getType != "ACTIVITY" ? delete params.effectiveDays : "";
|
||||
|
||||
//判断当前时间类型
|
||||
if (this.rangeTimeType == 1) {
|
||||
params.rangeDayType = "FIXEDTIME";
|
||||
params.startTime = this.$options.filters.unixToDate(
|
||||
this.form.rangeTime[0] / 1000
|
||||
);
|
||||
params.endTime = this.$options.filters.unixToDate(
|
||||
this.form.rangeTime[1] / 1000
|
||||
);
|
||||
delete params.rangeTime
|
||||
delete params.effectiveDays;
|
||||
} else {
|
||||
params.rangeDayType = "DYNAMICTIME";
|
||||
delete params.rangeTime;
|
||||
}
|
||||
|
||||
let scopeId = [];
|
||||
|
||||
if (
|
||||
|
@ -328,7 +366,7 @@ export default {
|
|||
(!params.promotionGoodsList ||
|
||||
params.promotionGoodsList.length == 0)
|
||||
) {
|
||||
this.$Modal.warning({ title: "提示", content: "请选择指定商品" });
|
||||
this.$Modal.warning({title: "提示", content: "请选择指定商品"});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -336,7 +374,7 @@ export default {
|
|||
params.scopeType == "PORTION_GOODS_CATEGORY" &&
|
||||
(!params.scopeIdGoods || params.scopeIdGoods.length == 0)
|
||||
) {
|
||||
this.$Modal.warning({ title: "提示", content: "请选择商品分类" });
|
||||
this.$Modal.warning({title: "提示", content: "请选择商品分类"});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -392,12 +430,13 @@ export default {
|
|||
);
|
||||
this.$router.go(-1);
|
||||
},
|
||||
openSkuList() { // 显示商品选择器
|
||||
openSkuList() {
|
||||
// 显示商品选择器
|
||||
this.$refs.skuSelect.open("goods");
|
||||
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList))
|
||||
data.forEach(e => {
|
||||
e.id = e.skuId
|
||||
})
|
||||
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
|
||||
data.forEach((e) => {
|
||||
e.id = e.skuId;
|
||||
});
|
||||
this.$refs.skuSelect.goodsData = data;
|
||||
},
|
||||
changeSelect(e) {
|
||||
|
@ -480,7 +519,7 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
return { value: item.id, label: item.name, children: item.children };
|
||||
return {value: item.id, label: item.name, children: item.children};
|
||||
});
|
||||
},
|
||||
filterCategory(list) {
|
||||
|
@ -522,10 +561,20 @@ h4 {
|
|||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.describe {
|
||||
font-size: 12px;
|
||||
margin-left: 10px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.effectiveDays {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
|
||||
> * {
|
||||
margin: 0 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue