-
Status changed to merged
-
mentioned in commit b7d57c4b768500985b18f8bd59d58ee9376ee98e
-
Dev See merge request !539
-
2. 助力活动的bug修复
-
Dev See merge request !538
-
2. 分享跳转内页
-
2. 购物车的功能优化
-
Dev See merge request !537
-
2. 助力活动的 不限任务数量 3. 等级卡的显示
Showing
53 changed files
app.js
| @@ -251,7 +251,7 @@ App({ | @@ -251,7 +251,7 @@ App({ | ||
| 251 | title: t, | 251 | title: t, |
| 252 | mask: e, | 252 | mask: e, |
| 253 | duration: a, | 253 | duration: a, |
| 254 | - image:"/packageA/images/gt.png", | 254 | + image:"/images/gt.png", |
| 255 | complete: function() { | 255 | complete: function() { |
| 256 | "function" == typeof o && setTimeout(o, a); | 256 | "function" == typeof o && setTimeout(o, a); |
| 257 | } | 257 | } |
app.json
| 1 | { | 1 | { |
| 2 | "pages": [ | 2 | "pages": [ |
| 3 | - | ||
| 4 | "pages/index/index/index", | 3 | "pages/index/index/index", |
| 5 | "pages/justTest/justTest", | 4 | "pages/justTest/justTest", |
| 6 | "pages/goods/categoryList/categoryList", | 5 | "pages/goods/categoryList/categoryList", |
| @@ -103,7 +102,12 @@ | @@ -103,7 +102,12 @@ | ||
| 103 | "pages/quan_list/quan_list", | 102 | "pages/quan_list/quan_list", |
| 104 | "pages/quan_pro/quan_pro", | 103 | "pages/quan_pro/quan_pro", |
| 105 | "pages/liveStream/liveStream", | 104 | "pages/liveStream/liveStream", |
| 106 | - "pages/liveStreamDetails/liveStreamDetails" | 105 | + "pages/liveStreamDetails/liveStreamDetails", |
| 106 | + | ||
| 107 | + "pages/goods_share/goods_share", | ||
| 108 | + "pages/activity_share/activity_share", | ||
| 109 | + "pages/live_share/live_share", | ||
| 110 | + "pages/quan/quan" | ||
| 107 | ] | 111 | ] |
| 108 | 112 | ||
| 109 | }], | 113 | }], |
app.wxss
| 1 | - | 1 | +.pdt20 { |
| 2 | + padding-top: 20rpx; | ||
| 3 | +} | ||
| 4 | +.pdt40 { | ||
| 5 | + padding-top: 40rpx; | ||
| 6 | +} | ||
| 2 | .flex { | 7 | .flex { |
| 3 | display: flex; | 8 | display: flex; |
| 4 | } | 9 | } |
| @@ -409,8 +414,107 @@ background: #ffe3e2; | @@ -409,8 +414,107 @@ background: #ffe3e2; | ||
| 409 | flex-wrap:wrap; | 414 | flex-wrap:wrap; |
| 410 | } | 415 | } |
| 411 | 416 | ||
| 417 | +.line-through { | ||
| 418 | + text-decoration:line-through; | ||
| 419 | +} | ||
| 420 | + | ||
| 421 | + | ||
| 412 | 422 | ||
| 413 | .lh1 { | 423 | .lh1 { |
| 414 | line-height: 1; | 424 | line-height: 1; |
| 415 | } | 425 | } |
| 416 | 426 | ||
| 427 | + | ||
| 428 | + | ||
| 429 | + | ||
| 430 | + | ||
| 431 | + | ||
| 432 | + | ||
| 433 | +/* 图标字体(ty) */ | ||
| 434 | +@font-face { | ||
| 435 | + font-family: 'iconfont'; /* project id 2054717 */ | ||
| 436 | + src: url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.eot'); | ||
| 437 | + src: url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.eot?#iefix') format('embedded-opentype'), | ||
| 438 | + url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.woff2') format('woff2'), | ||
| 439 | + url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.woff') format('woff'), | ||
| 440 | + url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.ttf') format('truetype'), | ||
| 441 | + url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.svg#iconfont') format('svg'); | ||
| 442 | +} | ||
| 443 | + | ||
| 444 | +.iconfont { | ||
| 445 | + font-family: "iconfont" !important; | ||
| 446 | + font-size: 16px; | ||
| 447 | + font-style: normal; | ||
| 448 | + -webkit-font-smoothing: antialiased; | ||
| 449 | + -moz-osx-font-smoothing: grayscale; | ||
| 450 | +} | ||
| 451 | + | ||
| 452 | +.icon-save:before { | ||
| 453 | + content: "\e6bb"; | ||
| 454 | +} | ||
| 455 | + | ||
| 456 | +.icon-close:before { | ||
| 457 | + content: "\e62e"; | ||
| 458 | +} | ||
| 459 | + | ||
| 460 | +.icon-info:before { | ||
| 461 | + content: "\e603"; | ||
| 462 | +} | ||
| 463 | + | ||
| 464 | +.icon-people:before { | ||
| 465 | + content: "\e66a"; | ||
| 466 | +} | ||
| 467 | + | ||
| 468 | +.icon-fire:before { | ||
| 469 | + content: "\e694"; | ||
| 470 | +} | ||
| 471 | + | ||
| 472 | +.icon-live:before { | ||
| 473 | + content: "\e664"; | ||
| 474 | +} | ||
| 475 | + | ||
| 476 | +.icon-clock:before { | ||
| 477 | + content: "\e608"; | ||
| 478 | +} | ||
| 479 | + | ||
| 480 | +.icon-hot:before { | ||
| 481 | + content: "\e680"; | ||
| 482 | +} | ||
| 483 | + | ||
| 484 | +.icon-img:before { | ||
| 485 | + content: "\e8c1"; | ||
| 486 | +} | ||
| 487 | + | ||
| 488 | +.icon-shang:before { | ||
| 489 | + content: "\e604"; | ||
| 490 | +} | ||
| 491 | + | ||
| 492 | +.icon-xia:before { | ||
| 493 | + content: "\e650"; | ||
| 494 | +} | ||
| 495 | + | ||
| 496 | +.icon-daohang:before { | ||
| 497 | + content: "\e748"; | ||
| 498 | +} | ||
| 499 | + | ||
| 500 | +.icon-phone:before { | ||
| 501 | + content: "\e602"; | ||
| 502 | +} | ||
| 503 | + | ||
| 504 | +.icon-up:before { | ||
| 505 | + content: "\e601"; | ||
| 506 | +} | ||
| 507 | + | ||
| 508 | +.icon-arrow_right:before { | ||
| 509 | + content: "\e61f"; | ||
| 510 | +} | ||
| 511 | + | ||
| 512 | +.icon-arrow_down:before { | ||
| 513 | + content: "\e600"; | ||
| 514 | +} | ||
| 515 | + | ||
| 516 | +.icon-weizhi:before { | ||
| 517 | + content: "\e615"; | ||
| 518 | +} | ||
| 519 | + | ||
| 520 | + |
components/nodata/nodata.js
0 → 100644
components/nodata/nodata.json
0 → 100644
components/nodata/nodata.wxml
0 → 100644
components/nodata/nodata.wxss
0 → 100644
| 1 | +@font-face { | ||
| 2 | + font-family: 'iconfont'; /* project id 1949577 */ | ||
| 3 | + src: url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.eot'); | ||
| 4 | + src: url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.eot?#iefix') format('embedded-opentype'), | ||
| 5 | + url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.woff2') format('woff2'), | ||
| 6 | + url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.woff') format('woff'), | ||
| 7 | + url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.ttf') format('truetype'), | ||
| 8 | + url('//at.alicdn.com/t/font_1949577_r1bys5v0lz.svg#iconfont') format('svg'); | ||
| 9 | +} | ||
| 10 | +.iconfont { | ||
| 11 | + font-family: "iconfont" !important; | ||
| 12 | + font-size: 32rpx; | ||
| 13 | + font-style: normal; | ||
| 14 | + -webkit-font-smoothing: antialiased; | ||
| 15 | + -moz-osx-font-smoothing: grayscale; | ||
| 16 | +} | ||
| 17 | +.icon-nodata:before { | ||
| 18 | + content: "\e636"; | ||
| 19 | +} | ||
| 20 | +.nodata-container { | ||
| 21 | + text-align: center; | ||
| 22 | +} | ||
| 23 | +.nodata-icon { | ||
| 24 | + font-size: 220rpx; | ||
| 25 | + color: #ddd; | ||
| 26 | + padding-top: 50rpx; | ||
| 27 | +} | ||
| 28 | +.nodata-title { | ||
| 29 | + padding-top: 40rpx; | ||
| 30 | + padding-bottom: 40rpx; | ||
| 31 | + color: #bbb; | ||
| 32 | +} | ||
| 0 | \ No newline at end of file | 33 | \ No newline at end of file |
components/share/share.js
0 → 100644
| 1 | +Component({ | ||
| 2 | + /*** 页面的初始数据***/ | ||
| 3 | + data: { | ||
| 4 | + type:0,// 0默认情况发送好友和海报 1只有发送好友 | ||
| 5 | + }, | ||
| 6 | + methods: { | ||
| 7 | + cancel() { | ||
| 8 | + this.triggerEvent('cancel',{},{bubbles: true}); | ||
| 9 | + }, | ||
| 10 | + share_img(){ | ||
| 11 | + this.triggerEvent('share_img',{},{bubbles: true}); | ||
| 12 | + }, | ||
| 13 | + set_type(type){ | ||
| 14 | + this.setData({type:type}) | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + } | ||
| 18 | +}) | ||
| 0 | \ No newline at end of file | 19 | \ No newline at end of file |
components/share/share.json
0 → 100644
components/share/share.wxml
0 → 100644
| 1 | +<view class="container" hidden="{{hiddenShare}}"> | ||
| 2 | + <view class="container-wrap animated slideInUp"> | ||
| 3 | + <view class="flex"> | ||
| 4 | + <block wx:if="{{type==0}}"> | ||
| 5 | + <button open-type="share" class="btn"> | ||
| 6 | + <view class="icon-container bg-green"><view class="iconfont icon-weixin"></view></view> | ||
| 7 | + <view class="title">发送给好友</view> | ||
| 8 | + </button> | ||
| 9 | + <view class="btn" bindtap="share_img"> | ||
| 10 | + <view class="icon-container bg-red"><view class="iconfont icon-pic"></view></view> | ||
| 11 | + <view class="title">生成海报分享</view> | ||
| 12 | + </view> | ||
| 13 | + </block> | ||
| 14 | + <block wx:else> | ||
| 15 | + <button open-type="share" class="btn" style="width: 100%;"> | ||
| 16 | + <view class="icon-container bg-green"><view class="iconfont icon-weixin"></view></view> | ||
| 17 | + <view class="title">发送给好友</view> | ||
| 18 | + </button> | ||
| 19 | + </block> | ||
| 20 | + </view> | ||
| 21 | + <view class="btn-cancel" bindtap="cancel">取消</view> | ||
| 22 | + </view> | ||
| 23 | +</view> | ||
| 0 | \ No newline at end of file | 24 | \ No newline at end of file |
components/share/share.wxss
0 → 100644
| 1 | +@charset "UTF-8"; | ||
| 2 | +@font-face { | ||
| 3 | + font-family: 'iconfont'; | ||
| 4 | + /* project id 2125414 */ | ||
| 5 | + src: url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.eot'); | ||
| 6 | + src: url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.eot?#iefix') format('embedded-opentype'), | ||
| 7 | + url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.woff2') format('woff2'), | ||
| 8 | + url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.woff') format('woff'), | ||
| 9 | + url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.ttf') format('truetype'), | ||
| 10 | + url('//at.alicdn.com/t/font_2125414_o4quhtfqnbr.svg#iconfont') format('svg'); | ||
| 11 | +} | ||
| 12 | + | ||
| 13 | +.iconfont { | ||
| 14 | + font-family: "iconfont" !important; | ||
| 15 | + font-size: 32rpx; | ||
| 16 | + font-style: normal; | ||
| 17 | + -webkit-font-smoothing: antialiased; | ||
| 18 | + -moz-osx-font-smoothing: grayscale; | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +.icon-weixin:before { | ||
| 22 | + content: "\e677"; | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +.icon-pic:before { | ||
| 26 | + content: "\e620"; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +.container { | ||
| 30 | + background-color: white; | ||
| 31 | + position: fixed; | ||
| 32 | + width: 100%; | ||
| 33 | + height: 100%; | ||
| 34 | + left: 0; | ||
| 35 | + top: 0; | ||
| 36 | + background-color: rgba(0,0,0,.5); | ||
| 37 | + z-index: 100; | ||
| 38 | +} | ||
| 39 | +.container-wrap { | ||
| 40 | + background-color: white; | ||
| 41 | + position: absolute; | ||
| 42 | + bottom: 0; | ||
| 43 | + width: 100%; | ||
| 44 | +} | ||
| 45 | +.flex { | ||
| 46 | + display: flex; | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +.btn { | ||
| 50 | + box-sizing: border-box; | ||
| 51 | + width: 50%; | ||
| 52 | + padding: 30rpx; | ||
| 53 | + text-align: center; | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +.icon-container { | ||
| 57 | + width: 80rpx; | ||
| 58 | + height: 80rpx; | ||
| 59 | + line-height: 80rpx; | ||
| 60 | + color: white; | ||
| 61 | + border-radius: 50%; | ||
| 62 | + text-align: center; | ||
| 63 | + margin: 0 auto; | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +.iconfont { | ||
| 67 | + font-size: 40rpx; | ||
| 68 | +} | ||
| 69 | + | ||
| 70 | +.bg-green { | ||
| 71 | + background-color: #2ECB38; | ||
| 72 | +} | ||
| 73 | + | ||
| 74 | +.bg-red { | ||
| 75 | + background-color: #F86C6C; | ||
| 76 | +} | ||
| 77 | + | ||
| 78 | +.title { | ||
| 79 | + font-size: 28rpx; | ||
| 80 | + color: #7b7b7b; | ||
| 81 | + padding-top: 10rpx; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.btn-cancel { | ||
| 85 | + padding: 20rpx; | ||
| 86 | + text-align: center; | ||
| 87 | + color: #7b7b7b; | ||
| 88 | + background-color: #f9f9f9; | ||
| 89 | + font-size: 28rpx; | ||
| 90 | + line-height: 2; | ||
| 91 | +} | ||
| 92 | + | ||
| 93 | +.animated { | ||
| 94 | + -webkit-animation-duration: .5s; | ||
| 95 | + animation-duration: .5s; | ||
| 96 | + -webkit-animation-fill-mode: both; | ||
| 97 | + animation-fill-mode: both | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +.animated.infinite { | ||
| 101 | + -webkit-animation-iteration-count: infinite; | ||
| 102 | + animation-iteration-count: infinite | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +.animated.hinge { | ||
| 106 | + -webkit-animation-duration: 2s; | ||
| 107 | + animation-duration: 2s | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | +@-webkit-keyframes slideInUp { | ||
| 111 | + 0% { | ||
| 112 | + opacity: 0; | ||
| 113 | + -webkit-transform: translateY(2000px); | ||
| 114 | + transform: translateY(2000px) | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + 100% { | ||
| 118 | + opacity: 1; | ||
| 119 | + -webkit-transform: translateY(0); | ||
| 120 | + transform: translateY(0) | ||
| 121 | + } | ||
| 122 | +} | ||
| 123 | + | ||
| 124 | +@keyframes slideInUp { | ||
| 125 | + 0% { | ||
| 126 | + opacity: 0; | ||
| 127 | + -webkit-transform: translateY(100px); | ||
| 128 | + -ms-transform: translateY(100px); | ||
| 129 | + transform: translateY(100px) | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + 100% { | ||
| 133 | + opacity: 1; | ||
| 134 | + -webkit-transform: translateY(0); | ||
| 135 | + -ms-transform: translateY(0); | ||
| 136 | + transform: translateY(0) | ||
| 137 | + } | ||
| 138 | +} | ||
| 139 | + | ||
| 140 | +.slideInUp { | ||
| 141 | + -webkit-animation-name: slideInUp; | ||
| 142 | + animation-name: slideInUp | ||
| 143 | +} | ||
| 144 | + | ||
| 145 | +button{ | ||
| 146 | + border: none; | ||
| 147 | +} | ||
| 148 | + | ||
| 149 | +button::after { | ||
| 150 | + border: none; | ||
| 151 | +} | ||
| 0 | \ No newline at end of file | 152 | \ No newline at end of file |
packageA/images/gt.png renamed to images/gt.png
1.72 KB
packageA/pages/activity_share/activity_share.js
0 → 100644
| 1 | +// packageA//pages/goods_share/goods_share.js | ||
| 2 | +var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js"); | ||
| 3 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
| 4 | +Page({ | ||
| 5 | + /** | ||
| 6 | + * 页面的初始数据 | ||
| 7 | + */ | ||
| 8 | + data: { | ||
| 9 | + // tab | ||
| 10 | + tab: ['秒杀','拼单','促销','专享礼包'], | ||
| 11 | + currentIndex: 0, | ||
| 12 | + //促销页tab | ||
| 13 | + tab2: ['订单促销','搭配促销','优惠促销'], | ||
| 14 | + currentIndex2: 0, | ||
| 15 | + //秒杀和拼单底部tab | ||
| 16 | + currentIndex3: 0, | ||
| 17 | + // 控制价格 | ||
| 18 | + active1: false, | ||
| 19 | + // 控制佣金 | ||
| 20 | + active2: false, | ||
| 21 | + url:oo.imghost, | ||
| 22 | + //popup | ||
| 23 | + hiddenPopup: true, | ||
| 24 | + | ||
| 25 | + list:[], | ||
| 26 | + is_load:0, //是否正在加载 | ||
| 27 | + is_no_data:0, //没有数据 | ||
| 28 | + is_no_more:0, //没有更多数据 | ||
| 29 | + key_str:'', | ||
| 30 | + pattern:0, //分成的方式 | ||
| 31 | + currentPage:1, //当前的页码 | ||
| 32 | + | ||
| 33 | + canvasHidden: 1, //-- 隐藏画布 -- | ||
| 34 | + dis_switch:0, //-- 分销开关 -- | ||
| 35 | + pattern:0, //-- 分成的方式 -- | ||
| 36 | + share_hidden:1, //-- 分享的按钮隐藏 -- | ||
| 37 | + share_good:null, //--- 要分享的商品 --- | ||
| 38 | + | ||
| 39 | + timer:0, | ||
| 40 | + hui_active:null, //优惠活动分享 | ||
| 41 | + | ||
| 42 | + //点击活动详情的时候的响应 | ||
| 43 | + list2:[], | ||
| 44 | + is_load2:0, | ||
| 45 | + is_no_data2:0, //没有数据 | ||
| 46 | + is_no_more2:0, //没有更多数据 | ||
| 47 | + currentPage2:1, //页码 | ||
| 48 | + prom_goods:null, //优惠活动的条件 | ||
| 49 | + | ||
| 50 | + }, | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * 生命周期函数--监听页面加载 | ||
| 54 | + */ | ||
| 55 | + onLoad: function (options) { | ||
| 56 | + var th=this; | ||
| 57 | + //接受有没有导购的参数 | ||
| 58 | + var first_leader=options.first_leader; | ||
| 59 | + if(first_leader){ | ||
| 60 | + //-- user_id代过来免登陆 -- | ||
| 61 | + getApp().globalData.user_id=first_leader; | ||
| 62 | + getApp().getUserFir(); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + this.requestGoodsList(); | ||
| 66 | + //-- 自定义海报 -- | ||
| 67 | + getApp().request.promiseGet("/api/weshop/goods/poster/page",{ | ||
| 68 | + data:{store_id:os.stoid, type:1, is_use:1 } | ||
| 69 | + }).then(res=>{ | ||
| 70 | + if(res.data.code==0){ | ||
| 71 | + | ||
| 72 | + var poster_data=res.data.data.pageData[0]; | ||
| 73 | + var json_str=poster_data.jsonStr; | ||
| 74 | + | ||
| 75 | + if(json_str){ | ||
| 76 | + var json_data=JSON.parse(json_str); | ||
| 77 | + if(json_data.bg_img){ | ||
| 78 | + | ||
| 79 | + //-- 把图片那到本地 -- | ||
| 80 | + wx.getImageInfo({ | ||
| 81 | + src:json_data.bg_img, | ||
| 82 | + success: function(res) { | ||
| 83 | + var path= res.path; | ||
| 84 | + th.setData({share_b_img:path}) | ||
| 85 | + }, | ||
| 86 | + fail: function(res) {} | ||
| 87 | + }); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + th.setData({poster:json_data}) | ||
| 91 | + | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + }) | ||
| 95 | + | ||
| 96 | + //获取分销的配置 | ||
| 97 | + getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{ | ||
| 98 | + if(res.data.code==0){ | ||
| 99 | + th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern}); | ||
| 100 | + } | ||
| 101 | + }) | ||
| 102 | + | ||
| 103 | + //获取用户设备信息,屏幕宽度 | ||
| 104 | + wx.getSystemInfo({ | ||
| 105 | + success: res => { | ||
| 106 | + th.setData({ | ||
| 107 | + screenWidth: res.screenWidth | ||
| 108 | + }) | ||
| 109 | + } | ||
| 110 | + }); | ||
| 111 | + | ||
| 112 | + //-- ---秒杀和拼团都要有定时器--- | ||
| 113 | + if(!options.currentIndex || options.currentIndex<=1){ | ||
| 114 | + //设置全局定时器 | ||
| 115 | + th.data.timer=setInterval(function () { | ||
| 116 | + th.countDown(); | ||
| 117 | + },1000); | ||
| 118 | + } | ||
| 119 | + }, | ||
| 120 | + | ||
| 121 | + /** | ||
| 122 | + * 生命周期函数--监听页面显示 | ||
| 123 | + */ | ||
| 124 | + onShow: function () {}, | ||
| 125 | + /** | ||
| 126 | + * 生命周期函数--监听页面隐藏 | ||
| 127 | + */ | ||
| 128 | + onHide: function () { | ||
| 129 | + //--清理定时器-- | ||
| 130 | + clearInterval(this.timer); | ||
| 131 | + }, | ||
| 132 | + /**e | ||
| 133 | + * 页面上拉触底事件的处理函数 | ||
| 134 | + */ | ||
| 135 | + onReachBottom: function () {}, | ||
| 136 | + | ||
| 137 | + /** | ||
| 138 | + * 用户点击右上角分享 | ||
| 139 | + */ | ||
| 140 | + onShareAppMessage: function () { | ||
| 141 | + var th = this; | ||
| 142 | + //礼包的转发 | ||
| 143 | + if(th.data.currentIndex==3){ | ||
| 144 | + var lbid=th.data.hui_active.lbId; | ||
| 145 | + var url="/pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; | ||
| 146 | + if(getApp().globalData.user_id){ | ||
| 147 | + url+="&first_leader="+getApp().globalData.user_id; | ||
| 148 | + } | ||
| 149 | + var img=this.data.share_img; | ||
| 150 | + var title=th.data.hui_active.giftTitle; | ||
| 151 | + | ||
| 152 | + var ob={ | ||
| 153 | + title:title, | ||
| 154 | + path:url, | ||
| 155 | + imageUrl: img, | ||
| 156 | + }; | ||
| 157 | + th.setData({share_hidden:1}); | ||
| 158 | + return ob; | ||
| 159 | + | ||
| 160 | + }else{ | ||
| 161 | + //---秒杀,拼团,促销--- | ||
| 162 | + var item=this.data.share_good; | ||
| 163 | + if(item){ | ||
| 164 | + var price = item.price; | ||
| 165 | + if(!price) price=item.shop_price; | ||
| 166 | + | ||
| 167 | + | ||
| 168 | + var title= item.goods_name; | ||
| 169 | + var img=this.data.url+item.original_img; | ||
| 170 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | ||
| 171 | + if(getApp().globalData.user_id){ | ||
| 172 | + url+="&first_leader="+getApp().globalData.user_id; | ||
| 173 | + } | ||
| 174 | + var ob={ | ||
| 175 | + title: price + "元 " +title, | ||
| 176 | + path:url, | ||
| 177 | + imageUrl: img, | ||
| 178 | + }; | ||
| 179 | + th.setData({share_hidden:1,share_good:null}); | ||
| 180 | + return ob; | ||
| 181 | + }else{ | ||
| 182 | + var url="/pages/index/index/index"; | ||
| 183 | + if(getApp().globalData.user_id){ | ||
| 184 | + url+="?first_leader="+getApp().globalData.user_id; | ||
| 185 | + } | ||
| 186 | + var hui_active=this.data.hui_active; | ||
| 187 | + var title=hui_active.name; | ||
| 188 | + if(!title) title=hui_active.main_goods_name; | ||
| 189 | + if(!title) title=hui_active.giftTitle; | ||
| 190 | + | ||
| 191 | + var ob={ | ||
| 192 | + title: title, | ||
| 193 | + path:url, | ||
| 194 | + }; | ||
| 195 | + th.setData({share_hidden:1,share_good:null}); | ||
| 196 | + return ob; | ||
| 197 | + } | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + }, | ||
| 201 | + | ||
| 202 | + | ||
| 203 | + //-- 点击tab -- | ||
| 204 | + clickTab(e) { | ||
| 205 | + var th=this; | ||
| 206 | + if(this.data.currentIndex!=e.target.dataset.index){ | ||
| 207 | + this.setData({ | ||
| 208 | + currentIndex: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[], | ||
| 209 | + }); | ||
| 210 | + this.data.is_load=0; | ||
| 211 | + this.data.currentPage=1; | ||
| 212 | + this.requestGoodsList(); | ||
| 213 | + if(e.target.dataset.index<=1){ | ||
| 214 | + //设置全局定时器 | ||
| 215 | + this.data.timer=setInterval(function () { | ||
| 216 | + th.countDown(); | ||
| 217 | + },1000); | ||
| 218 | + }else{ | ||
| 219 | + clearInterval(this.timer); | ||
| 220 | + } | ||
| 221 | + } | ||
| 222 | + }, | ||
| 223 | + | ||
| 224 | + //-- 点击促销页tab -- | ||
| 225 | + clickTab2(e) { | ||
| 226 | + if(this.data.currentIndex2!=e.target.dataset.index){ | ||
| 227 | + this.setData({ | ||
| 228 | + currentIndex2: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[], | ||
| 229 | + }); | ||
| 230 | + this.data.is_load=0; | ||
| 231 | + this.data.currentPage=1; | ||
| 232 | + this.requestGoodsList(); | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + }, | ||
| 236 | + //-- 点击秒杀和拼单底部tab,火热进行和即将开始 -- | ||
| 237 | + clickTab3(e) { | ||
| 238 | + if(this.data.currentIndex3!=e.target.dataset.index){ | ||
| 239 | + this.setData({ | ||
| 240 | + currentIndex3: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[], | ||
| 241 | + }); | ||
| 242 | + this.data.is_load=0; | ||
| 243 | + this.data.currentPage=1; | ||
| 244 | + this.requestGoodsList(); | ||
| 245 | + } | ||
| 246 | + }, | ||
| 247 | + // 关闭弹出层 | ||
| 248 | + closePopup() { | ||
| 249 | + this.setData({ | ||
| 250 | + hiddenPopup: true | ||
| 251 | + }); | ||
| 252 | + }, | ||
| 253 | + | ||
| 254 | + //--- 显示弹出层 --- | ||
| 255 | + showPopup(e) { | ||
| 256 | + var th=this; | ||
| 257 | + var index=e.currentTarget.dataset.index; | ||
| 258 | + var hui_active=this.data.list[index]; | ||
| 259 | + | ||
| 260 | + //---搭配促销-- | ||
| 261 | + this.setData({hui_active: hui_active}); | ||
| 262 | + ////---搭配促销-- | ||
| 263 | + if(this.data.currentIndex2==2){ | ||
| 264 | + this.get_prom_goods(); | ||
| 265 | + }else{ | ||
| 266 | + //-- 获取搭配购的从商品的信息 -- | ||
| 267 | + getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + hui_active.main_goods_id,{}).then(res=>{ | ||
| 268 | + if(res.data.code==0){ | ||
| 269 | + var info=res.data.data | ||
| 270 | + th.setData({['hui_active.ginfo']:info}); | ||
| 271 | + } | ||
| 272 | + }) | ||
| 273 | + this.get_colloction(); | ||
| 274 | + } | ||
| 275 | + this.setData({hiddenPopup:false}); | ||
| 276 | + | ||
| 277 | + }, | ||
| 278 | + | ||
| 279 | + get_colloction: async function(){ | ||
| 280 | + var list=null; | ||
| 281 | + //-- 获取搭配购的从商品的信息 -- | ||
| 282 | + await app.request.promiseGet("/api/weshop/goods/getGoodsPromList/"+oo.stoid+"/"+this.data.hui_active.main_goods_id+"/2",{}).then(res=>{ | ||
| 283 | + if(res.data.code==0){ | ||
| 284 | + list=res.data.data.collocationList; | ||
| 285 | + } | ||
| 286 | + }) | ||
| 287 | + if(list){ | ||
| 288 | + for(var i in list){ | ||
| 289 | + await app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + list[i].goods_id,{}).then(res=>{ | ||
| 290 | + if(res.data.code==0){ | ||
| 291 | + var info=res.data.data | ||
| 292 | + list[i].shop_price=info.shop_price; | ||
| 293 | + } | ||
| 294 | + }) | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + this.setData({list2:list});//把数据弄到前台 | ||
| 298 | + | ||
| 299 | + }, | ||
| 300 | + //-- 获取优惠商品的活动 -- | ||
| 301 | + get_prom_goods:function(){ | ||
| 302 | + var list=null; | ||
| 303 | + var th=this; | ||
| 304 | + var prom_goods=null; | ||
| 305 | + var hui_active=this.data.hui_active; | ||
| 306 | + | ||
| 307 | + //-- 获取优惠活动的详情信息 -- | ||
| 308 | + app.request.promiseGet("/api/weshop/promgoodslist/getPromGoodsInfo/"+hui_active.id,{}).then(res=>{ | ||
| 309 | + if(res.data.code==0){ | ||
| 310 | + prom_goods=res.data.data; | ||
| 311 | + th.setData({prom_goods:prom_goods}); | ||
| 312 | + } | ||
| 313 | + }) | ||
| 314 | + //-- 指定商品参与,才有商品列表分 -- | ||
| 315 | + if(hui_active.good_object==1){ | ||
| 316 | + this.request_prom_goods(); | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + }, | ||
| 320 | + | ||
| 321 | + //-- -------获取商品列表-------- | ||
| 322 | + requestGoodsList:function(){ | ||
| 323 | + var th=this; | ||
| 324 | + if(th.data.is_load) return false; //-- 正在加载 | ||
| 325 | + if(th.data.is_no_data) return false; //-- 没有数据 | ||
| 326 | + if(th.data.is_no_more) return false; //-- 没有更多 | ||
| 327 | + th.data.is_load=1; | ||
| 328 | + var url=""; | ||
| 329 | + var req_data={ | ||
| 330 | + page:this.data.currentPage, | ||
| 331 | + store_id:oo.stoid, | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + switch(th.data.currentIndex){ | ||
| 335 | + case 0: //--秒杀-- | ||
| 336 | + url="/api/ms/flash_sale/spikepage"; | ||
| 337 | + if(th.data.currentIndex3==0){ | ||
| 338 | + url+="?timetype=1"; //火热进行中 | ||
| 339 | + }else{ | ||
| 340 | + url+="?timetype=0"; //即将开始 | ||
| 341 | + } | ||
| 342 | + req_data.is_show=1; | ||
| 343 | + req_data.is_end=0; | ||
| 344 | + | ||
| 345 | + if(th.data.key_str && th.data.key_str.trim()){ | ||
| 346 | + req_data.key_str=th.data.key_str.trim(); | ||
| 347 | + } | ||
| 348 | + break; | ||
| 349 | + case 1: //--拼团-- | ||
| 350 | + url="/api/weshop/teamlist/pageteam"; | ||
| 351 | + if(th.data.currentIndex3==0){ | ||
| 352 | + url+="/1"; //火热进行中 | ||
| 353 | + }else{ | ||
| 354 | + url+="/0"; //即将开始 | ||
| 355 | + } | ||
| 356 | + req_data.is_show=1; | ||
| 357 | + req_data.is_end=0; | ||
| 358 | + | ||
| 359 | + if(th.data.key_str && th.data.key_str.trim()){ | ||
| 360 | + req_data.key_str=th.data.key_str.trim(); | ||
| 361 | + } | ||
| 362 | + break; | ||
| 363 | + case 2: //--促销-- | ||
| 364 | + if(th.data.currentIndex2==0){ | ||
| 365 | + url="//api/weshop/promorder/page"; | ||
| 366 | + if(th.data.key_str && th.data.key_str.trim()){ | ||
| 367 | + req_data.name=th.data.key_str.trim(); | ||
| 368 | + } | ||
| 369 | + }else if(th.data.currentIndex2==1){ | ||
| 370 | + url="/api/weshop/prom/collocation/pageCollocationGoods"; | ||
| 371 | + if(th.data.key_str && th.data.key_str.trim()){ | ||
| 372 | + req_data.name=th.data.key_str.trim(); | ||
| 373 | + } | ||
| 374 | + }else{ | ||
| 375 | + url="/api/weshop/promgoods/page"; | ||
| 376 | + if(th.data.key_str && th.data.key_str.trim()){ | ||
| 377 | + req_data.name=th.data.key_str.trim(); | ||
| 378 | + } | ||
| 379 | + } | ||
| 380 | + break; | ||
| 381 | + case 3: //专享礼包 | ||
| 382 | + url='/api/weshop/marketing/giftbag/pageMd'; | ||
| 383 | + if(th.data.key_str && th.data.key_str.trim()){ | ||
| 384 | + req_data.key_str=th.data.key_str.trim(); | ||
| 385 | + } | ||
| 386 | + break; | ||
| 387 | + } | ||
| 388 | + | ||
| 389 | + if(this.data.key_str && this.data.key_str.trim()){ | ||
| 390 | + var str=this.data.key_str.trim(); | ||
| 391 | + req_data.key_str=str; | ||
| 392 | + } | ||
| 393 | + //-- ---调用接口---- | ||
| 394 | + app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{ | ||
| 395 | + th.data.is_load=0; | ||
| 396 | + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | ||
| 397 | + th.data.currentPage++; | ||
| 398 | + var data=res.data.data.pageData; | ||
| 399 | + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});} | ||
| 400 | + var list=th.data.list; | ||
| 401 | + list=list.concat(data); | ||
| 402 | + th.setData({list:list}); | ||
| 403 | + }else{ | ||
| 404 | + if(th.data.currentPage==1){ | ||
| 405 | + th.setData({is_no_data:1}); | ||
| 406 | + } | ||
| 407 | + } | ||
| 408 | + }) | ||
| 409 | + }, | ||
| 410 | + | ||
| 411 | + //-- -------获取活动详情的商品的列表-------- | ||
| 412 | + request_prom_goods:function(){ | ||
| 413 | + var th=this; | ||
| 414 | + if(th.data.is_load2) return false; //-- 正在加载 | ||
| 415 | + if(th.data.is_no_data2) return false; //-- 没有数据 | ||
| 416 | + if(th.data.is_no_more2) return false; //-- 没有更多 | ||
| 417 | + th.data.is_load2=1; | ||
| 418 | + | ||
| 419 | + var req_data={ | ||
| 420 | + page:th.data.currentPage2 | ||
| 421 | + } | ||
| 422 | + app.request.promiseGet("/api/weshop/goods/page?store_id="+oo.stoid+"&prom_type=3&prom_id="+th.data.hui_active.id,{ | ||
| 423 | + data:req_data,isShowLoading:1 | ||
| 424 | + }).then(res=>{ | ||
| 425 | + th.data.is_load2=0; | ||
| 426 | + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | ||
| 427 | + th.data.currentPage2++; | ||
| 428 | + var data=res.data.data.pageData; | ||
| 429 | + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more2:1});} | ||
| 430 | + var list=th.data.list2; | ||
| 431 | + list=list.concat(data); | ||
| 432 | + th.setData({list2:list}); | ||
| 433 | + }else{ | ||
| 434 | + if(th.data.currentPage==1){ | ||
| 435 | + th.setData({is_no_data2:1}); | ||
| 436 | + } | ||
| 437 | + } | ||
| 438 | + }) | ||
| 439 | + }, | ||
| 440 | + | ||
| 441 | + //--- 获取卡类列表 --- | ||
| 442 | + getPlusCardType: function (func) { | ||
| 443 | + var storid = oo.stoid; | ||
| 444 | + var th = this; | ||
| 445 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | ||
| 446 | + var plusCard = res.data.data; | ||
| 447 | + var arr = [1219, 2089, 3031]; | ||
| 448 | + var new_arr = new Array(); | ||
| 449 | + var card_name_map=new Map(); | ||
| 450 | + var user = getApp().globalData.userInfo; | ||
| 451 | + for (var i = 0; i < plusCard.length; i++) { | ||
| 452 | + if ((user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) { | ||
| 453 | + continue; | ||
| 454 | + } | ||
| 455 | + var name="card"+plusCard[i].CorrPrice.toLowerCase(); | ||
| 456 | + card_name_map.set(name,plusCard[i].CardName); | ||
| 457 | + new_arr.push(plusCard[i]); | ||
| 458 | + } | ||
| 459 | + | ||
| 460 | + var ob={"card_list":new_arr,"name_map":card_name_map}; | ||
| 461 | + func(ob); | ||
| 462 | + }) | ||
| 463 | + }, | ||
| 464 | + | ||
| 465 | + | ||
| 466 | + //---图片失败,默认图片--- | ||
| 467 | + bind_bnerr2: function (e) { | ||
| 468 | + var _errImg = e.target.dataset.errorimg; | ||
| 469 | + var _errObj = {}; | ||
| 470 | + _errObj[_errImg] ="/miniapp/images/default_g_img.gif"; | ||
| 471 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
| 472 | + }, | ||
| 473 | + //-- ---更多加载---- | ||
| 474 | + refresh:function(){ | ||
| 475 | + this.requestGoodsList(); | ||
| 476 | + }, | ||
| 477 | + | ||
| 478 | + //--定义的保存图片方法,分享团--- | ||
| 479 | + saveImageToPhotosAlbum: function() { | ||
| 480 | + //--先判断会员状态-- | ||
| 481 | + var user_info = getApp().globalData.userInfo; | ||
| 482 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 483 | + //getApp().my_warnning("请先登录",0,this); | ||
| 484 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 485 | + return false; | ||
| 486 | + } | ||
| 487 | + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 | ||
| 488 | + var type = 0; | ||
| 489 | + wx.showLoading({ | ||
| 490 | + title: '生成中...', | ||
| 491 | + }) | ||
| 492 | + var that = this, th = that; | ||
| 493 | + //设置画板显示,才能开始绘图,并关闭底部按钮 | ||
| 494 | + that.setData({ | ||
| 495 | + canvasHidden: false,share_hidden:1 | ||
| 496 | + }) | ||
| 497 | + | ||
| 498 | + var app = getApp(); | ||
| 499 | + var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | ||
| 500 | + var scene = th.data.share_good.goods_id+""; | ||
| 501 | + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; | ||
| 502 | + if(user_id>0){ | ||
| 503 | + scene+="_"+user_id; | ||
| 504 | + } | ||
| 505 | + | ||
| 506 | + ///二微码 | ||
| 507 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | ||
| 508 | + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | ||
| 509 | + | ||
| 510 | + //读取文件成功则OK-- | ||
| 511 | + wx.getImageInfo({ | ||
| 512 | + src: path3, | ||
| 513 | + success: function(res) { | ||
| 514 | + //回调写法 | ||
| 515 | + th.get_head_temp(th.get_goods_temp, function() { | ||
| 516 | + var vpath = res.path; | ||
| 517 | + var context = wx.createCanvasContext('share'); | ||
| 518 | + //先画背景 | ||
| 519 | + var pg_path = "../../../images/share/share_bg.png"; | ||
| 520 | + | ||
| 521 | + //-- 如果有自定义海报的时候,判断背景的图片 -- | ||
| 522 | + if(th.data.share_b_img){ | ||
| 523 | + pg_path=th.data.share_b_img; | ||
| 524 | + } | ||
| 525 | + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | ||
| 526 | + | ||
| 527 | + //-- 是自定义海报的情况下 -- | ||
| 528 | + if(th.data.poster && parseInt(th.data.poster.style)==2){ | ||
| 529 | + //在线上分享人的情况下 | ||
| 530 | + if(parseInt(th.data.poster.show_headpic)){ | ||
| 531 | + //获取坐标 | ||
| 532 | + var x=parseFloat(th.data.poster.head_x)*2; | ||
| 533 | + var y=parseFloat(th.data.poster.head_y)*2; | ||
| 534 | + var x1=(x+90) *unit; | ||
| 535 | + var y1=(y+50) *unit; | ||
| 536 | + //--昵称--- | ||
| 537 | + context.setFontSize(24 * unit) | ||
| 538 | + context.setFillStyle("black") | ||
| 539 | + context.fillText(app.globalData.userInfo.nickname, x1, y1); | ||
| 540 | + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; | ||
| 541 | + //强烈推荐 改许程 | ||
| 542 | + var tj_path = "../../../images/share/q_tj.png"; | ||
| 543 | + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); | ||
| 544 | + context.setFontSize(16 * unit) | ||
| 545 | + context.setLineJoin('round'); //交点设置成圆角 | ||
| 546 | + context.setFillStyle("white") | ||
| 547 | + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); | ||
| 548 | + } | ||
| 549 | + }else{ | ||
| 550 | + //--昵称--- | ||
| 551 | + context.setFontSize(24 * unit) | ||
| 552 | + context.setFillStyle("black") | ||
| 553 | + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); | ||
| 554 | + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; | ||
| 555 | + //强烈推荐 改许程 | ||
| 556 | + var tj_path = "../../../images/share/q_tj.png"; | ||
| 557 | + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); | ||
| 558 | + context.setFontSize(16 * unit) | ||
| 559 | + context.setLineJoin('round'); //交点设置成圆角 | ||
| 560 | + context.setFillStyle("white") | ||
| 561 | + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); | ||
| 562 | + } | ||
| 563 | + | ||
| 564 | + | ||
| 565 | + //---产品名称--- | ||
| 566 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | ||
| 567 | + context.setFillStyle("black"); | ||
| 568 | + context.setFontSize(21.3 * unit) | ||
| 569 | + th.draw_Text(context, th.data.share_good.goods_name, | ||
| 570 | + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); | ||
| 571 | + //------产品的价格------- | ||
| 572 | + context.setFontSize(23 * unit) | ||
| 573 | + context.setFillStyle("red") | ||
| 574 | + context.fillText("¥", 416 * unit, 185 * unit); | ||
| 575 | + context.setFontSize(31 * unit) | ||
| 576 | + var pri0 = th.data.share_good.shop_price; | ||
| 577 | + if (th.data.prom_act) | ||
| 578 | + pri0 = th.data.prom_act.price; | ||
| 579 | + | ||
| 580 | + pri0 = parseFloat(pri0).toFixed(2); | ||
| 581 | + context.fillText(pri0, 438 * unit, 185 * unit); | ||
| 582 | + //---市场价划掉--- | ||
| 583 | + context.setFillStyle("gray") | ||
| 584 | + context.setFontSize(22 * unit) | ||
| 585 | + context.fillText("¥" + th.data.share_good.market_price, 426 * unit, 213 * unit); | ||
| 586 | + context.setStrokeStyle('gray') | ||
| 587 | + context.setLineWidth(1 * unit) | ||
| 588 | + context.moveTo(426 * unit, 206 * unit) | ||
| 589 | + context.lineTo(510 * unit, 206 * unit) | ||
| 590 | + context.stroke(); | ||
| 591 | + //---中间大图--- | ||
| 592 | + context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit); | ||
| 593 | + //-------大图后面就不一样了----------- | ||
| 594 | + switch (type) { | ||
| 595 | + case 0: //普通商品的展示 | ||
| 596 | + //中间的几个字 | ||
| 597 | + if(th.data.poster && parseInt(th.data.poster.style)==2 ){ | ||
| 598 | + if(parseInt(th.data.poster.show_quality)){ | ||
| 599 | + var g_path = "../../../images/share/s_gou.png"; | ||
| 600 | + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 601 | + context.setFillStyle("red") | ||
| 602 | + context.setFontSize(18 * unit) | ||
| 603 | + context.fillText("正品保证", 84 * unit, 690 * unit); | ||
| 604 | + | ||
| 605 | + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 606 | + context.setFillStyle("red") | ||
| 607 | + context.setFontSize(18 * unit) | ||
| 608 | + context.fillText("纯实体店", 246 * unit, 690 * unit); | ||
| 609 | + | ||
| 610 | + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 611 | + context.setFillStyle("red") | ||
| 612 | + context.setFontSize(18 * unit) | ||
| 613 | + context.fillText("官方验证", 420 * unit, 690 * unit); | ||
| 614 | + } | ||
| 615 | + | ||
| 616 | + }else{ | ||
| 617 | + var g_path = "../../../images/share/s_gou.png"; | ||
| 618 | + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 619 | + context.setFillStyle("red") | ||
| 620 | + context.setFontSize(18 * unit) | ||
| 621 | + context.fillText("正品保证", 84 * unit, 690 * unit); | ||
| 622 | + | ||
| 623 | + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 624 | + context.setFillStyle("red") | ||
| 625 | + context.setFontSize(18 * unit) | ||
| 626 | + context.fillText("纯实体店", 246 * unit, 690 * unit); | ||
| 627 | + | ||
| 628 | + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 629 | + context.setFillStyle("red") | ||
| 630 | + context.setFontSize(18 * unit) | ||
| 631 | + context.fillText("官方验证", 420 * unit, 690 * unit); | ||
| 632 | + } | ||
| 633 | + | ||
| 634 | + //---画线--- | ||
| 635 | + context.setLineWidth(1 * unit) | ||
| 636 | + context.moveTo(32 * unit, 710 * unit) | ||
| 637 | + context.lineTo(520 * unit, 710 * unit) | ||
| 638 | + context.stroke(); | ||
| 639 | + //---文字--- | ||
| 640 | + context.setFillStyle("black") | ||
| 641 | + context.setFontSize(22 * unit) | ||
| 642 | + // 原来start ---> | ||
| 643 | + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); | ||
| 644 | + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); | ||
| 645 | + | ||
| 646 | + //---二维吗图--- | ||
| 647 | + //-- 自定义海报 -- | ||
| 648 | + if(th.data.poster){ | ||
| 649 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 650 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 651 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 652 | + }else{ | ||
| 653 | + //---二维吗图--- | ||
| 654 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 655 | + } | ||
| 656 | + | ||
| 657 | + break; | ||
| 658 | + case 1: //秒杀商品的展示 | ||
| 659 | + //---画线--- | ||
| 660 | + context.setLineWidth(1 * unit) | ||
| 661 | + context.moveTo(32 * unit, 670 * unit) | ||
| 662 | + context.lineTo(520 * unit, 670 * unit) | ||
| 663 | + context.stroke(); | ||
| 664 | + | ||
| 665 | + //画秒杀的图片 | ||
| 666 | + var miaos_path = '../../../images/share/miao_share.png'; | ||
| 667 | + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); | ||
| 668 | + | ||
| 669 | + //---文字--- | ||
| 670 | + context.setFontSize(22 * unit) | ||
| 671 | + context.setFillStyle("black") | ||
| 672 | + context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit); | ||
| 673 | + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit); | ||
| 674 | + //---二维吗图--- | ||
| 675 | + //-- 自定义海报 -- | ||
| 676 | + if(th.data.poster){ | ||
| 677 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 678 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 679 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 680 | + }else{ | ||
| 681 | + //---二维吗图--- | ||
| 682 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 683 | + } | ||
| 684 | + break; | ||
| 685 | + | ||
| 686 | + case 2: //会员团和商家团的展示 | ||
| 687 | + //---画线--- | ||
| 688 | + context.setLineWidth(1 * unit) | ||
| 689 | + context.moveTo(32 * unit, 670 * unit) | ||
| 690 | + context.lineTo(520 * unit, 670 * unit) | ||
| 691 | + context.stroke(); | ||
| 692 | + //---文字--- | ||
| 693 | + context.setFontSize(22 * unit) | ||
| 694 | + context.font = 'normal bold'; | ||
| 695 | + context.setFillStyle("black") | ||
| 696 | + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | ||
| 697 | + | ||
| 698 | + //绘制成团图片 | ||
| 699 | + var ct_img = "../../../images/share/ct_num.png"; | ||
| 700 | + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); | ||
| 701 | + var ct_num = th.data.prom_act.ct_num; | ||
| 702 | + context.setFontSize(14 * unit) | ||
| 703 | + context.font = 'normal'; | ||
| 704 | + context.setFillStyle("red") | ||
| 705 | + if (ct_num < 10) { | ||
| 706 | + context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit); | ||
| 707 | + } else { | ||
| 708 | + context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit); | ||
| 709 | + } | ||
| 710 | + context.setFontSize(22 * unit) | ||
| 711 | + context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit); | ||
| 712 | + context.setFillStyle("gray") | ||
| 713 | + context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit); | ||
| 714 | + context.setFillStyle("black") | ||
| 715 | + context.font = 'normal bold 18px sans-serif'; | ||
| 716 | + context.setFontSize(21.3 * unit) | ||
| 717 | + context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); | ||
| 718 | + //---二维吗图--- | ||
| 719 | + //-- 自定义海报 -- | ||
| 720 | + if(th.data.poster){ | ||
| 721 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 722 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 723 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 724 | + }else{ | ||
| 725 | + //---二维吗图--- | ||
| 726 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 727 | + } | ||
| 728 | + break | ||
| 729 | + case 3: //阶梯团的展示 | ||
| 730 | + //---画线--- | ||
| 731 | + context.setLineWidth(1 * unit) | ||
| 732 | + context.moveTo(32 * unit, 670 * unit) | ||
| 733 | + context.lineTo(520 * unit, 670 * unit) | ||
| 734 | + context.stroke(); | ||
| 735 | + //---文字--- | ||
| 736 | + context.setFontSize(22 * unit) | ||
| 737 | + context.font = 'normal bold'; | ||
| 738 | + context.setFillStyle("black") | ||
| 739 | + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | ||
| 740 | + //---绘制中间阶梯的价格--- | ||
| 741 | + var list = th.data.prom_act.ct_rylist; | ||
| 742 | + for (var i = 0; i < list.length; i++) { | ||
| 743 | + var item = list[i]; | ||
| 744 | + var wi = i * 90 * unit; | ||
| 745 | + context.font = 'normal'; | ||
| 746 | + context.setFontSize(16 * unit) | ||
| 747 | + context.setFillStyle("red") | ||
| 748 | + context.fillText("¥", 40 * unit + wi, 756 * unit); | ||
| 749 | + context.setFontSize(22 * unit) | ||
| 750 | + var pri = parseFloat(item.price).toFixed(2); | ||
| 751 | + context.fillText(pri, 56 * unit + wi, 756 * unit); | ||
| 752 | + context.setFillStyle("gray") | ||
| 753 | + context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit); | ||
| 754 | + } | ||
| 755 | + //----------------下面部分---------------- | ||
| 756 | + context.setFillStyle("gray") | ||
| 757 | + context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit); | ||
| 758 | + context.setFillStyle("black") | ||
| 759 | + context.font = 'normal bold 18px sans-serif'; | ||
| 760 | + context.setFontSize(22 * unit) | ||
| 761 | + context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit); | ||
| 762 | + | ||
| 763 | + //-- 自定义海报 -- | ||
| 764 | + if(th.data.poster){ | ||
| 765 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 766 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 767 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 768 | + }else{ | ||
| 769 | + //---二维吗图--- | ||
| 770 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 771 | + } | ||
| 772 | + break | ||
| 773 | + } | ||
| 774 | + | ||
| 775 | + | ||
| 776 | + //--- 如果是自定义海报的时候 --- | ||
| 777 | + if(th.data.poster && parseInt(th.data.poster.style)==2){ | ||
| 778 | + //如果显示会员信息的话 | ||
| 779 | + if(parseInt(th.data.poster.show_headpic)){ | ||
| 780 | + //获取坐标 | ||
| 781 | + var x= parseFloat(th.data.poster.head_x)*2; | ||
| 782 | + var y=parseFloat(th.data.poster.head_y)*2; | ||
| 783 | + //---绘制圆形要放在最后---- | ||
| 784 | + context.save(); | ||
| 785 | + context.beginPath(); | ||
| 786 | + var h_x = x* unit; | ||
| 787 | + var h_y = y * unit; | ||
| 788 | + var h_r = 40 * unit; | ||
| 789 | + var cx = h_x + h_r; | ||
| 790 | + var cy = h_y + h_r; | ||
| 791 | + context.arc(cx, cy, h_r, 0, Math.PI * 2, false); | ||
| 792 | + context.closePath(); | ||
| 793 | + context.fill(); | ||
| 794 | + context.clip(); | ||
| 795 | + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2); | ||
| 796 | + context.restore(); | ||
| 797 | + } | ||
| 798 | + | ||
| 799 | + }else{ | ||
| 800 | + //---绘制圆形要放在最后---- | ||
| 801 | + context.save(); | ||
| 802 | + context.beginPath(); | ||
| 803 | + var h_x = 60 * unit; | ||
| 804 | + var h_y = 24 * unit; | ||
| 805 | + var h_r = 40 * unit; | ||
| 806 | + var cx = h_x + h_r; | ||
| 807 | + var cy = h_y + h_r; | ||
| 808 | + context.arc(cx, cy, h_r, 0, Math.PI * 2, false); | ||
| 809 | + context.closePath(); | ||
| 810 | + context.fill(); | ||
| 811 | + context.clip(); | ||
| 812 | + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2); | ||
| 813 | + context.restore(); | ||
| 814 | + } | ||
| 815 | + | ||
| 816 | + | ||
| 817 | + //把画板内容绘制成图片,并回调 画板图片路径 | ||
| 818 | + context.draw(false, function() { | ||
| 819 | + setTimeout(function() { | ||
| 820 | + wx.canvasToTempFilePath({ | ||
| 821 | + x: 0, | ||
| 822 | + y: 0, | ||
| 823 | + width: 750, | ||
| 824 | + height: 1217, | ||
| 825 | + destWidth: 1.2 * 750 * 750 / that.data.screenWidth, | ||
| 826 | + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth, | ||
| 827 | + canvasId: 'share', | ||
| 828 | + success: function(res) { | ||
| 829 | + that.setData({ | ||
| 830 | + shareImgPath: res.tempFilePath, | ||
| 831 | + canvasHidden: true | ||
| 832 | + }) | ||
| 833 | + if (!res.tempFilePath) { | ||
| 834 | + wx.showModal({ | ||
| 835 | + title: '提示', | ||
| 836 | + content: '图片绘制中,请稍后重试', | ||
| 837 | + showCancel: false | ||
| 838 | + }) | ||
| 839 | + return false; | ||
| 840 | + } | ||
| 841 | + wx.previewImage({ | ||
| 842 | + //将图片预览出来 | ||
| 843 | + urls: [that.data.shareImgPath] | ||
| 844 | + }); | ||
| 845 | + //-- 将商品清空 -- | ||
| 846 | + th.setData({share_good:null}); | ||
| 847 | + | ||
| 848 | + wx.hideLoading(); | ||
| 849 | + } | ||
| 850 | + }) | ||
| 851 | + }, 500) | ||
| 852 | + | ||
| 853 | + }); | ||
| 854 | + }); | ||
| 855 | + } | ||
| 856 | + }); | ||
| 857 | + | ||
| 858 | + }, | ||
| 859 | + //---点击分享优惠活动--- | ||
| 860 | + share_index:function(e){ | ||
| 861 | + | ||
| 862 | + //--先判断会员状态-- | ||
| 863 | + var user_info = getApp().globalData.userInfo; | ||
| 864 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 865 | + //getApp().my_warnning("请先登录",0,this); | ||
| 866 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 867 | + return false; | ||
| 868 | + } | ||
| 869 | + | ||
| 870 | + var index=e.currentTarget.dataset.index; | ||
| 871 | + var item=this.data.list[index]; | ||
| 872 | + this.setData({share_hidden:0,hui_active:item}); | ||
| 873 | + | ||
| 874 | + var com = this.selectComponent("#share_button"); //组件的id | ||
| 875 | + com.set_type(1); | ||
| 876 | + }, | ||
| 877 | + //---点击分享商品--- | ||
| 878 | + share_good:function(e){ | ||
| 879 | + | ||
| 880 | + //--先判断会员状态-- | ||
| 881 | + var user_info = getApp().globalData.userInfo; | ||
| 882 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 883 | + //getApp().my_warnning("请先登录",0,this); | ||
| 884 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 885 | + return false; | ||
| 886 | + } | ||
| 887 | + | ||
| 888 | + var index=e.currentTarget.dataset.index; | ||
| 889 | + var item=this.data.list[index]; | ||
| 890 | + this.setData({share_hidden:0,share_good:item}); | ||
| 891 | + | ||
| 892 | + var com = this.selectComponent("#share_button"); //组件的id | ||
| 893 | + com.set_type(0); | ||
| 894 | + }, | ||
| 895 | + | ||
| 896 | + //----活动详情里面的分享--- | ||
| 897 | + share_good2:function(e){ | ||
| 898 | + //--先判断会员状态-- | ||
| 899 | + var user_info = getApp().globalData.userInfo; | ||
| 900 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 901 | + //getApp().my_warnning("请先登录",0,this); | ||
| 902 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 903 | + return false; | ||
| 904 | + } | ||
| 905 | + | ||
| 906 | + var index=e.currentTarget.dataset.index; | ||
| 907 | + var item=this.data.list2[index]; | ||
| 908 | + this.setData({share_hidden:0,share_good:item}); | ||
| 909 | + var com = this.selectComponent("#share_button"); //组件的id | ||
| 910 | + com.set_type(0); | ||
| 911 | + }, | ||
| 912 | + | ||
| 913 | + //-----详情里面的分享------- | ||
| 914 | + share_detail:function(e){ | ||
| 915 | + | ||
| 916 | + //--先判断会员状态-- | ||
| 917 | + var user_info = getApp().globalData.userInfo; | ||
| 918 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 919 | + //getApp().my_warnning("请先登录",0,this); | ||
| 920 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 921 | + return false; | ||
| 922 | + } | ||
| 923 | + | ||
| 924 | + var com = this.selectComponent("#share_button"); //组件的id | ||
| 925 | + com.set_type(0); | ||
| 926 | + | ||
| 927 | + var idx=e.currentTarget.dataset.index; | ||
| 928 | + var item=this.data.list2[index]; | ||
| 929 | + this.setData({share_hidden:0,share_good:item}); | ||
| 930 | + }, | ||
| 931 | + | ||
| 932 | + cancel:function(){ | ||
| 933 | + this.setData({share_hidden:1}); | ||
| 934 | + }, | ||
| 935 | + | ||
| 936 | + //--获取头像的本地缓存,回调写法-- | ||
| 937 | + get_head_temp: function(tt, func) { | ||
| 938 | + var ee = this; | ||
| 939 | + if (ee.data.share_head) { | ||
| 940 | + tt(func); | ||
| 941 | + return false; | ||
| 942 | + } | ||
| 943 | + //---获取分享图片的本地地址,头像和商品图片---- | ||
| 944 | + var path2 = getApp().globalData.userInfo.head_pic; | ||
| 945 | + if (path2 == "") { | ||
| 946 | + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; | ||
| 947 | + tt(func); | ||
| 948 | + } else { | ||
| 949 | + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | ||
| 950 | + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | ||
| 951 | + wx.getImageInfo({ | ||
| 952 | + src: path2, | ||
| 953 | + success: function(res) { | ||
| 954 | + //res.path是网络图片的本地地址 | ||
| 955 | + ee.data.share_head = res.path; | ||
| 956 | + tt(func); | ||
| 957 | + }, | ||
| 958 | + fail: function(res) { | ||
| 959 | + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 | ||
| 960 | + tt(func); | ||
| 961 | + } | ||
| 962 | + }); | ||
| 963 | + } | ||
| 964 | + }, | ||
| 965 | + //--获取商品图片的本地缓存,回调写法-- | ||
| 966 | + get_goods_temp: function(tt) { | ||
| 967 | + var ee = this; | ||
| 968 | + //获取商品是分享图信息 | ||
| 969 | + wx.getImageInfo({ | ||
| 970 | + src: ee.data.url+ee.data.share_good.original_img, | ||
| 971 | + success: function(res) { | ||
| 972 | + //res.path是网络图片的本地地址 | ||
| 973 | + ee.data.share_goods_img = res.path; | ||
| 974 | + tt(); | ||
| 975 | + }, | ||
| 976 | + fail: function(res) { | ||
| 977 | + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | ||
| 978 | + tt(); | ||
| 979 | + } | ||
| 980 | + }); | ||
| 981 | + }, | ||
| 982 | + | ||
| 983 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | ||
| 984 | + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { | ||
| 985 | + var lineWidth = 0; | ||
| 986 | + var lastSubStrIndex = 0; //每次开始截取的字符串的索引 | ||
| 987 | + var han = 0; | ||
| 988 | + for (let i = 0; i < str.length; i++) { | ||
| 989 | + if (han == 2) return; | ||
| 990 | + //lineWidth += ctx.measureText(str[i]).width; | ||
| 991 | + lineWidth += ut.measureText(str[i], 21.3 * unit); | ||
| 992 | + if (lineWidth > canvasWidth) { | ||
| 993 | + han++; | ||
| 994 | + | ||
| 995 | + if (han == 2) | ||
| 996 | + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | ||
| 997 | + else | ||
| 998 | + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | ||
| 999 | + | ||
| 1000 | + initHeight += 22; //22为字体的高度 | ||
| 1001 | + lineWidth = 0; | ||
| 1002 | + lastSubStrIndex = i; | ||
| 1003 | + titleHeight += 20; | ||
| 1004 | + } | ||
| 1005 | + if (i == str.length - 1) { //绘制剩余部分 | ||
| 1006 | + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); | ||
| 1007 | + } | ||
| 1008 | + } | ||
| 1009 | + }, | ||
| 1010 | + | ||
| 1011 | + //---小于10的格式化函数---- | ||
| 1012 | + timeFormat(param) { | ||
| 1013 | + return param < 10 ? '0' + param : param; | ||
| 1014 | + }, | ||
| 1015 | + | ||
| 1016 | + //----倒计时函数----- | ||
| 1017 | + countDown() { | ||
| 1018 | + if(!this.data.timer) return false; | ||
| 1019 | + var th=this; | ||
| 1020 | + // 获取当前时间,同时得到活动结束时间数组 | ||
| 1021 | + let newTime =ut.gettimestamp(); | ||
| 1022 | + var endTimeList = this.data.list; | ||
| 1023 | + if(endTimeList==null) return null | ||
| 1024 | + // 对结束时间进行处理渲染到页面 | ||
| 1025 | + for (var i = 0; i < endTimeList.length;i++){ | ||
| 1026 | + var o = endTimeList[i]; | ||
| 1027 | + var endTime = o.end_time; | ||
| 1028 | + let obj = null; | ||
| 1029 | + // 如果活动未结束,对时间进行处理 | ||
| 1030 | + if (endTime - newTime > 0){ | ||
| 1031 | + let time = (endTime - newTime); | ||
| 1032 | + // 获取天、时、分、秒 | ||
| 1033 | + let day = parseInt(time / (60 * 60 * 24)); | ||
| 1034 | + let hou = parseInt(time % (60 * 60 * 24) / 3600); | ||
| 1035 | + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | ||
| 1036 | + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | ||
| 1037 | + obj = { | ||
| 1038 | + day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec), hide: 1 | ||
| 1039 | + } | ||
| 1040 | + }else{ | ||
| 1041 | + //活动已结束,全部设置为'00' | ||
| 1042 | + obj = { day: '00', hou: '00', min: '00', sec: '00' } | ||
| 1043 | + } | ||
| 1044 | + var txt ="list["+i+"].djs"; | ||
| 1045 | + th.setData({ [txt]: obj}); | ||
| 1046 | + } | ||
| 1047 | + }, | ||
| 1048 | + | ||
| 1049 | + //-------搜索的相关功能------ | ||
| 1050 | + set_search_value:function(e){ | ||
| 1051 | + var key_str=e.detail.value; | ||
| 1052 | + if(key_str) key_str=key_str.trim(); | ||
| 1053 | + this.setData({key_str:key_str}); | ||
| 1054 | + | ||
| 1055 | + }, | ||
| 1056 | + search_data:function(){ | ||
| 1057 | + this.setData({ | ||
| 1058 | + is_no_data:0,is_no_more:0,list:[], | ||
| 1059 | + }); | ||
| 1060 | + this.data.is_load=0; | ||
| 1061 | + this.data.currentPage=1; | ||
| 1062 | + this.requestGoodsList(); | ||
| 1063 | + }, | ||
| 1064 | + | ||
| 1065 | + | ||
| 1066 | + go_goods:function(e){ | ||
| 1067 | + var index=e.currentTarget.dataset.index; | ||
| 1068 | + var item=this.data.list[index]; | ||
| 1069 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | ||
| 1070 | + getApp().goto(url); | ||
| 1071 | + }, | ||
| 1072 | + | ||
| 1073 | + go_coll_good:function(e){ | ||
| 1074 | + var gid=e.currentTarget.dataset.gid; | ||
| 1075 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; | ||
| 1076 | + getApp().goto(url); | ||
| 1077 | + }, | ||
| 1078 | + | ||
| 1079 | + go_libao:function(e){ | ||
| 1080 | + var index=e.currentTarget.dataset.index; | ||
| 1081 | + var item=this.data.list[index]; | ||
| 1082 | + var lbid=item.lbId; | ||
| 1083 | + var url="/pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; | ||
| 1084 | + getApp().goto(url); | ||
| 1085 | + } | ||
| 1086 | + | ||
| 1087 | + | ||
| 1088 | +}) | ||
| 0 | \ No newline at end of file | 1089 | \ No newline at end of file |
packageA/pages/activity_share/activity_share.json
0 → 100644
packageA/pages/activity_share/activity_share.wxml
0 → 100644
| 1 | +<wxs module="g_filter" src="g_filter.wxs"></wxs> | ||
| 2 | +<view class="container"> | ||
| 3 | + <!-- 搜索框 --> | ||
| 4 | + <view class="search-container"> | ||
| 5 | + <view class="input-container"><input bindinput="set_search_value" class="search" type="text" placeholder="请输入您想查找的商品信息"/></view> | ||
| 6 | + <view bindtap="search_data" class="btn-search">搜索</view> | ||
| 7 | + </view> | ||
| 8 | + | ||
| 9 | + <!-- 列表 --> | ||
| 10 | + <view class="list-container"> | ||
| 11 | + <!-- 标题 --> | ||
| 12 | + <view class="title" > | ||
| 13 | + <block wx:for="{{tab}}"> | ||
| 14 | + <view class="title-item {{currentIndex == index ? 'active':''}}" data-index="{{index}}" bindtap="clickTab">{{item}}</view> | ||
| 15 | + </block> | ||
| 16 | + </view> | ||
| 17 | + <!-- 促销页标题 --> | ||
| 18 | + <view class="subTab-title flex" wx:if="{{currentIndex == 2}}"> | ||
| 19 | + <block wx:for="{{tab2}}"> | ||
| 20 | + <view class="subTab-titleItem {{currentIndex2 == index ? 'active':''}}" data-index="{{index}}" bindtap="clickTab2">{{item}}</view> | ||
| 21 | + </block> | ||
| 22 | + </view> | ||
| 23 | + <!-- 列表项 --> | ||
| 24 | + <scroll-view | ||
| 25 | + class="list {{currentIndex == 2?'active1':''}} {{currentIndex == 3?'active2':''}}" | ||
| 26 | + scroll-y="true" | ||
| 27 | + bindscrolltolower="refresh" | ||
| 28 | + scroll-anchoring | ||
| 29 | + > | ||
| 30 | + | ||
| 31 | + <block wx:for="{{list}}"> | ||
| 32 | + | ||
| 33 | + <!-- 拼单和秒杀 --> | ||
| 34 | + <block wx:if="{{currentIndex == 0 || currentIndex == 1}}"> | ||
| 35 | + <view class class="list-item" bindtap="go_goods" data-index="{{index}}"> | ||
| 36 | + <view class="img-container"> | ||
| 37 | + <image src="{{url+item.original_img}}" style="width: 100%; height: 100%;" | ||
| 38 | + binderror="bind_bnerr2" lazy-load="true" | ||
| 39 | + data-errorimg="list[{{index}}].original_img"></image> | ||
| 40 | + | ||
| 41 | + </view> | ||
| 42 | + <view class="details"> | ||
| 43 | + <view class="fs28 name ellipsis-2">{{item.title}}</view> | ||
| 44 | + <view> | ||
| 45 | + <!-- 点击秒杀时显示 --> | ||
| 46 | + <view class="flex ai-center pdtb8" wx:if="{{currentIndex == 0}}"> | ||
| 47 | + <view class="progress-container"> | ||
| 48 | + <progress class="progress" percent="{{100*(item.goods_num-item.buy_num)/item.goods_num}}" border-radius="6" stroke-width="14" activeColor="#FE6867" backgroundColor="#ccc"></progress> | ||
| 49 | + <text class="percent fs20">剩余{{g_filter.toFix(100*(item.goods_num-item.buy_num)/item.goods_num,2) }}%</text> | ||
| 50 | + </view> | ||
| 51 | + <view class="fs22 gray">已抢{{item.buy_num}}件</view> | ||
| 52 | + </view> | ||
| 53 | + <!-- 点击拼单时显示 --> | ||
| 54 | + <view class="flex pdtb6" wx:if="{{currentIndex == 1}}"> | ||
| 55 | + <view class="group-num">已拼{{item.buy_num}}份</view> | ||
| 56 | + <view class="group-type">1人团</view> | ||
| 57 | + </view> | ||
| 58 | + <!-- 公共项 --> | ||
| 59 | + <view class="fs22 red">剩余: | ||
| 60 | + <text class='tui-conutdown-box'> {{item.djs.day}}</text>天 | ||
| 61 | + <text class='tui-conutdown-box'>{{item.djs.hou}}</text>时 | ||
| 62 | + <text class='tui-conutdown-box'>{{item.djs.min}}</text>分 | ||
| 63 | + <text class='tui-conutdown-box tui-countdown-bg'>{{item.djs.sec}}</text>秒 | ||
| 64 | + </view> | ||
| 65 | + </view> | ||
| 66 | + <view class="red flex ai-center"> | ||
| 67 | + <view>¥{{item.price}}</view> | ||
| 68 | + <view class="retail">零售价:¥{{item.market_price}}</view> | ||
| 69 | + </view> | ||
| 70 | + <view catchtap="share_good" data-index="{{index}}" class="t-r fs28"><text class="btn-share">分享</text></view> | ||
| 71 | + </view> | ||
| 72 | + </view> | ||
| 73 | + </block> | ||
| 74 | + | ||
| 75 | + <!-- 促销 - 订单促销 --> | ||
| 76 | + <block wx:if="{{currentIndex == 2}}"> | ||
| 77 | + <view class="subTab-container"> | ||
| 78 | + <view class="subTab-list"> | ||
| 79 | + <view class="subTab-item"> | ||
| 80 | + <view class="bdr-b"> | ||
| 81 | + <view class="flex"> | ||
| 82 | + <view wx:if="{{currentIndex2==1 && item.type==0}}" class="badge">折</view> | ||
| 83 | + <view wx:if="{{currentIndex2==1 && item.type==1}}" class="badge">减</view> | ||
| 84 | + <view wx:if="{{currentIndex2==1}}" class="badge">配</view> | ||
| 85 | + <view wx:if="{{currentIndex2==2}}" class="badge">惠</view> | ||
| 86 | + <view wx:if="{{currentIndex2==1}}" class="ellipsis-1">{{item.main_goods_name}}</view> | ||
| 87 | + <view wx:else class="ellipsis-1">{{item.name}}</view> | ||
| 88 | + </view> | ||
| 89 | + <view class="pdv10 fs28">促销时间:{{g_filter.format_time(item.start_time,1)}} 到 {{g_filter.format_time(item.end_time,1)}}</view> | ||
| 90 | + </view> | ||
| 91 | + <view class="flex-space-between" wx:if="{{currentIndex2 == 0}}"> | ||
| 92 | + <view class="fs28"> | ||
| 93 | + <view class="pdv10">需购买金额:¥{{g_filter.toFix(item.money,2)}}</view> | ||
| 94 | + <view wx:if="{{item.type==0}}">折扣:{{item.expression}}(%)</view> | ||
| 95 | + <view wx:if="{{item.type==1}}">优惠金额:{{g_filter.toFix(item.expression,2)}}</view> | ||
| 96 | + </view> | ||
| 97 | + <view bindtap="share_index" data-index="{{index}}" class="btn-container"><text class="btn-share">分享</text></view> | ||
| 98 | + </view> | ||
| 99 | + <view class="flex-equality pdt20" wx:else> | ||
| 100 | + <view bindtap="showPopup" data-index="{{index}}" class="btn-container" ><text class="btn-share">活动详情</text></view> | ||
| 101 | + <view bindtap="share_index" data-index="{{index}}" class="btn-container"><text class="btn-share w164">分享</text></view> | ||
| 102 | + </view> | ||
| 103 | + </view> | ||
| 104 | + </view> | ||
| 105 | + </view> | ||
| 106 | + </block> | ||
| 107 | + | ||
| 108 | + <!-- 专享礼包 --> | ||
| 109 | + <block wx:if="{{currentIndex == 3}}"> | ||
| 110 | + <view class class="list-item" bindtap="go_libao" data-index="{{index}}"> | ||
| 111 | + <view class="img-container"> | ||
| 112 | + <image src="{{url+item.lbUrl}}" style="width: 100%; height: 100%;" | ||
| 113 | + binderror="bind_bnerr2" lazy-load="true" | ||
| 114 | + data-errorimg="list[{{index}}].lbUrl"></image> | ||
| 115 | + </view> | ||
| 116 | + <view class="details"> | ||
| 117 | + <view class="ellipsis-2 fs28 name">{{item.giftTitle}}</view> | ||
| 118 | + <view class="pdt14 red"> | ||
| 119 | + <tex wx:if="{{item.payMoney}}">¥{{g_filter.toFix(item.payMoney,2)}}</tex> | ||
| 120 | + <text wx:if="{{item.payMoney && item.payIntegral}}">/</text> | ||
| 121 | + <text wx:if="{{item.payIntegral}}">{{item.payIntegral}}积分</text> | ||
| 122 | + </view> | ||
| 123 | + <view class="fs22 line-through gray">零售价:¥{{item.giftPosPrice}}</view> | ||
| 124 | + <!-- <view class="fs22">已售:<text class="red">3</text></view> --> | ||
| 125 | + <view catchtap="share_index" data-index="{{index}}" class="t-r fs28"><view class="btn-share">分享</view></view> | ||
| 126 | + </view> | ||
| 127 | + </view> | ||
| 128 | + </block> | ||
| 129 | + | ||
| 130 | + </block><!--for的闭合 --> | ||
| 131 | + <view style="height: 1rpx;"></view> | ||
| 132 | + <nodata wx:if="{{list.length==0}}" nodataContainer="nodata">暂无数据</nodata> | ||
| 133 | + <view wx:if="{{is_no_more}}" class="no-more t-c">- 已全部加载 -</view> | ||
| 134 | + </scroll-view> | ||
| 135 | + </view> | ||
| 136 | + | ||
| 137 | + <!-- 底部栏 --> | ||
| 138 | + <view class="tabbar flex" wx:if="{{currentIndex == 0 || currentIndex == 1}}" bindtap="clickTab3"> | ||
| 139 | + <view class="tabbar-item {{currentIndex3 == 0?'active':''}}" data-index="0"> | ||
| 140 | + <text class="iconfont icon-hot"></text>火热进行 | ||
| 141 | + </view> | ||
| 142 | + <view class="tabbar-item {{currentIndex3 == 1?'active':''}}" data-index="1"> | ||
| 143 | + <text class="iconfont icon-clock"></text>即将开始 | ||
| 144 | + </view> | ||
| 145 | + </view> | ||
| 146 | + | ||
| 147 | + <!-- 弹出层 --> | ||
| 148 | + <view class="popup-container" hidden="{{hiddenPopup}}"> | ||
| 149 | + <view class="popup"> | ||
| 150 | + <view class="popup-content {{currentIndex2 == 2?'active':''}}"> | ||
| 151 | + <view class="popup-title dash-b">活动详情</view> | ||
| 152 | + <!-- 搭配促销 --> | ||
| 153 | + <block wx:if="{{currentIndex2 == 1}}"> | ||
| 154 | + <view class="pdv20 dash-b fs28" bindtap="go_coll_good" data-gid="{{hui_active.main_goods_id}}"> | ||
| 155 | + <view class="popup-title2">必买商品</view> | ||
| 156 | + <view class="popup-title3">商品编号:{{hui_active.goods_sn}}</view> | ||
| 157 | + <view class="popup-title3">{{hui_active.main_goods_name}}</view> | ||
| 158 | + <view class="popup-title3 red">手店价:¥{{g_filter.toFix(hui_active.ginfo.shop_price,2)}}</view> | ||
| 159 | + </view> | ||
| 160 | + <view class="pdv20"> | ||
| 161 | + <view class="popup-title2 fs28">搭配商品</view> | ||
| 162 | + <view class="fs28"> | ||
| 163 | + <view class="flex t-c bold pdv10"> | ||
| 164 | + <view class="w25">序号</view> | ||
| 165 | + <view class="w25">商品信息</view> | ||
| 166 | + <view class="w25">手店价</view> | ||
| 167 | + <view class="w25">搭配价</view> | ||
| 168 | + </view> | ||
| 169 | + <view class="popup-list t-c"> | ||
| 170 | + <block wx:for="{{list2}}"> | ||
| 171 | + <view class="flex ai-center pdb10" bindtap="go_coll_good" data-gid="{{item.goods_id}}"> | ||
| 172 | + <view class="w25">{{index+1}}</view> | ||
| 173 | + <view class="w25 ellipsis-2">{{item.goods_name}}</view> | ||
| 174 | + <view class="w25">¥{{g_filter.toFix(item.shop_price,2)}}</view> | ||
| 175 | + <view class="w25 red">¥{{g_filter.toFix(item.price,2)}}</view> | ||
| 176 | + </view> | ||
| 177 | + </block> | ||
| 178 | + | ||
| 179 | + </view> | ||
| 180 | + </view> | ||
| 181 | + </view> | ||
| 182 | + </block> | ||
| 183 | + | ||
| 184 | + <!-- 优惠促销 --> | ||
| 185 | + <block wx:if="{{currentIndex2 == 2}}"> | ||
| 186 | + <view class="pdv20 dash-b"> | ||
| 187 | + <view class="popup-title2 fs28">参与对象</view> | ||
| 188 | + <view class="flex ai-center t-c fs28 pdv20"> | ||
| 189 | + <view class="w50"> | ||
| 190 | + <radio wx:if="{{hui_active.good_object==0}}" checked="true" disabled/> | ||
| 191 | + <radio wx:else disabled/> | ||
| 192 | + 全部商品 | ||
| 193 | + </view> | ||
| 194 | + <view class="w50"> | ||
| 195 | + <radio wx:if="{{hui_active.good_object==1}}" checked="true" disabled/> | ||
| 196 | + <radio wx:else disabled/> | ||
| 197 | + 指定商品 | ||
| 198 | + </view> | ||
| 199 | + </view> | ||
| 200 | + <view class="fs28"> | ||
| 201 | + <view class="flex t-c bold pdv10"> | ||
| 202 | + <view class="w25">序号</view> | ||
| 203 | + <view class="w25">商品信息</view> | ||
| 204 | + <view class="w25">手店价</view> | ||
| 205 | + <view class="w25">操作</view> | ||
| 206 | + </view> | ||
| 207 | + <view class="t-c"> | ||
| 208 | + <block wx:for="{{list2}}"> | ||
| 209 | + <view class="flex ai-center pdb10" bindtap="go_coll_good" data-gid="{{item.goods_id}}"> | ||
| 210 | + <view class="w25">{{index+1}}</view> | ||
| 211 | + <view class="w25 ellipsis-2">{{item.goods_name}}</view> | ||
| 212 | + <view class="w25">¥{{item.shop_price}}</view> | ||
| 213 | + <view catchtap="share_good2" data-index="{{index}}" class="w25"><text class="btn-share">分享</text></view> | ||
| 214 | + </view> | ||
| 215 | + </block> | ||
| 216 | + </view> | ||
| 217 | + </view> | ||
| 218 | + </view> | ||
| 219 | + <view class="pdv20"> | ||
| 220 | + <view class="popup-title2 fs28">活动详情</view> | ||
| 221 | + <view class="fs28"> | ||
| 222 | + <block wx:for="{{prom_goods}}"> | ||
| 223 | + <view class="pdv10">需购买:{{item.condition}} | ||
| 224 | + <text wx:if="{{item.prom_type==0}}">元</text> | ||
| 225 | + <text wx:else>件</text> | ||
| 226 | + </view> | ||
| 227 | + <view class="pdl20"> | ||
| 228 | + <view class="flex pdb20"> | ||
| 229 | + <view class="w50" wx:if="{{item.money}}"><radio checked="true" disabled/>减现金 <text class="red">-{{item.money}}</text></view> | ||
| 230 | + <view class="w50" wx:if="{{item.sale}}"><radio checked="true" disabled/>打折 <text class="red">{{item.sale}}%</text></view> | ||
| 231 | + </view> | ||
| 232 | + <view class="flex pdb20"> | ||
| 233 | + <view class="w50"><radio wx:if="{{item.past}}" checked="true" disabled/><radio wx:else disabled/>包邮</view> | ||
| 234 | + <view class="w50"> | ||
| 235 | + <block wx:if="{{item.intValue}}"> | ||
| 236 | + <radio disabled/>积分 <text class="red">{{item.intValue}}</text> | ||
| 237 | + </block> | ||
| 238 | + <block wx:else> | ||
| 239 | + <radio disabled/>积分 | ||
| 240 | + </block> | ||
| 241 | + </view> | ||
| 242 | + </view> | ||
| 243 | + <view class="pdb20"><radio wx:if="{{item.couponId}}" checked="true" disabled/> <radio wx:else disabled/>优惠券</view> | ||
| 244 | + <view class="pdb20"><radio wx:if="{{item.gift_id}}" checked="true" disabled/> <radio wx:else disabled/>赠品</view> | ||
| 245 | + <view><radio wx:if="{{item.lb_id}}" checked="true" disabled/> <radio wx:else disabled/>礼包</view> | ||
| 246 | + </view> | ||
| 247 | + </block> | ||
| 248 | + | ||
| 249 | + </view> | ||
| 250 | + </view> | ||
| 251 | + </block> | ||
| 252 | + </view> | ||
| 253 | + <view class="popup-btn t-c"><text class="iconfont icon-close" bindtap="closePopup"></text></view> | ||
| 254 | + </view> | ||
| 255 | + </view> | ||
| 256 | +</view> | ||
| 257 | + | ||
| 258 | +<!--二维码显示页面--> | ||
| 259 | +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas> | ||
| 260 | +<!-- 分享控件,底部弹出 --> | ||
| 261 | +<share_button id="share_button" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{!share_hidden}}"></share_button> |
packageA/pages/activity_share/activity_share.wxss
0 → 100644
| 1 | +/* packageA//pages/goods_share/goods_share.wxss */ | ||
| 2 | +.red { | ||
| 3 | + color: #FE6867; | ||
| 4 | +} | ||
| 5 | +.gray { | ||
| 6 | + color: #7b7b7b; | ||
| 7 | +} | ||
| 8 | +.w25 { | ||
| 9 | + width: 25%; | ||
| 10 | +} | ||
| 11 | +.w50 { | ||
| 12 | + width: 50%; | ||
| 13 | +} | ||
| 14 | +.w164 { | ||
| 15 | + width: 164rpx; | ||
| 16 | +} | ||
| 17 | +.bold { | ||
| 18 | + font-weight: bold; | ||
| 19 | +} | ||
| 20 | +page { | ||
| 21 | + background-color: #f2f2f2; | ||
| 22 | + height: 100%; | ||
| 23 | +} | ||
| 24 | +.container { | ||
| 25 | + background-color: white; | ||
| 26 | + height: 100%; | ||
| 27 | +} | ||
| 28 | +.search-container { | ||
| 29 | + display: flex; | ||
| 30 | + padding: 26rpx 20rpx; | ||
| 31 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 32 | +} | ||
| 33 | +.input-container { | ||
| 34 | + flex: 1; | ||
| 35 | + border-radius: 6rpx 0 0 6rpx; | ||
| 36 | + overflow: hidden; | ||
| 37 | +} | ||
| 38 | +.search { | ||
| 39 | + background-color: #f0f0f0; | ||
| 40 | + padding: 10rpx 20rpx; | ||
| 41 | + font-size: 28rpx; | ||
| 42 | +} | ||
| 43 | +.btn-search { | ||
| 44 | + background-color: #FE6867; | ||
| 45 | + color: white; | ||
| 46 | + padding: 0 30rpx; | ||
| 47 | + display: flex; | ||
| 48 | + align-items: center; | ||
| 49 | + border-radius: 0 6rpx 6rpx 0; | ||
| 50 | +} | ||
| 51 | +.title { | ||
| 52 | + display: flex; | ||
| 53 | + font-size: 30rpx; | ||
| 54 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 55 | +} | ||
| 56 | +.title .iconfont { | ||
| 57 | + color: #ccc; | ||
| 58 | + font-size: 16rpx; | ||
| 59 | + margin-left: 8rpx; | ||
| 60 | +} | ||
| 61 | +.title-item { | ||
| 62 | + width: 25%; | ||
| 63 | + box-sizing: border-box; | ||
| 64 | + text-align: center; | ||
| 65 | + padding: 20rpx; | ||
| 66 | + position: relative; | ||
| 67 | +} | ||
| 68 | +.title-item.active { | ||
| 69 | + color: #FE6867; | ||
| 70 | + font-weight: bold; | ||
| 71 | +} | ||
| 72 | +.title-item.active:after { | ||
| 73 | + content:''; | ||
| 74 | + position: absolute; | ||
| 75 | + width: 50%; | ||
| 76 | + height: 4rpx; | ||
| 77 | + background-color: #FE6867; | ||
| 78 | + left: 0; | ||
| 79 | + right: 0; | ||
| 80 | + bottom: 0; | ||
| 81 | + margin: 0 auto; | ||
| 82 | +} | ||
| 83 | +.list-container { | ||
| 84 | + height: calc(100% - 118rpx); | ||
| 85 | +} | ||
| 86 | +.list { | ||
| 87 | + box-sizing: border-box; | ||
| 88 | + height: calc(100% - 82rpx); | ||
| 89 | + background-color: #f2f2f2; | ||
| 90 | + padding-bottom: 102rpx; | ||
| 91 | +} | ||
| 92 | +.list.active1 { | ||
| 93 | + height: calc(100% - 82rpx - 78rpx); | ||
| 94 | + padding-bottom: 0; | ||
| 95 | +} | ||
| 96 | +.list.active2 { | ||
| 97 | + padding-bottom: 0; | ||
| 98 | +} | ||
| 99 | +.list-item { | ||
| 100 | + display: flex; | ||
| 101 | + padding: 20rpx; | ||
| 102 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 103 | + background-color: white; | ||
| 104 | +} | ||
| 105 | +.img-container { | ||
| 106 | + background-color: #f0f0f0; | ||
| 107 | + width: 280rpx; | ||
| 108 | + height: 248rpx; | ||
| 109 | + display: flex; | ||
| 110 | + align-items: center; | ||
| 111 | + justify-content: center; | ||
| 112 | +} | ||
| 113 | +.img-container:after { | ||
| 114 | + | ||
| 115 | +} | ||
| 116 | +.details { | ||
| 117 | + flex: 1; | ||
| 118 | + padding-left: 20rpx; | ||
| 119 | +} | ||
| 120 | +.btn-share { | ||
| 121 | + box-sizing: border-box; | ||
| 122 | + display: inline-block; | ||
| 123 | + background-color: #FE6867; | ||
| 124 | + color: white; | ||
| 125 | + padding: 8rpx 30rpx; | ||
| 126 | + border-radius: 6rpx; | ||
| 127 | + text-align: center; | ||
| 128 | +} | ||
| 129 | +.pdt14 { | ||
| 130 | + padding-top: 14rpx; | ||
| 131 | +} | ||
| 132 | +.pdtb6 { | ||
| 133 | + padding-top: 6rpx; | ||
| 134 | + padding-bottom: 6rpx; | ||
| 135 | +} | ||
| 136 | +.pdtb8 { | ||
| 137 | + padding-top: 8rpx; | ||
| 138 | + padding-bottom: 8rpx; | ||
| 139 | +} | ||
| 140 | +.pdl20 { | ||
| 141 | + padding-left: 104rpx; | ||
| 142 | +} | ||
| 143 | + | ||
| 144 | + | ||
| 145 | +.no-more { | ||
| 146 | + line-height: 3; | ||
| 147 | + color: #ccc; | ||
| 148 | + /* background-color: #f2f2f2; */ | ||
| 149 | +} | ||
| 150 | +.nodata { | ||
| 151 | + text-align: center; | ||
| 152 | + background-color: #f2f2f2; | ||
| 153 | +} | ||
| 154 | +.progress-container { | ||
| 155 | + width: 55%; | ||
| 156 | + padding-right: 10rpx; | ||
| 157 | + position: relative; | ||
| 158 | + text-align: center; | ||
| 159 | +} | ||
| 160 | +.retail { | ||
| 161 | + color: #7b7b7b; | ||
| 162 | + text-decoration: line-through; | ||
| 163 | + font-size: 22rpx; | ||
| 164 | + padding-left: 20rpx; | ||
| 165 | +} | ||
| 166 | +.name { | ||
| 167 | + height: 76rpx; | ||
| 168 | + overflow: hidden; | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +.percent { | ||
| 172 | + position: absolute; | ||
| 173 | + top: 0; | ||
| 174 | + bottom: 0; | ||
| 175 | + left: 0; | ||
| 176 | + right: 0; | ||
| 177 | + margin: auto; | ||
| 178 | + color: white; | ||
| 179 | +} | ||
| 180 | +.tabbar { | ||
| 181 | + position: fixed; | ||
| 182 | + width: 100%; | ||
| 183 | + bottom: 0; | ||
| 184 | + background-color: white; | ||
| 185 | +} | ||
| 186 | +.tabbar:after { | ||
| 187 | + position: absolute; | ||
| 188 | + content: ''; | ||
| 189 | + width: 2rpx; | ||
| 190 | + height: 50%; | ||
| 191 | + top: 0; | ||
| 192 | + bottom: 0; | ||
| 193 | + left: 0; | ||
| 194 | + right: 0; | ||
| 195 | + margin: auto; | ||
| 196 | + background-color: #f0f0f0; | ||
| 197 | +} | ||
| 198 | +.tabbar-item { | ||
| 199 | + width: 50%; | ||
| 200 | + text-align: center; | ||
| 201 | + padding-top: 30rpx; | ||
| 202 | + padding-bottom: 30rpx; | ||
| 203 | +} | ||
| 204 | +.tabbar-item .iconfont { | ||
| 205 | + margin-right: 10rpx; | ||
| 206 | +} | ||
| 207 | +.tabbar-item.active { | ||
| 208 | + color: #FE6867; | ||
| 209 | +} | ||
| 210 | + | ||
| 211 | + | ||
| 212 | +.group-type, | ||
| 213 | +.group-num { | ||
| 214 | + position: relative; | ||
| 215 | + font-size: 22rpx; | ||
| 216 | +} | ||
| 217 | +.group-type:before, | ||
| 218 | +.group-num:before { | ||
| 219 | + font-family: iconfont; | ||
| 220 | +} | ||
| 221 | +.group-type:before { | ||
| 222 | + content: '\e66a'; | ||
| 223 | + color: white; | ||
| 224 | + background-color: #FE6867; | ||
| 225 | + position: absolute; | ||
| 226 | + left: 0; | ||
| 227 | + top: 0; | ||
| 228 | + bottom: 0; | ||
| 229 | + padding-left: 6rpx; | ||
| 230 | + padding-right: 10rpx; | ||
| 231 | + line-height: 30rpx; | ||
| 232 | +} | ||
| 233 | +.group-num:before { | ||
| 234 | + padding-right: 6rpx; | ||
| 235 | +} | ||
| 236 | +.group-num:before { | ||
| 237 | + content: '\e694'; | ||
| 238 | + position: relative; | ||
| 239 | +} | ||
| 240 | +.group-num { | ||
| 241 | + color: white; | ||
| 242 | + background-color: #FE6867; | ||
| 243 | + border-radius: 34rpx; | ||
| 244 | + padding-left: 10rpx; | ||
| 245 | + padding-right: 10rpx; | ||
| 246 | + margin-right: 14rpx; | ||
| 247 | +} | ||
| 248 | +.group-type { | ||
| 249 | + color: #FE6867; | ||
| 250 | + border: 2rpx solid #FE6867; | ||
| 251 | + padding-left: 42rpx; | ||
| 252 | + padding-right: 4rpx; | ||
| 253 | + border-radius: 6rpx; | ||
| 254 | +} | ||
| 255 | + | ||
| 256 | +.badge { | ||
| 257 | + color: white; | ||
| 258 | + padding: 0 20rpx; | ||
| 259 | + border-radius: 6rpx; | ||
| 260 | + background-color: #FE6867; | ||
| 261 | + margin-right: 10rpx; | ||
| 262 | +} | ||
| 263 | + | ||
| 264 | +.subTab-title { | ||
| 265 | + text-align: center; | ||
| 266 | + justify-content: center; | ||
| 267 | + align-items: center; | ||
| 268 | + font-size: 28rpx; | ||
| 269 | +} | ||
| 270 | +.subTab-list { | ||
| 271 | + padding: 20rpx; | ||
| 272 | +} | ||
| 273 | +.subTab-titleItem { | ||
| 274 | + box-sizing: border-box; | ||
| 275 | + width: calc(100% / 3); | ||
| 276 | + padding: 20rpx 40rpx; | ||
| 277 | + background-color: white; | ||
| 278 | + border-right: 2rpx solid #f8f8f8; | ||
| 279 | +} | ||
| 280 | +.subTab-titleItem:last-child { | ||
| 281 | + border-right: none; | ||
| 282 | +} | ||
| 283 | +.subTab-titleItem.active { | ||
| 284 | + background-color: #FE6867; | ||
| 285 | + color: white; | ||
| 286 | +} | ||
| 287 | +.subTab-item { | ||
| 288 | + padding: 20rpx; | ||
| 289 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 290 | + background-color: white; | ||
| 291 | + border-radius: 8rpx; | ||
| 292 | + box-shadow: 0 8px 12px #e7e9eb; | ||
| 293 | +} | ||
| 294 | +.subTab-item ~ .subTab-item { | ||
| 295 | + margin-top: 20rpx; | ||
| 296 | +} | ||
| 297 | +.pdv10 { | ||
| 298 | + padding-top: 10rpx; | ||
| 299 | + padding-bottom: 10rpx; | ||
| 300 | +} | ||
| 301 | +.pdv20 { | ||
| 302 | + padding-top: 20rpx; | ||
| 303 | + padding-bottom: 20rpx; | ||
| 304 | +} | ||
| 305 | +.pdb10 { | ||
| 306 | + padding-bottom: 10rpx; | ||
| 307 | +} | ||
| 308 | +.pdb20 { | ||
| 309 | + padding-bottom: 20rpx; | ||
| 310 | +} | ||
| 311 | +.bdr-b { | ||
| 312 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 313 | +} | ||
| 314 | +.dash-b { | ||
| 315 | + border-bottom: 2rpx dashed #ddd; | ||
| 316 | +} | ||
| 317 | +.btn-container { | ||
| 318 | + display: flex; | ||
| 319 | + align-items: flex-end; | ||
| 320 | + font-size: 26rpx; | ||
| 321 | +} | ||
| 322 | + | ||
| 323 | + | ||
| 324 | +.popup-container { | ||
| 325 | + content:''; | ||
| 326 | + position: fixed; | ||
| 327 | + top: 0; | ||
| 328 | + bottom: 0; | ||
| 329 | + left: 0; | ||
| 330 | + right: 0; | ||
| 331 | + z-index: 3; | ||
| 332 | + background-color: rgba(0,0,0,.6); | ||
| 333 | + display: flex; | ||
| 334 | + align-items: center; | ||
| 335 | + justify-content: center; | ||
| 336 | +} | ||
| 337 | +.popup { | ||
| 338 | + width: 90%; | ||
| 339 | +} | ||
| 340 | +.popup-content { | ||
| 341 | + box-sizing: border-box; | ||
| 342 | + width: 100%; | ||
| 343 | + background-color: white; | ||
| 344 | + padding: 0 20rpx; | ||
| 345 | + border-radius: 10rpx; | ||
| 346 | + max-height: 1038rpx; | ||
| 347 | +} | ||
| 348 | +.icon-close { | ||
| 349 | + font-size: 60rpx; | ||
| 350 | + color: white; | ||
| 351 | +} | ||
| 352 | +.popup-btn { | ||
| 353 | + padding-top: 30rpx; | ||
| 354 | +} | ||
| 355 | + | ||
| 356 | +.popup-title { | ||
| 357 | + /* font-size: 28rpx; */ | ||
| 358 | + font-weight: bold; | ||
| 359 | + padding: 20rpx 0; | ||
| 360 | +} | ||
| 361 | +.popup-title2 { | ||
| 362 | + /* padding: 10rpx 0; */ | ||
| 363 | + padding-bottom: 8rpx; | ||
| 364 | +} | ||
| 365 | +.popup-title3 { | ||
| 366 | + padding-left: 34rpx; | ||
| 367 | + font-size: 30rpx; | ||
| 368 | +} | ||
| 369 | +.popup-list { | ||
| 370 | + max-height: 602rpx; | ||
| 371 | + overflow-y: auto; | ||
| 372 | +} | ||
| 373 | + | ||
| 374 | + | ||
| 375 | +radio .wx-radio-input { | ||
| 376 | + width: 28rpx; | ||
| 377 | + height: 28rpx; | ||
| 378 | +} | ||
| 379 | + | ||
| 380 | + | ||
| 381 | +radio .wx-radio-input.wx-radio-input-checked { | ||
| 382 | + background-color: #FE6867; | ||
| 383 | + border-color: #FE6867; | ||
| 384 | +} | ||
| 385 | +radio .wx-radio-input.wx-radio-input-checked::before{ | ||
| 386 | + color: white; | ||
| 387 | +} | ||
| 388 | + | ||
| 389 | +.popup-content.active { | ||
| 390 | + max-height: 982rpx; | ||
| 391 | + overflow: auto; | ||
| 392 | +} | ||
| 393 | + | ||
| 394 | + |
packageA/pages/activity_share/g_filter.wxs
0 → 100644
| 1 | +var g_filters = { | ||
| 2 | + //-- 判断是不是有等级价 -- | ||
| 3 | + is_has_rank:function(rank_switch,item){ | ||
| 4 | + if(!rank_switch) return false; | ||
| 5 | + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true} | ||
| 6 | + return false; | ||
| 7 | + }, | ||
| 8 | + | ||
| 9 | + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | ||
| 10 | + get_card_price:function(goods,all_card,type){ | ||
| 11 | + var price1=parseFloat(goods['cardprice1']); | ||
| 12 | + var price2=parseFloat(goods['cardprice2']); | ||
| 13 | + var price3=parseFloat(goods['cardprice3']); | ||
| 14 | + if(!all_card){ | ||
| 15 | + if(type==0) return 0; | ||
| 16 | + return ""; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + var arr=[]; | ||
| 20 | + var min_price= 0; | ||
| 21 | + var min_name=""; | ||
| 22 | + | ||
| 23 | + var min_price=null; | ||
| 24 | + var min_name=null; | ||
| 25 | + //---设置对应的价格名字---- | ||
| 26 | + for(var i=0;i<3;i++) { | ||
| 27 | + var vl=all_card[i]; | ||
| 28 | + if(!vl) continue; | ||
| 29 | + if(vl['CorrPrice']=="Price1" && price1>0) | ||
| 30 | + { | ||
| 31 | + if(min_price==null) { | ||
| 32 | + min_price=price1;min_name=vl['CardName']; | ||
| 33 | + } | ||
| 34 | + else if(price1<min_price) { | ||
| 35 | + min_price=price1;min_name=vl['CardName']; | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + if(vl['CorrPrice']=="Price2" && price2>0) | ||
| 39 | + { | ||
| 40 | + if(min_price==null) { | ||
| 41 | + min_price=price2;min_name=vl['CardName']; | ||
| 42 | + } | ||
| 43 | + else if(price2<min_price) { | ||
| 44 | + min_price=price2;min_name=vl['CardName']; | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + if(vl['CorrPrice']=="Price3" && price3>0) | ||
| 49 | + { | ||
| 50 | + if(min_price==null) { | ||
| 51 | + min_price=price3;min_name=vl['CardName']; | ||
| 52 | + } | ||
| 53 | + else if(price3<min_price) { | ||
| 54 | + min_price=price3;min_name=vl['CardName']; | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + } | ||
| 59 | + if(min_price==null){ | ||
| 60 | + if(type==0) return 0; | ||
| 61 | + return ""; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + //if(type==0) return arr.length; | ||
| 65 | + //--进行排序,升序--- | ||
| 66 | + /*--- | ||
| 67 | + arr.sort(function(a,b){ | ||
| 68 | + if (a.price < b.price) { | ||
| 69 | + return -1; | ||
| 70 | + } else if (a.fee == b.fee) { | ||
| 71 | + return 0; | ||
| 72 | + } else { | ||
| 73 | + return 1; | ||
| 74 | + } | ||
| 75 | + })--*/ | ||
| 76 | + //-- 获取最下价钱,和相应的卡的名称 -- | ||
| 77 | + if(type==0) return min_price.toFixed(2); | ||
| 78 | + if(min_name.length>4) min_name=min_name.substring(0, 8); | ||
| 79 | + return min_name; | ||
| 80 | + }, | ||
| 81 | + | ||
| 82 | + toFix: function (val, count) { | ||
| 83 | + val = parseFloat(val); | ||
| 84 | + return val.toFixed(count) | ||
| 85 | + }, | ||
| 86 | + format_time: function (ts, isFull) { | ||
| 87 | + // 如果数值位数为1,则补0 | ||
| 88 | + function appendZero(obj) { | ||
| 89 | + if (obj < 10) { | ||
| 90 | + return "0" + "" + obj; | ||
| 91 | + } else { | ||
| 92 | + return obj; | ||
| 93 | + } | ||
| 94 | + }; | ||
| 95 | + | ||
| 96 | + if (ts == null || ts == undefined || ts == '') return ""; | ||
| 97 | + var d = getDate(ts * 1000) | ||
| 98 | + var fm = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('-'); | ||
| 99 | + var md = (d.getMonth() + 1) + '月' + d.getDate() + '日'; | ||
| 100 | + if (isFull == 1) | ||
| 101 | + fm = fm + ' ' + [d.getHours(), d.getMinutes(), d.getSeconds()].join(':'); | ||
| 102 | + if (isFull == 2) { | ||
| 103 | + fm = md + ' ' + [appendZero(d.getHours()), appendZero(d.getMinutes())].join(':'); | ||
| 104 | + } | ||
| 105 | + return fm; | ||
| 106 | + }, | ||
| 107 | + | ||
| 108 | +} | ||
| 109 | +module.exports = { | ||
| 110 | + is_has_rank:g_filters.is_has_rank, | ||
| 111 | + get_card_price:g_filters.get_card_price, | ||
| 112 | + toFix:g_filters.toFix, | ||
| 113 | + format_time:g_filters.format_time, | ||
| 114 | +} | ||
| 0 | \ No newline at end of file | 115 | \ No newline at end of file |
packageA/pages/goods_share/g_filter.wxs
0 → 100644
| 1 | +var g_filters = { | ||
| 2 | + //-- 判断是不是有等级价 -- | ||
| 3 | + is_has_rank:function(rank_switch,item){ | ||
| 4 | + if(!rank_switch) return false; | ||
| 5 | + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true} | ||
| 6 | + return false; | ||
| 7 | + }, | ||
| 8 | + | ||
| 9 | + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 -- | ||
| 10 | + get_card_price:function(goods,all_card,type){ | ||
| 11 | + var price1=parseFloat(goods['cardprice1']); | ||
| 12 | + var price2=parseFloat(goods['cardprice2']); | ||
| 13 | + var price3=parseFloat(goods['cardprice3']); | ||
| 14 | + if(!all_card){ | ||
| 15 | + if(type==0) return 0; | ||
| 16 | + return ""; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + var arr=[]; | ||
| 20 | + var min_price= 0; | ||
| 21 | + var min_name=""; | ||
| 22 | + | ||
| 23 | + var min_price=null; | ||
| 24 | + var min_name=null; | ||
| 25 | + //---设置对应的价格名字---- | ||
| 26 | + for(var i=0;i<3;i++) { | ||
| 27 | + var vl=all_card[i]; | ||
| 28 | + if(!vl) continue; | ||
| 29 | + if(vl['CorrPrice']=="Price1" && price1>0) | ||
| 30 | + { | ||
| 31 | + if(min_price==null) { | ||
| 32 | + min_price=price1;min_name=vl['CardName']; | ||
| 33 | + } | ||
| 34 | + else if(price1<min_price) { | ||
| 35 | + min_price=price1;min_name=vl['CardName']; | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + if(vl['CorrPrice']=="Price2" && price2>0) | ||
| 39 | + { | ||
| 40 | + if(min_price==null) { | ||
| 41 | + min_price=price2;min_name=vl['CardName']; | ||
| 42 | + } | ||
| 43 | + else if(price2<min_price) { | ||
| 44 | + min_price=price2;min_name=vl['CardName']; | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + if(vl['CorrPrice']=="Price3" && price3>0) | ||
| 49 | + { | ||
| 50 | + if(min_price==null) { | ||
| 51 | + min_price=price3;min_name=vl['CardName']; | ||
| 52 | + } | ||
| 53 | + else if(price3<min_price) { | ||
| 54 | + min_price=price3;min_name=vl['CardName']; | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + } | ||
| 59 | + if(min_price==null){ | ||
| 60 | + if(type==0) return 0; | ||
| 61 | + return ""; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + //if(type==0) return arr.length; | ||
| 65 | + //--进行排序,升序--- | ||
| 66 | + /*--- | ||
| 67 | + arr.sort(function(a,b){ | ||
| 68 | + if (a.price < b.price) { | ||
| 69 | + return -1; | ||
| 70 | + } else if (a.fee == b.fee) { | ||
| 71 | + return 0; | ||
| 72 | + } else { | ||
| 73 | + return 1; | ||
| 74 | + } | ||
| 75 | + })--*/ | ||
| 76 | + //-- 获取最下价钱,和相应的卡的名称 -- | ||
| 77 | + if(type==0) return min_price.toFixed(2); | ||
| 78 | + if(min_name.length>4) min_name=min_name.substring(0, 8); | ||
| 79 | + return min_name; | ||
| 80 | + }, | ||
| 81 | +} | ||
| 82 | +module.exports = { | ||
| 83 | + is_has_rank:g_filters.is_has_rank, | ||
| 84 | + get_card_price:g_filters.get_card_price, | ||
| 85 | +} | ||
| 0 | \ No newline at end of file | 86 | \ No newline at end of file |
packageA/pages/goods_share/goods_share.js
0 → 100644
| 1 | +// packageA//pages/goods_share/goods_share.js | ||
| 2 | +var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js"); | ||
| 3 | +Page({ | ||
| 4 | + /** | ||
| 5 | + * 页面的初始数据 | ||
| 6 | + */ | ||
| 7 | + data: { | ||
| 8 | + // 控制价格 | ||
| 9 | + active1: false, | ||
| 10 | + // 控制佣金 | ||
| 11 | + active2: false, | ||
| 12 | + url:oo.imghost, | ||
| 13 | + orderField:'sales_sum', | ||
| 14 | + orderType:'desc', | ||
| 15 | + list:[], | ||
| 16 | + is_load:0, //是否正在加载 | ||
| 17 | + is_no_data:0, //没有数据 | ||
| 18 | + is_no_more:0, //没有更多数据 | ||
| 19 | + key_str:'', | ||
| 20 | + pattern:0, //分成的方式 | ||
| 21 | + currentPage:1, //当前的页码 | ||
| 22 | + | ||
| 23 | + canvasHidden: 1, //-- 隐藏画布 -- | ||
| 24 | + dis_switch:0, //-- 分销开关 -- | ||
| 25 | + pattern:0, //-- 分成的方式 -- | ||
| 26 | + share_hidden:1, //-- 分享的按钮隐藏 -- | ||
| 27 | + share_good:null //--- 要分享的商品 --- | ||
| 28 | + }, | ||
| 29 | + /** | ||
| 30 | + * 生命周期函数--监听页面加载 | ||
| 31 | + */ | ||
| 32 | + onLoad: function (options) { | ||
| 33 | + var th=this; | ||
| 34 | + //接受有没有导购的参数 | ||
| 35 | + var first_leader=options.first_leader; | ||
| 36 | + if(first_leader){ | ||
| 37 | + //-- user_id代过来免登陆 -- | ||
| 38 | + getApp().globalData.user_id=first_leader; | ||
| 39 | + getApp().getUserFir(); | ||
| 40 | + } | ||
| 41 | + this.requestGoodsList(); | ||
| 42 | + | ||
| 43 | + //-- 自定义海报 -- | ||
| 44 | + getApp().request.promiseGet("/api/weshop/goods/poster/page",{ | ||
| 45 | + data:{store_id:os.stoid, type:1, is_use:1 } | ||
| 46 | + }).then(res=>{ | ||
| 47 | + if(res.data.code==0){ | ||
| 48 | + | ||
| 49 | + var poster_data=res.data.data.pageData[0]; | ||
| 50 | + var json_str=poster_data.jsonStr; | ||
| 51 | + | ||
| 52 | + if(json_str){ | ||
| 53 | + var json_data=JSON.parse(json_str); | ||
| 54 | + if(json_data.bg_img){ | ||
| 55 | + | ||
| 56 | + //-- 把图片那到本地 -- | ||
| 57 | + wx.getImageInfo({ | ||
| 58 | + src:json_data.bg_img, | ||
| 59 | + success: function(res) { | ||
| 60 | + var path= res.path; | ||
| 61 | + th.setData({share_b_img:path}) | ||
| 62 | + }, | ||
| 63 | + fail: function(res) {} | ||
| 64 | + }); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + th.setData({poster:json_data}) | ||
| 68 | + | ||
| 69 | + } | ||
| 70 | + } | ||
| 71 | + }) | ||
| 72 | + | ||
| 73 | + //获取分销的配置 | ||
| 74 | + getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{ | ||
| 75 | + if(res.data.code==0){ | ||
| 76 | + th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern}); | ||
| 77 | + } | ||
| 78 | + }) | ||
| 79 | + //获取用户设备信息,屏幕宽度 | ||
| 80 | + wx.getSystemInfo({ | ||
| 81 | + success: res => { | ||
| 82 | + th.setData({ | ||
| 83 | + screenWidth: res.screenWidth | ||
| 84 | + }) | ||
| 85 | + } | ||
| 86 | + }); | ||
| 87 | + | ||
| 88 | + }, | ||
| 89 | + | ||
| 90 | + /*** 生命周期函数--监听页面显示***/ | ||
| 91 | + onShow: function () { | ||
| 92 | + var th=this; | ||
| 93 | + getApp().getConfig2(function(rs){ | ||
| 94 | + //计算等级价相关 | ||
| 95 | + var swithc_list=rs.switch_list; | ||
| 96 | + var sw_arr=JSON.parse(swithc_list); | ||
| 97 | + //---如果后台又开等级卡的开关--- | ||
| 98 | + if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){ | ||
| 99 | + th.setData({rank_switch:true}); | ||
| 100 | + var user=getApp().globalData.userInfo; | ||
| 101 | + var ti=setInterval(function(){ | ||
| 102 | + if(!user) return false; | ||
| 103 | + clearInterval(ti); | ||
| 104 | + //---回调卡的列表--- | ||
| 105 | + th.getPlusCardType(function(ob){ | ||
| 106 | + th.setData({card_list:ob.card_list}); | ||
| 107 | + if(user.card_field ){ | ||
| 108 | + var str = user['card_expiredate'].replace(/-/g, '/'); | ||
| 109 | + var end = new Date(str); | ||
| 110 | + end = Date.parse(end) / 1000; | ||
| 111 | + var now = ut.gettimestamp(); | ||
| 112 | + //--- 判断是等级会员,且在有效期范围内 --- | ||
| 113 | + if(user.card_field && now<end){ | ||
| 114 | + var card_name=ob.name_map.get(user.card_field); | ||
| 115 | + // if(card_name.length>4) card_name=card_name.substring(0,4); | ||
| 116 | + th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list}); | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + }) | ||
| 120 | + },500) | ||
| 121 | + } | ||
| 122 | + }); | ||
| 123 | + }, | ||
| 124 | + | ||
| 125 | + /** | ||
| 126 | + * 生命周期函数--监听页面隐藏 | ||
| 127 | + */ | ||
| 128 | + onHide: function () {}, | ||
| 129 | + /**e | ||
| 130 | + * 用户点击右上角分享 | ||
| 131 | + */ | ||
| 132 | + onShareAppMessage: function () { | ||
| 133 | + var th = this; | ||
| 134 | + var item=this.data.share_good; | ||
| 135 | + var price = item.shop_price; | ||
| 136 | + var title= item.goods_name; | ||
| 137 | + var img=this.data.url+item.original_img; | ||
| 138 | + | ||
| 139 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | ||
| 140 | + if(getApp().globalData.user_id){ | ||
| 141 | + url+="&first_leader="+getApp().globalData.user_id; | ||
| 142 | + } | ||
| 143 | + var ob={ | ||
| 144 | + title: price + "元 " +title, | ||
| 145 | + path:url, | ||
| 146 | + imageUrl: img, | ||
| 147 | + }; | ||
| 148 | + th.setData({share_hidden:1}); | ||
| 149 | + return ob; | ||
| 150 | + | ||
| 151 | + }, | ||
| 152 | + | ||
| 153 | + // 点击价格排序 | ||
| 154 | + sort1() { | ||
| 155 | + if(this.data.active2) { | ||
| 156 | + this.setData({ | ||
| 157 | + active2: !this.data.active2 | ||
| 158 | + }); | ||
| 159 | + }; | ||
| 160 | + if(this.data.orderField!="shop_price"){ | ||
| 161 | + this.setData({ | ||
| 162 | + active1: 1,orderField:'shop_price',orderType:'asc',is_no_data:0,is_no_more:0,list:[], | ||
| 163 | + }); | ||
| 164 | + }else{ | ||
| 165 | + | ||
| 166 | + var ty=this.data.orderType=='asc'?'desc':'asc'; | ||
| 167 | + this.setData({ | ||
| 168 | + orderType:ty,is_no_data:0,is_no_more:0,list:[], | ||
| 169 | + }); | ||
| 170 | + } | ||
| 171 | + this.data.is_load=0; | ||
| 172 | + this.data.currentPage=1; | ||
| 173 | + this.requestGoodsList(); | ||
| 174 | + | ||
| 175 | + }, | ||
| 176 | + // 点击佣金排序 | ||
| 177 | + sort2() { | ||
| 178 | + if(this.data.active1) { | ||
| 179 | + this.setData({ | ||
| 180 | + active1: !this.data.active1 | ||
| 181 | + }); | ||
| 182 | + }; | ||
| 183 | + if(this.data.orderField!="commission"){ | ||
| 184 | + | ||
| 185 | + if(this.data.pattern==0){ | ||
| 186 | + this.setData({ | ||
| 187 | + active2: 1,orderField:'commission',orderType:'asc',is_no_data:0,is_no_more:0,list:[], | ||
| 188 | + }); | ||
| 189 | + }else{ | ||
| 190 | + this.setData({ | ||
| 191 | + active2: 1,orderField:'(fir_rate+sec_rate+thi_rate)',orderType:'asc',is_no_data:0,is_no_more:0,list:[], | ||
| 192 | + }); | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + | ||
| 196 | + }else{ | ||
| 197 | + this.setData({ | ||
| 198 | + orderType: (this.data.orderType=='asc'?'desc':'asc'),is_no_data:0,is_no_more:0,list:[], | ||
| 199 | + }); | ||
| 200 | + } | ||
| 201 | + this.data.is_load=0; | ||
| 202 | + this.data.currentPage=1; | ||
| 203 | + this.requestGoodsList(); | ||
| 204 | + }, | ||
| 205 | + | ||
| 206 | + //-- ----销量---- | ||
| 207 | + sale_sort(){ | ||
| 208 | + if(this.data.orderField!="sales_sum"){ | ||
| 209 | + this.setData({ | ||
| 210 | + active1: 0,active2:0,orderType:'desc',is_no_data:0,is_no_more:0,orderField:'sales_sum',list:[], | ||
| 211 | + }); | ||
| 212 | + this.data.is_load=0; | ||
| 213 | + this.data.currentPage=1; | ||
| 214 | + this.requestGoodsList(); | ||
| 215 | + } | ||
| 216 | + }, | ||
| 217 | + | ||
| 218 | + //-- ---最新--- | ||
| 219 | + new_sort:function(){ | ||
| 220 | + if(this.data.orderField!="is_new"){ | ||
| 221 | + this.setData({ | ||
| 222 | + active1: 0,active2:0,orderType:'desc',is_no_data:0,is_no_more:0,orderField:'is_new',list:[], | ||
| 223 | + }); | ||
| 224 | + this.data.is_load=0; | ||
| 225 | + this.data.currentPage=1; | ||
| 226 | + this.requestGoodsList(); | ||
| 227 | + } | ||
| 228 | + }, | ||
| 229 | + | ||
| 230 | + requestGoodsList:function(){ | ||
| 231 | + var th=this; | ||
| 232 | + if(th.data.is_load) return false; //-- 正在加载 | ||
| 233 | + if(th.data.is_no_data) return false; //-- 没有数据 | ||
| 234 | + if(th.data.is_no_more) return false; //-- 没有更多 | ||
| 235 | + th.data.is_load=1; | ||
| 236 | + | ||
| 237 | + var url="/api/weshop/goods/page"; | ||
| 238 | + var req_data={ | ||
| 239 | + page:this.data.currentPage, | ||
| 240 | + is_mainshow:1, | ||
| 241 | + isonsale:1, | ||
| 242 | + store_id:oo.stoid, | ||
| 243 | + orderField:this.data.orderField, | ||
| 244 | + orderType:this.data.orderType, | ||
| 245 | + } | ||
| 246 | + if(this.data.key_str && this.data.key_str.trim()){ | ||
| 247 | + var str=this.data.key_str.trim(); | ||
| 248 | + req_data.key_str=str; | ||
| 249 | + } | ||
| 250 | + //-- ---调用接口---- | ||
| 251 | + app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{ | ||
| 252 | + th.data.is_load=0; | ||
| 253 | + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | ||
| 254 | + th.data.currentPage++; | ||
| 255 | + var data=res.data.data.pageData; | ||
| 256 | + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});} | ||
| 257 | + var list=th.data.list; | ||
| 258 | + list=list.concat(data); | ||
| 259 | + th.setData({list:list}); | ||
| 260 | + }else{ | ||
| 261 | + if(th.data.currentPage==1){ | ||
| 262 | + th.setData({is_no_data:1}); | ||
| 263 | + } | ||
| 264 | + } | ||
| 265 | + }) | ||
| 266 | + }, | ||
| 267 | + | ||
| 268 | + | ||
| 269 | + //--- 获取卡类列表 --- | ||
| 270 | + getPlusCardType: function (func) { | ||
| 271 | + var storid = oo.stoid; | ||
| 272 | + var th = this; | ||
| 273 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | ||
| 274 | + var plusCard = res.data.data; | ||
| 275 | + var arr = [1219, 2089, 3031]; | ||
| 276 | + var new_arr = new Array(); | ||
| 277 | + var card_name_map=new Map(); | ||
| 278 | + var user = getApp().globalData.userInfo; | ||
| 279 | + for (var i = 0; i < plusCard.length; i++) { | ||
| 280 | + if ((user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) { | ||
| 281 | + continue; | ||
| 282 | + } | ||
| 283 | + var name="card"+plusCard[i].CorrPrice.toLowerCase(); | ||
| 284 | + card_name_map.set(name,plusCard[i].CardName); | ||
| 285 | + new_arr.push(plusCard[i]); | ||
| 286 | + } | ||
| 287 | + | ||
| 288 | + var ob={"card_list":new_arr,"name_map":card_name_map}; | ||
| 289 | + func(ob); | ||
| 290 | + }) | ||
| 291 | + }, | ||
| 292 | + | ||
| 293 | + | ||
| 294 | + //---图片失败,默认图片--- | ||
| 295 | + bind_bnerr2: function (e) { | ||
| 296 | + var _errImg = e.target.dataset.errorimg; | ||
| 297 | + var _errObj = {}; | ||
| 298 | + _errObj[_errImg] ="/miniapp/images/default_g_img.gif"; | ||
| 299 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
| 300 | + }, | ||
| 301 | + //-- ---更多加载---- | ||
| 302 | + refresh:function(){ | ||
| 303 | + this.requestGoodsList(); | ||
| 304 | + }, | ||
| 305 | + | ||
| 306 | + //--定义的保存图片方法,分享团--- | ||
| 307 | + saveImageToPhotosAlbum: function() { | ||
| 308 | + //--先判断会员状态-- | ||
| 309 | + var user_info = getApp().globalData.userInfo; | ||
| 310 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 311 | + //getApp().my_warnning("请先登录",0,this); | ||
| 312 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 313 | + return false; | ||
| 314 | + } | ||
| 315 | + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 | ||
| 316 | + var type = 0; | ||
| 317 | + wx.showLoading({ | ||
| 318 | + title: '生成中...', | ||
| 319 | + }) | ||
| 320 | + var that = this, th = that; | ||
| 321 | + //设置画板显示,才能开始绘图 | ||
| 322 | + that.setData({ | ||
| 323 | + canvasHidden: false,share_hidden:1 | ||
| 324 | + }) | ||
| 325 | + | ||
| 326 | + var app = getApp(); | ||
| 327 | + var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | ||
| 328 | + var scene = th.data.share_good.goods_id+""; | ||
| 329 | + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; | ||
| 330 | + if(user_id>0){ | ||
| 331 | + scene+="_"+user_id; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + ///二微码 | ||
| 335 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | ||
| 336 | + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | ||
| 337 | + | ||
| 338 | + //读取文件成功则OK-- | ||
| 339 | + wx.getImageInfo({ | ||
| 340 | + src: path3, | ||
| 341 | + success: function(res) { | ||
| 342 | + //回调写法 | ||
| 343 | + th.get_head_temp(th.get_goods_temp, function() { | ||
| 344 | + var vpath = res.path; | ||
| 345 | + var context = wx.createCanvasContext('share'); | ||
| 346 | + //先画背景 | ||
| 347 | + var pg_path = "../../../images/share/share_bg.png"; | ||
| 348 | + | ||
| 349 | + //-- 如果有自定义海报的时候,判断背景的图片 -- | ||
| 350 | + if(th.data.share_b_img){ | ||
| 351 | + pg_path=th.data.share_b_img; | ||
| 352 | + } | ||
| 353 | + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | ||
| 354 | + | ||
| 355 | + //-- 是自定义海报的情况下 -- | ||
| 356 | + if(th.data.poster && parseInt(th.data.poster.style)==2){ | ||
| 357 | + //在线上分享人的情况下 | ||
| 358 | + if(parseInt(th.data.poster.show_headpic)){ | ||
| 359 | + //获取坐标 | ||
| 360 | + var x=parseFloat(th.data.poster.head_x)*2; | ||
| 361 | + var y=parseFloat(th.data.poster.head_y)*2; | ||
| 362 | + var x1=(x+90) *unit; | ||
| 363 | + var y1=(y+50) *unit; | ||
| 364 | + //--昵称--- | ||
| 365 | + context.setFontSize(24 * unit) | ||
| 366 | + context.setFillStyle("black") | ||
| 367 | + context.fillText(app.globalData.userInfo.nickname, x1, y1); | ||
| 368 | + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; | ||
| 369 | + //强烈推荐 改许程 | ||
| 370 | + var tj_path = "../../../images/share/q_tj.png"; | ||
| 371 | + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit); | ||
| 372 | + context.setFontSize(16 * unit) | ||
| 373 | + context.setLineJoin('round'); //交点设置成圆角 | ||
| 374 | + context.setFillStyle("white") | ||
| 375 | + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit); | ||
| 376 | + } | ||
| 377 | + }else{ | ||
| 378 | + //--昵称--- | ||
| 379 | + context.setFontSize(24 * unit) | ||
| 380 | + context.setFillStyle("black") | ||
| 381 | + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); | ||
| 382 | + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; | ||
| 383 | + //强烈推荐 改许程 | ||
| 384 | + var tj_path = "../../../images/share/q_tj.png"; | ||
| 385 | + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); | ||
| 386 | + context.setFontSize(16 * unit) | ||
| 387 | + context.setLineJoin('round'); //交点设置成圆角 | ||
| 388 | + context.setFillStyle("white") | ||
| 389 | + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); | ||
| 390 | + } | ||
| 391 | + | ||
| 392 | + | ||
| 393 | + //---产品名称--- | ||
| 394 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | ||
| 395 | + context.setFillStyle("black"); | ||
| 396 | + context.setFontSize(21.3 * unit) | ||
| 397 | + th.draw_Text(context, th.data.share_good.goods_name, | ||
| 398 | + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit); | ||
| 399 | + //------产品的价格------- | ||
| 400 | + context.setFontSize(23 * unit) | ||
| 401 | + context.setFillStyle("red") | ||
| 402 | + context.fillText("¥", 416 * unit, 185 * unit); | ||
| 403 | + context.setFontSize(31 * unit) | ||
| 404 | + var pri0 = th.data.share_good.shop_price; | ||
| 405 | + if (th.data.prom_act) | ||
| 406 | + pri0 = th.data.prom_act.price; | ||
| 407 | + | ||
| 408 | + pri0 = parseFloat(pri0).toFixed(2); | ||
| 409 | + context.fillText(pri0, 438 * unit, 185 * unit); | ||
| 410 | + //---市场价划掉--- | ||
| 411 | + context.setFillStyle("gray") | ||
| 412 | + context.setFontSize(22 * unit) | ||
| 413 | + context.fillText("¥" + th.data.share_good.market_price, 426 * unit, 213 * unit); | ||
| 414 | + context.setStrokeStyle('gray') | ||
| 415 | + context.setLineWidth(1 * unit) | ||
| 416 | + context.moveTo(426 * unit, 206 * unit) | ||
| 417 | + context.lineTo(510 * unit, 206 * unit) | ||
| 418 | + context.stroke(); | ||
| 419 | + //---中间大图--- | ||
| 420 | + context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit); | ||
| 421 | + //-------大图后面就不一样了----------- | ||
| 422 | + switch (type) { | ||
| 423 | + case 0: //普通商品的展示 | ||
| 424 | + //中间的几个字 | ||
| 425 | + if(th.data.poster && parseInt(th.data.poster.style)==2 ){ | ||
| 426 | + if(parseInt(th.data.poster.show_quality)){ | ||
| 427 | + var g_path = "../../../images/share/s_gou.png"; | ||
| 428 | + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 429 | + context.setFillStyle("red") | ||
| 430 | + context.setFontSize(18 * unit) | ||
| 431 | + context.fillText("正品保证", 84 * unit, 690 * unit); | ||
| 432 | + | ||
| 433 | + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 434 | + context.setFillStyle("red") | ||
| 435 | + context.setFontSize(18 * unit) | ||
| 436 | + context.fillText("纯实体店", 246 * unit, 690 * unit); | ||
| 437 | + | ||
| 438 | + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 439 | + context.setFillStyle("red") | ||
| 440 | + context.setFontSize(18 * unit) | ||
| 441 | + context.fillText("官方验证", 420 * unit, 690 * unit); | ||
| 442 | + } | ||
| 443 | + | ||
| 444 | + }else{ | ||
| 445 | + var g_path = "../../../images/share/s_gou.png"; | ||
| 446 | + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 447 | + context.setFillStyle("red") | ||
| 448 | + context.setFontSize(18 * unit) | ||
| 449 | + context.fillText("正品保证", 84 * unit, 690 * unit); | ||
| 450 | + | ||
| 451 | + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 452 | + context.setFillStyle("red") | ||
| 453 | + context.setFontSize(18 * unit) | ||
| 454 | + context.fillText("纯实体店", 246 * unit, 690 * unit); | ||
| 455 | + | ||
| 456 | + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit); | ||
| 457 | + context.setFillStyle("red") | ||
| 458 | + context.setFontSize(18 * unit) | ||
| 459 | + context.fillText("官方验证", 420 * unit, 690 * unit); | ||
| 460 | + } | ||
| 461 | + | ||
| 462 | + //---画线--- | ||
| 463 | + context.setLineWidth(1 * unit) | ||
| 464 | + context.moveTo(32 * unit, 710 * unit) | ||
| 465 | + context.lineTo(520 * unit, 710 * unit) | ||
| 466 | + context.stroke(); | ||
| 467 | + //---文字--- | ||
| 468 | + context.setFillStyle("black") | ||
| 469 | + context.setFontSize(22 * unit) | ||
| 470 | + // 原来start ---> | ||
| 471 | + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit); | ||
| 472 | + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit); | ||
| 473 | + | ||
| 474 | + //---二维吗图--- | ||
| 475 | + //-- 自定义海报 -- | ||
| 476 | + if(th.data.poster){ | ||
| 477 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 478 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 479 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 480 | + }else{ | ||
| 481 | + //---二维吗图--- | ||
| 482 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 483 | + } | ||
| 484 | + | ||
| 485 | + break; | ||
| 486 | + case 1: //秒杀商品的展示 | ||
| 487 | + //---画线--- | ||
| 488 | + context.setLineWidth(1 * unit) | ||
| 489 | + context.moveTo(32 * unit, 670 * unit) | ||
| 490 | + context.lineTo(520 * unit, 670 * unit) | ||
| 491 | + context.stroke(); | ||
| 492 | + | ||
| 493 | + //画秒杀的图片 | ||
| 494 | + var miaos_path = '../../../images/share/miao_share.png'; | ||
| 495 | + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); | ||
| 496 | + | ||
| 497 | + //---文字--- | ||
| 498 | + context.setFontSize(22 * unit) | ||
| 499 | + context.setFillStyle("black") | ||
| 500 | + context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit); | ||
| 501 | + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit); | ||
| 502 | + //---二维吗图--- | ||
| 503 | + //-- 自定义海报 -- | ||
| 504 | + if(th.data.poster){ | ||
| 505 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 506 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 507 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 508 | + }else{ | ||
| 509 | + //---二维吗图--- | ||
| 510 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 511 | + } | ||
| 512 | + | ||
| 513 | + | ||
| 514 | + break; | ||
| 515 | + | ||
| 516 | + case 2: //会员团和商家团的展示 | ||
| 517 | + //---画线--- | ||
| 518 | + context.setLineWidth(1 * unit) | ||
| 519 | + context.moveTo(32 * unit, 670 * unit) | ||
| 520 | + context.lineTo(520 * unit, 670 * unit) | ||
| 521 | + context.stroke(); | ||
| 522 | + //---文字--- | ||
| 523 | + context.setFontSize(22 * unit) | ||
| 524 | + context.font = 'normal bold'; | ||
| 525 | + context.setFillStyle("black") | ||
| 526 | + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | ||
| 527 | + | ||
| 528 | + //绘制成团图片 | ||
| 529 | + var ct_img = "../../../images/share/ct_num.png"; | ||
| 530 | + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit); | ||
| 531 | + var ct_num = th.data.prom_act.ct_num; | ||
| 532 | + context.setFontSize(14 * unit) | ||
| 533 | + context.font = 'normal'; | ||
| 534 | + context.setFillStyle("red") | ||
| 535 | + if (ct_num < 10) { | ||
| 536 | + context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit); | ||
| 537 | + } else { | ||
| 538 | + context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit); | ||
| 539 | + } | ||
| 540 | + context.setFontSize(22 * unit) | ||
| 541 | + context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit); | ||
| 542 | + context.setFillStyle("gray") | ||
| 543 | + context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit); | ||
| 544 | + context.setFillStyle("black") | ||
| 545 | + context.font = 'normal bold 18px sans-serif'; | ||
| 546 | + context.setFontSize(21.3 * unit) | ||
| 547 | + context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit); | ||
| 548 | + //---二维吗图--- | ||
| 549 | + //-- 自定义海报 -- | ||
| 550 | + if(th.data.poster){ | ||
| 551 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 552 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 553 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 554 | + }else{ | ||
| 555 | + //---二维吗图--- | ||
| 556 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 557 | + } | ||
| 558 | + break | ||
| 559 | + case 3: //阶梯团的展示 | ||
| 560 | + //---画线--- | ||
| 561 | + context.setLineWidth(1 * unit) | ||
| 562 | + context.moveTo(32 * unit, 670 * unit) | ||
| 563 | + context.lineTo(520 * unit, 670 * unit) | ||
| 564 | + context.stroke(); | ||
| 565 | + //---文字--- | ||
| 566 | + context.setFontSize(22 * unit) | ||
| 567 | + context.font = 'normal bold'; | ||
| 568 | + context.setFillStyle("black") | ||
| 569 | + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit); | ||
| 570 | + //---绘制中间阶梯的价格--- | ||
| 571 | + var list = th.data.prom_act.ct_rylist; | ||
| 572 | + for (var i = 0; i < list.length; i++) { | ||
| 573 | + var item = list[i]; | ||
| 574 | + var wi = i * 90 * unit; | ||
| 575 | + context.font = 'normal'; | ||
| 576 | + context.setFontSize(16 * unit) | ||
| 577 | + context.setFillStyle("red") | ||
| 578 | + context.fillText("¥", 40 * unit + wi, 756 * unit); | ||
| 579 | + context.setFontSize(22 * unit) | ||
| 580 | + var pri = parseFloat(item.price).toFixed(2); | ||
| 581 | + context.fillText(pri, 56 * unit + wi, 756 * unit); | ||
| 582 | + context.setFillStyle("gray") | ||
| 583 | + context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit); | ||
| 584 | + } | ||
| 585 | + //----------------下面部分---------------- | ||
| 586 | + context.setFillStyle("gray") | ||
| 587 | + context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit); | ||
| 588 | + context.setFillStyle("black") | ||
| 589 | + context.font = 'normal bold 18px sans-serif'; | ||
| 590 | + context.setFontSize(22 * unit) | ||
| 591 | + context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit); | ||
| 592 | + | ||
| 593 | + //-- 自定义海报 -- | ||
| 594 | + if(th.data.poster){ | ||
| 595 | + var erm_x= parseFloat(th.data.poster.ewm_x)*2; | ||
| 596 | + var erm_y= parseFloat(th.data.poster.ewm_y)*2; | ||
| 597 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit); | ||
| 598 | + }else{ | ||
| 599 | + //---二维吗图--- | ||
| 600 | + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); | ||
| 601 | + } | ||
| 602 | + break | ||
| 603 | + } | ||
| 604 | + | ||
| 605 | + | ||
| 606 | + //--- 如果是自定义海报的时候 --- | ||
| 607 | + if(th.data.poster && parseInt(th.data.poster.style)==2){ | ||
| 608 | + //如果显示会员信息的话 | ||
| 609 | + if(parseInt(th.data.poster.show_headpic)){ | ||
| 610 | + //获取坐标 | ||
| 611 | + var x= parseFloat(th.data.poster.head_x)*2; | ||
| 612 | + var y=parseFloat(th.data.poster.head_y)*2; | ||
| 613 | + //---绘制圆形要放在最后---- | ||
| 614 | + context.save(); | ||
| 615 | + context.beginPath(); | ||
| 616 | + var h_x = x* unit; | ||
| 617 | + var h_y = y * unit; | ||
| 618 | + var h_r = 40 * unit; | ||
| 619 | + var cx = h_x + h_r; | ||
| 620 | + var cy = h_y + h_r; | ||
| 621 | + context.arc(cx, cy, h_r, 0, Math.PI * 2, false); | ||
| 622 | + context.closePath(); | ||
| 623 | + context.fill(); | ||
| 624 | + context.clip(); | ||
| 625 | + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2); | ||
| 626 | + context.restore(); | ||
| 627 | + } | ||
| 628 | + | ||
| 629 | + }else{ | ||
| 630 | + //---绘制圆形要放在最后---- | ||
| 631 | + context.save(); | ||
| 632 | + context.beginPath(); | ||
| 633 | + var h_x = 60 * unit; | ||
| 634 | + var h_y = 24 * unit; | ||
| 635 | + var h_r = 40 * unit; | ||
| 636 | + var cx = h_x + h_r; | ||
| 637 | + var cy = h_y + h_r; | ||
| 638 | + context.arc(cx, cy, h_r, 0, Math.PI * 2, false); | ||
| 639 | + context.closePath(); | ||
| 640 | + context.fill(); | ||
| 641 | + context.clip(); | ||
| 642 | + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2); | ||
| 643 | + context.restore(); | ||
| 644 | + } | ||
| 645 | + | ||
| 646 | + | ||
| 647 | + //把画板内容绘制成图片,并回调 画板图片路径 | ||
| 648 | + context.draw(false, function() { | ||
| 649 | + setTimeout(function() { | ||
| 650 | + wx.canvasToTempFilePath({ | ||
| 651 | + x: 0, | ||
| 652 | + y: 0, | ||
| 653 | + width: 750, | ||
| 654 | + height: 1217, | ||
| 655 | + destWidth: 1.2 * 750 * 750 / that.data.screenWidth, | ||
| 656 | + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth, | ||
| 657 | + canvasId: 'share', | ||
| 658 | + success: function(res) { | ||
| 659 | + that.setData({ | ||
| 660 | + shareImgPath: res.tempFilePath, | ||
| 661 | + canvasHidden: true | ||
| 662 | + }) | ||
| 663 | + if (!res.tempFilePath) { | ||
| 664 | + wx.showModal({ | ||
| 665 | + title: '提示', | ||
| 666 | + content: '图片绘制中,请稍后重试', | ||
| 667 | + showCancel: false | ||
| 668 | + }) | ||
| 669 | + return false; | ||
| 670 | + } | ||
| 671 | + wx.previewImage({ | ||
| 672 | + //将图片预览出来 | ||
| 673 | + urls: [that.data.shareImgPath] | ||
| 674 | + }); | ||
| 675 | + wx.hideLoading(); | ||
| 676 | + } | ||
| 677 | + }) | ||
| 678 | + }, 500) | ||
| 679 | + | ||
| 680 | + }); | ||
| 681 | + }); | ||
| 682 | + } | ||
| 683 | + }); | ||
| 684 | + | ||
| 685 | + }, | ||
| 686 | + | ||
| 687 | + //点击分享商品 | ||
| 688 | + share_good:function(e){ | ||
| 689 | + //--先判断会员状态-- | ||
| 690 | + var user_info = getApp().globalData.userInfo; | ||
| 691 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 692 | + //getApp().my_warnning("请先登录",0,this); | ||
| 693 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 694 | + return false; | ||
| 695 | + } | ||
| 696 | + | ||
| 697 | + var index=e.currentTarget.dataset.index; | ||
| 698 | + var item=this.data.list[index]; | ||
| 699 | + this.setData({share_hidden:0,share_good:item}); | ||
| 700 | + }, | ||
| 701 | + | ||
| 702 | + cancel:function(){ | ||
| 703 | + this.setData({share_hidden:1}); | ||
| 704 | + }, | ||
| 705 | + | ||
| 706 | + //--获取头像的本地缓存,回调写法-- | ||
| 707 | + get_head_temp: function(tt, func) { | ||
| 708 | + var ee = this; | ||
| 709 | + if (ee.data.share_head) { | ||
| 710 | + tt(func); | ||
| 711 | + return false; | ||
| 712 | + } | ||
| 713 | + //---获取分享图片的本地地址,头像和商品图片---- | ||
| 714 | + var path2 = getApp().globalData.userInfo.head_pic; | ||
| 715 | + if (path2 == "") { | ||
| 716 | + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; | ||
| 717 | + tt(func); | ||
| 718 | + } else { | ||
| 719 | + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | ||
| 720 | + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | ||
| 721 | + wx.getImageInfo({ | ||
| 722 | + src: path2, | ||
| 723 | + success: function(res) { | ||
| 724 | + //res.path是网络图片的本地地址 | ||
| 725 | + ee.data.share_head = res.path; | ||
| 726 | + tt(func); | ||
| 727 | + }, | ||
| 728 | + fail: function(res) { | ||
| 729 | + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 | ||
| 730 | + tt(func); | ||
| 731 | + } | ||
| 732 | + }); | ||
| 733 | + } | ||
| 734 | + }, | ||
| 735 | + //--获取商品图片的本地缓存,回调写法-- | ||
| 736 | + get_goods_temp: function(tt) { | ||
| 737 | + var ee = this; | ||
| 738 | + //获取商品是分享图信息 | ||
| 739 | + wx.getImageInfo({ | ||
| 740 | + src: ee.data.url+ee.data.share_good.original_img, | ||
| 741 | + success: function(res) { | ||
| 742 | + //res.path是网络图片的本地地址 | ||
| 743 | + ee.data.share_goods_img = res.path; | ||
| 744 | + tt(); | ||
| 745 | + }, | ||
| 746 | + fail: function(res) { | ||
| 747 | + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | ||
| 748 | + tt(); | ||
| 749 | + } | ||
| 750 | + }); | ||
| 751 | + }, | ||
| 752 | + | ||
| 753 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | ||
| 754 | + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { | ||
| 755 | + var lineWidth = 0; | ||
| 756 | + var lastSubStrIndex = 0; //每次开始截取的字符串的索引 | ||
| 757 | + var han = 0; | ||
| 758 | + for (let i = 0; i < str.length; i++) { | ||
| 759 | + if (han == 2) return; | ||
| 760 | + //lineWidth += ctx.measureText(str[i]).width; | ||
| 761 | + lineWidth += ut.measureText(str[i], 21.3 * unit); | ||
| 762 | + if (lineWidth > canvasWidth) { | ||
| 763 | + han++; | ||
| 764 | + | ||
| 765 | + if (han == 2) | ||
| 766 | + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | ||
| 767 | + else | ||
| 768 | + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | ||
| 769 | + | ||
| 770 | + initHeight += 22; //22为字体的高度 | ||
| 771 | + lineWidth = 0; | ||
| 772 | + lastSubStrIndex = i; | ||
| 773 | + titleHeight += 20; | ||
| 774 | + } | ||
| 775 | + if (i == str.length - 1) { //绘制剩余部分 | ||
| 776 | + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); | ||
| 777 | + } | ||
| 778 | + } | ||
| 779 | + }, | ||
| 780 | + | ||
| 781 | + //-------搜索的相关功能------ | ||
| 782 | + set_search_value:function(e){ | ||
| 783 | + var key_str=e.detail.value; | ||
| 784 | + if(key_str) key_str=key_str.trim(); | ||
| 785 | + this.setData({key_str:key_str}); | ||
| 786 | + | ||
| 787 | + }, | ||
| 788 | + search_data:function(){ | ||
| 789 | + this.setData({ | ||
| 790 | + is_no_data:0,is_no_more:0,list:[], | ||
| 791 | + }); | ||
| 792 | + this.data.is_load=0; | ||
| 793 | + this.data.currentPage=1; | ||
| 794 | + this.requestGoodsList(); | ||
| 795 | + }, | ||
| 796 | + | ||
| 797 | + go_goods:function(e){ | ||
| 798 | + var index=e.currentTarget.dataset.index; | ||
| 799 | + var item=this.data.list[index]; | ||
| 800 | + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | ||
| 801 | + getApp().goto(url); | ||
| 802 | + } | ||
| 803 | + | ||
| 804 | + | ||
| 805 | +}) | ||
| 0 | \ No newline at end of file | 806 | \ No newline at end of file |
packageA/pages/goods_share/goods_share.json
0 → 100644
packageA/pages/goods_share/goods_share.wxml
0 → 100644
| 1 | +<wxs module="g_filter" src="g_filter.wxs"></wxs> | ||
| 2 | +<view class="container"> | ||
| 3 | + <!-- 搜索框 --> | ||
| 4 | + <view class="search-container"> | ||
| 5 | + <view class="input-container"><input bindinput="set_search_value" class="search" type="text" placeholder="请输入您想查找的商品信息"/></view> | ||
| 6 | + <view bindtap="search_data" class="btn-search">搜索</view> | ||
| 7 | + </view> | ||
| 8 | + <!-- 列表 --> | ||
| 9 | + <view class="list-container"> | ||
| 10 | + <!-- 标题 --> | ||
| 11 | + <view class="title"> | ||
| 12 | + <view class="title-item" bindtap="sale_sort">销量</view> | ||
| 13 | + | ||
| 14 | + <block wx:if="{{orderField=='shop_price'}}"> | ||
| 15 | + <view class="title-item" bindtap="sort1">价格<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view> | ||
| 16 | + </block> | ||
| 17 | + <block wx:else> | ||
| 18 | + <view class="title-item" bindtap="sort1">价格<text class="iconfont icon-shang"></text></view> | ||
| 19 | + </block> | ||
| 20 | + | ||
| 21 | + <block wx:if="{{orderField=='commission'}}"> | ||
| 22 | + <view class="title-item" bindtap="sort2">佣金<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view> | ||
| 23 | + </block> | ||
| 24 | + <block wx:else> | ||
| 25 | + <view class="title-item" bindtap="sort2">佣金<text class="iconfont icon-xia"></text></view> | ||
| 26 | + </block> | ||
| 27 | + | ||
| 28 | + <view class="title-item" bindtap='new_sort'>最新</view> | ||
| 29 | + </view> | ||
| 30 | + <!-- 列表项 --> | ||
| 31 | + <scroll-view | ||
| 32 | + class="list" | ||
| 33 | + scroll-y="true" | ||
| 34 | + bindscrolltolower="refresh" | ||
| 35 | + scroll-anchoring | ||
| 36 | + > | ||
| 37 | + <block wx:for="{{list}}"> | ||
| 38 | + <view class class="list-item" bindtap="go_goods" data-index="{{index}}"> | ||
| 39 | + <view class="img-container"> | ||
| 40 | + <image src="{{url+item.original_img}}" style="width: 100%; height: 100%;" | ||
| 41 | + binderror="bind_bnerr2" lazy-load="true" | ||
| 42 | + data-errorimg="list[{{index}}].original_img"></image> | ||
| 43 | + </view> | ||
| 44 | + <view class="details"> | ||
| 45 | + <view class="ellipsis-2 fs28 name">{{item.goods_name}}</view> | ||
| 46 | + <view class="red pdt14">¥{{item.shop_price}} | ||
| 47 | + <!-- 如果有等级卡的话 --> | ||
| 48 | + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> | ||
| 49 | + <!-- 当会员是等级卡的时候,且卡有钱的时候 --> | ||
| 50 | + <block wx:if="{{card_field && item[card_field]>0}}"> | ||
| 51 | + <text class="plus_show">PLUS</text>¥{{item[card_field]}} | ||
| 52 | + </block> | ||
| 53 | + <!-- 当会员不是等级卡的时候,且卡有钱的时候 --> | ||
| 54 | + <block wx:if="{{!card_field && g_filter.get_card_price(item,card_list,0)>0}}"> | ||
| 55 | + <text class="plus_show">PLUS</text>¥{{g_filter.get_card_price(item,card_list,0)}} | ||
| 56 | + </block> | ||
| 57 | + </block> | ||
| 58 | + </view> | ||
| 59 | + | ||
| 60 | + <view class="flex jc_sb fs24 pdt14"> | ||
| 61 | + <view class="gray">已售:<text class="red">{{item.sales_sum}}</text></view> | ||
| 62 | + <view class="gray">分成金额: | ||
| 63 | + <text wx:if="{{!pattern}}" class="red">¥{{item.commission}}</text> | ||
| 64 | + <text wx:else class="red">¥{{item.fir_rate+item.sec_rate+item.thi_rate}}</text> | ||
| 65 | + </view> | ||
| 66 | + </view> | ||
| 67 | + <view catchtap="share_good" data-index="{{index}}" class="t-r fs28 pdt14"> | ||
| 68 | + <view class="btn-share">分享</view> | ||
| 69 | + </view> | ||
| 70 | + </view> | ||
| 71 | + </view> | ||
| 72 | + </block> | ||
| 73 | + <nodata wx:if="{{list.length==0}}" nodataContainer="nodata">暂无数据</nodata> | ||
| 74 | + <view wx:if="{{is_no_more}}" class="no-more t-c">- 已全部加载 -</view> | ||
| 75 | + </scroll-view> | ||
| 76 | + </view> | ||
| 77 | +</view> | ||
| 78 | + | ||
| 79 | +<!--二维码显示页面--> | ||
| 80 | +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas> | ||
| 81 | +<!-- 分享控件,底部弹出 --> | ||
| 82 | +<share_button id="share_button" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{!share_hidden}}"></share_button> |
packageA/pages/goods_share/goods_share.wxss
0 → 100644
| 1 | +/* packageA//pages/goods_share/goods_share.wxss */ | ||
| 2 | +.red { | ||
| 3 | + color: #FE6867; | ||
| 4 | +} | ||
| 5 | +.gray { | ||
| 6 | + color: #7b7b7b; | ||
| 7 | +} | ||
| 8 | +page { | ||
| 9 | + background-color: #f2f2f2; | ||
| 10 | + height: 100%; | ||
| 11 | +} | ||
| 12 | +.container { | ||
| 13 | + background-color: white; | ||
| 14 | + height: 100%; | ||
| 15 | +} | ||
| 16 | +.search-container { | ||
| 17 | + display: flex; | ||
| 18 | + padding: 26rpx 20rpx; | ||
| 19 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 20 | +} | ||
| 21 | +.input-container { | ||
| 22 | + flex: 1; | ||
| 23 | + border-radius: 6rpx 0 0 6rpx; | ||
| 24 | + overflow: hidden; | ||
| 25 | +} | ||
| 26 | +.search { | ||
| 27 | + background-color: #f0f0f0; | ||
| 28 | + padding: 10rpx 20rpx; | ||
| 29 | + font-size: 28rpx; | ||
| 30 | +} | ||
| 31 | +.btn-search { | ||
| 32 | + background-color: #FE6867; | ||
| 33 | + color: white; | ||
| 34 | + padding: 0 30rpx; | ||
| 35 | + display: flex; | ||
| 36 | + align-items: center; | ||
| 37 | + border-radius: 0 6rpx 6rpx 0; | ||
| 38 | +} | ||
| 39 | +.title { | ||
| 40 | + display: flex; | ||
| 41 | + font-size: 30rpx; | ||
| 42 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 43 | +} | ||
| 44 | +.title .iconfont { | ||
| 45 | + color: #ccc; | ||
| 46 | + font-size: 16rpx; | ||
| 47 | + margin-left: 8rpx; | ||
| 48 | +} | ||
| 49 | +.title-item { | ||
| 50 | + width: 25%; | ||
| 51 | + box-sizing: border-box; | ||
| 52 | + text-align: center; | ||
| 53 | + padding: 20rpx; | ||
| 54 | +} | ||
| 55 | +.list-container { | ||
| 56 | + height: calc(100% - 118rpx); | ||
| 57 | +} | ||
| 58 | +.list { | ||
| 59 | + height: calc(100% - 82rpx); | ||
| 60 | + background-color: #f2f2f2; | ||
| 61 | +} | ||
| 62 | +.list-item { | ||
| 63 | + display: flex; | ||
| 64 | + padding: 20rpx; | ||
| 65 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 66 | + background-color: white; | ||
| 67 | +} | ||
| 68 | +.img-container { | ||
| 69 | + background-color: #f0f0f0; | ||
| 70 | + width: 280rpx; | ||
| 71 | + height: 248rpx; | ||
| 72 | + display: flex; | ||
| 73 | + align-items: center; | ||
| 74 | + justify-content: center; | ||
| 75 | +} | ||
| 76 | +.img-container:after { | ||
| 77 | + /* font-family: iconfont; | ||
| 78 | + content: '\e8c1'; | ||
| 79 | + color: #bbb; | ||
| 80 | + font-size: 80rpx; */ | ||
| 81 | +} | ||
| 82 | +.details { | ||
| 83 | + flex: 1; | ||
| 84 | + padding-left: 20rpx; | ||
| 85 | +} | ||
| 86 | +.btn-share { | ||
| 87 | + display: inline-block; | ||
| 88 | + background-color: #FE6867; | ||
| 89 | + color: white; | ||
| 90 | + padding: 8rpx 30rpx; | ||
| 91 | + border-radius: 6rpx; | ||
| 92 | +} | ||
| 93 | +.pdt14 { | ||
| 94 | + padding-top: 14rpx; | ||
| 95 | +} | ||
| 96 | + | ||
| 97 | +.no-more { | ||
| 98 | + line-height: 3; | ||
| 99 | + color: #ccc; | ||
| 100 | + background-color: #f2f2f2; | ||
| 101 | +} | ||
| 102 | +.nodata { | ||
| 103 | + text-align: center; | ||
| 104 | + background-color: #f2f2f2; | ||
| 105 | +} | ||
| 106 | + | ||
| 107 | +.name { | ||
| 108 | + height: 76rpx; | ||
| 109 | +} | ||
| 110 | + | ||
| 111 | +.plus_show{ | ||
| 112 | + background-color: #FE6867; | ||
| 113 | + color: #fff; | ||
| 114 | + padding: 3rpx 5rpx; | ||
| 115 | + border-radius:8rpx ; | ||
| 116 | + margin-left: 10rpx; | ||
| 117 | + margin-right: 5rpx; | ||
| 118 | +} |
packageA/pages/jfbuy/jfbuy.js
0 → 100644
| 1 | +// packageA//pages/goods_share/goods_share.js | ||
| 2 | +var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js"); | ||
| 3 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
| 4 | +Page({ | ||
| 5 | + /** | ||
| 6 | + * 页面的初始数据 | ||
| 7 | + */ | ||
| 8 | + data: { | ||
| 9 | + // tab | ||
| 10 | + tab: ['全部','价格','销量','积分值'], | ||
| 11 | + currentIndex: 1, | ||
| 12 | + //促销页tab | ||
| 13 | + // tab2: ['订单促销','搭配促销','优惠促销'], | ||
| 14 | + // currentIndex2: 0, | ||
| 15 | + //秒杀和拼单底部tab | ||
| 16 | + // currentIndex3: 0, | ||
| 17 | + // 控制价格 | ||
| 18 | + active1: false, | ||
| 19 | + // 控制佣金 | ||
| 20 | + active2: false, | ||
| 21 | + url: oo.imghost, | ||
| 22 | + //popup | ||
| 23 | + hiddenPopup: true, | ||
| 24 | + // 排序 | ||
| 25 | + isUp: false, | ||
| 26 | + //控制滚动条至顶部时开启下拉刷新 | ||
| 27 | + // open: false, | ||
| 28 | + requestData: null, | ||
| 29 | + | ||
| 30 | + list:[], | ||
| 31 | + is_load:0, //是否正在加载 | ||
| 32 | + is_no_data:0, //没有数据 | ||
| 33 | + is_no_more:0, //没有更多数据 | ||
| 34 | + key_str:'', | ||
| 35 | + pattern:0, //分成的方式 | ||
| 36 | + currentPage:1, //当前的页码 | ||
| 37 | + | ||
| 38 | + // canvasHidden: 1, //-- 隐藏画布 -- | ||
| 39 | + // dis_switch:0, //-- 分销开关 -- | ||
| 40 | + // pattern:0, //-- 分成的方式 -- | ||
| 41 | + // share_hidden:1, //-- 分享的按钮隐藏 -- | ||
| 42 | + // share_good:null, //--- 要分享的商品 --- | ||
| 43 | + | ||
| 44 | + // timer:0, | ||
| 45 | + // hui_active:null, //优惠活动分享 | ||
| 46 | + | ||
| 47 | + //点击活动详情的时候的响应 | ||
| 48 | + list2:[], | ||
| 49 | + is_load2:0, | ||
| 50 | + is_no_data2:0, //没有数据 | ||
| 51 | + is_no_more2:0, //没有更多数据 | ||
| 52 | + currentPage2:1, //页码 | ||
| 53 | + prom_goods:null, //优惠活动的条件 | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + triggered: false, | ||
| 57 | + isPullDownRefresh: false, | ||
| 58 | + }, | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 生命周期函数--监听页面加载 | ||
| 62 | + */ | ||
| 63 | + onLoad: function (options) { | ||
| 64 | + this.request_list({ | ||
| 65 | + store_id:oo.stoid, | ||
| 66 | + stype:1, | ||
| 67 | + stypeup:1 | ||
| 68 | + }); | ||
| 69 | + // var th=this; | ||
| 70 | + // //接受有没有导购的参数 | ||
| 71 | + // var first_leader=options.first_leader; | ||
| 72 | + // if(first_leader){ | ||
| 73 | + // //-- user_id代过来免登陆 -- | ||
| 74 | + // getApp().globalData.user_id=first_leader; | ||
| 75 | + // getApp().getUserFir(); | ||
| 76 | + // } | ||
| 77 | + | ||
| 78 | + // this.requestGoodsList(); | ||
| 79 | + //-- 自定义海报 -- | ||
| 80 | + // getApp().request.promiseGet("/api/weshop/goods/poster/page",{ | ||
| 81 | + // data:{store_id:os.stoid, type:1, is_use:1 } | ||
| 82 | + // }).then(res=>{ | ||
| 83 | + // if(res.data.code==0){ | ||
| 84 | + | ||
| 85 | + // var poster_data=res.data.data.pageData[0]; | ||
| 86 | + // var json_str=poster_data.jsonStr; | ||
| 87 | + | ||
| 88 | + // if(json_str){ | ||
| 89 | + // var json_data=JSON.parse(json_str); | ||
| 90 | + // if(json_data.bg_img){ | ||
| 91 | + | ||
| 92 | + // //-- 把图片那到本地 -- | ||
| 93 | + // wx.getImageInfo({ | ||
| 94 | + // src:json_data.bg_img, | ||
| 95 | + // success: function(res) { | ||
| 96 | + // var path= res.path; | ||
| 97 | + // th.setData({share_b_img:path}) | ||
| 98 | + // }, | ||
| 99 | + // fail: function(res) {} | ||
| 100 | + // }); | ||
| 101 | + // } | ||
| 102 | + | ||
| 103 | + // th.setData({poster:json_data}) | ||
| 104 | + | ||
| 105 | + // } | ||
| 106 | + // } | ||
| 107 | + // }) | ||
| 108 | + | ||
| 109 | + //获取分销的配置 | ||
| 110 | + // getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{ | ||
| 111 | + // if(res.data.code==0){ | ||
| 112 | + // th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern}); | ||
| 113 | + // } | ||
| 114 | + // }) | ||
| 115 | + | ||
| 116 | + //获取用户设备信息,屏幕宽度 | ||
| 117 | + // wx.getSystemInfo({ | ||
| 118 | + // success: res => { | ||
| 119 | + // th.setData({ | ||
| 120 | + // screenWidth: res.screenWidth | ||
| 121 | + // }) | ||
| 122 | + // } | ||
| 123 | + // }); | ||
| 124 | + | ||
| 125 | + //-- ---秒杀和拼团都要有定时器--- | ||
| 126 | + // if(!options.currentIndex || options.currentIndex<=1){ | ||
| 127 | + // //设置全局定时器 | ||
| 128 | + // th.data.timer=setInterval(function () { | ||
| 129 | + // th.countDown(); | ||
| 130 | + // },1000); | ||
| 131 | + // } | ||
| 132 | + }, | ||
| 133 | + | ||
| 134 | + /** | ||
| 135 | + * 生命周期函数--监听页面显示 | ||
| 136 | + */ | ||
| 137 | + onShow: function () {}, | ||
| 138 | + /** | ||
| 139 | + * 生命周期函数--监听页面隐藏 | ||
| 140 | + */ | ||
| 141 | + onHide: function () { | ||
| 142 | + //--清理定时器-- | ||
| 143 | + // clearInterval(this.timer); | ||
| 144 | + }, | ||
| 145 | + /**e | ||
| 146 | + * 页面上拉触底事件的处理函数 | ||
| 147 | + */ | ||
| 148 | + onReachBottom: function () { | ||
| 149 | + | ||
| 150 | + }, | ||
| 151 | + | ||
| 152 | + /** | ||
| 153 | + * 用户点击右上角分享 | ||
| 154 | + */ | ||
| 155 | + // onShareAppMessage: function () { | ||
| 156 | + // var th = this; | ||
| 157 | + // //礼包的转发 | ||
| 158 | + // if(th.data.currentIndex==3){ | ||
| 159 | + // var lbid=th.data.hui_active.lbId; | ||
| 160 | + // var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; | ||
| 161 | + // if(getApp().globalData.user_id){ | ||
| 162 | + // url+="&first_leader="+getApp().globalData.user_id; | ||
| 163 | + // } | ||
| 164 | + // var img=this.data.share_img; | ||
| 165 | + // var title=th.data.hui_active.giftTitle; | ||
| 166 | + | ||
| 167 | + // var ob={ | ||
| 168 | + // title:title, | ||
| 169 | + // path:url, | ||
| 170 | + // imageUrl: img, | ||
| 171 | + // }; | ||
| 172 | + // th.setData({share_hidden:1}); | ||
| 173 | + // return ob; | ||
| 174 | + | ||
| 175 | + // }else{ | ||
| 176 | + // //---秒杀,拼团,促销--- | ||
| 177 | + // var item=this.data.share_good; | ||
| 178 | + // if(item){ | ||
| 179 | + // var price = item.shop_price; | ||
| 180 | + // var title= item.goods_name; | ||
| 181 | + // var img=this.data.url+item.original_img; | ||
| 182 | + // var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; | ||
| 183 | + // if(getApp().globalData.user_id){ | ||
| 184 | + // url+="&first_leader="+getApp().globalData.user_id; | ||
| 185 | + // } | ||
| 186 | + // var ob={ | ||
| 187 | + // title: price + "元 " +title, | ||
| 188 | + // path:url, | ||
| 189 | + // imageUrl: img, | ||
| 190 | + // }; | ||
| 191 | + // th.setData({share_hidden:1,share_good:null}); | ||
| 192 | + // return ob; | ||
| 193 | + // }else{ | ||
| 194 | + // var url="/pages/index/index/index"; | ||
| 195 | + // if(getApp().globalData.user_id){ | ||
| 196 | + // url+="?first_leader="+getApp().globalData.user_id; | ||
| 197 | + // } | ||
| 198 | + // var hui_active=this.data.hui_active; | ||
| 199 | + // var title=hui_active.name; | ||
| 200 | + // if(!title) title=hui_active.main_goods_name; | ||
| 201 | + // if(!title) title=hui_active.giftTitle; | ||
| 202 | + | ||
| 203 | + // var ob={ | ||
| 204 | + // title: title, | ||
| 205 | + // path:url, | ||
| 206 | + // }; | ||
| 207 | + // th.setData({share_hidden:1,share_good:null}); | ||
| 208 | + // return ob; | ||
| 209 | + // } | ||
| 210 | + // } | ||
| 211 | + | ||
| 212 | + // }, | ||
| 213 | + | ||
| 214 | + | ||
| 215 | + //-- 点击tab -- | ||
| 216 | + clickTab(e) { | ||
| 217 | + var th=this; | ||
| 218 | + var data = { | ||
| 219 | + store_id:oo.stoid, | ||
| 220 | + stype:e.target.dataset.index, | ||
| 221 | + stypeup:1, | ||
| 222 | + }; | ||
| 223 | + this.setData({ | ||
| 224 | + is_no_data2:0, | ||
| 225 | + is_no_more2:0, | ||
| 226 | + list2:[], | ||
| 227 | + is_load2: 0, | ||
| 228 | + currentPage2:1, | ||
| 229 | + }); | ||
| 230 | + if(this.data.currentIndex!=e.target.dataset.index){ | ||
| 231 | + this.setData({ | ||
| 232 | + currentIndex: e.target.dataset.index, | ||
| 233 | + isUp: false, | ||
| 234 | + }); | ||
| 235 | + | ||
| 236 | + } else { | ||
| 237 | + console.log('第2次点击'); | ||
| 238 | + this.setData({ | ||
| 239 | + isUp: !this.data.isUp | ||
| 240 | + }); | ||
| 241 | + }; | ||
| 242 | + | ||
| 243 | + if(this.data.isUp) { | ||
| 244 | + data.stypeup = 0; | ||
| 245 | + } else { | ||
| 246 | + data.stypeup = 1; | ||
| 247 | + }; | ||
| 248 | + | ||
| 249 | + // this.data.requestData = data; | ||
| 250 | + this.setData({ | ||
| 251 | + requestData: data | ||
| 252 | + }) | ||
| 253 | + | ||
| 254 | + this.request_list(data); | ||
| 255 | + }, | ||
| 256 | + | ||
| 257 | + | ||
| 258 | + | ||
| 259 | + | ||
| 260 | + request_list: function(data, callback){ | ||
| 261 | + // console.log('触发上拉刷新'); | ||
| 262 | + | ||
| 263 | + var th = this; | ||
| 264 | + if(this.data.is_load2) return false; //-- 正在加载 | ||
| 265 | + if(this.data.is_no_data2) return false; //-- 没有数据 | ||
| 266 | + if(this.data.is_no_more2) return false; //-- 没有更多 | ||
| 267 | + | ||
| 268 | + // 开启加载状态 | ||
| 269 | + this.data.is_load2=1; | ||
| 270 | + | ||
| 271 | + // var req_data = { | ||
| 272 | + // page:th.data.currentPage2 | ||
| 273 | + // } | ||
| 274 | + | ||
| 275 | + app.request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", { | ||
| 276 | + data: data | ||
| 277 | + }).then(res=>{ | ||
| 278 | + // 关闭加载状态 | ||
| 279 | + th.data.is_load2=0; | ||
| 280 | + // 请求成功 | ||
| 281 | + if(res.data.code==0) { | ||
| 282 | + if(res.data.data.pageData.length>0) { | ||
| 283 | + th.data.currentPage2++; | ||
| 284 | + var data = res.data.data.pageData; | ||
| 285 | + // 判断有无更多数据可以加载,如果大于则没有更多数据,反之则有 | ||
| 286 | + if(res.data.data.page*res.data.data.pageSize > res.data.data.total){th.setData({is_no_more2:1});} | ||
| 287 | + var list=th.data.list2; | ||
| 288 | + list=list.concat(data); | ||
| 289 | + th.setData({list2:list}); | ||
| 290 | + } else { | ||
| 291 | + if(th.data.currentPage==1){ | ||
| 292 | + th.setData({is_no_data2:1}); | ||
| 293 | + } else { | ||
| 294 | + th.setData({is_no_more2:1}); | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + if(callback) callback(); | ||
| 298 | + } else { | ||
| 299 | + wx.showToast({ | ||
| 300 | + title: res.data.msg, | ||
| 301 | + icon: 'none', | ||
| 302 | + duration: 2000 | ||
| 303 | + }) | ||
| 304 | + } | ||
| 305 | + console.log('xx',res); | ||
| 306 | + }) | ||
| 307 | + }, | ||
| 308 | + | ||
| 309 | + | ||
| 310 | + | ||
| 311 | + | ||
| 312 | + //---图片失败,默认图片--- | ||
| 313 | + bind_bnerr2: function (e) { | ||
| 314 | + var _errImg = e.target.dataset.errorimg; | ||
| 315 | + var _errObj = {}; | ||
| 316 | + _errObj[_errImg] ="/miniapp/images/default_g_img.gif"; | ||
| 317 | + this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
| 318 | + // this.setData({['list2[0].original_img']:/miniapp/images/default_g_img.gif}); | ||
| 319 | + }, | ||
| 320 | + //-- ---更多加载---- | ||
| 321 | + refresh:function(){ | ||
| 322 | + this.request_list(this.data.requestData); | ||
| 323 | + }, | ||
| 324 | + | ||
| 325 | + | ||
| 326 | + | ||
| 327 | + // 页面滚动 | ||
| 328 | + onPageScroll (e) { | ||
| 329 | + console.log(e); | ||
| 330 | + if(e.scrollTop == 0) { | ||
| 331 | + this.setData({open: true }); | ||
| 332 | + } else { | ||
| 333 | + this.setData({open: false}); | ||
| 334 | + } | ||
| 335 | + }, | ||
| 336 | + | ||
| 337 | + // 下拉刷新 | ||
| 338 | + onPullDownRefresh() { | ||
| 339 | + var th = this; | ||
| 340 | + var data = this.data.requestData; | ||
| 341 | + | ||
| 342 | + if(this.isPullDownRefresh) return; | ||
| 343 | + // 触发下拉刷新开启 | ||
| 344 | + this.isPullDownRefresh = true; | ||
| 345 | + | ||
| 346 | + this.setData({ | ||
| 347 | + list2: [], | ||
| 348 | + currentPage2: 1, | ||
| 349 | + is_no_more2: 0 | ||
| 350 | + }); | ||
| 351 | + | ||
| 352 | + this.request_list(data, function() { | ||
| 353 | + th.setData({ | ||
| 354 | + triggered: false, | ||
| 355 | + }); | ||
| 356 | + th.isPullDownRefresh = false; | ||
| 357 | + }); | ||
| 358 | + }, | ||
| 359 | +}) | ||
| 0 | \ No newline at end of file | 360 | \ No newline at end of file |
packageA/pages/jfbuy/jfbuy.json
0 → 100644
packageA/pages/jfbuy/jfbuy.wxml
0 → 100644
| 1 | +<!-- <wxs module="g_filter" src="g_filter.wxs"></wxs> --> | ||
| 2 | +<view class="container"> | ||
| 3 | + <!-- 搜索框 --> | ||
| 4 | + <!-- <view class="search-container"> | ||
| 5 | + <view class="input-container"><input bindinput="set_search_value" class="search" type="text" placeholder="请输入您想查找的商品信息"/></view> | ||
| 6 | + <view bindtap="search_data" class="btn-search">搜索</view> | ||
| 7 | + </view> --> | ||
| 8 | + | ||
| 9 | + <view class="banner-container"> | ||
| 10 | + <image src="../../images/jfbuy.jpg" class="banner"></image> | ||
| 11 | + </view> | ||
| 12 | + | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + <!-- 列表 --> | ||
| 16 | + <view class="list-container"> | ||
| 17 | + <!-- 标题 --> | ||
| 18 | + <view class="title" > | ||
| 19 | + <block wx:for="{{tab}}"> | ||
| 20 | + <view class="title-item {{currentIndex == (index+1) ? 'active' + (isUp?' active1':''):''}}" data-index="{{index+1}}" bindtap="clickTab">{{item}}</view> | ||
| 21 | + </block> | ||
| 22 | + </view> | ||
| 23 | + | ||
| 24 | + <!-- <view> --> | ||
| 25 | + <scroll-view | ||
| 26 | + class="list" | ||
| 27 | + scroll-y="true" | ||
| 28 | + bindscrolltolower="request_list" | ||
| 29 | + scroll-anchoring | ||
| 30 | + refresher-enabled | ||
| 31 | + refresher-triggered="{{triggered}}" | ||
| 32 | + bindrefresherrefresh="onPullDownRefresh"> | ||
| 33 | + | ||
| 34 | + <block wx:for="{{list2}}"> | ||
| 35 | + <view class class="list-item" bindtap="viewItemDetails"> | ||
| 36 | + <view class="img-container"> | ||
| 37 | + <image | ||
| 38 | + src="{{url+item.original_img}}" | ||
| 39 | + style="width: 100%; height: 100%;" | ||
| 40 | + binderror="bind_bnerr2" lazy-load="true" | ||
| 41 | + data-errorimg="list2[{{index}}].original_img"></image> | ||
| 42 | + </view> | ||
| 43 | + <view class="details"> | ||
| 44 | + <view class="ellipsis-2 fs30 name">{{item.goods_name}}</view> | ||
| 45 | + <view> | ||
| 46 | + <view class="red"> | ||
| 47 | + <text>{{item.integral}}积分 + ¥{{item.addmoney}}</text> | ||
| 48 | + </view> | ||
| 49 | + <view class="pdt14 fs22 gray flex jc_sb"> | ||
| 50 | + <view>零售价:¥{{item.shop_price}}</view> | ||
| 51 | + <view>销量:{{item.sales_sum}}</view> | ||
| 52 | + </view> | ||
| 53 | + </view> | ||
| 54 | + </view> | ||
| 55 | + </view> | ||
| 56 | + </block> | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + <!-- <view style="height: 1rpx;"></view> --> | ||
| 60 | + <nodata wx:if="{{list2.length==0}}" nodataContainer="nodata">暂无数据</nodata> | ||
| 61 | + <view wx:if="{{is_no_more2}}" class="no-more t-c">- 已全部加载 -</view> | ||
| 62 | + <!-- <nodata nodataContainer="nodata">暂无数据</nodata> | ||
| 63 | + <view class="no-more t-c">- 已全部加载 -</view> --> | ||
| 64 | + </scroll-view> | ||
| 65 | + <!-- </view> --> | ||
| 66 | + | ||
| 67 | + </view> | ||
| 68 | +</view> |
packageA/pages/jfbuy/jfbuy.wxss
0 → 100644
| 1 | +/* packageA//pages/goods_share/goods_share.wxss */ | ||
| 2 | +.red { | ||
| 3 | + color: #FE6867; | ||
| 4 | +} | ||
| 5 | +.gray { | ||
| 6 | + color: #7b7b7b; | ||
| 7 | +} | ||
| 8 | +.w25 { | ||
| 9 | + width: 25%; | ||
| 10 | +} | ||
| 11 | +.w50 { | ||
| 12 | + width: 50%; | ||
| 13 | +} | ||
| 14 | +.w164 { | ||
| 15 | + width: 164rpx; | ||
| 16 | +} | ||
| 17 | +.bold { | ||
| 18 | + font-weight: bold; | ||
| 19 | +} | ||
| 20 | +page, | ||
| 21 | +.container { | ||
| 22 | + height: 100%; | ||
| 23 | +} | ||
| 24 | +page { | ||
| 25 | + background-color: #f2f2f2; | ||
| 26 | + /* height: 100%; */ | ||
| 27 | +} | ||
| 28 | +.container { | ||
| 29 | + /* height: 100%; */ | ||
| 30 | + /* position: relative; */ | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +.search-container { | ||
| 34 | + /* display: flex; | ||
| 35 | + padding: 26rpx 20rpx; | ||
| 36 | + border-bottom: 2rpx solid #f8f8f8; */ | ||
| 37 | +} | ||
| 38 | +.input-container { | ||
| 39 | + /* flex: 1; | ||
| 40 | + border-radius: 6rpx 0 0 6rpx; | ||
| 41 | + overflow: hidden; */ | ||
| 42 | +} | ||
| 43 | +.search { | ||
| 44 | + /* background-color: #f0f0f0; | ||
| 45 | + padding: 10rpx 20rpx; | ||
| 46 | + font-size: 28rpx; */ | ||
| 47 | +} | ||
| 48 | +.btn-search { | ||
| 49 | + /* background-color: #FE6867; | ||
| 50 | + color: white; | ||
| 51 | + padding: 0 30rpx; | ||
| 52 | + display: flex; | ||
| 53 | + align-items: center; | ||
| 54 | + border-radius: 0 6rpx 6rpx 0; */ | ||
| 55 | +} | ||
| 56 | +.title { | ||
| 57 | + display: flex; | ||
| 58 | + font-size: 30rpx; | ||
| 59 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 60 | + background-color: white; | ||
| 61 | + position: sticky; | ||
| 62 | + position: -webkit-sticky; | ||
| 63 | + width: 100%; | ||
| 64 | + top: 0; | ||
| 65 | + z-index: 3; | ||
| 66 | +} | ||
| 67 | +.title .iconfont { | ||
| 68 | + color: #ccc; | ||
| 69 | + font-size: 16rpx; | ||
| 70 | + margin-left: 8rpx; | ||
| 71 | +} | ||
| 72 | +.title-item { | ||
| 73 | + width: 25%; | ||
| 74 | + box-sizing: border-box; | ||
| 75 | + text-align: center; | ||
| 76 | + padding: 20rpx; | ||
| 77 | + position: relative; | ||
| 78 | +} | ||
| 79 | +.title-item.active { | ||
| 80 | + color: #FE6867; | ||
| 81 | + font-weight: bold; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.title-item.active:before { | ||
| 85 | + content:''; | ||
| 86 | + position: absolute; | ||
| 87 | + width: 60%; | ||
| 88 | + height: 4rpx; | ||
| 89 | + background-color: #FE6867; | ||
| 90 | + left: 0; | ||
| 91 | + right: 0; | ||
| 92 | + bottom: 0; | ||
| 93 | + margin: 0 auto; | ||
| 94 | +} | ||
| 95 | +.title-item.active:after { | ||
| 96 | + font-family: iconfont; | ||
| 97 | + content: '\e650'; | ||
| 98 | + font-size: 18rpx; | ||
| 99 | + margin-left: 8rpx; | ||
| 100 | +} | ||
| 101 | +.title-item.active.active1:after { | ||
| 102 | + font-family: iconfont; | ||
| 103 | + content: '\e604'; | ||
| 104 | + font-size: 18rpx; | ||
| 105 | + margin-left: 8rpx; | ||
| 106 | +} | ||
| 107 | +.list-container { | ||
| 108 | + height: calc(100% - 360rpx); | ||
| 109 | + /* height: 100%; */ | ||
| 110 | +} | ||
| 111 | +.list { | ||
| 112 | + box-sizing: border-box; | ||
| 113 | + height: calc(100% - 82rpx); | ||
| 114 | + background-color: #f2f2f2; | ||
| 115 | + /* padding-bottom: 102rpx; */ | ||
| 116 | +} | ||
| 117 | +.list.active1 { | ||
| 118 | + /* height: calc(100% - 82rpx - 78rpx); */ | ||
| 119 | + /* padding-bottom: 0; */ | ||
| 120 | +} | ||
| 121 | +.list.active2 { | ||
| 122 | + /* padding-bottom: 0; */ | ||
| 123 | +} | ||
| 124 | +.list-item { | ||
| 125 | + display: flex; | ||
| 126 | + padding: 20rpx; | ||
| 127 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 128 | + background-color: white; | ||
| 129 | +} | ||
| 130 | +.img-container { | ||
| 131 | + background-color: #f0f0f0; | ||
| 132 | + width: 280rpx; | ||
| 133 | + height: 248rpx; | ||
| 134 | + display: flex; | ||
| 135 | + align-items: center; | ||
| 136 | + justify-content: center; | ||
| 137 | +} | ||
| 138 | +.img-container:after { | ||
| 139 | + | ||
| 140 | +} | ||
| 141 | +.details { | ||
| 142 | + flex: 1; | ||
| 143 | + padding-left: 20rpx; | ||
| 144 | + display: flex; | ||
| 145 | + flex-direction: column; | ||
| 146 | + justify-content: space-between; | ||
| 147 | +} | ||
| 148 | +.btn-share { | ||
| 149 | + box-sizing: border-box; | ||
| 150 | + display: inline-block; | ||
| 151 | + background-color: #FE6867; | ||
| 152 | + color: white; | ||
| 153 | + padding: 8rpx 30rpx; | ||
| 154 | + border-radius: 6rpx; | ||
| 155 | + text-align: center; | ||
| 156 | +} | ||
| 157 | +.pdt14 { | ||
| 158 | + padding-top: 14rpx; | ||
| 159 | +} | ||
| 160 | +.pdtb6 { | ||
| 161 | + padding-top: 6rpx; | ||
| 162 | + padding-bottom: 6rpx; | ||
| 163 | +} | ||
| 164 | +.pdtb8 { | ||
| 165 | + padding-top: 8rpx; | ||
| 166 | + padding-bottom: 8rpx; | ||
| 167 | +} | ||
| 168 | +.pdl20 { | ||
| 169 | + padding-left: 104rpx; | ||
| 170 | +} | ||
| 171 | + | ||
| 172 | + | ||
| 173 | +.no-more { | ||
| 174 | + line-height: 3; | ||
| 175 | + color: #ccc; | ||
| 176 | + /* background-color: #f2f2f2; */ | ||
| 177 | +} | ||
| 178 | +.nodata { | ||
| 179 | + text-align: center; | ||
| 180 | + background-color: #f2f2f2; | ||
| 181 | +} | ||
| 182 | +.progress-container { | ||
| 183 | + width: 55%; | ||
| 184 | + padding-right: 10rpx; | ||
| 185 | + position: relative; | ||
| 186 | + text-align: center; | ||
| 187 | +} | ||
| 188 | +.retail { | ||
| 189 | + color: #7b7b7b; | ||
| 190 | + text-decoration: line-through; | ||
| 191 | + font-size: 22rpx; | ||
| 192 | + padding-left: 20rpx; | ||
| 193 | +} | ||
| 194 | +.name { | ||
| 195 | + height: 76rpx; | ||
| 196 | + overflow: hidden; | ||
| 197 | +} | ||
| 198 | + | ||
| 199 | +.percent { | ||
| 200 | + position: absolute; | ||
| 201 | + top: 0; | ||
| 202 | + bottom: 0; | ||
| 203 | + left: 0; | ||
| 204 | + right: 0; | ||
| 205 | + margin: auto; | ||
| 206 | + color: white; | ||
| 207 | +} | ||
| 208 | +.tabbar { | ||
| 209 | + position: fixed; | ||
| 210 | + width: 100%; | ||
| 211 | + bottom: 0; | ||
| 212 | + background-color: white; | ||
| 213 | +} | ||
| 214 | +.tabbar:after { | ||
| 215 | + position: absolute; | ||
| 216 | + content: ''; | ||
| 217 | + width: 2rpx; | ||
| 218 | + height: 50%; | ||
| 219 | + top: 0; | ||
| 220 | + bottom: 0; | ||
| 221 | + left: 0; | ||
| 222 | + right: 0; | ||
| 223 | + margin: auto; | ||
| 224 | + background-color: #f0f0f0; | ||
| 225 | +} | ||
| 226 | +.tabbar-item { | ||
| 227 | + width: 50%; | ||
| 228 | + text-align: center; | ||
| 229 | + padding-top: 30rpx; | ||
| 230 | + padding-bottom: 30rpx; | ||
| 231 | +} | ||
| 232 | +.tabbar-item .iconfont { | ||
| 233 | + margin-right: 10rpx; | ||
| 234 | +} | ||
| 235 | +.tabbar-item.active { | ||
| 236 | + color: #FE6867; | ||
| 237 | +} | ||
| 238 | + | ||
| 239 | + | ||
| 240 | +.group-type, | ||
| 241 | +.group-num { | ||
| 242 | + position: relative; | ||
| 243 | + font-size: 22rpx; | ||
| 244 | +} | ||
| 245 | +.group-type:before, | ||
| 246 | +.group-num:before { | ||
| 247 | + font-family: iconfont; | ||
| 248 | +} | ||
| 249 | +.group-type:before { | ||
| 250 | + content: '\e66a'; | ||
| 251 | + color: white; | ||
| 252 | + background-color: #FE6867; | ||
| 253 | + position: absolute; | ||
| 254 | + left: 0; | ||
| 255 | + top: 0; | ||
| 256 | + bottom: 0; | ||
| 257 | + padding-left: 6rpx; | ||
| 258 | + padding-right: 10rpx; | ||
| 259 | + line-height: 30rpx; | ||
| 260 | +} | ||
| 261 | +.group-num:before { | ||
| 262 | + padding-right: 6rpx; | ||
| 263 | +} | ||
| 264 | +.group-num:before { | ||
| 265 | + content: '\e694'; | ||
| 266 | + position: relative; | ||
| 267 | +} | ||
| 268 | +.group-num { | ||
| 269 | + color: white; | ||
| 270 | + background-color: #FE6867; | ||
| 271 | + border-radius: 34rpx; | ||
| 272 | + padding-left: 10rpx; | ||
| 273 | + padding-right: 10rpx; | ||
| 274 | + margin-right: 14rpx; | ||
| 275 | +} | ||
| 276 | +.group-type { | ||
| 277 | + color: #FE6867; | ||
| 278 | + border: 2rpx solid #FE6867; | ||
| 279 | + padding-left: 42rpx; | ||
| 280 | + padding-right: 4rpx; | ||
| 281 | + border-radius: 6rpx; | ||
| 282 | +} | ||
| 283 | + | ||
| 284 | +.badge { | ||
| 285 | + color: white; | ||
| 286 | + padding: 0 20rpx; | ||
| 287 | + border-radius: 6rpx; | ||
| 288 | + background-color: #FE6867; | ||
| 289 | + margin-right: 10rpx; | ||
| 290 | +} | ||
| 291 | + | ||
| 292 | +.subTab-title { | ||
| 293 | + text-align: center; | ||
| 294 | + justify-content: center; | ||
| 295 | + align-items: center; | ||
| 296 | + font-size: 28rpx; | ||
| 297 | +} | ||
| 298 | +.subTab-list { | ||
| 299 | + padding: 20rpx; | ||
| 300 | +} | ||
| 301 | +.subTab-titleItem { | ||
| 302 | + box-sizing: border-box; | ||
| 303 | + width: calc(100% / 3); | ||
| 304 | + padding: 20rpx 40rpx; | ||
| 305 | + background-color: white; | ||
| 306 | + border-right: 2rpx solid #f8f8f8; | ||
| 307 | +} | ||
| 308 | +.subTab-titleItem:last-child { | ||
| 309 | + border-right: none; | ||
| 310 | +} | ||
| 311 | +.subTab-titleItem.active { | ||
| 312 | + background-color: #FE6867; | ||
| 313 | + color: white; | ||
| 314 | +} | ||
| 315 | +.subTab-item { | ||
| 316 | + padding: 20rpx; | ||
| 317 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 318 | + background-color: white; | ||
| 319 | + border-radius: 8rpx; | ||
| 320 | + box-shadow: 0 8px 12px #e7e9eb; | ||
| 321 | +} | ||
| 322 | +.subTab-item ~ .subTab-item { | ||
| 323 | + margin-top: 20rpx; | ||
| 324 | +} | ||
| 325 | +.pdv10 { | ||
| 326 | + padding-top: 10rpx; | ||
| 327 | + padding-bottom: 10rpx; | ||
| 328 | +} | ||
| 329 | +.pdv20 { | ||
| 330 | + padding-top: 20rpx; | ||
| 331 | + padding-bottom: 20rpx; | ||
| 332 | +} | ||
| 333 | +.pdb10 { | ||
| 334 | + padding-bottom: 10rpx; | ||
| 335 | +} | ||
| 336 | +.pdb20 { | ||
| 337 | + padding-bottom: 20rpx; | ||
| 338 | +} | ||
| 339 | +.bdr-b { | ||
| 340 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 341 | +} | ||
| 342 | +.dash-b { | ||
| 343 | + border-bottom: 2rpx dashed #ddd; | ||
| 344 | +} | ||
| 345 | +.btn-container { | ||
| 346 | + display: flex; | ||
| 347 | + align-items: flex-end; | ||
| 348 | + font-size: 26rpx; | ||
| 349 | +} | ||
| 350 | + | ||
| 351 | + | ||
| 352 | +/* .popup-container { | ||
| 353 | + content:''; | ||
| 354 | + position: fixed; | ||
| 355 | + top: 0; | ||
| 356 | + bottom: 0; | ||
| 357 | + left: 0; | ||
| 358 | + right: 0; | ||
| 359 | + z-index: 3; | ||
| 360 | + background-color: rgba(0,0,0,.6); | ||
| 361 | + display: flex; | ||
| 362 | + align-items: center; | ||
| 363 | + justify-content: center; | ||
| 364 | +} | ||
| 365 | +.popup { | ||
| 366 | + width: 90%; | ||
| 367 | +} | ||
| 368 | +.popup-content { | ||
| 369 | + box-sizing: border-box; | ||
| 370 | + width: 100%; | ||
| 371 | + background-color: white; | ||
| 372 | + padding: 0 20rpx; | ||
| 373 | + border-radius: 10rpx; | ||
| 374 | + max-height: 1038rpx; | ||
| 375 | +} | ||
| 376 | +.icon-close { | ||
| 377 | + font-size: 60rpx; | ||
| 378 | + color: white; | ||
| 379 | +} | ||
| 380 | +.popup-btn { | ||
| 381 | + padding-top: 30rpx; | ||
| 382 | +} */ | ||
| 383 | + | ||
| 384 | +/* .popup-title { */ | ||
| 385 | + /* font-size: 28rpx; */ | ||
| 386 | + /* font-weight: bold; | ||
| 387 | + padding: 20rpx 0; | ||
| 388 | +} */ | ||
| 389 | +/* .popup-title2 { */ | ||
| 390 | + /* padding: 10rpx 0; */ | ||
| 391 | + /* padding-bottom: 8rpx; | ||
| 392 | +} | ||
| 393 | +.popup-title3 { | ||
| 394 | + padding-left: 34rpx; | ||
| 395 | + font-size: 30rpx; | ||
| 396 | +} | ||
| 397 | +.popup-list { | ||
| 398 | + max-height: 602rpx; | ||
| 399 | + overflow-y: auto; | ||
| 400 | +} | ||
| 401 | + | ||
| 402 | + | ||
| 403 | +radio .wx-radio-input { | ||
| 404 | + width: 28rpx; | ||
| 405 | + height: 28rpx; | ||
| 406 | +} | ||
| 407 | + | ||
| 408 | + | ||
| 409 | +radio .wx-radio-input.wx-radio-input-checked { | ||
| 410 | + background-color: #FE6867; | ||
| 411 | + border-color: #FE6867; | ||
| 412 | +} | ||
| 413 | +radio .wx-radio-input.wx-radio-input-checked::before{ | ||
| 414 | + color: white; | ||
| 415 | +} */ | ||
| 416 | + | ||
| 417 | +/* .popup-content.active { | ||
| 418 | + max-height: 982rpx; | ||
| 419 | + overflow: auto; | ||
| 420 | +} */ | ||
| 421 | + | ||
| 422 | +.banner-container { | ||
| 423 | + height: 360rpx; | ||
| 424 | +} | ||
| 425 | +.banner { | ||
| 426 | + display: block; | ||
| 427 | + width: 100%; | ||
| 428 | + height: 100%; | ||
| 429 | +} | ||
| 0 | \ No newline at end of file | 430 | \ No newline at end of file |
packageA/pages/liveStreamDetails/liveStreamDetails.js
| @@ -397,6 +397,18 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un | @@ -397,6 +397,18 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un | ||
| 397 | onLoad: function (options) { | 397 | onLoad: function (options) { |
| 398 | var that = this; | 398 | var that = this; |
| 399 | this.getSystemInfo(); | 399 | this.getSystemInfo(); |
| 400 | + | ||
| 401 | + var first_leader=options.first_leader; | ||
| 402 | + if(first_leader){ | ||
| 403 | + //-- user_id代过来免登陆 -- | ||
| 404 | + getApp().globalData.first_leader=first_leader; | ||
| 405 | + //调用接口判断是不是会员 | ||
| 406 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+o.stoid+"/"+first_leader,{}).then(res=>{ | ||
| 407 | + if(res.data.code==0){ | ||
| 408 | + getApp().globalData.guide_id=res.data.data.id; | ||
| 409 | + } | ||
| 410 | + }) | ||
| 411 | + } | ||
| 400 | 412 | ||
| 401 | getApp().request.promiseGet("/api/weshop/wx/livelist/get",{ | 413 | getApp().request.promiseGet("/api/weshop/wx/livelist/get",{ |
| 402 | data:{ id: options.id } | 414 | data:{ id: options.id } |
packageA/pages/live_share/live_share.js
0 → 100644
| 1 | +// packageA//pages/goods_share/goods_share.js | ||
| 2 | +var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js"); | ||
| 3 | +Page({ | ||
| 4 | + | ||
| 5 | + /** | ||
| 6 | + * 页面的初始数据 | ||
| 7 | + */ | ||
| 8 | + data: { | ||
| 9 | + //促销页tab | ||
| 10 | + tab2: ['正在直播','即将开始','精彩回放'], | ||
| 11 | + currentIndex2: 0, | ||
| 12 | + //popup | ||
| 13 | + hiddenPopup: true, | ||
| 14 | + | ||
| 15 | + list:[], | ||
| 16 | + is_load:0, //是否正在加载 | ||
| 17 | + is_no_data:0, //没有数据 | ||
| 18 | + is_no_more:0, //没有更多数据 | ||
| 19 | + key_str:'', | ||
| 20 | + currentPage:1, //当前的页码 | ||
| 21 | + share_hidden:1, //-- 分享的按钮隐藏 -- | ||
| 22 | + }, | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 生命周期函数--监听页面加载 | ||
| 26 | + */ | ||
| 27 | + onLoad: function (options) { | ||
| 28 | + var th=this; | ||
| 29 | + //接受有没有导购的参数 | ||
| 30 | + var first_leader=options.first_leader; | ||
| 31 | + if(first_leader){ | ||
| 32 | + //-- user_id代过来免登陆 -- | ||
| 33 | + getApp().globalData.user_id=first_leader; | ||
| 34 | + getApp().getUserFir(); | ||
| 35 | + } | ||
| 36 | + this.requestGoodsList(); | ||
| 37 | + | ||
| 38 | + }, | ||
| 39 | + /** | ||
| 40 | + * 生命周期函数--监听页面显示 | ||
| 41 | + */ | ||
| 42 | + onShow: function () { | ||
| 43 | + | ||
| 44 | + }, | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 生命周期函数--监听页面隐藏 | ||
| 48 | + */ | ||
| 49 | + onHide: function () { | ||
| 50 | + | ||
| 51 | + }, | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 55 | + */ | ||
| 56 | + // onPullDownRefresh: function () { | ||
| 57 | + | ||
| 58 | + // }, | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 页面上拉触底事件的处理函数 | ||
| 62 | + */ | ||
| 63 | + onReachBottom: function () { | ||
| 64 | + | ||
| 65 | + }, | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 用户点击右上角分享 | ||
| 69 | + */ | ||
| 70 | + onShareAppMessage: function () { | ||
| 71 | + var th=this; | ||
| 72 | + var id=th.data.hui_active.id; | ||
| 73 | + var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + id + '&live=ing'; | ||
| 74 | + if(getApp().globalData.user_id){ | ||
| 75 | + url+="&first_leader="+getApp().globalData.user_id; | ||
| 76 | + } | ||
| 77 | + var title=th.data.hui_active.name; | ||
| 78 | + var img=th.data.hui_active.share_img; | ||
| 79 | + var ob={ | ||
| 80 | + title:title, | ||
| 81 | + path:url, | ||
| 82 | + imageUrl: img, | ||
| 83 | + }; | ||
| 84 | + th.setData({share_hidden:1}); | ||
| 85 | + return ob; | ||
| 86 | + }, | ||
| 87 | + | ||
| 88 | + | ||
| 89 | + // 点击tab | ||
| 90 | + clickTab2(e) { | ||
| 91 | + if(this.data.currentIndex2!=e.target.dataset.index){ | ||
| 92 | + this.setData({ | ||
| 93 | + currentIndex2: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[], | ||
| 94 | + }); | ||
| 95 | + this.data.is_load=0; | ||
| 96 | + this.data.currentPage=1; | ||
| 97 | + this.requestGoodsList(); | ||
| 98 | + } | ||
| 99 | + }, | ||
| 100 | + | ||
| 101 | + // 关闭弹出层 | ||
| 102 | + closePopup() { | ||
| 103 | + this.setData({ | ||
| 104 | + hiddenPopup: true | ||
| 105 | + }); | ||
| 106 | + }, | ||
| 107 | + // 显示弹出层 | ||
| 108 | + showPopup() { | ||
| 109 | + this.setData({ | ||
| 110 | + hiddenPopup: false | ||
| 111 | + }); | ||
| 112 | + }, | ||
| 113 | + | ||
| 114 | + requestGoodsList:function(){ | ||
| 115 | + var th=this; | ||
| 116 | + if(th.data.is_load) return false; //-- 正在加载 | ||
| 117 | + if(th.data.is_no_data) return false; //-- 没有数据 | ||
| 118 | + if(th.data.is_no_more) return false; //-- 没有更多 | ||
| 119 | + th.data.is_load=1; | ||
| 120 | + | ||
| 121 | + var url="/api/weshop/wx/livelist/page"; | ||
| 122 | + var req_data={ | ||
| 123 | + page:this.data.currentPage, | ||
| 124 | + store_id:oo.stoid, | ||
| 125 | + } | ||
| 126 | + switch(th.data.currentIndex2){ | ||
| 127 | + case 0: | ||
| 128 | + req_data.live_status=101; | ||
| 129 | + break; | ||
| 130 | + case 1: | ||
| 131 | + req_data.live_status=102; | ||
| 132 | + break; | ||
| 133 | + case 2: | ||
| 134 | + req_data.live_status=103; | ||
| 135 | + break; | ||
| 136 | + } | ||
| 137 | + if(this.data.key_str && this.data.key_str.trim()){ | ||
| 138 | + var str=this.data.key_str.trim(); | ||
| 139 | + req_data.key_str=str; | ||
| 140 | + } | ||
| 141 | + //-- ---调用接口---- | ||
| 142 | + app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{ | ||
| 143 | + th.data.is_load=0; | ||
| 144 | + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | ||
| 145 | + th.data.currentPage++; | ||
| 146 | + var data=res.data.data.pageData; | ||
| 147 | + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});} | ||
| 148 | + var list=th.data.list; | ||
| 149 | + list=list.concat(data); | ||
| 150 | + th.setData({list:list}); | ||
| 151 | + }else{ | ||
| 152 | + if(th.data.currentPage==1){ | ||
| 153 | + th.setData({is_no_data:1}); | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + }) | ||
| 157 | + }, | ||
| 158 | + | ||
| 159 | + //---点击分享优惠活动--- | ||
| 160 | + share_index:function(e){ | ||
| 161 | + | ||
| 162 | + //--先判断会员状态-- | ||
| 163 | + var user_info = getApp().globalData.userInfo; | ||
| 164 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 165 | + //getApp().my_warnning("请先登录",0,this); | ||
| 166 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 167 | + return false; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + var index=e.currentTarget.dataset.index; | ||
| 171 | + var item=this.data.list[index]; | ||
| 172 | + this.setData({share_hidden:0,hui_active:item}); | ||
| 173 | + | ||
| 174 | + var com = this.selectComponent("#share_button"); //组件的id | ||
| 175 | + com.set_type(1); | ||
| 176 | + }, | ||
| 177 | + //-- ---更多加载---- | ||
| 178 | + refresh:function(){ | ||
| 179 | + this.requestGoodsList(); | ||
| 180 | + }, | ||
| 181 | + | ||
| 182 | + cancel:function(){ | ||
| 183 | + this.setData({share_hidden:1}); | ||
| 184 | + }, | ||
| 185 | + go_live:function(e){ | ||
| 186 | + var index=e.currentTarget.dataset.index; | ||
| 187 | + var item=this.data.list[index]; | ||
| 188 | + var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + item.id + '&live=ing'; | ||
| 189 | + getApp().goto(url); | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + | ||
| 193 | + | ||
| 194 | +}) | ||
| 0 | \ No newline at end of file | 195 | \ No newline at end of file |
packageA/pages/live_share/live_share.json
0 → 100644
packageA/pages/live_share/live_share.wxml
0 → 100644
| 1 | +<wxs src="../../../utils/filter.wxs" module="filter"></wxs> | ||
| 2 | +<view class="container"> | ||
| 3 | + <!-- 列表 --> | ||
| 4 | + <view class="list-container"> | ||
| 5 | + <!-- 标题 --> | ||
| 6 | + <view class="subTab-title flex"> | ||
| 7 | + <block wx:for="{{tab2}}"> | ||
| 8 | + <view class="subTab-titleItem {{currentIndex2 == index ? 'active':''}}" data-index="{{index}}" bindtap="clickTab2">{{item}}</view> | ||
| 9 | + </block> | ||
| 10 | + </view> | ||
| 11 | + <!-- 列表项 --> | ||
| 12 | + <scroll-view | ||
| 13 | + class="list" | ||
| 14 | + scroll-y="true" | ||
| 15 | + bindscrolltolower="refresh" | ||
| 16 | + scroll-anchoring | ||
| 17 | + > | ||
| 18 | + <!-- 专享礼包 --> | ||
| 19 | + <block wx:for="{{list}}"> | ||
| 20 | + <view class class="list-item" bindtap="go_live" data-index="{{index}}"> | ||
| 21 | + <view class="img-container {{currentIndex2 == 0?'live':currentIndex2 == 1?'coming':'playback'}}"> | ||
| 22 | + <image src="{{item.cover_img}}" style="width: 100%; height: 100%;" | ||
| 23 | + binderror="bind_bnerr2" lazy-load="true" | ||
| 24 | + data-errorimg="list[{{index}}].share_img"></image> | ||
| 25 | + </view> | ||
| 26 | + <view class="details"> | ||
| 27 | + <view class="ellipsis-2 fs28 name">{{item.name}}</view> | ||
| 28 | + <view class="pdt20 fs26 red">直播时间:{{filter.format_time(item.start_time, 2)}} </view> | ||
| 29 | + <view class="fs26 red pdv10">主播:{{item['anchor_name']}}</view> | ||
| 30 | + <view catchtap="share_index" data-index="{{index}}" class="t-r fs28 pdt10"><view class="btn-share">分享</view></view> | ||
| 31 | + </view> | ||
| 32 | + </view> | ||
| 33 | + </block> | ||
| 34 | + <!-- 暂无数据 --> | ||
| 35 | + <nodata wx:if="{{list.length==0}}" nodataContainer="nodata">暂无数据</nodata> | ||
| 36 | + <view wx:if="{{is_no_more}}" class="no-more t-c">- 已全部加载 -</view> | ||
| 37 | + </scroll-view> | ||
| 38 | + </view> | ||
| 39 | +</view> | ||
| 40 | +<!-- 分享控件,底部弹出 --> | ||
| 41 | +<share_button id="share_button" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{!share_hidden}}"></share_button> | ||
| 42 | + |
packageA/pages/live_share/live_share.wxss
0 → 100644
| 1 | +/* packageA//pages/goods_share/goods_share.wxss */ | ||
| 2 | +.red { | ||
| 3 | + color: #FE6867; | ||
| 4 | +} | ||
| 5 | +.gray { | ||
| 6 | + color: #7b7b7b; | ||
| 7 | +} | ||
| 8 | +.w25 { | ||
| 9 | + width: 25%; | ||
| 10 | +} | ||
| 11 | +.w50 { | ||
| 12 | + width: 50%; | ||
| 13 | +} | ||
| 14 | +.w164 { | ||
| 15 | + width: 164rpx; | ||
| 16 | +} | ||
| 17 | +.bold { | ||
| 18 | + font-weight: bold; | ||
| 19 | +} | ||
| 20 | +page { | ||
| 21 | + background-color: #f2f2f2; | ||
| 22 | + height: 100%; | ||
| 23 | +} | ||
| 24 | +.container { | ||
| 25 | + background-color: white; | ||
| 26 | + height: 100%; | ||
| 27 | +} | ||
| 28 | +.search-container { | ||
| 29 | + display: flex; | ||
| 30 | + padding: 26rpx 20rpx; | ||
| 31 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 32 | +} | ||
| 33 | +.input-container { | ||
| 34 | + flex: 1; | ||
| 35 | + border-radius: 6rpx 0 0 6rpx; | ||
| 36 | + overflow: hidden; | ||
| 37 | +} | ||
| 38 | +.search { | ||
| 39 | + background-color: #f0f0f0; | ||
| 40 | + padding: 10rpx 20rpx; | ||
| 41 | + font-size: 28rpx; | ||
| 42 | +} | ||
| 43 | +.btn-search { | ||
| 44 | + background-color: #FE6867; | ||
| 45 | + color: white; | ||
| 46 | + padding: 0 30rpx; | ||
| 47 | + display: flex; | ||
| 48 | + align-items: center; | ||
| 49 | + border-radius: 0 6rpx 6rpx 0; | ||
| 50 | +} | ||
| 51 | +.title { | ||
| 52 | + display: flex; | ||
| 53 | + font-size: 30rpx; | ||
| 54 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 55 | +} | ||
| 56 | +.title .iconfont { | ||
| 57 | + color: #ccc; | ||
| 58 | + font-size: 16rpx; | ||
| 59 | + margin-left: 8rpx; | ||
| 60 | +} | ||
| 61 | +.title-item { | ||
| 62 | + width: 25%; | ||
| 63 | + box-sizing: border-box; | ||
| 64 | + text-align: center; | ||
| 65 | + padding: 20rpx; | ||
| 66 | + position: relative; | ||
| 67 | +} | ||
| 68 | +.title-item.active { | ||
| 69 | + color: #FE6867; | ||
| 70 | + font-weight: bold; | ||
| 71 | +} | ||
| 72 | +.title-item.active:after { | ||
| 73 | + content:''; | ||
| 74 | + position: absolute; | ||
| 75 | + width: 50%; | ||
| 76 | + height: 4rpx; | ||
| 77 | + background-color: #FE6867; | ||
| 78 | + left: 0; | ||
| 79 | + right: 0; | ||
| 80 | + bottom: 0; | ||
| 81 | + margin: 0 auto; | ||
| 82 | +} | ||
| 83 | +.list-container { | ||
| 84 | + height: calc(100% - 118rpx); | ||
| 85 | +} | ||
| 86 | +.list { | ||
| 87 | + box-sizing: border-box; | ||
| 88 | + height: calc(100% - 82rpx); | ||
| 89 | + background-color: #f2f2f2; | ||
| 90 | + /* padding-bottom: 102rpx; */ | ||
| 91 | +} | ||
| 92 | +.list.active1 { | ||
| 93 | + height: calc(100% - 82rpx - 78rpx); | ||
| 94 | + padding-bottom: 0; | ||
| 95 | +} | ||
| 96 | +.list.active2 { | ||
| 97 | + padding-bottom: 0; | ||
| 98 | +} | ||
| 99 | +.list-item { | ||
| 100 | + display: flex; | ||
| 101 | + padding: 20rpx; | ||
| 102 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 103 | + background-color: white; | ||
| 104 | +} | ||
| 105 | +.img-container { | ||
| 106 | + background-color: #f0f0f0; | ||
| 107 | + width: 280rpx; | ||
| 108 | + height: 248rpx; | ||
| 109 | + display: flex; | ||
| 110 | + align-items: center; | ||
| 111 | + justify-content: center; | ||
| 112 | + position: relative; | ||
| 113 | +} | ||
| 114 | +.img-container:after {} | ||
| 115 | + | ||
| 116 | + | ||
| 117 | +.img-container.live:before { | ||
| 118 | + content: '\e664'; | ||
| 119 | +} | ||
| 120 | +.img-container.coming:before { | ||
| 121 | + content: '\e608'; | ||
| 122 | +} | ||
| 123 | +.img-container.playback:before { | ||
| 124 | + content: '\e603'; | ||
| 125 | +} | ||
| 126 | +.img-container.live:before, | ||
| 127 | +.img-container.coming:before, | ||
| 128 | +.img-container.playback:before { | ||
| 129 | + font-family: iconfont; | ||
| 130 | + background-color: #FE6867; | ||
| 131 | + color: white; | ||
| 132 | + width: 50rpx; | ||
| 133 | + height: 50rpx; | ||
| 134 | + line-height: 50rpx; | ||
| 135 | + text-align: center; | ||
| 136 | + border-radius: 50%; | ||
| 137 | + position: absolute; | ||
| 138 | + left: 10rpx; | ||
| 139 | + top: 10rpx; | ||
| 140 | +} | ||
| 141 | +.details { | ||
| 142 | + flex: 1; | ||
| 143 | + padding-left: 20rpx; | ||
| 144 | +} | ||
| 145 | +.btn-share { | ||
| 146 | + box-sizing: border-box; | ||
| 147 | + display: inline-block; | ||
| 148 | + background-color: #FE6867; | ||
| 149 | + color: white; | ||
| 150 | + padding: 8rpx 30rpx; | ||
| 151 | + border-radius: 6rpx; | ||
| 152 | + text-align: center; | ||
| 153 | +} | ||
| 154 | +.pdt10 { | ||
| 155 | + padding-top: 10rpx; | ||
| 156 | +} | ||
| 157 | +.pdt14 { | ||
| 158 | + padding-top: 14rpx; | ||
| 159 | +} | ||
| 160 | +.pdtb6 { | ||
| 161 | + padding-top: 6rpx; | ||
| 162 | + padding-bottom: 6rpx; | ||
| 163 | +} | ||
| 164 | +.pdtb8 { | ||
| 165 | + padding-top: 8rpx; | ||
| 166 | + padding-bottom: 8rpx; | ||
| 167 | +} | ||
| 168 | +.pdl20 { | ||
| 169 | + padding-left: 104rpx; | ||
| 170 | +} | ||
| 171 | + | ||
| 172 | + | ||
| 173 | +.no-more { | ||
| 174 | + line-height: 3; | ||
| 175 | + color: #ccc; | ||
| 176 | + /* background-color: #f2f2f2; */ | ||
| 177 | +} | ||
| 178 | +.nodata { | ||
| 179 | + text-align: center; | ||
| 180 | + background-color: #f2f2f2; | ||
| 181 | +} | ||
| 182 | +.progress-container { | ||
| 183 | + width: 55%; | ||
| 184 | + padding-right: 10rpx; | ||
| 185 | + position: relative; | ||
| 186 | + text-align: center; | ||
| 187 | +} | ||
| 188 | +.retail { | ||
| 189 | + color: #7b7b7b; | ||
| 190 | + text-decoration: line-through; | ||
| 191 | + font-size: 22rpx; | ||
| 192 | + padding-left: 20rpx; | ||
| 193 | +} | ||
| 194 | +.name { | ||
| 195 | + height: 76rpx; | ||
| 196 | + overflow: hidden; | ||
| 197 | +} | ||
| 198 | + | ||
| 199 | +.percent { | ||
| 200 | + position: absolute; | ||
| 201 | + top: 0; | ||
| 202 | + bottom: 0; | ||
| 203 | + left: 0; | ||
| 204 | + right: 0; | ||
| 205 | + margin: auto; | ||
| 206 | + color: white; | ||
| 207 | +} | ||
| 208 | +.tabbar { | ||
| 209 | + position: fixed; | ||
| 210 | + width: 100%; | ||
| 211 | + bottom: 0; | ||
| 212 | + background-color: white; | ||
| 213 | +} | ||
| 214 | +.tabbar:after { | ||
| 215 | + position: absolute; | ||
| 216 | + content: ''; | ||
| 217 | + width: 2rpx; | ||
| 218 | + height: 50%; | ||
| 219 | + top: 0; | ||
| 220 | + bottom: 0; | ||
| 221 | + left: 0; | ||
| 222 | + right: 0; | ||
| 223 | + margin: auto; | ||
| 224 | + background-color: #f0f0f0; | ||
| 225 | +} | ||
| 226 | +.tabbar-item { | ||
| 227 | + width: 50%; | ||
| 228 | + text-align: center; | ||
| 229 | + padding-top: 30rpx; | ||
| 230 | + padding-bottom: 30rpx; | ||
| 231 | +} | ||
| 232 | +.tabbar-item .iconfont { | ||
| 233 | + margin-right: 10rpx; | ||
| 234 | +} | ||
| 235 | +.tabbar-item.active { | ||
| 236 | + color: #FE6867; | ||
| 237 | +} | ||
| 238 | + | ||
| 239 | + | ||
| 240 | +.group-type, | ||
| 241 | +.group-num { | ||
| 242 | + position: relative; | ||
| 243 | + font-size: 22rpx; | ||
| 244 | +} | ||
| 245 | +.group-type:before, | ||
| 246 | +.group-num:before { | ||
| 247 | + font-family: iconfont; | ||
| 248 | +} | ||
| 249 | +.group-type:before { | ||
| 250 | + content: '\e66a'; | ||
| 251 | + color: white; | ||
| 252 | + background-color: #FE6867; | ||
| 253 | + position: absolute; | ||
| 254 | + left: 0; | ||
| 255 | + top: 0; | ||
| 256 | + bottom: 0; | ||
| 257 | + padding-left: 6rpx; | ||
| 258 | + padding-right: 10rpx; | ||
| 259 | + line-height: 30rpx; | ||
| 260 | +} | ||
| 261 | +.group-num:before { | ||
| 262 | + padding-right: 6rpx; | ||
| 263 | +} | ||
| 264 | +.group-num:before { | ||
| 265 | + content: '\e694'; | ||
| 266 | + position: relative; | ||
| 267 | +} | ||
| 268 | +.group-num { | ||
| 269 | + color: white; | ||
| 270 | + background-color: #FE6867; | ||
| 271 | + border-radius: 34rpx; | ||
| 272 | + padding-left: 10rpx; | ||
| 273 | + padding-right: 10rpx; | ||
| 274 | + margin-right: 14rpx; | ||
| 275 | +} | ||
| 276 | +.group-type { | ||
| 277 | + color: #FE6867; | ||
| 278 | + border: 2rpx solid #FE6867; | ||
| 279 | + padding-left: 42rpx; | ||
| 280 | + padding-right: 4rpx; | ||
| 281 | + border-radius: 6rpx; | ||
| 282 | +} | ||
| 283 | + | ||
| 284 | +.badge { | ||
| 285 | + color: white; | ||
| 286 | + padding: 0 20rpx; | ||
| 287 | + border-radius: 6rpx; | ||
| 288 | + background-color: #FE6867; | ||
| 289 | + margin-right: 10rpx; | ||
| 290 | +} | ||
| 291 | + | ||
| 292 | +.subTab-title { | ||
| 293 | + text-align: center; | ||
| 294 | + justify-content: center; | ||
| 295 | + align-items: center; | ||
| 296 | + font-size: 28rpx; | ||
| 297 | +} | ||
| 298 | +.subTab-list { | ||
| 299 | + padding: 20rpx; | ||
| 300 | +} | ||
| 301 | +.subTab-titleItem { | ||
| 302 | + box-sizing: border-box; | ||
| 303 | + width: calc(100% / 3); | ||
| 304 | + padding: 20rpx 40rpx; | ||
| 305 | + background-color: white; | ||
| 306 | + border-right: 2rpx solid #f8f8f8; | ||
| 307 | +} | ||
| 308 | +.subTab-titleItem:last-child { | ||
| 309 | + border-right: none; | ||
| 310 | +} | ||
| 311 | +.subTab-titleItem.active { | ||
| 312 | + background-color: #FE6867; | ||
| 313 | + color: white; | ||
| 314 | +} | ||
| 315 | +.subTab-item { | ||
| 316 | + padding: 20rpx; | ||
| 317 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 318 | + background-color: white; | ||
| 319 | + border-radius: 8rpx; | ||
| 320 | + box-shadow: 0 8px 12px #e7e9eb; | ||
| 321 | +} | ||
| 322 | +.subTab-item ~ .subTab-item { | ||
| 323 | + margin-top: 20rpx; | ||
| 324 | +} | ||
| 325 | +.pdv10 { | ||
| 326 | + padding-top: 10rpx; | ||
| 327 | + padding-bottom: 10rpx; | ||
| 328 | +} | ||
| 329 | +.pdv20 { | ||
| 330 | + padding-top: 20rpx; | ||
| 331 | + padding-bottom: 20rpx; | ||
| 332 | +} | ||
| 333 | +.pdb10 { | ||
| 334 | + padding-bottom: 10rpx; | ||
| 335 | +} | ||
| 336 | +.pdb20 { | ||
| 337 | + padding-bottom: 20rpx; | ||
| 338 | +} | ||
| 339 | +.bdr-b { | ||
| 340 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 341 | +} | ||
| 342 | +.dash-b { | ||
| 343 | + border-bottom: 2rpx dashed #ddd; | ||
| 344 | +} | ||
| 345 | +.btn-container { | ||
| 346 | + display: flex; | ||
| 347 | + align-items: flex-end; | ||
| 348 | + font-size: 26rpx; | ||
| 349 | +} | ||
| 350 | + | ||
| 351 | + | ||
| 352 | +/* .popup-container { | ||
| 353 | + content:''; | ||
| 354 | + position: fixed; | ||
| 355 | + top: 0; | ||
| 356 | + bottom: 0; | ||
| 357 | + left: 0; | ||
| 358 | + right: 0; | ||
| 359 | + z-index: 3; | ||
| 360 | + background-color: rgba(0,0,0,.6); | ||
| 361 | + display: flex; | ||
| 362 | + align-items: center; | ||
| 363 | + justify-content: center; | ||
| 364 | +} | ||
| 365 | +.popup { | ||
| 366 | + width: 90%; | ||
| 367 | +} | ||
| 368 | +.popup-content { | ||
| 369 | + box-sizing: border-box; | ||
| 370 | + width: 100%; | ||
| 371 | + background-color: white; | ||
| 372 | + padding: 0 20rpx; | ||
| 373 | + border-radius: 10rpx; | ||
| 374 | + max-height: 1038rpx; | ||
| 375 | +} | ||
| 376 | +.icon-close { | ||
| 377 | + font-size: 60rpx; | ||
| 378 | + color: white; | ||
| 379 | +} | ||
| 380 | +.popup-btn { | ||
| 381 | + padding-top: 30rpx; | ||
| 382 | +} | ||
| 383 | + | ||
| 384 | +.popup-title { | ||
| 385 | + /* font-size: 28rpx; */ | ||
| 386 | + /* font-weight: bold; | ||
| 387 | + padding: 20rpx 0; | ||
| 388 | +} | ||
| 389 | +.popup-title2 { */ | ||
| 390 | + /* padding: 10rpx 0; */ | ||
| 391 | + /* padding-bottom: 8rpx; | ||
| 392 | +} | ||
| 393 | +.popup-title3 { | ||
| 394 | + padding-left: 34rpx; | ||
| 395 | + font-size: 30rpx; | ||
| 396 | +} | ||
| 397 | +.popup-list { | ||
| 398 | + max-height: 602rpx; | ||
| 399 | + overflow-y: auto; | ||
| 400 | +} | ||
| 401 | + | ||
| 402 | + | ||
| 403 | +radio .wx-radio-input { | ||
| 404 | + width: 28rpx; | ||
| 405 | + height: 28rpx; | ||
| 406 | +} | ||
| 407 | + | ||
| 408 | + | ||
| 409 | +radio .wx-radio-input.wx-radio-input-checked { | ||
| 410 | + background-color: #FE6867; | ||
| 411 | + border-color: #FE6867; | ||
| 412 | +} | ||
| 413 | +radio .wx-radio-input.wx-radio-input-checked::before{ | ||
| 414 | + color: white; | ||
| 415 | +} | ||
| 416 | + | ||
| 417 | +.popup-content.active { | ||
| 418 | + max-height: 982rpx; | ||
| 419 | + overflow: auto; | ||
| 420 | +} */ | ||
| 421 | + | ||
| 422 | + | ||
| 423 | + | ||
| 424 | + | ||
| 425 | + |
packageA/pages/quan/quan.js
0 → 100644
| 1 | +// packageA//pages/goods_share/goods_share.js | ||
| 2 | +var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js"); | ||
| 3 | +Page({ | ||
| 4 | + | ||
| 5 | + /** | ||
| 6 | + * 页面的初始数据 | ||
| 7 | + */ | ||
| 8 | + data: { | ||
| 9 | + //促销页tab | ||
| 10 | + tab2: ['免费发放'], | ||
| 11 | + currentIndex2:0, | ||
| 12 | + list:[], | ||
| 13 | + is_load:0, //是否正在加载 | ||
| 14 | + is_no_data:0, //没有数据 | ||
| 15 | + is_no_more:0, //没有更多数据 | ||
| 16 | + key_str:'', | ||
| 17 | + currentPage:1, //当前的页码 | ||
| 18 | + share_hidden:1, //-- 分享的按钮隐藏 -- | ||
| 19 | + hiddenPopup:1, | ||
| 20 | + }, | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 生命周期函数--监听页面加载 | ||
| 24 | + */ | ||
| 25 | + onLoad: function (options) { | ||
| 26 | + var th=this; | ||
| 27 | + //接受有没有导购的参数 | ||
| 28 | + var first_leader=options.first_leader; | ||
| 29 | + if(first_leader){ | ||
| 30 | + //-- user_id代过来免登陆 -- | ||
| 31 | + getApp().globalData.user_id=first_leader; | ||
| 32 | + getApp().getUserFir(); | ||
| 33 | + } | ||
| 34 | + this.requestGoodsList(); | ||
| 35 | + this.setData({getcurday:ut.gettimestamp()}); | ||
| 36 | + | ||
| 37 | + wx.setNavigationBarTitle({ | ||
| 38 | + title: "免费优惠券列表", | ||
| 39 | + }) | ||
| 40 | + | ||
| 41 | + }, | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 生命周期函数--监听页面显示 | ||
| 45 | + */ | ||
| 46 | + onShow: function () { }, | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 生命周期函数--监听页面隐藏 | ||
| 50 | + */ | ||
| 51 | + onHide: function () { | ||
| 52 | + | ||
| 53 | + }, | ||
| 54 | + /** | ||
| 55 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 56 | + */ | ||
| 57 | + // onPullDownRefresh: function () { | ||
| 58 | + | ||
| 59 | + // }, | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 页面上拉触底事件的处理函数 | ||
| 63 | + */ | ||
| 64 | + onReachBottom: function () { | ||
| 65 | + | ||
| 66 | + }, | ||
| 67 | + | ||
| 68 | + /** | ||
| 69 | + * 用户点击右上角分享 | ||
| 70 | + */ | ||
| 71 | + onShareAppMessage: function () { | ||
| 72 | + var th=this; | ||
| 73 | + var id=th.data.hui_active.id; | ||
| 74 | + var url="/packageA/pages/quan_pro/quan_pro?id="+id; | ||
| 75 | + | ||
| 76 | + if(getApp().globalData.user_id){ | ||
| 77 | + url+="&first_leader="+getApp().globalData.user_id; | ||
| 78 | + } | ||
| 79 | + var title=th.data.hui_active.name; | ||
| 80 | + var ob={ | ||
| 81 | + title:title, | ||
| 82 | + path:url, | ||
| 83 | + }; | ||
| 84 | + th.setData({share_hidden:1}); | ||
| 85 | + return ob; | ||
| 86 | + }, | ||
| 87 | + | ||
| 88 | + requestGoodsList:function(){ | ||
| 89 | + var th=this; | ||
| 90 | + if(th.data.is_load) return false; //-- 正在加载 | ||
| 91 | + if(th.data.is_no_data) return false; //-- 没有数据 | ||
| 92 | + if(th.data.is_no_more) return false; //-- 没有更多 | ||
| 93 | + th.data.is_load=1; | ||
| 94 | + | ||
| 95 | + var url="/api/weshop/prom/coupon/pageCouponList"; | ||
| 96 | + var req_data={ | ||
| 97 | + page:this.data.currentPage, | ||
| 98 | + store_id:oo.stoid, | ||
| 99 | + type:1 | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + //-- ---调用接口---- | ||
| 103 | + app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{ | ||
| 104 | + th.data.is_load=0; | ||
| 105 | + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ | ||
| 106 | + th.data.currentPage++; | ||
| 107 | + var data=res.data.data.pageData; | ||
| 108 | + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});} | ||
| 109 | + var list=th.data.list; | ||
| 110 | + list=list.concat(data); | ||
| 111 | + th.setData({list:list}); | ||
| 112 | + }else{ | ||
| 113 | + if(th.data.currentPage==1){ | ||
| 114 | + th.setData({is_no_data:1}); | ||
| 115 | + } | ||
| 116 | + } | ||
| 117 | + }) | ||
| 118 | + }, | ||
| 119 | + | ||
| 120 | + | ||
| 121 | + //---点击分享优惠活动--- | ||
| 122 | + share_index:function(e){ | ||
| 123 | + | ||
| 124 | + //--先判断会员状态-- | ||
| 125 | + var user_info = getApp().globalData.userInfo; | ||
| 126 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 127 | + //getApp().my_warnning("请先登录",0,this); | ||
| 128 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 129 | + return false; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + var index=e.currentTarget.dataset.index; | ||
| 133 | + var item=this.data.list[index]; | ||
| 134 | + this.setData({share_hidden:0,hui_active:item}); | ||
| 135 | + | ||
| 136 | + var com = this.selectComponent("#share_button"); //组件的id | ||
| 137 | + com.set_type(1); | ||
| 138 | + }, | ||
| 139 | + //-- ---更多加载---- | ||
| 140 | + refresh:function(){ | ||
| 141 | + this.requestGoodsList(); | ||
| 142 | + }, | ||
| 143 | + | ||
| 144 | + //---点击分享优惠活动--- | ||
| 145 | + share_index:function(e){ | ||
| 146 | + | ||
| 147 | + //--先判断会员状态-- | ||
| 148 | + var user_info = getApp().globalData.userInfo; | ||
| 149 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
| 150 | + //getApp().my_warnning("请先登录",0,this); | ||
| 151 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | ||
| 152 | + return false; | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + var index=e.currentTarget.dataset.index; | ||
| 156 | + var item=this.data.list[index]; | ||
| 157 | + this.setData({share_hidden:0,hui_active:item}); | ||
| 158 | + | ||
| 159 | + var com = this.selectComponent("#share_button"); //组件的id | ||
| 160 | + com.set_type(1); | ||
| 161 | + }, | ||
| 162 | + | ||
| 163 | + cancel:function(){ | ||
| 164 | + this.setData({share_hidden:1}); | ||
| 165 | + }, | ||
| 166 | + | ||
| 167 | + go_quan:function(e){ | ||
| 168 | + var index=e.currentTarget.dataset.index; | ||
| 169 | + var item=this.data.list[index]; | ||
| 170 | + var url="/packageA/pages/quan_pro/quan_pro?id="+item.id; | ||
| 171 | + getApp().goto(url); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + | ||
| 175 | + | ||
| 176 | + | ||
| 177 | + | ||
| 178 | + | ||
| 179 | + | ||
| 180 | +}) | ||
| 0 | \ No newline at end of file | 181 | \ No newline at end of file |
packageA/pages/quan/quan.json
0 → 100644
packageA/pages/quan/quan.wxml
0 → 100644
| 1 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | ||
| 2 | +<view class="container"> | ||
| 3 | + <!-- 列表 --> | ||
| 4 | + <!-- <view class="list-container"> --> | ||
| 5 | + <!-- 标题 --> | ||
| 6 | + <!-- <view class="subTab-title flex"> | ||
| 7 | + <block wx:for="{{tab2}}"> | ||
| 8 | + <view class="subTab-titleItem {{currentIndex2 == index ? 'active':''}}" data-index="{{index}}" bindtap="clickTab2">{{item}}</view> | ||
| 9 | + </block> | ||
| 10 | + </view> --> | ||
| 11 | + <!-- 列表项 --> | ||
| 12 | + <scroll-view | ||
| 13 | + class="list" | ||
| 14 | + scroll-y="true" | ||
| 15 | + bindscrolltolower="refresh" | ||
| 16 | + scroll-anchoring> | ||
| 17 | + | ||
| 18 | + <block wx:for="{{list}}"> | ||
| 19 | + <view class="coupons bg-red" bindtap="go_quan" data-index="{{index}}"> | ||
| 20 | + <view class="flex"> | ||
| 21 | + <view> | ||
| 22 | + <view class="coupon-hd ellipsis-2 fs32">{{item.name}}</view> | ||
| 23 | + <view class="deadline fs28 pdt10" wx:if="{{item.endtype==0}}">限时使用: | ||
| 24 | + <text wx:if="{{item.starttype==1}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}</text> | ||
| 25 | + <text wx:if="{{item.starttype==0 && item.use_start_time>0}}"> {{filters.format_time(item.use_start_time)}}</text>至 | ||
| 26 | + <text wx:if="{{item.use_end_time>0}}"> {{filters.format_time(item.use_end_time)}}</text><text wx:else>不限</text> | ||
| 27 | + </view> | ||
| 28 | + <view class="deadline fs28 pdt10" wx:else>限时使用: | ||
| 29 | + <text wx:if="{{item.starttype==1}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}至</text> <text wx:if="{{item.days>0}}">{{filters.format_time(getcurday+3600*24*item.days)}}</text><text wx:else>不限</text> | ||
| 30 | + </view> | ||
| 31 | + </view> | ||
| 32 | + <view class="price">¥<text class="fs40">{{filters.toFix(item.money,2)}}</text></view> | ||
| 33 | + </view> | ||
| 34 | + <view class="flex ai-center jc_sb pdt20"> | ||
| 35 | + <view wx:if="{{item.useobjecttype==0}}" class="coupon-ft ellipsis-2 fs28">全场任意产品通用</view> | ||
| 36 | + <view wx:if="{{item.useobjecttype==1}}" class="coupon-ft ellipsis-2 fs28">名牌({{item.useobjectname}})</view> | ||
| 37 | + <view wx:if="{{item.useobjecttype==2}}" class="coupon-ft ellipsis-2 fs28">品类({{item.useobjectname}})</view> | ||
| 38 | + <view wx:if="{{item.useobjecttype==11}}" class="coupon-ft ellipsis-2 fs28">用途({{item.useobjectname}})</view> | ||
| 39 | + <view wx:if="{{item.useobjecttype==12}}" class="coupon-ft ellipsis-2 fs28">分类一({{item.useobjectname}})</view> | ||
| 40 | + <view wx:if="{{item.useobjecttype==20}}" class="coupon-ft ellipsis-2 fs28">单品({{item.useobjectname}})</view> | ||
| 41 | + | ||
| 42 | + <view catchtap="share_index" data-index="{{index}}" class="btn-share" >分享</view> | ||
| 43 | + </view> | ||
| 44 | + </view> | ||
| 45 | + </block> | ||
| 46 | + | ||
| 47 | + <!-- 暂无数据 --> | ||
| 48 | + <nodata wx:if="{{list.length==0}}" nodataContainer="nodata">暂无数据</nodata> | ||
| 49 | + <view wx:if="{{is_no_more}}" class="no-more t-c">- 已全部加载 -</view> | ||
| 50 | + </scroll-view> | ||
| 51 | + <!-- </view> --> | ||
| 52 | + <view class="popup-container" hidden="{{hiddenPopup}}"> | ||
| 53 | + <view class="popup" bindtap="select"> | ||
| 54 | + <view class="popup-item bdr-b" hover-class="active" data-index="0"> | ||
| 55 | + <image src="../../images/wx2.png" class="popup-img"></image>微信 | ||
| 56 | + </view> | ||
| 57 | + <view class="popup-item" hover-class="active" data-index="1"> | ||
| 58 | + <image src="../../images/qywx.png" class="popup-img h70"></image>企业微信 | ||
| 59 | + </view> | ||
| 60 | + </view> | ||
| 61 | + </view> | ||
| 62 | +</view> | ||
| 63 | +<!-- 分享控件,底部弹出 --> | ||
| 64 | +<share_button id="share_button" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{!share_hidden}}"></share_button> |
packageA/pages/quan/quan.wxss
0 → 100644
| 1 | +/* packageA//pages/goods_share/goods_share.wxss */ | ||
| 2 | +.red { | ||
| 3 | + color: #FE6867; | ||
| 4 | +} | ||
| 5 | +.gray { | ||
| 6 | + color: #7b7b7b; | ||
| 7 | +} | ||
| 8 | +.w25 { | ||
| 9 | + width: 25%; | ||
| 10 | +} | ||
| 11 | +.w50 { | ||
| 12 | + width: 50%; | ||
| 13 | +} | ||
| 14 | +.w164 { | ||
| 15 | + width: 164rpx; | ||
| 16 | +} | ||
| 17 | +.bold { | ||
| 18 | + font-weight: bold; | ||
| 19 | +} | ||
| 20 | +page { | ||
| 21 | + background-color: #f2f2f2; | ||
| 22 | + height: 100%; | ||
| 23 | +} | ||
| 24 | +.container { | ||
| 25 | + /* background-color: white; */ | ||
| 26 | + height: 100%; | ||
| 27 | +} | ||
| 28 | +.search-container { | ||
| 29 | + display: flex; | ||
| 30 | + padding: 26rpx 20rpx; | ||
| 31 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 32 | +} | ||
| 33 | +.input-container { | ||
| 34 | + flex: 1; | ||
| 35 | + border-radius: 6rpx 0 0 6rpx; | ||
| 36 | + overflow: hidden; | ||
| 37 | +} | ||
| 38 | +.search { | ||
| 39 | + background-color: #f0f0f0; | ||
| 40 | + padding: 10rpx 20rpx; | ||
| 41 | + font-size: 28rpx; | ||
| 42 | +} | ||
| 43 | +.btn-search { | ||
| 44 | + background-color: #FE6867; | ||
| 45 | + color: white; | ||
| 46 | + padding: 0 30rpx; | ||
| 47 | + display: flex; | ||
| 48 | + align-items: center; | ||
| 49 | + border-radius: 0 6rpx 6rpx 0; | ||
| 50 | +} | ||
| 51 | +.title { | ||
| 52 | + display: flex; | ||
| 53 | + font-size: 30rpx; | ||
| 54 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 55 | +} | ||
| 56 | +.title .iconfont { | ||
| 57 | + color: #ccc; | ||
| 58 | + font-size: 16rpx; | ||
| 59 | + margin-left: 8rpx; | ||
| 60 | +} | ||
| 61 | +.title-item { | ||
| 62 | + width: 25%; | ||
| 63 | + box-sizing: border-box; | ||
| 64 | + text-align: center; | ||
| 65 | + padding: 20rpx; | ||
| 66 | + position: relative; | ||
| 67 | +} | ||
| 68 | +.title-item.active { | ||
| 69 | + color: #FE6867; | ||
| 70 | + font-weight: bold; | ||
| 71 | +} | ||
| 72 | +.title-item.active:after { | ||
| 73 | + content:''; | ||
| 74 | + position: absolute; | ||
| 75 | + width: 50%; | ||
| 76 | + height: 4rpx; | ||
| 77 | + background-color: #FE6867; | ||
| 78 | + left: 0; | ||
| 79 | + right: 0; | ||
| 80 | + bottom: 0; | ||
| 81 | + margin: 0 auto; | ||
| 82 | +} | ||
| 83 | +.list-container { | ||
| 84 | + /* height: 100%; */ | ||
| 85 | +} | ||
| 86 | +.list { | ||
| 87 | + box-sizing: border-box; | ||
| 88 | + /* height: calc(100% - 78rpx); */ | ||
| 89 | + height: 100%; | ||
| 90 | + background-color: #f2f2f2; | ||
| 91 | + padding: 20rpx 20rpx 0 20rpx; | ||
| 92 | + /* padding-bottom: 102rpx; */ | ||
| 93 | +} | ||
| 94 | +.list.active1 { | ||
| 95 | + height: calc(100% - 82rpx - 78rpx); | ||
| 96 | + padding-bottom: 0; | ||
| 97 | +} | ||
| 98 | +.list.active2 { | ||
| 99 | + padding-bottom: 0; | ||
| 100 | +} | ||
| 101 | +.list-item { | ||
| 102 | + display: flex; | ||
| 103 | + padding: 20rpx; | ||
| 104 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 105 | + background-color: white; | ||
| 106 | +} | ||
| 107 | +.img-container { | ||
| 108 | + background-color: #f0f0f0; | ||
| 109 | + width: 280rpx; | ||
| 110 | + height: 248rpx; | ||
| 111 | + display: flex; | ||
| 112 | + align-items: center; | ||
| 113 | + justify-content: center; | ||
| 114 | + position: relative; | ||
| 115 | +} | ||
| 116 | +.img-container:after { | ||
| 117 | + font-family: iconfont; | ||
| 118 | + content: '\e8c1'; | ||
| 119 | + color: #bbb; | ||
| 120 | + font-size: 80rpx; | ||
| 121 | +} | ||
| 122 | + | ||
| 123 | + | ||
| 124 | +.img-container.live:before { | ||
| 125 | + content: '\e664'; | ||
| 126 | +} | ||
| 127 | +.img-container.coming:before { | ||
| 128 | + content: '\e608'; | ||
| 129 | +} | ||
| 130 | +.img-container.playback:before { | ||
| 131 | + content: '\e603'; | ||
| 132 | +} | ||
| 133 | +.img-container.live:before, | ||
| 134 | +.img-container.coming:before, | ||
| 135 | +.img-container.playback:before { | ||
| 136 | + font-family: iconfont; | ||
| 137 | + background-color: #FE6867; | ||
| 138 | + color: white; | ||
| 139 | + width: 50rpx; | ||
| 140 | + height: 50rpx; | ||
| 141 | + line-height: 50rpx; | ||
| 142 | + text-align: center; | ||
| 143 | + border-radius: 50%; | ||
| 144 | + position: absolute; | ||
| 145 | + left: 10rpx; | ||
| 146 | + top: 10rpx; | ||
| 147 | +} | ||
| 148 | +.details { | ||
| 149 | + flex: 1; | ||
| 150 | + padding-left: 20rpx; | ||
| 151 | +} | ||
| 152 | +.btn-share { | ||
| 153 | + box-sizing: border-box; | ||
| 154 | + display: inline-block; | ||
| 155 | + background-color: #FE6867; | ||
| 156 | + color: white; | ||
| 157 | + padding: 8rpx 30rpx; | ||
| 158 | + border-radius: 6rpx; | ||
| 159 | + text-align: center; | ||
| 160 | +} | ||
| 161 | +.pdt10 { | ||
| 162 | + padding-top: 10rpx; | ||
| 163 | +} | ||
| 164 | +.pdt14 { | ||
| 165 | + padding-top: 14rpx; | ||
| 166 | +} | ||
| 167 | +.pdtb6 { | ||
| 168 | + padding-top: 6rpx; | ||
| 169 | + padding-bottom: 6rpx; | ||
| 170 | +} | ||
| 171 | +.pdtb8 { | ||
| 172 | + padding-top: 8rpx; | ||
| 173 | + padding-bottom: 8rpx; | ||
| 174 | +} | ||
| 175 | +.pdl20 { | ||
| 176 | + padding-left: 104rpx; | ||
| 177 | +} | ||
| 178 | + | ||
| 179 | + | ||
| 180 | +.no-more { | ||
| 181 | + line-height: 3; | ||
| 182 | + color: #ccc; | ||
| 183 | + /* background-color: #f2f2f2; */ | ||
| 184 | +} | ||
| 185 | +.nodata { | ||
| 186 | + text-align: center; | ||
| 187 | + background-color: #f2f2f2; | ||
| 188 | +} | ||
| 189 | +.progress-container { | ||
| 190 | + width: 55%; | ||
| 191 | + padding-right: 10rpx; | ||
| 192 | + position: relative; | ||
| 193 | + text-align: center; | ||
| 194 | +} | ||
| 195 | +.retail { | ||
| 196 | + color: #7b7b7b; | ||
| 197 | + text-decoration: line-through; | ||
| 198 | + font-size: 22rpx; | ||
| 199 | + padding-left: 20rpx; | ||
| 200 | +} | ||
| 201 | +.name { | ||
| 202 | + height: 76rpx; | ||
| 203 | + overflow: hidden; | ||
| 204 | +} | ||
| 205 | + | ||
| 206 | +.percent { | ||
| 207 | + position: absolute; | ||
| 208 | + top: 0; | ||
| 209 | + bottom: 0; | ||
| 210 | + left: 0; | ||
| 211 | + right: 0; | ||
| 212 | + margin: auto; | ||
| 213 | + color: white; | ||
| 214 | +} | ||
| 215 | +.tabbar { | ||
| 216 | + position: fixed; | ||
| 217 | + width: 100%; | ||
| 218 | + bottom: 0; | ||
| 219 | + background-color: white; | ||
| 220 | +} | ||
| 221 | +.tabbar:after { | ||
| 222 | + position: absolute; | ||
| 223 | + content: ''; | ||
| 224 | + width: 2rpx; | ||
| 225 | + height: 50%; | ||
| 226 | + top: 0; | ||
| 227 | + bottom: 0; | ||
| 228 | + left: 0; | ||
| 229 | + right: 0; | ||
| 230 | + margin: auto; | ||
| 231 | + background-color: #f0f0f0; | ||
| 232 | +} | ||
| 233 | +.tabbar-item { | ||
| 234 | + width: 50%; | ||
| 235 | + text-align: center; | ||
| 236 | + padding-top: 30rpx; | ||
| 237 | + padding-bottom: 30rpx; | ||
| 238 | +} | ||
| 239 | +.tabbar-item .iconfont { | ||
| 240 | + margin-right: 10rpx; | ||
| 241 | +} | ||
| 242 | +.tabbar-item.active { | ||
| 243 | + color: #FE6867; | ||
| 244 | +} | ||
| 245 | + | ||
| 246 | + | ||
| 247 | +.group-type, | ||
| 248 | +.group-num { | ||
| 249 | + position: relative; | ||
| 250 | + font-size: 22rpx; | ||
| 251 | +} | ||
| 252 | +.group-type:before, | ||
| 253 | +.group-num:before { | ||
| 254 | + font-family: iconfont; | ||
| 255 | +} | ||
| 256 | +.group-type:before { | ||
| 257 | + content: '\e66a'; | ||
| 258 | + color: white; | ||
| 259 | + background-color: #FE6867; | ||
| 260 | + position: absolute; | ||
| 261 | + left: 0; | ||
| 262 | + top: 0; | ||
| 263 | + bottom: 0; | ||
| 264 | + padding-left: 6rpx; | ||
| 265 | + padding-right: 10rpx; | ||
| 266 | + line-height: 30rpx; | ||
| 267 | +} | ||
| 268 | +.group-num:before { | ||
| 269 | + padding-right: 6rpx; | ||
| 270 | +} | ||
| 271 | +.group-num:before { | ||
| 272 | + content: '\e694'; | ||
| 273 | + position: relative; | ||
| 274 | +} | ||
| 275 | +.group-num { | ||
| 276 | + color: white; | ||
| 277 | + background-color: #FE6867; | ||
| 278 | + border-radius: 34rpx; | ||
| 279 | + padding-left: 10rpx; | ||
| 280 | + padding-right: 10rpx; | ||
| 281 | + margin-right: 14rpx; | ||
| 282 | +} | ||
| 283 | +.group-type { | ||
| 284 | + color: #FE6867; | ||
| 285 | + border: 2rpx solid #FE6867; | ||
| 286 | + padding-left: 42rpx; | ||
| 287 | + padding-right: 4rpx; | ||
| 288 | + border-radius: 6rpx; | ||
| 289 | +} | ||
| 290 | + | ||
| 291 | +.badge { | ||
| 292 | + color: white; | ||
| 293 | + padding: 0 20rpx; | ||
| 294 | + border-radius: 6rpx; | ||
| 295 | + background-color: #FE6867; | ||
| 296 | + margin-right: 10rpx; | ||
| 297 | +} | ||
| 298 | + | ||
| 299 | +.subTab-title { | ||
| 300 | + text-align: center; | ||
| 301 | + justify-content: center; | ||
| 302 | + align-items: center; | ||
| 303 | + font-size: 28rpx; | ||
| 304 | +} | ||
| 305 | +.subTab-list { | ||
| 306 | + padding: 20rpx; | ||
| 307 | +} | ||
| 308 | +.subTab-titleItem { | ||
| 309 | + box-sizing: border-box; | ||
| 310 | + width: calc(100% / 3); | ||
| 311 | + padding: 20rpx 40rpx; | ||
| 312 | + background-color: white; | ||
| 313 | + border-right: 2rpx solid #f8f8f8; | ||
| 314 | + flex: 1; | ||
| 315 | +} | ||
| 316 | +.subTab-titleItem:last-child { | ||
| 317 | + border-right: none; | ||
| 318 | +} | ||
| 319 | +.subTab-titleItem.active { | ||
| 320 | + background-color: #FE6867; | ||
| 321 | + color: white; | ||
| 322 | +} | ||
| 323 | +.subTab-item { | ||
| 324 | + padding: 20rpx; | ||
| 325 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 326 | + background-color: white; | ||
| 327 | + border-radius: 8rpx; | ||
| 328 | + box-shadow: 0 8px 12px #e7e9eb; | ||
| 329 | +} | ||
| 330 | +.subTab-item ~ .subTab-item { | ||
| 331 | + margin-top: 20rpx; | ||
| 332 | +} | ||
| 333 | +.pdv10 { | ||
| 334 | + padding-top: 10rpx; | ||
| 335 | + padding-bottom: 10rpx; | ||
| 336 | +} | ||
| 337 | +.pdv20 { | ||
| 338 | + padding-top: 20rpx; | ||
| 339 | + padding-bottom: 20rpx; | ||
| 340 | +} | ||
| 341 | +.pdb10 { | ||
| 342 | + padding-bottom: 10rpx; | ||
| 343 | +} | ||
| 344 | +.pdb20 { | ||
| 345 | + padding-bottom: 20rpx; | ||
| 346 | +} | ||
| 347 | +.bdr-b { | ||
| 348 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 349 | +} | ||
| 350 | +.dash-b { | ||
| 351 | + border-bottom: 2rpx dashed #ddd; | ||
| 352 | +} | ||
| 353 | +.btn-container { | ||
| 354 | + display: flex; | ||
| 355 | + align-items: flex-end; | ||
| 356 | + font-size: 26rpx; | ||
| 357 | +} | ||
| 358 | + | ||
| 359 | + | ||
| 360 | +/* .popup-container { | ||
| 361 | + content:''; | ||
| 362 | + position: fixed; | ||
| 363 | + top: 0; | ||
| 364 | + bottom: 0; | ||
| 365 | + left: 0; | ||
| 366 | + right: 0; | ||
| 367 | + z-index: 3; | ||
| 368 | + background-color: rgba(0,0,0,.6); | ||
| 369 | + display: flex; | ||
| 370 | + align-items: center; | ||
| 371 | + justify-content: center; | ||
| 372 | +} | ||
| 373 | +.popup { | ||
| 374 | + width: 90%; | ||
| 375 | +} | ||
| 376 | +.popup-content { | ||
| 377 | + box-sizing: border-box; | ||
| 378 | + width: 100%; | ||
| 379 | + background-color: white; | ||
| 380 | + padding: 0 20rpx; | ||
| 381 | + border-radius: 10rpx; | ||
| 382 | + max-height: 1038rpx; | ||
| 383 | +} | ||
| 384 | +.icon-close { | ||
| 385 | + font-size: 60rpx; | ||
| 386 | + color: white; | ||
| 387 | +} | ||
| 388 | +.popup-btn { | ||
| 389 | + padding-top: 30rpx; | ||
| 390 | +} | ||
| 391 | + | ||
| 392 | +.popup-title { | ||
| 393 | + /* font-size: 28rpx; */ | ||
| 394 | + /* font-weight: bold; | ||
| 395 | + padding: 20rpx 0; | ||
| 396 | +} | ||
| 397 | +.popup-title2 { */ | ||
| 398 | + /* padding: 10rpx 0; */ | ||
| 399 | + /* padding-bottom: 8rpx; | ||
| 400 | +} | ||
| 401 | +.popup-title3 { | ||
| 402 | + padding-left: 34rpx; | ||
| 403 | + font-size: 30rpx; | ||
| 404 | +} | ||
| 405 | +.popup-list { | ||
| 406 | + max-height: 602rpx; | ||
| 407 | + overflow-y: auto; | ||
| 408 | +} | ||
| 409 | + | ||
| 410 | + | ||
| 411 | +radio .wx-radio-input { | ||
| 412 | + width: 28rpx; | ||
| 413 | + height: 28rpx; | ||
| 414 | +} | ||
| 415 | + | ||
| 416 | + | ||
| 417 | +radio .wx-radio-input.wx-radio-input-checked { | ||
| 418 | + background-color: #FE6867; | ||
| 419 | + border-color: #FE6867; | ||
| 420 | +} | ||
| 421 | +radio .wx-radio-input.wx-radio-input-checked::before{ | ||
| 422 | + color: white; | ||
| 423 | +} | ||
| 424 | + | ||
| 425 | +.popup-content.active { | ||
| 426 | + max-height: 982rpx; | ||
| 427 | + overflow: auto; | ||
| 428 | +} */ | ||
| 429 | + | ||
| 430 | + | ||
| 431 | + | ||
| 432 | +.coupons { | ||
| 433 | + color: white; | ||
| 434 | + position: relative; | ||
| 435 | + padding: 28rpx 24rpx 28rpx 46rpx; | ||
| 436 | +} | ||
| 437 | +.coupons.bg-red { | ||
| 438 | + background: #F2F2F2 radial-gradient(circle at 0px 50%, transparent 10px, #FF6768 0) top; | ||
| 439 | +} | ||
| 440 | + | ||
| 441 | + | ||
| 442 | + | ||
| 443 | + | ||
| 444 | +.coupons ~ .coupons { | ||
| 445 | + margin-top: 20rpx; | ||
| 446 | +} | ||
| 447 | + | ||
| 448 | +.coupon-hd { | ||
| 449 | + word-break: break-all; | ||
| 450 | + line-height: 1.4; | ||
| 451 | +} | ||
| 452 | +.coupon-md { | ||
| 453 | + font-size: 26rpx; | ||
| 454 | + position: relative; | ||
| 455 | + padding-right: 200rpx; | ||
| 456 | +} | ||
| 457 | +.coupon-ft { | ||
| 458 | + line-height: 1.4; | ||
| 459 | +} | ||
| 460 | +.price { | ||
| 461 | + position: absolute; | ||
| 462 | + right: 24rpx; | ||
| 463 | +} | ||
| 464 | + | ||
| 465 | +.coupons .btn-share { | ||
| 466 | + flex-shrink: 0; | ||
| 467 | + border-radius: 30rpx; | ||
| 468 | + padding: 8rpx 40rpx; | ||
| 469 | + background-color: red; | ||
| 470 | +} | ||
| 471 | + | ||
| 472 | + | ||
| 473 | +.popup-container { | ||
| 474 | + position: fixed; | ||
| 475 | + left: 0; | ||
| 476 | + top: 0; | ||
| 477 | + width: 100%; | ||
| 478 | + height: 100%; | ||
| 479 | + background-color: rgba(0,0,0,.5); | ||
| 480 | +} | ||
| 481 | +.popup { | ||
| 482 | + background-color: white; | ||
| 483 | + border-radius: 16rpx; | ||
| 484 | + position: absolute; | ||
| 485 | + top: 50%; | ||
| 486 | + left: 50%; | ||
| 487 | + transform: translate(-50%, -50%); | ||
| 488 | + width: 500rpx; | ||
| 489 | + overflow: hidden; | ||
| 490 | +} | ||
| 491 | +.popup-img { | ||
| 492 | + display: block; | ||
| 493 | + width: 80rpx; | ||
| 494 | + height: 80rpx; | ||
| 495 | + margin-right: 20rpx; | ||
| 496 | + flex-shrink: 0; | ||
| 497 | +} | ||
| 498 | +.popup-item { | ||
| 499 | + display: flex; | ||
| 500 | + align-items: center; | ||
| 501 | + padding: 20rpx 90rpx; | ||
| 502 | +} | ||
| 503 | +.h70 { | ||
| 504 | + height: 70rpx; | ||
| 505 | +} | ||
| 506 | + | ||
| 507 | +.active { | ||
| 508 | + background-color: #f2f2f2; | ||
| 509 | +} | ||
| 510 | + | ||
| 511 | + | ||
| 512 | + | ||
| 513 | + |
packageA/pages/quan_pro/quan_pro.js
| @@ -19,6 +19,20 @@ Page({ | @@ -19,6 +19,20 @@ Page({ | ||
| 19 | }, | 19 | }, |
| 20 | //------初始化加载---------- | 20 | //------初始化加载---------- |
| 21 | onLoad: function(t) { | 21 | onLoad: function(t) { |
| 22 | + | ||
| 23 | + var th = this; | ||
| 24 | + var first_leader=t.first_leader; | ||
| 25 | + if(first_leader){ | ||
| 26 | + //-- user_id代过来免登陆 -- | ||
| 27 | + getApp().globalData.first_leader=first_leader; | ||
| 28 | + //调用接口判断是不是会员 | ||
| 29 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ | ||
| 30 | + if(res.data.code==0){ | ||
| 31 | + getApp().globalData.guide_id=res.data.data.id; | ||
| 32 | + } | ||
| 33 | + }) | ||
| 34 | + } | ||
| 35 | + | ||
| 22 | var id=t.id; | 36 | var id=t.id; |
| 23 | this.data.id=id; | 37 | this.data.id=id; |
| 24 | var goods_list = this.selectComponent("#goods_list"); //组件的id | 38 | var goods_list = this.selectComponent("#goods_list"); //组件的id |
pages/cart/cart2/cart2.js
| @@ -112,6 +112,8 @@ Page({ | @@ -112,6 +112,8 @@ Page({ | ||
| 112 | show_card:null, //显示的等级卡 | 112 | show_card:null, //显示的等级卡 |
| 113 | card_name:'', //显示的卡的名称 | 113 | card_name:'', //显示的卡的名称 |
| 114 | card_cut_price:null,//减价多少钱 | 114 | card_cut_price:null,//减价多少钱 |
| 115 | + | ||
| 116 | + show_submit:0, //提交按钮变正常显示 | ||
| 115 | 117 | ||
| 116 | }, | 118 | }, |
| 117 | onLoad: function(t) { | 119 | onLoad: function(t) { |
| @@ -140,8 +142,10 @@ Page({ | @@ -140,8 +142,10 @@ Page({ | ||
| 140 | //----------子页返回父页触发---------- | 142 | //----------子页返回父页触发---------- |
| 141 | onShow: function() { | 143 | onShow: function() { |
| 142 | var th=this; | 144 | var th=this; |
| 145 | + th.setData({show_submit:0}); //让提交先掩藏 | ||
| 146 | + th.data.g_cart_q_time=null; | ||
| 147 | + | ||
| 143 | if (th.data.isclose==0){ | 148 | if (th.data.isclose==0){ |
| 144 | - | ||
| 145 | wx.navigateTo({ | 149 | wx.navigateTo({ |
| 146 | url: "/pages/index/index/index" | 150 | url: "/pages/index/index/index" |
| 147 | }) | 151 | }) |
| @@ -153,7 +157,7 @@ Page({ | @@ -153,7 +157,7 @@ Page({ | ||
| 153 | console.log(ie) | 157 | console.log(ie) |
| 154 | 158 | ||
| 155 | //地址切换要把包邮券清空 | 159 | //地址切换要把包邮券清空 |
| 156 | - if( !th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ | 160 | + if( !th.data.user_addr || !ie || th.data.user_addr.address_id!=ie.address_id){ |
| 157 | var using_quan=th.data.using_quan; | 161 | var using_quan=th.data.using_quan; |
| 158 | for(var i in using_quan){ | 162 | for(var i in using_quan){ |
| 159 | var item=using_quan[i]; | 163 | var item=using_quan[i]; |
| @@ -164,19 +168,22 @@ Page({ | @@ -164,19 +168,22 @@ Page({ | ||
| 164 | } | 168 | } |
| 165 | th.data.isget_by_quan={}; | 169 | th.data.isget_by_quan={}; |
| 166 | } | 170 | } |
| 167 | - | 171 | + |
| 172 | + | ||
| 173 | + th.data.prom_goods_map={}; | ||
| 174 | + th.data.is_summit_ing=0; | ||
| 168 | //更换地址回来要重新调用计算价钱的接口 | 175 | //更换地址回来要重新调用计算价钱的接口 |
| 169 | if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ | 176 | if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){ |
| 170 | th.setData({user_addr: ie }); | 177 | th.setData({user_addr: ie }); |
| 171 | if (th.data.is_b_now == 1) { | 178 | if (th.data.is_b_now == 1) { |
| 172 | if(th.data.bn_goods) { | 179 | if(th.data.bn_goods) { |
| 173 | th.setData({add_back:1}); | 180 | th.setData({add_back:1}); |
| 174 | - th.calculatePrice2(); | 181 | + //th.calculatePrice2(); |
| 175 | } | 182 | } |
| 176 | }else{ | 183 | }else{ |
| 177 | if (th.data.cartlist){ | 184 | if (th.data.cartlist){ |
| 178 | th.setData({add_back:1}); | 185 | th.setData({add_back:1}); |
| 179 | - th.calculatePrice(); | 186 | + //th.calculatePrice(); |
| 180 | } | 187 | } |
| 181 | } | 188 | } |
| 182 | }else{ | 189 | }else{ |
| @@ -277,26 +284,31 @@ Page({ | @@ -277,26 +284,31 @@ Page({ | ||
| 277 | 284 | ||
| 278 | //------获取会员收货地址----- | 285 | //------获取会员收货地址----- |
| 279 | getuser_addr:function(func){ | 286 | getuser_addr:function(func){ |
| 287 | + var th=this; | ||
| 280 | a.get("/api/weshop/useraddress/page", { | 288 | a.get("/api/weshop/useraddress/page", { |
| 281 | - data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600 }, | 289 | + data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600,t:Math.random()}, |
| 282 | success: function (su) { | 290 | success: function (su) { |
| 283 | /*--- | 291 | /*--- |
| 284 | var user_addr=[ | 292 | var user_addr=[ |
| 285 | { 'address_id': 882, 'user_id': 2661, 'consignee': '测试测试测', 'province': 3102, 'city': 3431, 'district': 3466, | 293 | { 'address_id': 882, 'user_id': 2661, 'consignee': '测试测试测', 'province': 3102, 'city': 3431, 'district': 3466, |
| 286 | 'address': 'ed', 'more_address': '山西-长治市-襄垣县-虎(音si)亭镇', 'mobile': 13012345678,'is_default':1}, | 294 | 'address': 'ed', 'more_address': '山西-长治市-襄垣县-虎(音si)亭镇', 'mobile': 13012345678,'is_default':1}, |
| 287 | - ];---*/ | ||
| 288 | - var user_addr = su.data.data.pageData; | ||
| 289 | - var item = null; | ||
| 290 | - var def_item=null; | ||
| 291 | - for (var i = 0; i < user_addr.length; i++) { | ||
| 292 | - if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];} | ||
| 293 | - if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } | ||
| 294 | - } | ||
| 295 | - | ||
| 296 | - if (item == null) item = def_item; | ||
| 297 | - if (item == null) item = user_addr[0]; | 295 | + ];---*/ |
| 296 | + var item = null; | ||
| 297 | + if(su.data.code==0 && su.data.data && su.data.data.pageData){ | ||
| 298 | + var user_addr = su.data.data.pageData; | ||
| 299 | + var def_item=null; | ||
| 300 | + for (var i = 0; i < user_addr.length; i++) { | ||
| 301 | + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];} | ||
| 302 | + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; } | ||
| 303 | + } | ||
| 304 | + | ||
| 305 | + if (item == null) item = def_item; | ||
| 306 | + if (item == null) item = user_addr[0]; | ||
| 307 | + } | ||
| 298 | 308 | ||
| 299 | if(item==undefined) item=null; | 309 | if(item==undefined) item=null; |
| 310 | + if(!item) th.setData({user_addr:null}); //地址为空的时候,要清空,因为返回的时候,有缓存 | ||
| 311 | + | ||
| 300 | func(item); | 312 | func(item); |
| 301 | } | 313 | } |
| 302 | }); | 314 | }); |
| @@ -341,7 +353,8 @@ Page({ | @@ -341,7 +353,8 @@ Page({ | ||
| 341 | } | 353 | } |
| 342 | }); | 354 | }); |
| 343 | }, | 355 | }, |
| 344 | - | 356 | + |
| 357 | + | ||
| 345 | //-----真的获取购物车,入口-------- | 358 | //-----真的获取购物车,入口-------- |
| 346 | get_cart: function () { | 359 | get_cart: function () { |
| 347 | var th = this,app=getApp(); | 360 | var th = this,app=getApp(); |
| @@ -360,11 +373,7 @@ Page({ | @@ -360,11 +373,7 @@ Page({ | ||
| 360 | 373 | ||
| 361 | for (var i = 0; i < carr.length; i++) { | 374 | for (var i = 0; i < carr.length; i++) { |
| 362 | var item = carr[i]; | 375 | var item = carr[i]; |
| 363 | - //要把优惠活动加入,prom_goods_map中,赠品不要运算 | ||
| 364 | - if(item.prom_type==3 && item.is_gift!=1){ | ||
| 365 | - await th.add_prom_goods_map(item); | ||
| 366 | - } | ||
| 367 | - | 376 | + |
| 368 | //-- 如果是等级会员注册返回 -- | 377 | //-- 如果是等级会员注册返回 -- |
| 369 | if(is_card_back){ | 378 | if(is_card_back){ |
| 370 | th.data.card_name=th.data.userinfo.card_field; | 379 | th.data.card_name=th.data.userinfo.card_field; |
| @@ -383,12 +392,17 @@ Page({ | @@ -383,12 +392,17 @@ Page({ | ||
| 383 | // 拼团,搭配购不计算,赠品也不计算,同时会员还未购买等级会员 | 392 | // 拼团,搭配购不计算,赠品也不计算,同时会员还未购买等级会员 |
| 384 | if(item[th.data.card_name]>0 && item['prom_type']!=5 && item['prom_type']!=6 && !th.data.userinfo.card_field | 393 | if(item[th.data.card_name]>0 && item['prom_type']!=5 && item['prom_type']!=6 && !th.data.userinfo.card_field |
| 385 | && !item.is_gift && !item['is_collocation'] && item.goods_price>item[th.data.card_name] ){ | 394 | && !item.is_gift && !item['is_collocation'] && item.goods_price>item[th.data.card_name] ){ |
| 386 | - item.cut_price= item.goods_price-item[th.data.card_name]; | ||
| 387 | - carr[i].cut_price=(item.goods_price-item[th.data.card_name])*item.goods_num; | 395 | + item.cut_price1= item.goods_price-item[th.data.card_name]; |
| 396 | + carr[i].cut_price1=(item.goods_price-item[th.data.card_name])*item.goods_num; | ||
| 388 | } | 397 | } |
| 389 | 398 | ||
| 390 | } | 399 | } |
| 391 | 400 | ||
| 401 | + //要把优惠活动加入,prom_goods_map中,赠品不要运算 | ||
| 402 | + if(item.prom_type==3 && item.is_gift!=1){ | ||
| 403 | + await th.add_prom_goods_map(item); | ||
| 404 | + } | ||
| 405 | + | ||
| 392 | 406 | ||
| 393 | item.original_img = oo.imghost + item.original_img; | 407 | item.original_img = oo.imghost + item.original_img; |
| 394 | /*----接口要弄出来的,先顶着-----*/ | 408 | /*----接口要弄出来的,先顶着-----*/ |
| @@ -399,7 +413,22 @@ Page({ | @@ -399,7 +413,22 @@ Page({ | ||
| 399 | if (arr.length > 0) { | 413 | if (arr.length > 0) { |
| 400 | for (var j = 0; j < arr.length; j++) { | 414 | for (var j = 0; j < arr.length; j++) { |
| 401 | if (arr[j].pickup_id == pcid) { | 415 | if (arr[j].pickup_id == pcid) { |
| 402 | - arr[j].goods.push(item); | 416 | + arr[j].goods.push(item); |
| 417 | + if(item.is_gift!=1){ | ||
| 418 | + //确定配送方式 | ||
| 419 | + if(arr[j].distr_t==0){ | ||
| 420 | + arr[j].distr_t=item.distr_type; | ||
| 421 | + } | ||
| 422 | + var e_t=0 | ||
| 423 | + switch (arr[j].distr_t) { | ||
| 424 | + case 0: e_t = 1; break; | ||
| 425 | + case 1: e_t = 1; break; | ||
| 426 | + case 2: e_t = 0; break; | ||
| 427 | + } | ||
| 428 | + arr[j].exp_type=e_t; | ||
| 429 | + if (e_t == 0) th.setData({ is_all_zt:0}); | ||
| 430 | + } | ||
| 431 | + | ||
| 403 | //-- 把等级卡会优惠多少钱装进去 -- | 432 | //-- 把等级卡会优惠多少钱装进去 -- |
| 404 | if(item.cut_price) arr[j].card_cut_price+=item.cut_price; | 433 | if(item.cut_price) arr[j].card_cut_price+=item.cut_price; |
| 405 | find = 1;break; | 434 | find = 1;break; |
| @@ -426,7 +455,6 @@ Page({ | @@ -426,7 +455,6 @@ Page({ | ||
| 426 | case 1: e_t = 1; break; | 455 | case 1: e_t = 1; break; |
| 427 | case 2: e_t = 0; break; | 456 | case 2: e_t = 0; break; |
| 428 | } | 457 | } |
| 429 | - | ||
| 430 | //如果是物流的话,全部自提的控制要弄成0 | 458 | //如果是物流的话,全部自提的控制要弄成0 |
| 431 | if (e_t == 0) th.setData({ is_all_zt:0}); | 459 | if (e_t == 0) th.setData({ is_all_zt:0}); |
| 432 | 460 | ||
| @@ -441,14 +469,21 @@ Page({ | @@ -441,14 +469,21 @@ Page({ | ||
| 441 | } | 469 | } |
| 442 | 470 | ||
| 443 | var ie = { | 471 | var ie = { |
| 444 | - pickup_id: pcid, pname: pikname, goods: narr, wind: m_wind, distr_t: dis_t,card_cut_price:0, | 472 | + pickup_id: pcid, pname: pikname, goods: narr, wind: m_wind, distr_t: dis_t,card_cut_price:0,exp_type:e_t, |
| 445 | goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0}; | 473 | goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0}; |
| 446 | - | ||
| 447 | - if(!th.data.add_back){ | ||
| 448 | - ie.exp_type= e_t | ||
| 449 | - } | 474 | + |
| 475 | + //-- 如果是回退回来的情况 -- | ||
| 476 | + if(th.data.cartlist && th.data.cartlist.length>0) { | ||
| 477 | + for(var kj in th.data.cartlist){ | ||
| 478 | + if(ie.pickup_id==th.data.cartlist[kj].pickup_id){ | ||
| 479 | + ie.exp_type=th.data.cartlist[kj].exp_type; | ||
| 480 | + break; | ||
| 481 | + } | ||
| 482 | + } | ||
| 483 | + } | ||
| 484 | + | ||
| 450 | //-- 把等级卡会优惠多少钱装进去 -- | 485 | //-- 把等级卡会优惠多少钱装进去 -- |
| 451 | - if(item.cut_price) ie.card_cut_price+=item.cut_price; | 486 | + if(item.cut_price1) ie.card_cut_price+=item.cut_price1; |
| 452 | arr.push(ie); | 487 | arr.push(ie); |
| 453 | 488 | ||
| 454 | } | 489 | } |
| @@ -496,7 +531,9 @@ Page({ | @@ -496,7 +531,9 @@ Page({ | ||
| 496 | case 1: et = 1; break; | 531 | case 1: et = 1; break; |
| 497 | case 2: et = 0; break; | 532 | case 2: et = 0; break; |
| 498 | } | 533 | } |
| 499 | - | 534 | + |
| 535 | + if(th.data.bn_goods) et=th.data.bn_exp_type | ||
| 536 | + | ||
| 500 | var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | 537 | var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; |
| 501 | if(et==0 && def_exp_code){ | 538 | if(et==0 && def_exp_code){ |
| 502 | for(var k=0;k<th.data.wu_arr.length;k++){ | 539 | for(var k=0;k<th.data.wu_arr.length;k++){ |
| @@ -579,12 +616,9 @@ Page({ | @@ -579,12 +616,9 @@ Page({ | ||
| 579 | 616 | ||
| 580 | th.setData({ | 617 | th.setData({ |
| 581 | bn_goods: data, bn_pickname: gg.pick_name,index:m_wind, | 618 | bn_goods: data, bn_pickname: gg.pick_name,index:m_wind, |
| 582 | - bn_pick: gg.pick_id, bn_t_exp_t: distr_t | 619 | + bn_pick: gg.pick_id, bn_t_exp_t: distr_t,bn_exp_type: et |
| 583 | }); | 620 | }); |
| 584 | - | ||
| 585 | - if(!th.data.add_back){ | ||
| 586 | - th.setData({ bn_exp_type: et }) | ||
| 587 | - } | 621 | + |
| 588 | //计算价格 | 622 | //计算价格 |
| 589 | th.calculatePrice2(); | 623 | th.calculatePrice2(); |
| 590 | //获取优惠券 | 624 | //获取优惠券 |
| @@ -615,13 +649,10 @@ Page({ | @@ -615,13 +649,10 @@ Page({ | ||
| 615 | } | 649 | } |
| 616 | th.setData({ | 650 | th.setData({ |
| 617 | bn_goods: t.data.data, bn_pickname: gg.pick_name,index:m_wind, | 651 | bn_goods: t.data.data, bn_pickname: gg.pick_name,index:m_wind, |
| 618 | - bn_pick: gg.pick_id, bn_t_exp_t: distr_t | 652 | + bn_pick: gg.pick_id, bn_t_exp_t: distr_t,bn_exp_type: et |
| 619 | }); | 653 | }); |
| 620 | 654 | ||
| 621 | - if(!th.data.add_back){ | ||
| 622 | - th.setData({ bn_exp_type: et }) | ||
| 623 | - } | ||
| 624 | - | 655 | + |
| 625 | //--搭配促销也是按照购物车的方式来计算优惠券-- | 656 | //--搭配促销也是按照购物车的方式来计算优惠券-- |
| 626 | if(gg.prom_type==5){ | 657 | if(gg.prom_type==5){ |
| 627 | var frozenQuan=null; | 658 | var frozenQuan=null; |
| @@ -658,13 +689,9 @@ Page({ | @@ -658,13 +689,9 @@ Page({ | ||
| 658 | 689 | ||
| 659 | th.setData({ | 690 | th.setData({ |
| 660 | bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, | 691 | bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, |
| 661 | - bn_pick: gg.pick_id, bn_t_exp_t: distr_t | 692 | + bn_pick: gg.pick_id, bn_t_exp_t: distr_t,bn_exp_type: et |
| 662 | }); | 693 | }); |
| 663 | - | ||
| 664 | - if(!th.data.add_back){ | ||
| 665 | - th.setData({ bn_exp_type: et }) | ||
| 666 | - } | ||
| 667 | - | 694 | + |
| 668 | //计算价格 | 695 | //计算价格 |
| 669 | th.calculatePrice2(); | 696 | th.calculatePrice2(); |
| 670 | //获取优惠券 | 697 | //获取优惠券 |
| @@ -713,6 +740,152 @@ Page({ | @@ -713,6 +740,152 @@ Page({ | ||
| 713 | }); | 740 | }); |
| 714 | }, | 741 | }, |
| 715 | 742 | ||
| 743 | + calc_per:async function(c_arr){ | ||
| 744 | + var th=this; | ||
| 745 | + //-- 循环处理 -- | ||
| 746 | + for(var i in c_arr){ | ||
| 747 | + var cart_item=c_arr[i]; //就是每一单的意思 | ||
| 748 | + var pickid=cart_item.pickup_id; | ||
| 749 | + var ord_goods=c_arr[i].goods; //就是每一单的从表的意思 | ||
| 750 | + var o_price=0,q_conditin=0; | ||
| 751 | + //--------循环计算总价----------- | ||
| 752 | + for(var j=0;j<ord_goods.length;j++){ | ||
| 753 | + o_price += ord_goods[j].goods_price * ord_goods[j].goods_num; | ||
| 754 | + } | ||
| 755 | + | ||
| 756 | + //---如果该门店的相关活动,就要算一下减价-- | ||
| 757 | + if(th.data.prom_goods_map[pickid]){ | ||
| 758 | + var ob=th.data.prom_goods_map[pickid]; | ||
| 759 | + for(var ii in ob){ | ||
| 760 | + var item_map=ob[ii]; | ||
| 761 | + if(item_map.bs==undefined || item_map.bs==null) { | ||
| 762 | + //等待,获取一下优惠活动的信息 | ||
| 763 | + await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | ||
| 764 | + data: { | ||
| 765 | + price: item_map.price, prom_id: item_map.prom_id, | ||
| 766 | + goods_num: item_map.goods_num, user_id: getApp().globalData.user_id, | ||
| 767 | + is_bz: item_map.is_bz | ||
| 768 | + } | ||
| 769 | + }).then(res => { | ||
| 770 | + if (res.data.code == 0 && res.data.data.condition) { | ||
| 771 | + var get_data = res.data.data; | ||
| 772 | + item_map.is_bz = get_data.is_bz; //是不是倍增 | ||
| 773 | + item_map.bs = get_data.bs; //是不是倍数 | ||
| 774 | + item_map.is_past = get_data.is_past; //是不是包邮 | ||
| 775 | + item_map.prom_price = get_data.price>=0?get_data.price:item_map.price; | ||
| 776 | + item_map.s_intValue = get_data.intValue; | ||
| 777 | + item_map.s_coupon_id = get_data.coupon_id; | ||
| 778 | + item_map.s_coupon_num = get_data.coupon_num; | ||
| 779 | + if(get_data.gift_id && get_data.goodsinfo) { | ||
| 780 | + item_map.gift_id = get_data.gift_id; | ||
| 781 | + item_map.gift_goods_id = get_data.goods_id; | ||
| 782 | + item_map.gift_goods_name = get_data.goods_name; | ||
| 783 | + item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : ''; | ||
| 784 | + item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : ''; | ||
| 785 | + item_map.gift_original_img = get_data.goodsinfo.original_img; | ||
| 786 | + item_map.gift_limit_num = get_data.limit_num; | ||
| 787 | + item_map.gift_storecount = get_data.gift_storecount; | ||
| 788 | + item_map.gift_weight = get_data.goodsinfo.weight; | ||
| 789 | + item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; | ||
| 790 | + item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; | ||
| 791 | + | ||
| 792 | + } | ||
| 793 | + item_map.s_libao = get_data.libao; | ||
| 794 | + item_map.s_lb_num = get_data.lb_num; | ||
| 795 | + } | ||
| 796 | + }) | ||
| 797 | + } | ||
| 798 | + | ||
| 799 | + //有活动,且优惠活动并没有限制使用优惠券,且有减价 | ||
| 800 | + //--看有没有减价-- | ||
| 801 | + //if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){ | ||
| 802 | + if(item_map.price-item_map.prom_price && item_map.prom_price!==null){ | ||
| 803 | + if(cart_item.prom_pt_json){ | ||
| 804 | + cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}) | ||
| 805 | + }else{ | ||
| 806 | + cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}]; | ||
| 807 | + } | ||
| 808 | + | ||
| 809 | + //-- 如果系统要平摊到单品 -- | ||
| 810 | + //if(!th.data.ispt_goods){ | ||
| 811 | + var pt_data={ | ||
| 812 | + 'prom_id':item_map.prom_id, | ||
| 813 | + 'dis': parseFloat((item_map.price-item_map.prom_price).toFixed(2)), | ||
| 814 | + 'goods':item_map.goods | ||
| 815 | + } | ||
| 816 | + | ||
| 817 | + var pt_res=null; | ||
| 818 | + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{ | ||
| 819 | + if(res.data.code==0){ pt_res=res.data.data; } | ||
| 820 | + }) | ||
| 821 | + if(pt_res){ | ||
| 822 | + for (var io in item_map.goods){ | ||
| 823 | + //平摊赋值 | ||
| 824 | + item_map.goods[io].account_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account; | ||
| 825 | + item_map.goods[io].account_yu_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account_yu; | ||
| 826 | + if(!th.data.ispt_goods){ | ||
| 827 | + item_map.goods[io].account=item_map.goods[io].account_fir; | ||
| 828 | + item_map.goods[io].account_yu=item_map.goods[io].account_yu_fir; | ||
| 829 | + } | ||
| 830 | + } | ||
| 831 | + } | ||
| 832 | + // } | ||
| 833 | + | ||
| 834 | + o_price-=(item_map.price-item_map.prom_price); | ||
| 835 | + //如果有限制使用优惠券,就要减掉参与的活动商品的钱 | ||
| 836 | + if(!item_map.is_xz_yh) q_conditin=o_price; | ||
| 837 | + } | ||
| 838 | + | ||
| 839 | + //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表----------- | ||
| 840 | + for(var j=0;j<ord_goods.length;j++){ | ||
| 841 | + if(ord_goods[j].is_gift) continue; | ||
| 842 | + if(ord_goods[j].prom_type==3 && ord_goods[j].prom_id==item_map.prom_id){ | ||
| 843 | + ord_goods[j].is_xz_yh= item_map.is_xz_yh; | ||
| 844 | + ord_goods[j].is_past= item_map.is_past; | ||
| 845 | + ord_goods[j].account_fir= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account_fir; | ||
| 846 | + ord_goods[j].account_yu_fir= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account_yu_fir; | ||
| 847 | + ord_goods[j].account= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account; | ||
| 848 | + ord_goods[j].account_yu= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account_yu; | ||
| 849 | + } | ||
| 850 | + } | ||
| 851 | + | ||
| 852 | + | ||
| 853 | + //--优惠多少钱-- | ||
| 854 | + if(!cart_item.cut_price) cart_item.cut_price=0; | ||
| 855 | + cart_item.cut_price+=(item_map.price-item_map.prom_price); | ||
| 856 | + //---如果有送积分--- | ||
| 857 | + if(item_map.s_intValue){ | ||
| 858 | + if(!cart_item.s_intValue) cart_item.s_intValue=0; | ||
| 859 | + cart_item.s_intValue+=item_map.s_intValue; | ||
| 860 | + } | ||
| 861 | + //-- 如果有送优惠券的情况 -- | ||
| 862 | + if(item_map.s_coupon_id){ | ||
| 863 | + if(!cart_item.s_coupon_id) { | ||
| 864 | + cart_item.s_coupon_id=item_map.s_coupon_id+""; | ||
| 865 | + cart_item.g_coupon_num=[{'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}]; | ||
| 866 | + } | ||
| 867 | + else{ | ||
| 868 | + cart_item.s_coupon_id+=","+item_map.s_coupon_id; | ||
| 869 | + cart_item.g_coupon_num.push({'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}) | ||
| 870 | + } | ||
| 871 | + } | ||
| 872 | + | ||
| 873 | + //-- 如果有送优包邮券的情况 -- | ||
| 874 | + if(item_map.s_libao){ | ||
| 875 | + if(!cart_item.s_libao) { | ||
| 876 | + cart_item.s_libao=item_map.s_libao+""; | ||
| 877 | + cart_item.g_lb_num=[{'l_id':item_map.s_libao,"num": item_map.s_lb_num}]; | ||
| 878 | + } | ||
| 879 | + else{ | ||
| 880 | + cart_item.s_libao+=","+item_map.s_libao; | ||
| 881 | + cart_item.g_lb_num.push({'l_id':item_map.s_libao,"num": item_map.s_lb_num}) | ||
| 882 | + } | ||
| 883 | + } | ||
| 884 | + } | ||
| 885 | + } | ||
| 886 | + } | ||
| 887 | + }, | ||
| 888 | + | ||
| 716 | //-------------------计算订单价格------------------- | 889 | //-------------------计算订单价格------------------- |
| 717 | calculatePrice: function(t, s) { | 890 | calculatePrice: function(t, s) { |
| 718 | var th = this; | 891 | var th = this; |
| @@ -744,7 +917,17 @@ Page({ | @@ -744,7 +917,17 @@ Page({ | ||
| 744 | } | 917 | } |
| 745 | }) | 918 | }) |
| 746 | }; | 919 | }; |
| 747 | - var c_arr=JSON.parse(JSON.stringify(th.data.old_cartlist)); | 920 | + var c_arr=JSON.parse(JSON.stringify(th.data.old_cartlist)); |
| 921 | + if(th.data.cartlist && th.data.cartlist.length>0){ | ||
| 922 | + for(var i =0;i<c_arr.length;i++){ | ||
| 923 | + c_arr[i].exp_type=th.data.cartlist[i].exp_type; | ||
| 924 | + } | ||
| 925 | + } | ||
| 926 | + | ||
| 927 | + //调用函数计算每件商品的单价 | ||
| 928 | + await th.calc_per(c_arr); | ||
| 929 | + //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品 | ||
| 930 | + await th.get_cart_quan(c_arr); | ||
| 748 | //---循环购物车--- | 931 | //---循环购物车--- |
| 749 | for(var i in c_arr){ | 932 | for(var i in c_arr){ |
| 750 | //因为搭配购买也是再这里计算,搭配购的is_b_now==1 | 933 | //因为搭配购买也是再这里计算,搭配购的is_b_now==1 |
| @@ -772,140 +955,16 @@ Page({ | @@ -772,140 +955,16 @@ Page({ | ||
| 772 | for(var j=0;j<item.length;j++){ | 955 | for(var j=0;j<item.length;j++){ |
| 773 | o_price += item[j].goods_price * item[j].goods_num; | 956 | o_price += item[j].goods_price * item[j].goods_num; |
| 774 | } | 957 | } |
| 958 | + | ||
| 959 | + //如果又优惠的钱,就要减价 | ||
| 960 | + if(c_arr[i].cut_price>0) o_price-=c_arr[i].cut_price; | ||
| 961 | + | ||
| 775 | var f_o_price=o_price; | 962 | var f_o_price=o_price; |
| 776 | 963 | ||
| 777 | //判断包邮券的钱 | 964 | //判断包邮券的钱 |
| 778 | var q_conditin=0; | 965 | var q_conditin=0; |
| 779 | q_conditin=o_price; | 966 | q_conditin=o_price; |
| 780 | - //---如果该门店的相关活动,就要算一下减价-- | ||
| 781 | - if(th.data.prom_goods_map[pickid]){ | ||
| 782 | - var ob=th.data.prom_goods_map[pickid]; | ||
| 783 | - for(var ii in ob){ | ||
| 784 | - var item_map=ob[ii]; | ||
| 785 | - if(item_map.bs==undefined || item_map.bs==null) { | ||
| 786 | - //等待,获取一下优惠活动的信息 | ||
| 787 | - await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | ||
| 788 | - data: { | ||
| 789 | - price: item_map.price, prom_id: item_map.prom_id, | ||
| 790 | - goods_num: item_map.goods_num, user_id: getApp().globalData.user_id, | ||
| 791 | - is_bz: item_map.is_bz | ||
| 792 | - } | ||
| 793 | - }).then(res => { | ||
| 794 | - if (res.data.code == 0 && res.data.data.condition) { | ||
| 795 | - var get_data = res.data.data; | ||
| 796 | - item_map.is_bz = get_data.is_bz; //是不是倍增 | ||
| 797 | - item_map.bs = get_data.bs; //是不是倍数 | ||
| 798 | - item_map.is_past = get_data.is_past; //是不是包邮 | ||
| 799 | - item_map.prom_price = get_data.price>=0?get_data.price:item_map.price; | ||
| 800 | - item_map.s_intValue = get_data.intValue; | ||
| 801 | - item_map.s_coupon_id = get_data.coupon_id; | ||
| 802 | - item_map.s_coupon_num = get_data.coupon_num; | ||
| 803 | - if(get_data.gift_id && get_data.goodsinfo) { | ||
| 804 | - item_map.gift_id = get_data.gift_id; | ||
| 805 | - item_map.gift_goods_id = get_data.goods_id; | ||
| 806 | - item_map.gift_goods_name = get_data.goods_name; | ||
| 807 | - item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : ''; | ||
| 808 | - item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : ''; | ||
| 809 | - item_map.gift_original_img = get_data.goodsinfo.original_img; | ||
| 810 | - item_map.gift_limit_num = get_data.limit_num; | ||
| 811 | - item_map.gift_storecount = get_data.gift_storecount; | ||
| 812 | - item_map.gift_weight = get_data.goodsinfo.weight; | ||
| 813 | - item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; | ||
| 814 | - item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; | ||
| 815 | - | ||
| 816 | - } | ||
| 817 | - item_map.s_libao = get_data.libao; | ||
| 818 | - item_map.s_lb_num = get_data.lb_num; | ||
| 819 | - } | ||
| 820 | - }) | ||
| 821 | - } | ||
| 822 | - | ||
| 823 | - //有活动,且优惠活动并没有限制使用优惠券,且有减价 | ||
| 824 | - //--看有没有减价-- | ||
| 825 | - if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){ | ||
| 826 | - if(cart_item.prom_pt_json){ | ||
| 827 | - cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}) | ||
| 828 | - }else{ | ||
| 829 | - cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}]; | ||
| 830 | - } | ||
| 831 | - | ||
| 832 | - //-- 如果系统要平摊到单品 -- | ||
| 833 | - //if(!th.data.ispt_goods){ | ||
| 834 | - var pt_data={ | ||
| 835 | - 'prom_id':item_map.prom_id, | ||
| 836 | - 'dis': parseFloat((item_map.price-item_map.prom_price).toFixed(2)), | ||
| 837 | - 'goods':item_map.goods | ||
| 838 | - } | ||
| 839 | - | ||
| 840 | - var pt_res=null; | ||
| 841 | - await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{ | ||
| 842 | - if(res.data.code==0){ pt_res=res.data.data; } | ||
| 843 | - }) | ||
| 844 | - if(pt_res){ | ||
| 845 | - for (var io in item_map.goods){ | ||
| 846 | - //平摊赋值 | ||
| 847 | - item_map.goods[io].account_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account; | ||
| 848 | - item_map.goods[io].account_yu_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account_yu; | ||
| 849 | - if(!th.data.ispt_goods){ | ||
| 850 | - item_map.goods[io].account=item_map.goods[io].account_fir; | ||
| 851 | - item_map.goods[io].account_yu=item_map.goods[io].account_yu_fir; | ||
| 852 | - } | ||
| 853 | - } | ||
| 854 | - } | ||
| 855 | - // } | ||
| 856 | - | ||
| 857 | - o_price-=(item_map.price-item_map.prom_price); | ||
| 858 | - //如果有限制使用优惠券,就要减掉参与的活动商品的钱 | ||
| 859 | - if(!item_map.is_xz_yh) q_conditin=o_price; | ||
| 860 | - } | ||
| 861 | - | ||
| 862 | - //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表----------- | ||
| 863 | - for(var j=0;j<item.length;j++){ | ||
| 864 | - if(item[j].is_gift) continue; | ||
| 865 | - if(item[j].prom_type==3 && item[j].prom_id==item_map.prom_id){ | ||
| 866 | - item[j].is_xz_yh= item_map.is_xz_yh; | ||
| 867 | - item[j].is_past= item_map.is_past; | ||
| 868 | - item[j].account_fir= th.item_map_get_goods(item[j].goods_id,item_map).account_fir; | ||
| 869 | - item[j].account_yu_fir= th.item_map_get_goods(item[j].goods_id,item_map).account_yu_fir; | ||
| 870 | - item[j].account= th.item_map_get_goods(item[j].goods_id,item_map).account; | ||
| 871 | - item[j].account_yu= th.item_map_get_goods(item[j].goods_id,item_map).account_yu; | ||
| 872 | - } | ||
| 873 | - } | ||
| 874 | - | ||
| 875 | - | ||
| 876 | - //--优惠多少钱-- | ||
| 877 | - if(!cart_item.cut_price) cart_item.cut_price=0; | ||
| 878 | - cart_item.cut_price+=(item_map.price-item_map.prom_price); | ||
| 879 | - //---如果有送积分--- | ||
| 880 | - if(item_map.s_intValue){ | ||
| 881 | - if(!cart_item.s_intValue) cart_item.s_intValue=0; | ||
| 882 | - cart_item.s_intValue+=item_map.s_intValue; | ||
| 883 | - } | ||
| 884 | - //-- 如果有送优惠券的情况 -- | ||
| 885 | - if(item_map.s_coupon_id){ | ||
| 886 | - if(!cart_item.s_coupon_id) { | ||
| 887 | - cart_item.s_coupon_id=item_map.s_coupon_id+""; | ||
| 888 | - cart_item.g_coupon_num=[{'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}]; | ||
| 889 | - } | ||
| 890 | - else{ | ||
| 891 | - cart_item.s_coupon_id+=","+item_map.s_coupon_id; | ||
| 892 | - cart_item.g_coupon_num.push({'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}) | ||
| 893 | - } | ||
| 894 | - } | ||
| 895 | - //-- 如果有送优包邮券的情况 -- | ||
| 896 | - if(item_map.s_libao){ | ||
| 897 | - if(!cart_item.s_libao) { | ||
| 898 | - cart_item.s_libao=item_map.s_libao+""; | ||
| 899 | - cart_item.g_lb_num=[{'l_id':item_map.s_libao,"num": item_map.s_lb_num}]; | ||
| 900 | - } | ||
| 901 | - else{ | ||
| 902 | - cart_item.s_libao+=","+item_map.s_libao; | ||
| 903 | - cart_item.g_lb_num.push({'l_id':item_map.s_libao,"num": item_map.s_lb_num}) | ||
| 904 | - } | ||
| 905 | - } | ||
| 906 | - } | ||
| 907 | - } | ||
| 908 | - | 967 | + |
| 909 | cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算 | 968 | cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算 |
| 910 | //计算物流费用 | 969 | //计算物流费用 |
| 911 | cart_item.shipping_price = 0; | 970 | cart_item.shipping_price = 0; |
| @@ -965,7 +1024,10 @@ Page({ | @@ -965,7 +1024,10 @@ Page({ | ||
| 965 | } | 1024 | } |
| 966 | 1025 | ||
| 967 | var quan_no=null; | 1026 | var quan_no=null; |
| 968 | - if(th.data.using_quan[pickid])quan_no=th.data.using_quan[pickid].coupon_no; | 1027 | + if(th.data.using_quan[pickid]){ |
| 1028 | + quan_no=th.data.using_quan[pickid].coupon_no; | ||
| 1029 | + } | ||
| 1030 | + | ||
| 969 | //如果是包邮券的时候,要看看券的情况 | 1031 | //如果是包邮券的时候,要看看券的情况 |
| 970 | if(quan_no && th.data.using_quan[pickid].isby==1){ | 1032 | if(quan_no && th.data.using_quan[pickid].isby==1){ |
| 971 | var quan=th.data.using_quan[pickid]; | 1033 | var quan=th.data.using_quan[pickid]; |
| @@ -1004,15 +1066,18 @@ Page({ | @@ -1004,15 +1066,18 @@ Page({ | ||
| 1004 | if(no_ex_good){ | 1066 | if(no_ex_good){ |
| 1005 | is_good_no_by=th.check_by_goods(no_ex_good,item[j].goods_id); | 1067 | is_good_no_by=th.check_by_goods(no_ex_good,item[j].goods_id); |
| 1006 | } | 1068 | } |
| 1069 | + | ||
| 1007 | //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 | 1070 | //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 |
| 1008 | if(o_price>=freight_free && freight_free>0 && !is_good_no_by && th.data.is_no_by[pickid]!=1){ | 1071 | if(o_price>=freight_free && freight_free>0 && !is_good_no_by && th.data.is_no_by[pickid]!=1){ |
| 1009 | continue; | 1072 | continue; |
| 1010 | } | 1073 | } |
| 1074 | + | ||
| 1011 | //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算-- | 1075 | //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算-- |
| 1012 | if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby==1 && !is_good_no_by){ | 1076 | if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby==1 && !is_good_no_by){ |
| 1013 | continue; | 1077 | continue; |
| 1014 | } | 1078 | } |
| 1015 | 1079 | ||
| 1080 | + | ||
| 1016 | //----------------如果是选择了物流--------------------- | 1081 | //----------------如果是选择了物流--------------------- |
| 1017 | if(cart_item.exp_type == 0 && item[j].is_free_shipping==0){ | 1082 | if(cart_item.exp_type == 0 && item[j].is_free_shipping==0){ |
| 1018 | //如果地址不为空 | 1083 | //如果地址不为空 |
| @@ -1038,7 +1103,9 @@ Page({ | @@ -1038,7 +1103,9 @@ Page({ | ||
| 1038 | //计算物流价格 | 1103 | //计算物流价格 |
| 1039 | if (cart_item.exp_type == 0) { | 1104 | if (cart_item.exp_type == 0) { |
| 1040 | freight_free=0; //后面不在进行判断 | 1105 | freight_free=0; //后面不在进行判断 |
| 1041 | - var code = th.data.wu_arr[cart_item.wind].code; | 1106 | + var code = ""; |
| 1107 | + if(th.data.wu_arr && th.data.wu_arr[cart_item.wind]) | ||
| 1108 | + code=th.data.wu_arr[cart_item.wind].code; | ||
| 1042 | cart_item.shipping_price = | 1109 | cart_item.shipping_price = |
| 1043 | th.calculatewuliu(code, o_shipping_price, goods_weight, | 1110 | th.calculatewuliu(code, o_shipping_price, goods_weight, |
| 1044 | goods_piece,th.data.user_addr, freight_free, o_price, rs); | 1111 | goods_piece,th.data.user_addr, freight_free, o_price, rs); |
| @@ -1062,6 +1129,7 @@ Page({ | @@ -1062,6 +1129,7 @@ Page({ | ||
| 1062 | if(quan_no){ | 1129 | if(quan_no){ |
| 1063 | //如果不是包邮券的时候 | 1130 | //如果不是包邮券的时候 |
| 1064 | if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby!=1) { | 1131 | if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby!=1) { |
| 1132 | + var ui=2; | ||
| 1065 | //---获取优惠券优惠--- | 1133 | //---获取优惠券优惠--- |
| 1066 | await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { | 1134 | await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { |
| 1067 | data: { | 1135 | data: { |
| @@ -1197,7 +1265,7 @@ Page({ | @@ -1197,7 +1265,7 @@ Page({ | ||
| 1197 | th.setData({ [atxt]: all_total_m, [atxt1]: all_order_m, | 1265 | th.setData({ [atxt]: all_total_m, [atxt1]: all_order_m, |
| 1198 | [atxt2]: all_price, [atxt3]: all_user_m, [atxt4]: all_shipping_m, | 1266 | [atxt2]: all_price, [atxt3]: all_user_m, [atxt4]: all_shipping_m, |
| 1199 | [atxt5]: all_coupon_price_m,[atxt6]: all_cutprice, | 1267 | [atxt5]: all_coupon_price_m,[atxt6]: all_cutprice, |
| 1200 | - [atxt7]: all_order_prom, | 1268 | + [atxt7]: all_order_prom, show_submit:1 |
| 1201 | }) | 1269 | }) |
| 1202 | th.data.order_prom_list_cart=c_arr; | 1270 | th.data.order_prom_list_cart=c_arr; |
| 1203 | th.set_can_num(); | 1271 | th.set_can_num(); |
| @@ -1247,7 +1315,7 @@ Page({ | @@ -1247,7 +1315,7 @@ Page({ | ||
| 1247 | //-----------计算商品总价-------------- | 1315 | //-----------计算商品总价-------------- |
| 1248 | var allpice = good.shop_price * good.buynum; | 1316 | var allpice = good.shop_price * good.buynum; |
| 1249 | var cut_price=0; | 1317 | var cut_price=0; |
| 1250 | - if(good.prom_type==3 && good.prom_price){ | 1318 | + if(good.prom_type==3 && good.prom_price!==null){ |
| 1251 | cut_price=allpice-good.prom_price; | 1319 | cut_price=allpice-good.prom_price; |
| 1252 | } | 1320 | } |
| 1253 | allpice=parseFloat(allpice).toFixed(2); | 1321 | allpice=parseFloat(allpice).toFixed(2); |
| @@ -1304,12 +1372,12 @@ Page({ | @@ -1304,12 +1372,12 @@ Page({ | ||
| 1304 | goods_piece += good['buynum']; break; | 1372 | goods_piece += good['buynum']; break; |
| 1305 | } | 1373 | } |
| 1306 | 1374 | ||
| 1307 | - var code = th.data.wu_arr[th.data.index].code; | 1375 | + var code =""; |
| 1376 | + if(th.data.wu_arr && th.data.wu_arr[th.data.index]) code=th.data.wu_arr[th.data.index].code; | ||
| 1308 | var freight_free = ee.freight_free; //全场满多少包邮 | 1377 | var freight_free = ee.freight_free; //全场满多少包邮 |
| 1309 | var no_ex_id=ee.no_ex_id; | 1378 | var no_ex_id=ee.no_ex_id; |
| 1310 | th.data.is_no_by[th.data.bn_pick]=0; | 1379 | th.data.is_no_by[th.data.bn_pick]=0; |
| 1311 | 1380 | ||
| 1312 | - | ||
| 1313 | var no_by_data=null; | 1381 | var no_by_data=null; |
| 1314 | var gift_freight_free=freight_free; | 1382 | var gift_freight_free=freight_free; |
| 1315 | //有不包邮区域,且不免运费 | 1383 | //有不包邮区域,且不免运费 |
| @@ -1429,14 +1497,14 @@ Page({ | @@ -1429,14 +1497,14 @@ Page({ | ||
| 1429 | if (th.data.bn_use_money == 1) { | 1497 | if (th.data.bn_use_money == 1) { |
| 1430 | if (amoney> order_m) { | 1498 | if (amoney> order_m) { |
| 1431 | order_m = order_m.toFixed(2); | 1499 | order_m = order_m.toFixed(2); |
| 1432 | - th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) | 1500 | + th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) |
| 1433 | }else{ | 1501 | }else{ |
| 1434 | order_m =parseFloat(order_m - amoney); | 1502 | order_m =parseFloat(order_m - amoney); |
| 1435 | order_m = order_m.toFixed(2); | 1503 | order_m = order_m.toFixed(2); |
| 1436 | - th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price }) | 1504 | + th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) |
| 1437 | } | 1505 | } |
| 1438 | }else{ | 1506 | }else{ |
| 1439 | - th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price }) | 1507 | + th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price,show_submit:1}) |
| 1440 | } | 1508 | } |
| 1441 | //优惠活动送积分 | 1509 | //优惠活动送积分 |
| 1442 | if(good.s_intValue){ | 1510 | if(good.s_intValue){ |
| @@ -1476,14 +1544,14 @@ Page({ | @@ -1476,14 +1544,14 @@ Page({ | ||
| 1476 | if (th.data.bn_use_money == 1) { | 1544 | if (th.data.bn_use_money == 1) { |
| 1477 | if (amoney> order_m) { | 1545 | if (amoney> order_m) { |
| 1478 | order_m = order_m.toFixed(2); | 1546 | order_m = order_m.toFixed(2); |
| 1479 | - th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) | 1547 | + th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) |
| 1480 | }else{ | 1548 | }else{ |
| 1481 | order_m =parseFloat(order_m - amoney); | 1549 | order_m =parseFloat(order_m - amoney); |
| 1482 | order_m = order_m.toFixed(2); | 1550 | order_m = order_m.toFixed(2); |
| 1483 | - th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price }) | 1551 | + th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) |
| 1484 | } | 1552 | } |
| 1485 | }else{ | 1553 | }else{ |
| 1486 | - th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price }) | 1554 | + th.setData({ [txt]: 0, [txt2]: order_m,[txt3]:coupon_price, show_submit:1 }) |
| 1487 | } | 1555 | } |
| 1488 | //优惠活动送积分 | 1556 | //优惠活动送积分 |
| 1489 | if(good.s_intValue){ | 1557 | if(good.s_intValue){ |
| @@ -1527,7 +1595,7 @@ Page({ | @@ -1527,7 +1595,7 @@ Page({ | ||
| 1527 | 1595 | ||
| 1528 | if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ | 1596 | if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){ |
| 1529 | ff = false; getApp().my_warnning("请选择收货地址",0,th); | 1597 | ff = false; getApp().my_warnning("请选择收货地址",0,th); |
| 1530 | - this.data.is_summit_ing = 0; | 1598 | + th.data.is_summit_ing = 0; |
| 1531 | } | 1599 | } |
| 1532 | if (!ff) return false; | 1600 | if (!ff) return false; |
| 1533 | var addr = th.data.user_addr; | 1601 | var addr = th.data.user_addr; |
| @@ -1536,6 +1604,7 @@ Page({ | @@ -1536,6 +1604,7 @@ Page({ | ||
| 1536 | if(th.data.bn_exp_type==0) | 1604 | if(th.data.bn_exp_type==0) |
| 1537 | if(th.data.wu_arr==null || th.data.wu_arr.length<=0){ | 1605 | if(th.data.wu_arr==null || th.data.wu_arr.length<=0){ |
| 1538 | getApp().my_warnning("读取物流失败",0,th); | 1606 | getApp().my_warnning("读取物流失败",0,th); |
| 1607 | + th.data.is_summit_ing = 0; | ||
| 1539 | return false; | 1608 | return false; |
| 1540 | } | 1609 | } |
| 1541 | 1610 | ||
| @@ -1716,7 +1785,9 @@ Page({ | @@ -1716,7 +1785,9 @@ Page({ | ||
| 1716 | console.log(pdata); | 1785 | console.log(pdata); |
| 1717 | }else{ | 1786 | }else{ |
| 1718 | //---------购物车的结算--------- | 1787 | //---------购物车的结算--------- |
| 1719 | - if (th.data.is_all_zt == 0 && th.data.user_addr == null) { ff = false; getApp().confirmBox("请新建收货地址");} | 1788 | + if (th.data.is_all_zt == 0 && th.data.user_addr == null) { |
| 1789 | + th.data.is_summit_ing = 0; | ||
| 1790 | + ff = false; getApp().confirmBox("请新建收货地址");} | ||
| 1720 | if (!ff) return false; | 1791 | if (!ff) return false; |
| 1721 | 1792 | ||
| 1722 | var addr = th.data.user_addr; | 1793 | var addr = th.data.user_addr; |
| @@ -1726,6 +1797,7 @@ Page({ | @@ -1726,6 +1797,7 @@ Page({ | ||
| 1726 | 1797 | ||
| 1727 | if(th.data.is_all_zt !=1) | 1798 | if(th.data.is_all_zt !=1) |
| 1728 | if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){ | 1799 | if(th.data.wu_arr==null || th.data.wu_arr.length<=0 ){ |
| 1800 | + th.data.is_summit_ing = 0; | ||
| 1729 | getApp().confirmBox("读取物流失败"); | 1801 | getApp().confirmBox("读取物流失败"); |
| 1730 | return false; | 1802 | return false; |
| 1731 | } | 1803 | } |
| @@ -1939,7 +2011,7 @@ Page({ | @@ -1939,7 +2011,7 @@ Page({ | ||
| 1939 | util_pay.pay(data.data, function() { | 2011 | util_pay.pay(data.data, function() { |
| 1940 | //app.my_warnning("支付成功",1,th); | 2012 | //app.my_warnning("支付成功",1,th); |
| 1941 | //setTimeout(function () { | 2013 | //setTimeout(function () { |
| 1942 | - wx.navigateTo({ | 2014 | + wx.redirectTo({ |
| 1943 | url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data | 2015 | url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data |
| 1944 | }) | 2016 | }) |
| 1945 | //},1000) | 2017 | //},1000) |
| @@ -1965,7 +2037,7 @@ Page({ | @@ -1965,7 +2037,7 @@ Page({ | ||
| 1965 | //app.my_warnning("支付成功",1,th); | 2037 | //app.my_warnning("支付成功",1,th); |
| 1966 | //setTimeout(function () { | 2038 | //setTimeout(function () { |
| 1967 | th.setData({ isclose: 0 }); | 2039 | th.setData({ isclose: 0 }); |
| 1968 | - wx.navigateTo({ | 2040 | + wx.redirectTo({ |
| 1969 | url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data, | 2041 | url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data, |
| 1970 | }) | 2042 | }) |
| 1971 | //}, 1000) | 2043 | //}, 1000) |
| @@ -2084,6 +2156,7 @@ Page({ | @@ -2084,6 +2156,7 @@ Page({ | ||
| 2084 | 2156 | ||
| 2085 | //--------购物车购买时,选择自提和物流----------- | 2157 | //--------购物车购买时,选择自提和物流----------- |
| 2086 | setexptype_w:function(t){ | 2158 | setexptype_w:function(t){ |
| 2159 | + | ||
| 2087 | var def_exp_code= getApp().globalData.userInfo.def_exp_code,th=this; | 2160 | var def_exp_code= getApp().globalData.userInfo.def_exp_code,th=this; |
| 2088 | var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, | 2161 | var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, |
| 2089 | wl_txt = t.currentTarget.dataset.wl_txt, | 2162 | wl_txt = t.currentTarget.dataset.wl_txt, |
| @@ -2192,6 +2265,7 @@ Page({ | @@ -2192,6 +2265,7 @@ Page({ | ||
| 2192 | if (item == null) return o_shipping_price; | 2265 | if (item == null) return o_shipping_price; |
| 2193 | var fw_price = 0, fp_price=0; | 2266 | var fw_price = 0, fp_price=0; |
| 2194 | item=item.config; | 2267 | item=item.config; |
| 2268 | + if (item == null) return o_shipping_price; | ||
| 2195 | //------按重量---------- | 2269 | //------按重量---------- |
| 2196 | if (goods_weight>=0 && item['money']) { | 2270 | if (goods_weight>=0 && item['money']) { |
| 2197 | fw_price =parseFloat(item['money']); | 2271 | fw_price =parseFloat(item['money']); |
| @@ -2266,13 +2340,19 @@ Page({ | @@ -2266,13 +2340,19 @@ Page({ | ||
| 2266 | 2340 | ||
| 2267 | for(var i in quanlist){ | 2341 | for(var i in quanlist){ |
| 2268 | quanlist[i].is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); | 2342 | quanlist[i].is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); |
| 2269 | - if(!t_user || quanlist[i].CashRepNo!=t_user.coupon_no) quanlist[i].show_red=0; | 2343 | + if(t_user && quanlist[i].CashRepNo==t_user.coupon_no) |
| 2344 | + quanlist[i].show_red=1; | ||
| 2345 | + else | ||
| 2346 | + quanlist[i].show_red=0; | ||
| 2270 | } | 2347 | } |
| 2271 | 2348 | ||
| 2272 | if(get_by_quan_list_cart){ | 2349 | if(get_by_quan_list_cart){ |
| 2273 | for(var i in get_by_quan_list_cart){ | 2350 | for(var i in get_by_quan_list_cart){ |
| 2274 | get_by_quan_list_cart[i].is_using= th.check_in_sele(get_by_quan_list_cart[i].no,pickid); | 2351 | get_by_quan_list_cart[i].is_using= th.check_in_sele(get_by_quan_list_cart[i].no,pickid); |
| 2275 | - if(!t_user || get_by_quan_list_cart[i].no!=t_user.coupon_no) get_by_quan_list_cart[i].show_red=0; | 2352 | + if(t_user && get_by_quan_list_cart[i].no==t_user.coupon_no) |
| 2353 | + get_by_quan_list_cart[i].show_red=1; | ||
| 2354 | + else | ||
| 2355 | + get_by_quan_list_cart[i].show_red=0; | ||
| 2276 | } | 2356 | } |
| 2277 | th.setData({by_quan_list_cart:get_by_quan_list_cart}); | 2357 | th.setData({by_quan_list_cart:get_by_quan_list_cart}); |
| 2278 | }else { | 2358 | }else { |
| @@ -2708,12 +2788,13 @@ Page({ | @@ -2708,12 +2788,13 @@ Page({ | ||
| 2708 | },500); | 2788 | },500); |
| 2709 | }, | 2789 | }, |
| 2710 | //-----获取购物车进来的劵------- | 2790 | //-----获取购物车进来的劵------- |
| 2711 | - get_cart_quan:function () { | 2791 | + get_cart_quan:async function (order_prom_list_cart) { |
| 2712 | var th=this; | 2792 | var th=this; |
| 2713 | var is_xz_yh=1; | 2793 | var is_xz_yh=1; |
| 2714 | //等待值的出现 | 2794 | //等待值的出现 |
| 2715 | - getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { | ||
| 2716 | - var arr=th.data.order_prom_list_cart; | 2795 | + //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { |
| 2796 | + //var arr=th.data.order_prom_list_cart; | ||
| 2797 | + var arr=order_prom_list_cart; | ||
| 2717 | //如果系统有限制使用优惠券 | 2798 | //如果系统有限制使用优惠券 |
| 2718 | if(th.data.is_close_quan) return false; | 2799 | if(th.data.is_close_quan) return false; |
| 2719 | //------------开始计算使用优惠券相关------------ | 2800 | //------------开始计算使用优惠券相关------------ |
| @@ -2792,7 +2873,7 @@ Page({ | @@ -2792,7 +2873,7 @@ Page({ | ||
| 2792 | th.set_can_num(); | 2873 | th.set_can_num(); |
| 2793 | } | 2874 | } |
| 2794 | 2875 | ||
| 2795 | - }) | 2876 | + //}) |
| 2796 | }, | 2877 | }, |
| 2797 | 2878 | ||
| 2798 | //------ 获取立即购买的购物车的劵 -------- | 2879 | //------ 获取立即购买的购物车的劵 -------- |
pages/cart/cart2/cart2.wxml
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <form bindsubmit="submitForm"> | 5 | <form bindsubmit="submitForm"> |
| 6 | <view class="container"> | 6 | <view class="container"> |
| 7 | - <!--要进行判断地址是否显示----> | 7 | + <!--要进行判断地址是否显示----> |
| 8 | <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> | 8 | <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> |
| 9 | <!---默认地址显示------> | 9 | <!---默认地址显示------> |
| 10 | <block wx:if="{{user_addr!=null}}"> | 10 | <block wx:if="{{user_addr!=null}}"> |
| @@ -371,12 +371,12 @@ | @@ -371,12 +371,12 @@ | ||
| 371 | </view> | 371 | </view> |
| 372 | </view> | 372 | </view> |
| 373 | 373 | ||
| 374 | - <view class="btn-wrap shadow-1"> | 374 | + <view class="btn-wrap shadow-1" wx:if="{{show_submit}}"> |
| 375 | <view class="pay-amount"> | 375 | <view class="pay-amount"> |
| 376 | <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view> | 376 | <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view> |
| 377 | <!-- <view class="co-red big"></view> --> | 377 | <!-- <view class="co-red big"></view> --> |
| 378 | </view> | 378 | </view> |
| 379 | - <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | 379 | + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> |
| 380 | </view> | 380 | </view> |
| 381 | </form> | 381 | </form> |
| 382 | 382 |
pages/giftpack/giftpacklist/giftpacklist.js
| @@ -37,18 +37,30 @@ Page({ | @@ -37,18 +37,30 @@ Page({ | ||
| 37 | getGiftID: options.lbId, | 37 | getGiftID: options.lbId, |
| 38 | orderSn: options.orderSn | 38 | orderSn: options.orderSn |
| 39 | }) | 39 | }) |
| 40 | + | ||
| 41 | + //-- 获取分享人的ID -- | ||
| 42 | + var first_leader=options.first_leader; | ||
| 43 | + if(first_leader){ | ||
| 44 | + //-- user_id代过来免登陆 -- | ||
| 45 | + getApp().globalData.first_leader=first_leader; | ||
| 46 | + //调用接口判断是不是会员 | ||
| 47 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ | ||
| 48 | + if(res.data.code==0){ | ||
| 49 | + getApp().globalData.guide_id=res.data.data.id; | ||
| 50 | + } | ||
| 51 | + }) | ||
| 52 | + } | ||
| 40 | 53 | ||
| 41 | th.close(); | 54 | th.close(); |
| 42 | }, | 55 | }, |
| 43 | - onShow: function() { | ||
| 44 | - | 56 | + |
| 57 | + onShow: function() { | ||
| 45 | //--先判断会员状态-- | 58 | //--先判断会员状态-- |
| 46 | var user_info = getApp().globalData.userInfo; | 59 | var user_info = getApp().globalData.userInfo; |
| 47 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 60 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 48 | getApp().goto('/pages/togoin/togoin'); | 61 | getApp().goto('/pages/togoin/togoin'); |
| 49 | return false; | 62 | return false; |
| 50 | } | 63 | } |
| 51 | - | ||
| 52 | if (this.data.isBuy == 0) { | 64 | if (this.data.isBuy == 0) { |
| 53 | this.GetMyGiftList(); | 65 | this.GetMyGiftList(); |
| 54 | } else { | 66 | } else { |
pages/goods/goodsInfo/goodsInfo.js
| @@ -241,6 +241,8 @@ Page({ | @@ -241,6 +241,8 @@ Page({ | ||
| 241 | 241 | ||
| 242 | poster:null, //自定义海报 | 242 | poster:null, //自定义海报 |
| 243 | share_b_img:'', //自定义分享的背景 | 243 | share_b_img:'', //自定义分享的背景 |
| 244 | + | ||
| 245 | + showPoster: false, | ||
| 244 | }, | 246 | }, |
| 245 | 247 | ||
| 246 | //------初始化加载---------- | 248 | //------初始化加载---------- |
| @@ -1536,6 +1538,7 @@ Page({ | @@ -1536,6 +1538,7 @@ Page({ | ||
| 1536 | 1538 | ||
| 1537 | //--点击分享事件--- | 1539 | //--点击分享事件--- |
| 1538 | onShareAppMessage: function(t) { | 1540 | onShareAppMessage: function(t) { |
| 1541 | + | ||
| 1539 | var th = this; | 1542 | var th = this; |
| 1540 | var price = th.data.data.shop_price; | 1543 | var price = th.data.data.shop_price; |
| 1541 | if (th.data.prom_act) { | 1544 | if (th.data.prom_act) { |
| @@ -3330,10 +3333,13 @@ Page({ | @@ -3330,10 +3333,13 @@ Page({ | ||
| 3330 | //先画背景 | 3333 | //先画背景 |
| 3331 | var pg_path = "../../../images/share/share_bg.png"; | 3334 | var pg_path = "../../../images/share/share_bg.png"; |
| 3332 | 3335 | ||
| 3336 | + // context.fillStyle="#FFFFFF"; | ||
| 3337 | + // context.fillRect(0,0,554 * unit, 899 * unit); | ||
| 3338 | + | ||
| 3333 | //-- 如果有自定义海报的时候,判断背景的图片 -- | 3339 | //-- 如果有自定义海报的时候,判断背景的图片 -- |
| 3334 | if(th.data.share_b_img){ | 3340 | if(th.data.share_b_img){ |
| 3335 | pg_path=th.data.share_b_img; | 3341 | pg_path=th.data.share_b_img; |
| 3336 | - } | 3342 | + } |
| 3337 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | 3343 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); |
| 3338 | 3344 | ||
| 3339 | //-- 是自定义海报的情况下 -- | 3345 | //-- 是自定义海报的情况下 -- |
| @@ -3655,10 +3661,13 @@ Page({ | @@ -3655,10 +3661,13 @@ Page({ | ||
| 3655 | }) | 3661 | }) |
| 3656 | return false; | 3662 | return false; |
| 3657 | } | 3663 | } |
| 3658 | - wx.previewImage({ | ||
| 3659 | - //将图片预览出来 | ||
| 3660 | - urls: [that.data.shareImgPath] | ||
| 3661 | - }); | 3664 | + // wx.previewImage({ |
| 3665 | + // //将图片预览出来 | ||
| 3666 | + // urls: [that.data.shareImgPath] | ||
| 3667 | + // }); | ||
| 3668 | + that.setData({ | ||
| 3669 | + showPoster: true, | ||
| 3670 | + }); | ||
| 3662 | wx.hideLoading(); | 3671 | wx.hideLoading(); |
| 3663 | } | 3672 | } |
| 3664 | }) | 3673 | }) |
| @@ -4353,8 +4362,118 @@ Page({ | @@ -4353,8 +4362,118 @@ Page({ | ||
| 4353 | }) | 4362 | }) |
| 4354 | } | 4363 | } |
| 4355 | }) | 4364 | }) |
| 4356 | - } | ||
| 4357 | - | ||
| 4358 | - | 4365 | + }, |
| 4366 | + | ||
| 4367 | + closePoster() { | ||
| 4368 | + this.setData({ | ||
| 4369 | + showPoster: false, | ||
| 4370 | + }); | ||
| 4371 | + }, | ||
| 4372 | + | ||
| 4373 | + // 保存图片到手机 | ||
| 4374 | + savePic() { | ||
| 4375 | + console.log('保存图片'); | ||
| 4376 | + var self = this; | ||
| 4377 | + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 | ||
| 4378 | + this.getSetting().then((res) => { | ||
| 4379 | + // 判断用户是否授权了保存到相册的权限,如果没有发起授权 | ||
| 4380 | + if (!res.authSetting['scope.writePhotosAlbum']) { | ||
| 4381 | + this.authorize().then(() => { | ||
| 4382 | + // 同意授权后保存下载文件 | ||
| 4383 | + this.saveImage(self.data.shareImgPath) | ||
| 4384 | + .then(() => { | ||
| 4385 | + self.setData({ | ||
| 4386 | + showPoster: false | ||
| 4387 | + }); | ||
| 4388 | + }); | ||
| 4389 | + }) | ||
| 4390 | + } else { | ||
| 4391 | + // 如果已经授权,保存下载文件 | ||
| 4392 | + this.saveImage(self.data.shareImgPath) | ||
| 4393 | + .then(() => { | ||
| 4394 | + self.setData({ | ||
| 4395 | + showPoster: false | ||
| 4396 | + }); | ||
| 4397 | + }); | ||
| 4398 | + } | ||
| 4399 | + | ||
| 4400 | + }) | ||
| 4401 | + }, | ||
| 4402 | + | ||
| 4403 | + // 获取用户已经授予了哪些权限 | ||
| 4404 | + getSetting() { | ||
| 4405 | + return new Promise((resolve, reject) => { | ||
| 4406 | + wx.getSetting({ | ||
| 4407 | + success: res => { | ||
| 4408 | + resolve(res) | ||
| 4409 | + } | ||
| 4410 | + }) | ||
| 4411 | + }) | ||
| 4412 | + }, | ||
| 4413 | + | ||
| 4414 | + // 发起首次授权请求 | ||
| 4415 | + authorize() { | ||
| 4416 | + // isFirst 用来记录是否为首次发起授权, | ||
| 4417 | + // 如果首次授权拒绝后,isFirst赋值为1 | ||
| 4418 | + let isFirst = wx.getStorageSync('isFirst') || 0; | ||
| 4419 | + return new Promise((resolve, reject) => { | ||
| 4420 | + wx.authorize({ | ||
| 4421 | + scope: 'scope.writePhotosAlbum', | ||
| 4422 | + // 同意授权 | ||
| 4423 | + success: () => { | ||
| 4424 | + resolve(); | ||
| 4425 | + }, | ||
| 4426 | + // 拒绝授权,这里是用户拒绝授权后的回调 | ||
| 4427 | + fail: res => { | ||
| 4428 | + if(isFirst === 0) { | ||
| 4429 | + wx.setStorageSync('isFirst', 1); | ||
| 4430 | + wx.showToast({ | ||
| 4431 | + title: '保存失败', | ||
| 4432 | + icon: 'none', | ||
| 4433 | + duration: 1000 | ||
| 4434 | + }) | ||
| 4435 | + } else { | ||
| 4436 | + this.showModal(); | ||
| 4437 | + } | ||
| 4438 | + console.log('拒绝授权'); | ||
| 4439 | + reject(); | ||
| 4440 | + } | ||
| 4441 | + }) | ||
| 4442 | + }) | ||
| 4443 | + }, | ||
| 4444 | + | ||
| 4445 | + | ||
| 4446 | + // 保存图片到系统相册 | ||
| 4447 | + saveImage(saveUrl) { | ||
| 4448 | + var self = this; | ||
| 4449 | + return new Promise((resolve, reject) => { | ||
| 4450 | + wx.saveImageToPhotosAlbum({ | ||
| 4451 | + filePath: saveUrl, | ||
| 4452 | + success: (res) => { | ||
| 4453 | + wx.showToast({ | ||
| 4454 | + title: '保存成功', | ||
| 4455 | + duration: 1000, | ||
| 4456 | + }); | ||
| 4457 | + self.setData({ | ||
| 4458 | + showPlaybill: 'true' | ||
| 4459 | + }); | ||
| 4460 | + resolve(); | ||
| 4461 | + }, | ||
| 4462 | + fail: () => { | ||
| 4463 | + wx.showToast({ | ||
| 4464 | + title: '保存失败', | ||
| 4465 | + duration: 1000, | ||
| 4466 | + }); | ||
| 4467 | + } | ||
| 4468 | + }) | ||
| 4469 | + }) | ||
| 4470 | + }, | ||
| 4471 | + | ||
| 4472 | + previewImage() { | ||
| 4473 | + wx.previewImage({ | ||
| 4474 | + //将图片预览出来 | ||
| 4475 | + urls: [this.data.shareImgPath] | ||
| 4476 | + }); | ||
| 4477 | + }, | ||
| 4359 | 4478 | ||
| 4360 | }); | 4479 | }); |
pages/goods/goodsInfo/goodsInfo.wxml
| @@ -383,14 +383,14 @@ | @@ -383,14 +383,14 @@ | ||
| 383 | </block> | 383 | </block> |
| 384 | 384 | ||
| 385 | <!-- 门店收货地址 --> | 385 | <!-- 门店收货地址 --> |
| 386 | - <view class="xc-address_frame flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > | 386 | + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > |
| 387 | <view class="address_frame" bindtap="choice_store" data-ind="0"> | 387 | <view class="address_frame" bindtap="choice_store" data-ind="0"> |
| 388 | <view class="flex-vertical-between "> | 388 | <view class="flex-vertical-between "> |
| 389 | <view class="flex-vertical select_store_height"> | 389 | <view class="flex-vertical select_store_height"> |
| 390 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | 390 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| 391 | - <view class="fs30 xc-ash-9f">选择门店</view> | 391 | + <view class="fs30" style="color:black;">选择门店</view> |
| 392 | </view> | 392 | </view> |
| 393 | - <view class="red_bb fs32"> | 393 | + <view class="red_bb fs30"> |
| 394 | 更多门店 | 394 | 更多门店 |
| 395 | <text class="bg_jj"></text> | 395 | <text class="bg_jj"></text> |
| 396 | </view> | 396 | </view> |
| @@ -421,9 +421,9 @@ | @@ -421,9 +421,9 @@ | ||
| 421 | </view> | 421 | </view> |
| 422 | 422 | ||
| 423 | <!--许程 7.24暂时注释 --> | 423 | <!--许程 7.24暂时注释 --> |
| 424 | - <view wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> | 424 | + <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> |
| 425 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> | 425 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> |
| 426 | - <view class="cx-sizs wsize">领券</view> | 426 | + <view class="cx-sizs fs30">领券</view> |
| 427 | <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}"> | 427 | <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}"> |
| 428 | <view class="circle xc-circular xc-one"></view> | 428 | <view class="circle xc-circular xc-one"></view> |
| 429 | <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view> | 429 | <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view> |
| @@ -478,7 +478,7 @@ | @@ -478,7 +478,7 @@ | ||
| 478 | </block> | 478 | </block> |
| 479 | 479 | ||
| 480 | 480 | ||
| 481 | - <view class="bz_view flex ai-center" wx:if="{{bconfig}}" style="line-height: 36rpx"> | 481 | + <view class="bz_view flex ai-center bdt16" wx:if="{{bconfig}}" style="line-height: 36rpx"> |
| 482 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> | 482 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> |
| 483 | <view class="bz-content">{{bconfig.service_bz}}</view> | 483 | <view class="bz-content">{{bconfig.service_bz}}</view> |
| 484 | </view> | 484 | </view> |
| @@ -507,7 +507,7 @@ | @@ -507,7 +507,7 @@ | ||
| 507 | 507 | ||
| 508 | 508 | ||
| 509 | <!--- 宝贝评价 ----> | 509 | <!--- 宝贝评价 ----> |
| 510 | - <view style="overflow: hidden"> | 510 | + <view class="bdt16" style="overflow: hidden"> |
| 511 | <view class="bb_view"> | 511 | <view class="bb_view"> |
| 512 | <view>宝贝评价({{categories3[0].num}})</view> | 512 | <view>宝贝评价({{categories3[0].num}})</view> |
| 513 | <view class="red_bb" bindtap="look_pj">查看全部 | 513 | <view class="red_bb" bindtap="look_pj">查看全部 |
| @@ -523,32 +523,34 @@ | @@ -523,32 +523,34 @@ | ||
| 523 | </view> | 523 | </view> |
| 524 | 524 | ||
| 525 | <scroll-view scroll-x="true" class="pj_scroll"> | 525 | <scroll-view scroll-x="true" class="pj_scroll"> |
| 526 | - <view class="xc_comment-detail" style="display: inline-block" wx:for="{{fir_comments}}" wx:key="fir_comments"> | ||
| 527 | - <view class="xc_comment-left"> | ||
| 528 | - <view class="xc_comment-user"> | ||
| 529 | - <view class="xc_user-img"> | ||
| 530 | - <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image> | ||
| 531 | - </view> | ||
| 532 | - | ||
| 533 | - <view class="xc_user"> | ||
| 534 | - <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view> | ||
| 535 | - <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | ||
| 536 | - </view> | ||
| 537 | - </view> | ||
| 538 | - <view class="xc_comment-font pj_word_size ellipsis-2"> | ||
| 539 | - {{item.content?item.content:''}} | ||
| 540 | - </view> | ||
| 541 | - <view class="xc_comment-val"> | ||
| 542 | - <view class="xc_comment-time">{{item.add_time}}</view> | ||
| 543 | - | ||
| 544 | - </view> | ||
| 545 | - </view> | ||
| 546 | - <view class="xc_goods-img-frame"> | ||
| 547 | - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> | ||
| 548 | - <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image> | ||
| 549 | - <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image> | ||
| 550 | - </view> | ||
| 551 | - </view> | 526 | + |
| 527 | + <view class="xc_comment-detail" style="display: inline-block" wx:for="{{fir_comments}}" wx:key="fir_comments"> | ||
| 528 | + <view class="xc_comment-left"> | ||
| 529 | + <view class="xc_comment-user"> | ||
| 530 | + <view class="xc_user-img"> | ||
| 531 | + <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image> | ||
| 532 | + </view> | ||
| 533 | + | ||
| 534 | + <view class="xc_user"> | ||
| 535 | + <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view> | ||
| 536 | + <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | ||
| 537 | + </view> | ||
| 538 | + </view> | ||
| 539 | + <view class="xc_comment-font pj_word_size ellipsis-2"> | ||
| 540 | + {{item.content?item.content:''}} | ||
| 541 | + </view> | ||
| 542 | + <view class="xc_comment-val"> | ||
| 543 | + <view class="xc_comment-time">{{item.add_time}}</view> | ||
| 544 | + | ||
| 545 | + </view> | ||
| 546 | + </view> | ||
| 547 | + <view class="xc_goods-img-frame"> | ||
| 548 | + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> | ||
| 549 | + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image> | ||
| 550 | + <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image> | ||
| 551 | + </view> | ||
| 552 | + </view> | ||
| 553 | + | ||
| 552 | </scroll-view> | 554 | </scroll-view> |
| 553 | </view> | 555 | </view> |
| 554 | 556 | ||
| @@ -563,7 +565,7 @@ | @@ -563,7 +565,7 @@ | ||
| 563 | </view> | 565 | </view> |
| 564 | <view class="t_g_info"> | 566 | <view class="t_g_info"> |
| 565 | <view class="red_shu"></view> | 567 | <view class="red_shu"></view> |
| 566 | - <view style='font-size: 32rpx;'>商品信息</view> | 568 | + <view class="fs30">商品信息</view> |
| 567 | </view> | 569 | </view> |
| 568 | <view class="table_s"> | 570 | <view class="table_s"> |
| 569 | <view class="tb_item tb-l"> | 571 | <view class="tb_item tb-l"> |
| @@ -985,7 +987,7 @@ | @@ -985,7 +987,7 @@ | ||
| 985 | <!-- 没有门店的时候 --> | 987 | <!-- 没有门店的时候 --> |
| 986 | <view class="flex" bindtap="choice_store" wx:else> | 988 | <view class="flex" bindtap="choice_store" wx:else> |
| 987 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | 989 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| 988 | - <view class="fs28 xc-ash-9f">选择门店</view> | 990 | + <view class="fs30" style="color:black;">选择门店</view> |
| 989 | </view> | 991 | </view> |
| 990 | 992 | ||
| 991 | <view class="red-co fs28" bindtap="choice_store" > | 993 | <view class="red-co fs28" bindtap="choice_store" > |
| @@ -1483,5 +1485,18 @@ | @@ -1483,5 +1485,18 @@ | ||
| 1483 | </block> | 1485 | </block> |
| 1484 | <!-- ---------------分享弹窗--------------- --> | 1486 | <!-- ---------------分享弹窗--------------- --> |
| 1485 | <!--二维码显示页面--> | 1487 | <!--二维码显示页面--> |
| 1486 | -<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas> | ||
| 1487 | -<warn id="warn"></warn> | ||
| 1488 | \ No newline at end of file | 1488 | \ No newline at end of file |
| 1489 | +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> | ||
| 1490 | +<warn id="warn"></warn> | ||
| 1491 | + | ||
| 1492 | + | ||
| 1493 | +<view wx:if="{{showPoster}}" class="poster-container"> | ||
| 1494 | + <view class="poster" bindtap="previewImage"> | ||
| 1495 | + <image src="{{shareImgPath}}" class="poster-img"></image> | ||
| 1496 | + <view class="btn-close" catchtap="closePoster">x</view> | ||
| 1497 | + </view> | ||
| 1498 | + <view class="btn-container"> | ||
| 1499 | + <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> | ||
| 1500 | + <button class="btn-share" bindtap="savePic">保存到相册</button> | ||
| 1501 | + </view> | ||
| 1502 | +</view> | ||
| 1503 | + |
pages/goods/goodsInfo/goodsInfo.wxss
| @@ -9,15 +9,15 @@ image { | @@ -9,15 +9,15 @@ image { | ||
| 9 | display: flex; | 9 | display: flex; |
| 10 | justify-content: center; | 10 | justify-content: center; |
| 11 | width: 100%; | 11 | width: 100%; |
| 12 | - height: 80rpx; | ||
| 13 | - margin-bottom: 20rpx; | 12 | + /* height: 80rpx; */ |
| 13 | + /* margin-bottom: 20rpx; */ | ||
| 14 | background-color: #fff; | 14 | background-color: #fff; |
| 15 | - border-bottom: 1rpx #fafafa solid; | 15 | + /* border-bottom: 1rpx #fafafa solid; */ |
| 16 | } | 16 | } |
| 17 | .type-box { | 17 | .type-box { |
| 18 | width: 25%; | 18 | width: 25%; |
| 19 | box-sizing: border-box; | 19 | box-sizing: border-box; |
| 20 | - font-size: 36rpx; | 20 | + font-size: 28rpx; |
| 21 | line-height: 76rpx; | 21 | line-height: 76rpx; |
| 22 | padding: 0 20rpx; | 22 | padding: 0 20rpx; |
| 23 | text-align: center; | 23 | text-align: center; |
| @@ -25,13 +25,27 @@ image { | @@ -25,13 +25,27 @@ image { | ||
| 25 | overflow: hidden; | 25 | overflow: hidden; |
| 26 | } | 26 | } |
| 27 | .type-navbar-item { | 27 | .type-navbar-item { |
| 28 | - border-bottom: 4rpx solid #fff; | 28 | + /* border-bottom: 4rpx solid #fff; */ |
| 29 | display: flex; | 29 | display: flex; |
| 30 | justify-content: center; | 30 | justify-content: center; |
| 31 | width: 100%; | 31 | width: 100%; |
| 32 | } | 32 | } |
| 33 | .type-item-on { | 33 | .type-item-on { |
| 34 | - border-bottom: 4rpx solid #333; | 34 | + color: #F95D74; |
| 35 | + font-weight: bold; | ||
| 36 | + /* border-bottom: 4rpx solid #F95D74; */ | ||
| 37 | + position: relative; | ||
| 38 | +} | ||
| 39 | +.type-item-on:after { | ||
| 40 | + content: ''; | ||
| 41 | + position: absolute; | ||
| 42 | + width: 50%; | ||
| 43 | + height: 4rpx; | ||
| 44 | + background-color: #F95D74; | ||
| 45 | + left: 0; | ||
| 46 | + right: 0; | ||
| 47 | + bottom: 0; | ||
| 48 | + margin: 0 auto; | ||
| 35 | } | 49 | } |
| 36 | .swiper_box { | 50 | .swiper_box { |
| 37 | width: 100%; | 51 | width: 100%; |
| @@ -46,9 +60,12 @@ image { | @@ -46,9 +60,12 @@ image { | ||
| 46 | width: 560rpx; | 60 | width: 560rpx; |
| 47 | line-height: 46rpx; | 61 | line-height: 46rpx; |
| 48 | font-size: 32rpx; | 62 | font-size: 32rpx; |
| 63 | + font-weight: bold; | ||
| 49 | color: #333; | 64 | color: #333; |
| 50 | - margin-top: 40rpx; | ||
| 51 | - margin-bottom:20rpx; | 65 | + margin-top: 30rpx; |
| 66 | + margin-bottom:30rpx; | ||
| 67 | + flex: 1; | ||
| 68 | + text-align: justify; | ||
| 52 | } | 69 | } |
| 53 | 70 | ||
| 54 | .goods-collect { | 71 | .goods-collect { |
| @@ -78,7 +95,7 @@ image { | @@ -78,7 +95,7 @@ image { | ||
| 78 | 95 | ||
| 79 | /* margin-top: 46rpx; */ | 96 | /* margin-top: 46rpx; */ |
| 80 | margin-top:26rpx; | 97 | margin-top:26rpx; |
| 81 | - padding-bottom:12rpx; | 98 | + padding-bottom:20rpx; |
| 82 | } | 99 | } |
| 83 | 100 | ||
| 84 | .prom-info { | 101 | .prom-info { |
| @@ -114,7 +131,8 @@ image { | @@ -114,7 +131,8 @@ image { | ||
| 114 | .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} | 131 | .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} |
| 115 | 132 | ||
| 116 | .goods-num { | 133 | .goods-num { |
| 117 | - display: flex;font-size: 28rpx; | 134 | + display: flex; |
| 135 | + font-size: 24rpx; | ||
| 118 | justify-content: space-between; | 136 | justify-content: space-between; |
| 119 | } | 137 | } |
| 120 | 138 | ||
| @@ -949,11 +967,12 @@ left:31rpx;} | @@ -949,11 +967,12 @@ left:31rpx;} | ||
| 949 | 967 | ||
| 950 | .bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx } | 968 | .bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx } |
| 951 | .bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx; | 969 | .bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx; |
| 952 | - border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; } | 970 | + /* border-bottom: 3rpx solid #eee; */ |
| 971 | + /* border-top: 3rpx solid #eee; */} | ||
| 953 | .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;} | 972 | .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;} |
| 954 | 973 | ||
| 955 | .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; | 974 | .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; |
| 956 | - font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } | 975 | + font-size: 30rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } |
| 957 | .red_bb{ color: #d70026; min-width:158rpx;width: auto;} | 976 | .red_bb{ color: #d70026; min-width:158rpx;width: auto;} |
| 958 | .bg_jj{ width: 18rpx; height:18rpx; | 977 | .bg_jj{ width: 18rpx; height:18rpx; |
| 959 | border-top: 2rpx solid #d70026; | 978 | border-top: 2rpx solid #d70026; |
| @@ -1180,7 +1199,7 @@ left:31rpx;} | @@ -1180,7 +1199,7 @@ left:31rpx;} | ||
| 1180 | background: #ffe3e2; | 1199 | background: #ffe3e2; |
| 1181 | color: 28rpx; | 1200 | color: 28rpx; |
| 1182 | border-radius:20rpx; | 1201 | border-radius:20rpx; |
| 1183 | - font-size: 28rpx; | 1202 | + font-size: 24rpx; |
| 1184 | } | 1203 | } |
| 1185 | .xc_comment-discuss{ | 1204 | .xc_comment-discuss{ |
| 1186 | width: 152rpx; | 1205 | width: 152rpx; |
| @@ -1190,7 +1209,7 @@ left:31rpx;} | @@ -1190,7 +1209,7 @@ left:31rpx;} | ||
| 1190 | background: #ffe3e2; | 1209 | background: #ffe3e2; |
| 1191 | color: 28rpx; | 1210 | color: 28rpx; |
| 1192 | border-radius:20rpx; | 1211 | border-radius:20rpx; |
| 1193 | - font-size: 28rpx; | 1212 | + font-size: 24rpx; |
| 1194 | margin-left: 28rpx | 1213 | margin-left: 28rpx |
| 1195 | } | 1214 | } |
| 1196 | 1215 | ||
| @@ -1274,7 +1293,14 @@ left:31rpx;} | @@ -1274,7 +1293,14 @@ left:31rpx;} | ||
| 1274 | } | 1293 | } |
| 1275 | 1294 | ||
| 1276 | .pj_word_size{ font-size: 28rpx} | 1295 | .pj_word_size{ font-size: 28rpx} |
| 1277 | -.pj_scroll{white-space: nowrap;margin-bottom: 50rpx;} | 1296 | +.pj_scroll{ |
| 1297 | + white-space: nowrap; | ||
| 1298 | + /* height: 324rpx; */ | ||
| 1299 | + margin-bottom: 50rpx; | ||
| 1300 | + display: flex; | ||
| 1301 | + align-items: center; | ||
| 1302 | + /* box-shadow: 0 8px 12px #e7e9eb; */ | ||
| 1303 | +} | ||
| 1278 | 1304 | ||
| 1279 | 1305 | ||
| 1280 | /*领券*/ | 1306 | /*领券*/ |
| @@ -1285,7 +1311,7 @@ left:31rpx;} | @@ -1285,7 +1311,7 @@ left:31rpx;} | ||
| 1285 | font-size: 23rpx; | 1311 | font-size: 23rpx; |
| 1286 | } | 1312 | } |
| 1287 | .cx-frame{ | 1313 | .cx-frame{ |
| 1288 | - border-top:3rpx solid #eee; | 1314 | + /* border-top:3rpx solid #eee; */ |
| 1289 | width:99%; | 1315 | width:99%; |
| 1290 | height: 95rpx; | 1316 | height: 95rpx; |
| 1291 | line-height: 95rpx; | 1317 | line-height: 95rpx; |
| @@ -1317,19 +1343,17 @@ left:31rpx;} | @@ -1317,19 +1343,17 @@ left:31rpx;} | ||
| 1317 | 1343 | ||
| 1318 | } | 1344 | } |
| 1319 | .xc-coupon-fram .xc-circular{ | 1345 | .xc-coupon-fram .xc-circular{ |
| 1320 | - width: 24rpx; | ||
| 1321 | - height:20rpx; | 1346 | + width: 22rpx; |
| 1347 | + height:22rpx; | ||
| 1322 | background-color:#fff; | 1348 | background-color:#fff; |
| 1323 | position:absolute; | 1349 | position:absolute; |
| 1324 | - top:40rpx; | ||
| 1325 | - | ||
| 1326 | - | 1350 | + top: 40rpx; |
| 1327 | } | 1351 | } |
| 1328 | .xc-coupon-fram .xc-one{ | 1352 | .xc-coupon-fram .xc-one{ |
| 1329 | left:3rpx; | 1353 | left:3rpx; |
| 1330 | } | 1354 | } |
| 1331 | .xc-coupon-fram .xc-two{ | 1355 | .xc-coupon-fram .xc-two{ |
| 1332 | - left: 175rpx; | 1356 | + left: 178rpx; |
| 1333 | } | 1357 | } |
| 1334 | 1358 | ||
| 1335 | .cx-obtain-coupon{ | 1359 | .cx-obtain-coupon{ |
| @@ -2257,7 +2281,7 @@ right:17rpx; top:55rpx; | @@ -2257,7 +2281,7 @@ right:17rpx; top:55rpx; | ||
| 2257 | .no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx} | 2281 | .no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx} |
| 2258 | /* 门店地址 */ | 2282 | /* 门店地址 */ |
| 2259 | .xc-address_frame{ | 2283 | .xc-address_frame{ |
| 2260 | - border-top:1rpx solid #eee; | 2284 | + /* border-top:1rpx solid #eee; */ |
| 2261 | width: 100%; | 2285 | width: 100%; |
| 2262 | height: auto; | 2286 | height: auto; |
| 2263 | } | 2287 | } |
| @@ -2322,6 +2346,7 @@ background: white; | @@ -2322,6 +2346,7 @@ background: white; | ||
| 2322 | width: 100%; | 2346 | width: 100%; |
| 2323 | border-radius: 20rpx 20rpx 0 0; | 2347 | border-radius: 20rpx 20rpx 0 0; |
| 2324 | height: 72%; | 2348 | height: 72%; |
| 2349 | +bottom: 0; | ||
| 2325 | } | 2350 | } |
| 2326 | .popup-top{ | 2351 | .popup-top{ |
| 2327 | border-bottom: 1rpx solid #eee; | 2352 | border-bottom: 1rpx solid #eee; |
| @@ -2605,4 +2630,56 @@ button.custom-service::after{ | @@ -2605,4 +2630,56 @@ button.custom-service::after{ | ||
| 2605 | .dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx} | 2630 | .dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx} |
| 2606 | .act_content{ margin-top: 40rpx} | 2631 | .act_content{ margin-top: 40rpx} |
| 2607 | .act_content view{ margin-bottom: 12rpx} | 2632 | .act_content view{ margin-bottom: 12rpx} |
| 2608 | -.color_b{color: #ff9c00} | ||
| 2609 | \ No newline at end of file | 2633 | \ No newline at end of file |
| 2634 | +.color_b{color: #ff9c00} | ||
| 2635 | + | ||
| 2636 | +.poster-container { | ||
| 2637 | + box-sizing: border-box; | ||
| 2638 | + position: fixed; | ||
| 2639 | + top: 0; | ||
| 2640 | + width: 100%; | ||
| 2641 | + height: 100%; | ||
| 2642 | + z-index: 999; | ||
| 2643 | + background-color: rgba(0,0,0,.4); | ||
| 2644 | + padding: 60rpx; | ||
| 2645 | +} | ||
| 2646 | + | ||
| 2647 | +.poster { | ||
| 2648 | + box-sizing: border-box; | ||
| 2649 | + width: 100%; | ||
| 2650 | + height: 90%; | ||
| 2651 | + border-radius: 20rpx; | ||
| 2652 | + /* box-shadow: 0 8px 12px #666; */ | ||
| 2653 | + position: relative; | ||
| 2654 | + z-index: 999; | ||
| 2655 | + overflow: hidden; | ||
| 2656 | +} | ||
| 2657 | +.poster-img { | ||
| 2658 | + display: block; | ||
| 2659 | + width: 100%; | ||
| 2660 | + height: 100%; | ||
| 2661 | +} | ||
| 2662 | +.btn-container { | ||
| 2663 | + display: flex; | ||
| 2664 | + justify-content: space-around; | ||
| 2665 | +} | ||
| 2666 | +.btn-share { | ||
| 2667 | + display: block; | ||
| 2668 | + background-color: #FE6867; | ||
| 2669 | + color: white; | ||
| 2670 | + border-radius: 8rpx; | ||
| 2671 | + line-height: 80rpx; | ||
| 2672 | + margin-top: 28rpx; | ||
| 2673 | + padding: 0 60rpx; | ||
| 2674 | +} | ||
| 2675 | +.btn-close { | ||
| 2676 | + background-color: rgba(0,0,0,.5); | ||
| 2677 | + color: white; | ||
| 2678 | + width: 40rpx; | ||
| 2679 | + height: 40rpx; | ||
| 2680 | + line-height: 40rpx; | ||
| 2681 | + text-align: center; | ||
| 2682 | + border-radius: 50%; | ||
| 2683 | + position: absolute; | ||
| 2684 | + right: 20rpx; | ||
| 2685 | + top: 10rpx; | ||
| 2686 | +} | ||
| 2610 | \ No newline at end of file | 2687 | \ No newline at end of file |
pages/index/index/index.js
| @@ -72,14 +72,25 @@ Page({ | @@ -72,14 +72,25 @@ Page({ | ||
| 72 | max_sw_height: 0, //banner的最大高度 | 72 | max_sw_height: 0, //banner的最大高度 |
| 73 | is_disgraceful: 0, //是否显示新人广告 | 73 | is_disgraceful: 0, //是否显示新人广告 |
| 74 | new_image: "", //新人有礼弹窗图片 | 74 | new_image: "", //新人有礼弹窗图片 |
| 75 | - new_nav: "", //新人页面跳转地址 | ||
| 76 | - | ||
| 77 | - w_holiday_pop:0, | ||
| 78 | - | ||
| 79 | - }, | ||
| 80 | - | ||
| 81 | - onLoad: async function() { | ||
| 82 | - var th = this; | 75 | + new_nav: "", //新人页面跳转地址 |
| 76 | + w_holiday_pop:0, | ||
| 77 | + | ||
| 78 | + }, | ||
| 79 | + | ||
| 80 | + onLoad: async function(tt) { | ||
| 81 | + var th = this; | ||
| 82 | + var first_leader=tt.first_leader; | ||
| 83 | + if(first_leader){ | ||
| 84 | + //-- user_id代过来免登陆 -- | ||
| 85 | + getApp().globalData.first_leader=first_leader; | ||
| 86 | + //调用接口判断是不是会员 | ||
| 87 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{ | ||
| 88 | + if(res.data.code==0){ | ||
| 89 | + getApp().globalData.guide_id=res.data.data.id; | ||
| 90 | + } | ||
| 91 | + }) | ||
| 92 | + } | ||
| 93 | + | ||
| 83 | //看一下商家是否开通了权益 | 94 | //看一下商家是否开通了权益 |
| 84 | //--初始化是否有打勾-- | 95 | //--初始化是否有打勾-- |
| 85 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { | 96 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { |
| @@ -859,7 +870,14 @@ Page({ | @@ -859,7 +870,14 @@ Page({ | ||
| 859 | if(!url || url=='') return; | 870 | if(!url || url=='') return; |
| 860 | if(url[0]!='/') url='/'+url; | 871 | if(url[0]!='/') url='/'+url; |
| 861 | getApp().goto(url); | 872 | getApp().goto(url); |
| 862 | - } | 873 | + }, |
| 874 | + | ||
| 875 | + //----跳转到搭配购买---- | ||
| 876 | + go_test:function () { | ||
| 877 | + wx.navigateTo({ url: "/packageA/pages/goods_share/goods_share", }) | ||
| 878 | + }, | ||
| 879 | + | ||
| 880 | + | ||
| 863 | 881 | ||
| 864 | 882 | ||
| 865 | 883 |
pages/index/index/index.wxml
| @@ -3,6 +3,8 @@ | @@ -3,6 +3,8 @@ | ||
| 3 | <!--普通界面--> | 3 | <!--普通界面--> |
| 4 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> | 4 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> |
| 5 | <view class="container rel" wx:if="{{ishow}}"> | 5 | <view class="container rel" wx:if="{{ishow}}"> |
| 6 | + | ||
| 7 | + | ||
| 6 | <block wx:if="{{banner}}"> | 8 | <block wx:if="{{banner}}"> |
| 7 | <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> | 9 | <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> |
| 8 | </block> | 10 | </block> |
| @@ -84,7 +86,7 @@ | @@ -84,7 +86,7 @@ | ||
| 84 | <view class="flex-vertical"> | 86 | <view class="flex-vertical"> |
| 85 | <image class="xc-hook" src="{{url}}/miniapp/images/index/youxuan.png"> | 87 | <image class="xc-hook" src="{{url}}/miniapp/images/index/youxuan.png"> |
| 86 | </image> | 88 | </image> |
| 87 | - <text class="yellow-co fs26 margin-left">人工优先</text> | 89 | + <text bindtap='go_test' class="yellow-co fs26 margin-left" data-url="../../../packageA/pages/prom_list/prom_list">人工优先</text> |
| 88 | </view> | 90 | </view> |
| 89 | 91 | ||
| 90 | 92 |
pages/user/assistance/assistance.wxml
| @@ -7,7 +7,9 @@ | @@ -7,7 +7,9 @@ | ||
| 7 | <view class="zindex" style="color:#{{font_color ? font_color:'black'}};background-color:#{{bg_color ? bg_color:'d01119'}};"> | 7 | <view class="zindex" style="color:#{{font_color ? font_color:'black'}};background-color:#{{bg_color ? bg_color:'d01119'}};"> |
| 8 | <view class="top"> | 8 | <view class="top"> |
| 9 | <!-- 上传主图的情况 --> | 9 | <!-- 上传主图的情况 --> |
| 10 | - <view class="bg-img" wx:if="{{imageUrl}}"></view> | 10 | + <view wx:if="{{imageUrl}}" style="height: 100%;"> |
| 11 | + <image src="https://mshopimg.yolipai.net{{imageUrl}}" lazy-load="true" class="bg-img"></image> | ||
| 12 | + </view> | ||
| 11 | <!-- 没有上传主图的情况 --> | 13 | <!-- 没有上传主图的情况 --> |
| 12 | <block wx:else> | 14 | <block wx:else> |
| 13 | <view class="flex-center"> | 15 | <view class="flex-center"> |
| @@ -17,7 +19,7 @@ | @@ -17,7 +19,7 @@ | ||
| 17 | <view class="excitation" style="color:{{font_color ? ('#'+font_color):'white'}};">机会总是留给最有行动力的人</view> | 19 | <view class="excitation" style="color:{{font_color ? ('#'+font_color):'white'}};">机会总是留给最有行动力的人</view> |
| 18 | </view> | 20 | </view> |
| 19 | <view class="flex-center"> | 21 | <view class="flex-center"> |
| 20 | - <image class="gift" src="{{zl_act.imageUrl==''?iurl+'miniapp/images/friendhelp/gift.png':iurl+zl_act.imageUrl}}" lazy-load="true"></image> | 22 | + <image class="gift" src="{{(zl_act.imageUrl=='' || zl_act.imageUrl==undefined)?(iurl+'miniapp/images/friendhelp/gift.png'):(iurl+zl_act.imageUrl)}}" lazy-load="true"></image> |
| 21 | </view> | 23 | </view> |
| 22 | <view wx:if="{{zl_act.beginDate && zl_act.endDate}}" class="flex-center fs26 time"> | 24 | <view wx:if="{{zl_act.beginDate && zl_act.endDate}}" class="flex-center fs26 time"> |
| 23 | <view style="color:{{font_color ? ('#'+font_color):'white'}};">活动时间:{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}}</view> | 25 | <view style="color:{{font_color ? ('#'+font_color):'white'}};">活动时间:{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}}</view> |
| @@ -97,6 +99,7 @@ | @@ -97,6 +99,7 @@ | ||
| 97 | 99 | ||
| 98 | </view> | 100 | </view> |
| 99 | </view> | 101 | </view> |
| 102 | + | ||
| 100 | 103 | ||
| 101 | </view> | 104 | </view> |
| 102 | <!-- 活动说明 --> | 105 | <!-- 活动说明 --> |
| @@ -113,6 +116,7 @@ | @@ -113,6 +116,7 @@ | ||
| 113 | </view> | 116 | </view> |
| 114 | </view> | 117 | </view> |
| 115 | 118 | ||
| 119 | + | ||
| 116 | </view> | 120 | </view> |
| 117 | 121 | ||
| 118 | </view> | 122 | </view> |
pages/user/assistance/assistance.wxss
| 1 | -page { | 1 | +.page { |
| 2 | /* background-color: rgb(208, 17, 25); */ | 2 | /* background-color: rgb(208, 17, 25); */ |
| 3 | /* width: 100%; | 3 | /* width: 100%; |
| 4 | height: 100%; */ | 4 | height: 100%; */ |
| 5 | - | 5 | + /* height: 100%; */ |
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | .page { | 8 | .page { |
| @@ -11,8 +11,9 @@ page { | @@ -11,8 +11,9 @@ page { | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | .bg-img { | 13 | .bg-img { |
| 14 | - background: url("https://mshopimg.yolipai.net/public/upload/newpeoplegift/temp/2020/09-26/75640123e5ae953e416527134a6fc477.jpg") no-repeat center center; | ||
| 15 | - background-size: 100% 100%; | 14 | + display: block; |
| 15 | + width: 100%; | ||
| 16 | + height: 100%; | ||
| 16 | } | 17 | } |
| 17 | 18 | ||
| 18 | .lumi { | 19 | .lumi { |
pages/user/assistance/task_assistance.js
| @@ -21,6 +21,8 @@ Page({ | @@ -21,6 +21,8 @@ Page({ | ||
| 21 | endDate: "", //活动结束时间 | 21 | endDate: "", //活动结束时间 |
| 22 | activity_data: "25:20:59", //活动剩余时间 | 22 | activity_data: "25:20:59", //活动剩余时间 |
| 23 | task_number: 0, //任务数 | 23 | task_number: 0, //任务数 |
| 24 | + giftQty:0, //库存设置数 | ||
| 25 | + | ||
| 24 | is_task: 0, //历史记录与任务 | 26 | is_task: 0, //历史记录与任务 |
| 25 | aitem: "", //活动的轮播图数据 | 27 | aitem: "", //活动的轮播图数据 |
| 26 | switch_head: 0, //0:我的任务,1:记录 | 28 | switch_head: 0, //0:我的任务,1:记录 |
| @@ -221,6 +223,7 @@ Page({ | @@ -221,6 +223,7 @@ Page({ | ||
| 221 | th.setData({ | 223 | th.setData({ |
| 222 | aitem: data_aissa, | 224 | aitem: data_aissa, |
| 223 | task_number: task_number, | 225 | task_number: task_number, |
| 226 | + giftQty:data_aissa[0].giftQty, | ||
| 224 | }); | 227 | }); |
| 225 | th.go_to_task(th.data.taskid); | 228 | th.go_to_task(th.data.taskid); |
| 226 | 229 | ||
| @@ -228,7 +231,8 @@ Page({ | @@ -228,7 +231,8 @@ Page({ | ||
| 228 | th.setData({ | 231 | th.setData({ |
| 229 | aitem: data_aissa, | 232 | aitem: data_aissa, |
| 230 | task_number: task_number, | 233 | task_number: task_number, |
| 231 | - taskid: taskid | 234 | + taskid: taskid, |
| 235 | + giftQty:data_aissa[0].giftQty, | ||
| 232 | }); | 236 | }); |
| 233 | //判断是不是领取的任务 | 237 | //判断是不是领取的任务 |
| 234 | th.get_user_task(); | 238 | th.get_user_task(); |
| @@ -365,7 +369,8 @@ Page({ | @@ -365,7 +369,8 @@ Page({ | ||
| 365 | task_number: task_number, | 369 | task_number: task_number, |
| 366 | taskid: task_id, | 370 | taskid: task_id, |
| 367 | is_dismantle: 0, | 371 | is_dismantle: 0, |
| 368 | - bc_page: 1 | 372 | + bc_page: 1, |
| 373 | + giftQty:aitem[ind].giftQty, | ||
| 369 | }); | 374 | }); |
| 370 | 375 | ||
| 371 | if (this.data.switch_head == 1 && th.data.is_clik == 0) { | 376 | if (this.data.switch_head == 1 && th.data.is_clik == 0) { |
| @@ -554,7 +559,8 @@ Page({ | @@ -554,7 +559,8 @@ Page({ | ||
| 554 | taskid: task_id, | 559 | taskid: task_id, |
| 555 | is_dismantle: 0, | 560 | is_dismantle: 0, |
| 556 | is_clik: 1, | 561 | is_clik: 1, |
| 557 | - bc_page: 1 | 562 | + bc_page: 1, |
| 563 | + giftQty:aitem[index].giftQty | ||
| 558 | }) | 564 | }) |
| 559 | if (this.data.switch_head == 1) { | 565 | if (this.data.switch_head == 1) { |
| 560 | //判断有没有帮拆记录 | 566 | //判断有没有帮拆记录 |
| @@ -586,6 +592,7 @@ Page({ | @@ -586,6 +592,7 @@ Page({ | ||
| 586 | taskid: task_id, | 592 | taskid: task_id, |
| 587 | is_dismantle: 0, | 593 | is_dismantle: 0, |
| 588 | bc_page: 1, | 594 | bc_page: 1, |
| 595 | + giftQty:aitem[index].giftQty | ||
| 589 | }) | 596 | }) |
| 590 | if (this.data.switch_head == 1) { | 597 | if (this.data.switch_head == 1) { |
| 591 | this.dismantle_record(); | 598 | this.dismantle_record(); |
pages/user/assistance/task_assistance.wxml
| 1 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> | 1 | <wxs module="filter" src="../../../utils/filter.wxs"></wxs> |
| 2 | -<view class="top-back" style="background-color:#{{bg_color ? bg_color:'d01119'}};padding-bottom:80rpx;background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)" bindtap="close"> | ||
| 3 | -<!-- <view class="top-back" style="padding-bottom:{{is_user_task!=null&&is_user_task.status==0?50:0}}rpx;background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)" bindtap="close"> --> | ||
| 4 | - <!-- 助力活动头部 --> | ||
| 5 | - <view class="top-frame"> | ||
| 6 | - <view class="flex-center"> | ||
| 7 | - <view class="top-title white fs36 t-c ellipsis-1" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 8 | - {{aitem[sw_index].helpTaskName}} | ||
| 9 | - </view> | ||
| 10 | - </view> | ||
| 11 | - <view class="activity-data t-c fs28" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 12 | - 活动剩余时间: | ||
| 13 | - <block wx:if="{{aitem[0].djs.day}}"><text class='tui-conutdown-box'> {{aitem[0].djs.day}}天 </text></block> | ||
| 14 | - <text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>: | ||
| 15 | - <text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>: | ||
| 16 | - <text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text> | ||
| 17 | - </view> | ||
| 18 | - </view> | ||
| 19 | - <!-- 图片的轮播图 --> | ||
| 20 | - <view class="xc-specific-more-frame flex-center" style="height:{{max_sw_height}}px;"> | ||
| 21 | - <view bindtap="click_pre"> | ||
| 22 | - <view class="bg_left xc-left bcolor"></view> | ||
| 23 | - </view> | ||
| 24 | - <!-- <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> --> | ||
| 25 | - <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}" style='width:80%;height:100%;'> | ||
| 26 | - <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> | ||
| 27 | - | ||
| 28 | - <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}" mode="widthFix" bindload='imageLoad' style="width: 100%;display: block;"></image> | ||
| 29 | - <view bindtap="libao_details" data-taskid="{{aitem.id}}" class="abs select_details fs26 white">礼包详情</view> | ||
| 30 | - | ||
| 31 | - </swiper-item> | ||
| 32 | - | ||
| 33 | - </swiper> | ||
| 34 | - | ||
| 35 | - <view bindtap="click_next"> | ||
| 36 | - <view class="bg_right xc-right bcolor mt"></view> | ||
| 37 | - </view> | ||
| 38 | - </view> | ||
| 39 | - <view class="plan-frame flex ai-center" wx:if="{{is_user_task}}"> | ||
| 40 | - <view class="plan_num rel"> | ||
| 41 | - <view class="is_plam abs" style="width:{{(is_user_task.zlHelpNum/is_user_task.helpNum)*100}}%"></view> | ||
| 42 | - </view> | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - <text class="white fs24">{{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}}</text> | ||
| 46 | - | ||
| 47 | - </view> | ||
| 48 | - <view class="task-number fs28 t-c" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 49 | - 今天剩余可领{{task_number}}个任务 | ||
| 50 | - </view> | ||
| 51 | - | ||
| 52 | - <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center" data-taskid="{{taskid}}" bindtap="add_onlicke" | ||
| 53 | - style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> | ||
| 54 | - 就选它了 | ||
| 55 | - </view> | ||
| 56 | - <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}" class="task_clike fs40 t-c flex-center" bindtap="save_share" | ||
| 57 | - style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> | ||
| 58 | - 好友拆一拆 | ||
| 59 | - </view> | ||
| 60 | - <view wx:if="{{is_user_task!=null&&is_user_task.status==1}}" class="task_clike fs40 t-c flex-center" data-libaoid="{{is_user_task.helpListGiftBagId}}"data-taskingid="{{is_user_task.id}}" bindtap="redeem_now" | ||
| 61 | - style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> | ||
| 62 | - 立即兑换 | ||
| 63 | - </view> | ||
| 64 | - | ||
| 65 | - <!-- | ||
| 66 | - <view class="task_clike fs40 t-c flex-center" bindtap="test"> | ||
| 67 | - 测试专用帮被人拆 | ||
| 68 | - </view>--> | ||
| 69 | - | 2 | +<view class="container" style="background-color:#{{bg_color ? bg_color:'d01119'}}"> |
| 3 | + <view class="top-back" style="background-color:#{{bg_color ? bg_color:'d01119'}};padding-bottom:80rpx;background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)" bindtap="close"> | ||
| 4 | + <!-- <view class="top-back" style="padding-bottom:{{is_user_task!=null&&is_user_task.status==0?50:0}}rpx;background-image: url({{iurl}}/miniapp/images/friendhelp/lumi.png)" bindtap="close"> --> | ||
| 5 | + <!-- 助力活动头部 --> | ||
| 6 | + <view class="top-frame"> | ||
| 7 | + <view class="flex-center"> | ||
| 8 | + <view class="top-title white fs36 t-c ellipsis-1" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 9 | + {{aitem[sw_index].helpTaskName}} | ||
| 10 | + </view> | ||
| 11 | + </view> | ||
| 12 | + <view class="activity-data t-c fs28" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 13 | + 活动剩余时间: | ||
| 14 | + <block wx:if="{{aitem[0].djs.day}}"><text class='tui-conutdown-box'> {{aitem[0].djs.day}}天 </text></block> | ||
| 15 | + <text class='tui-conutdown-box'>{{aitem[0].djs.hou}}</text>: | ||
| 16 | + <text class='tui-conutdown-box'>{{aitem[0].djs.min}}</text>: | ||
| 17 | + <text class='tui-conutdown-box tui-countdown-bg'>{{aitem[0].djs.sec}}</text> | ||
| 18 | + </view> | ||
| 19 | + </view> | ||
| 20 | + <!-- 图片的轮播图 --> | ||
| 21 | + <view class="xc-specific-more-frame flex-center" style="height:{{max_sw_height}}px;"> | ||
| 22 | + <view bindtap="click_pre"> | ||
| 23 | + <view class="bg_left xc-left bcolor"></view> | ||
| 24 | + </view> | ||
| 25 | + <!-- <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> --> | ||
| 26 | + <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}" style='width:80%;height:100%;position:relative;'> | ||
| 27 | + <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> | ||
| 28 | + <view style="position:absolute;width:100%;"> | ||
| 29 | + <image show-menu-by-longpress class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}" mode="widthFix" bindload='imageLoad' style="width: 100%;display: block;"></image> | ||
| 30 | + <view bindtap="libao_details" data-taskid="{{aitem.id}}" class="abs select_details fs26 white">礼包详情</view> | ||
| 31 | + </view> | ||
| 32 | + </swiper-item> | ||
| 33 | + | ||
| 34 | + </swiper> | ||
| 35 | + | ||
| 36 | + <view bindtap="click_next"> | ||
| 37 | + <view class="bg_right xc-right bcolor mt"></view> | ||
| 38 | + </view> | ||
| 39 | + </view> | ||
| 40 | + <view class="plan-frame flex ai-center" wx:if="{{is_user_task}}"> | ||
| 41 | + <view class="plan_num rel"> | ||
| 42 | + <view class="is_plam abs" style="width:{{(is_user_task.zlHelpNum/is_user_task.helpNum)*100}}%"></view> | ||
| 43 | + </view> | ||
| 44 | + | ||
| 45 | + | ||
| 46 | + <text class="white fs24">{{is_user_task.zlHelpNum}}/{{is_user_task.helpNum}}</text> | ||
| 47 | + | ||
| 48 | + </view> | ||
| 49 | + <view class="task-number fs28 t-c" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 50 | + <text wx:if="{{giftQty}}">今天剩余可领{{task_number}}个任务</text> | ||
| 51 | + <text wx:else>不限任务数量</text> | ||
| 52 | + </view> | ||
| 53 | + | ||
| 54 | + <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center" data-taskid="{{taskid}}" bindtap="add_onlicke" | ||
| 55 | + style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> | ||
| 56 | + 就选它了 | ||
| 57 | + </view> | ||
| 58 | + <view wx:if="{{is_user_task!=null&&is_user_task.status==0}}" class="task_clike fs40 t-c flex-center" bindtap="save_share" | ||
| 59 | + style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> | ||
| 60 | + 好友拆一拆 | ||
| 61 | + </view> | ||
| 62 | + <view wx:if="{{is_user_task!=null&&is_user_task.status==1}}" class="task_clike fs40 t-c flex-center" data-libaoid="{{is_user_task.helpListGiftBagId}}"data-taskingid="{{is_user_task.id}}" bindtap="redeem_now" | ||
| 63 | + style="background-color:#{{btn_color ? btn_color:'fbda0e'}};color:{{font_color?('#'+font_color):'white'}};"> | ||
| 64 | + 立即兑换 | ||
| 65 | + </view> | ||
| 66 | + | ||
| 67 | + <!-- | ||
| 68 | + <view class="task_clike fs40 t-c flex-center" bindtap="test"> | ||
| 69 | + 测试专用帮被人拆 | ||
| 70 | + </view>--> | ||
| 71 | + | ||
| 72 | + </view> | ||
| 73 | + <!-- 底部列表 --> | ||
| 74 | + <view style="background-color:#{{bg_color ? bg_color:'d01119'}}"> | ||
| 75 | + <!-- <view style="margin-top:{{is_user_task!=null?52:0}}rpx"> --> | ||
| 76 | + <!-- 标题 --> | ||
| 77 | + | ||
| 78 | + <view class="flex-vertical-between fs28 padding head" style="color:#{{font_color ? font_color:'white'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"> | ||
| 79 | + <view class="flex-center lhead" bindtap="user_task_list_click" data-index="0" | ||
| 80 | + style="background-color:{{switch_head==0?(btn_color ? ('#'+btn_color):'#FDC107'):'transparent'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"> | ||
| 81 | + <image class="unfinished" src="{{iurl}}miniapp/images/friendhelp/task.png" lazy-load="true"></image> | ||
| 82 | + <view>我的任务</view> | ||
| 83 | + </view> | ||
| 84 | + <view class="flex-center lhead" bindtap="dismantle_record_click" data-index='1' | ||
| 85 | + style="background-color:{{switch_head==1?(btn_color ? ('#'+btn_color):'#FDC107'):'transparent'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"> | ||
| 86 | + <image class="unfinished" style="margin-top: 5rpx;" src="{{iurl}}miniapp/images/friendhelp/edit.png" lazy-load="true"></image> | ||
| 87 | + <view>帮拆记录</view> | ||
| 88 | + </view> | ||
| 89 | + </view> | ||
| 90 | + | ||
| 91 | + <view style="color:{{font_color ? ('#'+font_color):'white'}}"> | ||
| 92 | + | ||
| 93 | + <view class="items" wx:if="{{is_task==0}}"> | ||
| 94 | + <view class="tesk_list"> | ||
| 95 | + <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}" wx:key="*this"> | ||
| 96 | + <view class="flex-center width"> | ||
| 97 | + <view class="ellipsis-1">{{item.helpTaskName}} | ||
| 98 | + </view> | ||
| 99 | + </view> | ||
| 100 | + <view class="flex-center width state"> | ||
| 101 | + <view class="ellipsis-1"> | ||
| 102 | + <text wx:if="{{item.status==0}}" bindtap="go_task" data-taskid="{{item.helpTaskId}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> | ||
| 103 | + <text wx:if="{{item.status==2}}" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</text> | ||
| 104 | + <text wx:if="{{item.status==1}}" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}"data-taskingid="{{item.id}}" data-taskid="{{item.helpTaskId}}">领取礼包 </text> | ||
| 105 | + </view> | ||
| 106 | + </view> | ||
| 107 | + </view> | ||
| 108 | + </view> | ||
| 109 | + | ||
| 110 | + <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}"> | ||
| 111 | + <view class="flex-center nothing"> | ||
| 112 | + <view>暂无任务记录</view> | ||
| 113 | + </view> | ||
| 114 | + </view> | ||
| 115 | + </view> | ||
| 116 | + | ||
| 117 | + | ||
| 118 | + </view> | ||
| 119 | + | ||
| 120 | + | ||
| 121 | + <view class="items" wx:if="{{is_task==1}}" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 122 | + <block wx:if="{{ dismantle!=null|| dismantle!=''}}"> | ||
| 123 | + | ||
| 124 | + <view class="tesk_list"> | ||
| 125 | + <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}" wx:for-index="idx"> | ||
| 126 | + <view class="flex white is_dismantle_frame" style="justify-content: space-around; width: 90%;margin:auto"> | ||
| 127 | + <image class="circle user_img" src="{{item.headPic==null?defaultAvatar:item.headPic}}"></image> | ||
| 128 | + <view class="ellipsis-1 width">{{item.nickName}} | ||
| 129 | + </view> | ||
| 130 | + <view class="ellipsis-1">{{filter.format_time(item.zltime)}} | ||
| 131 | + </view> | ||
| 132 | + </view> | ||
| 133 | + </view> | ||
| 134 | + </view> | ||
| 135 | + <view class="flex-center fs32" wx:if="{{is_bc_show==1&&dismantle!=null&&is_dis_list==1}}"> | ||
| 136 | + <view class="line"></view> | ||
| 137 | + <view class="load white" bindtap="dismantle_record_list">点击加载更多</view> | ||
| 138 | + <view class="line"></view> | ||
| 139 | + </view> | ||
| 140 | + </block> | ||
| 141 | + | ||
| 142 | + <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}"> | ||
| 143 | + <view class="flex-center nothing"> | ||
| 144 | + <view>暂无任务记录</view> | ||
| 145 | + </view> | ||
| 146 | + </view> | ||
| 147 | + | ||
| 148 | + </view> | ||
| 149 | + | ||
| 150 | + | ||
| 151 | + </view> | ||
| 152 | + <!-- 加载更多 --> | ||
| 153 | + <view class="fs32" style="background-color:#{{bg_color ? bg_color:'d01119'}};color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 154 | + <view class="flex-center" wx:if="{{is_show==1&&is_user_list==0}}"> | ||
| 155 | + <view class="line"></view> | ||
| 156 | + <view class="load" bindtap="task_list">点击加载更多</view> | ||
| 157 | + <view class="line"></view> | ||
| 158 | + </view> | ||
| 159 | + <view class="flex-center bottom" wx:if="{{usercount>0}}"> | ||
| 160 | + <view>该任务已被领取了{{usercount}}次</view> | ||
| 161 | + </view> | ||
| 162 | + <view class="flex-center bottom" wx:else> | ||
| 163 | + <view>暂无领取记录</view> | ||
| 164 | + </view> | ||
| 165 | + </view> | ||
| 166 | + | ||
| 167 | + | ||
| 168 | + <!--********** 钱巧玲 --> | ||
| 169 | + <view wx:if="{{is_share}}"> | ||
| 170 | + <view class="dust"></view> | ||
| 171 | + <view class="canvas" style="width:100%;"> | ||
| 172 | + <view class="flex-center"> | ||
| 173 | + <canvas canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas> | ||
| 174 | + </view> | ||
| 175 | + <view class="closes flex-center"> | ||
| 176 | + <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image> | ||
| 177 | + </view> | ||
| 178 | + </view> | ||
| 179 | + </view> | ||
| 180 | + <!-- 引入提示组件 --> | ||
| 181 | + <warn id="warn"></warn> | ||
| 182 | + <!-- 制作一个圆球导航 --> | ||
| 183 | + <nav_b id="nav_b"></nav_b> | ||
| 70 | </view> | 184 | </view> |
| 71 | -<!-- 底部列表 --> | ||
| 72 | -<view style="background-color:#{{bg_color ? bg_color:'d01119'}}"> | ||
| 73 | -<!-- <view style="margin-top:{{is_user_task!=null?52:0}}rpx"> --> | ||
| 74 | - <!-- 标题 --> | ||
| 75 | - | ||
| 76 | - <view class="flex-vertical-between fs28 padding head" style="color:#{{font_color ? font_color:'white'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"> | ||
| 77 | - <view class="flex-center lhead" bindtap="user_task_list_click" data-index="0" | ||
| 78 | - style="background-color:{{switch_head==0?(btn_color ? ('#'+btn_color):'#FDC107'):'transparent'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"> | ||
| 79 | - <image class="unfinished" src="{{iurl}}miniapp/images/friendhelp/task.png" lazy-load="true"></image> | ||
| 80 | - <view>我的任务</view> | ||
| 81 | - </view> | ||
| 82 | - <view class="flex-center lhead" bindtap="dismantle_record_click" data-index='1' | ||
| 83 | - style="background-color:{{switch_head==1?(btn_color ? ('#'+btn_color):'#FDC107'):'transparent'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"> | ||
| 84 | - <image class="unfinished" style="margin-top: 5rpx;" src="{{iurl}}miniapp/images/friendhelp/edit.png" lazy-load="true"></image> | ||
| 85 | - <view>帮拆记录</view> | ||
| 86 | - </view> | ||
| 87 | - </view> | ||
| 88 | - | ||
| 89 | - <view style="color:{{font_color ? ('#'+font_color):'white'}}"> | ||
| 90 | - | ||
| 91 | - <view class="items" wx:if="{{is_task==0}}"> | ||
| 92 | - <view class="tesk_list"> | ||
| 93 | - <view class="item fs26 flex-vertical-between padding" wx:for="{{user_task_list}}" wx:key="*this"> | ||
| 94 | - <view class="flex-center width"> | ||
| 95 | - <view class="ellipsis-1">{{item.helpTaskName}} | ||
| 96 | - </view> | ||
| 97 | - </view> | ||
| 98 | - <view class="flex-center width state"> | ||
| 99 | - <view class="ellipsis-1"> | ||
| 100 | - <text wx:if="{{item.status==0}}" bindtap="go_task" data-taskid="{{item.helpTaskId}}">{{item.zlHelpNum}}/{{item.helpNum}}</text> | ||
| 101 | - <text wx:if="{{item.status==2}}" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</text> | ||
| 102 | - <text wx:if="{{item.status==1}}" bindtap="get_libao" data-libaoid="{{item.helpListGiftBagId}}"data-taskingid="{{item.id}}" data-taskid="{{item.helpTaskId}}">领取礼包 </text> | ||
| 103 | - </view> | ||
| 104 | - </view> | ||
| 105 | - </view> | ||
| 106 | - </view> | ||
| 107 | - | ||
| 108 | - <view class="fs30" wx:if="{{user_task_list==null || user_task_list==''}}"> | ||
| 109 | - <view class="flex-center nothing"> | ||
| 110 | - <view>暂无任务记录</view> | ||
| 111 | - </view> | ||
| 112 | - </view> | ||
| 113 | - </view> | ||
| 114 | 185 | ||
| 115 | - | ||
| 116 | - </view> | ||
| 117 | - | ||
| 118 | - | ||
| 119 | - <view class="items" wx:if="{{is_task==1}}" style="color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 120 | - <block wx:if="{{ dismantle!=null|| dismantle!=''}}"> | ||
| 121 | - | ||
| 122 | - <view class="tesk_list"> | ||
| 123 | - <view class="item fs26 flex flex-vertical-between padding" wx:for="{{dismantle}}" wx:for-index="idx"> | ||
| 124 | - <view class="flex white is_dismantle_frame" style="justify-content: space-around; width: 90%;margin:auto"> | ||
| 125 | - <image class="circle user_img" src="{{item.headPic==null?defaultAvatar:item.headPic}}"></image> | ||
| 126 | - <view class="ellipsis-1 width">{{item.nickName}} | ||
| 127 | - </view> | ||
| 128 | - <view class="ellipsis-1">{{filter.format_time(item.zltime)}} | ||
| 129 | - </view> | ||
| 130 | - </view> | ||
| 131 | - </view> | ||
| 132 | - </view> | ||
| 133 | - <view class="flex-center fs32" wx:if="{{is_bc_show==1&&dismantle!=null&&is_dis_list==1}}"> | ||
| 134 | - <view class="line"></view> | ||
| 135 | - <view class="load white" bindtap="dismantle_record_list">点击加载更多</view> | ||
| 136 | - <view class="line"></view> | ||
| 137 | - </view> | ||
| 138 | - </block> | ||
| 139 | - | ||
| 140 | - <view class="fs30" wx:if="{{dismantle==null|| dismantle==''}}"> | ||
| 141 | - <view class="flex-center nothing"> | ||
| 142 | - <view>暂无任务记录</view> | ||
| 143 | - </view> | ||
| 144 | - </view> | ||
| 145 | - | ||
| 146 | - </view> | ||
| 147 | - | ||
| 148 | - | ||
| 149 | -</view> | ||
| 150 | -<!-- 加载更多 --> | ||
| 151 | -<view class="fs32" style="background-color:#{{bg_color ? bg_color:'d01119'}};color:{{font_color ? ('#'+font_color):'white'}};"> | ||
| 152 | - <view class="flex-center" wx:if="{{is_show==1&&is_user_list==0}}"> | ||
| 153 | - <view class="line"></view> | ||
| 154 | - <view class="load" bindtap="task_list">点击加载更多</view> | ||
| 155 | - <view class="line"></view> | ||
| 156 | - </view> | ||
| 157 | - <view class="flex-center bottom" wx:if="{{usercount>0}}"> | ||
| 158 | - <view>该任务已被领取了{{usercount}}次</view> | ||
| 159 | - </view> | ||
| 160 | - <view class="flex-center bottom" wx:else> | ||
| 161 | - <view>暂无领取记录</view> | ||
| 162 | - </view> | ||
| 163 | -</view> | ||
| 164 | - | ||
| 165 | - | ||
| 166 | -<!--********** 钱巧玲 --> | ||
| 167 | -<view wx:if="{{is_share}}"> | ||
| 168 | - <view class="dust"></view> | ||
| 169 | - <view class="canvas" style="width:100%;"> | ||
| 170 | - <view class="flex-center"> | ||
| 171 | - <canvas canvas-id="share_id" style="width:600rpx;height:1000rpx;" bindtap="preview"></canvas> | ||
| 172 | - </view> | ||
| 173 | - <view class="closes flex-center"> | ||
| 174 | - <image class="close" src="{{iurl}}/miniapp/images/plus/Close.png" bindtap="close_share"></image> | ||
| 175 | - </view> | ||
| 176 | - </view> | ||
| 177 | -</view> | ||
| 178 | -<!-- 引入提示组件 --> | ||
| 179 | -<warn id="warn"></warn> | ||
| 180 | -<!-- 制作一个圆球导航 --> | ||
| 181 | -<nav_b id="nav_b"></nav_b> |
pages/user/assistance/task_assistance.wxss
| 1 | page { | 1 | page { |
| 2 | /* background: #d01119; */ | 2 | /* background: #d01119; */ |
| 3 | width: 100%; | 3 | width: 100%; |
| 4 | - height: 100%; | 4 | + height: 100%; |
| 5 | +} | ||
| 5 | 6 | ||
| 7 | +.container { | ||
| 8 | + height: 100vh; | ||
| 6 | } | 9 | } |
| 7 | 10 | ||
| 8 | .tesk_list{ | 11 | .tesk_list{ |
| @@ -38,7 +41,7 @@ page { | @@ -38,7 +41,7 @@ page { | ||
| 38 | .xc-specific-more-frame { | 41 | .xc-specific-more-frame { |
| 39 | width: 100%; | 42 | width: 100%; |
| 40 | height: 40%; | 43 | height: 40%; |
| 41 | - margin-top: 20rpx; | 44 | + padding-top: 20rpx; |
| 42 | } | 45 | } |
| 43 | 46 | ||
| 44 | .task-number { | 47 | .task-number { |
| @@ -156,14 +159,20 @@ page { | @@ -156,14 +159,20 @@ page { | ||
| 156 | } | 159 | } |
| 157 | 160 | ||
| 158 | .closes { | 161 | .closes { |
| 159 | - margin-top: 20rpx; | 162 | + /* margin-top: 20rpx; */ |
| 160 | } | 163 | } |
| 161 | 164 | ||
| 162 | .canvas { | 165 | .canvas { |
| 163 | position: fixed; | 166 | position: fixed; |
| 164 | z-index: 11; | 167 | z-index: 11; |
| 165 | width: 100%; | 168 | width: 100%; |
| 166 | - top: 20rpx; | 169 | + top: 0; |
| 170 | + bottom: 0; | ||
| 171 | + left: 0; | ||
| 172 | + right: 0; | ||
| 173 | + background-color: rgba(0,0,0,.5); | ||
| 174 | + box-sizing: border-box; | ||
| 175 | + padding-top: 60rpx; | ||
| 167 | } | 176 | } |
| 168 | 177 | ||
| 169 | .close { | 178 | .close { |
| @@ -203,15 +212,15 @@ page { | @@ -203,15 +212,15 @@ page { | ||
| 203 | } | 212 | } |
| 204 | 213 | ||
| 205 | .closes { | 214 | .closes { |
| 206 | - margin-top: 20rpx; | 215 | + /* margin-top: 20rpx; */ |
| 207 | } | 216 | } |
| 208 | 217 | ||
| 209 | -.canvas { | 218 | +/* .canvas { |
| 210 | position: fixed; | 219 | position: fixed; |
| 211 | z-index: 20; | 220 | z-index: 20; |
| 212 | width: 100%; | 221 | width: 100%; |
| 213 | top: 20rpx; | 222 | top: 20rpx; |
| 214 | -} | 223 | +} */ |
| 215 | 224 | ||
| 216 | .close { | 225 | .close { |
| 217 | width: 70rpx; | 226 | width: 70rpx; |
pages/user/index/filter.wxs
0 → 100644
| 1 | +var is_close = function (name,c_list) { | ||
| 2 | + if(!c_list) return 0; | ||
| 3 | + var map={}; | ||
| 4 | + map['我的分销']="1"; | ||
| 5 | + map['我的拼单']="2"; | ||
| 6 | + map['秒杀活动']="3"; | ||
| 7 | + map['PLUS会员']="4"; | ||
| 8 | + map['我的权益']="5"; | ||
| 9 | + map['联系客服']="6"; | ||
| 10 | + map['收藏夹']="7"; | ||
| 11 | + map['我的地址']="8"; | ||
| 12 | + map['收入卡包']="9"; | ||
| 13 | + map['专享礼包']="10"; | ||
| 14 | + map['我的服务']="12"; | ||
| 15 | + map['我的评价']="13"; | ||
| 16 | + map['我的礼包']="14"; | ||
| 17 | + map['助力活动']="15"; | ||
| 18 | + var index=map[name]; | ||
| 19 | + | ||
| 20 | + //我的权益要判断5,和11 | ||
| 21 | + if(name=="我的权益"){ | ||
| 22 | + if(c_list.indexOf("11")!=-1) return 1; | ||
| 23 | + else if(c_list.indexOf("5")!=-1) return 1; | ||
| 24 | + return 0; | ||
| 25 | + }else{ | ||
| 26 | + //不包含,不关闭 | ||
| 27 | + if(c_list.indexOf(index)==-1) return 0; | ||
| 28 | + //包含,就是关闭的 | ||
| 29 | + return 1 | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +module.exports = { | ||
| 35 | + is_close: is_close | ||
| 36 | +} |
pages/user/index/index.js
| @@ -57,24 +57,30 @@ Page({ | @@ -57,24 +57,30 @@ Page({ | ||
| 57 | /** | 57 | /** |
| 58 | * 生命周期函数--监听页面加载 | 58 | * 生命周期函数--监听页面加载 |
| 59 | */ | 59 | */ |
| 60 | - onLoad: function(options) { | 60 | + onLoad: function(options) { |
| 61 | var th=this; | 61 | var th=this; |
| 62 | + //-- 读取会员中心按钮列表 -- | ||
| 63 | + getApp().request.promiseGet("/api/weshop/userTool/page?pageSize=100", { | ||
| 64 | + }).then(res => { | ||
| 65 | + if(res.data.code==0 ){ | ||
| 66 | + var d_list=res.data.data.pageData; | ||
| 67 | + th.setData({user_tool:d_list}); | ||
| 68 | + } | ||
| 69 | + }) | ||
| 62 | this.birthday(); | 70 | this.birthday(); |
| 63 | - getApp().request.promiseGet("/api/weshop/ad/list?pid=401&store_id=" + os.stoid, { | 71 | + getApp().request.promiseGet("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, { |
| 64 | data: { | 72 | data: { |
| 65 | enabled: 1 | 73 | enabled: 1 |
| 66 | } | 74 | } |
| 67 | }).then(res => { | 75 | }).then(res => { |
| 68 | if(res.data.code==0 && res.data.data){ | 76 | if(res.data.code==0 && res.data.data){ |
| 69 | - var item=res.data.data[0]; | ||
| 70 | - if (item && item.ad_code) | 77 | + var item=res.data.data.pageData[0]; |
| 78 | + if (item && item.ad_code) | ||
| 71 | th.setData({ad_img:item.ad_code}) | 79 | th.setData({ad_img:item.ad_code}) |
| 72 | } | 80 | } |
| 73 | - }) | ||
| 74 | - | 81 | + }) |
| 75 | app.getUserFir(); | 82 | app.getUserFir(); |
| 76 | - | ||
| 77 | - | 83 | + |
| 78 | }, | 84 | }, |
| 79 | 85 | ||
| 80 | /** | 86 | /** |
| @@ -122,9 +128,7 @@ Page({ | @@ -122,9 +128,7 @@ Page({ | ||
| 122 | } | 128 | } |
| 123 | } | 129 | } |
| 124 | }); | 130 | }); |
| 125 | - | ||
| 126 | - | ||
| 127 | - | 131 | + |
| 128 | /*-----统计-----*/ | 132 | /*-----统计-----*/ |
| 129 | rq.get("/api/weshop/order/waitlist", { | 133 | rq.get("/api/weshop/order/waitlist", { |
| 130 | data: { | 134 | data: { |
| @@ -298,8 +302,10 @@ Page({ | @@ -298,8 +302,10 @@ Page({ | ||
| 298 | getApp().getConfig2(function(e) { | 302 | getApp().getConfig2(function(e) { |
| 299 | var t_swi = e.switch_list; | 303 | var t_swi = e.switch_list; |
| 300 | if (t_swi) t_swi = JSON.parse(t_swi) | 304 | if (t_swi) t_swi = JSON.parse(t_swi) |
| 301 | - if(t_swi){ | ||
| 302 | - th.setData({sys_switch:t_swi}) | 305 | + if(t_swi){ |
| 306 | + var user_tool=[]; | ||
| 307 | + if(t_swi.usertool) user_tool=JSON.parse(t_swi.usertool); | ||
| 308 | + th.setData({sys_switch:t_swi,c_list:user_tool}); | ||
| 303 | } | 309 | } |
| 304 | 310 | ||
| 305 | 311 |
pages/user/index/index.wxml
| 1 | <!-- <import src="../../tabbar/tabbar.wxml" /> | 1 | <!-- <import src="../../tabbar/tabbar.wxml" /> |
| 2 | <template is="tabBar" data="{{tabBar}}" /> --> | 2 | <template is="tabBar" data="{{tabBar}}" /> --> |
| 3 | - | 3 | +<wxs src="filter.wxs" module="util"></wxs> |
| 4 | <view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}"> | 4 | <view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}"> |
| 5 | <view class="xc-user"> | 5 | <view class="xc-user"> |
| 6 | <view class="xc-head rel"> | 6 | <view class="xc-head rel"> |
| @@ -199,73 +199,59 @@ | @@ -199,73 +199,59 @@ | ||
| 199 | <view class="xc-project-frame"> | 199 | <view class="xc-project-frame"> |
| 200 | <!-- 跳转页面 --> | 200 | <!-- 跳转页面 --> |
| 201 | <view class="center_v" style="display: flex;flex-wrap: wrap;align-items: center;"> | 201 | <view class="center_v" style="display: flex;flex-wrap: wrap;align-items: center;"> |
| 202 | - <view class="item t-c" data-url="/pages/team/team_ping/team_ping" bindtap="goto"> | ||
| 203 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/pindan.png"></image> | ||
| 204 | - <view class="fs26">我的拼单</view> | ||
| 205 | - </view> | ||
| 206 | - <view class="item t-c" data-url="/pages/activity/seckill_list/seckill_list" bindtap="goto"> | ||
| 207 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/miaosha.png"></image> | ||
| 208 | - <view class="fs26">秒杀活动</view> | ||
| 209 | - </view> | ||
| 210 | - <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}"> | ||
| 211 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/quanyi2.png"></image> | ||
| 212 | - <view class="fs26">我的权益</view> | ||
| 213 | - </view> | ||
| 214 | - | ||
| 215 | - <button class="item t-c" wx:if="{{sys_switch.weapp_customertype}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | ||
| 216 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/kefu.png"></image> | ||
| 217 | - <view class="fs26">联系客服</view> | ||
| 218 | - </button> | ||
| 219 | - | ||
| 220 | - <view class="item t-c" bindtap="contactService" wx:else> | ||
| 221 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/kefu.png"></image> | ||
| 222 | - <view class="fs26">联系客服</view> | ||
| 223 | - </view> | ||
| 224 | - | ||
| 225 | - | ||
| 226 | - | ||
| 227 | - | ||
| 228 | - <view class="item t-c" data-url="/pages/user/cardinfo/cardinfo" bindtap="goto" wx:if="{{is_dengji==1}}"> | ||
| 229 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/plus/privilege_o.png"></image> | ||
| 230 | - <view class="fs26">plus会员</view> | ||
| 231 | - </view> | ||
| 232 | - | ||
| 233 | - <view class="item t-c" data-url="/pages/user/collect_list/collect_list" bindtap="goto"> | ||
| 234 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/collections.png"></image> | ||
| 235 | - <view class="fs26">收藏夹</view> | ||
| 236 | - </view> | ||
| 237 | - | ||
| 238 | - <view class="item t-c" data-url="/pages/user/comment/comment" bindtap="goto"> | ||
| 239 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/evaluate.png"></image> | ||
| 240 | - <view class="fs26">我的评价</view> | ||
| 241 | - </view> | ||
| 242 | - | ||
| 243 | - <view class="item t-c" data-url="/pages/user/address_list/address_list" bindtap="goto"> | ||
| 244 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image> | ||
| 245 | - <view class="four-level-word">我的地址</view> | ||
| 246 | - </view> | ||
| 247 | - | ||
| 248 | - <!-- 收入卡包 --> | ||
| 249 | - <view class="item t-c" bindtap="addcard" wx:if="{{add_card_data}}"> | ||
| 250 | - <image class="xc-center-img " src="{{iurl}}//miniapp/images/wx_cardbag.png"></image> | ||
| 251 | - <view class="four-level-word">收入卡包</view> | ||
| 252 | - </view> | ||
| 253 | - | ||
| 254 | - <view class="item t-c" data-url="/pages/user/my_service/i_service" bindtap="goto_nav" > | ||
| 255 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> | ||
| 256 | - <view class="four-level-word">我的服务</view> | ||
| 257 | - </view> | ||
| 258 | - <view class="item t-c" data-url="/pages/giftpack/mygiftpack/mygiftpack" bindtap="goto_nav"> | ||
| 259 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images//user/wdlb.png"></image> | ||
| 260 | - <view class="four-level-word">专享礼包</view> | ||
| 261 | - </view> | ||
| 262 | - <block wx:if="{{is_assistance==1}}"> | ||
| 263 | - <view class="item t-c" data-url="/pages/user/assistance/assistance" bindtap="goto_nav"> | ||
| 264 | - <image class="xc-center-img " src="{{iurl}}/miniapp/images/friendhelp/icon-zl.png"></image> | ||
| 265 | - <view class="four-level-word">助力活动</view> | ||
| 266 | - </view> | ||
| 267 | - </block> | ||
| 268 | - | 202 | + <!-- 循环使用自定义菜单,显示和掩藏 --> |
| 203 | + <block wx:for="{{user_tool}}"> | ||
| 204 | + <!-- 判断系统配置中有没有把菜单关闭 --> | ||
| 205 | + <block wx:if="{{!util.is_close(item.name,c_list)}}"> | ||
| 206 | + <!-- 有链接地址的时候 --> | ||
| 207 | + <block wx:if="{{item.weappurl}}"> | ||
| 208 | + <block wx:if="{{item.name=='PLUS会员'}}"> | ||
| 209 | + <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto" wx:if="{{is_dengji==1}}"> | ||
| 210 | + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> | ||
| 211 | + <view class="fs26">PLUS会员</view> | ||
| 212 | + </view> | ||
| 213 | + </block> | ||
| 214 | + <block wx:elif="{{item.name=='助力活动'}}"> | ||
| 215 | + <view class="item t-c" data-url="/pages/user/assistance/assistance" bindtap="goto_nav" wx:if="{{is_assistance==1}}"> | ||
| 216 | + <image class="xc-center-img " src="{{iurl}}/miniapp/images/friendhelp/icon-zl.png"></image> | ||
| 217 | + <view class="four-level-word">助力活动</view> | ||
| 218 | + </view> | ||
| 219 | + </block> | ||
| 220 | + <block wx:elif="{{item.name=='我的权益'}}"> | ||
| 221 | + <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}"> | ||
| 222 | + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> | ||
| 223 | + <view class="fs26">我的权益</view> | ||
| 224 | + </view> | ||
| 225 | + </block> | ||
| 226 | + <block wx:else> | ||
| 227 | + <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto_nav"> | ||
| 228 | + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> | ||
| 229 | + <view class="fs26">{{item.name}}</view> | ||
| 230 | + </view> | ||
| 231 | + </block> | ||
| 232 | + </block> | ||
| 233 | + <!-- 没有链接地址的时候 --> | ||
| 234 | + <block wx:else> | ||
| 235 | + <block wx:if="{{item.name=='联系客服'}}"> | ||
| 236 | + <button class="item t-c" wx:if="{{sys_switch.weapp_customertype}}" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | ||
| 237 | + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> | ||
| 238 | + <view class="fs26">联系客服</view> | ||
| 239 | + </button> | ||
| 240 | + <view class="item t-c" bindtap="contactService" wx:else> | ||
| 241 | + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> | ||
| 242 | + <view class="fs26">联系客服</view> | ||
| 243 | + </view> | ||
| 244 | + | ||
| 245 | + </block> | ||
| 246 | + <block wx:elif="{{item.name=='收入卡包'}}"> | ||
| 247 | + <view class="item t-c" bindtap="addcard" wx:if="{{add_card_data}}"> | ||
| 248 | + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image> | ||
| 249 | + <view class="four-level-word">收入卡包</view> | ||
| 250 | + </view> | ||
| 251 | + </block> | ||
| 252 | + </block> | ||
| 253 | + </block> | ||
| 254 | + </block> | ||
| 269 | </view> | 255 | </view> |
| 270 | 256 | ||
| 271 | </view> | 257 | </view> |
pages/user/plus/plus.js
| @@ -245,7 +245,11 @@ Page({ | @@ -245,7 +245,11 @@ Page({ | ||
| 245 | {data: {storeId: os.stoid}}).then(res => { | 245 | {data: {storeId: os.stoid}}).then(res => { |
| 246 | if (res.data.code == 0) is_card = 1; | 246 | if (res.data.code == 0) is_card = 1; |
| 247 | }) | 247 | }) |
| 248 | - if (is_card == 0) getApp().my_warnning("请联系商家升级plus功能", 0, th); | 248 | + if (is_card == 0) { |
| 249 | + getApp().my_warnning("请联系商家升级plus功能", 0, th); | ||
| 250 | + return false; | ||
| 251 | + } | ||
| 252 | + | ||
| 249 | var item = th.data.is_plusCard[th.data.by_index]; | 253 | var item = th.data.is_plusCard[th.data.by_index]; |
| 250 | var req = {}; | 254 | var req = {}; |
| 251 | req.cardId = item.CardId; | 255 | req.cardId = item.CardId; |