diff --git a/api/apiT.js b/api/apiT.js index 2245e2a..5f21ec4 100644 --- a/api/apiT.js +++ b/api/apiT.js @@ -1,7 +1,8 @@ const baseUrl = "http://219.157.255.213:9007/"; //这里放置url域名32044 // const baseUrl = "http://api.crm.hnxinyouhe.com/"; //这里放置url域名32044 - // const baseUrl = "http://192.168.50.4:8787/"; //这里放置url域名32044 + // const baseUrl = "http://192.168.50.9:8787/"; //这里放置url域名32044 + // const baseUrl = "http://219.157.255.213:25329/"; //这里放置url域名32044 // const baseUrl = "/api/"; //这里放置url域名32044 export function request(options){//封装的requset let { url,data,method } = options; diff --git a/common/locales/en.js b/common/locales/en.js index 9500db0..28ec83f 100644 --- a/common/locales/en.js +++ b/common/locales/en.js @@ -10,6 +10,7 @@ export default { addfollowup:'Add follow-up', userList:'Customer Management', persondata:'Personal Data', + businesscard:'Business card' }, home: { @@ -55,6 +56,8 @@ export default { Customerphinput:'Please select customer preferences', Cstomerfjinput:'Please select customer rating', Countryinput:'Please select a country', + Cstomertag:'Label', + Cstomertaginput:'Please select', Company:'Company', Companyinput:'Go locate it', CustomerScreening:'Customer Screening', @@ -66,7 +69,7 @@ export default { msg:'Message Notification', cpassword:'Change Password', contact:'Contact Service', - feedback:'Feedback', + feedback:'Work order', about:'About Us', logoff:'Log Off', logout:'Log Out', @@ -156,4 +159,30 @@ export default { details:'Details', auth:'Lark Authorize', inputnl:'Please select', + noresults:'No matching results', + keyword:"Please enter search keywords", + prompt:'Prompt', + restoremsg:'Confirm to restore the current customer data?', + onedayn:'Within 1 day', + threedayn:'Within 3 day', + sevendayn:'Within 7 day', + follow:'follow up', + timeout:'Timeout', + day:'day', + hour:'hour', + minute:'minute', + second:'second', + nextgjtime:'Next follow up time', + Remindergj:'Follow up reminder', + callPhonemsg:'Dial the wrong number!', + download:'Download', + addtag:'Add labels', + CustomerProfile:'Customer Profile', + CustomerProfilemag:'No portrait label!', + retract:'Retract', + expand:'Expand to view more', + remarks:'Remarks', + channel:'Channel', + Nodata:'No data available at the moment!', + versionmsg:'It is already the latest version!' } \ No newline at end of file diff --git a/common/locales/zh.js b/common/locales/zh.js index d4f7985..a9d1444 100644 --- a/common/locales/zh.js +++ b/common/locales/zh.js @@ -10,6 +10,7 @@ export default { addfollowup:'添加跟进', userList:'客户管理', persondata:'个人资料', + businesscard:'我的名片' }, home: { desc: '首页', @@ -52,6 +53,8 @@ export default { Customerphinput:'请选择客户偏好', Cstomerfj:'客户分级', Cstomerfjinput:'请选择客户分级', + Cstomertag:'客户标签', + Cstomertaginput:'请选择', Country:'国家', Countryinput:'请选择国家', Company:'公司', @@ -65,7 +68,7 @@ export default { msg:'消息通知', cpassword:'修改密码', contact:'联系客服', - feedback:'意见反馈', + feedback:'提交工单', about:'关于我们', logoff:'注销账户', logout:'退出登录', @@ -90,7 +93,7 @@ export default { recyclebin:'回收站', restore:'恢复客户', position:'职位', - positioninput:'请填写职位' + positioninput:'请填写职位', }, call:'呼叫', delete:'删除', @@ -155,4 +158,31 @@ export default { details:'详情', auth:'飞书授权', inputnl:'请选择', + noresults:'无匹配结果', + keyword:"请输入搜索关键词", + prompt:'提示', + restoremsg:'确认要恢复当前客户数据?', + onedayn:'1天内', + threedayn:'3天内', + sevendayn:'7天内', + follow:'跟进', + timeout:'已超时', + day:'天', + hour:'时', + minute:'分', + second:'秒', + nextgjtime:'下次跟进时间', + Remindergj:'跟进提醒', + callPhonemsg:'拨打号码错误!', + download:'下载', + addtag:'添加标签', + CustomerProfile:'客户画像', + CustomerProfilemag:'暂无画像标签!', + retract:'收起', + expand:'展开查看更多', + remarks:'备注', + channel:'渠道', + Nodata:'暂无数据!', + versionmsg:'已是最新版本!' + } \ No newline at end of file diff --git a/components/Countdown/Countdown.vue b/components/Countdown/Countdown.vue new file mode 100644 index 0000000..725ea0d --- /dev/null +++ b/components/Countdown/Countdown.vue @@ -0,0 +1,104 @@ + + + + \ No newline at end of file diff --git a/components/select/select.vue b/components/select/select.vue new file mode 100644 index 0000000..78e5bc5 --- /dev/null +++ b/components/select/select.vue @@ -0,0 +1,125 @@ + + + + + \ No newline at end of file diff --git a/index.html b/index.html index c1ee912..d2c9bfc 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,7 @@ + diff --git a/manifest.json b/manifest.json index ecf2519..9c3ac43 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "versionName" : "1.0.0", "versionCode" : "100", "transformPx" : false, - "locale" : "zh-Hans", // 设置默认语言, + "locale" : "en", // 设置默认语言, "app-plus" : { "usingComponents" : true, "nvueCompiler" : "uni-app", diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index c0dd899..d61baa0 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -266,6 +266,14 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -379,6 +387,14 @@ "node": ">=4.8" } }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -477,6 +493,18 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "node_modules/html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "dependencies": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -691,6 +719,14 @@ "node": ">=4" } }, + "node_modules/text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/underscore": { "version": "1.13.7", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", @@ -704,6 +740,14 @@ "node": ">= 4.0.0" } }, + "node_modules/utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "dependencies": { + "base64-arraybuffer": "^1.0.2" + } + }, "node_modules/vue": { "version": "3.5.13", "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.13.tgz", diff --git a/package-lock.json b/package-lock.json index 713ef37..1035530 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@googlemaps/js-api-loader": "^1.16.8", "cordova-plugin-googlemaps": "^2.7.1", + "html2canvas": "^1.4.1", "vue-i18n": "^9.1.9" } }, @@ -276,6 +277,14 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -389,6 +398,14 @@ "node": ">=4.8" } }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/csstype": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", @@ -487,6 +504,18 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, + "node_modules/html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "dependencies": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -701,6 +730,14 @@ "node": ">=4" } }, + "node_modules/text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/underscore": { "version": "1.13.7", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", @@ -714,6 +751,14 @@ "node": ">= 4.0.0" } }, + "node_modules/utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "dependencies": { + "base64-arraybuffer": "^1.0.2" + } + }, "node_modules/vue": { "version": "3.5.13", "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.13.tgz", diff --git a/package.json b/package.json index 76c2e0d..d9fbb2e 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,7 @@ "dependencies": { "@googlemaps/js-api-loader": "^1.16.8", "cordova-plugin-googlemaps": "^2.7.1", + "html2canvas": "^1.4.1", "vue-i18n": "^9.1.9" } } diff --git a/pages.json b/pages.json index e4ada26..6c91f48 100644 --- a/pages.json +++ b/pages.json @@ -61,7 +61,7 @@ } }, { - "path" : "pages/index/mine", + "path" : "pages/index/mine",//我的 "style" : { "navigationBarTitleText" : "", @@ -70,7 +70,7 @@ } }, { - "path" : "pages/index/customer", + "path" : "pages/index/customer",//客户管理 "style" : { "navigationBarTitleText" : "", @@ -93,7 +93,7 @@ "root": "pages/customer", "pages": [ { - "path": "add", + "path": "add",//添加客户 "style" : { "navigationBarTitleText" : "", @@ -102,7 +102,7 @@ } }, { - "path" : "detile", + "path" : "detile",//客户详情 "style" : { "navigationBarTitleText" : "", @@ -111,7 +111,7 @@ } }, { - "path" : "editdetile", + "path" : "editdetile", //编辑客户 "style" : { "navigationBarTitleText" : "", @@ -120,7 +120,7 @@ } }, { - "path" : "followup", + "path" : "followup",//添加跟进 "style" : { "navigationBarTitleText" : "", @@ -147,7 +147,7 @@ } }, { - "path" : "followsuccess", + "path" : "followsuccess",//设置下次提醒 "style" : { "navigationBarTitleText" : "", @@ -160,7 +160,7 @@ "root": "pages/mine", "pages": [ { - "path": "changinfo", + "path": "changinfo",//修改信息 "style" : { "navigationBarTitleText" : "", @@ -169,7 +169,7 @@ } }, { - "path" : "massege", + "path" : "massege",//消息通知 "style" : { "navigationBarTitleText" : "", @@ -178,7 +178,7 @@ } }, { - "path" : "feedback", + "path" : "feedback",//意见反馈 "style" : { "navigationBarTitleText" : "", @@ -187,7 +187,7 @@ } }, { - "path" : "about", + "path" : "about",//关于我们 "style" : { "navigationBarTitleText" : "", @@ -196,7 +196,7 @@ } }, { - "path" : "logoff", + "path" : "logoff",//注销账号 "style" : { "navigationBarTitleText" : "", @@ -205,7 +205,7 @@ } }, { - "path" : "resetPwd", + "path" : "resetPwd",//修改密码 "style" : { "navigationBarTitleText" : "", @@ -214,7 +214,7 @@ } }, { - "path" : "recyclebin", + "path" : "recyclebin",//回收站 "style" : { "navigationBarTitleText" : "", @@ -223,7 +223,7 @@ } }, { - "path" : "recyclebindetil", + "path" : "businesscard",//我的名片 "style" : { "navigationBarTitleText" : "", diff --git a/pages/customer/add.vue b/pages/customer/add.vue index 92a2da7..9c45401 100644 --- a/pages/customer/add.vue +++ b/pages/customer/add.vue @@ -117,21 +117,38 @@ - - - + + + + {{$t('cancel')}} + {{$t('confirm')}} - --> - + + + + + + + {{ item.name }} + + + {{$t('noresults')}} + + + + @@ -140,7 +157,13 @@ export default { data() { return { - mapUrl: '', + actives:'', + activetags:'', + searchKeyword: "", // 搜索关键词 + selectedLabel: "", // 选中的值(显示在输入框中) + filteredOptions: [], // 过滤后的数据 + mapUrl: '', + showtag: false, showmap: false, showmagnitude: false, showgrade: false, @@ -172,7 +195,9 @@ lat:'', lng:'', }, - location:{} + location:{}, + activeMap: {}, // 存储每个父级下选中的子项 { 父ID: 子ID } + taglist:[] } }, onLoad() { @@ -259,7 +284,8 @@ method:'get', }).then(res => { var list = res.data.data - this.areaList = [list] + this.areaList = list + this.filteredOptions = list; }) }, //商机 @@ -302,6 +328,31 @@ this.car_type_name = val.value[0].name this.showcartype = false }, + // 国家搜索处理函数 + handleSearch() { + if (this.searchKeyword) { + console.log(this.searchKeyword) + this.filteredOptions = this.areaList.filter((item) => + item.name.includes(this.searchKeyword) + ); + console.log(this.filteredOptions) + } else { + // 如果搜索框为空,显示全部数据 + this.filteredOptions = this.areaList; + } + }, + // 选择选项 + handleSelect(item) { + this.selectedLabel = item.name; // 回显选中的值 + this.actives = item.id + console.log("选中的值:", item.id); + console.log("选中的值:", item.name); + }, + arerfn(){ + this.showarea = false; // 关闭弹窗 + this.country_name = this.selectedLabel + this.form.country_id = this.actives + }, cancel(val){ this[val] = false }, @@ -436,4 +487,47 @@ height: 350px; } } + + + + + // + .actives{ + background-color: #dfdfdf; + } + .text{ + display: flex; + align-items: center; + justify-content: space-between; + line-height: 30px; + padding: 10px 15px 0px; + .qd{ + color: #3471FF; + } + } + .popup-content { + padding: 20px; + background-color: #fff; + } + + .option-list { + max-height: 400rpx; + margin-top: 20rpx; + } + + .option-item { + padding: 20rpx; + border-bottom: 1rpx solid #eee; + } + + .option-item:last-child { + border-bottom: none; + } + + .no-data { + text-align: center; + padding: 20rpx; + color: #999; + } + diff --git a/pages/customer/detile.vue b/pages/customer/detile.vue index d11601a..ce0568a 100644 --- a/pages/customer/detile.vue +++ b/pages/customer/detile.vue @@ -14,19 +14,43 @@ {{datas.phone}} - 渠道:{{datas.channel_name}} + {{$t('channel')}}:{{datas.channel_name}} {{datas.sex_txt}} | {{datas.country_name}}{{datas.car_type_name}} Email: {{datas.email}} WhatsAPP: {{datas.WhatsApp}} - 公司: {{datas.address}} - 备注: {{datas.describe}} + {{$t('customer.Company')}}: {{datas.address}} + {{$t('remarks')}}: {{datas.describe}} + {{$t('edtbtn')}} + + + {{$t('CustomerProfile')}} + + {{$t('addtag')}} + + + + + {{item.name}} + + + + {{ expanded ? $t('retract') : $t('expand') }} + + + + + + + {{$t('CustomerProfilemag')}} + + {{$t('customer.Cstomerfj')}} @@ -47,26 +71,36 @@ - + - + - + {{$t('times')}} :{{item.created_at}} {{$t('address')}}:{{item.address}} - {{$t('customer.Visitcontent')}}:{{item.audio_text}} + {{$t('customer.Visitcontent')}}:{{item.audio_text}} - + + - + {{$t('times')}}:{{item.created_at}} - + + @@ -75,23 +109,27 @@ - - - + + + + + {{ item.name }} + + + {{ item1.name }} + + - + + - --> + @@ -101,7 +139,9 @@ data() { return { id:'', + expanded:false, followList:[], + showtag: false, showmap: false, showmagnitude: false, showgrade: false, @@ -115,7 +155,9 @@ form: { grade:'', }, - datas:'' + datas:'', + activeMap: {}, // 存储每个父级下选中的子项 { 父ID: 子ID } + taglist:[] } }, @@ -125,6 +167,7 @@ var that = this this.getGrade() this.customerdetailfn() + this.tagGroup() }, onShow() { @@ -141,6 +184,13 @@ leftClick(){ uni.navigateBack({}) }, + isurls(url){ + var urls=[] + var obj={} + obj.src = url + urls.push(obj) + return urls + }, gomap(){ uni.navigateTo({ url: '/pages/customer/map' @@ -166,6 +216,10 @@ } }).then(res => { that.datas = res.data.data + + that.datas.tags.forEach((item,index) => { + that.$set(that.activeMap, item.group_id,item.id); + }) that.form = res.data.data that.select() }) @@ -238,11 +292,49 @@ close(val){ this[val] = false }, + closetag(val){ + this[val] = false + this.customerdetailfn() + }, editFn(){ uni.navigateTo({ url: '/pages/customer/editdetile?id='+this.id }); }, + //标签 + tagGroup(){ + request({ + url:'tagGroup/list', + method:'get', + }).then(res => { + this.taglist = res.data.data + }) + }, + //标签点击 + tagSelect(item) { + // 如果已选中则取消,否则设置选中 + this.$set(this.activeMap, item.group_id, this.activeMap[item.group_id] === item.id ? '' : item.id); + console.log(this.activeMap) + request({ + url:'tagGroup/updatePivot', + method:'post', + data:{ + customer_id: this.id, + group_id:item.group_id, + tag_id:this.activeMap[item.group_id] + } + }).then(res => { + if(res.data.code!=0){ + uni.showToast({ + title: res.data.message, + icon: 'none' + }); + } + }) + }, + isActive(parentId, childId) { + return this.activeMap[parentId] === childId; + }, nextFn(){ request({ url:'customer/save', @@ -267,6 +359,16 @@ diff --git a/pages/customer/editdetile.vue b/pages/customer/editdetile.vue index 907e82b..9f46395 100644 --- a/pages/customer/editdetile.vue +++ b/pages/customer/editdetile.vue @@ -67,14 +67,6 @@ - {{$t('customer.Country')}} @@ -109,20 +101,37 @@ - - - + + + {{$t('cancel')}} + {{$t('confirm')}} - --> + + + + + + + + {{ item.name }} + + + {{$t('noresults')}} + + + + @@ -133,6 +142,10 @@ return { id:'', followList:[], + actives:'', + searchKeyword: "", // 搜索关键词 + selectedLabel: "", // 选中的值(显示在输入框中) + filteredOptions: [], // 过滤后的数据 showmap: false, showmagnitude: false, showgrade: false, @@ -184,7 +197,6 @@ var that = this this.getChannel() this.getMagnitude() - // this.getGrade() this.carType() this.area() this.customerdetailfn() @@ -207,7 +219,7 @@ gomap(){ // #ifdef H5 uni.navigateTo({ - url: '/pages/customer/maph5' + url: '/pages/customer/maph5?lat='+this.form.lat+'&lng='+this.form.lng }); // #endif // #ifdef APP-PLUS @@ -224,12 +236,6 @@ that.defaultIndexqd=[index] } }) - // that.getGradeList1.forEach((item,index) => { - // if(item.id == that.form.grade){ - // that.grade_name = item.name - // that.defaultIndexfj=[index] - // } - // }) that.carTypeList1.forEach((item,index) => { if(item.id == that.form.car_type_id){ that.car_type_name = item.name @@ -242,13 +248,6 @@ that.defaultIndexsj=[index] } }) - that.areaList1.forEach((item,index) => { - if(item.id == that.form.country_id){ - that.country_name = item.name - that.defaultIndexgj=[index] - console.log(that.country_name) - } - }) }, //客户详情 customerdetailfn(){ @@ -262,6 +261,8 @@ }).then(res => { that.datas = res.data.data that.form = res.data.data + this.actives = res.data.data.country_id + this.country_name = res.data.data.country_name that.select() }) }, @@ -332,7 +333,8 @@ var list = res.data.data this.areaList1 = list this.areaList = [list] - this.select() + this.filteredOptions = list; + // this.select() }) }, //商机 @@ -364,18 +366,46 @@ this.grade_name = val.value[0].name this.showgrade = false }, - //国家切换事件 - areaChange(val){ - this.form.country_id = val.value[0].id - this.country_name = val.value[0].name - this.showarea = false - }, + // //国家切换事件 + // areaChange(val){ + // this.form.country_id = val.value[0].id + // this.country_name = val.value[0].name + // this.showarea = false + // }, //偏好切换事件 cartypesChange(val){ this.form.car_type_id = val.value[0].id this.car_type_name = val.value[0].name this.showcartype = false }, + // 搜索处理函数 + handleSearch() { + if (this.searchKeyword) { + console.log(this.searchKeyword) + this.filteredOptions = this.areaList1.filter((item) => + item.name.includes(this.searchKeyword) + ); + console.log(this.filteredOptions) + } else { + // 如果搜索框为空,显示全部数据 + this.filteredOptions = this.areaList1; + } + }, + // 选择选项 + handleSelect(item) { + this.selectedLabel = item.name; // 回显选中的值 + // this.searchKeyword = item.name + this.actives = item.id + // this.showPicker = false; // 关闭弹窗 + console.log("选中的值:", item.id); + console.log("选中的值:", item.name); + }, + arerfn(){ + this.showarea = false; // 关闭弹窗 + this.country_name = this.selectedLabel + this.form.country_id = this.actives + + }, cancel(val){ this[val] = false }, @@ -481,4 +511,49 @@ margin-bottom: 40px; margin: 15px 4%; } + + + + + .actives{ + background-color: #dfdfdf; + } + .text{ + display: flex; + align-items: center; + justify-content: space-between; + line-height: 30px; + padding: 10px 15px 0px; + .qd{ + color: #3471FF; + } + } + .popup-content { + padding: 20px; + background-color: #fff; + } + + .option-list { + max-height: 400rpx; + margin-top: 20rpx; + } + + .option-item { + padding: 20rpx; + border-bottom: 1rpx solid #eee; + } + + .option-item:last-child { + border-bottom: none; + } + + .no-data { + text-align: center; + padding: 20rpx; + color: #999; + } + + + + diff --git a/pages/customer/followup.vue b/pages/customer/followup.vue index f6bb6b3..2c7877a 100644 --- a/pages/customer/followup.vue +++ b/pages/customer/followup.vue @@ -13,14 +13,14 @@ {{userdatas.phone}} - 渠道:{{userdatas.channel_name}} + {{$t('channel')}}:{{userdatas.channel_name}} {{userdatas.sex_txt}} | {{userdatas.country_name}}{{userdatas.car_type_name}} Email: {{userdatas.email}} WhatsAPP: {{userdatas.WhatsApp}} - 公司: {{userdatas.address}} - 备注: {{userdatas.describe}} + {{$t('customer.Company')}}: {{userdatas.address}} + {{$t('remarks')}}: {{userdatas.describe}} @@ -97,26 +97,36 @@ {{$t('customer.followrecord')}} {{datas.follow_txt}} - + - + - + {{$t('times')}} :{{item.created_at}} {{$t('address')}}:{{item.address}} - {{$t('customer.Visitcontent')}}:{{item.audio_text}} + {{$t('customer.Visitcontent')}}:{{item.audio_text}} - + + - + {{$t('times')}}:{{item.created_at}} - + + @@ -187,11 +197,12 @@ }, onLoad(options) { console.log(options); + this.getlocahost() this.id = options.id; this.form.customer_id = options.id; var that = this this.getGrade() - this.getlocahost() + this.customerdetailfn() this.followlistfn() }, @@ -199,6 +210,13 @@ leftClick(){ uni.navigateBack({}) }, + isurls(url){ + var urls=[] + var obj={} + obj.src = url + urls.push(obj) + return urls + }, close(val){ this[val]=false }, @@ -281,33 +299,7 @@ }, }); }, - getlocahost(){ - // 检查定位权限 - uni.getSetting({ - success: (res) => { - if (!res.authSetting['scope.userLocation']) { - // 未授权,请求权限 - uni.authorize({ - scope: 'scope.userLocation', - success: () => { - this.getlocahost(); - }, - fail: () => { - uni.showToast({ - title: '定位权限未授权', - icon: 'none', - }); - }, - }); - } else { - // 已授权,直接获取定位 - this.getlocahost(); - } - }, - }); - }, - getlocahost(){ - + unigetLocation(){ var that = this uni.getLocation({ type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02 @@ -325,18 +317,53 @@ console.log('获取位置完成'); } }); - - // uni.chooseLocation({ - // success: function (res) { - // console.log('位置名称:' + res.name); - // console.log('详细地址:' + res.address); - // console.log('经度:' + res.longitude); - // console.log('纬度:' + res.latitude); - // }, - // fail: function (err) { - // console.log('选择位置失败:', err); - // } - // }); + }, + getlocahost() { + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition( + (position) => { + console.log('当前位置的经度:' + position.coords.longitude); + console.log('当前位置的纬度:' + position.coords.latitude); + this.getarrd(position.coords.longitude,position.coords.latitude) + this.error = ''; + console.log("获取位置成功:", position); + }, + (error) => { + this.unigetLocation() + // this.error = this.getErrorMessage(error); + // uni.showToast({ + // title: this.error, + // icon: 'none' + // }); + console.error("获取位置失败:", error); + }, + { + enableHighAccuracy: true, + timeout: 10000, + maximumAge: 0 + } + ); + } else { + this.unigetLocation() + // this.error = "浏览器不支持 Geolocation API"; + // uni.showToast({ + // title: this.error, + // icon: 'none' + // }); + console.error("浏览器不支持 Geolocation API"); + } + }, + getErrorMessage(error) { + switch (error.code) { + case error.PERMISSION_DENIED: + return "用户拒绝了地理位置权限"; + case error.POSITION_UNAVAILABLE: + return "无法获取当前位置"; + case error.TIMEOUT: + return "获取位置超时"; + default: + return "未知错误"; + } }, // 跟进记录 followlistfn(){ @@ -438,14 +465,14 @@ header:{'Authorization': 'Bearer ' + uni.getStorageSync('token')}, success: (uploadFileRes) => { const path=JSON.parse(uploadFileRes.data) - if(path.code==-1){ + if(path.code==0){ + that.form[name] = path.data.path + console.log(that.form) + }else{ uni.showToast({ title: path.message, icon: 'none' }); - }else{ - that.form[name] = path.data.path - console.log(that.form) } } }); @@ -733,6 +760,14 @@ justify-content: space-between; align-items: center; color: #999999; + .lingh{ + line-height: 40px; + } + .flex{ + display: flex; + justify-content: space-between; + align-items: center; + } } .title{ color: #666666; diff --git a/pages/customer/maph5.vue b/pages/customer/maph5.vue index 147c1a6..3dd6d29 100644 --- a/pages/customer/maph5.vue +++ b/pages/customer/maph5.vue @@ -31,6 +31,7 @@ export default { value: '', // 模糊匹配数据 list: [], + center: { lat:'', lng:''}, cityInfo:{ lat: '', lng: '', @@ -44,7 +45,12 @@ export default { } } }, - onLoad() { + onLoad(e) { + if(e.lat&&e.lat!=''&&e.lat!=0){ + this.center.lat = e.lat + this.center.lng = e.lng + } + console.log(e) this.initMap() }, methods:{ @@ -92,63 +98,123 @@ export default { }); that.list =[] }, + getErrorMessage(error) { + switch (error.code) { + case error.PERMISSION_DENIED: + return "用户拒绝了地理位置权限"; + case error.POSITION_UNAVAILABLE: + return "无法获取当前位置"; + case error.TIMEOUT: + return "获取位置超时"; + default: + return "未知错误"; + } + }, + addmapmarkfn(lat,lng){ + var that = this + that.map = new google.maps.Map(document.getElementById("map"), + { + center: { lat:lat, lng: lng}, + zoom: 12,// 地图缩放参数 + maxZoom: 18,// 最大缩放参数 + minZoom: 4,// 最小缩放参数 + disableDefaultUI: true// 禁用默认UI + } + ) + var marker = new google.maps.Marker({ + position: { lat:lat, lng: lng}, + map: that.map, + draggable: true, // 允许拖动标记 + icon: { + url: 'https://now.guua.com/attachs/default/location_shop.png', + scaledSize: new google.maps.Size(30, 30), + origin: new google.maps.Point(0, 0), + anchor: new google.maps.Point(0, 0) + } + }); + // 监听标记拖动事件 + marker.addListener('dragend', () => { + const position = marker.getPosition(); + that.map.setCenter(position); + // 根据标记位置获取地址信息 + const geocoder = new google.maps.Geocoder(); + geocoder.geocode({ location: position }, (results, status) => { + if (status === 'OK' && results[0]) { + console.log(results) + console.log(position) + that.cityInfo.address = results[0].formatted_address; + that.cityInfo.lat = position.lat(); + that.cityInfo.lng = position.lng(); + that.value = results[0].formatted_address; + console.log(that.cityInfo) + } else { + alert('无法获取地址信息'); + } + }); + }); + }, + unigetLocation(){ + var that = this + uni.getLocation({ + type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02 + success: function (res) { + console.log('当前位置的经度:' + res.longitude); + console.log('当前位置的纬度:' + res.latitude); + that.addmapmarkfn(res.latitude,res.longitude) + // 如果需要将经纬度转换为具体地址,可以使用逆地理编码 + // 这里调用 uni.chooseLocation 或第三方地图服务(如高德、腾讯地图) + }, + fail: function (err) { + console.log('获取位置失败:', err); + }, + complete: function () { + console.log('获取位置完成'); + } + }); + }, initMap() { var that = this loader .load() .then((google) => { - uni.getLocation({ - type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02 - success: function (res) { - console.log(res) - that.map = new google.maps.Map(document.getElementById("map"), - { - center: { lat:res.latitude, lng: res.longitude}, - zoom: 12,// 地图缩放参数 - maxZoom: 18,// 最大缩放参数 - minZoom: 4,// 最小缩放参数 - disableDefaultUI: true// 禁用默认UI - } - ) - var marker = new google.maps.Marker({ - position: { lat:res.latitude, lng: res.longitude}, - map: that.map, - draggable: true, // 允许拖动标记 - icon: { - url: 'https://now.guua.com/attachs/default/location_shop.png', - scaledSize: new google.maps.Size(30, 30), - origin: new google.maps.Point(0, 0), - anchor: new google.maps.Point(0, 0) + if(this.center.lat!=''){ + that.addmapmarkfn(parseFloat(this.center.lat),parseFloat(this.center.lng)) + }else{ + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition( + (position) => { + console.log('当前位置的经度:' + position.coords.longitude); + console.log('当前位置的纬度:' + position.coords.latitude); + that.addmapmarkfn(position.coords.latitude,position.coords.longitude) + this.error = ''; + console.log("获取位置成功:", position); + }, + (error) => { + that.unigetLocation() + // this.error = this.getErrorMessage(error); + // uni.showToast({ + // title: this.error, + // icon: 'none' + // }); + console.error("获取位置失败:", error); + }, + { + enableHighAccuracy: true, + timeout: 10000, + maximumAge: 0 } - }); - // 监听标记拖动事件 - marker.addListener('dragend', () => { - const position = marker.getPosition(); - that.map.setCenter(position); - // 根据标记位置获取地址信息 - const geocoder = new google.maps.Geocoder(); - geocoder.geocode({ location: position }, (results, status) => { - if (status === 'OK' && results[0]) { - console.log(results) - console.log(position) - that.cityInfo.address = results[0].formatted_address; - that.cityInfo.lat = position.lat(); - that.cityInfo.lng = position.lng(); - that.value = results[0].formatted_address; - console.log(that.cityInfo) - } else { - alert('无法获取地址信息'); - } - }); - }); - }, - fail: function (err) { - console.log('获取位置失败:', err); - }, - complete: function () { - console.log('获取位置完成'); - } - }) + ); + } else { + that.unigetLocation() + // this.error = "浏览器不支持 Geolocation API"; + // uni.showToast({ + // title: this.error, + // icon: 'none' + // }); + console.error("浏览器不支持 Geolocation API"); + } + } + }) .catch((e) => { diff --git a/pages/index/customer.vue b/pages/index/customer.vue index 8220466..a167df2 100644 --- a/pages/index/customer.vue +++ b/pages/index/customer.vue @@ -1,6 +1,6 @@ - - diff --git a/static/image/customer/tagadd.png b/static/image/customer/tagadd.png new file mode 100644 index 0000000..1c4a0f5 Binary files /dev/null and b/static/image/customer/tagadd.png differ diff --git a/static/image/gtime.png b/static/image/gtime.png new file mode 100644 index 0000000..ea7e967 Binary files /dev/null and b/static/image/gtime.png differ diff --git a/static/image/mine/addr.png b/static/image/mine/addr.png new file mode 100644 index 0000000..a94dd46 Binary files /dev/null and b/static/image/mine/addr.png differ diff --git a/static/image/mine/cardbg.png b/static/image/mine/cardbg.png new file mode 100644 index 0000000..deaf031 Binary files /dev/null and b/static/image/mine/cardbg.png differ diff --git a/static/image/mine/email.png b/static/image/mine/email.png new file mode 100644 index 0000000..0c060b2 Binary files /dev/null and b/static/image/mine/email.png differ diff --git a/static/image/mine/ewm.png b/static/image/mine/ewm.png new file mode 100644 index 0000000..df52c84 Binary files /dev/null and b/static/image/mine/ewm.png differ diff --git a/static/image/mine/icon9.png b/static/image/mine/icon9.png new file mode 100644 index 0000000..2edb7b1 Binary files /dev/null and b/static/image/mine/icon9.png differ diff --git a/static/image/mine/phone.png b/static/image/mine/phone.png new file mode 100644 index 0000000..0dad3c1 Binary files /dev/null and b/static/image/mine/phone.png differ diff --git a/static/image/redtime.png b/static/image/redtime.png new file mode 100644 index 0000000..9c267bc Binary files /dev/null and b/static/image/redtime.png differ diff --git a/static/image/topbg.png b/static/image/topbg.png index aaec6d1..bbac171 100644 Binary files a/static/image/topbg.png and b/static/image/topbg.png differ