index.vue 6.1 KB

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