Commit 680695c80d33e00d1477a0da8ce861ebafacfbb2
1 parent
64a7bda6
商品详情视频播放的优化
Showing
3 changed files
with
71 additions
and
6 deletions
app.js
| @@ -51,7 +51,7 @@ App({ | @@ -51,7 +51,7 @@ App({ | ||
| 51 | config: null, //门店参数 | 51 | config: null, //门店参数 |
| 52 | config2: null, //门店配置 | 52 | config2: null, //门店配置 |
| 53 | code: null, | 53 | code: null, |
| 54 | - user_id:null,//6520390,//6520352 | 54 | + user_id:null,//15240065,//6520352,//6520390,//6520352 |
| 55 | // user_id:6520314,// qa-6519858,// | 55 | // user_id:6520314,// qa-6519858,// |
| 56 | // user_id:14148118,// qa-6519858,// | 56 | // user_id:14148118,// qa-6519858,// |
| 57 | buy_now: null, | 57 | buy_now: null, |
| @@ -766,6 +766,7 @@ App({ | @@ -766,6 +766,7 @@ App({ | ||
| 766 | th.globalData.storeFooter = null; //底部的导航 | 766 | th.globalData.storeFooter = null; //底部的导航 |
| 767 | th.globalData.full_screen = null; //全屏 | 767 | th.globalData.full_screen = null; //全屏 |
| 768 | th.globalData.guide_pick_id = null; //分享导购门店的优化 | 768 | th.globalData.guide_pick_id = null; //分享导购门店的优化 |
| 769 | + th.globalData.fuiou_pay = null; //分享导购门店的优化 | ||
| 769 | } else { | 770 | } else { |
| 770 | th.globalData.no_clear = 0; | 771 | th.globalData.no_clear = 0; |
| 771 | } | 772 | } |
| @@ -1541,8 +1542,72 @@ App({ | @@ -1541,8 +1542,72 @@ App({ | ||
| 1541 | } | 1542 | } |
| 1542 | //没有等级卡和新人有礼的时候 | 1543 | //没有等级卡和新人有礼的时候 |
| 1543 | if(func) func(); | 1544 | if(func) func(); |
| 1545 | + }, | ||
| 1546 | + | ||
| 1547 | + //content是映射的标题,goods_content是富文本的内容, | ||
| 1548 | + //a是wxpares插件 e是common.js th是页面的指针 | ||
| 1549 | + async deal_iframe(a,e,content,goods_content,th){ | ||
| 1550 | + | ||
| 1551 | + if (goods_content == null) goods_content = ""; | ||
| 1552 | + //-----商品详情--- | ||
| 1553 | + if (!goods_content) goods_content = " "; | ||
| 1554 | + | ||
| 1555 | + //用内存对象 | ||
| 1556 | + var ob={text:''}; | ||
| 1557 | + if(goods_content){ | ||
| 1558 | + ob.text=goods_content; | ||
| 1559 | + await this.deal_iframe_next(ob) | ||
| 1560 | + } | ||
| 1561 | + a.wxParse(content, "html", ut.format_content(ob.text), th, 6); | ||
| 1562 | + e.wxParseAddFullImageUrl(th, content); | ||
| 1563 | + }, | ||
| 1564 | + | ||
| 1565 | + async deal_iframe_next(ob){ | ||
| 1566 | + for(let i = 1; i > 0; i++){ | ||
| 1567 | + //如果没有iframe语句的时候,就跳出循环 | ||
| 1568 | + if(ob.text.indexOf('<iframe')<0) break | ||
| 1569 | + var start=ob.text.indexOf('<iframe'); | ||
| 1570 | + var end=ob.text.indexOf('</iframe>'); | ||
| 1571 | + //截取iframe的dom元素 | ||
| 1572 | + var str=ob.text.substring(start, end+9); | ||
| 1573 | + | ||
| 1574 | + var arr = str.split('vid='); | ||
| 1575 | + var arrs = arr[1].split('"'); | ||
| 1576 | + /* console.log("截取&前面的的"+arrs[0]);*/ | ||
| 1577 | + var vipid = arrs[0]; | ||
| 1578 | + | ||
| 1579 | + //-- 用vipid调用接口,转换视频 -- | ||
| 1580 | + var url = "https://vv.video.qq.com/getinfo?vid=" + vipid + "&platform=101001&charge=0&otype=json"; | ||
| 1581 | + var res=await getApp().promiseGet(url,{}) | ||
| 1582 | + if(res && res.data){ | ||
| 1583 | + var dataJson = res.data.replace(/QZOutputJson=/, '') + "qwe"; | ||
| 1584 | + var dataJson1 = dataJson.replace(/;qwe/, ''); | ||
| 1585 | + var data = JSON.parse(dataJson1); | ||
| 1586 | + if (data.vl != undefined) { | ||
| 1587 | + var host1 = data['vl']['vi'][0]; | ||
| 1588 | + var host2=host1['ul']['ui']; | ||
| 1589 | + var len=host2.length-1; | ||
| 1590 | + var host= host2[len]['url']; | ||
| 1591 | + | ||
| 1592 | + var fn = data.vl.vi[0].fn; | ||
| 1593 | + var fvkey = data.vl.vi[0].fvkey; | ||
| 1594 | + /* console.log("有参数吗"+fn+"有参数吗"+fvkey);*/ | ||
| 1595 | + var wxapp_url = host + fn + '?vkey=' + fvkey; | ||
| 1596 | + var frame='<video src="'+wxapp_url+'" controls="controls"></video>'; | ||
| 1597 | + ob.text=ob.text.replaceAll(str,frame) | ||
| 1598 | + } | ||
| 1599 | + continue; | ||
| 1600 | + }else{ | ||
| 1601 | + break; | ||
| 1602 | + } | ||
| 1603 | + } | ||
| 1544 | } | 1604 | } |
| 1545 | 1605 | ||
| 1606 | + | ||
| 1607 | + | ||
| 1608 | + | ||
| 1609 | + | ||
| 1610 | + | ||
| 1546 | }); | 1611 | }); |
| 1547 | 1612 | ||
| 1548 | 1613 |
components/diy_seckill/diy_seckill.js
| @@ -245,7 +245,7 @@ Component({ | @@ -245,7 +245,7 @@ Component({ | ||
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | //控制已售罄是否显示 | 247 | //控制已售罄是否显示 |
| 248 | - if (!th.data.object.hide_sold_out_items) { | 248 | + if (th.data.object.column_action_name && !th.data.object.hide_sold_out_items) { |
| 249 | all_array=empty | 249 | all_array=empty |
| 250 | } | 250 | } |
| 251 | 251 |
pages/goods/goodsInfo/goodsInfo.js
| @@ -1125,13 +1125,13 @@ Page({ | @@ -1125,13 +1125,13 @@ Page({ | ||
| 1125 | if (t.data.data.original_img.indexOf(o.imghost) == -1) | 1125 | if (t.data.data.original_img.indexOf(o.imghost) == -1) |
| 1126 | t.data.data.original_img = o.imghost + t.data.data.original_img; | 1126 | t.data.data.original_img = o.imghost + t.data.data.original_img; |
| 1127 | 1127 | ||
| 1128 | + /* -----商品详情--- | ||
| 1128 | if (t.data.data.goods_content == null) t.data.data.goods_content = ""; | 1129 | if (t.data.data.goods_content == null) t.data.data.goods_content = ""; |
| 1129 | - | ||
| 1130 | - //-----商品详情--- | ||
| 1131 | if (!t.data.data.goods_content) t.data.data.goods_content = " "; | 1130 | if (!t.data.data.goods_content) t.data.data.goods_content = " "; |
| 1132 | - | ||
| 1133 | a.wxParse("content", "html", ut.format_content(t.data.data.goods_content), ee, 6); | 1131 | a.wxParse("content", "html", ut.format_content(t.data.data.goods_content), ee, 6); |
| 1134 | - e.wxParseAddFullImageUrl(ee, "content"); | 1132 | + e.wxParseAddFullImageUrl(ee, "content");--*/ |
| 1133 | + | ||
| 1134 | + getApp().deal_iframe(a,e,'content',t.data.data.goods_content,ee); | ||
| 1135 | 1135 | ||
| 1136 | //if (ee.data.prom_type) { | 1136 | //if (ee.data.prom_type) { |
| 1137 | t.data.data.prom_type = ee.data.prom_type; | 1137 | t.data.data.prom_type = ee.data.prom_type; |