浏览代码

核销二维码无效时 显示修改

1004749546@qq.com 4 年之前
父节点
当前提交
59ae26385f
共有 2 个文件被更改,包括 31 次插入33 次删除
  1. 18 29
      pages/checkOut/checkOut.vue
  2. 13 4
      pages/index/index.vue

+ 18 - 29
pages/checkOut/checkOut.vue

@@ -31,12 +31,12 @@
 				<text>{{number||0}}</text>
 				<u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
 			</view>
-			<u-button :custom-style="btnStyle" @click="handlePay" type="error" >确认支付</u-button>
+			<u-button @click="handlePay" type="success" >确认支付</u-button>
 		</view>
 		 <!-- 确认支付弹窗 -->
 		 <u-popup mode="center" closeable @close="closeModal" v-model="showPayModal" width="600rpx" >
 			<view class="slot-content">
-				<view>请输入支付密码</view>
+				<view class="slot-title">请输入支付密码</view>
 				<view class="text-cont">
 					<view>
 						<text>收取门店:</text>
@@ -51,19 +51,20 @@
 					</view>
 					<view>
 						<text>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</text>
-						<text>{{remarks||'--'}}</text>
+						<text>{{remarks||''}}</text>
 					</view>
 				</view>
 				<view class="footer">
 					<input v-model="password" 
 					type="password" 
+					:focus="focus"
 					placeholder="请输入支付密码" 
 					:maxlength="30"
 					@confirm="confirm"
 					/>
 				</view>
 				<view class="fot-btn">
-					<u-button :custom-style="btnStyle" @click="confirm" type="error" >确认支付</u-button>
+					<u-button @click="confirm" type="success" >确认支付</u-button>
 				</view>
 			</view>
 		</u-popup>
@@ -81,14 +82,11 @@
 </template>
 
 <script>
-	import { sellerReceive,sellerFindByPartnerNo } from '@/api/user.js'
+	import { sellerReceive } from '@/api/user.js'
 	import { existPayPwd } from '@/api/order.js'
 	export default{
 		data() {
 			return {
-				btnStyle: {
-					backgroundColor : '#07c160'
-				},
 				showSetPswModal: false,
 				store: null, // 门店信息
 				remarks: '', // 备注
@@ -96,24 +94,15 @@
 				showPayModal: false, // 支付弹窗
 				password: '', // 支付密码
 				partnerNo: '', // 销售商编号
-				currentGold: 0 //用户当前拥有乐豆数
+				currentGold: 0, //用户当前拥有乐豆数
+				focus: false
 			}
 		},
 		onLoad(opts) {
 			this.currentGold = this.$store.state.vuex_userData.currentGold
 			console.log(this.currentGold,'currentGold')
 			console.log(opts)
-			this.partnerNo = opts.scene
-			// 查询销售商信息
-			sellerFindByPartnerNo({officialPartnerNo: this.partnerNo}).then(res => {
-				if(res.status == 200){
-					this.store = res.data
-				} else {
-					setTimeout(()=>{
-						uni.navigateBack()
-					},500)
-				}
-			})
+			this.store = JSON.parse(decodeURIComponent(opts.store))
 		},
 		methods: {
 			// 跳转到设置支付密码页
@@ -143,6 +132,9 @@
 							// 设置过支付密码,输入密码
 							if(res.data) {
 								this.showPayModal = true
+								setTimeout(()=>{
+									this.focus = true
+								},300)
 							} else {
 								// 没设置过支付密码,提示设置密码
 								 this.showSetPswModal = true
@@ -177,12 +169,7 @@
 						uni.redirectTo({
 							url: '/pages/checkOut/checkFinish?num='+this.number
 						})
-					} else {
-						uni.showToast({
-							icon: 'none',
-							title: res.message
-						})
-					}
+					} 
 				})
 			}
 		},
@@ -231,17 +218,19 @@
 	}
 	.slot-content{
 		padding: 30upx 0;
-		font-size: 32upx;
 		display: flex;
 		flex-direction: column;
 		align-items: center;
 		justify-content: space-between;
+		.slot-title{
+			font-size: 36rpx;
+		}
 		.text-cont{
 			width: 100%;
 			margin-top: 20upx;
-			border-bottom: 1px solid #F8F8F8;
+			// font-size: 20rpx;
 			>view {
-				padding: 10upx 40upx;
+				padding: 10upx 80upx;
 				display: flex;
 				>text{
 					&:last-child {

+ 13 - 4
pages/index/index.vue

@@ -74,6 +74,7 @@
 	import {stationList} from '@/api/station.js'
 	import {checkLogin,getUserInfo} from '@/api/login.js'
 	import {parseQueryString} from '@/libs/tools.js'
+	import { sellerFindByPartnerNo } from '@/api/user.js'
 	export default {
 		data() {
 			return {
@@ -108,7 +109,6 @@
 			this.getbannerList()
 			//  获取经纬度
 			this.getLocation()
-			
 			// 是否登录
 			checkLogin().then(res => {
 				console.log(res,'checkLogin')
@@ -251,9 +251,7 @@
 						if(e.scanType == 'QR_CODE'){
 							let params = parseQueryString(e.result)
 							if(params.codeType == 'hexiao'){  //  扫商户码
-								uni.navigateTo({
-									url: '/pages/checkOut/checkOut?scene='+params.officialPartnerNo
-								})
+								_this.getStoreData(params.officialPartnerNo)
 							}else{  //  扫箱体码
 								_this.openDevice(e.result)
 							}
@@ -271,6 +269,17 @@
 					}
 				})
 			},
+			// 扫商户码,获取商户信息
+			getStoreData(params) {
+				sellerFindByPartnerNo({officialPartnerNo: params}).then(res => {
+					if(res.status == 200){
+						let store = res.data
+						uni.navigateTo({
+							url: '/pages/checkOut/checkOut?store='+encodeURIComponent(JSON.stringify(store))
+						})
+					} 
+				})
+			},
 			// 开箱
 			openDevice(data){
 				let params = parseQueryString(data)