裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.5 KiB

  1. <template>
  2. <uv-popup
  3. ref="popup"
  4. :overlayOpacity="0.8"
  5. :customStyle="{
  6. backgroundColor: 'transparent',
  7. }"
  8. >
  9. <view class="flex content">
  10. <template v-if="mode === 'activate'">
  11. <image class="popup-bg" src="@/static/image/center/activate-code.png"></image>
  12. <view class="flex popup-btns">
  13. <button plain class="btn-simple" @click="close">
  14. <image class="popup-btn" src="@/static/image/center/cancel.png"></image>
  15. </button>
  16. <button plain class="btn-simple" @click="onConfirm">
  17. <image class="popup-btn" src="@/static/image/center/confirm.png"></image>
  18. </button>
  19. </view>
  20. <uv-input
  21. v-model="activateCode"
  22. :focus="true"
  23. inputAlign="center"
  24. color="#3DFEE0"
  25. fontSize="45rpx"
  26. border="none"
  27. :customStyle="{
  28. backgroundColor: 'transparent',
  29. width: '250rpx',
  30. height: '63rpx',
  31. position: 'absolute',
  32. top: '216rpx',
  33. left: '160rpx',
  34. }"
  35. ></uv-input>
  36. </template>
  37. <template v-else>
  38. <!-- todo: 切换切图 "你还不是代理商" -->
  39. <image class="popup-bg" src="@/static/image/center/activate-code.png"></image>
  40. <view class="flex popup-btns">
  41. <button plain class="btn-simple" @click="close">
  42. <image class="popup-btn" src="@/static/image/center/cancel.png"></image>
  43. </button>
  44. <button plain class="btn-simple" @click="mode = 'activate'" >
  45. <image class="popup-btn" src="@/static/image/center/activate.png"></image>
  46. </button>
  47. </view>
  48. </template>
  49. </view>
  50. </uv-popup>
  51. </template>
  52. <script>
  53. export default {
  54. props: {
  55. isAgent: {
  56. type: String,
  57. default: null
  58. }
  59. },
  60. data() {
  61. return {
  62. mode: '',
  63. activateCode: '',
  64. }
  65. },
  66. methods: {
  67. open(isAgent) {
  68. this.mode = isAgent ? 'activate' : ''
  69. this.$refs.popup.open();
  70. },
  71. close() {
  72. this.$refs.popup.close();
  73. },
  74. onConfirm() {
  75. // todo
  76. // submit activateCode and update userInfo
  77. this.close()
  78. }
  79. },
  80. }
  81. </script>
  82. <style scoped lang="scss">
  83. .content {
  84. position: relative;
  85. flex-direction: column;
  86. width: 570rpx;
  87. }
  88. .popup {
  89. &-bg {
  90. width: 514rpx; height: 355rpx;
  91. }
  92. &-btns {
  93. justify-content: space-between;
  94. margin-top: 56rpx;
  95. width: 100%;
  96. }
  97. &-btn {
  98. width: 265rpx;
  99. height: 84rpx;
  100. }
  101. }
  102. </style>