Merge branch 'dev-ryan'

# Conflicts:
#	buyer/src/components/header/Header.vue
#	buyer/src/components/invoiceModal/index.vue
#	manager/src/config/index.js
master
Chopper 2021-06-21 14:26:47 +08:00
commit d57b33cb4e
150 changed files with 6782 additions and 3034 deletions

View File

@ -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>

View File

@ -441,3 +441,39 @@ export function memberPointHistory (params) {
params
});
}
/**
* 分页获取会员站内信
* @param {Object} params 请求参数包括pageNumberpageSizestatus
*/
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
});
}

View File

@ -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)
}
},

View File

@ -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);

View File

@ -59,7 +59,6 @@ export default {
isActive: 0 // tab
};
},
mounted () {},
methods: {
//
callBack () {

View File

@ -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{
text-align: right;
.pageration {
text-align: right;
}
</style>

View File

@ -151,8 +151,6 @@ export default {
]
};
},
components: {},
mounted () {},
methods: {
getCartList () { //
this.loading = true

View File

@ -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
})

View File

@ -13,11 +13,6 @@
<script>
export default {
name: 'Main',
data () {
return {
};
},
props: {
_Title: { //
type: null,

View File

@ -62,7 +62,7 @@ export default {
};
},
methods: {
goArticle () { //
goArticle () { //
let routeUrl = this.$router.resolve({
path: '/article'
})

View File

@ -19,7 +19,7 @@ export default {
time: { //
default: 1718977559428
},
type: {
type: { //
default: 'goodsDetail', // goodsDetailcart
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);
}

View File

@ -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>
</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) {

View File

@ -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;

View File

@ -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>

View File

@ -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>

View File

@ -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,18 @@
</DropdownMenu>
</Dropdown>
</li>
<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>
<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">
<Icon size="18" class="cart-icon" type="ios-cart-outline"></Icon>
<Icon
size="18"
type="ios-cart-outline"
></Icon>
购物车
</span>
@ -116,37 +119,28 @@ export default {
},
},
methods: {
handleClickTheme() {
this.themeType === "light"
? (this.themeType = "dark")
: (this.themeType = "light");
window.document.documentElement.setAttribute(
"data-theme",
this.themeType
);
},
changeCity(city) {
changeCity (city) { //
this.city = city;
},
goToPay() {
goToPay () { //
let url = this.$router.resolve({
path: "/cart",
});
window.open(url.href, "_blank");
},
myInfo() {
myInfo () { //
let url = this.$router.resolve({
path: "/home",
});
window.open(url.href, "_blank");
},
signOutFun() {
storage.removeItem("accessToken");
storage.removeItem("refreshToken");
storage.removeItem("userInfo");
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');
},
goUserCenter(path) {
//
@ -230,13 +224,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 +371,6 @@ export default {
.sign-out p {
font-size: 12px;
}
.cart-icon {
padding: 0 6px;
}
.goods-title:hover {
color: $theme_color;
}

View File

@ -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>
<div class="shop-title-content">
<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>

View File

@ -23,7 +23,7 @@ export default {
}
},
methods: {
goCartList () {
goCartList () { //
let routerUrl = this.$router.resolve({
path: '/cart'
})

View File

@ -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}

View File

@ -32,7 +32,6 @@ export default {
options: this.data.options //
};
},
methods: {}
};
</script>
<style lang="scss" scoped>

View File

@ -50,9 +50,8 @@ export default {
this.$emit('content', val);
}
},
mounted () {},
methods: {
changeCurr (index) {
changeCurr (index) { //
this.currentIndex = index;
}
}

View File

@ -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'
});

View File

@ -1,3 +1 @@
## 此组件为结算页面修改发票信息使用 后续可以复用到个人信息添加发票页面
### 目前没有参数,之后会设置一个参数接收历史的单位发票数据

View File

@ -11,37 +11,42 @@
</div> -->
<!-- 普通发票 -->
<div class="nav-content">
<Form :model="invoiceForm" ref="form" label-position="left" :rules="ruleInline" :label-width="110">
<Form
:model="invoiceForm"
ref="form"
label-position="left"
:rules="ruleInline"
:label-width="110"
>
<FormItem label="发票类型">
<RadioGroup v-model="invoice" type="button" button-style="solid">
<Radio @on-change="changeInvoice" :label="1">电子普通发票</Radio>
<Radio :label="2" :disabled="true">增值税专用发票</Radio>
</RadioGroup>
</FormItem>
<FormItem label="发票抬头">
<RadioGroup v-model="type" @on-change="changeInvoice" type="button" button-style="solid">
<RadioGroup v-model="invoiceForm.type" type="button" button-style="solid">
<Radio :label="1">个人</Radio>
<Radio :label="2">单位</Radio>
</RadioGroup>
</FormItem>
<FormItem label="个人名称" v-if="type === 1" prop="receiptTitle">
<FormItem
label="发票抬头"
v-if="invoiceForm.type == 2"
prop="receiptTitle"
>
<i-input v-model="invoiceForm.receiptTitle"></i-input>
</FormItem>
<FormItem label="单位名称" v-if="type === 2" prop="receiptTitle">
<i-input v-model="invoiceForm.receiptTitle"></i-input>
</FormItem>
<FormItem label="纳税人识别号" v-if="type === 2" prop="taxpayerId">
<FormItem
label="纳税人识别号"
v-if="invoiceForm.type == 2"
prop="taxpayerId"
>
<i-input v-model="invoiceForm.taxpayerId"></i-input>
</FormItem>
<FormItem label="发票内容">
<RadioGroup v-model="invoiceForm.receiptContent" type="button" button-style="solid">
<Radio label="不开发票">不开发票</Radio>
<Radio label="商品明细">商品明细</Radio>
<Radio label="商品类别">商品类别</Radio>
</RadioGroup>
</FormItem>
</Form>
<div style="text-align: center">
<Button type="primary" :loading="loading" @click="submit"></Button>
<Button type="primary" :loading="loading" @click="save"></Button>
<Button type="default" @click="invoiceAvailable = false">取消</Button>
</div>
</div>
@ -49,104 +54,100 @@
</div>
</template>
<script>
import { receiptSelect } from "@/api/cart.js";
import { TINumber } from "@/plugins/RegExp.js";
import { saveReceipt } from '@/api/member.js';
import { TINumber } from '@/plugins/RegExp.js';
export default {
name: "invoiceModal",
data() {
name: 'invoiceModal',
data () {
return {
invoice: 1,
invoiceAvailable: false, //
loading: false, //
invoiceForm: {
//
invoiceForm: { //
//
receiptTitle: "", //
taxpayerId: "", //
receiptContent: "商品明细", //
receiptTitle: '', //
taxpayerId: '', //
receiptContent: '不开发票', //
type: 1 // 1 2
},
type: 1, // 1 2
ruleInline: {
ruleInline: { //
receiptTitle: [{ required: true, message: '请填写公司名称' }],
taxpayerId: [
{ required: true, message: "请填写纳税人识别号" },
{ pattern: TINumber, message: "请填写正确的纳税人识别号" },
],
},
{ required: true, message: '请填写纳税人识别号' },
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
]
}
};
},
props: ["invoiceData"],
watch: {
invoiceData: {
handler(val) {
this.invoiceForm = { ...val };
if (val.taxpayerId) {
this.type = 2;
} else {
this.type = 1;
}
},
deep: true,
immeadite: true,
},
},
methods: {
/**
* 选择发票抬头
*/
changeInvoice(val) {
this.$nextTick(() => {
this.type = val;
});
},
/**
* 保存判断
*/
save() {
let flage = true;
//
const { type, receiptTitle, receiptContent } = JSON.parse(
JSON.stringify(this.invoiceForm)
);
//
if (!receiptTitle) {
this.$Message.error("请填写发票抬头!");
flage = false;
return false;
}
if (type == 2) {
this.$refs.form.validate((valid) => {
if (!valid) {
flage = false;
save () { //
if (this.invoiceForm.type === 1) {
//
let flag = true;
this.receiptItems.forEach((e) => {
if (
e.receiptTitle === '个人' &&
e.receiptContent === this.invoiceForm.receiptContent
) {
this.$emit('change', e);
flag = false;
this.invoiceAvailable = false;
}
});
} else {
delete this.invoiceForm.taxpayerId;
}
return flage;
},
async submit() {
if (this.save()) {
this.loading = true;
let submit = {
way: this.$route.query.way,
...this.invoiceForm,
};
let receipt = await receiptSelect(submit);
if (receipt.success) {
this.$emit("change", true);
if (flag) {
let params = {
receiptTitle: '个人',
receiptContent: this.invoiceForm.receiptContent
};
this.loading = true;
saveReceipt(params)
.then((res) => {
this.loading = false;
if (res.success) {
this.$emit('change', res.result);
this.invoiceAvailable = false;
}
})
.catch(() => {
this.loading = false;
});
}
this.loading = false;
} else {
//
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
let params = {
receiptTitle: this.invoiceForm.receiptTitle,
taxpayerId: this.invoiceForm.taxpayerId,
receiptContent: this.invoiceForm.receiptContent
};
let flag = true;
this.receiptItems.forEach((e) => {
if (e.taxpayerId === params.taxpayerId) {
flag = false;
}
});
if (!flag) {
this.$Message.error('已有当前税号的发票信息,请直接选择已有发票');
} else {
saveReceipt(params)
.then((res) => {
this.loading = false;
if (res.success) {
this.$emit('change', res.result);
this.invoiceAvailable = false;
}
})
.catch(() => {
this.loading = false;
});
}
}
});
}
},
},
}
}
};
</script>
<style lang="scss" scoped>

View File

@ -85,7 +85,7 @@ export default {
this.$emit('getAddress', this.addrContent);
}
},
init () {
init () { //
AMapLoader.load({
key: 'b440952723253aa9fe483e698057bf7d', // WebKey load
version: '', // JSAPI 1.4.15

View File

@ -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) => {

View File

@ -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 () {
// idid
if (this.$route.query.categoryId) {
let cateId = this.$route.query.categoryId.split(',')
Object.assign(this.params, this.$route.query)

View File

@ -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()

View File

@ -6,7 +6,7 @@
#### 在组件上添加v-if来判断组件显隐
#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ]等,详情看接口文档
#### verifyType 验证格式[ 'LOGIN' ,'REGISTER' ]
#### @change方法 获取回调,参数为对象 {status:false,distance:100} status 为回调状态distance为移动距离

View File

@ -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;
});

View File

@ -26,7 +26,3 @@ export function postVerifyImg (params) {
headers: {uuid: storage.getItem('uuid')}
});
}
export function mouseup () {
console.log(111);
}

View File

@ -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',

View File

@ -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({

View File

@ -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;

View File

@ -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;
}

View File

@ -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');

View File

@ -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>

View File

@ -25,13 +25,6 @@
<script>
export default {
name: 'AccountBind',
data () {
return {}
},
mounted () {
},
methods: {}
}
</script>

View File

@ -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 }})
},
//

View File

@ -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;

View File

@ -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('请填写对话内容');

View File

@ -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 }})
}
}

View File

@ -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()
},

View File

@ -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}

View File

@ -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();
}
}

View File

@ -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'}
],

View File

@ -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()

View File

@ -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 () {}
}
}

View File

@ -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({

View File

@ -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;
}

View File

@ -0,0 +1,17 @@
<template>
<div class="msg-list">
会员消息详情
</div>
</template>
<script>
export default {
data() {
return {
detail: {}, //
}
},
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -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>

View File

@ -79,7 +79,7 @@ export default {
};
},
methods: {
save () {
save () { //
this.$refs.form.validate((valid) => {
if (valid) {
const params = JSON.parse(JSON.stringify(this.formData));

View File

@ -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()

View File

@ -75,7 +75,7 @@ export default {
}
})
},
getLog () {
getLog () { //
afterSaleLog(this.$route.query.sn).then(res => {
this.logList = res.result;
})

View File

@ -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({

View File

@ -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({

View File

@ -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('取消订单成功')

View File

@ -128,7 +128,7 @@ export default {
}
})
},
traces () {
traces () { //
getTraces(this.$route.query.sn).then(res => {
if (res.success) {
this.logistics = res.result

View File

@ -41,6 +41,11 @@ const member = [{
title: '账户安全',
path: 'AccountSafe'
},
{
icon: '',
title: '我的消息',
path: 'MsgList'
},
{
icon: '',
title: '我的足迹',

View File

@ -1,77 +1,133 @@
// 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;
// 如果是put/post请求用qs.stringify序列化参数
const isPutPost = config.method === 'put' || config.method === 'post';
const isJson = config.headers['Content-Type'] === 'application/json';
const isFile = config.headers['Content-Type'] === 'multipart/form-data';
if (isPutPost && isJson) {
config.data = JSON.stringify(config.data);
service.interceptors.request.use(
config => {
const { loading } = config;
// 如果是put/post请求用qs.stringify序列化参数
const isPutPost = config.method === "put" || config.method === "post";
const isJson = config.headers["Content-Type"] === "application/json";
const isFile = config.headers["Content-Type"] === "multipart/form-data";
if (isPutPost && isJson) {
config.data = JSON.stringify(config.data);
}
if (isPutPost && !isFile && !isJson) {
config.data = qs.stringify(config.data, {
arrayFormat: "repeat"
});
}
/** 配置全屏加载 */
if (process.client && loading !== false) {
config.loading = Spin.show();
}
const uuid = Storage.getItem("uuid");
config.headers["uuid"] = uuid;
// 获取访问Token
let accessToken = Storage.getItem("accessToken");
if (accessToken && config.needToken) {
config.headers["accessToken"] = accessToken;
// 解析当前token时间
let jwtData = JSON.parse(
decodeURIComponent(escape(window.atob(accessToken.split(".")[1])))
);
if (jwtData.exp < Math.round(new Date() / 1000)) {
refresh()
}
}
return config;
},
error => {
Promise.reject(error);
}
if (isPutPost && !isFile && !isJson) {
config.data = qs.stringify(config.data, {
arrayFormat: 'repeat'
);
async function refresh() {
const getTokenRes = await refreshToken();
if (getTokenRes === "success") {
// 刷新token
if (isRefreshToken === 1) {
error.response.config.headers.accessToken = Storage.getItem(
"accessToken"
);
return service(error.response.config);
} else {
router.go(0);
}
} else {
Storage.removeItem("accessToken");
Storage.removeItem("refreshToken");
Storage.removeItem("userInfo");
Storage.setItem("cartNum", 0);
store.commit("SET_CARTNUM", 0);
console.log("1111");
Modal.confirm({
title: "请登录",
content: "<p>请登录后执行此操作</p>",
okText: "立即登录",
cancelText: "继续浏览",
onOk: () => {
router.push({
path: "/login",
query: {
rePath: router.history.current.path,
query: JSON.stringify(router.history.current.query)
}
});
},
onCancel: () => {
Modal.remove();
}
});
}
/** 配置全屏加载 */
if (process.client && loading !== false) {
config.loading = Spin.show();
}
const uuid = Storage.getItem('uuid');
config.headers['uuid'] = uuid;
// 获取访问Token
let accessToken = Storage.getItem('accessToken');
if (accessToken && config.needToken) {
config.headers['accessToken'] = accessToken;
}
return config;
}, error => {
Promise.reject(error);
});
}
// respone拦截器
service.interceptors.response.use(
async response => {
await closeLoading(response);
return response.data;
},
async error => {
@ -84,45 +140,15 @@ service.interceptors.response.use(
isRefreshToken++;
if (isRefreshToken === 1) {
const getTokenRes = await refreshToken();
if (getTokenRes === 'success') { // 刷新token
if (isRefreshToken === 1) {
error.response.config.headers.accessToken = Storage.getItem('accessToken')
return service(error.response.config)
} else {
router.go(0)
}
} else {
Storage.removeItem('accessToken');
Storage.removeItem('refreshToken');
Storage.removeItem('userInfo');
Storage.setItem('cartNum', 0)
store.commit('SET_CARTNUM', 0)
console.log('1111');
Modal.confirm({
title: '请登录',
content: '<p>请登录后执行此操作</p>',
okText: '立即登录',
cancelText: '继续浏览',
onOk: () => {
router.push({
path: '/login',
query: {
rePath: router.history.current.path,
query: JSON.stringify(router.history.current.query)
}
});
},
onCancel: () => {
Modal.remove();
}
});
}
isRefreshToken = 0
refresh()
isRefreshToken = 0;
}
} else {
if (error.message) {
let _message = error.code === 'ECONNABORTED' ? '连接超时,请稍候再试!' : '网络错误,请稍后再试!';
let _message =
error.code === "ECONNABORTED"
? "连接超时,请稍候再试!"
: "网络错误,请稍后再试!";
Message.error(errorData.message || _message);
}
}
@ -134,7 +160,7 @@ service.interceptors.response.use(
* 关闭全局加载
* @param target
*/
const closeLoading = (target) => {
const closeLoading = target => {
if (!target.config || !target.config.loading) return true;
return new Promise((resolve, reject) => {
setTimeout(() => {
@ -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 => {
if (res.success) {
let {
accessToken,
refreshToken
} = res.result;
Storage.setItem('accessToken', accessToken);
Storage.setItem('refreshToken', refreshToken);
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);
success = true
lock = false
} else {
success = false
lock = false
// router.push('/login')
}
}).catch((err) => {
console.log(err);
success = false
lock = false
})
success = true;
lock = false;
} else {
success = false;
lock = false;
// router.push('/login')
}
})
.catch(err => {
console.log(err);
success = false;
lock = false;
});
}
return new Promise(resolve => {
// 一直看lock,直到请求失败或者成功
const timer = setInterval(() => {
if (!lock) {
clearInterval(timer)
clearInterval(timer);
if (success) {
resolve('success')
resolve("success");
} else {
resolve('fail')
resolve("fail");
}
}
}, 500) // 轮询时间间隔
})
}
}, 500); // 轮询时间间隔
});
};
}

View File

@ -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',

View File

@ -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",

View File

@ -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>

View File

@ -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);
};

View File

@ -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}`);
};

View File

@ -21,11 +21,10 @@ export default {
// buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn"
common: "http://192.168.0.109:8890",
buyer: "http://192.168.0.109:8888",
seller: "http://192.168.0.109:8889",
manager: "http://192.168.0.109:8887"
common: 'http://192.168.0.109:8890',
buyer: 'http://192.168.0.109:8888',
seller: 'http://192.168.0.109:8889',
manager: 'http://192.168.0.109:8887'
},
api_prod: {
common: "https://common-api.pickmall.cn",

View File

@ -24,6 +24,8 @@ service.interceptors.request.use(
...config.params
}
}
const uuid = getStore('uuid');
config.headers['uuid'] = uuid;
return config;
},
err => {

View File

@ -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")
}
]
};

View File

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

View File

@ -10,67 +10,77 @@
<span slot="close">关闭</span>
</i-switch>
</FormItem>
<FormItem label="分销关系绑定天数" prop="distributionDay">
<InputNumber :min="1" style="width:100px;" v-model="form.distributionDay" @on-change="handleSubmit"></InputNumber>
</FormItem>
<FormItem label="分销结算天数" prop="cashDay">
<InputNumber :min="1" style="width:100px;" v-model="form.cashDay" @on-change="handleSubmit "></InputNumber>
</FormItem>
</Form>
</div>
</template>
<script>
import { setSetting, getSetting } from "@/api/index";
import {setSetting, getSetting} from "@/api/index";
export default {
name: "distributionSetting",
components: {},
data() {
return {
loading: true, //
form: { //
isOpen: ""
},
//
formValidate: {},
submitLoading: false, //
selectList: [], //
selectCount: 0, //
data: [], //
total: 0 //
};
},
methods: {
init() {
this.getDataList();
export default {
name: "distributionSetting",
components: {},
data() {
return {
loading: true, //
form: {
//
isOpen: "",
distributionDay: "", //
cashDay: "", //
},
getDataList() {
this.loading = true;
//
getSetting("DISTRIBUTION_SETTING").then(res => {
this.loading = false;
if (res.success) {
this.form = res.result;
}
});
//
formValidate: {},
submitLoading: false, //
selectList: [], //
selectCount: 0, //
data: [], //
total: 0, //
};
},
methods: {
init() {
this.getDataList();
},
getDataList() {
this.loading = true;
//
getSetting("DISTRIBUTION_SETTING").then((res) => {
this.loading = false;
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
setSetting("DISTRIBUTION_SETTING", this.form).then(res => {
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
}
})
}
if (res.success) {
this.form = res.result;
}
});
this.loading = false;
},
mounted() {
this.init();
}
};
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
//
this.$options.filters.debounce(this.submit(), 1500);
}
});
},
submit() {
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -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,

View File

@ -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"; //goodspc 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>

View File

@ -1,7 +1,7 @@
<template>
<Modal :styles="{ top: '120px' }" width="1160" @on-cancel="clickClose" @on-ok="clickOK" v-model="flag" :mask-closable="false" scrollable>
<template v-if="flag">
<goodsDialog @selected="(val) => {goodsData = val;}"
<goodsDialog @selected="(val) => {goodsData = val;}"
v-if="goodsFlag" ref="goodsDialog" :selectedWay='goodsData'/>
<linkDialog @selectedLink="
(val) => {
@ -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 {
@ -60,7 +62,7 @@ export default {
} else {
this.goodsFlag = false;
}
},
close() {
this.flag = false;

View File

@ -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>

View File

@ -8,7 +8,7 @@
<div class="full-shadow" v-if="type == 'full'">
<img :src="advertising[0].img" alt="" />
</div>
</div>
</div>
</div>
@ -16,7 +16,7 @@
<div class="decorate">
<div class="decorate-title">全屏广告</div>
<div class="decorate-list">
<div
@ -79,11 +79,11 @@
</div>
</template>
<script>
import { btnWay } from "./btn.js";
export default {
data() {
return {
btnWay, //
type: "full", //
//广
@ -100,21 +100,16 @@ export default {
},
methods: {},
mounted() {
console.log(this.btnWay);
},
methods: {
//
clickLink(item) {
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];
@ -177,4 +172,4 @@ export default {
height: 30px;
}
}
</style>
</style>

View File

@ -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];
@ -171,4 +166,4 @@ export default {
height: 30px;
}
}
</style>
</style>

View File

@ -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"
},
];

View File

@ -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>

View File

@ -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
}

View File

@ -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",
@ -128,11 +113,13 @@ export default {
//
update() {
this.progress = false;
this.progress = false;
API_Other.updateHome(this.$route.query.id, {
pageData: JSON.stringify(this.$store.state.styleStore),
name: this.submitWay.name,
pageShow: this.submitWay.pageShow,
pageType: "INDEX",
pageClientType: "H5",
})
.then((res) => {
this.num = 50;
@ -175,7 +162,7 @@ export default {
this.goback();
}, 1000);
} else {
this.progress = true;
this.progress = true;
this.saveDialog = false;
this.$Message.error("保存失败,请稍后重试");
}

View File

@ -1,6 +1,6 @@
.image-mode {
max-width: 100%;
height: auto;
width: 100%;
height: 100%;
display: block;
padding: 1px;
}

View File

@ -1,11 +1,11 @@
<template>
<div class="layout">
<img class="image-mode" :src="res.list[0].img" alt="">
<img class="image-mode" :src="res.list[1].img" alt="">
<img class="image-mode" :src="res.list[2].img" alt="">
<img class="image-mode" :src="res.list[3].img" alt="">
<img class="image-mode" :src="res.list[4].img" alt="">
<img class="image-mode" :src="res.list[0].img" alt="">
<img class="image-mode" :src="res.list[1].img" alt="">
<img class="image-mode" :src="res.list[2].img" alt="">
<img class="image-mode" :src="res.list[3].img" alt="">
<img class="image-mode" :src="res.list[4].img" alt="">
</div>
</template>
@ -13,21 +13,18 @@
export default {
title: "五列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
background: #e8e8e8;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
}
img{
img {
width: 67px;
}
</style>
</style>

View File

@ -12,21 +12,22 @@
export default {
title: "四列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
height: 84px;
// background: #e8e8e8;
// height: 84px;
display: flex;
padding: 0 8px;
align-items: center;
justify-content: center;
background-size: cover;
}
img{
width: 84px;
}
</style>
</style>

View File

@ -11,14 +11,12 @@
export default {
title: "三列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
background: #e8e8e8;
height: 110px;
display: flex;
align-items: center;
@ -28,4 +26,4 @@ export default {
img{
width: 111px;
}
</style>
</style>

View File

@ -20,7 +20,7 @@ export default {
title: "左一右二",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
@ -34,4 +34,4 @@ export default {
background-size: cover;
}
</style>
</style>

View File

@ -10,7 +10,7 @@
</div>
</div>
<div class="view-height-150">
<img class="image-mode" :src="res.list[2].img" />
<img class="image-mode" style="height:150px;" :src="res.list[2].img" />
</div>
</div>
</template>
@ -21,18 +21,22 @@ export default {
props: ["res"],
mounted() {
console.log(this.res);
}
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
height: 167px;
height: 150px;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
}
</style>
.view-height-75 {
.image-mode {
height: 75px;
}
}
</style>

View File

@ -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,22 +108,34 @@ export default {
});
},
submitLogin() {
//
this.$refs.usernameLoginForm.validate((valid) => {
if (valid) {
this.loading = true;
login({
username: this.form.username,
password: this.md5(this.form.password),
}).then((res) => {
if (res && res.success) {
this.afterLogin(res);
} else {
this.loading = false;
}
});
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) => {
if (res && res.success) {
this.afterLogin(res);
} else {
this.loading = false;
}
})
.catch(() => {
this.loading = false;
});
this.$refs.verify.show = false;
},
},
};
</script>
@ -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>

View File

@ -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>

View File

@ -55,6 +55,7 @@ export default {
},
methods: {
changeMenu(name) { //
console.log(name)
this.$router.push({
name: name
});

View File

@ -21,11 +21,11 @@
<Button @click="addMember" type="primary">添加会员</Button>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
</Table>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
</Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
</Card>
@ -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 {

View File

@ -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>

View File

@ -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;
// liliheadertoken
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;

View File

@ -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>

View File

@ -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>

View File

@ -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);
};

View File

@ -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>

View File

@ -57,7 +57,7 @@
<Input type="number" v-model="form.sort" clearable style="width: 10%" />
</FormItem>
<FormItem class="form-item-view-el" label="文章内容" prop="content">
<editor v-model="form.content"></editor>
<editor openXss v-model="form.content"></editor>
</FormItem>
<FormItem label="是否展示" prop="openStatus">
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
@ -72,7 +72,7 @@
</div>
</Modal>
</template>
</Card>
</Col>
@ -123,7 +123,7 @@ export default {
searchTreeValue: "", //
form: {
//
openStatus:false,
openStatus: false,
title: "",
categoryId: "",
sort: 1,
@ -380,7 +380,6 @@ export default {
//
this.data = [];
if (res.result.records.length > 0) {
this.data = res.result.records;
}
}
@ -390,7 +389,6 @@ export default {
},
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
@ -403,7 +401,6 @@ export default {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
} else {
@ -414,8 +411,6 @@ export default {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
}
@ -440,10 +435,25 @@ export default {
this.form.categoryId = res.result.categoryId;
this.treeValue = data.articleCategoryName;
this.form.id = data.id;
this.form.content = res.result.content;
this.form.content = htmlEscape(res.result.content);
this.form.title = res.result.title;
this.form.sort = res.result.sort;
this.form.openStatus = res.result.openStatus
this.form.openStatus = res.result.openStatus;
}
});
},
htmlEscape(text) {
return text.replace(/[<>"&]/g, function (match, pos, originalText) {
switch (match) {
case "<":
return "&lt;";
case ">":
return "&gt;";
case "&":
return "&amp;";
case '"':
return "&quot;";
}
});
},

View File

@ -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) => {
return h("div", {
domProps:
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime}
});
if (params.row.getType === "ACTIVITY") {
return h("div", "长期有效");
} else {
return h("div", {
domProps: {
innerHTML:
params.row.startTime + "<br/>" + params.row.endTime,
},
});
}
},
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();
},
};

View File

@ -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">
@ -33,33 +33,49 @@
<FormItem label="店铺承担比例" prop="storeCommission">
<Input v-model="form.storeCommission" placeholder="店铺承担比例" style="width: 260px">
<span slot="append">%</span>
<span slot="append">%</span>
</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"
>
</DatePicker>
<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.startTime = this.$options.filters.unixToDate(
this.form.rangeTime[0] / 1000
);
params.endTime = this.$options.filters.unixToDate(
this.form.rangeTime[1] / 1000
);
delete params.rangeTime
//
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.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) {
@ -434,15 +473,15 @@ export default {
//
let list = [];
item.forEach((e) => {
list.push({
goodsName: e.goodsName,
price: e.price,
originalPrice: e.price,
quantity: e.quantity,
storeId: e.storeId,
storeName: e.storeName,
skuId: e.id,
});
list.push({
goodsName: e.goodsName,
price: e.price,
originalPrice: e.price,
quantity: e.quantity,
storeId: e.storeId,
storeName: e.storeName,
skuId: e.id,
});
});
this.form.promotionGoodsList = list;
},
@ -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