<template>
<!-- 容器 -->
<div class="container">

<!-- 标头 -->
<div class="header" :style="{ height: height }">
<wxc-minibar background-color="#fff"
text-color="#1a1a1a"
:title="titles"
@wxcMinibarLeftButtonClicked="minibarLeftButtonClick">

<!-- 图片位置 -->
<image slot="right" @click="jump('employEdit')" class="icon-add" src="../../../web/assets/images/icon-add.png"></image>

</wxc-minibar>
</div>

<list class="list">

<!-- list容器 -->
<cell class="list-cell" v-for="num in list" @click="jump('employEdit',1)">
<div class="list-box">
<image class="menu-img" src="../../../web/assets/images/icon-find-maintenance.png"></image>

<span class="list-m">
<text class="set-name">{{num.employeeName+"员工"}}</text>
<!-- <text class="set-addr">{{num.employeePhone}}</text> -->
</span>

<image class="icon-triggle" src="../../../web/assets/images/icon-triggle.png"></image>
</span>
</div>
</cell>
</list>
</div>
</template>

<script>

import { WxcMinibar,WxcCell,WxcTabPage, WxcPanItem, Utils, BindEnv } from 'weex-ui';
//不变的
const modal = weex.requireModule('modal');
//定义变量
var stream = weex.requireModule('stream');

export default {
//组件
components: { WxcMinibar,WxcCell },
data(){
return{
height:88,
titles:'员工管理',
//定义list
list: []
}
},

created: function() {
var me = this;

},

//安装
mounted:function(){
var me = this;
console.log(6666666666666);
//数据接收发出
stream.fetch({
method: 'POST',
url: '/api/employee/findAll?name='+1,
type:'json'
}, function(ret) {
if(!ret.ok){
console.log("123");
me.getJsonpResult = "request failed";
}else{
me.list = ret.data;
//控制台打印 类似alert()

console.log(me.list[0].employeeName+"打印进来了");
}
//响应
},function(response){
//取得进展
console.log('get jsonp in progress:'+response.length);
//接收的字节数
me.getJsonpResult = "你好!!!:"+response.length;
console.log('最后返回:'+response.length);

});
},

/*
stream Demo演示
stream.fetch({
method: 'POST',
url: POST_URL,
type:'json'
}, function(ret) {
if(!ret.ok){

me.postResult = "request failed";
}else{
console.log('get:'+JSON.stringify(ret));
me.postResult = JSON.stringify(ret.data);
}
},function(response){
console.log('get in progress:'+response.length);
me.postResult = "bytes received:"+response.length;
});
*/

//预估
beforeCreate: function() {
//文档标记名
document.getElementsByTagName("body")[0].style.backgroundColor="#f4f4f4";
},
methods: {

toParams(obj){
var param = "";
for(const name in obj){
if(typeof obj[name] != 'function'){
param += "&" + "=" + encodeURI(obj[name]);
}
}
return param.substring(1);
},

//小左按钮
minibarLeftButtonClick () {
},
//小右按钮
minibarRightButtonClick () {
modal.toast({ 'message': 'click rightButton!', 'duration': 1 });
},
//点击
wxcCellClicked (e) {
console.log(e)
},
//跳转
jump(urlName,id){
// this.$router.push({name: urlName,params:{Id:id}});

/*第一个参数是跳转路径,第二个参数是代理商id*/
this.$router.push({name: urlName,params:{id:id}});
}
}
};

</script>
<style scoped>
.header{
z-index: 9999;
position: fixed;
top:0;
width: 100%;
border-bottom: 1px solid #e5e5e5;
}
.icon-add{
width: 29px;
height: 29px;
}
.container{
padding-top: 88px;
}
.list,.list-cell{
width: 750px;
}
.list{
padding-bottom: 98px;
}
.list-cell{
padding: 24px 20px;
border-bottom: 1px solid #f4f4f4;
background-color: #fff;
}
.list-box{
width: 100%;
flex-direction: row;
}
.text-name{
margin-bottom: 16px;
font-size: 28px;
color: #333333;
}

.list-m{
flex: 1;
padding:0 0 0 20px;
}
.list-r{
padding-top: 10px;
}

.text-status.color-has .color-n{
display: inline-block;
padding: 0 4px;
font-size: 26px;
background-color: #e5e5e5;
color: #999;
border-radius: 4px;
}
.set-name{
font-size: 28px;
line-height: 100px;
color: #333333;
}
.icon-triggle{
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
width: 17px;
height: 28px;
}
.menu-img{
width: 100px;
height: 100px;
border-radius: 4px;
}

</style>

app开发中读取数据库信息的vue页面的更多相关文章

  1. app开发中如何利用sessionId来实现服务端与客户端保持回话

    app开发中如何利用sessionId来实现服务端与客户端保持回话 这个问题太过于常见,也过于简单,以至于大部分开发者根本没有关注过这个问题,我根据和我沟通的开发者中,总结出来常用的方法有以下几种: ...

  2. APP开发中,如何从UI设计上提升APP用户体验

    设计中有很多细微的东西要注意,就如UI设计中,元素的统一性,图标风格.段落的排版等等,只有能注意这些细节,你的 APP UI 才算合格. 干货君总结了17个提升用户体验的 UI 设计小技巧,也是我们日 ...

  3. django模板中变更数据库信息后,如何把变更后的信息同步更新到数据库

    我们在基于django开发项目的过程中,经常会遇到数据库表字段增加,删除,或者修改的情况,以及字段属性更改的情况,因为django基于ORM模式来操作数据库的, 传统上如果django项目中的数据库m ...

  4. Android 设备,如何root,执行adb shell,查看设备中的数据库信息等【转】

    原文地址: Android 设备,如何root,执行adb shell,查看设备中的数据库信息等

  5. hybrid app开发中:苹果移动设备实用Meta标签

    hybrid app开发中:苹果移动设备实用Meta标签 “apple-mobile-web-app-status-bar-style”作用是控制状态栏显示样式 具体效果如下: status-bar- ...

  6. PHP 开发 APP 接口 学习笔记与总结 - APP 接口实例 [2] 首页 APP 接口开发方案 ① 读取数据库方式

    方案一:读取数据库方式 从数据库读取信息→封装→生成接口数据 应用场景: 数据时效性比较高的系统 方案二:读取缓存方式 从数据库获取信息(第一次设置缓存或缓存失效时)→封装(第一次设置缓存或缓存失效时 ...

  7. 读取数据库信息并生成表设计文档Word版本

    1.参考C#代码 using Help.DBAccessLayer.Business; using Help.DBAccessLayer.Model.SqlGenerator; using Newto ...

  8. Android开发中使用数据库时出现java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.

    最近在开发一个 App 的时候用到了数据库,可是在使用数据库的时候就出现了一些问题,在我查询表中的一些信息时出现了一下问题: Caused by: java.lang.IllegalStateExce ...

  9. itext poi 学习之旅 (3)读取数据库信息并由excel展现出来

    DBConnection.java 连接数据库操作 package com.zkbj.poi; import java.sql.Connection; import java.sql.DriverMa ...

随机推荐

  1. java读取按行txt文件

    import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; pub ...

  2. MySQL存储过程 事务transaction

    MySQL 中,单个 Store Procedure(SP) 不是原子操作,而 Oracle 则是原子的.如下的存储过程,即使语句2 失败,语句 1 仍然会被 commit 到数据库中: create ...

  3. Django-models的字段类型

    model的field类型 1.models.AutoField   ---自增列 = int(11)    如果没有的话,默认会生成一个名称为 id 的列,如果要显示的自定义一个自增列,必须将给列设 ...

  4. virt-install详解

    man virt-install VIRT-INSTALL() Virtual Machine Manager VIRT-INSTALL() NAME virt-install - provision ...

  5. JavaScript之函数,词法分析,内置对象和方法

    函数 函数定义 JavaScript中的函数和Python中的非常类似,只是定义方式有点区别. // 普通函数定义 function f1() { console.log("Hello wo ...

  6. java根据GPS(经纬度)获取地理位置

    package cn.antiy.weiqing.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONAr ...

  7. spring事务管理实现原理-源码-传播属性

    转载请标识 https://me.csdn.net/wanghaitao4j https://blog.csdn.net/wanghaitao4j/article/details/83625260 本 ...

  8. [Unity算法]斜抛运动

    斜抛运动: 1.物体以一定的初速度斜向射出去,物体所做的这类运动叫做斜抛运动. 2.斜抛运动看成是作水平方向的匀速直线运动和竖直方向的竖直上抛运动的合运动. 3.它的运动轨迹是抛物线. Oblique ...

  9. 重识linux-循环执行的例行性工作调度

    重识linux-循环执行的例行性工作调度 1 用户的设置 1)/etc/cron.allow  可以使用的账号,在这个文件内 2)/etc/cron.deny 不可以的放在这个文件里面 allow的优 ...

  10. 41.纯 CSS 绘制一支栩栩如生的铅笔

    原文地址: https://segmentfault.com/a/1190000015153865 感想: 不难 HTML code: <div class="pencil" ...