index.vue 9.4 KB

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