123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <template>
- <!-- 回答正确弹窗 跳转 小程序-->
- <uni-popup ref="appPopup" type="center" :is-mask-click="false">
- <view class="appPopup-mask">
- <image class="tipimg" src="@/static/images/course_answer_img.png" mode="aspectFill"></image>
- <image class="close_icon" src="@/static/images/tc_close_icon.png" mode="aspectFill" @click="closePop"></image>
- <view class="appPopup-box">
- <view class="appPopup-title">恭喜你,<text style="color: #FF5C03;">回答正确</text></view>
- <view>百种好礼等你兑换</view>
- <view class="goodslist">
- <view class="goodsitem" v-for="(item,index) in products" :key="index">
- <image class="bg" src="/static/Subtract_bg100@2x.png" mode="widthFix"></image>
- <image class="img" :src="item.imageUrl" mode="aspectFill"></image>
- <view class="goodsitem-name textOne">{{item.productName}}</view>
- <view class="goodsitem-integral">
- <text class="goodsitem-integral-num">{{item.requiredPoints}}</text>
- <text>积分</text>
- </view>
- <view class="goodsitem-price">原价{{item.otPrice&&item.otPrice.toFixed(2)}}元</view>
- <wx-open-launch-weapp appid="wx20d588bebb30130f" :path="'pages_user/integralGoodsDetails?goodsId='+item.productId">
- <component :is="'script'" type="text/wxtag-template">
- <div class="goodsitem-mask"></div>
- </component>
- </wx-open-launch-weapp>
- </view>
- </view>
- <view class="changebtn" @click="getInfo">换一批</view>
- <view class="progress">
- <text>奖品兑换进度</text><text class="num">{{goodsInfo.exchangeProgress || 0}}%</text>
- <progress style="margin-top: 30rpx;" active-color="#FAA97F" backgroundColor="#F5F7FA" border-radius="12" :percent="goodsInfo.exchangeProgress" stroke-width="12"></progress>
- </view>
- <view class="my-integral">我的积分:<text>{{goodsInfo.currentPoints || 0}}</text> </view>
- <!-- <view class="launch-button" @click="closePop">{{goodsInfo.availableCoins}}积分已到账,去兑换</view> -->
- <wx-open-launch-weapp appid="wx20d588bebb30130f" path="pages_user/integralGoodsList" @launch="weappLaunch" @error="weappError">
- <component :is="'script'" type="text/wxtag-template">
- <div class="launch-button">{{goodsInfo.availableCoins}}积分已到账,去兑换</div>
- </component>
- </wx-open-launch-weapp>
- <!-- <view class="appPopup-tips">放弃积分,领取红包></view> -->
- </view>
- </view>
- </uni-popup>
- </template>
- <script>
- import { getCourseIntegralGoods } from "@/api/course.js"
- export default {
- data() {
- return {
- goodsInfo: {},
- products: []
- }
- },
- methods: {
- openPop() {
- this.$refs.appPopup.open("center")
- this.getInfo()
- },
- closePop() {
- this.$refs.appPopup.close()
- },
- //app礼品列表
- getInfo() {
- uni.showLoading({
- title: '加载中'
- })
- getCourseIntegralGoods().then(res=>{
- uni.hideLoading()
- if(res.code == 200) {
- this.goodsInfo = res.data
- this.products = res.data && res.data.products? res.data.products:[]
- } else {
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- }
- }).catch(()=>{
- uni.hideLoading()
- })
- },
- handleItem(item,index) {
- uni.navigateToMiniProgram({
- appId: 'wx20d588bebb30130f',
- path: 'pages_user/integralGoodsDetails',
- extraData: {
- 'goodsId': item.productId
- },
- success(res) {
- // 打开成功
- }
- })
- },
- weappLaunch() {
- this.$refs.appPopup.close()
- },
- weappError(e) {
- console.log('fail', e.detail);
- }
- }
- }
- </script>
- <style>
- .launch-button {
- width: 560rpx;
- height: 84rpx;
- margin: 0 auto;
- background: #FF5C03;
- border-radius: 42rpx 42rpx 42rpx 42rpx;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #FFFFFF;
- }
- .goodsitem-mask {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- }
- </style>
- <style scoped lang="scss">
- @mixin u-flex($flexD, $alignI, $justifyC) {
- display: flex;
- flex-direction: $flexD;
- align-items: $alignI;
- justify-content: $justifyC;
- }
- .textOne {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .num {
- margin-left: 12rpx;
- font-family: DINPro, DINPro;
- font-size: 40rpx;
- }
- .appPopup-mask {
- margin-top: -88rpx;
- width: 670rpx;
- @include u-flex(column, center, center);
- .tipimg {
- height: 206rpx;
- width: 206rpx;
- }
- .close_icon {
- height: 48rpx;
- width: 48rpx;
- position: absolute;
- top: 34rpx;
- right: 20rpx;
- }
- .appPopup-box {
- width: 670rpx;
- padding-bottom: 32rpx;
- background: linear-gradient( 180deg, #FFEBBD 0%, #FFFFFF 9%, #FFFFFF 100%);
- border-radius: 32rpx 32rpx 32rpx 32rpx;
- overflow: hidden;
- margin-top: -103rpx;
- padding-top: 103rpx;
- box-sizing: border-box;
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #757575;
- text-align: center;
- }
- .appPopup-title {
- margin-bottom: 10rpx;
- font-family: PingFang SC;
- font-weight: 600;
- font-size: 40rpx;
- color: #222222;
- }
- }
- .goodslist {
- margin-top: 58rpx;
- padding: 24rpx 10rpx;
- @include u-flex(row, center, space-evenly);
- }
- .bg {
- width: 100%;
- height: 100%;
- position: absolute;
- bottom: 0;
- left: 0;
- z-index: -1;
- }
- .goodsitem {
- flex: 1;
- max-width: 200rpx;
- min-height: 124rpx;
- border-radius: 10rpx;
- @include u-flex(column, center, flex-start);
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 22rpx;
- color: #999999;
- position: relative;
- z-index: 2;
- .img {
- width: 153rpx;
- height: 126rpx;
- margin-top: -44rpx;
- border-radius: 10rpx;
- }
- &-name {
- width: 100%;
- padding: 8rpx 14rpx;
- text-align: center;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 24rpx;
- color: #222222;
- box-sizing: border-box;
- word-break: break-all;
- }
- &-integral {
- min-width: 80%;
- padding-bottom: 16rpx;
- box-sizing: border-box;
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 22rpx;
- color: #FF5C03;
- border-bottom: 2px #999999 dotted;
- &-num {
- font-family: DINPro, DINPro;
- font-weight: 500;
- font-size: 36rpx;
- }
- }
- &-price {
- padding: 10rpx 0;
- }
- }
- .changebtn {
- width: 152rpx;
- height: 64rpx;
- margin: 0 auto;
- border-radius: 32rpx 32rpx 32rpx 32rpx;
- border: 1rpx solid #FF5C03;
- @include u-flex(row, center, center);
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #FF5C03;
- }
- .progress {
- padding: 0 90rpx;
- margin-top: 40rpx;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #222222;
- }
- ::v-deep {
- .uni-progress-bar, .uni-progress-inner-bar {
- border-radius: 6px;
- }
- }
- .my-integral {
- margin: 32rpx 0;
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #222222;
- text {
- color: #FF5C03;
- }
- }
- .appPopup-tips {
- margin-top: 32rpx;
- }
- </style>
|