index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="page flex-row justify-center" :style="{'width':sysWidth,'height':sysHeight}">
  3. <view class="content">
  4. <swiper :style="{'height':sysHeight}" :duration="0" :current="pageIndex">
  5. <swiper-item @touchmove.stop>
  6. <view class="flex-row justify-center">
  7. <image class="stepImg" src="/static/me/step1.png"></image>
  8. </view>
  9. <u--form labelPosition="top" :model="userInfo" :rules="rules" ref="uForm" :labelStyle="labelStyle">
  10. <view class="flex-row justify-center">
  11. <view class="formView flex-col justify-around">
  12. <view>
  13. <u-form-item labelWidth="auto" label="老系统手机号" prop="phone" borderBottom>
  14. <u--input v-model="userInfo.phone" border="none" placeholder="填写老系统电话"></u--input>
  15. </u-form-item>
  16. </view>
  17. <view>
  18. <u-form-item labelWidth="auto" label="老系统会员姓名" prop="memberName" borderBottom>
  19. <u--input v-model="userInfo.memberName" border="none" placeholder="填写姓名"></u--input>
  20. </u-form-item>
  21. </view>
  22. <view>
  23. <u-form-item labelWidth="auto" label="当前手机号" prop="phonenumber" borderBottom>
  24. <u--input v-model="userInfo.phonenumber" border="none" placeholder="填写当前手机号"></u--input>
  25. </u-form-item>
  26. </view>
  27. <view>
  28. <u-form-item labelWidth="auto" label="验证码" prop="smsCode">
  29. <view class="flex-row">
  30. <u--input v-model="userInfo.smsCode" border="none" placeholder="请输入验证码"></u--input>
  31. <view class="flex-col justify-center" @click="getCode">{{tips}}</view>
  32. </view>
  33. </u-form-item>
  34. </view>
  35. </view>
  36. </view>
  37. </u--form>
  38. <view class="flex-row justify-center">
  39. <view class="selectButton" @click="selectUserMsg">
  40. <text>查询</text>
  41. </view>
  42. </view>
  43. <u-code ref="uCode" @change="codeChange" seconds="60" @start="disabled1 = true" @end="disabled1 = false"></u-code>
  44. </swiper-item>
  45. <swiper-item @touchmove.stop>
  46. <scroll-view scroll-y="true" class="scroll-Y" :style="{'height':scrollHeight}">
  47. <view class="flex-row justify-center">
  48. <image class="stepImg" src="/static/me/step2.png"></image>
  49. </view>
  50. <view class="flex-row justify-center">
  51. <view class="userMsg flex-col justify-around">
  52. <view class="flex-row"><text class="key">会员姓名</text><text class="value">张三</text></view>
  53. <view class="flex-row"><text class="key">手机号码</text><text class="value">17365224542</text></view>
  54. <view class="flex-row"><text class="key">会员卡号</text><text class="value">SSS000001</text></view>
  55. <view class="flex-row"><text class="key">会员编号</text><text class="value">SSS000001</text></view>
  56. <view class="flex-row"><text class="key">积分</text><text class="value">366666</text></view>
  57. <view class="flex-row"><text class="key">账户余额</text><text class="value">¥22222</text></view>
  58. <view class="flex-row"><text class="key">赠送余额</text><text class="value">¥22222</text></view>
  59. </view>
  60. </view>
  61. <view class="list" :style="{'height':scrollHeight}">
  62. <view class="flex-row justify-center">
  63. <view class="flex-row justify-center recordView">
  64. <view :class="recordIndex === 0? 'selectRecord':'record'" @click="clickRecord(0)">
  65. <text>充值记录</text>
  66. </view>
  67. <view :class="recordIndex === 1? 'selectRecord':'record'" @click="clickRecord(1)">
  68. <text>消费记录</text>
  69. </view>
  70. </view>
  71. </view>
  72. <swiper :style="{'height':swiperHeight}" :current="recordIndex"
  73. @change="recordSwiperChange">
  74. <swiper-item v-for="(item,index) in 2" :key="index">
  75. <mescroll-item ref="MescrollItem" :i="index" :index="recordIndex"
  76. :height="swiperHeight">
  77. </mescroll-item>
  78. </swiper-item>
  79. </swiper>
  80. </view>
  81. </scroll-view>
  82. <view class="step2Button flex-row">
  83. <view class="last" @click="lastStep"><text>上一步</text></view>
  84. <view class="next" @click="migration"><text>下一步</text></view>
  85. </view>
  86. </swiper-item>
  87. <swiper-item @touchmove.stop>
  88. <view class="flex-row justify-center">
  89. <image class="stepImg" src="/static/me/step3.png"></image>
  90. </view>
  91. <view class="flex-row justify-center">
  92. <image class="successImg" src="/static/me/success.png"></image>
  93. </view>
  94. <view class="flex-row justify-center successText">
  95. <text>账户迁移成功</text>
  96. </view>
  97. <view class="flex-row justify-center ">
  98. <view class="endButton" @click="migrationEnd">
  99. <text>确认</text>
  100. </view>
  101. </view>
  102. </swiper-item>
  103. </swiper>
  104. </view>
  105. </view>
  106. </template>
  107. <script>
  108. import MescrollItem from "./module/mescrollUni-item.vue";
  109. export default {
  110. components: {
  111. MescrollItem
  112. },
  113. data() {
  114. return {
  115. pageIndex: 0,
  116. sysWidth: '',
  117. sysHeight: '',
  118. scrollHeight: '',
  119. swiperHeight: '',
  120. recordIndex: 0,
  121. userInfo: {},
  122. labelStyle: {
  123. fontSize: '28rpx',
  124. color: '#333333',
  125. fontWeight: 'bold'
  126. },
  127. tips: '',
  128. rules: {
  129. phone: {
  130. type: 'string',
  131. required: true,
  132. message: '请输入11位电话号码',
  133. trigger: ['blur', 'change']
  134. },
  135. memberName: {
  136. type: 'string',
  137. min: 1,
  138. required: true,
  139. message: '请输入名字',
  140. trigger: ['blur', 'change']
  141. },
  142. phonenumber: {
  143. type: 'string',
  144. min: 11,
  145. max: 11,
  146. required: true,
  147. message: '请输入11位电话号码',
  148. trigger: ['blur', 'change']
  149. },
  150. smsCode: {
  151. type: 'string',
  152. min: 4,
  153. max: 6,
  154. required: true,
  155. message: '请输入验证码',
  156. trigger: ['blur', 'change']
  157. },
  158. },
  159. };
  160. },
  161. onLoad() {
  162. let sysInfo = uni.getSystemInfoSync()
  163. this.sysWidth = sysInfo.windowWidth + 'px'
  164. this.sysHeight = sysInfo.windowHeight + 'px'
  165. this.scrollHeight = sysInfo.windowHeight - (sysInfo.windowWidth / 750) * 132 + 'px'
  166. this.swiperHeight = (750 / sysInfo.windowWidth) * sysInfo.windowHeight - 80 - 132 + 'rpx'
  167. },
  168. methods: {
  169. selectUserMsg() {
  170. //查询个人信息 todo
  171. this.pageIndex = 1
  172. },
  173. lastStep() {
  174. this.pageIndex = 0
  175. },
  176. migration() {
  177. //数据迁移 todo
  178. this.pageIndex = 2
  179. },
  180. migrationEnd() {
  181. uni.switchTab({
  182. url: '/pages/my/index'
  183. })
  184. },
  185. recordSwiperChange(e) {
  186. this.recordIndex = e.detail.current
  187. },
  188. clickRecord(num) {
  189. this.recordIndex = num
  190. },
  191. codeChange(text) {
  192. this.tips = text;
  193. },
  194. getCode() {
  195. if (this.$refs.uCode.canGetCode) {
  196. // 模拟向后端请求验证码
  197. uni.showLoading({
  198. title: '正在获取验证码'
  199. })
  200. setTimeout(() => {
  201. uni.hideLoading();
  202. // 这里此提示会被this.start()方法中的提示覆盖
  203. uni.$u.toast('验证码已发送');
  204. // 通知验证码组件内部开始倒计时
  205. this.$refs.uCode.start();
  206. }, 2000);
  207. } else {
  208. uni.$u.toast('倒计时结束后再发送');
  209. }
  210. },
  211. }
  212. };
  213. </script>
  214. <style scoped lang="scss">
  215. @import './index.rpx.scss';
  216. </style>