耀实惠小程序
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.

80 lines
1.6 KiB

  1. <template>
  2. <view class="pages">
  3. <image class="img" :src="img_src+ 'answer_fail.png'" mode=""></image>
  4. <text class="title">{{title}}</text>
  5. <button class="btn" @click="toPrize">{{btn_text}}</button>
  6. </view>
  7. </template>
  8. <script>
  9. import config from "@/utils/js/config.js"
  10. export default {
  11. data() {
  12. return {
  13. img_src: config.img_url,
  14. title: "很遗憾您没有答对题目哦!",
  15. btn_text: "明天继续哦!",
  16. isback_: true
  17. }
  18. },
  19. onUnload() {
  20. if(this.isback_) {
  21. this.toAnswerQuestionsPrize(1)
  22. }
  23. },
  24. methods: {
  25. // 跳转答题区域
  26. toPrize() {
  27. this.isback_ = false;
  28. this.toAnswerQuestionsPrize(2)
  29. },
  30. // 返回到答题列表
  31. toAnswerQuestionsPrize(index) {
  32. var that = this;
  33. let page_url = getCurrentPages()
  34. if (page_url.length > 1) {
  35. var url = page_url[page_url.length-2].route;
  36. if (url == "pagesB/homeGridList/answerQuestionsPrize/detale/detale") {
  37. // 返回到答题列表 1为返回一次 因为还有自己的返回 2为点击btn返回所以两次
  38. uni.navigateBack({
  39. delta:index
  40. })
  41. }
  42. }
  43. },
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .pages{
  49. display: flex;
  50. flex-direction: column;
  51. align-items: center;
  52. .img{
  53. margin-top: 71rpx;
  54. width: 380rpx;
  55. height: 380rpx;
  56. border-radius: 50%;
  57. }
  58. .title{
  59. margin-top: 56rpx;
  60. font-size: 30rpx;
  61. font-weight: bold;
  62. color: #01AEEA;
  63. }
  64. .btn{
  65. margin-top: 85rpx;
  66. width: 536rpx;
  67. height: 76rpx;
  68. border-radius: 26rpx;
  69. border: 3rpx solid #01AEEA;
  70. background-color: #fff;
  71. font-size: 30rpx;
  72. color: #01AEEA;
  73. display: flex;
  74. justify-content: center;
  75. align-items: center;
  76. }
  77. }
  78. </style>