index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="page" :style="{'height':windowHeight}">
  3. <scroll-view :style="{'height':windowHeight}" scroll-y>
  4. <view class="service-object-wrap">
  5. <view class="service-object-list" >
  6. <view v-for="(item,index) in serviceObjectList" class="store-content" :key="index">
  7. <view class="store-img">
  8. <image :src="item.facePhotoUrl || '/static/logo.png'" mode=""></image>
  9. </view>
  10. <view class="content">
  11. <view class="title-price">
  12. <view class="title">
  13. <text>{{item.nickName || '未填写'}}</text>
  14. </view>
  15. <view @click="gotoUpdateServiceObject(item)" class="icon-btn">
  16. <image src="/static/me/u2299.png" mode=""></image>
  17. </view>
  18. </view>
  19. <view class="desc">
  20. <view class="in-progress">关系:{{item.blood}}</view>
  21. <view class="completed" >
  22. 备注:<text>{{item.remark || '无'}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </scroll-view>
  30. <view @click="gotoAddServiceObject()" class="add">
  31. +<text class="name">添加服务对象</text>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. windowHeight:'',
  40. reqParm: {
  41. auth: true
  42. },
  43. serviceObjectList: [],
  44. images: [],
  45. };
  46. },
  47. mounted() {
  48. },
  49. onLoad() {
  50. let sysInfo = uni.getSystemInfoSync()
  51. this.windowHeight =sysInfo.windowHeight -100 +'px'//除标题栏栏外的屏幕可用高度
  52. },
  53. onShow(){
  54. // 查询服务对象列表
  55. this.listServiceObject();
  56. },
  57. methods: {
  58. // 查询服务对接信息列表
  59. listServiceObject(){
  60. this.$api.listServiceObject(this.reqParm).then((res)=>{
  61. console.log(res)
  62. this.serviceObjectList = res.data.data
  63. this.getImgUrlByBannerOssId(this.serviceObjectList);
  64. })
  65. },
  66. // 获取图片
  67. getImgUrlByBannerOssId(items){
  68. for(let i = 0; i <items.length; i++) {
  69. if (items[i].facePhoto){
  70. this.$api.getImgUrlByOssId({ossId:items[i].facePhoto}).then(res=>{
  71. console.log('++++++++++++facePhotoUrl+++++++++',res.data.data[0].url.replace(/^http:/, "https:"))
  72. items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  73. this.$set(this.serviceObjectList,i,items[i])
  74. })
  75. }
  76. }
  77. },
  78. /* 添加服务对象 */
  79. gotoAddServiceObject(){
  80. uni.navigateTo({
  81. url: '/myPages/serviceObjectFaceAuth/index',
  82. })
  83. },
  84. // 去修改服务对象
  85. gotoUpdateServiceObject(item){
  86. item.facePhotoUrl = item.imgUrl;
  87. if(item.wardship == '1'){ // 监护人
  88. uni.navigateTo({
  89. url: '/myPages/serviceObjectAllInfo/index?data=' + JSON.stringify(item),
  90. })
  91. } else { // 不是监护人
  92. item.opType = '2';
  93. uni.navigateTo({
  94. url: '/myPages/serviceObjectInfo/index?data=' + JSON.stringify(item) ,
  95. })
  96. }
  97. },
  98. }
  99. };
  100. </script>
  101. <style lang="scss" scoped>
  102. .page{
  103. background: #f7f7f7;
  104. border-top: 1px solid #f7f7f7;
  105. }
  106. .add{
  107. width: 686rpx;
  108. margin-left: 32rpx;
  109. margin-top: 30px;
  110. text-align: center;
  111. color: #333333;
  112. line-height: 42px;
  113. border-radius: 6px;
  114. font-size: 16px;
  115. height: 42px;
  116. background: #FFE05C;
  117. border-radius: 27px;
  118. .name{
  119. padding-left: 6px;
  120. }
  121. }
  122. .service-object-wrap{
  123. margin-left: 12px;
  124. margin-right: 12px;
  125. .service-object-list{
  126. .store-content{
  127. padding:10px;
  128. margin-top: 16px;
  129. background: #fff;
  130. display: flex;
  131. border-radius: 6px;
  132. .store-img{
  133. image{
  134. width: 90px;
  135. height: 90px;
  136. border-radius: 3px;
  137. }
  138. }
  139. .content{
  140. width: 100%;
  141. padding-left: 8px;
  142. padding-top: 4px;
  143. .title-price{
  144. display: flex;
  145. font-size: 20px;
  146. .title{
  147. font-size: 16px;
  148. color: #111111;
  149. width: 100%;
  150. font-family: "黑体", sans-serif;
  151. line-height: 30px;
  152. }
  153. .icon-btn{
  154. text-align: right;
  155. padding-right: 12px;
  156. image{
  157. height: 30px;
  158. width: 30px;
  159. }
  160. }
  161. }
  162. .desc{
  163. line-height: 26px;
  164. color: #999999;
  165. font-size: 12px;
  166. white-space: nowrap; /* Prevent line breaks */
  167. overflow: hidden; /* Hide overflowing content */
  168. text-overflow: ellipsis; /* Show ellipsis (...) for overflow */
  169. .teacher{
  170. padding-left: 6px;
  171. }
  172. .completed{
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }
  179. </style>