Commit e2c0db7864c6385f81958fddde10729dc35f8ec4

Authored by taiyuan
1 parent fa7bdcb3

我的礼包 和 礼包详情 修改

packageA/pages/myGift/myGift.js
... ... @@ -22,6 +22,7 @@ Page({
22 22 let url = '';
23 23 let data = {
24 24 store_id: app.globalData.setting.stoid,
  25 + user_id: app.globalData.user_id,
25 26 };
26 27  
27 28 this.setData({
... ... @@ -35,7 +36,6 @@ Page({
35 36 url = '/api/weshop/libao/libaoForm/page';
36 37 } else if(index == 1) {
37 38 url = '/api/weshop/libao/libaoFormvip/page';
38   - data.user_id = app.globalData.user_id;
39 39 };
40 40  
41 41 this.getData(true, url, data);
... ... @@ -74,6 +74,7 @@ Page({
74 74  
75 75 this.getData(true, '/api/weshop/libao/libaoForm/page', {
76 76 store_id: app.globalData.setting.stoid,
  77 + user_id: app.globalData.user_id,
77 78 });
78 79 };
79 80 };
... ...
packageA/pages/myGift/myGift.wxml
... ... @@ -6,7 +6,7 @@
6 6 <view class="tab-content">
7 7 <block wx:if="{{currentIndex == 0}}">
8 8 <view class="tab-item" wx:for="{{list.pageData}}">
9   - <view bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?id=' + item.lbvipid}}">
  9 + <view bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?index=0&id=' + item.id}}">
10 10 <!-- 图片 -->
11 11 <view class="img-container"><image src="{{imghost + item.lburl}}" class="img" mode="widthFix"/></view>
12 12 <view class="desc-container">
... ... @@ -26,14 +26,14 @@
26 26 </view>
27 27 </view>
28 28 <view class="btn-container pd20">
29   - <view class="btn exchange">立即兑换</view>
30   - <view class="btn buy">立即购买</view>
  29 + <view class="btn red">立即兑换</view>
  30 + <view class="btn pink">立即购买</view>
31 31 </view>
32 32 </view>
33 33 </block>
34 34  
35 35 <block wx:else>
36   - <view class="tab-item flex pd20" wx:for="{{list.pageData}}" bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?id=' + item.lbvipid}}">
  36 + <view class="tab-item flex pd20" wx:for="{{list.pageData}}" bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?index=1&id=' + item.lbvipid}}">
37 37 <view class="img-container2"><image src="{{imghost + item.lburl}}" class="img" mode="widthFix"/></view>
38 38 <view class="flex fdc jc_sb">
39 39 <view>
... ...
packageA/pages/myGift/myGift.wxss
... ... @@ -99,7 +99,7 @@ page {
99 99  
100 100 .img-container2 {
101 101 width: 200rpx;
102   - /* height: 200rpx; */
  102 + height: 200rpx;
103 103 background-color: #dedede;
104 104 margin-right: 20rpx;
105 105 flex-shrink: 0;
... ... @@ -140,12 +140,12 @@ page {
140 140 text-align: center;
141 141 }
142 142  
143   -.btn.exchange {
  143 +.btn.red {
144 144 background-color: #FF6768;
145 145 color: white;
146 146 }
147 147  
148   -.btn.buy {
  148 +.btn.pink {
149 149 background-color: #FACAD6;
150 150 color: #FF6768;
151 151 }
... ...
packageA/pages/myGiftDetails/myGiftDetails.js
... ... @@ -16,7 +16,11 @@ Page({
16 16 */
17 17 onLoad: function (options) {
18 18 self = this;
19   - this.data.id = options.id;
  19 + this.setData({
  20 + id: options.id,
  21 + index: options.index,
  22 + })
  23 +
20 24 // console.log('options', options);
21 25 app.isLogin().then(function(data) {//进入页面前已经授权登录成功
22 26 self.setData({
... ... @@ -44,20 +48,67 @@ Page({
44 48 isLogin: true,
45 49 });
46 50  
47   - // 请求数据
48   - app.request.promiseGet('/api/weshop/libao/libaoFormvip/page', {
49   - data: {
50   - store_id: app.globalData.setting.stoid,
51   - user_id: app.globalData.user_id,
52   - id: this.data.id,
53   - },
54   - isShowLoading: true,
55   - }).then(function(res) {
56   - console.log('res-->', res.data.data.pageData);
57   - self.setData({
58   - details: res.data.data.pageData[0],
  51 + let url = '';
  52 + // let data = {
  53 + // store_id: app.globalData.setting.stoid,
  54 + // user_id: app.globalData.user_id,
  55 + // };
  56 +
  57 + if(this.data.index == 0) {
  58 + // data.lbid = this.data.id;
  59 + // 请求数据
  60 + app.request.promiseGet('/api/weshop/libao/libaoForm/page', {
  61 + data: {
  62 + store_id: app.globalData.setting.stoid,
  63 + id: this.data.id,
  64 + },
  65 + isShowLoading: true,
  66 + }).then(function(res) {
  67 + self.setData({
  68 + details: res.data.data.pageData[0],
  69 + });
59 70 });
60   - });
  71 +
  72 + app.request.promiseGet('/api/weshop/libao/libaoList/page', {
  73 + data: {
  74 + store_id: app.globalData.setting.stoid,
  75 + lbid: this.data.id,
  76 + },
  77 + isShowLoading: true,
  78 + }).then(function(res) {
  79 + self.setData({
  80 + list: res.data.data.pageData,
  81 + });
  82 + });
  83 + } else if(this.data.index == 1) {
  84 + app.request.promiseGet('/api/weshop/libao/libaoFormvip/page', {
  85 + data: {
  86 + store_id: app.globalData.setting.stoid,
  87 + user_id: app.globalData.user_id,
  88 + id: this.data.id,
  89 + },
  90 + isShowLoading: true,
  91 + }).then(function(res) {
  92 + console.log('res3-->', res);
  93 + self.setData({
  94 + details: res.data.data.pageData[0],
  95 + });
  96 + });
  97 +
  98 + app.request.promiseGet('/api/weshop/libao/libaoListvip/page', {
  99 + data: {
  100 + store_id: app.globalData.setting.stoid,
  101 + lbvipid: this.data.id,
  102 + },
  103 + isShowLoading: true,
  104 + }).then(function(res) {
  105 + console.log('res4-->', res);
  106 + self.setData({
  107 + list: res.data.data.pageData,
  108 + });
  109 + });
  110 + };
  111 +
61 112  
62 113 };
63 114 };
... ...
packageA/pages/myGiftDetails/myGiftDetails.wxml
... ... @@ -15,7 +15,7 @@
15 15 <view class="fs24 c-a4">已售{{details.salenum}}件</view>
16 16 </view>
17 17 <!-- 时间 -->
18   - <view class="date">活动截止日期 {{filter.format_time(details.expdate)}}</view>
  18 + <view class="date">活动截止日期 {{details.expdate ? filter.format_time(details.expdate):filter.format_time(details.endtime)}}</view>
19 19 </view>
20 20 <!-- 单品 -->
21 21 <view class="goods-container">
... ... @@ -25,28 +25,19 @@
25 25 <view>单品名称</view>
26 26 <view>数量</view>
27 27 </view>
28   - <view class="flex pd20 jc_sb">
29   - <view>DN53000039蒂诺间金</view>
30   - <view class="c-a4">x1</view>
31   - </view>
32   - <view class="flex pd20 jc_sb">
33   - <view>蒂诺间金</view>
34   - <view class="c-a4">x1</view>
35   - </view>
36   - <view class="flex pd20 jc_sb">
37   - <view>金</view>
38   - <view class="c-a4">x1000</view>
39   - </view>
40   - <view class="flex pd20 jc_sb">
41   - <view class="ellipsis-1 pdr80">蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂蒂</view>
42   - <view class="c-a4">x199</view>
  28 + <view class="flex pd20 jc_sb" wx:for="{{list}}">
  29 + <view>{{item.goods_name}}</view>
  30 + <view class="c-a4">x{{item.goods_num}}</view>
43 31 </view>
44 32 </view>
45 33 </view>
46 34  
47 35 <!-- 按钮 -->
48 36 <view class="btn-container">
49   - <view class="btn exchange">立即兑换</view>
50   - <view class="btn buy">马上购买</view>
  37 + <block wx:if="{{index == 0}}">
  38 + <view class="btn red">立即兑换</view>
  39 + <view class="btn pink">立即购买</view>
  40 + </block>
  41 + <view wx:else class="btn red">立即使用</view>
51 42 </view>
52 43 </view>
... ...
packageA/pages/myGiftDetails/myGiftDetails.wxss
... ... @@ -68,12 +68,12 @@ page {
68 68 text-align: center;
69 69 }
70 70  
71   -.btn.exchange {
  71 +.btn.red {
72 72 background-color: #FF6768;
73 73 color: white;
74 74 }
75 75  
76   -.btn.buy {
  76 +.btn.pink {
77 77 background-color: #FACAD6;
78 78 color: #FF6768;
79 79 }
80 80 \ No newline at end of file
... ...