details.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-12 11:57:48
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-02-28 10:21:59
  6. * @Description: file content
  7. * @FilePath: \oms\pages\distributor\details.vue
  8. -->
  9. <template>
  10. <view class="home">
  11. <view class="nav">
  12. <view :style="{ paddingTop }">
  13. <view class="title" :style="[{ height }, { lineHeight: height }]">
  14. <view class="back" @click="goBack()">
  15. <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
  16. </view>
  17. <text>合作伙伴详情</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="main">
  22. <view class="main-top">
  23. <view class="customer-box">
  24. <view class="header flex1">
  25. <view class="name flex_l">
  26. <image class="img" src="../../static/images/menu1.png" mode="scaleToFill" />
  27. <text>{{ details.name }}</text>
  28. </view>
  29. <view class="date">{{ parseTime(details.createdTime, '{y}-{m}-{d}') }}</view>
  30. </view>
  31. <view class="info">
  32. <view class="info-item">
  33. <u-row>
  34. <u-col span="6">
  35. <view class="flex_l">
  36. <view class="info-label">负责区域:</view>
  37. <text class="info-txt">{{ details.territory }}</text>
  38. </view>
  39. </u-col>
  40. <u-col span="6">
  41. <view class="flex_l">
  42. <view class="info-label">联系方式:</view>
  43. <text class="info-txt">{{ details.contactWay }}</text>
  44. </view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <view class="info-item">
  49. <u-row justify="space-between">
  50. <u-col span="6">
  51. <view class="flex_l">
  52. <view class="info-label">岗位:</view>
  53. <text class="info-txt">{{ details.post }}</text>
  54. </view>
  55. </u-col>
  56. <u-col span="6">
  57. <view class="flex_l">
  58. <view class="info-label">备注:</view>
  59. <text class="info-txt">{{ details.remark }}</text>
  60. </view>
  61. </u-col>
  62. </u-row>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="tabs">
  67. <u-tabs
  68. v-if="curTabIndex >= 0"
  69. @change="changeTabs"
  70. :current="curTabIndex"
  71. :scrollable="false"
  72. :list="list"
  73. :activeStyle="{
  74. color: '#3E7EF8',
  75. fontWeight: 'bold',
  76. }"
  77. :inactiveStyle="{
  78. color: '#969696',
  79. }"></u-tabs>
  80. </view>
  81. </view>
  82. <view class="data-list">
  83. <!-- 跟进记录 -->
  84. <follow-records v-if="curTabIndex == 0" ref="follow" :targetId="id" :targetType="id"></follow-records>
  85. </view>
  86. <!-- 新增按钮 -->
  87. <view class="fixed-btn-group" :style="{ width: openBtnWidth ? '180rpx' : '90rpx' }">
  88. <view class="flex1" v-if="openBtnWidth">
  89. <view class="btn center" @click="openFollow()">跟</view>
  90. </view>
  91. <view class="btn center" @click="openBtnWidth = !openBtnWidth">
  92. <u-icon name="plus" color="#fff" size="20"></u-icon>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. import partnerApi from '../../api/partner'
  100. import to from 'await-to-js'
  101. import followRecords from './components/followRecords'
  102. export default {
  103. name: 'omsIndex',
  104. components: { followRecords },
  105. data() {
  106. return {
  107. openBtnWidth: false,
  108. curTabIndex: -1,
  109. fllowList: [], //跟进数据
  110. list: [
  111. {
  112. name: '跟进记录',
  113. index: 0,
  114. },
  115. {
  116. name: '',
  117. index: 1,
  118. disabled: true,
  119. },
  120. ],
  121. height: '',
  122. paddingTop: '',
  123. details: {},
  124. id: 0, //id
  125. }
  126. },
  127. onLoad(option) {
  128. this.id = parseInt(option.id)
  129. },
  130. created() {
  131. const navData = uni.getMenuButtonBoundingClientRect()
  132. this.height = navData.height + 'px'
  133. this.paddingTop = navData.top + 'px'
  134. },
  135. onShow() {
  136. this.curTabIndex = 0
  137. this.openBtnWidth = false
  138. this.getDistrDetail()
  139. },
  140. onHide() {
  141. this.curTabIndex = -1
  142. },
  143. methods: {
  144. async getDistrDetail() {
  145. const [err, res] = await to(partnerApi.getCompanyConcat({ id: this.id }))
  146. if (err) return
  147. if (res && res.code == 200) {
  148. this.details = res.data
  149. }
  150. },
  151. // 改变tab
  152. changeTabs(data) {
  153. this.curTabIndex = data.index
  154. },
  155. // 打开转移
  156. openFollow() {
  157. // this.$store.commit('setDetails', this.projectData)
  158. uni.navigateTo({
  159. //保留当前页面,跳转到应用内的某个页面
  160. url: '/pages/publicPages/follow?targetType=70&id=' + this.details.id,
  161. })
  162. },
  163. goBack() {
  164. uni.navigateBack({
  165. //关闭当前页面,返回上一页面或多级页面。
  166. delta: 1,
  167. })
  168. },
  169. },
  170. }
  171. </script>
  172. <style>
  173. page {
  174. background: #f2f3f5;
  175. }
  176. </style>
  177. <style lang="scss" scoped>
  178. .home {
  179. padding-top: 200rpx;
  180. .nav {
  181. position: absolute;
  182. left: 0;
  183. top: 0;
  184. width: 100%;
  185. height: 356rpx;
  186. background: #3e7ef8;
  187. border-radius: 0 0 31rpx 31rpx;
  188. .title {
  189. position: relative;
  190. text-align: center;
  191. font-size: 32rpx;
  192. font-weight: bold;
  193. color: #ffffff;
  194. .back {
  195. position: absolute;
  196. top: 0;
  197. bottom: 0;
  198. margin: auto;
  199. left: 70rpx;
  200. display: flex;
  201. }
  202. }
  203. }
  204. .main {
  205. position: absolute;
  206. width: 100%;
  207. height: calc(100vh - 200rpx);
  208. overflow: hidden;
  209. padding-bottom: 64rpx;
  210. .main-top {
  211. padding: 0 32rpx;
  212. }
  213. .customer-box {
  214. width: 100%;
  215. background: #ffffff;
  216. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  217. border-radius: 32rpx;
  218. padding: 22rpx 38rpx 68rpx 40rpx;
  219. .header {
  220. .name {
  221. .img {
  222. width: 46rpx;
  223. height: 46rpx;
  224. border-radius: 50%;
  225. margin-right: 8rpx;
  226. }
  227. text {
  228. font-size: 28rpx;
  229. font-weight: bold;
  230. color: #323232;
  231. }
  232. }
  233. .date {
  234. font-size: 24rpx;
  235. color: #3e7ef8;
  236. }
  237. }
  238. .info {
  239. .info-item {
  240. margin-top: 18rpx;
  241. .info-label {
  242. width: 162rpx;
  243. text-align: left;
  244. font-size: 24rpx;
  245. color: #646464;
  246. }
  247. .info-txt {
  248. flex: 1;
  249. font-size: 24rpx;
  250. color: #323232;
  251. }
  252. }
  253. }
  254. }
  255. .data-list {
  256. margin-top: 16rpx;
  257. width: 100%;
  258. height: calc(100vh - 532rpx);
  259. background: #ffffff;
  260. padding: 32rpx;
  261. overflow: auto;
  262. padding-bottom: 145rpx;
  263. .status1 {
  264. color: #4096fb;
  265. background: rgba(64, 150, 251, 0.2);
  266. }
  267. .status2 {
  268. background: rgba(255, 184, 60, 0.2);
  269. color: #ffb83c;
  270. }
  271. .status3 {
  272. color: #fe6936;
  273. background: rgba(254, 105, 54, 0.2);
  274. }
  275. }
  276. }
  277. .fixed-btn-group {
  278. position: fixed;
  279. display: flex;
  280. justify-content: space-around;
  281. align-items: center;
  282. width: 90rpx;
  283. height: 90rpx;
  284. bottom: 50rpx;
  285. right: 50rpx;
  286. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  287. border-radius: 20px;
  288. transition: all 0.2s;
  289. background: #fff;
  290. .btn {
  291. width: 60rpx;
  292. height: 60rpx;
  293. background: #3e7ef8;
  294. border-radius: 50%;
  295. margin: 10rpx;
  296. font-size: 26rpx;
  297. font-weight: bold;
  298. color: #ffffff;
  299. }
  300. }
  301. }
  302. </style>