yeliang-king 2022-04-25 14:50:11 +08:00
commit 92aafe3031
25 changed files with 1361 additions and 570 deletions

View File

@ -101,7 +101,7 @@
> >
<span <span
class="item-desc-pintuan" class="item-desc-pintuan"
v-if="promotionMap['FULL_DISCOUNT'].fullRate" v-if="promotionMap['FULL_DISCOUNT'].fullRate && promotionMap['FULL_DISCOUNT'].fullRateFlag"
>{{ promotionMap["FULL_DISCOUNT"].fullMoney }}立享{{ >{{ promotionMap["FULL_DISCOUNT"].fullMoney }}立享{{
promotionMap["FULL_DISCOUNT"].fullRate promotionMap["FULL_DISCOUNT"].fullRate
}}</span }}</span

View File

@ -34,7 +34,9 @@
<div class="cart-goods"> <div class="cart-goods">
<div class="cart-goods-title"> <div class="cart-goods-title">
<div class="width_60"> <div class="width_60">
<Checkbox v-model="allChecked" @on-change="changeChecked(allChecked, 'all')" <Checkbox
v-model="allChecked"
@on-change="changeChecked(allChecked, 'all')"
>全选</Checkbox >全选</Checkbox
> >
</div> </div>
@ -77,7 +79,9 @@
v-for="(item, index) in shop.couponList" v-for="(item, index) in shop.couponList"
:key="index" :key="index"
> >
<span v-if="item.couponType === 'PRICE'">{{ item.price }}</span> <span v-if="item.couponType === 'PRICE'"
>{{ item.price }}</span
>
<span v-if="item.couponType === 'DISCOUNT'" <span v-if="item.couponType === 'DISCOUNT'"
>{{ item.couponDiscount }}</span >{{ item.couponDiscount }}</span
> >
@ -100,12 +104,16 @@
<div class="width_60"> <div class="width_60">
<Checkbox <Checkbox
v-model="goods.checked" v-model="goods.checked"
@on-change="changeChecked(goods.checked, 'goods', goods.goodsSku.id)" @on-change="
changeChecked(goods.checked, 'goods', goods.goodsSku.id)
"
></Checkbox> ></Checkbox>
</div> </div>
<div <div
class="goods-title" class="goods-title"
@click="goGoodsDetail(goods.goodsSku.id, goods.goodsSku.goodsId)" @click="
goGoodsDetail(goods.goodsSku.id, goods.goodsSku.goodsId)
"
> >
<img <img
:src=" :src="
@ -115,24 +123,34 @@
/> />
<div> <div>
<p>{{ goods.goodsSku.goodsName }}</p> <p>{{ goods.goodsSku.goodsName }}</p>
<template v-for="(promotion, promotionIndex) in goods.promotions"> <template
v-for="(promotion, promotionIndex) in goods.promotions"
>
<div <div
class="promotion" class="promotion"
:key="promotionIndex" :key="promotionIndex"
v-if="promotion.promotionType === 'SECKILL'" v-if="promotion.promotionType === 'SECKILL'"
> >
<span>秒杀</span> <span>秒杀</span>
<promotion :time="promotion.endTime" type="cart"></promotion> <promotion
:time="promotion.endTime"
type="cart"
></promotion>
</div> </div>
</template> </template>
<template v-for="(promotion, promotionIndex) in goods.promotions"> <template
v-for="(promotion, promotionIndex) in goods.promotions"
>
<div <div
class="promotion" class="promotion"
:key="promotionIndex" :key="promotionIndex"
v-if="promotion.promotionType === 'FULL_DISCOUNT'" v-if="promotion.promotionType === 'FULL_DISCOUNT'"
> >
<span>满优惠活动</span> <span>满优惠活动</span>
<promotion :time="promotion.endTime" type="cart"></promotion> <promotion
:time="promotion.endTime"
type="cart"
></promotion>
</div> </div>
</template> </template>
</div> </div>
@ -155,22 +173,27 @@
{{ goods.subTotal | unitPrice("¥") }} {{ goods.subTotal | unitPrice("¥") }}
</div> </div>
<div class="width_100"> <div class="width_100">
<span <Button
class="handle-btn"
v-if="!goods.errorMessage" v-if="!goods.errorMessage"
size="small"
type="primary"
@click="delGoods(goods.goodsSku.id)" @click="delGoods(goods.goodsSku.id)"
>删除</span >删除</Button
> >
<span <Button
class="handle-btn"
v-if="!goods.errorMessage" v-if="!goods.errorMessage"
size="small"
type="info"
@click="collectGoods(goods.goodsSku.id)" @click="collectGoods(goods.goodsSku.id)"
>收藏</span style="margin-left: 10px"
>收藏</Button
> >
</div> </div>
<div class="error-goods" v-if="goods.errorMessage"> <div class="error-goods" v-if="goods.errorMessage">
<div>{{ goods.errorMessage }}</div> <div style="margin-top: 20px">{{ goods.errorMessage }}</div>
<Button type="primary" @click="delGoods(goods.goodsSku.id)"></Button> <Button type="primary" @click="delGoods(goods.goodsSku.id)"
>删除</Button
>
</div> </div>
</div> </div>
</template> </template>
@ -179,13 +202,19 @@
<div class="cart-goods-footer"> <div class="cart-goods-footer">
<div> <div>
<div class="width_60"> <div class="width_60">
<Checkbox v-model="allChecked" @on-change="changeChecked(allChecked, 'all')" <Checkbox
v-model="allChecked"
@on-change="changeChecked(allChecked, 'all')"
>全选</Checkbox >全选</Checkbox
> >
</div> </div>
<div class="width_100 handle-btn" @click="delGoods()"></div> <div class="width_100 handle-btn" @click="delGoods()">
删除选中商品
</div>
<!-- <div class="width_100 handle-btn" @click="collectGoods"></div> --> <!-- <div class="width_100 handle-btn" @click="collectGoods"></div> -->
<div class="width_100 handle-btn" @click="clearCart"></div> <div class="width_100 handle-btn" @click="clearCart">
清空购物车
</div>
</div> </div>
<div> <div>
<div class="selected-count"> <div class="selected-count">
@ -193,7 +222,9 @@
>件商品 >件商品
</div> </div>
<div class="ml_20 save-price"> <div class="ml_20 save-price">
已节省<span>{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span> 已节省<span>{{
priceDetailDTO.discountPrice | unitPrice("¥")
}}</span>
</div> </div>
<div class="ml_20 total-price"> <div class="ml_20 total-price">
总价不含运费: 总价不含运费:

View File

@ -287,7 +287,7 @@ export default {
}, },
filterOrderStatus (status) { // filterOrderStatus (status) { //
const ob = this.orderStatusList.filter(e => { return e.status === status }); const ob = this.orderStatusList.filter(e => { return e.status === status });
return ob[0].name return ob && ob[0] ? ob[0].name : status
} }
} }
}; };

View File

@ -43,13 +43,20 @@
<div> <div>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
<Tag class="ml_10" v-if="item.isDefault" color="red"></Tag> <Tag class="ml_10" v-if="item.isDefault" color="red"></Tag>
<Tag class="ml_10" v-if="item.alias" color="warning">{{ item.alias }} </Tag> <Tag class="ml_10" v-if="item.alias" color="warning"
>{{ item.alias }}
</Tag>
</div> </div>
<div>{{ item.mobile }}</div> <div>{{ item.mobile }}</div>
<div>{{ item.consigneeAddressPath | unitAddress }} {{ item.detail }}</div> <div>
{{ item.consigneeAddressPath | unitAddress }} {{ item.detail }}
</div>
<div class="edit-btn" v-show="showEditBtn === index"> <div class="edit-btn" v-show="showEditBtn === index">
<span @click.stop="editAddress(item.id)">修改</span> <span @click.stop="editAddress(item.id)">修改</span>
<span class="ml_10" v-if="!item.isDefault" @click.stop="delAddress(item)" <span
class="ml_10"
v-if="!item.isDefault"
@click.stop="delAddress(item)"
>删除</span >删除</span
> >
</div> </div>
@ -80,45 +87,59 @@
<span>商品信息</span> <span>商品信息</span>
<span @click="$router.push('/cart')"></span> <span @click="$router.push('/cart')"></span>
</div> </div>
<div class="goods-msg" v-for="(shop, shopIndex) in goodsList" :key="shopIndex"> <div
<div class="shop-name"> class="goods-msg"
<span> v-for="(shop, shopIndex) in goodsList"
<span class="hover-color" @click="goShopPage(shop.storeId)">{{ :key="shopIndex"
shop.storeName >
}}</span <div v-if="shop.checked">
>&nbsp;&nbsp; <div class="shop-name">
</span> <span>
</div> <span class="hover-color" @click="goShopPage(shop.storeId)">{{
<div class="goods-list"> shop.storeName
<div }}</span
class="goods-item" >&nbsp;&nbsp;
v-for="(goods, goodsIndex) in shop.skuList"
:key="goodsIndex"
>
<span
class="hover-color"
@click="goGoodsDetail(goods.goodsSku.id, goods.goodsSku.goodsId)"
>
<img :src="goods.goodsSku.thumbnail" alt="" />
<span style="vertical-align: top">{{ goods.goodsSku.goodsName }}</span>
</span> </span>
<span class="goods-price">{{ goods.purchasePrice | unitPrice("¥") }}</span>
<span>x{{ goods.num }}</span>
<span>{{ goods.goodsSku.quantity > 0 ? "有货" : "无货" }}</span>
<span class="goods-price">{{ goods.subTotal | unitPrice("¥") }}</span>
</div> </div>
</div> <div class="goods-list">
<div class="order-mark"> <div
<Input class="goods-item"
type="textarea" v-for="(goods, goodsIndex) in shop.checkedSkuList"
maxlength="60" :key="goodsIndex"
v-model="shop.remark" >
show-word-limit <span
placeholder="订单备注" class="hover-color"
/> @click="
<span style="font-size: 12px; color: #999" goGoodsDetail(goods.goodsSku.id, goods.goodsSku.goodsId)
>提示请勿填写有关支付收货发票方面的信息</span "
> >
<img :src="goods.goodsSku.thumbnail" alt="" />
<span style="vertical-align: top">{{
goods.goodsSku.goodsName
}}</span>
</span>
<span class="goods-price">{{
goods.purchasePrice | unitPrice("¥")
}}</span>
<span>x{{ goods.num }}</span>
<span>{{ goods.goodsSku.quantity > 0 ? "有货" : "无货" }}</span>
<span class="goods-price">{{
goods.subTotal | unitPrice("¥")
}}</span>
</div>
</div>
<div class="order-mark">
<Input
type="textarea"
maxlength="60"
v-model="shop.remark"
show-word-limit
placeholder="订单备注"
/>
<span style="font-size: 12px; color: #999"
>提示请勿填写有关支付收货发票方面的信息</span
>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -146,11 +167,19 @@
</div> </div>
<div v-if="couponList.length === 0"></div> <div v-if="couponList.length === 0"></div>
<ul v-else class="coupon-list"> <ul v-else class="coupon-list">
<li v-for="(item, index) in couponList" class="coupon-item" :key="index"> <li
v-for="(item, index) in couponList"
class="coupon-item"
:key="index"
>
<div class="c-left"> <div class="c-left">
<div> <div>
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color" <span
><span class="price">{{ item.price | unitPrice }}</span></span v-if="item.couponType === 'PRICE'"
class="fontsize_12 global_color"
><span class="price">{{
item.price | unitPrice
}}</span></span
> >
<span <span
v-if="item.couponType === 'DISCOUNT'" v-if="item.couponType === 'DISCOUNT'"
@ -158,7 +187,9 @@
><span class="price">{{ item.discount }}</span ><span class="price">{{ item.discount }}</span
></span ></span
> >
<span class="describe">{{ item.consumeThreshold }}元可用</span> <span class="describe"
>{{ item.consumeThreshold }}元可用</span
>
</div> </div>
<p>使用范围{{ useScope(item.scopeType) }}</p> <p>使用范围{{ useScope(item.scopeType) }}</p>
<p>有效期{{ item.endTime }}</p> <p>有效期{{ item.endTime }}</p>
@ -225,9 +256,17 @@
</div> </div>
<BaseFooter></BaseFooter> <BaseFooter></BaseFooter>
<!-- 添加发票模态框 --> <!-- 添加发票模态框 -->
<invoice-modal ref="invModal" :invoiceData="invoiceData" @change="getInvMsg" /> <invoice-modal
ref="invModal"
:invoiceData="invoiceData"
@change="getInvMsg"
/>
<!-- 选择地址模态框 --> <!-- 选择地址模态框 -->
<address-manage ref="address" :id="addrId" @change="addrChange"></address-manage> <address-manage
ref="address"
:id="addrId"
@change="addrChange"
></address-manage>
</div> </div>
</template> </template>
@ -303,6 +342,15 @@ export default {
.then((res) => { .then((res) => {
this.$Spin.hide(); this.$Spin.hide();
if (res.success) { if (res.success) {
if (
!res.result.checkedSkuList ||
res.result.checkedSkuList.length === 0
) {
this.$router.push({
path: "/cart",
replace: true,
});
}
this.goodsList = res.result.cartList; this.goodsList = res.result.cartList;
this.priceDetailDTO = res.result.priceDetailDTO; this.priceDetailDTO = res.result.priceDetailDTO;
this.skuList = res.result.skuList; this.skuList = res.result.skuList;
@ -313,11 +361,19 @@ export default {
let notSupArea = res.result.notSupportFreight; let notSupArea = res.result.notSupportFreight;
this.selectedCoupon = {}; this.selectedCoupon = {};
if (res.result.platformCoupon) if (res.result.platformCoupon)
this.selectedCoupon[res.result.platformCoupon.memberCoupon.id] = res.result.platformCoupon; this.selectedCoupon[res.result.platformCoupon.memberCoupon.id] =
if (res.result.storeCoupons && Object.keys(res.result.storeCoupons)[0]) { res.result.platformCoupon;
let storeMemberCouponsId = Object.keys(res.result.storeCoupons)[0]; if (
let storeCouponId = res.result.storeCoupons[storeMemberCouponsId].memberCoupon.id; res.result.storeCoupons &&
this.selectedCoupon[storeCouponId] = res.result.storeCoupons[storeMemberCouponsId]; Object.keys(res.result.storeCoupons)[0]
) {
let storeMemberCouponsId = Object.keys(
res.result.storeCoupons
)[0];
let storeCouponId =
res.result.storeCoupons[storeMemberCouponsId].memberCoupon.id;
this.selectedCoupon[storeCouponId] =
res.result.storeCoupons[storeMemberCouponsId];
} }
if (notSupArea) { if (notSupArea) {
let content = []; let content = [];
@ -344,7 +400,10 @@ export default {
const couponKeys = Object.keys(this.selectedCoupon); const couponKeys = Object.keys(this.selectedCoupon);
if (couponKeys.length) { if (couponKeys.length) {
this.couponList.forEach((e) => { this.couponList.forEach((e) => {
if (this.selectedCoupon[e.id] && e.id === this.selectedCoupon[e.id].memberCoupon.id) { if (
this.selectedCoupon[e.id] &&
e.id === this.selectedCoupon[e.id].memberCoupon.id
) {
this.usedCouponId.push(e.id); this.usedCouponId.push(e.id);
} }
}); });

View File

@ -41,7 +41,7 @@ export const getPromotionGoods = (promotionId, params) => {
// 获取当前进行中的促销活动 // 获取当前进行中的促销活动
export const getAllPromotion = params => { export const getAllPromotion = params => {
return getRequest("/promotion/current", params); return getRequest("/promotion/promotion/current", params);
}; };
// 获取拼团数据 // 获取拼团数据

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

View File

@ -1,16 +1,24 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<Tabs :value="wap[0].title" class="tabs"> <Tabs :value="wap[0].title" class="tabs">
<TabPane :label="item.title" :name="item.title" @click="clickTag(item, i)" v-for="(item, i) in wap" :key="i"> <TabPane
<component ref="lili-component" :is="templateWay[item.name]" @selected=" :label="item.title"
(val) => { :name="item.title"
changed = val; @click="clickTag(item, i)"
} v-for="(item, i) in wap"
" /> :key="i"
>
<component
ref="lili-component"
:is="templateWay[item.name]"
@selected="
(val) => {
changed = val;
}
"
/>
</TabPane> </TabPane>
</Tabs> </Tabs>
</div> </div>
</template> </template>
<script> <script>
@ -27,7 +35,7 @@ export default {
changed: "", // changed: "", //
selected: 0, // selected: 0, //
selectedLink: "", // selectedLink: "", //
wap // tab wap, // tab
}; };
}, },
watch: { watch: {
@ -44,7 +52,9 @@ export default {
}); });
this.wap.forEach((item) => { this.wap.forEach((item) => {
item.selected = false; if (item) {
item.selected = false;
}
}); });
}, },
methods: {}, methods: {},

View File

@ -1,9 +1,14 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<div class="list"> <div class="list">
<div
<div class="list-item" @click="clickPromotion(item,index)" v-for="(item,index) in Object.keys(promotionList)" :key="index" :class="{active:selectedIndex == index}"> class="list-item"
{{ typeOption[item].title}} v-for="(item, index) in Object.keys(promotionList)"
:key="index"
@click="clickPromotion(item, index)"
:class="{ active: selectedIndex == index }"
>
{{ typeOption(item).title }}
</div> </div>
<!-- <div class="list-item" >暂无活动</div> --> <!-- <div class="list-item" >暂无活动</div> -->
@ -19,15 +24,30 @@
</div> --> </div> -->
<div class="tables"> <div class="tables">
<Table
height="350"
border
tooltip
:loading="loading"
:columns="activeColumns"
:data="showPromotionList"
></Table>
<Table height="350" border tooltip :loading="loading" :columns="activeColumns" :data="showPromotionList"></Table> <Page
@on-change="
<Page @on-change="(val) => {params.pageNumber = val; } " :current="params.pageNumber" :page-size="params.pageSize" class="mt_10" :total="Number(totals)" size="small" show-elevator /> (val) => {
params.pageNumber = val;
}
"
:current="params.pageNumber"
:page-size="params.pageSize"
class="mt_10"
:total="Number(totals)"
size="small"
show-elevator
/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@ -47,11 +67,13 @@ export default {
selectedIndex: 0, // selectedIndex: 0, //
promotions: "", //key promotions: "", //key
index: 999, // index: 999, //
params: { // params: {
//
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
}, },
pintuanColumns: [ // pintuanColumns: [
//
{ {
title: "活动标题", title: "活动标题",
key: "title", key: "title",
@ -89,7 +111,7 @@ export default {
"Button", "Button",
{ {
props: { props: {
type: this.index == params.index ? "primary" : "", // type: this.index == params.index ? "primary" : "",
size: "small", size: "small",
}, },
on: { on: {
@ -147,7 +169,7 @@ export default {
{ {
style: {}, style: {},
}, },
this.$options.filters.unitPrice(params.row.price, '¥') this.$options.filters.unitPrice(params.row.price, "¥")
); );
}, },
}, },
@ -181,13 +203,12 @@ export default {
"Button", "Button",
{ {
props: { props: {
type: this.index == params.index ? "primary" : "", // type: this.index == params.index ? "primary" : "",
size: "small", size: "small",
}, },
on: { on: {
click: () => { click: () => {
this.selectedPromotion(params); this.selectedPromotion(params);
console.log(this.index)
}, },
}, },
}, },
@ -233,7 +254,7 @@ export default {
"Button", "Button",
{ {
props: { props: {
type: this.index == params.index ? "primary" : "", // type: this.index == params.index ? "primary" : "",
size: "small", size: "small",
}, },
on: { on: {
@ -252,62 +273,6 @@ export default {
promotionData: "", // promotionData: "", //
showPromotionList: [], // showPromotionList: [], //
typeOption: { //
FULL_DISCOUNT: {
title: "满减",
methodsed: () => {
this.showPromotionList = [];
this.activeColumns = this.pintuanColumns;
this.params.promotionType = "FULL_DISCOUNT";
this.sortGoods("FULL_DISCOUNT");
},
},
PINTUAN: {
title: "拼团",
methodsed: (id) => {
this.showPromotionList = [];
this.activeColumns = this.pintuanColumns;
this.params.promotionType = "PINTUAN";
this.sortGoods("PINTUAN");
},
},
SECKILL: {
title: "秒杀",
methodsed: () => {
this.showPromotionList = [];
this.activeColumns = this.seckillColumns;
this.params.seckillId = this.promotionList["SECKILL"].id;
delete this.params.promotionType;
getPromotionSeckill(this.params).then((res) => {
delete this.params.seckillId;
this.showPromotionList = this.showPromotionList.concat(
res.result.records
);
this.totals = res.result.total;
console.log(this.totals);
});
},
},
COUPON: {
title: "优惠券",
methodsed: () => {
this.showPromotionList = [];
this.params.promotionType = "COUPON";
this.sortGoods("COUPON");
},
},
POINTS_GOODS: {
title: "积分商品",
methodsed: () => {
this.showPromotionList = [];
this.params.promotionType = "POINTS_GOODS";
this.sortGoods("POINTS_GOODS");
},
},
},
}; };
}, },
mounted() { mounted() {
@ -317,8 +282,8 @@ export default {
params: { params: {
handler() { handler() {
this.index = 999; this.index = 999;
this.typeOption[this.promotions] && this.typeOption(this.promotions) &&
this.typeOption[this.promotions].methodsed(); this.typeOption(this.promotions).methodsed();
}, },
deep: true, deep: true,
}, },
@ -326,30 +291,76 @@ export default {
methods: { methods: {
sortGoods(type) { sortGoods(type) {
this.loading = true; this.loading = false;
this.params.pageNumber - 1; this.params.pageNumber - 1;
getPromotionGoods(this.promotionList[type].id, this.params).then( this.showPromotionList = this.promotionList[type];
(res) => { },
this.loading = false; typeOption(type) {
if (res.result) { //
this.$nextTick(() => { switch (type) {
this.showPromotionList = this.showPromotionList.concat( case "FULL_DISCOUNT":
res.result.records return {
); title: "满减",
console.log(this.totals); methodsed: () => {
this.totals = res.result.total; this.showPromotionList = [];
}); this.activeColumns = this.pintuanColumns;
}
} this.sortGoods("FULL_DISCOUNT");
); },
};
case "PINTUAN":
return {
title: "拼团",
methodsed: (id) => {
this.showPromotionList = [];
this.activeColumns = this.pintuanColumns;
this.sortGoods("PINTUAN");
},
};
case "KANJIA":
return {
title: "砍价",
methodsed: (id) => {
this.showPromotionList = [];
this.activeColumns = this.pintuanColumns;
this.sortGoods("KANJIA");
},
};
case "SECKILL":
return {
title: "秒杀",
methodsed: () => {
this.showPromotionList = [];
this.activeColumns = this.seckillColumns;
this.sortGoods("SECKILL");
},
};
case "COUPON":
return {
title: "优惠券",
methodsed: () => {
this.showPromotionList = [];
this.sortGoods("COUPON");
},
};
case "POINTS_GOODS":
return {
title: "积分商品",
methodsed: () => {
this.showPromotionList = [];
this.sortGoods("POINTS_GOODS");
},
};
default:
return {};
}
}, },
// //
selectedPromotion(val) { selectedPromotion(val) {
console.log(val);
val.row.___type = "marketing"; val.row.___type = "marketing";
val.row.___promotion = this.promotions; val.row.___promotion = this.promotions;
this.$emit("selected", [val.row]); this.$emit("selected", [val.row]);
console.log([val.row]);
this.index = val.index; this.index = val.index;
}, },
@ -359,19 +370,22 @@ export default {
if (res.success) { if (res.success) {
this.loading = false; this.loading = false;
this.getPromotion(res); this.getPromotion(res);
this.clickPromotion(this.typeOption[Object.keys(res.result)[0]], 0); // this.clickPromotion(this.typeOption[Object.keys(res.result)[0]], 0);
} else { } else {
this.loading = false; this.loading = false;
} }
}, },
getPromotion(res) { getPromotion(res) {
this.promotionList = res.result; if (res.result) {
this.promotionList = res.result;
if (Object.keys(res.result).length) { this.typeOption(Object.keys(res.result)[0]).methodsed();
this.typeOption[Object.keys(res.result)[0]].methodsed(
this.promotionList[Object.keys(res.result)[0]].id
);
} }
// if (Object.keys(res.result).length) {
// this.typeOption[Object.keys(res.result)[0]].methodsed(
// this.promotionList[Object.keys(res.result)[0]].id
// );
// }
}, },
// //
@ -379,8 +393,8 @@ export default {
this.promotions = val; this.promotions = val;
this.selectedIndex = i; this.selectedIndex = i;
this.params.pageNumber = 1; this.params.pageNumber = 1;
this.typeOption[val] && this.typeOption(val) &&
this.typeOption[val].methodsed(this.promotionList[val].id); this.typeOption(val).methodsed(this.promotionList[val].id);
}, },
}, },
}; };

View File

@ -1,24 +1,33 @@
<template> <template>
<div> <div>
<Row :gutter="30"> <Row :gutter="30">
<Col span="6" v-for="(item,index) in linkList" :key="index" v-if="(item.title !== '拼团频道' && item.title !== '签到') || $route.name !== 'renovation'"> <Col
<div class="card" :class="{'active':selectedIndex == index}" @click="handleLink(item,index)"> span="4"
v-for="(item, index) in linkList"
:key="index"
v-if="
(item.title !== '拼团频道' && item.title !== '签到') ||
$route.name !== 'renovation'
"
>
<div
class="card"
:class="{ active: selectedIndex == index }"
@click="handleLink(item, index)"
>
<Icon size="24" :type="item.icon" /> <Icon size="24" :type="item.icon" />
<p>{{item.title}}</p> <p>{{ item.title }}</p>
</div> </div>
</Col> </Col>
<!-- 外部链接只有pc端跳转 --> <!-- 外部链接只有pc端跳转 -->
<Col span="6" v-if="$route.name === 'renovation'"> <Col span="4">
<div class="card" :class="{'active':selectedIndex == linkList.length}" @click="handleLink(linkItem,linkList.length)"> <div
<Poptip v-model="linkVisible"> class="card"
<Icon size="24" :type="linkItem.icon" /> :class="{ active: selectedIndex == linkList.length }"
<p>{{linkItem.title}}</p> @click="handleLink(linkItem, linkList.length)"
<div slot="title">链接地址</div> >
<div slot="content"> <Icon size="24" :type="linkItem.icon" />
<Input type="text" @keyup="handleLink(linkItem,linkList.length)" v-model="linkItem.url" placeholder="https://"></Input> <p>{{ linkItem.title }}</p>
</div>
</Poptip>
</div> </div>
</Col> </Col>
</Row> </Row>
@ -28,7 +37,8 @@
export default { export default {
data() { data() {
return { return {
linkList: [ // linkList: [
//
{ {
title: "首页", title: "首页",
icon: "md-home", icon: "md-home",
@ -89,13 +99,12 @@ export default {
icon: "ios-basket", icon: "ios-basket",
___type: "point", ___type: "point",
}, },
], ],
linkItem: { linkItem: {
title: "外部链接", title: "外部链接",
icon: "ios-link", icon: "ios-link",
___type: "link", ___type: "link",
url: '' url: "",
}, },
linkVisible: false, // linkVisible: false, //
selectedIndex: 9999999, // index selectedIndex: 9999999, // index
@ -103,14 +112,9 @@ export default {
}, },
methods: { methods: {
handleLink(val, index) { handleLink(val, index) {
val = {...val,___type:'other'} val = { ...val, ___type: "other" };
this.selectedIndex = index; this.selectedIndex = index;
if (index === this.linkList.length) { this.$emit("selected", [val]);
this.linkVisible = true
} else {
this.linkVisible = false
}
this.$emit("selected",[val])
}, },
}, },
}; };
@ -132,8 +136,8 @@ export default {
} }
border: 1px solid #ededed; border: 1px solid #ededed;
} }
.card:hover{ .card:hover {
background: #ededed; background: #ededed;
} }
.active { .active {
background: #ededed; background: #ededed;

View File

@ -3,7 +3,9 @@ import * as API_Other from "@/api/other";
// 获取楼层装修信息 // 获取楼层装修信息
export function initData(id) { export function initData(id) {
API_Other.getHomeData(id).then(res => { API_Other.getHomeData(id).then(res => {
debugger
homeData = res; homeData = res;
console.log(res)
}); });
} }
@ -11,9 +13,10 @@ export let homeData = {};
/** /**
* drawer:true 广告右侧打开抽屉中显示 * drawer:true 广告右侧打开抽屉中显示
* drawerPromotions:true 广告右侧打开抽屉中显示
* ad_drawer:true 活动魔方右侧显示 * ad_drawer:true 活动魔方右侧显示
* notAdd: true 没有添加按钮 * notAdd: true 没有添加按钮
* notLink: true 没有接功能 * notLink: true 没有接功能
* notImg: true 没有选择图片功能 * notImg: true 没有选择图片功能
* close:true 右侧关闭按钮 * close:true 右侧关闭按钮
*/ */
@ -81,14 +84,20 @@ export const modelData = [
type: "title", type: "title",
name: "标题栏", name: "标题栏",
img: "md-image", img: "md-image",
// notTitle:true,
notAdd: true, notAdd: true,
notLink: true,
notImg: true, notImg: true,
options: { options: {
list: [ list: [
{ {
title: "标题", title: "标题",
color: "#000000" color: "#fff",
title1: '领取',
color1: "#fff",
bk_color: "#FF0000",
textAlign: "center",
link: "",
url: ''
} }
] ]
} }
@ -469,22 +478,22 @@ export const modelData = [
{ {
title: "精选", title: "精选",
desc: "电子推荐", desc: "电子推荐",
___index:0, ___index: 0,
}, },
{ {
title: "实惠", title: "实惠",
desc: "便宜好货", desc: "便宜好货",
___index:1, ___index: 1,
}, },
{ {
title: "进口", title: "进口",
desc: "国际自营", desc: "国际自营",
___index:2, ___index: 2,
}, },
{ {
title: "推荐", title: "推荐",
desc: "喂奶推荐", desc: "喂奶推荐",
___index:3, ___index: 3,
} }
], ],
listWay: [ listWay: [
@ -494,7 +503,7 @@ export const modelData = [
title: title:
" 微软 (Microsoft) Xbox 无线控制器/手柄 湛蓝色 | 3.5mm耳机接口蓝牙连接 Xbox主机电脑平板通用", " 微软 (Microsoft) Xbox 无线控制器/手柄 湛蓝色 | 3.5mm耳机接口蓝牙连接 Xbox主机电脑平板通用",
type: "精选", type: "精选",
___index:0 ___index: 0
}, },
{ {
img: "https://i.loli.net/2020/12/05/c9mptI5Pg8qJ6ny.png", img: "https://i.loli.net/2020/12/05/c9mptI5Pg8qJ6ny.png",
@ -502,69 +511,106 @@ export const modelData = [
"宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米", "宏碁(acer) DP高清线1.2版 2K*4KDisplayPort公对公接线笔记本电脑显卡连接显示器视频线1.5米",
price: "190", price: "190",
type: "精选", type: "精选",
___index:0 ___index: 0
}, },
] ]
} }
] ]
} }
},
{
type: "notice",
name: "公告",
img: "md-image",
notAdd: false,
notLink: true,
notImg: true,
options: {
list: [
{
title: [{context: "这是一条公告"}],
color: "#666",
bk_color: "#FFF",
img: 'http://files.sxcfx.cn/upload/20220318/71e5d27aca82aeedf647052e1e4ceaaa.png'
}
]
}
},
{
type: "promotions",
name: "促销活动",
img: "md-image",
notAdd: true,
notLink: true,
notImg: true,
close: true,
options: {
list: []
}
},
{
notAdd: true,
notImg: true,
notLink: true,
drawerPromotions: true,
type: "promotionDetail",
promotionsType: "PINTUAN",
name: "拼团活动",
subBkColor: "#e1212b",
subName: "惊喜折扣",
subColor: "#fff",
img: "md-image",
options: {
list: []
}
},
{
notAdd: true,
notImg: true,
notLink: true,
drawerPromotions: true,
type: "promotionDetail",
promotionsType: "LIVE",
name: "直播活动",
subBkColor: "#e1212b",
subName: "优惠好价",
subColor: "#fff",
img: "md-image",
options: {
list: []
}
},
{
notAdd: true,
notImg: true,
notLink: true,
drawerPromotions: true,
type: "promotionDetail",
promotionsType: "SECKILL",
name: "秒杀活动",
subBkColor: "#e1212b",
subName: "x点场",
subColor: "#fff",
img: "md-image",
options: {
list: []
}
},
{
notAdd: true,
notImg: true,
notLink: true,
drawerPromotions: true,
type: "promotionDetail",
promotionsType: "KANJIA",
name: "砍价活动",
subBkColor: "#e1212b",
subName: "超值好物",
subColor: "#fff",
img: "md-image",
options: {
list: []
}
} }
// TODO 第一版本隐藏暂无此功能
// {
// notAdd: true,
// notImg: true,
// type: "joinGroup",
// name: "拼团活动",
// img: "md-image",
// options: {
// list: [
// {
// title: "测试拼团"
// }
// ]
// }
// },
// {
// notAdd: true,
// notImg: true,
// type: "integral",
// name: "积分活动",
// img: "md-image",
// options: {
// list: [
// {
// title: "测试积分"
// }
// ]
// }
// },
// {
// notAdd: true,
// notImg: true,
// type: "spike",
// name: "秒杀活动",
// img: "md-image",
// options: {
// list: [
// {
// title: "测试秒杀"
// }
// ]
// }
// },
// {
// notAdd: true,
// notImg: true,
// type: "group",
// name: "团购活动",
// img: "md-image",
// options: {
// list: [
// {
// title: "测试团购"
// }
// ]
// }
// }
]; ];

View File

@ -1,117 +1,163 @@
/deep/ .ivu-modal-mask,
/deep/ .ivu-modal-mask,.ivu-modal-wrap{ .ivu-modal-wrap {
z-index: 800; z-index: 800;
} }
.decorate-view-link{
font-size: 12px; .decorate-view-link {
margin: 0 4px; font-size: 12px;
color: #999; margin: 0 4px;
color: #999;
} }
.decorate-view-style { .decorate-view-style {
border: 1px solid #ededed; border: 1px solid #ededed;
background: #f7f7fa; background: #f7f7fa;
text-align: center; text-align: center;
width: 100%; width: 100%;
padding: 30px 0 0 0; padding: 30px 0 0 0;
margin-bottom: 20px; margin-bottom: 20px;
cursor: pointer; cursor: pointer;
> .select-style {
background: #ededed; >.select-style {
padding: 15px 0;
font-size: 15px;
}
}
.decorate-border {
border: 1px solid #ededed;
margin: 10px 0;
padding: 0 10px;
}
.drawer {
width: 100%;
display: flex;
flex-wrap: wrap;
> .drawer-item {
cursor: pointer;
border: 1px solid #ededed;
background: #f9f0ff;
width: 170px;
margin-right: 14px;
color: #9254de;
margin-bottom: 14px;
border-radius: 0.8em;
height: 60px;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
}
.hidden-input {
display: none;
}
.decorate {
padding: 0 20px;
height: calc(100vh - 120px);
overflow-y: auto;
padding-bottom: 120px;
}
.decorate-title {
height: 50px;
line-height: 50px;
font-weight: bold;
}
.decorate-list {
overflow: hidden;
}
.decorate-view {
display: flex;
margin: 20px 0;
align-items: center;
}
.decorate-item-box {
background: #fff;
padding: 10px;
border: 1px solid #ededed;
}
.decorate-item-title {
height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
line-height: 40px;
padding: 0 10px;
}
.decorate-view-title {
margin-right: 10px;
}
.decorate-item {
background: #ededed; background: #ededed;
border-top-left-radius: 0.4em; padding: 15px 0;
margin-bottom: 20px; font-size: 15px;
border-top-right-radius: 0.4em;
} }
.show-image { }
max-width: 50px;
} .decorate-border {
.tips { border: 1px solid #ededed;
font-size: 12px; margin: 10px 0;
color: #999; padding: 0 10px;
> span { }
color: $theme_color;
} .drawer {
} width: 100%;
.selectBtn { display: flex;
margin-left: 10px; flex-wrap: wrap;
}
.bing-goods-list { >.drawer-item {
cursor: pointer;
border: 1px solid #ededed;
background: #f9f0ff;
width: 170px;
margin-right: 14px;
color: #9254de;
margin-bottom: 14px;
border-radius: 0.8em;
height: 60px;
display: flex; display: flex;
> .bing-goods-item { align-items: center;
width: 50px; flex-direction: column;
height: 50px; justify-content: center;
> img { }
width: 100%; }
height: 100%;
display: block; .hidden-input {
} display: none;
}
.decorate {
padding: 0 20px;
height: calc(100vh - 120px);
overflow-y: auto;
padding-bottom: 120px;
}
.decorate-title {
height: 50px;
line-height: 50px;
font-weight: bold;
}
.decorate-list {
overflow: hidden;
}
.decorate-view {
display: flex;
margin: 12px 0;
align-items: center;
}
.decorate-item-box {
background: #fff;
padding: 10px;
border: 1px solid #ededed;
}
.decorate-item-title {
height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
line-height: 40px;
padding: 0 10px;
}
.decorate-view-title {
margin-right: 10px;
}
.decorate-item {
background: #ededed;
border-top-left-radius: 0.4em;
margin-bottom: 20px;
border-top-right-radius: 0.4em;
}
.show-image {
max-width: 50px;
}
.tips {
font-size: 12px;
color: #999;
>span {
color: $theme_color;
}
}
.selectBtn {
margin-left: 10px;
}
.bing-goods-list {
display: flex;
>.bing-goods-item {
width: 50px;
height: 50px;
>img {
width: 100%;
height: 100%;
display: block;
} }
} }
}
.align-text {
width: 30px;
height: 30px;
display: block;
}
.card-box {
display: flex;
}
.decorate-notice {
margin-top: 10px;
}
.card {}
.card:hover {
background: #ededed;
}
.active {
background: #ededed;
}

View File

@ -6,11 +6,24 @@
style="margin-left: 20px" style="margin-left: 20px"
size="small" size="small"
ghost ghost
v-if="res.type == 'tpl_ad_list' || res.type == 'tpl_activity_list' || res.drawer" v-if="
res.type == 'tpl_ad_list' ||
res.type == 'tpl_activity_list' ||
res.drawer
"
type="primary" type="primary"
@click="selectStyle()" @click="selectStyle()"
>选择风格</Button >选择风格</Button
> >
<Button
style="margin-left: 20px"
size="small"
ghost
v-if="res.type == 'promotions' || res.drawerPromotions"
type="primary"
@click="selectPromotions()"
>选择促销活动</Button
>
</div> </div>
<!-- 右侧显示抽屉 --> <!-- 右侧显示抽屉 -->
@ -29,17 +42,48 @@
</div> </div>
</Drawer> </Drawer>
<!-- 右侧显示抽屉 -->
<Drawer
title="选择促销活动(最多只能展示两个活动)"
:closable="false"
width="400"
v-model="promotionsFlag"
>
<div class="drawer">
<div
class="drawer-item"
@click="clickDrawer(item, index)"
v-for="(item, index) in modelData"
:key="index"
v-if="item.drawerPromotions"
>
<img src alt />
<span>{{ item.name }}</span>
</div>
</div>
</Drawer>
<!-- 卡片集合 --> <!-- 卡片集合 -->
<div <div
class="decorate-list" class="decorate-list"
v-if="(res.type != 'tpl_ad_list' && res.type != 'tpl_activity_list') || res.drawer" v-if="
(res.type != 'tpl_ad_list' &&
res.type != 'tpl_activity_list' &&
res.type != 'promotions') ||
res.drawer ||
res.drawerPromotions
"
> >
<div class="decorate-item" v-for="(item, index) in res.options.list" :key="index"> <div
class="decorate-item"
v-for="(item, index) in res.options.list"
:key="index"
>
<div class="decorate-item-title"> <div class="decorate-item-title">
<div>卡片</div> <div>卡片</div>
<Icon <Icon
@click="closeDecorate(index)" @click="closeDecorate(index)"
v-if="res.close" v-if="res.close || res.type == 'promotionDetail'"
size="20" size="20"
color="#e1251b" color="#e1251b"
type="md-close-circle" type="md-close-circle"
@ -77,14 +121,19 @@
title_item.___index == bindGoods.___index || title_item.___index == bindGoods.___index ||
title_item.title == bindGoods.type title_item.title == bindGoods.type
" "
v-for="(bindGoods, bindGoodsIndex) in res.options.list[0].listWay" v-for="(bindGoods, bindGoodsIndex) in res.options.list[0]
.listWay"
:key="bindGoodsIndex" :key="bindGoodsIndex"
> >
{{ bindGoods.title }}, {{ bindGoods.title }},
</div> </div>
</div> </div>
<div> <div>
<Button @click="bindGoodsId(title_item)" size="small" ghost type="primary" <Button
@click="bindGoodsId(title_item)"
size="small"
ghost
type="primary"
>选择商品</Button >选择商品</Button
> >
</div> </div>
@ -111,18 +160,137 @@
> >
</div> </div>
</div> </div>
<div
class="decorate-view"
v-if="item.title != void 0 && !res.notTitle && res.type == 'title'"
>
<div class="decorate-view-title">文字对齐方式</div>
<div class="card-box">
<div
class="card"
:class="{ active: textAlign == 'left' }"
@click="changeTextAlign('left')"
>
<img
:src="require('@/assets/align-text-left.png')"
class="align-text"
alt=""
/>
</div>
<div
class="card"
:class="{ active: textAlign == 'center' }"
@click="changeTextAlign('center')"
>
<img
:src="require('@/assets/align-text-center.png')"
class="align-text"
alt=""
/>
</div>
<!-- <div
class="card"
:class="{ active: textAlign == 'right' }"
@click="changeTextAlign('right')"
>
<img
:src="require('@/assets/align-text-right.png')"
class="align-text"
alt=""
/>
</div> -->
</div>
</div>
<div
class="decorate-view"
v-if="
item.title != void 0 &&
!res.notTitle &&
(res.type == 'title' ||
res.type == 'notice' ||
res.type == 'promotionDetail')
"
>
<div class="decorate-view-title">背景颜色</div>
<div class="decorate-view">
<ColorPicker v-model="item.bk_color" />
<Input v-model="item.bk_color" />
</div>
</div>
<!-- 填写标题 --> <!-- 填写标题 -->
<div class="decorate-view" v-if="item.title != void 0 && !res.notTitle"> <div
class="decorate-view"
v-if="item.title != void 0 && !res.notTitle && res.type != 'notice'"
>
<div class="decorate-view-title">菜单标题</div> <div class="decorate-view-title">菜单标题</div>
<div> <div>
<Input v-model="item.title" style="width: 200px" /> <Input v-model="item.title" style="width: 200px" />
</div> </div>
</div> </div>
<div
class="decorate-view"
v-if="
item.title != void 0 &&
!res.notTitle &&
(res.type == 'title' || res.type == 'notice')
"
>
<div class="decorate-view-title">标题颜色</div>
<div class="decorate-view">
<ColorPicker v-model="item.color" />
<Input v-model="item.color" />
</div>
</div>
<!-- 填写小标题 -->
<div
class="decorate-view"
v-if="item.title1 != void 0 && !res.notTitle"
>
<div class="decorate-view-title">小标题</div>
<div>
<Input v-model="item.title1" style="width: 200px" />
</div>
</div>
<div
class="decorate-view"
v-if="item.title1 != void 0 && !res.notTitle"
>
<div class="decorate-view-title">小标题颜色</div>
<div class="decorate-view">
<ColorPicker v-model="item.color1" />
<Input v-model="item.color1" />
</div>
</div>
<div
class="decorate-view"
v-if="res.type === 'notice' && !res.notTitle"
>
<div class="decorate-view-title">公告内容</div>
<div>
<div
v-for="(t, tindex) in item.title"
:key="tindex"
class="decorate-notice"
>
<Input v-model="t.context" style="width: 200px" />
<Icon
@click="removeNotice(tindex)"
size="16"
type="md-close-circle"
/>
</div>
</div>
</div>
<!-- 填写链接 --> <!-- 填写链接 -->
<div class="decorate-view" v-if="!res.notLink"> <div class="decorate-view" v-if="!res.notLink">
<div class="decorate-view-title">选择链接</div> <div class="decorate-view-title">选择链接</div>
<div v-if="item.url.length != 0" class="decorate-view-link"> <div
v-if="item.url && item.url.length != 0"
class="decorate-view-link"
>
已选链接 已选链接
<span> <span>
@ -133,38 +301,73 @@
}} }}
- -
<!-- 当选择完链接之后的商品名称 --> <!-- 当选择完链接之后的商品名称 -->
<span v-if="item.url.___type == 'goods'"> {{ item.url.goodsName }}</span> <span v-if="item.url.___type == 'goods'">
{{ item.url.goodsName }}</span
>
<!-- 当选择完链接之后的分类回调 --> <!-- 当选择完链接之后的分类回调 -->
<span v-if="item.url.___type == 'category'"> {{ item.url.name }}</span> <span v-if="item.url.___type == 'category'">
{{ item.url.name }}</span
>
<!-- 当选择完链接之后的店铺回调 --> <!-- 当选择完链接之后的店铺回调 -->
<span v-if="item.url.___type == 'shops'"> {{ item.url.memberName }}</span> <span v-if="item.url.___type == 'shops'">
{{ item.url.memberName }}</span
>
<!-- 当选择完链接之后的其他回调 --> <!-- 当选择完链接之后的其他回调 -->
<span v-if="item.url.___type == 'other'"> {{ item.url.title }}</span> <span v-if="item.url.___type == 'other'">
{{ item.url.title }}</span
>
<!-- 当选择完活动之后的其他回调 --> <!-- 当选择完活动之后的其他回调 -->
<span v-if="item.url.___type == 'marketing'"> <span v-if="item.url.___type == 'marketing'">
<span v-if="item.url.___promotion == 'SECKILL'"> </span> <span v-if="item.url.___promotion == 'SECKILL'"> </span>
<span v-if="item.url.___promotion == 'FULL_DISCOUNT'"> </span> <span v-if="item.url.___promotion == 'FULL_DISCOUNT'">
满减
</span>
<span v-if="item.url.___promotion == 'PINTUAN'"> </span> <span v-if="item.url.___promotion == 'PINTUAN'"> </span>
{{ item.url.title || item.url.goodsName }} {{ item.url.title || item.url.goodsName }}
</span> </span>
<!-- 当选择完活动之后的其他回调 --> <!-- 当选择完活动之后的其他回调 -->
<span v-if="item.url.___type == 'pages'"> {{ item.url.title }}</span> <span v-if="item.url.___type == 'pages'">
{{ item.url.title }}</span
>
</span> </span>
</div> </div>
<div> <div>
<Button ghost size="small" type="primary" @click="clickLink(item, index)" <Button
ghost
size="small"
type="primary"
@click="clickLink(item, index)"
>选择链接</Button >选择链接</Button
> >
</div> </div>
</div> </div>
<!-- 链接地址-->
<div
class="decorate-view"
v-if="item.url && item.url.___type == 'other'"
>
<div class="decorate-view-title">外部链接</div>
<div>
<Input v-model="item.url.url" style="width: 200px" />
</div>
</div>
<p v-if="item.url && item.url.___type == 'other'">
(如非同域名下则在小程序与公众号中无效)
</p>
</div> </div>
</div> </div>
</div> </div>
<Button <Button
v-if="res.type != 'tpl_ad_list' && res.type != 'tpl_activity_list' && !res.notAdd" v-if="
res.type != 'tpl_ad_list' &&
res.type != 'tpl_activity_list' &&
!res.notAdd
"
type="primary" type="primary"
@click="addDecorate()" @click="addDecorate(res.type)"
ghost ghost
>添加</Button >添加</Button
> >
@ -194,6 +397,8 @@ export default {
picModelFlag: false, // picModelFlag: false, //
linkType: "goods", // dialog linkType: "goods", // dialog
styleFlag: false, //广 styleFlag: false, //广
textAlign: this.res.options.list[0].textAlign || "center", //
promotionsFlag: false, //广
selectedLinkIndex: "", // selectedLinkIndex: "", //
modelData, // modelData, //
selectedGoods: "", // selectedGoods: "", //
@ -213,15 +418,12 @@ export default {
selectStyle() { selectStyle() {
this.styleFlag = !this.styleFlag; this.styleFlag = !this.styleFlag;
}, },
selectPromotions() {
this.promotionsFlag = !this.promotionsFlag;
},
// //
selectedLink(val) { selectedLink(val) {
//
if (val) {
delete val.intro;
delete val.mobileIntro;
}
this.selectedLinks.url = val; this.selectedLinks.url = val;
}, },
// //
selectedGoodsData(val) { selectedGoodsData(val) {
@ -257,6 +459,10 @@ export default {
this.$refs.liliDialog.flag = true; this.$refs.liliDialog.flag = true;
}, },
changeTextAlign(val) {
this.res.options.list[0].textAlign = val;
this.textAlign = val;
},
// //
clickLink(val, index) { clickLink(val, index) {
this.selectedLinks = val; this.selectedLinks = val;
@ -275,15 +481,21 @@ export default {
}); });
}, },
// //
addDecorate() { addDecorate(type) {
let way = { if (type === "notice") {
img: "https://picsum.photos/id/264/200/200", this.res.options.list[0].title.push({
title: "标题", content: "",
link: "", });
url: "", } else {
size: this.res.options.list[0]?.size, let way = {
}; img: "https://picsum.photos/id/264/200/200",
this.res.options.list.push(way); title: "标题",
link: "",
url: "",
size: this.res.options.list[0]?.size,
};
this.res.options.list.push(way);
}
}, },
// //
callbackSelected(val) { callbackSelected(val) {
@ -296,6 +508,11 @@ export default {
this.selectedGoods = item; this.selectedGoods = item;
this.picModelFlag = true; this.picModelFlag = true;
}, },
removeNotice(index) {
this.$nextTick(() => {
this.res.options.list[0].title.splice(index, 1);
});
},
// //
closeDecorate(index) { closeDecorate(index) {
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -15,7 +15,7 @@
> >
<li <li
v-for="(model, index) in modelData" v-for="(model, index) in modelData"
v-if="!model.drawer" v-if="!model.drawer && !model.drawerPromotions"
:key="index" :key="index"
class="model-item" class="model-item"
> >
@ -77,7 +77,8 @@ import templates from "./template/index";
import Draggable from "vuedraggable"; import Draggable from "vuedraggable";
import { modelData } from "./config"; import { modelData } from "./config";
import decorate from "./decorate"; import decorate from "./decorate";
import * as API_Other from '@/api/other' import * as API_Other from "@/api/other";
import * as API_Promotions from "@/api/promotion";
export default { export default {
components: { components: {
Draggable, Draggable,
@ -89,10 +90,12 @@ export default {
modelData, // modelData, //
qrcode: "", // qrcode: "", //
selected: 0, // selected: 0, //
contentData: { // contentData: {
//
list: [], list: [],
}, },
decorateData: "", // decorateData: "", //
decoratePromotionsData: "", //
}; };
}, },
watch: { watch: {
@ -108,21 +111,14 @@ export default {
}, },
methods: { methods: {
enableBindGoodsShow(){
},
// //
init() { init() {
if (!this.$route.query.id) return false; if (!this.$route.query.id) return false;
API_Other.getHomeData(this.$route.query.id).then(res=>{ API_Other.getHomeData(this.$route.query.id).then((res) => {
this.contentData = JSON.parse(res.result.pageData) this.contentData = JSON.parse(res.result.pageData);
this.handleComponent(this.contentData.list[0], 0);
this.handleComponent( this.contentData.list[0], 0) });
})
}, },
// //
@ -136,7 +132,6 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.decorateData = ""; this.decorateData = "";
console.log(this.contentData.list.length);
// //
if (this.contentData.list.length > 1) { if (this.contentData.list.length > 1) {
// //
@ -156,29 +151,86 @@ export default {
// //
handleComponent(val, index) { handleComponent(val, index) {
console.warn(val)
this.selected = index; this.selected = index;
this.$set(this, "decorateData", val); this.$set(this, "decorateData", val);
}, },
// //
handleDrawer(val) { handleDrawer(val) {
let newIndex = this.selected; let newIndex = this.selected;
if (val.promotionsType) {
if (this.contentData.list[newIndex].options.list.length >= 2) {
this.$Message.error("最多只能展示两个活动");
return;
}
if (val.promotionsType === "LIVE") {
API_Promotions.getLiveList({
status: "START",
pageSize: 1,
}).then((res) => {
if (res.success && res.result.size > 0) {
API_Promotions.getLiveInfo(res.result.records[0].id).then(
(res) => {
if (res.success) {
this.contentData.list[newIndex].options.list.push({
type: val.promotionsType,
title: val.name,
title1: val.subName,
color1: val.subColor,
bk_color: val.subBkColor,
data: res.result.commodityList
? res.result.commodityList.splice(0,2)
: [],
});
}
}
);
}
});
} else {
API_Promotions.getAllPromotion().then((res) => {
let exist = this.contentData.list[newIndex].options.list.find(
(i) => i.type === val.promotionsType
);
this.decorateData = ""; if (res.success && !exist) {
this.contentData.list[newIndex].options.list.push({
data: res.result[val.promotionsType]
? res.result[val.promotionsType].splice(0,2)
: [],
type: val.promotionsType,
title1: val.subName,
color1: val.subColor,
bk_color: val.subBkColor,
title: val.name,
});
}
});
}
this.$set(this.contentData.list, newIndex, {
...val,
options: {
...this.contentData.list[newIndex].options,
},
//
model: val.type,
});
} else {
this.decorateData = "";
this.$set(this.contentData.list, newIndex, { this.$set(this.contentData.list, newIndex, {
...val, ...val,
options: { options: {
...val.options, ...val.options,
}, },
// //
model: val.type, model: val.type,
}); });
this.contentData.list = JSON.parse(JSON.stringify(this.contentData.list)); this.contentData.list = JSON.parse(
JSON.stringify(this.contentData.list)
this.$set(this, "decorateData", this.contentData.list[newIndex]); );
this.$set(this, "decorateData", this.contentData.list[newIndex]);
}
}, },
// //

View File

@ -12,20 +12,24 @@ import tpl_flex_four from "./tpl_flex_four";
import tpl_text_picture from "./tpl_text_picture"; import tpl_text_picture from "./tpl_text_picture";
import tpl_menu from "./tpl_menu"; import tpl_menu from "./tpl_menu";
import tpl_search from "./tpl_search"; import tpl_search from "./tpl_search";
import tpl_join_group from "./tpl_join_group"; import tpl_promotion_detail from "./tpl_promotion_detail";
import tpl_integral from "./tpl_integral"; import tpl_integral from "./tpl_integral";
import tpl_spike from "./tpl_spike"; import tpl_spike from "./tpl_spike";
import tpl_group from "./tpl_group"; import tpl_group from "./tpl_group";
import tpl_ad_list from "./tpl_view_list"; import tpl_ad_list from "./tpl_view_list";
import tpl_activity_list from './tpl_view_list' import tpl_activity_list from './tpl_view_list'
import tpl_goods from "./tpl_goods"; import tpl_goods from "./tpl_goods";
import tpl_notice from "./tpl_notice";
import tpl_promotions from "./tpl_promotions";
export default { export default {
notice: tpl_notice,
carousel: tpl_banner, carousel: tpl_banner,
title: tpl_title, title: tpl_title,
leftOneRightTwo: tpl_left_one_right_two, leftOneRightTwo: tpl_left_one_right_two,
leftTwoRightOne: tpl_left_two_right_one, leftTwoRightOne: tpl_left_two_right_one,
topOneBottomTwo:tpl_top_one_bottom_two, topOneBottomTwo: tpl_top_one_bottom_two,
topTwoBottomOne:tpl_top_two_bottom_one, topTwoBottomOne: tpl_top_two_bottom_one,
flexThree: tpl_flex_three, flexThree: tpl_flex_three,
flexFive: tpl_flex_five, flexFive: tpl_flex_five,
flexFour: tpl_flex_four, flexFour: tpl_flex_four,
@ -33,12 +37,13 @@ export default {
textPicture: tpl_text_picture, textPicture: tpl_text_picture,
menu: tpl_menu, menu: tpl_menu,
search: tpl_search, search: tpl_search,
joinGroup: tpl_join_group, promotionDetail: tpl_promotion_detail,
flexOne: tpl_flex_one, flexOne: tpl_flex_one,
goods: tpl_goods, goods: tpl_goods,
integral:tpl_integral, integral: tpl_integral,
spike:tpl_spike, spike: tpl_spike,
group:tpl_group, group: tpl_group,
tpl_ad_list, tpl_ad_list,
tpl_activity_list promotions: tpl_promotions,
tpl_activity_list,
}; };

View File

@ -1,38 +1,39 @@
<template> <template>
<div class="layout"> <div class="layout">
<div class="menu-list"> <div class="menu-list">
<div class="menu-item" v-for="(item,index) in res.list" :key="index"> <div class="menu-item" v-for="(item, index) in res.list" :key="index">
<div> <div>
<img class="menu-img" :src="item.img" alt=""> <img class="menu-img" :src="item.img" alt="" />
</div>
<div class="menu-title">{{item.title}}</div>
</div>
</div> </div>
<div class="menu-title">{{ item.title }}</div>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
props:['res'] props: ["res"],
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./tpl.scss"; @import "./tpl.scss";
.menu-list{ .menu-list {
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap; justify-content: space-between;
flex-wrap: wrap;
>.menu-item{ > .menu-item {
text-align: center; text-align: center;
width: 20%; width: 20%;
margin:10px 0; margin: 10px 0;
} }
} }
.menu-img{ .menu-img {
width: 44px; width: 44px;
height: 44px; height: 44px;
} }
.menu-title{ .menu-title {
font-size: 12px; font-size: 12px;
} }
</style> </style>

View File

@ -0,0 +1,61 @@
<template>
<div class="layout">
<div class="background" :style="{ backgroundColor: res.list[0].bk_color }">
<img :src="res.list[0].img" alt="" style="float:left;width: 20px;height: 20px;margin-top: 10px;margin-left: 10px;margin-right: 10px">
<div class="title" :style="{ color: res.list[0].color }">
{{ context }}
</div>
</div>
</div>
</template>
<script>
export default {
title: "公告",
props: ["res"],
data() {
return {
index: 0,
context: "",
}
},
mounted() {
this.context = this.res.list[0].title[this.index].context;
setInterval(() => {
this.context = this.res.list[0].title[this.index].context;
if (this.index < this.res.list[0].title.length - 1) {
this.index++;
} else {
this.index = 0;
}
}, 3000);
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.background {
position: absolute;
z-index: 2;
width: 100%;
height: 42px;
text-align: left;
font-size: 10px;
background-size: cover;
}
.layout {
text-align: center;
position: relative;
height: 42px;
display: flex;
align-items: center;
justify-content: center;
background: #ffffff;
}
.title {
line-height: 42px;
font-size: 10px;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,137 @@
<template>
<div class="layout">
<div class="join-list">
<div
v-for="(item, index) in res.list"
:key="index"
class="join-list-item"
>
<div>
<div class="join-title">
<div>{{ item.title }}</div>
<div
class="sub"
:style="{
backgroundColor: item.bk_color,
color: item.color1,
borderColor: item.bk_color,
}"
>
{{ item.title1 }}
</div>
</div>
<div class="join-box">
<div
class="join-item"
v-for="(i, _index) in item.data"
:key="_index"
>
<div class="item-img-box">
<img
class="item-img"
:src="i.thumbnail ? i.thumbnail : i.goodsImage"
alt
/>
</div>
<div
class="ellipsis"
:class="{ 'max-width': res.list.length <= 1 }"
>
{{ i.goodsName ? i.goodsName : i.name }}
</div>
<div class="item-price">
<span>{{ i.price ? i.price : i.originalPrice }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: ["res"],
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.join-box {
display: flex;
}
.join-list {
width: 100%;
display: flex;
overflow: hidden;
}
.join-list-item {
flex: 1;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 54px; // 1
font-size: 11px;
}
.max-width {
width: 158px !important;
}
.item-price {
> span {
font-size: 14px;
font-weight: 500;
color: #e1212b;
}
}
.join-item {
flex: 1;
}
.item-img {
width: 75px;
height: 75px;
margin: 0 auto;
display: block;
}
.item-img-box {
position: relative;
}
.item-line-through {
> span {
font-size: 10px;
font-weight: 400;
text-decoration: line-through;
color: #999;
}
}
.item-position-tips {
position: absolute;
right: 0;
color: #fff;
font-size: 12px;
bottom: 0;
}
.join-title {
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
height: 50px;
> div:nth-of-type(1) {
font-size: 15px;
font-weight: bold;
}
> div:nth-of-type(2) {
font-size: 10px;
color: #fff;
border: 2px solid;
border-radius: 8px;
text-align: center;
width: 30%;
}
.sub {
background-color: #e1212b;
margin-right: 40px;
}
}
</style>

View File

@ -0,0 +1,30 @@
<template>
<div class="layout">
<div class="flex-two">
请选择促销活动(最多只能展示两个活动)
</div>
</div>
</template>
<script>
export default {
title: "两张横图",
props: ["res"],
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.flex-two {
width: 100%;
display: flex;
height: 110px;
overflow: hidden;
}
.flex-item {
width: 50%;
> img {
display: block;
max-width: 100%;
height: 100%;
}
}
</style>

View File

@ -1,9 +1,26 @@
<template> <template>
<div class="layout"> <div class="layout" :style="{ textAlign: res.list[0].textAlign }">
<div class="background"> <div class="background" :style="{ backgroundColor: res.list[0].bk_color }">
<div class="title" :style="{ color: res.list[0].color }"> <div class="title" :style="{ color: res.list[0].color }">
{{ res.list[0].title }} {{ res.list[0].title }}
</div> </div>
<div
style="
position: absolute;
right: 10px;
top: 2px;
color: #fff;
line-height: 42px;
font-size: 10px;
"
>
<a
:href="res.list[0].url"
:style="{ color: res.list[0].color1 }"
style="text-decoration: none"
>{{ res.list[0].title1 }}</a
>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -11,13 +28,14 @@
<script> <script>
export default { export default {
title: "标题栏", title: "标题栏",
props: ["res"] props: ["res"],
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./tpl.scss"; @import "./tpl.scss";
.background { .background {
background: url("../../../../assets/title.png") no-repeat; background-color: rgb(255, 87, 62);
/*background: url("../../../../assets/title.png") no-repeat;*/
position: absolute; position: absolute;
z-index: 2; z-index: 2;
width: 100%; width: 100%;
@ -37,7 +55,8 @@ export default {
} }
.title { .title {
line-height: 42px; line-height: 42px;
font-size: 15px; font-size: 18px;
font-weight: bold; font-weight: bold;
margin-left: 4px;
} }
</style> </style>

View File

@ -3,6 +3,7 @@
<Card> <Card>
<Row class="operation"> <Row class="operation">
<Button @click="add()" type="primary">设置今日热词</Button> <Button @click="add()" type="primary">设置今日热词</Button>
<Button @click="deleteWords('')" type="primary">清空热词</Button>
</Row> </Row>
<Row> <Row>
<p> <p>
@ -112,10 +113,16 @@ export default {
this.modalVisible = true; this.modalVisible = true;
}, },
deleteWords(words) { deleteWords(words) {
let title = "是否确定删除热词";
let content = "<p>您确定要删除此热词吗?</p>";
if (words === '') {
title = "是否确定清空热词";
content = "<p>您确定要清空热词吗?</p>";
}
this.$Modal.confirm({ this.$Modal.confirm({
title: "是否确定删除热词", title: title,
content: "<p>您确定要删除此热词吗?</p>", content: content,
okText: "确实", okText: "确",
cancelText: "取消", cancelText: "取消",
onOk: () => { onOk: () => {
deleteHotWords(words).then((res) => { deleteHotWords(words).then((res) => {

View File

@ -38,32 +38,35 @@
<p>退单金额</p> <p>退单金额</p>
<p class="theme_color">-{{bill.refundPrice || 0 | unitPrice('¥')}}</p> <p class="theme_color">-{{bill.refundPrice || 0 | unitPrice('¥')}}</p>
</span> </span>
<span> <span>
<p>平台收取佣金</p> <p>平台收取佣金</p>
<p class="theme_color">-{{bill.commissionPrice || 0 | unitPrice('¥')}}</p> <p class="theme_color">-{{bill.commissionPrice || 0 | unitPrice('¥')}}</p>
</span> </span>
<span>
<p>退单产生退还佣金金额</p>
<p class="increase-color">+{{bill.refundCommissionPrice || 0 | unitPrice('¥')}}</p>
</span>
<span> <span>
<p>分销返现支出</p> <p>分销返现支出</p>
<p class="theme_color">-{{bill.distributionCommission || 0 | unitPrice('¥')}}</p> <p class="theme_color">-{{bill.distributionCommission || 0 | unitPrice('¥')}}</p>
</span> </span>
<span>
<p>退单分销返现返还</p>
<p class="increase-color">+{{bill.distributionRefundCommission || 0 | unitPrice('¥')}}</p>
</span>
<span> <span>
<p>平台优惠券支出</p> <p>退单平台优惠券补贴返还</p>
<p class="theme_color">-{{bill.siteCouponCommission || 0 | unitPrice('¥')}}</p> <p class="theme_color">-{{bill.siteCouponRefundCommission || 0 | unitPrice('¥')}}</p>
</span>
<span>
<p>退单产生退还佣金金额</p>
<p class="increase-color">+{{bill.refundCommissionPrice || 0 | unitPrice('¥')}}</p>
</span> </span>
<span> <span>
<p>退单分销返现返还</p> <p>平台优惠券补贴</p>
<p class="increase-color">+{{bill.distributionRefundCommission || 0 | unitPrice('¥')}}</p> <p class="increase-color">+{{bill.siteCouponCommission || 0 | unitPrice('¥')}}</p>
</span>
<span>
<p>退单平台优惠券返还</p>
<p class="increase-color">+{{bill.siteCouponRefundCommission || 0 | unitPrice('¥')}}</p>
</span> </span>
<span> <span>
<p>积分结算金额</p> <p>积分结算金额</p>
<p class="increase-color">+{{bill.pointSettlementPrice || 0 | unitPrice('¥')}}</p> <p class="increase-color">+{{bill.pointSettlementPrice || 0 | unitPrice('¥')}}</p>

View File

@ -53,11 +53,19 @@
<span class="describe">消费达到当前金额可以参与优惠</span> <span class="describe">消费达到当前金额可以参与优惠</span>
</FormItem> </FormItem>
<FormItem label="优惠方式"> <FormItem label="优惠方式">
<RadioGroup type="button" button-style="solid" v-model="form.discountType"> <RadioGroup
<Radio :disabled="form.promotionStatus != 'NEW'" label="fullMinusFlag" type="button"
button-style="solid"
v-model="form.discountType"
>
<Radio
:disabled="form.promotionStatus != 'NEW'"
label="fullMinusFlag"
>减现金</Radio >减现金</Radio
> >
<Radio :disabled="form.promotionStatus != 'NEW'" label="fullRateFlag" <Radio
:disabled="form.promotionStatus != 'NEW'"
label="fullRateFlag"
>打折</Radio >打折</Radio
> >
</RadioGroup> </RadioGroup>
@ -102,7 +110,9 @@
v-model="form.couponFlag" v-model="form.couponFlag"
>送优惠券</Checkbox >送优惠券</Checkbox
> >
<Checkbox :disabled="form.promotionStatus != 'NEW'" v-model="form.giftFlag" <Checkbox
:disabled="form.promotionStatus != 'NEW'"
v-model="form.giftFlag"
>送赠品</Checkbox >送赠品</Checkbox
> >
<Checkbox <Checkbox
@ -125,9 +135,12 @@
:loading="couponLoading" :loading="couponLoading"
style="width: 280px" style="width: 280px"
> >
<Option v-for="item in couponList" :value="item.id" :key="item.id">{{ <Option
item.couponName v-for="item in couponList"
}}</Option> :value="item.id"
:key="item.id"
>{{ item.couponName }}</Option
>
</Select> </Select>
</FormItem> </FormItem>
<FormItem v-if="form.giftFlag" label="赠品" prop="giftId"> <FormItem v-if="form.giftFlag" label="赠品" prop="giftId">
@ -140,9 +153,14 @@
:loading="giftLoading" :loading="giftLoading"
style="width: 280px" style="width: 280px"
> >
<Option v-for="item in giftList" :value="item.id" :key="item.id">{{ <Option
item.goodsName v-for="item in giftList"
}}</Option> :value="item.id"
:key="item.id"
>
{{ item.goodsName }}
</Option
>
</Select> </Select>
</FormItem> </FormItem>
<FormItem v-if="form.pointFlag" label="赠积分" prop="point"> <FormItem v-if="form.pointFlag" label="赠积分" prop="point">
@ -155,17 +173,26 @@
/> />
</FormItem> </FormItem>
<FormItem label="使用范围" prop="scopeType"> <FormItem label="使用范围" prop="scopeType">
<RadioGroup type="button" button-style="solid" v-model="form.scopeType"> <RadioGroup
type="button"
button-style="solid"
v-model="form.scopeType"
>
<Radio :disabled="form.promotionStatus != 'NEW'" label="ALL" <Radio :disabled="form.promotionStatus != 'NEW'" label="ALL"
>全品类</Radio >全品类</Radio
> >
<Radio :disabled="form.promotionStatus != 'NEW'" label="PORTION_GOODS" <Radio
:disabled="form.promotionStatus != 'NEW'"
label="PORTION_GOODS"
>指定商品</Radio >指定商品</Radio
> >
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
<FormItem style="width: 100%" v-if="form.scopeType == 'PORTION_GOODS'"> <FormItem
style="width: 100%"
v-if="form.scopeType == 'PORTION_GOODS'"
>
<div <div
style="display: flex; margin-bottom: 10px" style="display: flex; margin-bottom: 10px"
v-if="form.promotionStatus == 'NEW'" v-if="form.promotionStatus == 'NEW'"
@ -196,7 +223,7 @@
<template slot-scope="{ index }" slot="action"> <template slot-scope="{ index }" slot="action">
<Button <Button
type="error" type="error"
:disabled="form.promotionStatus != 'NEW' && id" :disabled="form.promotionStatus != 'NEW' && !!id"
size="small" size="small"
ghost ghost
@click="delGoods(index)" @click="delGoods(index)"
@ -210,7 +237,7 @@
<Button type="text" @click="closeCurrentPage"></Button> <Button type="text" @click="closeCurrentPage"></Button>
<Button <Button
type="primary" type="primary"
:disabled="form.promotionStatus != 'NEW' && id" :disabled="form.promotionStatus != 'NEW' && !!id"
:loading="submitLoading" :loading="submitLoading"
@click="handleSubmit" @click="handleSubmit"
>提交</Button >提交</Button
@ -220,7 +247,10 @@
</div> </div>
</Form> </Form>
</Card> </Card>
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select> <sku-select
ref="skuSelect"
@selectedGoodsData="selectedGoodsData"
></sku-select>
</div> </div>
</template> </template>
@ -280,7 +310,10 @@ export default {
promotionName: [{ required: true, message: "活动名称不能为空" }], promotionName: [{ required: true, message: "活动名称不能为空" }],
rangeTime: [{ required: true, message: "请选择活动时间" }], rangeTime: [{ required: true, message: "请选择活动时间" }],
description: [{ required: true, message: "请填写活动描述" }], description: [{ required: true, message: "请填写活动描述" }],
price: [{ required: true, message: "请输入面额" }, { validator: checkPrice }], price: [
{ required: true, message: "请输入面额" },
{ validator: checkPrice },
],
consumptionLimit: [{ required: true, validator: checkWeight }], consumptionLimit: [{ required: true, validator: checkWeight }],
fullMoney: [{ required: true, validator: checkWeight }], fullMoney: [{ required: true, validator: checkWeight }],
fullMinus: [ fullMinus: [
@ -318,7 +351,10 @@ export default {
key: "price", key: "price",
minWidth: 40, minWidth: 40,
render: (h, params) => { render: (h, params) => {
return h("div", this.$options.filters.unitPrice(params.row.price, "¥")); return h(
"div",
this.$options.filters.unitPrice(params.row.price, "¥")
);
}, },
}, },
{ {
@ -343,8 +379,8 @@ export default {
if (this.id) { if (this.id) {
this.getDetail(); this.getDetail();
} }
this.getCouponList(); await this.getCouponList();
this.getGiftList(); await this.getGiftList();
}, },
methods: { methods: {
// //
@ -390,14 +426,19 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const params = JSON.parse(JSON.stringify(this.form)); const params = JSON.parse(JSON.stringify(this.form));
const strat = this.$options.filters.unixToDate(this.form.rangeTime[0] / 1000); const strat = this.$options.filters.unixToDate(
const end = this.$options.filters.unixToDate(this.form.rangeTime[1] / 1000); this.form.rangeTime[0] / 1000
);
const end = this.$options.filters.unixToDate(
this.form.rangeTime[1] / 1000
);
params.startTime = strat; params.startTime = strat;
params.endTime = end; params.endTime = end;
if ( if (
params.scopeType == "PORTION_GOODS" && params.scopeType == "PORTION_GOODS" &&
(!params.promotionGoodsList || params.promotionGoodsList.length == 0) (!params.promotionGoodsList ||
params.promotionGoodsList.length == 0)
) { ) {
this.$Modal.warning({ title: "提示", content: "请选择指定商品" }); this.$Modal.warning({ title: "提示", content: "请选择指定商品" });
return; return;
@ -463,9 +504,11 @@ export default {
this.selectedGoods.forEach(function (e) { this.selectedGoods.forEach(function (e) {
ids.push(e.id); ids.push(e.id);
}); });
this.form.promotionGoodsList = this.form.promotionGoodsList.filter((item) => { this.form.promotionGoodsList = this.form.promotionGoodsList.filter(
return !ids.includes(item.id); (item) => {
}); return !ids.includes(item.id);
}
);
}, },
}); });
}, },
@ -511,7 +554,10 @@ export default {
let params = { let params = {
pageSize: 10, pageSize: 10,
pageNumber: 1, pageNumber: 1,
goodsName: query, id: query === this.form.giftId ? this.form.giftId : null,
goodsName: query === this.form.giftId ? null : query,
marketEnable: "UPPER",
authFlag: "PASS"
}; };
this.giftLoading = true; this.giftLoading = true;
getGoodsSkuListDataSeller(params).then((res) => { getGoodsSkuListDataSeller(params).then((res) => {

View File

@ -33,46 +33,49 @@
<div> <div>
<h3 class="ml_10">结算详细</h3> <h3 class="ml_10">结算详细</h3>
<div class="bill-detail-price"> <div class="bill-detail-price">
<span> <span>
<p>退单金额</p> <p>退单金额</p>
<p class="theme_color">-{{bill.refundPrice || 0 | unitPrice('¥')}}</p> <p class="theme_color">-{{bill.refundPrice || 0 | unitPrice('¥')}}</p>
</span> </span>
<span>
<p>平台收取佣金</p> <span>
<p class="theme_color">-{{bill.commissionPrice || 0 | unitPrice('¥')}}</p> <p>平台收取佣金</p>
</span> <p class="theme_color">-{{bill.commissionPrice || 0 | unitPrice('¥')}}</p>
<span> </span>
<p>分销返现支出</p> <span>
<p class="theme_color">-{{bill.distributionCommission || 0 | unitPrice('¥')}}</p> <p>退单产生退还佣金金额</p>
</span> <p class="increase-color">+{{bill.refundCommissionPrice || 0 | unitPrice('¥')}}</p>
<span> </span>
<p>平台优惠券支出</p>
<p class="theme_color">-{{bill.siteCouponCommission || 0 | unitPrice('¥')}}</p> <span>
</span> <p>分销返现支出</p>
<span> <p class="theme_color">-{{bill.distributionCommission || 0 | unitPrice('¥')}}</p>
<p>退单产生退还佣金金额</p> </span>
<p class="increase-color">+{{bill.refundCommissionPrice || 0 | unitPrice('¥')}}</p> <span>
</span> <p>退单分销返现返还</p>
<p class="increase-color">+{{bill.distributionRefundCommission || 0 | unitPrice('¥')}}</p>
<span> </span>
<p>退单分销返现返还</p>
<p class="increase-color">+{{bill.distributionRefundCommission || 0 | unitPrice('¥')}}</p> <span>
</span> <p>退单平台优惠券补贴返还</p>
<p class="theme_color">-{{bill.siteCouponRefundCommission || 0 | unitPrice('¥')}}</p>
<span> </span>
<p>退单平台优惠券返还</p>
<p class="increase-color">+{{bill.siteCouponRefundCommission || 0 | unitPrice('¥')}}</p> <span>
</span> <p>平台优惠券补贴</p>
<span> <p class="increase-color">+{{bill.siteCouponCommission || 0 | unitPrice('¥')}}</p>
<p>积分结算金额</p> </span>
<p class="increase-color">+{{bill.pointSettlementPrice || 0 | unitPrice('¥')}}</p>
</span> <span>
<span> <p>积分结算金额</p>
<p>砍价商品结算金额</p> <p class="increase-color">+{{bill.pointSettlementPrice || 0 | unitPrice('¥')}}</p>
<p class="increase-color">+{{bill.kanjiaSettlementPrice || 0 | unitPrice('¥')}}</p> </span>
</span> <span>
<p>砍价商品结算金额</p>
<p class="increase-color">+{{bill.kanjiaSettlementPrice || 0 | unitPrice('¥')}}</p>
</span>
</div>
</div> </div>
</div>
</Card> </Card>
<Card class="mt_10"> <Card class="mt_10">
<Tabs active-key="tab" type="card" @on-click="clickTabs"> <Tabs active-key="tab" type="card" @on-click="clickTabs">