学员端小程序
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.

108 lines
2.7 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year 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. if(this.currentId==1) {
  41. // let url = 'https://www.hzsjspx.com/theory/scienceStudy?token=amlhcGVpMTY5NTc3NzUzODg5ODA5NjU1&lat=30.343055&lng=120.183711&isUni=1'
  42. let questionUrl = website+':93/question/'
  43. let phone = this.vuex_userInfo.phone
  44. let obj = {
  45. phone,
  46. cityCode: '3311',
  47. }
  48. // #ifdef MP-WEIXIN
  49. obj.isWx = 1
  50. // #endif
  51. let uniItem = encodeURIComponent(JSON.stringify(obj))
  52. let url = `${questionUrl}?uniItem=${uniItem}`
  53. console.log(url)
  54. this.$store.commit('updateWebVeiwUrl', url)
  55. this.$goPage('/pages/indexEntry/webView/webView')
  56. }else if(this.currentId==2) {
  57. let theory = website+':91/theory/'
  58. let token = this.$store.state.user.vuex_loginInfo.accessToken
  59. let lat = this.vuex_cityInfo.lat|| 30.27419537786047
  60. let lng = this.vuex_cityInfo.lng|| 120.20633397715788
  61. let url = `${theory}?token=${token}&lat=${lat}&lng=${lng}&isWx=1`
  62. this.$store.commit('updateWebVeiwUrl', url)
  63. this.$goPage('/pages/indexEntry/webView/webView')
  64. }
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .radioBox {
  71. width: 100%;
  72. }
  73. .h3 {
  74. font-size: 28rpx;
  75. color: #fff;
  76. padding: 20rpx 10rpx;
  77. }
  78. .radioItem {
  79. width: 100%;
  80. height: 120rpx;
  81. background: #FFFFFF;
  82. border-radius: 16rpx;
  83. margin-bottom: 20rpx;
  84. display: flex;
  85. justify-content: space-between;
  86. align-items: center;
  87. padding: 0 32rpx;
  88. .text {
  89. font-size: 28rpx;
  90. }
  91. .icon {
  92. width: 32rpx;
  93. height: 32rpx;
  94. }
  95. }
  96. .btn {
  97. width: 396rpx;
  98. height: 72rpx;
  99. background: #1989FA;
  100. border-radius: 8rpx;
  101. font-size: 28rpx;
  102. color: #fff;
  103. text-align: center;
  104. line-height: 72rpx;
  105. margin: 140rpx auto 0 auto;
  106. }
  107. </style>