verificationCodeAlert.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view>
  3. <u-popup v-model="show" mode="center" width="80%" border-radius="15" :closeable="true" :mask-close-able="false">
  4. <view class="code-alert-container">
  5. <view class="title">投票验证</view>
  6. <view class="code-input">
  7. <u-input placeholder="请输入验证码" maxlength="4" v-model="codevalue"></u-input>
  8. <image style="width: 160rpx; height: 80rpx;" :src="codeImg" @click="handleRefreshCode"></imague>
  9. </view>
  10. <view style="color: #EF9944; margin-bottom: 30rpx;">* 为了保证投票的公平性,防止刷票行为,请先完成验证</view>
  11. <u-button :custom-style="customStyle" shape="circle" @click="confirm">确认</u-button>
  12. </view>
  13. </u-popup>
  14. <toast ref="toast"></toast>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. props: {
  20. codeImg: ''
  21. },
  22. data() {
  23. return {
  24. show: false,
  25. customStyle: {
  26. color: 'white',
  27. background: "#E72226",
  28. width: '400rpx'
  29. },
  30. codevalue: ''
  31. };
  32. },
  33. created() {
  34. this.customStyle.background = this.vuex_theme.bgColor;
  35. },
  36. computed: {},
  37. methods: {
  38. handleRefreshCode(){
  39. this.$emit('handleRefreshCode')
  40. },
  41. confirm(){
  42. this.$emit('confirm',this.codevalue)
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .code-alert-container {
  49. padding: 50rpx;
  50. .title {
  51. width: 100%;
  52. text-align: center;
  53. padding: 0rpx 10rpx 50rpx 10rpx;
  54. font-weight: 500;
  55. color: #353535;
  56. letter-spacing: 2rpx;
  57. font-size: 30rpx;
  58. }
  59. .code-input{
  60. display: flex;
  61. align-items: center;
  62. margin-bottom: 20rpx;
  63. }
  64. }
  65. </style>