login.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <view class="bagStorageLogin">
  3. <navigation-bar-view ref="nav" :maxTimer="60"></navigation-bar-view>
  4. <!-- <view class="label-box">请选择您的存放方式</view> -->
  5. <view class="content">
  6. <view class="scan-code-box">
  7. <image class="scan-code-bg" :src="require('../../static/images/icon-scan-code-bg.png')" mode="aspectFit"></image>
  8. <image class="scan-code" :src="codeUrl" mode="aspectFit"></image>
  9. </view>
  10. <view class="message">点开微信”扫一扫“</view>
  11. <view class="message">Scan QR Code via WeChat</view>
  12. <!-- <view class="item">
  13. <view class="label" style="margin-bottom: 2vw;">微信扫码</view>
  14. <view class="message">微信/支付宝扫码</view>
  15. </view>
  16. <view class="item">
  17. <view class="label">手机号验证</view>
  18. <view class="cell">
  19. <input class="input-box" placeholder="请输入存放手机号码" type="number" @input="changePhone" />
  20. </view>
  21. <view class="cell">
  22. <input class="input-box" placeholder="请输入验证码" maxlength="4" type="number" @input="changeCode" />
  23. <view class="code-btn" @click="getCode">{{countDownStr}}</view>
  24. </view>
  25. </view> -->
  26. </view>
  27. <view class="take-out-the-process">
  28. <image class="icon" :src="require('../../static/images/icon-storage-process.png')" mode="aspectFit"></image>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import navigationBarView from '../../components/navigationBarView.vue';
  34. import uQRCode from '../../js_sdk/Sansnn-uQRCode/uqrcode.js';
  35. export default {
  36. components: {
  37. navigationBarView
  38. },
  39. data() {
  40. return {
  41. countDownStr: '获取验证码',
  42. body: {
  43. phone: ''
  44. },
  45. codeUrl: ''
  46. }
  47. },
  48. onLoad() {
  49. this.getData()
  50. },
  51. onHide() {
  52. const $this = this;
  53. $this.$nextTick(function() {
  54. $this.$refs.nav.clearTimer();
  55. })
  56. },
  57. methods: {
  58. getData() {
  59. let sn = uni.getStorageSync('sn');
  60. this.codeUrl = `../../static/TakeStore/store_${sn}.png`
  61. this.$api.deviceInfo({
  62. deviceSn: sn
  63. }).then(res => {
  64. this.codeUrl = res.data.url
  65. })
  66. },
  67. changePhone(e) {
  68. this.body.phone = e.detail.value;
  69. },
  70. changeCode(e) {
  71. if (e.detail.value.length == 4) {
  72. this.$api.commonSmsValidate({
  73. phone: this.body.phone,
  74. code: e.detail.value
  75. }).then(res => {
  76. uni.redirectTo({
  77. url: '/pages/bagStorage/orders?phone=' + this.body.phone
  78. })
  79. })
  80. }
  81. },
  82. getCode() {
  83. if (!this.body.phone) {
  84. uni.showToast({
  85. title: '请输入手机号',
  86. icon: 'none'
  87. })
  88. return
  89. }
  90. if (this.countDownStr != '获取验证码') {
  91. return;
  92. }
  93. this.$api.commonSmsSend({
  94. phone: this.body.phone
  95. }).then(res => {
  96. uni.showToast({
  97. title: '验证码已发送'
  98. })
  99. })
  100. this.countDown()
  101. },
  102. countDown() {
  103. const $this = this;
  104. this.$tools.countDownForSecond(60, (timer, elemnet) => {
  105. if (timer == 0) {
  106. $this.countDownStr = '获取验证码'
  107. }
  108. $this.countDownStr = timer + 's'
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss">
  115. .bagStorageLogin {
  116. min-height: 100vh;
  117. background-color: #FFFFFF;
  118. .label-box {
  119. padding: 15.2vw 5vw 5.2vw;
  120. color: #222222;
  121. font-size: 4.2vw;
  122. }
  123. .content {
  124. display: flex;
  125. align-items: center;
  126. justify-content: space-between;
  127. flex-direction: column;
  128. // background-color: red;
  129. margin-top: 29.2vw;
  130. // padding: 0 5vw;
  131. .scan-code-box {
  132. position: relative;
  133. display: flex;
  134. align-items: center;
  135. justify-content: center;
  136. width: 39.7vw;
  137. height: 39.6vw;
  138. margin-bottom: 8.3vw;
  139. .scan-code-bg {
  140. position: absolute;
  141. top: 0;
  142. left: 0;
  143. width: 39.7vw;
  144. height: 39.6vw;
  145. }
  146. .scan-code {
  147. position: relative;
  148. width: 29.2vw;
  149. height: 29.2vw;
  150. }
  151. }
  152. .message {
  153. // margin-top: 8.3vw;
  154. text-align: center;
  155. font-size: 4.2vw;
  156. line-height: 5.8vw;
  157. color: #253B56;
  158. }
  159. // .item {
  160. // display: flex;
  161. // align-items: center;
  162. // flex-direction: column;
  163. // width: 42.5vw;
  164. // height: 60.4vw;
  165. // border-radius: 1.7vw;
  166. // background-color: #FFFFFF;
  167. // .label {
  168. // margin: 11.3vw 0 5vw;
  169. // color: #222222;
  170. // font-size: 4.2vw;
  171. // line-height: 4.2vw;
  172. // }
  173. // .message {
  174. // color: #666;
  175. // font-size: 3.2vw;
  176. // line-height: 3.2vw;
  177. // }
  178. // .img {
  179. // width: 30vw;
  180. // height: 30vw;
  181. // image {
  182. // width: 100%;
  183. // height: 100%;
  184. // }
  185. // }
  186. // .cell {
  187. // display: flex;
  188. // align-items: center;
  189. // width: 35.2vw;
  190. // margin-bottom: 11rpx;
  191. // .input-box {
  192. // flex: 1;
  193. // height: 7.5vw;
  194. // line-height: 7.5vw;
  195. // border: 0.2vw solid #DCDCDC;
  196. // border-radius: .8vw;
  197. // padding: 0 1vw;
  198. // background-color: #F4F4F4;
  199. // font-size: 2.5vw;
  200. // }
  201. // .code-btn {
  202. // display: flex;
  203. // align-items: center;
  204. // justify-content: center;
  205. // width: 15vw;
  206. // height: 7.5vw;
  207. // border-radius: .8vw;
  208. // background-color: #FDD002;
  209. // margin-left: 1.9vw;
  210. // font-size: 2.5vw;
  211. // }
  212. // }
  213. // }
  214. }
  215. .take-out-the-process {
  216. position: fixed;
  217. bottom: 0;
  218. left: 0;
  219. right: 0;
  220. .icon {
  221. width: 100vw;
  222. height: 43.75vw;
  223. vertical-align: top;
  224. }
  225. }
  226. }
  227. </style>