Browse Source

7.10日12:00提交

李万涛 2 years ago
parent
commit
738edbcb08

+ 2 - 2
common/wechat/wechat.js

xqd
@@ -78,10 +78,10 @@ export default {
 			});
 			throw false;
 		}
-		let host = $platform.host();
+		// let host = $platform.host();
 
 		// let host = window.Location.href;
-		// let host = 'http://www.liwantao.top';
+		let host = 'http://www.liwantao.top';
 		// let host = 'http://t20.9026.com/h5';
 
 		let payloadObject = {

+ 0 - 911
pages/chat2/chat.scss

xqd
@@ -1,911 +0,0 @@
-page {
-		background-color: #f1f1f1;
-		font-size: 28rpx;
-	}
-
-	.ask {
-		color: #26b3a0;
-		margin-top: 22rpx;
-	}
-
-	/* 加载数据提示 */
-	.tips {
-		position: fixed;
-		left: 0;
-		top: var(--window-top);
-		width: 100%;
-		z-index: 9;
-		background-color: rgba(0, 0, 0, 0.15);
-		height: 72rpx;
-		line-height: 72rpx;
-		transform: translateY(-80rpx);
-		transition: transform 0.3s ease-in-out 0s;
-
-		&.show {
-			transform: translateY(0);
-		}
-	}
-
-	.box-1 {
-		width: 100%;
-		height: auto;
-		padding-bottom: 138rpx;
-		box-sizing: content-box;
-
-		/* 兼容iPhoneX */
-		margin-bottom: 0;
-		margin-bottom: constant(safe-area-inset-bottom);
-		margin-bottom: env(safe-area-inset-bottom);
-	}
-
-	.box-2 {
-		position: fixed;
-		left: 0;
-		width: 100%;
-		bottom: 0;
-		// bottom: 98rpx;
-		height: auto;
-		// border-radius: 30rpx 30rpx 0 0;
-		z-index: 2;
-		border-top: #9e9e9e38 solid 1px;
-		// border-bottom: #e5e5e5 solid 1px;
-		box-sizing: content-box;
-		background-color: #ffffff;
-
-		/* 兼容iPhoneX */
-		padding-bottom: 0;
-		padding-bottom: constant(safe-area-inset-bottom);
-		padding-bottom: env(safe-area-inset-bottom);
-
-		>view {
-			padding: 0 20rpx;
-			height: 150rpx;
-
-		}
-
-		.content {
-			background-color: #f1f1f1;
-			height: 64rpx;
-			width: 100%;
-			padding: 15rpx 20rpx 0;
-			border-radius: 32rpx;
-			// font-size: 28rpx;
-			padding-bottom: 98rpx;
-	
-		}
-
-		.send {
-			background-color: #26b3a0d6;
-			color: #fff;
-			height: 75rpx;
-			margin-left: 20rpx;
-			border-radius: 50rpx;
-			padding: 0;
-			width: 138rpx;
-			font-size: 30rpx;
-			font-weight: bold;
-			line-height: 75rpx;
-
-			&:active {
-				background-color: #26b3a08a;
-			}
-		}
-	}
-
-	.talk-list {
-		padding-bottom: 20rpx;
-
-		/* 消息项,基础类 */
-		.item {
-			padding: 20rpx 20rpx 0 20rpx;
-			align-items: flex-start;
-			align-content: flex-start;
-			color: #333;
-
-			.pic {
-				width: 100rpx;
-				height: 100rpx;
-				border-radius: 50%;
-				border: #fff solid 1px;
-			}
-
-			.content {
-				font-weight: bold;
-				padding: 15rpx 25rpx;
-				border-radius: 4px;
-				max-width: 500rpx;
-				word-break: break-all;
-				line-height: 52rpx;
-				position: relative;
-			}
-
-			/* 收到的消息 */
-			&.pull {
-				.time {
-					margin-left: 22rpx;
-					font-size: 24rpx;
-					margin-bottom: 15rpx;
-					color: #9e9e9e;
-					position: absolute;
-					width: 300rpx;
-					top: 0rpx;
-					left: 0rpx;
-				}
-
-				.content {
-					margin-left: 22rpx;
-					background-color: #fff;
-					border-radius: 0px 8px 8px 8px;
-					margin-top: 45rpx;
-					// &::after{
-					// 	content: '';
-					// 	display: block;
-					// 	width: 0;
-					// 	height: 0;
-					// 	border-top: 16rpx solid transparent;
-					// 	border-bottom: 16rpx solid transparent;
-					// 	border-right: 20rpx solid #fff;
-					// 	position: absolute;
-					// 	top: 30rpx;
-					// 	left: -18rpx;
-					// }
-				}
-
-				.sentpictures {
-					width: 300rpx;
-					// height: 237.5rpx;
-					margin-left: 22rpx;
-					border-radius: 0px 8px 8px 8px;
-					margin-top: 46rpx;
-				}
-			}
-
-			/* 发出的消息 */
-			&.push {
-				/* 主轴为水平方向,起点在右端。使不修改DOM结构,也能改变元素排列顺序 */
-				flex-direction: row-reverse;
-
-				.time {
-					margin-right: 22rpx;
-					font-size: 24rpx;
-					margin-bottom: 15rpx;
-					color: #9e9e9e;
-					position: absolute;
-					width: 300rpx;
-					top: 0rpx;
-					right: 0rpx;
-					display: flex;
-					justify-content: flex-end;
-				}
-
-				.content {
-					margin-right: 22rpx;
-					background-color: #26b3a0;
-					color: #fff;
-					border-radius: 8px 0px 8px 8px;
-					margin-top: 45rpx;
-				}
-
-				.sentpictures {
-					width: 300rpx;
-
-					margin-right: 22rpx;
-					border-radius: 8px 0 8px 8px;
-					margin-top: 46rpx;
-				}
-			}
-		}
-	}
-
-	.flex_photo {
-		// width: 80rpx;
-		border-radius: 50%;
-		background: #f1f1f1;
-		padding: 12rpx;
-		margin-right: 20rpx;
-	}
-
-	.content {
-		width: 100%;
-
-		.msg-list {
-			// width: 95%;
-			// padding: 38rpx 20rpx 237rpx 20rpx;
-			padding: 20rpx;
-			// position: absolute;
-			// top: 0rpx;
-			// bottom: 130rpx;
-			// margin-bottom: constant(safe-area-inset-bottom);
-			// margin-bottom: env(safe-area-inset-bottom);
-
-			.loading {
-				//loading动画
-				display: flex;
-				justify-content: center;
-
-				@keyframes stretchdelay {
-
-					0%,
-					40%,
-					100% {
-						transform: scaleY(0.6);
-					}
-
-					20% {
-						transform: scaleY(1);
-					}
-				}
-
-				.spinner {
-					margin: 20rpx 0;
-					width: 60rpx;
-					height: 100rpx;
-					display: flex;
-					align-items: center;
-					justify-content: space-between;
-
-					view {
-						background-color: #f06c7a;
-						height: 50rpx;
-						width: 6rpx;
-						border-radius: 6rpx;
-						animation: stretchdelay 1.2s infinite ease-in-out;
-					}
-
-					.rect2 {
-						animation-delay: -1.1s;
-					}
-
-					.rect3 {
-						animation-delay: -1s;
-					}
-
-					.rect4 {
-						animation-delay: -0.9s;
-					}
-
-					.rect5 {
-						animation-delay: -0.8s;
-					}
-				}
-			}
-
-			.row {
-				.system {
-					display: flex;
-					justify-content: center;
-
-					view {
-						padding: 0 30rpx;
-						height: 50rpx;
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						background-color: #c9c9c9;
-						color: #fff;
-						font-size: 24rpx;
-						border-radius: 40rpx;
-					}
-
-					.red-envelope {
-						image {
-							margin-right: 5rpx;
-							width: 30rpx;
-							height: 30rpx;
-						}
-					}
-				}
-
-				&:first-child {
-					// margin-top: 20rpx;
-				}
-
-				padding: 15rpx 0;
-
-				.my .left,
-				.other .right {
-					width: 86%;
-					display: flex;
-
-					.bubble {
-						max-width: 91%;
-						min-height: 50rpx;
-						// border-radius: 13rpx;
-						padding: 20rpx 30rpx;
-						display: flex;
-						align-items: center;
-						font-size: 30rpx;
-						word-break: break-word;
-
-						&.img {
-							background-color: transparent;
-							padding: 0;
-							overflow: hidden;
-
-							image {
-								max-width: 300rpx;
-								// max-height: 350rpx;
-							}
-						}
-
-						&.red-envelope {
-							background-color: transparent;
-							padding: 0;
-							overflow: hidden;
-							position: relative;
-							justify-content: center;
-							align-items: flex-start;
-
-							image {
-								width: 250rpx;
-								height: 313rpx;
-							}
-
-							.tis {
-								position: absolute;
-								top: 6%;
-								font-size: 26rpx;
-								color: #9c1712;
-							}
-
-							.blessing {
-								position: absolute;
-								bottom: 14%;
-								color: #e9b874;
-								width: 80%;
-								text-align: center;
-								overflow: hidden;
-								// 最多两行
-								display: -webkit-box;
-								-webkit-box-orient: vertical;
-								-webkit-line-clamp: 2;
-							}
-						}
-
-						&.voice {
-							.icon {
-								font-size: 40rpx;
-								display: flex;
-								align-items: center;
-							}
-
-							.icon:after {
-								content: ' ';
-								width: 53rpx;
-								height: 53rpx;
-								border-radius: 100%;
-								position: absolute;
-								box-sizing: border-box;
-							}
-
-							.length {
-								font-size: 28rpx;
-							}
-						}
-					}
-				}
-
-				.my .right,
-				.other .left {
-					flex-shrink: 0;
-					// width: 84rpx;
-					// height: 84rpx;
-
-					// image {
-					// 	width: 80rpx;
-					// 	height: 80rpx;
-					// 	border-radius: 50%;
-					// }
-				}
-
-				.my {
-					width: 100%;
-					display: flex;
-					justify-content: flex-end;
-
-					.left {
-						min-height: 80rpx;
-						flex-wrap: wrap;
-						align-items: center;
-						justify-content: flex-end;
-
-						.bubbleimg {
-							image {
-								height: 300rpx;
-								width: 400rpx;
-								border-radius: 10px 0px 10px 10px;
-							}
-						}
-
-						.bubble {
-							border-radius: 20rpx 0rpx 20rpx 20rpx;
-						}
-
-						.username {
-							width: 100%;
-							height: 48rpx;
-							font-size: 26rpx;
-							color: #999;
-							display: flex;
-							justify-content: flex-end;
-
-							.name {
-								// margin-right: 50rpx;
-							}
-						}
-
-						.bubble {
-							background-color: #26b3a0;
-							color: #000;
-							font-size: 30rpx;
-
-							&.voice {
-								.icon {
-									color: #fff;
-								}
-
-								.length {
-									margin-right: 20rpx;
-								}
-							}
-
-							&.play {
-								@keyframes my-play {
-									0% {
-										transform: translateX(80%);
-									}
-
-									100% {
-										transform: translateX(0%);
-									}
-								}
-
-								.icon:after {
-									border-left: solid 10rpx rgba(240, 108, 122, 0.5);
-									animation: my-play 1s linear infinite;
-								}
-							}
-						}
-					}
-
-					.right {
-						margin-left: 22rpx;
-					}
-				}
-
-				.other {
-					width: 100%;
-					display: flex;
-
-					.bubbleimg {
-						image {
-							width: 400rpx;
-							height: 300rpx;
-							border-radius: 0px 10px 10px 10px;
-						}
-					}
-
-					.bubble {
-						border-radius: 0rpx 20rpx 20rpx 20rpx;
-					}
-
-					.left {
-						margin-right: 22rpx;
-					}
-
-					.tip {
-						display: flex;
-						flex-direction: column;
-						position: absolute;
-						justify-content: space-between;
-						right: -50rpx;
-						bottom: 0;
-						height: 92rpx;
-					}
-
-					.right {
-						flex-wrap: wrap;
-
-						.username {
-							width: 100%;
-							height: 48rpx;
-							font-size: 26rpx;
-							color: #999;
-							display: flex;
-
-							.name {
-								// margin-right: 50rpx;
-							}
-						}
-
-						.bubble {
-							background-color: #fff;
-							color: #333;
-
-							&.voice {
-								.icon {
-									color: #333;
-								}
-
-								.length {
-									margin-left: 20rpx;
-								}
-							}
-
-							&.play {
-								@keyframes other-play {
-									0% {
-										transform: translateX(-80%);
-									}
-
-									100% {
-										transform: translateX(0%);
-									}
-								}
-
-								.icon:after {
-									border-right: solid 10rpx rgba(255, 255, 255, 0.8);
-
-									animation: other-play 1s linear infinite;
-								}
-							}
-						}
-					}
-				}
-
-				.exchange {
-					font-weight: bold;
-					font-size: 30rpx;
-					background: #00000014;
-					padding: 15rpx 35rpx;
-					border-radius: 45rpx;
-
-					.launch {
-						margin-right: 35rpx;
-					}
-
-					.agree {
-						color: #4095e5;
-						margin-right: 25rpx;
-					}
-
-					.refuse {
-						color: #fe7058;
-					}
-				}
-			}
-		}
-	}
-
-	.ability {
-		width: 100%;
-		position: fixed;
-		top: 0;
-		height: 115rpx;
-		background: #ffffff;
-		z-index: 9;
-		border-bottom: #e5e5e5 solid 1px;
-
-		.item_ability {
-			width: 20%;
-
-			.t_ability {
-				font-size: 26rpx;
-				margin-top: 6rpx;
-			}
-		}
-	}
-
-	.flash {
-		margin-left: 2px;
-		animation: flash 0.8s linear infinite;
-	}
-
-	// 实现光标闪烁
-	@keyframes flash {
-		from {
-			opacity: 0;
-		}
-
-		to {
-			opacity: 1;
-		}
-	}
-
-	.neckBtn_view {
-		align-items: center;
-		display: flex;
-		justify-content: center;
-		position: fixed;
-		flex-direction: column;
-		background: linear-gradient(-45deg, #26b3a0, #3edd3e);
-		border-radius: 100rpx 0 0 100rpx;
-		box-shadow: 0rpx 10rpx 10rpx 0rpx rgba(0, 0, 0, 0.2);
-		box-sizing: border-box;
-		color: #fff;
-		font-size: 25rpx;
-		line-height: 30rpx;
-		padding: 10rpx 25rpx 10rpx;
-		right: 0;
-		text-align: center;
-		bottom: 415rpx;
-
-		.free_view {
-			font-size: 28rpx;
-			margin-bottom: 6rpx;
-		}
-	}
-
-	.poster-img {
-		width: 670rpx;
-		height: 928rpx;
-		position: relative;
-
-		text {
-			background: url('https://s.yun-live.com/images/20210201/5c4ef9d86bc5eec90f2f915683d9db08.png') no-repeat;
-			background-size: 100% 100%;
-			display: inline-block;
-			width: 50rpx;
-			height: 50rpx;
-			position: absolute;
-			top: -60rpx;
-			right: 0;
-		}
-
-		image {
-			width: 100%;
-			height: 100%;
-		}
-
-		view {
-			font-size: 32rpx;
-			font-family: PingFang-SC-Bold, PingFang-SC;
-			font-weight: bold;
-			color: #ffffff;
-			line-height: 32rpx;
-			text-align: center;
-			margin-top: 28rpx;
-		}
-	}
-
-	.poster {
-		padding: 24rpx 40rpx;
-
-		.footer-btn {
-			margin-top: 24rpx;
-			display: flex;
-			align-items: center;
-			justify-content: space-between;
-
-			view {
-				width: 319rpx;
-				height: 66rpx;
-				border-radius: 40rpx;
-				border: 1px solid #4070ff;
-				font-size: 26rpx;
-				font-family: PingFangSC-Regular, PingFang SC;
-				font-weight: 400;
-				color: #4070ff;
-				line-height: 66rpx;
-				text-align: center;
-			}
-
-			.save {
-				background: #4070ff;
-				color: #ffffff;
-			}
-		}
-	}
-
-	.poster-btn {
-		position: fixed;
-		bottom: 0;
-		left: 0;
-		width: 100%;
-		height: 140rpx;
-		background: #ffffff;
-		border-radius: 32rpx 32rpx 0px 0px;
-		display: flex;
-		align-items: center;
-		justify-content: space-around;
-
-		>view {
-			width: 80rpx;
-			height: 80rpx;
-			position: relative;
-			border-radius: 10rpx;
-			border: 4rpx solid #fff;
-
-			&.is-check {
-				border: 4rpx solid #4070ff;
-			}
-
-			image {
-				width: 100%;
-				height: 100%;
-			}
-
-			view {
-				width: 30rpx;
-				height: 30rpx;
-				position: absolute;
-				right: -15rpx;
-				bottom: -15rpx;
-				background: url('https://s.yun-live.com/images/20210201/311c01265c1aa508418f6bae10d67602.png') no-repeat;
-				background-size: 100% 100%;
-			}
-		}
-	}
-
-	.select {
-		font-weight: bold;
-		font-size: 32rpx;
-		margin: 30rpx;
-	}
-
-	.model_view {
-		margin: 30rpx;
-
-		.modelname {
-			font-size: 32rpx;
-			font-weight: bold;
-			width: 56%;
-
-			.name {
-				overflow: hidden;
-				white-space: nowrap;
-				text-overflow: ellipsis;
-			}
-
-			.modeldetails {
-				font-size: 26rpx;
-				font-weight: 500;
-				margin-top: 12rpx;
-				color: #9e9e9e;
-				overflow: hidden;
-				text-overflow: ellipsis;
-				display: -webkit-box;
-				-webkit-line-clamp: 2;
-				-webkit-box-orient: vertical;
-			}
-		}
-
-		.modelselect {
-			background: #03a9f4;
-			border-radius: 14rpx;
-			color: #fff;
-			width: 58px;
-			height: 30px;
-			line-height: 30px;
-			text-align: center;
-		}
-	}
-
-	.expand {
-		// padding: 20rpx;
-		// margin: 20rpx 20rpx 155rpx 20rpx;
-		// padding-bottom: env(safe-area-inset-bottom);
-		margin-left: 20rpx;
-
-		.surplus {
-			font-size: 26rpx;
-			background: #fff;
-			border-radius: 50rpx;
-			padding: 8rpx 12rpx;
-			margin-right: 20rpx;
-			border: 1px solid #ededed;
-			// box-shadow: 0px 0px 10px 3px #f1f1f1;
-
-			.item {
-				margin-left: 10rpx;
-			}
-
-			// display: inline-block;
-		}
-	}
-
-	.scroll-view_H {
-		white-space: nowrap;
-		width: 100%;
-		margin-bottom: 177rpx;
-	}
-
-	.operate {
-		width: 91%;
-		margin-top: 12rpx;
-		position: relative;
-
-		.duplicate {
-			font-size: 26rpx;
-			margin-left: 6rpx;
-			color: #9e9e9e;
-		}
-
-		// .eliseaudio {
-		// 	position: absolute;
-		// 	right: 0;
-		// }
-
-		.share {
-			font-size: 26rpx;
-			margin-left: 6rpx;
-			color: #9e9e9e;
-		}
-
-		.broadcast {
-			background: #fff;
-			width: 150rpx;
-			height: 40rpx;
-			border-radius: 60rpx;
-
-			// padding: 0 5rpx;
-			.play {
-				border-radius: 50%;
-			}
-
-			image {
-				width: 150rpx;
-				height: 40rpx;
-				border-radius: 60rpx;
-			}
-		}
-
-		.hoversubmit {
-			background: #9e9e9e61;
-		}
-	}
-
-	.bottomheight {
-		width: 100%;
-		height: 217rpx;
-	}
-
-	.soundrecording {
-		flex-direction: column;
-
-		.discriminate {
-			color: #9e9e9e;
-			margin-bottom: 30rpx;
-		}
-	}
-
-	.waveform {
-		image {
-			width: 468rpx;
-			height: 168rpx;
-		}
-
-
-	}
-
-	.operation {
-		margin: 60rpx 0 30rpx;
-
-		.affirm {
-			margin: 0 42rpx;
-
-			image {
-				width: 60rpx;
-				height: 60rpx;
-			}
-		}
-
-		.longpress {
-			background: red;
-			border-radius: 50%;
-			padding: 30rpx;
-
-			image {
-				width: 70rpx;
-				height: 70rpx;
-			}
-		}
-
-		.hoversubmit {
-			background: #9e9e9e61;
-		}
-	}
-
-	.env {
-		padding-bottom: env(safe-area-inset-bottom);
-	}

+ 0 - 418
pages/chat2/chat.vue

xqd
@@ -1,418 +0,0 @@
-<template>
-	<!-- <view style="padding-bottom: 248rpx;"> -->
-	<view style="">
-		<!-- #ifdef H5 -->
-		<view style="color: #000;">
-			<tn-nav-bar backgroundColor="#fff">GPT</tn-nav-bar>
-			<view :style="{ height: tobheight + 'px' }"></view>
-		</view>
-		<!-- #endif -->
-
-		<view class="content" @touchmove="touchmove">
-			<view class="msg-list">
-
-				<!-- <view v-if="!paintingmode" class="row"> -->
-				<view v-if="true" class="row">
-					<block>
-						<view class="other">
-							<!-- <view class="left" v-if="appInfo.is_show_gpt_avatar_nickname == 1"
-								@click="switchmodel = true"> -->
-							<view class="left" v-if="true" @click="switchmodel = true">
-								<u-image src="
-										/static/images/head.jpg
-									" mode="widthFix" radius="5" width="40" height="40"></u-image>
-							</view>
-							<view class="right">
-								<view class="username">
-									<view class="name"></view>
-									<view class="time"> ai问答机器人</view>
-								</view>
-								<view class="bubble">
-									<view class="content">
-										<view style="font-size: 32rpx;">您可以点击下方案例直接提问......</view>
-										<!-- <block v-for="(item, index) in homeTemplate.hot" :key="index">
-											<view class="ask" @click="send(item.text)">{{ item.text }}</view>
-										</block> -->
-
-										<view @click="commontemplate" class="tn-flex align-center"
-											style="justify-content: flex-end;margin-top: 15rpx;margin-bottom: 15rpx;">
-											<view style="color: #9e9e9e;margin-right: 10rpx;">换一换</view>
-											<u-icon name="reload" color="#9e9e9e" size="18"></u-icon>
-										</view>
-										<u-button size="small" @click="switchmodel = true" type="primary"
-											text="切换模型"></u-button>
-									</view>
-								</view>
-							</view>
-						</view>
-					</block>
-				</view>
-				<!-- <block v-for="(row, index) in paintingmode?paintinglist:talkList" :key="index" :id="'msg' + row.id">
-					<view class="row">
-						<block>
-							<view class="my" v-if="row.fromid == userInfo.id">
-								<view class="left">
-									<view class="username">
-										<view class="name">{{ row.nickname }}</view>
-									</view>
-									<u-icon v-if="row.content !='该问题已被隐藏!'" @click="copyText(index)" name="file-text"
-										color="#9e9e9e82" size="22"></u-icon>
-									<view v-if="row.type == 1" class="bubble" style="color: #fff;margin-left: 15rpx;">
-										<rich-text :nodes="row.content" @longtap="copy" :data-text="row.content"
-											selectable="true"></rich-text>
-									</view>
-								</view>
-								<view class="right">
-									<u-image :src="row.avatar ? row.avatar : '/static/images/head.jpg'" mode="widthFix"
-										radius="5" width="42" height="42"></u-image>
-								</view>
-							</view>
-							<view class="other" v-if="row.fromid != userInfo.id">
-								<view class="left" v-if="appInfo.is_show_gpt_avatar_nickname == 1"
-									@click="switchmodel = paintingmode?false:true">
-									<u-image :src="row.avatar" mode="widthFix" radius="5" width="42"
-										height="42"></u-image>
-								</view>
-								<view class="right">
-									<view class="username" v-if="appInfo.is_show_gpt_avatar_nickname == 1">
-										<view class="name"></view>
-										<view class="time">{{ row.nickname }}</view>
-									</view>
-
-									<view v-if="row.type == 1" class="bubble"
-										style="display: block;position: relative;">
-										<view>
-											<zero-markdown-view
-												v-if="(row.done && row.content.indexOf('```') != -1) || (row.done && row.content.indexOf('/*') != -1 || row.content.indexOf('---') != -1)"
-												:themeColor="themeColor" :markdown="row.content"></zero-markdown-view>
-											<text v-else @longtap="copy"
-												:data-text="row.content">{{ row.content.replace(/^\s+|\s+$/g, '') }}</text>
-											<text v-if="row.content == '正在思考中...'">{{ second }}s</text>
-
-											<text class="flash" v-if="row.show_flash">│</text>
-										</view>
-									</view>
-									<view v-if="row.type == 2" class="bubble"
-										style="display: block;position: relative;">
-										<view class="u-flex align-center">
-											<text style="margin-right: 20rpx;">{{row.content}}</text>
-											<u-loading-icon size="17"></u-loading-icon>
-										</view>
-									</view>
-									<view v-if="row.type == 3" class="bubbleimg">
-										<image @click="preview(index)" :src="row.img" mode="aspectFill"></image>
-									</view>
-									<view v-if="row.done && !row.donec"
-										class="tn-flex align-center justify-between operate">
-										<view @click="copyText(index)" hover-class="hoversubmit"
-											class="tn-flex align-center">
-											<u-icon name="file-text" top="1" color="#68d7bb" size="20"></u-icon>
-											<view class="duplicate">复制回答</view>
-										</view>
-										<view @click="createPoster(index)" hover-class="hoversubmit"
-											class="tn-flex align-center">
-											<u-icon name="share-square" top="1" color="#68d7bb" size="20"></u-icon>
-											<view class="share">分享对话</view>
-										</view>
-
-										<view v-if="appInfo.is_vop&&appInfo.is_vop == 1" class="eliseaudio">
-											<elise-audio @aittsjob="aittsjob" :audioId="'audioId'+index"
-												:url="row.audiolink" audioColor="#68d7bb" :durationS="5"
-												:content="row.content" :index="index" :cancel="cancel"></elise-audio>
-										</view>
-
-									</view>
-								</view>
-							</view>
-						</block>
-						
-					</view>
-				</block> -->
-			</view>
-			<view class="bottomheight"></view>
-			<view class="env"></view>
-		</view>
-
-		<view class="box-2">
-			<view class="flex_col">
-				<view class="flex_grow">
-					<u--textarea height="45" @blur="blurinput" @focus="focusinput" fixed :showConfirmBar="false"
-						v-model="content" :placeholder="paintingmode?'请输入您想绘制的图片内容...':'请输入您的问题...'"
-						:maxlength="paintingmode?500:-1" border="none" :cursorSpacing="80"></u--textarea>
-				</view>
-				<!-- <u-icon v-if="appInfo.is_vop&&appInfo.is_vop == 1" @click="openmicrophone" name="mic" color="#ff9800"
-					size="30"></u-icon> -->
-				<!-- 	<button class="send"
-					@click.prevent="paintingmode?sendpainting(content):send(content)">{{paintingmode?'绘制':'发送'}}</button> -->
-				<button class="send" @click.prevent="">发送</button>
-			</view>
-		</view>
-
-
-		<!-- 	<u-popup :show="showexpand" zIndex="1" mode="bottom" bgColor="transparent" :overlay="false"
-			@close="showexpand = false">
-			<scroll-view class="scroll-view_H" scroll-x="true">
-				<view class="expand u-flex">
-					<block v-if="appInfo.number_member">
-						<navigator @click="getroute"
-							:url="isLogin ?'/pages/user/member/member?id=1':'/pages/user/signin'"
-							class="surplus u-flex align-center" v-if="appInfo.number_member == 1">
-							<u-icon name="question-circle-fill" color="#ff9800" size="18" top="1"></u-icon>
-							<view class="item">
-								{{appInfo.number_alias?appInfo.number_alias+':':'点数:'}}{{ userData.coin ? userData.coin : 0 }}
-							</view>
-						</navigator>
-					</block>
-					<block v-else>
-						<navigator @click="getroute"
-							:url="isLogin ?'/pages/user/member/member?id=1':'/pages/user/signin'"
-							class="surplus u-flex align-center">
-							<u-icon name="question-circle-fill" color="#ff9800" size="18" top="1"></u-icon>
-							<view class="item">
-								{{appInfo.number_alias?appInfo.number_alias+':':'点数:'}}{{ userData.coin ? userData.coin : 0 }}
-							</view>
-						</navigator>
-					</block>
-					<blcok v-if="!paintingmode">
-						<navigator @click="getroute"
-							:url="isLogin ?'/pages/user/member/member?id=2':'/pages/user/signin'"
-							class="surplus u-flex align-center" v-if="appInfo.time_member && appInfo.time_member == 1">
-							<u-icon name="clock-fill" color="#607d8b" size="18" top="1"></u-icon>
-							<view class="item">
-								会员时长:{{ userData.is_validity == 1 ? Math.round((userData.vip_time - Date.parse(new Date()) / 1000) / (3600 * 24)) : 0 }}天
-							</view>
-						</navigator>
-					</blcok>
-					<view v-if="appInfo.is_aipainting&&appInfo.is_aipainting == 1" @click="switcmode"
-						class="surplus u-flex align-center">
-						<u-icon :name="paintingmode?'chat-fill':'edit-pen-fill'" color="#f44336" size="18"
-							top="1"></u-icon>
-						<view class="item">{{paintingmode?'聊天模式':'Ai绘画'}}</view>
-					</view>
-					<navigator @click="getroute" :url="isLogin ?'/pages/user/member/member?id=3':'/pages/user/signin'"
-						class="surplus u-flex align-center">
-						<u-icon name="more-circle-fill" color="#2979ff" size="18" top="1"></u-icon>
-						<view class="item">免费领{{appInfo.number_alias?appInfo.number_alias:'点数'}}</view>
-					</navigator>
-					<view class="surplus u-flex align-center" style="background: #fff0;padding: 1rpx;">
-
-					</view>
-				</view>
-			</scroll-view>
-		</u-popup> -->
-
-		<!-- <wike-skeleton count="4" type="user" v-if="homeTemplate.length === 0"></wike-skeleton> -->
-
-
-		<u-no-network></u-no-network>
-
-
-		<!-- <navigator v-if="is_commission == 1" class="neckBtn_view" url="/pages/user/commission/index">
-			<text class="free_view">分享</text>
-			赚佣金
-		</navigator> -->
-		<!-- 	<u-popup :show="showPoster" mode="bottom" :round="10" safeAreaInsetTop @close="showPoster = false">
-			<view class="poster">
-				<wike-painter :board="posterObj" @success="posterSuccess" ref="painter"></wike-painter>
-				<view class="footer-btn">
-					<view class="" @click="showPoster = false">退出</view>
-					<view class="save" @click="toSave">保存/分享</view>
-				</view>
-			</view>
-		</u-popup> -->
-		<!-- 		<u-popup :show="soundrecording" mode="bottom" :round="20" safeAreaInsetTop @close="soundrecording = false">
-
-			<view class="soundrecording u-flex justify-center">
-				<view v-if="showlongpress" class="waveform">
-					<image :src="'https://s1.voicecloud.cn/activity/imeVoiceShare/img/yuyin.gif'" mode="aspectFill">
-					</image>
-				</view>
-				<view class="operation u-flex">
-					<view @touchstart="startrecording" @touchend="stoprecording" class="longpress"
-						hover-class="hoversubmit">
-						<u-icon name="mic" color="#fff" size="35"></u-icon>
-					</view>
-				</view>
-				<view class="discriminate">长按识别语音</view>
-			</view>
-		</u-popup> -->
-
-
-		<!-- <wike-loading-page :isLoading="isLoading"></wike-loading-page> -->
-		<!-- 生成的图片 -->
-		<u-popup type="center" mode="center">
-			<view class="poster-img">
-				<text @click="closePopup"></text>
-				<!-- #ifdef H5 -->
-				<view class="">长按图片保存到手机</view>
-				<!-- #endif -->
-				<!-- #ifndef H5 -->
-				<view class="">点击图片保存到手机</view>
-				<!-- #endif -->
-			</view>
-		</u-popup>
-		<!-- 		<u-popup :show="switchmodel" @close="switchmodel = false" :round="15" closeable>
-			<view class="select u-flex justify-center"><text>选择模型</text></view>
-
-			<scroll-view scroll-y="true" :style="{ height: homeTemplate.mode.length > 6 ? 700 + 'rpx' : 'auto' }">
-				<block v-for="(item, index) in homeTemplate.mode" :key="index">
-					<view class="u-flex justify-between model_view">
-						<u-avatar :src="item.img_file.path" shape="square" mode="aspectFill" size="60"></u-avatar>
-						<view class="modelname">
-							<view class="name">{{ item.name }}</view>
-							<view class="modeldetails">{{ item.intro }}</view>
-						</view>
-						<view @click="onselect(index)" class="modelselect"
-							:style="{ background: selectornot == index ? '#9e9e9e' : '' }">
-							{{ selectornot == index ? '已选择' : '选择' }}
-						</view>
-					</view>
-				</block>
-				<view style="height: 30rpx;"></view>
-			</scroll-view>
-		</u-popup> -->
-
-		<!-- <wike-tabbar :onTabbar="true" :isShowAnimate="true"></wike-tabbar> -->
-	</view>
-</template>
-
-<script>
-	// import { indexOf } from 'core-js/js/array';
-	import {
-		Socket
-	} from 'dgram';
-	import {
-		mapMutations,
-		mapActions,
-		mapState,
-		mapGetters
-	} from 'vuex';
-	import {
-		apiurl
-	} from '@/common/request/request';
-	import MumuRecorder from '@/uni_modules/mumu-recorder/components/mumu-recorder/mumu-recorder.vue';
-	import eliseAudio from '@/components/elise-audio/elise-audio.vue';
-	// #ifdef H5
-	import Recorder from 'recorder-core';
-	import 'recorder-core/src/engine/wav'
-	// #endif
-
-	let down, delay;
-	let interstitialAd = null,
-		timer,
-		time2,
-		timingr;
-	// const innerAudioContext = uni.createInnerAudioContext();
-	const recorderManager = uni.getRecorderManager();
-	export default {
-		components: {
-			MumuRecorder,
-			eliseAudio,
-			// #ifdef H5
-			Recorder
-			// #endif
-		},
-		data() {
-			return {
-				gpt_mode_index: 0,
-				talkList: [
-
-				],
-				content: '',
-				thecontent: '',
-				image: '',
-				hot: [],
-				scrollTop: 999999,
-				scrollAnimation: false,
-				text1: ['您好,ChatGPT为您服务', '长按对话即可复制'],
-				tobheight: 45,
-				zhuangtai: 'AI智能问答机器人',
-				platform: this.$platform.get(),
-				// isFlash:false,
-				showPoster: false,
-				posterObj: {},
-				switchmodel: false,
-				selectornot: 0,
-				modeldata: [],
-				qrcode: '',
-				haddressurl: '',
-				haddresssk: '',
-				scrollToView: '',
-				question_index: 0,
-				answer_index: 0,
-				themeColor: '#007AFF',
-				codeBgColor: '#26B3A0',
-				showexpand: false,
-
-				second: 15,
-				showanswer: false,
-				h5question: '',
-				followornot: true,
-				eights: false,
-				spmplatform: 0,
-				is_commission: 0,
-				timing: 30,
-				showcontext: true,
-				showfetch: true,
-				showdirect: true,
-				//通道
-				thoroughfare: 0,
-
-				//绘画输入框
-				drawcontent: '',
-				//绘画模式
-				paintingmode: false,
-				//是否在绘画
-				showdraw: false,
-				//绘画id
-				uuid: '',
-				//绘画列表
-				paintinglist: [],
-
-				//弹出录音
-				soundrecording: false,
-				//是否长按
-				showlongpress: false,
-				//音频
-				innerAudioContextsrc: '',
-				//取消音频加载
-				cancel: false,
-				//第一次录
-				firstrecording: 0,
-				isLoading: true
-			};
-		},
-		computed: {
-
-		},
-		mounted() {
-
-		},
-		onReady() {
-
-
-		},
-
-		onLoad() {
-
-		},
-		onShow: function() {
-
-		},
-		onUnload() {
-
-		},
-		onHide() {
-
-		},
-		onReachBottom() {},
-		methods: {
-
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	@import '@/pages/chat/global.scss';
-	@import './chat.scss';
-</style>

+ 0 - 2136
pages/chat2/chat1.vue

xqd
@@ -1,2136 +0,0 @@
-<template>
-	<!-- <view style="padding-bottom: 248rpx;"> -->
-	<view style="">
-		<!-- #ifdef H5 -->
-		<view style="color: #000;">
-			<tn-nav-bar backgroundColor="#fff">GPT</tn-nav-bar>
-			<view :style="{ height: tobheight + 'px' }"></view>
-		</view>
-		<!-- #endif -->
-
-		<view class="content" @touchmove="touchmove">
-
-			<view class="msg-list">
-
-				<view v-if="!paintingmode" class="row">
-					<block>
-						<view class="other">
-							<view class="left" v-if="appInfo.is_show_gpt_avatar_nickname == 1"
-								@click="switchmodel = true">
-								<u-image :src="
-										homeTemplate.mode && homeTemplate.mode.length>0 && homeTemplate.mode[0].img_file.path
-											? homeTemplate.mode[0].img_file.path
-											: '/static/images/head.jpg'
-									" mode="widthFix" radius="5" width="40" height="40"></u-image>
-							</view>
-							<view class="right">
-								<view class="username">
-									<view class="name"></view>
-									<view class="time">{{ homeTemplate.mode && homeTemplate.mode.length>0 && homeTemplate.mode[0].name
-											?homeTemplate.mode[0].name :'ai问答机器人' }}</view>
-								</view>
-								<view class="bubble">
-									<view class="content">
-										<view style="font-size: 32rpx;">您可以点击下方案例直接提问......</view>
-										<block v-for="(item, index) in homeTemplate.hot" :key="index">
-											<view class="ask" @click="send(item.text)">{{ item.text }}</view>
-										</block>
-
-										<view @click="commontemplate" class="tn-flex align-center"
-											style="justify-content: flex-end;margin-top: 15rpx;margin-bottom: 15rpx;">
-											<view style="color: #9e9e9e;margin-right: 10rpx;">换一换</view>
-											<u-icon name="reload" color="#9e9e9e" size="18"></u-icon>
-										</view>
-										<u-button size="small" @click="switchmodel = true" type="primary"
-											text="切换模型"></u-button>
-									</view>
-								</view>
-							</view>
-						</view>
-					</block>
-				</view>
-				<block v-for="(row, index) in paintingmode?paintinglist:talkList" :key="index" :id="'msg' + row.id">
-					<view class="row">
-						<block>
-							<view class="my" v-if="row.fromid == userInfo.id">
-								<view class="left">
-									<view class="username">
-										<view class="name">{{ row.nickname }}</view>
-									</view>
-									<u-icon v-if="row.content !='该问题已被隐藏!'" @click="copyText(index)" name="file-text"
-										color="#9e9e9e82" size="22"></u-icon>
-									<view v-if="row.type == 1" class="bubble" style="color: #fff;margin-left: 15rpx;">
-										<rich-text :nodes="row.content" @longtap="copy" :data-text="row.content"
-											selectable="true"></rich-text>
-										<!-- <zero-markdown-view
-													
-													:themeColor="themeColor" :markdown="row.content"></zero-markdown-view> -->
-									</view>
-								</view>
-								<view class="right">
-									<!-- <u-avatar :src="row.avatar ? row.avatar : '/static/images/head.jpg'" size="40"
-										shape="square" mode="aspectFill"></u-avatar> -->
-									<u-image :src="row.avatar ? row.avatar : '/static/images/head.jpg'" mode="widthFix"
-										radius="5" width="42" height="42"></u-image>
-								</view>
-							</view>
-							<!-- GPT -->
-							<view class="other" v-if="row.fromid != userInfo.id">
-								<view class="left" v-if="appInfo.is_show_gpt_avatar_nickname == 1"
-									@click="switchmodel = paintingmode?false:true">
-									<u-image :src="row.avatar" mode="widthFix" radius="5" width="42"
-										height="42"></u-image>
-								</view>
-								<view class="right">
-									<view class="username" v-if="appInfo.is_show_gpt_avatar_nickname == 1">
-										<view class="name"></view>
-										<view class="time">{{ row.nickname }}</view>
-									</view>
-
-									<view v-if="row.type == 1" class="bubble"
-										style="display: block;position: relative;">
-										<view>
-											<!-- <mp-html :content="row.content" markdown/> -->
-											<zero-markdown-view
-												v-if="(row.done && row.content.indexOf('```') != -1) || (row.done && row.content.indexOf('/*') != -1 || row.content.indexOf('---') != -1)"
-												:themeColor="themeColor" :markdown="row.content"></zero-markdown-view>
-											<text v-else @longtap="copy"
-												:data-text="row.content">{{ row.content.replace(/^\s+|\s+$/g, '') }}</text>
-											<text v-if="row.content == '正在思考中...'">{{ second }}s</text>
-
-											<text class="flash" v-if="row.show_flash">│</text>
-
-											<!-- <view class="u-flex align-center flex-wrap">
-													<zero-markdown-view
-															
-															:themeColor="themeColor" :markdown="row.content"></zero-markdown-view>
-													<text  v-if="row.content == '正在思考中...'">{{ second }}s</text>
-													<view style="margin-left: 20rpx;">
-														<u-loading-icon v-if="row.show_flash" size="17"></u-loading-icon>
-													</view>
-													
-												</view> -->
-										</view>
-									</view>
-									<view v-if="row.type == 2" class="bubble"
-										style="display: block;position: relative;">
-										<view class="u-flex align-center">
-											<text style="margin-right: 20rpx;">{{row.content}}</text>
-											<u-loading-icon size="17"></u-loading-icon>
-										</view>
-									</view>
-									<view v-if="row.type == 3" class="bubbleimg">
-										<image @click="preview(index)" :src="row.img" mode="aspectFill"></image>
-									</view>
-									<view v-if="row.done && !row.donec"
-										class="tn-flex align-center justify-between operate">
-										<view @click="copyText(index)" hover-class="hoversubmit"
-											class="tn-flex align-center">
-											<u-icon name="file-text" top="1" color="#68d7bb" size="20"></u-icon>
-											<view class="duplicate">复制回答</view>
-										</view>
-										<!-- <view style="width: 50rpx;"></view> -->
-										<view @click="createPoster(index)" hover-class="hoversubmit"
-											class="tn-flex align-center">
-											<u-icon name="share-square" top="1" color="#68d7bb" size="20"></u-icon>
-											<view class="share">分享对话</view>
-										</view>
-
-										<view v-if="appInfo.is_vop&&appInfo.is_vop == 1" class="eliseaudio">
-											<elise-audio @aittsjob="aittsjob" :audioId="'audioId'+index"
-												:url="row.audiolink" audioColor="#68d7bb" :durationS="5"
-												:content="row.content" :index="index" :cancel="cancel"></elise-audio>
-										</view>
-
-									</view>
-								</view>
-							</view>
-						</block>
-					</view>
-				</block>
-			</view>
-			<view class="bottomheight"></view>
-			<view class="env"></view>
-		</view>
-		<view class="box-2">
-			<view class="flex_col">
-				<view class="flex_grow">
-					<u--textarea height="45" @blur="blurinput" @focus="focusinput" fixed :showConfirmBar="false"
-						v-model="content" :placeholder="paintingmode?'请输入您想绘制的图片内容...':'请输入您的问题...'"
-						:maxlength="paintingmode?500:-1" border="none" :cursorSpacing="80"></u--textarea>
-				</view>
-				<u-icon v-if="appInfo.is_vop&&appInfo.is_vop == 1" @click="openmicrophone" name="mic" color="#ff9800"
-					size="30"></u-icon>
-				<button class="send"
-					@click.prevent="paintingmode?sendpainting(content):send(content)">{{paintingmode?'绘制':'发送'}}</button>
-			</view>
-		</view>
-		<u-popup :show="showexpand" zIndex="1" mode="bottom" bgColor="transparent" :overlay="false"
-			@close="showexpand = false">
-			<scroll-view class="scroll-view_H" scroll-x="true">
-				<view class="expand u-flex">
-					<block v-if="appInfo.number_member">
-						<navigator @click="getroute"
-							:url="isLogin ?'/pages/user/member/member?id=1':'/pages/user/signin'"
-							class="surplus u-flex align-center" v-if="appInfo.number_member == 1">
-							<u-icon name="question-circle-fill" color="#ff9800" size="18" top="1"></u-icon>
-							<view class="item">
-								{{appInfo.number_alias?appInfo.number_alias+':':'点数:'}}{{ userData.coin ? userData.coin : 0 }}
-							</view>
-						</navigator>
-					</block>
-					<block v-else>
-						<navigator @click="getroute"
-							:url="isLogin ?'/pages/user/member/member?id=1':'/pages/user/signin'"
-							class="surplus u-flex align-center">
-							<u-icon name="question-circle-fill" color="#ff9800" size="18" top="1"></u-icon>
-							<view class="item">
-								{{appInfo.number_alias?appInfo.number_alias+':':'点数:'}}{{ userData.coin ? userData.coin : 0 }}
-							</view>
-						</navigator>
-					</block>
-					<blcok v-if="!paintingmode">
-						<navigator @click="getroute"
-							:url="isLogin ?'/pages/user/member/member?id=2':'/pages/user/signin'"
-							class="surplus u-flex align-center" v-if="appInfo.time_member && appInfo.time_member == 1">
-							<u-icon name="clock-fill" color="#607d8b" size="18" top="1"></u-icon>
-							<view class="item">
-								会员时长:{{ userData.is_validity == 1 ? Math.round((userData.vip_time - Date.parse(new Date()) / 1000) / (3600 * 24)) : 0 }}天
-							</view>
-						</navigator>
-					</blcok>
-
-					<!-- <view class="surplus">分享好友赚佣金</view> -->
-					<view v-if="appInfo.is_aipainting&&appInfo.is_aipainting == 1" @click="switcmode"
-						class="surplus u-flex align-center">
-						<u-icon :name="paintingmode?'chat-fill':'edit-pen-fill'" color="#f44336" size="18"
-							top="1"></u-icon>
-						<view class="item">{{paintingmode?'聊天模式':'Ai绘画'}}</view>
-					</view>
-					<navigator @click="getroute" :url="isLogin ?'/pages/user/member/member?id=3':'/pages/user/signin'"
-						class="surplus u-flex align-center">
-						<u-icon name="more-circle-fill" color="#2979ff" size="18" top="1"></u-icon>
-						<view class="item">免费领{{appInfo.number_alias?appInfo.number_alias:'点数'}}</view>
-					</navigator>
-					<view class="surplus u-flex align-center" style="background: #fff0;padding: 1rpx;">
-
-					</view>
-				</view>
-			</scroll-view>
-		</u-popup>
-
-		<wike-skeleton count="4" type="user" v-if="homeTemplate.length === 0"></wike-skeleton>
-
-
-		<u-no-network></u-no-network>
-		<!-- <navigator v-if="is_commission == 1" class="neckBtn_view" url="/pages/user/commission/index">
-			<text class="free_view">分享</text>
-			赚佣金
-		</navigator> -->
-		<u-popup :show="showPoster" mode="bottom" :round="10" safeAreaInsetTop @close="showPoster = false">
-			<view class="poster">
-				<wike-painter :board="posterObj" @success="posterSuccess" ref="painter"></wike-painter>
-				<view class="footer-btn">
-					<view class="" @click="showPoster = false">退出</view>
-					<view class="save" @click="toSave">保存/分享</view>
-				</view>
-			</view>
-		</u-popup>
-		<u-popup :show="soundrecording" mode="bottom" :round="20" safeAreaInsetTop @close="soundrecording = false">
-
-			<view class="soundrecording u-flex justify-center">
-				<view v-if="showlongpress" class="waveform">
-					<image :src="'https://s1.voicecloud.cn/activity/imeVoiceShare/img/yuyin.gif'" mode="aspectFill">
-					</image>
-				</view>
-				<view class="operation u-flex">
-					<!-- <view class="affirm">
-						<image src="/static/tf-speech-recognizer/cancel.png"></image>
-					</view> -->
-
-					<view @touchstart="startrecording" @touchend="stoprecording" class="longpress"
-						hover-class="hoversubmit">
-						<!-- <image disabled src="/static/tf-speech-recognizer/recording.png"></image> -->
-						<u-icon name="mic" color="#fff" size="35"></u-icon>
-					</view>
-					<!-- <view class="affirm">
-						<image src="/static/tf-speech-recognizer/confirm.png"></image>
-					</view> -->
-
-				</view>
-				<view class="discriminate">长按识别语音</view>
-			</view>
-		</u-popup>
-
-
-		<wike-loading-page :isLoading="isLoading"></wike-loading-page>
-		<!-- 生成的图片 -->
-		<u-popup type="center" mode="center">
-			<view class="poster-img">
-				<text @click="closePopup"></text>
-				<!-- <image :src="path" mode="" @click="previewImg"></image> -->
-				<!-- #ifdef H5 -->
-				<view class="">长按图片保存到手机</view>
-				<!-- #endif -->
-				<!-- #ifndef H5 -->
-				<view class="">点击图片保存到手机</view>
-				<!-- #endif -->
-			</view>
-		</u-popup>
-		<u-popup :show="switchmodel" @close="switchmodel = false" :round="15" closeable>
-			<view class="select u-flex justify-center"><text>选择模型</text></view>
-
-			<scroll-view scroll-y="true" :style="{ height: homeTemplate.mode.length > 6 ? 700 + 'rpx' : 'auto' }">
-				<block v-for="(item, index) in homeTemplate.mode" :key="index">
-					<view class="u-flex justify-between model_view">
-						<u-avatar :src="item.img_file.path" shape="square" mode="aspectFill" size="60"></u-avatar>
-						<view class="modelname">
-							<view class="name">{{ item.name }}</view>
-							<view class="modeldetails">{{ item.intro }}</view>
-						</view>
-						<view @click="onselect(index)" class="modelselect"
-							:style="{ background: selectornot == index ? '#9e9e9e' : '' }">
-							{{ selectornot == index ? '已选择' : '选择' }}
-						</view>
-					</view>
-				</block>
-				<view style="height: 30rpx;"></view>
-
-			</scroll-view>
-
-
-		</u-popup>
-
-
-		<!-- <wike-tabbar :onTabbar="true" :isShowAnimate="true"></wike-tabbar> -->
-	</view>
-</template>
-
-<script>
-	// import { indexOf } from 'core-js/js/array';
-	import {
-		Socket
-	} from 'dgram';
-	import {
-		mapMutations,
-		mapActions,
-		mapState,
-		mapGetters
-	} from 'vuex';
-	import {
-		apiurl
-	} from '@/common/request/request';
-	import MumuRecorder from '@/uni_modules/mumu-recorder/components/mumu-recorder/mumu-recorder.vue';
-	import eliseAudio from '@/components/elise-audio/elise-audio.vue';
-	// #ifdef H5
-	import Recorder from 'recorder-core';
-	import 'recorder-core/src/engine/wav'
-	// #endif
-
-	let down, delay;
-	let interstitialAd = null,
-		timer,
-		time2,
-		timingr;
-	// const innerAudioContext = uni.createInnerAudioContext();
-	const recorderManager = uni.getRecorderManager();
-	export default {
-		components: {
-			MumuRecorder,
-			eliseAudio,
-			// #ifdef H5
-			Recorder
-			// #endif
-		},
-		data() {
-			return {
-				gpt_mode_index: 0,
-				talkList: [
-					// {
-					// 	content: '正在思考中...',
-					// 	type: 1,
-					// 	toid: 1,
-					// 	fromid: 6,
-					// 	avatar: 'https://dev.iduomi.cc/addons/wike_chatgpt/public/static/storage/presets/mode/1.png',
-					// 	nickname: '我',
-					// },
-					// {
-					// 	content: '正在思考中,请你耐心的等待不要走开...',
-					// 	type: 1,
-					// 	toid: 1,
-					// 	fromid: -1,
-					// 	avatar: 'https://dev.iduomi.cc/addons/wike_chatgpt/public/static/storage/presets/mode/1.png',
-					// 	nickname: '小助手',
-					// 	show_flash: false,
-					// 	audioId: 'audio1',
-					// 	audiolink: 'https://dev.iduomi.cc/addons/ins_faceai/public/static/mobile/music/bubble.mp3',
-					// 	done: true,
-					// 	playback: false,
-					// },
-					// {
-					// 	content: '正在思考中...',
-					// 	type: 1,
-					// 	toid: 1,
-					// 	fromid: 6,
-					// 	avatar: 'https://dev.iduomi.cc/addons/wike_chatgpt/public/static/storage/presets/mode/1.png',
-					// 	nickname: '我',
-					// },
-					// {
-					// 	content: '是大家好好甘肃省',
-					// 	type: 1,
-					// 	toid: 1,
-					// 	fromid: -1,
-					// 	avatar: 'https://dev.iduomi.cc/addons/wike_chatgpt/public/static/storage/presets/mode/1.png',
-					// 	nickname: '小助手',
-					// 	audioId: 'audio2',
-					// 	audiolink: 'https://dev.iduomi.cc/addons/ins_faceai/public/static/mobile/music/redbone.mp3',
-					// 	show_flash: false,
-					// 	done: true,
-					// 	playback: false,
-					// },
-				],
-				content: '',
-				thecontent: '',
-				image: '',
-				hot: [],
-				scrollTop: 999999,
-				scrollAnimation: false,
-				text1: ['您好,ChatGPT为您服务', '长按对话即可复制'],
-				tobheight: 45,
-				zhuangtai: 'AI智能问答机器人',
-				platform: this.$platform.get(),
-				// isFlash:false,
-				showPoster: false,
-				posterObj: {},
-				switchmodel: false,
-				selectornot: 0,
-				modeldata: [],
-				qrcode: '',
-				haddressurl: '',
-				haddresssk: '',
-				scrollToView: '',
-				question_index: 0,
-				answer_index: 0,
-				themeColor: '#007AFF',
-				codeBgColor: '#26B3A0',
-				showexpand: false,
-
-				second: 15,
-				showanswer: false,
-				h5question: '',
-				followornot: true,
-				eights: false,
-				spmplatform: 0,
-				is_commission: 0,
-				timing: 30,
-				showcontext: true,
-				showfetch: true,
-				showdirect: true,
-				//通道
-				thoroughfare: 0,
-
-				//绘画输入框
-				drawcontent: '',
-				//绘画模式
-				paintingmode: false,
-				//是否在绘画
-				showdraw: false,
-				//绘画id
-				uuid: '',
-				//绘画列表
-				paintinglist: [],
-
-				//弹出录音
-				soundrecording: false,
-				//是否长按
-				showlongpress: false,
-				//音频
-				innerAudioContextsrc: '',
-				//取消音频加载
-				cancel: false,
-				//第一次录
-				firstrecording: 0,
-				isLoading: true
-			};
-		},
-		computed: {
-			...mapGetters(['appInfo', 'isLogin', 'userInfo', 'homeTemplate', 'userData'])
-		},
-		mounted() {
-
-		},
-		onReady() {
-			let that = this;
-			// #ifdef MP-WEIXIN
-			clearTimeout(timer);
-			// 在适合的场景显示插屏广告
-			timer = setTimeout(function() {
-				// 在页面onLoad回调事件中创建插屏广告实例
-				if (wx.createInterstitialAd && that.appInfo.interstitial_status == 1) {
-					interstitialAd = wx.createInterstitialAd({
-						adUnitId: that.appInfo.interstitial_id
-					});
-					interstitialAd.onLoad(() => {});
-					interstitialAd.onError(err => {});
-					interstitialAd.onClose(() => {
-						if (that.appInfo.interstitial_infinite_status == 1) {
-							that.showInterstitial();
-						}
-					});
-					interstitialAd.show().catch(err => {});
-				}
-			}, 4000);
-			// #endif
-		},
-
-		onLoad() {
-			var that = this;
-			if (that.platform == 'wxMiniProgram') {
-				var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight;
-				var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop;
-				that.tobheight = menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height;
-			}
-			if (that.$Route.query.draw) {
-				that.paintingmode = true
-				let pai = {
-					type: 1,
-					toid: 1,
-					fromid: -1,
-					avatar: that.appInfo.aipainting_avatar_path ? that.appInfo.aipainting_avatar_path :
-						'https://img0.baidu.com/it/u=2119417517,3891184201&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
-					nickname: that.appInfo.aipainting_name ? that.appInfo.aipainting_name : 'Ai绘画',
-					content: that.appInfo.aipainting_greetings ? that.appInfo.aipainting_greetings : '欢迎来的Ai绘画的世界',
-					show_flash: false,
-					done: true,
-					donec: true
-				};
-				that.paintinglist.push(pai)
-			}
-			if (this.$Route.query.question) {
-				// #ifdef MP-WEIXIN
-				this.send(this.$Route.query.question);
-				// #endif
-				// #ifdef H5
-				this.h5question = this.$Route.query.question;
-				this.aigetAddress();
-				// #endif
-			}
-			this.spmplatform = ['H5', 'wxOfficialAccount', 'wxMiniProgram', 'App'].indexOf(this.platform) + 1;
-			this.followornot = true;
-			// #ifdef H5
-			this.toaigetAddress();
-			// #endif
-			this.isLoading = false
-			this.initGpt();
-			this.getCommissionSetting()
-			this.onmessage();
-			uni.onSocketError(function(res) {});
-			// #ifdef MP-WEIXIN
-			let self = this;
-			recorderManager.onStop(function(res) {
-				self.aiaudiocheck(res.tempFilePath)
-			});
-			// #endif
-		},
-		onShow: function() {
-			if (this.isLogin) {
-				this.getUserData();
-			}
-		},
-		onUnload() {
-			this.followornot = false;
-			clearInterval(time2);
-			clearTimeout(timingr);
-			uni.$emit('stop')
-			if (this.$ws.socketStatus()) {
-				this.$ws.completeClose();
-			}
-		},
-		onHide() {
-			if (this.$ws.socketStatus()) {
-				this.$ws.completeClose();
-			}
-		},
-		onReachBottom() {},
-		methods: {
-			...mapActions(['getUserInfo', 'showAuthModal', 'getUserData']),
-			switcmode() {
-				this.paintingmode = !this.paintingmode
-				// #ifdef MP-WEIXIN
-				this.zhuangtai = this.paintingmode ? 'Ai绘画' : (this.appInfo.site_name ? this.appInfo.site_name :
-					'Ai问答机器人');
-				// #endif
-				// #ifdef H5
-				uni.setNavigationBarTitle({
-					title: this.appInfo.site_name ? this.appInfo.site_name : 'Ai问答机器人'
-				});
-				this.zhuangtai = this.paintingmode ? 'Ai绘画' : (this.homeTemplate.mode.length ? this.homeTemplate.mode[this
-					.selectornot].name : 'Ai问答机器人');
-				// #endif
-				if (this.paintinglist.length == 0) {
-					let pai = {
-						type: 1,
-						toid: 1,
-						fromid: -1,
-						avatar: this.appInfo.aipainting_avatar_path ? this.appInfo.aipainting_avatar_path :
-							'https://img0.baidu.com/it/u=2119417517,3891184201&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
-						nickname: this.appInfo.aipainting_name ? this.appInfo.aipainting_name : 'Ai绘画',
-						content: this.appInfo.aipainting_greetings ? this.appInfo.aipainting_greetings : '欢迎来的Ai绘画的世界',
-						show_flash: false,
-						done: true,
-						donec: true
-					};
-					this.paintinglist.push(pai)
-				}
-				this.Audio()
-				this.$nextTick(() => {
-					// 清空内容框中的内容
-					this.content = '';
-					uni.pageScrollTo({
-						scrollTop: 9999,
-						duration: 300
-					});
-				});
-			},
-			//开始录音的方法
-			uploadRecord() {
-				// 开始录音
-				if (!this.rec) {
-					// console.log('未打开录音权限');
-					uni.showToast({
-						title: '未打开录音权限'
-					})
-					return;
-				}
-				this.rec.start();
-				this.showlongpress = true
-			},
-			//结束录音的方法
-			h5btn_sub_stop() {
-				// console.log(123123)
-				var This = this;
-				var rec = This.rec;
-				This.rec = null;
-				if (!rec) {
-					// This.reclog("未打开录音", 1);
-					uni.showToast({
-						title: '未打开录音'
-					})
-					return;
-				}
-				rec.stop(function(blob, duration) {
-					var reader = new FileReader();
-					reader.addEventListener("load", function() {
-						// console.log(reader)
-						if (reader.result.length > 100) {
-							This.he_show = true
-						}
-					}, false);
-					reader.readAsDataURL(blob);
-					// console.log(blob,duration,'blob')
-					let blobURL = window.URL.createObjectURL(blob)
-					console.log(blobURL, '--------')
-					This.aiaudiocheck(blobURL)
-				}, function(s) {
-					// This.reclog("结束出错:" + s, 1);
-					// uni.showToast({
-					// 	title: '录音失败',
-					// 	icon: 'none'
-					// })
-					This.showlongpress = false
-				}, true); //自动close
-			},
-
-			getroute() {
-				if (!this.isLogin) {
-					uni.setStorageSync('route', '/pages/chat/chat');
-				}
-				this.Audio()
-			},
-			Audio() {
-				uni.$emit('stop')
-			},
-			aiaudiocheck(e) {
-				var that = this;
-				// console.log(e, '5');
-				uni.showLoading({
-					title: '识别中'
-				})
-				uni.uploadFile({
-					url: apiurl('ai/recognizer'),
-					filePath: e,
-					name: 'speech',
-					header: {
-						platform: that.platform
-					},
-					success: res2 => {
-						// console.log(res2.data);
-						uni.hideLoading();
-						let a = JSON.parse(res2.data);
-						// console.log(a);
-						if (a.code == 0) {
-							uni.showToast({
-								title: '识别成功',
-							})
-							// console.log(a.data.result[0]);
-
-							this.content += a.data.result[0]
-							this.thecontent += a.data.result[0]
-						} else {
-							uni.showToast({
-								title: '识别失败',
-								icon: 'none'
-							})
-						}
-					}
-				});
-			},
-			openmicrophone() {
-				var that = this;
-				this.Audio()
-				this.cancel = true
-				if (!this.isLogin) {
-					uni.navigateTo({
-						url: '/pages/user/signin'
-					});
-					uni.setStorageSync('route', '/pages/chat/chat');
-					return;
-				}
-				// #ifdef H5
-
-				let This = this;
-				let rec = This.rec = Recorder({
-					type: "wav", // wav格式, 需要使用的type类型,需提前把格式支持文件加载进来
-					bitRate: 16, // 比特率kbps,越大音质越好
-					sampleRate: 16000, // 采样率hz,每秒音波震动次数,越大细节越丰富
-					onProcess: function(buffers, powerLevel, duration, sampleRate) {
-						if (duration > 60000) {
-							This.h5btn_sub_stop()
-							This.showlongpress = false
-							This.soundrecording = false
-						}
-					} //录音实时回调,大约1秒调用12次回调
-				});
-				rec.open(function() {
-					// console.log('打开成功:');
-					// 渲染音频波形图
-					This.soundrecording = true
-				}, function(msg, isUserNotAllow) {
-					uni.showToast({
-						title: '麦克风已拒绝打开',
-						icon: 'none'
-					})
-					// 浏览器不支持录音、用户拒绝麦克风权限、或者非安全环境(非https、file等 
-					console.log((isUserNotAllow ? "UserNotAllow," : "") + "无法录音:" + msg);
-				});
-
-				// #endif
-				// #ifdef MP-WEIXIN
-				uni.getSetting({
-					success: (res) => {
-						if (res.authSetting['scope.record'] == false) {
-							uni.showModal({
-								confirmText: '去打开',
-								content: '请先开启麦克风授权',
-								title: '提示',
-								confirmColor: '#26B3A0',
-								success(res) {
-									// console.log(res);
-									if (res.confirm) {
-										uni.openSetting({
-											success: function(ress) {
-												console.log(ress);
-
-											}
-										});
-									}
-								}
-							})
-							return false
-						} else {
-							uni.authorize({
-								scope: 'scope.record',
-								success: (res) => {
-									that.soundrecording = true
-								},
-								fail: (res) => {
-									uni.showToast({
-										title: '麦克风打开失败',
-										icon: 'none'
-									})
-								}
-							})
-						}
-
-					},
-				})
-				// #endif
-
-			},
-			startrecording() {
-				console.log('开始录音');
-				// #ifdef H5
-
-				// this.$refs.recorder.start()
-				this.uploadRecord()
-				// #endif
-
-				// #ifdef MP-WEIXIN
-				recorderManager.start({
-					sampleRate: 16000,
-					numberOfChannels: 1,
-					format: 'aac',
-					duration: 60000
-				})
-				this.showlongpress = true
-				// #endif
-
-			},
-			stoprecording() {
-				console.log('停止录音');
-				// #ifdef H5
-				// this.$refs.recorder.stop()
-				this.h5btn_sub_stop()
-				// #endif
-				// #ifdef MP-WEIXIN
-
-
-				recorderManager.stop();
-				// #endif
-				this.showlongpress = false
-				this.soundrecording = false
-			},
-			aittsjob(res) {
-				// console.log(res);
-				this.talkList[res.index].audiolink = res.speech_url
-				// console.log(this.talkList);
-				// this.context = uni.createInnerAudioContext();
-				// this.context.src = res.speech_url;
-				// this.context.play()
-			},
-
-
-			sendpainting(e) {
-				if (!this.isLogin) {
-					uni.navigateTo({
-						url: '/pages/user/signin'
-					});
-					uni.setStorageSync('route', '/pages/chat/chat');
-					return;
-				}
-				if (this.showdraw) {
-					uni.showToast({
-						title: '正在绘制中,请等待绘制完成',
-						icon: 'none'
-					})
-					return;
-				}
-				if (!e) {
-					uni.showToast({
-						title: '请输入文本',
-						icon: 'none'
-					})
-					return;
-				}
-				uni.showLoading({})
-				this.$http('ai.painting', {
-					prompt: e
-				}).then(res => {
-					if (res.code == 0) {
-						uni.hideLoading();
-						this.uuid = res.data.Uuid
-						this.showdraw = true
-						this.showTask()
-
-						let data = {
-							id: new Date().getTime(),
-							content: e,
-							type: 1,
-							toid: this.toid,
-							fromid: this.userInfo.id,
-							avatar: this.userInfo.avatar,
-							nickname: this.userInfo.nickname,
-							done: true
-						};
-						this.paintinglist.push(data);
-						let chat_data = {
-							id: new Date().getTime(),
-							content: '正在绘制中,请等待...',
-							type: 2,
-							toid: this.toid,
-							fromid: -1,
-							avatar: this.appInfo.aipainting_avatar_path ? this.appInfo
-								.aipainting_avatar_path :
-								'https://img0.baidu.com/it/u=2119417517,3891184201&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
-							nickname: this.appInfo.aipainting_name ? this.appInfo
-								.aipainting_name : 'Ai绘画',
-						};
-						this.paintinglist.push(chat_data);
-						this.getUserData();
-						this.$nextTick(() => {
-							// 清空内容框中的内容
-							this.content = '';
-							uni.pageScrollTo({
-								scrollTop: 9999,
-								duration: 300
-							});
-						});
-					} else {
-						this.uuid = ''
-						this.showdraw = false
-					}
-				});
-			},
-			showTask() {
-				this.$http('ai.showTask', {
-					uuid: this.uuid
-				}).then(res => {
-					if (res.code == 0) {
-						if (res.data == 'wait') {
-							setTimeout(() => {
-								this.showTask()
-							}, 1500);
-							return;
-						}
-						uni.showToast({
-							title: '绘制完成'
-						})
-						this.paintinglist.pop();
-						let chat_data = {
-							id: new Date().getTime(),
-							img: res.data,
-							type: 3,
-							toid: this.toid,
-							fromid: -1,
-							avatar: this.appInfo.aipainting_avatar_path ? this.appInfo
-								.aipainting_avatar_path :
-								'https://img0.baidu.com/it/u=2119417517,3891184201&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
-							nickname: this.appInfo.aipainting_name ? this.appInfo
-								.aipainting_name : 'Ai绘画',
-						};
-						this.paintinglist.push(chat_data);
-						this.showdraw = false
-						this.$nextTick(() => {
-							// 清空内容框中的内容
-							this.content = '';
-							uni.pageScrollTo({
-								scrollTop: 9999,
-								duration: 300
-							});
-						});
-
-					} else {
-						this.uuid = ''
-						this.showdraw = false
-						this.paintinglist.pop();
-					}
-				});
-			},
-			initGpt() {
-				// console.log(this.homeTemplate.mode);
-
-				// #ifdef MP-WEIXIN
-				this.zhuangtai = this.paintingmode ? 'Ai绘画' : (this.appInfo.site_name ? this.appInfo
-					.site_name :
-					'Ai问答机器人');
-
-				// #endif
-				// #ifdef H5
-				uni.setNavigationBarTitle({
-					title: this.appInfo.site_name ? this.appInfo.site_name : 'Ai问答机器人'
-				});
-				this.zhuangtai = this.paintingmode ? 'Ai绘画' : (this.homeTemplate.mode.length ? this
-					.homeTemplate.mode[this
-						.selectornot].name : 'Ai问答机器人');
-				// #endif
-
-				this.commonqrcodePath();
-
-				//
-				// this.onmessage();
-			},
-			touchmove() {
-				this.followornot = false;
-
-			},
-			getCommissionSetting() {
-				this.$http('conf.getGroupConf', {
-					group: 'system.commission'
-				}).then(res => {
-					if (res.code == 0) {
-						this.is_commission = res.data.is_commission
-					}
-				});
-			},
-			//wss返回数据
-			onmessage() {
-				let that = this,
-					message = '';
-				uni.onSocketMessage(function(res) {
-					that.showanswer = true;
-					let a = res.data;
-					if (a.indexOf('wike_err:') != -1) {
-						uni.showToast({
-							title: '报错:' + a,
-							icon: 'none'
-						});
-						that.talkList[that.question_index].show_flash = false;
-						that.talkList[that.question_index].content = '报错:' + a;
-						that.talkList[that.question_index].done = true;
-						return;
-					}
-					if (!that.$ws.socketStatus()) {
-						uni.showToast({
-							title: '连接错误',
-							icon: 'none'
-						});
-						that.talkList[that.question_index].show_flash = false;
-						that.talkList[that.question_index].content = '报错';
-						return;
-					}
-					if (a.indexOf('[DONE]') != -1) {
-						that.$nextTick(() => {
-							that.timing = that.appInfo.text_expire_time ? Number(that
-								.appInfo
-								.text_expire_time) : 30;
-							that.showcontext = true;
-							that.getcontext()
-							that.talkList[that.question_index].show_flash = false;
-							that.talkList[that.question_index].done = true;
-							that.record(that.talkList[that.answer_index].content, message);
-							message = '';
-							if (that.$ws.socketStatus()) {
-								that.$ws.completeClose();
-							}
-							that.$nextTick(() => {
-								if (that.followornot) {
-									uni.pageScrollTo({
-										scrollTop: 9999,
-										duration: 0
-									});
-								}
-
-							});
-						});
-					} else {
-
-
-						var b = a.split('data:').filter(w => !!w.trim() && w.trim() !== '[DONE]');
-						var c = '';
-						b.map(w => JSON.parse(w))
-							.map(w => (c = w.choices[0].delta.content))
-							.join('');
-
-
-						if (that.followornot) {
-							uni.pageScrollTo({
-								scrollTop: 9999,
-								duration: 0
-							});
-						}
-						// });
-						if (c != undefined) {
-							message += c;
-						}
-
-						if (that.thoroughfare == 1) {
-							that.talkList[that.question_index].content = message;
-						}
-
-
-					}
-				});
-
-			},
-			getcontext() {
-				var that = this;
-				that.timing--;
-				// console.log(that.timing);
-				if (that.timing == 0) {
-					// console.log('关闭上下文定时器');
-					clearTimeout(timingr);
-					that.timing = that.appInfo.text_expire_time ? Number(that.appInfo.text_expire_time) :
-						30;
-					// console.log('取消下文关联');
-					that.showcontext = false
-					return;
-				}
-				timingr = setTimeout(() => {
-					that.getcontext();
-				}, 1000);
-			},
-			waitWss() {
-				return new Promise((resolve, reject) => {
-					uni.onSocketOpen(function(res) {
-
-						// console.log('WebSocket连接已打开!');
-						resolve(1);
-					});
-				});
-			},
-			waitClose() {
-				return new Promise((resolve, reject) => {
-					uni.onSocketClose(function(res) {
-						// console.log('WebSocket 已关闭!');
-						resolve(1);
-					});
-				});
-			},
-			aigetAddress() {
-				var that = this;
-				that.$http('ai.getAddress').then(res => {
-					if (res.code == 0) {
-						that.haddressurl = res.data.url;
-						that.haddresssk = res.data.sk;
-						// that.hAddress = res.data
-						that.send(that.h5question);
-					}
-				});
-			},
-			toaigetAddress() {
-				var that = this;
-				that.$http('ai.getAddress').then(res => {
-					if (res.code == 0) {
-						that.haddressurl = res.data.url;
-						that.haddresssk = res.data.sk;
-						// that.hAddress = res.data
-					}
-				});
-			},
-			commonqrcodePath() {
-				let spm = this.userInfo.id + '.1.0.' + this.spmplatform + '.1';
-				this.$http('common.qrcodePath', {
-					spm: spm
-				}).then(res => {
-					if (res.code == 0) {
-						this.qrcode = res.data;
-					}
-				});
-			},
-			getImage() {
-				uni.switchTab({
-					url: '/pages/user/user'
-				});
-			},
-			copy(e) {
-				var that = this;
-				var text = e.currentTarget.dataset.text;
-				uni.setClipboardData({
-					data: text,
-					success(res) {
-						uni.getClipboardData({
-							success(res) {}
-						});
-					}
-				});
-			},
-			changeinput(e) {},
-			focusinput() {
-				this.showexpand = false;
-				this.$nextTick(() => {
-
-
-					uni.pageScrollTo({
-						scrollTop: 9999,
-						duration: 300
-					});
-				});
-				if (!this.isLogin) {
-					uni.navigateTo({
-						url: '/pages/user/signin'
-					});
-					uni.setStorageSync('route', '/pages/chat/chat');
-					return;
-				}
-			},
-			blurinput() {
-				// this.showexpand = true;
-			},
-			commontemplate() {
-				this.$store.dispatch('getTemplate');
-			},
-			//敏感词过滤检测
-			getcheckText() {
-				var that = this;
-				return new Promise((resolve, reject) => {
-					that.$http('ai.checkText', {
-						prompt: that.thecontent
-					}).then(res => {
-						if (res.code == 0) {
-							resolve(1);
-						} else {
-							let data = {
-								id: new Date().getTime(),
-								content: '该问题已被隐藏!',
-								type: 1,
-								toid: that.toid,
-								fromid: that.userInfo.id,
-								avatar: that.userInfo.avatar,
-								nickname: that.userInfo.nickname,
-								done: true
-							};
-							that.talkList.push(data);
-							let chat_data = {
-								id: new Date().getTime(),
-								content: res.msg,
-								type: 1,
-								toid: this.toid,
-								fromid: -1,
-								avatar: this.homeTemplate.mode[this.selectornot]
-									.img_file.path,
-								nickname: this.homeTemplate.mode[this.selectornot]
-									.name,
-								show_flash: false,
-								done: true,
-								donec: true
-							};
-							this.talkList.push(chat_data);
-							this.$nextTick(() => {
-								// 清空内容框中的内容
-								this.content = '';
-								uni.pageScrollTo({
-									scrollTop: 9999,
-									duration: 300
-								});
-							});
-						}
-					})
-				});
-			},
-			// 发送信息
-			async send(e) {
-				let that = this;
-				// console.log('1');
-				if (!this.isLogin) {
-					uni.navigateTo({
-						url: '/pages/user/signin'
-					});
-					uni.setStorageSync('route', '/pages/chat/chat');
-					return;
-				}
-
-				if (that.appInfo.time_member && that.appInfo.time_member == 1) {
-					if (that.userData.is_validity == 0) {
-						if (that.userData.coin <= 0) {
-							var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
-							uni.showModal({
-								confirmText: '立即获取',
-								confirmColor: '#26B3A0',
-								content: '您的提问' + alias + '/会员时长不足',
-								title: '提示',
-								success(res) {
-									if (res.confirm) {
-										uni.navigateTo({
-											url: '/pages/user/member/member'
-										});
-									}
-								}
-							});
-							return;
-						}
-					}
-				} else {
-					if (that.userData.coin <= 0) {
-						var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
-						uni.showModal({
-							confirmText: '立即获取',
-							confirmColor: '#26B3A0',
-							content: '您的提问' + alias + '/会员时长不足',
-							title: '提示',
-							success(res) {
-								if (res.confirm) {
-									uni.navigateTo({
-										url: '/pages/user/member/member'
-									});
-								}
-							}
-						});
-						return;
-					}
-				}
-				if (!this.appInfo.sk && this.appInfo.connect_lines && this.appInfo.connect_lines ==
-					2) {
-					uni.showToast({
-						title: '未正确配置key',
-						icon: 'none'
-					});
-					return;
-				}
-
-				if (that.talkList.length > 1 && !that.talkList[that.talkList.length - 1].done) {
-					uni.showToast({
-						title: '正在输入回答,请等待输入完成',
-						icon: 'none'
-					});
-					return;
-				}
-				if (!e) {
-					uni.showToast({
-						title: '请输入有效的内容',
-						icon: 'none'
-					});
-					return;
-				}
-				this.thecontent = e;
-				// console.log('提问内容检测');
-				uni.showLoading({})
-				// #ifdef H5
-				let check = this.appInfo.is_h5_filter && this.appInfo.is_h5_filter == 1 ? await this
-					.getcheckText() :
-					1;
-				// #endif
-				// #ifdef MP-WEIXIN
-				let check = await this.getcheckText();
-				// #endif
-				if (check == 1) {
-					uni.hideLoading();
-					// 将当前发送信息 添加到消息列表。
-					let data = {
-						id: new Date().getTime(),
-						content: e,
-						type: 1,
-						toid: this.toid,
-						fromid: this.userInfo.id,
-						avatar: this.userInfo.avatar,
-						nickname: this.userInfo.nickname,
-						done: true
-					};
-					this.talkList.push(data);
-
-					let chat_data = {
-						id: new Date().getTime(),
-						content: '正在思考中...',
-						type: 1,
-						toid: this.toid,
-						fromid: -1,
-						avatar: this.homeTemplate.mode[this.selectornot].img_file.path,
-						nickname: this.homeTemplate.mode[this.selectornot].name,
-						show_flash: true,
-						done: false
-					};
-					this.talkList.push(chat_data);
-					this.$nextTick(() => {
-						// 清空内容框中的内容
-						this.content = '';
-						uni.pageScrollTo({
-							scrollTop: 99999,
-							duration: 300
-						});
-					});
-
-					// 重置是否来数据的判断
-					this.showanswer = false;
-					// this.show_flash = true;
-					// 允许跟随到最底部
-					this.followornot = true;
-					// 关闭重置上下文的30秒倒计时
-					clearTimeout(timingr);
-					this.timing = 30;
-					// #ifdef MP-WEIXIN
-					// 判断是否连接wss
-					if (!this.$ws.socketStatus()) {
-						// 重置倒计时15秒后的wss未返数据走直连模式
-						this.showdirect = true;
-						// 重置倒计时8秒后wss未返数据走fetch模式
-						this.showfetch = true;
-						// console.log('15秒倒计时开始');
-						this.countdown();
-						// console.log('重连wss');
-						this.$ws.init();
-						let re = await this.waitWss();
-						if (re == 1) {
-							// console.log('等待wss打开后执行');
-							this.getChatGPT(e);
-						}
-					} else {
-
-						// 关闭wss
-						if (this.$ws.socketStatus()) {
-							that.$ws.completeClose();
-						}
-						// console.log('15秒倒计时开始');
-						this.countdown();
-						// #ifdef H5
-						// console.log('倒计时8秒后不再走fetch模式');
-						// that.showfetch = false;
-						// console.log('走方案2');
-						// that.fetchmodel(that.thecontent);
-						// #endif
-
-						let answer = '';
-						if (that.talkList.length > 2 && that.showcontext) {
-							// answer = that.talkList[that.talkList.length - 4].content + '\n' + that
-							// 	.talkList[that
-							// 		.talkList.length - 3].content;
-							answer = that.talkList[that.talkList.length - 3].content;
-						}
-						// console.log(answer);
-						// console.log('倒计时15秒后不再走直连模式');
-						this.showdirect = false;
-						this.directGpt(that.thecontent, answer);
-
-					}
-
-					// #endif
-
-					// #ifdef H5
-					// console.log('15秒倒计时开始');
-					this.countdown();
-					// console.log('倒计时8秒后不再走fetch模式');
-					that.showfetch = false;
-					// console.log('走方案2');
-					that.fetchmodel(that.thecontent);
-					// #endif
-				}
-			},
-
-			//定时器
-			countdown() {
-				var that = this;
-				that.second--;
-
-				if (that.second == 0) {
-					// console.log('15秒定时结束');
-					// console.log(that.question_index);
-					if (!that.showanswer) {
-						let answer = '';
-						if (that.talkList.length > 2 && that.showcontext) {
-							// answer = that.talkList[that.question_index - 3].content + '\n' + that.talkList[
-							// 	that.talkList
-							// 	.length - 3].content;
-							answer = that.talkList[that.talkList.length - 3].content;
-							// console.log(answer);
-						}
-						uni.showLoading({
-							title: '加载中...'
-						});
-						// clearTimeout(down);
-						// console.log('关闭定时器');
-						// #ifdef MP-WEIXIN
-						if (that.$ws.socketStatus()) {
-							// console.log('关闭直连');
-							that.$ws.completeClose();
-						}
-						// #endif
-						if (that.showdirect) {
-							setTimeout(() => {
-								uni.hideLoading();
-								that.second = 15;
-								that.directGpt(that.thecontent, answer);
-							}, 1500);
-						} else {
-							uni.hideLoading();
-							that.second = 15;
-							if (that.talkList[that.question_index].content == '正在思考中...') {
-								that.talkList[that.question_index].content = '请等我几秒钟,正在输入回答...';
-							}
-
-						}
-						return;
-					} else {
-						that.second = 15;
-						clearTimeout(down);
-						// console.log('关闭定时器');
-					}
-					// clearTimeout(down);
-					return;
-				}
-				// #ifdef H5
-				if (that.second == 8 && that.showfetch) {
-					// console.log('8秒定时结束');
-					if (!that.showanswer) {
-						if (that.$ws.socketStatus()) {
-							that.$ws.completeClose();
-							// console.log('关闭直连');
-						}
-						// if (that.showfetch) {
-						that.fetchmodel(that.thecontent);
-						// }
-
-					} else {
-						that.second = 15;
-						clearTimeout(down);
-						// console.log('关闭定时器');
-					}
-				}
-				// #endif
-
-				down = setTimeout(() => {
-					// console.log(that.showanswer);
-					if (that.showanswer) {
-						clearTimeout(down);
-						// console.log('关闭定时器');
-						that.second = 15;
-						return;
-					}
-					that.countdown();
-				}, 1000);
-				// console.log(second);
-			},
-			// sendrepeat(e) {
-			// 	if (this.paintingmode) {
-			// 		this.sendpainting(this.paintinglist[e].content)
-			// 		return;
-			// 	}
-
-			// 	this.send(this.talkList[e].content)
-			// },
-			//wss模式
-			getChatGPT(e) {
-				var that = this;
-				let i = 1,
-					message = '';
-				this.question_index = that.talkList.length - 1;
-				this.answer_index = that.talkList.length - 2;
-				// this.eights = false;
-
-				// that.$http('ai.checkText', {
-				// 	prompt: e
-				// }).then(res => {
-				// 	if (res.code == 0) {
-				let answer = '';
-				if (that.talkList.length > 2 && that.showcontext) {
-					// answer = that.talkList[that.question_index - 3].content + '\n' + that.talkList[that
-					// 		.question_index - 2]
-					// 	.content;
-					answer = that.talkList[that.question_index - 2].content;
-				}
-				// console.log(answer);
-				var ty = {
-					prompt: e,
-					guide: that.homeTemplate.mode[that.selectornot].guide,
-					answer: answer,
-					key: that.appInfo.sk ? that.appInfo.sk : '',
-					lines: that.appInfo.connect_lines ? this.appInfo.connect_lines : 1
-				};
-				var json = JSON.stringify(ty);
-				// if (that.$ws.socketStatus()) {
-				// console.log('走方案1');
-				that.thoroughfare = 1
-				that.$ws.send(json);
-				// } else {
-				// that.eights = true;
-				// that.directGpt(e, answer);
-				// }
-				// } else {
-				// 	that.talkList[that.question_index].content = res.msg;
-				// 	that.talkList[that.question_index - 1].content = '该问题已被隐藏!';
-				// 	that.talkList[that.question_index].show_flash = false;
-				// 	that.talkList[that.question_index].done = true;
-				// }
-				// });
-
-			},
-			//php模式
-			directGpt(e, answer) {
-				// console.log('走方案3');
-				let that = this;
-				// console.log(that.appInfo.sk);
-				if (!that.appInfo.sk && this.appInfo.connect_lines && this.appInfo.connect_lines ==
-					2) {
-					uni.showToast({
-						title: '未正确配置key',
-						icon: 'none'
-					});
-					return;
-				}
-				this.question_index = that.talkList.length - 1;
-				if (this.showdirect) {
-					that.talkList[that.question_index].content = '请等我几秒钟,正在输入回答...';
-				}
-				// this.showdirect = false;
-				that.showanswer = this.showdirect;
-				that.thoroughfare = 3
-				that.$http('ai.chat', {
-					prompt: e,
-					guide: that.homeTemplate.mode[that.selectornot].guide,
-					answer: answer
-				}).then(res => {
-					if (that.thoroughfare == 3) {
-						if (res.code == 0) {
-							that.talkList[that.question_index].content = res.data.trim();
-							that.talkList[that.question_index].show_flash = false;
-							that.talkList[that.question_index].done = true;
-						} else if (res.code == 3) {
-							that.talkList[that.question_index].content = res.msg;
-							that.talkList[that.question_index].show_flash = false;
-							that.talkList[that.question_index].done = true;
-						} else {
-							that.talkList[that.question_index].content = res.msg;
-							that.talkList[that.question_index - 1].content = '该问题已被隐藏!';
-							that.talkList[that.question_index].show_flash = false;
-							that.talkList[that.question_index].done = true;
-						}
-						that.showanswer = true;
-						that.getUserData();
-						that.timing = that.appInfo.text_expire_time ? Number(that.appInfo
-							.text_expire_time) : 30;
-						that.showcontext = true;
-						that.getcontext();
-						that.$nextTick(() => {
-							// 清空内容框中的内容
-							that.content = '';
-							if (that.followornot) {
-								uni.pageScrollTo({
-									scrollTop: 9999,
-									duration: 300
-								});
-							}
-						});
-					}
-				});
-			},
-			//fetch模式
-			fetchmodel(e) {
-				// console.log('走方案2');
-				var that = this;
-				let i = 1,
-					message = '';
-				let answer = '';
-				that.thoroughfare = 2;
-				this.question_index = that.talkList.length - 1;
-				this.answer_index = that.talkList.length - 2;
-				if (that.talkList.length > 2 && that.showcontext) {
-					// answer = that.talkList[that.question_index - 3].content + '\n' + that.talkList[that
-					// 		.question_index - 2]
-					// 	.content;
-					answer = that.talkList[that.question_index - 2].content;
-				}
-
-				let param = {
-					max_tokens: 3000,
-					model: 'gpt-3.5-turbo-0301',
-					stream: true,
-					messages: [{
-							role: 'assistant',
-							content: answer
-						},
-						{
-							role: 'system',
-							content: that.homeTemplate.mode[that.selectornot].guide
-						},
-						{
-							role: 'user',
-							content: e
-						}
-					]
-				};
-				let headers = {};
-				if (that.appInfo.connect_lines == 2) {
-					headers = {
-						'Content-Type': 'application/json',
-						Authorization: 'Bearer' + ' ' + that.haddresssk
-					}
-				}
-				// console.log(that.haddressurl,headers,param,that.appInfo.connect_lines);
-				fetch(that.haddressurl, {
-						method: 'POST',
-						body: JSON.stringify(param),
-						headers: headers
-					})
-					.then(x => {
-						if (x.status === 200) return x.body;
-						throw x;
-					})
-					.then(x => {
-						const k = x.getReader();
-
-						return new ReadableStream({
-							start(V) {
-								function F() {
-									k.read().then(({
-										done: E,
-										value: U
-									}) => {
-
-										that.showanswer = true;
-										if (E) {
-											// console.log('done', E)
-											// , V.close();
-											that.timing = that.appInfo
-												.text_expire_time ? Number(that
-													.appInfo.text_expire_time) : 30;
-											that.showcontext = true;
-											that.getcontext();
-											that.record(that.talkList[that
-													.answer_index].content,
-												message);
-											that.talkList[that.question_index]
-												.show_flash = false;
-											that.talkList[that.question_index].done =
-												true;
-											that.getUserData();
-											if (that.followornot) {
-												uni.pageScrollTo({
-													scrollTop: 9999,
-													duration: 300
-												});
-											}
-
-											return;
-										}
-										V.enqueue(U);
-										const L = new TextDecoder().decode(U);
-
-										try {
-											const G = L.match(/data:\s/g),
-												j = L.split('data:').filter(w => !!w
-													.trim() && w
-													.trim() !== '[DONE]');
-											// console.log(j);
-											// let N = null;
-
-											let N = j
-												.map(w => JSON.parse(w))
-												.map(w => (N = w.choices[0].delta
-													.content))
-												.join('');
-
-
-											if (N != undefined) {
-												message += N;
-											}
-											if (that.thoroughfare == 2) {
-												that.talkList[that.question_index]
-													.content = message;
-											}
-											// let C = null;
-											let C = j
-												.map(w => JSON.parse(w))
-												.map(w => (N = w.choices[0]
-													.finish_reason))
-												.join('');
-											if (C == 'stop') {
-												that.timing = that.appInfo
-													.text_expire_time ? Number(
-														that.appInfo.text_expire_time
-													) : 30;
-												that.showcontext = true;
-												that.getcontext();
-												that.record(that.talkList[that
-														.answer_index].content,
-													message);
-												that.talkList[that.question_index]
-													.show_flash = false;
-												that.talkList[that.question_index]
-													.done = true;
-												that.getUserData();
-												// if (that.followornot) {
-												// 	uni.pageScrollTo({
-												// 		scrollTop: 9999,
-												// 		duration: 300
-												// 	});
-												// }
-												setTimeout(() => {
-													uni.pageScrollTo({
-														scrollTop: 9999,
-														duration: 300
-													});
-												}, 100);
-
-												return;
-											}
-											// console.log(C,'1');
-											if (that.followornot) {
-												uni.pageScrollTo({
-													scrollTop: 9999,
-													duration: 0
-												});
-											}
-										} catch (G) {
-											// console.error(G,'1');
-										}
-										F();
-									});
-								}
-								F();
-							}
-						});
-					})
-					.then(x =>
-						new Response(x, {
-							headers: {
-								'Content-Type': 'text/html'
-							}
-						}).text()
-					);
-			},
-			// 记录回答
-			record(question, answer) {
-				let that = this;
-				this.$http('question.add', {
-					question,
-					answer
-				}).then(res => {
-					if (res.code == 0) {
-						that.getUserData();
-						// console.log(that.question_index);
-					} else {
-						that.talkList[that.question_index].content = res.msg;
-						that.talkList[that.question_index - 1].content = '该问题已被隐藏!';
-						that.talkList[that.question_index].show_flash = false;
-						that.talkList[that.question_index].done = true;
-						that.talkList[that.question_index].donec = true;
-					}
-
-				});
-			},
-			// 复制文本
-			copyText(e) {
-				uni.setClipboardData({
-					data: this.talkList[e].content,
-					success: function() {
-						// console.log('success');
-						uni.showToast({
-							title: '复制成功'
-						});
-					}
-				});
-			},
-			// 插屏广告显示时间
-			showInterstitial() {
-				time2 = setInterval(
-					function() {
-						interstitialAd.show().catch(err => {
-							// console.error(err);
-						});
-					},
-					this.appInfo.gap ? this.appInfo.gap * 1000 : 12000
-				);
-			},
-			// 生成图片
-			toSave() {
-				uni.showLoading({
-					title: '海报生成中'
-				});
-				this.$refs.painter.canvasToTempFilePathSync({
-					// 在nvue里是jpeg
-					fileType: 'jpg',
-					quality: 1,
-					success: res => {
-						// this.path = res.tempFilePath;
-						// this.$refs.posterImg.open();
-						// this.show_poster = true;
-
-						// console.log(res.tempFilePath);
-						// 非H5 保存到相册
-						// H5 提示用户长按图另存
-						// #ifdef MP-WEIXIN
-						// uni.saveImageToPhotosAlbum({
-						// 	filePath: res.tempFilePath,
-						// 	success: function() {
-						// 		uni.showToast({
-						// 			title: '保存成功'
-						// 		});
-						// 		that.showPoster = false;
-						// 	}
-						// });
-
-						wx.showShareImageMenu({
-							path: res.tempFilePath
-						})
-						this.showPoster = false;
-						uni.hideLoading();
-						// #endif
-						// #ifdef H5
-						this.showPoster = false;
-						uni.hideLoading();
-						uni.showModal({
-							confirmColor: '#26B3A0',
-							confirmText: '查看图片',
-							title: '提示',
-							content: '查看图片后长按图片即可保存或分享',
-							success(src) {
-								if (src.confirm) {
-									uni.previewImage({
-										urls: [res.tempFilePath]
-									});
-								} else if (src.cancel) {
-									this.showPoster = true;
-								}
-							}
-						});
-						// #endif
-					}
-				});
-			},
-			//预览图片
-			preview(e) {
-				uni.previewImage({
-					urls: [this.paintinglist[e].img],
-
-				});
-			},
-			//选择模型
-			onselect(e) {
-				if (this.selectornot != e) {
-					let data = {
-						content: uni.$u.trim(this.homeTemplate.mode[e].greetings),
-						type: 1,
-						toid: this.toid,
-						fromid: -1,
-						avatar: this.homeTemplate.mode[e].img_file.path,
-						nickname: this.homeTemplate.mode[e].name,
-						done: true,
-						donec: true
-					};
-					this.talkList.push(data);
-					this.$nextTick(() => {
-						uni.pageScrollTo({
-							scrollTop: 9999,
-							duration: 300
-						});
-					});
-				}
-				this.showcontext = false
-				this.switchmodel = this.selectornot == e ? true : false;
-				this.selectornot = e;
-				// #ifdef H5
-				this.zhuangtai = this.homeTemplate.mode[e].name;
-				// #endif
-			},
-			posterSuccess(e) {
-				// console.log(e);
-
-			},
-			// 海报绘制
-			createPoster(e) {
-				let that = this;
-				(this.posterObj = {
-					width: '670rpx',
-					background: '#fff',
-					borderRadius: '16rpx',
-					css: {
-						// 根节点若无尺寸,自动获取父级节点
-						width: '670rpx'
-					},
-					views: [{
-							type: 'view',
-							css: {
-								marginTop: '20rpx',
-								paddingLeft: '10rpx',
-								display: 'flex'
-							},
-							views: [{
-									type: 'image',
-									src: this.userInfo.avatar ? this.userInfo.avatar :
-										'/static/images/head.jpg',
-									css: {
-										marginTop: '10rpx',
-										marginLeft: '10rpx',
-										borderRadius: '16rpx',
-										width: '80rpx',
-										height: '80rpx',
-										border: '2rpx solid #fff',
-										objectFit: 'cover'
-									}
-								},
-								{
-									type: 'view',
-									css: {
-										marginTop: '10rpx',
-										marginLeft: '20rpx'
-										// display:'flex',
-										// flexDirection:'column'
-									},
-									views: [{
-											type: 'view',
-											views: [{
-												type: 'text',
-												text: this.userInfo.nickname ? this
-													.userInfo
-													.nickname : '提问者',
-												css: {
-													marginTop: '10rpx',
-													fontSize: '28rpx',
-													fontWeight: 'bold',
-													color: '#1A2033',
-													lineHeight: '28rpx'
-												}
-											}]
-										},
-										{
-											type: 'view',
-											views: [{
-												type: 'text',
-												text: '我的提问',
-												css: {
-													marginTop: '15rpx',
-													fontSize: '22rpx',
-													// fontWeight: 'bold',
-													color: '#999',
-													lineHeight: '25rpx'
-												}
-											}]
-										}
-									]
-								}
-							]
-						},
-						{
-							type: 'view',
-							css: {
-								marginTop: '20rpx',
-								width: '610rpx',
-								padding: '10rpx',
-								background: '#d2f8d3',
-								borderRadius: '16rpx',
-								marginLeft: '20rpx',
-								marginRight: '10rpx'
-							},
-							views: [{
-								type: 'text',
-								text: that.talkList[e - 1].content,
-								css: {
-									fontSize: '28rpx',
-									color: '#1A2033',
-									lineHeight: '45rpx',
-									lineClamp: 2,
-									paddingLeft: '10rpx',
-									paddingRight: '10rpx',
-									width: '590rpx'
-									// padding:'10rpx'
-								}
-							}]
-						},
-						{
-							type: 'view',
-							css: {
-								marginTop: '20rpx',
-								paddingLeft: '10rpx',
-								display: 'flex'
-							},
-							views: [{
-									type: 'image',
-									// src: this.homeTemplate.mode&&this.homeTemplate.mode[this.selectornot].img_file.path?this.homeTemplate.mode[this.selectornot].img_file.path:'/static/images/head.jpg',
-									src: '/static/images/open.png',
-									css: {
-										marginTop: '10rpx',
-										marginLeft: '10rpx',
-										borderRadius: '16rpx',
-										width: '80rpx',
-										height: '80rpx',
-										border: '2rpx solid #fff',
-										objectFit: 'cover'
-									}
-								},
-								{
-									type: 'view',
-									css: {
-										marginTop: '10rpx',
-										marginLeft: '20rpx'
-										// display:'flex',
-										// flexDirection:'column'
-									},
-									views: [{
-											type: 'view',
-											views: [{
-												type: 'text',
-												text: this.appInfo.site_name ? this
-													.appInfo
-													.site_name : 'AI智能问答机器人',
-												css: {
-													marginTop: '10rpx',
-													fontSize: '28rpx',
-													fontWeight: 'bold',
-													color: '#1A2033',
-													lineHeight: '28rpx'
-												}
-											}]
-										},
-										{
-											type: 'view',
-											views: [{
-												type: 'text',
-												text: '回答结果',
-												css: {
-													marginTop: '15rpx',
-													fontSize: '22rpx',
-													// fontWeight: 'bold',
-													color: '#999',
-													lineHeight: '25rpx'
-												}
-											}]
-										}
-									]
-								}
-							]
-						},
-						{
-							type: 'view',
-							css: {
-								marginTop: '20rpx',
-								width: '610rpx',
-								padding: '10rpx',
-								background: '#f5f6f8',
-								borderRadius: '16rpx',
-								marginLeft: '20rpx',
-								marginRight: '10rpx'
-							},
-							views: [{
-								type: 'text',
-								text: uni.$u.trim(that.talkList[e].content),
-								css: {
-									fontSize: '28rpx',
-									color: '#1A2033',
-									lineHeight: '45rpx',
-									lineClamp: 11,
-									width: '590rpx',
-									// paddingLeft: '10rpx',
-									// paddingTop: '10rpx',
-									padding: '10rpx'
-								}
-							}]
-						},
-						{
-							type: 'view',
-							css: {
-								marginTop: '20rpx',
-								width: '100%',
-								textAlign: 'center'
-							},
-							// #ifdef H5
-							views: [{
-								type: 'qrcode',
-								text: this.qrcode,
-								css: {
-									width: '200rpx',
-									height: '200rpx'
-								}
-							}],
-							// #endif
-							// #ifdef MP-WEIXIN
-							views: [{
-								type: 'image',
-								src: this.qrcode,
-								css: {
-									width: '200rpx',
-									height: '200rpx'
-								}
-							}]
-							// #endif
-						},
-						{
-							type: 'text',
-							text: '————  ' + '长按识别 | 欢迎使用' + '  ————',
-							css: {
-								marginTop: '20rpx',
-								width: '100%',
-								textAlign: 'center',
-								fontSize: '24rpx',
-								color: '#989FB3',
-								lineHeight: '33rpx'
-							}
-						}
-					]
-				}),
-				(this.showPoster = true);
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	@import '@/pages/chat/global.scss';
-	@import './chat.scss';
-</style>

+ 0 - 112
pages/chat2/global.scss

xqd
@@ -1,112 +0,0 @@
-/* 根元素样式 设置页面背景、字体大小、字体颜色,字符间距、长单词换行 */
-page {
-  background-color: #f3f3f3;
-  font-size: 28rpx;
-  box-sizing: border-box;
-  color: #333;
-  letter-spacing: 0;
-  word-wrap: break-word;
-}
-
-/* 设置常用元素尺寸规则 */
-view,textarea,input,label,form,button,image{box-sizing: border-box;}
-/* 按钮样式处理 */
-button{font-size: 28rpx;}
-/* 取消按钮默认的边框线效果 */
-button:after{border:none;}
-/* 设置图片默认样式,取消默认尺寸 */
-image{display: block;height: auto;width: auto;}
-/* 输入框默认字体大小 */
-textarea,input{font-size: 28rpx;};
-
-/* 列式弹性盒子 */
-.flex_col {
-  display: flex;
-  flex-direction: row;
-  flex-wrap: nowrap;
-  justify-content: flex-start;
-  align-items: center;
-  align-content: center;
-}
-/* 行式弹性盒子 */
-.flex_row {
-  display: flex;
-  flex-direction: column;
-  flex-wrap: nowrap;
-  justify-content: flex-start;
-  align-items: flex-start;
-  align-content: flex-start;
-}
- 
-/* 弹性盒子弹性容器 */
-.flex_col .flex_grow{width:0;flex-grow: 1;}
-.flex_row .flex_grow{flex-grow: 1;}
- 
-/* 弹性盒子允许换行 */
-.flex_col.flex_wrap{flex-wrap: wrap;}
- 
-/* 弹性盒子居中对齐 */
-.flex_col.flex_center,.flex_row.flex_center{justify-content: center;}
- 
-/* 列式弹性盒子两端对齐 */
-.flex_col.flex_space{justify-content: space-between;}
-
-/* 弹性盒子快速分栏 ,这里非常郁闷 uniapp 居然不支持 * 选择器 */
-.flex_col.flex_col_2>view{width: 50%;}
-.flex_col.flex_col_3>view{width: 33.33333%;}
-.flex_col.flex_col_4>view{width: 25%;}
-.flex_col.flex_col_5>view{width: 20%;}
-.flex_col.flex_col_6>view{width: 16.66666%;}
-
-/* 字体颜色 */
-.color_333 {color: #333;}
-.color_666 {color: #666;}
-.color_999 {color: #999;}
-.color_ccc {color: #ccc;}
-.color_fff {color: #fff;}
-.color_6dc{color: #6dca6d;}
-.color_d51{color: #d51917;}
-.color_09f{color: #0099ff;}
- 
-/* 背景色*/
-.bg_fff{background-color: #ffffff;}
- 
-/* 字体大小 */
-.size_10 {font-size: 20rpx;}
-.size_12 {font-size: 24rpx;}
-.size_14 {font-size: 28rpx;}
-.size_16 {font-size: 32rpx;}
-.size_18 {font-size: 36rpx;}
-.size_20 {font-size: 40rpx;}
- 
-/* 字体加粗 */
-.font_b{font-weight: bold;}
- 
-/* 对齐方式 */
-.align_c{text-align: center;}
-.align_l{text-align: left;}
-.align_r{text-align: right;}
- 
-/* 遮罩 */
-.shade{
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  background-color: rgba(0,0,0,0.8);
-  z-index: 100;
-}
- 
-/* 弹窗 */
-.shade_box{
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  margin: auto;
-  z-index: 101;
-  min-width: 200rpx;
-  min-height: 200rpx;
-}

+ 133 - 59
pages/index/scoreDetail/index.vue

xqd xqd xqd xqd xqd xqd
@@ -63,6 +63,10 @@
 		wxPayPamars,
 		wxConfigPamars,
 	} from '@/api/public/index.js'
+	import {
+		myScoreOrder,
+		myScoreOrderDetail
+	} from '@/api/my/index.js'
 
 	import ShoproPay from '@/common/pay';
 	import wxsdk from '@/common/wechat/sdk'
@@ -79,7 +83,9 @@
 				tobheight: 45,
 
 				detail: {},
-				course_id: ''
+				course_id: '',
+				scoreOrderList: [],
+				currPayOrderList: []
 			};
 		},
 		computed: {
@@ -97,6 +103,10 @@
 				this.detail = res.data
 			}
 			console.log('课程详情返回值', res);
+
+
+
+
 		},
 		onReady() {
 
@@ -108,6 +118,17 @@
 
 		},
 		methods: {
+			async hasWaitingPayOrder() {
+				let resss = await myScoreOrder()
+				if (resss.code == 0) {
+					this.scoreOrderList = resss.data
+
+					this.currPayOrderList = this.scoreOrderList.filter((item, index) => {
+						return item.course_id == this.course_id
+					})
+				}
+			},
+
 			jumpToKefu() {
 				uni.navigateTo({
 					url: '/pages/user/public/kefu'
@@ -115,6 +136,7 @@
 			},
 			async goStudy(course_id) {
 				// console.log(isWechat());
+
 				if (!isWechat()) {
 					uni.showToast({
 						title: '请用微信内置浏览器打开本网站,进行课程购买!',
@@ -122,76 +144,128 @@
 					})
 					return
 				}
-				let res1 = await shopCourse({
-					course_id
-				})
-				console.log('立即学习(下单)返回值', res1);
-				if (res1.code == 0) {
-					// uni.showToast({
-					// 	title: '下单成功',
-					// 	icon: 'success'
-					// })
-
-					let res2 = await wxPayPamars({
-						order_id: res1.data.id
-					})
-					let url = window.location.href.split('#')[0]
-					let res3 = await wxConfigPamars({
-						url: url
-					})
 
-					console.log('res2返回值', res2);
-					console.log('res3返回值', res3);
-					// http://localhost:8080/h5/pages/index/scoreDetail/index?id=44
-					if (res2.code == 0 && res3.code == 0) {
-						wxsdk.wxpay(res3.data, res2.data, (res) => {
-							if (res.errMsg == "chooseWXPay:ok") {
+				// this.hasWaitingPayOrder(
+				// 判断是否存在待支付的订单
+				let resss = await myScoreOrder()
+				if (resss.code == 0) {
+					this.scoreOrderList = resss.data
+
+					this.currPayOrderList = this.scoreOrderList.filter((item, index) => {
+						return item.course_id == this.course_id
+					})
+				}
+				if (this.currPayOrderList.length != 0) {
+					console.log('当前购买课程的待支付订单列表', this.currPayOrderList, resss);
+					if (this.currPayOrderList[0].status) {
+						uni.showToast({
+							title: '你已购买过该课程,请勿重复购买!',
+							icon: 'none',
+							duration: 1500
+						})
+					} else {
+						let res2 = await wxPayPamars({
+							order_id: this.currPayOrderList[0].id
+						})
+						let url = window.location.href.split('#')[0]
+						let res3 = await wxConfigPamars({
+							url: url
+						})
+						if (res2.code == 0 && res3.code == 0) {
+							wxsdk.wxpay(res3.data, res2.data, (res) => {
+								if (res.errMsg == "chooseWXPay:ok") {
+									// uni.showToast({
+									// 	title: '付款成功',
+									// 	icon: 'success',
+									// 	duration: 1500
+									// })
+									setTimeout(() => {
+										uni.navigateTo({
+											url: '/pages/index/scorePaySuc/index?id=' + this
+												.course_id
+										})
+									}, 1500)
+								} else {
+									uni.showToast({
+										title: '支付失败,请稍后重试!',
+										icon: 'error',
+										duration: 1500
+									})
+								}
+							});
+						} else {
+							if (res2.code != 0) {
 								uni.showToast({
-									title: '付款成功',
-									icon: 'success',
+									title: res.msg,
+									icon: 'none',
 									duration: 1500
 								})
-								setTimeout(() => {
-									uni.navigateTo({
-										url: '/pages/index/scorePaySuc/index?id=' + this
-											.course_id
-									})
-								}, 1500)
-							} else {
+							} else if (res3.code != 0) {
 								uni.showToast({
-									title: '支付失败,请稍后重试!',
-									icon: 'error',
+									title: res.msg,
+									icon: 'none',
 									duration: 1500
 								})
 							}
-						});
-					} else {
-						if (res2.code != 0) {
-							uni.showToast({
-								title: res.msg,
-								icon: 'none',
-								duration: 1500
-							})
-						} else if (res3.code != 0) {
-							uni.showToast({
-								title: res.msg,
-								icon: 'none',
-								duration: 1500
-							})
 						}
-					}
 
-
-					// setTimeout(() => {
-					// 	uni.navigateTo({
-					// 		url: '/pages/index/scorePaySuc/index?id=' + course_id
-					// 	})
-					// }, 1000)
+					}
 				} else {
-					uni.showToast({
-						title: res.msg,
-						icon: 'none'
+					let res1 = await shopCourse({
+						course_id
 					})
+					console.log('立即学习(下单)返回值', res1);
+					if (res1.code == 0) {
+						let res2 = await wxPayPamars({
+							order_id: res1.data.id
+						})
+						let url = window.location.href.split('#')[0]
+						let res3 = await wxConfigPamars({
+							url: url
+						})
+						if (res2.code == 0 && res3.code == 0) {
+							wxsdk.wxpay(res3.data, res2.data, (res) => {
+								if (res.errMsg == "chooseWXPay:ok") {
+									// uni.showToast({
+									// 	title: '付款成功',
+									// 	icon: 'success',
+									// 	duration: 1500
+									// })
+									setTimeout(() => {
+										uni.navigateTo({
+											url: '/pages/index/scorePaySuc/index?id=' + this
+												.course_id
+										})
+									}, 1500)
+								} else {
+									uni.showToast({
+										title: '支付失败,请稍后重试!',
+										icon: 'error',
+										duration: 1500
+									})
+								}
+							});
+						} else {
+							if (res2.code != 0) {
+								uni.showToast({
+									title: res.msg,
+									icon: 'none',
+									duration: 1500
+								})
+							} else if (res3.code != 0) {
+								uni.showToast({
+									title: res.msg,
+									icon: 'none',
+									duration: 1500
+								})
+							}
+						}
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						})
+					}
 				}
 			}
 		}

+ 26 - 1
pages/tusk/tuskDetail/index.vue

xqd xqd xqd xqd
@@ -65,12 +65,18 @@
 		receiveOrder,
 		taskDetail
 	} from '@/api/tusk/index.js'
+	import {
+		myTaskOrder
+	} from '@/api/my/index.js'
 	export default {
 		components: {},
 		data() {
 			return {
 				tobheight: 45,
-				detail: {}
+				detail: {},
+
+				// alreadyReTimes: 0,
+				taskOrderList: [],
 			};
 		},
 		computed: {
@@ -87,6 +93,13 @@
 				this.detail = res.data
 			}
 			console.log('任务详情返回值', res);
+
+
+			let res1 = await myTaskOrder()
+			if (res1.code == 0) {
+				this.taskOrderList = res1.data
+				console.log('任务详情----全部任务返回值', res1, this.taskOrderList.length);
+			}
 		},
 		onReady() {
 
@@ -105,6 +118,16 @@
 			},
 
 			async handleReceiveOrder(task_id) {
+				if (this.detail.is_new) {
+					if (this.taskOrderList.length > 3) {
+						console.log('新用户限制次数-已接单', this.taskOrderList.length);
+						uni.showToast({
+							title: '接单失败,您已不是新用户',
+							icon: 'none'
+						})
+						return
+					}
+				}
 				if (this.detail.max_count == this.detail.order_total) {
 					uni.showToast({
 						title: '接单失败,允许的最大接单人数是:' + this.detail.max_count,
@@ -113,6 +136,8 @@
 					return
 				}
 
+
+
 				let res = await receiveOrder({
 					task_id
 				})

+ 9 - 5
pages/user/commission/commission-log2.vue

xqd xqd
@@ -67,12 +67,12 @@
 								<view class="log-name">{{ item.title }}</view>
 								<view class="log-notice">{{ item.created_at }}</view>
 
-								<!-- 	<view class="nextUser">
-									<image class="nextAvatar" src="../../../static/add.png" mode=""></image>
+								<view class="nextUser">
+									<image class="nextAvatar" src="/static/images/head.jpg" mode=""></image>
 									<view class="nextUserName">
-										张三
+										{{item.description.mobile}}
 									</view>
-								</view> -->
+								</view>
 							</view>
 						</view>
 						<view class="item-right">
@@ -198,9 +198,13 @@
 			}
 
 			let res = await recommendList()
-			console.log('推广佣金明细返回值', res);
 			if (res.code == 0) {
+				res.data.data.forEach((item, index) => {
+					item.description = JSON.parse(item.description)
+				})
+
 				this.commissionList = res.data.data
+				console.log('推广佣金明细返回值', res, this.commissionList);
 			}
 		},
 		onShow() {

+ 92 - 9
pages/user/score/record/index.vue

xqd xqd xqd
@@ -41,11 +41,19 @@
 	import {
 		apiurl
 	} from '@/common/request/request';
-
 	import {
-		myScoreOrder
+		courseDetail,
+		shopCourse
+	} from '@/api/score/index.js'
+	import {
+		myScoreOrder,
+		myScoreOrderDetail
 	} from '@/api/my/index.js'
-
+	import {
+		wxPayPamars,
+		wxConfigPamars,
+	} from '@/api/public/index.js'
+	import wxsdk from '@/common/wechat/sdk'
 	import empty from '@/components/empty/empty.vue'
 	export default {
 		components: {
@@ -56,13 +64,21 @@
 				loginType: 'h5', //app.globalData.loginType
 				tobheight: 45,
 
-				scoreOrderList: []
+				scoreOrderList: [],
+				course_id: ''
 			};
 		},
 		computed: {
 			...mapGetters(['appInfo', 'isLogin', 'userInfo'])
 		},
 		async onLoad() {
+			// let res = await myScoreOrder()
+			// if (res.code == 0) {
+			// 	this.scoreOrderList = res.data
+			// }
+			// console.log('我的课程订单返回值', res);
+		},
+		async onShow() {
 			let res = await myScoreOrder()
 			if (res.code == 0) {
 				this.scoreOrderList = res.data
@@ -70,11 +86,78 @@
 			console.log('我的课程订单返回值', res);
 		},
 		methods: {
-			goScoreDetail(score) {
-				//getApp().scoreDetail = score
-				uni.navigateTo({
-					url: '/pages/user/score/index?id=' + score.id
-				})
+			async goScoreDetail(score) {
+				this.course_id = score.course_id
+				if (score.status) {
+					uni.navigateTo({
+						url: '/pages/user/score/index?id=' + score.id
+					})
+				} else {
+					console.log('score信息', score, score.status);
+
+					// let res1 = await shopCourse({
+					// 	course_id: score.course_id
+					// })
+
+					let res1 = await myScoreOrderDetail({
+						course_order_id: score.id
+					})
+					if (res1.code == 0) {
+						let res2 = await wxPayPamars({
+							order_id: res1.data.id
+						})
+						let url = window.location.href.split('#')[0]
+						let res3 = await wxConfigPamars({
+							url: url
+						})
+
+						console.log('res2返回值', res2);
+						console.log('res3返回值', res3);
+						// http://localhost:8080/h5/pages/index/scoreDetail/index?id=44
+						if (res2.code == 0 && res3.code == 0) {
+							wxsdk.wxpay(res3.data, res2.data, (res) => {
+								if (res.errMsg == "chooseWXPay:ok") {
+									// uni.showToast({
+									// 	title: '付款成功',
+									// 	icon: 'success',
+									// 	duration: 1500
+									// })
+									setTimeout(() => {
+										uni.navigateTo({
+											url: '/pages/index/scorePaySuc/index?id=' + this
+												.course_id
+										})
+									}, 1500)
+								} else {
+									uni.showToast({
+										title: '支付失败,请稍后重试!',
+										icon: 'error',
+										duration: 1500
+									})
+								}
+							});
+						} else {
+							if (res2.code != 0) {
+								uni.showToast({
+									title: res.msg,
+									icon: 'none',
+									duration: 1500
+								})
+							} else if (res3.code != 0) {
+								uni.showToast({
+									title: res.msg,
+									icon: 'none',
+									duration: 1500
+								})
+							}
+						}
+					} else {
+						uni.showToast({
+							title: res.msg,
+							icon: 'none'
+						})
+					}
+				}
 			},
 
 			...mapActions(['logout']),

+ 1 - 1
pages/user/work/detail/index.vue

xqd
@@ -28,7 +28,7 @@
 				{{detail.task_name}}
 			</view>
 			<view class="des" style="color:#999;font-size: 30rpx;">
-				任务人数:{{detail.task_order_complete}}人/{{detail.task_order_total}}人
+				任务人数:{{detail.task_order_total}}人/{{detail.task.max_count}}人
 			</view>
 			<view class="content" v-if='detail.task'>
 				{{detail.task.intro}}