| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <template>
- <view class="container">
- <view class="name" @click="add()">请选择进入</view>
- <view class="image" @click="ToRegister(1)" v-if="userInfo.type != 2">
- <image src="../../static/img/img030.png"></image>
- <view class="identity">咨询预约</view>
- <view class="info">一对一医生咨询预约</view>
- </view>
- <view class="image" @click="ToRegister(2)">
- <image src="../../static/img/img031.png"></image>
- <view class="identity">科普学习</view>
- <view class="info">医疗知识课程直播详解</view>
- </view>
- </view>
- </template>
- <script>
- import {
- getUserInfo
- } from '@/api/login.js';
- export default {
- data() {
- return {
- userInfo: ''
- };
- },
- onLoad(option) {
- if (option.spread) {
- // 存储邀请人
- this.spread = option.spread;
- uni.setStorageSync('spread', option.spread);
- }
- },
- onShow() {
- let obj = this;
- getUserInfo({})
- .then(function(e) {
- obj.userInfo = e.data;
- uni.setStorageSync('userInfo', e.data);
- if (obj.userInfo.type == 2) {
- uni.setTabBarItem({
- index: 0,
- text: '首页',
- iconPath: 'static/tabBar/tab-home.png',
- selectedIconPath: 'static/tabBar/tab-home-current.png'
- });
- uni.setTabBarItem({
- index: 1,
- text: '我的病人',
- iconPath: 'static/tabBar/tab-cate.png',
- selectedIconPath: 'static/tabBar/tab-cate-current.png',
- visible: true
- });
- uni.setTabBarItem({
- index: 2,
- text: '科普学习',
- iconPath: 'static/tabBar/tab-study.png',
- selectedIconPath: 'static/tabBar/tab-study-current.png',
- visible: false
- });
- uni.setTabBarItem({
- index: 3,
- text: '接单',
- iconPath: 'static/tabBar/jd.png',
- selectedIconPath: 'static/tabBar/jd-act.png',
- visible: true
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png'
- });
- }
- if (obj.userInfo.type == 3) {
- uni.setTabBarItem({
- index: 0,
- text: '首页',
- iconPath: 'static/tabBar/tab-home.png',
- selectedIconPath: 'static/tabBar/tab-home-current.png'
- });
- uni.setTabBarItem({
- index: 1,
- text: '咨询记录',
- iconPath: 'static/tabBar/tab-cate.png',
- selectedIconPath: 'static/tabBar/tab-cate-current.png',
- visible: true
- });
- uni.setTabBarItem({
- index: 2,
- text: '科普学习',
- iconPath: 'static/tabBar/tab-study.png',
- selectedIconPath: 'static/tabBar/tab-study-current.png',
- visible: false
- });
- uni.setTabBarItem({
- index: 3,
- text: '发布订单',
- iconPath: 'static/tabBar/jd.png',
- selectedIconPath: 'static/tabBar/jd-act.png',
- pagePath: '/pages/dd/dd',
- visible: true
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png'
- });
- }
- if (obj.userInfo.type == 1) {
- uni.setTabBarItem({
- index: 0,
- text: '首页',
- iconPath: 'static/tabBar/tab-home.png',
- selectedIconPath: 'static/tabBar/tab-home-current.png'
- });
- uni.setTabBarItem({
- index: 1,
- text: '咨询记录',
- iconPath: 'static/tabBar/tab-cate.png',
- selectedIconPath: 'static/tabBar/tab-cate-current.png',
- visible: true
- });
- uni.setTabBarItem({
- index: 2,
- text: '科普学习',
- iconPath: 'static/tabBar/tab-study.png',
- selectedIconPath: 'static/tabBar/tab-study-current.png',
- visible: true
- });
- uni.setTabBarItem({
- index: 3,
- text: '接单',
- iconPath: 'static/tabBar/jd.png',
- selectedIconPath: 'static/tabBar/jd-act.png',
- visible: false
- })
- uni.setTabBarItem({
- index: 4,
- text: '我的',
- iconPath: 'static/tabBar/tab-my.png',
- selectedIconPath: 'static/tabBar/tab-my-current.png'
- });
- }
- })
- .catch(function(e) {
- console.log(e);
- });
- },
- methods: {
- ToRegister(item) {
- if (item == 1) {
- uni.navigateTo({
- url: '/pages/doctor/doclist'
- });
- } else {
- uni.switchTab({
- url: '/pages/index/index'
- });
- }
- },
- add() {
- let log = this.$log.getLog();
- // uni.showModal({
- // title: '日志',
- // content: JSON.stringify(log),
- // showCancel: false,
- // });
- this.$log.showLog();
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- background: #ffffff;
- height: 100%;
- }
- .container {
- width: 100%;
- padding: 90rpx 60rpx;
- }
- .name {
- padding: 60rpx 0rpx;
- color: #323232;
- font-size: 50rpx;
- font-weight: bold;
- }
- .image {
- width: 100%;
- height: 250rpx;
- position: relative;
- margin-bottom: 65rpx;
- image {
- width: 100%;
- height: 100%;
- }
- .identity {
- position: absolute;
- top: 60rpx;
- left: 50rpx;
- color: #ffffff;
- font-size: 40rpx;
- }
- .info {
- position: absolute;
- left: 50rpx;
- top: 125rpx;
- color: #ffffff;
- font-size: 24rpx;
- opacity: 0.5;
- }
- }
- </style>
|