index.vue 10 KB

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