personal.vue 7.0 KB

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