Result.js 453 B

1234567891011121314151617
  1. Page({
  2. data: {
  3. result: '', // 用于存储计算结果
  4. },
  5. onLoad: function(options) {
  6. const encodedResult = options.result;
  7. // 解码URL编码的字符串
  8. const decodedResult = decodeURIComponent(encodedResult);
  9. // 将解码后的字符串转换为JSON对象
  10. const resultArray = JSON.parse(decodedResult);
  11. // 更新页面数据以显示结果
  12. this.setData({
  13. result: resultArray[0].toString()
  14. });
  15. },
  16. });