user.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <template>
  2. <view class="container user clearfix" :style="{paddingBottom:isIphoneX?'140rpx':'98rpx'}">
  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. <!-- 底部tabbar -->
  94. <cu-tabbar :active-index ="2"></cu-tabbar>
  95. </view>
  96. </template>
  97. <script>
  98. import cuTabbar from '@/components/cu-tabbar.vue'
  99. import uniBadge from '@/components/uni-badge/uni-badge.vue'
  100. import { mapState,mapMutations } from 'vuex'
  101. import { getSellerHome } from "@/api/seller.js"
  102. export default{
  103. components: {
  104. uniBadge,
  105. cuTabbar
  106. },
  107. data() {
  108. return{
  109. name:'采美协销',
  110. headpic:'',
  111. userMoney:0.00,
  112. userId:'',
  113. aboutHtml:'',
  114. telPhone:'',
  115. beforeConfirmCount:0,//待确认角标
  116. beforePayCount:0, //待付款角标
  117. beforeShipCount:0, //待发货角标
  118. shippedCount:0, //已发货角标
  119. refundsCount:'', //退货/款角标
  120. isIphoneX:this.$store.state.isIphoneX,
  121. firstList:[
  122. {name:'机构列表',path:'/market/pages/club/list'},
  123. {name:'帮机构下单',path:'/market/pages/club/club-list'},
  124. {name:'拉机构上线',path:'/market/pages/login/register'},
  125. {name:'邀请运营人员',path:'/market/pages/club/allClub-list'}
  126. ],
  127. }
  128. },
  129. onLoad(){
  130. },
  131. computed: {
  132. ...mapState(['hasLogin','userInfo'])
  133. },
  134. methods:{
  135. initData(){
  136. getSellerHome({userId:this.userId}).then(response =>{
  137. let sellerData = response.data
  138. this.name = sellerData.seller.name //协销名称
  139. this.headpic = sellerData.seller.logo //会所头像
  140. this.beforeConfirmCount = this.showBadge(sellerData.beforeConfirmCount)//待付款
  141. this.beforePayCount = this.showBadge(sellerData.beforePayCount)//待付款
  142. this.beforeShipCount = this.showBadge(sellerData.beforeShipCount)//待发货
  143. this.shippedCount = this.showBadge(sellerData.shippedCount)//已发货
  144. this.refundsCount = this.showBadge(sellerData.refundsCount)//退货/款
  145. }).catch(response =>{
  146. this.$util.msg(response.msg,2000)
  147. })
  148. },
  149. navigator(url){
  150. this.$api.navigateTo(url)
  151. },
  152. showBadge(n){
  153. let num ='';
  154. if(n>100){num = 99}else{num = n;}
  155. return num;
  156. },
  157. onPullDownRefresh() {//下拉刷新
  158. this.initData()
  159. uni.stopPullDownRefresh()
  160. },
  161. onShow(){
  162. this.$api.getStorage().then((resolve) =>{
  163. // console.log(resolve)
  164. this.userId = resolve.userID
  165. this.initData()
  166. })
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang="scss">
  172. @import "@/uni.scss";
  173. page{
  174. background-color: #F7F7F7;
  175. }
  176. .user{
  177. width: 100%;
  178. height: auto;
  179. position:relative;
  180. background: rgba(247, 247, 247, 1);
  181. }
  182. .user-section.none{
  183. display: none;
  184. }
  185. .user-section.show{
  186. display: block;
  187. }
  188. .u-header{
  189. width: 100%;
  190. height: 400rpx;
  191. position: relative;
  192. image{
  193. width: 100%;
  194. height: 400rpx;
  195. }
  196. }
  197. .u-header-main{
  198. width: 100%;
  199. height: 284rpx;
  200. padding: 58rpx 0;
  201. position: absolute;
  202. top: 0;
  203. left: 0;
  204. .user-item{
  205. width: 100%;
  206. display: flex;
  207. flex-direction: column;
  208. align-items: center;
  209. margin-bottom: 16rpx;
  210. .u-h1{
  211. width: 410rpx;
  212. font-size: $font-size-28;
  213. line-height: 40rpx;
  214. color: #FFFFFF;
  215. margin-bottom: 8rpx;
  216. -o-text-overflow: ellipsis;
  217. text-overflow: ellipsis;
  218. display: -webkit-box;
  219. word-break: break-all;
  220. -webkit-box-orient: vertical;
  221. -webkit-line-clamp: 1;
  222. overflow: hidden;
  223. align-items: center;
  224. }
  225. .u-p{
  226. font-size: $font-size-24;
  227. line-height: 40rpx;
  228. color: #FFFFFF;
  229. }
  230. }
  231. .logo-m{
  232. width: 144rpx;
  233. height: 144rpx;
  234. border: 2rpx solid #FFFFFF;
  235. border-radius: 100%;
  236. background: $bg-color;
  237. position: relative;
  238. .txt{
  239. width: 144rpx;
  240. height: 42rpx;
  241. display: inline-block;
  242. background: linear-gradient(45deg,rgba(225,86,22,1) 0%,rgba(255,177,0,1) 100%);
  243. border-radius: 21rpx;
  244. line-height: 42rpx;
  245. text-align: center;
  246. color: #FFFFFF;
  247. font-size: $font-size-22;
  248. position: absolute;
  249. bottom: -10rpx;
  250. left: 0;
  251. }
  252. image{
  253. width: 144rpx;
  254. height: 144rpx;
  255. border-radius: 100%;
  256. }
  257. }
  258. }
  259. .user-order{
  260. width: 702rpx;
  261. height: auto;
  262. padding: 0 24rpx;
  263. background-color: $bg-color;
  264. margin-bottom: 24rpx;
  265. }
  266. .tab-title{
  267. font-size: $font-size-28;
  268. line-height: 80rpx;
  269. color: #333333;
  270. text-align:left;
  271. border-bottom: 1px solid #F8F8F8;
  272. position: relative;
  273. .cell-tit{
  274. font-size: $font-size-28;
  275. color: $text-color;
  276. }
  277. .cell-more{
  278. float: right;
  279. line-height: 80rpx;
  280. font-size: $font-size-24;
  281. color: $text-color;
  282. padding-right: 30rpx;
  283. }
  284. .iconfont{
  285. width: 30rpx;
  286. height: 80rpx;
  287. line-height: 80rpx;
  288. font-size: $font-size-28;
  289. text-align: center;
  290. position: absolute;
  291. right: 0;
  292. top: 0;
  293. display: block;
  294. }
  295. }
  296. .order-section{
  297. display: flex;
  298. justify-content: space-around;
  299. align-items: center;
  300. flex-wrap:wrap;
  301. height: 99rpx;
  302. padding: 24rpx 0;
  303. }
  304. .order-item{
  305. display: flex;
  306. flex-direction: column;
  307. align-items: center;
  308. width: 98rpx;
  309. position: relative;
  310. margin-right: 53rpx;
  311. &:last-child{
  312. margin-right: 0;
  313. }
  314. .order-icon{
  315. width: 52rpx;
  316. height: 52rpx;
  317. position: relative;
  318. image{
  319. width: 52rpx;
  320. height: 52rpx;
  321. }
  322. .icon-num{
  323. position: absolute;
  324. right:-24rpx;
  325. top: -9rpx;
  326. }
  327. .icon-num.goleft{
  328. right: -12rpx;
  329. }
  330. }
  331. .order-t{
  332. line-height: 50rpx;
  333. font-size: $font-size-24;
  334. color: $text-color;
  335. }
  336. }
  337. .foot-list{
  338. width: 100%;
  339. // margin-bottom: 150rpx;
  340. }
  341. .list-cell-item{
  342. width: 702rpx;
  343. height: auto;
  344. margin-bottom: 24rpx;
  345. padding:0 24rpx;
  346. background: $bg-color;
  347. }
  348. .list-cell{
  349. display:flex;
  350. width: 100%;
  351. align-items:baseline;
  352. line-height:100rpx;
  353. position:relative;
  354. background: $bg-color;
  355. justify-content: center;
  356. // border-bottom: 1px solid #EBEBEB;
  357. &.cell-hover{
  358. background:#fafafa;
  359. }
  360. .cell-more{
  361. align-self: baseline;
  362. font-size:$font-size-28;
  363. color:$text-color;
  364. margin-left:10rpx;
  365. }
  366. .cell-tit{
  367. flex: 1;
  368. font-size: $font-size-28;
  369. color: $text-color;
  370. margin-right:10rpx;
  371. }
  372. .cell-tip{
  373. font-size: $font-size-28;
  374. color: $text-color;
  375. }
  376. }
  377. .list-cell.last{
  378. border-bottom: none;
  379. }
  380. .uni-badge--small {
  381. -webkit-transform: scale(.8);
  382. -ms-transform: scale(.8);
  383. transform: scale(.8);
  384. -webkit-transform-origin: center center;
  385. -ms-transform-origin: center center;
  386. transform-origin: center center;
  387. }
  388. .uni-badge {
  389. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  390. -webkit-box-sizing: border-box;
  391. box-sizing: border-box;
  392. font-size: 12px;
  393. line-height: 1;
  394. display: inline-block;
  395. padding: 3px 6px;
  396. color: #333;
  397. border-radius: 100px;
  398. background-color: #f1f1f1;
  399. }
  400. .uni-badge-error {
  401. color: #fff;
  402. background-color: #dd524d;
  403. }
  404. </style>