index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. onShareAppMessage(obj) {
  60. return {
  61. title: '十二月 药优惠 得积分 兑豪礼',
  62. path: '/pages/index/index'
  63. }
  64. },
  65. onShow() {
  66. // 登录提示
  67. if( !this.$checkAccess.alterLogin() ) return ;
  68. // 判断数据
  69. this.$http.request('api/custom/get_info').then((callback)=>{
  70. if( callback.code == 'success' ){
  71. if( !callback.data.userpic ) callback.data.userpic = "../../static/icon/doctor.png";
  72. // 赋值
  73. this.userInfo = callback.data;
  74. // 存储登录标识
  75. uni.setStorageSync('userInfo',callback.data);
  76. }
  77. });
  78. },
  79. methods: {
  80. }
  81. }
  82. </script>
  83. <style lang="less">
  84. .user_box{
  85. width: 680rpx;
  86. height: 180rpx;
  87. overflow: hidden;
  88. background: #FFFFFF;
  89. padding: 10rpx 35rpx;
  90. .box_left{
  91. float: left;
  92. display: block;
  93. width: 140rpx;
  94. height: 140rpx;
  95. .user_image{
  96. display: block;
  97. width: 120rpx;
  98. height: 120rpx;
  99. border-radius: 50%;
  100. margin: 10rpx auto;
  101. }
  102. }
  103. .box_center{
  104. float: left;
  105. width: 300rpx;
  106. height: 140rpx;
  107. margin-left: 35rpx;
  108. .user_name{
  109. font-size: 30rpx;
  110. line-height: 80rpx;
  111. }
  112. .user_info{
  113. color: #999999;
  114. font-size: 24rpx;
  115. line-height: 60rpx;
  116. }
  117. }
  118. .box_right{
  119. float: right;
  120. width: 140rpx;
  121. height: 140rpx;
  122. font-size: 20rpx;
  123. line-height: 140rpx;
  124. .setting_page{
  125. width: 140rpx;
  126. height: 140rpx;
  127. display: block;
  128. overflow: hidden;
  129. .setting_icon{
  130. width: 60rpx;
  131. height: 60rpx;
  132. display: block;
  133. margin: 40rpx auto;
  134. }
  135. }
  136. .company_text{
  137. color: #E03519;
  138. width: 140rpx;
  139. height: 140rpx;
  140. font-size: 20rpx;
  141. text-align: center;
  142. line-height: 140rpx;
  143. }
  144. }
  145. }
  146. .navigator_list{
  147. display: flex; // 弹性盒模型
  148. overflow: hidden;
  149. margin: 20rpx auto;
  150. background: #FFFFFF;
  151. padding: 35rpx 0rpx;
  152. .navigator_item{
  153. float: left;
  154. height: 160rpx;
  155. display: block;
  156. margin: 0rpx auto;
  157. text-align: center;
  158. .navigator_image{
  159. width: 80rpx;
  160. height: 80rpx;
  161. margin: 20rpx auto;
  162. border-radius: 5rpx;
  163. }
  164. .navigator_title{
  165. width: 120rpx;
  166. display: block;
  167. font-size: 30rpx;
  168. line-height: 40rpx;
  169. text-align: center;
  170. }
  171. }
  172. }
  173. .alter_info{
  174. display: block;
  175. color: #E03519;
  176. font-size: 20rpx;
  177. overflow: hidden;
  178. margin: 20rpx auto;
  179. background: #FFFFFF;
  180. line-height: 40rpx;
  181. padding: 35rpx 35rpx;
  182. }
  183. </style>