Commit fb93cc75b6f64d4b4dcf54f2281a57216016a38c
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
17 changed files
with
10915 additions
and
13 deletions
packageB/pages/zuhegou/preindex/index.js
0 → 100644
| 1 | +const app = getApp(); | |
| 2 | +let self = null; | |
| 3 | +var os = app.globalData.setting; | |
| 4 | +var ut = require("../../../../utils/util.js"); | |
| 5 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | |
| 6 | +var oo = app.globalData; | |
| 7 | + | |
| 8 | + | |
| 9 | +let imgDraw = { | |
| 10 | + "width": "650px", | |
| 11 | + "height": "843px", | |
| 12 | + "background": "https://mshopimg.yolipai.net/miniapp/images/zhg/bg-zuhegou.jpg", | |
| 13 | + "views": [{ // 头像 | |
| 14 | + "type": "image", | |
| 15 | + "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg", | |
| 16 | + "css": { | |
| 17 | + "width": "100px", | |
| 18 | + "height": "100px", | |
| 19 | + "top": "20px", | |
| 20 | + "left": "275px", | |
| 21 | + "borderRadius": "100px", | |
| 22 | + "mode": "scaleToFill", | |
| 23 | + "borderWidth": "2px", | |
| 24 | + "borderColor": "#fff", | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + { //昵称 | |
| 28 | + "type": "text", | |
| 29 | + "text": "我是店铺名", | |
| 30 | + "css": { | |
| 31 | + "width": "650px", | |
| 32 | + "color": "#fff", | |
| 33 | + "top": "136px", | |
| 34 | + // "left": "137px", | |
| 35 | + "textAlign": "center", | |
| 36 | + "fontSize": "26px", | |
| 37 | + "maxLines": "1", | |
| 38 | + } | |
| 39 | + }, | |
| 40 | + { //10元任选3件 | |
| 41 | + "type": "text", | |
| 42 | + "text": "10元任选3件", | |
| 43 | + "css": { | |
| 44 | + "color": "#fff", | |
| 45 | + "width": "650px", | |
| 46 | + "top": "270px", | |
| 47 | + "fontSize": "70px", | |
| 48 | + "maxLines": "1", | |
| 49 | + "textAlign": "center", | |
| 50 | + "fontWeight": "bold", | |
| 51 | + } | |
| 52 | + }, | |
| 53 | + { //活动时间 | |
| 54 | + "type": "text", | |
| 55 | + "text": "活动时间:2021.07.06 - 2021.07.08", | |
| 56 | + "css": { | |
| 57 | + "color": "#333", | |
| 58 | + "width": "650px", | |
| 59 | + "top": "440px", | |
| 60 | + "fontSize": "26px", | |
| 61 | + "fontWeight": "normal", | |
| 62 | + "maxLines": "1", | |
| 63 | + "textAlign": "center" | |
| 64 | + } | |
| 65 | + }, | |
| 66 | + { // 码 | |
| 67 | + "type": "image", | |
| 68 | + "url": "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0F/08/ChMkJlauzXWIDrXBAAdCg2xP7oYAAH9FQOpVAIAB0Kb342.jpg", | |
| 69 | + "css": { | |
| 70 | + "color": "#000", | |
| 71 | + "width": "200px", | |
| 72 | + "height": "200px", | |
| 73 | + "top": "525px", | |
| 74 | + "left": "225px", | |
| 75 | + } | |
| 76 | + }, | |
| 77 | + { // 扫码提示 | |
| 78 | + "type": "text", | |
| 79 | + "text": "长按扫码即可参与活动", | |
| 80 | + "css": { | |
| 81 | + "color": "#666", | |
| 82 | + "width": "650px", | |
| 83 | + "top": "750px", | |
| 84 | + "fontSize": "26px", | |
| 85 | + "textAlign": "center" | |
| 86 | + } | |
| 87 | + }, | |
| 88 | + ] | |
| 89 | +}; | |
| 90 | + | |
| 91 | + | |
| 92 | +Page({ | |
| 93 | + | |
| 94 | + /** | |
| 95 | + * 页面的初始数据 | |
| 96 | + */ | |
| 97 | + data: { | |
| 98 | + iurl: os.imghost, | |
| 99 | + showRule: false, | |
| 100 | + showMask: false, | |
| 101 | + showNum: false, | |
| 102 | + haveAdded: false, | |
| 103 | + //imgDraw: imgDraw, 分享内容 | |
| 104 | + id: 0, //获得活动id | |
| 105 | + page: 1, //第一页 | |
| 106 | + no_more: 0, //没有更多 | |
| 107 | + loading: 0, //加载中 | |
| 108 | + list: null, //商品列表的显示 | |
| 109 | + act: null, //组合活动 | |
| 110 | + all_price: 0, //合计价格 | |
| 111 | + all_num: 0, //全部数量 | |
| 112 | + sele_pick_id: 0, //默认选择门店,当用户什么商品都没有选,sele_pick_id=0 | |
| 113 | + def_store: null, //用户默认的门店 | |
| 114 | + sele_store: 0, //是不是选择了门店 | |
| 115 | + more_store: 0, //选择门店 | |
| 116 | + sort_store: 0, //门店分类 | |
| 117 | + choice_sort_store: 0, //选择分类门店 | |
| 118 | + fir_pick_index: 0, //门店选择的下标 | |
| 119 | + sec_pick_index: 0 //门店选择的下标,地区选择之后的内页 | |
| 120 | + }, | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * 生命周期函数--监听页面加载 | |
| 124 | + */ | |
| 125 | + onLoad: function (options) { | |
| 126 | + console.log(options, 111); | |
| 127 | + self = this; | |
| 128 | + var the_id = options.id; | |
| 129 | + if (options.title) { | |
| 130 | + wx.setNavigationBarTitle({ | |
| 131 | + title: options.title, | |
| 132 | + }); | |
| 133 | + }; | |
| 134 | + var first_leader = options.first_leader; | |
| 135 | + | |
| 136 | + //--如果tg_id是空的话,分享回来-- | |
| 137 | + if (the_id == undefined || the_id == null || the_id == "") { | |
| 138 | + var gid_str = decodeURIComponent(options.scene); | |
| 139 | + gid_str = gid_str.split("_"); | |
| 140 | + the_id = gid_str[0]; | |
| 141 | + if (gid_str.length > 1) { | |
| 142 | + first_leader = gid_str[1]; | |
| 143 | + } | |
| 144 | + } | |
| 145 | + | |
| 146 | + this.data.id = the_id; | |
| 147 | + if (first_leader) { | |
| 148 | + getApp().globalData.first_leader = first_leader; | |
| 149 | + //调用接口判断是不是会员 | |
| 150 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 151 | + if (res.data.code == 0) { | |
| 152 | + getApp().globalData.guide_id = res.data.data.id; | |
| 153 | + } | |
| 154 | + }) | |
| 155 | + } | |
| 156 | + | |
| 157 | + //如果有会员的时候 | |
| 158 | + var userInfo = getApp().globalData.userInfo; | |
| 159 | + if (!userInfo) { | |
| 160 | + getApp().goto("/pages/togoin/togoin"); | |
| 161 | + return false; | |
| 162 | + } | |
| 163 | + }, | |
| 164 | + | |
| 165 | + /** | |
| 166 | + * 生命周期函数--监听页面显示 | |
| 167 | + */ | |
| 168 | + onShow: function () { | |
| 169 | + var th = this, | |
| 170 | + that = this, | |
| 171 | + ee = this; | |
| 172 | + this.data.is_timer = 1; | |
| 173 | + if (this.data.act) this.countDown(); | |
| 174 | + //如果有会员的时候 | |
| 175 | + var userInfo = getApp().globalData.userInfo; | |
| 176 | + if (userInfo) { | |
| 177 | + if (!th.data.is_get_act) { | |
| 178 | + //获取活动信息 | |
| 179 | + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + th.data.id + "/" + userInfo.user_id; | |
| 180 | + getApp().request.get(url, { | |
| 181 | + success: function (e) { | |
| 182 | + | |
| 183 | + th.data.is_get_act = 1; | |
| 184 | + if (e.data.code == 0 && e.data.data) { | |
| 185 | + self.setData({ | |
| 186 | + act: e.data.data | |
| 187 | + }); | |
| 188 | + if (e.data.data.is_show != 1) { | |
| 189 | + th.setData({ | |
| 190 | + error: '活动未开启' | |
| 191 | + }); | |
| 192 | + return false; | |
| 193 | + } | |
| 194 | + // if (ut.gettimestamp() < e.data.data.start_time) { | |
| 195 | + // th.setData({ | |
| 196 | + // error: '活动还未开始' | |
| 197 | + // }); | |
| 198 | + // return false; | |
| 199 | + // } | |
| 200 | + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { | |
| 201 | + //-- 获取商品列表 -- | |
| 202 | + self.get_list(); | |
| 203 | + self.countDown(); | |
| 204 | + } else { | |
| 205 | + th.setData({ | |
| 206 | + error: '活动已经过期' | |
| 207 | + }); | |
| 208 | + return false; | |
| 209 | + } | |
| 210 | + } else { | |
| 211 | + th.data.is_get_act = 0; | |
| 212 | + th.setData({ | |
| 213 | + error: e.data.msg | |
| 214 | + }); | |
| 215 | + return false; | |
| 216 | + } | |
| 217 | + } | |
| 218 | + }); | |
| 219 | + } | |
| 220 | + | |
| 221 | + //等待活动值 | |
| 222 | + this.waitfor2(10, 'list', function () { | |
| 223 | + if (!th.data.list) return false; | |
| 224 | + if (ut.gettimestamp() < th.data.act.start_time) { | |
| 225 | + return false; | |
| 226 | + } | |
| 227 | + if (th.data.act.is_end == 10 || ut.gettimestamp() >= th.data.act.end_time) { | |
| 228 | + return false; | |
| 229 | + } | |
| 230 | + //获取头像的分享 | |
| 231 | + th.get_head_temp(function () { | |
| 232 | + var txt = th.data.act.zhprice + "元任选" + th.data.act.zhbuyqty + "件"; | |
| 233 | + imgDraw.views[0].url = th.data.share_head; | |
| 234 | + imgDraw.views[1].text = userInfo.nickname; | |
| 235 | + imgDraw.views[2].text = txt; | |
| 236 | + | |
| 237 | + var start = ut.formar_no_full(th.data.act.start_time, '.'); | |
| 238 | + var end = ut.formar_no_full(th.data.act.end_time, '.'); | |
| 239 | + txt = "活动时间:" + start + " - " + end; | |
| 240 | + imgDraw.views[3].text = txt; | |
| 241 | + | |
| 242 | + var scene = th.data.id + ""; | |
| 243 | + var user_id = getApp().globalData.user_id; | |
| 244 | + scene += "_" + user_id; | |
| 245 | + ///二微码 | |
| 246 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 247 | + os.stoid + "?sceneValue=" + scene + "&pageValue=packageB/pages/zuhegou/index/index"; | |
| 248 | + wx.getImageInfo({ | |
| 249 | + src: path3, | |
| 250 | + success: function (res) { | |
| 251 | + var vpath = res.path; | |
| 252 | + imgDraw.views[4].url = vpath; | |
| 253 | + th.setData({ | |
| 254 | + imgDraw: imgDraw | |
| 255 | + }) | |
| 256 | + } | |
| 257 | + }) | |
| 258 | + }) | |
| 259 | + | |
| 260 | + //获取用户的默认门店 | |
| 261 | + getApp().get_user_store(function (e) { | |
| 262 | + if (!e) { | |
| 263 | + th.data.fir_def_store = {}; //赋值空对象 | |
| 264 | + return false; | |
| 265 | + } | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + var ee = JSON.parse(JSON.stringify(e)); | |
| 270 | + var appd = getApp().globalData; | |
| 271 | + //-- 等待定位系统的开启 -- | |
| 272 | + th.waitfor2(15, 'is_get_local_ok', function () { | |
| 273 | + | |
| 274 | + if (!th.data.is_get_local_ok) return false; | |
| 275 | + | |
| 276 | + var e = JSON.parse(JSON.stringify(ee)); | |
| 277 | + //如果有开启近距离的话,同时距离优不一样了 | |
| 278 | + if (that.data.lat != null) { | |
| 279 | + //如果经纬度有变化的话 | |
| 280 | + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) { | |
| 281 | + that.set_def_storage(e); | |
| 282 | + } else { | |
| 283 | + //要用接口是获取距离,js的计算不准 | |
| 284 | + getApp().request.promiseGet("/api/weshop/pickup/list", { | |
| 285 | + data: { | |
| 286 | + store_id: os.stoid, | |
| 287 | + pickup_id: e.pickup_id, | |
| 288 | + is_pos: 1, | |
| 289 | + lat: th.data.lat, | |
| 290 | + lon: th.data.lon | |
| 291 | + }, | |
| 292 | + }).then(res => { | |
| 293 | + if (res.data.code == 0) { | |
| 294 | + e = res.data.data.pageData[0]; | |
| 295 | + if (e) { | |
| 296 | + e.is_no_dis = ee.is_no_dis; | |
| 297 | + appd.pk_store = e; | |
| 298 | + that.set_def_storage(e); | |
| 299 | + } | |
| 300 | + | |
| 301 | + } | |
| 302 | + }) | |
| 303 | + } | |
| 304 | + appd.lat = that.data.lat; | |
| 305 | + appd.lon = that.data.lon; | |
| 306 | + } else { | |
| 307 | + if (e) { | |
| 308 | + e.distance = null; | |
| 309 | + that.set_def_storage(e); | |
| 310 | + } | |
| 311 | + } | |
| 312 | + }) | |
| 313 | + }); | |
| 314 | + | |
| 315 | + //----获取系统参数----- | |
| 316 | + getApp().getConfig2(function (e) { | |
| 317 | + ee.setData({ | |
| 318 | + bconfig: e, | |
| 319 | + sales_rules: e.sales_rules, | |
| 320 | + }); | |
| 321 | + //设置基本参数 | |
| 322 | + th.wait_for_store_config(e); | |
| 323 | + | |
| 324 | + var json_d = JSON.parse(e.switch_list); | |
| 325 | + ee.setData({ | |
| 326 | + store_config: e, | |
| 327 | + sys_switch: json_d, | |
| 328 | + is_closecoupon: json_d.is_closecoupon, | |
| 329 | + is_newsales_rules: json_d.is_newsales_rules, | |
| 330 | + is_open_offline: json_d.is_pricing_open, | |
| 331 | + sales_rules: e.sales_rules | |
| 332 | + }); | |
| 333 | + | |
| 334 | + //-- 计算等级价相关 -- | |
| 335 | + var swithc_list = e.switch_list; | |
| 336 | + var sw_arr = JSON.parse(swithc_list); | |
| 337 | + //---如果后台又开等级卡的开关--- | |
| 338 | + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | |
| 339 | + th.setData({ | |
| 340 | + rank_switch: true | |
| 341 | + }); | |
| 342 | + //---回调卡的列表--- | |
| 343 | + th.getPlusCardType(function (ob) { | |
| 344 | + th.setData({ | |
| 345 | + card_list: ob.card_list | |
| 346 | + }); | |
| 347 | + var user = getApp().globalData.userInfo; | |
| 348 | + if (!user) return false; | |
| 349 | + if (user.card_field && user['card_expiredate']) { | |
| 350 | + var str = user['card_expiredate'].replace(/-/g, '/'); | |
| 351 | + var end = new Date(str); | |
| 352 | + end = Date.parse(end) / 1000; | |
| 353 | + var now = ut.gettimestamp(); | |
| 354 | + //--- 判断是等级会员,且在有效期范围内 --- | |
| 355 | + if (user.card_field && now < end) { | |
| 356 | + var card_name = ob.name_map.get(user.card_field); | |
| 357 | + th.setData({ | |
| 358 | + card_field: user.card_field, | |
| 359 | + card_name: card_name, | |
| 360 | + card_list: ob.card_list | |
| 361 | + }); | |
| 362 | + } | |
| 363 | + } | |
| 364 | + //获取购物车的内容 | |
| 365 | + th.get_cart_val(e); | |
| 366 | + | |
| 367 | + }) | |
| 368 | + } else { | |
| 369 | + //获取购物车的内容 | |
| 370 | + th.get_cart_val(e); | |
| 371 | + } | |
| 372 | + }, 1); | |
| 373 | + | |
| 374 | + }) | |
| 375 | + | |
| 376 | + } | |
| 377 | + }, | |
| 378 | + | |
| 379 | + onHide: function () { | |
| 380 | + this.data.is_timer = 0; | |
| 381 | + }, | |
| 382 | + | |
| 383 | + //-- 调用接口的LIST,获取商品 -- | |
| 384 | + get_list: function () { | |
| 385 | + var th = this; | |
| 386 | + if (this.data.loading) return false; | |
| 387 | + if (this.data.no_more) return false; | |
| 388 | + this.data.loading = 1; | |
| 389 | + var url = "/api/weshop/prom/zhbuyGoods/page"; | |
| 390 | + var req_data = { | |
| 391 | + page: this.data.page, | |
| 392 | + pageSize: 10, | |
| 393 | + store_id: os.stoid, | |
| 394 | + zh_id: this.data.id | |
| 395 | + } | |
| 396 | + //开始调用接口 | |
| 397 | + getApp().request.get(url, { | |
| 398 | + data: req_data, | |
| 399 | + success: function (res) { | |
| 400 | + th.data.loading = 0; | |
| 401 | + th.setData({ | |
| 402 | + is_get: 1 | |
| 403 | + }) | |
| 404 | + if (ut.ajax_ok(res)) { | |
| 405 | + th.data.page++; | |
| 406 | + var list = th.data.list; | |
| 407 | + if (!list) list = []; | |
| 408 | + | |
| 409 | + //当是下拉刷新的时候 | |
| 410 | + if (th.data.page > 1 && th.data.cart_list) { | |
| 411 | + //下拉之后也要重新计算一下金额 | |
| 412 | + th.calc_more(res.data.data.pageData, function (list1) { | |
| 413 | + for (var i in list1) { | |
| 414 | + list.push(list1[i]); | |
| 415 | + } | |
| 416 | + th.setData({ | |
| 417 | + list: list | |
| 418 | + }); | |
| 419 | + th.re_sum_price(); | |
| 420 | + }) | |
| 421 | + } else { | |
| 422 | + for (var i in res.data.data.pageData) { | |
| 423 | + list.push(res.data.data.pageData[i]); | |
| 424 | + } | |
| 425 | + th.setData({ | |
| 426 | + list: list | |
| 427 | + }); | |
| 428 | + if (res.data.data.total <= 10) { | |
| 429 | + th.setData({ | |
| 430 | + no_more: 1 | |
| 431 | + }); | |
| 432 | + } | |
| 433 | + } | |
| 434 | + } else { | |
| 435 | + th.setData({ | |
| 436 | + no_more: 1 | |
| 437 | + }); | |
| 438 | + } | |
| 439 | + } | |
| 440 | + }) | |
| 441 | + }, | |
| 442 | + | |
| 443 | + //-- 滚动到底部触发 -- | |
| 444 | + get_more_list: function () { | |
| 445 | + this.get_list(); | |
| 446 | + }, | |
| 447 | + | |
| 448 | + /** | |
| 449 | + * 用户点击右上角分享 | |
| 450 | + */ | |
| 451 | + onShareAppMessage: function () { | |
| 452 | + var title = this.data.act.name; | |
| 453 | + var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; | |
| 454 | + if (getApp().globalData.user_id) { | |
| 455 | + url += "&first_leader=" + getApp().globalData.user_id; | |
| 456 | + } | |
| 457 | + var ob = { | |
| 458 | + title: title, | |
| 459 | + path: url, | |
| 460 | + }; | |
| 461 | + if (this.data.act.img_url) | |
| 462 | + ob.imageUrl = this.data.iurl + this.data.act.img_url; | |
| 463 | + return ob; | |
| 464 | + }, | |
| 465 | + | |
| 466 | + /** | |
| 467 | + * 用户分享朋友圈 | |
| 468 | + */ | |
| 469 | + onShareTimeline() { | |
| 470 | + var title = this.data.act.name; | |
| 471 | + var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; | |
| 472 | + if (getApp().globalData.user_id) { | |
| 473 | + url += "&first_leader=" + getApp().globalData.user_id; | |
| 474 | + } | |
| 475 | + var ob = { | |
| 476 | + title: title, | |
| 477 | + path: url, | |
| 478 | + }; | |
| 479 | + if (this.data.act.img_url) | |
| 480 | + ob.imageUrl = this.data.iurl + this.data.act.img_url; | |
| 481 | + return ob; | |
| 482 | + }, | |
| 483 | + /** | |
| 484 | + * 点击规则详情,弹出规则 | |
| 485 | + */ | |
| 486 | + showRule() { | |
| 487 | + this.setData({ | |
| 488 | + type: 0, //控制显示规则详情还是提示信息,0规则详情,1提示信息 | |
| 489 | + showRule: true, | |
| 490 | + showMask: true, | |
| 491 | + }); | |
| 492 | + }, | |
| 493 | + | |
| 494 | + /** | |
| 495 | + * 点击关闭按钮关闭规则详情弹窗 | |
| 496 | + */ | |
| 497 | + closeRule() { | |
| 498 | + this.setData({ | |
| 499 | + showRule: false, | |
| 500 | + showMask: false, | |
| 501 | + }); | |
| 502 | + }, | |
| 503 | + | |
| 504 | + /** | |
| 505 | + * 点击提示信息 | |
| 506 | + */ | |
| 507 | + showInfo() { | |
| 508 | + this.setData({ | |
| 509 | + type: 1, | |
| 510 | + showRule: true, | |
| 511 | + showMask: true, | |
| 512 | + }); | |
| 513 | + }, | |
| 514 | + | |
| 515 | + /** | |
| 516 | + * 加入购物车 | |
| 517 | + */ | |
| 518 | + addToCart(e) { | |
| 519 | + var th = this; | |
| 520 | + var index = e.currentTarget.dataset.index; | |
| 521 | + var userInfo = getApp().globalData.userInfo; | |
| 522 | + if (!userInfo) { | |
| 523 | + getApp().goto("/pages/togoin/togoin"); | |
| 524 | + return false; | |
| 525 | + } | |
| 526 | + let haveAdded = this.data.list[index].haveAdded; | |
| 527 | + this.data.sele_index = index; | |
| 528 | + let title = ''; | |
| 529 | + self = this; | |
| 530 | + th.data.s_cart_num = 0; | |
| 531 | + | |
| 532 | + //说明是加入购物车是时候 | |
| 533 | + this.data.is_zuhe_addcart = 1; | |
| 534 | + if (!haveAdded) { | |
| 535 | + th.data.sele_g = this.data.list[index]; | |
| 536 | + if (!th.data.sele_g.num) th.data.goodsInputNum = 1; | |
| 537 | + | |
| 538 | + //如果没有门店,活动商品的配送方式和门店的配送方式不一样 | |
| 539 | + if (!th.data.def_pick_store || | |
| 540 | + (th.data.sele_g.distr_type != 0 && th.data.def_pick_store.distr_type != 0 && th.data.sele_g.distr_type != th.data.def_pick_store.distr_type)) { | |
| 541 | + //选择了门店 | |
| 542 | + if (th.data.sele_store) { | |
| 543 | + wx.showToast({ | |
| 544 | + title: "该商品的物流配送方式和默认门店不匹配!", | |
| 545 | + icon: 'none', | |
| 546 | + duration: 2000 | |
| 547 | + }) | |
| 548 | + } else { | |
| 549 | + wx.showModal({ | |
| 550 | + title: '温馨提示', | |
| 551 | + content: '该商品的物流配送方式和默认门店不匹配,是否要切换门店?', | |
| 552 | + success(res) { | |
| 553 | + if (res.confirm) { | |
| 554 | + //物流的配送方式不一样 | |
| 555 | + th.get_sto(); | |
| 556 | + var set_data = { | |
| 557 | + store: 1 | |
| 558 | + }; | |
| 559 | + if (th.data.def_pick_store) { | |
| 560 | + set_data.is_no_pipei = th.data.def_pick_store.pickup_id; | |
| 561 | + } | |
| 562 | + th.setData(set_data); | |
| 563 | + } | |
| 564 | + } | |
| 565 | + }) | |
| 566 | + } | |
| 567 | + return false; | |
| 568 | + } else { | |
| 569 | + th.setData({ | |
| 570 | + is_no_pipei: 0 | |
| 571 | + }); | |
| 572 | + th.check_is_in_cart(function () { | |
| 573 | + th.add_cart_func(); | |
| 574 | + }) | |
| 575 | + } | |
| 576 | + } else { | |
| 577 | + | |
| 578 | + var txt = "list[" + index + "].haveAdded"; | |
| 579 | + var txt1 = "list[" + index + "].num"; | |
| 580 | + var txt2 = "list[" + index + "].showNum"; | |
| 581 | + th.data.sele_g = this.data.list[index]; | |
| 582 | + | |
| 583 | + wx.showModal({ | |
| 584 | + title: '温馨提示', | |
| 585 | + content: "确定取消该商品参与活动?", | |
| 586 | + success(res) { | |
| 587 | + if (res.confirm) { | |
| 588 | + console.log('用户点击确定'); | |
| 589 | + if (th.data.sele_g.cart_num && th.data.sele_g.cart_num - th.data.sele_g.num > 0) { | |
| 590 | + | |
| 591 | + var updata = { | |
| 592 | + id: th.data.sele_g.cart_id, | |
| 593 | + goods_num: th.data.sele_g.cart_num - th.data.sele_g.num, | |
| 594 | + store_id: os.stoid | |
| 595 | + } | |
| 596 | + getApp().request.put("/api/weshop/cart/update", { | |
| 597 | + data: updata, | |
| 598 | + success: function (rs) { | |
| 599 | + if (rs.data.code == 0) { | |
| 600 | + title = '取消成功'; | |
| 601 | + th.setData({ | |
| 602 | + [txt1]: 0, | |
| 603 | + [txt2]: false, | |
| 604 | + [txt]: false, | |
| 605 | + }); | |
| 606 | + wx.showToast({ | |
| 607 | + title: title, | |
| 608 | + icon: 'success', | |
| 609 | + }); | |
| 610 | + th.re_sum_price(); | |
| 611 | + } | |
| 612 | + } | |
| 613 | + }) | |
| 614 | + | |
| 615 | + } else { | |
| 616 | + var url = '/api/weshop/cart/del/' + os.stoid + '/' + th.data.sele_g.cart_id; | |
| 617 | + getApp().request.delete(url, { | |
| 618 | + success: function (res) { | |
| 619 | + | |
| 620 | + if (res.data.code == 0) { | |
| 621 | + title = '取消成功'; | |
| 622 | + th.setData({ | |
| 623 | + [txt1]: 0, | |
| 624 | + [txt2]: false, | |
| 625 | + [txt]: false, | |
| 626 | + }); | |
| 627 | + wx.showToast({ | |
| 628 | + title: title, | |
| 629 | + icon: 'success', | |
| 630 | + }); | |
| 631 | + | |
| 632 | + th.re_sum_price(); | |
| 633 | + } | |
| 634 | + } | |
| 635 | + }); | |
| 636 | + } | |
| 637 | + | |
| 638 | + } else if (res.cancel) { | |
| 639 | + console.log('用户点击取消') | |
| 640 | + self.setData({ | |
| 641 | + haveAdded: true, | |
| 642 | + }); | |
| 643 | + } | |
| 644 | + } | |
| 645 | + }) | |
| 646 | + } | |
| 647 | + | |
| 648 | + }, | |
| 649 | + | |
| 650 | + /** | |
| 651 | + * 增加数量 | |
| 652 | + */ | |
| 653 | + add(e) { | |
| 654 | + | |
| 655 | + var th = this; | |
| 656 | + var userInfo = getApp().globalData.userInfo; | |
| 657 | + if (!userInfo) { | |
| 658 | + getApp().goto("/pages/togoin/togoin"); | |
| 659 | + return false; | |
| 660 | + } | |
| 661 | + | |
| 662 | + if (this.data.changing) return false; | |
| 663 | + this.data.changing = 1; | |
| 664 | + | |
| 665 | + var index = e.currentTarget.dataset.index; | |
| 666 | + this.data.sele_g = this.data.list[index]; | |
| 667 | + this.data.sele_index = index; | |
| 668 | + th.data.goodsInputNum = this.data.sele_g.num + 1; | |
| 669 | + if (this.data.sele_g.cart_num) { | |
| 670 | + th.data.s_cart_num = this.data.sele_g.cart_num + 1; | |
| 671 | + } | |
| 672 | + th.add_cart_func(); | |
| 673 | + }, | |
| 674 | + | |
| 675 | + /** | |
| 676 | + * 减少数量 | |
| 677 | + */ | |
| 678 | + sub(e) { | |
| 679 | + var userInfo = getApp().globalData.userInfo; | |
| 680 | + if (!userInfo) { | |
| 681 | + getApp().goto("/pages/togoin/togoin"); | |
| 682 | + return false; | |
| 683 | + } | |
| 684 | + | |
| 685 | + var th = this; | |
| 686 | + var index = e.currentTarget.dataset.index; | |
| 687 | + var item = this.data.list[index]; | |
| 688 | + this.data.sele_g = item; | |
| 689 | + let num = item.num; | |
| 690 | + th.data.s_cart_num = item.cart_num - 1; | |
| 691 | + | |
| 692 | + if (num >= 2) { | |
| 693 | + var check_num = num - 1; | |
| 694 | + //小于起购数 | |
| 695 | + if (check_num < item.zhqty) { | |
| 696 | + wx.showToast({ | |
| 697 | + title: "该商品至少要购买" + item.zhqty + "件", | |
| 698 | + icon: 'none', | |
| 699 | + duration: 2000 | |
| 700 | + }) | |
| 701 | + return false; | |
| 702 | + } | |
| 703 | + | |
| 704 | + if (th.data.changing) return false; | |
| 705 | + th.data.changing = 1; | |
| 706 | + th.data.sele_g = item; | |
| 707 | + th.data.sele_index = index; | |
| 708 | + th.data.goodsInputNum = check_num; | |
| 709 | + | |
| 710 | + th.sub_updata_cart(); | |
| 711 | + return false; | |
| 712 | + } | |
| 713 | + | |
| 714 | + var txt = "list[" + index + "].haveAdded"; | |
| 715 | + var txt1 = "list[" + index + "].num"; | |
| 716 | + var txt2 = "list[" + index + "].showNum"; | |
| 717 | + | |
| 718 | + wx.showModal({ | |
| 719 | + title: '温馨提示', | |
| 720 | + content: '确定取消该商品参与活动?', | |
| 721 | + success(res) { | |
| 722 | + if (res.confirm) { | |
| 723 | + | |
| 724 | + if (th.data.s_cart_num) { | |
| 725 | + var updata = { | |
| 726 | + id: th.data.sele_g.cart_id, | |
| 727 | + goods_num: th.data.s_cart_num, | |
| 728 | + store_id: os.stoid | |
| 729 | + } | |
| 730 | + getApp().request.put("/api/weshop/cart/update", { | |
| 731 | + data: updata, | |
| 732 | + success: function (rs) { | |
| 733 | + if (rs.data.code == 0) { | |
| 734 | + var title = '取消成功'; | |
| 735 | + th.setData({ | |
| 736 | + [txt1]: 0, | |
| 737 | + [txt2]: false, | |
| 738 | + [txt]: false, | |
| 739 | + }); | |
| 740 | + wx.showToast({ | |
| 741 | + title: title, | |
| 742 | + icon: 'success', | |
| 743 | + }); | |
| 744 | + th.re_sum_price(); | |
| 745 | + } | |
| 746 | + } | |
| 747 | + }) | |
| 748 | + } else { | |
| 749 | + var url = '/api/weshop/cart/del/' + os.stoid + '/' + item.cart_id; | |
| 750 | + getApp().request.delete(url, { | |
| 751 | + success: function (res) { | |
| 752 | + if (res.data.code == 0) { | |
| 753 | + var title = '移除购物车成功'; | |
| 754 | + th.setData({ | |
| 755 | + [txt1]: 0, | |
| 756 | + [txt2]: false, | |
| 757 | + [txt]: false, | |
| 758 | + }); | |
| 759 | + wx.showToast({ | |
| 760 | + title: title, | |
| 761 | + icon: 'success', | |
| 762 | + }); | |
| 763 | + th.re_sum_price(); //重新统计数量和总金额 | |
| 764 | + } | |
| 765 | + } | |
| 766 | + }); | |
| 767 | + } | |
| 768 | + | |
| 769 | + } else if (res.cancel) { | |
| 770 | + console.log('用户点击取消') | |
| 771 | + self.setData({ | |
| 772 | + haveAdded: true, | |
| 773 | + }); | |
| 774 | + } | |
| 775 | + } | |
| 776 | + }) | |
| 777 | + return false; | |
| 778 | + | |
| 779 | + }, | |
| 780 | + | |
| 781 | + /** 分享 **/ | |
| 782 | + share() { | |
| 783 | + var th = this; | |
| 784 | + var userInfo = getApp().globalData.userInfo; | |
| 785 | + if (!userInfo) { | |
| 786 | + getApp().goto("/pages/togoin/togoin"); | |
| 787 | + return false; | |
| 788 | + } | |
| 789 | + wx.showLoading(); | |
| 790 | + setTimeout(function () { | |
| 791 | + th.setData({ | |
| 792 | + showMask: true, | |
| 793 | + showPoster: true, | |
| 794 | + }); | |
| 795 | + wx.hideLoading(); | |
| 796 | + }, 1000); | |
| 797 | + }, | |
| 798 | + | |
| 799 | + /** | |
| 800 | + * 关闭海报 | |
| 801 | + */ | |
| 802 | + closePoster() { | |
| 803 | + this.setData({ | |
| 804 | + showMask: false, | |
| 805 | + showPoster: false, | |
| 806 | + }); | |
| 807 | + }, | |
| 808 | + | |
| 809 | + onImgOK(e) { | |
| 810 | + console.log(e.detail.path); | |
| 811 | + this.setData({ | |
| 812 | + myimg: e.detail.path, | |
| 813 | + }); | |
| 814 | + | |
| 815 | + }, | |
| 816 | + | |
| 817 | + //---小于10的格式化函数---- | |
| 818 | + timeFormat(param) { | |
| 819 | + return param < 10 ? '0' + param : param; | |
| 820 | + }, | |
| 821 | + | |
| 822 | + //----倒计时函数----- | |
| 823 | + countDown() { | |
| 824 | + if (!this.data.is_timer) return false; | |
| 825 | + var th = this; | |
| 826 | + // 获取当前时间,同时得到活动结束时间数组 | |
| 827 | + var endTime = this.data.act.start_time; | |
| 828 | + var newTime = ut.gettimestamp(); | |
| 829 | + // 对结束时间进行处理渲染到页面 | |
| 830 | + var obj = null; | |
| 831 | + // 如果活动未结束,对时间进行处理 | |
| 832 | + if (endTime - newTime > 0) { | |
| 833 | + var time = (endTime - newTime); | |
| 834 | + // 获取天、时、分、秒 | |
| 835 | + var day = parseInt(time / (60 * 60 * 24)); | |
| 836 | + var hou = parseInt(time % (60 * 60 * 24) / 3600); | |
| 837 | + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
| 838 | + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
| 839 | + obj = { | |
| 840 | + hou: this.timeFormat(hou), | |
| 841 | + min: this.timeFormat(min), | |
| 842 | + sec: this.timeFormat(sec) | |
| 843 | + } | |
| 844 | + if (day > 0) { | |
| 845 | + obj.day = this.timeFormat(day); | |
| 846 | + } | |
| 847 | + } else { | |
| 848 | + //活动已结束,全部设置为'00' | |
| 849 | + obj = { | |
| 850 | + day: '00', | |
| 851 | + hou: '00', | |
| 852 | + min: '00', | |
| 853 | + sec: '00' | |
| 854 | + } | |
| 855 | + th.setData({ | |
| 856 | + prom_time_text: '活动已经结束:', | |
| 857 | + prom_st: 3 | |
| 858 | + }) | |
| 859 | + th.setData({ | |
| 860 | + djs: obj | |
| 861 | + }); | |
| 862 | + return false; | |
| 863 | + } | |
| 864 | + | |
| 865 | + th.setData({ | |
| 866 | + djs: obj | |
| 867 | + }); | |
| 868 | + setTimeout(function () { | |
| 869 | + th.countDown() | |
| 870 | + }, 1000); | |
| 871 | + }, | |
| 872 | + | |
| 873 | + close_all: function () { | |
| 874 | + this.setData({ | |
| 875 | + showMask: false, | |
| 876 | + showPoster: false, | |
| 877 | + showRule: false | |
| 878 | + }); | |
| 879 | + }, | |
| 880 | + | |
| 881 | + | |
| 882 | + //------定时等待某个值,有值才进行运算-------- | |
| 883 | + waitfor2: function (n, pop_value, func) { | |
| 884 | + var th = this; | |
| 885 | + if (n <= 0) { | |
| 886 | + func() | |
| 887 | + return false | |
| 888 | + } | |
| 889 | + if (th.data[pop_value]) { | |
| 890 | + func(); | |
| 891 | + return false; | |
| 892 | + } | |
| 893 | + setTimeout(function () { | |
| 894 | + --n; | |
| 895 | + th.waitfor2(n, pop_value, func) | |
| 896 | + }, 1000); | |
| 897 | + }, | |
| 898 | + | |
| 899 | + //--获取头像的本地缓存,回调写法-- | |
| 900 | + get_head_temp: function (tt) { | |
| 901 | + var ee = this; | |
| 902 | + if (ee.data.share_head) { | |
| 903 | + tt(); | |
| 904 | + return false; | |
| 905 | + } | |
| 906 | + //---获取分享图片的本地地址,头像和商品图片---- | |
| 907 | + var path2 = getApp().globalData.userInfo.head_pic; | |
| 908 | + if (path2 == "") { | |
| 909 | + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; | |
| 910 | + tt(); | |
| 911 | + } else { | |
| 912 | + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | |
| 913 | + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | |
| 914 | + wx.getImageInfo({ | |
| 915 | + src: path2, | |
| 916 | + success: function (res) { | |
| 917 | + //res.path是网络图片的本地地址 | |
| 918 | + console.log(res); | |
| 919 | + ee.data.share_head = res.path; | |
| 920 | + tt(); | |
| 921 | + }, | |
| 922 | + fail: function () { | |
| 923 | + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 | |
| 924 | + tt(); | |
| 925 | + } | |
| 926 | + }); | |
| 927 | + } | |
| 928 | + }, | |
| 929 | + | |
| 930 | + go_url: function (e) { | |
| 931 | + var url = e.currentTarget.dataset.url; | |
| 932 | + getApp().goto(url); | |
| 933 | + }, | |
| 934 | + | |
| 935 | + //-- 加入购物的函数 -- | |
| 936 | + add_cart_func: function () { | |
| 937 | + if (oo.user_id == null) { | |
| 938 | + this.data.changing = 0; | |
| 939 | + return getApp().my_warnning("还未登录!", 0, this); | |
| 940 | + } | |
| 941 | + if (!getApp().globalData.userInfo) { | |
| 942 | + this.data.changing = 0; | |
| 943 | + return getApp().my_warnning("还未登录!", 0, this); | |
| 944 | + } | |
| 945 | + | |
| 946 | + var e = this, | |
| 947 | + th = e, | |
| 948 | + o = this.data.sele_g, | |
| 949 | + a = o.goods_id; | |
| 950 | + | |
| 951 | + //----------添加到购物车时,要判断限购数量,-------- | |
| 952 | + e.get_buy_num(o, function (ee) { | |
| 953 | + //---判断商品是否超出限购--- | |
| 954 | + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
| 955 | + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id).gd_buynum > th.data.sele_g.viplimited) { | |
| 956 | + wx.showModal({ | |
| 957 | + title: '提示', | |
| 958 | + content: '超出商品限购' | |
| 959 | + }); | |
| 960 | + th.data.changing = 0; | |
| 961 | + return false; | |
| 962 | + } | |
| 963 | + if (th.data.s_cart_num) { | |
| 964 | + if (th.data.s_cart_num + th.data.g_buy_num.get(th.data.sele_g.goods_id).gd_buynum > th.data.sele_g.viplimited) { | |
| 965 | + wx.showModal({ | |
| 966 | + title: '提示', | |
| 967 | + content: '超出商品限购' | |
| 968 | + }); | |
| 969 | + th.data.changing = 0; | |
| 970 | + return false; | |
| 971 | + } | |
| 972 | + } | |
| 973 | + | |
| 974 | + } | |
| 975 | + //---判断商品是否超出活动限购--- | |
| 976 | + if (th.data.sele_g.buyqty > 0) { | |
| 977 | + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id).prom_buybum > th.data.sele_g.buyqty) { | |
| 978 | + wx.showModal({ | |
| 979 | + title: '提示', | |
| 980 | + content: '超出商品活动限购' | |
| 981 | + }); | |
| 982 | + th.data.changing = 0; | |
| 983 | + return false; | |
| 984 | + } | |
| 985 | + } | |
| 986 | + | |
| 987 | + if (th.data.goodsInputNum <= 0) { | |
| 988 | + this.data.changing = 0; | |
| 989 | + return s.my_warnning("商品数量不能为0", 0, th); | |
| 990 | + } | |
| 991 | + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) | |
| 992 | + this.setData({ | |
| 993 | + sto_sele_name: "" | |
| 994 | + }); | |
| 995 | + if (th.data.sto_sele_name == "") { | |
| 996 | + th.data.changing = 0; | |
| 997 | + return s.my_warnning("请选择门店", 0, th); | |
| 998 | + } | |
| 999 | + | |
| 1000 | + //--------------此时操作的数据------------ | |
| 1001 | + var newd = { | |
| 1002 | + goods_id: o.goods_id, | |
| 1003 | + goods_num: th.data.goodsInputNum, | |
| 1004 | + pick_id: th.data.sto_sele_id, | |
| 1005 | + user_id: oo.user_id, | |
| 1006 | + store_id: os.stoid, | |
| 1007 | + goods_price: o.shop_price, | |
| 1008 | + member_goods_price: o.shop_price, | |
| 1009 | + goods_name: o.goods_name, | |
| 1010 | + goods_sn: o.goods_sn, | |
| 1011 | + }; | |
| 1012 | + | |
| 1013 | + if (th.data.s_cart_num) { | |
| 1014 | + newd.goods_num = th.data.s_cart_num; | |
| 1015 | + } | |
| 1016 | + | |
| 1017 | + //---是不是从收藏夹出来的--- | |
| 1018 | + if (th.data.c_guide_id) { | |
| 1019 | + newd['guide_id'] = th.data.c_guide_id; | |
| 1020 | + newd['guide_type'] = 2; | |
| 1021 | + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3; | |
| 1022 | + } else { | |
| 1023 | + if (getApp().globalData.guide_id) { | |
| 1024 | + newd['guide_id'] = getApp().globalData.guide_id; | |
| 1025 | + newd['guide_type'] = 0; | |
| 1026 | + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1; | |
| 1027 | + } | |
| 1028 | + } | |
| 1029 | + | |
| 1030 | + //让商品带上房间号 | |
| 1031 | + if (th.data.sys_switch.is_skuroom_id == 1) { | |
| 1032 | + if (th.data.sele_g.goods_id == getApp().globalData.room_goods_id) { | |
| 1033 | + newd.room_id = getApp().globalData.room_id; | |
| 1034 | + } | |
| 1035 | + } else { | |
| 1036 | + if (newd.goods_id == getApp().globalData.room_goods_id) newd.room_id = getApp().globalData.room_id; | |
| 1037 | + } | |
| 1038 | + | |
| 1039 | + if (o.store_count <= 0) { | |
| 1040 | + th.data.changing = 0; | |
| 1041 | + return getApp().my_warnning("库存已为空!", 0, th); | |
| 1042 | + } | |
| 1043 | + if (o.store_count < e.data.goodsInputNum) { | |
| 1044 | + th.data.changing = 0; | |
| 1045 | + return getApp().my_warnning("库存不足!", 0, th); | |
| 1046 | + } | |
| 1047 | + th.add_cart_next(o, newd); //加入购物车下一步 | |
| 1048 | + | |
| 1049 | + }) | |
| 1050 | + }, | |
| 1051 | + | |
| 1052 | + //---加入购物车的最后一步--- | |
| 1053 | + add_cart_next(o, newd) { | |
| 1054 | + var th = this; | |
| 1055 | + //如果会员有等级价 | |
| 1056 | + if (th.data.card_field) { | |
| 1057 | + var card_price = o[th.data.card_field]; | |
| 1058 | + if (card_price > 0) { | |
| 1059 | + newd.goods_price = card_price; | |
| 1060 | + newd.member_goods_price = card_price; | |
| 1061 | + } | |
| 1062 | + } | |
| 1063 | + | |
| 1064 | + var index = this.data.sele_index; | |
| 1065 | + var txt = "list[" + index + "].haveAdded"; | |
| 1066 | + var txt1 = "list[" + index + "].num"; | |
| 1067 | + var txt2 = "list[" + index + "].showNum"; | |
| 1068 | + var txt3 = "list[" + index + "].current_price"; | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + newd.prom_type = 7; | |
| 1072 | + newd.prom_id = th.data.act.id; | |
| 1073 | + | |
| 1074 | + if (th.data.adding) return false; | |
| 1075 | + th.data.adding = 1; | |
| 1076 | + //-------如果购物车中有相关的数据--------- | |
| 1077 | + if (th.data.goodsInputNum > 1) { | |
| 1078 | + var item = th.data.sele_g; | |
| 1079 | + if (th.data.goodsInputNum > o.store_count) { | |
| 1080 | + th.data.adding = 0; | |
| 1081 | + return getApp().my_warnning("库存不足!", 0, th); | |
| 1082 | + } | |
| 1083 | + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id).prom_buybum > o.buyqty && o.buyqty > 0) { | |
| 1084 | + th.data.adding = 0; | |
| 1085 | + return getApp().my_warnning("超出商品活动限购!", 0, th); | |
| 1086 | + } | |
| 1087 | + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id).prom_buybum > th.data.sele_g.viplimited && | |
| 1088 | + th.data.sele_g.viplimited > 0 | |
| 1089 | + ) { | |
| 1090 | + th.data.adding = 0; | |
| 1091 | + return getApp().my_warnning("超出商品限购!", 0, th); | |
| 1092 | + } | |
| 1093 | + | |
| 1094 | + //如果商品没有其他活动,要取一下线下价格 | |
| 1095 | + var updata = { | |
| 1096 | + id: item.cart_id, | |
| 1097 | + goods_num: th.data.goodsInputNum, | |
| 1098 | + goods_price: newd.goods_price, | |
| 1099 | + member_goods_price: newd.goods_price, | |
| 1100 | + store_id: os.stoid, | |
| 1101 | + }; | |
| 1102 | + if (th.data.s_cart_num) { | |
| 1103 | + updata.goods_num = th.data.s_cart_num; | |
| 1104 | + } | |
| 1105 | + //---是不是从收藏夹出来的--- | |
| 1106 | + if (th.data.c_guide_id) { | |
| 1107 | + updata['guide_id'] = th.data.c_guide_id; | |
| 1108 | + updata['guide_type'] = 3; //加入购物车之后就变成了3 | |
| 1109 | + } else { | |
| 1110 | + if (getApp().globalData.guide_id) { | |
| 1111 | + updata['guide_id'] = getApp().globalData.guide_id; | |
| 1112 | + updata['guide_type'] = 0; | |
| 1113 | + } | |
| 1114 | + } | |
| 1115 | + getApp().request.put("/api/weshop/cart/update", { | |
| 1116 | + data: updata, | |
| 1117 | + success: function (t) { | |
| 1118 | + th.setData({ | |
| 1119 | + [txt1]: th.data.goodsInputNum, | |
| 1120 | + [txt2]: true, | |
| 1121 | + [txt]: true, | |
| 1122 | + [txt3]: newd.goods_price, | |
| 1123 | + }); | |
| 1124 | + th.data.adding = 0; | |
| 1125 | + th.data.sele_store = 1; | |
| 1126 | + | |
| 1127 | + if (th.data.s_cart_num) { | |
| 1128 | + var txt_temp = "list[" + index + "].cart_num"; | |
| 1129 | + th.setData({ | |
| 1130 | + [txt_temp]: th.data.s_cart_num | |
| 1131 | + }) | |
| 1132 | + } | |
| 1133 | + | |
| 1134 | + th.re_sum_price(); //重新统计数量和总金额 | |
| 1135 | + } | |
| 1136 | + }); | |
| 1137 | + } else { | |
| 1138 | + | |
| 1139 | + getApp().request.post("/api/weshop/cart/save", { | |
| 1140 | + data: newd, | |
| 1141 | + success: function (t) { | |
| 1142 | + if (t.data.code == 0) { | |
| 1143 | + var txt4 = "list[" + th.data.sele_index + "].cart_id"; | |
| 1144 | + th.setData({ | |
| 1145 | + [txt1]: newd.goods_num, | |
| 1146 | + [txt2]: true, | |
| 1147 | + [txt3]: newd.goods_price, | |
| 1148 | + [txt]: true, | |
| 1149 | + [txt4]: t.data.data.id, | |
| 1150 | + }); | |
| 1151 | + | |
| 1152 | + th.data.adding = 0; | |
| 1153 | + th.data.sele_store = 1; | |
| 1154 | + th.re_sum_price(); //重新统计数量和总金额 | |
| 1155 | + } | |
| 1156 | + } | |
| 1157 | + }); | |
| 1158 | + } | |
| 1159 | + }, | |
| 1160 | + | |
| 1161 | + //等待获取配置 | |
| 1162 | + wait_for_store_config: function (bconfig) { | |
| 1163 | + var th = this; | |
| 1164 | + var e = bconfig; | |
| 1165 | + if (e && e.is_sort_storage) { | |
| 1166 | + wx.getLocation({ | |
| 1167 | + type: 'gcj02', | |
| 1168 | + success: function (res) { | |
| 1169 | + th.data.lat = res.latitude; | |
| 1170 | + th.data.lon = res.longitude; | |
| 1171 | + th.data.is_get_local_ok = 1; | |
| 1172 | + }, | |
| 1173 | + fail: function (res) { | |
| 1174 | + if (res.errCode == 2) { | |
| 1175 | + th.setData({ | |
| 1176 | + is_gps: 0 | |
| 1177 | + }); | |
| 1178 | + if (th.data.is_gps == 0) { | |
| 1179 | + getApp().confirmBox("请开启GPS定位", null, 10000, !1); | |
| 1180 | + } | |
| 1181 | + | |
| 1182 | + } else { | |
| 1183 | + th.setData({ | |
| 1184 | + is_gps: "3" | |
| 1185 | + }); | |
| 1186 | + } | |
| 1187 | + | |
| 1188 | + th.data.is_get_local_ok = 1; | |
| 1189 | + } | |
| 1190 | + }) | |
| 1191 | + } else { | |
| 1192 | + th.data.is_get_local_ok = 1; | |
| 1193 | + } | |
| 1194 | + }, | |
| 1195 | + | |
| 1196 | + //--- 获取卡类列表 --- | |
| 1197 | + getPlusCardType: function (func) { | |
| 1198 | + var storid = os.stoid; | |
| 1199 | + var user = getApp().globalData.userInfo; | |
| 1200 | + if (!user) return false; | |
| 1201 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | |
| 1202 | + var plusCard = res.data.data; | |
| 1203 | + var arr = [1219, 2089, 3031]; | |
| 1204 | + var new_arr = new Array(); | |
| 1205 | + var card_name_map = new Map(); | |
| 1206 | + | |
| 1207 | + var list = []; | |
| 1208 | + for (var i = 0; i < plusCard.length; i++) { | |
| 1209 | + if ((!user || user.card_field == null || user.card_field == "") && plusCard[i].IsStopBuy == true) continue; | |
| 1210 | + var name = "card" + plusCard[i].CorrPrice.toLowerCase(); | |
| 1211 | + card_name_map.set(name, plusCard[i].CardName); | |
| 1212 | + list.push(plusCard[i]); | |
| 1213 | + } | |
| 1214 | + | |
| 1215 | + var ob = { | |
| 1216 | + "card_list": list, | |
| 1217 | + "name_map": card_name_map | |
| 1218 | + }; | |
| 1219 | + func(ob); | |
| 1220 | + }) | |
| 1221 | + }, | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + //--- 设置一下默认库存的数量 ---- | |
| 1225 | + set_def_storage(ee) { | |
| 1226 | + var that = this; | |
| 1227 | + that.data.fir_def_store = ee; | |
| 1228 | + that.setData({ | |
| 1229 | + def_pick_store: ee, | |
| 1230 | + sto_sele_name: ee.pickup_name, | |
| 1231 | + sto_sele_id: ee.pickup_id, | |
| 1232 | + sto_sele_distr: ee.distr_type | |
| 1233 | + }) | |
| 1234 | + }, | |
| 1235 | + | |
| 1236 | + //---------拿出门店分类和门店------------ | |
| 1237 | + get_sto(e) { | |
| 1238 | + var th = this; | |
| 1239 | + this.waitfor2(15, 'is_get_local_ok', function () { | |
| 1240 | + //if (!th.data.sele_g) return false; | |
| 1241 | + var dd = null; | |
| 1242 | + var g_distr_type = 0; | |
| 1243 | + if (th.data.sele_g) g_distr_type = th.data.sele_g.distr_type; | |
| 1244 | + if (g_distr_type != 0) { | |
| 1245 | + dd = { | |
| 1246 | + store_id: os.stoid, | |
| 1247 | + distr_type: g_distr_type, | |
| 1248 | + isstop: 0, | |
| 1249 | + is_pos: 1, | |
| 1250 | + pageSize: 2000 | |
| 1251 | + } | |
| 1252 | + } else { | |
| 1253 | + dd = { | |
| 1254 | + store_id: os.stoid, | |
| 1255 | + isstop: 0, | |
| 1256 | + is_pos: 1, | |
| 1257 | + pageSize: 2000 | |
| 1258 | + } | |
| 1259 | + } | |
| 1260 | + | |
| 1261 | + //如果有距离的话 | |
| 1262 | + if (th.data.lat != null) { | |
| 1263 | + dd.lat = th.data.lat; | |
| 1264 | + dd.lon = th.data.lon; | |
| 1265 | + } | |
| 1266 | + | |
| 1267 | + //如果会员是有默认的门店话 | |
| 1268 | + if (!th.data.def_pick_store && th.data.fir_def_store) { | |
| 1269 | + th.setData({ | |
| 1270 | + def_pick_store: th.data.fir_def_store | |
| 1271 | + }); | |
| 1272 | + } | |
| 1273 | + | |
| 1274 | + wx.showLoading({ | |
| 1275 | + title: '加载中.' | |
| 1276 | + }); | |
| 1277 | + //----------获取门店---------------- | |
| 1278 | + getApp().request.promiseGet("/api/weshop/pickup/list", { | |
| 1279 | + data: dd, | |
| 1280 | + }).then(res => { | |
| 1281 | + var e = res; | |
| 1282 | + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) { | |
| 1283 | + | |
| 1284 | + var his_cate_num = 0; | |
| 1285 | + for (let i in e.data.data.pageData) { | |
| 1286 | + let item = e.data.data.pageData[i]; | |
| 1287 | + if (item.category_id > 0) { | |
| 1288 | + his_cate_num = 1; | |
| 1289 | + break; | |
| 1290 | + } | |
| 1291 | + } | |
| 1292 | + e.his_cate_num = his_cate_num; | |
| 1293 | + | |
| 1294 | + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 | |
| 1295 | + if (dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store) == '{}') && th.data.bconfig && th.data.bconfig.is_sort_storage) { | |
| 1296 | + th.setData({ | |
| 1297 | + def_pick_store: e.data.data.pageData[0], | |
| 1298 | + sto_sele_name: e.data.data.pageData[0].pickup_name, | |
| 1299 | + sto_sele_id: e.data.data.pageData[0].pickup_id, | |
| 1300 | + sto_sele_distr: e.data.data.pageData[0].distr_type | |
| 1301 | + }); | |
| 1302 | + th.data.fir_def_store = e.data.data.pageData[0]; | |
| 1303 | + } | |
| 1304 | + | |
| 1305 | + //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 -- | |
| 1306 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { | |
| 1307 | + for (var k = 0; k < e.data.data.pageData.length; k++) { | |
| 1308 | + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { | |
| 1309 | + e.data.data.pageData.splice(k, 1); //删除 | |
| 1310 | + break; | |
| 1311 | + } | |
| 1312 | + } | |
| 1313 | + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 | |
| 1314 | + } | |
| 1315 | + | |
| 1316 | + th.setData({ | |
| 1317 | + all_pick_list: e.data.data.pageData | |
| 1318 | + }); | |
| 1319 | + th.deal_pickup(e); | |
| 1320 | + } | |
| 1321 | + }) | |
| 1322 | + }) | |
| 1323 | + }, | |
| 1324 | + //------------处理门店--------------- | |
| 1325 | + deal_pickup(e) { | |
| 1326 | + var th = this; | |
| 1327 | + wx.hideLoading(); | |
| 1328 | + //单总量超出5个的时候 | |
| 1329 | + if (e.data.data.total > 10 && e.his_cate_num) { | |
| 1330 | + getApp().request.get("/api/weshop/storagecategory/page", { | |
| 1331 | + data: { | |
| 1332 | + store_id: os.stoid, | |
| 1333 | + pageSize: 1000, | |
| 1334 | + orderField: "sort", | |
| 1335 | + orderType: 'asc', | |
| 1336 | + }, | |
| 1337 | + success: function (ee) { | |
| 1338 | + if (ee.data.code == 0) { | |
| 1339 | + | |
| 1340 | + var check_all_cate = 0; | |
| 1341 | + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) { | |
| 1342 | + for (let i in ee.data.data.pageData) { | |
| 1343 | + let item = ee.data.data.pageData[i]; | |
| 1344 | + if (item.is_show == 1) { | |
| 1345 | + check_all_cate = 1; | |
| 1346 | + break | |
| 1347 | + } | |
| 1348 | + } | |
| 1349 | + } | |
| 1350 | + | |
| 1351 | + if (check_all_cate) { | |
| 1352 | + | |
| 1353 | + var sto_cate = ee.data.data.pageData; | |
| 1354 | + var sto_arr = e.data.data.pageData; | |
| 1355 | + var newarr = new Array(); | |
| 1356 | + var qita = new Array(); | |
| 1357 | + | |
| 1358 | + var is_del_pk = 0; | |
| 1359 | + //----要进行门店分组-------- | |
| 1360 | + for (var i = 0; i < sto_arr.length; i++) { | |
| 1361 | + //找一下这个门店有没有在分类数组内 | |
| 1362 | + var find2 = 0, | |
| 1363 | + find2name = "", | |
| 1364 | + sort = 0; | |
| 1365 | + is_del_pk = 0; | |
| 1366 | + for (var m = 0; m < sto_cate.length; m++) { | |
| 1367 | + if (sto_arr[i].category_id == sto_cate[m].cat_id) { | |
| 1368 | + if (sto_cate[m].is_show != 1) { | |
| 1369 | + is_del_pk = 1; | |
| 1370 | + sto_arr.splice(i, 1); | |
| 1371 | + i--; | |
| 1372 | + } else { | |
| 1373 | + find2 = sto_cate[m].cat_id; | |
| 1374 | + find2name = sto_cate[m].cat_name; | |
| 1375 | + sort = sto_cate[m].sort; | |
| 1376 | + is_del_pk = 0; | |
| 1377 | + } | |
| 1378 | + break; | |
| 1379 | + } | |
| 1380 | + } | |
| 1381 | + if (is_del_pk) continue; | |
| 1382 | + | |
| 1383 | + if (newarr.length > 0) { | |
| 1384 | + var find = 0; | |
| 1385 | + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1386 | + if (find2 != 0) { | |
| 1387 | + for (var ii = 0; ii < newarr.length; ii++) { | |
| 1388 | + if (sto_arr[i].category_id == newarr[ii].cat_id) { | |
| 1389 | + newarr[ii].s_arr.push(sto_arr[i]); | |
| 1390 | + find = 1; | |
| 1391 | + break; | |
| 1392 | + } | |
| 1393 | + } | |
| 1394 | + if (find == 0) { | |
| 1395 | + var arr0 = new Array(); | |
| 1396 | + arr0.push(sto_arr[i]); | |
| 1397 | + var item = { | |
| 1398 | + cat_id: find2, | |
| 1399 | + name: find2name, | |
| 1400 | + sort: sort, | |
| 1401 | + s_arr: arr0 | |
| 1402 | + }; | |
| 1403 | + newarr.push(item); | |
| 1404 | + } | |
| 1405 | + } else { | |
| 1406 | + qita.push(sto_arr[i]); | |
| 1407 | + } | |
| 1408 | + } else { | |
| 1409 | + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1410 | + if (find2 != 0) { | |
| 1411 | + var arr0 = new Array(); | |
| 1412 | + arr0.push(sto_arr[i]); | |
| 1413 | + var item = { | |
| 1414 | + cat_id: find2, | |
| 1415 | + name: find2name, | |
| 1416 | + sort: sort, | |
| 1417 | + s_arr: arr0 | |
| 1418 | + }; | |
| 1419 | + newarr.push(item); | |
| 1420 | + } else { | |
| 1421 | + qita.push(sto_arr[i]); | |
| 1422 | + } | |
| 1423 | + } | |
| 1424 | + } | |
| 1425 | + | |
| 1426 | + var def_arr = new Array(); | |
| 1427 | + //-- 开始就看10个门店 -- | |
| 1428 | + for (var k = 0; k < 10; k++) { | |
| 1429 | + if (k == sto_arr.length) break; | |
| 1430 | + def_arr.push(sto_arr[k]); | |
| 1431 | + } | |
| 1432 | + | |
| 1433 | + th.setData({ | |
| 1434 | + def_pickpu_list: def_arr, | |
| 1435 | + pickpu_list: ee.data.data.pageData | |
| 1436 | + }); | |
| 1437 | + | |
| 1438 | + //门店分类要排序下 | |
| 1439 | + function compare(property) { | |
| 1440 | + return function (a, b) { | |
| 1441 | + var value1 = a[property]; | |
| 1442 | + var value2 = b[property]; | |
| 1443 | + return value1 - value2; | |
| 1444 | + } | |
| 1445 | + } | |
| 1446 | + | |
| 1447 | + if (newarr.length > 0) | |
| 1448 | + newarr.sort(compare("sort")); | |
| 1449 | + //----安排其他的分类----- | |
| 1450 | + if (qita.length > 0) { | |
| 1451 | + var item = { | |
| 1452 | + cat_id: -1, | |
| 1453 | + name: "其他", | |
| 1454 | + s_arr: qita | |
| 1455 | + }; | |
| 1456 | + newarr.push(item); | |
| 1457 | + } | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + var sd = { | |
| 1461 | + all_sto: newarr, | |
| 1462 | + is_show_sto_cat: 1 | |
| 1463 | + } | |
| 1464 | + if (!sto_arr || sto_arr.length <= 10) { | |
| 1465 | + sd.is_show_sto_cat = -1; | |
| 1466 | + sd.only_pk = sto_arr; | |
| 1467 | + } | |
| 1468 | + th.setData(sd); | |
| 1469 | + | |
| 1470 | + } else { | |
| 1471 | + th.setData({ | |
| 1472 | + is_show_sto_cat: -1, | |
| 1473 | + only_pk: e.data.data.pageData | |
| 1474 | + }); | |
| 1475 | + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | |
| 1476 | + if (!th.data.def_pick_store) { | |
| 1477 | + th.setData({ | |
| 1478 | + def_pick_store: e.data.data.pageData[0] | |
| 1479 | + }) | |
| 1480 | + } | |
| 1481 | + } | |
| 1482 | + } else { | |
| 1483 | + th.setData({ | |
| 1484 | + is_show_sto_cat: -1, | |
| 1485 | + only_pk: e.data.data.pageData | |
| 1486 | + }); | |
| 1487 | + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | |
| 1488 | + if (!th.data.def_pick_store) { | |
| 1489 | + th.setData({ | |
| 1490 | + def_pick_store: e.data.data.pageData[0] | |
| 1491 | + }) | |
| 1492 | + } | |
| 1493 | + } | |
| 1494 | + } | |
| 1495 | + }); | |
| 1496 | + } else { | |
| 1497 | + th.setData({ | |
| 1498 | + is_show_sto_cat: 0, | |
| 1499 | + only_pk: e.data.data.pageData | |
| 1500 | + }); | |
| 1501 | + //-----如果没有默认门店,要取第一个门店作为默认店------ | |
| 1502 | + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { | |
| 1503 | + if (e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) { | |
| 1504 | + th.setData({ | |
| 1505 | + def_pick_store: e.data.data.pageData[0], | |
| 1506 | + sto_sele_name: e.data.data.pageData[0].pickup_name, | |
| 1507 | + sto_sele_id: e.data.data.pageData[0].pickup_id, | |
| 1508 | + sto_sele_distr: e.data.data.pageData[0].distr_type | |
| 1509 | + }) | |
| 1510 | + } | |
| 1511 | + } | |
| 1512 | + } | |
| 1513 | + }, | |
| 1514 | + | |
| 1515 | + //---选择分类门店--- | |
| 1516 | + choice_sort_store: function (e) { | |
| 1517 | + var index = e.currentTarget.dataset.index; | |
| 1518 | + var region_name = e.currentTarget.dataset.region; | |
| 1519 | + var item = this.data.all_sto[index]; | |
| 1520 | + this.setData({ | |
| 1521 | + region_name: region_name, | |
| 1522 | + sort_store: 0, | |
| 1523 | + choice_sort_store: 1, | |
| 1524 | + sec_sto: item, | |
| 1525 | + sec_pick_index: 0 | |
| 1526 | + }); | |
| 1527 | + }, | |
| 1528 | + | |
| 1529 | + choose_for_store_fir: function (e) { | |
| 1530 | + var index_c = e.currentTarget.dataset.ind; | |
| 1531 | + var th = this; | |
| 1532 | + th.setData({ | |
| 1533 | + fir_pick_index: index_c | |
| 1534 | + }) | |
| 1535 | + }, | |
| 1536 | + | |
| 1537 | + //确定def_pick为选择的门店 | |
| 1538 | + sure_pick: function (e) { | |
| 1539 | + var th = this; | |
| 1540 | + var item = null; | |
| 1541 | + var openindstore = th.data.open_ind_store; | |
| 1542 | + | |
| 1543 | + if (th.data.choice_sort_store == 0) { | |
| 1544 | + var index = th.data.fir_pick_index; | |
| 1545 | + if (th.data.is_show_sto_cat == 1) { | |
| 1546 | + item = th.data.def_pickpu_list[index]; | |
| 1547 | + } else { | |
| 1548 | + item = th.data.only_pk[index]; //当没有门店分类的时候 | |
| 1549 | + } | |
| 1550 | + } else { | |
| 1551 | + var index = th.data.sec_pick_index; | |
| 1552 | + item = th.data.sec_sto.s_arr[index]; | |
| 1553 | + } | |
| 1554 | + | |
| 1555 | + //判断门店的配送方式是不是匹配 | |
| 1556 | + var g_distr_type = 0; | |
| 1557 | + if (th.data.sele_g) | |
| 1558 | + g_distr_type = th.data.sele_g.distr_type; | |
| 1559 | + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { | |
| 1560 | + wx.showToast({ | |
| 1561 | + title: "门店配送方式不匹配", | |
| 1562 | + icon: 'none', | |
| 1563 | + duration: 2000 | |
| 1564 | + }); | |
| 1565 | + return false; | |
| 1566 | + } | |
| 1567 | + | |
| 1568 | + th.setData({ | |
| 1569 | + def_pick_store: item, | |
| 1570 | + sto_sele_name: item.pickup_name, | |
| 1571 | + sto_sele_id: item.pickup_id, | |
| 1572 | + sto_sele_distr: item.distr_type, | |
| 1573 | + store: 0, | |
| 1574 | + choice_sort_store: 0, | |
| 1575 | + fir_pick_index: 0, | |
| 1576 | + sort_store: 0 | |
| 1577 | + }); | |
| 1578 | + | |
| 1579 | + //只是单纯的选择门店 | |
| 1580 | + if (this.data.only) { | |
| 1581 | + this.data.only = 0; | |
| 1582 | + return false; | |
| 1583 | + } | |
| 1584 | + th.check_is_in_cart(function () { | |
| 1585 | + th.add_cart_func(); | |
| 1586 | + }) | |
| 1587 | + }, | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + //---点击二级之后的选择--- | |
| 1591 | + choose_for_store: function (e) { | |
| 1592 | + var index_c = e.currentTarget.dataset.ind; | |
| 1593 | + var th = this; | |
| 1594 | + th.setData({ | |
| 1595 | + sec_pick_index: index_c, | |
| 1596 | + fir_pick_index: index_c | |
| 1597 | + }) | |
| 1598 | + | |
| 1599 | + }, | |
| 1600 | + //把选择的门店设置成默认的门店def_pick | |
| 1601 | + set_def_pick: function (e) { | |
| 1602 | + var th = this; | |
| 1603 | + var item = null; | |
| 1604 | + if (th.data.choice_sort_store == 0) { | |
| 1605 | + var index = th.data.fir_pick_index; | |
| 1606 | + if (th.data.is_show_sto_cat == 1) { | |
| 1607 | + item = th.data.def_pickpu_list[index]; | |
| 1608 | + } else { | |
| 1609 | + item = th.data.only_pk[index]; //当没有门店分类的时候 | |
| 1610 | + } | |
| 1611 | + } else { | |
| 1612 | + var index = th.data.sec_pick_index; | |
| 1613 | + item = th.data.sec_sto.s_arr[index]; | |
| 1614 | + } | |
| 1615 | + | |
| 1616 | + //判断门店的配送方式是不是匹配 | |
| 1617 | + var g_distr_type = th.data.sele_g.distr_type; | |
| 1618 | + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { | |
| 1619 | + wx.showToast({ | |
| 1620 | + title: "门店配送方式不匹配", | |
| 1621 | + icon: 'none', | |
| 1622 | + duration: 2000 | |
| 1623 | + }); | |
| 1624 | + return false; | |
| 1625 | + } | |
| 1626 | + | |
| 1627 | + //先设置之前,要判断是不是有库存 | |
| 1628 | + var user_id = getApp().globalData.user_id; | |
| 1629 | + var def_pickup_id = item.pickup_id; | |
| 1630 | + | |
| 1631 | + getApp().request.put('/api/weshop/users/update', { | |
| 1632 | + data: { | |
| 1633 | + user_id: user_id, | |
| 1634 | + def_pickup_id: def_pickup_id | |
| 1635 | + }, | |
| 1636 | + success: function (res) { | |
| 1637 | + if (res.data.code == 0) { | |
| 1638 | + if (th.data.choice_sort_store == 0) th.setData({ | |
| 1639 | + fir_pick_index: 0 | |
| 1640 | + }); | |
| 1641 | + getApp().globalData.pk_store = item; | |
| 1642 | + } else { | |
| 1643 | + //s.showWarning("设置默认门店地址失败", null, 500, !1); | |
| 1644 | + getApp().my_warnning("设置默认门店地址失败", 0, th) | |
| 1645 | + } | |
| 1646 | + | |
| 1647 | + } | |
| 1648 | + }); | |
| 1649 | + | |
| 1650 | + th.setData({ | |
| 1651 | + def_pick_store: item, | |
| 1652 | + sto_sele_name: item.pickup_name, | |
| 1653 | + sto_sele_id: item.pickup_id, | |
| 1654 | + sto_sele_distr: item.distr_type, | |
| 1655 | + store: 0, | |
| 1656 | + choice_sort_store: 0, | |
| 1657 | + sort_store: 0, //关闭门店2级 | |
| 1658 | + }); | |
| 1659 | + | |
| 1660 | + th.add_cart_func(); | |
| 1661 | + }, | |
| 1662 | + | |
| 1663 | + // 返回按钮 | |
| 1664 | + returns: function () { | |
| 1665 | + this.setData({ | |
| 1666 | + sort_store: 0, | |
| 1667 | + choice_sort_store: 0 | |
| 1668 | + }); | |
| 1669 | + }, | |
| 1670 | + //选择更多门店 | |
| 1671 | + more_store: function () { | |
| 1672 | + this.setData({ | |
| 1673 | + sort_store: 1 | |
| 1674 | + }); | |
| 1675 | + }, | |
| 1676 | + //关闭选择门店 | |
| 1677 | + close_popup: function (e) { | |
| 1678 | + var th = this; | |
| 1679 | + this.setData({ | |
| 1680 | + store: 0, | |
| 1681 | + choice_sort_store: 0, | |
| 1682 | + sort_store: 0, | |
| 1683 | + fir_pick_index: 0, | |
| 1684 | + sec_pick_index: 0 | |
| 1685 | + }) | |
| 1686 | + }, | |
| 1687 | + | |
| 1688 | + //-------------获取购买数量的总函数---------------- | |
| 1689 | + get_buy_num: function (gd, func) { | |
| 1690 | + var map = this.data.g_buy_num, | |
| 1691 | + th = this, | |
| 1692 | + user_id = getApp().globalData.user_id; | |
| 1693 | + | |
| 1694 | + if (user_id == null) { | |
| 1695 | + getApp().goto("/pages/togoin/togoin"); | |
| 1696 | + return false; | |
| 1697 | + } | |
| 1698 | + if (map && map.has(gd.goods_id)) { | |
| 1699 | + "function" == typeof func && func(); | |
| 1700 | + } else { | |
| 1701 | + var res1 = null; | |
| 1702 | + //----获取商品购买数---- | |
| 1703 | + getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | |
| 1704 | + data: { | |
| 1705 | + store_id: os.stoid, | |
| 1706 | + user_id: user_id, | |
| 1707 | + goods_id: gd.goods_id, | |
| 1708 | + prom_type: 7, | |
| 1709 | + prom_id: th.data.act.id | |
| 1710 | + }, | |
| 1711 | + }).then(res2 => { | |
| 1712 | + var g_buy_num = 0; | |
| 1713 | + var promgoodsbuynum = 0; | |
| 1714 | + if (res2.data.code == 0) { | |
| 1715 | + var buy_num_data = res2.data.data; | |
| 1716 | + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | |
| 1717 | + g_buy_num = buy_num_data.goodsbuynum; | |
| 1718 | + } | |
| 1719 | + | |
| 1720 | + if (!map) map = new Map(); | |
| 1721 | + var ob = { | |
| 1722 | + gd_buynum: g_buy_num, | |
| 1723 | + prom_buybum: promgoodsbuynum, | |
| 1724 | + } | |
| 1725 | + map.set(gd.goods_id, ob); | |
| 1726 | + th.setData({ | |
| 1727 | + g_buy_num: map | |
| 1728 | + }); | |
| 1729 | + "function" == typeof func && func(); | |
| 1730 | + }) | |
| 1731 | + } | |
| 1732 | + }, | |
| 1733 | + | |
| 1734 | + //-- 当是减数量的调用 -- | |
| 1735 | + sub_updata_cart() { | |
| 1736 | + var th = this; | |
| 1737 | + var index = this.data.sele_index; | |
| 1738 | + var txt = "list[" + index + "].haveAdded"; | |
| 1739 | + var txt1 = "list[" + index + "].num"; | |
| 1740 | + var txt2 = "list[" + index + "].showNum"; | |
| 1741 | + | |
| 1742 | + var cur_price = this.data.sele_g.shop_price; | |
| 1743 | + if (th.data.card_field && this.data.sele_g[th.data.card_field]) { | |
| 1744 | + cur_price = this.data.sele_g[th.data.card_field]; | |
| 1745 | + } | |
| 1746 | + var updata = { | |
| 1747 | + id: th.data.sele_g.cart_id, | |
| 1748 | + goods_num: th.data.goodsInputNum, | |
| 1749 | + goods_price: cur_price, | |
| 1750 | + store_id: os.stoid, | |
| 1751 | + }; | |
| 1752 | + | |
| 1753 | + if (th.data.s_cart_num) { | |
| 1754 | + updata.goods_num = th.data.s_cart_num; | |
| 1755 | + } | |
| 1756 | + | |
| 1757 | + //---是不是从收藏夹出来的--- | |
| 1758 | + if (th.data.c_guide_id) { | |
| 1759 | + updata['guide_id'] = th.data.c_guide_id; | |
| 1760 | + updata['guide_type'] = 3; //加入购物车之后就变成了3 | |
| 1761 | + } else { | |
| 1762 | + if (getApp().globalData.guide_id) { | |
| 1763 | + updata['guide_id'] = getApp().globalData.guide_id; | |
| 1764 | + updata['guide_type'] = 0; | |
| 1765 | + } | |
| 1766 | + } | |
| 1767 | + //调用接口,更新购物车 | |
| 1768 | + getApp().request.put("/api/weshop/cart/update", { | |
| 1769 | + data: updata, | |
| 1770 | + success: function (t) { | |
| 1771 | + th.setData({ | |
| 1772 | + [txt1]: th.data.goodsInputNum, | |
| 1773 | + [txt2]: true, | |
| 1774 | + [txt]: true, | |
| 1775 | + }); | |
| 1776 | + th.data.adding = 0; | |
| 1777 | + th.data.sele_store = 1; | |
| 1778 | + if (th.data.s_cart_num) { | |
| 1779 | + var txt_temp = "list[" + index + "].cart_num"; | |
| 1780 | + th.setData({ | |
| 1781 | + [txt_temp]: th.data.s_cart_num | |
| 1782 | + }) | |
| 1783 | + } | |
| 1784 | + | |
| 1785 | + th.re_sum_price(); //重新统计数量和总金额 | |
| 1786 | + } | |
| 1787 | + }); | |
| 1788 | + }, | |
| 1789 | + //一 开始的选择门店 -- | |
| 1790 | + choose_store: function (e) { | |
| 1791 | + var userInfo = getApp().globalData.userInfo; | |
| 1792 | + if (!userInfo) { | |
| 1793 | + getApp().goto("/pages/togoin/togoin"); | |
| 1794 | + return false; | |
| 1795 | + } | |
| 1796 | + this.data.only = 1; | |
| 1797 | + this.setData({ | |
| 1798 | + store: 1 | |
| 1799 | + }) | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + this.get_sto() | |
| 1803 | + }, | |
| 1804 | + | |
| 1805 | + // -- 加入之前,先判断有没有在购物车中,没有商品就添加 -- | |
| 1806 | + check_is_in_cart: function (func) { | |
| 1807 | + var th = this; | |
| 1808 | + var index = th.data.sele_index; | |
| 1809 | + var txt = "list[" + index + "].haveAdded"; | |
| 1810 | + var txt1 = "list[" + index + "].num"; | |
| 1811 | + var txt2 = "list[" + index + "].showNum"; | |
| 1812 | + var txt3 = "list[" + index + "].cart_id"; | |
| 1813 | + var txt4 = "list[" + index + "].current_price"; | |
| 1814 | + var txt5 = "list[" + index + "].cart_num"; | |
| 1815 | + | |
| 1816 | + //----先看会员在购物车中是否加入了该商品----- | |
| 1817 | + getApp().request.get("/api/weshop/cart/page", { | |
| 1818 | + data: { | |
| 1819 | + store_id: os.stoid, | |
| 1820 | + user_id: oo.user_id, | |
| 1821 | + goods_id: th.data.sele_g.goods_id, | |
| 1822 | + pick_id: th.data.sto_sele_id, | |
| 1823 | + }, | |
| 1824 | + success: function (re) { | |
| 1825 | + if (re.data.data.total > 0) { | |
| 1826 | + var item = re.data.data.pageData[0]; | |
| 1827 | + th.get_buy_num(th.data.sele_g, function () { | |
| 1828 | + //当前的价格要更新进去 | |
| 1829 | + var cur_price = th.data.sele_g.shop_price; | |
| 1830 | + if (th.data.card_field && th.data.sele_g[th.data.card_field]) { | |
| 1831 | + cur_price = th.data.sele_g[th.data.card_field]; | |
| 1832 | + } | |
| 1833 | + | |
| 1834 | + var prom_buybum = 0; | |
| 1835 | + var gd_buynum = 0; | |
| 1836 | + //加入也要控制一下限购 | |
| 1837 | + var check_obj = th.data.g_buy_num.get(th.data.sele_g.goods_id); | |
| 1838 | + if (check_obj.gd_buynum && check_obj.gd_buynum > 0) gd_buynum = check_obj.gd_buynum; | |
| 1839 | + if (check_obj.prom_buybum && check_obj.prom_buybum > 0) prom_buybum = check_obj.prom_buybum; | |
| 1840 | + | |
| 1841 | + if (check_obj) { | |
| 1842 | + if (check_obj.prom_buybum && check_obj.prom_buybum >= th.data.sele_g.buyqty && | |
| 1843 | + th.data.sele_g.buyqty > 0 | |
| 1844 | + ) { | |
| 1845 | + wx.showToast({ | |
| 1846 | + title: "您的已购数量超出活动的限购", | |
| 1847 | + icon: 'none', | |
| 1848 | + duration: 2000 | |
| 1849 | + }); | |
| 1850 | + return false; | |
| 1851 | + } | |
| 1852 | + if (check_obj.gd_buynum && check_obj.gd_buynum >= th.data.sele_g.viplimited && | |
| 1853 | + th.data.sele_g.viplimited > 0 | |
| 1854 | + ) { | |
| 1855 | + wx.showToast({ | |
| 1856 | + title: "您的已购数量超出商品的限购", | |
| 1857 | + icon: 'none', | |
| 1858 | + duration: 2000 | |
| 1859 | + }); | |
| 1860 | + return false; | |
| 1861 | + } | |
| 1862 | + } | |
| 1863 | + | |
| 1864 | + item.cbuy = 'no'; | |
| 1865 | + var cbuy = th.data.sele_g.viplimited > 0 ? th.data.sele_g.viplimited - gd_buynum : 'no'; | |
| 1866 | + if (cbuy != 'no') item.cbuy = cbuy; | |
| 1867 | + var cbuy2 = th.data.sele_g.buyqty > 0 ? th.data.sele_g.buyqty - prom_buybum : 'no'; | |
| 1868 | + if (cbuy2 != 'no') { | |
| 1869 | + if (item.cbuy == 'no' || item.cbuy > cbuy2) item.cbuy = cbuy2; | |
| 1870 | + } | |
| 1871 | + | |
| 1872 | + var num = item.goods_num; | |
| 1873 | + if (item.cbuy > -1 && item.cbuy < item.goods_num) { | |
| 1874 | + num = item.cbuy; | |
| 1875 | + } | |
| 1876 | + th.setData({ | |
| 1877 | + [txt1]: num, | |
| 1878 | + [txt2]: true, | |
| 1879 | + [txt]: true, | |
| 1880 | + [txt3]: item.id, | |
| 1881 | + [txt4]: cur_price, | |
| 1882 | + [txt5]: item.goods_num, | |
| 1883 | + }); | |
| 1884 | + | |
| 1885 | + var updata = { | |
| 1886 | + id: item.id, | |
| 1887 | + prom_type: 7, | |
| 1888 | + goods_price: cur_price, | |
| 1889 | + prom_id: th.data.act.id, | |
| 1890 | + store_id: os.stoid, | |
| 1891 | + }; | |
| 1892 | + if (getApp().globalData.guide_id) { | |
| 1893 | + updata['guide_id'] = getApp().globalData.guide_id; | |
| 1894 | + updata['guide_type'] = 0; | |
| 1895 | + } | |
| 1896 | + | |
| 1897 | + getApp().request.put("/api/weshop/cart/update", { | |
| 1898 | + data: updata, | |
| 1899 | + success: function (t) {} | |
| 1900 | + }); | |
| 1901 | + th.re_sum_price(); | |
| 1902 | + }) | |
| 1903 | + | |
| 1904 | + } else { | |
| 1905 | + func(); | |
| 1906 | + } | |
| 1907 | + } | |
| 1908 | + }) | |
| 1909 | + }, | |
| 1910 | + | |
| 1911 | + //-- 计算统计之后的金额 -- | |
| 1912 | + re_sum_price: function () { | |
| 1913 | + var all_num = 0; //商品数量之和 | |
| 1914 | + var all_price = 0; | |
| 1915 | + var need_to_buy = 0; | |
| 1916 | + var data = this.data.list; | |
| 1917 | + var all_zhqty = 0; //所有商品要求起购数之后 | |
| 1918 | + var zhqty_bz=[]; //超量 | |
| 1919 | + var no_in_arr = []; | |
| 1920 | + for (var i in data) { | |
| 1921 | + var item = data[i]; | |
| 1922 | + if (item.num) { | |
| 1923 | + all_num += item.num; | |
| 1924 | + all_price += item.num * item.current_price; | |
| 1925 | + //当有起购数的控制的时候 | |
| 1926 | + if (item.zhqty) { | |
| 1927 | + zhqty_bz.push(item); | |
| 1928 | + all_zhqty += item.zhqty; | |
| 1929 | + if (item.num < item.zhqty) { | |
| 1930 | + need_to_buy += item.zhqty - item.num; | |
| 1931 | + } | |
| 1932 | + if (item.num > item.zhqty) { | |
| 1933 | + for (var i = 0; i < item.num - item.zhqty; i++) { | |
| 1934 | + no_in_arr.push({ | |
| 1935 | + price: item.current_price, | |
| 1936 | + goods_id: item.goods_id | |
| 1937 | + }); | |
| 1938 | + } | |
| 1939 | + } | |
| 1940 | + } else { | |
| 1941 | + for (var j = 0; j < item.num; j++) { | |
| 1942 | + no_in_arr.push({ | |
| 1943 | + price: item.current_price, | |
| 1944 | + goods_id: item.goods_id | |
| 1945 | + }); | |
| 1946 | + } | |
| 1947 | + } | |
| 1948 | + } else { | |
| 1949 | + if (item.zhqty) need_to_buy += item.zhqty; | |
| 1950 | + } | |
| 1951 | + } | |
| 1952 | + | |
| 1953 | + //当满足组合的要求:总数要满足,起购数要满足 | |
| 1954 | + if (all_num >= this.data.act.zhbuyqty && !need_to_buy) { | |
| 1955 | + function sortData(a, b) { | |
| 1956 | + return a.price - b.price | |
| 1957 | + } | |
| 1958 | + if (no_in_arr.length) no_in_arr.sort(sortData); | |
| 1959 | + | |
| 1960 | + var aprice = this.data.act.zhprice; | |
| 1961 | + if (this.data.act.zhbuyqty > all_zhqty) { | |
| 1962 | + for (var n = 0; n < this.data.act.zhbuyqty - all_zhqty; n++) { | |
| 1963 | + no_in_arr.pop(); | |
| 1964 | + } | |
| 1965 | + } | |
| 1966 | + | |
| 1967 | + //看一下剩下的数量有没有满足组合购的要求,以及要不要倍增 | |
| 1968 | + if (this.data.act.is_bz && no_in_arr.length >= this.data.act.zhbuyqty) { | |
| 1969 | + let zhqty_map=new map(); | |
| 1970 | + //看一下是几倍 | |
| 1971 | + var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty); | |
| 1972 | + if(this.data.act.is_bzyh && zhqty_bz.length > 0 ){ | |
| 1973 | + for(let i=0;i<zhqty_bz.length;i++){ | |
| 1974 | + let vv=zhqty_bz[i]; | |
| 1975 | + let num=0; | |
| 1976 | + let bz_num=be*vv.zhqty; | |
| 1977 | + for(let j=0;j<no_in_arr.length;j++){ | |
| 1978 | + let ii=no_in_arr[j]; | |
| 1979 | + if(vv.goods_id===ii.goods_id){ | |
| 1980 | + num++; | |
| 1981 | + zhqty_map.set('num',num); | |
| 1982 | + zhqty_map.set('price',ii.price); | |
| 1983 | + } | |
| 1984 | + | |
| 1985 | + } | |
| 1986 | + } | |
| 1987 | + } | |
| 1988 | + if(bz_num <= num){ | |
| 1989 | + aprice += be * aprice; | |
| 1990 | + let pop_num=(be * this.data.act.zhbuyqty)-bz_num; | |
| 1991 | + console.log(pop_num); | |
| 1992 | + for (var m = 0; m < pop_num; m++) { | |
| 1993 | + no_in_arr.pop(); | |
| 1994 | + } | |
| 1995 | + } | |
| 1996 | + // var be = parseInt(no_in_arr.length / this.data.act.zhbuyqty); | |
| 1997 | + // aprice += be * aprice; | |
| 1998 | + // for (var m = 0; m < be * this.data.act.zhbuyqty; m++) { | |
| 1999 | + // no_in_arr.pop(); | |
| 2000 | + // } | |
| 2001 | + } | |
| 2002 | + | |
| 2003 | + //算一下剩余的钱 | |
| 2004 | + if (no_in_arr.length) { | |
| 2005 | + for (var ii in no_in_arr) { | |
| 2006 | + var item = no_in_arr[ii]; | |
| 2007 | + aprice += item.price; | |
| 2008 | + } | |
| 2009 | + } | |
| 2010 | + all_price = aprice; | |
| 2011 | + } | |
| 2012 | + this.data.changing = 0; | |
| 2013 | + this.setData({ | |
| 2014 | + all_price: all_price, | |
| 2015 | + need_to_buy: need_to_buy, | |
| 2016 | + all_num: all_num | |
| 2017 | + }) | |
| 2018 | + | |
| 2019 | + if (all_num <= 0) { | |
| 2020 | + this.data.sele_store = 0; //什么都没有选,就没有选择了门店 | |
| 2021 | + } | |
| 2022 | + | |
| 2023 | + }, | |
| 2024 | + | |
| 2025 | + go_cart: function () { | |
| 2026 | + getApp().goto("/pages/cart/cart/cart"); | |
| 2027 | + }, | |
| 2028 | + | |
| 2029 | + //获取购物车中,相应的门店已购买的商品 | |
| 2030 | + get_cart_val: function (e) { | |
| 2031 | + var th = this; | |
| 2032 | + var user_id = getApp().globalData.user_id; | |
| 2033 | + var req = { | |
| 2034 | + user_id: user_id, | |
| 2035 | + store_id: os.stoid, | |
| 2036 | + pageSize: 600, | |
| 2037 | + state: 0, | |
| 2038 | + prom_type: 7, | |
| 2039 | + prom_id: this.data.act.id | |
| 2040 | + }; | |
| 2041 | + //获取购物车列表 | |
| 2042 | + getApp().request.get("/api/weshop/cart/list", { | |
| 2043 | + data: req, | |
| 2044 | + success: async function (e) { | |
| 2045 | + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length) { | |
| 2046 | + var map = {}; | |
| 2047 | + var mlist = e.data.data.pageData; | |
| 2048 | + th.data.cart_list = mlist; | |
| 2049 | + | |
| 2050 | + for (let i in mlist) { | |
| 2051 | + let item = mlist[i]; | |
| 2052 | + if (item.prom_type != 7) continue; | |
| 2053 | + if (item.prom_id != th.data.act.id) continue; | |
| 2054 | + map[item.goods_id] = item; | |
| 2055 | + } | |
| 2056 | + for (let j in th.data.list) { | |
| 2057 | + let item_j = th.data.list[j]; | |
| 2058 | + item_j.current_price = item_j.shop_price; | |
| 2059 | + | |
| 2060 | + var card_price = 0; | |
| 2061 | + //如果会员有等级价 | |
| 2062 | + if (th.data.card_field) { | |
| 2063 | + card_price = item_j[th.data.card_field]; | |
| 2064 | + if (card_price > 0) { | |
| 2065 | + item_j.current_price = card_price; | |
| 2066 | + } | |
| 2067 | + } | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + if (map[item_j.goods_id]) { | |
| 2071 | + var cart_num = map[item_j.goods_id].goods_num; | |
| 2072 | + item_j.num = cart_num; | |
| 2073 | + item_j.cart_num = cart_num; | |
| 2074 | + item_j.cart_id = map[item_j.goods_id].id; | |
| 2075 | + if (item_j.buyqty > 0) { | |
| 2076 | + var g_buy_num = 0; | |
| 2077 | + var promgoodsbuynum = 0; | |
| 2078 | + //----获取商品购买数---- | |
| 2079 | + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | |
| 2080 | + data: { | |
| 2081 | + store_id: os.stoid, | |
| 2082 | + user_id: user_id, | |
| 2083 | + goods_id: item_j.goods_id, | |
| 2084 | + prom_type: 7, | |
| 2085 | + prom_id: th.data.act.id | |
| 2086 | + }, | |
| 2087 | + }).then(res2 => { | |
| 2088 | + if (res2.data.code == 0) { | |
| 2089 | + var buy_num_data = res2.data.data; | |
| 2090 | + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | |
| 2091 | + g_buy_num = buy_num_data.goodsbuynum; | |
| 2092 | + } | |
| 2093 | + }) | |
| 2094 | + | |
| 2095 | + if (item_j.viplimited > 0) { | |
| 2096 | + var cby = item_j.viplimited - g_buy_num; | |
| 2097 | + if (cby <= 0) continue; //不能买就continue下一个 | |
| 2098 | + item_j.num = cby > item_j.num ? item_j.num : cby; | |
| 2099 | + } | |
| 2100 | + if (item_j.buyqty > 0) { | |
| 2101 | + var cby = item_j.buyqty - promgoodsbuynum; | |
| 2102 | + if (cby <= 0) continue; //不能买就continue下一个 | |
| 2103 | + item_j.num = cby > item_j.num ? item_j.num : cby; | |
| 2104 | + } | |
| 2105 | + } | |
| 2106 | + | |
| 2107 | + item_j.haveAdded = 1; | |
| 2108 | + item_j.showNum = true; | |
| 2109 | + } | |
| 2110 | + } | |
| 2111 | + th.setData({ | |
| 2112 | + list: th.data.list | |
| 2113 | + }); | |
| 2114 | + th.re_sum_price(); | |
| 2115 | + } | |
| 2116 | + } | |
| 2117 | + }); | |
| 2118 | + }, | |
| 2119 | + | |
| 2120 | + //滚动加载跟多的时候的计算 | |
| 2121 | + async calc_more(list, func) { | |
| 2122 | + var th = this; | |
| 2123 | + var map = {}; | |
| 2124 | + var mlist = this.data.cart_list; | |
| 2125 | + for (let i in mlist) { | |
| 2126 | + let item = mlist[i]; | |
| 2127 | + if (item.prom_type != 7) continue; | |
| 2128 | + if (item.prom_id != th.data.act.id) continue; | |
| 2129 | + map[item.goods_id] = item; | |
| 2130 | + } | |
| 2131 | + | |
| 2132 | + for (let j in list) { | |
| 2133 | + let item_j = list[j]; | |
| 2134 | + item_j.current_price = item_j.shop_price; | |
| 2135 | + | |
| 2136 | + var card_price = 0; | |
| 2137 | + //如果会员有等级价 | |
| 2138 | + if (th.data.card_field) { | |
| 2139 | + card_price = item_j[th.data.card_field]; | |
| 2140 | + if (card_price > 0) { | |
| 2141 | + item_j.current_price = card_price; | |
| 2142 | + } | |
| 2143 | + } | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + if (map[item_j.goods_id]) { | |
| 2147 | + var cart_num = map[item_j.goods_id].goods_num; | |
| 2148 | + item_j.num = cart_num; | |
| 2149 | + item_j.cart_num = cart_num; | |
| 2150 | + item_j.cart_id = map[item_j.goods_id].id; | |
| 2151 | + if (item_j.buyqty > 0) { | |
| 2152 | + var g_buy_num = 0; | |
| 2153 | + var promgoodsbuynum = 0; | |
| 2154 | + //----获取商品购买数---- | |
| 2155 | + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | |
| 2156 | + data: { | |
| 2157 | + store_id: os.stoid, | |
| 2158 | + user_id: oo.user_id, | |
| 2159 | + goods_id: item_j.goods_id, | |
| 2160 | + prom_type: 7, | |
| 2161 | + prom_id: th.data.act.id | |
| 2162 | + }, | |
| 2163 | + }).then(res2 => { | |
| 2164 | + if (res2.data.code == 0) { | |
| 2165 | + var buy_num_data = res2.data.data; | |
| 2166 | + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | |
| 2167 | + g_buy_num = buy_num_data.goodsbuynum; | |
| 2168 | + } | |
| 2169 | + }) | |
| 2170 | + | |
| 2171 | + if (item_j.viplimited > 0) { | |
| 2172 | + var cby = item_j.viplimited - g_buy_num; | |
| 2173 | + if (cby <= 0) continue; //不能买就continue下一个 | |
| 2174 | + item_j.num = cby > item_j.num ? item_j.num : cby; | |
| 2175 | + } | |
| 2176 | + if (item_j.buyqty > 0) { | |
| 2177 | + var cby = item_j.buyqty - promgoodsbuynum; | |
| 2178 | + if (cby <= 0) continue; //不能买就continue下一个 | |
| 2179 | + item_j.num = cby > item_j.num ? item_j.num : cby; | |
| 2180 | + } | |
| 2181 | + } | |
| 2182 | + | |
| 2183 | + item_j.haveAdded = 1; | |
| 2184 | + item_j.showNum = true; | |
| 2185 | + } | |
| 2186 | + } | |
| 2187 | + if (func) func(list) | |
| 2188 | + | |
| 2189 | + } | |
| 2190 | + | |
| 2191 | +}) | |
| 0 | 2192 | \ No newline at end of file | ... | ... |
packageB/pages/zuhegou/preindex/index.json
0 → 100644
| 1 | +{ | |
| 2 | + "usingComponents": { | |
| 3 | + "catch": "/packageB//components/catch/catch", | |
| 4 | + "nodata": "/components/nodata/nodata", | |
| 5 | + "painter": "/packageB/components/painter/painter", | |
| 6 | + "warn": "/components/long_warn/long_warn" | |
| 7 | + }, | |
| 8 | + "enablePullDownRefresh": false, | |
| 9 | + "navigationBarTitleText": "组合购" | |
| 10 | +} | |
| 0 | 11 | \ No newline at end of file | ... | ... |
packageB/pages/zuhegou/preindex/index.wxml
0 → 100644
| 1 | +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | |
| 2 | +<view wx:if="{{act}}" class="container"> | |
| 3 | + <view class="flex jc_sb"> | |
| 4 | + <view class="white">以下商品{{act.zhprice}}元任选{{act.zhbuyqty}}件</view> | |
| 5 | + <view class="rule-container" bindtap="showRule">规则详情 | |
| 6 | + <text class="iconfont icon-arrow_right"></text> | |
| 7 | + </view> | |
| 8 | + </view> | |
| 9 | + <view wx:if="{{djs}}" class="countdown-container">距结束还剩 | |
| 10 | + <text wx:if="{{djs.day}}">{{djs.day}}天</text> | |
| 11 | + <text class="num-box">{{djs.hou}}</text> | |
| 12 | + : | |
| 13 | + <text class="num-box">{{djs.min}}</text> | |
| 14 | + : | |
| 15 | + <text class="num-box">{{djs.sec}}</text> | |
| 16 | + </view> | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + <!-- 商品列表 --> | |
| 22 | + <view class="list-container"> | |
| 23 | + <scroll-view class="list" scroll-y bindscrolltolower="get_more_list"> | |
| 24 | + <block wx:for="{{list}}"> | |
| 25 | + <view class="list-item" bindtap="go_url" | |
| 26 | + data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 27 | + <view class="img-container"> | |
| 28 | + <image src="{{iurl}}{{item.original_img?item.original_img:'/miniapp/images/default_g_img.gif'}}" | |
| 29 | + mode="aspectFit" class="img-block"></image> | |
| 30 | + </view> | |
| 31 | + <view class="pdl20 flex f1 fdc jc_sb" > | |
| 32 | + <view> | |
| 33 | + <view class="fs30 ellipsis-2">{{item.goods_name}}</view> | |
| 34 | + <view class="c-fa8b2b fs28" wx:if="{{item.zhqty && (item.num<item.zhqty || !item.num)}}">此商品还需购买{{item.zhqty-(item.num?item.num:0)}}件</view> | |
| 35 | + <view class="num-container" wx:if="{{item.showNum}}"> | |
| 36 | + <text class="num-box {{item.num<=1?'c-dedfe3':''}}" catchtap="sub" | |
| 37 | + data-index="{{index}}">-</text> | |
| 38 | + <text class="num-box">{{item.num}}</text> | |
| 39 | + <text class="num-box" catchtap="add" data-index="{{index}}">+</text> | |
| 40 | + </view> | |
| 41 | + </view> | |
| 42 | + | |
| 43 | + <view class="flex jc_sb ai_end pdt12"> | |
| 44 | + <view> | |
| 45 | + <!-- 要判断实际价格,因为有等级卡价 --> | |
| 46 | + <block wx:if="{{card_field && item[card_field]>0}}"> | |
| 47 | + <text class="rmb fs30 c-red">{{filters.toFix(item[card_field],2)}}</text> | |
| 48 | + </block> | |
| 49 | + <block wx:else> | |
| 50 | + <text class="rmb fs30 c-red">{{filters.toFix(item.shop_price,2)}}</text> | |
| 51 | + </block> | |
| 52 | + <text class="rmb fs20 line-through cb">{{filters.toFix(item.market_price,2)}}</text> | |
| 53 | + </view> | |
| 54 | + | |
| 55 | + </view> | |
| 56 | + </view> | |
| 57 | + </view> | |
| 58 | + </block> | |
| 59 | + | |
| 60 | + <nodata wx:if="{{list.length==0 && is_get}}" nodataContainer="t-c"></nodata> | |
| 61 | + <view wx:if="{{no_more}}" class="noMore">没有更多了</view> | |
| 62 | + </scroll-view> | |
| 63 | + | |
| 64 | + </view> | |
| 65 | + | |
| 66 | + <!-- 底部栏 --> | |
| 67 | + <view class="bar-container"> | |
| 68 | + <block wx:if="{{all_num>=act.zhbuyqty}}"> | |
| 69 | + <view wx:if="{{need_to_buy}}" class="t-c bg-fcfb c-fa8b2b fs28 pd20"> | |
| 70 | + 再买{{need_to_buy}}件,下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】 | |
| 71 | + </view> | |
| 72 | + <view wx:else class="t-c bg-fcfb c-fa8b2b fs28 pd20">下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】</view> | |
| 73 | + </block> | |
| 74 | + <block wx:else> | |
| 75 | + <view wx:if="{{all_num>0}}" class="t-c bg-fcfb c-fa8b2b fs28 pd20"> | |
| 76 | + 再买{{act.zhbuyqty-all_num>need_to_buy?act.zhbuyqty-all_num:need_to_buy}}件,下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】 | |
| 77 | + </view> | |
| 78 | + <view wx:else class="t-c bg-fcfb c-fa8b2b fs28 pd20"> | |
| 79 | + 买{{act.zhbuyqty}}件,下单立享【{{act.zhprice}}元任选{{act.zhbuyqty}}件】 | |
| 80 | + </view> | |
| 81 | + </block> | |
| 82 | + | |
| 83 | + </view> | |
| 84 | + <!-- 分享 --> | |
| 85 | + <view wx:if="{{imgDraw}}" class="share-container" bindtap="share"> | |
| 86 | + <text class="iconfont icon-zhuanfa fs40"></text> | |
| 87 | + <view class="fs22 c-8">分享</view> | |
| 88 | + </view> | |
| 89 | + | |
| 90 | + | |
| 91 | + <!-- 规则详情和提示信息弹窗 --> | |
| 92 | + <view class="rule-pop-container" wx:if="{{showRule}}"> | |
| 93 | + <view class="pop-title">{{!type ? '规则详情':'提示'}} | |
| 94 | + <text class="iconfont icon-guan" bindtap="closeRule"></text> | |
| 95 | + </view> | |
| 96 | + <block wx:if="{{!type}}"> | |
| 97 | + <view class="pdt40"> | |
| 98 | + <view class="pdb20">活动时间</view> | |
| 99 | + <view class="">{{filters.format_time(act.start_time,1)}} 至 {{filters.format_time(act.end_time,1)}} | |
| 100 | + </view> | |
| 101 | + </view> | |
| 102 | + <view class="pdt40"> | |
| 103 | + <view class="pdb20">活动内容</view> | |
| 104 | + <view class=""> | |
| 105 | + <view class="pdb10">{{act.remark}}</view> | |
| 106 | + </view> | |
| 107 | + </view> | |
| 108 | + </block> | |
| 109 | + | |
| 110 | + <!-- 小的提示按钮的展示 --> | |
| 111 | + <block wx:else> | |
| 112 | + <view class="pdt40 pdb20"> | |
| 113 | + <view class="">合计金额及提示仅为初步预估,请以最终下单金额为准。</view> | |
| 114 | + </view> | |
| 115 | + </block> | |
| 116 | + | |
| 117 | + <view class="pdv20"> | |
| 118 | + <view class="btn" bindtap="closeRule">我知道了</view> | |
| 119 | + </view> | |
| 120 | + </view> | |
| 121 | + | |
| 122 | + <!-- 遮罩层 --> | |
| 123 | + <view class="mask" wx:if="{{showMask}}" bindtap="close_all"></view> | |
| 124 | + <!-- 海报 --> | |
| 125 | + <view class="poster-container" wx:if="{{showPoster}}"> | |
| 126 | + <view class="t-r pdb20 white2"> | |
| 127 | + <text class="iconfont icon-close fs40" bindtap="closePoster"></text> | |
| 128 | + </view> | |
| 129 | + <image src="{{myimg}}" class="poster" show-menu-by-longpress></image> | |
| 130 | + <view class="pdt10 fs26 white2"> | |
| 131 | + <text class="iconfont icon-zhiwen"></text> | |
| 132 | + 长按图片保存至相册 | |
| 133 | + </view> | |
| 134 | + </view> | |
| 135 | + | |
| 136 | +</view> | |
| 137 | + | |
| 138 | +<painter style="position: absolute; top: -9999rpx;" palette="{{imgDraw}}" bind:imgOK="onImgOK"/> | |
| 139 | +<!-- 活动异常提醒 --> | |
| 140 | +<catch wx:if="{{error}}">{{error}}</catch> | |
| 141 | +<warn id="warn"></warn> | |
| 142 | +<!-- 选择门店的弹框,1.1版最新的 --> | |
| 143 | +<block wx:if="{{store==1}}"> | |
| 144 | + <view class="mongolia-layer" bindtap="close_popup"></view> | |
| 145 | + <view class="popup-frame"> | |
| 146 | + <block wx:if="{{sort_store==0}}"> | |
| 147 | + <!-- 头部 标题 --> | |
| 148 | + <view class="popup-top flex-space-between"> | |
| 149 | + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text> | |
| 150 | + <view> | |
| 151 | + <view> | |
| 152 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 153 | + </view> | |
| 154 | + <view class="flex choose_more" bindtap="more_store" wx:if="{{is_show_sto_cat>0}}"> | |
| 155 | + <text class="fs26 red-co" style="line-height: 30rpx;height: 30rpx" >{{choice_sort_store==0?'更多门店':'返回'}}</text> | |
| 156 | + <view class="bg_rights" ></view> | |
| 157 | + </view> | |
| 158 | + </view> | |
| 159 | + </view> | |
| 160 | + <!-- 门店列表,最外层的门店列表,一开始 --> | |
| 161 | + <view class="store-list"> | |
| 162 | + <!--如果还没有点击更多门店的时候 --> | |
| 163 | + <block wx:if="{{choice_sort_store==0}}"> | |
| 164 | + <!-- 需要for循环 --> | |
| 165 | + <block wx:if="{{is_show_sto_cat==1}}"> | |
| 166 | + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" | |
| 167 | + data-ind="{{index}}"> | |
| 168 | + <view class="store flex-vertical"> | |
| 169 | + <!-- 需要点击事件 --> | |
| 170 | + <block wx:if="{{index==fir_pick_index}}"> | |
| 171 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 172 | + </block> | |
| 173 | + <block wx:else> | |
| 174 | + <view class="circle xc-hooks"></view> | |
| 175 | + </block> | |
| 176 | + <view class="address-frame xc-ash"> | |
| 177 | + <view class="flex-vertical-between butttem5"> | |
| 178 | + <view class="flex xc-ash"> | |
| 179 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}} | |
| 180 | + <text wx:if="{{item.pickup_id==is_no_pipei}}" class="c-red">(不匹配)</text> | |
| 181 | + </view> | |
| 182 | + </view> | |
| 183 | + <view> | |
| 184 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
| 185 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}} | |
| 186 | + </view> | |
| 187 | + </view> | |
| 188 | + </view> | |
| 189 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 190 | + </view> | |
| 191 | + </view> | |
| 192 | + </view> | |
| 193 | + </block> | |
| 194 | + <block wx:else> | |
| 195 | + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" | |
| 196 | + data-ind="{{index}}"> | |
| 197 | + <view class="store flex-vertical"> | |
| 198 | + <!-- 需要点击事件 --> | |
| 199 | + <block wx:if="{{index==fir_pick_index}}"> | |
| 200 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 201 | + </block> | |
| 202 | + <block wx:else> | |
| 203 | + <view class="circle xc-hooks"></view> | |
| 204 | + </block> | |
| 205 | + | |
| 206 | + <view class="address-frame xc-ash"> | |
| 207 | + <view class="flex-vertical-between "> | |
| 208 | + <view class="flex xc-ash"> | |
| 209 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}} | |
| 210 | + <text wx:if="{{item.pickup_id==is_no_pipei}}" class="c-red">(不匹配)</text> | |
| 211 | + </view> | |
| 212 | + </view> | |
| 213 | + <view> | |
| 214 | + <view class="distance fs24 address-val" | |
| 215 | + wx:if="{{item.distance!=null}}"> | |
| 216 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
| 217 | + </view> | |
| 218 | + </view> | |
| 219 | + </view> | |
| 220 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 221 | + </view> | |
| 222 | + </view> | |
| 223 | + </view> | |
| 224 | + </block> | |
| 225 | + </block> | |
| 226 | + <block wx:else> <!-- 如果是点击选择门店分类后显示分类下的门店 --> | |
| 227 | + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" | |
| 228 | + bindtap="choose_for_store"> | |
| 229 | + <view class="store flex-vertical"> | |
| 230 | + <!-- 需要点击事件 --> | |
| 231 | + <block wx:if="{{index==sec_pick_index}}"> | |
| 232 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 233 | + </block> | |
| 234 | + <block wx:else> | |
| 235 | + <view class="circle xc-hooks"></view> | |
| 236 | + </block> | |
| 237 | + | |
| 238 | + <view class="address-frame xc-ash"> | |
| 239 | + <view class="flex-vertical-between "> | |
| 240 | + <view class="flex xc-ash"> | |
| 241 | + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 242 | + </view> | |
| 243 | + <view> | |
| 244 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
| 245 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
| 246 | + </view> | |
| 247 | + </view> | |
| 248 | + </view> | |
| 249 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 250 | + </view> | |
| 251 | + </view> | |
| 252 | + </view> | |
| 253 | + </block> | |
| 254 | + | |
| 255 | + </view> | |
| 256 | + | |
| 257 | + <!-- 门店列表底部 --> | |
| 258 | + <view class="store-bottom-frame"> | |
| 259 | + <view class="store-bottom flex-vertical-between"> | |
| 260 | + <view class="determine red-b fs28 white t-c" bindtap="sure_pick" | |
| 261 | + data-openindstore="{{open_ind_store}}">确定 | |
| 262 | + </view> | |
| 263 | + <view class="default t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}">设为默认 | |
| 264 | + </view> | |
| 265 | + </view> | |
| 266 | + </view> | |
| 267 | + | |
| 268 | + </block> | |
| 269 | + | |
| 270 | + | |
| 271 | + <block wx:else> | |
| 272 | + <view class="popup-top flex-space-between"> | |
| 273 | + <text class="fs32 nearby_store">门店分类选择</text> | |
| 274 | + <view> | |
| 275 | + <view> | |
| 276 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 277 | + </view> | |
| 278 | + <view class="felx choose_mores" bindtap="returns"> | |
| 279 | + <text class="fs26 red-co">返回</text> | |
| 280 | + </view> | |
| 281 | + </view> | |
| 282 | + </view> | |
| 283 | + <view class="sort_store_list"> | |
| 284 | + | |
| 285 | + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" | |
| 286 | + data-region="{{item.name}}"> | |
| 287 | + <view class="sort-store flex-vertical-between"> | |
| 288 | + <view class="fs30" di>{{item.name}}</view> | |
| 289 | + <view class="black_rights-frame"> | |
| 290 | + <view class="black_rights"></view> | |
| 291 | + </view> | |
| 292 | + </view> | |
| 293 | + </view> | |
| 294 | + | |
| 295 | + </view> | |
| 296 | + </block> | |
| 297 | + </view> | |
| 298 | +</block> | |
| 299 | + | |
| 300 | + | |
| 301 | + | ... | ... |
packageB/pages/zuhegou/preindex/index.wxss
0 → 100644
| 1 | +/* packageB//pages/zuhegou/index/index.wxss */ | |
| 2 | +page { | |
| 3 | + background: #f5f5f5 linear-gradient(to bottom, #FB5A2F, #FA7958, #f5f5f5 26%) no-repeat; | |
| 4 | +} | |
| 5 | +.container { | |
| 6 | + padding: 20rpx; | |
| 7 | +} | |
| 8 | +.countdown-container { | |
| 9 | + font-size: 26rpx; | |
| 10 | + padding-top: 10rpx; | |
| 11 | + color: white; | |
| 12 | +} | |
| 13 | + | |
| 14 | +.num-box { | |
| 15 | + display: inline-block; | |
| 16 | + background-color: rgba(255,255,255,.2); | |
| 17 | + box-sizing: border-box; | |
| 18 | + min-width: 40rpx; | |
| 19 | + padding: 4rpx; | |
| 20 | + margin: 0 8rpx; | |
| 21 | + border-radius: 6rpx; | |
| 22 | + text-align: center; | |
| 23 | +} | |
| 24 | + | |
| 25 | +.rule-container { | |
| 26 | + font-size: 24rpx; | |
| 27 | + background-color: rgba(255,255,255,.2); | |
| 28 | + padding: 10rpx 5rpx 10rpx 20rpx; | |
| 29 | + border-radius: 26rpx 0 0 26rpx; | |
| 30 | + margin-right: -20rpx; | |
| 31 | + color: white; | |
| 32 | +} | |
| 33 | + | |
| 34 | +.icon-arrow_right { | |
| 35 | + font-size: 24rpx; | |
| 36 | +} | |
| 37 | + | |
| 38 | +.list-container { | |
| 39 | + padding-top: 30rpx; | |
| 40 | +} | |
| 41 | + | |
| 42 | +.list { | |
| 43 | + border-radius: 10rpx; | |
| 44 | + background-color: white; | |
| 45 | + max-height:calc(100vh - 360rpx); | |
| 46 | +} | |
| 47 | + | |
| 48 | +.list-item { | |
| 49 | + padding: 20rpx; | |
| 50 | + display: flex; | |
| 51 | +} | |
| 52 | + | |
| 53 | +.img-container { | |
| 54 | + width: 200rpx; | |
| 55 | + height: 200rpx; | |
| 56 | + background-color: #f0f0f0; | |
| 57 | + border-radius: 8rpx; | |
| 58 | +} | |
| 59 | + | |
| 60 | +.num-container { | |
| 61 | + font-size: 28rpx; | |
| 62 | + padding-top: 10rpx; | |
| 63 | + text-align: right; | |
| 64 | +} | |
| 65 | + | |
| 66 | +.num-container .num-box { | |
| 67 | + background-color: #f3f3f3; | |
| 68 | +} | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | +.noMore { | |
| 73 | + padding: 20rpx; | |
| 74 | + color: #bbb; | |
| 75 | + text-align: center; | |
| 76 | + font-size: 26rpx; | |
| 77 | +} | |
| 78 | + | |
| 79 | +.rmb::before { | |
| 80 | + content: '¥'; | |
| 81 | + font-size: 22rpx; | |
| 82 | +} | |
| 83 | + | |
| 84 | +.bar-container { | |
| 85 | + position: fixed; | |
| 86 | + left: 0; | |
| 87 | + bottom: 0; | |
| 88 | + width: 100%; | |
| 89 | + background-color: white; | |
| 90 | +} | |
| 91 | + | |
| 92 | +.bg-fcfb { | |
| 93 | + background-color: #FCFBE5; | |
| 94 | +} | |
| 95 | + | |
| 96 | +.c-fa8b2b { | |
| 97 | + color: #FA8B2B; | |
| 98 | +} | |
| 99 | + | |
| 100 | +.c-8 { | |
| 101 | + color: #888; | |
| 102 | +} | |
| 103 | + | |
| 104 | +.c-dedfe3 { | |
| 105 | + color: #DEDFE3; | |
| 106 | +} | |
| 107 | + | |
| 108 | +.btn-container { | |
| 109 | + padding: 16rpx 40rpx; | |
| 110 | + background-color: red; | |
| 111 | + color: white; | |
| 112 | + font-size: 30rpx; | |
| 113 | + border-radius: 36rpx; | |
| 114 | + background: -webkit-linear-gradient(left,#ff5000,#ff2000) no-repeat; | |
| 115 | +} | |
| 116 | + | |
| 117 | +.share-container { | |
| 118 | + position: fixed; | |
| 119 | + right: 20rpx; | |
| 120 | + bottom: 125rpx; | |
| 121 | + width: 100rpx; | |
| 122 | + height: 100rpx; | |
| 123 | + border-radius: 50%; | |
| 124 | + background-color: white; | |
| 125 | + display: flex; | |
| 126 | + flex-direction: column; | |
| 127 | + justify-content: center; | |
| 128 | + align-items: center; | |
| 129 | + box-shadow: 0 0 16rpx #CCC; | |
| 130 | +} | |
| 131 | + | |
| 132 | +.mask { | |
| 133 | + position: fixed; | |
| 134 | + top: 0; | |
| 135 | + bottom: 0; | |
| 136 | + left: 0; | |
| 137 | + right: 0; | |
| 138 | + background-color: rgba(0,0,0,.6); | |
| 139 | +} | |
| 140 | + | |
| 141 | +.rule-pop-container { | |
| 142 | + position: fixed; | |
| 143 | + left: 0; | |
| 144 | + bottom: 0; | |
| 145 | + width: 100%; | |
| 146 | + background-color: white; | |
| 147 | + z-index: 1; | |
| 148 | + border-radius: 16rpx 16rpx 0 0; | |
| 149 | + padding: 0 40rpx; | |
| 150 | + box-sizing: border-box; | |
| 151 | + font-size: 28rpx; | |
| 152 | + color: #444; | |
| 153 | +} | |
| 154 | + | |
| 155 | +.pop-title { | |
| 156 | + padding: 20rpx 0; | |
| 157 | + text-align: center; | |
| 158 | + font-size: 32rpx; | |
| 159 | + position: relative; | |
| 160 | +} | |
| 161 | +.icon-guan { | |
| 162 | + position: absolute; | |
| 163 | + right: 0; | |
| 164 | + font-size: 26rpx; | |
| 165 | + top: 50%; | |
| 166 | + transform: translateY(-50%); | |
| 167 | + color: #ccc; | |
| 168 | +} | |
| 169 | + | |
| 170 | +.btn { | |
| 171 | + color: white; | |
| 172 | + padding: 20rpx 0; | |
| 173 | + text-align: center; | |
| 174 | + border-radius: 40rpx; | |
| 175 | + background: -webkit-linear-gradient(left,#ff5000,#ff2000) no-repeat; | |
| 176 | +} | |
| 177 | + | |
| 178 | +.active { | |
| 179 | + color: #ccc; | |
| 180 | +} | |
| 181 | + | |
| 182 | +.poster-container { | |
| 183 | + text-align: center; | |
| 184 | + color: white; | |
| 185 | + position: fixed; | |
| 186 | + top: 50%; | |
| 187 | + left: 50%; | |
| 188 | + transform: translate(-50%, -50%); | |
| 189 | +} | |
| 190 | + | |
| 191 | +.poster { | |
| 192 | + width: 650rpx; | |
| 193 | + height: 843rpx; | |
| 194 | + border-radius: 16rpx; | |
| 195 | + margin: 0 auto; | |
| 196 | +} | |
| 197 | + | |
| 198 | +.white2 { | |
| 199 | + color: rgba(255,255,255,.8); | |
| 200 | +} | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | +/* 选择门店的弹窗 */ | |
| 205 | +.mongolia-layer{ | |
| 206 | + position: fixed; | |
| 207 | + left: 0; | |
| 208 | + top: 0; | |
| 209 | + right: 0; | |
| 210 | + bottom: 0; | |
| 211 | + z-index: 11; | |
| 212 | + background: rgba(0,0,0,0.4); | |
| 213 | + width: 100%; | |
| 214 | + height: 91.9%; | |
| 215 | + | |
| 216 | +} | |
| 217 | + | |
| 218 | +.popup-frame{ | |
| 219 | + position: fixed; | |
| 220 | + z-index: 20; | |
| 221 | + background: white; | |
| 222 | + width: 100%; | |
| 223 | + border-radius: 20rpx 20rpx 0 0; | |
| 224 | + height: auto; | |
| 225 | + bottom: 0; | |
| 226 | +} | |
| 227 | +.popup-top{ | |
| 228 | + border-bottom: 1rpx solid #eee; | |
| 229 | + height: 155rpx; | |
| 230 | + width: 95%; | |
| 231 | + margin: auto; | |
| 232 | + line-height: 155rpx; | |
| 233 | + | |
| 234 | +} | |
| 235 | +.bg_rights{ | |
| 236 | + border-top: 2rpx solid ; | |
| 237 | + border-right: 2rpx solid ; | |
| 238 | + transform: rotate(45deg); | |
| 239 | + display:inline-block; | |
| 240 | + width:15rpx;height:15rpx; | |
| 241 | + border-color:#da0b31; | |
| 242 | + position: relative; | |
| 243 | + top:5rpx | |
| 244 | +} | |
| 245 | +.modal-closes { | |
| 246 | + position: absolute; | |
| 247 | + right: 30rpx; | |
| 248 | + top: -15rpx; | |
| 249 | + height: 25rpx; | |
| 250 | + | |
| 251 | +} | |
| 252 | +.choose_more{ | |
| 253 | + margin-top: 100rpx; | |
| 254 | + margin-right: 20rpx; | |
| 255 | + | |
| 256 | +} | |
| 257 | +.choose_mores{ | |
| 258 | + margin-top: 30rpx; | |
| 259 | + margin-right: 15rpx; | |
| 260 | + | |
| 261 | +} | |
| 262 | +.store-list{ | |
| 263 | + width: 95%; | |
| 264 | + min-height: 300rpx; | |
| 265 | + overflow-y: scroll; | |
| 266 | + margin: auto; | |
| 267 | + max-height: 610rpx; | |
| 268 | +} | |
| 269 | +.store-list .store_choose{ | |
| 270 | + width: 100%; | |
| 271 | + height: 120rpx; | |
| 272 | + line-height: 125rpx; | |
| 273 | + border-bottom: 1rpx solid #eee; | |
| 274 | + | |
| 275 | +} | |
| 276 | +.store-list .store_choose .store{ | |
| 277 | + width: 100%; | |
| 278 | + margin: auto; | |
| 279 | + line-height: 37rpx; | |
| 280 | + padding-left: 20rpx; | |
| 281 | + | |
| 282 | +} | |
| 283 | +.xc-hook{ | |
| 284 | + width: 35rpx; | |
| 285 | + height: 35rpx; | |
| 286 | + transform: rotate(-145deg); | |
| 287 | + line-height: 37rpx; | |
| 288 | + text-align: center; | |
| 289 | +} | |
| 290 | +.xc-hooks{ | |
| 291 | + width: 30rpx; | |
| 292 | + height: 30rpx; | |
| 293 | + border: 1rpx solid #999; | |
| 294 | +} | |
| 295 | +.address-frame{ | |
| 296 | + width: 93%; | |
| 297 | + margin-left: 7rpx; | |
| 298 | + | |
| 299 | +} | |
| 300 | +.nearby_store{ | |
| 301 | + margin-left: 17rpx; | |
| 302 | +} | |
| 303 | +.address_name{ | |
| 304 | + margin-right: 10rpx; | |
| 305 | + | |
| 306 | +} | |
| 307 | +.address-val{ | |
| 308 | + height: 38rpx; | |
| 309 | + line-height: 38rpx; | |
| 310 | + | |
| 311 | +} | |
| 312 | +.store-bottom{ | |
| 313 | + width: 85%; | |
| 314 | + margin: auto; | |
| 315 | + height: 90rpx; | |
| 316 | +} | |
| 317 | +.determine{ | |
| 318 | + width: 260rpx; | |
| 319 | + height: 55rpx; | |
| 320 | + border-radius: 50rpx; | |
| 321 | + line-height: 55rpx; | |
| 322 | +} | |
| 323 | +.default{ | |
| 324 | + width: 260rpx; | |
| 325 | + height: 55rpx; | |
| 326 | + border:3rpx solid #c8c8c8; | |
| 327 | + border-radius: 50rpx; | |
| 328 | + line-height: 55rpx; | |
| 329 | +} | |
| 330 | +.store-bottom-frame{ | |
| 331 | + width: 95%; | |
| 332 | + margin: auto; | |
| 333 | + | |
| 334 | +} | |
| 335 | +/* 门店分类列表 */ | |
| 336 | +.sort_store_list{ | |
| 337 | + height: 82%; | |
| 338 | + overflow: hidden; | |
| 339 | + overflow-y: scroll; | |
| 340 | + width: 95%; | |
| 341 | + margin: auto; | |
| 342 | +} | |
| 343 | +.sort_store_list .sort-store-frame{ | |
| 344 | + width: 100%; | |
| 345 | + height: 100rpx; | |
| 346 | + line-height:100rpx; | |
| 347 | + border-bottom: 1rpx solid #eee; | |
| 348 | + | |
| 349 | +} | |
| 350 | +.sort_store_list .sort-store-frame .sort-store{ | |
| 351 | + width: 94.5%; | |
| 352 | + margin: auto; | |
| 353 | +} | |
| 354 | + | |
| 355 | +.c_w{ color: #fff;} | |
| 356 | +.mt10{ margin-top: 10rpx;} | |
| 357 | +.mt20{ margin-top: 20rpx;} | |
| 0 | 358 | \ No newline at end of file | ... | ... |
packageC/pages/presell/list/list.wxml
| ... | ... | @@ -27,13 +27,13 @@ |
| 27 | 27 | |
| 28 | 28 | <view class="kill-list seckill_list"> |
| 29 | 29 | <view class="kill-item" wx:for="{{goodlist}}"> |
| 30 | - <navigator class="kill-pic rel" url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}"> | |
| 30 | + <navigator class="kill-pic rel" url="/packageC/pages/presell/pregoodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}"> | |
| 31 | 31 | <image class="wh100" src="{{url+item.original_img}}" data-val="{{item.original_img}}" |
| 32 | 32 | data-errorimg="goodlist[{{index}}].original_img" binderror="bind_bnerr2" lazy-load="true"></image> |
| 33 | 33 | </navigator> |
| 34 | 34 | <view class="kill-cont"> |
| 35 | 35 | <navigator class="goods-name ellipsis-2" |
| 36 | - url="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}">{{item.goods_name}}</navigator> | |
| 36 | + url="/packageC/pages/presell/pregoodsInfo/goodsInfo?goods_id={{item.goods_id}}&pre_id={{item.id}}">{{item.goods_name}}</navigator> | |
| 37 | 37 | <view class="flex-vertical xc-strip-frame"> |
| 38 | 38 | <view class="xc-strip-blank rel"> |
| 39 | 39 | ... | ... |
packageC/pages/presell/pregoodsInfo/filter.wxs
0 → 100644
| 1 | +var is_has = function (text,val) { | |
| 2 | + if(text.indexOf(","+val+",")==-1) return false; | |
| 3 | + return true | |
| 4 | +} | |
| 5 | +function format_tt(ts) { | |
| 6 | + if(ts==null || ts==undefined || ts=='') return ""; | |
| 7 | + var d = getDate(ts*1000) | |
| 8 | + var fm=(d.getMonth()+1)+"月"+ d.getDate()+"日"; | |
| 9 | + return fm; | |
| 10 | +} | |
| 11 | +module.exports = { | |
| 12 | + is_has: is_has, | |
| 13 | + format_tt:format_tt | |
| 14 | +} | ... | ... |
packageC/pages/presell/pregoodsInfo/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 | + //min_price=min.price; | |
| 78 | + //min_name=min.name; | |
| 79 | + if(type==0) return min_price.toFixed(2); | |
| 80 | + if(min_name.length>4) min_name=min_name.substring(0, 8); | |
| 81 | + return min_name; | |
| 82 | + }, | |
| 83 | + | |
| 84 | + toFix: function (val, count,set) { | |
| 85 | + if(val===undefined) return 0; | |
| 86 | + if(val===null) return 0; | |
| 87 | + if(val==='') return 0; | |
| 88 | + val = parseFloat(val); | |
| 89 | + if(set==1 && val==0) return val; | |
| 90 | + return val.toFixed(count) | |
| 91 | + }, | |
| 92 | + | |
| 93 | + //折扣数值处理,小数位数为1时,只显示1位;小数位数为2时,才显示2位; | |
| 94 | + num: function(value) { | |
| 95 | + if(value != 0) { | |
| 96 | + return parseFloat(value); | |
| 97 | + } else { | |
| 98 | + return value.toFixed(0); | |
| 99 | + }; | |
| 100 | + }, | |
| 101 | + | |
| 102 | + //跳转的接口 | |
| 103 | + get_goods_url:function(item){ | |
| 104 | + | |
| 105 | + console.log(item,111) | |
| 106 | + var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id | |
| 107 | + if(item.prom_type==8){ | |
| 108 | + url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&pre_id="+item.id | |
| 109 | + } | |
| 110 | + return url1; | |
| 111 | + } | |
| 112 | + | |
| 113 | + | |
| 114 | +} | |
| 115 | +module.exports = { | |
| 116 | + is_has_rank:g_filters.is_has_rank, | |
| 117 | + get_card_price:g_filters.get_card_price, | |
| 118 | + num:g_filters.num, | |
| 119 | + get_goods_url:g_filters.get_goods_url, | |
| 120 | +} | |
| 0 | 121 | \ No newline at end of file | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.js
0 → 100644
| 1 | +var ut = require("../../../../utils/util.js"), | |
| 2 | + e = require("../../../../utils/common.js"), | |
| 3 | + a = require("../../../../utils/wxParse/wxParse.js"), | |
| 4 | + s = getApp(), app = s, | |
| 5 | + i = s.request, | |
| 6 | + rq = i, | |
| 7 | + oo = s.globalData, | |
| 8 | + o = s.globalData.setting, | |
| 9 | + os = o; | |
| 10 | +//评价加载更多 | |
| 11 | +var more = function (e) { | |
| 12 | + return e && e.__esModule ? e : { | |
| 13 | + default: e | |
| 14 | + }; | |
| 15 | +}(require("../../../../utils/LoadMore.js")), | |
| 16 | + n = new more.default(); | |
| 17 | +var utils = require('../../../../utils/util.js'); | |
| 18 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | |
| 19 | + | |
| 20 | +Page({ | |
| 21 | + data: { | |
| 22 | + start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始) | |
| 23 | + color_type: 0, //线条控制 | |
| 24 | + color_type_one: 0, | |
| 25 | + color_type_two: 1, | |
| 26 | + | |
| 27 | + gid: '', | |
| 28 | + stoid: o.stoid, | |
| 29 | + url: o.url, | |
| 30 | + resourceUrl: o.h5_url, //公众号那边的图片文件域名 | |
| 31 | + iurl: o.imghost, | |
| 32 | + defaultAvatar: o.resourceUrl + "/static/images/user68.jpg", | |
| 33 | + | |
| 34 | + data: null, | |
| 35 | + content: "", //商品详情 | |
| 36 | + comments: null, //商品评论 | |
| 37 | + c_curr_p: 1, //评论分页 | |
| 38 | + com_num: 0, //评论人数 | |
| 39 | + gallery: null, //图片滚动 | |
| 40 | + is_collect: 0, | |
| 41 | + collect_id: 0, | |
| 42 | + cartGoodsNum: 0, | |
| 43 | + specSelect: 0, | |
| 44 | + optionItemId: 0, | |
| 45 | + goodsInputNum: 1, | |
| 46 | + openSpecModal: !1, | |
| 47 | + openSpecModal_pt: !1, //拼单的弹起, | |
| 48 | + openPromModal: !1, | |
| 49 | + activeCategoryId: 0, | |
| 50 | + supportPageScroll: !1, | |
| 51 | + address: { | |
| 52 | + address: "", | |
| 53 | + district: 0 | |
| 54 | + }, | |
| 55 | + shipping: "", | |
| 56 | + shippingCost: 0, | |
| 57 | + enterAddressPage: !1, | |
| 58 | + categories: [{ | |
| 59 | + name: "商品", | |
| 60 | + id: 0 | |
| 61 | + }, { | |
| 62 | + name: "详情", | |
| 63 | + id: 1 | |
| 64 | + }, { | |
| 65 | + name: "评价", | |
| 66 | + id: 2 | |
| 67 | + }], | |
| 68 | + activeCategoryId2: 0, | |
| 69 | + categories2: [{ | |
| 70 | + name: "商品详情", | |
| 71 | + id: 0 | |
| 72 | + }, { | |
| 73 | + name: "规格参数", | |
| 74 | + id: 1 | |
| 75 | + }], | |
| 76 | + activeCategoryId3: 1, | |
| 77 | + categories3: [{ | |
| 78 | + name: "全部", | |
| 79 | + id: 1, | |
| 80 | + num: 0 | |
| 81 | + }, | |
| 82 | + { | |
| 83 | + name: "有图", | |
| 84 | + id: 5, | |
| 85 | + num: 0 | |
| 86 | + }, | |
| 87 | + | |
| 88 | + { | |
| 89 | + name: "好评", | |
| 90 | + id: 2, | |
| 91 | + num: 0 | |
| 92 | + }, { | |
| 93 | + name: "中评", | |
| 94 | + id: 3, | |
| 95 | + num: 0 | |
| 96 | + }, { | |
| 97 | + name: "差评", | |
| 98 | + id: 4, | |
| 99 | + num: 0 | |
| 100 | + }, | |
| 101 | + ], | |
| 102 | + | |
| 103 | + select: { | |
| 104 | + price: 0, | |
| 105 | + stock: 0, | |
| 106 | + specName: "", | |
| 107 | + activity: null | |
| 108 | + }, | |
| 109 | + | |
| 110 | + //已选的商品(属性) | |
| 111 | + sele_g_spec_name: '', | |
| 112 | + sele_g_id: '', | |
| 113 | + sele_g: null, | |
| 114 | + //门店相关 | |
| 115 | + ismend: 0, | |
| 116 | + is_sec_mend: 0, | |
| 117 | + sto_sele_name: "", //选中的门店名称 | |
| 118 | + sto_sele_id: "", //选中的门店id | |
| 119 | + sto_sele_distr: "", //选择的门店的配送方式 | |
| 120 | + is_show_sto_cat: 1, //是否显示门店分类 | |
| 121 | + only_pk: null, | |
| 122 | + all_sto: null, | |
| 123 | + sec_sto: null, //选择了的门店分类 | |
| 124 | + pickpu_list: null, //读出的所有门店list | |
| 125 | + def_pickpu_list: null, //一开始5个门店list | |
| 126 | + sec_pick_index: 0, //第二级门店选择ID | |
| 127 | + fir_pick_index: 0, //第一级门店选择ID | |
| 128 | + all_pick_list: null,//所有的门店先记录起来 | |
| 129 | + //同一条形码的所有商品 | |
| 130 | + sku_g: null, | |
| 131 | + sku_g_pt: null, //---拼单的普通购买--- | |
| 132 | + //联系电话 | |
| 133 | + mobile: '', | |
| 134 | + //分类,品牌,国别名称 | |
| 135 | + cat_name: '', | |
| 136 | + brand_name: '', | |
| 137 | + nation_name: '', | |
| 138 | + | |
| 139 | + //商品的活动类型 0普通 1秒杀 2团购 3优惠 4 积分购 6拼单 8预售 | |
| 140 | + prom_type: 0, | |
| 141 | + prom_time_text: "", | |
| 142 | + prom_price: null, | |
| 143 | + prom_buy_limit: 0, | |
| 144 | + djs: null, | |
| 145 | + prom_st: 0, | |
| 146 | + prom_r_null: 0, | |
| 147 | + prom_end_time: null, | |
| 148 | + prom_start_time: null, | |
| 149 | + prom_act: null, | |
| 150 | + pd_xx: 0, | |
| 151 | + is_normal: 0, //是否普通购买 | |
| 152 | + teamgroup: null, //有多少人开团 | |
| 153 | + grounp_tatal: 0, //有几个人开团 | |
| 154 | + timer: [], | |
| 155 | + | |
| 156 | + //商品的购买次数 | |
| 157 | + prom_buy_num: -1, | |
| 158 | + g_buy_num: null, | |
| 159 | + prom_goods_num: 0, //活动商品数量 | |
| 160 | + prom_buy_num: 0, //活动商品购买数量 | |
| 161 | + prom_redis_num: 0, //活动商品redis数量 | |
| 162 | + | |
| 163 | + //拼单的规则显示 | |
| 164 | + is_show_gz: 0, | |
| 165 | + //会员自己的购买的拼单商品的情况 | |
| 166 | + user_order_pt_state: 0, | |
| 167 | + //购买的订单 | |
| 168 | + buy_order: null, | |
| 169 | + //1加入购物车 2立即购买 | |
| 170 | + openSpecModal_ind: 0, | |
| 171 | + | |
| 172 | + //---计时器开关---- | |
| 173 | + is_timer: 1, | |
| 174 | + isshow: 0, | |
| 175 | + bconfig: null, //基础配置 | |
| 176 | + | |
| 177 | + fir_comments: null, //详情页上的评价 | |
| 178 | + fir_quan: null, //详情页上的券 | |
| 179 | + quan_list: null, //券列表 | |
| 180 | + | |
| 181 | + coupon: 0, | |
| 182 | + //会员分享的头像 | |
| 183 | + share_head: "", | |
| 184 | + share_goods_img: "", | |
| 185 | + | |
| 186 | + //----------视频图片data参数--------- | |
| 187 | + current: 0, //图片计数 | |
| 188 | + swiperCurrent: 0, //轮播的下标 | |
| 189 | + hiddenn: 0, //控制轮播计数显示 | |
| 190 | + | |
| 191 | + currentTab: 0, // 选择器控制参数 | |
| 192 | + mapurl: "", | |
| 193 | + mapurl_f_img: "", | |
| 194 | + videopicture: 0, //视频图片的控制 | |
| 195 | + | |
| 196 | + video: 0, //视频图片切换器 | |
| 197 | + index: 0, | |
| 198 | + noon: 0, //开始视频的隐藏 | |
| 199 | + | |
| 200 | + screenWidth: 0, | |
| 201 | + canvasHidden: 1, | |
| 202 | + | |
| 203 | + //--推荐-- | |
| 204 | + store_config: null, | |
| 205 | + is_show_pl: 0, //是否品类 | |
| 206 | + is_show_pp: 0, //是否品牌 | |
| 207 | + is_show_gb: 0, //是否国别 | |
| 208 | + is_closecoupon: 0, | |
| 209 | + | |
| 210 | + //是否点赞中 | |
| 211 | + iszaning: 0, | |
| 212 | + select_store: 0, //选择更多 | |
| 213 | + index: 1, | |
| 214 | + more_store: 0, //选择门店 | |
| 215 | + sort_store: 0, //门店分类 | |
| 216 | + choice_sort_store: 0, //选择分类门店 | |
| 217 | + new_user: 0, //新用户 | |
| 218 | + | |
| 219 | + def_pick_store: null, // 默认的门店 | |
| 220 | + fir_def_store: null, //客户默认的门店的 | |
| 221 | + lat: null, //维度 | |
| 222 | + lon: null, //经度 | |
| 223 | + | |
| 224 | + is_get_local_ok: 0, //获取坐标是否完成 | |
| 225 | + region_name: "门店分类", //区域的名字 | |
| 226 | + is_gps: 1, | |
| 227 | + open_ind_store: 0, //哪里打开的门店列表的控制属性 | |
| 228 | + default_store: {}, //创建添加默认门店地址的对象 | |
| 229 | + | |
| 230 | + comments_no_more: 0, | |
| 231 | + get_c: 0, //获取评价是不是成 | |
| 232 | + is_collect_load: 0, //是不是处理 | |
| 233 | + is_newsales_rules: 0, //是否开启最新的门店规则,此时会新读门店,当点击选择门店时会触发读取线下库存 | |
| 234 | + sales_rules: 1, //默认是线上销售 | |
| 235 | + | |
| 236 | + wait_for_user_store: null, | |
| 237 | + prom_goods: null, //商品优惠列表 | |
| 238 | + order_prom: null, //订单优惠 | |
| 239 | + collocationGoods: null, //搭配购 | |
| 240 | + | |
| 241 | + poster: null, //自定义海报 | |
| 242 | + share_b_img: '', //自定义分享的背景 | |
| 243 | + | |
| 244 | + showPoster: false, | |
| 245 | + hui_condition: null, | |
| 246 | + sto_sele_name_1: '',//分享的门店名称 | |
| 247 | + fir_goods: null, | |
| 248 | + | |
| 249 | + share_hidden: false, | |
| 250 | + pre_arr: null, | |
| 251 | + }, | |
| 252 | + | |
| 253 | + //------初始化加载---------- | |
| 254 | + onLoad: function (t) { | |
| 255 | + var ee = this, that = ee, th = ee, | |
| 256 | + pre_id = t.pre_id, | |
| 257 | + gid = t.goods_id, | |
| 258 | + presell_id = t.prom_id, | |
| 259 | + first_leader = t.first_leader, | |
| 260 | + room_id = t.room_id, | |
| 261 | + room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id | |
| 262 | + | |
| 263 | + //-- 自定义海报 -- | |
| 264 | + getApp().request.promiseGet("/api/weshop/goods/poster/page", { | |
| 265 | + data: { store_id: os.stoid, type: 1, is_use: 1 } | |
| 266 | + }).then(res => { | |
| 267 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]) { | |
| 268 | + | |
| 269 | + var poster_data = res.data.data.pageData[0]; | |
| 270 | + var json_str = poster_data.jsonStr; | |
| 271 | + | |
| 272 | + if (json_str) { | |
| 273 | + var json_data = JSON.parse(json_str); | |
| 274 | + if (json_data.bg_img) { | |
| 275 | + | |
| 276 | + //-- 把图片那到本地 -- | |
| 277 | + wx.getImageInfo({ | |
| 278 | + src: json_data.bg_img, | |
| 279 | + success: function (res) { | |
| 280 | + var path = res.path; | |
| 281 | + th.setData({ share_b_img: path }) | |
| 282 | + }, | |
| 283 | + fail: function (res) { } | |
| 284 | + }); | |
| 285 | + } | |
| 286 | + th.setData({ poster: json_data }) | |
| 287 | + | |
| 288 | + } | |
| 289 | + } | |
| 290 | + }) | |
| 291 | + | |
| 292 | + //---获取手机地址坐标-- | |
| 293 | + //--如果tg_id是空的话,分享回来-- | |
| 294 | + if (gid == undefined || gid == null || gid == "") { | |
| 295 | + var gid_str = decodeURIComponent(t.scene); | |
| 296 | + gid_str = gid_str.split("_"); | |
| 297 | + gid = gid_str[0]; | |
| 298 | + if (gid_str.length > 1) { | |
| 299 | + pre_id = gid_str[1]; | |
| 300 | + first_leader = gid_str[2]; | |
| 301 | + } | |
| 302 | + //-- 如果有room_id的获取 -- | |
| 303 | + if (gid_str.length > 2 && gid_str[3]) { | |
| 304 | + room_id = gid_str[2]; | |
| 305 | + room_user_share = 1; | |
| 306 | + } | |
| 307 | + } | |
| 308 | + | |
| 309 | + this.setData({ | |
| 310 | + gid:gid,pre_id:pre_id,presell_id:presell_id | |
| 311 | + }) | |
| 312 | + | |
| 313 | + if (first_leader) { | |
| 314 | + console.log("log---".first_leader); | |
| 315 | + getApp().globalData.first_leader = first_leader; | |
| 316 | + //调用接口判断是不是会员 | |
| 317 | + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { | |
| 318 | + if (res.data.code == 0) { | |
| 319 | + getApp().globalData.guide_id = res.data.data.id; | |
| 320 | + } | |
| 321 | + }) | |
| 322 | + } | |
| 323 | + | |
| 324 | + //-- 如果有房间号 -- | |
| 325 | + if (room_id) { | |
| 326 | + getApp().globalData.room_id = room_id; | |
| 327 | + getApp().globalData.room_goods_id = gid; | |
| 328 | + //如果是会员分享过来的要记录 | |
| 329 | + if (room_user_share) | |
| 330 | + getApp().globalData.room_user_share = room_user_share; | |
| 331 | + } | |
| 332 | + | |
| 333 | + var c_guide_id = t.c_guide_id; | |
| 334 | + if (c_guide_id) { | |
| 335 | + th.data.c_guide_id = c_guide_id; | |
| 336 | + } | |
| 337 | + | |
| 338 | + getApp().getConfig(function (e) { | |
| 339 | + ee.setData({ sto_sele_name_1: e.store_name }) | |
| 340 | + }) | |
| 341 | + | |
| 342 | + //----获取系统参数----- | |
| 343 | + getApp().getConfig2(function (e) { | |
| 344 | + ee.setData({ | |
| 345 | + bconfig: e, | |
| 346 | + sales_rules: e.sales_rules, | |
| 347 | + }); | |
| 348 | + | |
| 349 | + if (e.categoryset.indexOf("," + 1 + ",") != -1) { | |
| 350 | + ee.setData({ | |
| 351 | + is_show_pl: 1 | |
| 352 | + }); | |
| 353 | + } | |
| 354 | + if (e.categoryset.indexOf("," + 3 + ",") != -1) { | |
| 355 | + ee.setData({ | |
| 356 | + is_show_pp: 1 | |
| 357 | + }); | |
| 358 | + } | |
| 359 | + if (e.categoryset.indexOf("," + 2 + ",") != -1) { | |
| 360 | + ee.setData({ | |
| 361 | + is_show_gb: 1 | |
| 362 | + }); | |
| 363 | + } | |
| 364 | + | |
| 365 | + var json_d = JSON.parse(e.switch_list); | |
| 366 | + ee.setData({ | |
| 367 | + store_config: e, | |
| 368 | + sys_switch: json_d, | |
| 369 | + is_closecoupon: json_d.is_closecoupon, | |
| 370 | + is_newsales_rules: json_d.is_newsales_rules | |
| 371 | + }); | |
| 372 | + ee.init(gid); | |
| 373 | + //------几人评价------- | |
| 374 | + //n.init(th, "", "comments"); | |
| 375 | + | |
| 376 | + th.requestCardNum(), wx.pageScrollTo && th.setData({ | |
| 377 | + supportPageScroll: !0 | |
| 378 | + }); | |
| 379 | + | |
| 380 | + //计算等级价相关 | |
| 381 | + var swithc_list = e.switch_list; | |
| 382 | + var sw_arr = JSON.parse(swithc_list); | |
| 383 | + //---如果后台又开等级卡的开关--- | |
| 384 | + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") { | |
| 385 | + th.setData({ rank_switch: true }); | |
| 386 | + //---回调卡的列表--- | |
| 387 | + th.getPlusCardType(function (ob) { | |
| 388 | + th.setData({ card_list: ob.card_list }); | |
| 389 | + var ti = setInterval(function () { | |
| 390 | + var user = getApp().globalData.userInfo; | |
| 391 | + if (!user) return false; | |
| 392 | + clearInterval(ti); | |
| 393 | + | |
| 394 | + if (user.card_field && user['card_expiredate']) { | |
| 395 | + var str = user['card_expiredate'].replace(/-/g, '/'); | |
| 396 | + var end = new Date(str); | |
| 397 | + end = Date.parse(end) / 1000; | |
| 398 | + var now = ut.gettimestamp(); | |
| 399 | + //--- 判断是等级会员,且在有效期范围内 --- | |
| 400 | + if (user.card_field && now < end) { | |
| 401 | + var card_name = ob.name_map.get(user.card_field); | |
| 402 | + //if(card_name.length>6) card_name=card_name.substring(0,6); | |
| 403 | + | |
| 404 | + var is_near_date = 0; | |
| 405 | + if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天 | |
| 406 | + th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date }); | |
| 407 | + } | |
| 408 | + } | |
| 409 | + }, 500) | |
| 410 | + }) | |
| 411 | + } | |
| 412 | + | |
| 413 | + }, 1); | |
| 414 | + | |
| 415 | + //获取用户设备信息,屏幕宽度 | |
| 416 | + wx.getSystemInfo({ | |
| 417 | + success: res => { | |
| 418 | + that.setData({ | |
| 419 | + screenWidth: res.screenWidth | |
| 420 | + }) | |
| 421 | + } | |
| 422 | + }); | |
| 423 | + //更新点击量 | |
| 424 | + getApp().request.put("/api/weshop/goods/updateClick", { | |
| 425 | + data: { store_id: os.stoid, goods_id: gid } | |
| 426 | + }) | |
| 427 | + }, | |
| 428 | + | |
| 429 | + | |
| 430 | + //--- 设置一下默认库存的数量 ---- | |
| 431 | + set_def_storage(ee) { | |
| 432 | + var that = this, th = this; | |
| 433 | + that.data.fir_def_store = ee; | |
| 434 | + that.setData({ | |
| 435 | + def_pick_store: ee, | |
| 436 | + sto_sele_name: ee.pickup_name, | |
| 437 | + sto_sele_id: ee.pickup_id, | |
| 438 | + sto_sele_distr: ee.distr_type | |
| 439 | + }) | |
| 440 | + }, | |
| 441 | + | |
| 442 | + | |
| 443 | + //------------程序初始化入口------------- | |
| 444 | + async init(gid) { | |
| 445 | + var ee = this, | |
| 446 | + th = ee, | |
| 447 | + gallery = null, | |
| 448 | + is_collect = 0, | |
| 449 | + collect_id = 0, | |
| 450 | + categories3 = ee.data.categories3, | |
| 451 | + fir_com = null, | |
| 452 | + fir_quan = null, | |
| 453 | + mapurl = null, | |
| 454 | + mapurl_f_img = null; | |
| 455 | + | |
| 456 | + this.get_sto(); | |
| 457 | + //------图片滚动---------- | |
| 458 | + await getApp().request.promiseGet("/api/weshop/goodsimages/page", { | |
| 459 | + data: { | |
| 460 | + store_id: os.stoid, | |
| 461 | + goods_id: gid, | |
| 462 | + }, | |
| 463 | + }).then(res => { | |
| 464 | + | |
| 465 | + var t = res; | |
| 466 | + var g = t.data.data.pageData; | |
| 467 | + if (g.length == 0) { | |
| 468 | + var ie = { | |
| 469 | + "image_url": o.imghost + "/public/images/default_goods_image_240.gif" | |
| 470 | + }; | |
| 471 | + g.push(ie); | |
| 472 | + gallery = g; | |
| 473 | + return; | |
| 474 | + } | |
| 475 | + for (var i = 0; i < g.length; i++) { | |
| 476 | + if (g[i].image_url.indexOf(o.imghost) == -1) | |
| 477 | + g[i].image_url = o.imghost + g[i].image_url; | |
| 478 | + } | |
| 479 | + gallery = g; | |
| 480 | + }) | |
| 481 | + //------是否收藏---------- | |
| 482 | + await getApp().request.promiseGet("/api/weshop/goodscollect/page", { | |
| 483 | + data: { | |
| 484 | + store_id: os.stoid, | |
| 485 | + goods_id: gid, | |
| 486 | + user_id: oo.user_id, | |
| 487 | + } | |
| 488 | + }).then(res => { | |
| 489 | + var t = res; | |
| 490 | + var data = t.data.data.pageData; | |
| 491 | + if (data.length > 0) { | |
| 492 | + //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, }); | |
| 493 | + is_collect = 1; | |
| 494 | + collect_id = data[0].collect_id; | |
| 495 | + } | |
| 496 | + }) | |
| 497 | + | |
| 498 | + //------获取评价的统计数量---- | |
| 499 | + await getApp().request.promiseGet("/api/weshop/comment/countlist/", { | |
| 500 | + data: { | |
| 501 | + store_id: os.stoid, | |
| 502 | + goods_id: gid | |
| 503 | + }, | |
| 504 | + //failRollback: !0, | |
| 505 | + | |
| 506 | + }).then(res => { | |
| 507 | + console.log(res); | |
| 508 | + var t = res; | |
| 509 | + var g = t.data.data[0]; | |
| 510 | + if (g != null && g != undefined) { | |
| 511 | + var allnum = g.c0 + g.c1 + g.c2 + g.c3 + g.c4 + g.c5; | |
| 512 | + var num2 = g.c4 + g.c5; | |
| 513 | + var num3 = g.c3; | |
| 514 | + var num4 = g.c0 + g.c1 + g.c2; | |
| 515 | + | |
| 516 | + var dd = ee.data.categories3; | |
| 517 | + dd[0].num = allnum; | |
| 518 | + dd[1].num = g.cimg; | |
| 519 | + dd[2].num = num2; | |
| 520 | + dd[3].num = num3; | |
| 521 | + dd[4].num = num4; | |
| 522 | + | |
| 523 | + categories3 = dd; | |
| 524 | + } | |
| 525 | + }) | |
| 526 | + | |
| 527 | + //----获取详情页的评价---- | |
| 528 | + await getApp().request.promiseGet("/api/weshop/comment/pageComment", { | |
| 529 | + data: { | |
| 530 | + store_id: os.stoid, | |
| 531 | + goods_id: gid, | |
| 532 | + pageSize: 3, | |
| 533 | + parent_id: 0, | |
| 534 | + page: 1, | |
| 535 | + is_show: 1, | |
| 536 | + }, | |
| 537 | + }).then(res => { | |
| 538 | + console.log(res); | |
| 539 | + fir_com = res.data.data.pageData; | |
| 540 | + }) | |
| 541 | + | |
| 542 | + if (fir_com) { | |
| 543 | + for (var ind in fir_com) { | |
| 544 | + if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png"; | |
| 545 | + if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img); | |
| 546 | + if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img); | |
| 547 | + } | |
| 548 | + } | |
| 549 | + | |
| 550 | + if (th.data.is_closecoupon != 1) { | |
| 551 | + //----获取详情页的券的数量---- | |
| 552 | + await getApp().request.promiseGet("/api/weshop/prom/coupon/pageCouponList", { | |
| 553 | + data: { | |
| 554 | + store_id: os.stoid, | |
| 555 | + type: 1, | |
| 556 | + pageSize: 3, | |
| 557 | + page: 1, | |
| 558 | + is_share: 0, | |
| 559 | + }, | |
| 560 | + }).then(res1 => { | |
| 561 | + fir_quan = res1.data.data.pageData; | |
| 562 | + }) | |
| 563 | + } | |
| 564 | + | |
| 565 | + //--------获取视频图片--------- | |
| 566 | + await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { | |
| 567 | + 1: 1 | |
| 568 | + }).then(res1 => { | |
| 569 | + if (res1.data.code == 0) { | |
| 570 | + mapurl = res1.data.data.video_url; | |
| 571 | + mapurl_f_img = res1.data.data.video_img; | |
| 572 | + } | |
| 573 | + }) | |
| 574 | + | |
| 575 | + ee.setData({ | |
| 576 | + gallery: gallery, | |
| 577 | + is_collect: is_collect, | |
| 578 | + collect_id: collect_id, | |
| 579 | + categories3: categories3, | |
| 580 | + fir_quan: fir_quan, | |
| 581 | + fir_comments: fir_com, | |
| 582 | + mapurl_f_img: mapurl_f_img, | |
| 583 | + mapurl: mapurl, | |
| 584 | + }); | |
| 585 | + | |
| 586 | + }, | |
| 587 | + | |
| 588 | + //---展示--- | |
| 589 | + onShow: function () { | |
| 590 | + var goods_list = null, th = this, that = this; | |
| 591 | + | |
| 592 | + //-- 如果是预览图片,页面不重新更新 -- | |
| 593 | + var show_prew_img = this.data.show_prew_img | |
| 594 | + if (show_prew_img) { | |
| 595 | + this.data.show_prew_img = 0; return false; | |
| 596 | + } | |
| 597 | + | |
| 598 | + /*-- | |
| 599 | + //优惠券要实时更新 | |
| 600 | + getApp().getConfig2(function (e) { | |
| 601 | + var json_d = JSON.parse(e.switch_list); | |
| 602 | + th.setData({ is_closecoupon: json_d.is_closecoupon }) | |
| 603 | + th.setData({ is_open_offline: json_d.is_pricing_open }) | |
| 604 | + }, 1)--*/ | |
| 605 | + clearInterval(ui); | |
| 606 | + var ui = setInterval(function () { | |
| 607 | + goods_list = th.selectComponent("#goods_list"); | |
| 608 | + if (goods_list) { | |
| 609 | + clearInterval(ui); | |
| 610 | + goods_list.init(); | |
| 611 | + return false | |
| 612 | + } | |
| 613 | + }, 300) | |
| 614 | + | |
| 615 | + this.data.is_timer = 1; | |
| 616 | + var ee = this, gid = this.data.gid, i = getApp().request; | |
| 617 | + | |
| 618 | + this.wait_for_store_config(); | |
| 619 | + this.get_pre_prom(function () { | |
| 620 | + i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, { | |
| 621 | + failRollback: !0, | |
| 622 | + success: function (t) { | |
| 623 | + | |
| 624 | + if (t.data.code == 0) { | |
| 625 | + if (t.data.data.is_on_sale != 1) { | |
| 626 | + wx.showModal({ | |
| 627 | + title: '商品已经下架', | |
| 628 | + showCancel: !1, | |
| 629 | + complete: function () { | |
| 630 | + wx.navigateBack(); | |
| 631 | + } | |
| 632 | + }); | |
| 633 | + } | |
| 634 | + var timestamp = Date.parse(new Date()); | |
| 635 | + timestamp = timestamp / 1000; | |
| 636 | + if (t.data.data.on_time > timestamp) { | |
| 637 | + wx.showModal({ | |
| 638 | + title: '商品还未上架', | |
| 639 | + showCancel: !1, | |
| 640 | + complete: function () { | |
| 641 | + wx.navigateBack(); | |
| 642 | + } | |
| 643 | + }); | |
| 644 | + } | |
| 645 | + | |
| 646 | + if (t.data.data.down_time > 0) { | |
| 647 | + if (t.data.data.down_time < timestamp) { | |
| 648 | + wx.showModal({ | |
| 649 | + title: '商品已经到期下架', | |
| 650 | + showCancel: !1, | |
| 651 | + complete: function () { | |
| 652 | + wx.navigateBack(); | |
| 653 | + } | |
| 654 | + }); | |
| 655 | + } | |
| 656 | + } | |
| 657 | + //动态获取商品名称 | |
| 658 | + wx.setNavigationBarTitle({ | |
| 659 | + title: t.data.data.goods_name, | |
| 660 | + }); | |
| 661 | + | |
| 662 | + //-- 把商品的赋值 -- | |
| 663 | + ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); | |
| 664 | + ee.data.sele_g_id=t.data.data.goods_id; | |
| 665 | + ee.data.sele_g=t.data.data; | |
| 666 | + | |
| 667 | + //获取用户的默认门店 | |
| 668 | + getApp().get_user_store(function (e) { | |
| 669 | + if (!e) { | |
| 670 | + th.data.fir_def_store = {}; //赋值空对象 | |
| 671 | + return false; | |
| 672 | + } | |
| 673 | + var ee = JSON.parse(JSON.stringify(e)); | |
| 674 | + | |
| 675 | + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type; | |
| 676 | + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对-- | |
| 677 | + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) { | |
| 678 | + ee.is_no_dis = 1; | |
| 679 | + } | |
| 680 | + | |
| 681 | + var appd = getApp().globalData; | |
| 682 | + var w_time = setInterval(function () { | |
| 683 | + if (that.data.is_get_local_ok == 0) return false; | |
| 684 | + clearInterval(w_time); | |
| 685 | + var e = JSON.parse(JSON.stringify(ee)); | |
| 686 | + | |
| 687 | + //如果有开启近距离的话,同时距离优不一样了 | |
| 688 | + if (that.data.lat != null) { | |
| 689 | + //如果经纬度有变化的话 | |
| 690 | + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) { | |
| 691 | + that.set_def_storage(e); | |
| 692 | + | |
| 693 | + } else { | |
| 694 | + //要用接口是获取距离,js的计算不准 | |
| 695 | + getApp().request.promiseGet("/api/weshop/pickup/list", { | |
| 696 | + data: { | |
| 697 | + store_id: os.stoid, | |
| 698 | + pickup_id: e.pickup_id, | |
| 699 | + is_pos: 1, | |
| 700 | + lat: th.data.lat, | |
| 701 | + lon: th.data.lon | |
| 702 | + }, | |
| 703 | + }).then(res => { | |
| 704 | + if (res.data.code == 0) { | |
| 705 | + e = res.data.data.pageData[0]; | |
| 706 | + if (e) { | |
| 707 | + e.is_no_dis = ee.is_no_dis; | |
| 708 | + appd.pk_store = e; | |
| 709 | + that.set_def_storage(e); | |
| 710 | + } | |
| 711 | + | |
| 712 | + } | |
| 713 | + }) | |
| 714 | + } | |
| 715 | + appd.lat = that.data.lat; | |
| 716 | + appd.lon = that.data.lon; | |
| 717 | + | |
| 718 | + } else { | |
| 719 | + if (e) { | |
| 720 | + e.distance = null; | |
| 721 | + that.set_def_storage(e); | |
| 722 | + } | |
| 723 | + } | |
| 724 | + }, 500) | |
| 725 | + }); | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss'); | |
| 730 | + | |
| 731 | + var cur_price = t.data.data.shop_price; | |
| 732 | + if (getApp().globalData.userInfo && getApp().globalData.userInfo.card_field) { | |
| 733 | + var cfile = getApp().globalData.userInfo.card_field; | |
| 734 | + if (t.data.data[cfile]) { | |
| 735 | + cur_price = t.data.data[cfile]; | |
| 736 | + } | |
| 737 | + } | |
| 738 | + var txt = (cur_price / t.data.data.market_price * 10).toFixed(2).toString(); | |
| 739 | + txt = parseFloat(txt); | |
| 740 | + | |
| 741 | + t.data.data['disc'] = txt; | |
| 742 | + if (t.data.data.original_img.indexOf(o.imghost) == -1) | |
| 743 | + t.data.data.original_img = o.imghost + t.data.data.original_img; | |
| 744 | + | |
| 745 | + if (t.data.data.goods_content == null) t.data.data.goods_content = ""; | |
| 746 | + | |
| 747 | + //-----商品详情--- | |
| 748 | + if (!t.data.data.goods_content) t.data.data.goods_content = " "; | |
| 749 | + a.wxParse("content", "html", t.data.data.goods_content, ee, 6); | |
| 750 | + e.wxParseAddFullImageUrl(ee, "content"); | |
| 751 | + | |
| 752 | + ee.setData({ | |
| 753 | + data: t.data.data, | |
| 754 | + sele_g: t.data.data, | |
| 755 | + userInfo: getApp().globalData.userInfo, | |
| 756 | + }); | |
| 757 | + | |
| 758 | + //获取门店 | |
| 759 | + ee.get_sto(); | |
| 760 | + ee.get_sku(o.stoid, t.data.data, gid); | |
| 761 | + | |
| 762 | + ee.data.g_buy_num = new Map(); | |
| 763 | + | |
| 764 | + if (ee.data.cat_name == '') { | |
| 765 | + //过去国别,分类,品牌的名称 | |
| 766 | + i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, { | |
| 767 | + success: function (t) { | |
| 768 | + var dd = t.data.data; | |
| 769 | + if (t.data.code == 0) { | |
| 770 | + th.setData({ | |
| 771 | + cat_name: dd.name | |
| 772 | + }); | |
| 773 | + } | |
| 774 | + } | |
| 775 | + }); | |
| 776 | + //过去国别,分类,品牌的名称 | |
| 777 | + i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, { | |
| 778 | + success: function (t) { | |
| 779 | + var dd = t.data.data; | |
| 780 | + if (t.data.code == 0) { | |
| 781 | + th.setData({ | |
| 782 | + brand_name: dd.name | |
| 783 | + }); | |
| 784 | + } | |
| 785 | + } | |
| 786 | + }); | |
| 787 | + //过去国别,分类,品牌的名称 | |
| 788 | + i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, { | |
| 789 | + success: function (t) { | |
| 790 | + var dd = t.data.data; | |
| 791 | + if (t.data.code == 0) { | |
| 792 | + th.setData({ | |
| 793 | + nation_name: dd.name | |
| 794 | + }); | |
| 795 | + } | |
| 796 | + } | |
| 797 | + }); | |
| 798 | + } | |
| 799 | + | |
| 800 | + } | |
| 801 | + else { | |
| 802 | + wx.showModal({ | |
| 803 | + title: t.data.msg, | |
| 804 | + showCancel: !1, | |
| 805 | + complete: function () { | |
| 806 | + wx.navigateBack(); | |
| 807 | + } | |
| 808 | + }); | |
| 809 | + } | |
| 810 | + } | |
| 811 | + }); | |
| 812 | + ee.data.enterAddressPage && (this.data.enterAddressPage = !1); | |
| 813 | + }) | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + }, | |
| 818 | + enterAddress: function () { | |
| 819 | + this.data.enterAddressPage = !0, wx.navigateTo({ | |
| 820 | + url: "/pages/user/address_list/address_list?operate=selectAddress" | |
| 821 | + }); | |
| 822 | + }, | |
| 823 | + onUnload: function () { | |
| 824 | + for (var i = 1; i < 100; i++) { | |
| 825 | + clearInterval(i); | |
| 826 | + } | |
| 827 | + }, | |
| 828 | + onHide: function () { | |
| 829 | + this.data.is_timer = 0; | |
| 830 | + for (var i = 1; i < 100; i++) { | |
| 831 | + clearInterval(i); | |
| 832 | + } | |
| 833 | + }, | |
| 834 | + //----------三个选项按钮----------- | |
| 835 | + tabClick: function (t) { | |
| 836 | + var e = t.currentTarget.id; | |
| 837 | + this.setData({ | |
| 838 | + activeCategoryId: e | |
| 839 | + }), 1 == e ? this.tabGoodsContent() : 2 == e && this.tabComment(); | |
| 840 | + }, | |
| 841 | + tabClick2: function (t) { | |
| 842 | + this.setData({ | |
| 843 | + activeCategoryId2: t.currentTarget.id | |
| 844 | + }); | |
| 845 | + }, | |
| 846 | + | |
| 847 | + tabClick3: function (t) { | |
| 848 | + var e = this; | |
| 849 | + if (t.currentTarget.id != this.data.activeCategoryId3) { | |
| 850 | + e.data.c_curr_p = 1; | |
| 851 | + this.setData({ | |
| 852 | + activeCategoryId3: t.currentTarget.id, | |
| 853 | + comments: null, comments_no_more: 0, get_c: 0, | |
| 854 | + }); | |
| 855 | + this.requestComments_new(); | |
| 856 | + } | |
| 857 | + }, | |
| 858 | + | |
| 859 | + doScrollTop: function () { | |
| 860 | + wx.pageScrollTo({ | |
| 861 | + scrollTop: 0 | |
| 862 | + }); | |
| 863 | + }, | |
| 864 | + | |
| 865 | + tabComment: function () { | |
| 866 | + this.setData({ | |
| 867 | + activeCategoryId: 2, comments_no_more: 0, get_c: 0 | |
| 868 | + }), this.data.comments || this.requestComments_new(); | |
| 869 | + }, | |
| 870 | + | |
| 871 | + //商品详情的时候调用 | |
| 872 | + tabGoodsContent: function () { | |
| 873 | + var th = this, | |
| 874 | + i = getApp().request; | |
| 875 | + this.setData({ | |
| 876 | + activeCategoryId: 1 | |
| 877 | + }); | |
| 878 | + | |
| 879 | + if (th.data.cat_name == '') { | |
| 880 | + //过去国别,分类,品牌的名称 | |
| 881 | + i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, { | |
| 882 | + success: function (t) { | |
| 883 | + var dd = t.data.data; | |
| 884 | + if (t.data.code == 0) { | |
| 885 | + th.setData({ | |
| 886 | + cat_name: dd.name | |
| 887 | + }); | |
| 888 | + } | |
| 889 | + } | |
| 890 | + }); | |
| 891 | + //过去国别,分类,品牌的名称 | |
| 892 | + i.get("/api/weshop/brand/get/" + o.stoid + "/" + th.data.data.brand_id, { | |
| 893 | + success: function (t) { | |
| 894 | + var dd = t.data.data; | |
| 895 | + if (t.data.code == 0) { | |
| 896 | + th.setData({ | |
| 897 | + brand_name: dd.name | |
| 898 | + }); | |
| 899 | + } | |
| 900 | + } | |
| 901 | + }); | |
| 902 | + //过去国别,分类,品牌的名称 | |
| 903 | + i.get("/api/weshop/nation/get/" + o.stoid + "/" + th.data.data.nation_id, { | |
| 904 | + success: function (t) { | |
| 905 | + var dd = t.data.data; | |
| 906 | + if (t.data.code == 0) { | |
| 907 | + th.setData({ | |
| 908 | + nation_name: dd.name | |
| 909 | + }); | |
| 910 | + } | |
| 911 | + } | |
| 912 | + }); | |
| 913 | + } | |
| 914 | + }, | |
| 915 | + | |
| 916 | + //获取redis中的数量 | |
| 917 | + async getactLen(func) { | |
| 918 | + var r_num = 0, | |
| 919 | + prom_type = this.data.prom_type, | |
| 920 | + prom_id = this.data.prom_id; | |
| 921 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { | |
| 922 | + 1: 1 | |
| 923 | + }).then(res => { | |
| 924 | + var em = res; | |
| 925 | + if (em.data.code == 0) { | |
| 926 | + r_num = em.data.data; | |
| 927 | + } | |
| 928 | + }) | |
| 929 | + func(r_num); | |
| 930 | + }, | |
| 931 | + | |
| 932 | + //------------加入购物车-------------- | |
| 933 | + addCart: function (t) { | |
| 934 | + var th = this; | |
| 935 | + var ind = t.currentTarget.dataset.openSpecModal_ind; | |
| 936 | + if (!ind) ind = t.currentTarget.dataset.openspecmodal_ind; | |
| 937 | + th.setData({ | |
| 938 | + open_ind_store: ind | |
| 939 | + }); | |
| 940 | + | |
| 941 | + th.add_cart_func(t); | |
| 942 | + | |
| 943 | + }, | |
| 944 | + | |
| 945 | + | |
| 946 | + //-- 加入购物的函数 -- | |
| 947 | + add_cart_func: function (t) { | |
| 948 | + var i = getApp().request; | |
| 949 | + if (oo.user_id == null) { | |
| 950 | + return s.my_warnning("还未登录!", 0, this); | |
| 951 | + } | |
| 952 | + | |
| 953 | + if (!getApp().globalData.userInfo) { | |
| 954 | + return s.my_warnning("还未登录!", 0, this); | |
| 955 | + } | |
| 956 | + | |
| 957 | + var e = this, th = e, o = this.data.sele_g, a = o.goods_id; | |
| 958 | + //----------添加到购物车时,要判断限购数量,-------- | |
| 959 | + e.get_buy_num(o, function (ee) { | |
| 960 | + //---判断商品是否超出限购--- | |
| 961 | + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
| 962 | + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | |
| 963 | + wx.showModal({ | |
| 964 | + title: '提示', | |
| 965 | + content: '超出商品限购' | |
| 966 | + }); | |
| 967 | + return false; | |
| 968 | + } | |
| 969 | + } | |
| 970 | + //---判断商品是否超出活动限购--- | |
| 971 | + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { | |
| 972 | + if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | |
| 973 | + wx.showModal({ | |
| 974 | + title: '提示', | |
| 975 | + content: '超出商品活动限购' | |
| 976 | + }); | |
| 977 | + return false; | |
| 978 | + } | |
| 979 | + } | |
| 980 | + | |
| 981 | + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | |
| 982 | + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) | |
| 983 | + this.setData({ | |
| 984 | + sto_sele_name: "" | |
| 985 | + }); | |
| 986 | + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | |
| 987 | + | |
| 988 | + //--------------此时操作的数据------------ | |
| 989 | + var newd = { | |
| 990 | + goods_id: o.goods_id, | |
| 991 | + goods_num: th.data.goodsInputNum, | |
| 992 | + pick_id: th.data.sto_sele_id, | |
| 993 | + user_id: oo.user_id, | |
| 994 | + store_id: th.data.stoid, | |
| 995 | + goods_price: o.shop_price, | |
| 996 | + member_goods_price: o.shop_price, | |
| 997 | + goods_name: o.goods_name, | |
| 998 | + goods_sn: o.goods_sn, | |
| 999 | + sku: o.sku, | |
| 1000 | + presell_list_id: th.data.presellList.id, | |
| 1001 | + }; | |
| 1002 | + | |
| 1003 | + //---是不是从收藏夹出来的--- | |
| 1004 | + if (th.data.c_guide_id) { | |
| 1005 | + newd['guide_id'] = th.data.c_guide_id; | |
| 1006 | + newd['guide_type'] = 2; | |
| 1007 | + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3; | |
| 1008 | + } else { | |
| 1009 | + if (getApp().globalData.guide_id) { | |
| 1010 | + newd['guide_id'] = getApp().globalData.guide_id; | |
| 1011 | + newd['guide_type'] = 0; | |
| 1012 | + if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1; | |
| 1013 | + } | |
| 1014 | + } | |
| 1015 | + | |
| 1016 | + //让商品带上房间号 | |
| 1017 | + if (th.data.sys_switch.is_skuroom_id == 1) { | |
| 1018 | + if (th.data.data.goods_id == getApp().globalData.room_goods_id) { | |
| 1019 | + newd.room_id = getApp().globalData.room_id; | |
| 1020 | + } | |
| 1021 | + } else { | |
| 1022 | + if (newd.goods_id == getApp().globalData.room_goods_id) newd.room_id = getApp().globalData.room_id; | |
| 1023 | + } | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + //如果有线下取价 | |
| 1027 | + if (o.offline_price) { | |
| 1028 | + newd.offline_price = o.offline_price; | |
| 1029 | + newd.pricing_type = o.pricing_type; | |
| 1030 | + } | |
| 1031 | + | |
| 1032 | + newd.goods_price = th.data.prom_price; | |
| 1033 | + newd.member_goods_price = th.data.prom_price, | |
| 1034 | + newd.prom_type = 8; | |
| 1035 | + newd.prom_id = o.prom_id; | |
| 1036 | + | |
| 1037 | + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
| 1038 | + if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); | |
| 1039 | + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + }) | |
| 1043 | + }, | |
| 1044 | + | |
| 1045 | + //---加入购物车的最后一步--- | |
| 1046 | + add_cart_next(e, t, a, o, newd, CanOutQty) { | |
| 1047 | + var th = this, i = getApp().request; | |
| 1048 | + if ("add" == t.currentTarget.dataset.action) { | |
| 1049 | + | |
| 1050 | + if (th.data.prom_goods) { | |
| 1051 | + newd.prom_type = 3; | |
| 1052 | + newd.prom_id = th.data.prom_goods[0].prom_id; | |
| 1053 | + } | |
| 1054 | + | |
| 1055 | + //----先看会员在购物车中是否加入了该商品----- | |
| 1056 | + i.get("/api/weshop/cart/page", { | |
| 1057 | + data: { | |
| 1058 | + store_id: e.data.stoid, | |
| 1059 | + user_id: oo.user_id, | |
| 1060 | + goods_id: a, | |
| 1061 | + pick_id: e.data.sto_sele_id, | |
| 1062 | + }, | |
| 1063 | + success: function (re) { | |
| 1064 | + | |
| 1065 | + //-------如果购物车中有相关的数据--------- | |
| 1066 | + if (re.data.data.total > 0) { | |
| 1067 | + | |
| 1068 | + var item = re.data.data.pageData[0]; | |
| 1069 | + if (item.goods_num + th.data.goodsInputNum > o.store_count) { | |
| 1070 | + return s.my_warnning("库存不足!", 0, th); | |
| 1071 | + } | |
| 1072 | + | |
| 1073 | + if (item.goods_num + th.data.goodsInputNum >th.data.pre_arr.presell_sumqty-th.data.pre_arr.buy_goodnum) { | |
| 1074 | + return s.my_warnning("库存不足!", 0, th); | |
| 1075 | + } | |
| 1076 | + | |
| 1077 | + var updata = { | |
| 1078 | + id: item.id, | |
| 1079 | + goods_num: e.data.goodsInputNum + item.goods_num, | |
| 1080 | + goods_price: newd.goods_price, | |
| 1081 | + member_goods_price: newd.goods_price, | |
| 1082 | + store_id: th.data.stoid, | |
| 1083 | + }; | |
| 1084 | + | |
| 1085 | + //---是不是从收藏夹出来的--- | |
| 1086 | + if (th.data.c_guide_id) { | |
| 1087 | + updata['guide_id'] = th.data.c_guide_id; | |
| 1088 | + updata['guide_type'] = 3; //加入购物车之后就变成了3 | |
| 1089 | + } else { | |
| 1090 | + if (getApp().globalData.guide_id) { | |
| 1091 | + updata['guide_id'] = getApp().globalData.guide_id; | |
| 1092 | + updata['guide_type'] = 0; | |
| 1093 | + } | |
| 1094 | + } | |
| 1095 | + | |
| 1096 | + i.put("/api/weshop/cart/update", { | |
| 1097 | + data: updata, | |
| 1098 | + success: function (t) { | |
| 1099 | + getApp().my_warnning('加入购物车成功', 1, th, 450); | |
| 1100 | + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; | |
| 1101 | + th.setData({ | |
| 1102 | + cartGoodsNum: c_num | |
| 1103 | + }); | |
| 1104 | + th.closeSpecModal(); | |
| 1105 | + } | |
| 1106 | + }); | |
| 1107 | + } else { | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + i.post("/api/weshop/cart/save", { | |
| 1111 | + data: newd, | |
| 1112 | + success: function (t) { | |
| 1113 | + getApp().my_warnning('加入购物车成功', 1, th, 450); | |
| 1114 | + var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; | |
| 1115 | + th.setData({ | |
| 1116 | + cartGoodsNum: c_num | |
| 1117 | + }); | |
| 1118 | + th.closeSpecModal(); | |
| 1119 | + } | |
| 1120 | + }); | |
| 1121 | + } | |
| 1122 | + } | |
| 1123 | + }) | |
| 1124 | + | |
| 1125 | + } else { | |
| 1126 | + newd['pick_name'] = th.data.sto_sele_name; | |
| 1127 | + newd['pick_dis'] = th.data.sto_sele_distr; | |
| 1128 | + th.buyNow(newd); | |
| 1129 | + } | |
| 1130 | + }, | |
| 1131 | + | |
| 1132 | + //----------立即购买----------- | |
| 1133 | + buyNow: function (e) { | |
| 1134 | + | |
| 1135 | + this.setData({ | |
| 1136 | + openSpecModal: 0, | |
| 1137 | + openSpecModal_inte: 0, | |
| 1138 | + openSpecModal_inte_normal: 0, | |
| 1139 | + openSpecModal_pt: 0, | |
| 1140 | + }) | |
| 1141 | + | |
| 1142 | + app.set_b_now(e); | |
| 1143 | + | |
| 1144 | + //如果是全额付款的话 | |
| 1145 | + if(this.data.presellForm.presell_type==1){ | |
| 1146 | + getApp().goto("/packageC/pages/presell/cart/cart2") | |
| 1147 | + }else{ | |
| 1148 | + getApp().goto("/packageC/pages/presell/cart/cart2_pre"); | |
| 1149 | + } | |
| 1150 | + }, | |
| 1151 | + | |
| 1152 | + //----------增加购买数量----------- | |
| 1153 | + addCartNum: function (t) { | |
| 1154 | + this.checkCartNum(this.data.goodsInputNum + 1); | |
| 1155 | + }, | |
| 1156 | + //----------减少购买数量----------- | |
| 1157 | + subCartNum: function (t) { | |
| 1158 | + this.checkCartNum(this.data.goodsInputNum - 1); | |
| 1159 | + }, | |
| 1160 | + //----------输入框输入购买数量----------- | |
| 1161 | + inputCartNum: function (t) { | |
| 1162 | + this.checkCartNum(Number(t.detail.value)); | |
| 1163 | + }, | |
| 1164 | + | |
| 1165 | + //------检查数量是不是超出限购------ | |
| 1166 | + checkCartNum: function (t) { | |
| 1167 | + var th = this; | |
| 1168 | + this.get_buy_num(this.data.sele_g, async function () { | |
| 1169 | + | |
| 1170 | + //--判断商品是否超出限购-- | |
| 1171 | + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | |
| 1172 | + | |
| 1173 | + var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); | |
| 1174 | + | |
| 1175 | + if (t + gd_buy_num > th.data.sele_g.viplimited) { | |
| 1176 | + wx.showModal({ | |
| 1177 | + title: '超出商品限购', | |
| 1178 | + }); | |
| 1179 | + | |
| 1180 | + var num = th.data.sele_g.viplimited - gd_buy_num; | |
| 1181 | + if (num < 0) num = 0; | |
| 1182 | + th.setData({ goodsInputNum: num }) | |
| 1183 | + return false; | |
| 1184 | + } | |
| 1185 | + } | |
| 1186 | + | |
| 1187 | + //--判断商品是否超出活动限购-- | |
| 1188 | + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { | |
| 1189 | + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { | |
| 1190 | + wx.showModal({ | |
| 1191 | + title: '超出商品活动限购', | |
| 1192 | + }); | |
| 1193 | + | |
| 1194 | + var num = th.data.prom_buy_limit - th.data.prom_buy_num; | |
| 1195 | + if (num < 0) num = 0; | |
| 1196 | + th.setData({ goodsInputNum: num }) | |
| 1197 | + return false; | |
| 1198 | + } | |
| 1199 | + } | |
| 1200 | + | |
| 1201 | + var e = th.data.sele_g.store_count; | |
| 1202 | + var e2=th.data.pre_arr.presell_sumqty-th.data.pre_arr.buy_goodnum; | |
| 1203 | + if(e2<e) e=e2; | |
| 1204 | + | |
| 1205 | + if (!e) e = 0; | |
| 1206 | + //库存不足,不增加 | |
| 1207 | + if (e < t) { | |
| 1208 | + wx.showModal({ title: '库存不足', }); | |
| 1209 | + if (e < 0) e = 0; | |
| 1210 | + th.setData({ goodsInputNum: e }); return false; | |
| 1211 | + } | |
| 1212 | + t > e || 0 == e ? t = e : t < 1 && (t = 1); | |
| 1213 | + th.setData({ goodsInputNum: t }); | |
| 1214 | + //th.is_show_more_buy(); | |
| 1215 | + | |
| 1216 | + }) | |
| 1217 | + }, | |
| 1218 | + | |
| 1219 | + closeSpecModal: function () { | |
| 1220 | + if (this.data.openSpecModal_pt && this.data.is_normal) { | |
| 1221 | + this.get_sto(); | |
| 1222 | + this.setData({ | |
| 1223 | + sele_g: this.data.data, | |
| 1224 | + gid: this.data.data.goods_id | |
| 1225 | + }) | |
| 1226 | + this.sele_spec_chech_activity(); | |
| 1227 | + | |
| 1228 | + } | |
| 1229 | + | |
| 1230 | + this.setData({ | |
| 1231 | + openSpecModal: !1, | |
| 1232 | + openSpecModal_pt: !1 | |
| 1233 | + }); | |
| 1234 | + }, | |
| 1235 | + | |
| 1236 | + openSpecModel: function (t) { | |
| 1237 | + var th = this; | |
| 1238 | + var open_store = t.currentTarget.dataset.ind; | |
| 1239 | + this.setData({ | |
| 1240 | + store: 0, | |
| 1241 | + choice_sort_store: 0, | |
| 1242 | + sort_store: 0, | |
| 1243 | + open_ind_store: open_store, | |
| 1244 | + }) | |
| 1245 | + //--先判断会员状态-- | |
| 1246 | + var user_info = getApp().globalData.userInfo; | |
| 1247 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 1248 | + wx.navigateTo({ | |
| 1249 | + url: '/pages/togoin/togoin', | |
| 1250 | + }) | |
| 1251 | + return false; | |
| 1252 | + } | |
| 1253 | + | |
| 1254 | + var ind = t.currentTarget.dataset.ind; | |
| 1255 | + | |
| 1256 | + //回调。判断是不是优惠促销 | |
| 1257 | + th.check_is_prom_goods(function () { | |
| 1258 | + th.setData({ | |
| 1259 | + openSpecModal: !0, | |
| 1260 | + openSpecModal_ind: ind, | |
| 1261 | + }); | |
| 1262 | + //var is_open=th.data.config | |
| 1263 | + th.get_off_price(); | |
| 1264 | + }) | |
| 1265 | + }, | |
| 1266 | + | |
| 1267 | + //判断是不是优惠促销 | |
| 1268 | + check_is_prom_goods: function (callback) { | |
| 1269 | + if(!this.data.sele_g) return false; | |
| 1270 | + var th = this; | |
| 1271 | + var usr = getApp().globalData.userInfo; | |
| 1272 | + if (this.data.sele_g.prom_type != 0 && this.data.sele_g.prom_type != 3) { | |
| 1273 | + callback(); | |
| 1274 | + } else { | |
| 1275 | + //-- 判断有没有优惠活动 -- | |
| 1276 | + getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + th.data.sele_g.goods_id + "/0", {}).then(res => { | |
| 1277 | + if (res.data.code == 0) { | |
| 1278 | + var r_data = res.data.data; | |
| 1279 | + th.data.prom_goods = r_data.promGoodsLists; | |
| 1280 | + if (!th.data.prom_goods) { | |
| 1281 | + callback(); | |
| 1282 | + return false; | |
| 1283 | + } | |
| 1284 | + | |
| 1285 | + ///api/weshop/order/getWPayOrder?store_id=1&user_id=5682366&prom_id=1&goods_id=1 | |
| 1286 | + getApp().promiseGet("/api/weshop/order/getWPayOrder", { | |
| 1287 | + data: { store_id: os.stoid, user_id: usr.user_id, goods_id: th.data.sele_g.goods_id, prom_id: th.data.prom_goods[0].prom_id } | |
| 1288 | + }).then(res => { | |
| 1289 | + if (res.data.code == 0) { | |
| 1290 | + wx.showToast({ | |
| 1291 | + title: "您已经购买了该商品待支付中", | |
| 1292 | + icon: 'none', | |
| 1293 | + duration: 2000 | |
| 1294 | + }) | |
| 1295 | + setTimeout(function () { | |
| 1296 | + getApp().goto("/pages/user/order_detail/order_detail?order_id=" + res.data.data.order_id,) | |
| 1297 | + }, 1000) | |
| 1298 | + } | |
| 1299 | + //未找到相关记录 | |
| 1300 | + else { | |
| 1301 | + callback(); | |
| 1302 | + } | |
| 1303 | + }) | |
| 1304 | + } | |
| 1305 | + | |
| 1306 | + }) | |
| 1307 | + | |
| 1308 | + } | |
| 1309 | + }, | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + //----获取线下价格------- | |
| 1314 | + get_off_price() { | |
| 1315 | + var th = this; | |
| 1316 | + //没有开启就返回 | |
| 1317 | + if (!th.data.is_open_offline) return false; | |
| 1318 | + //先看下购买的功能有没有到期 | |
| 1319 | + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=6", {}).then(res => { | |
| 1320 | + //未购买 | |
| 1321 | + if (res.data.code != 0 || !res.data.data || !res.data.data.pageData || !res.data.data.pageData.length) { | |
| 1322 | + return false; | |
| 1323 | + } else { | |
| 1324 | + //已经过期 | |
| 1325 | + var item = res.data.data.pageData[0]; | |
| 1326 | + if (item.end_time < ut.gettimestamp()) { | |
| 1327 | + return false; | |
| 1328 | + } | |
| 1329 | + } | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + var cur_goods = this.data.sele_g; | |
| 1333 | + var cur_price = cur_goods.shop_price; | |
| 1334 | + if (th.data.card_field && cur_goods[th.data.card_field] > 0) { | |
| 1335 | + cur_price = cur_goods[th.data.card_field]; | |
| 1336 | + } | |
| 1337 | + | |
| 1338 | + var user_info = getApp().globalData.userInfo; | |
| 1339 | + //获取一下接口,判断是不是有线下接口,必须是普通商品,全局优惠活动也是不行 | |
| 1340 | + if (cur_goods.prom_type == 0 && !this.data.prom_goods) { | |
| 1341 | + cur_goods.offline_price = null; | |
| 1342 | + //如果没有门店,不用计算线下价格 | |
| 1343 | + var def_pick_store = this.data.def_pick_store; | |
| 1344 | + if (!def_pick_store) return false; | |
| 1345 | + getApp().request.get("/api/weshop/goods/listWarePrice", { | |
| 1346 | + data: { | |
| 1347 | + VIPId: encodeURIComponent(user_info.erpvipid), | |
| 1348 | + store_id: os.stoid, | |
| 1349 | + PickupId: def_pick_store.pickup_id, | |
| 1350 | + WareIds: encodeURIComponent(cur_goods.erpwareid) | |
| 1351 | + }, | |
| 1352 | + success: function (res) { | |
| 1353 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
| 1354 | + var datalist = res.data.data; | |
| 1355 | + if (datalist[0].WarePrice < cur_price) { | |
| 1356 | + cur_goods.offline_price = datalist[0].WarePrice; //存储线下活动的价格 | |
| 1357 | + cur_goods.pricing_type = datalist[0].PriceType; //存储线下活动的类型 | |
| 1358 | + } | |
| 1359 | + } | |
| 1360 | + th.setData({ sele_g: cur_goods }); | |
| 1361 | + } | |
| 1362 | + | |
| 1363 | + }) | |
| 1364 | + } | |
| 1365 | + | |
| 1366 | + }) | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + }, | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + //---------点击收藏和不收藏------------ | |
| 1373 | + collectGoods: function () { | |
| 1374 | + var t = this, | |
| 1375 | + i = getApp().request; | |
| 1376 | + var user_id = s.globalData.user_id; | |
| 1377 | + if (user_id == '') { | |
| 1378 | + getApp().getUserFir(function () { }); | |
| 1379 | + getApp().showWarning("未登录"); | |
| 1380 | + return false; | |
| 1381 | + } else { | |
| 1382 | + | |
| 1383 | + if (t.data.is_collect_load) return false; | |
| 1384 | + t.data.is_collect_load = 1; | |
| 1385 | + | |
| 1386 | + if (t.data.is_collect == 1) { //删除收藏 | |
| 1387 | + i.delete("/api/weshop/goodscollect/del/" + o.stoid + "/" + t.data.collect_id, { | |
| 1388 | + success: function (e) { | |
| 1389 | + t.data.is_collect_load = 0; | |
| 1390 | + if (e.data.code == 0) { | |
| 1391 | + t.setData({ | |
| 1392 | + is_collect: 0, | |
| 1393 | + collect_id: 0, | |
| 1394 | + }); | |
| 1395 | + } | |
| 1396 | + } | |
| 1397 | + }); | |
| 1398 | + } else { | |
| 1399 | + var timestamp = Date.parse(new Date()); | |
| 1400 | + timestamp = timestamp / 1000; | |
| 1401 | + var d = { | |
| 1402 | + goods_id: t.data.data.goods_id, | |
| 1403 | + user_id: s.globalData.user_id, | |
| 1404 | + store_id: o.stoid, | |
| 1405 | + add_time: timestamp, | |
| 1406 | + }; | |
| 1407 | + //加入收藏夹就是导购的ID | |
| 1408 | + if (getApp().globalData.guide_id) { | |
| 1409 | + d.guide_id = getApp().globalData.guide_id; | |
| 1410 | + d.guide_type = 2; | |
| 1411 | + } | |
| 1412 | + | |
| 1413 | + i.post("/api/weshop/goodscollect/save", { //添加收藏 | |
| 1414 | + data: d, | |
| 1415 | + success: function (e) { | |
| 1416 | + t.data.is_collect_load = 0; | |
| 1417 | + if (e.data.code == 0) { | |
| 1418 | + t.setData({ | |
| 1419 | + is_collect: 1, | |
| 1420 | + collect_id: e.data.data.collect_id, | |
| 1421 | + }); | |
| 1422 | + } | |
| 1423 | + } | |
| 1424 | + }); | |
| 1425 | + } | |
| 1426 | + } | |
| 1427 | + }, | |
| 1428 | + | |
| 1429 | + //---------联系客服------------ | |
| 1430 | + contactService: function () { | |
| 1431 | + s.getConfig(function (t) { | |
| 1432 | + if (t.store_tel == undefined) { | |
| 1433 | + getApp().request.get("/api/weshop/store/get/" + os.stoid, { | |
| 1434 | + isShowLoading: 1, | |
| 1435 | + data: {}, | |
| 1436 | + success: function (rs) { | |
| 1437 | + getApp().globalData.config = rs.data.data; | |
| 1438 | + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { | |
| 1439 | + getApp().my_warnning("商家未设置电话", 0, th); | |
| 1440 | + return false; | |
| 1441 | + } | |
| 1442 | + s.confirmBox("请联系客服:" + rs.data.data.store_tel); | |
| 1443 | + } | |
| 1444 | + }) | |
| 1445 | + } else { | |
| 1446 | + s.confirmBox("请联系客服:" + t.store_tel); | |
| 1447 | + } | |
| 1448 | + }); | |
| 1449 | + }, | |
| 1450 | + //-------获取购物车数量---------- | |
| 1451 | + requestCardNum: function () { | |
| 1452 | + var t = this; | |
| 1453 | + getApp().request.get("/api/weshop/cart/page", { | |
| 1454 | + data: { | |
| 1455 | + store_id: o.stoid, | |
| 1456 | + user_id: s.globalData.user_id, | |
| 1457 | + state: 0, | |
| 1458 | + is_gift: 0 | |
| 1459 | + }, | |
| 1460 | + success: function (e) { | |
| 1461 | + var num = 0; | |
| 1462 | + for (var i = 0; i < e.data.data.pageData.length; i++) { | |
| 1463 | + num += e.data.data.pageData[i].goods_num; | |
| 1464 | + } | |
| 1465 | + | |
| 1466 | + //-- 读取服务卡的数量 -- | |
| 1467 | + getApp().promiseGet("/api/weshop/cartService/page", { | |
| 1468 | + data: { | |
| 1469 | + store_id: s.globalData.setting.stoid, | |
| 1470 | + user_id: s.globalData.user_id, | |
| 1471 | + } | |
| 1472 | + }).then(res => { | |
| 1473 | + for (var i = 0; i < res.data.data.pageData.length; i++) { | |
| 1474 | + num += res.data.data.pageData[i].goods_num; | |
| 1475 | + } | |
| 1476 | + t.setData({ cartGoodsNum: num }); | |
| 1477 | + }) | |
| 1478 | + } | |
| 1479 | + }); | |
| 1480 | + }, | |
| 1481 | + | |
| 1482 | + previewCommentImgs: function (t) { | |
| 1483 | + var e = this.data.comments[t.currentTarget.dataset.cidx].img; | |
| 1484 | + var b = e.slice() | |
| 1485 | + for (var i in b) { | |
| 1486 | + b[i] = this.data.iurl + e[i]; | |
| 1487 | + } | |
| 1488 | + this.data.show_prew_img = 1; | |
| 1489 | + | |
| 1490 | + wx.previewImage({ | |
| 1491 | + current: b[t.currentTarget.dataset.id], | |
| 1492 | + urls: b | |
| 1493 | + }); | |
| 1494 | + }, | |
| 1495 | + | |
| 1496 | + previewCommentImgs_w: function (t) { | |
| 1497 | + var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img; | |
| 1498 | + var b = e.slice() | |
| 1499 | + for (var i in b) { | |
| 1500 | + b[i] = this.data.iurl + e[i]; | |
| 1501 | + } | |
| 1502 | + this.data.show_prew_img = 1; | |
| 1503 | + wx.previewImage({ | |
| 1504 | + current: b[t.currentTarget.dataset.id], | |
| 1505 | + urls: b | |
| 1506 | + }); | |
| 1507 | + }, | |
| 1508 | + | |
| 1509 | + previewGoodsCommentImgs: function (t) { | |
| 1510 | + var e = this, | |
| 1511 | + a = this.data.data.comment[t.currentTarget.dataset.cidx].img; | |
| 1512 | + a = a.map(function (t) { | |
| 1513 | + return e.data.url + t; | |
| 1514 | + }), wx.previewImage({ | |
| 1515 | + current: a[t.currentTarget.dataset.id], | |
| 1516 | + urls: a | |
| 1517 | + }); | |
| 1518 | + this.data.show_prew_img = 1; | |
| 1519 | + }, | |
| 1520 | + closePromModal: function () { | |
| 1521 | + this.setData({ | |
| 1522 | + openPromModal: !1 | |
| 1523 | + }); | |
| 1524 | + }, | |
| 1525 | + openPromModal: function () { | |
| 1526 | + this.setData({ | |
| 1527 | + openPromModal: !0 | |
| 1528 | + }); | |
| 1529 | + }, | |
| 1530 | + | |
| 1531 | + //--点击分享事件--- | |
| 1532 | + onShareAppMessage: function (t) { | |
| 1533 | + | |
| 1534 | + var th = this; | |
| 1535 | + var price = th.data.pre_arr.presell_price; | |
| 1536 | + var img = th.data.data.original_img; | |
| 1537 | + var title = th.data.presellForm.share_title; | |
| 1538 | + if (!title) title = th.data.prom_act.title; | |
| 1539 | + if (th.data.prom_type == 4) title = th.data.prom_act.name; | |
| 1540 | + | |
| 1541 | + if (th.data.presellForm.share_img) | |
| 1542 | + img = th.data.iurl + th.data.presellForm.share_img; | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + var url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + th.data.gid+"&pre_id="+th.data.pre_arr.id; | |
| 1547 | + if (getApp().globalData.user_id) { | |
| 1548 | + url += "&first_leader=" + getApp().globalData.user_id; | |
| 1549 | + } | |
| 1550 | + | |
| 1551 | + //-- 如果房间分享,且不是会员分享的 -- | |
| 1552 | + if (getApp().globalData.room_id && | |
| 1553 | + th.data.data.goods_id == getApp().globalData.room_goods_id && | |
| 1554 | + !getApp().globalData.room_user_share | |
| 1555 | + ) { | |
| 1556 | + url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; | |
| 1557 | + } | |
| 1558 | + | |
| 1559 | + var ob = { | |
| 1560 | + title: price + "元 " + title, | |
| 1561 | + path: url, | |
| 1562 | + imageUrl: img, | |
| 1563 | + }; | |
| 1564 | + | |
| 1565 | + ob.title += '\n' + th.data.presellForm.share_remark; | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + console.log(ob,888); | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + return ob; | |
| 1572 | + | |
| 1573 | + }, | |
| 1574 | + | |
| 1575 | + //-----图片失败,默认图片----- | |
| 1576 | + bind_bnerr: function (e) { | |
| 1577 | + var _errImg = e.target.dataset.errorimg; | |
| 1578 | + var _errObj = {}; | |
| 1579 | + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif"; | |
| 1580 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 1581 | + }, | |
| 1582 | + | |
| 1583 | + //-----图片失败,默认图片----- | |
| 1584 | + bind_bnerr2: function (e) { | |
| 1585 | + var _errImg = e.target.dataset.errorimg; | |
| 1586 | + var _errObj = {}; | |
| 1587 | + _errObj[_errImg] = this.data.iurl + "/miniapp/images/hui_hear_pic.png" | |
| 1588 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 1589 | + }, | |
| 1590 | + | |
| 1591 | + //----------装载同一活动中的商品---------- | |
| 1592 | + async get_sku(stoid, gd, g_id, is_normal, func) { | |
| 1593 | + var tt = this, arrdata = null; | |
| 1594 | + var now = ut.gettimestamp(); | |
| 1595 | + var rq_data={ | |
| 1596 | + store_id: o.stoid, | |
| 1597 | + sku: gd.sku, | |
| 1598 | + more_spec: gd.more_spec, | |
| 1599 | + isonsale: 1, | |
| 1600 | + is_on_sale: 1, | |
| 1601 | + pageSize: 500, | |
| 1602 | + orderField: 'sort', | |
| 1603 | + prom_type: 8, | |
| 1604 | + }; | |
| 1605 | + | |
| 1606 | + if(tt.data.presellForm && tt.data.presellForm.id){ | |
| 1607 | + rq_data.prom_id=tt.data.presellForm.id; | |
| 1608 | + } | |
| 1609 | + | |
| 1610 | + await getApp().request.promiseGet("/api/weshop/goods/page", { | |
| 1611 | + data: rq_data | |
| 1612 | + }).then(res => { | |
| 1613 | + var e = res; | |
| 1614 | + if (e.data.code == 0) arrdata = e.data.data.pageData; | |
| 1615 | + }) | |
| 1616 | + if (!arrdata) return false; | |
| 1617 | + | |
| 1618 | + var arrsku = new Array(); | |
| 1619 | + var gitem = null; | |
| 1620 | + var gb = 1, gg = ""; | |
| 1621 | + for (var i = 0; i < arrdata.length; i++) { | |
| 1622 | + var goodsinfo = arrdata[i], prom = null; | |
| 1623 | + if (goodsinfo.goods_id != g_id) { | |
| 1624 | + | |
| 1625 | + switch (goodsinfo.prom_type) { | |
| 1626 | + case 1: | |
| 1627 | + await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + goodsinfo.prom_id, { | |
| 1628 | + }).then(res => { | |
| 1629 | + if (res.data.code == 0) prom = res.data.data; | |
| 1630 | + }) | |
| 1631 | + | |
| 1632 | + break; | |
| 1633 | + case 6: | |
| 1634 | + await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, { | |
| 1635 | + }).then(res => { | |
| 1636 | + if (res.data.code == 0) prom = res.data.data; | |
| 1637 | + }) | |
| 1638 | + | |
| 1639 | + break; | |
| 1640 | + case 2: | |
| 1641 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, { | |
| 1642 | + }).then(res => { | |
| 1643 | + if (res.data.code == 0) prom = res.data.data; | |
| 1644 | + }) | |
| 1645 | + break; | |
| 1646 | + case 4: | |
| 1647 | + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, { | |
| 1648 | + }).then(res => { | |
| 1649 | + if (res.data.code == 0) prom = res.data.data; | |
| 1650 | + }) | |
| 1651 | + break | |
| 1652 | + } | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + } | |
| 1656 | + //---如果有活动,不算在一起--- | |
| 1657 | + if (prom) { | |
| 1658 | + if (goodsinfo.prom_type == 1 || goodsinfo.prom_type == 6) { | |
| 1659 | + if (prom.is_end == 0 && prom.end_time > now && prom.start_time < now) continue; | |
| 1660 | + } else { | |
| 1661 | + continue; | |
| 1662 | + } | |
| 1663 | + } | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + var item = arrdata[i], gg = ""; | |
| 1667 | + if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = ""; | |
| 1668 | + if (item.goods_color == "null" || item.goods_color == null) item.goods_color = ""; | |
| 1669 | + | |
| 1670 | + if (item.goods_spec != "" && item.goods_color != "") { | |
| 1671 | + gg = item.goods_spec + "/" + item.goods_color; | |
| 1672 | + } else if (item.goods_spec != "" || item.goods_color != "") { | |
| 1673 | + gg = item.goods_spec + item.goods_color; | |
| 1674 | + } else { | |
| 1675 | + gg = "规格" + gb; | |
| 1676 | + gb++; | |
| 1677 | + } | |
| 1678 | + item.gg = gg; | |
| 1679 | + | |
| 1680 | + if (item.spec_img) | |
| 1681 | + item.original_img = os.imghost + item.spec_img; | |
| 1682 | + else | |
| 1683 | + item.original_img = os.imghost + item.original_img; | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + if (item.goods_id == g_id) { | |
| 1687 | + gitem = item; | |
| 1688 | + } else { | |
| 1689 | + arrsku.push(item); | |
| 1690 | + } | |
| 1691 | + } | |
| 1692 | + //-----------排列在最前面------------- | |
| 1693 | + arrsku.splice(0, 0, gitem); | |
| 1694 | + if (is_normal == 1) { | |
| 1695 | + tt.setData({ | |
| 1696 | + sku_g_pt: arrsku, | |
| 1697 | + sele_g: gitem | |
| 1698 | + }); | |
| 1699 | + func(); | |
| 1700 | + } else { | |
| 1701 | + tt.setData({ | |
| 1702 | + sku_g: arrsku, | |
| 1703 | + sele_g: gitem | |
| 1704 | + }); | |
| 1705 | + } | |
| 1706 | + }, | |
| 1707 | + | |
| 1708 | + //-----------选择属性的按钮事件---------- | |
| 1709 | + sele_spec: function (e) { | |
| 1710 | + var that = this, ee = this, th = this; | |
| 1711 | + var gid = e.currentTarget.dataset.gid; | |
| 1712 | + var nor = e.currentTarget.dataset.nor; | |
| 1713 | + | |
| 1714 | + var sku_g = this.data.sku_g; | |
| 1715 | + if (nor) { | |
| 1716 | + sku_g = this.data.sku_g_pt; | |
| 1717 | + } | |
| 1718 | + | |
| 1719 | + var item = null; | |
| 1720 | + for (var i in sku_g) { | |
| 1721 | + if (sku_g[i].goods_id == gid) { | |
| 1722 | + item = sku_g[i]; | |
| 1723 | + break | |
| 1724 | + } | |
| 1725 | + } | |
| 1726 | + if (item) this.setData({ | |
| 1727 | + sele_g: item, | |
| 1728 | + gid: gid | |
| 1729 | + }); | |
| 1730 | + | |
| 1731 | + //that.check_is_youhui(gid, that.data.is_normal); | |
| 1732 | + this.get_sto(); | |
| 1733 | + | |
| 1734 | + this.sele_spec_chech_activity(); | |
| 1735 | + }, | |
| 1736 | + | |
| 1737 | + //选择了不同的规格的时候要判断是不是有活动正在进行中 | |
| 1738 | + async sele_spec_chech_activity() { | |
| 1739 | + var prom = null, goodsinfo = this.data.sele_g, th = this; | |
| 1740 | + | |
| 1741 | + var all_pre_goods=th.data.all_pre_goods; | |
| 1742 | + if(all_pre_goods){ | |
| 1743 | + var userInfo = getApp().globalData.userInfo; | |
| 1744 | + var pre_data = { store_id: os.stoid, is_end: 0, timetype: 1, isuse: 1, goods_id: th.data.gid }; | |
| 1745 | + if (userInfo) { | |
| 1746 | + pre_data.user_id = userInfo.user_id; | |
| 1747 | + } | |
| 1748 | + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", { | |
| 1749 | + data: pre_data, | |
| 1750 | + }).then(e => { | |
| 1751 | + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { | |
| 1752 | + all_pre_goods=e.data.data.pageData; | |
| 1753 | + th.data.all_pre_goods=e.data.data.pageData; | |
| 1754 | + } | |
| 1755 | + }) | |
| 1756 | + } | |
| 1757 | + | |
| 1758 | + var idx=all_pre_goods.findIndex(function (ele) { | |
| 1759 | + return ele.goods_id==goodsinfo.goods_id; | |
| 1760 | + }) | |
| 1761 | + var pre_arr =all_pre_goods[idx]; | |
| 1762 | + th.setData({ pre_arr: pre_arr }) | |
| 1763 | + th.data.prom_buy_limit=pre_arr.vip_butyqty; | |
| 1764 | + }, | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + //---------拿出门店分类和门店------------ | |
| 1768 | + get_sto(e) { | |
| 1769 | + var th = this, is_normal = e; | |
| 1770 | + | |
| 1771 | + if (e == 1) { | |
| 1772 | + th.setData({ is_normal: 1 }) | |
| 1773 | + } else { | |
| 1774 | + th.setData({ is_normal: 0 }) | |
| 1775 | + } | |
| 1776 | + | |
| 1777 | + var timer_get = setInterval(function () { | |
| 1778 | + if (th.data.is_get_local_ok == 0) return false; | |
| 1779 | + var dd = null, i = getApp().request; | |
| 1780 | + if (!th.data.sele_g) return false; | |
| 1781 | + | |
| 1782 | + var g_distr_type = th.data.sele_g.distr_type; | |
| 1783 | + if (g_distr_type != 0) { | |
| 1784 | + dd = { | |
| 1785 | + store_id: o.stoid, | |
| 1786 | + distr_type: g_distr_type, | |
| 1787 | + isstop: 0, | |
| 1788 | + is_pos: 1, | |
| 1789 | + pageSize: 2000 | |
| 1790 | + } | |
| 1791 | + } else { | |
| 1792 | + dd = { | |
| 1793 | + store_id: o.stoid, | |
| 1794 | + isstop: 0, | |
| 1795 | + is_pos: 1, | |
| 1796 | + pageSize: 2000 | |
| 1797 | + } | |
| 1798 | + } | |
| 1799 | + //如果有距离的话 | |
| 1800 | + if (th.data.lat != null) { | |
| 1801 | + dd.lat = th.data.lat; | |
| 1802 | + dd.lon = th.data.lon; | |
| 1803 | + } | |
| 1804 | + clearInterval(timer_get); | |
| 1805 | + | |
| 1806 | + //如果会员是有默认的门店话 | |
| 1807 | + if (!th.data.def_pick_store && th.data.fir_def_store) { | |
| 1808 | + th.setData({ def_pick_store: th.data.fir_def_store }); | |
| 1809 | + } | |
| 1810 | + | |
| 1811 | + /*--最新的,不用这里筛选配送方式 | |
| 1812 | + if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){ | |
| 1813 | + th.setData({def_pick_store:null}); | |
| 1814 | + }--*/ | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + wx.showLoading({ | |
| 1818 | + title: '加载中.' | |
| 1819 | + }); | |
| 1820 | + //----------获取门店---------------- | |
| 1821 | + getApp().request.promiseGet("/api/weshop/pickup/list", { | |
| 1822 | + data: dd, | |
| 1823 | + }).then(res => { | |
| 1824 | + var e = res; | |
| 1825 | + | |
| 1826 | + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) { | |
| 1827 | + | |
| 1828 | + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 | |
| 1829 | + if (dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store) == '{}') && th.data.bconfig && th.data.bconfig.is_sort_storage) { | |
| 1830 | + th.setData({ | |
| 1831 | + def_pick_store: e.data.data.pageData[0], | |
| 1832 | + sto_sele_name: e.data.data.pageData[0].pickup_name, | |
| 1833 | + sto_sele_id: e.data.data.pageData[0].pickup_id, | |
| 1834 | + sto_sele_distr: e.data.data.pageData[0].distr_type | |
| 1835 | + }); | |
| 1836 | + th.data.fir_def_store = e.data.data.pageData[0]; | |
| 1837 | + } | |
| 1838 | + | |
| 1839 | + //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 -- | |
| 1840 | + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { | |
| 1841 | + for (var k = 0; k < e.data.data.pageData.length; k++) { | |
| 1842 | + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { | |
| 1843 | + e.data.data.pageData.splice(k, 1); //删除 | |
| 1844 | + break; | |
| 1845 | + } | |
| 1846 | + } | |
| 1847 | + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 | |
| 1848 | + } | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + th.setData({ all_pick_list: e.data.data.pageData }); | |
| 1852 | + | |
| 1853 | + //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购-- | |
| 1854 | + if (th.data.sales_rules == 2 && !th.data.is_newsales_rules && ((th.data.prom_type != 1 && th.data.prom_type != 6 && th.data.prom_type != 4) || is_normal == 1)) { | |
| 1855 | + setTimeout(function () { | |
| 1856 | + th.deal_pickup_dline(e); | |
| 1857 | + }, 800) | |
| 1858 | + } else { | |
| 1859 | + setTimeout(function () { | |
| 1860 | + th.deal_pickup(e); //--普通门店排版-- | |
| 1861 | + }, 800) | |
| 1862 | + } | |
| 1863 | + } | |
| 1864 | + }) | |
| 1865 | + }, 200) | |
| 1866 | + | |
| 1867 | + }, | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + //------------处理门店--------------- | |
| 1871 | + deal_pickup(e) { | |
| 1872 | + var th = this; | |
| 1873 | + if (!th.data.sele_g) return false | |
| 1874 | + | |
| 1875 | + var g_distr_type = th.data.sele_g.distr_type; | |
| 1876 | + wx.hideLoading(); | |
| 1877 | + | |
| 1878 | + //单总量超出5个的时候 | |
| 1879 | + if (e.data.data.total > 5) { | |
| 1880 | + getApp().request.get("/api/weshop/storagecategory/page", { | |
| 1881 | + data: { | |
| 1882 | + store_id: o.stoid, | |
| 1883 | + pageSize: 1000, | |
| 1884 | + orderField: "sort", | |
| 1885 | + orderType: 'asc', | |
| 1886 | + }, | |
| 1887 | + success: function (ee) { | |
| 1888 | + if (ee.data.code == 0) { | |
| 1889 | + | |
| 1890 | + var check_all_cate=0; | |
| 1891 | + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0){ | |
| 1892 | + for(let i in ee.data.data.pageData){ | |
| 1893 | + let item=ee.data.data.pageData[i]; | |
| 1894 | + if(item.is_show==1){ | |
| 1895 | + check_all_cate=1;break | |
| 1896 | + } | |
| 1897 | + } | |
| 1898 | + } | |
| 1899 | + | |
| 1900 | + if (check_all_cate) { | |
| 1901 | + | |
| 1902 | + var sto_cate = ee.data.data.pageData; | |
| 1903 | + var sto_arr = e.data.data.pageData; | |
| 1904 | + var newarr = new Array(); | |
| 1905 | + var qita = new Array(); | |
| 1906 | + | |
| 1907 | + var is_del_pk=0; | |
| 1908 | + //----要进行门店分组-------- | |
| 1909 | + for (var i = 0; i < sto_arr.length; i++) { | |
| 1910 | + //找一下这个门店有没有在分类数组内 | |
| 1911 | + var find2 = 0, find2name = "", sort = 0; | |
| 1912 | + is_del_pk=0; | |
| 1913 | + for (var m = 0; m < sto_cate.length; m++) { | |
| 1914 | + if (sto_arr[i].category_id == sto_cate[m].cat_id) { | |
| 1915 | + if (sto_cate[m].is_show != 1) { | |
| 1916 | + is_del_pk = 1; | |
| 1917 | + sto_arr.splice(i, 1); | |
| 1918 | + i--; | |
| 1919 | + } else { | |
| 1920 | + find2 = sto_cate[m].cat_id; | |
| 1921 | + find2name = sto_cate[m].cat_name; | |
| 1922 | + sort = sto_cate[m].sort; | |
| 1923 | + is_del_pk = 0; | |
| 1924 | + } | |
| 1925 | + break; | |
| 1926 | + } | |
| 1927 | + } | |
| 1928 | + | |
| 1929 | + if(is_del_pk) continue; | |
| 1930 | + | |
| 1931 | + if (newarr.length > 0) { | |
| 1932 | + var find = 0; | |
| 1933 | + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1934 | + if (find2 != 0) { | |
| 1935 | + for (var ii = 0; ii < newarr.length; ii++) { | |
| 1936 | + if (sto_arr[i].category_id == newarr[ii].cat_id) { | |
| 1937 | + newarr[ii].s_arr.push(sto_arr[i]); | |
| 1938 | + find = 1; | |
| 1939 | + break; | |
| 1940 | + } | |
| 1941 | + } | |
| 1942 | + if (find == 0) { | |
| 1943 | + var arr0 = new Array(); | |
| 1944 | + arr0.push(sto_arr[i]); | |
| 1945 | + var item = { | |
| 1946 | + cat_id: find2, | |
| 1947 | + name: find2name, | |
| 1948 | + sort: sort, | |
| 1949 | + s_arr: arr0 | |
| 1950 | + }; | |
| 1951 | + newarr.push(item); | |
| 1952 | + } | |
| 1953 | + } else { | |
| 1954 | + qita.push(sto_arr[i]); | |
| 1955 | + } | |
| 1956 | + } else { | |
| 1957 | + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1958 | + if (find2 != 0) { | |
| 1959 | + var arr0 = new Array(); | |
| 1960 | + arr0.push(sto_arr[i]); | |
| 1961 | + var item = { | |
| 1962 | + cat_id: find2, | |
| 1963 | + name: find2name, | |
| 1964 | + sort: sort, | |
| 1965 | + s_arr: arr0 | |
| 1966 | + }; | |
| 1967 | + newarr.push(item); | |
| 1968 | + } else { | |
| 1969 | + qita.push(sto_arr[i]); | |
| 1970 | + } | |
| 1971 | + } | |
| 1972 | + } | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + var def_arr = new Array(); | |
| 1976 | + //-- 开始就看10个门店 -- | |
| 1977 | + for (var k = 0; k < 10; k++) { | |
| 1978 | + if (k == sto_arr.length) break; | |
| 1979 | + def_arr.push(sto_arr[k]); | |
| 1980 | + } | |
| 1981 | + | |
| 1982 | + th.setData({ | |
| 1983 | + def_pickpu_list: def_arr, | |
| 1984 | + pickpu_list: ee.data.data.pageData | |
| 1985 | + }); | |
| 1986 | + //门店分类要排序下 | |
| 1987 | + function compare(property) { | |
| 1988 | + return function (a, b) { | |
| 1989 | + var value1 = a[property]; | |
| 1990 | + var value2 = b[property]; | |
| 1991 | + return value1 - value2; | |
| 1992 | + } | |
| 1993 | + } | |
| 1994 | + if (newarr.length > 0) | |
| 1995 | + newarr.sort(compare("sort")); | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + //----安排其他的分类----- | |
| 1999 | + if (qita.length > 0) { | |
| 2000 | + var item = { | |
| 2001 | + cat_id: -1, | |
| 2002 | + name: "其他", | |
| 2003 | + s_arr: qita | |
| 2004 | + }; | |
| 2005 | + newarr.push(item); | |
| 2006 | + } | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + var sd={ | |
| 2010 | + all_sto: newarr, | |
| 2011 | + is_show_sto_cat:1 | |
| 2012 | + } | |
| 2013 | + if(!sto_arr || sto_arr.length<=10){ | |
| 2014 | + sd.is_show_sto_cat=-1; | |
| 2015 | + sd.only_pk=sto_arr; | |
| 2016 | + } | |
| 2017 | + th.setData(sd); | |
| 2018 | + | |
| 2019 | + } else { | |
| 2020 | + th.setData({ | |
| 2021 | + is_show_sto_cat: -1, | |
| 2022 | + only_pk: e.data.data.pageData | |
| 2023 | + }); | |
| 2024 | + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | |
| 2025 | + if (!th.data.def_pick_store) { | |
| 2026 | + th.setData({ def_pick_store: e.data.data.pageData[0] }) | |
| 2027 | + } | |
| 2028 | + } | |
| 2029 | + } else { | |
| 2030 | + th.setData({ | |
| 2031 | + is_show_sto_cat: -1, | |
| 2032 | + only_pk: e.data.data.pageData | |
| 2033 | + }); | |
| 2034 | + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ | |
| 2035 | + if (!th.data.def_pick_store) { | |
| 2036 | + th.setData({ def_pick_store: e.data.data.pageData[0] }) | |
| 2037 | + } | |
| 2038 | + | |
| 2039 | + } | |
| 2040 | + } | |
| 2041 | + }); | |
| 2042 | + } else { | |
| 2043 | + th.setData({ | |
| 2044 | + is_show_sto_cat: 0, | |
| 2045 | + only_pk: e.data.data.pageData | |
| 2046 | + }); | |
| 2047 | + //-----如果没有默认门店,要取第一个门店作为默认店------ | |
| 2048 | + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { | |
| 2049 | + th.setData({ | |
| 2050 | + def_pick_store: e.data.data.pageData[0], | |
| 2051 | + sto_sele_name: e.data.data.pageData[0].pickup_name, | |
| 2052 | + sto_sele_id: e.data.data.pageData[0].pickup_id, | |
| 2053 | + sto_sele_distr: e.data.data.pageData[0].distr_type | |
| 2054 | + }) | |
| 2055 | + } | |
| 2056 | + } | |
| 2057 | + }, | |
| 2058 | + | |
| 2059 | + //------------处理线下门店库存-------- | |
| 2060 | + deal_pickup_dline(e) { | |
| 2061 | + var pkno = [], th = this; | |
| 2062 | + if (!th.data.sele_g) return false; | |
| 2063 | + | |
| 2064 | + if (this.data.def_pick_store) { | |
| 2065 | + pkno.push(this.data.def_pick_store.pickup_no); | |
| 2066 | + } | |
| 2067 | + for (var i in e.data.data.pageData) { | |
| 2068 | + var item = e.data.data.pageData[i]; | |
| 2069 | + if (pkno.indexOf(item.pickup_no) < 0) | |
| 2070 | + pkno.push(item.pickup_no); | |
| 2071 | + } | |
| 2072 | + pkno.sort(); | |
| 2073 | + var pkno_str = pkno.join(","); | |
| 2074 | + var o_plist = e.data.data.pageData; | |
| 2075 | + var new_list = []; | |
| 2076 | + var is_find_def_store = 0; | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + var g_distr_type = th.data.sele_g.distr_type; | |
| 2080 | + var lock = []; | |
| 2081 | + //先读取门店的lock,采用链式写法,少用await | |
| 2082 | + getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { | |
| 2083 | + data: { store_id: os.stoid, wareId: th.data.sele_g.goods_id, pageSize: 1000 } | |
| 2084 | + }).then(res => { | |
| 2085 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2086 | + lock = res.data.data.pageData | |
| 2087 | + } | |
| 2088 | + //---通过接口获取门店的线下库存信息-- | |
| 2089 | + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { | |
| 2090 | + data: { storageNos: pkno_str, wareIds: encodeURIComponent(th.data.sele_g.erpwareid), storeId: os.stoid, pageSize: 2000 } | |
| 2091 | + }) | |
| 2092 | + }).then(res => { | |
| 2093 | + | |
| 2094 | + wx.hideLoading(); | |
| 2095 | + if (res.data.code == 0) { | |
| 2096 | + if (res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 2097 | + var plist = res.data.data.pageData; | |
| 2098 | + var def_pick_store = th.data.def_pick_store; | |
| 2099 | + //以原来的数组为外循环,保证距离的顺序 | |
| 2100 | + for (var kk in o_plist) { | |
| 2101 | + for (var ii in plist) { | |
| 2102 | + //线下的门店小心 | |
| 2103 | + var n_item = plist[ii]; | |
| 2104 | + if (n_item.StorageNo == o_plist[kk].pickup_no) { | |
| 2105 | + | |
| 2106 | + //拿到锁库的数量 | |
| 2107 | + var lock_num = th.find_lock_num(o_plist[kk].pickup_id, lock); | |
| 2108 | + //可出库数大于预出库库存的数量,可以判断为有库存 | |
| 2109 | + if (n_item.CanOutQty > lock_num) { | |
| 2110 | + o_plist[kk].CanOutQty = n_item.CanOutQty - lock_num; | |
| 2111 | + new_list.push(o_plist[kk]); | |
| 2112 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
| 2113 | + if (th.data.fir_def_store && n_item.StorageNo == th.data.fir_def_store.pickup_no && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
| 2114 | + th.data.fir_def_store.CanOutQty = n_item.CanOutQty - lock_num; | |
| 2115 | + if (def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) | |
| 2116 | + th.setData({ def_pick_store: th.data.fir_def_store }) | |
| 2117 | + is_find_def_store = 1; | |
| 2118 | + } | |
| 2119 | + } | |
| 2120 | + break; | |
| 2121 | + } | |
| 2122 | + } | |
| 2123 | + } | |
| 2124 | + | |
| 2125 | + //数据组装下 | |
| 2126 | + var em = {}; em.data = {}; em.data.data = {}; | |
| 2127 | + em.data.data.total = new_list.length; | |
| 2128 | + em.data.data.pageData = new_list; | |
| 2129 | + | |
| 2130 | + //--如果找到默认门店,同时也应该判断配送方式对不对-- | |
| 2131 | + if (th.data.fir_def_store && !is_find_def_store && th.data.fir_def_store.pickup_id && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { | |
| 2132 | + th.data.fir_def_store.CanOutQty = 0; | |
| 2133 | + //--当选择的门店是客户默认的门店的时候-- | |
| 2134 | + if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) { | |
| 2135 | + th.setData({ def_pick_store: th.data.fir_def_store }); | |
| 2136 | + em.data.data.pageData.unshift(th.data.def_pick_store); | |
| 2137 | + } else { | |
| 2138 | + em.data.data.pageData.splice(1, 0, th.data.fir_def_store); | |
| 2139 | + } | |
| 2140 | + } | |
| 2141 | + | |
| 2142 | + //---把数组组装进去--- | |
| 2143 | + th.deal_pickup(em); | |
| 2144 | + } else { | |
| 2145 | + th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null }) | |
| 2146 | + } | |
| 2147 | + } else { | |
| 2148 | + th.setData({ def_pick_store: null, all_sto: null, only_pk: null, def_pickpu_list: null }) | |
| 2149 | + } | |
| 2150 | + }) | |
| 2151 | + }, | |
| 2152 | + | |
| 2153 | + find_lock_num(pick_id, lock) { | |
| 2154 | + var lock_num = 0; | |
| 2155 | + if (!lock) return 0; | |
| 2156 | + if (lock.length < 0) return 0; | |
| 2157 | + for (var i in lock) { | |
| 2158 | + if (pick_id == lock[i].pickupId) { | |
| 2159 | + lock_num += lock[i].outQty; | |
| 2160 | + } | |
| 2161 | + } | |
| 2162 | + return lock_num; | |
| 2163 | + }, | |
| 2164 | + | |
| 2165 | + //----------取货门店被点击的效果------ | |
| 2166 | + getmendian: function (t) { | |
| 2167 | + this.setData({ | |
| 2168 | + ismend: 1, | |
| 2169 | + }); | |
| 2170 | + }, | |
| 2171 | + | |
| 2172 | + //----------隐藏取货门店,选取门店---------- | |
| 2173 | + hidemend: function (e) { | |
| 2174 | + var pid = e.target.dataset.p_id; | |
| 2175 | + var pname = e.target.dataset.p_name; | |
| 2176 | + var p_distr_t = e.target.dataset.p_dis; | |
| 2177 | + this.setData({ | |
| 2178 | + ismend: 0, | |
| 2179 | + is_sec_mend: 0, | |
| 2180 | + sto_sele_id: pid, | |
| 2181 | + sto_sele_name: pname, | |
| 2182 | + sto_sele_distr: p_distr_t | |
| 2183 | + }); | |
| 2184 | + }, | |
| 2185 | + | |
| 2186 | + //------显示取货2级---------- | |
| 2187 | + show_sec: function (t) { | |
| 2188 | + var index = t.target.dataset.index; | |
| 2189 | + var item = this.data.all_sto[index]; | |
| 2190 | + this.setData({ | |
| 2191 | + is_sec_mend: 1, | |
| 2192 | + sec_sto: item | |
| 2193 | + }); | |
| 2194 | + }, | |
| 2195 | + | |
| 2196 | + //------隐藏取货门店2级---- | |
| 2197 | + hide_sec_mend: function () { | |
| 2198 | + this.setData({ | |
| 2199 | + is_sec_mend: 0, | |
| 2200 | + }); | |
| 2201 | + }, | |
| 2202 | + | |
| 2203 | + //评论的调用 | |
| 2204 | + requestComments_new: async function () { | |
| 2205 | + var e = this, th = e, ee = e; var tp = e.data.activeCategoryId3; | |
| 2206 | + var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p; | |
| 2207 | + | |
| 2208 | + //wx.showLoading(); | |
| 2209 | + var req_where = { | |
| 2210 | + store_id: o.stoid, pageSize: 5, is_show: 1, | |
| 2211 | + parent_id: 0, goods_id: th.data.gid, commenttype: tp, | |
| 2212 | + } | |
| 2213 | + if (getApp().globalData.userInfo) { | |
| 2214 | + req_where.userId = getApp().globalData.userInfo.user_id; | |
| 2215 | + } | |
| 2216 | + | |
| 2217 | + var rs_data = null; | |
| 2218 | + await getApp().request.promiseGet(t, { data: req_where }).then(res => { | |
| 2219 | + var tot = res.data.data.total; | |
| 2220 | + e.data.c_curr_p++; | |
| 2221 | + e.setData({ | |
| 2222 | + com_num: tot, //已经有加载 | |
| 2223 | + }); | |
| 2224 | + if (res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 2225 | + rs_data = res.data.data.pageData; | |
| 2226 | + } else { | |
| 2227 | + th.setData({ comments_no_more: 1, auto: 1 }); | |
| 2228 | + } | |
| 2229 | + }) | |
| 2230 | + | |
| 2231 | + if (rs_data) { | |
| 2232 | + //var cda = th.data.comments; | |
| 2233 | + var cda = rs_data, com_data = th.data.comments; | |
| 2234 | + for (var ind in cda) { | |
| 2235 | + var ep = cda[ind]; | |
| 2236 | + if (cda[ind].head_pic == '') { | |
| 2237 | + cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png"; | |
| 2238 | + } | |
| 2239 | + if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) { | |
| 2240 | + cda[ind].weapp_img = JSON.parse(ep.weapp_img); | |
| 2241 | + } | |
| 2242 | + if (ep.img != "" && ut.isString(ep.img)) { | |
| 2243 | + cda[ind].img = ut.unserialize(ep.img); | |
| 2244 | + } | |
| 2245 | + | |
| 2246 | + //--测量多有字的宽带,计算有多少行-- | |
| 2247 | + var widh = ut.measureText(ep.content, 30); | |
| 2248 | + var lines = widh / 712; | |
| 2249 | + cda[ind].seeMore = false; | |
| 2250 | + if (lines > 3) cda[ind].seeMore = true; | |
| 2251 | + | |
| 2252 | + await getApp().request.promiseGet("/api/weshop/comment/pageComment", { | |
| 2253 | + data: { store_id: o.stoid, parent_id: ep.comment_id } | |
| 2254 | + }).then(res => { | |
| 2255 | + if (res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 2256 | + cda[ind].replay_list = res.data.data.pageData; | |
| 2257 | + } | |
| 2258 | + }) | |
| 2259 | + } | |
| 2260 | + | |
| 2261 | + if (!com_data) com_data = cda; | |
| 2262 | + else com_data = com_data.concat(cda); | |
| 2263 | + | |
| 2264 | + th.setData({ comments: com_data }); | |
| 2265 | + } | |
| 2266 | + th.setData({ get_c: 1 }); | |
| 2267 | + //wx.hideLoading(); | |
| 2268 | + }, | |
| 2269 | + | |
| 2270 | + //加载更多是靠这个函数 | |
| 2271 | + onReachBottom: function () { | |
| 2272 | + if (this.data.activeCategoryId == 2) { | |
| 2273 | + if (!this.data.comments_no_more) this.requestComments_new(); | |
| 2274 | + } | |
| 2275 | + | |
| 2276 | + var goods_list = this.selectComponent("#goods_list"); //组件的id | |
| 2277 | + if (goods_list) goods_list.get_list(); | |
| 2278 | + }, | |
| 2279 | + | |
| 2280 | + //--获取有多少人在开团-- | |
| 2281 | + async get_team_group(prom_id) { | |
| 2282 | + var teamgroup = [], | |
| 2283 | + th = this, | |
| 2284 | + grounp_tatal = 0; | |
| 2285 | + //如果活动是开团不是商家团 | |
| 2286 | + if (this.data.prom_act.kttype > 1) { | |
| 2287 | + | |
| 2288 | + var req_data = { | |
| 2289 | + store_id: os.stoid, | |
| 2290 | + pageSize: 3, | |
| 2291 | + page: 1, | |
| 2292 | + state: 2, | |
| 2293 | + team_id: prom_id, | |
| 2294 | + ordernum: 1 | |
| 2295 | + }; | |
| 2296 | + | |
| 2297 | + if (this.data.prom_act.kttype == 3 && this.data.prom_act.max_ct_num) { | |
| 2298 | + req_data.max_num = this.data.prom_act.max_ct_num; | |
| 2299 | + } | |
| 2300 | + | |
| 2301 | + //获取活动从表信息team_id | |
| 2302 | + await getApp().request.promiseGet("/api/weshop/teamgroup/page", { | |
| 2303 | + data: req_data | |
| 2304 | + }).then(res => { | |
| 2305 | + teamgroup = res.data.data.pageData; | |
| 2306 | + grounp_tatal = res.data.data.total; | |
| 2307 | + }) | |
| 2308 | + //获取订单的总数这个接口不能用 | |
| 2309 | + for (i = 0; i < teamgroup.length; i++) { | |
| 2310 | + await getApp().request.promiseGet("/api/weshop/order/page", { | |
| 2311 | + data: { | |
| 2312 | + store_id: os.stoid, | |
| 2313 | + pt_status: 1, | |
| 2314 | + pt_listno: teamgroup[i].listno | |
| 2315 | + } | |
| 2316 | + }).then(res => { | |
| 2317 | + var order = res.data.data.pageData; | |
| 2318 | + teamgroup[i].open_num = order.length; | |
| 2319 | + }) | |
| 2320 | + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => { | |
| 2321 | + var user = res.data.data; | |
| 2322 | + teamgroup[i].user = user; | |
| 2323 | + }) | |
| 2324 | + } | |
| 2325 | + | |
| 2326 | + if (teamgroup.length > 0) { | |
| 2327 | + th.setData({ | |
| 2328 | + teamgroup: teamgroup, | |
| 2329 | + grounp_tatal: grounp_tatal | |
| 2330 | + }); | |
| 2331 | + th.countDown2(); | |
| 2332 | + } | |
| 2333 | + } | |
| 2334 | + }, | |
| 2335 | + | |
| 2336 | + //---小于10的格式化函数---- | |
| 2337 | + timeFormat(param) { | |
| 2338 | + return param < 10 ? '0' + param : param; | |
| 2339 | + }, | |
| 2340 | + | |
| 2341 | + //----倒计时函数----- | |
| 2342 | + countDown(time, prom_st) { | |
| 2343 | + if (!this.data.is_timer) return false; | |
| 2344 | + var th = this; | |
| 2345 | + // 获取当前时间,同时得到活动结束时间数组 | |
| 2346 | + var endTime = time; | |
| 2347 | + var newTime = ut.gettimestamp(); | |
| 2348 | + // 对结束时间进行处理渲染到页面 | |
| 2349 | + var obj = null; | |
| 2350 | + // 如果活动未结束,对时间进行处理 | |
| 2351 | + if (endTime - newTime > 0) { | |
| 2352 | + var time = (endTime - newTime); | |
| 2353 | + // 获取天、时、分、秒 | |
| 2354 | + var day = parseInt(time / (60 * 60 * 24)); | |
| 2355 | + var hou = parseInt(time % (60 * 60 * 24) / 3600); | |
| 2356 | + var min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
| 2357 | + var sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
| 2358 | + obj = { | |
| 2359 | + day: this.timeFormat(day), | |
| 2360 | + hou: this.timeFormat(hou), | |
| 2361 | + min: this.timeFormat(min), | |
| 2362 | + sec: this.timeFormat(sec) | |
| 2363 | + } | |
| 2364 | + } else { | |
| 2365 | + | |
| 2366 | + //活动已结束,全部设置为'00' | |
| 2367 | + obj = { | |
| 2368 | + day: '00', | |
| 2369 | + hou: '00', | |
| 2370 | + min: '00', | |
| 2371 | + sec: '00' | |
| 2372 | + } | |
| 2373 | + th.setData({ | |
| 2374 | + prom_time_text: '活动已经结束:', | |
| 2375 | + prom_st: 3 | |
| 2376 | + }) | |
| 2377 | + th.setData({ | |
| 2378 | + djs: obj | |
| 2379 | + }); | |
| 2380 | + return false; | |
| 2381 | + | |
| 2382 | + } | |
| 2383 | + | |
| 2384 | + th.setData({ | |
| 2385 | + djs: obj | |
| 2386 | + }); | |
| 2387 | + setTimeout(function () { | |
| 2388 | + th.countDown(endTime) | |
| 2389 | + }, 1000); | |
| 2390 | + }, | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + //-------------获取购买数量的总函数---------------- | |
| 2394 | + get_buy_num: function (gd, func) { | |
| 2395 | + var map = this.data.g_buy_num, | |
| 2396 | + th = this, | |
| 2397 | + user_id = getApp().globalData.user_id; | |
| 2398 | + if (user_id == null) { | |
| 2399 | + map.set(gd.goods_id, 0); | |
| 2400 | + th.setData({ | |
| 2401 | + g_buy_num: map, | |
| 2402 | + prom_buy_num: 0, | |
| 2403 | + }); | |
| 2404 | + "function" == typeof func && func(); | |
| 2405 | + return false; | |
| 2406 | + } | |
| 2407 | + | |
| 2408 | + if (map.has(gd.goods_id)) { | |
| 2409 | + "function" == typeof func && func(); | |
| 2410 | + } else { | |
| 2411 | + //----获取商品购买数---- | |
| 2412 | + getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { | |
| 2413 | + data: { | |
| 2414 | + store_id: os.stoid, | |
| 2415 | + user_id: user_id, | |
| 2416 | + goods_id: gd.goods_id, | |
| 2417 | + }, | |
| 2418 | + success: function (t) { | |
| 2419 | + if (t.data.code == 0) { | |
| 2420 | + var g_buy_num = t.data.data.goodsbuynum; | |
| 2421 | + map.set(gd.goods_id, g_buy_num); | |
| 2422 | + th.setData({ | |
| 2423 | + g_buy_num: map, | |
| 2424 | + }); | |
| 2425 | + getApp().request.get("/api/weshop/order/orderPresell/countBuyGoodsSum",{ | |
| 2426 | + data: {store_id: os.stoid, user_id: user_id, goods_id: gd.goods_id, prom_id: gd.prom_id}, | |
| 2427 | + success: function (e) { | |
| 2428 | + if (e.data.code == 0) { | |
| 2429 | + th.setData({prom_buy_num: e.data.data.sumgoodsnum}) | |
| 2430 | + "function" == typeof func && func(); | |
| 2431 | + } else { | |
| 2432 | + th.setData({prom_buy_num: 0,}) | |
| 2433 | + "function" == typeof func && func(); | |
| 2434 | + } | |
| 2435 | + | |
| 2436 | + } | |
| 2437 | + }); | |
| 2438 | + | |
| 2439 | + } | |
| 2440 | + } | |
| 2441 | + }); | |
| 2442 | + } | |
| 2443 | + }, | |
| 2444 | + | |
| 2445 | + //--拼单推荐的显示--- | |
| 2446 | + tj_Click: function (e) { | |
| 2447 | + var ind = parseInt(e.target.dataset.ind); | |
| 2448 | + this.setData({ | |
| 2449 | + is_show_gz: ind | |
| 2450 | + }); | |
| 2451 | + }, | |
| 2452 | + | |
| 2453 | + //-------跳转pt商品------- | |
| 2454 | + go_to_nopay: function () { | |
| 2455 | + var th =this,url = "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id; | |
| 2456 | + getApp().goto(url); | |
| 2457 | + | |
| 2458 | + }, | |
| 2459 | + //-------跳转pt teamshow------- | |
| 2460 | + go_to_team_show: function () { | |
| 2461 | + | |
| 2462 | + if (this.data.is_go_to_team_show) return false; | |
| 2463 | + this.data.is_go_to_team_show = 1; | |
| 2464 | + wx.showLoading(); | |
| 2465 | + | |
| 2466 | + var th = this; | |
| 2467 | + var url = "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn; | |
| 2468 | + getApp().goto(url); | |
| 2469 | + | |
| 2470 | + }, | |
| 2471 | + | |
| 2472 | + //---倒计时--- | |
| 2473 | + countDown2() { | |
| 2474 | + if (!this.data.is_timer) return false; | |
| 2475 | + var th = this; | |
| 2476 | + // 获取当前时间,同时得到活动结束时间数组 | |
| 2477 | + var newTime = ut.gettimestamp(); | |
| 2478 | + var List = th.data.teamgroup; | |
| 2479 | + for (var j = 0; j < List.length; j++) { | |
| 2480 | + // 对结束时间进行处理渲染到页面 | |
| 2481 | + var endTime = List[j].kt_end_time; | |
| 2482 | + let obj = null; | |
| 2483 | + // 如果活动未结束,对时间进行处理 | |
| 2484 | + if (endTime - newTime > 0) { | |
| 2485 | + let time = (endTime - newTime); | |
| 2486 | + // 获取天、时、分、秒 | |
| 2487 | + let day = parseInt(time / (60 * 60 * 24)); | |
| 2488 | + let hou = parseInt(time % (60 * 60 * 24) / 3600); | |
| 2489 | + let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); | |
| 2490 | + let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); | |
| 2491 | + obj = { | |
| 2492 | + day: this.timeFormat(day), | |
| 2493 | + hou: this.timeFormat(hou), | |
| 2494 | + min: this.timeFormat(min), | |
| 2495 | + sec: this.timeFormat(sec) | |
| 2496 | + } | |
| 2497 | + } else { | |
| 2498 | + //活动已结束,全部设置为'00' | |
| 2499 | + obj = { | |
| 2500 | + day: '00', | |
| 2501 | + hou: '00', | |
| 2502 | + min: '00', | |
| 2503 | + sec: '00' | |
| 2504 | + } | |
| 2505 | + } | |
| 2506 | + var txt = "timer[" + j + "]"; | |
| 2507 | + th.setData({ | |
| 2508 | + [txt]: obj | |
| 2509 | + }); | |
| 2510 | + } | |
| 2511 | + setTimeout(th.countDown2, 1000); | |
| 2512 | + }, | |
| 2513 | + | |
| 2514 | + //--点赞功能-- | |
| 2515 | + click_zan: function (e) { | |
| 2516 | + var com_id = e.currentTarget.dataset.com_id; | |
| 2517 | + var item_id = e.currentTarget.dataset.item_id; | |
| 2518 | + var app = getApp(), | |
| 2519 | + th = this; | |
| 2520 | + | |
| 2521 | + if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) { | |
| 2522 | + app.confirmBox("您还未登录"); | |
| 2523 | + return false; | |
| 2524 | + } | |
| 2525 | + | |
| 2526 | + var iszan = th.data.comments[item_id].userZanNum; | |
| 2527 | + if (this.data.iszaning) return false; | |
| 2528 | + this.data.iszaning = 1; | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + app.request.post("/api/weshop/commentZan/save", { | |
| 2532 | + data: { | |
| 2533 | + store_id: o.stoid, | |
| 2534 | + user_id: app.globalData.user_id, | |
| 2535 | + goods_id: th.data.gid, | |
| 2536 | + comment_id: com_id | |
| 2537 | + }, | |
| 2538 | + success: function (ee) { | |
| 2539 | + | |
| 2540 | + if (ee.data.code == "-1") { | |
| 2541 | + app.my_warnning("不能给自己点赞", 0, th); | |
| 2542 | + th.data.iszaning = 0; | |
| 2543 | + return; | |
| 2544 | + } | |
| 2545 | + | |
| 2546 | + if (ee.data.code == 0 && iszan != 1) { | |
| 2547 | + var num = th.data.comments[item_id].zan_num; | |
| 2548 | + num++; | |
| 2549 | + var text = "comments[" + item_id + "].zan_num"; | |
| 2550 | + var text1 = "comments[" + item_id + "].userZanNum"; | |
| 2551 | + var _errObj = {}; | |
| 2552 | + _errObj[text] = num; | |
| 2553 | + _errObj[text1] = 1; | |
| 2554 | + th.setData(_errObj); | |
| 2555 | + | |
| 2556 | + } else { | |
| 2557 | + var num = th.data.comments[item_id].zan_num; | |
| 2558 | + num--; | |
| 2559 | + var text = "comments[" + item_id + "].zan_num"; | |
| 2560 | + var text1 = "comments[" + item_id + "].userZanNum"; | |
| 2561 | + var _errObj = {}; | |
| 2562 | + _errObj[text] = num; | |
| 2563 | + _errObj[text1] = 0; | |
| 2564 | + th.setData(_errObj); | |
| 2565 | + } | |
| 2566 | + | |
| 2567 | + setTimeout(function () { | |
| 2568 | + th.data.iszaning = 0; | |
| 2569 | + }, 500) | |
| 2570 | + | |
| 2571 | + } | |
| 2572 | + }) | |
| 2573 | + }, | |
| 2574 | + | |
| 2575 | + /*----券的开关---*/ | |
| 2576 | + switchCoupon: async function (event) { | |
| 2577 | + var coupon = event.currentTarget.dataset.coupon; | |
| 2578 | + var app = getApp(); | |
| 2579 | + var url = "/api/weshop/prom/coupon/pageCouponList"; | |
| 2580 | + var quan_list = this.data.quan_list; | |
| 2581 | + var th = this; | |
| 2582 | + | |
| 2583 | + //当开启,且列表为空的情况下要 | |
| 2584 | + if (!quan_list && coupon == "1") { | |
| 2585 | + wx.showLoading(); | |
| 2586 | + await app.request.promiseGet(url, { | |
| 2587 | + data: { | |
| 2588 | + store_id: os.stoid, | |
| 2589 | + type: 1, | |
| 2590 | + pageSize: 100, | |
| 2591 | + page: 1, | |
| 2592 | + user_id: app.globalData.user_id, | |
| 2593 | + is_share: 0 | |
| 2594 | + } | |
| 2595 | + }).then(res => { | |
| 2596 | + wx.hideLoading(); | |
| 2597 | + quan_list = res.data.data.pageData; | |
| 2598 | + }) | |
| 2599 | + | |
| 2600 | + if (quan_list) { | |
| 2601 | + for (var ind in quan_list) { | |
| 2602 | + var ep = quan_list[ind]; | |
| 2603 | + var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd"); | |
| 2604 | + var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd"); | |
| 2605 | + start = start.replace("00:00:00", ""); | |
| 2606 | + end = end.replace("00:00:00", ""); | |
| 2607 | + quan_list[ind].start = start; | |
| 2608 | + quan_list[ind].end = end; | |
| 2609 | + } | |
| 2610 | + } | |
| 2611 | + | |
| 2612 | + th.setData({ | |
| 2613 | + coupon: coupon, | |
| 2614 | + quan_list: quan_list | |
| 2615 | + }); | |
| 2616 | + } else { | |
| 2617 | + th.setData({ | |
| 2618 | + coupon: coupon | |
| 2619 | + }); | |
| 2620 | + } | |
| 2621 | + }, | |
| 2622 | + | |
| 2623 | + //--查看评价-- | |
| 2624 | + look_pj: function () { | |
| 2625 | + this.tabComment(); | |
| 2626 | + this.doScrollTop(); | |
| 2627 | + }, | |
| 2628 | + | |
| 2629 | + //-----领取券----- | |
| 2630 | + get_quan: function (e) { | |
| 2631 | + var cid = e.currentTarget.dataset.cid; | |
| 2632 | + var index = e.currentTarget.dataset.ind; | |
| 2633 | + var item = this.data.quan_list[index]; | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + //--先判断会员状态-- | |
| 2637 | + var user_info = getApp().globalData.userInfo; | |
| 2638 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 2639 | + wx.navigateTo({ | |
| 2640 | + url: '/pages/togoin/togoin', | |
| 2641 | + }) | |
| 2642 | + return false; | |
| 2643 | + } | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + //如果券还在领取中,不能再点 | |
| 2647 | + if (item.linging == 1) { | |
| 2648 | + getApp().my_warnning('领取中..', 0, this); | |
| 2649 | + return false; | |
| 2650 | + } | |
| 2651 | + | |
| 2652 | + //如果领取的次数到了 | |
| 2653 | + if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) { | |
| 2654 | + getApp().my_warnning('领取失败,您已领完该券', 0, this); | |
| 2655 | + return false; | |
| 2656 | + } | |
| 2657 | + | |
| 2658 | + var lq_num = item.lqnum; | |
| 2659 | + | |
| 2660 | + var pdata = { | |
| 2661 | + 'uid': oo.user_id, | |
| 2662 | + 'cid': cid, | |
| 2663 | + 'store_id': os.stoid, | |
| 2664 | + 'type': 5 | |
| 2665 | + }; | |
| 2666 | + | |
| 2667 | + //-- 导购ID -- | |
| 2668 | + if (getApp().globalData.guide_id) { | |
| 2669 | + pdata.guide_id = getApp().globalData.guide_id; | |
| 2670 | + } | |
| 2671 | + | |
| 2672 | + var app = getApp(), | |
| 2673 | + th = this; | |
| 2674 | + app.request.post("/api/weshop/couponList/saveCouponList", { | |
| 2675 | + data: pdata, | |
| 2676 | + success: function (res) { | |
| 2677 | + if (res.data.code == 0) { | |
| 2678 | + app.my_warnning("领取成功", 1, th); | |
| 2679 | + lq_num++; | |
| 2680 | + var text = "quan_list[" + index + "].lqnum"; | |
| 2681 | + var text2 = "quan_list[" + index + "].linging"; | |
| 2682 | + var obj = {}; | |
| 2683 | + obj[text] = lq_num; | |
| 2684 | + obj[text2] = 0; | |
| 2685 | + th.setData(obj); | |
| 2686 | + } else { | |
| 2687 | + app.confirmBox(res.data.msg); | |
| 2688 | + var text2 = "quan_list[" + index + "].linging"; | |
| 2689 | + var obj = {}; | |
| 2690 | + obj[text2] = 0; | |
| 2691 | + th.setData(obj); | |
| 2692 | + } | |
| 2693 | + } | |
| 2694 | + }) | |
| 2695 | + }, | |
| 2696 | + | |
| 2697 | + //--定义的保存图片方法,分享团--- | |
| 2698 | + saveImageToPhotosAlbum: function () { | |
| 2699 | + //--先判断会员状态-- | |
| 2700 | + var user_info = getApp().globalData.userInfo; | |
| 2701 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 2702 | + //getApp().my_warnning("请先登录",0,this); | |
| 2703 | + wx.navigateTo({ url: '/pages/togoin/togoin', }) | |
| 2704 | + return false; | |
| 2705 | + } | |
| 2706 | + | |
| 2707 | + if (this.data.share_hidden) { | |
| 2708 | + this.setData({ | |
| 2709 | + share_hidden: false, | |
| 2710 | + }); | |
| 2711 | + }; | |
| 2712 | + | |
| 2713 | + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团 | |
| 2714 | + var type = 8; | |
| 2715 | + wx.showLoading({ | |
| 2716 | + title: '生成中...', | |
| 2717 | + }) | |
| 2718 | + var that = this, | |
| 2719 | + th = that; | |
| 2720 | + //设置画板显示,才能开始绘图 | |
| 2721 | + that.setData({ | |
| 2722 | + canvasHidden: false | |
| 2723 | + }) | |
| 2724 | + | |
| 2725 | + var app = getApp(); | |
| 2726 | + var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | |
| 2727 | + var path2 = that.data.data.original_img; | |
| 2728 | + | |
| 2729 | + var scene = th.data.gid + "_"+th.data.presellList.id; | |
| 2730 | + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; | |
| 2731 | + if (user_id > 0) { | |
| 2732 | + scene += "_" + user_id; | |
| 2733 | + } | |
| 2734 | + //-- 如果不是会员分享过来的要分享给别人 -- | |
| 2735 | + if (getApp().globalData.room_id && th.data.data.goods_id == getApp().globalData.room_goods_id && !getApp().globalData.room_user_share) { | |
| 2736 | + //固定房间是第3个字符 | |
| 2737 | + if (!user_id) scene += "_0"; | |
| 2738 | + scene += "_" + getApp().globalData.room_id; | |
| 2739 | + } | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + ///二微码 | |
| 2743 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
| 2744 | + os.stoid + "?sceneValue=" + scene + "&pageValue=packageC/pages/presell/goodsInfo/goodsInfo"; | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + console.log(path3); | |
| 2748 | + | |
| 2749 | + //读取文件成功则OK-- | |
| 2750 | + wx.getImageInfo({ | |
| 2751 | + src: path3, | |
| 2752 | + success: function (res) { | |
| 2753 | + //回调写法 | |
| 2754 | + th.get_head_temp(th.get_goods_temp, function () { | |
| 2755 | + var vpath = res.path; | |
| 2756 | + var context = wx.createCanvasContext('share'); | |
| 2757 | + //先画背景 | |
| 2758 | + var pg_path = "../../../../images/share/share_bg.png"; | |
| 2759 | + | |
| 2760 | + // context.fillStyle="#FFFFFF"; | |
| 2761 | + // context.fillRect(0,0,554 * unit, 899 * unit); | |
| 2762 | + | |
| 2763 | + //-- 如果有自定义海报的时候,判断背景的图片 -- | |
| 2764 | + if (th.data.share_b_img) { | |
| 2765 | + pg_path = th.data.share_b_img; | |
| 2766 | + } | |
| 2767 | + context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit); | |
| 2768 | + | |
| 2769 | + //-- 是自定义海报的情况下 -- | |
| 2770 | + if (th.data.poster && parseInt(th.data.poster.style) == 2) { | |
| 2771 | + //在线上分享人的情况下 | |
| 2772 | + if (parseInt(th.data.poster.show_headpic)) { | |
| 2773 | + //获取坐标 | |
| 2774 | + var x = parseFloat(th.data.poster.head_x) * 2; | |
| 2775 | + var y = parseFloat(th.data.poster.head_y) * 2; | |
| 2776 | + var x1 = (x + 90) * unit; | |
| 2777 | + var y1 = (y + 50) * unit; | |
| 2778 | + //--昵称--- | |
| 2779 | + context.setFontSize(24 * unit) | |
| 2780 | + context.setFillStyle("black") | |
| 2781 | + context.fillText(app.globalData.userInfo.nickname, x1, y1); | |
| 2782 | + var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit; | |
| 2783 | + //强烈推荐 改许程 | |
| 2784 | + var tj_path = "../../../../images/share/q_tj.png"; | |
| 2785 | + context.drawImage(tj_path, x1 + width, y1 - 22 * unit, 85 * unit, 30 * unit); | |
| 2786 | + context.setFontSize(16 * unit) | |
| 2787 | + context.setLineJoin('round'); //交点设置成圆角 | |
| 2788 | + context.setFillStyle("white") | |
| 2789 | + context.fillText('强烈推荐', x1 + width + 8 * unit, y1 - 1 * unit); | |
| 2790 | + | |
| 2791 | + //context.setFillStyle("black") | |
| 2792 | + //context.setFontSize(24 * unit) | |
| 2793 | + //context.fillText(getApp().globalData.config.store_name, 40 * unit, 130 * unit); | |
| 2794 | + } | |
| 2795 | + } else { | |
| 2796 | + //--昵称--- | |
| 2797 | + context.setFontSize(24 * unit) | |
| 2798 | + context.setFillStyle("black") | |
| 2799 | + context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit); | |
| 2800 | + var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit; | |
| 2801 | + //强烈推荐 改许程 | |
| 2802 | + var tj_path = "../../../../images/share/q_tj.png"; | |
| 2803 | + context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); | |
| 2804 | + context.setFontSize(16 * unit); | |
| 2805 | + context.setLineJoin('round'); //交点设置成圆角 | |
| 2806 | + context.setFillStyle("white"); | |
| 2807 | + context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 75 * unit); | |
| 2808 | + } | |
| 2809 | + | |
| 2810 | + var share_title = th.data.presellForm.share_title; | |
| 2811 | + share_title ? share_title : th.data.data.goods_name; | |
| 2812 | + | |
| 2813 | + //---产品名称--- | |
| 2814 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | |
| 2815 | + if (type != 4) { | |
| 2816 | + context.setFillStyle("black"); | |
| 2817 | + context.setFontSize(21.3 * unit) | |
| 2818 | + th.draw_Text(context, share_title, | |
| 2819 | + 80 * unit, 200 * unit, 200 * unit, 279 * unit, unit); | |
| 2820 | + | |
| 2821 | + //------产品的价格------- | |
| 2822 | + context.setFontSize(22 * unit) | |
| 2823 | + context.setFillStyle("red") | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + var pri0 = th.data.presellList.presell_money; | |
| 2827 | + // if (th.data.prom_act) | |
| 2828 | + // pri0 = th.data.prom_act.price; | |
| 2829 | + pri0 = parseFloat(pri0).toFixed(2); | |
| 2830 | + var wd1 = th.data.screenWidth - ut.measureText(pri0, 31 * unit) - 25; | |
| 2831 | + context.fillText("¥", wd1 - 15, 185 * unit); | |
| 2832 | + context.setFontSize(22 * unit) | |
| 2833 | + context.fillText(pri0, wd1, 185 * unit); | |
| 2834 | + | |
| 2835 | + //---市场价划掉--- | |
| 2836 | + context.setFillStyle("red") | |
| 2837 | + context.setFontSize(22 * unit) | |
| 2838 | + pri0 = "¥" + th.data.data.market_price.toFixed(2); | |
| 2839 | + var wd2 = th.data.screenWidth - ut.measureText(pri0, 22 * unit) - 25; | |
| 2840 | + | |
| 2841 | + if(th.data.presellForm.presell_type==1){ | |
| 2842 | + context.setStrokeStyle('gray'); | |
| 2843 | + context.fillText(pri0, wd2, 213 * unit); | |
| 2844 | + context.setLineWidth(1 * unit); | |
| 2845 | + context.moveTo(wd2 - 5, 206 * unit); | |
| 2846 | + context.lineTo(wd2 + ut.measureText(pri0, 22 * unit) + 5, 206 * unit); | |
| 2847 | + context.stroke(); | |
| 2848 | + }else{ | |
| 2849 | + context.fillText('定金', wd2, 213 * unit); | |
| 2850 | + } | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + } else { | |
| 2855 | + context.setFillStyle("black"); | |
| 2856 | + context.setFontSize(21.3 * unit) | |
| 2857 | + th.draw_Text(context, share_title, | |
| 2858 | + 38 * unit, 170 * unit, 20 * unit, 300 * unit, unit); | |
| 2859 | + //------ 产品的价格 ----- | |
| 2860 | + var pri0 = th.data.prom_act.addmoney; | |
| 2861 | + var integral = th.data.prom_act.integral; | |
| 2862 | + var text = ""; | |
| 2863 | + if (integral) { text = integral + "积分"; } | |
| 2864 | + if (pri0 && integral) { text += "+"; } | |
| 2865 | + if (pri0) { text += "¥" + pri0; } | |
| 2866 | + | |
| 2867 | + if (!pri0 && !integral) { text = "0积分"; } | |
| 2868 | + context.setFillStyle("red"); | |
| 2869 | + context.fillText(text, 38 * unit, 235 * unit); | |
| 2870 | + | |
| 2871 | + } | |
| 2872 | + | |
| 2873 | + //console.log(th.data.share_goods_img); | |
| 2874 | + //let share_goods_img=th.data.presellForm.share_img; | |
| 2875 | + //share_goods_img?share_goods_img:th.data.data.share_goods_img; | |
| 2876 | + //---中间大图--- | |
| 2877 | + context.drawImage(th.data.share_goods_img, 70 * unit, 250 * unit, 408 * unit, 408 * unit); | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + //---画线--- | |
| 2881 | + context.setLineWidth(1 * unit) | |
| 2882 | + context.moveTo(32 * unit, 665 * unit) | |
| 2883 | + context.lineTo(520 * unit, 665 * unit) | |
| 2884 | + context.stroke(); | |
| 2885 | + | |
| 2886 | + //---文字--- | |
| 2887 | + context.setFillStyle("black") | |
| 2888 | + // context.setFontSize(22 * unit) | |
| 2889 | + context.setFontSize(24 * unit) | |
| 2890 | + context.fillText(th.data.sto_sele_name_1, 40 * unit, 730 * unit); | |
| 2891 | + context.setFillStyle("red") | |
| 2892 | + context.setFontSize(20 * unit) | |
| 2893 | + var presell_price = `预售价:${th.data.presellList.presell_price}` | |
| 2894 | + context.fillText(presell_price, 40 * unit, 780 * unit); | |
| 2895 | + context.setFillStyle("black") | |
| 2896 | + context.setFontSize(22 * unit) | |
| 2897 | + context.fillText("特惠好物,限时预售", 40 * unit, 826 * unit); | |
| 2898 | + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 866 * unit); | |
| 2899 | + | |
| 2900 | + //---二维吗图--- | |
| 2901 | + //-- 自定义海报 -- | |
| 2902 | + if (th.data.poster) { | |
| 2903 | + var erm_x = parseFloat(th.data.poster.ewm_x) * 2; | |
| 2904 | + var erm_y = parseFloat(th.data.poster.ewm_y) * 2; | |
| 2905 | + context.drawImage(vpath, erm_x * unit, erm_y * unit, 136 * unit, 136 * unit); | |
| 2906 | + } else { | |
| 2907 | + //---二维吗图--- | |
| 2908 | + context.drawImage(vpath, 390 * unit, 746 * unit, 130 * unit, 116 * unit); | |
| 2909 | + } | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + //--- 如果是自定义海报的时候 --- | |
| 2914 | + if (th.data.poster && parseInt(th.data.poster.style) == 2) { | |
| 2915 | + | |
| 2916 | + //如果显示会员信息的话 | |
| 2917 | + if (parseInt(th.data.poster.show_headpic)) { | |
| 2918 | + //获取坐标 | |
| 2919 | + var x = parseFloat(th.data.poster.head_x) * 2; | |
| 2920 | + var y = parseFloat(th.data.poster.head_y) * 2; | |
| 2921 | + //---绘制圆形要放在最后---- | |
| 2922 | + context.save(); | |
| 2923 | + context.beginPath(); | |
| 2924 | + var h_x = x * unit; | |
| 2925 | + var h_y = y * unit; | |
| 2926 | + var h_r = 40 * unit; | |
| 2927 | + var cx = h_x + h_r; | |
| 2928 | + var cy = h_y + h_r; | |
| 2929 | + context.arc(cx, cy, h_r, 0, Math.PI * 2, false); | |
| 2930 | + context.closePath(); | |
| 2931 | + context.fill(); | |
| 2932 | + context.clip(); | |
| 2933 | + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2); | |
| 2934 | + context.restore(); | |
| 2935 | + } | |
| 2936 | + | |
| 2937 | + } else { | |
| 2938 | + //---绘制圆形要放在最后---- | |
| 2939 | + context.save(); | |
| 2940 | + context.beginPath(); | |
| 2941 | + var h_x = 60 * unit; | |
| 2942 | + var h_y = 24 * unit; | |
| 2943 | + var h_r = 40 * unit; | |
| 2944 | + var cx = h_x + h_r; | |
| 2945 | + var cy = h_y + h_r; | |
| 2946 | + context.arc(cx, cy, h_r, 0, Math.PI * 2, false); | |
| 2947 | + context.closePath(); | |
| 2948 | + context.fill(); | |
| 2949 | + context.clip(); | |
| 2950 | + context.drawImage(th.data.share_head, h_x, h_y, h_r * 2, h_r * 2); | |
| 2951 | + context.restore(); | |
| 2952 | + } | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + //把画板内容绘制成图片,并回调 画板图片路径 | |
| 2956 | + context.draw(false, function () { | |
| 2957 | + setTimeout(function () { | |
| 2958 | + wx.canvasToTempFilePath({ | |
| 2959 | + x: 0, | |
| 2960 | + y: 0, | |
| 2961 | + width: 750, | |
| 2962 | + height: 1217, | |
| 2963 | + destWidth: 1.2 * 750 * 750 / that.data.screenWidth, | |
| 2964 | + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth, | |
| 2965 | + canvasId: 'share', | |
| 2966 | + success: function (res) { | |
| 2967 | + | |
| 2968 | + that.setData({ | |
| 2969 | + shareImgPath: res.tempFilePath, | |
| 2970 | + canvasHidden: true | |
| 2971 | + }) | |
| 2972 | + | |
| 2973 | + if (!res.tempFilePath) { | |
| 2974 | + wx.showModal({ | |
| 2975 | + title: '提示', | |
| 2976 | + content: '图片绘制中,请稍后重试', | |
| 2977 | + showCancel: false | |
| 2978 | + }) | |
| 2979 | + return false; | |
| 2980 | + } | |
| 2981 | + | |
| 2982 | + // wx.previewImage({ | |
| 2983 | + // //将图片预览出来 | |
| 2984 | + // urls: [that.data.shareImgPath] | |
| 2985 | + // }); | |
| 2986 | + that.setData({ | |
| 2987 | + showPoster: true, | |
| 2988 | + }); | |
| 2989 | + wx.hideLoading(); | |
| 2990 | + } | |
| 2991 | + }) | |
| 2992 | + }, 500) | |
| 2993 | + | |
| 2994 | + }); | |
| 2995 | + }); | |
| 2996 | + }, | |
| 2997 | + fail: function (res) { | |
| 2998 | + console.log(res); | |
| 2999 | + wx.hideLoading(); | |
| 3000 | + | |
| 3001 | + } | |
| 3002 | + }); | |
| 3003 | + }, | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 | |
| 3007 | + draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { | |
| 3008 | + var lineWidth = 0; | |
| 3009 | + var lastSubStrIndex = 0; //每次开始截取的字符串的索引 | |
| 3010 | + var han = 0; | |
| 3011 | + for (let i = 0; i < str.length; i++) { | |
| 3012 | + if (han == 2) return; | |
| 3013 | + //lineWidth += ctx.measureText(str[i]).width; | |
| 3014 | + lineWidth += ut.measureText(str[i], 21.3 * unit); | |
| 3015 | + if (lineWidth > canvasWidth) { | |
| 3016 | + han++; | |
| 3017 | + | |
| 3018 | + if (han == 2) | |
| 3019 | + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | |
| 3020 | + else | |
| 3021 | + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | |
| 3022 | + | |
| 3023 | + initHeight += 22; //22为字体的高度 | |
| 3024 | + lineWidth = 0; | |
| 3025 | + lastSubStrIndex = i; | |
| 3026 | + titleHeight += 20; | |
| 3027 | + } | |
| 3028 | + if (i == str.length - 1) { //绘制剩余部分 | |
| 3029 | + ctx.fillText(str.substring(lastSubStrIndex, i + 1), leftWidth, initHeight); | |
| 3030 | + } | |
| 3031 | + } | |
| 3032 | + }, | |
| 3033 | + | |
| 3034 | + // ----视频图片---- | |
| 3035 | + // 图片计数器 | |
| 3036 | + swiperChange: function (e) { | |
| 3037 | + var that = this; | |
| 3038 | + if (e.detail.current > 0) { | |
| 3039 | + that.setData({ | |
| 3040 | + hiddenn: 1, | |
| 3041 | + videopicture: 1, | |
| 3042 | + }) | |
| 3043 | + } else { | |
| 3044 | + that.setData({ | |
| 3045 | + hiddenn: 0, | |
| 3046 | + videopicture: 0, | |
| 3047 | + }) | |
| 3048 | + } | |
| 3049 | + if (e.detail.source == 'touch') { | |
| 3050 | + that.setData({ | |
| 3051 | + current: e.detail.current | |
| 3052 | + }) | |
| 3053 | + } | |
| 3054 | + }, | |
| 3055 | + | |
| 3056 | + /*---视频相关--*/ | |
| 3057 | + videopicture: function (e) { | |
| 3058 | + var vipi = e.currentTarget.dataset.vipi; | |
| 3059 | + this.setData({ | |
| 3060 | + videopicture: vipi, | |
| 3061 | + swiperCurrent: vipi, | |
| 3062 | + noon: 0, | |
| 3063 | + current: 1 | |
| 3064 | + }); | |
| 3065 | + }, | |
| 3066 | + | |
| 3067 | + videoPlay: function (e) { | |
| 3068 | + var _index = e.currentTarget.id | |
| 3069 | + this.setData({ | |
| 3070 | + _index: _index, | |
| 3071 | + noon: 1 | |
| 3072 | + }) | |
| 3073 | + | |
| 3074 | + setTimeout(function () { | |
| 3075 | + //将点击视频进行播放 | |
| 3076 | + var videoContext = wx.createVideoContext(_index) | |
| 3077 | + videoContext.play(); | |
| 3078 | + }, 500) | |
| 3079 | + }, | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + //--获取头像的本地缓存,回调写法-- | |
| 3084 | + get_head_temp: function (tt, func) { | |
| 3085 | + var ee = this; | |
| 3086 | + if (ee.data.share_head) { | |
| 3087 | + tt(func); | |
| 3088 | + return false; | |
| 3089 | + } | |
| 3090 | + //---获取分享图片的本地地址,头像和商品图片---- | |
| 3091 | + var path2 = getApp().globalData.userInfo.head_pic; | |
| 3092 | + if (path2 == "") { | |
| 3093 | + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; | |
| 3094 | + tt(func); | |
| 3095 | + } else { | |
| 3096 | + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | |
| 3097 | + path2 = path2.replace("https://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | |
| 3098 | + wx.getImageInfo({ | |
| 3099 | + src: path2, | |
| 3100 | + success: function (res) { | |
| 3101 | + //res.path是网络图片的本地地址 | |
| 3102 | + ee.data.share_head = res.path; | |
| 3103 | + tt(func); | |
| 3104 | + }, | |
| 3105 | + fail: function (res) { | |
| 3106 | + ee.data.share_head = "../../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 | |
| 3107 | + tt(func); | |
| 3108 | + } | |
| 3109 | + }); | |
| 3110 | + } | |
| 3111 | + }, | |
| 3112 | + //--获取商品图片的本地缓存,回调写法-- | |
| 3113 | + get_goods_temp: function (tt) { | |
| 3114 | + var ee = this; | |
| 3115 | + if (ee.data.share_goods_img) { | |
| 3116 | + tt(); | |
| 3117 | + return false; | |
| 3118 | + } | |
| 3119 | + // var img_url = ee.data.data.original_img; | |
| 3120 | + var img_url = ee.data.presellForm.share_img; | |
| 3121 | + img_url?img_url:ee.data.data.original_img; | |
| 3122 | + | |
| 3123 | + if (img_url) { | |
| 3124 | + img_url = this.data.iurl + img_url; | |
| 3125 | + } | |
| 3126 | + | |
| 3127 | + //获取商品是分享图信息 | |
| 3128 | + wx.getImageInfo({ | |
| 3129 | + src: img_url, | |
| 3130 | + success: function (res) { | |
| 3131 | + //res.path是网络图片的本地地址 | |
| 3132 | + ee.data.share_goods_img = res.path; | |
| 3133 | + tt(); | |
| 3134 | + }, | |
| 3135 | + fail: function (res) { | |
| 3136 | + ee.data.share_goods_img = "../../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | |
| 3137 | + tt(); | |
| 3138 | + } | |
| 3139 | + }); | |
| 3140 | + }, | |
| 3141 | + | |
| 3142 | + //--外侧评价的点击效果--- | |
| 3143 | + clik_evaluate: function (e) { | |
| 3144 | + var val = e.currentTarget.dataset.val; | |
| 3145 | + this.setData({ | |
| 3146 | + activeCategoryId: 2, | |
| 3147 | + activeCategoryId3: val, | |
| 3148 | + comments: null | |
| 3149 | + }); | |
| 3150 | + this.requestComments_new(); | |
| 3151 | + }, | |
| 3152 | + | |
| 3153 | + //--跳转到商品详情页面-- | |
| 3154 | + go_goods: function (e) { | |
| 3155 | + var gid = e.currentTarget.dataset.gid; | |
| 3156 | + var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; | |
| 3157 | + getApp().goto(url); | |
| 3158 | + }, | |
| 3159 | + | |
| 3160 | + //--跳转到支付尾款界面-- | |
| 3161 | + go_pay_wk: function () { | |
| 3162 | + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id; | |
| 3163 | + getApp().goto(url); | |
| 3164 | + }, | |
| 3165 | + | |
| 3166 | + pop_err_img: function (e) { | |
| 3167 | + var txt = e.currentTarget.dataset.errorimg; | |
| 3168 | + var ob = {}; | |
| 3169 | + ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; | |
| 3170 | + this.setData(ob); | |
| 3171 | + }, | |
| 3172 | + | |
| 3173 | + //--调用更新阶梯团的接口-- | |
| 3174 | + update_jiti: function (id) { | |
| 3175 | + var th = this; | |
| 3176 | + //--更新阶梯团-- | |
| 3177 | + getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, { | |
| 3178 | + success: function (ee) { | |
| 3179 | + //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情-- | |
| 3180 | + if (ee.data.code == 0) { | |
| 3181 | + th.setData({ | |
| 3182 | + user_order_pt_state: 3, | |
| 3183 | + }); | |
| 3184 | + } else if (ee.data.code == -1) { | |
| 3185 | + th.setData({ | |
| 3186 | + user_order_pt_state: 2, | |
| 3187 | + }); | |
| 3188 | + } | |
| 3189 | + } | |
| 3190 | + }) | |
| 3191 | + }, | |
| 3192 | + // 选择门店 | |
| 3193 | + choice_store: function (ee) { | |
| 3194 | + var th = this; | |
| 3195 | + var ind = ee.currentTarget.dataset.ind; | |
| 3196 | + var bconfig = th.data.bconfig; | |
| 3197 | + | |
| 3198 | + if (!th.data.only_pk && !th.data.def_pickpu_list) { | |
| 3199 | + getApp().confirmBox("门店库存不足", null, 25000, !1); | |
| 3200 | + return false; | |
| 3201 | + } | |
| 3202 | + | |
| 3203 | + if (th.data.only_pk && !th.data.only_pk.length) { | |
| 3204 | + getApp().confirmBox("门店库存不足", null, 25000, !1); | |
| 3205 | + return false; | |
| 3206 | + } | |
| 3207 | + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) { | |
| 3208 | + getApp().confirmBox("门店库存不足", null, 25000, !1); | |
| 3209 | + return false; | |
| 3210 | + } | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + if (bconfig && bconfig.is_sort_storage) { | |
| 3214 | + wx.getLocation({ | |
| 3215 | + type: 'gcj02', | |
| 3216 | + success: function (res) { | |
| 3217 | + | |
| 3218 | + th.data.lat = res.latitude; | |
| 3219 | + th.data.lon = res.longitude; | |
| 3220 | + th.data.is_get_local_ok = 1; | |
| 3221 | + th.setData({ | |
| 3222 | + is_gps: 1 | |
| 3223 | + }); | |
| 3224 | + //th.onShow(); | |
| 3225 | + th.get_sto(th.data.is_normal); | |
| 3226 | + }, | |
| 3227 | + fail: function (res) { | |
| 3228 | + //th.onShow(); | |
| 3229 | + th.data.is_get_local_ok = 1; | |
| 3230 | + th.get_sto(th.data.is_normal); | |
| 3231 | + if (res.errCode == 2) { | |
| 3232 | + th.setData({ | |
| 3233 | + is_gps: 0 | |
| 3234 | + }); | |
| 3235 | + if (th.data.is_gps == 0) { | |
| 3236 | + getApp().confirmBox("请开启GPS定位", null, 25000, !1); | |
| 3237 | + } | |
| 3238 | + } else { | |
| 3239 | + th.setData({ | |
| 3240 | + is_gps: "3" | |
| 3241 | + }); | |
| 3242 | + } | |
| 3243 | + | |
| 3244 | + } | |
| 3245 | + }) | |
| 3246 | + } else { | |
| 3247 | + th.data.is_get_local_ok = 1; | |
| 3248 | + th.get_sto(th.data.is_normal); | |
| 3249 | + } | |
| 3250 | + | |
| 3251 | + if (ind != undefined && ind != null) { | |
| 3252 | + this.setData({ | |
| 3253 | + open_ind_store: ind, | |
| 3254 | + store: 1, | |
| 3255 | + openSpecModal: !1, | |
| 3256 | + openSpecModal_pt: !1 | |
| 3257 | + }) | |
| 3258 | + } else { | |
| 3259 | + this.setData({ | |
| 3260 | + store: 1, | |
| 3261 | + openSpecModal: !1, | |
| 3262 | + openSpecModal_pt: !1 | |
| 3263 | + }) | |
| 3264 | + } | |
| 3265 | + }, | |
| 3266 | + //关闭选择门店 | |
| 3267 | + close_popup: function (e) { | |
| 3268 | + var th = this; | |
| 3269 | + this.setData({ | |
| 3270 | + store: 0, | |
| 3271 | + choice_sort_store: 0, | |
| 3272 | + sort_store: 0, | |
| 3273 | + fir_pick_index: 0, | |
| 3274 | + sec_pick_index: 0 | |
| 3275 | + }) | |
| 3276 | + | |
| 3277 | + var openindstore = this.data.open_ind_store; | |
| 3278 | + if (openindstore == 1) { | |
| 3279 | + th.setData({ | |
| 3280 | + openSpecModal: !0, | |
| 3281 | + openSpecModal_ind: openindstore, | |
| 3282 | + }); | |
| 3283 | + } else if (openindstore == 2) { | |
| 3284 | + th.setData({ | |
| 3285 | + openSpecModal: !0, | |
| 3286 | + openSpecModal_ind: openindstore, | |
| 3287 | + }); | |
| 3288 | + } | |
| 3289 | + else if (openindstore == 4) { //4就是拼团 | |
| 3290 | + th.setData({ | |
| 3291 | + openSpecModal_pt: 1, //打开拼团购买界面 | |
| 3292 | + store: 0, //关闭门店 | |
| 3293 | + choice_sort_store: 0, //关闭门店2级 | |
| 3294 | + sort_store: 0, //关闭门店2级 | |
| 3295 | + }); | |
| 3296 | + } | |
| 3297 | + else { | |
| 3298 | + th.setData({ | |
| 3299 | + store: 0, | |
| 3300 | + choice_sort_store: 0, | |
| 3301 | + sort_store: 0 | |
| 3302 | + }) | |
| 3303 | + } | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + }, | |
| 3307 | + | |
| 3308 | + //选择更多门店 | |
| 3309 | + more_store: function () { | |
| 3310 | + this.setData({ | |
| 3311 | + sort_store: 1 | |
| 3312 | + }); | |
| 3313 | + }, | |
| 3314 | + sort_store: function () { | |
| 3315 | + | |
| 3316 | + }, | |
| 3317 | + // 返回按钮 | |
| 3318 | + returns: function () { | |
| 3319 | + this.setData({ | |
| 3320 | + sort_store: 0, | |
| 3321 | + choice_sort_store: 0 | |
| 3322 | + }); | |
| 3323 | + }, | |
| 3324 | + //---选择分类门店--- | |
| 3325 | + choice_sort_store: function (e) { | |
| 3326 | + var index = e.currentTarget.dataset.index; | |
| 3327 | + var region_name = e.currentTarget.dataset.region; | |
| 3328 | + var item = this.data.all_sto[index]; | |
| 3329 | + this.setData({ | |
| 3330 | + region_name: region_name, | |
| 3331 | + sort_store: 0, | |
| 3332 | + choice_sort_store: 1, | |
| 3333 | + sec_sto: item, | |
| 3334 | + sec_pick_index: 0 | |
| 3335 | + }); | |
| 3336 | + }, | |
| 3337 | + | |
| 3338 | + choose_for_store_fir: function (e) { | |
| 3339 | + var index_c = e.currentTarget.dataset.ind; | |
| 3340 | + var th = this; | |
| 3341 | + th.setData({ | |
| 3342 | + fir_pick_index: index_c | |
| 3343 | + }) | |
| 3344 | + | |
| 3345 | + }, | |
| 3346 | + | |
| 3347 | + //如果开启线下库存,已经急速库存才会使用 | |
| 3348 | + async check_the_pick(item, func) { | |
| 3349 | + var th = this; | |
| 3350 | + var goodsinfo = th.data.sele_g; | |
| 3351 | + var erpwareid = goodsinfo.erpwareid; | |
| 3352 | + var plist = null; | |
| 3353 | + var lock = 0; | |
| 3354 | + | |
| 3355 | + //---如果是活动的时候,同时不是普通购买--- | |
| 3356 | + if ((th.data.prom_type == 1 || th.data.prom_type == 6 || th.data.prom_type == 4) && !th.data.is_normal) { | |
| 3357 | + func(); return false; | |
| 3358 | + } | |
| 3359 | + | |
| 3360 | + if (this.data.sales_rules != 2) { | |
| 3361 | + func(); | |
| 3362 | + } else { | |
| 3363 | + | |
| 3364 | + //先读取门店的lock | |
| 3365 | + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { | |
| 3366 | + data: { store_id: os.stoid, wareId: goodsinfo.goods_id, storageId: item.pickup_id, pageSize: 1000 } | |
| 3367 | + }).then(res => { | |
| 3368 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
| 3369 | + for (var i in res.data.data.pageData) | |
| 3370 | + lock += res.data.data.pageData[i].outQty; | |
| 3371 | + } | |
| 3372 | + }) | |
| 3373 | + //读取线下的门店库存 | |
| 3374 | + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { | |
| 3375 | + data: { storageNos: item.pickup_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid } | |
| 3376 | + }).then(res => { | |
| 3377 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
| 3378 | + plist = res.data.data.pageData[0]; | |
| 3379 | + } | |
| 3380 | + }) | |
| 3381 | + | |
| 3382 | + if (plist && plist.CanOutQty - lock > 0) { | |
| 3383 | + item.CanOutQty = plist.CanOutQty - lock; | |
| 3384 | + func(); | |
| 3385 | + return false; | |
| 3386 | + } | |
| 3387 | + getApp().my_warnning(item.pickup_name + "库存不足!", 0, th); | |
| 3388 | + | |
| 3389 | + } | |
| 3390 | + }, | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + //确定def_pick为选择的门店 | |
| 3394 | + sure_pick: function (e) { | |
| 3395 | + var th = this; | |
| 3396 | + var item = null; | |
| 3397 | + var openindstore = th.data.open_ind_store; | |
| 3398 | + | |
| 3399 | + if (th.data.choice_sort_store == 0) { | |
| 3400 | + var index = th.data.fir_pick_index; | |
| 3401 | + if (th.data.is_show_sto_cat == 1) { | |
| 3402 | + item = th.data.def_pickpu_list[index]; | |
| 3403 | + } else { | |
| 3404 | + item = th.data.only_pk[index]; //当没有门店分类的时候 | |
| 3405 | + } | |
| 3406 | + | |
| 3407 | + } else { | |
| 3408 | + var index = th.data.sec_pick_index; | |
| 3409 | + item = th.data.sec_sto.s_arr[index]; | |
| 3410 | + } | |
| 3411 | + | |
| 3412 | + if (!th.data.sele_g) return false; | |
| 3413 | + //判断门店的配送方式是不是匹配 | |
| 3414 | + var g_distr_type = th.data.sele_g.distr_type; | |
| 3415 | + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { | |
| 3416 | + wx.showToast({ | |
| 3417 | + title: "门店配送方式不匹配", | |
| 3418 | + icon: 'none', | |
| 3419 | + duration: 2000 | |
| 3420 | + }); | |
| 3421 | + return false; | |
| 3422 | + } | |
| 3423 | + | |
| 3424 | + //--回调函数的用法-- | |
| 3425 | + th.check_the_pick(item, function () { | |
| 3426 | + th.setData({ | |
| 3427 | + def_pick_store: item, | |
| 3428 | + sto_sele_name: item.pickup_name, | |
| 3429 | + sto_sele_id: item.pickup_id, | |
| 3430 | + sto_sele_distr: item.distr_type, | |
| 3431 | + store: 0, | |
| 3432 | + choice_sort_store: 0, | |
| 3433 | + fir_pick_index: 0 | |
| 3434 | + }); | |
| 3435 | + | |
| 3436 | + if (openindstore == 1) { | |
| 3437 | + th.setData({ | |
| 3438 | + openSpecModal: !0, | |
| 3439 | + openSpecModal_ind: openindstore, | |
| 3440 | + }); | |
| 3441 | + } else if (openindstore == 2) { | |
| 3442 | + th.setData({ | |
| 3443 | + openSpecModal: !0, | |
| 3444 | + openSpecModal_ind: openindstore, | |
| 3445 | + }); | |
| 3446 | + } | |
| 3447 | + else if (openindstore == 4) { //4就是拼团 | |
| 3448 | + th.setData({ | |
| 3449 | + openSpecModal_pt: 1, //打开拼团购买界面 | |
| 3450 | + store: 0, //关闭门店 | |
| 3451 | + choice_sort_store: 0, //关闭门店2级 | |
| 3452 | + sort_store: 0, //关闭门店2级 | |
| 3453 | + }); | |
| 3454 | + } | |
| 3455 | + else { | |
| 3456 | + th.setData({ | |
| 3457 | + store: 0, | |
| 3458 | + choice_sort_store: 0, | |
| 3459 | + sort_store: 0 | |
| 3460 | + }) | |
| 3461 | + } | |
| 3462 | + //如果商品没有其他活动,要取一下线下价格 | |
| 3463 | + th.get_off_price(); | |
| 3464 | + }) | |
| 3465 | + }, | |
| 3466 | + //---点击二级之后的选择--- | |
| 3467 | + choose_for_store: function (e) { | |
| 3468 | + var index_c = e.currentTarget.dataset.ind; | |
| 3469 | + var th = this; | |
| 3470 | + th.setData({ | |
| 3471 | + sec_pick_index: index_c, | |
| 3472 | + fir_pick_index: index_c | |
| 3473 | + }) | |
| 3474 | + | |
| 3475 | + }, | |
| 3476 | + //把选择的门店设置成默认的门店def_pick | |
| 3477 | + set_def_pick: function (e) { | |
| 3478 | + var th = this; | |
| 3479 | + var item = null; | |
| 3480 | + if (th.data.choice_sort_store == 0) { | |
| 3481 | + var index = th.data.fir_pick_index; | |
| 3482 | + if (th.data.is_show_sto_cat == 1) { | |
| 3483 | + item = th.data.def_pickpu_list[index]; | |
| 3484 | + } else { | |
| 3485 | + item = th.data.only_pk[index]; //当没有门店分类的时候 | |
| 3486 | + } | |
| 3487 | + } else { | |
| 3488 | + var index = th.data.sec_pick_index; | |
| 3489 | + item = th.data.sec_sto.s_arr[index]; | |
| 3490 | + } | |
| 3491 | + | |
| 3492 | + //判断门店的配送方式是不是匹配 | |
| 3493 | + var g_distr_type = th.data.sele_g.distr_type; | |
| 3494 | + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { | |
| 3495 | + wx.showToast({ | |
| 3496 | + title: "门店配送方式不匹配", | |
| 3497 | + icon: 'none', | |
| 3498 | + duration: 2000 | |
| 3499 | + }); | |
| 3500 | + return false; | |
| 3501 | + } | |
| 3502 | + | |
| 3503 | + //先设置之前,要判断是不是有库存 | |
| 3504 | + th.check_the_pick(item, function () { | |
| 3505 | + var store_id = o.stoid; | |
| 3506 | + var user_id = getApp().globalData.user_id; | |
| 3507 | + var def_pickup_id = item.pickup_id; | |
| 3508 | + | |
| 3509 | + getApp().request.put('/api/weshop/users/update', { | |
| 3510 | + data: { | |
| 3511 | + user_id: user_id, | |
| 3512 | + def_pickup_id: def_pickup_id | |
| 3513 | + }, | |
| 3514 | + success: function (res) { | |
| 3515 | + if (res.data.code == 0) { | |
| 3516 | + if (th.data.choice_sort_store == 0) th.setData({ | |
| 3517 | + fir_pick_index: 0 | |
| 3518 | + }); | |
| 3519 | + getApp().globalData.pk_store = item; | |
| 3520 | + } else { | |
| 3521 | + //s.showWarning("设置默认门店地址失败", null, 500, !1); | |
| 3522 | + getApp().my_warnning("设置默认门店地址失败", 0, th) | |
| 3523 | + } | |
| 3524 | + } | |
| 3525 | + }); | |
| 3526 | + | |
| 3527 | + th.setData({ | |
| 3528 | + def_pick_store: item, | |
| 3529 | + sto_sele_name: item.pickup_name, | |
| 3530 | + sto_sele_id: item.pickup_id, | |
| 3531 | + sto_sele_distr: item.distr_type, | |
| 3532 | + store: 0, | |
| 3533 | + choice_sort_store: 0 | |
| 3534 | + }); | |
| 3535 | + | |
| 3536 | + var openindstore = th.data.open_ind_store; | |
| 3537 | + if (openindstore == 1) { | |
| 3538 | + th.setData({ | |
| 3539 | + openSpecModal: !0, | |
| 3540 | + openSpecModal_ind: openindstore, | |
| 3541 | + store: 0, | |
| 3542 | + choice_sort_store: 0, | |
| 3543 | + sort_store: 0, | |
| 3544 | + }); | |
| 3545 | + } else if (openindstore == 2) { | |
| 3546 | + th.setData({ | |
| 3547 | + openSpecModal: !0, | |
| 3548 | + openSpecModal_ind: openindstore, | |
| 3549 | + store: 0, | |
| 3550 | + choice_sort_store: 0, | |
| 3551 | + sort_store: 0, | |
| 3552 | + }); | |
| 3553 | + } | |
| 3554 | + else if (openindstore == 4) { //4就是拼团 | |
| 3555 | + th.setData({ | |
| 3556 | + openSpecModal_pt: 1, //打开拼团购买界面 | |
| 3557 | + store: 0, //关闭门店 | |
| 3558 | + choice_sort_store: 0, //关闭门店2级 | |
| 3559 | + sort_store: 0, //关闭门店2级 | |
| 3560 | + }); | |
| 3561 | + } | |
| 3562 | + | |
| 3563 | + else { | |
| 3564 | + th.setData({ | |
| 3565 | + store: 0, | |
| 3566 | + choice_sort_store: 0, | |
| 3567 | + sort_store: 0, | |
| 3568 | + }) | |
| 3569 | + } | |
| 3570 | + | |
| 3571 | + //如果商品没有其他活动,要取一下线下价格 | |
| 3572 | + th.get_off_price(); | |
| 3573 | + | |
| 3574 | + }) | |
| 3575 | + }, | |
| 3576 | + | |
| 3577 | + wait_for_store_config: function () { | |
| 3578 | + var th = this; | |
| 3579 | + var t_time = setInterval(function () { | |
| 3580 | + if (th.data.bconfig == null) false; | |
| 3581 | + var e = th.data.bconfig; | |
| 3582 | + if (e && e.is_sort_storage) { | |
| 3583 | + wx.getLocation({ | |
| 3584 | + type: 'gcj02', | |
| 3585 | + success: function (res) { | |
| 3586 | + th.data.lat = res.latitude; | |
| 3587 | + th.data.lon = res.longitude; | |
| 3588 | + th.data.is_get_local_ok = 1; | |
| 3589 | + }, | |
| 3590 | + fail: function (res) { | |
| 3591 | + if (res.errCode == 2) { | |
| 3592 | + th.setData({ | |
| 3593 | + is_gps: 0 | |
| 3594 | + }); | |
| 3595 | + if (th.data.is_gps == 0) { | |
| 3596 | + getApp().confirmBox("请开启GPS定位", null, 10000, !1); | |
| 3597 | + } | |
| 3598 | + | |
| 3599 | + } else { | |
| 3600 | + th.setData({ | |
| 3601 | + is_gps: "3" | |
| 3602 | + }); | |
| 3603 | + } | |
| 3604 | + | |
| 3605 | + th.data.is_get_local_ok = 1; | |
| 3606 | + } | |
| 3607 | + }) | |
| 3608 | + } else { | |
| 3609 | + th.data.is_get_local_ok = 1; | |
| 3610 | + } | |
| 3611 | + clearInterval(t_time); | |
| 3612 | + }, 500) | |
| 3613 | + }, | |
| 3614 | + //显示全部 | |
| 3615 | + toggleHandler: function (e) { | |
| 3616 | + var that = this, | |
| 3617 | + index = e.currentTarget.dataset.index; | |
| 3618 | + for (var i = 0; i < that.data.comments.length; i++) { | |
| 3619 | + if (index == i) { | |
| 3620 | + for (var i = 0; i < that.data.comments.length; i++) { | |
| 3621 | + that.data.comments[index].auto = true; | |
| 3622 | + that.data.comments[index].seeMore = false; | |
| 3623 | + } | |
| 3624 | + } | |
| 3625 | + } | |
| 3626 | + that.setData({ | |
| 3627 | + comments: that.data.comments | |
| 3628 | + }) | |
| 3629 | + }, | |
| 3630 | + | |
| 3631 | + //收起更多 | |
| 3632 | + toggleContent: function (e) { | |
| 3633 | + var that = this, | |
| 3634 | + index = e.currentTarget.dataset.index; | |
| 3635 | + for (var i = 0; i < that.data.comments.length; i++) { | |
| 3636 | + if (index == i) { | |
| 3637 | + that.data.comments[index].auto = true; | |
| 3638 | + that.data.comments[index].seeMore = true; | |
| 3639 | + } | |
| 3640 | + } | |
| 3641 | + that.setData({ | |
| 3642 | + comments: that.data.comments | |
| 3643 | + }) | |
| 3644 | + }, | |
| 3645 | + | |
| 3646 | + //--- 获取卡类列表 --- | |
| 3647 | + getPlusCardType: function (func) { | |
| 3648 | + var storid = os.stoid; | |
| 3649 | + var th = this; | |
| 3650 | + var user = getApp().globalData.userInfo; | |
| 3651 | + if (!user) return false; | |
| 3652 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { | |
| 3653 | + var plusCard = res.data.data; | |
| 3654 | + var arr = [1219, 2089, 3031]; | |
| 3655 | + var new_arr = new Array(); | |
| 3656 | + var card_name_map = new Map(); | |
| 3657 | + | |
| 3658 | + var list = []; | |
| 3659 | + for (var i = 0; i < plusCard.length; i++) { | |
| 3660 | + if ((!user || user.card_field == null || user.card_field == "") && plusCard[i].IsStopBuy == true) continue; | |
| 3661 | + var name = "card" + plusCard[i].CorrPrice.toLowerCase(); | |
| 3662 | + card_name_map.set(name, plusCard[i].CardName); | |
| 3663 | + list.push(plusCard[i]); | |
| 3664 | + } | |
| 3665 | + | |
| 3666 | + var ob = { "card_list": list, "name_map": card_name_map }; | |
| 3667 | + func(ob); | |
| 3668 | + }) | |
| 3669 | + }, | |
| 3670 | + | |
| 3671 | + go_plus: function () { | |
| 3672 | + getApp().goto("/pages/user/plus/plus"); | |
| 3673 | + }, | |
| 3674 | + go_card_info: function () { | |
| 3675 | + getApp().goto("/pages/user/cardinfo/cardinfo"); | |
| 3676 | + }, | |
| 3677 | + //-- 根据ID拿出门店 -- | |
| 3678 | + get_pick_from_list(pid) { | |
| 3679 | + var all_pick_list = this.data.all_pick_list; | |
| 3680 | + for (var i in all_pick_list) { | |
| 3681 | + var item = all_pick_list[i]; | |
| 3682 | + if (item.pickup_id == pid) { | |
| 3683 | + return item; | |
| 3684 | + } | |
| 3685 | + } | |
| 3686 | + }, | |
| 3687 | + //-----显示优惠券的时候情况----- | |
| 3688 | + show_more_cx: function () { | |
| 3689 | + if (this.data.is_more_cx) { | |
| 3690 | + this.setData({ is_more_cx: 0 }); | |
| 3691 | + } else { | |
| 3692 | + this.setData({ is_more_cx: 1 }); | |
| 3693 | + } | |
| 3694 | + }, | |
| 3695 | + | |
| 3696 | + //----跳转到搭配购买---- | |
| 3697 | + go_prom_list: function () { | |
| 3698 | + | |
| 3699 | + var url = "../../../../packageA/pages/prom_list/prom_list?goods_id=" + this.data.gid; | |
| 3700 | + var room_id = getApp().globalData.room_id; | |
| 3701 | + if (room_id && this.data.gid == getApp().globalData.room_goods_id) { | |
| 3702 | + url += "&room_id=" + room_id; | |
| 3703 | + } | |
| 3704 | + wx.navigateTo({ url: url, }) | |
| 3705 | + }, | |
| 3706 | + | |
| 3707 | + closePoster() { | |
| 3708 | + this.setData({ | |
| 3709 | + showPoster: false, | |
| 3710 | + }); | |
| 3711 | + }, | |
| 3712 | + | |
| 3713 | + // 保存图片到手机 | |
| 3714 | + savePic() { | |
| 3715 | + console.log('保存图片'); | |
| 3716 | + var self = this; | |
| 3717 | + // 获取用户的当前设置,返回值中有小程序已经向用户请求过的权限 | |
| 3718 | + this.getSetting().then((res) => { | |
| 3719 | + // 判断用户是否授权了保存到相册的权限,如果没有发起授权 | |
| 3720 | + if (!res.authSetting['scope.writePhotosAlbum']) { | |
| 3721 | + this.authorize().then(() => { | |
| 3722 | + // 同意授权后保存下载文件 | |
| 3723 | + this.saveImage(self.data.shareImgPath) | |
| 3724 | + .then(() => { | |
| 3725 | + self.setData({ | |
| 3726 | + showPoster: false | |
| 3727 | + }); | |
| 3728 | + }); | |
| 3729 | + }) | |
| 3730 | + } else { | |
| 3731 | + // 如果已经授权,保存下载文件 | |
| 3732 | + this.saveImage(self.data.shareImgPath) | |
| 3733 | + .then(() => { | |
| 3734 | + self.setData({ | |
| 3735 | + showPoster: false | |
| 3736 | + }); | |
| 3737 | + }); | |
| 3738 | + } | |
| 3739 | + | |
| 3740 | + }) | |
| 3741 | + }, | |
| 3742 | + | |
| 3743 | + // 获取用户已经授予了哪些权限 | |
| 3744 | + getSetting() { | |
| 3745 | + return new Promise((resolve, reject) => { | |
| 3746 | + wx.getSetting({ | |
| 3747 | + success: res => { | |
| 3748 | + resolve(res) | |
| 3749 | + } | |
| 3750 | + }) | |
| 3751 | + }) | |
| 3752 | + }, | |
| 3753 | + | |
| 3754 | + // 发起首次授权请求 | |
| 3755 | + authorize() { | |
| 3756 | + // isFirst 用来记录是否为首次发起授权, | |
| 3757 | + // 如果首次授权拒绝后,isFirst赋值为1 | |
| 3758 | + let isFirst = wx.getStorageSync('isFirst') || 0; | |
| 3759 | + return new Promise((resolve, reject) => { | |
| 3760 | + wx.authorize({ | |
| 3761 | + scope: 'scope.writePhotosAlbum', | |
| 3762 | + // 同意授权 | |
| 3763 | + success: () => { | |
| 3764 | + resolve(); | |
| 3765 | + }, | |
| 3766 | + // 拒绝授权,这里是用户拒绝授权后的回调 | |
| 3767 | + fail: res => { | |
| 3768 | + if (isFirst === 0) { | |
| 3769 | + wx.setStorageSync('isFirst', 1); | |
| 3770 | + wx.showToast({ | |
| 3771 | + title: '保存失败', | |
| 3772 | + icon: 'none', | |
| 3773 | + duration: 1000 | |
| 3774 | + }) | |
| 3775 | + } else { | |
| 3776 | + this.showModal(); | |
| 3777 | + } | |
| 3778 | + console.log('拒绝授权'); | |
| 3779 | + reject(); | |
| 3780 | + } | |
| 3781 | + }) | |
| 3782 | + }) | |
| 3783 | + }, | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + // 保存图片到系统相册 | |
| 3787 | + saveImage(saveUrl) { | |
| 3788 | + var self = this; | |
| 3789 | + return new Promise((resolve, reject) => { | |
| 3790 | + wx.saveImageToPhotosAlbum({ | |
| 3791 | + filePath: saveUrl, | |
| 3792 | + success: (res) => { | |
| 3793 | + wx.showToast({ | |
| 3794 | + title: '保存成功', | |
| 3795 | + duration: 1000, | |
| 3796 | + }); | |
| 3797 | + self.setData({ | |
| 3798 | + showPlaybill: 'true' | |
| 3799 | + }); | |
| 3800 | + resolve(); | |
| 3801 | + }, | |
| 3802 | + fail: () => { | |
| 3803 | + wx.showToast({ | |
| 3804 | + title: '保存失败', | |
| 3805 | + duration: 1000, | |
| 3806 | + }); | |
| 3807 | + } | |
| 3808 | + }) | |
| 3809 | + }) | |
| 3810 | + }, | |
| 3811 | + | |
| 3812 | + previewImage() { | |
| 3813 | + this.data.show_prew_img = 1; | |
| 3814 | + wx.previewImage({ | |
| 3815 | + //将图片预览出来 | |
| 3816 | + urls: [this.data.shareImgPath] | |
| 3817 | + }); | |
| 3818 | + }, | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + onShareTimeline() { | |
| 3822 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
| 3823 | + if (!store_name) | |
| 3824 | + store_name = getApp().globalData.setting.appName; | |
| 3825 | + return { | |
| 3826 | + title: this.data.data.goods_name + '-' + store_name, | |
| 3827 | + imageUrl: this.data.gallery[0].image_url, | |
| 3828 | + } | |
| 3829 | + }, | |
| 3830 | + | |
| 3831 | + clickCollapse() { | |
| 3832 | + this.setData({ flag: !this.data.flag, }) | |
| 3833 | + }, | |
| 3834 | + | |
| 3835 | + clickShare() { | |
| 3836 | + this.setData({ share_hidden: true, }); | |
| 3837 | + }, | |
| 3838 | + | |
| 3839 | + send() { | |
| 3840 | + this.setData({ share_hidden: false, }); | |
| 3841 | + }, | |
| 3842 | + | |
| 3843 | + cancel() { | |
| 3844 | + this.setData({ | |
| 3845 | + share_hidden: false, | |
| 3846 | + }); | |
| 3847 | + }, | |
| 3848 | + | |
| 3849 | + //积分购和拼团的普通购买的的时候,要判断有没有全场优惠活动 | |
| 3850 | + check_nor_promgood(goods_id, back) { | |
| 3851 | + getApp().request.get("/api/weshop/goods/getGoodsPromNormal/" + os.stoid + "/" + goods_id, { | |
| 3852 | + success: function (res) { | |
| 3853 | + if (res.data.code == 0 && res.data.data && res.data.data.promGoodsLists && res.data.data.promGoodsLists.length > 0) { | |
| 3854 | + var obj = { | |
| 3855 | + act_id: res.data.data.promGoodsLists[0].prom_id, | |
| 3856 | + } | |
| 3857 | + back(obj); | |
| 3858 | + } else { | |
| 3859 | + back(0) | |
| 3860 | + } | |
| 3861 | + } | |
| 3862 | + }) | |
| 3863 | + }, | |
| 3864 | + | |
| 3865 | + //获取预售的信息 | |
| 3866 | + async get_pre_prom(func) { | |
| 3867 | + var th = this; | |
| 3868 | + var presell_id = null; | |
| 3869 | + var pre_arr = null; | |
| 3870 | + | |
| 3871 | + if (!th.data.pre_id) { | |
| 3872 | + var presell_id = th.data.presell_id; | |
| 3873 | + var url = "/api/weshop/marketing/marketingPresellList/list" | |
| 3874 | + var rd = { | |
| 3875 | + store_id: os.stoid, | |
| 3876 | + presell_id: presell_id, | |
| 3877 | + goods_id: th.data.gid | |
| 3878 | + } | |
| 3879 | + //------获取预售从表---------- | |
| 3880 | + await getApp().request.promiseGet(url, { | |
| 3881 | + data: rd | |
| 3882 | + }).then(res => { | |
| 3883 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
| 3884 | + var arr = res.data.data[0]; | |
| 3885 | + presell_id = arr.presell_id; | |
| 3886 | + th.setData({ | |
| 3887 | + presellList: arr, | |
| 3888 | + }) | |
| 3889 | + } | |
| 3890 | + }) | |
| 3891 | + | |
| 3892 | + } else { | |
| 3893 | + //------获取预售从表---------- | |
| 3894 | + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/get/" + os.stoid + "/" + th.data.pre_id, {}).then(res => { | |
| 3895 | + if (res.data.code == 0 && res.data.data) { | |
| 3896 | + var arr = res.data.data; | |
| 3897 | + presell_id = arr.presell_id; | |
| 3898 | + th.setData({ | |
| 3899 | + presellList: arr, | |
| 3900 | + }) | |
| 3901 | + } | |
| 3902 | + }) | |
| 3903 | + } | |
| 3904 | + | |
| 3905 | + if (!presell_id) { | |
| 3906 | + wx.showToast({title: "未找到活动商品", icon: 'none', duration: 3000}); | |
| 3907 | + ut.wx_back(); | |
| 3908 | + return false; | |
| 3909 | + } | |
| 3910 | + | |
| 3911 | + var gnext=1; | |
| 3912 | + //------获取预售主表---------- | |
| 3913 | + await getApp().request.promiseGet(`/api/weshop/marketing/marketingPresellForm/get/${os.stoid}/${presell_id}`, {}).then(res => { | |
| 3914 | + if (res.data.code == 0 && res.data.data) { | |
| 3915 | + var act_data = res.data.data; | |
| 3916 | + if (act_data.is_end) { | |
| 3917 | + wx.showToast({title: "活动已经结束", icon: 'none', duration: 3000}); | |
| 3918 | + setTimeout(function () { | |
| 3919 | + ut.wx_back(); | |
| 3920 | + }, 2000) | |
| 3921 | + gnext=0; | |
| 3922 | + return false; | |
| 3923 | + } | |
| 3924 | + if (act_data.isuse == 0) { | |
| 3925 | + wx.showToast({title: "活动未启用", icon: 'none', duration: 3000}); | |
| 3926 | + setTimeout(function () { | |
| 3927 | + ut.wx_back(); | |
| 3928 | + }, 2000) | |
| 3929 | + gnext=0; | |
| 3930 | + return false; | |
| 3931 | + } | |
| 3932 | + | |
| 3933 | + var err_txt="活动定金时间已经结束"; | |
| 3934 | + var end_time = act_data.end_time; | |
| 3935 | + if (act_data.presell_type == 0) { | |
| 3936 | + end_time = act_data.pay_enddate; | |
| 3937 | + err_txt="活动尾款时间已经结束"; | |
| 3938 | + } | |
| 3939 | + if (end_time < ut.gettimestamp()) { | |
| 3940 | + wx.showToast({title:err_txt, icon: 'none', duration: 3000}); | |
| 3941 | + setTimeout(function () { | |
| 3942 | + ut.wx_back(); | |
| 3943 | + }, 2000) | |
| 3944 | + gnext=0; | |
| 3945 | + return false; | |
| 3946 | + } | |
| 3947 | + // 判断活动是否开始 | |
| 3948 | + // if (act_data.start_time > ut.gettimestamp()) { | |
| 3949 | + // wx.showToast({title:"活动还未开始", icon: 'none', duration: 3000}); | |
| 3950 | + // setTimeout(function () { | |
| 3951 | + // ut.wx_back(); | |
| 3952 | + // }, 2000) | |
| 3953 | + // gnext=0; | |
| 3954 | + // return false; | |
| 3955 | + // } | |
| 3956 | + th.setData({ | |
| 3957 | + presellForm: res.data.data, | |
| 3958 | + }); | |
| 3959 | + th.countDown(res.data.data.start_time) | |
| 3960 | + } | |
| 3961 | + | |
| 3962 | + }) | |
| 3963 | + | |
| 3964 | + if(!gnext){ | |
| 3965 | + return false; | |
| 3966 | + } | |
| 3967 | + | |
| 3968 | + var userInfo = getApp().globalData.userInfo; | |
| 3969 | + var pre_data = { | |
| 3970 | + store_id: os.stoid, | |
| 3971 | + is_end: 0, | |
| 3972 | + timetype: 0, | |
| 3973 | + isuse: 1, | |
| 3974 | + prom_type: 8, | |
| 3975 | + prom_id: | |
| 3976 | + presell_id, | |
| 3977 | + pageSize:1000 | |
| 3978 | + }; | |
| 3979 | + if (userInfo) { | |
| 3980 | + pre_data.user_id = userInfo.user_id; | |
| 3981 | + } | |
| 3982 | + await getApp().request.promiseGet("/api/weshop/marketing/marketingPresellList/page", { | |
| 3983 | + data: pre_data, | |
| 3984 | + }).then(e => { | |
| 3985 | + if (e.data.code == 0 && e.data.data.pageData && e.data.data.pageData.length > 0) { | |
| 3986 | + | |
| 3987 | + th.data.all_pre_goods = e.data.data.pageData; | |
| 3988 | + var idx = e.data.data.pageData.findIndex(function (ele) { | |
| 3989 | + return ele.id == th.data.presellList.id; | |
| 3990 | + }) | |
| 3991 | + | |
| 3992 | + pre_arr = e.data.data.pageData[idx]; | |
| 3993 | + th.setData({pre_arr: pre_arr,show:1}) | |
| 3994 | + th.data.prom_buy_limit = pre_arr.vip_butyqty; | |
| 3995 | + } | |
| 3996 | + }) | |
| 3997 | + | |
| 3998 | + | |
| 3999 | + // if (!pre_arr) { | |
| 4000 | + // wx.showToast({title: "当前会员身份不符或者时间已过期,无法参与", icon: 'none', duration: 3000}); | |
| 4001 | + // setTimeout(function () { | |
| 4002 | + // ut.wx_back(); | |
| 4003 | + // }, 2000) | |
| 4004 | + // return false; | |
| 4005 | + // } | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + if (func) { | |
| 4009 | + func(); | |
| 4010 | + } | |
| 4011 | + }, | |
| 4012 | + | |
| 4013 | + con_weixin:function () { | |
| 4014 | + var url=this.data.sys_switch.weapp_customertype_url; | |
| 4015 | + var id=this.data.sys_switch.weapp_customertype_appid; | |
| 4016 | + wx.openCustomerServiceChat({ | |
| 4017 | + extInfo: {url: url}, | |
| 4018 | + corpId: id, | |
| 4019 | + success(res) {} | |
| 4020 | + }) | |
| 4021 | + } | |
| 4022 | + | |
| 4023 | +}); | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.json
0 → 100644
| 1 | +{ | |
| 2 | + "navigationBarTitleText": "商品详情", | |
| 3 | + "enablePullDownRefresh": false, | |
| 4 | + "usingComponents": { | |
| 5 | + "nav_box": "/components/nav_box/nav_box", | |
| 6 | + "warn": "/components/long_warn/long_warn", | |
| 7 | + "goods_recommend": "/components/goods_list/goods_list", | |
| 8 | + "share": "/components/share/share" | |
| 9 | + } | |
| 10 | +} | |
| 0 | 11 | \ No newline at end of file | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.wxml
0 → 100644
| 1 | +<import src="../../../../utils/wxParse/wxParse.wxml"></import> | |
| 2 | +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | |
| 3 | +<wxs module="g_filters" src="g_filter.wxs"></wxs> | |
| 4 | +<wxs module="tool" src="filter.wxs"></wxs> | |
| 5 | + | |
| 6 | + | |
| 7 | +<block wx:if="{{show}}"> | |
| 8 | +<!-- 商品内容区域,普通商品,秒杀,拼团 --> | |
| 9 | +<view class="container"> | |
| 10 | + <view class="type-navbar"> | |
| 11 | + <view class="type-box" wx:for="{{categories}}" wx:key="categories"> | |
| 12 | + <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> | |
| 13 | + {{item.name}} | |
| 14 | + </view> | |
| 15 | + </view> | |
| 16 | + </view> | |
| 17 | + <view class="goods-detail"> | |
| 18 | + <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}"> | |
| 19 | + | |
| 20 | + <!-- 历史购买记录 --> | |
| 21 | + <view class="swiper-container"> | |
| 22 | + <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000"> | |
| 23 | + <swiper-item class="swiper-item" wx:for=""> | |
| 24 | + <view class="item"> | |
| 25 | + <view class="avatar-container"> | |
| 26 | + <image src=""></image> | |
| 27 | + </view> | |
| 28 | + <view class="flex ai_c pd10"> | |
| 29 | + <view class="nickname ellipsis-1x">abson下单成功</view> | |
| 30 | + </view> | |
| 31 | + </view> | |
| 32 | + </swiper-item> | |
| 33 | + </swiper> | |
| 34 | + </view> | |
| 35 | + <!-- 视频 --> | |
| 36 | + <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}" | |
| 37 | + indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> --> | |
| 38 | + <view id="id" bindtouchstart="handletouchtart" bindtouchmove="handletouchmove"> | |
| 39 | + <view class="xc-videos-picture rel"> | |
| 40 | + <swiper autoplay="{{false}}" current="{{swiperCurrent}}" class="swiper_box swiperContainer rel" duration="{{1000}}" indicatorDots="{{mapurl?false:true}}" interval="{{3000}}" vertical="{{false}}" bindchange="swiperChange"> | |
| 41 | + <swiper-item wx:if="{{mapurl}}"> | |
| 42 | + <view wx:if="{{noon == 0}}"> | |
| 43 | + <image class="xc-picturess" src="{{iurl+mapurl_f_img}}" mode="aspectFit"> | |
| 44 | + <image id="{{index}}" class="xc-play" src="{{iurl}}/miniapp/images/pofang.png" bindtap="videoPlay"></image> | |
| 45 | + </image> | |
| 46 | + </view> | |
| 47 | + <view wx:else> | |
| 48 | + <video class="xc-videos" src="{{iurl+mapurl}}" id="{{index}}" wx:if="{{_index == index}}"></video> | |
| 49 | + </view> | |
| 50 | + </swiper-item> | |
| 51 | + <swiper-item wx:for="{{gallery}}" wx:key="gallery"> | |
| 52 | + <!-- <image class="wh100" src="{{item.image_url}}" mode="aspectFit" binderror="bind_bnerr" lazy-load="true" data-errorimg="gallery[{{index}}].image_url"></image> --> | |
| 53 | + <view class="wh100 g_img_box" style="background-image:url({{item.image_url}});"></view> | |
| 54 | + </swiper-item> | |
| 55 | + </swiper> | |
| 56 | + <block wx:if="{{mapurl}}"> | |
| 57 | + <view wx:if="{{hiddenn==1}}"> | |
| 58 | + <view class="xc-imageCount">{{current}}/{{gallery.length}}</view> | |
| 59 | + </view> | |
| 60 | + <view class="xc-video-picture abs"> | |
| 61 | + <view class="xc-video" data-vipi="0" bindtap="videopicture"> | |
| 62 | + <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}"> | |
| 63 | + 视频 | |
| 64 | + </view> | |
| 65 | + </view> | |
| 66 | + <view class="xc-picture {{videopicture==1 ? 'xc-sn':''}}" data-vipi="1" bindtap="videopicture"> | |
| 67 | + <view>图片</view> | |
| 68 | + </view> | |
| 69 | + </view> | |
| 70 | + </block> | |
| 71 | + </view> | |
| 72 | + </view> | |
| 73 | + <view class="goo"> | |
| 74 | + <view class="pt_view rel"> | |
| 75 | + <!-- 许程 7. 24 --> | |
| 76 | + <image class="secondkill-img" src="{{iurl+'/miniapp/images/red_jx.png'}}"></image> | |
| 77 | + <!-- <view class=""> --> | |
| 78 | + <!-- <view class="flex" style='height:40rpx; margin-top:5rpx;'> --> | |
| 79 | + <view class="abs xc-qt-price fs28 xc-qtsign">预售价</view> | |
| 80 | + <view class="abs flex presell_price"> | |
| 81 | + <view class="fs28 val" style="margin-right:100rpx">¥{{presellList.presell_price}}</view> | |
| 82 | + <view class="word-line fs26 xc-qtunit-price"> | |
| 83 | + 零售价¥{{filters.toFix(data.market_price,2)}} | |
| 84 | + </view> | |
| 85 | + </view> | |
| 86 | + | |
| 87 | + | |
| 88 | + <block> | |
| 89 | + <!-- </view> --> | |
| 90 | + <view class="hy-stop word-color fs26 abs" style="color:#059de5;">距活动开始还有</view> | |
| 91 | + <view class="secview flex abs fs24 " style="color: black;right: 3px; top:46rpx;"> | |
| 92 | + <block wx:if="djs.day"> | |
| 93 | + <view class='day-val' style="color:#059de5;margin-top:-34rpx;"> | |
| 94 | + {{djs.day}} | |
| 95 | + </view> | |
| 96 | + <view class="day white" style="margin-top:-34rpx;margin-right:10rpx;color:#059de5"> | |
| 97 | + 天 | |
| 98 | + </view> | |
| 99 | + </block> | |
| 100 | + <view class='xc-time-val white t-c' style="background:#059de5"> | |
| 101 | + {{djs.hou}} | |
| 102 | + </view> | |
| 103 | + <view class="xc-time" style="color:#059de5">时</view> | |
| 104 | + <view class='xc-time-val white t-c' style="background:#059de5"> | |
| 105 | + {{djs.min}} | |
| 106 | + </view> | |
| 107 | + <view class="xc-time" style="color:#059de5">分</view> | |
| 108 | + <view class='xc-time-val white t-c' style="background:#059de5;"> | |
| 109 | + {{djs.sec}} | |
| 110 | + </view> | |
| 111 | + <view class="xc-time" style="color:#059de5">秒</view> | |
| 112 | + </view> | |
| 113 | + </block> | |
| 114 | + </view> | |
| 115 | + <view class="pt_fir pd20"> | |
| 116 | + <!-- --显示团类型和团价格-- --> | |
| 117 | + <view class="pt_fir_title "> | |
| 118 | + <view class="xc-goods-explain flex-vertical-between"> | |
| 119 | + <view class="xc-explain fs32 ellipsis-2"> | |
| 120 | + {{data.goods_name}} | |
| 121 | + </view> | |
| 122 | + <!-- 这个是分享按钮 --> | |
| 123 | + <view class="xc-share-frame t-c" bindtap="clickShare"> | |
| 124 | + <view class="iconfont icon-share fs60"></view> | |
| 125 | + <view class="fs22 c-7b">分享</view> | |
| 126 | + </view> | |
| 127 | + </view> | |
| 128 | + </view> | |
| 129 | + <view wx:if="{{presellForm.presell_type==0}}" class="fs24" style="padding-bottom:20rpx"> | |
| 130 | + <view class="stock" style="color:#999">尾款:{{filters.format_time(presellForm.pay_begindate,1)}}-{{filters.format_time(presellForm.pay_enddate,1)}}</view> | |
| 131 | + </view> | |
| 132 | + <view class="goods-num"> | |
| 133 | + <block wx:if="{{presellList.virtual_qty}}"> | |
| 134 | + <view class="stock">总数量:{{presellList.presell_sumqty+presellList.virtual_qty}}件</view> | |
| 135 | + <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> | |
| 136 | + <view class="stock" wx:else>限购:不限</view> | |
| 137 | + <view class="sales">已购:{{presellList.buy_goodnum+presellList.virtual_qty}}件</view> | |
| 138 | + </block> | |
| 139 | + <block wx:else> | |
| 140 | + <view class="stock">总数量:{{presellList.presell_sumqty}}件</view> | |
| 141 | + <view class="stock" wx:if="{{presellList.vip_butyqty}}">限购:{{presellList.vip_butyqty}}件</view> | |
| 142 | + <view class="stock" wx:else>限购:不限</view> | |
| 143 | + <view class="sales">已购:{{presellList.buy_goodnum}}件</view> | |
| 144 | + </block> | |
| 145 | + </view> | |
| 146 | + </view> | |
| 147 | + <view class="t_gz" wx:if="{{is_show_gz==1}}">{{prom_act.remark}}</view> | |
| 148 | + </view> | |
| 149 | + <!-- 门店收货地址 --> | |
| 150 | + <view class="xc-address_frame bdt16 flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}"> | |
| 151 | + <view class="address_frame" bindtap="choice_store" data-ind="0"> | |
| 152 | + <view class="flex-vertical-between "> | |
| 153 | + <view class="flex-vertical select_store_height"> | |
| 154 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 155 | + <view class="fs30" style="color:black;">选择门店</view> | |
| 156 | + </view> | |
| 157 | + <view class="red_bb fs26">更多门店<text class="bg_jj"></text></view> | |
| 158 | + </view> | |
| 159 | + <view wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
| 160 | + <view class="flex-space-between address ai_end pdv10"> | |
| 161 | + <view> | |
| 162 | + <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text> | |
| 163 | + </view> | |
| 164 | + <view class="distance fs24" wx:if="{{def_pick_store.distance!=null}}"> | |
| 165 | + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 166 | + </view> | |
| 167 | + </view> | |
| 168 | + <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | |
| 169 | + <block wx:else> | |
| 170 | + <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | |
| 171 | + (库存不足) | |
| 172 | + </view> | |
| 173 | + <block wx:else> | |
| 174 | + <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> | |
| 175 | + (配送不匹配2) | |
| 176 | + </view> | |
| 177 | + <view class="no_store" wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | |
| 178 | + (库存不足) | |
| 179 | + </view> | |
| 180 | + </block> | |
| 181 | + </block> | |
| 182 | + <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view> | |
| 183 | + </view> | |
| 184 | + </view> | |
| 185 | + </view> | |
| 186 | + <!-- - 宝贝评价 -- --> | |
| 187 | + <view class="bdt16"> | |
| 188 | + <view class="bb_view"> | |
| 189 | + <view class="bold">宝贝评价({{categories3[0].num}})</view> | |
| 190 | + <view class="red_bb fs26" bindtap="look_pj"> | |
| 191 | + 查看全部 | |
| 192 | + <text class="bg_jj"></text> | |
| 193 | + </view> | |
| 194 | + </view> | |
| 195 | + <view class="xc_comment"> | |
| 196 | + <view class="xc_comment-have-pictures" data-val="5" bindtap="clik_evaluate"> | |
| 197 | + 有图({{categories3[1].num}}) | |
| 198 | + </view> | |
| 199 | + <view class="xc_comment-discuss" data-val="2" bindtap="clik_evaluate"> | |
| 200 | + 好评({{categories3[2].num}}) | |
| 201 | + </view> | |
| 202 | + <view class="xc_comment-discuss" data-val="3" bindtap="clik_evaluate"> | |
| 203 | + 中评({{categories3[3].num}}) | |
| 204 | + </view> | |
| 205 | + <view class="xc_comment-discuss" data-val="4" bindtap="clik_evaluate"> | |
| 206 | + 差评({{categories3[4].num}}) | |
| 207 | + </view> | |
| 208 | + </view> | |
| 209 | + <scroll-view scroll-x="true" class="pj_scroll"> | |
| 210 | + <view class="flex"> | |
| 211 | + <view class="xc_comment-detail" style="" wx:for="{{fir_comments}}" wx:key="fir_comments"> | |
| 212 | + <view class="xc_comment-left"> | |
| 213 | + <view class="xc_comment-user"> | |
| 214 | + <view class="xc_user-img"> | |
| 215 | + <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> | |
| 216 | + </view> | |
| 217 | + <view class="xc_user"> | |
| 218 | + <view class="xc_user-name five-level-word"> | |
| 219 | + {{item.is_anonymous!=1?item.username:'匿名'}} | |
| 220 | + </view> | |
| 221 | + <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | |
| 222 | + </view> | |
| 223 | + </view> | |
| 224 | + <view class="xc_comment-font pj_word_size ellipsis-1 pdt12"> | |
| 225 | + <text class="ellipsis-1">{{item.content?item.content:'此用户没有填写评价。'}}</text> | |
| 226 | + </view> | |
| 227 | + <view class="xc_comment-val"> | |
| 228 | + <view class="xc_comment-time">{{item.add_time}}</view> | |
| 229 | + </view> | |
| 230 | + </view> | |
| 231 | + <view class="xc_goods-img-frame"> | |
| 232 | + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> | |
| 233 | + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image> | |
| 234 | + <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image> | |
| 235 | + </view> | |
| 236 | + </view> | |
| 237 | + </view> | |
| 238 | + </scroll-view> | |
| 239 | + </view> | |
| 240 | + <!-- 图文详情 --> | |
| 241 | + <view class="bdt16"> | |
| 242 | + <view class="t_g_info"> | |
| 243 | + <view class="red_shu"></view> | |
| 244 | + <view class="fs30 bold">商品详情</view> | |
| 245 | + </view> | |
| 246 | + <view class="pd20"> | |
| 247 | + <view class="table_s"> | |
| 248 | + <view class="tb_item tb-l"> | |
| 249 | + <view class="item_left"> | |
| 250 | + <text>商品名称</text> | |
| 251 | + </view> | |
| 252 | + <view class="item_right"> | |
| 253 | + <text>{{data.goods_name}}</text> | |
| 254 | + </view> | |
| 255 | + </view> | |
| 256 | + <view class="tb_item tb-l"> | |
| 257 | + <view class="item_left"> | |
| 258 | + <text>商品编号</text> | |
| 259 | + </view> | |
| 260 | + <view class="item_right"> | |
| 261 | + <text>{{data.goods_sn}}</text> | |
| 262 | + </view> | |
| 263 | + </view> | |
| 264 | + <view class="tb_item tb-l"> | |
| 265 | + <view class="item_left"> | |
| 266 | + <text>商品条码</text> | |
| 267 | + </view> | |
| 268 | + <view class="item_right"> | |
| 269 | + <text>{{data.sku}}</text> | |
| 270 | + </view> | |
| 271 | + </view> | |
| 272 | + <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> | |
| 273 | + <view class="item_left"> | |
| 274 | + <text>品类</text> | |
| 275 | + </view> | |
| 276 | + <view class="item_right"> | |
| 277 | + <text>{{cat_name}}</text> | |
| 278 | + </view> | |
| 279 | + </view> | |
| 280 | + <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}"> | |
| 281 | + <view class="item_left"> | |
| 282 | + <text>品牌</text> | |
| 283 | + </view> | |
| 284 | + <view class="item_right"> | |
| 285 | + <text>{{brand_name}}</text> | |
| 286 | + </view> | |
| 287 | + </view> | |
| 288 | + <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}"> | |
| 289 | + <view class="item_left"> | |
| 290 | + <text>国别</text> | |
| 291 | + </view> | |
| 292 | + <view class="item_right"> | |
| 293 | + <text>{{nation_name}}</text> | |
| 294 | + </view> | |
| 295 | + </view> | |
| 296 | + <view class="tb_item tb-l"> | |
| 297 | + <view class="item_left"> | |
| 298 | + <text>规格</text> | |
| 299 | + </view> | |
| 300 | + <view class="item_right"> | |
| 301 | + <text>{{filters.show_gui_ge(data.goods_spec,data.goods_color)}}</text> | |
| 302 | + </view> | |
| 303 | + </view> | |
| 304 | + <view class="tb_item tb-l"> | |
| 305 | + <view class="item_left"> | |
| 306 | + <text>上架时间</text> | |
| 307 | + </view> | |
| 308 | + <view class="item_right"> | |
| 309 | + <text>{{data.on_time}}</text> | |
| 310 | + </view> | |
| 311 | + </view> | |
| 312 | + </view> | |
| 313 | + </view> | |
| 314 | + <!-- 详情图片 --> | |
| 315 | + <view class="wxParse"> | |
| 316 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
| 317 | + </view> | |
| 318 | + </view> | |
| 319 | + <!-- 推荐商品 --> | |
| 320 | + <view class="flex-center rel xc-linellae-frame"> | |
| 321 | + <view class="xc-linellae"></view> | |
| 322 | + <view class="abs flex-center xc-recommend-frame "> | |
| 323 | + <image class=" xc-recommend" src="{{iurl}}/miniapp/images/diamond.png"></image> | |
| 324 | + <view class="xc-recommend-word">推荐</view> | |
| 325 | + </view> | |
| 326 | + </view> | |
| 327 | + <goods_recommend id="goods_list"></goods_recommend> | |
| 328 | + <!-- 技术支持 --> | |
| 329 | + <view class="logo-container t-c"> | |
| 330 | + <view class="flex ai_c fs24 jc-center pdv30 white"> | |
| 331 | + <image src="{{iurl + 'miniapp/images/luckDraw/logo.png?v=3'}}" class="logo" lazy-load></image> | |
| 332 | + 提供技术支持 | |
| 333 | + </view> | |
| 334 | + </view> | |
| 335 | + </view> | |
| 336 | + <!-- ----------商品详情图片页面-------------- --> | |
| 337 | + <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}"> | |
| 338 | + <view class="table_s"> | |
| 339 | + <view class="tb_item tb-l"> | |
| 340 | + <view class="item_left"> | |
| 341 | + <text>商品名称</text> | |
| 342 | + </view> | |
| 343 | + <view class="item_right"> | |
| 344 | + <text>{{data.goods_name}}</text> | |
| 345 | + </view> | |
| 346 | + </view> | |
| 347 | + <view class="tb_item tb-l"> | |
| 348 | + <view class="item_left"> | |
| 349 | + <text>商品编号</text> | |
| 350 | + </view> | |
| 351 | + <view class="item_right"> | |
| 352 | + <text>{{data.goods_sn}}</text> | |
| 353 | + </view> | |
| 354 | + </view> | |
| 355 | + <view class="tb_item tb-l"> | |
| 356 | + <view class="item_left"> | |
| 357 | + <text>商品条码</text> | |
| 358 | + </view> | |
| 359 | + <view class="item_right"> | |
| 360 | + <text>{{data.sku}}</text> | |
| 361 | + </view> | |
| 362 | + </view> | |
| 363 | + <view class="tb_item tb-l" wx:if="{{cat_name && is_show_pl}}"> | |
| 364 | + <view class="item_left"> | |
| 365 | + <text>品类</text> | |
| 366 | + </view> | |
| 367 | + <view class="item_right"> | |
| 368 | + <text>{{cat_name}}</text> | |
| 369 | + </view> | |
| 370 | + </view> | |
| 371 | + <view class="tb_item tb-l" wx:if="{{brand_name && is_show_pp}}"> | |
| 372 | + <view class="item_left"> | |
| 373 | + <text>品牌</text> | |
| 374 | + </view> | |
| 375 | + <view class="item_right"> | |
| 376 | + <text>{{brand_name}}</text> | |
| 377 | + </view> | |
| 378 | + </view> | |
| 379 | + <view class="tb_item tb-l" wx:if="{{nation_name && is_show_gb}}"> | |
| 380 | + <view class="item_left"> | |
| 381 | + <text>国别</text> | |
| 382 | + </view> | |
| 383 | + <view class="item_right"> | |
| 384 | + <text>{{nation_name}}</text> | |
| 385 | + </view> | |
| 386 | + </view> | |
| 387 | + <view class="tb_item tb-l"> | |
| 388 | + <view class="item_left"> | |
| 389 | + <text>规格</text> | |
| 390 | + </view> | |
| 391 | + <view class="item_right"> | |
| 392 | + <text>{{data.goods_spec==""?"规格1":data.goods_spec}}</text> | |
| 393 | + </view> | |
| 394 | + </view> | |
| 395 | + <view class="tb_item tb-l"> | |
| 396 | + <view class="item_left"> | |
| 397 | + <text>上架时间</text> | |
| 398 | + </view> | |
| 399 | + <view class="item_right"> | |
| 400 | + <text>{{data.on_time}}</text> | |
| 401 | + </view> | |
| 402 | + </view> | |
| 403 | + </view> | |
| 404 | + <view class="wxParse"> | |
| 405 | + <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> | |
| 406 | + </view> | |
| 407 | + </view> | |
| 408 | + <!-- -------------评价页面------------ --> | |
| 409 | + <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}"> | |
| 410 | + <view class="topframe"> | |
| 411 | + <view class="topframe-top"> | |
| 412 | + <view class="topframe-top-content"> | |
| 413 | + <view>宝贝评价</view> | |
| 414 | + <view class="topframe-top-val">({{categories3[0].num}})</view> | |
| 415 | + </view> | |
| 416 | + <view class="topframe-praise" wx:if="{{categories3[0].num}}"> | |
| 417 | + 好评{{ filters.toFix(categories3[2].num/categories3[0].num*100,2) }}% | |
| 418 | + </view> | |
| 419 | + <view wx:else>好评 0%</view> | |
| 420 | + </view> | |
| 421 | + <view class="buttem-list"> | |
| 422 | + <view bindtap="tabClick3" id="{{item.id}}" wx:for="{{categories3}}" wx:key="categories3" class="item {{activeCategoryId3==item.id?'red':''}}"> | |
| 423 | + {{item.name}}({{item.num}}) | |
| 424 | + </view> | |
| 425 | + </view> | |
| 426 | + </view> | |
| 427 | + <block wx:for="{{comments}}" wx:for-index="cIdx" wx:key="cIdx"> | |
| 428 | + <view style='border-bottom:4rpx solid #eee;'> | |
| 429 | + <view class="middle"> | |
| 430 | + <view class="middle-img-frame"> | |
| 431 | + <image class="middle-img" src="{{item.is_anonymous!=1?item.head_pic:iurl+'/miniapp/images/hui_hear_pic.png'}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image> | |
| 432 | + <view class="middle-user-frame"> | |
| 433 | + <view class="middle-user"> | |
| 434 | + {{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}} | |
| 435 | + </view> | |
| 436 | + <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> | |
| 437 | + </view> | |
| 438 | + </view> | |
| 439 | + <view class="xc-pirces"> | |
| 440 | + <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}"> | |
| 441 | + {{item.content?item.content:'此用户没有填写评价。'}} | |
| 442 | + </view> | |
| 443 | + </view> | |
| 444 | + <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'> | |
| 445 | + 全部显示 | |
| 446 | + </view> | |
| 447 | + <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'> | |
| 448 | + 收起 | |
| 449 | + </view> | |
| 450 | + <view class="img-ul"> | |
| 451 | + <block wx:if="{{item.source_type==0}}"> | |
| 452 | + <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}"> | |
| 453 | + <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" data-img="{{iurl}}{{item}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image> | |
| 454 | + </view> | |
| 455 | + </block> | |
| 456 | + <block wx:if="{{item.source_type==1}}"> | |
| 457 | + <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem"> | |
| 458 | + <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" data-img="{{aitem}}" data-id="{{index}}" src="{{aitem}}"></image> | |
| 459 | + </view> | |
| 460 | + </block> | |
| 461 | + </view> | |
| 462 | + <view class="z_parameter"> | |
| 463 | + <view class="parameter-font">{{item.add_time}}</view> | |
| 464 | + <view class="parameter-dian" bindtap="click_zan" data-com_id="{{item.comment_id}}" data-item_id="{{cIdx}}"> | |
| 465 | + <image wx:if="{{item.userZanNum==1}}" class="parameter-img" src="{{iurl}}/miniapp/images/zan_red.png"></image> | |
| 466 | + <image wx:else class="parameter-img" src="{{iurl}}/miniapp/images/dianzan.png"></image> | |
| 467 | + <view class="parameter-val" style='color:{{item.userZanNum==1? "#d60022":"#999" }}'> | |
| 468 | + {{item.zan_num}} | |
| 469 | + </view> | |
| 470 | + </view> | |
| 471 | + </view> | |
| 472 | + </view> | |
| 473 | + <view class="reply rel" wx:if="{{item.replay_list}}"> | |
| 474 | + <view class="line_bulge"></view> | |
| 475 | + <view class="shop-reply">店家回复:</view> | |
| 476 | + <view class="shop-font" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}"> | |
| 477 | + {{r_item.content}} | |
| 478 | + </view> | |
| 479 | + </view> | |
| 480 | + </view> | |
| 481 | + </block> | |
| 482 | + <block wx:if="{{(!comments || comments.length==0) && get_c }}"> | |
| 483 | + <text class="no_pj_list">暂无评价</text> | |
| 484 | + </block> | |
| 485 | + <block wx:if="{{comments.length>10 && comments_no_more}}"> | |
| 486 | + <text class="no_pj_list">已经加载到底部</text> | |
| 487 | + </block> | |
| 488 | + </view> | |
| 489 | + </view> | |
| 490 | +</view> | |
| 491 | +<!-- -滚动到顶部-- --> | |
| 492 | +<view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}"> | |
| 493 | + <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> | |
| 494 | +</view> | |
| 495 | +<!-- -----------------底部按钮------------------ --> | |
| 496 | +<view class="join-cart"> | |
| 497 | + <!-- bindtap="contactService" --> | |
| 498 | + <button wx:if="{{sys_switch.weapp_customertype==1}}" class="custom-service cart-ico new_split" open-type="contact" session-from="wechat|{{userInfo.user_id}}|{{userInfo.nickname}}|{{userInfo.head_pic}}"> | |
| 499 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 500 | + <view>客服</view> | |
| 501 | + </button> | |
| 502 | + | |
| 503 | + <view wx:elif="{{sys_switch.weapp_customertype==2}}" class="custom-service cart-ico new_split" bindtap="con_weixin"> | |
| 504 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 505 | + <view>客服</view> | |
| 506 | + </view> | |
| 507 | + | |
| 508 | + <view wx:else class="custom-service cart-ico new_split" bindtap="contactService"> | |
| 509 | + <image class="cs-img" src="{{iurl}}/miniapp/images/custom-service.png"></image> | |
| 510 | + <view>客服</view> | |
| 511 | + </view> | |
| 512 | + <view bindtap="collectGoods" class="custom-service cart-ico new_split"> | |
| 513 | + <image hidden="{{is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart.png"></image> | |
| 514 | + <image hidden="{{!is_collect}}" class="cs-img" src="{{iurl}}/miniapp/images/heart-h.png"></image> | |
| 515 | + <view>收藏</view> | |
| 516 | + </view> | |
| 517 | + <view class="shopping-cart cart-ico new_split"> | |
| 518 | + <navigator open-type="switchTab" url="/pages/cart/cart/cart"> | |
| 519 | + <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> | |
| 520 | + <view class="cart-num ellipsis-1">{{cartGoodsNum}}</view> | |
| 521 | + <view>购物车</view> | |
| 522 | + </navigator> | |
| 523 | + </view> | |
| 524 | + | |
| 525 | + <view class="fs24 f1 flex ai-center t-c white" style="background:#059de5;border-radius:10rpx;justify-content: center"> | |
| 526 | + <view style="padding: 0 6rpx"> | |
| 527 | + <view class="">{{filters.format_time(presellForm.end_time,2)}} 预售结束</view> | |
| 528 | + <!-- <view class="">08.30 23:59:59 开始发货</view> --> | |
| 529 | + <view class="" wx:if="{{presellForm.delivery_type==1}}">{{filters.format_time(presellForm.delivery_date,2)}} 开始发货</view> | |
| 530 | + <view class="" wx:else>付款{{presellForm.delivery_daynum}} 天后发货</view> | |
| 531 | + </view> | |
| 532 | + | |
| 533 | + <view class="line" data-ind="2" style="margin-left: 10rpx; padding-left: 10rpx"> | |
| 534 | + <block wx:if="{{presellForm.presell_type==0}}"> | |
| 535 | + <view class="">即将开始</view> | |
| 536 | + <view class="flex"> | |
| 537 | + 定金 | |
| 538 | + <text class="rmb">{{presellList.presell_money}}</text> | |
| 539 | + </view> | |
| 540 | + </block> | |
| 541 | + <block wx:else> | |
| 542 | + <view class="">支付金额</view> | |
| 543 | + <view class="flex"> | |
| 544 | + <text class="rmb" style="margin-left:10rpx;">{{presellList.presell_price}}</text> | |
| 545 | + </view> | |
| 546 | + </block> | |
| 547 | + </view> | |
| 548 | + </view> | |
| 549 | +</view> | |
| 550 | +<!-- 制作一个圆球导航 --> | |
| 551 | +<nav_box></nav_box> | |
| 552 | +</block> | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | +<!-- --弹起来,选择规格数量,普通商品购买和秒杀---- --> | |
| 557 | +<view hidden="{{!openSpecModal}}"> | |
| 558 | + <view bindtap="closeSpecModal" class="cover-layer"></view> | |
| 559 | + <view class="spec-model"> | |
| 560 | + <view class="pding"> | |
| 561 | + <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> | |
| 562 | + <view class="spec-goods"> | |
| 563 | + <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="sele_g.original_img"></image> | |
| 564 | + <view class="spec-goods-info"> | |
| 565 | + <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view> | |
| 566 | + <view class="flex ai_end xc-val-money"> | |
| 567 | + | |
| 568 | + <view class="spec-goods-price tag"> | |
| 569 | + <text class="fs20">¥</text>{{pre_arr.presell_money}} | |
| 570 | + </view> | |
| 571 | + <!-- 显示线下价格 --> | |
| 572 | + <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center"> | |
| 573 | + 券后¥<text class="fs32">{{sele_g.offline_price}}</text> | |
| 574 | + </view> | |
| 575 | + </view> | |
| 576 | + | |
| 577 | + <view class="flex"> | |
| 578 | + <view class="spec-goods-stock"> | |
| 579 | + 已售:{{pre_arr.buy_goodnum+pre_arr.virtual_qty}} | |
| 580 | + </view> | |
| 581 | + <view class="spec-goods-stock">可售:{{pre_arr.presell_sumqty-pre_arr.buy_goodnum}}</view> | |
| 582 | + </view> | |
| 583 | + | |
| 584 | + | |
| 585 | + </view> | |
| 586 | + <!-- 选择门店模块 --> | |
| 587 | + <view class="flex-space-between address ai_end xc-width "> | |
| 588 | + <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
| 589 | + <text class="fs30 xc-black3 shop_name bold">{{def_pick_store.pickup_name}}</text> | |
| 590 | + <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> | |
| 591 | + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 592 | + </view> | |
| 593 | + </view> | |
| 594 | + <!-- 没有门店的时候 --> | |
| 595 | + <view class="flex" bindtap="choice_store" wx:else> | |
| 596 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 597 | + <view class="fs30" style="color:black;">选择门店</view> | |
| 598 | + </view> | |
| 599 | + <view class="red-co fs28" bindtap="choice_store">更多门店<text class="right-arrow"></text></view> | |
| 600 | + </view> | |
| 601 | + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view> | |
| 602 | + <block wx:else> | |
| 603 | + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> | |
| 604 | + <block wx:else> | |
| 605 | + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配1)</view> | |
| 606 | + <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}"> | |
| 607 | + (库存不足) | |
| 608 | + </view> | |
| 609 | + </block> | |
| 610 | + </block> | |
| 611 | + <view class="fs24 xc-ash-9f xc-distance-top " wx:if="{{def_pick_store && def_pick_store.fulladdress}}"> | |
| 612 | + 地址:{{def_pick_store.fulladdress}} | |
| 613 | + </view> | |
| 614 | + </view> | |
| 615 | + <!-- 商品的属性项目 --> | |
| 616 | + <view class="xc-goods-attribute"> | |
| 617 | + <view hidden="{{ismend==1}}" class="spec-name">商品规格</view> | |
| 618 | + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;"> | |
| 619 | + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g"> | |
| 620 | + {{item.gg}} | |
| 621 | + </view> | |
| 622 | + </view> | |
| 623 | + </view> | |
| 624 | + <view class="b_num"> | |
| 625 | + <view>购买数量</view> | |
| 626 | + <view class="count"> | |
| 627 | + <view bindtap="{{goodsInputNum <= 1 ? '':'subCartNum'}}" class="sub {{goodsInputNum <= 1 ? 'active':''}}"> | |
| 628 | + - | |
| 629 | + </view> | |
| 630 | + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> | |
| 631 | + <view bindtap="addCartNum" class="add">+</view> | |
| 632 | + </view> | |
| 633 | + </view> | |
| 634 | + <!-- 提示再买多少优惠 --> | |
| 635 | + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}"> | |
| 636 | + 再买{{hui_condition.need}} | |
| 637 | + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text> | |
| 638 | + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text> | |
| 639 | + <text wx:if="{{hui_condition.past==1}}">,包邮</text> | |
| 640 | + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text> | |
| 641 | + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text> | |
| 642 | + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text> | |
| 643 | + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text> | |
| 644 | + </view> | |
| 645 | + </view> | |
| 646 | + <view class="spec-cart-btns"> | |
| 647 | + <view wx:if="{{def_pick_store && def_pick_store.is_no_dis}}" class="spec-cart-btn fs32" data-action="add" > | |
| 648 | + 门店的不匹配 | |
| 649 | + </view> | |
| 650 | + <block wx:else> | |
| 651 | + <!-- 根本就找不到门店 --> | |
| 652 | + <block wx:if="{{!only_pk && !def_pickpu_list}}"> | |
| 653 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">未找到门店</view> | |
| 654 | + </block> | |
| 655 | + <block wx:else> | |
| 656 | + <block wx:if="{{only_pk.length && !only_pk.length}}"> | |
| 657 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">未找到门店</view> | |
| 658 | + </block> | |
| 659 | + <block wx:else> | |
| 660 | + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}"> | |
| 661 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">未找到门店</view> | |
| 662 | + </block> | |
| 663 | + <block wx:else> | |
| 664 | + <block wx:if="{{!def_pick_store}}"> | |
| 665 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> | |
| 666 | + 请先选择门店 | |
| 667 | + </view> | |
| 668 | + </block> | |
| 669 | + <block wx:else> | |
| 670 | + | |
| 671 | + <!-- 线上销售 --> | |
| 672 | + <block wx:if="{{sele_g.store_count<=0 || pre_arr.presell_sumqty<=pre_arr.buy_goodnum }}"> | |
| 673 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | |
| 674 | + </block> | |
| 675 | + <block wx:else> | |
| 676 | + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" | |
| 677 | + data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy"> | |
| 678 | + <text wx:if="{{presellForm.presell_type==0}}">支付定金(¥{{pre_arr.presell_money}})</text> | |
| 679 | + <text wx:else>支付金额(¥{{pre_arr.presell_price}})</text> | |
| 680 | + </view> | |
| 681 | + </block> | |
| 682 | + | |
| 683 | + </block> | |
| 684 | + </block> | |
| 685 | + </block> | |
| 686 | + </block> | |
| 687 | + </block> | |
| 688 | + </view> | |
| 689 | + | |
| 690 | + | |
| 691 | + <view class="clear"></view> | |
| 692 | + <!-- 选择门店的列表 --> | |
| 693 | + <view hidden="{{ismend==0}}" class="sto_v"> | |
| 694 | + <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend"> | |
| 695 | + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image> | |
| 696 | + 选择门店 | |
| 697 | + </view> | |
| 698 | + <!-- ---第一级显示---- --> | |
| 699 | + <view class="itemlists" hidden="{{is_sec_mend==1}}"> | |
| 700 | + <block wx:if="{{is_show_sto_cat}}"> | |
| 701 | + <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}"> | |
| 702 | + {{item.name}} | |
| 703 | + </view> | |
| 704 | + </block> | |
| 705 | + <block wx:else> | |
| 706 | + <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}"> | |
| 707 | + {{item.pickup_name}} | |
| 708 | + </view> | |
| 709 | + </block> | |
| 710 | + </view> | |
| 711 | + <!-- ---第二级显示---- --> | |
| 712 | + <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend"> | |
| 713 | + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image> | |
| 714 | + {{sec_sto.name}} | |
| 715 | + </view> | |
| 716 | + <view class="itemlists" hidden="{{is_sec_mend==0}}"> | |
| 717 | + <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}"> | |
| 718 | + {{item.pickup_name}} | |
| 719 | + </view> | |
| 720 | + </view> | |
| 721 | + </view> | |
| 722 | + </view> | |
| 723 | +</view> | |
| 724 | + | |
| 725 | +<!-- --弹起来优惠信息---- --> | |
| 726 | +<view hidden="{{!openPromModal}}"> | |
| 727 | + <view bindtap="closePromModal" class="cover-layer"></view> | |
| 728 | + <view class="prom-model"> | |
| 729 | + <icon bindtap="closePromModal" class="modal-close" color="gray" size="22" type="cancel"></icon> | |
| 730 | + <view class="prom-title">优惠信息</view> | |
| 731 | + <view class="logistics-item" wx:for="{{select.activity.data}}" wx:key="{{index}}"> | |
| 732 | + <view class="item-title"> | |
| 733 | + <text class="prom-item">{{item.title}}</text> | |
| 734 | + </view> | |
| 735 | + <view class="item-mes ellipsis-1">{{item.content}}</view> | |
| 736 | + </view> | |
| 737 | + </view> | |
| 738 | +</view> | |
| 739 | + | |
| 740 | +<!-- --弹起领券-- --> | |
| 741 | +<view wx:if='{{coupon==1}}'> | |
| 742 | + <view class="cover-layer flex-center" data-coupon='0' bindtap="switchCoupon"></view> | |
| 743 | + <view class="cx-popup {{coupon== true ? 'up' : 'down'}} "> | |
| 744 | + <view class="top-frame"> | |
| 745 | + <!-- <view class="top two-level-word t-c"> --> | |
| 746 | + <view class="top t-c">优惠券领取</view> | |
| 747 | + </view> | |
| 748 | + <!-- <view class="top-frame"> | |
| 749 | + <view class="xc-valid-coupon four-level-word">可以领优惠券</view> | |
| 750 | + </view> --> | |
| 751 | + <view class="xc-frame"> | |
| 752 | + <view class="top-frame"> | |
| 753 | + <view class="xc-coupon-frame "> | |
| 754 | + <!-- -单张的券- --> | |
| 755 | + <view class="rel" wx:for="{{quan_list}}" wx:key="{{index}}"> | |
| 756 | + <view class="coupon flex"> | |
| 757 | + <view class="circle xc-circular-one"></view> | |
| 758 | + <view class="xc-coupon-left "> | |
| 759 | + <view class="flex ai_c xc-money-frame"> | |
| 760 | + <text class="xc-money two-level-word xc-rmb">¥</text> | |
| 761 | + <text class="one-level-word xc-money">{{item.money}}</text> | |
| 762 | + </view> | |
| 763 | + <view class="xc-money four-level-word xc-spacing">满{{item.condition}}元可用</view> | |
| 764 | + </view> | |
| 765 | + <view class="xc-coupon-right flex"> | |
| 766 | + <view class="xc-detail-coupon"> | |
| 767 | + <view class="four-level-word">订单金额满{{item.condition}}元可用</view> | |
| 768 | + <view class="four-level-word xc-below"> | |
| 769 | + {{filters.replace_time2(item.start)}} 至 {{filters.replace_time2(item.end)}} | |
| 770 | + </view> | |
| 771 | + </view> | |
| 772 | + <view class="flex-vertical"> | |
| 773 | + <view class="three-level-word xc-get background {{item.everyone_num>0 && item.lqnum>=item.everyone_num?'nouse':''}}" data-ind="{{index}}" data-cid="{{item.id}}" bindtap="get_quan"> | |
| 774 | + {{ item.linging==1?'领取中':'领取'}} | |
| 775 | + </view> | |
| 776 | + </view> | |
| 777 | + </view> | |
| 778 | + <view class="circle xc-circular-two"></view> | |
| 779 | + </view> | |
| 780 | + </view> | |
| 781 | + </view> | |
| 782 | + </view> | |
| 783 | + </view> | |
| 784 | + <view class="cx-confirm pd20" data-coupon='0' bindtap="switchCoupon"> | |
| 785 | + <view class="confirm t-c">关闭</view> | |
| 786 | + </view> | |
| 787 | + </view> | |
| 788 | +</view> | |
| 789 | +<!-- 选择门店的弹框,1.1版最新的 --> | |
| 790 | +<block wx:if="{{store==1}}"> | |
| 791 | + <view class="mongolia-layer" bindtap="close_popup"></view> | |
| 792 | + <view class="popup-frame"> | |
| 793 | + <block wx:if="{{sort_store==0}}"> | |
| 794 | + <!-- 头部 标题 --> | |
| 795 | + <view class="popup-top flex-space-between"> | |
| 796 | + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text> | |
| 797 | + <view> | |
| 798 | + <view> | |
| 799 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 800 | + </view> | |
| 801 | + <view class="felx choose_more" bindtap="more_store" wx:if="{{is_show_sto_cat>0}}" > | |
| 802 | + <text class="fs26 red-co" >{{choice_sort_store==0?'更多门店':'返回'}}</text> | |
| 803 | + <view class="bg_rights"></view> | |
| 804 | + </view> | |
| 805 | + </view> | |
| 806 | + </view> | |
| 807 | + <!-- 门店列表,最外层的门店列表,一开始 --> | |
| 808 | + <view class="store-list"> | |
| 809 | + <!-- 如果还没有点击更多门店的时候 --> | |
| 810 | + <block wx:if="{{choice_sort_store==0}}"> | |
| 811 | + <!-- 需要for循环 --> | |
| 812 | + <block wx:if="{{is_show_sto_cat==1}}"> | |
| 813 | + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 814 | + <view class="store flex-vertical"> | |
| 815 | + <!-- 需要点击事件 --> | |
| 816 | + <block wx:if="{{index==fir_pick_index}}"> | |
| 817 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 818 | + </block> | |
| 819 | + <block wx:else> | |
| 820 | + <view class="circle xc-hooks"></view> | |
| 821 | + </block> | |
| 822 | + <view class="address-frame xc-ash"> | |
| 823 | + <view class="flex-vertical-between butttem5"> | |
| 824 | + <view class="flex xc-ash"> | |
| 825 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 826 | + </view> | |
| 827 | + <view> | |
| 828 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
| 829 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}} | |
| 830 | + </view> | |
| 831 | + </view> | |
| 832 | + </view> | |
| 833 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 834 | + </view> | |
| 835 | + </view> | |
| 836 | + </view> | |
| 837 | + </block> | |
| 838 | + <block wx:else> | |
| 839 | + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 840 | + <view class="store flex-vertical"> | |
| 841 | + <!-- 需要点击事件 --> | |
| 842 | + <block wx:if="{{index==fir_pick_index}}"> | |
| 843 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 844 | + </block> | |
| 845 | + <block wx:else> | |
| 846 | + <view class="circle xc-hooks"></view> | |
| 847 | + </block> | |
| 848 | + <view class="address-frame xc-ash"> | |
| 849 | + <view class="flex-vertical-between "> | |
| 850 | + <view class="flex xc-ash"> | |
| 851 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 852 | + </view> | |
| 853 | + <view> | |
| 854 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
| 855 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
| 856 | + </view> | |
| 857 | + </view> | |
| 858 | + </view> | |
| 859 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 860 | + </view> | |
| 861 | + </view> | |
| 862 | + </view> | |
| 863 | + </block> | |
| 864 | + </block> | |
| 865 | + <block wx:else> | |
| 866 | + <!-- 如果是点击选择门店分类后显示分类下的门店 --> | |
| 867 | + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store"> | |
| 868 | + <view class="store flex-vertical"> | |
| 869 | + <!-- 需要点击事件 --> | |
| 870 | + <block wx:if="{{index==sec_pick_index}}"> | |
| 871 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 872 | + </block> | |
| 873 | + <block wx:else> | |
| 874 | + <view class="circle xc-hooks"></view> | |
| 875 | + </block> | |
| 876 | + <view class="address-frame xc-ash"> | |
| 877 | + <view class="flex-vertical-between "> | |
| 878 | + <view class="flex xc-ash"> | |
| 879 | + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 880 | + </view> | |
| 881 | + <view> | |
| 882 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
| 883 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
| 884 | + </view> | |
| 885 | + </view> | |
| 886 | + </view> | |
| 887 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 888 | + </view> | |
| 889 | + </view> | |
| 890 | + </view> | |
| 891 | + </block> | |
| 892 | + </view> | |
| 893 | + <!-- 门店列表底部 --> | |
| 894 | + <view class="store-bottom-frame"> | |
| 895 | + <view class="store-bottom flex-vertical-between"> | |
| 896 | + <view class="determine red-b fs28 white t-c" bindtap="sure_pick" data-openindstore="{{open_ind_store}}"> | |
| 897 | + 确定 | |
| 898 | + </view> | |
| 899 | + <view class="default t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}"> | |
| 900 | + 设为默认 | |
| 901 | + </view> | |
| 902 | + </view> | |
| 903 | + </view> | |
| 904 | + </block> | |
| 905 | + <block wx:else> | |
| 906 | + <view class="popup-top flex-space-between"> | |
| 907 | + <text class="fs32 nearby_store">门店分类选择</text> | |
| 908 | + <view> | |
| 909 | + <view> | |
| 910 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 911 | + </view> | |
| 912 | + <view class="felx choose_mores" bindtap="returns"> | |
| 913 | + <text class="fs26 red-co">返回</text> | |
| 914 | + </view> | |
| 915 | + </view> | |
| 916 | + </view> | |
| 917 | + <view class="sort_store_list"> | |
| 918 | + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}"> | |
| 919 | + <view class="sort-store flex-vertical-between"> | |
| 920 | + <view class="fs30" di>{{item.name}}</view> | |
| 921 | + <view class="black_rights-frame"> | |
| 922 | + <view class="black_rights"></view> | |
| 923 | + </view> | |
| 924 | + </view> | |
| 925 | + </view> | |
| 926 | + </view> | |
| 927 | + </block> | |
| 928 | + </view> | |
| 929 | +</block> | |
| 930 | +<!-- ---------------分享弹窗--------------- --> | |
| 931 | +<!-- 二维码显示页面 --> | |
| 932 | +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> | |
| 933 | +<warn id="warn"></warn> | |
| 934 | +<!-- 分享控件,底部弹出 --> | |
| 935 | +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share> | |
| 936 | +<view wx:if="{{showPoster}}"> | |
| 937 | + <view class="mask" catchtap="closePoster"></view> | |
| 938 | + <view class="poster-container"> | |
| 939 | + <view class="poster-wrapper"> | |
| 940 | + <view class="poster"> | |
| 941 | + <!-- <view class="poster" bindtap="previewImage"> --> | |
| 942 | + <image src="{{shareImgPath}}" class="poster-img" show-menu-by-longpress></image> | |
| 943 | + <view class="btn-close" catchtap="closePoster"> | |
| 944 | + <text class="iconfont icon-close"></text> | |
| 945 | + </view> | |
| 946 | + </view> | |
| 947 | + | |
| 948 | + </view> | |
| 949 | + </view> | |
| 950 | +</view> | |
| 951 | + | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.wxss
0 → 100644
| 1 | +@import "../../../../utils/wxParse/wxParse.wxss"; | |
| 2 | +.container { margin-bottom: 100rpx; overflow: hidden;padding-top: 80rpx;} | |
| 3 | +image { | |
| 4 | + vertical-align: top; | |
| 5 | +} | |
| 6 | +.goods-detail{overflow: hidden} | |
| 7 | + | |
| 8 | +.type-navbar { | |
| 9 | + display: flex; | |
| 10 | + justify-content: center; | |
| 11 | + width: 100%; | |
| 12 | + position: fixed; | |
| 13 | + top: 0; | |
| 14 | + z-index: 999; | |
| 15 | + /* height: 80rpx; */ | |
| 16 | + /* margin-bottom: 20rpx; */ | |
| 17 | + background-color: #fff; | |
| 18 | + border-top: 2rpx solid #ebedf0; | |
| 19 | + /* border-bottom: 1rpx #fafafa solid; */ | |
| 20 | +} | |
| 21 | +.type-box { | |
| 22 | + width: 25%; | |
| 23 | + box-sizing: border-box; | |
| 24 | + font-size: 32rpx; | |
| 25 | + line-height: 76rpx; | |
| 26 | + padding: 0 20rpx; | |
| 27 | + text-align: center; | |
| 28 | + display: inline-block; | |
| 29 | + overflow: hidden; | |
| 30 | +} | |
| 31 | +.type-navbar-item { | |
| 32 | + /* border-bottom: 4rpx solid #fff; */ | |
| 33 | + display: flex; | |
| 34 | + justify-content: center; | |
| 35 | + width: 100%; | |
| 36 | + font-size: 26rpx; | |
| 37 | +} | |
| 38 | +.type-item-on { | |
| 39 | + color: #F95D74; | |
| 40 | + font-weight: bold; | |
| 41 | + /* border-bottom: 4rpx solid #F95D74; */ | |
| 42 | + position: relative; | |
| 43 | + font-size: 30rpx; | |
| 44 | +} | |
| 45 | +.type-item-on:after { | |
| 46 | + content: ''; | |
| 47 | + position: absolute; | |
| 48 | + width: 50%; | |
| 49 | + height: 4rpx; | |
| 50 | + background-color: #F95D74; | |
| 51 | + left: 0; | |
| 52 | + right: 0; | |
| 53 | + bottom: 0; | |
| 54 | + margin: 0 auto; | |
| 55 | +} | |
| 56 | +.swiper_box { | |
| 57 | + width: 100%; | |
| 58 | + height: 750rpx; | |
| 59 | +} | |
| 60 | +.goods-title { | |
| 61 | + display: flex; | |
| 62 | + justify-content: space-between; | |
| 63 | + /* overflow: hidden; */ | |
| 64 | + /* height: 108rpx; */ | |
| 65 | +} | |
| 66 | +.goods-name { | |
| 67 | + /* width: 560rpx; */ | |
| 68 | + /* line-height: 46rpx; */ | |
| 69 | + font-size: 32rpx; | |
| 70 | + font-weight: bold; | |
| 71 | + color: #333; | |
| 72 | + /* margin-top: 30rpx; | |
| 73 | + margin-bottom:30rpx; */ | |
| 74 | + flex: 1; | |
| 75 | + text-align: justify; | |
| 76 | + margin: 10rpx 0 20rpx; | |
| 77 | +} | |
| 78 | + | |
| 79 | +.goods-collect { | |
| 80 | + width: 112rpx; | |
| 81 | + padding-top: 30rpx; | |
| 82 | +} | |
| 83 | + | |
| 84 | +.collect-img { | |
| 85 | + width: 50rpx; | |
| 86 | + height: 44rpx; | |
| 87 | + margin: 0 auto; | |
| 88 | + overflow: hidden; | |
| 89 | +} | |
| 90 | + | |
| 91 | +.collect-des { | |
| 92 | + text-align: center; | |
| 93 | + font-size: 24rpx; | |
| 94 | + color: #333; | |
| 95 | +} | |
| 96 | + | |
| 97 | +.goods-price { | |
| 98 | + font-size: 60rpx; | |
| 99 | + /* padding: 20rpx 34rpx; */ | |
| 100 | + /* padding:0rpx 34rpx; */ | |
| 101 | + /* line-height: 60rpx; */ | |
| 102 | + color: #999; | |
| 103 | + padding: 20rpx; | |
| 104 | + /* margin-top: 46rpx; */ | |
| 105 | + /* margin-top:26rpx; | |
| 106 | + padding-bottom:20rpx; */ | |
| 107 | +} | |
| 108 | + | |
| 109 | +.prom-info { | |
| 110 | + margin: 10rpx 0; | |
| 111 | + color: #f23030; | |
| 112 | +} | |
| 113 | + | |
| 114 | +.prom-info>.prom-type { | |
| 115 | + color: white; | |
| 116 | + background-color: #f23030; | |
| 117 | + margin-right: 14rpx; | |
| 118 | + padding: 2rpx 8rpx; | |
| 119 | + border-radius: 4rpx; | |
| 120 | +} | |
| 121 | +.market-price { | |
| 122 | + /* display: flex; | |
| 123 | + margin-left: -5rpx; */ | |
| 124 | +} | |
| 125 | + | |
| 126 | +.market-price .yuan{ | |
| 127 | + /* top:24rpx; */ | |
| 128 | + font-size: 30rpx | |
| 129 | +} | |
| 130 | + | |
| 131 | +.market-price>view>text { | |
| 132 | + text-decoration: line-through; | |
| 133 | +} | |
| 134 | + | |
| 135 | +.market-price>.yj{ | |
| 136 | + color: #999999; font-size: 24rpx;/* margin-left: 16rpx;position: relative;top:30rpx; */ | |
| 137 | + display: inline-block; | |
| 138 | +} | |
| 139 | + | |
| 140 | +.goods-price>.tm{ color: #999999; font-size: 26rpx;margin-top: 10rpx;} | |
| 141 | + | |
| 142 | +.goods-num { | |
| 143 | + color: #999; | |
| 144 | + display: flex; | |
| 145 | + font-size: 24rpx; | |
| 146 | + justify-content: space-between; | |
| 147 | +} | |
| 148 | + | |
| 149 | +.goods-detail .twen{ | |
| 150 | + background: #fff;height: 60rpx; line-height: 60rpx; font-size: 30rpx;padding-left: 30rpx;display: flex; | |
| 151 | +} | |
| 152 | +.goods-detail .twen .img{ width: 32rpx; height: 32rpx; margin-left: 200rpx; background: #fff} | |
| 153 | +.goods-detail .twen image.img{vertical-align:auto;} | |
| 154 | + | |
| 155 | + | |
| 156 | +.logistics-item { | |
| 157 | + display: flex; | |
| 158 | + justify-content: space-between; | |
| 159 | + align-items: center; | |
| 160 | + height: 90rpx; | |
| 161 | + /*border-bottom: 1px solid #f5f5f5;*/ | |
| 162 | + font-size: 32rpx; | |
| 163 | + color: #666; | |
| 164 | +} | |
| 165 | +.logistics-item .small{color: #999; font-size: 24rpx;} | |
| 166 | + | |
| 167 | +.item-title { width: 180rpx;} | |
| 168 | +.item-mes { | |
| 169 | + color: #333; width: 420rpx; | |
| 170 | + height: 90rpx; line-height: 90rpx; | |
| 171 | +} | |
| 172 | +.item-img { width: 32rpx; height: 32rpx;} | |
| 173 | +.prom-item { | |
| 174 | + color: #f23030; | |
| 175 | + border: 1px solid #f23030; | |
| 176 | + border-radius: 18rpx; | |
| 177 | + line-height: 40rpx; | |
| 178 | + height: 40rpx; | |
| 179 | + padding: 2rpx 8rpx; | |
| 180 | +} | |
| 181 | + | |
| 182 | +.guarantee { | |
| 183 | + justify-content: space-around; | |
| 184 | +} | |
| 185 | + | |
| 186 | +.ico-item { | |
| 187 | + width: 32rpx; | |
| 188 | + height: 32rpx; | |
| 189 | + margin-right: 10rpx; | |
| 190 | +} | |
| 191 | + | |
| 192 | +.guarantee>view { | |
| 193 | + display: flex; | |
| 194 | + align-items: center; | |
| 195 | + height: 32rpx; | |
| 196 | + color: #666; | |
| 197 | +} | |
| 198 | + | |
| 199 | +.user-comment { | |
| 200 | + margin: 10rpx 0; | |
| 201 | + font-size: 28rpx; | |
| 202 | +} | |
| 203 | + | |
| 204 | +.good-comment,.comment-num { | |
| 205 | + display: flex; | |
| 206 | +} | |
| 207 | + | |
| 208 | +.recommend { | |
| 209 | + background-color: #fff; | |
| 210 | + border-bottom: 1px solid #ddd; | |
| 211 | + padding-bottom: 20rpx; | |
| 212 | +} | |
| 213 | + | |
| 214 | +.recommend-title { | |
| 215 | + height: 70rpx; | |
| 216 | + line-height: 70rpx; | |
| 217 | + font-size: 28rpx; | |
| 218 | + padding: 0 30rpx; | |
| 219 | +} | |
| 220 | + | |
| 221 | +.recommend-ul { | |
| 222 | + display: flex; | |
| 223 | + justify-content: flex-start; | |
| 224 | +} | |
| 225 | + | |
| 226 | +.recommend-ul .li { | |
| 227 | + width: 25%; | |
| 228 | + box-sizing: border-box; | |
| 229 | + text-align: center; | |
| 230 | + font-size: 28rpx; | |
| 231 | + color: #333; | |
| 232 | +} | |
| 233 | + | |
| 234 | +.li-img { | |
| 235 | + width: 120rpx; | |
| 236 | + height: 120rpx; | |
| 237 | + margin: 0 auto; | |
| 238 | +} | |
| 239 | + | |
| 240 | +.li-title { | |
| 241 | + height: 58rpx; | |
| 242 | + line-height: 30rpx; | |
| 243 | + margin: 10rpx 0; | |
| 244 | +} | |
| 245 | + | |
| 246 | +.comment-item { | |
| 247 | + background-color: #fff; | |
| 248 | + font-size: 28rpx; | |
| 249 | +} | |
| 250 | + | |
| 251 | +.comment-title { | |
| 252 | + display: flex; | |
| 253 | + justify-content: space-between; | |
| 254 | + align-items: center; | |
| 255 | + height: 102rpx; | |
| 256 | + margin: 0 30rpx; | |
| 257 | + color: #333; | |
| 258 | + border-bottom: 1px solid #eee; | |
| 259 | +} | |
| 260 | + | |
| 261 | +.user-name { | |
| 262 | + display: flex; | |
| 263 | + align-items: center; | |
| 264 | +} | |
| 265 | + | |
| 266 | +.user-pic { | |
| 267 | + width: 54rpx; | |
| 268 | + height: 54rpx; | |
| 269 | + margin-right: 10rpx; | |
| 270 | + border-radius: 50%; | |
| 271 | + overflow: hidden; | |
| 272 | +} | |
| 273 | + | |
| 274 | +.stars { | |
| 275 | + float: left; | |
| 276 | + display: flex; | |
| 277 | + height: 42rpx; | |
| 278 | + line-height: 42rpx; | |
| 279 | + margin: 15rpx 0; | |
| 280 | + width: 200rpx; | |
| 281 | +} | |
| 282 | + | |
| 283 | +.star { | |
| 284 | + width: 26rpx; | |
| 285 | + height: 26rpx; | |
| 286 | + margin-right: 5rpx; | |
| 287 | +} | |
| 288 | + | |
| 289 | +.state-spec { | |
| 290 | + margin: 15rpx 0; | |
| 291 | + float: right; | |
| 292 | + font-size: 24rpx; | |
| 293 | + color: #666; | |
| 294 | + width: 460rpx; | |
| 295 | + text-align: right; | |
| 296 | +} | |
| 297 | + | |
| 298 | +.comment-cont { | |
| 299 | + padding: 0 30rpx 30rpx; | |
| 300 | + border-bottom: 1px solid #eee; | |
| 301 | +} | |
| 302 | + | |
| 303 | +.comment-mes { | |
| 304 | + line-height: 42rpx; | |
| 305 | +} | |
| 306 | + | |
| 307 | +.img-ul { | |
| 308 | + display: flex; | |
| 309 | + flex-wrap: wrap; | |
| 310 | +} | |
| 311 | + | |
| 312 | +.img-li { | |
| 313 | + width: 150rpx; | |
| 314 | + height: 150rpx; | |
| 315 | + margin-top: 8rpx; | |
| 316 | + margin-right: 10rpx; | |
| 317 | +} | |
| 318 | + | |
| 319 | +.comment-btn { | |
| 320 | + height: 60rpx; | |
| 321 | + padding: 20rpx 30rpx; | |
| 322 | +} | |
| 323 | + | |
| 324 | +.comment-btn .btn { | |
| 325 | + display: flex; | |
| 326 | + justify-content: center; | |
| 327 | + align-items: center; | |
| 328 | + height: 60rpx; | |
| 329 | + width: 45%; | |
| 330 | + border: 1px solid #eee; | |
| 331 | +} | |
| 332 | + | |
| 333 | +.comment-btn .btn-img { | |
| 334 | + width: 30rpx; | |
| 335 | + height: 28rpx; | |
| 336 | + margin: 0 10rpx; | |
| 337 | +} | |
| 338 | + | |
| 339 | +.reply-ul { | |
| 340 | + margin-top: 20rpx; | |
| 341 | +} | |
| 342 | + | |
| 343 | +.reply-li { | |
| 344 | + color: #aaa; | |
| 345 | +} | |
| 346 | + | |
| 347 | +.join-cart { | |
| 348 | + position: fixed; | |
| 349 | + left: 0; | |
| 350 | + bottom: 0; | |
| 351 | + display: flex; | |
| 352 | + width: 100%; | |
| 353 | + height: 100rpx; | |
| 354 | + background-color: #fff; | |
| 355 | + z-index: 9; | |
| 356 | + border-top: 4rpx solid #eee; | |
| 357 | + | |
| 358 | +} | |
| 359 | + | |
| 360 | +.join-cart>view { | |
| 361 | + width: 29%; | |
| 362 | +} | |
| 363 | + | |
| 364 | +.join-cart>.new_split { | |
| 365 | + width: 13%; | |
| 366 | + text-align: center; | |
| 367 | + padding: 0; | |
| 368 | + margin: 0; | |
| 369 | +} | |
| 370 | + | |
| 371 | +.cart-ico { | |
| 372 | + font-size: 24rpx; | |
| 373 | + color: #333; | |
| 374 | +} | |
| 375 | + | |
| 376 | +.shopping-cart { | |
| 377 | + position: relative; | |
| 378 | +} | |
| 379 | + | |
| 380 | +.cs-img { | |
| 381 | + width: 45rpx; | |
| 382 | + height: 40rpx; | |
| 383 | + margin-top: 15rpx; | |
| 384 | +} | |
| 385 | + | |
| 386 | +.sc-img { | |
| 387 | + width: 42rpx; | |
| 388 | + height: 40rpx; | |
| 389 | + margin-top: 15rpx; | |
| 390 | +} | |
| 391 | + | |
| 392 | +.cart-num { | |
| 393 | + position: absolute; | |
| 394 | + left: 50%; | |
| 395 | + top: 1rpx; | |
| 396 | + width: 40rpx; | |
| 397 | + height: 40rpx; | |
| 398 | + line-height: 40rpx; | |
| 399 | + text-align: center; | |
| 400 | + border-radius: 50%; | |
| 401 | + color: #fff; | |
| 402 | + background-color: rgba(217,81,99,0.9); | |
| 403 | +} | |
| 404 | + | |
| 405 | +.cart-btn { | |
| 406 | + font-size: 28rpx; | |
| 407 | + color: #fff; | |
| 408 | + line-height: 70rpx; | |
| 409 | + margin-top: 16rpx; | |
| 410 | + text-align: center; | |
| 411 | + | |
| 412 | + | |
| 413 | +} | |
| 414 | + | |
| 415 | +.join-btn { | |
| 416 | + background-color: #ffb03f; | |
| 417 | + height: 70rpx; | |
| 418 | +border-radius: 55rpx 0rpx 0rpx 55rpx; | |
| 419 | +margin-top: 16rpx; | |
| 420 | + | |
| 421 | + | |
| 422 | +} | |
| 423 | + | |
| 424 | +view.cart-btn-lg { | |
| 425 | + width: 50%; | |
| 426 | +} | |
| 427 | + | |
| 428 | +.buy-btn { | |
| 429 | + background-color: #f23030; | |
| 430 | + height: 70rpx; | |
| 431 | +border-radius: 0 56rpx 55rpx 0; | |
| 432 | + | |
| 433 | +} | |
| 434 | + | |
| 435 | +.buy-btn-all{ | |
| 436 | + background-color: #f23030; | |
| 437 | + height: 70rpx; | |
| 438 | + border-radius: 56rpx; | |
| 439 | +} | |
| 440 | + | |
| 441 | + | |
| 442 | +.toTop { | |
| 443 | + position: fixed; | |
| 444 | + z-index: 3; | |
| 445 | + right: 20rpx; | |
| 446 | + bottom: 160rpx; | |
| 447 | + width: 68rpx; | |
| 448 | + height: 68rpx; | |
| 449 | + border: 1px solid #ddd; | |
| 450 | + border-radius: 50%; | |
| 451 | + overflow: hidden; | |
| 452 | + cursor: pointer; | |
| 453 | +} | |
| 454 | + | |
| 455 | +.comment-more { | |
| 456 | + height: 56rpx; | |
| 457 | + line-height: 56rpx; | |
| 458 | + font-size: 26rpx; | |
| 459 | + color: #999; | |
| 460 | + text-align: center; | |
| 461 | + background-color: #eee; | |
| 462 | +} | |
| 463 | + | |
| 464 | +.goods-more { | |
| 465 | + background-color: #fff; | |
| 466 | +} | |
| 467 | + | |
| 468 | +.goods-norms { | |
| 469 | + background-color: #fff; | |
| 470 | +} | |
| 471 | + | |
| 472 | +.type-navbar2 { | |
| 473 | + display: flex; | |
| 474 | + height: 72rpx; | |
| 475 | + border-top: 1px solid #ddd; | |
| 476 | + border-bottom: 1px solid #ddd; | |
| 477 | +} | |
| 478 | + | |
| 479 | +.type-box2 { | |
| 480 | + width: 50%; | |
| 481 | + font-size: 26rpx; | |
| 482 | + line-height: 72rpx; | |
| 483 | + text-align: center; | |
| 484 | + overflow: hidden; | |
| 485 | +} | |
| 486 | + | |
| 487 | +.type-item2-on { | |
| 488 | + color: #f23030; | |
| 489 | +} | |
| 490 | + | |
| 491 | +.parameter { | |
| 492 | + padding: 40rpx 0; | |
| 493 | +} | |
| 494 | + | |
| 495 | +.table { | |
| 496 | + width: 698rpx; | |
| 497 | + margin: 0 auto; | |
| 498 | + border: 1px solid #ddd; | |
| 499 | + border-bottom: none; | |
| 500 | +} | |
| 501 | + | |
| 502 | +.tb { | |
| 503 | + width: 100%; | |
| 504 | + min-height: 69rpx; | |
| 505 | + line-height: 69rpx; | |
| 506 | + border-bottom: 1px solid #ddd; | |
| 507 | + font-size: 28rpx; | |
| 508 | + text-align: center; | |
| 509 | + color: #333; | |
| 510 | +} | |
| 511 | + | |
| 512 | +.th-thitle { | |
| 513 | + font-weight: bold; | |
| 514 | + background-color: #f5fafe; | |
| 515 | +} | |
| 516 | + | |
| 517 | +.td-cont { | |
| 518 | + display: flex; | |
| 519 | +} | |
| 520 | + | |
| 521 | +.td-title { | |
| 522 | + width: 259rpx; | |
| 523 | + background-color: #f5fafe; | |
| 524 | + border-right: 1px solid #ddd; | |
| 525 | +} | |
| 526 | + | |
| 527 | +.td-text { | |
| 528 | + width: 439rpx; | |
| 529 | +} | |
| 530 | + | |
| 531 | +.goods-comment { | |
| 532 | + background-color: #fff; | |
| 533 | +} | |
| 534 | + | |
| 535 | +.type-navbar3 { | |
| 536 | + display: flex; | |
| 537 | + height: 88rpx; | |
| 538 | + border-top: 1px solid #ddd; | |
| 539 | + border-bottom: 1px solid #ddd; | |
| 540 | + padding: 10rpx 0; | |
| 541 | +} | |
| 542 | + | |
| 543 | +.type-box3 { | |
| 544 | + width: 20%; | |
| 545 | + font-size: 30rpx; | |
| 546 | + line-height: 44rpx; | |
| 547 | + text-align: center; | |
| 548 | + overflow: hidden; | |
| 549 | +} | |
| 550 | + | |
| 551 | +.type-item3-on { | |
| 552 | + color: #f23030; | |
| 553 | +} | |
| 554 | + | |
| 555 | +.spec-model { | |
| 556 | + position: fixed; | |
| 557 | + bottom: 0; | |
| 558 | + z-index: 20; | |
| 559 | + background: white; | |
| 560 | + width: 100%; | |
| 561 | + /* padding: 0 30rpx; */ | |
| 562 | + font-size: 32rpx; | |
| 563 | + box-sizing: border-box; | |
| 564 | + border-radius: 20rpx 20rpx 0 0; | |
| 565 | + /* height: 72%; */ | |
| 566 | +} | |
| 567 | + | |
| 568 | +.spec-model .pding{padding: 0 20rpx;} | |
| 569 | + | |
| 570 | +.spec-goods { | |
| 571 | + padding: 30rpx 0 20rpx; | |
| 572 | + /* float: left; */ | |
| 573 | + width: 100%; | |
| 574 | + /* border-bottom:2rpx solid #eee; */ | |
| 575 | +} | |
| 576 | + | |
| 577 | +.spec-img { | |
| 578 | + float: left; | |
| 579 | + height: 186rpx; | |
| 580 | + width: 186rpx; | |
| 581 | + border: 4rpx solid #eee | |
| 582 | +} | |
| 583 | + | |
| 584 | +.spec-goods-info { | |
| 585 | + float: left; | |
| 586 | + padding: 0 25rpx; | |
| 587 | + width: 400rpx; | |
| 588 | +} | |
| 589 | + | |
| 590 | +.spec-goods-name { | |
| 591 | + font-size: 30rpx; | |
| 592 | + line-height: 35rpx; | |
| 593 | + height: 70rpx; | |
| 594 | + margin: 15rpx 20rpx 25rpx 0; | |
| 595 | + overflow: hidden; | |
| 596 | + text-overflow: ellipsis;color: #333; | |
| 597 | +} | |
| 598 | + | |
| 599 | +.spec-goods-price { | |
| 600 | + color: #d60021; | |
| 601 | + font-size: 33rpx; | |
| 602 | + font-weight: bold; | |
| 603 | + | |
| 604 | +} | |
| 605 | + | |
| 606 | +.spec-goods-price.tag { | |
| 607 | + position: relative; | |
| 608 | +} | |
| 609 | + | |
| 610 | +.spec-goods-price.tag::before { | |
| 611 | + content: '预售'; | |
| 612 | + color: white; | |
| 613 | + background-color: #FF4732; | |
| 614 | + font-size: 24rpx; | |
| 615 | + border-radius: 4rpx; | |
| 616 | + padding: 0 6rpx; | |
| 617 | +} | |
| 618 | + | |
| 619 | +.spec-goods-stock { | |
| 620 | + margin-top: 3rpx; | |
| 621 | + font-size: 24rpx; | |
| 622 | + color: #999999; | |
| 623 | + margin-right: 15rpx; | |
| 624 | +} | |
| 625 | + | |
| 626 | +.spec-name { | |
| 627 | + clear: both; | |
| 628 | + padding: 20rpx 0; | |
| 629 | + font-size: 30rpx;color: #333; | |
| 630 | +} | |
| 631 | + | |
| 632 | +.quhuo{font-size: 30rpx; color: #000} | |
| 633 | +.b_num{ | |
| 634 | + display: flex;font-size: 30rpx; color: #333; | |
| 635 | + justify-content: space-between; | |
| 636 | + align-items: center; | |
| 637 | + padding: 20rpx 0; | |
| 638 | +} | |
| 639 | + | |
| 640 | +.count { | |
| 641 | + /* position: fixed; */ | |
| 642 | + display: flex; | |
| 643 | + height: 50rpx; | |
| 644 | + /* border: 1rpx solid #000; */ | |
| 645 | + font-size: 28rpx; | |
| 646 | + right: 30rpx; | |
| 647 | +} | |
| 648 | + | |
| 649 | + | |
| 650 | +.count>view,.count>input { | |
| 651 | + width: 60rpx; | |
| 652 | + height: 50rpx; | |
| 653 | + line-height: 50rpx; | |
| 654 | + text-align: center; | |
| 655 | +} | |
| 656 | +.spec_bt{ | |
| 657 | + background: fff;color: #333; margin-left: 10rpx;padding: 4rpx 15rpx 4rpx; display: inline-block; | |
| 658 | + border-radius:30rpx;font-size: 24rpx;border: 1rpx solid #ccc; margin: 10rpx; height: 40rpx; line-height: 40rpx; | |
| 659 | +} | |
| 660 | +.spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;} | |
| 661 | +.sub, .add, .count>input { | |
| 662 | + /* border-right: 1px solid #000; */ | |
| 663 | + background-color: #f8f8f8; | |
| 664 | + border-radius: 8rpx; | |
| 665 | +} | |
| 666 | +.sub.active { | |
| 667 | + /* background-color: #ddd; */ | |
| 668 | + color: #ccc; | |
| 669 | +} | |
| 670 | +.count>input { | |
| 671 | + margin: 0 10rpx; | |
| 672 | +} | |
| 673 | + | |
| 674 | +.add { | |
| 675 | + /* background-color: #f8f8f8; */ | |
| 676 | + /* border-left: 1px solid #000; */ | |
| 677 | +} | |
| 678 | + | |
| 679 | +.spec-btn { | |
| 680 | + color: black; | |
| 681 | + background-color: white; | |
| 682 | + padding: 10rpx 10rpx; | |
| 683 | + font-size: 26rpx; | |
| 684 | + line-height: 28rpx; | |
| 685 | + float: left; | |
| 686 | + border: 1rpx solid #dedede; | |
| 687 | + margin: 4rpx 10rpx 4rpx 0; | |
| 688 | + border-radius: 4rpx; | |
| 689 | +} | |
| 690 | + | |
| 691 | +.spec-btn-click { | |
| 692 | + color: white; | |
| 693 | + background-color: #f23030; | |
| 694 | + border: 1rpx solid #f23030; | |
| 695 | +} | |
| 696 | + | |
| 697 | +.spec-cart-btns { | |
| 698 | + /* width: 92%; */ | |
| 699 | + line-height: 70rpx; | |
| 700 | + /* margin: 0rpx auto; | |
| 701 | + margin-top: 160rpx; */ | |
| 702 | + /* border-radius: 20rpx; */ | |
| 703 | +/* position: fixed; */ | |
| 704 | +/* bottom: 50rpx; */ | |
| 705 | +/* left: 4%; */ | |
| 706 | + padding: 20rpx; | |
| 707 | +} | |
| 708 | + | |
| 709 | +.spec-cart-btn { | |
| 710 | + | |
| 711 | + width:100%; | |
| 712 | + font-size: 30rpx; | |
| 713 | + text-align: center; | |
| 714 | + color: white; | |
| 715 | + border-radius: 40rpx; | |
| 716 | +} | |
| 717 | + | |
| 718 | +.spec-cart-btn.w40 { | |
| 719 | + width: 46%; | |
| 720 | +} | |
| 721 | + | |
| 722 | +.spec-add-cart { | |
| 723 | + background-color: #ffb03f; | |
| 724 | +} | |
| 725 | + | |
| 726 | +.spec-buy { | |
| 727 | + background-color: #f23030; | |
| 728 | + /* margin-left: 34rpx; */ | |
| 729 | +} | |
| 730 | + | |
| 731 | +.spec-cart-disable { | |
| 732 | + background: #bbbbbb; | |
| 733 | +} | |
| 734 | + | |
| 735 | +.spec-cart-btn-lg { | |
| 736 | + width: 614rpx; | |
| 737 | +} | |
| 738 | + | |
| 739 | +.prom-model { | |
| 740 | + position: fixed; | |
| 741 | + bottom: 0; | |
| 742 | + z-index: 20; | |
| 743 | + background: white; | |
| 744 | + width: 100%; | |
| 745 | + padding: 0 30rpx 30rpx; | |
| 746 | + font-size: 32rpx; | |
| 747 | + box-sizing: border-box; | |
| 748 | + overflow-x: hidden; | |
| 749 | +} | |
| 750 | + | |
| 751 | +.prom-model .prom-title {text-align: center;margin: 30rpx 0;} | |
| 752 | +.prom-model .logistics-item {border: 0;} | |
| 753 | +.prom-model .item-mes {width: 500rpx;} | |
| 754 | +.integral-btn {width: 100%; padding: 0rpx;margin: 0rpx;} | |
| 755 | +.clear{clear: both;} | |
| 756 | +.sto_v .title,.sto_v .stitle{ border-top: 1rpx solid #dedede;border-bottom: 1rpx solid #dedede; height: 78rpx; line-height: 78rpx;} | |
| 757 | +.sto_v .title .tubiao,.sto_v .stitle .tubiao{width: 32rpx; height: 32rpx; margin-top: 23rpx;} | |
| 758 | +.itemlists .item{border-bottom: 1rpx solid #dedede; height: 72rpx; line-height: 72rpx;font-size: 28rpx; margin: 0 10rpx;} | |
| 759 | + | |
| 760 | +.cshu{margin-bottom: 30rpx; margin-top: 20rpx;} | |
| 761 | +.cshu view{color: #999; font-size: 30rpx; margin-left: 26rpx;} | |
| 762 | + | |
| 763 | + | |
| 764 | +/*---活动特殊显示---*/ | |
| 765 | +.prom_show{height: 120rpx; display: flex;} | |
| 766 | +.prom_show .secondkill-img{width: 100%; height: 100%;} | |
| 767 | +.prom_show .spike-img{width: 283rpx; height: 57rpx; top:35rpx; | |
| 768 | +left:31rpx;} | |
| 769 | +.prom_show .stop{ color:#d81731;top: 17rpx;right:65rpx; font-weight:600;} | |
| 770 | +.prom_show .start{ color:#009ae2;top: 17rpx;right:65rpx; font-weight:600;} | |
| 771 | +.prom_show .timeac { font-size: 32rpx; height: 120rpx; color: #333; } | |
| 772 | +.prom_show .timeac.left{width: 66%; color: #fff;background:#f23030;} | |
| 773 | +.prom_show .timeac.right{width: 34%;background-color: #d7d7d7; text-align: center} | |
| 774 | + | |
| 775 | +.prom_show .secview .day{padding-right:10rpx;} | |
| 776 | +.prom_show .secview .time-val{width:36rpx;height:36rpx;border-radius:7rpx; line-height: 36rpx;} | |
| 777 | +.prom_show .secview .time{margin-right:10rpx; margin-left:10rpx;} | |
| 778 | + | |
| 779 | + | |
| 780 | +.prom_show .timeac.left view{ margin-left: 20rpx} | |
| 781 | +.prom_show .timeac.left view.firview{margin-top: 10rpx} | |
| 782 | +.prom_show .timeac.left view .tr_line{ text-decoration: line-through; font-size: 28rpx;} | |
| 783 | +.prom_show .timeac.left view .bprice{ font-size: 50rpx; } | |
| 784 | + | |
| 785 | +.prom_show .timeac.right view.firview{margin-top:12rpx; margin-bottom: 10rpx} | |
| 786 | +.prom_show .timeac.right view.secview{display: flex; text-align: center; justify-content:center; flex-direction: row;} | |
| 787 | +.prom_show .timeac.right view .tui-conutdown-box{ | |
| 788 | + /* background: #6b6b6b; */ | |
| 789 | + width: auto; | |
| 790 | + /* min-width: 45rpx; */ | |
| 791 | + height: 45rpx; color: #c4182e; font-size: 27rpx; text-align: center; line-height: 46rpx;} | |
| 792 | + | |
| 793 | +.huise{ background:gray} | |
| 794 | +.lanse{background:#0199e2} | |
| 795 | + | |
| 796 | + | |
| 797 | +/*------拼单------*/ | |
| 798 | +.pt_view{ text-align: center; width: 100%; height: 100rpx; line-height: 100rpx; font-size: 26rpx} | |
| 799 | +.pt_view .secondkill-img{width: 100%;height: 100%;} | |
| 800 | +.pt_fir{ background: #fff;/* margin-bottom: 10rpx; */} | |
| 801 | +.pt_fir .pt_fir_title{display: flex; align-items: center; /* margin-left: 10rpx; margin-top: 20rpx; */ font-size: 28rpx; position: relative;} | |
| 802 | +.pt_fir .pt_fir_title .kt_type{ color: #fff;background:#e9030d; width: 100rpx; line-height: 40rpx; border-radius: 6rpx; margin: 0 10rpx; | |
| 803 | + height: 40rpx; font-size: 24rpx; text-align: center;} | |
| 804 | +.pt_fir .pt_fir_title .price{color: #e9030d;font-size: 26rpx;} | |
| 805 | +.pt_fir .pt_fir_title .bigw{font-size: 36rpx;} | |
| 806 | +.pt_fir .pt_fir_title .tprice{text-decoration: line-through;color: #949494} | |
| 807 | +.pt_fir .pt_fir_title .tprice.ml50{margin-left: 50rpx} | |
| 808 | + | |
| 809 | +.pt_fir .pt_fir_title .js{padding: 0 15rpx;height: 40rpx;background:#e9030d; text-align: center; border-radius: 8rpx; color: #fff; margin-left: 10rpx;} | |
| 810 | +.pt_fir .pt_fir_title .tuannum{color: #e9030d; position: absolute; right: 20rpx; font-size: 26rpx;} | |
| 811 | +.pding{padding-top: 20rpx;padding-left: 20rpx;height: 81%; | |
| 812 | + padding-right: 20rpx;font-size: 26rpx;color: #ea120f} | |
| 813 | +.pdres{margin-left: 10rpx;color: #8f8f94} | |
| 814 | +.ptgz{position: relative;font-size: 30rpx;padding-left: 20rpx;margin-top: 10rpx; overflow: hidden } | |
| 815 | +.shuxian{width: 6rpx;height: 28rpx; background: #ea120f; display: inline-block;top: 5rpx;position: relative; margin-right: 5rpx} | |
| 816 | +.ptgz_an{position: absolute;top:5rpx; right: 6rpx} | |
| 817 | +.ptgz_an .arrow-two{width:18rpx;height:18rpx;border-color:#da0b31; margin-top:30rpx;} | |
| 818 | + | |
| 819 | +.pt_fir.se{height: auto; margin-bottom: 10rpx} | |
| 820 | +.t_gz{padding: 10rpx 20rpx; font-size:28rpx } | |
| 821 | + | |
| 822 | +.pt_fir.se1{height: auto; margin: 0} | |
| 823 | +.pt_fir.se2{height: auto; margin: 0;/* border-top:6rpx solid #eeeeee;border-bottom:2rpx solid #eeeeee; */} | |
| 824 | + | |
| 825 | +.pt_hb{height:78rpx; line-height: 75rpx; position: relative; font-size: 32rpx;overflow: hidden;width:695rpx;margin-left:28rpx; | |
| 826 | + border-bottom: 1rpx solid #E5E5E5 } | |
| 827 | +.ptgz_an.xq{font-size: 32rpx; color:#d40024} | |
| 828 | +.wf{display: flex; padding: 20rpx 0;} | |
| 829 | +.wf .item{width: 24.5%; text-align: center; font-size: 26rpx; color: #666} | |
| 830 | +.wf .item .item_txy{position: relative;width: 60rpx; height: 60rpx; background: #ea120f; border-radius: 50%;left: 50%;margin-left: -30rpx; | |
| 831 | + border: 3px #dfdfdf solid; text-align: center;line-height: 60rpx; color: #fff; margin-bottom: 10rpx;} | |
| 832 | +.wf .item .item_txy.hs{ background: #cbcbcb;} | |
| 833 | +.po{margin-bottom: 20rpx;} | |
| 834 | + | |
| 835 | +.cart-btn.line-h{ line-height: 26rpx;} | |
| 836 | +.cart-btn .fir-v{ margin-top: 10rpx;} | |
| 837 | + | |
| 838 | +.hyt{ padding: 0 20rpx; font-size: 30rpx; display: flex; align-items:center; margin-top: 10rpx;} | |
| 839 | +.hyt .r_f{color: #e9120f;font-size: 26rpx;position: relative;top:3rpx} | |
| 840 | +.hyt .byj{color: #e9120f;font-size: 32rpx;position: relative;top:5rpx} | |
| 841 | + | |
| 842 | +.pt_fir .pt_fir_title.no-mar-b{margin-bottom: 0;padding-bottom: 10rpx; margin-left: 20rpx} | |
| 843 | +.pt_fir .pt_fir_title.boder-1{border-bottom: 1rpx #e7e7e7 solid} | |
| 844 | + | |
| 845 | +.jie_price{/* padding: 10rpx 30rpx; */} | |
| 846 | +.jie_price_title{font-size: 30rpx; color: #a26270; margin-bottom: 10rpx} | |
| 847 | +.price_list{display: flex; width: 100%;} | |
| 848 | +.price_item{width: 25%;font-size: 28rpx; color: #4c336c} | |
| 849 | + | |
| 850 | +.pt_fir.se2 .zzk-1{/* margin-top: 23rpx; */ font-size: 30rpx;position: relative; /* margin-bottom: 30rpx; */ border-left:4rpx solid red;/* margin-left:14rpx; */height:30rpx;line-height:30rpx;/* padding-left:5rpx; */} | |
| 851 | +.ckgd{/* position: absolute;top:0;right:57rpx; */ color:#d70025; font-size: 26rpx;} | |
| 852 | +.ckgd .arrow-one{width:14rpx;height:14rpx;border-color:#da0b31;/* margin-top:5rpx; */ margin:auto;} | |
| 853 | +.bview{ | |
| 854 | + position: fixed; top:0; left:0; width: 100%; height: 100%; | |
| 855 | + background-color: rgba(0, 0, 0, 0.5); | |
| 856 | +} | |
| 857 | +.juzhong{ | |
| 858 | + position: fixed; top:0; left:0; width: 100%; height: 100%; | |
| 859 | + display: flex; | |
| 860 | + flex-direction:row; | |
| 861 | + justify-content: center; | |
| 862 | + align-items: center; | |
| 863 | +} | |
| 864 | + | |
| 865 | +.juzhong .xq{ padding: 0 20rpx; background: #fff; font-size: 30rpx; padding-bottom: 20rpx;} | |
| 866 | +.juzhong .xq .title{text-align: center; margin: 20rpx 0; position: relative; height: 50rpx;} | |
| 867 | +.juzhong .xq .hs1{font-size: 28rpx; color: #ab8f9e} | |
| 868 | +.juzhong .xq .title .close{position: absolute;top: 0; right: 0; width: 45rpx; height: 45rpx;} | |
| 869 | + | |
| 870 | +.pt_qd{/* margin-top: 40rpx; height: auto; */padding: 20rpx;} | |
| 871 | +.spec-cart-btn.w100{width: 95%; margin-left: 0; height: 75rpx; line-height:75rpx;margin: auto; } | |
| 872 | + | |
| 873 | +.sto_v{color: #333;} | |
| 874 | +.ellipsis{overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} | |
| 875 | + | |
| 876 | + | |
| 877 | +/*---多少人参加团--*/ | |
| 878 | +.group { | |
| 879 | + padding-top:20rpx; | |
| 880 | + padding-bottom:20rpx; | |
| 881 | + width: 100%; | |
| 882 | + /* min-height: 92rpx; */ | |
| 883 | + border-bottom: 2rpx solid #ebedf0; | |
| 884 | + | |
| 885 | +} | |
| 886 | + | |
| 887 | +.group .group-list { | |
| 888 | + display: flex; | |
| 889 | + align-items: center; | |
| 890 | + justify-content: space-around; | |
| 891 | + /* height: 90rpx; */ | |
| 892 | + /* padding: 0 130rpx 0 100rpx; */ | |
| 893 | + /* width: 470rpx; | |
| 894 | + | |
| 895 | + position: absolute; */ | |
| 896 | +} | |
| 897 | + | |
| 898 | +.group .group-list .gtou { | |
| 899 | + width: 70rpx; | |
| 900 | + height: 70rpx; | |
| 901 | + /* float: left; | |
| 902 | + position: relative; | |
| 903 | + top: 6rpx; | |
| 904 | + left: -96rpx; */ | |
| 905 | +} | |
| 906 | + | |
| 907 | +.group .group-list .gtou image { | |
| 908 | + display: block; | |
| 909 | + width: 100%; | |
| 910 | + height: 100%; | |
| 911 | + border-radius: 50%; | |
| 912 | + background-color: #f0f0f0; | |
| 913 | +} | |
| 914 | + | |
| 915 | +.group .group-list .gdn { | |
| 916 | + width: 140rpx; | |
| 917 | + text-align: center; | |
| 918 | + /* float: left; */ | |
| 919 | + font-size: 26rpx; | |
| 920 | + /* padding-left: 20rpx; */ | |
| 921 | + /* line-height: 48rpx; | |
| 922 | + height: 48rpx; | |
| 923 | + width: 168rpx; | |
| 924 | + position: relative; | |
| 925 | + left: -80rpx; | |
| 926 | + top:20rpx; */ | |
| 927 | + font-weight:bold; | |
| 928 | +} | |
| 929 | + | |
| 930 | +.group .group-list .ghaicha { | |
| 931 | + /* width:300rpx; */ | |
| 932 | + font-size: 27rpx; | |
| 933 | + /* margin-left:180rpx; | |
| 934 | + top:13rpx; | |
| 935 | + left:-3rpx; */ | |
| 936 | + font-weight: bold; | |
| 937 | + | |
| 938 | + | |
| 939 | +} | |
| 940 | + | |
| 941 | +.group .group-list .ghaicha .gred { | |
| 942 | + /* height: 48rpx; | |
| 943 | + width: 300rpx; */ | |
| 944 | +} | |
| 945 | + | |
| 946 | +.gsj { | |
| 947 | + float: left; | |
| 948 | + color: #8f8f94; | |
| 949 | +} | |
| 950 | + | |
| 951 | +.group .group-list .cjt { | |
| 952 | + height:42rpx; | |
| 953 | + width: 137rpx; | |
| 954 | + /* position: absolute; | |
| 955 | + right: 4rpx; | |
| 956 | + top:25rpx; */ | |
| 957 | + line-height: 42rpx; | |
| 958 | + font-size: 24rpx; | |
| 959 | + color: #fff; | |
| 960 | + border:2rpx solid #d60024; | |
| 961 | + background-color:#d60024; | |
| 962 | + border-radius:25rpx; | |
| 963 | + | |
| 964 | +} | |
| 965 | + | |
| 966 | +.gbody { | |
| 967 | + background-color: white; | |
| 968 | +} | |
| 969 | +.t_show{/* overflow: hidden; */ display: flex; /* width: 300rpx; */ color: #292929; /* line-height: 36rpx; */font-size:26rpx; | |
| 970 | +} | |
| 971 | +.join-cart>view.set_width { | |
| 972 | + width:58%; | |
| 973 | +} | |
| 974 | + | |
| 975 | +/*秒杀样式zwp*/ | |
| 976 | +#zwpMs{ | |
| 977 | + width: 31%; | |
| 978 | + color: #fff; | |
| 979 | + background: url(https://mshopimg.yolipai.net/miniapp/images/user/bgred.png) no-repeat; | |
| 980 | + background-size: 100% 60px; | |
| 981 | +} | |
| 982 | + | |
| 983 | + | |
| 984 | +/*--------- 修改后的样式 -----------*/ | |
| 985 | +.elli{ | |
| 986 | + overflow : hidden; | |
| 987 | + text-overflow: ellipsis; | |
| 988 | + display: -webkit-box; | |
| 989 | + -webkit-line-clamp: 2; | |
| 990 | + -webkit-box-orient: vertical; | |
| 991 | +} | |
| 992 | +.one_elli{ | |
| 993 | + overflow : hidden; | |
| 994 | + text-overflow: ellipsis; | |
| 995 | + white-space:nowrap; | |
| 996 | +} | |
| 997 | + | |
| 998 | +.tuwen_title{ /* height: 86rpx; */ background-color:#eeeeee; /* margin-bottom: 32rpx; */ position: relative; | |
| 999 | + display: flex; justify-content: center;align-items: center; padding: 20rpx;} | |
| 1000 | + | |
| 1001 | +.tuwen_title .g_line{ | |
| 1002 | + width:496rpx; | |
| 1003 | + height:1rpx; | |
| 1004 | + border-bottom:#ababab 1rpx solid; | |
| 1005 | +} | |
| 1006 | +.tuwen_title .center_s{ | |
| 1007 | + width: 124rpx; position: absolute; height: 34rpx; background-color:#eeeeee; font-size: 32rpx; display: flex; | |
| 1008 | + overflow: hidden; justify-content: center;align-items: center; | |
| 1009 | +} | |
| 1010 | +.tuwen_title .center_s image{ width: 34rpx; height: 26rpx; margin-right: 10rpx} | |
| 1011 | +.t_g_info{ /* margin: 0 34rpx;margin-bottom: 20rpx; */ display: flex; align-items: center;padding: 20rpx; } | |
| 1012 | +.red_shu{ width: 10rpx; height: 36rpx; background-color:#da0035; margin-right: 8rpx; } | |
| 1013 | + | |
| 1014 | +.tb-l{ /* line-height: 96rpx; */} | |
| 1015 | +.table_s{ border:#e4e4e4 1rpx solid; box-sizing: border-box;font-size: 26rpx;} | |
| 1016 | +.tb_item{display: flex; /* height: 96rpx; */ border-bottom: 1rpx solid #e4e4e4 } | |
| 1017 | +.item_left{width: 210rpx; height: 100%; box-sizing:border-box; text-align: center;padding: 20rpx; background: #f9f9f9 ;border-right:2rpx solid #e4e4e4} .item_left text{ /* margin-left: 44rpx; */} | |
| 1018 | +.item_right{flex:1; height: 100%; overflow : hidden;white-space:nowrap;text-overflow: ellipsis; padding: 20rpx;} | |
| 1019 | +.item_right text{ /* margin-left: 66rpx; */} | |
| 1020 | + | |
| 1021 | +.table_s .tb-l:last-child {border-bottom: none;} | |
| 1022 | + | |
| 1023 | +.bzfu_img{ width: 164rpx; height:34rpx; /* margin-right: 18rpx; margin-left: 12rpx */ } | |
| 1024 | + .bz_view{ /* height:100rpx; padding: 0 34rpx 0 13rpx; */ color: #333; font-size: 28rpx; padding: 20rpx 20rpx 20rpx 10rpx; | |
| 1025 | + /* border-bottom: 3rpx solid #eee; */ | |
| 1026 | + /* border-top: 3rpx solid #eee; */} | |
| 1027 | + .bz_view view{ width: 460rpx; /* max-height: 70rpx; */ /* overflow: hidden; */} | |
| 1028 | + | |
| 1029 | +.bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 20rpx; color: #333; | |
| 1030 | + font-size: 30rpx; /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ } | |
| 1031 | +.red_bb{ color: #d70026; /* min-width:158rpx;width: auto; */} | |
| 1032 | +.bg_jj{ width: 14rpx; height:14rpx; | |
| 1033 | + border-top: 2rpx solid #d70026; | |
| 1034 | + border-right: 2rpx solid #d70026; | |
| 1035 | + transform: rotate(45deg);display:inline-block; | |
| 1036 | + margin-bottom:3rpx; | |
| 1037 | +} | |
| 1038 | +.bg_jj.down1{transform: rotate(135deg);} | |
| 1039 | + | |
| 1040 | +.bz-content { | |
| 1041 | + flex-grow: 1; | |
| 1042 | + text-align: justify; | |
| 1043 | + padding: 0 30rpx 0 20rpx; | |
| 1044 | +} | |
| 1045 | + | |
| 1046 | +/* 顶部边框 */ | |
| 1047 | +.topframe{ | |
| 1048 | + width: 100%; | |
| 1049 | + height: 172rpx; | |
| 1050 | + flex-direction: row; | |
| 1051 | + justify-content: space-between; | |
| 1052 | + border-bottom: 6rpx solid #eeeeee; | |
| 1053 | + overflow: hidden; | |
| 1054 | +} | |
| 1055 | +/* 评价人边框*/ | |
| 1056 | +.topframe .topframe-top{ | |
| 1057 | + display: flex; | |
| 1058 | + margin-top: 40rpx; | |
| 1059 | + margin-bottom: 36rpx; | |
| 1060 | + color: #7d7d7d; | |
| 1061 | + padding-left: 20rpx; | |
| 1062 | + font-size: 32rpx; | |
| 1063 | +} | |
| 1064 | +/*评价人数量*/ | |
| 1065 | +.topframe .topframe-top .topframe-top-val{ | |
| 1066 | + margin-left: 15rpx; | |
| 1067 | + | |
| 1068 | +} | |
| 1069 | +.topframe-top-content{ | |
| 1070 | + display: flex; | |
| 1071 | + width: 36%; | |
| 1072 | +} | |
| 1073 | +/* 好评 */ | |
| 1074 | +.topframe-praise{ | |
| 1075 | + width: 61%; | |
| 1076 | + text-align: right; | |
| 1077 | + color: #dc4355; | |
| 1078 | + font-size: 28rpx; | |
| 1079 | +} | |
| 1080 | +/* 按钮列表 */ | |
| 1081 | +.buttem-list{ | |
| 1082 | + width: 100%; | |
| 1083 | + display: flex; | |
| 1084 | + font-size: 20rpx; | |
| 1085 | + overflow: hidden; | |
| 1086 | +} | |
| 1087 | + | |
| 1088 | +.buttem-list .item{ | |
| 1089 | + min-width: 17%; | |
| 1090 | + font-size: 24rpx; | |
| 1091 | + border-radius: 20rpx; | |
| 1092 | + background:#ffe3e2; | |
| 1093 | + height:38rpx; | |
| 1094 | + text-align: center; | |
| 1095 | + line-height: 38rpx; | |
| 1096 | + margin-left: 20rpx; | |
| 1097 | +} | |
| 1098 | + | |
| 1099 | +.buttem-list .item.red{ | |
| 1100 | + color: #fff; | |
| 1101 | + background: #d60022; | |
| 1102 | +} | |
| 1103 | + | |
| 1104 | +/* 用户评价 */ | |
| 1105 | +.middle{ | |
| 1106 | + width: 95%; | |
| 1107 | + margin:0 auto; | |
| 1108 | +} | |
| 1109 | +.middle-img-frame{ | |
| 1110 | + height:65rpx; | |
| 1111 | + display: flex; | |
| 1112 | + margin-top: 32rpx; | |
| 1113 | + | |
| 1114 | +} | |
| 1115 | +/* 评价的用户图片 */ | |
| 1116 | +.middle-img{ | |
| 1117 | + width:60rpx; | |
| 1118 | + height:60rpx; | |
| 1119 | + border-radius: 50%; | |
| 1120 | + -moz-border-radius: 50%; | |
| 1121 | + -webkit-border-radius: 50%; | |
| 1122 | + margin-right: 15rpx; | |
| 1123 | +} | |
| 1124 | +/* 评价的用户边框 */ | |
| 1125 | +.middle-user-frame{ | |
| 1126 | + height: 65rpx; | |
| 1127 | + overflow: hidden; | |
| 1128 | +} | |
| 1129 | +.middle-user{ | |
| 1130 | + height: 25; | |
| 1131 | + font-size: 28rpx; | |
| 1132 | +} | |
| 1133 | +/* 评价图片 */ | |
| 1134 | +.middle-img-two{ | |
| 1135 | + width: 115rpx; | |
| 1136 | + height: 25rpx; | |
| 1137 | + text-align: center; | |
| 1138 | + margin-bottom:20rpx; | |
| 1139 | + margin-left:5rpx; | |
| 1140 | +} | |
| 1141 | +.xc-pirces{ | |
| 1142 | + margin-top: 14rpx; | |
| 1143 | +} | |
| 1144 | +/* 评价文字 */ | |
| 1145 | +.middle-font{ | |
| 1146 | + font-size: 30rpx; | |
| 1147 | + | |
| 1148 | +} | |
| 1149 | +.iddle-goods-img{ | |
| 1150 | + width: 100%; | |
| 1151 | + display: flex; | |
| 1152 | + margin-top:22rpx; | |
| 1153 | +} | |
| 1154 | +/* 商品图片 */ | |
| 1155 | +.goods-img{ | |
| 1156 | + width: 156rpx; | |
| 1157 | + height: 156rpx; | |
| 1158 | + margin-left: 22rpx; | |
| 1159 | + height: 100%; | |
| 1160 | +} | |
| 1161 | +.parameter-frame{ | |
| 1162 | + margin-top:14rxp; | |
| 1163 | + margin-bottom: 14rpx; | |
| 1164 | + width:50%; | |
| 1165 | + height: 30rpx; | |
| 1166 | +} | |
| 1167 | +.z_parameter{ | |
| 1168 | + width:98%; | |
| 1169 | + height: 45rpx; | |
| 1170 | + display:flex; | |
| 1171 | + line-height: 45rpx; | |
| 1172 | + margin-top: 20rpx; | |
| 1173 | + margin-bottom: 14rpx; | |
| 1174 | + justify-content : space-between; | |
| 1175 | +} | |
| 1176 | +.parameter-font{ | |
| 1177 | + font-size: 26rpx; | |
| 1178 | + | |
| 1179 | +} | |
| 1180 | +/* 规格 */ | |
| 1181 | +.parameter-state{ | |
| 1182 | + width: 100rpx; | |
| 1183 | + font-size: 24rpx; | |
| 1184 | + color: #c4c4c4; | |
| 1185 | +} | |
| 1186 | +.parameter-dian{ | |
| 1187 | + display: flex; | |
| 1188 | + width: 94rpx; | |
| 1189 | + height: 33rpx; | |
| 1190 | + font-size: 20rpx; | |
| 1191 | + border-radius: 20rpx; | |
| 1192 | + line-height:33rpx; | |
| 1193 | + padding-left: 25rpx; | |
| 1194 | + border:4rpx solid #eeeeee; | |
| 1195 | + | |
| 1196 | +} | |
| 1197 | +/* 点赞图片 */ | |
| 1198 | +.parameter-img{ | |
| 1199 | + width: 27rpx; | |
| 1200 | + height: 27rpx; | |
| 1201 | + margin-top: 3rpx; | |
| 1202 | +} | |
| 1203 | +.parameter-val{ | |
| 1204 | + margin-left:25rpx; | |
| 1205 | + font-size: 26rpx; | |
| 1206 | + color: #999; | |
| 1207 | +} | |
| 1208 | +/* 回复 */ | |
| 1209 | +.reply{ | |
| 1210 | + width: 95%; | |
| 1211 | + height: 120rpx; | |
| 1212 | + padding-top: 14rpx; | |
| 1213 | + border-top:3rpx solid #eeeeee; | |
| 1214 | + margin:0 auto; | |
| 1215 | + | |
| 1216 | +} | |
| 1217 | +.shop-reply{ | |
| 1218 | + height: 30rpx; | |
| 1219 | + color:#d60022; | |
| 1220 | + font-size:24rpx; | |
| 1221 | + overflow: hidden; | |
| 1222 | +} | |
| 1223 | +.shop-font{ | |
| 1224 | + width: 94%; | |
| 1225 | + font-size: 24rpx; | |
| 1226 | + padding-top: 10rpx; | |
| 1227 | + | |
| 1228 | +} | |
| 1229 | +.line_bulge{ | |
| 1230 | + width: 17rpx; | |
| 1231 | + height: 17rpx; | |
| 1232 | + border-top: 1rpx solid #eeeeee; | |
| 1233 | + border-left: 1rpx solid #eeeeee; | |
| 1234 | + transform:rotate(45deg); | |
| 1235 | + position: absolute; | |
| 1236 | + top: -12rpx; | |
| 1237 | + left:50rpx; | |
| 1238 | + background:#fff; | |
| 1239 | +} | |
| 1240 | + | |
| 1241 | + | |
| 1242 | +.xc_comment{ | |
| 1243 | + display: flex; | |
| 1244 | + justify-content: space-around; | |
| 1245 | + width: 100%; | |
| 1246 | + box-sizing: border-box; | |
| 1247 | + padding: 10rpx 20rpx; | |
| 1248 | + /* height: 42rpx; | |
| 1249 | + padding-left: 34rpx; */ | |
| 1250 | + color: #333; | |
| 1251 | + | |
| 1252 | +} | |
| 1253 | +.xc_comment-have-pictures{ | |
| 1254 | + width: 153rpx; | |
| 1255 | + /* height: 42rpx; */ | |
| 1256 | + line-height: 42rpx; | |
| 1257 | + text-align: center; | |
| 1258 | + background: #ffe3e2; | |
| 1259 | + color: 28rpx; | |
| 1260 | + border-radius:21rpx; | |
| 1261 | + font-size: 24rpx; | |
| 1262 | +} | |
| 1263 | +.xc_comment-discuss{ | |
| 1264 | + width: 152rpx; | |
| 1265 | + height: 42rpx; | |
| 1266 | + line-height: 42rpx; | |
| 1267 | + text-align: center; | |
| 1268 | + background: #ffe3e2; | |
| 1269 | + color: 28rpx; | |
| 1270 | + border-radius:20rpx; | |
| 1271 | + font-size: 24rpx; | |
| 1272 | + margin-left: 28rpx | |
| 1273 | +} | |
| 1274 | + | |
| 1275 | +.xc_comment-detail{ | |
| 1276 | + display: flex; | |
| 1277 | + /* margin-top: 40rpx; */ | |
| 1278 | + /* width: 524rpx; */ | |
| 1279 | + /* margin-left: 34rpx; */ | |
| 1280 | + border-radius: 24rpx; | |
| 1281 | + border: 2rpx solid #ebedf0; | |
| 1282 | + margin-left: 20rpx; | |
| 1283 | + box-sizing: border-box; | |
| 1284 | + /* overflow: hidden; */ | |
| 1285 | +} | |
| 1286 | + | |
| 1287 | +.xc_user-img{ | |
| 1288 | + border-radius:50%; | |
| 1289 | + margin: auto 0; | |
| 1290 | +} | |
| 1291 | + | |
| 1292 | +.xc_comment-user{ | |
| 1293 | + display: flex; | |
| 1294 | + /* margin-top: 22rpx; | |
| 1295 | + margin-left: 22rpx; */ | |
| 1296 | +} | |
| 1297 | +.xc_user{ | |
| 1298 | + width: 170rpx; | |
| 1299 | + height: 60rpx; | |
| 1300 | + margin-left: 6rpx; | |
| 1301 | + overflow: hidden; | |
| 1302 | +} | |
| 1303 | +.xc_user-name{ /* height: 25rpx; */} | |
| 1304 | +.xc_comment-img{ | |
| 1305 | + width: 22rpx; | |
| 1306 | + height: 22rpx; | |
| 1307 | + /* margin-top: 14rpx; */ | |
| 1308 | + margin-right: 5rpx | |
| 1309 | +} | |
| 1310 | +.xc_comment-font{ | |
| 1311 | + /* height: 75rpx; */ | |
| 1312 | + /* margin-left: 22rpx; */ | |
| 1313 | + white-space:normal; | |
| 1314 | + overflow: hidden; | |
| 1315 | + /* margin-top: 8rpx; | |
| 1316 | + line-height: 38rpx; */ | |
| 1317 | + | |
| 1318 | +} | |
| 1319 | +.xc_comment-val{ | |
| 1320 | + /* width: 88%; | |
| 1321 | + height: 30rpx; | |
| 1322 | + margin-left: 22rpx; | |
| 1323 | + display: flex; | |
| 1324 | + margin-top: 15rpx; | |
| 1325 | + margin-bottom:15rpx; */ | |
| 1326 | +} | |
| 1327 | + | |
| 1328 | +.xc_comment-time{ | |
| 1329 | + /* height: 30rpx; */ | |
| 1330 | + font-size: 22rpx; | |
| 1331 | + color: #a5a5a5; | |
| 1332 | + overflow: hidden; | |
| 1333 | +} | |
| 1334 | + | |
| 1335 | +.xc_goods-img{ | |
| 1336 | + width: 180rpx;height: 180rpx; | |
| 1337 | +} | |
| 1338 | +.xc_comment-left{ | |
| 1339 | + display:inline-block; | |
| 1340 | + width: 312rpx; | |
| 1341 | + padding: 20rpx; | |
| 1342 | +} | |
| 1343 | +.xc_goods-img-frame{ | |
| 1344 | + border-radius: 0 22rpx 22rpx 0; | |
| 1345 | + overflow: hidden; | |
| 1346 | + /* display:inline-block; */ | |
| 1347 | + /* width: 40%; | |
| 1348 | + height: 90%; | |
| 1349 | + text-align: center; | |
| 1350 | + padding-top: 30rpx; | |
| 1351 | + vertical-align: top; */ | |
| 1352 | +} | |
| 1353 | +.xc_imgs{ | |
| 1354 | + width: 50rpx; | |
| 1355 | + height:50rpx; | |
| 1356 | + border-radius:50%; | |
| 1357 | + margin-right: 5rpx; | |
| 1358 | +} | |
| 1359 | + | |
| 1360 | +.pj_word_size{ font-size: 28rpx} | |
| 1361 | +.pj_scroll{ | |
| 1362 | + /* white-space: nowrap; */ | |
| 1363 | + /* height: 324rpx; */ | |
| 1364 | + /* margin-bottom: 50rpx; */ | |
| 1365 | + display: flex; | |
| 1366 | + align-items: center; | |
| 1367 | + padding: 20rpx 0; | |
| 1368 | + /* box-sizing: border-box; */ | |
| 1369 | + /* box-shadow: 0 8px 12px #e7e9eb; */ | |
| 1370 | +} | |
| 1371 | + | |
| 1372 | + | |
| 1373 | +/*领券*/ | |
| 1374 | +.three-level-word{ | |
| 1375 | + font-size: 25rpx; | |
| 1376 | +} | |
| 1377 | +.four-level-word{ | |
| 1378 | + font-size: 23rpx; | |
| 1379 | +} | |
| 1380 | +.cx-frame{ | |
| 1381 | + /* border-top:3rpx solid #eee; */ | |
| 1382 | + /* width:99%; | |
| 1383 | + height: 95rpx; | |
| 1384 | + line-height: 95rpx; | |
| 1385 | + padding-left:24rpx; */ | |
| 1386 | + padding: 20rpx; | |
| 1387 | +} | |
| 1388 | +.cx-frame .cx-sizs{ | |
| 1389 | + /* width: 68rpx; */ | |
| 1390 | + /* height: 100%; */ | |
| 1391 | + /* line-height: 100rpx; */ | |
| 1392 | + /* overflow: hidden; */ | |
| 1393 | + /* margin-left: 10rpx; */ | |
| 1394 | +} | |
| 1395 | +.xc-coupon-fram{ | |
| 1396 | + position: relative; | |
| 1397 | + margin-right: 16rpx; | |
| 1398 | + /* width:200rpx; */ | |
| 1399 | + /* padding-top:30rpx; */ | |
| 1400 | + | |
| 1401 | +} | |
| 1402 | +.xc-coupon-fram .xc-coupon{ | |
| 1403 | + /* width:175rpx ; | |
| 1404 | + height: 40rpx; | |
| 1405 | + line-height: 40rpx; */ | |
| 1406 | + background-color:#d60021 ; | |
| 1407 | + /* margin:0 auto; */ | |
| 1408 | + color:#fff; | |
| 1409 | + padding: 6rpx 20rpx; | |
| 1410 | + | |
| 1411 | +} | |
| 1412 | +.xc-coupon-fram .xc-circular{ | |
| 1413 | + width: 16rpx; | |
| 1414 | + height:16rpx; | |
| 1415 | + background-color: white; | |
| 1416 | + position:absolute; | |
| 1417 | + top: 50%; | |
| 1418 | + /* left: -10rpx; */ | |
| 1419 | + transform: translateY(-50%); | |
| 1420 | +} | |
| 1421 | +.xc-coupon-fram .xc-one{ | |
| 1422 | + left: -8rpx; | |
| 1423 | +} | |
| 1424 | +.xc-coupon-fram .xc-two{ | |
| 1425 | + right: -8rpx; | |
| 1426 | +} | |
| 1427 | + | |
| 1428 | +.cx-obtain-coupon{ | |
| 1429 | + /* width: 65rpx; | |
| 1430 | + height: 100%; | |
| 1431 | + padding-left:15rpx; */ | |
| 1432 | + color: #d70025; | |
| 1433 | + display: flex; | |
| 1434 | + align-items: center; | |
| 1435 | + /* position: absolute; | |
| 1436 | + right: 5rpx; */ | |
| 1437 | +} | |
| 1438 | + | |
| 1439 | +/* 自定义弹出窗口 */ | |
| 1440 | +.cx-popup{ | |
| 1441 | + width:100%; | |
| 1442 | + background: #fff; | |
| 1443 | + z-index: 35; | |
| 1444 | + border-top-left-radius: 25rpx; | |
| 1445 | + border-top-right-radius: 25rpx; | |
| 1446 | + position:fixed; | |
| 1447 | + bottom:0; | |
| 1448 | +} | |
| 1449 | + | |
| 1450 | +.cx-popup .top{ | |
| 1451 | + /* width: 90%; | |
| 1452 | + height:85rpx; */ | |
| 1453 | + font-size: 32rpx; | |
| 1454 | + padding: 20rpx 0; | |
| 1455 | + border-bottom: 2rpx solid #ebedf0; | |
| 1456 | + /* padding-top: 50rpx; | |
| 1457 | + font-weight:600; */ | |
| 1458 | + | |
| 1459 | +} | |
| 1460 | +.cx-popup .top-frame{ | |
| 1461 | + /* width: 100%; | |
| 1462 | + display: flex; | |
| 1463 | + justify-content: center; | |
| 1464 | + overflow: hidden; */ | |
| 1465 | +} | |
| 1466 | +.xc-valid-coupon{ | |
| 1467 | + width: 90%; | |
| 1468 | + height:40rpx; | |
| 1469 | + padding-top: 24rpx; | |
| 1470 | + overflow: hidden; | |
| 1471 | +} | |
| 1472 | +.xc-frame{ | |
| 1473 | + position: relative; | |
| 1474 | +} | |
| 1475 | +.xc-coupon-frame { | |
| 1476 | + width: 100%; | |
| 1477 | + max-height: 560rpx; | |
| 1478 | + overflow: auto; | |
| 1479 | + | |
| 1480 | +} | |
| 1481 | +.xc-coupon-frame .rel:not(:first-child) { | |
| 1482 | + margin-top: 20rpx; | |
| 1483 | +} | |
| 1484 | +.xc-coupon-frame .coupon { | |
| 1485 | + width:100%; | |
| 1486 | + height: 168rpx; | |
| 1487 | + border-radius: 25rpx; | |
| 1488 | + border:2rpx solid #ffdcdc; | |
| 1489 | + overflow: hidden; | |
| 1490 | + /* margin-top:16rpx; */ | |
| 1491 | + box-sizing: border-box; | |
| 1492 | + | |
| 1493 | +} | |
| 1494 | +/* .xc-coupon-frame .coupon ~ .coupon { | |
| 1495 | + margin-top:16rpx; | |
| 1496 | +} */ | |
| 1497 | +.xc-coupon-left{ | |
| 1498 | + width: 216rpx; | |
| 1499 | + /* height: 100%; */ | |
| 1500 | + background-color: #ffeeef; | |
| 1501 | + border-right: 4rpx dashed #ffdbd9; | |
| 1502 | + overflow: hidden; | |
| 1503 | + /* line-height: 100%; */ | |
| 1504 | + display: flex; | |
| 1505 | + flex-direction: column; | |
| 1506 | + justify-content: center; | |
| 1507 | + align-items: center; | |
| 1508 | + flex-shrink: 0; | |
| 1509 | +} | |
| 1510 | +.xc-money{ | |
| 1511 | + color: #f30026; | |
| 1512 | + text-align:center; | |
| 1513 | +} | |
| 1514 | +.xc-rmb{ | |
| 1515 | + /* width:44rpx; | |
| 1516 | + padding-top:7rpx; */ | |
| 1517 | +} | |
| 1518 | +.xc-money-frame{ | |
| 1519 | + /* margin-left:35rpx; | |
| 1520 | + margin-top:48rpx; */ | |
| 1521 | + | |
| 1522 | +} | |
| 1523 | +.xc-spacing{ | |
| 1524 | + letter-spacing:4rpx; | |
| 1525 | +} | |
| 1526 | +.xc-circular-one{ | |
| 1527 | + position: absolute; | |
| 1528 | + top:-15rpx; | |
| 1529 | + left:205rpx; | |
| 1530 | + width: 30rpx; | |
| 1531 | + height: 30rpx; | |
| 1532 | + background: #fff; | |
| 1533 | + overflow: hidden; | |
| 1534 | +} | |
| 1535 | +.xc-circular-two{ | |
| 1536 | + position: absolute; | |
| 1537 | + bottom: -15rpx; | |
| 1538 | + /* top:150rpx; */ | |
| 1539 | + left:205rpx; | |
| 1540 | + width: 30rpx; | |
| 1541 | + height:30rpx; | |
| 1542 | + background: #fff; | |
| 1543 | +} | |
| 1544 | +.xc-detail-coupon{ | |
| 1545 | + /* margin-left: 22rpx; | |
| 1546 | + overflow: hidden; | |
| 1547 | + padding-top: 43rpx; */ | |
| 1548 | + /* display: flex; | |
| 1549 | + align-items: center; */ | |
| 1550 | +} | |
| 1551 | +.xc-coupon-right{ | |
| 1552 | + /* width: 455rpx; | |
| 1553 | + height: 100%; */ | |
| 1554 | + background: #fffaf9; | |
| 1555 | + padding: 20rpx; | |
| 1556 | + box-sizing: border-box; | |
| 1557 | + width: 100%; | |
| 1558 | + justify-content: space-between; | |
| 1559 | + align-items: center; | |
| 1560 | +} | |
| 1561 | +.xc-below{ | |
| 1562 | + margin-top:20rpx; | |
| 1563 | + | |
| 1564 | +} | |
| 1565 | +.xc-get{ | |
| 1566 | + | |
| 1567 | + width: 140rpx; | |
| 1568 | + /* height: 48rpx; */ | |
| 1569 | + color: #fff; | |
| 1570 | + text-align: center; | |
| 1571 | + border-radius:27rpx; | |
| 1572 | + line-height:54rpx; | |
| 1573 | + /* margin-left:20rpx; */ | |
| 1574 | +} | |
| 1575 | + | |
| 1576 | +.background{ | |
| 1577 | + background:#f40028; | |
| 1578 | +} | |
| 1579 | +/*--不可使用--*/ | |
| 1580 | +.background.nouse{ | |
| 1581 | + background:gainsboro; | |
| 1582 | +} | |
| 1583 | + | |
| 1584 | +.xc-background{ | |
| 1585 | + background:#b9b9b9; | |
| 1586 | +} | |
| 1587 | + | |
| 1588 | + | |
| 1589 | +.cx-confirm{ | |
| 1590 | + width: 100%; | |
| 1591 | + padding: 20rpx; | |
| 1592 | + box-sizing: border-box; | |
| 1593 | + /* height: 160rpx; */ | |
| 1594 | + | |
| 1595 | +} | |
| 1596 | +.cx-confirm .confirm{ | |
| 1597 | + /* width: 372rpx; | |
| 1598 | + height: 60rpx; */ | |
| 1599 | + background-color: #f40026; | |
| 1600 | + color: #fff; | |
| 1601 | + border-radius:10rpx; | |
| 1602 | + line-height: 80rpx; | |
| 1603 | + font-size: 28rpx; | |
| 1604 | + | |
| 1605 | +} | |
| 1606 | + | |
| 1607 | +.up{ animation: up .7s; } | |
| 1608 | +.down{ animation: down 1s; } | |
| 1609 | +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } | |
| 1610 | +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } | |
| 1611 | + | |
| 1612 | + | |
| 1613 | +/* 分享 */ | |
| 1614 | +.icon-share { | |
| 1615 | + font-size: 46rpx; | |
| 1616 | + color: #d60021; | |
| 1617 | +} | |
| 1618 | +.xc-share-frame{ | |
| 1619 | + /* width: 129rpx; | |
| 1620 | + height: 48rpx; | |
| 1621 | + border-top-left-radius: 18rpx; | |
| 1622 | + border-bottom-left-radius: 18rpx; */ | |
| 1623 | + /* background: #d60021; */ | |
| 1624 | + /* position:absolute; | |
| 1625 | + left:622rpx; | |
| 1626 | + top:-37rpx; | |
| 1627 | + line-height:50rpx; | |
| 1628 | + margin-top:52rpx; */ | |
| 1629 | +} | |
| 1630 | +.xc-share-frame-jieti{ | |
| 1631 | + width: 129rpx; | |
| 1632 | + height: 48rpx; | |
| 1633 | + border-top-left-radius: 18rpx; | |
| 1634 | + border-bottom-left-radius: 18rpx; | |
| 1635 | + background: #d60021; | |
| 1636 | + line-height:50rpx; | |
| 1637 | +} | |
| 1638 | + | |
| 1639 | +.xc-share-frame .share-font,.xc-share-frame-jieti .share-font{ | |
| 1640 | + font-size: 32rpx; | |
| 1641 | + color:#fff; | |
| 1642 | + margin-left:10rpx; | |
| 1643 | + | |
| 1644 | +} | |
| 1645 | + | |
| 1646 | + | |
| 1647 | +.xc-share-frame .share-frame,.xc-share-frame-jieti .share-frame{ | |
| 1648 | + width: 30rpx; | |
| 1649 | + height: 30rpx; | |
| 1650 | + margin-top:9rpx; | |
| 1651 | + margin-left: 10rpx; | |
| 1652 | + | |
| 1653 | +} | |
| 1654 | +.xc-share { | |
| 1655 | + width:90%; | |
| 1656 | + height:800rpx; | |
| 1657 | + background:#fff; | |
| 1658 | + z-index:35; | |
| 1659 | +} | |
| 1660 | +.img-frame{ | |
| 1661 | + position: absolute; | |
| 1662 | + top: 175rpx; | |
| 1663 | + left:100rpx; | |
| 1664 | + z-index: 55; | |
| 1665 | + overflow:hidden; | |
| 1666 | + | |
| 1667 | +} | |
| 1668 | +.img-frame .img{ | |
| 1669 | + width: 100rpx; | |
| 1670 | + height: 100rpx; | |
| 1671 | + | |
| 1672 | +} | |
| 1673 | +.xc-share .top{ | |
| 1674 | + height: 85rpx; | |
| 1675 | + width: 100%; | |
| 1676 | + border-bottom: 4rpx dashed #f5f5f5; | |
| 1677 | + overflow:hidden; | |
| 1678 | + | |
| 1679 | +} | |
| 1680 | +.xc-share .name{ | |
| 1681 | + font-size: 25rpx; | |
| 1682 | + margin-left:180rpx; | |
| 1683 | + color:#000; | |
| 1684 | + | |
| 1685 | +} | |
| 1686 | + | |
| 1687 | +.xc-share .recommend{ | |
| 1688 | + width: 110rpx; | |
| 1689 | + height: 12rpx; | |
| 1690 | + color: #fff; | |
| 1691 | + background: #d60021; | |
| 1692 | + font-size: 20rpx; | |
| 1693 | + border-radius:25rpx; | |
| 1694 | + margin-left:10rpx; | |
| 1695 | + line-height:37rpx; | |
| 1696 | +} | |
| 1697 | +.xc-left-circle{ | |
| 1698 | + width: 40rpx; | |
| 1699 | + height: 25rpx; | |
| 1700 | + position: absolute; | |
| 1701 | + top:280rpx; | |
| 1702 | + left:29rpx; | |
| 1703 | + z-index: 55; | |
| 1704 | + background:#727272; | |
| 1705 | + border-radius:50rpx 50rpx 0 0; | |
| 1706 | + transform:rotate(90deg); | |
| 1707 | + | |
| 1708 | +} | |
| 1709 | +.xc-right-circle{ | |
| 1710 | + width: 40rpx; | |
| 1711 | + height: 25rpx; | |
| 1712 | + position: absolute; | |
| 1713 | + top: 280rpx; | |
| 1714 | + left:683rpx; | |
| 1715 | + z-index: 55; | |
| 1716 | + background:#727272; | |
| 1717 | + border-radius:50rpx 50rpx 0 0; | |
| 1718 | + transform:rotate(270deg); | |
| 1719 | + | |
| 1720 | +} | |
| 1721 | +.xc-circle-frame{ | |
| 1722 | + width: 25rpx; | |
| 1723 | + height: 40rpx; | |
| 1724 | + overflow: hidden; | |
| 1725 | +} | |
| 1726 | +.xc-goods-name{ | |
| 1727 | + width: 95%; | |
| 1728 | + font-size: 35rpx; | |
| 1729 | + padding-left: 75rpx; | |
| 1730 | + height: 50rpx; | |
| 1731 | + padding-top: 10rpx; | |
| 1732 | + color:#000; | |
| 1733 | + | |
| 1734 | +} | |
| 1735 | +.xc-good-img{ | |
| 1736 | + width: 100%; | |
| 1737 | + height: 381rpx; | |
| 1738 | + margin-top:5rpx; | |
| 1739 | + | |
| 1740 | +} | |
| 1741 | +.xc-good-img .img{ | |
| 1742 | + width: 90%; | |
| 1743 | + height: 381rpx; | |
| 1744 | +} | |
| 1745 | +.xc-ensure-frame{ | |
| 1746 | + width: 90%; | |
| 1747 | + height: 60rpx; | |
| 1748 | + border-bottom: 2rpx solid #d8d6d7; | |
| 1749 | +} | |
| 1750 | +.xc-ensure{ | |
| 1751 | + width: 30%; | |
| 1752 | + height: 60rpx; | |
| 1753 | + line-height: 60rpx; | |
| 1754 | +} | |
| 1755 | +xc-ensure-div{ | |
| 1756 | + width: 100%; | |
| 1757 | + height: 60rpx; | |
| 1758 | +} | |
| 1759 | +.xc-ensure .word{ | |
| 1760 | + font-size: 25rpx; | |
| 1761 | + color: #d30025; | |
| 1762 | + margin-left:9rpx; | |
| 1763 | + | |
| 1764 | +} | |
| 1765 | +.xc-ensure .img{ | |
| 1766 | + width: 25rpx; | |
| 1767 | + height: 25rpx; | |
| 1768 | + margin-top:18rpx; | |
| 1769 | + | |
| 1770 | +} | |
| 1771 | + | |
| 1772 | +.xc-bottmon{ | |
| 1773 | + width: 100%; | |
| 1774 | +} | |
| 1775 | +.xc-bottmon .xc-left{ | |
| 1776 | + width: 55%; | |
| 1777 | + margin-top:30rpx; | |
| 1778 | + padding-left:20rpx; | |
| 1779 | + | |
| 1780 | +} | |
| 1781 | +.xc-left .xc-top{ | |
| 1782 | + font-size: 25rpx; | |
| 1783 | + height:40rpx; | |
| 1784 | + line-height:40rpx; | |
| 1785 | + color:#000; | |
| 1786 | +} | |
| 1787 | +.xc-left .xc-middle{ | |
| 1788 | + font-size: 25rpx; | |
| 1789 | + color: #b2b2b2; | |
| 1790 | + height:30rpx; | |
| 1791 | + line-height:30rpx; | |
| 1792 | +} | |
| 1793 | +.xc-left .xc-buttem{ | |
| 1794 | + font-size: 25rpx; | |
| 1795 | + height:100rpx; | |
| 1796 | + line-height:100rpx; | |
| 1797 | + color:#000; | |
| 1798 | +} | |
| 1799 | +.xc-ensure-right{ | |
| 1800 | + width: 30%; | |
| 1801 | +} | |
| 1802 | +.xc-qrcode{ | |
| 1803 | + width:120rpx; | |
| 1804 | + height: 120rpx; | |
| 1805 | + margin-top:43rpx; | |
| 1806 | + margin-left:80rpx; | |
| 1807 | + | |
| 1808 | +} | |
| 1809 | +.xc-close{ | |
| 1810 | + width:50rpx; | |
| 1811 | + height:50rpx; | |
| 1812 | + border-radius:50%; | |
| 1813 | + border:3rpx solid #fff; | |
| 1814 | + text-align:center; | |
| 1815 | + line-height: 41rpx; | |
| 1816 | + font-size:50rpx; | |
| 1817 | + color:#fff; | |
| 1818 | + font-weight: lighter; | |
| 1819 | + font-family:MingLiU; | |
| 1820 | + transform:rotate(270deg); | |
| 1821 | + overflow:auto; | |
| 1822 | + margin-top:6rpx; | |
| 1823 | + margin-bottom:1rpx; | |
| 1824 | + | |
| 1825 | +} | |
| 1826 | +.xc-close-frame{ | |
| 1827 | + position:absolute; | |
| 1828 | + margin-top:30rpx; | |
| 1829 | + width:90%; | |
| 1830 | + display:flex; | |
| 1831 | + justify-content:center; | |
| 1832 | + overflow: auto; | |
| 1833 | + | |
| 1834 | +} | |
| 1835 | +.xc-guanbi{ | |
| 1836 | + width: 100%; | |
| 1837 | + height: 80rpx; | |
| 1838 | + overflow: hidden; | |
| 1839 | +} | |
| 1840 | + | |
| 1841 | + | |
| 1842 | +/* 自定义弹出窗口 */ | |
| 1843 | +.cx-popup{ | |
| 1844 | + width:100%; | |
| 1845 | + background: #fff; | |
| 1846 | + z-index: 35; | |
| 1847 | + border-top-left-radius: 10rpx; | |
| 1848 | + border-top-right-radius: 10rpx; | |
| 1849 | + position:fixed; | |
| 1850 | + bottom:0; | |
| 1851 | +} | |
| 1852 | + | |
| 1853 | +.xc-top-content{ | |
| 1854 | + width: 88%; | |
| 1855 | + height:85rpx; | |
| 1856 | + padding-top: 50rpx; | |
| 1857 | + font-size: 36rpx; | |
| 1858 | +} | |
| 1859 | + | |
| 1860 | + | |
| 1861 | +.xc-valid-coupon{ | |
| 1862 | + width: 90%; | |
| 1863 | + height:40rpx; | |
| 1864 | + padding-top: 24rpx; | |
| 1865 | + overflow: hidden; | |
| 1866 | +} | |
| 1867 | +.xc-frame { | |
| 1868 | + /* width: 100%; | |
| 1869 | + margin-top:20rpx; */ | |
| 1870 | + padding: 20rpx; | |
| 1871 | +} | |
| 1872 | + | |
| 1873 | +.xc-frame .list-frame{ | |
| 1874 | + width: 90%; | |
| 1875 | + height: 100%; | |
| 1876 | + overflow-y:scroll; | |
| 1877 | + | |
| 1878 | + margin-top:20rpx; | |
| 1879 | + | |
| 1880 | +} | |
| 1881 | +.xc-close-frame{ | |
| 1882 | + margin-top:30rpx; | |
| 1883 | + width:15%; | |
| 1884 | + display:flex; | |
| 1885 | +} | |
| 1886 | + | |
| 1887 | +.xc-close{ | |
| 1888 | + width:70rpx; | |
| 1889 | + height:70rpx; | |
| 1890 | + border-radius:50%; | |
| 1891 | + border:5rpx solid #a5a5a7; | |
| 1892 | + text-align:center; | |
| 1893 | + line-height: 55rpx; | |
| 1894 | + font-size:80rpx; | |
| 1895 | + color:#a5a5a7; | |
| 1896 | + font-family:"微软正黑体"; | |
| 1897 | + margin-top:8rpx; | |
| 1898 | + | |
| 1899 | +} | |
| 1900 | +.xc-money{ | |
| 1901 | + color: #ff0013; | |
| 1902 | +} | |
| 1903 | + | |
| 1904 | +.xc-money-frame{ | |
| 1905 | + /* margin-left:35rpx; */ | |
| 1906 | + | |
| 1907 | +} | |
| 1908 | +.xc-coupon-effect{ | |
| 1909 | + width: 99%; | |
| 1910 | + height: 128rpx; | |
| 1911 | + border-bottom:3rpx solid #ddd; | |
| 1912 | + | |
| 1913 | + | |
| 1914 | +} | |
| 1915 | +.xc-goods-coupon{ | |
| 1916 | + width: 80%; | |
| 1917 | + height:100%; | |
| 1918 | + | |
| 1919 | +} | |
| 1920 | +.xc-title{ | |
| 1921 | + width:50%; | |
| 1922 | + margin-left:222rpx; | |
| 1923 | + | |
| 1924 | +} | |
| 1925 | +.xc-coupon-money{ | |
| 1926 | + color: #c91e31; | |
| 1927 | + font-size: 35rpx; | |
| 1928 | + margin-top:20rpx; | |
| 1929 | + | |
| 1930 | +} | |
| 1931 | +.xc-coupon-time{ | |
| 1932 | + height: 50rpx; | |
| 1933 | + font-size: 27rpx; | |
| 1934 | + color: #a4a4a4; | |
| 1935 | +} | |
| 1936 | +.xc-coupon-time .time{ | |
| 1937 | + margin-left: 15rpx; | |
| 1938 | + font-size: 27rpx; | |
| 1939 | +} | |
| 1940 | +.xc-coupon-selection{ | |
| 1941 | + width:99%; | |
| 1942 | + height:100%; | |
| 1943 | + | |
| 1944 | + | |
| 1945 | +} | |
| 1946 | +.xc-confirm { | |
| 1947 | + width: 90%; | |
| 1948 | + height: 75rpx; | |
| 1949 | + margin:0 auto; | |
| 1950 | + background:#c41830; | |
| 1951 | + color:#fff; | |
| 1952 | + border-radius:10rpx; | |
| 1953 | + font-size:30rpx; | |
| 1954 | + margin-top: 50rpx; | |
| 1955 | +} | |
| 1956 | +.xc-not-Selection{ | |
| 1957 | + width: 60rpx; | |
| 1958 | + height: 60rpx; | |
| 1959 | + background: #eeeeee; | |
| 1960 | +} | |
| 1961 | + | |
| 1962 | +/*---------------视频图片---------------*/ | |
| 1963 | +.xc-imageCount { | |
| 1964 | + width:95rpx; | |
| 1965 | + height:50rpx; | |
| 1966 | + background-color: rgba(0, 0, 0, 0.3); | |
| 1967 | + border-radius:40rpx; | |
| 1968 | + line-height:50rpx; | |
| 1969 | + color:#fff; | |
| 1970 | + text-align:center; | |
| 1971 | + font-size:26rpx; | |
| 1972 | + position:absolute; | |
| 1973 | + | |
| 1974 | + right:23rpx; | |
| 1975 | + bottom:21rpx; | |
| 1976 | +} | |
| 1977 | + | |
| 1978 | + | |
| 1979 | +/* 视频图片的边框 */ | |
| 1980 | +.xc-videos-picture{ | |
| 1981 | + width: 100%; | |
| 1982 | + height: 750rpx; | |
| 1983 | +} | |
| 1984 | +/* 视频 */ | |
| 1985 | +.xc-videos{ | |
| 1986 | + width: 100%; | |
| 1987 | + height:544rpx; | |
| 1988 | + | |
| 1989 | + | |
| 1990 | +} | |
| 1991 | +/* 点击视频或图片 */ | |
| 1992 | +.xc-video-picture{ | |
| 1993 | + | |
| 1994 | + bottom: 20rpx; | |
| 1995 | + left: 0rpx; | |
| 1996 | + display: flex; | |
| 1997 | + align-items: center; | |
| 1998 | + justify-content:center; | |
| 1999 | + width: 45%; | |
| 2000 | + height: 60rpx; | |
| 2001 | + margin-left: 215rpx; | |
| 2002 | + | |
| 2003 | +} | |
| 2004 | +.xc-video-button:before{ | |
| 2005 | + content: ""; | |
| 2006 | + position: absolute; | |
| 2007 | + left: 48%; | |
| 2008 | + top: 40%; | |
| 2009 | + width: 0; | |
| 2010 | + height: 0; | |
| 2011 | + margin-left: -36rpx; | |
| 2012 | + margin-top: -10rpx; | |
| 2013 | + border-width:13rpx; | |
| 2014 | + border-style: dashed; | |
| 2015 | + border-color: transparent transparent transparent #fff; | |
| 2016 | + font-size: 0; | |
| 2017 | + line-height: 0; | |
| 2018 | + z-index: 2; | |
| 2019 | + -webkit-backface-visibility: hidden; | |
| 2020 | +} | |
| 2021 | +.xc-video-buttons:before{ | |
| 2022 | + content: ""; | |
| 2023 | + position: absolute; | |
| 2024 | + left: 50%; | |
| 2025 | + top:41%; | |
| 2026 | + width: 0; | |
| 2027 | + height: 0; | |
| 2028 | + margin-left: -36rpx; | |
| 2029 | + margin-top: -10rpx; | |
| 2030 | + border-width:13rpx; | |
| 2031 | + border-style: dashed; | |
| 2032 | + border-color: transparent transparent transparent #000; | |
| 2033 | + font-size: 0; | |
| 2034 | + line-height: 0; | |
| 2035 | + z-index: 2; | |
| 2036 | + -webkit-backface-visibility: hidden; | |
| 2037 | +} | |
| 2038 | + | |
| 2039 | +.xc-video{ | |
| 2040 | + /* width:100rpx; */ | |
| 2041 | + /* height: 50rpx; | |
| 2042 | + line-height: 50rpx; */ | |
| 2043 | + text-align: center; | |
| 2044 | + /* margin-left:-30rpx; */ | |
| 2045 | + | |
| 2046 | + | |
| 2047 | +} | |
| 2048 | +/* 图片 */ | |
| 2049 | +.xc-picture{ | |
| 2050 | + color: #000; | |
| 2051 | + background: #dcdcdc; | |
| 2052 | + width: 94rpx; | |
| 2053 | + height: 45rpx; | |
| 2054 | + font-size: 25rpx; | |
| 2055 | + border-radius: 25rpx; | |
| 2056 | + font-family: 'SimHei',Arial; | |
| 2057 | + text-align: center; | |
| 2058 | + line-height: 45rpx; | |
| 2059 | + margin-left:53rpx | |
| 2060 | + | |
| 2061 | +} | |
| 2062 | +/* 点击视频 */ | |
| 2063 | +.xc-video-button{ | |
| 2064 | + position: relative; | |
| 2065 | + color: #000; | |
| 2066 | + background: #dcdcdc; | |
| 2067 | + width: 85rpx; | |
| 2068 | + height: 45rpx; | |
| 2069 | + line-height: 45rpx; | |
| 2070 | + font-size: 30rpx; | |
| 2071 | + border-radius: 25rpx; | |
| 2072 | + font-family: 'SimHei',Arial; | |
| 2073 | + padding-left: 11rpx; | |
| 2074 | +} | |
| 2075 | + | |
| 2076 | + | |
| 2077 | +.xc-sn{ | |
| 2078 | + color: #fff; | |
| 2079 | + background: #c7161e; | |
| 2080 | + border-color: transparent transparent transparent #fff; | |
| 2081 | +} | |
| 2082 | +/* 图片 */ | |
| 2083 | +.xc-pictures{ | |
| 2084 | + width: 100%; | |
| 2085 | + height:529rpx; | |
| 2086 | + | |
| 2087 | +} | |
| 2088 | +/*视频封面的图片 */ | |
| 2089 | +.xc-picturess{ | |
| 2090 | + position: relative; | |
| 2091 | + width: 100%; | |
| 2092 | + height:529rpx; | |
| 2093 | +} | |
| 2094 | +/* 播放 */ | |
| 2095 | +.xc-play{ | |
| 2096 | + width: 130rpx; | |
| 2097 | + height: 130rpx; | |
| 2098 | + position: absolute; | |
| 2099 | + top:207rpx; | |
| 2100 | + left:309rpx; | |
| 2101 | +} | |
| 2102 | + | |
| 2103 | +.xc-video-buttons{ | |
| 2104 | + position: relative; | |
| 2105 | + color: #000; | |
| 2106 | + background: #dcdcdc; | |
| 2107 | + width: 85rpx; | |
| 2108 | + height: 45rpx; | |
| 2109 | + line-height: 45rpx; | |
| 2110 | + font-size: 30rpx; | |
| 2111 | + border-radius: 25rpx; | |
| 2112 | + font-family: 'SimHei',Arial; | |
| 2113 | + padding-left: 11rpx; | |
| 2114 | +} | |
| 2115 | + | |
| 2116 | + | |
| 2117 | +.wsize{font-size: 32rpx} | |
| 2118 | +.five-level-word{font-size: 24rpx;} | |
| 2119 | + | |
| 2120 | + | |
| 2121 | +/*-- 推荐商品 --*/ | |
| 2122 | +.xc-goods{ | |
| 2123 | + height: auto; | |
| 2124 | + background: #f2f2f2; | |
| 2125 | + padding: 0 20rpx; | |
| 2126 | + margin-top: -25rpx; | |
| 2127 | + padding-bottom: 20rpx | |
| 2128 | +} | |
| 2129 | + | |
| 2130 | +.xc-goods-recommend { | |
| 2131 | + border-radius: 20rpx; | |
| 2132 | + width:345rpx; | |
| 2133 | + height: 450rpx; | |
| 2134 | + margin-top: 25rpx; | |
| 2135 | + display: inline-block; | |
| 2136 | + | |
| 2137 | +} | |
| 2138 | + | |
| 2139 | +.xc-goods-recommend.ml{ margin-left: 22rpx} | |
| 2140 | + | |
| 2141 | +.xc-goods-recommend .xc-goods-imgs{ | |
| 2142 | + width: 100%; | |
| 2143 | + height: 325rpx; | |
| 2144 | + border-radius:20rpx 20rpx 0 0; | |
| 2145 | +} | |
| 2146 | + | |
| 2147 | +.xc-goods-bottom{ | |
| 2148 | + width: 345rpx; | |
| 2149 | + height: 134rpx; | |
| 2150 | + background: #fff; | |
| 2151 | + border-radius:0 0 20rpx 20rpx; | |
| 2152 | + bottom:-8rpx; | |
| 2153 | + left:0rpx; | |
| 2154 | +} | |
| 2155 | +.xc-goods-bottom .monry-frame{ | |
| 2156 | + width:283rpx; | |
| 2157 | +height:52rpx; | |
| 2158 | +padding-left:24rpx; | |
| 2159 | + | |
| 2160 | +} | |
| 2161 | +.xc-good-explain{ | |
| 2162 | + width: 283rpx; | |
| 2163 | + height:60rpx; | |
| 2164 | + word-break: normal; | |
| 2165 | + margin-left:30rpx; | |
| 2166 | + font-size: 26rpx; | |
| 2167 | + line-height: 30rpx; | |
| 2168 | + margin-top: 5rpx; | |
| 2169 | +} | |
| 2170 | +.money-color-val{ | |
| 2171 | + color: #c6172f; | |
| 2172 | +} | |
| 2173 | +.rmb-symbol{ | |
| 2174 | + line-height:81rpx; | |
| 2175 | + height:53rpx; | |
| 2176 | + font-size: 28rpx; | |
| 2177 | +} | |
| 2178 | +.xc-original-price{ | |
| 2179 | + color: #c0c0c0; | |
| 2180 | +} | |
| 2181 | +/* 文字中间加线条 */ | |
| 2182 | +.word-lines{ | |
| 2183 | + text-decoration:line-through; | |
| 2184 | + line-height:90rpx; | |
| 2185 | + margin-left:10rpx; | |
| 2186 | + font-size: 20rpx; | |
| 2187 | +} | |
| 2188 | + | |
| 2189 | + .xc-linellae-frame{ | |
| 2190 | + width: 100%; | |
| 2191 | + height: 70rpx; | |
| 2192 | + background: #f2f2f2; | |
| 2193 | +} | |
| 2194 | +.xc-linellae-frame .xc-linellae{ | |
| 2195 | + width: 386rpx; | |
| 2196 | + height: 1rpx; | |
| 2197 | + border-bottom: 1rpx solid #ebedf0; | |
| 2198 | +} | |
| 2199 | +.xc-recommend-frame{ | |
| 2200 | +background:#f2f2f2; | |
| 2201 | +width:97rpx; | |
| 2202 | +height:100%; | |
| 2203 | +padding-left: 10rpx; | |
| 2204 | +} | |
| 2205 | +.xc-recommend-frame .xc-recommend{ | |
| 2206 | + width: 35rpx; | |
| 2207 | + height: 27rpx; | |
| 2208 | +} | |
| 2209 | +.xc-recommend-frame .xc-recommend-word{ | |
| 2210 | + width:58rpx; | |
| 2211 | +font-size:24rpx; | |
| 2212 | +color: #a9a9a9; | |
| 2213 | +margin-left: 5rpx; | |
| 2214 | +margin-bottom: 5rpx; | |
| 2215 | +margin-top: 1rpx; | |
| 2216 | + | |
| 2217 | +} | |
| 2218 | +.xc-price-frame{ | |
| 2219 | + color: #ec0022; | |
| 2220 | + align-items: baseline; | |
| 2221 | +/* height:44rpx; */ | |
| 2222 | +} | |
| 2223 | +.xc-price-frame .sign{ | |
| 2224 | +margin-top:19rpx; | |
| 2225 | +margin-left:-4px; | |
| 2226 | +} | |
| 2227 | +.xc-val-price{ | |
| 2228 | +margin-left:24rpx; | |
| 2229 | +color: #ec0022; | |
| 2230 | +padding-top:13rpx; | |
| 2231 | +} | |
| 2232 | +.xc-val-price .save{ | |
| 2233 | + border-radius:10rpx; | |
| 2234 | + margin-top:5rpx; | |
| 2235 | + background:#fed2d9; | |
| 2236 | + min-width:230rpx; | |
| 2237 | + height:40rpx; | |
| 2238 | + line-height:40rpx; | |
| 2239 | + width: auto; | |
| 2240 | + padding-left:12rpx; | |
| 2241 | + padding-right:12rpx; | |
| 2242 | + | |
| 2243 | +} | |
| 2244 | +.xc-unit-price{ | |
| 2245 | + margin-top:25rpx; | |
| 2246 | +padding-left:-4rpx; | |
| 2247 | + | |
| 2248 | +} | |
| 2249 | +.xc-explain{ | |
| 2250 | + color:#292929; | |
| 2251 | + width:542rpx; | |
| 2252 | + margin: 10rpx 0 20rpx; | |
| 2253 | + width: 100%; | |
| 2254 | + font-weight: bold; | |
| 2255 | +} | |
| 2256 | +.xc-item{width: 16%; font-size: 26rpx; color: #666;margin-right:5rpx;} | |
| 2257 | +.xc-item .yuan{ | |
| 2258 | + width: 38rpx; | |
| 2259 | + height: 38rpx; | |
| 2260 | + line-height: 38rpx; | |
| 2261 | + border:1rpx solid #f3f1f2; | |
| 2262 | +margin-left:33rpx; | |
| 2263 | + | |
| 2264 | +} | |
| 2265 | +.xc-item .word{ | |
| 2266 | + width:104rpx; | |
| 2267 | + margin-top:16rpx; | |
| 2268 | + color:#363636; | |
| 2269 | + font-weight:600; | |
| 2270 | + | |
| 2271 | +} | |
| 2272 | +.xc-item .circle-color{ | |
| 2273 | + background: #d60024; | |
| 2274 | + color: #fff; | |
| 2275 | +} | |
| 2276 | +.xc-item .circle-color1{ | |
| 2277 | + background: #fefefe; | |
| 2278 | + color: #666666; | |
| 2279 | +} | |
| 2280 | +.link{ | |
| 2281 | +height:6rpx; | |
| 2282 | +width:180rpx; | |
| 2283 | +top:54rpx; | |
| 2284 | +left:32px; | |
| 2285 | +} | |
| 2286 | +.link1{ | |
| 2287 | +height:6rpx; | |
| 2288 | +width:166rpx; | |
| 2289 | +top:54rpx; | |
| 2290 | +left:264rpx; | |
| 2291 | +} | |
| 2292 | +.link2{ | |
| 2293 | + height:6rpx; | |
| 2294 | +width:157rpx; | |
| 2295 | +top:54rpx; | |
| 2296 | +right:87rpx; | |
| 2297 | +} | |
| 2298 | +.link-color-red{ | |
| 2299 | + background: #d60024;} | |
| 2300 | +.link-color{ | |
| 2301 | + background: #e5e5e5; | |
| 2302 | +} | |
| 2303 | +.xc-qt-price{ | |
| 2304 | + /* font-style: italic; */ | |
| 2305 | + top:-23rpx; | |
| 2306 | +left:40rpx; | |
| 2307 | + color: #fff; | |
| 2308 | +} | |
| 2309 | +.presell_price{ | |
| 2310 | + /* font-style: italic; */ | |
| 2311 | + | |
| 2312 | + top: 23rpx; | |
| 2313 | + left:40rpx; | |
| 2314 | + color: #fff; | |
| 2315 | + justify-content: space-between; | |
| 2316 | +} | |
| 2317 | +.xc-qt-price .xc-qtunit-price{ | |
| 2318 | + margin-left:6rpx; | |
| 2319 | +margin-top:-4rpx; | |
| 2320 | +} | |
| 2321 | +.xc-nanber{ | |
| 2322 | + top:-25rpx; | |
| 2323 | +left:289rpx; | |
| 2324 | + | |
| 2325 | +} | |
| 2326 | +.xc-qtsign{ | |
| 2327 | +margin-top:5rpx; | |
| 2328 | + | |
| 2329 | +} | |
| 2330 | +.xc-people-img{ | |
| 2331 | + height: 36rpx; | |
| 2332 | + width: 36rpx; | |
| 2333 | + background: #fff; | |
| 2334 | + border-radius: 7rpx; | |
| 2335 | + | |
| 2336 | +} | |
| 2337 | +.xc-people-img .imgs{ | |
| 2338 | + width: 28rpx; | |
| 2339 | + height: 28rpx; | |
| 2340 | + margin-top:4rpx; | |
| 2341 | + | |
| 2342 | +} | |
| 2343 | +.xc-people-val{ | |
| 2344 | + | |
| 2345 | + height: 32rpx; | |
| 2346 | + border-top: 1rpx solid #fff; | |
| 2347 | + border-bottom: 1rpx solid #fff; | |
| 2348 | + border-right: 1rpx solid #fff; | |
| 2349 | + border-radius:0 7rpx 7rpx 0; | |
| 2350 | + line-height:32rpx; | |
| 2351 | + margin-left:-6rpx; | |
| 2352 | + padding: 0 12rpx; | |
| 2353 | +} | |
| 2354 | +.word-color{ | |
| 2355 | + color:#d70024; | |
| 2356 | +} | |
| 2357 | +.word-color-lan{ | |
| 2358 | + color:#0393e1; | |
| 2359 | +} | |
| 2360 | +.pt_view .hy-stop{ | |
| 2361 | + top: -23rpx; | |
| 2362 | + right: 56rpx; | |
| 2363 | +} | |
| 2364 | +.xc-time-val{width:36rpx;height:36rpx;border-radius:7rpx; line-height: 36rpx;} | |
| 2365 | +.xc-time{margin-right:10rpx; margin-left:10rpx; margin-top:-32rpx; | |
| 2366 | +} | |
| 2367 | +.xc-goods-explain{ | |
| 2368 | + width:100%; | |
| 2369 | + /* padding-left:30rpx; | |
| 2370 | + margin-left:-9rpx; | |
| 2371 | + height: 150rpx */ | |
| 2372 | +} | |
| 2373 | +.xc-partner-frame{ | |
| 2374 | +border-bottom:2rpx solid #eee; | |
| 2375 | +width:100%; | |
| 2376 | +padding:20rpx; | |
| 2377 | +/* height:56rpx; */ | |
| 2378 | +box-sizing: border-box; | |
| 2379 | +} | |
| 2380 | +.xc-person-number{ | |
| 2381 | + width:120rpx; | |
| 2382 | + color: #999999; | |
| 2383 | + padding-left:8rpx; | |
| 2384 | + text-align: left | |
| 2385 | +} | |
| 2386 | + | |
| 2387 | +.xc-miaosha-time{ | |
| 2388 | +right:17rpx; top:55rpx; | |
| 2389 | +} | |
| 2390 | +.pd_top1{padding-top: 10rpx} | |
| 2391 | +.s_ms_bth{margin-top: 85rpx} | |
| 2392 | + | |
| 2393 | + | |
| 2394 | +.no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx} | |
| 2395 | +/* 门店地址 */ | |
| 2396 | +.xc-address_frame{ | |
| 2397 | + /* border-top:1rpx solid #eee; */ | |
| 2398 | + width: 100%; | |
| 2399 | + height: auto; | |
| 2400 | + padding: 20rpx; | |
| 2401 | + box-sizing: border-box; | |
| 2402 | +} | |
| 2403 | +.on_height{ | |
| 2404 | +height: 90rpx; | |
| 2405 | +} | |
| 2406 | +.sn_height{ | |
| 2407 | + /* min-height: 170rpx; height: auto;padding: 10rpx 0; */ | |
| 2408 | +} | |
| 2409 | +.xc-address_frame .address_frame{ | |
| 2410 | + width: 100%; | |
| 2411 | +/* padding-left: 10rpx; | |
| 2412 | +margin: auto; */ | |
| 2413 | + | |
| 2414 | +} | |
| 2415 | +.shop_name{ | |
| 2416 | + | |
| 2417 | +} | |
| 2418 | +.stores-img{ | |
| 2419 | + width: 28rpx; | |
| 2420 | + height: 28rpx; | |
| 2421 | + margin-right: 10rpx; | |
| 2422 | +} | |
| 2423 | +.shop_name{ | |
| 2424 | + margin-right: 10rpx; | |
| 2425 | +} | |
| 2426 | +.address{ | |
| 2427 | + /* width: 100%; | |
| 2428 | + margin-top: 5rpx; | |
| 2429 | + margin-bottom: 5rpx; */ | |
| 2430 | +} | |
| 2431 | +.distance{ | |
| 2432 | + padding-left: 20rpx; | |
| 2433 | + padding-right: 20rpx; | |
| 2434 | + background: #eee; | |
| 2435 | + border-radius: 20rpx; | |
| 2436 | + /* margin-right: 5rpx; */ | |
| 2437 | + color: #999; | |
| 2438 | + height: 38rpx; | |
| 2439 | +line-height: 38rpx; | |
| 2440 | + | |
| 2441 | +} | |
| 2442 | +/* 选择门店的弹窗 */ | |
| 2443 | +.mongolia-layer{ | |
| 2444 | + position: fixed; | |
| 2445 | +left: 0; | |
| 2446 | +top: 0; | |
| 2447 | +right: 0; | |
| 2448 | +bottom: 0; | |
| 2449 | +z-index: 11; | |
| 2450 | +background: rgba(0,0,0,0.4); | |
| 2451 | +width: 100%; | |
| 2452 | +height: 91.9%; | |
| 2453 | + | |
| 2454 | +} | |
| 2455 | + | |
| 2456 | +.popup-frame{ | |
| 2457 | +position: fixed; | |
| 2458 | +z-index: 20; | |
| 2459 | +background: white; | |
| 2460 | +width: 100%; | |
| 2461 | +border-radius: 20rpx 20rpx 0 0; | |
| 2462 | +height: auto; | |
| 2463 | +bottom: 0; | |
| 2464 | +} | |
| 2465 | +.popup-top{ | |
| 2466 | + border-bottom: 1rpx solid #eee; | |
| 2467 | + height: 155rpx; | |
| 2468 | + width: 95%; | |
| 2469 | + margin: auto; | |
| 2470 | + line-height: 155rpx; | |
| 2471 | + | |
| 2472 | +} | |
| 2473 | +.bg_rights{ | |
| 2474 | + border-top: 2rpx solid ; | |
| 2475 | + border-right: 2rpx solid ; | |
| 2476 | + transform: rotate(45deg); | |
| 2477 | + display:inline-block; | |
| 2478 | + width:15rpx;height:15rpx; | |
| 2479 | + border-color:#da0b31; | |
| 2480 | +} | |
| 2481 | +.modal-closes { | |
| 2482 | + position: absolute; | |
| 2483 | + right: 30rpx; | |
| 2484 | + top: -15rpx; | |
| 2485 | + height: 25rpx; | |
| 2486 | + | |
| 2487 | +} | |
| 2488 | +.choose_more{ | |
| 2489 | + margin-top: 40rpx; | |
| 2490 | + margin-right: 20rpx; | |
| 2491 | + | |
| 2492 | +} | |
| 2493 | +.choose_mores{ | |
| 2494 | + margin-top: 30rpx; | |
| 2495 | + margin-right: 15rpx; | |
| 2496 | + | |
| 2497 | +} | |
| 2498 | +.store-list{ | |
| 2499 | + width: 95%; | |
| 2500 | + min-height: 300rpx; | |
| 2501 | + overflow-y: scroll; | |
| 2502 | + margin: auto; | |
| 2503 | + max-height: 610rpx; | |
| 2504 | +} | |
| 2505 | +.store-list .store_choose{ | |
| 2506 | + width: 100%; | |
| 2507 | + height: 120rpx; | |
| 2508 | + line-height: 125rpx; | |
| 2509 | + border-bottom: 1rpx solid #eee; | |
| 2510 | + | |
| 2511 | +} | |
| 2512 | +.store-list .store_choose .store{ | |
| 2513 | +width: 100%; | |
| 2514 | +margin: auto; | |
| 2515 | +line-height: 37rpx; | |
| 2516 | +padding-left: 20rpx; | |
| 2517 | + | |
| 2518 | +} | |
| 2519 | +.xc-hook{ | |
| 2520 | + width: 35rpx; | |
| 2521 | + height: 35rpx; | |
| 2522 | + transform: rotate(-145deg); | |
| 2523 | +line-height: 37rpx; | |
| 2524 | +text-align: center; | |
| 2525 | +} | |
| 2526 | + .xc-hooks{ | |
| 2527 | + width: 30rpx; | |
| 2528 | + height: 30rpx; | |
| 2529 | + border: 1rpx solid #999; | |
| 2530 | + } | |
| 2531 | + .address-frame{ | |
| 2532 | + width: 93%; | |
| 2533 | +margin-left: 7rpx; | |
| 2534 | + | |
| 2535 | + } | |
| 2536 | + .nearby_store{ | |
| 2537 | +margin-left: 17rpx; | |
| 2538 | + } | |
| 2539 | + .address_name{ | |
| 2540 | + margin-right: 10rpx; | |
| 2541 | + | |
| 2542 | + } | |
| 2543 | + .address-val{ | |
| 2544 | + height: 38rpx; | |
| 2545 | +line-height: 38rpx; | |
| 2546 | + | |
| 2547 | + } | |
| 2548 | + .store-bottom{ | |
| 2549 | + width: 85%; | |
| 2550 | + margin: auto; | |
| 2551 | + height: 90rpx; | |
| 2552 | + } | |
| 2553 | + .determine{ | |
| 2554 | + width: 260rpx; | |
| 2555 | + height: 55rpx; | |
| 2556 | + border-radius: 50rpx; | |
| 2557 | + line-height: 55rpx; | |
| 2558 | + } | |
| 2559 | + .default{ | |
| 2560 | + width: 260rpx; | |
| 2561 | + height: 55rpx; | |
| 2562 | + border:3rpx solid #c8c8c8; | |
| 2563 | + border-radius: 50rpx; | |
| 2564 | + line-height: 55rpx; | |
| 2565 | + } | |
| 2566 | + .store-bottom-frame{ | |
| 2567 | + width: 95%; | |
| 2568 | + margin: auto; | |
| 2569 | + | |
| 2570 | + } | |
| 2571 | + /* 门店分类列表 */ | |
| 2572 | +.sort_store_list{ | |
| 2573 | + height: 82%; | |
| 2574 | + overflow: hidden; | |
| 2575 | + overflow-y: scroll; | |
| 2576 | + width: 95%; | |
| 2577 | + margin: auto; | |
| 2578 | +} | |
| 2579 | +.sort_store_list .sort-store-frame{ | |
| 2580 | + width: 100%; | |
| 2581 | +height: 100rpx; | |
| 2582 | +line-height:100rpx; | |
| 2583 | +border-bottom: 1rpx solid #eee; | |
| 2584 | + | |
| 2585 | +} | |
| 2586 | +.sort_store_list .sort-store-frame .sort-store{ | |
| 2587 | + width: 94.5%; | |
| 2588 | + margin: auto; | |
| 2589 | +} | |
| 2590 | +.black_rights-frame{ | |
| 2591 | +width: 50%; | |
| 2592 | +} | |
| 2593 | +.black_rights-frame .black_rights{ | |
| 2594 | + border-top: 3rpx solid; | |
| 2595 | +border-right: 3rpx solid; | |
| 2596 | +transform: rotate(45deg); | |
| 2597 | +display: inline-block; | |
| 2598 | +width: 20rpx; | |
| 2599 | +height: 20rpx; | |
| 2600 | +} | |
| 2601 | +.xc-val-money{ | |
| 2602 | + height:55rpx; | |
| 2603 | +} | |
| 2604 | + | |
| 2605 | +.xc-distance-bottom{ | |
| 2606 | + margin-bottom: 40rpx; | |
| 2607 | +} | |
| 2608 | +.xc-distance-top{ | |
| 2609 | +margin-top: 10rpx; | |
| 2610 | +} | |
| 2611 | +.xc-width{ | |
| 2612 | + width: 100%; | |
| 2613 | +} | |
| 2614 | +.right-arrow{ width: 15rpx; height:15rpx; | |
| 2615 | + border-top: 2rpx solid #d70026; | |
| 2616 | + border-right: 2rpx solid #d70026; | |
| 2617 | + transform: rotate(45deg);display:inline-block; | |
| 2618 | + margin-bottom:3rpx; | |
| 2619 | +} | |
| 2620 | +.xc-goods-attribute{ | |
| 2621 | + border-bottom: 1px solid #eee; | |
| 2622 | +padding-bottom: 20rpx; | |
| 2623 | +/* margin-bottom:40rpx; */ | |
| 2624 | +} | |
| 2625 | +.xc-val-fream{ | |
| 2626 | + width: 105rpx; | |
| 2627 | +} | |
| 2628 | +.is_stock{ | |
| 2629 | +width: 58%; | |
| 2630 | +height: 70rpx; | |
| 2631 | +border-radius: 55rpx; | |
| 2632 | +} | |
| 2633 | +.select_store_height{ | |
| 2634 | + height: 50rpx; | |
| 2635 | +} | |
| 2636 | +.butttem5{ | |
| 2637 | + margin-bottom: 5rpx; | |
| 2638 | +} | |
| 2639 | + | |
| 2640 | +.no_pj_list{text-align: center; width: 100%; color: #999; margin-top: 30rpx; display: inline-block; font-size: 28rpx} | |
| 2641 | + | |
| 2642 | + | |
| 2643 | +.join-cart>view.no_store { | |
| 2644 | + width: 58%; background-color: #adadad; | |
| 2645 | +} | |
| 2646 | + | |
| 2647 | +.s_btn{ margin-top: 25rpx; } | |
| 2648 | +/* 美妆价的样式 */ | |
| 2649 | +.beauty-makeup-frame{ | |
| 2650 | + /* width: 101.5%; | |
| 2651 | + margin: auto; */ | |
| 2652 | + height: 120rpx; | |
| 2653 | + border-radius: 15rpx; | |
| 2654 | + margin-top: 10px; | |
| 2655 | + | |
| 2656 | +} | |
| 2657 | +.beauty-makeup-frame .left{ | |
| 2658 | + width: 80%; | |
| 2659 | + height: 100%; | |
| 2660 | + background:#f7f7f7; | |
| 2661 | + border-radius: 20rpx 0rpx 0rpx 20rpx; | |
| 2662 | + /* padding: 0 10rpx; */ | |
| 2663 | +} | |
| 2664 | + .card-frame{ | |
| 2665 | + margin-top: 0rpx; | |
| 2666 | + /* padding-right: 23rpx; | |
| 2667 | + margin-right: 15rpx; */ | |
| 2668 | +} | |
| 2669 | +.advert-card{ | |
| 2670 | + margin-top: 0rpx!important; | |
| 2671 | + | |
| 2672 | +} | |
| 2673 | +.beauty-makeup-frame .right{ | |
| 2674 | + width: 20%; | |
| 2675 | + height: 100%; | |
| 2676 | + background:#f3efe3; | |
| 2677 | + border-radius: 0rpx 20rpx 20rpx 0rpx; | |
| 2678 | + } | |
| 2679 | +.grade-card-frame{ | |
| 2680 | + | |
| 2681 | + /* height:45rpx ; */ | |
| 2682 | + background: #3c300a; | |
| 2683 | + border-radius: 20rpx; | |
| 2684 | + /* margin-top: 10px; | |
| 2685 | + margin-left: 7rpx; */ | |
| 2686 | + justify-content: center; | |
| 2687 | + padding: 4rpx 12rpx; | |
| 2688 | +} | |
| 2689 | +.grade-card-frame .img{ | |
| 2690 | + width: 24rpx; | |
| 2691 | + height: 24rpx; | |
| 2692 | + margin-top: 2px; | |
| 2693 | + | |
| 2694 | +} | |
| 2695 | +.grade-card-frame .card-name{ | |
| 2696 | + margin-left: 8rpx; | |
| 2697 | + /* max-width: 120rpx; */ | |
| 2698 | + max-width: 165rpx; | |
| 2699 | +} | |
| 2700 | +.card-effect{ | |
| 2701 | + /* margin-left: 15rpx; */ | |
| 2702 | +} | |
| 2703 | +.at_once_carde{ | |
| 2704 | + width:65rpx; | |
| 2705 | + height: 75rpx; | |
| 2706 | + line-height:38rpx; | |
| 2707 | +} | |
| 2708 | +.bg_right{ width: 18rpx; height:18rpx; | |
| 2709 | + border-top: 2rpx solid #333; | |
| 2710 | + border-right: 2rpx solid #333; | |
| 2711 | + transform: rotate(45deg);display:inline-block; | |
| 2712 | + margin-bottom:3rpx; | |
| 2713 | + | |
| 2714 | +} | |
| 2715 | +.carde_frame{ | |
| 2716 | + height: 50rpx; | |
| 2717 | + line-height: 18rpx | |
| 2718 | +} | |
| 2719 | + | |
| 2720 | +button.custom-service { line-height: normal; border: 0;} | |
| 2721 | +button.custom-service::after{ | |
| 2722 | + border: 0; | |
| 2723 | +} | |
| 2724 | +.no_store{color:#d60021; font-size: 26rpx;} | |
| 2725 | +.cx_show_view{ width: 580rpx; /* line-height: 30rpx; margin-bottom: 6rpx; */ } | |
| 2726 | +.cx_show_view .word{ width: 400rpx} | |
| 2727 | +.prom_condition { | |
| 2728 | + color: #d60021; | |
| 2729 | + /* width: 180rpx; */ | |
| 2730 | + /* height: 30rpx; */ | |
| 2731 | + font-size: 20rpx; | |
| 2732 | + /* padding-top: 0.01rpx; */ | |
| 2733 | + /* display: flex; | |
| 2734 | + justify-content: center; | |
| 2735 | + align-items: center; */ | |
| 2736 | + border: 2rpx solid #d60021; | |
| 2737 | + border-radius: 10rpx; | |
| 2738 | + margin-right:10rpx ; | |
| 2739 | + /* margin-left: 10rpx; */ | |
| 2740 | + font-size: 24rpx; | |
| 2741 | + padding: 0 10rpx; | |
| 2742 | +} | |
| 2743 | +.hui_img{ width: 44rpx; height: 44rpx; margin-right: 8rpx} | |
| 2744 | +.order_hui{color: #444; width: 420rpx} | |
| 2745 | +.order_hui view{ height: 34rpx; line-height: 34rpx;} | |
| 2746 | +.dp_img{width: 240rpx; height: 240rpx; margin: 0 40rpx} | |
| 2747 | +.dp_cx_view{border-bottom: 0.02rpx solid #eee; padding-bottom: 40rpx} | |
| 2748 | +.act_content{ margin-top: 40rpx} | |
| 2749 | +.act_content view{ margin-bottom: 12rpx} | |
| 2750 | +.color_b{color: #ff9c00} | |
| 2751 | + | |
| 2752 | +.poster-container { | |
| 2753 | + box-sizing: border-box; | |
| 2754 | + position: fixed; | |
| 2755 | + top: 50%; | |
| 2756 | + left: 50%; | |
| 2757 | + transform: translate(-50%, -50%); | |
| 2758 | + width: calc(100% - 120rpx); | |
| 2759 | + z-index: 1000; | |
| 2760 | +} | |
| 2761 | +.mask { | |
| 2762 | + position: fixed; | |
| 2763 | + top: 0; | |
| 2764 | + left: 0; | |
| 2765 | + width: 100%; | |
| 2766 | + height: 100%; | |
| 2767 | + z-index: 999; | |
| 2768 | + background-color: rgba(0,0,0,.4); | |
| 2769 | +} | |
| 2770 | +.poster-wrapper { | |
| 2771 | + width: 100%; | |
| 2772 | +} | |
| 2773 | + | |
| 2774 | +.poster { | |
| 2775 | + box-sizing: border-box; | |
| 2776 | + width: 100%; | |
| 2777 | + height: 1055rpx; | |
| 2778 | + border-radius: 20rpx; | |
| 2779 | + /* box-shadow: 0 8px 12px #666; */ | |
| 2780 | + position: relative; | |
| 2781 | + z-index: 999; | |
| 2782 | + overflow: hidden; | |
| 2783 | +} | |
| 2784 | +.poster-img { | |
| 2785 | + display: block; | |
| 2786 | + width: 100%; | |
| 2787 | + height: 100%; | |
| 2788 | +} | |
| 2789 | +.btn-container { | |
| 2790 | + display: flex; | |
| 2791 | + justify-content: space-around; | |
| 2792 | +} | |
| 2793 | +.btn-share { | |
| 2794 | + display: block; | |
| 2795 | + background-color: #FE6867; | |
| 2796 | + color: white; | |
| 2797 | + border-radius: 8rpx; | |
| 2798 | + line-height: 80rpx; | |
| 2799 | + margin-top: 28rpx; | |
| 2800 | + padding: 0 60rpx; | |
| 2801 | +} | |
| 2802 | +/* .btn-close { | |
| 2803 | + background-color: rgba(0,0,0,.5); | |
| 2804 | + color: white; | |
| 2805 | + width: 40rpx; | |
| 2806 | + height: 40rpx; | |
| 2807 | + line-height: 40rpx; | |
| 2808 | + text-align: center; | |
| 2809 | + border-radius: 50%; | |
| 2810 | + position: absolute; | |
| 2811 | + right: 20rpx; | |
| 2812 | + top: 10rpx; | |
| 2813 | +} */ | |
| 2814 | + | |
| 2815 | +.goods-price .rel_txt{ | |
| 2816 | + /* position: relative; top: 32rpx; */ | |
| 2817 | + font-size: 30rpx; | |
| 2818 | +} | |
| 2819 | +.goods-price .rel_img{width: 62rpx; height: 62rpx;position: relative; top: 8rpx;} | |
| 2820 | + | |
| 2821 | +.btn-close { | |
| 2822 | + /* background-color: rgba(0,0,0,.5); */ | |
| 2823 | + color: #ccc; | |
| 2824 | + width: 50rpx; | |
| 2825 | + height: 50rpx; | |
| 2826 | + line-height: 50rpx; | |
| 2827 | + text-align: center; | |
| 2828 | + border-radius: 50%; | |
| 2829 | + position: absolute; | |
| 2830 | + right: 20rpx; | |
| 2831 | + top: 20rpx; | |
| 2832 | +} | |
| 2833 | + | |
| 2834 | +.icon-close { | |
| 2835 | + font-size: 48rpx; | |
| 2836 | +} | |
| 2837 | +.quan_price{ | |
| 2838 | + background-color: #ff4700; color: #fff; padding: 10rpx 25rpx; margin-left: 10rpx; border-radius: 30rpx; | |
| 2839 | +} | |
| 2840 | + | |
| 2841 | +/*--闪白屏--*/ | |
| 2842 | +.g_img_box{ | |
| 2843 | + background-position: center center; | |
| 2844 | + background-repeat: no-repeat; | |
| 2845 | + -webkit-background-size: cover; | |
| 2846 | + -moz-background-size: cover; | |
| 2847 | + background-size: cover; | |
| 2848 | +} | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | +.arrow { | |
| 2853 | + width: auto !important; | |
| 2854 | + position: absolute; | |
| 2855 | + right: 0; | |
| 2856 | + top: 10rpx; | |
| 2857 | +} | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | +/* 支付预售定金 */ | |
| 2866 | +.price-container { | |
| 2867 | + top: 50%; | |
| 2868 | + padding-left: 40rpx; | |
| 2869 | + transform: translateY(-50%); | |
| 2870 | + color: white; | |
| 2871 | + font-weight: bold; | |
| 2872 | +} | |
| 2873 | + | |
| 2874 | +.rmb { | |
| 2875 | + display: relative; | |
| 2876 | +} | |
| 2877 | + | |
| 2878 | +.rmb::before { | |
| 2879 | + content: '¥'; | |
| 2880 | + font-size: 24rpx; | |
| 2881 | +} | |
| 2882 | + | |
| 2883 | +.no-bold { | |
| 2884 | + font-weight: normal; | |
| 2885 | +} | |
| 2886 | + | |
| 2887 | +.bg-FF4732 { | |
| 2888 | + background-color: #FF4732; | |
| 2889 | +} | |
| 2890 | + | |
| 2891 | +.line { | |
| 2892 | + position: relative; | |
| 2893 | +} | |
| 2894 | + | |
| 2895 | +.line::before { | |
| 2896 | + position: absolute; | |
| 2897 | + left: 0; | |
| 2898 | + top: 50%; | |
| 2899 | + transform: translateY(-50%); | |
| 2900 | + content: ''; | |
| 2901 | + width: 2rpx; | |
| 2902 | + height: 60%; | |
| 2903 | + background-color: rgba(255,255,255,.4); | |
| 2904 | +} | |
| 2905 | + | |
| 2906 | + | |
| 2907 | +.logo-container { | |
| 2908 | + -webkit-filter: brightness(80%); | |
| 2909 | + filter: brightness(80%); | |
| 2910 | +} | |
| 2911 | + | |
| 2912 | +.logo { | |
| 2913 | + width: 132rpx; | |
| 2914 | + height: 37rpx; | |
| 2915 | + margin-right: 10rpx; | |
| 2916 | +} | |
| 2917 | + | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -102,7 +102,12 @@ |
| 102 | 102 | <image class="abs" style="width: 120rpx;top: 32rpx; right: 220rpx;" mode="widthFix" src='{{iurl+"/miniapp/images/activity-time.png"}}'></image> |
| 103 | 103 | |
| 104 | 104 | <image class="secondkill-img" src='{{iurl+"/miniapp/images/group_img.png"}}'></image> |
| 105 | - <view class="stop fs26 abs" style="color: #fff;" style="color: #fff;top: 22rpx" >结束时间</view> | |
| 105 | + <view class="stop fs26 abs" style="color: #fff;" style="color: #fff;top: 22rpx" > | |
| 106 | + | |
| 107 | + <block wx:if="{{prom_st==0 && !prom_r_null}}">开始时间</block> | |
| 108 | + <block wx:else>结束时间</block> | |
| 109 | + | |
| 110 | + </view> | |
| 106 | 111 | <view class="secview flex abs fs24 xc-miaosha-time" style="color: #fff;top: 68rpx"> |
| 107 | 112 | <block wx:if="djs.day">{{djs.day}}天</block>{{djs.hou}}小时{{djs.min}}分{{djs.sec}}秒 |
| 108 | 113 | </view> | ... | ... |
pages/goods/goodsList/goodsList.wxss
| ... | ... | @@ -21,7 +21,7 @@ page { |
| 21 | 21 | display: flex; |
| 22 | 22 | align-items: center; |
| 23 | 23 | justify-content: center; |
| 24 | - font-size: 26rpx; | |
| 24 | + font-size: 28rpx; | |
| 25 | 25 | border-bottom: 1px solid #f5f5f5; |
| 26 | 26 | background-color: #fff; |
| 27 | 27 | } |
| ... | ... | @@ -114,13 +114,13 @@ page { |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | .item-cont .title { |
| 117 | - font-size: 26rpx; | |
| 117 | + font-size: 28rpx; | |
| 118 | 118 | height: 72rpx; |
| 119 | 119 | margin-bottom: 20rpx; |
| 120 | 120 | /* padding-right: 10rpx; */ |
| 121 | 121 | line-height: 36rpx; |
| 122 | 122 | color: #2C2C2C; |
| 123 | - text-align: justify; | |
| 123 | + /* text-align: justify; */ | |
| 124 | 124 | overflow: hidden; |
| 125 | 125 | } |
| 126 | 126 | ... | ... |
pages/user/coupons/coupons.wxml
| ... | ... | @@ -176,7 +176,7 @@ |
| 176 | 176 | <view class="qr-container"> |
| 177 | 177 | <canvas class="qrcode" canvas-id="qrcode"/> |
| 178 | 178 | </view> |
| 179 | - <view class="pdb30 c-7b fs26 bdt"> | |
| 179 | + <view class="pdv20 c-7b fs26 bdt"> | |
| 180 | 180 | <text wx:if="{{details[useIndex].ValidDate}}" class="ellipsis-1x">有效期:{{details[useIndex].BeginDate==null ? " " : time.replace_time2(details[useIndex].BeginDate)}} 至 {{time.replace_time2(details[useIndex].ValidDate)}}</text> |
| 181 | 181 | <text wx:elif="{{details[useIndex].use_end_time}}" class="ellipsis-1x">有效期:{{details[useIndex].use_start_time==null ? " " : time.format_time(details[useIndex].use_start_time)}} 至 {{time.format_time(details[useIndex].use_end_time)}}</text> |
| 182 | 182 | <text wx:else>有效期:不限</text> | ... | ... |
pages/user/coupons/coupons.wxss
| ... | ... | @@ -392,7 +392,7 @@ page { |
| 392 | 392 | .tab-head-item.active::after { |
| 393 | 393 | content: ''; |
| 394 | 394 | width: 60%; |
| 395 | - height: 2rpx; | |
| 395 | + height: 4rpx; | |
| 396 | 396 | background-color: #fe0000; |
| 397 | 397 | position: absolute; |
| 398 | 398 | bottom: 0; |
| ... | ... | @@ -562,7 +562,7 @@ page { |
| 562 | 562 | font-size: 32rpx; |
| 563 | 563 | position: absolute; |
| 564 | 564 | right: 10rpx; |
| 565 | - top: 10rpx; | |
| 565 | + top: 2rpx; | |
| 566 | 566 | /* transform: translateY(-50%); */ |
| 567 | 567 | transition: all 0.3s; |
| 568 | 568 | } | ... | ... |
pages/user/index/index.wxml
| ... | ... | @@ -313,8 +313,8 @@ |
| 313 | 313 | |
| 314 | 314 | <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"--> |
| 315 | 315 | <view class="tc_view" hidden='{{tc_hide}}' bindtap='hide_tc'> |
| 316 | - <view class="modal-box" hidden="{{flag}}" bindtap="hide"></view> | |
| 317 | - <view class="modal-body"> | |
| 316 | + <view class="modal-box" hidden="{{flag}}" bindtap="hide" catchtouchmove="true"></view> | |
| 317 | + <view class="modal-body" catchtouchmove="true"> | |
| 318 | 318 | <view class="modal-content"> |
| 319 | 319 | <view class="flex"> |
| 320 | 320 | <image src="{{userInfo.head_pic}}" class="hd_img"></image> | ... | ... |
pages/user/index/index.wxss
| ... | ... | @@ -537,11 +537,14 @@ |
| 537 | 537 | |
| 538 | 538 | .modal-body { |
| 539 | 539 | position: fixed; |
| 540 | - top: 80rpx; | |
| 540 | + top: 0; | |
| 541 | + bottom: 0; | |
| 541 | 542 | left: 0; |
| 543 | + right: 0; | |
| 544 | + margin: auto; | |
| 542 | 545 | z-index: 100; |
| 543 | 546 | background: #fff; |
| 544 | - margin-left: 73rpx; | |
| 547 | + /* margin-left: 73rpx; */ | |
| 545 | 548 | width: 600rpx; |
| 546 | 549 | height: 860rpx; |
| 547 | 550 | border-radius: 8px; | ... | ... |