choose-image.js 625 B

1234567891011121314151617181920
  1. import { implJsapi } from './base';
  2. export var chooseImage = implJsapi({
  3. alipay: function (instance, args) {
  4. return new Promise(function (resolve, reject) {
  5. /**
  6. * @see https://opendocs.alipay.com/mini/api/media/image/my.chooseimage
  7. */
  8. instance.chooseImage({
  9. count: args.count,
  10. sourceType: args.sourceType,
  11. success: function (res) {
  12. resolve(res);
  13. },
  14. fail: function (err) {
  15. reject(err);
  16. },
  17. });
  18. });
  19. },
  20. });