完善余额功能

This commit is contained in:
2025-05-09 17:51:34 +08:00
parent 2a32bd6fe5
commit 9cd1e5eaca
23 changed files with 603 additions and 174 deletions

View File

@ -169,43 +169,14 @@ __webpack_require__.r(__webpack_exports__);
"use strict";
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var _mescrollMixins = _interopRequireDefault(__webpack_require__(/*! @/components/mescroll-uni/mescroll-mixins.js */ 181));
var _user = __webpack_require__(/*! @/api/user */ 34);
var _activity = __webpack_require__(/*! @/api/activity */ 748);
//
//
//
@ -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();
});
}
}
};

View File

@ -1 +1 @@
<view class="coupon"><view><u-tabs vue-id="d58401fe-1" list="{{list}}" is-scroll="{{false}}" current="{{current}}" active-color="{{themeColor}}" height="96" data-event-opts="{{[['^change',[['change']]]]}}" bind:change="__e" bind:__l="__l"></u-tabs></view><block wx: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="d58401fe-2" src="{{cloudPath+'img/icon_package1.png'}}" width="34" height="28" bind:__l="__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="d58401fe-3" src="{{cloudPath+'img/icon_package2.png'}}" width="220" height="60" bind:__l="__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="d58401fe-4" color="#FF0000" price="{{121.99}}" subscriptSize="{{32}}" firstSize="{{52}}" secondSize="{{52}}" bind:__l="__l"></price-format></view><view class="text-D8A658 u-text-center u-p-t-32">满11元可用</view></view></view></view></view></block><block wx: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="d58401fe-5" color="{{themeColor}}" price="{{121}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" bind:__l="__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="d58401fe-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']]]]}}" bind:click="__e" bind:__l="__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="d58401fe-7" color="{{themeColor}}" price="{{121}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" bind:__l="__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="d58401fe-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']]]]}}" bind:click="__e" bind:__l="__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="d58401fe-9" color="{{themeColor}}" price="{{121}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" bind:__l="__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="d58401fe-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']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">立即兑换</u-button></view></view></view></view></block></view>
<view class="coupon"><view><u-tabs vue-id="d58401fe-1" list="{{tab}}" is-scroll="{{false}}" current="{{current}}" active-color="{{themeColor}}" height="96" data-event-opts="{{[['^change',[['change']]]]}}" bind:change="__e" bind:__l="__l"></u-tabs></view><mescroll-body class="vue-ref" vue-id="d58401fe-2" up="{{upOption}}" data-ref="mescroll" data-event-opts="{{[['^init',[['mescrollInit']]],['^down',[['downCallback']]],['^up',[['upCallback']]]]}}" bind:init="__e" bind:down="__e" bind:up="__e" bind:__l="__l" vue-slots="{{['default']}}"><block wx: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="{{('d58401fe-3')+','+('d58401fe-2')}}" src="{{cloudPath+'img/icon_package1.png'}}" width="34" height="28" bind:__l="__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="{{('d58401fe-4')+','+('d58401fe-2')}}" src="{{cloudPath+'img/icon_package2.png'}}" width="220" height="60" bind:__l="__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="{{('d58401fe-5')+','+('d58401fe-2')}}" color="#FF0000" price="{{121.99}}" subscriptSize="{{32}}" firstSize="{{52}}" secondSize="{{52}}" bind:__l="__l"></price-format></view><view class="text-D8A658 u-text-center u-p-t-32">满11元可用</view></view></view></view></view></block><block wx:if="{{current===1}}"><view class="coupon-list u-m-t-12"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="coupon-list-bg row-between"><view class="row-start row-column u-row-center u-text-center"><view><price-format vue-id="{{('d58401fe-6-'+index)+','+('d58401fe-2')}}" color="{{themeColor}}" price="{{item.money}}" subscriptSize="{{40}}" firstSize="{{72}}" secondSize="{{72}}" bind:__l="__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="{{('d58401fe-7-'+index)+','+('d58401fe-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']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">立即兑换</u-button></view></view></view></block></view></block></mescroll-body></view>

View File

@ -242,6 +242,8 @@ var _type = __webpack_require__(/*! @/utils/type */ 42);
//
//
//
//
//
var _default = {
data: function data() {
return {

View File

@ -1 +1 @@
<view class="index home-bg" style="{{$root.s0}}"><u-sticky vue-id="39aa39a1-1" offset-top="0" h5-nav-height="0" bg-color="transparent" enable="{{true}}" bind:__l="__l" vue-slots="{{['default']}}"><u-navbar vue-id="{{('39aa39a1-2')+','+('39aa39a1-1')}}" border-bottom="{{false}}" is-fixed="{{false}}" custom-class="home-bg" background="{{navBackground}}" is-back="{{true}}" backText="{{backText}}" title="{{title}}" title-color="#fff" backIconColor="#fff" bind:__l="__l"></u-navbar></u-sticky><view class="row-center balance u-relative" style="{{'padding-top:'+(topSpace+'px')+';'}}"><view class="u-text-center w-full"><view class="text-fff" style="font-size:96rpx;">{{userInfo.user_integral}}</view><view class="text-fff nr">积分</view></view><view class="u-absolute right-0"><view class="excharge row-center text-default"><text class="xs">兑换商品</text><u-icon class="u-m-l-10" vue-id="39aa39a1-3" name="arrow-right" size="22" color="{{themeColor}}" bind:__l="__l"></u-icon></view></view></view><view class="u-p-b-40" style="margin-top:132rpx;"><view class="list bg-white br16 u-p-32"><view class="lg">积分明细</view><scroll-view style="height:880rpx;" scroll-y="true" refresher-enabled="{{true}}" refresher-triggered="{{isRefreshing}}" data-event-opts="{{[['refresherrefresh',[['refreshCallback',['$event']]]],['scrolltolower',[['upCallback',['$event']]]]]}}" bindrefresherrefresh="__e" bindscrolltolower="__e"><view class="u-m-t-16"><block wx:for="{{lists}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="u-m-b-16"><view class="nr row-between"><view>{{item.source_type}}</view><view class="deduct">{{item.change_amount}}</view></view><view class="date xs u-m-t-16">{{item.change_amount}}</view></view></block></view><loading-footer vue-id="39aa39a1-4" status="{{loadingStatus}}" bind:__l="__l"></loading-footer></scroll-view></view></view></view>
<view class="index home-bg" style="{{$root.s0}}"><u-sticky vue-id="39aa39a1-1" offset-top="0" h5-nav-height="0" bg-color="transparent" enable="{{true}}" bind:__l="__l" vue-slots="{{['default']}}"><u-navbar vue-id="{{('39aa39a1-2')+','+('39aa39a1-1')}}" border-bottom="{{false}}" is-fixed="{{false}}" custom-class="home-bg" background="{{navBackground}}" is-back="{{true}}" backText="{{backText}}" title="{{title}}" title-color="#fff" backIconColor="#fff" bind:__l="__l"></u-navbar></u-sticky><view class="row-center balance u-relative" style="{{'padding-top:'+(topSpace+'px')+';'}}"><view class="u-text-center w-full"><view class="text-fff" style="font-size:96rpx;">{{userInfo.user_integral}}</view><view class="text-fff nr">积分</view></view><view class="u-absolute right-0"><navigator url="/bundle/pages/points/points_store" hover-class="none"><view class="excharge row-center text-default"><text class="xs">兑换商品</text><u-icon class="u-m-l-10" vue-id="39aa39a1-3" name="arrow-right" size="22" color="{{themeColor}}" bind:__l="__l"></u-icon></view></navigator></view></view><view class="u-p-b-40" style="margin-top:132rpx;"><view class="list bg-white br16 u-p-32"><view class="lg">积分明细</view><scroll-view style="height:880rpx;" scroll-y="true" refresher-enabled="{{true}}" refresher-triggered="{{isRefreshing}}" data-event-opts="{{[['refresherrefresh',[['refreshCallback',['$event']]]],['scrolltolower',[['upCallback',['$event']]]]]}}" bindrefresherrefresh="__e" bindscrolltolower="__e"><view class="u-m-t-16"><block wx:for="{{lists}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="u-m-b-16"><view class="nr row-between"><view>{{item.source_type}}</view><view class="deduct">{{item.change_amount}}</view></view><view class="date xs u-m-t-16">{{item.change_amount}}</view></view></block></view><loading-footer vue-id="39aa39a1-4" status="{{loadingStatus}}" bind:__l="__l"></loading-footer></scroll-view></view></view></view>

View File

@ -167,7 +167,7 @@ __webpack_require__.r(__webpack_exports__);
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {
Object.defineProperty(exports, "__esModule", {
value: true
@ -230,10 +230,16 @@ var _default = {
methods: {
change: function change(index) {
this.current = index;
},
toExchange: function toExchange() {
uni.navigateTo({
url: "/bundle/pages/points/points_shop"
});
}
}
};
exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
/***/ }),

View File

@ -1 +1 @@
<view class="points-store u-relative"><view class="bg-default bg u-text-center text-fff"><view class="u-p-t-42"><view class="sm">可用积分</view><view class="fraction bold-600 u-m-t-14">0.00</view></view></view><view class="u-absolute left-0 right-0 bg-white u-p-t-34 list"><view><u-tabs vue-id="73f6c8bf-1" list="{{list}}" is-scroll="{{true}}" current="{{current}}" inactive-color="#636363" active-color="{{themeColor}}" data-event-opts="{{[['^change',[['change']]]]}}" bind:change="__e" bind:__l="__l"></u-tabs></view><view class="u-m-l-24 u-m-r-24"><u-line vue-id="73f6c8bf-2" color="#EEE" bind:__l="__l"></u-line></view><view class="u-m-t-32 u-m-l-24 u-m-r-24"><block wx:for="{{10}}" wx:for-item="itme" wx:for-index="index"><view class="row-start u-col-top u-m-b-42"><view><u-image vue-id="{{'73f6c8bf-3-'+index}}" src="{{cloudPath+'img/banner.png'}}" width="180" height="180" border-radius="20" bind:__l="__l"></u-image></view><view class="u-m-l-18 w-full"><view>小熊早餐必备煮蛋器</view><view class="u-m-t-4 text-7c">兑换66人</view><view class="u-m-t-42 row-between"><view><text class="primary">100.00</text><text class="text-7c">积分+</text><text class="primary">100.00</text><text class="text-7c">元</text></view><view><u-button vue-id="{{'73f6c8bf-4-'+index}}" hover-class="none" customStyle="{{({width:'145rpx',height:'61rpx',backgroundColor:themeColor,color:'#fff',border:'none',borderRadius:'31rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['mpLogin']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">兑换</u-button></view></view></view></view></block></view></view></view>
<view class="points-store u-relative"><view class="bg-default bg u-text-center text-fff"><view class="u-p-t-42"><view class="sm">可用积分</view><view class="fraction bold-600 u-m-t-14">0.00</view></view></view><view class="u-absolute left-0 right-0 bg-white u-p-t-34 list"><view><u-tabs vue-id="73f6c8bf-1" list="{{list}}" is-scroll="{{true}}" current="{{current}}" inactive-color="#636363" active-color="{{themeColor}}" data-event-opts="{{[['^change',[['change']]]]}}" bind:change="__e" bind:__l="__l"></u-tabs></view><view class="u-m-l-24 u-m-r-24"><u-line vue-id="73f6c8bf-2" color="#EEE" bind:__l="__l"></u-line></view><view class="u-m-t-32 u-m-l-24 u-m-r-24"><block wx:for="{{10}}" wx:for-item="itme" wx:for-index="index"><view class="row-start u-col-top u-m-b-42"><view><u-image vue-id="{{'73f6c8bf-3-'+index}}" src="{{cloudPath+'img/banner.png'}}" width="180" height="180" border-radius="20" bind:__l="__l"></u-image></view><view class="u-m-l-18 w-full"><view>小熊早餐必备煮蛋器</view><view class="u-m-t-4 text-7c">兑换66人</view><view class="u-m-t-42 row-between"><view><text class="primary">100.00</text><text class="text-7c">积分+</text><text class="primary">100.00</text><text class="text-7c">元</text></view><view><u-button vue-id="{{'73f6c8bf-4-'+index}}" hover-class="none" customStyle="{{({width:'145rpx',height:'61rpx',backgroundColor:themeColor,color:'#fff',border:'none',borderRadius:'31rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['toExchange']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">兑换</u-button></view></view></view></view></block></view></view></view>