index.vue 4.7 KB

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