makeOut.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <view class="scenic-makeOut">
  3. <u--form
  4. labelPosition="left"
  5. :model="form"
  6. :rules="rules"
  7. ref="uForm"
  8. labelWidth="150rpx"
  9. >
  10. <view class="content info">
  11. <view class="title">
  12. 敦煌鸣沙山与月牙泉门票成人票
  13. </view>
  14. <view class="notice">
  15. <view class="text">
  16. 预定须知
  17. </view>
  18. <image class="jiantou" src="../static/right.png" mode=""></image>
  19. </view>
  20. <u-form-item
  21. label="出游日期"
  22. borderBottom
  23. ref="item1"
  24. >
  25. <view class="time-box" @click="chooseTime">
  26. <image class="right-icon" src="../static/right.png" mode=""></image>
  27. </view>
  28. </u-form-item>
  29. <view class="signUp-box">
  30. <view class="label-box">
  31. <view class="label">
  32. 报名人数
  33. </view>
  34. <view class="desc">
  35. (最多10张)
  36. </view>
  37. </view>
  38. <view class="num-box">
  39. <view class="btn" :class="[num == 1?'disabled':'']" @click="add(-1)">
  40. -
  41. </view>
  42. <view class="num">
  43. {{num}}
  44. </view>
  45. <view class="btn" :class="[num == 10?'disabled':'']" @click="add(1)">
  46. +
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="content ">
  52. <view class="sub-title">
  53. 取票人信息
  54. </view>
  55. <u-form-item
  56. label="姓名"
  57. borderBottom
  58. ref="item1"
  59. >
  60. <u--input
  61. v-model="form.name"
  62. border="none"
  63. placeholder="请输入姓名"
  64. ></u--input>
  65. </u-form-item>
  66. <u-form-item
  67. label="手机号"
  68. borderBottom
  69. ref="item1"
  70. >
  71. <u--input
  72. v-model="form.name"
  73. border="none"
  74. placeholder="请输入手机号"
  75. ></u--input>
  76. </u-form-item>
  77. <u-form-item
  78. label="证件类型"
  79. borderBottom
  80. ref="item1"
  81. >
  82. <view class="time-box" @click="chooseTime">
  83. <image class="right-icon" src="../static/right.png" mode=""></image>
  84. </view>
  85. </u-form-item>
  86. <u-form-item
  87. label="证件号"
  88. ref="item1"
  89. >
  90. <u--input
  91. v-model="form.name"
  92. border="none"
  93. placeholder="请输入证件号"
  94. ></u--input>
  95. </u-form-item>
  96. </view>
  97. <view class="content" v-for="item in num" :key="item">
  98. <view class="sub-title">
  99. 出游人信息
  100. </view>
  101. <view class="no">
  102. 第{{item+1}}位
  103. </view>
  104. <u-form-item
  105. label="姓名"
  106. borderBottom
  107. ref="item1"
  108. >
  109. <u--input
  110. v-model="form.name"
  111. border="none"
  112. placeholder="请输入姓名"
  113. ></u--input>
  114. </u-form-item>
  115. <u-form-item
  116. label="手机号"
  117. borderBottom
  118. ref="item1"
  119. >
  120. <u--input
  121. v-model="form.name"
  122. border="none"
  123. placeholder="请输入手机号"
  124. ></u--input>
  125. </u-form-item>
  126. <u-form-item
  127. label="证件类型"
  128. borderBottom
  129. ref="item1"
  130. >
  131. <view class="time-box" @click="chooseTime">
  132. <image class="right-icon" src="../static/right.png" mode=""></image>
  133. </view>
  134. </u-form-item>
  135. <u-form-item
  136. label="证件号"
  137. ref="item1"
  138. >
  139. <u--input
  140. v-model="form.name"
  141. border="none"
  142. placeholder="请输入证件号"
  143. ></u--input>
  144. </u-form-item>
  145. </view>
  146. </u--form>
  147. <view class="btn-box">
  148. <view class="left">
  149. <view class="num">
  150. 共{{num}}件
  151. </view>
  152. <view class="total">
  153. 合计 <view class="price-box">
  154. <view class="unit">
  155. </view>
  156. <view class="price">
  157. {{total}}
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. <button class="btn" @click="handleBuy" :loading="loading">
  163. 立即报名
  164. </button>
  165. </view>
  166. </view>
  167. </template>
  168. <script>
  169. export default {
  170. data() {
  171. return {
  172. num:1,
  173. total:0,
  174. loading:false,
  175. form:{
  176. name:''
  177. },
  178. rules: {
  179. 'name': {
  180. type: 'string',
  181. required: true,
  182. message: '请填写姓名',
  183. trigger: ['blur', 'change']
  184. },
  185. },
  186. }
  187. },
  188. methods: {
  189. chooseTime() {
  190. console.log(1111);
  191. },
  192. add(val){
  193. if((val==-1&&this.num == 1)||(val==1&&this.num == 10)) return
  194. this.num += val
  195. },
  196. handleBuy(){
  197. }
  198. },
  199. onReady() {
  200. //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
  201. this.$refs.uForm.setRules(this.rules)
  202. },
  203. }
  204. </script>
  205. <style lang="scss" >
  206. .scenic-makeOut{
  207. background: #F9F9F9;
  208. border-radius: 0rpx 0rpx 0rpx 0rpx;
  209. padding: 20rpx 24rpx 120rpx;
  210. .content{
  211. background: #FFFFFF;
  212. border-radius: 16rpx 16rpx 16rpx 16rpx;
  213. margin-bottom: 20rpx;
  214. padding: 24rpx;
  215. }
  216. .sub-title{
  217. font-weight: 600;
  218. font-size: 28rpx;
  219. color: #222222;
  220. padding-bottom: 24rpx;
  221. border-bottom: 1rpx solid #F0F0F0;
  222. }
  223. .no{
  224. padding: 24rpx 0;
  225. font-size: 28rpx;
  226. color: #222222;
  227. }
  228. .time-box{
  229. display: flex;
  230. justify-content: flex-end;
  231. .right-icon{
  232. width: 48rpx;
  233. height: 48rpx;
  234. }
  235. }
  236. .info{
  237. .title{
  238. font-weight: 600;
  239. font-size: 36rpx;
  240. color: #222222;
  241. width: 100%;
  242. white-space: nowrap;
  243. overflow: hidden;
  244. text-overflow: ellipsis;
  245. margin-top: 10rpx;
  246. }
  247. .notice{
  248. display: flex;
  249. align-items: center;
  250. font-size: 24rpx;
  251. color: #AAAAAA;
  252. margin-top: 20rpx;
  253. .jiantou{
  254. width: 48rpx;
  255. height: 48rpx;
  256. }
  257. }
  258. .signUp-box{
  259. display: flex;
  260. justify-content: space-between;
  261. align-items: center;
  262. padding-top: 20rpx;
  263. .label-box{
  264. display: flex;
  265. align-items: center;
  266. .label{
  267. font-weight: 300;
  268. font-size: 24rpx;
  269. color: #181818;
  270. }
  271. .desc{
  272. font-weight: 300;
  273. font-size: 24rpx;
  274. color: #AAAAAA;
  275. }
  276. }
  277. .num-box{
  278. display: flex;
  279. align-items: center;
  280. .btn.disabled{
  281. background: #F0F0F0;
  282. color: #AAAAAA;
  283. }
  284. .btn{
  285. width: 36rpx;
  286. height: 36rpx;
  287. line-height: 36rpx;
  288. border-radius: 50%;
  289. background: #E2ECFF;
  290. color: #3879F9;
  291. font-size: 30rpx;
  292. text-align: center;
  293. vertical-align: top;
  294. }
  295. .num{
  296. font-weight: 400;
  297. font-size: 24rpx;
  298. color: #222222;
  299. width: 50rpx;
  300. text-align: center;
  301. }
  302. }
  303. }
  304. }
  305. .btn-box {
  306. position: fixed;
  307. bottom: 0%;
  308. left: 0%;
  309. z-index: 2;
  310. width: 100%;
  311. display: flex;
  312. align-items: center;
  313. justify-content: space-between;
  314. box-sizing: border-box;
  315. padding: 10rpx 24rpx env(safe-area-inset-bottom);
  316. background: #fff;
  317. border-top: 1rpx solid #EEEEEE;
  318. .left{
  319. display: flex;
  320. align-items: flex-end;
  321. .num{
  322. font-weight: 300;
  323. font-size: 24rpx;
  324. color: #AAAAAA;
  325. }
  326. .total{
  327. font-weight: 300;
  328. font-size: 24rpx;
  329. color: #222222;
  330. display: flex;
  331. align-items: flex-end;
  332. margin-left: 6rpx;
  333. .price-box{
  334. display: flex;
  335. align-items: flex-end;
  336. font-weight: 400;
  337. font-size: 32rpx;
  338. color: #222222;
  339. .unit{
  340. font-size: 20rpx;
  341. }
  342. }
  343. }
  344. }
  345. .btn {
  346. width: 280rpx;
  347. height: 80rpx;
  348. line-height: 80rpx;
  349. text-align: center;
  350. background: $uni-color-primary;
  351. border-radius: 40rpx;
  352. font-weight: 600;
  353. font-size: 28rpx;
  354. color: #FFFFFF;
  355. margin: 0;
  356. }
  357. }
  358. }
  359. </style>