From a9d87b3d1c3a8dcbbd07ba6544888f1561b71e15 Mon Sep 17 00:00:00 2001
From: yvan.ni <765199919@qq.com>
Date: Wed, 16 Dec 2020 10:51:52 +0800
Subject: [PATCH] 1. 图片组合 2. 直播间分享,要有房间ID 3. 积分购的点击事件,会出来充值页面,本来已经关闭的
---
components/diy_picMax/diy_picMax.js | 14 ++++++++------
components/diy_picMax/diy_picMax.wxml | 20 +++++++++++++++++++-
components/diy_picMax/diy_picMax.wxss | 28 +++++++++++++++++++++-------
pages/goods/goodsInfo/goodsInfo.js | 39 +++++++++++++++++++++++++++++++++++++--
pages/user/integral/integral.js | 41 ++++++++++++++++++++++++++---------------
5 files changed, 111 insertions(+), 31 deletions(-)
diff --git a/components/diy_picMax/diy_picMax.js b/components/diy_picMax/diy_picMax.js
index ad9af0e..61b6ea3 100644
--- a/components/diy_picMax/diy_picMax.js
+++ b/components/diy_picMax/diy_picMax.js
@@ -10,22 +10,24 @@ Component({
// 这里是一些组件内部数据
someData: {},
pic_height:0,//图片组合的高度
+ is_yspan:0, //是否要严格按照比例来实现
},
ready: function () {
- //console.log(this.data.object.data)
- //--计算图片组合占用的高度--
- /*--
+ //-- console.log(this.data.object.data) --
+ //-- 计算图片组合占用的高度 --
var height=0;
+ var is_yspan=0;
this.properties.object.data.forEach(function (val,ind) {
if(val.fir.x==0){
height+=val.y_span*187;
}
+ if(val.y_span>1) is_yspan=1;
+
})
- this.setData({pic_height:height})--*/
-
+ this.setData({pic_height:height,is_yspan:is_yspan})
},
methods: {
- //智能跳转到页面
+ //-- 智能跳转到页面 --
gopage(e) {
var url = e.currentTarget.dataset.url;
getApp().goto(url);
diff --git a/components/diy_picMax/diy_picMax.wxml b/components/diy_picMax/diy_picMax.wxml
index 27c644a..62285ea 100644
--- a/components/diy_picMax/diy_picMax.wxml
+++ b/components/diy_picMax/diy_picMax.wxml
@@ -1,7 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -11,4 +27,6 @@
+
+
diff --git a/components/diy_picMax/diy_picMax.wxss b/components/diy_picMax/diy_picMax.wxss
index 2e26ca6..e3d266d 100644
--- a/components/diy_picMax/diy_picMax.wxss
+++ b/components/diy_picMax/diy_picMax.wxss
@@ -1,8 +1,22 @@
-.picMax{width: 100%;position: relative;}
-.pic_item{display: block; top:0;left:0;float:left}
-.pic_item image{width: 100%; height: 100%; vertical-align: bottom;}
+.picMax{
+ width: 100%;
+ overflow: hidden;
+}
+.pic_item{
+ float: left;
+}
+.pic_item image{width: 100%;vertical-align: bottom;}
+.picMax-clear{clear: both;}
+
+
+.picMax2{
+ width: 100%;position: relative;
+}
+.pic_item2{
+ position:absolute;top:0; left:0;
+}
+.pic_item2 image{ width: 100%; height: 100%;}
.width_1{width: 187.5rpx}.width_2{width: 375rpx;}.width_3{width: 562.5rpx}.width_4{width:750rpx;}
-/* .height_1{height: 187.5rpx;}.height_2{height: 375rpx;}.height_3{height: 562.5rpx}.height_4{height: 748rpx;} */
-/* .mar_x1{margin-left:187.5rpx;}.mar_x2{margin-left:375rpx;}.mar_x3{margin-left:562.5rpx}.mar_x4{margin-left: 748rpx;}
-.mar_y1{margin-top: 187.5rpx;}.mar_y2{margin-top: 375rpx;}.mar_y3{margin-top: 562.5rpx}.mar_y4{margin-top: 748rpx;} */
-.picMax-clear{clear: both;}
\ No newline at end of file
+.height_1{height: 187.5rpx;}.height_2{height: 375rpx;}.height_3{height: 562.5rpx}.height_4{height: 748rpx;}
+.mar_x1{margin-left:187.5rpx;}.mar_x2{margin-left:375rpx;}.mar_x3{margin-left:562.5rpx}.mar_x4{margin-left: 748rpx;}
+.mar_y1{margin-top: 187.5rpx;}.mar_y2{margin-top: 375rpx;}.mar_y3{margin-top: 562.5rpx}.mar_y4{margin-top: 748rpx;}
\ No newline at end of file
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index 9b23572..7a69d21 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -257,7 +257,8 @@ Page({
th = ee,
gid = t.goods_id,
first_leader=t.first_leader,
- room_id=t.room_id;
+ room_id=t.room_id,
+ room_user_share=t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
//-- 自定义海报 --
getApp().request.promiseGet("/api/weshop/goods/poster/page",{
@@ -297,21 +298,35 @@ Page({
if(gid_str.length>1){
first_leader=gid_str[1];
}
+
+ //-- 如果有room_id的获取 --
+ if(gid_str.length>2 && gid_str[2]){
+ room_id=gid_str[2];
+ th.data.room_user_share=1;
+ }
+
}
ee.setData({ gid: gid});
if(first_leader){
+ console.log("log---".first_leader);
+
getApp().globalData.first_leader=first_leader;
//调用接口判断是不是会员
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
if(res.data.code==0){
getApp().globalData.guide_id=res.data.data.id;
+ console.log("log2---".getApp().globalData.guide_id);
}
})
}
+ //-- 如果有房间号 --
if(room_id){
getApp().globalData.room_id=room_id;
getApp().globalData.room_goods_id=gid;
+ //如果是会员分享过来的要记录
+ if(room_user_share)
+ getApp().globalData.room_user_share=room_user_share;
}
var c_guide_id=t.c_guide_id;
@@ -1749,11 +1764,21 @@ Page({
title=th.data.prom_act.share_title;
img=th.data.iurl+th.data.prom_act.share_imgurl;
}
+
+
var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
if(getApp().globalData.user_id){
url+="&first_leader="+getApp().globalData.user_id;
}
+ //-- 如果房间分享,且不是会员分享的 --
+ if(getApp().globalData.room_id &&
+ th.data.data.goods_id==getApp().globalData.room_goods_id &&
+ getApp().globalData.room_user_share
+ ){
+ url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1";
+ }
+
var ob={
title: price + "元 " +title,
path:url,
@@ -1764,8 +1789,15 @@ Page({
ob.title=title;
ob.desc=th.data.prom_act.share_remark;
}
+
+ //如果是积分购的时候
+ if(th.data.prom_type==4){
+ var name = th.data.prom_act.name;
+ ob.title=name;
+ }
+
return ob;
-
+
},
//-----图片失败,默认图片-----
@@ -3586,6 +3618,9 @@ Page({
if(user_id>0){
scene+="_"+user_id;
}
+ if(getApp().globalData.room_id && th.data.data.goods_id==getApp().globalData.room_goods_id){
+ scene+="_"+getApp().globalData.room_id ;
+ }
///二微码
var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
diff --git a/pages/user/integral/integral.js b/pages/user/integral/integral.js
index 2891c46..abf7e0d 100644
--- a/pages/user/integral/integral.js
+++ b/pages/user/integral/integral.js
@@ -158,28 +158,39 @@ Page({
swichNav: function (e) {
console.log("是什么", e.target.dataset.current);
var val=e.target.dataset.current;
+
+ var that = this;
+ if (this.data.currentTab== parseInt(e.target.dataset.current)) {
+ return false;
+ } else {
+ //如果是积分充值,但是不显示的话,不响应点击事件,退出
+ if(val!=0 && !this.data.is_show_jfcz){
+ return false;
+ }
+ that.setData({
+ currentTab: e.target.dataset.current
+ })
+ }
+
if (val==0){
console.log("积分明细", e.target.dataset.current);
- var jfmx=true;
+ var jfmx=true;
var jfcz= false;
- this.setData({ jfmx: jfmx, jfcz: jfcz, current_page: 0 });
+ this.setData({ jfmx: jfmx, jfcz: jfcz, current_page: 0,details:[] });
this.detaileds();
}else{
- console.log("积分充值", e.target.dataset.current);
- var jfmx = false;
- var jfcz = true;
- this.setData({jfmx: jfmx, jfcz: jfcz, current_page:1 });
- this.exchange();
+ if(this.data.is_show_jfcz) {
+ console.log("积分充值", e.target.dataset.current);
+ var jfmx = false;
+ var jfcz = true;
+ this.setData({jfmx: jfmx, jfcz: jfcz, current_page:1,result:[] });
+ this.exchange();
+ }else{
+ return false;
+ }
}
- var that = this;
- if (this.data.currentTab === e.target.dataset.current) {
- return false;
- } else {
- that.setData({
- currentTab: e.target.dataset.current
- })
- }
+
},
// 积分收支明细
detailed:function(){
--
libgit2 0.21.4