Skip to content

Commit

Permalink
some change
Browse files Browse the repository at this point in the history
  • Loading branch information
useryangtao committed Sep 25, 2016
1 parent 056c230 commit 01aa278
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 54 deletions.
14 changes: 6 additions & 8 deletions src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export default {
}
},
created() {
var isMobile = function(){
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = false;
for (var v = 0; v < Agents.length; v++) {
let isMobile = function(){
let userAgentInfo = navigator.userAgent;
let Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod")
let flag = false;
for (let v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = true; break; }
};
return flag;
Expand All @@ -71,9 +71,7 @@ export default {
setTimeout(() => {
this.welcome = false;
}, 2000)
if(isMobile){
}else{
if(!isMobile){
this.isnotMobile = true;
}
},
Expand Down
11 changes: 6 additions & 5 deletions src/route-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function(router) {

}
}
//个人相册
//个人相册
const albums = {
component: resolve => {
require(['./views/find/albums-friends.vue'], resolve)
Expand All @@ -31,6 +31,7 @@ export default function(router) {
'person-info': personInfo
}
}
//相互引用
personInfo.albums = albums

//对话框
Expand All @@ -57,15 +58,15 @@ export default function(router) {
'person-info': personInfo
}
},
'link':{
'link': {
component: resolve => {
require(['./components/iframe.vue'], resolve)
}
}
//other
}
}
//

//map
router.map({
'/chat': {
component: resolve => {
Expand Down Expand Up @@ -165,7 +166,7 @@ export default function(router) {
require(['./views/find/drift-bottle.vue'], resolve)
}
},
'shopping':{
'shopping': {
component: resolve => {
require(['./components/iframe.vue'], resolve)
}
Expand Down
16 changes: 0 additions & 16 deletions src/utils.js

This file was deleted.

10 changes: 1 addition & 9 deletions src/vuex/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ export const set_iframe_url = ({ dispatch }, urlObj, fn) => {
}


// export const set_person_info = ({ dispatch }, id) => {
// dispatch('PERSON_ID', id)
// }







// export const deleteTodo = makeAction('DELETE_TODO')
Expand All @@ -65,4 +57,4 @@ export const set_iframe_url = ({ dispatch }, urlObj, fn) => {

// function makeAction (type) {
// return ({ dispatch }, ...args) => dispatch(type, ...args)
// }</div>
// }
1 change: 0 additions & 1 deletion src/vuex/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ 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
5 changes: 3 additions & 2 deletions src/vuex/modules/chat.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
SET_MENU_WECHAT_LIST,
CHAT,
SET_NEWS_STATE
SET_NEWS_STATE,
DELETE_NEWS
} from '../mutation-types'

let state = {
Expand Down Expand Up @@ -97,7 +98,7 @@ const mutations = {
[SET_NEWS_STATE](state,index,val){
state.wechat_list[index].chatBaseModel.newsUnreadCount = val
},
['DELETE_NEWS'](state,index){
[DELETE_NEWS](state,index){
// state.wechat_list.shift();
state.wechat_list.splice(index,1);
}
Expand Down
22 changes: 11 additions & 11 deletions src/vuex/modules/contacts.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// import { } from '../mutation-types'
import { PERSON_INFO, CONTACT_FRIENDS, FRIEND_ID } from '../mutation-types'
let state = {
person_info:{
base:{}
person_info: {
base: {}
},
contact_friends:[]
contact_friends: []
}
const mutations = {
['PERSON_INFO'](state,infoObj){
[PERSON_INFO](state, infoObj) {
state.person_info = infoObj
},
['CONTACT_FRIENDS'](state,arr){
[CONTACT_FRIENDS](state, arr) {
state.contact_friends = arr;
},
['FRIEND_ID'](state,id){
[FRIEND_ID](state, id) {

}
}

export default {
state,
mutations
}
state,
mutations
}
8 changes: 6 additions & 2 deletions src/vuex/mutation-types.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
export const SET_MENU = 'SET_MENU'
export const SET_MENU_ACTIVE = 'SET_MENU_ACTIVE'
export const BACK_PATH = 'BACK_PATH'
//chat

//chat
export const SET_MENU_WECHAT_LIST = 'SET_MENU_WECHAT_LIST'
export const CHAT = 'CHAT'
export const SET_CHAT_COUNT = 'SET_CHAT_COUNT'
export const SET_NEWS_STATE = 'SET_NEWS_STATE'

export const DELETE_NEWS = 'DELETE_NEWS'

//contact
export const PERSON_INFO = 'PERSON_INFO'
export const CONTACT_FRIENDS = 'CONTACT_FRIENDS'
export const FRIEND_ID = 'FRIEND_ID'

0 comments on commit 01aa278

Please sign in to comment.