Quellcode durchsuchen

Merge branch 'dev' into 'test'

修改缺陷 盲豆优惠券的商品详情

See merge request quanshu/mp-ui-user!57
世轩 vor 2 Jahren
Ursprung
Commit
3d4d1add71

+ 1 - 1
src/packageGoods/ticket/index.vue

@@ -24,7 +24,7 @@
 			<view class="flex ticket-box-list">
 				<!-- <navigator :url="`/pages/ticketBox/detail?boxId=${ item.boxId }`" class="flex ticket-box-list-item"
 					hover-class="navigator-hover" v-for="(item, index) in list" :key="index"> -->
-				<navigator :url="JSON.parse(item.refType).value === 'goods' ? `/packagePrize/goods/index?id=${ item.refId }&boxId=${ item.boxId }`:JSON.parse(item.refType).value === 'coin' ?`/packagePrize/goods/index?id=424`:`/packagePrize/goods/index?id=425`" class="flex ticket-box-list-item"
+				<navigator :url="JSON.parse(item.refType).value === 'goods' ? `/packagePrize/goods/index?id=${ item.refId }&boxId=${ item.boxId }`:JSON.parse(item.refType).value === 'coin' ?`/packagePrize/goods/index?id=424&boxId=${ item.boxId }`:`/packagePrize/goods/index?id=425&boxId=${ item.boxId }`" class="flex ticket-box-list-item"
 					hover-class="navigator-hover" v-for="(item, index) in list" :key="index">
 					<image :src="item.picUrl" mode="aspectFill"></image>
 					<view class="info">

+ 21 - 6
src/packageOperate/activity/index.vue

@@ -56,13 +56,13 @@
 			</view>
 
 			<!-- 一等奖 -->
-			<view v-for="(item,index) in awardsList" :key="index">
+			<view v-for="(item,index) in awardsList" :key="item.id">
 				<view class="wrap-fixed" v-for="(itemTwo,index1) in item.prizeList" :key="index1"
 					v-if="item.name == '一等奖'">
 					<view class="wrap-fixed-effectstwo">
 						<view class="effectsthree">
 							<navigator
-								:url="JSON.parse(itemTwo.prizeType).value == 'goods' ? `/packagePrize/goods/detail?id=${ itemTwo.refId }`:JSON.parse(itemTwo.prizeType).value == 'coin' ?`/packagePrize/goods/detail?id=424`:`/packagePrize/goods/detail?id=425`"
+								:url="itemTwo.prizeType && JSON.parse(itemTwo.prizeType).value == 'goods' ? `/packagePrize/goods/detail?id=${ itemTwo.refId }`:JSON.parse(itemTwo.prizeType).value == 'coin' ?`/packagePrize/goods/detail?id=424`:`/packagePrize/goods/detail?id=425`"
 								hover-class="none">
 								<view class="effectsthree-width">
 									<image src="../static/activity/effectsthree.png" mode="aspectFit"></image>
@@ -127,7 +127,7 @@
 								</navigator>
 							</view>
 						</view>
-						<view v-if="item.prizeList.length > 1 " class="wrap-award-explain">以上奖品随机获得一件</view>
+						<view v-if="item.prizeList && item.prizeList.length > 1 " class="wrap-award-explain">以上奖品随机获得一件</view>
 					</view>
 				</view>
 			</view>
@@ -137,7 +137,7 @@
 			<!-- 抽奖码 -->
 			<view class="wrap-description">
 				<view class="wrap-description-code"> 我的抽奖码</view>
-				<view v-if="info.codeList.length > 0" class="wrap-description-codetwo">
+				<view v-if="info.codeList && info.codeList.length > 0" class="wrap-description-codetwo">
 					<view class="codeList" v-for="(item,index) in info.codeList" :key="index">
 						<view class="codeList-bottom">{{item}}</view>
 					</view>
@@ -198,8 +198,8 @@
 		<view class="footer-fixed">
 			<view class="flex btn">
 				<button type="default" v-if="info.codeType == 1 && info.codeList.length < 1"
-					@click="exChangeCode">立即参与抽奖</button>
-				<button type="default" class="buttoncol" v-else>请在微信“码上快购”小程序分享助力</button>
+					@click="exChangeCodeH5">立即参与抽奖</button>
+				<button type="default" @click="toWeChatProgram" class="buttoncol" v-else>请在微信“码上快购”小程序分享助力</button>
 			</view>
 		</view>
 		<!-- #endif -->
@@ -389,6 +389,16 @@
 				})
 				this.exChange()
 			},
+			exChangeCodeH5() {
+				$http.post(`/api/v1/mp/user/marketing/generateCode/${this.id}`, {}).then(res => {
+					if (res.code == 0) {
+						this.getDetail()
+						setTimeout(() => {
+							uni.$u.toast('参与成功,您已获得1个抽奖码');
+						}, 500)
+					}
+				})
+			},
 			close() {
 				//弹出层收起
 				// this.popupShow = false
@@ -403,6 +413,11 @@
 					url: `/packageOperate/activity/wxofficial`
 				})
 			},
+			
+			//跳转微信小程序
+			toWeChatProgram() {
+				// location.href = 'weixin://dl/business/?t=xxxxxx'
+			},
 
 			getBaseInfo() {
 				$http.post('/api/v1/mp/user/getLoginUserinfo', {

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

@@ -529,48 +529,17 @@
 					})
 				} else if (item.refType && JSON.parse(item.refType).value === 'coin') {
 					uni.navigateTo({
-						url: `/packagePrize/goods/detail?id=424`
+						url: `/packagePrize/goods/index?id=424&boxId=${ this.ticketInfo.boxId }`
 					})
 				} else if (item.refType && JSON.parse(item.refType).value === 'coupon' || JSON.parse(item.refType)
 					.value === 'coupon_pkg') {
 					uni.navigateTo({
-						url: `/packagePrize/goods/detail?id=425`
+						url: `/packagePrize/goods/index?id=425&boxId=${ this.ticketInfo.boxId }`
 					})
 				}
 
 			},
 
-			// 点击奖品,跳转到奖品详情
-			toPrizeGoods(item) {
-				if (item.prizeType == "goods") {
-					uni.navigateTo({
-						url: `/packagePrize/goods/detail?id=${ item.refId }`
-					})
-				}
-				//门店优惠券
-				if (item.prizeType == "coupon") {
-					// if (item.couponType == "1") {
-					// 	uni.navigateTo({
-					// 		url: `/packagePrize/goods/detail?id=426`
-					// 	})
-					// }
-					// if (item.couponType == "2") {
-					// uni.navigateTo({
-					// 	url: `/packagePrize/goods/detail?id=425`
-					// })
-					// }
-					uni.navigateTo({
-						url: `/packagePrize/goods/detail?id=425`
-					})
-				}
-				// 盲豆
-				if (item.prizeType == "coin") {
-					uni.navigateTo({
-						url: `/packagePrize/goods/detail?id=424`
-					})
-				}
-			},
-
 			toActivity() {
 				uni.switchTab({
 					url: '/pages/activity/index'