-
gibada说:
请使用echart 设计一个大屏展示
可以使用echart的【漏斗图】功能来实现,漏斗图可以展示某个事物从源头到最终结果的流程,比如可以用来展示营销流程:
var myChart = echarts.init(document.getElementById('main')); option = { title: { text: '漏斗图', subtext: '营销流程' }, tooltip: { trigger: 'item', formatter: "{a} {b} : {c}%" }, toolbox: { feature: { dataView: {readOnly: false}, restore: {}, saveAsImage: {} } }, legend: { data: ['展示', '点击', '访问', '咨询', '订单'] }, series: [ { name: '营销流程', type: 'funnel', left: '10%', top: 60, //x2: 80, bottom: 60, width: '80%', // height: {totalHeight} - y - y2, min: 0, max: 100, minSize: '0%', maxSize: '100%', sort: 'descending', gap: 2, label: { normal: { show: true, position: 'inside' }, emphasis: { textStyle: { fontSize: 20 } } }, labelLine: { normal: { length: 10, lineStyle: { width: 1, type: 'solid' } } }, itemStyle: { normal: { borderColor: '#fff', borderWidth: 1 } }, data: [ {value: 60, name: '访问'}, {value: 40, name: '咨询'}, {value: 20, name: '订单'}, {value: 80, name: '点击'}, {value: 100, name: '展示'} ] } ] }; myChart.setOption(option);
-
nigger说:
试用jQuery写一个表单页面当用户选择下拉框时弹出一张图片
jQuery表单页面 $(document).ready(function () { $("#select").change(function () { if ($("#select").val() == "1") { $("#img").attr("src", "https://www.runoob.com/wp-content/uploads/2014/09/icon.jpg"); } if ($("#select").val() == "2") { $("#img").attr("src", "https://www.runoob.com/wp-content/uploads/2014/09/icon2.jpg"); } }); }); --请选择一个图片-- 图片1 图片2
-
nigger说:
jQuery监听选项
框的点击事件
$("#username_div").click(function () {
$("#username_div").css("border","1px solid #ff6700");
$("#password_div").css("border","1px solid #ccc");
});
$("#password_div").click(function () {
$("#password_div").css("border","1px solid #ff6700");
$("#username_div").css("border","1px solid #ccc");
});
// 2.给登录按钮添加点击事件
$("#login_btn").click(function () {
// 3.获取用户输入的用户名和密码
var username = $("#username").val();
var password = $("#password").val();
// 4.判断用户名和密码是否为空
if(username.trim() == "" || password.trim() == ""){
mui.toast("用户名和密码不能为空");
return;
}
// 5.调用登录接口
$.ajax({
url:"/user/login",
type:"post",
data:{
username:username,
password:password
},
success:function (res) {
console.log(res);
// 6.判断是否登录成功
if(res.error == 403){
mui.toast(res.message);
}
if(res.success){
// 7.登录成功跳转到个人中心页
location.href="user.html";
}
}
})
});
})3. 后台登录接口 ```js //1.引入模块 const express = require("express"); const router = express.Router(); const bcrypt = require("bcrypt"); const User = require("../../models/User"); //2.创建登录路由 router.post("/login",(req,res)=>{ //3.获取用户输入的用户名和密码 const username = req.body.username; const password = req.body.password; //4.查询数据库 User.findOne({username:username}) .then(user=>{ if(user){ //5.比较密码 bcrypt.compare(password,user.password,(err,isMatch)=>{ if(isMatch){ res.json({ success:true }) }else{ res.json({ error:403, message:"密码不正确" }) } }) }else{ res.json({ error:403, message:"用户名不存在" }) } }) }); //6.导出路由 module.exports = router;
5.2 个人中心
- 前端页面
用户中心 用户中心 昵称 欢迎您! 我的订单 收货地址 联系客服 退出登录
- 订单页面
我的订单 我的订单 全部订单 待付款 已完成 删除 待支付 春装新款毛呢外套女 购买数量:1 总价:¥199 支付宝支付
- 收货地址页面
收货地址
-
-
peng111说:
python怎么做三列十四行表格
# -*- coding: UTF-8 -*- # 导入模块 import pandas as pd # 使用DataFrame构建三列十四行表格 data = {'A': list(range(1, 15)), 'B': list(range(1, 15)), 'C': list(range(1, 15))} df = pd.DataFrame(data) # 输出结果 print(df)
输出结果:
A B C
0 1 1 1
1 2 2 2
2 3 3 3
3 4 4 4
4 5 5 5
5 6 6 6
6 7 7 7
7 8 8 8
8 9 9 9
9 10 10 10
10 11 11 11
11 12 12 12
12 13 13 13
13 14 14 14 -
peng111说:
python怎么做三50列50行表格
§ Code
#使用Python的模块printtable
from printtable import PrintTable#定义列标题
col_titles=['col1','col2','col3','col4','col5','col6','col7','col8','col9','col10',
'col11','col12','col13','col14','col15','col16','col17','col18','col19','col20',
'col21','col22','col23','col24','col25','col26','col27','col28','col29','col30',
'col31','col32','col33','col34','col35','col36','col37','col38','col39','col40',
'col41','col42','col43','col44','col45','col46','col47','col48','col49','col50']#定义表格内容
table_data = [
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50'],
['1','2','3','4','5','6','7','8','9','10',
'11','12','13','14','15','16','17','18','19','20',
'21','22','23','24','25','26','27','28','29','30',
'31','32','33','34','35','36','37','38','39','40',
'41','42','43','44','45','46','47','48','49','50']
]#创建表格
table = PrintTable(col_titles)#添加表格内容
table.add_rows(table_data)#打印表格
table.print_table()§ Output
stdout : ['+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+----...----+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+\n', 'Total rows: 10\n']
§ END OF DOC
-
marlkiller说:
java 支持携程吗? 请提供一份示例
是的,Java 支持使用携程来实现多线程编程。下面是一个简单的 Java 携程示例:
public class MyThread implements Runnable{
public void run(){
System.out.println("MyThread running");
}
public static void main(String args[]){
Thread thread = new Thread(new MyThread());
thread.start();
}
}