info.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="ysec">
  3. <uni-forms ref="form" :value="user" >
  4. <view class="yttit">信息开门</view>
  5. <view class="ysecbox">
  6. <uni-forms-item name="username" label="姓名">
  7. <uni-easyinput :inputBorder="false" v-model="username" placeholder="请输入姓名" />
  8. </uni-forms-item>
  9. <uni-forms-item name="phonenumber" label="手机号码">
  10. <uni-easyinput :inputBorder="false" type="number" v-model="phonenumber" placeholder="请输入手机号码" />
  11. </uni-forms-item>
  12. <!-- <uni-forms-item name="code" label="验证码">
  13. <uni-easyinput :inputBorder="false" v-model="code" placeholder="请输入验证码" />
  14. <view class="line flex0"></view>
  15. <view v-if="timefalg" class="code act">{{time}}秒</view>
  16. <view v-else @click="getCode" class="code">获取验证码</view>
  17. </uni-forms-item> -->
  18. </view>
  19. <view class="rbtn" @click="submit">开门</view>
  20. </uni-forms>
  21. <!-- 列表 -->
  22. <view class="searchlist" v-if="listflag">
  23. <y-list :datalist="list" :wtdt="wtdt" :type="type" @getDetail='getDetail'></y-list>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import * as base64 from "base-64"
  29. import { getReservatList } from "@/api/mine/order.js"
  30. import {sendSmsFn} from "@/api/login.js"
  31. import yList from "@/components/order/list.vue"
  32. export default {
  33. components:{yList},
  34. data() {
  35. return {
  36. timefalg:false,
  37. time:'',
  38. username:'',
  39. phonenumber:'17856919066',
  40. code:'',
  41. newcode:'',//验证码1419
  42. user:{},
  43. list:[],
  44. type:'1',
  45. pageSize: 10,
  46. pageNum: 1,
  47. reachflag: true,
  48. wtdt:'',
  49. listflag:false,
  50. backflag:false
  51. }
  52. },
  53. onReady() {
  54. },
  55. onLoad:function(){
  56. // uni.$on('refreshrelist',(e) => {
  57. // this.reachflag=true;
  58. // this.pageNum=1;
  59. // this.list=[];
  60. // this.backflag=true;
  61. // this.getDataFn();
  62. // })
  63. },
  64. onUnload() {
  65. uni.$off('refreshrelist')
  66. },
  67. // 上拉触底加载更多触发事件
  68. onReachBottom() {
  69. // if (this.reachflag) {
  70. // this.pageNum++
  71. // this.getDataFn()
  72. // }
  73. },
  74. methods: {
  75. submit() {
  76. var that = this;
  77. if (!this.username) {
  78. that.$toast("请输入姓名")
  79. return
  80. }
  81. if (!this.phonenumber ) {
  82. that.$toast("请输入手机号")
  83. return
  84. }
  85. let regphone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
  86. if (this.phonenumber && !regphone.test(this.phonenumber)) {
  87. that.$toast("请输入正确的手机号")
  88. return
  89. }
  90. // this.getDataFn()
  91. },
  92. // getDetail(data){
  93. // var s=base64.encode(data)
  94. // this.$tab.navigateTo('/a/code?id='+s)
  95. // },
  96. // getCode(){
  97. // var that=this;
  98. // if (!this.phonenumber ) {
  99. // that.$toast("请输入手机号")
  100. // return
  101. // }
  102. // let regphone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
  103. // if (this.phonenumber && !regphone.test(this.phonenumber)) {
  104. // that.$toast("请输入正确的手机号")
  105. // return
  106. // }
  107. // sendSmsFn(this.phonenumber).then(res=>{
  108. // if (res.code == 200) {
  109. // // 发送验证码
  110. // that.$toast("发送成功")
  111. // that.newcode=res.msg
  112. // that.time=60;
  113. // that.timefalg=true;
  114. // that.setTimein()
  115. // } else {
  116. // that.$toast(res.msg)
  117. // }
  118. // // 判断是不是对等的
  119. // // that.getCodesend(that.phonenumber)
  120. // })
  121. // },
  122. // 验证码倒计时
  123. // setTimein(){
  124. // var that=this;
  125. // clearInterval(that.timer)
  126. // that.timer=setInterval(()=>{
  127. // if(that.time<=1){
  128. // that.timefalg=false;
  129. // that.time=60;
  130. // clearInterval(that.timer)
  131. // }
  132. // that.time=that.time-1;
  133. // },1000)
  134. // },
  135. // getDataFn(){
  136. // var params={
  137. // visitPhone:this.phonenumber,
  138. // pageSize:this.pageSize,
  139. // pageNum: this.pageNum,
  140. // }
  141. // getReservatList(params).then(res=>{
  142. // if(res.code==200){
  143. // var list=res.rows;
  144. // this.listflag=true;
  145. // if(list&&list.length){
  146. // var len=list.length;
  147. // if(len==1&&!this.backflag&&this.pageNum==1){
  148. // var id=list[0].reservatId
  149. // this.$tab.navigateTo('/pages/order/comedetail?id='+base64.encode(id))
  150. // }else{
  151. // if (res.rows.length < this.pageSize) {
  152. // this.reachflag = false
  153. // this.wtdt = '到底了~';
  154. // } else {
  155. // var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  156. // if (num < res.total) {
  157. // this.reachflag = true
  158. // this.wtdt = '上拉加载更多'
  159. // } else {
  160. // this.reachflag = false
  161. // this.wtdt = '到底了~';
  162. // }
  163. // }
  164. // if (this.pageNum == 1) {
  165. // this.list = res.rows;
  166. // } else {
  167. // this.list = this.list.concat(res.rows)
  168. // }
  169. // }
  170. // }else{
  171. // this.$toast('暂无预约信息')
  172. // }
  173. // }else{
  174. // this.$toast(res.msg)
  175. // }
  176. // })
  177. // },
  178. }
  179. }
  180. </script>
  181. <style lang="scss">
  182. // page {
  183. // background-color: #f5f5f5;
  184. // }
  185. .ysec{padding-top: 10rpx;
  186. .rbtn{width: 680rpx;height: 90rpx;background: $com-cd3;border-radius: 42rpx;text-align: center;line-height: 90rpx;font-size: 28rpx;font-weight: bold;color: #FFFEFE;margin: 70rpx auto 0;}
  187. .yttit{font-size: 28rpx;font-weight: bold;background-color: #f1f1f1;color: $com-cd3;min-height: 72rpx;display: flex;align-items: center;padding: 0rpx 60rpx;box-sizing: border-box;position: relative;
  188. &::before{content: '';width: 6rpx;height: 34rpx;background: $com-cd3;border-radius: 4rpx;position: absolute;top: 50%;transform: translateY(-50%);left: 34rpx;}
  189. }
  190. .ysecbox{padding:0 34rpx;background: #ffffff;}
  191. }
  192. .searchlist{
  193. padding: 0 30rpx;margin-top: 30rpx;
  194. }
  195. .line{width: 2rpx;height: 24rpx;background: #CDCDCD;margin: 0 24rpx;}
  196. .code{font-size: 26rpx;color: $com-cd3;font-weight: 500;
  197. &.act{color: #666666;}
  198. }
  199. .ysec /deep/ .uni-forms .uni-forms-item{padding: 20rpx 16rpx 20rpx;border-bottom: 2rpx solid #E6E6E6;margin-bottom: 0;}
  200. .ysec /deep/ .uni-forms-item__label{flex: 0 0 auto;width: auto !important;font-size: 28rpx;font-weight: bold;position: relative;color: #343434;}
  201. .ysec /deep/ .uni-textarea-placeholder{font-size: 28rpx;color: #DDDDDD !important;}
  202. .ysec /deep/ .uni-easyinput__placeholder-class{font-size: 28rpx;color: #DDDDDD;}
  203. .ysec /deep/ .uni-forms-item__content{display: flex;align-items: center;flex-direction: row;}
  204. .ysec /deep/ .uni-easyinput{flex: 1;text-align: right;}
  205. .ysec /deep/ .uni-forms-item:last-child{border-bottom: none;}
  206. .ysec /deep/ .uni-easyinput__content-input{font-size: 28rpx;}
  207. .ysec /deep/ .uni-forms-item__error{margin-top:20rpx;left: auto;right: 0;}
  208. </style>