• 0
  • 0

uniapp 代码

2019-11-19 846 0 admin 所属分类:Hbuilder

code复制

  1. #ifdef APP-PLUS
  2. plus.contacts.getAddressBook(
  3. plus.contacts.ADDRESSBOOK_PHONE,
  4. function (addressbook) {
  5. fun.alert("addressbook calback success");
  6. fun.alert("addressbook json: " + JSON.stringify(addressbook));
  7. try{
  8. if (addressbook.find==undefined) {
  9. fun.alert("addressbook.find 方法不存在");
  10. }
  11. fun.alert("111111111111111");
  12. addressbook.find(["displayName","phoneNumbers"],function(contacts){
  13. console.log("getAddressBook success");
  14. fun.alert(contacts.length);
  15. }, function () {
  16. fun.alert("getAddressBook fail");
  17. },{multiple:true});
  18. fun.alert("222222222222222222");
  19. }catch(e){
  20. fun.alert('调用find异常:'+JSON.stringify(e));
  21. }
  22. fun.alert("3333333333333333333");
  23. },
  24. function(e){
  25. if (e.code!=undefined && e.code==20) {
  26. fun.alert('未授权');
  27. }
  28. fun.alert("Get address book failed: " + JSON.stringify(e));
  29. });
  30. #endif

调用前一页的方法

code复制

  1. var pages = getCurrentPages();
  2. var page = pages[pages.length - 2];
  3. if (page && page.route && page.route.indexOf('/orders/orders') != -1) {
  4. page.$vm['updateNormalUI']();
  5. }


返回顶部