personal.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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" v-if="user.userType == 2">
  25. <view class="msn" @click="go('/pages/market/one/leader/cart')">
  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/leader/order')">
  34. <view class="out">
  35. <view class="int">
  36. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  37. <view class="tit">一级订单</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="msn" @click="go('/pages/market/two/leader/order')">
  42. <view class="out">
  43. <view class="int">
  44. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  45. <view class="tit">二级订单</view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <!--外籍商户-->
  51. <view class="menu" v-if="user.userType == 3">
  52. <view class="msn" @click="go('/pages/market/one/merchant/goods/list')">
  53. <view class="out">
  54. <view class="int">
  55. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  56. <view class="tit">商品管理</view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="msn" @click="go('/pages/market/one/merchant/order/list')">
  61. <view class="out">
  62. <view class="int">
  63. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  64. <view class="tit">我的订单</view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <!--收购商-->
  70. <view class="menu" v-if="user.userType == 4">
  71. <view class="msn" @click="go('/pages/market/two/purchaser/buy/list')">
  72. <view class="out">
  73. <view class="int">
  74. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</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. <view class="cmd">
  89. <view class="s_item" @click="show = true">
  90. <text class="icon ic">&#xe686;</text>
  91. <text class="title">常见问题</text>
  92. <text class="icon arrow">&#xe8f2;</text>
  93. </view>
  94. <view class="s_item" @click="show = true">
  95. <text class="icon ic">&#xe686;</text>
  96. <text class="title">联系我们</text>
  97. <text class="icon arrow">&#xe8f2;</text>
  98. </view>
  99. <view class="s_item" @click="show = true">
  100. <text class="icon ic">&#xe686;</text>
  101. <text class="title">用户协议</text>
  102. <text class="icon arrow">&#xe8f2;</text>
  103. </view>
  104. <view class="s_item" @click="show = true">
  105. <text class="icon ic">&#xe686;</text>
  106. <text class="title">隐私协议</text>
  107. <text class="icon arrow">&#xe8f2;</text>
  108. </view>
  109. <view class="s_item" @click="show = true">
  110. <text class="icon ic">&#xe686;</text>
  111. <text class="title">设置</text>
  112. <text class="icon arrow">&#xe8f2;</text>
  113. </view>
  114. </view>
  115. <button class="btn exit" @click="exitLogin()">退出登录</button>
  116. </view>
  117. </view>
  118. </template>
  119. <script>
  120. export default {
  121. data() {
  122. return {
  123. user: {}
  124. };
  125. },
  126. onShow() {
  127. if (this.hasLogin()) {
  128. this.user = this.getUser();
  129. } else {
  130. uni.redirectTo({ url: '/pages/login/login' });
  131. }
  132. },
  133. methods: {
  134. order() {
  135. //组长
  136. if (this.user.userType == 2) {
  137. uni.navigateTo({ url: 'user' });
  138. }
  139. //外籍商户
  140. if (this.user.userType == 3) {
  141. uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
  142. }
  143. //外籍商户
  144. if (this.user.userType == 4) {
  145. uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
  146. }
  147. },
  148. go(url) {
  149. uni.navigateTo({ url: url });
  150. },
  151. exitLogin() {
  152. uni.removeStorageSync('token');
  153. uni.removeStorageSync('info');
  154. uni.removeStorageSync('menu');
  155. this.$common.to('/pages/login/login');
  156. }
  157. }
  158. };
  159. </script>
  160. <style lang="scss">
  161. page {
  162. background-color: #f5f5f5;
  163. }
  164. .my_top {
  165. position: relative;
  166. overflow: hidden;
  167. image {
  168. width: 100%;
  169. }
  170. }
  171. .list {
  172. position: relative;
  173. padding: 0px 20px 10px 20px;
  174. margin-top: -196px;
  175. .user {
  176. background-color: white;
  177. padding: 20px;
  178. border-radius: 8px;
  179. color: $font-c;
  180. .head {
  181. float: left;
  182. width: 55px;
  183. height: 55px;
  184. }
  185. .con {
  186. float: left;
  187. padding-left: 15px;
  188. width: 60%;
  189. .nickName {
  190. font-size: 17px;
  191. font-weight: bold;
  192. }
  193. .tag {
  194. background-color: #6799ad;
  195. color: white;
  196. float: left;
  197. font-size: 13px;
  198. padding: 2px 6px;
  199. border-radius: 5px;
  200. margin-top: 6px;
  201. }
  202. }
  203. .edit {
  204. float: right;
  205. font-size: 20px;
  206. margin-top: 17px;
  207. }
  208. }
  209. }
  210. .exit {
  211. margin-top: 20px;
  212. background-color: white;
  213. color: $main-color;
  214. }
  215. </style>