Merged
Merge Request #537 · created by 后端研发-苏明海


Dev


From dev into test

Merged by 后端研发-苏明海

1 participants





app.json
1 1 {
2 2 "pages": [
3   -
4 3 "pages/index/index/index",
5 4 "pages/justTest/justTest",
6 5 "pages/goods/categoryList/categoryList",
... ... @@ -103,7 +102,12 @@
103 102 "pages/quan_list/quan_list",
104 103 "pages/quan_pro/quan_pro",
105 104 "pages/liveStream/liveStream",
106   - "pages/liveStreamDetails/liveStreamDetails"
  105 + "pages/liveStreamDetails/liveStreamDetails",
  106 + "pages/shop_details/shop_details",
  107 + "pages/goods_share/goods_share",
  108 + "pages/activity_share/activity_share",
  109 + "pages/live_share/live_share",
  110 + "pages/addCustomer/addCustomer"
107 111 ]
108 112  
109 113 }],
... ...
app.wxss
1   -
  1 +.pdt20 {
  2 + padding-top: 20rpx;
  3 +}
  4 +.pdt40 {
  5 + padding-top: 40rpx;
  6 +}
2 7 .flex {
3 8 display: flex;
4 9 }
... ... @@ -409,8 +414,107 @@ background: #ffe3e2;
409 414 flex-wrap:wrap;
410 415 }
411 416  
  417 +.line-through {
  418 + text-decoration:line-through;
  419 +}
  420 +
  421 +
412 422  
413 423 .lh1 {
414 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
  1 +Component({
  2 + externalClasses: ['nodata-container'],
  3 + /*** 页面的初始数据***/
  4 + data: {
  5 +
  6 + },
  7 +
  8 + methods: {
  9 +
  10 + }
  11 +})
0 12 \ No newline at end of file
... ...
components/nodata/nodata.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
components/nodata/nodata.wxml 0 → 100644
  1 +<view class="nodata-container">
  2 + <view class="nodata-icon iconfont icon-nodata"></view>
  3 + <view class="nodata-title">暂无数据</view>
  4 +</view>
... ...
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 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 19 \ No newline at end of file
... ...
components/share/share.json 0 → 100644
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
0 5 \ No newline at end of file
... ...
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 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 152 \ No newline at end of file
... ...
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.shop_price;
  165 + var title= item.goods_name;
  166 + var img=this.data.url+item.original_img;
  167 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid;
  168 + if(getApp().globalData.user_id){
  169 + url+="&first_leader="+getApp().globalData.user_id;
  170 + }
  171 + var ob={
  172 + title: price + "元 " +title,
  173 + path:url,
  174 + imageUrl: img,
  175 + };
  176 + th.setData({share_hidden:1,share_good:null});
  177 + return ob;
  178 + }else{
  179 + var url="/pages/index/index/index";
  180 + if(getApp().globalData.user_id){
  181 + url+="?first_leader="+getApp().globalData.user_id;
  182 + }
  183 + var hui_active=this.data.hui_active;
  184 + var title=hui_active.name;
  185 + if(!title) title=hui_active.main_goods_name;
  186 + if(!title) title=hui_active.giftTitle;
  187 +
  188 + var ob={
  189 + title: title,
  190 + path:url,
  191 + };
  192 + th.setData({share_hidden:1,share_good:null});
  193 + return ob;
  194 + }
  195 + }
  196 +
  197 + },
  198 +
  199 +
  200 + //-- 点击tab --
  201 + clickTab(e) {
  202 + var th=this;
  203 + if(this.data.currentIndex!=e.target.dataset.index){
  204 + this.setData({
  205 + currentIndex: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
  206 + });
  207 + this.data.is_load=0;
  208 + this.data.currentPage=1;
  209 + this.requestGoodsList();
  210 + if(e.target.dataset.index<=1){
  211 + //设置全局定时器
  212 + this.data.timer=setInterval(function () {
  213 + th.countDown();
  214 + },1000);
  215 + }else{
  216 + clearInterval(this.timer);
  217 + }
  218 + }
  219 + },
  220 +
  221 + //-- 点击促销页tab --
  222 + clickTab2(e) {
  223 + if(this.data.currentIndex2!=e.target.dataset.index){
  224 + this.setData({
  225 + currentIndex2: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
  226 + });
  227 + this.data.is_load=0;
  228 + this.data.currentPage=1;
  229 + this.requestGoodsList();
  230 + }
  231 +
  232 + },
  233 + //-- 点击秒杀和拼单底部tab,火热进行和即将开始 --
  234 + clickTab3(e) {
  235 + if(this.data.currentIndex3!=e.target.dataset.index){
  236 + this.setData({
  237 + currentIndex3: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
  238 + });
  239 + this.data.is_load=0;
  240 + this.data.currentPage=1;
  241 + this.requestGoodsList();
  242 + }
  243 + },
  244 + // 关闭弹出层
  245 + closePopup() {
  246 + this.setData({
  247 + hiddenPopup: true
  248 + });
  249 + },
  250 +
  251 + //--- 显示弹出层 ---
  252 + showPopup(e) {
  253 + var th=this;
  254 + var index=e.currentTarget.dataset.index;
  255 + var hui_active=this.data.list[index];
  256 +
  257 + //---搭配促销--
  258 + this.setData({hui_active: hui_active});
  259 + ////---搭配促销--
  260 + if(this.data.currentIndex2==2){
  261 + this.get_prom_goods();
  262 + }else{
  263 + //-- 获取搭配购的从商品的信息 --
  264 + getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + hui_active.main_goods_id,{}).then(res=>{
  265 + if(res.data.code==0){
  266 + var info=res.data.data
  267 + th.setData({['hui_active.ginfo']:info});
  268 + }
  269 + })
  270 + this.get_colloction();
  271 + }
  272 + this.setData({hiddenPopup:false});
  273 +
  274 + },
  275 +
  276 + get_colloction: async function(){
  277 + var list=null;
  278 + //-- 获取搭配购的从商品的信息 --
  279 + await app.request.promiseGet("/api/weshop/goods/getGoodsPromList/"+oo.stoid+"/"+this.data.hui_active.main_goods_id+"/2",{}).then(res=>{
  280 + if(res.data.code==0){
  281 + list=res.data.data.collocationList;
  282 + }
  283 + })
  284 + if(list){
  285 + for(var i in list){
  286 + await app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + list[i].goods_id,{}).then(res=>{
  287 + if(res.data.code==0){
  288 + var info=res.data.data
  289 + list[i].shop_price=info.shop_price;
  290 + }
  291 + })
  292 + }
  293 + }
  294 + this.setData({list2:list});//把数据弄到前台
  295 +
  296 + },
  297 + //-- 获取优惠商品的活动 --
  298 + get_prom_goods:function(){
  299 + var list=null;
  300 + var th=this;
  301 + var prom_goods=null;
  302 + var hui_active=this.data.hui_active;
  303 +
  304 + //-- 获取优惠活动的详情信息 --
  305 + app.request.promiseGet("/api/weshop/promgoodslist/getPromGoodsInfo/"+hui_active.id,{}).then(res=>{
  306 + if(res.data.code==0){
  307 + prom_goods=res.data.data;
  308 + th.setData({prom_goods:prom_goods});
  309 + }
  310 + })
  311 + //-- 指定商品参与,才有商品列表分 --
  312 + if(hui_active.good_object==1){
  313 + this.request_prom_goods();
  314 + }
  315 +
  316 + },
  317 +
  318 + //-- -------获取商品列表--------
  319 + requestGoodsList:function(){
  320 + var th=this;
  321 + if(th.data.is_load) return false; //-- 正在加载
  322 + if(th.data.is_no_data) return false; //-- 没有数据
  323 + if(th.data.is_no_more) return false; //-- 没有更多
  324 + th.data.is_load=1;
  325 + var url="";
  326 + var req_data={
  327 + page:this.data.currentPage,
  328 + store_id:oo.stoid,
  329 + }
  330 +
  331 + switch(th.data.currentIndex){
  332 + case 0: //--秒杀--
  333 + url="/api/ms/flash_sale/spikepage";
  334 + if(th.data.currentIndex3==0){
  335 + url+="?timetype=1"; //火热进行中
  336 + }else{
  337 + url+="?timetype=0"; //即将开始
  338 + }
  339 + req_data.is_show=1;
  340 + req_data.is_end=0;
  341 +
  342 + if(th.data.key_str && th.data.key_str.trim()){
  343 + req_data.key_str=th.data.key_str.trim();
  344 + }
  345 + break;
  346 + case 1: //--拼团--
  347 + url="/api/weshop/teamlist/pageteam";
  348 + if(th.data.currentIndex3==0){
  349 + url+="/1"; //火热进行中
  350 + }else{
  351 + url+="/0"; //即将开始
  352 + }
  353 + req_data.is_show=1;
  354 + req_data.is_end=0;
  355 +
  356 + if(th.data.key_str && th.data.key_str.trim()){
  357 + req_data.key_str=th.data.key_str.trim();
  358 + }
  359 + break;
  360 + case 2: //--促销--
  361 + if(th.data.currentIndex2==0){
  362 + url="//api/weshop/promorder/page";
  363 + if(th.data.key_str && th.data.key_str.trim()){
  364 + req_data.name=th.data.key_str.trim();
  365 + }
  366 + }else if(th.data.currentIndex2==1){
  367 + url="/api/weshop/prom/collocation/pageCollocationGoods";
  368 + if(th.data.key_str && th.data.key_str.trim()){
  369 + req_data.name=th.data.key_str.trim();
  370 + }
  371 + }else{
  372 + url="/api/weshop/promgoods/page";
  373 + if(th.data.key_str && th.data.key_str.trim()){
  374 + req_data.name=th.data.key_str.trim();
  375 + }
  376 + }
  377 + break;
  378 + case 3: //专享礼包
  379 + url='/api/weshop/marketing/giftbag/pageMd';
  380 + if(th.data.key_str && th.data.key_str.trim()){
  381 + req_data.key_str=th.data.key_str.trim();
  382 + }
  383 + break;
  384 + }
  385 +
  386 + if(this.data.key_str && this.data.key_str.trim()){
  387 + var str=this.data.key_str.trim();
  388 + req_data.key_str=str;
  389 + }
  390 + //-- ---调用接口----
  391 + app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{
  392 + th.data.is_load=0;
  393 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
  394 + th.data.currentPage++;
  395 + var data=res.data.data.pageData;
  396 + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
  397 + var list=th.data.list;
  398 + list=list.concat(data);
  399 + th.setData({list:list});
  400 + }else{
  401 + if(th.data.currentPage==1){
  402 + th.setData({is_no_data:1});
  403 + }
  404 + }
  405 + })
  406 + },
  407 +
  408 + //-- -------获取活动详情的商品的列表--------
  409 + request_prom_goods:function(){
  410 + var th=this;
  411 + if(th.data.is_load2) return false; //-- 正在加载
  412 + if(th.data.is_no_data2) return false; //-- 没有数据
  413 + if(th.data.is_no_more2) return false; //-- 没有更多
  414 + th.data.is_load2=1;
  415 +
  416 + var req_data={
  417 + page:th.data.currentPage2
  418 + }
  419 + app.request.promiseGet("/api/weshop/goods/page?store_id="+oo.stoid+"&prom_type=3&prom_id="+th.data.hui_active.id,{
  420 + data:req_data,isShowLoading:1
  421 + }).then(res=>{
  422 + th.data.is_load2=0;
  423 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
  424 + th.data.currentPage2++;
  425 + var data=res.data.data.pageData;
  426 + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more2:1});}
  427 + var list=th.data.list2;
  428 + list=list.concat(data);
  429 + th.setData({list2:list});
  430 + }else{
  431 + if(th.data.currentPage==1){
  432 + th.setData({is_no_data2:1});
  433 + }
  434 + }
  435 + })
  436 + },
  437 +
  438 + //--- 获取卡类列表 ---
  439 + getPlusCardType: function (func) {
  440 + var storid = oo.stoid;
  441 + var th = this;
  442 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
  443 + var plusCard = res.data.data;
  444 + var arr = [1219, 2089, 3031];
  445 + var new_arr = new Array();
  446 + var card_name_map=new Map();
  447 + var user = getApp().globalData.userInfo;
  448 + for (var i = 0; i < plusCard.length; i++) {
  449 + if ((user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
  450 + continue;
  451 + }
  452 + var name="card"+plusCard[i].CorrPrice.toLowerCase();
  453 + card_name_map.set(name,plusCard[i].CardName);
  454 + new_arr.push(plusCard[i]);
  455 + }
  456 +
  457 + var ob={"card_list":new_arr,"name_map":card_name_map};
  458 + func(ob);
  459 + })
  460 + },
  461 +
  462 +
  463 + //---图片失败,默认图片---
  464 + bind_bnerr2: function (e) {
  465 + var _errImg = e.target.dataset.errorimg;
  466 + var _errObj = {};
  467 + _errObj[_errImg] ="/miniapp/images/default_g_img.gif";
  468 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  469 + },
  470 + //-- ---更多加载----
  471 + refresh:function(){
  472 + this.requestGoodsList();
  473 + },
  474 +
  475 + //--定义的保存图片方法,分享团---
  476 + saveImageToPhotosAlbum: function() {
  477 + //--先判断会员状态--
  478 + var user_info = getApp().globalData.userInfo;
  479 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  480 + //getApp().my_warnning("请先登录",0,this);
  481 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  482 + return false;
  483 + }
  484 + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
  485 + var type = 0;
  486 + wx.showLoading({
  487 + title: '生成中...',
  488 + })
  489 + var that = this, th = that;
  490 + //设置画板显示,才能开始绘图,并关闭底部按钮
  491 + that.setData({
  492 + canvasHidden: false,share_hidden:1
  493 + })
  494 +
  495 + var app = getApp();
  496 + var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  497 + var scene = th.data.gid+"";
  498 + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
  499 + if(user_id>0){
  500 + scene+="_"+user_id;
  501 + }
  502 +
  503 + ///二微码
  504 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  505 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
  506 +
  507 + //读取文件成功则OK--
  508 + wx.getImageInfo({
  509 + src: path3,
  510 + success: function(res) {
  511 + //回调写法
  512 + th.get_head_temp(th.get_goods_temp, function() {
  513 + var vpath = res.path;
  514 + var context = wx.createCanvasContext('share');
  515 + //先画背景
  516 + var pg_path = "../../../images/share/share_bg.png";
  517 +
  518 + //-- 如果有自定义海报的时候,判断背景的图片 --
  519 + if(th.data.share_b_img){
  520 + pg_path=th.data.share_b_img;
  521 + }
  522 + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  523 +
  524 + //-- 是自定义海报的情况下 --
  525 + if(th.data.poster && parseInt(th.data.poster.style)==2){
  526 + //在线上分享人的情况下
  527 + if(parseInt(th.data.poster.show_headpic)){
  528 + //获取坐标
  529 + var x=parseFloat(th.data.poster.head_x)*2;
  530 + var y=parseFloat(th.data.poster.head_y)*2;
  531 + var x1=(x+90) *unit;
  532 + var y1=(y+50) *unit;
  533 + //--昵称---
  534 + context.setFontSize(24 * unit)
  535 + context.setFillStyle("black")
  536 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  537 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  538 + //强烈推荐 改许程
  539 + var tj_path = "../../../images/share/q_tj.png";
  540 + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
  541 + context.setFontSize(16 * unit)
  542 + context.setLineJoin('round'); //交点设置成圆角
  543 + context.setFillStyle("white")
  544 + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);
  545 + }
  546 + }else{
  547 + //--昵称---
  548 + context.setFontSize(24 * unit)
  549 + context.setFillStyle("black")
  550 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
  551 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  552 + //强烈推荐 改许程
  553 + var tj_path = "../../../images/share/q_tj.png";
  554 + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
  555 + context.setFontSize(16 * unit)
  556 + context.setLineJoin('round'); //交点设置成圆角
  557 + context.setFillStyle("white")
  558 + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit);
  559 + }
  560 +
  561 +
  562 + //---产品名称---
  563 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  564 + context.setFillStyle("black");
  565 + context.setFontSize(21.3 * unit)
  566 + th.draw_Text(context, th.data.share_good.goods_name,
  567 + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
  568 + //------产品的价格-------
  569 + context.setFontSize(23 * unit)
  570 + context.setFillStyle("red")
  571 + context.fillText("¥", 416 * unit, 185 * unit);
  572 + context.setFontSize(31 * unit)
  573 + var pri0 = th.data.share_good.shop_price;
  574 + if (th.data.prom_act)
  575 + pri0 = th.data.prom_act.price;
  576 +
  577 + pri0 = parseFloat(pri0).toFixed(2);
  578 + context.fillText(pri0, 438 * unit, 185 * unit);
  579 + //---市场价划掉---
  580 + context.setFillStyle("gray")
  581 + context.setFontSize(22 * unit)
  582 + context.fillText("¥" + th.data.share_good.market_price, 426 * unit, 213 * unit);
  583 + context.setStrokeStyle('gray')
  584 + context.setLineWidth(1 * unit)
  585 + context.moveTo(426 * unit, 206 * unit)
  586 + context.lineTo(510 * unit, 206 * unit)
  587 + context.stroke();
  588 + //---中间大图---
  589 + context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
  590 + //-------大图后面就不一样了-----------
  591 + switch (type) {
  592 + case 0: //普通商品的展示
  593 + //中间的几个字
  594 + if(th.data.poster && parseInt(th.data.poster.style)==2 ){
  595 + if(parseInt(th.data.poster.show_quality)){
  596 + var g_path = "../../../images/share/s_gou.png";
  597 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  598 + context.setFillStyle("red")
  599 + context.setFontSize(18 * unit)
  600 + context.fillText("正品保证", 84 * unit, 690 * unit);
  601 +
  602 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  603 + context.setFillStyle("red")
  604 + context.setFontSize(18 * unit)
  605 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  606 +
  607 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  608 + context.setFillStyle("red")
  609 + context.setFontSize(18 * unit)
  610 + context.fillText("官方验证", 420 * unit, 690 * unit);
  611 + }
  612 +
  613 + }else{
  614 + var g_path = "../../../images/share/s_gou.png";
  615 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  616 + context.setFillStyle("red")
  617 + context.setFontSize(18 * unit)
  618 + context.fillText("正品保证", 84 * unit, 690 * unit);
  619 +
  620 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  621 + context.setFillStyle("red")
  622 + context.setFontSize(18 * unit)
  623 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  624 +
  625 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  626 + context.setFillStyle("red")
  627 + context.setFontSize(18 * unit)
  628 + context.fillText("官方验证", 420 * unit, 690 * unit);
  629 + }
  630 +
  631 + //---画线---
  632 + context.setLineWidth(1 * unit)
  633 + context.moveTo(32 * unit, 710 * unit)
  634 + context.lineTo(520 * unit, 710 * unit)
  635 + context.stroke();
  636 + //---文字---
  637 + context.setFillStyle("black")
  638 + context.setFontSize(22 * unit)
  639 + // 原来start --->
  640 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
  641 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
  642 +
  643 + //---二维吗图---
  644 + //-- 自定义海报 --
  645 + if(th.data.poster){
  646 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  647 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  648 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  649 + }else{
  650 + //---二维吗图---
  651 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  652 + }
  653 +
  654 + break;
  655 + case 1: //秒杀商品的展示
  656 + //---画线---
  657 + context.setLineWidth(1 * unit)
  658 + context.moveTo(32 * unit, 670 * unit)
  659 + context.lineTo(520 * unit, 670 * unit)
  660 + context.stroke();
  661 +
  662 + //画秒杀的图片
  663 + var miaos_path = '../../../images/share/miao_share.png';
  664 + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
  665 +
  666 + //---文字---
  667 + context.setFontSize(22 * unit)
  668 + context.setFillStyle("black")
  669 + context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit);
  670 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
  671 + //---二维吗图---
  672 + //-- 自定义海报 --
  673 + if(th.data.poster){
  674 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  675 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  676 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  677 + }else{
  678 + //---二维吗图---
  679 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  680 + }
  681 + break;
  682 +
  683 + case 2: //会员团和商家团的展示
  684 + //---画线---
  685 + context.setLineWidth(1 * unit)
  686 + context.moveTo(32 * unit, 670 * unit)
  687 + context.lineTo(520 * unit, 670 * unit)
  688 + context.stroke();
  689 + //---文字---
  690 + context.setFontSize(22 * unit)
  691 + context.font = 'normal bold';
  692 + context.setFillStyle("black")
  693 + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
  694 +
  695 + //绘制成团图片
  696 + var ct_img = "../../../images/share/ct_num.png";
  697 + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
  698 + var ct_num = th.data.prom_act.ct_num;
  699 + context.setFontSize(14 * unit)
  700 + context.font = 'normal';
  701 + context.setFillStyle("red")
  702 + if (ct_num < 10) {
  703 + context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
  704 + } else {
  705 + context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
  706 + }
  707 + context.setFontSize(22 * unit)
  708 + context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
  709 + context.setFillStyle("gray")
  710 + context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit);
  711 + context.setFillStyle("black")
  712 + context.font = 'normal bold 18px sans-serif';
  713 + context.setFontSize(21.3 * unit)
  714 + context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
  715 + //---二维吗图---
  716 + //-- 自定义海报 --
  717 + if(th.data.poster){
  718 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  719 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  720 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  721 + }else{
  722 + //---二维吗图---
  723 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  724 + }
  725 + break
  726 + case 3: //阶梯团的展示
  727 + //---画线---
  728 + context.setLineWidth(1 * unit)
  729 + context.moveTo(32 * unit, 670 * unit)
  730 + context.lineTo(520 * unit, 670 * unit)
  731 + context.stroke();
  732 + //---文字---
  733 + context.setFontSize(22 * unit)
  734 + context.font = 'normal bold';
  735 + context.setFillStyle("black")
  736 + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
  737 + //---绘制中间阶梯的价格---
  738 + var list = th.data.prom_act.ct_rylist;
  739 + for (var i = 0; i < list.length; i++) {
  740 + var item = list[i];
  741 + var wi = i * 90 * unit;
  742 + context.font = 'normal';
  743 + context.setFontSize(16 * unit)
  744 + context.setFillStyle("red")
  745 + context.fillText("¥", 40 * unit + wi, 756 * unit);
  746 + context.setFontSize(22 * unit)
  747 + var pri = parseFloat(item.price).toFixed(2);
  748 + context.fillText(pri, 56 * unit + wi, 756 * unit);
  749 + context.setFillStyle("gray")
  750 + context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
  751 + }
  752 + //----------------下面部分----------------
  753 + context.setFillStyle("gray")
  754 + context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
  755 + context.setFillStyle("black")
  756 + context.font = 'normal bold 18px sans-serif';
  757 + context.setFontSize(22 * unit)
  758 + context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
  759 +
  760 + //-- 自定义海报 --
  761 + if(th.data.poster){
  762 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  763 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  764 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  765 + }else{
  766 + //---二维吗图---
  767 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  768 + }
  769 + break
  770 + }
  771 +
  772 +
  773 + //--- 如果是自定义海报的时候 ---
  774 + if(th.data.poster && parseInt(th.data.poster.style)==2){
  775 + //如果显示会员信息的话
  776 + if(parseInt(th.data.poster.show_headpic)){
  777 + //获取坐标
  778 + var x= parseFloat(th.data.poster.head_x)*2;
  779 + var y=parseFloat(th.data.poster.head_y)*2;
  780 + //---绘制圆形要放在最后----
  781 + context.save();
  782 + context.beginPath();
  783 + var h_x = x* unit;
  784 + var h_y = y * unit;
  785 + var h_r = 40 * unit;
  786 + var cx = h_x + h_r;
  787 + var cy = h_y + h_r;
  788 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  789 + context.closePath();
  790 + context.fill();
  791 + context.clip();
  792 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  793 + context.restore();
  794 + }
  795 +
  796 + }else{
  797 + //---绘制圆形要放在最后----
  798 + context.save();
  799 + context.beginPath();
  800 + var h_x = 60 * unit;
  801 + var h_y = 24 * unit;
  802 + var h_r = 40 * unit;
  803 + var cx = h_x + h_r;
  804 + var cy = h_y + h_r;
  805 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  806 + context.closePath();
  807 + context.fill();
  808 + context.clip();
  809 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  810 + context.restore();
  811 + }
  812 +
  813 +
  814 + //把画板内容绘制成图片,并回调 画板图片路径
  815 + context.draw(false, function() {
  816 + setTimeout(function() {
  817 + wx.canvasToTempFilePath({
  818 + x: 0,
  819 + y: 0,
  820 + width: 750,
  821 + height: 1217,
  822 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  823 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  824 + canvasId: 'share',
  825 + success: function(res) {
  826 + that.setData({
  827 + shareImgPath: res.tempFilePath,
  828 + canvasHidden: true
  829 + })
  830 + if (!res.tempFilePath) {
  831 + wx.showModal({
  832 + title: '提示',
  833 + content: '图片绘制中,请稍后重试',
  834 + showCancel: false
  835 + })
  836 + return false;
  837 + }
  838 + wx.previewImage({
  839 + //将图片预览出来
  840 + urls: [that.data.shareImgPath]
  841 + });
  842 + //-- 将商品清空 --
  843 + th.setData({share_good:null});
  844 +
  845 + wx.hideLoading();
  846 + }
  847 + })
  848 + }, 500)
  849 +
  850 + });
  851 + });
  852 + }
  853 + });
  854 +
  855 + },
  856 + //---点击分享优惠活动---
  857 + share_index:function(e){
  858 +
  859 + //--先判断会员状态--
  860 + var user_info = getApp().globalData.userInfo;
  861 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  862 + //getApp().my_warnning("请先登录",0,this);
  863 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  864 + return false;
  865 + }
  866 +
  867 + var index=e.currentTarget.dataset.index;
  868 + var item=this.data.list[index];
  869 + this.setData({share_hidden:0,hui_active:item});
  870 +
  871 + var com = this.selectComponent("#share_button"); //组件的id
  872 + com.set_type(1);
  873 + },
  874 + //---点击分享商品---
  875 + share_good:function(e){
  876 +
  877 + //--先判断会员状态--
  878 + var user_info = getApp().globalData.userInfo;
  879 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  880 + //getApp().my_warnning("请先登录",0,this);
  881 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  882 + return false;
  883 + }
  884 +
  885 + var index=e.currentTarget.dataset.index;
  886 + var item=this.data.list[index];
  887 + this.setData({share_hidden:0,share_good:item});
  888 +
  889 + var com = this.selectComponent("#share_button"); //组件的id
  890 + com.set_type(0);
  891 + },
  892 +
  893 + //----活动详情里面的分享---
  894 + share_good2:function(e){
  895 + //--先判断会员状态--
  896 + var user_info = getApp().globalData.userInfo;
  897 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  898 + //getApp().my_warnning("请先登录",0,this);
  899 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  900 + return false;
  901 + }
  902 +
  903 + var index=e.currentTarget.dataset.index;
  904 + var item=this.data.list2[index];
  905 + this.setData({share_hidden:0,share_good:item});
  906 + var com = this.selectComponent("#share_button"); //组件的id
  907 + com.set_type(0);
  908 + },
  909 +
  910 + //-----详情里面的分享-------
  911 + share_detail:function(e){
  912 +
  913 + //--先判断会员状态--
  914 + var user_info = getApp().globalData.userInfo;
  915 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  916 + //getApp().my_warnning("请先登录",0,this);
  917 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  918 + return false;
  919 + }
  920 +
  921 + var com = this.selectComponent("#share_button"); //组件的id
  922 + com.set_type(0);
  923 +
  924 + var idx=e.currentTarget.dataset.index;
  925 + var item=this.data.list2[index];
  926 + this.setData({share_hidden:0,share_good:item});
  927 + },
  928 +
  929 + cancel:function(){
  930 + this.setData({share_hidden:1});
  931 + },
  932 +
  933 + //--获取头像的本地缓存,回调写法--
  934 + get_head_temp: function(tt, func) {
  935 + var ee = this;
  936 + if (ee.data.share_head) {
  937 + tt(func);
  938 + return false;
  939 + }
  940 + //---获取分享图片的本地地址,头像和商品图片----
  941 + var path2 = getApp().globalData.userInfo.head_pic;
  942 + if (path2 == "") {
  943 + ee.data.share_head = "../../../images/share/hui_hear_pic.png";
  944 + tt(func);
  945 + } else {
  946 + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
  947 + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
  948 + wx.getImageInfo({
  949 + src: path2,
  950 + success: function(res) {
  951 + //res.path是网络图片的本地地址
  952 + ee.data.share_head = res.path;
  953 + tt(func);
  954 + },
  955 + fail: function(res) {
  956 + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
  957 + tt(func);
  958 + }
  959 + });
  960 + }
  961 + },
  962 + //--获取商品图片的本地缓存,回调写法--
  963 + get_goods_temp: function(tt) {
  964 + var ee = this;
  965 + //获取商品是分享图信息
  966 + wx.getImageInfo({
  967 + src: ee.data.url+ee.data.share_good.original_img,
  968 + success: function(res) {
  969 + //res.path是网络图片的本地地址
  970 + ee.data.share_goods_img = res.path;
  971 + tt();
  972 + },
  973 + fail: function(res) {
  974 + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
  975 + tt();
  976 + }
  977 + });
  978 + },
  979 +
  980 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  981 + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
  982 + var lineWidth = 0;
  983 + var lastSubStrIndex = 0; //每次开始截取的字符串的索引
  984 + var han = 0;
  985 + for (let i = 0; i < str.length; i++) {
  986 + if (han == 2) return;
  987 + //lineWidth += ctx.measureText(str[i]).width;
  988 + lineWidth += ut.measureText(str[i], 21.3 * unit);
  989 + if (lineWidth > canvasWidth) {
  990 + han++;
  991 +
  992 + if (han == 2)
  993 + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
  994 + else
  995 + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
  996 +
  997 + initHeight += 22; //22为字体的高度
  998 + lineWidth = 0;
  999 + lastSubStrIndex = i;
  1000 + titleHeight += 20;
  1001 + }
  1002 + if (i == str.length - 1) { //绘制剩余部分
  1003 + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
  1004 + }
  1005 + }
  1006 + },
  1007 +
  1008 + //---小于10的格式化函数----
  1009 + timeFormat(param) {
  1010 + return param < 10 ? '0' + param : param;
  1011 + },
  1012 +
  1013 + //----倒计时函数-----
  1014 + countDown() {
  1015 + if(!this.data.timer) return false;
  1016 + var th=this;
  1017 + // 获取当前时间,同时得到活动结束时间数组
  1018 + let newTime =ut.gettimestamp();
  1019 + var endTimeList = this.data.list;
  1020 + if(endTimeList==null) return null
  1021 + // 对结束时间进行处理渲染到页面
  1022 + for (var i = 0; i < endTimeList.length;i++){
  1023 + var o = endTimeList[i];
  1024 + var endTime = o.end_time;
  1025 + let obj = null;
  1026 + // 如果活动未结束,对时间进行处理
  1027 + if (endTime - newTime > 0){
  1028 + let time = (endTime - newTime);
  1029 + // 获取天、时、分、秒
  1030 + let day = parseInt(time / (60 * 60 * 24));
  1031 + let hou = parseInt(time % (60 * 60 * 24) / 3600);
  1032 + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
  1033 + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
  1034 + obj = {
  1035 + day: this.timeFormat(day), hou: this.timeFormat(hou), min: this.timeFormat(min), sec: this.timeFormat(sec), hide: 1
  1036 + }
  1037 + }else{
  1038 + //活动已结束,全部设置为'00'
  1039 + obj = { day: '00', hou: '00', min: '00', sec: '00' }
  1040 + }
  1041 + var txt ="list["+i+"].djs";
  1042 + th.setData({ [txt]: obj});
  1043 + }
  1044 + },
  1045 +
  1046 + //-------搜索的相关功能------
  1047 + set_search_value:function(e){
  1048 + var key_str=e.detail.value;
  1049 + if(key_str) key_str=key_str.trim();
  1050 + this.setData({key_str:key_str});
  1051 +
  1052 + },
  1053 + search_data:function(){
  1054 + this.setData({
  1055 + is_no_data:0,is_no_more:0,list:[],
  1056 + });
  1057 + this.data.is_load=0;
  1058 + this.data.currentPage=1;
  1059 + this.requestGoodsList();
  1060 + }
  1061 +
  1062 +
  1063 +})
0 1064 \ No newline at end of file
... ...
packageA/pages/activity_share/activity_share.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "活动分享",
  3 + "usingComponents": {
  4 + "nodata": "/components/nodata/nodata",
  5 + "share_button": "/components/share/share"
  6 + },
  7 + "enablePullDownRefresh": false
  8 +}
0 9 \ No newline at end of file
... ...
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 + refresher-enabled>
  30 +
  31 + <block wx:for="{{list}}">
  32 +
  33 + <!-- 拼单和秒杀 -->
  34 + <block wx:if="{{currentIndex == 0 || currentIndex == 1}}">
  35 + <view class class="list-item">
  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 bindtap="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">
  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 bindtap="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">
  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">
  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">
  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 bindtap="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 115 \ No newline at end of file
... ...
packageA/pages/addCustomer/addCustomer.js 0 → 100644
  1 +// packageA//pages/quan/quan.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面隐藏
  34 + */
  35 + onHide: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面卸载
  41 + */
  42 + onUnload: function () {
  43 +
  44 + },
  45 +
  46 + /**
  47 + * 页面相关事件处理函数--监听用户下拉动作
  48 + */
  49 + onPullDownRefresh: function () {
  50 +
  51 + },
  52 +
  53 + /**
  54 + * 页面上拉触底事件的处理函数
  55 + */
  56 + onReachBottom: function () {
  57 +
  58 + },
  59 +
  60 + /**
  61 + * 用户点击右上角分享
  62 + */
  63 + onShareAppMessage: function () {
  64 +
  65 + }
  66 +})
0 67 \ No newline at end of file
... ...
packageA/pages/addCustomer/addCustomer.json 0 → 100644
  1 +{
  2 + "usingComponents": {},
  3 + "enablePullDownRefresh": false
  4 +}
0 5 \ No newline at end of file
... ...
packageA/pages/addCustomer/addCustomer.wxml 0 → 100644
  1 +<view class="container">
  2 + <view class="panel t-c">
  3 + <view class="avatar"></view>
  4 + <view class="nickname">微信昵称</view>
  5 + <view class="gray">hello,我是您的专属顾问</view>
  6 + <view class="gray">扫描下方二维码,加我微信吧~</view>
  7 + <view class="qrcode"></view>
  8 + </view>
  9 + <view class="flex bottom t-c gray pdv10">
  10 + <view class="w50">
  11 + <image src="../../images/wx.png" class="wx"></image>
  12 + <view class="fs26">发给客户</view>
  13 + </view>
  14 + <view class="w50 save">
  15 + <text class="iconfont icon-save"></text>
  16 + <view class="fs26 mgt12">保存图片</view>
  17 + </view>
  18 + </view>
  19 +</view>
0 20 \ No newline at end of file
... ...
packageA/pages/addCustomer/addCustomer.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 +.mgt12 {
  21 + margin-top: 12rpx;
  22 +}
  23 +page,
  24 +.container {
  25 + /* background-color: #f2f2f2; */
  26 + height: 100%;
  27 + background-color: pink;
  28 +}
  29 +.container {
  30 + /* background-color: white; */
  31 + /* position: fixed;
  32 + width: 100%;
  33 + bottom: 0; */
  34 + box-sizing: border-box;
  35 + padding: 160rpx 40rpx 0;
  36 + background-image: linear-gradient(to top, #4481eb 0%, #04befe 100%);
  37 + /* padding-bottom: 128rpx; */
  38 +}
  39 +.search-container {
  40 + display: flex;
  41 + padding: 26rpx 20rpx;
  42 + border-bottom: 2rpx solid #f8f8f8;
  43 +}
  44 +.input-container {
  45 + flex: 1;
  46 + border-radius: 6rpx 0 0 6rpx;
  47 + overflow: hidden;
  48 +}
  49 +.search {
  50 + background-color: #f0f0f0;
  51 + padding: 10rpx 20rpx;
  52 + font-size: 28rpx;
  53 +}
  54 +.btn-search {
  55 + background-color: #FE6867;
  56 + color: white;
  57 + padding: 0 30rpx;
  58 + display: flex;
  59 + align-items: center;
  60 + border-radius: 0 6rpx 6rpx 0;
  61 +}
  62 +.title {
  63 + display: flex;
  64 + font-size: 30rpx;
  65 + border-bottom: 2rpx solid #f8f8f8;
  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 +.title-item.active:after {
  84 + content:'';
  85 + position: absolute;
  86 + width: 50%;
  87 + height: 4rpx;
  88 + background-color: #FE6867;
  89 + left: 0;
  90 + right: 0;
  91 + bottom: 0;
  92 + margin: 0 auto;
  93 +}
  94 +.list-container {
  95 + height: calc(100% - 118rpx);
  96 +}
  97 +.list {
  98 + box-sizing: border-box;
  99 + height: calc(100% - 82rpx);
  100 + background-color: #f2f2f2;
  101 + /* padding-bottom: 102rpx; */
  102 +}
  103 +.list.active1 {
  104 + height: calc(100% - 82rpx - 78rpx);
  105 + padding-bottom: 0;
  106 +}
  107 +.list.active2 {
  108 + padding-bottom: 0;
  109 +}
  110 +.list-item {
  111 + display: flex;
  112 + padding: 20rpx;
  113 + border-bottom: 2rpx solid #f8f8f8;
  114 + background-color: white;
  115 +}
  116 +.img-container {
  117 + background-color: #f0f0f0;
  118 + width: 280rpx;
  119 + height: 248rpx;
  120 + display: flex;
  121 + align-items: center;
  122 + justify-content: center;
  123 + position: relative;
  124 +}
  125 +.img-container:after {
  126 + font-family: iconfont;
  127 + content: '\e8c1';
  128 + color: #bbb;
  129 + font-size: 80rpx;
  130 +}
  131 +
  132 +
  133 +.img-container.live:before {
  134 + content: '\e664';
  135 +}
  136 +.img-container.coming:before {
  137 + content: '\e608';
  138 +}
  139 +.img-container.playback:before {
  140 + content: '\e603';
  141 +}
  142 +.img-container.live:before,
  143 +.img-container.coming:before,
  144 +.img-container.playback:before {
  145 + font-family: iconfont;
  146 + background-color: #FE6867;
  147 + color: white;
  148 + width: 50rpx;
  149 + height: 50rpx;
  150 + line-height: 50rpx;
  151 + text-align: center;
  152 + border-radius: 50%;
  153 + position: absolute;
  154 + left: 10rpx;
  155 + top: 10rpx;
  156 +}
  157 +.details {
  158 + flex: 1;
  159 + padding-left: 20rpx;
  160 +}
  161 +.btn-share {
  162 + box-sizing: border-box;
  163 + display: inline-block;
  164 + background-color: #FE6867;
  165 + color: white;
  166 + padding: 8rpx 30rpx;
  167 + border-radius: 6rpx;
  168 + text-align: center;
  169 +}
  170 +.pdt10 {
  171 + padding-top: 10rpx;
  172 +}
  173 +.pdt14 {
  174 + padding-top: 14rpx;
  175 +}
  176 +.pdtb6 {
  177 + padding-top: 6rpx;
  178 + padding-bottom: 6rpx;
  179 +}
  180 +.pdtb8 {
  181 + padding-top: 8rpx;
  182 + padding-bottom: 8rpx;
  183 +}
  184 +.pdl20 {
  185 + padding-left: 104rpx;
  186 +}
  187 +
  188 +
  189 +.no-more {
  190 + line-height: 3;
  191 + color: #ccc;
  192 + /* background-color: #f2f2f2; */
  193 +}
  194 +.nodata {
  195 + text-align: center;
  196 + background-color: #f2f2f2;
  197 +}
  198 +.progress-container {
  199 + width: 55%;
  200 + padding-right: 10rpx;
  201 + position: relative;
  202 + text-align: center;
  203 +}
  204 +.retail {
  205 + color: #7b7b7b;
  206 + text-decoration: line-through;
  207 + font-size: 22rpx;
  208 + padding-left: 20rpx;
  209 +}
  210 +.name {
  211 + height: 76rpx;
  212 + overflow: hidden;
  213 +}
  214 +
  215 +.percent {
  216 + position: absolute;
  217 + top: 0;
  218 + bottom: 0;
  219 + left: 0;
  220 + right: 0;
  221 + margin: auto;
  222 + color: white;
  223 +}
  224 +.tabbar {
  225 + position: fixed;
  226 + width: 100%;
  227 + bottom: 0;
  228 + background-color: white;
  229 +}
  230 +.tabbar:after {
  231 + position: absolute;
  232 + content: '';
  233 + width: 2rpx;
  234 + height: 50%;
  235 + top: 0;
  236 + bottom: 0;
  237 + left: 0;
  238 + right: 0;
  239 + margin: auto;
  240 + background-color: #f0f0f0;
  241 +}
  242 +.tabbar-item {
  243 + width: 50%;
  244 + text-align: center;
  245 + padding-top: 30rpx;
  246 + padding-bottom: 30rpx;
  247 +}
  248 +.tabbar-item .iconfont {
  249 + margin-right: 10rpx;
  250 +}
  251 +.tabbar-item.active {
  252 + color: #FE6867;
  253 +}
  254 +
  255 +
  256 +.group-type,
  257 +.group-num {
  258 + position: relative;
  259 + font-size: 22rpx;
  260 +}
  261 +.group-type:before,
  262 +.group-num:before {
  263 + font-family: iconfont;
  264 +}
  265 +.group-type:before {
  266 + content: '\e66a';
  267 + color: white;
  268 + background-color: #FE6867;
  269 + position: absolute;
  270 + left: 0;
  271 + top: 0;
  272 + bottom: 0;
  273 + padding-left: 6rpx;
  274 + padding-right: 10rpx;
  275 + line-height: 30rpx;
  276 +}
  277 +.group-num:before {
  278 + padding-right: 6rpx;
  279 +}
  280 +.group-num:before {
  281 + content: '\e694';
  282 + position: relative;
  283 +}
  284 +.group-num {
  285 + color: white;
  286 + background-color: #FE6867;
  287 + border-radius: 34rpx;
  288 + padding-left: 10rpx;
  289 + padding-right: 10rpx;
  290 + margin-right: 14rpx;
  291 +}
  292 +.group-type {
  293 + color: #FE6867;
  294 + border: 2rpx solid #FE6867;
  295 + padding-left: 42rpx;
  296 + padding-right: 4rpx;
  297 + border-radius: 6rpx;
  298 +}
  299 +
  300 +.badge {
  301 + color: white;
  302 + padding: 0 20rpx;
  303 + border-radius: 6rpx;
  304 + background-color: #FE6867;
  305 + margin-right: 10rpx;
  306 +}
  307 +
  308 +.subTab-title {
  309 + text-align: center;
  310 + justify-content: center;
  311 + align-items: center;
  312 + font-size: 28rpx;
  313 +}
  314 +.subTab-list {
  315 + padding: 20rpx;
  316 +}
  317 +.subTab-titleItem {
  318 + box-sizing: border-box;
  319 + width: calc(100% / 3);
  320 + padding: 20rpx 40rpx;
  321 + background-color: white;
  322 + border-right: 2rpx solid #f8f8f8;
  323 +}
  324 +.subTab-titleItem:last-child {
  325 + border-right: none;
  326 +}
  327 +.subTab-titleItem.active {
  328 + background-color: #FE6867;
  329 + color: white;
  330 +}
  331 +.subTab-item {
  332 + padding: 20rpx;
  333 + border-bottom: 2rpx solid #f8f8f8;
  334 + background-color: white;
  335 + border-radius: 8rpx;
  336 + box-shadow: 0 8px 12px #e7e9eb;
  337 +}
  338 +.subTab-item ~ .subTab-item {
  339 + margin-top: 20rpx;
  340 +}
  341 +.pdv10 {
  342 + padding-top: 10rpx;
  343 + padding-bottom: 10rpx;
  344 +}
  345 +.pdv20 {
  346 + padding-top: 20rpx;
  347 + padding-bottom: 20rpx;
  348 +}
  349 +.pdb10 {
  350 + padding-bottom: 10rpx;
  351 +}
  352 +.pdb20 {
  353 + padding-bottom: 20rpx;
  354 +}
  355 +.bdr-b {
  356 + border-bottom: 2rpx solid #f8f8f8;
  357 +}
  358 +.dash-b {
  359 + border-bottom: 2rpx dashed #ddd;
  360 +}
  361 +.btn-container {
  362 + display: flex;
  363 + align-items: flex-end;
  364 + font-size: 26rpx;
  365 +}
  366 +
  367 +
  368 +/* .popup-container {
  369 + content:'';
  370 + position: fixed;
  371 + top: 0;
  372 + bottom: 0;
  373 + left: 0;
  374 + right: 0;
  375 + z-index: 3;
  376 + background-color: rgba(0,0,0,.6);
  377 + display: flex;
  378 + align-items: center;
  379 + justify-content: center;
  380 +}
  381 +.popup {
  382 + width: 90%;
  383 +}
  384 +.popup-content {
  385 + box-sizing: border-box;
  386 + width: 100%;
  387 + background-color: white;
  388 + padding: 0 20rpx;
  389 + border-radius: 10rpx;
  390 + max-height: 1038rpx;
  391 +}
  392 +.icon-close {
  393 + font-size: 60rpx;
  394 + color: white;
  395 +}
  396 +.popup-btn {
  397 + padding-top: 30rpx;
  398 +}
  399 +
  400 +.popup-title {
  401 + /* font-size: 28rpx; */
  402 + /* font-weight: bold;
  403 + padding: 20rpx 0;
  404 +}
  405 +.popup-title2 { */
  406 + /* padding: 10rpx 0; */
  407 + /* padding-bottom: 8rpx;
  408 +}
  409 +.popup-title3 {
  410 + padding-left: 34rpx;
  411 + font-size: 30rpx;
  412 +}
  413 +.popup-list {
  414 + max-height: 602rpx;
  415 + overflow-y: auto;
  416 +}
  417 +
  418 +
  419 +radio .wx-radio-input {
  420 + width: 28rpx;
  421 + height: 28rpx;
  422 +}
  423 +
  424 +
  425 +radio .wx-radio-input.wx-radio-input-checked {
  426 + background-color: #FE6867;
  427 + border-color: #FE6867;
  428 +}
  429 +radio .wx-radio-input.wx-radio-input-checked::before{
  430 + color: white;
  431 +}
  432 +
  433 +.popup-content.active {
  434 + max-height: 982rpx;
  435 + overflow: auto;
  436 +} */
  437 +
  438 +.panel {
  439 + box-sizing: border-box;
  440 + background-color: white;
  441 + height: 100%;
  442 + border-radius: 16rpx;
  443 + position: relative;
  444 + padding-top: 140rpx;
  445 + box-shadow: 0 8px 12px #ccc;
  446 +}
  447 +.avatar {
  448 + width: 220rpx;
  449 + height: 220rpx;
  450 + border-radius: 50%;
  451 + background-color: skyblue;
  452 + position: absolute;
  453 + top: -100rpx;
  454 + left: 0;
  455 + right: 0;
  456 + margin: 0 auto;
  457 +}
  458 +.nickname {
  459 + padding-bottom: 60rpx;
  460 +}
  461 +.bottom {
  462 + background-color: white;
  463 + border-top: 2rpx solid #f0f0f0;
  464 + /* box-shadow: 0 -6px 8px #e7e9eb; */
  465 + width: 100%;
  466 + position: fixed;
  467 + left: 0;
  468 + bottom: 0;
  469 +}
  470 +.wx {
  471 + width: 60rpx;
  472 + height: 60rpx;
  473 +}
  474 +.save {
  475 + box-sizing: border-box;
  476 + padding-top: 6rpx;
  477 +}
  478 +.icon-save {
  479 + font-size: 50rpx;
  480 +}
  481 +.qrcode {
  482 + width: 480rpx;
  483 + height: 480rpx;
  484 + background-color: red;
  485 + margin: 60rpx auto 0;
  486 +}
  487 +
  488 +
... ...
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 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=" + th.data.gid;
  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.gid+"";
  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 +
  798 +})
0 799 \ No newline at end of file
... ...
packageA/pages/goods_share/goods_share.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "商品分享",
  3 + "usingComponents": {
  4 + "nodata": "/components/nodata/nodata",
  5 + "share_button": "/components/share/share"
  6 + },
  7 + "enablePullDownRefresh": false
  8 +}
0 9 \ No newline at end of file
... ...
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 + <view class="title-item" bindtap="sort1">价格<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view>
  14 + <view class="title-item" bindtap="sort2">佣金<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view>
  15 + <view class="title-item" bindtap='new_sort'>最新</view>
  16 + </view>
  17 + <!-- 列表项 -->
  18 + <scroll-view
  19 + class="list"
  20 + scroll-y="true"
  21 + bindscrolltolower="refresh"
  22 + scroll-anchoring
  23 + refresher-enabled>
  24 + <block wx:for="{{list}}">
  25 + <view class class="list-item">
  26 + <view class="img-container">
  27 + <image src="{{url+item.original_img}}" style="width: 100%; height: 100%;"
  28 + binderror="bind_bnerr2" lazy-load="true"
  29 + data-errorimg="list[{{index}}].original_img"></image>
  30 + </view>
  31 + <view class="details">
  32 + <view class="ellipsis-2 fs28 name">{{item.goods_name}}</view>
  33 + <view class="red pdt14">¥{{item.shop_price}}
  34 + <!-- 如果有等级卡的话 -->
  35 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  36 + <!-- 当会员是等级卡的时候,且卡有钱的时候 -->
  37 + <block wx:if="{{card_field && item[card_field]>0}}">
  38 + <text class="plus_show">PLUS</text>¥{{item[card_field]}}
  39 + </block>
  40 + <!-- 当会员不是等级卡的时候,且卡有钱的时候 -->
  41 + <block wx:if="{{!card_field && g_filter.get_card_price(item,card_list,0)>0}}">
  42 + <text class="plus_show">PLUS</text>¥{{g_filter.get_card_price(item,card_list,0)}}
  43 + </block>
  44 + </block>
  45 + </view>
  46 +
  47 + <view class="flex jc_sb fs24 pdt14">
  48 + <view class="gray">已售:<text class="red">{{item.sales_sum}}</text></view>
  49 + <view class="gray">分成金额:
  50 + <text wx:if="{{!pattern}}" class="red">¥{{item.commission}}</text>
  51 + <text wx:else class="red">¥{{item.fir_rate+item.sec_rate+item.thi_rate}}</text>
  52 + </view>
  53 + </view>
  54 + <view bindtap="share_good" data-index="{{index}}" class="t-r fs28 pdt14">
  55 + <view class="btn-share">分享</view>
  56 + </view>
  57 + </view>
  58 + </view>
  59 + </block>
  60 + <nodata wx:if="{{list.length==0}}" nodataContainer="nodata">暂无数据</nodata>
  61 + <view wx:if="{{is_no_more}}" class="no-more t-c">- 已全部加载 -</view>
  62 + </scroll-view>
  63 + </view>
  64 +</view>
  65 +
  66 +<!--二维码显示页面-->
  67 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas>
  68 +<!-- 分享控件,底部弹出 -->
  69 +<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/liveStreamDetails/liveStreamDetails.js
... ... @@ -397,6 +397,19 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
397 397 onLoad: function (options) {
398 398 var that = this;
399 399 this.getSystemInfo();
  400 +
  401 + var first_leader=options.first_leader;
  402 + if(first_leader){
  403 + //-- user_id代过来免登陆 --
  404 + getApp().globalData.user_id=first_leader;
  405 + getApp().getUserFir();
  406 + //调用接口判断是不是会员
  407 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+o.stoid+"/"+first_leader,{}).then(res=>{
  408 + if(res.data.code==0){
  409 + getApp().globalData.guide_id=res.data.data.id;
  410 + }
  411 + })
  412 + }
400 413  
401 414 getApp().request.promiseGet("/api/weshop/wx/livelist/get",{
402 415 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 +
  183 +
  184 +})
0 185 \ No newline at end of file
... ...
packageA/pages/live_share/live_share.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "直播间分享",
  3 + "usingComponents": {
  4 + "nodata": "/components/nodata/nodata",
  5 + "share_button": "/components/share/share"
  6 + },
  7 + "enablePullDownRefresh": false
  8 +}
0 9 \ No newline at end of file
... ...
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 + refresher-enabled>
  18 + <!-- 专享礼包 -->
  19 + <block wx:for="{{list}}">
  20 + <view class class="list-item">
  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 bindtap="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 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面显示
  41 + */
  42 + onShow: function () { },
  43 +
  44 + /**
  45 + * 生命周期函数--监听页面隐藏
  46 + */
  47 + onHide: function () {
  48 +
  49 + },
  50 + /**
  51 + * 页面相关事件处理函数--监听用户下拉动作
  52 + */
  53 + // onPullDownRefresh: function () {
  54 +
  55 + // },
  56 +
  57 + /**
  58 + * 页面上拉触底事件的处理函数
  59 + */
  60 + onReachBottom: function () {
  61 +
  62 + },
  63 +
  64 + /**
  65 + * 用户点击右上角分享
  66 + */
  67 + onShareAppMessage: function () {
  68 + var th=this;
  69 + var id=th.data.hui_active.id;
  70 + var url="/packageA/pages/quan_pro/quan_pro?id="+id;
  71 +
  72 + if(getApp().globalData.user_id){
  73 + url+="&first_leader="+getApp().globalData.user_id;
  74 + }
  75 + var title=th.data.hui_active.name;
  76 + var ob={
  77 + title:title,
  78 + path:url,
  79 + };
  80 + th.setData({share_hidden:1});
  81 + return ob;
  82 + },
  83 +
  84 + requestGoodsList:function(){
  85 + var th=this;
  86 + if(th.data.is_load) return false; //-- 正在加载
  87 + if(th.data.is_no_data) return false; //-- 没有数据
  88 + if(th.data.is_no_more) return false; //-- 没有更多
  89 + th.data.is_load=1;
  90 +
  91 + var url="/api/weshop/prom/coupon/pageCouponList";
  92 + var req_data={
  93 + page:this.data.currentPage,
  94 + store_id:oo.stoid,
  95 + type:1
  96 + }
  97 +
  98 + //-- ---调用接口----
  99 + app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{
  100 + th.data.is_load=0;
  101 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
  102 + th.data.currentPage++;
  103 + var data=res.data.data.pageData;
  104 + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
  105 + var list=th.data.list;
  106 + list=list.concat(data);
  107 + th.setData({list:list});
  108 + }else{
  109 + if(th.data.currentPage==1){
  110 + th.setData({is_no_data:1});
  111 + }
  112 + }
  113 + })
  114 + },
  115 +
  116 +
  117 + //---点击分享优惠活动---
  118 + share_index:function(e){
  119 +
  120 + //--先判断会员状态--
  121 + var user_info = getApp().globalData.userInfo;
  122 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  123 + //getApp().my_warnning("请先登录",0,this);
  124 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  125 + return false;
  126 + }
  127 +
  128 + var index=e.currentTarget.dataset.index;
  129 + var item=this.data.list[index];
  130 + this.setData({share_hidden:0,hui_active:item});
  131 +
  132 + var com = this.selectComponent("#share_button"); //组件的id
  133 + com.set_type(1);
  134 + },
  135 + //-- ---更多加载----
  136 + refresh:function(){
  137 + this.requestGoodsList();
  138 + },
  139 +
  140 + //---点击分享优惠活动---
  141 + share_index:function(e){
  142 +
  143 + //--先判断会员状态--
  144 + var user_info = getApp().globalData.userInfo;
  145 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  146 + //getApp().my_warnning("请先登录",0,this);
  147 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  148 + return false;
  149 + }
  150 +
  151 + var index=e.currentTarget.dataset.index;
  152 + var item=this.data.list[index];
  153 + this.setData({share_hidden:0,hui_active:item});
  154 +
  155 + var com = this.selectComponent("#share_button"); //组件的id
  156 + com.set_type(1);
  157 + },
  158 +
  159 +
  160 +
  161 +
  162 +})
0 163 \ No newline at end of file
... ...
packageA/pages/quan/quan.json 0 → 100644
  1 +{
  2 + "usingComponents": {
  3 + "nodata": "/components/nodata/nodata",
  4 + "share_button": "/components/share/share"
  5 + },
  6 + "navigationBarTitleText": "优惠券列表",
  7 + "enablePullDownRefresh": false
  8 +}
0 9 \ No newline at end of file
... ...
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 + refresher-enabled>
  18 +
  19 + <block wx:for="{{list}}">
  20 + <view class="coupons bg-red">
  21 + <view class="flex">
  22 + <view>
  23 + <view class="coupon-hd ellipsis-2 fs36">{{item.name}}</view>
  24 + <view class="deadline fs28 pdt10" wx:if="{{item.endtype==0}}">限时使用:
  25 + <text wx:if="{{item.starttype==1}}">{{filters.format_time(getcurday+3600*24*item.startdays)}}</text>
  26 + <text wx:if="{{item.starttype==0 && item.use_start_time>0}}"> {{filters.format_time(item.use_start_time)}}</text>至
  27 + <text wx:if="{{item.use_end_time>0}}"> {{filters.format_time(item.use_end_time)}}</text><text wx:else>不限</text>
  28 + </view>
  29 + <view class="deadline fs28 pdt10" wx:else>限时使用:
  30 + <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>
  31 + </view>
  32 + </view>
  33 + <view class="price">¥<text class="fs80">{{filters.toFix(item.money,2)}}</text></view>
  34 + </view>
  35 + <view class="flex ai-center jc_sb pdt20">
  36 + <view wx:if="{{item.useobjecttype==0}}" class="coupon-ft ellipsis-2 fs28">全场任意产品通用</view>
  37 + <view wx:if="{{item.useobjecttype==1}}" class="coupon-ft ellipsis-2 fs28">名牌({{item.useobjectname}})</view>
  38 + <view wx:if="{{item.useobjecttype==2}}" class="coupon-ft ellipsis-2 fs28">品类({{item.useobjectname}})</view>
  39 + <view wx:if="{{item.useobjecttype==11}}" class="coupon-ft ellipsis-2 fs28">用途({{item.useobjectname}})</view>
  40 + <view wx:if="{{item.useobjecttype==12}}" class="coupon-ft ellipsis-2 fs28">分类一({{item.useobjectname}})</view>
  41 + <view wx:if="{{item.useobjecttype==20}}" class="coupon-ft ellipsis-2 fs28">单品({{item.useobjectname}})</view>
  42 +
  43 + <view bindtap="share_index" data-index="{{index}}" class="btn-share" >分享</view>
  44 + </view>
  45 + </view>
  46 + </block>
  47 +
  48 + <!-- 暂无数据 -->
  49 + <nodata wx:if="{{list.length==0}}" nodataContainer="nodata">暂无数据</nodata>
  50 + <view wx:if="{{is_no_more}}" class="no-more t-c">- 已全部加载 -</view>
  51 + </scroll-view>
  52 + <!-- </view> -->
  53 + <view class="popup-container" hidden="{{hiddenPopup}}">
  54 + <view class="popup" bindtap="select">
  55 + <view class="popup-item bdr-b" hover-class="active" data-index="0">
  56 + <image src="../../images/wx2.png" class="popup-img"></image>微信
  57 + </view>
  58 + <view class="popup-item" hover-class="active" data-index="1">
  59 + <image src="../../images/qywx.png" class="popup-img h70"></image>企业微信
  60 + </view>
  61 + </view>
  62 + </view>
  63 +</view>
  64 +<!-- 分享控件,底部弹出 -->
  65 +<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 + background-color: #f2f2f2;
  90 + padding: 20rpx 20rpx 0 20rpx;
  91 + /* padding-bottom: 102rpx; */
  92 +}
  93 +.list.active1 {
  94 + height: calc(100% - 82rpx - 78rpx);
  95 + padding-bottom: 0;
  96 +}
  97 +.list.active2 {
  98 + padding-bottom: 0;
  99 +}
  100 +.list-item {
  101 + display: flex;
  102 + padding: 20rpx;
  103 + border-bottom: 2rpx solid #f8f8f8;
  104 + background-color: white;
  105 +}
  106 +.img-container {
  107 + background-color: #f0f0f0;
  108 + width: 280rpx;
  109 + height: 248rpx;
  110 + display: flex;
  111 + align-items: center;
  112 + justify-content: center;
  113 + position: relative;
  114 +}
  115 +.img-container:after {
  116 + font-family: iconfont;
  117 + content: '\e8c1';
  118 + color: #bbb;
  119 + font-size: 80rpx;
  120 +}
  121 +
  122 +
  123 +.img-container.live:before {
  124 + content: '\e664';
  125 +}
  126 +.img-container.coming:before {
  127 + content: '\e608';
  128 +}
  129 +.img-container.playback:before {
  130 + content: '\e603';
  131 +}
  132 +.img-container.live:before,
  133 +.img-container.coming:before,
  134 +.img-container.playback:before {
  135 + font-family: iconfont;
  136 + background-color: #FE6867;
  137 + color: white;
  138 + width: 50rpx;
  139 + height: 50rpx;
  140 + line-height: 50rpx;
  141 + text-align: center;
  142 + border-radius: 50%;
  143 + position: absolute;
  144 + left: 10rpx;
  145 + top: 10rpx;
  146 +}
  147 +.details {
  148 + flex: 1;
  149 + padding-left: 20rpx;
  150 +}
  151 +.btn-share {
  152 + box-sizing: border-box;
  153 + display: inline-block;
  154 + background-color: #FE6867;
  155 + color: white;
  156 + padding: 8rpx 30rpx;
  157 + border-radius: 6rpx;
  158 + text-align: center;
  159 +}
  160 +.pdt10 {
  161 + padding-top: 10rpx;
  162 +}
  163 +.pdt14 {
  164 + padding-top: 14rpx;
  165 +}
  166 +.pdtb6 {
  167 + padding-top: 6rpx;
  168 + padding-bottom: 6rpx;
  169 +}
  170 +.pdtb8 {
  171 + padding-top: 8rpx;
  172 + padding-bottom: 8rpx;
  173 +}
  174 +.pdl20 {
  175 + padding-left: 104rpx;
  176 +}
  177 +
  178 +
  179 +.no-more {
  180 + line-height: 3;
  181 + color: #ccc;
  182 + /* background-color: #f2f2f2; */
  183 +}
  184 +.nodata {
  185 + text-align: center;
  186 + background-color: #f2f2f2;
  187 +}
  188 +.progress-container {
  189 + width: 55%;
  190 + padding-right: 10rpx;
  191 + position: relative;
  192 + text-align: center;
  193 +}
  194 +.retail {
  195 + color: #7b7b7b;
  196 + text-decoration: line-through;
  197 + font-size: 22rpx;
  198 + padding-left: 20rpx;
  199 +}
  200 +.name {
  201 + height: 76rpx;
  202 + overflow: hidden;
  203 +}
  204 +
  205 +.percent {
  206 + position: absolute;
  207 + top: 0;
  208 + bottom: 0;
  209 + left: 0;
  210 + right: 0;
  211 + margin: auto;
  212 + color: white;
  213 +}
  214 +.tabbar {
  215 + position: fixed;
  216 + width: 100%;
  217 + bottom: 0;
  218 + background-color: white;
  219 +}
  220 +.tabbar:after {
  221 + position: absolute;
  222 + content: '';
  223 + width: 2rpx;
  224 + height: 50%;
  225 + top: 0;
  226 + bottom: 0;
  227 + left: 0;
  228 + right: 0;
  229 + margin: auto;
  230 + background-color: #f0f0f0;
  231 +}
  232 +.tabbar-item {
  233 + width: 50%;
  234 + text-align: center;
  235 + padding-top: 30rpx;
  236 + padding-bottom: 30rpx;
  237 +}
  238 +.tabbar-item .iconfont {
  239 + margin-right: 10rpx;
  240 +}
  241 +.tabbar-item.active {
  242 + color: #FE6867;
  243 +}
  244 +
  245 +
  246 +.group-type,
  247 +.group-num {
  248 + position: relative;
  249 + font-size: 22rpx;
  250 +}
  251 +.group-type:before,
  252 +.group-num:before {
  253 + font-family: iconfont;
  254 +}
  255 +.group-type:before {
  256 + content: '\e66a';
  257 + color: white;
  258 + background-color: #FE6867;
  259 + position: absolute;
  260 + left: 0;
  261 + top: 0;
  262 + bottom: 0;
  263 + padding-left: 6rpx;
  264 + padding-right: 10rpx;
  265 + line-height: 30rpx;
  266 +}
  267 +.group-num:before {
  268 + padding-right: 6rpx;
  269 +}
  270 +.group-num:before {
  271 + content: '\e694';
  272 + position: relative;
  273 +}
  274 +.group-num {
  275 + color: white;
  276 + background-color: #FE6867;
  277 + border-radius: 34rpx;
  278 + padding-left: 10rpx;
  279 + padding-right: 10rpx;
  280 + margin-right: 14rpx;
  281 +}
  282 +.group-type {
  283 + color: #FE6867;
  284 + border: 2rpx solid #FE6867;
  285 + padding-left: 42rpx;
  286 + padding-right: 4rpx;
  287 + border-radius: 6rpx;
  288 +}
  289 +
  290 +.badge {
  291 + color: white;
  292 + padding: 0 20rpx;
  293 + border-radius: 6rpx;
  294 + background-color: #FE6867;
  295 + margin-right: 10rpx;
  296 +}
  297 +
  298 +.subTab-title {
  299 + text-align: center;
  300 + justify-content: center;
  301 + align-items: center;
  302 + font-size: 28rpx;
  303 +}
  304 +.subTab-list {
  305 + padding: 20rpx;
  306 +}
  307 +.subTab-titleItem {
  308 + box-sizing: border-box;
  309 + width: calc(100% / 3);
  310 + padding: 20rpx 40rpx;
  311 + background-color: white;
  312 + border-right: 2rpx solid #f8f8f8;
  313 + flex: 1;
  314 +}
  315 +.subTab-titleItem:last-child {
  316 + border-right: none;
  317 +}
  318 +.subTab-titleItem.active {
  319 + background-color: #FE6867;
  320 + color: white;
  321 +}
  322 +.subTab-item {
  323 + padding: 20rpx;
  324 + border-bottom: 2rpx solid #f8f8f8;
  325 + background-color: white;
  326 + border-radius: 8rpx;
  327 + box-shadow: 0 8px 12px #e7e9eb;
  328 +}
  329 +.subTab-item ~ .subTab-item {
  330 + margin-top: 20rpx;
  331 +}
  332 +.pdv10 {
  333 + padding-top: 10rpx;
  334 + padding-bottom: 10rpx;
  335 +}
  336 +.pdv20 {
  337 + padding-top: 20rpx;
  338 + padding-bottom: 20rpx;
  339 +}
  340 +.pdb10 {
  341 + padding-bottom: 10rpx;
  342 +}
  343 +.pdb20 {
  344 + padding-bottom: 20rpx;
  345 +}
  346 +.bdr-b {
  347 + border-bottom: 2rpx solid #f8f8f8;
  348 +}
  349 +.dash-b {
  350 + border-bottom: 2rpx dashed #ddd;
  351 +}
  352 +.btn-container {
  353 + display: flex;
  354 + align-items: flex-end;
  355 + font-size: 26rpx;
  356 +}
  357 +
  358 +
  359 +/* .popup-container {
  360 + content:'';
  361 + position: fixed;
  362 + top: 0;
  363 + bottom: 0;
  364 + left: 0;
  365 + right: 0;
  366 + z-index: 3;
  367 + background-color: rgba(0,0,0,.6);
  368 + display: flex;
  369 + align-items: center;
  370 + justify-content: center;
  371 +}
  372 +.popup {
  373 + width: 90%;
  374 +}
  375 +.popup-content {
  376 + box-sizing: border-box;
  377 + width: 100%;
  378 + background-color: white;
  379 + padding: 0 20rpx;
  380 + border-radius: 10rpx;
  381 + max-height: 1038rpx;
  382 +}
  383 +.icon-close {
  384 + font-size: 60rpx;
  385 + color: white;
  386 +}
  387 +.popup-btn {
  388 + padding-top: 30rpx;
  389 +}
  390 +
  391 +.popup-title {
  392 + /* font-size: 28rpx; */
  393 + /* font-weight: bold;
  394 + padding: 20rpx 0;
  395 +}
  396 +.popup-title2 { */
  397 + /* padding: 10rpx 0; */
  398 + /* padding-bottom: 8rpx;
  399 +}
  400 +.popup-title3 {
  401 + padding-left: 34rpx;
  402 + font-size: 30rpx;
  403 +}
  404 +.popup-list {
  405 + max-height: 602rpx;
  406 + overflow-y: auto;
  407 +}
  408 +
  409 +
  410 +radio .wx-radio-input {
  411 + width: 28rpx;
  412 + height: 28rpx;
  413 +}
  414 +
  415 +
  416 +radio .wx-radio-input.wx-radio-input-checked {
  417 + background-color: #FE6867;
  418 + border-color: #FE6867;
  419 +}
  420 +radio .wx-radio-input.wx-radio-input-checked::before{
  421 + color: white;
  422 +}
  423 +
  424 +.popup-content.active {
  425 + max-height: 982rpx;
  426 + overflow: auto;
  427 +} */
  428 +
  429 +
  430 +
  431 +.coupons {
  432 + color: white;
  433 + position: relative;
  434 + padding: 28rpx 24rpx 28rpx 46rpx;
  435 +}
  436 +.coupons.bg-red {
  437 + background: #F2F2F2 radial-gradient(circle at 0px 50%, transparent 10px, #FF6768 0) top;
  438 +}
  439 +
  440 +
  441 +
  442 +
  443 +.coupons ~ .coupons {
  444 + margin-top: 20rpx;
  445 +}
  446 +
  447 +.coupon-hd {
  448 + word-break: break-all;
  449 + line-height: 1.4;
  450 +}
  451 +.coupon-md {
  452 + font-size: 26rpx;
  453 + position: relative;
  454 + padding-right: 200rpx;
  455 +}
  456 +.coupon-ft {
  457 + line-height: 1.4;
  458 +}
  459 +.price {
  460 + position: absolute;
  461 + right: 24rpx;
  462 +}
  463 +
  464 +.coupons .btn-share {
  465 + flex-shrink: 0;
  466 + border-radius: 30rpx;
  467 + padding: 8rpx 40rpx;
  468 + background-color: red;
  469 +}
  470 +
  471 +
  472 +.popup-container {
  473 + position: fixed;
  474 + left: 0;
  475 + top: 0;
  476 + width: 100%;
  477 + height: 100%;
  478 + background-color: rgba(0,0,0,.5);
  479 +}
  480 +.popup {
  481 + background-color: white;
  482 + border-radius: 16rpx;
  483 + position: absolute;
  484 + top: 50%;
  485 + left: 50%;
  486 + transform: translate(-50%, -50%);
  487 + width: 500rpx;
  488 + overflow: hidden;
  489 +}
  490 +.popup-img {
  491 + display: block;
  492 + width: 80rpx;
  493 + height: 80rpx;
  494 + margin-right: 20rpx;
  495 + flex-shrink: 0;
  496 +}
  497 +.popup-item {
  498 + display: flex;
  499 + align-items: center;
  500 + padding: 20rpx 90rpx;
  501 +}
  502 +.h70 {
  503 + height: 70rpx;
  504 +}
  505 +
  506 +.active {
  507 + background-color: #f2f2f2;
  508 +}
  509 +
  510 +
  511 +
  512 +
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -37,18 +37,31 @@ Page({
37 37 getGiftID: options.lbId,
38 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.user_id=first_leader;
  46 + getApp().getUserFir();
  47 + //调用接口判断是不是会员
  48 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
  49 + if(res.data.code==0){
  50 + getApp().globalData.guide_id=res.data.data.id;
  51 + }
  52 + })
  53 + }
40 54  
41 55 th.close();
42 56 },
43   - onShow: function() {
44   -
  57 +
  58 + onShow: function() {
45 59 //--先判断会员状态--
46 60 var user_info = getApp().globalData.userInfo;
47 61 if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
48 62 getApp().goto('/pages/togoin/togoin');
49 63 return false;
50 64 }
51   -
52 65 if (this.data.isBuy == 0) {
53 66 this.GetMyGiftList();
54 67 } else {
... ...
pages/index/index/index.js
... ... @@ -72,14 +72,26 @@ Page({
72 72 max_sw_height: 0, //banner的最大高度
73 73 is_disgraceful: 0, //是否显示新人广告
74 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.user_id=first_leader;
  86 + getApp().getUserFir();
  87 + //调用接口判断是不是会员
  88 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
  89 + if(res.data.code==0){
  90 + getApp().globalData.guide_id=res.data.data.id;
  91 + }
  92 + })
  93 + }
  94 +
83 95 //看一下商家是否开通了权益
84 96 //--初始化是否有打勾--
85 97 getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", {
... ... @@ -859,7 +871,14 @@ Page({
859 871 if(!url || url=='') return;
860 872 if(url[0]!='/') url='/'+url;
861 873 getApp().goto(url);
862   - }
  874 + },
  875 +
  876 + //----跳转到搭配购买----
  877 + go_test:function () {
  878 + wx.navigateTo({ url: "/packageA/pages/goods_share/goods_share", })
  879 + },
  880 +
  881 +
863 882  
864 883  
865 884  
... ...
pages/index/index/index.wxml
... ... @@ -3,6 +3,8 @@
3 3 <!--普通界面-->
4 4 <wxs module="filter" src="../../../utils/filter.wxs"></wxs>
5 5 <view class="container rel" wx:if="{{ishow}}">
  6 +
  7 +
6 8 <block wx:if="{{banner}}">
7 9 <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image>
8 10 </block>
... ... @@ -84,7 +86,7 @@
84 86 <view class="flex-vertical">
85 87 <image class="xc-hook" src="{{url}}/miniapp/images/index/youxuan.png">
86 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 90 </view>
89 91  
90 92  
... ...
pages/user/assistance/assistance.wxml
... ... @@ -17,7 +17,7 @@
17 17 <view class="excitation" style="color:{{font_color ? ('#'+font_color):'white'}};">机会总是留给最有行动力的人</view>
18 18 </view>
19 19 <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>
  20 + <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 21 </view>
22 22 <view wx:if="{{zl_act.beginDate && zl_act.endDate}}" class="flex-center fs26 time">
23 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>
... ...
pages/user/assistance/task_assistance.js
... ... @@ -21,6 +21,8 @@ Page({
21 21 endDate: "", //活动结束时间
22 22 activity_data: "25:20:59", //活动剩余时间
23 23 task_number: 0, //任务数
  24 + giftQty:0, //库存设置数
  25 +
24 26 is_task: 0, //历史记录与任务
25 27 aitem: "", //活动的轮播图数据
26 28 switch_head: 0, //0:我的任务,1:记录
... ... @@ -221,6 +223,7 @@ Page({
221 223 th.setData({
222 224 aitem: data_aissa,
223 225 task_number: task_number,
  226 + giftQty:giftQty,
224 227 });
225 228 th.go_to_task(th.data.taskid);
226 229  
... ... @@ -228,7 +231,7 @@ Page({
228 231 th.setData({
229 232 aitem: data_aissa,
230 233 task_number: task_number,
231   - taskid: taskid
  234 + taskid: taskid,
232 235 });
233 236 //判断是不是领取的任务
234 237 th.get_user_task();
... ...
pages/user/assistance/task_assistance.wxml
... ... @@ -46,7 +46,8 @@
46 46  
47 47 </view>
48 48 <view class="task-number fs28 t-c" style="color:{{font_color ? ('#'+font_color):'white'}};">
49   - 今天剩余可领{{task_number}}个任务
  49 + <text wx:if="{{giftQty}}">今天剩余可领{{task_number}}个任务</text>
  50 + <text wx:else>不限任务数量</text>
50 51 </view>
51 52  
52 53 <view wx:if="{{is_user_task==null}}" class="task_clike fs40 t-c flex-center" data-taskid="{{taskid}}" bindtap="add_onlicke"
... ...
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['我的服务']="11";
  15 + map['我的评价']="12";
  16 + map['我的礼包']="13";
  17 + var index=map[name];
  18 + //不包含,不关闭
  19 + if(c_list.indexOf(index)==-1) return 0;
  20 + //包含,就是关闭的
  21 + return 1
  22 +
  23 +}
  24 +
  25 +module.exports = {
  26 + is_close: is_close
  27 +}
... ...
pages/user/index/index.js
... ... @@ -57,24 +57,30 @@ Page({
57 57 /**
58 58 * 生命周期函数--监听页面加载
59 59 */
60   - onLoad: function(options) {
  60 + onLoad: function(options) {
61 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 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 72 data: {
65 73 enabled: 1
66 74 }
67 75 }).then(res => {
68 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 79 th.setData({ad_img:item.ad_code})
72 80 }
73   - })
74   -
  81 + })
75 82 app.getUserFir();
76   -
77   -
  83 +
78 84 },
79 85  
80 86 /**
... ... @@ -122,9 +128,7 @@ Page({
122 128 }
123 129 }
124 130 });
125   -
126   -
127   -
  131 +
128 132 /*-----统计-----*/
129 133 rq.get("/api/weshop/order/waitlist", {
130 134 data: {
... ... @@ -298,8 +302,10 @@ Page({
298 302 getApp().getConfig2(function(e) {
299 303 var t_swi = e.switch_list;
300 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 1 <!-- <import src="../../tabbar/tabbar.wxml" />
2 2 <template is="tabBar" data="{{tabBar}}" /> -->
3   -
  3 +<wxs src="filter.wxs" module="util"></wxs>
4 4 <view class="xc-page" style="margin-bottom:{{isIpx ? '168rpx' : '100rpx'}}">
5 5 <view class="xc-user">
6 6 <view class="xc-head rel">
... ... @@ -199,73 +199,59 @@
199 199 <view class="xc-project-frame">
200 200 <!-- 跳转页面 -->
201 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:else>
  221 + <view class="item t-c" data-url="{{item.weappurl}}" bindtap="goto_nav">
  222 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  223 + <view class="fs26">{{item.name}}</view>
  224 + </view>
  225 + </block>
  226 + </block>
  227 + <!-- 没有链接地址的时候 -->
  228 + <block wx:else>
  229 + <block wx:if="{{item.name=='我的权益'}}">
  230 + <view class="item t-c" bindtap="go_qy" wx:if="{{qy_list!=null && is_init && gradeId}}">
  231 + <image class="xc-center-img " src="{{iurl+item.icoimg}}"></image>
  232 + <view class="fs26">我的权益</view>
  233 + </view>
  234 + </block>
  235 + <block wx:elif="{{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 255 </view>
270 256  
271 257 </view>
... ...
pages/user/plus/plus.js
... ... @@ -245,7 +245,11 @@ Page({
245 245 {data: {storeId: os.stoid}}).then(res => {
246 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 253 var item = th.data.is_plusCard[th.data.by_index];
250 254 var req = {};
251 255 req.cardId = item.CardId;
... ...