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

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