index.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <view>
  3. <!-- <image mode="widthFix" :src="isLogin ? '/static/wd_bg_login.jpg' : '/static/wd_bg.jpg'" :class="isLogin ? 'login_full_img' : 'full_img'"></image> -->
  4. <u-navbar :is-back="false" title="我的" :border-bottom="false" title-color="#333333" back-icon-color="#ffffff">
  5. <view class="slot-wrap">
  6. <image src="/static/logo2.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image>
  7. </view>
  8. </u-navbar>
  9. <view v-if="isLogin" class="imgs_bg">
  10. <view class="infos">
  11. <image :src="userInfo ? $method.splitImgHost(userInfo.avatar, true) : ''" class="avatar"></image>
  12. <!-- <view style="margin-left: 20rpx;z-index: 999;"> -->
  13. <view style="color: #FFFFFF;font-size: 32rpx;">{{ userInfo.nickname }}</view>
  14. <view style="color: #ffffff;font-size: 20rpx;margin-top: 17rpx">{{ userInfo.telphone }}</view>
  15. <!-- </view> -->
  16. </view>
  17. <image src="/static/me/me_bgpic.jpg" class="bg_pic"></image>
  18. </view>
  19. <view class="login_wrap" v-if="!isLogin">
  20. <view class="login_text">您还没有登录哦~</view>
  21. <view class="loginBtn" @click="jumpLogin">立即登录/注册</view>
  22. </view>
  23. <view v-if="isLogin" class="loginBox">
  24. <view class="contents">
  25. <!-- <view style="width: 100%;height: 40px;background-color: #F0F1F5;position: fixed;top: 150px;z-index: 100;"></view>
  26. <view style="display: flex;height: 160rpx;align-items: center; position: fixed;z-index: 999;top: 110px;" v-if="isLogin">
  27. <image :src="userInfo ? $method.splitImgHost(userInfo.avatar, true) : ''" class="avatar"></image>
  28. <view style="margin-left: 20rpx;z-index: 999;">
  29. <view style="color: #FFFFFF;font-size: 36rpx;padding: 10rpx;">{{ userInfo.nickname }}</view>
  30. <view style="color: #333333;font-size: 36rpx;padding: 10rpx;">{{ userInfo.telphone }}</view>
  31. </view>
  32. <view style="background-color: #F0F1F5;height:80rpx;"></view>
  33. </view>
  34. <view style="top: 195px;position: relative;padding-bottom: 30rpx;"> -->
  35. <!-- <navigator hover-class="none" url="/pages2/plan/index" class="menu_box">
  36. <view class="box_left">
  37. <image src="/static/icon/my_icon1.png" class="my_icon"></image>
  38. <view>学习计划</view>
  39. </view>
  40. <view class="box_right">
  41. 今天有
  42. <text>{{ userNums.planSum }}</text>
  43. 个学习任务
  44. </view>
  45. </navigator> -->
  46. <!-- <view class="two_menu">
  47. <navigator hover-class="none" url="/pages2/wd/class" class="small_menu">
  48. <image src="/static/icon/my_icon3.png" class="my_icon"></image>
  49. <view>我的网课</view>
  50. </navigator>
  51. <view @click="goBank()" class="small_menu">
  52. <image src="/static/icon/my_icon4.png" class="my_icon"></image>
  53. <view>我的题库通</view>
  54. </view>
  55. </view> -->
  56. <!-- <navigator hover-class="none" url="/pages5/liveDetail/list" class="menu_box" >
  57. <view class="box_left">
  58. <image src="/static/icon/my_icon12.png" class="my_icon"></image>
  59. <view>我的直播课</view>
  60. </view>
  61. <view class="box_right">
  62. <text>{{ total2 }}</text>
  63. 个课程直播中
  64. </view>
  65. </navigator> -->
  66. <navigator hover-class="none" url="/pages2/learn/my_learn" class="menu_box" >
  67. <view class="box_left">
  68. <image src="/static/icon/my_icon2.png" class="my_icon"></image>
  69. <view>我的学时</view>
  70. </view>
  71. <view class="box_right">
  72. 累计
  73. <text>{{ userNums.periodSum }}</text>
  74. 学时未通过
  75. </view>
  76. </navigator>
  77. <navigator hover-class="none" url="/pages5/exam/index" class="menu_box" >
  78. <view class="box_left">
  79. <image src="/static/icon/my_icon11.png" class="my_icon"></image>
  80. <view>我的模考</view>
  81. </view>
  82. <view class="box_right">
  83. <text>{{ total1 }}</text>
  84. 个模考预约
  85. </view>
  86. </navigator>
  87. <navigator hover-class="none" url="/pages2/exam/index" class="menu_box" >
  88. <view class="box_left">
  89. <image src="/static/icon/my_icon10.png" class="my_icon"></image>
  90. <view>我的考试</view>
  91. </view>
  92. <view class="box_right">
  93. <text>{{ userNums.subscribeSum }}</text>
  94. 考试预约
  95. </view>
  96. </navigator>
  97. <navigator hover-class="none" v-if="!hideBuyState" url="/pages2/order/index" class="menu_box">
  98. <view class="box_left">
  99. <image src="/static/icon/my_icon7.png" class="my_icon"></image>
  100. <view>我的订单</view>
  101. </view>
  102. <view class="box_right">
  103. <text>{{ userNums.orderSum }}</text>
  104. 笔待支付
  105. </view>
  106. </navigator>
  107. <navigator hover-class="none" url="/pages2/msg/index" class="menu_box">
  108. <view class="box_left">
  109. <image src="/static/icon/my_icon8.png" class="my_icon"></image>
  110. <view>我的消息</view>
  111. </view>
  112. <view class="box_right">
  113. <text>{{ userNums.informSum }}</text>
  114. 条未读
  115. </view>
  116. </navigator>
  117. <navigator hover-class="none" url="/pages2/wd/info" class="menu_box">
  118. <view class="box_left">
  119. <image src="/static/icon/my_icon9.png" class="my_icon"></image>
  120. <view>我的资料</view>
  121. </view>
  122. <view class="box_right">
  123. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  124. </view>
  125. </navigator>
  126. </view>
  127. <view class="logout" @click="logout">退出</view>
  128. </view>
  129. <!-- <u-navbar :is-back="false" title="我的" :border-bottom="false" background="{ background: '#ffffff',opacity:0.4; }" title-color="#ffffff" back-icon-color="#ffffff">
  130. <view class="slot-wrap"><image src="/static/logo.png" style="width: 178rpx;height: 31rpx;margin-left: 30rpx;"></image></view>
  131. </u-navbar> -->
  132. <!-- <tab-bar v-model="current" :list="tabbarlist" :mid-button="true" :mid-button-size="50" class="tab_items"></tab-bar> -->
  133. </view>
  134. </template>
  135. <script>
  136. // import { websocket } from '@/common/socket.js';
  137. import { mapGetters } from 'vuex';
  138. // import TabBar from '@/components/u-tabbar/u-tabbar.vue';
  139. export default {
  140. // components: {TabBar},
  141. data() {
  142. return {
  143. list: [23, 24, 25, 26, 27, 28, 29],
  144. content: '此功能暂未开放',
  145. show: false,
  146. isLogin: false,
  147. userNums: {},
  148. total1:0,
  149. total2:0,
  150. current: 4,
  151. tabbarlist: this.$store.state.tabLists
  152. };
  153. },
  154. onLoad(option) {
  155. // console.log(option,987)
  156. },
  157. onShow() {
  158. this.isLogin = this.$method.isLogin();
  159. if(this.isLogin){
  160. this.$store.state.allowLoading = false;
  161. this.getNums();
  162. this.getCount();
  163. this.goodsLivingSectionList();
  164. this.$store.state.allowLoading = true;
  165. }
  166. // this.$store.dispatch('changeTabsNum')
  167. },
  168. methods: {
  169. getCount() {
  170. this.$api.mockSubscribeListSubscribe({
  171. mockStatus:0,
  172. pageNum:1,
  173. pageSize:1,
  174. }).then(res => {
  175. this.total1 = res.data.total
  176. })
  177. },
  178. goodsLivingSectionList() {
  179. this.$api.goodsLivingSectionList().then(res => {
  180. this.total2 = res.data.data.length
  181. })
  182. },
  183. goBank() {
  184. this.$api.lockLockStatus({
  185. action:'bank'
  186. }).then(res => {
  187. if(res.data.code == 200) { //有其他端在操作,不能学习
  188. uni.showToast({
  189. icon:'none',
  190. title:res.data.msg,
  191. duration:3000,
  192. })
  193. } else if(res.data.code == 500) { //可以学习
  194. uni.navigateTo({
  195. url:'/pages2/wd/question_bank'
  196. })
  197. }
  198. })
  199. },
  200. getNums() {
  201. this.$api.getinfoAttached().then(res => {
  202. if (res.data.code === 200) {
  203. this.userNums = res.data.data;
  204. const nums = res.data.data.informSum + res.data.data.orderSum + res.data.data.periodSum + res.data.data.planSum + res.data.data.subscribeSum;
  205. this.$store.commit('tabNum', nums);
  206. }
  207. });
  208. },
  209. logout() {
  210. // websocket.stop()
  211. this.$method.exit();
  212. this.isLogin = this.$method.isLogin();
  213. },
  214. jumpLogin() {
  215. this.$navTo.togo('/pages4/login/login');
  216. }
  217. },
  218. computed: { ...mapGetters(['userInfo','hideBuyState']) }
  219. };
  220. </script>
  221. <style>
  222. ::-webkit-scrollbar {
  223. width: 0;
  224. height: 0;
  225. color: transparent;
  226. }
  227. page {
  228. background-color: #f0f1f5;
  229. }
  230. </style>
  231. <style scoped lang="scss">
  232. .login_wrap {
  233. text-align: center;
  234. margin-top: 100rpx;
  235. .login_text {
  236. color: #007AFF;
  237. font-size: 36rpx;
  238. font-weight: bold;
  239. }
  240. .loginBtn {
  241. width: 526rpx;
  242. height: 80rpx;
  243. background: linear-gradient(90deg, #015eea, #00c0fa);
  244. box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
  245. border-radius: 40rpx;
  246. color: #ffffff;
  247. line-height: 80rpx;
  248. margin: 0 auto;
  249. margin-top: 50rpx;
  250. }
  251. }
  252. .imgs_bg {
  253. width: 100%;
  254. height: 429rpx;
  255. position: fixed;
  256. z-index: 999;
  257. .infos {
  258. position: absolute;
  259. top: 0;
  260. left: 0;
  261. width: 100%;
  262. z-index: 99;
  263. display: flex;
  264. flex-direction: column;
  265. align-items: center;
  266. }
  267. .bg_pic {
  268. width: 100%;
  269. height: 100%;
  270. display: block;
  271. position: absolute;
  272. top: 0;
  273. left: 0;
  274. z-index: 9;
  275. }
  276. }
  277. .avatar {
  278. height: 160rpx;
  279. width: 160rpx;
  280. border-radius: 50%;
  281. margin: 110rpx 0rpx 37rpx 0rpx;
  282. }
  283. .small_menu {
  284. width: 45%;
  285. height: 104rpx;
  286. background: #ffffff;
  287. border-radius: 24rpx;
  288. display: flex;
  289. align-items: center;
  290. padding-left: 20rpx;
  291. margin-top: 30rpx;
  292. }
  293. .two_menu {
  294. font-size: 32rpx;
  295. color: #666;
  296. display: flex;
  297. justify-content: space-between;
  298. }
  299. .my_icon {
  300. width: 56rpx;
  301. height: 56rpx;
  302. margin-right: 20rpx;
  303. }
  304. .menu_box {
  305. height: 130rpx;
  306. background: #ffffff;
  307. // border-radius: 24rpx;
  308. // margin-top: 30rpx;
  309. display: flex;
  310. align-items: center;
  311. // padding: 0 20rpx;
  312. justify-content: space-between;
  313. color: #666666;
  314. font-size: 30rpx;
  315. font-weight: 500;
  316. border-bottom: 1rpx solid #EEEEEE;
  317. .box_left {
  318. display: flex;
  319. align-items: center;
  320. }
  321. .box_right {
  322. font-size: 32rpx;
  323. text {
  324. color: #007AFF;
  325. margin: 0 5rpx;
  326. }
  327. }
  328. }
  329. .loginBox {
  330. position: relative;
  331. padding: 0 30rpx 180rpx 30rpx;
  332. top: 430rpx;
  333. width: 100%;
  334. height: 100%;
  335. margin-top: 30rpx;
  336. .contents {
  337. width: 100%;
  338. height: 100%;
  339. border-radius: 24rpx;
  340. background-color: #ffffff;
  341. padding: 0rpx 30rpx 0rpx 20rpx;
  342. }
  343. }
  344. .login_full_img {
  345. display: block;
  346. width: 100%;
  347. height: 150px !important;
  348. z-index: 300;
  349. top: 0;
  350. position: fixed;
  351. }
  352. .full_img {
  353. display: block;
  354. width: 100%;
  355. z-index: -999;
  356. top: 0;
  357. }
  358. .logout {
  359. color: #999999;
  360. text-align: center;
  361. font-size: 32rpx;
  362. margin-top: 50rpx;
  363. }
  364. </style>