packs_information.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  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>
  128. <!-- 按钮 -->
  129. <view class="cu-bar bg-white tabbar border shop" style="position: fixed; bottom: 0; z-index: 99;width: 100%;">
  130. <view class="submit text-white" @click="next" style="background-color: rgb(11,115,186); font-size: 32rpx;">下一步</view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. export default {
  136. onLoad(op) {
  137. this.packs = JSON.parse(op.data)
  138. },
  139. onShow() {
  140. this.getarchives()
  141. },
  142. mounted() {
  143. },
  144. data() {
  145. return {
  146. //当前处于第几步
  147. current: 0,
  148. numList: [{
  149. name: '基本信息'
  150. }, {
  151. name: '确认订单'
  152. }, {
  153. name: '支付结果'
  154. }],
  155. list: [{
  156. name: '是',
  157. disabled: false
  158. },
  159. {
  160. name: '否',
  161. disabled: false
  162. }
  163. ],
  164. //控制列选择器
  165. choiceName: false,
  166. relationship: false,
  167. choicelist: [{
  168. value: '1',
  169. label: '测试1'
  170. },
  171. {
  172. value: '2',
  173. label: '测试2'
  174. }
  175. ],
  176. guanxilist: [{
  177. value: '1',
  178. label: '父亲'
  179. },
  180. {
  181. value: '2',
  182. label: '母亲'
  183. },
  184. {
  185. value: '3',
  186. label: '祖父'
  187. },
  188. {
  189. value: '4',
  190. label: '祖母'
  191. },
  192. {
  193. value: '5',
  194. label: '外祖父'
  195. },
  196. {
  197. value: '6',
  198. label: '外祖母'
  199. },
  200. {
  201. value: '7',
  202. label: '叔侄'
  203. },
  204. {
  205. value: '8',
  206. label: '其他'
  207. }
  208. ],
  209. /**
  210. * 需要传的数据
  211. * 名字
  212. * 身份证
  213. * 社保 值为 是 否
  214. * 监护人姓名
  215. * */
  216. babyNmae: {
  217. label: "请选择",
  218. value: ""
  219. },
  220. babyID: '',
  221. guarantee: '',
  222. guardianName: '',
  223. nRelationship: {
  224. value: "",
  225. label: "请选择"
  226. },
  227. babyList: [],
  228. isindex: -1,
  229. packs: {},
  230. showpeople: false,
  231. value: "请选择",
  232. huanzheID: ""
  233. }
  234. },
  235. methods: {
  236. getarchives: async function() {
  237. let res = await this.$request.post("/api/v1/patient/patientList")
  238. if (res.status == 0) {
  239. this.babyList = res.data.data
  240. }
  241. },
  242. peopleRadioChange(e) {
  243. console.log(e);
  244. },
  245. xuanzehuanzhe(item) {
  246. if (item.card_back_img_url == '' && item.card_img_url == '') {
  247. uni.showModal({
  248. title: "提示",
  249. content: "该档案人未上传证件照无法购买本服务包",
  250. confirmText: "前往设置",
  251. success: (res) => {
  252. if (res.confirm) {
  253. uni.navigateTo({
  254. url: "../archives/upcard?id=" + item.id
  255. })
  256. this.showpeople = false
  257. } else if (res.cancel) {
  258. this.showpeople = false
  259. }
  260. }
  261. })
  262. return false
  263. }
  264. this.huanzheID = item.id
  265. this.value = item.name
  266. this.showpeople = false
  267. },
  268. addPeople(e) {
  269. uni.navigateTo({
  270. url: "../archives/add_archives"
  271. })
  272. },
  273. // 选中任一radio时,由radio-group触发
  274. radioGroupChange(e) {
  275. if (e == "是") {
  276. this.isindex = 1
  277. } else {
  278. this.isindex = 0
  279. }
  280. console.log(this.isindex)
  281. },
  282. confirm1(e) {
  283. console.log(e)
  284. this.babyNmae = e[0]
  285. },
  286. confirm2(e) {
  287. this.nRelationship = e[0]
  288. },
  289. //下一步
  290. next(e) {
  291. if (this.value == "请选择") {
  292. uni.showToast({
  293. title: "请选择宝贝",
  294. icon: "none"
  295. })
  296. return false
  297. }
  298. if (this.isindex == -1) {
  299. uni.showToast({
  300. title: "请选择是否有社保",
  301. icon: "none"
  302. })
  303. return false
  304. }
  305. if (this.guardianName == "") {
  306. uni.showToast({
  307. title: "请填写监护人姓名",
  308. icon: "none"
  309. })
  310. return false
  311. }
  312. if (this.nRelationship.label == "请选择") {
  313. uni.showToast({
  314. title: "请选择关系",
  315. icon: "none"
  316. })
  317. return false
  318. }
  319. let obj = {
  320. product_type: 6,
  321. patient_id: this.huanzheID,
  322. total_amount: this.packs.price / 100,
  323. service_pack_id: this.packs.id,
  324. is_security: this.isindex,
  325. guardian_name: this.guardianName,
  326. relationship_type: this.nRelationship.value,
  327. payment_type: 2
  328. }
  329. console.log(obj)
  330. uni.navigateTo({
  331. url: "../order/payment?data=" + JSON.stringify(obj)
  332. })
  333. }
  334. }
  335. }
  336. </script>
  337. <style lang="scss">
  338. .steps {
  339. padding-top: 50rpx;
  340. padding-bottom: 30rpx;
  341. height: auto;
  342. background-color: #FFFFFF;
  343. }
  344. /* 信息标题 */
  345. .information-title {
  346. height: auto;
  347. width: auto;
  348. font-size: 30rpx;
  349. font-weight: 600;
  350. padding: 30rpx 0 20rpx 30rpx;
  351. background-color: #FFFFFF;
  352. }
  353. /* 星号 */
  354. .xinghao {
  355. width: 20px;
  356. height: 20px;
  357. display: inline-block;
  358. vertical-align: middle;
  359. text-align: center;
  360. line-height: 26px;
  361. font-size: 15px;
  362. color: #f00;
  363. }
  364. .information-button {
  365. height: 10vh;
  366. padding: 0 20rpx;
  367. }
  368. .popup_title {
  369. height: 15%;
  370. width: 100%;
  371. display: flex;
  372. justify-content: center;
  373. align-items: center;
  374. border-bottom: 1rpx solid #f9f9f9;
  375. }
  376. .textareasty {
  377. background-color: white;
  378. border: 1px solid #efefef;
  379. border-radius: 16rpx;
  380. padding: 15rpx;
  381. margin: 15rpx auto;
  382. }
  383. .popup_title_text {
  384. width: auto;
  385. height: auto;
  386. font-size: 34rpx;
  387. font-weight: 540;
  388. }
  389. .popup_list {
  390. display: flex;
  391. height: 10vh;
  392. width: auto;
  393. border-bottom: 1rpx solid #f9f9f9;
  394. }
  395. .popup_list_title {
  396. height: 100%;
  397. width: 90%;
  398. display: inline-block;
  399. padding: 0 0 0 30rpx;
  400. .title {
  401. height: 50%;
  402. width: auto;
  403. font-size: 32rpx;
  404. font-weight: 500;
  405. padding: 20rpx 0 0 0;
  406. }
  407. .body {
  408. height: 50%;
  409. color: #a1a1a1;
  410. height: auto;
  411. width: auto;
  412. font-size: 30rpx;
  413. padding: 10rpx 0 0 0;
  414. }
  415. }
  416. .popup_button {
  417. height: 80rpx;
  418. width: 100%;
  419. display: flex;
  420. justify-content: center;
  421. align-items: center;
  422. view {
  423. color: #0b73ba;
  424. font-weight: 500;
  425. }
  426. }
  427. </style>