ygdetail.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="content">
  3. <view class="yg-top">
  4. <image :src="yg_detail.avatar" mode="" class="yg-img"></image>
  5. <view class="yg-name">
  6. {{yg_detail.staffName}}
  7. </view>
  8. <view class="star-wrap">
  9. <u-rate :count="count" v-model="yg_detail.evaluate" active-color="#F3BE69" inactive-color="#eee" disabled></u-rate>
  10. <!-- <u-icon name="star-fill" color="#F3BE69" v-for="item in star*1" class="start" size="20rpx"></u-icon>
  11. <u-icon name="star-fill" color="#eee" v-for="itemt in (5-star*1)" class="start" size="20rpx"></u-icon> -->
  12. </view>
  13. </view>
  14. <view class="yg-info">
  15. <view class="info-line">
  16. <view class="left-name">
  17. <image src="https://api.junhailan.com/img/user/ljfw.png" mode=""></image>
  18. <view class="">
  19. 累计服务
  20. </view>
  21. </view>
  22. <view class="info-val">
  23. {{yg_detail.sold}}次
  24. </view>
  25. </view>
  26. <!-- <view class="info-line">
  27. <view class="left-name">
  28. <image src="" mode=""></image>
  29. <view class="">
  30. 从业年限
  31. </view>
  32. </view>
  33. <view class="info-val">
  34. 2年
  35. </view>
  36. </view> -->
  37. <view class="info-line" style="height: auto;border-bottom: none;">
  38. <view class="left-name">
  39. <image src="https://api.junhailan.com/img/user/ygjj.png" mode=""></image>
  40. <view class="">
  41. 员工简介
  42. </view>
  43. </view>
  44. <view class="info-val" style="line-height: 1.5;padding-top: 20rpx;">
  45. {{yg_detail.info || '暂无'}}
  46. </view>
  47. </view>
  48. </view>
  49. <view class="pj-tit">
  50. 服务评价
  51. </view>
  52. <scroll-view scroll-y="true" :style="{'height': height}" class="swiper-box">
  53. <u-empty text="暂无数据" mode="data" v-if="list.length == 0 && loaded"></u-empty>
  54. <view class="pj-wrap" v-for="item in list">
  55. <view class="pj-user">
  56. <image :src="item.customer.avatar" mode="" class="user-logo"></image>
  57. <view class="user-info">
  58. <view class="user-name">
  59. {{item.customer.name | showName}}
  60. </view>
  61. <view class="star-wrap">
  62. <u-rate :count="count" v-model="item.score" active-color="#F3BE69" inactive-color="#999" disabled></u-rate>
  63. </view>
  64. </view>
  65. <view class="pj-time">
  66. {{$utils.formatDate(item.createTime)}}
  67. </view>
  68. </view>
  69. <view class="pj-info">
  70. {{item.comment}}
  71. </view>
  72. </view>
  73. <u-loadmore :status="loadingType" v-if="!loaded || list.length > 0"/>
  74. </scroll-view>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. loaded: false,
  82. count: 5,
  83. star: 3,
  84. height: '',
  85. pjlist: 10,
  86. ygid: '',
  87. yg_detail: {},
  88. page:1,
  89. pageSize: 10,
  90. loadingType: 'loadmore',
  91. list: []
  92. }
  93. },
  94. onLoad(opt) {
  95. if(opt.type) {
  96. this.ygid = this.$store.state.userInfo.staffId
  97. }else {
  98. this.ygid = opt.id
  99. }
  100. this.getYgdetail()
  101. this.getYgPj()
  102. },
  103. onShow() {
  104. },
  105. onReachBottom() {
  106. },
  107. onReady() {
  108. var _this = this;
  109. uni.getSystemInfo({
  110. success: resu => {
  111. const query = uni.createSelectorQuery();
  112. query.select('.swiper-box').boundingClientRect();
  113. query.exec(function(res) {
  114. _this.height = resu.windowHeight - res[0].top + 'px';
  115. console.log('打印页面的剩余高度', _this.height);
  116. });
  117. },
  118. fail: res => {}
  119. });
  120. },
  121. filters: {
  122. showName(val) {
  123. if(val !== '') {
  124. let arr = val.split('')
  125. return arr[0] + '***'+ arr[arr.length-1]
  126. }else {
  127. return '佚名'
  128. }
  129. }
  130. },
  131. methods: {
  132. getYgdetail() {
  133. this.$u.api.getYgdetail({
  134. request_id: this.ygid
  135. }).then(({data})=> {
  136. this.yg_detail = data
  137. })
  138. },
  139. getYgPj() {
  140. if(this.loadingType == 'nomore' || this.loadingType == 'loading') {
  141. return
  142. }
  143. this.loadingType = 'loading'
  144. this.$u.api.getYgPj({
  145. id: this.ygid, //员工id
  146. page: this.page, //分页页码,数字类型
  147. pageSize: this.pageSize
  148. }).then(({data})=> {
  149. this.list = this.list.concat(data)
  150. this.page++
  151. this.loaded = true
  152. if(this.pageSize == data.length) {
  153. this.loadingType = 'loadmore'
  154. }else {
  155. this.loadingType = 'nomore'
  156. }
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss">
  163. page {
  164. background-color: #fff;
  165. }
  166. .yg-top {
  167. height: 326rpx;
  168. width: 100%;
  169. // color: #262261;
  170. background-color: #262261;
  171. position: relative;
  172. .yg-img {
  173. position: absolute;
  174. width: 120rpx;
  175. height: 120rpx;
  176. border-radius: 50%;
  177. top: 96rpx;
  178. left: 43rpx;
  179. background-color: #eee;
  180. }
  181. .yg-name {
  182. position: absolute;
  183. font-size: 36rpx;
  184. font-weight: 500;
  185. color: #FFFFFF;
  186. top: 115rpx;
  187. left: 185rpx;
  188. }
  189. .star-wrap {
  190. position: absolute;
  191. top: 170rpx;
  192. left: 185rpx;
  193. display: flex;
  194. justify-content: flex-start;
  195. .start {
  196. margin-right: 10rpx;
  197. }
  198. }
  199. }
  200. .yg-info {
  201. margin: -78rpx auto 20rpx;
  202. position: relative;
  203. width: 694rpx;
  204. padding-bottom: 10rpx;
  205. // height: 299rpx;
  206. background: #FFFFFF;
  207. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  208. border-radius: 10rpx;
  209. .info-line {
  210. border-bottom: 1px solid #F8F8F8;
  211. font-size: 20rpx;
  212. font-weight: 500;
  213. color: #666666;
  214. height: 72rpx;
  215. line-height: 72rpx;
  216. display: flex;
  217. .info-val {
  218. flex-grow: 1;
  219. }
  220. }
  221. }
  222. .left-name {
  223. flex-shrink: 0;
  224. height: 72rpx;
  225. width: 165rpx;
  226. display: flex;
  227. justify-content: flex-end;
  228. align-items: center;
  229. font-size: 25rpx;
  230. font-weight: bold;
  231. color: #101010;
  232. padding-right: 10rpx;
  233. image {
  234. width: 28rpx;
  235. height: 28rpx;
  236. margin-right: 15rpx;
  237. background-color: #eee;
  238. }
  239. }
  240. .pj-tit {
  241. font-size: 30rpx;
  242. font-weight: bold;
  243. color: #101010;
  244. padding: 26rpx;
  245. }
  246. .pj-wrap {
  247. width: 100%;
  248. min-height: 244rpx;
  249. border-bottom:#f5f5f5 1rpx solid;
  250. background-color: #fff;
  251. padding: 30rpx;
  252. .pj-user {
  253. display: flex;
  254. align-items: center;
  255. height: 75rpx;
  256. .user-logo {
  257. width: 75rpx;
  258. height: 75rpx;
  259. background-color: #eee;
  260. border-radius: 50%;
  261. margin-right: 10rpx;
  262. }
  263. .user-info {
  264. flex-grow: 1;
  265. .user-name {
  266. font-size: 26rpx;
  267. font-weight: 500;
  268. color: #545456;
  269. margin-bottom: 10rpx;
  270. }
  271. .star-wrap {
  272. display: flex;
  273. justify-content: flex-start;
  274. .start {
  275. margin-right: 10rpx;
  276. }
  277. }
  278. }
  279. .pj-time {
  280. font-size: 24rpx;
  281. font-weight: 400;
  282. color: #545456;
  283. }
  284. }
  285. .pj-info {
  286. padding-top: 30rpx;
  287. font-size: 24rpx;
  288. font-weight: 500;
  289. color: #545456;
  290. }
  291. }
  292. .swiper-box {
  293. }
  294. </style>