Fix some issues
This commit is contained in:
parent
6927603bca
commit
a2cac6d92b
@ -14,7 +14,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="suggest">
|
<view class="suggest">
|
||||||
<text class="suggest-item" bindtap="suggestSubmit" data-suggest="{{suggest}}" wx:for="{{item.suggests}}" wx:for-item="suggest">{{suggest}}</text>
|
<view hover-class="suggest-item-hover" class="suggest-item" bindtap="suggestSubmit" data-suggest="{{suggest}}" wx:for="{{item.suggests}}" wx:for-item="suggest">{{suggest}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -59,13 +59,14 @@
|
|||||||
.suggest-item{
|
.suggest-item{
|
||||||
background-color: #f4f6f8;
|
background-color: #f4f6f8;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 5rpx 10rpx 5rpx 10rpx;
|
padding: 5rpx 8rpx 5rpx 8rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 8rpx;
|
||||||
margin-right: 16rpx;
|
margin-right: 16rpx;
|
||||||
color: rgb(180, 187, 196);
|
color: #b4bbc4;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
font-size: 25rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes blink {
|
@keyframes blink {
|
||||||
from { display: 1.0; }
|
from { display: 1.0; }
|
||||||
to { opacity: 0.0; }
|
to { opacity: 0.0; }
|
||||||
@ -75,3 +76,7 @@
|
|||||||
animation: blink 1.5s ease-in-out infinite;
|
animation: blink 1.5s ease-in-out infinite;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.suggest-item-hover {
|
||||||
|
color: #ff502c;
|
||||||
|
}
|
||||||
@ -70,12 +70,13 @@ async def chat(request):
|
|||||||
text = ''
|
text = ''
|
||||||
suggests = []
|
suggests = []
|
||||||
if status == 'Success':
|
if status == 'Success':
|
||||||
if len(res['item']['messages']) >= 2:
|
item = res['item']['messages']
|
||||||
text = res['item']['messages'][1]['text']
|
if len(item) >= 2:
|
||||||
|
text = item[1]['text']
|
||||||
if re.search(r'\[\^\d+\^\]', text):
|
if re.search(r'\[\^\d+\^\]', text):
|
||||||
text = res['item']['messages'][1]['adaptiveCards'][0]['body'][0]['text']
|
text = item[1]['adaptiveCards'][0]['body'][0]['text']
|
||||||
text = re.sub(r'\[\^\d+\^\]', '', text)
|
text = re.sub(r'\[\^\d+\^\]', '', text)
|
||||||
suggests = [x['text'] for x in res['item']['messages'][1]['suggestedResponses']]
|
suggests = [x['text'] for x in item[1]['suggestedResponses']] if 'suggestedResponses' in item[1] else []
|
||||||
else:
|
else:
|
||||||
text = '抱歉,未搜索到结果,请重试。'
|
text = '抱歉,未搜索到结果,请重试。'
|
||||||
suggests = [request.json.get('q')]
|
suggests = [request.json.get('q')]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user