personal.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <view>
  3. <u-notify ref="uNotify" message="Hi uView"></u-notify>
  4. <!--头部-->
  5. <view class="my_top">
  6. <image src="../../static/images/top-bg.png" class="bg"></image>
  7. </view>
  8. <view class="list animated fadeInDown">
  9. <!--只有外籍商户和收购商才需要手动认证-->
  10. <view class="message _error" @click="go('/pages/authentication/index')"
  11. v-if="user.userType == 5 && user.auth == 0">
  12. <text class="icon">&#xe64e;</text>
  13. <text>你还未认证,请先认证</text>
  14. <text class="icon" style="float: right">&#xe8f2;</text>
  15. </view>
  16. <view class="message _error" @click="go('/pages/authentication/purchaser/index')"
  17. v-if="user.userType == 3 && user.auth == 0">
  18. <text class="icon">&#xe64e;</text>
  19. <text>你还未认证,请先认证</text>
  20. <text class="icon" style="float: right">&#xe8f2;</text>
  21. </view>
  22. <view class="message _info" @click="go('/pages/face/faceRegister')"
  23. v-if="(user.userType == 1 || user.userType == 2) && user.face == 0">
  24. <text class="icon">&#xe78d;</text>
  25. <text>你还未人脸认证,请先人脸认证</text>
  26. <text class="icon" style="float: right">&#xe8f2;</text>
  27. </view>
  28. <view class="message _info" v-if="(user.userType == 1 || user.userType == 2) && user.face == 1">
  29. <text class="icon">&#xe643;</text>
  30. <text>人脸已认证<text style="color: blue;margin-left: 5px;"></text></text>
  31. </view>
  32. <!--用户信息-->
  33. <view class="user">
  34. <image src="../../static/icon/user.png" mode="widthFix" class="head"></image>
  35. <view class="con">
  36. <view class="nickName omit">{{user.name}}({{ user.phone }})</view>
  37. <view class="tag" v-if="user.userType == 1">边民</view>
  38. <view class="tag" v-if="user.userType == 2">组长</view>
  39. <view class="tag" v-if="user.userType == 3">收购商</view>
  40. <view class="tag" v-if="user.userType == 4">司机</view>
  41. <view class="tag" v-if="user.userType == 5">商户</view>
  42. <view class="tag" v-if="user.userType == 6">合作社</view>
  43. </view>
  44. <view class="clear"></view>
  45. </view>
  46. <view class="cmd">
  47. <view class="s_item" @click="go('/pages/personal/bankInfo')">
  48. <text class="icon ic">&#xe69a;</text>
  49. <text class="title">银行卡</text>
  50. <text class="icon arrow">&#xe8f2;</text>
  51. </view>
  52. <view v-if="user.userType==1" class="s_item" @click="go('/pages/personal/myGroup')">
  53. <text class="icon ic">&#xe686;</text>
  54. <text class="title">我的互助组</text>
  55. <text class="icon arrow">&#xe8f2;</text>
  56. </view>
  57. <view class="s_item" @click="go('/pages/login/userAgreement?id=1')">
  58. <text class="icon ic">&#xe662;</text>
  59. <text class="title">用户协议</text>
  60. <text class="icon arrow">&#xe8f2;</text>
  61. </view>
  62. <view class="s_item" @click="go('/pages/login/userAgreement?id=2')">
  63. <text class="icon ic">&#xe643;</text>
  64. <text class="title">隐私协议</text>
  65. <text class="icon arrow">&#xe8f2;</text>
  66. </view>
  67. <!-- <view class="s_item" @click="go('/pages/personal/setting')">
  68. <text class="icon ic">&#xe817;</text>
  69. <text class="title">设置</text>
  70. <text class="icon arrow">&#xe8f2;</text>
  71. </view> -->
  72. <view class="s_item" @click="go('/pages/personal/editPassword')">
  73. <text class="icon ic">&#xe817;</text>
  74. <text class="title">修改密码</text>
  75. <text class="icon arrow">&#xe8f2;</text>
  76. </view>
  77. <view class="s_item " @click="go('/pages/personal/group')" v-if="user.userType==1&&!user.groupName">
  78. <text class="icon ic">&#xe686;</text>
  79. <text class="title" style="color: firebrick;;font-weight: bold;">加入互助组</text>
  80. <text class="icon arrow">&#xe8f2;</text>
  81. </view>
  82. <view class="s_item ">
  83. <text class="icon ic">&#xe622;</text>
  84. <text class="title">APP版本 {{version}}</text>
  85. </view>
  86. </view>
  87. <button class="btn exit" @click="exitLogin()">退出登录</button>
  88. <button class="btn exit" @click="cancelAccount()">注销账号</button>
  89. </view>
  90. <view class="version">
  91. <view>
  92. <view>Copyright@2024-2030</view>
  93. <view>天保国际物流投资有限公司版权所有</view>
  94. </view>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. export default {
  100. data() {
  101. return {
  102. user: {},
  103. version: uni.getAppBaseInfo().appVersion
  104. };
  105. },
  106. onLoad() {
  107. },
  108. onShow() {
  109. this.user = this.getUser();
  110. this.http.request({
  111. url: '/sp-admin/app/AppUser/getAuth',
  112. success: res => {
  113. this.user.auth = res.data.data.auth;
  114. this.user.face = res.data.data.face;
  115. if (this.user.userType == 1) {
  116. this.user.groupName = res.data.data.groupName;
  117. this.user.groupId = res.data.data.groupId;
  118. this.user.leaderName = res.data.data.leaderName;
  119. this.user.leaderPhone = res.data.data.leaderPhone;
  120. if (!this.user.groupName) {
  121. this.$refs.uNotify.show({
  122. top: 10,
  123. type: 'error',
  124. color: '#ffffff',
  125. bgColor: '#ff5500',
  126. message: '未加入互助组,请先加入互助组',
  127. duration: 1000 * 20,
  128. fontSize: 20,
  129. safeAreaInsetTop: true
  130. })
  131. return;
  132. }
  133. }
  134. uni.setStorageSync('info', this.user);
  135. }
  136. });
  137. },
  138. methods: {
  139. makePhoneCall(phone) {
  140. uni.makePhoneCall({
  141. phoneNumber: phone
  142. });
  143. },
  144. order() {
  145. if (!this.hasAuth()) {
  146. uni.navigateTo({
  147. url: '/pages/authentication/index'
  148. });
  149. return;
  150. }
  151. //组长
  152. if (this.user.userType == 2) {
  153. uni.navigateTo({
  154. url: 'user'
  155. });
  156. }
  157. //外籍商户
  158. if (this.user.userType == 5) {
  159. uni.navigateTo({
  160. url: '/pages/market/one/merchant/order/list'
  161. });
  162. }
  163. //收购商
  164. if (this.user.userType == 3) {
  165. uni.navigateTo({
  166. url: '/pages/market/two/purchaser/order/list'
  167. });
  168. }
  169. },
  170. go(url) {
  171. if (!this.hasAuth() && this.user.userType == 5) {
  172. uni.navigateTo({
  173. url: '/pages/authentication/index'
  174. });
  175. return;
  176. }
  177. if (!this.hasAuth() && this.user.userType == 3) {
  178. uni.navigateTo({
  179. url: '/pages/authentication/purchaser/index'
  180. });
  181. return;
  182. }
  183. uni.navigateTo({
  184. url: url
  185. });
  186. },
  187. exitLogin() {
  188. let param = {
  189. appUserId: this.getUser().id
  190. };
  191. uni.showModal({
  192. title: '提示',
  193. content: '确定注销登录?',
  194. success: res => {
  195. if (res.confirm) {
  196. uni.removeStorageSync('token');
  197. uni.removeStorageSync('info');
  198. uni.removeStorageSync('menu');
  199. uni.redirectTo({
  200. url: '/pages/login/login'
  201. });
  202. this.http.request({
  203. url: '/sp-admin/app/AppUser/logout',
  204. data: param,
  205. success: res => {
  206. }
  207. });
  208. }
  209. }
  210. });
  211. },
  212. cancelAccount() {
  213. let param = {
  214. id: this.getUser().id
  215. };
  216. uni.showModal({
  217. title: '提示',
  218. content: '确定注销账号?',
  219. success: res => {
  220. if (res.confirm) {
  221. uni.removeStorageSync('token');
  222. uni.removeStorageSync('info');
  223. uni.removeStorageSync('menu');
  224. uni.redirectTo({
  225. url: '/pages/login/login'
  226. });
  227. this.http.request({
  228. url: '/sp-admin/app/AppUser/delete',
  229. data: param,
  230. success: res => {}
  231. });
  232. }
  233. }
  234. });
  235. }
  236. }
  237. };
  238. </script>
  239. <style lang="scss">
  240. page {
  241. background-color: #f5f5f5;
  242. }
  243. .my_top {
  244. position: relative;
  245. overflow: hidden;
  246. image {
  247. width: 100%;
  248. }
  249. }
  250. .list {
  251. position: relative;
  252. padding: 0px 20px 10px 20px;
  253. margin-top: -196px;
  254. .user {
  255. background-color: white;
  256. padding: 20px;
  257. border-radius: 8px;
  258. color: $font-c;
  259. .head {
  260. float: left;
  261. width: 55px;
  262. height: 55px;
  263. }
  264. .con {
  265. float: left;
  266. padding-left: 15px;
  267. width: 80%;
  268. .nickName {
  269. font-size: 16px;
  270. font-weight: bold;
  271. }
  272. .tag {
  273. background-color: #6799ad;
  274. color: white;
  275. float: left;
  276. font-size: 13px;
  277. padding: 2px 6px;
  278. border-radius: 5px;
  279. margin-top: 6px;
  280. }
  281. }
  282. .edit {
  283. float: right;
  284. font-size: 20px;
  285. margin-top: 17px;
  286. }
  287. }
  288. }
  289. .exit {
  290. margin-top: 20px;
  291. background-color: white;
  292. color: #f44336;
  293. }
  294. .version {
  295. margin-left: 15%;
  296. position: fixed;
  297. bottom: 25px;
  298. color: #888484;
  299. text-align: center;
  300. }
  301. </style>