bindid.js 849 B

123456789101112131415161718192021222324252627282930313233
  1. function getbindid(options, store) {
  2. /* 通过分享小程序进入 */
  3. if (options.pid) {
  4. let pid = uni.getStorageSync('sys_pid');
  5. if (pid == '') {
  6. uni.setStorageSync('sys_pid', options.pid)
  7. } else {
  8. if (options.pid != '' && options.pid != pid) {
  9. uni.setStorageSync('sys_pid', options.pid)
  10. }
  11. }
  12. console.log('通过分享小程序进入首页1', options)
  13. }
  14. /* 通过扫推广小程序码进入首页 */
  15. if (options.scene) {
  16. const scene = decodeURIComponent(options.scene)
  17. if (scene) {
  18. let pid = uni.getStorageSync('sys_pid');
  19. if (pid == '') {
  20. uni.setStorageSync('sys_pid', scene)
  21. } else {
  22. if (scene != '' && scene != pid) {
  23. uni.setStorageSync('sys_pid', scene)
  24. }
  25. }
  26. }
  27. console.log('通过分享小程序进入首页2', uni.getStorageSync('sys_pid'))
  28. }
  29. }
  30. module.exports = {
  31. getbindid
  32. }