index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <template>
  2. <view style="height: 100vh; overflow: hidden">
  3. <view class="page-header">
  4. <view class="page-header-title" :style="status_bar_style">我的</view>
  5. <view class="user_box">
  6. <view class="box_left">
  7. <navigator url="/pages/user/settings">
  8. <image class="user_image" :src="userInfo?.userpic"></image>
  9. </navigator>
  10. </view>
  11. <view class="box_center">
  12. <view class="user_name" v-if="is_login">{{ userInfo?.username }}</view>
  13. <navigator class="user_name" url="/pages/login/index" v-if="!is_login">请登录</navigator>
  14. <view class="user_info">{{ userInfo?.phone }}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="customized-page">
  19. <view class="icon-list">
  20. <icon-list mode="row8" :icons="icons_1" :gap="0" :small="true" />
  21. </view>
  22. <view class="icon-list">
  23. <icon-list mode="row8" :icons="icons_2" :gap="0" :small="true" />
  24. </view>
  25. <view class="icon-list">
  26. <icon-list mode="row8" :icons="icons_3" :gap="0" :small="true" />
  27. </view>
  28. <view class="user_list">
  29. <list v-bind="list_props" />
  30. </view>
  31. <view class="alter_info">本程序暂不提供在线交易以及支付功能,您所提交的预约,我们将验证您的购药资质并交由有售卖药品资质的商业公司与您联系确认并提供线下后续服务。</view>
  32. </view>
  33. <!-- <view class="balance_content">
  34. <view class="balance_content_main">
  35. <view style="display: flex">
  36. <view class="price_content" style="margin-right: 45rpx">
  37. <text class="title">当前余额(元)</text> <text>{{ Number(userInfo.amount || 0).toFixed(2) }}</text></view
  38. >
  39. <view class="price_content">
  40. <text class="title">已成功提现(元)</text> <text>{{ Number(userInfo.transfer_amount || 0).toFixed(2) }}</text></view
  41. >
  42. </view>
  43. <view class="withdraw_btn" @click="_goWithdraw">提现</view>
  44. </view>
  45. <view class="balance_content_detail" @click="_goBalance">
  46. <view>查看余额明细</view>
  47. <view>></view>
  48. </view>
  49. </view>
  50. <view class="navigator_list">
  51. <navigator class="navigator_item" url="/pages/orders/index">
  52. <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/orders.png" mode=""></image>
  53. <view class="navigator_title">预约</view>
  54. </navigator>
  55. <navigator class="navigator_item" url="/pages/coupon/index">
  56. <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/coupon.png" mode=""></image>
  57. <view class="navigator_title">优惠券</view>
  58. </navigator>
  59. <navigator class="navigator_item" url="/pages/score/orders">
  60. <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/score.png" mode=""></image>
  61. <view class="navigator_title">积分订单</view>
  62. </navigator>
  63. <navigator class="navigator_item" url="/pages/recruitment/index">
  64. <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/newuser.png" mode=""></image>
  65. <view class="navigator_title">拉新活动</view>
  66. </navigator>
  67. </view>
  68. <view class="navigator_list">
  69. <navigator class="navigator_item" url="/pages/article/index">
  70. <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/article.png" mode=""></image>
  71. <view class="navigator_title">资讯</view>
  72. </navigator>
  73. <navigator class="navigator_item" url="/pages/video/index" v-if="userInfo.is_video_vip == 1">
  74. <image class="navigator_image" src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/video.png" mode=""></image>
  75. <view class="navigator_title">学习</view>
  76. </navigator>
  77. </view> -->
  78. <view class="packet_content" v-if="show_packet">
  79. <view class="close_btn" @click="closePacket"> X </view>
  80. <image src="https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/red_packet.gif" class="red_packet" @click="_getredpacket" />
  81. </view>
  82. <cc-myTabbar :tabBarShow="4"></cc-myTabbar>
  83. </view>
  84. </template>
  85. <script>
  86. import IconList from '@/components/IconList';
  87. import List from '@/components/List';
  88. const line1_icons = [
  89. {
  90. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/order.png',
  91. text: '全部订单',
  92. urlMap: { internal_url: '/pages/orders/index?status=0' },
  93. },
  94. {
  95. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/order_1.png',
  96. text: '待付款',
  97. urlMap: { internal_url: '/pages/orders/index?status=1' },
  98. },
  99. {
  100. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/order_2.png',
  101. text: '已取消',
  102. urlMap: { internal_url: '/pages/orders/index?status=4' },
  103. },
  104. {
  105. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/order_3.png',
  106. text: '已完成',
  107. urlMap: { internal_url: '/pages/orders/index?status=8' },
  108. },
  109. ];
  110. const line2_icons = [
  111. {
  112. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/line_2_1.png',
  113. text: '余额',
  114. urlMap: { internal_url: '/pages/balance/index' },
  115. },
  116. {
  117. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/line_2_2.png',
  118. text: '积分订单',
  119. urlMap: { internal_url: '/pages/score/orders' },
  120. },
  121. {
  122. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/line_2_3.png',
  123. text: '我的优惠券',
  124. urlMap: { internal_url: '/pages/coupon/index' },
  125. },
  126. ];
  127. const line3_icons = [
  128. {
  129. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/line_3_1.png',
  130. text: '签到',
  131. urlMap: { internal_url: '/pages/score/clockin' },
  132. },
  133. {
  134. image: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/user/line_3_2.png',
  135. text: '积分商城',
  136. urlMap: { internal_url: '/pages/score/index' },
  137. },
  138. ];
  139. export default {
  140. components: { IconList, List },
  141. data() {
  142. return {
  143. userInfo: {
  144. username: '请登录',
  145. userpic: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png',
  146. phone: 'kailin',
  147. status: 0,
  148. city_id: 0,
  149. is_video_vip: 0,
  150. amount: 0.0,
  151. transfer_amount: 0.0,
  152. },
  153. is_login: 0,
  154. packetList: [],
  155. show_packet: false,
  156. icons_1: line1_icons,
  157. icons_2: line2_icons,
  158. icons_3: line3_icons,
  159. list_props: {
  160. iconShow: false,
  161. lists: [
  162. { text: '地址', url: '/pages/addr/index' },
  163. { text: '设置', url: '/pages/user/settings' },
  164. ],
  165. showTitle: false,
  166. title: '列表设置',
  167. },
  168. status_bar_style: {},
  169. };
  170. },
  171. onLoad(param) {
  172. // 存储分享标识
  173. if (param.share_uid) {
  174. uni.setStorageSync('share_uid', param.share_uid);
  175. console.log('share_uid', param.share_uid);
  176. }
  177. // #ifdef MP-WEIXIN
  178. uni.hideTabBar();
  179. // #ifdef MP-WEIXIN
  180. const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
  181. // #endif
  182. this.status_bar_style = {
  183. // #ifdef MP-WEIXIN
  184. height: menuButtonInfo.height + 'px',
  185. top: menuButtonInfo.top + 'px',
  186. 'line-height': menuButtonInfo.height + 'px',
  187. // #endif
  188. // #ifdef H5
  189. height: '44px',
  190. 'line-height': '44px',
  191. // #endif
  192. };
  193. //分享按钮
  194. uni.showShareMenu({
  195. withShareTicket: true,
  196. menus: ['shareAppMessage', 'shareTimeline'],
  197. });
  198. // #endif
  199. },
  200. onShareAppMessage(obj) {
  201. //获取当前用户信息
  202. let userInfo = uni.getStorageSync('userInfo');
  203. let param = '';
  204. if (userInfo.uid) {
  205. param = '?share_uid=' + userInfo.uid;
  206. }
  207. // 获取分享信息
  208. let shareList = getApp().globalData.shareList;
  209. // 获取分享信息
  210. let shareObj = {
  211. title: '999智控终端平台\n药优惠 得积分 兑豪礼',
  212. //path: '/pages/score/lottery',
  213. path: '/pages/user/index',
  214. imageUrl: '',
  215. };
  216. // 循环列表
  217. for (let i in shareList) {
  218. if (shareList[i].pages == 'pages/user/index') {
  219. shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
  220. shareObj.title = shareList[i].title ? `999智控终端平台\n${shareList[i].title}` : shareObj.title;
  221. shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
  222. }
  223. }
  224. if (param) {
  225. shareObj.path += param;
  226. }
  227. // 返回分享信息
  228. return shareObj;
  229. },
  230. onShow() {
  231. this.is_login = this.$checkAccess.checkLogin();
  232. // 未登录不请求
  233. if (!this.is_login) {
  234. this.userInfo = {
  235. username: '请登录',
  236. userpic: 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png',
  237. phone: 'kailin',
  238. status: 0,
  239. city_id: 0,
  240. is_video_vip: 0,
  241. amount: 0.0,
  242. transfer_amount: 0.0,
  243. };
  244. return;
  245. }
  246. // 判断数据
  247. this.$http.request('api/custom/get_info').then((callback) => {
  248. if (callback.code == 'success') {
  249. if (!callback.data.userpic) callback.data.userpic = 'https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/icon/doctor.png';
  250. // 赋值
  251. this.userInfo = callback.data;
  252. // 存储登录标识
  253. uni.setStorageSync('userInfo', callback.data);
  254. }
  255. });
  256. this._getPacketNum();
  257. },
  258. methods: {
  259. _getredpacket() {
  260. let url = '/pages/redpacket/list';
  261. if (this.packetList.length == 1) {
  262. url = `/pages/redpacket/index?packet_id=${this.packetList[0].custom_redpacket_id}`;
  263. }
  264. uni.navigateTo({
  265. url: url,
  266. });
  267. },
  268. _goWithdraw() {
  269. uni.navigateTo({
  270. url: '/pages/user/withdraw',
  271. });
  272. },
  273. _goBalance() {
  274. uni.navigateTo({
  275. url: '/pages/balance/index',
  276. });
  277. },
  278. //获取红包数量是否展示红包领取页面
  279. _getPacketNum() {
  280. this.$http.request('api/redpacket/get_list').then((callback) => {
  281. if (callback.code == 'success') {
  282. this.packetList = callback.data.data || [];
  283. if (callback.data.data.length > 0) {
  284. this.show_packet = true;
  285. }
  286. }
  287. });
  288. },
  289. closePacket() {
  290. this.show_packet = false;
  291. },
  292. },
  293. };
  294. </script>
  295. <style lang="less" scoped>
  296. .icon-list {
  297. padding: 0 32rpx;
  298. box-sizing: border-box;
  299. margin: 24rpx 0 0;
  300. }
  301. .user_list {
  302. margin-top: 24rpx;
  303. padding: 0 32rpx;
  304. }
  305. .page-header {
  306. width: 100%;
  307. height: 494rpx;
  308. background: url(https://kailin-saas.oss-cn-shenzhen.aliyuncs.com/images/index/user-mask.png) no-repeat center;
  309. background-size: contain;
  310. position: fixed;
  311. z-index: 100;
  312. .page-header-title {
  313. position: absolute;
  314. width: 100%;
  315. color: #ffffff;
  316. text-align: center;
  317. }
  318. }
  319. .shop-info-header-right {
  320. width: 184rpx;
  321. height: 56rpx;
  322. background: #ffffff;
  323. border-radius: 200rpx 200rpx 200rpx 200rpx;
  324. color: #999;
  325. font-size: 28rpx;
  326. text-align: center;
  327. line-height: 56rpx;
  328. position: absolute;
  329. right: 50rpx;
  330. top: 20rpx;
  331. }
  332. .customized-page {
  333. display: flex;
  334. flex-direction: column;
  335. padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
  336. position: absolute;
  337. top: 350rpx;
  338. z-index: 100;
  339. .customized-item {
  340. margin: 10rpx 0;
  341. padding: 0 16rpx;
  342. box-sizing: border-box;
  343. }
  344. .alter_info {
  345. display: block;
  346. color: var(--primary-color);
  347. font-size: 20rpx;
  348. overflow: hidden;
  349. line-height: 40rpx;
  350. padding: 32rpx 32rpx;
  351. color: #f89c33;
  352. }
  353. }
  354. .user_box {
  355. width: 680rpx;
  356. height: 180rpx;
  357. overflow: hidden;
  358. padding: 10rpx 35rpx;
  359. color: #ffffff;
  360. position: absolute;
  361. bottom: 100rpx;
  362. .box_left {
  363. float: left;
  364. display: block;
  365. width: 140rpx;
  366. height: 140rpx;
  367. .user_image {
  368. display: block;
  369. width: 120rpx;
  370. height: 120rpx;
  371. border-radius: 50%;
  372. margin: 10rpx auto;
  373. }
  374. }
  375. .box_center {
  376. float: left;
  377. width: 300rpx;
  378. height: 140rpx;
  379. margin-left: 35rpx;
  380. .user_name {
  381. font-size: 30rpx;
  382. line-height: 80rpx;
  383. }
  384. .user_info {
  385. font-size: 24rpx;
  386. line-height: 60rpx;
  387. }
  388. }
  389. }
  390. .navigator_list {
  391. display: flex; // 弹性盒模型
  392. overflow: hidden;
  393. margin: 20rpx auto;
  394. background: #ffffff;
  395. padding: 35rpx 0rpx;
  396. .navigator_item {
  397. float: left;
  398. height: 160rpx;
  399. display: block;
  400. margin: 0rpx auto;
  401. text-align: center;
  402. .navigator_image {
  403. width: 80rpx;
  404. height: 80rpx;
  405. margin: 20rpx auto;
  406. border-radius: 5rpx;
  407. }
  408. .navigator_title {
  409. width: 120rpx;
  410. display: block;
  411. font-size: 30rpx;
  412. line-height: 40rpx;
  413. text-align: center;
  414. }
  415. }
  416. }
  417. .navigator_list_community {
  418. display: block; // 弹性盒模型
  419. overflow: hidden;
  420. margin: 20rpx auto;
  421. background: #ffffff;
  422. padding: 35rpx 35rpx;
  423. .navigator_item {
  424. float: left;
  425. height: 160rpx;
  426. display: block;
  427. margin: 0rpx auto;
  428. text-align: center;
  429. .navigator_image {
  430. width: 80rpx;
  431. height: 80rpx;
  432. margin: 20rpx auto;
  433. border-radius: 5rpx;
  434. }
  435. .navigator_title {
  436. width: 120rpx;
  437. display: block;
  438. font-size: 30rpx;
  439. line-height: 40rpx;
  440. text-align: center;
  441. }
  442. }
  443. }
  444. .balance_content {
  445. margin: 20rpx;
  446. padding: 35rpx;
  447. background-color: #fff;
  448. box-sizing: border-box;
  449. .balance_content_main {
  450. display: flex;
  451. justify-content: space-between;
  452. align-items: center;
  453. margin-bottom: 36rpx;
  454. .price_content {
  455. display: flex;
  456. flex-direction: column;
  457. > .title {
  458. font-size: 24rpx;
  459. margin-bottom: 15rpx;
  460. }
  461. }
  462. .withdraw_btn {
  463. color: #ffffff;
  464. background-color: #169bd5;
  465. border-radius: 60rpx;
  466. padding: 10rpx 20rpx;
  467. width: 90rpx;
  468. text-align: center;
  469. line-height: 40rpx;
  470. }
  471. }
  472. .balance_content_detail {
  473. display: flex;
  474. justify-content: space-between;
  475. align-items: center;
  476. border-top: 2rpx solid #f3f3f3;
  477. font-size: 24rpx;
  478. padding-top: 18rpx;
  479. }
  480. }
  481. .packet_content {
  482. position: absolute;
  483. right: 0;
  484. bottom: 15%;
  485. width: 160rpx;
  486. height: 160rpx;
  487. z-index: 101;
  488. .red_packet {
  489. width: 100%;
  490. height: 100%;
  491. }
  492. .close_btn {
  493. width: 40rpx;
  494. height: 40rpx;
  495. font-size: 24rpx;
  496. line-height: 40rpx;
  497. border-radius: 50%;
  498. border: 1rpx solid #ddd;
  499. display: flex;
  500. align-items: center;
  501. justify-content: center;
  502. position: absolute;
  503. top: 5rpx;
  504. left: 0;
  505. }
  506. }
  507. </style>