Commit a9d87b3d1c3a8dcbbd07ba6544888f1561b71e15

Authored by yvan.ni
1 parent 6c8809fc

1. 图片组合

2.  直播间分享,要有房间ID
3.  积分购的点击事件,会出来充值页面,本来已经关闭的
components/diy_picMax/diy_picMax.js
@@ -10,22 +10,24 @@ Component({ @@ -10,22 +10,24 @@ Component({
10 // 这里是一些组件内部数据 10 // 这里是一些组件内部数据
11 someData: {}, 11 someData: {},
12 pic_height:0,//图片组合的高度 12 pic_height:0,//图片组合的高度
  13 + is_yspan:0, //是否要严格按照比例来实现
13 }, 14 },
14 ready: function () { 15 ready: function () {
15 - //console.log(this.data.object.data)  
16 - //--计算图片组合占用的高度--  
17 - /*-- 16 + //-- console.log(this.data.object.data) --
  17 + //-- 计算图片组合占用的高度 --
18 var height=0; 18 var height=0;
  19 + var is_yspan=0;
19 this.properties.object.data.forEach(function (val,ind) { 20 this.properties.object.data.forEach(function (val,ind) {
20 if(val.fir.x==0){ 21 if(val.fir.x==0){
21 height+=val.y_span*187; 22 height+=val.y_span*187;
22 } 23 }
  24 + if(val.y_span>1) is_yspan=1;
  25 +
23 }) 26 })
24 - this.setData({pic_height:height})--*/  
25 - 27 + this.setData({pic_height:height,is_yspan:is_yspan})
26 }, 28 },
27 methods: { 29 methods: {
28 - //智能跳转到页面 30 + //-- 智能跳转到页面 --
29 gopage(e) { 31 gopage(e) {
30 var url = e.currentTarget.dataset.url; 32 var url = e.currentTarget.dataset.url;
31 getApp().goto(url); 33 getApp().goto(url);
components/diy_picMax/diy_picMax.wxml
1 <!--图片组合--> 1 <!--图片组合-->
2 <wxs module="g_filter" src="../diy_notice/g_filter.wxs"></wxs> 2 <wxs module="g_filter" src="../diy_notice/g_filter.wxs"></wxs>
  3 +<!-- 如果有纵向合并的时候,要求要按照绝对布局来实现 -->
  4 +<block wx:if="{{is_yspan}}">
  5 + <view class="picMax2" style="height: {{pic_height}}rpx;" >
  6 + <view wx:for="{{object.data}}" class="pic_item2 width_{{item.x_span}} height_{{item.y_span}} mar_x{{item.fir.x}} mar_y{{item.fir.y}}">
  7 + <block wx:if="{{g_filter.has_char(item.wxapp_url,'plugin')>=0}}" >
  8 + <navigator url="{{item.wxapp_url}}">
  9 + <image src="{{item.src}}" style="display: block;" ></image>
  10 + </navigator>
  11 + </block>
  12 + <block wx:else>
  13 + <image bindtap='gopage' data-url="{{item.wxapp_url}}" src="{{item.src}}" style="display: block;" ></image>
  14 + </block>
  15 + </view>
  16 + </view>
  17 +</block>
  18 +<block wx:else>
3 <view class="picMax" > 19 <view class="picMax" >
4 - <view wx:for="{{object.data}}" class="pic_item width_{{item.x_span}} height_{{item.y_span}} mar_x{{item.fir.x}} mar_y{{item.fir.y}}"> 20 + <view wx:for="{{object.data}}" class="pic_item width_{{item.x_span}}">
5 <block wx:if="{{g_filter.has_char(item.wxapp_url,'plugin')>=0}}" > 21 <block wx:if="{{g_filter.has_char(item.wxapp_url,'plugin')>=0}}" >
6 <navigator url="{{item.wxapp_url}}"> 22 <navigator url="{{item.wxapp_url}}">
7 <image src="{{item.src}}" mode="widthFix" style="display: block;" ></image> 23 <image src="{{item.src}}" mode="widthFix" style="display: block;" ></image>
@@ -11,4 +27,6 @@ @@ -11,4 +27,6 @@
11 <image bindtap='gopage' data-url="{{item.wxapp_url}}" src="{{item.src}}" mode="widthFix" style="display: block;" ></image> 27 <image bindtap='gopage' data-url="{{item.wxapp_url}}" src="{{item.src}}" mode="widthFix" style="display: block;" ></image>
12 </block> 28 </block>
13 </view> 29 </view>
  30 + <view class="picMax-clear"></view>
14 </view> 31 </view>
  32 +</block>
components/diy_picMax/diy_picMax.wxss
1 -.picMax{width: 100%;position: relative;}  
2 -.pic_item{display: block; top:0;left:0;float:left}  
3 -.pic_item image{width: 100%; height: 100%; vertical-align: bottom;} 1 +.picMax{
  2 + width: 100%;
  3 + overflow: hidden;
  4 +}
  5 +.pic_item{
  6 + float: left;
  7 +}
  8 +.pic_item image{width: 100%;vertical-align: bottom;}
  9 +.picMax-clear{clear: both;}
  10 +
  11 +
  12 +.picMax2{
  13 + width: 100%;position: relative;
  14 +}
  15 +.pic_item2{
  16 + position:absolute;top:0; left:0;
  17 +}
  18 +.pic_item2 image{ width: 100%; height: 100%;}
4 .width_1{width: 187.5rpx}.width_2{width: 375rpx;}.width_3{width: 562.5rpx}.width_4{width:750rpx;} 19 .width_1{width: 187.5rpx}.width_2{width: 375rpx;}.width_3{width: 562.5rpx}.width_4{width:750rpx;}
5 -/* .height_1{height: 187.5rpx;}.height_2{height: 375rpx;}.height_3{height: 562.5rpx}.height_4{height: 748rpx;} */  
6 -/* .mar_x1{margin-left:187.5rpx;}.mar_x2{margin-left:375rpx;}.mar_x3{margin-left:562.5rpx}.mar_x4{margin-left: 748rpx;}  
7 -.mar_y1{margin-top: 187.5rpx;}.mar_y2{margin-top: 375rpx;}.mar_y3{margin-top: 562.5rpx}.mar_y4{margin-top: 748rpx;} */  
8 -.picMax-clear{clear: both;}  
9 \ No newline at end of file 20 \ No newline at end of file
  21 +.height_1{height: 187.5rpx;}.height_2{height: 375rpx;}.height_3{height: 562.5rpx}.height_4{height: 748rpx;}
  22 +.mar_x1{margin-left:187.5rpx;}.mar_x2{margin-left:375rpx;}.mar_x3{margin-left:562.5rpx}.mar_x4{margin-left: 748rpx;}
  23 +.mar_y1{margin-top: 187.5rpx;}.mar_y2{margin-top: 375rpx;}.mar_y3{margin-top: 562.5rpx}.mar_y4{margin-top: 748rpx;}
10 \ No newline at end of file 24 \ No newline at end of file
pages/goods/goodsInfo/goodsInfo.js
@@ -257,7 +257,8 @@ Page({ @@ -257,7 +257,8 @@ Page({
257 th = ee, 257 th = ee,
258 gid = t.goods_id, 258 gid = t.goods_id,
259 first_leader=t.first_leader, 259 first_leader=t.first_leader,
260 - room_id=t.room_id; 260 + room_id=t.room_id,
  261 + room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
261 262
262 //-- 自定义海报 -- 263 //-- 自定义海报 --
263 getApp().request.promiseGet("/api/weshop/goods/poster/page",{ 264 getApp().request.promiseGet("/api/weshop/goods/poster/page",{
@@ -297,21 +298,35 @@ Page({ @@ -297,21 +298,35 @@ Page({
297 if(gid_str.length>1){ 298 if(gid_str.length>1){
298 first_leader=gid_str[1]; 299 first_leader=gid_str[1];
299 } 300 }
  301 +
  302 + //-- 如果有room_id的获取 --
  303 + if(gid_str.length>2 && gid_str[2]){
  304 + room_id=gid_str[2];
  305 + th.data.room_user_share=1;
  306 + }
  307 +
300 } 308 }
301 ee.setData({ gid: gid}); 309 ee.setData({ gid: gid});
302 if(first_leader){ 310 if(first_leader){
  311 + console.log("log---".first_leader);
  312 +
303 getApp().globalData.first_leader=first_leader; 313 getApp().globalData.first_leader=first_leader;
304 //调用接口判断是不是会员 314 //调用接口判断是不是会员
305 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ 315 getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
306 if(res.data.code==0){ 316 if(res.data.code==0){
307 getApp().globalData.guide_id=res.data.data.id; 317 getApp().globalData.guide_id=res.data.data.id;
  318 + console.log("log2---".getApp().globalData.guide_id);
308 } 319 }
309 }) 320 })
310 } 321 }
311 322
  323 + //-- 如果有房间号 --
312 if(room_id){ 324 if(room_id){
313 getApp().globalData.room_id=room_id; 325 getApp().globalData.room_id=room_id;
314 getApp().globalData.room_goods_id=gid; 326 getApp().globalData.room_goods_id=gid;
  327 + //如果是会员分享过来的要记录
  328 + if(room_user_share)
  329 + getApp().globalData.room_user_share=room_user_share;
315 } 330 }
316 331
317 var c_guide_id=t.c_guide_id; 332 var c_guide_id=t.c_guide_id;
@@ -1749,11 +1764,21 @@ Page({ @@ -1749,11 +1764,21 @@ Page({
1749 title=th.data.prom_act.share_title; 1764 title=th.data.prom_act.share_title;
1750 img=th.data.iurl+th.data.prom_act.share_imgurl; 1765 img=th.data.iurl+th.data.prom_act.share_imgurl;
1751 } 1766 }
  1767 +
  1768 +
1752 var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; 1769 var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
1753 if(getApp().globalData.user_id){ 1770 if(getApp().globalData.user_id){
1754 url+="&first_leader="+getApp().globalData.user_id; 1771 url+="&first_leader="+getApp().globalData.user_id;
1755 } 1772 }
1756 1773
  1774 + //-- 如果房间分享,且不是会员分享的 --
  1775 + if(getApp().globalData.room_id &&
  1776 + th.data.data.goods_id==getApp().globalData.room_goods_id &&
  1777 + getApp().globalData.room_user_share
  1778 + ){
  1779 + url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1";
  1780 + }
  1781 +
1757 var ob={ 1782 var ob={
1758 title: price + "元 " +title, 1783 title: price + "元 " +title,
1759 path:url, 1784 path:url,
@@ -1764,8 +1789,15 @@ Page({ @@ -1764,8 +1789,15 @@ Page({
1764 ob.title=title; 1789 ob.title=title;
1765 ob.desc=th.data.prom_act.share_remark; 1790 ob.desc=th.data.prom_act.share_remark;
1766 } 1791 }
  1792 +
  1793 + //如果是积分购的时候
  1794 + if(th.data.prom_type==4){
  1795 + var name = th.data.prom_act.name;
  1796 + ob.title=name;
  1797 + }
  1798 +
1767 return ob; 1799 return ob;
1768 - 1800 +
1769 }, 1801 },
1770 1802
1771 //-----图片失败,默认图片----- 1803 //-----图片失败,默认图片-----
@@ -3586,6 +3618,9 @@ Page({ @@ -3586,6 +3618,9 @@ Page({
3586 if(user_id>0){ 3618 if(user_id>0){
3587 scene+="_"+user_id; 3619 scene+="_"+user_id;
3588 } 3620 }
  3621 + if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id){
  3622 + scene+="_"+getApp().globalData.room_id ;
  3623 + }
3589 3624
3590 ///二微码 3625 ///二微码
3591 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + 3626 var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
pages/user/integral/integral.js
@@ -158,28 +158,39 @@ Page({ @@ -158,28 +158,39 @@ Page({
158 swichNav: function (e) { 158 swichNav: function (e) {
159 console.log("是什么", e.target.dataset.current); 159 console.log("是什么", e.target.dataset.current);
160 var val=e.target.dataset.current; 160 var val=e.target.dataset.current;
  161 +
  162 + var that = this;
  163 + if (this.data.currentTab== parseInt(e.target.dataset.current)) {
  164 + return false;
  165 + } else {
  166 + //如果是积分充值,但是不显示的话,不响应点击事件,退出
  167 + if(val!=0 && !this.data.is_show_jfcz){
  168 + return false;
  169 + }
  170 + that.setData({
  171 + currentTab: e.target.dataset.current
  172 + })
  173 + }
  174 +
161 if (val==0){ 175 if (val==0){
162 console.log("积分明细", e.target.dataset.current); 176 console.log("积分明细", e.target.dataset.current);
163 - var jfmx=true; 177 + var jfmx=true;
164 var jfcz= false; 178 var jfcz= false;
165 - this.setData({ jfmx: jfmx, jfcz: jfcz, current_page: 0 }); 179 + this.setData({ jfmx: jfmx, jfcz: jfcz, current_page: 0,details:[] });
166 this.detaileds(); 180 this.detaileds();
167 }else{ 181 }else{
168 - console.log("积分充值", e.target.dataset.current);  
169 - var jfmx = false;  
170 - var jfcz = true;  
171 - this.setData({jfmx: jfmx, jfcz: jfcz, current_page:1 });  
172 - this.exchange(); 182 + if(this.data.is_show_jfcz) {
  183 + console.log("积分充值", e.target.dataset.current);
  184 + var jfmx = false;
  185 + var jfcz = true;
  186 + this.setData({jfmx: jfmx, jfcz: jfcz, current_page:1,result:[] });
  187 + this.exchange();
  188 + }else{
  189 + return false;
  190 + }
173 } 191 }
174 192
175 - var that = this;  
176 - if (this.data.currentTab === e.target.dataset.current) {  
177 - return false;  
178 - } else {  
179 - that.setData({  
180 - currentTab: e.target.dataset.current  
181 - })  
182 - } 193 +
183 }, 194 },
184 // 积分收支明细 195 // 积分收支明细
185 detailed:function(){ 196 detailed:function(){