packs_information.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <view style="background-color: #f7f4f8; width: auto;">
  3. <view style="height: 100%;">
  4. <!-- 列选择器 -->
  5. <!-- <u-select v-model="choiceName" :list="babyList" value-name="id" label-name="name" @confirm="confirm1"></u-select> -->
  6. <u-select v-model="relationship" :list="guanxilist" @confirm="confirm2"></u-select>
  7. <!-- model控制开关 mode控制显示方向-->
  8. <u-popup v-model="showpeople" mode="bottom" border-radius="14" length="50%">
  9. <view class="popup_title">
  10. <view class="popup_title_text">选择就诊人</view>
  11. </view>
  12. <scroll-view style="height: 70%;" scroll-y="true">
  13. <view class="popup_list" v-for="(item, index) in babyList" :key="index" :data-index="index" @click="xuanzehuanzhe(item)">
  14. <view class="popup_list_title">
  15. <view class="title">{{item.name}}</view>
  16. <view class="body">
  17. {{item.sex==1?'男':'女'}}
  18. </view>
  19. </view>
  20. <view class="popup_list_button flex align-center">
  21. <u-radio-group v-model="value">
  22. <u-radio @change="peopleRadioChange" :key="index" :name="item.name">
  23. </u-radio>
  24. </u-radio-group>
  25. </view>
  26. </view>
  27. </scroll-view>
  28. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  29. <view class="popup_button">
  30. <image style="width: 32rpx;height: 32rpx;margin-right: 15rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/addjiu.png"
  31. mode=""></image>
  32. <view class="" @click="addPeople">
  33. 添加就诊人档案
  34. </view>
  35. </view>
  36. </u-popup>
  37. <!-- 步骤条 -->
  38. <!-- <view class="steps">
  39. <u-steps :list="numList" :current="current"></u-steps>
  40. </view> -->
  41. <!-- 分隔 -->
  42. <u-gap height="30" bg-color="#f9f9f9"></u-gap>
  43. <!-- 宝贝信息 -->
  44. <view>
  45. <view>
  46. <!-- 标题 -->
  47. <view class="information-title">宝贝计划</view>
  48. <u-line color="#ededed" />
  49. <!-- 姓名 -->
  50. <uni-list :border="false">
  51. <uni-list-item :border="false" :clickable="true" @click="showpeople = true">
  52. <!-- 自定义左(header)右(footer)的内容 -->
  53. <view slot="header">
  54. <text class="xinghao">*</text>
  55. <text style="font-size: 28rpx;">宝贝姓名</text>
  56. </view>
  57. <view slot="footer">
  58. <text style="font-size: 30rpx;">{{value}}</text>
  59. </view>
  60. </uni-list-item>
  61. <!-- 身份证 -->
  62. <!-- <uni-list-item :border="false">
  63. <view slot="header">
  64. <text class="xinghao">*</text>
  65. <text style="font-size: 28rpx;">宝贝身份证</text>
  66. </view>
  67. <view slot="footer">
  68. <u-input v-model="babyID" type="idcard" :border="false" placeholder="请填写宝贝身份证" :clearable="false" input-align="right"
  69. height="50" />
  70. </view>
  71. </uni-list-item> -->
  72. <!-- 社保 -->
  73. <uni-list-item :border="false">
  74. <!-- 自定义左(header)右(footer)的内容 -->
  75. <view slot="header">
  76. <text class="xinghao">*</text>
  77. <text style="font-size: 28rpx;">宝贝是否有社保</text>
  78. </view>
  79. <view slot="footer">
  80. <u-radio-group v-model="guarantee" @change="radioGroupChange">
  81. <u-radio v-for="(item, index) in list" :key="index" :name="item.name" :disabled="item.disabled">
  82. {{item.name}}
  83. </u-radio>
  84. </u-radio-group>
  85. </view>
  86. </uni-list-item>
  87. </uni-list>
  88. </view>
  89. </view>
  90. <!-- 分隔 -->
  91. <u-gap height="30" bg-color="#f9f9f9"></u-gap>
  92. <!-- 监护人信息 -->
  93. <view>
  94. <view>
  95. <!-- 标题 -->
  96. <view class="information-title">监护人信息</view>
  97. <!-- 线条 -->
  98. <u-line color="#ededed" />
  99. <uni-list :border="false">
  100. <!-- 监护人姓名 -->
  101. <uni-list-item :border="false">
  102. <!-- 自定义左(header)右(footer)的内容 -->
  103. <view slot="header">
  104. <text class="xinghao">*</text>
  105. <text style="font-size: 28rpx;">监护人姓名</text>
  106. </view>
  107. <view slot="footer">
  108. <u-input v-model="guardianName" type="text" :border="false" placeholder="请填写您真实姓名" :clearable="false"
  109. input-align="right" height="50" />
  110. </view>
  111. </uni-list-item>
  112. <!-- 关系 -->
  113. <uni-list-item :border="false" :showArrow="true" :clickable="true" @click="relationship = true">
  114. <!-- 自定义左(header)右(footer)的内容 -->
  115. <view slot="header">
  116. <text class="xinghao">*</text>
  117. <text style="font-size: 28rpx;">与宝贝的关系</text>
  118. </view>
  119. <view slot="footer">
  120. <!-- <view style="color: #AAAAAA;" v-if="nRelationship == '' ">请选择</view> -->
  121. <view style="color: #AAAAAA;">{{nRelationship.label}}</view>
  122. </view>
  123. </uni-list-item>
  124. </uni-list>
  125. </view>
  126. </view>
  127. <view class="flex align-center padding bg-white">
  128. <u-switch v-model="checked" size="40"></u-switch>
  129. <view class="margin-left-sm">
  130. 本服务包赠送一份保险服务,是否领取保险。如领取保险需要同意<text class="text-blue">《保单协议》</text>和<text class="text-blue">《保单条款》</text>
  131. </view>
  132. </view>
  133. </view>
  134. <!-- 按钮 -->
  135. <view class="cu-bar bg-white tabbar border shop" style="position: fixed; bottom: 0; z-index: 99;width: 100%;">
  136. <view class="submit text-white" @click="next" style="background-color: rgb(11,115,186); font-size: 32rpx;">下一步</view>
  137. </view>
  138. </view>
  139. </template>
  140. <script>
  141. export default {
  142. onLoad(op) {
  143. // console.log(JSON.parse(op.data))
  144. this.packs = JSON.parse(op.data)
  145. },
  146. onShow() {
  147. this.getarchives()
  148. },
  149. mounted() {
  150. },
  151. data() {
  152. return {
  153. //当前处于第几步
  154. current: 0,
  155. numList: [{
  156. name: '基本信息'
  157. }, {
  158. name: '确认订单'
  159. }, {
  160. name: '支付结果'
  161. }],
  162. list: [{
  163. name: '是',
  164. disabled: false
  165. },
  166. {
  167. name: '否',
  168. disabled: false
  169. }
  170. ],
  171. //控制列选择器
  172. choiceName: false,
  173. relationship: false,
  174. choicelist: [{
  175. value: '1',
  176. label: '测试1'
  177. },
  178. {
  179. value: '2',
  180. label: '测试2'
  181. }
  182. ],
  183. guanxilist: [{
  184. value: '1',
  185. label: '父亲'
  186. },
  187. {
  188. value: '2',
  189. label: '母亲'
  190. },
  191. {
  192. value: '3',
  193. label: '祖父'
  194. },
  195. {
  196. value: '4',
  197. label: '祖母'
  198. },
  199. {
  200. value: '5',
  201. label: '外祖父'
  202. },
  203. {
  204. value: '6',
  205. label: '外祖母'
  206. },
  207. {
  208. value: '7',
  209. label: '叔侄'
  210. },
  211. {
  212. value: '8',
  213. label: '其他'
  214. }
  215. ],
  216. /**
  217. * 需要传的数据
  218. * 名字
  219. * 身份证
  220. * 社保 值为 是 否
  221. * 监护人姓名
  222. * */
  223. babyNmae: {
  224. label: "请选择",
  225. value: ""
  226. },
  227. babyID: '',
  228. guarantee: '',
  229. guardianName: '',
  230. nRelationship: {
  231. value: "",
  232. label: "请选择"
  233. },
  234. babyList: [],
  235. isindex: -1,
  236. packs: "",
  237. showpeople: false,
  238. value: "",
  239. huanzheID: "",
  240. checked: false,
  241. isagreement: false,
  242. currentbaby: {}
  243. }
  244. },
  245. methods: {
  246. getarchives: async function() {
  247. let res = await this.$request.post("/api/v1/patient/patientList")
  248. if (res.status == 0) {
  249. this.babyList = res.data.data
  250. this.value = this.babyList[0].name
  251. this.huanzheID = this.babyList[0].id
  252. this.currentbaby = this.babyList[0]
  253. // if (this.babyList[0].card_back_img_url == '' && this.babyList[0].card_img_url == '') {
  254. // let imglist = [{
  255. // url: this.babyList[0].card_img_url
  256. // }, {
  257. // url: this.babyList[0].card_back_img_url
  258. // }]
  259. // uni.showModal({
  260. // title: "提示",
  261. // content: "该档案人未上传证件照无法购买本服务包",
  262. // confirmText: "前往设置",
  263. // success: (res) => {
  264. // if (res.confirm) {
  265. // uni.navigateTo({
  266. // url: "../archives/upcard?id=" + this.babyList[0].id + "&data=" + JSON.stringify(imglist)
  267. // })
  268. // // this.showpeople = false
  269. // } else if (res.cancel) {
  270. // // this.showpeople = false
  271. // }
  272. // }
  273. // })
  274. // }
  275. }
  276. },
  277. peopleRadioChange(e) {
  278. console.log(e);
  279. },
  280. xuanzehuanzhe(item) {
  281. // if (item.card_back_img_url == '' && item.card_img_url == '') {
  282. // let imglist = [{
  283. // url: item.card_img_url
  284. // }, {
  285. // url: item.card_back_img_url
  286. // }]
  287. // uni.showModal({
  288. // title: "提示",
  289. // content: "该档案人未上传证件照无法购买本服务包",
  290. // confirmText: "前往设置",
  291. // success: (res) => {
  292. // if (res.confirm) {
  293. // uni.navigateTo({
  294. // url: "../archives/upcard?id=" + item.id + "&data=" + JSON.stringify(imglist)
  295. // })
  296. // this.showpeople = false
  297. // } else if (res.cancel) {
  298. // this.showpeople = false
  299. // }
  300. // }
  301. // })
  302. // return false
  303. // }
  304. this.currentbaby = item
  305. this.huanzheID = item.id
  306. this.value = item.name
  307. this.showpeople = false
  308. },
  309. addPeople(e) {
  310. uni.navigateTo({
  311. url: "../archives/add_archives"
  312. })
  313. },
  314. // 选中任一radio时,由radio-group触发
  315. radioGroupChange(e) {
  316. if (e == "是") {
  317. this.isindex = 1
  318. } else {
  319. this.isindex = 0
  320. }
  321. console.log(this.isindex)
  322. },
  323. confirm1(e) {
  324. console.log(e)
  325. this.babyNmae = e[0]
  326. },
  327. confirm2(e) {
  328. this.nRelationship = e[0]
  329. },
  330. //下一步
  331. next(e) {
  332. if (this.currentbaby.card_number == '') {
  333. uni.showModal({
  334. title: "提示",
  335. content: "该宝贝尚未填写身份证,请前往填写",
  336. confirmText: "去填写",
  337. showCancel: false,
  338. success: (res) => {
  339. if (res.confirm) {
  340. uni.navigateTo({
  341. url: "../archives/add_archives?info=" + JSON.stringify(this.currentbaby)
  342. })
  343. }
  344. }
  345. })
  346. return false
  347. }
  348. if (this.value == "请选择") {
  349. uni.showToast({
  350. title: "请选择宝贝",
  351. icon: "none"
  352. })
  353. return false
  354. }
  355. if (this.isindex == -1) {
  356. uni.showToast({
  357. title: "请选择是否有社保",
  358. icon: "none"
  359. })
  360. return false
  361. }
  362. if (this.guardianName == "") {
  363. uni.showToast({
  364. title: "请填写监护人姓名",
  365. icon: "none"
  366. })
  367. return false
  368. }
  369. if (this.nRelationship.label == "请选择") {
  370. uni.showToast({
  371. title: "请选择关系",
  372. icon: "none"
  373. })
  374. return false
  375. }
  376. // if (!this.isagreement) {
  377. // uni.showToast({
  378. // title: "请先同意保单协议",
  379. // icon: "none"
  380. // })
  381. // return false
  382. // }
  383. // if (this.babyID == '') {
  384. // uni.showToast({
  385. // title: "请填写宝贝身份证号",
  386. // icon: "none"
  387. // })
  388. // return false
  389. // }
  390. let obj = {
  391. product_type: 6,
  392. patient_id: this.huanzheID,
  393. total_amount: this.packs.price / 100,
  394. service_pack_id: this.packs.id,
  395. is_security: this.isindex,
  396. guardian_name: this.guardianName,
  397. relationship_type: this.nRelationship.value,
  398. is_need_insurance: this.checked,
  399. payment_type: 2
  400. }
  401. console.log(obj)
  402. uni.navigateTo({
  403. url: "../order/payment?data=" + JSON.stringify(obj)
  404. })
  405. }
  406. }
  407. }
  408. </script>
  409. <style lang="scss">
  410. .steps {
  411. padding-top: 50rpx;
  412. padding-bottom: 30rpx;
  413. height: auto;
  414. background-color: #FFFFFF;
  415. }
  416. /* 信息标题 */
  417. .information-title {
  418. height: auto;
  419. width: auto;
  420. font-size: 30rpx;
  421. font-weight: 600;
  422. padding: 30rpx 0 20rpx 30rpx;
  423. background-color: #FFFFFF;
  424. }
  425. /* 星号 */
  426. .xinghao {
  427. width: 20px;
  428. height: 20px;
  429. display: inline-block;
  430. vertical-align: middle;
  431. text-align: center;
  432. line-height: 26px;
  433. font-size: 15px;
  434. color: #f00;
  435. }
  436. .information-button {
  437. height: 10vh;
  438. padding: 0 20rpx;
  439. }
  440. .popup_title {
  441. height: 15%;
  442. width: 100%;
  443. display: flex;
  444. justify-content: center;
  445. align-items: center;
  446. border-bottom: 1rpx solid #f9f9f9;
  447. }
  448. .textareasty {
  449. background-color: white;
  450. border: 1px solid #efefef;
  451. border-radius: 16rpx;
  452. padding: 15rpx;
  453. margin: 15rpx auto;
  454. }
  455. .popup_title_text {
  456. width: auto;
  457. height: auto;
  458. font-size: 34rpx;
  459. font-weight: 540;
  460. }
  461. .popup_list {
  462. display: flex;
  463. height: 10vh;
  464. width: auto;
  465. border-bottom: 1rpx solid #f9f9f9;
  466. }
  467. .popup_list_title {
  468. height: 100%;
  469. width: 90%;
  470. display: inline-block;
  471. padding: 0 0 0 30rpx;
  472. .title {
  473. height: 50%;
  474. width: auto;
  475. font-size: 32rpx;
  476. font-weight: 500;
  477. padding: 20rpx 0 0 0;
  478. }
  479. .body {
  480. height: 50%;
  481. color: #a1a1a1;
  482. height: auto;
  483. width: auto;
  484. font-size: 30rpx;
  485. padding: 10rpx 0 0 0;
  486. }
  487. }
  488. .popup_button {
  489. height: 80rpx;
  490. width: 100%;
  491. display: flex;
  492. justify-content: center;
  493. align-items: center;
  494. view {
  495. color: #0b73ba;
  496. font-weight: 500;
  497. }
  498. }
  499. </style>