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

104 lines
2.6 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months 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. export default {
  21. data() {
  22. return {
  23. radioArr: [
  24. {text: '自学练习', id: 1},
  25. {text: '记录理论学时', id: 2},
  26. {text: '安全警示教育在线视频学习', id: 3},
  27. ],
  28. currentId: 2,
  29. }
  30. },
  31. methods: {
  32. changeNav(item) {
  33. this.currentId = item.id
  34. },
  35. goPage() {
  36. if(this.currentId==1) {
  37. // let url = 'https://www.hzsjspx.com/theory/scienceStudy?token=amlhcGVpMTY5NTc3NzUzODg5ODA5NjU1&lat=30.343055&lng=120.183711&isUni=1'
  38. let questionUrl = 'http://192.168.1.44:92/question/'
  39. let phone = this.vuex_userInfo.mobile
  40. let obj = {
  41. phone,
  42. cityCode: '3311',
  43. }
  44. // #ifdef MP-WEIXIN
  45. obj.isWx = 1
  46. // #endif
  47. let uniItem = encodeURIComponent(JSON.stringify(obj))
  48. let url = `${questionUrl}?uniItem=${uniItem}`
  49. console.log(url)
  50. this.$store.commit('updateWebVeiwUrl', url)
  51. this.$goPage('/pages/indexEntry/webView/webView')
  52. }else if(this.currentId==2) {
  53. let theory = 'http://192.168.1.44:91/theory/'
  54. let token = this.$store.state.user.vuex_loginInfo.accessToken
  55. let lat = this.vuex_cityInfo.lat|| 30.27419537786047
  56. let lng = this.vuex_cityInfo.lng|| 120.20633397715788
  57. let url = `${theory}?token=${token}&lat=${lat}&lng=${lng}&isUni=1`
  58. this.$store.commit('updateWebVeiwUrl', url)
  59. this.$goPage('/pages/indexEntry/webView/webView')
  60. }
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .radioBox {
  67. width: 100%;
  68. }
  69. .h3 {
  70. font-size: 28rpx;
  71. color: #fff;
  72. padding: 20rpx 10rpx;
  73. }
  74. .radioItem {
  75. width: 100%;
  76. height: 120rpx;
  77. background: #FFFFFF;
  78. border-radius: 16rpx;
  79. margin-bottom: 20rpx;
  80. display: flex;
  81. justify-content: space-between;
  82. align-items: center;
  83. padding: 0 32rpx;
  84. .text {
  85. font-size: 28rpx;
  86. }
  87. .icon {
  88. width: 32rpx;
  89. height: 32rpx;
  90. }
  91. }
  92. .btn {
  93. width: 396rpx;
  94. height: 72rpx;
  95. background: #1989FA;
  96. border-radius: 8rpx;
  97. font-size: 28rpx;
  98. color: #fff;
  99. text-align: center;
  100. line-height: 72rpx;
  101. margin: 140rpx auto 0 auto;
  102. }
  103. </style>