index.js 585 B

1234567891011121314151617181920212223
  1. const util = require('../../../utils/util.js');
  2. const qrcode = require('../../../utils/qrcode.js');
  3. const app = getApp();
  4. Page({
  5. data: {
  6. qrcode:"",
  7. info:{}
  8. },
  9. onLoad(options) {
  10. let that = this;
  11. util.ajax({
  12. func: "order/by_password",
  13. data: {"password": options.password }
  14. }, function (res) {
  15. if (res.code == 0) {
  16. var data = qrcode.createQrCodeImg(res.data.password, { 'size': 350,'errorCorrectLevel':'H' });
  17. that.setData({ qrcode: data, info:res.data});
  18. } else {
  19. util.showTips(res.reason);
  20. }
  21. });
  22. }
  23. })