diff --git a/packageA/pages/quan/quan.json b/packageA/pages/quan/quan.json index e3d91c4..7d53138 100644 --- a/packageA/pages/quan/quan.json +++ b/packageA/pages/quan/quan.json @@ -3,6 +3,6 @@ "nodata": "/components/nodata/nodata", "share_button": "/components/share/share" }, - "navigationBarTitleText": "优惠券列表", + "navigationBarTitleText": "免费优惠券列表", "enablePullDownRefresh": false } \ No newline at end of file diff --git a/packageA/pages/quan/quan.wxml b/packageA/pages/quan/quan.wxml index b2cd17c..089d1f3 100644 --- a/packageA/pages/quan/quan.wxml +++ b/packageA/pages/quan/quan.wxml @@ -3,18 +3,17 @@ - + + scroll-anchoring> diff --git a/packageA/pages/quan/quan.wxss b/packageA/pages/quan/quan.wxss index c0e2276..6146348 100644 --- a/packageA/pages/quan/quan.wxss +++ b/packageA/pages/quan/quan.wxss @@ -85,7 +85,8 @@ page { } .list { box-sizing: border-box; - height: calc(100% - 78rpx); + /* height: calc(100% - 78rpx); */ + height: 100%; background-color: #f2f2f2; padding: 20rpx 20rpx 0 20rpx; /* padding-bottom: 102rpx; */ diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 4b4e7c1..40c7e1e 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -241,6 +241,8 @@ Page({ poster:null, //自定义海报 share_b_img:'', //自定义分享的背景 + + showPoster: false, }, //------初始化加载---------- @@ -1536,6 +1538,7 @@ Page({ //--点击分享事件--- onShareAppMessage: function(t) { + var th = this; var price = th.data.data.shop_price; if (th.data.prom_act) { @@ -3330,10 +3333,13 @@ Page({ //先画背景 var pg_path = "../../../images/share/share_bg.png"; + // context.fillStyle="#FFFFFF"; + // context.fillRect(0,0,554 * unit, 899 * unit); + //-- 如果有自定义海报的时候,判断背景的图片 -- if(th.data.share_b_img){ pg_path=th.data.share_b_img; - } + } context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); //-- 是自定义海报的情况下 -- @@ -3655,10 +3661,13 @@ Page({ }) return false; } - wx.previewImage({ - //将图片预览出来 - urls: [that.data.shareImgPath] - }); + // wx.previewImage({ + // //将图片预览出来 + // urls: [that.data.shareImgPath] + // }); + that.setData({ + showPoster: true, + }); wx.hideLoading(); } }) @@ -4353,8 +4362,118 @@ Page({ }) } }) - } - - + }, + + closePoster() { + this.setData({ + showPoster: false, + }); + }, + + // 保存图片到手机 + savePic() { + console.log('保存图片'); + var self = this; + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 + this.getSetting().then((res) => { + // 判断用户是否授权了保存到相册的权限,如果没有发起授权 + if (!res.authSetting['scope.writePhotosAlbum']) { + this.authorize().then(() => { + // 同意授权后保存下载文件 + this.saveImage(self.data.shareImgPath) + .then(() => { + self.setData({ + showPoster: false + }); + }); + }) + } else { + // 如果已经授权,保存下载文件 + this.saveImage(self.data.shareImgPath) + .then(() => { + self.setData({ + showPoster: false + }); + }); + } + + }) + }, + + // 获取用户已经授予了哪些权限 + getSetting() { + return new Promise((resolve, reject) => { + wx.getSetting({ + success: res => { + resolve(res) + } + }) + }) + }, + + // 发起首次授权请求 + authorize() { + // isFirst 用来记录是否为首次发起授权, + // 如果首次授权拒绝后,isFirst赋值为1 + let isFirst = wx.getStorageSync('isFirst') || 0; + return new Promise((resolve, reject) => { + wx.authorize({ + scope: 'scope.writePhotosAlbum', + // 同意授权 + success: () => { + resolve(); + }, + // 拒绝授权,这里是用户拒绝授权后的回调 + fail: res => { + if(isFirst === 0) { + wx.setStorageSync('isFirst', 1); + wx.showToast({ + title: '保存失败', + icon: 'none', + duration: 1000 + }) + } else { + this.showModal(); + } + console.log('拒绝授权'); + reject(); + } + }) + }) + }, + + + // 保存图片到系统相册 + saveImage(saveUrl) { + var self = this; + return new Promise((resolve, reject) => { + wx.saveImageToPhotosAlbum({ + filePath: saveUrl, + success: (res) => { + wx.showToast({ + title: '保存成功', + duration: 1000, + }); + self.setData({ + showPlaybill: 'true' + }); + resolve(); + }, + fail: () => { + wx.showToast({ + title: '保存失败', + duration: 1000, + }); + } + }) + }) + }, + + previewImage() { + wx.previewImage({ + //将图片预览出来 + urls: [this.data.shareImgPath] + }); + }, }); diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 18429eb..3f7bd0a 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -383,14 +383,14 @@ - + - 选择门店 + 选择门店 - + 更多门店 @@ -421,9 +421,9 @@ - + - 领券 + 领券 满{{item.condition}}减{{item.money}} @@ -478,7 +478,7 @@ - + {{bconfig.service_bz}} @@ -507,7 +507,7 @@ - + 宝贝评价({{categories3[0].num}}) 查看全部 @@ -523,32 +523,34 @@ - - - - - - - - - {{item.is_anonymous!=1?item.username:'匿名'}} - - - - - {{item.content?item.content:''}} - - - {{item.add_time}} - - - - - - - - - + + + + + + + + + + {{item.is_anonymous!=1?item.username:'匿名'}} + + + + + {{item.content?item.content:''}} + + + {{item.add_time}} + + + + + + + + + + @@ -563,7 +565,7 @@ - 商品信息 + 商品信息 @@ -985,7 +987,7 @@ - 选择门店 + 选择门店 @@ -1483,5 +1485,18 @@ - - \ No newline at end of file + + + + + + + + x + + + + + + + diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss index 48bcc8b..1004874 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxss +++ b/pages/goods/goodsInfo/goodsInfo.wxss @@ -9,15 +9,15 @@ image { display: flex; justify-content: center; width: 100%; - height: 80rpx; - margin-bottom: 20rpx; + /* height: 80rpx; */ + /* margin-bottom: 20rpx; */ background-color: #fff; - border-bottom: 1rpx #fafafa solid; + /* border-bottom: 1rpx #fafafa solid; */ } .type-box { width: 25%; box-sizing: border-box; - font-size: 36rpx; + font-size: 28rpx; line-height: 76rpx; padding: 0 20rpx; text-align: center; @@ -25,13 +25,27 @@ image { overflow: hidden; } .type-navbar-item { - border-bottom: 4rpx solid #fff; + /* border-bottom: 4rpx solid #fff; */ display: flex; justify-content: center; width: 100%; } .type-item-on { - border-bottom: 4rpx solid #333; + color: #F95D74; + font-weight: bold; + /* border-bottom: 4rpx solid #F95D74; */ + position: relative; +} +.type-item-on:after { + content: ''; + position: absolute; + width: 50%; + height: 4rpx; + background-color: #F95D74; + left: 0; + right: 0; + bottom: 0; + margin: 0 auto; } .swiper_box { width: 100%; @@ -46,9 +60,12 @@ image { width: 560rpx; line-height: 46rpx; font-size: 32rpx; + font-weight: bold; color: #333; - margin-top: 40rpx; - margin-bottom:20rpx; + margin-top: 30rpx; + margin-bottom:30rpx; + flex: 1; + text-align: justify; } .goods-collect { @@ -78,7 +95,7 @@ image { /* margin-top: 46rpx; */ margin-top:26rpx; - padding-bottom:12rpx; + padding-bottom:20rpx; } .prom-info { @@ -114,7 +131,8 @@ image { .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} .goods-num { - display: flex;font-size: 28rpx; + display: flex; + font-size: 24rpx; justify-content: space-between; } @@ -949,11 +967,12 @@ left:31rpx;} .bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx } .bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx; - border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; } + /* border-bottom: 3rpx solid #eee; */ + /* border-top: 3rpx solid #eee; */} .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;} .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; - font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } + font-size: 30rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } .red_bb{ color: #d70026; min-width:158rpx;width: auto;} .bg_jj{ width: 18rpx; height:18rpx; border-top: 2rpx solid #d70026; @@ -1180,7 +1199,7 @@ left:31rpx;} background: #ffe3e2; color: 28rpx; border-radius:20rpx; - font-size: 28rpx; + font-size: 24rpx; } .xc_comment-discuss{ width: 152rpx; @@ -1190,7 +1209,7 @@ left:31rpx;} background: #ffe3e2; color: 28rpx; border-radius:20rpx; - font-size: 28rpx; + font-size: 24rpx; margin-left: 28rpx } @@ -1274,7 +1293,14 @@ left:31rpx;} } .pj_word_size{ font-size: 28rpx} -.pj_scroll{white-space: nowrap;margin-bottom: 50rpx;} +.pj_scroll{ + white-space: nowrap; + /* height: 324rpx; */ + margin-bottom: 50rpx; + display: flex; + align-items: center; + /* box-shadow: 0 8px 12px #e7e9eb; */ +} /*领券*/ @@ -1285,7 +1311,7 @@ left:31rpx;} font-size: 23rpx; } .cx-frame{ - border-top:3rpx solid #eee; + /* border-top:3rpx solid #eee; */ width:99%; height: 95rpx; line-height: 95rpx; @@ -1317,19 +1343,17 @@ left:31rpx;} } .xc-coupon-fram .xc-circular{ - width: 24rpx; - height:20rpx; + width: 22rpx; + height:22rpx; background-color:#fff; position:absolute; - top:40rpx; - - + top: 40rpx; } .xc-coupon-fram .xc-one{ left:3rpx; } .xc-coupon-fram .xc-two{ - left: 175rpx; + left: 178rpx; } .cx-obtain-coupon{ @@ -2257,7 +2281,7 @@ right:17rpx; top:55rpx; .no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx} /* 门店地址 */ .xc-address_frame{ - border-top:1rpx solid #eee; + /* border-top:1rpx solid #eee; */ width: 100%; height: auto; } @@ -2322,6 +2346,7 @@ background: white; width: 100%; border-radius: 20rpx 20rpx 0 0; height: 72%; +bottom: 0; } .popup-top{ border-bottom: 1rpx solid #eee; @@ -2605,4 +2630,56 @@ button.custom-service::after{ .dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx} .act_content{ margin-top: 40rpx} .act_content view{ margin-bottom: 12rpx} -.color_b{color: #ff9c00} \ No newline at end of file +.color_b{color: #ff9c00} + +.poster-container { + box-sizing: border-box; + position: fixed; + top: 0; + width: 100%; + height: 100%; + z-index: 999; + background-color: rgba(0,0,0,.4); + padding: 60rpx; +} + +.poster { + box-sizing: border-box; + width: 100%; + height: 90%; + border-radius: 20rpx; + /* box-shadow: 0 8px 12px #666; */ + position: relative; + z-index: 999; + overflow: hidden; +} +.poster-img { + display: block; + width: 100%; + height: 100%; +} +.btn-container { + display: flex; + justify-content: space-around; +} +.btn-share { + display: block; + background-color: #FE6867; + color: white; + border-radius: 8rpx; + line-height: 80rpx; + margin-top: 28rpx; + padding: 0 60rpx; +} +.btn-close { + background-color: rgba(0,0,0,.5); + color: white; + width: 40rpx; + height: 40rpx; + line-height: 40rpx; + text-align: center; + border-radius: 50%; + position: absolute; + right: 20rpx; + top: 10rpx; +} \ No newline at end of file