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 charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="./static/logo.ico" type="image/x-icon"> <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> <title>LILI</title>
</head> </head>
<body> <body>

View File

@ -441,3 +441,39 @@ export function memberPointHistory (params) {
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: { methods: {
selectTags (item) { selectTags (item) { //
this.searchData = item; this.searchData = item;
this.search(); this.search();
}, },
search () { search () { //
this.$router.push({ this.$router.push({
path: '/goodsList', path: '/goodsList',
query: { keyword: this.searchData } query: { keyword: this.searchData }
}); });
}, },
searchStore () { searchStore () { //
this.$emit('search', this.searchData) this.$emit('search', this.searchData)
} }
}, },

View File

@ -57,7 +57,7 @@ import {
export default { export default {
name: 'addressManage', name: 'addressManage',
props: { props: {
id: { id: { // id
defalut: '', defalut: '',
type: String type: String
} }
@ -89,7 +89,7 @@ export default {
}; };
}, },
methods: { methods: {
save () { save () { //
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const params = JSON.parse(JSON.stringify(this.formData)); const params = JSON.parse(JSON.stringify(this.formData));
@ -138,15 +138,15 @@ export default {
this.formData.lat = item.position.lat; this.formData.lat = item.position.lat;
this.formData.lon = item.position.lng; this.formData.lon = item.position.lng;
}, },
show () { show () { //
this.showAddr = true; this.showAddr = true;
}, },
hide () { hide () { //
this.showAddr = false; this.showAddr = false;
} }
}, },
watch: { watch: {
id: { id: { // id
handler: function (v) { handler: function (v) {
if (v) { if (v) {
this.getAddrById(v); this.getAddrById(v);

View File

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

View File

@ -44,7 +44,7 @@ export default {
}; };
}, },
methods: { methods: {
getList () { getList () { //
this.loading = true this.loading = true
memberCouponList(this.params).then(res => { memberCouponList(this.params).then(res => {
this.loading = false this.loading = false
@ -67,18 +67,18 @@ export default {
} }
}, },
changePageNum (val) { changePageNum (val) { //
this.params.pageNumber = val; this.params.pageNumber = val;
this.getList() this.getList()
}, },
changePageSize (val) { changePageSize (val) { //
this.pageNumber = 1; this.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;
this.getList() this.getList()
}, },
useScope (type, storeName) { useScope (type, storeName) { //
let shop = '平台'; let shop = '平台';
let goods = '全部商品' let goods = '全部商品'
if (storeName !== 'platform') shop = storeName if (storeName !== 'platform') shop = storeName

View File

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

View File

@ -44,12 +44,12 @@ export default {
} }
}, },
methods: { methods: {
showCartNum (item) { showCartNum (item) { //
if (this.userInfo && item.title === '购物车') { if (this.userInfo && item.title === '购物车') {
this.getCartList() this.getCartList()
} }
}, },
clickBar (val) { clickBar (val) { // tabbar
if (!this.userInfo) { if (!this.userInfo) {
this.$Modal.confirm({ this.$Modal.confirm({
title: '请登录', title: '请登录',
@ -83,7 +83,7 @@ export default {
} }
} }
}, },
openBlank (path) { openBlank (path) { //
let routerUrl = this.$router.resolve({ let routerUrl = this.$router.resolve({
path: path path: path
}) })

View File

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

View File

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

View File

@ -19,7 +19,7 @@ export default {
time: { // time: { //
default: 1718977559428 default: 1718977559428
}, },
type: { type: { //
default: 'goodsDetail', // goodsDetailcart default: 'goodsDetail', // goodsDetailcart
type: String type: String
} }
@ -37,7 +37,7 @@ export default {
this.init() this.init()
}, },
methods: { methods: {
countDown (val) { countDown (val) { //
function addZero (i) { function addZero (i) {
return i < 10 ? '0' + i : i + ''; return i < 10 ? '0' + i : i + '';
} }
@ -58,8 +58,8 @@ export default {
clearInterval(this.interval) clearInterval(this.interval)
} }
}, },
init () { init () { //
this.interval = setInterval((item) => { this.interval = setInterval(() => {
this.countDown(this.time); this.countDown(this.time);
}, 1000); }, 1000);
} }

View File

@ -20,7 +20,6 @@
<div class="goodsConfig mt_10"> <div class="goodsConfig mt_10">
<span @click="collect" ><Icon type="ios-heart" :color="isCollected ? '#ed3f14' : '#666'" />{{isCollected?'已收藏':'收藏'}}</span> <span @click="collect" ><Icon type="ios-heart" :color="isCollected ? '#ed3f14' : '#666'" />{{isCollected?'已收藏':'收藏'}}</span>
<!-- <span>举报</span> -->
</div> </div>
</div> </div>
<!-- 右侧商品信息活动信息操作展示 --> <!-- 右侧商品信息活动信息操作展示 -->
@ -60,7 +59,7 @@
:key="index" :key="index"
@click="receiveCoupon(item.id)" @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 v-if="item.couponType == 'DISCOUNT'">{{ item.consumeThreshold }}{{item.couponDiscount}}</span>
</span> </span>
</p> </p>
@ -120,38 +119,16 @@
<span class="inventory"> {{skuDetail.weight}}kg</span> <span class="inventory"> {{skuDetail.weight}}kg</span>
</div> </div>
</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="error" :loading="loading" :disabled="skuDetail.quantity === 0" @click="addShoppingCartBtn"></Button>
<Button type="warning" :loading="loading1" :disabled="skuDetail.quantity === 0" @click="buyNow"></Button> <Button type="warning" :loading="loading1" :disabled="skuDetail.quantity === 0" @click="buyNow"></Button>
</div> </div>
</div>
</div>
<!-- <div class="item-detail-see"> </div>
<Divider>更多推荐</Divider> </div>
<Row>
<Col :span="24" class="see-Item">
<img class="see-Img" src="https://demo.dscmall.cn/storage/images/201703/thumb_img/0_thumb_G_1489099128797.jpg" alt="" />
<p>
名龙堂i7 6700升7700 GTX1060 6G台式电脑主机DIY游戏组装整机
升6GB独显 送正版WIN10 一年上门
</p>
<p class="global_color">2500.00</p>
</Col>
<Col :span="24" class="see-Item">
<img
class="see-Img"
src="https://demo.dscmall.cn/storage/images/201703/thumb_img/0_thumb_G_1489099128797.jpg"
alt=""
/>
<p>
名龙堂i7 6700升7700 GTX1060 6G台式电脑主机DIY游戏组装整机
升6GB独显 送正版WIN10 一年上门
</p>
<p class="global_color">2500.00</p>
</Col>
</Row>
</div> -->
</div> </div>
</div> </div>
</template> </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 () { // async collect () { //
if (this.isCollected) { if (this.isCollected) {
let cancel = await cancelCollect('GOODS', this.skuDetail.id) let cancel = await cancelCollect('GOODS', this.skuDetail.id)
@ -338,6 +331,7 @@ export default {
} }
}, },
mounted () { mounted () {
//
if (this.Cookies.getItem('userInfo')) { if (this.Cookies.getItem('userInfo')) {
isCollection('GOODS', this.skuDetail.id).then(res => { isCollection('GOODS', this.skuDetail.id).then(res => {
if (res.success && res.result) { if (res.success && res.result) {

View File

@ -38,10 +38,10 @@
</div> </div>
</div> </div>
<div class="remarks-bar"> <div class="remarks-bar">
<span @click="searchByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span> <span @click="viewByGrade('')" :class="{selectedBar: commentParams.grade === ''}">全部({{commentTypeNum.all}})</span>
<span @click="searchByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span> <span @click="viewByGrade('GOOD')" :class="{selectedBar: commentParams.grade === 'GOOD'}">好评({{commentTypeNum.good}})</span>
<span @click="searchByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span> <span @click="viewByGrade('MODERATE')" :class="{selectedBar: commentParams.grade === 'MODERATE'}">中评({{commentTypeNum.moderate}})</span>
<span @click="searchByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span> <span @click="viewByGrade('WORSE')" :class="{selectedBar: commentParams.grade === 'WORSE'}">差评({{commentTypeNum.worse}})</span>
</div> </div>
<div style="text-align: center;margin-top: 20px;" v-if="commentList.length === 0"> <div style="text-align: center;margin-top: 20px;" v-if="commentList.length === 0">
暂无评价数据 暂无评价数据
@ -86,9 +86,6 @@
</div> </div>
</div> </div>
</TabPane> </TabPane>
<!-- <TabPane label="商品问答">
<ShowGoodsQuestion/>
</TabPane> -->
</Tabs> </Tabs>
</div> </div>
</div> </div>
@ -97,7 +94,6 @@
</template> </template>
<script> <script>
import ShowGoodsQuestion from '@/components/goodsDetail/ShowGoodsQuestion';
import { goodsComment, goodsCommentNum } from '@/api/member.js'; import { goodsComment, goodsCommentNum } from '@/api/member.js';
export default { export default {
name: 'ShowGoodsDetail', name: 'ShowGoodsDetail',
@ -122,21 +118,21 @@ export default {
}; };
}, },
computed: { computed: {
skuDetail () { skuDetail () { // skuId
return this.detail.data; return this.detail.data;
} }
}, },
methods: { methods: {
changeHeight (name) { changeHeight (name) { //
let heightCss = window.getComputedStyle(this.$refs[name]).height; let heightCss = window.getComputedStyle(this.$refs[name]).height;
heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89; heightCss = parseInt(heightCss.substr(0, heightCss.length - 2)) + 89;
this.$refs.itemIntroDetail.style.height = heightCss + 'px'; this.$refs.itemIntroDetail.style.height = heightCss + 'px';
}, },
changePageNum (val) { changePageNum (val) { //
this.commentParams.pageNumber = val; this.commentParams.pageNumber = val;
this.getList(); this.getList();
}, },
changePageSize (val) { changePageSize (val) { //
this.commentParams.pageNumber = 1; this.commentParams.pageNumber = 1;
this.commentParams.pageSize = val; this.commentParams.pageSize = val;
this.getList(); this.getList();
@ -155,12 +151,12 @@ export default {
} }
}); });
}, },
searchByGrade (grade) { viewByGrade (grade) { //
this.$set(this.commentParams, 'grade', grade); this.$set(this.commentParams, 'grade', grade);
this.commentParams.pageNumber = 1; this.commentParams.pageNumber = 1;
this.getList(); this.getList();
}, },
tabClick (name) { tabClick (name) { // tab
if (name === 0) { if (name === 0) {
this.$nextTick(() => { this.$nextTick(() => {
this.changeHeight('itemIntroGoods') this.changeHeight('itemIntroGoods')
@ -198,7 +194,7 @@ export default {
} }
} }
}, },
handleScroll () { handleScroll () { //
if (this.onceFlag) { if (this.onceFlag) {
this.$nextTick(() => { this.$nextTick(() => {
this.changeHeight('itemIntroGoods') this.changeHeight('itemIntroGoods')
@ -208,15 +204,12 @@ export default {
} }
}, },
mounted () { mounted () {
this.$nextTick(() => { this.$nextTick(() => { //
setTimeout(this.changeHeight('itemIntroGoods'), 2000); setTimeout(this.changeHeight('itemIntroGoods'), 2000);
}); });
window.addEventListener('scroll', this.handleScroll) window.addEventListener('scroll', this.handleScroll)
this.getList(); this.getList();
}, },
components: {
ShowGoodsQuestion
}
}; };
</script> </script>
@ -283,14 +276,12 @@ export default {
} }
.item-intro-detail{ .item-intro-detail{
margin: 0 30px; margin: 0 30px;
// min-height: 1500px;
width: 100%; width: 100%;
} }
.item-intro-nav{ .item-intro-nav{
width: 100%; width: 100%;
height: 38px; height: 38px;
background-color: #F7F7F7; background-color: #F7F7F7;
// border-bottom: 1px solid $theme_color;
} }
.item-intro-nav ul{ .item-intro-nav ul{
margin: 0px; margin: 0px;
@ -329,8 +320,6 @@ export default {
width: 240px; width: 240px;
height: 36px; height: 36px;
font-size: 14px; font-size: 14px;
/* text-align: center; */
/* background-color: #ccc; */
} }
.item-param-title { .item-param-title {
color: #232323; 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> </li>
</ul> </ul>
<ul class="detail"> <ul class="detail">
<!-- <li class="first hover-pointer" @click="handleClickTheme()"></li> -->
<li class="first" v-show="!userInfo.username"> <li class="first" v-show="!userInfo.username">
<router-link :to="`/login?rePath=${$route.path}&query=${JSON.stringify($route.query)}`"> <router-link :to="`/login?rePath=${$route.path}&query=${JSON.stringify($route.query)}`">
<span style="border:none" class="tipsLogin">请登录</span> <span style="border:none" class="tipsLogin">请登录</span>
@ -35,14 +34,18 @@
</DropdownMenu> </DropdownMenu>
</Dropdown> </Dropdown>
</li> </li>
<li class="hover-color" @click="goUserCenter('/home/MyOrder')"><span class="nav-item">我的订单</span></li> <li @click="goUserCenter('/home/MyOrder')"><span class="nav-item hover-color">我的订单</span></li>
<li class="hover-color" @click="goUserCenter('/home/MyTracks')"><span class="nav-item">我的足迹</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;"> <li v-if="$route.name !== 'Cart'" style="position:relative;">
<i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i> <i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i>
<Dropdown placement="bottom-start"> <Dropdown placement="bottom-start">
<router-link to="/cart" target="_blank"> <router-link to="/cart" target="_blank">
<span @mouseenter="getCartList"> <span @mouseenter="getCartList">
<Icon size="18" class="cart-icon" type="ios-cart-outline"></Icon> <Icon
size="18"
type="ios-cart-outline"
></Icon>
购物车 购物车
</span> </span>
@ -116,37 +119,28 @@ export default {
}, },
}, },
methods: { methods: {
handleClickTheme() { changeCity (city) { //
this.themeType === "light"
? (this.themeType = "dark")
: (this.themeType = "light");
window.document.documentElement.setAttribute(
"data-theme",
this.themeType
);
},
changeCity(city) {
this.city = city; this.city = city;
}, },
goToPay() { goToPay () { //
let url = this.$router.resolve({ let url = this.$router.resolve({
path: "/cart", path: "/cart",
}); });
window.open(url.href, "_blank"); window.open(url.href, "_blank");
}, },
myInfo() { myInfo () { //
let url = this.$router.resolve({ let url = this.$router.resolve({
path: "/home", path: "/home",
}); });
window.open(url.href, "_blank"); window.open(url.href, "_blank");
}, },
signOutFun() { signOutFun () { // 退
storage.removeItem("accessToken"); storage.removeItem('accessToken');
storage.removeItem("refreshToken"); storage.removeItem('refreshToken');
storage.removeItem("userInfo"); storage.removeItem('userInfo');
storage.removeItem("cartNum"); storage.removeItem('cartNum');
this.$store.commit("SET_CARTNUM", 0); this.$store.commit('SET_CARTNUM', 0)
this.$router.push("/login"); this.$router.push('/login');
}, },
goUserCenter(path) { goUserCenter(path) {
// //
@ -230,13 +224,13 @@ export default {
float: left; float: left;
font-size: 14px; font-size: 14px;
line-height: 35px; line-height: 35px;
margin-right: 15px; margin-right: 10px;
font-weight: bold; font-weight: bold;
} }
.nav a, .nav a,
.nav-item { .nav-item {
text-decoration: none; text-decoration: none;
padding-left: 15px; padding-left: 10px;
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
color: #999; color: #999;
cursor: pointer; cursor: pointer;
@ -377,9 +371,6 @@ export default {
.sign-out p { .sign-out p {
font-size: 12px; font-size: 12px;
} }
.cart-icon {
padding: 0 6px;
}
.goods-title:hover { .goods-title:hover {
color: $theme_color; color: $theme_color;
} }

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="shop-box"> <div class="shop-box">
<div class="shop-container"> <div class="shop-container">
<div class="shop-title">
<div class="shop-title-content"> <div class="shop-title-content">
<p><router-link :to="`/merchant?id=${skuDetail.storeId}`">{{ skuDetail.storeName }}</router-link></p> <img class="hover-pointer" @click="linkTo(`/merchant?id=${storeDetail.storeId}`)" :src="storeDetail.storeLogo" height="40" alt="">
</div> <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> </div>
</div> </div>
@ -20,7 +20,7 @@ export default {
} }
}, },
computed: { computed: {
skuDetail () { storeDetail () { //
return this.detail; return this.detail;
} }
} }
@ -46,57 +46,17 @@ export default {
color: #fff; color: #fff;
} }
.shop-title {
display: flex;
flex-direction: row;
}
.shop-title-icon {
font-size: 46px;
}
.shop-title-content { .shop-title-content {
padding-top: 8px;
margin-left: 15px;
display: flex; display: flex;
align-items: center;
} }
.shop-title-content p { .shop-title-content p {
line-height: 26px;
font-size: 20px; font-size: 20px;
}
.shop-title-content p:nth-child(2) {
font-size: 16px;
margin-left: 20px; margin-left: 20px;
} }
.shop-title-content a { .shop-title-content a {
color: #fff; 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> </style>

View File

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

View File

@ -67,14 +67,14 @@ export default {
}; };
}, },
methods: { methods: {
getArticleList () { getArticleList () { //
articleList(this.params).then(res => { articleList(this.params).then(res => {
if (res.success) { if (res.success) {
this.articleList = res.result.records this.articleList = res.result.records
} }
}) })
}, },
goArticle (id) { goArticle (id) { //
let routeUrl = this.$router.resolve({ let routeUrl = this.$router.resolve({
path: '/article', path: '/article',
query: {id} query: {id}

View File

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

View File

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

View File

@ -71,7 +71,7 @@ export default {
}; };
}, },
watch: { watch: {
diffSeconds (val) { diffSeconds (val) { //
const hours = Math.floor(val / 3600); const hours = Math.floor(val / 3600);
// / 60 // / 60
// 3600 / 60 = 60 // 3600 / 60 = 60
@ -139,7 +139,7 @@ export default {
}, 1000); }, 1000);
} }
}, },
goPromotion () { goPromotion () { //
let routeUrl = this.$router.resolve({ let routeUrl = this.$router.resolve({
path: '/seckill' path: '/seckill'
}); });

View File

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

View File

@ -11,37 +11,42 @@
</div> --> </div> -->
<!-- 普通发票 --> <!-- 普通发票 -->
<div class="nav-content"> <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="发票类型"> <FormItem label="发票类型">
<RadioGroup v-model="invoice" type="button" button-style="solid"> <RadioGroup v-model="invoiceForm.type" 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">
<Radio :label="1">个人</Radio> <Radio :label="1">个人</Radio>
<Radio :label="2">单位</Radio> <Radio :label="2">单位</Radio>
</RadioGroup> </RadioGroup>
</FormItem> </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> <i-input v-model="invoiceForm.receiptTitle"></i-input>
</FormItem> </FormItem>
<FormItem label="单位名称" v-if="type === 2" prop="receiptTitle"> <FormItem
<i-input v-model="invoiceForm.receiptTitle"></i-input> label="纳税人识别号"
</FormItem> v-if="invoiceForm.type == 2"
<FormItem label="纳税人识别号" v-if="type === 2" prop="taxpayerId"> prop="taxpayerId"
>
<i-input v-model="invoiceForm.taxpayerId"></i-input> <i-input v-model="invoiceForm.taxpayerId"></i-input>
</FormItem> </FormItem>
<FormItem label="发票内容"> <FormItem label="发票内容">
<RadioGroup v-model="invoiceForm.receiptContent" type="button" button-style="solid"> <RadioGroup v-model="invoiceForm.receiptContent" type="button" button-style="solid">
<Radio label="不开发票">不开发票</Radio>
<Radio label="商品明细">商品明细</Radio> <Radio label="商品明细">商品明细</Radio>
<Radio label="商品类别">商品类别</Radio>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
</Form> </Form>
<div style="text-align: center"> <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> <Button type="default" @click="invoiceAvailable = false">取消</Button>
</div> </div>
</div> </div>
@ -49,104 +54,100 @@
</div> </div>
</template> </template>
<script> <script>
import { receiptSelect } from "@/api/cart.js"; import { saveReceipt } from '@/api/member.js';
import { TINumber } from "@/plugins/RegExp.js"; import { TINumber } from '@/plugins/RegExp.js';
export default { export default {
name: "invoiceModal", name: 'invoiceModal',
data () { data () {
return { return {
invoice: 1,
invoiceAvailable: false, // invoiceAvailable: false, //
loading: false, // loading: false, //
invoiceForm: { invoiceForm: { //
//
// //
receiptTitle: "", // receiptTitle: '', //
taxpayerId: "", // taxpayerId: '', //
receiptContent: "商品明细", // receiptContent: '不开发票', //
type: 1 // 1 2
}, },
type: 1, // 1 2 ruleInline: { //
ruleInline: { receiptTitle: [{ required: true, message: '请填写公司名称' }],
taxpayerId: [ taxpayerId: [
{ required: true, message: "请填写纳税人识别号" }, { required: true, message: '请填写纳税人识别号' },
{ pattern: TINumber, 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: { methods: {
/** save () { //
* 选择发票抬头 if (this.invoiceForm.type === 1) {
*/ //
changeInvoice(val) { let flag = true;
this.$nextTick(() => { this.receiptItems.forEach((e) => {
this.type = val; if (
}); e.receiptTitle === '个人' &&
}, e.receiptContent === this.invoiceForm.receiptContent
) {
/** this.$emit('change', e);
* 保存判断 flag = false;
*/ this.invoiceAvailable = false;
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;
} }
}); });
} else {
delete this.invoiceForm.taxpayerId;
}
return flage; if (flag) {
}, let params = {
receiptTitle: '个人',
async submit() { receiptContent: this.invoiceForm.receiptContent
if (this.save()) {
this.loading = true;
let submit = {
way: this.$route.query.way,
...this.invoiceForm,
}; };
let receipt = await receiptSelect(submit); this.loading = true;
if (receipt.success) { saveReceipt(params)
this.$emit("change", true); .then((res) => {
}
this.loading = false; this.loading = false;
if (res.success) {
this.$emit('change', res.result);
this.invoiceAvailable = false;
}
})
.catch(() => {
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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

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

View File

@ -21,7 +21,7 @@ export default {
props: ['addressId'], props: ['addressId'],
mounted () {}, mounted () {},
methods: { methods: {
change (val, selectedData) { change (val, selectedData) { //
/** /**
* @returns [regionId,region] * @returns [regionId,region]
*/ */
@ -30,7 +30,7 @@ export default {
selectedData[selectedData.length - 1].__label.split('/') selectedData[selectedData.length - 1].__label.split('/')
]); ]);
}, },
loadData (item, callback) { loadData (item, callback) { //
item.loading = true; item.loading = true;
getRegion(item.value).then((res) => { getRegion(item.value).then((res) => {
if (res.result.length <= 0) { if (res.result.length <= 0) {
@ -59,7 +59,7 @@ export default {
} }
}); });
}, },
async init () { async init () { //
let data = await getRegion(0); let data = await getRegion(0);
let arr = []; let arr = [];
data.result.forEach((item) => { data.result.forEach((item) => {

View File

@ -209,7 +209,7 @@ export default {
}, },
deep: true deep: true
}, },
'$route': { '$route': { //
handler (val, oVal) { handler (val, oVal) {
if (this.$route.query.categoryId) { if (this.$route.query.categoryId) {
let cateId = this.$route.query.categoryId.split(',') let cateId = this.$route.query.categoryId.split(',')
@ -373,6 +373,7 @@ export default {
} }
}, },
mounted () { mounted () {
// idid
if (this.$route.query.categoryId) { if (this.$route.query.categoryId) {
let cateId = this.$route.query.categoryId.split(',') let cateId = this.$route.query.categoryId.split(',')
Object.assign(this.params, this.$route.query) Object.assign(this.params, this.$route.query)

View File

@ -93,6 +93,11 @@ export default {
getCategory(0).then(res => { getCategory(0).then(res => {
if (res.success) { if (res.success) {
this.cateList = res.result; this.cateList = res.result;
//
var expirationTime = new Date().setHours(new Date().getHours() + 1);
//
localStorage.setItem('category_expiration_time', expirationTime);
//
localStorage.setItem('category', JSON.stringify(res.result)) localStorage.setItem('category', JSON.stringify(res.result))
} }
}); });
@ -117,7 +122,12 @@ export default {
} }
}, },
mounted () { mounted () {
if (localStorage.getItem('category')) { if (localStorage.getItem('category') && localStorage.getItem('category_expiration_time')) {
//
if (new Date() > localStorage.getItem('category_expiration_time')) {
this.getCate();
return;
}
this.cateList = JSON.parse(localStorage.getItem('category')) this.cateList = JSON.parse(localStorage.getItem('category'))
} else { } else {
this.getCate() this.getCate()

View File

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

View File

@ -43,11 +43,11 @@ export default {
}; };
}, },
methods: { methods: {
mouseDown (e) { mouseDown (e) { //
this.downX = e.clientX; this.downX = e.clientX;
this.flag = true; this.flag = true;
}, },
mouseMove (e) { mouseMove (e) { //
if (this.flag) { if (this.flag) {
let offset = e.clientX - this.downX; let offset = e.clientX - this.downX;
@ -60,7 +60,7 @@ export default {
} }
} }
}, },
mouseUp () { mouseUp () { //
if (!this.flag) return false; if (!this.flag) return false;
this.flag = false; this.flag = false;
let params = { let params = {
@ -83,7 +83,7 @@ export default {
} }
}); });
}, },
refresh () { refresh () { //
this.flag = false; this.flag = false;
this.downX = 0; this.downX = 0;
this.distance = 0; this.distance = 0;
@ -91,7 +91,7 @@ export default {
this.verifyText = '拖动滑块解锁'; this.verifyText = '拖动滑块解锁';
this.getImg(); this.getImg();
}, },
getImg () { getImg () { //
getVerifyImg(this.type).then(res => { getVerifyImg(this.type).then(res => {
this.data = res.result; this.data = res.result;
}); });

View File

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

View File

@ -17,10 +17,10 @@ export default {
* @description api请求基础路径 * @description api请求基础路径
*/ */
api_dev: { api_dev: {
// common: 'http://192.168.0.103:8890', // common: 'http://192.168.0.109:8890',
// buyer: 'http://192.168.0.103:8888', // buyer: 'http://192.168.0.109:8888',
// seller: 'http://192.168.0.103:8889', // seller: 'http://192.168.0.109:8889',
// manager: 'http://192.168.0.103:8887' // manager: 'http://192.168.0.109:8887'
common: 'https://common-api.pickmall.cn', common: 'https://common-api.pickmall.cn',
buyer: 'https://buyer-api.pickmall.cn', buyer: 'https://buyer-api.pickmall.cn',

View File

@ -37,6 +37,11 @@ Vue.prototype.linkTo = function (url) {
window.open(url, '_blank') 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 Vue.prototype.Cookies = storage
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({

View File

@ -3,7 +3,7 @@
<BaseHeader></BaseHeader> <BaseHeader></BaseHeader>
<Search></Search> <Search></Search>
<drawer></drawer> <drawer></drawer>
<ShopHeader v-if="goodsMsg.data" :detail="goodsMsg.data"></ShopHeader> <ShopHeader :detail="storeMsg"></ShopHeader>
<div class="shop-item-path"> <div class="shop-item-path">
<div class="shop-nav-container"> <div class="shop-nav-container">
<Breadcrumb> <Breadcrumb>
@ -11,8 +11,9 @@
<BreadcrumbItem v-for="(item, index) in categoryBar" :to="goGoodsList(index)" target="_blank" :key="index">{{item.name}}</BreadcrumbItem> <BreadcrumbItem v-for="(item, index) in categoryBar" :to="goGoodsList(index)" target="_blank" :key="index">{{item.name}}</BreadcrumbItem>
</Breadcrumb> </Breadcrumb>
<div class="store-collect"> <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="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> </div>
</div> </div>
@ -40,6 +41,7 @@ import ShowGoodsDetail from '@/components/goodsDetail/ShowGoodsDetail';
import ShowLikeGoods from '@/components/like'; import ShowLikeGoods from '@/components/like';
import { goodsSkuDetail } from '@/api/goods'; import { goodsSkuDetail } from '@/api/goods';
import { cancelCollect, collectGoods, isCollection } from '@/api/member'; import { cancelCollect, collectGoods, isCollection } from '@/api/member';
import {getDetailById} from '@/api/shopentry'
export default { export default {
name: 'GoodsDetail', name: 'GoodsDetail',
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
@ -48,20 +50,15 @@ export default {
}, },
created () { created () {
this.getGoodsDetail(); this.getGoodsDetail();
if (this.Cookies.getItem('userInfo')) {
isCollection('STORE', this.goodsMsg.data.storeId).then(res => {
if (res.success && res.result) {
this.storeCollected = true;
}
})
}
}, },
data () { data () {
return { return {
goodsMsg: {}, // goodsMsg: {}, //
isLoading: false, // isLoading: false, //
categoryBar: [], // categoryBar: [], //
storeCollected: false // storeCollected: false, //
storeMsg: {} //
}; };
}, },
methods: { methods: {
@ -81,8 +78,23 @@ export default {
name: cateName[index] name: cateName[index]
}); });
}); });
console.log(cateArr);
this.categoryBar = cateArr; this.categoryBar = cateArr;
this.goodsMsg = res.result; 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 { } else {
this.$Message.error(res.message) this.$Message.error(res.message)
this.$router.push('/') this.$router.push('/')
@ -91,7 +103,7 @@ export default {
this.$router.push('/') this.$router.push('/')
}); });
}, },
goGoodsList (currIndex) { goGoodsList (currIndex) { //
const arr = [] const arr = []
this.categoryBar.forEach((e, index) => { this.categoryBar.forEach((e, index) => {
if (index <= currIndex) { if (index <= currIndex) {
@ -132,7 +144,6 @@ export default {
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.shop-item-path { .shop-item-path {
height: 38px; height: 38px;
@ -146,6 +157,7 @@ export default {
padding: 20px 0; padding: 20px 0;
@include white_background_color(); @include white_background_color();
} }
.shop-nav-container { .shop-nav-container {
width: 1200px; width: 1200px;
margin: 0 auto; margin: 0 auto;

View File

@ -9,9 +9,10 @@
<img :src="storeMsg.storeLogo" height="50" alt=""> <img :src="storeMsg.storeLogo" height="50" alt="">
<div> <div>
<p>{{storeMsg.storeName || 'xx店铺'}}</p> <p>{{storeMsg.storeName || 'xx店铺'}}</p>
<p>{{storeMsg.storeDesc || 'xx店铺描述'}}</p> <p v-html="storeMsg.storeDesc"></p>
</div> </div>
<div class="store-collect" @click="collect"><Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#fff'" />{{storeCollected?'已收藏店铺':'收藏店铺'}}</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> </div>
<div class="store-category"> <div class="store-category">
@ -204,7 +205,7 @@ export default {
} }
} }
.store-collect{ .store-collect{
margin-left: 20px!important; margin-left: 750px!important;
&:hover{ &:hover{
cursor: pointer; cursor: pointer;
} }

View File

@ -4,7 +4,7 @@
<Search></Search> <Search></Search>
<cateNav></cateNav> <cateNav></cateNav>
<ul class="category"> <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> </ul>
<h3 class="promotion-decorate">积分商品</h3> <h3 class="promotion-decorate">积分商品</h3>
<!-- 列表 --> <!-- 列表 -->
@ -39,6 +39,13 @@
</div> </div>
</div> </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> <BaseFooter></BaseFooter>
</div> </div>
</template> </template>
@ -56,7 +63,8 @@ export default {
pageNumber: 1, pageNumber: 1,
pageSize: 20, pageSize: 20,
pointsGoodsCategoryId: '' pointsGoodsCategoryId: ''
} },
total: 0 //
} }
}, },
mounted () { mounted () {
@ -69,6 +77,7 @@ export default {
pointGoods(this.params).then(res => { pointGoods(this.params).then(res => {
if (res.success) { if (res.success) {
this.goodsList = res.result.records 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.params.pointsGoodsCategoryId = id
this.getList() this.getList()
this.$router.push({query: {categoryId: id}}) 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> </script>
@ -104,8 +129,19 @@ export default {
margin: 0 10px; margin: 0 10px;
&:hover{ &:hover{
cursor: pointer; 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{ .promotion-decorate::before,.promotion-decorate::after{
background-image: url('../../static/sprite@2x.png'); background-image: url('../../static/sprite@2x.png');

View File

@ -34,33 +34,6 @@
</div> </div>
</div> </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> <BaseFooter></BaseFooter>
</div> </div>
</template> </template>

View File

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

View File

@ -1,7 +1,6 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<card _Title="账户安全"/> <card _Title="账户安全"/>
<div class="safeList"> <div class="safeList">
<!-- 密码 --> <!-- 密码 -->
<Row class="safeItem"> <Row class="safeItem">
@ -16,102 +15,11 @@
<Button @click="modifyPwd"></Button> <Button @click="modifyPwd"></Button>
</Col> </Col>
</Row> </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>
</div> </div>
</template> </template>
<script> <script>
import card from '@/components/card'
import { import {
getPwdStatus getPwdStatus
} from '@/api/account'; } from '@/api/account';
@ -122,7 +30,6 @@ export default {
pwdStatus: '' // pwdStatus: '' //
} }
}, },
components: {card},
mounted () { mounted () {
this.getPwdStatus() this.getPwdStatus()
}, },
@ -131,10 +38,7 @@ export default {
goModifyPwd () { goModifyPwd () {
this.$router.push({name: 'ModifyPwd', query: { status: 2 }}) this.$router.push({name: 'ModifyPwd', query: { status: 2 }})
}, },
selectPwd (value) { modifyPwd () { //
this.$router.push({name: 'ModifyPwd', query: { status: value }})
},
modifyPwd () {
this.$router.push({name: 'ModifyPwd', query: { status: 1 }}) this.$router.push({name: 'ModifyPwd', query: { status: 1 }})
}, },
// //

View File

@ -18,7 +18,7 @@
<div class="title order-item-title"> <div class="title order-item-title">
<span>订单号:{{item.orderNo}}</span> <span>订单号:{{item.orderNo}}</span>
<span class="color999 ml_10">{{item.createTime}}</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> </div>
<Row class="order-item-view"> <Row class="order-item-view">
<i-col span="12" class="item-view-name"> <i-col span="12" class="item-view-name">
@ -80,7 +80,7 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
getList () { getList () { //
evolutionList(this.params).then(res => { evolutionList(this.params).then(res => {
if (res.success) { if (res.success) {
const list = res.result.records; const list = res.result.records;
@ -92,19 +92,16 @@ export default {
} }
}) })
}, },
changePageNum (val) { changePageNum (val) { //
this.params.pageNumber = val; this.params.pageNumber = val;
this.getList() this.getList()
}, },
changePageSize (val) { changePageSize (val) { //
this.pageNumber = 1; this.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;
this.getList() this.getList()
}, },
changeIndex (index) { evaluateDetail (id) { //
console.log(index);
},
evaluate (id) {
this.$router.push({path: '/home/evalDetail', query: { id }}) this.$router.push({path: '/home/evalDetail', query: { id }})
} }
} }
@ -112,6 +109,10 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.page-size {
display: flex;
justify-content: flex-end;
}
.order-img { .order-img {
> img { > img {
width: 60px; width: 60px;

View File

@ -141,23 +141,23 @@ export default {
} }
}, },
methods: { methods: {
getDetail () { getDetail () { //
getComplainDetail(this.$route.query.id).then(res => { getComplainDetail(this.$route.query.id).then(res => {
if (res.success) this.detail = res.result if (res.success) this.detail = res.result
}) })
}, },
goGoodsDetail (skuId, goodsId) { goGoodsDetail (skuId, goodsId) { //
let routerUrl = this.$router.resolve({ let routerUrl = this.$router.resolve({
path: '/goodsDetail', path: '/goodsDetail',
query: {skuId, goodsId} query: {skuId, goodsId}
}) })
window.open(routerUrl.href, '_blank') window.open(routerUrl.href, '_blank')
}, },
handleView (name) { handleView (name) { //
this.previewImage = name; this.previewImage = name;
this.visible = true; this.visible = true;
}, },
// //
handleSubmit () { handleSubmit () {
if (this.params.content === '') { if (this.params.content === '') {
this.$Message.error('请填写对话内容'); this.$Message.error('请填写对话内容');

View File

@ -18,7 +18,7 @@
<div class="title order-item-title"> <div class="title order-item-title">
<span>投诉单号:{{item.id}}</span> <span>投诉单号:{{item.id}}</span>
<span class="color999 ml_10">{{item.createTime}}</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> <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> </div>
<Row class="order-item-view"> <Row class="order-item-view">
@ -93,7 +93,7 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
getList () { getList () { //
complainList(this.params).then(res => { complainList(this.params).then(res => {
if (res.success) { if (res.success) {
const list = res.result.records; const list = res.result.records;
@ -102,16 +102,16 @@ export default {
} }
}) })
}, },
changePageNum (val) { changePageNum (val) { //
this.params.pageNumber = val; this.params.pageNumber = val;
this.getList() this.getList()
}, },
changePageSize (val) { changePageSize (val) { //
this.pageNumber = 1; this.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;
this.getList() this.getList()
}, },
cancel (id) { cancel (id) { //
this.$Modal.confirm({ this.$Modal.confirm({
title: '取消投诉', title: '取消投诉',
content: '<p>确定取消投诉吗?</p>', content: '<p>确定取消投诉吗?</p>',
@ -126,7 +126,7 @@ export default {
onCancel: () => { } onCancel: () => { }
}); });
}, },
detail (id) { goDetail (id) { //
this.$router.push({path: '/home/complainDetail', query: { id }}) this.$router.push({path: '/home/complainDetail', query: { id }})
} }
} }

View File

@ -213,7 +213,7 @@ export default {
this.distribution() this.distribution()
}, },
methods: { methods: {
apply () { apply () { //
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
this.applyLoading = true this.applyLoading = true
@ -239,10 +239,10 @@ export default {
} }
}) })
}, },
qrcodeData (data64) { qrcodeData (data64) { // base64
this.base64Img = data64 this.base64Img = data64
}, },
downloadQrcode () { downloadQrcode () { //
let a = document.createElement('a'); // a let a = document.createElement('a'); // a
let event = new MouseEvent('click'); // let event = new MouseEvent('click'); //
a.download = this.goodsNameCurr || 'photo' a.download = this.goodsNameCurr || 'photo'
@ -265,11 +265,11 @@ export default {
this.getLog() this.getLog()
} }
}, },
changePage (val) { changePage (val) { //
this.params.pageNumber = val; this.params.pageNumber = val;
this.getGoodsData() this.getGoodsData()
}, },
changePageLog (val) { changePageLog (val) { //
this.logParams.pageNumber = val; this.logParams.pageNumber = val;
this.getLog() this.getLog()
}, },

View File

@ -68,19 +68,19 @@ export default {
}; };
}, },
methods: { methods: {
getList () { getList () { //
this.spinShow = true this.spinShow = true
collectList(this.params).then(res => { collectList(this.params).then(res => {
this.spinShow = false this.spinShow = false
if (res.success) this.list = res.result.records; if (res.success) this.list = res.result.records;
}) })
}, },
change (index) { change (index) { // tab
if (index === 0) { this.params.type = 'GOODS' } if (index === 0) { this.params.type = 'GOODS' }
if (index === 1) { this.params.type = 'SHOP' } if (index === 1) { this.params.type = 'SHOP' }
this.getList() this.getList()
}, },
cancel (id) { cancel (id) { //
let typeName = this.params.type === 'GOODS' ? '商品' : '店铺' let typeName = this.params.type === 'GOODS' ? '商品' : '店铺'
this.$Modal.confirm({ this.$Modal.confirm({
title: 'Title', title: 'Title',
@ -94,23 +94,23 @@ export default {
} }
}); });
}, },
changePageNum (val) { changePageNum (val) { //
this.params.pageNumber = val; this.params.pageNumber = val;
this.getList() this.getList()
}, },
changePageSize (val) { changePageSize (val) { //
this.pageNumber = 1; this.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;
this.getList() this.getList()
}, },
buynow (skuId, goodsId) { buynow (skuId, goodsId) { //
let url = this.$router.resolve({ let url = this.$router.resolve({
path: '/goodsDetail', path: '/goodsDetail',
query: {skuId, goodsId} query: {skuId, goodsId}
}) })
window.open(url.href, '_blank') window.open(url.href, '_blank')
}, },
goShop (id) { goShop (id) { //
let url = this.$router.resolve({ let url = this.$router.resolve({
path: '/merchant', path: '/merchant',
query: {id} query: {id}

View File

@ -78,12 +78,12 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
getList () { getList () { //
receiptList().then(res => { receiptList().then(res => {
this.list = res.result.records; this.list = res.result.records;
}) })
}, },
save () { save () { //
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
@ -105,7 +105,7 @@ export default {
} }
}); });
}, },
resetData () { resetData () { //
this.$refs.form.resetFields(); this.$refs.form.resetFields();
} }
} }

View File

@ -99,7 +99,7 @@ export default {
againPassword: '', againPassword: '',
newPassword: '' newPassword: ''
}, },
ruleInLines: { ruleInLines: { //
picture: [ picture: [
{required: true, message: '请输入图片验证码', trigger: 'blur'} {required: true, message: '请输入图片验证码', trigger: 'blur'}
], ],
@ -107,7 +107,7 @@ export default {
{required: true, message: '请输入短信验证码', trigger: 'blur'} {required: true, message: '请输入短信验证码', trigger: 'blur'}
] ]
}, },
ruleIn: { ruleIn: { //
newPassword: [ newPassword: [
{required: true, message: '请输入新密码', trigger: 'blur'}, {required: true, message: '请输入新密码', trigger: 'blur'},
{type: 'string', min: 6, message: '密码不能少于6位'} {type: 'string', min: 6, message: '密码不能少于6位'}
@ -117,7 +117,7 @@ export default {
{type: 'string', min: 6, message: '密码不能少于6位'} {type: 'string', min: 6, message: '密码不能少于6位'}
] ]
}, },
ruleInline: { ruleInline: { //
password: [ password: [
{required: true, message: '请输入旧密码', trigger: 'blur'} {required: true, message: '请输入旧密码', trigger: 'blur'}
], ],

View File

@ -63,7 +63,7 @@ export default {
this.getPoint() this.getPoint()
}, },
methods: { methods: {
getHistory () { getHistory () { //
memberPointHistory(this.params).then(res => { memberPointHistory(this.params).then(res => {
this.logData = res.result; this.logData = res.result;
}) })
@ -73,11 +73,11 @@ export default {
if (res.success) this.pointObj = res.result if (res.success) this.pointObj = res.result
}) })
}, },
changePage (val) { changePage (val) { //
this.pageNumber = val this.pageNumber = val
this.getHistory() this.getHistory()
}, },
changePageSize (val) { changePageSize (val) { //
this.param.pageSize = val this.param.pageSize = val
this.params.pageNumber = 1 this.params.pageNumber = 1
this.getHistory() this.getHistory()

View File

@ -8,7 +8,6 @@
<Upload <Upload
:show-upload-list="false" :show-upload-list="false"
:on-success="handleSuccess" :on-success="handleSuccess"
:before-upload="handleBeforeUpload"
:format="['jpg','jpeg','png']" :format="['jpg','jpeg','png']"
:action="action" :action="action"
:headers="accessToken" :headers="accessToken"
@ -58,7 +57,7 @@ export default {
this.accessToken.accessToken = storage.getItem('accessToken'); this.accessToken.accessToken = storage.getItem('accessToken');
}, },
methods: { methods: {
save () { save () { //
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
let params = { let params = {
@ -76,10 +75,9 @@ export default {
} }
}) })
}, },
handleSuccess (res, file) { handleSuccess (res, file) { //
this.$set(this.formItem, 'face', res.result) this.$set(this.formItem, 'face', res.result)
}, },
handleBeforeUpload () {}
} }
} }

View File

@ -88,7 +88,7 @@ export default {
} }
}, },
methods: { methods: {
getOrderDetail () { getOrderDetail () { //
orderDetail(this.$route.query.sn).then(res => { orderDetail(this.$route.query.sn).then(res => {
this.order = res.result this.order = res.result
this.orderGoods = res.result.orderItems[this.$route.query.index] this.orderGoods = res.result.orderItems[this.$route.query.index]
@ -96,7 +96,7 @@ export default {
this.orderGoods.uploadList = [] this.orderGoods.uploadList = []
}) })
}, },
save () { save () { //
if (!this.form.serviceScore || !this.form.deliveryScore) { if (!this.form.serviceScore || !this.form.deliveryScore) {
this.$Message.warning('物流服务评价不能为空') this.$Message.warning('物流服务评价不能为空')
return false; return false;
@ -129,26 +129,26 @@ export default {
this.loading = false; this.loading = false;
}) })
}, },
goGoodsDetail (skuId, goodsId) { goGoodsDetail (skuId, goodsId) { //
let routerUrl = this.$router.resolve({ let routerUrl = this.$router.resolve({
path: '/goodsDetail', path: '/goodsDetail',
query: {skuId, goodsId} query: {skuId, goodsId}
}) })
window.open(routerUrl.href, '_blank') window.open(routerUrl.href, '_blank')
}, },
handleView (name) { handleView (name) { //
this.previewImage = name; this.previewImage = name;
this.visible = true; this.visible = true;
}, },
handleRemove (index) { handleRemove (index) { //
this.orderGoods.uploadList.splice(index, 1) this.orderGoods.uploadList.splice(index, 1)
this.$forceUpdate() this.$forceUpdate()
}, },
handleSuccess (res, file) { handleSuccess (res, file) { //
this.orderGoods.uploadList.push(res.result) this.orderGoods.uploadList.push(res.result)
this.$forceUpdate() this.$forceUpdate()
}, },
handleBeforeUpload () { handleBeforeUpload () { //
const check = this.orderGoods.uploadList.length < 10; const check = this.orderGoods.uploadList.length < 10;
if (!check) { if (!check) {
this.$Notice.warning({ this.$Notice.warning({

View File

@ -65,19 +65,19 @@ export default {
} }
}, },
methods: { methods: {
getDetail () { getDetail () { //
evaluationDetail(this.$route.query.id).then(res => { evaluationDetail(this.$route.query.id).then(res => {
if (res.success) this.orderGoods = res.result if (res.success) this.orderGoods = res.result
}) })
}, },
goGoodsDetail (skuId, goodsId) { goGoodsDetail (skuId, goodsId) { //
let routerUrl = this.$router.resolve({ let routerUrl = this.$router.resolve({
path: '/goodsDetail', path: '/goodsDetail',
query: {skuId, goodsId} query: {skuId, goodsId}
}) })
window.open(routerUrl.href, '_blank') window.open(routerUrl.href, '_blank')
}, },
handleView (name) { handleView (name) { //
this.previewImage = name; this.previewImage = name;
this.visible = true; 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: { methods: {
save () { save () { //
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const params = JSON.parse(JSON.stringify(this.formData)); const params = JSON.parse(JSON.stringify(this.formData));

View File

@ -133,7 +133,7 @@ export default {
}); });
window.open(routeUrl.href, '_blank'); window.open(routeUrl.href, '_blank');
}, },
getList () { getList () { //
this.spinShow = true; this.spinShow = true;
let params = JSON.parse(JSON.stringify(this.params)) let params = JSON.parse(JSON.stringify(this.params))
afterSaleList(params).then(res => { afterSaleList(params).then(res => {
@ -144,11 +144,11 @@ export default {
} }
}); });
}, },
changePageNum (val) { changePageNum (val) { //
this.params.pageNumber = val; this.params.pageNumber = val;
this.getList() this.getList()
}, },
changePageSize (val) { changePageSize (val) { //
this.pageNumber = 1; this.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;
this.getList() this.getList()

View File

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

View File

@ -139,7 +139,7 @@ export default {
} }
}, },
methods: { methods: {
getInfo () { getInfo () { //
afterSaleInfo(this.$route.query.sn).then(res => { afterSaleInfo(this.$route.query.sn).then(res => {
if (res.success) { if (res.success) {
this.info = res.result this.info = res.result
@ -147,15 +147,15 @@ export default {
} }
}) })
}, },
getReason (type) { getReason (type) { //
afterSaleReason(type).then(res => { afterSaleReason(type).then(res => {
if (res.success) this.reasonList = res.result if (res.success) this.reasonList = res.result
}) })
}, },
changeReason (type) { changeReason (type) { //
this.getReason(type) this.getReason(type)
}, },
apply () { apply () { //
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
let params = Object.assign(this.info, this.form) let params = Object.assign(this.info, this.form)
@ -170,19 +170,19 @@ export default {
} }
}) })
}, },
handleView (name) { handleView (name) { //
this.previewImage = name; this.previewImage = name;
this.visible = true; this.visible = true;
}, },
handleRemove (index) { handleRemove (index) { //
this.uploadList.splice(index, 1) this.uploadList.splice(index, 1)
this.$forceUpdate() this.$forceUpdate()
}, },
handleSuccess (res, file) { handleSuccess (res, file) { //
this.uploadList.push(res.result) this.uploadList.push(res.result)
this.$forceUpdate() this.$forceUpdate()
}, },
handleBeforeUpload () { handleBeforeUpload () { //
const check = this.uploadList.length < 6; const check = this.uploadList.length < 6;
if (!check) { if (!check) {
this.$Notice.warning({ this.$Notice.warning({

View File

@ -78,7 +78,7 @@ export default {
} }
}, },
methods: { methods: {
getOrderDetail () { getOrderDetail () { //
orderDetail(this.$route.query.sn).then(res => { orderDetail(this.$route.query.sn).then(res => {
this.order = res.result this.order = res.result
this.orderGoods = res.result.orderItems[this.$route.query.index] this.orderGoods = res.result.orderItems[this.$route.query.index]
@ -92,7 +92,7 @@ export default {
} }
}) })
}, },
save () { save () { //
let params = { let params = {
goodsId: this.orderGoods.goodsId, goodsId: this.orderGoods.goodsId,
complainTopic: this.form.complainTopic, complainTopic: this.form.complainTopic,
@ -108,26 +108,26 @@ export default {
} }
}) })
}, },
goGoodsDetail (skuId, goodsId) { goGoodsDetail (skuId, goodsId) { //
let routerUrl = this.$router.resolve({ let routerUrl = this.$router.resolve({
path: '/goodsDetail', path: '/goodsDetail',
query: {skuId, goodsId} query: {skuId, goodsId}
}) })
window.open(routerUrl.href, '_blank') window.open(routerUrl.href, '_blank')
}, },
handleView (name) { handleView (name) { //
this.previewImage = name; this.previewImage = name;
this.visible = true; this.visible = true;
}, },
handleRemove (index) { handleRemove (index) { //
this.orderGoods.uploadList.splice(index, 1) this.orderGoods.uploadList.splice(index, 1)
this.$forceUpdate() this.$forceUpdate()
}, },
handleSuccess (res, file) { handleSuccess (res, file) { //
this.orderGoods.uploadList.push(res.result) this.orderGoods.uploadList.push(res.result)
this.$forceUpdate() this.$forceUpdate()
}, },
handleBeforeUpload () { handleBeforeUpload () { //
const check = this.orderGoods.uploadList.length < 6; const check = this.orderGoods.uploadList.length < 6;
if (!check) { if (!check) {
this.$Notice.warning({ this.$Notice.warning({

View File

@ -240,7 +240,7 @@ export default {
complainResult (sn) { // complainResult (sn) { //
}, },
delOrder (sn) { delOrder (sn) { //
this.$Modal.confirm({ this.$Modal.confirm({
title: '删除订单', title: '删除订单',
content: '<p>确认删除当前订单吗?</p>', content: '<p>确认删除当前订单吗?</p>',
@ -255,7 +255,7 @@ export default {
onCancel: () => {} onCancel: () => {}
}); });
}, },
getList () { getList () { //
this.spinShow = true; this.spinShow = true;
let params = JSON.parse(JSON.stringify(this.params)) let params = JSON.parse(JSON.stringify(this.params))
if (params.orderStatus === 'ALL') { if (params.orderStatus === 'ALL') {
@ -269,11 +269,11 @@ export default {
} }
}); });
}, },
changePageNum (val) { changePageNum (val) { //
this.params.pageNumber = val; this.params.pageNumber = val;
this.getList() this.getList()
}, },
changePageSize (val) { changePageSize (val) { //
this.pageNumber = 1; this.pageNumber = 1;
this.params.pageSize = val; this.params.pageSize = val;
this.getList() this.getList()
@ -289,7 +289,7 @@ export default {
} }
}) })
}, },
sureCancel () { sureCancel () { //
cancelOrder(this.cancelParams).then(res => { cancelOrder(this.cancelParams).then(res => {
if (res.success) { if (res.success) {
this.$Message.success('取消订单成功') this.$Message.success('取消订单成功')

View File

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

View File

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

View File

@ -1,53 +1,58 @@
// import Vue from 'vue'; // import Vue from 'vue';
import axios from 'axios'; import axios from "axios";
import https from 'https'; import https from "https";
import { import { Message, Spin, Modal } from "view-design";
Message, import Storage from "./storage";
Spin, import config from "@/config";
Modal import router from "../router/index.js";
} from 'view-design'; import store from "../vuex/store";
import Storage from './storage'; import { handleRefreshToken } from "@/api/index";
import config from '@/config'; const qs = require("qs");
import router from '../router/index.js'; export const buyerUrl =
import store from '../vuex/store'; process.env.NODE_ENV === "development"
import { ? config.api_dev.buyer
handleRefreshToken : config.api_prod.buyer;
} from '@/api/index'; export const commonUrl =
const qs = require('qs'); process.env.NODE_ENV === "development"
? config.api_dev.common
export const buyerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.buyer : config.api_prod.buyer); : config.api_prod.common;
export const commonUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.common : config.api_prod.common); export const managerUrl =
export const managerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.manager : config.api_prod.manager); process.env.NODE_ENV === "development"
export const sellerUrl = (process.env.NODE_ENV === 'development' ? config.api_dev.seller : config.api_prod.seller); ? config.api_dev.manager
: config.api_prod.manager;
export const sellerUrl =
process.env.NODE_ENV === "development"
? config.api_dev.seller
: config.api_prod.seller;
// 创建axios实例 // 创建axios实例
var isRefreshToken = 0; var isRefreshToken = 0;
const refreshToken = getTokenDebounce() const refreshToken = getTokenDebounce();
const service = axios.create({ const service = axios.create({
timeout: 10000, // 请求超时时间 timeout: 10000, // 请求超时时间
baseURL: buyerUrl, // API baseURL: buyerUrl, // API
httpsAgent: new https.Agent({ httpsAgent: new https.Agent({
rejectUnauthorized: false rejectUnauthorized: false
}), }),
paramsSerializer: params => qs.stringify(params, { paramsSerializer: params =>
arrayFormat: 'repeat' qs.stringify(params, {
arrayFormat: "repeat"
}) })
}); });
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(
const { config => {
loading const { loading } = config;
} = config;
// 如果是put/post请求用qs.stringify序列化参数 // 如果是put/post请求用qs.stringify序列化参数
const isPutPost = config.method === 'put' || config.method === 'post'; const isPutPost = config.method === "put" || config.method === "post";
const isJson = config.headers['Content-Type'] === 'application/json'; const isJson = config.headers["Content-Type"] === "application/json";
const isFile = config.headers['Content-Type'] === 'multipart/form-data'; const isFile = config.headers["Content-Type"] === "multipart/form-data";
if (isPutPost && isJson) { if (isPutPost && isJson) {
config.data = JSON.stringify(config.data); config.data = JSON.stringify(config.data);
} }
if (isPutPost && !isFile && !isJson) { if (isPutPost && !isFile && !isJson) {
config.data = qs.stringify(config.data, { config.data = qs.stringify(config.data, {
arrayFormat: 'repeat' arrayFormat: "repeat"
}); });
} }
/** 配置全屏加载 */ /** 配置全屏加载 */
@ -55,23 +60,74 @@ service.interceptors.request.use(config => {
config.loading = Spin.show(); config.loading = Spin.show();
} }
const uuid = Storage.getItem('uuid'); const uuid = Storage.getItem("uuid");
config.headers['uuid'] = uuid; config.headers["uuid"] = uuid;
// 获取访问Token // 获取访问Token
let accessToken = Storage.getItem('accessToken'); let accessToken = Storage.getItem("accessToken");
if (accessToken && config.needToken) { if (accessToken && config.needToken) {
config.headers['accessToken'] = accessToken; config.headers["accessToken"] = accessToken;
// 解析当前token时间
let jwtData = JSON.parse(
decodeURIComponent(escape(window.atob(accessToken.split(".")[1])))
);
if (jwtData.exp < Math.round(new Date() / 1000)) {
refresh()
} }
}
return config; return config;
}, error => { },
error => {
Promise.reject(error); Promise.reject(error);
}
);
async function refresh() {
const getTokenRes = await refreshToken();
if (getTokenRes === "success") {
// 刷新token
if (isRefreshToken === 1) {
error.response.config.headers.accessToken = Storage.getItem(
"accessToken"
);
return service(error.response.config);
} else {
router.go(0);
}
} else {
Storage.removeItem("accessToken");
Storage.removeItem("refreshToken");
Storage.removeItem("userInfo");
Storage.setItem("cartNum", 0);
store.commit("SET_CARTNUM", 0);
console.log("1111");
Modal.confirm({
title: "请登录",
content: "<p>请登录后执行此操作</p>",
okText: "立即登录",
cancelText: "继续浏览",
onOk: () => {
router.push({
path: "/login",
query: {
rePath: router.history.current.path,
query: JSON.stringify(router.history.current.query)
}
}); });
},
onCancel: () => {
Modal.remove();
}
});
}
}
// respone拦截器 // respone拦截器
service.interceptors.response.use( service.interceptors.response.use(
async response => { async response => {
await closeLoading(response); await closeLoading(response);
return response.data; return response.data;
}, },
async error => { async error => {
@ -84,45 +140,15 @@ service.interceptors.response.use(
isRefreshToken++; isRefreshToken++;
if (isRefreshToken === 1) { if (isRefreshToken === 1) {
const getTokenRes = await refreshToken(); refresh()
if (getTokenRes === 'success') { // 刷新token isRefreshToken = 0;
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
} }
} else { } else {
if (error.message) { if (error.message) {
let _message = error.code === 'ECONNABORTED' ? '连接超时,请稍候再试!' : '网络错误,请稍后再试!'; let _message =
error.code === "ECONNABORTED"
? "连接超时,请稍候再试!"
: "网络错误,请稍后再试!";
Message.error(errorData.message || _message); Message.error(errorData.message || _message);
} }
} }
@ -134,7 +160,7 @@ service.interceptors.response.use(
* 关闭全局加载 * 关闭全局加载
* @param target * @param target
*/ */
const closeLoading = (target) => { const closeLoading = target => {
if (!target.config || !target.config.loading) return true; if (!target.config || !target.config.loading) return true;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
@ -145,10 +171,10 @@ const closeLoading = (target) => {
}; };
export const Method = { export const Method = {
GET: 'get', GET: "get",
POST: 'post', POST: "post",
PUT: 'put', PUT: "put",
DELETE: 'delete' DELETE: "delete"
}; };
export default function request(options) { export default function request(options) {
@ -161,46 +187,45 @@ export default function request (options) {
// 防抖闭包来一波 // 防抖闭包来一波
function getTokenDebounce() { function getTokenDebounce() {
let lock = false let lock = false;
let success = false let success = false;
return function() { return function() {
if (!lock) { if (!lock) {
lock = true lock = true;
let oldRefreshToken = Storage.getItem('refreshToken'); let oldRefreshToken = Storage.getItem("refreshToken");
handleRefreshToken(oldRefreshToken).then(res => { handleRefreshToken(oldRefreshToken)
.then(res => {
if (res.success) { if (res.success) {
let { let { accessToken, refreshToken } = res.result;
accessToken, Storage.setItem("accessToken", accessToken);
refreshToken Storage.setItem("refreshToken", refreshToken);
} = res.result;
Storage.setItem('accessToken', accessToken);
Storage.setItem('refreshToken', refreshToken);
success = true success = true;
lock = false lock = false;
} else { } else {
success = false success = false;
lock = false lock = false;
// router.push('/login') // router.push('/login')
} }
}).catch((err) => {
console.log(err);
success = false
lock = false
}) })
.catch(err => {
console.log(err);
success = false;
lock = false;
});
} }
return new Promise(resolve => { return new Promise(resolve => {
// 一直看lock,直到请求失败或者成功 // 一直看lock,直到请求失败或者成功
const timer = setInterval(() => { const timer = setInterval(() => {
if (!lock) { if (!lock) {
clearInterval(timer) clearInterval(timer);
if (success) { if (success) {
resolve('success') resolve("success");
} else { } else {
resolve('fail') resolve("fail");
} }
} }
}, 500) // 轮询时间间隔 }, 500); // 轮询时间间隔
}) });
} };
} }

View File

@ -47,6 +47,8 @@ const ComplainList = resolve => require(['@/pages/home/memberCenter/ComplainList
const ComplainDetail = resolve => require(['@/pages/home/memberCenter/ComplainDetail'], resolve); const ComplainDetail = resolve => require(['@/pages/home/memberCenter/ComplainDetail'], resolve);
const Invoice = resolve => require(['@/pages/home/memberCenter/Invoice'], resolve); const Invoice = resolve => require(['@/pages/home/memberCenter/Invoice'], resolve);
const Point = resolve => require(['@/pages/home/memberCenter/Point'], 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', name: 'AddAddress',
component: AddAddress component: AddAddress
}, },
{
path: 'MsgList',
name: 'MsgList',
component: MsgList,
meta: {title: '我的消息'}
},
{
path: 'MsgDetail',
name: 'MsgDetail',
component: MsgDetail,
meta: {title: '我的消息'}
},
{ {
path: 'MyOrder', path: 'MyOrder',
name: 'MyOrder', name: 'MyOrder',

View File

@ -27,7 +27,6 @@
"print-js": "^1.0.63", "print-js": "^1.0.63",
"qrcodejs2": "0.0.2", "qrcodejs2": "0.0.2",
"quill": "^1.3.7", "quill": "^1.3.7",
"vue-qr": "^2.3.0",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"sockjs-client": "^1.4.0", "sockjs-client": "^1.4.0",
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
@ -40,14 +39,17 @@
"vue-clipboard2": "^0.3.0", "vue-clipboard2": "^0.3.0",
"vue-cropper": "^0.4.9", "vue-cropper": "^0.4.9",
"vue-i18n": "^8.15.1", "vue-i18n": "^8.15.1",
"vue-json-excel": "^0.3.0",
"vue-json-pretty": "^1.4.1", "vue-json-pretty": "^1.4.1",
"vue-lazyload": "^1.3.3", "vue-lazyload": "^1.3.3",
"vue-qr": "^2.3.0",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuedraggable": "^2.23.2", "vuedraggable": "^2.23.2",
"vuex": "^3.4.0", "vuex": "^3.4.0",
"wangeditor": "^4.5.3", "wangeditor": "^4.5.3",
"xlsx": "^0.16.2", "xlsx": "^0.16.2",
"xss": "^1.0.7" "xss": "^1.0.7",
"uuid": "^8.3.2"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.4.4", "@vue/cli-plugin-babel": "^4.4.4",

View File

@ -5,6 +5,7 @@
</template> </template>
<script> <script>
import {v4 as uuidv4} from 'uuid';
import {getCategoryTree} from '@/api/goods.js' import {getCategoryTree} from '@/api/goods.js'
export default { export default {
updated() { updated() {
@ -15,7 +16,14 @@ export default {
} }
}) })
} }
},
mounted() {
let uuid = this.getStore('uuid');
if (!uuid) {
uuid = uuidv4();
this.setStore('uuid', uuid);
} }
},
}; };
</script> </script>

View File

@ -1,4 +1,4 @@
import {commonUrl, getRequest} from '@/libs/axios'; import {commonUrl, getRequest, getRequestWithNoToken, postRequestWithNoToken} from '@/libs/axios';
// 通过id获取子地区 // 通过id获取子地区
export const getChildRegion = (id) => { export const getChildRegion = (id) => {
@ -6,6 +6,16 @@ export const getChildRegion = (id) => {
}; };
// 点地图获取地址信息 // 点地图获取地址信息
export const getRegion = (parpams) => { export const getRegion = (params) => {
return getRequest(`${commonUrl}/common/region/region`, parpams); 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中修改 // 统一请求路径前缀在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) => { export const getPromotionGoods = (promotionId, params) => {
return getRequest(`/promotion/${promotionId}/goods`, params) return getRequest(`/promotion/${promotionId}/goods`, params);
} };
// 获取当前进行中的促销活动 // 获取当前进行中的促销活动
export const getAllPromotion = (params) => { export const getAllPromotion = params => {
return getRequest('/promotion/current', params) return getRequest("/promotion/current", params);
} };
// 获取拼团数据 // 获取拼团数据
export const getPintuanList = (params) => { export const getPintuanList = params => {
return getRequest('/promotion/pintuan', params) return getRequest("/promotion/pintuan", params);
} };
// 获取拼团详情 // 获取拼团详情
export const getPintuanDetail = (id) => { export const getPintuanDetail = id => {
return getRequest(`/promotion/pintuan/${id}`) return getRequest(`/promotion/pintuan/${id}`);
} };
// 获取拼团商品数据 // 获取拼团商品数据
export const getPintuanGoodsList = (params) => { export const getPintuanGoodsList = params => {
return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`,params) return getRequest(`/promotion/pintuan/goods/${params.pintuanId}`, params);
} };
// 关闭拼团活动 // 关闭拼团活动
export const closePintuan = (pintuanId) => { export const closePintuan = pintuanId => {
return putRequest(`/promotion/pintuan/close/${pintuanId}`) return putRequest(`/promotion/pintuan/close/${pintuanId}`);
} };
// 保存平台优惠券 // 保存平台优惠券
export const savePlatformCoupon = (params) => { export const savePlatformCoupon = params => {
return postRequest('/promotion/coupon', params,{'Content-type': 'application/json'}) return postRequest("/promotion/coupon", params, {
} "Content-type": "application/json"
});
};
// 修改平台优惠券 // 修改平台优惠券
export const editPlatformCoupon = (params) => { export const editPlatformCoupon = params => {
return putRequest('/promotion/coupon', params,{'Content-type': 'application/json'}) return putRequest("/promotion/coupon", params, {
} "Content-type": "application/json"
});
};
// 获取平台优惠券 // 获取平台优惠券
export const getPlatformCouponList = (params) => { export const getPlatformCouponList = params => {
return getRequest('/promotion/coupon', params) return getRequest("/promotion/coupon", params);
} };
// 作废优惠券 // 作废优惠券
export const deletePlatformCoupon = (ids) => { export const deletePlatformCoupon = ids => {
return deleteRequest(`/promotion/coupon/${ids}`) return deleteRequest(`/promotion/coupon/${ids}`);
} };
// 更新优惠券状态 // 更新优惠券状态
export const updatePlatformCouponStatus = ( params) => { export const updatePlatformCouponStatus = params => {
return putRequest(`/promotion/coupon/status`, params) return putRequest(`/promotion/coupon/status`, params);
} };
// 获取单个优惠券 // 获取单个优惠券
export const getPlatformCoupon = (id) => { export const getPlatformCoupon = id => {
return getRequest(`/promotion/coupon/${id}`) return getRequest(`/promotion/coupon/${id}`);
} };
// 获取优惠券领取详情 // 获取优惠券领取详情
export const getMemberReceiveCouponList = (id) => { export const getMemberReceiveCouponList = id => {
return getRequest(`/promotion/coupon/member/${id}`) return getRequest(`/promotion/coupon/member/${id}`);
} };
// 作废会员优惠券 // 作废会员优惠券
export const deleteMemberReceiveCoupon = (id) => { export const deleteMemberReceiveCoupon = id => {
return putRequest(`/promotion/coupon/member/cancellation/${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) => { export const getSeckillList = params => {
return getRequest('/promotion/seckill', params) return getRequest("/promotion/seckill", params);
} };
// 获取限时抢购审核列表 // 获取限时抢购审核列表
export const seckillGoodsList = (params) => { export const seckillGoodsList = params => {
return getRequest('/promotion/seckill/apply', params) return getRequest("/promotion/seckill/apply", params);
} };
// 获取限时抢购详情数据 // 获取限时抢购详情数据
export const seckillDetail = (id, params) => { export const seckillDetail = (id, params) => {
return getRequest(`/promotion/seckill/${id}`, params) return getRequest(`/promotion/seckill/${id}`, params);
} };
// 删除限时抢购 // 删除限时抢购
export const delSeckill = (id) => { export const delSeckill = id => {
return deleteRequest(`/promotion/seckill/${id}`) return deleteRequest(`/promotion/seckill/${id}`);
} };
// 保存限时抢购 // 保存限时抢购
export const saveSeckill = (params) => { export const saveSeckill = params => {
return postRequest('/promotion/seckill', params) return postRequest("/promotion/seckill", params);
} };
// 修改限时抢购 // 修改限时抢购
export const updateSeckill = (params) => { export const updateSeckill = params => {
return putRequest('/promotion/seckill', params) return putRequest("/promotion/seckill", params);
} };
// 关闭限时抢购 // 关闭限时抢购
export const closeSeckill = (id) => { export const closeSeckill = id => {
return putRequest(`/promotion/seckill/close/${id}`) return putRequest(`/promotion/seckill/close/${id}`);
} };
// 审核限时抢购 // 审核限时抢购
export const auditApplySeckill = (params) => { export const auditApplySeckill = params => {
return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params) return putRequest(`/promotion/seckill/apply/audit/${params.ids}`, params);
} };
// 满优惠列表 // 满优惠列表
export const getFullDiscountList = (params) => { export const getFullDiscountList = params => {
return getRequest(`/promotion/fullDiscount`,params) return getRequest(`/promotion/fullDiscount`, params);
} };
// 满优惠列表 // 满优惠列表
export const getFullDiscountById = (id) => { export const getFullDiscountById = id => {
return getRequest(`/promotion/fullDiscount/${id}`) return getRequest(`/promotion/fullDiscount/${id}`);
} };
// 积分商品列表 // 积分商品列表
export const getPointsGoodsList = (params) => { export const getPointsGoodsList = params => {
return getRequest(`/promotion/pointsGoods`,params) return getRequest(`/promotion/pointsGoods`, params);
} };
// 积分商品详情 // 积分商品详情
export const getPointsGoodsById = (id) => { export const getPointsGoodsById = id => {
return getRequest(`/promotion/pointsGoods/${id}`) return getRequest(`/promotion/pointsGoods/${id}`);
} };
// 添加积分商品 // 添加积分商品
export const addPointsGoods = (params) => { export const addPointsGoods = params => {
return postRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'}) return postRequest(`/promotion/pointsGoods`, params, {
} "Content-type": "application/json"
});
};
// 修改积分商品 // 修改积分商品
export const updatePointsGoods = (params) => { export const updatePointsGoods = params => {
return putRequest(`/promotion/pointsGoods`,params, {'Content-type': 'application/json'}) return putRequest(`/promotion/pointsGoods`, params, {
} "Content-type": "application/json"
});
};
// 修改积分商品状态 // 修改积分商品状态
export const editPointsGoodsStatus = (id, params) => { export const editPointsGoodsStatus = (id, params) => {
return putRequest(`/promotion/pointsGoods/${id}`,params) return putRequest(`/promotion/pointsGoods/${id}`, params);
} };
// 删除积分商品 // 删除积分商品
export const deletePointsGoodsStatus = (id) => { export const deletePointsGoodsStatus = id => {
return deleteRequest(`/promotion/pointsGoods/${id}`) return deleteRequest(`/promotion/pointsGoods/${id}`);
} };
// 积分商品分类列表 // 积分商品分类列表
export const getPointsGoodsCategoryList = (params) => { export const getPointsGoodsCategoryList = params => {
return getRequest(`/promotion/pointsGoodsCategory`,params) return getRequest(`/promotion/pointsGoodsCategory`, params);
} };
// 积分商品分类详情 // 积分商品分类详情
export const getPointsGoodsCategoryById = (id) => { export const getPointsGoodsCategoryById = id => {
return getRequest(`/promotion/pointsGoodsCategory/${id}`) return getRequest(`/promotion/pointsGoodsCategory/${id}`);
} };
// 添加积分商品分类 // 添加积分商品分类
export const addPointsGoodsCategory = (params) => { export const addPointsGoodsCategory = params => {
return postRequest(`/promotion/pointsGoodsCategory`, params) return postRequest(`/promotion/pointsGoodsCategory`, params);
} };
// 更新积分商品分类 // 更新积分商品分类
export const updatePointsGoodsCategory = (params) => { export const updatePointsGoodsCategory = params => {
return putRequest(`/promotion/pointsGoodsCategory`, params) return putRequest(`/promotion/pointsGoodsCategory`, params);
} };
// 删除积分商品分类 // 删除积分商品分类
export const deletePointsGoodsCategoryById = (id) => { export const deletePointsGoodsCategoryById = id => {
return deleteRequest(`/promotion/pointsGoodsCategory/${id}`) return deleteRequest(`/promotion/pointsGoodsCategory/${id}`);
} };

View File

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

View File

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

View File

@ -5,7 +5,7 @@ export const loginRouter = {
path: "/login", path: "/login",
name: "login", name: "login",
meta: { meta: {
title: "登录 - lili " title: "登录 - lili运营后台"
}, },
component: () => import("@/views/login.vue") component: () => import("@/views/login.vue")
}; };
@ -243,6 +243,43 @@ export const otherRouter = {
name: "platform-coupon-info", name: "platform-coupon-info",
component: () => import("@/views/promotion/coupon/couponInfo.vue") 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", path: "promotion/manager-pintuan",
title: "平台拼团", title: "平台拼团",
@ -296,6 +333,12 @@ export const otherRouter = {
title: "短信签名", title: "短信签名",
name: "add-sms-sign", name: "add-sms-sign",
component: () => import("@/views/sys/message/smsSign.vue") 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 * @param price

View File

@ -10,12 +10,17 @@
<span slot="close">关闭</span> <span slot="close">关闭</span>
</i-switch> </i-switch>
</FormItem> </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> </Form>
</div> </div>
</template> </template>
<script> <script>
import { setSetting, getSetting } from "@/api/index"; import { setSetting, getSetting } from "@/api/index";
export default { export default {
@ -24,8 +29,11 @@
data() { data() {
return { return {
loading: true, // loading: true, //
form: { // form: {
isOpen: "" //
isOpen: "",
distributionDay: "", //
cashDay: "", //
}, },
// //
formValidate: {}, formValidate: {},
@ -33,7 +41,7 @@
selectList: [], // selectList: [], //
selectCount: 0, // selectCount: 0, //
data: [], // data: [], //
total: 0 // total: 0, //
}; };
}, },
methods: { methods: {
@ -43,7 +51,7 @@
getDataList() { getDataList() {
this.loading = true; this.loading = true;
// //
getSetting("DISTRIBUTION_SETTING").then(res => { getSetting("DISTRIBUTION_SETTING").then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
this.form = res.result; this.form = res.result;
@ -52,25 +60,27 @@
this.loading = false; this.loading = false;
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((valid) => {
this.$refs.form.validate(valid => {
if (valid) { if (valid) {
setSetting("DISTRIBUTION_SETTING", this.form).then(res => { //
this.$options.filters.debounce(this.submit(), 1500);
}
});
},
submit() {
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
if (res.success) { if (res.success) {
this.$Message.success("操作成功"); this.$Message.success("操作成功");
this.getDataList(); this.getDataList();
} }
}); });
} },
})
}
}, },
mounted() { mounted() {
this.init(); this.init();
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

View File

@ -211,10 +211,8 @@
import { homeStatistics, hotGoods, hotShops, getNoticePage } from "@/api/index"; import { homeStatistics, hotGoods, hotShops, getNoticePage } from "@/api/index";
import show from "./show.vue"; import show from "./show.vue";
import * as API_Goods from "@/api/goods"; import * as API_Goods from "@/api/goods";
import { Chart } from "@antv/g2"; import { Chart } from "@antv/g2";
import * as API_Member from "@/api/member"; import * as API_Member from "@/api/member";
import Cookies from "js-cookie";
export default { export default {
name: "home", name: "home",
components: { components: {
@ -502,11 +500,13 @@ export default {
let data = this.chartList; let data = this.chartList;
data.forEach((item) => { data.forEach((item) => {
item.title = "历史在线人数"; item.title = "历史在线人数";
item.date = item.date.substring(5)
}); });
this.historyMemberChart.data(data); this.historyMemberChart.data(data);
console.error(data)
this.historyMemberChart.tooltip({ this.historyMemberChart.tooltip({
showCrosshairs: true, showCrosshairs: true,
shared: 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

@ -14,10 +14,12 @@
<script> <script>
import goodsDialog from "./goods-dialog"; import goodsDialog from "./goods-dialog";
import linkDialog from "./link-dialog"; import linkDialog from "./link-dialog";
import couponDialog from "./coupon-dialog";
export default { export default {
components: { components: {
goodsDialog, goodsDialog,
linkDialog, linkDialog,
couponDialog,
}, },
data() { data() {
return { return {

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

@ -79,11 +79,11 @@
</div> </div>
</template> </template>
<script> <script>
import { btnWay } from "./btn.js";
export default { export default {
data() { data() {
return { return {
btnWay, //
type: "full", // type: "full", //
//广 //广
@ -100,7 +100,7 @@ export default {
}, },
methods: {}, methods: {},
mounted() { mounted() {
console.log(this.btnWay);
}, },
methods: { methods: {
@ -109,12 +109,7 @@ export default {
this.$refs.liliDialog.open('link') this.$refs.liliDialog.open('link')
}, },
//
closeDecorate(index) {
this.$nextTick(() => {
this.btnWay.splice(index, 1);
});
},
//base64 //base64
changeFile(item, index) { changeFile(item, index) {
const file = document.getElementById("files" + index).files[0]; const file = document.getElementById("files" + index).files[0];

View File

@ -76,7 +76,7 @@
</div> </div>
</template> </template>
<script> <script>
import { btnWay } from "./btn.js";
export default { export default {
data() { data() {
return { return {
@ -95,7 +95,7 @@ export default {
}, },
methods: {}, methods: {},
mounted() { mounted() {
console.log(this.btnWay);
}, },
methods: { methods: {
// //
@ -103,12 +103,7 @@ export default {
this.$refs.liliDialog.open('link') this.$refs.liliDialog.open('link')
}, },
//
closeDecorate(index) {
this.$nextTick(() => {
this.btnWay.splice(index, 1);
});
},
//base64 //base64
changeFile(item, index) { changeFile(item, index) {
const file = document.getElementById("files" + index).files[0]; const file = document.getElementById("files" + index).files[0];

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 index from './index.vue' //首页
import btn from './btn.vue' //按钮
import advertising from './advertising.vue' //全屏活动 import advertising from './advertising.vue' //全屏活动
import alertAdvertising from './alertAdvertising.vue' //弹窗活动 import alertAdvertising from './alertAdvertising.vue' //弹窗活动
@ -7,7 +7,7 @@ import alertAdvertising from './alertAdvertising.vue' //弹窗活动
const templates = { const templates = {
index, index,
btn,
advertising, advertising,
alertAdvertising alertAdvertising
} }

View File

@ -3,35 +3,22 @@
<div class="model-title"> <div class="model-title">
<div>店铺装修</div> <div>店铺装修</div>
<div class="btns"> <div class="btns">
<Button <Button @click="clickBtn(item)" size="small" v-for="(item, index) in way" :key="index" :type="item.selected ? 'primary' : ''">
@click="clickBtn(item)"
size="small"
v-for="(item, index) in way"
:key="index"
:type="item.selected ? 'primary' : ''"
>
{{ item.title }} {{ item.title }}
</Button> </Button>
</div> </div>
<div class="model-title-view-btn"> <div class="model-title-view-btn">
<Poptip placement="bottom" width="100"> <!-- TODO 后期会补全 目前版本暂无 -->
<!-- <Poptip placement="bottom" width="100">
<Button size="default" @click="creatQrCode"></Button> <Button size="default" @click="creatQrCode"></Button>
<div slot="content" class="default-view-content"> <div slot="content" class="default-view-content">
<div>临时预览</div> <div>临时预览</div>
<div ref="qrCodeUrl"></div> <div ref="qrCodeUrl"></div>
</div> </div>
</Poptip> </Poptip> -->
<Button size="default" type="primary" @click="handleSpinShow" <Button size="default" type="primary" @click="handleSpinShow"></Button>
>保存模板</Button
>
<Modal <Modal title="保存中" v-model="saveDialog" :closable="true" :mask-closable="false" :footer-hide="true">
title="保存中"
v-model="saveDialog"
:closable="true"
:mask-closable="false"
:footer-hide="true"
>
<div v-if="progress"> <div v-if="progress">
<div class="model-item"> <div class="model-item">
模板名称 <Input style="width: 200px" v-model="submitWay.name" /> 模板名称 <Input style="width: 200px" v-model="submitWay.name" />
@ -61,17 +48,14 @@ export default {
progress: true, // progress: true, //
num: 20, // num: 20, //
saveDialog: false, // saveDialog: false, //
way: [ // tab way: [
// tab
{ {
title: "首页", title: "首页",
name: "index", name: "index",
selected: true, selected: true,
}, },
{
title: "悬浮按钮",
name: "btn",
selected: false,
},
{ {
title: "全屏广告", title: "全屏广告",
name: "advertising", name: "advertising",
@ -84,7 +68,8 @@ export default {
}, },
], ],
qrcode: "", // qrcode: "", //
submitWay: { // submitWay: {
//
pageShow: this.$route.query.type || false, pageShow: this.$route.query.type || false,
name: this.$route.query.name || "模板名称", name: this.$route.query.name || "模板名称",
pageClientType: "H5", pageClientType: "H5",
@ -133,6 +118,8 @@ export default {
pageData: JSON.stringify(this.$store.state.styleStore), pageData: JSON.stringify(this.$store.state.styleStore),
name: this.submitWay.name, name: this.submitWay.name,
pageShow: this.submitWay.pageShow, pageShow: this.submitWay.pageShow,
pageType: "INDEX",
pageClientType: "H5",
}) })
.then((res) => { .then((res) => {
this.num = 50; this.num = 50;

View File

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

View File

@ -13,15 +13,12 @@
export default { export default {
title: "五列单行图片模块", title: "五列单行图片模块",
props: ["res"], props: ["res"],
mounted() {
console.log(this.res);
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./tpl.scss"; @import "./tpl.scss";
.layout { .layout {
background: #e8e8e8;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

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

View File

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

View File

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

View File

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

View File

@ -22,6 +22,8 @@
</Row> </Row>
</Row> </Row>
<!-- 拼图验证码 -->
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
<div v-if="socialLogining"> <div v-if="socialLogining">
<RectLoading /> <RectLoading />
</div> </div>
@ -41,6 +43,7 @@ import LangSwitch from "@/views/main-components/lang-switch";
import RectLoading from "@/views/my-components/lili/rect-loading"; import RectLoading from "@/views/my-components/lili/rect-loading";
import CountDownButton from "@/views/my-components/lili/count-down-button"; import CountDownButton from "@/views/my-components/lili/count-down-button";
import util from "@/libs/util.js"; import util from "@/libs/util.js";
import verify from "@/views/my-components/verify";
export default { export default {
components: { components: {
@ -49,17 +52,20 @@ export default {
LangSwitch, LangSwitch,
Header, Header,
Footer, Footer,
verify,
}, },
data() { data() {
return { return {
loading: false, // loading: false, //
form: { // form: {
//
username: "", username: "",
password: "", password: "",
mobile: "", mobile: "",
code: "", code: "",
}, },
rules: { // rules: {
//
username: [ username: [
{ {
required: true, required: true,
@ -80,6 +86,7 @@ export default {
methods: { methods: {
mounted() {}, mounted() {},
afterLogin(res) { afterLogin(res) {
//
let accessToken = res.result.accessToken; let accessToken = res.result.accessToken;
let refreshToken = res.result.refreshToken; let refreshToken = res.result.refreshToken;
this.setStore("accessToken", accessToken); this.setStore("accessToken", accessToken);
@ -101,21 +108,33 @@ export default {
}); });
}, },
submitLogin() { submitLogin() {
//
this.$refs.usernameLoginForm.validate((valid) => { this.$refs.usernameLoginForm.validate((valid) => {
if (valid) { if (valid) {
this.$refs.verify.show = true;
}
});
},
verifyChange(con) {
//
if (!con.status) return;
this.loading = true; this.loading = true;
login({ login({
username: this.form.username, username: this.form.username,
password: this.md5(this.form.password), password: this.md5(this.form.password),
}).then((res) => { })
.then((res) => {
if (res && res.success) { if (res && res.success) {
this.afterLogin(res); this.afterLogin(res);
} else { } else {
this.loading = false; this.loading = false;
} }
})
.catch(() => {
this.loading = false;
}); });
} this.$refs.verify.show = false;
});
}, },
}, },
}; };
@ -140,7 +159,12 @@ export default {
position: relative; position: relative;
zoom: 1; zoom: 1;
} }
.verify-con {
position: absolute;
top: 90px;
z-index: 10;
left: 20px;
}
.form { .form {
padding-top: 1vh; padding-top: 1vh;
@ -179,5 +203,4 @@ export default {
.flex { .flex {
justify-content: center; justify-content: center;
} }
</style> </style>

View File

@ -2,7 +2,6 @@
<div> <div>
<Row class="header"> <Row class="header">
<img src="../../assets/logo.png" class="logo" width="220px"> <img src="../../assets/logo.png" class="logo" width="220px">
<!-- <div class="description">{{ $t('LILISHOP-ADMIN') }}</div> -->
</Row> </Row>
</div> </div>
</template> </template>
@ -15,13 +14,13 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.header { .header {
margin-bottom: 6vh; margin-bottom: 6vh;
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center !important; justify-content: center !important;
} }
.logo { .logo {
transform: scale(2); width: 440px;
height: 158px;
} }
</style> </style>

View File

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

View File

@ -24,8 +24,8 @@
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"> <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
</Table> </Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
size="small" show-total show-elevator show-sizer></Page> show-total show-elevator show-sizer></Page>
</Row> </Row>
</Card> </Card>
@ -137,12 +137,14 @@ export default {
loading: true, // loading: true, //
addFlag: false, // modal addFlag: false, // modal
updateRegion: false, // updateRegion: false, //
addMemberForm: { // addMemberForm: {
//
mobile: "", mobile: "",
username: "", username: "",
password: "", password: "",
}, },
searchForm: { // searchForm: {
//
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
order: "desc", order: "desc",
@ -152,7 +154,8 @@ export default {
}, },
picModelFlag: false, // picModelFlag: false, //
formValidate: {}, // formValidate: {}, //
addRule: { // addRule: {
//
mobile: [ mobile: [
{ required: true, message: "请输入手机号码" }, { required: true, message: "请输入手机号码" },
{ {
@ -229,6 +232,7 @@ export default {
{ {
props: { props: {
size: "small", size: "small",
type: params.row.___selected ? "primary" : "",
}, },
style: { style: {
marginRight: "5px", marginRight: "5px",
@ -236,11 +240,11 @@ export default {
}, },
on: { on: {
click: () => { click: () => {
this.callback(params.row); this.callback(params.row, params.index);
}, },
}, },
}, },
"选择" params.row.___selected ? "已选择" : "选择"
), ),
h( h(
@ -251,7 +255,8 @@ export default {
size: "small", size: "small",
}, },
style: { style: {
marginRight: "5px", display: this.selectedMember ? "none" : "block", marginRight: "5px",
display: this.selectedMember ? "none" : "block",
}, },
on: { on: {
click: () => { click: () => {
@ -270,7 +275,8 @@ export default {
ghost: true, ghost: true,
}, },
style: { style: {
marginRight: "5px", display: this.selectedMember ? "none" : "block", marginRight: "5px",
display: this.selectedMember ? "none" : "block",
}, },
on: { on: {
click: () => { click: () => {
@ -306,18 +312,75 @@ export default {
], ],
data: [], // data: [], //
total: 0, // 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: { 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); this.$emit("callback", val);
}, },
init() { //
this.getData(); init(data) {
data.forEach((item) => {
if (this.selectMember.length != 0) {
this.selectMember.forEach((member) => {
if (member.id == item.id) {
this.$set(item, "___selected", true);
}
});
} else {
this.$set(item, "___selected", false);
}
});
this.data = data;
}, },
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
//
//selectedMember
this.getData(); this.getData();
}, },
changePageSize(v) { changePageSize(v) {
@ -373,12 +436,13 @@ export default {
} }
}); });
}, },
// //
getData() { getData() {
API_Member.getMemberListData(this.searchForm).then((res) => { API_Member.getMemberListData(this.searchForm).then((res) => {
if (res.result.records) { if (res.result.records) {
this.loading = false; this.loading = false;
this.data = res.result.records; this.init(res.result.records);
this.total = res.result.total; this.total = res.result.total;
} }
}); });
@ -467,7 +531,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.init(); this.getData();
}, },
}; };
</script> </script>

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>
</div> </div>
<Modal <Modal title="编辑html代码" v-model="showHTMLModal" :mask-closable="false" :width="900" :fullscreen="full">
title="编辑html代码" <Input v-if="!full" v-model="dataEdit" :rows="15" type="textarea" style="max-height:60vh;overflow:auto;" />
v-model="showHTMLModal"
:mask-closable="false"
:width="900"
:fullscreen="full"
>
<Input
v-if="!full"
v-model="dataEdit"
:rows="15"
type="textarea"
style="max-height:60vh;overflow:auto;"
/>
<Input v-if="full" v-model="dataEdit" :rows="32" type="textarea" /> <Input v-if="full" v-model="dataEdit" :rows="32" type="textarea" />
<div slot="footer"> <div slot="footer">
<Button @click="full=!full" icon="md-expand">全屏开/</Button> <Button @click="full=!full" icon="md-expand">全屏开/</Button>
@ -56,21 +44,21 @@ export default {
props: { props: {
id: { id: {
type: String, type: String,
default: "editor" default: "editor",
}, },
value: String, value: String,
base64: { base64: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
showExpand: { showExpand: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
openXss: { openXss: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
data() { data() {
return { return {
@ -79,16 +67,17 @@ export default {
dataEdit: "", // dataEdit: "", //
showHTMLModal: false, // html showHTMLModal: false, // html
full: false, // html full: false, // html
fullscreenModal: false // fullscreenModal: false, //
}; };
}, },
methods: { methods: {
initEditor() { initEditor() {
let that = this; let that = this;
// wangeditor3 https://www.kancloud.cn/wangfupeng/wangeditor3/332599 // wangeditor3 https://www.kancloud.cn/wangfupeng/wangeditor3/332599
editor = new E(`#${this.id}`); editor = new E(`#${this.id}`);
// //
editor.config.onchange = html => { editor.config.onchange = (html) => {
if (this.openXss) { if (this.openXss) {
this.data = xss(html); this.data = xss(html);
} else { } else {
@ -108,7 +97,7 @@ export default {
editor.config.uploadImgServer = uploadFile; editor.config.uploadImgServer = uploadFile;
// liliheadertoken // liliheadertoken
editor.config.uploadImgHeaders = { editor.config.uploadImgHeaders = {
accessToken: that.getStore("accessToken") accessToken: that.getStore("accessToken"),
}; };
editor.config.uploadFileName = "file"; editor.config.uploadFileName = "file";
editor.config.uploadImgHooks = { editor.config.uploadImgHooks = {
@ -139,9 +128,10 @@ export default {
} else { } else {
that.$Message.error(result.message); that.$Message.error(result.message);
} }
} },
}; };
} }
editor.config.customAlert = function (info) { editor.config.customAlert = function (info) {
// info // info
// that.$Message.info(info); // that.$Message.info(info);
@ -156,8 +146,8 @@ export default {
// type -> 'emoji' / 'image' // type -> 'emoji' / 'image'
type: "image", type: "image",
// content -> // content ->
content: sina content: sina,
} },
]; ];
editor.create(); editor.create();
if (this.value) { if (this.value) {
@ -187,7 +177,7 @@ export default {
editor.txt.html(this.data); editor.txt.html(this.data);
this.$emit("input", this.data); this.$emit("input", this.data);
this.$emit("on-change", this.data); this.$emit("on-change", this.data);
} },
}); });
}, },
setData(value) { setData(value) {
@ -200,22 +190,21 @@ export default {
this.$emit("input", this.data); this.$emit("input", this.data);
this.$emit("on-change", this.data); this.$emit("on-change", this.data);
} }
} },
}, },
watch: { watch: {
value(val) { value(val) {
this.setData(val); this.setData(val);
} },
}, },
mounted() { mounted() {
this.initEditor(); this.initEditor();
} },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.e-menu { .e-menu {
z-index: 101; z-index: 101;
position: absolute; position: absolute;
cursor: pointer; cursor: pointer;

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> <template>
<div class="search"> <div class="search">
<Card> <Card>
<Row @keydown.enter.native="handleSearch"> <Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form"> <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="订单号" prop="orderSn"> <Form-item label="订单号" prop="orderSn">
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 200px" /> <Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 160px" />
</Form-item> </Form-item>
<Form-item label="会员名称" prop="buyerName"> <Form-item label="会员名称" prop="buyerName">
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 200px" /> <Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 160px" />
</Form-item>
<Form-item label="订单类型" prop="orderType">
<Select v-model="searchForm.orderType" placeholder="请选择" clearable style="width: 160px">
<Option value="NORMAL">普通订单</Option>
<Option value="PINTUAN">拼团订单</Option>
<Option value="GIFT">赠品订单</Option>
<Option value="VIRTUAL">核验订单</Option>
</Select>
</Form-item> </Form-item>
<Form-item label="订单状态" prop="orderStatus"> <Form-item label="订单状态" prop="orderStatus">
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 200px"> <Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
<Option value="UNPAID">未付款</Option> <Option value="UNPAID">未付款</Option>
<Option value="PAID">已付款</Option> <Option value="PAID">已付款</Option>
<Option value="UNDELIVERED">待发货</Option> <Option value="UNDELIVERED">待发货</Option>
@ -20,29 +31,91 @@
<Option value="CANCELLED">已取消</Option> <Option value="CANCELLED">已取消</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="下单时间"> <Form-item label="下单时间">
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 200px"></DatePicker> <DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 160px"></DatePicker>
</Form-item> </Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button> <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form> </Form>
</Row> </Row>
<div>
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
<Button type="primary" class="export">
导出Excel
</Button>
</download-excel>
</div>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table> <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
size="small" show-total show-elevator show-sizer></Page> show-total show-elevator show-sizer></Page>
</Row> </Row>
</Card> </Card>
</div> </div>
</template> </template>
<script> <script>
import * as API_Order from "@/api/order"; import * as API_Order from "@/api/order";
import JsonExcel from "vue-json-excel";
export default { export default {
name: "orderList", name: "orderList",
components: {}, components: {
"download-excel": JsonExcel,
},
data() { data() {
return { 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, // loading: true, //
searchForm: { searchForm: {
// //
@ -65,18 +138,14 @@ export default {
{ {
title: "订单号", title: "订单号",
key: "sn", key: "sn",
minWidth: 230, minWidth: 240,
tooltip: true, tooltip: true,
}, },
{
title: "下单时间",
key: "createTime",
width: 200,
},
{ {
title: "订单来源", title: "订单来源",
key: "clientType", key: "clientType",
width: 95, width: 120,
render: (h, params) => { render: (h, params) => {
if (params.row.clientType == "H5") { if (params.row.clientType == "H5") {
return h("div", {}, "移动端"); return h("div", {}, "移动端");
@ -86,21 +155,39 @@ export default {
return h("div", {}, "小程序端"); return h("div", {}, "小程序端");
} else if (params.row.clientType == "APP") { } else if (params.row.clientType == "APP") {
return h("div", {}, "移动应用端"); return h("div", {}, "移动应用端");
} } else {
else{
return h("div", {}, params.row.clientType); return h("div", {}, params.row.clientType);
} }
}, },
}, },
{
title: "订单类型",
key: "orderType",
width: 120,
render: (h, params) => {
if (params.row.orderType == "NORMAL") {
return h("div", [h("span", {}, "普通订单")]);
} else if (params.row.orderType == "PINTUAN") {
return h("div", [h("span", {}, "拼团订单")]);
} else if (params.row.orderType == "GIFT") {
return h("div", [h("span", {}, "赠品订单")]);
} else if (params.row.orderType == "VIRTUAL") {
return h("div", [h("tag", {}, "核验订单")]);
}
},
},
{ {
title: "买家名称", title: "买家名称",
key: "memberName", key: "memberName",
width: 130, minWidth: 130,
tooltip: true,
}, },
{ {
title: "订单金额", title: "订单金额",
key: "flowPrice", key: "flowPrice",
minWidth: 120, minWidth: 100,
tooltip: true,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", "div",
@ -112,7 +199,7 @@ export default {
{ {
title: "订单状态", title: "订单状态",
key: "orderStatus", key: "orderStatus",
width: 95, minWidth: 100,
render: (h, params) => { render: (h, params) => {
if (params.row.orderStatus == "UNPAID") { if (params.row.orderStatus == "UNPAID") {
return h("div", [h("span", {}, "未付款")]); return h("div", [h("span", {}, "未付款")]);
@ -131,12 +218,19 @@ export default {
} }
}, },
}, },
{
title: "下单时间",
key: "createTime",
width: 170,
sortable: true,
sortType: "desc",
},
{ {
title: "操作", title: "操作",
key: "action", key: "action",
align: "center", align: "center",
width: 180, width: 100,
render: (h, params) => { render: (h, params) => {
return h("div", [ return h("div", [
h( h(
@ -280,4 +374,11 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
// //
@import "@/styles/table-common.scss"; @import "@/styles/table-common.scss";
.export {
margin: 10px 20px 10px 0;
}
.export-excel-wrapper {
display: inline;
}
</style> </style>

View File

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

View File

@ -4,21 +4,10 @@
<Row> <Row>
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form"> <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="活动名称" prop="couponName"> <Form-item label="活动名称" prop="couponName">
<Input <Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px" />
type="text"
v-model="searchForm.couponName"
placeholder="请输入活动名称"
clearable
style="width: 200px"
/>
</Form-item> </Form-item>
<Form-item label="活动状态" prop="promotionStatus"> <Form-item label="活动状态" prop="promotionStatus">
<Select <Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
v-model="searchForm.promotionStatus"
placeholder="请选择"
clearable
style="width: 200px"
>
<Option value="NEW">未开始</Option> <Option value="NEW">未开始</Option>
<Option value="START">已开始/上架</Option> <Option value="START">已开始/上架</Option>
<Option value="END">已结束/下架</Option> <Option value="END">已结束/下架</Option>
@ -26,66 +15,27 @@
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="活动时间"> <Form-item label="活动时间">
<DatePicker <DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
v-model="selectDate"
type="daterange"
clearable
placeholder="选择起始时间"
style="width: 200px"
></DatePicker>
</Form-item> </Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button> <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form> </Form>
</Row> </Row>
<Row class="operation padding-row"> <Row class="operation padding-row">
<Button @click="add" type="primary">添加</Button> <Button @click="add" type="primary">添加优惠券</Button>
<Button @click="delAll"></Button> <Button @click="delAll"></Button>
<!-- <Button @click="upAll" >批量上架</Button> --> <!-- <Button @click="upAll" >批量上架</Button> -->
</Row> </Row>
<Table <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-select-cancel="cancelSelect" @on-selection-change="changeSelect">
:loading="loading" <template slot-scope="{ row,index }" slot="action">
border <Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary" size="small" style="margin-right: 10px" @click="edit(row)">
:columns="columns" </Button>
:data="data" <Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" style="margin-right: 10px" @click="remove(row)">
ref="table" </Button>
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
>
</template> </template>
</Table> </Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
:current="searchForm.pageNumber + 1" show-total show-elevator show-sizer></Page>
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row> </Row>
</Card> </Card>
</div> </div>
@ -94,13 +44,13 @@
<script> <script>
import { import {
getPlatformCouponList, getPlatformCouponList,
deletePlatformCoupon,
updatePlatformCouponStatus, updatePlatformCouponStatus,
} from "@/api/promotion"; } from "@/api/promotion";
export default { export default {
name: "coupon", name: "coupon",
components: {}, components: {},
data() { data() {
return { return {
loading: true, // loading: true, //
@ -109,10 +59,11 @@ export default {
modalTitle: "", // modalTitle: "", //
searchForm: { searchForm: {
// //
pageNumber: 0, // pageNumber: 1, //
pageSize: 10, // pageSize: 10, //
sort: "startTime", // sort: "startTime", //
order: "desc", // order: "desc", //
getType: "", //
}, },
form: { form: {
// //
@ -138,15 +89,16 @@ export default {
{ {
title: "活动名称", title: "活动名称",
key: "promotionName", key: "promotionName",
width: 120, minWidth: 100,
fixed: "left", fixed: "left",
}, },
{ {
title: "优惠券名称", title: "优惠券名称",
key: "couponName", key: "couponName",
width: 120, minWidth: 100,
tooltip: true tooltip: true,
}, { },
{
title: "面额/折扣", title: "面额/折扣",
key: "price", key: "price",
width: 120, width: 120,
@ -165,9 +117,12 @@ export default {
{ {
title: "领取数量/总数量", title: "领取数量/总数量",
key: "publishNum", key: "publishNum",
width: 150,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", params.row.receivedNum + "/" + params.row.publishNum) "div",
params.row.receivedNum + "/" + params.row.publishNum
);
}, },
minWidth: 130, minWidth: 130,
}, },
@ -205,21 +160,28 @@ export default {
}, },
{ {
title: "活动时间", title: "活动时间",
render: (h, params) => { render: (h, params) => {
if (params.row.getType === "ACTIVITY") {
return h("div", "长期有效");
} else {
return h("div", { return h("div", {
domProps: domProps: {
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime} innerHTML:
}); params.row.startTime + "<br/>" + params.row.endTime,
},
});
}
}, },
minWidth:150,
}, },
{ {
title: "状态", title: "状态",
width: 100,
key: "promotionStatus", key: "promotionStatus",
fixed: "right", fixed: "right",
render: (h, params) => { render: (h, params) => {
let text = "未知", let text = "未知",
color = ""; color = "red";
if (params.row.promotionStatus == "NEW") { if (params.row.promotionStatus == "NEW") {
text = "未开始"; text = "未开始";
color = "default"; color = "default";
@ -252,13 +214,31 @@ export default {
slot: "action", slot: "action",
align: "center", align: "center",
fixed: "right", fixed: "right",
minWidth: 140 maxWidth: 140,
}, },
], ],
data: [], // data: [], //
total: 0, // total: 0, //
selectCoupon: [], //
}; };
}, },
props: {
//
checked: {
type: Boolean,
default: false,
},
//
getType: {
type: String,
default: "",
},
//
selectedList: {
type: Array,
default: [],
},
},
watch: { watch: {
$route(to, from) { $route(to, from) {
if (to.fullPath == "/promotion/manager-coupon") { if (to.fullPath == "/promotion/manager-coupon") {
@ -267,6 +247,21 @@ export default {
}, },
}, },
methods: { 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() { init() {
this.getDataList(); this.getDataList();
}, },
@ -281,9 +276,9 @@ export default {
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } }); this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
}, },
changePage(v) { changePage(v) {
this.searchForm.pageNumber = v - 1; this.searchForm.pageNumber = v;
this.getDataList(); this.getDataList();
this.clearSelectAll(); // this.clearSelectAll();
}, },
changePageSize(v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
@ -305,7 +300,35 @@ export default {
clearSelectAll() { clearSelectAll() {
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
}, },
/**
* 取消已选择的数据
*/
cancelSelect(selection, row) {
console.log(row)
let findCoupon = this.selectCoupon.find((item) => {
return item.id == row.id;
});
//
if (!findCoupon) {
this.selectCoupon.push(row);
} else {
//
this.selectCoupon.map((item, index) => {
if (item.id == findCoupon.id) {
this.selectCoupon.splice(index, 1);
}
});
}
},
/**
* 选择优惠券
*/
changeSelect(e) { changeSelect(e) {
if (this.checked && e.length != 0) {
this.selectCoupon.push(...e);
this.check();
}
this.selectList = e; this.selectList = e;
this.selectCount = e.length; this.selectCount = e.length;
}, },
@ -322,6 +345,18 @@ export default {
getPlatformCouponList(this.searchForm).then((res) => { getPlatformCouponList(this.searchForm).then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
res.result.records.forEach((item) => {
if (this.selectCoupon.length != 0) {
this.selectCoupon.forEach((child) => {
if (item.id == child.id) {
item.___selected = true;
item._checked = true;
}
});
}
item.___selected = false;
});
this.data = res.result.records; this.data = res.result.records;
this.total = res.result.total; this.total = res.result.total;
} }
@ -373,7 +408,10 @@ export default {
loading: true, loading: true,
onOk: () => { onOk: () => {
// //
updatePlatformCouponStatus({couponIds: v.id, promotionStatus: "CLOSE"}) updatePlatformCouponStatus({
couponIds: v.id,
promotionStatus: "CLOSE",
})
.then((res) => { .then((res) => {
this.$Modal.remove(); this.$Modal.remove();
if (res.success) { if (res.success) {
@ -449,6 +487,10 @@ export default {
}, },
}, },
mounted() { mounted() {
//
if (this.getType) {
this.searchForm.getType = this.getType;
}
this.init(); this.init();
}, },
}; };

View File

@ -37,29 +37,45 @@
</Input> </Input>
<span class="describe">店铺承担比例输入0-100之间数值</span> <span class="describe">店铺承担比例输入0-100之间数值</span>
</FormItem> </FormItem>
<FormItem label="发放数量" prop="publishNum"> <FormItem label="发放数量" prop="publishNum" v-if="form.getType==='FREE'">
<Input v-model="form.publishNum" placeholder="发放数量" style="width: 260px"/> <Input v-model="form.publishNum" placeholder="发放数量" style="width: 260px"/>
</FormItem> </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> </div>
<h4>使用限制</h4> <h4>使用限制</h4>
<div class="form-item-view"> <div class="form-item-view">
<FormItem label="消费门槛" prop="consumeThreshold"> <FormItem label="消费门槛" prop="consumeThreshold">
<Input type="text" v-model="form.consumeThreshold" placeholder="消费门槛" clearable style="width: 260px"/> <Input type="text" v-model="form.consumeThreshold" placeholder="消费门槛" clearable style="width: 260px"/>
</FormItem> </FormItem>
<FormItem label="领取限制" prop="couponLimitNum">
<Input v-model="form.couponLimitNum" placeholder="领取限制" clearable style="width: 260px" />
</FormItem>
<FormItem label="有效期" prop="rangeTime"> <FormItem label="有效期" prop="rangeTime">
<DatePicker <div v-if="form.getType == 'ACTIVITY'">
type="datetimerange" <RadioGroup v-model="rangeTimeType">
v-model="form.rangeTime"
format="yyyy-MM-dd HH:mm:ss" <Radio :label="1">
placeholder="请选择" 起止时间
:options="options" </Radio>
style="width: 260px" <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> </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>
<FormItem label="使用范围" prop="scopeType"> <FormItem label="使用范围" prop="scopeType">
<RadioGroup type="button" button-style="solid" v-model="form.scopeType"> <RadioGroup type="button" button-style="solid" v-model="form.scopeType">
<Radio label="ALL">全品类</Radio> <Radio label="ALL">全品类</Radio>
@ -82,13 +98,10 @@
<FormItem v-if="form.scopeType == 'PORTION_GOODS_CATEGORY'"> <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>
<FormItem label="范围描述" prop="description">
<Input v-model="form.description" type="textarea" :rows="4" maxlength="50" show-word-limit clearable style="width: 260px" />
</FormItem>
<div> <div>
<Button type="text" @click="closeCurrentPage"></Button> <Button type="text" @click="closeCurrentPage"></Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit"></Button> <Button type="primary" :loading="submitLoading" @click="handleSubmit"></Button>
@ -116,6 +129,16 @@ export default {
components: { components: {
skuSelect, skuSelect,
}, },
watch: {
"form.getType": {
handler(val) {
if (val == "FREE") {
this.rangeTimeType = 1;
}
},
deep: true,
},
},
data() { data() {
const checkPrice = (rule, value, callback) => { const checkPrice = (rule, value, callback) => {
if (!value && value !== 0) { if (!value && value !== 0) {
@ -140,12 +163,13 @@ export default {
} }
}; };
return { return {
rangeTimeType: 1,
modalType: 0, // modalType: 0, //
form: { form: {
/** 店铺承担比例 */ /** 店铺承担比例 */
storeCommission: 0, storeCommission: 0,
/** 发行数量 */ /** 发行数量 */
publishNum: 1, publishNum: 0,
/** 运费承担者 */ /** 运费承担者 */
scopeType: "ALL", scopeType: "ALL",
/** 限领数量 */ /** 限领数量 */
@ -154,9 +178,11 @@ export default {
couponType: "PRICE", couponType: "PRICE",
/** 优惠券名称 */ /** 优惠券名称 */
couponName: "", couponName: "",
promotionName: "",
getType: "FREE", getType: "FREE",
promotionGoodsList: [], promotionGoodsList: [],
scopeIdGoods: [], scopeIdGoods: [],
rangeDayType: "",
}, },
id: this.$route.query.id, // id id: this.$route.query.id, // id
submitLoading: false, // submitLoading: false, //
@ -171,7 +197,6 @@ export default {
formRule: { formRule: {
promotionName: [{required: true, message: "活动名称不能为空"}], promotionName: [{required: true, message: "活动名称不能为空"}],
couponName: [{required: true, message: "优惠券名称不能为空"}], couponName: [{required: true, message: "优惠券名称不能为空"}],
couponLimitNum: [{ required: true, message: "领取限制不能为空" }],
price: [ price: [
{required: true, message: "请输入面额"}, {required: true, message: "请输入面额"},
{validator: checkPrice}, {validator: checkPrice},
@ -197,7 +222,7 @@ export default {
{pattern: regular.integer, message: "请输入正整数"}, {pattern: regular.integer, message: "请输入正整数"},
], ],
couponLimitNum: [ couponLimitNum: [
{ required: true, message: "请输入领取限制" }, {required: true, message: "领取限制不能为空"},
{pattern: regular.integer, message: "请输入正整数"}, {pattern: regular.integer, message: "请输入正整数"},
], ],
description: [{required: true, message: "请输入范围描述"}], description: [{required: true, message: "请输入范围描述"}],
@ -277,6 +302,7 @@ export default {
if (!data.promotionGoodsList) data.promotionGoodsList = []; if (!data.promotionGoodsList) data.promotionGoodsList = [];
if (data.scopeType == "PORTION_GOODS_CATEGORY") { if (data.scopeType == "PORTION_GOODS_CATEGORY") {
let prevCascader = data.scopeId.split(","); let prevCascader = data.scopeId.split(",");
// console.log(prevCascader); // console.log(prevCascader);
function next(params, prev) { function next(params, prev) {
for (let i = 0; i < params.length; i++) { for (let i = 0; i < params.length; i++) {
@ -301,6 +327,7 @@ export default {
} }
} }
} }
next(this.goodsCategoryList, []); next(this.goodsCategoryList, []);
data.scopeIdGoods = prevCascader; data.scopeIdGoods = prevCascader;
} }
@ -314,13 +341,24 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const params = JSON.parse(JSON.stringify(this.form)); const params = JSON.parse(JSON.stringify(this.form));
//
params.getType != "ACTIVITY" ? delete params.effectiveDays : "";
//
if (this.rangeTimeType == 1) {
params.rangeDayType = "FIXEDTIME";
params.startTime = this.$options.filters.unixToDate( params.startTime = this.$options.filters.unixToDate(
this.form.rangeTime[0] / 1000 this.form.rangeTime[0] / 1000
); );
params.endTime = this.$options.filters.unixToDate( params.endTime = this.$options.filters.unixToDate(
this.form.rangeTime[1] / 1000 this.form.rangeTime[1] / 1000
); );
delete params.rangeTime delete params.effectiveDays;
} else {
params.rangeDayType = "DYNAMICTIME";
delete params.rangeTime;
}
let scopeId = []; let scopeId = [];
if ( if (
@ -392,12 +430,13 @@ export default {
); );
this.$router.go(-1); this.$router.go(-1);
}, },
openSkuList() { // openSkuList() {
//
this.$refs.skuSelect.open("goods"); this.$refs.skuSelect.open("goods");
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList)) let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
data.forEach(e => { data.forEach((e) => {
e.id = e.skuId e.id = e.skuId;
}) });
this.$refs.skuSelect.goodsData = data; this.$refs.skuSelect.goodsData = data;
}, },
changeSelect(e) { changeSelect(e) {
@ -522,10 +561,20 @@ h4 {
line-height: 40px; line-height: 40px;
text-align: left; text-align: left;
} }
.describe { .describe {
font-size: 12px; font-size: 12px;
margin-left: 10px; margin-left: 10px;
color: #999; color: #999;
} }
.effectiveDays {
font-size: 12px;
color: #999;
> * {
margin: 0 4px;
}
}
</style> </style>

Some files were not shown because too many files have changed in this diff Show More