小程序农机手端

index.jsx 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import { useState, useEffect } from "react"
  2. import { useModel } from '@/store'
  3. import Taro from "@tarojs/taro"
  4. import { View, Image, ScrollView } from "@tarojs/components"
  5. import userBgi from '@/assets/user/userBgi.png'
  6. import avatar from '@/assets/user/defaultAvatar.png'
  7. import MyCell from "@/components/MyCell"
  8. import account from '@/assets/user/account.png'
  9. import aboutUs from '@/assets/user/aboutUs.png'
  10. import update from '@/assets/user/update.png'
  11. import feedback from '@/assets/user/feedback.png'
  12. import goto from '@/assets/user/goto.png'
  13. import machinery from '@/assets/user/machinery.png'
  14. import wallet from '@/assets/user/wallet.png'
  15. import bankCard from '@/assets/user/bankCard.png'
  16. import './style.less'
  17. export default (props) => {
  18. const { phone, setPhone } = useModel('phone')
  19. const handleAccount = () => {
  20. Taro.navigateTo({ url: '/pages/userInfo/index' });
  21. }
  22. const handleAboutUs = () => {
  23. Taro.navigateTo({ url: '/pages/aboutUs/index' });
  24. }
  25. const handleUpdate = () => {
  26. Taro.navigateTo({ url: '/pages/versionUpdate/index' });
  27. }
  28. const handleFeedback = () => {
  29. Taro.navigateTo({ url: '/pages/feedback/index' });
  30. }
  31. const goMachinery = () => {
  32. Taro.navigateTo({ url: '/pages/machineryList/index' });
  33. }
  34. const goWallet = () => {
  35. Taro.navigateTo({ url: '/pages/wallet/index?balance=2022.56' });
  36. }
  37. const goBank = () => {
  38. Taro.navigateTo({ url: '/pages/bankCard/index' });
  39. }
  40. const signOut = () => {
  41. setPhone()
  42. Taro.reLaunch({ url: '/pages/index/index?tab=2' });
  43. }
  44. return (
  45. <ScrollView scrollY style={{ height: '100%' }}>
  46. <View className='personTip'>该账号归张三所属</View>
  47. <View className='userHead'>
  48. <Image src={userBgi} className='userBgi' />
  49. <View className='headcontent' >
  50. <Image src={avatar} className='avatar' />
  51. <View>
  52. <View>张三</View>
  53. <View>{phone}</View>
  54. </View>
  55. </View>
  56. </View>
  57. <View className='userCard'>
  58. <View
  59. className='cardItem'
  60. onClick={() => goMachinery()}
  61. >
  62. <Image className='cardImg' src={machinery}></Image>
  63. <View className='text'>我的农机</View>
  64. </View>
  65. <View
  66. className='cardItem'
  67. onClick={() => goWallet()}
  68. >
  69. <Image className='cardImg' src={wallet}></Image>
  70. <View className='text'>我的钱包</View>
  71. </View>
  72. <View
  73. className='cardItem'
  74. onClick={() => goBank()}
  75. >
  76. <Image className='cardImg' src={bankCard}></Image>
  77. <View className='text'>我的银行卡</View>
  78. </View>
  79. </View>
  80. <View className='userContent'>
  81. <View className='userBox'>
  82. <MyCell icon={account} action={goto} user handleAction={handleAccount} >账号与安全</MyCell>
  83. </View>
  84. <View className='userBox'>
  85. <MyCell icon={aboutUs} action={goto} user handleAction={handleAboutUs}>关于我们</MyCell>
  86. </View>
  87. <View className='userBox'>
  88. <MyCell icon={update} action={goto} user handleAction={handleUpdate}>版本更新</MyCell>
  89. </View>
  90. <View className='userBox'>
  91. <MyCell icon={feedback} action={goto} user handleAction={handleFeedback}>意见反馈</MyCell>
  92. </View>
  93. <View className='signOut' onClick={signOut}>退出登录</View>
  94. </View>
  95. </ScrollView>
  96. )
  97. }