order.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <view class="safeArea">
  3. <view class="appointment">
  4. <view class="appointmentItem">
  5. <view class="title">考试地点:</view>
  6. <view class="place" @click="showAddress">
  7. <view class="name">{{addressName}}</view>
  8. <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
  9. </view>
  10. </view>
  11. <view class="appointmentItem">
  12. <view class="title">考试时间:</view>
  13. <view class="main">
  14. <view v-for="(item,index) in list" class="item" :key="index" @click="choItem(index)">
  15. <view class="checkbox"><u-checkbox v-if="item.status===1" v-model="item.checked" shape="circle"></u-checkbox></view>
  16. <view class="box">
  17. <view :class="['time',{'active':item.checked},{'no':item.status!==1}]">{{item.time}}</view>
  18. <view class="statusInfo" v-if="item.status !==1">
  19. <template v-if="item.status===2">预约名额已满</template>
  20. <template v-if="item.status===3">此时段您已经有其他考试预约</template>
  21. </view>
  22. </view>
  23. <view class="num">已报:{{item.appoint}}/{{item.total}}</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="btnMain">
  28. <view class="return">上一步</view>
  29. <view class="sure" @click="sureOppoint">确定预约</view>
  30. </view>
  31. </view>
  32. <!-- 弹框-->
  33. <u-popup v-model="address_show" mode="bottom" class="addModel">
  34. <view class="tipBox safeArea">
  35. <view class="line"></view>
  36. <view class="title">温馨提示</view>
  37. <u-line color="#EEEEEE" />
  38. <scroll-view class="addressList" :scroll-y="true">
  39. <view class="item" v-for="(item,index) in addressList" :key="index" @click="choAddress(index)">
  40. <u-checkbox class="checkbox" v-model="item.checked" shape="circle"></u-checkbox>
  41. <view :class="['address',{'active': item.checked}]">{{item.address}}</view>
  42. </view>
  43. </scroll-view>
  44. <u-line color="#EEEEEE" />
  45. <view class="btn" @click="sureAddress">确认</view>
  46. </view>
  47. </u-popup>
  48. </view>
  49. </template>
  50. <script>
  51. import { mapGetters } from 'vuex';
  52. export default {
  53. data() {
  54. return {
  55. address_show: false,
  56. addressName: '广州市天可区燕岭路建设大厦3楼',
  57. addressList:[{checked:true,address: '广州市天可区燕岭路建设大厦3楼'},{checked:false,address: '广州市海珠区广州塔3楼'},{checked:false,address: '深圳市企鹅大厦附近的写字楼'}],
  58. list: [{
  59. time: '2021/10/23 10:00 ~ 11:00',
  60. total: 100,
  61. appoint: 100,
  62. checked: true,
  63. status: 1, // 1:可报 2:预约名额已满 3:此时段您已经有其他考试预约
  64. },
  65. {
  66. time: '2021/10/23 10:00 ~ 11:00',
  67. total: 100,
  68. appoint: 20,
  69. status: 2,
  70. },
  71. {
  72. time: '2021/10/23 10:00 ~ 11:00',
  73. total: 100,
  74. appoint: 20,
  75. status: 3
  76. },
  77. {
  78. time: '2021/10/23 10:00 ~ 11:00',
  79. total: 100,
  80. appoint: 20,
  81. status: 1
  82. }
  83. ]
  84. };
  85. },
  86. onLoad(option) {},
  87. methods: {
  88. showAddress(){
  89. this.address_show = true
  90. },
  91. choAddress(index){
  92. this.addressList.forEach((item,idx)=>{
  93. item.checked = false
  94. this.$set(item, 'checked',false)
  95. if(idx === index){
  96. this.$set(item, 'checked',true)
  97. }
  98. })
  99. },
  100. sureAddress(){
  101. const index = this.addressList.findIndex(item => item.checked)
  102. this.addressName = this.addressList[index].address
  103. this.address_show = false
  104. },
  105. choItem(index){
  106. const item = this.list[index]
  107. if(item.status!==1){
  108. return
  109. }
  110. this.list.forEach((item,idx)=>{
  111. item.checked = false
  112. if(idx === index){
  113. item.checked = true
  114. }
  115. })
  116. },
  117. sureOppoint(){
  118. this.$navTo.togo('/pages2/order/confirm_list');
  119. }
  120. },
  121. };
  122. </script>
  123. <style >
  124. page{
  125. background-color: #EAEEF1;
  126. }
  127. .addModel .u-drawer-bottom{
  128. box-shadow: 0px 0px 16px 4px rgba(145, 156, 178, 0.1);
  129. border-radius: 32rpx 32rpx 0px 0px;
  130. }
  131. </style>
  132. <style scoped lang="scss">
  133. .appointment{
  134. padding:0 8rpx;
  135. .appointmentItem{
  136. margin: 24rpx 0 40rpx;
  137. .title{
  138. font-size: 30rpx;
  139. font-family: PingFang SC;
  140. font-weight: 500;
  141. color: #333333;
  142. line-height: 1;
  143. margin-bottom: 16rpx;
  144. padding-left: 24rpx;
  145. }
  146. .place{
  147. height: 80rpx;
  148. background: #FFFFFF;
  149. border-radius: 16rpx;
  150. display: flex;
  151. justify-content: space-between;
  152. align-items: center;
  153. padding: 0 24rpx;
  154. }
  155. }
  156. .main{
  157. background: #FFFFFF;
  158. border-radius: 16rpx;
  159. padding: 32rpx 16rpx;
  160. .item{
  161. display: flex;
  162. align-items: center;
  163. margin-bottom: 16rpx;
  164. font-size: 28rpx;
  165. font-family: PingFang SC;
  166. font-weight: 500;
  167. color: #333333;
  168. .statusInfo{
  169. font-size: 24rpx;
  170. font-family: PingFang SC;
  171. font-weight: 500;
  172. color: #FF3B30;
  173. padding-left:24rpx;
  174. }
  175. .checkbox {
  176. width:32rpx;
  177. height:32rpx;
  178. display: flex;
  179. align-items: center;
  180. }
  181. .time{
  182. width: 430rpx;
  183. height: 80rpx;
  184. line-height: 80rpx;
  185. background: #F5F5F5;
  186. border: 2rpx solid #F5F5F5;
  187. border-radius: 16rpx;
  188. font-size: 30rpx;
  189. font-family: PingFang SC;
  190. font-weight: bold;
  191. text-align: center;
  192. color: #333333;
  193. margin: 0 18rpx 0 8rpx;
  194. &.active{
  195. background: #EBF5FF;
  196. border: 2px solid #007AFF;
  197. }
  198. &.no{
  199. background: #FFDDDB;
  200. border: 2px solid #FFDDDB;
  201. }
  202. }
  203. }
  204. }
  205. .btnMain{
  206. display: flex;
  207. justify-content: center;
  208. text-align: center;
  209. .return{
  210. width: 200rpx;
  211. height: 80rpx;
  212. line-height: 80rpx;
  213. background: #F5F5F5;
  214. border-radius: 40rpx;
  215. font-size: 30rpx;
  216. font-family: PingFang SC;
  217. font-weight: bold;
  218. color: #007AFF;
  219. }
  220. .sure{
  221. width: 438rpx;
  222. height: 80rpx;
  223. line-height: 80rpx;
  224. background: #007AFF;
  225. border-radius: 40rpx;
  226. font-size: 30rpx;
  227. font-family: PingFang SC;
  228. font-weight: bold;
  229. color: #FFFFFF;
  230. margin-left:24rpx;
  231. }
  232. }
  233. }
  234. .tipBox{
  235. width: 100%;
  236. font-family: PingFang SC;
  237. .line{
  238. width: 80rpx;
  239. height: 8rpx;
  240. background: #999999;
  241. border-radius: 4rpx;
  242. margin: 8rpx auto;
  243. }
  244. .title{
  245. text-align: center;
  246. font-size: 24rpx;
  247. font-family: PingFang SC;
  248. font-weight: 500;
  249. color: #999999;
  250. margin: 15rpx 0;
  251. }
  252. .main{
  253. font-size: 30rpx;
  254. font-weight: 500;
  255. color: #666666;
  256. line-height: 48rpx;
  257. margin-bottom: 40rpx;
  258. }
  259. .addressList{
  260. height: 500rpx;
  261. .item{
  262. display: flex;
  263. align-items: center;
  264. padding: 0 24rpx;
  265. margin-bottom: 24rpx;
  266. .checkbox{
  267. width:32rpx;
  268. height:32rpx;
  269. display: flex;
  270. align-items: center;
  271. margin-right: 8rpx;
  272. }
  273. .address{
  274. width: 654rpx;
  275. height: 80rpx;
  276. line-height: 80rpx;
  277. background: #F5F5F5;
  278. border-radius: 16rpx;
  279. font-size: 30rpx;
  280. font-family: PingFang SC;
  281. font-weight: bold;
  282. color: #333333;
  283. padding: 0 24rpx;
  284. &.active{
  285. background: #EBF5FF;
  286. border: 2rpx solid #007AFF;
  287. }
  288. }
  289. }
  290. }
  291. .btn{
  292. width: 200rpx;
  293. height: 64rpx;
  294. line-height: 64rpx;
  295. background: linear-gradient(0deg, #015EEA, #00C0FA);
  296. border-radius: 32rpx;
  297. margin: 17rpx auto;
  298. font-size: 30rpx;
  299. font-family: PingFang SC;
  300. font-weight: 500;
  301. text-align: center;
  302. color: #FFFFFF;
  303. }
  304. }
  305. </style>