mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 00:45:54 +08:00
Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-ui
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getCategoryTree} from '@/api/goods.js'
|
||||
import { getCategoryTree } from '@/api/goods.js'
|
||||
export default {
|
||||
updated() {
|
||||
updated () {
|
||||
if (!localStorage.getItem('category') && this.$route.path !== '/login') {
|
||||
getCategoryTree(0).then(res => {
|
||||
if (res.success) {
|
||||
@@ -49,7 +49,8 @@ body {
|
||||
.ivu-tag {
|
||||
cursor: pointer;
|
||||
}
|
||||
.tox-notifications-container{
|
||||
|
||||
.tox-notifications-container {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -274,6 +274,42 @@
|
||||
{{ orderInfo.order.priceDetailDTO.couponPrice | unitPrice("¥") }}
|
||||
</span>
|
||||
</li>
|
||||
<li v-if="orderInfo.order.priceDetailDTO.discountPriceDetail != undefined && orderInfo.order.priceDetailDTO.discountPriceDetail && orderInfo.order.priceDetailDTO.discountPriceDetail != null && orderInfo.order.priceDetailDTO.discountPriceDetail != ''">
|
||||
<div class="label">
|
||||
<Poptip trigger="hover" placement="left" width="200">
|
||||
<Icon v-if="typeList.length > 0" type="ios-alert-outline" size="17" @click="getOrderPrice" color="#cc0000"/>
|
||||
<template #content>
|
||||
<div class="api" style="text-align:left;">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>优惠详情:</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item,index) in typeList" :key="index">
|
||||
<td>{{item.promotionName}}:</td>
|
||||
<td>¥{{ item.discountPrice | unitPrice }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
</Poptip>
|
||||
<span>优惠详情:</span>
|
||||
</div>
|
||||
</li>
|
||||
<!-- <li v-if="showPrices">
|
||||
<span class="label" style="color: #cc0000;font-size: 14px;" v-if="typeList.length > 0" >优惠详情:</span>
|
||||
</li> -->
|
||||
<!-- <li v-if="showPrices" v-for="(item,index) in typeList" :key="index">
|
||||
<span class="label" v-if="index == 1 && typeList.length > 1" style="font-size:10px !important;"><a @click="gotoHomes" style="display: inline-block;border-bottom: 1px dashed;color:black;width:80px;">{{item.promotionName}}:</a></span>
|
||||
<span class="txt" style="border-bottom: 1px dashed;font-size:10px !important;" v-if="index == 1 && typeList.length > 1">¥{{ item.discountPrice | unitPrice }}</span>
|
||||
<span class="label" v-if="index == 0 && typeList.length > 1" style="font-size:10px !important;"><a @click="gotoHomes" style="display: inline-block;border-top: 1px dashed;color:black;width:80px;">{{item.promotionName}}:</a></span>
|
||||
<span class="txt" style="border-top: 1px dashed;font-size:10px !important;" v-if="index == 0 && typeList.length > 1">¥{{ item.discountPrice | unitPrice }}</span>
|
||||
<span class="label" v-if="typeList.length == 1 && index == 0" style="font-size:10px !important;"><a @click="gotoHomes" style="display: inline-block;border-top: 1px dashed;border-bottom: 1px dashed;color:black;width:80px;">{{item.promotionName}}:</a></span>
|
||||
<span class="txt" v-if="typeList.length == 1 && index == 0" style="border-top: 1px dashed;border-bottom: 1px dashed;font-size:10px !important;">¥{{ item.discountPrice | unitPrice }}</span>
|
||||
</li> -->
|
||||
<li>
|
||||
<span class="label">运费:</span>
|
||||
<span class="txt">{{
|
||||
@@ -515,6 +551,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
typeList:[],
|
||||
showPrices:false,
|
||||
printHiddenFlag:false,//隐藏信息
|
||||
printInfoObj:{
|
||||
id: "printInfo",//要打印的id名 无#号
|
||||
@@ -699,6 +737,9 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
gotoHomes(){
|
||||
return false
|
||||
},
|
||||
//修改地址
|
||||
regionClick() {
|
||||
this.showRegion = true;
|
||||
@@ -722,6 +763,28 @@ export default {
|
||||
},
|
||||
});
|
||||
},
|
||||
getOrderPrice(){
|
||||
if(this.showPrices){
|
||||
this.showPrices = false
|
||||
}else if(!this.showPrices){
|
||||
this.showPrices = true
|
||||
}
|
||||
},
|
||||
getContentPrice(){
|
||||
for (let i = 0; i < this.typeList.length; i++) {
|
||||
for (let j = i + 1; j < this.typeList.length; j++) {
|
||||
if (this.typeList[i].promotionId === this.typeList[j].promotionId) {
|
||||
this.typeList[i].discountPrice = this.typeList[i].discountPrice + this.typeList[j].discountPrice
|
||||
this.typeList.splice(j, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(this.typeList)
|
||||
if(this.typeList.length >= 3){
|
||||
console.log(123123)
|
||||
this.getContentPrice()
|
||||
}
|
||||
},
|
||||
// 获取订单详情
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
@@ -731,6 +794,9 @@ export default {
|
||||
this.orderInfo = res.result;
|
||||
this.allowOperation = res.result.allowOperationVO;
|
||||
this.data = res.result.orderItems;
|
||||
this.typeList = JSON.parse(JSON.stringify(res.result.order.priceDetailDTO.discountPriceDetail));
|
||||
this.getContentPrice()
|
||||
this.getOrderPrice()
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -899,7 +965,7 @@ export default {
|
||||
|
||||
.goods-total {
|
||||
padding: 20px;
|
||||
height: 150px;
|
||||
height: 220px;
|
||||
width: 100%;
|
||||
|
||||
ul {
|
||||
@@ -916,11 +982,13 @@ export default {
|
||||
.label {
|
||||
float: left;
|
||||
width: 500px;
|
||||
font-size: 14px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.txt {
|
||||
float: left;
|
||||
font-size: 14px;
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
font-family: verdana;
|
||||
|
||||
@@ -12,11 +12,19 @@
|
||||
<span v-if="couponActivity.couponActivityType === 'REGISTERED'"
|
||||
>新人发券</span
|
||||
>
|
||||
<span v-else-if="couponActivity.couponActivityType === 'AUTO_COUPON'">自动发券</span>
|
||||
<spin v-else>精确发券</spin>
|
||||
</FormItem>
|
||||
<FormItem label="领取频率" v-if="couponActivity.couponFrequencyEnum != '' && couponActivity.couponFrequencyEnum != null && couponActivity.couponFrequencyEnum != undefined">
|
||||
<span v-if="couponActivity.couponFrequencyEnum === 'DAY'"
|
||||
>每日</span
|
||||
>
|
||||
<span v-else-if="couponActivity.couponFrequencyEnum === 'WEEK'">每周一次</span>
|
||||
<span v-else>每月一次</span>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="活动范围"
|
||||
v-if="couponActivity.couponActivityType === 'SPECIFY'"
|
||||
v-if="couponActivity.couponActivityType === 'SPECIFY' || couponActivity.couponActivityType === 'AUTO_COUPON'"
|
||||
>
|
||||
<span v-if="couponActivity.activityScope === 'ALL'">全部会员</span>
|
||||
<spin v-else>指定会员</spin>
|
||||
|
||||
@@ -34,6 +34,22 @@
|
||||
>
|
||||
<Radio label="REGISTERED">新人发券</Radio>
|
||||
<Radio label="SPECIFY">精确发券</Radio>
|
||||
<Radio label="INVITE_NEW">邀新赠券</Radio>
|
||||
<Radio label="AUTO_COUPON">自动赠券</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
label="领取频率"
|
||||
v-if="form.couponActivityType === 'AUTO_COUPON'"
|
||||
>
|
||||
<RadioGroup
|
||||
type="button"
|
||||
button-style="solid"
|
||||
v-model="form.couponFrequencyEnum"
|
||||
>
|
||||
<Radio label="DAY">每日一次</Radio>
|
||||
<Radio label="WEEK">每周一次</Radio>
|
||||
<Radio label="MONTH">每月一次</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
@@ -161,6 +177,7 @@ export default {
|
||||
endTime: "", //结束时间
|
||||
memberDTOS: [], //指定会员范围
|
||||
couponActivityItems: [], //优惠券列表
|
||||
couponFrequencyEnum:"", //选择周期
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectCouponList: [], //选择的优惠券列表
|
||||
@@ -323,7 +340,7 @@ export default {
|
||||
// 清空原有数据
|
||||
this.form.couponActivityItems = this.selectCouponList.map((item) => {
|
||||
return {
|
||||
num: 0,
|
||||
num: 1,
|
||||
couponId: item.id,
|
||||
};
|
||||
});
|
||||
@@ -341,6 +358,33 @@ export default {
|
||||
},
|
||||
/** 保存平台优惠券 */
|
||||
handleSubmit() {
|
||||
if(this.form.couponFrequencyEnum !== ''){
|
||||
console.log(this.activityScope)
|
||||
if(this.form.activityScope == 'ALL'){
|
||||
this.form.startTime = this.$options.filters.unixToDate(this.rangeTime[0] / 1000);
|
||||
this.form.endTime = this.$options.filters.unixToDate(this.rangeTime[1] / 1000);
|
||||
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
this.submitLoading = true;
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete params.id;
|
||||
saveActivityCoupon(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("优惠券活动创建成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else {
|
||||
this.$Message.info('自动发券只能全用户发送')
|
||||
this.form.couponActivityType = 'SPECIFY'
|
||||
this.form.activityScope = 'ALL'
|
||||
}
|
||||
}else{
|
||||
this.form.startTime = this.$options.filters.unixToDate(this.rangeTime[0] / 1000);
|
||||
this.form.endTime = this.$options.filters.unixToDate(this.rangeTime[1] / 1000);
|
||||
|
||||
@@ -359,6 +403,8 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
// 关闭当前页面
|
||||
closeCurrentPage() {
|
||||
|
||||
@@ -92,7 +92,9 @@ export default {
|
||||
render: (h, params) => {
|
||||
if (params.row.couponActivityType === "REGISTERED") {
|
||||
return h("div", ["注册赠券"]);
|
||||
} else {
|
||||
}else if(params.row.couponActivityType === 'AUTO_COUPON'){
|
||||
return h("div", ["自动发券"]);
|
||||
}else {
|
||||
return h("div", ["精确发券"]);
|
||||
}
|
||||
},
|
||||
@@ -111,6 +113,25 @@ export default {
|
||||
return h("div", [text]);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "领取频率",
|
||||
key: "couponFrequencyEnum",
|
||||
minWidth: 120,
|
||||
render: (h, params) => {
|
||||
console.log(params)
|
||||
let text = ''
|
||||
if (params.row.couponFrequencyEnum === "DAY") {
|
||||
text = "每日";
|
||||
} else if(params.row.couponFrequencyEnum === "WEEK") {
|
||||
text = "每周";
|
||||
} else if(params.row.couponFrequencyEnum === 'MONTH'){
|
||||
text = '每月'
|
||||
} else {
|
||||
text = '/'
|
||||
}
|
||||
return h("div", [text]);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "活动时间",
|
||||
minWidth: 150,
|
||||
@@ -121,6 +142,8 @@ export default {
|
||||
innerHTML: params.row.startTime + "<br/>" + params.row.endTime,
|
||||
},
|
||||
});
|
||||
}else{
|
||||
return h("div", '/');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<FormItem label="有效期" prop="rangeTime">
|
||||
<div v-if="form.getType == 'ACTIVITY'">
|
||||
<RadioGroup v-model="rangeTimeType">
|
||||
<Radio :disabled="disabled" :label="1">起止时间</Radio>
|
||||
<Radio :disabled="disabled" :label="1" v-if="form.getType !== 'ACTIVITY'">起止时间</Radio>
|
||||
<Radio :disabled="disabled" :label="0">固定时间</Radio>
|
||||
</RadioGroup>
|
||||
</div>
|
||||
@@ -144,6 +144,7 @@
|
||||
<div class="effectiveDays" v-if="rangeTimeType == 0">
|
||||
领取当天开始
|
||||
<InputNumber
|
||||
:disabled="disabled"
|
||||
v-model="form.effectiveDays"
|
||||
:min="1"
|
||||
style="width: 100px"
|
||||
@@ -242,6 +243,11 @@ export default {
|
||||
handler(val) {
|
||||
if (val == "FREE") {
|
||||
this.rangeTimeType = 1;
|
||||
}else{
|
||||
this.rangeTimeType = 0;
|
||||
}
|
||||
if(this.rangeTimeType == 0){
|
||||
delete this.formRule.rangeTime
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
@@ -301,6 +307,7 @@ export default {
|
||||
promotionGoodsList: [],
|
||||
scopeIdGoods: [],
|
||||
rangeDayType: "",
|
||||
effectiveDays:1,
|
||||
},
|
||||
id: this.$route.query.id, // 优惠券id
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
||||
Reference in New Issue
Block a user