Browse Source

Merge branch 'master' of http://git.liuniu946.com/lhl/myc

lhl 3 năm trước cách đây
mục cha
commit
6ffb56070c
4 tập tin đã thay đổi với 160 bổ sung63 xóa
  1. 9 0
      api/merchant.js
  2. 137 27
      pages/merchant/merchant.vue
  3. 14 36
      pages/user/user.vue
  4. BIN
      static/img/arc.png

+ 9 - 0
api/merchant.js

@@ -53,3 +53,12 @@ export function goods(data) {
 		data
 	});
 }
+
+//订单核销
+export function verific(data) {
+	return request({
+		url: '/api/order/order_verific',
+		method: 'post',
+		data
+	});
+}

+ 137 - 27
pages/merchant/merchant.vue

@@ -6,10 +6,14 @@
 				<view class="userInfo-box">
 					<view class="userInfo-img"><image class="portrait" :src="image || '../../static/error/missing-face.png'"></image></view>
 					<view class="userInfo-xinxi">
-						<view class="title clamp"><text>{{name}}</text></view>
-						<view class="phone"><text>{{phone}}</text></view>
+						<view class="title clamp">
+							<text>{{ name }}</text>
+						</view>
+						<view class="phone">
+							<text>{{ phone }}</text>
+						</view>
 					</view>
-					<view class="balance clamp">{{address}}</view>
+					<view class="balance clamp">{{ address }}</view>
 				</view>
 			</view>
 			<view class="userInfoList">
@@ -43,27 +47,43 @@
 				</view>
 			</view>
 		</view>
+		<uni-popup ref="popuphx" class="agree-wrapper">
+			<view class="hx-wrapper">
+				<view class="hx-img"><image src="../../static/img/hxbg.png" mode=""></image></view>
+				<view class="hx-body">
+					<view class="hx-title">输入核销码核销</view>
+					<input type="text" v-model="code" placeholder="请输入核销码" placeholder-class="hx-placeholder" />
+					<view class="hx-btn" @click="qhx">立即核销</view>
+				</view>
+				<view class="hx-close" @click="close"><image src="../../static/icon/close.png" mode=""></image></view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script>
-import { my } from '@/api/merchant.js'
+import { my,verific } from '@/api/merchant.js';
+import uniPopup from '@/components/uni-popup/uni-popup.vue';
 export default {
+	components: {
+		uniPopup
+	},
 	data() {
 		return {
-			image:'',
-			name:'',
-			phone:'',
-			address:'',
+			image: '',
+			name: '',
+			phone: '',
+			address: '',
+			code: ''
 		};
 	},
 	onLoad() {
-		my({}).then(({data}) =>{
+		my({}).then(({ data }) => {
 			this.image = data.image;
 			this.name = data.name;
 			this.phone = data.phone;
-			this.address = data.detailed_address
-		})
+			this.address = data.detailed_address;
+		});
 	},
 	methods: {
 		//跳转
@@ -72,25 +92,40 @@ export default {
 				url
 			});
 		},
+		close() {
+			this.$refs.popuphx.close()
+			this.code = ''
+		},
+		qhx() {
+			verific({verify_code:this.code,
+			is_confirm: 1,//1是核销,0是查看
+			}).then(e => {
+				this.$api.msg('核销成功')
+				this.close()
+			}).catch(e => {
+				console.log(e)
+			})
+		},
 		//调取扫描二维码
 		sao() {
 			let obj = this;
-			// #ifndef H5
-			uni.scanCode({
-				success(e) {
-					obj.orderVerific(e.result);
-				}
-			});
-			// #endif
-			// #ifdef H5
-			this.weichatObj.scanQRCode({
-				needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
-				scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
-				success: function(res) {
-					obj.orderVerific(res.resultStr); // 当needResult 为 1 时,扫码返回的结果
-				}
-			});
-			// #endif
+			this.$refs.popuphx.open();
+			// // #ifndef H5
+			// uni.scanCode({
+			// 	success(e) {
+			// 		obj.orderVerific(e.result);
+			// 	}
+			// });
+			// // #endif
+			// // #ifdef H5
+			// this.weichatObj.scanQRCode({
+			// 	needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
+			// 	scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
+			// 	success: function(res) {
+			// 		obj.orderVerific(res.resultStr); // 当needResult 为 1 时,扫码返回的结果
+			// 	}
+			// });
+			// // #endif
 		}
 	}
 };
@@ -103,6 +138,81 @@ page {
 	padding: 0;
 	margin: 0;
 }
+// 弹窗
+.hx-wrapper {
+	width: 536rpx;
+	height: 630rpx;
+	position: relative;
+
+	// background-color: #fff;
+	.hx-img {
+		width: 536rpx;
+		height: 281rpx;
+
+		image {
+			width: 536rpx;
+			height: 281rpx;
+		}
+	}
+
+	.hx-close {
+		position: absolute;
+		left: 243rpx;
+		bottom: -80rpx;
+		width: 52rpx;
+		height: 52rpx;
+
+		image {
+			width: 52rpx;
+			height: 52rpx;
+		}
+	}
+
+	.hx-body {
+		width: 536rpx;
+		height: 349rpx;
+		background-color: #fff;
+		border-radius: 0 0 10rpx 10rpx;
+
+		.hx-title {
+			width: 536rpx;
+			font-size: 36rpx;
+			font-weight: 500;
+			color: #333333;
+			line-height: 1;
+			padding-top: 42rpx;
+			text-align: center;
+		}
+
+		input {
+			width: 439rpx;
+			height: 68rpx;
+			background: #dbf3e9;
+			border-radius: 10rpx;
+			margin: 39rpx auto 0;
+			padding-left: 26rpx;
+
+			.hx-placeholder {
+				font-size: 26rpx;
+				font-weight: 500;
+				color: #52c696;
+			}
+		}
+
+		.hx-btn {
+			margin: 44rpx auto 0;
+			width: 353rpx;
+			height: 71rpx;
+			background: #52c696;
+			border-radius: 34rpx;
+			font-size: 36rpx;
+			font-weight: 500;
+			color: #f8f9f9;
+			line-height: 71rpx;
+			text-align: center;
+		}
+	}
+}
 
 .content {
 	background-color: #eeeded;

+ 14 - 36
pages/user/user.vue

@@ -26,8 +26,9 @@
 			</view>
 			<!-- 会员卡功能 -->
 			
-		</view>
-		<view class="item-box">
+		</view>
+		<view class="item-box">
+			<image class="arc" src="/static/img/arc.png"></image>
 			<view class="box-title flex borde-b">
 				<view class="title"><text>我的订单</text></view>
 				<view class="link" @click="navTo('/pages/order/order?state=5')" hover-class="common-hover">
@@ -88,39 +89,11 @@
 						<view class=" icon position-relative"><image class="icon-img" src="../../static/user/commission.png" mode="aspectFit"></image></view>
 						<text>我的佣金</text>
 					</view>
-					<!-- <view class="order-item" @click="navTo('/pages/scoreAccumulate/scoreAccumulate')" hover-class="common-hover" :hover-stay-time="50">
-						<view class=" icon position-relative"><image class="icon-img" src="../../static/user/integral.png" mode="aspectFit"></image></view>
-						<text>我的积分</text>
-					</view> -->
 					<view class="order-item" @click="navTo('/pages/coupon/consumer')" hover-class="common-hover" :hover-stay-time="50">
 						<view class=" icon position-relative"><image class="icon-img" src="../../static/user/coupon.png" mode="aspectFit"></image></view>
 						<text>我的消费券</text>
 					</view>
-					<!-- <view v-if="userInfo.is_store == 1" class="order-item" @click="openQr" hover-class="common-hover" :hover-stay-time="50">
-						<view class=" icon position-relative"><image class="icon-img" src="/static/icon/u4.png" mode="aspectFit"></image></view>
-						<text>核销</text>
-					</view> -->
-				</view>
-			
-			<!-- <image class="arc" v-if="isShowIllegality" src="/static/img/arc.png"></image> -->
-			<!-- <view class="tj-sction" v-if="isShowIllegality">
-				<view class="tj-item" @click="navTo('/pages/wallet/wallet')">
-					<text class="num">{{ userInfo.now_money || '0.00' }}</text>
-					<text>余额</text>
-				</view>
-				<view class="tj-item" @click="navTo('/pages/award/award')">
-					<text class="num">{{ userInfo.brokerage_price || '0.00' }}</text>
-					<text>佣金</text>
-				</view>
-				<view class="tj-item" @click="navTo('/pages/scoreAccumulate/scoreAccumulate')">
-					<text class="num">{{ userInfo.integral || '0.00' }}</text>
-					<text>积分</text>
 				</view>
-				<view class="tj-item" @click="navTo('/pages/coupon/consumer')">
-					<text class="num">{{ userInfo.consumer || '0.00' }}</text>
-					<text>消费券</text>
-				</view>
-			</view> -->
 			<!-- 浏览历史 -->
 			<view class="history-section ">
 				<uni-list>
@@ -395,10 +368,10 @@ export default {
 	}
 }
 .user-info-box {
-	height: 180rpx;
+	height: 280rpx;
 	color: white;
 	display: flex;
-	align-items: center;
+	align-items: start;
 	justify-content: space-between;
 	position: relative;
 	z-index: 1;
@@ -540,11 +513,16 @@ export default {
 
 .item-box {
 	position: relative;
-	border-radius: 10rpx;
 	background-color: white;
-	top: -130rpx;
-	margin: 0 30rpx;
-	box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
+	top: -150rpx;
+	box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
+	.arc {
+		position: absolute;
+		left: 0;
+		top: -34rpx;
+		width: 100%;
+		height: 36rpx;
+	}
 	.box-title {
 		line-height: 1;
 		padding: 30rpx;

BIN
static/img/arc.png