diff --git a/pages.json b/pages.json
index 95bdc89..a73f226 100644
--- a/pages.json
+++ b/pages.json
@@ -16,7 +16,8 @@
"style": {
"navigationBarTitleText": "智控管家",
"navigationBarBackgroundColor": "#2671E2",
- "navigationBarTextStyle": "white"
+ "navigationBarTextStyle": "white",
+ "enablePullDownRefresh":true
}
},
{
@@ -31,7 +32,8 @@
"style": {
"navigationBarTitleText": "学习",
"navigationBarBackgroundColor": "#2671E2",
- "navigationBarTextStyle": "white"
+ "navigationBarTextStyle": "white",
+ "enablePullDownRefresh":true
}
},{
"path": "pages/index/personal",
@@ -196,7 +198,8 @@
"style": {
"navigationBarTitleText": "值班顾问",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -204,7 +207,8 @@
"style": {
"navigationBarTitleText": "设备管理",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -226,6 +230,36 @@
}
}
+ ,{
+ "path" : "registerCode",
+ "style" :
+ {
+ "navigationBarTitleText": "访客登记码",
+ "navigationBarBackgroundColor": "#2671E2",
+ "navigationBarTextStyle": "white"
+ }
+
+ }
+ ,{
+ "path" : "registerForm",
+ "style" :
+ {
+ "navigationBarTitleText": "访客登记表",
+ "navigationBarBackgroundColor": "#2671E2",
+ "navigationBarTextStyle": "white"
+ }
+
+ },
+ {
+ "path" : "registerResult",
+ "style" :
+ {
+ "navigationBarTitleText": "访客登记表",
+ "navigationBarBackgroundColor": "#2671E2",
+ "navigationBarTextStyle": "white"
+ }
+
+ }
]
},
{
@@ -269,7 +303,8 @@
"style": {
"navigationBarTitleText": "分点学习",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -301,7 +336,8 @@
"style": {
"navigationBarTitleText": "销讲数据",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -309,7 +345,8 @@
"style": {
"navigationBarTitleText": "集团对比",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -317,7 +354,8 @@
"style": {
"navigationBarTitleText": "团队对比",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -341,7 +379,8 @@
"style": {
"navigationBarTitleText": "客户画像",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -349,7 +388,8 @@
"style": {
"navigationBarTitleText": "趋势分析",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -357,7 +397,8 @@
"style": {
"navigationBarTitleText": "员工分析",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
@@ -390,7 +431,8 @@
"style": {
"navigationBarTitleText": "顾问排名",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
@@ -399,7 +441,8 @@
"style": {
"navigationBarTitleText": "接待记录",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -415,7 +458,8 @@
"style": {
"navigationBarTitleText": "违禁记录",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
@@ -423,7 +467,8 @@
"style": {
"navigationBarTitleText": "客户管理",
"navigationBarBackgroundColor": "#FFFFFF",
- "navigationBarTextStyle": "black"
+ "navigationBarTextStyle": "black",
+ "enablePullDownRefresh":true
}
},
{
diff --git a/pages/center/Piabodata/Employeesstatistics.vue b/pages/center/Piabodata/Employeesstatistics.vue
index 9c554ae..47e1e1c 100644
--- a/pages/center/Piabodata/Employeesstatistics.vue
+++ b/pages/center/Piabodata/Employeesstatistics.vue
@@ -201,6 +201,12 @@
this.houseId = uni.getStorageSync('buildingID').id;
this.init()
},
+ onPullDownRefresh() {
+ this.init()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
methods: {
init(){
this.newlisttabinfo1={
diff --git a/pages/center/Piabodata/Groupcontrast.vue b/pages/center/Piabodata/Groupcontrast.vue
index 42e77bd..26d0b3e 100644
--- a/pages/center/Piabodata/Groupcontrast.vue
+++ b/pages/center/Piabodata/Groupcontrast.vue
@@ -300,6 +300,19 @@
this.getSectionList()
+ },
+ onPullDownRefresh(){
+ let that=this
+ uni.$on('updateGroup',function(data){
+ console.log(data)
+ that.houseId=data.arr.join(',')
+ // 获取销奖能力
+ that.getPowerList()
+ })
+ this.getSectionList()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
},
methods: {
// 获取部门列表
diff --git a/pages/center/Piabodata/StaffAnalysis.vue b/pages/center/Piabodata/StaffAnalysis.vue
index b4eecfa..372f59d 100644
--- a/pages/center/Piabodata/StaffAnalysis.vue
+++ b/pages/center/Piabodata/StaffAnalysis.vue
@@ -242,6 +242,12 @@
// 请求接口获取所有置业顾问员工的列表
this.getStaffList()
},
+ onPullDownRefresh() {
+ this.getStaffList()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
methods: {
//是否对比
checkboxChange(){
diff --git a/pages/center/Piabodata/Theteamcompared.vue b/pages/center/Piabodata/Theteamcompared.vue
index 04cad0e..fee1539 100644
--- a/pages/center/Piabodata/Theteamcompared.vue
+++ b/pages/center/Piabodata/Theteamcompared.vue
@@ -471,6 +471,23 @@
this.getSectionList()
},
+ onPullDownRefresh() {
+ let that=this
+ uni.$on('update',function(data){
+ // console.log(data)
+ that.deptids=data.arr.join(',')
+ // 获取销奖能力
+ that.getPowerList()
+ })
+ // 获取项目id
+ this.houseId = uni.getStorageSync('buildingID').id;
+ // this.buildingname = uni.getStorageSync('buildingID').name;
+ // 请求接口获取所有置业顾问员工的列表
+ this.getSectionList()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
methods: {
//是否对比
checkboxChange(){
diff --git a/pages/center/Piabodata/TrendAnalysis.vue b/pages/center/Piabodata/TrendAnalysis.vue
index fd2541f..717147f 100644
--- a/pages/center/Piabodata/TrendAnalysis.vue
+++ b/pages/center/Piabodata/TrendAnalysis.vue
@@ -322,6 +322,12 @@
this.pamect.houseId = uni.getStorageSync('buildingID').id;
this.init()
},
+ onPullDownRefresh() {
+ this.init()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
watch: {
Showhiddenunits(newValue, oldValue) {
this.showCanvas = !newValue
diff --git a/pages/center/Piabodata/Userinsightinto.vue b/pages/center/Piabodata/Userinsightinto.vue
index 51e4818..2fad9ce 100644
--- a/pages/center/Piabodata/Userinsightinto.vue
+++ b/pages/center/Piabodata/Userinsightinto.vue
@@ -106,6 +106,12 @@
this.buildingID=uni.getStorageSync('buildingID').id;
this.gitinit()
},
+ onPullDownRefresh() {
+ this.gitinit()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
methods: {
anclick(i){
console.log(i)
diff --git a/pages/center/Piabodata/index.vue b/pages/center/Piabodata/index.vue
index a74946b..ca8a579 100644
--- a/pages/center/Piabodata/index.vue
+++ b/pages/center/Piabodata/index.vue
@@ -336,6 +336,23 @@
// 获取维度
this.getindexZxl()
},
+ onPullDownRefresh(){
+ // 获取员工
+ this.getStaffList()
+ // 获取团队
+ this.getSectionList()
+ // 获取团队是否显示权限
+
+ // 获取简报
+ this.getReport()
+ // 获取接待趋势
+ this.getRtrent()
+ // 获取维度
+ this.getindexZxl()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
methods: {
queryHaveDept() {
return new Promise((resolve, reject) => {
diff --git a/pages/center/consumer/index.vue b/pages/center/consumer/index.vue
index e98a168..ce04de8 100644
--- a/pages/center/consumer/index.vue
+++ b/pages/center/consumer/index.vue
@@ -26,7 +26,9 @@
更多筛选
-
+
+ 筛选结果:{{totalRecords}} 条
+
@@ -148,7 +150,13 @@
到访次数
-
+
+
+ {{item.label}}
+
+
+
+
+ 筛选结果:{{totalRecords}} 条
+
@@ -93,8 +96,9 @@
timeshow:false,
soltishow:false,
orderBy:'',
- userInfo:{}
-
+ userInfo:{},
+ totalRecords:'',
+ isRefresh:false
}
},
onLoad(options) {
@@ -113,6 +117,7 @@
this.buildingID = uni.getStorageSync('buildingID').id;
this.recordList=[];
this.nextPage=1;
+ this.isRefresh = false;
this.getMyCustom()
this.getFreeList();
this.isnorefresh='';
@@ -121,6 +126,14 @@
pages[0].$vm.path='/pages/index/index'
console.log(pages[0].$vm.path)
},
+ onPullDownRefresh(){
+ this.nextPage=1;
+ this.isRefresh = true;
+ this.getMyCustom()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
onReachBottom() {
if(this.totalRecord==this.nextPage){
uni.showToast({
@@ -131,6 +144,7 @@
return
}else{
this.nextPage+=1;
+ this.isRefresh = false;
this.getMyCustom();
}
},
@@ -147,6 +161,7 @@
this.orderBy=e[0].value;
this.nextPage=1;
this.recordList=[];
+ this.isRefresh = false;
this.getMyCustom();
},
//时间选择
@@ -160,6 +175,7 @@
this.endtime='';
this.nextPage=1;
this.recordList=[];
+ this.isRefresh = false;
this.getMyCustom();
}
},
@@ -170,6 +186,7 @@
this.activeTotal=4;
this.nextPage=1;
this.recordList=[];
+ this.isRefresh = false;
this.getMyCustom();
},
tapThevisiting(item) {
@@ -254,8 +271,13 @@
this.$u.post("/customer/findbypage", parames).then(data => {
var list = data.results || [];
- this.recordList = [...this.recordList, ...list];
+ if(this.isRefresh){
+ this.recordList = list;
+ }else{
+ this.recordList = [...this.recordList, ...list];
+ }
this.totalRecord=data.totalPage;
+ this.totalRecords = data.totalRecord;
})
},
//获取顾问列表
@@ -274,6 +296,7 @@
this.recordList=[];
this.nextPage=1;
this.selectshow=false;
+ this.isRefresh = false;
this.getMyCustom();
},
@@ -291,6 +314,18 @@
height: 100%;
background: #F8F8F8;
}
+ .count {
+ width: 100%;
+ height: 90rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: #FBE4E4;
+
+ text {
+ color: #F71616;
+ }
+ }
.timeview{
height: 80rpx;
line-height: 80rpx;
diff --git a/pages/center/records/index.vue b/pages/center/records/index.vue
index 2d2298d..9172663 100644
--- a/pages/center/records/index.vue
+++ b/pages/center/records/index.vue
@@ -27,6 +27,9 @@
更多筛选
+
+ 筛选结果:{{totalRecords}} 条
+
@@ -131,7 +134,13 @@
到访次数
-
+
+
+ {{item.label}}
+
+
+
+
+
+
+ 访客登记码
+
+
+
+
+
@@ -101,6 +110,11 @@
this.mobile = userInfos.loginName
},
methods: {
+ scan(){
+ uni.navigateTo({
+ url:"../mine/registerCode"
+ })
+ },
//拨打电话
phone() {
wx.makePhoneCall({
diff --git a/pages/learning/Equinoctiallearning.vue b/pages/learning/Equinoctiallearning.vue
index 04ccbc2..cd4756e 100644
--- a/pages/learning/Equinoctiallearning.vue
+++ b/pages/learning/Equinoctiallearning.vue
@@ -38,6 +38,12 @@
this.biaoqian=options.biaoqian
this.ceninit()
},
+ onPullDownRefresh() {
+ this.ceninit()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
methods: {
quclick(item) {
uni.showLoading({
diff --git a/pages/mine/consultanonduty/index.vue b/pages/mine/consultanonduty/index.vue
index baa13ff..96796ac 100644
--- a/pages/mine/consultanonduty/index.vue
+++ b/pages/mine/consultanonduty/index.vue
@@ -67,6 +67,13 @@
this.changeAgentListShow()
this.changePausedAgentListShow()
},
+ onPullDownRefresh() {
+ this.changeAgentListShow()
+ this.changePausedAgentListShow()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
computed: {
activeAgentList() {
return this.activeTotal == 1 ? this.agentList : this.pausedAgentList
diff --git a/pages/mine/equipment/index.vue b/pages/mine/equipment/index.vue
index bfbcb37..181bdb0 100644
--- a/pages/mine/equipment/index.vue
+++ b/pages/mine/equipment/index.vue
@@ -1,9 +1,9 @@
-
+
-
+
-
+
-
-
+
+
@@ -28,29 +28,23 @@
- 电量:
+ 电量:
{{item.electricity}}%
{{item.electricity}}%
-
+
-
-
-
-
-
-
+
+
+
+
+
+
信号:0
信号:{{item.signalDevice}}
-
+
设备编号
@@ -59,12 +53,15 @@
录音状态
关闭
- 开启
- 关闭
+ 开启
+ 关闭
待上传
-
+
{{ item.fileCount }}条
@@ -94,7 +91,8 @@
export default {
data() {
return {
- tablist: [{
+ tablist: [
+ {
name: "全部(0)",
},
{
@@ -111,29 +109,35 @@
}
],
activeClass: 0,
- pageNum: 1,
- pageSize: 20,
- imei: "",
- orgcode: "",
- newListdata: [],
- buildingID: '',
- jump: ''
+ pageNum:1,
+ pageSize:20,
+ imei:"",
+ orgcode:"",
+ newListdata:[],
+ buildingID:'',
+ jump:''
};
},
onReachBottom() {
- this.pageNum += 1;
+ this.pageNum +=1;
this.init()
},
+ onPullDownRefresh(){
+ this.init()
+ setTimeout(function () {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
onLoad(options) {
- if (options.active) {
- this.activeClass = options.active
- } else {
- this.activeClass = 0
+ if(options.active){
+ this.activeClass=options.active
+ }else{
+ this.activeClass=0
}
- this.newListdata = []
- this.pageNum = 1;
- this.pageSize = 20;
- this.init()
+ this.newListdata=[]
+ this.pageNum=1;
+ this.pageSize=20;
+ this.init()
},
filters: {
formatDate: (dateTimeStamp) => {
@@ -143,114 +147,113 @@
var day = hour * 24;
var halfamonth = day * 15;
var month = day * 30;
- var now = new Date().getTime();
+ var now = new Date().getTime();
var diffValue = now - newDate;
- if (diffValue < 0) {
- return;
- }
- var monthC = diffValue / month;
- var weekC = diffValue / (7 * day);
- var dayC = diffValue / day;
- var hourC = diffValue / hour;
- var minC = diffValue / minute;
+ if(diffValue < 0){return;}
+ var monthC =diffValue/month;
+ var weekC =diffValue/(7*day);
+ var dayC =diffValue/day;
+ var hourC =diffValue/hour;
+ var minC =diffValue/minute;
var result = '';
- if (weekC >= 1) {
- result = "1周前";
- } else if (dayC >= 1) {
- result = "" + parseInt(dayC) + "天前";
- } else if (hourC >= 1) {
- result = "" + parseInt(hourC) + "小时前";
- } else if (minC >= 1) {
- result = "" + parseInt(minC) + "分钟前";
- } else {
- result = "刚刚";
+ if(weekC>=1){
+ result= "1周前";
+ }else if(dayC>=1){
+ result=""+ parseInt(dayC) +"天前";
+ } else if(hourC>=1){
+ result=""+ parseInt(hourC) +"小时前";
+ }
+ else if(minC>=1){
+ result=""+ parseInt(minC) +"分钟前";
+ }else{
+ result="刚刚";
}
return result;
}
},
methods: {
- shecs() {
- this.newListdata = []
- this.pageNum = 1;
- this.pageSize = 20;
- this.init()
+ shecs(){
+ this.newListdata=[]
+ this.pageNum=1;
+ this.pageSize=20;
+ this.init()
},
// tab
clocktab(index) {
- this.activeClass = index;
- this.newListdata = []
- this.pageNum = 1;
- this.pageSize = 20;
+ this.activeClass=index;
+ this.newListdata=[]
+ this.pageNum=1;
+ this.pageSize=20;
this.init()
},
- init() {
- this.buildingID = uni.getStorageSync('buildingID').id;
+ init(){
+ this.buildingID=uni.getStorageSync('buildingID').id;
const parames = {
pageNum: this.pageNum,
pageSize: this.pageSize,
- query: {
- imei: this.imei,
- onLine: this.activeClass,
- propertyId: this.buildingID,
- orderType: 1
+ query:{
+ imei:this.imei,
+ onLine:this.activeClass,
+ propertyId:this.buildingID,
+ orderType:1
}
}
-
- if (this.activeClass == 0) {
- parames.query.onLine = null
+
+ if(this.activeClass==0){
+ parames.query.onLine=null
}
this.$u.post("/equipment/apiFindByPage", parames).then(res => {
- this.tablist[0].name = "全部(" + res.allCount + ")";
- this.tablist[1].name = "在线(" + res.eqOnLineCount + ")";
- this.tablist[2].name = "低电量(" + res.lowElectricityCount + ")";
- this.tablist[3].name = "今日活跃(" + res.activeCount + ")";
- this.tablist[4].name = "离线(" + res.eqOffLineCount + ")";
- if (res.obj.list.results == null) {
- if (this.pageNum == 1) {
+ this.tablist[0].name="全部("+res.allCount+")";
+ this.tablist[1].name="在线("+res.eqOnLineCount+")";
+ this.tablist[2].name="低电量("+res.lowElectricityCount+")";
+ this.tablist[3].name="今日活跃("+res.activeCount+")";
+ this.tablist[4].name="离线("+res.eqOffLineCount+")";
+ if(res.obj.list.results==null){
+ if (this.pageNum == 1){
return
- } else {
+ }else{
uni.showToast({
- title: '已经到底了!',
- duration: 2000
+ title: '已经到底了!',
+ duration: 2000
});
}
- } else {
- res.obj.list.results.forEach(item => {
- if (item.onLine == 0) {
- item.signalDevice = 0
+ }else{
+ res.obj.list.results.forEach(item=>{
+ if(item.onLine==0){
+ item.signalDevice=0
}
-
- if (item.electricity == '') {
- item.electricity = 0
+
+ if(item.electricity==''){
+ item.electricity=0
}
- if (item.electricity > 100) {
- item.electricity = 100
+ if(item.electricity>100){
+ item.electricity=100
}
- let num = this.ascformatDate(item.updateTime)
- if (num > 12) {
- item.electricity = 0
+ let num=this.ascformatDate(item.updateTime)
+ if(num>12){
+ item.electricity=0
}
-
+
})
-
+
if (this.pageNum == 1) {
- this.newListdata = res.obj.list.results
+ this.newListdata=res.obj.list.results
} else {
- this.newListdata = [...this.newListdata, ...res.obj.list.results];
+ this.newListdata = [...this.newListdata, ...res.obj.list.results];
}
}
})
},
- ascformatDate(dateTimeStamp) {
+ ascformatDate(dateTimeStamp){
let newDate = new Date(dateTimeStamp.replace(/-/g, '/')).getTime();
let minute = 1000 * 60;
let hour = minute * 60;
let day = hour * 24;
let halfamonth = day * 15;
let month = day * 30;
- let now = new Date().getTime();
+ let now = new Date().getTime();
let diffValue = now - newDate;
- let result = diffValue / hour;
+ let result =diffValue/hour;
return result;
}
},
@@ -375,7 +378,6 @@
background-color: #333333;
}
}
-
.you11 {
width: 20rpx;
height: 28rpx;
@@ -384,7 +386,7 @@
background-size: 100% 100%;
display: flex;
flex-direction: column-reverse;
-
+
.youimg {
width: 100%;
background-color: red;
@@ -399,7 +401,6 @@
color: #333333;
margin-left: 6rpx;
}
-
.you22 {
width: 114rpx;
height: 30rpx;
@@ -456,7 +457,7 @@
font-size: 24rpx;
color: #333333;
text-indent: 30rpx;
-
+
.stayupload {
color: #F41313;
}
diff --git a/pages/mine/registerCode.vue b/pages/mine/registerCode.vue
new file mode 100644
index 0000000..64b4c17
--- /dev/null
+++ b/pages/mine/registerCode.vue
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+ 保存图片到手机
+
+
+
+
+
+
+
diff --git a/pages/mine/registerForm.vue b/pages/mine/registerForm.vue
new file mode 100644
index 0000000..58f508d
--- /dev/null
+++ b/pages/mine/registerForm.vue
@@ -0,0 +1,327 @@
+
+
+
+
+ 姓名
+
+
+
+
+
+
+
+
+
+
+
+
+ 性别
+
+ 男士
+ 女士
+
+
+
+
+ 到访人数
+
+
+ {{i + 1}}
+
+
+
+
+
+ 到访途径
+
+
+ {{parames.sourceName}}
+ 请选择客户来源
+
+
+
+
+
+
+
+
+
+ 提交1
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/mine/registerResult.vue b/pages/mine/registerResult.vue
new file mode 100644
index 0000000..5b45d56
--- /dev/null
+++ b/pages/mine/registerResult.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+ 提交成功
+
+
+
+
+
+
+
diff --git a/sdk/WXBizDataCrypt.js b/sdk/WXBizDataCrypt.js
new file mode 100644
index 0000000..aadef98
--- /dev/null
+++ b/sdk/WXBizDataCrypt.js
@@ -0,0 +1,35 @@
+var crypto = require('crypto')
+
+function WXBizDataCrypt(appId, sessionKey) {
+ this.appId = appId
+ this.sessionKey = sessionKey
+}
+
+WXBizDataCrypt.prototype.decryptData = function (encryptedData, iv) {
+ // base64 decode
+ var sessionKey = new Buffer(this.sessionKey, 'base64')
+ encryptedData = new Buffer(encryptedData, 'base64')
+ iv = new Buffer(iv, 'base64')
+
+ try {
+ // 解密
+ var decipher = crypto.createDecipheriv('aes-128-cbc', sessionKey, iv)
+ // 设置自动 padding 为 true,删除填充补位
+ decipher.setAutoPadding(true)
+ var decoded = decipher.update(encryptedData, 'binary', 'utf8')
+ decoded += decipher.final('utf8')
+
+ decoded = JSON.parse(decoded)
+
+ } catch (err) {
+ throw new Error('Illegal Buffer')
+ }
+
+ if (decoded.watermark.appid !== this.appId) {
+ throw new Error('Illegal Buffer')
+ }
+
+ return decoded
+}
+
+module.exports = WXBizDataCrypt
diff --git a/utils/domain.js b/utils/domain.js
index b84db65..4dafaca 100644
--- a/utils/domain.js
+++ b/utils/domain.js
@@ -1,11 +1,12 @@
// http.js使用域名
// const baseUrl = 'http://192.168.31.57:8080/autoSR/api';// 本地
-// const baseUrl = 'http://121.42.63.138:9091/autoSR/api';// 测试站/
+const baseUrl = 'http://121.42.63.138:9091/autoSR/api';// 测试站/
+// const baseUrl = 'http://192.168.31.92:8080/api';// sh
// const baseUrl = 'http://192.168.31.167:8080/autoSR/api'; // 长龙
// const baseUrl = 'http://192.168.31.134:8080/autoSR/api'; // 佳豪
// const baseUrl = 'http://10.2.1.104:8081/autoSR/api'; // 刘敏
// const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式
-const baseUrl = 'https://hfju.com/api'; // 数智正式
+// const baseUrl = 'https://hfju.com/api'; // 数智正式
// config使用域名