index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="my-box flex-common-css">
  3. <Nav title="我的" :leftShow='false' titleColor="#333" bgckgroundBox='transparent'></Nav>
  4. <image class="bg-box" src="@/static/img/my/bg.png" mode=""></image>
  5. <view class="user-box align-items-center" @click="goToUrl(0)">
  6. <view class="user-img-box mr-24">
  7. <image v-if="userInfoData.head_img" class="user-img" :src="userInfoData.head_img" mode=""></image>
  8. <image v-else class="user-img" src="@/static/img/my/user-img.png" mode=""></image>
  9. <image class="set-iimg" src="@/static/img/my/pen.png" mode=""></image>
  10. </view>
  11. <view class="user-name text-overflow-ellipsis-one fs-34">
  12. {{ userInfoData.nickname }}
  13. </view>
  14. </view>
  15. <view class="function-one-box box-border-box">
  16. <view class="function-one b-rad-20 bgc-f box-border-box mb-24 align-items-center flex-justify-space">
  17. <view class="my-function-box flex-direction align-items-center" @click="goToUrl(1)">
  18. <image class="my-img" src="@/static/img/my/wdkq.png" mode=""></image>
  19. <view class="fs-26">
  20. 我的卡券
  21. </view>
  22. </view>
  23. <view class="my-function-box flex-direction align-items-center" @click="goToUrl(2)">
  24. <image class="my-img" src="@/static/img/my/wdfb.png" mode=""></image>
  25. <view class="fs-26">
  26. 我的发布
  27. </view>
  28. </view>
  29. <view class="my-function-box flex-direction align-items-center" @click="goToUrl(3)">
  30. <image class="my-img" src="@/static/img/my/wdpj.png" mode=""></image>
  31. <view class="fs-26">
  32. 我的评价
  33. </view>
  34. </view>
  35. <view class="my-function-box flex-direction align-items-center" @click="goToUrl(4)">
  36. <image class="my-img" src="@/static/img/my/dzgl.png" mode=""></image>
  37. <view class="fs-26">
  38. 地址管理
  39. </view>
  40. </view>
  41. </view>
  42. <view class="function-two b-rad-20 box-border-box flex-justify-space mb-22" @click="goToUrl(5)">
  43. <view class="function-two-left">
  44. <view class="align-items-center mb-12 p-t-10">
  45. <image class="lqzx-img" src="@/static/img/my/lqzx.png" mode=""></image>
  46. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  47. </view>
  48. <view class="fs-26 fc-9">
  49. 领券下单更优惠
  50. </view>
  51. </view>
  52. <image class="function-two-right" src="@/static/img/my/q.png" mode=""></image>
  53. </view>
  54. </view>
  55. <scroll-view class="" :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  56. <view class="list-box function-one-box box-border-box">
  57. <view class="list bgc-f b-rad-20">
  58. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(6)">
  59. <view class="item-left align-items-center">
  60. <image class="item-img" src="@/static/img/my/xxzx.png" mode=""></image>
  61. <view class="fs-32 fc-3">
  62. 消息中心
  63. </view>
  64. </view>
  65. <view class="item-right align-items-center">
  66. <view class="fs-24 fc-9" v-if="userInfoData.msg_count > 0">
  67. {{userInfoData.msg_count}}条未读消息
  68. </view>
  69. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  70. </view>
  71. </view>
  72. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(12)">
  73. <view class="item-left align-items-center">
  74. <image class="item-img" src="@/static/img/my/gong-gao-icon.png" mode=""></image>
  75. <view class="fs-32 fc-3">
  76. 通知公告
  77. </view>
  78. </view>
  79. <view class="item-right align-items-center">
  80. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  81. </view>
  82. </view>
  83. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(7)">
  84. <view class="item-left align-items-center">
  85. <image class="item-img" src="@/static/img/my/lxkf.png" mode=""></image>
  86. <view class="fs-32 fc-3">
  87. 联系客服
  88. </view>
  89. </view>
  90. <view class="item-right align-items-center">
  91. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  92. </view>
  93. </view>
  94. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(8)">
  95. <view class="item-left align-items-center">
  96. <image class="item-img" src="@/static/img/my/swhz.png" mode=""></image>
  97. <view class="fs-32 fc-3">
  98. 商务合作
  99. </view>
  100. </view>
  101. <view class="item-right align-items-center">
  102. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  103. </view>
  104. </view>
  105. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(9)">
  106. <view class="item-left align-items-center">
  107. <image class="item-img" src="@/static/img/my/qszp.png" mode=""></image>
  108. <view class="fs-32 fc-3">
  109. 骑手招聘
  110. </view>
  111. </view>
  112. <view class="item-right align-items-center">
  113. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  114. </view>
  115. </view>
  116. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(10)">
  117. <view class="item-left align-items-center">
  118. <image class="item-img" src="@/static/img/my/wtfk.png" mode=""></image>
  119. <view class="fs-32 fc-3">
  120. 问题反馈
  121. </view>
  122. </view>
  123. <view class="item-right align-items-center">
  124. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  125. </view>
  126. </view>
  127. <view class="item-box align-items-center flex-justify-space" @click="goToUrl(11)">
  128. <view class="item-left align-items-center">
  129. <image class="item-img" src="@/static/img/my/gywm.png" mode=""></image>
  130. <view class="fs-32 fc-3">
  131. 关于我们
  132. </view>
  133. </view>
  134. <view class="item-right align-items-center">
  135. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </scroll-view>
  141. <view class="p-b-20 b-rad-20"></view>
  142. </view>
  143. </template>
  144. <script>
  145. import {userInfo} from '@/api/member.js'
  146. export default {
  147. components: {},
  148. data() {
  149. return {
  150. userInfoData:{
  151. nickname:'',
  152. head_img:'',
  153. phone:'',
  154. sex:'',
  155. msg_count:'',
  156. },
  157. };
  158. },
  159. onShow() {
  160. let token = uni.getStorageSync('token');
  161. if(!token){
  162. this.userInfoData.nickname = '请先登录'
  163. }else{
  164. this.getUserInfo();
  165. }
  166. },
  167. methods: {
  168. getUserInfo(){
  169. userInfo().then((res)=>{
  170. if(res.code === 1){
  171. this.userInfoData = res.data;
  172. }
  173. })
  174. },
  175. scrolltolower() {
  176. console.log('触底');
  177. },
  178. goToUrl(type) {
  179. if (type == 0) {
  180. // 修改个人信息
  181. uni.navigateTo({
  182. url: '/pages-my/user-info'
  183. })
  184. } else if (type == 1) {
  185. // 我的卡券
  186. uni.navigateTo({
  187. url: '/pages-my/my-ticket'
  188. })
  189. } else if (type == 2) {
  190. // 我的发布
  191. uni.navigateTo({
  192. url: '/pages-my/my-publish'
  193. })
  194. } else if (type == 3) {
  195. // 我的评价
  196. uni.navigateTo({
  197. url: '/pages-my/my-appraise'
  198. })
  199. } else if (type == 4) {
  200. // 地址管理
  201. uni.navigateTo({
  202. url: '/pages-address/address'
  203. })
  204. } else if (type == 5) {
  205. // 领券中心
  206. uni.navigateTo({
  207. url: '/pages-my/ticket-centre'
  208. })
  209. } else if (type == 6) {
  210. // 消息中心
  211. uni.navigateTo({
  212. url: '/pages-my/info-centre'
  213. })
  214. } else if (type == 7) {
  215. // 联系客服
  216. } else if (type == 8) {
  217. // 商务合作
  218. uni.navigateTo({
  219. url: '/pages-my/cooperate'
  220. })
  221. } else if (type == 9) {
  222. // 骑手招聘
  223. uni.navigateTo({
  224. url: '/pages-my/rider-recruit'
  225. })
  226. } else if (type == 10) {
  227. // 问题反馈
  228. uni.navigateTo({
  229. url: '/pages-my/feedback'
  230. })
  231. } else if (type == 11) {
  232. // 关于我们
  233. uni.navigateTo({
  234. url: '/pages-my/about-us'
  235. })
  236. } else if (type == 12) {
  237. // 系统通知
  238. uni.navigateTo({
  239. url: '/pages-my/notice/list'
  240. })
  241. }
  242. }
  243. },
  244. }
  245. </script>
  246. <style lang="scss" scoped>
  247. .my-box {}
  248. .bg-box {
  249. width: 100%;
  250. height: 476rpx;
  251. position: fixed;
  252. top: 0;
  253. z-index: -1;
  254. }
  255. .user-img-box {
  256. width: 112rpx;
  257. height: 112rpx;
  258. position: relative;
  259. }
  260. .user-box {
  261. padding: 54rpx 32rpx;
  262. }
  263. .user-img {
  264. width: 100%;
  265. height: 100%;
  266. }
  267. .set-iimg {
  268. position: absolute;
  269. right: 4rpx;
  270. bottom: 0;
  271. width: 33rpx;
  272. height: 33rpx;
  273. }
  274. .user-name {
  275. max-width: 388rpx;
  276. }
  277. .function-one-box {
  278. padding: 0 24rpx;
  279. }
  280. .function-one {
  281. padding: 24rpx 34rpx;
  282. }
  283. .function-two {
  284. padding: 22rpx 40rpx 22rpx 32rpx;
  285. background: linear-gradient(90deg, #FFFFFF 47%, #FFF7E5 100%);
  286. }
  287. .my-img {
  288. width: 80rpx;
  289. height: 80rpx;
  290. margin: 0 0 8rpx 0;
  291. }
  292. .function-two-right {
  293. width: 96rpx;
  294. height: 96rpx;
  295. }
  296. .lqzx-img {
  297. width: 137rpx;
  298. height: 30rpx;
  299. margin: 0 8rpx 0 0;
  300. }
  301. .to-right {
  302. width: 32rpx;
  303. height: 32rpx;
  304. }
  305. // .list-box{
  306. // padding: 0 24rpx 20rpx;
  307. // }
  308. .list {
  309. padding: 32rpx 28rpx 32rpx 32rpx;
  310. }
  311. .item-img {
  312. width: 48rpx;
  313. height: 48rpx;
  314. margin: 0 20rpx 0 0;
  315. }
  316. </style>