index.vue 9.6 KB

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