Commit 610cd2b4 by 张立顺

Merge branch 'SAAS+V4.43-0807' of http://192.168.3.233:8090/saas_plus/dj-car-bou…

…tique-work-wechat into SAAS+V4.43-0807
2 parents 5f87901b d9614640
......@@ -6,6 +6,12 @@ module.exports = {
data.productCode = "PC00c2";
return api.post("dj.api.smartcarlife.jscode.login", data);
},
/**微信登录 */
ssoLogin(data) {
return api.post("scrm.api.sso.weapp.jscode.login", data, [],
"/rop-scrm-sso/router",
"scrm",false);
},
/**微信手机号登录 */
authPhone(data) {
data.productCode = "PC00c2";
......@@ -294,4 +300,4 @@ module.exports = {
getCurShopList(data) {
return api.post("dj.api.smartcarlife.serviceMerchant.curShopList", data)
}
};
};
\ No newline at end of file
......@@ -70,17 +70,17 @@ Page({
},
// 结束,查看报告
toResult() {
const history_message = this.getHistoryAll();
const audioBox = this.selectComponent("#audioBox");
const list = audioBox.data.list;
if (list.length == 0) {
return this.back();
}
let isJump = true,Sentences = [];
let isJump = true,
Sentences = [];
list.forEach((i) => {
if (i.role == 2) {
isJump = false;
Sentences = [...Sentences, ...i.Sentences?i.Sentences:[]]
Sentences = [...Sentences, ...i.Sentences ? i.Sentences : []]
}
});
if (isJump) {
......@@ -90,10 +90,22 @@ Page({
wx.$util.showToast("AI还未回复");
return;
}
if(Sentences.length == 0) {
if (Sentences.length == 0) {
wx.$util.showToast("对话内容太短");
return;
}
this.setData({
isVisible: true
})
},
handleCancel() {
this.setData({
isVisible: false
})
},
handleSure() {
const history_message = this.getHistoryAll();
const audioBox = this.selectComponent("#audioBox");
const chatList = JSON.stringify(audioBox.data.list);
wx.setStorageSync("chatList", chatList);
const {
......@@ -150,7 +162,7 @@ Page({
content: "",
openAudio: false
};
audioBox.addList(addVal,1);
audioBox.addList(addVal, 1);
const index = Math.floor(Math.random() * 3);
const message = scriptList[index].content;
const Phrases = await aiApi.getPhrases({
......@@ -377,7 +389,7 @@ Page({
});
},
//提供相应的建议
getSparring(user_message,retryCount = 0) {
getSparring(user_message, retryCount = 0) {
const {
step,
reject_reason,
......@@ -396,7 +408,7 @@ Page({
content: ""
};
const audioBox = this.selectComponent("#audioBox");
if(retryCount == 0) {
if (retryCount == 0) {
audioBox.addList(addVal);
}
const {
......@@ -425,7 +437,7 @@ Page({
} = res;
console.log('batch_id', batch_id, 'uuid', uuid)
audioBox.setList({
content: sale_message.replace(/,/g,','),
content: sale_message.replace(/,/g, ','),
times: Math.ceil(sale_message.length / 4),
spkTime: new Date().format("yyyy-MM-dd hh:mm:ss"),
},
......@@ -446,7 +458,7 @@ Page({
defense_step,
step: next_step,
});
}).catch(e=>{
}).catch(e => {
if (retryCount < 1) { // 如果重试次数小于1,则重试一次
this.getSparring(user_message, retryCount + 1);
}
......@@ -550,12 +562,16 @@ Page({
};
if (name) {
params = {
roleName: name.replace('客户',''),
roleName: name.replace('客户', ''),
};
this.setData({entry:'other'})
this.setData({
entry: 'other'
})
}
if(entry == 'other') {
this.setData({entry:'other'})
if (entry == 'other') {
this.setData({
entry: 'other'
})
}
const roleInfo = await carLifeApi.sparringRole({
currentPage: 1,
......@@ -601,12 +617,6 @@ Page({
this.setData({
sparringTaskId: res.data.sparringTaskId
});
if (!res.data.sparringAllow) {
this.setData({
isVisible: true
});
return;
}
},
//获取攻防话术
getScriptList(attackScript) {
......
......@@ -261,6 +261,7 @@ page {
}
}
}
.wrapper-pop {
position: fixed;
top: 0;
......@@ -269,6 +270,7 @@ page {
bottom: 0;
background: rgba(0, 0, 0, 0.5);
}
.icon-tips {
width: 160rpx;
height: 160rpx;
......@@ -277,6 +279,7 @@ page {
left: 50%;
transform: translateX(-50%);
}
.wrapper-content {
position: absolute;
left: 50%;
......@@ -288,21 +291,29 @@ page {
box-shadow: 0 -8rpx 12rpx 0 rgba(0, 0, 0, 0.05);
border-radius: 32rpx;
text-align: center;
.title {
font-weight: 500;
font-size: 32rpx;
color: #292D33;
margin-top: 112rpx;
}
}
.content {
font-size: 28rpx;
color: #5A5E66;
margin-top: 20rpx;
padding: 0 70rpx;
}
.btn {
}
.footer {
display: flex;
margin: 48rpx auto;
width: 333rpx;
justify-content: center;
}
.btn {
width: 244rpx;
height: 80rpx;
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
border-radius: 486rpx;
......@@ -310,5 +321,13 @@ page {
font-weight: 500;
font-size: 28rpx;
line-height: 80rpx;
margin-right: 20rpx;
&.cancel {
background: #F2F3F5;
color: #292D33;
}
}
\ No newline at end of file
&.sure {
background-image: linear-gradient(90deg, #4D53FF 0%, #389AFF 100%);
}
}
}
\ No newline at end of file
......@@ -13,38 +13,56 @@
<view class="chat-section">
<view class="chat-list">
<scroll-view scroll-y="true" scroll-x="false" style="height:100%" scroll-top="{{scrollTop}}">
<view class="chat-item">
<view class="chat-left">
<image class="avatar-icon" src="{{avatar}}"></image>
<view class="chat-box">
<view class="content-box">你已选择:<text class="font-b">{{roleName}}、{{stage}}环节</text></view>
<view class="operation">
<view class="operation-top"> <gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
对练建议</view>
<view class="content">{{roleDesc}}</view>
</view>
<view class="chat-item">
<view class="chat-left">
<image class="avatar-icon" src="{{avatar}}"></image>
<view class="chat-box">
<view class="content-box">你已选择:<text class="font-b">{{roleName}}、{{stage}}环节</text></view>
<view class="operation">
<view class="operation-top">
<gl-image class="suggest-icon" src="/aiCheck/suggest-icon.png"></gl-image>
对练建议
</view>
<view class="content">{{roleDesc}}</view>
</view>
</view>
</view>
</view>
</view>
<audio-tts wx:if="{{roleName}}" isDemo="{{isDemo}}" showSpeechPopup="{{showSpeechPopup}}" roleName="{{roleName}}" chatList="{{chatList}}" voice="{{voice}}" avatar="{{avatar}}" id="audioBox"></audio-tts></scroll-view>
<audio-tts wx:if="{{roleName}}" isDemo="{{isDemo}}" showSpeechPopup="{{showSpeechPopup}}" roleName="{{roleName}}"
chatList="{{chatList}}" voice="{{voice}}" avatar="{{avatar}}" id="audioBox"></audio-tts>
</scroll-view>
</view>
<view class="control-box" style="{{controlBoxStyle}}">
<view class="inspiration-btn {{popType == 'inspiration' ? 'active' : ''}}" bindtap="openPopup" data-type="inspiration"><gl-image class="icon" src="/aiCheck/{{popType == 'inspiration' ? 'inspiration-icon-white' : 'inspiration-icon'}}.png"></gl-image></view>
<view class="inspiration-btn {{popType == 'script' ? 'active' : ''}}" bindtap="handleScript" data-type="script"><gl-image class="icon" src="/aiCheck/{{popType == 'script' ? 'script-icon-white' : 'script-icon'}}.png"></gl-image></view>
<view class="speak-btn" bindtap="handleSpeak"><gl-image class="icon" src="/aiCheck/speech-icon.png"></gl-image>点击说话</view>
<view class="inspiration-btn {{popType == 'inspiration' ? 'active' : ''}}" bindtap="openPopup"
data-type="inspiration">
<gl-image class="icon"
src="/aiCheck/{{popType == 'inspiration' ? 'inspiration-icon-white' : 'inspiration-icon'}}.png"></gl-image>
</view>
<view class="inspiration-btn {{popType == 'script' ? 'active' : ''}}" bindtap="handleScript" data-type="script">
<gl-image class="icon" src="/aiCheck/{{popType == 'script' ? 'script-icon-white' : 'script-icon'}}.png">
</gl-image>
</view>
<view class="speak-btn" bindtap="handleSpeak">
<gl-image class="icon" src="/aiCheck/speech-icon.png"></gl-image>点击说话
</view>
</view>
</view>
<!-- 弹窗组件 -->
<scene-popup avatar="{{avatar}}" bind:handleMask="handleMask" popType="{{popType}}" show="{{showScenePopup}}" inspirationContent="{{inspirationContent}}" scriptList="{{scriptList}}" bindcancel="cancel" bind:handleScript="handleScript" bindscene="handleScene"></scene-popup>
<speech-popup bindsend="send" show="{{showSpeechPopup}}" inspirationContent="{{inspirationContent}}" bindclose="closeSpeechPopup"></speech-popup>
<scene-popup avatar="{{avatar}}" bind:handleMask="handleMask" popType="{{popType}}" show="{{showScenePopup}}"
inspirationContent="{{inspirationContent}}" scriptList="{{scriptList}}" bindcancel="cancel"
bind:handleScript="handleScript" bindscene="handleScene"></scene-popup>
<speech-popup bindsend="send" show="{{showSpeechPopup}}" inspirationContent="{{inspirationContent}}"
bindclose="closeSpeechPopup"></speech-popup>
<view class="wrapper-pop" wx:if="{{isVisible}}">
<view class="wrapper-content">
<gl-image class="icon-tips" webp src="/aiCheck/icon-tips.webp"></gl-image>
<view class="title">温馨提示</view>
<view class="content">您的对练试用次数已用完,请等待管理员为您分配对练任务</view>
<view class="btn" bind:tap="back">我知道了</view>
<gl-image class="icon-tips" webp src="/aiCheck/icon-tips.webp"></gl-image>
<view class="title">温馨提示</view>
<view class="content">点击确定按钮,您将结束此次对练并订阅生成报告提醒</view>
<view class="footer">
<view class="btn cancel" bind:tap="handleCancel">取消</view>
<view class="btn sure" bind:tap="handleSure">确定</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -117,25 +117,27 @@ Page({
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene`,
});
} else if(entry == 'other'){
} else if (entry == 'other') {
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene`,
});
}else {
} else {
wx.$router.back();
}
},
backHome() {
const pages = getCurrentPages();
const prevPage = pages[pages.length - 2];
const {entry} = this.data
console.log(entry,'entry')
if(entry == 'other'){
const {
entry
} = this.data
console.log(entry, 'entry')
if (entry == 'other') {
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/start/start`,
});
return
}
}
if (prevPage.route == "packageEquity/pages/aiCheck/start/start") {
wx.navigateBack({
delta: 1,
......@@ -176,11 +178,24 @@ Page({
})
.exec();
},
setRemind() {
wx.requestSubscribeMessage({
tmplIds: ['ctivVQAIoDzv1OKlcI9cXiJpyKZBUP1XamO8sBP8ij0'],
success(res) {
wx.showToast({
title: '订阅成功',
icon: 'none'
})
wx.p.router.back()
}
})
},
/**
* 生命周期函数--监听页面加载+
*
*/
async onLoad(options) {
this.setRemind()
const {
history_message,
duration,
......@@ -212,13 +227,15 @@ Page({
id
})
} else {
const sensitiveRes = await aiApi.getSensitive({history_message})
const sensitiveRes = await aiApi.getSensitive({
history_message
})
const is_sensitive = sensitiveRes.is_sensitive
const chatList = JSON.parse(wx.getStorageSync("chatList"));
this.setData({
chatList
})
this.handleSave(chatList, duration,is_sensitive)
this.handleSave(chatList, duration, is_sensitive)
}
console.log(windowW);
},
......@@ -319,7 +336,7 @@ Page({
let axisX = [];
let axisY_SpeechRate = [];
let axisY_EmotionValue = [];
if(Sentences.length == 0) {
if (Sentences.length == 0) {
return
}
if (Sentences.length > 2) {
......@@ -366,7 +383,7 @@ Page({
}
const axisY_Intonation = axisY_EmotionValue.map((currentValue, index) => {
if (index < axisY_EmotionValue.length - 1) {
const mul = Math.ceil( axisY_EmotionValue[index + 1] - currentValue) + 1
const mul = Math.ceil(axisY_EmotionValue[index + 1] - currentValue) + 1
return mul > 0 ? mul : 0
} else {
return 1
......@@ -417,7 +434,7 @@ Page({
content
}
},
handleSave(list, sparringDuration,triggerSensitive) {
handleSave(list, sparringDuration, triggerSensitive) {
console.log(list)
let totalTime = 0;
let Sentences = [];
......@@ -434,7 +451,7 @@ Page({
redundantWords,
definition,
intonation
} = this.getSentencesDetail(Sentences, totalTime, content) ||{}
} = this.getSentencesDetail(Sentences, totalTime, content) || {}
const {
sparringTaskId,
roleType,
......@@ -522,15 +539,15 @@ Page({
extra: {
radar: {
max: 6,
gridColor:'#F3F5FA',
bgColor:'#ffffff',
gridColor: '#F3F5FA',
bgColor: '#ffffff',
maxAlpha: 0.3
},
},
}, {
dataPointShape: ["circle"],
drawLine: true,
radarGridCount:6
radarGridCount: 6
});
setTimeout(() => {
console.log(this.a)
......@@ -556,7 +573,7 @@ Page({
id,
entry
} = this.data
if(score == null) return
if (score == null) return
wx.$router.go("/packageEquity/pages/aiCheck/detail/detail", {
reportItem,
avatar,
......
......@@ -79,22 +79,10 @@ Component({
})
}
},1000),
async setSparringVerify(id) {
const {
merchantId,
uuid
} = wx.$util.getUserInfo()
const res = await aiApi.setSparringVerify({
staffUuid: uuid,
yqMerchantId: merchantId
setSparringVerify(id) {
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene?id=${id}`
})
this.setData({isVisible: !res.data.sparringAllow})
if (res.data.sparringAllow) {
wx.navigateTo({
url: `/packageEquity/pages/aiCheck/scene/scene?id=${id}`
})
}
},
}
})
\ No newline at end of file
......@@ -30,6 +30,4 @@
</view>
</block>
</view>
</view>
<tipsPop isVisible="{{isVisible}}" bindconfirm="confirm"></tipsPop>
\ No newline at end of file
</view>
\ No newline at end of file
......@@ -53,6 +53,11 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.getUserProfile({
desc: '获取用户信息',
}).then(res=>{
console.log(res)
})
// wx.getRecorderManager().start({
// duration: 600000,
// numberOfChannels: 1,
......
......@@ -386,7 +386,7 @@ Component({
carModels: searchForm?.carModels,
orderResult: searchForm?.orderResult,
merchantNo: !searchForm?.merchantNo?.length ? (userInfo?.isSuper ? storeRangeList.map(v => { if (v.merchantNo) return v.merchantNo }) : userInfo?.loginRole == 3 ? '' : [userInfo?.default4SStoreInfo?.merchantId]) : searchForm?.merchantNo,
staffUuids: userInfo.isSuper ? searchForm?.staffUuids : [userInfo.uuid]
staffUuids: userInfo.isSuper || userInfo?.loginRole == 3 ? searchForm?.staffUuids : [userInfo.uuid]
}
return obj
},
......@@ -398,7 +398,7 @@ Component({
onLoad() {
const isStaff = app.globalData.isStaff;
let userInfo = wx.$util.getUserInfo() || {};
if (userInfo.isSuper) this.setData({ showEmployeeName: true, isShowDefeatBtn: false })
if (userInfo?.isSuper || userInfo?.loginRole == 3) this.setData({ showEmployeeName: true, isShowDefeatBtn: false })
this.setData({
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo || {},
userInfo,
......@@ -500,7 +500,7 @@ Component({
},
getStoreList() {
return new Promise(resolve => {
if (wx.$receptionLoaded) return
// if (wx.$receptionLoaded) return
let userInfo = wx.$util.getUserInfo() || {}
let { menuList } = this.data
carLifeApi.selectrecmerchantList({}).then(res => {
......
......@@ -25,7 +25,7 @@ Page({
*/
onLoad(options) {
let userInfo = wx.$util.getUserInfo() || {}
if (userInfo.isSuper) this.setData({showEmployeeName: true, isShowDefeatBtn: false})
if (userInfo?.isSuper || userInfo?.loginRole == 3) this.setData({showEmployeeName: true, isShowDefeatBtn: false})
// 超管获取所有质检门店/员工
this.setData({
nothing: false
......@@ -71,7 +71,7 @@ Page({
carModels: searchForm?.carModels,
orderResult: searchForm?.orderResult,
merchantNo: !searchForm?.merchantNo?.length ? (userInfo?.isSuper ? storeRangeList.map(v => {if (v.merchantNo) return v.merchantNo}) : userInfo?.loginRole == 3 ? '' : [userInfo?.default4SStoreInfo?.merchantId]) : searchForm?.merchantNo,
staffUuids: userInfo.isSuper ? searchForm?.staffUuids : [userInfo.uuid]
staffUuids: userInfo.isSuper || userInfo?.loginRole == 3 ? searchForm?.staffUuids : [userInfo.uuid]
}
return obj
},
......
......@@ -790,6 +790,17 @@ Page({
data
} = result;
if (code == 0) {
this.data.changeBtnData.forEach(changeData => {
if (data[changeData.valueObj].totalOrderMoney > 10000000) {
data[changeData.valueObj].totalOrderMoney = parseInt(data[changeData.valueObj].totalOrderMoney)
}
if (data[changeData.valueFn].totalOrderMoney > 10000000) {
data[changeData.valueFn].totalOrderMoney = parseInt(data[changeData.valueFn].totalOrderMoney)
}
})
this.setData({
userStat: data,
});
......@@ -1263,12 +1274,11 @@ Page({
// 不是员工类型
if (isNoStaff) {
menu = [{
name: "预约管理",
url: "pages.tabDateIndex",
recordId: 8,
icon: "booking_management",
},
];
name: "预约管理",
url: "pages.tabDateIndex",
recordId: 8,
icon: "booking_management",
}, ];
// 判断是超管再加 这个菜单
// if (userInfo.isSuper) {
// menu.push({
......@@ -1280,8 +1290,8 @@ Page({
// }
}
//超管、督导驻店日报、BI报表、生意助手
if(userInfo.loginRole === 3 || userInfo.isSuper){
menu=[]
if (userInfo.loginRole === 3 || userInfo.isSuper) {
menu = []
}
if ((userInfo.isSuper || userInfo.loginRole === 3) && menu.every((item) => item.name != "BI报表")) {
menu.push({
......
......@@ -27,7 +27,7 @@
<swiper-item>
<view class="swiper-item">
<view class="total-wrap">
<view class="item">
<view class="item left">
<view class="title">{{changeSelectIndex==0?'今日':changeSelectIndex==1?'本月':'累计'}}产值</view>
<veiw class="number" wx:if="{{userInfo.userType == 2 && !userInfo.isSuper}}">
<text class="unit">¥</text>
......
......@@ -110,6 +110,12 @@ const getSessionId = () => {
const setSessionId = sessionId => {
wx.setStorageSync('dj_boutique_sessionId', sessionId)
}
const setOpenId = openId => {
wx.setStorageSync('dj_boutique_openId', openId)
}
const getOpenId = () => {
wx.getStorageSync('dj_boutique_openId', openId)
}
const removeStorage = () => {
wx.removeStorageSync('noSignInUuid')
wx.removeStorageSync('dj_boutique_user_info')
......@@ -292,6 +298,8 @@ const util = {
getUserInfo,
setUserInfo,
getSessionId,
setOpenId,
getOpenId,
setSessionId,
removeSellerInfo,
removeStorage,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!