yshop1.5版本新增秒杀功能,手机端新增H5支付,修复其他bug,导出最新sql

This commit is contained in:
hupeng
2019-12-17 18:49:35 +08:00
parent c69b599781
commit 81fe09b633
11 changed files with 663 additions and 9 deletions

View File

@ -23,6 +23,7 @@
<eForm ref="form" :is-add="isAdd"/>
<eAttr ref="form2" :is-attr="isAttr"/>
<comForm ref="form3" :is-add="isAdd"/>
<killForm ref="form4" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="商品id"/>
@ -72,6 +73,10 @@
<el-button v-permission="['ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT']" size="mini"
type="primary" @click="editC(scope.row)">开启拼团</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button v-permission="['ADMIN','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT']" size="mini"
type="primary" @click="editD(scope.row)">开启秒杀</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@ -95,8 +100,9 @@ import { del, onsale } from '@/api/yxStoreProduct'
import eForm from './form'
import eAttr from './attr'
import comForm from '@/views/activity/combination/form'
import killForm from '@/views/activity/seckill/form'
export default {
components: { eForm, eAttr, comForm },
components: { eForm, eAttr, comForm, killForm },
mixins: [initData],
data() {
return {
@ -241,6 +247,38 @@ export default {
}
_this.dialog = true
},
editD(data) {
this.isAdd = false
const _this = this.$refs.form4
_this.form = {
productId: data.id,
merId: data.merId,
image: data.image,
images: data.sliderImage,
title: data.storeName,
info: data.storeInfo,
postage: data.postage,
unitName: data.unitName,
sort: data.sort,
sales: data.sales,
stock: data.stock,
isShow: data.isShow,
status: 1,
isHot: data.isHot,
description: data.description,
isPostage: data.isPostage,
people: 0,
price: 0.01,
effectiveTime: 24,
otPrice: data.otPrice,
cost: data.cost,
num: 1,
giveIntegral: 0,
isDel: 0,
browse: 0
}
_this.dialog = true
},
attr(data) {
console.log(3333)
this.isAttr = false

View File

@ -5,7 +5,7 @@
<span>收货信息</span>
<!--<el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>-->
</div>
<div>用户昵称: {{ form.nickname }}</div>
<div>用户昵称:{{ form.nickname }}</div>
<div>收货人: {{ form.realName }}</div>
<div>联系电话: {{ form.userPhone }}</div>
<div>收货地址: {{ form.userAddress }}</div>

View File

@ -80,7 +80,7 @@
@click="refund(scope.row)">
立刻退款</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-dropdown-item v-if="scope.row._status == 1 || scope.row._status == 6 || scope.row._status == 7">
<el-popover
v-permission="['ADMIN','YXSTOREORDER_ALL','YXSTOREORDER_DELETE']"
:ref="scope.row.id"

View File

@ -0,0 +1,118 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID"/>
<el-table-column prop="map.time" label="开启时间(整数小时)"/>
<el-table-column prop="map.continued" label="持续时间(整数小时)"/>
<el-table-column v-if="checkPermission(['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxSystemGroupData'
import eForm from './seckillform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'routine_seckill_time' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
time: data.map.time,
continued: data.map.continued
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,101 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
<el-form-item label="开启时间(整数小时)" >
<el-input v-model="form.time" style="width: 270px;"/>
</el-form-item>
<el-form-item label="持续时间(整数小时)" >
<el-input v-model="form.continued" style="width: 270px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
export default {
components: { picUpload },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'routine_seckill_time',
time: 5,
continued: 2
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'routine_seckill_time',
value: '',
addTime: '',
sort: '',
status: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -2,10 +2,10 @@
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="第几天" >
<el-input v-model="form.day" style="width: 370px;"/>
<el-input v-model="form.day" style="width: 300px;"/>
</el-form-item>
<el-form-item label="获取积分" >
<el-input v-model="form.sign_num" style="width: 370px;"/>
<el-input v-model="form.sign_num" style="width: 300px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">