personal.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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/two/purchaser/buy/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/two/purchaser/address/list')">
  61. <view class="out">
  62. <view class="int">
  63. <view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe623;</view>
  64. <view class="tit">地址管理</view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="msn" @click="go('/pages/market/two/purchaser/order/list')">
  69. <view class="out">
  70. <view class="int">
  71. <view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
  72. <view class="tit">我的订单</view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <!--外籍商户-->
  78. <view class="menu" v-if="user.userType == 5">
  79. <view class="msn" @click="go('/pages/market/one/merchant/goods/list')">
  80. <view class="out">
  81. <view class="int">
  82. <view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
  83. <view class="tit">商品管理</view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="msn" @click="go('/pages/market/one/merchant/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">&#xe8bb;</text>
  99. <text class="title">常见问题</text>
  100. <text class="icon arrow">&#xe8f2;</text>
  101. </view>
  102. <view class="s_item" @click="go('/pages/login/userAgreement?id=1')">
  103. <text class="icon ic">&#xe662;</text>
  104. <text class="title">用户协议</text>
  105. <text class="icon arrow">&#xe8f2;</text>
  106. </view>
  107. <view class="s_item" @click="go('/pages/login/userAgreement?id=2')">
  108. <text class="icon ic">&#xe643;</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">&#xe817;</text>
  114. <text class="title">设置</text>
  115. <text class="icon arrow">&#xe8f2;</text>
  116. </view>
  117. </view>
  118. <button class="btn exit" @click="exitLogin()">退出登录</button>
  119. </view>
  120. </view>
  121. </template>
  122. <script>
  123. export default {
  124. data() {
  125. return {
  126. user: {}
  127. };
  128. },
  129. onShow() {
  130. if (this.hasLogin()) {
  131. this.user = this.getUser();
  132. } else {
  133. uni.redirectTo({ url: '/pages/login/login' });
  134. }
  135. },
  136. methods: {
  137. order() {
  138. //组长
  139. if (this.user.userType == 2) {
  140. uni.navigateTo({ url: 'user' });
  141. }
  142. //外籍商户
  143. if (this.user.userType == 5) {
  144. uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
  145. }
  146. //收购商
  147. if (this.user.userType == 3) {
  148. uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
  149. }
  150. },
  151. go(url) {
  152. uni.navigateTo({ url: url });
  153. },
  154. exitLogin() {
  155. uni.showModal({
  156. title: '提示',
  157. content: '确定注销登录?',
  158. success: res => {
  159. if (res.confirm) {
  160. uni.removeStorageSync('token');
  161. uni.removeStorageSync('info');
  162. uni.removeStorageSync('menu');
  163. uni.redirectTo({ url: '/pages/login/login' });
  164. }
  165. }
  166. });
  167. }
  168. }
  169. };
  170. </script>
  171. <style lang="scss">
  172. page {
  173. background-color: #f5f5f5;
  174. }
  175. .my_top {
  176. position: relative;
  177. overflow: hidden;
  178. image {
  179. width: 100%;
  180. }
  181. }
  182. .list {
  183. position: relative;
  184. padding: 0px 20px 10px 20px;
  185. margin-top: -196px;
  186. .user {
  187. background-color: white;
  188. padding: 20px;
  189. border-radius: 8px;
  190. color: $font-c;
  191. .head {
  192. float: left;
  193. width: 55px;
  194. height: 55px;
  195. }
  196. .con {
  197. float: left;
  198. padding-left: 15px;
  199. width: 60%;
  200. .nickName {
  201. font-size: 17px;
  202. font-weight: bold;
  203. }
  204. .tag {
  205. background-color: #6799ad;
  206. color: white;
  207. float: left;
  208. font-size: 13px;
  209. padding: 2px 6px;
  210. border-radius: 5px;
  211. margin-top: 6px;
  212. }
  213. }
  214. .edit {
  215. float: right;
  216. font-size: 20px;
  217. margin-top: 17px;
  218. }
  219. }
  220. }
  221. .exit {
  222. margin-top: 20px;
  223. background-color: white;
  224. color: #f44336;
  225. }
  226. </style>