test.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="content">
  3. <button @click="open">打开弹窗</button>
  4. </view>
  5. </template>
  6. <script>
  7. import {
  8. mapState,
  9. mapGetters
  10. } from 'vuex'
  11. export default {
  12. name: "hah",
  13. data() {
  14. return {
  15. code: ""
  16. }
  17. },
  18. async created() {
  19. this.$Request({
  20. url: "/getStationNoticeInfo",
  21. method: 'GET',
  22. data: {
  23. stationId: this.$store.state.stationId
  24. }
  25. }).then((res) => {})
  26. let [err, loginData] = await uni.login();
  27. this.code = loginData.code
  28. },
  29. computed: {
  30. ...mapState({
  31. text: state => state.moduleA.text,
  32. timestamp: state => state.moduleB.timestamp,
  33. }),
  34. ...mapState(["appId", "stationId", "phoneNumber", "countryCode", "purePhoneNumber", "openId", "unionId",
  35. "userInfo"
  36. ]),
  37. ...mapGetters([
  38. 'timeString'
  39. ])
  40. },
  41. methods: {
  42. open() {
  43. // 通过组件定义的ref调用uni-popup方法
  44. this.$refs.popup.open()
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. uni-popup {
  51. .pay-type {
  52. width: 750rpx;
  53. height: 750rpx;
  54. background-color: #4CD964;
  55. }
  56. }
  57. </style>