personal.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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 == 3 || 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. <!--用户信息-->
  16. <view class="user">
  17. <image src="../../static/icon/user.png" mode="widthFix" class="head"></image>
  18. <view class="con">
  19. <view class="nickName omit">{{ user.phone }}</view>
  20. <view class="tag" v-if="user.userType == 1">普通边民</view>
  21. <view class="tag" v-if="user.userType == 2">互市组长</view>
  22. <view class="tag" v-if="user.userType == 3">收购商</view>
  23. <view class="tag" v-if="user.userType == 4">司机</view>
  24. <view class="tag" v-if="user.userType == 5">外籍商户</view>
  25. </view>
  26. <text class="icon edit" @click="go('/pages/personal/my')">&#xe645;</text>
  27. <view class="clear"></view>
  28. </view>
  29. <!--边民菜单-->
  30. <view class="menu" v-if="user.userType == 1">
  31. <view class="msn" @click="go('/pages/market/one/leader/order')">
  32. <view class="out">
  33. <view class="int">
  34. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  35. <view class="tit">我的订单</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <!--组长菜单-->
  41. <view class="menu" v-if="user.userType == 2">
  42. <view class="msn" @click="go('/pages/market/one/leader/cart')">
  43. <view class="out">
  44. <view class="int">
  45. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe604;</view>
  46. <view class="tit">购物车</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="msn" @click="go('/pages/market/one/leader/order')">
  51. <view class="out">
  52. <view class="int">
  53. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  54. <view class="tit">一级订单</view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="msn" @click="go('/pages/market/two/leader/order')">
  59. <view class="out">
  60. <view class="int">
  61. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  62. <view class="tit">二级订单</view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <!--收购商-->
  68. <view class="menu" v-if="user.userType == 3">
  69. <view class="msn" @click="go('/pages/market/two/purchaser/buy/list')">
  70. <view class="out">
  71. <view class="int">
  72. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  73. <view class="tit">采购需求</view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="msn" @click="go('/pages/market/two/purchaser/address/list')">
  78. <view class="out">
  79. <view class="int">
  80. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe623;</view>
  81. <view class="tit">地址管理</view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="msn" @click="go('/pages/market/two/purchaser/order/list')">
  86. <view class="out">
  87. <view class="int">
  88. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  89. <view class="tit">我的订单</view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <!--外籍商户-->
  95. <view class="menu" v-if="user.userType == 5">
  96. <view class="msn" @click="go('/pages/market/one/merchant/goods/list')">
  97. <view class="out">
  98. <view class="int">
  99. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  100. <view class="tit">商品管理</view>
  101. </view>
  102. </view>
  103. </view>
  104. <view class="msn" @click="go('/pages/market/one/merchant/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/index')">
  113. <view class="out">
  114. <view class="int">
  115. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  116. <view class="tit">我的认证</view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="cmd">
  122. <view class="s_item" @click="show = true">
  123. <text class="icon ic">&#xe8bb;</text>
  124. <text class="title">常见问题</text>
  125. <text class="icon arrow">&#xe8f2;</text>
  126. </view>
  127. <view class="s_item" @click="go('/pages/login/userAgreement?id=1')">
  128. <text class="icon ic">&#xe662;</text>
  129. <text class="title">用户协议</text>
  130. <text class="icon arrow">&#xe8f2;</text>
  131. </view>
  132. <view class="s_item" @click="go('/pages/login/userAgreement?id=2')">
  133. <text class="icon ic">&#xe643;</text>
  134. <text class="title">隐私协议</text>
  135. <text class="icon arrow">&#xe8f2;</text>
  136. </view>
  137. <view class="s_item" @click="go('/pages/personal/setting')">
  138. <text class="icon ic">&#xe817;</text>
  139. <text class="title">设置</text>
  140. <text class="icon arrow">&#xe8f2;</text>
  141. </view>
  142. </view>
  143. <button class="btn exit" @click="exitLogin()">退出登录</button>
  144. </view>
  145. </view>
  146. </template>
  147. <script>
  148. export default {
  149. data() {
  150. return {
  151. user: {}
  152. };
  153. },
  154. onShow() {
  155. this.user = this.getUser();
  156. },
  157. methods: {
  158. order() {
  159. if (!this.hasAuth()) {
  160. uni.navigateTo({ url: '/pages/authentication/index' });
  161. return;
  162. }
  163. //组长
  164. if (this.user.userType == 2) {
  165. uni.navigateTo({ url: 'user' });
  166. }
  167. //外籍商户
  168. if (this.user.userType == 5) {
  169. uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
  170. }
  171. //收购商
  172. if (this.user.userType == 3) {
  173. uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
  174. }
  175. },
  176. go(url) {
  177. if (!this.hasAuth()) {
  178. uni.navigateTo({ url: '/pages/authentication/index' });
  179. return;
  180. }
  181. uni.navigateTo({ url: url });
  182. },
  183. exitLogin() {
  184. let param = {
  185. appUserId: this.getUser().id
  186. };
  187. uni.showModal({
  188. title: '提示',
  189. content: '确定注销登录?',
  190. success: res => {
  191. if (res.confirm) {
  192. this.http.request({
  193. url: '/sp-admin/app/AppUser/logout',
  194. data: param,
  195. success: res => {
  196. uni.removeStorageSync('token');
  197. uni.removeStorageSync('info');
  198. uni.removeStorageSync('menu');
  199. uni.redirectTo({ url: '/pages/login/login' });
  200. }
  201. });
  202. }
  203. }
  204. });
  205. }
  206. }
  207. };
  208. </script>
  209. <style lang="scss">
  210. page {
  211. background-color: #f5f5f5;
  212. }
  213. .my_top {
  214. position: relative;
  215. overflow: hidden;
  216. image {
  217. width: 100%;
  218. }
  219. }
  220. .list {
  221. position: relative;
  222. padding: 0px 20px 10px 20px;
  223. margin-top: -196px;
  224. .user {
  225. background-color: white;
  226. padding: 20px;
  227. border-radius: 8px;
  228. color: $font-c;
  229. .head {
  230. float: left;
  231. width: 55px;
  232. height: 55px;
  233. }
  234. .con {
  235. float: left;
  236. padding-left: 15px;
  237. width: 60%;
  238. .nickName {
  239. font-size: 17px;
  240. font-weight: bold;
  241. }
  242. .tag {
  243. background-color: #6799ad;
  244. color: white;
  245. float: left;
  246. font-size: 13px;
  247. padding: 2px 6px;
  248. border-radius: 5px;
  249. margin-top: 6px;
  250. }
  251. }
  252. .edit {
  253. float: right;
  254. font-size: 20px;
  255. margin-top: 17px;
  256. }
  257. }
  258. }
  259. .exit {
  260. margin-top: 20px;
  261. background-color: white;
  262. color: #f44336;
  263. }
  264. </style>