mine.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view style="overflow: scroll; background-color: #232428">
  3. <img
  4. src="https://file.rongcyl.cn/festatic/bkm/mine/mine_bgt.png"
  5. style="width: 100%; height: 658rpx; position: absolute; z-index: 99"
  6. />
  7. <div style="width: 100%; height: 658rpx; z-index: 100; position: relative">
  8. <div
  9. :style="{
  10. color: '#fff',
  11. 'margin-top': menuButton.top + 'px',
  12. 'line-height': menuButton.height + 'px',
  13. textAlign: 'center',
  14. }"
  15. >
  16. 我的
  17. </div>
  18. <div class="flex pt-3 px-5">
  19. <img @click="toUserInfo" style="width: 116rpx; height: 116rpx" :src="userInfo.avatar" class="rounded-full" />
  20. <div style="color: #bbbcc3" class="ml-3" v-if="hasLogin">
  21. <div>
  22. <span>{{ userInfo.nickname || '' }}</span>
  23. <span style="color: #9e9e9e" class="fs12 ml-4">ID:{{ userId || '' }}</span>
  24. </div>
  25. <div class="relative inline-block" style="width: 100rpx; height: 60rpx">
  26. <img src="https://file.rongcyl.cn/festatic/bkm/mine/vip2.png" style="width: 100rpx; height: 60rpx" />
  27. <div
  28. class="absolute fs13"
  29. style="top: 0; height: 60rpx; right: 15rpx; color: #713b08; z-index: 999; line-height: 60rpx"
  30. >
  31. 1
  32. </div>
  33. </div>
  34. </div>
  35. <div class="text-white" @click="toLogin" v-else>点击登录</div>
  36. </div>
  37. <div class="flex justify-around text-white mt-4 items-center text-center">
  38. <div class="">
  39. <div class="fs16 bold">{{ 999 }}</div>
  40. <div class="fs14">积分</div>
  41. </div>
  42. <div class="">
  43. <div class="fs16 bold">{{ 999 }}</div>
  44. <div class="fs14">优惠券</div>
  45. </div>
  46. </div>
  47. <img
  48. src="https://file.rongcyl.cn/festatic/bkm/mine/vip.png"
  49. style="width: 152rpx; height: 170rpx; position: absolute"
  50. :style="{ top: vipTop, right: '15rpx' }"
  51. />
  52. </div>
  53. <div
  54. style="
  55. margin-top: -320rpx;
  56. height: calc(100vh - 358rpx);
  57. width: 100vw;
  58. position: relative;
  59. z-index: 100;
  60. background: url(https://file.rongcyl.cn/festatic/bkm/mine/mine_bg.png) no-repeat;
  61. background-size: cover;
  62. color: #bbbcc3;
  63. padding: 0 30rpx;
  64. box-sizing: border-box;
  65. padding-top: 100rpx;
  66. "
  67. >
  68. <div class="flex justify-between items-center">
  69. <div class="fs14">我的订单</div>
  70. <div class="flex items-center">
  71. <span class="fs12">查看全部</span>
  72. <img
  73. class="ml-2 inline-block"
  74. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  75. style="width: 28rpx; height: 28rpx"
  76. />
  77. </div>
  78. </div>
  79. <div class="flex justify-around my-5 fs12 text-center">
  80. <div>
  81. <img src="https://file.rongcyl.cn/festatic/bkm/mine/t1.png" style="width: 100rpx; height: 100rpx" />
  82. <div class="mt-1">待发货</div>
  83. </div>
  84. <div>
  85. <img src="https://file.rongcyl.cn/festatic/bkm/mine/t2.png" style="width: 100rpx; height: 100rpx" />
  86. <div class="mt-1">待收货</div>
  87. </div>
  88. <div>
  89. <img src="https://file.rongcyl.cn/festatic/bkm/mine/t3.png" style="width: 100rpx; height: 100rpx" />
  90. <div class="mt-1">已完成</div>
  91. </div>
  92. <div>
  93. <img src="https://file.rongcyl.cn/festatic/bkm/mine/t4.png" style="width: 100rpx; height: 100rpx" />
  94. <div class="mt-1">消费记录</div>
  95. </div>
  96. </div>
  97. <div class="flex justify-between fs14 items-center border-t border-zinc-600" style="height: 92rpx">
  98. <div class="flex items-center">
  99. <img
  100. src="https://file.rongcyl.cn/festatic/bkm/mine/s1.png"
  101. class="inline-block mr-2"
  102. style="width: 32rpx; height: 32rpx"
  103. />
  104. <span>常见问题</span>
  105. </div>
  106. <img
  107. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  108. style="width: 28rpx; height: 28rpx; display: inline-block"
  109. />
  110. </div>
  111. <div class="flex justify-between fs14 items-center border-t border-zinc-600" style="height: 92rpx">
  112. <div class="flex items-center">
  113. <img
  114. src="https://file.rongcyl.cn/festatic/bkm/mine/s2.png"
  115. class="inline-block mr-2"
  116. style="width: 32rpx; height: 32rpx"
  117. />
  118. <span>意见反馈</span>
  119. </div>
  120. <img
  121. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  122. style="width: 28rpx; height: 28rpx; display: inline-block"
  123. />
  124. </div>
  125. <div class="flex justify-between fs14 items-center border-t border-zinc-600" style="height: 92rpx">
  126. <div class="flex items-center">
  127. <img
  128. src="https://file.rongcyl.cn/festatic/bkm/mine/s3.png"
  129. class="inline-block mr-2"
  130. style="width: 32rpx; height: 32rpx"
  131. />
  132. <span>加入群组</span>
  133. </div>
  134. <img
  135. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  136. style="width: 28rpx; height: 28rpx; display: inline-block"
  137. />
  138. </div>
  139. <div class="flex justify-between fs14 items-center border-t border-zinc-600" style="height: 92rpx">
  140. <div class="flex items-center">
  141. <img
  142. src="https://file.rongcyl.cn/festatic/bkm/mine/s4.png"
  143. class="inline-block mr-2"
  144. style="width: 32rpx; height: 32rpx"
  145. />
  146. <span>联系客服</span>
  147. </div>
  148. <img
  149. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  150. style="width: 28rpx; height: 28rpx; display: inline-block"
  151. />
  152. </div>
  153. <div class="flex justify-between fs14 items-center border-t border-zinc-600" style="height: 92rpx">
  154. <div class="flex items-center">
  155. <img
  156. src="https://file.rongcyl.cn/festatic/bkm/mine/s5.png"
  157. class="inline-block mr-2"
  158. style="width: 32rpx; height: 32rpx"
  159. />
  160. <span>地址管理</span>
  161. </div>
  162. <img
  163. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  164. style="width: 28rpx; height: 28rpx; display: inline-block"
  165. />
  166. </div>
  167. <div class="flex justify-between fs14 items-center border-t border-zinc-600" style="height: 92rpx">
  168. <div class="flex items-center">
  169. <img
  170. src="https://file.rongcyl.cn/festatic/bkm/mine/s6.png"
  171. class="inline-block mr-2"
  172. style="width: 32rpx; height: 32rpx"
  173. />
  174. <span>游戏规则</span>
  175. </div>
  176. <img
  177. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  178. style="width: 28rpx; height: 28rpx; display: inline-block"
  179. />
  180. </div>
  181. <div class="flex justify-between fs14 items-center border-t border-b border-zinc-600" style="height: 92rpx">
  182. <div class="flex items-center">
  183. <img
  184. src="https://file.rongcyl.cn/festatic/bkm/mine/s7.png"
  185. class="inline-block mr-2"
  186. style="width: 32rpx; height: 32rpx"
  187. />
  188. <span>用户协议</span>
  189. </div>
  190. <img
  191. src="https://file.rongcyl.cn/festatic/bkm/arrow.png"
  192. style="width: 28rpx; height: 28rpx; display: inline-block"
  193. />
  194. </div>
  195. </div>
  196. <uni-popup class="popup" ref="popup" type="center">
  197. <image
  198. class="qrcodeImg"
  199. :show-menu-by-longpress="true"
  200. :src="'https://file.rongcyl.cn/festatic/bkm/imgv2/QRcode.png'"
  201. mode="widthFix"
  202. />
  203. </uni-popup>
  204. </view>
  205. </template>
  206. <script>
  207. import { userInfoApi } from '@/api/user.js'
  208. import { messageListApi } from '@/api/message.js'
  209. export default {
  210. data() {
  211. return {
  212. isLogin: false,
  213. userInfo: null,
  214. userId: '-',
  215. hasLogin: false,
  216. userInfoDetail: {},
  217. massageNum: 0,
  218. safeAreaTop: 0,
  219. menuButton: {
  220. top: 0,
  221. height: 0,
  222. },
  223. }
  224. },
  225. created() {
  226. const { top, height } = wx.getMenuButtonBoundingClientRect()
  227. this.menuButton.top = top
  228. this.menuButton.height = height
  229. wx.getSystemInfo({
  230. success: res => {
  231. console.log(res.safeArea)
  232. this.safeAreaTop = res.safeArea.top + 'px'
  233. },
  234. })
  235. },
  236. computed: {
  237. vipTop() {
  238. return this.menuButton.height + 15 + 'px'
  239. },
  240. },
  241. onShow() {
  242. // this.userInfo = wx.getStorageSync('userInfo');
  243. this.userId = wx.getStorageSync('userId')
  244. //获取用户的登录信息
  245. if (wx.getStorageSync('token')) {
  246. this.hasLogin = true
  247. getApp().globalData.hasLogin = true
  248. // 获取用户信息详情
  249. this.getUserInfo()
  250. this.getMassage()
  251. } else {
  252. this.userInfo = null
  253. this.hasLogin = false
  254. getApp().globalData.hasLogin = false
  255. this.userInfoDetail = {}
  256. }
  257. },
  258. methods: {
  259. getMassage() {
  260. let params = {
  261. page: 1,
  262. limit: 1,
  263. status: 0,
  264. }
  265. messageListApi(params).then(res => {
  266. this.massageNum = res.data.total
  267. })
  268. },
  269. toUserInfo() {
  270. this.$navigateTo('/pages/user/user')
  271. if (this.isLogin) {
  272. this.$navigateTo('/pages/user/user')
  273. }
  274. },
  275. getUserInfo() {
  276. userInfoApi().then(res => {
  277. console.log(res, '详细用户信息')
  278. this.userInfoDetail = res.data
  279. // wx.setStorageSync('userInfo', res.data)
  280. this.userInfo = res.data
  281. })
  282. },
  283. toLogin() {
  284. wx.navigateTo({ url: '/pages/login/login' })
  285. },
  286. pageTo(url) {
  287. wx.navigateTo({ url: url })
  288. },
  289. showQRcode() {
  290. this.$refs.popup.open()
  291. },
  292. },
  293. }
  294. </script>
  295. <style scoped lang="scss">
  296. .btn {
  297. border: none;
  298. outline: none;
  299. background-color: #fff;
  300. &::after {
  301. border: none;
  302. }
  303. }
  304. .qrcodeImg {
  305. width: 70vw;
  306. border-radius: 5px;
  307. }
  308. </style>