Commit 07b38de4ddc7c1aa9c657cdff4d152b3fe2dc164
Merge branch 'dev' into 'test'
Dev See merge request !539
Showing
16 changed files
with
1371 additions
and
237 deletions
packageA/pages/jfbuy/jfbuy.js
0 → 100644
| 1 | +// packageA//pages/goods_share/goods_share.js | ||
| 2 | +var app=getApp(),oo = app.globalData.setting,os=oo,ut = require("../../../utils/util.js"); | ||
| 3 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
| 4 | +Page({ | ||
| 5 | + /** | ||
| 6 | + * 页面的初始数据 | ||
| 7 | + */ | ||
| 8 | + data: { | ||
| 9 | + // tab | ||
| 10 | + tab: ['全部','价格','销量','积分值'], | ||
| 11 | + currentIndex: 1, | ||
| 12 | + //促销页tab | ||
| 13 | + // tab2: ['订单促销','搭配促销','优惠促销'], | ||
| 14 | + // currentIndex2: 0, | ||
| 15 | + //秒杀和拼单底部tab | ||
| 16 | + // currentIndex3: 0, | ||
| 17 | + // 控制价格 | ||
| 18 | + active1: false, | ||
| 19 | + // 控制佣金 | ||
| 20 | + active2: false, | ||
| 21 | + url: oo.imghost, | ||
| 22 | + //popup | ||
| 23 | + hiddenPopup: true, | ||
| 24 | + // 排序 | ||
| 25 | + isUp: false, | ||
| 26 | + //控制滚动条至顶部时开启下拉刷新 | ||
| 27 | + // open: false, | ||
| 28 | + requestData: null, | ||
| 29 | + | ||
| 30 | + list:[], | ||
| 31 | + is_load:0, //是否正在加载 | ||
| 32 | + is_no_data:0, //没有数据 | ||
| 33 | + is_no_more:0, //没有更多数据 | ||
| 34 | + key_str:'', | ||
| 35 | + pattern:0, //分成的方式 | ||
| 36 | + currentPage:1, //当前的页码 | ||
| 37 | + | ||
| 38 | + // canvasHidden: 1, //-- 隐藏画布 -- | ||
| 39 | + // dis_switch:0, //-- 分销开关 -- | ||
| 40 | + // pattern:0, //-- 分成的方式 -- | ||
| 41 | + // share_hidden:1, //-- 分享的按钮隐藏 -- | ||
| 42 | + // share_good:null, //--- 要分享的商品 --- | ||
| 43 | + | ||
| 44 | + // timer:0, | ||
| 45 | + // hui_active:null, //优惠活动分享 | ||
| 46 | + | ||
| 47 | + //点击活动详情的时候的响应 | ||
| 48 | + list2:[], | ||
| 49 | + is_load2:0, | ||
| 50 | + is_no_data2:0, //没有数据 | ||
| 51 | + is_no_more2:0, //没有更多数据 | ||
| 52 | + currentPage2:1, //页码 | ||
| 53 | + prom_goods:null, //优惠活动的条件 | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + triggered: false, | ||
| 57 | + isPullDownRefresh: false, | ||
| 58 | + }, | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 生命周期函数--监听页面加载 | ||
| 62 | + */ | ||
| 63 | + onLoad: function (options) { | ||
| 64 | + this.request_list({ | ||
| 65 | + store_id:oo.stoid, | ||
| 66 | + stype:1, | ||
| 67 | + stypeup:1 | ||
| 68 | + }); | ||
| 69 | + // var th=this; | ||
| 70 | + // //接受有没有导购的参数 | ||
| 71 | + // var first_leader=options.first_leader; | ||
| 72 | + // if(first_leader){ | ||
| 73 | + // //-- user_id代过来免登陆 -- | ||
| 74 | + // getApp().globalData.user_id=first_leader; | ||
| 75 | + // getApp().getUserFir(); | ||
| 76 | + // } | ||
| 77 | + | ||
| 78 | + // this.requestGoodsList(); | ||
| 79 | + //-- 自定义海报 -- | ||
| 80 | + // getApp().request.promiseGet("/api/weshop/goods/poster/page",{ | ||
| 81 | + // data:{store_id:os.stoid, type:1, is_use:1 } | ||
| 82 | + // }).then(res=>{ | ||
| 83 | + // if(res.data.code==0){ | ||
| 84 | + | ||
| 85 | + // var poster_data=res.data.data.pageData[0]; | ||
| 86 | + // var json_str=poster_data.jsonStr; | ||
| 87 | + | ||
| 88 | + // if(json_str){ | ||
| 89 | + // var json_data=JSON.parse(json_str); | ||
| 90 | + // if(json_data.bg_img){ | ||
| 91 | + | ||
| 92 | + // //-- 把图片那到本地 -- | ||
| 93 | + // wx.getImageInfo({ | ||
| 94 | + // src:json_data.bg_img, | ||
| 95 | + // success: function(res) { | ||
| 96 | + // var path= res.path; | ||
| 97 | + // th.setData({share_b_img:path}) | ||
| 98 | + // }, | ||
| 99 | + // fail: function(res) {} | ||
| 100 | + // }); | ||
| 101 | + // } | ||
| 102 | + | ||
| 103 | + // th.setData({poster:json_data}) | ||
| 104 | + | ||
| 105 | + // } | ||
| 106 | + // } | ||
| 107 | + // }) | ||
| 108 | + | ||
| 109 | + //获取分销的配置 | ||
| 110 | + // getApp().request.promiseGet("/api/weshop/storeDistribut/get/"+oo.stoid,{}).then(res=>{ | ||
| 111 | + // if(res.data.code==0){ | ||
| 112 | + // th.setData({dis_switch:res.data.data.switch,pattern:res.data.data.pattern}); | ||
| 113 | + // } | ||
| 114 | + // }) | ||
| 115 | + | ||
| 116 | + //获取用户设备信息,屏幕宽度 | ||
| 117 | + // wx.getSystemInfo({ | ||
| 118 | + // success: res => { | ||
| 119 | + // th.setData({ | ||
| 120 | + // screenWidth: res.screenWidth | ||
| 121 | + // }) | ||
| 122 | + // } | ||
| 123 | + // }); | ||
| 124 | + | ||
| 125 | + //-- ---秒杀和拼团都要有定时器--- | ||
| 126 | + // if(!options.currentIndex || options.currentIndex<=1){ | ||
| 127 | + // //设置全局定时器 | ||
| 128 | + // th.data.timer=setInterval(function () { | ||
| 129 | + // th.countDown(); | ||
| 130 | + // },1000); | ||
| 131 | + // } | ||
| 132 | + }, | ||
| 133 | + | ||
| 134 | + /** | ||
| 135 | + * 生命周期函数--监听页面显示 | ||
| 136 | + */ | ||
| 137 | + onShow: function () {}, | ||
| 138 | + /** | ||
| 139 | + * 生命周期函数--监听页面隐藏 | ||
| 140 | + */ | ||
| 141 | + onHide: function () { | ||
| 142 | + //--清理定时器-- | ||
| 143 | + // clearInterval(this.timer); | ||
| 144 | + }, | ||
| 145 | + /**e | ||
| 146 | + * 页面上拉触底事件的处理函数 | ||
| 147 | + */ | ||
| 148 | + onReachBottom: function () { | ||
| 149 | + | ||
| 150 | + }, | ||
| 151 | + | ||
| 152 | + /** | ||
| 153 | + * 用户点击右上角分享 | ||
| 154 | + */ | ||
| 155 | + // onShareAppMessage: function () { | ||
| 156 | + // var th = this; | ||
| 157 | + // //礼包的转发 | ||
| 158 | + // if(th.data.currentIndex==3){ | ||
| 159 | + // var lbid=th.data.hui_active.lbId; | ||
| 160 | + // var url="pages/giftpack/giftpacklist/giftpacklist?lbId="+lbid+"&isBuy=1"; | ||
| 161 | + // if(getApp().globalData.user_id){ | ||
| 162 | + // url+="&first_leader="+getApp().globalData.user_id; | ||
| 163 | + // } | ||
| 164 | + // var img=this.data.share_img; | ||
| 165 | + // var title=th.data.hui_active.giftTitle; | ||
| 166 | + | ||
| 167 | + // var ob={ | ||
| 168 | + // title:title, | ||
| 169 | + // path:url, | ||
| 170 | + // imageUrl: img, | ||
| 171 | + // }; | ||
| 172 | + // th.setData({share_hidden:1}); | ||
| 173 | + // return ob; | ||
| 174 | + | ||
| 175 | + // }else{ | ||
| 176 | + // //---秒杀,拼团,促销--- | ||
| 177 | + // var item=this.data.share_good; | ||
| 178 | + // if(item){ | ||
| 179 | + // var price = item.shop_price; | ||
| 180 | + // var title= item.goods_name; | ||
| 181 | + // var img=this.data.url+item.original_img; | ||
| 182 | + // var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + th.data.gid; | ||
| 183 | + // if(getApp().globalData.user_id){ | ||
| 184 | + // url+="&first_leader="+getApp().globalData.user_id; | ||
| 185 | + // } | ||
| 186 | + // var ob={ | ||
| 187 | + // title: price + "元 " +title, | ||
| 188 | + // path:url, | ||
| 189 | + // imageUrl: img, | ||
| 190 | + // }; | ||
| 191 | + // th.setData({share_hidden:1,share_good:null}); | ||
| 192 | + // return ob; | ||
| 193 | + // }else{ | ||
| 194 | + // var url="/pages/index/index/index"; | ||
| 195 | + // if(getApp().globalData.user_id){ | ||
| 196 | + // url+="?first_leader="+getApp().globalData.user_id; | ||
| 197 | + // } | ||
| 198 | + // var hui_active=this.data.hui_active; | ||
| 199 | + // var title=hui_active.name; | ||
| 200 | + // if(!title) title=hui_active.main_goods_name; | ||
| 201 | + // if(!title) title=hui_active.giftTitle; | ||
| 202 | + | ||
| 203 | + // var ob={ | ||
| 204 | + // title: title, | ||
| 205 | + // path:url, | ||
| 206 | + // }; | ||
| 207 | + // th.setData({share_hidden:1,share_good:null}); | ||
| 208 | + // return ob; | ||
| 209 | + // } | ||
| 210 | + // } | ||
| 211 | + | ||
| 212 | + // }, | ||
| 213 | + | ||
| 214 | + | ||
| 215 | + //-- 点击tab -- | ||
| 216 | + clickTab(e) { | ||
| 217 | + var th=this; | ||
| 218 | + var data = { | ||
| 219 | + store_id:oo.stoid, | ||
| 220 | + stype:e.target.dataset.index, | ||
| 221 | + stypeup:1, | ||
| 222 | + }; | ||
| 223 | + this.setData({ | ||
| 224 | + is_no_data2:0, | ||
| 225 | + is_no_more2:0, | ||
| 226 | + list2:[], | ||
| 227 | + is_load2: 0, | ||
| 228 | + currentPage2:1, | ||
| 229 | + }); | ||
| 230 | + if(this.data.currentIndex!=e.target.dataset.index){ | ||
| 231 | + this.setData({ | ||
| 232 | + currentIndex: e.target.dataset.index, | ||
| 233 | + isUp: false, | ||
| 234 | + }); | ||
| 235 | + | ||
| 236 | + } else { | ||
| 237 | + console.log('第2次点击'); | ||
| 238 | + this.setData({ | ||
| 239 | + isUp: !this.data.isUp | ||
| 240 | + }); | ||
| 241 | + }; | ||
| 242 | + | ||
| 243 | + if(this.data.isUp) { | ||
| 244 | + data.stypeup = 0; | ||
| 245 | + } else { | ||
| 246 | + data.stypeup = 1; | ||
| 247 | + }; | ||
| 248 | + | ||
| 249 | + // this.data.requestData = data; | ||
| 250 | + this.setData({ | ||
| 251 | + requestData: data | ||
| 252 | + }) | ||
| 253 | + | ||
| 254 | + this.request_list(data); | ||
| 255 | + }, | ||
| 256 | + | ||
| 257 | + | ||
| 258 | + | ||
| 259 | + | ||
| 260 | + request_list: function(data, callback){ | ||
| 261 | + // console.log('触发上拉刷新'); | ||
| 262 | + | ||
| 263 | + var th = this; | ||
| 264 | + if(this.data.is_load2) return false; //-- 正在加载 | ||
| 265 | + if(this.data.is_no_data2) return false; //-- 没有数据 | ||
| 266 | + if(this.data.is_no_more2) return false; //-- 没有更多 | ||
| 267 | + | ||
| 268 | + // 开启加载状态 | ||
| 269 | + this.data.is_load2=1; | ||
| 270 | + | ||
| 271 | + // var req_data = { | ||
| 272 | + // page:th.data.currentPage2 | ||
| 273 | + // } | ||
| 274 | + | ||
| 275 | + app.request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", { | ||
| 276 | + data: data | ||
| 277 | + }).then(res=>{ | ||
| 278 | + // 关闭加载状态 | ||
| 279 | + th.data.is_load2=0; | ||
| 280 | + // 请求成功 | ||
| 281 | + if(res.data.code==0) { | ||
| 282 | + if(res.data.data.pageData.length>0) { | ||
| 283 | + th.data.currentPage2++; | ||
| 284 | + var data = res.data.data.pageData; | ||
| 285 | + // 判断有无更多数据可以加载,如果大于则没有更多数据,反之则有 | ||
| 286 | + if(res.data.data.page*res.data.data.pageSize > res.data.data.total){th.setData({is_no_more2:1});} | ||
| 287 | + var list=th.data.list2; | ||
| 288 | + list=list.concat(data); | ||
| 289 | + th.setData({list2:list}); | ||
| 290 | + } else { | ||
| 291 | + if(th.data.currentPage==1){ | ||
| 292 | + th.setData({is_no_data2:1}); | ||
| 293 | + } else { | ||
| 294 | + th.setData({is_no_more2:1}); | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + if(callback) callback(); | ||
| 298 | + } else { | ||
| 299 | + wx.showToast({ | ||
| 300 | + title: res.data.msg, | ||
| 301 | + icon: 'none', | ||
| 302 | + duration: 2000 | ||
| 303 | + }) | ||
| 304 | + } | ||
| 305 | + console.log('xx',res); | ||
| 306 | + }) | ||
| 307 | + }, | ||
| 308 | + | ||
| 309 | + | ||
| 310 | + | ||
| 311 | + | ||
| 312 | + //---图片失败,默认图片--- | ||
| 313 | + bind_bnerr2: function (e) { | ||
| 314 | + var _errImg = e.target.dataset.errorimg; | ||
| 315 | + var _errObj = {}; | ||
| 316 | + _errObj[_errImg] ="/miniapp/images/default_g_img.gif"; | ||
| 317 | + this.setData(_errObj); //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
| 318 | + // this.setData({['list2[0].original_img']:/miniapp/images/default_g_img.gif}); | ||
| 319 | + }, | ||
| 320 | + //-- ---更多加载---- | ||
| 321 | + refresh:function(){ | ||
| 322 | + this.request_list(this.data.requestData); | ||
| 323 | + }, | ||
| 324 | + | ||
| 325 | + | ||
| 326 | + | ||
| 327 | + // 页面滚动 | ||
| 328 | + onPageScroll (e) { | ||
| 329 | + console.log(e); | ||
| 330 | + if(e.scrollTop == 0) { | ||
| 331 | + this.setData({open: true }); | ||
| 332 | + } else { | ||
| 333 | + this.setData({open: false}); | ||
| 334 | + } | ||
| 335 | + }, | ||
| 336 | + | ||
| 337 | + // 下拉刷新 | ||
| 338 | + onPullDownRefresh() { | ||
| 339 | + var th = this; | ||
| 340 | + var data = this.data.requestData; | ||
| 341 | + | ||
| 342 | + if(this.isPullDownRefresh) return; | ||
| 343 | + // 触发下拉刷新开启 | ||
| 344 | + this.isPullDownRefresh = true; | ||
| 345 | + | ||
| 346 | + this.setData({ | ||
| 347 | + list2: [], | ||
| 348 | + currentPage2: 1, | ||
| 349 | + is_no_more2: 0 | ||
| 350 | + }); | ||
| 351 | + | ||
| 352 | + this.request_list(data, function() { | ||
| 353 | + th.setData({ | ||
| 354 | + triggered: false, | ||
| 355 | + }); | ||
| 356 | + th.isPullDownRefresh = false; | ||
| 357 | + }); | ||
| 358 | + }, | ||
| 359 | +}) | ||
| 0 | \ No newline at end of file | 360 | \ No newline at end of file |
packageA/pages/jfbuy/jfbuy.json
0 → 100644
packageA/pages/jfbuy/jfbuy.wxml
0 → 100644
| 1 | +<!-- <wxs module="g_filter" src="g_filter.wxs"></wxs> --> | ||
| 2 | +<view class="container"> | ||
| 3 | + <!-- 搜索框 --> | ||
| 4 | + <!-- <view class="search-container"> | ||
| 5 | + <view class="input-container"><input bindinput="set_search_value" class="search" type="text" placeholder="请输入您想查找的商品信息"/></view> | ||
| 6 | + <view bindtap="search_data" class="btn-search">搜索</view> | ||
| 7 | + </view> --> | ||
| 8 | + | ||
| 9 | + <view class="banner-container"> | ||
| 10 | + <image src="../../images/jfbuy.jpg" class="banner"></image> | ||
| 11 | + </view> | ||
| 12 | + | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + <!-- 列表 --> | ||
| 16 | + <view class="list-container"> | ||
| 17 | + <!-- 标题 --> | ||
| 18 | + <view class="title" > | ||
| 19 | + <block wx:for="{{tab}}"> | ||
| 20 | + <view class="title-item {{currentIndex == (index+1) ? 'active' + (isUp?' active1':''):''}}" data-index="{{index+1}}" bindtap="clickTab">{{item}}</view> | ||
| 21 | + </block> | ||
| 22 | + </view> | ||
| 23 | + | ||
| 24 | + <!-- <view> --> | ||
| 25 | + <scroll-view | ||
| 26 | + class="list" | ||
| 27 | + scroll-y="true" | ||
| 28 | + bindscrolltolower="request_list" | ||
| 29 | + scroll-anchoring | ||
| 30 | + refresher-enabled | ||
| 31 | + refresher-triggered="{{triggered}}" | ||
| 32 | + bindrefresherrefresh="onPullDownRefresh"> | ||
| 33 | + | ||
| 34 | + <block wx:for="{{list2}}"> | ||
| 35 | + <view class class="list-item" bindtap="viewItemDetails"> | ||
| 36 | + <view class="img-container"> | ||
| 37 | + <image | ||
| 38 | + src="{{url+item.original_img}}" | ||
| 39 | + style="width: 100%; height: 100%;" | ||
| 40 | + binderror="bind_bnerr2" lazy-load="true" | ||
| 41 | + data-errorimg="list2[{{index}}].original_img"></image> | ||
| 42 | + </view> | ||
| 43 | + <view class="details"> | ||
| 44 | + <view class="ellipsis-2 fs30 name">{{item.goods_name}}</view> | ||
| 45 | + <view> | ||
| 46 | + <view class="red"> | ||
| 47 | + <text>{{item.integral}}积分 + ¥{{item.addmoney}}</text> | ||
| 48 | + </view> | ||
| 49 | + <view class="pdt14 fs22 gray flex jc_sb"> | ||
| 50 | + <view>零售价:¥{{item.shop_price}}</view> | ||
| 51 | + <view>销量:{{item.sales_sum}}</view> | ||
| 52 | + </view> | ||
| 53 | + </view> | ||
| 54 | + </view> | ||
| 55 | + </view> | ||
| 56 | + </block> | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + <!-- <view style="height: 1rpx;"></view> --> | ||
| 60 | + <nodata wx:if="{{list2.length==0}}" nodataContainer="nodata">暂无数据</nodata> | ||
| 61 | + <view wx:if="{{is_no_more2}}" class="no-more t-c">- 已全部加载 -</view> | ||
| 62 | + <!-- <nodata nodataContainer="nodata">暂无数据</nodata> | ||
| 63 | + <view class="no-more t-c">- 已全部加载 -</view> --> | ||
| 64 | + </scroll-view> | ||
| 65 | + <!-- </view> --> | ||
| 66 | + | ||
| 67 | + </view> | ||
| 68 | +</view> |
packageA/pages/jfbuy/jfbuy.wxss
0 → 100644
| 1 | +/* packageA//pages/goods_share/goods_share.wxss */ | ||
| 2 | +.red { | ||
| 3 | + color: #FE6867; | ||
| 4 | +} | ||
| 5 | +.gray { | ||
| 6 | + color: #7b7b7b; | ||
| 7 | +} | ||
| 8 | +.w25 { | ||
| 9 | + width: 25%; | ||
| 10 | +} | ||
| 11 | +.w50 { | ||
| 12 | + width: 50%; | ||
| 13 | +} | ||
| 14 | +.w164 { | ||
| 15 | + width: 164rpx; | ||
| 16 | +} | ||
| 17 | +.bold { | ||
| 18 | + font-weight: bold; | ||
| 19 | +} | ||
| 20 | +page, | ||
| 21 | +.container { | ||
| 22 | + height: 100%; | ||
| 23 | +} | ||
| 24 | +page { | ||
| 25 | + background-color: #f2f2f2; | ||
| 26 | + /* height: 100%; */ | ||
| 27 | +} | ||
| 28 | +.container { | ||
| 29 | + /* height: 100%; */ | ||
| 30 | + /* position: relative; */ | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +.search-container { | ||
| 34 | + /* display: flex; | ||
| 35 | + padding: 26rpx 20rpx; | ||
| 36 | + border-bottom: 2rpx solid #f8f8f8; */ | ||
| 37 | +} | ||
| 38 | +.input-container { | ||
| 39 | + /* flex: 1; | ||
| 40 | + border-radius: 6rpx 0 0 6rpx; | ||
| 41 | + overflow: hidden; */ | ||
| 42 | +} | ||
| 43 | +.search { | ||
| 44 | + /* background-color: #f0f0f0; | ||
| 45 | + padding: 10rpx 20rpx; | ||
| 46 | + font-size: 28rpx; */ | ||
| 47 | +} | ||
| 48 | +.btn-search { | ||
| 49 | + /* background-color: #FE6867; | ||
| 50 | + color: white; | ||
| 51 | + padding: 0 30rpx; | ||
| 52 | + display: flex; | ||
| 53 | + align-items: center; | ||
| 54 | + border-radius: 0 6rpx 6rpx 0; */ | ||
| 55 | +} | ||
| 56 | +.title { | ||
| 57 | + display: flex; | ||
| 58 | + font-size: 30rpx; | ||
| 59 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 60 | + background-color: white; | ||
| 61 | + position: sticky; | ||
| 62 | + position: -webkit-sticky; | ||
| 63 | + width: 100%; | ||
| 64 | + top: 0; | ||
| 65 | + z-index: 3; | ||
| 66 | +} | ||
| 67 | +.title .iconfont { | ||
| 68 | + color: #ccc; | ||
| 69 | + font-size: 16rpx; | ||
| 70 | + margin-left: 8rpx; | ||
| 71 | +} | ||
| 72 | +.title-item { | ||
| 73 | + width: 25%; | ||
| 74 | + box-sizing: border-box; | ||
| 75 | + text-align: center; | ||
| 76 | + padding: 20rpx; | ||
| 77 | + position: relative; | ||
| 78 | +} | ||
| 79 | +.title-item.active { | ||
| 80 | + color: #FE6867; | ||
| 81 | + font-weight: bold; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.title-item.active:before { | ||
| 85 | + content:''; | ||
| 86 | + position: absolute; | ||
| 87 | + width: 60%; | ||
| 88 | + height: 4rpx; | ||
| 89 | + background-color: #FE6867; | ||
| 90 | + left: 0; | ||
| 91 | + right: 0; | ||
| 92 | + bottom: 0; | ||
| 93 | + margin: 0 auto; | ||
| 94 | +} | ||
| 95 | +.title-item.active:after { | ||
| 96 | + font-family: iconfont; | ||
| 97 | + content: '\e650'; | ||
| 98 | + font-size: 18rpx; | ||
| 99 | + margin-left: 8rpx; | ||
| 100 | +} | ||
| 101 | +.title-item.active.active1:after { | ||
| 102 | + font-family: iconfont; | ||
| 103 | + content: '\e604'; | ||
| 104 | + font-size: 18rpx; | ||
| 105 | + margin-left: 8rpx; | ||
| 106 | +} | ||
| 107 | +.list-container { | ||
| 108 | + height: calc(100% - 360rpx); | ||
| 109 | + /* height: 100%; */ | ||
| 110 | +} | ||
| 111 | +.list { | ||
| 112 | + box-sizing: border-box; | ||
| 113 | + height: calc(100% - 82rpx); | ||
| 114 | + background-color: #f2f2f2; | ||
| 115 | + /* padding-bottom: 102rpx; */ | ||
| 116 | +} | ||
| 117 | +.list.active1 { | ||
| 118 | + /* height: calc(100% - 82rpx - 78rpx); */ | ||
| 119 | + /* padding-bottom: 0; */ | ||
| 120 | +} | ||
| 121 | +.list.active2 { | ||
| 122 | + /* padding-bottom: 0; */ | ||
| 123 | +} | ||
| 124 | +.list-item { | ||
| 125 | + display: flex; | ||
| 126 | + padding: 20rpx; | ||
| 127 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 128 | + background-color: white; | ||
| 129 | +} | ||
| 130 | +.img-container { | ||
| 131 | + background-color: #f0f0f0; | ||
| 132 | + width: 280rpx; | ||
| 133 | + height: 248rpx; | ||
| 134 | + display: flex; | ||
| 135 | + align-items: center; | ||
| 136 | + justify-content: center; | ||
| 137 | +} | ||
| 138 | +.img-container:after { | ||
| 139 | + | ||
| 140 | +} | ||
| 141 | +.details { | ||
| 142 | + flex: 1; | ||
| 143 | + padding-left: 20rpx; | ||
| 144 | + display: flex; | ||
| 145 | + flex-direction: column; | ||
| 146 | + justify-content: space-between; | ||
| 147 | +} | ||
| 148 | +.btn-share { | ||
| 149 | + box-sizing: border-box; | ||
| 150 | + display: inline-block; | ||
| 151 | + background-color: #FE6867; | ||
| 152 | + color: white; | ||
| 153 | + padding: 8rpx 30rpx; | ||
| 154 | + border-radius: 6rpx; | ||
| 155 | + text-align: center; | ||
| 156 | +} | ||
| 157 | +.pdt14 { | ||
| 158 | + padding-top: 14rpx; | ||
| 159 | +} | ||
| 160 | +.pdtb6 { | ||
| 161 | + padding-top: 6rpx; | ||
| 162 | + padding-bottom: 6rpx; | ||
| 163 | +} | ||
| 164 | +.pdtb8 { | ||
| 165 | + padding-top: 8rpx; | ||
| 166 | + padding-bottom: 8rpx; | ||
| 167 | +} | ||
| 168 | +.pdl20 { | ||
| 169 | + padding-left: 104rpx; | ||
| 170 | +} | ||
| 171 | + | ||
| 172 | + | ||
| 173 | +.no-more { | ||
| 174 | + line-height: 3; | ||
| 175 | + color: #ccc; | ||
| 176 | + /* background-color: #f2f2f2; */ | ||
| 177 | +} | ||
| 178 | +.nodata { | ||
| 179 | + text-align: center; | ||
| 180 | + background-color: #f2f2f2; | ||
| 181 | +} | ||
| 182 | +.progress-container { | ||
| 183 | + width: 55%; | ||
| 184 | + padding-right: 10rpx; | ||
| 185 | + position: relative; | ||
| 186 | + text-align: center; | ||
| 187 | +} | ||
| 188 | +.retail { | ||
| 189 | + color: #7b7b7b; | ||
| 190 | + text-decoration: line-through; | ||
| 191 | + font-size: 22rpx; | ||
| 192 | + padding-left: 20rpx; | ||
| 193 | +} | ||
| 194 | +.name { | ||
| 195 | + height: 76rpx; | ||
| 196 | + overflow: hidden; | ||
| 197 | +} | ||
| 198 | + | ||
| 199 | +.percent { | ||
| 200 | + position: absolute; | ||
| 201 | + top: 0; | ||
| 202 | + bottom: 0; | ||
| 203 | + left: 0; | ||
| 204 | + right: 0; | ||
| 205 | + margin: auto; | ||
| 206 | + color: white; | ||
| 207 | +} | ||
| 208 | +.tabbar { | ||
| 209 | + position: fixed; | ||
| 210 | + width: 100%; | ||
| 211 | + bottom: 0; | ||
| 212 | + background-color: white; | ||
| 213 | +} | ||
| 214 | +.tabbar:after { | ||
| 215 | + position: absolute; | ||
| 216 | + content: ''; | ||
| 217 | + width: 2rpx; | ||
| 218 | + height: 50%; | ||
| 219 | + top: 0; | ||
| 220 | + bottom: 0; | ||
| 221 | + left: 0; | ||
| 222 | + right: 0; | ||
| 223 | + margin: auto; | ||
| 224 | + background-color: #f0f0f0; | ||
| 225 | +} | ||
| 226 | +.tabbar-item { | ||
| 227 | + width: 50%; | ||
| 228 | + text-align: center; | ||
| 229 | + padding-top: 30rpx; | ||
| 230 | + padding-bottom: 30rpx; | ||
| 231 | +} | ||
| 232 | +.tabbar-item .iconfont { | ||
| 233 | + margin-right: 10rpx; | ||
| 234 | +} | ||
| 235 | +.tabbar-item.active { | ||
| 236 | + color: #FE6867; | ||
| 237 | +} | ||
| 238 | + | ||
| 239 | + | ||
| 240 | +.group-type, | ||
| 241 | +.group-num { | ||
| 242 | + position: relative; | ||
| 243 | + font-size: 22rpx; | ||
| 244 | +} | ||
| 245 | +.group-type:before, | ||
| 246 | +.group-num:before { | ||
| 247 | + font-family: iconfont; | ||
| 248 | +} | ||
| 249 | +.group-type:before { | ||
| 250 | + content: '\e66a'; | ||
| 251 | + color: white; | ||
| 252 | + background-color: #FE6867; | ||
| 253 | + position: absolute; | ||
| 254 | + left: 0; | ||
| 255 | + top: 0; | ||
| 256 | + bottom: 0; | ||
| 257 | + padding-left: 6rpx; | ||
| 258 | + padding-right: 10rpx; | ||
| 259 | + line-height: 30rpx; | ||
| 260 | +} | ||
| 261 | +.group-num:before { | ||
| 262 | + padding-right: 6rpx; | ||
| 263 | +} | ||
| 264 | +.group-num:before { | ||
| 265 | + content: '\e694'; | ||
| 266 | + position: relative; | ||
| 267 | +} | ||
| 268 | +.group-num { | ||
| 269 | + color: white; | ||
| 270 | + background-color: #FE6867; | ||
| 271 | + border-radius: 34rpx; | ||
| 272 | + padding-left: 10rpx; | ||
| 273 | + padding-right: 10rpx; | ||
| 274 | + margin-right: 14rpx; | ||
| 275 | +} | ||
| 276 | +.group-type { | ||
| 277 | + color: #FE6867; | ||
| 278 | + border: 2rpx solid #FE6867; | ||
| 279 | + padding-left: 42rpx; | ||
| 280 | + padding-right: 4rpx; | ||
| 281 | + border-radius: 6rpx; | ||
| 282 | +} | ||
| 283 | + | ||
| 284 | +.badge { | ||
| 285 | + color: white; | ||
| 286 | + padding: 0 20rpx; | ||
| 287 | + border-radius: 6rpx; | ||
| 288 | + background-color: #FE6867; | ||
| 289 | + margin-right: 10rpx; | ||
| 290 | +} | ||
| 291 | + | ||
| 292 | +.subTab-title { | ||
| 293 | + text-align: center; | ||
| 294 | + justify-content: center; | ||
| 295 | + align-items: center; | ||
| 296 | + font-size: 28rpx; | ||
| 297 | +} | ||
| 298 | +.subTab-list { | ||
| 299 | + padding: 20rpx; | ||
| 300 | +} | ||
| 301 | +.subTab-titleItem { | ||
| 302 | + box-sizing: border-box; | ||
| 303 | + width: calc(100% / 3); | ||
| 304 | + padding: 20rpx 40rpx; | ||
| 305 | + background-color: white; | ||
| 306 | + border-right: 2rpx solid #f8f8f8; | ||
| 307 | +} | ||
| 308 | +.subTab-titleItem:last-child { | ||
| 309 | + border-right: none; | ||
| 310 | +} | ||
| 311 | +.subTab-titleItem.active { | ||
| 312 | + background-color: #FE6867; | ||
| 313 | + color: white; | ||
| 314 | +} | ||
| 315 | +.subTab-item { | ||
| 316 | + padding: 20rpx; | ||
| 317 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 318 | + background-color: white; | ||
| 319 | + border-radius: 8rpx; | ||
| 320 | + box-shadow: 0 8px 12px #e7e9eb; | ||
| 321 | +} | ||
| 322 | +.subTab-item ~ .subTab-item { | ||
| 323 | + margin-top: 20rpx; | ||
| 324 | +} | ||
| 325 | +.pdv10 { | ||
| 326 | + padding-top: 10rpx; | ||
| 327 | + padding-bottom: 10rpx; | ||
| 328 | +} | ||
| 329 | +.pdv20 { | ||
| 330 | + padding-top: 20rpx; | ||
| 331 | + padding-bottom: 20rpx; | ||
| 332 | +} | ||
| 333 | +.pdb10 { | ||
| 334 | + padding-bottom: 10rpx; | ||
| 335 | +} | ||
| 336 | +.pdb20 { | ||
| 337 | + padding-bottom: 20rpx; | ||
| 338 | +} | ||
| 339 | +.bdr-b { | ||
| 340 | + border-bottom: 2rpx solid #f8f8f8; | ||
| 341 | +} | ||
| 342 | +.dash-b { | ||
| 343 | + border-bottom: 2rpx dashed #ddd; | ||
| 344 | +} | ||
| 345 | +.btn-container { | ||
| 346 | + display: flex; | ||
| 347 | + align-items: flex-end; | ||
| 348 | + font-size: 26rpx; | ||
| 349 | +} | ||
| 350 | + | ||
| 351 | + | ||
| 352 | +/* .popup-container { | ||
| 353 | + content:''; | ||
| 354 | + position: fixed; | ||
| 355 | + top: 0; | ||
| 356 | + bottom: 0; | ||
| 357 | + left: 0; | ||
| 358 | + right: 0; | ||
| 359 | + z-index: 3; | ||
| 360 | + background-color: rgba(0,0,0,.6); | ||
| 361 | + display: flex; | ||
| 362 | + align-items: center; | ||
| 363 | + justify-content: center; | ||
| 364 | +} | ||
| 365 | +.popup { | ||
| 366 | + width: 90%; | ||
| 367 | +} | ||
| 368 | +.popup-content { | ||
| 369 | + box-sizing: border-box; | ||
| 370 | + width: 100%; | ||
| 371 | + background-color: white; | ||
| 372 | + padding: 0 20rpx; | ||
| 373 | + border-radius: 10rpx; | ||
| 374 | + max-height: 1038rpx; | ||
| 375 | +} | ||
| 376 | +.icon-close { | ||
| 377 | + font-size: 60rpx; | ||
| 378 | + color: white; | ||
| 379 | +} | ||
| 380 | +.popup-btn { | ||
| 381 | + padding-top: 30rpx; | ||
| 382 | +} */ | ||
| 383 | + | ||
| 384 | +/* .popup-title { */ | ||
| 385 | + /* font-size: 28rpx; */ | ||
| 386 | + /* font-weight: bold; | ||
| 387 | + padding: 20rpx 0; | ||
| 388 | +} */ | ||
| 389 | +/* .popup-title2 { */ | ||
| 390 | + /* padding: 10rpx 0; */ | ||
| 391 | + /* padding-bottom: 8rpx; | ||
| 392 | +} | ||
| 393 | +.popup-title3 { | ||
| 394 | + padding-left: 34rpx; | ||
| 395 | + font-size: 30rpx; | ||
| 396 | +} | ||
| 397 | +.popup-list { | ||
| 398 | + max-height: 602rpx; | ||
| 399 | + overflow-y: auto; | ||
| 400 | +} | ||
| 401 | + | ||
| 402 | + | ||
| 403 | +radio .wx-radio-input { | ||
| 404 | + width: 28rpx; | ||
| 405 | + height: 28rpx; | ||
| 406 | +} | ||
| 407 | + | ||
| 408 | + | ||
| 409 | +radio .wx-radio-input.wx-radio-input-checked { | ||
| 410 | + background-color: #FE6867; | ||
| 411 | + border-color: #FE6867; | ||
| 412 | +} | ||
| 413 | +radio .wx-radio-input.wx-radio-input-checked::before{ | ||
| 414 | + color: white; | ||
| 415 | +} */ | ||
| 416 | + | ||
| 417 | +/* .popup-content.active { | ||
| 418 | + max-height: 982rpx; | ||
| 419 | + overflow: auto; | ||
| 420 | +} */ | ||
| 421 | + | ||
| 422 | +.banner-container { | ||
| 423 | + height: 360rpx; | ||
| 424 | +} | ||
| 425 | +.banner { | ||
| 426 | + display: block; | ||
| 427 | + width: 100%; | ||
| 428 | + height: 100%; | ||
| 429 | +} | ||
| 0 | \ No newline at end of file | 430 | \ No newline at end of file |
packageA/pages/quan/quan.js
| @@ -33,6 +33,10 @@ Page({ | @@ -33,6 +33,10 @@ Page({ | ||
| 33 | } | 33 | } |
| 34 | this.requestGoodsList(); | 34 | this.requestGoodsList(); |
| 35 | this.setData({getcurday:ut.gettimestamp()}); | 35 | this.setData({getcurday:ut.gettimestamp()}); |
| 36 | + | ||
| 37 | + wx.setNavigationBarTitle({ | ||
| 38 | + title: "免费优惠券列表", | ||
| 39 | + }) | ||
| 36 | 40 | ||
| 37 | }, | 41 | }, |
| 38 | 42 |
packageA/pages/quan/quan.json
| @@ -3,6 +3,6 @@ | @@ -3,6 +3,6 @@ | ||
| 3 | "nodata": "/components/nodata/nodata", | 3 | "nodata": "/components/nodata/nodata", |
| 4 | "share_button": "/components/share/share" | 4 | "share_button": "/components/share/share" |
| 5 | }, | 5 | }, |
| 6 | - "navigationBarTitleText": "优惠券列表", | 6 | + "navigationBarTitleText": "免费优惠券列表", |
| 7 | "enablePullDownRefresh": false | 7 | "enablePullDownRefresh": false |
| 8 | } | 8 | } |
| 9 | \ No newline at end of file | 9 | \ No newline at end of file |
packageA/pages/quan/quan.wxml
| @@ -3,18 +3,17 @@ | @@ -3,18 +3,17 @@ | ||
| 3 | <!-- 列表 --> | 3 | <!-- 列表 --> |
| 4 | <!-- <view class="list-container"> --> | 4 | <!-- <view class="list-container"> --> |
| 5 | <!-- 标题 --> | 5 | <!-- 标题 --> |
| 6 | - <view class="subTab-title flex"> | 6 | + <!-- <view class="subTab-title flex"> |
| 7 | <block wx:for="{{tab2}}"> | 7 | <block wx:for="{{tab2}}"> |
| 8 | <view class="subTab-titleItem {{currentIndex2 == index ? 'active':''}}" data-index="{{index}}" bindtap="clickTab2">{{item}}</view> | 8 | <view class="subTab-titleItem {{currentIndex2 == index ? 'active':''}}" data-index="{{index}}" bindtap="clickTab2">{{item}}</view> |
| 9 | </block> | 9 | </block> |
| 10 | - </view> | 10 | + </view> --> |
| 11 | <!-- 列表项 --> | 11 | <!-- 列表项 --> |
| 12 | <scroll-view | 12 | <scroll-view |
| 13 | class="list" | 13 | class="list" |
| 14 | scroll-y="true" | 14 | scroll-y="true" |
| 15 | bindscrolltolower="refresh" | 15 | bindscrolltolower="refresh" |
| 16 | - scroll-anchoring | ||
| 17 | - refresher-enabled> | 16 | + scroll-anchoring> |
| 18 | 17 | ||
| 19 | <block wx:for="{{list}}"> | 18 | <block wx:for="{{list}}"> |
| 20 | <view class="coupons bg-red" bindtap="go_quan" data-index="{{index}}"> | 19 | <view class="coupons bg-red" bindtap="go_quan" data-index="{{index}}"> |
packageA/pages/quan/quan.wxss
| @@ -85,7 +85,8 @@ page { | @@ -85,7 +85,8 @@ page { | ||
| 85 | } | 85 | } |
| 86 | .list { | 86 | .list { |
| 87 | box-sizing: border-box; | 87 | box-sizing: border-box; |
| 88 | - height: calc(100% - 78rpx); | 88 | + /* height: calc(100% - 78rpx); */ |
| 89 | + height: 100%; | ||
| 89 | background-color: #f2f2f2; | 90 | background-color: #f2f2f2; |
| 90 | padding: 20rpx 20rpx 0 20rpx; | 91 | padding: 20rpx 20rpx 0 20rpx; |
| 91 | /* padding-bottom: 102rpx; */ | 92 | /* padding-bottom: 102rpx; */ |
pages/cart/cart2/cart2.js
| @@ -142,8 +142,9 @@ Page({ | @@ -142,8 +142,9 @@ Page({ | ||
| 142 | //----------子页返回父页触发---------- | 142 | //----------子页返回父页触发---------- |
| 143 | onShow: function() { | 143 | onShow: function() { |
| 144 | var th=this; | 144 | var th=this; |
| 145 | - th.setData({show_submit:0}); | ||
| 146 | - | 145 | + th.setData({show_submit:0}); //让提交先掩藏 |
| 146 | + th.data.g_cart_q_time=null; | ||
| 147 | + | ||
| 147 | if (th.data.isclose==0){ | 148 | if (th.data.isclose==0){ |
| 148 | wx.navigateTo({ | 149 | wx.navigateTo({ |
| 149 | url: "/pages/index/index/index" | 150 | url: "/pages/index/index/index" |
| @@ -739,6 +740,152 @@ Page({ | @@ -739,6 +740,152 @@ Page({ | ||
| 739 | }); | 740 | }); |
| 740 | }, | 741 | }, |
| 741 | 742 | ||
| 743 | + calc_per:async function(c_arr){ | ||
| 744 | + var th=this; | ||
| 745 | + //-- 循环处理 -- | ||
| 746 | + for(var i in c_arr){ | ||
| 747 | + var cart_item=c_arr[i]; //就是每一单的意思 | ||
| 748 | + var pickid=cart_item.pickup_id; | ||
| 749 | + var ord_goods=c_arr[i].goods; //就是每一单的从表的意思 | ||
| 750 | + var o_price=0,q_conditin=0; | ||
| 751 | + //--------循环计算总价----------- | ||
| 752 | + for(var j=0;j<ord_goods.length;j++){ | ||
| 753 | + o_price += ord_goods[j].goods_price * ord_goods[j].goods_num; | ||
| 754 | + } | ||
| 755 | + | ||
| 756 | + //---如果该门店的相关活动,就要算一下减价-- | ||
| 757 | + if(th.data.prom_goods_map[pickid]){ | ||
| 758 | + var ob=th.data.prom_goods_map[pickid]; | ||
| 759 | + for(var ii in ob){ | ||
| 760 | + var item_map=ob[ii]; | ||
| 761 | + if(item_map.bs==undefined || item_map.bs==null) { | ||
| 762 | + //等待,获取一下优惠活动的信息 | ||
| 763 | + await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | ||
| 764 | + data: { | ||
| 765 | + price: item_map.price, prom_id: item_map.prom_id, | ||
| 766 | + goods_num: item_map.goods_num, user_id: getApp().globalData.user_id, | ||
| 767 | + is_bz: item_map.is_bz | ||
| 768 | + } | ||
| 769 | + }).then(res => { | ||
| 770 | + if (res.data.code == 0 && res.data.data.condition) { | ||
| 771 | + var get_data = res.data.data; | ||
| 772 | + item_map.is_bz = get_data.is_bz; //是不是倍增 | ||
| 773 | + item_map.bs = get_data.bs; //是不是倍数 | ||
| 774 | + item_map.is_past = get_data.is_past; //是不是包邮 | ||
| 775 | + item_map.prom_price = get_data.price>=0?get_data.price:item_map.price; | ||
| 776 | + item_map.s_intValue = get_data.intValue; | ||
| 777 | + item_map.s_coupon_id = get_data.coupon_id; | ||
| 778 | + item_map.s_coupon_num = get_data.coupon_num; | ||
| 779 | + if(get_data.gift_id && get_data.goodsinfo) { | ||
| 780 | + item_map.gift_id = get_data.gift_id; | ||
| 781 | + item_map.gift_goods_id = get_data.goods_id; | ||
| 782 | + item_map.gift_goods_name = get_data.goods_name; | ||
| 783 | + item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : ''; | ||
| 784 | + item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : ''; | ||
| 785 | + item_map.gift_original_img = get_data.goodsinfo.original_img; | ||
| 786 | + item_map.gift_limit_num = get_data.limit_num; | ||
| 787 | + item_map.gift_storecount = get_data.gift_storecount; | ||
| 788 | + item_map.gift_weight = get_data.goodsinfo.weight; | ||
| 789 | + item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; | ||
| 790 | + item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; | ||
| 791 | + | ||
| 792 | + } | ||
| 793 | + item_map.s_libao = get_data.libao; | ||
| 794 | + item_map.s_lb_num = get_data.lb_num; | ||
| 795 | + } | ||
| 796 | + }) | ||
| 797 | + } | ||
| 798 | + | ||
| 799 | + //有活动,且优惠活动并没有限制使用优惠券,且有减价 | ||
| 800 | + //--看有没有减价-- | ||
| 801 | + //if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){ | ||
| 802 | + if(item_map.price-item_map.prom_price && item_map.prom_price!==null){ | ||
| 803 | + if(cart_item.prom_pt_json){ | ||
| 804 | + cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}) | ||
| 805 | + }else{ | ||
| 806 | + cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}]; | ||
| 807 | + } | ||
| 808 | + | ||
| 809 | + //-- 如果系统要平摊到单品 -- | ||
| 810 | + //if(!th.data.ispt_goods){ | ||
| 811 | + var pt_data={ | ||
| 812 | + 'prom_id':item_map.prom_id, | ||
| 813 | + 'dis': parseFloat((item_map.price-item_map.prom_price).toFixed(2)), | ||
| 814 | + 'goods':item_map.goods | ||
| 815 | + } | ||
| 816 | + | ||
| 817 | + var pt_res=null; | ||
| 818 | + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{ | ||
| 819 | + if(res.data.code==0){ pt_res=res.data.data; } | ||
| 820 | + }) | ||
| 821 | + if(pt_res){ | ||
| 822 | + for (var io in item_map.goods){ | ||
| 823 | + //平摊赋值 | ||
| 824 | + item_map.goods[io].account_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account; | ||
| 825 | + item_map.goods[io].account_yu_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account_yu; | ||
| 826 | + if(!th.data.ispt_goods){ | ||
| 827 | + item_map.goods[io].account=item_map.goods[io].account_fir; | ||
| 828 | + item_map.goods[io].account_yu=item_map.goods[io].account_yu_fir; | ||
| 829 | + } | ||
| 830 | + } | ||
| 831 | + } | ||
| 832 | + // } | ||
| 833 | + | ||
| 834 | + o_price-=(item_map.price-item_map.prom_price); | ||
| 835 | + //如果有限制使用优惠券,就要减掉参与的活动商品的钱 | ||
| 836 | + if(!item_map.is_xz_yh) q_conditin=o_price; | ||
| 837 | + } | ||
| 838 | + | ||
| 839 | + //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表----------- | ||
| 840 | + for(var j=0;j<ord_goods.length;j++){ | ||
| 841 | + if(ord_goods[j].is_gift) continue; | ||
| 842 | + if(ord_goods[j].prom_type==3 && ord_goods[j].prom_id==item_map.prom_id){ | ||
| 843 | + ord_goods[j].is_xz_yh= item_map.is_xz_yh; | ||
| 844 | + ord_goods[j].is_past= item_map.is_past; | ||
| 845 | + ord_goods[j].account_fir= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account_fir; | ||
| 846 | + ord_goods[j].account_yu_fir= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account_yu_fir; | ||
| 847 | + ord_goods[j].account= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account; | ||
| 848 | + ord_goods[j].account_yu= th.item_map_get_goods(ord_goods[j].goods_id,item_map).account_yu; | ||
| 849 | + } | ||
| 850 | + } | ||
| 851 | + | ||
| 852 | + | ||
| 853 | + //--优惠多少钱-- | ||
| 854 | + if(!cart_item.cut_price) cart_item.cut_price=0; | ||
| 855 | + cart_item.cut_price+=(item_map.price-item_map.prom_price); | ||
| 856 | + //---如果有送积分--- | ||
| 857 | + if(item_map.s_intValue){ | ||
| 858 | + if(!cart_item.s_intValue) cart_item.s_intValue=0; | ||
| 859 | + cart_item.s_intValue+=item_map.s_intValue; | ||
| 860 | + } | ||
| 861 | + //-- 如果有送优惠券的情况 -- | ||
| 862 | + if(item_map.s_coupon_id){ | ||
| 863 | + if(!cart_item.s_coupon_id) { | ||
| 864 | + cart_item.s_coupon_id=item_map.s_coupon_id+""; | ||
| 865 | + cart_item.g_coupon_num=[{'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}]; | ||
| 866 | + } | ||
| 867 | + else{ | ||
| 868 | + cart_item.s_coupon_id+=","+item_map.s_coupon_id; | ||
| 869 | + cart_item.g_coupon_num.push({'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}) | ||
| 870 | + } | ||
| 871 | + } | ||
| 872 | + | ||
| 873 | + //-- 如果有送优包邮券的情况 -- | ||
| 874 | + if(item_map.s_libao){ | ||
| 875 | + if(!cart_item.s_libao) { | ||
| 876 | + cart_item.s_libao=item_map.s_libao+""; | ||
| 877 | + cart_item.g_lb_num=[{'l_id':item_map.s_libao,"num": item_map.s_lb_num}]; | ||
| 878 | + } | ||
| 879 | + else{ | ||
| 880 | + cart_item.s_libao+=","+item_map.s_libao; | ||
| 881 | + cart_item.g_lb_num.push({'l_id':item_map.s_libao,"num": item_map.s_lb_num}) | ||
| 882 | + } | ||
| 883 | + } | ||
| 884 | + } | ||
| 885 | + } | ||
| 886 | + } | ||
| 887 | + }, | ||
| 888 | + | ||
| 742 | //-------------------计算订单价格------------------- | 889 | //-------------------计算订单价格------------------- |
| 743 | calculatePrice: function(t, s) { | 890 | calculatePrice: function(t, s) { |
| 744 | var th = this; | 891 | var th = this; |
| @@ -770,7 +917,17 @@ Page({ | @@ -770,7 +917,17 @@ Page({ | ||
| 770 | } | 917 | } |
| 771 | }) | 918 | }) |
| 772 | }; | 919 | }; |
| 773 | - var c_arr=JSON.parse(JSON.stringify(th.data.old_cartlist)); | 920 | + var c_arr=JSON.parse(JSON.stringify(th.data.old_cartlist)); |
| 921 | + if(th.data.cartlist && th.data.cartlist.length>0){ | ||
| 922 | + for(var i =0;i<c_arr.length;i++){ | ||
| 923 | + c_arr[i].exp_type=th.data.cartlist[i].exp_type; | ||
| 924 | + } | ||
| 925 | + } | ||
| 926 | + | ||
| 927 | + //调用函数计算每件商品的单价 | ||
| 928 | + await th.calc_per(c_arr); | ||
| 929 | + //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品 | ||
| 930 | + await th.get_cart_quan(c_arr); | ||
| 774 | //---循环购物车--- | 931 | //---循环购物车--- |
| 775 | for(var i in c_arr){ | 932 | for(var i in c_arr){ |
| 776 | //因为搭配购买也是再这里计算,搭配购的is_b_now==1 | 933 | //因为搭配购买也是再这里计算,搭配购的is_b_now==1 |
| @@ -798,142 +955,16 @@ Page({ | @@ -798,142 +955,16 @@ Page({ | ||
| 798 | for(var j=0;j<item.length;j++){ | 955 | for(var j=0;j<item.length;j++){ |
| 799 | o_price += item[j].goods_price * item[j].goods_num; | 956 | o_price += item[j].goods_price * item[j].goods_num; |
| 800 | } | 957 | } |
| 958 | + | ||
| 959 | + //如果又优惠的钱,就要减价 | ||
| 960 | + if(c_arr[i].cut_price>0) o_price-=c_arr[i].cut_price; | ||
| 961 | + | ||
| 801 | var f_o_price=o_price; | 962 | var f_o_price=o_price; |
| 802 | 963 | ||
| 803 | //判断包邮券的钱 | 964 | //判断包邮券的钱 |
| 804 | var q_conditin=0; | 965 | var q_conditin=0; |
| 805 | q_conditin=o_price; | 966 | q_conditin=o_price; |
| 806 | - //---如果该门店的相关活动,就要算一下减价-- | ||
| 807 | - if(th.data.prom_goods_map[pickid]){ | ||
| 808 | - var ob=th.data.prom_goods_map[pickid]; | ||
| 809 | - for(var ii in ob){ | ||
| 810 | - var item_map=ob[ii]; | ||
| 811 | - if(item_map.bs==undefined || item_map.bs==null) { | ||
| 812 | - //等待,获取一下优惠活动的信息 | ||
| 813 | - await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | ||
| 814 | - data: { | ||
| 815 | - price: item_map.price, prom_id: item_map.prom_id, | ||
| 816 | - goods_num: item_map.goods_num, user_id: getApp().globalData.user_id, | ||
| 817 | - is_bz: item_map.is_bz | ||
| 818 | - } | ||
| 819 | - }).then(res => { | ||
| 820 | - if (res.data.code == 0 && res.data.data.condition) { | ||
| 821 | - var get_data = res.data.data; | ||
| 822 | - item_map.is_bz = get_data.is_bz; //是不是倍增 | ||
| 823 | - item_map.bs = get_data.bs; //是不是倍数 | ||
| 824 | - item_map.is_past = get_data.is_past; //是不是包邮 | ||
| 825 | - item_map.prom_price = get_data.price>=0?get_data.price:item_map.price; | ||
| 826 | - item_map.s_intValue = get_data.intValue; | ||
| 827 | - item_map.s_coupon_id = get_data.coupon_id; | ||
| 828 | - item_map.s_coupon_num = get_data.coupon_num; | ||
| 829 | - if(get_data.gift_id && get_data.goodsinfo) { | ||
| 830 | - item_map.gift_id = get_data.gift_id; | ||
| 831 | - item_map.gift_goods_id = get_data.goods_id; | ||
| 832 | - item_map.gift_goods_name = get_data.goods_name; | ||
| 833 | - item_map.gift_goods_color = get_data.goodsinfo.goods_color ? get_data.goodsinfo.goods_color : ''; | ||
| 834 | - item_map.gift_goods_spec = get_data.goodsinfo.goods_spec ? get_data.goodsinfo.goods_spec : ''; | ||
| 835 | - item_map.gift_original_img = get_data.goodsinfo.original_img; | ||
| 836 | - item_map.gift_limit_num = get_data.limit_num; | ||
| 837 | - item_map.gift_storecount = get_data.gift_storecount; | ||
| 838 | - item_map.gift_weight = get_data.goodsinfo.weight; | ||
| 839 | - item_map.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type; | ||
| 840 | - item_map.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum; | ||
| 841 | - | ||
| 842 | - } | ||
| 843 | - item_map.s_libao = get_data.libao; | ||
| 844 | - item_map.s_lb_num = get_data.lb_num; | ||
| 845 | - } | ||
| 846 | - }) | ||
| 847 | - } | ||
| 848 | - | ||
| 849 | - //有活动,且优惠活动并没有限制使用优惠券,且有减价 | ||
| 850 | - //--看有没有减价-- | ||
| 851 | - //if(item_map.prom_price>=0 && item_map.price-item_map.prom_price){ | ||
| 852 | - if(item_map.price-item_map.prom_price && item_map.prom_price!==null){ | ||
| 853 | - if(cart_item.prom_pt_json){ | ||
| 854 | - cart_item.prom_pt_json.push({"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}) | ||
| 855 | - }else{ | ||
| 856 | - cart_item.prom_pt_json=[{"prom_id":item_map.prom_id,"dis":(item_map.price-item_map.prom_price).toFixed(2),"ispt":0}]; | ||
| 857 | - } | ||
| 858 | - | ||
| 859 | - //-- 如果系统要平摊到单品 -- | ||
| 860 | - //if(!th.data.ispt_goods){ | ||
| 861 | - var pt_data={ | ||
| 862 | - 'prom_id':item_map.prom_id, | ||
| 863 | - 'dis': parseFloat((item_map.price-item_map.prom_price).toFixed(2)), | ||
| 864 | - 'goods':item_map.goods | ||
| 865 | - } | ||
| 866 | - | ||
| 867 | - var pt_res=null; | ||
| 868 | - await getApp().request.promisePost("/api/weshop/order/getGoodsSplit",{is_json:1,data:pt_data}).then(res=>{ | ||
| 869 | - if(res.data.code==0){ pt_res=res.data.data; } | ||
| 870 | - }) | ||
| 871 | - if(pt_res){ | ||
| 872 | - for (var io in item_map.goods){ | ||
| 873 | - //平摊赋值 | ||
| 874 | - item_map.goods[io].account_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account; | ||
| 875 | - item_map.goods[io].account_yu_fir=th.arr_get_goods(item_map.goods[io].goods_id,pt_res).fisrt_account_yu; | ||
| 876 | - if(!th.data.ispt_goods){ | ||
| 877 | - item_map.goods[io].account=item_map.goods[io].account_fir; | ||
| 878 | - item_map.goods[io].account_yu=item_map.goods[io].account_yu_fir; | ||
| 879 | - } | ||
| 880 | - } | ||
| 881 | - } | ||
| 882 | - // } | ||
| 883 | - | ||
| 884 | - o_price-=(item_map.price-item_map.prom_price); | ||
| 885 | - //如果有限制使用优惠券,就要减掉参与的活动商品的钱 | ||
| 886 | - if(!item_map.is_xz_yh) q_conditin=o_price; | ||
| 887 | - } | ||
| 888 | - | ||
| 889 | - //--------循环计算商品是不是包邮,是不是使用优惠券,此时循环是商品从表----------- | ||
| 890 | - for(var j=0;j<item.length;j++){ | ||
| 891 | - if(item[j].is_gift) continue; | ||
| 892 | - if(item[j].prom_type==3 && item[j].prom_id==item_map.prom_id){ | ||
| 893 | - item[j].is_xz_yh= item_map.is_xz_yh; | ||
| 894 | - item[j].is_past= item_map.is_past; | ||
| 895 | - item[j].account_fir= th.item_map_get_goods(item[j].goods_id,item_map).account_fir; | ||
| 896 | - item[j].account_yu_fir= th.item_map_get_goods(item[j].goods_id,item_map).account_yu_fir; | ||
| 897 | - item[j].account= th.item_map_get_goods(item[j].goods_id,item_map).account; | ||
| 898 | - item[j].account_yu= th.item_map_get_goods(item[j].goods_id,item_map).account_yu; | ||
| 899 | - } | ||
| 900 | - } | ||
| 901 | - | ||
| 902 | - | ||
| 903 | - //--优惠多少钱-- | ||
| 904 | - if(!cart_item.cut_price) cart_item.cut_price=0; | ||
| 905 | - cart_item.cut_price+=(item_map.price-item_map.prom_price); | ||
| 906 | - //---如果有送积分--- | ||
| 907 | - if(item_map.s_intValue){ | ||
| 908 | - if(!cart_item.s_intValue) cart_item.s_intValue=0; | ||
| 909 | - cart_item.s_intValue+=item_map.s_intValue; | ||
| 910 | - } | ||
| 911 | - //-- 如果有送优惠券的情况 -- | ||
| 912 | - if(item_map.s_coupon_id){ | ||
| 913 | - if(!cart_item.s_coupon_id) { | ||
| 914 | - cart_item.s_coupon_id=item_map.s_coupon_id+""; | ||
| 915 | - cart_item.g_coupon_num=[{'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}]; | ||
| 916 | - } | ||
| 917 | - else{ | ||
| 918 | - cart_item.s_coupon_id+=","+item_map.s_coupon_id; | ||
| 919 | - cart_item.g_coupon_num.push({'c_id':item_map.s_coupon_id,"num": item_map.s_coupon_num}) | ||
| 920 | - } | ||
| 921 | - } | ||
| 922 | - | ||
| 923 | - //-- 如果有送优包邮券的情况 -- | ||
| 924 | - if(item_map.s_libao){ | ||
| 925 | - if(!cart_item.s_libao) { | ||
| 926 | - cart_item.s_libao=item_map.s_libao+""; | ||
| 927 | - cart_item.g_lb_num=[{'l_id':item_map.s_libao,"num": item_map.s_lb_num}]; | ||
| 928 | - } | ||
| 929 | - else{ | ||
| 930 | - cart_item.s_libao+=","+item_map.s_libao; | ||
| 931 | - cart_item.g_lb_num.push({'l_id':item_map.s_libao,"num": item_map.s_lb_num}) | ||
| 932 | - } | ||
| 933 | - } | ||
| 934 | - } | ||
| 935 | - } | ||
| 936 | - | 967 | + |
| 937 | cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算 | 968 | cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算 |
| 938 | //计算物流费用 | 969 | //计算物流费用 |
| 939 | cart_item.shipping_price = 0; | 970 | cart_item.shipping_price = 0; |
| @@ -993,7 +1024,10 @@ Page({ | @@ -993,7 +1024,10 @@ Page({ | ||
| 993 | } | 1024 | } |
| 994 | 1025 | ||
| 995 | var quan_no=null; | 1026 | var quan_no=null; |
| 996 | - if(th.data.using_quan[pickid])quan_no=th.data.using_quan[pickid].coupon_no; | 1027 | + if(th.data.using_quan[pickid]){ |
| 1028 | + quan_no=th.data.using_quan[pickid].coupon_no; | ||
| 1029 | + } | ||
| 1030 | + | ||
| 997 | //如果是包邮券的时候,要看看券的情况 | 1031 | //如果是包邮券的时候,要看看券的情况 |
| 998 | if(quan_no && th.data.using_quan[pickid].isby==1){ | 1032 | if(quan_no && th.data.using_quan[pickid].isby==1){ |
| 999 | var quan=th.data.using_quan[pickid]; | 1033 | var quan=th.data.using_quan[pickid]; |
| @@ -1069,7 +1103,9 @@ Page({ | @@ -1069,7 +1103,9 @@ Page({ | ||
| 1069 | //计算物流价格 | 1103 | //计算物流价格 |
| 1070 | if (cart_item.exp_type == 0) { | 1104 | if (cart_item.exp_type == 0) { |
| 1071 | freight_free=0; //后面不在进行判断 | 1105 | freight_free=0; //后面不在进行判断 |
| 1072 | - var code = th.data.wu_arr[cart_item.wind].code; | 1106 | + var code = ""; |
| 1107 | + if(th.data.wu_arr && th.data.wu_arr[cart_item.wind]) | ||
| 1108 | + code=th.data.wu_arr[cart_item.wind].code; | ||
| 1073 | cart_item.shipping_price = | 1109 | cart_item.shipping_price = |
| 1074 | th.calculatewuliu(code, o_shipping_price, goods_weight, | 1110 | th.calculatewuliu(code, o_shipping_price, goods_weight, |
| 1075 | goods_piece,th.data.user_addr, freight_free, o_price, rs); | 1111 | goods_piece,th.data.user_addr, freight_free, o_price, rs); |
| @@ -1093,6 +1129,7 @@ Page({ | @@ -1093,6 +1129,7 @@ Page({ | ||
| 1093 | if(quan_no){ | 1129 | if(quan_no){ |
| 1094 | //如果不是包邮券的时候 | 1130 | //如果不是包邮券的时候 |
| 1095 | if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby!=1) { | 1131 | if(th.data.using_quan[pickid] && th.data.using_quan[pickid].isby!=1) { |
| 1132 | + var ui=2; | ||
| 1096 | //---获取优惠券优惠--- | 1133 | //---获取优惠券优惠--- |
| 1097 | await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { | 1134 | await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { |
| 1098 | data: { | 1135 | data: { |
| @@ -1335,12 +1372,12 @@ Page({ | @@ -1335,12 +1372,12 @@ Page({ | ||
| 1335 | goods_piece += good['buynum']; break; | 1372 | goods_piece += good['buynum']; break; |
| 1336 | } | 1373 | } |
| 1337 | 1374 | ||
| 1338 | - var code = th.data.wu_arr[th.data.index].code; | 1375 | + var code =""; |
| 1376 | + if(th.data.wu_arr && th.data.wu_arr[th.data.index]) code=th.data.wu_arr[th.data.index].code; | ||
| 1339 | var freight_free = ee.freight_free; //全场满多少包邮 | 1377 | var freight_free = ee.freight_free; //全场满多少包邮 |
| 1340 | var no_ex_id=ee.no_ex_id; | 1378 | var no_ex_id=ee.no_ex_id; |
| 1341 | th.data.is_no_by[th.data.bn_pick]=0; | 1379 | th.data.is_no_by[th.data.bn_pick]=0; |
| 1342 | 1380 | ||
| 1343 | - | ||
| 1344 | var no_by_data=null; | 1381 | var no_by_data=null; |
| 1345 | var gift_freight_free=freight_free; | 1382 | var gift_freight_free=freight_free; |
| 1346 | //有不包邮区域,且不免运费 | 1383 | //有不包邮区域,且不免运费 |
| @@ -2228,6 +2265,7 @@ Page({ | @@ -2228,6 +2265,7 @@ Page({ | ||
| 2228 | if (item == null) return o_shipping_price; | 2265 | if (item == null) return o_shipping_price; |
| 2229 | var fw_price = 0, fp_price=0; | 2266 | var fw_price = 0, fp_price=0; |
| 2230 | item=item.config; | 2267 | item=item.config; |
| 2268 | + if (item == null) return o_shipping_price; | ||
| 2231 | //------按重量---------- | 2269 | //------按重量---------- |
| 2232 | if (goods_weight>=0 && item['money']) { | 2270 | if (goods_weight>=0 && item['money']) { |
| 2233 | fw_price =parseFloat(item['money']); | 2271 | fw_price =parseFloat(item['money']); |
| @@ -2302,13 +2340,19 @@ Page({ | @@ -2302,13 +2340,19 @@ Page({ | ||
| 2302 | 2340 | ||
| 2303 | for(var i in quanlist){ | 2341 | for(var i in quanlist){ |
| 2304 | quanlist[i].is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); | 2342 | quanlist[i].is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); |
| 2305 | - if(!t_user || quanlist[i].CashRepNo!=t_user.coupon_no) quanlist[i].show_red=0; | 2343 | + if(t_user && quanlist[i].CashRepNo==t_user.coupon_no) |
| 2344 | + quanlist[i].show_red=1; | ||
| 2345 | + else | ||
| 2346 | + quanlist[i].show_red=0; | ||
| 2306 | } | 2347 | } |
| 2307 | 2348 | ||
| 2308 | if(get_by_quan_list_cart){ | 2349 | if(get_by_quan_list_cart){ |
| 2309 | for(var i in get_by_quan_list_cart){ | 2350 | for(var i in get_by_quan_list_cart){ |
| 2310 | get_by_quan_list_cart[i].is_using= th.check_in_sele(get_by_quan_list_cart[i].no,pickid); | 2351 | get_by_quan_list_cart[i].is_using= th.check_in_sele(get_by_quan_list_cart[i].no,pickid); |
| 2311 | - if(!t_user || get_by_quan_list_cart[i].no!=t_user.coupon_no) get_by_quan_list_cart[i].show_red=0; | 2352 | + if(t_user && get_by_quan_list_cart[i].no==t_user.coupon_no) |
| 2353 | + get_by_quan_list_cart[i].show_red=1; | ||
| 2354 | + else | ||
| 2355 | + get_by_quan_list_cart[i].show_red=0; | ||
| 2312 | } | 2356 | } |
| 2313 | th.setData({by_quan_list_cart:get_by_quan_list_cart}); | 2357 | th.setData({by_quan_list_cart:get_by_quan_list_cart}); |
| 2314 | }else { | 2358 | }else { |
| @@ -2744,12 +2788,13 @@ Page({ | @@ -2744,12 +2788,13 @@ Page({ | ||
| 2744 | },500); | 2788 | },500); |
| 2745 | }, | 2789 | }, |
| 2746 | //-----获取购物车进来的劵------- | 2790 | //-----获取购物车进来的劵------- |
| 2747 | - get_cart_quan:function () { | 2791 | + get_cart_quan:async function (order_prom_list_cart) { |
| 2748 | var th=this; | 2792 | var th=this; |
| 2749 | var is_xz_yh=1; | 2793 | var is_xz_yh=1; |
| 2750 | //等待值的出现 | 2794 | //等待值的出现 |
| 2751 | - getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { | ||
| 2752 | - var arr=th.data.order_prom_list_cart; | 2795 | + //getApp().waitfor2(this,"g_cart_q_time","order_prom_list_cart",async function () { |
| 2796 | + //var arr=th.data.order_prom_list_cart; | ||
| 2797 | + var arr=order_prom_list_cart; | ||
| 2753 | //如果系统有限制使用优惠券 | 2798 | //如果系统有限制使用优惠券 |
| 2754 | if(th.data.is_close_quan) return false; | 2799 | if(th.data.is_close_quan) return false; |
| 2755 | //------------开始计算使用优惠券相关------------ | 2800 | //------------开始计算使用优惠券相关------------ |
| @@ -2828,7 +2873,7 @@ Page({ | @@ -2828,7 +2873,7 @@ Page({ | ||
| 2828 | th.set_can_num(); | 2873 | th.set_can_num(); |
| 2829 | } | 2874 | } |
| 2830 | 2875 | ||
| 2831 | - }) | 2876 | + //}) |
| 2832 | }, | 2877 | }, |
| 2833 | 2878 | ||
| 2834 | //------ 获取立即购买的购物车的劵 -------- | 2879 | //------ 获取立即购买的购物车的劵 -------- |
pages/goods/goodsInfo/goodsInfo.js
| @@ -241,6 +241,8 @@ Page({ | @@ -241,6 +241,8 @@ Page({ | ||
| 241 | 241 | ||
| 242 | poster:null, //自定义海报 | 242 | poster:null, //自定义海报 |
| 243 | share_b_img:'', //自定义分享的背景 | 243 | share_b_img:'', //自定义分享的背景 |
| 244 | + | ||
| 245 | + showPoster: false, | ||
| 244 | }, | 246 | }, |
| 245 | 247 | ||
| 246 | //------初始化加载---------- | 248 | //------初始化加载---------- |
| @@ -1536,6 +1538,7 @@ Page({ | @@ -1536,6 +1538,7 @@ Page({ | ||
| 1536 | 1538 | ||
| 1537 | //--点击分享事件--- | 1539 | //--点击分享事件--- |
| 1538 | onShareAppMessage: function(t) { | 1540 | onShareAppMessage: function(t) { |
| 1541 | + | ||
| 1539 | var th = this; | 1542 | var th = this; |
| 1540 | var price = th.data.data.shop_price; | 1543 | var price = th.data.data.shop_price; |
| 1541 | if (th.data.prom_act) { | 1544 | if (th.data.prom_act) { |
| @@ -3330,10 +3333,13 @@ Page({ | @@ -3330,10 +3333,13 @@ Page({ | ||
| 3330 | //先画背景 | 3333 | //先画背景 |
| 3331 | var pg_path = "../../../images/share/share_bg.png"; | 3334 | var pg_path = "../../../images/share/share_bg.png"; |
| 3332 | 3335 | ||
| 3336 | + // context.fillStyle="#FFFFFF"; | ||
| 3337 | + // context.fillRect(0,0,554 * unit, 899 * unit); | ||
| 3338 | + | ||
| 3333 | //-- 如果有自定义海报的时候,判断背景的图片 -- | 3339 | //-- 如果有自定义海报的时候,判断背景的图片 -- |
| 3334 | if(th.data.share_b_img){ | 3340 | if(th.data.share_b_img){ |
| 3335 | pg_path=th.data.share_b_img; | 3341 | pg_path=th.data.share_b_img; |
| 3336 | - } | 3342 | + } |
| 3337 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | 3343 | context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); |
| 3338 | 3344 | ||
| 3339 | //-- 是自定义海报的情况下 -- | 3345 | //-- 是自定义海报的情况下 -- |
| @@ -3655,10 +3661,13 @@ Page({ | @@ -3655,10 +3661,13 @@ Page({ | ||
| 3655 | }) | 3661 | }) |
| 3656 | return false; | 3662 | return false; |
| 3657 | } | 3663 | } |
| 3658 | - wx.previewImage({ | ||
| 3659 | - //将图片预览出来 | ||
| 3660 | - urls: [that.data.shareImgPath] | ||
| 3661 | - }); | 3664 | + // wx.previewImage({ |
| 3665 | + // //将图片预览出来 | ||
| 3666 | + // urls: [that.data.shareImgPath] | ||
| 3667 | + // }); | ||
| 3668 | + that.setData({ | ||
| 3669 | + showPoster: true, | ||
| 3670 | + }); | ||
| 3662 | wx.hideLoading(); | 3671 | wx.hideLoading(); |
| 3663 | } | 3672 | } |
| 3664 | }) | 3673 | }) |
| @@ -4353,8 +4362,118 @@ Page({ | @@ -4353,8 +4362,118 @@ Page({ | ||
| 4353 | }) | 4362 | }) |
| 4354 | } | 4363 | } |
| 4355 | }) | 4364 | }) |
| 4356 | - } | ||
| 4357 | - | ||
| 4358 | - | 4365 | + }, |
| 4366 | + | ||
| 4367 | + closePoster() { | ||
| 4368 | + this.setData({ | ||
| 4369 | + showPoster: false, | ||
| 4370 | + }); | ||
| 4371 | + }, | ||
| 4372 | + | ||
| 4373 | + // 保存图片到手机 | ||
| 4374 | + savePic() { | ||
| 4375 | + console.log('保存图片'); | ||
| 4376 | + var self = this; | ||
| 4377 | + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 | ||
| 4378 | + this.getSetting().then((res) => { | ||
| 4379 | + // 判断用户是否授权了保存到相册的权限,如果没有发起授权 | ||
| 4380 | + if (!res.authSetting['scope.writePhotosAlbum']) { | ||
| 4381 | + this.authorize().then(() => { | ||
| 4382 | + // 同意授权后保存下载文件 | ||
| 4383 | + this.saveImage(self.data.shareImgPath) | ||
| 4384 | + .then(() => { | ||
| 4385 | + self.setData({ | ||
| 4386 | + showPoster: false | ||
| 4387 | + }); | ||
| 4388 | + }); | ||
| 4389 | + }) | ||
| 4390 | + } else { | ||
| 4391 | + // 如果已经授权,保存下载文件 | ||
| 4392 | + this.saveImage(self.data.shareImgPath) | ||
| 4393 | + .then(() => { | ||
| 4394 | + self.setData({ | ||
| 4395 | + showPoster: false | ||
| 4396 | + }); | ||
| 4397 | + }); | ||
| 4398 | + } | ||
| 4399 | + | ||
| 4400 | + }) | ||
| 4401 | + }, | ||
| 4402 | + | ||
| 4403 | + // 获取用户已经授予了哪些权限 | ||
| 4404 | + getSetting() { | ||
| 4405 | + return new Promise((resolve, reject) => { | ||
| 4406 | + wx.getSetting({ | ||
| 4407 | + success: res => { | ||
| 4408 | + resolve(res) | ||
| 4409 | + } | ||
| 4410 | + }) | ||
| 4411 | + }) | ||
| 4412 | + }, | ||
| 4413 | + | ||
| 4414 | + // 发起首次授权请求 | ||
| 4415 | + authorize() { | ||
| 4416 | + // isFirst 用来记录是否为首次发起授权, | ||
| 4417 | + // 如果首次授权拒绝后,isFirst赋值为1 | ||
| 4418 | + let isFirst = wx.getStorageSync('isFirst') || 0; | ||
| 4419 | + return new Promise((resolve, reject) => { | ||
| 4420 | + wx.authorize({ | ||
| 4421 | + scope: 'scope.writePhotosAlbum', | ||
| 4422 | + // 同意授权 | ||
| 4423 | + success: () => { | ||
| 4424 | + resolve(); | ||
| 4425 | + }, | ||
| 4426 | + // 拒绝授权,这里是用户拒绝授权后的回调 | ||
| 4427 | + fail: res => { | ||
| 4428 | + if(isFirst === 0) { | ||
| 4429 | + wx.setStorageSync('isFirst', 1); | ||
| 4430 | + wx.showToast({ | ||
| 4431 | + title: '保存失败', | ||
| 4432 | + icon: 'none', | ||
| 4433 | + duration: 1000 | ||
| 4434 | + }) | ||
| 4435 | + } else { | ||
| 4436 | + this.showModal(); | ||
| 4437 | + } | ||
| 4438 | + console.log('拒绝授权'); | ||
| 4439 | + reject(); | ||
| 4440 | + } | ||
| 4441 | + }) | ||
| 4442 | + }) | ||
| 4443 | + }, | ||
| 4444 | + | ||
| 4445 | + | ||
| 4446 | + // 保存图片到系统相册 | ||
| 4447 | + saveImage(saveUrl) { | ||
| 4448 | + var self = this; | ||
| 4449 | + return new Promise((resolve, reject) => { | ||
| 4450 | + wx.saveImageToPhotosAlbum({ | ||
| 4451 | + filePath: saveUrl, | ||
| 4452 | + success: (res) => { | ||
| 4453 | + wx.showToast({ | ||
| 4454 | + title: '保存成功', | ||
| 4455 | + duration: 1000, | ||
| 4456 | + }); | ||
| 4457 | + self.setData({ | ||
| 4458 | + showPlaybill: 'true' | ||
| 4459 | + }); | ||
| 4460 | + resolve(); | ||
| 4461 | + }, | ||
| 4462 | + fail: () => { | ||
| 4463 | + wx.showToast({ | ||
| 4464 | + title: '保存失败', | ||
| 4465 | + duration: 1000, | ||
| 4466 | + }); | ||
| 4467 | + } | ||
| 4468 | + }) | ||
| 4469 | + }) | ||
| 4470 | + }, | ||
| 4471 | + | ||
| 4472 | + previewImage() { | ||
| 4473 | + wx.previewImage({ | ||
| 4474 | + //将图片预览出来 | ||
| 4475 | + urls: [this.data.shareImgPath] | ||
| 4476 | + }); | ||
| 4477 | + }, | ||
| 4359 | 4478 | ||
| 4360 | }); | 4479 | }); |
pages/goods/goodsInfo/goodsInfo.wxml
| @@ -383,14 +383,14 @@ | @@ -383,14 +383,14 @@ | ||
| 383 | </block> | 383 | </block> |
| 384 | 384 | ||
| 385 | <!-- 门店收货地址 --> | 385 | <!-- 门店收货地址 --> |
| 386 | - <view class="xc-address_frame flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > | 386 | + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > |
| 387 | <view class="address_frame" bindtap="choice_store" data-ind="0"> | 387 | <view class="address_frame" bindtap="choice_store" data-ind="0"> |
| 388 | <view class="flex-vertical-between "> | 388 | <view class="flex-vertical-between "> |
| 389 | <view class="flex-vertical select_store_height"> | 389 | <view class="flex-vertical select_store_height"> |
| 390 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | 390 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| 391 | - <view class="fs30 xc-ash-9f">选择门店</view> | 391 | + <view class="fs30" style="color:black;">选择门店</view> |
| 392 | </view> | 392 | </view> |
| 393 | - <view class="red_bb fs32"> | 393 | + <view class="red_bb fs30"> |
| 394 | 更多门店 | 394 | 更多门店 |
| 395 | <text class="bg_jj"></text> | 395 | <text class="bg_jj"></text> |
| 396 | </view> | 396 | </view> |
| @@ -421,9 +421,9 @@ | @@ -421,9 +421,9 @@ | ||
| 421 | </view> | 421 | </view> |
| 422 | 422 | ||
| 423 | <!--许程 7.24暂时注释 --> | 423 | <!--许程 7.24暂时注释 --> |
| 424 | - <view wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> | 424 | + <view class="bdt16" wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> |
| 425 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> | 425 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> |
| 426 | - <view class="cx-sizs wsize">领券</view> | 426 | + <view class="cx-sizs fs30">领券</view> |
| 427 | <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}"> | 427 | <view class="xc-coupon-fram" wx:for="{{fir_quan}}" wx:key="{{index}}"> |
| 428 | <view class="circle xc-circular xc-one"></view> | 428 | <view class="circle xc-circular xc-one"></view> |
| 429 | <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view> | 429 | <view class="xc-coupon t-c four-level-word">满{{item.condition}}减{{item.money}}</view> |
| @@ -478,7 +478,7 @@ | @@ -478,7 +478,7 @@ | ||
| 478 | </block> | 478 | </block> |
| 479 | 479 | ||
| 480 | 480 | ||
| 481 | - <view class="bz_view flex ai-center" wx:if="{{bconfig}}" style="line-height: 36rpx"> | 481 | + <view class="bz_view flex ai-center bdt16" wx:if="{{bconfig}}" style="line-height: 36rpx"> |
| 482 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> | 482 | <image class="bzfu_img" src="{{iurl}}/miniapp/images/bzfu_w.png"></image> |
| 483 | <view class="bz-content">{{bconfig.service_bz}}</view> | 483 | <view class="bz-content">{{bconfig.service_bz}}</view> |
| 484 | </view> | 484 | </view> |
| @@ -507,7 +507,7 @@ | @@ -507,7 +507,7 @@ | ||
| 507 | 507 | ||
| 508 | 508 | ||
| 509 | <!--- 宝贝评价 ----> | 509 | <!--- 宝贝评价 ----> |
| 510 | - <view style="overflow: hidden"> | 510 | + <view class="bdt16" style="overflow: hidden"> |
| 511 | <view class="bb_view"> | 511 | <view class="bb_view"> |
| 512 | <view>宝贝评价({{categories3[0].num}})</view> | 512 | <view>宝贝评价({{categories3[0].num}})</view> |
| 513 | <view class="red_bb" bindtap="look_pj">查看全部 | 513 | <view class="red_bb" bindtap="look_pj">查看全部 |
| @@ -523,32 +523,34 @@ | @@ -523,32 +523,34 @@ | ||
| 523 | </view> | 523 | </view> |
| 524 | 524 | ||
| 525 | <scroll-view scroll-x="true" class="pj_scroll"> | 525 | <scroll-view scroll-x="true" class="pj_scroll"> |
| 526 | - <view class="xc_comment-detail" style="display: inline-block" wx:for="{{fir_comments}}" wx:key="fir_comments"> | ||
| 527 | - <view class="xc_comment-left"> | ||
| 528 | - <view class="xc_comment-user"> | ||
| 529 | - <view class="xc_user-img"> | ||
| 530 | - <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image> | ||
| 531 | - </view> | ||
| 532 | - | ||
| 533 | - <view class="xc_user"> | ||
| 534 | - <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view> | ||
| 535 | - <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | ||
| 536 | - </view> | ||
| 537 | - </view> | ||
| 538 | - <view class="xc_comment-font pj_word_size ellipsis-2"> | ||
| 539 | - {{item.content?item.content:''}} | ||
| 540 | - </view> | ||
| 541 | - <view class="xc_comment-val"> | ||
| 542 | - <view class="xc_comment-time">{{item.add_time}}</view> | ||
| 543 | - | ||
| 544 | - </view> | ||
| 545 | - </view> | ||
| 546 | - <view class="xc_goods-img-frame"> | ||
| 547 | - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> | ||
| 548 | - <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image> | ||
| 549 | - <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image> | ||
| 550 | - </view> | ||
| 551 | - </view> | 526 | + |
| 527 | + <view class="xc_comment-detail" style="display: inline-block" wx:for="{{fir_comments}}" wx:key="fir_comments"> | ||
| 528 | + <view class="xc_comment-left"> | ||
| 529 | + <view class="xc_comment-user"> | ||
| 530 | + <view class="xc_user-img"> | ||
| 531 | + <image class="xc_imgs" src='{{item.is_anonymous!=1?item.head_pic:iurl+"/miniapp/images/hui_hear_pic.png"}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image> | ||
| 532 | + </view> | ||
| 533 | + | ||
| 534 | + <view class="xc_user"> | ||
| 535 | + <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view> | ||
| 536 | + <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | ||
| 537 | + </view> | ||
| 538 | + </view> | ||
| 539 | + <view class="xc_comment-font pj_word_size ellipsis-2"> | ||
| 540 | + {{item.content?item.content:''}} | ||
| 541 | + </view> | ||
| 542 | + <view class="xc_comment-val"> | ||
| 543 | + <view class="xc_comment-time">{{item.add_time}}</view> | ||
| 544 | + | ||
| 545 | + </view> | ||
| 546 | + </view> | ||
| 547 | + <view class="xc_goods-img-frame"> | ||
| 548 | + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> | ||
| 549 | + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image> | ||
| 550 | + <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image> | ||
| 551 | + </view> | ||
| 552 | + </view> | ||
| 553 | + | ||
| 552 | </scroll-view> | 554 | </scroll-view> |
| 553 | </view> | 555 | </view> |
| 554 | 556 | ||
| @@ -563,7 +565,7 @@ | @@ -563,7 +565,7 @@ | ||
| 563 | </view> | 565 | </view> |
| 564 | <view class="t_g_info"> | 566 | <view class="t_g_info"> |
| 565 | <view class="red_shu"></view> | 567 | <view class="red_shu"></view> |
| 566 | - <view style='font-size: 32rpx;'>商品信息</view> | 568 | + <view class="fs30">商品信息</view> |
| 567 | </view> | 569 | </view> |
| 568 | <view class="table_s"> | 570 | <view class="table_s"> |
| 569 | <view class="tb_item tb-l"> | 571 | <view class="tb_item tb-l"> |
| @@ -985,7 +987,7 @@ | @@ -985,7 +987,7 @@ | ||
| 985 | <!-- 没有门店的时候 --> | 987 | <!-- 没有门店的时候 --> |
| 986 | <view class="flex" bindtap="choice_store" wx:else> | 988 | <view class="flex" bindtap="choice_store" wx:else> |
| 987 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | 989 | <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> |
| 988 | - <view class="fs28 xc-ash-9f">选择门店</view> | 990 | + <view class="fs30" style="color:black;">选择门店</view> |
| 989 | </view> | 991 | </view> |
| 990 | 992 | ||
| 991 | <view class="red-co fs28" bindtap="choice_store" > | 993 | <view class="red-co fs28" bindtap="choice_store" > |
| @@ -1483,5 +1485,18 @@ | @@ -1483,5 +1485,18 @@ | ||
| 1483 | </block> | 1485 | </block> |
| 1484 | <!-- ---------------分享弹窗--------------- --> | 1486 | <!-- ---------------分享弹窗--------------- --> |
| 1485 | <!--二维码显示页面--> | 1487 | <!--二维码显示页面--> |
| 1486 | -<canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas> | ||
| 1487 | -<warn id="warn"></warn> | ||
| 1488 | \ No newline at end of file | 1488 | \ No newline at end of file |
| 1489 | +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> | ||
| 1490 | +<warn id="warn"></warn> | ||
| 1491 | + | ||
| 1492 | + | ||
| 1493 | +<view wx:if="{{showPoster}}" class="poster-container"> | ||
| 1494 | + <view class="poster" bindtap="previewImage"> | ||
| 1495 | + <image src="{{shareImgPath}}" class="poster-img"></image> | ||
| 1496 | + <view class="btn-close" catchtap="closePoster">x</view> | ||
| 1497 | + </view> | ||
| 1498 | + <view class="btn-container"> | ||
| 1499 | + <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> | ||
| 1500 | + <button class="btn-share" bindtap="savePic">保存到相册</button> | ||
| 1501 | + </view> | ||
| 1502 | +</view> | ||
| 1503 | + |
pages/goods/goodsInfo/goodsInfo.wxss
| @@ -9,15 +9,15 @@ image { | @@ -9,15 +9,15 @@ image { | ||
| 9 | display: flex; | 9 | display: flex; |
| 10 | justify-content: center; | 10 | justify-content: center; |
| 11 | width: 100%; | 11 | width: 100%; |
| 12 | - height: 80rpx; | ||
| 13 | - margin-bottom: 20rpx; | 12 | + /* height: 80rpx; */ |
| 13 | + /* margin-bottom: 20rpx; */ | ||
| 14 | background-color: #fff; | 14 | background-color: #fff; |
| 15 | - border-bottom: 1rpx #fafafa solid; | 15 | + /* border-bottom: 1rpx #fafafa solid; */ |
| 16 | } | 16 | } |
| 17 | .type-box { | 17 | .type-box { |
| 18 | width: 25%; | 18 | width: 25%; |
| 19 | box-sizing: border-box; | 19 | box-sizing: border-box; |
| 20 | - font-size: 36rpx; | 20 | + font-size: 28rpx; |
| 21 | line-height: 76rpx; | 21 | line-height: 76rpx; |
| 22 | padding: 0 20rpx; | 22 | padding: 0 20rpx; |
| 23 | text-align: center; | 23 | text-align: center; |
| @@ -25,13 +25,27 @@ image { | @@ -25,13 +25,27 @@ image { | ||
| 25 | overflow: hidden; | 25 | overflow: hidden; |
| 26 | } | 26 | } |
| 27 | .type-navbar-item { | 27 | .type-navbar-item { |
| 28 | - border-bottom: 4rpx solid #fff; | 28 | + /* border-bottom: 4rpx solid #fff; */ |
| 29 | display: flex; | 29 | display: flex; |
| 30 | justify-content: center; | 30 | justify-content: center; |
| 31 | width: 100%; | 31 | width: 100%; |
| 32 | } | 32 | } |
| 33 | .type-item-on { | 33 | .type-item-on { |
| 34 | - border-bottom: 4rpx solid #333; | 34 | + color: #F95D74; |
| 35 | + font-weight: bold; | ||
| 36 | + /* border-bottom: 4rpx solid #F95D74; */ | ||
| 37 | + position: relative; | ||
| 38 | +} | ||
| 39 | +.type-item-on:after { | ||
| 40 | + content: ''; | ||
| 41 | + position: absolute; | ||
| 42 | + width: 50%; | ||
| 43 | + height: 4rpx; | ||
| 44 | + background-color: #F95D74; | ||
| 45 | + left: 0; | ||
| 46 | + right: 0; | ||
| 47 | + bottom: 0; | ||
| 48 | + margin: 0 auto; | ||
| 35 | } | 49 | } |
| 36 | .swiper_box { | 50 | .swiper_box { |
| 37 | width: 100%; | 51 | width: 100%; |
| @@ -46,9 +60,12 @@ image { | @@ -46,9 +60,12 @@ image { | ||
| 46 | width: 560rpx; | 60 | width: 560rpx; |
| 47 | line-height: 46rpx; | 61 | line-height: 46rpx; |
| 48 | font-size: 32rpx; | 62 | font-size: 32rpx; |
| 63 | + font-weight: bold; | ||
| 49 | color: #333; | 64 | color: #333; |
| 50 | - margin-top: 40rpx; | ||
| 51 | - margin-bottom:20rpx; | 65 | + margin-top: 30rpx; |
| 66 | + margin-bottom:30rpx; | ||
| 67 | + flex: 1; | ||
| 68 | + text-align: justify; | ||
| 52 | } | 69 | } |
| 53 | 70 | ||
| 54 | .goods-collect { | 71 | .goods-collect { |
| @@ -78,7 +95,7 @@ image { | @@ -78,7 +95,7 @@ image { | ||
| 78 | 95 | ||
| 79 | /* margin-top: 46rpx; */ | 96 | /* margin-top: 46rpx; */ |
| 80 | margin-top:26rpx; | 97 | margin-top:26rpx; |
| 81 | - padding-bottom:12rpx; | 98 | + padding-bottom:20rpx; |
| 82 | } | 99 | } |
| 83 | 100 | ||
| 84 | .prom-info { | 101 | .prom-info { |
| @@ -114,7 +131,8 @@ image { | @@ -114,7 +131,8 @@ image { | ||
| 114 | .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} | 131 | .goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} |
| 115 | 132 | ||
| 116 | .goods-num { | 133 | .goods-num { |
| 117 | - display: flex;font-size: 28rpx; | 134 | + display: flex; |
| 135 | + font-size: 24rpx; | ||
| 118 | justify-content: space-between; | 136 | justify-content: space-between; |
| 119 | } | 137 | } |
| 120 | 138 | ||
| @@ -949,11 +967,12 @@ left:31rpx;} | @@ -949,11 +967,12 @@ left:31rpx;} | ||
| 949 | 967 | ||
| 950 | .bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx } | 968 | .bzfu_img{ width: 164rpx; height:34rpx; margin-right: 18rpx; margin-left: 12rpx } |
| 951 | .bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx; | 969 | .bz_view{ height:100rpx; padding: 0 34rpx 0 13rpx; color: #333; font-size: 28rpx; |
| 952 | - border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; } | 970 | + /* border-bottom: 3rpx solid #eee; */ |
| 971 | + /* border-top: 3rpx solid #eee; */} | ||
| 953 | .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;} | 972 | .bz_view view{ width: 460rpx; max-height: 70rpx; overflow: hidden;} |
| 954 | 973 | ||
| 955 | .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; | 974 | .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; |
| 956 | - font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } | 975 | + font-size: 30rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } |
| 957 | .red_bb{ color: #d70026; min-width:158rpx;width: auto;} | 976 | .red_bb{ color: #d70026; min-width:158rpx;width: auto;} |
| 958 | .bg_jj{ width: 18rpx; height:18rpx; | 977 | .bg_jj{ width: 18rpx; height:18rpx; |
| 959 | border-top: 2rpx solid #d70026; | 978 | border-top: 2rpx solid #d70026; |
| @@ -1180,7 +1199,7 @@ left:31rpx;} | @@ -1180,7 +1199,7 @@ left:31rpx;} | ||
| 1180 | background: #ffe3e2; | 1199 | background: #ffe3e2; |
| 1181 | color: 28rpx; | 1200 | color: 28rpx; |
| 1182 | border-radius:20rpx; | 1201 | border-radius:20rpx; |
| 1183 | - font-size: 28rpx; | 1202 | + font-size: 24rpx; |
| 1184 | } | 1203 | } |
| 1185 | .xc_comment-discuss{ | 1204 | .xc_comment-discuss{ |
| 1186 | width: 152rpx; | 1205 | width: 152rpx; |
| @@ -1190,7 +1209,7 @@ left:31rpx;} | @@ -1190,7 +1209,7 @@ left:31rpx;} | ||
| 1190 | background: #ffe3e2; | 1209 | background: #ffe3e2; |
| 1191 | color: 28rpx; | 1210 | color: 28rpx; |
| 1192 | border-radius:20rpx; | 1211 | border-radius:20rpx; |
| 1193 | - font-size: 28rpx; | 1212 | + font-size: 24rpx; |
| 1194 | margin-left: 28rpx | 1213 | margin-left: 28rpx |
| 1195 | } | 1214 | } |
| 1196 | 1215 | ||
| @@ -1274,7 +1293,14 @@ left:31rpx;} | @@ -1274,7 +1293,14 @@ left:31rpx;} | ||
| 1274 | } | 1293 | } |
| 1275 | 1294 | ||
| 1276 | .pj_word_size{ font-size: 28rpx} | 1295 | .pj_word_size{ font-size: 28rpx} |
| 1277 | -.pj_scroll{white-space: nowrap;margin-bottom: 50rpx;} | 1296 | +.pj_scroll{ |
| 1297 | + white-space: nowrap; | ||
| 1298 | + /* height: 324rpx; */ | ||
| 1299 | + margin-bottom: 50rpx; | ||
| 1300 | + display: flex; | ||
| 1301 | + align-items: center; | ||
| 1302 | + /* box-shadow: 0 8px 12px #e7e9eb; */ | ||
| 1303 | +} | ||
| 1278 | 1304 | ||
| 1279 | 1305 | ||
| 1280 | /*领券*/ | 1306 | /*领券*/ |
| @@ -1285,7 +1311,7 @@ left:31rpx;} | @@ -1285,7 +1311,7 @@ left:31rpx;} | ||
| 1285 | font-size: 23rpx; | 1311 | font-size: 23rpx; |
| 1286 | } | 1312 | } |
| 1287 | .cx-frame{ | 1313 | .cx-frame{ |
| 1288 | - border-top:3rpx solid #eee; | 1314 | + /* border-top:3rpx solid #eee; */ |
| 1289 | width:99%; | 1315 | width:99%; |
| 1290 | height: 95rpx; | 1316 | height: 95rpx; |
| 1291 | line-height: 95rpx; | 1317 | line-height: 95rpx; |
| @@ -1317,19 +1343,17 @@ left:31rpx;} | @@ -1317,19 +1343,17 @@ left:31rpx;} | ||
| 1317 | 1343 | ||
| 1318 | } | 1344 | } |
| 1319 | .xc-coupon-fram .xc-circular{ | 1345 | .xc-coupon-fram .xc-circular{ |
| 1320 | - width: 24rpx; | ||
| 1321 | - height:20rpx; | 1346 | + width: 22rpx; |
| 1347 | + height:22rpx; | ||
| 1322 | background-color:#fff; | 1348 | background-color:#fff; |
| 1323 | position:absolute; | 1349 | position:absolute; |
| 1324 | - top:40rpx; | ||
| 1325 | - | ||
| 1326 | - | 1350 | + top: 40rpx; |
| 1327 | } | 1351 | } |
| 1328 | .xc-coupon-fram .xc-one{ | 1352 | .xc-coupon-fram .xc-one{ |
| 1329 | left:3rpx; | 1353 | left:3rpx; |
| 1330 | } | 1354 | } |
| 1331 | .xc-coupon-fram .xc-two{ | 1355 | .xc-coupon-fram .xc-two{ |
| 1332 | - left: 175rpx; | 1356 | + left: 178rpx; |
| 1333 | } | 1357 | } |
| 1334 | 1358 | ||
| 1335 | .cx-obtain-coupon{ | 1359 | .cx-obtain-coupon{ |
| @@ -2257,7 +2281,7 @@ right:17rpx; top:55rpx; | @@ -2257,7 +2281,7 @@ right:17rpx; top:55rpx; | ||
| 2257 | .no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx} | 2281 | .no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx} |
| 2258 | /* 门店地址 */ | 2282 | /* 门店地址 */ |
| 2259 | .xc-address_frame{ | 2283 | .xc-address_frame{ |
| 2260 | - border-top:1rpx solid #eee; | 2284 | + /* border-top:1rpx solid #eee; */ |
| 2261 | width: 100%; | 2285 | width: 100%; |
| 2262 | height: auto; | 2286 | height: auto; |
| 2263 | } | 2287 | } |
| @@ -2322,6 +2346,7 @@ background: white; | @@ -2322,6 +2346,7 @@ background: white; | ||
| 2322 | width: 100%; | 2346 | width: 100%; |
| 2323 | border-radius: 20rpx 20rpx 0 0; | 2347 | border-radius: 20rpx 20rpx 0 0; |
| 2324 | height: 72%; | 2348 | height: 72%; |
| 2349 | +bottom: 0; | ||
| 2325 | } | 2350 | } |
| 2326 | .popup-top{ | 2351 | .popup-top{ |
| 2327 | border-bottom: 1rpx solid #eee; | 2352 | border-bottom: 1rpx solid #eee; |
| @@ -2605,4 +2630,56 @@ button.custom-service::after{ | @@ -2605,4 +2630,56 @@ button.custom-service::after{ | ||
| 2605 | .dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx} | 2630 | .dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx} |
| 2606 | .act_content{ margin-top: 40rpx} | 2631 | .act_content{ margin-top: 40rpx} |
| 2607 | .act_content view{ margin-bottom: 12rpx} | 2632 | .act_content view{ margin-bottom: 12rpx} |
| 2608 | -.color_b{color: #ff9c00} | ||
| 2609 | \ No newline at end of file | 2633 | \ No newline at end of file |
| 2634 | +.color_b{color: #ff9c00} | ||
| 2635 | + | ||
| 2636 | +.poster-container { | ||
| 2637 | + box-sizing: border-box; | ||
| 2638 | + position: fixed; | ||
| 2639 | + top: 0; | ||
| 2640 | + width: 100%; | ||
| 2641 | + height: 100%; | ||
| 2642 | + z-index: 999; | ||
| 2643 | + background-color: rgba(0,0,0,.4); | ||
| 2644 | + padding: 60rpx; | ||
| 2645 | +} | ||
| 2646 | + | ||
| 2647 | +.poster { | ||
| 2648 | + box-sizing: border-box; | ||
| 2649 | + width: 100%; | ||
| 2650 | + height: 90%; | ||
| 2651 | + border-radius: 20rpx; | ||
| 2652 | + /* box-shadow: 0 8px 12px #666; */ | ||
| 2653 | + position: relative; | ||
| 2654 | + z-index: 999; | ||
| 2655 | + overflow: hidden; | ||
| 2656 | +} | ||
| 2657 | +.poster-img { | ||
| 2658 | + display: block; | ||
| 2659 | + width: 100%; | ||
| 2660 | + height: 100%; | ||
| 2661 | +} | ||
| 2662 | +.btn-container { | ||
| 2663 | + display: flex; | ||
| 2664 | + justify-content: space-around; | ||
| 2665 | +} | ||
| 2666 | +.btn-share { | ||
| 2667 | + display: block; | ||
| 2668 | + background-color: #FE6867; | ||
| 2669 | + color: white; | ||
| 2670 | + border-radius: 8rpx; | ||
| 2671 | + line-height: 80rpx; | ||
| 2672 | + margin-top: 28rpx; | ||
| 2673 | + padding: 0 60rpx; | ||
| 2674 | +} | ||
| 2675 | +.btn-close { | ||
| 2676 | + background-color: rgba(0,0,0,.5); | ||
| 2677 | + color: white; | ||
| 2678 | + width: 40rpx; | ||
| 2679 | + height: 40rpx; | ||
| 2680 | + line-height: 40rpx; | ||
| 2681 | + text-align: center; | ||
| 2682 | + border-radius: 50%; | ||
| 2683 | + position: absolute; | ||
| 2684 | + right: 20rpx; | ||
| 2685 | + top: 10rpx; | ||
| 2686 | +} | ||
| 2610 | \ No newline at end of file | 2687 | \ No newline at end of file |
pages/user/assistance/assistance.wxss
| 1 | -page { | 1 | +.page { |
| 2 | /* background-color: rgb(208, 17, 25); */ | 2 | /* background-color: rgb(208, 17, 25); */ |
| 3 | /* width: 100%; | 3 | /* width: 100%; |
| 4 | height: 100%; */ | 4 | height: 100%; */ |
| 5 | - | 5 | + /* height: 100%; */ |
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | .page { | 8 | .page { |
| 9 | - /* height: 100vh; */ | 9 | + height: 100vh; |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | 12 |
pages/user/assistance/task_assistance.js
| @@ -223,7 +223,7 @@ Page({ | @@ -223,7 +223,7 @@ Page({ | ||
| 223 | th.setData({ | 223 | th.setData({ |
| 224 | aitem: data_aissa, | 224 | aitem: data_aissa, |
| 225 | task_number: task_number, | 225 | task_number: task_number, |
| 226 | - giftQty:giftQty, | 226 | + giftQty:data_aissa[0].giftQty, |
| 227 | }); | 227 | }); |
| 228 | th.go_to_task(th.data.taskid); | 228 | th.go_to_task(th.data.taskid); |
| 229 | 229 | ||
| @@ -232,6 +232,7 @@ Page({ | @@ -232,6 +232,7 @@ Page({ | ||
| 232 | aitem: data_aissa, | 232 | aitem: data_aissa, |
| 233 | task_number: task_number, | 233 | task_number: task_number, |
| 234 | taskid: taskid, | 234 | taskid: taskid, |
| 235 | + giftQty:data_aissa[0].giftQty, | ||
| 235 | }); | 236 | }); |
| 236 | //判断是不是领取的任务 | 237 | //判断是不是领取的任务 |
| 237 | th.get_user_task(); | 238 | th.get_user_task(); |
| @@ -368,7 +369,8 @@ Page({ | @@ -368,7 +369,8 @@ Page({ | ||
| 368 | task_number: task_number, | 369 | task_number: task_number, |
| 369 | taskid: task_id, | 370 | taskid: task_id, |
| 370 | is_dismantle: 0, | 371 | is_dismantle: 0, |
| 371 | - bc_page: 1 | 372 | + bc_page: 1, |
| 373 | + giftQty:aitem[ind].giftQty, | ||
| 372 | }); | 374 | }); |
| 373 | 375 | ||
| 374 | if (this.data.switch_head == 1 && th.data.is_clik == 0) { | 376 | if (this.data.switch_head == 1 && th.data.is_clik == 0) { |
| @@ -557,7 +559,8 @@ Page({ | @@ -557,7 +559,8 @@ Page({ | ||
| 557 | taskid: task_id, | 559 | taskid: task_id, |
| 558 | is_dismantle: 0, | 560 | is_dismantle: 0, |
| 559 | is_clik: 1, | 561 | is_clik: 1, |
| 560 | - bc_page: 1 | 562 | + bc_page: 1, |
| 563 | + giftQty:aitem[index].giftQty | ||
| 561 | }) | 564 | }) |
| 562 | if (this.data.switch_head == 1) { | 565 | if (this.data.switch_head == 1) { |
| 563 | //判断有没有帮拆记录 | 566 | //判断有没有帮拆记录 |
| @@ -589,6 +592,7 @@ Page({ | @@ -589,6 +592,7 @@ Page({ | ||
| 589 | taskid: task_id, | 592 | taskid: task_id, |
| 590 | is_dismantle: 0, | 593 | is_dismantle: 0, |
| 591 | bc_page: 1, | 594 | bc_page: 1, |
| 595 | + giftQty:aitem[index].giftQty | ||
| 592 | }) | 596 | }) |
| 593 | if (this.data.switch_head == 1) { | 597 | if (this.data.switch_head == 1) { |
| 594 | this.dismantle_record(); | 598 | this.dismantle_record(); |
pages/user/assistance/task_assistance.wxml
| @@ -18,17 +18,17 @@ | @@ -18,17 +18,17 @@ | ||
| 18 | </view> | 18 | </view> |
| 19 | </view> | 19 | </view> |
| 20 | <!-- 图片的轮播图 --> | 20 | <!-- 图片的轮播图 --> |
| 21 | - <view class="xc-specific-more-frame flex-center" style="height:{{max_sw_height}}px;"> | 21 | + <view class="xc-specific-more-frame flex-center" style="height:{{max_sw_height}}px;"> |
| 22 | <view bindtap="click_pre"> | 22 | <view bindtap="click_pre"> |
| 23 | <view class="bg_left xc-left bcolor"></view> | 23 | <view class="bg_left xc-left bcolor"></view> |
| 24 | </view> | 24 | </view> |
| 25 | <!-- <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> --> | 25 | <!-- <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> --> |
| 26 | - <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}" style='width:80%;height:100%;'> | 26 | + <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}" style='width:80%;height:100%;position:relative;'> |
| 27 | <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> | 27 | <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> |
| 28 | - | ||
| 29 | - <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}" mode="widthFix" bindload='imageLoad' style="width: 100%;display: block;"></image> | ||
| 30 | - <view bindtap="libao_details" data-taskid="{{aitem.id}}" class="abs select_details fs26 white">礼包详情</view> | ||
| 31 | - | 28 | + <view style="position:absolute;width:100%;"> |
| 29 | + <image show-menu-by-longpress class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}" mode="widthFix" bindload='imageLoad' style="width: 100%;display: block;"></image> | ||
| 30 | + <view bindtap="libao_details" data-taskid="{{aitem.id}}" class="abs select_details fs26 white">礼包详情</view> | ||
| 31 | + </view> | ||
| 32 | </swiper-item> | 32 | </swiper-item> |
| 33 | 33 | ||
| 34 | </swiper> | 34 | </swiper> |
pages/user/assistance/task_assistance.wxss
| @@ -41,7 +41,7 @@ page { | @@ -41,7 +41,7 @@ page { | ||
| 41 | .xc-specific-more-frame { | 41 | .xc-specific-more-frame { |
| 42 | width: 100%; | 42 | width: 100%; |
| 43 | height: 40%; | 43 | height: 40%; |
| 44 | - margin-top: 20rpx; | 44 | + padding-top: 20rpx; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | .task-number { | 47 | .task-number { |
| @@ -159,14 +159,20 @@ page { | @@ -159,14 +159,20 @@ page { | ||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | .closes { | 161 | .closes { |
| 162 | - margin-top: 20rpx; | 162 | + /* margin-top: 20rpx; */ |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | .canvas { | 165 | .canvas { |
| 166 | position: fixed; | 166 | position: fixed; |
| 167 | z-index: 11; | 167 | z-index: 11; |
| 168 | width: 100%; | 168 | width: 100%; |
| 169 | - top: 20rpx; | 169 | + top: 0; |
| 170 | + bottom: 0; | ||
| 171 | + left: 0; | ||
| 172 | + right: 0; | ||
| 173 | + background-color: rgba(0,0,0,.5); | ||
| 174 | + box-sizing: border-box; | ||
| 175 | + padding-top: 60rpx; | ||
| 170 | } | 176 | } |
| 171 | 177 | ||
| 172 | .close { | 178 | .close { |
| @@ -206,15 +212,15 @@ page { | @@ -206,15 +212,15 @@ page { | ||
| 206 | } | 212 | } |
| 207 | 213 | ||
| 208 | .closes { | 214 | .closes { |
| 209 | - margin-top: 20rpx; | 215 | + /* margin-top: 20rpx; */ |
| 210 | } | 216 | } |
| 211 | 217 | ||
| 212 | -.canvas { | 218 | +/* .canvas { |
| 213 | position: fixed; | 219 | position: fixed; |
| 214 | z-index: 20; | 220 | z-index: 20; |
| 215 | width: 100%; | 221 | width: 100%; |
| 216 | top: 20rpx; | 222 | top: 20rpx; |
| 217 | -} | 223 | +} */ |
| 218 | 224 | ||
| 219 | .close { | 225 | .close { |
| 220 | width: 70rpx; | 226 | width: 70rpx; |