Skip to content

feat(mp-alipay): showToast api 支持 image 和 mask 属性 #5533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

chouchouji
Copy link
Contributor

支付宝已支持以上两个属性,相关文档

image

Copy link

github-actions bot commented Jun 10, 2025

Size report

Path Size
packages/size-check/dist/size-check.es.js 47.18 KB (0%)
packages/size-check/dist/style.css 2.82 KB (0%)
packages/uni-app/dist/uni-app.es.js 2.48 KB (0%)
packages/uni-h5-vue/dist/vue.runtime.esm.js 76.41 KB (0%)
packages/uni-mp-vue/dist/vue.runtime.esm.js 43.13 KB (0%)
packages/uni-mp-alipay/dist/uni.api.esm.js 14.74 KB (+0.4% 🔺)
packages/uni-mp-alipay/dist/uni.mp.esm.js 7.99 KB (0%)
packages/uni-mp-baidu/dist/uni.api.esm.js 11.33 KB (0%)
packages/uni-mp-baidu/dist/uni.mp.esm.js 9.68 KB (0%)
packages/uni-mp-qq/dist/uni.api.esm.js 10.65 KB (0%)
packages/uni-mp-qq/dist/uni.mp.esm.js 7.6 KB (0%)
packages/uni-mp-toutiao/dist/uni.api.esm.js 10.52 KB (0%)
packages/uni-mp-toutiao/dist/uni.mp.esm.js 9.42 KB (0%)
packages/uni-mp-weixin/dist/uni.api.esm.js 11.65 KB (0%)
packages/uni-mp-weixin/dist/uni.mp.esm.js 7.94 KB (0%)
packages/uni-quickapp-webview/dist/uni.api.esm.js 10.6 KB (0%)
packages/uni-quickapp-webview/dist/uni.mp.esm.js 8.16 KB (0%)

@Otto-J Otto-J requested a review from Copilot June 11, 2025 03:43
Copilot

This comment was marked as outdated.

@Otto-J
Copy link
Member

Otto-J commented Jun 11, 2025

补充单元测试,对比 alipay 的其他单元测试,验证用户输入和最终给 my.xxx 的 api 参数是否都和预期,是否正确的处理。

测试并说明 钉钉 是否支持,是否会导致钉钉小程序发生错误,做安全回退,钉钉和支付宝的 showtaost/showmodal 比较特殊。

@Otto-J Otto-J requested a review from Copilot June 12, 2025 03:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the new showToast API enhancements for the Alipay mini program, adding support for the image and mask properties as described in the updated documentation. The key changes include reordering and adding the "extend" import in multiple files, updating the showToast and showLoading implementations in protocols.ts to conditionally include new properties, and adding new tests to verify the API behavior across different platforms.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/uni-mp-compiler/src/template/codegen.ts Reordered import statements for consistency.
packages/uni-mp-alipay/src/api/protocols.ts Added the "extend" import and updated showToast/showLoading logic to support new properties.
packages/uni-mp-alipay/tests/api.spec.ts Added tests for showToast and showLoading to verify correct behavior based on canIUse responses.
Comments suppressed due to low confidence (3)

packages/uni-mp-alipay/tests/api.spec.ts:204

  • [nitpick] Consider reviewing the test naming convention; labels such as 'api-alipay' vs. 'api-dingding' might benefit from additional comments or consistency to clearly indicate the platform context.
test('api-alipay showLoading', () => {

packages/uni-mp-compiler/src/template/codegen.ts:1

  • [nitpick] Please ensure that the new import order conforms to the project's established style guidelines.
import { extend, hyphenate, isFunction, isPlainObject } from '@vue/shared'

packages/uni-mp-alipay/src/api/protocols.ts:1

  • Verify that adding the 'extend' import aligns with how similar utilities are used consistently across the codebase.
import { extend, hasOwn, isArray, isPlainObject } from '@vue/shared'

@Otto-J Otto-J merged commit 249405b into next Jun 13, 2025
1 of 4 checks passed
@Otto-J Otto-J deleted the feat-alipay-show branch June 13, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants