Commit 3b2ffe8fe21526513264b01d1e26472ab10f7707

Authored by yvan.ni
2 parents f2daf8fd 2a8fd16f

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

packageA/pages/cardDetails/cardDetails.js
1 // pages/i_service/cardDetails/cardDetails.js 1 // pages/i_service/cardDetails/cardDetails.js
  2 +const app = getApp();
  3 +let self = null;
  4 +
2 Page({ 5 Page({
3 6
4 /** 7 /**
5 * 页面的初始数据 8 * 页面的初始数据
6 */ 9 */
7 data: { 10 data: {
8 -  
9 }, 11 },
10 12
11 /** 13 /**
12 * 生命周期函数--监听页面加载 14 * 生命周期函数--监听页面加载
13 */ 15 */
14 onLoad: function (options) { 16 onLoad: function (options) {
15 - 17 + self = this;
  18 + this.data.options = options;
  19 + // this.setData({
  20 + // options,
  21 + // });
  22 + app.isLogin().then(function(data) {//进入页面前已经授权登录成功
  23 + self.setData({
  24 + userInfo: data,
  25 + imghost: app.globalData.setting.imghost,
  26 + });
  27 + });
  28 +
16 }, 29 },
17 30
18 /** 31 /**
@@ -26,7 +39,26 @@ Page({ @@ -26,7 +39,26 @@ Page({
26 * 生命周期函数--监听页面显示 39 * 生命周期函数--监听页面显示
27 */ 40 */
28 onShow: function () { 41 onShow: function () {
29 - 42 + if(app.globalData.userInfo) {
  43 + if(!this.data.isLogin) {
  44 + this.setData({
  45 + userInfo: app.globalData.userInfo,
  46 + imghost: app.globalData.setting.imghost,
  47 + isLogin: true,
  48 + });
  49 +
  50 + app.request.get("/api/weshop/serviceCard/get/" + app.globalData.setting.stoid + '/' + this.data.options.id, {
  51 + isShowLoading: false,
  52 + success: function(res) {
  53 + self.setData({
  54 + details: res.data.data
  55 + });
  56 + },
  57 + });
  58 +
  59 +
  60 + };
  61 + };
30 }, 62 },
31 63
32 /** 64 /**
packageA/pages/cardDetails/cardDetails.wxml
1 <view class="page"> 1 <view class="page">
2 <view> 2 <view>
3 - <image class="image" src=""/> 3 + <image class="image" src="{{imghost + details.imgUrl}}" mode="aspectFit"/>
4 </view> 4 </view>
5 <view class="bg-white"> 5 <view class="bg-white">
6 - <view class="price pd20 fs30">3000</view>  
7 - <view class="fs28 pdh20"><text class="ellipsis-2 lh1-4">服务卡项名称服务卡项名称服务卡项名称服务卡称服务卡项名称服务卡称服务卡项名称服务卡称服务卡项名称服务卡项名称服务卡项名称服务卡项名称服务卡项名称</text></view> 6 + <view class="price pd20 fs30">{{details.money}}</view>
  7 + <view class="fs28 pdh20"><text class="ellipsis-2 lh1-4">{{details.serviceName}}</text></view>
8 <view class="flex jc_sb fs24 pdh20 pdv30 c7b"> 8 <view class="flex jc_sb fs24 pdh20 pdv30 c7b">
9 - <view>时长:30分钟</view>  
10 - <view>次数:10次</view>  
11 - <view>有效天数:365天</view> 9 + <!-- <view>时长:30分钟</view>
  10 + <view>次数:10次</view> -->
  11 + <view>有效天数:{{details.validDays}}天</view>
12 </view> 12 </view>
13 </view> 13 </view>
14 <!-- 详情 --> 14 <!-- 详情 -->
15 - <view>  
16 - <view class="t-c pd20 line c7b"><text class="title">详情</text></view>  
17 - <view>  
18 - <images class="image"/>  
19 - </view> 15 + <view class="bg-white">
  16 + <view class="t-c pd20 c7b"><text class="title">—— 详情 ——</text></view>
  17 + <view class="pd20">{{details.serviceContent}}</view>
20 </view> 18 </view>
21 </view> 19 </view>
packageA/pages/cardDetails/cardDetails.wxss
@@ -10,7 +10,6 @@ page { @@ -10,7 +10,6 @@ page {
10 .image { 10 .image {
11 width: 100%; 11 width: 100%;
12 display: block; 12 display: block;
13 - background-color: pink;  
14 } 13 }
15 14
16 .price { 15 .price {
@@ -40,6 +39,5 @@ page { @@ -40,6 +39,5 @@ page {
40 } 39 }
41 40
42 .title { 41 .title {
43 - background-color: #f2f2f2;  
44 padding: 10rpx; 42 padding: 10rpx;
45 } 43 }
46 \ No newline at end of file 44 \ No newline at end of file
packageA/pages/service_share/g_filter.wxs 0 → 100644
  1 +var g_filters = {
  2 + //-- 判断是不是有等级价 --
  3 + is_has_rank:function(rank_switch,item){
  4 + if(!rank_switch) return false;
  5 + if(item.cardprice1 || item.cardprice2 || item.cardprice3) {return true}
  6 + return false;
  7 + },
  8 +
  9 + //-- 判断,不是等级会员时候,要显示的最低等级价和名称 --
  10 + get_card_price:function(goods,all_card,type){
  11 + var price1=parseFloat(goods['cardprice1']);
  12 + var price2=parseFloat(goods['cardprice2']);
  13 + var price3=parseFloat(goods['cardprice3']);
  14 + if(!all_card){
  15 + if(type==0) return 0;
  16 + return "";
  17 + }
  18 +
  19 + var arr=[];
  20 + var min_price= 0;
  21 + var min_name="";
  22 +
  23 + var min_price=null;
  24 + var min_name=null;
  25 + //---设置对应的价格名字----
  26 + for(var i=0;i<3;i++) {
  27 + var vl=all_card[i];
  28 + if(!vl) continue;
  29 + if(vl['CorrPrice']=="Price1" && price1>0)
  30 + {
  31 + if(min_price==null) {
  32 + min_price=price1;min_name=vl['CardName'];
  33 + }
  34 + else if(price1<min_price) {
  35 + min_price=price1;min_name=vl['CardName'];
  36 + }
  37 + }
  38 + if(vl['CorrPrice']=="Price2" && price2>0)
  39 + {
  40 + if(min_price==null) {
  41 + min_price=price2;min_name=vl['CardName'];
  42 + }
  43 + else if(price2<min_price) {
  44 + min_price=price2;min_name=vl['CardName'];
  45 + }
  46 + }
  47 +
  48 + if(vl['CorrPrice']=="Price3" && price3>0)
  49 + {
  50 + if(min_price==null) {
  51 + min_price=price3;min_name=vl['CardName'];
  52 + }
  53 + else if(price3<min_price) {
  54 + min_price=price3;min_name=vl['CardName'];
  55 + }
  56 + }
  57 +
  58 + }
  59 + if(min_price==null){
  60 + if(type==0) return 0;
  61 + return "";
  62 + }
  63 +
  64 + //if(type==0) return arr.length;
  65 + //--进行排序,升序---
  66 + /*---
  67 + arr.sort(function(a,b){
  68 + if (a.price < b.price) {
  69 + return -1;
  70 + } else if (a.fee == b.fee) {
  71 + return 0;
  72 + } else {
  73 + return 1;
  74 + }
  75 + })--*/
  76 + //-- 获取最下价钱,和相应的卡的名称 --
  77 + if(type==0) return min_price.toFixed(2);
  78 + if(min_name.length>4) min_name=min_name.substring(0, 8);
  79 + return min_name;
  80 + },
  81 +}
  82 +module.exports = {
  83 + is_has_rank:g_filters.is_has_rank,
  84 + get_card_price:g_filters.get_card_price,
  85 +}
0 \ No newline at end of file 86 \ No newline at end of file
packageA/pages/service_share/service_share.js
1 -// packageA//pages/service_share/service_share.js 1 +// packageA//pages/goods_share/goods_share.js
  2 +var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js");
2 Page({ 3 Page({
3 -  
4 /** 4 /**
5 * 页面的初始数据 5 * 页面的初始数据
6 */ 6 */
7 data: { 7 data: {
8 - 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 //--- 要分享的商品 ---
9 }, 28 },
10 -  
11 /** 29 /**
12 * 生命周期函数--监听页面加载 30 * 生命周期函数--监听页面加载
13 */ 31 */
14 onLoad: function (options) { 32 onLoad: function (options) {
15 -  
16 - },  
17 -  
18 - /**  
19 - * 生命周期函数--监听页面初次渲染完成  
20 - */  
21 - onReady: function () {  
22 - 33 + var th=this;
  34 + //接受有没有导购的参数
  35 + var first_leader=options.first_leader;
  36 + var StaffId=options.StaffId;
  37 + var StorageId=options.StorageId;
  38 + if(first_leader){
  39 + //-- user_id代过来免登录 --
  40 + getApp().globalData.user_id=first_leader;
  41 + getApp().getUserFir();
  42 +
  43 + //设置分享会员和导购id和归属门店ID
  44 + this.setData({first_leader:first_leader,StaffId:StaffId,StorageId:StorageId});
  45 + }
  46 + this.requestGoodsList();
  47 +
  48 + //-- 自定义海报 --
  49 + getApp().request.promiseGet("/api/weshop/goods/poster/page",{
  50 + data:{store_id:os.stoid, type:1, is_use:1 }
  51 + }).then(res=>{
  52 + if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0] ){
  53 +
  54 + var poster_data=res.data.data.pageData[0];
  55 + var json_str=poster_data.jsonStr;
  56 +
  57 + if(json_str){
  58 + var json_data=JSON.parse(json_str);
  59 + if(json_data.bg_img){
  60 +
  61 + //-- 把图片那到本地 --
  62 + wx.getImageInfo({
  63 + src:json_data.bg_img,
  64 + success: function(res) {
  65 + var path= res.path;
  66 + th.setData({share_b_img:path})
  67 + },
  68 + fail: function(res) {}
  69 + });
  70 + }
  71 +
  72 + th.setData({poster:json_data})
  73 +
  74 + }
  75 + }
  76 + })
  77 +
  78 + //获取分销的配置
  79 + getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{
  80 + if(res.data.code==0){
  81 + th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern});
  82 + }
  83 + });
  84 + //获取用户设备信息,屏幕宽度
  85 + wx.getSystemInfo({
  86 + success: res => {
  87 + th.setData({
  88 + screenWidth: res.screenWidth
  89 + })
  90 + }
  91 + });
  92 +
23 }, 93 },
24 94
25 - /**  
26 - * 生命周期函数--监听页面显示  
27 - */ 95 + /*** 生命周期函数--监听页面显示***/
28 onShow: function () { 96 onShow: function () {
29 - 97 + var th=this;
  98 + getApp().getConfig2(function(rs){
  99 + //计算等级价相关
  100 + var swithc_list=rs.switch_list;
  101 + var sw_arr=JSON.parse(swithc_list);
  102 + //---如果后台又开等级卡的开关---
  103 + if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){
  104 + th.setData({rank_switch:true});
  105 + var user=getApp().globalData.userInfo;
  106 +
  107 + //---回调卡的列表---
  108 + th.getPlusCardType(function(ob){
  109 + th.setData({card_list:ob.card_list});
  110 +
  111 + var ti=setInterval(function(){
  112 + if(!user) return false;
  113 + clearInterval(ti);
  114 +
  115 + if(user.card_field && user['card_expiredate']){
  116 + var str = user['card_expiredate'].replace(/-/g, '/');
  117 + var end = new Date(str);
  118 + end = Date.parse(end) / 1000;
  119 + var now = ut.gettimestamp();
  120 + //--- 判断是等级会员,且在有效期范围内 ---
  121 + if(user.card_field && now<end){
  122 + var card_name=ob.name_map.get(user.card_field);
  123 + // if(card_name.length>4) card_name=card_name.substring(0,4);
  124 + th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list});
  125 + }
  126 + }
  127 + },1000)
  128 + })
  129 +
  130 + }
  131 + });
30 }, 132 },
31 133
32 /** 134 /**
33 * 生命周期函数--监听页面隐藏 135 * 生命周期函数--监听页面隐藏
34 */ 136 */
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 - /** 137 + onHide: function () {},
  138 + /**e
61 * 用户点击右上角分享 139 * 用户点击右上角分享
62 */ 140 */
63 onShareAppMessage: function () { 141 onShareAppMessage: function () {
  142 + var th = this;
  143 + var item=this.data.share_good;
  144 + var price = item.money;
  145 + var title= item.serviceName;
  146 + var img=this.data.url+item.original_img;
  147 +
  148 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;
  149 + if(getApp().globalData.user_id){
  150 + url+="&first_leader="+getApp().globalData.user_id;
  151 + }
  152 + var ob={
  153 + title: price + "元 " +title,
  154 + path:url,
  155 + imageUrl: img,
  156 + };
  157 + th.setData({share_hidden:1});
  158 + th.insert_goods_share();
  159 + return ob;
  160 +
  161 + },
  162 +
  163 + // 点击价格排序
  164 + sort1() {
  165 + if(this.data.active2) {
  166 + this.setData({
  167 + active2: !this.data.active2
  168 + });
  169 + };
  170 + if(this.data.orderField!="shop_price"){
  171 + this.setData({
  172 + active1: 1,orderField:'shop_price',orderType:'asc',is_no_data:0,is_no_more:0,list:[],
  173 + });
  174 + }else{
  175 +
  176 + var ty=this.data.orderType=='asc'?'desc':'asc';
  177 + this.setData({
  178 + orderType:ty,is_no_data:0,is_no_more:0,list:[],
  179 + });
  180 + }
  181 + this.data.is_load=0;
  182 + this.data.currentPage=1;
  183 + this.requestGoodsList();
  184 +
  185 + },
  186 + // 点击佣金排序
  187 + sort2() {
  188 + if(this.data.active1) {
  189 + this.setData({
  190 + active1: !this.data.active1
  191 + });
  192 + };
  193 + if(this.data.orderField!="commission"){
  194 +
  195 + if(this.data.pattern==0){
  196 + this.setData({
  197 + active2: 1,orderField:'commission',orderType:'asc',is_no_data:0,is_no_more:0,list:[],
  198 + });
  199 + }else{
  200 + this.setData({
  201 + active2: 1,orderField:'(fir_rate+sec_rate+thi_rate)',orderType:'asc',is_no_data:0,is_no_more:0,list:[],
  202 + });
  203 + }
  204 +
  205 +
  206 + }else{
  207 + this.setData({
  208 + orderType: (this.data.orderType=='asc'?'desc':'asc'),is_no_data:0,is_no_more:0,list:[],
  209 + });
  210 + }
  211 + this.data.is_load=0;
  212 + this.data.currentPage=1;
  213 + this.requestGoodsList();
  214 + },
  215 +
  216 + //-- ----销量----
  217 + sale_sort(){
  218 + if(this.data.orderField!="sales_sum"){
  219 + this.setData({
  220 + active1: 0,active2:0,orderType:'desc',is_no_data:0,is_no_more:0,orderField:'sales_sum',list:[],
  221 + });
  222 + this.data.is_load=0;
  223 + this.data.currentPage=1;
  224 + this.requestGoodsList();
  225 + }
  226 + },
  227 +
  228 + //-- ---最新---
  229 + new_sort:function(){
  230 + if(this.data.orderField!="is_new"){
  231 + this.setData({
  232 + active1: 0,active2:0,orderType:'desc',is_no_data:0,is_no_more:0,orderField:'is_new',list:[],
  233 + });
  234 + this.data.is_load=0;
  235 + this.data.currentPage=1;
  236 + this.requestGoodsList();
  237 + }
  238 + },
  239 +
  240 + requestGoodsList:function(){
  241 + var th=this;
  242 + if(th.data.is_load) return false; //-- 正在加载
  243 + if(th.data.is_no_data) return false; //-- 没有数据
  244 + if(th.data.is_no_more) return false; //-- 没有更多
  245 + th.data.is_load=1;
  246 +
  247 + var url="/api/weshop/serviceCard/page";
  248 + var req_data={
  249 + page:this.data.currentPage,
  250 + is_mainshow:1,
  251 + isonsale:1,
  252 + store_id:oo.stoid,
  253 + orderField:this.data.orderField,
  254 + orderType:this.data.orderType,
  255 + }
  256 + if(this.data.key_str && this.data.key_str.trim()){
  257 + var str=this.data.key_str.trim();
  258 + req_data.key_str=str;
  259 + }
  260 + //-- ---调用接口----
  261 + app.request.promiseGet(url,{data:req_data,isShowLoading:1}).then(res=>{
  262 + th.data.is_load=0;
  263 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
  264 + th.data.currentPage++;
  265 + var data=res.data.data.pageData;
  266 + if(res.data.data.page*10>res.data.data.total){th.setData({is_no_more:1});}
  267 + var list=th.data.list;
  268 + list=list.concat(data);
  269 + th.setData({list:list});
  270 + }else{
  271 + if(th.data.currentPage==1){
  272 + th.setData({is_no_data:1});
  273 + }
  274 + }
  275 + })
  276 + },
  277 +
  278 +
  279 + //--- 获取卡类列表 ---
  280 + getPlusCardType: function (func) {
  281 + var storid = oo.stoid;
  282 + var th = this;
  283 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
  284 +
  285 + if(res.data.code!=0 || !res.data.data){
  286 + var ob={"card_list":[],"name_map":''};
  287 + func(ob);
  288 + return false;
  289 + }
64 290
65 - } 291 + var plusCard = res.data.data;
  292 + var arr = [1219, 2089, 3031];
  293 + var new_arr = new Array();
  294 + var card_name_map=new Map();
  295 + var user = getApp().globalData.userInfo;
  296 + for (var i = 0; i < plusCard.length; i++) {
  297 + if ((!user || user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
  298 + continue;
  299 + }
  300 + var name="card"+plusCard[i].CorrPrice.toLowerCase();
  301 + card_name_map.set(name,plusCard[i].CardName);
  302 + new_arr.push(plusCard[i]);
  303 + }
  304 +
  305 + var ob={"card_list":new_arr,"name_map":card_name_map};
  306 + func(ob);
  307 + })
  308 + },
  309 +
  310 +
  311 + //---图片失败,默认图片---
  312 + bind_bnerr2: function (e) {
  313 + var _errImg = e.target.dataset.errorimg;
  314 + var _errObj = {};
  315 + _errObj[_errImg] ="/miniapp/images/default_g_img.gif";
  316 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  317 + },
  318 + //-- ---更多加载----
  319 + refresh:function(){
  320 + this.requestGoodsList();
  321 + },
  322 +
  323 + //--定义的保存图片方法,分享团---
  324 + saveImageToPhotosAlbum: function() {
  325 + //--先判断会员状态--
  326 + var user_info = getApp().globalData.userInfo;
  327 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  328 + //getApp().my_warnning("请先登录",0,this);
  329 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  330 + return false;
  331 + }
  332 + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
  333 + var type = 0;
  334 + wx.showLoading({
  335 + title: '生成中...',
  336 + })
  337 + var that = this, th = that;
  338 + //设置画板显示,才能开始绘图
  339 + that.setData({
  340 + canvasHidden: false,share_hidden:1
  341 + })
  342 +
  343 + //点击分享
  344 + this.insert_goods_share();
  345 +
  346 + var app = getApp();
  347 + var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  348 + var scene = th.data.share_good.goods_id+"";
  349 + var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
  350 + if(user_id>0){
  351 + scene+="_"+user_id;
  352 + }
  353 +
  354 + ///二微码
  355 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  356 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo";
  357 +
  358 + //读取文件成功则OK--
  359 + wx.getImageInfo({
  360 + src: path3,
  361 + success: function(res) {
  362 + //回调写法
  363 + th.get_head_temp(th.get_goods_temp, function() {
  364 + var vpath = res.path;
  365 + var context = wx.createCanvasContext('share');
  366 + //先画背景
  367 + var pg_path = "../../../images/share/share_bg.png";
  368 + // var pg_path = "../../../images/share/share_bg.png";
  369 +
  370 + //-- 如果有自定义海报的时候,判断背景的图片 --
  371 + if(th.data.share_b_img){
  372 + pg_path=th.data.share_b_img;
  373 + }
  374 + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
  375 +
  376 + //-- 是自定义海报的情况下 --
  377 + if(th.data.poster && parseInt(th.data.poster.style)==2){
  378 + //在线上分享人的情况下
  379 + if(parseInt(th.data.poster.show_headpic)){
  380 + //获取坐标
  381 + var x=parseFloat(th.data.poster.head_x)*2;
  382 + var y=parseFloat(th.data.poster.head_y)*2;
  383 + var x1=(x+90) *unit;
  384 + var y1=(y+50) *unit;
  385 + //--昵称---
  386 + context.setFontSize(24 * unit)
  387 + context.setFillStyle("black")
  388 + context.fillText(app.globalData.userInfo.nickname, x1, y1);
  389 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
  390 + //强烈推荐 改许程
  391 + var tj_path = "../../../images/share/q_tj.png";
  392 + context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
  393 + context.setFontSize(16 * unit)
  394 + context.setLineJoin('round'); //交点设置成圆角
  395 + context.setFillStyle("white")
  396 + context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);
  397 + }
  398 + }else{
  399 + //--昵称---
  400 + context.setFontSize(24 * unit)
  401 + context.setFillStyle("black")
  402 + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
  403 + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
  404 + //强烈推荐 改许程
  405 + var tj_path = "../../../images/share/q_tj.png";
  406 + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit);
  407 + context.setFontSize(16 * unit)
  408 + context.setLineJoin('round'); //交点设置成圆角
  409 + context.setFillStyle("white")
  410 + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit);
  411 + }
  412 +
  413 +
  414 + //---产品名称---
  415 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  416 + context.setFillStyle("black");
  417 + context.setFontSize(21.3 * unit)
  418 + // th.draw_Text(context, th.data.share_good.goods_name,
  419 + th.draw_Text(context, th.data.share_good.serviceName,
  420 + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
  421 + //------产品的价格-------
  422 + context.setFontSize(23 * unit)
  423 + context.setFillStyle("red")
  424 + context.fillText("¥", 416 * unit, 185 * unit);
  425 + context.setFontSize(31 * unit)
  426 + var pri0 = th.data.share_good.money;
  427 + // var pri0 = th.data.share_good.shop_price;
  428 + if (th.data.prom_act)
  429 + pri0 = th.data.prom_act.price;
  430 +
  431 + pri0 = parseFloat(pri0).toFixed(2);
  432 + context.fillText(pri0, 438 * unit, 185 * unit);
  433 + //---市场价划掉---
  434 + // sty:这里不需要
  435 + // context.setFillStyle("gray")
  436 + // context.setFontSize(22 * unit)
  437 + // context.fillText("¥" + th.data.share_good.market_price, 426 * unit, 213 * unit);
  438 + // context.setStrokeStyle('gray')
  439 + // context.setLineWidth(1 * unit)
  440 + // context.moveTo(426 * unit, 206 * unit)
  441 + // context.lineTo(510 * unit, 206 * unit)
  442 + // context.stroke();
  443 +
  444 + //---中间大图---
  445 + context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
  446 + //-------大图后面就不一样了-----------
  447 + switch (type) {
  448 + case 0: //普通商品的展示
  449 + //中间的几个字
  450 + if(th.data.poster && parseInt(th.data.poster.style)==2 ){
  451 + if(parseInt(th.data.poster.show_quality)){
  452 + var g_path = "../../../images/share/s_gou.png";
  453 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  454 + context.setFillStyle("red")
  455 + context.setFontSize(18 * unit)
  456 + context.fillText("正品保证", 84 * unit, 690 * unit);
  457 +
  458 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  459 + context.setFillStyle("red")
  460 + context.setFontSize(18 * unit)
  461 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  462 +
  463 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  464 + context.setFillStyle("red")
  465 + context.setFontSize(18 * unit)
  466 + context.fillText("官方验证", 420 * unit, 690 * unit);
  467 + }
  468 +
  469 + }else{
  470 + var g_path = "../../../images/share/s_gou.png";
  471 + context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit);
  472 + context.setFillStyle("red")
  473 + context.setFontSize(18 * unit)
  474 + context.fillText("正品保证", 84 * unit, 690 * unit);
  475 +
  476 + context.drawImage(g_path, 218 * unit, 670 * unit, 22 * unit, 22 * unit);
  477 + context.setFillStyle("red")
  478 + context.setFontSize(18 * unit)
  479 + context.fillText("纯实体店", 246 * unit, 690 * unit);
  480 +
  481 + context.drawImage(g_path, 388 * unit, 670 * unit, 22 * unit, 22 * unit);
  482 + context.setFillStyle("red")
  483 + context.setFontSize(18 * unit)
  484 + context.fillText("官方验证", 420 * unit, 690 * unit);
  485 + }
  486 +
  487 + //---画线---
  488 + context.setLineWidth(1 * unit)
  489 + context.moveTo(32 * unit, 710 * unit)
  490 + context.lineTo(520 * unit, 710 * unit)
  491 + context.stroke();
  492 + //---文字---
  493 + context.setFillStyle("black")
  494 + context.setFontSize(22 * unit)
  495 + // 原来start --->
  496 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
  497 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
  498 +
  499 + //---二维吗图---
  500 + //-- 自定义海报 --
  501 + if(th.data.poster){
  502 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  503 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  504 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  505 + }else{
  506 + //---二维吗图---
  507 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  508 + }
  509 +
  510 + break;
  511 + case 1: //秒杀商品的展示
  512 + //---画线---
  513 + context.setLineWidth(1 * unit)
  514 + context.moveTo(32 * unit, 670 * unit)
  515 + context.lineTo(520 * unit, 670 * unit)
  516 + context.stroke();
  517 +
  518 + //画秒杀的图片
  519 + var miaos_path = '../../../images/share/miao_share.png';
  520 + context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit);
  521 +
  522 + //---文字---
  523 + context.setFontSize(22 * unit)
  524 + context.setFillStyle("black")
  525 + context.fillText("特惠好物,限时秒杀", 40 * unit, 806 * unit);
  526 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 846 * unit);
  527 + //---二维吗图---
  528 + //-- 自定义海报 --
  529 + if(th.data.poster){
  530 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  531 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  532 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  533 + }else{
  534 + //---二维吗图---
  535 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  536 + }
  537 +
  538 +
  539 + break;
  540 +
  541 + case 2: //会员团和商家团的展示
  542 + //---画线---
  543 + context.setLineWidth(1 * unit)
  544 + context.moveTo(32 * unit, 670 * unit)
  545 + context.lineTo(520 * unit, 670 * unit)
  546 + context.stroke();
  547 + //---文字---
  548 + context.setFontSize(22 * unit)
  549 + context.font = 'normal bold';
  550 + context.setFillStyle("black")
  551 + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
  552 +
  553 + //绘制成团图片
  554 + var ct_img = "../../../images/share/ct_num.png";
  555 + context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
  556 + var ct_num = th.data.prom_act.ct_num;
  557 + context.setFontSize(14 * unit)
  558 + context.font = 'normal';
  559 + context.setFillStyle("red")
  560 + if (ct_num < 10) {
  561 + context.fillText(ct_num + "人拼团", 92 * unit, 760 * unit);
  562 + } else {
  563 + context.fillText(ct_num + "人拼团", 86 * unit, 760 * unit);
  564 + }
  565 + context.setFontSize(22 * unit)
  566 + context.fillText("已拼" + th.data.prom_act.buy_num + "份", 166 * unit, 763 * unit);
  567 + context.setFillStyle("gray")
  568 + context.fillText("快来和我一起拼团吧!", 40 * unit, 826 * unit);
  569 + context.setFillStyle("black")
  570 + context.font = 'normal bold 18px sans-serif';
  571 + context.setFontSize(21.3 * unit)
  572 + context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
  573 + //---二维吗图---
  574 + //-- 自定义海报 --
  575 + if(th.data.poster){
  576 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  577 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  578 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  579 + }else{
  580 + //---二维吗图---
  581 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  582 + }
  583 + break
  584 + case 3: //阶梯团的展示
  585 + //---画线---
  586 + context.setLineWidth(1 * unit)
  587 + context.moveTo(32 * unit, 670 * unit)
  588 + context.lineTo(520 * unit, 670 * unit)
  589 + context.stroke();
  590 + //---文字---
  591 + context.setFontSize(22 * unit)
  592 + context.font = 'normal bold';
  593 + context.setFillStyle("black")
  594 + context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
  595 + //---绘制中间阶梯的价格---
  596 + var list = th.data.prom_act.ct_rylist;
  597 + for (var i = 0; i < list.length; i++) {
  598 + var item = list[i];
  599 + var wi = i * 90 * unit;
  600 + context.font = 'normal';
  601 + context.setFontSize(16 * unit)
  602 + context.setFillStyle("red")
  603 + context.fillText("¥", 40 * unit + wi, 756 * unit);
  604 + context.setFontSize(22 * unit)
  605 + var pri = parseFloat(item.price).toFixed(2);
  606 + context.fillText(pri, 56 * unit + wi, 756 * unit);
  607 + context.setFillStyle("gray")
  608 + context.fillText("满" + item.rynum + "人", 40 * unit + wi, 786 * unit);
  609 + }
  610 + //----------------下面部分----------------
  611 + context.setFillStyle("gray")
  612 + context.fillText("快来和我一起拼团吧!", 40 * unit, 830 * unit);
  613 + context.setFillStyle("black")
  614 + context.font = 'normal bold 18px sans-serif';
  615 + context.setFontSize(22 * unit)
  616 + context.fillText("长按识别二维码,立即参团", 40 * unit, 860 * unit);
  617 +
  618 + //-- 自定义海报 --
  619 + if(th.data.poster){
  620 + var erm_x= parseFloat(th.data.poster.ewm_x)*2;
  621 + var erm_y= parseFloat(th.data.poster.ewm_y)*2;
  622 + context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
  623 + }else{
  624 + //---二维吗图---
  625 + context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  626 + }
  627 + break
  628 + }
  629 +
  630 +
  631 + //--- 如果是自定义海报的时候 ---
  632 + if(th.data.poster && parseInt(th.data.poster.style)==2){
  633 + //如果显示会员信息的话
  634 + if(parseInt(th.data.poster.show_headpic)){
  635 + //获取坐标
  636 + var x= parseFloat(th.data.poster.head_x)*2;
  637 + var y=parseFloat(th.data.poster.head_y)*2;
  638 + //---绘制圆形要放在最后----
  639 + context.save();
  640 + context.beginPath();
  641 + var h_x = x* unit;
  642 + var h_y = y * unit;
  643 + var h_r = 40 * unit;
  644 + var cx = h_x + h_r;
  645 + var cy = h_y + h_r;
  646 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  647 + context.closePath();
  648 + context.fill();
  649 + context.clip();
  650 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  651 + context.restore();
  652 + }
  653 +
  654 + }else{
  655 + //---绘制圆形要放在最后----
  656 + context.save();
  657 + context.beginPath();
  658 + var h_x = 60 * unit;
  659 + var h_y = 24 * unit;
  660 + var h_r = 40 * unit;
  661 + var cx = h_x + h_r;
  662 + var cy = h_y + h_r;
  663 + context.arc(cx, cy, h_r, 0, Math.PI * 2, false);
  664 + context.closePath();
  665 + context.fill();
  666 + context.clip();
  667 + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2);
  668 + context.restore();
  669 + }
  670 +
  671 +
  672 + //把画板内容绘制成图片,并回调 画板图片路径
  673 + context.draw(false, function() {
  674 + setTimeout(function() {
  675 + wx.canvasToTempFilePath({
  676 + x: 0,
  677 + y: 0,
  678 + width: 750,
  679 + height: 1217,
  680 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  681 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  682 + canvasId: 'share',
  683 + success: function(res) {
  684 + that.setData({
  685 + shareImgPath: res.tempFilePath,
  686 + canvasHidden: true
  687 + })
  688 + if (!res.tempFilePath) {
  689 + wx.showModal({
  690 + title: '提示',
  691 + content: '图片绘制中,请稍后重试',
  692 + showCancel: false
  693 + })
  694 + return false;
  695 + }
  696 + wx.previewImage({
  697 + //将图片预览出来
  698 + urls: [that.data.shareImgPath]
  699 + });
  700 + wx.hideLoading();
  701 + }
  702 + })
  703 + }, 500)
  704 +
  705 + });
  706 + });
  707 + }
  708 + });
  709 +
  710 + },
  711 +
  712 + //点击分享商品
  713 + share_good:function(e){
  714 + //--先判断会员状态--
  715 + var user_info = getApp().globalData.userInfo;
  716 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  717 + //getApp().my_warnning("请先登录",0,this);
  718 + wx.navigateTo({ url: '/pages/togoin/togoin', })
  719 + return false;
  720 + }
  721 +
  722 + var index=e.currentTarget.dataset.index;
  723 + var item=this.data.list[index];
  724 + this.setData({share_hidden:0,share_good:item});
  725 + },
  726 +
  727 + cancel:function(){
  728 + this.setData({share_hidden:1});
  729 + },
  730 +
  731 + //--获取头像的本地缓存,回调写法--
  732 + get_head_temp: function(tt, func) {
  733 + var ee = this;
  734 + if (ee.data.share_head) {
  735 + tt(func);
  736 + return false;
  737 + }
  738 + //---获取分享图片的本地地址,头像和商品图片----
  739 + var path2 = getApp().globalData.userInfo.head_pic;
  740 + if (path2 == "") {
  741 + ee.data.share_head = "../../../images/share/hui_hear_pic.png";
  742 + tt(func);
  743 + } else {
  744 + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
  745 + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn");
  746 + wx.getImageInfo({
  747 + src: path2,
  748 + success: function(res) {
  749 + //res.path是网络图片的本地地址
  750 + ee.data.share_head = res.path;
  751 + tt(func);
  752 + },
  753 + fail: function(res) {
  754 + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的
  755 + tt(func);
  756 + }
  757 + });
  758 + }
  759 + },
  760 + //--获取商品图片的本地缓存,回调写法--
  761 + get_goods_temp: function(tt) {
  762 + var ee = this;
  763 + //获取商品是分享图信息
  764 + wx.getImageInfo({
  765 + src: ee.data.url+ee.data.share_good.original_img,
  766 + success: function(res) {
  767 + //res.path是网络图片的本地地址
  768 + ee.data.share_goods_img = res.path;
  769 + tt();
  770 + },
  771 + fail: function(res) {
  772 + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的
  773 + tt();
  774 + }
  775 + });
  776 + },
  777 +
  778 + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
  779 + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) {
  780 + var lineWidth = 0;
  781 + var lastSubStrIndex = 0; //每次开始截取的字符串的索引
  782 + var han = 0;
  783 + for (let i = 0; i < str.length; i++) {
  784 + if (han == 2) return;
  785 + //lineWidth += ctx.measureText(str[i]).width;
  786 + lineWidth += ut.measureText(str[i], 21.3 * unit);
  787 + if (lineWidth > canvasWidth) {
  788 + han++;
  789 +
  790 + if (han == 2)
  791 + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分
  792 + else
  793 + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight);
  794 +
  795 + initHeight += 22; //22为字体的高度
  796 + lineWidth = 0;
  797 + lastSubStrIndex = i;
  798 + titleHeight += 20;
  799 + }
  800 + if (i == str.length - 1) { //绘制剩余部分
  801 + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight);
  802 + }
  803 + }
  804 + },
  805 +
  806 + //-------搜索的相关功能------
  807 + set_search_value:function(e){
  808 + var key_str=e.detail.value;
  809 + if(key_str) key_str=key_str.trim();
  810 + this.setData({key_str:key_str});
  811 +
  812 + },
  813 + search_data:function(){
  814 + this.setData({
  815 + is_no_data:0,is_no_more:0,list:[],
  816 + });
  817 + this.data.is_load=0;
  818 + this.data.currentPage=1;
  819 + this.requestGoodsList();
  820 + },
  821 +
  822 + go_goods:function(e){
  823 + var index=e.currentTarget.dataset.index;
  824 + var item=this.data.list[index];
  825 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id;
  826 + getApp().goto(url);
  827 + },
  828 +
  829 + insert_goods_share:function(){
  830 + var th = this;
  831 + var item=this.data.share_good;
  832 + var url="/api/weshop/sharetypeList/save";
  833 + var req_data={
  834 + shareActId:item.id,
  835 + shareActName:item.serviceName,
  836 + shareType:8,
  837 + shareUserId:th.data.first_leader,
  838 + shareStaffId:th.data.StaffId,
  839 + shareStorageId:th.data.StorageId,
  840 + shareTime:ut.gettimestamp(),
  841 + storeId:os.stoid
  842 + }
  843 + //插入数据
  844 + getApp().request.post(url,{
  845 + data:req_data,
  846 + success:function(){
  847 +
  848 + }
  849 + });
  850 +
  851 + //收入线下数据
  852 + req_data.userId=th.data.first_leader;
  853 + delete req_data.shareUserId;
  854 + //插入数据
  855 + getApp().request.post('/api/weshop/MdShareType/saveShare',{
  856 + data:req_data,
  857 + success:function(){}
  858 + })
  859 +
  860 + },
  861 +
  862 +
  863 + goto:function(e) {
  864 + var url = e.currentTarget.dataset.url;
  865 + app.goto(url);
  866 + },
  867 +
  868 +
66 }) 869 })
67 \ No newline at end of file 870 \ No newline at end of file
packageA/pages/service_share/service_share.json
1 { 1 {
2 - "usingComponents": {} 2 + "navigationBarTitleText": "服务卡项分享",
  3 + "usingComponents": {
  4 + "nodata": "/components/nodata/nodata",
  5 + "share_button": "/components/share/share"
  6 + },
  7 + "enablePullDownRefresh": false
3 } 8 }
4 \ No newline at end of file 9 \ No newline at end of file
packageA/pages/service_share/service_share.wxml
1 -<!--packageA//pages/service_share/service_share.wxml-->  
2 -<text>packageA//pages/service_share/service_share.wxml</text> 1 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
  2 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  3 +<view class="container">
  4 + <!-- 搜索框 -->
  5 + <view class="search-container">
  6 + <view class="input-container"><input bindinput="set_search_value" class="search" type="text" placeholder="请输入您想查找的商品信息"/></view>
  7 + <view bindtap="search_data" class="btn-search">搜索</view>
  8 + </view>
  9 + <!-- 列表 -->
  10 + <view class="list-container">
  11 + <!-- 标题 -->
  12 + <view class="title">
  13 + <view class="title-item f1" bindtap="sale_sort">销量</view>
  14 +
  15 + <block wx:if="{{orderField=='shop_price'}}">
  16 + <view class="title-item f1" bindtap="sort1">价格<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view>
  17 + </block>
  18 + <block wx:else>
  19 + <view class="title-item f1" bindtap="sort1">价格<text class="iconfont icon-shang"></text></view>
  20 + </block>
  21 +
  22 + <!-- <block wx:if="{{orderField=='commission'}}">
  23 + <view class="title-item" bindtap="sort2">佣金<text class="iconfont {{orderType=='asc'?'icon-shang':'icon-xia'}}"></text></view>
  24 + </block>
  25 + <block wx:else>
  26 + <view class="title-item" bindtap="sort2">佣金<text class="iconfont icon-xia"></text></view>
  27 + </block> -->
  28 +
  29 + <view class="title-item f1" bindtap='new_sort'>最新</view>
  30 + </view>
  31 + <!-- 列表项 -->
  32 + <scroll-view
  33 + class="list"
  34 + scroll-y="true"
  35 + bindscrolltolower="refresh"
  36 + scroll-anchoring
  37 + >
  38 + <block wx:for="{{list}}">
  39 + <!-- <view class class="list-item" bindtap="go_goods" data-index="{{index}}"> -->
  40 + <view class class="list-item" bindtap="goto" data-index="{{index}}" data-url="{{'/packageA/pages/cardDetails/cardDetails?id=' + item.id}}">
  41 + <view class="img-container">
  42 + <image src="{{url+item.original_img}}" style="width: 100%; height: 100%;"
  43 + binderror="bind_bnerr2" lazy-load="true"
  44 + data-errorimg="list[{{index}}].original_img"></image>
  45 + </view>
  46 + <view class="details">
  47 + <view class="ellipsis-2 fs28 name">{{item.serviceName}}</view>
  48 + <view class="fs26 pdt10">有效天数:{{item.validDays}}</view>
  49 + <view class="flex ai-center pdt14 jc_sb">
  50 + <view class="red fs26">¥{{item.money}}</view>
  51 + <view class="gray fs24">已售:<text class="red">{{item.sales_sum}}</text></view>
  52 + <!-- <view class="txt_line">¥{{item.market_price}}</view> -->
  53 + </view>
  54 +
  55 + <view class="t-r">
  56 + <!-- 如果有等级卡的话 -->
  57 + <!-- <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}"> -->
  58 + <!-- 当会员是等级卡的时候,且卡有钱的时候 -->
  59 + <!-- <block wx:if="{{card_field && item[card_field]>0}}"> -->
  60 + <!-- <text class="plus_show">card_name</text>¥{{item[card_field]}} -->
  61 + <!-- <view class="card_bg ellipsis-1 flex ai-center">
  62 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  63 + <text class="card_name">{{card_name}}</text>
  64 + </view>
  65 + <view class="fs28">¥{{filters.toFix(item[card_field],2)}}</view>
  66 +
  67 + </block> -->
  68 + <!-- 当会员不是等级卡的时候,且卡有钱的时候 -->
  69 + <!-- <block wx:if="{{!card_field && g_filter.get_card_price(item,card_list,0)>0}}">
  70 + <view class="card_bg ellipsis-1 flex ai-center">
  71 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  72 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  73 + </view>
  74 + <view class="fs28">¥{{g_filter.get_card_price(item,card_list,0)}}</view>
  75 +
  76 + </block>
  77 + </block>
  78 + </view> -->
  79 +
  80 + <!-- <view class="flex jc_sb fs24 pdt14">
  81 + <view class="gray">已售:<text class="red">{{item.sales_sum}}</text></view>
  82 + <view class="gray">分成金额:
  83 + <text wx:if="{{!pattern}}" class="red">¥{{item.commission}}</text>
  84 + <text wx:else class="red">¥{{item.fir_rate+item.sec_rate+item.thi_rate}}</text>
  85 + </view>
  86 + </view> -->
  87 + <view catchtap="share_good" data-index="{{index}}" class="t-r fs28 pdt14">
  88 + <view class="btn-share">分享</view>
  89 + </view>
  90 + </view>
  91 + </view>
  92 + </view>
  93 + </block>
  94 + <nodata wx:if="{{list.length==0}}" nodataContainer="nodata">暂无数据</nodata>
  95 + <view wx:if="{{is_no_more}}" class="no-more t-c">- 已全部加载 -</view>
  96 + </scroll-view>
  97 + </view>
  98 +</view>
  99 +
  100 +<!--二维码显示页面-->
  101 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas>
  102 +<!-- 分享控件,底部弹出 -->
  103 +<share_button id="share_button" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{!share_hidden}}"></share_button>
packageA/pages/service_share/service_share.wxss
1 -/* packageA//pages/service_share/service_share.wxss */  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +/* packageA//pages/goods_share/goods_share.wxss */
  3 +.red {
  4 + color: #FE6867;
  5 +}
  6 +.gray {
  7 + color: #7b7b7b;
  8 +}
  9 +page {
  10 + background-color: #f2f2f2;
  11 + height: 100%;
  12 +}
  13 +.container {
  14 + background-color: white;
  15 + height: 100%;
  16 +}
  17 +.search-container {
  18 + display: flex;
  19 + padding: 26rpx 20rpx;
  20 + border-bottom: 2rpx solid #f8f8f8;
  21 +}
  22 +.input-container {
  23 + flex: 1;
  24 + border-radius: 6rpx 0 0 6rpx;
  25 + overflow: hidden;
  26 +}
  27 +.search {
  28 + background-color: #f0f0f0;
  29 + padding: 10rpx 20rpx;
  30 + font-size: 28rpx;
  31 +}
  32 +.btn-search {
  33 + background-color: #FE6867;
  34 + color: white;
  35 + padding: 0 30rpx;
  36 + display: flex;
  37 + align-items: center;
  38 + border-radius: 0 6rpx 6rpx 0;
  39 +}
  40 +.title {
  41 + display: flex;
  42 + font-size: 30rpx;
  43 + border-bottom: 2rpx solid #f8f8f8;
  44 +}
  45 +.title .iconfont {
  46 + color: #ccc;
  47 + font-size: 16rpx;
  48 + margin-left: 8rpx;
  49 +}
  50 +.title-item {
  51 + width: 25%;
  52 + box-sizing: border-box;
  53 + text-align: center;
  54 + padding: 20rpx;
  55 +}
  56 +.list-container {
  57 + height: calc(100% - 118rpx);
  58 +}
  59 +.list {
  60 + height: calc(100% - 82rpx);
  61 + background-color: #f2f2f2;
  62 +}
  63 +.list-item {
  64 + display: flex;
  65 + padding: 20rpx;
  66 + border-bottom: 2rpx solid #f8f8f8;
  67 + background-color: white;
  68 +}
  69 +.img-container {
  70 + background-color: #f0f0f0;
  71 + width: 280rpx;
  72 + height: 248rpx;
  73 + display: flex;
  74 + align-items: center;
  75 + justify-content: center;
  76 +}
  77 +.img-container:after {
  78 + /* font-family: iconfont;
  79 + content: '\e8c1';
  80 + color: #bbb;
  81 + font-size: 80rpx; */
  82 +}
  83 +.details {
  84 + flex: 1;
  85 + padding-left: 20rpx;
  86 +}
  87 +.btn-share {
  88 + display: inline-block;
  89 + background-color: #FE6867;
  90 + color: white;
  91 + padding: 8rpx 30rpx;
  92 + border-radius: 6rpx;
  93 +}
  94 +.pdt14 {
  95 + padding-top: 14rpx;
  96 +}
  97 +
  98 +.no-more {
  99 + line-height: 3;
  100 + color: #ccc;
  101 + background-color: #f2f2f2;
  102 +}
  103 +.nodata {
  104 + text-align: center;
  105 + background-color: #f2f2f2;
  106 +}
  107 +
  108 +.name {
  109 + height: 76rpx;
  110 +}
  111 +
  112 +.plus_show{
  113 + background-color: #FE6867;
  114 + color: #fff;
  115 + padding: 3rpx 5rpx;
  116 + border-radius:8rpx ;
  117 + margin-left: 10rpx;
  118 + margin-right: 5rpx;
  119 +}
  120 +
  121 +.card_bg {
  122 + box-sizing: border-box;
  123 + padding: 2rpx 10rpx;
  124 + height: 28rpx;
  125 + border-radius: 26rpx;
  126 + font-size: 18rpx;
  127 + line-height: 28rpx;
  128 + max-width: 210rpx;
  129 + background: #333;
  130 + color: #fff;
  131 + margin-left: 8rpx;
  132 +}
  133 +
  134 +.card_bg image {
  135 + width: 19rpx;
  136 + height: 19rpx;
  137 + margin-right: 8rpx;
  138 +}
  139 +
  140 +.txt_line{
  141 + text-decoration: line-through; position: relative;
  142 + top: 23rpx;color: #adadad;
  143 + font-size: 24rpx; margin-left: 10rpx;
  144 + }