Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui into fengtianyangyang
commit
61a9110c51
|
@ -8,5 +8,5 @@ module.exports = {
|
||||||
icpMessage: "京ICP备20009696号-1", //icp备案
|
icpMessage: "京ICP备20009696号-1", //icp备案
|
||||||
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
||||||
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
||||||
port:10000, //端口
|
port: 10000, //端口
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
<template>
|
||||||
|
<div class="box">
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="nav" @click="back">
|
||||||
|
<img src="@/assets/images/logo2.png" alt="" class="logo" />
|
||||||
|
<div class="title">{{ detail.title }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-html="detail.content"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { articleDetail } from "@/api/common.js";
|
||||||
|
const config = require("@/config/index");
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
config,
|
||||||
|
detail: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back() {
|
||||||
|
this.$router.push("/");
|
||||||
|
},
|
||||||
|
// 初始化文章
|
||||||
|
init() {
|
||||||
|
const id = this.$route.query.id;
|
||||||
|
|
||||||
|
articleDetail(id).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.detail = res.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.logo {
|
||||||
|
max-width: 200px;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 1200px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 32px;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
width: 1200px;
|
||||||
|
min-height: 600px;
|
||||||
|
padding: 32px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.nav {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 21px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
font-size: 21px;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// iphone
|
||||||
|
@media screen and (max-width: 767px) {
|
||||||
|
.box {
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 600px;
|
||||||
|
padding: 0 16px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,344 +1,383 @@
|
||||||
import Vue from 'vue';
|
import Vue from "vue";
|
||||||
import Router from 'vue-router';
|
import Router from "vue-router";
|
||||||
import Index from '@/pages/Index';
|
import Index from "@/pages/Index";
|
||||||
const Login = resolve => require(['@/pages/Login'], resolve);
|
const Login = (resolve) => require(["@/pages/Login"], resolve);
|
||||||
const SignUp = resolve => require(['@/pages/SignUp'], resolve);
|
const SignUp = (resolve) => require(["@/pages/SignUp"], resolve);
|
||||||
const ForgetPassword = resolve => require(['@/pages/ForgetPassword'], resolve);
|
const ForgetPassword = (resolve) =>
|
||||||
const GoodsList = resolve => require(['@/pages/GoodsList'], resolve);
|
require(["@/pages/ForgetPassword"], resolve);
|
||||||
const GoodsDetail = resolve => require(['@/pages/GoodsDetail'], resolve);
|
const GoodsList = (resolve) => require(["@/pages/GoodsList"], resolve);
|
||||||
const PointGoodsDetail = resolve => require(['@/pages/promotion/PointGoodsDetail'], resolve);
|
const GoodsDetail = (resolve) => require(["@/pages/GoodsDetail"], resolve);
|
||||||
const ShoppingCart = resolve => require(['@/pages/ShoppingCart'], resolve);
|
const PointGoodsDetail = (resolve) =>
|
||||||
const Cart = resolve => require(['@/pages/Cart'], resolve);
|
require(["@/pages/promotion/PointGoodsDetail"], resolve);
|
||||||
const Pay = resolve => require(['@/pages/payment/Pay'], resolve);
|
const ShoppingCart = (resolve) => require(["@/pages/ShoppingCart"], resolve);
|
||||||
const PayDone = resolve => require(['@/pages/payment/PayDone'], resolve);
|
const Cart = (resolve) => require(["@/pages/Cart"], resolve);
|
||||||
const PayMent = resolve => require(['@/pages/payment/PayMent'], resolve);
|
const Pay = (resolve) => require(["@/pages/payment/Pay"], resolve);
|
||||||
const ThirdPay = resolve => require(['@/pages/payment/ThirdPay'], resolve);
|
const PayDone = (resolve) => require(["@/pages/payment/PayDone"], resolve);
|
||||||
const Coupon = resolve => require(['@/pages/CouponCenter'], resolve);
|
const PayMent = (resolve) => require(["@/pages/payment/PayMent"], resolve);
|
||||||
const seckill = resolve => require(['@/pages/promotion/seckill'], resolve);
|
const ThirdPay = (resolve) => require(["@/pages/payment/ThirdPay"], resolve);
|
||||||
const article = resolve => require(['@/pages/article/index'], resolve);
|
const Coupon = (resolve) => require(["@/pages/CouponCenter"], resolve);
|
||||||
const PointMall = resolve => require(['@/pages/promotion/PointMall'], resolve);
|
const seckill = (resolve) => require(["@/pages/promotion/seckill"], resolve);
|
||||||
|
const article = (resolve) => require(["@/pages/article/index"], resolve);
|
||||||
|
const articleDetail = (resolve) => require(["@/pages/article/detail"], resolve);
|
||||||
|
const PointMall = (resolve) =>
|
||||||
|
require(["@/pages/promotion/PointMall"], resolve);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 会员中心
|
* 会员中心
|
||||||
* 订单列表
|
* 订单列表
|
||||||
*/
|
*/
|
||||||
const MyOrder = resolve => require([`@/pages/home/orderCenter/MyOrder`], resolve);
|
const MyOrder = (resolve) =>
|
||||||
const OrderDetail = resolve => require([`@/pages/home/orderCenter/OrderDetail`], resolve);
|
require([`@/pages/home/orderCenter/MyOrder`], resolve);
|
||||||
const MyAddress = resolve => require(['@/pages/home/orderCenter/MyAddress'], resolve);
|
const OrderDetail = (resolve) =>
|
||||||
const AddAddress = resolve => require(['@/pages/home/orderCenter/AddAddress'], resolve);
|
require([`@/pages/home/orderCenter/OrderDetail`], resolve);
|
||||||
const Complain = resolve => require(['@/pages/home/orderCenter/Complain'], resolve);
|
const MyAddress = (resolve) =>
|
||||||
const AfterSale = resolve => require(['@/pages/home/orderCenter/AfterSale'], resolve);
|
require(["@/pages/home/orderCenter/MyAddress"], resolve);
|
||||||
const AfterSaleDetail = resolve => require(['@/pages/home/orderCenter/AfterSaleDetail'], resolve);
|
const AddAddress = (resolve) =>
|
||||||
const ApplyAfterSale = resolve => require(['@/pages/home/orderCenter/ApplyAfterSale'], resolve);
|
require(["@/pages/home/orderCenter/AddAddress"], resolve);
|
||||||
|
const Complain = (resolve) =>
|
||||||
|
require(["@/pages/home/orderCenter/Complain"], resolve);
|
||||||
|
const AfterSale = (resolve) =>
|
||||||
|
require(["@/pages/home/orderCenter/AfterSale"], resolve);
|
||||||
|
const AfterSaleDetail = (resolve) =>
|
||||||
|
require(["@/pages/home/orderCenter/AfterSaleDetail"], resolve);
|
||||||
|
const ApplyAfterSale = (resolve) =>
|
||||||
|
require(["@/pages/home/orderCenter/ApplyAfterSale"], resolve);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 会员中心
|
* 会员中心
|
||||||
*/
|
*/
|
||||||
const Profile = resolve => require(['@/pages/home/memberCenter/Profile'], resolve);
|
const Profile = (resolve) =>
|
||||||
const AccountSafe = resolve => require(['@/pages/home/memberCenter/AccountSafe'], resolve);
|
require(["@/pages/home/memberCenter/Profile"], resolve);
|
||||||
const ModifyPwd = resolve => require(['@/pages/home/memberCenter/ModifyPwd'], resolve);
|
const AccountSafe = (resolve) =>
|
||||||
const Favorites = resolve => require(['@/pages/home/memberCenter/Favorites'], resolve);
|
require(["@/pages/home/memberCenter/AccountSafe"], resolve);
|
||||||
const Distribution = resolve => require(['@/pages/home/memberCenter/Distribution'], resolve);
|
const ModifyPwd = (resolve) =>
|
||||||
const CommentList = resolve => require(['@/pages/home/memberCenter/CommentList'], resolve); // 评价列表
|
require(["@/pages/home/memberCenter/ModifyPwd"], resolve);
|
||||||
const AddEval = resolve => require(['@/pages/home/memberCenter/evaluation/AddEval'], resolve); // 添加评价
|
const Favorites = (resolve) =>
|
||||||
const EvalDetail = resolve => require(['@/pages/home/memberCenter/evaluation/EvalDetail'], resolve);
|
require(["@/pages/home/memberCenter/Favorites"], resolve);
|
||||||
const ComplainList = resolve => require(['@/pages/home/memberCenter/ComplainList'], resolve);
|
const Distribution = (resolve) =>
|
||||||
const ComplainDetail = resolve => require(['@/pages/home/memberCenter/ComplainDetail'], resolve);
|
require(["@/pages/home/memberCenter/Distribution"], resolve);
|
||||||
const Point = resolve => require(['@/pages/home/memberCenter/Point'], resolve);
|
const CommentList = (resolve) =>
|
||||||
const MsgList = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgList'], resolve);
|
require(["@/pages/home/memberCenter/CommentList"], resolve); // 评价列表
|
||||||
const MsgDetail = resolve => require(['@/pages/home/memberCenter/memberMsg/MsgDetail'], resolve);
|
const AddEval = (resolve) =>
|
||||||
|
require(["@/pages/home/memberCenter/evaluation/AddEval"], resolve); // 添加评价
|
||||||
|
const EvalDetail = (resolve) =>
|
||||||
|
require(["@/pages/home/memberCenter/evaluation/EvalDetail"], resolve);
|
||||||
|
const ComplainList = (resolve) =>
|
||||||
|
require(["@/pages/home/memberCenter/ComplainList"], resolve);
|
||||||
|
const ComplainDetail = (resolve) =>
|
||||||
|
require(["@/pages/home/memberCenter/ComplainDetail"], resolve);
|
||||||
|
const Point = (resolve) =>
|
||||||
|
require(["@/pages/home/memberCenter/Point"], resolve);
|
||||||
|
const MsgList = (resolve) =>
|
||||||
|
require(["@/pages/home/memberCenter/memberMsg/MsgList"], resolve);
|
||||||
|
const MsgDetail = (resolve) =>
|
||||||
|
require(["@/pages/home/memberCenter/memberMsg/MsgDetail"], resolve);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 会员中心
|
* 会员中心
|
||||||
* 账户中心
|
* 账户中心
|
||||||
* */
|
* */
|
||||||
const Coupons = resolve => require(['@/pages/home/userCenter/Coupons'], resolve);
|
const Coupons = (resolve) =>
|
||||||
const MyTracks = resolve => require(['@/pages/home/userCenter/MyTracks'], resolve);
|
require(["@/pages/home/userCenter/Coupons"], resolve);
|
||||||
const MoneyManagement = resolve => require(['@/pages/home/userCenter/MoneyManagement'], resolve);
|
const MyTracks = (resolve) =>
|
||||||
|
require(["@/pages/home/userCenter/MyTracks"], resolve);
|
||||||
|
const MoneyManagement = (resolve) =>
|
||||||
|
require(["@/pages/home/userCenter/MoneyManagement"], resolve);
|
||||||
|
|
||||||
const Home = resolve => require(['@/pages/user/Home'], resolve);
|
const Home = (resolve) => require(["@/pages/user/Home"], resolve);
|
||||||
|
|
||||||
const Merchant = resolve => require(['@/pages/Merchant'], resolve);
|
const Merchant = (resolve) => require(["@/pages/Merchant"], resolve);
|
||||||
const UserMain = resolve => require(['@/pages/home/Main'], resolve);
|
const UserMain = (resolve) => require(["@/pages/home/Main"], resolve);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺入驻
|
* 店铺入驻
|
||||||
*/
|
*/
|
||||||
const ShopEntry = resolve => require(['@/pages/shopEntry/ShopEntry'], resolve);
|
const ShopEntry = (resolve) =>
|
||||||
|
require(["@/pages/shopEntry/ShopEntry"], resolve);
|
||||||
|
|
||||||
Vue.use(Router);
|
Vue.use(Router);
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
mode: 'history',
|
mode: "history",
|
||||||
routes: [{
|
routes: [
|
||||||
path: '/', // 首页
|
{
|
||||||
name: 'Index',
|
path: "/", // 首页
|
||||||
component: Index
|
name: "Index",
|
||||||
|
component: Index,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login', // 登陆
|
path: "/login", // 登陆
|
||||||
name: 'login',
|
name: "login",
|
||||||
component: Login,
|
component: Login,
|
||||||
meta: {
|
meta: {
|
||||||
title: '登录'
|
title: "登录",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/SignUp', // 注册
|
path: "/SignUp", // 注册
|
||||||
name: 'SignUp',
|
name: "SignUp",
|
||||||
component: SignUp,
|
component: SignUp,
|
||||||
meta: {
|
meta: {
|
||||||
title: '注册'
|
title: "注册",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/forgetPassword', // 忘记密码
|
path: "/forgetPassword", // 忘记密码
|
||||||
name: 'forgetPassword',
|
name: "forgetPassword",
|
||||||
component: ForgetPassword,
|
component: ForgetPassword,
|
||||||
meta: {
|
meta: {
|
||||||
title: '忘记密码'
|
title: "忘记密码",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/goodsList', // 商品列表
|
path: "/goodsList", // 商品列表
|
||||||
name: 'GoodsList',
|
name: "GoodsList",
|
||||||
component: GoodsList
|
component: GoodsList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/goodsDetail', // 商品详情
|
path: "/goodsDetail", // 商品详情
|
||||||
name: 'GoodsDetail',
|
name: "GoodsDetail",
|
||||||
component: GoodsDetail,
|
component: GoodsDetail,
|
||||||
meta: {title: '商品详情'}
|
meta: { title: "商品详情" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/pointGoodsDetail', // 商品详情
|
path: "/pointGoodsDetail", // 商品详情
|
||||||
name: 'PointGoodsDetail',
|
name: "PointGoodsDetail",
|
||||||
component: PointGoodsDetail,
|
component: PointGoodsDetail,
|
||||||
meta: {title: '积分商品'}
|
meta: { title: "积分商品" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/shoppingCart', // 头部购物车
|
path: "/shoppingCart", // 头部购物车
|
||||||
name: 'ShoppingCart',
|
name: "ShoppingCart",
|
||||||
component: ShoppingCart
|
component: ShoppingCart,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/cart', // 购物车
|
path: "/cart", // 购物车
|
||||||
name: 'Cart',
|
name: "Cart",
|
||||||
component: Cart,
|
component: Cart,
|
||||||
meta: {title: '购物车'}
|
meta: { title: "购物车" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/pay', // 支付页面
|
path: "/pay", // 支付页面
|
||||||
name: 'Pay',
|
name: "Pay",
|
||||||
component: Pay,
|
component: Pay,
|
||||||
meta: {title: '订单结算'}
|
meta: { title: "订单结算" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/payMent',
|
path: "/payMent",
|
||||||
name: 'PayMent',
|
name: "PayMent",
|
||||||
component: PayMent
|
component: PayMent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/PointMall',
|
path: "/PointMall",
|
||||||
name: 'PointMall',
|
name: "PointMall",
|
||||||
component: PointMall,
|
component: PointMall,
|
||||||
meta: {title: '积分商城'}
|
meta: { title: "积分商城" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/qrpay', // 三方支付
|
path: "/qrpay", // 三方支付
|
||||||
name: 'qrpay',
|
name: "qrpay",
|
||||||
component: ThirdPay
|
component: ThirdPay,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/payDone', // 支付成功页面
|
path: "/payDone", // 支付成功页面
|
||||||
name: 'PayDone',
|
name: "PayDone",
|
||||||
component: PayDone
|
component: PayDone,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/article', // 文章页面
|
path: "/article", // 文章页面
|
||||||
name: 'article',
|
name: "article",
|
||||||
component: article,
|
component: article,
|
||||||
meta: {
|
meta: {
|
||||||
title: '帮助中心'
|
title: "帮助中心",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/shopEntry',
|
path: "/article/detail", // 文章页面
|
||||||
name: 'shopEntry',
|
name: "articleDetail",
|
||||||
|
component: articleDetail,
|
||||||
|
meta: {
|
||||||
|
title: "帮助中心",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/shopEntry",
|
||||||
|
name: "shopEntry",
|
||||||
component: ShopEntry,
|
component: ShopEntry,
|
||||||
meta: {
|
meta: {
|
||||||
title: '店铺入驻'
|
title: "店铺入驻",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/coupon',
|
path: "/coupon",
|
||||||
name: 'coupon',
|
name: "coupon",
|
||||||
component: Coupon,
|
component: Coupon,
|
||||||
meta: {
|
meta: {
|
||||||
title: '领券中心'
|
title: "领券中心",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/seckill',
|
path: "/seckill",
|
||||||
name: 'seckill',
|
name: "seckill",
|
||||||
component: seckill,
|
component: seckill,
|
||||||
meta: {
|
meta: {
|
||||||
title: '限时秒杀'
|
title: "限时秒杀",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/home', // 主页
|
path: "/home", // 主页
|
||||||
component: Home,
|
component: Home,
|
||||||
children: [{
|
children: [
|
||||||
path: '/',
|
{
|
||||||
name: 'Home',
|
path: "/",
|
||||||
|
name: "Home",
|
||||||
component: UserMain,
|
component: UserMain,
|
||||||
meta: {
|
meta: {
|
||||||
title: '会员中心'
|
title: "会员中心",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'MyTracks',
|
path: "MyTracks",
|
||||||
name: 'MyTracks',
|
name: "MyTracks",
|
||||||
component: MyTracks,
|
component: MyTracks,
|
||||||
meta: {title: '我的足迹'}
|
meta: { title: "我的足迹" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'MoneyManagement',
|
path: "MoneyManagement",
|
||||||
name: 'MoneyManagement',
|
name: "MoneyManagement",
|
||||||
component: MoneyManagement
|
component: MoneyManagement,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'Complain',
|
path: "Complain",
|
||||||
name: 'Complain',
|
name: "Complain",
|
||||||
component: Complain
|
component: Complain,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'Coupons',
|
path: "Coupons",
|
||||||
name: 'Coupons',
|
name: "Coupons",
|
||||||
component: Coupons
|
component: Coupons,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'CommentList',
|
path: "CommentList",
|
||||||
name: 'CommentList',
|
name: "CommentList",
|
||||||
component: CommentList,
|
component: CommentList,
|
||||||
mate: {title: '评价列表'}
|
mate: { title: "评价列表" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'AddEval',
|
path: "AddEval",
|
||||||
name: 'AddEval',
|
name: "AddEval",
|
||||||
component: AddEval,
|
component: AddEval,
|
||||||
mate: {title: '添加评价'}
|
mate: { title: "添加评价" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'EvalDetail',
|
path: "EvalDetail",
|
||||||
name: 'EvalDetail',
|
name: "EvalDetail",
|
||||||
component: EvalDetail,
|
component: EvalDetail,
|
||||||
mate: {title: '评价详情'}
|
mate: { title: "评价详情" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'ComplainList',
|
path: "ComplainList",
|
||||||
name: 'ComplainList',
|
name: "ComplainList",
|
||||||
component: ComplainList
|
component: ComplainList,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'ComplainDetail',
|
path: "ComplainDetail",
|
||||||
name: 'ComplainDetail',
|
name: "ComplainDetail",
|
||||||
component: ComplainDetail
|
component: ComplainDetail,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'AccountSafe',
|
path: "AccountSafe",
|
||||||
name: 'AccountSafe',
|
name: "AccountSafe",
|
||||||
component: AccountSafe
|
component: AccountSafe,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'ModifyPwd',
|
path: "ModifyPwd",
|
||||||
name: 'ModifyPwd',
|
name: "ModifyPwd",
|
||||||
component: ModifyPwd
|
component: ModifyPwd,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'Favorites',
|
path: "Favorites",
|
||||||
name: 'Favorites',
|
name: "Favorites",
|
||||||
component: Favorites,
|
component: Favorites,
|
||||||
meta: {title: '我的收藏'}
|
meta: { title: "我的收藏" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'Distribution',
|
path: "Distribution",
|
||||||
name: 'Distribution',
|
name: "Distribution",
|
||||||
component: Distribution,
|
component: Distribution,
|
||||||
meta: {title: '分销推荐'}
|
meta: { title: "分销推荐" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'Point',
|
path: "Point",
|
||||||
name: 'Point',
|
name: "Point",
|
||||||
component: Point,
|
component: Point,
|
||||||
meta: {title: '我的积分'}
|
meta: { title: "我的积分" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'Profile',
|
path: "Profile",
|
||||||
name: 'Profile',
|
name: "Profile",
|
||||||
component: Profile
|
component: Profile,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'AfterSale',
|
path: "AfterSale",
|
||||||
name: 'AfterSale',
|
name: "AfterSale",
|
||||||
component: AfterSale,
|
component: AfterSale,
|
||||||
meta: {title: '售后'}
|
meta: { title: "售后" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'ApplyAfterSale',
|
path: "ApplyAfterSale",
|
||||||
name: 'ApplyAfterSale',
|
name: "ApplyAfterSale",
|
||||||
component: ApplyAfterSale,
|
component: ApplyAfterSale,
|
||||||
meta: {title: '申请售后'}
|
meta: { title: "申请售后" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/home/MyAddress',
|
path: "/home/MyAddress",
|
||||||
name: 'MyAddress',
|
name: "MyAddress",
|
||||||
component: MyAddress,
|
component: MyAddress,
|
||||||
meta: {title: '收货地址'}
|
meta: { title: "收货地址" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'AddAddress',
|
path: "AddAddress",
|
||||||
name: 'AddAddress',
|
name: "AddAddress",
|
||||||
component: AddAddress
|
component: AddAddress,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'MsgList',
|
path: "MsgList",
|
||||||
name: 'MsgList',
|
name: "MsgList",
|
||||||
component: MsgList,
|
component: MsgList,
|
||||||
meta: {title: '我的消息'}
|
meta: { title: "我的消息" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'MsgDetail',
|
path: "MsgDetail",
|
||||||
name: 'MsgDetail',
|
name: "MsgDetail",
|
||||||
component: MsgDetail,
|
component: MsgDetail,
|
||||||
meta: {title: '我的消息'}
|
meta: { title: "我的消息" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'MyOrder',
|
path: "MyOrder",
|
||||||
name: 'MyOrder',
|
name: "MyOrder",
|
||||||
component: MyOrder,
|
component: MyOrder,
|
||||||
meta: {title: '我的订单'}
|
meta: { title: "我的订单" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'OrderDetail',
|
path: "OrderDetail",
|
||||||
name: 'OrderDetail',
|
name: "OrderDetail",
|
||||||
component: OrderDetail,
|
component: OrderDetail,
|
||||||
meta: {title: '订单详情'}
|
meta: { title: "订单详情" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'AfterSaleDetail',
|
path: "AfterSaleDetail",
|
||||||
name: 'AfterSaleDetail',
|
name: "AfterSaleDetail",
|
||||||
component: AfterSaleDetail,
|
component: AfterSaleDetail,
|
||||||
meta: {title: '售后详情'}
|
meta: { title: "售后详情" },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/merchant',
|
path: "/merchant",
|
||||||
name: 'Merchant',
|
name: "Merchant",
|
||||||
component: Merchant,
|
component: Merchant,
|
||||||
meta: {title: '店铺'}
|
meta: { title: "店铺" },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,5 +3,5 @@ module.exports = {
|
||||||
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
||||||
website: "https://www.pickmall.cn", //官网地址
|
website: "https://www.pickmall.cn", //官网地址
|
||||||
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
||||||
port:10003, //端口
|
port: 10003, //端口
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,5 +3,5 @@ module.exports = {
|
||||||
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
|
||||||
website: "https://www.pickmall.cn", //官网地址
|
website: "https://www.pickmall.cn", //官网地址
|
||||||
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
|
||||||
port:10002, //端口
|
port: 10002, //端口
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,11 @@
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="商品品牌" prop="brandId">
|
<FormItem label="商品品牌" prop="brandId">
|
||||||
<Select v-model="baseInfoForm.brandId" filterable style="width: 200px">
|
<Select
|
||||||
|
v-model="baseInfoForm.brandId"
|
||||||
|
filterable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
<Option
|
<Option
|
||||||
v-for="item in brandList"
|
v-for="item in brandList"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
|
@ -57,14 +61,25 @@
|
||||||
</div>
|
</div>
|
||||||
<h4>商品交易信息</h4>
|
<h4>商品交易信息</h4>
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<FormItem class="form-item-view-el" label="计量单位" prop="goodsUnit">
|
<FormItem
|
||||||
|
class="form-item-view-el"
|
||||||
|
label="计量单位"
|
||||||
|
prop="goodsUnit"
|
||||||
|
>
|
||||||
<Select v-model="baseInfoForm.goodsUnit" style="width: 100px">
|
<Select v-model="baseInfoForm.goodsUnit" style="width: 100px">
|
||||||
<Option v-for="(unit, i) in goodsUnitList" :key="i" :value="unit"
|
<Option
|
||||||
|
v-for="(unit, i) in goodsUnitList"
|
||||||
|
:key="i"
|
||||||
|
:value="unit"
|
||||||
>{{ unit }}
|
>{{ unit }}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem class="form-item-view-el" label="销售模式" prop="salesModel">
|
<FormItem
|
||||||
|
class="form-item-view-el"
|
||||||
|
label="销售模式"
|
||||||
|
prop="salesModel"
|
||||||
|
>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
type="button"
|
type="button"
|
||||||
v-if="baseInfoForm.goodsType != 'VIRTUAL_GOODS'"
|
v-if="baseInfoForm.goodsType != 'VIRTUAL_GOODS'"
|
||||||
|
@ -94,7 +109,10 @@
|
||||||
prop="goodsGalleryFiles"
|
prop="goodsGalleryFiles"
|
||||||
>
|
>
|
||||||
<div style="display: flex; flex-wrap: flex-start">
|
<div style="display: flex; flex-wrap: flex-start">
|
||||||
<vuedraggable :list="baseInfoForm.goodsGalleryFiles" :animation="200">
|
<vuedraggable
|
||||||
|
:list="baseInfoForm.goodsGalleryFiles"
|
||||||
|
:animation="200"
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
class="demo-upload-list"
|
class="demo-upload-list"
|
||||||
v-for="(item, __index) in baseInfoForm.goodsGalleryFiles"
|
v-for="(item, __index) in baseInfoForm.goodsGalleryFiles"
|
||||||
|
@ -163,12 +181,15 @@
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
slot="extra"
|
slot="extra"
|
||||||
@click="handleCloseSkuItem($index)"
|
@click="handleCloseSkuItem(item, $index)"
|
||||||
>
|
>
|
||||||
删除规格
|
删除规格
|
||||||
</Button>
|
</Button>
|
||||||
<div>
|
<Form :model="item" class="flex">
|
||||||
<FormItem label="规格名" class="sku-item-content-val flex">
|
<FormItem
|
||||||
|
label="规格名"
|
||||||
|
class="sku-item-content-val flex"
|
||||||
|
>
|
||||||
<AutoComplete
|
<AutoComplete
|
||||||
style="width: 150px"
|
style="width: 150px"
|
||||||
v-model="item.name"
|
v-model="item.name"
|
||||||
|
@ -176,11 +197,11 @@
|
||||||
placeholder="请输入规格项名称"
|
placeholder="请输入规格项名称"
|
||||||
:filter-method="filterMethod"
|
:filter-method="filterMethod"
|
||||||
:data="skuData"
|
:data="skuData"
|
||||||
@on-change="editSkuItem"
|
@on-change="handleSkuTitle($event, $index)"
|
||||||
>
|
>
|
||||||
</AutoComplete>
|
</AutoComplete>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</div>
|
</Form>
|
||||||
<div class="flex sku-val">
|
<div class="flex sku-val">
|
||||||
<Form :model="item" class="flex">
|
<Form :model="item" class="flex">
|
||||||
<!--规格值文本列表-->
|
<!--规格值文本列表-->
|
||||||
|
@ -200,7 +221,14 @@
|
||||||
:filter-method="filterMethod"
|
:filter-method="filterMethod"
|
||||||
:data="skuVal"
|
:data="skuVal"
|
||||||
@on-focus="changeSkuVals(item.name)"
|
@on-focus="changeSkuVals(item.name)"
|
||||||
@on-change="skuValueChange(val.value, $index, item)"
|
@on-change="
|
||||||
|
handleSkuValue(
|
||||||
|
val.value,
|
||||||
|
$index,
|
||||||
|
val,
|
||||||
|
index
|
||||||
|
)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
</AutoComplete>
|
</AutoComplete>
|
||||||
<Button
|
<Button
|
||||||
|
@ -215,7 +243,9 @@
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Button @click="addSpec($index, item)">添加规格值</Button>
|
<Button @click="addSpec($index, item)"
|
||||||
|
>添加规格值</Button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -233,9 +263,97 @@
|
||||||
规格详细
|
规格详细
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
|
<ul class="flex sku-ul">
|
||||||
|
<li
|
||||||
|
v-for="(item, index) in skuTableColumn"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
{{ item.title }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="mt_10 flex sku-editor"
|
||||||
|
v-for="(item, index) in skuTableData"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="(spec, specIndex) in skuTableColumn.filter(
|
||||||
|
(val) => {
|
||||||
|
return val.key;
|
||||||
|
}
|
||||||
|
)"
|
||||||
|
:key="specIndex"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
skuTableData[index][
|
||||||
|
spec.title || spec.key || spec.___key
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="
|
||||||
|
skuTableColumn.find((val) => {
|
||||||
|
return val.slot == 'weight';
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
clearable
|
||||||
|
:min="0"
|
||||||
|
v-model="item.weight"
|
||||||
|
placeholder="请输入重量"
|
||||||
|
@on-change="updateSkuTable(item, 'weight', index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Input
|
||||||
|
clearable
|
||||||
|
v-model="item.sn"
|
||||||
|
placeholder="请输入货号"
|
||||||
|
@on-change="updateSkuTable(item, 'sn', index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<InputNumber
|
||||||
|
clearable
|
||||||
|
class="input-number"
|
||||||
|
:min="0"
|
||||||
|
v-model="item.quantity"
|
||||||
|
placeholder="请输入库存"
|
||||||
|
@on-change="updateSkuTable(item, 'quantity', index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<InputNumber
|
||||||
|
clearable
|
||||||
|
class="input-number"
|
||||||
|
:min="0"
|
||||||
|
v-model="item.cost"
|
||||||
|
placeholder="请输入成本价"
|
||||||
|
@on-change="updateSkuTable(item, 'cost', index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<InputNumber
|
||||||
|
class="input-number"
|
||||||
|
clearable
|
||||||
|
:min="0"
|
||||||
|
v-model="item.price"
|
||||||
|
placeholder="请输入价格"
|
||||||
|
@on-change="updateSkuTable(item, 'price', index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button @click="editSkuPicture(item)"
|
||||||
|
>编辑图片</Button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- #TODO 此处有待优化 -->
|
<!-- #TODO 此处有待优化 -->
|
||||||
<Table
|
<!-- <Table
|
||||||
class="mt_10"
|
|
||||||
:columns="skuTableColumn"
|
:columns="skuTableColumn"
|
||||||
:data="skuTableData"
|
:data="skuTableData"
|
||||||
style="
|
style="
|
||||||
|
@ -291,6 +409,15 @@
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ row }" slot="images">
|
<template slot-scope="{ row }" slot="images">
|
||||||
<Button @click="editSkuPicture(row)">编辑图片</Button>
|
<Button @click="editSkuPicture(row)">编辑图片</Button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</Table> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Panel>
|
||||||
|
</Collapse>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
v-model="showSkuPicture"
|
v-model="showSkuPicture"
|
||||||
:styles="{ top: '30px' }"
|
:styles="{ top: '30px' }"
|
||||||
|
@ -349,18 +476,15 @@
|
||||||
</div>
|
</div>
|
||||||
</Upload>
|
</Upload>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
|
||||||
</Table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Panel>
|
|
||||||
</Collapse>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<h4>商品详情描述</h4>
|
<h4>商品详情描述</h4>
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<div class="tree-bar">
|
<div class="tree-bar">
|
||||||
<FormItem class="form-item-view-el" label="店内分类" prop="shopCategory">
|
<FormItem
|
||||||
|
class="form-item-view-el"
|
||||||
|
label="店内分类"
|
||||||
|
prop="shopCategory"
|
||||||
|
>
|
||||||
<Tree
|
<Tree
|
||||||
ref="tree"
|
ref="tree"
|
||||||
style="text-align: left"
|
style="text-align: left"
|
||||||
|
@ -375,14 +499,25 @@
|
||||||
<FormItem class="form-item-view-el" label="商品描述" prop="intro">
|
<FormItem class="form-item-view-el" label="商品描述" prop="intro">
|
||||||
<editor eid="intro" v-model="baseInfoForm.intro"></editor>
|
<editor eid="intro" v-model="baseInfoForm.intro"></editor>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem class="form-item-view-el" label="移动端描述" prop="skuList">
|
<FormItem
|
||||||
<editor eid="mobileIntro" v-model="baseInfoForm.mobileIntro"></editor>
|
class="form-item-view-el"
|
||||||
|
label="移动端描述"
|
||||||
|
prop="skuList"
|
||||||
|
>
|
||||||
|
<editor
|
||||||
|
eid="mobileIntro"
|
||||||
|
v-model="baseInfoForm.mobileIntro"
|
||||||
|
></editor>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="baseInfoForm.goodsType != 'VIRTUAL_GOODS'">
|
<div v-if="baseInfoForm.goodsType != 'VIRTUAL_GOODS'">
|
||||||
<h4>商品物流信息</h4>
|
<h4>商品物流信息</h4>
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<FormItem class="form-item-view-el" label="物流模板" prop="templateId">
|
<FormItem
|
||||||
|
class="form-item-view-el"
|
||||||
|
label="物流模板"
|
||||||
|
prop="templateId"
|
||||||
|
>
|
||||||
<Select v-model="baseInfoForm.templateId" style="width: 200px">
|
<Select v-model="baseInfoForm.templateId" style="width: 200px">
|
||||||
<Option
|
<Option
|
||||||
v-for="item in logisticsTemplate"
|
v-for="item in logisticsTemplate"
|
||||||
|
@ -395,7 +530,11 @@
|
||||||
</div>
|
</div>
|
||||||
<h4>其他信息</h4>
|
<h4>其他信息</h4>
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<FormItem class="form-item-view-el" label="商品发布" prop="release">
|
<FormItem
|
||||||
|
class="form-item-view-el"
|
||||||
|
label="商品发布"
|
||||||
|
prop="release"
|
||||||
|
>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
type="button"
|
type="button"
|
||||||
button-style="solid"
|
button-style="solid"
|
||||||
|
@ -409,7 +548,11 @@
|
||||||
</Radio>
|
</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem class="form-item-view-el" label="商品推荐" prop="skuList">
|
<FormItem
|
||||||
|
class="form-item-view-el"
|
||||||
|
label="商品推荐"
|
||||||
|
prop="skuList"
|
||||||
|
>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
type="button"
|
type="button"
|
||||||
button-style="solid"
|
button-style="solid"
|
||||||
|
@ -656,6 +799,7 @@ export default {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 选择参数
|
* 选择参数
|
||||||
|
@ -674,14 +818,15 @@ export default {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//赋予分组id、分组名称
|
//赋予分组id、分组名称
|
||||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId = paramsGroup.groupId;
|
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId =
|
||||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName = paramsGroup.groupName;
|
paramsGroup.groupId;
|
||||||
|
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName =
|
||||||
|
paramsGroup.groupName;
|
||||||
|
|
||||||
//参数详细为空,则赋予
|
//参数详细为空,则赋予
|
||||||
if (
|
if (
|
||||||
!this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[
|
!this.baseInfoForm.goodsParamsDTOList[groupIndex]
|
||||||
paramsIndex
|
.goodsParamsItemDTOList[paramsIndex]
|
||||||
]
|
|
||||||
) {
|
) {
|
||||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[
|
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[
|
||||||
paramsIndex
|
paramsIndex
|
||||||
|
@ -707,7 +852,8 @@ export default {
|
||||||
},
|
},
|
||||||
// 编辑sku图片
|
// 编辑sku图片
|
||||||
editSkuPicture(row) {
|
editSkuPicture(row) {
|
||||||
if (row.images && row.images.length > 0) {
|
console.log(row);
|
||||||
|
if (row.images && row.images.length) {
|
||||||
this.previewPicture = row.images[0].url;
|
this.previewPicture = row.images[0].url;
|
||||||
}
|
}
|
||||||
this.selectedSku = row;
|
this.selectedSku = row;
|
||||||
|
@ -724,7 +870,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 移除已选图片
|
// 移除已选图片
|
||||||
handleRemove(item, index) {
|
handleRemove(item, index) {
|
||||||
this.selectedSku.images = this.selectedSku.images.filter((i) => i.url !== item.url);
|
this.selectedSku.images = this.selectedSku.images.filter(
|
||||||
|
(i) => i.url !== item.url
|
||||||
|
);
|
||||||
if (this.selectedSku.images.length > 0 && index === 0) {
|
if (this.selectedSku.images.length > 0 && index === 0) {
|
||||||
this.previewPicture = this.selectedSku.images[0].url;
|
this.previewPicture = this.selectedSku.images[0].url;
|
||||||
} else if (this.selectedSku.images.length < 0) {
|
} else if (this.selectedSku.images.length < 0) {
|
||||||
|
@ -738,9 +886,8 @@ export default {
|
||||||
},
|
},
|
||||||
// 移除商品图片
|
// 移除商品图片
|
||||||
handleRemoveGoodsPicture(file) {
|
handleRemoveGoodsPicture(file) {
|
||||||
this.baseInfoForm.goodsGalleryFiles = this.baseInfoForm.goodsGalleryFiles.filter(
|
this.baseInfoForm.goodsGalleryFiles =
|
||||||
(i) => i.url !== file.url
|
this.baseInfoForm.goodsGalleryFiles.filter((i) => i.url !== file.url);
|
||||||
);
|
|
||||||
},
|
},
|
||||||
// 更新sku图片
|
// 更新sku图片
|
||||||
updateSkuPicture() {
|
updateSkuPicture() {
|
||||||
|
@ -762,7 +909,6 @@ export default {
|
||||||
},
|
},
|
||||||
// 商品图片上传成功
|
// 商品图片上传成功
|
||||||
handleSuccessGoodsPicture(res, file) {
|
handleSuccessGoodsPicture(res, file) {
|
||||||
console.log(res);
|
|
||||||
if (file.response) {
|
if (file.response) {
|
||||||
file.url = file.response.result;
|
file.url = file.response.result;
|
||||||
this.baseInfoForm.goodsGalleryFiles.push(file);
|
this.baseInfoForm.goodsGalleryFiles.push(file);
|
||||||
|
@ -795,7 +941,8 @@ export default {
|
||||||
// sku图片上传前钩子
|
// sku图片上传前钩子
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
const check =
|
const check =
|
||||||
this.selectedSku.images !== undefined && this.selectedSku.images.length > 5;
|
this.selectedSku.images !== undefined &&
|
||||||
|
this.selectedSku.images.length > 5;
|
||||||
if (check) {
|
if (check) {
|
||||||
this.$Notice.warning({ title: "图片数量不能大于五张" });
|
this.$Notice.warning({ title: "图片数量不能大于五张" });
|
||||||
return false;
|
return false;
|
||||||
|
@ -804,9 +951,11 @@ export default {
|
||||||
|
|
||||||
/** 查询商品品牌列表 */
|
/** 查询商品品牌列表 */
|
||||||
getGoodsBrandList() {
|
getGoodsBrandList() {
|
||||||
API_GOODS.getCategoryBrandListDataSeller(this.categoryId).then((response) => {
|
API_GOODS.getCategoryBrandListDataSeller(this.categoryId).then(
|
||||||
|
(response) => {
|
||||||
this.brandList = response;
|
this.brandList = response;
|
||||||
});
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 获取商品单位
|
// 获取商品单位
|
||||||
GET_GoodsUnit() {
|
GET_GoodsUnit() {
|
||||||
|
@ -860,12 +1009,11 @@ export default {
|
||||||
response.result.goodsGalleryList &&
|
response.result.goodsGalleryList &&
|
||||||
response.result.goodsGalleryList.length > 0
|
response.result.goodsGalleryList.length > 0
|
||||||
) {
|
) {
|
||||||
this.baseInfoForm.goodsGalleryFiles = response.result.goodsGalleryList.map(
|
this.baseInfoForm.goodsGalleryFiles =
|
||||||
(i) => {
|
response.result.goodsGalleryList.map((i) => {
|
||||||
let files = { url: i };
|
let files = { url: i };
|
||||||
return files;
|
return files;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Get_SkuInfoByCategory(this.categoryId);
|
this.Get_SkuInfoByCategory(this.categoryId);
|
||||||
|
@ -892,12 +1040,18 @@ export default {
|
||||||
cost: e.cost,
|
cost: e.cost,
|
||||||
quantity: e.quantity,
|
quantity: e.quantity,
|
||||||
weight: e.weight,
|
weight: e.weight,
|
||||||
|
// ___keys: [],
|
||||||
};
|
};
|
||||||
e.specList.forEach((u) => {
|
e.specList.forEach((u) => {
|
||||||
if (u.specName === "images") {
|
if (u.specName === "images") {
|
||||||
sku.images = u.specImage;
|
sku.images = u.specImage;
|
||||||
} else {
|
} else {
|
||||||
sku[u.specName] = u.specValue;
|
sku[u.specName] = u.specValue;
|
||||||
|
// 赋值keys标识符
|
||||||
|
// sku.___keys.push({
|
||||||
|
// key: u.specName,
|
||||||
|
// value: u.specValue,
|
||||||
|
// });
|
||||||
if (
|
if (
|
||||||
!skusInfo.some((s) => s.name === u.specName) &&
|
!skusInfo.some((s) => s.name === u.specName) &&
|
||||||
!this.ignoreColumn.includes(u.specName)
|
!this.ignoreColumn.includes(u.specName)
|
||||||
|
@ -910,6 +1064,7 @@ export default {
|
||||||
id: u.specValueId,
|
id: u.specValueId,
|
||||||
name: u.specName,
|
name: u.specName,
|
||||||
value: u.specValue || "",
|
value: u.specValue || "",
|
||||||
|
___key: u.specValue || "",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
@ -923,6 +1078,7 @@ export default {
|
||||||
id: u.specValueId,
|
id: u.specValueId,
|
||||||
name: u.specName,
|
name: u.specName,
|
||||||
value: u.specValue || "",
|
value: u.specValue || "",
|
||||||
|
___key: u.specValue || "",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!sk.spec_id && u.specName === "specId") {
|
if (!sk.spec_id && u.specName === "specId") {
|
||||||
|
@ -937,12 +1093,14 @@ export default {
|
||||||
});
|
});
|
||||||
this.skuInfo = skusInfo;
|
this.skuInfo = skusInfo;
|
||||||
this.renderTableData();
|
this.renderTableData();
|
||||||
|
|
||||||
this.skuTableData = skus;
|
this.skuTableData = skus;
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 根据当前分类id查询商品应包含的参数 */
|
/** 根据当前分类id查询商品应包含的参数 */
|
||||||
GET_GoodsParams() {
|
GET_GoodsParams() {
|
||||||
API_GOODS.getCategoryParamsListDataSeller(this.categoryId).then((response) => {
|
API_GOODS.getCategoryParamsListDataSeller(this.categoryId).then(
|
||||||
|
(response) => {
|
||||||
if (!response || response.length <= 0) {
|
if (!response || response.length <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -974,7 +1132,8 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.baseInfoForm.goodsParamsDTOList = [];
|
this.baseInfoForm.goodsParamsDTOList = [];
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
/** 添加规格项 */
|
/** 添加规格项 */
|
||||||
addSkuItem() {
|
addSkuItem() {
|
||||||
|
@ -985,18 +1144,11 @@ export default {
|
||||||
// 写入对象,下标,具体对象
|
// 写入对象,下标,具体对象
|
||||||
this.$set(this.skuInfo, this.skuInfo.length, {
|
this.$set(this.skuInfo, this.skuInfo.length, {
|
||||||
spec_values: [],
|
spec_values: [],
|
||||||
name: "规格名",
|
name: "规格名" + (this.skuInfo.length + 1),
|
||||||
});
|
});
|
||||||
this.renderTableData();
|
// this.renderTableData();
|
||||||
},
|
|
||||||
// 编辑规格名
|
|
||||||
editSkuItem() {
|
|
||||||
this.renderTableData();
|
|
||||||
},
|
|
||||||
// 编辑规格值
|
|
||||||
async skuValueChange(val, index, item) {
|
|
||||||
this.renderTableData();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取焦点时,取得规格名对应的规格值
|
// 获取焦点时,取得规格名对应的规格值
|
||||||
changeSkuVals(name) {
|
changeSkuVals(name) {
|
||||||
if (name) {
|
if (name) {
|
||||||
|
@ -1009,14 +1161,7 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 移除当前规格项 进行数据变化*/
|
|
||||||
handleCloseSkuItem($index) {
|
|
||||||
this.skuInfo.splice($index, 1);
|
|
||||||
/**
|
|
||||||
* 渲染规格详细表格
|
|
||||||
*/
|
|
||||||
this.renderTableData();
|
|
||||||
},
|
|
||||||
// 添加规格值的验证
|
// 添加规格值的验证
|
||||||
validateEmpty(params) {
|
validateEmpty(params) {
|
||||||
let flag = true;
|
let flag = true;
|
||||||
|
@ -1042,6 +1187,7 @@ export default {
|
||||||
this.$set(item.spec_values, item.spec_values.length, {
|
this.$set(item.spec_values, item.spec_values.length, {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
value: "",
|
value: "",
|
||||||
|
___key: "",
|
||||||
});
|
});
|
||||||
this.baseInfoForm.regeneratorSkuFlag = true;
|
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||||
/**
|
/**
|
||||||
|
@ -1051,27 +1197,99 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 移除当前规格值 */
|
/** 移除当前规格项 进行数据变化*/
|
||||||
handleCloseSkuValue(item, index) {
|
handleCloseSkuItem(item, $index) {
|
||||||
item.spec_values.splice(index, 1);
|
console.log(item);
|
||||||
|
let oldsSkuTableData = cloneObj(this.skuTableData);
|
||||||
|
oldsSkuTableData.forEach((sku, i) => {
|
||||||
|
if (sku[item.name]) {
|
||||||
|
delete sku[item.name];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.skuTableData = oldsSkuTableData;
|
||||||
|
|
||||||
|
this.skuTableColumn.forEach((column, i) => {
|
||||||
|
if (column.key == item.name) {
|
||||||
|
this.skuTableColumn.splice(i, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.skuInfo.splice($index, 1);
|
||||||
|
},
|
||||||
|
|
||||||
this.baseInfoForm.regeneratorSkuFlag = true;
|
|
||||||
/**
|
/**
|
||||||
* 渲染规格详细表格
|
* 移除当前规格值
|
||||||
|
* 找到一样规格的值进行移出
|
||||||
*/
|
*/
|
||||||
this.renderTableData();
|
handleCloseSkuValue(item, index) {
|
||||||
|
let oldsSkuTableData = cloneObj(this.skuTableData);
|
||||||
|
console.log("oldsSkuTableData", oldsSkuTableData);
|
||||||
|
this.skuTableData = oldsSkuTableData.filter((sku, i) => {
|
||||||
|
if (
|
||||||
|
sku[item.spec_values[index].name] != item.spec_values[index].value
|
||||||
|
) {
|
||||||
|
return sku;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
item.spec_values.splice(index, 1);
|
||||||
|
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑规格值
|
||||||
|
* 根据当前___keys的索引指定需修改的值
|
||||||
|
* @param {*} change 返回input更改的值
|
||||||
|
* @param {*} index 修改规格名的索引
|
||||||
|
* @param {*} item 当前规格值
|
||||||
|
*/
|
||||||
|
async handleSkuValue(change, index, item) {
|
||||||
|
this.skuTableData.map((sku, i) => {
|
||||||
|
// 指定key
|
||||||
|
if (sku[item.name] == item.___key) {
|
||||||
|
sku[item.name] = change;
|
||||||
|
console.log(1);
|
||||||
|
} else if (!item.___key && !sku[item.name]) {
|
||||||
|
// 如果为第一次没有值则进行赋值操作
|
||||||
|
|
||||||
|
sku[item.name] = change;
|
||||||
|
console.log("赋值", sku);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
item.___key = change;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑规格名
|
||||||
|
* 根据修改的规格名,将skuTableData的key(规格名)进行修改
|
||||||
|
* @param {*} change 返回input更改的值
|
||||||
|
* @param {*} index 修改规格名的索引
|
||||||
|
*/
|
||||||
|
handleSkuTitle(change, index) {
|
||||||
|
let oldSkuTableColumn = cloneObj(this.skuTableColumn);
|
||||||
|
this.skuTableData.forEach((sku, i) => {
|
||||||
|
Object.keys(sku).forEach((key) => {
|
||||||
|
if (oldSkuTableColumn[index].key == key) {
|
||||||
|
// 修改当前sku的规格名
|
||||||
|
sku = {
|
||||||
|
[change]: sku[key],
|
||||||
|
...sku,
|
||||||
|
};
|
||||||
|
delete sku[key];
|
||||||
|
|
||||||
|
this.skuTableData[i] = sku;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.skuTableColumn[index].key = change;
|
||||||
|
this.skuTableColumn[index].title = change;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 渲染table所需要的column 和 data
|
* 渲染table所需要的column 和 data
|
||||||
*/
|
*/
|
||||||
renderTableData() {
|
renderTableData() {
|
||||||
this.skuTableColumn = [];
|
|
||||||
this.skuTableData = [];
|
|
||||||
let pushData = [];
|
let pushData = [];
|
||||||
//渲染头部
|
//渲染头部
|
||||||
this.skuInfo.forEach((sku) => {
|
this.skuInfo.forEach((sku) => {
|
||||||
// !sku.name ? (sku.name = "规格名") : "";
|
|
||||||
//列名称
|
//列名称
|
||||||
let columnName = sku.name;
|
let columnName = sku.name;
|
||||||
pushData.push({
|
pushData.push({
|
||||||
|
@ -1112,14 +1330,20 @@ export default {
|
||||||
this.skuTableColumn = pushData;
|
this.skuTableColumn = pushData;
|
||||||
//克隆所有渲染的数据
|
//克隆所有渲染的数据
|
||||||
let cloneTemp = cloneObj(this.skuInfo);
|
let cloneTemp = cloneObj(this.skuInfo);
|
||||||
|
if (cloneTemp.length) {
|
||||||
|
cloneTemp.map((temp) => {
|
||||||
|
return {
|
||||||
|
[temp.name]: temp.value,
|
||||||
|
images: this.baseInfoForm.goodsGalleryFiles || [],
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//数据清空一次
|
|
||||||
this.$set(this, "skuTableData", []);
|
|
||||||
//判定 是否存在规格分组
|
//判定 是否存在规格分组
|
||||||
if (cloneTemp[0]) {
|
if (cloneTemp[0]) {
|
||||||
//存放最终结果
|
//存放最终结果
|
||||||
let result = [];
|
let result = [];
|
||||||
//循环选中的 sku 数据
|
// 循环出第一个规格名中的数据
|
||||||
cloneTemp[0].spec_values.forEach((specItem) => {
|
cloneTemp[0].spec_values.forEach((specItem) => {
|
||||||
result.push({
|
result.push({
|
||||||
[cloneTemp[0].name]: specItem.value,
|
[cloneTemp[0].name]: specItem.value,
|
||||||
|
@ -1128,8 +1352,14 @@ export default {
|
||||||
});
|
});
|
||||||
cloneTemp.splice(0, 1);
|
cloneTemp.splice(0, 1);
|
||||||
result = this.specIterator(result, cloneTemp);
|
result = this.specIterator(result, cloneTemp);
|
||||||
|
// 保存以前skuTable值
|
||||||
|
let oldData = cloneObj(this.skuTableData);
|
||||||
|
|
||||||
this.skuTableData = result;
|
this.skuTableData = result;
|
||||||
console.log(this.skuTableData);
|
// 赋值给最新的skuTable
|
||||||
|
this.skuTableData = Object.assign(this.skuTableData, oldData);
|
||||||
|
|
||||||
|
console.log(result, this.skuTableData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -1141,16 +1371,25 @@ export default {
|
||||||
//是否还可以循环
|
//是否还可以循环
|
||||||
if (cloneTemp.length > 0) {
|
if (cloneTemp.length > 0) {
|
||||||
let table = [];
|
let table = [];
|
||||||
result.forEach((resItem) => {
|
let newVal = []; // 用于存储新对象 并重置到最后一位
|
||||||
|
result.forEach((resItem, i) => {
|
||||||
cloneTemp[0].spec_values.forEach((valItem) => {
|
cloneTemp[0].spec_values.forEach((valItem) => {
|
||||||
let obj = cloneObj(resItem);
|
let obj = cloneObj(resItem);
|
||||||
obj[cloneTemp[0].name] = valItem.value;
|
obj[cloneTemp[0].name] = valItem.value;
|
||||||
|
|
||||||
|
if (valItem.value) {
|
||||||
table.push(obj);
|
table.push(obj);
|
||||||
|
} else {
|
||||||
|
newVal.push(obj);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
result = [];
|
result = [];
|
||||||
|
table.push(...newVal);
|
||||||
|
|
||||||
table.forEach((t) => {
|
table.forEach((t) => {
|
||||||
|
console.log("t", t);
|
||||||
|
|
||||||
result.push(t);
|
result.push(t);
|
||||||
});
|
});
|
||||||
//清除当前循环的分组
|
//清除当前循环的分组
|
||||||
|
@ -1160,6 +1399,7 @@ export default {
|
||||||
}
|
}
|
||||||
return this.specIterator(result, cloneTemp);
|
return this.specIterator(result, cloneTemp);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 根据分类id获取系统设置规格信息*/
|
/** 根据分类id获取系统设置规格信息*/
|
||||||
Get_SkuInfoByCategory(categoryId) {
|
Get_SkuInfoByCategory(categoryId) {
|
||||||
if (categoryId) {
|
if (categoryId) {
|
||||||
|
@ -1179,8 +1419,7 @@ export default {
|
||||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
||||||
},
|
},
|
||||||
/** 数据改变之后 抛出数据 */
|
/** 数据改变之后 抛出数据 */
|
||||||
updateSkuTable(row, item, type = "deafult") {
|
updateSkuTable(row, item, index) {
|
||||||
let index = row._index;
|
|
||||||
this.baseInfoForm.regeneratorSkuFlag = true;
|
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||||
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
|
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
|
||||||
if (item === "weight") {
|
if (item === "weight") {
|
||||||
|
@ -1218,6 +1457,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
console.log(index, item);
|
||||||
this.skuTableData[index][item] = row[item];
|
this.skuTableData[index][item] = row[item];
|
||||||
});
|
});
|
||||||
// this.$set(this.skuTableData,[index][item],row[item])
|
// this.$set(this.skuTableData,[index][item],row[item])
|
||||||
|
@ -1257,7 +1497,10 @@ export default {
|
||||||
this.$refs["baseInfoForm"].validate((valid) => {
|
this.$refs["baseInfoForm"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let submit = JSON.parse(JSON.stringify(this.baseInfoForm));
|
let submit = JSON.parse(JSON.stringify(this.baseInfoForm));
|
||||||
if (submit.goodsGalleryFiles && submit.goodsGalleryFiles.length <= 0) {
|
if (
|
||||||
|
submit.goodsGalleryFiles &&
|
||||||
|
submit.goodsGalleryFiles.length <= 0
|
||||||
|
) {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
this.$Message.error("请上传商品图片");
|
this.$Message.error("请上传商品图片");
|
||||||
return;
|
return;
|
||||||
|
@ -1284,13 +1527,17 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (submit.goodsGalleryFiles.length > 0) {
|
if (submit.goodsGalleryFiles.length > 0) {
|
||||||
submit.goodsGalleryList = submit.goodsGalleryFiles.map((i) => i.url);
|
submit.goodsGalleryList = submit.goodsGalleryFiles.map(
|
||||||
|
(i) => i.url
|
||||||
|
);
|
||||||
}
|
}
|
||||||
/** 参数校验 **/
|
/** 参数校验 **/
|
||||||
/* Object.keys(submit.goodsParamsList).forEach((item) => {
|
/* Object.keys(submit.goodsParamsList).forEach((item) => {
|
||||||
});*/
|
});*/
|
||||||
submit.release ? (submit.release = true) : (submit.release = false);
|
submit.release ? (submit.release = true) : (submit.release = false);
|
||||||
submit.recommend ? (submit.recommend = true) : (submit.recommend = false);
|
submit.recommend
|
||||||
|
? (submit.recommend = true)
|
||||||
|
: (submit.recommend = false);
|
||||||
|
|
||||||
if (this.goodsId) {
|
if (this.goodsId) {
|
||||||
API_GOODS.editGoods(this.goodsId, submit).then((res) => {
|
API_GOODS.editGoods(this.goodsId, submit).then((res) => {
|
||||||
|
@ -1323,9 +1570,8 @@ export default {
|
||||||
saveToDraft() {
|
saveToDraft() {
|
||||||
this.baseInfoForm.skuList = this.skuTableData;
|
this.baseInfoForm.skuList = this.skuTableData;
|
||||||
if (this.baseInfoForm.goodsGalleryFiles.length > 0) {
|
if (this.baseInfoForm.goodsGalleryFiles.length > 0) {
|
||||||
this.baseInfoForm.goodsGalleryList = this.baseInfoForm.goodsGalleryFiles.map(
|
this.baseInfoForm.goodsGalleryList =
|
||||||
(i) => i.url
|
this.baseInfoForm.goodsGalleryFiles.map((i) => i.url);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
this.baseInfoForm.categoryName = [];
|
this.baseInfoForm.categoryName = [];
|
||||||
this.baseInfoForm.saveType = "TEMPLATE";
|
this.baseInfoForm.saveType = "TEMPLATE";
|
||||||
|
@ -1415,4 +1661,30 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./addGoods.scss";
|
@import "./addGoods.scss";
|
||||||
|
|
||||||
|
.sku-ul {
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 0;
|
||||||
|
border-radius: 0.4em;
|
||||||
|
background: #f3f5f7;
|
||||||
|
> li {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.sku-editor {
|
||||||
|
> div {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.input-number {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,78 +1,177 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="search">
|
<div class="search">
|
||||||
|
|
||||||
<Card style="margin-left: 10px">
|
<Card style="margin-left: 10px">
|
||||||
<Tabs v-model="type" @on-click="handleClickType">
|
<Tabs v-model="type" @on-click="handleClickType">
|
||||||
<TabPane label="基本信息" name="INFO">
|
<TabPane label="基本信息" name="INFO">
|
||||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
<Form
|
||||||
|
ref="form"
|
||||||
|
:model="form"
|
||||||
|
:label-width="100"
|
||||||
|
:rules="formValidate"
|
||||||
|
>
|
||||||
<FormItem label="店铺名称">
|
<FormItem label="店铺名称">
|
||||||
<Input v-model="storeName" disabled clearable style="width: 20%"/>
|
<Input
|
||||||
|
v-model="storeName"
|
||||||
|
disabled
|
||||||
|
clearable
|
||||||
|
style="width: 20%"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="店铺地址" prop="address">
|
<FormItem label="店铺地址" prop="address">
|
||||||
<Input v-model="form.address" @on-focus="$refs.liliMap.showMap = true" clearable style="width: 20%"/>
|
<Input
|
||||||
|
v-model="form.address"
|
||||||
|
@on-focus="$refs.liliMap.showMap = true"
|
||||||
|
clearable
|
||||||
|
style="width: 20%"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="详细地址" prop="shopAddressDetail">
|
<FormItem label="详细地址" prop="shopAddressDetail">
|
||||||
<Input v-model="form.storeAddressDetail" clearable style="width: 20%" maxlength="50"/>
|
<Input
|
||||||
|
v-model="form.storeAddressDetail"
|
||||||
|
clearable
|
||||||
|
style="width: 20%"
|
||||||
|
maxlength="50"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="店铺LOGO:">
|
<FormItem label="店铺LOGO:">
|
||||||
<upload-pic-thumb v-model="form.storeLogo" :multiple="false"></upload-pic-thumb>
|
<upload-pic-thumb
|
||||||
|
v-model="form.storeLogo"
|
||||||
|
:multiple="false"
|
||||||
|
></upload-pic-thumb>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="店铺简介" prop="content" class="wangEditor">
|
<FormItem label="店铺简介" prop="content" class="wangEditor">
|
||||||
<Input type="textarea" :rows="8" v-model="form.storeDesc" style="width: 30%"></Input>
|
<Input
|
||||||
|
type="textarea"
|
||||||
|
:rows="8"
|
||||||
|
v-model="form.storeDesc"
|
||||||
|
style="width: 30%"
|
||||||
|
></Input>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<Form-item>
|
<Form-item>
|
||||||
<Button @click="handleSubmit" :loading="submitLoading" type="primary" style="margin-right:5px">修改
|
<Button
|
||||||
|
@click="handleSubmit"
|
||||||
|
:loading="submitLoading"
|
||||||
|
type="primary"
|
||||||
|
style="margin-right: 5px"
|
||||||
|
>修改
|
||||||
</Button>
|
</Button>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
</Form>
|
</Form>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane label="退货地址" name="REFUND_GOODS_ADDRESS">
|
<TabPane label="退货地址" name="REFUND_GOODS_ADDRESS">
|
||||||
<Form ref="addressForm" :model="addressForm" :label-width="100" :rules="afterFormValidate">
|
<Form
|
||||||
|
ref="addressForm"
|
||||||
|
:model="addressForm"
|
||||||
|
:label-width="100"
|
||||||
|
:rules="afterFormValidate"
|
||||||
|
>
|
||||||
<FormItem label="收货人" prop="salesConsigneeName">
|
<FormItem label="收货人" prop="salesConsigneeName">
|
||||||
<Input v-model="addressForm.salesConsigneeName" maxlength="11" clearable style="width: 20%"/>
|
<Input
|
||||||
|
v-model="addressForm.salesConsigneeName"
|
||||||
|
maxlength="11"
|
||||||
|
clearable
|
||||||
|
style="width: 20%"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="收货人电话" prop="salesConsigneeMobile">
|
<FormItem label="收货人电话" prop="salesConsigneeMobile">
|
||||||
<Input v-model="addressForm.salesConsigneeMobile" maxlength="11" style="width: 20%"/>
|
<Input
|
||||||
|
v-model="addressForm.salesConsigneeMobile"
|
||||||
|
maxlength="11"
|
||||||
|
style="width: 20%"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="售后地址">
|
<FormItem label="售后地址">
|
||||||
<Input v-model="region" disabled style="width: 20%" v-if="showRegion == false"/>
|
<Input
|
||||||
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary"
|
v-model="region"
|
||||||
style="margin-left:8px">修改
|
disabled
|
||||||
|
style="width: 20%"
|
||||||
|
v-if="showRegion == false"
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
v-if="showRegion == false"
|
||||||
|
@click="regionClick"
|
||||||
|
:loading="submitLoading"
|
||||||
|
type="primary"
|
||||||
|
style="margin-left: 8px"
|
||||||
|
>修改
|
||||||
</Button>
|
</Button>
|
||||||
<regionMap style="width: 20%" @selected="selectedRegion" v-if="showRegion == true"/>
|
<regionMap
|
||||||
|
style="width: 20%"
|
||||||
|
@selected="selectedRegion"
|
||||||
|
v-if="showRegion == true"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="详细地址" prop="salesConsigneeDetail">
|
<FormItem label="详细地址" prop="salesConsigneeDetail">
|
||||||
<Input v-model="addressForm.salesConsigneeDetail" clearable style="width: 20%" maxlength="50"/>
|
<Input
|
||||||
|
v-model="addressForm.salesConsigneeDetail"
|
||||||
|
clearable
|
||||||
|
style="width: 20%"
|
||||||
|
maxlength="50"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<Form-item>
|
<Form-item>
|
||||||
<Button @click="afterHandleSubmit" :loading="submitLoading" type="primary" style="margin-right:5px">修改
|
<Button
|
||||||
|
@click="afterHandleSubmit"
|
||||||
|
:loading="submitLoading"
|
||||||
|
type="primary"
|
||||||
|
style="margin-right: 5px"
|
||||||
|
>修改
|
||||||
</Button>
|
</Button>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
</Form>
|
</Form>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane label="库存预警" name="STOCK_WARNING">
|
<TabPane label="库存预警" name="STOCK_WARNING">
|
||||||
|
<Form
|
||||||
<Form ref="stockWarningForm" :model="stockWarningForm" :label-width="100" :rules="stockWarningFormValidate">
|
ref="stockWarningForm"
|
||||||
|
:model="stockWarningForm"
|
||||||
|
:label-width="100"
|
||||||
|
:rules="stockWarningFormValidate"
|
||||||
|
>
|
||||||
<FormItem label="预警数" prop="stockWarning">
|
<FormItem label="预警数" prop="stockWarning">
|
||||||
<Input v-model="stockWarningForm.stockWarning" type="number" maxlength="6" clearable style="width: 20%"/>
|
<InputNumber
|
||||||
|
:min="0"
|
||||||
|
:max="99999"
|
||||||
|
v-model="stockWarningForm.stockWarning"
|
||||||
|
type="number"
|
||||||
|
maxlength="6"
|
||||||
|
clearable
|
||||||
|
style="width: 20%"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<Form-item>
|
<Form-item>
|
||||||
<Button @click="stockWarningHandleSubmit" :loading="submitLoading" type="primary"
|
<Button
|
||||||
style="margin-right:5px">修改
|
@click="stockWarningHandleSubmit"
|
||||||
|
:loading="submitLoading"
|
||||||
|
type="primary"
|
||||||
|
style="margin-right: 5px"
|
||||||
|
>修改
|
||||||
</Button>
|
</Button>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
</Form>
|
</Form>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane label="客服设置" name="UDESK">
|
<TabPane label="客服设置" name="UDESK">
|
||||||
|
<Form
|
||||||
<Form ref="udeskForm" :model="udeskForm" :label-width="100" :rules="udeskFormValidate">
|
ref="udeskForm"
|
||||||
|
:model="udeskForm"
|
||||||
|
:label-width="100"
|
||||||
|
:rules="udeskFormValidate"
|
||||||
|
>
|
||||||
<FormItem label="坐席id" prop="merchantEuid">
|
<FormItem label="坐席id" prop="merchantEuid">
|
||||||
<Input v-model="udeskForm.merchantEuid" maxlength="30" clearable style="width: 20%"/>
|
<Input
|
||||||
|
v-model="udeskForm.merchantEuid"
|
||||||
|
maxlength="30"
|
||||||
|
clearable
|
||||||
|
style="width: 20%"
|
||||||
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<Form-item>
|
<Form-item>
|
||||||
<Button @click="merchantSubmit" :loading="submitLoading" type="primary"
|
<Button
|
||||||
style="margin-right:5px">修改
|
@click="merchantSubmit"
|
||||||
|
:loading="submitLoading"
|
||||||
|
type="primary"
|
||||||
|
style="margin-right: 5px"
|
||||||
|
>修改
|
||||||
</Button>
|
</Button>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -86,7 +185,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Shop from "@/api/shops";
|
import * as API_Shop from "@/api/shops";
|
||||||
import {validateMobile} from "@/libs/validate";
|
import { validateMobile } from "@/libs/validate";
|
||||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
||||||
import liliMap from "@/views/my-components/map/index";
|
import liliMap from "@/views/my-components/map/index";
|
||||||
import regionMap from "@/views/lili-components/region";
|
import regionMap from "@/views/lili-components/region";
|
||||||
|
@ -121,21 +220,21 @@ export default {
|
||||||
},
|
},
|
||||||
//im form
|
//im form
|
||||||
udeskForm: {
|
udeskForm: {
|
||||||
merchantEuid: ""
|
merchantEuid: "",
|
||||||
},
|
},
|
||||||
stockWarningFormValidate: {
|
stockWarningFormValidate: {
|
||||||
stockWarning: [
|
stockWarning: [
|
||||||
{required: true, message: "请输入库存预警数", trigger: "blur"},
|
{ required: true, message: "请输入库存预警数", trigger: "blur" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
udeskFormValidate: {
|
udeskFormValidate: {
|
||||||
merchantEuid: [
|
merchantEuid: [
|
||||||
{required: true, message: "请输入店铺坐席ID", trigger: "blur"},
|
{ required: true, message: "请输入店铺坐席ID", trigger: "blur" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
afterFormValidate: {
|
afterFormValidate: {
|
||||||
salesConsigneeMobile: [
|
salesConsigneeMobile: [
|
||||||
{required: true, message: "手机号不能为空", trigger: "blur"},
|
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||||
{
|
{
|
||||||
pattern: RegExp.mobile,
|
pattern: RegExp.mobile,
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
|
@ -143,10 +242,10 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
salesConsigneeName: [
|
salesConsigneeName: [
|
||||||
{required: true, message: "请输入收货人", trigger: "blur"},
|
{ required: true, message: "请输入收货人", trigger: "blur" },
|
||||||
],
|
],
|
||||||
salesConsigneeDetail: [
|
salesConsigneeDetail: [
|
||||||
{required: true, message: "请输入详细地址", trigger: "blur"},
|
{ required: true, message: "请输入详细地址", trigger: "blur" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
|
@ -272,7 +371,6 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
merchantSubmit() {
|
merchantSubmit() {
|
||||||
|
|
||||||
this.$refs.udeskForm.validate((valid) => {
|
this.$refs.udeskForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.submitLoading = true;
|
this.submitLoading = true;
|
||||||
|
@ -339,7 +437,7 @@ export default {
|
||||||
this.$set(this.form, "address", item.addr);
|
this.$set(this.form, "address", item.addr);
|
||||||
this.form.storeAddressPath = item.addr;
|
this.form.storeAddressPath = item.addr;
|
||||||
this.form.storeAddressIdPath = item.addrId;
|
this.form.storeAddressIdPath = item.addrId;
|
||||||
this.form.storeCenter = item.position.lng + "," + item.position.lat
|
this.form.storeCenter = item.position.lng + "," + item.position.lat;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
Loading…
Reference in New Issue