Browse Source

AI助手版本

zhengjinyi 11 months ago
parent
commit
e9417d46f4

+ 35 - 3
common/css/iconfont.scss

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 1519039 */
-  src: url('//at.alicdn.com/t/c/font_1519039_1hleu97y1mi.woff2?t=1722216368869') format('woff2'),
-       url('//at.alicdn.com/t/c/font_1519039_1hleu97y1mi.woff?t=1722216368869') format('woff'),
-       url('//at.alicdn.com/t/c/font_1519039_1hleu97y1mi.ttf?t=1722216368869') format('truetype');
+  src: url('//at.alicdn.com/t/c/font_1519039_r79lcbz9qh.woff2?t=1722564732002') format('woff2'),
+       url('//at.alicdn.com/t/c/font_1519039_r79lcbz9qh.woff?t=1722564732002') format('woff'),
+       url('//at.alicdn.com/t/c/font_1519039_r79lcbz9qh.ttf?t=1722564732002') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,38 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-iconfontzhizuobiaozhun023110:before {
+  content: "\e670";
+}
+
+.icon-xiaoxi:before {
+  content: "\e600";
+}
+
+.icon-message:before {
+  content: "\e61d";
+}
+
+.icon-xiaoxi1:before {
+  content: "\e61e";
+}
+
+.icon-xiaoxi2:before {
+  content: "\e61f";
+}
+
+.icon-xiaoxijilu-1:before {
+  content: "\e75b";
+}
+
+.icon-AIzhushou:before {
+  content: "\e9f5";
+}
+
+.icon-aizhushou:before {
+  content: "\e65a";
+}
+
 .icon-fasong:before {
   content: "\e61b";
 }

+ 7 - 8
components/cm-module/homeIndex/customer.vue

@@ -20,11 +20,9 @@
                     <view class="search-btn">搜索</view>
                 </view>
                 <view class="gosearch-kf">
-                    <!-- #ifdef MP-WEIXIN -->
-                    <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
-                        <text class="iconfont icon-zixunrexian"></text>
-                    </button>
-                    <!-- #endif -->
+                    <view class="contact-btn" @click.stop="handleToChat">
+                        <text class="iconfont icon-AIzhushou"></text>
+                    </view>
                 </view>
             </view>
             <view class="swiper-banner-nav">
@@ -159,6 +157,9 @@
             btnCloseDrop() {
                 this.dropScreenShow = false
             },
+            handleToChat(){
+                this.$api.navigateTo('/pages/user/chats/index')
+            },
             handleContact(e) {
                 console.log(e.detail.path)
                 console.log(e.detail.query)
@@ -290,16 +291,14 @@
             float: left;
             line-height: 70rpx;
             text-align: center;
-
             .contact-btn {
                 width: 70rpx;
                 height: 70rpx;
                 background-color: rgba(0, 0, 0, 0);
                 line-height: 70rpx;
                 text-align: center;
-
                 .iconfont {
-                    font-size: $font-size-48;
+                    font-size: 50rpx;
                     color: #ff5b00;
                 }
             }

+ 13 - 7
components/cm-module/scrollTop/scrollTop.vue

@@ -1,14 +1,13 @@
 <template name="scrollTop">
-    <!-- 商品详情价格判断 -->
     <view>
         <view class="scrollTop" :style="{ bottom: bottom + 'rpx' }">
             <view class="icon msg" v-if="isShowKefu">
                 <!-- #ifdef MP-WEIXIN -->
-                <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
+               <button class="contact-btn" open-type="contact" @bindcontact="handleContact">
                     <text class="iconfont icon-zixunrexian"></text>
                 </button>
                 <!-- #endif -->
-            </view>
+            </view> 
             <view class="icon top" @click="onPageScrollTop" :class="isScrollTop ? 'show' : 'none'">
                 <text class="iconfont icon-zhiding"></text>
             </view>
@@ -16,7 +15,8 @@
     </view>
 </template>
 
-<script>
+<script>
+import { mapState, mapMutations } from 'vuex'
 export default {
     name: 'scrollTop',
     props: {
@@ -46,7 +46,10 @@ export default {
             isShowIcon: true
         }
     },
-    created() {},
+    created() {},
+    computed: {
+        ...mapState(['hasLogin'])
+    },
     methods: {
         onPageScrollTop() {
             uni.pageScrollTo({
@@ -87,8 +90,11 @@ export default {
                 color: #ffffff;
             }
         }
-        &.msg {
-            background-image: linear-gradient(0deg, #f28e31 0%, #ff5b00 100%);
+        &.msg {
+            background-color: #ffe6dc;
+            .iconfont {
+                color: #ff5b00;
+            }
         }
         &.top {
             background-color: rgba(0, 0, 0, 0.4);

+ 3 - 1
pages.json

@@ -598,7 +598,9 @@
 				{
 					"path": "chats/index",
 					"style": {
-						"navigationBarTitleText": "采美AI助手"
+						"navigationBarTitleText": "采美Ai助手",
+                        "enablePullDownRefresh": true
+                        // "navigationStyle": "custom"
 					}
 				}
 				

+ 2 - 4
pages/goods/product.vue

@@ -556,8 +556,6 @@
 						</view>
 					</view>
 				</view>
-				<!-- 侧边 -->
-				<scroll-top :isScrollTop="isScrollTop" :bottom="240" v-show="tabCurrentIndex !== 3"></scroll-top>
 			</view>
 		</template>
 		<!-- 商品参数 -->
@@ -597,12 +595,12 @@
 		/>
 		<!-- 供应商收集用户信息弹窗 -->
 		<cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml" :advertisInfo="advertisement" />
-
 		<!-- 分享弹窗 -->
 		<cm-share-popup ref="sharePopup" :data="posterData" type="product" />
-
 		<!-- 协销名片 -->
 		<cm-seller-modal :suid="suid" />
+        <!-- 侧边 -->
+        <scroll-top :isScrollTop="isScrollTop" :bottom="240" :isShowKefu="true" v-show="tabCurrentIndex !== 3" />
 	</view>
 </template>
 

+ 3 - 12
pages/login/bindwechat.vue

@@ -97,7 +97,7 @@
 			this.getVerificationCode()
 		},
 		computed: {
-			...mapState(['isWxAuthorize','isLoginType','isLoginProductId','isLoginOrderId'])
+			...mapState(['isWxAuthorize','isLoginType','isLoginOrderId'])
 		},
 		methods:{
 			...mapMutations(['login','wxLogin']),
@@ -163,18 +163,9 @@
             		    }
             		} else {
                       if(this.userIdentity === 3){
-                      	this.$api.navigateTo('/pages/supplier/index/index')
+                            this.$api.navigateTo('/pages/supplier/index/index')
                       }else{
-                          const map = {
-                              7:`/pages/user/order/order-details?type=share&orderId=${this.isLoginOrderId}`,
-                              8:`/pages/goods/product?id=${this.isLoginProductId}`,
-                              9:'/pages/h5/activity/activity_mid'
-                          }
-                          if(this.isLoginType){
-                              this.$api.navigateTo(map[this.isLoginType])
-                          }else{
-                              this.$api.switchTabTo('/pages/tabBar/user/user')
-                          }
+                            this.$api.switchTabTo('/pages/tabBar/user/user')
                       }
             		}
             		uni.removeStorageSync('LOGIN_REDIRECT_URL')

+ 274 - 274
pages/login/logincode.vue

@@ -1,277 +1,277 @@
-
-<template>
-	<view class="container login">
-		<view class="login-main">
-			<image class="logo" src="https://static.caimei365.com/app/img/icon/logo@2x.png" mode=""></image>
-		</view>
-		<view class="login-input">
-			<keyInput
-				borderValueColor="#E1E1E1"
-				borderActiveColor="#E1E1E1"
-				ref="vcodeInputRef"
-				@vcodeInput="keyInput"
-				@vcodeChange="keyInputChangeHandle"
-				sum="6"
-			>
-			</keyInput>
-		</view>
-		<button class="login-btn"  @click.stop="goLogin" :class="isDisabled ? 'disabled' : ''" :disabled="isDisabled">邀请码登录</button>
-		<view class="login-tips">
-			邀请码是采美平台为了方便机构内成员互相邀请并快速注册采美账号推出的一项邀请机制。机构成员在任一渠道(包括采美365网站和微信“采美采购商城”小程序)注册了采美账号,该成员可在其个人中心添加其他机构成员,系统自动为每一个成员生成邀请码。其他成员使用邀请码可直接登录“采美采购商城”小程序。
-		</view>
-	</view>
-</template>
-
-<script>
-	import authorize from '@/common/config/authorize.js'
-	import wxLogin from '@/common/config/wxLogin.js'
-	import {mapState,mapMutations } from 'vuex'
-	import keyInput from '@/components/uni-keyinput/uni-keyinput'
-	
-	export default{
-		components: { 
-			keyInput 
-		},
-		data() {
-			return{
-				params:{
-					invitationCode:'',//获取用户登录的邀请码
-					unionId:0,
-					nickName:'',
-					avatarUrl:'',
-				},
-			}
-		},
-		onLoad(option) {
-
-		},
-		computed: {
-			...mapState(['isWxAuthorize','isLoginType','isLoginProductId','isLoginOrderId']),
-			isDisabled() {// 邀请码长度是否符合要求
-				return this.params.invitationCode.trim().length < 6
-			},
-		},
-		methods:{
-			...mapMutations(['login','wxLogin']),
-			goLogin(){
-				if( this.params.invitationCode == ''){
-					this.$util.msg('请输入邀请码',2000)
-					return
-				}
-				this.isUserInfo = false
-				this.params.unionId = uni.getStorageSync('unionId')
-				// 友盟埋点邀请码确认登录点击事件
-				if(process.env.NODE_ENV != 'development'){
-					this.$uma.trackEvent('Um_Event_InvitationCode', {
-						Um_Key_PageName: '邀请码登录',
-						Um_Key_SourcePage: '邀请码页面',
-					})
-				}
-				this.GetUserProfile()
-			},
-			navigatorRegirst(url){
-				// 友盟埋点注册入口点击事件
-				if(process.env.NODE_ENV != 'development'){
-					this.$uma.trackEvent('Um_Event_zhuce', {
-						Um_Key_PageName: '立即注册',
-						Um_Key_SourcePage: '个人中心',
-					})
-				}
-				this.$api.navigateTo(url)
-			},
-			GetUserProfile(){//获取用户微信个人信息
-				const self = this
-				wx.getUserProfile({
-					desc: '采美采购商城小程序获取您的信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
-					success(res) {
-						console.log('微信获取用户信息新API',res)	
-						self.wxLogin(res.userInfo)	
-						self.params.nickName = res.userInfo.nickName
-						self.params.avatarUrl = res.userInfo.avatarUrl
-						self.BindingWechat(self.params)
-					},
-					fail() {
-						self.$util.msg('授权失败', 2000)
-					}
-				})
-			},
+<template>
+    <view class="container login">
+        <view class="login-main">
+            <image class="logo" src="https://static.caimei365.com/app/img/icon/logo@2x.png" mode=""></image>
+        </view>
+        <view class="login-input">
+            <keyInput borderValueColor="#E1E1E1" borderActiveColor="#E1E1E1" ref="vcodeInputRef" @vcodeInput="keyInput"
+                @vcodeChange="keyInputChangeHandle" sum="6">
+            </keyInput>
+        </view>
+        <button class="login-btn" @click.stop="goLogin" :class="isDisabled ? 'disabled' : ''"
+            :disabled="isDisabled">邀请码登录</button>
+        <view class="login-tips">
+            邀请码是采美平台为了方便机构内成员互相邀请并快速注册采美账号推出的一项邀请机制。机构成员在任一渠道(包括采美365网站和微信“采美采购商城”小程序)注册了采美账号,该成员可在其个人中心添加其他机构成员,系统自动为每一个成员生成邀请码。其他成员使用邀请码可直接登录“采美采购商城”小程序。
+        </view>
+    </view>
+</template>
+
+<script>
+    import authorize from '@/common/config/authorize.js'
+    import wxLogin from '@/common/config/wxLogin.js'
+    import { mapState, mapMutations } from 'vuex'
+    import keyInput from '@/components/uni-keyinput/uni-keyinput'
+
+    export default {
+        components: {
+            keyInput
+        },
+        data() {
+            return {
+                params: {
+                    invitationCode: '', //获取用户登录的邀请码
+                    unionId: 0,
+                    nickName: '',
+                    avatarUrl: '',
+                },
+            }
+        },
+        onLoad(option) {
+
+        },
+        computed: {
+            ...mapState(['isWxAuthorize', 'isLoginType', 'isLoginOrderId']),
+            isDisabled() { // 邀请码长度是否符合要求
+                return this.params.invitationCode.trim().length < 6
+            },
+        },
+        methods: {
+            ...mapMutations(['login', 'wxLogin']),
+            goLogin() {
+                if (this.params.invitationCode == '') {
+                    this.$util.msg('请输入邀请码', 2000)
+                    return
+                }
+                this.isUserInfo = false
+                this.params.unionId = uni.getStorageSync('unionId')
+                // 友盟埋点邀请码确认登录点击事件
+                if (process.env.NODE_ENV != 'development') {
+                    this.$uma.trackEvent('Um_Event_InvitationCode', {
+                        Um_Key_PageName: '邀请码登录',
+                        Um_Key_SourcePage: '邀请码页面',
+                    })
+                }
+                this.GetUserProfile()
+            },
+            navigatorRegirst(url) {
+                // 友盟埋点注册入口点击事件
+                if (process.env.NODE_ENV != 'development') {
+                    this.$uma.trackEvent('Um_Event_zhuce', {
+                        Um_Key_PageName: '立即注册',
+                        Um_Key_SourcePage: '个人中心',
+                    })
+                }
+                this.$api.navigateTo(url)
+            },
+            GetUserProfile() { //获取用户微信个人信息
+                const self = this
+                wx.getUserProfile({
+                    desc: '采美采购商城小程序获取您的信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+                    success(res) {
+                        console.log('微信获取用户信息新API', res)
+                        self.wxLogin(res.userInfo)
+                        self.params.nickName = res.userInfo.nickName
+                        self.params.avatarUrl = res.userInfo.avatarUrl
+                        self.BindingWechat(self.params)
+                    },
+                    fail() {
+                        self.$util.msg('授权失败', 2000)
+                    }
+                })
+            },
             async BindingWechat(params) {
-            	//绑定微信并登陆
-            	try{
-            		await this.UserService.InvitationCodeLogin(params)
+                //绑定微信并登陆
+                try {
+                    await this.UserService.InvitationCodeLogin(params)
+                    const url = uni.getStorageSync('LOGIN_REDIRECT_URL')
                     wxLogin.wxLoginAuthorize()
-            		const url = uni.getStorageSync('LOGIN_REDIRECT_URL')
-            		if (url) {
-            		    if (url.indexOf('tabBar') > -1) {
-            		        uni.switchTabTo(url)
-            		    } else {
-            				this.$api.reLaunch(url)
-            		    }
-            		} else {
-                      if(this.userIdentity === 3){
-                      	this.$api.navigateTo('/pages/supplier/index/index')
-                      }else{
-                          const map = {
-                              7:`/pages/user/order/order-details?type=share&orderId=${this.isLoginOrderId}`,
-                              8:`/pages/goods/product?id=${this.isLoginProductId}`,
-                              9:'/pages/h5/activity/activity_mid'
-                          }
-                          if(this.isLoginType){
-                              this.$api.navigateTo(map[this.isLoginType])
-                          }else{
-                              this.$api.switchTabTo('/pages/tabBar/user/user')
-                          }
-                      }
-            		}
-            		uni.removeStorageSync('LOGIN_REDIRECT_URL')
-            	}catch(error){
-            		this.$util.msg(error.msg, 2000)
+                    setTimeout(() => {
+                        if (url) {
+                            if (url.indexOf('tabBar') > -1) {
+                                uni.switchTabTo(url)
+                            } else {
+                                this.$api.reLaunch(url)
+                            }
+                        } else {
+                            if (this.userIdentity === 3) {
+                                this.$api.navigateTo('/pages/supplier/index/index')
+                            } else {
+                                this.$api.switchTabTo('/pages/tabBar/user/user')
+                            }
+                        }
+                        uni.removeStorageSync('LOGIN_REDIRECT_URL')
+                    }, 1000)
+                } catch (error) {
+                    this.$util.msg(error.msg, 2000)
                     this.isUserInfo = false
-            	}
-            },
-			keyInput(val) {// 输入框输入介绍
-				// this.params.invitationCode = val
-				console.log(val)
-			},
-			keyInputChangeHandle(val) {// 输入框输入事件
-				this.params.invitationCode = val
-				// console.log(val)
-			},
-			setFocus() {// 控制组件获取焦点
-				this.$refs.VcodeInput.setFocus()
-			},
-			
-			setBlur() {// 控制组件失去焦点
-				this.$refs.VcodeInput.setBlur()
-			},
-			clearValue() {// 清除已输入
-				this.$refs.VcodeInput.clearValue()
-			},
-			InitAuthorize(){ //是否已授权 0:为取消授权 1:为已授权 2:为未操作
-				wxLogin.wxLoginQuick()
-			}
-		},
-		onShow() {
-			this.$api.getStorage().then((resolve) =>{
-				this.params.unionId = resolve.unionId ? resolve.unionId : 0
-			})
-			this.InitAuthorize()
-		}
-	}
-</script>
-
-<style lang="scss">
-	.login{
-		width: 100%;
-		height: auto;
-		.model-warp.none{
-			display: none;			
-		}
-		.model-warp.show{
-			display: block;
-		}
-		.login-main{
-			width: 100%;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			height: 284rpx;
-			padding:60rpx 0 40rpx 0;
-			margin-bottom: 70rpx;
-			.logo{
-				width:611rpx;
-				height: 284rpx;
-				display: block;
-			}
-		}
-		.login-input{
-			width: 600rpx;
-			height: 88rpx;
-			padding: 24rpx 0;
-			margin: 30rpx auto;
-			margin-bottom: 30rpx;
-			background: #FFFFFF;
-			position: relative;
-		}
-		.login-row{
-			padding: 0 75rpx;
-			font-size: $font-size-28;
-			line-height: 40rpx;
-			color: #FF5B00;
-			margin-bottom: 48rpx;
-			text-align: right;
-		}
-		.login-btn{
-			width: 600rpx;
-			height: 88rpx;
-			border-radius: 44rpx;
-			font-size: $font-size-28;
-			line-height: 88rpx;
-			color: #FFFFFF;
-			margin: 0 auto;
-			text-align: center;
-			background:$btn-confirm;
-			&.disabled{
-				background: #E1E1E1;
-			}
-		}
-		.login-btn-last{
-			width: 600rpx;
-			height: 86rpx;
-			border-radius: 44rpx;
-			font-size: $font-size-28;
-			line-height: 88rpx;
-			color: $color-system;
-			margin: 0 auto;
-			text-align: center;
-			border: 1px solid $color-system;
-			margin-top: 20rpx;
-		}
-		.login-tips{
-			width: 100%;
-			height: auto;
-			margin-top: 80rpx;
-			box-sizing: border-box;
-			padding: 0 75rpx;
-			line-height: 44rpx;
-			font-size: $font-size-20;
-			color: #fea785;
-			text-align: justify;
-			text-indent: 40rpx;
-		}
-		.model-authorization{
-			width: 100%;
-			height: 100%;
-			position: fixed;
-			top: 0;
-			left: 0;
-			z-index: 999;
-			.authorization{
-				width: 518rpx;
-				height: 320rpx;
-				position: absolute;
-				background: rgba(255,255,255,.7);
-				left: 0;
-				right: 0;
-				bottom: 0;
-				top: 0;
-				margin: auto;
-				.to-btn{
-					position: absolute;
-					top: 0;
-					left: 0;
-					right: 0;
-					bottom: 0;
-					margin: auto;
-					width: 70%;
-					height: 88rpx;
-					font-size: $font-size-28;
-					line-height: 88rpx;
-					color: #FFFFFF;
-					text-align: center;
-					border-radius: 44rpx;
-				}
-			}
-		}
-	}
-</style>
+                }
+            },
+            keyInput(val) { // 输入框输入介绍
+                // this.params.invitationCode = val
+                console.log(val)
+            },
+            keyInputChangeHandle(val) { // 输入框输入事件
+                this.params.invitationCode = val
+                // console.log(val)
+            },
+            setFocus() { // 控制组件获取焦点
+                this.$refs.VcodeInput.setFocus()
+            },
+
+            setBlur() { // 控制组件失去焦点
+                this.$refs.VcodeInput.setBlur()
+            },
+            clearValue() { // 清除已输入
+                this.$refs.VcodeInput.clearValue()
+            },
+            InitAuthorize() { //是否已授权 0:为取消授权 1:为已授权 2:为未操作
+                wxLogin.wxLoginQuick()
+            }
+        },
+        onShow() {
+            this.$api.getStorage().then((resolve) => {
+                this.params.unionId = resolve.unionId ? resolve.unionId : 0
+            })
+            this.InitAuthorize()
+        }
+    }
+</script>
+
+<style lang="scss">
+    .login {
+        width: 100%;
+        height: auto;
+
+        .model-warp.none {
+            display: none;
+        }
+
+        .model-warp.show {
+            display: block;
+        }
+
+        .login-main {
+            width: 100%;
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            height: 284rpx;
+            padding: 60rpx 0 40rpx 0;
+            margin-bottom: 70rpx;
+
+            .logo {
+                width: 611rpx;
+                height: 284rpx;
+                display: block;
+            }
+        }
+
+        .login-input {
+            width: 600rpx;
+            height: 88rpx;
+            padding: 24rpx 0;
+            margin: 30rpx auto;
+            margin-bottom: 30rpx;
+            background: #FFFFFF;
+            position: relative;
+        }
+
+        .login-row {
+            padding: 0 75rpx;
+            font-size: $font-size-28;
+            line-height: 40rpx;
+            color: #FF5B00;
+            margin-bottom: 48rpx;
+            text-align: right;
+        }
+
+        .login-btn {
+            width: 600rpx;
+            height: 88rpx;
+            border-radius: 44rpx;
+            font-size: $font-size-28;
+            line-height: 88rpx;
+            color: #FFFFFF;
+            margin: 0 auto;
+            text-align: center;
+            background: $btn-confirm;
+
+            &.disabled {
+                background: #E1E1E1;
+            }
+        }
+
+        .login-btn-last {
+            width: 600rpx;
+            height: 86rpx;
+            border-radius: 44rpx;
+            font-size: $font-size-28;
+            line-height: 88rpx;
+            color: $color-system;
+            margin: 0 auto;
+            text-align: center;
+            border: 1px solid $color-system;
+            margin-top: 20rpx;
+        }
+
+        .login-tips {
+            width: 100%;
+            height: auto;
+            margin-top: 80rpx;
+            box-sizing: border-box;
+            padding: 0 75rpx;
+            line-height: 44rpx;
+            font-size: $font-size-20;
+            color: #fea785;
+            text-align: justify;
+            text-indent: 40rpx;
+        }
+
+        .model-authorization {
+            width: 100%;
+            height: 100%;
+            position: fixed;
+            top: 0;
+            left: 0;
+            z-index: 999;
+
+            .authorization {
+                width: 518rpx;
+                height: 320rpx;
+                position: absolute;
+                background: rgba(255, 255, 255, .7);
+                left: 0;
+                right: 0;
+                bottom: 0;
+                top: 0;
+                margin: auto;
+
+                .to-btn {
+                    position: absolute;
+                    top: 0;
+                    left: 0;
+                    right: 0;
+                    bottom: 0;
+                    margin: auto;
+                    width: 70%;
+                    height: 88rpx;
+                    font-size: $font-size-28;
+                    line-height: 88rpx;
+                    color: #FFFFFF;
+                    text-align: center;
+                    border-radius: 44rpx;
+                }
+            }
+        }
+    }
+</style>

+ 48 - 37
pages/tabBar/user/user.vue

@@ -1,16 +1,18 @@
 <template>
-    <view class="container user clearfix">
-        <cm-custom :navbar-data="nvabarData" v-if="isCmcustom"></cm-custom>
-        <view class="user-section">
-            <view
-                class="header"
-                :style="{
-                    height: CustomBar + 120 - StatusBar + 'px',
-                    paddingTop: CustomBar + 'px',
-                    background: 'url(https://static.caimei365.com/app/img/bg/new_home_cumres@2x.png)',
-                    backgroundSize: 'cover'
-                }"
-            >
+    <view class="container user clearfix">
+        <tui-skeleton v-if="skeletonShow" backgroundColor="#fafafa" borderRadius="10rpx" :isLoading="true" :loadingType="5" />
+        <template v-else>
+            <cm-custom :navbar-data="nvabarData" v-if="isCmcustom"></cm-custom>
+            <view class="user-section">
+                <view
+                    class="header"
+                    :style="{
+                        height: CustomBar + 120 - StatusBar + 'px',
+                        paddingTop: CustomBar + 'px',
+                        background: 'url(https://static.caimei365.com/app/img/bg/new_home_cumres@2x.png)',
+                        backgroundSize: 'cover'
+                    }"
+                >
                 <view class="header-main" v-if="hasLogin">
                     <view class="header-icon">
                         <image
@@ -277,7 +279,8 @@
                     </view>
                 </view>
             </view>
-        </view>
+            </view>
+        </template>
         <!-- 采美豆提示弹窗 -->
         <activityBean
             v-if="isActivityBean"
@@ -288,11 +291,11 @@
         />
     </view>
 </template>
-<script>
-import activityBean from '@/components/cm-module/activity/activityBean.vue'
-import authorize from '@/common/config/authorize.js'
+<script>
 import { mapState, mapMutations } from 'vuex'
-
+import activityBean from '@/components/cm-module/activity/activityBean.vue'
+import authorize from '@/common/config/authorize.js'
+import wxLogin from '@/common/config/wxLogin.js'
 export default {
     components: {
         activityBean
@@ -311,7 +314,8 @@ export default {
             },
             CustomBar: this.CustomBar, // 顶部导航栏高度
             StatusBar: this.StatusBar,
-            StaticUrl: this.$Static,
+            StaticUrl: this.$Static,
+            skeletonShow:true,
             userId: 0,
             beanNumber: 50,
             beansType: 0,
@@ -362,7 +366,7 @@ export default {
         }
     },
     onLoad(option) {
-       this.initTbasUser()
+        this.initTbasUser()
     },
     computed: {
         ...mapState(['hasLogin', 'userInfo', 'isWxAuthorize'])
@@ -594,15 +598,27 @@ export default {
                 num = n
             }
             return num
+        },
+        // 初始化
+        async initUserData() {
+            if (this.hasLogin) {
+                const userInfo = await this.$api.getStorage()
+                this.userId = userInfo.userId
+                this.getClubObtainCenter()
+                this.UserClubOrderCount()
+                this.GetInitBeansInfo()
+                this.updateNoticeNum()
+                setTimeout(() => {
+                    this.skeletonShow = false
+                }, 1000)
+            } else {
+                this.getPhone()
+                this.$store.commit('updateAllNum', 0)
+                setTimeout(() => {
+                    this.skeletonShow = false
+                }, 1000)
+            }
         },
-        async initUserData() {
-            const userInfo = await this.$api.getComStorage('userInfo')
-            this.userId = userInfo.userId ? userInfo.userId : 0
-            this.getClubObtainCenter()
-            this.UserClubOrderCount()
-            this.GetInitBeansInfo()
-            this.updateNoticeNum()
-        }
     },
     onPageScroll(e) {
         //实时获取到滚动的值
@@ -616,9 +632,9 @@ export default {
             this.nvabarData.textColor = '#FFFFFF'
         }
     },
-    onPullDownRefresh() {
+    onPullDownRefresh() {  
         //下拉刷新
-        if (this.hasLogin) {
+        if (this.hasLogin) {
             this.getClubObtainCenter()
             this.UserClubOrderCount()
             uni.stopPullDownRefresh()
@@ -626,14 +642,9 @@ export default {
             uni.stopPullDownRefresh()
         }
     },
-    onShow() {
-        if (this.hasLogin) {
-            this.initUserData()
-        } else {
-            this.getPhone()
-            this.$store.commit('updateAllNum', 0)
-        }
-    }
+    onShow() {
+        this.initUserData()
+    } 
 }
 </script>
 

+ 120 - 0
pages/user/chats/components/chat-custom.vue

@@ -0,0 +1,120 @@
+<template name="headerNavbar">
+    <!-- 自定义导航栏 -->
+    <view class='navbar-wrap'
+        :style="{height:CustomBar+'px',paddingTop:StatusBar+'px',background:navbarData.bgColor ? navbarData.bgColor : '#f5f4f6'}">
+        <view class="navbar-text"
+            :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : (capsule.height+10)+'px'}"
+            :class="platformClass">
+            {{navbarData.title ? navbarData.title : " "}}
+        </view>
+        <view class="navbar-icon"
+            :style="{top:capsule.top +'px;',left:((screenWidth-capsule.right)+5)+'px;',height:capsule.height+'px;',lineHeight:capsule.height+'px;'}">
+            <text :style="{width:navbarBtn.height+'px;'}" @tap="handleBack" class="iconfont icon-fanhui"></text>
+            <text :style="{width:navbarBtn.height+'px;'}" @tap="handleShowDr" class="iconfont icon-xiaoxi"></text>
+        </view>
+    </view>
+</template>
+
+<script>
+    var self
+    export default {
+        name: 'chatCustom',
+        props: {
+            navbarData: { // 由父页面传递的数据
+                type: Object
+            }
+        },
+        data() {
+            return {
+                CustomBar: this.CustomBar, // 顶部导航栏高度
+                StatusBar: this.StatusBar,
+                fontSizeSetting: this.fontSizeSetting,
+                screenWidth: this.screenWidth,
+                capsule: this.capsule,
+                platformClass: this.platformClass,
+            }
+        },
+        created() {
+            if (getCurrentPages().length === 1) { // 当只有一个页面时
+                this.navbarData.haveBack = false
+            } else {
+                this.navbarData.haveBack = true
+            }
+        },
+        onLoad() {
+
+        },
+        methods: {
+            handleBack() {
+                this.$emit('navigateBack')
+            },
+            handleShowDr() {
+                this.$emit('showDr')
+            }
+        },
+        onShow() {
+
+        }
+    }
+</script>
+
+<style lang="scss">
+    .navbar-wrap {
+        position: fixed;
+        width: 100%;
+        top: 0;
+        z-index: 100000;
+        box-sizing: border-box;
+        background: #f5f4f6;
+        border-bottom: 1px solid #f5f4f6;
+    }
+
+    .navbar-text {
+        font-size: 30rpx;
+        color: #000000;
+        font-weight: 500;
+    }
+
+    .navbar-text.center {
+        text-align: center;
+    }
+
+    .navbar-text.left {
+        text-align: left;
+        padding-left: 45px;
+    }
+
+    .navbar-icon {
+    	 position: fixed;
+    	 display: flex;
+    	 border-radius: 50%;
+    	 text-align: center;
+    	 background: rgba(255,255,255,0.6);
+    	 border: 0.5px solid rgba(0,0,0, 0.1);
+    	 box-sizing: border-box;
+    	 z-index: 9999;
+    }
+    
+    .navbar-icon .iconfont {
+    	 height: 100%;
+    	 width: 100%;
+    	 font-size: 38rpx;
+    	 font-weight: bold;
+    	 display: inline-block;
+    	 overflow: hidden;
+    }
+    .navbar-icon view {
+    	 height: 18px;
+    	 border-left: 0.5px solid rgba(0,0,0, 0.3);
+    	 margin-top: 6px;
+    }
+
+    .navbar-icon .icon-xiaoxi {
+        color: #FF5B00;
+    }
+
+    .navbar-loading {
+        background: #fff;
+        text-align: center;
+    }
+</style>

+ 257 - 0
pages/user/chats/components/chat-drawer.vue

@@ -0,0 +1,257 @@
+<template>
+	<view class="drawer-content">
+		<!--右抽屉-->
+		<tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
+			<view
+				class="drawer-container clearfix"
+				scroll-y
+				:style="{
+					paddingTop: CustomBar - StatusBar + 8 + 'px',
+					paddingBottom: isIphoneX ? '180rpx' : '146rpx'
+				}"
+			>
+				<scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
+					
+				</scroll-view>
+				<view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
+					<view class="drawer-btn clear" @click="closeDrawer">取消</view>
+					<view class="drawer-btn comfrim" @click="handSearchConfirm">确定</view>
+				</view>
+			</view>
+		</tui-drawer>
+	</view>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex'
+export default {
+	name: 'rightDrawer',
+	props: {
+		rightDrawer: {
+			type: Boolean,
+			default: false
+		},
+		current:{
+			type:Number
+		}
+	},
+	data() {
+		return {
+			date: currentDate,
+			CustomBar: this.CustomBar, // 顶部导航栏高度
+			StatusBar: this.StatusBar,
+			isIphoneX: this.$store.state.isIphoneX,
+			height: 0,
+			drawerH: 0, // 抽屉内部scrollview高度
+			list: [],
+            chatHistoryParams: {
+                userId: '',
+                pageNum: 1,
+                pageSize: 10
+            },
+		}
+	},
+	created() {
+		this.setScrollHeight()
+	},
+	computed: {
+        
+	},
+	methods: {
+		async userNewChatHistory() {
+			//获取组员协销列表
+			try{
+				const userInfo = await this.$api.getStorage()
+                this.chatHistoryParams.userId = userInfo.userId
+				const res = await this.UserService.userNewChatHistory({ spId: userInfo.serviceProviderId })
+				this.list = res.data
+			}catch(e){
+				console.log('=========>获取AI记录异常')
+			}
+		},
+		closeDrawer() {
+			this.$parent.rightDrawer = false
+		},
+		handSearchConfirm() {
+			//确定筛选
+			this.$emit('handSearchConfirm', this.queryData)
+			this.$parent.rightDrawer = false
+		},
+		setScrollHeight() {
+			let obj = {}
+			const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
+			uni.getSystemInfo({
+				success: res => {
+					this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
+					this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
+				}
+			})
+			this.windowHeight = windowHeight - 1
+			this.scrollHeight = windowHeight - 1
+		}
+	}
+}
+</script>
+
+<style lang="scss">
+/*screen*/
+.drawer-container {
+	width: 580rpx;
+	height: 100%;
+	padding: 80rpx 0;
+	overflow: hidden;
+	box-sizing: border-box;
+	background-color: #ffffff;
+	.drawer-title {
+		width: 100%;
+		height: 72rpx;
+		line-height: 72rpx;
+		box-sizing: border-box;
+		padding: 0 30rpx;
+		float: left;
+		background-color: #f7f7f7;
+		font-size: $font-size-26;
+		color: #333333;
+		font-weight: bold;
+		text-align: left;
+	}
+	.drawer-main {
+		width: 100%;
+		height: auto;
+		box-sizing: border-box;
+		float: left;
+		.drawer-main-name {
+			width: 100%;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: left;
+			font-size: $font-size-26;
+			color: #333333;
+			box-sizing: border-box;
+			padding: 0 20rpx;
+			font-weight: bold;
+			.small{
+				font-weight: normal;
+				color: #999999;
+			}
+		}
+		.drawer-main-time{
+			width: 100%;
+			height: 56rpx;
+			box-sizing: border-box;
+			.line{
+				color: #999999;
+				float: left;
+				line-height: 56rpx;
+			}
+			.drawer-main-time-input{
+				width: 228rpx;
+				height: 56rpx;
+				background: #F7F7F7;
+				border-radius: 28rpx;
+				box-sizing: border-box;
+				padding: 0 20rpx;
+				line-height: 56rpx;
+				float: left;
+				margin: 0 20rpx;
+				position: relative;
+				.input-text{
+					display: block;
+					height: 56rpx;
+					font-size: 26rpx;
+					color: #666666;
+				}
+				.icon-riqi{
+					color: #FF5B00;
+					display: block;
+					width: 40rpx;
+					height: 56rpx;
+					position: absolute;
+					right: 10rpx;
+					top: 0;
+					line-height: 56rpx;
+				}
+			}
+		}
+		.drawer-main-radiov {
+			width: 100%;
+			height: auto;
+			box-sizing: border-box;
+			padding: 0 20rpx;
+			.drawer-main-radio {
+				width: 100%;
+				height: 80rpx;
+				box-sizing: border-box;
+				padding: 0 10rpx;
+				border: 1px solid rgba(0, 0, 0, 0.2);
+				border-radius: 6rpx;
+				margin-bottom: 30rpx;
+				position: relative;
+				&.btn {
+					border: none;
+					margin-top: 40rpx;
+				}
+				.input {
+					width: 100%;
+					height: 80rpx;
+					line-height: 80rpx;
+					float: left;
+					box-sizing: border-box;
+					font-size: $font-size-24;
+					color: #333333;
+					padding: 0 10rpx;
+					padding-right: 68rpx;
+				}
+				.iconfont {
+					width: 50rpx;
+					height: 80rpx;
+					display: block;
+					line-height: 80rpx;
+					text-align: center;
+					font-size: 30rpx;
+					color: #999999;
+					position: absolute;
+					right: 0;
+					top: 0;
+				}
+			}
+		}
+	}
+	.drawer-input {
+		width: 100%;
+		float: left;
+		box-sizing: border-box;
+		padding: 24rpx 10rpx 0 10rpx;
+		border: 1px solid rgba(0, 0, 0, 0.2);
+		border-radius: 4rpx;
+		position: relative;
+		background-color: #ffffff;
+		&.btn {
+			border: none;
+			display: flex;
+			position: fixed;
+			left: 0;
+			bottom: 0;
+		}
+		.drawer-btn {
+			width: 210rpx;
+			height: 84rpx;
+			border-radius: 42rpx;
+			background: $btn-confirm;
+			line-height: 84rpx;
+			text-align: center;
+			font-size: $font-size-26;
+			color: #ffffff;
+			flex: 1;
+			margin: 0 10rpx;
+			&.comfrim {
+				background: $btn-confirm;
+			}
+			&.clear {
+				background: #ffe6dc;
+				color: $color-system;
+			}
+		}
+	}
+}
+</style>

+ 36 - 11
pages/user/chats/components/chat-html.vue

@@ -1,17 +1,20 @@
 <template>
     <view>
+        <view class="cm_ai_answer chat">
+            <view class="cm_ai_html chat">
+                <view class="h1">Hi,我是采美AI助手 <text class="iconfont icon-AIzhushou"></text></view>
+                我是您的AI助手,欢迎向我提出您的疑问,我会根据你给出的问题提供相对应的回答~
+            </view>
+        </view>
         <view v-for="(chat, index) in messages" :key="index" class="cm_ai_answer"
             :class="chat.from === 'me' ? 'user' : ''">
             <view class="cm_ai_html" :class="chat.from === 'me' ? 'user' : ''">
                 <template v-if="chat.from === 'me'">
-                    {{ chat.question }}
+                    <text>{{ chat.question }}</text>
                 </template>
                 <template v-else>
-                   <!-- <image v-if="isLoading" class="cm_ai_html_loading" src="https://static.caimei365.com/app/img/chat/icon-loading@2x.gif" /> -->
-                   <!-- <template v-else> -->
-                       <text v-if="chat.typing">{{ chat.question.substring(0, chat.currentLength) }}</text>
-                       <text v-else>{{ chat.question }}</text>  
-                   <!-- </template> -->
+                    <text v-if="chat.typing">{{ chat.question.substring(0, chat.currentLength) }}</text>
+                    <text v-else>{{ chat.question }}</text>
                 </template>
             </view>
         </view>
@@ -32,7 +35,7 @@
             }
         },
         created() {
-           
+
         },
         computed: {
 
@@ -54,9 +57,11 @@
                         if (currentLength < message.question.length) {
                             message.currentLength++ // 增加已显示的文本长度  
                             // 如果需要,可以在这里添加一些性能优化或条件检查  
-                            setTimeout(typeEffect, 50) // 每100毫秒增加一个字符  
+                            setTimeout(typeEffect, 30) // 每100毫秒增加一个字符  
+                            this.$emit('scrollUpdate', true)
                         } else {
                             message.typing = false // 打字完成  
+                            this.$emit('scrollUpdate', true)
                         }
                     }
                     typeEffect() // 开始打字效果  
@@ -67,6 +72,13 @@
 </script>
 
 <style lang="scss">
+    .chat-container {
+        height: 100%;
+        /* 或者你需要的固定高度 */
+        overflow-y: auto;
+        /* 允许y轴滚动 */
+    }
+
     .cm_ai_answer {
         width: 100%;
         height: auto;
@@ -86,15 +98,28 @@
             line-height: 1.5715;
             background-color: #FFFFFF;
             box-sizing: border-box;
-            padding: 20rpx;
-            font-size: 30rpx;
+            padding: 24rpx;
+            font-size: 28rpx;
             color: #666666;
+            letter-spacing: 0.5rpx;
 
+            .h1 {
+                font-size: $font-size-48;
+                font-weight: 600;
+                color: #333333;
+                line-height: 110rpx;
+                letter-spacing: 2rpx;
+                .icon-AIzhushou{
+                    font-size: 56rpx;
+                    color: #ff5b00;
+                    font-weight: normal;
+                }
+            }
             &.user {
                 min-height: 80rpx;
                 border-radius: 30rpx 30rpx 0 30rpx;
                 background-color: rgba(255, 91, 0, 0.1);
-                font-size: 30rpx;
+                font-size: 28rpx;
                 color: #333333;
             }
 

+ 168 - 90
pages/user/chats/index.vue

@@ -1,38 +1,57 @@
 <template>
     <view class="container">
-        <view class="cm_ai_container_main">
-            <view class="cm_ai_container">
+        <!-- <chatCustom @showDr="handleShowDrawer"/> -->
+        <!-- <view class="cm_ai_container_main" :style="{ paddingBottom: isIphoneX ? '208rpx' : '174rpx', paddingTop:CustomBar+'px' }"> -->
+        <view class="cm_ai_container_main" :style="{ paddingBottom: isIphoneX ? '208rpx' : '174rpx' }">
+            <scroll-view class="cm_ai_container" scroll-y="true" show-scrollbar="true" ref="scrollView" id="scrollChatView">
                 <!--提问回答element-->
                 <view class="cm_ai_answer_main" id="cm_ai_answer">
-                    <chat-html ref="chatHtml" :messages='messages' />
+                    <chat-html ref="chatHtml" :messages='messages' @scrollUpdate="scrollToBottom" />
                 </view>
-                <!--提问文本框-->
-                <view class="cm_ai_content">
-                    <view class="cm_ai_input">
-                        <input class="cm_ai_textarea" v-model="questionTextarea" placeholder="请输入您想了解的内容"
-                            @confirm="handleAskQuestion" />
-                        <view class="cm_ai_button" :class="isLoading ? 'none' : ''" @click="handleAskQuestion">
-                            <text class="iconfont icon-fasong"></text>
-                        </view>
+            </scroll-view>
+            <!--提问文本框-->
+            <view class="cm_ai_content" :style="{ height: isIphoneX ? (120+68) +'rpx' : (120+34) +'rpx', paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
+                <view class="cm_ai_input">
+                    <input class="cm_ai_textarea" v-model="questionTextarea" cursor-spacing="30" confirm-type="send" maxlength="200"
+                        placeholder="请输入您想了解的内容" @confirm="handleAskQuestion" />
+                    <view class="cm_ai_button" :class="isLoading ? 'none' : ''" @click="handleAskQuestion">
+                        <text class="iconfont icon-fasong"></text>
                     </view>
                 </view>
             </view>
         </view>
+        <!-- 对话记录 -->
+        <!-- <chatDrawer :rightDrawer="isRightDrawer"/> -->
     </view>
 </template>
 
 <script>
     import { mapState, mapMutations } from 'vuex'
+    import chatCustom from './components/chat-custom' //地址信息
+    import chatDrawer from './components/chat-drawer' //地址信息
     import chatHtml from './components/chat-html' //地址信息
     export default {
         components: {
+            chatCustom,
+            chatDrawer,
             chatHtml
         },
         data() {
             return {
                 StaticUrl: this.$Static,
                 isIphoneX: this.$store.state.isIphoneX,
+                CustomBar:this.CustomBar,// 顶部导航栏高度
+                isRightDrawer:false,
                 isLoading: false,
+                nvabarData: {		//顶部自定义导航
+                	haveBack:true,
+                	haveHome:true,
+                	showCapsule:1, // 是否显示左上角图标  1表示显示  0表示不显示,
+                	showSearch: 0,
+                	title: '',  // 导航栏 中间的标题
+                	bgColor: '#f5f4f6 ',  // 导航栏 中间的标题
+                	textLeft:this.$store.state.isIphone
+                },
                 chatParams: {
                     userId: '',
                     question: ''
@@ -40,7 +59,7 @@
                 questionTextarea: '',
                 probeChatId: '',
                 probeIndex: 0,
-                messages: []
+                messages: [],
             }
         },
         onLoad(option) {
@@ -53,37 +72,59 @@
             ...mapState(['hasLogin', 'userInfo', ])
         },
         methods: {
+            // 初始化
             async initGetStotage() {
                 const userInfo = await this.$api.getStorage()
                 this.chatParams.userId = userInfo.userId
                 this.questionTextarea = ''
+                this.probeIndex = 0
+                this.messages = []
             },
+            // 发送
             async handleAskQuestion() {
-                this.chatParams.question = this.questionTextarea
-                if (this.isLoading) { return }
-                if (!this.chatParams.question) {
-                    this.$util.msg('请输入内容', 2000)
+                if (!this.hasLogin) {
+                    this.$util.msg('请您登陆后使用AI助手', 2000)
+                    setTimeout(() => {
+                        this.$api.navigateTo('/pages/login/login')
+                    }, 2000)
                     return
-                }
-                this.messages.push({ question: this.chatParams.question, from: 'me', typing: false,
-                    currentLength: 0 })
-                if (this.probeIndex === 0) {
-                    this.messages.push({ question: `老板,稍等一下哈,我为你查询一下${this.chatParams.question}的相关信息。`, from: 'bot',
-                        typing: false, currentLength: 0 })
-                }
-                this.isLoading = true
-                setTimeout(() => {
+                } else {
+                    this.chatParams.question = this.questionTextarea
+                    if (this.isLoading) {
+                        return
+                    }
+                    if (!this.chatParams.question) {
+                        this.$util.msg('请输入内容', 2000)
+                        return
+                    }
+                    this.messages.push({
+                        question: this.chatParams.question,
+                        from: 'me',
+                        typing: false,
+                        currentLength: 0
+                    })
                     if (this.probeIndex === 0) {
-                        this.handleUserNewChat(this.chatParams)
-
-                    } else {
-                        this.handleUserSecondChat({ chatId: this.probeChatId, ...this.chatParams })
+                        this.messages.push({
+                            question: `老板,稍等一下哈,为你查询${this.chatParams.question}的相关信息。`,
+                            from: 'bot',
+                            typing: false,
+                            currentLength: 0
+                        })
                     }
-                }, 1000)
+                    this.questionTextarea = ''
+                    this.isLoading = true
+                    setTimeout(() => {
+                        if (this.probeIndex === 0) {
+                            this.handleUserNewChat(this.chatParams)
+                        } else {
+                            this.handleUserSecondChat({ chatId: this.probeChatId, ...this.chatParams })
+                        }
+                    }, 1000)
+                }
             },
+            //初次提问
             async handleUserNewChat(chatParams) {
                 try {
-                    this.questionTextarea = ''
                     const res = await this.UserService.userNewChat(chatParams)
                     const data = res.data
                     this.probeIndex++
@@ -91,21 +132,59 @@
                     this.messages.push({ question: data.result, from: 'bot', typing: false, currentLength: 0 })
                     this.isLoading = false
                 } catch (error) {
-                    console.error('Error fetching new chats:', error)
+                   console.log('error',error)
+                   const msgMap = {
+                       '-1':`您好,目前没有找到与${chatParams.question}相关的信息,可以换个说法试试。`,
+                       '-2':'您的此次对话已超出对话轮次上限,可以刷新页面或新建对话重试。',
+                       '-3':'您的单日对话次数已超出上限,请明日再来尝试提问。'
+                   }
+                   this.messages.push({ question: msgMap[error.code], from: 'bot', typing: false, currentLength: 0 })
+                   this.isLoading = false
                 }
             },
+            // 追问
             async handleUserSecondChat(chatParams) {
                 try {
-                    this.questionTextarea = ''
                     const res = await this.UserService.userSecondChat(chatParams)
                     const data = res.data
                     this.messages.push({ question: data.result, from: 'bot', typing: false, currentLength: 0 })
                     this.isLoading = false
                 } catch (error) {
-                    console.error('Error fetching new chats:', error)
+                    console.log('error',error)
+                }
+            },
+            handleShowDrawer(){
+                this.isRightDrawer = true
+            },
+            scrollToBottom(flag) {
+                // console.log('flag',flag)
+                // this.$nextTick( async () => {
+                //     const scrollChatView = await this.$util.boundingClientRect(this, '#scrollChatView', false)
+                //     // console.log('scrollChatView',scrollChatView.height)
+                //     uni.pageScrollTo({
+                //     	duration: 300, //过渡时间必须为0,uniapp bug,否则运行到手机会报错
+                //     	scrollTop: scrollChatView.height,
+                //     })
+                //     // this.$refs.scrollView.scrollTop = lastCHatMain.top + lastCHatMain.height
+                // })
+            },
+            //滑动到最底部
+            async handleScrollUpdate(flag) {
+                if (flag) {
+                    this.$refs.scrollView.scrollIntoView('#lastElementId', {
+                        behavior: 'smooth' // 平滑滚动  
+                    })
                 }
             }
         },
+        onPullDownRefresh() {
+            // 下拉刷新
+            setTimeout(() => {
+                this.probeIndex = 0
+                this.messages = []
+                uni.stopPullDownRefresh()
+            }, 200)
+        },
         onShow() {
             this.initGetStotage()
         }
@@ -116,86 +195,85 @@
     page {
         width: 100%;
         height: 100%;
-        background-color: #FFFFFF;
+        background-color: #e6ebf7 !important;
     }
 
     .cm_ai_container_main {
         width: 100%;
         height: 100%;
+        box-sizing: border-box;
         background-image: radial-gradient(circle at 14% 85%, #e7ecf7 0, rgba(231, 236, 247, 0) 37%), radial-gradient(circle at 3.4% 3.7%, rgba(245, 237, 241, .5) 0, rgba(245, 237, 241, 0) 28%), radial-gradient(circle at 100% 18%, #e8ebea 0, hsla(160, 7%, 92%, 0) 30%), linear-gradient(180deg, #f5f4f6, #e6ebf7);
-
-        .cm_ai_container {
+        .cm_ai_content {
             width: 100%;
-            height: 100%;
-            display: flex;
-            flex-direction: column;
+            padding:20rpx 24rpx 0 24rpx;
+            background-color: #e6ebf7 !important;
             box-sizing: border-box;
-            padding: 0 24rpx 40rpx 24rpx;
-
-            .cm_ai_content {
+            position: fixed;
+            left: 0;
+            bottom: 0;
+            .cm_ai_input {
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
                 width: 100%;
-                height: 88rpx;
+                height: 100%;
                 background-color: #FFFFFF;
                 box-shadow: 0 16rpx 20rpx 0 rgba(174, 167, 223, .2);
-                border-radius: 40rpx;
+                border-radius: 50rpx;
                 box-sizing: border-box;
-                padding: 14rpx 24rpx;
-                margin: 20rpx 0;
+                padding: 10rpx 100rpx 10rpx 10rpx;
                 position: relative;
 
-                .cm_ai_input {
-                    display: flex;
-                    align-items: center;
-                    justify-content: space-between;
+                .cm_ai_textarea {
                     width: 100%;
-                    height: 60rpx;
-                    overflow: hidden;
+                    height: 80rpx !important;
+                    font-size: 30rpx;
+                    line-height: 80rpx;
+                    background-color: transparent;
+                    border: none;
+                    box-shadow: none;
+                    overflow: auto;
+                    scrollbar-width: none;
+                    resize: none;
                     box-sizing: border-box;
-                    padding-right: 60rpx;
-                    position: relative;
-
-                    input {
-                        width: 100%;
-                        height: 60rpx !important;
-                        font-size: 24rpx;
-                        line-height: 60rpx;
-                        background-color: transparent;
-                        border: none;
-                        box-shadow: none;
-                        overflow: auto;
-                        scrollbar-width: none;
-                        resize: none;
-                        box-sizing: border-box;
-                        padding-left: 4rpx;
-                    }
+                    padding-left: 24rpx;
+                }
 
-                    .cm_ai_button {
-                        width: 60rpx;
-                        height: 60rpx;
-                        line-height: 60rpx;
-                        border-radius: 20rpx;
-                        display: inline-flex;
-                        align-items: center;
-                        justify-content: center;
-                        font-size: 24rpx;
-                        position: absolute;
-                        right: 0;
+                .cm_ai_button {
+                    width: 100rpx;
+                    height: 100rpx;
+                    line-height: 100rpx;
+                    border-radius: 20rpx;
+                    display: inline-flex;
+                    align-items: center;
+                    justify-content: center;
+                    font-size: 24rpx;
+                    position: absolute;
+                    right: 0;
 
-                        &.none {
-                            background-image: radial-gradient(circle at 14% 85%, #e7ecf7 0, rgba(231, 236, 247, 0) 37%);
-
-                            .icon-fasong {
-                                color: #e6e6e6;
-                            }
-                        }
+                    &.none {
+                        background-image: radial-gradient(circle at 14% 85%, #e7ecf7 0, rgba(231, 236, 247, 0) 37%);
 
                         .icon-fasong {
-                            font-size: 50rpx;
-                            color: #ff5b00;
+                            color: #e6e6e6;
                         }
                     }
+
+                    .icon-fasong {
+                        font-size: 50rpx;
+                        color: #ff5b00;
+                    }
                 }
             }
+        }
+
+        .cm_ai_container {
+            width: 100%;
+            height: 100%;
+            display: flex;
+            flex-direction: column;
+            box-sizing: border-box;
+            padding: 0 24rpx;
 
             .cm_ai_answer_main {
                 width: 100%;

+ 2 - 2
pages/user/pay/card-comfirm.vue

@@ -6,7 +6,7 @@
 			borderRadius="10rpx"
 			:isLoading="true"
 			:loadingType="5"
-		></tui-skeleton>
+		/>
 		<template v-else>
 			<view class="card-content">
 				<view class="card-row">
@@ -265,7 +265,7 @@ export default {
 		},
 		handleGoSusList() {
 			// 跳转支持银行
-			this.$api.navigateTo(`/pages/user/pay/card-sus-list`)
+			this.$api.navigateTo('/pages/user/pay/card-sus-list')
 		},
 		formatAccNo(value) {
 			const newValue = value.replace(/([^0-9])/g, '') // 只允许输入数字

+ 13 - 0
services/user.service.js

@@ -1061,4 +1061,17 @@ export default class UserService {
             loadText:'AI分析中...'    
         })
     }
+    /**
+     * @采美AI助手-提问记录
+     * @param:userId 用户userId
+     * @param:pageNum 每页页码
+     * @param:pageSize 条数
+     */
+    userNewChatHistory(data = {}) {
+        return this.AjaxService.get({
+            url: '/user/chat/chat/history',
+            data,
+            isLoading: false
+        })
+    }
 }

+ 1 - 6
store/index.js

@@ -23,7 +23,6 @@ const store = new Vuex.Store({
         isIphoneX: false,
         isActivity: false, // 首页活动弹窗
         isLoginType: 0,
-        isLoginProductId: 0,
         isManage: false,// 是否是管理员或者小组长
         shopAdvert:[] // 供应商广告图列表
     },
@@ -34,7 +33,7 @@ const store = new Vuex.Store({
             uni.setStorage({ //缓存用户登陆状态
                 key: 'userInfo',
                 data: provider
-            })
+            })
         },
         logout(state) {
             state.hasLogin = false
@@ -183,10 +182,6 @@ const store = new Vuex.Store({
             state.isLoginType = variable
             console.log(state.isLoginType)
         },
-        setLoginProductId(state, variable) { // 记录跳转商品ID
-            state.isLoginProductId = variable
-            console.log(state.isLoginProductId)
-        },
         setLoginOrderId(state, variable) { // 记录跳转订单ID
             state.isLoginOrderId = variable
             console.log(state.isLoginOrderId)