Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui into fengtianyangyang

master
paulGao 2022-02-11 16:44:27 +08:00
commit 61a9110c51
7 changed files with 983 additions and 486 deletions

View File

@ -8,5 +8,5 @@ module.exports = {
icpMessage: "京ICP备20009696号-1", //icp备案
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
port:10000, //端口
port: 10000, //端口
};

View File

@ -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>

View File

@ -1,344 +1,383 @@
import Vue from 'vue';
import Router from 'vue-router';
import Index from '@/pages/Index';
const Login = resolve => require(['@/pages/Login'], resolve);
const SignUp = resolve => require(['@/pages/SignUp'], resolve);
const ForgetPassword = resolve => require(['@/pages/ForgetPassword'], resolve);
const GoodsList = resolve => require(['@/pages/GoodsList'], resolve);
const GoodsDetail = resolve => require(['@/pages/GoodsDetail'], resolve);
const PointGoodsDetail = resolve => require(['@/pages/promotion/PointGoodsDetail'], resolve);
const ShoppingCart = resolve => require(['@/pages/ShoppingCart'], resolve);
const Cart = resolve => require(['@/pages/Cart'], resolve);
const Pay = resolve => require(['@/pages/payment/Pay'], resolve);
const PayDone = resolve => require(['@/pages/payment/PayDone'], resolve);
const PayMent = resolve => require(['@/pages/payment/PayMent'], resolve);
const ThirdPay = resolve => require(['@/pages/payment/ThirdPay'], resolve);
const Coupon = resolve => require(['@/pages/CouponCenter'], resolve);
const seckill = resolve => require(['@/pages/promotion/seckill'], resolve);
const article = resolve => require(['@/pages/article/index'], resolve);
const PointMall = resolve => require(['@/pages/promotion/PointMall'], resolve);
import Vue from "vue";
import Router from "vue-router";
import Index from "@/pages/Index";
const Login = (resolve) => require(["@/pages/Login"], resolve);
const SignUp = (resolve) => require(["@/pages/SignUp"], resolve);
const ForgetPassword = (resolve) =>
require(["@/pages/ForgetPassword"], resolve);
const GoodsList = (resolve) => require(["@/pages/GoodsList"], resolve);
const GoodsDetail = (resolve) => require(["@/pages/GoodsDetail"], resolve);
const PointGoodsDetail = (resolve) =>
require(["@/pages/promotion/PointGoodsDetail"], resolve);
const ShoppingCart = (resolve) => require(["@/pages/ShoppingCart"], resolve);
const Cart = (resolve) => require(["@/pages/Cart"], resolve);
const Pay = (resolve) => require(["@/pages/payment/Pay"], resolve);
const PayDone = (resolve) => require(["@/pages/payment/PayDone"], resolve);
const PayMent = (resolve) => require(["@/pages/payment/PayMent"], resolve);
const ThirdPay = (resolve) => require(["@/pages/payment/ThirdPay"], resolve);
const Coupon = (resolve) => require(["@/pages/CouponCenter"], 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 OrderDetail = resolve => require([`@/pages/home/orderCenter/OrderDetail`], resolve);
const MyAddress = resolve => require(['@/pages/home/orderCenter/MyAddress'], resolve);
const AddAddress = 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 MyOrder = (resolve) =>
require([`@/pages/home/orderCenter/MyOrder`], resolve);
const OrderDetail = (resolve) =>
require([`@/pages/home/orderCenter/OrderDetail`], resolve);
const MyAddress = (resolve) =>
require(["@/pages/home/orderCenter/MyAddress"], resolve);
const AddAddress = (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 AccountSafe = resolve => require(['@/pages/home/memberCenter/AccountSafe'], resolve);
const ModifyPwd = resolve => require(['@/pages/home/memberCenter/ModifyPwd'], resolve);
const Favorites = resolve => require(['@/pages/home/memberCenter/Favorites'], resolve);
const Distribution = resolve => require(['@/pages/home/memberCenter/Distribution'], resolve);
const CommentList = resolve => require(['@/pages/home/memberCenter/CommentList'], 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 Profile = (resolve) =>
require(["@/pages/home/memberCenter/Profile"], resolve);
const AccountSafe = (resolve) =>
require(["@/pages/home/memberCenter/AccountSafe"], resolve);
const ModifyPwd = (resolve) =>
require(["@/pages/home/memberCenter/ModifyPwd"], resolve);
const Favorites = (resolve) =>
require(["@/pages/home/memberCenter/Favorites"], resolve);
const Distribution = (resolve) =>
require(["@/pages/home/memberCenter/Distribution"], resolve);
const CommentList = (resolve) =>
require(["@/pages/home/memberCenter/CommentList"], 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 MyTracks = resolve => require(['@/pages/home/userCenter/MyTracks'], resolve);
const MoneyManagement = resolve => require(['@/pages/home/userCenter/MoneyManagement'], resolve);
const Coupons = (resolve) =>
require(["@/pages/home/userCenter/Coupons"], 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 UserMain = resolve => require(['@/pages/home/Main'], resolve);
const Merchant = (resolve) => require(["@/pages/Merchant"], 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);
export default new Router({
mode: 'history',
routes: [{
path: '/', // 首页
name: 'Index',
component: Index
mode: "history",
routes: [
{
path: "/", // 首页
name: "Index",
component: Index,
},
{
path: '/login', // 登陆
name: 'login',
path: "/login", // 登陆
name: "login",
component: Login,
meta: {
title: '登录'
}
title: "登录",
},
},
{
path: '/SignUp', // 注册
name: 'SignUp',
path: "/SignUp", // 注册
name: "SignUp",
component: SignUp,
meta: {
title: '注册'
}
title: "注册",
},
},
{
path: '/forgetPassword', // 忘记密码
name: 'forgetPassword',
path: "/forgetPassword", // 忘记密码
name: "forgetPassword",
component: ForgetPassword,
meta: {
title: '忘记密码'
}
title: "忘记密码",
},
},
{
path: '/goodsList', // 商品列表
name: 'GoodsList',
component: GoodsList
path: "/goodsList", // 商品列表
name: "GoodsList",
component: GoodsList,
},
{
path: '/goodsDetail', // 商品详情
name: 'GoodsDetail',
path: "/goodsDetail", // 商品详情
name: "GoodsDetail",
component: GoodsDetail,
meta: {title: '商品详情'}
meta: { title: "商品详情" },
},
{
path: '/pointGoodsDetail', // 商品详情
name: 'PointGoodsDetail',
path: "/pointGoodsDetail", // 商品详情
name: "PointGoodsDetail",
component: PointGoodsDetail,
meta: {title: '积分商品'}
meta: { title: "积分商品" },
},
{
path: '/shoppingCart', // 头部购物车
name: 'ShoppingCart',
component: ShoppingCart
path: "/shoppingCart", // 头部购物车
name: "ShoppingCart",
component: ShoppingCart,
},
{
path: '/cart', // 购物车
name: 'Cart',
path: "/cart", // 购物车
name: "Cart",
component: Cart,
meta: {title: '购物车'}
meta: { title: "购物车" },
},
{
path: '/pay', // 支付页面
name: 'Pay',
path: "/pay", // 支付页面
name: "Pay",
component: Pay,
meta: {title: '订单结算'}
meta: { title: "订单结算" },
},
{
path: '/payMent',
name: 'PayMent',
component: PayMent
path: "/payMent",
name: "PayMent",
component: PayMent,
},
{
path: '/PointMall',
name: 'PointMall',
path: "/PointMall",
name: "PointMall",
component: PointMall,
meta: {title: '积分商城'}
meta: { title: "积分商城" },
},
{
path: '/qrpay', // 三方支付
name: 'qrpay',
component: ThirdPay
path: "/qrpay", // 三方支付
name: "qrpay",
component: ThirdPay,
},
{
path: '/payDone', // 支付成功页面
name: 'PayDone',
component: PayDone
path: "/payDone", // 支付成功页面
name: "PayDone",
component: PayDone,
},
{
path: '/article', // 文章页面
name: 'article',
path: "/article", // 文章页面
name: "article",
component: article,
meta: {
title: '帮助中心'
}
title: "帮助中心",
},
},
{
path: '/shopEntry',
name: 'shopEntry',
path: "/article/detail", // 文章页面
name: "articleDetail",
component: articleDetail,
meta: {
title: "帮助中心",
},
},
{
path: "/shopEntry",
name: "shopEntry",
component: ShopEntry,
meta: {
title: '店铺入驻'
}
title: "店铺入驻",
},
},
{
path: '/coupon',
name: 'coupon',
path: "/coupon",
name: "coupon",
component: Coupon,
meta: {
title: '领券中心'
}
title: "领券中心",
},
},
{
path: '/seckill',
name: 'seckill',
path: "/seckill",
name: "seckill",
component: seckill,
meta: {
title: '限时秒杀'
}
title: "限时秒杀",
},
},
{
path: '/home', // 主页
path: "/home", // 主页
component: Home,
children: [{
path: '/',
name: 'Home',
children: [
{
path: "/",
name: "Home",
component: UserMain,
meta: {
title: '会员中心'
}
title: "会员中心",
},
},
{
path: 'MyTracks',
name: 'MyTracks',
path: "MyTracks",
name: "MyTracks",
component: MyTracks,
meta: {title: '我的足迹'}
meta: { title: "我的足迹" },
},
{
path: 'MoneyManagement',
name: 'MoneyManagement',
component: MoneyManagement
path: "MoneyManagement",
name: "MoneyManagement",
component: MoneyManagement,
},
{
path: 'Complain',
name: 'Complain',
component: Complain
path: "Complain",
name: "Complain",
component: Complain,
},
{
path: 'Coupons',
name: 'Coupons',
component: Coupons
path: "Coupons",
name: "Coupons",
component: Coupons,
},
{
path: 'CommentList',
name: 'CommentList',
path: "CommentList",
name: "CommentList",
component: CommentList,
mate: {title: '评价列表'}
mate: { title: "评价列表" },
},
{
path: 'AddEval',
name: 'AddEval',
path: "AddEval",
name: "AddEval",
component: AddEval,
mate: {title: '添加评价'}
mate: { title: "添加评价" },
},
{
path: 'EvalDetail',
name: 'EvalDetail',
path: "EvalDetail",
name: "EvalDetail",
component: EvalDetail,
mate: {title: '评价详情'}
mate: { title: "评价详情" },
},
{
path: 'ComplainList',
name: 'ComplainList',
component: ComplainList
path: "ComplainList",
name: "ComplainList",
component: ComplainList,
},
{
path: 'ComplainDetail',
name: 'ComplainDetail',
component: ComplainDetail
path: "ComplainDetail",
name: "ComplainDetail",
component: ComplainDetail,
},
{
path: 'AccountSafe',
name: 'AccountSafe',
component: AccountSafe
path: "AccountSafe",
name: "AccountSafe",
component: AccountSafe,
},
{
path: 'ModifyPwd',
name: 'ModifyPwd',
component: ModifyPwd
path: "ModifyPwd",
name: "ModifyPwd",
component: ModifyPwd,
},
{
path: 'Favorites',
name: 'Favorites',
path: "Favorites",
name: "Favorites",
component: Favorites,
meta: {title: '我的收藏'}
meta: { title: "我的收藏" },
},
{
path: 'Distribution',
name: 'Distribution',
path: "Distribution",
name: "Distribution",
component: Distribution,
meta: {title: '分销推荐'}
meta: { title: "分销推荐" },
},
{
path: 'Point',
name: 'Point',
path: "Point",
name: "Point",
component: Point,
meta: {title: '我的积分'}
meta: { title: "我的积分" },
},
{
path: 'Profile',
name: 'Profile',
component: Profile
path: "Profile",
name: "Profile",
component: Profile,
},
{
path: 'AfterSale',
name: 'AfterSale',
path: "AfterSale",
name: "AfterSale",
component: AfterSale,
meta: {title: '售后'}
meta: { title: "售后" },
},
{
path: 'ApplyAfterSale',
name: 'ApplyAfterSale',
path: "ApplyAfterSale",
name: "ApplyAfterSale",
component: ApplyAfterSale,
meta: {title: '申请售后'}
meta: { title: "申请售后" },
},
{
path: '/home/MyAddress',
name: 'MyAddress',
path: "/home/MyAddress",
name: "MyAddress",
component: MyAddress,
meta: {title: '收货地址'}
meta: { title: "收货地址" },
},
{
path: 'AddAddress',
name: 'AddAddress',
component: AddAddress
path: "AddAddress",
name: "AddAddress",
component: AddAddress,
},
{
path: 'MsgList',
name: 'MsgList',
path: "MsgList",
name: "MsgList",
component: MsgList,
meta: {title: '我的消息'}
meta: { title: "我的消息" },
},
{
path: 'MsgDetail',
name: 'MsgDetail',
path: "MsgDetail",
name: "MsgDetail",
component: MsgDetail,
meta: {title: '我的消息'}
meta: { title: "我的消息" },
},
{
path: 'MyOrder',
name: 'MyOrder',
path: "MyOrder",
name: "MyOrder",
component: MyOrder,
meta: {title: '我的订单'}
meta: { title: "我的订单" },
},
{
path: 'OrderDetail',
name: 'OrderDetail',
path: "OrderDetail",
name: "OrderDetail",
component: OrderDetail,
meta: {title: '订单详情'}
meta: { title: "订单详情" },
},
{
path: 'AfterSaleDetail',
name: 'AfterSaleDetail',
path: "AfterSaleDetail",
name: "AfterSaleDetail",
component: AfterSaleDetail,
meta: {title: '售后详情'}
}
]
meta: { title: "售后详情" },
},
],
},
{
path: '/merchant',
name: 'Merchant',
path: "/merchant",
name: "Merchant",
component: Merchant,
meta: {title: '店铺'}
}
]
meta: { title: "店铺" },
},
],
});

View File

@ -3,5 +3,5 @@ module.exports = {
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
website: "https://www.pickmall.cn", //官网地址
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
port:10003, //端口
port: 10003, //端口
};

View File

@ -3,5 +3,5 @@ module.exports = {
aMapKey: "b440952723253aa9fe483e698057bf7d", //高德web端申请的api key
website: "https://www.pickmall.cn", //官网地址
enableCDN: true, //生产环境 是否启用cdn加载 vue等js
port:10002, //端口
port: 10002, //端口
};

View File

@ -45,7 +45,11 @@
/>
</FormItem>
<FormItem label="商品品牌" prop="brandId">
<Select v-model="baseInfoForm.brandId" filterable style="width: 200px">
<Select
v-model="baseInfoForm.brandId"
filterable
style="width: 200px"
>
<Option
v-for="item in brandList"
:value="item.id"
@ -57,14 +61,25 @@
</div>
<h4>商品交易信息</h4>
<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">
<Option v-for="(unit, i) in goodsUnitList" :key="i" :value="unit"
<Option
v-for="(unit, i) in goodsUnitList"
:key="i"
:value="unit"
>{{ unit }}
</Option>
</Select>
</FormItem>
<FormItem class="form-item-view-el" label="销售模式" prop="salesModel">
<FormItem
class="form-item-view-el"
label="销售模式"
prop="salesModel"
>
<RadioGroup
type="button"
v-if="baseInfoForm.goodsType != 'VIRTUAL_GOODS'"
@ -94,7 +109,10 @@
prop="goodsGalleryFiles"
>
<div style="display: flex; flex-wrap: flex-start">
<vuedraggable :list="baseInfoForm.goodsGalleryFiles" :animation="200">
<vuedraggable
:list="baseInfoForm.goodsGalleryFiles"
:animation="200"
>
<div
class="demo-upload-list"
v-for="(item, __index) in baseInfoForm.goodsGalleryFiles"
@ -163,12 +181,15 @@
<Button
type="primary"
slot="extra"
@click="handleCloseSkuItem($index)"
@click="handleCloseSkuItem(item, $index)"
>
删除规格
</Button>
<div>
<FormItem label="规格名" class="sku-item-content-val flex">
<Form :model="item" class="flex">
<FormItem
label="规格名"
class="sku-item-content-val flex"
>
<AutoComplete
style="width: 150px"
v-model="item.name"
@ -176,11 +197,11 @@
placeholder="请输入规格项名称"
:filter-method="filterMethod"
:data="skuData"
@on-change="editSkuItem"
@on-change="handleSkuTitle($event, $index)"
>
</AutoComplete>
</FormItem>
</div>
</Form>
<div class="flex sku-val">
<Form :model="item" class="flex">
<!--规格值文本列表-->
@ -200,7 +221,14 @@
:filter-method="filterMethod"
:data="skuVal"
@on-focus="changeSkuVals(item.name)"
@on-change="skuValueChange(val.value, $index, item)"
@on-change="
handleSkuValue(
val.value,
$index,
val,
index
)
"
>
</AutoComplete>
<Button
@ -215,7 +243,9 @@
</Form>
</div>
<div>
<Button @click="addSpec($index, item)">添加规格值</Button>
<Button @click="addSpec($index, item)"
>添加规格值</Button
>
</div>
</Card>
</div>
@ -233,9 +263,97 @@
规格详细
<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 此处有待优化 -->
<Table
class="mt_10"
<!-- <Table
:columns="skuTableColumn"
:data="skuTableData"
style="
@ -291,6 +409,15 @@
</template>
<template slot-scope="{ row }" slot="images">
<Button @click="editSkuPicture(row)"></Button>
</template>
</Table> -->
</div>
</div>
</Panel>
</Collapse>
</div>
<Modal
v-model="showSkuPicture"
:styles="{ top: '30px' }"
@ -349,18 +476,15 @@
</div>
</Upload>
</Modal>
</template>
</Table>
</div>
</div>
</Panel>
</Collapse>
</div>
</div>
<h4>商品详情描述</h4>
<div class="form-item-view">
<div class="tree-bar">
<FormItem class="form-item-view-el" label="店内分类" prop="shopCategory">
<FormItem
class="form-item-view-el"
label="店内分类"
prop="shopCategory"
>
<Tree
ref="tree"
style="text-align: left"
@ -375,14 +499,25 @@
<FormItem class="form-item-view-el" label="商品描述" prop="intro">
<editor eid="intro" v-model="baseInfoForm.intro"></editor>
</FormItem>
<FormItem class="form-item-view-el" label="移动端描述" prop="skuList">
<editor eid="mobileIntro" v-model="baseInfoForm.mobileIntro"></editor>
<FormItem
class="form-item-view-el"
label="移动端描述"
prop="skuList"
>
<editor
eid="mobileIntro"
v-model="baseInfoForm.mobileIntro"
></editor>
</FormItem>
</div>
<div v-if="baseInfoForm.goodsType != 'VIRTUAL_GOODS'">
<h4>商品物流信息</h4>
<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">
<Option
v-for="item in logisticsTemplate"
@ -395,7 +530,11 @@
</div>
<h4>其他信息</h4>
<div class="form-item-view">
<FormItem class="form-item-view-el" label="商品发布" prop="release">
<FormItem
class="form-item-view-el"
label="商品发布"
prop="release"
>
<RadioGroup
type="button"
button-style="solid"
@ -409,7 +548,11 @@
</Radio>
</RadioGroup>
</FormItem>
<FormItem class="form-item-view-el" label="商品推荐" prop="skuList">
<FormItem
class="form-item-view-el"
label="商品推荐"
prop="skuList"
>
<RadioGroup
type="button"
button-style="solid"
@ -656,6 +799,7 @@ export default {
],
};
},
methods: {
/**
* 选择参数
@ -674,14 +818,15 @@ export default {
};
}
//id
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId = paramsGroup.groupId;
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName = paramsGroup.groupName;
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId =
paramsGroup.groupId;
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName =
paramsGroup.groupName;
//
if (
!this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[
paramsIndex
]
!this.baseInfoForm.goodsParamsDTOList[groupIndex]
.goodsParamsItemDTOList[paramsIndex]
) {
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[
paramsIndex
@ -707,7 +852,8 @@ export default {
},
// sku
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.selectedSku = row;
@ -724,7 +870,9 @@ export default {
},
//
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) {
this.previewPicture = this.selectedSku.images[0].url;
} else if (this.selectedSku.images.length < 0) {
@ -738,9 +886,8 @@ export default {
},
//
handleRemoveGoodsPicture(file) {
this.baseInfoForm.goodsGalleryFiles = this.baseInfoForm.goodsGalleryFiles.filter(
(i) => i.url !== file.url
);
this.baseInfoForm.goodsGalleryFiles =
this.baseInfoForm.goodsGalleryFiles.filter((i) => i.url !== file.url);
},
// sku
updateSkuPicture() {
@ -762,7 +909,6 @@ export default {
},
//
handleSuccessGoodsPicture(res, file) {
console.log(res);
if (file.response) {
file.url = file.response.result;
this.baseInfoForm.goodsGalleryFiles.push(file);
@ -795,7 +941,8 @@ export default {
// sku
handleBeforeUpload(file) {
const check =
this.selectedSku.images !== undefined && this.selectedSku.images.length > 5;
this.selectedSku.images !== undefined &&
this.selectedSku.images.length > 5;
if (check) {
this.$Notice.warning({ title: "图片数量不能大于五张" });
return false;
@ -804,9 +951,11 @@ export default {
/** 查询商品品牌列表 */
getGoodsBrandList() {
API_GOODS.getCategoryBrandListDataSeller(this.categoryId).then((response) => {
API_GOODS.getCategoryBrandListDataSeller(this.categoryId).then(
(response) => {
this.brandList = response;
});
}
);
},
//
GET_GoodsUnit() {
@ -860,12 +1009,11 @@ export default {
response.result.goodsGalleryList &&
response.result.goodsGalleryList.length > 0
) {
this.baseInfoForm.goodsGalleryFiles = response.result.goodsGalleryList.map(
(i) => {
this.baseInfoForm.goodsGalleryFiles =
response.result.goodsGalleryList.map((i) => {
let files = { url: i };
return files;
}
);
});
}
this.Get_SkuInfoByCategory(this.categoryId);
@ -892,12 +1040,18 @@ export default {
cost: e.cost,
quantity: e.quantity,
weight: e.weight,
// ___keys: [],
};
e.specList.forEach((u) => {
if (u.specName === "images") {
sku.images = u.specImage;
} else {
sku[u.specName] = u.specValue;
// keys
// sku.___keys.push({
// key: u.specName,
// value: u.specValue,
// });
if (
!skusInfo.some((s) => s.name === u.specName) &&
!this.ignoreColumn.includes(u.specName)
@ -910,6 +1064,7 @@ export default {
id: u.specValueId,
name: u.specName,
value: u.specValue || "",
___key: u.specValue || "",
},
],
});
@ -923,6 +1078,7 @@ export default {
id: u.specValueId,
name: u.specName,
value: u.specValue || "",
___key: u.specValue || "",
});
}
if (!sk.spec_id && u.specName === "specId") {
@ -937,12 +1093,14 @@ export default {
});
this.skuInfo = skusInfo;
this.renderTableData();
this.skuTableData = skus;
},
/** 根据当前分类id查询商品应包含的参数 */
GET_GoodsParams() {
API_GOODS.getCategoryParamsListDataSeller(this.categoryId).then((response) => {
API_GOODS.getCategoryParamsListDataSeller(this.categoryId).then(
(response) => {
if (!response || response.length <= 0) {
return;
}
@ -974,7 +1132,8 @@ export default {
} else {
this.baseInfoForm.goodsParamsDTOList = [];
}
});
}
);
},
/** 添加规格项 */
addSkuItem() {
@ -985,18 +1144,11 @@ export default {
//
this.$set(this.skuInfo, this.skuInfo.length, {
spec_values: [],
name: "规格名",
name: "规格名" + (this.skuInfo.length + 1),
});
this.renderTableData();
},
//
editSkuItem() {
this.renderTableData();
},
//
async skuValueChange(val, index, item) {
this.renderTableData();
// this.renderTableData();
},
//
changeSkuVals(name) {
if (name) {
@ -1009,14 +1161,7 @@ export default {
});
}
},
/** 移除当前规格项 进行数据变化*/
handleCloseSkuItem($index) {
this.skuInfo.splice($index, 1);
/**
* 渲染规格详细表格
*/
this.renderTableData();
},
//
validateEmpty(params) {
let flag = true;
@ -1042,6 +1187,7 @@ export default {
this.$set(item.spec_values, item.spec_values.length, {
name: item.name,
value: "",
___key: "",
});
this.baseInfoForm.regeneratorSkuFlag = true;
/**
@ -1051,27 +1197,99 @@ export default {
}
},
/** 移除当前规格值 */
handleCloseSkuValue(item, index) {
item.spec_values.splice(index, 1);
/** 移除当前规格项 进行数据变化*/
handleCloseSkuItem(item, $index) {
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
*/
renderTableData() {
this.skuTableColumn = [];
this.skuTableData = [];
let pushData = [];
//
this.skuInfo.forEach((sku) => {
// !sku.name ? (sku.name = "") : "";
//
let columnName = sku.name;
pushData.push({
@ -1112,14 +1330,20 @@ export default {
this.skuTableColumn = pushData;
//
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]) {
//
let result = [];
// sku
//
cloneTemp[0].spec_values.forEach((specItem) => {
result.push({
[cloneTemp[0].name]: specItem.value,
@ -1128,8 +1352,14 @@ export default {
});
cloneTemp.splice(0, 1);
result = this.specIterator(result, cloneTemp);
// skuTable
let oldData = cloneObj(this.skuTableData);
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) {
let table = [];
result.forEach((resItem) => {
let newVal = []; //
result.forEach((resItem, i) => {
cloneTemp[0].spec_values.forEach((valItem) => {
let obj = cloneObj(resItem);
obj[cloneTemp[0].name] = valItem.value;
if (valItem.value) {
table.push(obj);
} else {
newVal.push(obj);
}
});
});
result = [];
table.push(...newVal);
table.forEach((t) => {
console.log("t", t);
result.push(t);
});
//
@ -1160,6 +1399,7 @@ export default {
}
return this.specIterator(result, cloneTemp);
},
/** 根据分类id获取系统设置规格信息*/
Get_SkuInfoByCategory(categoryId) {
if (categoryId) {
@ -1179,8 +1419,7 @@ export default {
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
},
/** 数据改变之后 抛出数据 */
updateSkuTable(row, item, type = "deafult") {
let index = row._index;
updateSkuTable(row, item, index) {
this.baseInfoForm.regeneratorSkuFlag = true;
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
if (item === "weight") {
@ -1218,6 +1457,7 @@ export default {
}
}
this.$nextTick(() => {
console.log(index, item);
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) => {
if (valid) {
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.$Message.error("请上传商品图片");
return;
@ -1284,13 +1527,17 @@ export default {
}
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) => {
});*/
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) {
API_GOODS.editGoods(this.goodsId, submit).then((res) => {
@ -1323,9 +1570,8 @@ export default {
saveToDraft() {
this.baseInfoForm.skuList = this.skuTableData;
if (this.baseInfoForm.goodsGalleryFiles.length > 0) {
this.baseInfoForm.goodsGalleryList = this.baseInfoForm.goodsGalleryFiles.map(
(i) => i.url
);
this.baseInfoForm.goodsGalleryList =
this.baseInfoForm.goodsGalleryFiles.map((i) => i.url);
}
this.baseInfoForm.categoryName = [];
this.baseInfoForm.saveType = "TEMPLATE";
@ -1415,4 +1661,30 @@ export default {
</script>
<style lang="scss" scoped>
@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>

View File

@ -1,78 +1,177 @@
<template>
<div class="search">
<Card style="margin-left: 10px">
<Tabs v-model="type" @on-click="handleClickType">
<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="店铺名称">
<Input v-model="storeName" disabled clearable style="width: 20%"/>
<Input
v-model="storeName"
disabled
clearable
style="width: 20%"
/>
</FormItem>
<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 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 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 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>
<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>
</Form-item>
</Form>
</TabPane>
<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">
<Input v-model="addressForm.salesConsigneeName" maxlength="11" clearable style="width: 20%"/>
<Input
v-model="addressForm.salesConsigneeName"
maxlength="11"
clearable
style="width: 20%"
/>
</FormItem>
<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 label="售后地址">
<Input v-model="region" disabled style="width: 20%" v-if="showRegion == false"/>
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary"
style="margin-left:8px">修改
<Input
v-model="region"
disabled
style="width: 20%"
v-if="showRegion == false"
/>
<Button
v-if="showRegion == false"
@click="regionClick"
:loading="submitLoading"
type="primary"
style="margin-left: 8px"
>修改
</Button>
<regionMap style="width: 20%" @selected="selectedRegion" v-if="showRegion == true"/>
<regionMap
style="width: 20%"
@selected="selectedRegion"
v-if="showRegion == true"
/>
</FormItem>
<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>
<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>
</Form-item>
</Form>
</TabPane>
<TabPane label="库存预警" name="STOCK_WARNING">
<Form ref="stockWarningForm" :model="stockWarningForm" :label-width="100" :rules="stockWarningFormValidate">
<Form
ref="stockWarningForm"
:model="stockWarningForm"
:label-width="100"
:rules="stockWarningFormValidate"
>
<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>
<Form-item>
<Button @click="stockWarningHandleSubmit" :loading="submitLoading" type="primary"
style="margin-right:5px">修改
<Button
@click="stockWarningHandleSubmit"
:loading="submitLoading"
type="primary"
style="margin-right: 5px"
>修改
</Button>
</Form-item>
</Form>
</TabPane>
<TabPane label="客服设置" name="UDESK">
<Form ref="udeskForm" :model="udeskForm" :label-width="100" :rules="udeskFormValidate">
<Form
ref="udeskForm"
:model="udeskForm"
:label-width="100"
:rules="udeskFormValidate"
>
<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>
<Form-item>
<Button @click="merchantSubmit" :loading="submitLoading" type="primary"
style="margin-right:5px">修改
<Button
@click="merchantSubmit"
:loading="submitLoading"
type="primary"
style="margin-right: 5px"
>修改
</Button>
</Form-item>
</Form>
@ -86,7 +185,7 @@
<script>
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 liliMap from "@/views/my-components/map/index";
import regionMap from "@/views/lili-components/region";
@ -121,21 +220,21 @@ export default {
},
//im form
udeskForm: {
merchantEuid: ""
merchantEuid: "",
},
stockWarningFormValidate: {
stockWarning: [
{required: true, message: "请输入库存预警数", trigger: "blur"},
{ required: true, message: "请输入库存预警数", trigger: "blur" },
],
},
udeskFormValidate: {
merchantEuid: [
{required: true, message: "请输入店铺坐席ID", trigger: "blur"},
{ required: true, message: "请输入店铺坐席ID", trigger: "blur" },
],
},
afterFormValidate: {
salesConsigneeMobile: [
{required: true, message: "手机号不能为空", trigger: "blur"},
{ required: true, message: "手机号不能为空", trigger: "blur" },
{
pattern: RegExp.mobile,
trigger: "blur",
@ -143,10 +242,10 @@ export default {
},
],
salesConsigneeName: [
{required: true, message: "请输入收货人", trigger: "blur"},
{ required: true, message: "请输入收货人", trigger: "blur" },
],
salesConsigneeDetail: [
{required: true, message: "请输入详细地址", trigger: "blur"},
{ required: true, message: "请输入详细地址", trigger: "blur" },
],
},
form: {
@ -272,7 +371,6 @@ export default {
});
},
merchantSubmit() {
this.$refs.udeskForm.validate((valid) => {
if (valid) {
this.submitLoading = true;
@ -339,7 +437,7 @@ export default {
this.$set(this.form, "address", item.addr);
this.form.storeAddressPath = item.addr;
this.form.storeAddressIdPath = item.addrId;
this.form.storeCenter = item.position.lng + "," + item.position.lat
this.form.storeCenter = item.position.lng + "," + item.position.lat;
},
},
mounted() {