index.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. <navigator class="navigator_item" url="/pages/recruitment/index" >
  34. <image class="navigator_image" src="../../static/icon/score_gift.png" mode=""></image>
  35. <view class="navigator_title">拉新活动</view>
  36. </navigator>
  37. </view>
  38. <view class="alter_info">本程序暂不提供在线交易以及支付功能,您所提交的预约,我们将验证您的购药资质并交由有售卖药品资质的商业公司与您联系确认并提供线下后续服务。</view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. userInfo:{
  46. username:"请登录",
  47. userpic:"../../static/icon/doctor.png",
  48. phone:"kailin",
  49. status:0,
  50. city_id:0,
  51. },
  52. }
  53. },
  54. onLoad(param) {
  55. // 存储分享标识
  56. if (param.share_uid){
  57. uni.setStorageSync('share_uid',param.share_uid);
  58. console.log('share_uid',param.share_uid)
  59. }
  60. // #ifdef MP-WEIXIN
  61. //分享按钮
  62. uni.showShareMenu({
  63. withShareTicket: true,
  64. menus: ['shareAppMessage', 'shareTimeline']
  65. })
  66. // #endif
  67. },
  68. onShareAppMessage(obj) {
  69. //获取当前用户信息
  70. let userInfo = uni.getStorageSync("userInfo");
  71. let param = '';
  72. if (userInfo.uid){
  73. param = '?share_uid='+userInfo.uid;
  74. }
  75. // 获取分享信息
  76. let shareList = getApp().globalData.shareList;
  77. // 获取分享信息
  78. let shareObj = {
  79. title: '药优惠 得积分 兑豪礼',
  80. //path: '/pages/score/lottery',
  81. path: '/pages/user/index',
  82. imageUrl:'',
  83. };
  84. // 循环列表
  85. for ( let i in shareList ) {
  86. if( shareList[i].pages == 'pages/user/index' ) {
  87. shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path ;
  88. shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title ;
  89. shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;
  90. }
  91. }
  92. if (param){
  93. shareObj.path += param;
  94. }
  95. // 返回分享信息
  96. return shareObj;
  97. },
  98. onShow() {
  99. // 登录提示
  100. if( !this.$checkAccess.alterLogin() ) return ;
  101. // 判断数据
  102. this.$http.request('api/custom/get_info').then((callback)=>{
  103. if( callback.code == 'success' ){
  104. if( !callback.data.userpic ) callback.data.userpic = "../../static/icon/doctor.png";
  105. // 赋值
  106. this.userInfo = callback.data;
  107. // 存储登录标识
  108. uni.setStorageSync('userInfo',callback.data);
  109. }
  110. });
  111. },
  112. methods: {
  113. }
  114. }
  115. </script>
  116. <style lang="less">
  117. .user_box{
  118. width: 680rpx;
  119. height: 180rpx;
  120. overflow: hidden;
  121. background: #FFFFFF;
  122. padding: 10rpx 35rpx;
  123. .box_left{
  124. float: left;
  125. display: block;
  126. width: 140rpx;
  127. height: 140rpx;
  128. .user_image{
  129. display: block;
  130. width: 120rpx;
  131. height: 120rpx;
  132. border-radius: 50%;
  133. margin: 10rpx auto;
  134. }
  135. }
  136. .box_center{
  137. float: left;
  138. width: 300rpx;
  139. height: 140rpx;
  140. margin-left: 35rpx;
  141. .user_name{
  142. font-size: 30rpx;
  143. line-height: 80rpx;
  144. }
  145. .user_info{
  146. color: #999999;
  147. font-size: 24rpx;
  148. line-height: 60rpx;
  149. }
  150. }
  151. .box_right{
  152. float: right;
  153. width: 140rpx;
  154. height: 140rpx;
  155. font-size: 20rpx;
  156. line-height: 140rpx;
  157. .setting_page{
  158. width: 140rpx;
  159. height: 140rpx;
  160. display: block;
  161. overflow: hidden;
  162. .setting_icon{
  163. width: 60rpx;
  164. height: 60rpx;
  165. display: block;
  166. margin: 40rpx auto;
  167. }
  168. }
  169. .company_text{
  170. color: #E03519;
  171. width: 140rpx;
  172. height: 140rpx;
  173. font-size: 20rpx;
  174. text-align: center;
  175. line-height: 140rpx;
  176. }
  177. }
  178. }
  179. .navigator_list{
  180. display: flex; // 弹性盒模型
  181. overflow: hidden;
  182. margin: 20rpx auto;
  183. background: #FFFFFF;
  184. padding: 35rpx 0rpx;
  185. .navigator_item{
  186. float: left;
  187. height: 160rpx;
  188. display: block;
  189. margin: 0rpx auto;
  190. text-align: center;
  191. .navigator_image{
  192. width: 80rpx;
  193. height: 80rpx;
  194. margin: 20rpx auto;
  195. border-radius: 5rpx;
  196. }
  197. .navigator_title{
  198. width: 120rpx;
  199. display: block;
  200. font-size: 30rpx;
  201. line-height: 40rpx;
  202. text-align: center;
  203. }
  204. }
  205. }
  206. .alter_info{
  207. display: block;
  208. color: #E03519;
  209. font-size: 20rpx;
  210. overflow: hidden;
  211. margin: 20rpx auto;
  212. background: #FFFFFF;
  213. line-height: 40rpx;
  214. padding: 35rpx 35rpx;
  215. }
  216. </style>