personal.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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. if (!this.hasAuth()) {
  177. this.http.request({
  178. url: '/sp-admin/app/AppUser/getAuth',
  179. success: res => {
  180. this.user.auth = res.data.data;
  181. }
  182. });
  183. }
  184. },
  185. methods: {
  186. order() {
  187. if (!this.hasAuth()) {
  188. uni.navigateTo({ url: '/pages/authentication/index' });
  189. return;
  190. }
  191. //组长
  192. if (this.user.userType == 2) {
  193. uni.navigateTo({ url: 'user' });
  194. }
  195. //外籍商户
  196. if (this.user.userType == 5) {
  197. uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
  198. }
  199. //收购商
  200. if (this.user.userType == 3) {
  201. uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
  202. }
  203. },
  204. go(url) {
  205. if (!this.hasAuth() && this.user.userType == 5) {
  206. uni.navigateTo({ url: '/pages/authentication/index' });
  207. return;
  208. }
  209. if (!this.hasAuth() && this.user.userType == 3) {
  210. uni.navigateTo({ url: '/pages/authentication/purchaser/index' });
  211. return;
  212. }
  213. uni.navigateTo({ url: url });
  214. },
  215. exitLogin() {
  216. let param = {
  217. appUserId: this.getUser().id
  218. };
  219. uni.showModal({
  220. title: '提示',
  221. content: '确定注销登录?',
  222. success: res => {
  223. if (res.confirm) {
  224. this.http.request({
  225. url: '/sp-admin/app/AppUser/logout',
  226. data: param,
  227. success: res => {
  228. uni.removeStorageSync('token');
  229. uni.removeStorageSync('info');
  230. uni.removeStorageSync('menu');
  231. uni.redirectTo({ url: '/pages/login/login' });
  232. }
  233. });
  234. }
  235. }
  236. });
  237. }
  238. }
  239. };
  240. </script>
  241. <style lang="scss">
  242. page {
  243. background-color: #f5f5f5;
  244. }
  245. .my_top {
  246. position: relative;
  247. overflow: hidden;
  248. image {
  249. width: 100%;
  250. }
  251. }
  252. .list {
  253. position: relative;
  254. padding: 0px 20px 10px 20px;
  255. margin-top: -196px;
  256. .user {
  257. background-color: white;
  258. padding: 20px;
  259. border-radius: 8px;
  260. color: $font-c;
  261. .head {
  262. float: left;
  263. width: 55px;
  264. height: 55px;
  265. }
  266. .con {
  267. float: left;
  268. padding-left: 15px;
  269. width: 60%;
  270. .nickName {
  271. font-size: 17px;
  272. font-weight: bold;
  273. }
  274. .tag {
  275. background-color: #6799ad;
  276. color: white;
  277. float: left;
  278. font-size: 13px;
  279. padding: 2px 6px;
  280. border-radius: 5px;
  281. margin-top: 6px;
  282. }
  283. }
  284. .edit {
  285. float: right;
  286. font-size: 20px;
  287. margin-top: 17px;
  288. }
  289. }
  290. }
  291. .exit {
  292. margin-top: 20px;
  293. background-color: white;
  294. color: #f44336;
  295. }
  296. </style>