index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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 class="status_bar" :style="{top:StatusBarHeight+ 'px'}">我的</view>
  36. <view class="user_box">
  37. <view :style="{height: NavBarHerder +'px'}"></view>
  38. <view class="user_content">
  39. <view class="box_left">
  40. <navigator url="/pages/user/settings">
  41. <image class="user_image" :src="userInfo.userpic" ></image>
  42. </navigator>
  43. </view>
  44. <view class="box_center">
  45. <view class="user_name">{{userInfo.username}}</view>
  46. <view class="user_info">{{userInfo.phone}}</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="navigator_content">
  51. <view class="navigator_list">
  52. <navigator class="navigator_item" url="/pagesA/orders/userorder" >
  53. <view class="navigator_image_order">
  54. <image class="navigator_image" src="../../static/user_icon/user_order_icon.png" mode=""></image>
  55. </view>
  56. <view class="navigator_title">我的订单</view>
  57. </navigator>
  58. <navigator class="navigator_item" url="/pagesA/course/usercourse" >
  59. <view class="navigator_image_class">
  60. <image class="navigator_image" src="../../static/user_icon/user_class_icon.png" mode=""></image>
  61. </view>
  62. <view class="navigator_title">课程表</view>
  63. </navigator>
  64. <navigator class="navigator_item" url="/pages/score/orders" >
  65. <view class="navigator_image_score">
  66. <image class="navigator_image" src="../../static/user_icon/user_score_icon.png" mode=""></image>
  67. </view>
  68. <view class="navigator_title">积分订单</view>
  69. </navigator>
  70. <navigator class="navigator_item" url="/pages/addr/index" >
  71. <view class="navigator_image_attr">
  72. <image class="navigator_image" src="../../static/user_icon/user_attr_icon.png" mode=""></image>
  73. </view>
  74. <view class="navigator_title">收货地址</view>
  75. </navigator>
  76. <navigator class="navigator_item" url="/pagesA/user/usercoupon" >
  77. <view class="navigator_image_coupon">
  78. <image class="navigator_image" src="../../static/user_icon/user_coupon_icon.png" mode=""></image>
  79. </view>
  80. <view class="navigator_title">优惠卷</view>
  81. </navigator>
  82. <navigator class="navigator_item" url="/pages/score/clockin" >
  83. <view class="navigator_image_order">
  84. <image class="navigator_image" src="../../static/user_icon/user_clockin_icon.png" mode=""></image>
  85. </view>
  86. <view class="navigator_title">签到</view>
  87. </navigator>
  88. <!-- <navigator class="navigator_item" url="/pagesA/user/favorites" >
  89. <view class="navigator_image_favo">
  90. <view class="star_icon">
  91. <uni-icons type="star-filled" size="40" color= "#fff"></uni-icons>
  92. </view>
  93. </view>
  94. <view class="navigator_title">我的收藏</view>
  95. </navigator> -->
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. export default {
  102. data() {
  103. return {
  104. userInfo:{
  105. username:"请登录",
  106. userpic:"../../static/icon/doctor.png",
  107. phone:"kailin",
  108. status:0,
  109. city_id:0,
  110. },
  111. StatusBarHeight:0,
  112. TitleBarHeight:0,
  113. NavBarHerder:0,
  114. }
  115. },
  116. onLoad() {
  117. },
  118. onShow() {
  119. this.getStatusBarHeight();
  120. this.getTitleBarHeight();
  121. this.getNavBarHerder();
  122. // 登录提示
  123. if( !this.$checkAccess.alterLogin() ) return ;
  124. // 判断数据
  125. this.$http.request('api/custom/get_info').then((callback)=>{
  126. if( callback.code == 'success' ){
  127. if( !callback.data.userpic ) callback.data.userpic = "../../static/icon/doctor.png";
  128. // 赋值
  129. this.userInfo = callback.data;
  130. // 存储登录标识
  131. uni.setStorageSync('userInfo',callback.data);
  132. }
  133. });
  134. },
  135. methods: {
  136. getStatusBarHeight(){
  137. let SYSTEM_INFO = uni.getSystemInfoSync();
  138. this.StatusBarHeight = SYSTEM_INFO.statusBarHeight || 10;
  139. },
  140. getTitleBarHeight(){
  141. if(uni.getMenuButtonBoundingClientRect){
  142. let {top,height} = uni.getMenuButtonBoundingClientRect();
  143. this.TitleBarHeight = height + (top - this.StatusBarHeight)*2;
  144. }else{
  145. this.TitleBarHeight = 40
  146. }
  147. },
  148. getNavBarHerder(){
  149. this.NavBarHerder = this.StatusBarHeight + this.TitleBarHeight
  150. },
  151. }
  152. }
  153. </script>
  154. <style lang="less">
  155. // .user_box{
  156. // width: 680rpx;
  157. // height: 180rpx;
  158. // overflow: hidden;
  159. // background: #FFFFFF;
  160. // padding: 10rpx 35rpx;
  161. // .box_left{
  162. // float: left;
  163. // display: block;
  164. // width: 140rpx;
  165. // height: 140rpx;
  166. // .user_image{
  167. // display: block;
  168. // width: 120rpx;
  169. // height: 120rpx;
  170. // border-radius: 50%;
  171. // margin: 10rpx auto;
  172. // }
  173. // }
  174. // .box_center{
  175. // float: left;
  176. // width: 300rpx;
  177. // height: 140rpx;
  178. // margin-left: 35rpx;
  179. // .user_name{
  180. // font-size: 30rpx;
  181. // line-height: 80rpx;
  182. // }
  183. // .user_info{
  184. // color: #999999;
  185. // font-size: 24rpx;
  186. // line-height: 60rpx;
  187. // }
  188. // }
  189. // .box_right{
  190. // float: right;
  191. // width: 140rpx;
  192. // height: 140rpx;
  193. // font-size: 20rpx;
  194. // line-height: 140rpx;
  195. // .setting_page{
  196. // width: 140rpx;
  197. // height: 140rpx;
  198. // display: block;
  199. // overflow: hidden;
  200. // .setting_icon{
  201. // width: 60rpx;
  202. // height: 60rpx;
  203. // display: block;
  204. // margin: 40rpx auto;
  205. // }
  206. // }
  207. // .company_text{
  208. // color: #E03519;
  209. // width: 140rpx;
  210. // height: 140rpx;
  211. // font-size: 20rpx;
  212. // text-align: center;
  213. // line-height: 140rpx;
  214. // }
  215. // }
  216. // }
  217. // .navigator_list{
  218. // display: flex; // 弹性盒模型
  219. // overflow: hidden;
  220. // margin: 20rpx auto;
  221. // background: #FFFFFF;
  222. // padding: 35rpx 0rpx;
  223. // .navigator_item{
  224. // float: left;
  225. // height: 160rpx;
  226. // display: block;
  227. // margin: 0rpx auto;
  228. // text-align: center;
  229. // .navigator_image{
  230. // width: 80rpx;
  231. // height: 80rpx;
  232. // margin: 20rpx auto;
  233. // border-radius: 5rpx;
  234. // }
  235. // .navigator_title{
  236. // width: 120rpx;
  237. // display: block;
  238. // font-size: 30rpx;
  239. // line-height: 40rpx;
  240. // text-align: center;
  241. // }
  242. // }
  243. // }
  244. // .alter_info{
  245. // display: block;
  246. // color: #E03519;
  247. // font-size: 20rpx;
  248. // overflow: hidden;
  249. // margin: 20rpx auto;
  250. // background: #FFFFFF;
  251. // line-height: 40rpx;
  252. // padding: 35rpx 35rpx;
  253. // }
  254. .status_bar{
  255. position: fixed;
  256. width: 38px;
  257. height: 38px;
  258. left: 340rpx;
  259. margin-left: 0;
  260. top: 0;
  261. display: flex;
  262. align-items: center;
  263. justify-content: center;
  264. font-size: 30rpx;
  265. }
  266. .user_box{
  267. width: 750rpx;
  268. height: 25vh;
  269. background-image: linear-gradient(to bottom, #ffe4e1, #f6efee);
  270. padding-bottom: 30rpx;
  271. .user_content{
  272. display: flex;
  273. .box_left{
  274. width: 160rpx;
  275. height: 160rpx;
  276. margin-top: 40rpx;
  277. margin-left: 30rpx;
  278. .user_image{
  279. width: 160rpx;
  280. height: 160rpx;
  281. border-radius: 50%;
  282. }
  283. }
  284. .box_center{
  285. width: 300rpx;
  286. height: 160rpx;
  287. margin-top: 40rpx;
  288. margin-left: 20rpx;
  289. line-height: 80rpx;
  290. }
  291. }
  292. }
  293. .navigator_content{
  294. width: 750rpx;
  295. height: 75vh;
  296. background-color: #FFFFFF;
  297. .navigator_list{
  298. width: 690rpx;
  299. display: flex;
  300. flex-wrap: wrap;
  301. padding: 35rpx 0rpx;
  302. margin: 0rpx auto;
  303. .navigator_item{
  304. height: 180rpx;
  305. margin: 25rpx;
  306. text-align: center;
  307. .navigator_image_box{
  308. background-color: #ffac1e;
  309. border-radius: 40rpx;
  310. .navigator_image{
  311. width: 80rpx;
  312. height: 80rpx;
  313. margin: 20rpx auto;
  314. border-radius: 5rpx;
  315. }
  316. }
  317. .navigator_image_order{
  318. background-color: #ffac1e;
  319. border-radius: 40rpx;
  320. .navigator_image{
  321. width: 80rpx;
  322. height: 80rpx;
  323. margin: 20rpx auto;
  324. border-radius: 5rpx;
  325. }
  326. }
  327. .navigator_image_class{
  328. background-color: #29c78a;
  329. border-radius: 40rpx;
  330. .navigator_image{
  331. width: 80rpx;
  332. height: 80rpx;
  333. margin: 20rpx auto;
  334. border-radius: 5rpx;
  335. }
  336. }
  337. .navigator_image_score{
  338. background-color: #3a85ff;
  339. border-radius: 40rpx;
  340. .navigator_image{
  341. width: 80rpx;
  342. height: 80rpx;
  343. margin: 20rpx auto;
  344. border-radius: 5rpx;
  345. }
  346. }
  347. .navigator_image_attr{
  348. background-color: #b88fe9;
  349. border-radius: 40rpx;
  350. .navigator_image{
  351. width: 80rpx;
  352. height: 80rpx;
  353. margin: 20rpx auto;
  354. border-radius: 5rpx;
  355. }
  356. }
  357. .navigator_image_coupon{
  358. background-color: #b88fe9;
  359. border-radius: 40rpx;
  360. .navigator_image{
  361. width: 80rpx;
  362. height: 80rpx;
  363. margin: 20rpx auto;
  364. border-radius: 5rpx;
  365. }
  366. }
  367. .navigator_image_favo{
  368. background-color: #29c78a;
  369. border-radius: 40rpx;
  370. width: 120rpx;
  371. height: 125rpx;
  372. display: flex;
  373. justify-content: center;
  374. align-items: center;
  375. .star_icon{
  376. // padding: 18rpx 0rpx;
  377. }
  378. }
  379. .navigator_title{
  380. width: 120rpx;
  381. margin-top: 20rpx;
  382. display: block;
  383. font-size: 30rpx;
  384. line-height: 40rpx;
  385. text-align: center;
  386. }
  387. }
  388. }
  389. }
  390. </style>