|
@@ -1,6 +1,9 @@
|
|
|
<template>
|
|
|
<view class="content" style="background: #F4F5F7;">
|
|
|
- <view class="indexTop">
|
|
|
+ <view class="qwTsBox" v-if="qwtsShow">
|
|
|
+ <view class="qwTsTxt">{{msg}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="indexTop" v-if="userDetail">
|
|
|
<view class="top">
|
|
|
<view>
|
|
|
<image class="logo" :src="userDetail.avatar"></image>
|
|
@@ -38,11 +41,14 @@
|
|
|
<view @click="copy(token)">{{token}}</view>
|
|
|
<view>{{agentId}}</view> -->
|
|
|
<!-- <view @click="oAuth">重新授权</view> -->
|
|
|
- <!-- <view style="color: red;">{{userId}}</view>
|
|
|
+ <!-- <view style="color: red;">{{userId}}</view>
|
|
|
<view @click="copy(userId)">复制userId</view>
|
|
|
<view>{{token}}</view>
|
|
|
<view @click="copy(token)">复制token</view> -->
|
|
|
<!-- <view>agentId:{{agentId}}</view> -->
|
|
|
+ <!-- <view>code1:{{code1}}</view>
|
|
|
+ <view>code2:{{code2}}</view>
|
|
|
+ <view>code3:{{code3}}</view> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -69,6 +75,11 @@
|
|
|
corpID:'',
|
|
|
agentId:'',
|
|
|
unionID:'',
|
|
|
+ qwtsShow:false,
|
|
|
+ code1:'',
|
|
|
+ code2:'',
|
|
|
+ code3:'',
|
|
|
+ msg:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -76,17 +87,19 @@
|
|
|
this.code=uni.getStorageSync('code')
|
|
|
this.token=uni.getStorageSync('token')
|
|
|
this.corpID=uni.getStorageSync('corpID')
|
|
|
- this.agentId=uni.getStorageSync('agentId')
|
|
|
+ this.agentId=uni.getStorageSync('agentId')
|
|
|
/* this.corpID='wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g'
|
|
|
this.agentId='1000051'
|
|
|
this.userId='wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA'
|
|
|
+ //this.token='D226815BF1F1A11DE73489E7B8B3F7CEB2FA7AB1E002EF21F835C7D505158C7DAF945459643F62A3A6FD87751E6880BB'
|
|
|
+
|
|
|
this.token='26AF53EA2DC528681ABD7B3AC46072E96F0A964431A2453CF0F1DA1C28732A1EAF945459643F62A3A6FD87751E6880BB'
|
|
|
*/
|
|
|
//this.userId='wmMGjbBgAALroygkoaVBN4-W2O1daIkg'
|
|
|
//this.token='065BAA93971FEB1A37A08D682FCDB41CC69E76FC36BB038790FB99C5CD71C28EAF945459643F62A3A6FD87751E6880BB'
|
|
|
//this.userId='wmMGjbBgAAeKTdCmEN0CLKPNwJ4ACTxw'
|
|
|
//this.token='0A809B6077F4044EDECFC49762B59668E9508B2CA4C6C4791C8894B2B1A7338AAF945459643F62A3A6FD87751E6880BB'
|
|
|
- /* uni.setStorage({
|
|
|
+ /* uni.setStorage({
|
|
|
key: 'token',
|
|
|
data: that.token,
|
|
|
success: function () {
|
|
@@ -140,72 +153,86 @@
|
|
|
},
|
|
|
extCustomerInfo(){
|
|
|
var that=this;
|
|
|
+ /* uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: 'extCustomerInfo',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ console.log('用户点击确定');
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }); */
|
|
|
this.$http('enterprise/wechat/extCustomerInfo', {
|
|
|
//corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
|
|
|
corpID:that.corpID,
|
|
|
// extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA',
|
|
|
- extUserId:this.userId,
|
|
|
+ extUserId:this.userId,
|
|
|
token:this.token
|
|
|
}, 'GET').then(res => {
|
|
|
console.log(res.code)
|
|
|
- uni.hideLoading();
|
|
|
+ this.code2=res.code
|
|
|
+ uni.hideLoading();
|
|
|
if(res.code!=1){
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: res.msg,
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- console.log('用户点击确定');
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
|
|
|
//uni.clearStorageSync()
|
|
|
- uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: 'none',
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
- }
|
|
|
- this.customerInfo=res.data.customerInfo
|
|
|
- uni.setStorage({
|
|
|
- key: 'integral',
|
|
|
- data: that.customerInfo.integral,
|
|
|
- success: function () { }
|
|
|
- });
|
|
|
- uni.setStorage({
|
|
|
- key: 'levelName',
|
|
|
- data: that.customerInfo.levelName,
|
|
|
- success: function () { }
|
|
|
- });
|
|
|
- var map=res.data.map
|
|
|
- var arr=[]
|
|
|
- if(map.length){
|
|
|
- map.forEach(item=>{
|
|
|
- arr.push(item.PlateNumber)
|
|
|
- })
|
|
|
+ if(res.code == 401){
|
|
|
+ this.qwtsShow=true
|
|
|
+ this.msg=res.msg
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.customerInfo=res.data.customerInfo
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'integral',
|
|
|
+ data: that.customerInfo.integral,
|
|
|
+ success: function () { }
|
|
|
+ });
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'levelName',
|
|
|
+ data: that.customerInfo.levelName,
|
|
|
+ success: function () { }
|
|
|
+ });
|
|
|
+ var map=res.data.map
|
|
|
+ var arr=[]
|
|
|
+ if(map.length){
|
|
|
+ map.forEach(item=>{
|
|
|
+ arr.push(item.PlateNumber)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'PlateNumberArr',
|
|
|
+ data: arr,
|
|
|
+ success: function () { }
|
|
|
+ });
|
|
|
}
|
|
|
- uni.setStorage({
|
|
|
- key: 'PlateNumberArr',
|
|
|
- data: arr,
|
|
|
- success: function () { }
|
|
|
- });
|
|
|
+
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
extUserDetail(){
|
|
|
var that=this;
|
|
|
-
|
|
|
+ console.log("extUserDetail")
|
|
|
this.$http('enterpriseWechat/auth/extUserDetail', {
|
|
|
corpID:that.corpID,
|
|
|
// extUserId:'wmMGjbBgAA0JAbGD5Vu8BzEuYgZhvhOA'
|
|
|
extUserId:this.userId
|
|
|
}, 'GET').then(res => {
|
|
|
+ console.log("extUserDetailRES"+res.code)
|
|
|
uni.hideLoading();
|
|
|
+ this.code1=res.code
|
|
|
+ if(res.code == 401){
|
|
|
+ this.qwtsShow=true
|
|
|
+ this.msg=res.msg
|
|
|
+ }
|
|
|
this.userDetail=res.data
|
|
|
this.$refs.customView.getdata()
|
|
|
})
|
|
@@ -239,12 +266,23 @@
|
|
|
corpID:that.corpID,
|
|
|
code: this.code
|
|
|
}, 'GET').then(res => {
|
|
|
+ this.code3=res.code
|
|
|
if(res.code!=1){
|
|
|
- uni.showToast({
|
|
|
- title: res.msg,
|
|
|
- icon: 'none',
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
+ uni.hideLoading();
|
|
|
+ if(res.code == 401){
|
|
|
+ this.qwtsShow=true
|
|
|
+ this.msg=res.msg
|
|
|
+ }else if(res.code == 0){
|
|
|
+ this.qwtsShow=true
|
|
|
+ this.msg=res.msg
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ //title: res.code,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 3000
|
|
|
+ });
|
|
|
+ }
|
|
|
}else{
|
|
|
this.token=res.data.token
|
|
|
uni.setStorage({
|
|
@@ -262,25 +300,14 @@
|
|
|
})
|
|
|
},
|
|
|
init(){
|
|
|
- /* if(this.$wx.agentConfig){
|
|
|
- uni.showToast({
|
|
|
- title: 'agentConfig',
|
|
|
- icon: 'none',
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- title: 'agentConfig失败',
|
|
|
- icon: 'none',
|
|
|
- duration: 3000
|
|
|
- });
|
|
|
- } */
|
|
|
+
|
|
|
var that=this
|
|
|
+
|
|
|
this.$http('enterpriseWechat/auth/getAgentConfig', {
|
|
|
corpID:that.corpID,
|
|
|
url:'http://qw.66km.com.cn/'
|
|
|
}, 'GET').then(res => {
|
|
|
- console.log(11)
|
|
|
+
|
|
|
that.$wx.agentConfig({
|
|
|
corpid:that.corpID,// 必填,企业微信的corpid,必须与当前登录的企业一致
|
|
|
agentid:that.agentId, // 必填,企业微信的应用id (e.g. 1000247)
|
|
@@ -290,11 +317,7 @@
|
|
|
jsApiList: ['getCurExternalContact','getContext','sendChatMessage'], //必填,传入需要使用的接口名称
|
|
|
success: function(res) {
|
|
|
console.log(res)
|
|
|
- /* uni.showToast({
|
|
|
- title: 'agentConfig成功',
|
|
|
- icon: 'none',
|
|
|
- duration: 3000
|
|
|
- }); */
|
|
|
+
|
|
|
// 回调
|
|
|
that.getContext()
|
|
|
},
|
|
@@ -332,6 +355,13 @@
|
|
|
},
|
|
|
getCurExternalContact(){
|
|
|
var that=this;
|
|
|
+ /* uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: 'getCurExternalContact',
|
|
|
+ success: function (res) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }); */
|
|
|
this.$wx.invoke('getCurExternalContact', {
|
|
|
}, function(res){
|
|
|
if(res.err_msg == "getCurExternalContact:ok"){
|
|
@@ -384,6 +414,13 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ onBackPress (options) {
|
|
|
+ if (options.from === "backbutton") {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
onReachBottom() {
|
|
|
|
|
|
},
|
|
@@ -465,4 +502,24 @@
|
|
|
.tabline{
|
|
|
padding-bottom: 8rpx;
|
|
|
}
|
|
|
+ .qwTsBox{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: rgba(0, 0, 0, 0.5);
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 111;
|
|
|
+ }
|
|
|
+ .qwTsTxt{
|
|
|
+ color: #333;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 40vh;
|
|
|
+ background: #fff;
|
|
|
+ width: 60vw;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ margin-left: calc(20vw - 30rpx);
|
|
|
+ font-size: 30rpx;
|
|
|
+ padding: 30rpx;
|
|
|
+ }
|
|
|
</style>
|