CustomerDetail.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <template>
  2. <view>
  3. <view class="detail-top">
  4. <u-navbar
  5. title="客户详情"
  6. :background="{ background: `rgba(255,255,255,${scroll_top/100})` }"
  7. back-icon-color="#2D405E"
  8. :title-bold="true"
  9. title-color="#2D405E"
  10. title-size="32"
  11. :border-bottom="false"
  12. ></u-navbar>
  13. <view class="top-view">
  14. <view class="clearfix customer-main">
  15. <view class="float_left main-left">
  16. <view class="cu-top">
  17. <text class="cu-name">{{ customer_detail.name }}</text>
  18. <text class="custom-icon custom-icon-ziyuan"></text>
  19. <text class="cu-mobile">{{ customer_detail.mobile }}</text>
  20. </view>
  21. <view class="type-view">
  22. <view class="type-li primary-type" v-if="customer_detail.customerType">{{ customer_detail.customerType }}</view>
  23. <view class="type-li primary-type" v-if="customer_detail.status === 2">已审核</view>
  24. <view class="type-li warning-type" v-if="customer_detail.status === 1">未审核</view>
  25. <view class="type-li warning-type" v-if="customer_detail.status === 0">待完善</view>
  26. <view class="type-li success-type" v-if="customer_detail.enableStatus === 5">启用</view>
  27. <view class="type-li danger-type" v-if="customer_detail.enableStatus === 4">禁用</view>
  28. </view>
  29. </view>
  30. <view class="float_right avatar"><image :src="customer_detail.avatar || '../../static/img/user-re.png'" mode="aspectFill"></image></view>
  31. </view>
  32. <view class="other-info">
  33. <view class="other-li">
  34. <text class="custom-icon custom-icon-form_light"></text>
  35. <text class="value">
  36. 编号:{{ customer_detail.code }}
  37. </text>
  38. </view>
  39. <view class="other-li">
  40. <text class="custom-icon custom-icon-lishi"></text>
  41. <text class="value">
  42. 注册时间:
  43. </text>
  44. <text class="value time">
  45. {{ $u.timeFormat(customer_detail.createTime) }}
  46. </text>
  47. </view>
  48. </view>
  49. <view class="bottom-info clearfix">
  50. 所属商铺:{{customer_detail.shopName|| '未设置'}}
  51. </view>
  52. <view class="bottom-info clearfix" style="margin-top: 8rpx;">
  53. <view class="float_left">类型:{{customer_detail.customerType|| '未设置'}}</view>
  54. <view class="float_right">业务员:{{customer_detail.salesManName|| '未设置'}}</view>
  55. </view>
  56. </view>
  57. </view>
  58. <u-sticky offset-top="140">
  59. <view class="tabs-view">
  60. <u-tabs-swiper
  61. ref="tabs"
  62. :is-scroll="false"
  63. font-size="26"
  64. :current="tabs_current"
  65. :list="tags_list"
  66. height="94"
  67. @change="changeTab"
  68. bg-color="transparent"
  69. inactive-color="rgba(255, 255, 255, 0.6)"
  70. :bar-style="{ borderRadius: '6rpx', height: '6rpx', width: '32rpx', backgroundColor: '#ffffff' }"
  71. :active-item-style="{ color: '#ffffff', fontSize: '32rpx' }"
  72. ></u-tabs-swiper>
  73. </view>
  74. </u-sticky>
  75. <!-- :style="{paddingTop:scroll_top>150?'150rpx':'0'}" -->
  76. <view class="handel-view">
  77. <view v-if="customer_id">
  78. <block v-if="tabs_current === 0">
  79. <!-- 浏览记录 -->
  80. <Visitslogs :customerId="customer_id"></Visitslogs>
  81. </block>
  82. <block v-if="tabs_current === 1">
  83. <!-- 购买记录 -->
  84. <BuyLogs :userCenterId="customer_detail.userCenterId"></BuyLogs>
  85. </block>
  86. <block v-if="tabs_current === 2">
  87. <!-- 跟进记录 -->
  88. <CommunicationLogs :customerId="customer_id"></CommunicationLogs>
  89. </block>
  90. <block v-if="tabs_current === 3">
  91. <!-- 账款明细 -->
  92. <moneyDetail :customerId="customer_id"></moneyDetail>
  93. </block>
  94. <block v-if="tabs_current === 4">
  95. <!-- 订单列表 -->
  96. <CustomerOrder :userCenterId="customer_detail.userCenterId"></CustomerOrder>
  97. </block>
  98. </view>
  99. </view>
  100. <view class="submit-btn">
  101. <viwe class="float_left" style="color: #B8C0C8;text-align: center;margin-left: 40rpx;">
  102. <view @click="goPage('/pagesT/customer/AddCustomer?id=' + customer_detail.id)">
  103. <u-icon
  104. label-pos="bottom"
  105. margin-top="10rpx"
  106. name="file-text"
  107. color="#B8C0C8"
  108. label="完善资料"
  109. label-color="#62738E"
  110. label-size="20"
  111. size="40"
  112. ></u-icon>
  113. </view>
  114. </viwe>
  115. <view class="btn-min" @click="callPhone(customer_detail.mobile)">联系客户</view>
  116. <view class="btn-min-valet-order" @click="orderAdd()" v-if="customer_detail.status === 2 && customer_detail.enableStatus === 5">代客下单</view>
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. import Visitslogs from './components/Visitslogs.vue';
  122. import BuyLogs from './components/BuyLogs.vue';
  123. import CommunicationLogs from './components/CommunicationLogs.vue';
  124. import CustomerOrder from './components/CustomerOrder.vue';
  125. import moneyDetail from './components/moneyDetail.vue';
  126. export default {
  127. components: {
  128. Visitslogs,
  129. BuyLogs,
  130. CommunicationLogs,
  131. moneyDetail,
  132. CustomerOrder
  133. },
  134. data() {
  135. return {
  136. tabs_current: 0,
  137. tags_list: [
  138. {
  139. name: '浏览记录'
  140. },
  141. {
  142. name: '购买记录'
  143. },
  144. {
  145. name: '跟进记录'
  146. },
  147. {
  148. name: '账款明细'
  149. },
  150. {
  151. name: '订单列表'
  152. }
  153. ],
  154. customer_id: 0,
  155. customer_detail: {},
  156. visit_logs: [],
  157. scroll_top: 0,
  158. actived: ''
  159. };
  160. },
  161. onPageScroll(e) {
  162. this.scroll_top = e.scrollTop;
  163. },
  164. async onLoad(options) {
  165. if (options.id) {
  166. this.customer_id = options.id;
  167. }
  168. },
  169. async onShow(options) {
  170. await this.getCustomerInfo();
  171. },
  172. methods: {
  173. orderAdd(item) {
  174. const obj = {
  175. shopId: this.customer_detail.shopId,
  176. userCenterId: this.customer_detail.userCenterId,
  177. customerId: this.customer_detail.id,
  178. customerName: this.customer_detail.name
  179. };
  180. this.goPage('/pages/order/OrderAdd?customer=' + JSON.stringify(obj));
  181. },
  182. // 切换tabs
  183. changeTab(index) {
  184. this.tabs_current = index;
  185. },
  186. // 客户详情
  187. async getCustomerInfo() {
  188. await this.$u.api.getCustomerInfo(this.customer_id).then(({ data }) => {
  189. this.customer_detail = data;
  190. });
  191. }
  192. }
  193. };
  194. </script>
  195. <style lang="scss" scoped>
  196. .detail-top {
  197. // background: rgba($color: #ffffff, $alpha: 0.9);
  198. background: linear-gradient(270deg,#f8f8fd, #e7f7ff, #f8f8fd);
  199. padding-bottom: 100rpx;
  200. .top-view {
  201. padding: 24rpx 40rpx 40rpx;
  202. .customer-main {
  203. .avatar {
  204. image {
  205. background-color: #FFFFFF;
  206. display: block;
  207. width: 88rpx;
  208. height: 88rpx;
  209. border-radius: 8rpx;
  210. border: 2rpx solid #ffffff;
  211. }
  212. }
  213. .main-left{
  214. width: 560rpx;
  215. .cu-top {
  216. margin-bottom: 10rpx;
  217. line-height: 45rpx;
  218. .cu-name{
  219. font-family: DIN-Medium;
  220. display: inline-block;
  221. max-width: 360rpx;
  222. color: #2D405E;
  223. font-size: 32rpx;
  224. font-weight: 600;
  225. margin-right: 24rpx;
  226. vertical-align: middle;
  227. }
  228. .custom-icon-ziyuan{
  229. font-size: 28rpx;
  230. color: #000000;
  231. margin-right: 4rpx;
  232. }
  233. .cu-mobile{
  234. font-weight: 300;
  235. font-family: DINPro-Regular;
  236. }
  237. }
  238. .type-view {
  239. display: flex;
  240. .type-li {
  241. width: 104rpx;
  242. height: 36rpx;
  243. border-radius: 4rpx;
  244. font-size: 20rpx;
  245. margin-right: 8rpx;
  246. text-align: center;
  247. line-height: 36rpx;
  248. &.primary-type {
  249. background: rgba(64, 118, 214, 0.12);
  250. color: #4076d6;
  251. }
  252. &.warning-type {
  253. background: #fdf6e8;
  254. color: #fa6400;
  255. }
  256. &.success-type {
  257. background: rgba(0, 195, 149, 0.12);
  258. color: #00c395;
  259. }
  260. &.danger-type {
  261. background: rgba(246, 119, 120, 0.12);
  262. color: #f67778;
  263. }
  264. }
  265. }
  266. }
  267. }
  268. .other-info{
  269. padding-top: 22rpx;
  270. font-weight: 400;
  271. font-size: 24rpx;
  272. color: #B8C0C8;
  273. line-height: 40rpx;
  274. .custom-icon{
  275. font-size: 24rpx;
  276. margin-right: 8rpx;
  277. }
  278. .time{
  279. color: #2D405E;
  280. font-family: DINPro-Regular;
  281. }
  282. }
  283. .bottom-info{
  284. margin-top: 24rpx;
  285. .float_right{
  286. color: #B8C0C8;
  287. }
  288. }
  289. }
  290. }
  291. .tabs-view {
  292. width: 100%;
  293. border-top-left-radius: 20rpx;
  294. border-top-right-radius: 20rpx;
  295. background-color: #4076d6;
  296. transform: translateY(-100rpx);
  297. }
  298. .handel-view {
  299. width: 100%;
  300. margin: 0 auto;
  301. background-color: #ffffff;
  302. transform: translateY(-100rpx);
  303. }
  304. .submit-btn {
  305. width: 100%;
  306. height: 98rpx;
  307. font-size: 28rpx;
  308. color: #fff;
  309. font-family: PingFangSC-Medium, PingFang SC;
  310. .btn-min {
  311. float: right;
  312. width: 240rpx;
  313. height: 64rpx;
  314. line-height: 64rpx;
  315. background: #4076d6;
  316. border-radius: 32rpx;
  317. margin-left: 40rpx;
  318. }
  319. .btn-min-valet-order {
  320. float: right;
  321. width: 240rpx;
  322. height: 64rpx;
  323. line-height: 64rpx;
  324. text-align: center;
  325. background: #fff;
  326. border-radius: 32rpx;
  327. border: 1px solid #979797;
  328. color: #2d405e;
  329. margin-left: 70rpx;
  330. }
  331. }
  332. </style>