洛阳学员端
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.

109 lines
2.8 KiB

6 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title=" "></topNavbar>
  4. <view class="pad">
  5. <view class="h3">请选择您要学习的类型</view>
  6. <view class="radioBox">
  7. <view class="radioItem" v-for="(item,index) in radioArr" :key="index" @click="changeNav(item)">
  8. <view class="text">{{ item.text }}</view>
  9. <view class="icon">
  10. <image src="@/static/images/index/radio_cli.png" mode="" v-if="currentId==item.id"></image>
  11. <image src="@/static/images/index/radio_nor.png" mode="" v-else></image>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="btn" @click="goPage">去练习</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import { website } from '@/config/site.config.js'
  21. export default {
  22. data() {
  23. return {
  24. radioArr: [
  25. {text: '自学练习', id: 1},
  26. {text: '记录理论学时', id: 2},
  27. {text: '安全警示教育在线视频学习', id: 3},
  28. ],
  29. currentId: 2,
  30. }
  31. },
  32. onLoad(options) {
  33. if(options.type) this.currentId = options.type
  34. },
  35. methods: {
  36. changeNav(item) {
  37. this.currentId = item.id
  38. },
  39. goPage() {
  40. return this.$u.toast('待确定!')
  41. if(this.currentId==1) {
  42. // let url = 'https://www.hzsjspx.com/theory/scienceStudy?token=amlhcGVpMTY5NTc3NzUzODg5ODA5NjU1&lat=30.343055&lng=120.183711&isUni=1'
  43. let questionUrl = website+':93/question/'
  44. let phone = this.vuex_userInfo.phone
  45. let obj = {
  46. phone,
  47. cityCode: '3311',
  48. }
  49. // #ifdef MP-WEIXIN
  50. obj.isWx = 1
  51. // #endif
  52. let uniItem = encodeURIComponent(JSON.stringify(obj))
  53. let url = `${questionUrl}?uniItem=${uniItem}`
  54. console.log(url)
  55. this.$store.commit('updateWebVeiwUrl', url)
  56. this.$goPage('/pages/indexEntry/webView/webView')
  57. }else if(this.currentId==2) {
  58. let theory = website+':91/theory/'
  59. let token = this.$store.state.user.vuex_loginInfo.accessToken
  60. let lat = this.vuex_cityInfo.lat|| 30.27419537786047
  61. let lng = this.vuex_cityInfo.lng|| 120.20633397715788
  62. let url = `${theory}?token=${token}&lat=${lat}&lng=${lng}&isWx=1`
  63. this.$store.commit('updateWebVeiwUrl', url)
  64. this.$goPage('/pages/indexEntry/webView/webView')
  65. }
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .radioBox {
  72. width: 100%;
  73. }
  74. .h3 {
  75. font-size: 28rpx;
  76. color: #fff;
  77. padding: 20rpx 10rpx;
  78. }
  79. .radioItem {
  80. width: 100%;
  81. height: 120rpx;
  82. background: #FFFFFF;
  83. border-radius: 16rpx;
  84. margin-bottom: 20rpx;
  85. display: flex;
  86. justify-content: space-between;
  87. align-items: center;
  88. padding: 0 32rpx;
  89. .text {
  90. font-size: 28rpx;
  91. }
  92. .icon {
  93. width: 32rpx;
  94. height: 32rpx;
  95. }
  96. }
  97. .btn {
  98. width: 396rpx;
  99. height: 72rpx;
  100. background: #1989FA;
  101. border-radius: 8rpx;
  102. font-size: 28rpx;
  103. color: #fff;
  104. text-align: center;
  105. line-height: 72rpx;
  106. margin: 140rpx auto 0 auto;
  107. }
  108. </style>