mine.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <template>
  2. <view class="content">
  3. <view class="hflex acenter jbetween user">
  4. <view class="hflex acenter" v-if="!login">
  5. <image src="/static/images/mine/avatar1.jpg" mode="widthFix" class="avatar"></image>
  6. <view class="hflex acenter" @click="toLogin">
  7. <view class="text_style1">立即登录</view>
  8. <u-icon name="arrow-right" color="#000" size="10"></u-icon>
  9. </view>
  10. </view>
  11. <view class="hflex acenter" v-else>
  12. <image :src="user.img" mode="widthFix" class="avatar"></image>
  13. <view class="vflex">
  14. <view class="hflex acenter">
  15. <view class="text_style1">{{user.name}}</view>
  16. <view class="setting" @click="toSetting">设置</view>
  17. </view>
  18. <view class="member_icon">
  19. <image src="/static/images/mine/member_icon.png" style="width: 136rpx;height: 48rpx;"></image>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="user_right" @click="toMessage">
  24. <image src="/static/images/mine/message.png" mode="widthFix" class="message_icon"></image>
  25. <view class="message" v-if="user.message_num > 0">{{user.message_num}}</view>
  26. </view>
  27. </view>
  28. <view class="member hflex acenter jbetween" @click="toMember">
  29. <view class="vflex">
  30. <view class="hflex acenter">
  31. <image src="/static//images/mine/huiyuan.png" mode="widthFix" style="width: 40rpx;"></image>
  32. <view class="member_name">船百知会员</view>
  33. </view>
  34. <view class="member_detail" v-if="user.is_member">{{user.member_date}}到期</view>
  35. <view class="member_detail" v-else>开通会员立享优惠</view>
  36. </view>
  37. <view class="hflex acenter jbetween member_btn">
  38. <view v-if="user.is_member">立即续费</view>
  39. <view v-else>去开通</view>
  40. <image src="/static/images/mine/btn_right.png" mode="widthFix" style="width: 32rpx;margin-left: 14rpx;"></image>
  41. </view>
  42. </view>
  43. <view class="box hflex acenter jbetween">
  44. <view class="box_left vflex" @click="toWallet">
  45. <view class="left_title">我的余额</view>
  46. <view class="left_num" v-if="login">{{user.balance_num ? user.balance_num : 0}}</view>
  47. <view class="left_num" v-else>**</view>
  48. <view class="left_bottom">看看你的账户余额吧~</view>
  49. </view>
  50. <view class="box_right vflex" @click="toCollect">
  51. <view class="left_title">我的收藏</view>
  52. <view class="left_num" v-if="login">{{user.collect_num ? user.collect_num : 0}}</view>
  53. <view class="left_num" v-else>**</view>
  54. <view class="right_bottom">你收藏的宝藏都在这里</view>
  55. </view>
  56. </view>
  57. <view class="list">
  58. <view class="list_title">我的订单</view>
  59. <view class=" hflex acenter jbetween">
  60. <block v-for="(item,index) in order" :key="index">
  61. <view class="list_item vflex acenter" @click="toOrder(item.url)">
  62. <image :src="item.img" mode="widthFix" style="width: 56rpx;margin-bottom: 20rpx;"></image>
  63. <view>{{item.text}}</view>
  64. </view>
  65. </block>
  66. </view>
  67. </view>
  68. <view class="list">
  69. <view class="list_title">我的服务</view>
  70. <view class="hflex acenter fwrap">
  71. <block v-for="(item,index) in serviceList" :key="index">
  72. <view class="list_item1 vflex acenter" @click="toService(item.url)">
  73. <image :src="item.img" mode="widthFix" style="width: 60rpx;margin-bottom: 14rpx;"></image>
  74. <view>{{item.text}}</view>
  75. </view>
  76. </block>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import $api from '@/static/js/api.js'
  83. var that = ''
  84. export default {
  85. data() {
  86. return {
  87. login: false,
  88. user: {
  89. img: '/static/images/mine/avatar2.jpg',
  90. name: '放风筝的人',
  91. message_num: 0,
  92. is_member: 1,
  93. member_date: '2022-11-10',
  94. balance_num: 348.95,
  95. collect_num: 12,
  96. },
  97. order: [
  98. {
  99. id: 1,
  100. img: '/static/images/mine/order1.png',
  101. text: '生产订单',
  102. url: '/page_mine/pages/order/production'
  103. },
  104. {
  105. id: 2,
  106. img: '/static/images/mine/order2.png',
  107. text: '外协订单',
  108. url: '/page_mine/pages/order/outsourcing'
  109. },
  110. {
  111. id: 3,
  112. img: '/static/images/mine/order3.png',
  113. text: '采购订单',
  114. url: '/page_mine/pages/order/purchase'
  115. },
  116. {
  117. id: 4,
  118. img: '/static/images/mine/order4.png',
  119. text: '海运订单',
  120. url: '/page_mine/pages/order/oceanShipping'
  121. },
  122. {
  123. id: 5,
  124. img: '/static/images/mine/order5.png',
  125. text: '维修订单',
  126. url: '/page_mine/pages/order/repair'
  127. },
  128. ],
  129. serviceList: [
  130. {
  131. url: '',
  132. img: '/static/images/mine/service1.png',
  133. text: '加入人才库',
  134. url: '/page_mine/pages/service/joinPerson'
  135. },
  136. {
  137. url: '',
  138. img: '/static/images/mine/service2.png',
  139. text: '成为维修工',
  140. url: '/page_mine/pages/service/applyMaintenance'
  141. },
  142. {
  143. url: '',
  144. img: '/static/images/mine/service3.png',
  145. text: '入驻船厂',
  146. },
  147. {
  148. url: '',
  149. img: '/static/images/mine/service4.png',
  150. text: '入驻商家',
  151. },
  152. {
  153. url: '',
  154. img: '/static/images/mine/service5.png',
  155. text: '实名认证',
  156. },
  157. {
  158. url: '',
  159. img: '/static/images/mine/service6.png',
  160. text: '我的发布',
  161. },
  162. {
  163. url: '',
  164. img: '/static/images/mine/service7.png',
  165. text: '我的需求',
  166. },
  167. {
  168. url: '',
  169. img: '/static/images/mine/service8.png',
  170. text: '意见反馈',
  171. },
  172. ]
  173. }
  174. },
  175. onLoad() {
  176. that = this
  177. },
  178. onShow() {
  179. that.isLogin()
  180. },
  181. methods: {
  182. // 判断登录
  183. isLogin() {
  184. var token = uni.getStorageSync("token")
  185. if (token) {
  186. that.login = true
  187. }
  188. },
  189. // 去登陆
  190. toLogin() {
  191. $api.jump('/pages/login/password_login')
  192. },
  193. // 去设置
  194. toSetting() {
  195. $api.jump('/page_mine/pages/setting/setting')
  196. },
  197. // 去通知中心
  198. toMessage() {
  199. if(that.login) {
  200. $api.jump('/page_mine/pages/message/message')
  201. } else {
  202. $api.info('请先登录')
  203. }
  204. },
  205. // 去会员中心
  206. toMember() {
  207. if(that.login) {
  208. $api.jump('/page_mine/pages/member/index')
  209. } else {
  210. $api.info('请先登录')
  211. }
  212. },
  213. // 我的余额
  214. toWallet() {
  215. if(that.login) {
  216. $api.jump('/page_mine/pages/wallet/wallet')
  217. } else {
  218. $api.info('请先登录')
  219. }
  220. },
  221. // 我的收藏
  222. toCollect() {
  223. if(that.login) {
  224. $api.jump('/page_mine/pages/collect/collect')
  225. } else {
  226. $api.info('请先登录')
  227. }
  228. },
  229. // 我的订单
  230. toOrder(url) {
  231. if(that.login) {
  232. $api.jump(url)
  233. } else {
  234. $api.info('请先登录')
  235. }
  236. },
  237. // 我的服务
  238. toService(url) {
  239. if(that.login) {
  240. $api.jump(url)
  241. } else {
  242. $api.info('请先登录')
  243. }
  244. }
  245. },
  246. }
  247. </script>
  248. <style lang="scss" scoped>
  249. .content {
  250. background:url('/static/images/mine/bg.png') no-repeat;
  251. background-size: 100%;
  252. padding: 0 30rpx;
  253. .user {
  254. width: 100%;
  255. margin: 24rpx 0;
  256. .avatar {
  257. box-shadow: 0 8rpx 20rpx 0 #c4d8df;
  258. border: 4rpx solid #fff;
  259. width: 120rpx;
  260. height: 120rpx;
  261. border-radius: 50%;
  262. }
  263. .text_style1 {
  264. color: #131415;
  265. font-size: 40rpx;
  266. margin: 0 6rpx 0 16rpx;
  267. }
  268. .member_icon {
  269. margin: 10rpx 0 0 16rpx;
  270. }
  271. .setting {
  272. margin-left: 12rpx;
  273. width: 64rpx;
  274. height: 32rpx;
  275. border-radius: 20rpx;
  276. border: 1rpx solid #526fff;
  277. text-align: center;
  278. line-height: 32rpx;
  279. font-size: 20rpx;
  280. color: #526fff;
  281. }
  282. .user_right {
  283. position: relative;
  284. .message_icon {
  285. width: 48rpx;
  286. height: 48rpx;
  287. }
  288. .message {
  289. position: absolute;
  290. right: -10rpx;
  291. top: 0;
  292. width: 36rpx;
  293. height: 24rpx;
  294. background-color: #fb3e32;
  295. border-radius: 12rpx 12rpx 12rpx 4rpx;
  296. font-size: 20rpx;
  297. color: #fff;
  298. text-align: center;
  299. }
  300. }
  301. }
  302. .member {
  303. width: 100%;
  304. height: 132rpx;
  305. background-color: #2b2b2b;
  306. border-radius: 16rpx;
  307. border: 1rpx solid ;
  308. box-sizing: border-box;
  309. padding: 20rpx;
  310. margin: 20rpx 0;
  311. .member_name {
  312. color: #fff;
  313. font-size: 32rpx;
  314. margin-left: 6rpx;
  315. }
  316. .member_detail {
  317. color: #fff;
  318. font-size: 22rpx;
  319. margin-top: 16rpx;
  320. }
  321. .member_btn {
  322. width: auto;
  323. height: 64rpx;
  324. background: linear-gradient(270deg,#feebc8 0%, #ffe3a4 100%);
  325. border-radius: 32rpx;
  326. box-sizing: border-box;
  327. padding: 28rpx;
  328. font-size: 24rpx;
  329. color: #572915;
  330. }
  331. }
  332. .box {
  333. width: 100%;
  334. margin-bottom: 20rpx;
  335. .box_left {
  336. background: url('/static/images/mine/balance.png') no-repeat;
  337. background-size: 100%;
  338. box-sizing: border-box;
  339. padding: 16rpx 24rpx;
  340. width: 336rpx;
  341. height: 180rpx;
  342. .left_bottom {
  343. width: 264rpx;
  344. height: 32rpx;
  345. background: linear-gradient(270deg, rgba(234,245,255,0) 0%, #e3eeff 100%);
  346. padding: 0 12rpx;
  347. line-height: 32rpx;
  348. font-size: 20rpx;
  349. color: #4f64af;
  350. }
  351. }
  352. .box_right {
  353. background: url('/static/images/mine//collect.png') no-repeat;
  354. background-size: 100%;
  355. box-sizing: border-box;
  356. padding: 16rpx 24rpx;
  357. width: 336rpx;
  358. height: 180rpx;
  359. .right_bottom {
  360. width: 264rpx;
  361. height: 32rpx;
  362. background: linear-gradient(270deg, rgba(227,255,255,0) 0%, #d4f1ff 100%);
  363. padding: 0 12rpx;
  364. line-height: 32rpx;
  365. font-size: 20rpx;
  366. color: #26b0ff;
  367. }
  368. }
  369. .left_title {
  370. font-size: 24rpx;
  371. color: #444;
  372. }
  373. .left_num {
  374. font-size: 48rpx;
  375. color: #444;
  376. margin: 6rpx 0 6rpx;
  377. }
  378. }
  379. .list {
  380. width: 100%;
  381. height: auto;
  382. background: #fff;
  383. border-radius: 20rpx;
  384. box-sizing: border-box;
  385. padding: 20rpx;
  386. margin-bottom: 20rpx;
  387. .list_title {
  388. font-size: 26rpx;
  389. color: #222;
  390. margin-bottom: 24rpx;
  391. font-weight: 600;
  392. }
  393. .list_item {
  394. width: 20%;
  395. font-size: 22rpx;
  396. color: #333;
  397. }
  398. .list_item1 {
  399. width: 25%;
  400. margin-bottom: 40rpx;
  401. font-size: 24rpx;
  402. color: #444;
  403. }
  404. }
  405. }
  406. </style>