my.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <gui-page :customFooter="true" iphoneXButtomStyle="background:#F8F8F8"
  3. :footerSets="{height:150, zIndex:100, bg:'none'}" :isLoading="pageLoading">
  4. <view slot="gBody">
  5. <view class="gui-margin gui-margin-top">
  6. <text class="gui-h5 gui-color-gray gui-bold">个人中心</text>
  7. </view>
  8. <view hover-class="gui-tap" @click="login" v-if="fetch.user.id <= 0">
  9. <text class="gui-text-center gui-block-text gui-icons logoff gui-color-gray">&#xe629; 点此登录</text>
  10. </view>
  11. <view class="gui-list gui-margin-top gui-padding" @tap="user" v-if="fetch.user.id > 0">
  12. <view class="gui-list-items">
  13. <view class="gui-list-image ucenter-face gui-relative">
  14. <image class="gui-list-image ucenter-face-image"
  15. :src="fetch.user.avatar" mode="widthFix"></image>
  16. <text class="gui-bg-blue gui-badge-gender gui-color-white gui-icons" v-if="fetch.user.sex == 1">&#xe618;</text>
  17. <text class="gui-bg-red gui-badge-gender gui-color-white gui-icons" v-if="fetch.user.sex == 2">&#xe619;</text>
  18. <text class="gui-bg-green gui-badge-gender gui-color-white gui-icons" v-if="fetch.user.sex == 3">&#xe628;</text>
  19. </view>
  20. <view class="gui-list-body">
  21. <view class="gui-list-title">
  22. <view class="gui-list-title-text gui-primary-color">{{fetch.user.username}}
  23. <text v-if="fetch.user.title">({{fetch.user.title}})</text>
  24. </view>
  25. </view>
  26. <view class="gui-list-body-desc gui-color-gray gui-block-text"><view v-if="fetch.user.info">{{fetch.user.info}}</view>
  27. <view v-if="!fetch.user.info">暂无签名</view></view>
  28. </view>
  29. <text class="gui-list-arrow-right gui-icons gui-color-gray">&#xe601;</text>
  30. </view>
  31. </view>
  32. <view class="ucenter-line"></view>
  33. <view>
  34. <gui-box-banner :items="fetch.row"></gui-box-banner>
  35. </view>
  36. <block v-if="state">
  37. <view class="ucenter-line"></view>
  38. <view class="gui-list gui-margin-top gui-padding" >
  39. <view class="gui-list-items">
  40. <text class="gui-list-icon gui-icons gui-color-blue">&#xe60d;</text>
  41. <view class="gui-list-body gui-border-b">
  42. <view class="gui-list-title">
  43. <text class="gui-list-title-text">好友动态</text>
  44. <text class="gui-badge gui-bg-red gui-color-white">12</text>
  45. </view>
  46. </view>
  47. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  48. </view>
  49. <view class="gui-list-items">
  50. <text class="gui-list-icon gui-icons gui-color-green">&#xe612;</text>
  51. <view class="gui-list-body gui-border-b">
  52. <view class="gui-list-title">
  53. <text class="gui-list-title-text">我的钱包</text>
  54. </view>
  55. </view>
  56. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  57. </view>
  58. <view class="gui-list-items">
  59. <text class="gui-list-icon gui-icons gui-color-orange">&#xe624;</text>
  60. <view class="gui-list-body gui-border-b">
  61. <view class="gui-list-title">
  62. <text class="gui-list-title-text">我的发现</text>
  63. </view>
  64. </view>
  65. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  66. </view>
  67. <view class="gui-list-items">
  68. <text class="gui-list-icon gui-icons gui-color-red">&#xe687;</text>
  69. <view class="gui-list-body">
  70. <view class="gui-list-title">
  71. <text class="gui-list-title-text">身份认证</text>
  72. </view>
  73. </view>
  74. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  75. </view>
  76. </view>
  77. </block>
  78. <view class="ucenter-line"></view>
  79. <view class="gui-list gui-margin-top gui-padding">
  80. <view class="gui-list-items" style="display: none;">
  81. <text class="gui-list-icon gui-icons gui-color-yellow">&#xe613;</text>
  82. <view class="gui-list-body gui-border-b">
  83. <view class="gui-list-title">
  84. <text class="gui-list-title-text">账户设置</text>
  85. </view>
  86. </view>
  87. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  88. </view>
  89. <view class="gui-list-items" @click="check()">
  90. <text class="gui-list-icon gui-icons gui-color-green">&#xe61a;</text>
  91. <view class="gui-list-body">
  92. <view class="gui-list-title">
  93. <text class="gui-list-title-text">检查版本</text>
  94. <text class="gui-badge">1.0.0</text>
  95. </view>
  96. </view>
  97. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  98. </view>
  99. <view class="gui-list-items" @click="goView('use', '使用说明')">
  100. <text class="gui-list-icon gui-icons gui-color-red">&#xe629;</text>
  101. <view class="gui-list-body">
  102. <view class="gui-list-title">
  103. <text class="gui-list-title-text">使用说明</text>
  104. </view>
  105. </view>
  106. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  107. </view>
  108. <view class="gui-list-items" @click="goView('about', '关于合小记')">
  109. <text class="gui-list-icon gui-icons">&#xe60c;</text>
  110. <view class="gui-list-body">
  111. <view class="gui-list-title">
  112. <text class="gui-list-title-text">关于合小记</text>
  113. </view>
  114. </view>
  115. <text class="gui-list-arrow-right gui-icons">&#xe601;</text>
  116. </view>
  117. </view>
  118. <block v-if="fetch.user.id > 0">
  119. <view class="ucenter-line"></view>
  120. <view hover-class="gui-tap" @click="open">
  121. <text class="gui-text-center gui-block-text gui-icons logoff gui-color-gray">&#xe62e; 退出登录</text>
  122. </view>
  123. </block>
  124. <gui-modal ref="quit"
  125. title="确认退出">
  126. <view slot="content" class="gui-padding gui-bg-gray">
  127. <text class="gui-block-text gui-text-center gui-text gui-color-gray"
  128. style="line-height:100rpx; padding:10rpx;">您确定要这样退出吗?</text>
  129. </view>
  130. <!-- 利用 flex 布局 可以放置多个自定义按钮哦 -->
  131. <view slot="btns" class="gui-flex gui-rows gui-space-between">
  132. <view class="modal-btns gui-flex1" style="margin-right:80rpx;">
  133. <text class="modal-btns gui-color-gray" @tap="close">取消</text>
  134. </view>
  135. <view class="modal-btns gui-flex1" style="margin-left:80rpx;">
  136. <text class="modal-btns gui-color-blue" @tap="quit">确认</text>
  137. </view>
  138. </view>
  139. </gui-modal>
  140. </view>
  141. <foot ref="foot" slot="gFooter" :value="foot_value"></foot>
  142. </gui-page>
  143. </template>
  144. <script>
  145. import foot from '@/pages/index/foot.vue';
  146. export default {
  147. data() {
  148. return {
  149. state : false,
  150. foot_value : 4,
  151. fetch : {
  152. user : {},
  153. config : {
  154. home_top : '',
  155. },
  156. score : {},
  157. xuanchuan : [],
  158. share : false,
  159. row : [],
  160. },
  161. }
  162. },
  163. components:{
  164. foot
  165. },
  166. onShow() {
  167. this.$nextTick(function() {
  168. this.$refs.foot.cur = this.foot_value;
  169. });
  170. this.getData();
  171. },
  172. // 重新加载
  173. onPullDownRefresh: function() {
  174. this.getData();
  175. },
  176. methods: {
  177. getData : function() {
  178. this.Dever.get(this, 'app/collection/?l=api.my', {id:-1});
  179. },
  180. login : function() {
  181. this.Dever.goLogin();
  182. },
  183. user : function() {
  184. this.Dever.location('user/index');
  185. },
  186. quit : function() {
  187. this.close();
  188. this.Dever.setToken('');
  189. var self = this;
  190. this.Dever.alert('已退出', 'none', function() {
  191. self.Dever.location('index/my');
  192. });
  193. },
  194. open : function() {
  195. this.$refs.quit.open();
  196. },
  197. close : function() {
  198. this.$refs.quit.close();
  199. },
  200. goView : function(key, name) {
  201. var path = this.Dever.api_host + 'main/?l=page&key=' + key;
  202. this.Dever.location(path, 'webview', name);
  203. },
  204. check : function() {
  205. this.Dever.alert('当前已是最新版本');
  206. }
  207. }
  208. }
  209. </script>
  210. <style>
  211. .ucenter-face{width:100rpx; height:100rpx;}
  212. .ucenter-face-image{width:100rpx; height:100rpx;}
  213. .ucenter-line{height:20rpx; background-color:#F6F7F8; margin:16rpx 0;}
  214. .logoff{line-height:88rpx; font-size:28rpx;}
  215. .gui-list-title-text{line-height:60rpx;}
  216. .modal-btns{line-height:88rpx; font-size:26rpx; text-align:center; width:200rpx;}
  217. </style>