合并冲突
commit
35094a7ac2
|
@ -61,7 +61,7 @@ export function getCateById (id) {
|
||||||
// 店铺入驻协议
|
// 店铺入驻协议
|
||||||
export function agreement () {
|
export function agreement () {
|
||||||
return request({
|
return request({
|
||||||
url: `/buyer/article/get/1349291301250293760`,
|
url: `/buyer/article/type/STORE_REGISTER`,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
method: Method.GET
|
method: Method.GET
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,26 +2,10 @@
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<ul class="location">
|
<ul class="location">
|
||||||
<li><router-link to="/" v-if="$route.path !== '/'" class="home-page" ><Icon type="md-home" />首页</router-link></li>
|
|
||||||
<li>
|
<li>
|
||||||
<Dropdown placement="bottom-start">
|
<router-link to="/" v-if="$route.path !== '/'" class="home-page">
|
||||||
<a href="javascript:void(0)">
|
<Icon type="md-home" />首页
|
||||||
<Icon type="ios-pin" class="icon"></Icon>
|
</router-link>
|
||||||
{{ 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>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="detail">
|
<ul class="detail">
|
||||||
|
@ -50,18 +34,14 @@
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</li>
|
</li>
|
||||||
<li @click="goUserCenter('/home/MyOrder')"><span class="nav-item hover-color">我的订单</span></li>
|
<li class="hover-color" @click="goUserCenter('/home/MyOrder')"><span class="nav-item">我的订单</span></li>
|
||||||
<li @click="goUserCenter('/home/MyTracks')"><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/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
|
<Icon size="18" class="cart-icon" type="ios-cart-outline"></Icon>
|
||||||
size="18"
|
|
||||||
type="ios-cart-outline"
|
|
||||||
></Icon>
|
|
||||||
购物车
|
购物车
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
@ -74,12 +54,7 @@
|
||||||
<span>赶快去添加商品吧~</span>
|
<span>赶快去添加商品吧~</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
|
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
|
||||||
<div
|
<div class="shopping-cart-box" v-for="(item, index) in shoppingCart" @click="goToPay" :key="index">
|
||||||
class="shopping-cart-box"
|
|
||||||
v-for="(item, index) in shoppingCart"
|
|
||||||
@click="goToPay"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<div class="shopping-cart-img">
|
<div class="shopping-cart-img">
|
||||||
<img :src="item.goodsSku.thumbnail" class="hover-pointer" />
|
<img :src="item.goodsSku.thumbnail" class="hover-pointer" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -116,35 +91,28 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import storage from '@/plugins/storage.js';
|
import storage from "@/plugins/storage.js";
|
||||||
import {cartGoodsAll} from '@/api/cart.js'
|
import { cartGoodsAll } from "@/api/cart.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'M-Header',
|
name: "M-Header",
|
||||||
created () {
|
created() {
|
||||||
if (storage.getItem('userInfo')) {
|
if (storage.getItem("userInfo")) {
|
||||||
this.userInfo = JSON.parse(storage.getItem('userInfo'));
|
this.userInfo = JSON.parse(storage.getItem("userInfo"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 主题颜色切换
|
// 主题颜色切换
|
||||||
themeType: 'light',
|
themeType: "light",
|
||||||
city: '珠海', // 展示城市
|
|
||||||
cityArr: [
|
|
||||||
['北京', '上海', '天津', '重庆', '广州'],
|
|
||||||
['深圳', '河南', '辽宁', '吉林', '江苏'],
|
|
||||||
['江西', '四川', '海南', '贵州', '云南'],
|
|
||||||
['西藏', '陕西', '甘肃', '青海', '珠海']
|
|
||||||
],
|
|
||||||
userInfo: {}, // 用户信息
|
userInfo: {}, // 用户信息
|
||||||
shoppingCart: [] // 购物车
|
shoppingCart: [], // 购物车
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
cartNum () {
|
cartNum() {
|
||||||
return this.$store.state.cartNum
|
return this.$store.state.cartNum;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeCity (city) { // 选择所在城市
|
changeCity (city) { // 选择所在城市
|
||||||
|
@ -152,67 +120,69 @@ export default {
|
||||||
},
|
},
|
||||||
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) {
|
||||||
|
// 跳转我的订单,我的足迹
|
||||||
if (this.userInfo.username) {
|
if (this.userInfo.username) {
|
||||||
this.$router.push({path: path})
|
this.$router.push({ path: path });
|
||||||
} else {
|
} else {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '请登录',
|
title: "请登录",
|
||||||
content: '<p>请登录后执行此操作</p>',
|
content: "<p>请登录后执行此操作</p>",
|
||||||
okText: '立即登录',
|
okText: "立即登录",
|
||||||
cancelText: '继续浏览',
|
cancelText: "继续浏览",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/login',
|
path: "/login",
|
||||||
query: {
|
query: {
|
||||||
rePath: this.$router.history.current.path,
|
rePath: this.$router.history.current.path,
|
||||||
query: JSON.stringify(this.$router.history.current.query)
|
query: JSON.stringify(this.$router.history.current.query),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shopEntry () { // 店铺入驻
|
shopEntry() {
|
||||||
if (storage.getItem('accessToken')) {
|
// 店铺入驻
|
||||||
|
if (storage.getItem("accessToken")) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/shopEntry',
|
path: "/shopEntry",
|
||||||
query: {id: 1}
|
query: { id: 1 },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('login');
|
this.$router.push("login");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getCartList () { // 获取购物车列表
|
getCartList() {
|
||||||
|
// 获取购物车列表
|
||||||
if (this.userInfo.username) {
|
if (this.userInfo.username) {
|
||||||
|
cartGoodsAll().then((res) => {
|
||||||
cartGoodsAll().then(res => {
|
this.shoppingCart = res.result.skuList;
|
||||||
this.shoppingCart = res.result.skuList
|
this.$store.commit("SET_CARTNUM", this.shoppingCart.length);
|
||||||
this.$store.commit('SET_CARTNUM', this.shoppingCart.length)
|
this.Cookies.setItem("cartNum", this.shoppingCart.length);
|
||||||
this.Cookies.setItem('cartNum', this.shoppingCart.length)
|
});
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -253,7 +223,8 @@ export default {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.nav a,.nav-item {
|
.nav a,
|
||||||
|
.nav-item {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
|
@ -396,7 +367,6 @@ export default {
|
||||||
.sign-out p {
|
.sign-out p {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-title:hover {
|
.goods-title:hover {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,42 +11,37 @@
|
||||||
</div> -->
|
</div> -->
|
||||||
<!-- 普通发票 -->
|
<!-- 普通发票 -->
|
||||||
<div class="nav-content">
|
<div class="nav-content">
|
||||||
<Form
|
<Form :model="invoiceForm" ref="form" label-position="left" :rules="ruleInline" :label-width="110">
|
||||||
:model="invoiceForm"
|
|
||||||
ref="form"
|
|
||||||
label-position="left"
|
|
||||||
:rules="ruleInline"
|
|
||||||
:label-width="110"
|
|
||||||
>
|
|
||||||
<FormItem label="发票类型">
|
<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="1">个人</Radio>
|
||||||
<Radio :label="2">单位</Radio>
|
<Radio :label="2">单位</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem label="个人名称" v-if="type === 1" prop="receiptTitle">
|
||||||
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
|
<FormItem label="单位名称" v-if="type === 2" prop="receiptTitle">
|
||||||
label="纳税人识别号"
|
<i-input v-model="invoiceForm.receiptTitle"></i-input>
|
||||||
v-if="invoiceForm.type == 2"
|
</FormItem>
|
||||||
prop="taxpayerId"
|
<FormItem label="纳税人识别号" v-if="type === 2" 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="save">保存发票信息</Button>
|
<Button type="primary" :loading="loading" @click="submit">保存发票信息</Button>
|
||||||
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,100 +49,104 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { saveReceipt } from '@/api/member.js';
|
import { receiptSelect } from "@/api/cart.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 单位
|
|
||||||
},
|
},
|
||||||
ruleInline: { // 验证规则
|
type: 1, // 1 个人 2 单位
|
||||||
receiptTitle: [{ required: true, message: '请填写公司名称' }],
|
ruleInline: {
|
||||||
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) {
|
* 选择发票抬头
|
||||||
// 个人
|
*/
|
||||||
let flag = true;
|
changeInvoice(val) {
|
||||||
this.receiptItems.forEach((e) => {
|
this.$nextTick(() => {
|
||||||
if (
|
this.type = val;
|
||||||
e.receiptTitle === '个人' &&
|
|
||||||
e.receiptContent === this.invoiceForm.receiptContent
|
|
||||||
) {
|
|
||||||
this.$emit('change', e);
|
|
||||||
flag = false;
|
|
||||||
this.invoiceAvailable = false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
if (flag) {
|
/**
|
||||||
let params = {
|
* 保存判断
|
||||||
receiptTitle: '个人',
|
*/
|
||||||
receiptContent: this.invoiceForm.receiptContent
|
save() {
|
||||||
};
|
let flage = true;
|
||||||
this.loading = true;
|
|
||||||
saveReceipt(params)
|
// 保存分为两种类型,个人以及企业
|
||||||
.then((res) => {
|
const { type, receiptTitle, receiptContent } = JSON.parse(
|
||||||
this.loading = false;
|
JSON.stringify(this.invoiceForm)
|
||||||
if (res.success) {
|
);
|
||||||
this.$emit('change', res.result);
|
|
||||||
this.invoiceAvailable = false;
|
// 判断是否填写发票抬头
|
||||||
|
if (!receiptTitle) {
|
||||||
|
this.$Message.error("请填写发票抬头!");
|
||||||
|
flage = false;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.catch(() => {
|
if (type == 2) {
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 单位
|
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (!valid) {
|
||||||
this.loading = true;
|
flage = false;
|
||||||
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 {
|
} else {
|
||||||
saveReceipt(params)
|
delete this.invoiceForm.taxpayerId;
|
||||||
.then((res) => {
|
}
|
||||||
|
|
||||||
|
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;
|
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>
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
已节省<span>{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span>
|
已节省<span>{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml_20 total-price">
|
<div class="ml_20 total-price">
|
||||||
总价(不含运费):<span>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</span>
|
总价(不含运费):<div>{{ priceDetailDTO.billPrice | unitPrice("¥") }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pay ml_20" @click="pay">去结算</div>
|
<div class="pay ml_20" @click="pay">去结算</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -136,26 +136,26 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Promotion from '@/components/goodsDetail/Promotion'
|
import Promotion from "@/components/goodsDetail/Promotion";
|
||||||
import Search from '@/components/Search';
|
import Search from "@/components/Search";
|
||||||
import ShowLikeGoods from '@/components/like';
|
import ShowLikeGoods from "@/components/like";
|
||||||
import * as APICart from '@/api/cart';
|
import * as APICart from "@/api/cart";
|
||||||
import * as APIMember from '@/api/member';
|
import * as APIMember from "@/api/member";
|
||||||
import {getLogo} from '@/api/common.js'
|
import { getLogo } from "@/api/common.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'Cart',
|
name: "Cart",
|
||||||
beforeRouteEnter (to, from, next) {
|
beforeRouteEnter(to, from, next) {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Search,
|
Search,
|
||||||
ShowLikeGoods,
|
ShowLikeGoods,
|
||||||
Promotion
|
Promotion,
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
logoImg: '', // logo图
|
logoImg: "", // logo图
|
||||||
couponAvailable: false, // 展示优惠券
|
couponAvailable: false, // 展示优惠券
|
||||||
stepIndex: 0, // 当前处于哪一步,购物车==0,填写订单信息==1,成功提交订单==2
|
stepIndex: 0, // 当前处于哪一步,购物车==0,填写订单信息==1,成功提交订单==2
|
||||||
goodsTotal: 1, // 商品数量
|
goodsTotal: 1, // 商品数量
|
||||||
|
@ -165,45 +165,45 @@ export default {
|
||||||
cartList: [], // 购物车列表
|
cartList: [], // 购物车列表
|
||||||
couponList: [], // 优惠券列表
|
couponList: [], // 优惠券列表
|
||||||
priceDetailDTO: {}, // 价格明细
|
priceDetailDTO: {}, // 价格明细
|
||||||
skuList: [] // sku列表
|
skuList: [], // sku列表
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
methods: {
|
||||||
// 跳转商品详情
|
// 跳转商品详情
|
||||||
goGoodsDetail (skuId, goodsId) {
|
goGoodsDetail(skuId, goodsId) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/goodsDetail',
|
path: "/goodsDetail",
|
||||||
query: { skuId, goodsId }
|
query: { skuId, goodsId },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
// 跳转店铺首页
|
// 跳转店铺首页
|
||||||
goShopPage (id) {
|
goShopPage(id) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/Merchant',
|
path: "/Merchant",
|
||||||
query: { id }
|
query: { id },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
// 收藏商品
|
// 收藏商品
|
||||||
collectGoods (id) {
|
collectGoods(id) {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '收藏',
|
title: "收藏",
|
||||||
content: '<p>商品收藏后可在个人中心我的收藏查看</p>',
|
content: "<p>商品收藏后可在个人中心我的收藏查看</p>",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
APIMember.collectGoods('GOODS', id).then((res) => {
|
APIMember.collectGoods("GOODS", id).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('收藏商品成功');
|
this.$Message.success("收藏商品成功");
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCancel: () => { }
|
onCancel: () => {},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 删除商品
|
// 删除商品
|
||||||
delGoods (id) {
|
delGoods(id) {
|
||||||
const idArr = [];
|
const idArr = [];
|
||||||
if (!id) {
|
if (!id) {
|
||||||
const list = this.cartList;
|
const list = this.cartList;
|
||||||
|
@ -216,49 +216,50 @@ export default {
|
||||||
idArr.push(id);
|
idArr.push(id);
|
||||||
}
|
}
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '删除',
|
title: "删除",
|
||||||
content: '<p>确定要删除该商品吗?</p>',
|
content: "<p>确定要删除该商品吗?</p>",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
APICart.delCartGoods({ skuIds: idArr.toString() }).then((res) => {
|
APICart.delCartGoods({ skuIds: idArr.toString() }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('删除成功');
|
this.$Message.success("删除成功");
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error(res.message);
|
this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clearCart () { // 清空购物车
|
clearCart() {
|
||||||
|
// 清空购物车
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '提示',
|
title: "提示",
|
||||||
content: '<p>确定要清空购物车吗?清空后不可恢复</p>',
|
content: "<p>确定要清空购物车吗?清空后不可恢复</p>",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
APICart.clearCart().then((res) => {
|
APICart.clearCart().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('清空购物车成功');
|
this.$Message.success("清空购物车成功");
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error(res.message);
|
this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 跳转支付页面
|
// 跳转支付页面
|
||||||
pay () {
|
pay() {
|
||||||
if (this.checkedNum) {
|
if (this.checkedNum) {
|
||||||
this.$router.push({ path: '/pay', query: { way: 'CART' } });
|
this.$router.push({ path: "/pay", query: { way: "CART" } });
|
||||||
} else {
|
} else {
|
||||||
this.$Message.warning('请至少选择一件商品');
|
this.$Message.warning("请至少选择一件商品");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 展示优惠券
|
// 展示优惠券
|
||||||
showCoupon (storeId, index) {
|
showCoupon(storeId, index) {
|
||||||
this.couponAvailable = index;
|
this.couponAvailable = index;
|
||||||
},
|
},
|
||||||
changeNum (val, id) {
|
changeNum(val, id) {
|
||||||
// 设置购买数量
|
// 设置购买数量
|
||||||
console.log(val, id);
|
console.log(val, id);
|
||||||
APICart.setCartGoodsNum({ skuId: id, num: val }).then((res) => {
|
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;
|
const check = status ? 1 : 0;
|
||||||
if (type === 'all') {
|
if (type === "all") {
|
||||||
// 全选
|
// 全选
|
||||||
await APICart.setCheckedAll({ checked: check });
|
await APICart.setCheckedAll({ checked: check });
|
||||||
} else if (type === 'shop') {
|
} else if (type === "shop") {
|
||||||
// 选中店铺所有商品
|
// 选中店铺所有商品
|
||||||
await APICart.setCheckedSeller({ checked: check, storeId: id });
|
await APICart.setCheckedSeller({ checked: check, storeId: id });
|
||||||
} else {
|
} else {
|
||||||
|
@ -285,16 +286,17 @@ export default {
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
},
|
},
|
||||||
|
|
||||||
async receiveShopCoupon (item) { // 领取优惠券
|
async receiveShopCoupon(item) {
|
||||||
let res = await APIMember.receiveCoupon(item.id)
|
// 领取优惠券
|
||||||
|
let res = await APIMember.receiveCoupon(item.id);
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$set(item, 'disabled', true)
|
this.$set(item, "disabled", true);
|
||||||
this.$Message.success('领取成功')
|
this.$Message.success("领取成功");
|
||||||
} else {
|
} else {
|
||||||
this.$Message.error(res.message)
|
this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getCartList () {
|
async getCartList() {
|
||||||
// 购物车列表
|
// 购物车列表
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
try {
|
try {
|
||||||
|
@ -307,9 +309,9 @@ export default {
|
||||||
this.checkedNum = 0;
|
this.checkedNum = 0;
|
||||||
let allChecked = true;
|
let allChecked = true;
|
||||||
for (let k = 0; k < this.cartList.length; k++) {
|
for (let k = 0; k < this.cartList.length; k++) {
|
||||||
let shop = this.cartList[k]
|
let shop = this.cartList[k];
|
||||||
let list = await APIMember.couponList({storeId: shop.storeId})
|
let list = await APIMember.couponList({ storeId: shop.storeId });
|
||||||
shop.couponList.push(...list.result.records)
|
shop.couponList.push(...list.result.records);
|
||||||
}
|
}
|
||||||
for (let i = 0; i < this.skuList.length; i++) {
|
for (let i = 0; i < this.skuList.length; i++) {
|
||||||
if (this.skuList[i].checked) {
|
if (this.skuList[i].checked) {
|
||||||
|
@ -318,30 +320,31 @@ export default {
|
||||||
allChecked = false;
|
allChecked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$forceUpdate()
|
this.$forceUpdate();
|
||||||
this.allChecked = allChecked;
|
this.allChecked = allChecked;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted () {
|
},
|
||||||
|
mounted() {
|
||||||
this.getCartList();
|
this.getCartList();
|
||||||
APICart.cartCount().then(res => { // 购物车商品数量
|
APICart.cartCount().then((res) => {
|
||||||
|
// 购物车商品数量
|
||||||
if (res.success) this.goodsTotal = res.result;
|
if (res.success) this.goodsTotal = res.result;
|
||||||
});
|
});
|
||||||
if (!this.Cookies.getItem('logo')) {
|
if (!this.Cookies.getItem("logo")) {
|
||||||
getLogo().then(res => {
|
getLogo().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let logoObj = JSON.parse(res.result.settingValue)
|
let logoObj = JSON.parse(res.result.settingValue);
|
||||||
this.Cookies.setItem('logo', logoObj.buyerSideLogo)
|
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.logoImg = this.Cookies.getItem('logo')
|
this.logoImg = this.Cookies.getItem("logo");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -544,7 +547,7 @@ export default {
|
||||||
width: 70px;
|
width: 70px;
|
||||||
height: 70px;
|
height: 70px;
|
||||||
}
|
}
|
||||||
>div>p {
|
> div > p {
|
||||||
@include content_color($light_content_color);
|
@include content_color($light_content_color);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
@ -567,12 +570,12 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.error-goods{
|
.error-goods {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-left: -20px;
|
margin-left: -20px;
|
||||||
background-color: rgba($color: #999, $alpha: .5);
|
background-color: rgba($color: #999, $alpha: 0.5);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -603,7 +606,7 @@ export default {
|
||||||
.save-price span {
|
.save-price span {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.total-price span {
|
.total-price div {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
@ -651,23 +654,31 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
>span{
|
> span {
|
||||||
border: 1px solid $theme_color;
|
border: 1px solid $theme_color;
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
}
|
}
|
||||||
>p{
|
> p {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.cart-goods-footer > div{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.total-price{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.ivu-input-number-input {
|
.ivu-input-number-input {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
<span @click="goAddressManage">管理收货人地址</span>
|
<span @click="goAddressManage">管理收货人地址</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="address-manage">
|
<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>
|
<div>
|
||||||
<span>{{item.name}}</span>
|
<span>{{item.name}}</span>
|
||||||
<Tag class="ml_10" v-if="item.isDefault" color="red">默认</Tag>
|
<Tag class="ml_10" v-if="item.isDefault" color="red">默认</Tag>
|
||||||
|
@ -92,7 +93,9 @@
|
||||||
<!-- 发票信息 -->
|
<!-- 发票信息 -->
|
||||||
<div class="invoice">
|
<div class="invoice">
|
||||||
<div class="card-head mt_20 mb_20">
|
<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>
|
||||||
<div class="inovice-content">
|
<div class="inovice-content">
|
||||||
<span>{{invoiceData.receiptTitle}}</span>
|
<span>{{invoiceData.receiptTitle}}</span>
|
||||||
|
@ -135,7 +138,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -159,45 +163,56 @@
|
||||||
<!-- 底部支付栏 -->
|
<!-- 底部支付栏 -->
|
||||||
<div class="order-footer width_1200">
|
<div class="order-footer width_1200">
|
||||||
<div class="pay ml_20" @click="pay">提交订单</div>
|
<div class="pay ml_20" @click="pay">提交订单</div>
|
||||||
<div class="pay-address" v-if="addressList.length">配送至:{{ selectedAddress.consigneeAddressPath | unitAddress }} {{selectedAddress.detail}} 收货人:{{selectedAddress.name}} {{selectedAddress.mobile}}</div>
|
<div class="pay-address" v-if="addressList.length">配送至:{{ selectedAddress.consigneeAddressPath | unitAddress }}
|
||||||
|
{{selectedAddress.detail}} 收货人:{{selectedAddress.name}} {{selectedAddress.mobile}}</div>
|
||||||
</div>
|
</div>
|
||||||
<BaseFooter></BaseFooter>
|
<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>
|
<address-manage ref="address" :id="addrId" @change="addrChange"></address-manage>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import invoiceModal from '@/components/invoiceModal';
|
import invoiceModal from "@/components/invoiceModal";
|
||||||
import addressManage from '@/components/addressManage';
|
import addressManage from "@/components/addressManage";
|
||||||
import {memberAddress, delMemberAddress} from '@/api/address';
|
import { memberAddress, delMemberAddress } from "@/api/address";
|
||||||
import {cartGoodsPay, createTrade, selectAddr, shippingMethod, receiptSelect, selectCoupon, couponNum} from '@/api/cart';
|
import {
|
||||||
import { canUseCouponList } from '@/api/member.js';
|
cartGoodsPay,
|
||||||
import {getLogo} from '@/api/common.js'
|
createTrade,
|
||||||
|
selectAddr,
|
||||||
|
shippingMethod,
|
||||||
|
selectCoupon,
|
||||||
|
couponNum,
|
||||||
|
} from "@/api/cart";
|
||||||
|
import { canUseCouponList } from "@/api/member.js";
|
||||||
|
import { getLogo } from "@/api/common.js";
|
||||||
export default {
|
export default {
|
||||||
name: 'Pay',
|
name: "Pay",
|
||||||
components: { invoiceModal, addressManage },
|
components: { invoiceModal, addressManage },
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
stepIndex: 1, // 顶部步骤条状态
|
stepIndex: 1, // 顶部步骤条状态
|
||||||
invoiceAvailable: false, // 发票编辑按钮
|
invoiceAvailable: false, // 发票编辑按钮
|
||||||
showEditBtn: '', // 鼠标移入显示编辑按钮
|
showEditBtn: "", // 鼠标移入显示编辑按钮
|
||||||
orderMark: '', // 订单备注
|
orderMark: "", // 订单备注
|
||||||
invoiceData: { // 发票数据
|
invoiceData: {
|
||||||
receiptTitle: '个人',
|
// 发票数据
|
||||||
receiptContent: '不开发票'
|
receiptTitle: "个人",
|
||||||
|
receiptContent: "不开发票",
|
||||||
},
|
},
|
||||||
otherMsgForm: { // 其他信息模块数据
|
otherMsgForm: {
|
||||||
|
// 其他信息模块数据
|
||||||
point: 0,
|
point: 0,
|
||||||
availablePoint: 10,
|
availablePoint: 10,
|
||||||
totalPoint: 100,
|
totalPoint: 100,
|
||||||
noGoods: 0
|
noGoods: 0,
|
||||||
},
|
},
|
||||||
deliveryList: [ // 物流
|
deliveryList: [
|
||||||
|
// 物流
|
||||||
// {value: 'SELF_PICK_UP', label: '自提'},
|
// {value: 'SELF_PICK_UP', label: '自提'},
|
||||||
{value: 'LOGISTICS', label: '物流'}
|
{ value: "LOGISTICS", label: "物流" },
|
||||||
// {value: 'LOCAL_TOWN_DELIVERY', label: '同城配送'}
|
// {value: 'LOCAL_TOWN_DELIVERY', label: '同城配送'}
|
||||||
],
|
],
|
||||||
addressList: [], // 地址列表
|
addressList: [], // 地址列表
|
||||||
|
@ -205,257 +220,277 @@ export default {
|
||||||
goodsList: [], // 商品列表
|
goodsList: [], // 商品列表
|
||||||
priceDetailDTO: {}, // 商品价格
|
priceDetailDTO: {}, // 商品价格
|
||||||
totalNum: 0, // 购买数量
|
totalNum: 0, // 购买数量
|
||||||
addrId: '', // 编辑地址传入的id
|
addrId: "", // 编辑地址传入的id
|
||||||
moreAddr: false, // 更多地址
|
moreAddr: false, // 更多地址
|
||||||
canUseCouponNum: 0, // 可用优惠券数量
|
canUseCouponNum: 0, // 可用优惠券数量
|
||||||
couponList: [], // 可用优惠券列表
|
couponList: [], // 可用优惠券列表
|
||||||
logoImg: '', // 平台logo
|
logoImg: "", // 平台logo
|
||||||
usedCouponId: [], // 已使用优惠券id
|
usedCouponId: [], // 已使用优惠券id
|
||||||
selectedCoupon: {} // 已选优惠券对象
|
selectedCoupon: {}, // 已选优惠券对象
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
if (!this.Cookies.getItem('logo')) {
|
if (!this.Cookies.getItem("logo")) {
|
||||||
getLogo().then(res => {
|
getLogo().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
let logoObj = JSON.parse(res.result.settingValue)
|
let logoObj = JSON.parse(res.result.settingValue);
|
||||||
this.Cookies.setItem('logo', logoObj.buyerSideLogo)
|
this.Cookies.setItem("logo", logoObj.buyerSideLogo);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.logoImg = this.Cookies.getItem('logo')
|
this.logoImg = this.Cookies.getItem("logo");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init () {
|
init() {
|
||||||
this.getGoodsDetail();
|
this.getGoodsDetail();
|
||||||
},
|
},
|
||||||
goAddressManage () { // 跳转地址管理页面
|
goAddressManage() {
|
||||||
this.$router.push('/home/MyAddress');
|
// 跳转地址管理页面
|
||||||
|
this.$router.push("/home/MyAddress");
|
||||||
},
|
},
|
||||||
getAddress () { // 获取收货地址列表
|
getAddress() {
|
||||||
memberAddress().then(res => {
|
// 获取收货地址列表
|
||||||
|
memberAddress().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.addressList = res.result.records;
|
this.addressList = res.result.records;
|
||||||
this.addressList.forEach((e, index) => {
|
this.addressList.forEach((e, index) => {
|
||||||
if (e.id === this.selectedAddress.id && index > 2) {
|
if (e.id === this.selectedAddress.id && index > 2) {
|
||||||
this.moreAddr = true
|
this.moreAddr = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getGoodsDetail () { // 订单商品详情
|
getGoodsDetail() {
|
||||||
|
// 订单商品详情
|
||||||
this.$Spin.show();
|
this.$Spin.show();
|
||||||
cartGoodsPay({way: this.$route.query.way}).then(res => {
|
cartGoodsPay({ way: this.$route.query.way })
|
||||||
|
.then((res) => {
|
||||||
this.$Spin.hide();
|
this.$Spin.hide();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.goodsList = res.result.cartList;
|
this.goodsList = res.result.cartList;
|
||||||
this.priceDetailDTO = res.result.priceDetailDTO;
|
this.priceDetailDTO = res.result.priceDetailDTO;
|
||||||
this.skuList = res.result.skuList;
|
this.skuList = res.result.skuList;
|
||||||
|
|
||||||
|
res.result.receiptVO
|
||||||
|
? (this.invoiceData = res.result.receiptVO)
|
||||||
|
: "";
|
||||||
|
|
||||||
let notSupArea = res.result.notSupportFreight;
|
let notSupArea = res.result.notSupportFreight;
|
||||||
this.selectedCoupon = {}
|
this.selectedCoupon = {};
|
||||||
if (res.result.platformCoupon) this.selectedCoupon.platformCoupon = res.result.platformCoupon
|
if (res.result.platformCoupon)
|
||||||
Object.assign(this.selectedCoupon, res.result.storeCoupons)
|
this.selectedCoupon.platformCoupon = res.result.platformCoupon;
|
||||||
|
Object.assign(this.selectedCoupon, res.result.storeCoupons);
|
||||||
if (notSupArea) {
|
if (notSupArea) {
|
||||||
let content = [];
|
let content = [];
|
||||||
let title = ''
|
let title = "";
|
||||||
notSupArea.forEach(e => {
|
notSupArea.forEach((e) => {
|
||||||
title = e.errorMessage
|
title = e.errorMessage;
|
||||||
content.push(e.goodsSku.goodsName)
|
content.push(e.goodsSku.goodsName);
|
||||||
})
|
});
|
||||||
this.$Modal.warning({
|
this.$Modal.warning({
|
||||||
title: '以下商品超出配送区域' || title,
|
title: "以下商品超出配送区域" || title,
|
||||||
content: content.toString()
|
content: content.toString(),
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
if (res.result.memberAddress) {
|
if (res.result.memberAddress) {
|
||||||
this.selectedAddress = res.result.memberAddress
|
this.selectedAddress = res.result.memberAddress;
|
||||||
}
|
}
|
||||||
this.getAddress()
|
this.getAddress();
|
||||||
this.totalNum = 0;
|
this.totalNum = 0;
|
||||||
for (let i = 0; i < this.skuList.length; i++) {
|
for (let i = 0; i < this.skuList.length; i++) {
|
||||||
this.totalNum += this.skuList[i].num;
|
this.totalNum += this.skuList[i].num;
|
||||||
}
|
}
|
||||||
this.getCouponNum()
|
this.getCouponNum();
|
||||||
}
|
}
|
||||||
}).catch(() => { this.$Spin.hide() });
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$Spin.hide();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getCouponNum () { // 获取可用优惠券数量
|
getCouponNum() {
|
||||||
couponNum({way: this.$route.query.way}).then(res => {
|
// 获取可用优惠券数量
|
||||||
this.canUseCouponNum = res.result
|
couponNum({ way: this.$route.query.way }).then((res) => {
|
||||||
|
this.canUseCouponNum = res.result;
|
||||||
if (res.result) {
|
if (res.result) {
|
||||||
let storeArr = []
|
let storeArr = [];
|
||||||
let skuArr = []
|
let skuArr = [];
|
||||||
this.goodsList.forEach(e => {
|
this.goodsList.forEach((e) => {
|
||||||
storeArr.push(e.storeId)
|
storeArr.push(e.storeId);
|
||||||
e.skuList.forEach(i => {
|
e.skuList.forEach((i) => {
|
||||||
skuArr.push(i.goodsSku.id)
|
skuArr.push(i.goodsSku.id);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
let params = {
|
let params = {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
memberCouponStatus: 'NEW',
|
memberCouponStatus: "NEW",
|
||||||
scopeId: skuArr.toString(),
|
scopeId: skuArr.toString(),
|
||||||
storeId: storeArr.toString(),
|
storeId: storeArr.toString(),
|
||||||
totalPrice: this.priceDetailDTO.goodsPrice
|
totalPrice: this.priceDetailDTO.goodsPrice,
|
||||||
}
|
};
|
||||||
canUseCouponList(params).then(res => { // 可用优惠券列表
|
canUseCouponList(params).then((res) => {
|
||||||
if (res.success) this.couponList = res.result.records
|
// 可用优惠券列表
|
||||||
const couponKeys = Object.keys(this.selectedCoupon)
|
if (res.success) this.couponList = res.result.records;
|
||||||
this.usedCouponId = []
|
const couponKeys = Object.keys(this.selectedCoupon);
|
||||||
|
this.usedCouponId = [];
|
||||||
if (couponKeys.length) {
|
if (couponKeys.length) {
|
||||||
this.couponList.forEach(e => {
|
this.couponList.forEach((e) => {
|
||||||
if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) {
|
if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) {
|
||||||
this.usedCouponId.push(e.id)
|
this.usedCouponId.push(e.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$forceUpdate()
|
this.$forceUpdate();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
selectAddress (item) { // 选择地址
|
selectAddress(item) {
|
||||||
|
// 选择地址
|
||||||
let params = {
|
let params = {
|
||||||
way: this.$route.query.way,
|
way: this.$route.query.way,
|
||||||
shippingAddressId: item.id
|
shippingAddressId: item.id,
|
||||||
};
|
};
|
||||||
selectAddr(params).then(res => {
|
selectAddr(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('选择收货地址成功');
|
this.$Message.success("选择收货地址成功");
|
||||||
this.selectedAddress = item;
|
this.selectedAddress = item;
|
||||||
this.getGoodsDetail();
|
this.getGoodsDetail();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editAddress (id) { // 编辑地址
|
editAddress(id) {
|
||||||
|
// 编辑地址
|
||||||
this.addrId = id;
|
this.addrId = id;
|
||||||
this.$refs.address.show();
|
this.$refs.address.show();
|
||||||
},
|
},
|
||||||
addrChange (item) { // 添加,编辑地址回显
|
addrChange(item) {
|
||||||
|
// 添加,编辑地址回显
|
||||||
this.getAddress();
|
this.getAddress();
|
||||||
},
|
},
|
||||||
delAddress (item) {
|
delAddress(item) {
|
||||||
// 删除地址
|
// 删除地址
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '提示',
|
title: "提示",
|
||||||
content: '你确定删除这个收货地址',
|
content: "你确定删除这个收货地址",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
delMemberAddress(item.id).then((res) => {
|
delMemberAddress(item.id).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('删除成功');
|
this.$Message.success("删除成功");
|
||||||
this.getAddress();
|
this.getAddress();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCancel: () => {}
|
onCancel: () => {},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
goGoodsDetail(skuId, goodsId) {
|
||||||
|
// 跳转商品详情
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/goodsDetail',
|
path: "/goodsDetail",
|
||||||
query: { skuId, goodsId }
|
query: { skuId, goodsId },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
// 跳转店铺首页
|
// 跳转店铺首页
|
||||||
goShopPage (id) {
|
goShopPage(id) {
|
||||||
let routeUrl = this.$router.resolve({
|
let routeUrl = this.$router.resolve({
|
||||||
path: '/Merchant',
|
path: "/Merchant",
|
||||||
query: {id: id}
|
query: { id: id },
|
||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, "_blank");
|
||||||
},
|
},
|
||||||
selectDelivery (delivery) { // 选择配送方式
|
selectDelivery(delivery) {
|
||||||
|
// 选择配送方式
|
||||||
let params = {
|
let params = {
|
||||||
way: this.$route.query.way,
|
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 = {
|
let params = {
|
||||||
way: this.$route.query.way,
|
way: this.$route.query.way,
|
||||||
memberCouponId: id,
|
memberCouponId: id,
|
||||||
used: used // true 为使用, false为弃用
|
used: used, // true 为使用, false为弃用
|
||||||
}
|
};
|
||||||
selectCoupon(params).then(res => {
|
selectCoupon(params).then((res) => {
|
||||||
if (res.success) this.init()
|
if (res.success) this.init();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
editInvoice () { // 编辑发票信息
|
editInvoice() {
|
||||||
|
|
||||||
|
// 编辑发票信息
|
||||||
this.$refs.invModal.invoiceAvailable = true;
|
this.$refs.invModal.invoiceAvailable = true;
|
||||||
},
|
},
|
||||||
getInvMsg (item) { // 获取发票信息
|
getInvMsg(item) {
|
||||||
console.log(item);
|
// 获取发票信息
|
||||||
this.invoiceData = item;
|
if (item) {
|
||||||
this.selectReceipt(item.id)
|
this.init();
|
||||||
},
|
this.$refs.invModal.invoiceAvailable = false;
|
||||||
selectReceipt (id) { // 选择发票
|
|
||||||
let params = {
|
|
||||||
way: this.$route.query.way,
|
|
||||||
receiptId: id
|
|
||||||
}
|
}
|
||||||
receiptSelect(params).then(res => {
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
pay () { // 结算
|
|
||||||
|
pay() {
|
||||||
|
// 结算
|
||||||
const params = {
|
const params = {
|
||||||
client: 'PC',
|
client: "PC",
|
||||||
remark: [],
|
remark: [],
|
||||||
way: this.$route.query.way
|
way: this.$route.query.way,
|
||||||
};
|
};
|
||||||
this.goodsList.forEach(e => {
|
this.goodsList.forEach((e) => {
|
||||||
if (e.remark) {
|
if (e.remark) {
|
||||||
params.remark.push({
|
params.remark.push({
|
||||||
remark: e.remark,
|
remark: e.remark,
|
||||||
storeId: e.storeId
|
storeId: e.storeId,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
if (!params.remark.length) delete params.remark;
|
if (!params.remark.length) delete params.remark;
|
||||||
|
|
||||||
this.$Spin.show();
|
this.$Spin.show();
|
||||||
createTrade(params).then(res => {
|
createTrade(params)
|
||||||
|
.then((res) => {
|
||||||
this.$Spin.hide();
|
this.$Spin.hide();
|
||||||
if (res.success) {
|
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) {
|
useScope(type) {
|
||||||
let goods = '全部商品'
|
let goods = "全部商品";
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'ALL':
|
case "ALL":
|
||||||
goods = '全部商品'
|
goods = "全部商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS':
|
case "PORTION_GOODS":
|
||||||
goods = '部分商品'
|
goods = "部分商品";
|
||||||
break;
|
break;
|
||||||
case 'PORTION_GOODS_CATEGORY':
|
case "PORTION_GOODS_CATEGORY":
|
||||||
goods = '部分分类商品'
|
goods = "部分分类商品";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return `${goods}可用`
|
return `${goods}可用`;
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '../../assets/styles/coupon.scss';
|
@import "../../assets/styles/coupon.scss";
|
||||||
/** logo start */
|
/** logo start */
|
||||||
.logo {
|
.logo {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
@ -463,31 +498,31 @@ export default {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 20px auto 0;
|
margin: 20px auto 0;
|
||||||
div:nth-child(1){
|
div:nth-child(1) {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
img{
|
img {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
height:auto;
|
height: auto;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
div:nth-child(2){
|
div:nth-child(2) {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin: 0 20px;
|
margin: 0 20px;
|
||||||
span{
|
span {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cart-steps{
|
.cart-steps {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
span{
|
span {
|
||||||
@include content_color($light_content_color);
|
@include content_color($light_content_color);
|
||||||
height: 30px;
|
height: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -496,19 +531,19 @@ export default {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ivu-icon{
|
.ivu-icon {
|
||||||
@include content_color($light_content_color);
|
@include content_color($light_content_color);
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin:0 15px;
|
margin: 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active{
|
.active {
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
background-color:#ff8f23;
|
background-color: #ff8f23;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active-arrow{
|
.active-arrow {
|
||||||
color: #ff8f23;
|
color: #ff8f23;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -521,60 +556,60 @@ export default {
|
||||||
padding: 15px 25px;
|
padding: 15px 25px;
|
||||||
}
|
}
|
||||||
/** 地址管理 */
|
/** 地址管理 */
|
||||||
.address-manage{
|
.address-manage {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
>div {
|
> div {
|
||||||
border:1px dotted #949494;
|
border: 1px dotted #949494;
|
||||||
width: 265px;
|
width: 265px;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
margin:20px 20px 0 0;
|
margin: 20px 20px 0 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
.add-address{
|
.add-address {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.ivu-icon{
|
.ivu-icon {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.address-item{
|
.address-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
>div:nth-child(1){
|
> div:nth-child(1) {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
span{
|
span {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
>span:nth-child(1){
|
> span:nth-child(1) {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.edit-btn{
|
.edit-btn {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
span:hover{
|
span:hover {
|
||||||
border-bottom: 1px solid $theme_color;
|
border-bottom: 1px solid $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.corner-icon{
|
.corner-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: -1px;
|
right: -1px;
|
||||||
bottom: -1px;
|
bottom: -1px;
|
||||||
div{
|
div {
|
||||||
width: 0;
|
width: 0;
|
||||||
border-top: 20px solid transparent;
|
border-top: 20px solid transparent;
|
||||||
border-right: 20px solid $theme_color;
|
border-right: 20px solid $theme_color;
|
||||||
}
|
}
|
||||||
.ivu-icon{
|
.ivu-icon {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
@ -584,28 +619,30 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.border-red{
|
.border-red {
|
||||||
border-color: $theme_color;
|
border-color: $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 购买商品列表 start */
|
/** 购买商品列表 start */
|
||||||
.shop-name{
|
.shop-name {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
>span:nth-child(1){
|
> span:nth-child(1) {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
.ivu-icon{
|
.ivu-icon {
|
||||||
color: #ff8f23;
|
color: #ff8f23;
|
||||||
&:hover {color: $theme_color;}
|
&:hover {
|
||||||
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>span:nth-child(2){
|
}
|
||||||
|
> span:nth-child(2) {
|
||||||
color: #999;
|
color: #999;
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
.delivery-list{
|
.delivery-list {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
|
@ -616,106 +653,110 @@ export default {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
li{
|
li {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
&:hover{
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.goods-list{
|
.goods-list {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
margin: 10px 0 20px 0;
|
margin: 10px 0 20px 0;
|
||||||
.goods-item{
|
.goods-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
margin: 0 20px;
|
margin: 0 20px;
|
||||||
border-bottom: 1px dotted #999;
|
border-bottom: 1px dotted #999;
|
||||||
&:last-child{border:none;}
|
&:last-child {
|
||||||
img{
|
border: none;
|
||||||
|
}
|
||||||
|
img {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
}
|
}
|
||||||
>span{
|
> span {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
>span:nth-child(1) {
|
> span:nth-child(1) {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
>span:last-child{
|
> span:last-child {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.goods-price{
|
.goods-price {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.order-mark{
|
.order-mark {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
}
|
}
|
||||||
/** 购买商品列表 end */
|
/** 购买商品列表 end */
|
||||||
/** 发票信息 start */
|
/** 发票信息 start */
|
||||||
.invoice{
|
.invoice {
|
||||||
.inv-tips{
|
.inv-tips {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
width: 310px;
|
width: 310px;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
margin: 0 0 0 10px;
|
margin: 0 0 0 10px;
|
||||||
font-size: 12px!important;
|
font-size: 12px !important;
|
||||||
box-shadow: 0 0 3px rgba(0,0,0,.15);
|
box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
|
||||||
&::before{
|
&::before {
|
||||||
content: '';
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 17px;
|
height: 17px;
|
||||||
background:url(../../assets/images/arrow-left.png) 0 0 no-repeat;
|
background: url(../../assets/images/arrow-left.png) 0 0 no-repeat;
|
||||||
background-color:#fff;
|
background-color: #fff;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -9px;
|
left: -9px;
|
||||||
}
|
}
|
||||||
.ivu-icon{
|
.ivu-icon {
|
||||||
color: #ff8f23;
|
color: #ff8f23;
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.inovice-content{
|
.inovice-content {
|
||||||
>span {
|
> span {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
>span:last-child{
|
> span:last-child {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
&:hover{border-bottom: 1px solid $theme_color;}
|
&:hover {
|
||||||
|
border-bottom: 1px solid $theme_color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 发票信息 end */
|
/** 发票信息 end */
|
||||||
|
|
||||||
/** 订单价格 */
|
/** 订单价格 */
|
||||||
.order-price{
|
.order-price {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #999;
|
color: #999;
|
||||||
>div>span:nth-child(2){
|
> div > span:nth-child(2) {
|
||||||
width: 130px;
|
width: 130px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.actrual-price{
|
.actrual-price {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
@ -732,7 +773,7 @@ export default {
|
||||||
flex-direction: row-reverse;
|
flex-direction: row-reverse;
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
div{
|
div {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
position: sticky;
|
position: sticky;
|
||||||
|
@ -746,7 +787,7 @@ export default {
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 公共表头 */
|
/** 公共表头 */
|
||||||
.card-head {
|
.card-head {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -755,14 +796,14 @@ export default {
|
||||||
border-bottom: 1px solid #dddddd;
|
border-bottom: 1px solid #dddddd;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
||||||
span:nth-child(1){
|
span:nth-child(1) {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
span:nth-child(2){
|
span:nth-child(2) {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #438cde;
|
color: #438cde;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
&:hover{
|
&:hover {
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -771,8 +812,10 @@ export default {
|
||||||
background: $theme_color;
|
background: $theme_color;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
}
|
}
|
||||||
.pay-address{font-size: 12px;}
|
.pay-address {
|
||||||
.more-addr{
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.more-addr {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -782,15 +825,16 @@ export default {
|
||||||
height: 125px;
|
height: 125px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
.c-right{
|
.c-right {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
padding: 10px 7px;
|
padding: 10px 7px;
|
||||||
}
|
}
|
||||||
b{
|
b {
|
||||||
background: url('../../assets/images/small-circle.png') top left repeat-y;
|
background: url("../../assets/images/small-circle.png") top left repeat-y;
|
||||||
right: 28px;
|
right: 28px;
|
||||||
}
|
}
|
||||||
.circle-top,.circle-bottom{
|
.circle-top,
|
||||||
|
.circle-bottom {
|
||||||
right: 22px;
|
right: 22px;
|
||||||
}
|
}
|
||||||
.used {
|
.used {
|
||||||
|
|
|
@ -9,23 +9,11 @@
|
||||||
<Step title="其他信息"></Step>
|
<Step title="其他信息"></Step>
|
||||||
<Step title="提交审核"></Step>
|
<Step title="提交审核"></Step>
|
||||||
</Steps>
|
</Steps>
|
||||||
<first-apply
|
<first-apply v-if="currentIndex == 0 && dataReview" :content="firstData" @change="nextPage"></first-apply>
|
||||||
v-if="currentIndex == 0 && dataReview"
|
|
||||||
:content="firstData"
|
|
||||||
@change="nextPage"
|
|
||||||
></first-apply>
|
|
||||||
|
|
||||||
<second-apply
|
<second-apply v-if="currentIndex == 1 && dataReview" :content="secondData" @change="nextPage"></second-apply>
|
||||||
v-if="currentIndex == 1 && dataReview"
|
|
||||||
:content="secondData"
|
|
||||||
@change="nextPage"
|
|
||||||
></second-apply>
|
|
||||||
|
|
||||||
<third-apply
|
<third-apply v-if="currentIndex == 2 && dataReview" :content="thirdData" @change="nextPage"></third-apply>
|
||||||
v-if="currentIndex == 2 && dataReview"
|
|
||||||
:content="thirdData"
|
|
||||||
@change="nextPage"
|
|
||||||
></third-apply>
|
|
||||||
|
|
||||||
<div class="success-page" v-if="currentIndex == 3">
|
<div class="success-page" v-if="currentIndex == 3">
|
||||||
<span v-if="storeDisable == '' || storeDisable == 'APPLYING'">入驻申请提交成功,等待平台审核</span>
|
<span v-if="storeDisable == '' || storeDisable == 'APPLYING'">入驻申请提交成功,等待平台审核</span>
|
||||||
|
@ -37,62 +25,51 @@
|
||||||
<Button type="primary" @click='currentIndex = 0' v-if="storeDisable === 'REFUSED' && currentIndex === 3">重新申请</Button>
|
<Button type="primary" @click='currentIndex = 0' v-if="storeDisable === 'REFUSED' && currentIndex === 3">重新申请</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal
|
<Modal title="店铺入驻协议" v-model="showAgreement" width="1200" :closable="false" :mask-closable="false">
|
||||||
title="店铺入驻协议"
|
|
||||||
v-model="showAgreement"
|
|
||||||
width="1200"
|
|
||||||
:closable="false"
|
|
||||||
:mask-closable="false"
|
|
||||||
>
|
|
||||||
<div class="agreeent-con" v-html="agreementCon"></div>
|
<div class="agreeent-con" v-html="agreementCon"></div>
|
||||||
|
|
||||||
<div slot="footer" style="text-align: center">
|
<div slot="footer" style="text-align: center">
|
||||||
<p><Checkbox v-model="checked">我已同意以上协议</Checkbox></p>
|
<p>
|
||||||
<Button
|
<Checkbox v-model="checked">我已同意以上协议</Checkbox>
|
||||||
type="primary"
|
</p>
|
||||||
:disabled="!checked"
|
<Button type="primary" :disabled="!checked" class="margin" @click="showAgreement = false">同意协议填写资质信息</Button>
|
||||||
class="margin"
|
|
||||||
@click="showAgreement = false"
|
|
||||||
>同意协议填写资质信息</Button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { agreement, applyStatus } from '@/api/shopentry';
|
import { agreement, applyStatus } from "@/api/shopentry";
|
||||||
import firstApply from './first-apply';
|
import firstApply from "./first-apply";
|
||||||
import secondApply from './second-apply';
|
import secondApply from "./second-apply";
|
||||||
import thirdApply from './third-apply';
|
import thirdApply from "./third-apply";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
firstApply,
|
firstApply,
|
||||||
secondApply,
|
secondApply,
|
||||||
thirdApply
|
thirdApply,
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentIndex: 0, // 当前步骤
|
currentIndex: 0, // 当前步骤
|
||||||
showAgreement: false, // 协议显示
|
showAgreement: false, // 协议显示
|
||||||
agreementCon: '', // 协议内容
|
agreementCon: "", // 协议内容
|
||||||
checked: false, // 选中协议
|
checked: false, // 选中协议
|
||||||
applyData: {}, // 申请数据
|
applyData: {}, // 申请数据
|
||||||
firstData: {}, // 第一步数据
|
firstData: {}, // 第一步数据
|
||||||
secondData: {}, // 第二步数据
|
secondData: {}, // 第二步数据
|
||||||
thirdData: {}, // 第三步数据
|
thirdData: {}, // 第三步数据
|
||||||
storeDisable: '', // APPLY OPEN 开店中 CLOSED 关闭 REFUSED 拒绝 APPLYING 申请中,审核
|
storeDisable: "", // APPLY OPEN 开店中 CLOSED 关闭 REFUSED 拒绝 APPLYING 申请中,审核
|
||||||
dataReview: true // 根据接口返回判断是否可展示数据
|
dataReview: true, // 根据接口返回判断是否可展示数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getArticle () {
|
getArticle() {
|
||||||
// 入驻协议
|
// 入驻协议
|
||||||
agreement().then((res) => {
|
agreement().then((res) => {
|
||||||
console.log(res);
|
this.agreementCon = res.result.content;
|
||||||
this.agreementCon = res.result;
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getData () {
|
getData() {
|
||||||
applyStatus().then((res) => {
|
applyStatus().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
if (!res.result) {
|
if (!res.result) {
|
||||||
|
@ -101,34 +78,34 @@ export default {
|
||||||
this.dataReview = false;
|
this.dataReview = false;
|
||||||
let data = res.result;
|
let data = res.result;
|
||||||
let first = [
|
let first = [
|
||||||
'addressIdPath',
|
"addressIdPath",
|
||||||
'addressPath',
|
"addressPath",
|
||||||
'companyAddress',
|
"companyAddress",
|
||||||
'companyEmail',
|
"companyEmail",
|
||||||
'companyName',
|
"companyName",
|
||||||
'employeeNum',
|
"employeeNum",
|
||||||
'legalId',
|
"legalId",
|
||||||
'legalName',
|
"legalName",
|
||||||
'licencePhoto',
|
"licencePhoto",
|
||||||
'legalPhoto',
|
"legalPhoto",
|
||||||
'licenseNum',
|
"licenseNum",
|
||||||
'linkName',
|
"linkName",
|
||||||
'linkPhone',
|
"linkPhone",
|
||||||
'registeredCapital',
|
"registeredCapital",
|
||||||
'scope'
|
"scope",
|
||||||
];
|
];
|
||||||
let second = [
|
let second = [
|
||||||
'settlementBankAccountName',
|
"settlementBankAccountName",
|
||||||
'settlementBankAccountNum',
|
"settlementBankAccountNum",
|
||||||
'settlementBankBranchName',
|
"settlementBankBranchName",
|
||||||
'settlementBankJointName'
|
"settlementBankJointName",
|
||||||
];
|
];
|
||||||
let third = [
|
let third = [
|
||||||
'goodsManagementCategory',
|
"goodsManagementCategory",
|
||||||
'storeCenter',
|
"storeCenter",
|
||||||
'storeDesc',
|
"storeDesc",
|
||||||
'storeLogo',
|
"storeLogo",
|
||||||
'storeName'
|
"storeName",
|
||||||
];
|
];
|
||||||
|
|
||||||
this.storeDisable = data.storeDisable;
|
this.storeDisable = data.storeDisable;
|
||||||
|
@ -143,7 +120,7 @@ export default {
|
||||||
this.thirdData[e] = data[e];
|
this.thirdData[e] = data[e];
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.storeDisable === 'APPLY') {
|
if (this.storeDisable === "APPLY") {
|
||||||
this.currentIndex = 0;
|
this.currentIndex = 0;
|
||||||
} else {
|
} else {
|
||||||
this.currentIndex = 3;
|
this.currentIndex = 3;
|
||||||
|
@ -154,13 +131,14 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
nextPage (step) {
|
nextPage(step) {
|
||||||
this.currentIndex = step;
|
this.currentIndex = step;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted () {
|
},
|
||||||
|
mounted() {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
this.getArticle();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -5,6 +5,13 @@ import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios'
|
||||||
export const getManagerBrandPage = (params) => {
|
export const getManagerBrandPage = (params) => {
|
||||||
return getRequest('/goods/brand/getByPage', params)
|
return getRequest('/goods/brand/getByPage', params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量删除
|
||||||
|
export const delBrand = (ids) =>{
|
||||||
|
return deleteRequest(`/goods/brand/delByIds/${ids}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 添加
|
// 添加
|
||||||
export const addBrand = (params) => {
|
export const addBrand = (params) => {
|
||||||
return postRequest('/goods/brand', params)
|
return postRequest('/goods/brand', params)
|
||||||
|
|
|
@ -21,10 +21,11 @@ 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",
|
||||||
|
|
|
@ -1,25 +1,13 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/styles/table-common.scss";
|
@import "@/styles/table-common.scss";
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<Card>
|
<Card>
|
||||||
<Row @keydown.enter.native="handleSearch">
|
<Row @keydown.enter.native="handleSearch">
|
||||||
<Form
|
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||||
ref="searchForm"
|
|
||||||
:model="searchForm"
|
|
||||||
inline
|
|
||||||
:label-width="70"
|
|
||||||
class="search-form"
|
|
||||||
>
|
|
||||||
<Form-item label="品牌名称" prop="name">
|
<Form-item label="品牌名称" prop="name">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.name"
|
|
||||||
placeholder="请输入品牌名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</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>
|
||||||
|
@ -28,64 +16,41 @@
|
||||||
<Row class="operation padding-row">
|
<Row class="operation padding-row">
|
||||||
<Button @click="add" type="primary">添加</Button>
|
<Button @click="add" type="primary">添加</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<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>
|
|
||||||
<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"
|
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>
|
||||||
<Modal
|
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||||
:title="modalTitle"
|
|
||||||
v-model="modalVisible"
|
|
||||||
:mask-closable="false"
|
|
||||||
:width="500"
|
|
||||||
>
|
|
||||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||||
<FormItem label="品牌名称" prop="name">
|
<FormItem label="品牌名称" prop="name">
|
||||||
<Input v-model="form.name" clearable style="width: 100%"/>
|
<Input v-model="form.name" clearable style="width: 100%" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="品牌图标" prop="logo">
|
<FormItem label="品牌图标" prop="logo">
|
||||||
<upload-pic-input
|
<upload-pic-input v-model="form.logo" style="width: 100%"></upload-pic-input>
|
||||||
v-model="form.logo"
|
|
||||||
style="width: 100%"
|
|
||||||
></upload-pic-input>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交
|
||||||
>提交
|
</Button>
|
||||||
</Button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getManagerBrandPage, addBrand,updateBrand, disableBrand} from "@/api/goods";
|
import {
|
||||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
getManagerBrandPage,
|
||||||
|
addBrand,
|
||||||
|
updateBrand,
|
||||||
|
disableBrand,
|
||||||
|
delBrand,
|
||||||
|
} from "@/api/goods";
|
||||||
|
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "brand",
|
name: "brand",
|
||||||
components: {
|
components: {
|
||||||
uploadPicInput,
|
uploadPicInput,
|
||||||
|
@ -253,6 +218,24 @@
|
||||||
"编辑"
|
"编辑"
|
||||||
),
|
),
|
||||||
enableOrDisable,
|
enableOrDisable,
|
||||||
|
|
||||||
|
h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
this.delBrand(params.row.id);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"删除"
|
||||||
|
),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -262,6 +245,16 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 删除品牌
|
||||||
|
async delBrand(id) {
|
||||||
|
let res = await delBrand(id);
|
||||||
|
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("品牌删除成功!");
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
@ -300,7 +293,7 @@
|
||||||
getManagerBrandPage(this.searchForm).then((res) => {
|
getManagerBrandPage(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.warn(12)
|
console.warn(12);
|
||||||
this.data = res.result.records;
|
this.data = res.result.records;
|
||||||
this.total = res.result.total;
|
this.total = res.result.total;
|
||||||
}
|
}
|
||||||
|
@ -363,7 +356,7 @@
|
||||||
content: "您确认要启用品牌 " + v.name + " ?",
|
content: "您确认要启用品牌 " + v.name + " ?",
|
||||||
loading: true,
|
loading: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
disableBrand(v.id, {disable: false}).then((res) => {
|
disableBrand(v.id, { disable: false }).then((res) => {
|
||||||
this.$Modal.remove();
|
this.$Modal.remove();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("操作成功");
|
this.$Message.success("操作成功");
|
||||||
|
@ -379,7 +372,7 @@
|
||||||
content: "您确认要禁用品牌 " + v.name + " ?",
|
content: "您确认要禁用品牌 " + v.name + " ?",
|
||||||
loading: true,
|
loading: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
disableBrand(v.id, {disable: true}).then((res) => {
|
disableBrand(v.id, { disable: true }).then((res) => {
|
||||||
this.$Modal.remove();
|
this.$Modal.remove();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("操作成功");
|
this.$Message.success("操作成功");
|
||||||
|
@ -393,5 +386,5 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
|
|
||||||
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
|
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
|
||||||
<Form ref="specForm" :model="specForm" :label-width="100">
|
<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 v-for="item in specifications" :value="item.id" :key="item.id" :label="item.specName">
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
|
@ -134,7 +134,6 @@ import {
|
||||||
} from "@/api/goods";
|
} from "@/api/goods";
|
||||||
import TreeTable from "@/views/my-components/tree-table/Table/Table";
|
import TreeTable from "@/views/my-components/tree-table/Table/Table";
|
||||||
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
|
||||||
import * as filters from "@/utils/filters";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "lili-components",
|
name: "lili-components",
|
||||||
|
@ -153,7 +152,7 @@ export default {
|
||||||
specifications: [], //规格集合
|
specifications: [], //规格集合
|
||||||
categoryId: "", // 分类id
|
categoryId: "", // 分类id
|
||||||
category_brands: [], //已经选择的品牌
|
category_brands: [], //已经选择的品牌
|
||||||
category_specs: [], //已经选择的规格
|
categorySpecs: [], //已经选择的规格
|
||||||
expandLevel: 1, // 展开层级
|
expandLevel: 1, // 展开层级
|
||||||
modalType: 0, // 添加或编辑标识
|
modalType: 0, // 添加或编辑标识
|
||||||
modalVisible: false, // 添加或编辑显示
|
modalVisible: false, // 添加或编辑显示
|
||||||
|
@ -212,13 +211,17 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
categoryIndex: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
changeSortCate(val) {
|
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;
|
return item.name == val;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.tableData = [way];
|
this.tableData = [way];
|
||||||
},
|
},
|
||||||
|
@ -236,7 +239,8 @@ export default {
|
||||||
//获取所有规格
|
//获取所有规格
|
||||||
getSpecList() {
|
getSpecList() {
|
||||||
getSpecificationList().then((res) => {
|
getSpecificationList().then((res) => {
|
||||||
if (res.success) {
|
if (res.length != 0) {
|
||||||
|
|
||||||
this.specifications = res;
|
this.specifications = res;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -244,7 +248,7 @@ export default {
|
||||||
//弹出品牌关联框
|
//弹出品牌关联框
|
||||||
brandOperation(v) {
|
brandOperation(v) {
|
||||||
getCategoryBrandListData(v.id).then((res) => {
|
getCategoryBrandListData(v.id).then((res) => {
|
||||||
console.warn(res)
|
console.warn(res);
|
||||||
this.categoryId = v.id;
|
this.categoryId = v.id;
|
||||||
this.modalBrandTitle = "品牌关联";
|
this.modalBrandTitle = "品牌关联";
|
||||||
this.brandForm.categoryBrands = res.result.map((item) => item.id);
|
this.brandForm.categoryBrands = res.result.map((item) => item.id);
|
||||||
|
@ -257,7 +261,8 @@ export default {
|
||||||
getCategorySpecListData(v.id).then((res) => {
|
getCategorySpecListData(v.id).then((res) => {
|
||||||
this.categoryId = v.id;
|
this.categoryId = v.id;
|
||||||
this.modalSpecTitle = "规格关联";
|
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;
|
this.modalSpecVisible = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -337,7 +342,7 @@ export default {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("添加成功");
|
this.$Message.success("添加成功");
|
||||||
this.getAllList(0);
|
this.getAllList(this.categoryIndex);
|
||||||
this.modalVisible = false;
|
this.modalVisible = false;
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
}
|
}
|
||||||
|
@ -348,7 +353,7 @@ export default {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("修改成功");
|
this.$Message.success("修改成功");
|
||||||
this.getAllList(0);
|
this.getAllList(this.categoryIndex);
|
||||||
this.modalVisible = false;
|
this.modalVisible = false;
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
}
|
}
|
||||||
|
@ -376,13 +381,11 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getAllList(parent_id) {
|
getAllList(parent_id) {
|
||||||
this.sortCateList = []
|
this.sortCateList = [];
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getCategoryTree(parent_id).then((res) => {
|
getCategoryTree(parent_id).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// 仅展开指定级数 默认后台已展开所有
|
|
||||||
let expandLevel = this.expandLevel;
|
|
||||||
localStorage.setItem("category", JSON.stringify(res.result));
|
localStorage.setItem("category", JSON.stringify(res.result));
|
||||||
res.result.forEach((e, index, arr) => {
|
res.result.forEach((e, index, arr) => {
|
||||||
this.sortCateList.push({
|
this.sortCateList.push({
|
||||||
|
@ -390,65 +393,13 @@ export default {
|
||||||
value: e.name,
|
value: e.name,
|
||||||
});
|
});
|
||||||
this.sortCate = arr[0].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.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;
|
background: #fff;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
.article {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 400;
|
|
||||||
margin: 12px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.href-text {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.operation {
|
.operation {
|
||||||
margin-bottom: 2vh;
|
margin-bottom: 2vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-count {
|
|
||||||
font-weight: 600;
|
|
||||||
color: #40a9ff;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue