合并冲突

master
lemon橪 2021-06-21 14:30:06 +08:00
commit 35094a7ac2
10 changed files with 1335 additions and 1395 deletions

View File

@ -61,7 +61,7 @@ export function getCateById (id) {
// 店铺入驻协议
export function agreement () {
return request({
url: `/buyer/article/get/1349291301250293760`,
url: `/buyer/article/type/STORE_REGISTER`,
needToken: true,
method: Method.GET
})

View File

@ -2,26 +2,10 @@
<div class="box">
<div class="nav">
<ul class="location">
<li><router-link to="/" v-if="$route.path !== '/'" class="home-page" ><Icon type="md-home" />首页</router-link></li>
<li>
<Dropdown placement="bottom-start">
<a href="javascript:void(0)">
<Icon type="ios-pin" class="icon"></Icon>
{{ city }}
</a>
<DropdownMenu slot="list">
<div class="city">
<p v-for="(items, index) in cityArr" :key="index">
<span
v-for="(item, index) in items"
class="city-item"
:key="index"
@click="changeCity(item)"
>{{ item }}</span>
</p>
</div>
</DropdownMenu>
</Dropdown>
<router-link to="/" v-if="$route.path !== '/'" class="home-page">
<Icon type="md-home" />首页
</router-link>
</li>
</ul>
<ul class="detail">
@ -50,18 +34,14 @@
</DropdownMenu>
</Dropdown>
</li>
<li @click="goUserCenter('/home/MyOrder')"><span class="nav-item hover-color">我的订单</span></li>
<li @click="goUserCenter('/home/MyTracks')"><span class="nav-item hover-color">我的足迹</span></li>
<li @click="goUserCenter('/home/MsgList')"><span class="nav-item hover-color">我的消息</span></li>
<li class="hover-color" @click="goUserCenter('/home/MyOrder')"><span class="nav-item">我的订单</span></li>
<li class="hover-color" @click="goUserCenter('/home/MyTracks')"><span class="nav-item">我的足迹</span></li>
<li v-if="$route.name !== 'Cart'" style="position:relative;">
<i class="cart-badge" v-show="Number(cartNum)">{{cartNum < 100 ? cartNum : '99'}}</i>
<Dropdown placement="bottom-start">
<router-link to="cart" target="_blank" >
<router-link to="/cart" target="_blank">
<span @mouseenter="getCartList">
<Icon
size="18"
type="ios-cart-outline"
></Icon>
<Icon size="18" class="cart-icon" type="ios-cart-outline"></Icon>
购物车
</span>
@ -74,12 +54,7 @@
<span>赶快去添加商品吧~</span>
</div>
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
<div
class="shopping-cart-box"
v-for="(item, index) in shoppingCart"
@click="goToPay"
:key="index"
>
<div class="shopping-cart-box" v-for="(item, index) in shoppingCart" @click="goToPay" :key="index">
<div class="shopping-cart-img">
<img :src="item.goodsSku.thumbnail" class="hover-pointer" />
</div>
@ -116,35 +91,28 @@
</template>
<script>
import storage from '@/plugins/storage.js';
import {cartGoodsAll} from '@/api/cart.js'
import storage from "@/plugins/storage.js";
import { cartGoodsAll } from "@/api/cart.js";
export default {
name: 'M-Header',
created () {
if (storage.getItem('userInfo')) {
this.userInfo = JSON.parse(storage.getItem('userInfo'));
name: "M-Header",
created() {
if (storage.getItem("userInfo")) {
this.userInfo = JSON.parse(storage.getItem("userInfo"));
}
},
data () {
data() {
return {
//
themeType: 'light',
city: '珠海', //
cityArr: [
['北京', '上海', '天津', '重庆', '广州'],
['深圳', '河南', '辽宁', '吉林', '江苏'],
['江西', '四川', '海南', '贵州', '云南'],
['西藏', '陕西', '甘肃', '青海', '珠海']
],
themeType: "light",
userInfo: {}, //
shoppingCart: [] //
shoppingCart: [], //
};
},
computed: {
cartNum () {
return this.$store.state.cartNum
}
cartNum() {
return this.$store.state.cartNum;
},
},
methods: {
changeCity (city) { //
@ -152,67 +120,69 @@ export default {
},
goToPay () { //
let url = this.$router.resolve({
path: '/cart'
})
window.open(url.href, '_blank')
path: "/cart",
});
window.open(url.href, "_blank");
},
myInfo () { //
myInfo() {
let url = this.$router.resolve({
path: '/home'
})
window.open(url.href, '_blank')
path: "/home",
});
window.open(url.href, "_blank");
},
signOutFun () { // 退
storage.removeItem('accessToken');
storage.removeItem('refreshToken');
storage.removeItem('userInfo');
storage.removeItem('cartNum');
this.$store.commit('SET_CARTNUM', 0)
this.$router.push('/login');
signOutFun() {
storage.removeItem("accessToken");
storage.removeItem("refreshToken");
storage.removeItem("userInfo");
storage.removeItem("cartNum");
this.$store.commit("SET_CARTNUM", 0);
this.$router.push("/login");
},
goUserCenter (path) { //
goUserCenter(path) {
//
if (this.userInfo.username) {
this.$router.push({path: path})
this.$router.push({ path: path });
} else {
this.$Modal.confirm({
title: '请登录',
content: '<p>请登录后执行此操作</p>',
okText: '立即登录',
cancelText: '继续浏览',
title: "请登录",
content: "<p>请登录后执行此操作</p>",
okText: "立即登录",
cancelText: "继续浏览",
onOk: () => {
this.$router.push({
path: '/login',
path: "/login",
query: {
rePath: this.$router.history.current.path,
query: JSON.stringify(this.$router.history.current.query)
}
query: JSON.stringify(this.$router.history.current.query),
},
});
}
},
});
}
},
shopEntry () { //
if (storage.getItem('accessToken')) {
shopEntry() {
//
if (storage.getItem("accessToken")) {
let routeUrl = this.$router.resolve({
path: '/shopEntry',
query: {id: 1}
path: "/shopEntry",
query: { id: 1 },
});
window.open(routeUrl.href, '_blank');
window.open(routeUrl.href, "_blank");
} else {
this.$router.push('login');
this.$router.push("login");
}
},
getCartList () { //
getCartList() {
//
if (this.userInfo.username) {
cartGoodsAll().then(res => {
this.shoppingCart = res.result.skuList
this.$store.commit('SET_CARTNUM', this.shoppingCart.length)
this.Cookies.setItem('cartNum', this.shoppingCart.length)
})
}
}
cartGoodsAll().then((res) => {
this.shoppingCart = res.result.skuList;
this.$store.commit("SET_CARTNUM", this.shoppingCart.length);
this.Cookies.setItem("cartNum", this.shoppingCart.length);
});
}
},
},
};
</script>
@ -253,7 +223,8 @@ export default {
margin-right: 10px;
font-weight: bold;
}
.nav a,.nav-item {
.nav a,
.nav-item {
text-decoration: none;
padding-left: 10px;
border-left: 1px solid #ccc;
@ -396,7 +367,6 @@ export default {
.sign-out p {
font-size: 12px;
}
.goods-title:hover {
color: $theme_color;
}

View File

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

View File

@ -117,7 +117,7 @@
已节省<span>{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span>
</div>
<div class="ml_20 total-price">
总价不含运费:<span>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</span>
总价不含运费:<div>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</div>
</div>
<div class="pay ml_20" @click="pay"></div>
</div>
@ -136,26 +136,26 @@
</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
logoImg: "", // logo
couponAvailable: false, //
stepIndex: 0, // ==0==1==2
goodsTotal: 1, //
@ -165,45 +165,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,49 +216,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) => {
@ -268,13 +269,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 {
@ -285,16 +286,17 @@ export default {
this.getCartList();
},
async receiveShopCoupon (item) { //
let res = await APIMember.receiveCoupon(item.id)
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)
this.$Message.error(res.message);
}
},
async getCartList () {
async getCartList() {
//
this.loading = true;
try {
@ -307,9 +309,9 @@ export default {
this.checkedNum = 0;
let allChecked = true;
for (let k = 0; k < this.cartList.length; k++) {
let shop = this.cartList[k]
let list = await APIMember.couponList({storeId: shop.storeId})
shop.couponList.push(...list.result.records)
let shop = this.cartList[k];
let list = await APIMember.couponList({ storeId: shop.storeId });
shop.couponList.push(...list.result.records);
}
for (let i = 0; i < this.skuList.length; i++) {
if (this.skuList[i].checked) {
@ -318,30 +320,31 @@ export default {
allChecked = false;
}
}
this.$forceUpdate()
this.$forceUpdate();
this.allChecked = allChecked;
}
} catch (error) {
this.loading = false;
}
}
},
mounted () {
},
mounted() {
this.getCartList();
APICart.cartCount().then(res => { //
APICart.cartCount().then((res) => {
//
if (res.success) this.goodsTotal = res.result;
});
if (!this.Cookies.getItem('logo')) {
getLogo().then(res => {
if (!this.Cookies.getItem("logo")) {
getLogo().then((res) => {
if (res.success) {
let logoObj = JSON.parse(res.result.settingValue)
this.Cookies.setItem('logo', logoObj.buyerSideLogo)
let logoObj = JSON.parse(res.result.settingValue);
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
}
})
});
} else {
this.logoImg = this.Cookies.getItem('logo')
}
this.logoImg = this.Cookies.getItem("logo");
}
},
};
</script>
@ -544,7 +547,7 @@ export default {
width: 70px;
height: 70px;
}
>div>p {
> div > p {
@include content_color($light_content_color);
font-size: 13px;
text-align: left;
@ -567,12 +570,12 @@ export default {
}
}
}
.error-goods{
.error-goods {
position: absolute;
width: 100%;
height: 100%;
margin-left: -20px;
background-color: rgba($color: #999, $alpha: .5);
background-color: rgba($color: #999, $alpha: 0.5);
z-index: 10;
display: flex;
align-items: center;
@ -603,7 +606,7 @@ export default {
.save-price span {
color: #000;
}
.total-price span {
.total-price div {
color: $theme_color;
font-size: 20px;
}
@ -651,23 +654,31 @@ export default {
display: flex;
margin-top: 5px;
margin-left: 5px;
>span{
> span {
border: 1px solid $theme_color;
color: $theme_color;
font-size: 12px;
border-radius: 2px;
padding: 0 2px;
}
>p{
> p {
font-size: 12px;
margin-left: 10px;
color: #999;
}
}
.cart-goods-footer > div{
display: flex;
align-items: center;
overflow: hidden;
}
.total-price{
display: flex;
align-items: center;
}
</style>
<style>
.ivu-input-number-input {
.ivu-input-number-input {
text-align: center;
}
}
</style>

View File

@ -24,7 +24,8 @@
<span @click="goAddressManage"></span>
</div>
<div class="address-manage">
<div class="address-item" v-show="moreAddr ? true : index < 3" :class="selectedAddress.id === item.id?'border-red':''" @mouseenter="showEditBtn = index" @mouseleave="showEditBtn = ''" @click="selectAddress(item)" v-for="(item,index) in addressList" :key="index">
<div class="address-item" v-show="moreAddr ? true : index < 3" :class="selectedAddress.id === item.id?'border-red':''" @mouseenter="showEditBtn = index" @mouseleave="showEditBtn = ''"
@click="selectAddress(item)" v-for="(item,index) in addressList" :key="index">
<div>
<span>{{item.name}}</span>
<Tag class="ml_10" v-if="item.isDefault" color="red"></Tag>
@ -92,7 +93,9 @@
<!-- 发票信息 -->
<div class="invoice">
<div class="card-head mt_20 mb_20">
<span class="relative">发票信息<span class="inv-tips"><Icon type="ios-alert-outline" />开企业抬头发票须填写纳税人识别号以免影响报销</span></span>
<span class="relative">发票信息<span class="inv-tips">
<Icon type="ios-alert-outline" />开企业抬头发票须填写纳税人识别号以免影响报销
</span></span>
</div>
<div class="inovice-content">
<span>{{invoiceData.receiptTitle}}</span>
@ -135,7 +138,8 @@
</div>
<div>
<div>
<span>使用积分</span><Input type="text" style="width:100px;" v-model.number="otherMsgForm.point" placeholder="请输入使用积分" /> <span style="color:#999;">您当前的可用积分为 {{otherMsgForm.totalPoint}} 本订单最多可以使用{{otherMsgForm.availablePoint}}</span>
<span>使用积分</span><Input type="text" style="width:100px;" v-model.number="otherMsgForm.point" placeholder="请输入使用积分" /> <span style="color:#999;">您当前的可用积分为 {{otherMsgForm.totalPoint}}
本订单最多可以使用{{otherMsgForm.availablePoint}}</span>
</div>
</div>
</div>
@ -159,45 +163,56 @@
<!-- 底部支付栏 -->
<div class="order-footer width_1200">
<div class="pay ml_20" @click="pay"></div>
<div class="pay-address" v-if="addressList.length">{{ selectedAddress.consigneeAddressPath | unitAddress }} {{selectedAddress.detail}}&nbsp;&nbsp;{{selectedAddress.name}}&nbsp;&nbsp;{{selectedAddress.mobile}}</div>
<div class="pay-address" v-if="addressList.length">{{ selectedAddress.consigneeAddressPath | unitAddress }}
{{selectedAddress.detail}}&nbsp;&nbsp;收货人{{selectedAddress.name}}&nbsp;&nbsp;{{selectedAddress.mobile}}</div>
</div>
<BaseFooter></BaseFooter>
<!-- 添加发票模态框 -->
<invoice-modal ref="invModal" @change="getInvMsg" />
<invoice-modal ref="invModal" :invoiceData="invoiceData" @change="getInvMsg" />
<!-- 选择地址模态框 -->
<address-manage ref="address" :id="addrId" @change="addrChange"></address-manage>
</div>
</template>
<script>
import invoiceModal from '@/components/invoiceModal';
import addressManage from '@/components/addressManage';
import {memberAddress, delMemberAddress} from '@/api/address';
import {cartGoodsPay, createTrade, selectAddr, shippingMethod, receiptSelect, selectCoupon, couponNum} from '@/api/cart';
import { canUseCouponList } from '@/api/member.js';
import {getLogo} from '@/api/common.js'
import invoiceModal from "@/components/invoiceModal";
import addressManage from "@/components/addressManage";
import { memberAddress, delMemberAddress } from "@/api/address";
import {
cartGoodsPay,
createTrade,
selectAddr,
shippingMethod,
selectCoupon,
couponNum,
} from "@/api/cart";
import { canUseCouponList } from "@/api/member.js";
import { getLogo } from "@/api/common.js";
export default {
name: 'Pay',
name: "Pay",
components: { invoiceModal, addressManage },
data () {
data() {
return {
stepIndex: 1, //
invoiceAvailable: false, //
showEditBtn: '', //
orderMark: '', //
invoiceData: { //
receiptTitle: '个人',
receiptContent: '不开发票'
showEditBtn: "", //
orderMark: "", //
invoiceData: {
//
receiptTitle: "个人",
receiptContent: "不开发票",
},
otherMsgForm: { //
otherMsgForm: {
//
point: 0,
availablePoint: 10,
totalPoint: 100,
noGoods: 0
noGoods: 0,
},
deliveryList: [ //
deliveryList: [
//
// {value: 'SELF_PICK_UP', label: ''},
{value: 'LOGISTICS', label: '物流'}
{ value: "LOGISTICS", label: "物流" },
// {value: 'LOCAL_TOWN_DELIVERY', label: ''}
],
addressList: [], //
@ -205,257 +220,277 @@ export default {
goodsList: [], //
priceDetailDTO: {}, //
totalNum: 0, //
addrId: '', // id
addrId: "", // id
moreAddr: false, //
canUseCouponNum: 0, //
couponList: [], //
logoImg: '', // logo
logoImg: "", // logo
usedCouponId: [], // 使id
selectedCoupon: {} //
selectedCoupon: {}, //
};
},
mounted () {
mounted() {
this.init();
if (!this.Cookies.getItem('logo')) {
getLogo().then(res => {
if (!this.Cookies.getItem("logo")) {
getLogo().then((res) => {
if (res.success) {
let logoObj = JSON.parse(res.result.settingValue)
this.Cookies.setItem('logo', logoObj.buyerSideLogo)
let logoObj = JSON.parse(res.result.settingValue);
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
}
})
});
} else {
this.logoImg = this.Cookies.getItem('logo')
this.logoImg = this.Cookies.getItem("logo");
}
},
methods: {
init () {
init() {
this.getGoodsDetail();
},
goAddressManage () { //
this.$router.push('/home/MyAddress');
goAddressManage() {
//
this.$router.push("/home/MyAddress");
},
getAddress () { //
memberAddress().then(res => {
getAddress() {
//
memberAddress().then((res) => {
if (res.success) {
this.addressList = res.result.records;
this.addressList.forEach((e, index) => {
if (e.id === this.selectedAddress.id && index > 2) {
this.moreAddr = true
this.moreAddr = true;
}
});
}
});
},
getGoodsDetail () { //
getGoodsDetail() {
//
this.$Spin.show();
cartGoodsPay({way: this.$route.query.way}).then(res => {
cartGoodsPay({ way: this.$route.query.way })
.then((res) => {
this.$Spin.hide();
if (res.success) {
this.goodsList = res.result.cartList;
this.priceDetailDTO = res.result.priceDetailDTO;
this.skuList = res.result.skuList;
res.result.receiptVO
? (this.invoiceData = res.result.receiptVO)
: "";
let notSupArea = res.result.notSupportFreight;
this.selectedCoupon = {}
if (res.result.platformCoupon) this.selectedCoupon.platformCoupon = res.result.platformCoupon
Object.assign(this.selectedCoupon, res.result.storeCoupons)
this.selectedCoupon = {};
if (res.result.platformCoupon)
this.selectedCoupon.platformCoupon = res.result.platformCoupon;
Object.assign(this.selectedCoupon, res.result.storeCoupons);
if (notSupArea) {
let content = [];
let title = ''
notSupArea.forEach(e => {
title = e.errorMessage
content.push(e.goodsSku.goodsName)
})
let title = "";
notSupArea.forEach((e) => {
title = e.errorMessage;
content.push(e.goodsSku.goodsName);
});
this.$Modal.warning({
title: '以下商品超出配送区域' || title,
content: content.toString()
})
title: "以下商品超出配送区域" || title,
content: content.toString(),
});
}
if (res.result.memberAddress) {
this.selectedAddress = res.result.memberAddress
this.selectedAddress = res.result.memberAddress;
}
this.getAddress()
this.getAddress();
this.totalNum = 0;
for (let i = 0; i < this.skuList.length; i++) {
this.totalNum += this.skuList[i].num;
}
this.getCouponNum()
this.getCouponNum();
}
}).catch(() => { this.$Spin.hide() });
})
.catch(() => {
this.$Spin.hide();
});
},
getCouponNum () { //
couponNum({way: this.$route.query.way}).then(res => {
this.canUseCouponNum = res.result
getCouponNum() {
//
couponNum({ way: this.$route.query.way }).then((res) => {
this.canUseCouponNum = res.result;
if (res.result) {
let storeArr = []
let skuArr = []
this.goodsList.forEach(e => {
storeArr.push(e.storeId)
e.skuList.forEach(i => {
skuArr.push(i.goodsSku.id)
})
})
let storeArr = [];
let skuArr = [];
this.goodsList.forEach((e) => {
storeArr.push(e.storeId);
e.skuList.forEach((i) => {
skuArr.push(i.goodsSku.id);
});
});
let params = {
pageNumber: 1,
pageSize: 100,
memberCouponStatus: 'NEW',
memberCouponStatus: "NEW",
scopeId: skuArr.toString(),
storeId: storeArr.toString(),
totalPrice: this.priceDetailDTO.goodsPrice
}
canUseCouponList(params).then(res => { //
if (res.success) this.couponList = res.result.records
const couponKeys = Object.keys(this.selectedCoupon)
this.usedCouponId = []
totalPrice: this.priceDetailDTO.goodsPrice,
};
canUseCouponList(params).then((res) => {
//
if (res.success) this.couponList = res.result.records;
const couponKeys = Object.keys(this.selectedCoupon);
this.usedCouponId = [];
if (couponKeys.length) {
this.couponList.forEach(e => {
this.couponList.forEach((e) => {
if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) {
this.usedCouponId.push(e.id)
this.usedCouponId.push(e.id);
}
})
});
this.$nextTick(() => {
this.$forceUpdate()
})
this.$forceUpdate();
});
}
})
});
}
})
});
},
selectAddress (item) { //
selectAddress(item) {
//
let params = {
way: this.$route.query.way,
shippingAddressId: item.id
shippingAddressId: item.id,
};
selectAddr(params).then(res => {
selectAddr(params).then((res) => {
if (res.success) {
this.$Message.success('选择收货地址成功');
this.$Message.success("选择收货地址成功");
this.selectedAddress = item;
this.getGoodsDetail();
}
});
},
editAddress (id) { //
editAddress(id) {
//
this.addrId = id;
this.$refs.address.show();
},
addrChange (item) { //
addrChange(item) {
//
this.getAddress();
},
delAddress (item) {
delAddress(item) {
//
this.$Modal.confirm({
title: '提示',
content: '你确定删除这个收货地址',
title: "提示",
content: "你确定删除这个收货地址",
onOk: () => {
delMemberAddress(item.id).then((res) => {
if (res.success) {
this.$Message.success('删除成功');
this.$Message.success("删除成功");
this.getAddress();
}
});
},
onCancel: () => {}
onCancel: () => {},
});
},
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: id}
path: "/Merchant",
query: { id: id },
});
window.open(routeUrl.href, '_blank');
window.open(routeUrl.href, "_blank");
},
selectDelivery (delivery) { //
selectDelivery(delivery) {
//
let params = {
way: this.$route.query.way,
shippingMethod: delivery.value
shippingMethod: delivery.value,
};
shippingMethod(params).then(res => {
});
shippingMethod(params).then((res) => {});
},
useCoupon (id, used) { // 使
useCoupon(id, used) {
// 使
let params = {
way: this.$route.query.way,
memberCouponId: id,
used: used // true 使 false
}
selectCoupon(params).then(res => {
if (res.success) this.init()
})
used: used, // true 使 false
};
selectCoupon(params).then((res) => {
if (res.success) this.init();
});
},
editInvoice () { //
editInvoice() {
//
this.$refs.invModal.invoiceAvailable = true;
},
getInvMsg (item) { //
console.log(item);
this.invoiceData = item;
this.selectReceipt(item.id)
},
selectReceipt (id) { //
let params = {
way: this.$route.query.way,
receiptId: id
getInvMsg(item) {
//
if (item) {
this.init();
this.$refs.invModal.invoiceAvailable = false;
}
receiptSelect(params).then(res => {
})
},
pay () { //
pay() {
//
const params = {
client: 'PC',
client: "PC",
remark: [],
way: this.$route.query.way
way: this.$route.query.way,
};
this.goodsList.forEach(e => {
this.goodsList.forEach((e) => {
if (e.remark) {
params.remark.push({
remark: e.remark,
storeId: e.storeId
})
storeId: e.storeId,
});
}
})
});
if (!params.remark.length) delete params.remark;
this.$Spin.show();
createTrade(params).then(res => {
createTrade(params)
.then((res) => {
this.$Spin.hide();
if (res.success) {
this.$router.push({path: '/payment', query: {orderType: 'TRADE', sn: res.result.sn}});
this.$router.push({
path: "/payment",
query: { orderType: "TRADE", sn: res.result.sn },
});
}
}).catch(() => {
this.$Spin.hide()
})
.catch(() => {
this.$Spin.hide();
});
},
useScope (type) {
let goods = '全部商品'
useScope(type) {
let goods = "全部商品";
switch (type) {
case 'ALL':
goods = '全部商品'
case "ALL":
goods = "全部商品";
break;
case 'PORTION_GOODS':
goods = '部分商品'
case "PORTION_GOODS":
goods = "部分商品";
break;
case 'PORTION_GOODS_CATEGORY':
goods = '部分分类商品'
case "PORTION_GOODS_CATEGORY":
goods = "部分分类商品";
break;
}
return `${goods}可用`
}
}
return `${goods}可用`;
},
},
};
</script>
<style scoped lang="scss">
@import '../../assets/styles/coupon.scss';
@import "../../assets/styles/coupon.scss";
/** logo start */
.logo {
height: 40px;
@ -463,31 +498,31 @@ export default {
justify-content: space-between;
align-items: center;
margin: 20px auto 0;
div:nth-child(1){
div:nth-child(1) {
display: flex;
justify-content: space-between;
align-items: center;
img{
img {
width: 150px;
height:auto;
height: auto;
cursor: pointer;
}
div:nth-child(2){
div:nth-child(2) {
width: 200px;
color: #999;
font-size: 16px;
margin: 0 20px;
span{
span {
color: $theme_color;
}
}
}
}
.cart-steps{
.cart-steps {
height: 30px;
display: flex;
align-items: center;
span{
span {
@include content_color($light_content_color);
height: 30px;
text-align: center;
@ -496,19 +531,19 @@ export default {
padding: 0 15px;
}
.ivu-icon{
.ivu-icon {
@include content_color($light_content_color);
font-size: 20px;
margin:0 15px;
margin: 0 15px;
}
.active{
.active {
border-radius: 50px;
background-color:#ff8f23;
background-color: #ff8f23;
color: #fff;
}
.active-arrow{
.active-arrow {
color: #ff8f23;
}
}
@ -521,60 +556,60 @@ export default {
padding: 15px 25px;
}
/** 地址管理 */
.address-manage{
.address-manage {
display: flex;
flex-wrap: wrap;
>div {
border:1px dotted #949494;
> div {
border: 1px dotted #949494;
width: 265px;
height: 120px;
margin:20px 20px 0 0;
margin: 20px 20px 0 0;
padding: 10px;
cursor: pointer;
color: #999;
}
.add-address{
.add-address {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.ivu-icon{
.ivu-icon {
font-size: 24px;
}
}
.address-item{
.address-item {
position: relative;
font-size: 12px;
>div:nth-child(1){
> div:nth-child(1) {
margin-bottom: 10px;
span{
span {
margin-right: 10px;
}
>span:nth-child(1){
> span:nth-child(1) {
color: #000000;
font-size: 14px;
}
}
.edit-btn{
.edit-btn {
font-size: 12px;
position: absolute;
top: 15px;
right: 20px;
color: $theme_color;
span:hover{
span:hover {
border-bottom: 1px solid $theme_color;
}
}
.corner-icon{
.corner-icon {
position: absolute;
right: -1px;
bottom: -1px;
div{
div {
width: 0;
border-top: 20px solid transparent;
border-right: 20px solid $theme_color;
}
.ivu-icon{
.ivu-icon {
font-size: 12px;
position: absolute;
bottom: 0;
@ -584,28 +619,30 @@ export default {
}
}
}
.border-red{
.border-red {
border-color: $theme_color;
}
}
/** 购买商品列表 start */
.shop-name{
.shop-name {
display: flex;
justify-content: space-between;
>span:nth-child(1){
> span:nth-child(1) {
font-weight: bold;
.ivu-icon{
.ivu-icon {
color: #ff8f23;
&:hover {color: $theme_color;}
&:hover {
color: $theme_color;
}
}
>span:nth-child(2){
}
> span:nth-child(2) {
color: #999;
position: relative;
display: flex;
width: 200px;
}
.delivery-list{
.delivery-list {
position: absolute;
right: 0;
top: 20px;
@ -616,106 +653,110 @@ export default {
width: 200px;
min-height: 100px;
padding: 10px;
li{
li {
width: 90px;
height: 30px;
text-align: center;
&:hover{
&:hover {
cursor: pointer;
}
}
}
}
.goods-list{
.goods-list {
background-color: #f8f8f8;
margin: 10px 0 20px 0;
.goods-item{
.goods-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 0;
margin: 0 20px;
border-bottom: 1px dotted #999;
&:last-child{border:none;}
img{
&:last-child {
border: none;
}
img {
width: 48px;
height: 48px;
}
>span{
> span {
text-align: center;
width: 100px;
}
>span:nth-child(1) {
> span:nth-child(1) {
font-size: 12px;
flex: 1;
text-align: left;
}
>span:last-child{
> span:last-child {
color: $theme_color;
font-weight: bold;
}
.goods-price{
.goods-price {
font-size: 16px;
}
}
}
.order-mark{
.order-mark {
width: 500px;
}
/** 购买商品列表 end */
/** 发票信息 start */
.invoice{
.inv-tips{
.invoice {
.inv-tips {
position: absolute;
border: 1px solid #ddd;
width: 310px;
padding: 3px;
margin: 0 0 0 10px;
font-size: 12px!important;
box-shadow: 0 0 3px rgba(0,0,0,.15);
&::before{
content: '';
font-size: 12px !important;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
&::before {
content: "";
display: inline-block;
width: 12px;
height: 17px;
background:url(../../assets/images/arrow-left.png) 0 0 no-repeat;
background-color:#fff;
background: url(../../assets/images/arrow-left.png) 0 0 no-repeat;
background-color: #fff;
position: absolute;
left: -9px;
}
.ivu-icon{
.ivu-icon {
color: #ff8f23;
margin-right: 3px;
font-size: 16px;
font-weight: bold;
}
}
.inovice-content{
>span {
.inovice-content {
> span {
margin-right: 10px;
}
>span:last-child{
> span:last-child {
color: $theme_color;
cursor: pointer;
&:hover{border-bottom: 1px solid $theme_color;}
&:hover {
border-bottom: 1px solid $theme_color;
}
}
}
}
/** 发票信息 end */
/** 订单价格 */
.order-price{
.order-price {
text-align: right;
margin-top: 30px;
font-size: 16px;
color: #999;
>div>span:nth-child(2){
> div > span:nth-child(2) {
width: 130px;
text-align: right;
display: inline-block;
margin-top: 10px;
}
.actrual-price{
.actrual-price {
color: $theme_color;
font-weight: bold;
font-size: 20px;
@ -732,7 +773,7 @@ export default {
flex-direction: row-reverse;
border-top: 1px solid #ddd;
margin: 10px auto;
div{
div {
text-align: center;
}
position: sticky;
@ -746,7 +787,7 @@ export default {
line-height: 50px;
cursor: pointer;
}
}
}
/** 公共表头 */
.card-head {
display: flex;
@ -755,14 +796,14 @@ export default {
border-bottom: 1px solid #dddddd;
height: 40px;
span:nth-child(1){
span:nth-child(1) {
font-size: 18px;
}
span:nth-child(2){
span:nth-child(2) {
font-size: 12px;
color: #438cde;
cursor: pointer;
&:hover{
&:hover {
color: $theme_color;
}
}
@ -771,8 +812,10 @@ export default {
background: $theme_color;
height: 2px;
}
.pay-address{font-size: 12px;}
.more-addr{
.pay-address {
font-size: 12px;
}
.more-addr {
cursor: pointer;
margin-top: 10px;
display: inline-block;
@ -782,15 +825,16 @@ export default {
height: 125px;
margin-right: 10px;
margin-bottom: 10px;
.c-right{
.c-right {
width: 30px;
padding: 10px 7px;
}
b{
background: url('../../assets/images/small-circle.png') top left repeat-y;
b {
background: url("../../assets/images/small-circle.png") top left repeat-y;
right: 28px;
}
.circle-top,.circle-bottom{
.circle-top,
.circle-bottom {
right: 22px;
}
.used {

View File

@ -9,23 +9,11 @@
<Step title="其他信息"></Step>
<Step title="提交审核"></Step>
</Steps>
<first-apply
v-if="currentIndex == 0 && dataReview"
:content="firstData"
@change="nextPage"
></first-apply>
<first-apply v-if="currentIndex == 0 && dataReview" :content="firstData" @change="nextPage"></first-apply>
<second-apply
v-if="currentIndex == 1 && dataReview"
:content="secondData"
@change="nextPage"
></second-apply>
<second-apply v-if="currentIndex == 1 && dataReview" :content="secondData" @change="nextPage"></second-apply>
<third-apply
v-if="currentIndex == 2 && dataReview"
:content="thirdData"
@change="nextPage"
></third-apply>
<third-apply v-if="currentIndex == 2 && dataReview" :content="thirdData" @change="nextPage"></third-apply>
<div class="success-page" v-if="currentIndex == 3">
<span v-if="storeDisable == '' || storeDisable == 'APPLYING'"></span>
@ -37,62 +25,51 @@
<Button type="primary" @click='currentIndex = 0' v-if="storeDisable === 'REFUSED' && currentIndex === 3"></Button>
</div>
<Modal
title="店铺入驻协议"
v-model="showAgreement"
width="1200"
:closable="false"
:mask-closable="false"
>
<Modal title="店铺入驻协议" v-model="showAgreement" width="1200" :closable="false" :mask-closable="false">
<div class="agreeent-con" v-html="agreementCon"></div>
<div slot="footer" style="text-align: center">
<p><Checkbox v-model="checked"></Checkbox></p>
<Button
type="primary"
:disabled="!checked"
class="margin"
@click="showAgreement = false"
>同意协议填写资质信息</Button
>
<p>
<Checkbox v-model="checked"></Checkbox>
</p>
<Button type="primary" :disabled="!checked" class="margin" @click="showAgreement = false">同意协议填写资质信息</Button>
</div>
</Modal>
</div>
</template>
<script>
import { agreement, applyStatus } from '@/api/shopentry';
import firstApply from './first-apply';
import secondApply from './second-apply';
import thirdApply from './third-apply';
import { agreement, applyStatus } from "@/api/shopentry";
import firstApply from "./first-apply";
import secondApply from "./second-apply";
import thirdApply from "./third-apply";
export default {
components: {
firstApply,
secondApply,
thirdApply
thirdApply,
},
data () {
data() {
return {
currentIndex: 0, //
showAgreement: false, //
agreementCon: '', //
agreementCon: "", //
checked: false, //
applyData: {}, //
firstData: {}, //
secondData: {}, //
thirdData: {}, //
storeDisable: '', // APPLY OPEN CLOSED REFUSED APPLYING
dataReview: true //
storeDisable: "", // APPLY OPEN CLOSED REFUSED APPLYING
dataReview: true, //
};
},
methods: {
getArticle () {
getArticle() {
//
agreement().then((res) => {
console.log(res);
this.agreementCon = res.result;
this.agreementCon = res.result.content;
});
},
getData () {
getData() {
applyStatus().then((res) => {
if (res.success) {
if (!res.result) {
@ -101,34 +78,34 @@ export default {
this.dataReview = false;
let data = res.result;
let first = [
'addressIdPath',
'addressPath',
'companyAddress',
'companyEmail',
'companyName',
'employeeNum',
'legalId',
'legalName',
'licencePhoto',
'legalPhoto',
'licenseNum',
'linkName',
'linkPhone',
'registeredCapital',
'scope'
"addressIdPath",
"addressPath",
"companyAddress",
"companyEmail",
"companyName",
"employeeNum",
"legalId",
"legalName",
"licencePhoto",
"legalPhoto",
"licenseNum",
"linkName",
"linkPhone",
"registeredCapital",
"scope",
];
let second = [
'settlementBankAccountName',
'settlementBankAccountNum',
'settlementBankBranchName',
'settlementBankJointName'
"settlementBankAccountName",
"settlementBankAccountNum",
"settlementBankBranchName",
"settlementBankJointName",
];
let third = [
'goodsManagementCategory',
'storeCenter',
'storeDesc',
'storeLogo',
'storeName'
"goodsManagementCategory",
"storeCenter",
"storeDesc",
"storeLogo",
"storeName",
];
this.storeDisable = data.storeDisable;
@ -143,7 +120,7 @@ export default {
this.thirdData[e] = data[e];
});
if (this.storeDisable === 'APPLY') {
if (this.storeDisable === "APPLY") {
this.currentIndex = 0;
} else {
this.currentIndex = 3;
@ -154,13 +131,14 @@ export default {
}
});
},
nextPage (step) {
nextPage(step) {
this.currentIndex = step;
}
},
mounted () {
},
mounted() {
this.getData();
}
this.getArticle();
},
};
</script>
<style lang="scss" scoped>

View File

@ -5,6 +5,13 @@ import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios'
export const getManagerBrandPage = (params) => {
return getRequest('/goods/brand/getByPage', params)
}
// 批量删除
export const delBrand = (ids) =>{
return deleteRequest(`/goods/brand/delByIds/${ids}`)
}
// 添加
export const addBrand = (params) => {
return postRequest('/goods/brand', params)

View File

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

View File

@ -1,25 +1,13 @@
<style lang="scss">
@import "@/styles/table-common.scss";
@import "@/styles/table-common.scss";
</style>
<template>
<div class="search">
<Card>
<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="name">
<Input
type="text"
v-model="searchForm.name"
placeholder="请输入品牌名称"
clearable
style="width: 200px"
/>
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" />
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
@ -28,64 +16,41 @@
<Row class="operation padding-row">
<Button @click="add" type="primary">添加</Button>
</Row>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
></Table>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
</Card>
<Modal
:title="modalTitle"
v-model="modalVisible"
:mask-closable="false"
:width="500"
>
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<FormItem label="品牌名称" prop="name">
<Input v-model="form.name" clearable style="width: 100%"/>
<Input v-model="form.name" clearable style="width: 100%" />
</FormItem>
<FormItem label="品牌图标" prop="logo">
<upload-pic-input
v-model="form.logo"
style="width: 100%"
></upload-pic-input>
<upload-pic-input v-model="form.logo" style="width: 100%"></upload-pic-input>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
>提交
</Button
>
<Button type="primary" :loading="submitLoading" @click="handleSubmit">
</Button>
</div>
</Modal>
</div>
</template>
<script>
import {getManagerBrandPage, addBrand,updateBrand, disableBrand} from "@/api/goods";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import {
getManagerBrandPage,
addBrand,
updateBrand,
disableBrand,
delBrand,
} from "@/api/goods";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
export default {
export default {
name: "brand",
components: {
uploadPicInput,
@ -253,6 +218,24 @@
"编辑"
),
enableOrDisable,
h(
"Button",
{
props: {
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.delBrand(params.row.id);
},
},
},
"删除"
),
]);
},
},
@ -262,6 +245,16 @@
};
},
methods: {
//
async delBrand(id) {
let res = await delBrand(id);
if (res.success) {
this.$Message.success("品牌删除成功!");
this.getDataList();
}
},
init() {
this.getDataList();
},
@ -300,7 +293,7 @@
getManagerBrandPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
console.warn(12)
console.warn(12);
this.data = res.result.records;
this.total = res.result.total;
}
@ -363,7 +356,7 @@
content: "您确认要启用品牌 " + v.name + " ?",
loading: true,
onOk: () => {
disableBrand(v.id, {disable: false}).then((res) => {
disableBrand(v.id, { disable: false }).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
@ -379,7 +372,7 @@
content: "您确认要禁用品牌 " + v.name + " ?",
loading: true,
onOk: () => {
disableBrand(v.id, {disable: true}).then((res) => {
disableBrand(v.id, { disable: true }).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
@ -393,5 +386,5 @@
mounted() {
this.init();
},
};
};
</script>

View File

@ -106,7 +106,7 @@
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
<Form ref="specForm" :model="specForm" :label-width="100">
<Select v-model="specForm.category_specs" multiple>
<Select v-model="specForm.categorySpecs" multiple>
<Option v-for="item in specifications" :value="item.id" :key="item.id" :label="item.specName">
</Option>
</Select>
@ -134,7 +134,6 @@ import {
} from "@/api/goods";
import TreeTable from "@/views/my-components/tree-table/Table/Table";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import * as filters from "@/utils/filters";
export default {
name: "lili-components",
@ -153,7 +152,7 @@ export default {
specifications: [], //
categoryId: "", // id
category_brands: [], //
category_specs: [], //
categorySpecs: [], //
expandLevel: 1, //
modalType: 0, //
modalVisible: false, //
@ -212,13 +211,17 @@ export default {
},
],
tableData: [],
categoryIndex: 0,
};
},
methods: {
changeSortCate(val) {
let way = this.categoryList.find((item) => {
let way = this.categoryList.find((item, index) => {
if (item.name == val) {
this.categoryIndex = index;
console.log((this.categoryIndex = index));
return item.name == val;
}
});
this.tableData = [way];
},
@ -236,7 +239,8 @@ export default {
//
getSpecList() {
getSpecificationList().then((res) => {
if (res.success) {
if (res.length != 0) {
this.specifications = res;
}
});
@ -244,7 +248,7 @@ export default {
//
brandOperation(v) {
getCategoryBrandListData(v.id).then((res) => {
console.warn(res)
console.warn(res);
this.categoryId = v.id;
this.modalBrandTitle = "品牌关联";
this.brandForm.categoryBrands = res.result.map((item) => item.id);
@ -257,7 +261,8 @@ export default {
getCategorySpecListData(v.id).then((res) => {
this.categoryId = v.id;
this.modalSpecTitle = "规格关联";
this.specForm.category_specs = res.map((item) => item.id);
console.log(res);
this.specForm.categorySpecs = res.map((item) => item.id);
this.modalSpecVisible = true;
});
},
@ -337,7 +342,7 @@ export default {
this.submitLoading = false;
if (res.success) {
this.$Message.success("添加成功");
this.getAllList(0);
this.getAllList(this.categoryIndex);
this.modalVisible = false;
this.$refs.form.resetFields();
}
@ -348,7 +353,7 @@ export default {
this.submitLoading = false;
if (res.success) {
this.$Message.success("修改成功");
this.getAllList(0);
this.getAllList(this.categoryIndex);
this.modalVisible = false;
this.$refs.form.resetFields();
}
@ -376,13 +381,11 @@ export default {
});
},
getAllList(parent_id) {
this.sortCateList = []
this.sortCateList = [];
this.loading = true;
getCategoryTree(parent_id).then((res) => {
this.loading = false;
if (res.success) {
//
let expandLevel = this.expandLevel;
localStorage.setItem("category", JSON.stringify(res.result));
res.result.forEach((e, index, arr) => {
this.sortCateList.push({
@ -390,65 +393,13 @@ export default {
value: e.name,
});
this.sortCate = arr[0].name;
if (expandLevel == 1) {
if (e.level == 0) {
e.expand = false;
}
if (e.children && e.children.length > 0) {
e.children.forEach(function (c) {
if (c.level == 1) {
c.expand = false;
}
if (c.children && c.children.length > 0) {
c.children.forEach(function (b) {
if (b.level == 2) {
b.expand = false;
}
});
}
});
}
} else if (expandLevel == 2) {
if (e.level == 0) {
e.expand = true;
}
if (e.children && e.children.length > 0) {
e.children.forEach(function (c) {
if (c.level == 1) {
c.expand = false;
}
if (c.children && c.children.length > 0) {
c.children.forEach(function (b) {
if (b.level == 2) {
b.expand = false;
}
});
}
});
}
} else if (expandLevel == 3) {
if (e.level == 0) {
e.expand = true;
}
if (e.children && e.children.length > 0) {
e.children.forEach(function (c) {
if (c.level == 1) {
c.expand = true;
}
if (c.children && c.children.length > 0) {
c.children.forEach(function (b) {
if (b.level == 2) {
b.expand = false;
}
});
}
});
}
}
});
this.categoryList = res.result;
this.tableData = [res.result[0]];
this.$nextTick(() => {
this.$set(this, "tableData", [res.result[this.categoryIndex]]);
});
}
});
},
@ -508,22 +459,8 @@ export default {
background: #fff;
padding: 20px;
}
.article {
font-size: 16px;
font-weight: 400;
margin: 12px 0;
}
.href-text {
font-size: 12px;
}
.operation {
margin-bottom: 2vh;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
</style>