index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view>
  3. <view class="user_box">
  4. <view class="box_left">
  5. <navigator url="/pages/user/settings" >
  6. <image class="user_image" :src="userInfo.userpic" ></image>
  7. </navigator>
  8. </view>
  9. <view class="box_center">
  10. <view class="user_name">{{userInfo.username}}</view>
  11. <view class="user_info">{{userInfo.phone}}</view>
  12. </view>
  13. <view class="box_right">
  14. <navigator url="/pages/user/info" class="company_text" v-if="!userInfo.city_id">请选择城市</navigator>
  15. <navigator url="/pages/user/settings" class="setting_page" v-if="userInfo.city_id" >
  16. <image class="setting_icon" src="../../static/icon/setting.png" ></image>
  17. </navigator>
  18. </view>
  19. </view>
  20. <view class="navigator_list">
  21. <navigator class="navigator_item" url="/pages/orders/index" >
  22. <image class="navigator_image" src="../../static/icon/orders.png" mode=""></image>
  23. <view class="navigator_title">预 约</view>
  24. </navigator>
  25. <navigator class="navigator_item" url="/pages/coupon/index" >
  26. <image class="navigator_image" src="../../static/icon/coupon.png" mode=""></image>
  27. <view class="navigator_title">优惠券</view>
  28. </navigator>
  29. <navigator class="navigator_item" url="/pages/score/orders" >
  30. <image class="navigator_image" src="../../static/icon/score_gift.png" mode=""></image>
  31. <view class="navigator_title">积分订单</view>
  32. </navigator>
  33. </view>
  34. <view class="alter_info">本程序暂不提供在线交易以及支付功能,您所提交的预约,我们将验证您的购药资质并交由有售卖药品资质的商业公司与您联系确认并提供线下后续服务。</view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. userInfo:{
  42. username:"请登录",
  43. userpic:"../../static/icon/doctor.png",
  44. phone:"kailin",
  45. status:0,
  46. city_id:0,
  47. },
  48. }
  49. },
  50. onLoad() {
  51. // #ifdef MP-WEIXIN
  52. //分享按钮
  53. uni.showShareMenu({
  54. withShareTicket: true,
  55. menus: ['shareAppMessage', 'shareTimeline']
  56. })
  57. // #endif
  58. },
  59. onShow() {
  60. // 登录提示
  61. if( !this.$checkAccess.alterLogin() ) return ;
  62. // 判断数据
  63. this.$http.request('api/custom/get_info').then((callback)=>{
  64. if( callback.code == 'success' ){
  65. if( !callback.data.userpic ) callback.data.userpic = "../../static/icon/doctor.png";
  66. // 赋值
  67. this.userInfo = callback.data;
  68. // 存储登录标识
  69. uni.setStorageSync('userInfo',callback.data);
  70. }
  71. });
  72. },
  73. methods: {
  74. }
  75. }
  76. </script>
  77. <style lang="less">
  78. .user_box{
  79. width: 680rpx;
  80. height: 180rpx;
  81. overflow: hidden;
  82. background: #FFFFFF;
  83. padding: 10rpx 35rpx;
  84. .box_left{
  85. float: left;
  86. display: block;
  87. width: 140rpx;
  88. height: 140rpx;
  89. .user_image{
  90. display: block;
  91. width: 120rpx;
  92. height: 120rpx;
  93. border-radius: 50%;
  94. margin: 10rpx auto;
  95. }
  96. }
  97. .box_center{
  98. float: left;
  99. width: 300rpx;
  100. height: 140rpx;
  101. margin-left: 35rpx;
  102. .user_name{
  103. font-size: 30rpx;
  104. line-height: 80rpx;
  105. }
  106. .user_info{
  107. color: #999999;
  108. font-size: 24rpx;
  109. line-height: 60rpx;
  110. }
  111. }
  112. .box_right{
  113. float: right;
  114. width: 140rpx;
  115. height: 140rpx;
  116. font-size: 20rpx;
  117. line-height: 140rpx;
  118. .setting_page{
  119. width: 140rpx;
  120. height: 140rpx;
  121. display: block;
  122. overflow: hidden;
  123. .setting_icon{
  124. width: 60rpx;
  125. height: 60rpx;
  126. display: block;
  127. margin: 40rpx auto;
  128. }
  129. }
  130. .company_text{
  131. color: #E03519;
  132. width: 140rpx;
  133. height: 140rpx;
  134. font-size: 20rpx;
  135. text-align: center;
  136. line-height: 140rpx;
  137. }
  138. }
  139. }
  140. .navigator_list{
  141. display: flex; // 弹性盒模型
  142. overflow: hidden;
  143. margin: 20rpx auto;
  144. background: #FFFFFF;
  145. padding: 35rpx 0rpx;
  146. .navigator_item{
  147. float: left;
  148. height: 160rpx;
  149. display: block;
  150. margin: 0rpx auto;
  151. text-align: center;
  152. .navigator_image{
  153. width: 80rpx;
  154. height: 80rpx;
  155. margin: 20rpx auto;
  156. border-radius: 5rpx;
  157. }
  158. .navigator_title{
  159. width: 120rpx;
  160. display: block;
  161. font-size: 30rpx;
  162. line-height: 40rpx;
  163. text-align: center;
  164. }
  165. }
  166. }
  167. .alter_info{
  168. display: block;
  169. color: #E03519;
  170. font-size: 20rpx;
  171. overflow: hidden;
  172. margin: 20rpx auto;
  173. background: #FFFFFF;
  174. line-height: 40rpx;
  175. padding: 35rpx 35rpx;
  176. }
  177. </style>