Commit c59229fb by 张立顺

功能提交

1 parent 6b0b2b3c
@import '~@/assets/style/unit/color.scss'; @import '~@/assets/style/unit/color.scss';
// 工具类名统一前缀 // 工具类名统一前缀
$prefix: d2; $prefix: d2;
// 禁止用户选中 鼠标变为手形 // 禁止用户选中 鼠标变为手形
%unable-select { %unable-select {
user-select: none; user-select: none;
cursor: pointer; cursor: pointer;
} }
// 填满父元素 // 填满父元素
// 组要父元素 position: relative | absolute; // 组要父元素 position: relative | absolute;
%full { %full {
position: absolute; position: absolute;
top: 0px; top: 0px;
right: 0px; right: 0px;
bottom: 0px; bottom: 0px;
left: 0px; left: 0px;
} }
// flex 垂直水平居中 // flex 垂直水平居中
%flex-center-row { %flex-center-row {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
} }
%flex-center-col { %flex-center-col {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
} }
// 将元素模拟成卡片外观 // 将元素模拟成卡片外观
%card { %card {
border: 1px solid #dddee1; border: 1px solid #dddee1;
border-color: #e9eaec; border-color: #e9eaec;
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
position: relative; position: relative;
} }
// element // element
.el-table--medium td { .el-table--medium td {
padding: 4px 0 !important; padding: 4px 0 !important;
} }
.el-table .cell { .el-table .cell {
padding: 0 0; padding: 0 0;
} }
.el-range-editor--small.el-input__inner { .el-range-editor--small.el-input__inner {
width: 100%; width: 100%;
} }
.up-btns { .up-btns {
// position: absolute; // position: absolute;
// bottom: 7%; // bottom: 7%;
// right: 20px; // right: 20px;
text-align: right; text-align: right;
padding: 10px 20px; padding: 10px 20px;
} }
.ok-btn { .ok-btn {
width: 100px; width: 100px;
margin-right: 40px; margin-right: 40px;
} }
.cancel-btn { .pointer {
width: 100px; cursor: pointer;
color: #ffffff; }
background: #999999;
} .cancel-btn {
width: 100px;
.edit-title { color: #ffffff;
font-size: 18px; background: #999999;
font-weight: bold; }
height: 48px;
line-height: 48px; .edit-title {
color: #0947C6; font-size: 18px;
border-bottom: 1px solid #E7EAEC; font-weight: bold;
// padding-left: 20px; height: 48px;
margin: 0 0; line-height: 48px;
} color: #0947C6;
.edit-sub-title::before { border-bottom: 1px solid #E7EAEC;
position: absolute; // padding-left: 20px;
display: inline-block; margin: 0 0;
content: ''; }
height: 18px;
width: 4px; .edit-sub-title::before {
top: 2px; position: absolute;
left: 0; display: inline-block;
background-color: #0947C6; content: '';
} height: 18px;
width: 4px;
.edit-sub-title { top: 2px;
position: relative; left: 0;
font-size: 16px; background-color: #0947C6;
font-weight: 700; }
color: #333333;
margin: 0 0 30px 0; .edit-sub-title {
padding-left: 8px; position: relative;
} font-size: 16px;
font-weight: 700;
.title-tips { color: #333333;
font-size: 14px; margin: 0 0 30px 0;
font-weight: normal; padding-left: 8px;
color: #d9534f; }
margin-left: 8px;
} .title-tips {
font-size: 14px;
.table-header-left-txt { font-weight: normal;
font-size: 12px; color: #d9534f;
color: #6C6F71; margin-left: 8px;
margin-left: 20px; }
}
.table-header-left-txt {
.el-input.is-disabled .el-input__inner { font-size: 12px;
color: #606266; color: #6C6F71;
} margin-left: 20px;
}
.suffix {
font-style: inherit; .el-input.is-disabled .el-input__inner {
color: #606266; color: #606266;
line-height: 30px; }
}
.suffix {
// 公共样式-文字 font-style: inherit;
// 页面标题 color: #606266;
.car-main-head { line-height: 30px;
color: rgba(#000000, 0.85); }
font-size: 20px;
font-weight: bold; // 公共样式-文字
} // 页面标题
.car-main-head {
// 小标题 color: rgba(#000000, 0.85);
.car-sub-head { font-size: 20px;
color: rgba(#000000, 0.85); font-weight: bold;
font-size: 16px; }
font-weight: bold;
} // 小标题
.car-sub-head {
// 强调 -加粗 color: rgba(#000000, 0.85);
.car-strong-txt { font-size: 16px;
color: rgba(#000000, 0.65); font-weight: bold;
font-size: 14px; }
font-weight: bold;
} // 强调 -加粗
.car-strong-txt {
// 正文 color: rgba(#000000, 0.65);
.car-txt { font-size: 14px;
color: rgba(#000000, 0.65); font-weight: bold;
font-size: 14px; }
}
// 正文
// 辅助文字 .car-txt {
.car-help-txt { color: rgba(#000000, 0.65);
color: rgba(#000000, 0.45); font-size: 14px;
font-size: 14px; }
}
// 辅助文字
// 失效文字 .car-help-txt {
.car-disabled-txt { color: rgba(#000000, 0.45);
color: rgba(#000000, 0.25); font-size: 14px;
font-size: 14px; }
}
// 失效文字
// 链接文字 .car-disabled-txt {
.car-link-txt { color: rgba(#000000, 0.25);
color: #1890FF; font-size: 14px;
font-size: 14px; }
}
// 链接文字
// 错误提示 .car-link-txt {
.car-error-txt { color: #1890FF;
color: #F5222D; font-size: 14px;
font-size: 14px; }
}
// 错误提示
// 提示图标 .car-error-txt {
.tips-block { color: #F5222D;
position: relative; font-size: 14px;
} }
.tips-label {
margin-right: 20px; // 提示图标
} .tips-block {
position: relative;
.tips-icon { }
position: absolute;
display: inline-block; .tips-label {
width: 12px; margin-right: 20px;
height: 12px; }
top: 0px;
right: 14px; .tips-icon {
margin-right: 4px; position: absolute;
cursor: pointer; display: inline-block;
border: 1px solid #7f7f7f; width: 12px;
border-radius: 50%; height: 12px;
} top: 0px;
.tips-icon::before{ right: 14px;
content: '?'; margin-right: 4px;
position: absolute; cursor: pointer;
width: 8px; border: 1px solid #7f7f7f;
height: 8px; border-radius: 50%;
top: -12px; }
left: 1px;
font-size: 10px; .tips-icon::before {
} content: '?';
position: absolute;
.one-line-ellipsis { width: 8px;
width: 100%; height: 8px;
white-space: nowrap; top: -12px;
display: inline-block; left: 1px;
overflow: hidden; font-size: 10px;
text-overflow: ellipsis; }
}
.one-line-ellipsis {
.two-line-ellipsis { width: 100%;
display: inline-block; white-space: nowrap;
overflow: hidden; display: inline-block;
text-overflow: ellipsis; overflow: hidden;
-webkit-line-clamp: 2; text-overflow: ellipsis;
-webkit-box-orient: vertical; }
}
.two-line-ellipsis {
.blue { display: inline-block;
color: #0947c6; overflow: hidden;
} text-overflow: ellipsis;
-webkit-line-clamp: 2;
/* 以下两个修改箭头颜色 */ -webkit-box-orient: vertical;
// .el-tooltip__popper[x-placement^='top'] .popper__arrow { }
// border-top-color: #505050;
// opacity: 90%; .blue {
// } color: #0947c6;
}
// .el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
// border-top-color: #505050; /* 以下两个修改箭头颜色 */
// opacity: 90%; // .el-tooltip__popper[x-placement^='top'] .popper__arrow {
// } // border-top-color: #505050;
// .tooltip-class { // opacity: 90%;
// background-color: #505050 !important; // }
// 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 \ No newline at end of file
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</span> </span>
</span> </span>
<div <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" <div v-for="(item, index) in i.formBlock"
:key="index" :key="index"
:style="{'width': i.width || '100%', 'display': 'inline-block'}"> :style="{'width': i.width || '100%', 'display': 'inline-block'}">
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
{{ item.btnTxt }} {{ item.btnTxt }}
</el-button> </el-button>
<span>已为该商品组合分配<span <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>
<el-table :data="formData[item.name]" <el-table :data="formData[item.name]"
style="width: 690px" style="width: 690px"
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
添加绑定 添加绑定
</el-button> </el-button>
<span>已将基础商品绑定<span <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>
<div v-for="(subItem, subIndex) in formData[item.name]" <div v-for="(subItem, subIndex) in formData[item.name]"
:key="subIndex" :key="subIndex"
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
<div class="pro-price-block"> <div class="pro-price-block">
<p>建议升级价格:<span class="pro-price">{{ subItem.upgradePrice }}</span>元</p> <p>建议升级价格:<span class="pro-price">{{ subItem.upgradePrice }}</span>元</p>
<p v-show="warrantyProList.includes(subItem.goodsType)">质保年限:<span <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> </p>
</div> </div>
</div> </div>
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
+ +
</div> </div>
<span <span
class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span> class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span>
<input type="file" <input type="file"
name="thumbUrl" name="thumbUrl"
:id="item.name + 'file'" :id="item.name + 'file'"
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
+ +
</div> </div>
<span <span
class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span> class="number">{{ formData[item.name].length }}/{{ item.maxPhotoNum }}</span>
<input type="file" <input type="file"
style="opacity: 0" style="opacity: 0"
:id="item.name + 'file'" :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> <template>
<baseDialog :is-show.sync="dialogShow" <!-- <baseDialog :is-show.sync="dialogShow"
:config="dialogConfig.setting" :config="dialogConfig.setting"
:dialog-config="dialogConfig.config" :dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose"> @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 class="detail-content">
填写地址 填写地址
</div> </div>
</baseDialog> </el-drawer>
</template> </template>
<script> <script>
export default { export default {
name: 'AddressCom', name: 'AddressCom',
props: {
visible: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
dialogShow: false, // dialogShow: false,
direction: 'rtl',
dialogConfig: { dialogConfig: {
setting: { setting: {
showClose: true, showClose: true,
...@@ -31,6 +48,16 @@ export default { ...@@ -31,6 +48,16 @@ export default {
} }
} }
}, },
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
methods: { methods: {
handleDetailClose() { handleDetailClose() {
......
No preview for this file type
No preview for this file type
No preview for this file type
<!-- 采购商城 --> <!-- 采购商城 -->
<template> <template>
<d2-container class="mallContainer"> <d2-container class="mallContainer">
<div class="d2-container-content"> <div class="header addressCon"
<div class="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>
<div class="d2-container-content">
<div class="classifyContainer"> <div class="classifyContainer">
<div class="centerfrom">订阅名</div> <div class="centerfrom">订阅名</div>
<div class="spanall" <div class="spanall"
...@@ -53,7 +74,7 @@ ...@@ -53,7 +74,7 @@
</div> </div>
<!-- 购物车组件 --> <!-- 购物车组件 -->
<shoppingCartCom /> <shoppingCartCom />
<addressCom /> <addressCom :visible.sync="addressComVisible" />
<goodsDetailCom :visible.sync="goodsDetailComVisible" /> <goodsDetailCom :visible.sync="goodsDetailComVisible" />
</d2-container> </d2-container>
</template> </template>
...@@ -74,6 +95,7 @@ export default { ...@@ -74,6 +95,7 @@ export default {
}, },
data() { data() {
return { return {
addressComVisible: false,
goodsDetailComVisible: false, goodsDetailComVisible: false,
searchForm: { searchForm: {
type: '0' type: '0'
...@@ -101,7 +123,9 @@ export default { ...@@ -101,7 +123,9 @@ export default {
addressInfo: { addressInfo: {
contactName: '', contactName: '',
contactPhone: '', contactPhone: '',
contactAddress: '' contactAddress: '',
yqMerchantName: '',
yqMerchantId: ''
}, },
productType: [], productType: [],
productTypeId: '', productTypeId: '',
...@@ -111,7 +135,8 @@ export default { ...@@ -111,7 +135,8 @@ export default {
}, },
created() { created() {
this.getGoodsCategoryConfiguration() this.getGoodsCategoryConfiguration()
// this.listWithPagePurchaseInfo() this.listWithPagePurchaseInfo()
this.addressGet()
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -121,10 +146,12 @@ export default { ...@@ -121,10 +146,12 @@ export default {
}) })
}, },
methods: { methods: {
handleDetail(item) { handleDetail(item) {
this.selectItem = item this.selectItem = item
this.goodsDetailComVisible = true this.goodsDetailComVisible = true
}, },
listWithPagePurchaseInfo() { listWithPagePurchaseInfo() {
const params = { const params = {
pageNum: this.page.pageNum, pageNum: this.page.pageNum,
...@@ -181,20 +208,21 @@ export default { ...@@ -181,20 +208,21 @@ export default {
}, },
addressGet() { addressGet() {
addressGet().then((result) => { addressGet().then((result) => {
console.log(result) // console.log(result)
const { // const {
contactName, // contactName,
contactPhone, // contactPhone,
contactAddress // contactAddress
} = result // } = result
this.addressInfo = { // this.addressInfo = {
contactName, // contactName,
contactPhone, // contactPhone,
contactAddress // contactAddress
} // }
this.addressInfo = result
}).catch((err) => { }).catch((err) => {
console.log(err)
}) })
}, },
// 每页条数 // 每页条数
...@@ -216,6 +244,63 @@ export default { ...@@ -216,6 +244,63 @@ export default {
</script> </script>
<style lang="scss" scoped> <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 { .classifyContainer {
width: 100%; width: 100%;
display: flex; display: flex;
......
module.exports = { module.exports = {
index: '主页', index: "主页",
'customer/glsx': '广联赛讯' "customer/glsx": "广联赛讯"
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!