index.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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_content">
  21. <view class="navigator_list">
  22. <navigator class="navigator_item" url="/pages/orders/index" >
  23. <view class="navigator_image_order">
  24. <image class="navigator_image" src="../../static/user_icon/user_order_icon.png" mode=""></image>
  25. </view>
  26. <view class="navigator_title">我的订单</view>
  27. </navigator>
  28. <navigator class="navigator_item" url="/pages/course/usercourse" >
  29. <view class="navigator_image_class">
  30. <image class="navigator_image" src="../../static/user_icon/user_class_icon.png" mode=""></image>
  31. </view>
  32. <view class="navigator_title">课程表</view>
  33. </navigator>
  34. <navigator class="navigator_item" url="/pages/score/orders" >
  35. <view class="navigator_image_score">
  36. <image class="navigator_image" src="../../static/user_icon/user_score_icon.png" mode=""></image>
  37. </view>
  38. <view class="navigator_title">积分订单</view>
  39. </navigator>
  40. <navigator class="navigator_item" url="/pages/addr/index" >
  41. <view class="navigator_image_attr">
  42. <image class="navigator_image" src="../../static/user_icon/user_attr_icon.png" mode=""></image>
  43. </view>
  44. <view class="navigator_title">收货地址</view>
  45. </navigator>
  46. <navigator class="navigator_item" url="/pages/coupon/index" >
  47. <view class="navigator_image_coupon">
  48. <image class="navigator_image" src="../../static/user_icon/user_coupon_icon.png" mode=""></image>
  49. </view>
  50. <view class="navigator_title">优惠卷</view>
  51. </navigator>
  52. <navigator class="navigator_item" url="/pages/score/clockin" >
  53. <view class="navigator_image_order">
  54. <image class="navigator_image" src="../../static/user_icon/user_clockin_icon.png" mode=""></image>
  55. </view>
  56. <view class="navigator_title">签到</view>
  57. </navigator>
  58. <!-- <navigator class="navigator_item" url="/pagesA/user/favorites" >
  59. <view class="navigator_image_favo">
  60. <view class="star_icon">
  61. <uni-icons type="star-filled" size="40" color= "#fff"></uni-icons>
  62. </view>
  63. </view>
  64. <view class="navigator_title">我的收藏</view>
  65. </navigator> -->
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. userInfo:{
  75. username:"请登录",
  76. userpic:"../../static/icon/doctor.png",
  77. phone:"kailin",
  78. status:0,
  79. city_id:0,
  80. },
  81. }
  82. },
  83. onLoad() {
  84. // #ifdef MP-WEIXIN
  85. //分享按钮
  86. uni.showShareMenu({
  87. withShareTicket: true,
  88. menus: ['shareAppMessage', 'shareTimeline']
  89. })
  90. // #endif
  91. },
  92. onShareAppMessage(obj) {
  93. // 获取分享信息
  94. let shareList = getApp().globalData.shareList;
  95. // 获取分享信息
  96. let shareObj = {
  97. title: '药优惠 得积分 兑豪礼',
  98. path: '/pages/score/lottery',
  99. imageUrl:'',
  100. };
  101. // 循环列表
  102. for ( let i in shareList ) {
  103. if( shareList[i].pages == 'pages/user/index' ) {
  104. shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path ;
  105. shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title ;
  106. shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl ;
  107. }
  108. }
  109. // 返回分享信息
  110. return shareObj;
  111. },
  112. onShow() {
  113. // 登录提示
  114. if( !this.$checkAccess.alterLogin() ) return ;
  115. // 判断数据
  116. this.$http.request('api/custom/get_info').then((callback)=>{
  117. if( callback.code == 'success' ){
  118. if( !callback.data.userpic ) callback.data.userpic = "../../static/icon/doctor.png";
  119. // 赋值
  120. this.userInfo = callback.data;
  121. // 存储登录标识
  122. uni.setStorageSync('userInfo',callback.data);
  123. }
  124. });
  125. },
  126. methods: {
  127. }
  128. }
  129. </script>
  130. <style lang="less">
  131. .user_box{
  132. width: 680rpx;
  133. height: 180rpx;
  134. overflow: hidden;
  135. background: #FFFFFF;
  136. padding: 10rpx 35rpx;
  137. .box_left{
  138. float: left;
  139. display: block;
  140. width: 140rpx;
  141. height: 140rpx;
  142. .user_image{
  143. display: block;
  144. width: 120rpx;
  145. height: 120rpx;
  146. border-radius: 50%;
  147. margin: 10rpx auto;
  148. }
  149. }
  150. .box_center{
  151. float: left;
  152. width: 300rpx;
  153. height: 140rpx;
  154. margin-left: 35rpx;
  155. .user_name{
  156. font-size: 30rpx;
  157. line-height: 80rpx;
  158. }
  159. .user_info{
  160. color: #999999;
  161. font-size: 24rpx;
  162. line-height: 60rpx;
  163. }
  164. }
  165. .box_right{
  166. float: right;
  167. width: 140rpx;
  168. height: 140rpx;
  169. font-size: 20rpx;
  170. line-height: 140rpx;
  171. .setting_page{
  172. width: 140rpx;
  173. height: 140rpx;
  174. display: block;
  175. overflow: hidden;
  176. .setting_icon{
  177. width: 60rpx;
  178. height: 60rpx;
  179. display: block;
  180. margin: 40rpx auto;
  181. }
  182. }
  183. .company_text{
  184. color: #E03519;
  185. width: 140rpx;
  186. height: 140rpx;
  187. font-size: 20rpx;
  188. text-align: center;
  189. line-height: 140rpx;
  190. }
  191. }
  192. }
  193. .navigator_content{
  194. width: 750rpx;
  195. height: 75vh;
  196. background-color: #FFFFFF;
  197. .navigator_list{
  198. width: 690rpx;
  199. display: flex;
  200. flex-wrap: wrap;
  201. padding: 35rpx 0rpx;
  202. margin: 0rpx auto;
  203. .navigator_item{
  204. height: 180rpx;
  205. margin: 25rpx;
  206. text-align: center;
  207. .navigator_image_box{
  208. background-color: #ffac1e;
  209. border-radius: 40rpx;
  210. .navigator_image{
  211. width: 80rpx;
  212. height: 80rpx;
  213. margin: 20rpx auto;
  214. border-radius: 5rpx;
  215. }
  216. }
  217. .navigator_image_order{
  218. background-color: #ffac1e;
  219. border-radius: 40rpx;
  220. .navigator_image{
  221. width: 80rpx;
  222. height: 80rpx;
  223. margin: 20rpx auto;
  224. border-radius: 5rpx;
  225. }
  226. }
  227. .navigator_image_class{
  228. background-color: #29c78a;
  229. border-radius: 40rpx;
  230. .navigator_image{
  231. width: 80rpx;
  232. height: 80rpx;
  233. margin: 20rpx auto;
  234. border-radius: 5rpx;
  235. }
  236. }
  237. .navigator_image_score{
  238. background-color: #3a85ff;
  239. border-radius: 40rpx;
  240. .navigator_image{
  241. width: 80rpx;
  242. height: 80rpx;
  243. margin: 20rpx auto;
  244. border-radius: 5rpx;
  245. }
  246. }
  247. .navigator_image_attr{
  248. background-color: #b88fe9;
  249. border-radius: 40rpx;
  250. .navigator_image{
  251. width: 80rpx;
  252. height: 80rpx;
  253. margin: 20rpx auto;
  254. border-radius: 5rpx;
  255. }
  256. }
  257. .navigator_image_coupon{
  258. background-color: #b88fe9;
  259. border-radius: 40rpx;
  260. .navigator_image{
  261. width: 80rpx;
  262. height: 80rpx;
  263. margin: 20rpx auto;
  264. border-radius: 5rpx;
  265. }
  266. }
  267. .navigator_image_favo{
  268. background-color: #29c78a;
  269. border-radius: 40rpx;
  270. width: 120rpx;
  271. height: 125rpx;
  272. display: flex;
  273. justify-content: center;
  274. align-items: center;
  275. .star_icon{
  276. // padding: 18rpx 0rpx;
  277. }
  278. }
  279. .navigator_title{
  280. width: 120rpx;
  281. margin-top: 20rpx;
  282. display: block;
  283. font-size: 30rpx;
  284. line-height: 40rpx;
  285. text-align: center;
  286. }
  287. }
  288. }
  289. }
  290. .alter_info{
  291. display: block;
  292. color: #E03519;
  293. font-size: 20rpx;
  294. overflow: hidden;
  295. margin: 20rpx auto;
  296. background: #FFFFFF;
  297. line-height: 40rpx;
  298. padding: 35rpx 35rpx;
  299. }
  300. </style>