mine.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <view class="mine-page">
  3. <!-- 头部 -->
  4. <headContent borderBottom>
  5. <template #left>
  6. <reverse-back />
  7. </template>
  8. <template #content>
  9. <view class="haed-title">
  10. 个人中心
  11. </view>
  12. </template>
  13. <template #right>
  14. <page-style />
  15. </template>
  16. </headContent>
  17. <!-- 个人信息 -->
  18. <view class="mine-info" v-if="showMuen">
  19. <view class="mine-account">{{ userInfo.account_number }}</view>
  20. <view class="mine-UID">UID: {{ userInfo.id }}<text v-show="userInfo.id" class="mine-copy iconfont"
  21. @click.stop="setCopy(userInfo.id)">&#xe65f;</text>
  22. </view>
  23. </view>
  24. <!-- 个人信息 -->
  25. <view class="mine-info" v-else @click.stop="goLogin()">
  26. <view class="mine-account">点击登录/注册</view>
  27. <view class="mine-UID">Hi, 欢迎来到BiKing</view>
  28. </view>
  29. <gap />
  30. <!-- 个人信息 -->
  31. <view class="mine-muen">
  32. <view v-show="showMuen" class="mine-muen-item" @click.stop="openSafetySet()">
  33. <view class="muen-content">
  34. <text class="muen-icon iconfont">&#xec4d;</text>
  35. <!--
  36. <text class="muen-icon iconfont">&#xe616;</text> -->
  37. <text class="muen-text">安全设置</text>
  38. </view>
  39. <view class="muen-more">
  40. <text class="more-icon iconfont">&#xe8b5;</text>
  41. <!-- <image class="muen-more-icon" src="../../static/logo.png" mode="aspectFit" /> -->
  42. </view>
  43. </view>
  44. <view v-show="showMuen" class="mine-muen-item">
  45. <view class="muen-content">
  46. <text class="muen-icon iconfont">&#xe616;</text>
  47. <text class="muen-text">身份验证</text>
  48. </view>
  49. <view class="muen-more">
  50. <text class="muen-more-text">{{ userInfo.is_realname == 1 ? '去认证' : '' }}</text>
  51. <text class="more-icon iconfont">&#xe8b5;</text>
  52. </view>
  53. </view>
  54. <view v-show="showMuen" class="mine-muen-item" @click.stop="getAddress()">
  55. <view class="muen-content">
  56. <text class="muen-icon iconfont">&#xe688;</text>
  57. <text class="muen-text">提现地址</text>
  58. </view>
  59. <view class="muen-more">
  60. <text class="more-icon iconfont">&#xe8b5;</text>
  61. </view>
  62. </view>
  63. <view v-show="showMuen" class="mine-muen-item">
  64. <view class="muen-content">
  65. <text class="muen-icon iconfont">&#xe784;</text>
  66. <text class="muen-text">我的红包</text>
  67. </view>
  68. <view class="muen-more">
  69. <text class="more-icon iconfont">&#xe8b5;</text>
  70. </view>
  71. </view>
  72. <view v-show="showMuen" class="mine-muen-item" @click.stop="openActivityCenter()">
  73. <view class="muen-content">
  74. <text class="muen-icon iconfont">&#xe614;</text>
  75. <text class="muen-text">活动中心</text>
  76. </view>
  77. <view class="muen-more">
  78. <text class="more-icon iconfont">&#xe8b5;</text>
  79. </view>
  80. </view>
  81. <view class="mine-muen-item" @click.stop="openShare()">
  82. <view class="muen-content">
  83. <text class="muen-icon iconfont">&#xe615;</text>
  84. <text class="muen-text">邀请链接</text>
  85. </view>
  86. <view class="muen-more">
  87. <text class="more-icon iconfont">&#xe8b5;</text>
  88. </view>
  89. </view>
  90. <view v-show="showMuen" class="mine-muen-item">
  91. <view class="muen-content">
  92. <text class="muen-icon iconfont">&#xe6e3;</text>
  93. <text class="muen-text">合约战绩</text>
  94. </view>
  95. <view class="muen-more">
  96. <text class="more-icon iconfont">&#xe8b5;</text>
  97. </view>
  98. </view>
  99. </view>
  100. <gap />
  101. <view class="mine-muen">
  102. <view class="mine-muen-item" @click.stop="openSetting()">
  103. <view class="muen-content">
  104. <text class="muen-icon iconfont">&#xe616;</text>
  105. <text class="muen-text">系统设置</text>
  106. </view>
  107. <view class="muen-more">
  108. <text class="more-icon iconfont">&#xe8b5;</text>
  109. </view>
  110. </view>
  111. </view>
  112. <gap />
  113. <view class="mine-muen">
  114. <view class="mine-muen-item">
  115. <view class="muen-content">
  116. <text class="muen-icon iconfont">&#xe823;</text>
  117. <text class="muen-text">检查更新</text>
  118. </view>
  119. <view class="muen-more">
  120. <text class="muen-more-text">当前版本 V2.4.6 62</text>
  121. <text class="more-icon iconfont">&#xe8b5;</text>
  122. </view>
  123. </view>
  124. </view>
  125. <gap />
  126. <view class="mine-muen">
  127. <view class="mine-muen-item" @click.stop="getService()">
  128. <view class="muen-content">
  129. <text class="muen-icon iconfont">&#xe621;</text>
  130. <text class="muen-text">在线客服</text>
  131. </view>
  132. <view class="muen-more">
  133. <text class="more-icon iconfont">&#xe8b5;</text>
  134. </view>
  135. </view>
  136. <view class="mine-muen-item" @click.stop="getAboutUs()">
  137. <view class="muen-content">
  138. <text class="muen-icon iconfont">&#xe609;</text>
  139. <text class="muen-text">关于我们</text>
  140. </view>
  141. <view class="muen-more">
  142. <text class="more-icon iconfont">&#xe8b5;</text>
  143. </view>
  144. </view>
  145. <view class="mine-btn" @click.stop="retreatFromLogin" v-show="showMuen">
  146. 安全退出
  147. </view>
  148. </view>
  149. <!-- 邀请 -->
  150. <sharePage ref="sharePageRef" :tabBar="false" />
  151. <!-- 确认退出 -->
  152. <confirm-popup ref="confirmPopup" @confirm="confirmOut" content="确认退出此账号"/>
  153. </view>
  154. </template>
  155. <script>
  156. import {
  157. mapGetters
  158. } from 'vuex'
  159. import reverseBack from "@/components/headModules/reverse-back.vue"
  160. import pageStyle from "@/components/headModules/style.vue"
  161. import {
  162. Way_getUserInfo
  163. } from "@/utils/common-request.js"
  164. import {
  165. refreshAccount
  166. } from "@/utils/common.js"
  167. export default {
  168. components: {
  169. pageStyle,
  170. reverseBack
  171. },
  172. data() {
  173. return {
  174. showMuen: false,
  175. userInfo: {}
  176. };
  177. },
  178. onShow() {
  179. },
  180. computed: {
  181. ...mapGetters([
  182. 'token'
  183. ]),
  184. },
  185. watch: {
  186. token: {
  187. handler(newToken) {
  188. this.showMuen = newToken ? true : false
  189. if (newToken) {
  190. this.getUserInfo()
  191. }
  192. },
  193. immediate: true
  194. }
  195. },
  196. methods: {
  197. // 获取用户信息
  198. getUserInfo() {
  199. Way_getUserInfo().then(res => {
  200. this.userInfo = res
  201. }).catch(err => {
  202. this.userInfo = {}
  203. })
  204. },
  205. // 去登陆
  206. goLogin() {
  207. uni.navigateTo({
  208. url: '/pages/login/index'
  209. });
  210. },
  211. // 打开邀请
  212. openShare() {
  213. this.$nextTick(() => {
  214. this.$refs.sharePageRef.openShare()
  215. })
  216. },
  217. // 系统设置
  218. openSetting() {
  219. uni.navigateTo({
  220. url: '/pages/content/setting'
  221. })
  222. },
  223. // 安全设置
  224. openSafetySet() {
  225. uni.navigateTo({
  226. url: '/pages/content/safety-set'
  227. })
  228. },
  229. // 在线客服
  230. getService() {
  231. uni.navigateTo({
  232. url: '/pages/content/customer-service'
  233. })
  234. },
  235. // 关于我们
  236. getAboutUs() {
  237. this.getSinglePage(1)
  238. },
  239. // 安全退出
  240. retreatFromLogin() {
  241. this.$nextTick(() => {
  242. this.$refs.confirmPopup.open()
  243. });
  244. },
  245. // 确认 安全退出
  246. confirmOut() {
  247. refreshAccount()
  248. },
  249. // 获取地址列表
  250. getAddress() {
  251. uni.navigateTo({
  252. url: '/pages/content/address'
  253. })
  254. },
  255. // getAboutUs
  256. openActivityCenter() {
  257. this.getSinglePage(2)
  258. },
  259. getSinglePage(id) {
  260. uni.navigateTo({
  261. url: `/pages/content/h5-list?id=${id}`
  262. })
  263. },
  264. setCopy(val) {
  265. uni.setClipboardData({
  266. data: val,
  267. success: function() {
  268. uni.showToast({
  269. title: '复制成功',
  270. icon: 'none'
  271. })
  272. }
  273. });
  274. }
  275. }
  276. }
  277. </script>
  278. <style>
  279. page {
  280. background-color: #fff;
  281. }
  282. </style>
  283. <style lang="scss" scoped>
  284. .mine-info {
  285. width: 100%;
  286. min-height: 140rpx;
  287. background-color: $modules-box-bg;
  288. padding: 23rpx $pages-padding 30rpx;
  289. display: flex;
  290. flex-direction: column;
  291. justify-content: space-between;
  292. .mine-account {
  293. font-size: 34rpx;
  294. font-family: PingFang SC, PingFang SC-Bold;
  295. font-weight: 700;
  296. color: #1a1a1a;
  297. }
  298. .mine-UID {
  299. margin-top: 13rpx;
  300. font-size: 22rpx;
  301. font-family: PingFang SC, PingFang SC-Regular;
  302. font-weight: 400;
  303. color: #808080;
  304. display: flex;
  305. align-items: center;
  306. .copy-UID {
  307. width: 22rpx;
  308. height: 26rpx;
  309. margin-left: 12rpx;
  310. }
  311. .mine-copy {
  312. margin-left: 10rpx;
  313. font-size: 30rpx;
  314. }
  315. }
  316. }
  317. // <view class="mine-muen">
  318. // <view class="muen-content">
  319. // <image class="muen-icon" src="../../static/logo.png" mode="aspectFit" /> <text class="muen-text">安全设置</text>
  320. // </view>
  321. // <image class="muen-moey" src="../../static/logo.png" mode="aspectFit" />
  322. // </view>
  323. .mine-muen-item {
  324. width: 100%;
  325. height: 94rpx;
  326. display: flex;
  327. justify-content: space-between;
  328. align-items: center;
  329. background-color: $modules-box-bg;
  330. padding: 0 $pages-padding;
  331. border-bottom: 1rpx solid #f2f2f2;
  332. &:last-child {
  333. border-bottom: none;
  334. }
  335. .muen-content {
  336. display: flex;
  337. align-items: center;
  338. .muen-icon {
  339. width: 50rpx;
  340. // height: 28rpx;
  341. font-size: 32rpx;
  342. }
  343. .muen-text {
  344. font-size: 28rpx;
  345. font-family: PingFang SC, PingFang SC-Regular;
  346. font-weight: 400;
  347. color: #1a1a1a;
  348. line-height: 40rpx;
  349. }
  350. }
  351. .muen-more {
  352. flex-shrink: 0;
  353. display: flex;
  354. align-items: center;
  355. .muen-more-text {
  356. font-size: 28rpx;
  357. font-family: PingFang SC, PingFang SC-Regular;
  358. font-weight: 400;
  359. color: #0abd76;
  360. padding-right: 8rpx;
  361. }
  362. .more-icon {
  363. font-size: 30rpx;
  364. color: #939292;
  365. transform: rotate(-180deg);
  366. }
  367. }
  368. }
  369. .mine-btn {
  370. width: 690rpx;
  371. height: 90rpx;
  372. margin: 80rpx auto;
  373. background: #05c175;
  374. border-radius: 8rpx;
  375. font-size: 30rpx;
  376. font-family: PingFang SC, PingFang SC-Regular;
  377. font-weight: 400;
  378. text-align: center;
  379. color: #ffffff;
  380. line-height: 90rpx;
  381. letter-spacing: 0.64rpx;
  382. }
  383. </style>