accept.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <g-toast :is-show="isShowToast">
  3. <view class="challenge-invite">
  4. <view class="challenge-user">
  5. <view
  6. class="user-avatar"
  7. :style="{ backgroundImage: `url(${serverUserInfo.cha_avatar})` }"
  8. />
  9. </view>
  10. <view class="challenge-title">
  11. “{{ serverUserInfo.cha_nickname }}”向你发起学分挑战 详情可在“我的挑战”列表中查看
  12. </view>
  13. <view class="challenage-btn" @click="toChallenge('0')">查看详情</view>
  14. </view>
  15. </g-toast>
  16. </template>
  17. <script>
  18. import GToast from "../../components/global/toast.vue"
  19. export default {
  20. components: {
  21. GToast
  22. },
  23. data() {
  24. return {
  25. serverUserInfo: uni.getStorageSync("serverUserInfo"),
  26. initToast: true
  27. }
  28. },
  29. computed: {
  30. isShowToast() {
  31. let { cha_nickname } = this.serverUserInfo
  32. return this.initToast && cha_nickname
  33. }
  34. },
  35. methods: {
  36. // 跳转挑战
  37. toChallenge() {
  38. uni.navigateTo({
  39. url: "../../pages/challenge/index?nav=0"
  40. })
  41. }
  42. }
  43. }
  44. </script>
  45. <style scoped lang="scss">
  46. .challenge-invite {
  47. display: flex;
  48. flex-direction: column;
  49. align-items: center;
  50. .challenge-user {
  51. width: 426rpx;
  52. height: 334rpx;
  53. margin: 0 auto 48rpx auto;
  54. background: url(https://api.jiuweiyun.cn/public/uploads/weapp/icon/invite.png) center no-repeat;
  55. background-size: 100%;
  56. position: relative;
  57. .user-avatar {
  58. width: 168rpx;
  59. height: 168rpx;
  60. border-radius: 50%;
  61. position: absolute;
  62. bottom: 8rpx;
  63. left: 50%;
  64. transform: translateX(-50%);
  65. background-position: center;
  66. background-repeat: no-repeat;
  67. background-size: 100%;
  68. background-color: #007AFF;
  69. }
  70. }
  71. .challenge-title {
  72. width: 456rpx;
  73. color: #FFF1AD;
  74. font-size: 32rpx;
  75. line-height: 50rpx;
  76. margin-bottom: 86rpx;
  77. font-weight: bold;
  78. }
  79. .challenage-btn{
  80. width: 502rpx;
  81. height: 96rpx;
  82. border-radius: 96rpx;
  83. background: linear-gradient(180deg, #FEEB71 0%, #F89018 100%);
  84. color: #984100;
  85. font-size: 32rpx;
  86. font-weight: bold;
  87. line-height: 96rpx;
  88. text-align: center;
  89. }
  90. }
  91. </style>