Browse Source

yshop1.6发布:新增砍价功能,新增加锁功能,修复其他bug

master
hupeng 5 years ago
parent
commit
1ccc3e7092
  1. 1
      src/icons/svg/bargain.svg
  2. 34
      src/views/activity/bargain/form.vue
  3. 21
      src/views/activity/bargain/index.vue
  4. 2
      src/views/components/Editor.vue
  5. 9
      src/views/shop/goods/index.vue

1
src/icons/svg/bargain.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577087533544" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2122" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M344.502857 655.36a18.651429 18.651429 0 0 1-13.165714-5.485714l-161.28-161.645715A17.188571 17.188571 0 0 1 164.571429 475.428571V146.285714a18.285714 18.285714 0 0 1 18.285714-18.285714h329.142857a17.188571 17.188571 0 0 1 12.8 5.485714l179.2 178.834286a18.651429 18.651429 0 0 1 5.485714 13.531429 19.382857 19.382857 0 0 1-6.217143 13.165714l-346.697142 311.588571a20.114286 20.114286 0 0 1-12.068572 4.754286zM201.142857 467.748571l143.725714 144.091429 319.634286-287.085714-160.182857-160.182857H201.142857z m201.142857-10.605714a91.428571 91.428571 0 1 1 91.428572-91.428571 91.428571 91.428571 0 0 1-91.428572 91.428571z m0-146.285714a54.857143 54.857143 0 1 0 54.857143 54.857143A54.857143 54.857143 0 0 0 402.285714 310.857143z" p-id="2123"></path><path d="M603.428571 950.857143a17.188571 17.188571 0 0 1-12.8-5.485714L365.714286 721.554286a17.92 17.92 0 0 1 0-24.868572l311.222857-347.062857a19.017143 19.017143 0 0 1 13.165714-5.851428 20.114286 20.114286 0 0 1 13.531429 5.12l241.371428 241.737142a17.554286 17.554286 0 0 1 0 25.6l-329.142857 329.142858a17.188571 17.188571 0 0 1-12.434286 5.485714z m-198.582857-242.834286l198.582857 198.582857 303.177143-303.177143-214.674285-215.04z" p-id="2124"></path><path d="M250.88 870.034286a18.285714 18.285714 0 0 1-12.8-5.12l-68.022857-68.388572a17.92 17.92 0 0 1-5.485714-13.165714 16.822857 16.822857 0 0 1 6.217142-13.165714L841.142857 169.325714a18.285714 18.285714 0 0 1 25.234286 0 18.651429 18.651429 0 0 1 0 24.868572L264.777143 864.182857a19.017143 19.017143 0 0 1-13.165714 5.851429z m-41.325714-85.577143l40.594285 40.96 360.594286-402.285714z" p-id="2125"></path></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

34
src/views/activity/bargain/form.vue

@ -1,16 +1,18 @@
<template> <template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启砍价'" width="900px"> <el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启砍价'" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px"> <el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="砍价名称" > <el-form-item label="砍价活动名称" >
<el-input v-model="form.title" style="width: 500px;"/> <el-input v-model="form.title" style="width: 500px;"/>
</el-form-item> </el-form-item>
<el-form-item label="砍价简介" > <el-form-item label="砍价活动简介" >
<el-input v-model="form.info" style="width: 500px;" rows="5" type="textarea"/> <el-input v-model="form.info" style="width: 500px;" rows="5" type="textarea"/>
</el-form-item> </el-form-item>
<el-form-item label="砍价产品名称" >
<el-input v-model="form.storeName" style="width: 500px;" />
</el-form-item>
<el-form-item label="单位" > <el-form-item label="单位" >
<el-input v-model="form.unitName" style="width: 500px;"/> <el-input v-model="form.unitName" style="width: 500px;"/>
</el-form-item> </el-form-item>
<el-form-item label="秒杀开始时间" > <el-form-item label="秒杀开始时间" >
<template> <template>
<el-date-picker <el-date-picker
@ -41,17 +43,13 @@
<el-form-item label="销量" > <el-form-item label="销量" >
<el-input-number v-model="form.sales" /> <el-input-number v-model="form.sales" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="砍价产品名称" >-->
<!-- <el-input v-model="form.storeName" />-->
<!-- </el-form-item>-->
<el-form-item label="砍价金额" > <el-form-item label="砍价金额" >
<el-input-number v-model="form.price" /> <el-input-number v-model="form.price" />
</el-form-item> </el-form-item>
<el-form-item label="允许砍到最低价" > <el-form-item label="最低购买价" >
<el-input-number v-model="form.minPrice" /> <el-input-number v-model="form.minPrice" />
</el-form-item> </el-form-item>
<el-form-item label="限购" > <el-form-item label="允许购买数量" >
<el-input-number v-model="form.num" /> <el-input-number v-model="form.num" />
</el-form-item> </el-form-item>
<el-form-item label="单次砍最高价" > <el-form-item label="单次砍最高价" >
@ -60,26 +58,12 @@
<el-form-item label="单次砍最低价" > <el-form-item label="单次砍最低价" >
<el-input-number v-model="form.bargainMinPrice" /> <el-input-number v-model="form.bargainMinPrice" />
</el-form-item> </el-form-item>
<el-form-item label="用户每次砍价的次数" >
<el-input-number v-model="form.bargainNum" />
</el-form-item>
<el-form-item label="反多少积分" >
<el-input-number v-model="form.giveIntegral" />
</el-form-item>
<el-form-item label="砍价状态" >
<el-radio v-model="form.status" :label="1">到砍价时间自动开启</el-radio>
<el-radio v-model="form.status" :label="0" style="width: 110px;">到砍价时间不自动开启</el-radio>
</el-form-item>
<el-form-item label="成本价" > <el-form-item label="成本价" >
<el-input-number v-model="form.cost" /> <el-input-number v-model="form.cost" />
</el-form-item> </el-form-item>
<el-form-item label="排序" > <el-form-item label="排序" >
<el-input-number v-model="form.sort" /> <el-input-number v-model="form.sort" />
</el-form-item> </el-form-item>
<el-form-item label="是否推荐" >
<el-radio v-model="form.isHot" :label="1"></el-radio>
<el-radio v-model="form.isHot" :label="0" style="width: 110px;"></el-radio>
</el-form-item>
<el-form-item label="是否包邮" > <el-form-item label="是否包邮" >
<el-radio v-model="form.isPostage" :label="1"></el-radio> <el-radio v-model="form.isPostage" :label="1"></el-radio>
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;"></el-radio> <el-radio v-model="form.isPostage" :label="0" style="width: 110px;"></el-radio>
@ -87,6 +71,10 @@
<el-form-item label="邮费" v-if="form.isPostage ===0"> <el-form-item label="邮费" v-if="form.isPostage ===0">
<el-input-number v-model="form.postage" /> <el-input-number v-model="form.postage" />
</el-form-item> </el-form-item>
<el-form-item label="活动状态" >
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0" style="width: 110px;">关闭</el-radio>
</el-form-item>
<el-form-item label="砍价规则" > <el-form-item label="砍价规则" >
<editor v-model="form.rule" /> <editor v-model="form.rule" />
</el-form-item> </el-form-item>

21
src/views/activity/bargain/index.vue

@ -3,21 +3,11 @@
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<!-- 新增 --> <!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div> </div>
<!--表单组件--> <!--表单组件-->
<eForm ref="form" :is-add="isAdd"/> <eForm ref="form" :is-add="isAdd"/>
<!--表格渲染--> <!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;"> <el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="砍价产品ID"/>
<el-table-column prop="title" label="砍价标题"/> <el-table-column prop="title" label="砍价标题"/>
<el-table-column prop="info" label="砍价简介"/> <el-table-column prop="info" label="砍价简介"/>
<el-table-column prop="image" label="砍价图片"> <el-table-column prop="image" label="砍价图片">
@ -25,9 +15,14 @@
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a> <a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unitName" label="单位名称"/> <el-table-column prop="price" label="砍价价格"/>
<el-table-column prop="price" label="砍价区间">
<template slot-scope="scope">
<span>{{ scope.row.bargainMinPrice }}~{{ scope.row.bargainMaxPrice }}</span>
</template>
</el-table-column>
<el-table-column prop="minPrice" label="最低价"/>
<el-table-column prop="stock" label="库存"/> <el-table-column prop="stock" label="库存"/>
<el-table-column prop="sales" label="销量"/>
<el-table-column prop="startTime" label="开始时间"> <el-table-column prop="startTime" label="开始时间">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.startTime) }}</span> <span>{{ formatTimeTwo(scope.row.startTime) }}</span>
@ -38,9 +33,7 @@
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span> <span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="storeName" label="砍价产品名称"/>-->
<el-table-column prop="look" label="浏览量"/> <el-table-column prop="look" label="浏览量"/>
<el-table-column prop="share" label="分享量"/>
<el-table-column v-if="checkPermission(['ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT','YXSTOREBARGAIN_DELETE'])" label="操作" width="150px" align="center"> <el-table-column v-if="checkPermission(['ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT','YXSTOREBARGAIN_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/> <el-button v-permission="['ADMIN','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>

2
src/views/components/Editor.vue

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div ref="editor" style="text-align:left;margin: 5px"> <div ref="editor" style="text-align:left;margin: 5px;width: 700px">
</div> </div>
</div> </div>
</template> </template>

9
src/views/shop/goods/index.vue

@ -293,7 +293,8 @@ export default {
merId: data.merId, merId: data.merId,
image: data.image, image: data.image,
images: data.sliderImage, images: data.sliderImage,
title: data.storeName, title: '',
storeName: data.storeName,
info: data.storeInfo, info: data.storeInfo,
postage: data.postage, postage: data.postage,
unitName: data.unitName, unitName: data.unitName,
@ -313,7 +314,11 @@ export default {
num: 1, num: 1,
giveIntegral: 0, giveIntegral: 0,
isDel: 0, isDel: 0,
browse: 0 browse: 0,
bargainMaxPrice: 10,
bargainMinPrice: 0.01,
minPrice: 0.01,
bargainNum: 1
} }
_this.dialog = true _this.dialog = true
}, },

Loading…
Cancel
Save