mine-qrcode.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="mine-qrcode">
  3. <view class="handlerUpload">
  4. <image src="" mode="" v-if="userInfo.qrcode"></image>
  5. <text v-else>
  6. 请点击上传二维码
  7. </text>
  8. </view>
  9. <button class="upload">上传二维码</button>
  10. <button class="save-qrcode" :class="active && 'active'" @click="handlerSave">保存</button>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. active: false,
  18. userInfo: {
  19. qrcode: ''
  20. }
  21. }
  22. },
  23. watch: {
  24. 'userInfo.qrcode': {
  25. handler(val) {
  26. if (val) {
  27. this.active = true
  28. }
  29. },
  30. immediate: true,
  31. deep: true
  32. }
  33. },
  34. methods: {
  35. handlerSave() {
  36. if (this.active) {
  37. this.$api.navigateTo('/pages/seller/remarks/mine-card')
  38. }
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .mine-qrcode {
  45. width: 100vw;
  46. height: 100vh;
  47. .handlerUpload {
  48. width: 420rpx;
  49. height: 420rpx;
  50. border: 1px dotted #B2B2B2;
  51. margin: 120rpx auto 0 auto;
  52. text-align: center;
  53. line-height: 420rpx;
  54. color: #B2B2B2;
  55. font-size: 24rpx;
  56. border-radius: 16rpx;
  57. }
  58. .upload {
  59. margin: 101rpx auto 0 auto;
  60. width: 600rpx;
  61. height: 90rpx;
  62. border-radius: 45rpx;
  63. opacity: 1;
  64. border: 1rpx solid #FF5B00;
  65. color: #FF5B00;
  66. line-height: 90rpx;
  67. text-align: center;
  68. }
  69. .save-qrcode {
  70. margin: 24rpx auto 0 auto;
  71. width: 600rpx;
  72. height: 90rpx;
  73. border-radius: 45rpx;
  74. opacity: 1;
  75. color: #FFFFFF;
  76. line-height: 90rpx;
  77. text-align: center;
  78. background-color: #E1E1E1;
  79. }
  80. .active {
  81. background: linear-gradient(90deg, #FF9300 0%, #FF5B00 100%);
  82. }
  83. }
  84. </style>