contactmov.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <!-- components/contactmov/contactmov.wxml -->
  3. <view>
  4. <movable-area class="move-area-ser">
  5. <movable-view direction="all" :x="pageX + 'rpx'" :y="pageY + 'rpx'" class="move-view-ser">
  6. <image
  7. class="contact-img"
  8. mode="aspectFit"
  9. :src="'https://jzmall.lifejingzhi.com/file/jzmall/weixin/ad-kt.png?' + randomNum"
  10. @longpress="goJoin"
  11. @tap="goJoin"
  12. ></image>
  13. </movable-view>
  14. </movable-area>
  15. </view>
  16. </template>
  17. <script>
  18. // components/contactmov/contactmov.js
  19. const util = require('../../utils/util.js');
  20. const api = require('../../config/api.js');
  21. export default {
  22. data() {
  23. return {
  24. randomNum: (Math.random() * 100000000).toFixed(0)
  25. };
  26. },
  27. /**
  28. * 组件的属性列表
  29. */
  30. props: {
  31. pageX: {
  32. type: Number,
  33. default: 600
  34. },
  35. pageY: {
  36. type: Number,
  37. default: 1000
  38. }
  39. },
  40. /**
  41. * 组件的方法列表
  42. */
  43. methods: {
  44. goJoin() {
  45. // if (!app.globalData.hasLogin) {
  46. // wx.navigateTo({
  47. // url: "/pages/auth/login/login"
  48. // });
  49. // return;
  50. // }
  51. util.request(api.AuthInfo, {}, 'GET').then((res) => {
  52. if (res.errno == 0) {
  53. let mobile = res.data.mobile;
  54. let randomBoolean = Math.random() < 0.5;
  55. let cp = randomBoolean == true ? '13127931250' : '13122656821';
  56. uni.navigateTo({
  57. url: '/pages/ucenter/wx/join?mobile=' + mobile + '&cp=' + cp
  58. });
  59. }
  60. });
  61. }
  62. },
  63. created: function () {}
  64. };
  65. </script>
  66. <style>
  67. /* components/contactmov/contactmov.wxss */
  68. .move-area-ser {
  69. width: 750rpx;
  70. height: 100vh;
  71. top: 0rpx;
  72. /* pointer-events: auto; */
  73. position: fixed;
  74. pointer-events: none;
  75. }
  76. .move-view-ser {
  77. pointer-events: auto;
  78. width: 246rpx;
  79. height: 200rpx;
  80. }
  81. .contact-img {
  82. width: 246rpx;
  83. height: 200rpx;
  84. margin: 0;
  85. }
  86. </style>