index.vue 4.9 KB

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