Commit 279a8bd67e49eb302998f71a6fb66a698d190287

Authored by vking
1 parent 5690a52a

商家红包活动

@@ -53,7 +53,8 @@ @@ -53,7 +53,8 @@
53 "pages/kefu", 53 "pages/kefu",
54 "pages/qiye", 54 "pages/qiye",
55 "pages/rule", 55 "pages/rule",
56 - "pages/yuding" 56 + "pages/yuding",
  57 + "pack/pack"
57 ] 58 ]
58 }, 59 },
59 { 60 {
  1 +// pack-activity/pages/money.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + list:[],
  11 + },
  12 +
  13 + /**
  14 + * 生命周期函数--监听页面加载
  15 + */
  16 + onLoad: function (options) {
  17 + this.GetUserCard()
  18 + },
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面初次渲染完成
  22 + */
  23 + onReady: function () {
  24 +
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面显示
  29 + */
  30 + onShow: function () {
  31 +
  32 + },
  33 +
  34 + /**
  35 + * 生命周期函数--监听页面隐藏
  36 + */
  37 + onHide: function () {
  38 +
  39 + },
  40 +
  41 + /**
  42 + * 生命周期函数--监听页面卸载
  43 + */
  44 + onUnload: function () {
  45 +
  46 + },
  47 +
  48 + /**
  49 + * 页面相关事件处理函数--监听用户下拉动作
  50 + */
  51 + onPullDownRefresh: function () {
  52 +
  53 + },
  54 +
  55 + /**
  56 + * 页面上拉触底事件的处理函数
  57 + */
  58 + onReachBottom: function () {
  59 +
  60 + },
  61 + GetUserCard(){
  62 + App.Customer.GetUserCard().then(res=> {
  63 + this.setData({
  64 + list: res.data
  65 + })
  66 + })
  67 + },
  68 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"black",
  5 + "usingComponents": {
  6 + "nav":"/components/nav/nav"
  7 + }
  8 +}
  1 +<!--pack-activity/pages/money.wxml-->
  2 +<wxs src="../../utils/util.wxs" module="util" />
  3 +<nav hasHome>我的余额</nav>
  4 +<view class="pages">
  5 + <view class="pages-view">
  6 + <view class="money-block">
  7 + <view class="money-views-top">
  8 + <view class="txt">我的余额</view>
  9 + </view>
  10 + <view class="money-views flex-bc">
  11 + <view class="money-number">{{user.price}}</view>
  12 + <view class="money-dw">元</view>
  13 + </view>
  14 + <navigator url="/pages/reserve/index" open-type="switchTab" hover-class="other-navigator-hover">
  15 + <view class="yuding flex-cc">
  16 + <view class="icon"></view>
  17 + 去订包间
  18 + </view>
  19 + </navigator>
  20 + </view>
  21 + </view>
  22 + <view class="list-view" wx:if="{{list.length>0}}">
  23 + <view class="item" wx:for="{{list}}" wx:key="list">
  24 + <view class="flex-lr name">
  25 + <view>{{item.remark}}</view>
  26 + <view>{{item.type==1?'+':'-'}}{{item.consumeprice}}</view>
  27 + </view>
  28 + <view class="flex-lr date">
  29 + <view>{{util.unixtoTime(item.createtime,"MM-DD HH:II")}}</view>
  30 + <view>余额 {{item.currprice}}</view>
  31 + </view>
  32 + </view>
  33 + </view>
  34 +</view>
  1 +/* pack-activity/pages/money.wxss */
  2 +page{
  3 + background-color: #F5F5F5;
  4 +}
  5 +.pages{
  6 + /*background-image: url("http://nosqn.colorcun.com/activity/images/money-header.png");*/
  7 + background-image: url("http://nosqn.colorcun.com/activity/images/bg-black.png");
  8 + background-size: 100% auto;
  9 + background-repeat: no-repeat;
  10 + min-height: 500rpx;
  11 + padding-top: 80rpx;
  12 +}
  13 +.pages-view{
  14 + width: calc(100% - 40rpx);
  15 + margin-left: 20rpx;
  16 + height:340rpx;
  17 + background:#ffffff;
  18 + border-radius:20rpx;
  19 + box-sizing: border-box;
  20 + padding: 20rpx;
  21 +}
  22 +.money-block{
  23 + height:300rpx;
  24 + background:rgba(255,255,255,1);
  25 + border-radius:20rpx;
  26 + padding-top: 40rpx;
  27 + box-sizing: border-box;
  28 +}
  29 +.money-views-top{
  30 + width: 258rpx;
  31 + height: 40rpx;
  32 + font-size:28rpx;
  33 + margin-left: calc(50% - 126rpx);
  34 + text-align: center;
  35 + font-weight:500;
  36 + color:rgba(153,153,153,1);
  37 + line-height:40rpx;
  38 + position: relative;
  39 +}
  40 +.money-views-top:before{
  41 + position: absolute;
  42 + display: block;
  43 + content: "";
  44 + width: 100%;
  45 + height: 2rpx;
  46 + left:0;
  47 + top:19rpx;
  48 + background-color: #E0E0E0;
  49 +}
  50 +.money-views-top .txt{
  51 + width: 138rpx;
  52 + background-color: #ffffff;
  53 + left:60rpx;
  54 + position: absolute;
  55 +}
  56 +
  57 +.money-views{
  58 + height:100rpx;
  59 + font-size:72rpx;
  60 + font-weight:600;
  61 + color:#353535;
  62 + line-height:100rpx;
  63 + margin-top: 10rpx;
  64 +}
  65 +.money-dw{
  66 + width:32rpx;
  67 + height:44rpx;
  68 + font-size:32rpx;
  69 + font-weight:600;
  70 + color:#353535;
  71 + line-height:44rpx;
  72 + margin-left: 20rpx;
  73 +}
  74 +.list-view{
  75 + width: calc(100% - 40rpx);
  76 + margin-left: 20rpx;
  77 + background:rgba(255,255,255,1);
  78 + border-radius:20rpx;
  79 + box-sizing: border-box;
  80 + padding: 2rpx 40rpx 0;
  81 + margin-top: 20rpx;
  82 +}
  83 +.item{
  84 + height: 166rpx;
  85 + box-sizing: border-box;
  86 + border-bottom: 2rpx solid #F5F5F5;
  87 + line-height: 166rpx;
  88 + padding-top: 40rpx;
  89 +}
  90 +.item:last-child{
  91 + border-bottom-width: 0;
  92 +}
  93 +.item .name{
  94 + height:44rpx;
  95 + font-size:32rpx;
  96 + font-weight:500;
  97 + color:rgba(53,53,53,1);
  98 + line-height:44rpx;
  99 + box-sizing: border-box;
  100 +}
  101 +.item .date{
  102 + height:34rpx;
  103 + font-size:24rpx;
  104 + font-weight:500;
  105 + color:rgba(153,153,153,1);
  106 + line-height:34rpx;
  107 + margin-top: 10rpx;
  108 +}
  109 +
  110 +.yuding{
  111 + width:320rpx;
  112 + height:70rpx;
  113 + background:linear-gradient(360deg,rgba(192,163,105,1) 0%,rgba(252,210,167,1) 100%);
  114 + border-radius:35rpx;
  115 + font-size:32rpx;
  116 + font-family:PingFangSC-Semibold,PingFang SC;
  117 + font-weight:600;
  118 + color:rgba(123,81,42,1);
  119 + line-height:70rpx;
  120 + margin-left: calc(50% - 160rpx);
  121 + margin-top: 40rpx;
  122 +}
  123 +.yuding .icon{
  124 + background-size: 100% 100%;
  125 + width: 30rpx;
  126 + height: 30rpx;
  127 + background-image: url("http://nosqn.colorcun.com/activity/images/addr.png");
  128 + margin-right: 20rpx;
  129 +}
@@ -11,17 +11,17 @@ @@ -11,17 +11,17 @@
11 </view> 11 </view>
12 </view> 12 </view>
13 <view class="pages"> 13 <view class="pages">
14 - <view class="block-rev money">  
15 - <navigator url="/pack-activity/pages/money">  
16 - <view class="flex-lr title">  
17 - <view class="flex-ll">  
18 - <view class="money-icon"></view>  
19 - <view class="money-title">我的余额</view>  
20 - </view>  
21 - <view class="flex-rr money-more">  
22 - <view>点击查看</view>  
23 - <view class="more"></view>  
24 - </view> 14 + <view class="block-rev money flex-lr">
  15 + <navigator url="/pack-activity/pages/money" class="money-item">
  16 + <view class="flex-vc">
  17 + <view class="money-value">¥20</view>
  18 + <view class="money-title">余额</view>
  19 + </view>
  20 + </navigator>
  21 + <navigator url="/pack-activity/pack/pack" class="money-item">
  22 + <view class="flex-vc">
  23 + <view class="money-value">20</view>
  24 + <view class="money-title">红包</view>
25 </view> 25 </view>
26 </navigator> 26 </navigator>
27 </view> 27 </view>
@@ -45,10 +45,7 @@ image{ @@ -45,10 +45,7 @@ image{
45 border-radius:10rpx; 45 border-radius:10rpx;
46 margin-bottom: 20rpx; 46 margin-bottom: 20rpx;
47 } 47 }
48 -.block-rev.money{  
49 - height: 100rpx;  
50 48
51 -}  
52 .block-rev .title{ 49 .block-rev .title{
53 box-sizing: border-box; 50 box-sizing: border-box;
54 height: 100rpx; 51 height: 100rpx;
@@ -157,29 +154,32 @@ image{ @@ -157,29 +154,32 @@ image{
157 background-image: url("http://nosqn.colorcun.com/custom/me/image/l2.png"); 154 background-image: url("http://nosqn.colorcun.com/custom/me/image/l2.png");
158 margin-right: 20rpx; 155 margin-right: 20rpx;
159 } 156 }
160 -.money-icon{  
161 - background-size: 100% 100%;  
162 - width:120rpx;  
163 - height: 48rpx;  
164 - background-color: rgba(252,210,167,1);  
165 - margin-right: 20rpx;  
166 - border-radius:10rpx;  
167 - background-image: url("http://nosqn.colorcun.com/activity/images/Balance.png"); 157 +.block-rev.money{
  158 + height: 160rpx;
  159 +
168 } 160 }
169 .money-title{ 161 .money-title{
170 - height:42rpx;  
171 - font-size:30rpx; 162 + height:40rpx;
  163 + font-size:28rpx;
  164 + font-family:PingFangSC-Medium,PingFang SC;
172 font-weight:500; 165 font-weight:500;
173 - color:rgba(53,53,53,1);  
174 - line-height:42rpx; 166 + color:rgba(136,136,136,1);
  167 + line-height:40rpx;
175 } 168 }
176 -.money-more{  
177 - height: 34rpx;  
178 - font-size:24rpx; 169 +.money-value{
  170 + height:48rpx;
  171 + font-size:34rpx;
  172 + font-family:PingFangSC-Medium,PingFang SC;
179 font-weight:500; 173 font-weight:500;
180 - color:rgba(53,53,53,1);  
181 - line-height:34rpx; 174 + color:rgba(0,0,0,1);
  175 + line-height:48rpx;
182 } 176 }
183 -.money-more .more{  
184 - margin-left: 20rpx; 177 +.money-item{
  178 + width: 50%;
  179 + box-sizing: border-box;
  180 + height: 88rpx;
  181 + border-right: 2rpx solid #F5F5F5;
  182 +}
  183 +.money-item:last-child{
  184 + border-right-width: 0;
185 } 185 }
@@ -479,4 +479,8 @@ export default { @@ -479,4 +479,8 @@ export default {
479 'App.Customer.SetCardRel':{ 479 'App.Customer.SetCardRel':{
480 openid:'openid', 480 openid:'openid',
481 }, 481 },
  482 + //根据不同状态获取用户对应的卡券列表
  483 + 'App.Customer.GetUserCard':{
  484 + openid:'openid',
  485 + },
482 } 486 }