123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <template>
- <view class="content">
- <view class="top-box" v-if="item!=null">
- <view class="customer-box">
- <view class="left">
- <view class="name">{{item.customerName}}</view>
- <view class="desc-box">
- <view class="label">创建时间:</view>
- <view class="value"> {{item.createTime}}</view>
- </view>
- <view class="desc-box">
- <view class="label">地址:</view>
- <view class="value">{{item.address}} </view>
- </view>
- </view>
- <view class="btns">
- <image class="btn" src="../../../static/images/sms.png"></image>
- <image class="btn" src="../../../static/images/phone.png"></image>
- </view>
- </view>
- <view class="tabs">
- <u-tabs
- :scrollable="true"
- :list="tabs"
- lineColor="#115296"
- @change="tagChange">
- </u-tabs>
- </view>
- <view class="cont-box">
- <customer-info ref="customerInfo" v-if="tabId==1"></customer-info>
- </view>
- </view>
- <u-modal :show="show" ref="uModal" :asyncClose="true" :showCancelButton="true" title="提示" @cancel="close" @confirm="confirm" :content='content'></u-modal>
- </view>
- </template>
- <script>
- import customerInfo from './components/customerInfo.vue'
- import {getCustomerDetails,editCrmCustomer} from '@/api/crm.js'
- export default {
- components:{
- customerInfo, // 基本信息
- },
- data() {
- return {
- wxNickName:null,
- show:false,
- content:"",
- customerId:null,
- tabId:1,
- item:null,
- tabs:[
- {
- id:1,
- name:'用户资料'
- },
- {
- id:2,
- name:'联系人'
- },
- {
- id:3,
- name:'跟进记录'
- },
- {
- id:4,
- name:'通话记录'
- },
- {
- id:5,
- name:'短信记录'
- }
- ],
- }
- },
- onLoad(option) {
- var that=this;
- uni.$on('getWeixinId', (item) => {
- console.log(item)
-
- that.content="用户昵称:"+item.data+",是否更新";
- that.wxNickName=item.data;
- that.show=true;
- })
- this.customerId=option.customerId
- console.log(this.customerId)
- this.getCustomerDetails()
- },
- onShow() {
-
- },
- methods: {
- close(){
- this.show=false;
- },
- confirm(){
- this.show=false;
- var data = {
- customerId:this.customerId,
- weixin:this.wxNickName
-
- };
- //更新用户昵称
- var that=this;
- editCrmCustomer(data).then(res => {
- if(res.code==200){
- uni.showToast({
- icon:'none',
- title: "操作成功",
- });
- if(this.tabId==1){
- setTimeout(function(){
- that.$refs.customerInfo.getCustomerDetails(that.customerId)
- },200);
- }
- }else{
- uni.showToast({
- icon:'none',
- title: res.msg,
- });
- }
- });
-
- },
- tagChange(item){
- this.tabId=item.id
- var that = this;
- if(this.tabId==1){
- setTimeout(function(){
- that.$refs.customerInfo.getCustomerDetails(that.customerId)
- },200);
- }
- },
- getCustomerDetails() {
- //联网加载数据
- var that = this;
- var data = {
- customerId:this.customerId
- };
- getCustomerDetails(data).then(res => {
- if(res.code==200){
- this.item=res.customer;
- setTimeout(function(){
- that.$refs.customerInfo.getCustomerDetails(that.customerId)
- },200);
-
-
- }else{
- uni.showToast({
- icon:'none',
- title: res.msg,
- });
- setTimeout(function(){
- uni.navigateBack()
- },2000);
-
- }
- });
- },
- }
- }
- </script>
- <style lang="scss">
- page{
-
- height: 100%;
- background: #f6f6f6;
- }
- </style>
- <style scoped lang="scss">
- .content{
- height: 100%;
- padding: 20rpx;
- .top-box{
- padding: 15rpx;
- background-color: #fff;
- margin-bottom: 15rpx;
- border-radius: 15rpx;
- width: 100%;
- .customer-box{
-
- width: 100%;
- display: flex;
- align-items: flex-start;
- justify-content: flex-start;
- .left{
- flex: 1;
- font-size: 38rpx;
- color:#111;
- .name{
- flex: 1;
- font-size: 42rpx;
- color:#111;
- }
- .desc-box{
- margin-top: 15rpx;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-start;
- .label{
- font-size: 28rpx;
- color: #a8a8a8;
- }
- .value{
- font-size: 28rpx;
- color: #a8a8a8;
- }
-
-
- }
- }
- .btns{
- .btn{
- margin-left: 10rpx;
- width: 45rpx;
- height:45rpx;
- }
- }
- }
- }
-
- }
-
- </style>
|