Commit 31389cb994b3f4fcc23da584cd042fd20d96a19d

Authored by yvan.ni
1 parent 1cbcb3dd

直播~~

pages/goods/goodsInfo/goodsInfo.js
... ... @@ -272,6 +272,9 @@ Page({
272 272 prom_type = t.prom_type,
273 273 prom_id = t.prom_id; //活动ID
274 274  
  275 + var share_openid= t.share_openid;
  276 +
  277 +
275 278 self = this;
276 279  
277 280 //检查测肤
... ... @@ -370,6 +373,10 @@ Page({
370 373 //如果是会员分享过来的要记录
371 374 if (room_user_share)
372 375 getApp().globalData.room_user_share = room_user_share;
  376 +
  377 + if(share_openid){
  378 + this.get_room_share_guide(share_openid);
  379 + }
373 380 }
374 381  
375 382 var c_guide_id = t.c_guide_id;
... ... @@ -532,6 +539,34 @@ Page({
532 539 },
533 540  
534 541  
  542 + async get_room_share_guide(share_openid){
  543 +
  544 + var url="/api/weshop/users/page";
  545 + var first_leader=0;
  546 +
  547 + //调用接口判断是不是会员
  548 + await getApp().request.promiseGet(url, {
  549 + data:{stoid:os.stoid,weapp_openid:share_openid}
  550 + }).then(res => {
  551 + if (ut.ajax_ok(res)) {
  552 + first_leader=res.data.data.pageData[0].user_id;
  553 + getApp().globalData.guide_id = res.data.data.id;
  554 + }
  555 + })
  556 +
  557 + if(!first_leader) return false;
  558 +
  559 + getApp().globalData.first_leader = first_leader;
  560 +
  561 + //调用接口判断是不是会员
  562 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  563 + if (res.data.code == 0) {
  564 + getApp().globalData.guide_id = res.data.data.id;
  565 + }
  566 + })
  567 +
  568 + },
  569 +
535 570 //--- 设置一下默认库存的数量 ----
536 571 set_def_storage(ee) {
537 572 var that = this, th = this;
... ... @@ -5052,25 +5087,25 @@ Page({
5052 5087 context.setFillStyle('#f2f1f6');
5053 5088 context.rect(0, 0, 554 * unit, 899 * unit);
5054 5089 context.fill();
5055   -
  5090 +
5056 5091 // 2.商城名称
5057 5092 let shopName = this.data.sto_sele_name_1;
5058 5093 context.setTextAlign('center');
5059 5094 context.setFontSize(26 * unit);
5060 5095 context.setFillStyle('black');
5061 5096 context.fillText(shopName, 277 * unit, 60 * unit);
5062   -
  5097 +
5063 5098 // 3.推荐来源
5064 5099 let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
5065 5100 context.setTextAlign('center');
5066 5101 context.setFontSize(22 * unit);
5067 5102 context.setFillStyle('#96959a');
5068 5103 context.fillText(fromText, 277 * unit, 105 * unit);
5069   -
  5104 +
5070 5105 // 4.海报背景
5071 5106 context.setFillStyle('white');
5072 5107 context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
5073   -
  5108 +
5074 5109 // 5.商品图片
5075 5110 // 图片的x坐标
5076 5111 let bg_x = 37 * unit
... ... @@ -5092,88 +5127,107 @@ Page({
5092 5127 context.clip()
5093 5128 context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
5094 5129 context.restore();
5095   -
  5130 +
5096 5131 // 6.强烈推荐
5097   - let src = '';
5098   - context.beginPath();
5099   - if(type == 0) { // 普通
5100   - src = '../../../images/share/q_tj.png';
5101   - context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit);
5102   - context.setFontSize(16 * unit)
5103   - context.setFillStyle("white")
5104   - context.setTextAlign('left');
5105   - context.fillText('强烈推荐', 64 * unit, 668 * unit);
5106   - };
5107   - if(type == 1) { // 秒杀
5108   - src = '../../../images/share/miao_share.png';
5109   - context.drawImage(src, 54 * unit, 648 * unit, 200 * unit, 36 * unit);
5110   - context.setTextAlign('left');
5111   - };
5112   - if(type == 2) { // 商家和会员团
5113   - src = '../../../images/share/ct_num.png';
5114   - context.drawImage(src, 54 * unit, 648 * unit, 120 * unit, 30 * unit);
5115   - context.setTextAlign('left');
5116   -
5117   - let ct_num = self.data.prom_act.ct_num;
5118   - context.setFontSize(16 * unit)
5119   - context.font = 'normal';
5120   - context.setFillStyle("red")
5121   - if (ct_num < 10) {
5122   - context.fillText(ct_num + "人拼团", 100 * unit, 670 * unit);
5123   - } else {
5124   - context.fillText(ct_num + "人拼团", 96 * unit, 670 * unit);
5125   - }
5126   - context.setFontSize(22 * unit)
5127   - context.fillText("已拼" + self.data.prom_act.buy_num + "份", 186 * unit, 672 * unit);
5128   - };
5129   - if(type == 3) { // 阶梯团
5130   - let list = self.data.prom_act.ct_rylist;
5131   - for (let i = 0; i < list.length; i++) {
5132   - let item = list[i];
5133   - let wi = i * 90 * unit;
5134   - context.font = 'normal';
5135   - context.setTextAlign('left');
5136   - context.setFontSize(16 * unit)
5137   - context.setFillStyle("red")
5138   - context.fillText("¥", 50 * unit + wi, 680 * unit);
5139   - context.setFontSize(22 * unit)
5140   - let pri = parseFloat(item.price).toFixed(2);
5141   - context.fillText(pri, 66 * unit + wi, 680 * unit);
5142   - context.setFillStyle("gray")
5143   - context.fillText("满" + item.rynum + "人", 50 * unit + wi, 716 * unit);
5144   - }
5145   - };
5146   -
  5132 + let src = '';
  5133 + context.beginPath();
  5134 + if (type == 0) { // 普通
  5135 + src = '../../../images/share/q_tj.png';
  5136 + context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit);
  5137 + context.setFontSize(16 * unit)
  5138 + context.setFillStyle("white")
  5139 + context.setTextAlign('left');
  5140 + context.fillText('强烈推荐', 64 * unit, 668 * unit);
  5141 + }
  5142 +
  5143 + if (type == 1) { // 秒杀
  5144 + src = '../../../images/share/miao_share.png';
  5145 + context.drawImage(src, 54 * unit, 648 * unit, 200 * unit, 36 * unit);
  5146 + context.setTextAlign('left');
  5147 + }
  5148 +
  5149 + if (type == 2) { // 商家和会员团
  5150 + src = '../../../images/share/ct_num.png';
  5151 + context.drawImage(src, 54 * unit, 648 * unit, 120 * unit, 30 * unit);
  5152 + context.setTextAlign('left');
  5153 +
  5154 + let ct_num = self.data.prom_act.ct_num;
  5155 + context.setFontSize(16 * unit)
  5156 + context.font = 'normal';
  5157 + context.setFillStyle("red")
  5158 + if (ct_num < 10) {
  5159 + context.fillText(ct_num + "人拼团", 100 * unit, 670 * unit);
  5160 + } else {
  5161 + context.fillText(ct_num + "人拼团", 96 * unit, 670 * unit);
  5162 + }
  5163 + context.setFontSize(22 * unit)
  5164 + context.fillText("已拼" + self.data.prom_act.buy_num + "份", 186 * unit, 672 * unit);
  5165 + }
  5166 +
  5167 + if (type == 3) { // 阶梯团
  5168 + let list = self.data.prom_act.ct_rylist;
  5169 + for (let i = 0; i < list.length; i++) {
  5170 + let item = list[i];
  5171 + let wi = i * 90 * unit;
  5172 + context.font = 'normal';
  5173 + context.setTextAlign('left');
  5174 + context.setFontSize(16 * unit)
  5175 + context.setFillStyle("red")
  5176 + context.fillText("¥", 50 * unit + wi, 680 * unit);
  5177 + context.setFontSize(22 * unit)
  5178 + let pri = parseFloat(item.price).toFixed(2);
  5179 + context.fillText(pri, 66 * unit + wi, 680 * unit);
  5180 +
  5181 + var wp= 62 * unit + wi+ ut.measureText('¥' + pri, 32 * unit);
  5182 + var hp=735 * unit
  5183 + self.draw_pos_price(context,wp,hp,self.data.data.market_price,unit);
  5184 +
  5185 + context.setFillStyle("gray")
  5186 + context.fillText("满" + item.rynum + "人", 50 * unit + wi, 716 * unit);
  5187 + }
  5188 + }
  5189 +
  5190 +
5147 5191 // 7.商品价格
5148   - if(type != 3) {
5149   - let price = this.data.data.shop_price;
5150   - if (this.data.card_field && this.data.data[this.data.card_field]) {
5151   - price = this.data.data[this.data.card_field];
5152   - }
5153   - if (this.data.prom_act) price = this.data.prom_price;
5154   - price = parseFloat(price).toFixed(2);
5155   - context.setFontSize(32 * unit);
5156   - context.setFillStyle('#DE1117');
5157   - if (this.data.prom_type == 4 && this.data.prom_integral){
5158   - context.fillText(this.data.prom_integral+'积分+¥' + price, 54 * unit, 735 * unit);
5159   - }else{
5160   - context.fillText('¥' + price, 54 * unit, 735 * unit);
5161   - }
5162   -
  5192 + if (type != 3) {
  5193 + let price = this.data.data.shop_price;
  5194 + if (this.data.card_field && this.data.data[this.data.card_field]) {
  5195 + price = this.data.data[this.data.card_field];
  5196 + }
  5197 + if (this.data.prom_act) price = this.data.prom_price;
  5198 + price = parseFloat(price).toFixed(2);
  5199 + context.setFontSize(32 * unit);
  5200 + context.setFillStyle('#DE1117');
  5201 + if (this.data.prom_type == 4 && this.data.prom_integral) {
  5202 + context.fillText(this.data.prom_integral + '积分+¥' + price, 54 * unit, 735 * unit);
  5203 +
  5204 + var wp= 62 * unit+ut.measureText(this.data.prom_integral + '积分+¥' + price, 32 * unit);
  5205 + var hp=735 * unit
  5206 + this.draw_pos_price(context,wp,hp,this.data.data.market_price,unit);
  5207 +
  5208 + } else {
  5209 + context.fillText('¥' + price, 54 * unit, 735 * unit);
  5210 +
  5211 + var wp= 62 * unit+ut.measureText('¥' + price, 32 * unit);
  5212 + var hp=735 * unit
  5213 + this.draw_pos_price(context,wp,hp,this.data.data.market_price,unit);
  5214 +
  5215 + }
  5216 +
  5217 +
  5218 + }
  5219 +
  5220 + // 8.商品标题
  5221 + context.setFontSize(20 * unit);
  5222 + context.setFillStyle('#898989');
  5223 + getApp().draw_Text(context, this.data.data.goods_name, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1);
5163 5224  
5164   - };
5165   -
5166   - // 8.商品标题
5167   - context.setFontSize(20 * unit);
5168   - context.setFillStyle('#898989');
5169   - getApp().draw_Text(context, this.data.data.goods_name, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1);
5170   -
5171 5225 // 9.小程序码
5172 5226 context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
5173 5227 context.setFontSize(16 * unit);
5174 5228 context.setFillStyle('#777');
5175 5229 context.fillText('长按识别二维码', 378 * unit, 810 * unit);
5176   -
  5230 +
5177 5231 // 10.竖线
5178 5232 context.beginPath();
5179 5233 context.setFillStyle('#eee');
... ... @@ -5181,6 +5235,27 @@ Page({
5181 5235 context.fill();
5182 5236 },
5183 5237  
  5238 + //---市场价划掉---
  5239 + draw_pos_price(context,w,h,market_price,unit){
  5240 +
  5241 + if(!this.data.sys_switch) return false;
  5242 + if(!this.data.sys_switch.is_retail_price) return false;
  5243 +
  5244 + context.setFillStyle("gray")
  5245 + context.setFontSize(22 * unit)
  5246 + var pri0 = "¥" + market_price.toFixed(2);
  5247 + context.fillText(pri0, w, h);
  5248 +
  5249 + var c_h=h-6;
  5250 + context.setStrokeStyle('gray');
  5251 + context.setLineWidth(1 * unit);
  5252 + context.moveTo(w - 5, c_h);
  5253 + context.lineTo(w + ut.measureText(pri0, 22 * unit) + 5, c_h);
  5254 + context.stroke();
  5255 +
  5256 + },
  5257 +
  5258 +
5184 5259  
5185 5260 //--定义的保存图片方法,分享团---
5186 5261 saveImageToPhotosAlbum: function () {
... ... @@ -5267,10 +5342,10 @@ Page({
5267 5342 // var erm_x = parseFloat(th.data.poster.ewm_x) * 2;
5268 5343 // var erm_y = parseFloat(th.data.poster.ewm_y) * 2;
5269 5344 // context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit);
5270   - // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  5345 +
5271 5346 };
5272 5347  
5273   - // th.drawPoster(context, unit, th.data.share_goods_img, vpath);
  5348 +
5274 5349  
5275 5350  
5276 5351 //-- 是自定义海报的情况下 --
... ... @@ -5347,30 +5422,44 @@ Page({
5347 5422 pri0 = th.data.prom_price;
5348 5423 pri0 = parseFloat(pri0).toFixed(2);
5349 5424 var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25;
5350   - context.fillText("¥", wd1 - 15, 185 * unit);
  5425 +
  5426 + if(th.data.prom_type!=4)
  5427 + context.fillText("¥", wd1 - 15, 185 * unit);
  5428 +
5351 5429 context.setFontSize(31 * unit)
5352   - // if(th.data.prom_type==4){
5353   - // context.fillText(th.data.prom_integral+'积分'+pri0, wd1, 185 * unit);
5354   - // }else{
5355   - // context.fillText(pri0, wd1, 185 * unit);
5356   - // }
5357   - context.fillText(pri0, wd1, 185 * unit);
  5430 + var pri_str=pri0;
  5431 + if(th.data.prom_type==4){
  5432 + pri_str='';
5358 5433  
  5434 + if(th.data.prom_integral) pri_str=th.data.prom_integral+'积分';
  5435 + if (pri0 && th.data.prom_integral) {
  5436 + pri_str += "+";
  5437 + }
  5438 + if (pri0) {
  5439 + pri_str += pri0;
  5440 + }
  5441 +
  5442 + wd1 = th.data.screenWidth - ut.measureText(pri_str, 31 * unit) - 20;
  5443 + }
  5444 + context.fillText(pri_str, wd1, 185 * unit);
5359 5445 //---市场价划掉---
5360   - /*--
5361   - context.setFillStyle("gray")
5362   - context.setFontSize(22 * unit)
5363   - pri0 = "¥" + th.data.data.market_price.toFixed(2);
5364   - var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25;
5365   - context.fillText(pri0, wd2, 213 * unit);
5366   -
5367   - context.setStrokeStyle('gray');
5368   - context.setLineWidth(1 * unit);
5369   - context.moveTo(wd2 - 5, 206 * unit);
5370   - context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
5371   - context.stroke();--*/
5372   -
5373   - } else if ( ( type == 4 && type != 0 && type != 1 && type != 2 && type != 3)) {
  5446 + // context.setFillStyle("gray")
  5447 + // context.setFontSize(22 * unit)
  5448 + // pri0 = "¥" + th.data.data.market_price.toFixed(2);
  5449 + // var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25;
  5450 + // context.fillText(pri0, wd2, 213 * unit);
  5451 + //
  5452 + // context.setStrokeStyle('gray');
  5453 + // context.setLineWidth(1 * unit);
  5454 + // context.moveTo(wd2 - 5, 206 * unit);
  5455 + // context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
  5456 + // context.stroke();
  5457 +
  5458 + var wp= 62 * unit + wi+ ut.measureText(pri_str, 32 * unit);
  5459 + var hp=735 * unit
  5460 + th.draw_pos_price(context,wp,hp,self.data.data.market_price,unit);
  5461 +
  5462 + } else if (type == 4 ) {
5374 5463 context.setFillStyle("black");
5375 5464 context.setFontSize(21.3 * unit)
5376 5465 getApp().draw_Text(context, share_title,
... ... @@ -5395,31 +5484,51 @@ Page({
5395 5484 context.setFillStyle("red");
5396 5485 context.fillText(text, 38 * unit, 235 * unit);
5397 5486  
  5487 + //---市场价划掉---
  5488 + // context.setFillStyle("gray")
  5489 + // context.setFontSize(22 * unit)
  5490 + // pri0 = "¥" + th.data.data.market_price.toFixed(2);
  5491 + // var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25;
  5492 + // context.fillText(pri0, wd2, 213 * unit);
  5493 + //
  5494 + // context.setStrokeStyle('gray');
  5495 + // context.setLineWidth(1 * unit);
  5496 + // context.moveTo(wd2 - 5, 206 * unit);
  5497 + // context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit);
  5498 + // context.stroke();
  5499 +
  5500 +
  5501 +
  5502 + var wp= 62 * unit + wi+ ut.measureText(text, 32 * unit);
  5503 + var hp=735 * unit
  5504 + th.draw_pos_price(context,wp,hp,self.data.data.market_price,unit);
  5505 +
  5506 +
5398 5507 }
5399 5508  
5400 5509 //---中间大图---
5401 5510 if ( th.data.share_b_img || (type != 0 && type != 1 && type != 2 && type != 3)) {
5402   - context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit);
  5511 + context.drawImage(th.data.share_goods_img, 70 * unit, 240 * unit, 408 * unit, 408 * unit);
5403 5512 }
5404   - ;
  5513 +
5405 5514  
5406 5515 //---自定义海报 产品质量保证
5407   - if(th.data.share_b_img && th.data.poster.show_quality==1 ){
  5516 + if(th.data.share_b_img && th.data.poster.show_quality==1 && type!=4){
5408 5517 var g_path = "../../../images/share/s_gou.png";
5409   - context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  5518 + context.drawImage(g_path, 56 * unit, 650 * unit, 22 * unit, 22 * unit);
5410 5519 context.setFillStyle("red")
5411 5520 context.setFontSize(18 * unit)
5412   - context.fillText("正品保证", 84 * unit, 690 * unit);
  5521 + context.fillText("正品保证", 84 * unit, 670 * unit);
5413 5522  
5414   - context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  5523 + context.drawImage(g_path, 218 * unit, 650 * unit, 22 * unit, 22 * unit);
5415 5524 context.setFillStyle("red")
5416 5525 context.setFontSize(18 * unit)
5417   - context.fillText("纯实体店", 246 * unit, 690 * unit);
  5526 + context.fillText("纯实体店", 246 * unit, 670 * unit);
5418 5527  
5419   - context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  5528 + context.drawImage(g_path, 388 * unit, 650 * unit, 22 * unit, 22 * unit);
5420 5529 context.setFillStyle("red")
5421 5530 context.setFontSize(18 * unit)
5422   - context.fillText("官方验证", 420 * unit, 690 * unit);
  5531 + context.fillText("官方验证", 420 * unit, 670 * unit);
5423 5532  
5424 5533 }
5425 5534 //-------大图后面就不一样了-----------
... ... @@ -5447,6 +5556,26 @@ Page({
5447 5556 context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit);
5448 5557 break;//普通商品的展示
5449 5558 case 4:
  5559 +
  5560 + if(th.data.share_b_img && th.data.poster.show_quality==1 && type!=4){
  5561 + var g_path = "../../../images/share/s_gou.png";
  5562 + context.drawImage(g_path, 56 * unit, 660 * unit, 22 * unit, 22 * unit);
  5563 + context.setFillStyle("red")
  5564 + context.setFontSize(18 * unit)
  5565 + context.fillText("正品保证", 84 * unit, 680 * unit);
  5566 +
  5567 + context.drawImage(g_path, 218 * unit, 660 * unit, 22 * unit, 22 * unit);
  5568 + context.setFillStyle("red")
  5569 + context.setFontSize(18 * unit)
  5570 + context.fillText("纯实体店", 246 * unit, 680 * unit);
  5571 +
  5572 + context.drawImage(g_path, 388 * unit, 660 * unit, 22 * unit, 22 * unit);
  5573 + context.setFillStyle("red")
  5574 + context.setFontSize(18 * unit)
  5575 + context.fillText("官方验证", 420 * unit, 680 * unit);
  5576 + }
  5577 +
  5578 +
5450 5579 // 中间的几个字
5451 5580 if (th.data.poster && parseInt(th.data.poster.style) == 2) {
5452 5581 if (parseInt(th.data.poster.show_quality)) {
... ... @@ -5524,7 +5653,7 @@ Page({
5524 5653 //---二维吗图---
5525 5654 context.drawImage(vpath, 390 * unit, 726 * unit, 136 * unit, 136 * unit);
5526 5655 }
5527   - ;
  5656 +
5528 5657  
5529 5658 break;
5530 5659 case 1: //秒杀商品的展示
... ... @@ -5533,8 +5662,8 @@ Page({
5533 5662 }
5534 5663 //---画线---
5535 5664 context.setLineWidth(1 * unit)
5536   - context.moveTo(32 * unit, 670 * unit)
5537   - context.lineTo(520 * unit, 670 * unit)
  5665 + context.moveTo(32 * unit, 690 * unit)
  5666 + context.lineTo(520 * unit, 690 * unit)
5538 5667 context.stroke();
5539 5668  
5540 5669 //画秒杀的图片
... ... @@ -5569,8 +5698,8 @@ Page({
5569 5698 }
5570 5699 //---画线---
5571 5700 context.setLineWidth(1 * unit)
5572   - context.moveTo(32 * unit, 670 * unit)
5573   - context.lineTo(520 * unit, 670 * unit)
  5701 + context.moveTo(32 * unit, 690 * unit)
  5702 + context.lineTo(520 * unit, 690 * unit)
5574 5703 context.stroke();
5575 5704 //---文字---
5576 5705 context.setFillStyle("black")
... ... @@ -5617,8 +5746,8 @@ Page({
5617 5746 }
5618 5747 //---画线---
5619 5748 context.setLineWidth(1 * unit)
5620   - context.moveTo(32 * unit, 670 * unit)
5621   - context.lineTo(520 * unit, 670 * unit)
  5749 + context.moveTo(32 * unit, 690 * unit)
  5750 + context.lineTo(520 * unit, 690 * unit)
5622 5751 context.stroke();
5623 5752 //---文字---
5624 5753 context.setFillStyle("black")
... ... @@ -5739,7 +5868,6 @@ Page({
5739 5868 }
5740 5869  
5741 5870 }
5742   - ;
5743 5871  
5744 5872  
5745 5873 //把画板内容绘制成图片,并回调 画板图片路径
... ... @@ -5835,17 +5963,17 @@ Page({
5835 5963 videoContext.play();
5836 5964 }, 500)
5837 5965  
5838   - },
  5966 + },
5839 5967  
5840 5968 //加载更多是靠这个函数
5841 5969 onReachBottom: function () {
5842   - if (this.data.activeCategoryId == 2) {
5843   - if (!this.data.comments_no_more) this.requestComments_new();
5844   - }
  5970 + if (this.data.activeCategoryId == 2) {
  5971 + if (!this.data.comments_no_more) this.requestComments_new();
  5972 + }
5845 5973  
5846   - var goods_list = this.selectComponent("#goods_list"); //组件的id
5847   - if (goods_list) goods_list.get_list();
5848   - },
  5974 + var goods_list = this.selectComponent("#goods_list"); //组件的id
  5975 + if (goods_list) goods_list.get_list();
  5976 + },
5849 5977  
5850 5978 //--获取头像的本地缓存,回调写法--
5851 5979 get_head_temp: function (tt, func) {
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -125,7 +125,7 @@
125 125 <view class="fs50 val">{{prom_price}}</view>
126 126 </view>
127 127  
128   - <view wx:if="is_retail_price" class="word-line fs20 xc-qtunit-price">零售价:¥{{filters.toFix(data.market_price,2)}}</view>
  128 + <view wx:if="{{is_retail_price}}" class="word-line fs20 xc-qtunit-price">零售价:¥{{filters.toFix(data.market_price,2)}}</view>
129 129 <view wx:else class="word-line fs20 xc-qtunit-price">¥{{filters.toFix(data.shop_price,2)}}</view>
130 130 </view>
131 131  
... ... @@ -312,26 +312,12 @@
312 312 <view wx:if="{{is_retail_price}}" class='yj' style="top:35rpx">
313 313 <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>
314 314 </view>
315   -
316   - <view wx:else class='yj' style="top:35rpx">
317   - <text>¥{{filters.toFix(data.shop_price,2)}}</text>
318   - </view>
  315 +<!-- <view wx:else class='yj' style="top:35rpx">-->
  316 +<!-- <text>¥{{filters.toFix(data.shop_price,2)}}</text>-->
  317 +<!-- </view>-->
319 318  
320 319 </block>
321   - <block wx:elif="{{prom_type!=2}}">
322   -
323 320  
324   - <text class="yuan">¥</text>
325   - {{filters.toFix(data.shop_price,2)}}
326   - <view wx:if="{{is_retail_price}}" class='yj'>
327   - <text>零售价:¥{{filters.toFix(data.market_price,2)}}</text>
328   - </view>
329   -
330   - <view wx:else class='yj'>
331   - <text>¥{{filters.toFix(data.shop_price,2)}}</text>
332   - </view>
333   -
334   - </block>
335 321 </view>
336 322 </view>
337 323 <!-- 这个是分享按钮 -->
... ...
pages/index/index/index.js
... ... @@ -230,7 +230,11 @@ Page({
230 230 }
231 231 })
232 232  
233   -
  233 +
  234 + var share_openid= tt.share_openid;
  235 + if(share_openid){
  236 + this.get_room_share_guide(share_openid);
  237 + }
234 238  
235 239 //调用底部导航
236 240 //getApp().globalData.url=th.data.url
... ... @@ -238,6 +242,36 @@ Page({
238 242  
239 243 },
240 244  
  245 +
  246 + async get_room_share_guide(share_openid){
  247 +
  248 + var url="/api/weshop/users/page";
  249 + var first_leader=0;
  250 +
  251 + //调用接口判断是不是会员
  252 + await getApp().request.promiseGet(url, {
  253 + data:{stoid:os.stoid,weapp_openid:share_openid}
  254 + }).then(res => {
  255 + if (ut.ajax_ok(res)) {
  256 + first_leader=res.data.data.pageData[0].user_id;
  257 + getApp().globalData.guide_id = res.data.data.id;
  258 + }
  259 + })
  260 +
  261 + if(!first_leader) return false;
  262 +
  263 + getApp().globalData.first_leader = first_leader;
  264 +
  265 + //调用接口判断是不是会员
  266 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  267 + if (res.data.code == 0) {
  268 + getApp().globalData.guide_id = res.data.data.id;
  269 + }
  270 + })
  271 +
  272 + },
  273 +
  274 +
241 275 async onload_init() {
242 276 var th = this;
243 277 await this.init_load();
... ...