Commit 5a390a7a by lixiaomin

修改店铺

parent ce83b235
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<el-table-column label="售价" align="center" prop="price" /> <el-table-column label="售价" align="center" prop="price" />
<el-table-column label="折扣价" align="center" prop="discount" /> <el-table-column label="折扣价" align="center" prop="discount" />
<el-table-column label="总销量" align="center" prop="salesVolume" /> <el-table-column label="总销量" align="center" prop="salesVolume" />
<el-table-column label="上架时间" align="center" prop="shelfat" /> <el-table-column label="上架时间" align="center" prop="shelfAt" />
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" /> :limit.sync="queryParams.pageSize" @pagination="getList" />
......
...@@ -2,10 +2,20 @@ ...@@ -2,10 +2,20 @@
<div> <div>
<el-table v-loading="loading" :data="orderList"> <el-table v-loading="loading" :data="orderList">
<el-table-column label="商品名称" align="center" prop="name" /> <el-table-column label="商品名称" align="center" prop="name" />
<el-table-column label="编码" align="center" prop="code" /> <el-table-column label="缩略图" align="center" prop="" width="150">
<template slot-scope="scope">
<div class="image-tmp">
<el-image style="width: 100px; height: 100px" :src="getPicsList(scope.row.pics)" :preview-src-list="getPicsBigList(scope.row.pics)">
<div slot="error" class="image-slot"></div>
</el-image>
</div>
</template>
</el-table-column>
<el-table-column label="商品分类" align="center" prop="categoryName" width="100" />
<el-table-column label="折扣价" align="center" prop="discount" /> <el-table-column label="折扣价" align="center" prop="discount" />
<el-table-column label="原价" align="center" prop="price" /> <el-table-column label="原价" align="center" prop="price" />
<el-table-column label="销售总量" align="center" prop="salesVolume" /> <el-table-column label="销售总量" align="center" prop="salesVolume" />
<el-table-column label="推荐时间" align="center" prop="recDate" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popconfirm title="确定要移除吗?" @confirm="removeRecommend(scope.row)"> <el-popconfirm title="确定要移除吗?" @confirm="removeRecommend(scope.row)">
...@@ -59,7 +69,17 @@ export default { ...@@ -59,7 +69,17 @@ export default {
this.$modal.msgSuccess("移除成功"); this.$modal.msgSuccess("移除成功");
this.getList() this.getList()
}) })
} },
getPicsList(str){
let picObj = JSON.parse(str);
return picObj.thumbnail
},
getPicsBigList(str){
let list=[];
let picObj = JSON.parse(str);
list.push(picObj.thumbnail)
return list;
},
} }
} }
</script> </script>
......
...@@ -28,8 +28,12 @@ ...@@ -28,8 +28,12 @@
<el-input v-model="form.address" placeholder="请输入详细地址" /> <el-input v-model="form.address" placeholder="请输入详细地址" />
</el-form-item> </el-form-item>
<el-form-item label="营业时间" prop="time"> <el-form-item label="营业时间" prop="time">
<el-date-picker style="width:100%" v-model="form.time" type="daterange" range-separator="~" <el-date-picker
start-placeholder="开始日期" end-placeholder="结束日期"> v-model="form.time"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
...@@ -105,11 +109,12 @@ export default { ...@@ -105,11 +109,12 @@ export default {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
const { time, province, ...surplus } = this.form const { time, province, ...surplus } = this.form
surplus.startTime = moment(time[0]).format('YYYY-MM-DD hh:mm:ss') surplus.startTime = time[0]
surplus.endTime = moment(time[1]).format('YYYY-MM-DD hh:mm:ss') surplus.endTime = time[1]
surplus.province = province[0] surplus.province = province[0]
surplus.city = province[1] surplus.city = province[1]
surplus.zone = province[2] surplus.zone = province[2]
console.log("surplus",surplus);
if (surplus.id != null) { if (surplus.id != null) {
updateShop(surplus).then((res) => { updateShop(surplus).then((res) => {
if(res.code=="200"){ if(res.code=="200"){
...@@ -153,7 +158,7 @@ export default { ...@@ -153,7 +158,7 @@ export default {
getShopInfo(id) { getShopInfo(id) {
getShop(id).then(({ data }) => { getShop(id).then(({ data }) => {
const { startTime, endTime, province, city, zone, ...surplus } = data const { startTime, endTime, province, city, zone, ...surplus } = data
surplus.time = [moment(startTime), moment(endTime)] surplus.time = [startTime, endTime]
surplus.province = [province, city, zone] surplus.province = [province, city, zone]
this.form = surplus; this.form = surplus;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</el-table-column> </el-table-column>
<el-table-column label="折扣价" align="center" prop="discount" /> <el-table-column label="折扣价" align="center" prop="discount" />
<el-table-column label="总销量" align="center" prop="salesVolume" /> <el-table-column label="总销量" align="center" prop="salesVolume" />
<el-table-column label="上架时间" align="center" prop="shelfat" width="150" /> <el-table-column label="上架时间" align="center" prop="shelfAt" width="150" />
<el-table-column label="状态" align="center" prop="state" width="150"> <el-table-column label="状态" align="center" prop="state" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.state == 1">售卖</span> <span v-if="scope.row.state == 1">售卖</span>
...@@ -119,6 +119,7 @@ export default { ...@@ -119,6 +119,7 @@ export default {
}, },
getList() { getList() {
if (!this.shopId) return; if (!this.shopId) return;
this.list=[];
getCategoryGoods(this.shopId).then(({ data }) => { getCategoryGoods(this.shopId).then(({ data }) => {
if (data && data.length > 0) { if (data && data.length > 0) {
this.options = data; this.options = data;
......
...@@ -62,7 +62,19 @@ ...@@ -62,7 +62,19 @@
<el-table-column label="总销售金额" align="center" prop="salesAmount" /> <el-table-column label="总销售金额" align="center" prop="salesAmount" />
<el-table-column label="总销量" align="center" prop="salesVolume" /> <el-table-column label="总销量" align="center" prop="salesVolume" />
<el-table-column label="创建时间" align="center" prop="createdAt" /> <el-table-column label="创建时间" align="center" prop="createdAt" />
<el-table-column label="营业时间" align="center" /> <el-table-column label="营业时间" align="center">
<template slot-scope="scope">
<div>
<span >{{scope.row.startTime}}</span>
</div>
<div>
<span >~</span>
</div>
<div>
<span >{{scope.row.endTime}}</span>
</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="state"> <el-table-column label="状态" align="center" prop="state">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.state == 1">正常营业</span> <span v-if="scope.row.state == 1">正常营业</span>
...@@ -133,21 +145,18 @@ export default { ...@@ -133,21 +145,18 @@ export default {
label: '全部' label: '全部'
}], }],
options: [{ options: [{
value: '',
label: '全部'
},{
value: '1', value: '1',
label: '已创建' label: '正常营业'
}, { }, {
value: '2', value: '2',
label: '已完成编程' label: '暂停营业'
}, { }, {
value: '3', value: '3',
label: '已上架'
}, {
value: '4',
label: '已下架'
}, {
value: '5',
label: '已删除' label: '已删除'
}], }]
}; };
}, },
created() { created() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment