personal.vue 8.2 KB

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