personal.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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">&#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 == 5">
  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/address/list')">
  80. <view class="out">
  81. <view class="int">
  82. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe623;</view>
  83. <view class="tit">地址管理</view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="msn" @click="go('/pages/market/two/purchaser/order/list')">
  88. <view class="out">
  89. <view class="int">
  90. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  91. <view class="tit">我的订单</view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="cmd">
  97. <view class="s_item" @click="show = true">
  98. <text class="icon ic">&#xe686;</text>
  99. <text class="title">常见问题</text>
  100. <text class="icon arrow">&#xe8f2;</text>
  101. </view>
  102. <view class="s_item" @click="show = true">
  103. <text class="icon ic">&#xe686;</text>
  104. <text class="title">联系我们</text>
  105. <text class="icon arrow">&#xe8f2;</text>
  106. </view>
  107. <view class="s_item" @click="show = true">
  108. <text class="icon ic">&#xe686;</text>
  109. <text class="title">用户协议</text>
  110. <text class="icon arrow">&#xe8f2;</text>
  111. </view>
  112. <view class="s_item" @click="show = true">
  113. <text class="icon ic">&#xe686;</text>
  114. <text class="title">隐私协议</text>
  115. <text class="icon arrow">&#xe8f2;</text>
  116. </view>
  117. <view class="s_item" @click="show = true">
  118. <text class="icon ic">&#xe686;</text>
  119. <text class="title">设置</text>
  120. <text class="icon arrow">&#xe8f2;</text>
  121. </view>
  122. </view>
  123. <button class="btn exit" @click="exitLogin()">退出登录</button>
  124. </view>
  125. </view>
  126. </template>
  127. <script>
  128. export default {
  129. data() {
  130. return {
  131. user: {}
  132. };
  133. },
  134. onShow() {
  135. if (this.hasLogin()) {
  136. this.user = this.getUser();
  137. } else {
  138. uni.redirectTo({ url: '/pages/login/login' });
  139. }
  140. },
  141. methods: {
  142. order() {
  143. //组长
  144. if (this.user.userType == 2) {
  145. uni.navigateTo({ url: 'user' });
  146. }
  147. //外籍商户
  148. if (this.user.userType == 3) {
  149. uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
  150. }
  151. //收购商
  152. if (this.user.userType == 5) {
  153. uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
  154. }
  155. },
  156. go(url) {
  157. uni.navigateTo({ url: url });
  158. },
  159. exitLogin() {
  160. uni.removeStorageSync('token');
  161. uni.removeStorageSync('info');
  162. uni.removeStorageSync('menu');
  163. this.$common.to('/pages/login/login');
  164. }
  165. }
  166. };
  167. </script>
  168. <style lang="scss">
  169. page {
  170. background-color: #f5f5f5;
  171. }
  172. .my_top {
  173. position: relative;
  174. overflow: hidden;
  175. image {
  176. width: 100%;
  177. }
  178. }
  179. .list {
  180. position: relative;
  181. padding: 0px 20px 10px 20px;
  182. margin-top: -196px;
  183. .user {
  184. background-color: white;
  185. padding: 20px;
  186. border-radius: 8px;
  187. color: $font-c;
  188. .head {
  189. float: left;
  190. width: 55px;
  191. height: 55px;
  192. }
  193. .con {
  194. float: left;
  195. padding-left: 15px;
  196. width: 60%;
  197. .nickName {
  198. font-size: 17px;
  199. font-weight: bold;
  200. }
  201. .tag {
  202. background-color: #6799ad;
  203. color: white;
  204. float: left;
  205. font-size: 13px;
  206. padding: 2px 6px;
  207. border-radius: 5px;
  208. margin-top: 6px;
  209. }
  210. }
  211. .edit {
  212. float: right;
  213. font-size: 20px;
  214. margin-top: 17px;
  215. }
  216. }
  217. }
  218. .exit {
  219. margin-top: 20px;
  220. background-color: white;
  221. color: $main-color;
  222. }
  223. </style>