Commit c59229fb by 张立顺

功能提交

1 parent 6b0b2b3c
@import '~@/assets/style/unit/color.scss';
// 工具类名统一前缀
$prefix: d2;
// 禁止用户选中 鼠标变为手形
%unable-select {
user-select: none;
cursor: pointer;
}
// 填满父元素
// 组要父元素 position: relative | absolute;
%full {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
// flex 垂直水平居中
%flex-center-row {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
}
%flex-center-col {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
// 将元素模拟成卡片外观
%card {
border: 1px solid #dddee1;
border-color: #e9eaec;
background: #fff;
border-radius: 4px;
font-size: 14px;
position: relative;
}
// element
.el-table--medium td {
padding: 4px 0 !important;
}
.el-table .cell {
padding: 0 0;
}
.el-range-editor--small.el-input__inner {
width: 100%;
}
.up-btns {
// position: absolute;
// bottom: 7%;
// right: 20px;
text-align: right;
padding: 10px 20px;
}
.ok-btn {
width: 100px;
margin-right: 40px;
}
.cancel-btn {
width: 100px;
color: #ffffff;
background: #999999;
}
.edit-title {
font-size: 18px;
font-weight: bold;
height: 48px;
line-height: 48px;
color: #0947C6;
border-bottom: 1px solid #E7EAEC;
// padding-left: 20px;
margin: 0 0;
}
.edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947C6;
}
.edit-sub-title {
position: relative;
font-size: 16px;
font-weight: 700;
color: #333333;
margin: 0 0 30px 0;
padding-left: 8px;
}
.title-tips {
font-size: 14px;
font-weight: normal;
color: #d9534f;
margin-left: 8px;
}
.table-header-left-txt {
font-size: 12px;
color: #6C6F71;
margin-left: 20px;
}
.el-input.is-disabled .el-input__inner {
color: #606266;
}
.suffix {
font-style: inherit;
color: #606266;
line-height: 30px;
}
// 公共样式-文字
// 页面标题
.car-main-head {
color: rgba(#000000, 0.85);
font-size: 20px;
font-weight: bold;
}
// 小标题
.car-sub-head {
color: rgba(#000000, 0.85);
font-size: 16px;
font-weight: bold;
}
// 强调 -加粗
.car-strong-txt {
color: rgba(#000000, 0.65);
font-size: 14px;
font-weight: bold;
}
// 正文
.car-txt {
color: rgba(#000000, 0.65);
font-size: 14px;
}
// 辅助文字
.car-help-txt {
color: rgba(#000000, 0.45);
font-size: 14px;
}
// 失效文字
.car-disabled-txt {
color: rgba(#000000, 0.25);
font-size: 14px;
}
// 链接文字
.car-link-txt {
color: #1890FF;
font-size: 14px;
}
// 错误提示
.car-error-txt {
color: #F5222D;
font-size: 14px;
}
// 提示图标
.tips-block {
position: relative;
}
.tips-label {
margin-right: 20px;
}
.tips-icon {
position: absolute;
display: inline-block;
width: 12px;
height: 12px;
top: 0px;
right: 14px;
margin-right: 4px;
cursor: pointer;
border: 1px solid #7f7f7f;
border-radius: 50%;
}
.tips-icon::before{
content: '?';
position: absolute;
width: 8px;
height: 8px;
top: -12px;
left: 1px;
font-size: 10px;
}
.one-line-ellipsis {
width: 100%;
white-space: nowrap;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
}
.two-line-ellipsis {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.blue {
color: #0947c6;
}
/* 以下两个修改箭头颜色 */
// .el-tooltip__popper[x-placement^='top'] .popper__arrow {
// border-top-color: #505050;
// opacity: 90%;
// }
// .el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
// border-top-color: #505050;
// opacity: 90%;
// }
// .tooltip-class {
// background-color: #505050 !important;
// opacity: 90%;
@import '~@/assets/style/unit/color.scss';
// 工具类名统一前缀
$prefix: d2;
// 禁止用户选中 鼠标变为手形
%unable-select {
user-select: none;
cursor: pointer;
}
// 填满父元素
// 组要父元素 position: relative | absolute;
%full {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
// flex 垂直水平居中
%flex-center-row {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
}
%flex-center-col {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
// 将元素模拟成卡片外观
%card {
border: 1px solid #dddee1;
border-color: #e9eaec;
background: #fff;
border-radius: 4px;
font-size: 14px;
position: relative;
}
// element
.el-table--medium td {
padding: 4px 0 !important;
}
.el-table .cell {
padding: 0 0;
}
.el-range-editor--small.el-input__inner {
width: 100%;
}
.up-btns {
// position: absolute;
// bottom: 7%;
// right: 20px;
text-align: right;
padding: 10px 20px;
}
.ok-btn {
width: 100px;
margin-right: 40px;
}
.pointer {
cursor: pointer;
}
.cancel-btn {
width: 100px;
color: #ffffff;
background: #999999;
}
.edit-title {
font-size: 18px;
font-weight: bold;
height: 48px;
line-height: 48px;
color: #0947C6;
border-bottom: 1px solid #E7EAEC;
// padding-left: 20px;
margin: 0 0;
}
.edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947C6;
}
.edit-sub-title {
position: relative;
font-size: 16px;
font-weight: 700;
color: #333333;
margin: 0 0 30px 0;
padding-left: 8px;
}
.title-tips {
font-size: 14px;
font-weight: normal;
color: #d9534f;
margin-left: 8px;
}
.table-header-left-txt {
font-size: 12px;
color: #6C6F71;
margin-left: 20px;
}
.el-input.is-disabled .el-input__inner {
color: #606266;
}
.suffix {
font-style: inherit;
color: #606266;
line-height: 30px;
}
// 公共样式-文字
// 页面标题
.car-main-head {
color: rgba(#000000, 0.85);
font-size: 20px;
font-weight: bold;
}
// 小标题
.car-sub-head {
color: rgba(#000000, 0.85);
font-size: 16px;
font-weight: bold;
}
// 强调 -加粗
.car-strong-txt {
color: rgba(#000000, 0.65);
font-size: 14px;
font-weight: bold;
}
// 正文
.car-txt {
color: rgba(#000000, 0.65);
font-size: 14px;
}
// 辅助文字
.car-help-txt {
color: rgba(#000000, 0.45);
font-size: 14px;
}
// 失效文字
.car-disabled-txt {
color: rgba(#000000, 0.25);
font-size: 14px;
}
// 链接文字
.car-link-txt {
color: #1890FF;
font-size: 14px;
}
// 错误提示
.car-error-txt {
color: #F5222D;
font-size: 14px;
}
// 提示图标
.tips-block {
position: relative;
}
.tips-label {
margin-right: 20px;
}
.tips-icon {
position: absolute;
display: inline-block;
width: 12px;
height: 12px;
top: 0px;
right: 14px;
margin-right: 4px;
cursor: pointer;
border: 1px solid #7f7f7f;
border-radius: 50%;
}
.tips-icon::before {
content: '?';
position: absolute;
width: 8px;
height: 8px;
top: -12px;
left: 1px;
font-size: 10px;
}
.one-line-ellipsis {
width: 100%;
white-space: nowrap;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
}
.two-line-ellipsis {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.blue {
color: #0947c6;
}
/* 以下两个修改箭头颜色 */
// .el-tooltip__popper[x-placement^='top'] .popper__arrow {
// border-top-color: #505050;
// opacity: 90%;
// }
// .el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
// border-top-color: #505050;
// opacity: 90%;
// }
// .tooltip-class {
// background-color: #505050 !important;
// opacity: 90%;
// }
\ No newline at end of file
......@@ -24,7 +24,7 @@
</span>
</span>
<div
:style="{'width': i.headImg ? 'calc(100% - 220px)' : '100%', 'display': 'inline-block'}">
:style="{'width': i.headImg ? 'calc(100% - 220px)' : '100%', 'display': 'inline-block'}">
<div v-for="(item, index) in i.formBlock"
:key="index"
:style="{'width': i.width || '100%', 'display': 'inline-block'}">
......@@ -159,7 +159,7 @@
{{ item.btnTxt }}
</el-button>
<span>已为该商品组合分配<span
class="relate-btn-txt">{{ formData[item.name] ? formData[item.name].length : 0 }}</span>家可见店铺</span>
class="relate-btn-txt">{{ formData[item.name] ? formData[item.name].length : 0 }}</span>家可见店铺</span>
</div>
<el-table :data="formData[item.name]"
style="width: 690px"
......@@ -204,7 +204,7 @@
添加绑定
</el-button>
<span>已将基础商品绑定<span
class="relate-btn-txt">{{ formData[item.name] ? formData[item.name].length : 0 }}</span>件升级商品</span>
class="relate-btn-txt">{{ formData[item.name] ? formData[item.name].length : 0 }}</span>件升级商品</span>
</div>
<div v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex"
......@@ -224,7 +224,7 @@
<div class="pro-price-block">
<p>建议升级价格:<span class="pro-price">{{ subItem.upgradePrice }}</span>元</p>
<p v-show="warrantyProList.includes(subItem.goodsType)">质保年限:<span
class="pro-price">{{ subItem.warrantyPeriod ? (subItem.warrantyPeriod + '年') : '无' }}</span>
class="pro-price">{{ subItem.warrantyPeriod ? (subItem.warrantyPeriod + '年') : '无' }}</span>
</p>
</div>
</div>
......@@ -242,7 +242,7 @@
+
</div>
<span
class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span>
class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span>
<input type="file"
name="thumbUrl"
:id="item.name + 'file'"
......@@ -281,7 +281,7 @@
+
</div>
<span
class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span>
class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span>
<input type="file"
style="opacity: 0"
:id="item.name + 'file'"
......
<!-- 表格+分页 -->
<template>
<div>
<el-table :data="getListApi ? data : tableData"
v-loading="loading"
border
:highlight-current-row="true"
:stripe="true"
@sort-change="sortChange">
<el-table-column align="center"
width="60px"
label="序号"
type="index"
:index="index=>index+(pagination.pageSize - 1) * pagination.pageCount + 1" />
<el-table-column v-for="(item, index) in tableParams.tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align||'center'"
:sortable="item.sortable">
<template slot-scope="scope">
<slot v-if="item.addHtml"
:name="item.addHtml"
:scope="scope.row"
:prop="item.prop"
:mom-flag="item.momFlag" />
<template v-else-if="item.momFlag">
<div>
<span v-text="scope.row[item.prop]" />
<span v-if="scope.row[item.momFlag] > 0"
class="el-icon-top" />
<span v-else-if="scope.row[item.momFlag] < 0"
class="el-icon-bottom" />
<span v-else-if="scope.row[item.momFlag] == 0">--</span>
</div>
</template>
<template v-else-if="item.tagLabel">
<el-tag v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]" />
<el-tag v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]" />
</template>
<template v-else-if="item.formatter">
<span v-text="item.formatter(scope.row)" />
</template>
<template v-else-if="getListApi">
<p v-text="data[scope.$index][item.prop]" />
</template>
<template v-else>
<p v-text="tableData[scope.$index][item.prop]" />
</template>
</template>
</el-table-column>
<el-table-column v-if="tableParams.tableOption"
label="操作"
:align="tableParams.tableOption.align||'center'"
:width="tableParams.tableOption.width||'200'"
fixed="right">
<template slot-scope="scope">
<slot name="auth-button"
:scope="scope.row" />
</template>
</el-table-column>
</el-table>
<el-pagination v-if="hasPage"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageSize"
:page-sizes="[10,20,30,40]"
:page-size="page.pageCount"
:total="getListApi ? total : tableTotal"
layout="sizes,total,->,prev,pager,next,jumper" />
</div>
</template>
<script>
import { deepClone } from '@/common/util'
export default {
name: 'D2Table',
data() {
return {
loading: false,
oldValue: {},
data: [],
// 页码
page: {
pageCount: 10,
pageSize: 1
},
total: 10,
// 排序
sortColum: '',
sort: '',
pagination: {}
}
},
props: {
// 搜索条件
searchForm: {
type: Object,
default: () => []
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
tableTotal: {
type: Number,
default: 10
},
// 获取列表接口
getListApi: {
type: Function,
default: null
},
// 分页,默认有
hasPage: {
type: Boolean,
default: true
},
tableParams: {
type: Object,
default: () => {
return {
// 搜索按钮id;new Date().getTime() + parseInt(Math.random() * 1000)
// btnId: {
// type: String,
// default: ''
// },
// 后端返回列表参数名
listName: {
type: String,
default: ''
},
// 标签-默认标签名为tag;若有多个,那么需要在表格栏的列中加“tagName”
// tag: {
// type: Array,
// default: () => []
// },
// 表格操作,默认没有
// tableOption: {
// type: Object,
// default: null
// },
// 表格栏
tableColumns: {
type: Array,
default: () => []
}
}
}
}
},
watch: {
searchForm: {
handler(val) {
const attr = Object.keys(val).find(item => val[item] !== this.oldValue[item])
if (!val[attr] && this.oldValue[attr]) {
this.getListApi ? this.refreshEmit() : this.$emit('refreshTable', this.page)
}
this.oldValue = deepClone(val)
},
deep: true
}
// 调用其他接口,导致表格刷新-标识
// '$store.state.d2admin.refreshtable.value'(val) {
// (val === 'fresh') && this.refreshEmit()
// }
},
mounted() {
const btn = document.getElementById(this.tableParams.btnId)
btn && btn.addEventListener('click', this.refreshEmit)
this.getListApi && this.refreshTable()
},
methods: {
// 排序
sortChange({ column, prop, order }) {
this.sortColum = order ? prop : ''
this.sort = order
this.refreshTable()
},
// 发布事件,以期查询条件改变后,页面图表需要刷新
refreshEmit() {
this.$emit('searchChange')
this.refreshTable()
},
refreshTable() {
this.loading = true
var params = {
...this.page,
...this.searchForm
}
if (this.sort) {
params.sortColum = this.sortColum
params.sort = this.sort === 'descending' ? 1 : 0
}
this.getListApi(params).then(res => {
this.pagination = res.pagination ? res.pagination : this.page
this.data = res[this.tableParams.listName]
res.pagination && (this.total = res.pagination.totalCount)
this.loading = false
}).catch(() => {
this.loading = false
})
},
// 页码
handleSizeChange(value) {
this.page.pageCount = value
this.getListApi ? this.refreshTable() : this.$emit('refreshTable', this.page)
},
handleCurrentChange(value) {
this.page.pageSize = value
this.getListApi ? this.refreshTable() : this.$emit('refreshTable', this.page)
}
}
}
</script>
<style>
.a-click {
cursor: pointer;
}
</style>
<template>
<baseDialog :is-show.sync="dialogShow"
<!-- <baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose">
</baseDialog> -->
<!-- <div class="detail-content">
填写地址
</div> -->
<el-drawer class="shoppingCartDrawerCon"
title="收货地址管理"
size="500px"
:visible.sync="dialogShow"
:direction="direction">
<div class="detail-content">
填写地址
</div>
</baseDialog>
</el-drawer>
</template>
<script>
export default {
name: 'AddressCom',
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {
dialogShow: false,
// dialogShow: false,
direction: 'rtl',
dialogConfig: {
setting: {
showClose: true,
......@@ -31,6 +48,16 @@ export default {
}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
methods: {
handleDetailClose() {
......
No preview for this file type
No preview for this file type
No preview for this file type
<!-- 采购商城 -->
<template>
<d2-container class="mallContainer">
<div class="d2-container-content">
<div class="addressCon">
地址
<div class="header addressCon"
slot="header">
<div class="addressTitle">
<img src="./images/addressIcon.webp"
alt=""
class="icon">
<span class="title">{{ addressInfo.yqMerchantName }}</span>
<span class="edit pointer"
@click="addressComVisible = true">
<img src="./images/editAddressIcon.webp"
alt=""
class="editIcon">
修改
</span>
</div>
<div class="addressInfo">
<!-- 收货人:白敬亭 -->
<span class="name">收货人:<span class="label">{{ addressInfo.contactName }}</span></span>
<span class="phone">电话:<span class="label">{{ addressInfo.contactPhone }}</span></span>
<span class="address">收货地址:<span
class="label">{{ addressInfo.contactAddress }}</span></span>
</div>
</div>
<div class="d2-container-content">
<div class="classifyContainer">
<div class="centerfrom">订阅名</div>
<div class="spanall"
......@@ -53,7 +74,7 @@
</div>
<!-- 购物车组件 -->
<shoppingCartCom />
<addressCom />
<addressCom :visible.sync="addressComVisible" />
<goodsDetailCom :visible.sync="goodsDetailComVisible" />
</d2-container>
</template>
......@@ -74,6 +95,7 @@ export default {
},
data() {
return {
addressComVisible: false,
goodsDetailComVisible: false,
searchForm: {
type: '0'
......@@ -101,7 +123,9 @@ export default {
addressInfo: {
contactName: '',
contactPhone: '',
contactAddress: ''
contactAddress: '',
yqMerchantName: '',
yqMerchantId: ''
},
productType: [],
productTypeId: '',
......@@ -111,7 +135,8 @@ export default {
},
created() {
this.getGoodsCategoryConfiguration()
// this.listWithPagePurchaseInfo()
this.listWithPagePurchaseInfo()
this.addressGet()
},
mounted() {
this.$nextTick(() => {
......@@ -121,10 +146,12 @@ export default {
})
},
methods: {
handleDetail(item) {
this.selectItem = item
this.goodsDetailComVisible = true
},
listWithPagePurchaseInfo() {
const params = {
pageNum: this.page.pageNum,
......@@ -181,20 +208,21 @@ export default {
},
addressGet() {
addressGet().then((result) => {
console.log(result)
// console.log(result)
const {
contactName,
contactPhone,
contactAddress
} = result
this.addressInfo = {
contactName,
contactPhone,
contactAddress
}
// const {
// contactName,
// contactPhone,
// contactAddress
// } = result
// this.addressInfo = {
// contactName,
// contactPhone,
// contactAddress
// }
this.addressInfo = result
}).catch((err) => {
console.log(err)
})
},
// 每页条数
......@@ -216,6 +244,63 @@ export default {
</script>
<style lang="scss" scoped>
.mallContainer {
::v-deep .d2-header-switch {
display: none;
}
}
.addressCon {
padding: 10px 20px;
.addressTitle {
display: flex;
align-items: center;
.title {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
}
.edit {
display: flex;
align-items: center;
margin-left: auto;
font-size: 14px;
color: #185efe;
}
.editIcon {
width: 20px;
height: 20px;
}
}
.icon {
width: 32px;
height: 32px;
margin-right: 8px;
}
.addressInfo {
display: flex;
box-sizing: border-box;
// align-items: space-between;
align-items: center;
justify-content: space-between;
width: 100%;
height: 36px;
padding: 0 20px;
margin-top: 10px;
background: #f9f9f9;
font-size: 14px;
color: #666666;
.label {
color: #333333;
// margin-left: 0px;
}
.address {
min-width: 500px;
}
}
}
.classifyContainer {
width: 100%;
display: flex;
......
module.exports = {
index: '主页',
'customer/glsx': '广联赛讯'
}
module.exports = {
index: "主页",
"customer/glsx": "广联赛讯"
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!