packs_information.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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. <!-- 步骤条 -->
  8. <view class="steps">
  9. <u-steps :list="numList" :current="current"></u-steps>
  10. </view>
  11. <!-- 分隔 -->
  12. <u-gap height="30" bg-color="#f9f9f9"></u-gap>
  13. <!-- 宝贝信息 -->
  14. <view>
  15. <view>
  16. <!-- 标题 -->
  17. <view class="information-title">宝贝计划</view>
  18. <u-line color="#ededed" />
  19. <!-- 姓名 -->
  20. <uni-list :border="false">
  21. <uni-list-item :border="false" :clickable="true" @click="choiceName = true">
  22. <!-- 自定义左(header)右(footer)的内容 -->
  23. <view slot="header">
  24. <text class="xinghao">*</text>
  25. <text style="font-size: 28rpx;">宝贝姓名</text>
  26. </view>
  27. <view slot="footer">
  28. <text style="font-size: 30rpx;">{{babyNmae.label}}</text>
  29. </view>
  30. </uni-list-item>
  31. <!-- 身份证 -->
  32. <uni-list-item :border="false">
  33. <!-- 自定义左(header)右(footer)的内容 -->
  34. <view slot="header">
  35. <text class="xinghao">*</text>
  36. <text style="font-size: 28rpx;">宝贝身份证</text>
  37. </view>
  38. <view slot="footer">
  39. <u-input v-model="babyID" type="idcard" :border="false" placeholder="请填写宝贝身份证" :clearable="false" input-align="right"
  40. height="50" />
  41. </view>
  42. </uni-list-item>
  43. <!-- 社保 -->
  44. <uni-list-item :border="false">
  45. <!-- 自定义左(header)右(footer)的内容 -->
  46. <view slot="header">
  47. <text class="xinghao">*</text>
  48. <text style="font-size: 28rpx;">宝贝是否有社保</text>
  49. </view>
  50. <view slot="footer">
  51. <u-radio-group v-model="guarantee" @change="radioGroupChange">
  52. <u-radio v-for="(item, index) in list" :key="index" :name="item.name" :disabled="item.disabled">
  53. {{item.name}}
  54. </u-radio>
  55. </u-radio-group>
  56. </view>
  57. </uni-list-item>
  58. </uni-list>
  59. </view>
  60. </view>
  61. <!-- 分隔 -->
  62. <u-gap height="30" bg-color="#f9f9f9"></u-gap>
  63. <!-- 监护人信息 -->
  64. <view>
  65. <view>
  66. <!-- 标题 -->
  67. <view class="information-title">监护人信息</view>
  68. <!-- 线条 -->
  69. <u-line color="#ededed" />
  70. <uni-list :border="false">
  71. <!-- 监护人姓名 -->
  72. <uni-list-item :border="false">
  73. <!-- 自定义左(header)右(footer)的内容 -->
  74. <view slot="header">
  75. <text class="xinghao">*</text>
  76. <text style="font-size: 28rpx;">监护人姓名</text>
  77. </view>
  78. <view slot="footer">
  79. <u-input v-model="guardianName" type="text" :border="false" placeholder="请填写您真实姓名" :clearable="false"
  80. input-align="right" height="50" />
  81. </view>
  82. </uni-list-item>
  83. <!-- 关系 -->
  84. <uni-list-item :border="false" :showArrow="true" :clickable="true" @click="relationship = true">
  85. <!-- 自定义左(header)右(footer)的内容 -->
  86. <view slot="header">
  87. <text class="xinghao">*</text>
  88. <text style="font-size: 28rpx;">与宝贝的关系</text>
  89. </view>
  90. <view slot="footer">
  91. <!-- <view style="color: #AAAAAA;" v-if="nRelationship == '' ">请选择</view> -->
  92. <view style="color: #AAAAAA;">{{nRelationship.label}}</view>
  93. </view>
  94. </uni-list-item>
  95. </uni-list>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 按钮 -->
  100. <view class="cu-bar bg-white tabbar border shop" style="position: fixed; bottom: 0; z-index: 99;width: 100%;">
  101. <view class="submit text-white" @click="next" style="background-color: rgb(11,115,186); font-size: 32rpx;">下一步</view>
  102. </view>
  103. </view>
  104. </template>
  105. <script>
  106. export default {
  107. onLoad(op) {
  108. this.packs = JSON.parse(op.data)
  109. },
  110. mounted() {
  111. this.getarchives()
  112. },
  113. data() {
  114. return {
  115. //当前处于第几步
  116. current: 0,
  117. numList: [{
  118. name: '基本信息'
  119. }, {
  120. name: '确认订单'
  121. }, {
  122. name: '支付结果'
  123. }],
  124. list: [{
  125. name: '是',
  126. disabled: false
  127. },
  128. {
  129. name: '否',
  130. disabled: false
  131. }
  132. ],
  133. //控制列选择器
  134. choiceName: false,
  135. relationship: false,
  136. choicelist: [{
  137. value: '1',
  138. label: '测试1'
  139. },
  140. {
  141. value: '2',
  142. label: '测试2'
  143. }
  144. ],
  145. guanxilist: [{
  146. value: '1',
  147. label: '父亲'
  148. },
  149. {
  150. value: '2',
  151. label: '母亲'
  152. },
  153. {
  154. value: '3',
  155. label: '祖父'
  156. },
  157. {
  158. value: '4',
  159. label: '祖母'
  160. },
  161. {
  162. value: '5',
  163. label: '外祖父'
  164. },
  165. {
  166. value: '6',
  167. label: '外祖母'
  168. },
  169. {
  170. value: '7',
  171. label: '叔侄'
  172. }
  173. ],
  174. /**
  175. * 需要传的数据
  176. * 名字
  177. * 身份证
  178. * 社保 值为 是 否
  179. * 监护人姓名
  180. * */
  181. babyNmae: {
  182. label: "请选择",
  183. value: ""
  184. },
  185. babyID: '',
  186. guarantee: '',
  187. guardianName: '',
  188. nRelationship: {
  189. value: "",
  190. label: "请选择"
  191. },
  192. babyList: [],
  193. isindex: "",
  194. packs: {}
  195. }
  196. },
  197. methods: {
  198. getarchives: async function() {
  199. let res = await this.$request.post("/api/v1/patient/patientList")
  200. if (res.status == 0) {
  201. this.babyList = res.data.data
  202. }
  203. },
  204. // 选中任一radio时,由radio-group触发
  205. radioGroupChange(e) {
  206. if (e == "是") {
  207. this.isindex = 1
  208. } else {
  209. this.isindex = 0
  210. }
  211. console.log(this.isindex)
  212. },
  213. confirm1(e) {
  214. console.log(e)
  215. this.babyNmae = e[0]
  216. },
  217. confirm2(e) {
  218. this.nRelationship = e[0]
  219. },
  220. //下一步
  221. next(e) {
  222. if (this.babyNmae.value != "" && this.guardian_name != "") {
  223. let obj = {
  224. product_type: 6,
  225. patient_id: this.babyNmae.value,
  226. total_amount: this.packs.price / 100,
  227. service_pack_id: this.packs.id,
  228. is_security: this.isindex,
  229. guardian_name: this.guardianName,
  230. relationship_type: this.nRelationship.value,
  231. payment_type: 2
  232. }
  233. console.log(obj)
  234. uni.navigateTo({
  235. url: "../order/payment?data=" + JSON.stringify(obj)
  236. })
  237. } else {
  238. uni.showToast({
  239. title: "请填写完整",
  240. icon: "none"
  241. })
  242. }
  243. let obj = {
  244. product_type: 6,
  245. patient_id: this.babyNmae.value,
  246. total_amount: this.packs.price / 100,
  247. service_pack_id: this.packs.id,
  248. is_security: this.isindex,
  249. guardian_name: this.guardianName,
  250. relationship_type: this.nRelationship.value,
  251. payment_type: 2
  252. }
  253. console.log(obj)
  254. }
  255. }
  256. }
  257. </script>
  258. <style>
  259. .steps {
  260. padding-top: 50rpx;
  261. padding-bottom: 30rpx;
  262. height: auto;
  263. background-color: #FFFFFF;
  264. }
  265. /* 信息标题 */
  266. .information-title {
  267. height: auto;
  268. width: auto;
  269. font-size: 30rpx;
  270. font-weight: 600;
  271. padding: 30rpx 0 20rpx 30rpx;
  272. background-color: #FFFFFF;
  273. }
  274. /* 星号 */
  275. .xinghao {
  276. width: 20px;
  277. height: 20px;
  278. display: inline-block;
  279. vertical-align: middle;
  280. text-align: center;
  281. line-height: 26px;
  282. font-size: 15px;
  283. color: #f00;
  284. }
  285. .information-button {
  286. height: 10vh;
  287. padding: 0 20rpx;
  288. }
  289. </style>