Commit 446c8c3f5c59b92e5974404b15378d163d1f2483
1 parent
c8efca69
分享的添加俩个字段的优化
Showing
3 changed files
with
29 additions
and
19 deletions
packageA/pages/activity_share/activity_share.js
... | ... | @@ -159,7 +159,7 @@ Page({ |
159 | 159 | imageUrl: img, |
160 | 160 | }; |
161 | 161 | th.setData({share_hidden:1}); |
162 | - th.insert_act_share(title,lbid,6); | |
162 | + th.insert_act_share(title,lbid,6,null,th.data.hui_active.payMoney); | |
163 | 163 | return ob; |
164 | 164 | }else{ |
165 | 165 | //---秒杀,拼团,促销--- |
... | ... | @@ -193,9 +193,9 @@ Page({ |
193 | 193 | //插入活动 |
194 | 194 | if(item.prom_type==3){ |
195 | 195 | var hui_active=this.data.hui_active; |
196 | - th.insert_act_share(hui_active.name,hui_active.id,5); | |
196 | + th.insert_act_share(hui_active.name,hui_active.id,5,item.goods_sn,price); | |
197 | 197 | }else{ |
198 | - th.insert_act_share(item.title,item.id,ind); | |
198 | + th.insert_act_share(item.title,item.id,ind,item.goods_sn,price); | |
199 | 199 | } |
200 | 200 | |
201 | 201 | return ob; |
... | ... | @@ -220,7 +220,7 @@ Page({ |
220 | 220 | if(th.data.currentIndex==2){ ind=5;} |
221 | 221 | |
222 | 222 | //插入活动 |
223 | - th.insert_act_share(title,hui_active.id,ind); | |
223 | + th.insert_act_share(title,hui_active.id,ind,null,null); | |
224 | 224 | return ob; |
225 | 225 | } |
226 | 226 | } |
... | ... | @@ -546,14 +546,17 @@ Page({ |
546 | 546 | if(that.data.currentIndex==1){ |
547 | 547 | ind=4; |
548 | 548 | } |
549 | - | |
549 | + | |
550 | + //-- 价格 -- | |
551 | + var pri0 = th.data.share_good.shop_price; | |
552 | + if (th.data.share_good.price) | |
553 | + pri0 = th.data.share_good.price; | |
550 | 554 | if(th.data.share_good.prom_type==3){ |
551 | - th.insert_act_share(th.data.hui_active.name,th.data.hui_active.id,5); //插入分享 | |
555 | + th.insert_act_share(th.data.hui_active.name,th.data.hui_active.id,5,th.data.share_good.goods_sn,pri0); //插入分享 | |
552 | 556 | }else{ |
553 | - th.insert_act_share(th.data.share_good.title,th.data.share_good.id,ind); //插入分享 | |
557 | + th.insert_act_share(th.data.share_good.title,th.data.share_good.id,ind,th.data.share_good.goods_sn,pri0); //插入分享 | |
554 | 558 | } |
555 | - | |
556 | - | |
559 | + | |
557 | 560 | ///二微码 |
558 | 561 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
559 | 562 | os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; |
... | ... | @@ -624,9 +627,7 @@ Page({ |
624 | 627 | context.setFillStyle("red") |
625 | 628 | context.fillText("¥", 416 * unit, 185 * unit); |
626 | 629 | context.setFontSize(31 * unit) |
627 | - var pri0 = th.data.share_good.shop_price; | |
628 | - if (th.data.share_good.price) | |
629 | - pri0 = th.data.share_good.price; | |
630 | + | |
630 | 631 | |
631 | 632 | pri0 = parseFloat(pri0).toFixed(2); |
632 | 633 | context.fillText(pri0, 438 * unit, 185 * unit); |
... | ... | @@ -1136,7 +1137,7 @@ Page({ |
1136 | 1137 | }, |
1137 | 1138 | |
1138 | 1139 | //-- 推送活动分享 -- |
1139 | - insert_act_share:function(title,actid,ind){ | |
1140 | + insert_act_share:function(title,actid,ind,ShareActNo,ActMoney){ | |
1140 | 1141 | var th = this; |
1141 | 1142 | var url="/api/weshop/sharetypeList/save"; |
1142 | 1143 | var req_data={ |
... | ... | @@ -1149,6 +1150,11 @@ Page({ |
1149 | 1150 | shareTime:ut.gettimestamp(), |
1150 | 1151 | storeId:os.stoid |
1151 | 1152 | } |
1153 | + | |
1154 | + if(!ShareActNo) ShareActNo=actid; //如果没有带编号就带活动id | |
1155 | + if(ActMoney) req_data.ActMoney=ActMoney; //如果金额就要把参数带入 | |
1156 | + req_data.ShareActNo=ShareActNo; | |
1157 | + | |
1152 | 1158 | //插入数据 |
1153 | 1159 | getApp().request.post(url,{ |
1154 | 1160 | data:req_data, |
... | ... | @@ -1164,8 +1170,8 @@ Page({ |
1164 | 1170 | data:req_data, |
1165 | 1171 | success:function(){} |
1166 | 1172 | }) |
1167 | - | |
1168 | - | |
1173 | + | |
1174 | + | |
1169 | 1175 | } |
1170 | 1176 | |
1171 | 1177 | ... | ... |
packageA/pages/live_share/live_share.js
packageA/pages/quan/quan.js
... | ... | @@ -87,7 +87,7 @@ Page({ |
87 | 87 | path:url, |
88 | 88 | }; |
89 | 89 | th.setData({share_hidden:1}); |
90 | - th.insert_quan_share(title,th.data.hui_active.id); | |
90 | + th.insert_quan_share(title,th.data.hui_active.id,th.data.hui_active.money); | |
91 | 91 | |
92 | 92 | return ob; |
93 | 93 | }, |
... | ... | @@ -179,7 +179,7 @@ Page({ |
179 | 179 | }, |
180 | 180 | |
181 | 181 | //-- 推送活动分享 -- |
182 | - insert_quan_share:function(title,actid){ | |
182 | + insert_quan_share:function(title,actid,price){ | |
183 | 183 | var th = this; |
184 | 184 | var url="/api/weshop/sharetypeList/save"; |
185 | 185 | var req_data={ |
... | ... | @@ -190,8 +190,11 @@ Page({ |
190 | 190 | shareStaffId:th.data.StaffId, |
191 | 191 | shareStorageId:th.data.StorageId, |
192 | 192 | shareTime:ut.gettimestamp(), |
193 | - storeId:os.stoid | |
193 | + storeId:os.stoid, | |
194 | + ShareActNo:actid, | |
195 | + ActMoney:price | |
194 | 196 | } |
197 | + | |
195 | 198 | //插入数据 |
196 | 199 | getApp().request.post(url,{ |
197 | 200 | data:req_data, | ... | ... |