소스 검색

Merge branch 'master' of ssh://git.9026.com:2212/gubai/IHG

gubai 2 년 전
부모
커밋
79e18dfc86
5개의 변경된 파일62개의 추가작업 그리고 57개의 파일을 삭제
  1. 1 1
      pages.json
  2. 22 12
      pages/goods/goods-detail/index.vue
  3. 32 37
      pages/goods/goods-lucky/index.vue
  4. 4 4
      pages/index/vote-detail/index.vue
  5. 3 3
      setting.js

+ 1 - 1
pages.json

xqd
@@ -331,7 +331,7 @@
 		"list": [{
 			"name": "goood-lucky", //模式名称
 			"path": "pages/goods/goods-lucky/index", //启动页面,必选
-			"query": "draw_no=H191Q9HmOQxh" //启动参数,在页面的onLoad函数里面得到
+			"query": "draw_no=UBGsSWflawlc" //启动参数,在页面的onLoad函数里面得到
 		}]
 	}
 }

+ 22 - 12
pages/goods/goods-detail/index.vue

xqd
@@ -460,22 +460,32 @@
 			checked(index) {
 				this.isActive = index
 			},
+			getAttrListId(name){
+				for(let k in this.attr_groups){
+					for(let k1 in this.attr_groups[k].attr_list){
+						const v = this.attr_groups[k].attr_list[k1];
+						if(v.attr_name == name){
+							return v.attr_id;
+							break;
+						}
+					}
+				}
+			},
 			// 口味切换
 			flavorchecked(index, name) {
 				this.$set(this.flavorIsActive, name, index)
 				this.specs.flavor = name
-				if (Object.keys(this.flavorIsActive).length < this.sku.keys.length) return;
-				for (let index = 0; index < this.sku.sku.length; index++) {
-					const item = this.sku.sku[index];
-					let res = true;
-					for (const k in this.flavorIsActive) {
-						if (item[k] != this.flavorIsActive[k]) {
-							res = false
-						}
-					}
-					if (res) {
-						this.productDetail.price = item.price;
-						this.productDetail.integral = item.price
+				
+				let resTemp = []
+				for(let k in this.flavorIsActive){
+					resTemp.push(this.getAttrListId(this.flavorIsActive[k]));
+				}
+				const attr = resTemp.join(":");
+				for(let k in this.productDetail.product_attr){
+					if(this.productDetail.product_attr[k].attr == attr){
+						const price = this.productDetail.product_attr[k].price;
+						this.productDetail.price = price;
+						this.productDetail.integral = price;
 						break;
 					}
 				}

+ 32 - 37
pages/goods/goods-lucky/index.vue

xqd xqd xqd xqd xqd xqd xqd
@@ -15,7 +15,7 @@
 			<view class="produce">
 				<view class="produce-title">奖品信息</view>
 				<view class="produce-main" v-for="(item,index) in drawInfo.draw_template.draw_config" :key="item.id">
-					<image style="width: 132rpx;height: 132rpx;border-radius: 10rpx;" :src="item.product.img_urls"
+					<image style="width: 132rpx;height: 132rpx;border-radius: 10rpx;" :src="item.product.img_urls?item.product.img_urls:item.prize_img"
 						mode=""></image>
 					<view class="produce-main-text">
 						<text class="produce-main-text-top">{{item.name}}</text>
@@ -96,7 +96,27 @@
 			</view>
 		</uni-popup>
 
-
+		<uni-popup ref="dialogError" type="center">
+			<view style="
+				width: 600rpx;
+				max-width: 100%;
+				text-align: center;
+				background: #fff;
+				height: 300rpx;
+				border-radius: 20rpx
+			">
+				<view style="
+					height: 70%;
+					display: flex;
+					justify-content: center;
+					align-items: center;
+					border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+				">
+					{{error.info}}
+				</view>
+				<navigator style="height: 30%;display: flex;justify-content: center;align-items: center;" open-type="exit" target="miniProgram">退出</navigator>
+			</view>
+		</uni-popup>
 
 	</view>
 </template>
@@ -109,40 +129,15 @@
 		},
 		data() {
 			return {
+				error:{
+					info: ""
+				},
 				big_wheel:{},
 				//中奖等级
 				prizeLevel:'',
 				isexchange: true,
 				backImageUrl: 'http://t9.9026.com/imgs/banner02.png',
-				award: 1,
-				// awardList: [{
-				// 		title: '一等奖'
-				// 	},
-				// 	{
-				// 		title: '四等奖'
-				// 	},
-				// 	{
-				// 		title: '谢谢参与'
-				// 	},
-				// 	{
-				// 		title: '一等奖'
-				// 	},
-				// 	{
-				// 		title: '谢谢参与'
-				// 	},
-				// 	{
-				// 		title: '三等奖'
-				// 	},
-				// 	{
-				// 		title: '三等奖'
-				// 	},
-				// 	{
-				// 		title: '二等奖'
-				// 	},
-				// 	{
-				// 		title: '一等奖'
-				// 	}
-				// ], 
+				award: 1,
 				// 顺时针对应每个奖项 
 				drawInfo:{
 					draw_no: ''
@@ -209,10 +204,8 @@
 						this.drawInfo = res.data;
 						this.$refs.turntable.init(this.drawInfo.draw_template.draw_config);
 					}else{
-						uni.showToast({
-							icon: 'error',
-							title: res.msg ? res.msg : "暂无权限"
-						})
+						this.error.info = res.msg ? res.msg : "暂无权限";
+						this.$refs.dialogError.open()
 					}
 				}).catch(err=>{
 					uni.showToast({
@@ -231,7 +224,7 @@
 					if(res.code == 0){
 						res.data.data.forEach(item => {
 							if(item.source == 2 && (item.integral>0 || item.product_id>0)){
-								this.drawRecord.push(item);	
+								this.drawRecord.push(item);
 							}
 						})
 						if(res.data.length >= 15){
@@ -286,7 +279,6 @@
 						if(draw_config[i].id == this.drawResult.draw_config_id){
 							this.drawResultProduct = draw_config[i];
 							setTimeout(()=>{
-								console.log(i)
 								this.$refs.turntable.end(i).then(_=>{
 									if(this.drawResultProduct.integral<=0 && !this.drawResultProduct.product){
 										this.$refs.codePurchaseNone.open()
@@ -294,6 +286,9 @@
 										this.$refs.codePurchase.open()
 									}
 								});
+								if(this.drawResult.draw_type){
+									this.getDrawRecord(1)
+								}
 							}, 5000)
 							break;
 						}

+ 4 - 4
pages/index/vote-detail/index.vue

xqd xqd xqd
@@ -128,7 +128,7 @@
 				</view>
 				<view class="textfont">
 					<text v-if="!isVoteNum && is_prize==0">今日投票数已用完
-						{{!isVoteNum&&is_vip ? '' : `点击 加入IHG会员 可享受额外${vipRewardTicketNum}票`}}</text>					
+						{{isVoteNum&&!is_vip&&vipRewardTicketNum ? `点击 加入IHG会员 可享受额外${vipRewardTicketNum}票` : ""}}</text>					
 					<text v-if="isVoteNum && is_prize==0 ">今日投票数还有 {{userCanVoteNum}} 次
 						点击再次投票可再次为本项目投票也可为其他项目投票</text>
 					<text v-if="is_prize==1">恭喜你中奖了!
@@ -140,7 +140,7 @@
 						<text>{{isVoteNum?'再次投票':'关闭'}}</text>
 					</view>
 					<view v-if="is_prize==0" class="download" @click="isVoteNum||is_vip?goOtherItem():goJoinActivity()">
-						<text>{{isVoteNum||is_vip?'其他项目':'加入IHG会员' }}</text>
+						<text>{{isVoteNum||is_vip||!vipRewardTicketNum?'其他项目':'加入IHG会员' }}</text>
 					</view>
 
 					<view v-if="is_prize==1" class="cancel" @click="closeVote">
@@ -575,14 +575,14 @@
 						}
 					} else {
 						uni.showToast({
-							icon: 'error',
+							icon: 'none',
 							title: res.msg?res.msg:"暂无权限"
 						})
 					}
 				}).catch(err => {
 					console.log(err)
 					uni.showToast({
-						icon: 'none',
+						icon: 'error',
 						title: '投票失败'
 					})
 				})

+ 3 - 3
setting.js

xqd
@@ -1,10 +1,10 @@
 /**
  * Created by JianJia.Zhou<jianjia.zhou> on 2022/3/18.
  */
-const IS_DEV = process.env.NODE_ENV === 'development'
+const IS_DEV = process.env.NODE_ENV === 'development1'
 
-const URL = 'https://t9.9026.com'
-// const URL = 'https://ihg.9026.com'
+// const URL = 'https://t9.9026.com'
+const URL = 'https://ihg.9026.com'
 
 	
 module.exports = {