Commit 4b257fd2 by cwq0219

首页设置

1 parent ad816bf0
...@@ -2,15 +2,15 @@ import { http } from '@/main' ...@@ -2,15 +2,15 @@ import { http } from '@/main'
const defaultPath = 'scrm.api.carlife.' const defaultPath = 'scrm.api.carlife.'
// const getGoodsList = params => { const getGoodsListApi = params => {
// params.method = 'scrm.api.shopmall.goods.page.curMerchant' params.method = 'scrm.api.shopmall.goods.page.curMerchant'
// return http({ return http({
// url: 'rop-scrm-shopmall/router', url: 'rop-scrm-shopmall/router',
// method: 'GET', method: 'GET',
// data: params, data: params,
// sign: true sign: true
// }) })
// } }
const uploadImgApi = params => { const uploadImgApi = params => {
params.method = `${defaultPath}common.uploadImg` params.method = `${defaultPath}common.uploadImg`
...@@ -43,4 +43,4 @@ const getMerchantList = params => { ...@@ -43,4 +43,4 @@ const getMerchantList = params => {
// }) // })
// } // }
export default { uploadImgApi, getMerchantList } export default { getGoodsListApi, uploadImgApi, getMerchantList }
...@@ -10,4 +10,15 @@ const getHomeInfoListApi = params => { ...@@ -10,4 +10,15 @@ const getHomeInfoListApi = params => {
}) })
} }
export default { getHomeInfoListApi } const updateHomeApi = params => {
params.method = 'scrm.api.shopmall.homeConfig.update'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getHomeInfoListApi, updateHomeApi }
...@@ -51,6 +51,11 @@ ...@@ -51,6 +51,11 @@
height: 60px; height: 60px;
} }
.marketing .img-100 {
width: 100px;
height: 100px;
}
.marketing .footer { .marketing .footer {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
...@@ -68,6 +73,10 @@ ...@@ -68,6 +73,10 @@
justify-content: space-between; justify-content: space-between;
} }
.marketing .flex-grow {
flex: 1;
}
.marketing .edit-title { .marketing .edit-title {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
...@@ -79,22 +88,33 @@ ...@@ -79,22 +88,33 @@
margin: 0 0; margin: 0 0;
} }
.marketing .edit-sub-title::before { // .marketing .edit-sub-title::before {
position: absolute; // position: absolute;
display: inline-block; // display: inline-block;
content: ''; // content: '';
height: 18px; // height: 18px;
width: 4px; // width: 4px;
top: 2px; // top: 2px;
left: 0; // left: 0;
background-color: #0947C6; // background-color: #0947C6;
} // }
.marketing .edit-sub-title { .marketing .edit-sub-title {
position: relative; position: relative;
font-size: 16px; font-size: 13px;
font-weight: 700; font-weight: 700;
height: 32px;
line-height: 32px;
color: #333333; color: #333333;
margin: 0 0 30px 0; margin-bottom: 20px;
padding-left: 8px; padding-left: 8px;
background-color: rgba(242, 242, 242, 1);
}
.one-line-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
* @FilePath: \scrm\scrm-sub-blog\src\components\index.js * @FilePath: \scrm\scrm-sub-blog\src\components\index.js
*/ */
import Vue from 'vue' import Vue from 'vue'
// 导入权限按钮
// import _button from '@/components/glsx-button/index'
import glsxCombiForm from '@/components/glsx-combi-form/index.vue' import glsxCombiForm from '@/components/glsx-combi-form/index.vue'
// Vue.component('glsx-button', _button)
Vue.component('glsx-combi-form', glsxCombiForm)
\ No newline at end of file \ No newline at end of file
import selectMutiProDialog from '@/components/selectMutiProDialog/index.vue'
import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('select-muti-pro-dialog', selectMutiProDialog)
Vue.component('select-single-pro-dialog', selectSingleProDialog)
\ No newline at end of file \ No newline at end of file
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable ref="mutiProRef" :tableData="productList" :tableParams="tableParams" @refreshTable="getList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
</GLTable>
</glsx-dialog>
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '价格(元)',
prop: 'retailPrice'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
selectedProList: {
type: Array,
default: () => []
}
},
components: {
glsxDialog
},
mounted() {
this.getList(true)
},
methods: {
getList(isMounted = false) {
var params = {
goodsStatus: 1,
goodsSource: 1,
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
}
var that = this
this.$apis.common.getGoodsListApi(params).then(res => {
// console.log(res)
this.productList = res.list
this.$refs.mutiProRef.tableTotal = res.total
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
this.recoverySelected()
})
},
recoverySelected() {
if (this.selectedProList.length) {
this.selectedProList.forEach(row => {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
})
}
},
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
<!-- 选择商品 - 单选 -->
<template>
<glsx-dialog class="single-pro" title="选择商品" :isVisible.sync="isSingleSelectVisible" width="900px" @confirmDialog="handleSingleSelectConfirm" @closeDialog="handleSingleSelectClose">
<el-radio-group v-model="infoId">
<el-radio class="pro-box" v-for="item in productList" :key="item.id" :label="item.id">
<img :src="item.goodsImage" />
<div class="txt-box">
<p :title="item.goodsName" class="ellipsis">{{ item.goodsName }}</p>
<p class="f-s-12">销量:{{ item.saleAmount }}</p>
<p class="f-s-12">库存:{{ item.goodsStock }}</p>
<p class="f-s-12">零售价:{{ item.retailPrice }}</p>
<p :title="item.merchantName" class="ellipsis f-s-12">门店名称:{{ item.merchantName }}</p>
</div>
</el-radio>
</el-radio-group>
</glsx-dialog>
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectSingleProDialog',
data() {
return {
infoId: '',
minRatilPrice: '',
productList: []
}
},
props: {
isSingleSelectVisible: {
type: Boolean,
default: false
},
selectedProInfo: {
type: Object,
default: () => {}
}
},
components: {
glsxDialog
},
computed: {},
mounted() {
this.infoId = this.selectedProInfo.id
this.getList()
},
methods: {
getList() {
var params = {
goodsStatus: 1,
goodsSource: 1,
pageNum: 1,
pageSize: 100000
}
var that = this
this.$apis.common.getGoodsListApi(params).then(res => {
// console.log(res)
this.productList = res.list
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
})
},
handleSingleSelectConfirm() {
if (!this.infoId) {
this.$message.error('请选择商品')
return true
}
var selectInfo = this.productList.find(item => item.id === this.infoId)
this.$emit('handleSingleSelectConfirm', selectInfo)
},
handleSingleSelectClose() {
this.$emit('handleSingleSelectClose')
}
}
}
</script>
<style>
.single-pro .pro-box {
width: 202px;
border: 1px solid #cccccc;
margin: 0 10px 10px 0;
}
.single-pro p {
margin: 0 0 8px 0;
}
.single-pro .f-s-12 {
font-size: 12px;
}
.single-pro .pro-box img {
width: 202px;
height: 202px;
}
.single-pro .el-radio__input {
position: absolute;
top: 8px;
left: 8px;
}
.single-pro .el-radio__label {
padding: 0;
}
.single-pro .txt-box {
padding: 10px 10px 0;
color: #666666;
}
.single-pro .ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectMerchant" slot-scope="item" class="select-merchant"> <div slot="selectMerchant" slot-scope="scope" class="select-merchant">
<el-button type="primary" @click="handleRelateStoreClose(item)">{{ editForm.merchantList.length ? '更换' : '请选择' }}</el-button> <el-button type="primary" @click="handleRelateStoreClose(scope)">{{ editForm.merchantList.length ? '更换' : '请选择' }}</el-button>
</div> </div>
<div slot="merchantTable" class="select-merchant"> <div slot="merchantTable" class="select-merchant">
<GLTable v-show="editForm.merchantList.length" ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList"> <GLTable v-show="editForm.merchantList.length" ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList">
<span slot="auth-button" slot-scope="item"> <span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleMerchantDelete(item)">删除</el-button> <el-button type="text" @click="handleMerchantDelete(scope)">删除</el-button>
</span> </span>
</GLTable> </GLTable>
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!