twt vor 2 Jahren
Ursprung
Commit
0d235c2d84
3 geänderte Dateien mit 204 neuen und 0 gelöschten Zeilen
  1. 7 0
      pages.json
  2. 175 0
      pages/index/discountDlq.vue
  3. 22 0
      pages/index/index.vue

+ 7 - 0
pages.json

@@ -465,6 +465,13 @@
 				"navigationBarTitleText": "提现说明"
 				 //"enablePullDownRefresh": true
 			}
+		},
+		{
+			"path": "pages/index/discountDlq",
+			"style": {
+				"navigationBarTitleText": "优惠券",
+				 "enablePullDownRefresh": true
+			}
 		}
     ],
 	"tabBar": {

+ 175 - 0
pages/index/discountDlq.vue

@@ -0,0 +1,175 @@
+<template>
+<view class="box">
+	<view style="height: 20rpx;"></view>
+ <view class="line" v-for="(item,index) in list">
+	 <view class="linetop">
+		 <view class="lineTopleft">
+		 	<view class="lineTop1">
+				<view class="linemoney">¥ <span style="font-size: 40rpx;">{{item.actMoney}}</span> </view>
+				<view class="lineTopName">新人优惠券</view>
+			</view>
+			<view class="linetop2">
+				<view class="mdsky">{{item.whereMoney!==0?'满'+item.whereMoney+'可用':'无限制'}}</view>
+				<view class="endOffsetDays">
+					<span v-if="item.endOffsetDays">领取后{{item.endOffsetDays}}天有效</span>
+					<span v-else>{{item.startTime|dateformat}}-{{item.endTime|dateformat}}</span>
+				</view>
+			</view>
+		 </view>
+		 <view class="receiveBtn1" @click="receive(item.id)">领取</view>
+	 </view>
+	 <view class="lineBottom">
+		 <view>可用次数:{{item.avaQty}}</view>
+		 <view>查看详情></view>
+	 </view>
+ </view>
+ <nodata v-if="list.length==0"></nodata>
+</view>
+</template>
+
+<script>
+	import nodata from '../../components/nodata/nodata.vue'
+	export default {
+		components: {
+			nodata
+		},
+		
+		data() {
+			return {
+				list:'',
+				themeColor:'',
+				userInfo:'',
+				stateMap: ['待审核', '审核通过', '审核拒绝'],
+			}
+		},
+		onLoad(opt) {
+			this.themeColor = uni.getStorageSync("themeColor");
+			this.userInfo = uni.getStorageSync("userInfo");
+			this.getList()
+		},
+		onShow() {
+			
+		},
+		methods: {
+			receive(id){
+				uni.showLoading({
+					title: '领取中'
+				})
+				this.$http('opencoupon/getCoupons', {
+				      id: id,
+				}, 'GET').then(res => {
+					uni.hideLoading();
+					uni.showToast({
+						 title: '领取成功',
+						 icon:'none',
+						 duration: 3000
+					});
+					//this.getList();
+					//var data=res.data.Items;
+					//this.list=this.list.concat(data);
+					//console.log('list+=', this.queryShopList);
+				
+				})
+			},
+			getList(){
+				uni.showLoading({
+					title: '加载中'
+				})
+				this.$http('opencoupon/getCouponList', {
+				    discount:1
+				}, 'GET').then(res => {
+					uni.hideLoading();
+					this.list = res.data;
+					//var data=res.data.Items;
+					//this.list=this.list.concat(data);
+					//console.log('list+=', this.queryShopList);
+				
+				})
+			}
+			
+		},
+		onReachBottom(){
+			//this.page++;
+			this.getList()
+			//console.log("shanglas")
+		},
+		onPullDownRefresh(){
+		    //this.page=1;
+			//this.list=[];
+			this.getList();
+			setTimeout(() => {
+					uni.stopPullDownRefresh(); // 关闭下拉刷新 
+			}, 2000);
+		}
+	}
+</script>
+
+<style scoped lang="less">
+.box {
+	width: 100vw;
+	min-height: 100vh;
+	background: #F4F5F7;
+}
+.receiveBtn1{
+	width: 144rpx;
+	height: 56rpx;
+	font-size: 28rpx;
+	line-height: 56rpx;
+	color: #D53533;
+	border-radius: 36rpx;
+	border: 2rpx solid #D53533;
+	text-align: center;
+}
+.lineTop1{
+	display: flex;
+}
+.linetop2{
+	display: flex;font-size: 24rpx;
+	padding-bottom: 39rpx;
+	padding-top: 10rpx;
+}
+.mdsky{
+	color: #666666;
+}
+.endOffsetDays{
+	color: #666666;
+}
+.linemoney{
+	width: 260rpx;
+}
+.linetop{
+	display: flex;
+	justify-content: space-between;
+}
+.mdsky{
+	width: 260rpx;
+}
+.lineBottom{
+	display: flex;
+	justify-content: space-between;
+	color: #999999;
+	font-size: 24rpx;
+	padding-top: 20rpx;
+	border-top: 1px dashed #EEEEEE;
+}
+.linemoney{
+	color: #FF3B30;font-size: 26rpx;
+}
+.lineTopName{
+	font-size: 30rpx;
+	font-family: PingFangSC-Medium, PingFang SC;
+	font-weight: 500;
+	color: #333333;
+}
+
+.line{
+	width: 662rpx;
+	background: #FFFFFF;
+	border-radius: 10rpx;
+	margin-bottom: 20rpx;
+	margin-left: 24rpx;
+	padding: 30rpx 20rpx 20rpx 20rpx;
+}
+
+
+</style>

+ 22 - 0
pages/index/index.vue

@@ -257,6 +257,7 @@
 				themeColor:'',
 				getwxLoing:false,
 				shareID:'',
+				discount:'',
 			}
 		},
 		onLoad(opt) {
@@ -276,6 +277,7 @@
 				this.shareID = shareID
 				//this.$store.commit('mutationsshareID', shareID)
 			}
+			this.shareID='5788B15EAEE94EE78D3AA3FCE079B68D'
 			//this.unionId="26A1039A-DB10-4D0E-BBA2-541C06274EED";
 			//this.ext.appId="wxffd2502e67d37908"
 			// uni.setStorage({
@@ -633,6 +635,26 @@
 					}else{
 						this.authorizShow=true;
 					}
+					 uni.hideLoading();
+					 
+					//console.log("优惠券")
+					uni.showModal({
+						title: '提示',
+						content: '您有优惠券待领取',
+						cancelText:'回到首页',
+						confirmText:'查看',
+						success: function(resTK) {
+							if (resTK.confirm) {
+								uni.navigateTo({
+									url:'discountDlq'
+								})
+							}
+						}
+					
+					
+					});
+					
+					
 					
 					
 				  })