chore(组件): 全部使用easycom来处理组件问题
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
<view class="goods-media">
|
||||
<!-- #ifdef H5 -->
|
||||
<cover-view class="share">
|
||||
<view class="share_left"><text class="iconfont icon-back_light" @click="$util.goBack()"></text></view>
|
||||
<view class="share_left"><text class="iconfont icon-back_light" @click="$util.goBack()"></text>
|
||||
</view>
|
||||
</cover-view>
|
||||
<!-- #endif -->
|
||||
|
||||
@@ -13,12 +14,21 @@
|
||||
<swiper class="swiper">
|
||||
<swiper-item :item-id="'goods_id_' + pointInfo.type">
|
||||
<view class="item" v-if="pointInfo.type == 2">
|
||||
<image class="adv-pic" :src="pointInfo.image ? $util.img(pointInfo.image) : $util.img('public/uniapp/point/coupon.png')" @error="imageError($util.img('public/uniapp/point/coupon.png'))" mode="aspectFit"/>
|
||||
<image class="adv-pic"
|
||||
:src="pointInfo.image ? $util.img(pointInfo.image) : $util.img('public/uniapp/point/coupon.png')"
|
||||
@error="imageError($util.img('public/uniapp/point/coupon.png'))"
|
||||
mode="aspectFit" />
|
||||
</view>
|
||||
<view class="item" v-else-if="pointInfo.type == 3">
|
||||
<image class="adv-pic" :src="pointInfo.image ? $util.img(pointInfo.image) : $util.img('public/uniapp/point/hongbao.png')" @error="imageError($util.img('public/uniapp/point/hongbao.png'))" mode="aspectFit"/>
|
||||
<image class="adv-pic"
|
||||
:src="pointInfo.image ? $util.img(pointInfo.image) : $util.img('public/uniapp/point/hongbao.png')"
|
||||
@error="imageError($util.img('public/uniapp/point/hongbao.png'))"
|
||||
mode="aspectFit" />
|
||||
</view>
|
||||
<view class="item" v-else>
|
||||
<image class="adv-pic" :src="$util.img(pointInfo.image)" @error="imageError()"
|
||||
mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="item" v-else><image class="adv-pic" :src="$util.img(pointInfo.image)" @error="imageError()" mode="aspectFit"></image></view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -27,7 +37,8 @@
|
||||
<view class="goods-module-wrap">
|
||||
<text class="price-symbol ">{{ pointInfo.point }}积分</text>
|
||||
<template v-if="pointInfo.exchange_price != '0.00' && pointInfo.pay_type > 0">
|
||||
<text class="price-symbol ">+{{ $lang('common.currencySymbol') }}{{ pointInfo.exchange_price }}</text>
|
||||
<text class="price-symbol ">+{{ $lang('common.currencySymbol') }}{{ pointInfo.exchange_price
|
||||
}}</text>
|
||||
</template>
|
||||
|
||||
<view class="market-price-wrap" v-if="pointInfo.price">
|
||||
@@ -35,26 +46,36 @@
|
||||
<text class="money">{{ pointInfo.price }}</text>
|
||||
</view>
|
||||
|
||||
<view class="follow-and-share" v-if="pointInfo.stock_show == 1 || pointInfo.stock_show == undefined">
|
||||
<text class="color-tip" v-if="pointInfo.pointCoupon != 1">库存:{{ pointInfo.stock }}{{ pointInfo.stock >= 0 ? pointInfo.unit : '' }}</text>
|
||||
<view class="follow-and-share"
|
||||
v-if="pointInfo.stock_show == 1 || pointInfo.stock_show == undefined">
|
||||
<text class="color-tip" v-if="pointInfo.pointCoupon != 1">库存:{{ pointInfo.stock }}{{
|
||||
pointInfo.stock >= 0 ?
|
||||
pointInfo.unit : '' }}</text>
|
||||
<text class="color-tip" v-else>库存:无限{{ pointInfo.stock >= 0 ? pointInfo.unit : '' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-module-wrap info">
|
||||
<text class="sku-name-wrap" v-if="pointInfo.type == 1">{{ isEnEnv ? pointInfo.en_goods_name : pointInfo.goods_name }}</text>
|
||||
<text class="sku-name-wrap" v-if="pointInfo.type == 1">{{ isEnEnv ? pointInfo.en_goods_name :
|
||||
pointInfo.goods_name
|
||||
}}</text>
|
||||
<text class="sku-name-wrap" v-else>{{ pointInfo.name }}</text>
|
||||
</view>
|
||||
<view class="coupon-desc">
|
||||
<view v-if="pointInfo.balance && pointInfo.balance > 0" class="color-tip">内含{{ pointInfo.balance }}元</view>
|
||||
<view v-if="pointInfo.balance && pointInfo.balance > 0" class="color-tip">内含{{ pointInfo.balance
|
||||
}}元</view>
|
||||
<view v-if="pointInfo.coupon_type == 'random'" class="color-tip">无门槛优惠券</view>
|
||||
<view v-if="pointInfo.coupon_type == 'reward'" class="color-tip">{{ '满' + pointInfo.at_least + '减' + pointInfo.money }}</view>
|
||||
<view v-if="pointInfo.coupon_type == 'reward'" class="color-tip">{{ '满' + pointInfo.at_least +
|
||||
'减' + pointInfo.money
|
||||
}}</view>
|
||||
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">
|
||||
满{{ pointInfo.at_least }}元
|
||||
<text>{{ pointInfo.discount }}折</text>
|
||||
</view>
|
||||
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">最多优惠{{ pointInfo.discount_limit }}元</view>
|
||||
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">最多优惠{{
|
||||
pointInfo.discount_limit }}元</view>
|
||||
<view class="time color-tip" v-if="pointInfo.coupon_type">
|
||||
{{ pointInfo.validity_type == 1 ? '领取之日起' + pointInfo.fixed_term + '天内有效' : $util.timeStampTurnTime(pointInfo.end_time) + '到期' }}
|
||||
{{ pointInfo.validity_type == 1 ? '领取之日起' + pointInfo.fixed_term + '天内有效' :
|
||||
$util.timeStampTurnTime(pointInfo.end_time) + '到期' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -71,22 +92,23 @@
|
||||
</view>
|
||||
|
||||
<!-- 促销 -->
|
||||
<view class="community-model" @touchmove.prevent.stop @click.stop="onCloseCommunity()" v-show="isCommunity">
|
||||
<view class="community-model" @touchmove.prevent.stop @click.stop="onCloseCommunity()"
|
||||
v-show="isCommunity">
|
||||
<view class="community-model-content" @click.stop>
|
||||
<view class="community-model-content-radius"><view>添加社群</view></view>
|
||||
<view class="community-model-content-radius">
|
||||
<view>添加社群</view>
|
||||
</view>
|
||||
<view class="community-model-content-draw" v-if="pointInfo.qr_data && pointInfo.qr_data.qr_img">
|
||||
<image
|
||||
:src="
|
||||
pointInfo.qr_data.qr_img != '' && pointInfo.qr_data.qr_state == 1
|
||||
? $util.img(pointInfo.qr_data.qr_img)
|
||||
: $util.img('public/uniapp/goods/detail_erweiImage.png')
|
||||
"
|
||||
mode="aspectFill"
|
||||
show-menu-by-longpress="true"/>
|
||||
<image :src="pointInfo.qr_data.qr_img != '' && pointInfo.qr_data.qr_state == 1
|
||||
? $util.img(pointInfo.qr_data.qr_img)
|
||||
: $util.img('public/uniapp/goods/detail_erweiImage.png')
|
||||
" mode="aspectFill" show-menu-by-longpress="true" />
|
||||
</view>
|
||||
<view class="community-model-content-text">长按识别二维码,添加社群</view>
|
||||
</view>
|
||||
<view class="community-model-close" @click.stop="onCloseCommunity()"><text class="iconfont icon-close"></text></view>
|
||||
<view class="community-model-close" @click.stop="onCloseCommunity()"><text
|
||||
class="iconfont icon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 添加二维码 end -->
|
||||
<block v-if="pointInfo.type == 1">
|
||||
@@ -95,15 +117,20 @@
|
||||
<view class="item selected-sku-spec" v-if="pointInfo.sku_spec_format" @click="exchange">
|
||||
<view class="label">选择</view>
|
||||
<view class="box">
|
||||
<text v-for="(item, index) in pointInfo.sku_spec_format" :key="index">{{ item.spec_name }}/{{ item.spec_value_name }}</text>
|
||||
<text v-for="(item, index) in pointInfo.sku_spec_format" :key="index">{{ item.spec_name
|
||||
}}/{{
|
||||
item.spec_value_name }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
|
||||
<view class="item goods-attribute" @click="openAttributePopup()" v-if="pointInfo.goods_attr_format && pointInfo.goods_attr_format.length > 0">
|
||||
<view class="item goods-attribute" @click="openAttributePopup()"
|
||||
v-if="pointInfo.goods_attr_format && pointInfo.goods_attr_format.length > 0">
|
||||
<view class="label">属性</view>
|
||||
<view class="box">
|
||||
<text v-for="(item, index) in pointInfo.goods_attr_format" :key="index" v-if="index < 2">{{ item.attr_name }}: {{ item.attr_value_name }}</text>
|
||||
<text v-for="(item, index) in pointInfo.goods_attr_format" :key="index"
|
||||
v-if="index < 2">{{
|
||||
item.attr_name }}: {{ item.attr_value_name }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
@@ -118,12 +145,14 @@
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y class="goods-attribute-body">
|
||||
<view class="item" v-for="(item, index) in pointInfo.goods_attr_format" :key="index">
|
||||
<view class="item" v-for="(item, index) in pointInfo.goods_attr_format"
|
||||
:key="index">
|
||||
<text class="attr-name">{{ item.attr_name }}</text>
|
||||
<text class="value-name">{{ item.attr_value_name }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="button-box"><button type="primary" @click="closeAttributePopup()">确定</button></view>
|
||||
<view class="button-box"><button type="primary"
|
||||
@click="closeAttributePopup()">确定</button></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
@@ -136,7 +165,8 @@
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view scroll-y>
|
||||
<view class="item" :class="{ 'empty-desc': !item.desc }" v-for="(item, index) in pointInfo.goods_service" :key="index">
|
||||
<view class="item" :class="{ 'empty-desc': !item.desc }"
|
||||
v-for="(item, index) in pointInfo.goods_service" :key="index">
|
||||
<view class="iconfont icon-dui "></view>
|
||||
<view class="info-wrap">
|
||||
<text class="title">{{ item.service_name }}</text>
|
||||
@@ -144,7 +174,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="button-box"><button type="primary" @click="closeMerchantsServicePopup()">确定</button></view>
|
||||
<view class="button-box"><button type="primary"
|
||||
@click="closeMerchantsServicePopup()">确定</button></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
@@ -152,41 +183,42 @@
|
||||
|
||||
<!-- 详情 -->
|
||||
<view class="goods-detail-tab">
|
||||
<view class="detail-tab"><view class="tab-item">兑换详情</view></view>
|
||||
<view class="detail-tab">
|
||||
<view class="tab-item">兑换详情</view>
|
||||
</view>
|
||||
|
||||
<view class="detail-content">
|
||||
<view class="detail-content-item">
|
||||
<view class="goods-details" v-if="pointInfo.content"><rich-text :nodes="pointInfo.content"></rich-text></view>
|
||||
<view class="goods-details" v-if="pointInfo.content"><rich-text
|
||||
:nodes="pointInfo.content"></rich-text>
|
||||
</view>
|
||||
<view class="goods-details active" v-else>暂无兑换详情!</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- SKU选择 -->
|
||||
<ns-goods-sku
|
||||
v-if="pointInfo.id"
|
||||
ref="goodsSku"
|
||||
@refresh="refreshGoodsSkuDetail"
|
||||
:goods-detail="pointInfo"
|
||||
:goods-id="pointInfo.goods_id"
|
||||
:max-buy="pointInfo.max_buy"
|
||||
:min-buy="pointInfo.min_buy"
|
||||
source="point"
|
||||
></ns-goods-sku>
|
||||
<ns-goods-sku v-if="pointInfo.id" ref="goodsSku" @refresh="refreshGoodsSkuDetail"
|
||||
:goods-detail="pointInfo" :goods-id="pointInfo.goods_id" :max-buy="pointInfo.max_buy"
|
||||
:min-buy="pointInfo.min_buy" source="point"></ns-goods-sku>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-if="!isLogin"><button type="primary" >登录之后方可兑换</button></view>
|
||||
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-if="!isLogin"><button
|
||||
type="primary">登录之后方可兑换</button></view>
|
||||
<block v-else>
|
||||
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-if="pointInfo.stock == 0"><button disabled>库存不足</button></view>
|
||||
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-else-if="enough"><button disabled>积分不足</button></view>
|
||||
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-else><button type="primary" hover-class="none">兑换</button></view>
|
||||
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-if="pointInfo.stock == 0"><button
|
||||
disabled>库存不足</button></view>
|
||||
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-else-if="enough"><button
|
||||
disabled>积分不足</button></view>
|
||||
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-else><button
|
||||
type="primary" hover-class="none">兑换</button></view>
|
||||
</block>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
|
||||
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
@@ -195,19 +227,10 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
|
||||
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
import nsGoodsSku from '@/components/ns-goods-sku/ns-goods-sku.vue';
|
||||
import toTop from '@/components/toTop/toTop.vue';
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
export default {
|
||||
components: {
|
||||
uniPopup,
|
||||
uniNumberBox,
|
||||
nsGoodsSku,
|
||||
toTop
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
@@ -280,8 +303,8 @@ export default {
|
||||
title: title,
|
||||
path: path,
|
||||
imageUrl: imageUrl,
|
||||
success: res => {},
|
||||
fail: res => {}
|
||||
success: res => { },
|
||||
fail: res => { }
|
||||
};
|
||||
},
|
||||
|
||||
@@ -318,7 +341,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.isLogin = true;
|
||||
this.getPointInfo();
|
||||
@@ -470,9 +493,11 @@ export default {
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/common/css/goods_detail.scss';
|
||||
|
||||
.group-wrap .goods-module-wrap.info {
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.group-wrap {
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
@@ -492,6 +517,7 @@ export default {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
&[type='primary'] {
|
||||
background-color: var(--goods-btn-color);
|
||||
}
|
||||
|
||||
@@ -116,21 +116,13 @@
|
||||
|
||||
<script>
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
import uniDrawer from '@/components/uni-drawer/uni-drawer.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniDrawer,
|
||||
MescrollUni,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
nsEmpty,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
// #endif
|
||||
|
||||
@@ -2,16 +2,19 @@
|
||||
<view class="conteiner" :style="themeColor">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="point-navbar"
|
||||
:style="{'padding-top': menuButtonBounding.top + 'px', height: menuButtonBounding.height + 'px' }">
|
||||
<view class="nav-wrap" :style="{width: menuButtonBounding.left + 'px'}">
|
||||
<view class="back" @click="back" :style="{width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }">
|
||||
:style="{ 'padding-top': menuButtonBounding.top + 'px', height: menuButtonBounding.height + 'px' }">
|
||||
<view class="nav-wrap" :style="{ width: menuButtonBounding.left + 'px' }">
|
||||
<view class="back" @click="back"
|
||||
:style="{ width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }">
|
||||
<text class="iconfont icon-back_light"></text>
|
||||
</view>
|
||||
<view class="search" @click="$util.redirectTo('/pages_tool/goods/search')">
|
||||
<text class="iconfont icon-sousuo3"></text>
|
||||
<text class="tips">搜索商品</text>
|
||||
</view>
|
||||
<view class="sign" :style="{width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }" @click="redirect('/pages_tool/member/signin')">
|
||||
<view class="sign"
|
||||
:style="{ width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }"
|
||||
@click="redirect('/pages_tool/member/signin')">
|
||||
<image :src="$util.img('public/uniapp/point/navbar-sing-icon.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
@@ -20,7 +23,7 @@
|
||||
<!-- #endif -->
|
||||
|
||||
<scroll-view scroll-y="true" class="point-scroll-view" @scrolltolower="getData">
|
||||
<view class="point-wrap" :style="{'background-position-y': -menuButtonBounding.bottom + 'px'}">
|
||||
<view class="point-wrap" :style="{ 'background-position-y': -menuButtonBounding.bottom + 'px' }">
|
||||
<view class="head-box">
|
||||
<view class="account-content">
|
||||
<view class="left">
|
||||
@@ -28,9 +31,9 @@
|
||||
<view>我的积分</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text class="point price-font">{{point}}</text>
|
||||
<text class="point price-font">{{ point }}</text>
|
||||
<text class="text">积分</text>
|
||||
<!-- <text class="iconfont icon-right"></text> -->
|
||||
<!-- <text class="iconfont icon-right"></text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="remark">
|
||||
@@ -39,7 +42,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="menu-wrap">
|
||||
<!-- <view class="menu-wrap">
|
||||
<view class="menu-list">
|
||||
<view class="menu-item" @click="openPointPopup()">
|
||||
<image :src="$util.img('/public/uniapp/point/point-rule.png')" class="menu-img"></image>
|
||||
@@ -65,7 +68,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!--
|
||||
<!--
|
||||
<view class="poster-wrap">
|
||||
<view class="poster-item" @click="redirect('/pages_tool/recharge/list')">
|
||||
<image :src="$util.img('/public/uniapp/point/recharge-poster.png')" mode="widthFix"></image>
|
||||
@@ -75,7 +78,8 @@
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="recharge-list-wrap" @click="redirect('/pages_tool/recharge/list')" v-if="rechargeList.length">
|
||||
<view class="recharge-list-wrap" @click="redirect('/pages_tool/recharge/list')"
|
||||
v-if="rechargeList.length">
|
||||
<view class="item-wrap" v-for="(item, index) in rechargeList.slice(0, 4)" :key="index">
|
||||
<view class="recharge">储值{{ parseFloat(item.buy_price) }}元</view>
|
||||
<view class="point">可得{{ item.point }}积分</view>
|
||||
@@ -92,10 +96,13 @@
|
||||
</view>
|
||||
|
||||
<view class="list-wrap">
|
||||
<view class="list-wrap-scroll" :class="{'single-row': couponList.length < 3}">
|
||||
<view class="list-wrap-item coupon-list-wrap-item" v-for="(couponItem, couponIndex) in couponList" :key="couponIndex" @click="toDetail(couponItem)">
|
||||
<view class="list-wrap-scroll" :class="{ 'single-row': couponList.length < 3 }">
|
||||
<view class="list-wrap-item coupon-list-wrap-item"
|
||||
v-for="(couponItem, couponIndex) in couponList" :key="couponIndex"
|
||||
@click="toDetail(couponItem)">
|
||||
<view class="img-box">
|
||||
<image :src="$util.img('public/uniapp/point/coupon_' + themeStyle.name + '_bg1.png')"/>
|
||||
<image
|
||||
:src="$util.img('public/uniapp/point/coupon_' + themeStyle.name + '_bg1.png')" />
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="coupon"
|
||||
@@ -114,10 +121,14 @@
|
||||
</view>
|
||||
<view class="coupon-info">
|
||||
<view class="coupon_condition font-size-activity-tag">
|
||||
{{ couponItem.at_least == 0 ? '无门槛优惠券' : '满' + parseFloat(couponItem.at_least).toFixed(0) + '可用' }}
|
||||
{{ couponItem.at_least == 0 ? '无门槛优惠券' : '满' +
|
||||
parseFloat(couponItem.at_least).toFixed(0) + '可用' }}
|
||||
</view>
|
||||
<view class="coupon_type font-size-activity-tag" v-if="couponItem.goods_type == 1">全场券</view>
|
||||
<view class="coupon_type font-size-activity-tag" v-else-if="couponItem.goods_type == 2||couponItem.goods_type == 3">指定券</view>
|
||||
<view class="coupon_type font-size-activity-tag"
|
||||
v-if="couponItem.goods_type == 1">全场券</view>
|
||||
<view class="coupon_type font-size-activity-tag"
|
||||
v-else-if="couponItem.goods_type == 2 || couponItem.goods_type == 3">
|
||||
指定券</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coupon_right">
|
||||
@@ -139,7 +150,9 @@
|
||||
</view>
|
||||
|
||||
<view class="list-wrap">
|
||||
<view class="list-wrap-item hongbao-list-wrap-item" v-for="(hongbaoItem, hongbaoIndex) in hongbaoList" :key="hongbaoIndex" @click="toDetail(hongbaoItem)">
|
||||
<view class="list-wrap-item hongbao-list-wrap-item"
|
||||
v-for="(hongbaoItem, hongbaoIndex) in hongbaoList" :key="hongbaoIndex"
|
||||
@click="toDetail(hongbaoItem)">
|
||||
<view class="img-box">
|
||||
<image :src="$util.img('public/uniapp/point/hongbao_bg.png')"></image>
|
||||
</view>
|
||||
@@ -188,17 +201,19 @@
|
||||
<block v-if="item.price > 0 && item.pay_type > 0">
|
||||
<text class="unit font-size-tag">+</text>
|
||||
<view>
|
||||
<text class="font-size-tag">{{ parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
|
||||
<text class="unit font-size-tag">.{{ parseFloat(item.price).toFixed(2).split(".")[1] }}元</text>
|
||||
<text class="font-size-tag">{{
|
||||
parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
|
||||
<text class="unit font-size-tag">.{{
|
||||
parseFloat(item.price).toFixed(2).split(".")[1] }}元</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="btn" @click="toDetail(item)">兑换</view>
|
||||
</view>
|
||||
<view class="pro-info" v-if="item.stock_show || item.sale_show ">
|
||||
<view class="font-size-activity-tag color-tip" v-if="item.stock_show ">
|
||||
<view class="pro-info" v-if="item.stock_show || item.sale_show">
|
||||
<view class="font-size-activity-tag color-tip" v-if="item.stock_show">
|
||||
库存:{{ isNaN(parseInt(item.stock)) ? 0 : parseInt(item.stock) }}</view>
|
||||
<view class="font-size-activity-tag color-tip sale" v-if="item.sale_show ">
|
||||
<view class="font-size-activity-tag color-tip sale" v-if="item.sale_show">
|
||||
已兑:{{ isNaN(parseInt(item.sale_num)) ? 0 : parseInt(item.sale_num) }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -216,19 +231,19 @@
|
||||
<uni-popup ref="pointPopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closePointPopup()">
|
||||
<view class="title">{{ isEnEnv ? 'Integral Description' : '积分说明'}}</view>
|
||||
<view class="title">{{ isEnEnv ? 'Integral Description' : '积分说明' }}</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">
|
||||
<view class="tip">{{ isEnEnv ? 'Integral Acquisition' : '积分的获取'}}</view>
|
||||
<view class="tip">{{ isEnEnv ? 'Integral Acquisition' : '积分的获取' }}</view>
|
||||
<view class="font-size-base">1、积分可在注册、签到、分享、消费、充值时获得。</view>
|
||||
<view class="font-size-base">2、在购买部分商品时可获得积分。</view>
|
||||
<view class="tip">{{ isEnEnv ? 'Integral Use' : '积分的使用'}}</view>
|
||||
<view class="tip">{{ isEnEnv ? 'Integral Use' : '积分的使用' }}</view>
|
||||
<view class="font-size-base">1、积分可用于兑换积分中心的商品。</view>
|
||||
<view class="font-size-base">2、积分可在参与某些活动时使用。</view>
|
||||
<view class="font-size-base">3、积分不得转让,出售,不设有效期。</view>
|
||||
<view class="tip">{{ isEnEnv ? 'Integral Query' : '积分的查询'}}</view>
|
||||
<view class="tip">{{ isEnEnv ? 'Integral Query' : '积分的查询' }}</view>
|
||||
<view class="font-size-base">1、积分可在会员中心中查询具体数额以及明细。</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -245,349 +260,345 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
export default {
|
||||
components: {
|
||||
uniPopup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mescroll: {
|
||||
num: 0,
|
||||
total: 1,
|
||||
loading: false
|
||||
},
|
||||
categoryList: [{
|
||||
id: 1,
|
||||
name: '积分换好物'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '积分换券'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '积分换红包'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mescroll: {
|
||||
num: 0,
|
||||
total: 1,
|
||||
loading: false
|
||||
},
|
||||
categoryList: [{
|
||||
id: 1,
|
||||
name: '积分换好物'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '积分换券'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: '积分换红包'
|
||||
}
|
||||
],
|
||||
isLogin: false,
|
||||
goodsList: [],
|
||||
couponList: [],
|
||||
hongbaoList: [],
|
||||
point: 0,
|
||||
signState: 1, // 签到是否开启
|
||||
mpShareData: null, //小程序分享数据
|
||||
menuButtonBounding: {
|
||||
bottom: 0
|
||||
},
|
||||
rechargeList: [], //充值套餐
|
||||
newestGame: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.pointexchange) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启积分商城',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
//小程序分享接收source_member
|
||||
if (option.source_member) {
|
||||
uni.setStorageSync('source_member', option.source_member);
|
||||
}
|
||||
// 小程序扫码进入,接收source_member
|
||||
if (option.scene) {
|
||||
var sceneParams = decodeURIComponent(option.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
|
||||
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
|
||||
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
this.getData();
|
||||
this.getRechargeList();
|
||||
this.getNewestGame();
|
||||
},
|
||||
onShow() {
|
||||
//记录分享关系
|
||||
if (this.storeToken && uni.getStorageSync('source_member')) {
|
||||
this.$util.onSourceMember(uni.getStorageSync('source_member'));
|
||||
}
|
||||
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare().then(res => {
|
||||
this.mpShareData = res;
|
||||
});
|
||||
// #endif
|
||||
|
||||
if (this.storeToken) this.getAccountInfo();
|
||||
this.getCouponList();
|
||||
this.getHongbaoList();
|
||||
// this.getSignState();
|
||||
},
|
||||
methods: {
|
||||
// 签到是否开启
|
||||
getSignState() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/getSignStatus',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signState = res.data.is_use;
|
||||
}
|
||||
],
|
||||
isLogin: false,
|
||||
goodsList: [],
|
||||
couponList: [],
|
||||
hongbaoList: [],
|
||||
point: 0,
|
||||
signState: 1, // 签到是否开启
|
||||
mpShareData: null, //小程序分享数据
|
||||
menuButtonBounding: {
|
||||
bottom: 0
|
||||
},
|
||||
rechargeList: [], //充值套餐
|
||||
newestGame: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.pointexchange) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启积分商城',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
//小程序分享接收source_member
|
||||
if (option.source_member) {
|
||||
uni.setStorageSync('source_member', option.source_member);
|
||||
}
|
||||
// 小程序扫码进入,接收source_member
|
||||
if (option.scene) {
|
||||
var sceneParams = decodeURIComponent(option.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
|
||||
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
|
||||
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
this.getData();
|
||||
this.getRechargeList();
|
||||
this.getNewestGame();
|
||||
},
|
||||
onShow() {
|
||||
//记录分享关系
|
||||
if (this.storeToken && uni.getStorageSync('source_member')) {
|
||||
this.$util.onSourceMember(uni.getStorageSync('source_member'));
|
||||
}
|
||||
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare().then(res => {
|
||||
this.mpShareData = res;
|
||||
});
|
||||
// #endif
|
||||
|
||||
if (this.storeToken) this.getAccountInfo();
|
||||
this.getCouponList();
|
||||
this.getHongbaoList();
|
||||
// this.getSignState();
|
||||
},
|
||||
methods: {
|
||||
// 签到是否开启
|
||||
getSignState() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/getSignStatus',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signState = res.data.is_use;
|
||||
}
|
||||
jumpPage(url) {
|
||||
this.$util.redirectTo(url);
|
||||
},
|
||||
// 打开积分说明弹出层
|
||||
openPointPopup() {
|
||||
this.$refs.pointPopup.open();
|
||||
},
|
||||
// 打开积分说明弹出层
|
||||
closePointPopup() {
|
||||
this.$refs.pointPopup.close();
|
||||
},
|
||||
// 优惠券
|
||||
getCouponList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/goods/page',
|
||||
data: {
|
||||
page_size: 0,
|
||||
type: 2
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.couponList = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
jumpPage(url) {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
//联网失败的回调
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 红包
|
||||
getHongbaoList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/goods/page',
|
||||
data: {
|
||||
page_size: 0,
|
||||
type: 3
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.hongbaoList = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
//联网失败的回调
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取积分商品详情
|
||||
getData() {
|
||||
if (this.mescroll.loading || this.mescroll.num >= this.mescroll.total) return;
|
||||
this.mescroll.loading = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/goods/page',
|
||||
data: {
|
||||
page: this.mescroll.num + 1,
|
||||
page_size: 10,
|
||||
type: 1
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
//设置列表数据
|
||||
this.mescroll.loading = false;
|
||||
this.mescroll.total = res.data.page_count;
|
||||
this.mescroll.num += 1;
|
||||
if (this.mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
this.mescroll.loading = false;
|
||||
//联网失败的回调
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//跳转至详情页面
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages_promotion/point/detail', {
|
||||
id: item.id
|
||||
});
|
||||
},
|
||||
goGoodsList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/goods_list');
|
||||
},
|
||||
//获取个人
|
||||
getAccountInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/info',
|
||||
data: {
|
||||
account_type: 'point'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
if (!isNaN(parseFloat(res.data.point))) {
|
||||
this.point = parseFloat(res.data.point).toFixed(0);
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//跳转至登录页面
|
||||
login() {
|
||||
this.$refs.login.open('/pages_promotion/point/list');
|
||||
},
|
||||
imgError(index) {
|
||||
this.goodsList[index].image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
goodsImg(data) {
|
||||
let img = '';
|
||||
switch (data.type) {
|
||||
case 1:
|
||||
img = this.$util.img(data.image.split(',')[0], {
|
||||
size: 'mid'
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
img = data.image ? this.$util.img(data.image) : this.$util.img(
|
||||
'public/uniapp/point/coupon.png');
|
||||
break;
|
||||
case 3:
|
||||
img = data.image ? this.$util.img(data.image) : this.$util.img(
|
||||
'public/uniapp/point/hongbao.png');
|
||||
break;
|
||||
}
|
||||
return img;
|
||||
},
|
||||
/**
|
||||
* 跳转
|
||||
* @param {Object} url
|
||||
*/
|
||||
redirect(url) {
|
||||
if (!this.storeToken) {
|
||||
this.$refs.login.open(url);
|
||||
} else {
|
||||
this.$util.redirectTo(url);
|
||||
},
|
||||
// 打开积分说明弹出层
|
||||
openPointPopup() {
|
||||
this.$refs.pointPopup.open();
|
||||
},
|
||||
// 打开积分说明弹出层
|
||||
closePointPopup() {
|
||||
this.$refs.pointPopup.close();
|
||||
},
|
||||
// 优惠券
|
||||
getCouponList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/goods/page',
|
||||
data: {
|
||||
page_size: 0,
|
||||
type: 2
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.couponList = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
//联网失败的回调
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
},
|
||||
getRechargeList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/memberrecharge/page',
|
||||
data: {
|
||||
page_size: 100,
|
||||
page: 1
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
let rechargeList = [];
|
||||
res.data.list.forEach(item => {
|
||||
if (item.point > 0) rechargeList.push(item)
|
||||
});
|
||||
this.rechargeList = rechargeList;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 红包
|
||||
getHongbaoList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/goods/page',
|
||||
data: {
|
||||
page_size: 0,
|
||||
type: 3
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.hongbaoList = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
//联网失败的回调
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取积分商品详情
|
||||
getData() {
|
||||
if (this.mescroll.loading || this.mescroll.num >= this.mescroll.total) return;
|
||||
this.mescroll.loading = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/goods/page',
|
||||
data: {
|
||||
page: this.mescroll.num + 1,
|
||||
page_size: 10,
|
||||
type: 1
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
//设置列表数据
|
||||
this.mescroll.loading = false;
|
||||
this.mescroll.total = res.data.page_count;
|
||||
this.mescroll.num += 1;
|
||||
if (this.mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
this.mescroll.loading = false;
|
||||
//联网失败的回调
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//跳转至详情页面
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages_promotion/point/detail', {
|
||||
id: item.id
|
||||
});
|
||||
},
|
||||
goGoodsList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/goods_list');
|
||||
},
|
||||
//获取个人
|
||||
getAccountInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/info',
|
||||
data: {
|
||||
account_type: 'point'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
if (!isNaN(parseFloat(res.data.point))) {
|
||||
this.point = parseFloat(res.data.point).toFixed(0);
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//跳转至登录页面
|
||||
login() {
|
||||
this.$refs.login.open('/pages_promotion/point/list');
|
||||
},
|
||||
imgError(index) {
|
||||
this.goodsList[index].image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
goodsImg(data) {
|
||||
let img = '';
|
||||
switch (data.type) {
|
||||
case 1:
|
||||
img = this.$util.img(data.image.split(',')[0], {
|
||||
size: 'mid'
|
||||
}
|
||||
})
|
||||
},
|
||||
back() {
|
||||
if (getCurrentPages().length > 1) uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
else this.$util.redirectTo('/pages/index/index');
|
||||
},
|
||||
getNewestGame() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/game/newestgame',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) this.newestGame = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
luckdraw() {
|
||||
if (this.newestGame) {
|
||||
switch (this.newestGame.game_type) {
|
||||
case 'cards':
|
||||
this.$util.redirectTo('/pages_promotion/game/cards', {
|
||||
id: this.newestGame.game_id
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
img = data.image ? this.$util.img(data.image) : this.$util.img(
|
||||
'public/uniapp/point/coupon.png');
|
||||
case 'egg':
|
||||
this.$util.redirectTo('/pages_promotion/game/smash_eggs', {
|
||||
id: this.newestGame.game_id
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
img = data.image ? this.$util.img(data.image) : this.$util.img(
|
||||
'public/uniapp/point/hongbao.png');
|
||||
case 'turntable':
|
||||
this.$util.redirectTo('/pages_promotion/game/turntable', {
|
||||
id: this.newestGame.game_id
|
||||
});
|
||||
break;
|
||||
}
|
||||
return img;
|
||||
},
|
||||
/**
|
||||
* 跳转
|
||||
* @param {Object} url
|
||||
*/
|
||||
redirect(url) {
|
||||
if (!this.storeToken) {
|
||||
this.$refs.login.open(url);
|
||||
} else {
|
||||
this.$util.redirectTo(url);
|
||||
}
|
||||
},
|
||||
getRechargeList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/memberrecharge/page',
|
||||
data: {
|
||||
page_size: 100,
|
||||
page: 1
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
let rechargeList = [];
|
||||
res.data.list.forEach(item => {
|
||||
if (item.point > 0) rechargeList.push(item)
|
||||
});
|
||||
this.rechargeList = rechargeList;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
back() {
|
||||
if (getCurrentPages().length > 1) uni.navigateBack({
|
||||
delta: 1
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '暂无相关活动'
|
||||
});
|
||||
else this.$util.redirectTo('/pages/index/index');
|
||||
},
|
||||
getNewestGame() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/game/newestgame',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) this.newestGame = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
luckdraw() {
|
||||
if (this.newestGame) {
|
||||
switch (this.newestGame.game_type) {
|
||||
case 'cards':
|
||||
this.$util.redirectTo('/pages_promotion/game/cards', {
|
||||
id: this.newestGame.game_id
|
||||
});
|
||||
break;
|
||||
case 'egg':
|
||||
this.$util.redirectTo('/pages_promotion/game/smash_eggs', {
|
||||
id: this.newestGame.game_id
|
||||
});
|
||||
break;
|
||||
case 'turntable':
|
||||
this.$util.redirectTo('/pages_promotion/game/turntable', {
|
||||
id: this.newestGame.game_id
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '暂无相关活动'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
//分享给好友
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData.appMessage;
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
return this.mpShareData.timeLine;
|
||||
}
|
||||
};
|
||||
},
|
||||
//分享给好友
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData.appMessage;
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
return this.mpShareData.timeLine;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/list.scss';
|
||||
@import './public/css/list.scss';
|
||||
</style>
|
||||
<style>
|
||||
.ns-adv>>>image {
|
||||
width: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
.ns-adv>>>image {
|
||||
width: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -84,9 +84,6 @@
|
||||
|
||||
<script>
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
@@ -94,9 +91,6 @@
|
||||
export default {
|
||||
components: {
|
||||
MescrollUni,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
nsEmpty,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
// #endif
|
||||
|
||||
@@ -278,24 +278,14 @@
|
||||
|
||||
<script>
|
||||
import payment from './public/js/payment.js';
|
||||
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||
import nsSelectTime from '@/components/ns-select-time/ns-select-time.vue';
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uniPopup,
|
||||
nsSelectTime,
|
||||
nsLogin,
|
||||
MescrollUni,
|
||||
loadingCover,
|
||||
nsEmpty,
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
// #endif
|
||||
|
||||
Reference in New Issue
Block a user