personal.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 == 1">司机</view>
  19. </view>
  20. <text class="icon edit">&#xe645;</text>
  21. <view class="clear"></view>
  22. </view>
  23. <!--菜单-->
  24. <view class="menu">
  25. <view class="msn" @click="go()" v-if="user.userType == 2">
  26. <view class="out">
  27. <view class="int">
  28. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe604;</view>
  29. <view class="tit">购物车</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="msn" @click="go('/pages/market/one/merchant/goods/list')" v-if="user.userType == 3">
  34. <view class="out">
  35. <view class="int">
  36. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  37. <view class="tit">商品管理</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="msn" @click="go('/pages/market/two/purchaser/buy/list')" v-if="user.userType == 4">
  42. <view class="out">
  43. <view class="int">
  44. <view class="icon ioc" style="background-color: #eaf1fe; color: #2a95fe">&#xe64f;</view>
  45. <view class="tit">收购管理</view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="msn" @click="order()">
  50. <view class="out">
  51. <view class="int">
  52. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  53. <view class="tit">我的订单</view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="clear"></view>
  58. </view>
  59. <view class="cmd">
  60. <view class="s_item" @click="show = true">
  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="show = true">
  66. <text class="icon ic">&#xe686;</text>
  67. <text class="title">联系我们</text>
  68. <text class="icon arrow">&#xe8f2;</text>
  69. </view>
  70. <view class="s_item" @click="show = true">
  71. <text class="icon ic">&#xe686;</text>
  72. <text class="title">用户协议</text>
  73. <text class="icon arrow">&#xe8f2;</text>
  74. </view>
  75. <view class="s_item" @click="show = true">
  76. <text class="icon ic">&#xe686;</text>
  77. <text class="title">隐私协议</text>
  78. <text class="icon arrow">&#xe8f2;</text>
  79. </view>
  80. <view class="s_item" @click="show = true">
  81. <text class="icon ic">&#xe686;</text>
  82. <text class="title">设置</text>
  83. <text class="icon arrow">&#xe8f2;</text>
  84. </view>
  85. </view>
  86. <button class="btn exit" @click="exitLogin()">退出登录</button>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. export default {
  92. data() {
  93. return {
  94. user: {}
  95. };
  96. },
  97. onShow() {
  98. if (this.hasLogin()) {
  99. this.user = this.getUser();
  100. } else {
  101. uni.redirectTo({ url: '/pages/login/login' });
  102. }
  103. },
  104. methods: {
  105. order() {
  106. //组长
  107. if (this.user.userType == 2) {
  108. uni.navigateTo({url: '/pages/market/one/merchant/order/list'});
  109. }
  110. //外籍商户
  111. if (this.user.userType == 3) {
  112. uni.navigateTo({url: '/pages/market/one/merchant/order/list'});
  113. }
  114. //外籍商户
  115. if (this.user.userType == 4) {
  116. uni.navigateTo({url: '/pages/market/two/purchaser/order/list'});
  117. }
  118. },
  119. go(url) {
  120. uni.navigateTo({ url: url });
  121. },
  122. exitLogin() {
  123. uni.removeStorageSync('token');
  124. uni.removeStorageSync('info');
  125. uni.removeStorageSync('menu');
  126. this.$common.to('/pages/login/login');
  127. }
  128. }
  129. };
  130. </script>
  131. <style lang="scss">
  132. page {
  133. background-color: #f5f5f5;
  134. }
  135. .my_top {
  136. position: relative;
  137. overflow: hidden;
  138. image {
  139. width: 100%;
  140. }
  141. }
  142. .list {
  143. position: relative;
  144. padding: 0px 20px 10px 20px;
  145. margin-top: -196px;
  146. .user {
  147. background-color: white;
  148. padding: 20px;
  149. border-radius: 8px;
  150. color: $font-c;
  151. .head {
  152. float: left;
  153. width: 55px;
  154. height: 55px;
  155. }
  156. .con {
  157. float: left;
  158. padding-left: 15px;
  159. width: 60%;
  160. .nickName {
  161. font-size: 17px;
  162. font-weight: bold;
  163. }
  164. .tag {
  165. background-color: #6799ad;
  166. color: white;
  167. float: left;
  168. font-size: 13px;
  169. padding: 2px 6px;
  170. border-radius: 5px;
  171. margin-top: 6px;
  172. }
  173. }
  174. .edit {
  175. float: right;
  176. font-size: 20px;
  177. margin-top: 17px;
  178. }
  179. }
  180. }
  181. .exit {
  182. margin-top: 20px;
  183. background-color: white;
  184. color: $main-color;
  185. }
  186. </style>