index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="">
  3. <view class="road">
  4. <view class="nav"
  5. ><view class="left">科目三真实考场</view>
  6. <navigator url="/otherPages/myExamRoadVideo/index">
  7. <view class="right">
  8. 查找我的考场<van-icon color="#498EF5" name="arrow"
  9. /></view>
  10. </navigator>
  11. </view>
  12. <view class="mark">
  13. <navigator url="/otherPages/examRoadVideo/index">
  14. <view class="button1">社会化驾驶人考场</view>
  15. </navigator>
  16. <image mode="widthFix" class="play" :src="bottom_arrrow"></image>
  17. </view>
  18. <view class="nav2">
  19. <image
  20. mode="widthFix"
  21. class="left"
  22. src="https://ndata.zzxcx.net/ctjk/mp-wx/teacherVideo/kemu3.png"
  23. ></image>
  24. <view class="right">
  25. <view>熟记考场</view>
  26. <view>考试不用慌</view>
  27. <navigator url="/otherPages/examRoadVideo/index">
  28. <view class="look">去看考场</view></navigator
  29. >
  30. </view>
  31. </view>
  32. </view>
  33. <view class="subject">
  34. <view v-for="(item, index) in kemu" :key="index" class="list">
  35. <view
  36. @click="
  37. goPath('/otherPages/videoSubjectList/index?subject=' + (index + 1))
  38. "
  39. >
  40. <image
  41. mode="widthFix"
  42. class="subject-bg"
  43. :src="
  44. 'https://ndata.zzxcx.net/ctjk/mp-wx/teacherVideo/kemubg' +
  45. (index + 1) +
  46. '.png'
  47. "
  48. ></image>
  49. <view class="text1"> 科目{{ item }} </view>
  50. <view class="text2"> 《视频讲解》 </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="care" :style="careVisible ? '' : 'display:none'">
  55. <view class="dialog">
  56. <official-account></official-account>
  57. <view @click="()=>{
  58. careVisible=false
  59. }" class="confirm"> 关闭</view>
  60. </view>
  61. </view>
  62. <view class="wxad">
  63. <ad
  64. ad-type="video"
  65. :ad-intervals="100"
  66. unit-id="adunit-8eb44bbd7e3147d4"
  67. ></ad>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import bottom_arrrow from "@/assets/img/bottom_arrrow.png";
  73. import api from "@/api";
  74. export default {
  75. data() {
  76. return {
  77. careVisible: false,
  78. bottom_arrrow,
  79. query: {},
  80. kemu: ["一", "二", "三", "四"],
  81. };
  82. },
  83. methods: {
  84. goPath(url) {
  85. let that = this;
  86. let userInfo = uni.getStorageSync("userInfo");
  87. let gzhOpenid = userInfo.gzhOpenid;
  88. console.log(userInfo);
  89. if (gzhOpenid) {
  90. uni.navigateTo({
  91. url,
  92. });
  93. } else {
  94. let hotStartupOption = uni.getStorageSync("hot_startup_option");
  95. let coldStartupOption = uni.getStorageSync("cold_startup_option");
  96. console.log(hotStartupOption.scene);
  97. console.log(coldStartupOption.scene);
  98. switch (coldStartupOption.scene) {
  99. case 1011:
  100. case 1017:
  101. case 1038:
  102. case 1047:
  103. case 1124:
  104. that.careVisible = true;
  105. break;
  106. default:
  107. uni.showModal({
  108. title: "请关注公众号",
  109. content: "关注后回到这里观看相关视频",
  110. success(res) {
  111. if (res.confirm) {
  112. uni.navigateTo({ url: "/otherPages/careGzh/index" });
  113. } else if (res.cancel) {
  114. }
  115. },
  116. });
  117. break;
  118. }
  119. // switch (){
  120. // case :
  121. // break;
  122. // }
  123. }
  124. },
  125. onLoad(query) {
  126. this.query = query;
  127. },
  128. },
  129. onShow() {
  130. api.user.getInfo().then((res) => {
  131. uni.setStorageSync("userInfo", res.data);
  132. this.$store.commit("SET_USERINFO", res.data);
  133. });
  134. },
  135. };
  136. </script>
  137. <style lang="scss" scoped>
  138. .care {
  139. width: 100vw;
  140. height: 100vh;
  141. background-color: rgba(0, 0, 0, 0.35);
  142. position: fixed;
  143. z-index: 10;
  144. top: 0;
  145. left: 0;
  146. display: flex;
  147. justify-content: center;
  148. align-items: center;
  149. align-content: center;
  150. .dialog {
  151. width: 300px;
  152. height: calc(84px + 72rpx);
  153. background: #fff;
  154. border-radius: 16rpx;
  155. overflow: hidden;
  156. }
  157. .confirm {
  158. width: 100%;
  159. height: 72rpx;
  160. text-align: center;
  161. font-size: 40rpx;
  162. line-height: 72rpx;
  163. color: #ee0a24;
  164. background: #fff;
  165. letter-spacing:15px;
  166. }
  167. }
  168. .road {
  169. width: 690rpx;
  170. margin: 0 auto;
  171. height: 478rpx;
  172. background: linear-gradient(
  173. 188deg,
  174. #edf4ff 0%,
  175. rgba(237, 244, 255, 0.43) 100%
  176. );
  177. border-radius: 20rpx 20rpx 20rpx 20rpx;
  178. opacity: 1;
  179. .nav {
  180. display: flex;
  181. width: 100%;
  182. justify-content: space-between;
  183. align-content: center;
  184. align-items: center;
  185. padding-left: 30rpx;
  186. padding-right: 30rpx;
  187. padding-top: 36rpx;
  188. .left {
  189. font-size: 36rpx;
  190. font-weight: bold;
  191. }
  192. .right {
  193. color: #498ef5;
  194. }
  195. }
  196. .mark {
  197. position: relative;
  198. padding-left: 30rpx;
  199. padding-right: 30rpx;
  200. margin-top: 22rpx;
  201. width: 328rpx;
  202. text-align: center;
  203. font-size: 0;
  204. .button1 {
  205. width: 268rpx;
  206. line-height: 64rpx;
  207. background: #498ef5;
  208. border-radius: 20rpx 20rpx 20rpx 20rpx;
  209. opacity: 1;
  210. color: #fff;
  211. font-size: 26rpx;
  212. text-align: center;
  213. }
  214. .play {
  215. width: 36rpx;
  216. margin-top: 4rpx;
  217. }
  218. }
  219. .nav2 {
  220. display: flex;
  221. width: 100%;
  222. padding-left: 30rpx;
  223. padding-right: 30rpx;
  224. justify-content: space-between;
  225. margin-top: 20rpx;
  226. .left {
  227. width: 408rpx;
  228. }
  229. .right {
  230. width: 200rpx;
  231. color: #498ef5;
  232. font-size: 30rpx;
  233. text-align: center;
  234. line-height: 1.5;
  235. .look {
  236. width: 200rpx;
  237. line-height: 92rpx;
  238. background: #498ef5;
  239. border-radius: 50rpx 50rpx 50rpx 50rpx;
  240. opacity: 1;
  241. font-size: 34rpx;
  242. color: #fff;
  243. margin-top: 10rpx;
  244. }
  245. }
  246. }
  247. }
  248. .subject {
  249. padding: 0 30rpx;
  250. display: flex;
  251. flex-direction: row;
  252. flex-wrap: wrap;
  253. justify-content: space-between;
  254. .list {
  255. position: relative;
  256. margin-bottom: 15rpx;
  257. .subject-bg {
  258. width: 334rpx;
  259. }
  260. .text1 {
  261. font-size: 42rpx;
  262. color: #fff;
  263. position: absolute;
  264. top: 30rpx;
  265. left: 60rpx;
  266. }
  267. .text2 {
  268. font-size: 42rpx;
  269. color: #fff;
  270. position: absolute;
  271. top: 88rpx;
  272. left: 40rpx;
  273. }
  274. }
  275. }
  276. .wxad {
  277. border: none;
  278. padding: 0 30rpx;
  279. }
  280. </style>