app开发中读取数据库信息的vue页面
<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页面的更多相关文章
- app开发中如何利用sessionId来实现服务端与客户端保持回话
app开发中如何利用sessionId来实现服务端与客户端保持回话 这个问题太过于常见,也过于简单,以至于大部分开发者根本没有关注过这个问题,我根据和我沟通的开发者中,总结出来常用的方法有以下几种: ...
- APP开发中,如何从UI设计上提升APP用户体验
设计中有很多细微的东西要注意,就如UI设计中,元素的统一性,图标风格.段落的排版等等,只有能注意这些细节,你的 APP UI 才算合格. 干货君总结了17个提升用户体验的 UI 设计小技巧,也是我们日 ...
- django模板中变更数据库信息后,如何把变更后的信息同步更新到数据库
我们在基于django开发项目的过程中,经常会遇到数据库表字段增加,删除,或者修改的情况,以及字段属性更改的情况,因为django基于ORM模式来操作数据库的, 传统上如果django项目中的数据库m ...
- Android 设备,如何root,执行adb shell,查看设备中的数据库信息等【转】
原文地址: Android 设备,如何root,执行adb shell,查看设备中的数据库信息等
- hybrid app开发中:苹果移动设备实用Meta标签
hybrid app开发中:苹果移动设备实用Meta标签 “apple-mobile-web-app-status-bar-style”作用是控制状态栏显示样式 具体效果如下: status-bar- ...
- PHP 开发 APP 接口 学习笔记与总结 - APP 接口实例 [2] 首页 APP 接口开发方案 ① 读取数据库方式
方案一:读取数据库方式 从数据库读取信息→封装→生成接口数据 应用场景: 数据时效性比较高的系统 方案二:读取缓存方式 从数据库获取信息(第一次设置缓存或缓存失效时)→封装(第一次设置缓存或缓存失效时 ...
- 读取数据库信息并生成表设计文档Word版本
1.参考C#代码 using Help.DBAccessLayer.Business; using Help.DBAccessLayer.Model.SqlGenerator; using Newto ...
- Android开发中使用数据库时出现java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.
最近在开发一个 App 的时候用到了数据库,可是在使用数据库的时候就出现了一些问题,在我查询表中的一些信息时出现了一下问题: Caused by: java.lang.IllegalStateExce ...
- itext poi 学习之旅 (3)读取数据库信息并由excel展现出来
DBConnection.java 连接数据库操作 package com.zkbj.poi; import java.sql.Connection; import java.sql.DriverMa ...
随机推荐
- GIT命令行笔记
一次常规的初始化+推送: git initgit config user.email "you@example.com"git config user.name "asm ...
- flask-日料网站搭建-后台登录
引言:想使用python的flask框架搭建一个日料网站,主要包含web架构,静态页面,后台系统,交互,今天教大家实现后台登录功能,比较简单. 本节知识:表单标签,表单验证,数据查询,模板 pytho ...
- python 中logging模块
logging的作用:python中,logging模块主要是处理日志的.所谓日志,可理解为在软件运行过程中,所记录的的一些运行情况信息,软件开发人员可以根据自己的需求添加日志,日志可以帮助软件开发人 ...
- three.js学习:性能监视器stats.js的用法
用法一: var stats = new Stats(); stats.setMode(0); stats.domElement.style.position = 'absolute'; stats. ...
- appium 搭建及实例
一.Appium环境搭建(Java版本) 转载2016-04-26 09:24:55 标签:appium移动端自动化测试 市场需求与职业生涯的碰撞,阴差阳错我就跨进了移动App端自动化测试的大门,前生 ...
- day16(软件开发目录规范)
模块的使用01 模块的循环导入问题 解决方案一: 把循环导入的语句放到名字定义的后面 解决方案二: 将循环导入语句放到函数内(先定义确定名称空间)02 区分python文件的两种用途 #当文件被执行时 ...
- ASP.NET 实现重启系统或关机
在C#程序中实现电脑的关机.重启,两种方法可以实现: 方法1:启动Shell进程,调用外部命令shutdown.exe来实现. 首先导入命名空间using System.Diagnostics;然后, ...
- [Android]数据篇 --- SharedPreferences
转载请标注:转载于http://www.cnblogs.com/Liuyt-61/p/6637515.html -------------------------------------------- ...
- 修改json文件
第三方库jq https://stedolan.github.io/jq/manual/ cat old_deploy.json \ | jq --arg cpu_limit $cpu_limit ' ...
- 《GPU高性能编程CUDA实战》第六章 常量内存
▶ 本章介绍了常量内存的使用,并给光线追踪的一个例子.介绍了结构cudaEvent_t及其在计时方面的使用. ● 章节代码,大意是有SPHERES个球分布在原点附近,其球心坐标在每个坐标轴方向上分量绝 ...