宜轩到家/服务到家第三版,换个颜色
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
4.8 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="content">
  3. <view v-if="step === 1">
  4. <view style="height: 138rpx; width: 100%;"></view>
  5. <view class="a1 flex">
  6. <image src="/static/icons/icon7.png" style="width: 29rpx;height: 32rpx; margin-right: 10rpx" />
  7. <span>手机号快捷登录</span>
  8. </view>
  9. <view class="a2">未注册手机号将自动创建账号</view>
  10. <view class="a3"></view>
  11. <view class="a4 flex">
  12. <view class="left-area">+86</view>
  13. <input placeholder="请输入手机号" />
  14. </view>
  15. <button class="a5" @click="clickSendCode">下一步</button>
  16. </view>
  17. <view v-if="step === 2">
  18. <view class="b1">
  19. <span>输入验证码</span>
  20. </view>
  21. <view class="b2">
  22. 验证码已发送至156**3437
  23. </view>
  24. <view>
  25. <view class="flex flex-sb" style="padding: 40rpx; width: calc(100% - 80rpx)">
  26. <input v-for="i in 6" class="input-m" type="number" :class="{active: i === code.length+1}"
  27. :focus="i === code.length+1" :value="code[i-1]" @click="clickNum(i)" @input="inputNum" />
  28. </view>
  29. </view>
  30. <view class="b3">
  31. 没收到验证码?<span>重新发送</span>
  32. </view>
  33. <view class="b4">
  34. 确认绑定
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import md5 from '@/utils/md5.js'
  41. export default {
  42. data() {
  43. return {
  44. step: 1,
  45. openid: '',
  46. code: ''
  47. }
  48. },
  49. onShow() {
  50. console.log();
  51. },
  52. methods: {
  53. clickCancel() {
  54. uni.switchTab({
  55. url: '/pages/index/index'
  56. })
  57. },
  58. clickSendCode() {
  59. let timestamp = Date.now()
  60. let userName = 'tairoudj'
  61. uni.request({
  62. url: 'http://agent.izjun.com:8001/sms/api/sendMessageOne',
  63. data: {
  64. userName,
  65. messageList : [
  66. {
  67. "phone" : "13055015802",
  68. "content" : "尊敬的龙先生, 这是一条测试短信"
  69. }
  70. ],
  71. timestamp,
  72. sign : window.md5(userName + timestamp + window.md5('evXRctaIoX22'))
  73. },
  74. header: {
  75. 'Accept': 'application/json',
  76. 'Content-Type': 'application/json;charset=utf-8'
  77. },
  78. method: 'POST',
  79. success: (res) => {
  80. console.log(res.data);
  81. }
  82. })
  83. // this.step = 2
  84. },
  85. clickNum(i) {
  86. this.code = this.code.substring(0, i - 1)
  87. },
  88. inputNum(event) {
  89. if (event) {
  90. this.code = this.code + event.detail.value.toString().substring(0, 1)
  91. if (this.code.length === 6) {
  92. this.checkCode()
  93. }
  94. }
  95. },
  96. checkCode() {
  97. this.clickCancel()
  98. },
  99. }
  100. }
  101. </script>
  102. <style>
  103. .b1 {
  104. width: 100%;
  105. height: 56rpx;
  106. font-size: 40rpx;
  107. font-family: PingFang SC, PingFang SC-Heavy;
  108. font-weight: 800;
  109. text-align: center;
  110. color: #333333;
  111. margin-top: 38rpx;
  112. }
  113. .b2 {
  114. width: 100%;
  115. height: 40rpx;
  116. font-size: 28rpx;
  117. font-family: PingFang SC, PingFang SC-Regular;
  118. font-weight: 400;
  119. text-align: center;
  120. color: #a5a5a5;
  121. margin-top: 20rpx;
  122. }
  123. .input-m {
  124. width: 96rpx;
  125. height: 136rpx;
  126. background: #f8f8f8;
  127. border-radius: 16rpx;
  128. line-height: 136rpx;
  129. font-size: 52rpx;
  130. font-family: PingFang SC, PingFang SC-Heavy;
  131. font-weight: 800;
  132. text-align: center;
  133. color: #333333;
  134. }
  135. .input-m.active {
  136. width: 90rpx;
  137. height: 130rpx;
  138. border: 3rpx solid #6e3009;
  139. }
  140. .b3 {
  141. font-size: 28rpx;
  142. font-family: PingFang SC, PingFang SC-Regular;
  143. font-weight: 400;
  144. text-align: center;
  145. color: #666666;
  146. }
  147. .b3 span {
  148. color: #6e3009;
  149. }
  150. .b4 {
  151. width: 556rpx;
  152. height: 90rpx;
  153. line-height: 90rpx;
  154. border-radius: 46rpx;
  155. font-size: 28rpx;
  156. font-family: PingFang SC, PingFang SC-Regular;
  157. font-weight: 400;
  158. text-align: center;
  159. margin: 94rpx auto;
  160. background: linear-gradient(178deg, #ffe6ed, #ecb978);
  161. color: #6e3009;
  162. }
  163. .a1 {
  164. font-size: 32rpx;
  165. line-height: 38rpx;
  166. font-family: PingFang SC, PingFang SC-Heavy, serif;
  167. font-weight: 800;
  168. text-align: left;
  169. color: #333333;
  170. margin-left: 98rpx;
  171. margin-bottom: 12rpx;
  172. }
  173. .a2 {
  174. font-size: 28rpx;
  175. font-family: PingFang SC, PingFang SC-Regular;
  176. font-weight: 400;
  177. text-align: left;
  178. color: #a5a5a5;
  179. margin-left: 98rpx;
  180. }
  181. .a3 {
  182. width: 100%;
  183. height: 120rpx;
  184. }
  185. .a4 {
  186. width: 556rpx;
  187. height: 90rpx;
  188. line-height: 90rpx;
  189. background: #f5f5f5;
  190. border-radius: 45rpx;
  191. margin: 0 auto;
  192. }
  193. .left-area {
  194. width: 136rpx;
  195. font-size: 32rpx;
  196. font-family: PingFang SC, PingFang SC-Bold;
  197. font-weight: 700;
  198. text-align: center;
  199. color: #333333;
  200. }
  201. .a4 input {
  202. line-height: 90rpx;
  203. padding: 22rpx 0;
  204. font-size: 32rpx;
  205. font-family: PingFang SC, PingFang SC-Bold;
  206. font-weight: 700;
  207. color: #333333;
  208. }
  209. .a5 {
  210. width: 556rpx;
  211. height: 90rpx;
  212. line-height: 90rpx;
  213. border-radius: 46px;
  214. margin: 60rpx auto;
  215. font-size: 28rpx;
  216. font-family: PingFang SC, PingFang SC-Regular;
  217. font-weight: 400;
  218. text-align: center;
  219. background: linear-gradient(178deg, #ffe6ed, #ecb978);
  220. color: #6e3009;
  221. }
  222. </style>