Compare commits
21 Commits
6cb3944a86
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f8245ab2c | ||
|
|
afdb3cb724 | ||
|
|
612de69d7b | ||
|
|
d244f20aac | ||
|
|
c205422420 | ||
|
|
426ac9171d | ||
|
|
45b0117f5f | ||
|
|
95a1187b8a | ||
|
|
a6a98eb2b6 | ||
|
|
d37b721c28 | ||
|
|
ca7572c542 | ||
|
|
c10a0be121 | ||
|
|
036f2a61bf | ||
|
|
487a367c5a | ||
|
|
1f4fc0b0cc | ||
|
|
ed26947cce | ||
|
|
8e049c4a0c | ||
|
|
e94ce94c42 | ||
|
|
2bda2bb389 | ||
|
|
20dc7d5f75 | ||
|
|
850ed466cf |
@@ -1,6 +1,12 @@
|
|||||||
|
|
||||||
#调用后台地址
|
#调用后台地址
|
||||||
# VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
|
# 公司
|
||||||
VITE_APP_BASE_URL = 'https://app-test.718yousheng.com'
|
VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
|
||||||
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
|
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
|
||||||
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
|
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
|
||||||
|
|
||||||
|
# 友晟外网
|
||||||
|
# VITE_APP_BASE_URL = 'https://app-test.718yousheng.com/app'
|
||||||
|
# 友晟内网
|
||||||
|
# VITE_APP_BASE_URL = 'https://appi-test.718yousheng.com/app'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
|
|
||||||
#调用后台地址
|
#调用后台地址
|
||||||
VITE_APP_BASE_URL = 'https://app-test.718yousheng.com'
|
# 公司
|
||||||
# VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
|
# VITE_APP_BASE_URL = 'http://118.186.13.120:31302'
|
||||||
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
|
# VITE_APP_BASE_URL = "http://192.168.236.71:31302"
|
||||||
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
|
# VITE_APP_BASE_URL = "http://123.57.20.168:3000"
|
||||||
|
|
||||||
|
# 友晟外网
|
||||||
|
VITE_APP_BASE_URL = 'https://app-test.718yousheng.com/app'
|
||||||
|
# 友晟内网
|
||||||
|
# VITE_APP_BASE_URL = 'https://appi-test.718yousheng.com/app'
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@ pnpm-debug.log*
|
|||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
|
.hbuilderx
|
||||||
.DS_Store
|
.DS_Store
|
||||||
dist
|
dist
|
||||||
*.local
|
*.local
|
||||||
|
|||||||
19
.hbuilderx/launch.json
Normal file
19
.hbuilderx/launch.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"version" : "1.0",
|
||||||
|
"configurations" : [
|
||||||
|
{
|
||||||
|
"playground" : "custom",
|
||||||
|
"type" : "uni-app:app-android"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"app" : {
|
||||||
|
"launchtype" : "remote"
|
||||||
|
},
|
||||||
|
"default" : {
|
||||||
|
"launchtype" : "local"
|
||||||
|
},
|
||||||
|
"provider" : "aliyun",
|
||||||
|
"type" : "uniCloud"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
29
nativeplugins/Tm-TmSafeSaveFileModule/package.json
Normal file
29
nativeplugins/Tm-TmSafeSaveFileModule/package.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "TmSafeSaveFileModule隐私数据保存",
|
||||||
|
"id": "Tm-TmSafeSaveFileModule",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "TmSafeSaveFileModule隐私数据保存",
|
||||||
|
"_dp_type": "nativeplugin",
|
||||||
|
"_dp_nativeplugin": {
|
||||||
|
"android": {
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"type": "module",
|
||||||
|
"name": "Tm-TmSafeSaveFileModule",
|
||||||
|
"class": "io.dcloud.uniplugin.safesave.TmSafeSaveFileModule"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"abis": [
|
||||||
|
"armeabi-v7a",
|
||||||
|
"x86"
|
||||||
|
],
|
||||||
|
"minSdkVersion": "26",
|
||||||
|
"integrateType": "aar",
|
||||||
|
"dependencies": [
|
||||||
|
"androidx.security:security-crypto:1.1.0-alpha06"
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
41
src/App.vue
41
src/App.vue
@@ -4,16 +4,39 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
// import { onLaunch } from '@dcloudio/uni-app';
|
import {showAlert} from '@/utils/message.js'
|
||||||
// onLaunch((opt) => {
|
import { onLaunch } from '@dcloudio/uni-app';
|
||||||
// console.log("onLaunch")
|
onLaunch((opt) => {
|
||||||
|
// uni.preloadPage({ url: "/pages/login/login" });
|
||||||
|
// uni.preloadPage({ url: "/pages/home/home" });
|
||||||
|
// uni.preloadPage({ url: "/pages/business/business" });
|
||||||
|
// uni.preloadPage({ url: "/pages/notice/notice" });
|
||||||
|
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
|
||||||
|
console.log("APP onLaunch")
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// uni.getPushClientId({
|
||||||
|
// success: (res) => {
|
||||||
|
// let push_clientid = res.cid
|
||||||
|
// showAlert(push_clientid)
|
||||||
|
// console.log('客户端推送标识:', push_clientid);
|
||||||
|
// },
|
||||||
|
// fail(err) {
|
||||||
|
// console.log(err)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
uni.onPushMessage(res => {
|
||||||
|
console.log("收到推送消息:", res) //监听推送消息
|
||||||
|
// uni.createPushMessage({
|
||||||
|
// title: res.data.title,
|
||||||
|
// content: res.data.content,
|
||||||
|
// payload: res.data.payload
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
|
||||||
// uni.preloadPage({ url: "/pages/login/login" });
|
|
||||||
// uni.preloadPage({ url: "/pages/home/home" });
|
|
||||||
// uni.preloadPage({ url: "/pages/business/business" });
|
|
||||||
// uni.preloadPage({ url: "/pages/notice/notice" });
|
|
||||||
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
import request from "@/utils/request"
|
import request from "@/utils/request"
|
||||||
|
// 获取用户信息
|
||||||
export function getPersonalPlanList(params) {
|
|
||||||
return request.post({
|
|
||||||
url: '/getPersonalPlanList',
|
|
||||||
params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUserInfo(data) {
|
export function getUserInfo(data) {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/crm/app/user/getUserInfo',
|
url: '/crm/app/user/getUserInfo',
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref, defineExpose} from "vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 是否显示全部清空按钮
|
// 是否显示全部清空按钮
|
||||||
@@ -111,7 +111,7 @@ const active = ref(false); // 组件是否激活,
|
|||||||
let changevalue = reactive([]);
|
let changevalue = reactive([]);
|
||||||
let realValue = reactive([]);
|
let realValue = reactive([]);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init();
|
// init();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 初始化函数
|
// 初始化函数
|
||||||
@@ -175,6 +175,17 @@ const handleChange = (index, item) => {
|
|||||||
// 触发回调函数
|
// 触发回调函数
|
||||||
emit("change", changevalue, realValue);
|
emit("change", changevalue, realValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 失去焦点时关闭选项列表
|
||||||
|
const handleBlur = () => {
|
||||||
|
active.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 定义组件实例暴露的方法
|
||||||
|
defineExpose({
|
||||||
|
handleBlur
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id" : "H5E705637",
|
"id" : "H5E705637",
|
||||||
"name" : "app",
|
"name" : "718友晟",
|
||||||
// "appid" : "H5E705637",
|
"appid" : "__UNI__4C459F4",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
@@ -16,12 +16,14 @@
|
|||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender" : true,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting" : false,// 是否显示等待界面
|
"waiting" : false, // 是否显示等待界面
|
||||||
"autoclose" : true,
|
"autoclose" : true,
|
||||||
"delay" : 0
|
"delay" : 0
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules" : {},
|
"modules" : {
|
||||||
|
"Push" : {}
|
||||||
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
@@ -41,21 +43,72 @@
|
|||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.INTERNET\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.GET_TASKS\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.BLUETOOTH\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_ADDED\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_CHANGED\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_INSTALL\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_REPLACED\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.RESTART_PACKAGES\" />",
|
||||||
|
"<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />"
|
||||||
],
|
],
|
||||||
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
|
||||||
|
"minSdkVersion" : 26,
|
||||||
|
"targetSdkVersion" : 35,
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"android" : {
|
"android" : {
|
||||||
"hdpi" : "static/icons/72x72.png",
|
"hdpi" : "/static/images/icon.png",
|
||||||
"xhdpi" : "static/icons/96x96.png",
|
"xhdpi" : "/static/images/icon.png",
|
||||||
"xxhdpi" : "static/icons/144x144.png",
|
"xxhdpi" : "/static/images/icon.png",
|
||||||
"xxxhdpi" : "static/icons/192x192.png"
|
"xxxhdpi" : "/static/images/icon.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios" : {},
|
"ios" : {
|
||||||
|
"dSYMs" : false
|
||||||
|
},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs" : {}
|
"sdkConfigs" : {
|
||||||
|
"push" : {
|
||||||
|
"unipush" : {
|
||||||
|
"version" : "2",
|
||||||
|
"offline" : true,
|
||||||
|
"icons" : {
|
||||||
|
"small" : {
|
||||||
|
"ldpi" : "/static/images/icon.png",
|
||||||
|
"mdpi" : "/static/images/icon.png",
|
||||||
|
"hdpi" : "/static/images/icon.png",
|
||||||
|
"xhdpi" : "/static/images/icon.png",
|
||||||
|
"xxhdpi" : "/static/images/icon.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nativePlugins" : {
|
||||||
|
"Tm-TmSafeSaveFileModule" : {
|
||||||
|
"__plugin_info__" : {
|
||||||
|
"name" : "TmSafeSaveFileModule隐私数据保存",
|
||||||
|
"description" : "TmSafeSaveFileModule隐私数据保存",
|
||||||
|
"platforms" : "Android",
|
||||||
|
"url" : "",
|
||||||
|
"android_package_name" : "",
|
||||||
|
"ios_bundle_id" : "",
|
||||||
|
"isCloud" : false,
|
||||||
|
"bought" : -1,
|
||||||
|
"pid" : "",
|
||||||
|
"parameters" : {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
@@ -84,8 +137,8 @@
|
|||||||
"h5" : {
|
"h5" : {
|
||||||
"router" : {
|
"router" : {
|
||||||
"base" : ""
|
"base" : ""
|
||||||
/*,"mode": "history" 仅对 H5 平台生效 */
|
|
||||||
},
|
},
|
||||||
|
/*,"mode": "history" 仅对 H5 平台生效 */
|
||||||
"template" : "index.html"
|
"template" : "index.html"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,12 @@
|
|||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/notice/noticeDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/notice/waitApprove",
|
"path": "pages/notice/waitApprove",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -217,13 +223,6 @@
|
|||||||
"navigationBarTitleText": "通用信息更新"
|
"navigationBarTitleText": "通用信息更新"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//选择客户(已更新)
|
|
||||||
{
|
|
||||||
"path": "pages/business/CRM/chooseCus",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "客户选择"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//选择客户人员(已更新)
|
//选择客户人员(已更新)
|
||||||
{
|
{
|
||||||
"path": "pages/business/CRM/customerUserList",
|
"path": "pages/business/CRM/customerUserList",
|
||||||
|
|||||||
@@ -1,256 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="con-body">
|
|
||||||
<view class="con-bg">
|
|
||||||
<!-- 头部 -->
|
|
||||||
<customHeader ref="customHeaderRef" :title="'客户名称列表'" :leftFlag="true" :rightFlag="false">
|
|
||||||
<template #right>
|
|
||||||
<view class="head-right" @click="handleAdd">
|
|
||||||
<uni-icons type="plus" size="24" color="#B7D2FF"></uni-icons>
|
|
||||||
新增
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</customHeader>
|
|
||||||
|
|
||||||
<!-- 高度来避免头部遮挡 -->
|
|
||||||
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view>
|
|
||||||
|
|
||||||
<!-- 正文内容 -->
|
|
||||||
<view class="all-body">
|
|
||||||
<!-- 搜索 @blur="blur" @focus="focus" @input="input" @cancel="cancel" @clear="clear"-->
|
|
||||||
<view class="search">
|
|
||||||
<uni-search-bar class="custom-search" radius="28" placeholder="请输入客户名称" clearButton="auto"
|
|
||||||
cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff"
|
|
||||||
v-model="searchValue" @clear="searchValue=''"
|
|
||||||
/>
|
|
||||||
<!-- <button type="default" @click="searchValue=''" size="mini" class="btn-search">清空</button>-->
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 分页部分 -->
|
|
||||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
|
||||||
:up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"
|
|
||||||
class="scroll-h" :class="{'loading-scroll':cssFlag}"
|
|
||||||
><!-- @down="downCallback"-->
|
|
||||||
<radio-group class="block" @change="radioChange">
|
|
||||||
<view class="white-bg" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
|
|
||||||
<radio class='radio'
|
|
||||||
:class="index === selectIndex ? 'checked' : ''"
|
|
||||||
:checked="index === selectIndex"
|
|
||||||
:value="index+''">
|
|
||||||
</radio>
|
|
||||||
|
|
||||||
<view class="report-list">
|
|
||||||
<view class="title">{{ item.cusName }}</view>
|
|
||||||
<!-- <view class="r-list">
|
|
||||||
<view class="r-name">{{ item.shortName }}</view>
|
|
||||||
<view class="r-right btn-orange" size="mini">{{ item.statusName }}</view>
|
|
||||||
</view>-->
|
|
||||||
<view class="border-bottom"></view>
|
|
||||||
<!-- <view class="r-list">
|
|
||||||
<view class="r-left">日期</view>
|
|
||||||
<view class="r-right">{{ new Date(item.createTime).toLocaleDateString()}}</view>
|
|
||||||
</view>-->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</radio-group>
|
|
||||||
</mescroll-uni>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
|
|
||||||
import {ref, onMounted, getCurrentInstance, watch} from 'vue'
|
|
||||||
import customHeader from '@/components/customHeader.vue'
|
|
||||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
|
||||||
import {getNavBarPaddingTop} from '@/utils/system.js'
|
|
||||||
import {onLoad} from "@dcloudio/uni-app";
|
|
||||||
import {getCustomerList} from "@/api/crm/customer/getCustomer";
|
|
||||||
|
|
||||||
let instance = null;
|
|
||||||
// 获取导航栏高度用于内容区域padding
|
|
||||||
const navBarPaddingTop = ref(0);
|
|
||||||
// 查询列表
|
|
||||||
let list = ref([]);
|
|
||||||
const mescrollRef = ref(null);
|
|
||||||
let searchValue = ref('')
|
|
||||||
|
|
||||||
let cssFlag=ref(false);//控制样式
|
|
||||||
|
|
||||||
const upOption = ref({
|
|
||||||
page: { num: 0, size: 10 },
|
|
||||||
noMoreSize: 5,
|
|
||||||
empty: {
|
|
||||||
tip: '~ 空空如也 ~',
|
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
|
||||||
},
|
|
||||||
textLoading: '加载中...',
|
|
||||||
textNoMore: '已经到底了'
|
|
||||||
});
|
|
||||||
|
|
||||||
const downOption = ref({
|
|
||||||
auto: true,
|
|
||||||
textInOffset: '下拉刷新',
|
|
||||||
textOutOffset: '释放更新',
|
|
||||||
textLoading: '刷新中...'
|
|
||||||
});
|
|
||||||
|
|
||||||
const mescrollInit = (mescroll) => {
|
|
||||||
cssFlag.value = true;
|
|
||||||
mescrollRef.value = mescroll;
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
navBarPaddingTop.value = getNavBarPaddingTop() * 2;
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
onLoad((options)=>{
|
|
||||||
instance = getCurrentInstance().proxy;
|
|
||||||
const eventChannel = instance.getOpenerEventChannel();
|
|
||||||
eventChannel.on('requestCusList', async (res) => {
|
|
||||||
let {cusName} = res.data;
|
|
||||||
// console.log(cusName, "客户选择页读取到参数");
|
|
||||||
searchValue.value = cusName;
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
let timerId = null;
|
|
||||||
// 搜索
|
|
||||||
watch(searchValue, (newValue, oldValue) => {
|
|
||||||
// console.log(`新值: ${newValue}, 旧值: ${oldValue}`);
|
|
||||||
if(timerId) clearTimeout(timerId);
|
|
||||||
timerId = setTimeout(async ()=>{
|
|
||||||
handleSearch();
|
|
||||||
clearTimeout(timerId);
|
|
||||||
timerId = null;
|
|
||||||
}, 500);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 下拉刷新
|
|
||||||
const downCallback = async (mescroll) => {
|
|
||||||
try {
|
|
||||||
const res = await getList(1, upOption.value.page.size);
|
|
||||||
list.value = res.list;
|
|
||||||
// 正确结束下拉刷新状态
|
|
||||||
mescroll.endSuccess(res.list.length, res.total >= upOption.value.page.size);
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
// 发生错误时结束下拉刷新
|
|
||||||
mescroll.endErr();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 上拉加载更多
|
|
||||||
const upCallback = async (mescroll) => {
|
|
||||||
try {
|
|
||||||
const res = await getList(mescroll.num, mescroll.size);
|
|
||||||
if (mescroll.num === 1) {
|
|
||||||
list.value = res.list;
|
|
||||||
} else {
|
|
||||||
list.value.push(...res.list);
|
|
||||||
}
|
|
||||||
// 正确结束上拉加载状态
|
|
||||||
mescroll.endSuccess(res.list.length, res.list.length >= mescroll.size);
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
// 发生错误时结束上拉加载
|
|
||||||
mescroll.endErr();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询搜索跳转
|
|
||||||
let handleSearch = async () => {
|
|
||||||
// 触发下拉刷新以重新加载数据
|
|
||||||
if (mescrollRef.value) {
|
|
||||||
cssFlag.value = true;
|
|
||||||
uni.showLoading()
|
|
||||||
await downCallback(mescrollRef.value.mescroll);
|
|
||||||
uni.hideLoading()
|
|
||||||
cssFlag.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取数据列表
|
|
||||||
const getList = async (pageIndex, pageSize) => {
|
|
||||||
let param = {
|
|
||||||
pageNum: pageIndex,
|
|
||||||
pageSize,
|
|
||||||
cusName: searchValue.value
|
|
||||||
}
|
|
||||||
let { rows, total } = await getCustomerList(param)
|
|
||||||
return {list: rows, total};
|
|
||||||
}
|
|
||||||
// 选中项的索引号
|
|
||||||
const selectIndex = ref(null);
|
|
||||||
const radioChange = (e) => {
|
|
||||||
let {value} = e.detail; // index
|
|
||||||
// console.log(value);
|
|
||||||
const eventChannel = instance.getOpenerEventChannel();
|
|
||||||
eventChannel.emit('onCustomerSelected', list.value[value]);
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.all-body {
|
|
||||||
/* #ifdef APP-PLUS */
|
|
||||||
top: 150rpx;
|
|
||||||
height: calc(100vh - 75px);
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef APP-PLUS */
|
|
||||||
top: 120rpx;
|
|
||||||
height: calc(100vh);
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.search .btn-search {
|
|
||||||
border: none;
|
|
||||||
background: none;
|
|
||||||
line-height: normal;
|
|
||||||
color: #fff;
|
|
||||||
line-height: 56rpx !important;
|
|
||||||
padding: 10rpx 0 0;
|
|
||||||
text-align: left;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search .btn-search::after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scroll-h {
|
|
||||||
/* #ifdef APP-PLUS */
|
|
||||||
height: calc(100vh - 120px);
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef APP-PLUS */
|
|
||||||
height: calc(100vh - 110px);
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.white-bg {
|
|
||||||
//padding-bottom:10rpx;
|
|
||||||
margin-bottom: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.radio {
|
|
||||||
padding-right: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 32rpx;
|
|
||||||
line-height: 48rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.report-list {
|
|
||||||
width: calc(100% - 70rpx);
|
|
||||||
//background-color: pink;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border-bottom {
|
|
||||||
margin-top: 6rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -128,7 +128,7 @@ const upOption = ref({
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
||||||
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
||||||
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/>
|
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/>
|
||||||
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList"
|
<multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
|
||||||
@change="handleHobbyChange" :slabel="'name'"
|
@change="handleHobbyChange" :slabel="'name'"
|
||||||
|
|
||||||
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
||||||
@@ -467,20 +467,29 @@ let handleThinkLevelChange = (e) => {
|
|||||||
// 系统推荐等级
|
// 系统推荐等级
|
||||||
let recommendLevel = ref("");
|
let recommendLevel = ref("");
|
||||||
let getRecommendLevel = async () => {
|
let getRecommendLevel = async () => {
|
||||||
if (formData.value.cusEstate && formData.value.functionalRequirements) {
|
if (formData.value.cusEstate) {
|
||||||
let {cusEstate, functionalRequirements} = formData.value;
|
let {cusEstate, functionalRequirements} = formData.value;
|
||||||
let param = {cusEstate, functionalRequirements};
|
let param = {cusEstate, functionalRequirements};
|
||||||
if (formData.value.salesmanThinkLevel) {
|
if (formData.value.salesmanThinkLevel) {
|
||||||
param.personnelLevel = formData.value.salesmanThinkLevel;
|
param.personnelLevel = formData.value.salesmanThinkLevel;
|
||||||
}
|
}
|
||||||
let res = await getCustomerLevel(param).catch(err => {
|
let res = await getCustomerLevel(param)
|
||||||
|
/*.catch(err => {
|
||||||
console.error(err, "客户的系统推荐等级获取失败")
|
console.error(err, "客户的系统推荐等级获取失败")
|
||||||
})
|
})*/
|
||||||
if (!res.systemRecommendationLevel) {
|
try{
|
||||||
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
if(res.data.systemRecommendationLevel){
|
||||||
console.log(formData.value.systemThinkLevel + "???")
|
formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
|
||||||
}
|
}
|
||||||
|
}catch(e){
|
||||||
|
if (res.systemRecommendationLevel) {
|
||||||
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
||||||
}
|
}
|
||||||
@@ -509,8 +518,7 @@ let handleUserTypeChange = (e) => {
|
|||||||
|
|
||||||
// 选择日期
|
// 选择日期
|
||||||
function handleTenureTimeChange(e) {
|
function handleTenureTimeChange(e) {
|
||||||
let {value} = e.detail;
|
formData.value.tenureTime = e;
|
||||||
formData.value.tenureTime = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需求层次索引
|
// 需求层次索引
|
||||||
@@ -533,16 +541,16 @@ let handleDevelopChange = e => {
|
|||||||
|
|
||||||
// 选择生日
|
// 选择生日
|
||||||
function handleBirthdayChange(e) {
|
function handleBirthdayChange(e) {
|
||||||
let{value} = e.detail
|
formData.value.birthday = e;
|
||||||
formData.value.birthday = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 爱好标签索引
|
// 爱好标签索引
|
||||||
let hobbyIndex = reactive([]);
|
let hobbyIds = ref([]);
|
||||||
|
let hobbies = ref([]);
|
||||||
// 选择爱好标签
|
// 选择爱好标签
|
||||||
const handleHobbyChange = (item, value) => {
|
const handleHobbyChange = (items, ids) => {
|
||||||
// console.log("爱好", item, value);
|
hobbyIds.value = [];
|
||||||
hobbyIndex = value;
|
hobbies.value = items;
|
||||||
};
|
};
|
||||||
// 选择
|
// 选择
|
||||||
const handleNativeChange = (e) => {
|
const handleNativeChange = (e) => {
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
<!--
|
||||||
|
* @author wangzhuo
|
||||||
|
* @date 2025年9月1日
|
||||||
|
* @description 编辑客户人员信息
|
||||||
|
-->
|
||||||
<template>
|
<template>
|
||||||
<view class="con-body">
|
<view class="con-body">
|
||||||
<view class="con-bg">
|
<view class="con-bg">
|
||||||
@@ -17,7 +22,7 @@
|
|||||||
|
|
||||||
<!-- 正文内容 -->
|
<!-- 正文内容 -->
|
||||||
<view class="white-bg">
|
<view class="white-bg">
|
||||||
<view class="form-con">
|
<view class="form-con" @click="handleBlur">
|
||||||
<uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%">
|
<uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%">
|
||||||
<!-- 选择客户 -->
|
<!-- 选择客户 -->
|
||||||
<uni-forms-item label="客户名称" name="cusName" required class="f-c-right">
|
<uni-forms-item label="客户名称" name="cusName" required class="f-c-right">
|
||||||
@@ -168,7 +173,7 @@
|
|||||||
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
||||||
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
||||||
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/>
|
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/>
|
||||||
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList"
|
<multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
|
||||||
@change="handleHobbyChange" :slabel="'name'"
|
@change="handleHobbyChange" :slabel="'name'"
|
||||||
|
|
||||||
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
||||||
@@ -468,20 +473,29 @@ let handleThinkLevelChange = (e) => {
|
|||||||
// 系统推荐等级
|
// 系统推荐等级
|
||||||
let recommendLevel = ref("");
|
let recommendLevel = ref("");
|
||||||
let getRecommendLevel = async () => {
|
let getRecommendLevel = async () => {
|
||||||
if (formData.value.cusEstate && formData.value.functionalRequirements) {
|
if (formData.value.cusEstate) {
|
||||||
let {cusEstate, functionalRequirements} = formData.value;
|
let {cusEstate, functionalRequirements} = formData.value;
|
||||||
let param = {cusEstate, functionalRequirements};
|
let param = {cusEstate, functionalRequirements};
|
||||||
if (formData.value.salesmanThinkLevel) {
|
if (formData.value.salesmanThinkLevel) {
|
||||||
param.personnelLevel = formData.value.salesmanThinkLevel;
|
param.personnelLevel = formData.value.salesmanThinkLevel;
|
||||||
}
|
}
|
||||||
let res = await getCustomerLevel(param).catch(err => {
|
let res = await getCustomerLevel(param)
|
||||||
|
/*.catch(err => {
|
||||||
console.error(err, "客户的系统推荐等级获取失败")
|
console.error(err, "客户的系统推荐等级获取失败")
|
||||||
})
|
})*/
|
||||||
if (!res.systemRecommendationLevel) {
|
try{
|
||||||
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
if(res.data.systemRecommendationLevel){
|
||||||
console.log(formData.value.systemThinkLevel + "???")
|
formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
|
||||||
}
|
}
|
||||||
|
}catch(e){
|
||||||
|
if (res.systemRecommendationLevel) {
|
||||||
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
||||||
}
|
}
|
||||||
@@ -510,8 +524,7 @@ let handleUserTypeChange = (e) => {
|
|||||||
|
|
||||||
// 选择日期
|
// 选择日期
|
||||||
function handleTenureTimeChange(e) {
|
function handleTenureTimeChange(e) {
|
||||||
let {value} = e.detail;
|
formData.value.tenureTime = e;
|
||||||
formData.value.tenureTime = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需求层次索引
|
// 需求层次索引
|
||||||
@@ -534,17 +547,19 @@ let handleDevelopChange = e => {
|
|||||||
|
|
||||||
// 选择生日
|
// 选择生日
|
||||||
function handleBirthdayChange(e) {
|
function handleBirthdayChange(e) {
|
||||||
let{value} = e.detail
|
formData.value.birthday = e;
|
||||||
formData.value.birthday = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 爱好标签索引
|
// 爱好标签索引
|
||||||
let hobbyIndex = reactive([]);
|
let hobbyIds = ref([]);
|
||||||
|
let hobbies = ref([]);
|
||||||
// 选择爱好标签
|
// 选择爱好标签
|
||||||
const handleHobbyChange = (item, value) => {
|
const handleHobbyChange = (items, ids) => {
|
||||||
// console.log("爱好", item, value);
|
console.log('选择爱好', items, ids);
|
||||||
hobbyIndex = value;
|
hobbyIds.value = [];
|
||||||
|
hobbies.value = items;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择
|
// 选择
|
||||||
const handleNativeChange = (e) => {
|
const handleNativeChange = (e) => {
|
||||||
formData.value.nativec = (e.detail.value.map(item => {
|
formData.value.nativec = (e.detail.value.map(item => {
|
||||||
@@ -567,17 +582,22 @@ let handleWorkingStatusChange = e => {
|
|||||||
formData.value.workingStatus = workingStatusList[value].name;
|
formData.value.workingStatus = workingStatusList[value].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hobbySelectRef = ref(null);
|
||||||
|
// 多选组件失去焦点关闭
|
||||||
|
let handleBlur = () => {
|
||||||
|
if (hobbySelectRef.value) hobbySelectRef.value.handleBlur();
|
||||||
|
}
|
||||||
let submitForm = async () => {
|
let submitForm = async () => {
|
||||||
let hobbyTags = hobbyIndex.map(it => {
|
let hobbyTags = hobbies.value.map(it => {
|
||||||
let {name} = hobbyList[it];
|
let {name} = it;
|
||||||
return name;
|
return name;
|
||||||
})
|
})
|
||||||
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
|
|
||||||
const hobbyTagString = hobbyTags.join(',');
|
const hobbyTagString = hobbyTags.join(',');
|
||||||
console.log(hobbyTagString);
|
console.log(hobbyTagString);
|
||||||
if (hobbyTagString || formData.value.hobby) {
|
if (hobbyTagString || formData.value.hobby) {
|
||||||
formData.value.hobby = formData.value.hobby ? formData.value.hobby + ',' + hobbyTagString : hobbyTagString;
|
formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + ',' : '') + hobbyTagString : formData.value.hobby;
|
||||||
}
|
}
|
||||||
|
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
|
||||||
// console.log(formData.value, "校验表单数据")
|
// console.log(formData.value, "校验表单数据")
|
||||||
// console.log(recommendLevel);
|
// console.log(recommendLevel);
|
||||||
formData.value.cusName = customerUser.value.cusName;
|
formData.value.cusName = customerUser.value.cusName;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<!-- 正文内容 -->
|
<!-- 正文内容 -->
|
||||||
<view class="white-bg">
|
<view class="white-bg">
|
||||||
<view class="form-con">
|
<view class="form-con" @click="handleBlur">
|
||||||
<uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%">
|
<uni-forms ref="formRef" :model="formData" :rules="rules" label-width="40%">
|
||||||
<!-- 选择客户 -->
|
<!-- 选择客户 -->
|
||||||
<uni-forms-item label="客户名称" name="cusName" required class="f-c-right">
|
<uni-forms-item label="客户名称" name="cusName" required class="f-c-right">
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
||||||
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
||||||
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/>
|
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好"/>
|
||||||
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList"
|
<multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
|
||||||
@change="handleHobbyChange" :slabel="'name'"
|
@change="handleHobbyChange" :slabel="'name'"
|
||||||
|
|
||||||
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
||||||
@@ -271,7 +271,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref, onMounted, computed, reactive} from 'vue'
|
import {ref, reactive} from 'vue'
|
||||||
import customHeader from '@/components/customHeader.vue'
|
import customHeader from '@/components/customHeader.vue'
|
||||||
import multipleSelect from '@/components/multipleSelect.vue'
|
import multipleSelect from '@/components/multipleSelect.vue'
|
||||||
import {
|
import {
|
||||||
@@ -284,7 +284,8 @@ import {
|
|||||||
} from "./dataMap";
|
} from "./dataMap";
|
||||||
import city from "@/utils/area";
|
import city from "@/utils/area";
|
||||||
import {getCustomerLevel, saveappCrmCusUserNew} from "@/api/crm/customer/getCustomer";
|
import {getCustomerLevel, saveappCrmCusUserNew} from "@/api/crm/customer/getCustomer";
|
||||||
|
// 对 multipleSelect 组件的引用
|
||||||
|
const hobbySelectRef = ref(null);
|
||||||
// 表单引用
|
// 表单引用
|
||||||
const formRef = ref({});
|
const formRef = ref({});
|
||||||
// 表单数据
|
// 表单数据
|
||||||
@@ -448,20 +449,29 @@ let handleThinkLevelChange = (e) => {
|
|||||||
// 系统推荐等级
|
// 系统推荐等级
|
||||||
let recommendLevel = ref("");
|
let recommendLevel = ref("");
|
||||||
let getRecommendLevel = async () => {
|
let getRecommendLevel = async () => {
|
||||||
if (formData.value.cusEstate && formData.value.functionalRequirements) {
|
if (formData.value.cusEstate) {
|
||||||
let {cusEstate, functionalRequirements} = formData.value;
|
let {cusEstate, functionalRequirements} = formData.value;
|
||||||
let param = {cusEstate, functionalRequirements};
|
let param = {cusEstate, functionalRequirements};
|
||||||
if (formData.value.salesmanThinkLevel) {
|
if (formData.value.salesmanThinkLevel) {
|
||||||
param.personnelLevel = formData.value.salesmanThinkLevel;
|
param.personnelLevel = formData.value.salesmanThinkLevel;
|
||||||
}
|
}
|
||||||
let res = await getCustomerLevel(param).catch(err => {
|
let res = await getCustomerLevel(param)
|
||||||
|
/*.catch(err => {
|
||||||
console.error(err, "客户的系统推荐等级获取失败")
|
console.error(err, "客户的系统推荐等级获取失败")
|
||||||
})
|
})*/
|
||||||
if (!res.systemRecommendationLevel) {
|
try{
|
||||||
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
if(res.data.systemRecommendationLevel){
|
||||||
console.log(formData.value.systemThinkLevel + "???")
|
formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
|
||||||
}
|
}
|
||||||
|
}catch(e){
|
||||||
|
if (res.systemRecommendationLevel) {
|
||||||
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
||||||
}
|
}
|
||||||
@@ -489,9 +499,9 @@ let handleUserTypeChange = (e) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 选择日期
|
// 选择日期
|
||||||
function handleTenureTimeChange(e) {
|
function handleTenureTimeChange(val) {
|
||||||
let {value} = e.detail;
|
console.log(val)
|
||||||
formData.value.tenureTime = value;
|
formData.value.tenureTime = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需求层次索引
|
// 需求层次索引
|
||||||
@@ -513,18 +523,20 @@ let handleDevelopChange = e => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 选择生日
|
// 选择生日
|
||||||
function handleBirthdayChange(e) {
|
function handleBirthdayChange(val) {
|
||||||
let{value} = e.detail
|
formData.value.birthday = val;
|
||||||
formData.value.birthday = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 爱好标签索引
|
// 爱好标签索引
|
||||||
let hobbyIndex = reactive([]);
|
let hobbyIds = ref([]);
|
||||||
|
let hobbies = ref([]);
|
||||||
// 选择爱好标签
|
// 选择爱好标签
|
||||||
const handleHobbyChange = (item, value) => {
|
const handleHobbyChange = (items, ids) => {
|
||||||
// console.log("爱好", item, value);
|
console.log('选择爱好', items, ids);
|
||||||
hobbyIndex = value;
|
hobbyIds.value = [];
|
||||||
|
hobbies.value = items;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择
|
// 选择
|
||||||
const handleNativeChange = (e) => {
|
const handleNativeChange = (e) => {
|
||||||
formData.value.nativec = (e.detail.value.map(item => {
|
formData.value.nativec = (e.detail.value.map(item => {
|
||||||
@@ -546,16 +558,93 @@ let handleWorkingStatusChange = e => {
|
|||||||
workingStatusIndex.value = 0;
|
workingStatusIndex.value = 0;
|
||||||
formData.value.workingStatus = workingStatusList[value].name;
|
formData.value.workingStatus = workingStatusList[value].name;
|
||||||
}
|
}
|
||||||
|
// 多选组件失去焦点关闭
|
||||||
let submitForm = async () => {
|
let handleBlur = () => {
|
||||||
let hobbyTags = hobbyIndex.map(it => {
|
if (hobbySelectRef.value) hobbySelectRef.value.handleBlur();
|
||||||
let {name} = hobbyList[it];
|
}
|
||||||
|
// 提取爱好标签处理逻辑
|
||||||
|
const processHobbyTags = () => {
|
||||||
|
let hobbyTags = hobbies.value.map(it => {
|
||||||
|
let {name} = it;
|
||||||
return name;
|
return name;
|
||||||
})
|
})
|
||||||
const hobbyTagString = hobbyTags.join(',');
|
const hobbyTagString = hobbyTags.join(',');
|
||||||
console.log(hobbyTagString);
|
console.log(hobbyTagString);
|
||||||
if (hobbyTagString || formData.value.hobby) {
|
if (hobbyTagString || formData.value.hobby) {
|
||||||
formData.value.hobby = formData.value.hobby ? formData.value.hobby + ',' + hobbyTagString : hobbyTagString;
|
formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + ',' : '') + hobbyTagString : formData.value.hobby;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提取表单验证逻辑
|
||||||
|
const validateForm = async () => {
|
||||||
|
formData.value.cusName = customerUser.value.cusName;
|
||||||
|
await formRef.value.validate();
|
||||||
|
console.log(formData.value, "提交表单数据");
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提取API调用逻辑
|
||||||
|
const saveCustomerUser = async () => {
|
||||||
|
uni.showLoading();
|
||||||
|
try {
|
||||||
|
const res = await saveappCrmCusUserNew(formData.value);
|
||||||
|
if(res.code === 200){
|
||||||
|
uni.showToast({
|
||||||
|
title: "保存成功"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "操作失败",
|
||||||
|
icon: "error"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setTimeout(() => uni.navigateBack(), 1500);
|
||||||
|
} catch(err) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: "保存失败"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
finally{
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 简化后的 submitForm 方法
|
||||||
|
let submitForm = async () => {
|
||||||
|
console.log(formData.value);
|
||||||
|
try {
|
||||||
|
if(formData.value.iphone){
|
||||||
|
formData.value.mobilePhone = formData.value.iphone;
|
||||||
|
}
|
||||||
|
// 处理爱好标签
|
||||||
|
processHobbyTags();
|
||||||
|
|
||||||
|
// 表单验证
|
||||||
|
await validateForm();
|
||||||
|
|
||||||
|
// 保存客户人员信息
|
||||||
|
await saveCustomerUser();
|
||||||
|
} catch (err) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '请检查并完善信息'
|
||||||
|
});
|
||||||
|
console.warn(err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/*let submitForm = async () => {
|
||||||
|
let hobbyTags = hobbies.value.map(it => {
|
||||||
|
let {name} = it;
|
||||||
|
return name;
|
||||||
|
})
|
||||||
|
const hobbyTagString = hobbyTags.join(',');
|
||||||
|
console.log(hobbyTagString);
|
||||||
|
if (hobbyTagString || formData.value.hobby) {
|
||||||
|
formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + ',' : '') + hobbyTagString : formData.value.hobby;
|
||||||
|
}
|
||||||
|
if(formData.value.iphone){
|
||||||
|
formData.value.mobilePhone = formData.value.iphone;
|
||||||
}
|
}
|
||||||
// console.log(formData.value, "校验表单数据")
|
// console.log(formData.value, "校验表单数据")
|
||||||
// console.log(recommendLevel);
|
// console.log(recommendLevel);
|
||||||
@@ -565,19 +654,19 @@ let submitForm = async () => {
|
|||||||
console.log(formData.value, "提交表单数据")
|
console.log(formData.value, "提交表单数据")
|
||||||
// 请求保存
|
// 请求保存
|
||||||
uni.showLoading()
|
uni.showLoading()
|
||||||
saveappCrmCusUserNew(formData.value).then(res=>{
|
saveappCrmCusUserNew(formData.value).then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if(res.code === 200){
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "保存成功"
|
title: "保存成功"
|
||||||
})
|
})
|
||||||
}else{
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "操作失败"
|
title: "操作失败"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
setTimeout(()=>uni.navigateBack(), 1500);
|
setTimeout(() => uni.navigateBack(), 1500);
|
||||||
}).catch(err=>{
|
}).catch(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: "保存失败"
|
title: "保存失败"
|
||||||
@@ -593,7 +682,7 @@ let submitForm = async () => {
|
|||||||
})
|
})
|
||||||
console.warn(err);
|
console.warn(err);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
<uni-forms-item label="爱好" name="hobby" class="uni-forms-item is-direction-top is-top">
|
||||||
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
<!-- 索引:hobbyIndex 范围:hobbyList 响应:handleHobbyChange-->
|
||||||
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/>
|
<uni-easyinput v-model="formData.hobby" placeholder="请输入爱好" :disabled="!editable"/>
|
||||||
<multipleSelect :multiple="true" :value="hobbyIndex" downInner :options="hobbyList"
|
<multipleSelect ref="hobbySelectRef" :multiple="true" downInner :value="hobbyIds" :options="hobbyList"
|
||||||
@change="handleHobbyChange" :slabel="'name'"
|
@change="handleHobbyChange" :slabel="'name'"
|
||||||
|
|
||||||
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
></multipleSelect><!--placeholder="请选择爱好标签"-->
|
||||||
@@ -439,20 +439,29 @@ let handleThinkLevelChange = (e) => {
|
|||||||
// 系统推荐等级
|
// 系统推荐等级
|
||||||
let recommendLevel = ref("");
|
let recommendLevel = ref("");
|
||||||
let getRecommendLevel = async () => {
|
let getRecommendLevel = async () => {
|
||||||
if (formData.value.cusEstate && formData.value.functionalRequirements) {
|
if (formData.value.cusEstate) {
|
||||||
let {cusEstate, functionalRequirements} = formData.value;
|
let {cusEstate, functionalRequirements} = formData.value;
|
||||||
let param = {cusEstate, functionalRequirements};
|
let param = {cusEstate, functionalRequirements};
|
||||||
if (formData.value.salesmanThinkLevel) {
|
if (formData.value.salesmanThinkLevel) {
|
||||||
param.personnelLevel = formData.value.salesmanThinkLevel;
|
param.personnelLevel = formData.value.salesmanThinkLevel;
|
||||||
}
|
}
|
||||||
let res = await getCustomerLevel(param).catch(err => {
|
let res = await getCustomerLevel(param)
|
||||||
|
/*.catch(err => {
|
||||||
console.error(err, "客户的系统推荐等级获取失败")
|
console.error(err, "客户的系统推荐等级获取失败")
|
||||||
})
|
})*/
|
||||||
if (!res.systemRecommendationLevel) {
|
try{
|
||||||
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
if(res.data.systemRecommendationLevel){
|
||||||
console.log(formData.value.systemThinkLevel + "???")
|
formData.value.systemThinkLevel = res.data.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐";
|
||||||
}
|
}
|
||||||
|
}catch(e){
|
||||||
|
if (res.systemRecommendationLevel) {
|
||||||
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
formData.value.systemThinkLevel = res.systemRecommendationLevel;
|
||||||
|
}else{
|
||||||
|
recommendLevel.value = "客户无等级信息,暂无法进行等级推荐"
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
recommendLevel.value = "无公司等级信息,无法推荐等级";
|
||||||
}
|
}
|
||||||
@@ -481,8 +490,7 @@ let handleUserTypeChange = (e) => {
|
|||||||
|
|
||||||
// 选择日期
|
// 选择日期
|
||||||
function handleTenureTimeChange(e) {
|
function handleTenureTimeChange(e) {
|
||||||
let {value} = e.detail;
|
formData.value.tenureTime = e;
|
||||||
formData.value.tenureTime = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需求层次索引
|
// 需求层次索引
|
||||||
@@ -505,17 +513,19 @@ let handleDevelopChange = e => {
|
|||||||
|
|
||||||
// 选择生日
|
// 选择生日
|
||||||
function handleBirthdayChange(e) {
|
function handleBirthdayChange(e) {
|
||||||
let{value} = e.detail
|
formData.value.birthday = e;
|
||||||
formData.value.birthday = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 爱好标签索引
|
// 爱好标签索引
|
||||||
let hobbyIndex = reactive([]);
|
let hobbyIds = ref([]);
|
||||||
|
let hobbies = ref([]);
|
||||||
// 选择爱好标签
|
// 选择爱好标签
|
||||||
const handleHobbyChange = (item, value) => {
|
const handleHobbyChange = (items, ids) => {
|
||||||
// console.log("爱好", item, value);
|
console.log('选择爱好', items, ids);
|
||||||
hobbyIndex = value;
|
hobbyIds.value = [];
|
||||||
|
hobbies.value = items;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择
|
// 选择
|
||||||
const handleNativeChange = (e) => {
|
const handleNativeChange = (e) => {
|
||||||
formData.value.nativec = (e.detail.value.map(item => {
|
formData.value.nativec = (e.detail.value.map(item => {
|
||||||
@@ -539,16 +549,18 @@ let handleWorkingStatusChange = e => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let submitForm = async () => {
|
let submitForm = async () => {
|
||||||
let hobbyTags = hobbyIndex.map(it => {
|
let hobbyTags = hobbies.value.map(it => {
|
||||||
let {name} = hobbyList[it];
|
let {name} = it;
|
||||||
return name;
|
return name;
|
||||||
})
|
})
|
||||||
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
|
|
||||||
const hobbyTagString = hobbyTags.join(',');
|
const hobbyTagString = hobbyTags.join(',');
|
||||||
console.log(hobbyTagString);
|
console.log(hobbyTagString);
|
||||||
if (hobbyTagString || formData.value.hobby) {
|
if (hobbyTagString || formData.value.hobby) {
|
||||||
formData.value.hobby = formData.value.hobby ? formData.value.hobby + ',' + hobbyTagString : hobbyTagString;
|
formData.value.hobby = hobbyTagString ? (formData.value.hobby ? formData.value.hobby + ',' : '') + hobbyTagString : formData.value.hobby;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formData.value.iphone = formData.value.mobilePhone; // 特殊处理
|
||||||
|
|
||||||
// console.log(formData.value, "校验表单数据")
|
// console.log(formData.value, "校验表单数据")
|
||||||
// console.log(recommendLevel);
|
// console.log(recommendLevel);
|
||||||
formData.value.cusName = customerUser.value.cusName;
|
formData.value.cusName = customerUser.value.cusName;
|
||||||
|
|||||||
@@ -11,18 +11,18 @@
|
|||||||
</customHeader>
|
</customHeader>
|
||||||
|
|
||||||
<!-- 高度来避免头部遮挡 -->
|
<!-- 高度来避免头部遮挡 -->
|
||||||
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view>
|
<view class="top-height"></view>
|
||||||
|
|
||||||
<!-- 正文内容 -->
|
<!-- 正文内容 -->
|
||||||
<view class="all-body">
|
<view class="all-body">
|
||||||
<!-- 搜索-->
|
<!-- 搜索-->
|
||||||
<!-- <view class="search">-->
|
<!-- <view class="search">-->
|
||||||
<!-- <uni-search-bar class="custom-search" radius="28" placeholder="请输入客户人员名称" clearButton="auto"-->
|
<!-- <uni-search-bar class="custom-search" radius="28" placeholder="请输入客户人员名称" clearButton="auto"-->
|
||||||
<!-- cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff"-->
|
<!-- cancelButton="none" bgColor="#6FA2F8" textColor="#ffffff"-->
|
||||||
<!-- v-model="searchValue"-->
|
<!-- v-model="searchValue"-->
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<!-- <button type="default" @click="clearSearchValue" size="mini" class="btn-search">清空</button>-->
|
<!-- <button type="default" @click="clearSearchValue" size="mini" class="btn-search">清空</button>-->
|
||||||
<!-- </view>-->
|
<!-- </view>-->
|
||||||
|
|
||||||
<!-- 分页部分 -->
|
<!-- 分页部分 -->
|
||||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
||||||
@@ -122,10 +122,7 @@ let list = ref([]);
|
|||||||
const upOption = ref({
|
const upOption = ref({
|
||||||
page: {num: 0, size: 10},
|
page: {num: 0, size: 10},
|
||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {tip: '~ 空空如也 ~'},
|
||||||
tip: '~ 空空如也 ~',
|
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
|
||||||
},
|
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ function getCrmCusUserNewChangeOwnerList() {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.con-bg{
|
.con-bg{
|
||||||
background: white;
|
background: white;
|
||||||
min-height: 100vh;
|
/* min-height: 100vh; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.white-bg {
|
.white-bg {
|
||||||
|
|||||||
@@ -10,18 +10,18 @@
|
|||||||
<!-- 正文内容 -->
|
<!-- 正文内容 -->
|
||||||
<view>
|
<view>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<view class="search">
|
<!-- <view class="search">-->
|
||||||
<picker mode="date" :value="defaultDate" :start="startDate" :end="endDate" @change="bindDateChange"
|
<!-- <picker mode="date" :value="defaultDate" :start="startDate" :end="endDate" @change="bindDateChange"-->
|
||||||
class="picker-bg">
|
<!-- class="picker-bg">-->
|
||||||
<view class="picker">
|
<!-- <view class="picker">-->
|
||||||
<uni-icons custom-prefix="iconfont" color="#ffffff" type="icon-phoneshizhong"
|
<!-- <uni-icons custom-prefix="iconfont" color="#ffffff" type="icon-phoneshizhong"-->
|
||||||
size="18"></uni-icons>
|
<!-- size="18"></uni-icons>-->
|
||||||
<view>{{ defaultDate }}</view>
|
<!-- <view>{{ defaultDate }}</view>-->
|
||||||
<uni-icons type="down" size="18"></uni-icons>
|
<!-- <uni-icons type="down" size="18"></uni-icons>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</picker>
|
<!-- </picker>-->
|
||||||
<button type="default" @click="handleSearch" size="mini" class="btn-search">查询</button>
|
<!-- <button type="default" @click="handleSearch" size="mini" class="btn-search">查询</button>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
|
|
||||||
<!-- 分页部分 -->
|
<!-- 分页部分 -->
|
||||||
<view class="white-bg margin-bottom20" v-for="(item, index) in list">
|
<view class="white-bg margin-bottom20" v-for="(item, index) in list">
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ import { ref, reactive, onMounted } from 'vue'
|
|||||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||||
import { getNavBarPaddingTop } from '@/utils/system.js'
|
import { getNavBarPaddingTop } from '@/utils/system.js'
|
||||||
import { onShow } from '@dcloudio/uni-app';
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import { getApprovalList, getUserInfo } from '../../../../api/crm/activity/activity';
|
import { getApprovalList } from '../../../../api/crm/activity/activity';
|
||||||
|
|
||||||
|
|
||||||
let list = ref([])
|
let list = ref([])
|
||||||
@@ -82,7 +82,7 @@ const upOption = ref({
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
@@ -110,24 +110,24 @@ function upCallback(page) {
|
|||||||
getVisistList(page);
|
getVisistList(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
onShow(() => {
|
// onShow(() => {
|
||||||
getUserInfoMethod();
|
// getUserInfoMethod();
|
||||||
})
|
// })
|
||||||
|
|
||||||
let nickName = ref();
|
let nickName = ref();
|
||||||
let deptName = ref();
|
let deptName = ref();
|
||||||
let userId = ref();
|
let userId = ref();
|
||||||
let posts = ref();
|
let posts = ref();
|
||||||
|
|
||||||
//获取用户信息
|
// //获取用户信息
|
||||||
function getUserInfoMethod() {
|
// function getUserInfoMethod() {
|
||||||
getUserInfo().then(res => {
|
// getUserInfo().then(res => {
|
||||||
nickName.value = res.user.nickName;
|
// nickName.value = res.user.nickName;
|
||||||
deptName.value = res.user.dept.deptName;
|
// deptName.value = res.user.dept.deptName;
|
||||||
userId.value = res.user.userId;
|
// userId.value = res.user.userId;
|
||||||
posts.value = res.post;
|
// posts.value = res.post;
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
//查询待审批的列表信息
|
//查询待审批的列表信息
|
||||||
let dataList = ref([])
|
let dataList = ref([])
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const upOption = ref({
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
|
|||||||
@@ -95,7 +95,12 @@ import { ref } from 'vue'
|
|||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import customHeader from '@/components/customHeader.vue'
|
import customHeader from '@/components/customHeader.vue'
|
||||||
import customTabs from '@/components/customTabs.vue';
|
import customTabs from '@/components/customTabs.vue';
|
||||||
import { auditActivityReport, getVisistDetailList, getYsVisistInfo } from '../../../../api/crm/activity/activity';
|
import {
|
||||||
|
auditActivityReport,
|
||||||
|
getRejectReason,
|
||||||
|
getVisistDetailList,
|
||||||
|
getYsVisistInfo
|
||||||
|
} from '../../../../api/crm/activity/activity';
|
||||||
|
|
||||||
|
|
||||||
let visistId = ref(0)
|
let visistId = ref(0)
|
||||||
@@ -127,10 +132,38 @@ const activeTab = ref(0);//默认报告明细
|
|||||||
const tabList = ['报告明细'];
|
const tabList = ['报告明细'];
|
||||||
|
|
||||||
//点击驳回
|
//点击驳回
|
||||||
function refuse() {
|
// 修正后的驳回方法
|
||||||
uni.navigateTo({
|
const refuse = async () => {
|
||||||
url: './auditReject?visistId=' + visistId.value
|
uni.showModal({
|
||||||
})
|
title: '驳回原因',
|
||||||
|
content: '',
|
||||||
|
editable: true,
|
||||||
|
success: async function (modalRes) { // 使用modalRes避免重名
|
||||||
|
if (modalRes.confirm) {
|
||||||
|
try {
|
||||||
|
const param = {
|
||||||
|
visistId: visistId.value,
|
||||||
|
rejectReason: modalRes.content // 用户输入的驳回原因
|
||||||
|
};
|
||||||
|
const apiRes = await getRejectReason(param); // 避免与modalRes重名
|
||||||
|
uni.showToast({
|
||||||
|
title: '驳回成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
// 操作完成后返回
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack(1);
|
||||||
|
}, 800);
|
||||||
|
} catch (err) {
|
||||||
|
console.log('驳回失败:', err);
|
||||||
|
uni.showToast({
|
||||||
|
title: '驳回失败',
|
||||||
|
icon: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击通过
|
//点击通过
|
||||||
@@ -145,7 +178,7 @@ function adopt(item) {
|
|||||||
reportStaffName: item.staffName,
|
reportStaffName: item.staffName,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// that.mescroll.resetUpScroll()
|
mescroll.resetUpScroll()
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
@@ -153,6 +186,10 @@ function adopt(item) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
uni.navigateBack({
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ const upOption = ref({
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ const upOption = ref({
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
|
|||||||
@@ -69,7 +69,10 @@
|
|||||||
class="uni-forms-item is-direction-top is-top">
|
class="uni-forms-item is-direction-top is-top">
|
||||||
|
|
||||||
<multipleSelect :multiple="true" :value="chooseMyLeaderList" downInner
|
<multipleSelect :multiple="true" :value="chooseMyLeaderList" downInner
|
||||||
:options="myLeaderList" @change="changeValue2" :key="Math.round()" :slabel="'text'">
|
:options="myLeaderList"
|
||||||
|
@change="changeValue2" :key="Math.round()"
|
||||||
|
:slabel="'text'"
|
||||||
|
>
|
||||||
</multipleSelect>
|
</multipleSelect>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
|
||||||
@@ -138,7 +141,9 @@ const submitForm = async () => {
|
|||||||
icon: 'success'
|
icon: 'success'
|
||||||
});
|
});
|
||||||
saveVisistReportForm.cusId = formData.value.cusId
|
saveVisistReportForm.cusId = formData.value.cusId
|
||||||
saveVisistReportForm.joinUser = formData.value.leader.map(item => item.text).join(',')
|
if (Array.isArray(formData.value.leader)) {
|
||||||
|
saveVisistReportForm.joinUser = formData.value.leader.map(item => item.text).join(',');
|
||||||
|
}
|
||||||
saveVisistReportForm.visistDate = formData.value.visitDate
|
saveVisistReportForm.visistDate = formData.value.visitDate
|
||||||
saveVisistReportForm.visistType = 'I类活动(走访)'
|
saveVisistReportForm.visistType = 'I类活动(走访)'
|
||||||
saveVisistReportForm.mapId = mapId.value
|
saveVisistReportForm.mapId = mapId.value
|
||||||
@@ -249,9 +254,10 @@ function chooseRecord(e) {
|
|||||||
|
|
||||||
.form-con {
|
.form-con {
|
||||||
/* #ifdef APP-PLUS */
|
/* #ifdef APP-PLUS */
|
||||||
height: calc(100vh - 100px)
|
height: calc(100vh - 95px) !important;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifndef APP-PLUS */
|
/* #ifndef APP-PLUS */
|
||||||
|
height:calc(100vh - 68px) !important;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ const dynamicPlaceholder = computed(() => {
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ const dynamicPlaceholder = computed(() => {
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ const inputval = ref(''); // 搜索内容
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
height: calc(120vh - 100px)
|
height: calc(120vh - 100px)
|
||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifndef APP-PLUS */
|
/* #ifndef APP-PLUS */
|
||||||
height:calc(120vh - 80px)
|
height:calc(140vh - 80px)
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -179,7 +179,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<view class="report-list">
|
<view class="report-list">
|
||||||
<view class="title r-list">
|
<view class="title r-list">
|
||||||
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
||||||
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.status==2}"
|
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.state==='完成'}"
|
||||||
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding:0rpx 0 10rpx">
|
<view style="padding:0rpx 0 10rpx">
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<view class="report-list">
|
<view class="report-list">
|
||||||
<view class="title r-list">
|
<view class="title r-list">
|
||||||
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
||||||
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.status==2}"
|
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.state==='完成'}"
|
||||||
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding:0rpx 0 10rpx">
|
<view style="padding:0rpx 0 10rpx">
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
<view class="report-list">
|
<view class="report-list">
|
||||||
<view class="title r-list">
|
<view class="title r-list">
|
||||||
<view class="r-left" style="font-size:38rpx;">{{ item.competitiveUnits }}</view>
|
<view class="r-left" style="font-size:38rpx;">{{ item.competitiveUnits }}</view>
|
||||||
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.status==2}"
|
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.state==='完成'}"
|
||||||
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding:0rpx 0 10rpx">
|
<view style="padding:0rpx 0 10rpx">
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
<view class="report-list">
|
<view class="report-list">
|
||||||
<view class="title r-list">
|
<view class="title r-list">
|
||||||
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
||||||
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.status==2}"
|
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.state==='完成'}"
|
||||||
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding:0rpx 0 10rpx">
|
<view style="padding:0rpx 0 10rpx">
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
<view class="report-list">
|
<view class="report-list">
|
||||||
<view class="title r-list">
|
<view class="title r-list">
|
||||||
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
||||||
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.status==2}"
|
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.state==='完成'}"
|
||||||
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding:0rpx 0 10rpx">
|
<view style="padding:0rpx 0 10rpx">
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
<view class="report-list">
|
<view class="report-list">
|
||||||
<view class="title r-list">
|
<view class="title r-list">
|
||||||
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
<view class="r-left" style="font-size:38rpx;">{{ item.cusName }}</view>
|
||||||
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.status==2}"
|
<view class="r-right btn-gray flex-auto" :class="{'btn-blue':item.state==='完成'}"
|
||||||
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
size="mini" @click.stop="itemView(item)">{{ item.state }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding:0rpx 0 10rpx">
|
<view style="padding:0rpx 0 10rpx">
|
||||||
@@ -237,7 +237,7 @@
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
@@ -493,4 +493,8 @@
|
|||||||
.report-list .title {
|
.report-list .title {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
.btn-blue {
|
||||||
|
background-color: #3384DF; /* 蓝色背景 */
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -105,7 +105,7 @@ const upOption = ref({
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
|
|||||||
@@ -232,7 +232,8 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer(){
|
function chooseCustomer(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
@@ -311,7 +312,7 @@
|
|||||||
height: calc(120vh - 100px)
|
height: calc(120vh - 100px)
|
||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifndef APP-PLUS */
|
/* #ifndef APP-PLUS */
|
||||||
height:calc(120vh - 80px)
|
height:calc(140vh - 80px)
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer(){
|
function chooseCustomer(){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url:'/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -201,7 +201,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ const upOption = ref({
|
|||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {
|
||||||
tip: '~ 空空如也 ~',
|
tip: '~ 空空如也 ~',
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
icon: "../../../../static/images/mescroll-empty.png"
|
||||||
},
|
},
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
// 选择客户页面跳转
|
// 选择客户页面跳转
|
||||||
function chooseCustomer() {
|
function chooseCustomer() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/business/CRM/chooseCus'
|
url: '/pages/business/CRM/marketActivity/chooseCus'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//定义数据接收的值
|
//定义数据接收的值
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<!-- 高度来避免头部遮挡 -->
|
<!-- 高度来避免头部遮挡 -->
|
||||||
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view>
|
<view class="top-height"></view>
|
||||||
|
|
||||||
<view class="white-bg">
|
<view class="white-bg">
|
||||||
<navigator url="/pages/business/CRM/plan/myPlan">
|
<navigator url="/pages/business/CRM/plan/myPlan">
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ function handleEdit(index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.white-bg.white-bg-2 {
|
.white-bg.white-bg-2 {
|
||||||
/* margin-bottom: 20rpx; */
|
/* margin-bottom: 20rpx; */
|
||||||
}
|
}
|
||||||
.bottom-spliter{
|
.bottom-spliter{
|
||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
@@ -286,14 +286,14 @@ function handleEdit(index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-list {
|
.nav-list {
|
||||||
/* display: flex;*/
|
/* display: flex;*/
|
||||||
/* width: 690rpx;*/
|
/* width: 690rpx;*/
|
||||||
overflow-x: auto; /* 允许横向滚动 */
|
overflow-x: auto; /* 允许横向滚动 */
|
||||||
/*overflow-y: hidden; 隐藏垂直滚动 */
|
/*overflow-y: hidden; 隐藏垂直滚动 */
|
||||||
/*-ms-overflow-style: none; IE 隐藏滚动条 */
|
/*-ms-overflow-style: none; IE 隐藏滚动条 */
|
||||||
/* scrollbar-width: none; */ /*Firefox 隐藏滚动条 */
|
/* scrollbar-width: none; */ /*Firefox 隐藏滚动条 */
|
||||||
/* 添加高度以确保有足够的空间 */
|
/* 添加高度以确保有足够的空间 */
|
||||||
/* height: 80rpx;*/
|
/* height: 80rpx;*/
|
||||||
white-space: nowrap; /* 保持子元素在同一行显示 */
|
white-space: nowrap; /* 保持子元素在同一行显示 */
|
||||||
/* 添加这些属性确保滚动正常工作 */
|
/* 添加这些属性确保滚动正常工作 */
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
@@ -310,7 +310,7 @@ function handleEdit(index) {
|
|||||||
}
|
}
|
||||||
.nav-list .nav-item {
|
.nav-list .nav-item {
|
||||||
/* flex: 0 0 auto; 关键:不放大、不缩小、自动宽度 */
|
/* flex: 0 0 auto; 关键:不放大、不缩小、自动宽度 */
|
||||||
/* width: 200rpx;*/
|
/* width: 200rpx;*/
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background-color: #05A3F4;
|
background-color: #05A3F4;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
|
|||||||
@@ -11,8 +11,7 @@
|
|||||||
</customHeader>
|
</customHeader>
|
||||||
|
|
||||||
<!-- 高度来避免头部遮挡 -->
|
<!-- 高度来避免头部遮挡 -->
|
||||||
<view class="top-height" :style="{ paddingTop: navBarPaddingTop + 'px' }"></view>
|
<view class="top-height"></view>
|
||||||
|
|
||||||
<!-- 正文内容 -->
|
<!-- 正文内容 -->
|
||||||
<view>
|
<view>
|
||||||
|
|
||||||
@@ -37,9 +36,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 分页部分 -->
|
<!-- 分页部分 -->
|
||||||
<!-- <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"-->
|
<!-- <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"-->
|
||||||
<!-- :up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"-->
|
<!-- :up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"-->
|
||||||
<!-- class="scroll-h" :class="{'loading-scroll':cssFlag}">-->
|
<!-- class="scroll-h" :class="{'loading-scroll':cssFlag}">-->
|
||||||
<view class="white-bg" v-if="list.length">
|
<view class="white-bg" v-if="list.length">
|
||||||
<!--v-for="(item, index) in list" :key="index" @click="handleDetail(item)"-->
|
<!--v-for="(item, index) in list" :key="index" @click="handleDetail(item)"-->
|
||||||
<view style="text-align: center; margin-bottom: 30rpx; font-size: 30rpx;">
|
<view style="text-align: center; margin-bottom: 30rpx; font-size: 30rpx;">
|
||||||
@@ -91,7 +90,7 @@
|
|||||||
<view v-else style="text-align: center; margin-top: 50%; color: white">
|
<view v-else style="text-align: center; margin-top: 50%; color: white">
|
||||||
暂无数据
|
暂无数据
|
||||||
</view>
|
</view>
|
||||||
<!-- </mescroll-uni>-->
|
<!-- </mescroll-uni>-->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -144,10 +143,7 @@ const mescrollRef = ref(null);
|
|||||||
const upOption = ref({
|
const upOption = ref({
|
||||||
page: {num: 0, size: 10},
|
page: {num: 0, size: 10},
|
||||||
noMoreSize: 5,
|
noMoreSize: 5,
|
||||||
empty: {
|
empty: {tip: '~ 空空如也 ~'},
|
||||||
tip: '~ 空空如也 ~',
|
|
||||||
icon: "../../static/images/mescroll-empty.png"
|
|
||||||
},
|
|
||||||
textLoading: '加载中...',
|
textLoading: '加载中...',
|
||||||
textNoMore: '已经到底了'
|
textNoMore: '已经到底了'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ const handleSubmit= async()=>{
|
|||||||
await bizFavoriteSetting({bizIds:bizIds.value.join(",")});
|
await bizFavoriteSetting({bizIds:bizIds.value.join(",")});
|
||||||
showAlert("操作成功")
|
showAlert("操作成功")
|
||||||
hideLoading();
|
hideLoading();
|
||||||
|
uni.navigateBack();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading();
|
hideLoading();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref,onMounted } from 'vue';
|
import { ref,onMounted } from 'vue';
|
||||||
import { onLoad } from '@dcloudio/uni-app';
|
import { onLoad,onShow } from '@dcloudio/uni-app';
|
||||||
import customHeader from '@/components/customHeader.vue'
|
import customHeader from '@/components/customHeader.vue'
|
||||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||||
import customSteps from '@/components/customSteps.vue'
|
import customSteps from '@/components/customSteps.vue'
|
||||||
@@ -185,6 +185,9 @@ onLoad(async(opt) => {
|
|||||||
uni.setStorageSync('page_cache',true);
|
uni.setStorageSync('page_cache',true);
|
||||||
// initLoad();
|
// initLoad();
|
||||||
})
|
})
|
||||||
|
onShow(()=>{
|
||||||
|
initLoad();
|
||||||
|
})
|
||||||
|
|
||||||
// 初始化调用方法
|
// 初始化调用方法
|
||||||
const initLoad =()=>{
|
const initLoad =()=>{
|
||||||
@@ -517,7 +520,7 @@ const formatDateStr =(times)=>{
|
|||||||
margin-top:10rpx;
|
margin-top:10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.white-bg .logo-list{
|
/* .white-bg .logo-list{
|
||||||
margin-left:-25rpx;
|
margin-left:-25rpx;
|
||||||
margin-right:-25rpx;
|
margin-right:-25rpx;
|
||||||
padding:0 20rpx;
|
padding:0 20rpx;
|
||||||
@@ -535,5 +538,5 @@ const formatDateStr =(times)=>{
|
|||||||
.white-bg .logo-list .l-l-item img{
|
.white-bg .logo-list .l-l-item img{
|
||||||
width:110rpx;
|
width:110rpx;
|
||||||
height:110rpx;
|
height:110rpx;
|
||||||
}
|
} */
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ const selectDeviceId = async()=>{
|
|||||||
// 查询本地缓存的设备状态是否绑定过
|
// 查询本地缓存的设备状态是否绑定过
|
||||||
// let deviceId = uni.getStorageSync('app_device_id');// 本地设备ID
|
// let deviceId = uni.getStorageSync('app_device_id');// 本地设备ID
|
||||||
try {
|
try {
|
||||||
|
// showAlert("safeSave=>"+safeSave)
|
||||||
safeSave.getSafeFile({ "key": "app_device_id" }, res2 => {
|
safeSave.getSafeFile({ "key": "app_device_id" }, res2 => {
|
||||||
// showAlert(JSON.stringify(res2));
|
// showAlert(JSON.stringify(res2));
|
||||||
if (res2.code == 1) {
|
if (res2.code == 1) {
|
||||||
@@ -177,7 +178,7 @@ const selectDeviceId = async()=>{
|
|||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("getSafeFile=>",error)
|
console.log("getSafeFile=>",error)
|
||||||
showAlert(error)
|
// showAlert("getSafeFile=>"+error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 下载最新版本
|
// 下载最新版本
|
||||||
|
|||||||
@@ -264,9 +264,9 @@ const submitForm = () => {
|
|||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
//h5测试用 内网-sn123456
|
//h5测试用 内网-sn123456
|
||||||
//公司外网 '9516053c-b441-465b-9781-06e7b8031811'
|
//公司外网 'f3fca83f-bf56-47f4-a98b-a602ed8bddee'
|
||||||
//友晟外网 'b97527c8-2ad4-493c-a01c-5f9d0aabaff2'
|
//友晟外网 'b97527c8-2ad4-493c-a01c-5f9d0aabaff2'
|
||||||
param.uniqCode = 'b97527c8-2ad4-493c-a01c-5f9d0aabaff2';
|
param.uniqCode = 'f3fca83f-bf56-47f4-a98b-a602ed8bddee';
|
||||||
let res = await login(param);
|
let res = await login(param);
|
||||||
userStore.login(res);
|
userStore.login(res);
|
||||||
uni.switchTab({ url: '/pages/home/home' })
|
uni.switchTab({ url: '/pages/home/home' })
|
||||||
@@ -278,10 +278,16 @@ const submitForm = () => {
|
|||||||
// 读取设备ID
|
// 读取设备ID
|
||||||
safeSave.getSafeFile({ "key": "app_device_id" }, res3 => {
|
safeSave.getSafeFile({ "key": "app_device_id" }, res3 => {
|
||||||
if (res3.code == 1) {
|
if (res3.code == 1) {
|
||||||
let deviceId = res3.data;//'b97527c8-2ad4-493c-a01c-5f9d0aabaff2' //
|
let deviceId = res3.data;
|
||||||
// showAlert("读取成功=>"+deviceId);
|
// showAlert("读取成功=>"+deviceId);
|
||||||
param.uniqCode = deviceId;
|
param.uniqCode = deviceId;
|
||||||
|
uni.getPushClientId({
|
||||||
|
success: (res) => {
|
||||||
|
let push_clientid = res.cid
|
||||||
|
console.log('客户端推送标识:', push_clientid);
|
||||||
console.log("param=>",param)
|
console.log("param=>",param)
|
||||||
|
param.cid = push_clientid
|
||||||
|
// showAlert("客户端推送标识=>"+push_clientid);
|
||||||
login(param).then(res=>{
|
login(param).then(res=>{
|
||||||
userStore.login(res);
|
userStore.login(res);
|
||||||
uni.switchTab({ url: '/pages/home/home' })
|
uni.switchTab({ url: '/pages/home/home' })
|
||||||
@@ -289,6 +295,11 @@ const submitForm = () => {
|
|||||||
}).finally(()=>{
|
}).finally(()=>{
|
||||||
btnLoading.value = false;
|
btnLoading.value = false;
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
fail(err) {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// showAlert('读取失败:'+res3.msg)
|
// showAlert('读取失败:'+res3.msg)
|
||||||
|
|||||||
@@ -214,7 +214,8 @@ const getNoticeList = (pageIndex, pageSize) => {
|
|||||||
// 跳转webview
|
// 跳转webview
|
||||||
const handleJump = (item)=>{
|
const handleJump = (item)=>{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/h5-webview/h5-webview?url=' + item.mobileLink+"&title="+item.subject
|
// url: '/pages/h5-webview/h5-webview?url=' + item.mobileLink+"&title="+item.subject
|
||||||
|
url:'/pages/notice/noticeDetail?title='+item.subject+'&time='+item.createTime+'&appName='+item.appName
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
84
src/pages/notice/noticeDetail.vue
Normal file
84
src/pages/notice/noticeDetail.vue
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<template>
|
||||||
|
<view class="con-body">
|
||||||
|
<view class="con-bg">
|
||||||
|
<!-- 头部 -->
|
||||||
|
<customHeader ref="customHeaderRef" :title="'消息通知'" :leftFlag="true" :rightFlag="false"></customHeader>
|
||||||
|
|
||||||
|
<!-- 高度来避免头部遮挡 -->
|
||||||
|
<view class="top-height"></view>
|
||||||
|
|
||||||
|
<!-- 正文内容 -->
|
||||||
|
<view class="white-bg">
|
||||||
|
<view class="n-title">{{ title }}</view>
|
||||||
|
<view class="n-time">
|
||||||
|
<text>来自:{{appName}}</text> {{ time }}
|
||||||
|
</view>
|
||||||
|
<view class="btn-blue" @click="handleJump">跳转详情页</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 底部加高度来避免tabbar遮挡 -->
|
||||||
|
<view class="bottom-height"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted } from 'vue'
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import customHeader from '@/components/customHeader.vue'
|
||||||
|
import {showToast} from '@/utils/message.js'
|
||||||
|
|
||||||
|
// 加载后调用
|
||||||
|
let title = ref(null);
|
||||||
|
let time = ref(null);
|
||||||
|
let appName = ref(null);
|
||||||
|
onLoad((options) => {
|
||||||
|
console.log(options)
|
||||||
|
title.value = options.title;
|
||||||
|
time.value = options.time;
|
||||||
|
appName.value = options.appName
|
||||||
|
})
|
||||||
|
|
||||||
|
// 跳转webview
|
||||||
|
const handleJump = ()=>{
|
||||||
|
showToast('暂不支持跳转');
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.white-bg {
|
||||||
|
width: 650rpx;
|
||||||
|
padding:30rpx 50rpx;
|
||||||
|
height:100vh;
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 8px 8px 0 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
.white-bg .n-title{
|
||||||
|
font-size:40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
padding:20rpx 0 25rpx;
|
||||||
|
text-align: center;
|
||||||
|
border-bottom: 1px solid #BFBFBF;
|
||||||
|
}
|
||||||
|
.white-bg .n-time{
|
||||||
|
text-align: center;
|
||||||
|
color:#919191;
|
||||||
|
font-size:26rpx;
|
||||||
|
padding:20rpx;
|
||||||
|
}
|
||||||
|
.white-bg .n-time text{
|
||||||
|
margin-right:50rpx;
|
||||||
|
}
|
||||||
|
.btn-blue {
|
||||||
|
background-color: #05A3F4;
|
||||||
|
color: #fff;
|
||||||
|
width:380rpx;
|
||||||
|
height:80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
margin:300rpx auto 0;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -59,6 +59,7 @@ import customHeader from '@/components/customHeader.vue'
|
|||||||
import { getNavBarPaddingTop } from '@/utils/system.js'
|
import { getNavBarPaddingTop } from '@/utils/system.js'
|
||||||
import {formatLevel} from '@/utils/status.js'
|
import {formatLevel} from '@/utils/status.js'
|
||||||
import { parseTime } from '@/utils/datetime.js'
|
import { parseTime } from '@/utils/datetime.js'
|
||||||
|
import {showToast} from '@/utils/message.js'
|
||||||
|
|
||||||
|
|
||||||
let detail = ref({})
|
let detail = ref({})
|
||||||
@@ -80,10 +81,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
// 跳转webview
|
// 跳转webview
|
||||||
const handleJump = ()=>{
|
const handleJump = ()=>{
|
||||||
let item = detail.value;
|
showToast('暂不支持跳转');
|
||||||
uni.navigateTo({
|
// let item = detail.value;
|
||||||
url: `/pages/h5-webview/h5-webview?url=${item.mobileLink}&title=${item.subject}`
|
// uni.navigateTo({
|
||||||
});
|
// url: `/pages/h5-webview/h5-webview?url=${item.mobileLink}&title=${item.subject}`
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
6
src/uni_modules/uni-config-center/changelog.md
Normal file
6
src/uni_modules/uni-config-center/changelog.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
## 0.0.3(2022-11-11)
|
||||||
|
- 修复 config 方法获取根节点为数组格式配置时错误的转化为了对象的Bug
|
||||||
|
## 0.0.2(2021-04-16)
|
||||||
|
- 修改插件package信息
|
||||||
|
## 0.0.1(2021-03-15)
|
||||||
|
- 初始化项目
|
||||||
81
src/uni_modules/uni-config-center/package.json
Normal file
81
src/uni_modules/uni-config-center/package.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-config-center",
|
||||||
|
"displayName": "uni-config-center",
|
||||||
|
"version": "0.0.3",
|
||||||
|
"description": "uniCloud 配置中心",
|
||||||
|
"keywords": [
|
||||||
|
"配置",
|
||||||
|
"配置中心"
|
||||||
|
],
|
||||||
|
"repository": "",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "^3.1.0"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "",
|
||||||
|
"type": "unicloud-template-function"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../../scripts/dist"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "u",
|
||||||
|
"app-nvue": "u"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "u",
|
||||||
|
"Android Browser": "u",
|
||||||
|
"微信浏览器(Android)": "u",
|
||||||
|
"QQ浏览器(Android)": "u"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "u",
|
||||||
|
"IE": "u",
|
||||||
|
"Edge": "u",
|
||||||
|
"Firefox": "u",
|
||||||
|
"Safari": "u"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "u",
|
||||||
|
"阿里": "u",
|
||||||
|
"百度": "u",
|
||||||
|
"字节跳动": "u",
|
||||||
|
"QQ": "u"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "u"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
93
src/uni_modules/uni-config-center/readme.md
Normal file
93
src/uni_modules/uni-config-center/readme.md
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
# 为什么使用uni-config-center
|
||||||
|
|
||||||
|
实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cloudfunctions
|
||||||
|
└─────common 公共模块
|
||||||
|
├─plugin-a // 插件A对应的目录
|
||||||
|
│ ├─index.js
|
||||||
|
│ ├─config.json // plugin-a对应的配置文件
|
||||||
|
│ └─other-file.cert // plugin-a依赖的其他文件
|
||||||
|
└─plugin-b // plugin-b对应的目录
|
||||||
|
├─index.js
|
||||||
|
└─config.json // plugin-b对应的配置文件
|
||||||
|
```
|
||||||
|
|
||||||
|
假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
|
||||||
|
|
||||||
|
uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cloudfunctions
|
||||||
|
└─────common 公共模块
|
||||||
|
├─plugin-a // 插件A对应的目录
|
||||||
|
│ └─index.js
|
||||||
|
├─plugin-b // plugin-b对应的目录
|
||||||
|
│ └─index.js
|
||||||
|
└─uni-config-center
|
||||||
|
├─index.js // config-center入口文件
|
||||||
|
├─plugin-a
|
||||||
|
│ ├─config.json // plugin-a对应的配置文件
|
||||||
|
│ └─other-file.cert // plugin-a依赖的其他文件
|
||||||
|
└─plugin-b
|
||||||
|
└─config.json // plugin-b对应的配置文件
|
||||||
|
```
|
||||||
|
|
||||||
|
使用uni-config-center后的优势
|
||||||
|
|
||||||
|
- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
|
||||||
|
- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持)
|
||||||
|
|
||||||
|
# 用法
|
||||||
|
|
||||||
|
在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
|
||||||
|
|
||||||
|
```js
|
||||||
|
const createConfig = require('uni-config-center')
|
||||||
|
|
||||||
|
const uniIdConfig = createConfig({
|
||||||
|
pluginId: 'uni-id', // 插件id
|
||||||
|
defaultConfig: { // 默认配置
|
||||||
|
tokenExpiresIn: 7200,
|
||||||
|
tokenExpiresThreshold: 600,
|
||||||
|
},
|
||||||
|
customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
|
||||||
|
// defaudltConfig 默认配置
|
||||||
|
// userConfig 用户配置
|
||||||
|
return Object.assign(defaultConfig, userConfig)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 以如下配置为例
|
||||||
|
// {
|
||||||
|
// "tokenExpiresIn": 7200,
|
||||||
|
// "passwordErrorLimit": 6,
|
||||||
|
// "bindTokenToDevice": false,
|
||||||
|
// "passwordErrorRetryTime": 3600,
|
||||||
|
// "app-plus": {
|
||||||
|
// "tokenExpiresIn": 2592000
|
||||||
|
// },
|
||||||
|
// "service": {
|
||||||
|
// "sms": {
|
||||||
|
// "codeExpiresIn": 300
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 获取配置
|
||||||
|
uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象
|
||||||
|
uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200
|
||||||
|
uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300
|
||||||
|
uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600
|
||||||
|
|
||||||
|
// 获取文件绝对路径
|
||||||
|
uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
|
||||||
|
|
||||||
|
// 引用文件(require)
|
||||||
|
uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。
|
||||||
|
|
||||||
|
// 判断是否包含某文件
|
||||||
|
uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在
|
||||||
|
```
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "uni-config-center",
|
||||||
|
"version": "0.0.3",
|
||||||
|
"description": "配置中心",
|
||||||
|
"main": "index.js",
|
||||||
|
"keywords": [],
|
||||||
|
"author": "DCloud",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"origin-plugin-dev-name": "uni-config-center",
|
||||||
|
"origin-plugin-version": "0.0.3",
|
||||||
|
"plugin-dev-name": "uni-config-center",
|
||||||
|
"plugin-version": "0.0.3"
|
||||||
|
}
|
||||||
36
src/uni_modules/uni-id-common/changelog.md
Normal file
36
src/uni_modules/uni-id-common/changelog.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
## 1.0.18(2024-07-08)
|
||||||
|
- checkToken时如果传入的token为空则返回uni-id-check-token-failed错误码以便uniIdRouter能正常跳转
|
||||||
|
## 1.0.17(2024-04-26)
|
||||||
|
- 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios)
|
||||||
|
## 1.0.16(2023-04-25)
|
||||||
|
- 新增maxTokenLength配置,用于限制数据库用户记录token数组的最大长度
|
||||||
|
## 1.0.15(2023-04-06)
|
||||||
|
- 修复部分语言国际化出错的Bug
|
||||||
|
## 1.0.14(2023-03-07)
|
||||||
|
- 修复 admin用户包含其他角色时未包含在token的Bug
|
||||||
|
## 1.0.13(2022-07-21)
|
||||||
|
- 修复 创建token时未传角色权限信息生成的token不正确的bug
|
||||||
|
## 1.0.12(2022-07-15)
|
||||||
|
- 提升与旧版本uni-id的兼容性(补充读取配置文件时回退平台app-plus、h5),但是仍推荐使用新平台名进行配置(app、web)
|
||||||
|
## 1.0.11(2022-07-14)
|
||||||
|
- 修复 部分情况下报`read property 'reduce' of undefined`的错误
|
||||||
|
## 1.0.10(2022-07-11)
|
||||||
|
- 将token存储在用户表的token字段内,与旧版本uni-id保持一致
|
||||||
|
## 1.0.9(2022-07-01)
|
||||||
|
- checkToken兼容token内未缓存角色权限的情况,此时将查库获取角色权限
|
||||||
|
## 1.0.8(2022-07-01)
|
||||||
|
- 修复clientDB默认依赖时部分情况下获取不到uni-id配置的Bug
|
||||||
|
## 1.0.7(2022-06-30)
|
||||||
|
- 修复config文件不合法时未抛出具体错误的Bug
|
||||||
|
## 1.0.6(2022-06-28)
|
||||||
|
- 移除插件内的数据表schema
|
||||||
|
## 1.0.5(2022-06-27)
|
||||||
|
- 修复使用多应用配置时报`Cannot read property 'appId' of undefined`的Bug
|
||||||
|
## 1.0.4(2022-06-27)
|
||||||
|
- 修复使用自定义token内容功能报错的Bug [详情](https://ask.dcloud.net.cn/question/147945)
|
||||||
|
## 1.0.2(2022-06-23)
|
||||||
|
- 对齐旧版本uni-id默认配置
|
||||||
|
## 1.0.1(2022-06-22)
|
||||||
|
- 补充对uni-config-center的依赖
|
||||||
|
## 1.0.0(2022-06-21)
|
||||||
|
- 提供uni-id token创建、校验、刷新接口,简化旧版uni-id公共模块
|
||||||
84
src/uni_modules/uni-id-common/package.json
Normal file
84
src/uni_modules/uni-id-common/package.json
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-id-common",
|
||||||
|
"displayName": "uni-id-common",
|
||||||
|
"version": "1.0.18",
|
||||||
|
"description": "包含uni-id token生成、校验、刷新功能的云函数公共模块",
|
||||||
|
"keywords": [
|
||||||
|
"uni-id-common",
|
||||||
|
"uniCloud",
|
||||||
|
"token",
|
||||||
|
"权限"
|
||||||
|
],
|
||||||
|
"repository": "https://gitcode.net/dcloud/uni-id-common",
|
||||||
|
"engines": {
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": 0
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "",
|
||||||
|
"type": "unicloud-template-function"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": ["uni-config-center"],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y",
|
||||||
|
"alipay": "n"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "u",
|
||||||
|
"vue3": "u"
|
||||||
|
},
|
||||||
|
"App": {
|
||||||
|
"app-vue": "u",
|
||||||
|
"app-nvue": "u"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "u",
|
||||||
|
"Android Browser": "u",
|
||||||
|
"微信浏览器(Android)": "u",
|
||||||
|
"QQ浏览器(Android)": "u"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "u",
|
||||||
|
"IE": "u",
|
||||||
|
"Edge": "u",
|
||||||
|
"Firefox": "u",
|
||||||
|
"Safari": "u"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "u",
|
||||||
|
"阿里": "u",
|
||||||
|
"百度": "u",
|
||||||
|
"字节跳动": "u",
|
||||||
|
"QQ": "u",
|
||||||
|
"钉钉": "u",
|
||||||
|
"快手": "u",
|
||||||
|
"飞书": "u",
|
||||||
|
"京东": "u"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
src/uni_modules/uni-id-common/readme.md
Normal file
3
src/uni_modules/uni-id-common/readme.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# uni-id-common
|
||||||
|
|
||||||
|
文档请参考:[uni-id-common](https://uniapp.dcloud.net.cn/uniCloud/uni-id-common.html)
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "uni-id-common",
|
||||||
|
"version": "1.0.18",
|
||||||
|
"description": "uni-id token生成、校验、刷新",
|
||||||
|
"main": "index.js",
|
||||||
|
"homepage": "https:\/\/uniapp.dcloud.io\/uniCloud\/uni-id-common.html",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https:\/\/gitee.com\/dcloud\/uni-id-common.git"
|
||||||
|
},
|
||||||
|
"author": "DCloud",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"uni-config-center": "file:..\/..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center"
|
||||||
|
},
|
||||||
|
"origin-plugin-dev-name": "uni-id-common",
|
||||||
|
"origin-plugin-version": "1.0.18",
|
||||||
|
"plugin-dev-name": "uni-id-common",
|
||||||
|
"plugin-version": "1.0.18"
|
||||||
|
}
|
||||||
@@ -13,7 +13,7 @@ const requestHooks = {
|
|||||||
requestInterceptorsHook(options, config) {
|
requestInterceptorsHook(options, config) {
|
||||||
// console.log("request=>config=>",config)
|
// console.log("request=>config=>",config)
|
||||||
const { urlPrefix, baseUrl, withToken, isAuth } = config;
|
const { urlPrefix, baseUrl, withToken, isAuth } = config;
|
||||||
options.header = options.header ?? {};
|
options.header = options.header ? options.header:{};
|
||||||
if (urlPrefix) {
|
if (urlPrefix) {
|
||||||
options.url = `${urlPrefix}${options.url}`;
|
options.url = `${urlPrefix}${options.url}`;
|
||||||
}
|
}
|
||||||
@@ -33,20 +33,19 @@ const requestHooks = {
|
|||||||
// console.log("response=>",response)
|
// console.log("response=>",response)
|
||||||
// console.log("response=>config=>",config)
|
// console.log("response=>config=>",config)
|
||||||
const { isTransformResponse, isReturnDefaultResponse, isAuth } = config;
|
const { isTransformResponse, isReturnDefaultResponse, isAuth } = config;
|
||||||
|
|
||||||
if (isReturnDefaultResponse) {
|
if (isReturnDefaultResponse) {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
if (!isTransformResponse) {
|
|
||||||
return response.data;
|
|
||||||
}
|
|
||||||
// const { logout, isLogin } = useUserStore();
|
// const { logout, isLogin } = useUserStore();
|
||||||
const { code, data, msg, show } = response.data;
|
const { code, data, msg, show } = response.data;
|
||||||
// console.log(code,data,msg,show)
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case RequestCodeEnum.SUCCESS:
|
case RequestCodeEnum.SUCCESS:
|
||||||
msg && show && message.toast(msg);
|
msg && show && message.toast(msg);
|
||||||
|
if (!isTransformResponse) {
|
||||||
|
return response.data;
|
||||||
|
}else{
|
||||||
return data;
|
return data;
|
||||||
|
}
|
||||||
case RequestCodeEnum.FAILED:
|
case RequestCodeEnum.FAILED:
|
||||||
message.toast(msg);
|
message.toast(msg);
|
||||||
return Promise.reject(msg);
|
return Promise.reject(msg);
|
||||||
@@ -61,7 +60,10 @@ const requestHooks = {
|
|||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if(msg)
|
||||||
message.alert(msg)
|
message.alert(msg)
|
||||||
|
else
|
||||||
|
message.alert("网络连接失败,请稍后再试!")
|
||||||
// return data;
|
// return data;
|
||||||
return Promise.reject(msg);
|
return Promise.reject(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
46
uniCloud-aliyun/cloudfunctions/testUnipush2/index.js
Normal file
46
uniCloud-aliyun/cloudfunctions/testUnipush2/index.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
// 'use strict';
|
||||||
|
// const uniPush = uniCloud.getPushManager({appId:"__UNI__4C459F4"}) //注意这里需要传入你的应用appId
|
||||||
|
// exports.main = async (event) => {
|
||||||
|
// console.log(event)
|
||||||
|
// if(event.cid){
|
||||||
|
// let obj = JSON.parse(event.body);
|
||||||
|
// console.log(obj)
|
||||||
|
// const res = await uniPush.sendMessage({
|
||||||
|
// "push_clientid": obj.cids, // 设备id,支持多个以数组的形式指定多个设备,如["cid-1","cid-2"],数组长度不大于1000
|
||||||
|
// "title": obj.title, // 标题
|
||||||
|
// "content": obj.content, // 内容
|
||||||
|
// "settings": obj.settings, // 消息有效期
|
||||||
|
// "payload": obj.payload, // 数据
|
||||||
|
// "category": obj.category, // HarmonyOS NEXT系统(纯血鸿蒙、非安卓鸿蒙)的消息分类,要给鸿蒙设备推送时才必传
|
||||||
|
// "force_notification": true, //填写true,客户端就会对在线消息自动创建“通知栏消息”,不填写则需要客户端自己处理。
|
||||||
|
// "request_id": obj.request_id ,//请求唯一标识号,10-32位之间;如果request_id重复,会导致消息丢失
|
||||||
|
// "options":obj.options //消息分类,没申请可以不传这个参数
|
||||||
|
// })
|
||||||
|
// return res;
|
||||||
|
// }
|
||||||
|
// return {}
|
||||||
|
// };
|
||||||
|
|
||||||
|
// 简单的使用示例 appId: "__UNI__4C459F4"
|
||||||
|
'use strict';
|
||||||
|
const uniPush = uniCloud.getPushManager({
|
||||||
|
appId: "__UNI__0B682E1"
|
||||||
|
})
|
||||||
|
exports.main = async (event) => {
|
||||||
|
console.log(event)
|
||||||
|
let obj = JSON.parse(event.body)
|
||||||
|
const res = await uniPush.sendMessage({
|
||||||
|
"push_clientid": obj.cids, // 设备id,支持多个以数组的形式指定多个设备,如["cid-1","cid-2"],数组长度不大于1000
|
||||||
|
"title": obj.title, // 标题
|
||||||
|
"content": obj.content, // 内容
|
||||||
|
"settings": obj.settings, // 消息有效期
|
||||||
|
"payload": obj.payload, // 数据
|
||||||
|
"category": obj.category, // HarmonyOS NEXT系统(纯血鸿蒙、非安卓鸿蒙)的消息分类,要给鸿蒙设备推送时才必传
|
||||||
|
"force_notification": true, //填写true,客户端就会对在线消息自动创建“通知栏消息”,不填写则需要客户端自己处理。
|
||||||
|
"request_id": obj.request_id ,//请求唯一标识号,10-32位之间;如果request_id重复,会导致消息丢失
|
||||||
|
"options":obj.options //消息分类,没申请可以不传这个参数
|
||||||
|
})
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
|
||||||
7
uniCloud-aliyun/cloudfunctions/testUnipush2/package.json
Normal file
7
uniCloud-aliyun/cloudfunctions/testUnipush2/package.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "testUnipush2",
|
||||||
|
"dependencies": {},
|
||||||
|
"extensions": {
|
||||||
|
"uni-cloud-push": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
uniCloud-aliyun/database/JQL查询.jql
Normal file
12
uniCloud-aliyun/database/JQL查询.jql
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理
|
||||||
|
// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法
|
||||||
|
// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码
|
||||||
|
// 如果文档中存在多条JQL语句,只有最后一条语句生效
|
||||||
|
// 如果混写了普通js,最后一条语句需是数据库操作语句
|
||||||
|
// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission
|
||||||
|
// 不支持clientDB的action
|
||||||
|
// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#limit
|
||||||
|
// 详细JQL语法,请参考:https://uniapp.dcloud.net.cn/uniCloud/jql.html
|
||||||
|
|
||||||
|
// 下面示例查询uni-id-users表的所有数据
|
||||||
|
db.collection('uni-id-users').get();
|
||||||
Reference in New Issue
Block a user