personal.vue 9.2 KB

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