zhangdan 4 年之前
父節點
當前提交
496830b87e
共有 4 個文件被更改,包括 42 次插入44 次删除
  1. 1 1
      pages.json
  2. 12 41
      pages/index/index.vue
  3. 29 2
      pages/index/order.vue
  4. 二進制
      static/billing_icon.png

+ 1 - 1
pages.json

@@ -13,7 +13,7 @@
 			}
 		},
 		{
-			"path": "pages/index/YY",
+			"path": "pages/index/order",
 			"style": {
 				"navigationBarTitleText": "下单",
 				// "navigationBarBackgroundColor": "#1995FF",

+ 12 - 41
pages/index/index.vue

@@ -93,7 +93,6 @@
 					<u-empty src="/static/def_result.png" :text="noDataText" icon-size="260" ></u-empty>
 				</view>
 			</view>
-			
 		</view>
 	</view>
 </template>
@@ -263,11 +262,18 @@
 			},
 			// 扫码下单
 			gotoSaoMa(){
-				wx.scanCode({
-				  success: (res)=> {
-				    console.log(res,'----------------res===================')
-				  }
-				})
+				if(this.hasLogin){
+					wx.scanCode({
+					  success: (res)=> {
+						  uni.navigateTo({
+						      url: '/pages/index/YY'
+						  })
+					    console.log(res,'----------------res===================')
+					  }
+					})
+				}else{
+					this.loginModal()
+				}
 			},
 			// 自主下单
 			gotoYueYu(){
@@ -466,41 +472,6 @@
 				.statistics-box:last-child{
 					margin-bottom:0 ;
 				}
-				// .bottom-statistics{
-				// 	display: flex;
-				// 	width: 100%;
-				// 	justify-content: space-between;
-				// 	.statistics-rubbishType{
-				// 		width: 48%;
-				// 		.statistics-box{
-				// 			margin-bottom:30upx ;
-				// 			background-color: #fff;
-				// 			padding: 20upx 10upx 20upx 20upx;
-				// 			border-radius:16upx;
-				// 		}
-				// 		.statistics-box:last-child{
-				// 			margin-bottom:0 ;
-				// 		}
-				// 	}
-				// 	.rubbishType-type{
-				// 		display: flex;
-				// 		align-items: center;
-				// 		justify-content: flex-start;
-				// 		font-size: 28upx;
-				// 		font-family: PingFang SC;
-				// 		font-weight: 400;
-				// 		color: #000000;
-				// 	}
-				// 	.rubbishType-item{
-				// 		display: flex;
-				// 		justify-content: flex-start;
-				// 		margin:10upx 0 ;
-				// 		font-size: 26upx;
-				// 		font-family: PingFang SC;
-				// 		font-weight: 400;
-				// 		color: #444444;
-				// 	}
-				// }
 			}
 		}
 </style>

+ 29 - 2
pages/index/YY.vue → pages/index/order.vue

@@ -19,9 +19,9 @@
 				<!-- 表单 -->
 				<view class="list-container">
 					<view class="list-item">
-						<view class="list-item-left phone">
+						<view class="list-item-left phone flex align_center">
 							<text>联系电话</text>
-							<u-image src="/static/billing_icon.png" width="24" height="24" style="margin:0 0 10rpx 10rpx;"></u-image>
+							<u-image src="/static/billing_icon.png" width="24" height="24" style="margin:0 0 16rpx 10rpx;"></u-image>
 						</view>
 					    <view class="list-item-right flex_1">
 							<u-input class="flex_1" :custom-style="inputClass" v-model="form.contactMobile" placeholder="请输入车牌号码" placeholder-style="color:'#bbb';font-size:18px"/>
@@ -110,6 +110,7 @@
 	import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
 	import {geRubbishType} from '@/api/index'
 	import {userInfoSave} from '@/api/data.js'
+	import { checkLogin } from '@/api/login.js' 
 	export default{
 		components: {uniNavBar},
 		data(){
@@ -159,6 +160,16 @@
 			  } 
 			})
 		},
+		onShow() {
+			checkLogin().then(res => {
+				this.hasLogin=res.status==200
+				if(this.hasLogin){
+					this.pageInit()
+				}else{
+					this.noDataText="您尚未登录或登录已过期,完成登录后可进行下单操作!"
+				}
+			})
+		},
 		methods:{
 			pageInit() {
 				this.geRubbishTypeList()
@@ -326,6 +337,22 @@
 				// 	}
 				// })
 			},
+			// 未登录弹窗
+			loginModal(){
+				uni.showModal({
+				  title: '提示',
+				  content: '您尚未登录或登录已过期,请登录后使用',
+				  success: (res)=> {
+				    if (res.confirm) {
+				     uni.navigateTo({
+				         url: '/pages/login/login'
+				     })
+				    } else if (res.cancel) {
+				      console.log('用户点击取消');
+				    }
+				  }
+				});
+			},
 		},
 		
 		onLaunch(){

二進制
static/billing_icon.png