index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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">
  84. <button class="item-box-button" open-type="contact" :bindcontact="handleContact"></button>
  85. <view class="item-left align-items-center">
  86. <image class="item-img" src="@/static/img/my/lxkf.png" mode=""></image>
  87. <view class="fs-32 fc-3">
  88. 联系客服
  89. </view>
  90. </view>
  91. <view class="item-right align-items-center">
  92. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  93. </view>
  94. </view>
  95. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(8)">
  96. <view class="item-left align-items-center">
  97. <image class="item-img" src="@/static/img/my/swhz.png" mode=""></image>
  98. <view class="fs-32 fc-3">
  99. 商务合作
  100. </view>
  101. </view>
  102. <view class="item-right align-items-center">
  103. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  104. </view>
  105. </view>
  106. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(9)">
  107. <view class="item-left align-items-center">
  108. <image class="item-img" src="@/static/img/my/qszp.png" mode=""></image>
  109. <view class="fs-32 fc-3">
  110. 骑手招聘
  111. </view>
  112. </view>
  113. <view class="item-right align-items-center">
  114. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  115. </view>
  116. </view>
  117. <view class="item-box align-items-center flex-justify-space mb-64" @click="goToUrl(10)">
  118. <view class="item-left align-items-center">
  119. <image class="item-img" src="@/static/img/my/wtfk.png" mode=""></image>
  120. <view class="fs-32 fc-3">
  121. 问题反馈
  122. </view>
  123. </view>
  124. <view class="item-right align-items-center">
  125. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  126. </view>
  127. </view>
  128. <view class="item-box align-items-center flex-justify-space" @click="goToUrl(11)">
  129. <view class="item-left align-items-center">
  130. <image class="item-img" src="@/static/img/my/gywm.png" mode=""></image>
  131. <view class="fs-32 fc-3">
  132. 关于我们
  133. </view>
  134. </view>
  135. <view class="item-right align-items-center">
  136. <image class="to-right" src="@/static/img/toRight.png" mode=""></image>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </scroll-view>
  142. <view class="p-b-20 b-rad-20"></view>
  143. </view>
  144. </template>
  145. <script>
  146. import {userInfo} from '@/api/member.js'
  147. export default {
  148. components: {},
  149. data() {
  150. return {
  151. userInfoData:{
  152. nickname:'',
  153. head_img:'',
  154. phone:'',
  155. sex:'',
  156. msg_count:'',
  157. },
  158. };
  159. },
  160. onShow() {
  161. let token = uni.getStorageSync('token');
  162. if(!token){
  163. this.userInfoData.nickname = '请先登录'
  164. }else{
  165. this.getUserInfo();
  166. }
  167. },
  168. methods: {
  169. handleContact(e){
  170. console.log(e);
  171. },
  172. getUserInfo(){
  173. userInfo().then((res)=>{
  174. if(res.code === 1){
  175. this.userInfoData = res.data;
  176. }
  177. })
  178. },
  179. scrolltolower() {
  180. console.log('触底');
  181. },
  182. goToUrl(type) {
  183. if (type == 0) {
  184. // 修改个人信息
  185. uni.navigateTo({
  186. url: '/pages-my/user-info'
  187. })
  188. } else if (type == 1) {
  189. // 我的卡券
  190. uni.navigateTo({
  191. url: '/pages-my/my-ticket'
  192. })
  193. } else if (type == 2) {
  194. // 我的发布
  195. uni.navigateTo({
  196. url: '/pages-my/my-publish'
  197. })
  198. } else if (type == 3) {
  199. // 我的评价
  200. uni.navigateTo({
  201. url: '/pages-my/my-appraise'
  202. })
  203. } else if (type == 4) {
  204. // 地址管理
  205. uni.navigateTo({
  206. url: '/pages-address/address'
  207. })
  208. } else if (type == 5) {
  209. // 领券中心
  210. uni.navigateTo({
  211. url: '/pages-my/ticket-centre'
  212. })
  213. } else if (type == 6) {
  214. // 消息中心
  215. uni.navigateTo({
  216. url: '/pages-my/info-centre'
  217. })
  218. }else if (type == 8) {
  219. // 商务合作
  220. uni.navigateTo({
  221. url: '/pages-my/cooperate'
  222. })
  223. } else if (type == 9) {
  224. // 骑手招聘
  225. uni.navigateTo({
  226. url: '/pages-my/rider-recruit'
  227. })
  228. } else if (type == 10) {
  229. // 问题反馈
  230. uni.navigateTo({
  231. url: '/pages-my/feedback'
  232. })
  233. } else if (type == 11) {
  234. // 关于我们
  235. uni.navigateTo({
  236. url: '/pages-my/about-us'
  237. })
  238. } else if (type == 12) {
  239. // 系统通知
  240. uni.navigateTo({
  241. url: '/pages-my/notice/list'
  242. })
  243. }
  244. }
  245. },
  246. }
  247. </script>
  248. <style lang="scss" scoped>
  249. .item-box{
  250. position: relative;
  251. .item-box-button{
  252. position: absolute;
  253. width: 100%;
  254. height: 54rpx;
  255. top: 0;
  256. left: 0;
  257. z-index: 100;
  258. background-color: transparent;
  259. border: none !important;
  260. }
  261. button::after{
  262. border: none !important;
  263. }
  264. }
  265. .my-box {}
  266. .bg-box {
  267. width: 100%;
  268. height: 476rpx;
  269. position: fixed;
  270. top: 0;
  271. z-index: -1;
  272. }
  273. .user-img-box {
  274. width: 112rpx;
  275. height: 112rpx;
  276. position: relative;
  277. }
  278. .user-box {
  279. padding: 54rpx 32rpx;
  280. }
  281. .user-img {
  282. width: 100%;
  283. height: 100%;
  284. }
  285. .set-iimg {
  286. position: absolute;
  287. right: 4rpx;
  288. bottom: 0;
  289. width: 33rpx;
  290. height: 33rpx;
  291. }
  292. .user-name {
  293. max-width: 388rpx;
  294. }
  295. .function-one-box {
  296. padding: 0 24rpx;
  297. }
  298. .function-one {
  299. padding: 24rpx 34rpx;
  300. }
  301. .function-two {
  302. padding: 22rpx 40rpx 22rpx 32rpx;
  303. background: linear-gradient(90deg, #FFFFFF 47%, #FFF7E5 100%);
  304. }
  305. .my-img {
  306. width: 80rpx;
  307. height: 80rpx;
  308. margin: 0 0 8rpx 0;
  309. }
  310. .function-two-right {
  311. width: 96rpx;
  312. height: 96rpx;
  313. }
  314. .lqzx-img {
  315. width: 137rpx;
  316. height: 30rpx;
  317. margin: 0 8rpx 0 0;
  318. }
  319. .to-right {
  320. width: 32rpx;
  321. height: 32rpx;
  322. }
  323. // .list-box{
  324. // padding: 0 24rpx 20rpx;
  325. // }
  326. .list {
  327. padding: 32rpx 28rpx 32rpx 32rpx;
  328. }
  329. .item-img {
  330. width: 48rpx;
  331. height: 48rpx;
  332. margin: 0 20rpx 0 0;
  333. }
  334. </style>