Browse Source

首页配置基本逻辑和样式基本完成4

preview
dai_siki 6 years ago
parent
commit
382871c861
  1. 4
      epmet-oper-web/public/index.html
  2. BIN
      epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/avatar-mini.png
  3. BIN
      epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/qi2.png
  4. BIN
      epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/wx-top.png
  5. 44
      epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss
  6. 1
      epmet-oper-web/src/utils/request.js
  7. 53
      epmet-oper-web/src/views/modules/wx-mini/index-set.vue

4
epmet-oper-web/public/index.html

@ -28,10 +28,8 @@
</script>
<!-- 开发环境 -->
<!-- https://nei.netease.com/api/apimock/30f0251f1b7dc90a8c38e3c634ef2a8b/ -->
<!-- http://10.10.10.77:8080 -->
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>window.SITE_CONFIG['apiURL'] = 'http://10.10.10.77:8080/api';</script>
<script>window.SITE_CONFIG['apiURL'] = 'http://10.10.10.79:8080/api';</script>
<% } %>
<!-- 集成测试环境 -->
<% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %>

BIN
epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/avatar-mini.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/qi2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/wx-top.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

44
epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss

@ -128,6 +128,11 @@
background-color: #f7f6f9;
box-shadow: 0 5px 15px 1px rgba(0, 0, 0, 0.2);
.mw-phone-topbar{
display: block;
width: 100%;
}
.mw-phone-hint {
position: absolute;
top: 0;
@ -177,11 +182,11 @@
cursor: pointer;
&.z-focused {
box-shadow: 0 0 12px 3px rgba(#177, 0.5);
box-shadow: 0 0 12px 3px rgba(#67C23A, 0.5);
}
.d-cpt-operate {
@include bs1;
@include bs3;
position: absolute;
top: -1000px;
bottom: -1000px;
@ -209,8 +214,8 @@
}
img {
height: 12px;
line-height: 12px;
height: 10px;
line-height: 10px;
}
p {
line-height: 10px;
@ -223,15 +228,23 @@
position: relative;
.d-cpt-wrap {
line-height: 50px;
height: 40px;
line-height: 40px;
padding-left: 10px;
background-color: #fff;
img {
.d-cpt-ico {
position: relative;
top: -4px;
margin-right: 4px;
height: 20px;
}
.d-cpt-avatar {
position: relative;
float: right;
margin-right: 10px;
top: 5px;
width: 30px;
}
span {
font-size: 17px;
font-family: PingFang SC;
@ -245,7 +258,7 @@
position: relative;
.d-cpt-wrap {
padding: 1px 10px 15px 10px;
padding: 10px 10px 15px 10px;
background-color: #fff;
.d-cpt-subwrap {
position: relative;
@ -347,11 +360,12 @@
}
.d-news-title {
height: 40px;
font-size: 17px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 20px;
overflow: hidden;
}
.d-news-info {
margin-top: 17px;
@ -451,7 +465,7 @@
span {
position: relative;
z-index: 20;
font-size: 15px;
font-size: 14px;
font-family: PingFang SC;
font-weight: bold;
font-style: italic;
@ -511,7 +525,7 @@
background: rgba(255, 76, 82, 1);
border-radius: 25px;
text-align: center;
font-size: 16px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
@ -535,7 +549,7 @@
}
.mw-phone-top {
position: relative;
height: 50px;
height: 40px;
}
.mw-phone-ban {
position: relative;
@ -581,7 +595,7 @@
}
textarea {
background-color: rgba(247,247,247,1);
background-color: rgba(247, 247, 247, 1);
min-height: 100px !important;
font-size: 13px;
&:focus {
@ -590,15 +604,15 @@
}
.d-config-hint {
margin-top: -10px;
margin-top: -10px;
font-size: 10px;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 18px;
img {
height: 14px;
margin-right: 4px;
height: 14px;
margin-right: 4px;
}
}

1
epmet-oper-web/src/utils/request.js

@ -17,6 +17,7 @@ const http = axios.create({
http.interceptors.request.use(config => {
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
config.headers['token'] = Cookies.get('token') || ''
config.headers['Authorization'] = Cookies.get('token') || ''
// 默认参数
var defaults = {}
// 防止缓存,GET请求默认带_t参数

53
epmet-oper-web/src/views/modules/wx-mini/index-set.vue

@ -37,11 +37,11 @@
<div class="mw-cpt_type">
<div class="d-function" v-show="item.componentList.length > 0" :key="item.functionId" v-for="item in cptTypeList">
<div class="d-info" @click="shiftCptTypeItemUnfold(item)">
<img v-if="item.functionId==0" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/common-cpt.png">
<img v-if="item.functionId==1" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/function-cpt1.png">
<img v-if="item.functionId==2" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/function-cpt2.png">
<img v-if="item.functionId==3" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/function-cpt3.png">
<img v-if="item.functionId==4" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/function-cpt4.png">
<img v-else-if="item.functionId==2" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/function-cpt2.png">
<img v-else-if="item.functionId==3" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/function-cpt3.png">
<img v-else-if="item.functionId==4" class="d-ico" src="@/assets/img/modules/wx-mini/index-set/function-cpt4.png">
<img v-else class="d-ico" src="@/assets/img/modules/wx-mini/index-set/common-cpt.png">
<span class="d-name">{{ item.functionName }}</span>
@ -68,6 +68,8 @@
@click="isInPreview = false" icon="el-icon-close" circle></el-button>
</div>
<div class="mw-phone">
<img class="mw-phone-topbar" v-show="isInPreview" src="@/assets/img/modules/wx-mini/index-set/page/wx-top.png">
<div class="mw-phone-top" v-show="!isInPreview || topCptList.length>0" :class="{'z-none': !isInPreview}">
<div class="mw-phone-hint" v-show="!isInPreview" :class="{'z-out-left': topCptList.length>0}">{{ getCptRegionName('top') }}</div>
<div class="mw-cpt"
@ -76,9 +78,12 @@
v-for="item in topCptList">
<div class="mw-cpt-top_title" v-if="item.componentFrontId==='resi-titleList-home-gridNameTitle'">
<div class="d-cpt-wrap">
<img v-if="item.demoData.ico" :src="item.demoData.ico">
<img v-else src="@/assets/img/modules/wx-mini/index-set/page/dang.png">
<img class="d-cpt-ico" v-if="item.demoData.ico" :src="item.demoData.ico">
<img class="d-cpt-ico" v-else src="@/assets/img/modules/wx-mini/index-set/page/dang.png">
<span>{{ item.demoData.title }}</span>
<img class="d-cpt-avatar" v-if="item.demoData.avatar" :src="item.demoData.avatar">
<img class="d-cpt-avatar" v-else src="@/assets/img/modules/wx-mini/index-set/page/avatar-mini.png">
</div>
<div class="d-cpt-operate z-small"
@ -193,7 +198,8 @@
<div class="item" :key="subindex" v-for="(subitem, subindex) in item.demoData.list">
<div class="d-group-no">
<img v-if="subitem.ico" :src="subitem.ico">
<img v-else src="@/assets/img/modules/wx-mini/index-set/page/qi.png">
<img v-else-if="subindex === 0" src="@/assets/img/modules/wx-mini/index-set/page/qi.png">
<img v-else src="@/assets/img/modules/wx-mini/index-set/page/qi2.png">
<span>{{ subitem.no }}</span>
</div>
<div class="d-group-avatar">
@ -289,7 +295,7 @@ import getRandomString from 'dai-js/tools/getRandomString'
import cloneDeep from 'lodash/cloneDeep'
const getMockFilterUrl = (url) => {
const usedMockTest = true
const usedMockTest = false
const mockBaseUrl = 'https://nei.netease.com/api/apimock/30f0251f1b7dc90a8c38e3c634ef2a8b/api'
if (usedMockTest) {
return mockBaseUrl + url
@ -348,6 +354,7 @@ export default {
},
demoData: {
ico: '',
avatar: '',
title: '青岛市市北区大港路第二网格'
},
configurationDescription: '请配置具体内容'
@ -436,7 +443,7 @@ export default {
},
{
ico: '',
no: '1',
no: '2',
avatar: '',
title: '群名称',
info1: '山东路45号-张三',
@ -445,7 +452,7 @@ export default {
},
{
ico: '',
no: '1',
no: '3',
avatar: '',
title: '群名称',
info1: '山东路45号-张三',
@ -467,7 +474,7 @@ export default {
list: [
{
pic: '',
title: '我是新闻标题',
title: '我是新闻标题,我是新闻标题,我是新闻标题,我是新闻标题,我是新闻标题',
author: '大港路党支部',
date: '2020-01-02'
},
@ -507,6 +514,7 @@ export default {
// region: 1 // 1top 2ban 3fixed 4cnt
// }
],
lastSavedCptList: [],
focusedCpt: {
tempOnlyId: ''
}
@ -621,6 +629,7 @@ export default {
...res.data.floatingList
]
// this.cptList = list.map(this.processBackendCptData)
this.lastSavedCptList = cloneDeep(this.cptList)
console.log('用户储存组件列表', list)
}
}).catch(() => {
@ -650,6 +659,7 @@ export default {
return this.$message.error(res.msg)
} else {
console.log(res)
this.lastSavedCptList = cloneDeep(this.cptList)
return this.$message.success('保存成功')
}
}).catch(() => {
@ -686,6 +696,7 @@ export default {
return this.$message.error(res.msg)
} else {
console.log(res)
this.lastSavedCptList = cloneDeep(this.cptList)
return this.$message.success('发布成功')
}
}).catch(() => {
@ -784,6 +795,9 @@ export default {
//
delCpt (item) {
this.cptList = this.cptList.filter(cptItem => item.tempOnlyId !== cptItem.tempOnlyId)
if (this.focusedCpt.tempOnlyId === item.tempOnlyId) {
this.focusedCpt = { tempOnlyId: '' }
}
},
//
checkExistCpt (item) {
@ -816,15 +830,26 @@ export default {
}
})
},
//
//
resetFocusedCptData () {
const { focusedCpt } = this
this.cptList.forEach(item => {
const fun = item => {
if (item.tempOnlyId === focusedCpt.tempOnlyId) {
focusedCpt.demoData = JSON.stringify(item.demoData)
focusedCpt.configuration = JSON.stringify(item.configuration)
return true
} else {
return false
}
})
}
if (!this.lastSavedCptList.some(fun)) {
this.cptTypeListTiled.forEach(item => {
if (item.componentFrontId === focusedCpt.componentFrontId) {
focusedCpt.demoData = JSON.stringify(item.demoData)
focusedCpt.configuration = JSON.stringify(item.configuration)
}
})
}
},
//

Loading…
Cancel
Save