index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. </script>
  129. <style lang="less">
  130. .user_box {
  131. width: 680rpx;
  132. height: 180rpx;
  133. overflow: hidden;
  134. background: #ffffff;
  135. padding: 10rpx 35rpx;
  136. .box_left {
  137. float: left;
  138. display: block;
  139. width: 140rpx;
  140. height: 140rpx;
  141. .user_image {
  142. display: block;
  143. width: 120rpx;
  144. height: 120rpx;
  145. border-radius: 50%;
  146. margin: 10rpx auto;
  147. }
  148. }
  149. .box_center {
  150. float: left;
  151. width: 300rpx;
  152. height: 140rpx;
  153. margin-left: 35rpx;
  154. .user_name {
  155. font-size: 30rpx;
  156. line-height: 80rpx;
  157. }
  158. .user_info {
  159. color: #999999;
  160. font-size: 24rpx;
  161. line-height: 60rpx;
  162. }
  163. }
  164. .box_right {
  165. float: right;
  166. width: 140rpx;
  167. height: 140rpx;
  168. font-size: 20rpx;
  169. line-height: 140rpx;
  170. .setting_page {
  171. width: 140rpx;
  172. height: 140rpx;
  173. display: block;
  174. overflow: hidden;
  175. .setting_icon {
  176. width: 60rpx;
  177. height: 60rpx;
  178. display: block;
  179. margin: 40rpx auto;
  180. }
  181. }
  182. .company_text {
  183. color: #e03519;
  184. width: 140rpx;
  185. height: 140rpx;
  186. font-size: 20rpx;
  187. text-align: center;
  188. line-height: 140rpx;
  189. }
  190. }
  191. }
  192. .navigator_content {
  193. width: 750rpx;
  194. height: 75vh;
  195. background-color: #ffffff;
  196. .navigator_list {
  197. width: 690rpx;
  198. display: flex;
  199. flex-wrap: wrap;
  200. padding: 35rpx 0rpx;
  201. margin: 0rpx auto;
  202. .navigator_item {
  203. height: 180rpx;
  204. margin: 25rpx;
  205. text-align: center;
  206. .navigator_image_box {
  207. background-color: #ffac1e;
  208. border-radius: 40rpx;
  209. .navigator_image {
  210. width: 80rpx;
  211. height: 80rpx;
  212. margin: 20rpx auto;
  213. border-radius: 5rpx;
  214. }
  215. }
  216. .navigator_image_order {
  217. background-color: #ffac1e;
  218. border-radius: 40rpx;
  219. .navigator_image {
  220. width: 80rpx;
  221. height: 80rpx;
  222. margin: 20rpx auto;
  223. border-radius: 5rpx;
  224. }
  225. }
  226. .navigator_image_class {
  227. background-color: #29c78a;
  228. border-radius: 40rpx;
  229. .navigator_image {
  230. width: 80rpx;
  231. height: 80rpx;
  232. margin: 20rpx auto;
  233. border-radius: 5rpx;
  234. }
  235. }
  236. .navigator_image_score {
  237. background-color: #3a85ff;
  238. border-radius: 40rpx;
  239. .navigator_image {
  240. width: 80rpx;
  241. height: 80rpx;
  242. margin: 20rpx auto;
  243. border-radius: 5rpx;
  244. }
  245. }
  246. .navigator_image_attr {
  247. background-color: #b88fe9;
  248. border-radius: 40rpx;
  249. .navigator_image {
  250. width: 80rpx;
  251. height: 80rpx;
  252. margin: 20rpx auto;
  253. border-radius: 5rpx;
  254. }
  255. }
  256. .navigator_image_coupon {
  257. background-color: #b88fe9;
  258. border-radius: 40rpx;
  259. .navigator_image {
  260. width: 80rpx;
  261. height: 80rpx;
  262. margin: 20rpx auto;
  263. border-radius: 5rpx;
  264. }
  265. }
  266. .navigator_image_favo {
  267. background-color: #29c78a;
  268. border-radius: 40rpx;
  269. width: 120rpx;
  270. height: 125rpx;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. .star_icon {
  275. // padding: 18rpx 0rpx;
  276. }
  277. }
  278. .navigator_title {
  279. width: 120rpx;
  280. margin-top: 20rpx;
  281. display: block;
  282. font-size: 30rpx;
  283. line-height: 40rpx;
  284. text-align: center;
  285. }
  286. }
  287. }
  288. }
  289. .alter_info {
  290. display: block;
  291. color: #e03519;
  292. font-size: 20rpx;
  293. overflow: hidden;
  294. margin: 20rpx auto;
  295. background: #ffffff;
  296. line-height: 40rpx;
  297. padding: 35rpx 35rpx;
  298. }
  299. </style>