integral.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. // pages/integral/integral.js
  2. import Integralinfo from '../../api/integralinfo'
  3. import {getMobileCache, getPhoneNumberNew as getPhoneNumberSync} from '../../utils/user'
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. lock: false,
  10. noResult: false,
  11. noMore: false,
  12. bannerList: [],
  13. couponList: [],
  14. channelid: '',
  15. shopid: '',
  16. storeid: '',
  17. bodyHidden: true,
  18. bgStatus: false,
  19. scorePhone: false,
  20. animationData: {},
  21. integralIngo:{},
  22. loading: false,
  23. setPhone: '',
  24. current: '',
  25. integralNum: 0,
  26. phone: '********',
  27. // phone: '15888282621',
  28. mobile: '********',
  29. paymentStatus: false,
  30. paymentBgStatus: false,
  31. activeNum: 0,
  32. listTrue: [],
  33. listStatus: false,
  34. total: 0,
  35. row: {},
  36. codeName: '60s后重新获取',
  37. codeTime: '',
  38. active1obj: {
  39. orderId: '',
  40. order_no: '',
  41. step: ''
  42. },
  43. active1code: '',
  44. active2code: '',
  45. tgid: '',
  46. scene: '',
  47. noClick: true,
  48. showToastObj: {
  49. icon: '',
  50. title: '',
  51. status: false
  52. },
  53. stepList:[
  54. {
  55. name:"下单时间",
  56. status:"0"
  57. },
  58. {
  59. name:"支付时间",
  60. status:"0"
  61. },
  62. {
  63. name:"降锁时间",
  64. status:"1"//status步骤条状态。=1表示最后一条渲染不同样式
  65. }
  66. ]
  67. },
  68. /**
  69. * 生命周期函数--监听页面加载
  70. */
  71. onLoad: function (options) {
  72. var reg = /^(\d{3})\d{4}(\d{4})$/;
  73. this.setData({
  74. isLogin: getMobileCache() != '',
  75. phone: getMobileCache() == ''?'********':getMobileCache().replace(reg, "$1****$2"),
  76. setPhone: getMobileCache(),
  77. mobile: getMobileCache(),
  78. })
  79. this.step = this.selectComponent("#step");
  80. },
  81. /**
  82. * 生命周期函数--监听页面初次渲染完成
  83. */
  84. onReady: function () {
  85. },
  86. /**
  87. * 生命周期函数--监听页面显示
  88. */
  89. onShow: function () {
  90. this.getBannerList()
  91. this.getCouponList()
  92. if(getMobileCache() != ''){
  93. this.getphoneClick()
  94. }
  95. },
  96. /**
  97. * 生命周期函数--监听页面隐藏
  98. */
  99. onHide: function () {
  100. },
  101. /**
  102. * 生命周期函数--监听页面卸载
  103. */
  104. onUnload: function () {
  105. },
  106. /**
  107. * 页面相关事件处理函数--监听用户下拉动作
  108. */
  109. onPullDownRefresh: function () {
  110. },
  111. /**
  112. * 页面上拉触底事件的处理函数
  113. */
  114. onReachBottom: function () {
  115. },
  116. /**
  117. * 用户点击右上角分享
  118. */
  119. onShareAppMessage: function () {
  120. },
  121. getBannerList: function() {
  122. Integralinfo.getBannerList({
  123. channelid: this.data.channelid,
  124. shopid: this.data.shopid,
  125. storeid: this.data.storeid
  126. }).then(res => {
  127. console.log(res.data)
  128. this.setData({
  129. bannerList: res.data
  130. })
  131. }).catch(err => {
  132. console.log(err)
  133. })
  134. },
  135. getCouponList: function() {
  136. Integralinfo.getList({
  137. channelid: this.data.channelid,
  138. shopid: this.data.shopid,
  139. storeid: this.data.storeid
  140. }).then(res => {
  141. this.couponListView(res.data)
  142. this.data.lock = false
  143. }).catch(_ => {
  144. console.log(_)
  145. this.data.lock = false
  146. })
  147. },
  148. couponListView: function(data) {
  149. if (!Array.isArray(data) || data.length == 0) {
  150. console.log("优惠券列表数据为空");
  151. }
  152. data.forEach((v) => {
  153. v.quantity = 0
  154. v.integral = v.price * v.ratio
  155. })
  156. let num = this.data.integralNum > 20000 ? 19999 : this.data.integralNum
  157. const arr = []
  158. for (let i = 0; i < data.length; i++) {
  159. data[i].quantity = parseInt(num / data[i].integral)
  160. if (data[i].quantity > 0) {
  161. num -= (data[i].quantity * data[i].price) * data[i].ratio
  162. this.data.total += (data[i].quantity * data[i].price) * data[i].ratio
  163. this.setData({
  164. total:this.data.total
  165. })
  166. arr.push(data[i])
  167. data.splice(i, 1)
  168. i--
  169. }
  170. }
  171. this.setData({
  172. couponList: [...arr, ...data]
  173. })
  174. console.log(this.data.couponList)
  175. },
  176. // 点击标识点触发
  177. detailsClick(row) {
  178. this.hideModal();
  179. this.row = row.currentTarget.dataset.info
  180. console.log(this.row)
  181. if (this.row.detail_type === 0) {
  182. this.row.detailArr = this.row.detail.split('\n')
  183. } else {
  184. this.row.detailArr = row.detail
  185. }
  186. this.setData({
  187. integralIngo: this.row,
  188. })
  189. console.log(this.data.integralIngo)
  190. setTimeout(() => {
  191. this.showDodal();
  192. }, 100)
  193. },
  194. showDodal() {
  195. var that = this;
  196. // 显示遮罩层
  197. var animation = wx.createAnimation({
  198. duration: 150,
  199. timingFunction: "linear",
  200. delay: 0
  201. })
  202. this.setData({
  203. bgStatus: true,
  204. bodyHidden: false
  205. })
  206. that.animation = animation
  207. animation.translateY(-500).step()
  208. that.setData({
  209. animationData: animation.export()
  210. })
  211. },
  212. //隐藏对话框
  213. hideModal() {
  214. var that = this;
  215. console.log(that.data)
  216. // 隐藏遮罩层
  217. var animation = wx.createAnimation({
  218. duration: 150,
  219. timingFunction: "linear",
  220. delay: 0
  221. })
  222. this.setData({
  223. bodyHidden: true,
  224. bgStatus: false,
  225. scorePhone: false,
  226. })
  227. that.animation = animation
  228. animation.translateY(0).step()
  229. that.setData({
  230. animationData: animation.export()
  231. })
  232. },
  233. /**授权手机号 */
  234. getPhoneNumber(e) {
  235. getPhoneNumberSync(e, async () => {
  236. console.log(e)
  237. if (getMobileCache() == '') {
  238. wx.showToast({
  239. icon:'error',
  240. title:'先查询移动积分'
  241. })
  242. setTimeout(()=>{
  243. that.data.setPhone = ''
  244. that.scoreClick()
  245. wx.hideLoading()
  246. },500)
  247. } else {
  248. var reg = /^(\d{3})\d{4}(\d{4})$/;
  249. this.setData({
  250. isLogin: true,
  251. setPhone: '13816922995',
  252. mobile: '13816922995',
  253. phone: '13816922995'.replace(reg, "$1****$2")
  254. })
  255. // console.log(this.data.setPhone)
  256. // console.log(this.data.mobile)
  257. // console.log(this.data.phone)
  258. this.getphoneClick()
  259. }
  260. })
  261. },
  262. // 查询积分
  263. scoreClick() {
  264. this.setData({
  265. bgStatus: true,
  266. scorePhone: true,
  267. })
  268. },
  269. // 查询积分
  270. getphoneClick() {
  271. console.log(this.data.setPhone)
  272. if (!(/^1[3456789]\d{9}$/.test(this.data.setPhone))) {
  273. wx.showToast({
  274. title: '填写正确手机号',
  275. icon: 'error',
  276. duration: 2000
  277. });
  278. } else if (this.data.setPhone != '') {
  279. // wx.showLoading({
  280. // title: '加载中'
  281. // });
  282. Integralinfo.getBalance({
  283. mobile: '13816922995',
  284. callbackUrl: '../integral/integral.wxml',
  285. fingerprint: '',
  286. sessionid: '',
  287. shopid: 2,
  288. type: 'wx',
  289. }).then(arr => {
  290. console.log(arr)
  291. wx.hideLoading();
  292. if (arr.code === '0000') {
  293. var reg = /^(\d{3})\d{4}(\d{4})$/;
  294. this.setData({
  295. integralNum: arr.data,
  296. setPhone: '13816922995',
  297. phone: this.data.setPhone.replace(reg, "$1****$2"),
  298. })
  299. // this.data.integralNum = arr.data
  300. // var reg = /^(\d{3})\d{4}(\d{4})$/;
  301. // this.data.mobile = this.data.setPhone
  302. // this.data.setPhone = this.data.setPhone.replace(reg, "$1****$2");
  303. let response = {
  304. points: arr.data,
  305. outTokenId: this.data.setPhone + '_out'
  306. }
  307. // App.globalData.AppShow = response
  308. this.hideModal()
  309. this.getCouponList()
  310. wx.pageScrollTo({
  311. scrollTop: 0
  312. });
  313. let dateNum = Math.round(new Date().getTime() / 1000).toString()
  314. if (wx.getStorageSync('orderDetails') != '' && this.data.mobile === JSON.parse(wx
  315. .getStorageSync('orderDetails')).mobile) {
  316. if (dateNum - JSON.parse(wx.getStorageSync('orderDetails')).date <= 120) {
  317. const data = JSON.parse(wx.getStorageSync('orderDetails'))
  318. if (dateNum - data.date < 60) {
  319. let time = dateNum - data.date
  320. this.data.codeName = 60 - time + 's后重新获取'
  321. this.codeSetInterval(60 - time)
  322. } else {
  323. this.data.codeName = '重新获取验证码'
  324. }
  325. this.setData({
  326. paymentStatus: true,
  327. paymentBgStatus: true,
  328. active1code: '',
  329. active2code: '',
  330. active1obj: data,
  331. })
  332. if (data.step === 1) {
  333. this.data.activeNum = 1
  334. } else if (data.step === 2) {
  335. this.data.activeNum = 0
  336. }
  337. }
  338. }
  339. } else {
  340. this.setData({
  341. loading: true,
  342. bgStatus: true
  343. })
  344. setTimeout(() => {
  345. // #ifdef H5
  346. window.location.href = arr.message;
  347. // #endif
  348. // #ifdef MP-WEIXIN
  349. const version = wx.getSystemInfoSync().SDKVersion
  350. if (this.compareVersion(version, '2.20.1') >= 0) {
  351. wx.openEmbeddedMiniProgram({
  352. appId: arr.data.appId,
  353. path: arr.data.path,
  354. extraData: arr.data.extraData,
  355. success(res) {
  356. // 打开成功
  357. },
  358. fail() {}
  359. })
  360. } else {
  361. // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
  362. wx.navigateToMiniProgram({
  363. appId: arr.data.appId,
  364. path: arr.data.path,
  365. extraData: arr.data.extraData,
  366. success(res) {
  367. // 打开成功
  368. },
  369. fail() {
  370. }
  371. })
  372. }
  373. // #endif
  374. this.hideModal()
  375. this.loading = false
  376. }, 4000)
  377. }
  378. })
  379. }
  380. },
  381. // 商品数量减少按钮
  382. reduceClick(e) {
  383. console.log(e.currentTarget.dataset.index)
  384. let index = e.currentTarget.dataset.index
  385. this.data.couponList[index].quantity--
  386. this.data.total -= parseInt(this.data.couponList[index].integral)
  387. this.setData({
  388. total: this.data.total,
  389. couponList: this.data.couponList
  390. })
  391. },
  392. // 商品数量添加按钮
  393. addClick(e) {
  394. let index = e.currentTarget.dataset.index
  395. if (this.data.phone !== '********') {
  396. if (this.data.total + parseInt(this.data.couponList[index].integral) > 20000) {
  397. wx.showToast({
  398. title: '单笔限额两万分',
  399. icon: 'error',
  400. duration: 2000
  401. });
  402. } else if ((this.data.integralNum - this.data.total) >= this.data.couponList[index].integral) {
  403. this.data.couponList[index].quantity++
  404. this.data.total += parseInt(this.data.couponList[index].integral)
  405. this.setData({
  406. total: this.data.total,
  407. couponList:this.data.couponList
  408. })
  409. } else {
  410. wx.showToast({
  411. title: '积分不足',
  412. icon: 'error',
  413. duration: 2000
  414. });
  415. }
  416. } else {
  417. wx.showToast({
  418. title: '先查询移动积分',
  419. icon: 'error',
  420. duration: 1000
  421. });
  422. setTimeout(() => {
  423. this.scoreClick()
  424. }, 1000)
  425. }
  426. },
  427. /** 刷新 */
  428. shuaxinClick() {
  429. Integralinfo.getBalance({
  430. mobile: '13816922995',
  431. callbackUrl: '../integral/integral.wxml',
  432. fingerprint: '',
  433. sessionid: '',
  434. shopid: 2,
  435. type: 'wx',
  436. }).then(arr => {
  437. if (arr.code === '0000') {
  438. wx.hideLoading();
  439. wx.showToast({
  440. title: '查询成功!',
  441. icon: 'success',
  442. duration: 1000
  443. });
  444. var reg = /^(\d{3})\d{4}(\d{4})$/;
  445. this.setData({
  446. integralNum: arr.data,
  447. setPhone: '13816922995',
  448. phone: this.data.setPhone.replace(reg, "$1****$2"),
  449. })
  450. }
  451. })
  452. },
  453. // 支付按钮
  454. paymentClick() {
  455. console.log(this.data.mobile)
  456. if (this.data.mobile === '********') {
  457. setTimeout(() => {
  458. this.scoreClick()
  459. }, 1000)
  460. wx.showToast({
  461. title: '先查询移动积分',
  462. icon: 'error',
  463. duration: 1000
  464. });
  465. } else if (this.data.total === 0) {
  466. wx.showToast({
  467. title: '请选择商品数量',
  468. icon: 'error',
  469. duration: 2000
  470. });
  471. } else {
  472. const data = []
  473. this.data.couponList.forEach(v => {
  474. if (v.quantity > 0) {
  475. data.push({
  476. couponid: v.id,
  477. num: v.quantity,
  478. })
  479. }
  480. })
  481. // let fingerprint = ''
  482. // let sessionid = ''
  483. // // #ifndef MP-WEIXIN
  484. // fingerprint = window.fmOpt
  485. // sessionid = window.sessionId
  486. // // #endif
  487. Integralinfo.getOrder({
  488. fingerprint:'',
  489. list: data,
  490. mobile: this.data.setPhone,
  491. tgid: this.data.tgid,
  492. sessionid:'',
  493. shopid: this.data.shopid
  494. }).then(res => {
  495. if (res.code === '0000') {
  496. this.setData({
  497. codeName: '60s后重新获取',
  498. paymentStatus: true,
  499. paymentBgStatus: true,
  500. active1code: '',
  501. active2code: '',
  502. active1obj:{
  503. orderId: res.data.orderId,
  504. order_no: res.data.order_no,
  505. step: res.data.step,
  506. date: Math.round(new Date().getTime() / 1000).toString(),
  507. mobile: this.data.mobile
  508. },
  509. })
  510. wx.setStorageSync('orderDetails', JSON.stringify(this.data.active1obj))
  511. if (res.data.step === 1) {
  512. this.setData({
  513. activeNum: 1,
  514. })
  515. } else if (res.data.step === 2) {
  516. this.setData({
  517. activeNum: 0,
  518. })
  519. }
  520. this.getPaySend()
  521. this.codeSetInterval(60)
  522. } else {
  523. console.log(res.data.message)
  524. console.log(this.data.integralNum,this.data.mobile,JSON.stringify(data))
  525. // log.error(`${res.data.message}`)
  526. // log.error(`${this.data.integralNum},${this.data.mobile},${JSON.stringify(data)}`)
  527. this.setData({
  528. showToastObj: {
  529. icon: 'iconSueecss',
  530. title: res.data.message,
  531. status: true
  532. }
  533. })
  534. setTimeout(() => {
  535. this.setData({
  536. showToastObj: {
  537. icon: 'iconSueecss',
  538. title: res.data.message,
  539. status: false
  540. }
  541. })
  542. }, 2500)
  543. }
  544. })
  545. }
  546. },
  547. // 步骤按钮
  548. nextCodeClick() {
  549. console.log(this.data.activeNum,this.data.active2code)
  550. if (this.data.activeNum === 1 && this.data.active2code !== '') {
  551. // wx.showLoading({
  552. // title: '兑换中'
  553. // });
  554. // let fingerprint = ''
  555. // let sessionid = ''
  556. // // #ifndef MP-WEIXIN
  557. // fingerprint = window.fmOpt
  558. // sessionid = window.sessionId
  559. // #endif
  560. Integralinfo.getPayOnce({
  561. fingerprint: '',
  562. mobile: this.data.mobile,
  563. optCode: this.data.active2code,
  564. order_no: this.data.active1obj.order_no,
  565. orderId: this.data.active1obj.orderId,
  566. sessionid: '',
  567. shopid: this.data.shopid
  568. }).then(res => {
  569. if (res.code === '0000') {
  570. const obj = {
  571. mobile: this.data.mobile,
  572. channelid: this.data.channelid,
  573. shopid: this.data.shopid,
  574. storeid: this.data.storeid
  575. }
  576. this.data.integralNum -= this.data.total
  577. this.setData({
  578. integralNum: this.data.integralNum,
  579. total: 0,
  580. listStatus: false,
  581. listTrue: [],
  582. })
  583. this.data.couponList.forEach((v)=>{
  584. v.quantity = 0
  585. })
  586. this.setData({
  587. paymentStatus: false,
  588. paymentBgStatus: false,
  589. })
  590. wx.setStorageSync('orderDetails', null)
  591. wx.hideLoading();
  592. wx.navigateTo({
  593. url: '../success/success?row=' + JSON.stringify(obj)
  594. })
  595. } else {
  596. wx.hideLoading();
  597. this.setData({
  598. showToastObj: {
  599. icon: 'iconSueecss',
  600. title: res.message,
  601. status: true
  602. }
  603. })
  604. setTimeout(() => {
  605. this.setData({
  606. showToastObj: {
  607. icon: 'iconSueecss',
  608. title: res.message,
  609. status: false
  610. }
  611. })
  612. }, 2500)
  613. }
  614. });
  615. } else if (this.data.activeNum === 0 && this.data.active1code !== '') {
  616. Integralinfo.getPayOnce({
  617. fingerprint: '',
  618. mobile: this.data.mobile,
  619. optCode: this.data.active1code,
  620. orderId: this.data.active1obj.orderId,
  621. order_no: this.data.active1obj.order_no,
  622. sessionid: '',
  623. shopid: this.data.shopid
  624. }).then(res => {
  625. if (res.code === '0000') {
  626. clearInterval(this.data.codeTime)
  627. this.setData({
  628. active2code: '',
  629. activeNum: this.activeNum++,
  630. codeName: '60s后重新获取',
  631. })
  632. this.codeSetInterval(60)
  633. } else {
  634. this.setData({
  635. showToastObj: {
  636. icon: 'iconSueecss',
  637. title: res.message,
  638. status: true
  639. }
  640. })
  641. setTimeout(() => {
  642. this.setData({
  643. showToastObj: {
  644. icon: 'iconSueecss',
  645. title: res.message,
  646. status: false
  647. }
  648. })
  649. }, 2500)
  650. }
  651. })
  652. } else {
  653. wx.showToast({
  654. icon: 'error',
  655. title: '请填写验证码'
  656. })
  657. }
  658. },
  659. // 短信定时器
  660. codeSetInterval(num) {
  661. console.log(num)
  662. let time = num
  663. this.data.codeTime = setInterval(() => {
  664. if (time <= 1) {
  665. this.setData({
  666. codeName: '重新获取验证码',
  667. })
  668. clearInterval(this.data.codeTime)
  669. } else {
  670. time--
  671. this.setData({
  672. codeName:`${time}s后重新获取`
  673. })
  674. }
  675. }, 1000)
  676. },
  677. getPaySend(){
  678. if (this.data.activeNum === 1) {
  679. console.log('发送短信')
  680. Integralinfo.getPaySend({
  681. order_no: this.data.active1obj.order_no,
  682. mobile: this.data.mobile,
  683. shopid: this.data.shopid,
  684. }).then(res => {
  685. if (res.code === '0000') {
  686. this.setData({
  687. codeName: '60s后重新获取',
  688. })
  689. this.codeSetInterval(60)
  690. } else {
  691. this.setData({
  692. showToastObj: {
  693. icon: 'iconSueecss',
  694. title: res.message,
  695. status: true
  696. }
  697. })
  698. setTimeout(() => {
  699. this.setData({
  700. showToastObj: {
  701. icon: 'iconSueecss',
  702. title: res.message,
  703. status: false
  704. }
  705. })
  706. }, 2500)
  707. }
  708. })
  709. }
  710. },
  711. // 重新获取短信
  712. getCodeClick() {
  713. console.log(this.data.activeNum,this.data.codeName,this.data.active1obj.step)
  714. if ((this.data.activeNum === 1 && this.data.codeName === '重新获取验证码') && this.data.active1obj.step === 1) {
  715. Integralinfo.getSendCmccSms({
  716. orderId: this.data.active1obj.orderId,
  717. mobile: this.data.mobile,
  718. shopid: this.data.shopid
  719. }).then(res => {
  720. if (res.code === '0000') {
  721. this.setData({
  722. codeName: '60s后重新获取',
  723. })
  724. this.codeSetInterval(60)
  725. const obj = this.data.active1obj
  726. obj.date = Math.round(new Date().getTime() / 1000).toString()
  727. wx.setStorageSync('orderDetails', JSON.stringify(obj))
  728. } else {
  729. this.setData({
  730. showToastObj: {
  731. icon: 'iconSueecss',
  732. title: res.message,
  733. status: true
  734. }
  735. })
  736. setTimeout(() => {
  737. this.setData({
  738. showToastObj: {
  739. icon: 'iconSueecss',
  740. title: res.message,
  741. status: false
  742. }
  743. })
  744. }, 2500)
  745. }
  746. });
  747. } else {
  748. if (this.data.activeNum === 0 && this.data.codeName === '重新获取验证码') {
  749. Integralinfo.getSendCmccSms({
  750. orderId: this.data.active1obj.orderId,
  751. mobile: this.data.mobile,
  752. shopid: this.data.shopid
  753. }).then(res => {
  754. if (res.code === '0000') {
  755. this.codeName = '60s后重新获取'
  756. this.codeSetInterval(60)
  757. } else {
  758. this.setData({
  759. showToastObj: {
  760. icon: 'iconSueecss',
  761. title: res.message,
  762. status: true
  763. }
  764. })
  765. setTimeout(() => {
  766. this.setData({
  767. showToastObj: {
  768. icon: 'iconSueecss',
  769. title: res.message,
  770. status: false
  771. }
  772. })
  773. }, 2500)
  774. }
  775. });
  776. } else if (this.data.activeNum === 1 && this.data.codeName === '重新获取验证码') {
  777. console.log('短信')
  778. Integralinfo.getPaySend({
  779. order_no: this.data.active1obj.order_no,
  780. mobile: this.data.mobile,
  781. shopid: this.data.shopid,
  782. }).then(res => {
  783. if (res.code === '0000') {
  784. this.setData({
  785. codeName: '60s后重新获取',
  786. })
  787. this.codeSetInterval(60)
  788. } else {
  789. this.setData({
  790. showToastObj: {
  791. icon: 'iconSueecss',
  792. title: res.message,
  793. status: true
  794. }
  795. })
  796. setTimeout(() => {
  797. this.setData({
  798. showToastObj: {
  799. icon: 'iconSueecss',
  800. title: res.message,
  801. status: false
  802. }
  803. })
  804. }, 2500)
  805. }
  806. });
  807. }
  808. }
  809. },
  810. })