qrcodejump.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view>
  3. </view>
  4. </template>
  5. <script>
  6. export default {
  7. data() {
  8. return {};
  9. },
  10. onLoad: function(e) {
  11. let _this = this
  12. uni.showLoading({
  13. title: '数据加载中'
  14. });
  15. if (e && e.scene) {
  16. const scene = decodeURIComponent(e.scene) // 处理扫码进商品详情页面的逻辑
  17. if (scene) {
  18. if (scene.split(',')[1]) {
  19. e.reid = scene.split(',')[1];
  20. uni.setStorageSync('reid', e.reid)
  21. }
  22. if (scene.split(',')[0]) {
  23. _this.$request.get('tuanzhang.detail', {
  24. id: scene.split(',')[0],
  25. samkey: (new Date()).valueOf()
  26. }).then(res => {
  27. if (res.errno == 0) {
  28. uni.setStorageSync('tz_id', res.data.id);
  29. uni.setStorageSync('tz_title', res.data.title);
  30. uni.reLaunch({
  31. url: '/pages/index/index'
  32. });
  33. }
  34. })
  35. }
  36. }
  37. }
  38. },
  39. /**
  40. * 页面相关事件处理函数--监听用户下拉动作
  41. */
  42. onPullDownRefresh: function() {
  43. setTimeout(() => {
  44. uni.stopPullDownRefresh()
  45. }, 200);
  46. },
  47. };
  48. </script>