李万涛 1 gadu atpakaļ
vecāks
revīzija
b41c0afbd1
6 mainītis faili ar 59 papildinājumiem un 29 dzēšanām
  1. 3 3
      App.vue
  2. 5 1
      api/robot/index.js
  3. 33 8
      pages/robot/index.vue
  4. 1 1
      pages/user/signin.vue
  5. 15 15
      pages/user/user.vue
  6. 2 1
      pages/user/userinfo.vue

+ 3 - 3
App.vue

xqd
@@ -9,9 +9,9 @@
 			uni.hideTabBar({});
 			// #endif
 			if (!uni.getStorageSync('token')) {
-				uni.reLaunch({
-					url: '/pages/user/signin'
-				})
+				// uni.reLaunch({
+				// 	url: '/pages/user/signin'
+				// })
 			}
 		}
 	};

+ 5 - 1
api/robot/index.js

xqd
@@ -34,4 +34,8 @@ export const login = (params, config = {}) => http.post('index.php/api.Digit/log
 
 
 //获取数字人合成背景
-export const getBg = (params, config = {}) => http.post('index.php/api.Digit/getBackImageByRole', params, config)
+export const getBg = (params, config = {}) => http.post('index.php/api.Digit/getBackImageByRole', params, config)
+
+
+// //精彩案例
+// export const demoList = (params, config = {}) => http.post('index.php/api.Digit/getBackImageByRole', params, config)

+ 33 - 8
pages/robot/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -16,7 +16,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="draft">
+			<view class="draft" v-if="isLogin">
 				<view class="draftLabel">
 					草稿
 				</view>
@@ -43,9 +43,9 @@
 
 			<view class="draft">
 				<view class="draftLabel">
-					数字人作品
+					{{isLogin?'数字人作品':'精选案例'}}
 				</view>
-				<empty v-if="workList.length==0" tipTxt="暂无作品"></empty>
+				<empty v-if="workList.length==0" :tipTxt="isLogin?'暂无作品':'暂无案例'"></empty>
 				<view class="draftList" v-else>
 					<view class="itemBox" v-for="(item,index) in workList" @click="goWorkDetail(item)">
 						<view class="top" :style="{minHeight:isPc?'rpx':'470rpx'}">
@@ -70,7 +70,7 @@
 							</view>
 
 						</view>
-						<view class="bottom">
+						<view class="bottom" v-if="isLogin">
 							<view class="left" :style="{fontSize:isPc?'64rpx':'32rpx'}">
 								{{item.name}}
 							</view>
@@ -113,6 +113,7 @@
 <script>
 	import empty from '@/components/empty/empty.vue'
 	import {
+		demoList,
 		workList,
 		delWork,
 		draftList
@@ -123,6 +124,8 @@
 	export default {
 		data() {
 			return {
+				demoList: [],
+
 				show: false,
 
 
@@ -148,7 +151,13 @@
 			};
 		},
 		computed: {
-
+			isLogin() {
+				if (uni.getStorageSync('token')) {
+					return true
+				} else {
+					return false
+				}
+			}
 		},
 
 		onReady() {
@@ -348,6 +357,8 @@
 					})
 				}
 
+
+
 				let res1 = await draftList({})
 				if (res1.code == 0) {
 					// uni.stopPullDownRefresh()
@@ -378,9 +389,23 @@
 				})
 			},
 			handleCreatePro() {
-				uni.navigateTo({
-					url: '/pages/robot/generate/index?type=create'
-				})
+				if (!uni.getStorageSync('token')) {
+
+					uni.showToast({
+						title: '请登录后创建项目',
+						icon: 'none'
+					})
+					// setTimeout(() => {
+					// 	uni.navigateTo({
+					// 		url: '/pages/user/signin'
+					// 	})
+					// }, 1500)
+					return
+				} else {
+					uni.navigateTo({
+						url: '/pages/robot/generate/index?type=create'
+					})
+				}
 			},
 			handleShowMoreMenu(item, index) {
 				this.$refs.picker.setIndexs([0])

+ 1 - 1
pages/user/signin.vue

xqd
@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<view style="color: #000;">
-			<tn-nav-bar backgroundColor="#fff" :bottomShadow="false" :isBack="false">登录</tn-nav-bar>
+			<tn-nav-bar backgroundColor="#fff" :bottomShadow="false" :isBack="true">登录</tn-nav-bar>
 			<view :style="{height: tobheight+'px'}"></view>
 		</view>
 		<block>

+ 15 - 15
pages/user/user.vue

xqd xqd
@@ -608,24 +608,24 @@
 		},
 
 		async onShow() {
-			let res = await userInfo()
-
-			if (res.code == 0) {
-				this.userInfo = res.msg
-			}
-			console.log('我的-用户信息返回值:', res);
-
 			if (uni.getStorageSync('token')) {
 				this.hasLogin = true
-			}
 
-			if (this.isLogin) {
-				this.getUserData();
-				if (this.$ws.socketStatus()) {
-					this.$ws.completeClose();
+				let res = await userInfo()
+
+				if (res.code == 0) {
+					this.userInfo = res.msg
 				}
+				console.log('我的-用户信息返回值:', res);
 			}
-			this.systemwechat()
+
+			// if (this.isLogin) {
+			// 	this.getUserData();
+			// 	if (this.$ws.socketStatus()) {
+			// 		this.$ws.completeClose();
+			// 	}
+			// }
+			// this.systemwechat()
 			// this.$store.dispatch('tabbarInit')
 		},
 
@@ -637,8 +637,8 @@
 			// 	});
 			// 	uni.setStorageSync('route', '/pages/user/user');
 			// }
-			this.getCommissionSetting();
-			this.getPlan();
+			// this.getCommissionSetting();
+			// this.getPlan();
 			// this.systemwechat()
 			// console.log(API_ROOT);
 		},

+ 2 - 1
pages/user/userinfo.vue

xqd xqd
@@ -228,6 +228,7 @@
 					success: function(res) {
 						if (res.confirm) {
 							uni.removeStorageSync('token')
+							// uni.clearStorageSync()
 
 							if (uni.getStorageSync('timer')) {
 								console.log('logout-timer', Number(uni.getStorageSync('timer')));
@@ -236,7 +237,7 @@
 							}
 							setTimeout(() => {
 								uni.reLaunch({
-									url: '/pages/user/signin'
+									url: '/pages/robot/index'
 								})
 							}, 1500)
 						} else if (res.cancel) {