Skip to content

Commit

Permalink
some change
Browse files Browse the repository at this point in the history
  • Loading branch information
useryangtao committed Sep 22, 2016
1 parent 426d783 commit 93f245c
Show file tree
Hide file tree
Showing 17 changed files with 111 additions and 38 deletions.
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<meta content="black" name="apple-mobile-web-app-status-bar-style" >
</head>

<body >
<div id="app"></div>
<body @touchmove.prevent=''>
<!-- built files will be auto injected -->
</body>

Expand Down
2 changes: 2 additions & 0 deletions src/app.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<template>
<div id="app">
<section class="welcome" v-show="welcome" transition="welcome"></section>
<section class="mobile-tips" style="dislay:none;" v-show="isnotMobile">
<div class="mobile-tips-inner">
Expand All @@ -23,6 +24,7 @@
<index-nav></index-nav>
</div>
</footer>
</div>
</template>
<script>
import store from 'store'
Expand Down
4 changes: 3 additions & 1 deletion src/assets/css/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ body,
border-top: 0;
}

.padding-top-1{
padding-top: 1px;
}

/*1px线*/

Expand Down Expand Up @@ -234,7 +237,6 @@ body,
height: 100%;
overflow: hidden;
z-index: 1;
padding-top: 1px;
transition: .2s all ease-in-out;
opacity: 1;
transform: translate3d(0%, 0, 0);
Expand Down
16 changes: 14 additions & 2 deletions src/components/dialogue-bar-public.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ul class="component-dialogue-bar-public">

<li v-for="item in dialogue_bar.menu">
<li v-for="item in dialogue_bar.menu" v-touch:tap="linkFrame(item)">
<a :href="item.link"></a>
<span class="iconfont icon-chat-detail-add" v-show=""></span>
<div class="_ellipsis" v-text="item.title">
Expand All @@ -11,18 +11,30 @@
</template>
<script>
import { dialogue_bar } from 'getters'
import {set_iframe_url} from 'actions'
export default {
vuex:{
getters:{
dialogue_bar
},
actions:{
set_iframe_url
}
},
replace: true,
props: {},
data() {
return {}
},
methods: {},
methods: {
linkFrame(obj){
if(!!obj.url){
this.set_iframe_url(obj,()=>{
this.$router.go({path:'/chat/dialogue/link'})
})
}
}
},
components: {}
}
</script>
25 changes: 17 additions & 8 deletions src/components/iframe.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
<template>
<div class="_full_router component-xxx">
<div class="_full_router component-iframe">
<div class="_full_inner">
<top-handle
:back-text="topModel.backText"
:cur-text="topModel.curText"
:cur-text="iframe_title"
:decline="decline"
:next-path="topModel.nextPath"
:next-icon="topModel.nextIcon"
>
</top-handle>
<div class="_cover-content _effect"
:class="{'_effect--30':decline}">
<div></div>
:class="{'_effect--30':decline}" >
<div class="_full" style="overflow:hidden;">
<iframe class="iframe-wrap _full" style="overflow:hidden;" :src='iframe_url' frameborder="0"></iframe>
</div>

</div>
</div>
<iframe src="" frameborder="0"></iframe>
</div>
</template>
<script>
// import {} from 'getters'
import {
iframe_url,
iframe_title
} from 'getters'
// import {} from 'actions'
import topHandle from 'topHandle'
export default {
vuex:{
getters:{
iframe_url,
iframe_title
},
actions:{
Expand Down Expand Up @@ -64,7 +73,6 @@ export default {
}
},
created(){
},
ready(){
Expand All @@ -75,5 +83,6 @@ export default {
}
</script>
<style scoped>
.iframe-wrap{
}
</style>
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fastclick.attach(document.body)

const App = Vue.extend(require('./app.vue'))

router.start(App, '#app')
router.start(App, 'body')


window.router = router
Expand Down
12 changes: 6 additions & 6 deletions src/mock/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ var list = [{
"chatDialogueBarModel": {
menu: [{
title: '翻译计划',
link: 'http://mp.weixin.qq.com/s?__biz=MzA3MjA4NjE3NQ==&mid=2652104271&idx=1&sn=fcd5bc3e300b92e10f3bf7574f1fcef8&scene=18#wechat_redirect',
url: 'http://mp.weixin.qq.com/s?__biz=MzA3MjA4NjE3NQ==&mid=2652104271&idx=1&sn=fcd5bc3e300b92e10f3bf7574f1fcef8&scene=18#wechat_redirect',
subMenu: []
}, {
title: '绝密试卷',
link: 'http://p.memoe.cn/',
url: 'http://p.memoe.cn/',
subMenu: []
}, {
title: '稀土掘金',
link: '//gold.xitu.io',
url: '//gold.xitu.io',
subMenu: []
}]
},
Expand Down Expand Up @@ -182,15 +182,15 @@ var list = [{
"chatDialogueBarModel": {
menu: [{
title: '我要订餐',
link: '//m.ele.me/',
url: '//m.ele.me/',
subMenu: []
}, {
title: '关注必读',
link: '//mp.weixin.qq.com/mp/homepage?__biz=MzA3NDM1NTY0Nw==&hid=1&sn=5574694ffc2ac18f84873bd901630d2e#wechat_redirect',
url: '//mp.weixin.qq.com/mp/homepage?__biz=MzA3NDM1NTY0Nw==&hid=1&sn=5574694ffc2ac18f84873bd901630d2e#wechat_redirect',
subMenu: []
}, {
title: '联系我们',
link: '//m.ele.me/',
url: '//m.ele.me/',
subMenu: []
}]
},
Expand Down
10 changes: 10 additions & 0 deletions src/route-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export default function(router) {
subRoutes: {
'person-info': personInfo
}
},
'link':{
component: resolve => {
require(['./components/iframe.vue'], resolve)
}
}
//other
}
Expand Down Expand Up @@ -159,6 +164,11 @@ export default function(router) {
component: resolve => {
require(['./views/find/drift-bottle.vue'], resolve)
}
},
'shopping':{
component: resolve => {
require(['./components/iframe.vue'], resolve)
}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/views/chat.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="_full_inner _scroll _effect component-chat" :class="{'_effect--30':decline}" @touchmove.stop="">
<div class="_full_inner _scroll _effect component-chat" :class="{'_effect--30':decline}">
<search-bar></search-bar>
<ul class="wechat-list">
<li class="item _line-fine" v-for="item in wechat_list" transition="chat-item">
Expand Down
3 changes: 2 additions & 1 deletion src/views/chat/dialogue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ export default {
//nextPath
let nextPath = '';
let roleType = this.dialogue_type;
console.log(roleType)
if (roleType === 'group') {
nextPath = '/chat/dialogue/chat-info'
} else if (roleType === 'person') {
} else if (roleType === 'friends') {
nextPath = '/chat/dialogue/chat-detail'
} else if(roleType === 'service'){
nextPath = '/contact/public-info'
Expand Down
18 changes: 9 additions & 9 deletions src/views/contact/new-friends.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@
<div class="weui_cells message-list">
<div class="weui_cell">
<div class="weui_cell_hd">
<img src="http://ww4.sinaimg.cn/mw690/8fb58bcajw1f7nkyidkwqj20f90faq62.jpg" alt="" style="width:40px;margin-right:5px;display:block">
<img src="//images2015.cnblogs.com/blog/528573/201609/528573-20160922181544949-1515459394.jpg" alt="" style="width:40px;margin-right:5px;display:block">
</div>
<div class="weui_cell_bd weui_cell_primary">
<p><b>了了</b></p>
<p><span>我是群聊""的</span><span>了了</span></p>
<p><b>陌生人</b></p>
<p><span>我是群聊""的</span><span>陌生人</span></p>
</div>
<div class="weui_cell_ft">已添加</div>
</div>
<div class="weui_cell">
<div class="weui_cell_hd"><img src="http://ww4.sinaimg.cn/mw690/8fb58bcajw1f7nkyidkwqj20f90faq62.jpg" alt="" style="width:40px;margin-right:5px;display:block"></div>
<div class="weui_cell_hd"><img src="//images2015.cnblogs.com/blog/528573/201609/528573-20160922181544949-1515459394.jpg" alt="" style="width:40px;margin-right:5px;display:block"></div>
<div class="weui_cell_bd weui_cell_primary">
<p><b>了了</b></p>
<p><span>我是群聊""的</span><span>了了</span></p>
<p><b>陌生人</b></p>
<p><span>我是群聊""的</span><span>陌生人</span></p>
</div>
<div class="weui_cell_ft">已拒绝</div>
</div>
<div class="weui_cell">
<div class="weui_cell_hd"><img src="http://ww4.sinaimg.cn/mw690/8fb58bcajw1f7nkyidkwqj20f90faq62.jpg" alt="" style="width:40px;margin-right:5px;display:block"></div>
<div class="weui_cell_hd"><img src="//images2015.cnblogs.com/blog/528573/201609/528573-20160922181544949-1515459394.jpg" alt="" style="width:40px;margin-right:5px;display:block"></div>
<div class="weui_cell_bd weui_cell_primary">
<p><b>了了</b></p>
<p><span>我是群聊""的</span><span>了了</span></p>
<p><b>陌生人</b></p>
<p><span>我是群聊""的</span><span>陌生人</span></p>
</div>
<div class="weui_cell_ft">
<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_primary">接受</a>
Expand Down
11 changes: 10 additions & 1 deletion src/views/find.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>
<!-- flag -->
<div class="weui_cells weui_cells_access">
<div class="weui_cell" href="javascript:;">
<div class="weui_cell" href="javascript:;" v-touch:tap='hrefShopping()'>
<div class="weui_cell_hd"><img src="../assets/images/find_icon-shopping.png"></div>
<div class="weui_cell_bd weui_cell_primary">
<p>购物</p>
Expand Down Expand Up @@ -79,6 +79,7 @@
<script>
// import {} from 'getters'
import {
set_iframe_url,
set_menu_active
} from 'actions'
Expand All @@ -90,6 +91,7 @@ export default {
},
actions: {
set_iframe_url,
set_menu_active
}
},
Expand All @@ -109,6 +111,13 @@ export default {
}
},
methods: {
hrefShopping(){
this.set_iframe_url({title:"京东购物",url:"//wqs.jd.com"},()=>{
this.$router.go({
path: "/find/shopping"
})
});
}
},
events: {
Expand Down
4 changes: 2 additions & 2 deletions src/views/find/albums-friends.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="_full_router component-xxx" @touchmove.prevent="">
<div class="_full_router component-albums-friends" @touchmove.prevent="">
<div class="_full_inner" @touchmove.stop="">
<top-handle :back-text="topModel.backText" :cur-text="topModel.curText" :decline="decline" :next-path="topModel.nextPath" :next-icon="topModel.nextIcon">
</top-handle>
Expand All @@ -10,7 +10,7 @@
<header class="home-pic">
<div class="home-pic-base">
<div class="top-pic">
<div class="top-pic-inner" style="background-image:url(//images2015.cnblogs.com/blog/528573/201609/528573-20160922181803449-1753077357.jpg) ">
<div class="top-pic-inner" style="background-image:url(//ww1.sinaimg.cn/mw690/d0d07035jw1f7f2n6w1j1j20e60e6wg4.jpg) ">
</div>
</div>
<div class="top-name _ellipsis">yangtao</div>
Expand Down
11 changes: 8 additions & 3 deletions src/vuex/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ export const get_person_info = ({ dispatch }, id, fn) => {
fn()
}
export const get_friends_list = ({ dispatch }, id) => {
let friends = require('../mock/contact')
dispatch('CONTACT_FRIENDS', friends)
console.log(friends)
let friends = require('../mock/contact')
dispatch('CONTACT_FRIENDS', friends)
console.log(friends)
}
//find
export const set_iframe_url = ({ dispatch }, urlObj, fn) => {
dispatch('SET_IFRAME_URL', urlObj)
!!fn && fn()
}


Expand Down
5 changes: 5 additions & 0 deletions src/vuex/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ export const chat_config = ({ chat }) => chat.chat_config
//contact
export const person_info = ({ contacts }) => contacts.person_info
export const contact_friends = ({ contacts }) => contacts.contact_friends

//find

export const iframe_url = ({ find }) => find.iframe_url
export const iframe_title = ({ find }) => find.iframe_title
16 changes: 16 additions & 0 deletions src/vuex/modules/find.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// import { } from '../mutation-types'
let state = {
iframe_url:'',
iframe_title:''
}
const mutations = {
['SET_IFRAME_URL'](state,urlObj){
state.iframe_url = urlObj.url
state.iframe_title = urlObj.title
}
}

export default {
state,
mutations
}
5 changes: 4 additions & 1 deletion src/vuex/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import base from './modules/base'
import chat from './modules/chat'
//联系人
import contacts from './modules/contacts'
//发现
import find from './modules/find'

Vue.use(Vuex)

Expand All @@ -15,7 +17,8 @@ export default new Vuex.Store({
modules: {
base,
chat,
contacts
contacts,
find
},
strict: true
})

0 comments on commit 93f245c

Please sign in to comment.