index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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.imgUrl" :src="item.imgUrl" 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. this.listServiceObject();
  51. },
  52. methods: {
  53. // 查询服务对接信息列表
  54. listServiceObject(){
  55. this.$api.listServiceObject(this.reqParm).then((res)=>{
  56. console.log(res)
  57. this.serviceObjectList = res.data.data
  58. this.getImgUrlByBannerOssId(this.serviceObjectList);
  59. }).catch(() =>{
  60. uni.showToast({
  61. title: "操作失败"
  62. })
  63. });
  64. },
  65. // 获取图片
  66. getImgUrlByBannerOssId(items){
  67. for(let i = 0; i <items.length; i++) {
  68. if (items[i].facePhoto){
  69. this.$api.getImgUrlByOssId({ossId:items[i].facePhoto}).then(res=>{
  70. items[i].facePhoto = res.data.data[0].url.replace(/^http:/, "https:")
  71. })
  72. }
  73. }
  74. },
  75. /* 添加服务对象 */
  76. gotoAddServiceObject(){
  77. uni.navigateTo({
  78. url: '/myPages/serviceObjectFaceAuth/index',
  79. })
  80. },
  81. // 去修改服务对象
  82. gotoUpdateServiceObject(item){
  83. item.facePhotoUrl = item.imgUrl;
  84. if(item.wardship == '1'){ // 监护人
  85. uni.navigateTo({
  86. url: '/myPages/serviceObjectAllInfo/index?data=' + JSON.stringify(item),
  87. })
  88. } else { // 不是监护人
  89. item.opType = '2';
  90. uni.navigateTo({
  91. url: '/myPages/serviceObjectInfo/index?data=' + JSON.stringify(item) ,
  92. })
  93. }
  94. },
  95. }
  96. };
  97. </script>
  98. <style lang="scss" scoped>
  99. .service-object-wrap{
  100. margin-left: 12px;
  101. margin-right: 12px;
  102. .add{
  103. position: fixed;
  104. bottom: 12px;
  105. right: 12px;
  106. left: 12px;
  107. margin-top: 20px;
  108. text-align: center;
  109. color: #333333;
  110. line-height: 42px;
  111. border-radius: 6px;
  112. font-size: 16px;
  113. height: 42px;
  114. background: #FFE05C;
  115. border-radius: 27px;
  116. .name{
  117. padding-left: 6px;
  118. }
  119. }
  120. .service-object-list{
  121. .store-content{
  122. padding:10px;
  123. margin-top: 16px;
  124. background: #fff;
  125. display: flex;
  126. border-radius: 6px;
  127. .store-img{
  128. image{
  129. width: 90px;
  130. height: 90px;
  131. border-radius: 3px;
  132. }
  133. }
  134. .content{
  135. width: 100%;
  136. padding-left: 8px;
  137. padding-top: 4px;
  138. .title-price{
  139. display: flex;
  140. font-size: 20px;
  141. .title{
  142. font-size: 16px;
  143. color: #111111;
  144. width: 100%;
  145. font-family: "黑体", sans-serif;
  146. line-height: 30px;
  147. }
  148. .icon-btn{
  149. text-align: right;
  150. padding-right: 12px;
  151. image{
  152. height: 36px;
  153. width: 36px;
  154. }
  155. }
  156. }
  157. .desc{
  158. line-height: 26px;
  159. color: #999999;
  160. font-size: 12px;
  161. white-space: nowrap; /* Prevent line breaks */
  162. overflow: hidden; /* Hide overflowing content */
  163. text-overflow: ellipsis; /* Show ellipsis (...) for overflow */
  164. .teacher{
  165. padding-left: 6px;
  166. }
  167. .completed{
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. </style>