user.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  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://img.caimei365.com/group1/M00/03/94/Cmis216Sk_SAPDwvAAcTspdl8h0610.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://img.caimei365.com/group1/M00/03/94/Cmis216Sk_OAZaxVAAANf4oruy4674.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.linkMan1?sellerData.seller.linkMan1:'' //协销名称
  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. this.userId = resolve.userID
  164. this.initData()
  165. })
  166. }
  167. }
  168. }
  169. </script>
  170. <style lang="scss">
  171. @import "@/uni.scss";
  172. page{
  173. background-color: #F7F7F7;
  174. }
  175. .user{
  176. width: 100%;
  177. height: auto;
  178. position:relative;
  179. background: rgba(247, 247, 247, 1);
  180. }
  181. .user-section.none{
  182. display: none;
  183. }
  184. .user-section.show{
  185. display: block;
  186. }
  187. .u-header{
  188. width: 100%;
  189. height: 400rpx;
  190. position: relative;
  191. image{
  192. width: 100%;
  193. height: 400rpx;
  194. }
  195. }
  196. .u-header-main{
  197. width: 100%;
  198. height: 284rpx;
  199. padding: 58rpx 0;
  200. position: absolute;
  201. top: 0;
  202. left: 0;
  203. .user-item{
  204. width: 100%;
  205. display: flex;
  206. flex-direction: column;
  207. align-items: center;
  208. margin-bottom: 16rpx;
  209. .u-h1{
  210. width: 410rpx;
  211. font-size: $font-size-28;
  212. line-height: 40rpx;
  213. color: #FFFFFF;
  214. margin-bottom: 8rpx;
  215. -o-text-overflow: ellipsis;
  216. text-overflow: ellipsis;
  217. display: -webkit-box;
  218. word-break: break-all;
  219. -webkit-box-orient: vertical;
  220. -webkit-line-clamp: 1;
  221. overflow: hidden;
  222. align-items: center;
  223. }
  224. .u-p{
  225. font-size: $font-size-24;
  226. line-height: 40rpx;
  227. color: #FFFFFF;
  228. }
  229. }
  230. .logo-m{
  231. width: 144rpx;
  232. height: 144rpx;
  233. border: 2rpx solid #FFFFFF;
  234. border-radius: 100%;
  235. background: $bg-color;
  236. position: relative;
  237. .txt{
  238. width: 144rpx;
  239. height: 42rpx;
  240. display: inline-block;
  241. background: linear-gradient(45deg,rgba(225,86,22,1) 0%,rgba(255,177,0,1) 100%);
  242. border-radius: 21rpx;
  243. line-height: 42rpx;
  244. text-align: center;
  245. color: #FFFFFF;
  246. font-size: $font-size-22;
  247. position: absolute;
  248. bottom: -10rpx;
  249. left: 0;
  250. }
  251. image{
  252. width: 144rpx;
  253. height: 144rpx;
  254. border-radius: 100%;
  255. }
  256. }
  257. }
  258. .user-order{
  259. width: 702rpx;
  260. height: auto;
  261. padding: 0 24rpx;
  262. background-color: $bg-color;
  263. margin-bottom: 24rpx;
  264. }
  265. .tab-title{
  266. font-size: $font-size-28;
  267. line-height: 80rpx;
  268. color: #333333;
  269. text-align:left;
  270. border-bottom: 1px solid #F8F8F8;
  271. position: relative;
  272. .cell-tit{
  273. font-size: $font-size-28;
  274. color: $text-color;
  275. }
  276. .cell-more{
  277. float: right;
  278. line-height: 80rpx;
  279. font-size: $font-size-24;
  280. color: $text-color;
  281. padding-right: 30rpx;
  282. }
  283. .iconfont{
  284. width: 30rpx;
  285. height: 80rpx;
  286. line-height: 80rpx;
  287. font-size: $font-size-28;
  288. text-align: center;
  289. position: absolute;
  290. right: 0;
  291. top: 0;
  292. display: block;
  293. }
  294. }
  295. .order-section{
  296. display: flex;
  297. justify-content: space-around;
  298. align-items: center;
  299. flex-wrap:wrap;
  300. height: 99rpx;
  301. padding: 24rpx 0;
  302. }
  303. .order-item{
  304. display: flex;
  305. flex-direction: column;
  306. align-items: center;
  307. width: 98rpx;
  308. position: relative;
  309. margin-right: 53rpx;
  310. &:last-child{
  311. margin-right: 0;
  312. }
  313. .order-icon{
  314. width: 52rpx;
  315. height: 52rpx;
  316. position: relative;
  317. image{
  318. width: 52rpx;
  319. height: 52rpx;
  320. }
  321. .icon-num{
  322. position: absolute;
  323. right:-24rpx;
  324. top: -9rpx;
  325. }
  326. .icon-num.goleft{
  327. right: -12rpx;
  328. }
  329. }
  330. .order-t{
  331. line-height: 50rpx;
  332. font-size: $font-size-24;
  333. color: $text-color;
  334. }
  335. }
  336. .foot-list{
  337. width: 100%;
  338. // margin-bottom: 150rpx;
  339. }
  340. .list-cell-item{
  341. width: 702rpx;
  342. height: auto;
  343. margin-bottom: 24rpx;
  344. padding:0 24rpx;
  345. background: $bg-color;
  346. }
  347. .list-cell{
  348. display:flex;
  349. width: 100%;
  350. align-items:baseline;
  351. line-height:100rpx;
  352. position:relative;
  353. background: $bg-color;
  354. justify-content: center;
  355. // border-bottom: 1px solid #EBEBEB;
  356. &.cell-hover{
  357. background:#fafafa;
  358. }
  359. .cell-more{
  360. align-self: baseline;
  361. font-size:$font-size-28;
  362. color:$text-color;
  363. margin-left:10rpx;
  364. }
  365. .cell-tit{
  366. flex: 1;
  367. font-size: $font-size-28;
  368. color: $text-color;
  369. margin-right:10rpx;
  370. }
  371. .cell-tip{
  372. font-size: $font-size-28;
  373. color: $text-color;
  374. }
  375. }
  376. .list-cell.last{
  377. border-bottom: none;
  378. }
  379. .uni-badge--small {
  380. -webkit-transform: scale(.8);
  381. -ms-transform: scale(.8);
  382. transform: scale(.8);
  383. -webkit-transform-origin: center center;
  384. -ms-transform-origin: center center;
  385. transform-origin: center center;
  386. }
  387. .uni-badge {
  388. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  389. -webkit-box-sizing: border-box;
  390. box-sizing: border-box;
  391. font-size: 12px;
  392. line-height: 1;
  393. display: inline-block;
  394. padding: 3px 6px;
  395. color: #333;
  396. border-radius: 100px;
  397. background-color: #f1f1f1;
  398. }
  399. .uni-badge-error {
  400. color: #fff;
  401. background-color: #dd524d;
  402. }
  403. </style>