宜轩到家/服务到家第三版,换个颜色
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.

264 lines
4.9 KiB

8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 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="请输入手机号" v-model="phone"/>
  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. 验证码已发送至{{ phone }}
  23. </view>
  24. <view>
  25. <view class="flex flex-sb" style="padding: 40rpx; width: calc(100% - 80rpx)">
  26. <input v-for="i in 4" class="input-m" type="number"
  27. :class="{active: i === yzmCode.length+1}"
  28. :focus="i === yzmCode.length+1"
  29. :value="yzmCode[i-1]"
  30. @click="clickNum(i)" @input="inputNum" />
  31. </view>
  32. </view>
  33. <view class="b3">
  34. 没收到验证码?<span @click="clickSendCode">重新发送</span>
  35. </view>
  36. <view class="b4" @click="toWxLogin">
  37. 确认登录
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. step: 1,
  47. openid: '',
  48. yzmCode: '',
  49. phone : '',
  50. }
  51. },
  52. onShow() {
  53. // this.getConfig()
  54. // this.code = this.GetQueryString('code');
  55. // if (!this.code) {
  56. // this.getwx_authorize();
  57. // }
  58. },
  59. methods: {
  60. clickCancel(){
  61. uni.switchTab({ url: '/pages/index/index' })
  62. },
  63. clickSendCode(){
  64. this.$api('getVipCode', {
  65. phone : this.phone
  66. }, res => {
  67. if(res.code == 200){
  68. this.step = 2
  69. uni.showToast({
  70. title : '发送成功',
  71. icon : 'none'
  72. })
  73. }
  74. }, '发送中...')
  75. },
  76. clickNum(i){
  77. this.yzmCode = this.yzmCode.substring(0, i-1)
  78. },
  79. inputNum(event){
  80. if (event){
  81. this.yzmCode = this.yzmCode + event.detail.value.toString().substring(0,1)
  82. // if (this.yzmCode.length === 6){
  83. // this.checkCode()
  84. // }
  85. }
  86. },
  87. checkCode(){
  88. this.clickCancel()
  89. },
  90. //微信登录
  91. toWxLogin(code) {
  92. this.$api('wxTechnicianLogin', {
  93. code : this.yzmCode,
  94. phone : this.phone
  95. }, res=> {
  96. if(res.code == 200){
  97. uni.setStorageSync("token", res.result.token)
  98. uni.setStorageSync("userInfo", JSON.stringify(res.result.userInfo))
  99. uni.switchTab({
  100. url: '/pages/index/index'
  101. })
  102. }
  103. }, true)
  104. },
  105. }
  106. }
  107. </script>
  108. <style scoped lang="scss">
  109. .b1{
  110. width: 100%;
  111. height: 56rpx;
  112. font-size: 40rpx;
  113. font-family: PingFang SC, PingFang SC-Heavy;
  114. font-weight: 800;
  115. text-align: center;
  116. color: #333333;
  117. margin-top: 38rpx;
  118. }
  119. .b2{
  120. width: 100%;
  121. height: 40rpx;
  122. font-size: 28rpx;
  123. font-family: PingFang SC, PingFang SC-Regular;
  124. font-weight: 400;
  125. text-align: center;
  126. color: #a5a5a5;
  127. margin-top: 20rpx;
  128. }
  129. .input-m{
  130. width: 146rpx;
  131. // width: 96rpx;
  132. height: 136rpx;
  133. background: #f8f8f8;
  134. border-radius: 16rpx;
  135. line-height: 136rpx;
  136. font-size: 52rpx;
  137. font-family: PingFang SC, PingFang SC-Heavy;
  138. font-weight: 800;
  139. text-align: center;
  140. color: #333333;
  141. }
  142. .input-m.active{
  143. border: 3rpx solid $uni-color;
  144. }
  145. .b3{
  146. font-size: 28rpx;
  147. font-family: PingFang SC, PingFang SC-Regular;
  148. font-weight: 400;
  149. text-align: center;
  150. color: #666666;
  151. }
  152. .b3 span{
  153. color: $uni-color;
  154. }
  155. .b4{
  156. width: 556rpx;
  157. height: 90rpx;
  158. line-height: 90rpx;
  159. border-radius: 46rpx;
  160. background: $uni-bg-color;
  161. color: $uni-color;
  162. font-size: 28rpx;
  163. font-family: PingFang SC, PingFang SC-Regular;
  164. font-weight: 400;
  165. text-align: center;
  166. margin: 94rpx auto;
  167. }
  168. .a1{
  169. font-size: 32rpx;
  170. line-height: 38rpx;
  171. font-family: PingFang SC, PingFang SC-Heavy,serif;
  172. font-weight: 800;
  173. text-align: left;
  174. color: #333333;
  175. margin-left: 98rpx;
  176. margin-bottom: 12rpx;
  177. }
  178. .a2 {
  179. font-size: 28rpx;
  180. font-family: PingFang SC, PingFang SC-Regular;
  181. font-weight: 400;
  182. text-align: left;
  183. color: #a5a5a5;
  184. margin-left: 98rpx;
  185. }
  186. .a3 {
  187. width: 100%;
  188. height: 120rpx;
  189. }
  190. .a4 {
  191. width: 556rpx;
  192. height: 90rpx;
  193. line-height: 90rpx;
  194. background: #f5f5f5;
  195. border-radius: 45rpx;
  196. margin: 0 auto;
  197. }
  198. .left-area{
  199. width: 136rpx;
  200. font-size: 32rpx;
  201. font-family: PingFang SC, PingFang SC-Bold;
  202. font-weight: 700;
  203. text-align: center;
  204. color: #333333;
  205. }
  206. .a4 input{
  207. line-height: 90rpx;
  208. padding: 22rpx 0;
  209. font-size: 32rpx;
  210. font-family: PingFang SC, PingFang SC-Bold;
  211. font-weight: 700;
  212. color: #333333;
  213. }
  214. .a5 {
  215. width: 556rpx;
  216. height: 90rpx;
  217. line-height: 90rpx;
  218. background: $uni-bg-color;
  219. color: $uni-color;
  220. border-radius: 46px;
  221. margin: 60rpx auto;
  222. font-size: 28rpx;
  223. font-family: PingFang SC, PingFang SC-Regular;
  224. font-weight: 400;
  225. text-align: center;
  226. }
  227. </style>