personal.vue 8.8 KB

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