user.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <view class="container user clearfix">
  3. <view class="user-section">
  4. <view class="u-header">
  5. <image src="https://admin-b.caimei365.com/userfiles/1/images/photo/2020/03/%E6%88%91%E7%9A%84%20%E2%80%93%201%403x.png" mode=""></image>
  6. <view class="u-header-main">
  7. <view class="user-item">
  8. <view class="logo-m">
  9. <image :src="headpic ? headpic:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/04/%E5%8D%8F%E9%94%80%E9%BB%98%E8%AE%A4%E5%A4%B4%E5%83%8F.png'" mode=""></image>
  10. <text class="txt">协销员工</text>
  11. </view>
  12. </view>
  13. <view class="user-item">
  14. <text class="u-h1">{{name}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <!-- 订单 -->
  19. <view class="user-order">
  20. <view class="tab-title" @click="navigator('/market/pages/order/order-list?listType=0')">
  21. <text class="cell-tit">我的订单</text>
  22. <text class="cell-more">查看更多</text>
  23. <text class="iconfont icon-xiayibu"></text>
  24. </view>
  25. <view class="order-section">
  26. <view class="order-item" @click="navigator('/market/pages/order/order-list?listType=1')" hover-class="common-hover" :hover-stay-time="50">
  27. <view class="order-icon">
  28. <image src="../../static/temp/order1@3x.png" mode=""></image>
  29. <text v-if="beforeConfirmCount >0"
  30. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  31. :class="[beforeConfirmCount < 10 ? 'goleft':'']">
  32. {{beforeConfirmCount == 99? '99+' : beforeConfirmCount}}
  33. </text>
  34. </view>
  35. <text class="order-t">待确认</text>
  36. </view>
  37. <view class="order-item" @click="navigator('/market/pages/order/order-list?listType=2')" hover-class="common-hover" :hover-stay-time="50">
  38. <view class="order-icon">
  39. <image src="../../static/temp/order2@3x.png" mode=""></image>
  40. <text v-if="beforePayCount >0"
  41. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num "
  42. :class="[beforePayCount < 10 ? 'goleft':'']">
  43. {{beforePayCount == 99? '99+' : beforePayCount}}
  44. </text>
  45. </view>
  46. <text class="order-t">待付款</text>
  47. </view>
  48. <view class="order-item" @click="navigator('/market/pages/order/order-list?listType=3')" hover-class="common-hover" :hover-stay-time="50">
  49. <view class="order-icon">
  50. <image src="../../static/temp/order3@3x.png" mode=""></image>
  51. <text v-if="beforeShipCount >0"
  52. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  53. :class="[beforeShipCount < 10 ? 'goleft':'']">
  54. {{beforeShipCount == 99? '99+' : beforeShipCount}}
  55. </text>
  56. </view>
  57. <text class="order-t">待发货</text>
  58. </view>
  59. <view class="order-item" @click="navigator('/market/pages/order/order-list?listType=4')" hover-class="common-hover" :hover-stay-time="50">
  60. <view class="order-icon">
  61. <image src="../../static/temp/order4@3x.png" mode=""></image>
  62. <text v-if="shippedCount >0"
  63. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  64. :class="[shippedCount < 10 ? 'goleft':'']">
  65. {{shippedCount == 99? '99+' : shippedCount}}
  66. </text>
  67. </view>
  68. <text class="order-t">已发货</text>
  69. </view>
  70. <view class="order-item" @click="navigator('/market/pages/order/order-list?listType=5')" hover-class="common-hover" :hover-stay-time="50">
  71. <view class="order-icon">
  72. <image src="../../static/temp/order5@3x.png" mode=""></image>
  73. <text v-if="refundsCount >0"
  74. class="uni-badge uni-badge-error uni-small uni-badge--small icon-num"
  75. :class="[refundsCount < 10 ? 'goleft':'']">
  76. {{refundsCount == 99? '99+' : refundsCount}}
  77. </text>
  78. </view>
  79. <text class="order-t">退货/款</text>
  80. </view>
  81. </view>
  82. </view>
  83. <!-- 底部跳转 -->
  84. <view class="foot-list">
  85. <view class="list-cell-item">
  86. <view class="list-cell" v-for="(item, index) in firstList" :key="index" @click="navigator(item.path)" hover-class="cell-hover" :hover-stay-time="50">
  87. <text class="cell-tit">{{item.name}}</text>
  88. <text class="cell-more iconfont icon-xiayibu"></text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. <script>
  96. import uniBadge from '@/components/uni-badge/uni-badge.vue'
  97. import { mapState,mapMutations } from 'vuex'
  98. import { getSellerHome } from "@/api/seller.js"
  99. export default{
  100. components: {
  101. uniBadge,
  102. },
  103. data() {
  104. return{
  105. name:'采美协销',
  106. headpic:'',
  107. userMoney:0.00,
  108. userId:'',
  109. aboutHtml:'',
  110. telPhone:'',
  111. beforeConfirmCount:0,//待确认角标
  112. beforePayCount:0, //待付款角标
  113. beforeShipCount:0, //待发货角标
  114. shippedCount:0, //已发货角标
  115. refundsCount:'', //退货/款角标
  116. firstList:[
  117. {name:'机构列表',path:'/market/pages/club/list'},
  118. {name:'帮机构下单',path:'/market/pages/club/club-list'},
  119. {name:'拉机构上线',path:'/market/pages/login/register'},
  120. {name:'邀请运营人员',path:'/market/pages/club/allClub-list'}
  121. ],
  122. }
  123. },
  124. created() {
  125. this.initData()
  126. },
  127. computed: {
  128. ...mapState(['hasLogin','userInfo'])
  129. },
  130. methods:{
  131. initData(){
  132. this.$api.getStorage().then((resolve) =>{
  133. this.userId = resolve.userID
  134. getSellerHome({userId:this.userId}).then(response =>{
  135. let sellerData = response.data
  136. this.name = sellerData.seller.linkMan1?sellerData.seller.linkMan1:'' //协销名称
  137. this.headpic = sellerData.seller.logo //会所头像
  138. this.beforeConfirmCount = this.showBadge(sellerData.beforeConfirmCount)//待付款
  139. this.beforePayCount = this.showBadge(sellerData.beforePayCount)//待付款
  140. this.beforeShipCount = this.showBadge(sellerData.beforeShipCount)//待发货
  141. this.shippedCount = this.showBadge(sellerData.shippedCount)//已发货
  142. this.refundsCount = this.showBadge(sellerData.refundsCount)//退货/款
  143. }).catch(response =>{
  144. this.$util.msg(response.msg,2000)
  145. })
  146. })
  147. },
  148. navigator(url){
  149. this.$api.navigateTo(url)
  150. },
  151. showBadge(n){
  152. let num ='';
  153. if(n>100){num = 99}else{num = n;}
  154. return num;
  155. },
  156. onPullDownRefresh() {//下拉刷新
  157. this.initData()
  158. uni.stopPullDownRefresh()
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss">
  164. @import "@/uni.scss";
  165. page{
  166. background-color: #F7F7F7;
  167. }
  168. .user{
  169. width: 100%;
  170. height: auto;
  171. position:relative;
  172. background: rgba(247, 247, 247, 1);
  173. }
  174. .user-section.none{
  175. display: none;
  176. }
  177. .user-section.show{
  178. display: block;
  179. }
  180. .u-header{
  181. width: 100%;
  182. height: 400rpx;
  183. position: relative;
  184. image{
  185. width: 100%;
  186. height: 400rpx;
  187. }
  188. }
  189. .u-header-main{
  190. width: 100%;
  191. height: 284rpx;
  192. padding: 58rpx 0;
  193. position: absolute;
  194. top: 0;
  195. left: 0;
  196. .user-item{
  197. width: 100%;
  198. display: flex;
  199. flex-direction: column;
  200. align-items: center;
  201. margin-bottom: 16rpx;
  202. .u-h1{
  203. width: 410rpx;
  204. font-size: $font-size-28;
  205. line-height: 40rpx;
  206. color: #FFFFFF;
  207. margin-bottom: 8rpx;
  208. -o-text-overflow: ellipsis;
  209. text-overflow: ellipsis;
  210. display: -webkit-box;
  211. word-break: break-all;
  212. -webkit-box-orient: vertical;
  213. -webkit-line-clamp: 1;
  214. overflow: hidden;
  215. align-items: center;
  216. }
  217. .u-p{
  218. font-size: $font-size-24;
  219. line-height: 40rpx;
  220. color: #FFFFFF;
  221. }
  222. }
  223. .logo-m{
  224. width: 144rpx;
  225. height: 144rpx;
  226. border: 2rpx solid #FFFFFF;
  227. border-radius: 100%;
  228. background: $bg-color;
  229. position: relative;
  230. .txt{
  231. width: 144rpx;
  232. height: 42rpx;
  233. display: inline-block;
  234. background: linear-gradient(45deg,rgba(225,86,22,1) 0%,rgba(255,177,0,1) 100%);
  235. border-radius: 21rpx;
  236. line-height: 42rpx;
  237. text-align: center;
  238. color: #FFFFFF;
  239. font-size: $font-size-22;
  240. position: absolute;
  241. bottom: -10rpx;
  242. left: 0;
  243. }
  244. image{
  245. width: 144rpx;
  246. height: 144rpx;
  247. border-radius: 100%;
  248. }
  249. }
  250. }
  251. .user-order{
  252. width: 702rpx;
  253. height: auto;
  254. padding: 0 24rpx;
  255. background-color: $bg-color;
  256. margin-bottom: 24rpx;
  257. }
  258. .tab-title{
  259. font-size: $font-size-28;
  260. line-height: 80rpx;
  261. color: #333333;
  262. text-align:left;
  263. border-bottom: 1px solid #F8F8F8;
  264. position: relative;
  265. .cell-tit{
  266. font-size: $font-size-28;
  267. color: $text-color;
  268. }
  269. .cell-more{
  270. float: right;
  271. line-height: 80rpx;
  272. font-size: $font-size-24;
  273. color: $text-color;
  274. padding-right: 30rpx;
  275. }
  276. .iconfont{
  277. width: 30rpx;
  278. height: 80rpx;
  279. line-height: 80rpx;
  280. font-size: $font-size-28;
  281. text-align: center;
  282. position: absolute;
  283. right: 0;
  284. top: 0;
  285. display: block;
  286. }
  287. }
  288. .order-section{
  289. display: flex;
  290. justify-content: space-around;
  291. align-items: center;
  292. flex-wrap:wrap;
  293. height: 99rpx;
  294. padding: 24rpx 0;
  295. }
  296. .order-item{
  297. display: flex;
  298. flex-direction: column;
  299. align-items: center;
  300. width: 98rpx;
  301. position: relative;
  302. margin-right: 53rpx;
  303. &:last-child{
  304. margin-right: 0;
  305. }
  306. .order-icon{
  307. width: 52rpx;
  308. height: 52rpx;
  309. position: relative;
  310. image{
  311. width: 52rpx;
  312. height: 52rpx;
  313. }
  314. .icon-num{
  315. position: absolute;
  316. right:-24rpx;
  317. top: -9rpx;
  318. }
  319. .icon-num.goleft{
  320. right: -12rpx;
  321. }
  322. }
  323. .order-t{
  324. line-height: 50rpx;
  325. font-size: $font-size-24;
  326. color: $text-color;
  327. }
  328. }
  329. .foot-list{
  330. width: 100%;
  331. // margin-bottom: 150rpx;
  332. }
  333. .list-cell-item{
  334. width: 702rpx;
  335. height: auto;
  336. margin-bottom: 24rpx;
  337. padding:0 24rpx;
  338. background: $bg-color;
  339. }
  340. .list-cell{
  341. display:flex;
  342. width: 100%;
  343. align-items:baseline;
  344. line-height:100rpx;
  345. position:relative;
  346. background: $bg-color;
  347. justify-content: center;
  348. // border-bottom: 1px solid #EBEBEB;
  349. &.cell-hover{
  350. background:#fafafa;
  351. }
  352. .cell-more{
  353. align-self: baseline;
  354. font-size:$font-size-28;
  355. color:$text-color;
  356. margin-left:10rpx;
  357. }
  358. .cell-tit{
  359. flex: 1;
  360. font-size: $font-size-28;
  361. color: $text-color;
  362. margin-right:10rpx;
  363. }
  364. .cell-tip{
  365. font-size: $font-size-28;
  366. color: $text-color;
  367. }
  368. }
  369. .list-cell.last{
  370. border-bottom: none;
  371. }
  372. .uni-badge--small {
  373. -webkit-transform: scale(.8);
  374. -ms-transform: scale(.8);
  375. transform: scale(.8);
  376. -webkit-transform-origin: center center;
  377. -ms-transform-origin: center center;
  378. transform-origin: center center;
  379. }
  380. .uni-badge {
  381. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  382. -webkit-box-sizing: border-box;
  383. box-sizing: border-box;
  384. font-size: 12px;
  385. line-height: 1;
  386. display: inline-block;
  387. padding: 3px 6px;
  388. color: #333;
  389. border-radius: 100px;
  390. background-color: #f1f1f1;
  391. }
  392. .uni-badge-error {
  393. color: #fff;
  394. background-color: #dd524d;
  395. }
  396. </style>