소스 검색

bug 修复

lilei 4 년 전
부모
커밋
52bfe3dbc6
4개의 변경된 파일89개의 추가작업 그리고 13개의 파일을 삭제
  1. 2 2
      App.vue
  2. 18 0
      api/user.js
  3. 67 9
      pages/checkOut/checkOut.vue
  4. 2 2
      pages/index/index.vue

+ 2 - 2
App.vue

@@ -1,6 +1,6 @@
 <script>
-	const uat_URL = 'https://lese.test.sxzxyj.net/gc-shop/' // 预发布
-	// const uat_URL = 'http://192.168.16.102:8302/gc-shop/' // 本地
+	// const uat_URL = 'https://lese.test.sxzxyj.net/gc-shop/' // 预发布
+	const uat_URL = 'http://192.168.16.104:8302/gc-shop/' // 本地
 	const pro_URL = 'https://lese.sxzxyj.net/gc-shop/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 18 - 0
api/user.js

@@ -31,4 +31,22 @@ export const ldUsedQuery = params => {
     data: params,
     method: 'post'
   })
+}
+
+// 核销
+export const sellerReceive = params => { 
+  let url = `seller/receive`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 查询销售商信息
+export const sellerFindByPartnerNo = params => { 
+  let url = `seller/findByPartnerNo/${params.officialPartnerNo}`
+  return axios.request({
+    url: url,
+    method: 'get'
+  })
 }

+ 67 - 9
pages/checkOut/checkOut.vue

@@ -3,11 +3,10 @@
 		<u-gap height="10" bg-color="#f8f8f8"></u-gap>
 		<u-field
 			class="field-item"
-			v-model="storeName"
+			:value="store.name"
 			disabled
 			input-align="right"
 			label="收取门店"
-			placeholder="请填写手机号"
 		>
 		</u-field>
 		<u-field
@@ -37,7 +36,7 @@
 				<view class="text-cont">
 					<view>
 						<text>收取门店:</text>
-						<text>{{storeName}}</text>
+						<text>{{store.name||'--'}}</text>
 					</view>
 					<view class="num-text">
 						<text>支付数量:</text>
@@ -64,24 +63,51 @@
 				</view>
 			</view>
 		</u-popup>
+		
+		<!-- 提示用户设置支付密码 -->
+		<u-modal v-model="showSetPswModal" 
+		content="请先设置支付密码,才能使用乐豆" 
+		show-cancel-button 
+		confirm-text="去设置" 
+		cancel-text="暂时放弃"
+		@confirm="toSetPwd"
+		@cancel="showSetPswModal=false"
+		></u-modal>
 	</view>
 </template>
 
 <script>
+	import { sellerReceive,sellerFindByPartnerNo } from '@/api/user.js'
+	import { existPayPwd } from '@/api/order.js'
 	export default{
 		data() {
 			return {
-				storeName: '和超级大黄蜂发挥教师的回复', // 门店名称
+				showSetPswModal: false,
+				store: null, // 门店信息
 				remarks: '', // 备注
 				number: '',  // 支付数量
 				showPayModal: false, // 支付弹窗
 				password: '', // 支付密码
+				partnerNo: '' // 销售商编号
 			}
 		},
-		onLoad() {
-			
+		onLoad(opts) {
+			console.log(opts)
+			this.partnerNo = opts.scene
+			// 查询销售商信息
+			sellerFindByPartnerNo({officialPartnerNo: this.partnerNo}).then(res => {
+				if(res.status == 200){
+					this.store = res.data
+				}
+			})
 		},
 		methods: {
+			// 跳转到设置支付密码页
+			toSetPwd () {
+				uni.navigateTo({
+					url:"/pages/userCenter/userInfo/paymentPwd"
+				})
+			},
 			// 确认支付
 			handlePay() {
 				if (!this.number) {
@@ -90,7 +116,18 @@
 						icon: 'none'
 					})
 				} else {
-					this.showPayModal = true
+					existPayPwd().then(res => {
+						console.log(res,'rrrrrr')
+						if(res.status == 200) {
+							// 设置过支付密码,输入密码
+							if(res.data) {
+								this.showPayModal = true
+							} else {
+								// 没设置过支付密码,提示设置密码
+								 this.showSetPswModal = true
+							}
+						}
+					})
 				}
 			},
 			// 关闭弹窗
@@ -100,8 +137,29 @@
 			},
 			// 输入密码完成 支付
 			confirm(e) {
-				console.log(e,'eeeee')
-				
+				if(this.password == ''){
+					uni.showToast({
+						title: '请输入支付密码',
+						icon: 'none'
+					})
+					return
+				}
+				let data = {
+					"payPassword": this.password,
+					"changeNum": this.number,
+					"remarks": this.remarks,
+					"officialPartnerNo": this.partnerNo
+				}
+				sellerReceive(data).then(res => {
+					console.log(res)
+					if(res.status == 200){
+						uni.navigateBack()
+						uni.showToast({
+							icon: 'none',
+							title: res.message
+						})
+					}
+				})
 			}
 		},
 	}

+ 2 - 2
pages/index/index.vue

@@ -285,13 +285,13 @@
 						console.log(e)
 						// 普通二维码,用户扫箱体的二维码开箱
 						if(e.scanType == 'QR_CODE'){
-							console.log(e.result)
 							_this.openDevice(e.result)
 						}
 						// 小程序码,用户核销
 						if(e.scanType == 'WX_CODE'){
+							let scene = e.path.split('?')[1]
 							uni.navigateTo({
-								url: '/pages/checkOut/checkOut'
+								url: '/pages/checkOut/checkOut?scene='+scene.split("=")[1]
 							})
 						}
 					},