personal.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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')" v-if="user.userType == 5 && user.auth == 0">
  11. <text class="icon">&#xe64e;</text>
  12. <text>你还未认证,请先认证</text>
  13. <text class="icon" style="float: right">&#xe8f2;</text>
  14. </view>
  15. <view class="message _error" @click="go('/pages/authentication/purchaser/index')" v-if="user.userType == 3 && user.auth == 0">
  16. <text class="icon">&#xe64e;</text>
  17. <text>你还未认证,请先认证</text>
  18. <text class="icon" style="float: right">&#xe8f2;</text>
  19. </view>
  20. <view class="message _info" @click="go('/pages/face/faceRegister')" v-if="(user.userType == 1 || user.userType == 2) && user.face == 0">
  21. <text class="icon">&#xe78d;</text>
  22. <text>你还未人脸认证,请先人脸认证</text>
  23. <text class="icon" style="float: right">&#xe8f2;</text>
  24. </view>
  25. <!--用户信息-->
  26. <view class="user">
  27. <image src="../../static/icon/user.png" mode="widthFix" class="head"></image>
  28. <view class="con">
  29. <view class="nickName omit">{{ user.phone }}</view>
  30. <view class="tag" v-if="user.userType == 1">普通边民</view>
  31. <view class="tag" v-if="user.userType == 2">互市组长</view>
  32. <view class="tag" v-if="user.userType == 3">采购商</view>
  33. <view class="tag" v-if="user.userType == 4">司机</view>
  34. <view class="tag" v-if="user.userType == 5">商户</view>
  35. <view class="tag" v-if="user.userType == 6">合作社</view>
  36. </view>
  37. <text class="icon edit" @click="go('/pages/personal/my')">&#xe645;</text>
  38. <view class="clear"></view>
  39. </view>
  40. <!--边民菜单-->
  41. <!-- <view class="menu" v-if="user.userType == 1">
  42. <view class="msn" @click="go('/pages/market/one/leader/order')">
  43. <view class="out">
  44. <view class="int">
  45. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  46. <view class="tit">我的订单</view>
  47. </view>
  48. </view>
  49. </view>
  50. </view> -->
  51. <!--边民菜单与组长菜单-->
  52. <view class="menu" v-if="user.userType == 1 || user.userType == 2">
  53. <!-- <view class="msn" @click="go('/pages/market/one/leader/cart')">
  54. <view class="out">
  55. <view class="int">
  56. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe604;</view>
  57. <view class="tit">购物车</view>
  58. </view>
  59. </view>
  60. </view> -->
  61. <view class="msn" @click="go('/pages/market/one/leader/order')">
  62. <view class="out">
  63. <view class="int">
  64. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  65. <view class="tit">一级订单</view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="msn" @click="go('/pages/market/two/leader/order')">
  70. <view class="out">
  71. <view class="int">
  72. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  73. <view class="tit">二级订单</view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <!--收购商-->
  79. <view class="menu" v-if="user.userType == 3">
  80. <view class="msn" @click="go('/pages/market/two/purchaser/order/cart')">
  81. <view class="out">
  82. <view class="int">
  83. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe604;</view>
  84. <view class="tit">购物车</view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- <view class="msn" @click="go('/pages/market/two/purchaser/buy/list')">
  89. <view class="out">
  90. <view class="int">
  91. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  92. <view class="tit">采购需求</view>
  93. </view>
  94. </view>
  95. </view> -->
  96. <view class="msn" @click="go('/pages/market/two/purchaser/address/list')">
  97. <view class="out">
  98. <view class="int">
  99. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe623;</view>
  100. <view class="tit">地址管理</view>
  101. </view>
  102. </view>
  103. </view>
  104. <view class="msn" @click="go('/pages/market/two/purchaser/order/list')">
  105. <view class="out">
  106. <view class="int">
  107. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  108. <view class="tit">我的订单</view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="msn" @click="go('/pages/authentication/purchaser/info')">
  113. <view class="out">
  114. <view class="int">
  115. <view class="icon ioc" style="background-color: #e0ffff; color: #00bfff">&#xe660;</view>
  116. <view class="tit">我的认证</view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <!--外籍商户-->
  122. <!-- <view class="menu" v-if="user.userType == 5">
  123. <view class="msn" @click="go('/pages/market/one/merchant/goods/list')">
  124. <view class="out">
  125. <view class="int">
  126. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  127. <view class="tit">商品管理</view>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="msn" @click="go('/pages/market/one/merchant/order/list')">
  132. <view class="out">
  133. <view class="int">
  134. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  135. <view class="tit">交易订单</view>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="msn" @click="go('/pages/authentication/index')">
  140. <view class="out">
  141. <view class="int">
  142. <view class="icon ioc" style="background-color: #e0ffff; color: #00bfff">&#xe660;</view>
  143. <view class="tit">我的认证</view>
  144. </view>
  145. </view>
  146. </view>
  147. </view> -->
  148. <!--合作社-->
  149. <view class="menu" v-if="user.userType == 6">
  150. <view class="msn" @click="go('/pages/market/one/cooperative/order')">
  151. <view class="out">
  152. <view class="int">
  153. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  154. <view class="tit">结算单</view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. <view class="cmd">
  160. <view class="s_item" @click="go('/pages/personal/bankInfo')">
  161. <text class="icon ic">&#xe662;</text>
  162. <text class="title">银行卡</text>
  163. <text class="icon arrow">&#xe8f2;</text>
  164. </view>
  165. <view class="s_item" @click="go('/pages/personal/commissionAgreement')">
  166. <text class="icon ic">&#xe662;</text>
  167. <text class="title">互助委托协议</text>
  168. <text class="icon arrow">&#xe8f2;</text>
  169. </view>
  170. <view class="s_item" @click="go('/pages/login/userAgreement?id=1')">
  171. <text class="icon ic">&#xe662;</text>
  172. <text class="title">用户协议</text>
  173. <text class="icon arrow">&#xe8f2;</text>
  174. </view>
  175. <view class="s_item" @click="go('/pages/login/userAgreement?id=2')">
  176. <text class="icon ic">&#xe643;</text>
  177. <text class="title">隐私协议</text>
  178. <text class="icon arrow">&#xe8f2;</text>
  179. </view>
  180. <!-- <view class="s_item" @click="go('/pages/personal/setting')">
  181. <text class="icon ic">&#xe817;</text>
  182. <text class="title">设置</text>
  183. <text class="icon arrow">&#xe8f2;</text>
  184. </view> -->
  185. <view class="s_item" @click="go('/pages/personal/editPassword')">
  186. <text class="icon ic">&#xe817;</text>
  187. <text class="title">修改密码</text>
  188. <text class="icon arrow">&#xe8f2;</text>
  189. </view>
  190. </view>
  191. <button class="btn exit" @click="exitLogin()">退出登录</button>
  192. </view>
  193. </view>
  194. </template>
  195. <script>
  196. export default {
  197. data() {
  198. return {
  199. user: {}
  200. };
  201. },
  202. onLoad() {
  203. //人脸认证界面成功的回调
  204. uni.$on('face', res => {
  205. this.http.request({
  206. url: '/sp-admin/app/AppUser/face',
  207. method: 'POST',
  208. success: res => {
  209. this.user.face = 1;
  210. }
  211. });
  212. });
  213. },
  214. onShow() {
  215. this.user = this.getUser();
  216. if (!this.hasAuth()) {
  217. this.http.request({
  218. url: '/sp-admin/app/AppUser/getAuth',
  219. success: res => {
  220. this.user.auth = res.data.data.auth;
  221. this.user.face=res.data.data.face;
  222. uni.setStorageSync('info', this.user);
  223. }
  224. });
  225. }
  226. },
  227. methods: {
  228. order() {
  229. if (!this.hasAuth()) {
  230. uni.navigateTo({ url: '/pages/authentication/index' });
  231. return;
  232. }
  233. //组长
  234. if (this.user.userType == 2) {
  235. uni.navigateTo({ url: 'user' });
  236. }
  237. //外籍商户
  238. if (this.user.userType == 5) {
  239. uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
  240. }
  241. //收购商
  242. if (this.user.userType == 3) {
  243. uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
  244. }
  245. },
  246. go(url) {
  247. if (!this.hasAuth() && this.user.userType == 5) {
  248. uni.navigateTo({ url: '/pages/authentication/index' });
  249. return;
  250. }
  251. if (!this.hasAuth() && this.user.userType == 3) {
  252. uni.navigateTo({ url: '/pages/authentication/purchaser/index' });
  253. return;
  254. }
  255. uni.navigateTo({ url: url });
  256. },
  257. exitLogin() {
  258. let param = {
  259. appUserId: this.getUser().id
  260. };
  261. uni.showModal({
  262. title: '提示',
  263. content: '确定注销登录?',
  264. success: res => {
  265. if (res.confirm) {
  266. uni.removeStorageSync('token');
  267. uni.removeStorageSync('info');
  268. uni.removeStorageSync('menu');
  269. uni.redirectTo({ url: '/pages/login/login' });
  270. this.http.request({
  271. url: '/sp-admin/app/AppUser/logout',
  272. data: param,
  273. success: res => {
  274. }
  275. });
  276. }
  277. }
  278. });
  279. }
  280. }
  281. };
  282. </script>
  283. <style lang="scss">
  284. page {
  285. background-color: #f5f5f5;
  286. }
  287. .my_top {
  288. position: relative;
  289. overflow: hidden;
  290. image {
  291. width: 100%;
  292. }
  293. }
  294. .list {
  295. position: relative;
  296. padding: 0px 20px 10px 20px;
  297. margin-top: -196px;
  298. .user {
  299. background-color: white;
  300. padding: 20px;
  301. border-radius: 8px;
  302. color: $font-c;
  303. .head {
  304. float: left;
  305. width: 55px;
  306. height: 55px;
  307. }
  308. .con {
  309. float: left;
  310. padding-left: 15px;
  311. width: 60%;
  312. .nickName {
  313. font-size: 17px;
  314. font-weight: bold;
  315. }
  316. .tag {
  317. background-color: #6799ad;
  318. color: white;
  319. float: left;
  320. font-size: 13px;
  321. padding: 2px 6px;
  322. border-radius: 5px;
  323. margin-top: 6px;
  324. }
  325. }
  326. .edit {
  327. float: right;
  328. font-size: 20px;
  329. margin-top: 17px;
  330. }
  331. }
  332. }
  333. .exit {
  334. margin-top: 20px;
  335. background-color: white;
  336. color: #f44336;
  337. }
  338. </style>