index.vue 6.5 KB

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