Commit 0f68c64f7fb3684f292bc5ac9d86ecff9c8cc2f3

Authored by 前端研发-钱巧玲
1 parent 29593190

礼包详情二维码显示

pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -27,18 +27,22 @@ Page({
27 27 my_confirm.open_cancel(0);
28 28 th.setData({
29 29 getStorageID: a.stoid,
30   - getUserID: d.user_id
31   - })
32   - },
33   - onShow: function() {
34   - var th = this;
35   - th.setData({
  30 + getUserID: d.user_id,
36 31 pages: 1,
37 32 pageSize: 10,
38 33 loadingType: 0
39 34 })
40 35 th.getList();
41 36 },
  37 + onShow: function() {
  38 + // var th = this;
  39 + // th.setData({
  40 + // pages: 1,
  41 + // pageSize: 10,
  42 + // loadingType: 0
  43 + // })
  44 + // th.getList();
  45 + },
42 46  
43 47 GetBuyPrice: function(e) {
44 48 var that = this.data;
... ...
pages/giftpack/buygiftpack/giftpackbuy.wxml
1 1 <view class="top_img">
2   - <view class="top_img">
3   - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}" lazy-load="true"></image>
  2 + <view class="top_img">
  3 + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}" lazy-load="true"></image>
  4 + </view>
  5 + <view class="top_title">
  6 + <view class="top_title_box">
  7 + <text class="top_title_redtext">礼包列表</text>
4 8 </view>
5   - <view class="top_title">
6   - <view class="top_title_box">
7   - <text class="top_title_redtext">礼包列表</text>
8   - </view>
9   - <view class="top_title_box_S"></view>
10   - <view class="top_title_box">
11   - <a class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a>
12   - </view>
  9 + <view class="top_title_box_S"></view>
  10 + <view class="top_title_box">
  11 + <a class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a>
13 12 </view>
14   - <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index">
15   - <view class="content_box">
16   - <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}">
17   - <view class="content_box_img">
18   - <image src="{{iurl+items.lbUrl}}" lazy-load="true"></image>
19   - </view>
20   - <view class="content_box_title">
21   - <view class="content_ware_title">
22   - <text bindtap="__e">{{items.giftTitle}}</text>
23   - </view>
24   - <view class="content_ware_type">
25   - <block wx:if="{{items.payMoney>0}}">
26   - <text>{{"¥"+items.payMoney}}</text>
27   - </block>
28   - <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}">
29   - <text>/</text>
30   - </block>
31   - <block wx:if="{{items.payIntegral>0}}">
32   - <text>{{items.payIntegral+"积分"}}</text>
33   - </block>
34   - </view>
35   - <view class="content_ware_price">
36   - <text>{{"原价:¥"+items.giftPosPrice}}</text>
37   - </view>
38   - <view class="content_ware_time">
39   - <text>{{"活动时间:"+items.endTime}}</text>
40   - </view>
41   - </view>
  13 + </view>
  14 + <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index">
  15 + <view class="content_box">
  16 + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}">
  17 + <view class="content_box_img">
  18 + <image src="{{iurl+items.lbUrl}}" lazy-load="true"></image>
  19 + </view>
  20 + <view class="content_box_title">
  21 + <view class="content_ware_title">
  22 + <text bindtap="__e">{{items.giftTitle}}</text>
  23 + </view>
  24 + <view class="content_ware_type">
  25 + <block wx:if="{{items.payMoney>0}}">
  26 + <text>{{"¥"+items.payMoney}}</text>
  27 + </block>
  28 + <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}">
  29 + <text>/</text>
  30 + </block>
  31 + <block wx:if="{{items.payIntegral>0}}">
  32 + <view class="flex">
  33 + <text class="ellipsis-1">{{items.payIntegral}}</text>
  34 + <view>积分</view>
  35 + </view>
  36 + </block>
42 37 </view>
43   - <view class="content_box_button">
44   - <view class="box_button_remark">
45   - <text>{{"已售:"+items.giftQty+"件"}}</text>
46   - </view>
47   - <block wx:if="{{items.payMoney>0}}">
48   - <view class="box_button_buy" bindtap="GetBuyPrice" data-id="{{items.lbId}}">
49   - <button>立即购买</button>
50   - </view>
51   - </block>
52   - <block wx:if="{{items.payIntegral>0}}">
53   - <view class="box_button_dui" bindtap="GetBuyIntegral" data-id="{{items.lbId}}">
54   - <button>立即兑换</button>
55   - </view>
56   - </block>
  38 + <view class="content_ware_price">
  39 + <text class="ellipsis-1">{{"原价:¥"+items.giftPosPrice}}</text>
57 40 </view>
58   - </view>
59   - </block>
60   - <block wx:if="{{isEmpty==true && wareCard.length<2}}">
61   - <view class="foot_empty">
62   - <view>
63   - <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image>
  41 + <view class="content_ware_time">
  42 + <text class="ellipsis-1">{{"活动时间:"+items.endTime}}</text>
64 43 </view>
65   - <view>
66   - <text>当前暂无礼包</text>
  44 + </view>
  45 + </view>
  46 + <view class="content_box_button">
  47 + <view class="box_button_remark">
  48 + <text>{{"已售:"+items.giftQty+"件"}}</text>
  49 + </view>
  50 + <block wx:if="{{items.payMoney>0}}">
  51 + <view class="box_button_buy" bindtap="GetBuyPrice" data-id="{{items.lbId}}">
  52 + <button>立即购买</button>
67 53 </view>
68   - <view class="foot_empty_button">
69   - <text bindtap="__e">去获取</text>
  54 + </block>
  55 + <block wx:if="{{items.payIntegral>0}}">
  56 + <view class="box_button_dui" bindtap="GetBuyIntegral" data-id="{{items.lbId}}">
  57 + <button>立即兑换</button>
70 58 </view>
  59 + </block>
71 60 </view>
72   - </block>
73   - <view wx:if="{{is_read}}" class="foot_box">
74   - <text>———— 到底了 ————</text>
  61 + </view>
  62 + </block>
  63 + <block wx:if="{{isEmpty==true && wareCard.length<2}}">
  64 + <view class="foot_empty">
  65 + <view>
  66 + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image>
  67 + </view>
  68 + <view>
  69 + <text>当前暂无礼包</text>
  70 + </view>
  71 + <view class="foot_empty_button">
  72 + <text bindtap="__e">去获取</text>
  73 + </view>
75 74 </view>
76   -</view>
77   -<!-- 引入提示组件 -->
78   -<warn id="warn"></warn>
79   -<my_confirm id="my_confirm"></my_confirm>
80 75 \ No newline at end of file
  76 + </block>
  77 + <view wx:if="{{is_read}}" class="foot_box">
  78 + <text>———— 到底了 ————</text>
  79 + </view>
  80 + </view>
  81 + <!-- 引入提示组件 -->
  82 + <warn id="warn"></warn>
  83 + <my_confirm id="my_confirm"></my_confirm>
81 84 \ No newline at end of file
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -22,6 +22,7 @@ Page({
22 22 getUrl: '',
23 23 wareCard: [],
24 24 orderSn: "", //订单编号
  25 + lbId:""
25 26 },
26 27 onLoad: function(options) {
27 28 var th = this;
... ... @@ -46,79 +47,109 @@ Page({
46 47 giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img")
47 48 })
48 49 },
49   - GetBuyPrice: function() {
50   - var that = this;
51   - var th = this.data;
52   - uni.showModal({
53   - title: '',
54   - content: '是否确定购买该礼包',
55   - success: function success(res) {
56   - if (res.confirm) {
57   - getApp().request.post('/api/weshop/marketing/buy/receive/gift/record/insert', {
58   - data: {
59   - "actId": '', //活动Id
60   - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
61   - "buyType": '2', //1=积分兑换 2=余额购买
62   - "lbId": th.getGiftID, //礼包Id
63   - "storeId": th.getStorageID, //商家Id
64   - "userId": th.getUserID //用户ID
65   - },
66   - success: function success(res) {
67   - if (res.data.code == 0) {
68   - getApp().my_warnning("购买成功!", 0, that);
69   -
70   - } else {
71   - getApp().my_warnning(res.data.msg, 0, that);
72   - }
73   - }
74   - });
  50 + GetBuyPrice: function (e) {
  51 + var that = this.data;
  52 + var th = this;
  53 + // var id = e.currentTarget.dataset.id;//活动id
  54 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  55 + my_confirm.open(
  56 + "是否确定购买该礼包",
  57 + "取消",
  58 + "确定",
  59 + function () {
  60 + my_confirm.open_cancel(0);
  61 + },
  62 + function () {
  63 + my_confirm.open_cancel(0);
  64 + var json = {
  65 + "actId": '', //活动Id
  66 + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  67 + "buyType": '2', //1=积分兑换 2=余额购买
  68 + "lbId": that.getGiftID, //礼包Id
  69 + "storeId": that.getStorageID, //商家Id
  70 + "userId": that.getUserID, //用户ID
  71 + "buyFrom": 2
  72 + };
  73 + var data = JSON.stringify(json);
  74 + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
  75 + wx.request({
  76 + url: url,
  77 + data: data,
  78 + method: 'post',
  79 + header: {
  80 + 'content-type': 'application/json'
  81 + }, // 设置请求的 header
  82 + success: function (res) {
  83 + if (res.data.code == 0) {
  84 + res = res.data.data;
  85 + wx.requestPayment({
  86 + timeStamp: String(res.timeStamp),
  87 + nonceStr: res.nonceStr,
  88 + package: res.packageValue,
  89 + signType: res.signType,
  90 + paySign: res.paySign,
  91 + success: function (n) {
75 92  
76   - } else if (res.cancel) {
  93 + },
  94 + fail: function (n) {
  95 +
  96 + }
  97 + });
  98 + } else {
  99 + getApp().my_warnning(res.data.msg, 0, th);
  100 + }
  101 + }
  102 + })
77 103  
78   - }
79 104 }
80   - });
  105 +
  106 +
  107 + )
81 108  
82 109  
83 110 },
84   - GetBuyIntegral: function() {
  111 + GetBuyIntegral: function (e) {
85 112 var that = this.data;
86   - uni.showModal({
87   - title: '',
88   - content: '是否确定兑换该礼包',
89   - success: function success(res) {
90   - if (res.confirm) {
91   - getApp().request.promisepost('/api/weshop/marketing/buy/receive/gift/record/insert', {
92   - data: {
93   - "actId": '', //活动Id
94   - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
95   - "buyType": '1', //1=积分兑换 2=余额购买
96   - "lbId": that.getGiftID, //礼包Id
97   - "storeId": that.getStorageID, //商家Id
98   - "userId": that.getUserID //用户ID
99   - },
100   - success: function success(res) {
101   - if (res.data.code == 0) {
102   - // uni.showToast({
103   - // icon: 'none',
104   - // title: '兑换成功!'
105   - // });
106   - getApp().my_warnning("兑换成功!");
107   -
108   - } else {
109   - uni.showToast({
110   - icon: 'none',
111   - title: res.data.msg
112   - });
113   -
114   - }
  113 + var th = this;
  114 + // var id = e.currentTarget.dataset.id;//活动id
  115 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  116 + my_confirm.open(
  117 + "是否确定兑换该礼包",
  118 + "取消",
  119 + "确定",
  120 + function () {
  121 + my_confirm.open_cancel(0);
  122 + },
  123 + function () {
  124 + my_confirm.open_cancel(0);
  125 + var json = {
  126 + "actId": '', //活动Id
  127 + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
  128 + "buyType": '1', //1=积分兑换 2=余额购买
  129 + "lbId": that.getGiftID, //礼包Id
  130 + "storeId": that.getStorageID, //商家Id
  131 + "userId": that.getUserID //用户ID
  132 + };
  133 + var data = JSON.stringify(json);
  134 + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
  135 + wx.request({
  136 + url: url,
  137 + data: data,
  138 + method: 'post',
  139 + header: {
  140 + 'content-type': 'application/json'
  141 + }, // 设置请求的 header
  142 + success: function (res) {
  143 + if (res.data.code == 0) {
  144 + getApp().my_warnning("兑换成功!", 1, th);
  145 + } else {
  146 + getApp().my_warnning(res.data.msg, 0, th);
115 147 }
116   - });
  148 + }
  149 + })
117 150  
  151 + })
118 152  
119   - } else if (res.cancel) {}
120   - }
121   - });
122 153  
123 154 },
124 155 GetMyGiftList: function() {
... ... @@ -154,7 +185,8 @@ Page({
154 185 giftPrice: res.data.data.payMoney,
155 186 giftType: res.data.data.actType,
156 187 actTitle: res.data.data.actTitle,
157   - wareCard: res.data.data.wareCard
  188 + wareCard: res.data.data.wareCard,
  189 + lbId: res.data.data.lbId
158 190 })
159 191 } else {
160 192 getApp().my_warnning("系统繁忙,请稍后再试", 0, th);
... ... @@ -198,7 +230,7 @@ Page({
198 230 giftPrice: res.data.data.payMoney,
199 231 giftType: res.data.data.actType,
200 232 actTitle: res.data.data.actTitle,
201   - wareCard: res.data.data.wareCard
  233 + wareCard: res.data.data.wareCard,
202 234 })
203 235 } else {
204 236 getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2);
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
1 1 <view class="box data-v-3a5b7e36">
2   - <view class="box_top data-v-3a5b7e36">
3   - <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true"></image>
  2 + <view class="box_top data-v-3a5b7e36">
  3 + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true"></image>
  4 + </view>
  5 + <view class="box_title data-v-3a5b7e36">
  6 + <view class="top_title data-v-3a5b7e36">
  7 + <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text>
4 8 </view>
5   - <view class="box_title data-v-3a5b7e36">
6   - <view class="top_title data-v-3a5b7e36">
7   - <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text>
8   - </view>
9   - <view class="top_time data-v-3a5b7e36">
10   - <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text>
  9 + <view class="top_time data-v-3a5b7e36">
  10 + <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text>
  11 + </view>
  12 + <view class="top_price data-v-3a5b7e36">
  13 + <block wx:if="{{giftPrice>0}}">
  14 + <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text>
  15 + </block>
  16 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
  17 + <text class="data-v-3a5b7e36">/</text>
  18 + </block>
  19 + <block wx:if="{{giftIntegral>0}}">
  20 + <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text>
  21 + </block>
  22 + <block wx:if="{{giftType>0}}">
  23 + <text class="data-v-3a5b7e36">{{actTitle}}</text>
  24 + </block>
  25 + </view>
  26 + <view class="top_foot data-v-3a5b7e36">
  27 + <view class="top_foot_price data-v-3a5b7e36">
  28 + <text class="data-v-3a5b7e36">{{"原价:"+giftPosPrice+"元"}}</text>
  29 + </view>
  30 + <view class="top_foot_qty data-v-3a5b7e36">
  31 + <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text>
  32 + </view>
  33 + </view>
  34 + </view>
  35 + <view class="box_ware data-v-3a5b7e36">
  36 + <view class="box_ware_title data-v-3a5b7e36">
  37 + <text class="data-v-3a5b7e36">礼包内容</text>
  38 + </view>
  39 + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index">
  40 + <view class="box_ware_box data-v-3a5b7e36">
  41 + <view class="box_ware_img data-v-3a5b7e36">
  42 + <block wx:if="{{item.lbType==1}}">
  43 + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true"></image>
  44 + </block>
  45 + <block wx:if="{{item.lbType==2}}">
  46 + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
  47 + </block>
  48 + <block wx:if="{{item.lbType==3}}">
  49 + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
  50 + </block>
  51 + <block wx:if="{{item.lbType==4}}">
  52 + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
  53 + </block>
  54 + <block wx:if="{{item.lbType==5}}">
  55 + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
  56 + </block>
11 57 </view>
12   - <view class="top_price data-v-3a5b7e36">
13   - <block wx:if="{{giftPrice>0}}">
14   - <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text>
  58 + <view class="box_ware_item data-v-3a5b7e36">
  59 + <view class="box_ware_item_title data-v-3a5b7e36">
  60 + <text class="data-v-3a5b7e36">{{item.couponName}}</text>
  61 + </view>
  62 + <view class="box_ware_item_price data-v-3a5b7e36">
  63 + <text class="data-v-3a5b7e36"></text>
  64 + </view>
  65 + <view class="box_ware_item_qty data-v-3a5b7e36">
  66 + <text class="data-v-3a5b7e36">{{"数量:"+item.num}}</text>
  67 + </view>
  68 + <view class="box_ware_code data-v-3a5b7e36">
  69 + <block wx:if="{{isBuy==0&item.lbType==1}}">
  70 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="__e" class="data-v-3a5b7e36"></image>
15 71 </block>
16   - <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
17   - <text class="data-v-3a5b7e36">/</text>
  72 + <block wx:if="{{isBuy==0&item.lbType==2}}">
  73 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image>
18 74 </block>
19   - <block wx:if="{{giftIntegral>0}}">
20   - <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text>
  75 + <block wx:if="{{isBuy==0&item.lbType==3}}">
  76 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image>
21 77 </block>
22   - <block wx:if="{{giftType>0}}">
23   - <text class="data-v-3a5b7e36">{{actTitle}}</text>
  78 + <block wx:if="{{isBuy==0&item.lbType>3}}">
  79 + <text class="data-v-3a5b7e36">已自动到账</text>
24 80 </block>
  81 + </view>
25 82 </view>
26   - <view class="top_foot data-v-3a5b7e36">
27   - <view class="top_foot_price data-v-3a5b7e36">
28   - <text class="data-v-3a5b7e36">{{"原价:"+giftPosPrice+"元"}}</text>
29   - </view>
30   - <view class="top_foot_qty data-v-3a5b7e36">
31   - <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text>
32   - </view>
33   - </view>
  83 + </view>
  84 + </block>
  85 + </view>
  86 + <view class="foot_box data-v-3a5b7e36">
  87 + <view class="foot_box_title data-v-3a5b7e36">
  88 + <text class="data-v-3a5b7e36">活动说明</text>
34 89 </view>
35   - <view class="box_ware data-v-3a5b7e36">
36   - <view class="box_ware_title data-v-3a5b7e36">
37   - <text class="data-v-3a5b7e36">礼包内容</text>
38   - </view>
39   - <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index">
40   - <view class="box_ware_box data-v-3a5b7e36">
41   - <view class="box_ware_img data-v-3a5b7e36">
42   - <block wx:if="{{item.lbType==1}}">
43   - <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true"></image>
44   - </block>
45   - <block wx:if="{{item.lbType==2}}">
46   - <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
47   - </block>
48   - <block wx:if="{{item.lbType==3}}">
49   - <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
50   - </block>
51   - <block wx:if="{{item.lbType==4}}">
52   - <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
53   - </block>
54   - <block wx:if="{{item.lbType==5}}">
55   - <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image>
56   - </block>
57   - </view>
58   - <view class="box_ware_item data-v-3a5b7e36">
59   - <view class="box_ware_item_title data-v-3a5b7e36">
60   - <text class="data-v-3a5b7e36">{{item.couponName}}</text>
61   - </view>
62   - <view class="box_ware_item_price data-v-3a5b7e36">
63   - <text class="data-v-3a5b7e36"></text>
64   - </view>
65   - <view class="box_ware_item_qty data-v-3a5b7e36">
66   - <text class="data-v-3a5b7e36">{{"数量:"+item.num}}</text>
67   - </view>
68   - <view class="box_ware_code data-v-3a5b7e36">
69   - <block wx:if="{{isBuy==0&item.lbType==1}}">
70   - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="__e" class="data-v-3a5b7e36"></image>
71   - </block>
72   - <block wx:if="{{isBuy==0&item.lbType==2}}">
73   - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image>
74   - </block>
75   - <block wx:if="{{isBuy==0&item.lbType==3}}">
76   - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image>
77   - </block>
78   - <block wx:if="{{isBuy==0&item.lbType>3}}">
79   - <text class="data-v-3a5b7e36">已自动到账</text>
80   - </block>
81   - </view>
82   - </view>
83   - </view>
84   - </block>
  90 + <view class="foot_box_remark data-v-3a5b7e36">
  91 + <rich-text nodes="{{giftRemark}}"></rich-text>
85 92 </view>
86   - <view class="foot_box data-v-3a5b7e36">
87   - <view class="foot_box_title data-v-3a5b7e36">
88   - <text class="data-v-3a5b7e36">活动说明</text>
  93 + </view>
  94 + <view class="foot_empty data-v-3a5b7e36"></view>
  95 + <block wx:if="{{isBuy==1}}">
  96 + <view class="foot_button data-v-3a5b7e36">
  97 + <block wx:if="{{giftPrice>0&&giftIntegral>0}}">
  98 + <view class="foot_button_left data-v-3a5b7e36">
  99 + <text bindtap="GetBuyPrice" class="data-v-3a5b7e36" data-id="{{lbId}}">立即购买</text>
89 100 </view>
90   - <view class="foot_box_remark data-v-3a5b7e36">
91   - <rich-text nodes="{{giftRemark}}"></rich-text>
  101 + </block>
  102 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
  103 + <view class="foot_button_right data-v-3a5b7e36">
  104 + <text bindtap="GetBuyIntegral" class="data-v-3a5b7e36" data-id="{{lbId}}">立即兑换</text>
92 105 </view>
93   - </view>
94   - <view class="foot_empty data-v-3a5b7e36"></view>
95   - <block wx:if="{{isBuy==1}}">
96   - <view class="foot_button data-v-3a5b7e36">
97   - <block wx:if="{{giftPrice>0&&giftIntegral>0}}">
98   - <view class="foot_button_left data-v-3a5b7e36">
99   - <text bindtap="__e" class="data-v-3a5b7e36">立即购买</text>
100   - </view>
101   - </block>
102   - <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
103   - <view class="foot_button_right data-v-3a5b7e36">
104   - <text bindtap="__e" class="data-v-3a5b7e36">立即兑换</text>
105   - </view>
106   - </block>
107   - <block wx:if="{{giftPrice>0 && giftIntegral<=0}}">
108   - <view class="foot_button_buy data-v-3a5b7e36">
109   - <text bindtap="__e" class="data-v-3a5b7e36">立即购买</text>
110   - </view>
111   - </block>
112   - <block wx:if="{{giftPrice<=0 && giftIntegral>0}}">
113   - <view class="foot_button_intalge data-v-3a5b7e36">
114   - <text bindtap="__e" class="data-v-3a5b7e36">立即兑换</text>
115   - </view>
116   - </block>
  106 + </block>
  107 + <block wx:if="{{giftPrice>0 && giftIntegral<=0}}">
  108 + <view class="foot_button_buy data-v-3a5b7e36">
  109 + <text bindtap="GetBuyPrice" class="data-v-3a5b7e36" data-id="{{lbId}}">立即购买</text>
117 110 </view>
118   - </block>
119   - <block wx:if="{{isBuy==0}}">
120   - <view class="foot_button data-v-3a5b7e36">
121   - <view class="foot_button_buy data-v-3a5b7e36">
122   - <text bindtap="__e" class="data-v-3a5b7e36">立即使用</text>
123   - </view>
  111 + </block>
  112 + <block wx:if="{{giftPrice<=0 && giftIntegral>0}}">
  113 + <view class="foot_button_intalge data-v-3a5b7e36">
  114 + <text bindtap="GetBuyIntegral" class="data-v-3a5b7e36" data-id="{{lbId}}">立即兑换</text>
124 115 </view>
125   - </block>
  116 + </block>
  117 + </view>
  118 + </block>
  119 + <block wx:if="{{isBuy==0}}">
  120 + <view class="foot_button data-v-3a5b7e36">
  121 + <view class="foot_button_buy data-v-3a5b7e36">
  122 + <text bindtap="__e" class="data-v-3a5b7e36">立即使用</text>
  123 + </view>
  124 + </view>
  125 + </block>
126 126 </view>
127 127 <!-- 引入提示组件 -->
128 128 <warn id="warn"></warn>
... ...
pages/giftpack/mygiftpack/mygiftpack.js
... ... @@ -28,21 +28,25 @@ Page({
28 28 var th = this;
29 29 th.setData({
30 30 getStorageID: a.stoid,
31   - getUserID: d.user_id
  31 + getUserID: d.user_id,
  32 + pages: 1,
  33 + pageSize: 10,
  34 + loadingType: 0
32 35 })
  36 + th.getList();
33 37 },
34 38 onShow: function() {
35 39 // this.pages = 1;
36 40 // this.pageSize = 10;
37 41 // this.loadingType = 0;
38 42 // this.getList();
39   - var th = this;
40   - th.setData({
41   - pages: 1,
42   - pageSize: 10,
43   - loadingType: 0
44   - })
45   - th.getList();
  43 + // var th = this;
  44 + // th.setData({
  45 + // pages: 1,
  46 + // pageSize: 10,
  47 + // loadingType: 0
  48 + // })
  49 + // th.getList();
46 50 },
47 51 // methods: {
48 52 // BuyGift: function BuyGift() {
... ...
pages/giftpack/mygiftpack/mygiftpack.wxml
... ... @@ -14,7 +14,7 @@
14 14 </view>
15 15 <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index">
16 16 <view class="content_box">
17   - <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{item.lbId}}&orderSn={{item.orderSn}}">
  17 + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}">
18 18 <view class="content_box_img">
19 19 <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> -->
20 20 <image src="{{iurl+item.lbUrl}}" lazy-load="true"></image>
... ... @@ -81,8 +81,8 @@
81 81 </view>
82 82 </view>
83 83 </view>
84   - <view class="content_box_button">
85   - <button bindtap="__e">立即使用</button>
  84 + <view class="content_box_button" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}">
  85 + <button>立即使用</button>
86 86 </view>
87 87 </view>
88 88 </block>
... ...