user.vue 11 KB

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