ygdetail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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.liuniukj.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.liuniukj.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. {{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. this.ygid = opt.id
  96. this.getYgdetail()
  97. this.getYgPj()
  98. },
  99. onShow() {
  100. },
  101. onReachBottom() {
  102. },
  103. onReady() {
  104. var _this = this;
  105. uni.getSystemInfo({
  106. success: resu => {
  107. const query = uni.createSelectorQuery();
  108. query.select('.swiper-box').boundingClientRect();
  109. query.exec(function(res) {
  110. _this.height = resu.windowHeight - res[0].top + 'px';
  111. console.log('打印页面的剩余高度', _this.height);
  112. });
  113. },
  114. fail: res => {}
  115. });
  116. },
  117. filters: {
  118. showName(val) {
  119. if(val !== '') {
  120. let arr = val.split('')
  121. return arr[0] + '***'+ arr[arr.length-1]
  122. }else {
  123. return '佚名'
  124. }
  125. }
  126. },
  127. methods: {
  128. getYgdetail() {
  129. this.$u.api.getYgdetail({
  130. request_id: this.ygid
  131. }).then(({data})=> {
  132. this.yg_detail = data
  133. })
  134. },
  135. getYgPj() {
  136. if(this.loadingType == 'nomore' || this.loadingType == 'loading') {
  137. return
  138. }
  139. this.loadingType = 'loading'
  140. this.$u.api.getYgPj({
  141. id: this.ygid, //员工id
  142. page: this.page, //分页页码,数字类型
  143. pageSize: this.pageSize
  144. }).then(({data})=> {
  145. this.list = this.list.concat(data)
  146. this.page++
  147. this.loaded = true
  148. if(this.pageSize == data.length) {
  149. this.loadingType = 'loadmore'
  150. }else {
  151. this.loadingType = 'nomore'
  152. }
  153. })
  154. }
  155. }
  156. }
  157. </script>
  158. <style lang="scss">
  159. page {
  160. background-color: #fff;
  161. }
  162. .yg-top {
  163. height: 326rpx;
  164. width: 100%;
  165. // color: #262261;
  166. background-color: #262261;
  167. position: relative;
  168. .yg-img {
  169. position: absolute;
  170. width: 120rpx;
  171. height: 120rpx;
  172. border-radius: 50%;
  173. top: 96rpx;
  174. left: 43rpx;
  175. background-color: #eee;
  176. }
  177. .yg-name {
  178. position: absolute;
  179. font-size: 36rpx;
  180. font-weight: 500;
  181. color: #FFFFFF;
  182. top: 115rpx;
  183. left: 185rpx;
  184. }
  185. .star-wrap {
  186. position: absolute;
  187. top: 170rpx;
  188. left: 185rpx;
  189. display: flex;
  190. justify-content: flex-start;
  191. .start {
  192. margin-right: 10rpx;
  193. }
  194. }
  195. }
  196. .yg-info {
  197. margin: -78rpx auto 20rpx;
  198. position: relative;
  199. width: 694rpx;
  200. padding-bottom: 10rpx;
  201. // height: 299rpx;
  202. background: #FFFFFF;
  203. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  204. border-radius: 10rpx;
  205. .info-line {
  206. border-bottom: 1px solid #F8F8F8;
  207. font-size: 20rpx;
  208. font-weight: 500;
  209. color: #666666;
  210. height: 72rpx;
  211. line-height: 72rpx;
  212. display: flex;
  213. .info-val {
  214. flex-grow: 1;
  215. }
  216. }
  217. }
  218. .left-name {
  219. flex-shrink: 0;
  220. height: 72rpx;
  221. width: 165rpx;
  222. display: flex;
  223. justify-content: flex-end;
  224. align-items: center;
  225. font-size: 25rpx;
  226. font-weight: bold;
  227. color: #101010;
  228. padding-right: 10rpx;
  229. image {
  230. width: 28rpx;
  231. height: 28rpx;
  232. margin-right: 15rpx;
  233. background-color: #eee;
  234. }
  235. }
  236. .pj-tit {
  237. font-size: 30rpx;
  238. font-weight: bold;
  239. color: #101010;
  240. padding: 26rpx;
  241. }
  242. .pj-wrap {
  243. width: 100%;
  244. min-height: 244rpx;
  245. border-bottom:#f5f5f5 1rpx solid;
  246. background-color: #fff;
  247. padding: 30rpx;
  248. .pj-user {
  249. display: flex;
  250. align-items: center;
  251. height: 75rpx;
  252. .user-logo {
  253. width: 75rpx;
  254. height: 75rpx;
  255. background-color: #eee;
  256. border-radius: 50%;
  257. margin-right: 10rpx;
  258. }
  259. .user-info {
  260. flex-grow: 1;
  261. .user-name {
  262. font-size: 26rpx;
  263. font-weight: 500;
  264. color: #545456;
  265. margin-bottom: 10rpx;
  266. }
  267. .star-wrap {
  268. display: flex;
  269. justify-content: flex-start;
  270. .start {
  271. margin-right: 10rpx;
  272. }
  273. }
  274. }
  275. .pj-time {
  276. font-size: 24rpx;
  277. font-weight: 400;
  278. color: #545456;
  279. }
  280. }
  281. .pj-info {
  282. padding-top: 30rpx;
  283. font-size: 24rpx;
  284. font-weight: 500;
  285. color: #545456;
  286. }
  287. }
  288. .swiper-box {
  289. }
  290. </style>