完善余额功能
This commit is contained in:
@ -1 +1 @@
|
||||
<view class="coupon"><view><u-tabs vue-id="d5980252-1" list="{{list}}" is-scroll="{{false}}" current="{{current}}" active-color="{{themeColor}}" height="96" data-event-opts="{{[['^change',[['change']]]]}}" onChange="__e" onVueInit="__l"></u-tabs></view><block a:if="{{current===0}}"><view class="u-relative"><view class="package u-text-center u-p-t-22 u-p-b-28"><view class="bold-500">超级省钱券包</view><view>超值权益一单回本</view></view><view class="list u-absolute left-0 right-0"><view class="block br20"><view class="row-between"><view><view class="row"><u-image vue-id="d5980252-2" src="{{cloudPath+'img/icon_package1.png'}}" width="34" height="28" onVueInit="__l"></u-image><view class="text-333 u-m-l-10 nr">券包</view></view><view class="text-755023 xs u-m-t-10"><text>2元最低可抵111元/共<text class="primary">1</text>张券</text></view></view><view class="u-relative"><u-image vue-id="d5980252-3" src="{{cloudPath+'img/icon_package2.png'}}" width="220" height="60" onVueInit="__l"></u-image><view class="text-755023 u-absolute price xs">¥2.00</view></view></view><view class="coupon-bg u-m-t-32"><view class="xxs u-text-center u-p-t-4 text-845F2E">满减券x1</view><view class="bold-600 u-text-center u-p-t-26"><price-format vue-id="d5980252-4" color="#FF0000" price="{{121.99}}" subscriptSize="{{32}}" firstSize="{{52}}" secondSize="{{52}}" onVueInit="__l"></price-format></view><view class="text-D8A658 u-text-center u-p-t-32">满11元可用</view></view></view></view></view></block><block a:if="{{current===1}}"><view class="coupon-list u-m-t-12"><view class="coupon-list-bg row-between"><view class="row-start row-column u-row-center u-text-center"><view><price-format vue-id="d5980252-5" color="{{themeColor}}" price="{{121}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" onVueInit="__l"></price-format></view><view class="full">满20元可用</view></view><view class="flex1 u-m-l-80 row-between"><view><view class="coupon-text bold-600">优惠券</view><view class="xs u-m-t-20 date">有效期3天</view></view><view><u-button vue-id="d5980252-6" hover-class="none" customStyle="{{({width:'160rpx',height:'56rpx',backgroundColor:themeColor,color:'#fff',border:'none',borderRadius:'100rpx',fontSize:'24rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['mpLogin']]]]}}" onClick="__e" onVueInit="__l" vue-slots="{{['default']}}">立即兑换</u-button></view></view></view><view class="coupon-list-bg row-between"><view class="row-start row-column u-row-center u-text-center"><view><price-format vue-id="d5980252-7" color="{{themeColor}}" price="{{121}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" onVueInit="__l"></price-format></view><view class="full">满20元可用</view></view><view class="flex1 u-m-l-80 row-between"><view><view class="coupon-text bold-600">优惠券</view><view class="xs u-m-t-20 date">有效期3天</view></view><view><u-button vue-id="d5980252-8" hover-class="none" customStyle="{{({width:'160rpx',height:'56rpx',backgroundColor:themeColor,color:'#fff',border:'none',borderRadius:'100rpx',fontSize:'24rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['mpLogin']]]]}}" onClick="__e" onVueInit="__l" vue-slots="{{['default']}}">立即兑换</u-button></view></view></view><view class="coupon-list-bg row-between"><view class="row-start row-column u-row-center u-text-center"><view><price-format vue-id="d5980252-9" color="{{themeColor}}" price="{{121}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" onVueInit="__l"></price-format></view><view class="full">满20元可用</view></view><view class="flex1 u-m-l-80 row-between"><view><view class="coupon-text bold-600">优惠券</view><view class="xs u-m-t-20 date">有效期3天</view></view><view><u-button vue-id="d5980252-10" hover-class="none" customStyle="{{({width:'160rpx',height:'56rpx',backgroundColor:themeColor,color:'#fff',border:'none',borderRadius:'100rpx',fontSize:'24rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['mpLogin']]]]}}" onClick="__e" onVueInit="__l" vue-slots="{{['default']}}">立即兑换</u-button></view></view></view></view></block></view>
|
||||
<view class="coupon"><view><u-tabs vue-id="d5980252-1" list="{{tab}}" is-scroll="{{false}}" current="{{current}}" active-color="{{themeColor}}" height="96" data-event-opts="{{[['^change',[['change']]]]}}" onChange="__e" onVueInit="__l"></u-tabs></view><mescroll-body vue-id="d5980252-2" up="{{upOption}}" ref="__r" data-ref="mescroll" data-event-opts="{{[['^init',[['mescrollInit']]],['^down',[['downCallback']]],['^up',[['upCallback']]]]}}" onInit="__e" onDown="__e" onUp="__e" onVueInit="__l" vue-slots="{{['default']}}"><block a:if="{{current===0}}"><view class="u-relative"><view class="package u-text-center u-p-t-22 u-p-b-28"><view class="bold-500">超级省钱券包</view><view>超值权益一单回本</view></view><view class="list u-absolute left-0 right-0"><view class="block br20"><view class="row-between"><view><view class="row"><u-image vue-id="{{('d5980252-3')+','+('d5980252-2')}}" src="{{cloudPath+'img/icon_package1.png'}}" width="34" height="28" onVueInit="__l"></u-image><view class="text-333 u-m-l-10 nr">券包</view></view><view class="text-755023 xs u-m-t-10"><text>2元最低可抵111元/共<text class="primary">1</text>张券</text></view></view><view class="u-relative"><u-image vue-id="{{('d5980252-4')+','+('d5980252-2')}}" src="{{cloudPath+'img/icon_package2.png'}}" width="220" height="60" onVueInit="__l"></u-image><view class="text-755023 u-absolute price xs">¥2.00</view></view></view><view class="coupon-bg u-m-t-32"><view class="xxs u-text-center u-p-t-4 text-845F2E">满减券x1</view><view class="bold-600 u-text-center u-p-t-26"><price-format vue-id="{{('d5980252-5')+','+('d5980252-2')}}" color="#FF0000" price="{{121.99}}" subscriptSize="{{32}}" firstSize="{{52}}" secondSize="{{52}}" onVueInit="__l"></price-format></view><view class="text-D8A658 u-text-center u-p-t-32">满11元可用</view></view></view></view></view></block><block a:if="{{current===1}}"><view class="coupon-list u-m-t-12"><view class="coupon-list-bg row-between" a:for="{{list}}" a:for-item="item" a:for-index="index" a:key="index"><view class="row-start row-column u-row-center u-text-center"><view><price-format vue-id="{{('d5980252-6-'+index)+','+('d5980252-2')}}" color="{{themeColor}}" price="{{item.money}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" onVueInit="__l"></price-format></view><view class="full">{{item.use_condition}}</view></view><view class="flex1 u-m-l-80 row-between"><view><view class="coupon-text bold-600">优惠券</view><view class="xs u-m-t-20 date">{{"有效期 "+item.use_time_tips+"天"}}</view></view><view><u-button vue-id="{{('d5980252-7-'+index)+','+('d5980252-2')}}" hover-class="none" customStyle="{{({width:'160rpx',height:'56rpx',backgroundColor:themeColor,color:'#fff',border:'none',borderRadius:'100rpx',fontSize:'24rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['mpLogin']]]]}}" onClick="__e" onVueInit="__l" vue-slots="{{['default']}}">立即兑换</u-button></view></view></view></view></block></mescroll-body></view>
|
||||
@ -169,43 +169,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||
"use strict";
|
||||
|
||||
|
||||
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 3);
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
var _mescrollMixins = _interopRequireDefault(__webpack_require__(/*! @/components/mescroll-uni/mescroll-mixins.js */ 177));
|
||||
var _user = __webpack_require__(/*! @/api/user */ 30);
|
||||
var _activity = __webpack_require__(/*! @/api/activity */ 730);
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -272,19 +243,46 @@ exports.default = void 0;
|
||||
//
|
||||
//
|
||||
var _default = {
|
||||
mixins: [_mescrollMixins.default],
|
||||
data: function data() {
|
||||
return {
|
||||
list: [{
|
||||
tab: [{
|
||||
name: '购买'
|
||||
}, {
|
||||
name: '兑换'
|
||||
}],
|
||||
current: 1
|
||||
current: 1,
|
||||
upOption: {
|
||||
noMoreSize: 4,
|
||||
empty: {
|
||||
tip: '~ 空空如也 ~',
|
||||
// 提示
|
||||
btnText: ''
|
||||
},
|
||||
textNoMore: '没有更多了'
|
||||
},
|
||||
list: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
change: function change(index) {
|
||||
this.current = index;
|
||||
},
|
||||
// 初始化数据
|
||||
upCallback: function upCallback(page) {
|
||||
var _this = this;
|
||||
(0, _activity.getCouponList)({
|
||||
page: page.num,
|
||||
current: this.current
|
||||
}).then(function (res) {
|
||||
var data = res.data;
|
||||
_this.mescroll.endSuccess(data.length, data.totalPages);
|
||||
//设置列表数据
|
||||
if (page.num == 1) _this.list = []; //如果是第一页需手动制空列表
|
||||
_this.list = _this.list.concat(data); //追加新数据
|
||||
}).catch(function () {
|
||||
_this.mescroll.endErr();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"u-tabs": "/components/uview-ui/components/u-tabs/u-tabs",
|
||||
"u-image": "/components/uview-ui/components/u-image/u-image",
|
||||
"price-format": "/components/price-format/price-format",
|
||||
"u-button": "/components/uview-ui/components/u-button/u-button"
|
||||
"u-button": "/components/uview-ui/components/u-button/u-button",
|
||||
"mescroll-body": "/components/mescroll-uni/mescroll-body"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user