index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <template>
  2. <view class="container">
  3. <view class="step-bar">
  4. <view>
  5. <view class="h-num">
  6. <view class="head-ball"
  7. :style="currentStep == 0 ? 'background-color: #fbe362;':'background-color: #91d224;color:#FFFFFF' ">
  8. <text>1</text>
  9. </view>
  10. </view>
  11. <view class="">账号查询</view>
  12. </view>
  13. <view>
  14. <u-icon name="more-dot-fill" color="#cccccc" size="28"></u-icon>
  15. </view>
  16. <view>
  17. <view class="h-num">
  18. <view class="head-ball"
  19. :style="currentStep == 1 ? 'background-color: #fbe362;':(currentStep == 0? 'background-color: #FFFFFF' :'background-color: #91d224;color:#FFFFFF' ) ">
  20. <text>2</text>
  21. </view>
  22. </view>
  23. <view class="">信息确认</view>
  24. </view>
  25. <view>
  26. <u-icon name="more-dot-fill" color="#cccccc" size="28"></u-icon>
  27. </view>
  28. <view>
  29. <view class="h-num">
  30. <view class="head-ball" :style="currentStep == 2 ? 'background-color: #fbe362;':'background-color: #FFFFFF' ">
  31. <text>3</text>
  32. </view>
  33. </view>
  34. <view class="">账号迁移</view>
  35. </view>
  36. </view>
  37. <view class="form">
  38. <view v-if="currentStep === 0" class="h-content-wrap">
  39. <u--form labelPosition="top" :model="userInfo" :rules="rules" ref="form1">
  40. <u-form-item labelWidth="auto" labelAlign="right" label="老系统手机号" prop="phone">
  41. <u--input v-model="userInfo.phone" disabledColor="#ffffff" placeholder="填写老系统电话" border="bottom"
  42. maxlength="11"></u--input>
  43. </u-form-item>
  44. <!-- <u-form-item label="老系统会员姓名" prop="memberName" labelPosition="top" labelWidth="auto" labelAlign="right">-->
  45. <!-- <u&#45;&#45;input v-model="userInfo.memberName" disabledColor="#ffffff" placeholder="填写姓名" border="bottom"-->
  46. <!-- maxlength="16"></u&#45;&#45;input>-->
  47. <!-- </u-form-item>-->
  48. <!-- <u-form-item label="当前手机号" prop="phonenumber" labelWidth="auto" labelAlign="right">-->
  49. <!-- <u&#45;&#45;input v-model="userInfo.phonenumber" disabledColor="#ffffff" placeholder="填写当前手机号"-->
  50. <!-- border="bottom" maxlength="11"></u&#45;&#45;input>-->
  51. <!-- </u-form-item>-->
  52. <u-form-item labelWidth="auto" labelAlign="right" label="验证码" prop="smsCode" width="120">
  53. <u--input v-model="userInfo.smsCode" disabledColor="#ffffff" placeholder="请输入验证码" border="bottom"
  54. maxlength="6"></u--input>
  55. <template #right>
  56. <view class="identifying-code">
  57. <u-code ref="uCode2" @change="codeChange2" keep-running start-text="获取验证码"></u-code>
  58. <text @tap="getCode2" :text="tips2" class="u-page__code-text">{{ tips2 }}</text>
  59. </view>
  60. </template>
  61. </u-form-item>
  62. </u--form>
  63. </view>
  64. <view v-if="currentStep === 1">
  65. <view class="h-content">
  66. <view class="h-basic-info">
  67. <view class="h-value">
  68. <view class="h-name">会员编号</view>
  69. <view class="h-text">{{ userMemberInfo.memberNo }}</view>
  70. <view v-if="userMemberInfo.isCommit" style="color: red">(已找回)</view>
  71. </view>
  72. <view class="h-value">
  73. <view class="h-name">开卡店铺</view>
  74. <view class="h-text">{{ userMemberInfo.store }}</view>
  75. </view>
  76. <view class="h-value">
  77. <view class="h-name">会员姓名</view>
  78. <view class="h-text">{{ userMemberInfo.memberName }}</view>
  79. </view>
  80. <view class="h-value">
  81. <view class="h-name">手机号码</view>
  82. <view class="h-text">{{ userMemberInfo.phone }}</view>
  83. </view>
  84. <view class="h-value">
  85. <view class="h-name">积分</view>
  86. <view class="h-text">{{ userMemberInfo.integral }}</view>
  87. </view>
  88. <view class="h-value">
  89. <view class="h-name">账户余额</view>
  90. <view class="h-text">¥{{ userMemberInfo.nowBalance }}</view>
  91. </view>
  92. </view>
  93. <view class="h-record">
  94. <!-- 导航-->
  95. <view class="service-order-tab-bar">
  96. <view class="service-order-tab-item" :class="{ active: currentServiceTab === 'orderTab1' }"
  97. @click="changeServiceTab('orderTab1')">
  98. <text :class="{ underline: currentServiceTab === 'orderTab1' }">充值记录</text>
  99. </view>
  100. <view class="service-order-tab-item" :class="{ active: currentServiceTab === 'orderTab2' }"
  101. @click="changeServiceTab('orderTab2')">
  102. <text :class="{ underline: currentServiceTab === 'orderTab2' }">消费记录</text>
  103. </view>
  104. </view>
  105. <view class="custom-line"></view>
  106. <!-- order -->
  107. <view v-if="currentServiceTab == 'orderTab1' " class="store-order-wrap">
  108. <view v-for="(item, index) in memberInfoRecords" class="store-order">
  109. <view class="h-content">
  110. <view class="h-row">
  111. <view class="h-value">
  112. <text>储值记录</text>
  113. </view>
  114. <view class="h-value">
  115. <text>+ ¥{{ item.rechargeAmount }}</text>
  116. </view>
  117. </view>
  118. <view class="h-row">
  119. <view class="h-value">
  120. <text class="h-text">{{ item.rechargeTime }}</text>
  121. </view>
  122. <view class="h-value h-name">
  123. <text class="h-text">账户余额:¥{{ item.nowBalance }}</text>
  124. </view>
  125. </view>
  126. </view>
  127. <view class="custom-line"></view>
  128. </view>
  129. </view>
  130. <view v-if="currentServiceTab == 'orderTab2'" class="store-order-wrap">
  131. <view v-for="(item, index) in memberInfoRecords" class="store-order">
  132. <view class="h-content">
  133. <view class="h-row">
  134. <view class="h-value">
  135. <text>消费记录</text>
  136. </view>
  137. <view class="h-value">
  138. <text>- ¥{{ item.consumeAmount }}</text>
  139. </view>
  140. </view>
  141. <view class="h-row">
  142. <view class="h-value">
  143. <text class="h-text">{{ item.consumeTime }}</text>
  144. </view>
  145. <!-- <view class="h-value h-name">-->
  146. <!-- <text class="h-text">账户余额:¥{{ item.nowBalance }}</text>-->
  147. <!-- </view>-->
  148. </view>
  149. </view>
  150. <view class="custom-line"></view>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <view v-if="currentStep === 2" class="">
  158. <view class="h-content-step-end">
  159. <view class="h-success">
  160. <u-icon name="checkmark" color="#5dac17" size="70"></u-icon>
  161. </view>
  162. <view class="h-name">
  163. <text>账户迁移成功</text>
  164. </view>
  165. <view @click="nextStep(3)" class="h-btn">
  166. <text>确认</text>
  167. </view>
  168. </view>
  169. </view>
  170. <view v-if="currentStep == 0" class="button-group">
  171. <!-- <button @click="prevStep" :disabled="currentStep === 0">上一步</button> -->
  172. <button class="h-btn" @click="nextStep(1)" :disabled="currentStep === steps.length - 1">查询</button>
  173. </view>
  174. <view v-if="currentStep == 1" class="button-group">
  175. <button class="h-btn" style="background-color: #EEEEEE;width: 240rpx" @click="prevStep"
  176. :disabled="currentStep === 0">上一步
  177. </button>
  178. <view class="h-btn" v-if="isCommit == 0" @click="nextStep(2)" :disabled="currentStep === steps.length - 1">
  179. <text>确认并迁移</text>
  180. </view>
  181. </view>
  182. <!-- 会员编号弹窗 -->
  183. <view>
  184. <uni-popup ref="popup" :isMaskClick="false">
  185. <view class="popup-content">
  186. <view style="text-align: center">
  187. <text class="text">选择会员编号</text>
  188. </view>
  189. <view v-for="item in numberList">
  190. <view class="popupItem" :class="{'popupItemSelect':item.isSelect == true }" @click="SelectItem(item)"
  191. :style="item.isCommit == 1?'background-color: #93D21A;color:#FFFFFF': null">
  192. <view>
  193. <text>{{ item.memberNo }}</text>
  194. </view>
  195. <view style="width:100rpx">
  196. <text v-if="item.isCommit == 1 " style="text-align: right">已找回</text>
  197. </view>
  198. </view>
  199. </view>
  200. <view class="button-popup">
  201. <button class="h-btn" style="background-color: #EEEEEE;" @click="this.$refs.popup.close()">取消</button>
  202. <view class="h-btn" style="background-color: #FFE05C;" @click="nextStep(0)"
  203. :disabled="currentStep === steps.length - 1">
  204. <text>确定</text>
  205. </view>
  206. </view>
  207. </view>
  208. </uni-popup>
  209. </view>
  210. <!-- 确认迁移弹框 -->
  211. <uni-popup ref="popupMigrate" :isMaskClick="false">
  212. <view class="popup-content">
  213. <view style="text-align: center">
  214. <view class="text">当前会员编号为{{ storageUserInfo.no }}</view>
  215. <text class="text">是否确认找回到该账号下?</text>
  216. </view>
  217. <view style="height:10px"></view>
  218. <view class="button-popup">
  219. <button class="h-btn" style="background-color: #EEEEEE;" @click="popupClose()">取消</button>
  220. <view class="h-btn" style="background-color: #FFE05C;" @click="nextStep(4)"
  221. :disabled="currentStep === steps.length - 1">
  222. <text>确定</text>
  223. </view>
  224. </view>
  225. </view>
  226. </uni-popup>
  227. </view>
  228. </template>
  229. <script>
  230. import signature from '../components/sign/sign';
  231. export default {
  232. components: {
  233. signature
  234. },
  235. data() {
  236. return {
  237. isCommit: 0,
  238. isSelect: false,
  239. isShow: true,
  240. isMigrateClick: false,
  241. showCanvas: false,
  242. numberList: [],
  243. currentStep: 0,
  244. steps: ['账户查询', '信息确认', '账户迁移'], // 步骤条的文字内容
  245. step1Value: '',
  246. step2Value: '',
  247. step3Value: '',
  248. userInfo: {
  249. auth: true,
  250. phone: '',
  251. // memberName: '赵梓熠-测试',
  252. // phonenumber: '18231041846',
  253. smsCode: '',
  254. memberNo: "",
  255. type: 7,
  256. requstForm: true
  257. },
  258. userMemberInfo: {
  259. memberNo: "string",
  260. pingYinCode: "string",
  261. memberName: "string",
  262. integral: 0,
  263. sex: 0,
  264. birthday: "string",
  265. phone: "string",
  266. memberPassword: "string",
  267. height: "string",
  268. weight: "string",
  269. memberCard: "string",
  270. address: "string",
  271. nowBalance: 0,
  272. totalConsumeAmount: 0,
  273. debt: 0,
  274. remarks: "string",
  275. joinTime: "string",
  276. memberStatus: 0,
  277. referencesNo: "string",
  278. consumeCycle: "string",
  279. otherInfo: "string",
  280. photoUrl: "string"
  281. },
  282. memberInfoRecords: [{
  283. orderNo: "string",
  284. memberNo: "string",
  285. memberName: "string",
  286. phone: "string",
  287. consumeAmount: 0,
  288. realPayAmount: 0,
  289. profit: 0,
  290. integral: 0,
  291. remainDebt: 0,
  292. consumeTime: "string",
  293. remarks: "string",
  294. consumeStore: "string",
  295. consumeType: "string",
  296. discountAmount: 0,
  297. bedName: "string",
  298. payInfo: "string",
  299. memberStore: "string",
  300. payType: "string"
  301. }],
  302. show: false,
  303. currentTab: 'tab1', // 当前选中的 Tab
  304. currentServiceTab: 'orderTab1', // 当前选中的 Tab
  305. defaultColor: '#CCCCCC',
  306. currentColor: '#FF0000',
  307. completedColor: '#00FF00',
  308. content: '一、本人所提供的个人信息 证明材料、证件',
  309. signType: '',
  310. signImg1: '',
  311. tips2: '',
  312. storageUserInfo:{},
  313. rules: {
  314. phone: [
  315. {
  316. required: true,
  317. min: 10,
  318. max: 12,
  319. message: '请输入11位电话号码',
  320. trigger: ['blur', 'change'],
  321. },
  322. {
  323. // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
  324. validator: (rule, value, callback) => {
  325. // 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
  326. return !this.$isDataEmpty(value);
  327. },
  328. message: "请认真填写电话号码",
  329. trigger: ['blur', 'change'],
  330. }
  331. ],
  332. memberName: [
  333. {
  334. required: true,
  335. message: '请输入名字',
  336. trigger: ['blur', 'change'],
  337. },
  338. ],
  339. phonenumber: [
  340. {
  341. required: true,
  342. min: 10,
  343. max: 12,
  344. message: '请输入11位电话号码',
  345. trigger: ['blur', 'change'],
  346. },
  347. {
  348. // 此为同步验证,可以直接返回true或者false,如果是异步验证,稍微不同,见下方说明
  349. validator: (rule, value, callback) => {
  350. // 调用uView自带的js验证规则,详见:https://www.uviewui.com/js/test.html
  351. return !this.$isDataEmpty(value);
  352. },
  353. message: "请认真填写电话号码",
  354. trigger: ['blur', 'change'],
  355. }
  356. ],
  357. smsCode: {
  358. required: true,
  359. min: 4,
  360. max: 6,
  361. message: '请认真填写验证码',
  362. trigger: ['blur', 'change'],
  363. },
  364. },
  365. };
  366. },
  367. computed: {
  368. itemObject(num) {
  369. return (num) => ({
  370. backgroundColor: item.background,
  371. gridColumnStart: item.columnStart,
  372. gridColumnEnd: item.columnEnd,
  373. gridRowStart: item.rowStart,
  374. gridRowEnd: item.rowEnd
  375. })
  376. }
  377. },
  378. onLoad() {
  379. // 用户信息
  380. this.storageUserInfo = uni.getStorageSync('userInfo')
  381. // 获取服务条款数据
  382. // this.getTermOfServiceByType();
  383. // this.$refs.popupMigrate.open()
  384. },
  385. onUnload() {
  386. if (this.timer) {
  387. clearTimeout(this.timer);
  388. this.timer = null;
  389. }
  390. },
  391. onReady() {
  392. this.$refs.form1.setRules(this.rules)
  393. },
  394. methods: {
  395. popupClose(){
  396. this.$refs.popupMigrate.close()
  397. },
  398. SelectItem(data) {
  399. this.isSelect = true
  400. this.userMemberInfo = data
  401. console.log(this.userMemberInfo, '33333333')
  402. this.isCommit = this.userMemberInfo.isCommit
  403. this.numberList.forEach(e => {
  404. e.isSelect = false
  405. })
  406. data.isSelect = true
  407. },
  408. // 关闭签名框
  409. closeCanvas() {
  410. this.showCanvas = false;
  411. },
  412. // 选择签名类型
  413. personSing(type) {
  414. this.showCanvas = true;
  415. this.signType = type;
  416. },
  417. // 保存签名信息
  418. saveCanvasImg(path) {
  419. console.log(path)
  420. let that = this;
  421. uni.uploadFile({
  422. url: this.$host + '/resource/oss/upload', //仅为示例,非真实的接口地址
  423. filePath: path,
  424. name: 'file',
  425. header: {
  426. 'Authorization': 'Bearer ' + that.$store.state.loginState.accessToken,
  427. },
  428. success: (uploadFileRes) => {
  429. let res = JSON.parse(uploadFileRes.data)
  430. console.log(res)
  431. that.showCanvas = false;
  432. }
  433. });
  434. },
  435. codeChange2(text) {
  436. this.tips2 = text;
  437. },
  438. getCode2() {
  439. if (this.$refs.uCode2.canGetCode) {
  440. this.getSmsCode();
  441. } else {
  442. uni.$u.toast('倒计时结束后再发送');
  443. }
  444. },
  445. // 获取手机验证码
  446. getSmsCode() {
  447. // 模拟向后端请求验证码
  448. uni.showLoading({
  449. title: '正在获取验证码'
  450. })
  451. this.$api.getSmsCodeByType({phonenumber: this.userInfo.phone, auth: true, type: 1}).then((res) => {
  452. uni.hideLoading();
  453. // 这里此提示会被this.start()方法中的提示覆盖
  454. uni.$u.toast('验证码已发送');
  455. // 通知验证码组件内部开始倒计时
  456. this.$refs.uCode2.start();
  457. }).catch(() => {
  458. uni.showToast({
  459. title: "操作失败"
  460. })
  461. });
  462. },
  463. getStepClass(index) {
  464. if (index < this.currentStep) {
  465. return 'step';
  466. } else if (index === this.currentStep) {
  467. return ['step', 'active'];
  468. } else {
  469. return ['step', 'default'];
  470. }
  471. },
  472. // 查询老会员系统数据
  473. getOldMember() {
  474. this.$api.getOldMember(this.userInfo).then(res => {
  475. console.log(res.data.data.length, '5555555555')
  476. if (res.data.data.length != 0) {
  477. if (res.data.data.length === 1) {
  478. this.numberList = res.data.data
  479. console.log(this.numberList, '1111111')
  480. this.userMemberInfo = res.data.data[0]
  481. this.isCommit = res.data.data[0].isCommit
  482. console.log(this.isCommit, '9999999999')
  483. if (this.currentStep < this.steps.length - 1) {
  484. this.currentStep++;
  485. this.getOrderRechargeOldList()
  486. }
  487. } else {
  488. this.$refs.popup.open()
  489. this.numberList = res.data.data
  490. const newArr = []
  491. this.numberList.map((item) => {
  492. newArr.push(Object.assign(item, {isSelect: false}))
  493. })
  494. this.numberList = newArr
  495. }
  496. } else {
  497. uni.$u.toast('未查询到数据');
  498. }
  499. // // 查询充值记录
  500. // this.getOrderRechargeOldList();
  501. //
  502. // this.timer = setTimeout(() => {
  503. // if (this.currentStep < this.steps.length - 1) {
  504. // this.currentStep++;
  505. // }
  506. // }, 0)
  507. }).catch((res) => {
  508. uni.showToast({
  509. title: "操作失败"
  510. })
  511. });
  512. },
  513. // 查询会员消费记录
  514. getOrderConsumeLogOld() {
  515. this.$api.getOrderConsumeLogOld(this.userMemberInfo).then((res) => {
  516. this.memberInfoRecords = res.data.data;
  517. }).catch(() => {
  518. uni.showToast({
  519. title: "操作失败"
  520. })
  521. });
  522. },
  523. // 查询叶会员充值记录
  524. getOrderRechargeOldList() {
  525. this.$api.getOrderRechargeOldList(this.userMemberInfo).then((res) => {
  526. this.memberInfoRecords = res.data.data;
  527. }).catch(() => {
  528. uni.showToast({
  529. title: "操作失败"
  530. })
  531. });
  532. },
  533. // 提交保存
  534. submitOldData() {
  535. console.log(this.userInfo.memberNo)
  536. // this.userInfo.memberNo = '18902'
  537. this.$api.submitOldData(this.userMemberInfo).then(res => {
  538. console.log(res)
  539. if (this.currentStep < this.steps.length - 1) {
  540. this.currentStep++;
  541. }
  542. }).catch((res) => {
  543. console.log(res.msg)
  544. uni.showToast({
  545. title: res.msg
  546. })
  547. });
  548. },
  549. open() {
  550. },
  551. nextStep(idx) {
  552. if (idx == 0) { // 点击确认
  553. console.log(this.userInfo.phone)
  554. if (this.isSelect === true) {
  555. this.$refs.popup.close()
  556. // this.getOldMember();
  557. if (this.currentServiceTab == 'orderTab1') {
  558. this.getOrderRechargeOldList()
  559. } else {
  560. this.getOrderConsumeLogOld();
  561. }
  562. if (this.currentStep < this.steps.length - 1) {
  563. this.currentStep++;
  564. }
  565. } else {
  566. uni.showToast({
  567. icon: 'none',
  568. duration: 3000,
  569. title: '请选择会员编号'
  570. });
  571. }
  572. }
  573. if (idx == 1) { // 点击查询数据
  574. const userInfo = uni.getStorageSync('userInfo')
  575. // console.log(userInfo,'绑定手机号')
  576. if (!userInfo.phone) {
  577. uni.showModal({
  578. title: '温馨提示',
  579. content: '资产找回涉及资金安全,需绑定手机号才能进行查询,是否确认绑定手机号',
  580. success: res => {
  581. if (res.confirm) {
  582. uni.navigateTo({
  583. url: '/myPages/setting/setting-telphone',
  584. })
  585. }
  586. }
  587. })
  588. return
  589. }
  590. this.$refs.form1.validate().then(res => {
  591. this.getOldMember();
  592. }).catch(errors => {
  593. uni.$u.toast('校验失败,请认真填写')
  594. })
  595. }
  596. if (idx == 2) { // 用户签名确认
  597. this.$refs.popupMigrate.open()
  598. }
  599. if (idx == 3) { // 迁移成功,重新设置用户数据
  600. uni.redirectTo({
  601. url: '/myPages/rechargeRecord/index',
  602. })
  603. }
  604. if (idx == 4) {
  605. this.submitOldData();
  606. this.$refs.popupMigrate.close()
  607. }
  608. },
  609. prevStep() {
  610. if (this.currentStep > 0) {
  611. this.currentStep--;
  612. }
  613. },
  614. changeTab(tab) {
  615. this.currentTab = tab;
  616. },
  617. // 服务订单
  618. changeServiceTab(tab) {
  619. if (tab == 'orderTab1') {
  620. this.getOrderRechargeOldList();
  621. } else if (tab == 'orderTab2') {
  622. this.getOrderConsumeLogOld();
  623. }
  624. this.currentServiceTab = tab;
  625. },
  626. }
  627. };
  628. </script>
  629. <style scoped lang="scss">
  630. @import './index.rpx.scss';
  631. </style>