index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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="balance_content">
  21. <view class="balance_content_main">
  22. <view style="display: flex">
  23. <view class="price_content" style="margin-right: 45rpx"> <text class="title">当前余额(元)</text> <text>0.00</text></view>
  24. <view class="price_content"> <text class="title">已成功提现(元)</text> <text>0.00</text></view>
  25. </view>
  26. <view class="withdraw_btn" @click="_goWithdraw">提现</view>
  27. </view>
  28. <view class="balance_content_detail" @click="_goBalance">
  29. <view>查看余额明细</view>
  30. <view>></view>
  31. </view>
  32. </view>
  33. <view class="navigator_list">
  34. <navigator class="navigator_item" url="/pages/orders/index">
  35. <image class="navigator_image" src="../../static/icon/orders.png" mode=""></image>
  36. <view class="navigator_title">预约</view>
  37. </navigator>
  38. <navigator class="navigator_item" url="/pages/coupon/index">
  39. <image class="navigator_image" src="../../static/icon/coupon.png" mode=""></image>
  40. <view class="navigator_title">优惠券</view>
  41. </navigator>
  42. <navigator class="navigator_item" url="/pages/score/orders">
  43. <image class="navigator_image" src="../../static/icon/score_gift.png" mode=""></image>
  44. <view class="navigator_title">积分订单</view>
  45. </navigator>
  46. <navigator class="navigator_item" url="/pages/recruitment/index">
  47. <image class="navigator_image" src="../../static/icon/score_gift.png" mode=""></image>
  48. <view class="navigator_title">拉新活动</view>
  49. </navigator>
  50. </view>
  51. <view class="alter_info">本程序暂不提供在线交易以及支付功能,您所提交的预约,我们将验证您的购药资质并交由有售卖药品资质的商业公司与您联系确认并提供线下后续服务。</view>
  52. <image src="../../static/icon/red_packet.gif" class="red_packet" @click="_getRedPacket" />
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data() {
  58. return {
  59. userInfo: {
  60. username: "请登录",
  61. userpic: "../../static/icon/doctor.png",
  62. phone: "kailin",
  63. status: 0,
  64. city_id: 0,
  65. },
  66. };
  67. },
  68. onLoad(param) {
  69. // 存储分享标识
  70. if (param.share_uid) {
  71. uni.setStorageSync("share_uid", param.share_uid);
  72. console.log("share_uid", param.share_uid);
  73. }
  74. // #ifdef MP-WEIXIN
  75. //分享按钮
  76. uni.showShareMenu({
  77. withShareTicket: true,
  78. menus: ["shareAppMessage", "shareTimeline"],
  79. });
  80. // #endif
  81. },
  82. onShareAppMessage(obj) {
  83. //获取当前用户信息
  84. let userInfo = uni.getStorageSync("userInfo");
  85. let param = "";
  86. if (userInfo.uid) {
  87. param = "?share_uid=" + userInfo.uid;
  88. }
  89. // 获取分享信息
  90. let shareList = getApp().globalData.shareList;
  91. // 获取分享信息
  92. let shareObj = {
  93. title: "药优惠 得积分 兑豪礼",
  94. //path: '/pages/score/lottery',
  95. path: "/pages/user/index",
  96. imageUrl: "",
  97. };
  98. // 循环列表
  99. for (let i in shareList) {
  100. if (shareList[i].pages == "pages/user/index") {
  101. shareObj.path = shareList[i].path ? shareList[i].path : shareObj.path;
  102. shareObj.title = shareList[i].title ? shareList[i].title : shareObj.title;
  103. shareObj.imageUrl = shareList[i].image_url ? shareList[i].image_url : shareObj.imageUrl;
  104. }
  105. }
  106. if (param) {
  107. shareObj.path += param;
  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. _getRedPacket() {
  128. uni.navigateTo({
  129. url: "/pages/redPacket/index",
  130. });
  131. },
  132. _goWithdraw() {
  133. uni.navigateTo({
  134. url: "/pages/user/withdraw",
  135. });
  136. },
  137. _goBalance() {
  138. uni.navigateTo({
  139. url: "/pages/balance/index",
  140. });
  141. },
  142. },
  143. };
  144. </script>
  145. <style lang="less">
  146. .user_box {
  147. width: 680rpx;
  148. height: 180rpx;
  149. overflow: hidden;
  150. background: #ffffff;
  151. padding: 10rpx 35rpx;
  152. .box_left {
  153. float: left;
  154. display: block;
  155. width: 140rpx;
  156. height: 140rpx;
  157. .user_image {
  158. display: block;
  159. width: 120rpx;
  160. height: 120rpx;
  161. border-radius: 50%;
  162. margin: 10rpx auto;
  163. }
  164. }
  165. .box_center {
  166. float: left;
  167. width: 300rpx;
  168. height: 140rpx;
  169. margin-left: 35rpx;
  170. .user_name {
  171. font-size: 30rpx;
  172. line-height: 80rpx;
  173. }
  174. .user_info {
  175. color: #999999;
  176. font-size: 24rpx;
  177. line-height: 60rpx;
  178. }
  179. }
  180. .box_right {
  181. float: right;
  182. width: 140rpx;
  183. height: 140rpx;
  184. font-size: 20rpx;
  185. line-height: 140rpx;
  186. .setting_page {
  187. width: 140rpx;
  188. height: 140rpx;
  189. display: block;
  190. overflow: hidden;
  191. .setting_icon {
  192. width: 60rpx;
  193. height: 60rpx;
  194. display: block;
  195. margin: 40rpx auto;
  196. }
  197. }
  198. .company_text {
  199. color: #e03519;
  200. width: 140rpx;
  201. height: 140rpx;
  202. font-size: 20rpx;
  203. text-align: center;
  204. line-height: 140rpx;
  205. }
  206. }
  207. }
  208. .navigator_list {
  209. display: flex; // 弹性盒模型
  210. overflow: hidden;
  211. margin: 20rpx auto;
  212. background: #ffffff;
  213. padding: 35rpx 0rpx;
  214. .navigator_item {
  215. float: left;
  216. height: 160rpx;
  217. display: block;
  218. margin: 0rpx auto;
  219. text-align: center;
  220. .navigator_image {
  221. width: 80rpx;
  222. height: 80rpx;
  223. margin: 20rpx auto;
  224. border-radius: 5rpx;
  225. }
  226. .navigator_title {
  227. width: 120rpx;
  228. display: block;
  229. font-size: 30rpx;
  230. line-height: 40rpx;
  231. text-align: center;
  232. }
  233. }
  234. }
  235. .alter_info {
  236. display: block;
  237. color: #e03519;
  238. font-size: 20rpx;
  239. overflow: hidden;
  240. margin: 20rpx auto;
  241. background: #ffffff;
  242. line-height: 40rpx;
  243. padding: 35rpx 35rpx;
  244. }
  245. .balance_content {
  246. margin: 20rpx;
  247. padding: 35rpx;
  248. background-color: #fff;
  249. box-sizing: border-box;
  250. .balance_content_main {
  251. display: flex;
  252. justify-content: space-between;
  253. align-items: center;
  254. margin-bottom: 36rpx;
  255. .price_content {
  256. display: flex;
  257. flex-direction: column;
  258. > .title {
  259. font-size: 24rpx;
  260. margin-bottom: 15rpx;
  261. }
  262. }
  263. .withdraw_btn {
  264. color: #ffffff;
  265. background-color: #169bd5;
  266. border-radius: 60rpx;
  267. padding: 10rpx 20rpx;
  268. width: 90rpx;
  269. text-align: center;
  270. line-height: 40rpx;
  271. }
  272. }
  273. .balance_content_detail {
  274. display: flex;
  275. justify-content: space-between;
  276. align-items: center;
  277. border-top: 2rpx solid #f3f3f3;
  278. font-size: 24rpx;
  279. padding-top: 18rpx;
  280. }
  281. }
  282. .red_packet {
  283. position: absolute;
  284. right: 0;
  285. bottom: 15%;
  286. width: 160rpx;
  287. height: 160rpx;
  288. }
  289. </style>