mine.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <template>
  2. <view class="main">
  3. <view class="pr">
  4. <view class="header-content">
  5. <image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/mybanner.png" style="width:100%;height:260rpx;"></image>
  6. </view>
  7. <view class="pr" style="z-index:2">
  8. <view class="plr15">
  9. <view class="bdr4 pb20">
  10. <view class="m-dpflex m-justify-start m-align-center" style="height: 165rpx;">
  11. <!-- <image binderror="_binderror" mode="scaleToFill" :src="info.avatar||" style="width: 120rpx;height: 120rpx;border-radius: 50%;"></image> -->
  12. <u-avatar :src="info.avatar" mode="circle" size="120"></u-avatar>
  13. <text class="line1 f20 fb plr15 text-white" style="width: 220rpx;">{{info.nickname||'用户02958472'}}</text>
  14. <navigator hoverClass="none" :url="'editinfo?name='+info.nickname+'&phone='+info.phone">
  15. <image class="header-img" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/myedit.png"></image>
  16. </navigator>
  17. <view class="pr tr m-flex" style="display: flex; justify-content: flex-end; ">
  18. <!-- <view class="tip msg" v-if="true"></view> -->
  19. <navigator hoverClass="none" url="message" style="width: 50rpx;">
  20. <image style="width: 50rpx;height: 50rpx;" class="header-img" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/myinfo.png"></image>
  21. <view class="cu-tag badge text-xs" v-if="mseeage!=''">{{mseeage}}</view>
  22. </navigator>
  23. </view>
  24. </view>
  25. <view class="pr m-xcenter plr20 header-box" style="padding: 40rpx 40rpx;background-color: #fff;border-radius: 16rpx;">
  26. <navigator class="m-flex tl f14 m-ycenter dpb" hoverClass="none" url="../personal/personal_information">
  27. <view class="m-gray-big f20 fb pr10">{{(info.balance/100)||'0'}}</view>
  28. <view class="m-gray-letter mt5 f12">余额(元)</view>
  29. </navigator>
  30. <view @click="gocoupon" class="m-flex tl f14 m-ycenter">
  31. <view class="m-gray-big f20 fb">{{info.coupon_num||'0'}}</view>
  32. <view class="m-gray-letter mt5 f12">优惠券(张)</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="fb f18 plr20">我的订单</view>
  39. <view class="margin-lr-sm m-dpflex m-justify-start m-align-center overflow bg-white margin-top-sm" style="padding-top: 40rpx;padding-bottom: 40rpx;border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  40. <navigator class="width25 m-ycenter overflow pr" v-for="(item,index) in icons" :key="index" hoverClass="none"
  41. @click="gotoinfoorder(item.name)">
  42. <image style="width: 76rpx;height: 76rpx;" :src="item.image" mode=""></image>
  43. <!-- <view class="tip"></view> -->
  44. <view class="f14 m-gray-small mt10 line1">{{item.name}}</view>
  45. </navigator>
  46. <!-- <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="../common_tools/my_consulting/my_appointment">
  47. <image style="width: 76rpx;height: 76rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/myyuyue.png"
  48. mode=""></image>
  49. <view class="tip"></view>
  50. <view class="f14 m-gray-small mt10 line1">我的预约</view>
  51. </navigator>
  52. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="../common_tools/my_consulting/my_opinion">
  53. <image style="width: 76rpx;height: 76rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/myyijian.png"
  54. mode=""></image>
  55. <view class="tip"></view>
  56. <view class="f14 m-gray-small mt10 line1">我的意见单</view>
  57. </navigator>
  58. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="../service_box/box_details">
  59. <image style="width: 76rpx;height: 76rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/myservice.png"
  60. mode=""></image>
  61. <view class="tip"></view>
  62. <view class="f14 m-gray-small mt10 line1">服务包订单</view>
  63. </navigator> -->
  64. </view>
  65. <navigator class="pr m-xcenter plr20 pt20" hoverClass="none" url="../archives/my_archives">
  66. <view class="fb f18 pr m-flex tl">健康档案</view>
  67. <view class="pr m-gray-small">档案列表</view>
  68. <label class="m-gray-letter iconfont icon-arrow-right f18 dpb"></label>
  69. </navigator>
  70. <view class="mt20 pr pb40" style="margin-left: 20rpx;margin-right: 20rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);height:380rpx;">
  71. <navigator class="m-ycenter" hoverClass="none" style="padding-top: 174rpx;" url="../archives/add_archives" v-if="!istrue">
  72. <view class="bdr30 m-theme br-theme tc plr20 pt8 pb8 f14 width40">新增健康档案</view>
  73. <!-- <view class="pt20 f12 m-gray-letter">点击添加新的健康档案</view> -->
  74. </navigator>
  75. <swiper duration="500" @change="swiperChange" v-if="istrue" :current="itemcurrent" interval="5000" style="height:380rpx;"
  76. class="swiper-box">
  77. <swiper-item class="" style="box-sizing: border-box;" v-for="(ite,index) in patientList" :key="index">
  78. <view class="bg-white" style="border-radius: 16rpx;height: 100%;">
  79. <view @click="gotoinfo(ite)" style="height: 100%;">
  80. <view class="fb f18 pt20 margin-left">{{ite.name}}</view>
  81. <view class="f14 m-gray-letter pt10 margin-left">年龄:<text class="text-black">{{ite.age||'0岁'}}</text></view>
  82. <view class="plr10 m-dpflex m-justify-start m-align-center overflow pb30 pt30" style="margin-top:60rpx;border-top: 2rpx solid rgb(248,248,248);">
  83. <view class="width33 m-ycenter overflow pr">
  84. <view class="fb f18">{{ite.order_num}}</view>
  85. <view class="f12 m-gray-small mt6 line1">病例信息</view>
  86. </view>
  87. <view class="width33 m-ycenter overflow pr">
  88. <view class="fb f18">{{ite.pack_docter_num}}</view>
  89. <view class="f12 m-gray-small mt6 line1">就诊记录</view>
  90. </view>
  91. <view class="width33 m-ycenter overflow pr">
  92. <view class="fb f18">{{ite.perfectd_degree}}</view>
  93. <view class="f12 m-gray-small mt6 line1">个人资料</view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </swiper-item>
  99. </swiper>
  100. <view class="dots">
  101. <view :class="index==itemcurrent?'dot active':'dot'" v-for="(item,index) in patientList.length" :key="index"></view>
  102. </view>
  103. </view>
  104. <view class="fb f18 plr20 pt40">常用工具</view>
  105. <view class="bg-white margin-lr-sm margin-top-sm" style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  106. <view class="plr10 m-dpflex m-justify-start m-align-center overflow pt30 pb30">
  107. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="/pages/common_tools/home_doctor">
  108. <image style="width: 42rpx;height: 42rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/mydoctor.png"></image>
  109. <view class="f14 m-gray-small mt10 line1">家庭医生</view>
  110. </navigator>
  111. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="/pages/common_tools/me_follow">
  112. <image style="width: 42rpx;height: 42rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/myguanzhu.png"></image>
  113. <view class="f14 m-gray-small mt10 line1">我的关注</view>
  114. </navigator>
  115. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="/pages/common_tools/collection/collection">
  116. <image style="width: 42rpx;height: 42rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/wenzhang.png"></image>
  117. <view class="f14 m-gray-small mt10 line1">收藏文章</view>
  118. </navigator>
  119. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="/pages/common_tools/me_order/me_order">
  120. <image style="width: 42rpx;height: 42rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/baodan.png"></image>
  121. <!-- <view class="tip"></view> -->
  122. <view class="f14 m-gray-small mt10 line1">我的保单</view>
  123. </navigator>
  124. </view>
  125. <view class="plr10 m-dpflex m-justify-start m-align-center overflow pb30">
  126. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="/pages/common_tools/me_evaluate">
  127. <image style="width: 42rpx;height: 42rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/pinjia.png"></image>
  128. <view class="f14 m-gray-small mt10 line1">我的评价</view>
  129. </navigator>
  130. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="/pages/personal/coupon/couponList">
  131. <image style="width: 42rpx;height: 42rpx;" src="../../static/img/collarvolume.png"></image>
  132. <view class="f14 m-gray-small mt10 line1">领卷中心</view>
  133. </navigator>
  134. <navigator class="width25 m-ycenter overflow pr" hoverClass="none" url="/pages/common_tools/help_feedback/help_feedback">
  135. <image style="width: 42rpx;height: 42rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/myhple.png"></image>
  136. <view class="f14 m-gray-small mt10 line1">帮助反馈</view>
  137. </navigator>
  138. <view class="width25 m-ycenter overflow pr" @click="customer">
  139. <image style="width: 42rpx;height: 42rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/toolimg/kefu.png"></image>
  140. <view class="f14 m-gray-small mt10 line1">客服咨询</view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="footer">
  145. <image style="width: 200rpx;height: 72rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/logo.png"
  146. mode=""></image>
  147. <text style="font-size: 24rpx;color: rgba(0,0,0,.3);margin-top: 15rpx;">宝宝少生病 / 妈妈更省心 / 家人更安心</text>
  148. </view>
  149. </view>
  150. <view class="cu-tabbar-height"></view>
  151. <view class="cu-tabbar-height"></view>
  152. <u-no-network></u-no-network>
  153. </view>
  154. </template>
  155. <script>
  156. import IMService from "../../common/goeasyimutil.js"
  157. var user = require('../../common/user.js');
  158. import store from '@/store'
  159. export default {
  160. onLoad(options) {
  161. this.getindexImg()
  162. this.$util.getAgreement().then(res => {
  163. this.phone = res.data.phone
  164. }).catch(err => {
  165. })
  166. },
  167. onShow() {
  168. this.getUserInfo()
  169. this.getarchives()
  170. if (getApp().globalData.imService == null) {
  171. let user = uni.getStorageSync('user')
  172. getApp().globalData.imService = new IMService();
  173. let loginResult = getApp().globalData.imService.login({
  174. flag: user.flag,
  175. nickname: user.nickname,
  176. avatar: user.avatar
  177. });
  178. if (loginResult) {
  179. //连接IM
  180. getApp().globalData.imService.connectIM();
  181. }
  182. }
  183. this.imService = getApp().globalData.imService;
  184. this.imService.onConversationsUpdate = (conversations) => {
  185. this.conversations = conversations;
  186. this.setUnreadAmount();
  187. };
  188. var promise = this.imService.latestConversations();
  189. promise.then(res => {
  190. this.conversations = res.content;
  191. console.log("conversations load successfully")
  192. this.setUnreadAmount();
  193. console.log(this.conversations)
  194. uni.hideLoading();
  195. }).catch(e => {
  196. console.log(e)
  197. });
  198. },
  199. data() {
  200. return {
  201. itemcurrent: 0,
  202. info: {},
  203. istrue: false,
  204. patientList: [],
  205. conversations: {
  206. unreadTotal: 0,
  207. conversations: []
  208. },
  209. imService: null,
  210. mseeage: "",
  211. icons: []
  212. }
  213. },
  214. methods: {
  215. getindexImg: async function() {
  216. let res = await this.$request.post("/api/v1/common/icons", {
  217. type: 3
  218. })
  219. if (res.status == 200) {
  220. this.icons = res.data
  221. console.log(this.icons, ">>>>>>>>>>>>>>>>>>>>")
  222. }
  223. },
  224. gotoinfoorder(name) {
  225. switch (name) {
  226. case "我的咨询":
  227. uni.navigateTo({
  228. url: "../common_tools/my_consulting/my_consulting"
  229. })
  230. break;
  231. case "我的预约":
  232. uni.navigateTo({
  233. url: "../common_tools/my_consulting/my_appointment"
  234. })
  235. break;
  236. case "我的意见单":
  237. uni.navigateTo({
  238. url: "../common_tools/my_consulting/my_opinion"
  239. })
  240. break;
  241. case "服务包订单":
  242. uni.navigateTo({
  243. url: "../service_box/box_details"
  244. })
  245. break;
  246. default:
  247. break;
  248. }
  249. },
  250. setUnreadAmount() {
  251. if (this.conversations.unreadTotal > 0) {
  252. this.mseeage = this.conversations.unreadTotal.toString()
  253. uni.setTabBarBadge({
  254. index: 2,
  255. text: this.conversations.unreadTotal.toString()
  256. })
  257. } else {
  258. this.mseeage = ""
  259. uni.hideTabBarRedDot({
  260. index: 2
  261. })
  262. }
  263. },
  264. customer() {
  265. uni.makePhoneCall({
  266. phoneNumber: this.phone
  267. })
  268. },
  269. swiperChange(e) {
  270. this.itemcurrent = e.detail.current
  271. },
  272. getUserInfo: async function() {
  273. let res = await this.$request.post('/api/v1/user/userInfo', {}, false)
  274. let status = user.islogin(res)
  275. if (status) {
  276. this.info = res.data
  277. this.info.flag = 'member_' + this.info.id
  278. store.commit('setUser', this.info)
  279. if (this.info.is_set_pay_password == 0) {
  280. uni.showModal({
  281. title: "提示",
  282. content: "尚未设置支付密码,是否前往设置",
  283. confirmText: "去设置",
  284. success: (res) => {
  285. if (res.confirm) {
  286. uni.navigateTo({
  287. url: "paypassword"
  288. })
  289. }
  290. }
  291. })
  292. }
  293. // getApp().globalData.imService = new IMService();
  294. // let loginResult = getApp().globalData.imService.login(e.detail.userInfo);
  295. // if (loginResult) {
  296. // //连接IM
  297. // getApp().globalData.imService.connectIM();
  298. // }
  299. }
  300. },
  301. gotoinfo(ite) {
  302. uni.navigateTo({
  303. url: "../archives/archives_info?id=" + ite.id
  304. })
  305. },
  306. getarchives: async function() {
  307. let res = await this.$request.post("/api/v1/patient/patientList", {}, false)
  308. if (res.status == 0) {
  309. this.patientList = res.data.data
  310. console.log(this.patientList)
  311. if (this.patientList.length != 0) {
  312. this.istrue = true
  313. }
  314. }
  315. },
  316. gocoupon() {
  317. uni.navigateTo({
  318. url: "../personal/coupon/coupon"
  319. })
  320. }
  321. }
  322. };
  323. </script>
  324. <style scoped>
  325. @import url("./mine.css");
  326. .footer {
  327. text-align: center;
  328. padding-top: 15rpx;
  329. padding-bottom: 15rpx;
  330. position: absolute;
  331. bottom: -200rpx;
  332. width: 100%;
  333. display: flex;
  334. justify-content: center;
  335. align-items: center;
  336. flex-direction: column;
  337. }
  338. .header-content {
  339. position: absolute;
  340. top: 0;
  341. right: 0;
  342. bottom: 0;
  343. left: 0;
  344. width: 100%;
  345. z-index: -1;
  346. overflow: hidden;
  347. box-sizing: border-box;
  348. }
  349. .header-box {
  350. box-shadow: 0px 8rpx 34rpx -6rpx rgba(248, 151, 164, 0.13);
  351. }
  352. .header-img {
  353. width: 36rpx;
  354. height: 36rpx;
  355. }
  356. .tip {
  357. position: absolute;
  358. top: 0;
  359. right: 20%;
  360. bottom: 0;
  361. background-color: red;
  362. width: 12rpx;
  363. height: 12rpx;
  364. border-radius: 50%;
  365. }
  366. .msg {
  367. top: -3rpx;
  368. right: -9rpx;
  369. }
  370. swiper {
  371. height: 320rpx;
  372. }
  373. .swiper-wrapper {
  374. padding: 0 10rpx;
  375. box-sizing: border-box;
  376. }
  377. .swiper-item {
  378. width: 100%;
  379. height: 300rpx;
  380. box-shadow: 0 26rpx 40rpx 0 rgba(255, 255, 255, 0.31);
  381. background: url("http://file.supermm.me/miniProgram/images/personal/bg_doc.png") no-repeat bottom center;
  382. }
  383. .dots {
  384. position: absolute;
  385. left: 0;
  386. right: 0;
  387. bottom: -40rpx;
  388. display: flex;
  389. justify-content: center;
  390. }
  391. .dots .dot {
  392. margin: 0 8rpx;
  393. width: 14rpx;
  394. height: 14rpx;
  395. background: #E4E4E4;
  396. border-radius: 8rpx;
  397. transition: all .6s;
  398. }
  399. .dots .dot.active {
  400. width: 24rpx;
  401. background: rgb(153, 153, 153);
  402. }
  403. .game-wrap {
  404. position: relative;
  405. width: 100%;
  406. height: 100%;
  407. overflow: hidden;
  408. box-sizing: border-box;
  409. }
  410. .game-item {
  411. height: 100%;
  412. background: url("https://file.supermm.me/h5/wechat-h5/integral/personeBg001.jpg") no-repeat;
  413. background-size: 100% 100%;
  414. background-position: center center;
  415. border-radius: 100rpx;
  416. }
  417. </style>