faceDetectionDetails.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // pages/faceDetectionDetails/faceDetectionDetails.js
  2. import {
  3. get,
  4. } from '../../utils/http';
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. man: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220527/invite/man.png',
  11. female: 'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220527/invite/wuman.png',
  12. scheme_list: [],
  13. userInfo: {},
  14. nowTimesIndex: 0,
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. onLoad: function (options) {
  20. this.getInfo()
  21. },
  22. /**
  23. * 生命周期函数--监听页面初次渲染完成
  24. */
  25. onReady: function () {
  26. },
  27. /**
  28. * 生命周期函数--监听页面显示
  29. */
  30. onShow: function () {
  31. },
  32. /**
  33. * 生命周期函数--监听页面隐藏
  34. */
  35. onHide: function () {
  36. },
  37. /**
  38. * 生命周期函数--监听页面卸载
  39. */
  40. onUnload: function () {
  41. },
  42. /**
  43. * 页面相关事件处理函数--监听用户下拉动作
  44. */
  45. onPullDownRefresh: function () {
  46. },
  47. /**
  48. * 页面上拉触底事件的处理函数
  49. */
  50. onReachBottom: function () {
  51. },
  52. /**
  53. * 用户点击右上角分享
  54. */
  55. onShareAppMessage: function () {
  56. },
  57. getInfo() {
  58. get('/v2/api/user/scheme', {}, (res) => {
  59. this.setData({
  60. userInfo: res.data
  61. })
  62. })
  63. },
  64. changeWeek(e) {
  65. this.setData({
  66. nowTimesIndex: e.currentTarget.dataset.index
  67. })
  68. },
  69. beginOrder() {
  70. },
  71. ruleClick: function () {
  72. wx.navigateTo({
  73. url: '/pages/recommendRule/recommendRule?notTrueBtn=true',
  74. })
  75. },
  76. // 去预约
  77. toMake(e) {
  78. let orderDetails = e.currentTarget.dataset.item
  79. let moneyShow = 0
  80. for (let i = 0; i < orderDetails.length; i++) {
  81. moneyShow = (moneyShow * 1) + (orderDetails[i].price * 1)
  82. if (orderDetails[i].product_name) {
  83. orderDetails[i].selectMaterial = {}
  84. orderDetails[i].selectMaterial.name = orderDetails[i].product_name
  85. orderDetails[i].selectMaterial.id = orderDetails[i].product_id
  86. }
  87. }
  88. console.log(orderDetails)
  89. wx.navigateTo({
  90. url: '../reserveCar/reserveCar?data=' + JSON.stringify(orderDetails) + '&&money=' + moneyShow + '&&type=project',
  91. })
  92. }
  93. })