personal.vue 8.5 KB

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