Browse Source

组件自定义

preview
jiangyy 4 years ago
parent
commit
82c8319958
  1. 90
      epmet-oper-web/src/assets/scss/modules/wx-mini/extended.scss
  2. 7
      epmet-oper-web/src/components/wx-index/cpt-item.vue
  3. 42
      epmet-oper-web/src/components/wx-index/extended.vue
  4. 3
      epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue

90
epmet-oper-web/src/assets/scss/modules/wx-mini/extended.scss

@ -37,15 +37,11 @@
} }
// 更多功能2 // 更多功能2
.mw-cpt-cnt_function2 { .extended_more2 {
position: relative;
margin-top: 10px;
.d-cpt-wrap {
border-radius: 10px; border-radius: 10px;
// overflow-x: scroll; // overflow-x: scroll;
overflow: hidden; overflow: hidden;
margin: 0 13px; margin: 10px 13px;
padding:0 0 13px 0; padding:0 0 13px 0;
background-color: white; background-color: white;
@ -102,7 +98,89 @@
} }
} }
}
//问卷调查
.extended_question{
margin:10px 10px;
background: #FFFFFF;
box-shadow: 0px 4px 29px 0px rgba(63, 63, 63, 0.1);
border-radius: 10px;
height: 60px;
padding:10px;
line-height: 40px;
.left_title{
width: 40px;
float: left;
font-size: 17px;
font-family: PangMenZhengDao;
font-weight: 400;
font-style: italic;
color: #E2281B;
line-height: 20px;
background: linear-gradient(0deg, #F6A43B 0%, #F56923 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.center_content{
width: 70%;
float: left;
margin-left:10px;
font-size: 17px;
font-family: PingFang SC;
font-weight: 500;
color: #3F3F3F;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.right_more{
width: 34px;
float: right;
line-height: 20px;
font-size: 13px;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
} }
} }
//快捷入口
.extended_quick {
margin-top: 10px;
background: rgba(255, 255, 255, 1);
.more_list {
padding:20px 10px;
display: flex;
justify-content: flex-start;
flex-wrap:wrap;
.more_item {
width:25%;
display: flex;
flex-direction: column;
text-align: center;
img {
width: 40px;
height: 40px;
margin-bottom: 1px;
}
p {
font-size: 13px;
text-align: center;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
}
}
}

7
epmet-oper-web/src/components/wx-index/cpt-item.vue

@ -50,9 +50,11 @@
:isFocused=isFocused></score> :isFocused=isFocused></score>
</div> </div>
<!-- 扩展功能更多功能1更多功能2 --> <!-- 扩展功能更多功能1更多功能2快捷入口问卷调查 -->
<div v-else-if="item.componentFrontId==='resi-functionList-extend-moreFunctionIcons' <div v-else-if="item.componentFrontId==='resi-functionList-extend-moreFunctionIcons'
||item.componentFrontId==='resi-functionList-extend-moreFunctionIcons2'"> ||item.componentFrontId==='resi-functionList-extend-moreFunctionIcons2'
||item.componentFrontId==='resi-functionList-extend-quickentry'
||item.componentFrontId==='resi-functionList-extend-question'">
<extended :item=item <extended :item=item
:isFocused=isFocused></extended> :isFocused=isFocused></extended>
</div> </div>
@ -137,6 +139,7 @@ export default {
this.$refs[tempOnlyId].scrollIntoViewIfNeeded(false) this.$refs[tempOnlyId].scrollIntoViewIfNeeded(false)
}, },
focusCpt () { focusCpt () {
console.log(this.item)
this.$emit('focus', this.item) this.$emit('focus', this.item)
} }
} }

42
epmet-oper-web/src/components/wx-index/extended.vue

@ -4,7 +4,7 @@
:class="{'z-focused': isFocused}" :class="{'z-focused': isFocused}"
@click="focusCpt"> @click="focusCpt">
<!-- 更多功能组件 --> <!-- 扩展功能更多功能1 -->
<div class="extended_more1" <div class="extended_more1"
v-if="item.componentFrontId==='resi-functionList-extend-moreFunctionIcons'"> v-if="item.componentFrontId==='resi-functionList-extend-moreFunctionIcons'">
@ -29,10 +29,9 @@
</div> </div>
<!-- 更多功能2栏组件 --> <!-- 扩展功能更多功能2 -->
<div class="mw-cpt-cnt_function2" <div class="extended_more2"
v-else-if="item.componentFrontId==='resi-functionList-extend-moreFunctionIcons2'"> v-else-if="item.componentFrontId==='resi-functionList-extend-moreFunctionIcons2'">
<div class="d-cpt-wrap">
<div class="link"> <div class="link">
<div class="link-item"> <div class="link-item">
@ -62,6 +61,38 @@
</div> --> </div> -->
</div> </div>
<!-- 扩展功能快捷入口 -->
<div class="extended_quick"
v-if="item.componentFrontId==='resi-functionList-extend-quickentry'">
<div class="more_list">
<div class="more_item"
:key="subindex"
v-for="(subitem, subindex) in item.demoData.list">
<div>
<img v-if="subitem.icon"
:src="subitem.icon">
<img v-else
src="@/assets/img/modules/wx-mini/index-set/page/icon2.png">
</div>
<p>{{ subitem.name }}</p>
</div>
</div>
</div>
<!-- 扩展功能问卷调查 -->
<div class="extended_question"
v-if="item.componentFrontId==='resi-functionList-extend-question'">
<div class="left_title">问卷 调查</div>
<!-- <div class="center_content">标题</div> -->
<div class="center_content">{{item.demoData.info.title}}</div>
<div class="right_more">查看更多</div>
</div> </div>
</div> </div>
@ -79,6 +110,9 @@ export default {
props: { props: {
isFocused: Boolean, isFocused: Boolean,
item: Object item: Object
},
mounted () {
}, },
methods: { methods: {

3
epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue

@ -563,6 +563,7 @@ export default {
} }
}, },
mounted () { mounted () {
const userType = localStorage.getItem('userType') const userType = localStorage.getItem('userType')
if (userType === 'work') { if (userType === 'work') {
@ -844,7 +845,7 @@ export default {
}, },
// //
focusCpt (item, index) { focusCpt (item, index) {
console.log('聚焦实例组件') console.log('聚焦实例组件', item)
this.globalIndex = index this.globalIndex = index
if (this.isInPreview) return if (this.isInPreview) return
if (this.focusedCpt.tempOnlyId === item.tempOnlyId) { if (this.focusedCpt.tempOnlyId === item.tempOnlyId) {

Loading…
Cancel
Save