specialistsDetail.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view>
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
  5. left-icon="left" title="累计交友圈专员详情" @clickLeft="back"/>
  6. <!-- #endif -->
  7. <view class="flex-row justify-center">
  8. <u-tabs :list="tabList" lineWidth="50" :scrollable="false" @click="clickTabs" :current="current"></u-tabs>
  9. </view>
  10. <swiper class="swiper" :style="{height:height}" :current="current" @change="swiperChange">
  11. <swiper-item>
  12. <view class="msg" :style="{height:height}">
  13. <view class="flex-row justify-between msgItem">
  14. <view>
  15. <text>头像</text>
  16. </view>
  17. <view>
  18. <image :src="expandUser.selfPhotoUrl || '/static/ud4.png'" class="profilePhoto"></image>
  19. </view>
  20. </view>
  21. <view class="flex-row justify-between msgItem">
  22. <view>
  23. <text>好友编号</text>
  24. </view>
  25. <view>
  26. <text>{{expandUser.id}}</text>
  27. </view>
  28. </view>
  29. <view class="flex-row justify-between msgItem">
  30. <view>
  31. <text>姓名</text>
  32. </view>
  33. <view>
  34. <text>{{expandUser.name}}</text>
  35. </view>
  36. </view>
  37. <view class="flex-row justify-between msgItem">
  38. <view>
  39. <text>电话号码</text>
  40. </view>
  41. <view>
  42. <text>{{expandUser.phone}}</text>
  43. </view>
  44. </view>
  45. <view class="flex-row justify-between msgItem">
  46. <view>
  47. <text>备注</text>
  48. </view>
  49. <view class="itemValue">
  50. <text>{{expandUser.remake}}</text>
  51. </view>
  52. </view>
  53. <view class="flex-row justify-between msgItem">
  54. <view>
  55. <text>备注地址</text>
  56. </view>
  57. <view class="itemValue">
  58. <text>{{expandUser.remarkAddress}}</text>
  59. </view>
  60. </view>
  61. <view class="flex-row justify-between msgItem">
  62. <view>
  63. <text>现场照片</text>
  64. </view>
  65. <view class="itemValue scenePhoto">
  66. <image :src="item.url" class="photo" v-for="(item,index) in scenePhotoArr" :key="index" @click="amplifier(item.url)"></image>
  67. </view>
  68. </view>
  69. <view class="flex-row msgItem">
  70. <view>
  71. <text>合同</text>
  72. </view>
  73. <view >
  74. <text class="see" @click="seeContract(expandUser.expand1)">点击查看</text>
  75. </view>
  76. </view>
  77. <view class="flex-row justify-center">
  78. <button class="jiechuBtn" type="warn" @click="unbind">解除绑定</button>
  79. </view>
  80. </view>
  81. </swiper-item>
  82. <swiper-item>
  83. <mescroll-item ref="MescrollItem" :i="0" :index="0" :height="height" :expandUserId="expandUserId">
  84. </mescroll-item>
  85. </swiper-item>
  86. </swiper>
  87. <uni-popup ref="amplifierPopup" type="center">
  88. <view class="amplifierImg">
  89. <image mode="widthFix" :src="amplifierUrl"></image>
  90. </view>
  91. </uni-popup>
  92. <!--#ifdef H5-->
  93. <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
  94. <!--#endif-->
  95. </view>
  96. </template>
  97. <script>
  98. import MescrollItem from "./module/mescrollUni-item.vue";
  99. import {url} from "../../uni_modules/uv-ui-tools/libs/function/test";
  100. export default {
  101. components: {
  102. MescrollItem
  103. },
  104. data() {
  105. return {
  106. amplifierUrl:'',
  107. scenePhotoArr:[],
  108. expandUser: {},
  109. expandUserId: null,
  110. height: '',
  111. current: 0,
  112. tabList: [{
  113. name: '详情备注',
  114. }, {
  115. name: '交友记录',
  116. }]
  117. }
  118. },
  119. onLoad(e) {
  120. this.expandUserId = e.id
  121. let sysInfo = uni.getSystemInfoSync()
  122. this.height = sysInfo.windowHeight - 140 + 'px' //除标题栏栏外的屏幕可用高度
  123. this.expandUserDetail()
  124. },
  125. methods: {
  126. seeContract(id){
  127. console.log(id)
  128. if (!id){
  129. uni.showToast({
  130. title: '暂无合同',
  131. icon: 'error',
  132. duration: 2000
  133. });
  134. return
  135. }
  136. this.$api.service.getImage(id).then(res=>{
  137. res.data.data[0].url = res.data.data[0].url.replace(/^http:/, "https:")
  138. if (res.data.data){
  139. uni.navigateTo({
  140. url:'/pages/pdfView/pdfView?contract='+ JSON.stringify(res.data.data[0]),
  141. })
  142. }
  143. })
  144. },
  145. unbind(){
  146. let that = this
  147. uni.showModal({
  148. title: '危险操作',
  149. content: '解除绑定后不可恢复,请再次确认!',
  150. success: function (res) {
  151. if (res.confirm) {
  152. console.log('用户点击确定');
  153. that.$api.service.unbind({
  154. id:that.expandUserId
  155. }).then(res=>{
  156. uni.$u.toast("解除绑定成功")
  157. console.log(res)
  158. uni.navigateBack({
  159. delta: 1
  160. });
  161. })
  162. } else if (res.cancel) {
  163. console.log('用户点击取消');
  164. }
  165. }
  166. });
  167. },
  168. amplifier(url){
  169. this.amplifierUrl = url
  170. this.$refs.amplifierPopup.open()
  171. },
  172. expandUserDetail(){
  173. this.$api.service.expandUserDetail({
  174. expandUserId:this.expandUserId
  175. }).then(async res=>{
  176. this.expandUser = res.data.data
  177. if (this.expandUser.img){
  178. let oss = await this.$commonUtils.getImgUrlByOssId(this.expandUser.img)
  179. this.expandUser.selfPhotoUrl = oss[0].url
  180. }
  181. if (this.expandUser.scenePhoto){
  182. if (this.expandUser.scenePhoto){
  183. let arr = this.expandUser.scenePhoto.split(',')
  184. for (const imgId of arr) {
  185. let oss = await this.$commonUtils.getImgUrlByOssId(imgId)
  186. this.scenePhotoArr.push(oss[0])
  187. this.$set(this.scenePhotoArr)
  188. }
  189. }
  190. }
  191. this.$set(this.expandUser)
  192. console.log('人员详情',this.expandUser)
  193. })
  194. },
  195. swiperChange(e) {
  196. console.log(e)
  197. this.current = e.detail.current
  198. },
  199. clickTabs(e) {
  200. this.current = e.index
  201. },
  202. back() {
  203. let pages = getCurrentPages()
  204. if (pages.length > 1) {
  205. uni.navigateBack({
  206. delta: 1,
  207. fail: err => {
  208. console.log(err)
  209. }
  210. })
  211. } else {
  212. uni.switchTab({
  213. url: '/pages/index/index'
  214. });
  215. }
  216. },
  217. }
  218. }
  219. </script>
  220. <style lang="scss" scoped>
  221. @import './index.rpx.css';
  222. </style>