商品添加缓存 活动
This commit is contained in:
parent
43df2b637b
commit
c79049443a
|
|
@ -417,6 +417,17 @@ export function modityActivate(data) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增、修改活动 新的!
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function storageupActivate(data) {
|
||||||
|
return request({
|
||||||
|
url: `/shop/storage/upActivate`,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 活动列表
|
* 活动列表
|
||||||
* @returns
|
* @returns
|
||||||
|
|
|
||||||
|
|
@ -437,7 +437,7 @@ export default {
|
||||||
Editor,
|
Editor,
|
||||||
addImg,
|
addImg,
|
||||||
},
|
},
|
||||||
name:'add_shop',
|
name: 'add_shop',
|
||||||
data() {
|
data() {
|
||||||
const validatordateUsed = (rule, value, callback) => {
|
const validatordateUsed = (rule, value, callback) => {
|
||||||
if (!this.form.notices.dateUsed) {
|
if (!this.form.notices.dateUsed) {
|
||||||
|
|
@ -602,17 +602,32 @@ export default {
|
||||||
batchNumberForm: {
|
batchNumberForm: {
|
||||||
batchNumber: 0,
|
batchNumber: 0,
|
||||||
},
|
},
|
||||||
|
routequery: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.tbShopUnit();
|
this.tbShopUnit();
|
||||||
this.tbShopCategoryGet();
|
this.tbShopCategoryGet();
|
||||||
this.changeTypeEnum(0);
|
this.changeTypeEnum(0);
|
||||||
|
|
||||||
if (this.$route.query.goods_id) {
|
if (this.$route.query.goods_id) {
|
||||||
this.tbProductGetDetail();
|
this.tbProductGetDetail();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听路由对象中的参数变化
|
||||||
|
$route(to, from) {
|
||||||
|
console.log(to.query.goods_id)
|
||||||
|
if (to.query.goods_id) {
|
||||||
|
if (this.routequery == to.query.goods_id) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
this.tbProductGetDetail();
|
||||||
|
}
|
||||||
|
this.routequery = to.query.goods_id
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
uploadImgSucess(res, item) {
|
uploadImgSucess(res, item) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
|
|
||||||
|
|
@ -298,11 +298,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
console.log(this.$route.query.productId, 'tiaoshi1')
|
|
||||||
if (this.$route.query.productId) {
|
if (this.$route.query.productId) {
|
||||||
this.query.productId = this.$route.query.productId
|
this.query.productId = this.$route.query.productId
|
||||||
}
|
}
|
||||||
console.log(this.query)
|
|
||||||
|
|
||||||
await this.tbShopCategoryGet()
|
await this.tbShopCategoryGet()
|
||||||
await this.getTableData()
|
await this.getTableData()
|
||||||
|
|
@ -533,7 +531,6 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(res);
|
|
||||||
|
|
||||||
this.tableData.loading = false
|
this.tableData.loading = false
|
||||||
this.tableData.data = res.content
|
this.tableData.data = res.content
|
||||||
|
|
|
||||||
|
|
@ -19,24 +19,26 @@
|
||||||
下载会员充值二维码
|
下载会员充值二维码
|
||||||
</el-button>
|
</el-button>
|
||||||
<div style="margin-top: 35px; font-size: 16px; color: #333;">
|
<div style="margin-top: 35px; font-size: 16px; color: #333;">
|
||||||
允许充值自定义金额:<el-switch v-model="shopInfo.isCustom" active-value="1" inactive-value="0" size="large" @change="customStatusChange"></el-switch>
|
允许充值自定义金额:<el-switch v-model="shopInfo.isCustom" active-value="1" inactive-value="0" size="large"
|
||||||
|
@change="customStatusChange"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||||
<el-table-column label="店铺ID" prop="shopId"></el-table-column>
|
<el-table-column label="店铺ID" prop="shopId"></el-table-column>
|
||||||
<el-table-column label="最小金额" prop="minNum"></el-table-column>
|
<el-table-column label="充值金额" prop="amount"></el-table-column>
|
||||||
<el-table-column label="最大金额" prop="maxNum"></el-table-column>
|
<el-table-column label="赠送金额" prop="giftAmount"></el-table-column>
|
||||||
<el-table-column label="赠送金额" prop="handselNum"></el-table-column>
|
<!-- <el-table-column label="赠送金额" prop="handselNum"></el-table-column>
|
||||||
<el-table-column label="赠送类型" prop="handselType">
|
<el-table-column label="是否使用优惠券" prop="isUseCoupon">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.handselType | handselTypeFilter }}
|
{{ scope.row.handselType | handselTypeFilter }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="排序" sortable prop="sort"></el-table-column> -->
|
<el-table-column label="排序" sortable prop="sort"></el-table-column> -->
|
||||||
<el-table-column label="是否启用" prop="isDel">
|
<el-table-column label="赠送积分" prop="giftPoints"></el-table-column>
|
||||||
|
<el-table-column label="是否使用优惠券" prop="isUseCoupon">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.isDel" active-value="0" inactive-value="1"
|
<el-switch v-model="scope.row.isUseCoupon" :active-value="1" :inactive-value="0"
|
||||||
@change="statusChange($event, scope.row)"></el-switch>
|
@change="statusChange($event, scope.row)"></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -65,7 +67,7 @@
|
||||||
import handselTypes from './handselTypes'
|
import handselTypes from './handselTypes'
|
||||||
import addActive from './components/addActive'
|
import addActive from './components/addActive'
|
||||||
import QR from './components/downloadQR.vue'
|
import QR from './components/downloadQR.vue'
|
||||||
import { findActivate, modityActivate } from '@/api/shop'
|
import { findActivate, storageupActivate } from '@/api/shop'
|
||||||
import { tbShopInfo, tbShopInfoPut } from "@/api/user";
|
import { tbShopInfo, tbShopInfoPut } from "@/api/user";
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -107,8 +109,9 @@ export default {
|
||||||
try {
|
try {
|
||||||
this.tableData.loading = true
|
this.tableData.loading = true
|
||||||
const data = { ...row }
|
const data = { ...row }
|
||||||
data.status = e
|
data.isUseCoupon = e
|
||||||
await modityActivate(data)
|
console.log(data.isUseCoupon)
|
||||||
|
await storageupActivate(data)
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
@ -151,7 +154,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(this.shopInfo);
|
console.log(this.shopInfo);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,23 @@
|
||||||
<div>
|
<div>
|
||||||
<el-dialog :title="form.id ? '编辑活动' : '添加活动'" :visible.sync="dialogVisible" @close="reset">
|
<el-dialog :title="form.id ? '编辑活动' : '添加活动'" :visible.sync="dialogVisible" @close="reset">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
|
||||||
<el-form-item label="最小金额">
|
<el-form-item label="充值">
|
||||||
|
<template>
|
||||||
|
<div style="display: flex;">
|
||||||
|
<el-input style="width: 220px;" placeholder="请输入金额" v-model="form.amount">
|
||||||
|
<template slot="prepend">满</template>
|
||||||
|
<template slot="append">元</template>
|
||||||
|
</el-input>
|
||||||
|
<el-input style="margin-left: 20px; width: 220px;" placeholder="请输入金额"
|
||||||
|
v-model="form.giftAmount">
|
||||||
|
<template slot="prepend">赠</template>
|
||||||
|
<template slot="append">元</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item label="最小金额">
|
||||||
<el-input-number v-model="form.minNum" controls-position="right" :min="1"></el-input-number>
|
<el-input-number v-model="form.minNum" controls-position="right" :min="1"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="最大金额">
|
<el-form-item label="最大金额">
|
||||||
|
|
@ -11,22 +27,35 @@
|
||||||
<el-form-item label="赠送金额">
|
<el-form-item label="赠送金额">
|
||||||
<el-input-number v-model="form.handselNum" controls-position="right" :min="0"></el-input-number>
|
<el-input-number v-model="form.handselNum" controls-position="right" :min="0"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="赠送类型">
|
<el-form-item label="赠送类型">
|
||||||
<el-select v-model="form.handselType">
|
<el-select v-model="form.handselType">
|
||||||
<el-option :label="item.label" :value="item.value" v-for="item in handselTypes"
|
<el-option :label="item.label" :value="item.value" v-for="item in handselTypes"
|
||||||
:key="item.value"></el-option>
|
:key="item.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item> -->
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-switch v-model="form.isDel" active-value="0" inactive-value="1"></el-switch>
|
<el-switch v-model="form.isDel" active-value="0" inactive-value="1"></el-switch>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<el-form-item label="是否使用优惠券">
|
||||||
|
<el-switch v-model="form.isUseCoupon" :active-value="1" :inactive-value="0"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否赠送商品">
|
<el-form-item label="数量">
|
||||||
<el-switch v-model="form.isGiftPro" :active-value="1" :inactive-value="0"></el-switch>
|
<el-input-number v-model="form.num" controls-position="right" :min="1"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="赠送商品">
|
<el-form-item label="积分">
|
||||||
|
<template>
|
||||||
|
<div class="labelboxss">
|
||||||
|
<div>赠送</div>
|
||||||
|
<el-input style="width: 140px;margin: 0 15px;" v-model="form.giftPoints"></el-input>
|
||||||
|
<div>积分</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="选择优惠劵">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.shopListRef.show([...productIds])">
|
<el-button type="primary" icon="el-icon-plus" @click="$refs.shopListRef.show([...productIds])">
|
||||||
添加商品
|
添加优惠劵
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="shop_list">
|
<div class="shop_list">
|
||||||
|
|
@ -53,7 +82,9 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import handselTypes from '../handselTypes'
|
import handselTypes from '../handselTypes'
|
||||||
import { modityActivate, activate } from '@/api/shop'
|
import { activate, storageupActivate } from '@/api/shop'
|
||||||
|
import { queryReceive } from '@/api/coupon'
|
||||||
|
|
||||||
import shopList from '@/components/shopList'
|
import shopList from '@/components/shopList'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -70,7 +101,10 @@ export default {
|
||||||
maxNum: 1,
|
maxNum: 1,
|
||||||
handselNum: 1, // 打印类型
|
handselNum: 1, // 打印类型
|
||||||
handselType: 'GD',
|
handselType: 'GD',
|
||||||
isDel: '0'
|
isDel: '0',
|
||||||
|
num: 1,
|
||||||
|
amount: '',
|
||||||
|
giftAmount: ''
|
||||||
},
|
},
|
||||||
productIds: [],
|
productIds: [],
|
||||||
resetForm: '',
|
resetForm: '',
|
||||||
|
|
@ -125,21 +159,28 @@ export default {
|
||||||
this.form.config.categoryList = e
|
this.form.config.categoryList = e
|
||||||
},
|
},
|
||||||
onSubmitHandle() {
|
onSubmitHandle() {
|
||||||
// console.log(this.form)
|
console.log(this.form)
|
||||||
let arr = []
|
if (this.form.amount == '') {
|
||||||
this.productIds.forEach(ele => {
|
this.$message({
|
||||||
arr.push({
|
message: '充值金额不能为空',
|
||||||
productId: ele.id,
|
type: 'warning'
|
||||||
num: ele.num
|
});
|
||||||
})
|
return false;
|
||||||
})
|
}
|
||||||
this.form.products = arr
|
// let arr = []
|
||||||
|
// this.productIds.forEach(ele => {
|
||||||
|
// arr.push({
|
||||||
|
// productId: ele.id,
|
||||||
|
// num: ele.num
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// this.form.products = arr
|
||||||
this.$refs.form.validate(async valid => {
|
this.$refs.form.validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.form.shopId = localStorage.getItem('shopId')
|
this.form.shopId = localStorage.getItem('shopId')
|
||||||
let res = await modityActivate(this.form)
|
let res = await storageupActivate(this.form)
|
||||||
this.$emit('success', res)
|
this.$emit('success', res)
|
||||||
this.close()
|
this.close()
|
||||||
this.$notify({
|
this.$notify({
|
||||||
|
|
@ -159,8 +200,8 @@ export default {
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
if (obj && obj.id) {
|
if (obj && obj.id) {
|
||||||
this.form = { ...obj }
|
this.form = { ...obj }
|
||||||
let res = await activate(obj.id)
|
// let res = await activate(obj.id)
|
||||||
this.productIds = res
|
// this.productIds = res
|
||||||
console.log(res, '调试1')
|
console.log(res, '调试1')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -174,6 +215,35 @@ export default {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.labelbox {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666666;
|
||||||
|
width: 130px;
|
||||||
|
background: #F7F7FA;
|
||||||
|
border-radius: 2px 2px 2px 2px;
|
||||||
|
border: 1px solid #DDDFE6;
|
||||||
|
padding: 0 10px;
|
||||||
|
|
||||||
|
input {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.labelboxss {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
|
||||||
.shop_list {
|
.shop_list {
|
||||||
// display: flex;/
|
// display: flex;/
|
||||||
// flex-wrap: wrap;
|
// flex-wrap: wrap;
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,14 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show() {
|
show() {
|
||||||
this.isshow = true
|
|
||||||
this.getlist()
|
this.getlist()
|
||||||
},
|
},
|
||||||
async getlist() {
|
async getlist() {
|
||||||
let res = await getwxacode({
|
let res = await getwxacode({
|
||||||
shopId: localStorage.getItem('shopId')
|
shopId: localStorage.getItem('shopId')
|
||||||
})
|
})
|
||||||
|
this.isshow = true
|
||||||
|
|
||||||
this.imgUrl = res
|
this.imgUrl = res
|
||||||
}, downImg() {
|
}, downImg() {
|
||||||
// window.location.href()
|
// window.location.href()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue