浏览代码

门店盲票列表

lsx 2 年之前
父节点
当前提交
3dadcbb035

+ 11 - 4
src/components/pay-popup/pay-popup.vue

@@ -95,6 +95,7 @@
 					workNo: "" //工号
 				},
 				promoterNum: 0, //推广员
+				siteId: "", // 门店id
 			};
 		},
 		created() {
@@ -147,10 +148,16 @@
 				})
 			},
 
-			toCoupon() {
-				uni.navigateTo({
-					url: `/packageGoods/coupon/index?channelId=${ this.payInfo.channelId }&couponId=${ this.payInfo.couponId }&boxId=${ this.payInfo.boxId }&ticketId=${ this.payInfo.ticketId }`
-				})
+			toCoupon() {
+				if(this.payInfo && this.payInfo.siteId){
+					uni.navigateTo({
+						url: `/packageGoods/coupon/index?channelId=${ this.payInfo.channelId }&couponId=${ this.payInfo.couponId }&boxId=${ this.payInfo.boxId }&ticketId=${ this.payInfo.ticketId }&siteId=${ this.payInfo.siteId }`
+					})
+				}else{
+					uni.navigateTo({
+						url: `/packageGoods/coupon/index?channelId=${ this.payInfo.channelId }&couponId=${ this.payInfo.couponId }&boxId=${ this.payInfo.boxId }&ticketId=${ this.payInfo.ticketId }`
+					})
+				}
 			},
 
 			toRule() {

+ 10 - 0
src/packageGoods/coupon/index.vue

@@ -104,6 +104,7 @@
 				backOff: "https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/coupon_bkg1.png",
 				channelId: '',
 				pagesNum: '',
+				siteId: '',
 			};
 		},
 		onShow() {
@@ -122,6 +123,9 @@
 				this.couponId = opthios.couponId
 				this.radiovalue1 = opthios.couponId
 			}
+			if(opthios.siteId){
+				this.siteId = opthios.siteId
+			}
 		},
 		methods: {
 			pageList() {
@@ -179,6 +183,9 @@
 					orderNum: 1,
 					appSource: appId
 				}
+				if( this.siteId ){
+					data.siteId = this.siteId
+				}
 				$http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
 					if (res.code == 0) {
 						let pages = getCurrentPages()
@@ -194,6 +201,9 @@
 								.couponList[0].id,
 							listNum: this.listNum
 						}
+						if(this.siteId){
+							payInfo.siteId = this.siteId
+						}
 						page.$vm.payInfo = payInfo
 						uni.navigateBack({
 							delta: 1

+ 99 - 84
src/packageOperate/store/index.vue

@@ -1,23 +1,31 @@
 <template>
 	<view>
 		<!-- #ifdef MP-ALIPAY -->
-		<u-navbar :title="storeName" :border="true" bgColor="#fff" leftIconSize="0" />
+		<!-- <u-navbar :title="siteName" :border="true" :placeholder="true" bgColor="#fff" leftIconSize="0" /> -->
+			<u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :title="siteName">
+				<view class="nav-left flex" slot="left" @click="$toIndex()">
+					<u-icon name="home" size="20" color="#333"></u-icon>
+					<view class="nav-left__code">首页</view>
+				</view>
+			</u-navbar>
 		<!-- #endif -->
 		<!-- #ifndef MP-ALIPAY -->
-		<u-navbar :title="storeName" :border="true" leftIconSize="0" bgColor="#fff" />
+		<!-- <u-navbar :title="siteName" :border="true" :placeholder="true" leftIconSize="0" bgColor="#fff" /> -->
+		<u-navbar leftIconSize="0" :placeholder="true" bgColor="#fff" :title="siteName">
+			<view class="nav-left flex" slot="left" @click="$toIndex()">
+				<u-icon name="home" size="20" color="#333"></u-icon>
+				<view class="nav-left__code">首页</view>
+			</view>
+		</u-navbar>
 		<!-- #endif -->
 		
 		<view class="list">
 			<view class="list-item" v-for="(item, index) in list" :key="index">
-				<image :src="item.picUrl" mode="aspectFit"></image>
-				<view class="list-item-content flex">
-					<view class="top">
-						<view class="top-title">{{ item.title }}</view>
-						<view class="top-num">序列号:{{ item.serialNo }}</view>
-						<view class="top-price" v-if="item.status != '2'">面值:¥{{ $numberFormat(item.facePrice) }}</view>
-					</view>
+				<image :src="item.picUrl" mode="aspectFit" @click="toTicketBox(item)"></image>
+				<view class="list-item-content flex" @click="toTicketBox(item)">
+					<view class="top">{{ item.title }}</view>
 					<view class="bottom flex">
-						<view class="bottom-price">面值:<text>¥{{ $numberFormat(item.facePrice) }}</text></view>
+						<view class="bottom-price">价格:<view style="font-size: 12px; display: inline-block;">¥</view>{{ $numberFormat(item.salePrice) }}<view class="view1">划线价:<text style="font-size: 10px; display: inline-block;">¥</text>{{ $numberFormat(item.originPrice) }}</view></view>
 					</view>
 				</view>
 			</view>
@@ -33,50 +41,85 @@
 </template>
 
 <script>
+	import env from '../../config/env.js'
 	import $http from '@/utils/request.js'
 	export default {
 		data() {
 			return {
-				storeName: '哈哈',
-				channelId: '',
 				status: 'nomore',//上拉刷新状态
 				pageNum: 1,
 				total: 0,
 				list: [],
 				pagesNum: '',
+				
+				sceneArr: [],
+				channelId: '',
+				userId: '',
+				siteName: '门店',
 			}
 		},
 
 		onLoad(options) {
-			// 当前页面参数
-			this.channelId = options.channelId
+			// 测试用
+			if(options.channelId){
+				this.channelId = options.channelId
+			}
+			
+			/**
+			 * 票赢天下小程序分享门店二维码跳转接收的参数
+			 * channelId: 门店ID
+			 * userId: 分享类型
+			 * siteName: 门店名称
+			 * */
+			if (options.scene) {
+				let sceneStr = decodeURIComponent(options.scene)
+				this.sceneArr = sceneStr.split('&')
+				this.channelId = this.sceneArr[0]
+				this.userId = this.sceneArr[1]
+			}
 		},
 		onShow() {
 			// 获取页面数据
 			this.pageList()
+			this.getSiteName()
 		},
 		methods: {
+			//获取门店名称
+			getSiteName() {
+				$http.post(`/api/v1/mp/channel/saleSite/info/${this.channelId}`,{}).then(res => {
+					if (res.code == 0) {
+						this.siteName = res.data ? res.data : ('门店' + this.channelId)
+					}
+				}).catch(() => {
+				})
+			},
+			
 			// 获取页面数据
+			pageList() {
+				this.pageNum = 1
+				this.list = []
+				this.getList()
+			},
 			getList() {
 				$http.post(`/api/v1/mp/user/ticket/list/underChannel?pageNum=${this.pageNum}&pageSize=20`,{
 					channelId: this.channelId
 				}).then(res => {
-					console.log('res',res);
-					return
 					if (res.code == 0) {
 						res.rows.forEach(item => {
 							item.picUrl = env.filePublic + item.picUrl.split(',')[0] + '?imageView2/2/w/170'
-						})
+						})
 						this.total = res.total
 						this.list = this.list.concat(res.rows)
 					}
 				}).catch(() => {
 				})
 			},
-			pageList() {
-				this.pageNum = 1
-				this.list = []
-				this.getList()
+			
+			// 点击盲票,跳转盲票详情
+			toTicketBox(item) {
+				uni.navigateTo({
+					url: `/pages/ticketBox/detail?boxId=${ item.boxId }&share=1&siteId=${ this.channelId }`
+				})
 			},
 		},
 		onReachBottom() {
@@ -90,6 +133,11 @@
 	}
 </script>
 <style lang="scss" scoped>
+	.nav-left {
+		&__code {
+			margin-left: 10rpx;
+		}
+	}
 	// 状态
 	.state {
 		display: flex;
@@ -101,52 +149,43 @@
 	}
 	// 列表
 	.list {
-		padding: 120rpx 0 100rpx;
+		padding: 20rpx 0 100rpx;
 		margin: 0 20rpx 0;
 		
 		&-item {
 			display: flex;
 			background: #FFFFFF;
-			border-radius: 11px;
-			padding: 34rpx 10rpx;
-			margin-bottom: 34rpx;
+			padding: 30rpx 20rpx;
+			border-radius: 1px;
+			box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.12);
+			margin-bottom: 28rpx;
 			
 			image {
-				width: 200rpx;
-				height: 270rpx;
+				width: 140rpx;
+				height: 189rpx;
 				border-radius: 22rpx;
-				margin-right: 15rpx;
+				margin-right: 60rpx;
 			}
 			
 			&-content {
-				flex: 1;
+				width: 70%;
+				// flex: 1;
 				flex-direction: column;
 				justify-content: space-between;
-				padding: 16rpx 0;
+				padding: 26rpx 0;
 				
 				
 				.top {
 					width: 100%;
-					display: flex;
-					flex-direction: column;
-					
-					&-title {
-						font-size: 36rpx;
-						line-height: 36rpx;
-						font-weight: bold;
-						margin-bottom: 46rpx;
-					}
-					
-					&-num {
-						font-size: 26rpx;
-						line-height: 26rpx;
-					}
+					display: inline-block;
+					font-size: 30rpx;
+					line-height: 30rpx;
+					font-weight: bold;
+					margin-bottom: 46rpx;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
 					
-					&-price {
-						margin-top: 30rpx;
-						font-size: 26rpx;
-						line-height: 26rpx;
-					}
 				}
 				
 				.bottom {
@@ -154,45 +193,21 @@
 					justify-content: space-between;
 					
 					&-price {
-						height: 26rpx;
+						height: 30rpx;
 						overflow: hidden;
-						font-size: 26rpx;
-						line-height: 26rpx;
+						font-size: 30rpx;
+						line-height: 30rpx;
 						
-						text {
-							color: #F9822C ;
-						}
-					}
-					&-pricetwo {
-						view {
+						.view1 {
+							color: #999;
 							display: inline-block;
-							height: 26rpx;
-							font-size: 26rpx;
-							line-height: 26rpx;
-							vertical-align: top;
+							text-decoration: line-through;
+							margin-left: 10rpx;
+							font-size: 24rpx;
+							text {
+								text-decoration: line-through;
+							}
 						}
-						text {
-							display: inline-block;
-							color: #F9822C ;
-							width: 350rpx;
-							height: 26rpx;
-							font-size: 26rpx;
-							line-height: 26rpx;
-							white-space: nowrap;
-							overflow: hidden;
-							text-overflow: ellipsis;
-						}
-					}
-					
-					&-btn {
-						width: 220rpx;
-						height: 72rpx;
-						line-height: 72rpx;
-						text-align: center;
-						background: #F9822C;
-						border-radius: 36rpx;
-						color: #FFFFFF;
-						font-size: 30rpx;
 					}
 				}
 			}

+ 1 - 1
src/packagePrize/purchase/index.vue

@@ -22,7 +22,7 @@
 		<view class="purchase">
 			<image class="imgOne" src="https://mp-public-test-1309783959.cos.ap-shanghai.myqcloud.com/v2/buy_suc.png"
 				mode="scaleToFill"></image>
-			<image class="imgTwo" :src="picUrl" mode="scaleToFill"></image>
+			<image class="imgTwo" :src="picUrl" mode="aspectFit"></image>
 		</view>
 
 		<view class="package">

+ 8 - 2
src/pages/index/index.vue

@@ -34,7 +34,8 @@
 					</view>
 					<!-- #endif -->
 				</view>
-				<!-- <view @click="toLucky">这是测试盲票开奖入口</view> -->
+				<!-- <view @click="toLucky">这是测试盲票开奖入口</view> -->
+				<!-- <view @click="toStore">这是测试门店盲票列表入口</view> -->
 				<!-- 盲票轮播 -->
 				<view class="ticket">
 					<view class="ticket-bgc" @click="ticketLeft()">
@@ -322,8 +323,13 @@
 			
 			toLucky() {
 				uni.navigateTo({
-					url: `/pages/lucky/index?id=9e3f2d1220c368b027f4f35c49fdabb77a46fa669e4482326ea7cf746757ee22`
+					url: `/pages/lucky/index?id=9a4b315da3ef4db5ea378c05f8b0b626f87d793d66714d29dcc7f4ccf9441317`
 				})
+			},
+			toStore() {
+				uni.navigateTo({
+					url: `/packageOperate/store/index?channelId=49`
+				})
 			},
 
 			// 投诉建议

+ 18 - 3
src/pages/ticketBox/detail.vue

@@ -74,8 +74,8 @@
 				</view>
 				<view class="ticket-btn-share flex">
 					<!-- #ifdef MP-WEIXIN -->
-					<image src="../../static/ticketBox/ticket_share.png" mode="scaleToFill" @click="toShare"></image>
-					<button type="default" open-type="share" v-if="loginState"></button>
+					<image src="../../static/ticketBox/ticket_share.png" mode="scaleToFill" @click="toShare" v-if="!share"></image>
+					<button type="default" open-type="share" v-if="loginState && !share"></button>
 					<!-- #endif -->
 				</view>
 			</view>
@@ -163,9 +163,18 @@
 				userInfo: {},
 				loginState: false,
 				pagesNum: '',
+				share: 0,
+				siteId: '',
 			};
 		},
 		onLoad(opthios) {
+			// 从门店盲票列表跳转
+			if(opthios.share) {
+				this.share = opthios.share
+			}
+			if(opthios.siteId){
+				this.siteId = opthios.siteId
+			}
 			//票赢天下跳转
 			if (opthios.scene) {
 				let sceneStr = decodeURIComponent(opthios.scene)
@@ -314,7 +323,10 @@
 					autoCoupon: 1,
 					boxId: this.info.boxId,
 					orderNum: 1,
-					appSource: appId
+					appSource: appId,
+				}
+				if( this.siteId ){
+					data.siteId = this.siteId
 				}
 				$http.post('/api/v1/mp/user/ticket/order/settle', data).then(res => {
 					if (res.code == 0) {
@@ -327,6 +339,9 @@
 							couponId: res.data && res.data.couponList && res.data.couponList.length && res.data
 								.couponList[0].id
 						}
+						if( this.siteId ){
+							info.siteId = this.siteId
+						}
 						this.payInfo = info
 						this.payShow = true
 					}