index.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import React, {Component} from 'react'
  2. import './index.css'
  3. import {Grid} from 'antd-mobile'
  4. import {withRouter} from 'react-router-dom'
  5. const orderIcon = [
  6. {
  7. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/pay.png',
  8. text: '待付款',
  9. id: 'pay'
  10. },
  11. {
  12. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/ship.png',
  13. text: '待发货',
  14. id: 'ship'
  15. },
  16. {
  17. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/unbox.png',
  18. text: '待收货',
  19. id: 'unbox'
  20. },
  21. {
  22. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/judge.png',
  23. text: '待评价',
  24. id: 'judge'
  25. }
  26. ]
  27. const toolsIcon = [
  28. {
  29. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/address.png',
  30. text: '收货地址',
  31. id: 'address'
  32. },
  33. {
  34. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/cart.png',
  35. text: '购物袋',
  36. id: 'cart'
  37. },
  38. {
  39. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/message.png',
  40. text: '系统通知',
  41. id: 'message'
  42. }
  43. ]
  44. const memberIcon = [
  45. {
  46. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/card.png',
  47. text: '会员卡',
  48. id: 'card'
  49. },
  50. {
  51. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/coupon.png',
  52. text: '优惠券',
  53. id: 'coupon'
  54. },
  55. {
  56. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/credit.png',
  57. text: '积分',
  58. id: 'credit'
  59. }
  60. ]
  61. const shopIcon = [
  62. {
  63. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/shop.png',
  64. text: '店铺展示',
  65. id: 'shop'
  66. },
  67. {
  68. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/goods.png',
  69. text: '商品管理',
  70. id: 'goods'
  71. },
  72. {
  73. icon: 'https://ece-img-1254337200.cos.ap-chengdu.myqcloud.com/icon/order.png',
  74. text: '订单管理',
  75. id: 'order'
  76. }
  77. ]
  78. class All extends Component {
  79. constructor(props) {
  80. super(props)
  81. this.state = {}
  82. }
  83. render() {
  84. return (
  85. <div className='my-wrap all'>
  86. <div className='avatar-area'>
  87. <div className='avatar'/>
  88. <div className='nickname'>110</div>
  89. </div>
  90. <div className='my-card order-card'>
  91. <div className='card-title'>
  92. 电商订单
  93. </div>
  94. <div className='card-icons'>
  95. <Grid data={orderIcon}
  96. columnNum={4}
  97. hasLine={false}
  98. onClick={(order) => {
  99. this.props.history.push({
  100. pathname: '/my/order',
  101. state: {
  102. page: order.id
  103. }
  104. })
  105. }}
  106. />
  107. </div>
  108. </div>
  109. <div className='my-card tools-card'>
  110. <div className='card-title'>
  111. 我的工具
  112. </div>
  113. <div className='card-icons'>
  114. <Grid data={toolsIcon}
  115. columnNum={4}
  116. hasLine={false}
  117. onClick={(tools) => {
  118. if (tools.id === 'cart') {
  119. this.props.history.push({
  120. pathname: '/cart'
  121. })
  122. } else {
  123. this.props.history.push({
  124. pathname: '/my/tools',
  125. state: {
  126. page: tools.id
  127. }
  128. })
  129. }
  130. }}
  131. />
  132. </div>
  133. </div>
  134. <div className='my-card member-card'>
  135. <div className='card-title'>
  136. 会员中心
  137. </div>
  138. <div className='card-icons'>
  139. <Grid data={memberIcon}
  140. columnNum={4}
  141. hasLine={false}
  142. onClick={(member) => {
  143. this.props.history.push({
  144. pathname: '/my/member',
  145. state: {
  146. page: member.id
  147. }
  148. })
  149. }}
  150. />
  151. </div>
  152. </div>
  153. <div className='my-card member-card'>
  154. <div className='card-title'>
  155. 商家入口
  156. </div>
  157. <div className='card-icons'>
  158. <Grid data={shopIcon}
  159. columnNum={4}
  160. hasLine={false}
  161. onClick={(shop) => {
  162. this.props.history.push({
  163. pathname: '/my/shop',
  164. state: {
  165. page: shop.id
  166. }
  167. })
  168. }}
  169. />
  170. </div>
  171. </div>
  172. </div>
  173. )
  174. }
  175. }
  176. export default withRouter(All)