index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <!-- 设置 -->
  3. <view class="userSet">
  4. <navigator url="/pages/users/user_info/index" hover-class="none" class="userInfo acea-row row-between-wrapper">
  5. <view class="picTxt acea-row row-middle">
  6. <view class="pictrue">
  7. <image :src="userInfo.avatar"></image>
  8. </view>
  9. <view class="text">
  10. <view class="name line1">{{userInfo.nickname}}</view>
  11. <view class="info">ID:{{userInfo.uid}}</view>
  12. </view>
  13. </view>
  14. <view class="iconfont icon-xiangyou"></view>
  15. </navigator>
  16. <view class="list">
  17. <view class="item acea-row row-between-wrapper" v-if="userInfo.link_uid">
  18. <view>节点</view>
  19. <view hover-class="none" class="input grab">
  20. {{userInfo.link_uid}}
  21. </view>
  22. </view>
  23. <view class="item acea-row row-between-wrapper" v-if="!userInfo.link_uid">
  24. <view>节点</view>
  25. <navigator url="/pages/users/user_point/index" hover-class="none" class="input grab">
  26. 点击设置节点<text class="iconfont icon-xiangyou"></text>
  27. </navigator>
  28. </view>
  29. <view class="item acea-row row-between-wrapper">
  30. <view>支付密码</view>
  31. <navigator url="/pages/users/user_bus_edit/index" hover-class="none" class="input grab">
  32. 点击设置支付密码<text class="iconfont icon-xiangyou"></text>
  33. </navigator>
  34. </view>
  35. <!-- #ifdef H5 -->
  36. <view class="item acea-row row-between-wrapper" v-if="userInfo.phone && !this.$wechat.isWeixin()">
  37. <view>密码</view>
  38. <navigator url="/pages/users/user_pwd_edit/index" hover-class="none" class="input grab">
  39. 点击修改密码<text class="iconfont icon-xiangyou"></text>
  40. </navigator>
  41. </view>
  42. <!-- #endif -->
  43. <!-- #ifdef APP-PLUS -->
  44. <view class="item acea-row row-between-wrapper" v-if="userInfo.phone">
  45. <view>密码</view>
  46. <navigator url="/pages/users/user_pwd_edit/index" hover-class="none" class="grab">
  47. 点击修改密码<text class="iconfont icon-xiangyou"></text>
  48. </navigator>
  49. </view>
  50. <!-- #endif -->
  51. <view class="item acea-row row-between-wrapper" v-if="userInfo.phone">
  52. <view>更换手机号码</view>
  53. <navigator url="/pages/users/user_phone/index?type=1" hover-class="none" class="grab">
  54. 点击更换手机号码<text class="iconfont icon-xiangyou"></text>
  55. </navigator>
  56. </view>
  57. </view>
  58. <view class="list">
  59. <view class="item acea-row row-between-wrapper">
  60. <view>地址管理</view>
  61. <navigator url="/pages/users/user_address_list/index" hover-class="none" class="grab">
  62. 点击前往<text class="iconfont icon-xiangyou"></text>
  63. </navigator>
  64. </view>
  65. <view class="item acea-row row-between-wrapper">
  66. <view>发票管理</view>
  67. <navigator url="/pages/users/user_invoice_list/index" hover-class="none" class="grab">
  68. 点击前往<text class="iconfont icon-xiangyou"></text>
  69. </navigator>
  70. </view>
  71. </view>
  72. <view class="list">
  73. <!-- #ifdef MP -->
  74. <view class='item acea-row row-between-wrapper'>
  75. <view>权限设置</view>
  76. <view class="input grab" @click="Setting">
  77. 点击管理<text class="iconfont icon-xiangyou"></text>
  78. </view>
  79. </view>
  80. <!-- #endif -->
  81. <view class="item acea-row row-between-wrapper">
  82. <view>账号注销</view>
  83. <navigator url="/pages/users/user_cancellation/index" hover-class="none" class="input grab">
  84. 注销后无法恢复<text class="iconfont icon-xiangyou"></text>
  85. </navigator>
  86. </view>
  87. </view>
  88. <!-- #ifdef MP -->
  89. <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
  90. <!-- #endif -->
  91. </view>
  92. </template>
  93. <style lang="scss">
  94. .userSet {
  95. .userInfo {
  96. margin-top: 20rpx;
  97. background-color: #fff;
  98. padding: 0 30rpx;
  99. height: 144rpx;
  100. .iconfont {
  101. font-size: 30rpx;
  102. color: #868686;
  103. }
  104. .picTxt {
  105. .text {
  106. width: 524rpx;
  107. margin-left: 30rpx;
  108. font-weight: 400;
  109. .name {
  110. font-size: 32rpx;
  111. color: #333;
  112. }
  113. .info {
  114. font-size: 24rpx;
  115. color: #999;
  116. margin-top: 5rpx;
  117. }
  118. }
  119. .pictrue {
  120. width: 88rpx;
  121. height: 88rpx;
  122. image {
  123. width: 100%;
  124. height: 100%;
  125. border: 1px solid #eee;
  126. border-radius: 50%;
  127. }
  128. }
  129. }
  130. }
  131. .list {
  132. background-color: #fff;
  133. margin-top: 20rpx;
  134. .item {
  135. padding: 30rpx 30rpx 30rpx 0;
  136. border-bottom: 1rpx solid #f2f2f2;
  137. margin-left: 30rpx;
  138. font-size: 32rpx;
  139. color: #333;
  140. .grab {
  141. color: #ccc;
  142. .iconfont {
  143. font-size: 30rpx;
  144. color: #868686;
  145. margin-left: 6rpx;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. </style>
  152. <script>
  153. import {
  154. getUserInfo
  155. } from '@/api/user.js';
  156. import {
  157. toLogin
  158. } from '@/libs/login.js';
  159. import {
  160. mapGetters
  161. } from "vuex";
  162. export default {
  163. computed: mapGetters(['isLogin']),
  164. data() {
  165. return {
  166. userInfo: {},
  167. isShowAuth: false
  168. }
  169. },
  170. onLoad() {},
  171. onShow() {
  172. if (this.isLogin) {
  173. this.getUserInfo();
  174. } else {
  175. //#ifndef MP
  176. toLogin();
  177. //#endif
  178. //#ifdef MP
  179. this.isShowAuth = true;
  180. //#endif
  181. }
  182. },
  183. methods: {
  184. /**
  185. * 小程序设置
  186. */
  187. Setting: function() {
  188. uni.openSetting({
  189. success: function(res) {}
  190. });
  191. },
  192. onLoadFun() {
  193. this.getUserInfo();
  194. this.isShowAuth = false
  195. },
  196. // 授权关闭
  197. authColse: function(e) {
  198. this.isShowAuth = e
  199. },
  200. getUserInfo() {
  201. let that = this;
  202. getUserInfo().then(res => {
  203. that.userInfo = res.data;
  204. });
  205. },
  206. // 获取用户列表
  207. getMenList() {
  208. let that = this
  209. try{
  210. that.$io.read("MenList.json").then(res => {
  211. // res 读取的文件内容
  212. console.log(res)
  213. }).catch(err => {
  214. // 找不到该文件就写入一个空白文件。
  215. that.$io.storage("MenList.json", [])
  216. console.log(err, "err")
  217. })
  218. }catch(e){
  219. //TODO handle the exception
  220. console.log(e)
  221. }
  222. }
  223. }
  224. }
  225. </script>