my.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="page">
  3. <view class="topBody">
  4. <view class="header">
  5. <view class="infoBg">
  6. <view class="left" @click="goPage('/pages/login/loginFirst')">
  7. <image class="img" mode="widthFix" :src="myinfo.avator"></image>
  8. </view>
  9. <view class="right" @click="goPage('/pages/login/loginFirst')">
  10. <view class="nickname">
  11. <text>{{myinfo.nickname}}</text>
  12. <image src="../../static/me/icon_vip.png" mode="widthFix" />
  13. <view class="siming">已实名</view>
  14. </view>
  15. <view class="join_date">
  16. {{myinfo.join_name}}
  17. <image src="../../static/me/arrow_right.png" mode="widthFix" />
  18. </view>
  19. </view>
  20. <view class="dashang" @click="chkSel">
  21. <view class="sel" v-if="sel == 1">
  22. <view class="name">关闭<br />打赏</view>
  23. <view class="block"></view>
  24. </view>
  25. <view class="selno" v-else>
  26. <view class="blockGray"></view>
  27. <view class="name">开启<br />打赏</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="myinfo">
  33. <view class="line"></view>
  34. <view class="numlist">
  35. <view class="item">
  36. <view class="num">
  37. <text style="color:#FF2A95;">{{myinfo.num_gmd}}</text>
  38. <view class="name">我的糖果</view>
  39. </view>
  40. </view>
  41. <view class="item">
  42. <view class="num">
  43. <text>{{myinfo.num_gmb}}</text>
  44. <view class="name">我的M币</view>
  45. </view>
  46. </view>
  47. <view class="item">
  48. <view class="num" @click="goPage('/pages/w3/ucenter')">
  49. <image src="../../static/me/web3.0.png" mode="widthFix" />
  50. <view class="name">WEB3.0</view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="numlist2" style="margin-top: 60rpx;">
  55. <view class="item" @click="goPage('/pages/my/idcheck')">
  56. <view class="num">
  57. <image class="icon" src="../../static/me/icon_list.png" mode="widthFix" />
  58. <view class="name">身份认证</view>
  59. </view>
  60. </view>
  61. <view class="item" v-for="(item,index) in 0">
  62. <view class="num">
  63. <image class="icon" src="../../static/me/icon_list.png" mode="widthFix" />
  64. <view class="name">基本资料</view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="btn_submit" @click="onLogout()">退出登录</view>
  70. <view class="blankHeight"></view>
  71. <view class="blankHeight"></view>
  72. </view>
  73. <!-- 提示框 -->
  74. <DialogBox ref="DialogBox"></DialogBox>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. components: {},
  80. data() {
  81. return {
  82. title: '',
  83. sel: 1,
  84. myinfo: {
  85. nickname: '王思思',
  86. join_name: '注册日期:2024年5月',
  87. num_1: 0,
  88. num_2: 0,
  89. num_3: 0,
  90. num_4: 0,
  91. is_login: 'no',
  92. num_history: 0,
  93. num_collection: 0
  94. },
  95. }
  96. },
  97. onLoad() {
  98. setTimeout(function() {
  99. uni.setNavigationBarColor({
  100. frontColor: '#ffffff',
  101. backgroundColor: '#00000000',
  102. animation: {
  103. duration: 400,
  104. timingFunc: 'easeIn'
  105. }
  106. })
  107. }, 200);
  108. },
  109. onShow() {
  110. this.loadData();
  111. },
  112. methods: {
  113. onBack() {},
  114. chkSel() {
  115. if (this.sel == 1) {
  116. this.sel = 0;
  117. } else {
  118. this.sel = 1;
  119. }
  120. },
  121. goPage(page) {
  122. uni.navigateTo({
  123. url: page,
  124. })
  125. },
  126. loadData() {
  127. console.log({
  128. uuid: getApp().globalData.uuid,
  129. skey: getApp().globalData.skey
  130. });
  131. uni.request({
  132. url: this.$apiHost + '/Web/getinfo',
  133. data: {
  134. uuid: getApp().globalData.uuid,
  135. skey: getApp().globalData.skey
  136. },
  137. header: {
  138. "content-type": "application/json", //自定义请求头信息
  139. },
  140. success: (res) => {
  141. console.log("----:", res.data);
  142. this.myinfo = res.data;
  143. },
  144. complete: (com) => {
  145. // uni.hideLoading();
  146. },
  147. fail: (e) => {
  148. console.log("----e:", e);
  149. }
  150. });
  151. },
  152. onLogout() {
  153. let that = this;
  154. this.$refs['DialogBox'].confirm({
  155. title: '提示',
  156. content: '确定退出吗?',
  157. DialogType: 'inquiry',
  158. btn1: '取消',
  159. btn2: '退出',
  160. animation: 0
  161. }).then((res) => {
  162. uni.request({
  163. url: that.$apiHost + '/My/logout',
  164. data: {
  165. uuid: getApp().globalData.uuid,
  166. skey: getApp().globalData.skey
  167. },
  168. header: {
  169. "content-type": "application/json", //自定义请求头信息
  170. },
  171. success: (res) => {
  172. console.log("----:", res.data);
  173. getApp().globalData.skey = "";
  174. getApp().globalData.uuid = "";
  175. uni.removeStorageSync("wapptoken");
  176. uni.redirectTo({
  177. url: '/pages/login/login'
  178. })
  179. },
  180. complete: (com) => {
  181. // uni.hideLoading();
  182. },
  183. fail: (e) => {
  184. console.log("----e:", e);
  185. }
  186. });
  187. })
  188. },
  189. }
  190. }
  191. </script>
  192. <style scoped lang="scss">
  193. @import 'my.scss';
  194. </style>