加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
demo.html 12.08 KB
一键复制 编辑 原始数据 按行查看 历史
熊立丁 提交于 2015-11-19 17:47 . wx-progress
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>wx demo</title>
<style>
.buttons wx-button {
margin: 14px;
}
@font-face {
font-weight: normal;
font-style: normal;
font-family: "weui";
src: url('data:application/octet-stream;base64,AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJAKExpAAABfAAAAFZjbWFw62+z7QAAAgwAAAIYZ2x5ZhDSxPMAAAREAAAGKGhlYWQHiJksAAAA4AAAADZoaGVhCAYD9wAAALwAAAAkaG10eDLIAAAAAAHUAAAAOGxvY2ELRgmeAAAEJAAAAB5tYXhwARwAPgAAARgAAAAgbmFtZeNcHtgAAApsAAAB5nBvc3QLp+XhAAAMVAAAAMUAAQAAA+gAAABaA+gAAAAAA8MAAQAAAAAAAAAAAAAAAAAAAA4AAQAAAAEAAAf32TpfDzz1AAsD6AAAAADSU6pCAAAAANJTqkIAAAAAA8MDwwAAAAgAAgAAAAAAAAABAAAADgAyAAQAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQOhAZAABQAIAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA6gHqDQPoAAAAWgPoAAAAAAABAAAAAAAAAAAAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAD6AAAA+gAAAPoAAAAAAAFAAAAAwAAACwAAAAEAAABbAABAAAAAABmAAMAAQAAACwAAwAKAAABbAAEADoAAAAE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JokW5lr2OJS38yx1uEbWtjFKfHqy9l9/KIUJa6F9Ery9OqKzTEyHQcKLAfhmIk+ksoyVQA=') format('truetype');
}
</style>
<script src="https://cdn.bootcss.com/riot/2.2.4/riot.js"></script>
<script src="/wx.js"></script>
</head>
<body style="background: #fbf9fe; margin: 0;">
<app>
<div class="buttons">
<wx-button>OK</wx-button>
<wx-button disabled>disabled</wx-button>
<wx-button class="wx-primary">OK</wx-button>
<wx-button class="wx-primary" disabled>disabled</wx-button>
<wx-button class="wx-danger">OK</wx-button>
<wx-button class="wx-danger" disabled>disabled</wx-button>
</div>
<div class="cells">
<wx-cells></wx-cells>
<div id="single-select"></div>
<div id="multi-select"></div>
</div>
<div class="toast">
<wx-button onclick="showToastDone()">show toast done</wx-button>
<wx-button onclick="showToastLoading()">show toast loading</wx-button>
<div id="wx-toast"></div>
</div>
<div class="dialog">
<wx-button onclick="showDialogAlert()">show dialog alert</wx-button>
<wx-button onclick="showDialogConfirm()">show dialog confirm</wx-button>
<div id="wx-dialog"></div>
</div>
<div class="progress">
<wx-progress></wx-progress>
</div>
</app>
<script>
// 支持物理像素
if (window.devicePixelRatio && devicePixelRatio >= 2) {
var testElem = document.createElement('div');
testElem.style.border = '.5px solid transparent';
document.body.appendChild(testElem);
if (testElem.offsetHeight == 1) {
document.querySelector('html').classList.add('hairlines');
}
document.body.removeChild(testElem);
}
var icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAMAAABgZ9sFAAAAVFBMVEXx8fHMzMzr6+vn5+fv7+/t7e3d3d2+vr7W1tbHx8eysrKdnZ3p6enk5OTR0dG7u7u3t7ejo6PY2Njh4eHf39/T09PExMSvr6+goKCqqqqnp6e4uLgcLY/OAAAAnklEQVRIx+3RSRLDIAxE0QYhAbGZPNu5/z0zrXHiqiz5W72FqhqtVuuXAl3iOV7iPV/iSsAqZa9BS7YOmMXnNNX4TWGxRMn3R6SxRNgy0bzXOW8EBO8SAClsPdB3psqlvG+Lw7ONXg/pTld52BjgSSkA3PV2OOemjIDcZQWgVvONw60q7sIpR38EnHPSMDQ4MjDjLPozhAkGrVbr/z0ANjAF4AcbXmYAAAAASUVORK5CYII=';
riot.mount('wx-button');
riot.mount('wx-cells', {title: "It's title of cells", dataset: [
{main: 'main'},
{main: 'main', text: 'text'},
{image: icon, main: 'main', text: 'text'},
{image: icon, main: 'main', text: 'text', click: function (e) {alert('You Click ' + e.item.main);}}
]});
riot.mount('#single-select', 'wx-select', {
title: "It's title of single select",
options: [
{main: 'my value is 1', value: 1, selected: true},
{main: 'my value is 2', value: 2}
],
onchange: function (values) {
alert('You select ' + JSON.stringify(values));
}
});
var multiselect = riot.mount('#multi-select', 'wx-select', {
title: "It's title of multiple select",
options: [
{main: 'my value is 1', value: 1, selected: true},
{main: 'my value is 2', value: 2}
],
onchange: function (values) {
alert('You select ' + JSON.stringify(values));
},
multiple: true
});
var showToastDone = function () {
riot.mount('#wx-toast', 'wx-toast', {
main: '已完成',
timeout: 3000,
ontimeout: function () {}
});
};
var showToastLoading = function () {
riot.mount('#wx-toast', 'wx-toast', {
sign: 'loading',
main: '数据加载中',
timeout: 3000,
ontimeout: function () {}
});
};
var showDialogAlert = function () {
riot.mount('#wx-dialog', 'wx-dialog', {
main: '弹窗标题',
text: '自定义弹窗内容',
});
};
var showDialogConfirm = function () {
riot.mount('#wx-dialog', 'wx-dialog', {
confirm: true,
main: '弹窗标题',
text: '自定义弹窗内容',
});
};
riot.mount('wx-progress', {
percent: 0.5,
oncancel: function () { alert('Cancel') },
});
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化