ソースを参照

1.添加充值逻辑
2.修改页面布局

306132416@qq.com 6 年 前
コミット
d1273730c2
共有3 個のファイルを変更した33 個の追加18 個の削除を含む
  1. 1 1
      pages.json
  2. 30 15
      pages/index/index.vue
  3. 2 2
      pages/selfInfo/selfInfo.vue

+ 1 - 1
pages.json

@@ -3,7 +3,7 @@
 		{
 			"path": "pages/index/index",
 			"style": {
-					"navigationBarTitleText": "阿拉丁神灯"
+					"navigationBarTitleText": "阿拉灯神丁"
 					}
 		}
 	    ,{

+ 30 - 15
pages/index/index.vue

@@ -9,13 +9,13 @@
 		<!-- 	<view class="tips-box tips-title">
 				您好,智能投顾很高兴为您服务!
 			</view> -->
-<!-- 
+
 			<view class="talk-box">
 				<view class="talk-head-box">
 					<image src="../../static/rabotHead.png" mode="" class="talk-head"></image> 
 				</view>
-				<view class="talk-content">您好,智能顾投很高兴为您服务!</view>
-			</view> -->
+				<view class="talk-content">您好,欢迎您使用阿拉灯神丁。我可以给您提供股票投资建议,快来试试吧。</view>
+			</view>
 
 			<view v-for="chat in talkList" :key="chat.talkType"  class="m-item">
 				<view class="talk-box talk-box-end" v-show="chat.content">
@@ -28,16 +28,17 @@
 					<view class="talk-head-box">
 						<image :src='rabotHeadImg' mode="" class="talk-head"></image>
 					</view>
-					<view class="talk-content">{{chat.reply}}</view>
+					<view class="talk-content">{{chat.reply}}<text class="goRechargeText" v-if='chat.isRecharge' @click.stop="goRecharge">去充值</text></view>
 				</view>
 
 			</view>
 
 		</scroll-view>
 		<view class="send-box" :style="{ 'padding-bottom' : isShowKeyBoard + 'px'}">
-			<input type="text" class="enter-box" v-model="inputInfo" :adjust-position="true" @input='isInputing'
+			<input type="text" class="enter-box" v-model="inputInfo" :adjust-position="true" 
 		    :style="{'width':inputWidth}" confirm-hold='true' confirm-type='send' @confirm="sendInputInfo" />
-			<button type="primary" class="submit-message" @click="sendInputInfo()" v-if='isShowSend'>发送</button>
+			<!-- @input='isInputing' -->
+			<!-- <button type="primary" class="submit-message" @click="sendInputInfo()" v-if='isShowSend'>发送</button> -->
 			<image src="/static/setIcon.png"  @click.stop='openModal()' v-if='isShowSetCenter'></image>
 		</view>
 		 <!-- <drag-button :isDock="true" :existTabBar="true"  @btnClick="goUserSelf" /> -->
@@ -75,6 +76,7 @@
 				isShowSend:false,
 				isShowSetModal:false,
 				isShowSetCenter:true,
+				isShowRecharge:false,
 				inputWidth:'80%',
 				title: 'RABOT',
 				nowTime: '',
@@ -139,7 +141,7 @@
 						 getApp().globalData.open_id = res.data.msg.openid;
 						 getApp().globalData.isAuth = res.data.msg.isauth === '0';
 						 getApp().globalData.user_name = res.data.msg.name;
-						 getApp().globalData.user_headUrl = res.data.msg.headimg;
+						 getApp().globalData.user_headUrl = res.data.msg.headimg  || '../../static/userDefault.png';
 						 getApp().globalData.times = res.data.msg.times;
 						 getApp().globalData.total_times = res.data.msg.total_times;
 						 that.getHistory();	
@@ -180,7 +182,7 @@
 							// }, 100)
 						})
 					},
-			getHistory() {
+			getHistory(isShow) {
 						let that = this;
 						uni.request({
 							url: getApp().globalData.shareUrl, //需要设置为全局
@@ -198,6 +200,9 @@
 							},
 							success: res => {
 								that.userHeadUrl = getApp().globalData.user_headUrl;
+								if(isShow){
+									res.data.msg[0].isRecharge = 1
+								}
 								if(page === 1){
 									that.scrollRequestEnable = true;
 									that.talkList  = ((res.data.msg).reverse());
@@ -245,15 +250,23 @@
 								content: msg
 							},
 							success: res => {
-								this.inputInfo = '';
-								that.getHistory();
+								if(res.data.code === 100){
+									that.isShowRecharge = true;
+									that.inputInfo = '';
+									that.getHistory('show');
+								}else {
+									that.inputInfo = '';
+									that.getHistory();
+									that.isShowRecharge = false
+								}
+						
 							}
 						});
 					},
 			sendInputInfo() {
-						this.inputWidth = '80%';
-						this.isShowSend = false;
-						this.isShowSetCenter = true;
+						// this.inputWidth = '80%';
+						// this.isShowSend = false;
+						// this.isShowSetCenter = true;
 						if (!this.inputInfo) {
 							uni.showToast({
 								title: '请输入股票代码',
@@ -383,7 +396,7 @@
 	}
 	.talk-reply{
 		padding: 2%;
-		background: #fff;
+		background: #9EEA6A;
 		font-size: 28rpx;
 		border-top-left-radius: 20rpx;
 		border-bottom-left-radius: 20rpx;
@@ -391,7 +404,9 @@
 		text-align: left;
 		max-width: 70%;
 	}
-
+    .goRechargeText {
+		color:#0A98D5
+	} 
 	.enter-box {
 		height: 70rpx;
 		background: #fff;

+ 2 - 2
pages/selfInfo/selfInfo.vue

@@ -5,7 +5,7 @@
 			<image :src='userHeadUrl' mode="aspectFit"></image>
 			<text>{{userName}}</text>
 		</view>
-		<button class="login-button-pos" v-if="isShowAuthBtn" open-type="getUserInfo" @getuserinfo="getUserInfo">未登录,请点击授权</button>
+		<button class="login-button-pos" v-if="isShowAuthBtn" open-type="getUserInfo" @getuserinfo="getUserInfo">未授权,请点击获取信息</button>
 		<view class="self-search-box">
 			<view class="search-content">
 				<view class="search-content-value">{{userTime}}</view>
@@ -61,7 +61,7 @@
 				title: '个人中心页面',
 				nowHeight:getApp().globalData.glbalHeight,
 				isShowAuthBtn:getApp().globalData.isAuth,
-				userName:getApp().globalData.user_name || '芝麻开发',
+				userName:getApp().globalData.user_name || '阿拉灯神丁',
 				userHeadUrl:getApp().globalData.user_headUrl || '../../static/rabotHead.png',
 				userTime:getApp().globalData.times,
 				userTotalTime:getApp().globalData.total_times