mui按鈕操作


第一種:通過id操作

document.getElementById("btnSelect").addEventListener("tap", function() {
                var name = document.getElementById("name").value;
                getlist(name);
            });

第二種:獲取模塊的id 【#btndiv】找到內部包含的class 【".bt"】

mui("#btndiv").on("tap", ".bt", function() {
                hishop.openVW('salesAddContacts');//跳轉新頁面
            });
//openVW方法

app.openVW = function(id, extras, url) {
$.openWindow({
//createNew: id == "product-detail" || id == 'storeproduct-detail',
id: id,
url: url || id + ".html",
extras: extras,
show: {
autoShow: true,
aniShow: 'pop-in',
duration: 300
},
waiting: {
autoShow: false
}
});
}

 

mui("#Dlist").on("tap", ".mreport", function() {
var id = this.getAttribute('data-id');//獲取下列循環列表里的 data-id
hishop.openVW('salesAddressbookDetail', {
'contactsid': id//跳轉頁面的時候傳遞值
});
});

//跳轉頁面獲取傳過來的值

var self = plus.webview.currentWebview();
contactsid = self.contactsid;

 

//循環ajax請求到的列表

<script type="text/html" id="message-body">
{{each MessageList as message}}
<div class="hd">
<img class="mui-pull-left" src="{{ShowSiteLink(message.Img)}}">
<a class="mreport" data-id="{{message.Id}}">
<em class="iconfont arrow_right right_more"></em></a>
<span>{{message.Name}} </span>
</a>
</div>
{{/each}}
</script>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM