index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. <view class="packet_content">
  53. <view class="close_btn" @click="closeRule"> X </view>
  54. <image src="../../static/icon/red_packet.gif" class="red_packet" @click="_getRedPacket" />
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. userInfo: {
  63. username: "请登录",
  64. userpic: "../../static/icon/doctor.png",
  65. phone: "kailin",
  66. status: 0,
  67. city_id: 0,
  68. },
  69. };
  70. },
  71. onLoad(param) {
  72. // 存储分享标识
  73. if (param.share_uid) {
  74. uni.setStorageSync("share_uid", param.share_uid);
  75. console.log("share_uid", param.share_uid);
  76. }
  77. // #ifdef MP-WEIXIN
  78. //分享按钮
  79. uni.showShareMenu({
  80. withShareTicket: true,
  81. menus: ["shareAppMessage", "shareTimeline"],
  82. });
  83. // #endif
  84. },
  85. onShareAppMessage(obj) {
  86. //获取当前用户信息
  87. let userInfo = uni.getStorageSync("userInfo");
  88. let param = "";
  89. if (userInfo.uid) {
  90. param = "?share_uid=" + userInfo.uid;
  91. }
  92. // 获取分享信息
  93. let shareList = getApp().globalData.shareList;
  94. // 获取分享信息
  95. let shareObj = {
  96. title: "药优惠 得积分 兑豪礼",
  97. //path: '/pages/score/lottery',
  98. path: "/pages/user/index",
  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. if (param) {
  110. shareObj.path += param;
  111. }
  112. // 返回分享信息
  113. return shareObj;
  114. },
  115. onShow() {
  116. // 登录提示
  117. if (!this.$checkAccess.alterLogin()) return;
  118. // 判断数据
  119. this.$http.request("api/custom/get_info").then((callback) => {
  120. if (callback.code == "success") {
  121. if (!callback.data.userpic) callback.data.userpic = "../../static/icon/doctor.png";
  122. // 赋值
  123. this.userInfo = callback.data;
  124. // 存储登录标识
  125. uni.setStorageSync("userInfo", callback.data);
  126. }
  127. });
  128. },
  129. methods: {
  130. _getRedPacket() {
  131. uni.navigateTo({
  132. url: "/pages/redPacket/index",
  133. });
  134. },
  135. _goWithdraw() {
  136. uni.navigateTo({
  137. url: "/pages/user/withdraw",
  138. });
  139. },
  140. _goBalance() {
  141. uni.navigateTo({
  142. url: "/pages/balance/index",
  143. });
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="less">
  149. .user_box {
  150. width: 680rpx;
  151. height: 180rpx;
  152. overflow: hidden;
  153. background: #ffffff;
  154. padding: 10rpx 35rpx;
  155. .box_left {
  156. float: left;
  157. display: block;
  158. width: 140rpx;
  159. height: 140rpx;
  160. .user_image {
  161. display: block;
  162. width: 120rpx;
  163. height: 120rpx;
  164. border-radius: 50%;
  165. margin: 10rpx auto;
  166. }
  167. }
  168. .box_center {
  169. float: left;
  170. width: 300rpx;
  171. height: 140rpx;
  172. margin-left: 35rpx;
  173. .user_name {
  174. font-size: 30rpx;
  175. line-height: 80rpx;
  176. }
  177. .user_info {
  178. color: #999999;
  179. font-size: 24rpx;
  180. line-height: 60rpx;
  181. }
  182. }
  183. .box_right {
  184. float: right;
  185. width: 140rpx;
  186. height: 140rpx;
  187. font-size: 20rpx;
  188. line-height: 140rpx;
  189. .setting_page {
  190. width: 140rpx;
  191. height: 140rpx;
  192. display: block;
  193. overflow: hidden;
  194. .setting_icon {
  195. width: 60rpx;
  196. height: 60rpx;
  197. display: block;
  198. margin: 40rpx auto;
  199. }
  200. }
  201. .company_text {
  202. color: #e03519;
  203. width: 140rpx;
  204. height: 140rpx;
  205. font-size: 20rpx;
  206. text-align: center;
  207. line-height: 140rpx;
  208. }
  209. }
  210. }
  211. .navigator_list {
  212. display: flex; // 弹性盒模型
  213. overflow: hidden;
  214. margin: 20rpx auto;
  215. background: #ffffff;
  216. padding: 35rpx 0rpx;
  217. .navigator_item {
  218. float: left;
  219. height: 160rpx;
  220. display: block;
  221. margin: 0rpx auto;
  222. text-align: center;
  223. .navigator_image {
  224. width: 80rpx;
  225. height: 80rpx;
  226. margin: 20rpx auto;
  227. border-radius: 5rpx;
  228. }
  229. .navigator_title {
  230. width: 120rpx;
  231. display: block;
  232. font-size: 30rpx;
  233. line-height: 40rpx;
  234. text-align: center;
  235. }
  236. }
  237. }
  238. .alter_info {
  239. display: block;
  240. color: #e03519;
  241. font-size: 20rpx;
  242. overflow: hidden;
  243. margin: 20rpx auto;
  244. background: #ffffff;
  245. line-height: 40rpx;
  246. padding: 35rpx 35rpx;
  247. }
  248. .balance_content {
  249. margin: 20rpx;
  250. padding: 35rpx;
  251. background-color: #fff;
  252. box-sizing: border-box;
  253. .balance_content_main {
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. margin-bottom: 36rpx;
  258. .price_content {
  259. display: flex;
  260. flex-direction: column;
  261. > .title {
  262. font-size: 24rpx;
  263. margin-bottom: 15rpx;
  264. }
  265. }
  266. .withdraw_btn {
  267. color: #ffffff;
  268. background-color: #169bd5;
  269. border-radius: 60rpx;
  270. padding: 10rpx 20rpx;
  271. width: 90rpx;
  272. text-align: center;
  273. line-height: 40rpx;
  274. }
  275. }
  276. .balance_content_detail {
  277. display: flex;
  278. justify-content: space-between;
  279. align-items: center;
  280. border-top: 2rpx solid #f3f3f3;
  281. font-size: 24rpx;
  282. padding-top: 18rpx;
  283. }
  284. }
  285. .packet_content {
  286. position: absolute;
  287. right: 0;
  288. bottom: 15%;
  289. width: 160rpx;
  290. height: 160rpx;
  291. .red_packet {
  292. width: 100%;
  293. height: 100%;
  294. }
  295. .close_btn {
  296. width: 40rpx;
  297. height: 40rpx;
  298. font-size: 24rpx;
  299. line-height: 40rpx;
  300. border-radius: 50%;
  301. border: 1rpx solid #ddd;
  302. display: flex;
  303. align-items: center;
  304. justify-content: center;
  305. position: absolute;
  306. top: 5rpx;
  307. left: 0;
  308. }
  309. }
  310. </style>