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

87 lines
1.8 KiB

  1. <template>
  2. <view class="pages" v-if="title">
  3. <image class="img" :src="img_src+ 'answer_success.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. onLoad(options) {
  20. this.title = `恭喜答对${options.num}题,获得${options.integer}元兑购金`
  21. },
  22. onUnload() {
  23. if(this.isback_) {
  24. this.toAnswerQuestionsPrize(1)
  25. }
  26. },
  27. methods: {
  28. // 跳转答题区域
  29. toPrize() {
  30. // uni.redirectTo({
  31. // url: "./../index"
  32. // })
  33. this.isback_ = false;
  34. this.toAnswerQuestionsPrize(2)
  35. },
  36. // 返回到答题列表
  37. toAnswerQuestionsPrize(index) {
  38. var that = this;
  39. let page_url = getCurrentPages()
  40. if (page_url.length > 1) {
  41. var url = page_url[page_url.length-2].route;
  42. console.log(url,"----------------------------");
  43. if (url == "pagesB/homeGridList/answerQuestionsPrize/detale/detale") {
  44. // 返回到答题列表 1为返回一次 因为还有自己的返回 2为点击btn返回所以两次
  45. uni.navigateBack({
  46. delta:index
  47. })
  48. }
  49. }
  50. },
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .pages{
  56. display: flex;
  57. flex-direction: column;
  58. align-items: center;
  59. .img{
  60. margin-top: 71rpx;
  61. width: 380rpx;
  62. height: 380rpx;
  63. border-radius: 50%;
  64. }
  65. .title{
  66. margin-top: 56rpx;
  67. font-size: 30rpx;
  68. font-weight: bold;
  69. color: #01AEEA;
  70. }
  71. .btn{
  72. margin-top: 85rpx;
  73. width: 536rpx;
  74. height: 76rpx;
  75. border-radius: 26rpx;
  76. border: 3rpx solid #01AEEA;
  77. background-color: #fff;
  78. font-size: 30rpx;
  79. color: #01AEEA;
  80. display: flex;
  81. justify-content: center;
  82. align-items: center;
  83. }
  84. }
  85. </style>