- 注册时间
- 2012-3-31
- 最后登录
- 2019-4-2
- 阅读权限
- 150
- 积分
- 18852
- 精华
- 0
- 帖子
- 8776
|
用mini.message()来做,里面放个html,并且用JS来控制内部显示内容,和关闭时间
html:- <div id="htmlContent" style="padding-left:10px;display:none;">
- <div>请不要多次点击</div>
- <div id="count">3</div>
- </div>
复制代码 JS:- mini.parse();
- var htmlContent = document.getElementById("htmlContent");
- var time = parseInt(document.getElementById("count").innerHTML);
- function htmlClick() {
- htmlContent.style.display = "";
- var win = mini.showMessageBox({
- width: 250,
- title: "关闭",
- html: htmlContent,
- showModal: false,
- callback: function (action) {
-
- }
- });
- var s = setInterval(function () {
- time -= 1;
- document.getElementById("count").innerHTML = time
- if (time == 0) {
- clearInterval(s);
- mini.hideMessageBox(win);
- }
- }, 1000)
-
- }
复制代码 大概是这个样子 |
|