买家优惠券页面调整,订单导出添加参数,订单详情样式调整

master
mabo 2021-07-22 09:01:59 +08:00
parent 75bff1edc4
commit 6351bdb633
10 changed files with 309 additions and 320 deletions

View File

@ -1,110 +0,0 @@
<template>
<div class="wrapper">
<empty v-if="list.length==0" />
<ul class="coupon-list" v-else>
<li v-for="(item, index) in list" class="coupon-item" :key="index">
<div class="c-left">
<div>
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span>
<span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.couponDiscount}}</span></span>
<span class="describe">{{item.consumeThreshold}}元可用</span>
</div>
<p>使用范围{{useScope(item.scopeType, item.storeName)}}</p>
<p>有效期{{item.endTime}}</p>
</div>
<b></b>
<a class="c-right" @click="go(item)">使</a>
<i class="circle-top"></i>
<i class="circle-bottom"></i>
</li>
</ul>
<Page :total="total" @on-change="changePageNum"
v-if="list.length && total > params.pageNumber"
class="pageration"
@on-page-size-change="changePageSize"
:page-size="params.pageSize"
show-sizer>
</Page>
<Spin v-if="loading" fix></Spin>
</div>
</template>
<script>
import { memberCouponList } from '@/api/member.js';
export default {
data () {
return {
loading: false, //
params: { //
pageNumber: 1,
pageSize: 10
},
total: 0, //
list: [] //
};
},
methods: {
getList () { //
this.loading = true
memberCouponList(this.params).then(res => {
this.loading = false
if (res.success) {
this.list = res.result.records
this.total = res.result.total
}
})
},
go (item) { // 使
if (item.storeId !== 'platform') {
this.$router.push({path: '/merchant', query: {id: item.storeId}})
} else {
if (item.scopeType === 'PORTION_GOODS_CATEGORY') {
this.$router.push({path: '/goodsList', query: {categoryId: item.scopeId}})
} else {
this.$router.push({path: '/goodsList'})
}
}
},
changePageNum (val) { //
this.params.pageNumber = val;
this.getList()
},
changePageSize (val) { //
this.pageNumber = 1;
this.params.pageSize = val;
this.getList()
},
useScope (type, storeName) { //
let shop = '平台';
let goods = '全部商品'
if (storeName !== 'platform') shop = storeName
switch (type) {
case 'ALL':
goods = '全部商品'
break;
case 'PORTION_GOODS':
goods = '部分商品'
break;
case 'PORTION_GOODS_CATEGORY':
goods = '部分分类商品'
break;
}
return `${shop}${goods}可用`
}
},
mounted () {
this.getList()
}
};
</script>
<style scoped lang="scss">
@import '../../assets/styles/coupon.scss';
.pageration {
text-align: right;
}
</style>

View File

@ -4,7 +4,7 @@
<!-- LOGO 搜索 -->
<div class="width_1200 logo">
<div>
<router-link to="/"><img :src="logoImg" alt="lili shop" title="lilishop" /></router-link>
<router-link to="/"><img :src="$store.state.logoImg" alt="lili shop" title="lilishop" /></router-link>
<div>
购物车(<span>{{ goodsTotal }}</span>)
</div>
@ -136,26 +136,25 @@
</template>
<script>
import Promotion from "@/components/goodsDetail/Promotion";
import Search from "@/components/Search";
import ShowLikeGoods from "@/components/like";
import * as APICart from "@/api/cart";
import * as APIMember from "@/api/member";
import { getLogo } from "@/api/common.js";
import Promotion from '@/components/goodsDetail/Promotion';
import Search from '@/components/Search';
import ShowLikeGoods from '@/components/like';
import * as APICart from '@/api/cart';
import * as APIMember from '@/api/member';
import { getLogo } from '@/api/common.js';
export default {
name: "Cart",
beforeRouteEnter(to, from, next) {
name: 'Cart',
beforeRouteEnter (to, from, next) {
window.scrollTo(0, 0);
next();
},
components: {
Search,
ShowLikeGoods,
Promotion,
Promotion
},
data() {
data () {
return {
logoImg: "", // logo
couponAvailable: false, //
stepIndex: 0, // ==0==1==2
goodsTotal: 1, //
@ -165,45 +164,45 @@ export default {
cartList: [], //
couponList: [], //
priceDetailDTO: {}, //
skuList: [], // sku
skuList: [] // sku
};
},
computed: {},
methods: {
//
goGoodsDetail(skuId, goodsId) {
goGoodsDetail (skuId, goodsId) {
let routeUrl = this.$router.resolve({
path: "/goodsDetail",
query: { skuId, goodsId },
path: '/goodsDetail',
query: { skuId, goodsId }
});
window.open(routeUrl.href, "_blank");
window.open(routeUrl.href, '_blank');
},
//
goShopPage(id) {
goShopPage (id) {
let routeUrl = this.$router.resolve({
path: "/Merchant",
query: { id },
path: '/Merchant',
query: { id }
});
window.open(routeUrl.href, "_blank");
window.open(routeUrl.href, '_blank');
},
//
collectGoods(id) {
collectGoods (id) {
this.$Modal.confirm({
title: "收藏",
content: "<p>商品收藏后可在个人中心我的收藏查看</p>",
title: '收藏',
content: '<p>商品收藏后可在个人中心我的收藏查看</p>',
onOk: () => {
APIMember.collectGoods("GOODS", id).then((res) => {
APIMember.collectGoods('GOODS', id).then((res) => {
if (res.success) {
this.$Message.success("收藏商品成功");
this.$Message.success('收藏商品成功');
this.getCartList();
}
});
},
onCancel: () => {},
onCancel: () => {}
});
},
//
delGoods(id) {
delGoods (id) {
const idArr = [];
if (!id) {
const list = this.cartList;
@ -216,50 +215,50 @@ export default {
idArr.push(id);
}
this.$Modal.confirm({
title: "删除",
content: "<p>确定要删除该商品吗?</p>",
title: '删除',
content: '<p>确定要删除该商品吗?</p>',
onOk: () => {
APICart.delCartGoods({ skuIds: idArr.toString() }).then((res) => {
if (res.success) {
this.$Message.success("删除成功");
this.$Message.success('删除成功');
this.getCartList();
} else {
this.$Message.error(res.message);
}
});
},
}
});
},
clearCart() {
clearCart () {
//
this.$Modal.confirm({
title: "提示",
content: "<p>确定要清空购物车吗?清空后不可恢复</p>",
title: '提示',
content: '<p>确定要清空购物车吗?清空后不可恢复</p>',
onOk: () => {
APICart.clearCart().then((res) => {
if (res.success) {
this.$Message.success("清空购物车成功");
this.$Message.success('清空购物车成功');
this.getCartList();
} else {
this.$Message.error(res.message);
}
});
},
}
});
},
//
pay() {
pay () {
if (this.checkedNum) {
this.$router.push({ path: "/pay", query: { way: "CART" } });
this.$router.push({ path: '/pay', query: { way: 'CART' } });
} else {
this.$Message.warning("请至少选择一件商品");
this.$Message.warning('请至少选择一件商品');
}
},
//
showCoupon(storeId, index) {
showCoupon (storeId, index) {
this.couponAvailable = index;
},
changeNum(val, id) {
changeNum (val, id) {
//
console.log(val, id);
APICart.setCartGoodsNum({ skuId: id, num: val }).then((res) => {
@ -269,13 +268,13 @@ export default {
}
});
},
async changeChecked(status, type, id) {
async changeChecked (status, type, id) {
//
const check = status ? 1 : 0;
if (type === "all") {
if (type === 'all') {
//
await APICart.setCheckedAll({ checked: check });
} else if (type === "shop") {
} else if (type === 'shop') {
//
await APICart.setCheckedSeller({ checked: check, storeId: id });
} else {
@ -286,17 +285,17 @@ export default {
this.getCartList();
},
async receiveShopCoupon(item) {
async receiveShopCoupon (item) {
//
let res = await APIMember.receiveCoupon(item.id);
if (res.success) {
this.$set(item, "disabled", true);
this.$Message.success("领取成功");
this.$set(item, 'disabled', true);
this.$Message.success('领取成功');
} else {
this.$Message.error(res.message);
}
},
async getCartList() {
async getCartList () {
//
this.loading = true;
try {
@ -326,25 +325,15 @@ export default {
} catch (error) {
this.loading = false;
}
}
},
},
mounted() {
mounted () {
this.getCartList();
APICart.cartCount().then((res) => {
//
if (res.success) this.goodsTotal = res.result;
});
if (!this.Cookies.getItem("logo")) {
getLogo().then((res) => {
if (res.success) {
let logoObj = JSON.parse(res.result.settingValue);
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
}
});
} else {
this.logoImg = this.Cookies.getItem("logo");
}
},
};
</script>

View File

@ -71,7 +71,7 @@
<Input v-model="form.bankAccountNumber" type="text" placeholder="请输入银行账号" style="width:260px" />
</FormItem>
</template>
<FormItem label="返回方式">
<FormItem label="返回方式" v-if="form.serviceType === 'RETURN_GOODS'">
<div>快递至第三方卖家</div>
</FormItem>
<FormItem>

View File

@ -1,32 +1,137 @@
<template>
<div class="wrapper">
<card _Title="优惠券列表" />
<Coupon/>
<card _Title="优惠券列表" :_Tabs="statusNameList" @_Change="change" />
<empty v-if="list.length==0" />
<ul class="coupon-list" v-else>
<li v-for="(item, index) in list" class="coupon-item" :key="index">
<div class="c-left">
<div>
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color">¥<span class="price">{{item.price | unitPrice}}</span></span>
<span v-if="item.couponType === 'DISCOUNT'" class="fontsize_12 global_color"><span class="price">{{item.discount}}</span></span>
<span class="describe">{{item.consumeThreshold}}元可用</span>
</div>
<p>使用范围{{useScope(item.scopeType, item.storeName)}}</p>
<p>有效期{{item.endTime}}</p>
</div>
<b></b>
<a class="c-right" @click="go(item)">使</a>
<i class="circle-top"></i>
<i class="circle-bottom"></i>
</li>
</ul>
<Page :total="total" @on-change="changePageNum"
v-if="list.length && total > params.pageNumber"
class="pageration"
@on-page-size-change="changePageSize"
:page-size="params.pageSize"
show-sizer>
</Page>
<Spin v-if="loading" fix></Spin>
</div>
</template>
<script>
import Coupon from '@/components/coupon/Coupon.vue'
import { memberCouponList } from '@/api/member.js';
export default {
name: 'Coupons',
data () {
return {
couponsList: [ //
statusNameList: [ //
'未使用',
'已使用',
'已过期',
'即将到期'
]
'已过期'
],
statusList: ['NEW', 'USED', 'EXPIRE'],
loading: false, //
params: { //
pageNumber: 1,
pageSize: 10,
memberCouponStatus: 'NEW'
},
total: 0, //
list: [] //
};
},
methods: {
getList () { //
this.loading = true
memberCouponList(this.params).then(res => {
this.loading = false
if (res.success) {
this.list = res.result.records
this.total = res.result.total
}
})
},
//
change (index) {
this.params.memberCouponStatus = this.statusList[index]
this.getList()
},
go (item) { // 使
if (item.storeId !== 'platform') {
this.$router.push({path: '/merchant', query: {id: item.storeId}})
} else {
if (item.scopeType === 'PORTION_GOODS_CATEGORY') {
this.$router.push({path: '/goodsList', query: {categoryId: item.scopeId}})
} else {
this.$router.push({path: '/goodsList'})
}
}
},
components: {Coupon},
mounted () {
changePageNum (val) { //
this.params.pageNumber = val;
this.getList()
},
methods: {}
changePageSize (val) { //
this.pageNumber = 1;
this.params.pageSize = val;
this.getList()
},
useScope (type, storeName) { //
let shop = '平台';
let goods = '全部商品'
if (storeName !== 'platform') shop = storeName
switch (type) {
case 'ALL':
goods = '全部商品'
break;
case 'PORTION_GOODS':
goods = '部分商品'
break;
case 'PORTION_GOODS_CATEGORY':
goods = '部分分类商品'
break;
}
return `${shop}${goods}可用`
}
},
mounted () {
this.getList()
}
}
</script>
<style scoped lang="scss">
@import '../../../assets/styles/coupon.scss';
.coupon-item{
height: 125px;
.c-left{
padding: 16px;
}
.c-right{
padding: 20px 16px;
width: 43px;
font-size: 14px;
}
i {
right: 34px;
}
}
.pageration {
text-align: right;
}
</style>

View File

@ -190,7 +190,7 @@
<span
v-if="item.couponType === 'DISCOUNT'"
class="fontsize_12 global_color"
><span class="price">{{ item.couponDiscount }}</span
><span class="price">{{ item.discount }}</span
></span
>
<span class="describe"

View File

@ -18,14 +18,14 @@ export default {
* @description api请求基础路径
*/
api_dev: {
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn"
common: 'http://192.168.0.101:8890',
buyer: 'http://192.168.0.101:8888',
seller: 'http://192.168.0.101:8889',
manager: 'http://192.168.0.101:8887'
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
seller: "https://store-api.pickmall.cn",
manager: "https://admin-api.pickmall.cn"
// common: 'http://192.168.0.101:8890',
// buyer: 'http://192.168.0.101:8888',
// seller: 'http://192.168.0.101:8889',
// manager: 'http://192.168.0.101:8887'
},
api_prod: {
common: "https://common-api.pickmall.cn",

View File

@ -1,7 +1,7 @@
<template>
<div class="search">
<Card style="height: 60px">
<div style="">
<div>
<Button
v-if="allowOperation.editPrice"
@click="modifyPrice"
@ -30,8 +30,9 @@
</div>
</Card>
<Card style="height: 400px" class="mt_10">
<div style="width: 30%; float: left; margin-left: 20px">
<Card class="mt_10">
<Row>
<Col span="12">
<div class="div-item">
<div class="div-item-left">订单号</div>
<div class="div-item-right">{{ orderInfo.order.sn }}</div>
@ -42,8 +43,6 @@
{{ orderInfo.order.clientType | clientTypeWay }}
</div>
</div>
</div>
<div class="div-item">
<div class="div-item-left">订单状态</div>
<div class="div-item-right">
@ -57,8 +56,6 @@
{{ orderInfo.order.createTime }}
</div>
</div>
<div style="width: 30%; float: left; margin-left: 20px">
<div class="div-item" v-if="orderInfo.order.needReceipt == false">
<div class="div-item-left">发票信息</div>
<div class="div-item-right">暂无发票信息</div>
@ -116,9 +113,8 @@
</div>
</div>
</template>
</div>
<div style="width: 36%; float: left">
</Col>
<Col span="12">
<div class="div-item">
<div class="div-item-left">收货信息</div>
<div class="div-item-right">
@ -150,7 +146,8 @@
}}
</div>
</div>
</div>
</Col>
</Row>
</Card>
<Card class="mt_10">

View File

@ -53,7 +53,6 @@
<script>
import * as API_Order from "@/api/order";
import { verificationCode } from "@/api/order";
import JsonExcel from "vue-json-excel";
import Cookies from "js-cookie";
export default {
@ -186,6 +185,12 @@ export default {
'收货人': 'consigneeName',
'收货人联系电话': 'consigneeMobile',
'收货地址': 'consigneeAddress',
'商品名称': 'goodsName',
'商品价格': 'goodsPrice',
'订单金额': 'flowPrice',
'商品数量': 'num',
'店铺名称': 'storeName',
'创建时间': 'createTime'
}
};
},
@ -275,6 +280,8 @@ export default {
res.result[i].index = i+1;
res.result[i].consigneeAddress =
res.result[i].consigneeAddressPath.replace(/,/g, "") + res.result[i].consigneeDetail
res.result[i].goodsPrice = this.$options.filters.unitPrice(res.result[i].goodsPrice,'¥')
res.result[i].flowPrice = this.$options.filters.unitPrice(res.result[i].flowPrice,'¥')
}
return res.result
} else {

View File

@ -27,12 +27,12 @@
</Row>
<Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table" @on-selection-change="changeSelect">
<template slot-scope="{ row }" slot="action">
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="info" size="small" style="margin-right: 10px" @click="edit(row)"></Button>
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="info" size="small" style="margin-right: 5px" @click="edit(row)"></Button>
<Button v-if="row.promotionStatus !== 'CLOSE'" type="error" size="small" @click="remove(row)"></Button>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
@ -49,7 +49,7 @@ export default {
loading: true, //
searchForm: {
//
pageNumber: 0, //
pageNumber: 1, //
pageSize: 10, //
sort: "startTime", //
order: "desc", //
@ -135,7 +135,7 @@ export default {
title: "活动时间",
render: (h, params) => {
if (params.row.getType === "ACTIVITY") {
if (params.row.rangeDayType !== "FIXEDTIME") {
return h("div", "长期有效");
} else {
return h("div", {
@ -208,7 +208,7 @@ export default {
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
},
changePage(v) {
this.searchForm.pageNumber = v - 1;
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
@ -217,13 +217,13 @@ export default {
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 0;
this.searchForm.pageNumber = 1;
this.getDataList();
},
handleReset() {
this.searchForm = {};
this.selectDate = "";
this.searchForm.pageNumber = 0;
this.searchForm.pageNumber = 1;
this.getDataList();
},
clearSelectAll() {

View File

@ -1,7 +1,7 @@
<template>
<div>
<Card>
<Form ref="form" :model="form" :label-width="120" :rules="formRule" class="search-form">
<Form ref="form" :model="form" :label-width="120" :rules="formRule">
<div class="base-info-item">
<h4>基本信息</h4>
<div class="form-item-view">
@ -389,6 +389,7 @@ export default {
getDetail() {
//
getFullDiscountById(this.id).then((res) => {
console.log(res);
let data = res.result;
if (data.number == -1) {
data.promotionGoodsList = [];
@ -400,7 +401,7 @@ export default {
data.discountType = "isFullMinus";
delete data.isFullMinus;
} else {
data.discountType = "isFullMinus";
data.discountType = "isFullRate";
delete data.isFullRate;
}
data.rangeTime = [];