Commit 8eed5c9df2abff0a4a8a443258af70aa34d5d551
Merge branch 'test' into 'qa'
Test See merge request !105
Showing
57 changed files
with
8290 additions
and
2953 deletions
app.js
| ... | ... | @@ -9,8 +9,8 @@ App({ |
| 9 | 9 | setting: t, |
| 10 | 10 | wechatUser: null, |
| 11 | 11 | userInfo: null, |
| 12 | - config: null, | |
| 13 | - config2: null, | |
| 12 | + config: null, //门店参数 | |
| 13 | + config2: null, //门店配置 | |
| 14 | 14 | code: null, |
| 15 | 15 | heigth:0, |
| 16 | 16 | user_id: null,// 4379287,// null,// 5682068, |
| ... | ... | @@ -19,13 +19,14 @@ App({ |
| 19 | 19 | wuliuprice: null, //物流价格表 |
| 20 | 20 | wuliu: null, //物流公司 |
| 21 | 21 | baddr:null, |
| 22 | - mobile: null, //记录手机 | |
| 23 | - getu:null, //记录会员信息 | |
| 22 | + mobile: null, //记录手机 | |
| 23 | + getu:null, //记录会员信息 | |
| 24 | 24 | sessionKey: null,//记录会员信息 |
| 25 | 25 | openid: null, //记录会员信息 |
| 26 | 26 | |
| 27 | - to_group:null, //参团传递的数据 | |
| 28 | - wxapp_buy_obj:null,//微信小程序购买的Object | |
| 27 | + to_group:null, //参团传递的数据 | |
| 28 | + wxapp_buy_obj:null, //微信小程序购买的Object | |
| 29 | + pk_store:null, //选择的门店 | |
| 29 | 30 | |
| 30 | 31 | }, |
| 31 | 32 | auth: o, |
| ... | ... | @@ -47,7 +48,6 @@ App({ |
| 47 | 48 | app.globalData.user_id= app.globalData.userInfo.user_id; |
| 48 | 49 | } |
| 49 | 50 | } |
| 50 | - | |
| 51 | 51 | }, |
| 52 | 52 | |
| 53 | 53 | //---初始化第三方---- |
| ... | ... | @@ -58,6 +58,8 @@ App({ |
| 58 | 58 | var t = wx.getExtConfigSync(), o = this.globalData.setting; |
| 59 | 59 | console.log(t); |
| 60 | 60 | t.appName ? (o.appName = t.appName, o.stoid = t.stoid) : tt=1; |
| 61 | + | |
| 62 | + | |
| 61 | 63 | }, |
| 62 | 64 | |
| 63 | 65 | //首页的第一次登录 |
| ... | ... | @@ -109,7 +111,7 @@ App({ |
| 109 | 111 | success: function (o) { |
| 110 | 112 | console.log('getConfig2'); |
| 111 | 113 | if (o.data.code == 0) { |
| 112 | - e.globalData.config = o.data.data, "function" == typeof t && t(e.globalData.config); | |
| 114 | + e.globalData.config2 = o.data.data, "function" == typeof t && t(e.globalData.config2); | |
| 113 | 115 | } |
| 114 | 116 | } |
| 115 | 117 | }); |
| ... | ... | @@ -287,10 +289,64 @@ App({ |
| 287 | 289 | }, |
| 288 | 290 | |
| 289 | 291 | //显示提示,word提示内容,type 0失败,提示 1成功 |
| 290 | - my_warnning(word,type,that){ | |
| 292 | + my_warnning(word,type,that,width){ | |
| 291 | 293 | var warn = that.selectComponent("#warn"); //组件的id |
| 292 | - warn.open(word,type); | |
| 294 | + warn.open(word,type,width); | |
| 293 | 295 | return 1; |
| 294 | - } | |
| 296 | + }, | |
| 297 | + | |
| 298 | + //获取会员门店 | |
| 299 | + get_user_store:function (func) | |
| 300 | + { | |
| 301 | + var th=this; | |
| 302 | + //---空会员的情况--- | |
| 303 | + if(!th.globalData.userInfo){ | |
| 304 | + return func(null); | |
| 305 | + } | |
| 306 | + if(!this.globalData.pk_store){ | |
| 307 | + var pick_id=0; | |
| 308 | + //先找一个会员是否有设置默认的地址 | |
| 309 | + if(th.globalData.userInfo.def_pickup_id){ | |
| 310 | + pick_id= th.globalData.userInfo.def_pickup_id | |
| 311 | + } | |
| 312 | + //查找会员的注册的地址 | |
| 313 | + else if(th.globalData.userInfo.pickup_id){ | |
| 314 | + pick_id= th.globalData.userInfo.pickup_id | |
| 315 | + } | |
| 316 | + //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- | |
| 317 | + if(pick_id==0) return func(null); | |
| 318 | + //获取用户注册时候的门店 | |
| 319 | + th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+this.globalData.userInfo.pickup_id,{ | |
| 320 | + data:{}, | |
| 321 | + success:function (res) { | |
| 322 | + th.globalData.pk_store=res.data.data; | |
| 323 | + func(th.globalData.pk_store); | |
| 324 | + } | |
| 325 | + }) | |
| 326 | + }else{ | |
| 327 | + func(this.globalData.pk_store); | |
| 328 | + } | |
| 329 | + }, | |
| 330 | + | |
| 331 | + //-------获取购物车数量---------- | |
| 332 | + requestCardNum: function() { | |
| 333 | + var th = this; | |
| 334 | + th.request.get("/api/weshop/cart/page", { | |
| 335 | + data: { | |
| 336 | + store_id: th.globalData.setting.stoid, | |
| 337 | + user_id: th.globalData.user_id, | |
| 338 | + }, | |
| 339 | + success: function(e) { | |
| 340 | + var num = 0; | |
| 341 | + for (var i = 0; i < e.data.data.pageData.length; i++) { | |
| 342 | + num += e.data.data.pageData[i].goods_num; | |
| 343 | + } | |
| 344 | + wx.setTabBarBadge({ //tabbar右上角添加文本 | |
| 345 | + index: 2, ////tabbar下标 | |
| 346 | + text: '' + num //显示的内容 | |
| 347 | + }); | |
| 348 | + } | |
| 349 | + }); | |
| 350 | + }, | |
| 295 | 351 | |
| 296 | 352 | }); | ... | ... |
app.json
| ... | ... | @@ -68,10 +68,16 @@ |
| 68 | 68 | "pages/user/user_spsy/user_spsy", |
| 69 | 69 | "pages/user/user_fw/user_fw", |
| 70 | 70 | "pages/user/user_coupon/user_coupon", |
| 71 | - "pages/user/grow_value/grow_value" | |
| 71 | + "pages/user/grow_value/grow_value", | |
| 72 | + "pages/payment/pay_success/pay_success" | |
| 72 | 73 | |
| 73 | 74 | ], |
| 74 | - "window": { | |
| 75 | + "permission": { | |
| 76 | + "scope.userLocation": { | |
| 77 | + "desc": "获取你的位置信息" | |
| 78 | + } | |
| 79 | + }, | |
| 80 | + "window": { | |
| 75 | 81 | "backgroundTextStyle": "light", |
| 76 | 82 | "navigationBarTextStyle": "black", |
| 77 | 83 | "navigationBarTitleText": "加载中...", |
| ... | ... | @@ -84,6 +90,7 @@ |
| 84 | 90 | "selectedColor": "#f23030", |
| 85 | 91 | "borderStyle": "white", |
| 86 | 92 | "backgroundColor": "#ffffff", |
| 93 | + | |
| 87 | 94 | "list": [ |
| 88 | 95 | { |
| 89 | 96 | "pagePath": "pages/index/index/index", | ... | ... |
app.wxss
| ... | ... | @@ -77,7 +77,7 @@ button { |
| 77 | 77 | .modal-close { |
| 78 | 78 | position: absolute; |
| 79 | 79 | right: 25rpx; |
| 80 | - top: 25rpx; | |
| 80 | + top:40rpx; | |
| 81 | 81 | } |
| 82 | 82 | .no-data { |
| 83 | 83 | width: 100%; |
| ... | ... | @@ -220,7 +220,7 @@ justify-content:space-around; |
| 220 | 220 | border-right: 2rpx solid ; |
| 221 | 221 | transform: rotate(45deg); |
| 222 | 222 | display:inline-block; |
| 223 | - width:18rpx;height:18rpx;border-color:#da0b31;margin-top:6rpx; | |
| 223 | + width:18rpx;height:18rpx;border-color:#da0b31; | |
| 224 | 224 | |
| 225 | 225 | } |
| 226 | 226 | /*********************** 7.15 */ |
| ... | ... | @@ -308,6 +308,17 @@ justify-content:space-around; |
| 308 | 308 | .xc-ash{ |
| 309 | 309 | color: #b9b9b9; |
| 310 | 310 | } |
| 311 | +.xc-ash-9f{ | |
| 312 | + color: #9fa1a0; | |
| 313 | + | |
| 314 | +} | |
| 315 | + | |
| 316 | +.xc-ash_c999{ | |
| 317 | +color: #999; | |
| 318 | +} | |
| 319 | +.xc-ash-b{ | |
| 320 | +background: #b9b9b9; | |
| 321 | +} | |
| 311 | 322 | .xc-black{ |
| 312 | 323 | color: #000; |
| 313 | 324 | } |
| ... | ... | @@ -315,6 +326,9 @@ color: #b9b9b9; |
| 315 | 326 | color: #333; |
| 316 | 327 | } |
| 317 | 328 | |
| 329 | +.xc-black3{ | |
| 330 | +color: #333; | |
| 331 | +} | |
| 318 | 332 | |
| 319 | 333 | .xc-fixed{ |
| 320 | 334 | position: fixed; |
| ... | ... | @@ -326,6 +340,9 @@ position: fixed; |
| 326 | 340 | .yellow-co{ |
| 327 | 341 | color: #ffb03f; |
| 328 | 342 | } |
| 343 | +.yellow{ | |
| 344 | + background-color: #ffb03f; | |
| 345 | +} | |
| 329 | 346 | .green{ |
| 330 | 347 | background-color: #16ba63; |
| 331 | 348 | } |
| ... | ... | @@ -358,6 +375,9 @@ background: #ffe3e2; |
| 358 | 375 | .fs40 { |
| 359 | 376 | font-size: 40rpx; |
| 360 | 377 | } |
| 361 | -.ai_and{ | |
| 362 | - align-items:flex-end; | |
| 378 | +.ai_end{ | |
| 379 | + align-items: flex-end; | |
| 363 | 380 | } |
| 381 | +.flex-wrap{ | |
| 382 | + flex-wrap:wrap; | |
| 383 | +} | |
| 364 | 384 | \ No newline at end of file | ... | ... |
components/long_warn/long_warn.js
| ... | ... | @@ -8,12 +8,17 @@ Component({ |
| 8 | 8 | is_show:0, |
| 9 | 9 | type:0, //0 提示,失败 1成功 |
| 10 | 10 | iurl:t.globalData.setting.imghost, |
| 11 | + width:0, | |
| 11 | 12 | }, |
| 12 | 13 | |
| 13 | 14 | methods: { |
| 14 | - open:function (e,type) { | |
| 15 | + open:function (e,type,width) { | |
| 15 | 16 | var that=this; |
| 16 | - this.setData({is_show:1,val:e,type:type}); | |
| 17 | + if(width!=undefined) { | |
| 18 | + this.setData({is_show:1,val:e,type:type,width:width}); | |
| 19 | + }else{ | |
| 20 | + this.setData({is_show:1,val:e,type:type}); | |
| 21 | + } | |
| 17 | 22 | setTimeout(function () { |
| 18 | 23 | that.setData({is_show:0}); |
| 19 | 24 | },2000); | ... | ... |
components/long_warn/long_warn.wxml
| 1 | 1 | <view class="rim" wx:if="{{is_show}}"> |
| 2 | 2 | <view class="content flex-center"> |
| 3 | - <view class="con_view"> | |
| 3 | + <view class="con_view" style="width:{{width>0?width+'rpx':'auto'}}"> | |
| 4 | 4 | <view class="con_view_img"> |
| 5 | 5 | <image wx:if="{{type}}" src="{{iurl}}/miniapp/images/sucess_g.png"></image><!-- 成功 --> |
| 6 | 6 | <image wx:else src="{{iurl}}/miniapp/images/gt.png"></image> <!-- 失败 --> | ... | ... |
components/qr_code/qr_code.js
components/qr_code/qr_code.wxml
| 1 | + | |
| 1 | 2 | <view class="xc-pop-up" wx:if="{{q_show}}"> |
| 2 | - <view class="xc-obscuration" bindtap='close'></view> | |
| 3 | +<!-- <scroll-view scroll-y="false" style=" height: 100%;"> --> | |
| 4 | + <view class="xc-obscuration" bindtap='close' catchtouchmove="ture"></view> | |
| 3 | 5 | <view> |
| 4 | 6 | <view class="xc-qr-frame"> |
| 7 | + | |
| 5 | 8 | <view class="barqrcode"> |
| 6 | 9 | <view class="barcode" wx:if="{{!is_fw}}"> |
| 7 | - <canvas canvas-id="barcode{{item.index}}" wx:for="{{barcode_canvas}}" /> | |
| 10 | + <canvas canvas-id="barcode{{item.index}}" wx:for="{{barcode_canvas}}" /> | |
| 8 | 11 | <view class="q_code">{{object.val}}</view> |
| 9 | 12 | </view> |
| 10 | 13 | <view class="qrcode_rim {{is_fw==1?'mt':''}}"> |
| 11 | - <canvas class="qrcode" canvas-id="qrcode{{item.index}}" wx:for="{{barcode_canvas}}" /> | |
| 14 | + <canvas class="qrcode" canvas-id="qrcode{{item.index}}" wx:for="{{barcode_canvas}}" /> | |
| 12 | 15 | <view class="r-code">{{object.content}}</view> |
| 13 | 16 | <view class="r-code flex" wx:if="{{object.is_quan}}">有效时间:{{object.now}} 至 <view>{{object.validay}}</view></view> |
| 14 | 17 | <block wx:if="{{object.is_quan}}"> |
| ... | ... | @@ -18,7 +21,9 @@ |
| 18 | 21 | <view></view> |
| 19 | 22 | </view> |
| 20 | 23 | </view> |
| 24 | + | |
| 21 | 25 | </view> |
| 22 | 26 | <view class="shut" bindtap="close">ⅹ</view> |
| 23 | 27 | </view> |
| 28 | +<!-- </scroll-view> --> | |
| 24 | 29 | </view> |
| 25 | 30 | \ No newline at end of file | ... | ... |
components/qr_code/qr_code.wxss
| ... | ... | @@ -6,7 +6,11 @@ |
| 6 | 6 | display:flex; |
| 7 | 7 | justify-content:center; |
| 8 | 8 | align-items:center; |
| 9 | + | |
| 9 | 10 | } |
| 11 | +/* page{ | |
| 12 | + overflow-y: hidden; | |
| 13 | +} */ | |
| 10 | 14 | |
| 11 | 15 | .xc-obscuration{ |
| 12 | 16 | position: fixed; |
| ... | ... | @@ -33,28 +37,36 @@ align-items:center; |
| 33 | 37 | height: auto; |
| 34 | 38 | padding-bottom:20rpx; |
| 35 | 39 | left:35rpx; |
| 40 | + overflow: hidden; | |
| 41 | + | |
| 42 | + | |
| 36 | 43 | |
| 37 | 44 | } |
| 38 | 45 | |
| 39 | 46 | /* 二维码和条形码的边框 */ |
| 40 | 47 | .barqrcode{ |
| 41 | 48 | width: 100%; |
| 42 | - height: auto; | |
| 49 | + height: 100%; | |
| 43 | 50 | margin-top:30rpx; |
| 51 | +position: relative; | |
| 52 | +top: 0rpx; | |
| 53 | +left: 0rpx; | |
| 44 | 54 | |
| 45 | 55 | } |
| 46 | 56 | /* 点击条形 */ |
| 47 | 57 | .barcode { |
| 48 | 58 | height:150rpx; |
| 49 | 59 | width: 620rpx; |
| 50 | - padding-left:30rpx; | |
| 60 | + | |
| 51 | 61 | text-align:center; |
| 62 | + position:absolute; | |
| 63 | + left: 30rpx | |
| 52 | 64 | } |
| 53 | 65 | canvas{ |
| 54 | 66 | width:100%; |
| 55 | 67 | height:55px; |
| 56 | 68 | display:block; |
| 57 | -position:relative; | |
| 69 | + | |
| 58 | 70 | } |
| 59 | 71 | .q_code{ |
| 60 | 72 | font-size:28rpx; |
| ... | ... | @@ -66,10 +78,13 @@ letter-spacing:6rpx; |
| 66 | 78 | /* 二维码边框*/ |
| 67 | 79 | .qrcode_rim { |
| 68 | 80 | width: 550rpx; |
| 69 | - height:580rpx; | |
| 81 | + height:520rpx; | |
| 70 | 82 | display:flex; |
| 71 | 83 | flex-direction:column; |
| 72 | -margin-left:74rpx; | |
| 84 | + | |
| 85 | +position: absolute; | |
| 86 | +left: 74rpx; | |
| 87 | +top: 130rpx; | |
| 73 | 88 | |
| 74 | 89 | |
| 75 | 90 | } |
| ... | ... | @@ -82,7 +97,8 @@ margin-left:74rpx; |
| 82 | 97 | } |
| 83 | 98 | .r-code{ |
| 84 | 99 | font-size:28rpx; |
| 85 | - text-align: center | |
| 100 | + padding-left: 25rpx; | |
| 101 | + | |
| 86 | 102 | } |
| 87 | 103 | |
| 88 | 104 | .shut{ | ... | ... |
pages/cart/cart/cart.js
| 1 | -var t = getApp(), a = t.request, oo = t.globalData.setting, app = getApp(), rq = t.request; | |
| 1 | +var t = getApp(), | |
| 2 | + a = t.request, | |
| 3 | + oo = t.globalData.setting, | |
| 4 | + app = getApp(), | |
| 5 | + rq = t.request; | |
| 2 | 6 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 3 | 7 | |
| 4 | 8 | Page({ |
| 5 | - data: { | |
| 6 | - url: t.globalData.setting.url, | |
| 7 | - resourceUrl: t.globalData.setting.resourceUrl, | |
| 8 | - requestData: null, | |
| 9 | - checkAllToggle: 0, | |
| 10 | - total_fee:0, | |
| 11 | - allsto:null, | |
| 12 | - imgUrl:t.globalData.setting.imghost, | |
| 13 | - }, | |
| 14 | - onLoad: function() { | |
| 15 | - | |
| 16 | - wx.setNavigationBarTitle({ title: "购物车",}) | |
| 17 | - | |
| 18 | - var a = this; | |
| 19 | - t.auth.hadAuth() && t.getUserInfo(function() { | |
| 20 | - a.getCardList(); | |
| 9 | + data: { | |
| 10 | + url: t.globalData.setting.url, | |
| 11 | + resourceUrl: t.globalData.setting.resourceUrl, | |
| 12 | + iurl: t.globalData.setting.imghost, | |
| 13 | + requestData: null, | |
| 14 | + checkAllToggle: 0, | |
| 15 | + total_fee: 0, //结算金额 | |
| 16 | + total_num: 0, //结算数量 | |
| 17 | + all_num: 0, //购物车中所有商品数量 | |
| 18 | + allsto: null, | |
| 19 | + imgUrl: t.globalData.setting.imghost, | |
| 20 | + is_has_flash: 0, //是否又秒杀活动 | |
| 21 | + is_edit: 0, //是否编辑 | |
| 22 | + is_load: 0, //是否已加载 | |
| 23 | + up_dating: 0, //更新中 | |
| 24 | + isreduce: 0, //商品数量是否可减 | |
| 25 | + isadd: 0, //是否可以加商品数量 | |
| 26 | + }, | |
| 27 | + | |
| 28 | + onLoad: function() { | |
| 29 | + wx.setNavigationBarTitle({ | |
| 30 | + title: "购物车", | |
| 31 | + }) | |
| 32 | + var a = this; | |
| 33 | + //判断是否有登陆 | |
| 34 | + t.auth.hadAuth() && t.getUserInfo(function() { | |
| 35 | + a.getCardList(); | |
| 36 | + }); | |
| 37 | + }, | |
| 38 | + onShow: function() { | |
| 39 | + var th = this; | |
| 40 | + this.getCardList(); | |
| 41 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | |
| 42 | + //--获取是否又秒杀活动-- | |
| 43 | + getApp().request.promiseGet("/api/ms/flash_sale/spikepage", { | |
| 44 | + data: { | |
| 45 | + store_id: oo.stoid, | |
| 46 | + timetype: 2, | |
| 47 | + is_end: 0, | |
| 48 | + is_show: 1, | |
| 49 | + pageSize: 1 | |
| 50 | + }, | |
| 51 | + }).then(res => { | |
| 52 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData.length > 0) { | |
| 53 | + th.setData({ | |
| 54 | + is_has_flash: 1 | |
| 55 | + }) | |
| 56 | + } | |
| 57 | + }); | |
| 58 | + | |
| 59 | + }, | |
| 60 | + | |
| 61 | + //-------------获取购物车列表,要安装门店进行分类订单----------- | |
| 62 | + getCardList: function() { | |
| 63 | + var th = this; | |
| 64 | + //如果门店还未读出来的时候 | |
| 65 | + if (th.data.allsto == null) { | |
| 66 | + //读取门店 | |
| 67 | + app.get_allsto(function(e) { | |
| 68 | + th.setData({ | |
| 69 | + allsto: e | |
| 21 | 70 | }); |
| 22 | - }, | |
| 23 | - onShow: function() { | |
| 24 | - this.getCardList(); | |
| 25 | - }, | |
| 26 | - | |
| 27 | - //-------------获取购物车列表,要安装门店进行分类订单----------- | |
| 28 | - getCardList: function () { | |
| 29 | - var th = this; | |
| 30 | - //如果门店还未读出来的时候 | |
| 31 | - if (th.data.allsto==null){ | |
| 32 | - //读取门店 | |
| 33 | - app.get_allsto(function(e){ | |
| 34 | - th.setData({ allsto: e}); | |
| 35 | - th.get_cart(); | |
| 36 | - }) | |
| 37 | - }else{ th.get_cart();} | |
| 71 | + th.get_cart(); | |
| 72 | + }) | |
| 73 | + } else { | |
| 74 | + th.get_cart(); | |
| 75 | + } | |
| 38 | 76 | }, |
| 39 | 77 | //-----真的获取购物车-------- |
| 40 | - get_cart:function(){ | |
| 41 | - var th=this; | |
| 78 | + get_cart: function() { | |
| 79 | + var th = this; | |
| 42 | 80 | var rd = Math.random().toString(36).substr(2, 15); |
| 43 | 81 | getApp().request.get("/api/weshop/cart/list", { |
| 44 | 82 | data: { |
| 45 | - user_id: app.globalData.user_id, rd: rd, | |
| 46 | - store_id: oo.stoid,pageSize:600}, | |
| 47 | - success: function (su) { | |
| 48 | - console.log("333"); | |
| 49 | - console.log(th.data.allsto); | |
| 50 | - | |
| 83 | + user_id: app.globalData.user_id, | |
| 84 | + rd: rd, | |
| 85 | + store_id: oo.stoid, | |
| 86 | + pageSize: 600 | |
| 87 | + }, | |
| 88 | + success: function(su) { | |
| 51 | 89 | //按门店分类的数组 |
| 52 | - var arr = new Array(); | |
| 53 | - var carr = su.data.data.pageData; | |
| 90 | + var arr = new Array(), | |
| 91 | + carr = su.data.data.pageData; | |
| 92 | + var all_num = 0; | |
| 93 | + | |
| 54 | 94 | for (var i = 0; i < carr.length; i++) { |
| 55 | 95 | var item = carr[i]; |
| 96 | + all_num += item.goods_num; | |
| 56 | 97 | item.original_img = oo.imghost + item.original_img; |
| 98 | + item.selected = 0; | |
| 57 | 99 | |
| 58 | - item.selected=0; | |
| 59 | - | |
| 60 | 100 | var pcid = item.pick_id; |
| 61 | 101 | var find = 0; |
| 62 | 102 | //---------循环查找门店--- |
| 63 | - if (arr.length>0){ | |
| 64 | - for (var j = 0; j < arr.length; j++) { | |
| 65 | - if (arr[j].pid == pcid) { | |
| 66 | - arr[j].goods.push(item); | |
| 67 | - find = 1; | |
| 68 | - break; | |
| 69 | - } | |
| 103 | + if (arr.length > 0) { | |
| 104 | + for (var j = 0; j < arr.length; j++) { | |
| 105 | + if (arr[j].pid == pcid) { | |
| 106 | + arr[j].goods.push(item); | |
| 107 | + find = 1; | |
| 108 | + break; | |
| 70 | 109 | } |
| 110 | + } | |
| 71 | 111 | } |
| 72 | 112 | |
| 73 | 113 | //------如果没有找到----- |
| 74 | 114 | if (find == 0) { |
| 75 | 115 | var pikname = ''; |
| 76 | 116 | //找到门店名称 |
| 77 | - for (var k=0;k<th.data.allsto.length;k++){ | |
| 78 | - if (pcid == th.data.allsto[k].pickup_id){ | |
| 79 | - pikname = th.data.allsto[k].pickup_name;break; | |
| 117 | + for (var k = 0; k < th.data.allsto.length; k++) { | |
| 118 | + if (pcid == th.data.allsto[k].pickup_id) { | |
| 119 | + pikname = th.data.allsto[k].pickup_name; | |
| 120 | + break; | |
| 80 | 121 | } |
| 81 | 122 | } |
| 82 | - var narr = new Array(); narr.push(item); | |
| 83 | - var ie = { pid: pcid, pname: pikname, goods: narr,selected:0}; | |
| 123 | + var narr = new Array(); | |
| 124 | + narr.push(item); | |
| 125 | + var ie = { | |
| 126 | + pid: pcid, | |
| 127 | + pname: pikname, | |
| 128 | + goods: narr, | |
| 129 | + selected: 0 | |
| 130 | + }; | |
| 84 | 131 | arr.push(ie); |
| 85 | 132 | } |
| 86 | 133 | } |
| ... | ... | @@ -90,478 +137,654 @@ Page({ |
| 90 | 137 | |
| 91 | 138 | th.setData({ |
| 92 | 139 | requestData: arr, |
| 93 | - }), | |
| 94 | - th.doCheckAll(), wx.stopPullDownRefresh(); | |
| 140 | + all_num: all_num, | |
| 141 | + is_load: 1, | |
| 142 | + is_edit: 0 | |
| 143 | + }), | |
| 144 | + th.doCheckAll(), wx.stopPullDownRefresh(); | |
| 95 | 145 | } |
| 96 | 146 | }); |
| 97 | 147 | }, |
| 98 | 148 | //删除商品 |
| 99 | 149 | delete_th_item: function(t) { |
| 100 | - var e = this; | |
| 101 | - var a=rq; | |
| 102 | - console.log(a); | |
| 103 | - wx.showModal({ | |
| 104 | - title: "确定删除", | |
| 105 | - success: function(s) { | |
| 106 | - if (s.confirm) { | |
| 107 | - var r =t.currentTarget.dataset.cartid; | |
| 108 | - var url = '/api/weshop/cart/del/'+oo.stoid+'/'+r; | |
| 109 | - a.delete(url, { | |
| 110 | - success: function(t) { | |
| 111 | - e.getCardList(); | |
| 112 | - } | |
| 113 | - }); | |
| 114 | - } | |
| 150 | + var e = this; | |
| 151 | + var a = rq; | |
| 152 | + console.log(a); | |
| 153 | + wx.showModal({ | |
| 154 | + title: "确定删除?", | |
| 155 | + success: function(s) { | |
| 156 | + if (s.confirm) { | |
| 157 | + var r = t.currentTarget.dataset.cartid; | |
| 158 | + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + r; | |
| 159 | + a.delete(url, { | |
| 160 | + success: function(t) { | |
| 161 | + e.getCardList(); | |
| 115 | 162 | } |
| 116 | - }); | |
| 117 | - }, | |
| 118 | - | |
| 119 | - //-----------------点击输入修改商品数量--------------- | |
| 120 | - valueToNum: function(t) { | |
| 121 | - var a = t.currentTarget.dataset.item; | |
| 122 | - var b = t.currentTarget.dataset.pitems; | |
| 123 | - a = this.data.requestData[b].goods[a]; | |
| 124 | - var e=a; | |
| 125 | - if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) { | |
| 126 | - var s = { | |
| 127 | - goods_num: a, | |
| 128 | - goods_id:e.goods_id, | |
| 129 | - id: e.id, | |
| 130 | - store_id:oo.stoid | |
| 131 | - }; | |
| 132 | - this.postCardList(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
| 133 | - } | |
| 134 | - }, | |
| 135 | - | |
| 136 | - //-------------加数量--------------------- | |
| 137 | - addNum: function(t) { | |
| 138 | - var a = t.currentTarget.dataset.item; | |
| 139 | - var b = t.currentTarget.dataset.pitems; | |
| 140 | - a = this.data.requestData[b].goods[a]; | |
| 141 | - | |
| 142 | - if (!(a.goods_num >= a.store_count)) { | |
| 143 | - var e = { | |
| 144 | - goods_num: a.goods_num + 1, | |
| 145 | - id: a.id, | |
| 146 | - goods_id:a.goods_id, | |
| 147 | - store_id:oo.stoid | |
| 148 | - }; | |
| 149 | - this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
| 150 | - } | |
| 151 | - }, | |
| 152 | - //-------------减数量--------------------- | |
| 153 | - subNum: function(t) { | |
| 154 | - var a = t.currentTarget.dataset.item; | |
| 155 | - var b = t.currentTarget.dataset.pitems; | |
| 156 | - a = this.data.requestData[b].goods[a]; | |
| 157 | - | |
| 158 | - if(a.goods_num - 1<0) return false; | |
| 159 | - | |
| 160 | - if (1 != a.goods_num) { | |
| 161 | - var e = { | |
| 162 | - goods_num: a.goods_num - 1, | |
| 163 | - id: a.id, | |
| 164 | - goods_id: a.goods_id, | |
| 165 | - store_id:oo.stoid | |
| 166 | - }; | |
| 167 | - this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
| 163 | + }); | |
| 168 | 164 | } |
| 169 | - }, | |
| 170 | - //---------------全选,全选的时候要判断是否门店的匹配方式一致-------------- | |
| 171 | - checkAll: function() { | |
| 172 | - var e = this, dda = e.data.requestData, tfeel = 0,text_arr=""; | |
| 173 | - for (var i = 0; i < dda.length; i++) { | |
| 174 | - var item=dda[i].goods; | |
| 175 | - if (!e.data.checkAllToggle){ | |
| 176 | - var txt = "requestData[" +i+ "].selected"; | |
| 177 | - e.setData({ [txt]:0,}); | |
| 165 | + } | |
| 166 | + }); | |
| 167 | + }, | |
| 168 | + | |
| 169 | + //-----------------点击输入修改商品数量--------------- | |
| 170 | + valueToNum: function(t) { | |
| 171 | + var a = t.currentTarget.dataset.item; | |
| 172 | + var b = t.currentTarget.dataset.pitems; | |
| 173 | + a = this.data.requestData[b].goods[a]; | |
| 174 | + var e = a; | |
| 175 | + if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) { | |
| 176 | + var s = { | |
| 177 | + goods_num: a, | |
| 178 | + goods_id: e.goods_id, | |
| 179 | + id: e.id, | |
| 180 | + store_id: oo.stoid | |
| 181 | + }; | |
| 182 | + this.postCardList(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
| 183 | + } | |
| 184 | + }, | |
| 185 | + | |
| 186 | + //-------------加数量--------------------- | |
| 187 | + addNum: function(t) { | |
| 188 | + if (this.data.up_dating == 1) return false; | |
| 189 | + this.data.up_dating = 1; | |
| 190 | + | |
| 191 | + var a = t.currentTarget.dataset.item; | |
| 192 | + var b = t.currentTarget.dataset.pitems; | |
| 193 | + a = this.data.requestData[b].goods[a]; | |
| 194 | + | |
| 195 | + if (a.goods_num<a.store_count) { | |
| 196 | + var e = { | |
| 197 | + goods_num: a.goods_num + 1, | |
| 198 | + id: a.id, | |
| 199 | + goods_id: a.goods_id, | |
| 200 | + store_id: oo.stoid | |
| 201 | + }; | |
| 202 | + isShowLoading: 0; | |
| 203 | + this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
| 204 | + } else { | |
| 205 | + wx.showModal({ | |
| 206 | + title: '提示', | |
| 207 | + content: '购买的数量不能超出库存数量', | |
| 208 | + }); | |
| 209 | + this.data.up_dating = 0; | |
| 210 | + } | |
| 211 | + }, | |
| 212 | + //-------------减数量--------------------- | |
| 213 | + subNum: function(t) { | |
| 214 | + var a = t.currentTarget.dataset.item; | |
| 215 | + var b = t.currentTarget.dataset.pitems; | |
| 216 | + a = this.data.requestData[b].goods[a]; | |
| 217 | + | |
| 218 | + if (a.goods_num - 1 < 0) return false; | |
| 219 | + | |
| 220 | + if (1 != a.goods_num) { | |
| 221 | + var e = { | |
| 222 | + goods_num: a.goods_num - 1, | |
| 223 | + id: a.id, | |
| 224 | + goods_id: a.goods_id, | |
| 225 | + store_id: oo.stoid | |
| 226 | + }; | |
| 227 | + this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | |
| 228 | + } | |
| 229 | + }, | |
| 230 | + //---------------全选,全选的时候要判断是否门店的匹配方式一致-------------- | |
| 231 | + checkAll: function() { | |
| 232 | + var e = this, | |
| 233 | + dda = e.data.requestData, | |
| 234 | + tfeel = 0, | |
| 235 | + t_num = 0, | |
| 236 | + text_arr = ""; | |
| 237 | + for (var i = 0; i < dda.length; i++) { | |
| 238 | + var item = dda[i].goods; | |
| 239 | + if (!e.data.checkAllToggle) { | |
| 240 | + var txt = "requestData[" + i + "].selected"; | |
| 241 | + e.setData({ | |
| 242 | + [txt]: 0, | |
| 243 | + }); | |
| 244 | + } | |
| 245 | + var fir = 0; | |
| 246 | + for (var j = 0; j < item.length; j++) { | |
| 247 | + if (fir == 0) { | |
| 248 | + fir = item[j].distr_type; | |
| 249 | + } else { | |
| 250 | + //如果同一门店有不同门店的商品,不能同一配送 | |
| 251 | + if (fir != item[j].distr_type && !e.data.checkAllToggle && item[j].distr_type != 0) { | |
| 252 | + text_arr += item[j].goods_name + " "; | |
| 253 | + break; | |
| 254 | + } | |
| 178 | 255 | } |
| 179 | - var fir=0; | |
| 180 | - for(var j=0;j<item.length;j++){ | |
| 181 | - if (fir == 0) {fir=item[j].distr_type;} | |
| 182 | - else{ | |
| 183 | - //如果同一门店有不同门店的商品,不能同一配送 | |
| 184 | - if (fir != item[j].distr_type && !e.data.checkAllToggle && item[j].distr_type!=0 ){ | |
| 185 | - text_arr+=item[j].goods_name+" "; break; | |
| 186 | - } | |
| 187 | - } | |
| 188 | - var txt = "requestData[" + i + "].goods["+j+"].selected" | |
| 189 | - e.setData({ | |
| 190 | - [txt]: !e.data.checkAllToggle, | |
| 191 | - }) | |
| 192 | - if (!e.data.checkAllToggle) | |
| 193 | - tfeel += item[j].goods_num * item[j].goods_price; | |
| 256 | + var txt = "requestData[" + i + "].goods[" + j + "].selected" | |
| 257 | + e.setData({ | |
| 258 | + [txt]: !e.data.checkAllToggle, | |
| 259 | + }) | |
| 260 | + if (!e.data.checkAllToggle) { | |
| 261 | + tfeel += item[j].goods_num * item[j].goods_price; | |
| 262 | + t_num += item[j].goods_num; | |
| 194 | 263 | } |
| 195 | 264 | } |
| 265 | + } | |
| 196 | 266 | |
| 197 | - if (text_arr!=""){ | |
| 198 | - wx.showModal({ title: '提示', content: text_arr+'不能与门店中其他商品一起结算,配送方式不一致' }); return false; | |
| 199 | - e.setData({ | |
| 200 | - total_fee: tfeel.toFixed(2), | |
| 201 | - }); | |
| 202 | - }else{ | |
| 203 | - e.setData({ | |
| 204 | - checkAllToggle: !e.data.checkAllToggle, | |
| 205 | - total_fee: tfeel.toFixed(2), | |
| 206 | - }); | |
| 207 | - } | |
| 208 | - }, | |
| 209 | - | |
| 210 | - //------门店全选按钮,要判断是否门店的匹配方式一致--------- | |
| 211 | - check_th_all_item:function(ele){ | |
| 212 | - var e=this,pitems = ele.currentTarget.dataset.pitems,item = this.data.requestData[pitems].goods; | |
| 213 | - var sele = this.data.requestData[pitems].selected; | |
| 214 | - | |
| 215 | - var isok = 1, fir = 0, iarr = item; | |
| 216 | - if (!sele && item.length > 0 ){ | |
| 217 | - | |
| 218 | - console.log(item); | |
| 219 | - for (var i = 0; i < iarr.length; i++) { | |
| 220 | - if (iarr[i].distr_type != 0) { | |
| 221 | - if (fir == 0) { fir = iarr[i].distr_type; } | |
| 222 | - else { | |
| 223 | - if (fir != iarr[i].distr_type && iarr[i].distr_type!=0 ) { isok = 0; break; } | |
| 267 | + if (text_arr != "") { | |
| 268 | + wx.showModal({ | |
| 269 | + title: '提示', | |
| 270 | + content: text_arr + '不能与门店中其他商品一起结算,配送方式不一致' | |
| 271 | + }); | |
| 272 | + return false; | |
| 273 | + } else { | |
| 274 | + e.setData({ | |
| 275 | + checkAllToggle: !e.data.checkAllToggle, | |
| 276 | + total_fee: tfeel.toFixed(2), | |
| 277 | + total_num: t_num, | |
| 278 | + }); | |
| 279 | + } | |
| 280 | + }, | |
| 281 | + | |
| 282 | + //------门店全选按钮,要判断是否门店的匹配方式一致--------- | |
| 283 | + check_th_all_item: function(ele) { | |
| 284 | + var e = this, | |
| 285 | + pitems = ele.currentTarget.dataset.pitems, | |
| 286 | + item = this.data.requestData[pitems].goods, | |
| 287 | + sele = this.data.requestData[pitems].selected; | |
| 288 | + | |
| 289 | + var isok = 1, | |
| 290 | + fir = 0, | |
| 291 | + iarr = item; | |
| 292 | + if (!sele && item.length > 0) { | |
| 293 | + for (var i = 0; i < iarr.length; i++) { | |
| 294 | + if (iarr[i].distr_type != 0) { | |
| 295 | + if (fir == 0) { | |
| 296 | + fir = iarr[i].distr_type; | |
| 297 | + } else { | |
| 298 | + if (fir != iarr[i].distr_type && iarr[i].distr_type != 0) { | |
| 299 | + isok = 0; | |
| 300 | + break; | |
| 224 | 301 | } |
| 225 | 302 | } |
| 226 | 303 | } |
| 227 | - } | |
| 304 | + } | |
| 305 | + } | |
| 228 | 306 | |
| 229 | - if (!isok) { | |
| 230 | - wx.showModal({ title: '提示', content: '同一门店自提和物流的商品不能同时结算' }); return false; | |
| 231 | - } | |
| 307 | + if (!isok) { | |
| 308 | + wx.showModal({ | |
| 309 | + title: '提示', | |
| 310 | + content: '同一门店自提和物流的商品不能同时结算' | |
| 311 | + }); | |
| 312 | + return false; | |
| 313 | + } | |
| 232 | 314 | |
| 233 | - for(var i=0;i<item.length;i++){ | |
| 234 | - var txt = "requestData[" + pitems + "].goods[" + i+ "].selected"; | |
| 235 | - e.setData({ | |
| 236 | - [txt]: Number(!sele), | |
| 237 | - }); | |
| 238 | - } | |
| 239 | - var txt = "requestData[" + pitems + "].selected"; | |
| 240 | - e.setData({ | |
| 241 | - [txt]: Number(!sele), | |
| 242 | - }); | |
| 243 | - this.doCheckAll(); | |
| 244 | - }, | |
| 245 | - | |
| 246 | - //---------------单选,也要判断门店的配送方式是否一致-------------- | |
| 247 | - check_th_item: function(t) { | |
| 248 | - var e=this, item = t.currentTarget.dataset.item,pitems = t.currentTarget.dataset.pitems; | |
| 249 | - a = this.data.requestData[pitems].goods[item]; | |
| 250 | - var isok=1,fir=0; | |
| 251 | - var iarr = e.data.requestData[pitems].goods; | |
| 252 | - | |
| 253 | - | |
| 254 | - //当数量大于1,且是选择的时候 | |
| 255 | - if (iarr.length > 1 && !a.selected){ | |
| 256 | - for (var i = 0; i < iarr.length;i++){ | |
| 257 | - //---当不是本身选择项目---- | |
| 258 | - var sel = iarr[i].selected; | |
| 259 | - if (iarr[i].distr_type != 0 && (sel || iarr[i].id==a.id)) { | |
| 260 | - if (fir == 0) { fir = iarr[i].distr_type; } | |
| 261 | - else { | |
| 262 | - if (fir != iarr[i].distr_type && iarr[i].distr_type != 0) { isok = 0; break; } | |
| 263 | - } | |
| 264 | - } | |
| 315 | + for (var i = 0; i < item.length; i++) { | |
| 316 | + var txt = "requestData[" + pitems + "].goods[" + i + "].selected"; | |
| 317 | + e.setData({ | |
| 318 | + [txt]: Number(!sele), | |
| 319 | + }); | |
| 320 | + } | |
| 321 | + var txt = "requestData[" + pitems + "].selected"; | |
| 322 | + e.setData({ | |
| 323 | + [txt]: Number(!sele), | |
| 324 | + }); | |
| 325 | + this.doCheckAll(); | |
| 326 | + }, | |
| 327 | + | |
| 328 | + //---------------单选,也要判断门店的配送方式是否一致-------------- | |
| 329 | + check_th_item: function(t) { | |
| 330 | + var e = this, | |
| 331 | + item = t.currentTarget.dataset.item, | |
| 332 | + pitems = t.currentTarget.dataset.pitems; | |
| 333 | + a = this.data.requestData[pitems].goods[item]; | |
| 334 | + var isok = 1, | |
| 335 | + fir = 0; | |
| 336 | + var iarr = e.data.requestData[pitems].goods; | |
| 337 | + | |
| 338 | + | |
| 339 | + //当数量大于1,且是选择的时候 | |
| 340 | + if (iarr.length > 1 && !a.selected) { | |
| 341 | + for (var i = 0; i < iarr.length; i++) { | |
| 342 | + //---当不是本身选择项目---- | |
| 343 | + var sel = iarr[i].selected; | |
| 344 | + if (iarr[i].distr_type != 0 && (sel || iarr[i].id == a.id)) { | |
| 345 | + if (fir == 0) { | |
| 346 | + fir = iarr[i].distr_type; | |
| 347 | + } else { | |
| 348 | + if (fir != iarr[i].distr_type && iarr[i].distr_type != 0) { | |
| 349 | + isok = 0; | |
| 350 | + break; | |
| 351 | + } | |
| 265 | 352 | } |
| 266 | 353 | } |
| 267 | - if(!isok){ | |
| 268 | - wx.showModal({ title: '提示', content: '同一门店自提和物流的商品不能同时结算' }); | |
| 269 | - }else{ | |
| 270 | - var txt = "requestData[" + pitems + "].goods[" + item + "].selected"; | |
| 271 | - e.setData({ | |
| 272 | - [txt]: Number(!a.selected), | |
| 273 | - }); | |
| 274 | - this.doCheckAll(); | |
| 354 | + } | |
| 355 | + } | |
| 356 | + if (!isok) { | |
| 357 | + wx.showModal({ | |
| 358 | + title: '提示', | |
| 359 | + content: '同一门店自提和物流的商品不能同时结算' | |
| 360 | + }); | |
| 361 | + } else { | |
| 362 | + var txt = "requestData[" + pitems + "].goods[" + item + "].selected"; | |
| 363 | + e.setData({ | |
| 364 | + [txt]: Number(!a.selected), | |
| 365 | + }); | |
| 366 | + this.doCheckAll(); | |
| 367 | + } | |
| 368 | + }, | |
| 369 | + //----------检查是否全选--------- | |
| 370 | + doCheckAll: function() { | |
| 371 | + var th = this, | |
| 372 | + tfeel = 0, | |
| 373 | + t_num = 0, | |
| 374 | + ischeck = 1, | |
| 375 | + car = this.data.requestData, | |
| 376 | + all_num = 0; | |
| 377 | + | |
| 378 | + for (var a = 0; a < car.length; a++) { | |
| 379 | + var item = car[a].goods, | |
| 380 | + is_s_sele = 1; | |
| 381 | + for (var c = 0; c < item.length; c++) { | |
| 382 | + all_num += item[c].goods_num; | |
| 383 | + if (item[c].selected == 0) { | |
| 384 | + ischeck = 0; | |
| 385 | + is_s_sele = 0; | |
| 386 | + } else { | |
| 387 | + tfeel += item[c].goods_num * item[c].goods_price; | |
| 388 | + t_num += item[c].goods_num; | |
| 275 | 389 | } |
| 276 | - }, | |
| 277 | - //----------检查是否全选--------- | |
| 278 | - doCheckAll: function() { | |
| 279 | - var th=this,tfeel=0,ischeck = 1,car = this.data.requestData; | |
| 280 | - for (var a = 0; a < car.length; a++) { | |
| 281 | - var item = car[a].goods; | |
| 282 | - var is_s_sele=1; | |
| 283 | - for (var c = 0; c < item.length;c++){ | |
| 284 | - if(item[c].selected==0){ | |
| 285 | - ischeck=0; | |
| 286 | - is_s_sele=0; | |
| 287 | - } | |
| 288 | - else{ tfeel += item[c].goods_num * item[c].goods_price; } | |
| 289 | - } | |
| 390 | + } | |
| 391 | + | |
| 392 | + var txt = "requestData[" + a + "].selected"; | |
| 393 | + th.setData({ | |
| 394 | + [txt]: Number(is_s_sele) | |
| 395 | + }); | |
| 396 | + | |
| 397 | + } | |
| 398 | + this.setData({ | |
| 399 | + checkAllToggle: ischeck, | |
| 400 | + total_fee: tfeel.toFixed(2), | |
| 401 | + all_num: all_num, | |
| 402 | + total_num: t_num | |
| 403 | + }); | |
| 404 | + }, | |
| 290 | 405 | |
| 291 | - var txt = "requestData[" + a+ "].selected"; | |
| 292 | - th.setData({ | |
| 293 | - [txt]: Number(is_s_sele), | |
| 406 | + //----------------------更新购物数量,加减,调用接口--------------------- | |
| 407 | + postCardList: function(t, item, pitem) { | |
| 408 | + var e = this; | |
| 409 | + var user_id = getApp().globalData.user_id; | |
| 410 | + console.log('update'); | |
| 411 | + console.log(t); | |
| 412 | + rq.get("/api/weshop/goods/get/" + oo.stoid + "/" + t.goods_id, { | |
| 413 | + isShowLoading: 0, | |
| 414 | + async success(d) { | |
| 415 | + var limit = d.data.data.viplimited; | |
| 416 | + var store_count = d.data.data.store_count; | |
| 417 | + | |
| 418 | + var goodsinfo = e.data.requestData[pitem].goods[item]; | |
| 419 | + var promgoodsbuynum = 0; | |
| 420 | + var goodsbuynum = 0; | |
| 421 | + | |
| 422 | + //--要获得商品,该用户买了多少件,同步应用-- | |
| 423 | + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | |
| 424 | + data: { | |
| 425 | + store_id: oo.stoid, | |
| 426 | + user_id: user_id, | |
| 427 | + goods_id: goodsinfo.goods_id, | |
| 428 | + prom_type: goodsinfo.prom_type, | |
| 429 | + prom_id: goodsinfo.prom_id | |
| 430 | + }, | |
| 431 | + }).then(res => { | |
| 432 | + var buy_num_data = res.data.data; | |
| 433 | + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | |
| 434 | + goodsbuynum = buy_num_data.goodsbuynum; | |
| 435 | + }) | |
| 436 | + | |
| 437 | + var buyed_mum2 = t.goods_num + goodsbuynum; | |
| 438 | + if (buyed_mum2 > limit && limit > 0) { | |
| 439 | + wx.showModal({ | |
| 440 | + title: '提示', | |
| 441 | + content: '购买数量超出商品限购' | |
| 294 | 442 | }); |
| 443 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 444 | + var cbuy = limit - buyed_mum; | |
| 445 | + e.setData({ | |
| 446 | + [txt]: cbuy > 0 ? cbuy : 0, | |
| 447 | + }); | |
| 448 | + e.doCheckAll(); | |
| 449 | + return false; | |
| 450 | + } | |
| 295 | 451 | |
| 452 | + if (t.goods_num > store_count) { | |
| 453 | + wx.showModal({ | |
| 454 | + title: '提示', | |
| 455 | + content: '购买数量超出商品库存' | |
| 456 | + }); | |
| 457 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 458 | + e.setData({ | |
| 459 | + [txt]: store_count | |
| 460 | + }); | |
| 461 | + e.doCheckAll(); | |
| 462 | + return false; | |
| 296 | 463 | } |
| 297 | - this.setData({ | |
| 298 | - checkAllToggle: ischeck, | |
| 299 | - total_fee: tfeel.toFixed(2), | |
| 300 | - }); | |
| 301 | - }, | |
| 302 | - | |
| 303 | - //----------------------更新购物数量,加减,调用接口--------------------- | |
| 304 | - postCardList: function (t, item, pitem) { | |
| 305 | - var e = this; | |
| 306 | - var user_id=getApp().globalData.user_id; | |
| 307 | - console.log('update'); | |
| 308 | - console.log(t); | |
| 309 | - rq.get("/api/weshop/goods/get/" + oo.stoid + "/" + t.goods_id, { | |
| 310 | - async success(d) { | |
| 311 | - var limit = d.data.data.viplimited; | |
| 312 | - var store_count = d.data.data.store_count; | |
| 313 | - | |
| 314 | - var goodsinfo=e.data.requestData[pitem ].goods[item]; | |
| 315 | - var promgoodsbuynum=0; | |
| 316 | - var goodsbuynum=0; | |
| 317 | - //--要获得商品,该用户买了多少件,同步应用-- | |
| 318 | - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum",{ | |
| 319 | - data: { | |
| 320 | - store_id: oo.stoid, | |
| 321 | - user_id: user_id, | |
| 322 | - goods_id: goodsinfo.goods_id, | |
| 323 | - prom_type:goodsinfo.prom_type, | |
| 324 | - prom_id:goodsinfo.prom_id | |
| 325 | - }, | |
| 326 | - }).then(res=>{ | |
| 327 | - var buy_num_data=res.data.data; | |
| 328 | - if(buy_num_data.promgoodsbuynum) promgoodsbuynum=buy_num_data.promgoodsbuynum; | |
| 329 | - goodsbuynum=buy_num_data.goodsbuynum; | |
| 330 | - }) | |
| 331 | - | |
| 332 | - var buyed_mum2 = t.goods_num + goodsbuynum; | |
| 333 | - if (buyed_mum2>limit && limit>0){ | |
| 334 | - wx.showModal({ title: '提示', content: '购买数量超出商品限购'}); | |
| 335 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 336 | - var cbuy = limit - buyed_mum; | |
| 337 | - e.setData({ [txt]: cbuy > 0 ? cbuy:0, }); | |
| 338 | - return false; | |
| 339 | - } | |
| 340 | 464 | |
| 341 | - if (t.goods_num > store_count) { | |
| 342 | - wx.showModal({ title: '提示', content: '购买数量超出商品库存' }); | |
| 343 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 344 | - e.setData({ [txt]: store_count }); | |
| 345 | - return false; | |
| 346 | - } | |
| 465 | + if (goodsinfo.prom_type == 1) { | |
| 466 | + //读取秒杀 | |
| 467 | + rq.get("/api/ms/flash_sale/getFlashSaleOne/" + oo.stoid + "/" + goodsinfo.prom_id, { | |
| 468 | + isShowLoading: 0, | |
| 469 | + success: function(res_d) { | |
| 470 | + var false_data = res_d.data.data; | |
| 471 | + | |
| 472 | + //--判断库存-- | |
| 473 | + if (t.goods_num > false_data.goods_num - false_data.buy_num) { | |
| 474 | + wx.showModal({ | |
| 475 | + title: '提示', | |
| 476 | + content: '购买数量超出活动库存' | |
| 477 | + }); | |
| 478 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 479 | + e.setData({ | |
| 480 | + [txt]: false_data.goods_num - false_data.buy_num | |
| 481 | + }); | |
| 482 | + e.doCheckAll(); | |
| 483 | + return false; | |
| 484 | + } | |
| 347 | 485 | |
| 348 | - if(goodsinfo.prom_type==1){ | |
| 349 | - //读取秒杀 | |
| 350 | - rq.get("/api/ms/flash_sale/getFlashSaleOne/" + oo.stoid + "/" + goodsinfo.prom_id, { | |
| 351 | - success: function (res_d) { | |
| 352 | - var false_data=res_d.data.data; | |
| 353 | - | |
| 354 | - //--判断库存-- | |
| 355 | - if (t.goods_num > false_data.goods_num-false_data.buy_num){ | |
| 356 | - wx.showModal({ title: '提示', content: '购买数量超出活动库存' }); | |
| 357 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 358 | - e.setData({ [txt]: false_data.goods_num-false_data.buy_num }); | |
| 359 | - return false; | |
| 360 | - } | |
| 361 | - | |
| 362 | - //--判断redis数量是否已经超出-- | |
| 363 | - if(t.goods_num >false_data.redisnum){ | |
| 364 | - wx.showModal({ title: '提示', content: '购买数量超出商品库存' }); | |
| 365 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 366 | - e.setData({ [txt]: false_data.redisnum }); | |
| 367 | - return false; | |
| 368 | - } | |
| 369 | - | |
| 370 | - //--活动的限购是不是要判断-- | |
| 371 | - if(t.goods_num+promgoodsbuynum >false_data.buy_limit && false_data.buy_limit>0){ | |
| 372 | - wx.showModal({ title: '提示', content: '购买数量超出秒杀限购' }); | |
| 373 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 374 | - e.setData({ [txt]: false_data.false_data.buy_limit }); | |
| 375 | - return false; | |
| 376 | - } | |
| 377 | - | |
| 378 | - e.update_cart(t,pitem,item); | |
| 379 | - } | |
| 380 | - }) | |
| 381 | - }else{ | |
| 382 | - e.update_cart(t,pitem,item); | |
| 383 | - } | |
| 486 | + //--判断redis数量是否已经超出-- | |
| 487 | + if (t.goods_num > false_data.redisnum) { | |
| 488 | + wx.showModal({ | |
| 489 | + title: '提示', | |
| 490 | + content: '购买数量超出商品库存' | |
| 491 | + }); | |
| 492 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 493 | + e.setData({ | |
| 494 | + [txt]: false_data.redisnum | |
| 495 | + }); | |
| 496 | + e.doCheckAll(); | |
| 497 | + return false; | |
| 384 | 498 | } |
| 385 | - }); | |
| 386 | - }, | |
| 387 | - | |
| 388 | - //更新购物车 | |
| 389 | - update_cart:function(t,pitem,item){ | |
| 390 | - var e=this; | |
| 391 | - getApp().request.put("/api/weshop/cart/update", { | |
| 392 | - data: t, | |
| 393 | - success: function (ee) { | |
| 394 | - var txt = "requestData[" + pitem + "].goods[" + item+"].goods_num"; | |
| 499 | + | |
| 500 | + //--活动的限购是不是要判断-- | |
| 501 | + if (t.goods_num + promgoodsbuynum > false_data.buy_limit && false_data.buy_limit > 0) { | |
| 502 | + wx.showModal({ | |
| 503 | + title: '提示', | |
| 504 | + content: '购买数量超出秒杀限购' | |
| 505 | + }); | |
| 506 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 395 | 507 | e.setData({ |
| 396 | - [txt]: t.goods_num, | |
| 508 | + [txt]: false_data.false_data.buy_limit | |
| 397 | 509 | }); |
| 398 | 510 | e.doCheckAll(); |
| 511 | + return false; | |
| 512 | + } | |
| 513 | + e.update_cart(t, pitem, item); | |
| 399 | 514 | } |
| 515 | + }) | |
| 516 | + } else { | |
| 517 | + e.update_cart(t, pitem, item); | |
| 518 | + } | |
| 519 | + } | |
| 520 | + }); | |
| 521 | + }, | |
| 522 | + | |
| 523 | + //更新购物车 | |
| 524 | + update_cart: function(t, pitem, item) { | |
| 525 | + var e = this; | |
| 526 | + getApp().request.put("/api/weshop/cart/update", { | |
| 527 | + data: t, | |
| 528 | + success: function(ee) { | |
| 529 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | |
| 530 | + e.data.up_dating = 0 | |
| 531 | + e.setData({ | |
| 532 | + [txt]: t.goods_num, | |
| 400 | 533 | }); |
| 401 | - }, | |
| 402 | - | |
| 403 | - //-------下拉刷新--------- | |
| 404 | - onPullDownRefresh: function(t) { | |
| 405 | - this.getCardList(); | |
| 406 | - }, | |
| 407 | - | |
| 408 | - //--------------去结算------------ | |
| 409 | - async checkout() { | |
| 410 | - var glist=""; //用逗号隔开的 | |
| 411 | - var map=new Map(); //使用map值键进行运算 | |
| 412 | - var map_limit=new Map(); //使用map值键进行存储限购 | |
| 413 | - var g_arr = new Array(); //已选的商品列表 | |
| 414 | - var user_id=getApp().globalData.user_id; | |
| 415 | - var th=this; | |
| 416 | - | |
| 417 | - var ab = 0;//选中 | |
| 418 | - console.log('checkout'); | |
| 419 | - for (var i=0;i<this.data.requestData.length;i++){ | |
| 420 | - var i_arr = this.data.requestData[i].goods; | |
| 421 | - for (var j = 0; j < i_arr.length;j++ ){ | |
| 422 | - if (i_arr[j].selected){ | |
| 423 | - //map 的key是不会重复,会覆盖,, | |
| 424 | - var ie = { goods_id: i_arr[j].goods_id, id: i_arr[j].id, goods_price: i_arr[j].goods_price}; | |
| 425 | - g_arr.push(ie); | |
| 426 | - if(map.has(i_arr[j].goods_id + "")){ | |
| 427 | - var num11 = map.get(i_arr[j].goods_id + ""); | |
| 428 | - var num22 = parseInt(i_arr[j].goods_num)+parseInt(num11); | |
| 429 | - map.set(i_arr[j].goods_id + "", num22); | |
| 430 | - }else{ | |
| 431 | - map.set(i_arr[j].goods_id + "", i_arr[j].goods_num); | |
| 432 | - } | |
| 433 | - glist += i_arr[j].goods_id+","; | |
| 434 | - ab=1; | |
| 435 | - }else{ | |
| 436 | - rq.put("/api/weshop/cart/update", { | |
| 437 | - data: { id: i_arr[j].id, selected: 0,store_id:oo.stoid }, | |
| 438 | - success: function (ee) { | |
| 439 | - console.log(ee); | |
| 440 | - } | |
| 441 | - }); | |
| 442 | - } | |
| 534 | + e.doCheckAll(); | |
| 535 | + } | |
| 536 | + }); | |
| 537 | + }, | |
| 538 | + | |
| 539 | + //-------下拉刷新--------- | |
| 540 | + onPullDownRefresh: function(t) { | |
| 541 | + this.getCardList(); | |
| 542 | + }, | |
| 543 | + | |
| 544 | + //--------------去结算------------ | |
| 545 | + async checkout() { | |
| 546 | + var glist = ""; //用逗号隔开的 | |
| 547 | + var map = new Map(); //使用map值键进行运算 | |
| 548 | + var map_limit = new Map(); //使用map值键进行存储限购 | |
| 549 | + var g_arr = new Array(); //已选的商品列表 | |
| 550 | + var user_id = getApp().globalData.user_id; | |
| 551 | + var th = this; | |
| 552 | + | |
| 553 | + var ab = 0; //选中 | |
| 554 | + console.log('checkout'); | |
| 555 | + for (var i = 0; i < this.data.requestData.length; i++) { | |
| 556 | + var i_arr = this.data.requestData[i].goods; | |
| 557 | + for (var j = 0; j < i_arr.length; j++) { | |
| 558 | + if (i_arr[j].selected) { | |
| 559 | + //map 的key是不会重复,会覆盖,, | |
| 560 | + var ie = { | |
| 561 | + goods_id: i_arr[j].goods_id, | |
| 562 | + id: i_arr[j].id, | |
| 563 | + goods_price: i_arr[j].goods_price | |
| 564 | + }; | |
| 565 | + g_arr.push(ie); | |
| 566 | + if (map.has(i_arr[j].goods_id + "")) { | |
| 567 | + var num11 = map.get(i_arr[j].goods_id + ""); | |
| 568 | + var num22 = parseInt(i_arr[j].goods_num) + parseInt(num11); | |
| 569 | + map.set(i_arr[j].goods_id + "", num22); | |
| 570 | + } else { | |
| 571 | + map.set(i_arr[j].goods_id + "", i_arr[j].goods_num); | |
| 443 | 572 | } |
| 573 | + glist += i_arr[j].goods_id + ","; | |
| 574 | + ab = 1; | |
| 575 | + } else { | |
| 576 | + rq.put("/api/weshop/cart/update", { | |
| 577 | + data: { | |
| 578 | + id: i_arr[j].id, | |
| 579 | + selected: 0, | |
| 580 | + store_id: oo.stoid | |
| 581 | + }, | |
| 582 | + success: function(ee) { | |
| 583 | + console.log(ee); | |
| 584 | + } | |
| 585 | + }); | |
| 444 | 586 | } |
| 445 | - if (ab==0){t.my_warnning("未选择商品",0,th);return false; } | |
| 446 | - | |
| 447 | - glist = glist.substring(0, glist.length - 1); | |
| 448 | - //--取一下商品的限购 以及活动的限购,redis数量-- | |
| 449 | - rq.get("/api/weshop/goods/getGoodsListNum", { | |
| 450 | - data: { goodsidlist: glist, store_id: oo.stoid }, | |
| 451 | - async success(ee) { | |
| 452 | - console.log(ee); | |
| 453 | - if(ee.data.code==0){ | |
| 454 | - var ddata = ee.data.data, isok = 1, gname="",err=""; | |
| 455 | - //--组装-- | |
| 456 | - for (var ij=0;ij<ddata.length;ij++){ | |
| 457 | - var val=ddata[ij]; | |
| 458 | - var obj = map_limit.get(val.goods_id+""); | |
| 459 | - if(obj) continue; | |
| 460 | - | |
| 461 | - var promgoodsbuynum=0; | |
| 462 | - var goodsbuynum=0; | |
| 463 | - //--要获得商品,该用户买了多少件,同步应用-- | |
| 464 | - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum",{ | |
| 465 | - data: { | |
| 466 | - store_id: oo.stoid, | |
| 467 | - user_id: user_id, | |
| 468 | - goods_id: val.goods_id, | |
| 469 | - prom_type:val.prom_type, | |
| 470 | - prom_id:val.prom_id | |
| 471 | - }, | |
| 472 | - }).then(res=>{ | |
| 473 | - var buy_num_data=res.data.data; | |
| 474 | - if(buy_num_data.promgoodsbuynum) promgoodsbuynum=buy_num_data.promgoodsbuynum; | |
| 475 | - goodsbuynum=buy_num_data.goodsbuynum; | |
| 476 | - }) | |
| 477 | - var ie={promgoodsbuynum:promgoodsbuynum,goodsbuynum:goodsbuynum}; | |
| 478 | - map_limit.set(val.goods_id + "", ie); | |
| 479 | - } | |
| 480 | - | |
| 481 | - try{ | |
| 482 | - ddata.forEach(function(val,ind){ | |
| 483 | - var num = map.get(val.goods_id+""); | |
| 484 | - if (num<=0) { | |
| 485 | - isok = 0; gname = val.goods_name; | |
| 486 | - throw "购买数量不能为0";return false; | |
| 487 | - } | |
| 488 | - if ( num>val.store_count) { | |
| 489 | - isok = 0; gname = val.goods_name; | |
| 490 | - throw "超出库存"; return false; | |
| 491 | - } | |
| 492 | - if ( num>val.redisnum && val.redisnum) { | |
| 493 | - isok = 0; gname = val.goods_name; | |
| 494 | - throw "超出活动库存"; return false; | |
| 495 | - } | |
| 496 | - if ( num>val.goods_num-val.buy_num && val.goods_num) { | |
| 497 | - isok = 0; gname = val.goods_name; | |
| 498 | - throw "超出活动库存";return false; | |
| 499 | - } | |
| 500 | - | |
| 501 | - var buyed=map_limit.get(val.goods_id+""); | |
| 502 | - if (num+buyed.goodsbuynum>val.viplimited && val.viplimited>0) { | |
| 503 | - isok = 0; gname = val.goods_name; | |
| 504 | - throw "超出商品限购";return false; | |
| 505 | - } | |
| 506 | - | |
| 507 | - if (num+buyed.promgoodsbuynum>val.buy_limit && val.buy_limit>0) { | |
| 508 | - isok = 0; gname = val.goods_name; | |
| 509 | - throw "超出活动限购";return false; | |
| 510 | - } | |
| 511 | - | |
| 512 | - for (var i = 0; i < g_arr.length;i++){ | |
| 513 | - if (g_arr[i].goods_id==val.goods_id){ | |
| 514 | - if(g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price!=val.prom_price){ | |
| 515 | - isok = 0; gname = val.goods_name; | |
| 516 | - throw "商品价格已经变化"; | |
| 517 | - } | |
| 518 | - rq.put("/api/weshop/cart/update", { | |
| 519 | - data: { id: g_arr[i].id, selected: 1,store_id:oo.stoid }, | |
| 520 | - success: function (ee) { | |
| 521 | - console.log(ee); | |
| 522 | - } | |
| 523 | - }); | |
| 524 | - } | |
| 525 | - } | |
| 526 | - | |
| 527 | - }) | |
| 528 | - } catch (e) { err=e;} | |
| 529 | - if (isok==0){ | |
| 530 | - if (gname.length > 10) { | |
| 531 | - gname = gname.substr(0, 10); gname+="..."; | |
| 532 | - } | |
| 533 | - t.confirmBox(gname+":"+ err); return false; | |
| 587 | + } | |
| 588 | + } | |
| 589 | + if (ab == 0) { | |
| 590 | + t.my_warnning("未选择商品", 0, th); | |
| 591 | + return false; | |
| 592 | + } | |
| 593 | + | |
| 594 | + glist = glist.substring(0, glist.length - 1); | |
| 595 | + //--取一下商品的限购 以及活动的限购,redis数量-- | |
| 596 | + rq.get("/api/weshop/goods/getGoodsListNum", { | |
| 597 | + data: { | |
| 598 | + goodsidlist: glist, | |
| 599 | + store_id: oo.stoid | |
| 600 | + }, | |
| 601 | + async success(ee) { | |
| 602 | + console.log(ee); | |
| 603 | + if (ee.data.code == 0) { | |
| 604 | + var ddata = ee.data.data, | |
| 605 | + isok = 1, | |
| 606 | + gname = "", | |
| 607 | + err = ""; | |
| 608 | + //--组装-- | |
| 609 | + for (var ij = 0; ij < ddata.length; ij++) { | |
| 610 | + var val = ddata[ij]; | |
| 611 | + var obj = map_limit.get(val.goods_id + ""); | |
| 612 | + if (obj) continue; | |
| 613 | + | |
| 614 | + var promgoodsbuynum = 0; | |
| 615 | + var goodsbuynum = 0; | |
| 616 | + //--要获得商品,该用户买了多少件,同步应用-- | |
| 617 | + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | |
| 618 | + data: { | |
| 619 | + store_id: oo.stoid, | |
| 620 | + user_id: user_id, | |
| 621 | + goods_id: val.goods_id, | |
| 622 | + prom_type: val.prom_type, | |
| 623 | + prom_id: val.prom_id | |
| 624 | + }, | |
| 625 | + }).then(res => { | |
| 626 | + var buy_num_data = res.data.data; | |
| 627 | + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | |
| 628 | + goodsbuynum = buy_num_data.goodsbuynum; | |
| 629 | + }) | |
| 630 | + var ie = { | |
| 631 | + promgoodsbuynum: promgoodsbuynum, | |
| 632 | + goodsbuynum: goodsbuynum | |
| 633 | + }; | |
| 634 | + map_limit.set(val.goods_id + "", ie); | |
| 635 | + } | |
| 636 | + | |
| 637 | + try { | |
| 638 | + ddata.forEach(function(val, ind) { | |
| 639 | + var num = map.get(val.goods_id + ""); | |
| 640 | + if (num <= 0) { | |
| 641 | + isok = 0; | |
| 642 | + gname = val.goods_name; | |
| 643 | + throw "购买数量不能为0"; | |
| 644 | + return false; | |
| 645 | + } | |
| 646 | + if (num > val.store_count) { | |
| 647 | + isok = 0; | |
| 648 | + gname = val.goods_name; | |
| 649 | + throw "超出库存"; | |
| 650 | + return false; | |
| 651 | + } | |
| 652 | + if (num > val.redisnum && val.redisnum) { | |
| 653 | + isok = 0; | |
| 654 | + gname = val.goods_name; | |
| 655 | + throw "超出活动库存"; | |
| 656 | + return false; | |
| 657 | + } | |
| 658 | + if (num > val.goods_num - val.buy_num && val.goods_num) { | |
| 659 | + isok = 0; | |
| 660 | + gname = val.goods_name; | |
| 661 | + throw "超出活动库存"; | |
| 662 | + return false; | |
| 663 | + } | |
| 664 | + | |
| 665 | + var buyed = map_limit.get(val.goods_id + ""); | |
| 666 | + if (num + buyed.goodsbuynum > val.viplimited && val.viplimited > 0) { | |
| 667 | + isok = 0; | |
| 668 | + gname = val.goods_name; | |
| 669 | + throw "超出商品限购"; | |
| 670 | + return false; | |
| 671 | + } | |
| 672 | + | |
| 673 | + if (num + buyed.promgoodsbuynum > val.buy_limit && val.buy_limit > 0) { | |
| 674 | + isok = 0; | |
| 675 | + gname = val.goods_name; | |
| 676 | + throw "超出活动限购"; | |
| 677 | + return false; | |
| 678 | + } | |
| 679 | + | |
| 680 | + for (var i = 0; i < g_arr.length; i++) { | |
| 681 | + if (g_arr[i].goods_id == val.goods_id) { | |
| 682 | + if (g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price != val.prom_price) { | |
| 683 | + isok = 0; | |
| 684 | + gname = val.goods_name; | |
| 685 | + throw "商品价格已经变化"; | |
| 686 | + } | |
| 687 | + rq.put("/api/weshop/cart/update", { | |
| 688 | + data: { | |
| 689 | + id: g_arr[i].id, | |
| 690 | + selected: 1, | |
| 691 | + store_id: oo.stoid | |
| 692 | + }, | |
| 693 | + success: function(ee) { | |
| 694 | + console.log(ee); | |
| 534 | 695 | } |
| 535 | - wx.navigateTo({ | |
| 536 | - url: "/pages/cart/cart2/cart2" | |
| 537 | - }); | |
| 696 | + }); | |
| 538 | 697 | } |
| 698 | + } | |
| 699 | + | |
| 700 | + }) | |
| 701 | + } catch (e) { | |
| 702 | + err = e; | |
| 539 | 703 | } |
| 540 | - }); | |
| 541 | - }, | |
| 542 | - | |
| 543 | - //结算到最后一个商品 | |
| 544 | - set_last: function (ab, isok, gname){ | |
| 545 | - if (isok == 0) { | |
| 546 | - t.my_warnning(gname + "商品超出库存",0,this); | |
| 547 | - } else { | |
| 548 | - ab ? wx.navigateTo({ | |
| 549 | - url: "/pages/cart/cart2/cart2" | |
| 550 | - }) : t.my_warnning("还没有选中商品",0,this); | |
| 704 | + if (isok == 0) { | |
| 705 | + t.confirmBox(gname + ":" + err); | |
| 706 | + return false; | |
| 707 | + } | |
| 708 | + wx.navigateTo({ | |
| 709 | + url: "/pages/cart/cart2/cart2" | |
| 710 | + }); | |
| 711 | + } | |
| 551 | 712 | } |
| 552 | - }, | |
| 713 | + }); | |
| 714 | + }, | |
| 715 | + | |
| 716 | + //结算到最后一个商品 | |
| 717 | + set_last: function(ab, isok, gname) { | |
| 718 | + if (isok == 0) { | |
| 719 | + t.my_warnning(gname + "商品超出库存", 0, this); | |
| 720 | + } else { | |
| 721 | + ab ? wx.navigateTo({ | |
| 722 | + url: "/pages/cart/cart2/cart2" | |
| 723 | + }) : t.my_warnning("还没有选中商品", 0, this); | |
| 724 | + } | |
| 725 | + }, | |
| 553 | 726 | |
| 554 | 727 | |
| 555 | 728 | //图片失败,默认图片 |
| 556 | - bind_bnerr2: function (e) { | |
| 729 | + bind_bnerr2: function(e) { | |
| 557 | 730 | var _errImg = e.target.dataset.errorimg; |
| 558 | 731 | var _errurl = e.target.dataset.url; |
| 559 | 732 | var ii = _errurl.indexOf(oo.imghost); |
| 560 | 733 | if (ii != -1) { |
| 561 | 734 | this.setData({ |
| 562 | - [_errImg]: oo.imghost+"/miniapp/images/default_g_img.gif", | |
| 735 | + [_errImg]: oo.imghost + "/miniapp/images/default_g_img.gif", | |
| 563 | 736 | }) |
| 564 | 737 | } |
| 738 | + }, | |
| 739 | + //设置点击按钮为true或者false | |
| 740 | + radio_chick: function(checked, num) { | |
| 741 | + var th = this; | |
| 742 | + var requestData = th.data.requestData; | |
| 743 | + }, | |
| 744 | + | |
| 745 | + //点击编辑后的效果 | |
| 746 | + edit_cart: function(e) { | |
| 747 | + var type = parseFloat(e.currentTarget.dataset.type); | |
| 748 | + this.setData({ | |
| 749 | + is_edit: type | |
| 750 | + }); | |
| 751 | + }, | |
| 752 | + | |
| 753 | + //--多个删除购物车商品--- | |
| 754 | + check_del: function() { | |
| 755 | + var glist = ""; //用逗号隔开的 | |
| 756 | + var user_id = getApp().globalData.user_id; | |
| 757 | + var th = this; | |
| 758 | + | |
| 759 | + var ab = 0; //选中 | |
| 760 | + for (var i = 0; i < this.data.requestData.length; i++) { | |
| 761 | + var i_arr = this.data.requestData[i].goods; | |
| 762 | + for (var j = 0; j < i_arr.length; j++) { | |
| 763 | + if (i_arr[j].selected) { | |
| 764 | + glist += i_arr[j].id + ","; | |
| 765 | + ab = 1; | |
| 766 | + } | |
| 767 | + } | |
| 768 | + } | |
| 769 | + | |
| 770 | + if (ab == 0) { | |
| 771 | + t.my_warnning("未选择商品", 0, th); | |
| 772 | + return false; | |
| 773 | + } | |
| 774 | + glist = glist.substring(0, glist.length - 1); | |
| 775 | + //要删除购物车中的商品 | |
| 776 | + var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist; | |
| 777 | + getApp().request.delete(url, { | |
| 778 | + success: function(t) { | |
| 779 | + th.getCardList(); | |
| 780 | + } | |
| 781 | + }); | |
| 782 | + }, | |
| 783 | + //跳到首页 | |
| 784 | + goto: function(e) { | |
| 785 | + wx.switchTab({ | |
| 786 | + url: '/pages/index/index/index', | |
| 787 | + }) | |
| 565 | 788 | } |
| 566 | 789 | |
| 567 | 790 | -}); |
| 791 | +}); | |
| 568 | 792 | \ No newline at end of file | ... | ... |
pages/cart/cart/cart.wxml
| 1 | +<!-- 广告图片 --> | |
| 2 | +<navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}"> | |
| 3 | + <image class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> | |
| 4 | +</navigator> | |
| 1 | 5 | <view class="container" wx:if="{{requestData.length>0}}"> |
| 2 | - <view class="login-in pd-bg-fff"> | |
| 3 | - <block wx:for="{{requestData}}" wx:key="{{index}}" wx:for-index="pidx"> | |
| 4 | - <view class="shmd_m"> | |
| 5 | - <view bindtap="check_th_all_item" class="goods-ico" data-pitems="{{pidx}}" > | |
| 6 | - <icon color="{{checkAllToggle||item.selected?'red':'gray'}}" size="16" type="success"></icon> | |
| 7 | - </view> | |
| 8 | - <view class="shmd">门店:{{item.pname}}</view> | |
| 6 | + <!-- 购物车商品框架 --> | |
| 7 | + <view class="login-in"> | |
| 8 | + <!-- 编辑 --> | |
| 9 | + <view class="padding flex-vertical-between fs30 Storenum store"> | |
| 10 | + <view class="flex"> | |
| 11 | + <view>商品数量:</view> | |
| 12 | + <view class="goods_num">{{all_num}}</view> | |
| 13 | + </view> | |
| 14 | + <view wx:if="{{is_edit==0}}" bindtap="edit_cart" data-type="1">编辑</view> | |
| 15 | + <view wx:else bindtap="edit_cart" data-type="0">完成</view> | |
| 16 | + </view> | |
| 17 | + <block wx:for="{{requestData}}" wx:key="{{index}}" wx:for-index="pidx"> | |
| 18 | + <!-- 门店底下的商品 --> | |
| 19 | + <view class="store"> | |
| 20 | + <view class="shmd_m"> | |
| 21 | + <!-- 门店 --> | |
| 22 | + <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>--> | |
| 23 | + | |
| 24 | + <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" | |
| 25 | + color="red" size="20" type="success"></icon> | |
| 26 | + <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view> | |
| 27 | + | |
| 28 | + <view class="flex-center"> | |
| 29 | + <image src="{{iurl}}miniapp/images/stores/store.png"></image> | |
| 30 | + <view class="shmd fs30">{{item.pname}}</view> | |
| 9 | 31 | </view> |
| 10 | - <view class="order-item" data-item="{{idx}}" wx:for="{{item.goods}}" | |
| 11 | - wx:for-item="items" | |
| 12 | - wx:for-index="idx" wx:key="{{index}}"> | |
| 13 | - <view bindtap="check_th_item" class="goods-ico" data-check="{{items.selected}}" data-item="{{idx}}" data-pitems="{{pidx}}"> | |
| 14 | - <icon color="{{checkAllToggle||items.selected?'red':'gray'}}" size="16" type="success"></icon> | |
| 32 | + | |
| 33 | + </view> | |
| 34 | + <view class="order-item" data-item="{{idx}}" wx:for="{{item.goods}}" wx:for-item="items" wx:for-index="idx" wx:key="{{index}}"> | |
| 35 | + <view bindtap="check_th_item" class="order-raido flex-vertical " data-check="{{items.selected}}" data-item="{{idx}}" data-pitems="{{pidx}}"> | |
| 36 | + <!--<radio color="red" checked="{{checkAllToggle||items.selected}}"></radio>--> | |
| 37 | + <icon wx:if="{{checkAllToggle||items.selected}}" color="red" size="20" type="success"></icon> | |
| 38 | + <text wx:else class="icon_no_sele"></text> | |
| 39 | + </view> | |
| 40 | + <navigator class="goods-img rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | |
| 41 | + <image class="wh100" src="{{items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image> | |
| 42 | + <view class="abs flex-center fs26" wx:if="{{items.distr_type==0}}">自选</view> | |
| 43 | + <view class="abs flex-center fs26" wx:if="{{items.distr_type==1}}">自提</view> | |
| 44 | + <view class="abs flex-center fs26" wx:if="{{items.distr_type==2}}">物流</view> | |
| 45 | + | |
| 46 | + </navigator> | |
| 47 | + <view class="goods-cont"> | |
| 48 | + <view class="goods-name"> | |
| 49 | + <navigator class="ellipsis-2 fs30" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">{{items.goods_name}}</navigator> | |
| 50 | + | |
| 51 | + <view class="specifications ellipsis-1"> | |
| 52 | + <view wx:if="{{items.goods_color || items.goods_spec}}"> | |
| 53 | + {{items.goods_color}}{{items.goods_color?"/":''}}{{items.goods_spec}}</view> | |
| 54 | + <view wx:else>规格1</view> | |
| 55 | + </view> | |
| 56 | + </view> | |
| 57 | + | |
| 58 | + <view class="flex alend jc_sb"> | |
| 59 | + <view class="goods-price co-red baseline ellipsis-1"> | |
| 60 | + <view class="fs20">¥</view> | |
| 61 | + <view class="fs28">{{items.goods_price}}</view> | |
| 15 | 62 | </view> |
| 16 | - <navigator class="goods-img" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | |
| 17 | - <image class="wh100" src="{{items.original_img}}" | |
| 18 | - binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" | |
| 19 | - data-url="{{items.original_img}}" ></image> | |
| 20 | - </navigator> | |
| 21 | - <view class="goods-cont"> | |
| 22 | - <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">{{items.goods_name}}</navigator> | |
| 23 | - <view class="goods-attribute ellipsis-2">{{items.spec_key_name}}</view> | |
| 24 | - <view class="goods-price co-red">¥{{items.goods_price}}</view> | |
| 25 | - <view bindtap="delete_th_item" class="btn-del" data-cartid="{{items.id}}"> | |
| 26 | - <image class="wh100" src="{{imgUrl}}/miniapp/images/dele.png"></image> | |
| 27 | - </view> | |
| 28 | - <view class="count"> | |
| 29 | - <view bindtap="subNum" class="sub" data-pitems="{{pidx}}" data-item="{{idx}}">-</view> | |
| 30 | - <input bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input> | |
| 31 | - <view bindtap="addNum" class="add" data-pitems="{{pidx}}" data-item="{{idx}}">+</view> | |
| 32 | - </view> | |
| 63 | + <view class="count"> | |
| 64 | + <view bindtap="subNum" class="sub fs28" data-pitems="{{pidx}}" data-item="{{idx}}">一</view> | |
| 65 | + <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input> | |
| 66 | + <view class="add" bindtap="addNum" data-pitems="{{pidx}}" data-item="{{idx}}">+</view> | |
| 33 | 67 | </view> |
| 68 | + </view> | |
| 34 | 69 | </view> |
| 35 | - </block> | |
| 36 | - </view> | |
| 70 | + </view> | |
| 71 | + </view> | |
| 72 | + </block> | |
| 73 | + </view> | |
| 74 | + <view class="pay-for flex-vertical-between"> | |
| 75 | + <view class="allradio flex-vertical-between"> | |
| 76 | + <view class="flex-vertical mlr" bindtap="checkAll"> | |
| 77 | + <!--<radio class="order-raido" color="red" checked="{{checkAllToggle}}"></radio>--> | |
| 78 | + <icon wx:if="{{checkAllToggle}}" color="red" size="20" type="success"></icon> | |
| 79 | + <text wx:else class="icon_no_sele"></text> | |
| 80 | + <view class="all fs30" style="margin-left: 10rpx">全选</view> | |
| 81 | + </view> | |
| 37 | 82 | |
| 38 | - <view class="pay-for"> | |
| 39 | - <label bindtap="checkAll" class="checkbox"> | |
| 40 | - <icon class="ico-check" color="{{checkAllToggle?'red':'gray'}}" size="20" type="success"></icon>全选 | |
| 41 | - </label> | |
| 42 | - <button bindtap="checkout" class="pay-btn">去结算</button> | |
| 43 | - <view class="consumer"> | |
| 44 | - <view class="total">总计 : <text class="co-red">{{total_fee}}</text> | |
| 45 | - </view> | |
| 46 | - <text class="tips">不包含运费</text> | |
| 83 | + <!-- 显示金额的多少 --> | |
| 84 | + <view class="consumer" wx:if="{{is_edit==0}}"> | |
| 85 | + <view class="fs30 baseline"> | |
| 86 | + <view class="total">合计:</view> | |
| 87 | + <text class="co-red">¥{{total_fee}}</text> | |
| 88 | + </view> | |
| 89 | + <view class="flex-level-right"> | |
| 90 | + <text class="tips fs20">不含运费</text> | |
| 47 | 91 | </view> |
| 92 | + </view> | |
| 48 | 93 | </view> |
| 49 | -</view> | |
| 50 | -<view class="no-data" wx:if="{{!requestData||requestData.length==0}}"> | |
| 51 | - <image class="cart-image" src="{{imgUrl}}/miniapp/images/cart-null.png"></image> | |
| 52 | - <view class="no-data-title">购物车暂无商品</view> | |
| 53 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 94 | + <view> | |
| 95 | + | |
| 96 | + <button wx:if="{{is_edit}}" bindtap="check_del" class="pay-btn">删除</button> | |
| 97 | + <button wx:else bindtap="checkout" class="pay-btn">结算({{total_num}})</button> | |
| 98 | + </view> | |
| 99 | + </view> | |
| 100 | + | |
| 54 | 101 | </view> |
| 55 | 102 | |
| 103 | +<!-- 购物车为空 --> | |
| 104 | +<view class="empty_order" wx:if="{{(!requestData|| requestData.length==0) && is_load}}"> | |
| 105 | + <view class="flex-level"> | |
| 106 | + <image src="{{iurl}}miniapp/images/stores/nocart.png"></image> | |
| 107 | + </view> | |
| 108 | + <view class="flex-level fs32 xc-ash">购物车竟然是空的</view> | |
| 109 | + <view class="flex-level"> | |
| 110 | + <navigator url="/pages/index/index/index" bindtap="goto"> | |
| 111 | + <view class="flex-center fs30 white">去首页逛逛</view> | |
| 112 | + </navigator> | |
| 113 | + </view> | |
| 114 | +</view> | |
| 56 | 115 | |
| 57 | 116 | <warn id="warn"></warn> |
| 58 | 117 | \ No newline at end of file | ... | ... |
pages/cart/cart/cart.wxss
| 1 | 1 | page { |
| 2 | - background-color: #fff; | |
| 2 | + background-color: rgb(245, 245, 245); | |
| 3 | + font-family: crosoft yahei; | |
| 4 | +} | |
| 5 | + | |
| 6 | +.padding { | |
| 7 | + padding: 0rpx 30rpx; | |
| 8 | +} | |
| 9 | + | |
| 10 | +.alend { | |
| 11 | + align-items: flex-end; | |
| 12 | +} | |
| 13 | + | |
| 14 | +.goods-price { | |
| 15 | + font-size: 18rpx; | |
| 16 | +} | |
| 17 | + | |
| 18 | +.baseline { | |
| 19 | + display: flex; | |
| 20 | + align-items: baseline; | |
| 21 | +} | |
| 22 | + | |
| 23 | +.picture { | |
| 24 | + width: 100%; | |
| 25 | + height: 220rpx; | |
| 3 | 26 | } |
| 4 | 27 | |
| 5 | 28 | .container { |
| 6 | - display: flex; | |
| 7 | - height: 100%; | |
| 8 | - align-items: center; | |
| 9 | - justify-content: center; | |
| 10 | - background-color: #fff; | |
| 11 | - padding-bottom: 100rpx; | |
| 29 | + display: flex; | |
| 30 | + height: 100%; | |
| 31 | + align-items: center; | |
| 32 | + justify-content: center; | |
| 33 | + background-color: rgb(255, 255, 255); | |
| 34 | + margin-bottom: 99rpx; | |
| 35 | +} | |
| 36 | + | |
| 37 | +radio { | |
| 38 | + transform: scale(0.8); | |
| 12 | 39 | } |
| 13 | 40 | |
| 14 | 41 | .login-in { |
| 15 | - width: 100%; | |
| 16 | - box-sizing: border-box; | |
| 42 | + width: 100%; | |
| 43 | + box-sizing: border-box; | |
| 44 | + background-color: rgb(255, 255, 255); | |
| 17 | 45 | } |
| 18 | 46 | |
| 19 | 47 | .order-item { |
| 20 | - display: flex; | |
| 21 | - justify-content: space-around; | |
| 22 | - height: 200rpx; | |
| 23 | - padding: 10rpx 0; | |
| 24 | - border-bottom: 1px solid #ddd; | |
| 48 | + display: flex; | |
| 49 | + height: 246rpx; | |
| 50 | + border-top: 3rpx solid rgb(245, 245, 245); | |
| 51 | + align-items: center; | |
| 52 | + padding-right: 30rpx; | |
| 25 | 53 | } |
| 26 | 54 | |
| 27 | 55 | .goods-ico { |
| 28 | - display: flex; | |
| 29 | - align-items: center; | |
| 56 | + display: flex; | |
| 57 | + align-items: center; | |
| 58 | + padding: 0rpx 30rpx; | |
| 59 | +} | |
| 60 | + | |
| 61 | +.order-raido { | |
| 62 | + height: 100%; | |
| 63 | + padding-left: 30rpx; | |
| 64 | + padding-right: 25rpx; | |
| 30 | 65 | } |
| 31 | 66 | |
| 32 | 67 | .goods-img { |
| 33 | - width: 180rpx; | |
| 34 | - height: 180rpx; | |
| 35 | - font-size: 0; | |
| 36 | - margin-top: 10rpx; | |
| 68 | + width: 180rpx; | |
| 69 | + height: 180rpx; | |
| 70 | + font-size: 0; | |
| 71 | + overflow: hidden; | |
| 72 | + border: 2rpx solid rgb(236, 236, 236); | |
| 37 | 73 | } |
| 38 | 74 | |
| 39 | 75 | .goods-cont { |
| 40 | - position: relative; | |
| 41 | - width: 430rpx; | |
| 42 | - height: 200rpx; | |
| 43 | - font-size: 28rpx; | |
| 76 | + width: 385rpx; | |
| 77 | + height: 165rpx; | |
| 78 | + font-size: 28rpx; | |
| 79 | + margin-left: 35rpx; | |
| 80 | + padding-top: 7rpx; | |
| 81 | + padding-bottom: 5rpx; | |
| 44 | 82 | } |
| 45 | 83 | |
| 46 | 84 | .goods-name { |
| 47 | - width: 370rpx; | |
| 48 | - height: 64rpx; | |
| 49 | - margin: 8rpx 0; | |
| 50 | - line-height: 32rpx; | |
| 51 | - color: #333; | |
| 52 | - | |
| 85 | + line-height: 32rpx; | |
| 86 | + color: #333; | |
| 87 | + height: 125rpx; | |
| 53 | 88 | } |
| 54 | 89 | |
| 55 | 90 | .goods-attribute { |
| 56 | - max-height: 52rpx; | |
| 57 | - line-height: 26rpx; | |
| 58 | - font-size: 24rpx; | |
| 59 | - color: #999; | |
| 60 | -} | |
| 61 | - | |
| 62 | -.goods-price { | |
| 63 | - height: 40rpx; | |
| 64 | - line-height: 40rpx; | |
| 65 | - margin-top: 10rpx; | |
| 91 | + max-height: 52rpx; | |
| 92 | + line-height: 26rpx; | |
| 93 | + font-size: 24rpx; | |
| 94 | + color: #999; | |
| 66 | 95 | } |
| 67 | 96 | |
| 68 | 97 | .btn-del { |
| 69 | - position: absolute; | |
| 70 | - right: 0; | |
| 71 | - top: 8rpx; | |
| 72 | - width: 34rpx; | |
| 73 | - height: 34rpx; | |
| 98 | + position: absolute; | |
| 99 | + right: 0; | |
| 100 | + top: 8rpx; | |
| 101 | + width: 34rpx; | |
| 102 | + height: 34rpx; | |
| 74 | 103 | } |
| 75 | 104 | |
| 76 | 105 | .count { |
| 77 | - position: absolute; | |
| 78 | - right: 0; | |
| 79 | - bottom: 5rpx; | |
| 80 | - width: 156rpx; | |
| 81 | - height: 50rpx; | |
| 82 | - border: 1px solid #ddd; | |
| 106 | + display: flex; | |
| 107 | + bottom: 5rpx; | |
| 108 | + border: 2rpx solid rgb(236, 236, 236); | |
| 109 | + margin-bottom: 3rpx; | |
| 110 | +} | |
| 111 | + | |
| 112 | +.count>view, .count>input { | |
| 113 | + width: 50rpx; | |
| 114 | + height: 40rpx; | |
| 115 | + line-height: 40rpx; | |
| 116 | + text-align: center; | |
| 117 | + display: flex; | |
| 118 | + font-size: 18rpx; | |
| 119 | + justify-content: center; | |
| 120 | + min-height: 35rpx; | |
| 83 | 121 | } |
| 84 | 122 | |
| 85 | -.count>view,.count>input { | |
| 86 | - float: left; | |
| 87 | - width: 50rpx; | |
| 88 | - height: 50rpx; | |
| 89 | - line-height: 50rpx; | |
| 90 | - text-align: center; | |
| 123 | +.count>.goodadd { | |
| 124 | + width: 67rpx; | |
| 125 | + font-size: 24rpx; | |
| 126 | +} | |
| 127 | + | |
| 128 | +.count>.add { | |
| 129 | + font-size: 32rpx; | |
| 91 | 130 | } |
| 92 | 131 | |
| 93 | 132 | .sub { |
| 94 | - border-right: 1px solid #ddd; | |
| 133 | + border-right: 2rpx solid rgb(236, 236, 236); | |
| 95 | 134 | } |
| 96 | 135 | |
| 97 | 136 | .add { |
| 98 | - border-left: 1px solid #ddd; | |
| 137 | + border-left: 2rpx solid rgb(236, 236, 236); | |
| 99 | 138 | } |
| 100 | 139 | |
| 101 | 140 | .pay-for { |
| 102 | - width: 100%; | |
| 103 | - height: 100rpx; | |
| 104 | - position: fixed; | |
| 105 | - left: 0; | |
| 106 | - bottom: 0; | |
| 107 | - font-size: 28rpx; | |
| 108 | - color: #666; | |
| 109 | - background-color: #f0f2f5; | |
| 141 | + | |
| 142 | + width: 100%; | |
| 143 | + height: 100rpx; | |
| 144 | + position: fixed; | |
| 145 | + left: 0; | |
| 146 | + bottom: 0; | |
| 147 | + font-size: 28rpx; | |
| 148 | + color: #666; | |
| 149 | + background-color: rgb(255, 255, 255); | |
| 150 | + z-index: 2; | |
| 151 | + border-top: 1rpx solid rgb(236, 236, 236); | |
| 152 | + border-bottom: 1rpx solid rgb(236, 236, 236); | |
| 153 | + | |
| 110 | 154 | } |
| 111 | 155 | |
| 112 | 156 | .pay-for .pay-btn { |
| 113 | - float: right; | |
| 114 | - width: 200rpx; | |
| 115 | - height: 100rpx; | |
| 116 | - line-height: 100rpx; | |
| 117 | - text-align: center; | |
| 118 | - background-color: #f23030; | |
| 119 | - color: #fff; | |
| 120 | - border-radius: 0; | |
| 157 | + width: 220rpx; | |
| 158 | + height: 100rpx; | |
| 159 | + line-height: 100rpx; | |
| 160 | + background-color: rgb(219, 27, 52); | |
| 161 | + color: #fff; | |
| 162 | + border-radius: 0; | |
| 163 | + font-size: 31rpx; | |
| 121 | 164 | } |
| 122 | 165 | |
| 123 | 166 | .pay-for .consumer { |
| 124 | - float: right; | |
| 125 | - margin-right: 20rpx; | |
| 126 | - line-height: 50rpx; | |
| 167 | + margin-right: 23rpx; | |
| 168 | + color: rgb(0, 0, 0); | |
| 169 | + letter-spacing: 1rpx; | |
| 170 | +} | |
| 171 | + | |
| 172 | +.pay-for .consumer .total { | |
| 173 | + color: rgb(0, 0, 0); | |
| 174 | +} | |
| 175 | + | |
| 176 | +.pay-for .consumer .tips { | |
| 177 | + color: rgb(153, 153, 153); | |
| 127 | 178 | } |
| 128 | 179 | |
| 129 | 180 | .pay-for .checkbox { |
| 130 | - float: left; | |
| 131 | - padding-left: 40rpx; | |
| 132 | - line-height: 100rpx; | |
| 133 | - display: flex; | |
| 134 | - align-items: center; | |
| 181 | + float: left; | |
| 182 | + padding-left: 40rpx; | |
| 183 | + line-height: 100rpx; | |
| 184 | + display: flex; | |
| 185 | + align-items: center; | |
| 135 | 186 | } |
| 136 | 187 | |
| 137 | 188 | .pay-for .ico-check { |
| 138 | - display: flex; | |
| 139 | - align-items: center; | |
| 140 | - margin-right: 20rpx; | |
| 189 | + display: flex; | |
| 190 | + align-items: center; | |
| 191 | + margin-right: 20rpx; | |
| 192 | +} | |
| 193 | + | |
| 194 | +.shmd_m { | |
| 195 | + height: 80rpx; | |
| 196 | + line-height: 80rpx; | |
| 197 | + display: flex; | |
| 198 | +} | |
| 199 | + | |
| 200 | +.shmd_m image { | |
| 201 | + height: 50rpx; | |
| 202 | + width: 55rpx; | |
| 203 | + margin-left: -10rpx; | |
| 141 | 204 | } |
| 142 | -.shmd_m{margin-left: 5rpx; height: 80rpx; line-height: 80rpx; display: flex;border-bottom: 1rpx solid #ddd} | |
| 143 | -.shmd_m .goods-ico icon{margin-top: 26rpx;} | |
| 144 | -.shmd{margin-left: 20rpx;} | |
| 145 | 205 | \ No newline at end of file |
| 206 | + | |
| 207 | +.shmd_m .goods-ico icon { | |
| 208 | + margin-top: 26rpx; | |
| 209 | +} | |
| 210 | + | |
| 211 | +.shmd { | |
| 212 | + margin-left: 5rpx; | |
| 213 | +} | |
| 214 | + | |
| 215 | +.store { | |
| 216 | + border-bottom: 7rpx solid rgb(245, 245, 245); | |
| 217 | +} | |
| 218 | + | |
| 219 | +.login-in .Storenum { | |
| 220 | + height: 80rpx; | |
| 221 | + color: rgb(51, 51, 51); | |
| 222 | +} | |
| 223 | + | |
| 224 | +.login-in .goods_num { | |
| 225 | + margin-left: 13rpx; | |
| 226 | +} | |
| 227 | + | |
| 228 | +.allradio { | |
| 229 | + width: 600rpx; | |
| 230 | + height: 100%; | |
| 231 | +} | |
| 232 | + | |
| 233 | +.allradio .all { | |
| 234 | + color: rgb(0, 0, 0); | |
| 235 | +} | |
| 236 | + | |
| 237 | +.specifications { | |
| 238 | + padding: 3rpx 8rpx; | |
| 239 | + margin-top: 8rpx; | |
| 240 | + font-size: 22rpx; | |
| 241 | + max-width: 356rpx; | |
| 242 | + width: auto; | |
| 243 | + height: 30rpx; | |
| 244 | + line-height: 29rpx; | |
| 245 | + background-color: rgb(236, 236, 236); | |
| 246 | + border-radius: 8rpx; | |
| 247 | + white-space: nowrap; | |
| 248 | + color: rgb(63, 63, 63); | |
| 249 | + display: inline-block; | |
| 250 | + | |
| 251 | +} | |
| 252 | + | |
| 253 | +.ellipsis-2 { | |
| 254 | + max-height: 64rpx; | |
| 255 | +} | |
| 256 | + | |
| 257 | +.abs { | |
| 258 | + top: 15rpx; | |
| 259 | + left: -39rpx; | |
| 260 | + width: 154rpx; | |
| 261 | + height: 40rpx; | |
| 262 | + background-color: rgb(16, 202, 220); | |
| 263 | + transform: rotate(320deg); | |
| 264 | + color: rgb(255, 255, 255); | |
| 265 | + line-height: 40rpx; | |
| 266 | +} | |
| 267 | + | |
| 268 | +/* 购物车为空 */ | |
| 269 | + | |
| 270 | +.empty_order image { | |
| 271 | + width: 329rpx; | |
| 272 | + height: 229rpx; | |
| 273 | + margin-top: 140rpx; | |
| 274 | +} | |
| 275 | + | |
| 276 | +.empty_order .xc-ash { | |
| 277 | + margin-top: 25rpx; | |
| 278 | + font-weight: 600px; | |
| 279 | +} | |
| 280 | + | |
| 281 | +.empty_order navigator { | |
| 282 | + margin-top: 60rpx; | |
| 283 | + border-radius: 40rpx; | |
| 284 | +} | |
| 285 | + | |
| 286 | +.empty_order navigator view { | |
| 287 | + width: 247rpx; | |
| 288 | + height: 56rpx; | |
| 289 | + background-color: rgb(255, 72, 72); | |
| 290 | + border-radius: 40rpx; | |
| 291 | +} | |
| 292 | + | |
| 293 | +.icon_no_sele{ display: inline-block; width: 39rpx; height: 39rpx; border: 1rpx solid #ddd; border-radius: 50%} | |
| 294 | +.icon_no_sele2{width: 39rpx; height: 39rpx; border: 1rpx solid #ddd; border-radius: 50%; margin-top: 20rpx; | |
| 295 | + margin-left: 30rpx; margin-right: 25rpx} | |
| 296 | + | |
| 297 | +.mlr{ margin-left: 25rpx; margin-right: 20rpx} | ... | ... |
pages/cart/cart2/c_filter.wxs
0 → 100644
| 1 | +var filters = { | |
| 2 | + toFix:function(val,count){ | |
| 3 | + return val.toFixed(count) | |
| 4 | + }, | |
| 5 | + format_time:function(ts,isFull) { | |
| 6 | + var d = getDate(ts*1000) | |
| 7 | + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); | |
| 8 | + if(isFull==1) | |
| 9 | + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') | |
| 10 | + return fm; | |
| 11 | + }, | |
| 12 | + setcolor:function(ind){ | |
| 13 | + if (ind == 0 || ind ==null) return "red"; | |
| 14 | + if(ind==1 ) return "green"; | |
| 15 | + if(ind==2) return "blue"; | |
| 16 | + if(ind==11) return "green"; | |
| 17 | + if(ind==12) return "blue"; | |
| 18 | + return ""; | |
| 19 | + }, | |
| 20 | + setbgcolor: function (ind) { | |
| 21 | + if (ind == 0 || ind == null) return "#ffa1b9"; | |
| 22 | + if (ind == 1) return "#59e1d2"; | |
| 23 | + if (ind == 2) return "#a3bcff"; | |
| 24 | + if (ind == 11) return "#59e1d2"; | |
| 25 | + if (ind == 12) return "#a3bcff"; | |
| 26 | + return ""; | |
| 27 | + }, | |
| 28 | + | |
| 29 | + get_type:function(ind){ | |
| 30 | + if (ind == 0 || ind == null) return "全场通用"; | |
| 31 | + if (ind == 1) return "品牌"; | |
| 32 | + if (ind == 2) return "品类"; | |
| 33 | + if (ind == 11) return "用途"; | |
| 34 | + if (ind == 12) return "分类1"; | |
| 35 | + return ""; | |
| 36 | + }, | |
| 37 | + get_type_card:function(ind){ | |
| 38 | + if (ind == 0 || ind == null) return "全场通用"; | |
| 39 | + if (ind == 1) return "指定品牌"; | |
| 40 | + if (ind == 2) return "指定品类"; | |
| 41 | + if (ind == 11) return "指定用途"; | |
| 42 | + if (ind == 12) return "指定分类1"; | |
| 43 | + return ""; | |
| 44 | + }, | |
| 45 | + format_huiche:function (text) { | |
| 46 | + if (!text) { | |
| 47 | + return ""; | |
| 48 | + } | |
| 49 | + var reg = getRegExp('\\\\n', 'g') | |
| 50 | + return text.replace(reg, '\n') | |
| 51 | + } | |
| 52 | +} | |
| 53 | + | |
| 54 | +module.exports = { | |
| 55 | + toFix: filters.toFix, | |
| 56 | + format_time:filters.format_time, | |
| 57 | + setcolor:filters.setcolor, | |
| 58 | + setbgcolor: filters.setbgcolor, | |
| 59 | + get_type: filters.get_type, | |
| 60 | + get_split_name: filters.get_split_name, | |
| 61 | + get_type_card: filters.get_type_card, | |
| 62 | + format_huiche: filters.format_huiche, | |
| 63 | +} | |
| 0 | 64 | \ No newline at end of file | ... | ... |
pages/cart/cart2/cart2.js
| ... | ... | @@ -2,10 +2,11 @@ var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"), |
| 2 | 2 | s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp(); |
| 3 | 3 | var oo=t.globalData.setting; |
| 4 | 4 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 5 | +var util_pay = require("../../../utils/pay.js"); | |
| 5 | 6 | |
| 6 | -Page({ | |
| 7 | +Page({ | |
| 7 | 8 | data: { |
| 8 | - url: t.globalData.setting.url, | |
| 9 | + url: t.globalData.setting.url, | |
| 9 | 10 | resourceUrl: t.globalData.setting.resourceUrl, |
| 10 | 11 | imgUrl: t.globalData.setting.imghost, |
| 11 | 12 | goods: null, |
| ... | ... | @@ -51,6 +52,7 @@ Page({ |
| 51 | 52 | /*----------物流选择--------*/ |
| 52 | 53 | wu_arr:null, |
| 53 | 54 | index:0, |
| 55 | + w_sele_index:0, | |
| 54 | 56 | |
| 55 | 57 | //判断页面是返回回来的还是 首次进入的 |
| 56 | 58 | isclose:1, |
| ... | ... | @@ -71,10 +73,17 @@ Page({ |
| 71 | 73 | //选择的券列表 |
| 72 | 74 | selected_quan_list:null, |
| 73 | 75 | //选择的券的门店 |
| 74 | - selected_quan_pick:null, | |
| 76 | + selected_quan_pick:null, | |
| 75 | 77 | is_close_quan:0, |
| 76 | 78 | disabled:0, |
| 77 | - | |
| 79 | + open_express:0,//控制选择物流名列表 的属性 | |
| 80 | + | |
| 81 | + is_express:0, //选中物流的属性 | |
| 82 | + expres_name:"", //点击选定 | |
| 83 | + isopen:0, //券的说明 | |
| 84 | + is_coupon:null, //选择券的控制属性 | |
| 85 | + is_shipping_code:"",//插入用户默认地址 | |
| 86 | + wu_arr_txt:"", //要更新的物流的字段 | |
| 78 | 87 | }, |
| 79 | 88 | onLoad: function(t) { |
| 80 | 89 | |
| ... | ... | @@ -89,21 +98,20 @@ Page({ |
| 89 | 98 | } |
| 90 | 99 | }); |
| 91 | 100 | |
| 92 | - //先获取是否有关闭使用优惠券 | |
| 93 | - getApp().getConfig2(function (ee) { | |
| 94 | - var json_d = JSON.parse(ee.switch_list); | |
| 95 | - th.setData({ is_close_quan: json_d.is_close_quan }); | |
| 96 | - //-----先获取物流,再获取用户信息,再展示页面----- | |
| 97 | - th.get_wuliu(th.get_info(th.show_page)); | |
| 98 | - }) | |
| 101 | + //先获取是否有关闭使用优惠券 | |
| 102 | + getApp().getConfig2(function (ee) { | |
| 103 | + var json_d = JSON.parse(ee.switch_list); | |
| 104 | + th.setData({ is_close_quan: json_d.is_close_quan }); | |
| 105 | + //-----先获取物流,再获取用户信息,再展示页面----- | |
| 106 | + th.get_wuliu(th.get_info(th.show_page)); | |
| 107 | + }) | |
| 108 | + | |
| 99 | 109 | }, |
| 100 | 110 | onUnload: function () { this.setData({ isclose: 1 })}, |
| 101 | 111 | |
| 102 | 112 | //----------子页返回父页触发---------- |
| 103 | 113 | onShow: function() { |
| 104 | - console.log('onshow'); | |
| 105 | 114 | var th=this; |
| 106 | - console.log(th.data.isclose); | |
| 107 | 115 | if (th.data.isclose==0){ |
| 108 | 116 | /*--- |
| 109 | 117 | wx.navigateTo({ |
| ... | ... | @@ -115,7 +123,7 @@ Page({ |
| 115 | 123 | }) |
| 116 | 124 | |
| 117 | 125 | }else{ |
| 118 | - this.getuser_addr(function(ie){ | |
| 126 | + this.getuser_addr(function(ie){ | |
| 119 | 127 | |
| 120 | 128 | console.log("getuser_addr") |
| 121 | 129 | console.log(ie) |
| ... | ... | @@ -137,15 +145,20 @@ Page({ |
| 137 | 145 | },500) |
| 138 | 146 | |
| 139 | 147 | }); |
| 148 | + //--更新默认地址--,看一下是不是跳到地址页面 | |
| 149 | + if(!getApp().globalData.is_cart2_old){ | |
| 150 | + this.update_code(); | |
| 151 | + }else{ | |
| 152 | + getApp().globalData.is_cart2_old=0; | |
| 153 | + } | |
| 140 | 154 | } |
| 141 | 155 | }, |
| 142 | 156 | |
| 143 | 157 | //-------------------获取物流--------------- |
| 144 | 158 | get_wuliu(func) { |
| 159 | + | |
| 145 | 160 | var th = this; |
| 146 | 161 | to.getwuliu(function (e) { |
| 147 | - console.log("ws"); | |
| 148 | - console.log(e); | |
| 149 | 162 | th.setData({ wu_arr: e }) |
| 150 | 163 | typeof func == "function" && func(); |
| 151 | 164 | }) |
| ... | ... | @@ -223,7 +236,7 @@ Page({ |
| 223 | 236 | }); |
| 224 | 237 | }, |
| 225 | 238 | |
| 226 | - //-----真的获取购物车-------- | |
| 239 | + //-----真的获取购物车,入口-------- | |
| 227 | 240 | get_cart: function () { |
| 228 | 241 | var th = this,app=getApp(); |
| 229 | 242 | a.get("/api/weshop/cart/list", { |
| ... | ... | @@ -277,9 +290,17 @@ Page({ |
| 277 | 290 | //如果是物流的话,全部自提的控制要弄成0 |
| 278 | 291 | if (e_t == 0) th.setData({ is_all_zt:0}); |
| 279 | 292 | var narr = new Array(); narr.push(item); |
| 280 | - //-----------拼装购物车结算的数组----------------- | |
| 293 | + | |
| 294 | + //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号----------------- | |
| 295 | + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | |
| 296 | + if(e_t==0 && def_exp_code){ | |
| 297 | + for(var k=0;k<th.data.wu_arr.length;k++){ | |
| 298 | + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; } | |
| 299 | + } | |
| 300 | + } | |
| 301 | + | |
| 281 | 302 | var ie = { |
| 282 | - pickup_id: pcid, pname: pikname, goods: narr, exp_type: e_t, wind: 0, distr_t: dis_t, | |
| 303 | + pickup_id: pcid, pname: pikname, goods: narr, exp_type: e_t, wind: m_wind, distr_t: dis_t, | |
| 283 | 304 | goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0}; |
| 284 | 305 | arr.push(ie); |
| 285 | 306 | } |
| ... | ... | @@ -356,7 +377,7 @@ Page({ |
| 356 | 377 | }); |
| 357 | 378 | }, |
| 358 | 379 | |
| 359 | - //-----获取立即购买的商品信息---- | |
| 380 | + //-----获取立即购买的商品信息,入口---- | |
| 360 | 381 | get_buy_goods: function (e){ |
| 361 | 382 | var th=this; |
| 362 | 383 | var gg = to.get_b_now(); |
| ... | ... | @@ -380,6 +401,14 @@ Page({ |
| 380 | 401 | case 2: et = 0; break; |
| 381 | 402 | } |
| 382 | 403 | |
| 404 | + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | |
| 405 | + if(et==0 && def_exp_code){ | |
| 406 | + for(var k=0;k<th.data.wu_arr.length;k++){ | |
| 407 | + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; } | |
| 408 | + } | |
| 409 | + } | |
| 410 | + | |
| 411 | + | |
| 383 | 412 | switch (gd.prom_type){ |
| 384 | 413 | case 0: |
| 385 | 414 | case 6: |
| ... | ... | @@ -399,6 +428,8 @@ Page({ |
| 399 | 428 | }).then(res=>{ |
| 400 | 429 | if(res.data.code==0) |
| 401 | 430 | quanlist=res.data.data.pageData; |
| 431 | + | |
| 432 | + | |
| 402 | 433 | }) |
| 403 | 434 | } |
| 404 | 435 | |
| ... | ... | @@ -416,9 +447,9 @@ Page({ |
| 416 | 447 | |
| 417 | 448 | t.data.data.prom_id = 0; |
| 418 | 449 | t.data.data.prom_type = 0; |
| 419 | - | |
| 450 | + | |
| 420 | 451 | th.setData({ |
| 421 | - bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, | |
| 452 | + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, | |
| 422 | 453 | bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist |
| 423 | 454 | }); |
| 424 | 455 | //计算价格 |
| ... | ... | @@ -462,8 +493,9 @@ Page({ |
| 462 | 493 | } |
| 463 | 494 | } |
| 464 | 495 | } |
| 496 | + | |
| 465 | 497 | th.setData({ |
| 466 | - bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, | |
| 498 | + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, | |
| 467 | 499 | bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist |
| 468 | 500 | }); |
| 469 | 501 | //计算价格 |
| ... | ... | @@ -574,8 +606,7 @@ Page({ |
| 574 | 606 | th.data.cartlist[i].shipping_price=0; |
| 575 | 607 | } |
| 576 | 608 | |
| 577 | - th.data.cartlist[i].shipping_price.toFixed(2); | |
| 578 | - | |
| 609 | + th.data.cartlist[i].shipping_price=th.data.cartlist[i].shipping_price.toFixed(2); | |
| 579 | 610 | //---如果有选择优惠券的情况下--- |
| 580 | 611 | var quan_price=0; |
| 581 | 612 | var coupon_price=0,bn_pick=th.data.bn_pick,pickid=cart_item.pickup_id; |
| ... | ... | @@ -627,7 +658,7 @@ Page({ |
| 627 | 658 | } |
| 628 | 659 | }else{ |
| 629 | 660 | th.data.cartlist[i].user_money=0; |
| 630 | - } | |
| 661 | + } | |
| 631 | 662 | |
| 632 | 663 | th.data.cartlist[i].user_money = parseFloat(th.data.cartlist[i].user_money).toFixed(2); |
| 633 | 664 | |
| ... | ... | @@ -637,16 +668,17 @@ Page({ |
| 637 | 668 | th.data.cartlist[i].goods_price = o_price.toFixed(2); |
| 638 | 669 | th.data.cartlist[i].order_amount= th.data.cartlist[i].order_amount- th.data.cartlist[i].user_money; //会员使用余额 |
| 639 | 670 | |
| 640 | - all_price += parseFloat(o_price); | |
| 641 | - all_total_m += parseFloat(th.data.cartlist[i].total_amount); | |
| 642 | - all_shipping_m += parseFloat(th.data.cartlist[i].shipping_price); | |
| 643 | - all_order_m += parseFloat(th.data.cartlist[i].order_amount); | |
| 644 | - all_user_m += parseFloat(th.data.cartlist[i].user_money); | |
| 645 | - all_coupon_price_m+= parseFloat(th.data.cartlist[i].coupon_price); | |
| 646 | 671 | |
| 672 | + all_price += parseFloat(o_price); | |
| 673 | + all_total_m += parseFloat(th.data.cartlist[i].total_amount); | |
| 674 | + all_shipping_m += parseFloat(th.data.cartlist[i].shipping_price); | |
| 675 | + all_order_m += parseFloat(th.data.cartlist[i].order_amount); | |
| 676 | + all_user_m += parseFloat(th.data.cartlist[i].user_money); | |
| 677 | + all_coupon_price_m+= parseFloat(th.data.cartlist[i].coupon_price); | |
| 647 | 678 | |
| 648 | 679 | } |
| 649 | 680 | |
| 681 | + all_shipping_m=parseFloat(all_shipping_m).toFixed(2); | |
| 650 | 682 | all_total_m = parseFloat(all_total_m).toFixed(2); |
| 651 | 683 | all_order_m = parseFloat(all_order_m).toFixed(2); |
| 652 | 684 | all_price = parseFloat(all_price).toFixed(2); |
| ... | ... | @@ -758,6 +790,7 @@ Page({ |
| 758 | 790 | //--------------如果使用余额--------------------- |
| 759 | 791 | if (th.data.bn_use_money == 1) { |
| 760 | 792 | if (amoney> order_m) { |
| 793 | + order_m = order_m.toFixed(2); | |
| 761 | 794 | th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) |
| 762 | 795 | }else{ |
| 763 | 796 | order_m =parseFloat(order_m - amoney); |
| ... | ... | @@ -949,6 +982,7 @@ Page({ |
| 949 | 982 | } |
| 950 | 983 | console.log(pdata); |
| 951 | 984 | } |
| 985 | + | |
| 952 | 986 | if (pdata.length==0) return; |
| 953 | 987 | var str = JSON.stringify(pdata); |
| 954 | 988 | wx.showLoading({title: "加载中"}); |
| ... | ... | @@ -983,9 +1017,24 @@ Page({ |
| 983 | 1017 | //要进行判断,如果是用微信支付,就要跳转到支付界面 |
| 984 | 1018 | if (order_amount > 0) { |
| 985 | 1019 | th.setData({ isclose: 0 }); |
| 986 | - void e.jumpToCart4({ | |
| 987 | - order_sn: data.data, | |
| 988 | - }, 1); | |
| 1020 | + //void e.jumpToCart4({ | |
| 1021 | + // order_sn: data.data, | |
| 1022 | + //}, 1); | |
| 1023 | + util_pay.pay(data.data, function() { | |
| 1024 | + //app.my_warnning("支付成功",1,th); | |
| 1025 | + //setTimeout(function () { | |
| 1026 | + wx.navigateTo({ | |
| 1027 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data | |
| 1028 | + }) | |
| 1029 | + //},1000) | |
| 1030 | + | |
| 1031 | + }, function () { | |
| 1032 | + //支付失败 | |
| 1033 | + setTimeout(function () { | |
| 1034 | + wx.navigateBack({ delta: 1 }) | |
| 1035 | + },1000) | |
| 1036 | + },oo.stoid); | |
| 1037 | + | |
| 989 | 1038 | } else { |
| 990 | 1039 | var dd = { |
| 991 | 1040 | parent_sn: data.data, |
| ... | ... | @@ -997,13 +1046,13 @@ Page({ |
| 997 | 1046 | success: function (t) { |
| 998 | 1047 | //console.log(t); |
| 999 | 1048 | if(t.data.code==0){ |
| 1000 | - app.my_warnning("支付成功",1,th); | |
| 1001 | - setTimeout(function () { | |
| 1049 | + //app.my_warnning("支付成功",1,th); | |
| 1050 | + //setTimeout(function () { | |
| 1002 | 1051 | th.setData({ isclose: 0 }); |
| 1003 | 1052 | wx.navigateTo({ |
| 1004 | - url: "/pages/user/order_list/order_list" | |
| 1053 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data, | |
| 1005 | 1054 | }) |
| 1006 | - }, 1000) | |
| 1055 | + //}, 1000) | |
| 1007 | 1056 | } |
| 1008 | 1057 | }, |
| 1009 | 1058 | fail:function () { |
| ... | ... | @@ -1049,17 +1098,22 @@ Page({ |
| 1049 | 1098 | }); |
| 1050 | 1099 | }, |
| 1051 | 1100 | enterAddressPage: function() { |
| 1101 | + getApp().globalData.is_cart_old=1; | |
| 1052 | 1102 | this.data.enterAddressPage = !0, wx.navigateTo({ |
| 1053 | - url: "/pages/user/address_list/address_list?is_back=1" | |
| 1103 | + url: "/pages/user/address_list/address_list" | |
| 1054 | 1104 | }); |
| 1055 | 1105 | }, |
| 1056 | 1106 | |
| 1057 | - //--------立即购买时,选择自提和物流----------- | |
| 1107 | + //--------购物车购买时,选择自提和物流----------- | |
| 1058 | 1108 | setexptype_w:function(t){ |
| 1059 | - var th=this; | |
| 1060 | - var ty = t.currentTarget.dataset.t,txt = t.currentTarget.dataset.txt; | |
| 1109 | + var def_exp_code= getApp().globalData.userInfo.def_exp_code,th=this; | |
| 1110 | + var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, | |
| 1111 | + wl_txt = t.currentTarget.dataset.wl_txt, | |
| 1112 | + ont = t.currentTarget.dataset.ont; | |
| 1113 | + | |
| 1061 | 1114 | th.setData({ [txt]: ty }); |
| 1062 | 1115 | var iszt=1; |
| 1116 | + | |
| 1063 | 1117 | if(ty==0){ |
| 1064 | 1118 | th.setData({ is_all_zt: 0 }); |
| 1065 | 1119 | }else{ |
| ... | ... | @@ -1067,22 +1121,48 @@ Page({ |
| 1067 | 1121 | var item = th.data.cartlist[i]; |
| 1068 | 1122 | if (item.exp_type==0){ iszt=0;break;} |
| 1069 | 1123 | } |
| 1124 | + | |
| 1070 | 1125 | th.setData({ is_all_zt: iszt }); |
| 1071 | 1126 | } |
| 1127 | + //判断有没有默认的物流地址值 | |
| 1128 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code !=undefined) { | |
| 1129 | + var wu_arr=this.data.wu_arr; | |
| 1130 | + if (wu_arr!= null && wu_arr!=""){ | |
| 1131 | + for(var i=0;i<wu_arr.length;i++){ | |
| 1132 | + if (wu_arr[i].shipping_code == def_exp_code){ | |
| 1133 | + var set_txt="cartlist" | |
| 1134 | + th.setData({wl_txt:i}); | |
| 1135 | + } | |
| 1136 | + } | |
| 1137 | + } | |
| 1138 | + } | |
| 1072 | 1139 | //----计算此时购物车的价格---- |
| 1073 | 1140 | th.calculatePrice(); |
| 1074 | 1141 | }, |
| 1142 | + | |
| 1075 | 1143 | //--------立即购买时,选择自提和物流---------- |
| 1076 | 1144 | setexptype:function(t){ |
| 1077 | 1145 | var th=this; |
| 1078 | - var ty = t.currentTarget.dataset.t; | |
| 1146 | + var ty = t.currentTarget.dataset.t,def_exp_code= getApp().globalData.userInfo.def_exp_code; | |
| 1079 | 1147 | th.setData({ bn_exp_type:ty}); |
| 1080 | 1148 | //当物流为空的时候。 |
| 1081 | 1149 | if (ty == 0 && th.data.wu_arr==null){ |
| 1082 | 1150 | return th.get_wuliu(th.calculatePrice2()); |
| 1083 | 1151 | } |
| 1084 | - th.calculatePrice2() | |
| 1085 | - console.log('setexptype'); | |
| 1152 | + | |
| 1153 | + //判断有没有默认的物流地址值 | |
| 1154 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code !=undefined) { | |
| 1155 | + var wu_arr=this.data.wu_arr; | |
| 1156 | + if (wu_arr!= null && wu_arr!=""){ | |
| 1157 | + for(var i=0;i<wu_arr.length;i++){ | |
| 1158 | + if (wu_arr[i].shipping_code == def_exp_code){ | |
| 1159 | + th.setData({index:i}); | |
| 1160 | + } | |
| 1161 | + } | |
| 1162 | + } | |
| 1163 | + } | |
| 1164 | + th.calculatePrice2() | |
| 1165 | + | |
| 1086 | 1166 | }, |
| 1087 | 1167 | |
| 1088 | 1168 | //--------立即购买时,使用余额-------- |
| ... | ... | @@ -1184,6 +1264,7 @@ Page({ |
| 1184 | 1264 | var is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); |
| 1185 | 1265 | if(is_using) quanlist[i].is_using=1; |
| 1186 | 1266 | } |
| 1267 | + console.log("2222222券的列表", quanlist); | |
| 1187 | 1268 | th.setData({open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist,disabled:1}); |
| 1188 | 1269 | } |
| 1189 | 1270 | }, |
| ... | ... | @@ -1209,8 +1290,7 @@ Page({ |
| 1209 | 1290 | |
| 1210 | 1291 | /*--点击选择券--*/ |
| 1211 | 1292 | sele_quan_item:function(e) { |
| 1212 | - var no_use=e.currentTarget.dataset.no, quanlist=this.data.selected_quan_list; | |
| 1213 | - | |
| 1293 | + var no_use=e.currentTarget.dataset.no, quanlist=this.data.selected_quan_list; | |
| 1214 | 1294 | //---所有的券的显示红色选择都清理一遍--- |
| 1215 | 1295 | for(var ind in quanlist){ |
| 1216 | 1296 | quanlist[ind].show_red=0; |
| ... | ... | @@ -1218,29 +1298,31 @@ Page({ |
| 1218 | 1298 | this.setData({selected_quan_list:quanlist}); |
| 1219 | 1299 | var using_quan=this.data.using_quan; |
| 1220 | 1300 | var th=this; |
| 1221 | - | |
| 1222 | 1301 | //---如果是不使用优惠券--- |
| 1223 | 1302 | if(no_use==1){ |
| 1303 | + console.log("有进来吗券", no_use); | |
| 1224 | 1304 | if(using_quan[th.data.selected_quan_pick]){ |
| 1225 | 1305 | using_quan[th.data.selected_quan_pick].is_nouse_red=1; |
| 1226 | 1306 | } |
| 1227 | 1307 | else{ |
| 1228 | 1308 | using_quan[th.data.selected_quan_pick] ={is_nouse_red:1}; |
| 1229 | 1309 | } |
| 1230 | - this.setData({using_quan:using_quan}); | |
| 1310 | + this.setData({ using_quan: using_quan, is_coupon:2222}); | |
| 1231 | 1311 | return; |
| 1232 | 1312 | } |
| 1233 | 1313 | |
| 1234 | 1314 | var ind = e.currentTarget.dataset.ind; |
| 1315 | + | |
| 1235 | 1316 | var quan_item = this.data.selected_quan_list[ind]; |
| 1236 | 1317 | var txt = "selected_quan_list[" + ind + "].show_red"; |
| 1318 | + | |
| 1237 | 1319 | var obj = {}; |
| 1238 | 1320 | obj[txt] = 1; |
| 1239 | 1321 | if (quan_item.show_red) { |
| 1240 | 1322 | obj[txt] = 0; |
| 1241 | 1323 | } |
| 1242 | 1324 | this.setData(obj); |
| 1243 | - | |
| 1325 | + console.log(this.data.selected_quan_list, "选中的券的下标", quan_item, "数据都在这里", txt); | |
| 1244 | 1326 | if(using_quan[th.data.selected_quan_pick]){ |
| 1245 | 1327 | using_quan[th.data.selected_quan_pick].is_nouse_red=0; |
| 1246 | 1328 | } |
| ... | ... | @@ -1253,14 +1335,18 @@ Page({ |
| 1253 | 1335 | |
| 1254 | 1336 | //--确认使用券--- |
| 1255 | 1337 | confirm_quan:function () { |
| 1256 | - console.log(1111); | |
| 1338 | + | |
| 1257 | 1339 | var using_quan=this.data.using_quan,pickid=this.data.selected_quan_pick; |
| 1258 | 1340 | var th=this,selected_quan_list=this.data.selected_quan_list; |
| 1259 | 1341 | //选择了的券 |
| 1260 | 1342 | var sele_quan=null; |
| 1343 | + console.log(selected_quan_list, "确认使用券"); | |
| 1261 | 1344 | for(var i in selected_quan_list){ |
| 1345 | + | |
| 1262 | 1346 | var item=selected_quan_list[i]; |
| 1347 | + console.log(item, "确认使用券",item.show_red); | |
| 1263 | 1348 | if(item.show_red) { |
| 1349 | + console.log(item.show_red, "确定的券7"); | |
| 1264 | 1350 | th.insert_into_using_quan(item,using_quan,pickid); |
| 1265 | 1351 | return; |
| 1266 | 1352 | } |
| ... | ... | @@ -1306,6 +1392,7 @@ Page({ |
| 1306 | 1392 | |
| 1307 | 1393 | //--验证是否已经冻结-- |
| 1308 | 1394 | check_is_frozenQuan:function(quanlist,frozenQuan){ |
| 1395 | + console.log("券列表",quanlist); | |
| 1309 | 1396 | var arr=[]; |
| 1310 | 1397 | for(var i=0;i<quanlist.length;i++){ |
| 1311 | 1398 | var item=quanlist[i]; |
| ... | ... | @@ -1321,6 +1408,112 @@ Page({ |
| 1321 | 1408 | |
| 1322 | 1409 | } |
| 1323 | 1410 | return arr; |
| 1411 | + }, | |
| 1412 | + | |
| 1413 | + //// 开启物流的弹窗 | |
| 1414 | + show_wu_arr:function(e){ | |
| 1415 | + var wu_arr_txt=e.currentTarget.dataset.txt; | |
| 1416 | + var w_sele_index=e.currentTarget.dataset.w_sele_index; | |
| 1417 | + var is_express=null; | |
| 1418 | + var ob={open_express: 1,wu_arr_txt:wu_arr_txt,disabled:1}; | |
| 1419 | + | |
| 1420 | + //--如果是多个门店的时候-- | |
| 1421 | + if(w_sele_index!=undefined){ | |
| 1422 | + is_express=this.data.cartlist[w_sele_index].wind; | |
| 1423 | + ob['is_express']=is_express; | |
| 1424 | + } | |
| 1425 | + this.setData(ob); | |
| 1426 | + }, | |
| 1427 | + // 关闭物流的弹窗 | |
| 1428 | + close_express:function(){ | |
| 1429 | + this.setData({ open_express:0,disabled:0 }); | |
| 1430 | + }, | |
| 1431 | + // 选择物流 | |
| 1432 | + click_express_name:function(e){ | |
| 1433 | + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; | |
| 1434 | + var index=e.currentTarget.dataset.idxe; | |
| 1435 | + var ob={ is_express: index, is_shipping_code: shippingcode,disabled:0}; | |
| 1436 | + ob[this.data.wu_arr_txt]=index; | |
| 1437 | + this.setData(ob); | |
| 1438 | + }, | |
| 1439 | + | |
| 1440 | + //点击确定物流 | |
| 1441 | + determine_expres:function(e){ | |
| 1442 | + this.setData({ open_express: 0}); | |
| 1443 | + if(this.data.is_b_now==1) | |
| 1444 | + this.calculatePrice2(); | |
| 1445 | + else | |
| 1446 | + this.calculatePrice(); | |
| 1447 | + }, | |
| 1448 | + | |
| 1449 | + //点击打开优惠券使用说明 | |
| 1450 | + clik_coupons:function(e){ | |
| 1451 | + var ind = e.currentTarget.dataset.idx; | |
| 1452 | + var is_open = this.data.selected_quan_list[ind].is_open; | |
| 1453 | + | |
| 1454 | + if (is_open == 1) is_open = 0; | |
| 1455 | + else is_open = 1; | |
| 1456 | + | |
| 1457 | + var txt = "selected_quan_list[" + ind + "].is_open" | |
| 1458 | + var obj = {}; obj[txt] = is_open; | |
| 1459 | + | |
| 1460 | + this.setData(obj); | |
| 1461 | + this.setData({disabled:1}) | |
| 1462 | + }, | |
| 1463 | + //选择券 | |
| 1464 | + sele_coupon:function(e){ | |
| 1465 | + var ind = e.currentTarget.dataset.ind; | |
| 1466 | + console.log("下标", ind); | |
| 1467 | + this.setData({ is_coupon: ind}); | |
| 1468 | + }, | |
| 1469 | + | |
| 1470 | + //设置默认物流 | |
| 1471 | + select_default_logistics: function () { | |
| 1472 | + var th=this; | |
| 1473 | + var is_shipping_code=this.data.is_shipping_code | |
| 1474 | + getApp().request.put("/api/weshop/users/update",{ | |
| 1475 | + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, | |
| 1476 | + success:function(rse){ | |
| 1477 | + if (rse.data.code==0){ | |
| 1478 | + getApp().globalData.userInfo.def_exp_code=is_shipping_code; | |
| 1479 | + th.setData({ open_express: 0 }); | |
| 1480 | + //----计算此时购物车的价格---- | |
| 1481 | + if(th.data.is_b_now==1) th.calculatePrice2(); | |
| 1482 | + else th.calculatePrice(); | |
| 1483 | + } | |
| 1484 | + } | |
| 1485 | + }) | |
| 1486 | + }, | |
| 1487 | + | |
| 1488 | + //更新下默认,在onshow里面 | |
| 1489 | + update_code(){ | |
| 1490 | + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | |
| 1491 | + //--定时器,判断wu_arr不未空-- | |
| 1492 | + var uii=setInterval(function () { | |
| 1493 | + if(th.data.wu_arr) | |
| 1494 | + { | |
| 1495 | + clearInterval(uii); | |
| 1496 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | |
| 1497 | + var item = th.data.wu_arr[k]; | |
| 1498 | + if (def_exp_code == item.code) { m_wind = k; } | |
| 1499 | + } | |
| 1500 | + //--如果是立即购买-- | |
| 1501 | + if (th.data.is_b_now == 1) { | |
| 1502 | + th.setData({index: m_wind,is_express:m_wind}); | |
| 1503 | + } else { | |
| 1504 | + var ui = setInterval(function () { | |
| 1505 | + if (th.data.cartlist) { | |
| 1506 | + var c_arr = th.data.cartlist; | |
| 1507 | + for (var i in c_arr) { | |
| 1508 | + c_arr[i].wind = m_wind; | |
| 1509 | + } | |
| 1510 | + th.setData({cartlist: c_arr,is_express:m_wind}) | |
| 1511 | + clearInterval(ui); | |
| 1512 | + } | |
| 1513 | + }, 500) | |
| 1514 | + } | |
| 1515 | + } | |
| 1516 | + },500); | |
| 1324 | 1517 | } |
| 1325 | 1518 | |
| 1326 | 1519 | ... | ... |
pages/cart/cart2/cart2.wxml
| 1 | +<wxs module="filter" src="c_filter.wxs"></wxs> | |
| 2 | +<wxs src="filter.wxs" module="util"></wxs> | |
| 3 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | |
| 1 | 4 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
| 2 | 5 | <form bindsubmit="submitForm"> |
| 3 | - <view class="container"> | |
| 4 | - <!--要进行判断地址是否显示----> | |
| 6 | + <view class="container"> | |
| 7 | + <!--要进行判断地址是否显示----> | |
| 5 | 8 | <view bindtap="enterAddressPage" class="user-mes" |
| 6 | 9 | hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> |
| 7 | 10 | <!---默认地址显示------> |
| 8 | 11 | <block wx:if="{{user_addr!=null}}"> |
| 9 | - <view class="user-contact">{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | |
| 12 | + | |
| 13 | + <view class="user-contact"> | |
| 14 | + <text>收货人:</text>{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | |
| 10 | 15 | <view class="location"> |
| 11 | 16 | <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> |
| 12 | 17 | <view class="pos-icon"> |
| 13 | - <image class="wh100" src="{{imgUrl}}/miniapp/images/iconfont-address.png"></image> | |
| 18 | + <image class="wh100" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> | |
| 14 | 19 | </view> |
| 15 | 20 | </view> |
| 16 | 21 | <view class="update-logistics"> |
| 17 | - <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image> | |
| 22 | + <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> --> | |
| 23 | + <view class="xc-right"></view> | |
| 18 | 24 | </view> |
| 19 | 25 | </block> |
| 20 | 26 | <!---先增地址------> |
| ... | ... | @@ -23,14 +29,16 @@ |
| 23 | 29 | <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址 |
| 24 | 30 | </view> |
| 25 | 31 | </block> |
| 26 | - <view class="border-img"><image class="wh100" src="{{imgUrl}}/miniapp/images/tt.png"></image></view> | |
| 32 | + <view class="border-img"><image class="wh100" src="{{imgUrl}}/miniapp/images/order/new_dividing_line.png"></image></view> | |
| 27 | 33 | </view> |
| 28 | 34 | |
| 29 | 35 | <!---------------------购物车进来,有可能多单----------------------> |
| 30 | 36 | <block wx:if="{{is_b_now==0}}"> |
| 37 | + <view class="xc-border main-top"></view> | |
| 31 | 38 | <view wx:for="{{cartlist}}" wx:for-index="pidx"> |
| 32 | - <view class="use-item bfff"> | |
| 33 | - <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{item.pname}}</view></view> | |
| 39 | + <view class="use-item bfff"> | |
| 40 | + | |
| 41 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>门店:{{item.pname}}</view></view> | |
| 34 | 42 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> |
| 35 | 43 | <!----商品图片-----> |
| 36 | 44 | <view class="goods-img"> |
| ... | ... | @@ -40,70 +48,116 @@ |
| 40 | 48 | <!----商品名称规格----> |
| 41 | 49 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> |
| 42 | 50 | <view class="goods-name">{{items.goods_name}}</view> |
| 43 | - <view class="goods-color"> | |
| 44 | - <text wx:if="{{items.goods_spec!='' && items.goods_spec!=null }}">{{items.goods_spec}}/</text> | |
| 45 | - {{items.goods_color==null?"":items.goods_color}} | |
| 51 | + <!-- 商品属性 --> | |
| 52 | + <view class="flex-vertical fs28 color-gray n_guige"> | |
| 53 | + <view class="goods-color"> | |
| 54 | + <text wx:if="{{items.goods_spec!='' && items.goods_spec!=null }}"> {{items.goods_spec}}</text> | |
| 55 | + {{items.goods_color==null || items.goods_color=='' ?"":"/"+items.goods_color}} | |
| 56 | + </view> | |
| 46 | 57 | </view> |
| 47 | - </navigator> | |
| 48 | - <!-----商品名称规格------> | |
| 49 | - <view class="order-num"> | |
| 50 | - <view class="co-red">¥{{items.goods_price}}</view> | |
| 58 | + | |
| 59 | + | |
| 60 | + <!-----商品名称规格------> | |
| 61 | + <view class="order-num flex-space-between"> | |
| 62 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(items.goods_price,2)}}</text></view> | |
| 51 | 63 | <view class="goods-num">x{{items.goods_num}}</view> |
| 52 | 64 | </view> |
| 65 | + </navigator> | |
| 66 | + | |
| 53 | 67 | </view> |
| 54 | 68 | |
| 55 | 69 | <!-----使用优惠券------> |
| 56 | 70 | <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" |
| 57 | 71 | wx:if="{{item.quan_list && item.quan_list.length>0 }}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> |
| 58 | 72 | <view class="work-frame flex-space-between"> |
| 59 | - <view class="work">使用优惠券</view> | |
| 73 | + <view class="work">优惠券</view> | |
| 60 | 74 | <view class="xc-right-frame"> |
| 61 | 75 | <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text> |
| 62 | - <text wx:if="{{using_quan[item.pickup_id].money}}">{{using_quan[item.pickup_id].money}}元优惠券</text> | |
| 76 | + <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text> | |
| 63 | 77 | <view class="xc-right"></view> |
| 64 | 78 | </view> |
| 65 | 79 | </view> |
| 66 | 80 | </view> |
| 67 | 81 | |
| 82 | + | |
| 68 | 83 | <view class="set-mes"> |
| 69 | - <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | |
| 84 | + <view wx:if="{{order.store_prom}}"> | |
| 85 | + <icon color="#f23030" size="16" type="info"></icon> | |
| 86 | + {{order.store_prom}} | |
| 70 | 87 | </view> |
| 71 | - <view class="use-item"> | |
| 72 | - <view data-t='1' style="display:{{item.distr_t==2?'none':'flex'}};"> | |
| 73 | - <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> | |
| 88 | + <view class="use-item flex-space-between"> | |
| 89 | + <view class="flex-vertical"> | |
| 90 | + <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type'style="display:{{item.distr_t==2?'none':'flex;align-items: center'}};"> | |
| 91 | + <!-- <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> --> | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + <block wx:if="{{item.exp_type==1}}"> | |
| 96 | + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> | |
| 97 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
| 98 | + </block> | |
| 99 | + <block wx:else> | |
| 100 | + <view class="circle xc-hookts on"></view> | |
| 101 | + </block> | |
| 74 | 102 | <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view> |
| 75 | 103 | </view> |
| 76 | 104 | |
| 77 | - <view data-t='0' style="display:{{item.distr_t==1?'none':'flex'}};"> | |
| 78 | - <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' class="wuliu" color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> | |
| 79 | - <view bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">快递邮寄</view> | |
| 105 | + <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};"> | |
| 106 | + <!-- <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> --> | |
| 107 | + <block wx:if="{{item.exp_type==0}}"> | |
| 108 | + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> | |
| 109 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
| 110 | + </block> | |
| 111 | + <block wx:else> | |
| 112 | + <view class="circle xc-hookts on"></view> | |
| 113 | + </block> | |
| 114 | + | |
| 115 | + <view bindtap='setexptype_w' data-t='0' | |
| 116 | + data-txt='cartlist[{{pidx}}].exp_type' | |
| 117 | + data-wl_txt='cartlist[{{pidx}}].wind' | |
| 118 | + class="yu_er">快递邮寄</view> | |
| 119 | + </view> | |
| 80 | 120 | </view> |
| 121 | + <block wx:if="{{item.exp_type==0}}"> | |
| 122 | + <!-- 点击显示物流选择 --> | |
| 123 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}"> | |
| 124 | + <view >{{wu_arr[item.wind].name}}</view><view class="xc-right"></view> | |
| 125 | + </view> | |
| 126 | + </block> | |
| 81 | 127 | </view> |
| 82 | - <view class="use-item" hidden='{{item.exp_type==1}}'> | |
| 83 | - <view>选择物流:</view> | |
| 84 | - <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind' value="{{item.wind}}" range="{{wu_arr}}" range-key="name"> | |
| 128 | + | |
| 129 | + <!-- <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'> | |
| 130 | + <view>选择物流:</view> --> | |
| 131 | + <!-- <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind' value="{{item.wind}}" range="{{wu_arr}}" range-key="name"> | |
| 85 | 132 | <view >{{wu_arr[item.wind].name}}</view> |
| 86 | - </picker> | |
| 87 | - </view> | |
| 133 | + </picker> --> | |
| 134 | + <!-- </view> --> | |
| 88 | 135 | </view> |
| 89 | - <view class="coupon-mes"> | |
| 90 | - <view>用户备注(50字)</view> | |
| 136 | + | |
| 137 | + <!-- 留言 --> | |
| 138 | + <view class="coupon-mes flex-vertical"> | |
| 139 | + <view>留言</view> | |
| 91 | 140 | <view class="leave-word"> |
| 92 | - <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note_{{item.pickup_id}}"></textarea> | |
| 93 | - <view class="max-word">{{maxWord}}/50</view> | |
| 141 | + <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" | |
| 142 | + disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}"></input> | |
| 143 | + | |
| 94 | 144 | </view> |
| 95 | 145 | </view> |
| 146 | + | |
| 96 | 147 | </view> |
| 148 | + | |
| 97 | 149 | <!-----使用余额------> |
| 98 | 150 | <view class="set-mes" wx:if="{{yuer>0}}"> |
| 99 | - <view class="use-item" bindtap='set_js_useyuer'> | |
| 100 | - <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon> | |
| 101 | - <view class="yu_er">使用余额 :¥{{yuer}} </view> | |
| 102 | - </view> | |
| 151 | + <view class="use-item" bindtap='set_js_useyuer'> | |
| 152 | + <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon> | |
| 153 | + <view class="yu_er">使用余额 :¥{{yuer}} </view> | |
| 154 | + </view> | |
| 103 | 155 | </view> |
| 156 | + | |
| 104 | 157 | </block> |
| 105 | 158 | |
| 106 | 159 | <!------立即购买--------> |
| 160 | + <view class="xc-border xc-border"></view> | |
| 107 | 161 | <block wx:if="{{is_b_now==1}}"> |
| 108 | 162 | <view class="use-item bfff"> |
| 109 | 163 | <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view> |
| ... | ... | @@ -113,14 +167,18 @@ |
| 113 | 167 | </view> |
| 114 | 168 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> |
| 115 | 169 | <view class="goods-name">{{bn_goods.goods_name}}</view> |
| 116 | - <view class="goods-color"> | |
| 117 | - <text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}} | |
| 118 | - </view> | |
| 119 | - </navigator> | |
| 120 | - <view class="order-num"> | |
| 121 | - <view class="co-red">¥{{bn_goods.shop_price}}</view> | |
| 170 | + | |
| 171 | + <!-- 商品属性 --> | |
| 172 | + <view class="flex-vertical fs28 xc-ash">商品属性: <view class="goods-color"> | |
| 173 | + <text wx:if="{{bn_goods.goods_spec!=''}}"> {{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}}</view></view> | |
| 174 | + | |
| 175 | + <!-----商品名称规格------> | |
| 176 | + <view class="order-num flex-space-between"> | |
| 177 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> | |
| 122 | 178 | <view class="goods-num">x{{bn_goods.buynum}}</view> |
| 123 | 179 | </view> |
| 180 | + </navigator> | |
| 181 | + | |
| 124 | 182 | </view> |
| 125 | 183 | <view class="set-mes"> |
| 126 | 184 | <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} |
| ... | ... | @@ -130,48 +188,32 @@ |
| 130 | 188 | wx:if="{{selected_quan_list && selected_quan_list.length>0}}"> |
| 131 | 189 | <view class="work-frame flex-space-between"> |
| 132 | 190 | <view class="work"> |
| 133 | - 使用优惠券 | |
| 191 | + 优惠券 | |
| 134 | 192 | </view> |
| 135 | 193 | <view class="xc-right-frame"> |
| 136 | 194 | <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> |
| 137 | - <text wx:if="{{using_quan[bn_pick].money}}">{{using_quan[bn_pick].money}}元优惠券</text> | |
| 195 | + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text> | |
| 138 | 196 | <view class="xc-right"></view> |
| 139 | 197 | </view> |
| 140 | 198 | </view> |
| 141 | 199 | </view> |
| 142 | 200 | |
| 143 | - <view class="use-item"> | |
| 144 | - <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex'}};"> | |
| 201 | + <view class="use-item flex-space-between"> | |
| 202 | + <view class="flex"> | |
| 203 | + <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};"> | |
| 145 | 204 | <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> |
| 146 | 205 | <view class="yu_er">自提</view> |
| 147 | 206 | </view> |
| 148 | - <view bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex'}};"> | |
| 207 | + <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};"> | |
| 149 | 208 | <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> |
| 150 | 209 | <view class="yu_er">物流</view> |
| 151 | 210 | </view> |
| 211 | +</view> | |
| 212 | + <block wx:if="{{bn_exp_type==0}}"> | |
| 213 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'><view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view></view> | |
| 214 | + </block> | |
| 152 | 215 | </view> |
| 153 | 216 | |
| 154 | - <view class="use-item" hidden='{{bn_exp_type==1}}'> | |
| 155 | - <view>使用物流:</view> | |
| 156 | - <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name"> | |
| 157 | - <view >{{wu_arr[index].name}}</view> | |
| 158 | - </picker> | |
| 159 | - </view> | |
| 160 | - | |
| 161 | - <!-- <view class="use-item"> | |
| 162 | - <view>使用积分 : </view> | |
| 163 | - <input bindblur="keyUpChangePay2" maxlength="20" name="pay_points" placeholder="可用积分为:{{order.userInfo.pay_points}}" type="number"></input> | |
| 164 | - <button class="use-btn" formType="submit">使用</button> | |
| 165 | - </view> | |
| 166 | - <view class="use-item"> | |
| 167 | - <view>使用券码 : </view> | |
| 168 | - <input name="couponCode" placeholder="请输入优惠券券码" type="text"></input> | |
| 169 | - <button class="use-btn" formType="submit">使用</button> | |
| 170 | - </view> | |
| 171 | - <view class="use-item" style="display:{{payWithUserMoney&&payWithPoints?'none':'flex'}}"> | |
| 172 | - <view>支付密码 : </view> | |
| 173 | - <input password maxlength="20" name="paypwd" placeholder="请输入密码" type="text"></input> | |
| 174 | - </view> --> | |
| 175 | 217 | </view> |
| 176 | 218 | |
| 177 | 219 | <!-----使用余额------> |
| ... | ... | @@ -179,14 +221,13 @@ |
| 179 | 221 | <view class="use-item" bindtap='set_bn_useyuer'> |
| 180 | 222 | <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> |
| 181 | 223 | <view class="yu_er">使用余额 :¥{{yuer}} </view> |
| 182 | - <!-- <input bindblur="keyUpChangePay1" maxlength="20" name="user_money" placeholder="可用余额:{{order.userInfo.user_money}}" type="digit"></input> <button class="use-btn" formType="submit">使用</button>--> | |
| 183 | 224 | </view> |
| 184 | 225 | </view> |
| 185 | - <view class="coupon-mes"> | |
| 186 | - <view>用户备注(50字)</view> | |
| 226 | + <view class="coupon-mes flex-vertical"> | |
| 227 | + <view>留言</view> | |
| 187 | 228 | <view class="leave-word"> |
| 188 | - <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note"></textarea> | |
| 189 | - <view class="max-word">{{maxWord}}/50</view> | |
| 229 | + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input> | |
| 230 | + | |
| 190 | 231 | </view> |
| 191 | 232 | </view> |
| 192 | 233 | </block> |
| ... | ... | @@ -238,53 +279,192 @@ |
| 238 | 279 | <view class="top flex"> |
| 239 | 280 | <view class="xc-top-content t-c"> |
| 240 | 281 | <view class="xc-title"> |
| 241 | - 选择优惠券 | |
| 282 | + 优惠券使用 | |
| 242 | 283 | </view> |
| 243 | 284 | </view> |
| 244 | 285 | <view class="xc-close-frame" bindtap='close_coupon' > |
| 245 | 286 | <view class="xc-close">×</view> |
| 246 | 287 | </view> |
| 247 | 288 | </view> |
| 289 | + <!-- <view class=""> --> | |
| 290 | + <view class="may_use_coupon fs28 flex"> | |
| 291 | + 可使用的优惠券 | |
| 292 | + <view class=" is_use_coupon flex-vertical" bindtap="sele_quan_item" data-no="1"> | |
| 293 | + 不使用优惠券 | |
| 294 | + | |
| 295 | + <block wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"> | |
| 296 | + <view class="circle white xc-hooka fs20 red-b sn"><text>Γ</text></view> | |
| 297 | + </block> | |
| 298 | + <block wx:else> | |
| 299 | + <view class="circle xc-hookst ons"></view> | |
| 300 | + </block> | |
| 248 | 301 | |
| 302 | + </view> | |
| 303 | + </view> | |
| 304 | + <!-- </view> --> | |
| 249 | 305 | <view class="xc-frame flex-level"> |
| 250 | 306 | <view class="list-frame"> |
| 251 | - <view class="xc-coupon-effect flex-vertical flex-space-between" bindtap="sele_quan_item" data-no="1"> | |
| 252 | - <view class="xc-goods-coupon "> | |
| 253 | - <view class="xc-coupon-money0">不使用优惠券</view> | |
| 254 | - <view class="flex"></view> | |
| 255 | - </view> | |
| 256 | - <view class="xc-coupon-selection flex-right-vertical" > | |
| 257 | - <icon color='red' size='20' type='success' wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"></icon> | |
| 258 | - <view class="circle xc-not-Selection" wx:if="{{!using_quan[selected_quan_pick].is_nouse_red }}"></view> | |
| 259 | - </view> | |
| 260 | - </view> | |
| 261 | - | |
| 262 | - <!-- 循环那些还没有被其他门店选择的券 --> | |
| 263 | - <view class="xc-coupon-effect flex-vertical flex-space-between" wx:for="{{selected_quan_list}}" wx:if="{{!item.is_using}}" bindtap="sele_quan_item" data-ind="{{index}}"> | |
| 264 | - <view class="xc-goods-coupon "> | |
| 265 | - <view class="xc-coupon-money">{{item.Sum}}元</view> | |
| 266 | - <view class="xc-coupon-money1">订单满{{item.BuySum?item.BuySum:0}}元使用</view> | |
| 267 | - <view class="flex xc-coupon-time">使用期限 | |
| 268 | - <view class="time" wx:if="{{item.BeginDate && item.ValidDate}}" > | |
| 269 | - {{filters.replace_time(item.BeginDate)}}至{{filters.replace_time(item.ValidDate)}} | |
| 270 | - </view> | |
| 271 | - <view wx:else>: 无限制</view> | |
| 272 | - </view> | |
| 273 | - </view> | |
| 274 | - <view class="xc-coupon-selection flex-right-vertical" > | |
| 275 | - <icon color='red' size='20' type='success' wx:if="{{item.show_red}}"></icon> | |
| 276 | - <view class="circle xc-not-Selection" wx:if="{{!item.show_red }}"></view> | |
| 277 | - </view> | |
| 307 | + | |
| 308 | + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}" wx:for-item="item"wx:for-index="q_index"> | |
| 309 | + <view class="xc-coupon-frame flex-center" bindtap="sele_coupon" data-ind="{{q_index}}"> | |
| 310 | + <view class="coupon-frame flex rel"> | |
| 311 | + <!-- 锯齿 --> | |
| 312 | + <view class="circle-frame abs"> | |
| 313 | + <view class='circle circle-sawtooth'></view> | |
| 314 | + <view class='circle circle-sawtooth'></view> | |
| 315 | + <view class='circle circle-sawtooth'></view> | |
| 316 | + <view class='circle circle-sawtooth'></view> | |
| 317 | + <view class='circle circle-sawtooth'></view> | |
| 318 | + <view class='circle circle-sawtooth'></view> | |
| 319 | + <view class='circle circle-sawtooth'></view> | |
| 320 | + <view class='circle circle-sawtooth'></view> | |
| 321 | + <view class='circle circle-sawtooth'></view> | |
| 322 | + <view class='circle circle-sawtooth'></view> | |
| 323 | + <view class='circle circle-sawtooth'></view> | |
| 324 | + <view class='circle circle-sawtooth'></view> | |
| 325 | + <view class='circle circle-sawtooth'></view> | |
| 326 | + <view class='circle circle-sawtooth'></view> | |
| 327 | + <view class='circle circle-sawtooth'></view> | |
| 328 | + <view class='circle circle-sawtooth'></view> | |
| 329 | + <view class='circle circle-sawtooth'></view> | |
| 330 | + <view class='circle circle-sawtooth'></view> | |
| 331 | + <view class='circle circle-sawtooth'></view> | |
| 332 | + <view class='circle circle-sawtooth'></view> | |
| 333 | + </view> | |
| 334 | + | |
| 335 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | |
| 336 | + | |
| 337 | + | |
| 338 | + <view class="white xc-money-frames"> | |
| 339 | + <view class="f_text"> | |
| 340 | + <text class="xc-rmb-symbol">¥</text> | |
| 341 | + <text class="xc-rmb-val">{{item.Sum}}</text> | |
| 278 | 342 | </view> |
| 279 | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + <view class="coupon-explain t-c" wx:if="{{item.BuySum>0}}"> | |
| 347 | + 满{{item.BuySum}}元可用 | |
| 280 | 348 | </view> |
| 349 | + <view class="coupon-explain t-c" wx:else> | |
| 350 | + 满0元可用 | |
| 351 | + </view> | |
| 352 | + | |
| 353 | + </view> | |
| 354 | + </view> | |
| 355 | + <view class="coupon-right flex-center rel"> | |
| 356 | + <view class="coupon-annotation flex"> | |
| 357 | + | |
| 358 | + <view class="flex top-frame"> | |
| 359 | + | |
| 360 | + <view class="frame"> | |
| 361 | + <!-- <view class="flex"> --> | |
| 362 | + <view class="coupon-wode ib flex ellipsis-2 "> | |
| 363 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(item.UseObjectType)}} | |
| 364 | + </text> | |
| 365 | + <block>{{item.Sum}}元优惠券</block> | |
| 366 | + </view> | |
| 367 | + <view class="coupon-time"> | |
| 368 | + {{filters.replace_time2(item.BeginDate)}}至{{filters.replace_time2(item.BillDate)}}</view> | |
| 369 | + </view> | |
| 370 | + </view> | |
| 371 | + <!-- <view wx:if="{{item.Obtain>0}}" class="code-img" bindtap="show_quan" data-ind="{{index}}" data-now="{{filter.format_time(now)}}"> | |
| 372 | + <image class="coupon-code" src='{{iurl}}/miniapp/images/user_r_code.png'></image> | |
| 373 | + </view> | |
| 374 | + <view wx:else class="code-img"> | |
| 375 | + <image class="coupon-code" src='{{iurl}}/miniapp/images/hui-ewm.png'></image> | |
| 376 | + </view> --> | |
| 377 | + | |
| 378 | + <block wx:if="{{item.show_red}}"> | |
| 379 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | |
| 380 | + </block> | |
| 381 | + <block wx:else> | |
| 382 | + <view class="circle xc-hooks on"></view> | |
| 383 | + </block> | |
| 384 | + </view> | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + <view class="abs flex-vertical-between bottmo-explain" catchtap='clik_coupons' data-idx="{{q_index}}"> | |
| 389 | + <view></view> | |
| 390 | + <view class="font-word flex">优惠券使用说明 | |
| 391 | + <view class="circle circle-size flex t-c"> | |
| 392 | + <view class="xc-jiantou">く</view> | |
| 393 | + </view> | |
| 394 | + </view> | |
| 395 | + </view> | |
| 281 | 396 | </view> |
| 397 | + </view> | |
| 398 | + </view> | |
| 399 | + | |
| 400 | + <view class="xc-buttom " wx:if="{{item.is_open==1}}"> | |
| 401 | + <view style="padding:10rpx"> | |
| 402 | + <text class="five-level-word explain-coupon" wx:if="{{item.Remark}}">{{util.format(item.Remark)}}</text> | |
| 403 | + <text class="five-level-word explain-coupon" wx:else> | |
| 404 | + <block wx:if="{{item.UseObjectName}}">仅{{item.UseObjectName}}使用</block> | |
| 405 | + <block wx:else>全场通用</block> | |
| 406 | + </text> | |
| 407 | + </view> | |
| 408 | + </view> | |
| 409 | + | |
| 410 | +</view> | |
| 282 | 411 | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + </view> | |
| 416 | + </view> | |
| 417 | + <view class="determine-frame"> | |
| 283 | 418 | <view class="xc-confirm flex-center" bindtap="confirm_quan"> |
| 284 | - <view class="flex-vertical t-c">确定</view> | |
| 419 | + 确定 | |
| 420 | + </view> | |
| 421 | + </view> | |
| 422 | + </view > | |
| 423 | +</view> | |
| 424 | + | |
| 425 | +<!----弹起选择物流名的列表----> | |
| 426 | +<view wx:if='{{open_express==1}}' > | |
| 427 | + <view class="cover-layer flex-center " bindtap='close_express'> | |
| 428 | + </view> | |
| 429 | + | |
| 430 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" > | |
| 431 | + <view class="tops flex"> | |
| 432 | + <view class="top-content fs32"> | |
| 433 | + <view>选择物流名字</view> | |
| 434 | + </view> | |
| 435 | + <view class="close-frame" bindtap='close_express' > | |
| 436 | + <view class="xc-close-express">×</view> | |
| 437 | + </view> | |
| 285 | 438 | </view> |
| 439 | + <view class="express_list"> | |
| 440 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | |
| 441 | + <view class="express_list_frame" bindtap="click_express_name" | |
| 442 | + data-shippingcode="{{express_list.shipping_code}}" | |
| 443 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | |
| 444 | + | |
| 445 | + <block wx:if="{{is_express==idx}}"> | |
| 446 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | |
| 447 | + </block> | |
| 448 | + <block wx:else> | |
| 449 | + <view class="circle xc-hooks"></view> | |
| 450 | + </block> | |
| 451 | + <view class="fs30">{{express_list.name}}</view> | |
| 452 | + | |
| 453 | + </view> | |
| 454 | + </view> | |
| 455 | + </view> | |
| 456 | + <view class="flex click-buttem" > | |
| 457 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | |
| 458 | + <view class="flex-vertical t-c">确定</view> | |
| 459 | + </view> | |
| 460 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | |
| 461 | + <view class="flex-vertical t-c">设为默认</view> | |
| 462 | + </view> | |
| 463 | + </view> | |
| 464 | + | |
| 286 | 465 | </view > |
| 287 | 466 | </view> |
| 288 | 467 | |
| 289 | 468 | |
| 469 | + | |
| 290 | 470 | <warn id="warn"></warn> |
| 291 | 471 | \ No newline at end of file | ... | ... |
pages/cart/cart2/cart2.wxss
| ... | ... | @@ -5,25 +5,26 @@ |
| 5 | 5 | color: #444; |
| 6 | 6 | } |
| 7 | 7 | .user-contact { |
| 8 | - padding: 24rpx 80rpx; | |
| 8 | + padding: 24rpx 70rpx; | |
| 9 | + font-weight: 600; | |
| 9 | 10 | } |
| 10 | - | |
| 11 | + | |
| 11 | 12 | .location { |
| 12 | 13 | position: relative; |
| 13 | - padding: 0 80rpx 24rpx; | |
| 14 | + padding: 0 70rpx 24rpx; | |
| 14 | 15 | } |
| 15 | 16 | |
| 16 | 17 | .pos-icon { |
| 17 | 18 | position: absolute; |
| 18 | - left: 30rpx; | |
| 19 | - top: 0; | |
| 19 | + left: 22rpx; | |
| 20 | + top: 9rpx; | |
| 20 | 21 | width: 32rpx; |
| 21 | - height: 32.5rpx; | |
| 22 | + height: 37.5rpx; | |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | .border-img { |
| 25 | 26 | width: 100%; |
| 26 | - height: 16rpx; | |
| 27 | + height: 12rpx; | |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | .update-logistics { |
| ... | ... | @@ -50,23 +51,23 @@ |
| 50 | 51 | |
| 51 | 52 | .order-detail { |
| 52 | 53 | padding: 30rpx 0; |
| 53 | - border-bottom: 1px solid #ddd; | |
| 54 | + border-bottom: 6rpx solid #eee; | |
| 54 | 55 | color: #777; |
| 55 | - min-height: 100rpx; | |
| 56 | + min-height: 190rpx; | |
| 56 | 57 | background-color: #fff; |
| 57 | 58 | |
| 58 | 59 | } |
| 59 | 60 | |
| 60 | 61 | .goods-img { |
| 61 | 62 | float: left; |
| 62 | - width: 100rpx; | |
| 63 | - height: 100rpx; | |
| 63 | + width: 191rpx; | |
| 64 | + height: 191rpx; | |
| 64 | 65 | margin: 0 20rpx; |
| 65 | 66 | } |
| 66 | 67 | |
| 67 | 68 | .order-cont { |
| 68 | 69 | float: left; |
| 69 | - width: 400rpx; | |
| 70 | + width: 438rpx; | |
| 70 | 71 | } |
| 71 | 72 | |
| 72 | 73 | .goods-name { |
| ... | ... | @@ -75,6 +76,8 @@ |
| 75 | 76 | overflow: hidden; |
| 76 | 77 | margin-bottom: 16rpx; |
| 77 | 78 | font-size: 28rpx; |
| 79 | + color: #333; | |
| 80 | + | |
| 78 | 81 | } |
| 79 | 82 | |
| 80 | 83 | .goods-color { |
| ... | ... | @@ -82,29 +85,27 @@ |
| 82 | 85 | } |
| 83 | 86 | |
| 84 | 87 | .order-num { |
| 85 | - float: right; | |
| 88 | + margin-top: 25rpx; | |
| 86 | 89 | font-size: 24rpx; |
| 87 | - margin-top: 10rpx; | |
| 88 | - margin-right: 20rpx; | |
| 89 | - text-align: right; | |
| 90 | 90 | line-height: 42rpx; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | -.set-mes{background-color: #fff; margin-bottom: 20rpx;} | |
| 93 | +.set-mes{background-color: #fff; } | |
| 94 | 94 | .use-item{ |
| 95 | 95 | display: flex; |
| 96 | 96 | align-items: center; |
| 97 | - height: 92rpx; | |
| 97 | + height: 80rpx; | |
| 98 | 98 | border-bottom: 1px solid #ddd; |
| 99 | 99 | font-size: 30rpx; |
| 100 | - padding-left: 20rpx; | |
| 101 | - | |
| 100 | + width:95%; | |
| 101 | +margin:auto; | |
| 102 | + | |
| 102 | 103 | } |
| 103 | 104 | .use-item>view{ |
| 104 | - display: flex;margin-right: 20rpx; | |
| 105 | + display: flex;margin-right: 12rpx; | |
| 105 | 106 | } |
| 106 | 107 | .use-item.bfff{ background-color: #fff;} |
| 107 | -.use-item .dp{width: 56rpx; height: 56rpx;} | |
| 108 | +.use-item .dp{width: 56rpx; height: 56rpx; margin-left: -5rpx} | |
| 108 | 109 | |
| 109 | 110 | .set-item { |
| 110 | 111 | justify-content: space-between; |
| ... | ... | @@ -134,11 +135,14 @@ |
| 134 | 135 | } |
| 135 | 136 | |
| 136 | 137 | .coupon-mes { |
| 137 | - margin-bottom: 20rpx; | |
| 138 | + height:95rpx; | |
| 138 | 139 | padding: 0 20rpx; |
| 139 | 140 | background-color: #fff; |
| 140 | 141 | font-size: 30rpx; |
| 141 | 142 | color: #444; |
| 143 | + width: 100%; | |
| 144 | + | |
| 145 | + | |
| 142 | 146 | } |
| 143 | 147 | |
| 144 | 148 | .coupon-title { |
| ... | ... | @@ -165,15 +169,17 @@ |
| 165 | 169 | |
| 166 | 170 | .leave-word { |
| 167 | 171 | position: relative; |
| 168 | - margin: 20rpx 0; | |
| 172 | + | |
| 169 | 173 | font-size: 24rpx; |
| 174 | + margin-left: 20rpx; | |
| 175 | + | |
| 170 | 176 | } |
| 171 | 177 | |
| 172 | 178 | .word-box { |
| 173 | - border: 1px solid #ddd; | |
| 174 | - width: 690rpx; | |
| 179 | + | |
| 180 | + width: 600rpx; | |
| 175 | 181 | padding: 10rpx; |
| 176 | - height: 120rpx; | |
| 182 | + height: 28rpx; | |
| 177 | 183 | line-height: 40rpx; |
| 178 | 184 | } |
| 179 | 185 | |
| ... | ... | @@ -201,7 +207,9 @@ |
| 201 | 207 | .btn-wrap { |
| 202 | 208 | height: 100rpx; width: 100%; |
| 203 | 209 | background-color: #fff; |
| 204 | - position: fixed; bottom: 0;left: 0 | |
| 210 | + position: fixed; bottom: 0;left: 0; | |
| 211 | + border-top:1rpx solid #dee | |
| 212 | + | |
| 205 | 213 | } |
| 206 | 214 | |
| 207 | 215 | .tips-btn { |
| ... | ... | @@ -269,18 +277,20 @@ |
| 269 | 277 | .add_new{height: 60rpx; line-height: 60rpx;} |
| 270 | 278 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; |
| 271 | 279 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} |
| 272 | -.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | |
| 280 | +.yu_er{margin-left: 10rpx;margin-right: 60rpx;} .wuliu{margin-left: 20rpx;} | |
| 273 | 281 | |
| 274 | 282 | |
| 275 | 283 | /*---- 优惠券列表 -----*/ |
| 276 | 284 | .xc-coupon-frame{ |
| 277 | 285 | width: 100%; |
| 278 | 286 | height: 92rpx; |
| 279 | - border-bottom:1px solid #ddd; | |
| 287 | + | |
| 280 | 288 | } |
| 281 | 289 | .xc-coupon-frame .work-frame{ |
| 282 | - width: 94%; | |
| 290 | + width: 100%; | |
| 283 | 291 | height: 100%; |
| 292 | + border-bottom:3rpx solid #eee; | |
| 293 | + | |
| 284 | 294 | |
| 285 | 295 | } |
| 286 | 296 | .xc-right{ |
| ... | ... | @@ -290,36 +300,41 @@ |
| 290 | 300 | border-right:2rpx solid #000; |
| 291 | 301 | transform:rotate(45deg); |
| 292 | 302 | display:inline-block; |
| 293 | - margin-top:30rpx; | |
| 303 | + | |
| 294 | 304 | } |
| 295 | 305 | |
| 296 | -.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; color: #d81e06;} | |
| 306 | +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; } | |
| 297 | 307 | .xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } |
| 298 | 308 | |
| 299 | 309 | /* 自定义弹出窗口 */ |
| 300 | 310 | .cx-popup{ |
| 301 | 311 | width:100%; |
| 302 | - height: 775rpx; | |
| 312 | + height:920rpx; | |
| 303 | 313 | background: #fff; |
| 304 | 314 | z-index: 35; |
| 305 | - border-top-left-radius: 10rpx; | |
| 306 | - border-top-right-radius: 10rpx; | |
| 315 | + border-top-left-radius: 20rpx; | |
| 316 | + border-top-right-radius: 20rpx; | |
| 307 | 317 | position:fixed; |
| 308 | 318 | bottom:0; |
| 319 | + padding-bottom: 25rpx; | |
| 320 | + | |
| 309 | 321 | } |
| 310 | 322 | |
| 311 | 323 | .cx-popup .top{ |
| 312 | - width:100%; | |
| 324 | + width:95%; | |
| 313 | 325 | height:100rpx; |
| 314 | 326 | border-bottom:3rpx solid #ddd; |
| 315 | - | |
| 327 | + margin: auto; | |
| 328 | + margin-top: 30rpx; | |
| 316 | 329 | |
| 317 | 330 | } |
| 318 | 331 | .xc-top-content{ |
| 319 | - width: 88%; | |
| 332 | + width: 93%; | |
| 320 | 333 | height:85rpx; |
| 321 | - padding-top: 20rpx; | |
| 322 | - font-size: 36rpx; | |
| 334 | + padding-top: 30rpx; | |
| 335 | + font-size: 34rpx; | |
| 336 | + font-weight: 600; | |
| 337 | + | |
| 323 | 338 | } |
| 324 | 339 | |
| 325 | 340 | |
| ... | ... | @@ -331,35 +346,29 @@ |
| 331 | 346 | } |
| 332 | 347 | .xc-frame{ |
| 333 | 348 | width: 100%; |
| 334 | - height: 465rpx; | |
| 335 | - margin-top:20rpx; | |
| 336 | - | |
| 349 | + height:68.9%; | |
| 337 | 350 | } |
| 338 | 351 | |
| 339 | 352 | .xc-frame .list-frame{ |
| 340 | - width: 90%; | |
| 353 | + width: 95%; | |
| 341 | 354 | height: 100%; |
| 342 | 355 | overflow-y:scroll; |
| 343 | 356 | |
| 344 | 357 | } |
| 345 | 358 | .xc-close-frame{ |
| 346 | - margin-top:10rpx; | |
| 347 | - width:1%; | |
| 359 | + margin-top:-10rpx; | |
| 360 | + | |
| 348 | 361 | } |
| 349 | 362 | |
| 350 | 363 | .xc-close{ |
| 351 | - width: 46rpx; | |
| 352 | -height: 46rpx; | |
| 364 | + width: 37rpx; | |
| 365 | +height: 37rpx; | |
| 353 | 366 | border-radius: 50%; |
| 354 | -border: 5rpx solid #a5a5a7; | |
| 367 | +border: 3rpx solid #333; | |
| 355 | 368 | text-align: center; |
| 356 | -line-height: 46rpx; | |
| 357 | -font-size: 34rpx; | |
| 358 | -font-weight: bolder; | |
| 359 | -color: #a5a5a7; | |
| 360 | -margin-top: 5rpx; | |
| 361 | - | |
| 362 | - | |
| 369 | +line-height: 34rpx; | |
| 370 | +font-size: 29rpx; | |
| 371 | +color: #333; | |
| 363 | 372 | |
| 364 | 373 | } |
| 365 | 374 | .xc-money{ |
| ... | ... | @@ -422,16 +431,14 @@ margin-top: 5rpx; |
| 422 | 431 | } |
| 423 | 432 | |
| 424 | 433 | .xc-confirm { |
| 425 | - width: 90%; | |
| 426 | - height: 75rpx; | |
| 434 | + width: 48%; | |
| 435 | + border-radius: 50rpx; | |
| 436 | + height: 50rpx; | |
| 427 | 437 | margin:0 auto; |
| 428 | - background:#c41830; | |
| 438 | + background:#d60021; | |
| 429 | 439 | color:#fff; |
| 430 | - border-radius:10rpx; | |
| 431 | - font-size:30rpx; | |
| 432 | - margin-top: 50rpx; | |
| 433 | - | |
| 434 | - | |
| 440 | + font-size:28rpx; | |
| 441 | + margin-top: 28rpx; | |
| 435 | 442 | } |
| 436 | 443 | |
| 437 | 444 | .up{ animation: up .7s; } |
| ... | ... | @@ -446,3 +453,373 @@ height: 40rpx; |
| 446 | 453 | } |
| 447 | 454 | |
| 448 | 455 | |
| 456 | +.xc-close-express{ | |
| 457 | + width: 40rpx; | |
| 458 | +height: 40rpx; | |
| 459 | +border-radius: 50%; | |
| 460 | +border: 3rpx solid #333; | |
| 461 | +text-align: center; | |
| 462 | +font-size:32rpx; | |
| 463 | +line-height: 38rpx; | |
| 464 | +color: #333; | |
| 465 | +margin-top: 5rpx; | |
| 466 | +} | |
| 467 | +.cx-popup .tops{ | |
| 468 | + width: 100%; | |
| 469 | +height: 145rpx; | |
| 470 | +border-bottom: 3rpx solid #eee; | |
| 471 | + | |
| 472 | +} | |
| 473 | +.top-content { | |
| 474 | + width: 82%; | |
| 475 | +padding-top: 33px; | |
| 476 | +height: 100%; | |
| 477 | +padding-left: 40rpx; | |
| 478 | +} | |
| 479 | +.close-frame{ | |
| 480 | + margin-top: 30rpx; | |
| 481 | + | |
| 482 | +} | |
| 483 | +.cx-popup.radius{ | |
| 484 | + | |
| 485 | +height: 650rpx; | |
| 486 | + | |
| 487 | +} | |
| 488 | +.xc-hook { | |
| 489 | +width: 33rpx; | |
| 490 | +height: 33rpx; | |
| 491 | +transform: rotate(-135deg); | |
| 492 | +line-height: 35rpx; | |
| 493 | +text-align: center; | |
| 494 | +margin-right: 20rpx | |
| 495 | + | |
| 496 | + | |
| 497 | +} | |
| 498 | +.xc-hooks { | |
| 499 | +width: 30rpx; | |
| 500 | +height: 30rpx; | |
| 501 | +border: 1rpx solid #999; | |
| 502 | +margin-right: 20rpx; | |
| 503 | +} | |
| 504 | +.express_list_frame{ | |
| 505 | + display: flex; | |
| 506 | +height: 80rpx; | |
| 507 | +align-items: center; | |
| 508 | +padding-left: 40rpx; | |
| 509 | +border-bottom: 1rpx solid #eee; | |
| 510 | + | |
| 511 | +} | |
| 512 | +.express_list{ | |
| 513 | + width: 100%; | |
| 514 | + height: 65%; | |
| 515 | + overflow-y: scroll; | |
| 516 | + overflow: hidden; | |
| 517 | +} | |
| 518 | +.xc-confirms { | |
| 519 | + width: 40%; | |
| 520 | + border-radius: 50rpx; | |
| 521 | + height: 55rpx; | |
| 522 | + margin:0 auto; | |
| 523 | + font-size:28rpx; | |
| 524 | + background: #fff; | |
| 525 | + color: #333; | |
| 526 | + border: 2rpx solid #333; | |
| 527 | + | |
| 528 | +} | |
| 529 | + | |
| 530 | + | |
| 531 | +/* 优惠券的改版样式 */ | |
| 532 | +.xc-coupon-frame{ | |
| 533 | + width: 710rpx; | |
| 534 | + height:auto; | |
| 535 | + margin: 0 auto; | |
| 536 | + | |
| 537 | +} | |
| 538 | +.xc-coupon-frame .coupon-frame{ | |
| 539 | + width: 99%; | |
| 540 | + height: 200rpx; | |
| 541 | + margin-top:10rpx; | |
| 542 | + border-bottom: 1rpx solid #eee; | |
| 543 | + | |
| 544 | +} | |
| 545 | +.xc-coupon-frame .coupon-frame .coupon-left{ | |
| 546 | + width: 215rpx; | |
| 547 | + height:100%; | |
| 548 | + overflow: hidden; | |
| 549 | +} | |
| 550 | +.xc-money-frames{ | |
| 551 | + width:96%; | |
| 552 | + margin-top: -10px; | |
| 553 | +} | |
| 554 | + | |
| 555 | +.xc-rmb-symbol{ | |
| 556 | + font-size:40rpx; | |
| 557 | + | |
| 558 | +} | |
| 559 | + | |
| 560 | +.xc-rmb-val{ | |
| 561 | + font-size:60rpx; | |
| 562 | + | |
| 563 | +} | |
| 564 | +.coupon-explain{ | |
| 565 | + font-size:25rpx; | |
| 566 | +width:100%; | |
| 567 | + | |
| 568 | + | |
| 569 | +} | |
| 570 | +.xc-valuer{ | |
| 571 | + margin-top:39rpx; | |
| 572 | + margin-left:28rpx; | |
| 573 | + font-size:25rpx; | |
| 574 | +} | |
| 575 | +.coupon-frame .oval{ | |
| 576 | + width:155rpx; | |
| 577 | + height:83rpx; | |
| 578 | + border-radius: 50%; | |
| 579 | + right:-78rpx; | |
| 580 | + top:-37rpx; | |
| 581 | +} | |
| 582 | +.coupon-right{ | |
| 583 | + width:490rpx; | |
| 584 | + height: 99%; | |
| 585 | + border-top: 1rpx solid #eaeaea; | |
| 586 | + /* //border-bottom: 1rpx solid #eaeaea; */ | |
| 587 | + border-right: 1rpx solid #eaeaea; | |
| 588 | + | |
| 589 | +} | |
| 590 | +.coupon-annotation{ | |
| 591 | + width: 95%; | |
| 592 | + height: 100%; | |
| 593 | + | |
| 594 | +} | |
| 595 | +.xc-brand{ | |
| 596 | + width:100rpx; | |
| 597 | + height:35rpx; | |
| 598 | + line-height: 35rpx; | |
| 599 | + font-size:21rpx; | |
| 600 | + border-radius:10rpx; position: relative; top:-1px; | |
| 601 | + margin-right: 8rpx | |
| 602 | +} | |
| 603 | +.top-frame{ | |
| 604 | + width:82%; | |
| 605 | + height: 75rpx; | |
| 606 | + margin-top:10rpx; | |
| 607 | +} | |
| 608 | +.top-frame .coupon-wode{ | |
| 609 | + font-size: 25rpx; | |
| 610 | + margin-left:10rpx; | |
| 611 | + width:340rpx; | |
| 612 | + height:88rpx; | |
| 613 | +} | |
| 614 | +.coupon-code{ | |
| 615 | + width:60rpx; | |
| 616 | + height:60rpx; | |
| 617 | + margin-top:5rpx; | |
| 618 | + | |
| 619 | +} | |
| 620 | +.frame{ | |
| 621 | + width: 100% | |
| 622 | +} | |
| 623 | +.coupon-time{ | |
| 624 | + font-size: 23rpx; | |
| 625 | + line-height:33rpx; | |
| 626 | + color: #333; | |
| 627 | +} | |
| 628 | + | |
| 629 | +.clik-get{ | |
| 630 | + width:125rpx; | |
| 631 | + height:45rpx; | |
| 632 | + border-radius: 25rpx; | |
| 633 | + line-height: 45rpx; | |
| 634 | + font-size:25rpx; | |
| 635 | + bottom:67rpx; | |
| 636 | + right:6px; | |
| 637 | +} | |
| 638 | + | |
| 639 | +.code-img{ | |
| 640 | + margin-left:20rpx; | |
| 641 | +} | |
| 642 | +.bottmo-explain{ | |
| 643 | +top:145rpx; | |
| 644 | +width:94%; | |
| 645 | +border-top:1rpx dashed #eee; | |
| 646 | +padding-top:8rpx; | |
| 647 | +height:38rpx; | |
| 648 | +line-height: 51rpx; | |
| 649 | + | |
| 650 | +} | |
| 651 | +.font-word{ | |
| 652 | + font-size: 22rpx; | |
| 653 | +} | |
| 654 | +.circle-size{ | |
| 655 | + background: #a0a0a0; | |
| 656 | + width: 27rpx; | |
| 657 | + height: 27rpx; | |
| 658 | + margin-top:13rpx; | |
| 659 | +margin-left:8rpx; | |
| 660 | +display: flex; | |
| 661 | + | |
| 662 | +align-items: center; | |
| 663 | +} | |
| 664 | +.xc-jiantou{ | |
| 665 | + /* width: 9rpx; | |
| 666 | + height: 9rpx; */ | |
| 667 | + /* border-top: 2rpx solid #fff; | |
| 668 | + border-right: 2rpx solid #fff; */ | |
| 669 | + transform: rotate(-90deg); | |
| 670 | + color: #fff; | |
| 671 | + font-size: 15rpx; | |
| 672 | + /* display:inline-block; | |
| 673 | + margin-top: 6.5rpx; */ | |
| 674 | + text-align: center; | |
| 675 | +width: 24rpx; | |
| 676 | +} | |
| 677 | +.xc-buttom{ | |
| 678 | + width:99%; | |
| 679 | +min-height:76rpx; | |
| 680 | +height:auto; | |
| 681 | +line-height:40rpx; | |
| 682 | +border-left:1rpx solid #eee; | |
| 683 | +border-right:1rpx solid #eee; | |
| 684 | +border-bottom:1rpx solid #eee; | |
| 685 | +margin-left: 6rpx; | |
| 686 | + | |
| 687 | +} | |
| 688 | + | |
| 689 | +.goods-num{ | |
| 690 | + font-size: 28rpx; | |
| 691 | + color: #333; | |
| 692 | +} | |
| 693 | + | |
| 694 | +.explain-coupon{ | |
| 695 | + font-size:25rpx; | |
| 696 | + padding: 10rpx 10rpx | |
| 697 | +} | |
| 698 | +.circle-frame{ | |
| 699 | + width: 20rpx; | |
| 700 | + height: auto; | |
| 701 | + z-index:1; | |
| 702 | + left:210rpx; | |
| 703 | + | |
| 704 | +} | |
| 705 | +.circle-sawtooth{ | |
| 706 | + width: 11rpx; | |
| 707 | + height: 11rpx; | |
| 708 | + background: #fff; | |
| 709 | +} | |
| 710 | + | |
| 711 | +.red{background-color: #fe7496;} | |
| 712 | +.green{ background-color: #22c7c1;} | |
| 713 | +.blue{background-color:#5e82e3;} | |
| 714 | +.g_gray{background-color: #aaaaaa} | |
| 715 | + | |
| 716 | +.f_text{text-align: center; height:96rpx; } | |
| 717 | +.xc-hook.sn { | |
| 718 | + margin-top:12%; | |
| 719 | +width:45rpx; | |
| 720 | +height:45rpx; | |
| 721 | +font-size:28rpx; | |
| 722 | +line-height:44rpx; | |
| 723 | + | |
| 724 | + | |
| 725 | +} | |
| 726 | +.xc-hooks.on{ | |
| 727 | + margin-top:12%; | |
| 728 | +width:42rpx; | |
| 729 | +height:42rpx; | |
| 730 | +} | |
| 731 | +.may_use_coupon{ | |
| 732 | + width: 95%; | |
| 733 | + height: 68rpx; | |
| 734 | + line-height:78rpx; | |
| 735 | + margin: auto; | |
| 736 | +} | |
| 737 | +.determine-frame{ | |
| 738 | + width: 100%; | |
| 739 | + height: 130rpx; | |
| 740 | + | |
| 741 | +} | |
| 742 | +.xc-determine{ | |
| 743 | + height: 55rpx; | |
| 744 | + width: 40%; | |
| 745 | + border-radius: 50rpx; | |
| 746 | +background: #d60021; | |
| 747 | +color: #fff; | |
| 748 | +font-size: 28rpx; | |
| 749 | +margin: 0 auto; | |
| 750 | + | |
| 751 | +} | |
| 752 | +.click-buttem{ | |
| 753 | +width: 90%; | |
| 754 | +margin: auto; | |
| 755 | +} | |
| 756 | +.logistics-name{ | |
| 757 | + margin-right:20rpx; | |
| 758 | +} | |
| 759 | +.xc-border{ | |
| 760 | + border-top:8rpx solid #eee; | |
| 761 | +width: 100% | |
| 762 | +} | |
| 763 | +.main-top{ | |
| 764 | +margin-top: 20rpx; | |
| 765 | + | |
| 766 | +} | |
| 767 | +.xc-hookts{ | |
| 768 | +border: 1rpx solid #999; | |
| 769 | + | |
| 770 | +} | |
| 771 | +.xc-hookts.on{ | |
| 772 | + width:30rpx; | |
| 773 | +height:30rpx; | |
| 774 | + | |
| 775 | +} | |
| 776 | +.xc-hookt.sn{ | |
| 777 | + width: 32rpx; | |
| 778 | +height: 32rpx; | |
| 779 | +font-size: 28rpx; | |
| 780 | +line-height: 34rpx; | |
| 781 | +} | |
| 782 | +.xc-hookt{ | |
| 783 | + transform: rotate(-135deg); | |
| 784 | +text-align: center; | |
| 785 | + | |
| 786 | +} | |
| 787 | +.main-bottom{ | |
| 788 | + margin-bottom: 20rpx; | |
| 789 | + | |
| 790 | +} | |
| 791 | +.xc-hookst{ | |
| 792 | + border: 1rpx solid #999; | |
| 793 | + | |
| 794 | +} | |
| 795 | +.xc-hookst.ons{ | |
| 796 | + width: 42rpx; | |
| 797 | +height: 42rpx; | |
| 798 | +margin-left: 20rpx; | |
| 799 | + | |
| 800 | +} | |
| 801 | +.is_use_coupon{ | |
| 802 | + width: 65%; | |
| 803 | +justify-content: flex-end; | |
| 804 | +padding-top: 10rpx; | |
| 805 | + | |
| 806 | + | |
| 807 | +} | |
| 808 | +.xc-hooka{ | |
| 809 | + transform: rotate(-135deg); | |
| 810 | +text-align: center; | |
| 811 | + | |
| 812 | +} | |
| 813 | +.xc-hooka.sn{ | |
| 814 | + width: 45rpx; | |
| 815 | +height: 45rpx; | |
| 816 | +font-size: 28rpx; | |
| 817 | +line-height: 44rpx; | |
| 818 | +margin-left: 20rpx; | |
| 819 | + | |
| 820 | +} | |
| 821 | +.color-gray{ | |
| 822 | + color: #808080; | |
| 823 | +} | |
| 824 | + | |
| 825 | +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx } | |
| 449 | 826 | \ No newline at end of file | ... | ... |
pages/cart/cart2/filter.wxs
0 → 100644
pages/cart/cart2_pt/cart2_pt.js
| ... | ... | @@ -2,6 +2,7 @@ var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"), |
| 2 | 2 | s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp(); |
| 3 | 3 | var oo=t.globalData.setting; |
| 4 | 4 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 5 | +var util_pay = require("../../../utils/pay.js"); | |
| 5 | 6 | |
| 6 | 7 | Page({ |
| 7 | 8 | data: { |
| ... | ... | @@ -54,7 +55,8 @@ Page({ |
| 54 | 55 | is_pt_tz:0,//是否开团团长 |
| 55 | 56 | qh:'', //期号 |
| 56 | 57 | pt_listno:'',//期号 |
| 57 | - is_normal:0 | |
| 58 | + is_normal:0, | |
| 59 | + is_express:0,//选择物流的控制器 | |
| 58 | 60 | }, |
| 59 | 61 | onLoad: function(t) { |
| 60 | 62 | console.log("onLoad_pt_cart"); |
| ... | ... | @@ -212,18 +214,21 @@ Page({ |
| 212 | 214 | |
| 213 | 215 | //----------子页返回父页触发---------- |
| 214 | 216 | onShow: function() { |
| 215 | - console.log('onshow'); | |
| 216 | 217 | var th=this; |
| 217 | - console.log(th.data.isclose); | |
| 218 | 218 | if (th.data.isclose==0){ |
| 219 | 219 | wx.switchTab({ |
| 220 | 220 | url: "/pages/index/index/index" |
| 221 | 221 | }) |
| 222 | - | |
| 223 | 222 | }else{ |
| 224 | - this.getuser_addr(function(ie){ | |
| 225 | - th.setData({user_addr: ie }); | |
| 226 | - }) | |
| 223 | + this.getuser_addr(function(ie){ | |
| 224 | + th.setData({user_addr: ie }); | |
| 225 | + }) | |
| 226 | + //--更新默认地址--,看一下是不是跳到地址页面 | |
| 227 | + if(!getApp().globalData.is_cart2_old){ | |
| 228 | + this.update_code(); | |
| 229 | + }else{ | |
| 230 | + getApp().globalData.is_cart2_old=0; | |
| 231 | + } | |
| 227 | 232 | } |
| 228 | 233 | }, |
| 229 | 234 | //---------------检查是否有收货地址------------------- |
| ... | ... | @@ -333,10 +338,8 @@ Page({ |
| 333 | 338 | }); |
| 334 | 339 | }); |
| 335 | 340 | }, |
| 336 | - | |
| 337 | 341 | //--------------------提交订单----------------------- |
| 338 | 342 | submitForm:function(t){ |
| 339 | - | |
| 340 | 343 | if(this.data.is_summit_ing==1) return false; //--提交中退出-- |
| 341 | 344 | this.data.is_summit_ing=1; |
| 342 | 345 | |
| ... | ... | @@ -457,11 +460,25 @@ Page({ |
| 457 | 460 | }) |
| 458 | 461 | //要进行判断,如果是用微信支付,就要跳转到支付界面 |
| 459 | 462 | if (order_amount > 0) { |
| 460 | - th.setData({ isclose: 0 }); | |
| 461 | - void e.jumpToCart4({ | |
| 462 | - order_sn: data.data, | |
| 463 | - type:1, | |
| 464 | - }, 1); | |
| 463 | + th.setData({ isclose: 0 }); | |
| 464 | + //void e.jumpToCart4({ | |
| 465 | + // order_sn: data.data, | |
| 466 | + // type:1, | |
| 467 | + // }, 1); | |
| 468 | + util_pay.pay(data.data, function() { | |
| 469 | + setTimeout(function () { | |
| 470 | + wx.navigateTo({ | |
| 471 | + url: "/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data, | |
| 472 | + }) | |
| 473 | + },1000) | |
| 474 | + }, function () { | |
| 475 | + //支付失败 | |
| 476 | + setTimeout(function () { | |
| 477 | + wx.navigateBack({ delta: 1 }) | |
| 478 | + },1000) | |
| 479 | + | |
| 480 | + },oo.stoid,1); | |
| 481 | + | |
| 465 | 482 | } else { |
| 466 | 483 | var dd = { |
| 467 | 484 | parent_sn: data.data, |
| ... | ... | @@ -478,9 +495,12 @@ Page({ |
| 478 | 495 | th.setData({ isclose: 0 }); |
| 479 | 496 | |
| 480 | 497 | if(th.data.is_normal==1){ |
| 498 | + /*-- | |
| 481 | 499 | wx.navigateTo({ |
| 482 | 500 | url: "/pages/user/order_list/order_list", |
| 483 | - }) | |
| 501 | + })--*/ | |
| 502 | + var url="/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data; | |
| 503 | + getApp().goto(url); | |
| 484 | 504 | }else{ |
| 485 | 505 | wx.navigateTo({ |
| 486 | 506 | url: "/pages/team/team_success/team_success?ordersn=" + data.data, |
| ... | ... | @@ -521,8 +541,9 @@ Page({ |
| 521 | 541 | }); |
| 522 | 542 | }, |
| 523 | 543 | enterAddressPage: function() { |
| 544 | + getApp().globalData.is_cart_old=1; | |
| 524 | 545 | this.data.enterAddressPage = !0, wx.navigateTo({ |
| 525 | - url: "/pages/user/address_list/address_list?operate=select" | |
| 546 | + url: "/pages/user/address_list/address_list" | |
| 526 | 547 | }); |
| 527 | 548 | }, |
| 528 | 549 | |
| ... | ... | @@ -646,6 +667,65 @@ Page({ |
| 646 | 667 | var ob = {}; |
| 647 | 668 | ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; |
| 648 | 669 | this.setData(ob); |
| 649 | - } | |
| 670 | + }, | |
| 671 | + | |
| 672 | + //// 开启物流的弹窗 | |
| 673 | + show_wu_arr:function(e){ | |
| 674 | + this.setData({ open_express: 1}); | |
| 675 | + }, | |
| 676 | + | |
| 677 | + //更新下默认,在onshow里面 | |
| 678 | + update_code(){ | |
| 679 | + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | |
| 680 | + | |
| 681 | + var uii=setInterval(function () { | |
| 682 | + if(th.data.wu_arr){ | |
| 683 | + clearInterval(uii); | |
| 684 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | |
| 685 | + var item = th.data.wu_arr[k]; | |
| 686 | + if (def_exp_code == item.code) { | |
| 687 | + m_wind = k; | |
| 688 | + } | |
| 689 | + } | |
| 690 | + //--如果是立即购买-- | |
| 691 | + th.setData({ index: m_wind, is_express: m_wind}); | |
| 692 | + } | |
| 693 | + },500) | |
| 694 | + }, | |
| 695 | + | |
| 696 | + // 关闭物流的弹窗 | |
| 697 | + close_express:function(){ | |
| 698 | + this.setData({ open_express:0 }); | |
| 699 | + }, | |
| 700 | + // 选择物流 | |
| 701 | + click_express_name:function(e){ | |
| 702 | + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; | |
| 703 | + var index=e.currentTarget.dataset.idxe; | |
| 704 | + var ob={ is_express: index, is_shipping_code: shippingcode,index:index}; | |
| 705 | + this.setData(ob); | |
| 706 | + }, | |
| 707 | + | |
| 708 | + //点击确定物流 | |
| 709 | + determine_expres:function(e){ | |
| 710 | + this.setData({ open_express: 0}); | |
| 711 | + this.calculatePrice2(); | |
| 712 | + }, | |
| 713 | + //设置默认物流 | |
| 714 | + select_default_logistics: function () { | |
| 715 | + var th=this; | |
| 716 | + var is_shipping_code=this.data.is_shipping_code | |
| 717 | + getApp().request.put("/api/weshop/users/update",{ | |
| 718 | + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, | |
| 719 | + success:function(rse){ | |
| 720 | + if (rse.data.code==0){ | |
| 721 | + getApp().globalData.userInfo.def_exp_code=is_shipping_code; | |
| 722 | + th.setData({ open_express: 0 }); | |
| 723 | + //----计算此时购物车的价格---- | |
| 724 | + if(th.data.is_b_now==1) th.calculatePrice2(); | |
| 725 | + else th.calculatePrice(); | |
| 726 | + } | |
| 727 | + } | |
| 728 | + }) | |
| 729 | + }, | |
| 650 | 730 | |
| 651 | 731 | }); | ... | ... |
pages/cart/cart2_pt/cart2_pt.wxml
| 1 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | |
| 1 | 2 | <form bindsubmit="submitForm"> |
| 2 | 3 | <view class="container"> |
| 3 | 4 | <!--要进行判断地址是否显示----> |
| 4 | 5 | <view bindtap="enterAddressPage" class="user-mes" hidden='{{bn_exp_type==1 || kt_type==3}}'> |
| 5 | 6 | <!---默认地址显示------> |
| 6 | 7 | <block wx:if="{{user_addr!=null}}"> |
| 7 | - <view class="user-contact">{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | |
| 8 | + <view class="user-contact">收货人:{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | |
| 8 | 9 | <view class="location"> |
| 9 | 10 | <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> |
| 10 | 11 | <view class="pos-icon"> |
| 11 | - <image class="wh100" src="{{imgUrl}}/miniapp/images/iconfont-address.png"></image> | |
| 12 | + <image class="wh100" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> | |
| 12 | 13 | </view> |
| 13 | 14 | </view> |
| 14 | 15 | <view class="update-logistics"> |
| ... | ... | @@ -27,8 +28,9 @@ |
| 27 | 28 | |
| 28 | 29 | <!------立即购买--------> |
| 29 | 30 | <block> |
| 31 | + <view class="xc-border main-top"></view> | |
| 30 | 32 | <view class="use-item bfff"> |
| 31 | - <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view> | |
| 33 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>门店:{{bn_pickname}}</view></view> | |
| 32 | 34 | <view class="order-detail"> |
| 33 | 35 | <view class="goods-img"> |
| 34 | 36 | <image class="wh100" src="{{bn_goods.original_img}}" |
| ... | ... | @@ -36,32 +38,60 @@ |
| 36 | 38 | </view> |
| 37 | 39 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> |
| 38 | 40 | <view class="goods-name">{{bn_goods.goods_name}}</view> |
| 39 | - <view class="goods-color"> | |
| 40 | - <text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}} | |
| 41 | - </view> | |
| 41 | + <!-- 商品属性 --> | |
| 42 | + <view class="flex-vertical fs28 color-gray n_guige"> | |
| 43 | + <view class="goods-color"> | |
| 44 | + <text wx:if="{{bn_goods.goods_spec!=''}}"> {{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}} | |
| 45 | + </view></view> | |
| 46 | + | |
| 47 | + | |
| 48 | + <!-----商品名称规格------> | |
| 49 | + <view class="order-num flex-space-between"> | |
| 50 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> | |
| 51 | + <view class="goods-num">x{{bn_goods.buynum}}</view> | |
| 52 | + </view> | |
| 42 | 53 | </navigator> |
| 43 | - <view class="order-num"> | |
| 54 | + <!-- <view class="order-num"> | |
| 44 | 55 | <view class="co-red">¥{{bn_goods.shop_price}}</view> |
| 45 | 56 | <view class="goods-num">x{{bn_goods.buynum}}</view> |
| 46 | - </view> | |
| 57 | + </view> --> | |
| 47 | 58 | </view> |
| 48 | 59 | <view class="set-mes"> |
| 49 | 60 | <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} |
| 50 | 61 | </view> |
| 51 | 62 | |
| 52 | 63 | <!--阶梯团是不显示的--> |
| 53 | - <view class="use-item" wx:if="{{kt_type!=3 || is_normal==1}}"> | |
| 54 | - <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex'}};"> | |
| 55 | - <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> | |
| 64 | + <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}"> | |
| 65 | + <view class="flex-vertical"> | |
| 66 | + <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};"> | |
| 67 | + <!-- <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> --> | |
| 68 | + <block wx:if="{{bn_exp_type==1}}"> | |
| 69 | + | |
| 70 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
| 71 | + </block> | |
| 72 | + <block wx:else> | |
| 73 | + <view class="circle xc-hookts on"></view> | |
| 74 | + </block> | |
| 56 | 75 | <view class="yu_er">自提</view> |
| 57 | 76 | </view> |
| 58 | - <view bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex'}};"> | |
| 59 | - <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> | |
| 77 | + <view class="{{bn_t_exp_t==2?'':'xc-left'}}" bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};"> | |
| 78 | + <!-- <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> --> | |
| 79 | + <block wx:if="{{bn_exp_type==0}}"> | |
| 80 | + | |
| 81 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
| 82 | + </block> | |
| 83 | + <block wx:else> | |
| 84 | + <view class="circle xc-hookts on"></view> | |
| 85 | + </block> | |
| 60 | 86 | <view class="yu_er">物流</view> |
| 61 | 87 | </view> |
| 62 | 88 | </view> |
| 89 | + <block wx:if="{{bn_exp_type==0}}"> | |
| 90 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'><view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view></view> | |
| 91 | + </block> | |
| 92 | + </view> | |
| 63 | 93 | |
| 64 | - <!--阶梯团是不显示的--> | |
| 94 | + <!--阶梯团是不显示的 | |
| 65 | 95 | <block wx:if="{{kt_type!=3 || is_normal==1 }}"> |
| 66 | 96 | <view class="use-item" hidden='{{bn_exp_type==1}}'> |
| 67 | 97 | <view>使用物流:</view> |
| ... | ... | @@ -69,7 +99,7 @@ |
| 69 | 99 | <view >{{wu_arr[index].name}}</view> |
| 70 | 100 | </picker> |
| 71 | 101 | </view> |
| 72 | - </block> | |
| 102 | + </block>--> | |
| 73 | 103 | |
| 74 | 104 | </view> |
| 75 | 105 | |
| ... | ... | @@ -81,11 +111,11 @@ |
| 81 | 111 | |
| 82 | 112 | </view> |
| 83 | 113 | </view> |
| 84 | - <view class="coupon-mes"> | |
| 85 | - <view>用户备注(50字)</view> | |
| 114 | + <view class="coupon-mes flex-vertical"> | |
| 115 | + <view>留言</view> | |
| 86 | 116 | <view class="leave-word"> |
| 87 | - <textarea bindinput="keyUpChangeNum" class="word-box" maxlength="50" name="user_note"></textarea> | |
| 88 | - <view class="max-word">{{maxWord}}/50</view> | |
| 117 | + <textarea placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></textarea> | |
| 118 | + | |
| 89 | 119 | </view> |
| 90 | 120 | </view> |
| 91 | 121 | </block> |
| ... | ... | @@ -122,5 +152,49 @@ |
| 122 | 152 | </view> |
| 123 | 153 | </form> |
| 124 | 154 | |
| 155 | +<!----弹起选择物流名的列表----> | |
| 156 | +<view wx:if='{{open_express==1}}' > | |
| 157 | + <view class="cover-layer flex-center " bindtap='close_express'> | |
| 158 | + </view> | |
| 159 | + | |
| 160 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" > | |
| 161 | + <view class="tops flex"> | |
| 162 | + <view class="top-content fs32"> | |
| 163 | + <view> | |
| 164 | + 选择物流名字 | |
| 165 | + </view> | |
| 166 | + </view> | |
| 167 | + <view class="close-frame" bindtap='close_express' > | |
| 168 | + <view class="xc-close-express">×</view> | |
| 169 | + </view> | |
| 170 | + </view> | |
| 171 | + <view class="express_list"> | |
| 172 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | |
| 173 | + <view class="express_list_frame" bindtap="click_express_name" | |
| 174 | + data-shippingcode="{{express_list.shipping_code}}" | |
| 175 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | |
| 176 | + | |
| 177 | + <block wx:if="{{is_express==idx}}"> | |
| 178 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | |
| 179 | + </block> | |
| 180 | + <block wx:else> | |
| 181 | + <view class="circle xc-hooks"></view> | |
| 182 | + </block> | |
| 183 | + <view class="fs30">{{express_list.name}}</view> | |
| 184 | + | |
| 185 | + </view> | |
| 186 | + </view> | |
| 187 | + </view> | |
| 188 | + <view class="flex click-buttem" > | |
| 189 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | |
| 190 | + <view class="flex-vertical t-c">确定</view> | |
| 191 | + </view> | |
| 192 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | |
| 193 | + <view class="flex-vertical t-c">设为默认</view> | |
| 194 | + </view> | |
| 195 | + </view> | |
| 196 | + | |
| 197 | + </view > | |
| 198 | +</view> | |
| 125 | 199 | |
| 126 | 200 | <warn id="warn"></warn> | ... | ... |
pages/cart/cart2_pt/cart2_pt.wxss
| ... | ... | @@ -5,20 +5,22 @@ |
| 5 | 5 | color: #444; |
| 6 | 6 | } |
| 7 | 7 | .user-contact { |
| 8 | - padding: 24rpx 80rpx; | |
| 8 | + padding: 24rpx 70rpx; | |
| 9 | + font-weight: 600; | |
| 10 | + | |
| 9 | 11 | } |
| 10 | 12 | |
| 11 | 13 | .location { |
| 12 | 14 | position: relative; |
| 13 | - padding: 0 80rpx 24rpx; | |
| 15 | + padding: 0 70rpx 24rpx; | |
| 14 | 16 | } |
| 15 | 17 | |
| 16 | 18 | .pos-icon { |
| 17 | 19 | position: absolute; |
| 18 | - left: 30rpx; | |
| 19 | - top: 0; | |
| 20 | + left: 22rpx; | |
| 21 | + top: 20rpx; | |
| 20 | 22 | width: 32rpx; |
| 21 | - height: 32.5rpx; | |
| 23 | + height: 40rpx; | |
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | .border-img { |
| ... | ... | @@ -50,17 +52,17 @@ |
| 50 | 52 | |
| 51 | 53 | .order-detail { |
| 52 | 54 | padding: 30rpx 0; |
| 53 | - border-bottom: 1px solid #ddd; | |
| 55 | + border-bottom: 7rpx solid #eee; | |
| 54 | 56 | color: #777; |
| 55 | - min-height: 100rpx; | |
| 57 | + min-height: 190rpx; | |
| 56 | 58 | background-color: #fff; |
| 57 | 59 | |
| 58 | 60 | } |
| 59 | 61 | |
| 60 | 62 | .goods-img { |
| 61 | 63 | float: left; |
| 62 | - width: 100rpx; | |
| 63 | - height: 100rpx; | |
| 64 | + width: 190rpx; | |
| 65 | + height: 190rpx; | |
| 64 | 66 | margin: 0 20rpx; |
| 65 | 67 | } |
| 66 | 68 | |
| ... | ... | @@ -75,6 +77,8 @@ |
| 75 | 77 | overflow: hidden; |
| 76 | 78 | margin-bottom: 16rpx; |
| 77 | 79 | font-size: 28rpx; |
| 80 | + color: #333; | |
| 81 | + | |
| 78 | 82 | } |
| 79 | 83 | |
| 80 | 84 | .goods-color { |
| ... | ... | @@ -90,21 +94,21 @@ |
| 90 | 94 | line-height: 42rpx; |
| 91 | 95 | } |
| 92 | 96 | |
| 93 | -.set-mes{background-color: #fff; margin-bottom: 20rpx;} | |
| 97 | +.set-mes{background-color: #fff; } | |
| 94 | 98 | .use-item{ |
| 95 | 99 | display: flex; |
| 96 | 100 | align-items: center; |
| 97 | 101 | height: 92rpx; |
| 98 | 102 | border-bottom: 1px solid #ddd; |
| 99 | 103 | font-size: 30rpx; |
| 100 | - padding-left: 20rpx; | |
| 101 | - | |
| 104 | + width: 95%; | |
| 105 | + margin: auto; | |
| 102 | 106 | } |
| 103 | 107 | .use-item>view{ |
| 104 | - display: flex;margin-right: 20rpx; | |
| 108 | + display: flex;margin-right: 10rpx; | |
| 105 | 109 | } |
| 106 | 110 | .use-item.bfff{ background-color: #fff;} |
| 107 | -.use-item .dp{width: 56rpx; height: 56rpx;} | |
| 111 | +.use-item .dp{width: 56rpx; height: 56rpx; margin-left: -5rpx} | |
| 108 | 112 | |
| 109 | 113 | .set-item { |
| 110 | 114 | justify-content: space-between; |
| ... | ... | @@ -134,11 +138,15 @@ |
| 134 | 138 | } |
| 135 | 139 | |
| 136 | 140 | .coupon-mes { |
| 137 | - margin-bottom: 20rpx; | |
| 141 | + height:95rpx; | |
| 138 | 142 | padding: 0 20rpx; |
| 139 | 143 | background-color: #fff; |
| 140 | 144 | font-size: 30rpx; |
| 141 | 145 | color: #444; |
| 146 | + width: 100%; | |
| 147 | + border-bottom: 6rpx solid #eee; | |
| 148 | + margin-bottom: 20rpx; | |
| 149 | + | |
| 142 | 150 | } |
| 143 | 151 | |
| 144 | 152 | .coupon-title { |
| ... | ... | @@ -165,15 +173,16 @@ |
| 165 | 173 | |
| 166 | 174 | .leave-word { |
| 167 | 175 | position: relative; |
| 168 | - margin: 20rpx 0; | |
| 169 | 176 | font-size: 24rpx; |
| 177 | + margin-left: 20rpx; | |
| 178 | + | |
| 170 | 179 | } |
| 171 | 180 | |
| 172 | 181 | .word-box { |
| 173 | - border: 1px solid #ddd; | |
| 174 | - width: 690rpx; | |
| 182 | + | |
| 183 | + width: 600rpx; | |
| 175 | 184 | padding: 10rpx; |
| 176 | - height: 120rpx; | |
| 185 | + height: 28rpx; | |
| 177 | 186 | line-height: 40rpx; |
| 178 | 187 | } |
| 179 | 188 | |
| ... | ... | @@ -269,5 +278,291 @@ |
| 269 | 278 | .add_new{height: 60rpx; line-height: 60rpx;} |
| 270 | 279 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; |
| 271 | 280 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} |
| 272 | -.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | |
| 281 | +.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | |
| 282 | + | |
| 283 | + | |
| 284 | +/* 自定义弹出窗口 */ | |
| 285 | +.cx-popup{ | |
| 286 | + width:100%; | |
| 287 | + height:920rpx; | |
| 288 | + background: #fff; | |
| 289 | + z-index: 35; | |
| 290 | + border-top-left-radius: 20rpx; | |
| 291 | + border-top-right-radius: 20rpx; | |
| 292 | + position:fixed; | |
| 293 | + bottom:0; | |
| 294 | + padding-bottom: 25rpx; | |
| 295 | + | |
| 296 | +} | |
| 297 | + | |
| 298 | +.cx-popup .top{ | |
| 299 | + width:95%; | |
| 300 | + height:100rpx; | |
| 301 | + border-bottom:3rpx solid #ddd; | |
| 302 | + margin: auto; | |
| 303 | + margin-top: 30rpx; | |
| 304 | + | |
| 305 | +} | |
| 306 | +.xc-top-content{ | |
| 307 | + width: 93%; | |
| 308 | + height:85rpx; | |
| 309 | + padding-top: 30rpx; | |
| 310 | + font-size: 34rpx; | |
| 311 | + font-weight: 600; | |
| 312 | + | |
| 313 | +} | |
| 314 | + | |
| 315 | + | |
| 316 | +.xc-valid-coupon{ | |
| 317 | + width: 90%; | |
| 318 | + height:40rpx; | |
| 319 | + padding-top: 24rpx; | |
| 320 | + overflow: hidden; | |
| 321 | +} | |
| 322 | +.xc-frame{ | |
| 323 | + width: 100%; | |
| 324 | + height:68.9%; | |
| 325 | +} | |
| 326 | + | |
| 327 | +.xc-frame .list-frame{ | |
| 328 | + width: 95%; | |
| 329 | + height: 100%; | |
| 330 | + overflow-y:scroll; | |
| 331 | + | |
| 332 | +} | |
| 333 | +.xc-close-frame{ | |
| 334 | + margin-top:-10rpx; | |
| 335 | + | |
| 336 | +} | |
| 337 | + | |
| 338 | +.xc-close{ | |
| 339 | + width: 37rpx; | |
| 340 | + height: 37rpx; | |
| 341 | + border-radius: 50%; | |
| 342 | + border: 3rpx solid #333; | |
| 343 | + text-align: center; | |
| 344 | + line-height: 34rpx; | |
| 345 | + font-size: 29rpx; | |
| 346 | + color: #333; | |
| 347 | + | |
| 348 | +} | |
| 349 | +.xc-money{ | |
| 350 | + color: #af2346; | |
| 351 | + font-size: 35rpx; | |
| 352 | +} | |
| 353 | + | |
| 354 | +.xc-money-frame{ | |
| 355 | + margin-left:35rpx; | |
| 356 | + | |
| 357 | +} | |
| 358 | +.xc-coupon-effect{ | |
| 359 | + width: 99%; | |
| 360 | + min-height: 100rpx; | |
| 361 | + border-bottom:3rpx solid #ddd; | |
| 362 | + | |
| 363 | + | |
| 364 | +} | |
| 365 | +.xc-goods-coupon{ | |
| 366 | + width: 85%; | |
| 367 | + height:100%; | |
| 368 | + | |
| 369 | +} | |
| 370 | +.xc-title{ | |
| 371 | + width:50%; | |
| 372 | + margin-left:222rpx; | |
| 373 | + | |
| 374 | +} | |
| 375 | +.xc-coupon-money0{ | |
| 376 | + color: #c91e31; | |
| 377 | + font-size: 35rpx; | |
| 378 | + line-height: 40rpx; | |
| 379 | + | |
| 380 | +} | |
| 381 | +.xc-coupon-money{ | |
| 382 | + color: #c91e31; | |
| 383 | + font-size: 35rpx; | |
| 384 | + line-height: 40rpx; | |
| 385 | + padding-top: 10px; | |
| 386 | + | |
| 387 | +} | |
| 388 | +.xc-coupon-money1{ | |
| 389 | + color: #444; | |
| 390 | + font-size: 28rpx; | |
| 391 | + line-height: 60rpx; | |
| 392 | + | |
| 393 | + | |
| 394 | +} | |
| 395 | +.xc-coupon-time{ | |
| 396 | + height: 50rpx; | |
| 397 | + font-size: 27rpx; | |
| 398 | + color: #a4a4a4; | |
| 399 | +} | |
| 400 | +.xc-coupon-time .time{ | |
| 401 | + margin-left: 15rpx; | |
| 402 | + font-size: 27rpx; | |
| 403 | +} | |
| 404 | +.xc-coupon-selection{ | |
| 405 | + height:100%; | |
| 406 | +} | |
| 407 | + | |
| 408 | +.xc-confirm { | |
| 409 | + width: 48%; | |
| 410 | + border-radius: 50rpx; | |
| 411 | + height: 50rpx; | |
| 412 | + margin:0 auto; | |
| 413 | + background:#d60021; | |
| 414 | + color:#fff; | |
| 415 | + font-size:28rpx; | |
| 416 | + margin-top: 28rpx; | |
| 417 | +} | |
| 418 | + | |
| 419 | +.up{ animation: up .7s; } | |
| 420 | +.down{ animation: down 1s; } | |
| 421 | +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } | |
| 422 | +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } | |
| 423 | + | |
| 424 | +.xc-not-Selection{ | |
| 425 | + width: 40rpx; | |
| 426 | + height: 40rpx; | |
| 427 | + background: #eeeeee; | |
| 428 | +} | |
| 429 | + | |
| 430 | + | |
| 431 | +.xc-close-express{ | |
| 432 | + width: 40rpx; | |
| 433 | + height: 40rpx; | |
| 434 | + border-radius: 50%; | |
| 435 | + border: 3rpx solid #333; | |
| 436 | + text-align: center; | |
| 437 | + font-size:32rpx; | |
| 438 | + line-height: 38rpx; | |
| 439 | + color: #333; | |
| 440 | + margin-top: 5rpx; | |
| 441 | +} | |
| 442 | +.cx-popup .tops{ | |
| 443 | + width: 100%; | |
| 444 | + height: 145rpx; | |
| 445 | + border-bottom: 3rpx solid #eee; | |
| 446 | + | |
| 447 | +} | |
| 448 | +.top-content { | |
| 449 | + width: 82%; | |
| 450 | + padding-top: 33px; | |
| 451 | + height: 100%; | |
| 452 | + padding-left: 40rpx; | |
| 453 | +} | |
| 454 | +.close-frame{ | |
| 455 | + margin-top: 30rpx; | |
| 456 | + | |
| 457 | +} | |
| 458 | +.cx-popup.radius{ | |
| 459 | + | |
| 460 | + height: 650rpx; | |
| 461 | + | |
| 462 | +} | |
| 463 | +.xc-hook { | |
| 464 | + width: 33rpx; | |
| 465 | + height: 33rpx; | |
| 466 | + transform: rotate(-135deg); | |
| 467 | + line-height: 35rpx; | |
| 468 | + text-align: center; | |
| 469 | + margin-right: 20rpx | |
| 470 | + | |
| 471 | + | |
| 472 | +} | |
| 473 | +.xc-hooks { | |
| 474 | + width: 30rpx; | |
| 475 | + height: 30rpx; | |
| 476 | + border: 1rpx solid #999; | |
| 477 | + margin-right: 20rpx; | |
| 478 | +} | |
| 479 | +.express_list_frame{ | |
| 480 | + display: flex; | |
| 481 | + height: 80rpx; | |
| 482 | + align-items: center; | |
| 483 | + padding-left: 40rpx; | |
| 484 | + border-bottom: 1rpx solid #eee; | |
| 485 | + | |
| 486 | +} | |
| 487 | +.express_list{ | |
| 488 | + width: 100%; | |
| 489 | + height: 65%; | |
| 490 | + overflow-y: scroll; | |
| 491 | + overflow: hidden; | |
| 492 | +} | |
| 493 | +.xc-confirms { | |
| 494 | + width: 40%; | |
| 495 | + border-radius: 50rpx; | |
| 496 | + height: 55rpx; | |
| 497 | + margin:0 auto; | |
| 498 | + font-size:28rpx; | |
| 499 | + background: #fff; | |
| 500 | + color: #333; | |
| 501 | + border: 2rpx solid #333; | |
| 502 | + | |
| 503 | +} | |
| 504 | + | |
| 505 | +.xc-right{ | |
| 506 | + width:20rpx; | |
| 507 | + height:20rpx; | |
| 508 | + border-top:2rpx solid #000; | |
| 509 | + border-right:2rpx solid #000; | |
| 510 | + transform:rotate(45deg); | |
| 511 | + display:inline-block; | |
| 512 | + margin-right: 5rpx; | |
| 513 | + margin-left: 10rpx; | |
| 514 | + | |
| 515 | +} | |
| 516 | + | |
| 517 | + | |
| 518 | +.xc-left{ | |
| 519 | + margin-left: 45rpx; | |
| 520 | +} | |
| 521 | +.xc-border{ | |
| 522 | + border-top:8rpx solid #eee; | |
| 523 | +width: 100% | |
| 524 | +} | |
| 525 | +.main-top{ | |
| 526 | +margin-top: 20rpx; | |
| 527 | + | |
| 528 | +} | |
| 529 | +.order-num { | |
| 530 | + margin-top: 25rpx; | |
| 531 | + font-size: 24rpx; | |
| 532 | + line-height: 42rpx; | |
| 533 | + width: 95%; | |
| 534 | + | |
| 535 | +} | |
| 536 | +.goods-num{ | |
| 537 | + font-size: 28rpx; | |
| 538 | +color: #333; | |
| 539 | + | |
| 540 | +} | |
| 541 | +.click-buttem{ | |
| 542 | +width: 90%; | |
| 543 | +margin: auto; | |
| 544 | +} | |
| 545 | +.xc-determine{ | |
| 546 | + height: 55rpx; | |
| 547 | + width: 40%; | |
| 548 | + border-radius: 50rpx; | |
| 549 | +background: #d60021; | |
| 550 | +color: #fff; | |
| 551 | +font-size: 28rpx; | |
| 552 | +margin: 0 auto; | |
| 553 | + | |
| 554 | +} | |
| 555 | +.xc-hookts{ | |
| 556 | +border: 1rpx solid #999; | |
| 557 | + | |
| 558 | +} | |
| 559 | +.xc-hookts.on{ | |
| 560 | + width:30rpx; | |
| 561 | +height:30rpx; | |
| 562 | + | |
| 563 | +} | |
| 564 | +.color-gray{ | |
| 565 | + color: #808080; | |
| 566 | +} | |
| 273 | 567 | |
| 568 | +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx } | |
| 274 | 569 | \ No newline at end of file | ... | ... |
pages/cart/cart_wk/cart_wk.js
| ... | ... | @@ -541,7 +541,7 @@ Page({ |
| 541 | 541 | //------支付成功页面-------- |
| 542 | 542 | jumpPaymentPage: function(order_sn,order_amount) { |
| 543 | 543 | wx.setStorageSync("order:order_list:update", !0), wx.redirectTo({ |
| 544 | - url: "/pages/payment/payment/payment?order_sn=" + order_sn + "&order_amount=" + order_amount | |
| 544 | + url: "/pages/payment/pay_success/pay_success?order_sn=" + order_sn + "&type=1", | |
| 545 | 545 | }); |
| 546 | 546 | }, |
| 547 | 547 | ... | ... |
pages/goods/categoryList/categoryList.js
| ... | ... | @@ -22,14 +22,31 @@ Page({ |
| 22 | 22 | // 导航字母 |
| 23 | 23 | letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', |
| 24 | 24 | 'U', 'V', 'W', 'X', 'Y', 'Z'], |
| 25 | - | |
| 25 | + //控制新旧分类版本 | |
| 26 | + is_used_share:0, | |
| 27 | + //国家的控制属性 | |
| 28 | + is_country:1, | |
| 29 | + //品牌的控制属性 | |
| 30 | + is_brand:1, | |
| 31 | + //选择分类的控制属性 | |
| 32 | + select_classify_on:223, | |
| 33 | + index:223, | |
| 34 | + classify_name:"国家",//项目类型 | |
| 35 | + brand_list:null,//品牌列表 | |
| 36 | + | |
| 37 | + one_level_classify:[],// 新的版本左边的边分类1级 | |
| 38 | + is_level_three:0,//判断有没有3级 | |
| 39 | + cat_id:0, | |
| 40 | + pl_timer: null,//只有品类的定时器 | |
| 41 | + is_pl_time:0, | |
| 42 | + | |
| 26 | 43 | }, |
| 27 | 44 | onLoad: function(tt) { |
| 28 | 45 | const res = wx.getSystemInfoSync(), |
| 29 | 46 | letters = this.data.letters; |
| 30 | 47 | |
| 31 | 48 | var that = this; |
| 32 | - this.requestFirstCategoris(); | |
| 49 | + | |
| 33 | 50 | this.setData({ |
| 34 | 51 | abc: t.globalData.heigth-88-88-16, |
| 35 | 52 | windowHeight: res.windowHeight, |
| ... | ... | @@ -55,25 +72,69 @@ Page({ |
| 55 | 72 | } |
| 56 | 73 | this.setData({ |
| 57 | 74 | lettersPosition: temp |
| 58 | - }) | |
| 59 | - | |
| 75 | + }); | |
| 76 | + | |
| 77 | + if (this.data.is_used_share==0){ | |
| 78 | + this.get_nation(); | |
| 79 | + } | |
| 60 | 80 | |
| 61 | 81 | }, |
| 62 | 82 | |
| 63 | 83 | onShow:function(){ |
| 64 | 84 | var that=this; |
| 65 | - | |
| 85 | + //this.requestFirstCategoris(); | |
| 86 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | |
| 66 | 87 | getApp().getConfig2(function (e) { |
| 88 | + | |
| 89 | + var data=e; | |
| 90 | + var switch_list_data = data.switch_list; | |
| 91 | + var switch_list = JSON.parse(switch_list_data); | |
| 92 | + var is_newsgoodstype = switch_list.is_newsgoodstype; | |
| 93 | + that.setData({ is_used_share :is_newsgoodstype}); | |
| 67 | 94 | if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); } |
| 68 | 95 | if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); } |
| 69 | 96 | if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); } |
| 70 | 97 | that.setData({ store_config: e,is_do:1 }); |
| 71 | 98 | |
| 99 | + //---有勾品类--- | |
| 100 | + if (that.data.is_show_pl){ | |
| 101 | + that.requestFirstCategoris(); | |
| 102 | + } | |
| 103 | + if (that.data.is_show_gb != 1 && that.data.is_show_pp != 1 && that.data.is_show_pl){ | |
| 104 | + that.data.pl_timer = setInterval(function () { | |
| 105 | + if (that.data.one_level_classify.length>0){ | |
| 106 | + var item=that.data.one_level_classify[0],arr=item.array; | |
| 107 | + //----如果有下级的时候----- | |
| 108 | + if(item.array && item.array.length>0){ | |
| 109 | + var is_lev_thr=0 | |
| 110 | + for(var i=0;i<arr.length;i++){ | |
| 111 | + if (arr[i].arrays.length>0) {is_lev_thr=1;break; } | |
| 112 | + } | |
| 113 | + that.setData({ is_level_three: is_lev_thr }); | |
| 114 | + if (is_lev_thr!=1) { | |
| 115 | + that.setData({ select_classify_on: 0, index: 0, classify_name: item.items.name, goodslist: item.array }); | |
| 116 | + } else { | |
| 117 | + that.setData({ select_classify_on: 0, index: 0, goodslist: arr }); | |
| 118 | + } | |
| 119 | + } | |
| 120 | + else{ | |
| 121 | + that.setData({ select_classify_on: 0, index: 0, goodslist: null,classify_name:item.items.name,is_level_three: 0}); | |
| 122 | + } | |
| 123 | + clearInterval(that.data.pl_timer); | |
| 124 | + } | |
| 125 | + },1000); | |
| 126 | + | |
| 127 | + } else if (that.data.is_show_gb != 1 && that.data.is_show_pp ){ | |
| 128 | + that.setData({ select_classify_on: 220, classify_name: "品牌" }); | |
| 129 | + } | |
| 130 | + | |
| 131 | + | |
| 132 | + var one_level_classify = that.data.one_level_classify; | |
| 133 | + | |
| 72 | 134 | if (that.data.is_show_pl) that.setData({ currentTab: 0 }); |
| 73 | 135 | else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); } |
| 74 | 136 | else if (that.data.is_show_pp) {that.setData({ currentTab: 2 });that.get_brand(); } |
| 75 | 137 | |
| 76 | - | |
| 77 | 138 | //----求传参过来的控制----- |
| 78 | 139 | if (getApp().globalData.cat_type == 1 && that.data.is_show_gb ) { |
| 79 | 140 | that.setData({ currentTab: 1 }); |
| ... | ... | @@ -84,12 +145,9 @@ Page({ |
| 84 | 145 | } else if (that.data.is_show_pl) { |
| 85 | 146 | that.setData({ currentTab: 0 }); |
| 86 | 147 | } |
| 87 | - | |
| 88 | 148 | }) |
| 89 | - | |
| 90 | 149 | }, |
| 91 | 150 | |
| 92 | - | |
| 93 | 151 | //---------------分类请求接口,数据进行拼装------------------ |
| 94 | 152 | requestFirstCategoris: function() { |
| 95 | 153 | var t = this; |
| ... | ... | @@ -98,13 +156,17 @@ Page({ |
| 98 | 156 | success: function(e) { |
| 99 | 157 | var arr=new Array(); |
| 100 | 158 | var dda = e.data.data.pageData; |
| 101 | - console.log(dda.length); | |
| 159 | + if (dda != null && dda !=""&&dda!=undefined){ | |
| 160 | + t.setData({is_pl_time:1}); | |
| 161 | + } | |
| 162 | + | |
| 163 | + if (t.data.is_used_share == 0) {//is_used_share控制新旧版本 | |
| 102 | 164 | for(var i=0;i<dda.length;i++){ |
| 103 | 165 | if (parseInt(dda[i].level)==1){ |
| 104 | 166 | var item = {items: dda[i], array: new Array()} |
| 105 | 167 | arr.push(item); |
| 106 | 168 | } else if (parseInt(dda[i].level) == 2){ |
| 107 | - for (var j = 0; j < arr.length;j++ ){ | |
| 169 | + for (var j = 0; j < arr.length;j++ ){ | |
| 108 | 170 | if (parseInt(dda[i].parent_id) == parseInt(arr[j].items.id)){ |
| 109 | 171 | arr[j].array.push(dda[i]); break; |
| 110 | 172 | } |
| ... | ... | @@ -114,6 +176,50 @@ Page({ |
| 114 | 176 | } |
| 115 | 177 | } |
| 116 | 178 | t.setData({ catelist: arr}); |
| 179 | + }else{ | |
| 180 | + | |
| 181 | + //---------新的版本---------------- | |
| 182 | + for (var i = 0; i < dda.length; i++) { | |
| 183 | + //--要排队的元素--- | |
| 184 | + var need_to_insert=dda[i]; | |
| 185 | + if (parseInt(need_to_insert.level) == 1) { | |
| 186 | + var item = { items: need_to_insert, array: new Array() }//判断数组的长度看看有没有2级菜单 | |
| 187 | + arr.push(item); | |
| 188 | + } else if (parseInt(need_to_insert.level) == 2) { | |
| 189 | + | |
| 190 | + for (var j = 0; j < arr.length; j++) { | |
| 191 | + | |
| 192 | + | |
| 193 | + if (parseInt(need_to_insert.parent_id) == parseInt(arr[j].items.id)) { | |
| 194 | + | |
| 195 | + var ishaf_two = { items: need_to_insert, arrays: new Array() }; | |
| 196 | + arr[j].array.push(ishaf_two); arr.ishaf_two = 0; | |
| 197 | + } | |
| 198 | + } | |
| 199 | + } else if (parseInt(need_to_insert.level) == 3) {//判断有3级的时候在二级里添加一个数组 | |
| 200 | + | |
| 201 | + for (var dd = 0; dd < arr.length; dd++) { | |
| 202 | + for (var pp = 0; pp < arr[dd].array.length; pp++) { | |
| 203 | + //--判断二级-- | |
| 204 | + var two_item = arr[dd].array; | |
| 205 | + | |
| 206 | + if (two_item && two_item.length>0){ | |
| 207 | + | |
| 208 | + if (parseInt(need_to_insert.parent_id) == parseInt(two_item[pp].items.id)) { | |
| 209 | + | |
| 210 | + arr[dd].array[pp].arrays.push(need_to_insert); arr.ishaf_three = 0; break; | |
| 211 | + } | |
| 212 | + } | |
| 213 | + } | |
| 214 | + } | |
| 215 | + } | |
| 216 | + | |
| 217 | + } | |
| 218 | + | |
| 219 | + console.log("现在是1级与2级所有的数据", arr) | |
| 220 | + t.setData({one_level_classify:arr}); | |
| 221 | + | |
| 222 | + } | |
| 117 | 223 | } |
| 118 | 224 | }); |
| 119 | 225 | }, |
| ... | ... | @@ -132,6 +238,7 @@ Page({ |
| 132 | 238 | } |
| 133 | 239 | }); |
| 134 | 240 | }, |
| 241 | + | |
| 135 | 242 | switchFirstCategory: function(t) { |
| 136 | 243 | this.requestCategories(t.currentTarget.dataset.id); |
| 137 | 244 | }, |
| ... | ... | @@ -220,9 +327,10 @@ Page({ |
| 220 | 327 | |
| 221 | 328 | //跳转到分类的商品列表 |
| 222 | 329 | go_cate:function(t){ |
| 223 | - var cid= t.currentTarget.dataset.cid; | |
| 224 | - var pid = t.currentTarget.dataset.pid; | |
| 225 | - var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; | |
| 330 | + var cid= t.currentTarget.dataset.cid; | |
| 331 | + var pid = t.currentTarget.dataset.pid; | |
| 332 | + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid; | |
| 333 | + lurl+="&pid="+pid; | |
| 226 | 334 | wx.navigateTo({ url: lurl}); |
| 227 | 335 | }, |
| 228 | 336 | |
| ... | ... | @@ -239,10 +347,6 @@ Page({ |
| 239 | 347 | var lurl = "/pages/goods/goodsList/goodsList?nation_id=" + cid; |
| 240 | 348 | wx.navigateTo({ url: lurl }); |
| 241 | 349 | }, |
| 242 | - | |
| 243 | - | |
| 244 | - | |
| 245 | - | |
| 246 | 350 | //获取国别 |
| 247 | 351 | get_nation:function(){ |
| 248 | 352 | var s = this; |
| ... | ... | @@ -254,10 +358,10 @@ Page({ |
| 254 | 358 | }, |
| 255 | 359 | success: function (e) { |
| 256 | 360 | var dda = e.data.data.pageData; |
| 361 | + console.log("国家的数据", dda); | |
| 257 | 362 | s.setData({ nationlist:dda}) |
| 258 | 363 | } |
| 259 | 364 | }); |
| 260 | - | |
| 261 | 365 | }, |
| 262 | 366 | |
| 263 | 367 | //获取品牌 |
| ... | ... | @@ -284,10 +388,11 @@ Page({ |
| 284 | 388 | success: function (e) { |
| 285 | 389 | var arr=new Array(); |
| 286 | 390 | var dda = e.data.data.pageData; |
| 391 | + console.log("商品数据",dda); | |
| 392 | + s.setData({brand_list:dda}); | |
| 287 | 393 | for (var i = 0; i < dda.length; i++) { |
| 288 | 394 | |
| 289 | 395 | dda[i].logo = oo.imghost+dda[i].logo; |
| 290 | - | |
| 291 | 396 | if (arr.length>0){ |
| 292 | 397 | var find = 0; |
| 293 | 398 | //寻找字母在arr数组中是否存在,不存在就要添加,存在就在要这个数组添加元素 |
| ... | ... | @@ -321,7 +426,21 @@ Page({ |
| 321 | 426 | var _errImg = e.target.dataset.errorimg; |
| 322 | 427 | var _errObj = {}; |
| 323 | 428 | _errObj[_errImg] = this.data.iurl+"/miniapp/images/default_g_img.gif"; |
| 324 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 429 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 430 | + }, | |
| 431 | + //图片失败,默认图片 | |
| 432 | + bind_bnerr_pp: function (e) { | |
| 433 | + var _errImg = e.target.dataset.errorimg; | |
| 434 | + var _errObj = {}; | |
| 435 | + _errObj[_errImg] = this.data.iurl+"/miniapp/images/no_brand_def.jpg\n"; | |
| 436 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 437 | + }, | |
| 438 | + //商品图片失败,默认图片 | |
| 439 | + goods_bnerr: function (e) { | |
| 440 | + var _errImg = e.target.dataset.err; | |
| 441 | + var _errObj = {}; | |
| 442 | + _errObj[_errImg] = this.data.iurl + "/miniapp/images/no_cate_def.png"; | |
| 443 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 325 | 444 | }, |
| 326 | 445 | |
| 327 | 446 | goseach:function(){ |
| ... | ... | @@ -339,7 +458,75 @@ Page({ |
| 339 | 458 | _errObj[_errImg] = "/public/images/category.png"; |
| 340 | 459 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 341 | 460 | |
| 342 | - } | |
| 461 | + }, | |
| 462 | + // 新的版本分类点击一级分类 | |
| 463 | + click_classify:function(e){ | |
| 464 | + this.data.ishaf_three=0; | |
| 465 | + var indexs=e.currentTarget.dataset.index; | |
| 466 | + var name = e.currentTarget.dataset.name; | |
| 467 | + var cid = e.currentTarget.dataset.cid; | |
| 468 | + var pid = e.currentTarget.dataset.pid; | |
| 469 | + var arr = e.currentTarget.dataset.arr; | |
| 470 | + | |
| 471 | + if (indexs==220){ this.get_brand();} | |
| 472 | + if (arr!="undefined" && arr!=undefined){ | |
| 473 | + if (arr.length==0){ | |
| 474 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, | |
| 475 | + goodslist: null,is_level_three: 0 }); | |
| 476 | + return false; | |
| 477 | + } | |
| 478 | + if (arr.length != 0){ | |
| 479 | + var is_lev_thr=0 | |
| 480 | + for(var i=0;i<arr.length;i++){ | |
| 481 | + if (arr[i].arrays.length>0) {is_lev_thr=1;break; } | |
| 482 | + } | |
| 483 | + this.setData({ is_level_three: is_lev_thr }); | |
| 343 | 484 | |
| 485 | + if (this.data.is_level_three!=1) { | |
| 486 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr }); | |
| 487 | + } else { | |
| 488 | + this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr }); | |
| 489 | + } | |
| 490 | + } | |
| 491 | + } | |
| 492 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid}); | |
| 493 | + | |
| 494 | + }, | |
| 495 | + | |
| 496 | + | |
| 497 | + //图片失败 | |
| 498 | + bind_bnerr_xc: function (e) { | |
| 499 | + var _errImg = e.target.dataset.errorimg; | |
| 500 | + var _errurl = e.target.dataset.url; | |
| 501 | + | |
| 502 | + var _errObj = {}; | |
| 503 | + _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; | |
| 504 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 505 | + }, | |
| 506 | + //选择更多 | |
| 507 | + select_more:function(e){ | |
| 508 | + var cid = e.currentTarget.dataset.cid; | |
| 509 | + var pid = e.currentTarget.dataset.pid; | |
| 510 | + console.log("选择更多"+cid); | |
| 511 | + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; | |
| 512 | + wx.navigateTo({ url: lurl }); | |
| 513 | + | |
| 514 | + }, | |
| 515 | +//扫一扫 | |
| 516 | + getScancode:function(){ | |
| 517 | + var _this = this; | |
| 518 | + // 允许从相机和相册扫码 | |
| 519 | + wx.scanCode({ | |
| 520 | + success: (res) => { | |
| 521 | + var result = res.result; | |
| 522 | + wx.navigateTo({ | |
| 523 | + url: "/pages/goods/search/search?s_key="+result, | |
| 524 | + }); | |
| 525 | + } | |
| 526 | + }) | |
| 527 | + }, | |
| 528 | + onUnload: function () { | |
| 529 | + this.destroyActivityTimer(); | |
| 530 | + }, | |
| 344 | 531 | |
| 345 | 532 | }); |
| 346 | 533 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.wxml
| 1 | - | |
| 2 | -<view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | |
| 1 | +<block wx:if="{{is_used_share==0}}"> | |
| 2 | + <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | |
| 3 | 3 | <view class="swiper-tab" > |
| 4 | 4 | <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" |
| 5 | 5 | data-current="0" bindtap="clickTab">分类</view> |
| ... | ... | @@ -7,10 +7,9 @@ |
| 7 | 7 | data-current="1" bindtap="clickTab">国家</view> |
| 8 | 8 | <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}" |
| 9 | 9 | data-current="2" bindtap="clickTab">品牌</view> |
| 10 | - </view> | |
| 10 | + </view> | |
| 11 | 11 | </view> |
| 12 | - | |
| 13 | -<view class="search-box" bindtap="goseach"> | |
| 12 | + <view class="search-box " bindtap="goseach"> | |
| 14 | 13 | <view class="search-inner"> |
| 15 | 14 | <view class="search-img"> |
| 16 | 15 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> |
| ... | ... | @@ -18,17 +17,15 @@ |
| 18 | 17 | <input bindfocus="goseach" class="search-cont" placeholder="寻找好口碑" type="text"></input> |
| 19 | 18 | </view> |
| 20 | 19 | </view> |
| 21 | - | |
| 22 | -<block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | |
| 20 | + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | |
| 23 | 21 | <swiper current="{{currentTab}}" duration="300" bindanimationfinish="swiperTab" style="height:{{abc}}rpx;"> |
| 24 | 22 | <!--------分类----------> |
| 25 | 23 | <swiper-item > |
| 26 | 24 | <scroll-view scroll-y="true" class="fenlei-list" |
| 27 | 25 | scroll-with-animation="true" lower-threshold="1" bindscrolltolower="scrolltolower" style="height: {{abc}}rpx;" > |
| 28 | - | |
| 29 | 26 | <block wx:for="{{catelist}}" wx:for-item="fitem" > |
| 30 | 27 | <view class='f_item'> |
| 31 | - <view class="pic_view" bindtap="go_cate" data-cid="{{fitem.items.id}}" data-pid="0"><image class='fl_img' src='{{iurl}}{{fitem.items.image}}' binderror="bind_bnerr2" data-errorimg="catelist[{{index}}].items.image"></image> | |
| 28 | + <view class="pic_view" bindtap="go_cate" data-cid="{{fitem.items.id}}" data-pid="0"><image class='fl_img' src='{{iurl}}{{fitem.items.image}}' binderror="bind_bnerr2" data-errorimg="catelist[{{index}}].items.image"></image> | |
| 32 | 29 | <view class='over_view'></view> |
| 33 | 30 | <text class='f_item_over_t'>{{fitem.items.name}}</text></view> |
| 34 | 31 | <view class='fenlei_text_v'> |
| ... | ... | @@ -36,9 +33,7 @@ |
| 36 | 33 | bindtap="go_cate" data-cid="{{item.id}}" data-pid="{{item.parent_id}}">{{item.name}}</view> |
| 37 | 34 | </view> |
| 38 | 35 | </view> |
| 39 | - </block> | |
| 40 | - | |
| 41 | - | |
| 36 | + </block> | |
| 42 | 37 | </scroll-view> |
| 43 | 38 | </swiper-item> |
| 44 | 39 | <!-------国别----------> |
| ... | ... | @@ -51,7 +46,7 @@ |
| 51 | 46 | <view><image class='n_img' src='{{iurl}}{{bitem.logo}}'></image> |
| 52 | 47 | <view class='nation_box'> |
| 53 | 48 | <view class='nt_1'><text class="nt_1_t">{{bitem.name}}</text></view> |
| 54 | - <view class='nt_2'>enname</view> | |
| 49 | + <view class='nt_2'>{{bitem.enname}}</view> | |
| 55 | 50 | </view> |
| 56 | 51 | </view> |
| 57 | 52 | </view> |
| ... | ... | @@ -67,8 +62,9 @@ |
| 67 | 62 | <view class="group-users"> |
| 68 | 63 | <view wx:for="{{group.array}}" bindtap="go_brand" data-bid="{{user.id}}" |
| 69 | 64 | wx:for-item="user" wx:for-index="idx" class="user box box-lr"> |
| 70 | - <image class="user-avatar-img" src="{{user.logo}}" | |
| 71 | - binderror="bind_bnerr" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo"></image> | |
| 65 | + <image class="user-avatar-img" src="{{user.logo}}" | |
| 66 | + data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" | |
| 67 | + binderror="bind_bnerr"></image> | |
| 72 | 68 | </view> |
| 73 | 69 | </view> |
| 74 | 70 | </view> |
| ... | ... | @@ -89,11 +85,181 @@ |
| 89 | 85 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 90 | 86 | </view> |
| 91 | 87 | </block> |
| 92 | - | |
| 93 | -<block wx:elif="{{is_do}}"> | |
| 88 | + <block wx:elif="{{is_do}}"> | |
| 94 | 89 | <view class="no-data" > |
| 95 | 90 | <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> |
| 96 | 91 | <view class="no-data-title">商家暂未设置分类</view> |
| 97 | 92 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> |
| 98 | 93 | </view> |
| 99 | 94 | </block> |
| 95 | +</block> | |
| 96 | +<block wx:else> | |
| 97 | + <block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | |
| 98 | + <!-- 新版分类头部 --> | |
| 99 | + <view class="xc-search-box flex-center white_b"> | |
| 100 | + <view class="share-height t-c" bindtap="getScancode" > | |
| 101 | + <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> | |
| 102 | + <view class="fs24"> | |
| 103 | + 扫一扫 | |
| 104 | + </view> | |
| 105 | + </view> | |
| 106 | + <view class="xc-search-inner "> | |
| 107 | + <view class="search-img left"> | |
| 108 | + <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | |
| 109 | + </view> | |
| 110 | + <input bindfocus="goseach" class="search-cont" placeholder="搜索你想要的生活" type="text"></input> | |
| 111 | + </view> | |
| 112 | + </view> | |
| 113 | + <!-- 分类项目内容 --> | |
| 114 | + <view class="flex project_height"> | |
| 115 | + <!-- 分类项目的类型 --> | |
| 116 | + <view class="project_type"> | |
| 117 | + <view class="project_type-frame"> | |
| 118 | + <view wx:if="{{is_show_gb}}"> | |
| 119 | + <view bindtap="click_classify" class="share_type fs32 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> | |
| 120 | + <text>国</text><text>家</text> | |
| 121 | + | |
| 122 | + </view> | |
| 123 | + </view> | |
| 124 | + <view wx:if="{{is_show_pp}}"> | |
| 125 | + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} share_type fs32 flex-space-between xc-letter-spacing" wx:if="{{is_brand}}"data-index="220"data-name="品牌"> | |
| 126 | + <text>品</text><text>牌</text> | |
| 127 | + </view> | |
| 128 | + </view> | |
| 129 | + <view wx:if="{{is_show_pl}}"> | |
| 130 | + | |
| 131 | + <view wx:for="{{one_level_classify}}" wx:for-item="ittms" > | |
| 132 | + <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs32 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.name}}"> | |
| 133 | + <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}"> | |
| 134 | + <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index"> | |
| 135 | + <view> | |
| 136 | + {{name}} | |
| 137 | + </view> | |
| 138 | + </view> | |
| 139 | + | |
| 140 | + </view> | |
| 141 | + <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}} | |
| 142 | + </view> | |
| 143 | + </view> | |
| 144 | + | |
| 145 | + </view> | |
| 146 | + | |
| 147 | + </view> | |
| 148 | + </view> | |
| 149 | + | |
| 150 | + </view> | |
| 151 | + <!-- 分类项目的内容 --> | |
| 152 | + <view class="classify_content"> | |
| 153 | + <!-- 国家的样式 --> | |
| 154 | + <block wx:if="{{select_classify_on==223&&is_show_gb}}"> | |
| 155 | + <view class="classify_name fs32 flex-space-between"> | |
| 156 | + <view>{{ishaf_three==1?good_list.name:classify_name}}</view> | |
| 157 | + | |
| 158 | + </view> | |
| 159 | + <view class=" classify_content-frame flex-space-between " > | |
| 160 | + <view bindtap="go_nation" class="country_img-frame rel outer_location"wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}" > | |
| 161 | + <image class="country_img" src="{{iurl}}{{bitem.logo}}"></image> | |
| 162 | + <view class='nation_box abs box'> | |
| 163 | + <view class='nt_1 t-c line-height' style="height:50rpx"> | |
| 164 | + <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text> | |
| 165 | + </view> | |
| 166 | + <view class='nt_2 t-c line-height fs24' style="line-height: 50rpx"> | |
| 167 | + <text class="nation_y_name ellipsis-1 nt_1_t height fs24">{{bitem.enname}}</text> | |
| 168 | + </view> | |
| 169 | + </view> | |
| 170 | + <!--<view class='nation_box abs box' style="top:20rpx">--> | |
| 171 | + <!--</view>--> | |
| 172 | + </view> | |
| 173 | + </view> | |
| 174 | + </block> | |
| 175 | + <!-- 品牌 --> | |
| 176 | + <block wx:if="{{select_classify_on==220&&is_show_pp}}"> | |
| 177 | + | |
| 178 | + <view class="classify_name fs32 flex-space-between"> | |
| 179 | + <view>{{classify_name}}</view> | |
| 180 | + | |
| 181 | + </view> | |
| 182 | + | |
| 183 | + <view class="classify_content-frame flex flex-wrap"> | |
| 184 | + | |
| 185 | + <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> | |
| 186 | + <view class="brand_img_frame "wx:for="{{brand_list.array}}"wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > | |
| 187 | + | |
| 188 | + <view class="brand_img t-c"> | |
| 189 | + <image class=" brand_img" src="{{user.logo}}"data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image> | |
| 190 | + <view class="brand_img_name ellipsis-2 fs24">{{user.name}}</view> | |
| 191 | + </view> | |
| 192 | + </view> | |
| 193 | + | |
| 194 | + | |
| 195 | + </block> | |
| 196 | + </view> | |
| 197 | + </block> | |
| 198 | + <!-- 品类--> | |
| 199 | + <block wx:if="{{is_show_pl}}"> | |
| 200 | + <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> | |
| 201 | + <view> | |
| 202 | + <view class="classify_name fs32 flex-space-between"data-pid="0"data-cid="{{cat_id}}" bindtap='select_more'> | |
| 203 | + <view>{{classify_name}}</view> | |
| 204 | + <view class="flex select_more" > | |
| 205 | + <view class="red-co fs24" >更多</view> | |
| 206 | + <view class="bg_right width_height"></view> | |
| 207 | + </view> | |
| 208 | + </view> | |
| 209 | + <!-- 显示2级列表 --> | |
| 210 | + <view class="classify_content-frame flex-wrap"> | |
| 211 | + <block wx:if="{{goodslist && goodslist.length>0}}"> | |
| 212 | + <block wx:for="{{goodslist}}" wx:for-item="goods"wx:for-index="indx"> | |
| 213 | + <view class="type_img_frame t-c ib" data-cid="{{goods.items.id}}" data-pid="{{goods.items.parent_id}}" bindtap="go_cate"> | |
| 214 | + <image class=" type_img" src="{{goods.items.icoimg==null||goods.items.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':goods.items.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image> | |
| 215 | + <view class="brand_img_name fs24 ellipsis-1">{{goods.items.name}}</view> | |
| 216 | + </view> | |
| 217 | + </block> | |
| 218 | + </block> | |
| 219 | + <block wx:else> | |
| 220 | + <view class="no_child_lev fs28">该类别无子级</view> | |
| 221 | + </block> | |
| 222 | + </view> | |
| 223 | + | |
| 224 | + </view> | |
| 225 | + </block> | |
| 226 | + | |
| 227 | + <!-- 商品 含有3级的--> | |
| 228 | + <block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three==1}}"> | |
| 229 | + <block wx:for="{{goodslist}}"wx:for-item="goods"wx:for-index="inds"> | |
| 230 | + <view> | |
| 231 | + | |
| 232 | + <view class="classify_name fs32 flex-space-between"data-pid="{{goods.items.parent_id}}" data-cid="{{goods.items.id}}" bindtap='select_more'> | |
| 233 | + <view>{{goods.items.name}}</view> | |
| 234 | + <view class="flex select_more" > | |
| 235 | + <view class="red-co fs24" >更多</view> | |
| 236 | + <view class="bg_right width_height"></view> | |
| 237 | + </view> | |
| 238 | + </view> | |
| 239 | + | |
| 240 | + <block wx:if="{{goods.arrays.length>0}}"> | |
| 241 | + <view class="classify_content-frame flex-wrap"> | |
| 242 | + <view class="type_img_frame t-c ib" data-cid="{{item.id}}" data-pid="three" wx:for="{{goods.arrays}}" wx:for-index="index" wx:for-item="item" bindtap="go_cate"> | |
| 243 | + <image class=" type_img"src="{{item.icoimg==null||item.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':item.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image> | |
| 244 | + <view class="brand_img_name fs24 ellipsis-1">{{item.name}}</view> | |
| 245 | + </view> | |
| 246 | + </view> | |
| 247 | + <view class="divider_line"></view> | |
| 248 | + </block> | |
| 249 | + | |
| 250 | + </view> | |
| 251 | + </block> | |
| 252 | + </block> | |
| 253 | + </block> | |
| 254 | + </view> | |
| 255 | + </view> | |
| 256 | + </block> | |
| 257 | + <block wx:elif="{{is_do}}"> | |
| 258 | + <view class="no-data" > | |
| 259 | + <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | |
| 260 | + <view class="no-data-title">商家暂未设置分类</view> | |
| 261 | + <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 262 | + </view> | |
| 263 | + </block> | |
| 264 | + | |
| 265 | +</block> | |
| 100 | 266 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.wxss
| ... | ... | @@ -10,6 +10,7 @@ page{height: 100%; background: #fff;} |
| 10 | 10 | flex-flow: row; |
| 11 | 11 | justify-content: center; |
| 12 | 12 | margin-left: 15%; |
| 13 | + | |
| 13 | 14 | } |
| 14 | 15 | .swiper-tab-item{ |
| 15 | 16 | width: 30%; |
| ... | ... | @@ -51,7 +52,7 @@ swiper{ |
| 51 | 52 | border-radius: 29rpx; |
| 52 | 53 | background-color: #fff; |
| 53 | 54 | position: relative; |
| 54 | - top:15rpx; | |
| 55 | + top: 15rpx; | |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | 58 | .search-img { |
| ... | ... | @@ -151,4 +152,238 @@ swiper{ |
| 151 | 152 | .user-name { |
| 152 | 153 | padding-left: 30rpx; |
| 153 | 154 | } |
| 154 | -.fenlei-list{z-index: -1;} | |
| 155 | 155 | \ No newline at end of file |
| 156 | +.fenlei-list{z-index: -1;} | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | +/* 商品分类新的版本 */ | |
| 163 | +/* 分享样式*/ | |
| 164 | +.xc-search-box { | |
| 165 | + width: 100%; | |
| 166 | + height: 120rpx; | |
| 167 | + z-index: 10; | |
| 168 | + background: #fff; | |
| 169 | + border-top: 4rpx solid #eee; | |
| 170 | + border-bottom: 1rpx solid #eee; | |
| 171 | + | |
| 172 | +} | |
| 173 | + | |
| 174 | +.share-height{ | |
| 175 | + line-height: 20rpx; | |
| 176 | +margin-right: 15rpx; | |
| 177 | +margin-top: 8rpx; | |
| 178 | + | |
| 179 | +} | |
| 180 | +.scanning_black-img{ | |
| 181 | + width:50rpx; | |
| 182 | + height: 45rpx; | |
| 183 | + margin-bottom: 5rpx; | |
| 184 | + | |
| 185 | +} | |
| 186 | +.search-img.left{ | |
| 187 | + margin-left: 35rpx; | |
| 188 | +} | |
| 189 | + | |
| 190 | +.xc-search-inner { | |
| 191 | + display: flex; | |
| 192 | + align-items: center; | |
| 193 | + | |
| 194 | + width: 600rpx; | |
| 195 | + height: 58rpx; | |
| 196 | + border-radius: 29rpx; | |
| 197 | + background-color: #f2f2f2; | |
| 198 | +} | |
| 199 | +.project_height{ | |
| 200 | + height: 90%; | |
| 201 | + | |
| 202 | +} | |
| 203 | +.project_type{ | |
| 204 | + width: 33%; | |
| 205 | + height: 100%; | |
| 206 | + border-right: 1rpx solid #eee; | |
| 207 | + white-space: nowrap; | |
| 208 | +overflow: hidden; | |
| 209 | +overflow-y: scroll; | |
| 210 | + | |
| 211 | +} | |
| 212 | +.share_type{ | |
| 213 | + margin: auto; | |
| 214 | + width: 58%; | |
| 215 | + margin-top: 40rpx; | |
| 216 | +overflow: hidden; | |
| 217 | + | |
| 218 | +} | |
| 219 | +.xc-letter-spacing{ | |
| 220 | +padding-left: 29rpx; | |
| 221 | +padding-right: 29rpx; | |
| 222 | +width: 51%; | |
| 223 | +margin: auto; | |
| 224 | +margin-top: 40rpx; | |
| 225 | + | |
| 226 | + | |
| 227 | +} | |
| 228 | +.world_sn{ | |
| 229 | +white-space: nowrap; | |
| 230 | +overflow: hidden; | |
| 231 | +width: 58%; | |
| 232 | +/* letter-spacing: 60rpx; */ | |
| 233 | +margin: auto; | |
| 234 | +margin-top: 35rpx; | |
| 235 | +} | |
| 236 | +.select_classify{ | |
| 237 | + background: #d60021; | |
| 238 | +border-radius: 30rpx; | |
| 239 | +color: #fff; | |
| 240 | +height: 48rpx; | |
| 241 | +line-height: 45rpx; | |
| 242 | + | |
| 243 | +} | |
| 244 | +.select_classify.width80{ | |
| 245 | + width: 74.5%; | |
| 246 | +} | |
| 247 | + .select_classify.width80.text-indent{ | |
| 248 | + text-indent: 38rpx; | |
| 249 | + padding-right: 20px; | |
| 250 | +width: 60%; | |
| 251 | + | |
| 252 | + } | |
| 253 | + .classify_name{ | |
| 254 | + width: 90%; | |
| 255 | + margin: auto; | |
| 256 | + height: 70rpx; | |
| 257 | + border-bottom: 1rpx solid #eee; | |
| 258 | + line-height: 85rpx; | |
| 259 | + font-weight: 600; | |
| 260 | + | |
| 261 | + | |
| 262 | + } | |
| 263 | + .classify_content{ | |
| 264 | + width: 67% | |
| 265 | + | |
| 266 | + } | |
| 267 | + .classify_content-frame{ | |
| 268 | + width: 90%; | |
| 269 | + margin: auto; | |
| 270 | + flex-wrap:wrap; | |
| 271 | + max-height: 90%; | |
| 272 | + overflow-y:scroll; | |
| 273 | + overflow: hidden scroll; | |
| 274 | + padding-bottom: 25rpx; | |
| 275 | + | |
| 276 | + | |
| 277 | + } | |
| 278 | + .country_img-frame{ | |
| 279 | + width: 48%; | |
| 280 | + height: 140rpx; | |
| 281 | + | |
| 282 | + } | |
| 283 | + .country_img{ | |
| 284 | + width: 100%; | |
| 285 | + height: 100%; | |
| 286 | + } | |
| 287 | + .outer_location{ | |
| 288 | + top:0rpx; | |
| 289 | + left: 0rpx; | |
| 290 | + margin-top: 20rpx; | |
| 291 | + | |
| 292 | + } | |
| 293 | + .nation_box.box{ | |
| 294 | + top: 16%; | |
| 295 | +width:80%; | |
| 296 | +height:70%; | |
| 297 | +left: 70.5%; | |
| 298 | +overflow: hidden; | |
| 299 | + | |
| 300 | + } | |
| 301 | + .nt_1.line-height{ | |
| 302 | + line-height: 65rpx; | |
| 303 | + height: 72rpx; | |
| 304 | +margin-top: -5rpx; | |
| 305 | + | |
| 306 | + } | |
| 307 | + .nt_1_t.height{ | |
| 308 | + height: 54rpx; | |
| 309 | + } | |
| 310 | + .nt_1.height{ | |
| 311 | + height: 56rpx; | |
| 312 | +line-height: 65rpx; | |
| 313 | + } | |
| 314 | + .nt_2.line-height{ | |
| 315 | + height: 0rpx; | |
| 316 | + line-height: 0rpx; | |
| 317 | + | |
| 318 | + } | |
| 319 | + .nt_1_t.fs24{ | |
| 320 | + font-size: 24rpx; | |
| 321 | + } | |
| 322 | + .nt_2.fs24{ | |
| 323 | + font-size: 24rpx; | |
| 324 | + } | |
| 325 | + .brand_img_frame{ | |
| 326 | + width: 45%; | |
| 327 | + margin-top: 18rpx; | |
| 328 | + margin-right: 15rpx; | |
| 329 | + height: 160rpx; | |
| 330 | + } | |
| 331 | + .brand_img{ | |
| 332 | + width:200rpx; | |
| 333 | + height:86rpx; | |
| 334 | + margin-bottom: 10rpx; | |
| 335 | + margin-top: 10rpx; | |
| 336 | + | |
| 337 | + } | |
| 338 | + .type_img_frame{ | |
| 339 | + width: 30%; | |
| 340 | + height: 140rpx; | |
| 341 | + margin-top: 18rpx; | |
| 342 | + margin-right: 15rpx; | |
| 343 | + | |
| 344 | + | |
| 345 | + } | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + .type_img{ | |
| 350 | + width:80rpx; | |
| 351 | + height:80rpx; | |
| 352 | + margin-bottom: 10rpx; | |
| 353 | + margin-top: 10rpx; | |
| 354 | + | |
| 355 | + } | |
| 356 | + .brand_img-name{ | |
| 357 | + width: 100%; | |
| 358 | + height: 80rpx; | |
| 359 | + } | |
| 360 | + .select_classify.width80.text3{ | |
| 361 | +padding-right: 20rpx; | |
| 362 | +padding-left: 20rpx; | |
| 363 | +width: 62%; | |
| 364 | + | |
| 365 | + } | |
| 366 | + .width_height{ | |
| 367 | + width: 13rpx; | |
| 368 | + height: 13rpx; | |
| 369 | + margin-top:12rpx; | |
| 370 | + } | |
| 371 | + .select_more{ | |
| 372 | +line-height: 37rpx; | |
| 373 | +height: 35rpx; | |
| 374 | +margin-top: 24rpx; | |
| 375 | + } | |
| 376 | + .divider_line{ | |
| 377 | + width: 100%; | |
| 378 | + border-bottom: 6rpx solid #eee; | |
| 379 | + } | |
| 380 | + .sort-name{ | |
| 381 | + width: 132rpx; | |
| 382 | +overflow: hidden; | |
| 383 | +margin: auto; | |
| 384 | + | |
| 385 | +} | |
| 386 | + | |
| 387 | +.nation_z_name{ max-width: 130rpx} | |
| 388 | +.nation_y_name{ max-width: 130rpx; color: #888} | |
| 389 | + | |
| 390 | +.no_child_lev{width: 100%; text-align: center; color: #adadad; padding-top: 30rpx} | |
| 156 | 391 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -21,10 +21,10 @@ var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 21 | 21 | |
| 22 | 22 | Page({ |
| 23 | 23 | data: { |
| 24 | - start_stop:2,//秒杀开始 结束 的控制(1正在进行,2即将开始) | |
| 25 | - color_type:0,//线条控制 | |
| 26 | - color_type_one:0, | |
| 27 | - color_type_two:1, | |
| 24 | + start_stop: 2, //秒杀开始 结束 的控制(1正在进行,2即将开始) | |
| 25 | + color_type: 0, //线条控制 | |
| 26 | + color_type_one: 0, | |
| 27 | + color_type_two: 1, | |
| 28 | 28 | |
| 29 | 29 | gid: "", |
| 30 | 30 | stoid: o.stoid, |
| ... | ... | @@ -50,7 +50,8 @@ Page({ |
| 50 | 50 | activeCategoryId: 0, |
| 51 | 51 | supportPageScroll: !1, |
| 52 | 52 | address: { |
| 53 | - address: "", district: 0 | |
| 53 | + address: "", | |
| 54 | + district: 0 | |
| 54 | 55 | }, |
| 55 | 56 | shipping: "", |
| 56 | 57 | shippingCost: 0, |
| ... | ... | @@ -75,29 +76,30 @@ Page({ |
| 75 | 76 | }], |
| 76 | 77 | activeCategoryId3: 1, |
| 77 | 78 | categories3: [{ |
| 78 | - name: "全部", | |
| 79 | - id: 1, | |
| 80 | - num: 0 | |
| 81 | - }, | |
| 82 | - { | |
| 79 | + name: "全部", | |
| 80 | + id: 1, | |
| 81 | + num: 0 | |
| 82 | + }, | |
| 83 | + { | |
| 83 | 84 | name: "有图", |
| 84 | 85 | id: 5, |
| 85 | 86 | num: 0 |
| 86 | 87 | }, |
| 87 | 88 | |
| 88 | 89 | { |
| 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 | - }, ], | |
| 90 | + name: "好评", | |
| 91 | + id: 2, | |
| 92 | + num: 0 | |
| 93 | + }, { | |
| 94 | + name: "中评", | |
| 95 | + id: 3, | |
| 96 | + num: 0 | |
| 97 | + }, { | |
| 98 | + name: "差评", | |
| 99 | + id: 4, | |
| 100 | + num: 0 | |
| 101 | + }, | |
| 102 | + ], | |
| 101 | 103 | |
| 102 | 104 | select: { |
| 103 | 105 | price: 0, |
| ... | ... | @@ -119,7 +121,12 @@ Page({ |
| 119 | 121 | is_show_sto_cat: 1, //是否显示门店分类 |
| 120 | 122 | only_pk: null, |
| 121 | 123 | all_sto: null, |
| 122 | - sec_sto: null, | |
| 124 | + sec_sto: null, //选择了的门店分类 | |
| 125 | + pickpu_list: null, //读出的所有门店list | |
| 126 | + def_pickpu_list: null, //一开始5个门店list | |
| 127 | + sec_pick_index: 0, //第二级门店选择ID | |
| 128 | + fir_pick_index: 0, //第一级门店选择ID | |
| 129 | + | |
| 123 | 130 | //同一条形码的所有商品 |
| 124 | 131 | sku_g: null, |
| 125 | 132 | sku_g_pt: null, //---拼单的普通购买--- |
| ... | ... | @@ -142,17 +149,17 @@ Page({ |
| 142 | 149 | prom_start_time: null, |
| 143 | 150 | prom_act: null, |
| 144 | 151 | pd_xx: 0, |
| 145 | - is_normal: 0, //是否普通购买 | |
| 146 | - teamgroup:null, //有多少人开团 | |
| 147 | - grounp_tatal:0, //有几个人开团 | |
| 148 | - timer:[], | |
| 152 | + is_normal: 0, //是否普通购买 | |
| 153 | + teamgroup: null, //有多少人开团 | |
| 154 | + grounp_tatal: 0, //有几个人开团 | |
| 155 | + timer: [], | |
| 149 | 156 | |
| 150 | 157 | //商品的购买次数 |
| 151 | 158 | prom_buy_num: -1, |
| 152 | 159 | g_buy_num: null, |
| 153 | - prom_goods_num:0, //活动商品数量 | |
| 154 | - prom_buy_num:0, //活动商品购买数量 | |
| 155 | - prom_redis_num:0, //活动商品redis数量 | |
| 160 | + prom_goods_num: 0, //活动商品数量 | |
| 161 | + prom_buy_num: 0, //活动商品购买数量 | |
| 162 | + prom_redis_num: 0, //活动商品redis数量 | |
| 156 | 163 | |
| 157 | 164 | //拼单的规则显示 |
| 158 | 165 | is_show_gz: 0, |
| ... | ... | @@ -164,99 +171,168 @@ Page({ |
| 164 | 171 | openSpecModal_ind: 0, |
| 165 | 172 | |
| 166 | 173 | //---计时器开关---- |
| 167 | - is_timer:1, | |
| 168 | - isshow:0, | |
| 169 | - bconfig:null, //基础配置 | |
| 174 | + is_timer: 1, | |
| 175 | + isshow: 0, | |
| 176 | + bconfig: null, //基础配置 | |
| 170 | 177 | |
| 171 | - fir_comments:null, //详情页上的评价 | |
| 172 | - fir_quan:null, //详情页上的券 | |
| 173 | - quan_list:null, //券列表 | |
| 178 | + fir_comments: null, //详情页上的评价 | |
| 179 | + fir_quan: null, //详情页上的券 | |
| 180 | + quan_list: null, //券列表 | |
| 174 | 181 | |
| 175 | - coupon:0, | |
| 182 | + coupon: 0, | |
| 176 | 183 | //会员分享的头像 |
| 177 | - share_head:"", | |
| 178 | - share_goods_img:"", | |
| 184 | + share_head: "", | |
| 185 | + share_goods_img: "", | |
| 179 | 186 | |
| 180 | 187 | //----------视频图片data参数--------- |
| 181 | - current: 0,//图片计数 | |
| 182 | - swiperCurrent:0,//轮播的下标 | |
| 183 | - hiddenn:0,//控制轮播计数显示 | |
| 188 | + current: 0, //图片计数 | |
| 189 | + swiperCurrent: 0, //轮播的下标 | |
| 190 | + hiddenn: 0, //控制轮播计数显示 | |
| 184 | 191 | |
| 185 | - currentTab: 0,// 选择器控制参数 | |
| 192 | + currentTab: 0, // 选择器控制参数 | |
| 186 | 193 | mapurl: "", |
| 187 | - mapurl_f_img:"", | |
| 188 | - videopicture: 0,//视频图片的控制 | |
| 194 | + mapurl_f_img: "", | |
| 195 | + videopicture: 0, //视频图片的控制 | |
| 189 | 196 | |
| 190 | - video: 0,//视频图片切换器 | |
| 197 | + video: 0, //视频图片切换器 | |
| 191 | 198 | index: 0, |
| 192 | - noon: 0,//开始视频的隐藏 | |
| 199 | + noon: 0, //开始视频的隐藏 | |
| 193 | 200 | |
| 194 | - screenWidth:0, | |
| 195 | - canvasHidden:1, | |
| 201 | + screenWidth: 0, | |
| 202 | + canvasHidden: 1, | |
| 196 | 203 | |
| 197 | 204 | //--推荐-- |
| 198 | - recommend_list:[], | |
| 199 | - store_config:null, | |
| 200 | - is_show_pl:0, //是否品类 | |
| 201 | - is_show_pp:0, //是否品牌 | |
| 202 | - is_show_gb:0, //是否国别 | |
| 203 | - is_closecoupon:0, | |
| 205 | + recommend_list: [], | |
| 206 | + store_config: null, | |
| 207 | + is_show_pl: 0, //是否品类 | |
| 208 | + is_show_pp: 0, //是否品牌 | |
| 209 | + is_show_gb: 0, //是否国别 | |
| 210 | + is_closecoupon: 0, | |
| 204 | 211 | |
| 205 | 212 | //是否点赞中 |
| 206 | 213 | iszaning: 0, |
| 214 | + | |
| 215 | + select_store: 0, //选择更多 | |
| 216 | + index: 1, | |
| 217 | + more_store: 0, //选择门店 | |
| 218 | + sort_store: 0, //门店分类 | |
| 219 | + choice_sort_store: 0, //选择分类门店 | |
| 220 | + new_user: 0, //新用户 | |
| 221 | + | |
| 222 | + def_pick_store: null, // 默认的门店 | |
| 223 | + lat: null, //维度 | |
| 224 | + lon: null, //经度 | |
| 225 | + | |
| 226 | + is_get_local_ok: 0, //获取坐标是否完成 | |
| 227 | + region_name: "门店分类", //区域的名字 | |
| 228 | + is_gps: 1, | |
| 229 | + open_ind_store: 0, //哪里打开的门店列表的控制属性 | |
| 230 | + default_store: {}, //创建添加默认门店地址的对象 | |
| 231 | + | |
| 232 | + comments_no_more:0, | |
| 233 | + get_c:0, //获取评价是不是成 | |
| 234 | + is_collect_load:0, //是不是处理 | |
| 207 | 235 | }, |
| 208 | 236 | |
| 209 | 237 | //------初始化加载---------- |
| 210 | 238 | onLoad: function(t) { |
| 211 | - wx.setNavigationBarTitle({ title: "商品详情",}) | |
| 212 | - var ee = this, that=ee,th=ee, | |
| 239 | + wx.setNavigationBarTitle({ | |
| 240 | + title: "商品详情", | |
| 241 | + }) | |
| 242 | + var ee = this, | |
| 243 | + that = ee, | |
| 244 | + th = ee, | |
| 213 | 245 | gid = t.goods_id; |
| 214 | 246 | |
| 215 | - //如果tg_id是空的话,分享回来 | |
| 247 | + //---获取手机地址坐标-- | |
| 248 | + //--如果tg_id是空的话,分享回来-- | |
| 216 | 249 | if (gid == undefined || gid == null || gid == "") { |
| 217 | 250 | gid = decodeURIComponent(t.scene); |
| 218 | 251 | } |
| 219 | - | |
| 220 | 252 | ee.setData({ |
| 221 | 253 | gid: gid |
| 222 | 254 | }); |
| 223 | 255 | |
| 224 | - getApp().getConfig2(function (e) { | |
| 225 | - if (e.categoryset.indexOf("," + 1 + ",") != -1) { ee.setData({ is_show_pl: 1 }); } | |
| 226 | - if (e.categoryset.indexOf("," + 3 + ",") != -1) { ee.setData({ is_show_pp: 1 }); } | |
| 227 | - if (e.categoryset.indexOf("," + 2 + ",") != -1) { ee.setData({ is_show_gb: 1 }); } | |
| 228 | - | |
| 229 | - var json_d = JSON.parse(e.switch_list); | |
| 230 | - ee.setData({ store_config: e, is_closecoupon: json_d.is_closecoupon }); | |
| 231 | - ee.init(gid); | |
| 232 | - //------几人评价------- | |
| 233 | - n.init(th, "", "comments"); | |
| 234 | - th.requestCardNum(), wx.pageScrollTo && th.setData({ | |
| 235 | - supportPageScroll: !0 | |
| 256 | + //----获取系统参数----- | |
| 257 | + getApp().getConfig2(function(e) { | |
| 258 | + ee.setData({ | |
| 259 | + bconfig: e | |
| 260 | + }); | |
| 261 | + | |
| 262 | + if (e.categoryset.indexOf("," + 1 + ",") != -1) { | |
| 263 | + ee.setData({ | |
| 264 | + is_show_pl: 1 | |
| 265 | + }); | |
| 266 | + } | |
| 267 | + if (e.categoryset.indexOf("," + 3 + ",") != -1) { | |
| 268 | + ee.setData({ | |
| 269 | + is_show_pp: 1 | |
| 236 | 270 | }); |
| 271 | + } | |
| 272 | + if (e.categoryset.indexOf("," + 2 + ",") != -1) { | |
| 273 | + ee.setData({ | |
| 274 | + is_show_gb: 1 | |
| 275 | + }); | |
| 276 | + } | |
| 237 | 277 | |
| 238 | - }) | |
| 278 | + var json_d = JSON.parse(e.switch_list); | |
| 279 | + ee.setData({ | |
| 280 | + store_config: e, | |
| 281 | + is_closecoupon: json_d.is_closecoupon | |
| 282 | + }); | |
| 283 | + ee.init(gid); | |
| 284 | + //------几人评价------- | |
| 285 | + //n.init(th, "", "comments"); | |
| 286 | + | |
| 287 | + th.requestCardNum(), wx.pageScrollTo && th.setData({ | |
| 288 | + supportPageScroll: !0 | |
| 289 | + }); | |
| 239 | 290 | |
| 291 | + }); | |
| 240 | 292 | |
| 241 | 293 | //获取用户设备信息,屏幕宽度 |
| 242 | 294 | wx.getSystemInfo({ |
| 243 | 295 | success: res => { |
| 244 | - that.setData({ screenWidth: res.screenWidth }) | |
| 296 | + that.setData({ | |
| 297 | + screenWidth: res.screenWidth | |
| 298 | + }) | |
| 245 | 299 | } |
| 246 | - }) | |
| 300 | + }); | |
| 301 | + | |
| 302 | + //获取用户的默认门店 | |
| 303 | + getApp().get_user_store(function(e) { | |
| 304 | + var w_time = setInterval(function() { | |
| 305 | + if (that.data.is_get_local_ok == 0) return false; | |
| 306 | + var distance = null; | |
| 307 | + if (that.data.lat != null && e.distance == undefined) { | |
| 308 | + //distance=Math.sqrt((e.lat-th.data.lat)*(e.lat-th.data.lat)+(e.lon-th.data.lon)* (e.lon-th.data.lon)); | |
| 309 | + var distance = ut.getDistance(e.lat, th.data.lat, e.lon, th.data.lon); | |
| 310 | + e.distance = distance; | |
| 311 | + } | |
| 312 | + if (e) that.setData({ | |
| 313 | + def_pick_store: e, | |
| 314 | + sto_sele_name: e.pickup_name, | |
| 315 | + sto_sele_id: e.pickup_id, | |
| 316 | + sto_sele_distr: e.distr_type | |
| 317 | + }) | |
| 318 | + clearInterval(w_time); | |
| 319 | + }, 500) | |
| 320 | + }); | |
| 321 | + | |
| 247 | 322 | }, |
| 248 | 323 | |
| 249 | 324 | //------------程序初始化入口------------- |
| 250 | 325 | async init(gid) { |
| 251 | - var ee = this,th=ee, | |
| 326 | + var ee = this, | |
| 327 | + th = ee, | |
| 252 | 328 | gallery = null, |
| 253 | 329 | is_collect = 0, |
| 254 | 330 | collect_id = 0, |
| 255 | 331 | categories3 = ee.data.categories3, |
| 256 | - fir_com=null, | |
| 257 | - fir_quan=null, | |
| 258 | - mapurl=null, | |
| 259 | - mapurl_f_img=null; | |
| 332 | + fir_com = null, | |
| 333 | + fir_quan = null, | |
| 334 | + mapurl = null, | |
| 335 | + mapurl_f_img = null; | |
| 260 | 336 | |
| 261 | 337 | |
| 262 | 338 | //------图片滚动---------- |
| ... | ... | @@ -335,42 +411,43 @@ Page({ |
| 335 | 411 | goods_id: gid, |
| 336 | 412 | pageSize: 3, |
| 337 | 413 | parent_id: 0, |
| 338 | - page:1 | |
| 414 | + page:1, | |
| 415 | + is_show:1, | |
| 339 | 416 | }, |
| 340 | 417 | }).then(res => { |
| 341 | - fir_com=res.data.data.pageData; | |
| 418 | + fir_com = res.data.data.pageData; | |
| 342 | 419 | }) |
| 343 | 420 | |
| 344 | - if(fir_com){ | |
| 345 | - for(var ind in fir_com){ | |
| 346 | - if(fir_com[ind].head_pic=="") fir_com[ind].head_pic= ee.data.iurl+"/miniapp/images/hui_hear_pic.png"; | |
| 347 | - if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img); | |
| 348 | - } | |
| 421 | + if (fir_com) { | |
| 422 | + for (var ind in fir_com) { | |
| 423 | + if (fir_com[ind].head_pic == "") fir_com[ind].head_pic = ee.data.iurl + "/miniapp/images/hui_hear_pic.png"; | |
| 424 | + if (fir_com[ind].img) fir_com[ind].img = ut.unserialize(fir_com[ind].img); | |
| 425 | + if (fir_com[ind].weapp_img) fir_com[ind].weapp_img = JSON.parse(fir_com[ind].weapp_img); | |
| 426 | + } | |
| 349 | 427 | } |
| 350 | 428 | |
| 351 | - if (th.data.is_closecoupon!=1){ | |
| 429 | + if (th.data.is_closecoupon != 1) { | |
| 352 | 430 | //----获取详情页的券的数量---- |
| 353 | 431 | await getApp().request.promiseGet("/api/weshop/prom/coupon/page", { |
| 354 | 432 | data: { |
| 355 | 433 | store_id: os.stoid, |
| 356 | - type:1, | |
| 434 | + type: 1, | |
| 357 | 435 | pageSize: 3, |
| 358 | - page:1, | |
| 436 | + page: 1, | |
| 359 | 437 | }, |
| 360 | 438 | }).then(res1 => { |
| 361 | - fir_quan=res1.data.data.pageData; | |
| 439 | + fir_quan = res1.data.data.pageData; | |
| 362 | 440 | }) |
| 363 | 441 | } |
| 364 | 442 | |
| 365 | - | |
| 366 | 443 | //--------获取视频图片--------- |
| 367 | - await getApp().request.promiseGet("/api/weshop/goodsVideos/get/"+os.stoid+"/"+ee.data.gid, { | |
| 368 | - 1:1 | |
| 444 | + await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { | |
| 445 | + 1: 1 | |
| 369 | 446 | }).then(res1 => { |
| 370 | - if(res1.data.code==0){ | |
| 371 | - mapurl=res1.data.data.video_url; | |
| 372 | - mapurl_f_img=res1.data.data.video_img; | |
| 373 | - } | |
| 447 | + if (res1.data.code == 0) { | |
| 448 | + mapurl = res1.data.data.video_url; | |
| 449 | + mapurl_f_img = res1.data.data.video_img; | |
| 450 | + } | |
| 374 | 451 | }) |
| 375 | 452 | |
| 376 | 453 | ee.setData({ |
| ... | ... | @@ -378,19 +455,12 @@ Page({ |
| 378 | 455 | is_collect: is_collect, |
| 379 | 456 | collect_id: collect_id, |
| 380 | 457 | categories3: categories3, |
| 381 | - fir_quan:fir_quan, | |
| 382 | - fir_comments:fir_com, | |
| 383 | - mapurl_f_img:mapurl_f_img, | |
| 384 | - mapurl:mapurl, | |
| 458 | + fir_quan: fir_quan, | |
| 459 | + fir_comments: fir_com, | |
| 460 | + mapurl_f_img: mapurl_f_img, | |
| 461 | + mapurl: mapurl, | |
| 385 | 462 | }); |
| 386 | 463 | |
| 387 | - //获取系统参数 | |
| 388 | - getApp().getConfig2(function (conf) { | |
| 389 | - ee.setData({ | |
| 390 | - bconfig:conf, | |
| 391 | - }) | |
| 392 | - }); | |
| 393 | - | |
| 394 | 464 | ee.requestRecommend(); |
| 395 | 465 | |
| 396 | 466 | }, |
| ... | ... | @@ -398,8 +468,13 @@ Page({ |
| 398 | 468 | //---展示--- |
| 399 | 469 | onShow: function() { |
| 400 | 470 | |
| 401 | - this.data.is_timer=1; | |
| 402 | - var ee = this,gid = this.data.gid,i=getApp().request; | |
| 471 | + this.data.is_timer = 1; | |
| 472 | + var ee = this, | |
| 473 | + gid = this.data.gid, | |
| 474 | + i = getApp().request; | |
| 475 | + | |
| 476 | + this.wait_for_store_config(); | |
| 477 | + | |
| 403 | 478 | i.get("/api/weshop/goods/get/" + o.stoid + "/" + ee.data.gid, { |
| 404 | 479 | failRollback: !0, |
| 405 | 480 | success: function(t) { |
| ... | ... | @@ -445,7 +520,7 @@ Page({ |
| 445 | 520 | if (t.data.data.original_img.indexOf(o.imghost) == -1) |
| 446 | 521 | t.data.data.original_img = o.imghost + t.data.data.original_img; |
| 447 | 522 | |
| 448 | - if(t.data.data.goods_content==null) t.data.data.goods_content=""; | |
| 523 | + if (t.data.data.goods_content == null) t.data.data.goods_content = ""; | |
| 449 | 524 | |
| 450 | 525 | //-----商品详情--- |
| 451 | 526 | a.wxParse("content", "html", t.data.data.goods_content, ee, 6); |
| ... | ... | @@ -474,12 +549,14 @@ Page({ |
| 474 | 549 | t.data.data.gg = gg; |
| 475 | 550 | var uu = []; |
| 476 | 551 | uu.push(t.data.data); |
| 477 | - ee.setData({ sku_g: uu,}); | |
| 552 | + ee.setData({ | |
| 553 | + sku_g: uu, | |
| 554 | + }); | |
| 478 | 555 | } |
| 479 | 556 | ee.data.g_buy_num = new Map(); |
| 480 | 557 | ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id); |
| 481 | 558 | |
| 482 | - var th=ee; | |
| 559 | + var th = ee; | |
| 483 | 560 | if (ee.data.cat_name == '') { |
| 484 | 561 | //过去国别,分类,品牌的名称 |
| 485 | 562 | i.get("/api/weshop/goodscategory/get/" + o.stoid + "/" + th.data.data.cat_id, { |
| ... | ... | @@ -521,6 +598,8 @@ Page({ |
| 521 | 598 | }); |
| 522 | 599 | this.data.enterAddressPage && (this.data.enterAddressPage = !1); |
| 523 | 600 | |
| 601 | + | |
| 602 | + | |
| 524 | 603 | }, |
| 525 | 604 | enterAddress: function() { |
| 526 | 605 | this.data.enterAddressPage = !0, wx.navigateTo({ |
| ... | ... | @@ -528,8 +607,8 @@ Page({ |
| 528 | 607 | }); |
| 529 | 608 | }, |
| 530 | 609 | onUnload: function() {}, |
| 531 | - onHide:function(){ | |
| 532 | - this.data.is_timer=0; | |
| 610 | + onHide: function() { | |
| 611 | + this.data.is_timer = 0; | |
| 533 | 612 | }, |
| 534 | 613 | //----------三个选项按钮----------- |
| 535 | 614 | tabClick: function(t) { |
| ... | ... | @@ -550,9 +629,9 @@ Page({ |
| 550 | 629 | e.data.c_curr_p = 1; |
| 551 | 630 | this.setData({ |
| 552 | 631 | activeCategoryId3: t.currentTarget.id, |
| 553 | - comments: null | |
| 632 | + comments: null,comments_no_more:0,get_c:0, | |
| 554 | 633 | }); |
| 555 | - this.requestComments(); | |
| 634 | + this.requestComments_new(); | |
| 556 | 635 | } |
| 557 | 636 | }, |
| 558 | 637 | |
| ... | ... | @@ -564,13 +643,14 @@ Page({ |
| 564 | 643 | |
| 565 | 644 | tabComment: function() { |
| 566 | 645 | this.setData({ |
| 567 | - activeCategoryId: 2 | |
| 568 | - }), this.data.comments || this.requestComments(); | |
| 646 | + activeCategoryId: 2,comments_no_more:0,get_c:0 | |
| 647 | + }), this.data.comments || this.requestComments_new(); | |
| 569 | 648 | }, |
| 570 | 649 | |
| 571 | 650 | //商品详情的时候调用 |
| 572 | 651 | tabGoodsContent: function() { |
| 573 | - var th = this,i=getApp().request; | |
| 652 | + var th = this, | |
| 653 | + i = getApp().request; | |
| 574 | 654 | this.setData({ |
| 575 | 655 | activeCategoryId: 1 |
| 576 | 656 | }); |
| ... | ... | @@ -613,14 +693,16 @@ Page({ |
| 613 | 693 | }, |
| 614 | 694 | |
| 615 | 695 | //获取redis中的数量 |
| 616 | - async getactLen(func){ | |
| 617 | - var r_num=0,prom_type=this.data.prom_type,prom_id=this.data.prom_id; | |
| 618 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { | |
| 696 | + async getactLen(func) { | |
| 697 | + var r_num = 0, | |
| 698 | + prom_type = this.data.prom_type, | |
| 699 | + prom_id = this.data.prom_id; | |
| 700 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { | |
| 619 | 701 | 1: 1 |
| 620 | 702 | }).then(res => { |
| 621 | 703 | var em = res; |
| 622 | 704 | if (em.data.code == 0) { |
| 623 | - r_num=em.data.data; | |
| 705 | + r_num = em.data.data; | |
| 624 | 706 | } |
| 625 | 707 | }) |
| 626 | 708 | func(r_num); |
| ... | ... | @@ -628,29 +710,36 @@ Page({ |
| 628 | 710 | |
| 629 | 711 | //------------加入购物车-------------- |
| 630 | 712 | addCart: function(t) { |
| 631 | - var th=this; | |
| 713 | + var th = this; | |
| 714 | + var ind = t.currentTarget.dataset.openSpecModal_ind; | |
| 715 | + th.setData({ | |
| 716 | + open_ind_store: ind | |
| 717 | + }); | |
| 632 | 718 | //如果是秒杀的话,要看redis够不够 |
| 633 | - if(this.data.prom_type==1){ | |
| 634 | - this.getactLen(function (num) { | |
| 635 | - if(num<th.data.goodsInputNum) { | |
| 636 | - getApp().my_warnning("秒杀库存不足!",0,th); | |
| 637 | - return false; | |
| 638 | - }else{ | |
| 639 | - th.add_cart_func(t); | |
| 640 | - } | |
| 641 | - }); | |
| 642 | - }else{ | |
| 719 | + if (this.data.prom_type == 1) { | |
| 720 | + this.getactLen(function(num) { | |
| 721 | + if (num < th.data.goodsInputNum) { | |
| 722 | + getApp().my_warnning("秒杀库存不足!", 0, th); | |
| 723 | + return false; | |
| 724 | + } else { | |
| 725 | + th.add_cart_func(t); | |
| 726 | + } | |
| 727 | + }); | |
| 728 | + } else { | |
| 643 | 729 | th.add_cart_func(t); |
| 644 | 730 | } |
| 645 | 731 | }, |
| 646 | 732 | //加入购物的函数 |
| 647 | - add_cart_func:function(t){ | |
| 648 | - var i=getApp().request; | |
| 733 | + add_cart_func: function(t) { | |
| 734 | + var i = getApp().request; | |
| 649 | 735 | if (oo.user_id == null) { |
| 650 | - return s.my_warnning("还未登录!",0,this); | |
| 736 | + return s.my_warnning("还未登录!", 0, this); | |
| 651 | 737 | } |
| 652 | - var e = this,th = e,a = 0,o = this.data.sele_g; | |
| 653 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!",0,th); | |
| 738 | + var e = this, | |
| 739 | + th = e, | |
| 740 | + a = 0, | |
| 741 | + o = this.data.sele_g; | |
| 742 | + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
| 654 | 743 | a = o.goods_id; |
| 655 | 744 | |
| 656 | 745 | //----------添加到购物车时,要判断限购数量,-------- |
| ... | ... | @@ -676,13 +765,13 @@ Page({ |
| 676 | 765 | } |
| 677 | 766 | } |
| 678 | 767 | |
| 679 | - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0",0,th); | |
| 680 | - if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存",0,th); | |
| 768 | + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | |
| 769 | + if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存", 0, th); | |
| 681 | 770 | if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) |
| 682 | 771 | this.setData({ |
| 683 | 772 | sto_sele_name: "" |
| 684 | 773 | }); |
| 685 | - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店",0,th); | |
| 774 | + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | |
| 686 | 775 | |
| 687 | 776 | //--------------此时操作的数据------------ |
| 688 | 777 | var newd = { |
| ... | ... | @@ -701,8 +790,8 @@ Page({ |
| 701 | 790 | //-----如果是秒杀,团购,积分购,拼团----- |
| 702 | 791 | if (th.data.prom_type == 1) { |
| 703 | 792 | newd.goods_price = th.data.prom_price; |
| 704 | - newd.member_goods_price= th.data.prom_price, | |
| 705 | - newd.prom_type = th.data.prom_type; | |
| 793 | + newd.member_goods_price = th.data.prom_price, | |
| 794 | + newd.prom_type = th.data.prom_type; | |
| 706 | 795 | newd.prom_id = th.data.prom_id; |
| 707 | 796 | } else if (th.data.prom_type == 3) { |
| 708 | 797 | newd.prom_type = 0; |
| ... | ... | @@ -723,43 +812,34 @@ Page({ |
| 723 | 812 | //-------如果购物车中有相关的数据--------- |
| 724 | 813 | if (re.data.data.total > 0) { |
| 725 | 814 | var item = re.data.data.pageData[0]; |
| 726 | - | |
| 727 | - | |
| 728 | 815 | var updata = { |
| 729 | 816 | id: item.id, |
| 730 | 817 | goods_num: e.data.goodsInputNum + item.goods_num, |
| 731 | - goods_price: newd.shop_price, | |
| 818 | + goods_price: newd.goods_price, | |
| 819 | + store_id: th.data.stoid, | |
| 732 | 820 | }; |
| 733 | 821 | |
| 734 | 822 | i.put("/api/weshop/cart/update", { |
| 735 | 823 | data: updata, |
| 736 | 824 | success: function(t) { |
| 737 | - wx.showModal({ | |
| 738 | - title: "添加成功!", | |
| 739 | - cancelText: "去购物车", | |
| 740 | - confirmText: "再逛逛", | |
| 741 | - success: function(t) { | |
| 742 | - t.cancel ? wx.switchTab({ | |
| 743 | - url: "/pages/cart/cart/cart" | |
| 744 | - }) : e.requestCardNum(); | |
| 745 | - } | |
| 825 | + getApp().my_warnning('加入购物车成功', 1, th, 450); | |
| 826 | + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; | |
| 827 | + th.setData({ | |
| 828 | + cartGoodsNum: c_num | |
| 746 | 829 | }); |
| 830 | + th.closeSpecModal(); | |
| 747 | 831 | } |
| 748 | 832 | }); |
| 749 | 833 | } else { |
| 750 | 834 | i.post("/api/weshop/cart/save", { |
| 751 | 835 | data: newd, |
| 752 | 836 | success: function(t) { |
| 753 | - wx.showModal({ | |
| 754 | - title: "添加成功!", | |
| 755 | - cancelText: "去购物车", | |
| 756 | - confirmText: "再逛逛", | |
| 757 | - success: function(t) { | |
| 758 | - t.cancel ? wx.switchTab({ | |
| 759 | - url: "/pages/cart/cart/cart" | |
| 760 | - }) : e.requestCardNum(); | |
| 761 | - } | |
| 837 | + getApp().my_warnning('加入购物车成功', 1, th, 450); | |
| 838 | + var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; | |
| 839 | + th.setData({ | |
| 840 | + cartGoodsNum: c_num | |
| 762 | 841 | }); |
| 842 | + th.closeSpecModal(); | |
| 763 | 843 | } |
| 764 | 844 | }); |
| 765 | 845 | } |
| ... | ... | @@ -797,7 +877,7 @@ Page({ |
| 797 | 877 | // action: "buy_now" |
| 798 | 878 | // }), |
| 799 | 879 | s.set_b_now(e); |
| 800 | - wx.navigateTo({ | |
| 880 | + wx.redirectTo({ | |
| 801 | 881 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, |
| 802 | 882 | }); |
| 803 | 883 | }, |
| ... | ... | @@ -815,11 +895,10 @@ Page({ |
| 815 | 895 | this.checkCartNum(Number(t.detail.value)); |
| 816 | 896 | }, |
| 817 | 897 | |
| 818 | - | |
| 819 | 898 | //------检查数量是不是超出限购------ |
| 820 | 899 | checkCartNum: function(t) { |
| 821 | 900 | var th = this; |
| 822 | - this.get_buy_num(this.data.sele_g,async function() { | |
| 901 | + this.get_buy_num(this.data.sele_g, async function() { | |
| 823 | 902 | |
| 824 | 903 | //--判断商品是否超出限购-- |
| 825 | 904 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
| ... | ... | @@ -833,7 +912,7 @@ Page({ |
| 833 | 912 | |
| 834 | 913 | //--判断商品是否超出活动限购-- |
| 835 | 914 | if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) { |
| 836 | - if (t + th.data.prom_buy_num >th.data.prom_buy_limit) { | |
| 915 | + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { | |
| 837 | 916 | wx.showModal({ |
| 838 | 917 | title: '超出商品活动限购', |
| 839 | 918 | }); |
| ... | ... | @@ -841,20 +920,22 @@ Page({ |
| 841 | 920 | } |
| 842 | 921 | } |
| 843 | 922 | |
| 844 | - if(th.data.sele_g.prom_type==1 || th.data.sele_g.prom_type==6 ){ | |
| 845 | - var redis_num=0; | |
| 846 | - //------判断活动是否抢光----- | |
| 847 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" | |
| 848 | - + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, { | |
| 849 | - 1:1 | |
| 923 | + if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) { | |
| 924 | + var redis_num = 0; | |
| 925 | + //------判断活动是否抢光----- | |
| 926 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
| 927 | + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, { | |
| 928 | + 1: 1 | |
| 850 | 929 | }).then(res => { |
| 851 | - redis_num=res.data.data; | |
| 852 | - }); | |
| 930 | + redis_num = res.data.data; | |
| 931 | + }); | |
| 853 | 932 | |
| 854 | - if(t>redis_num){ | |
| 855 | - wx.showModal({ title: '超出商品活动库存', }); | |
| 856 | - return false; | |
| 857 | - } | |
| 933 | + if (t > redis_num) { | |
| 934 | + wx.showModal({ | |
| 935 | + title: '超出商品活动库存', | |
| 936 | + }); | |
| 937 | + return false; | |
| 938 | + } | |
| 858 | 939 | |
| 859 | 940 | } |
| 860 | 941 | |
| ... | ... | @@ -866,7 +947,6 @@ Page({ |
| 866 | 947 | }) |
| 867 | 948 | }, |
| 868 | 949 | |
| 869 | - | |
| 870 | 950 | closeSpecModal: function() { |
| 871 | 951 | this.setData({ |
| 872 | 952 | openSpecModal: !1, |
| ... | ... | @@ -874,10 +954,20 @@ Page({ |
| 874 | 954 | }); |
| 875 | 955 | }, |
| 876 | 956 | openSpecModel: function(t) { |
| 957 | + var open_store = t.currentTarget.dataset.ind; | |
| 958 | + | |
| 959 | + this.setData({ | |
| 960 | + store: 0, | |
| 961 | + choice_sort_store: 0, | |
| 962 | + sort_store: 0, | |
| 963 | + open_ind_store: open_store, | |
| 964 | + }) | |
| 877 | 965 | //--先判断会员状态-- |
| 878 | - var user_info=getApp().globalData.userInfo; | |
| 879 | - if(user_info==null || user_info.mobile==undefined || user_info.mobile=="" || user_info.mobile==null){ | |
| 880 | - wx.navigateTo({ url: '/pages/getphone/getphone', }) | |
| 966 | + var user_info = getApp().globalData.userInfo; | |
| 967 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 968 | + wx.navigateTo({ | |
| 969 | + url: '/pages/getphone/getphone', | |
| 970 | + }) | |
| 881 | 971 | return false; |
| 882 | 972 | } |
| 883 | 973 | |
| ... | ... | @@ -889,19 +979,26 @@ Page({ |
| 889 | 979 | }, |
| 890 | 980 | //---------点击收藏和不收藏------------ |
| 891 | 981 | collectGoods: function() { |
| 892 | - var t = this,i=getApp().request; | |
| 982 | + var t = this, | |
| 983 | + i = getApp().request; | |
| 893 | 984 | var user_id = s.globalData.user_id; |
| 894 | 985 | if (user_id == '') { |
| 895 | - getApp().getUserFir(function () {}); | |
| 986 | + getApp().getUserFir(function() {}); | |
| 896 | 987 | getApp().showWarning("未登录"); |
| 897 | 988 | return false; |
| 898 | 989 | } else { |
| 990 | + | |
| 991 | + if(t.data.is_collect_load) return false; | |
| 992 | + t.data.is_collect_load=1; | |
| 993 | + | |
| 899 | 994 | if (t.data.is_collect == 1) { //删除收藏 |
| 900 | 995 | i.delete("/api/weshop/goodscollect/del/" + o.stoid + "/" + t.data.collect_id, { |
| 901 | 996 | success: function(e) { |
| 997 | + t.data.is_collect_load=0; | |
| 902 | 998 | if (e.data.code == 0) { |
| 903 | 999 | t.setData({ |
| 904 | - is_collect: 0,collect_id: 0, | |
| 1000 | + is_collect: 0, | |
| 1001 | + collect_id: 0, | |
| 905 | 1002 | }); |
| 906 | 1003 | } |
| 907 | 1004 | } |
| ... | ... | @@ -918,6 +1015,7 @@ Page({ |
| 918 | 1015 | i.post("/api/weshop/goodscollect/save", { //添加收藏 |
| 919 | 1016 | data: d, |
| 920 | 1017 | success: function(e) { |
| 1018 | + t.data.is_collect_load=0; | |
| 921 | 1019 | if (e.data.code == 0) { |
| 922 | 1020 | t.setData({ |
| 923 | 1021 | is_collect: 1, |
| ... | ... | @@ -933,21 +1031,21 @@ Page({ |
| 933 | 1031 | //---------联系客服------------ |
| 934 | 1032 | contactService: function() { |
| 935 | 1033 | s.getConfig(function(t) { |
| 936 | - if(t.store_tel==undefined){ | |
| 937 | - getApp().request.get("/api/weshop/store/get/" + os.stoid,{ | |
| 938 | - isShowLoading:1, | |
| 939 | - data:{}, | |
| 940 | - success:function (rs) { | |
| 941 | - getApp().globalData.config = rs.data.data; | |
| 942 | - if(rs.data.data.store_tel==null && rs.data.data.store_tel==undefined ){ | |
| 943 | - getApp().my_warnning("商家未设置电话",0,th); | |
| 944 | - return false; | |
| 945 | - } | |
| 946 | - s.confirmBox("请联系客服:" + rs.data.data.store_tel); | |
| 947 | - } | |
| 948 | - }) | |
| 949 | - }else{ | |
| 950 | - s.confirmBox("请联系客服:" + t.store_tel); | |
| 1034 | + if (t.store_tel == undefined) { | |
| 1035 | + getApp().request.get("/api/weshop/store/get/" + os.stoid, { | |
| 1036 | + isShowLoading: 1, | |
| 1037 | + data: {}, | |
| 1038 | + success: function(rs) { | |
| 1039 | + getApp().globalData.config = rs.data.data; | |
| 1040 | + if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { | |
| 1041 | + getApp().my_warnning("商家未设置电话", 0, th); | |
| 1042 | + return false; | |
| 1043 | + } | |
| 1044 | + s.confirmBox("请联系客服:" + rs.data.data.store_tel); | |
| 1045 | + } | |
| 1046 | + }) | |
| 1047 | + } else { | |
| 1048 | + s.confirmBox("请联系客服:" + t.store_tel); | |
| 951 | 1049 | } |
| 952 | 1050 | }); |
| 953 | 1051 | }, |
| ... | ... | @@ -970,6 +1068,7 @@ Page({ |
| 970 | 1068 | } |
| 971 | 1069 | }); |
| 972 | 1070 | }, |
| 1071 | + | |
| 973 | 1072 | previewCommentImgs: function(t) { |
| 974 | 1073 | var e = this.data.comments[t.currentTarget.dataset.cidx].img; |
| 975 | 1074 | wx.previewImage({ |
| ... | ... | @@ -977,6 +1076,15 @@ Page({ |
| 977 | 1076 | urls: e |
| 978 | 1077 | }); |
| 979 | 1078 | }, |
| 1079 | + | |
| 1080 | + previewCommentImgs_w: function(t) { | |
| 1081 | + var e = this.data.comments[t.currentTarget.dataset.cidx].weapp_img; | |
| 1082 | + wx.previewImage({ | |
| 1083 | + current: e[t.currentTarget.dataset.id], | |
| 1084 | + urls: e | |
| 1085 | + }); | |
| 1086 | + }, | |
| 1087 | + | |
| 980 | 1088 | previewGoodsCommentImgs: function(t) { |
| 981 | 1089 | var e = this, |
| 982 | 1090 | a = this.data.data.comment[t.currentTarget.dataset.cidx].img; |
| ... | ... | @@ -1025,7 +1133,7 @@ Page({ |
| 1025 | 1133 | bind_bnerr: function(e) { |
| 1026 | 1134 | var _errImg = e.target.dataset.errorimg; |
| 1027 | 1135 | var _errObj = {}; |
| 1028 | - _errObj[_errImg] = this.data.iurl+"/miniapp/images/default_g_img.gif"; | |
| 1136 | + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif"; | |
| 1029 | 1137 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 1030 | 1138 | }, |
| 1031 | 1139 | |
| ... | ... | @@ -1034,7 +1142,7 @@ Page({ |
| 1034 | 1142 | |
| 1035 | 1143 | var _errImg = e.target.dataset.errorimg; |
| 1036 | 1144 | var _errObj = {}; |
| 1037 | - _errObj[_errImg] = this.data.iurl+"/miniapp/images/hui_hear_pic.png" | |
| 1145 | + _errObj[_errImg] = this.data.iurl + "/miniapp/images/hui_hear_pic.png" | |
| 1038 | 1146 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 1039 | 1147 | }, |
| 1040 | 1148 | |
| ... | ... | @@ -1095,77 +1203,132 @@ Page({ |
| 1095 | 1203 | //-----------选择属性的按钮事件---------- |
| 1096 | 1204 | sele_spec: function(e) { |
| 1097 | 1205 | var gid = e.currentTarget.dataset.gid; |
| 1098 | - var sku_g=this.data.sku_g; | |
| 1099 | - var item=null; | |
| 1100 | - for(var i in sku_g){ | |
| 1101 | - if(sku_g[i].goods_id==gid){item=sku_g[i]; break} | |
| 1206 | + var sku_g = this.data.sku_g; | |
| 1207 | + var item = null; | |
| 1208 | + for (var i in sku_g) { | |
| 1209 | + if (sku_g[i].goods_id == gid) { | |
| 1210 | + item = sku_g[i]; | |
| 1211 | + break | |
| 1212 | + } | |
| 1102 | 1213 | } |
| 1103 | - if(item) this.setData({sele_g:item,gid:gid}); | |
| 1214 | + if (item) this.setData({ | |
| 1215 | + sele_g: item, | |
| 1216 | + gid: gid | |
| 1217 | + }); | |
| 1104 | 1218 | }, |
| 1105 | 1219 | //---------拿出门店分类和门店------------ |
| 1106 | - async get_sto(e) { | |
| 1107 | - var th = this, dd = null,i=getApp().request; | |
| 1108 | - var g_distr_type = this.data.data.distr_type; | |
| 1109 | - if (g_distr_type != 0) { | |
| 1110 | - dd = { | |
| 1111 | - store_id: o.stoid, | |
| 1112 | - distr_type: g_distr_type, | |
| 1113 | - isstop: 0, | |
| 1114 | - pageSize: 300 | |
| 1220 | + get_sto(e) { | |
| 1221 | + var th = this; | |
| 1222 | + var timer_get = setInterval(function() { | |
| 1223 | + if (th.data.is_get_local_ok == 0) return false; | |
| 1224 | + var dd = null, | |
| 1225 | + i = getApp().request; | |
| 1226 | + var g_distr_type = th.data.data.distr_type; | |
| 1227 | + if (g_distr_type != 0) { | |
| 1228 | + dd = { | |
| 1229 | + store_id: o.stoid, | |
| 1230 | + distr_type: g_distr_type, | |
| 1231 | + isstop: 0, | |
| 1232 | + pageSize: 300 | |
| 1233 | + } | |
| 1234 | + } else { | |
| 1235 | + dd = { | |
| 1236 | + store_id: o.stoid, | |
| 1237 | + isstop: 0, | |
| 1238 | + pageSize: 300 | |
| 1239 | + } | |
| 1115 | 1240 | } |
| 1116 | - } else { | |
| 1117 | - dd = { | |
| 1118 | - store_id: o.stoid, | |
| 1119 | - isstop: 0, | |
| 1120 | - pageSize: 300 | |
| 1241 | + //如果有距离的话 | |
| 1242 | + if (th.data.lat != null) { | |
| 1243 | + dd.lat = th.data.lat; | |
| 1244 | + dd.lon = th.data.lon; | |
| 1121 | 1245 | } |
| 1122 | - } | |
| 1123 | - //----------获取门店---------------- | |
| 1124 | - await getApp().request.promiseGet("/api/weshop/pickup/list", { | |
| 1125 | - data: dd, | |
| 1126 | - }).then(res => { | |
| 1127 | - var e = res; | |
| 1128 | - if (e.data.code == 0) { | |
| 1129 | - //单总量超出5个的时候 | |
| 1130 | - if (e.data.data.total > 5) { | |
| 1131 | - i.get("/api/weshop/storagecategory/page", { | |
| 1132 | - data: { | |
| 1133 | - store_id: o.stoid, | |
| 1134 | - is_show: 1, | |
| 1135 | - pageSize: 300 | |
| 1136 | - }, | |
| 1137 | - success: function(ee) { | |
| 1138 | - if (ee.data.code == 0) { | |
| 1139 | - if (ee.data.data.pageData.length > 0) { | |
| 1140 | - var sto_cate = ee.data.data.pageData; | |
| 1141 | - var sto_arr = e.data.data.pageData; | |
| 1142 | - var newarr = new Array(); | |
| 1143 | - var qita = new Array(); | |
| 1144 | - //----要进行门店分组-------- | |
| 1145 | - for (var i = 0; i < sto_arr.length; i++) { | |
| 1146 | - //找一下这个门店有没有在分类数组内 | |
| 1147 | - var find2 = 0, | |
| 1148 | - find2name = ""; | |
| 1149 | - for (var m = 0; m < sto_cate.length; m++) { | |
| 1150 | - if (sto_arr[i].category_id == sto_cate[m].cat_id) { | |
| 1151 | - find2 = sto_cate[m].cat_id; | |
| 1152 | - find2name = sto_cate[m].cat_name; | |
| 1153 | - break; | |
| 1154 | - } | |
| 1246 | + clearInterval(timer_get); | |
| 1247 | + //----------获取门店---------------- | |
| 1248 | + getApp().request.promiseGet("/api/weshop/pickup/list", { | |
| 1249 | + data: dd, | |
| 1250 | + }).then(res => { | |
| 1251 | + var e = res; | |
| 1252 | + if (e.data.code == 0) { | |
| 1253 | + //-- 如果有默认选择门店的时候,要把默认门店放在第一位 -- | |
| 1254 | + if (th.data.def_pick_store) { | |
| 1255 | + for (var k = 0; k < e.data.data.pageData.length; k++) { | |
| 1256 | + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { | |
| 1257 | + e.data.data.pageData.splice(k, 1); //删除 | |
| 1258 | + break; | |
| 1259 | + } | |
| 1260 | + } | |
| 1261 | + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 | |
| 1262 | + } | |
| 1263 | + | |
| 1264 | + //单总量超出5个的时候 | |
| 1265 | + if (e.data.data.total > 5) { | |
| 1266 | + i.get("/api/weshop/storagecategory/page", { | |
| 1267 | + data: { | |
| 1268 | + store_id: o.stoid, | |
| 1269 | + is_show: 1, | |
| 1270 | + pageSize: 300 | |
| 1271 | + }, | |
| 1272 | + success: function(ee) { | |
| 1273 | + if (ee.data.code == 0) { | |
| 1274 | + if (ee.data.data.pageData.length > 0) { | |
| 1275 | + var def_arr = new Array(); | |
| 1276 | + var ishas = 0; | |
| 1277 | + //-- 开始就看5个门店 -- | |
| 1278 | + for (var k = 0; k < 5; k++) { | |
| 1279 | + if (k == e.data.data.pageData.length) break; | |
| 1280 | + def_arr.push(e.data.data.pageData[k]); | |
| 1155 | 1281 | } |
| 1156 | 1282 | |
| 1157 | - if (newarr.length > 0) { | |
| 1158 | - var find = 0; | |
| 1159 | - //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1160 | - if (find2 != 0) { | |
| 1161 | - for (var ii = 0; ii < newarr.length; ii++) { | |
| 1162 | - if (sto_arr[i].category_id == newarr[ii].cat_id) { | |
| 1163 | - newarr[ii].s_arr.push(sto_arr[i]); | |
| 1164 | - find = 1; | |
| 1165 | - break; | |
| 1283 | + th.setData({ | |
| 1284 | + def_pickpu_list: def_arr, | |
| 1285 | + pickpu_list: ee.data.data.pageData | |
| 1286 | + }); | |
| 1287 | + var sto_cate = ee.data.data.pageData; | |
| 1288 | + var sto_arr = e.data.data.pageData; | |
| 1289 | + var newarr = new Array(); | |
| 1290 | + var qita = new Array(); | |
| 1291 | + | |
| 1292 | + //----要进行门店分组-------- | |
| 1293 | + for (var i = 0; i < sto_arr.length; i++) { | |
| 1294 | + //找一下这个门店有没有在分类数组内 | |
| 1295 | + var find2 = 0, | |
| 1296 | + find2name = ""; | |
| 1297 | + for (var m = 0; m < sto_cate.length; m++) { | |
| 1298 | + if (sto_arr[i].category_id == sto_cate[m].cat_id) { | |
| 1299 | + find2 = sto_cate[m].cat_id; | |
| 1300 | + find2name = sto_cate[m].cat_name; | |
| 1301 | + break; | |
| 1302 | + } | |
| 1303 | + } | |
| 1304 | + | |
| 1305 | + if (newarr.length > 0) { | |
| 1306 | + var find = 0; | |
| 1307 | + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1308 | + if (find2 != 0) { | |
| 1309 | + for (var ii = 0; ii < newarr.length; ii++) { | |
| 1310 | + if (sto_arr[i].category_id == newarr[ii].cat_id) { | |
| 1311 | + newarr[ii].s_arr.push(sto_arr[i]); | |
| 1312 | + find = 1; | |
| 1313 | + break; | |
| 1314 | + } | |
| 1315 | + } | |
| 1316 | + if (find == 0) { | |
| 1317 | + var arr0 = new Array(); | |
| 1318 | + arr0.push(sto_arr[i]); | |
| 1319 | + var item = { | |
| 1320 | + cat_id: find2, | |
| 1321 | + name: find2name, | |
| 1322 | + s_arr: arr0 | |
| 1323 | + }; | |
| 1324 | + newarr.push(item); | |
| 1166 | 1325 | } |
| 1326 | + } else { | |
| 1327 | + qita.push(sto_arr[i]); | |
| 1167 | 1328 | } |
| 1168 | - if (find == 0) { | |
| 1329 | + } else { | |
| 1330 | + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1331 | + if (find2 != 0) { | |
| 1169 | 1332 | var arr0 = new Array(); |
| 1170 | 1333 | arr0.push(sto_arr[i]); |
| 1171 | 1334 | var item = { |
| ... | ... | @@ -1174,63 +1337,51 @@ Page({ |
| 1174 | 1337 | s_arr: arr0 |
| 1175 | 1338 | }; |
| 1176 | 1339 | newarr.push(item); |
| 1340 | + } else { | |
| 1341 | + qita.push(sto_arr[i]); | |
| 1177 | 1342 | } |
| 1178 | - } else { | |
| 1179 | - qita.push(sto_arr[i]); | |
| 1180 | - } | |
| 1181 | - } else { | |
| 1182 | - //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 | |
| 1183 | - if (find2 != 0) { | |
| 1184 | - var arr0 = new Array(); | |
| 1185 | - arr0.push(sto_arr[i]); | |
| 1186 | - var item = { | |
| 1187 | - cat_id: find2, | |
| 1188 | - name: find2name, | |
| 1189 | - s_arr: arr0 | |
| 1190 | - }; | |
| 1191 | - newarr.push(item); | |
| 1192 | - } else { | |
| 1193 | - qita.push(sto_arr[i]); | |
| 1194 | 1343 | } |
| 1195 | 1344 | } |
| 1196 | - } | |
| 1197 | 1345 | |
| 1198 | - //----安排其他的分类----- | |
| 1199 | - if (qita.length > 0) { | |
| 1200 | - var item = { | |
| 1201 | - cat_id: -1, | |
| 1202 | - name: "其他", | |
| 1203 | - s_arr: qita | |
| 1204 | - }; | |
| 1205 | - newarr.push(item); | |
| 1206 | - } | |
| 1207 | - th.setData({ | |
| 1208 | - is_show_sto_cat: 1, | |
| 1209 | - all_sto: newarr | |
| 1210 | - }); | |
| 1346 | + //----安排其他的分类----- | |
| 1347 | + if (qita.length > 0) { | |
| 1348 | + var item = { | |
| 1349 | + cat_id: -1, | |
| 1350 | + name: "其他", | |
| 1351 | + s_arr: qita | |
| 1352 | + }; | |
| 1353 | + newarr.push(item); | |
| 1354 | + } | |
| 1355 | + th.setData({ | |
| 1356 | + is_show_sto_cat: 1, | |
| 1357 | + all_sto: newarr | |
| 1358 | + }); | |
| 1211 | 1359 | |
| 1360 | + } else { | |
| 1361 | + th.setData({ | |
| 1362 | + is_show_sto_cat: -1, | |
| 1363 | + only_pk: e.data.data.pageData | |
| 1364 | + }); | |
| 1365 | + } | |
| 1212 | 1366 | } else { |
| 1213 | 1367 | th.setData({ |
| 1214 | - is_show_sto_cat: 0, | |
| 1368 | + is_show_sto_cat: -1, | |
| 1215 | 1369 | only_pk: e.data.data.pageData |
| 1216 | 1370 | }); |
| 1217 | 1371 | } |
| 1218 | - } else { | |
| 1219 | - th.setData({ | |
| 1220 | - is_show_sto_cat: 0, | |
| 1221 | - only_pk: e.data.data.pageData | |
| 1222 | - }); | |
| 1223 | 1372 | } |
| 1224 | - } | |
| 1225 | - }); | |
| 1226 | - } else { | |
| 1227 | - th.setData({ | |
| 1228 | - is_show_sto_cat: 0, | |
| 1229 | - only_pk: e.data.data.pageData | |
| 1230 | - }); | |
| 1373 | + }); | |
| 1374 | + } else { | |
| 1375 | + th.setData({ | |
| 1376 | + is_show_sto_cat: 0, | |
| 1377 | + only_pk: e.data.data.pageData | |
| 1378 | + }); | |
| 1379 | + } | |
| 1231 | 1380 | } |
| 1232 | - } | |
| 1233 | - }) | |
| 1381 | + }) | |
| 1382 | + }, 200) | |
| 1383 | + | |
| 1384 | + | |
| 1234 | 1385 | }, |
| 1235 | 1386 | |
| 1236 | 1387 | //----------取货门店被点击的效果------ |
| ... | ... | @@ -1272,59 +1423,77 @@ Page({ |
| 1272 | 1423 | }, |
| 1273 | 1424 | |
| 1274 | 1425 | //评论的调用 |
| 1275 | - requestComments: function() { | |
| 1276 | - var e = this, th = e; | |
| 1277 | - var tp = e.data.activeCategoryId3; | |
| 1426 | + requestComments_new: async function(){ | |
| 1427 | + var e = this, th = e,ee=e; var tp = e.data.activeCategoryId3; | |
| 1278 | 1428 | var t = '/api/weshop/comment/pageComment?page=' + e.data.c_curr_p; |
| 1279 | 1429 | |
| 1280 | - var req_where={ | |
| 1281 | - store_id: o.stoid, | |
| 1282 | - pageSize: 5, | |
| 1283 | - parent_id: 0, | |
| 1284 | - goods_id: th.data.gid, | |
| 1285 | - commenttype: tp, | |
| 1286 | - | |
| 1430 | + wx.showLoading(); | |
| 1431 | + var req_where = { | |
| 1432 | + store_id: o.stoid, pageSize: 5,is_show:1, | |
| 1433 | + parent_id: 0, goods_id: th.data.gid, commenttype: tp, | |
| 1287 | 1434 | } |
| 1288 | - if(getApp().globalData.userInfo){ | |
| 1289 | - req_where.userId=getApp().globalData.userInfo.user_id; | |
| 1435 | + if (getApp().globalData.userInfo) { | |
| 1436 | + req_where.userId = getApp().globalData.userInfo.user_id; | |
| 1290 | 1437 | } |
| 1291 | 1438 | |
| 1292 | - n.request(t, async function(ee) { | |
| 1293 | - var tot = ee.data.data.total; | |
| 1294 | - e.setData({ | |
| 1295 | - com_num: tot,get_c:1 | |
| 1296 | - }); | |
| 1439 | + var rs_data=null; | |
| 1440 | + await getApp().request.promiseGet(t, { data: req_where}).then(res=>{ | |
| 1441 | + var tot = res.data.data.total; | |
| 1297 | 1442 | e.data.c_curr_p++; |
| 1443 | + e.setData({ | |
| 1444 | + com_num: tot, //已经有加载 | |
| 1445 | + }); | |
| 1446 | + if (res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ | |
| 1447 | + rs_data=res.data.data.pageData; | |
| 1448 | + }else{ | |
| 1449 | + th.setData({comments_no_more:1,auto:1}); | |
| 1450 | + } | |
| 1451 | + }) | |
| 1298 | 1452 | |
| 1299 | - var cda = th.data.comments; | |
| 1300 | - for(var ind in cda){ | |
| 1301 | - var ep= cda[ind]; | |
| 1302 | - if(ep.is_req!=1){ | |
| 1303 | - await getApp().request.promiseGet("/api/weshop/comment/pageComment",{ | |
| 1304 | - data:{store_id:o.stoid ,parent_id:ep.comment_id} | |
| 1305 | - }).then(res=>{ | |
| 1306 | - cda[ind].is_req=1; | |
| 1307 | - if(cda[ind].head_pic==''){ | |
| 1308 | - cda[ind].head_pic= th.data.iurl+"/miniapp/images/hui_hear_pic.png"; | |
| 1309 | - } | |
| 1310 | - if(res.data.data.pageData && res.data.data.pageData.length>0){ | |
| 1311 | - cda[ind].replay_list=res.data.data.pageData; | |
| 1312 | - } | |
| 1313 | - }) | |
| 1314 | - } | |
| 1453 | + if (rs_data){ | |
| 1454 | + //var cda = th.data.comments; | |
| 1455 | + var cda = rs_data,com_data=th.data.comments; | |
| 1456 | + for (var ind in cda) { | |
| 1457 | + var ep = cda[ind]; | |
| 1458 | + if (cda[ind].head_pic == '') { | |
| 1459 | + cda[ind].head_pic = th.data.iurl + "/miniapp/images/hui_hear_pic.png"; | |
| 1460 | + } | |
| 1461 | + if (ep.weapp_img != "" && ut.isString(ep.weapp_img)) { | |
| 1462 | + cda[ind].weapp_img = JSON.parse(ep.weapp_img); | |
| 1463 | + } | |
| 1464 | + if (ep.img != "" && ut.isString(ep.img)) { | |
| 1465 | + cda[ind].img = ut.unserialize(ep.img); | |
| 1466 | + } | |
| 1467 | + | |
| 1468 | + //--测量多有字的宽带,计算有多少行-- | |
| 1469 | + var widh=ut.measureText(ep.content,30); | |
| 1470 | + var lines=widh/712; | |
| 1471 | + cda[ind].seeMore=false; | |
| 1472 | + if(lines>3) cda[ind].seeMore=true; | |
| 1473 | + | |
| 1474 | + await getApp().request.promiseGet("/api/weshop/comment/pageComment", { | |
| 1475 | + data: {store_id: o.stoid, parent_id: ep.comment_id } | |
| 1476 | + }).then(res => { | |
| 1477 | + if (res.data.data.pageData && res.data.data.pageData.length > 0) { | |
| 1478 | + cda[ind].replay_list = res.data.data.pageData; | |
| 1479 | + } | |
| 1480 | + }) | |
| 1315 | 1481 | } |
| 1316 | 1482 | |
| 1317 | - th.setData({ | |
| 1318 | - comments: cda | |
| 1319 | - }); | |
| 1483 | + if (!com_data) com_data = cda; | |
| 1484 | + else com_data = com_data.concat(cda); | |
| 1320 | 1485 | |
| 1321 | - }, null,req_where); | |
| 1486 | + th.setData({ comments: com_data}); | |
| 1487 | + } | |
| 1488 | + th.setData({get_c: 1}); | |
| 1489 | + wx.hideLoading(); | |
| 1322 | 1490 | }, |
| 1323 | 1491 | |
| 1324 | 1492 | //加载更多是靠这个函数 |
| 1325 | 1493 | onReachBottom: function() { |
| 1326 | - if (this.data.activeCategoryId == 2) | |
| 1327 | - n.canloadMore() && this.requestComments(); | |
| 1494 | + if (this.data.activeCategoryId == 2){ | |
| 1495 | + if(!this.data.comments_no_more) this.requestComments_new(); | |
| 1496 | + } | |
| 1328 | 1497 | }, |
| 1329 | 1498 | |
| 1330 | 1499 | //--------检查是否活动,活动是否开始,或者是否结束------- |
| ... | ... | @@ -1333,7 +1502,8 @@ Page({ |
| 1333 | 1502 | th = ee; |
| 1334 | 1503 | if (prom_type == 3 || prom_type == 0) { |
| 1335 | 1504 | this.setData({ |
| 1336 | - prom_type: prom_type,isshow:1, | |
| 1505 | + prom_type: prom_type, | |
| 1506 | + isshow: 1, | |
| 1337 | 1507 | }); |
| 1338 | 1508 | return false; |
| 1339 | 1509 | } |
| ... | ... | @@ -1356,7 +1526,8 @@ Page({ |
| 1356 | 1526 | success: function(t) { |
| 1357 | 1527 | if (t.data.code != 0) { |
| 1358 | 1528 | ee.setData({ |
| 1359 | - prom_type: 0,isshow:1, | |
| 1529 | + prom_type: 0, | |
| 1530 | + isshow: 1, | |
| 1360 | 1531 | }); |
| 1361 | 1532 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1362 | 1533 | return false; |
| ... | ... | @@ -1364,25 +1535,28 @@ Page({ |
| 1364 | 1535 | //----已经结束----- |
| 1365 | 1536 | if (t.data.data.is_end == 1) { |
| 1366 | 1537 | ee.setData({ |
| 1367 | - prom_type: 0,isshow:1, | |
| 1538 | + prom_type: 0, | |
| 1539 | + isshow: 1, | |
| 1368 | 1540 | }); |
| 1369 | 1541 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1370 | 1542 | return false; |
| 1371 | 1543 | } |
| 1372 | 1544 | //----已经过期----- |
| 1373 | 1545 | var now = ut.gettimestamp(); |
| 1374 | - if (t.data.data.end_time < now ) { | |
| 1546 | + if (t.data.data.end_time < now) { | |
| 1375 | 1547 | ee.setData({ |
| 1376 | - prom_type: 0,isshow:1, | |
| 1548 | + prom_type: 0, | |
| 1549 | + isshow: 1, | |
| 1377 | 1550 | }); |
| 1378 | 1551 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1379 | 1552 | return false; |
| 1380 | 1553 | } |
| 1381 | 1554 | |
| 1382 | 1555 | /*-- 还没有开始预热的也不显示 --*/ |
| 1383 | - if (t.data.data.show_time >now) { | |
| 1556 | + if (t.data.data.show_time > now) { | |
| 1384 | 1557 | ee.setData({ |
| 1385 | - prom_type: 0,isshow:1, | |
| 1558 | + prom_type: 0, | |
| 1559 | + isshow: 1, | |
| 1386 | 1560 | }); |
| 1387 | 1561 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1388 | 1562 | return false; |
| ... | ... | @@ -1400,7 +1574,7 @@ Page({ |
| 1400 | 1574 | prom_act: t.data.data, |
| 1401 | 1575 | prom_end_time: prom_end_time, |
| 1402 | 1576 | prom_start_time: prom_start_time, |
| 1403 | - isshow:1, | |
| 1577 | + isshow: 1, | |
| 1404 | 1578 | }); |
| 1405 | 1579 | |
| 1406 | 1580 | |
| ... | ... | @@ -1452,7 +1626,8 @@ Page({ |
| 1452 | 1626 | success: function(t) { |
| 1453 | 1627 | if (t.data.code != 0) { |
| 1454 | 1628 | ee.setData({ |
| 1455 | - prom_type: 0,isshow:1, | |
| 1629 | + prom_type: 0, | |
| 1630 | + isshow: 1, | |
| 1456 | 1631 | }); |
| 1457 | 1632 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1458 | 1633 | return false; |
| ... | ... | @@ -1460,7 +1635,8 @@ Page({ |
| 1460 | 1635 | //----已经结束----- |
| 1461 | 1636 | if (t.data.data.is_end == 1) { |
| 1462 | 1637 | ee.setData({ |
| 1463 | - prom_type: 0,isshow:1, | |
| 1638 | + prom_type: 0, | |
| 1639 | + isshow: 1, | |
| 1464 | 1640 | }); |
| 1465 | 1641 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1466 | 1642 | return false; |
| ... | ... | @@ -1469,7 +1645,8 @@ Page({ |
| 1469 | 1645 | var now = ut.gettimestamp(); |
| 1470 | 1646 | if (t.data.data.end_time < now) { |
| 1471 | 1647 | ee.setData({ |
| 1472 | - prom_type: 0,isshow:1, | |
| 1648 | + prom_type: 0, | |
| 1649 | + isshow: 1, | |
| 1473 | 1650 | }); |
| 1474 | 1651 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1475 | 1652 | return false; |
| ... | ... | @@ -1478,7 +1655,8 @@ Page({ |
| 1478 | 1655 | /*-- 还没有开始预热的也不显示 --*/ |
| 1479 | 1656 | if (t.data.data.show_time > now) { |
| 1480 | 1657 | ee.setData({ |
| 1481 | - prom_type: 0,isshow:1, | |
| 1658 | + prom_type: 0, | |
| 1659 | + isshow: 1, | |
| 1482 | 1660 | }); |
| 1483 | 1661 | ee.get_sku(os.stoid, ee.data.data.sku, gid); |
| 1484 | 1662 | return false; |
| ... | ... | @@ -1499,51 +1677,55 @@ Page({ |
| 1499 | 1677 | th.data.buy_order = odr; |
| 1500 | 1678 | if (odr.pt_status == 0 && odr.order_status == 1) { |
| 1501 | 1679 | th.setData({ |
| 1502 | - user_order_pt_state: 1 | |
| 1680 | + user_order_pt_state: 1 | |
| 1503 | 1681 | }); |
| 1504 | 1682 | } |
| 1505 | 1683 | if (odr.pt_status == 1 && odr.order_status == 1) { |
| 1506 | - if (odr.is_zsorder == 4){ | |
| 1507 | - getApp().request.promiseGet("/api/weshop/teamgroup/page/", { | |
| 1508 | - data: { store_id: os.stoid, team_id: odr.pt_prom_id, listno: odr.pt_listno } | |
| 1509 | - }).then(res => { | |
| 1510 | - var now=ut.gettimestamp(); | |
| 1511 | - var tgr = res.data.data.pageData[0]; | |
| 1512 | - //如果团的时间已经到了 | |
| 1513 | - if (now >= tgr.kt_end_time){ | |
| 1514 | - th.update_jiti(tgr.id); | |
| 1515 | - }else{ | |
| 1516 | - th.setData({ | |
| 1517 | - user_order_pt_state: 2 | |
| 1518 | - }); | |
| 1519 | - } | |
| 1520 | - }) | |
| 1521 | - | |
| 1522 | - }else{ | |
| 1523 | - th.setData({ | |
| 1524 | - user_order_pt_state: 2 | |
| 1525 | - }); | |
| 1526 | - } | |
| 1527 | - } | |
| 1528 | - | |
| 1529 | - if (odr.pt_status == 2 && odr.is_zsorder == 4) { | |
| 1684 | + if (odr.is_zsorder == 4) { | |
| 1685 | + getApp().request.promiseGet("/api/weshop/teamgroup/page/", { | |
| 1686 | + data: { | |
| 1687 | + store_id: os.stoid, | |
| 1688 | + team_id: odr.pt_prom_id, | |
| 1689 | + listno: odr.pt_listno | |
| 1690 | + } | |
| 1691 | + }).then(res => { | |
| 1692 | + var now = ut.gettimestamp(); | |
| 1693 | + var tgr = res.data.data.pageData[0]; | |
| 1694 | + //如果团的时间已经到了 | |
| 1695 | + if (now >= tgr.kt_end_time) { | |
| 1696 | + th.update_jiti(tgr.id); | |
| 1697 | + } else { | |
| 1698 | + th.setData({ | |
| 1699 | + user_order_pt_state: 2 | |
| 1700 | + }); | |
| 1701 | + } | |
| 1702 | + }) | |
| 1703 | + | |
| 1704 | + } else { | |
| 1530 | 1705 | th.setData({ |
| 1531 | - user_order_pt_state: 3, | |
| 1706 | + user_order_pt_state: 2 | |
| 1532 | 1707 | }); |
| 1533 | - th.data.wk_order_id=odr.order_id; | |
| 1708 | + } | |
| 1709 | + } | |
| 1710 | + | |
| 1711 | + if (odr.pt_status == 2 && odr.is_zsorder == 4) { | |
| 1712 | + th.setData({ | |
| 1713 | + user_order_pt_state: 3, | |
| 1714 | + }); | |
| 1715 | + th.data.wk_order_id = odr.order_id; | |
| 1534 | 1716 | } |
| 1535 | 1717 | } |
| 1536 | 1718 | }, |
| 1537 | 1719 | }); |
| 1538 | 1720 | |
| 1539 | 1721 | //----------查看阶梯团------------ |
| 1540 | - if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined){ | |
| 1541 | - t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist); | |
| 1542 | - var max_num=0; | |
| 1543 | - t.data.data.ct_rylist.forEach(function (val,ind) { | |
| 1544 | - if(val.rynum>max_num) max_num=val.rynum; | |
| 1545 | - }) | |
| 1546 | - t.data.data.max_ct_num=max_num; | |
| 1722 | + if (t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) { | |
| 1723 | + t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist); | |
| 1724 | + var max_num = 0; | |
| 1725 | + t.data.data.ct_rylist.forEach(function(val, ind) { | |
| 1726 | + if (val.rynum > max_num) max_num = val.rynum; | |
| 1727 | + }) | |
| 1728 | + t.data.data.max_ct_num = max_num; | |
| 1547 | 1729 | } |
| 1548 | 1730 | |
| 1549 | 1731 | var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); |
| ... | ... | @@ -1556,7 +1738,7 @@ Page({ |
| 1556 | 1738 | prom_act: t.data.data, |
| 1557 | 1739 | prom_end_time: prom_end_time, |
| 1558 | 1740 | prom_start_time: prom_start_time, |
| 1559 | - isshow:1, | |
| 1741 | + isshow: 1, | |
| 1560 | 1742 | }); |
| 1561 | 1743 | |
| 1562 | 1744 | var newTime = now; |
| ... | ... | @@ -1588,40 +1770,51 @@ Page({ |
| 1588 | 1770 | }, |
| 1589 | 1771 | |
| 1590 | 1772 | //--获取有多少人在开团-- |
| 1591 | - async get_team_group(prom_id){ | |
| 1592 | - var teamgroup=[],th=this,grounp_tatal=0; | |
| 1593 | - //如果活动是开团不是商家团 | |
| 1594 | - if(this.data.prom_act.kttype>1) { | |
| 1595 | - //获取活动从表信息team_id | |
| 1596 | - await getApp().request.promiseGet("/api/weshop/teamgroup/page", { | |
| 1773 | + async get_team_group(prom_id) { | |
| 1774 | + var teamgroup = [], | |
| 1775 | + th = this, | |
| 1776 | + grounp_tatal = 0; | |
| 1777 | + //如果活动是开团不是商家团 | |
| 1778 | + if (this.data.prom_act.kttype > 1) { | |
| 1779 | + //获取活动从表信息team_id | |
| 1780 | + await getApp().request.promiseGet("/api/weshop/teamgroup/page", { | |
| 1781 | + data: { | |
| 1782 | + store_id: os.stoid, | |
| 1783 | + pageSize: 3, | |
| 1784 | + page: 1, | |
| 1785 | + state: 2, | |
| 1786 | + team_id: prom_id | |
| 1787 | + } | |
| 1788 | + }).then(res => { | |
| 1789 | + teamgroup = res.data.data.pageData; | |
| 1790 | + grounp_tatal = res.data.data.total; | |
| 1791 | + }) | |
| 1792 | + //获取订单的总数这个接口不能用 | |
| 1793 | + for (i = 0; i < teamgroup.length; i++) { | |
| 1794 | + await getApp().request.promiseGet("/api/weshop/order/page", { | |
| 1597 | 1795 | data: { |
| 1598 | - store_id: os.stoid, pageSize: 3, page: 1, | |
| 1599 | - state: 2, | |
| 1600 | - team_id: prom_id | |
| 1796 | + store_id: os.stoid, | |
| 1797 | + pt_status: 1, | |
| 1798 | + pt_listno: teamgroup[i].listno | |
| 1601 | 1799 | } |
| 1602 | 1800 | }).then(res => { |
| 1603 | - teamgroup = res.data.data.pageData; | |
| 1604 | - grounp_tatal = res.data.data.total; | |
| 1801 | + var order = res.data.data.pageData; | |
| 1802 | + teamgroup[i].open_num = order.length; | |
| 1605 | 1803 | }) |
| 1606 | - //获取订单的总数这个接口不能用 | |
| 1607 | - for (i = 0; i < teamgroup.length; i++) { | |
| 1608 | - await getApp().request.promiseGet("/api/weshop/order/page", { | |
| 1609 | - data: { store_id: os.stoid, pt_status: 1, pt_listno: teamgroup[i].listno } | |
| 1610 | - }).then(res => { | |
| 1611 | - var order = res.data.data.pageData; | |
| 1612 | - teamgroup[i].open_num = order.length; | |
| 1613 | - }) | |
| 1614 | - await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => { | |
| 1615 | - var user = res.data.data; | |
| 1616 | - teamgroup[i].user = user; | |
| 1617 | - }) | |
| 1618 | - } | |
| 1804 | + await getApp().request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + teamgroup[i].openvipid, {}).then(res => { | |
| 1805 | + var user = res.data.data; | |
| 1806 | + teamgroup[i].user = user; | |
| 1807 | + }) | |
| 1808 | + } | |
| 1619 | 1809 | |
| 1620 | - if (teamgroup.length > 0) { | |
| 1621 | - th.setData({ teamgroup: teamgroup, grounp_tatal: grounp_tatal }); | |
| 1622 | - th.countDown2(); | |
| 1623 | - } | |
| 1810 | + if (teamgroup.length > 0) { | |
| 1811 | + th.setData({ | |
| 1812 | + teamgroup: teamgroup, | |
| 1813 | + grounp_tatal: grounp_tatal | |
| 1814 | + }); | |
| 1815 | + th.countDown2(); | |
| 1624 | 1816 | } |
| 1817 | + } | |
| 1625 | 1818 | }, |
| 1626 | 1819 | |
| 1627 | 1820 | //---小于10的格式化函数---- |
| ... | ... | @@ -1631,7 +1824,7 @@ Page({ |
| 1631 | 1824 | |
| 1632 | 1825 | //----倒计时函数----- |
| 1633 | 1826 | countDown(time, prom_st) { |
| 1634 | - if(!this.data.is_timer) return false; | |
| 1827 | + if (!this.data.is_timer) return false; | |
| 1635 | 1828 | var th = this; |
| 1636 | 1829 | // 获取当前时间,同时得到活动结束时间数组 |
| 1637 | 1830 | var endTime = time; |
| ... | ... | @@ -1736,8 +1929,8 @@ Page({ |
| 1736 | 1929 | if (tt.data.code == 0) { |
| 1737 | 1930 | map.set(gd.goods_id, g_buy_num); |
| 1738 | 1931 | th.setData({ |
| 1739 | - g_buy_num: map, | |
| 1740 | - prom_buy_num: tt.data.data.goodsbuynum, | |
| 1932 | + g_buy_num: map, | |
| 1933 | + prom_buy_num: tt.data.data.goodsbuynum, | |
| 1741 | 1934 | }); |
| 1742 | 1935 | "function" == typeof func && func(); |
| 1743 | 1936 | } |
| ... | ... | @@ -1778,10 +1971,17 @@ Page({ |
| 1778 | 1971 | |
| 1779 | 1972 | //--点击弹起拼单-- |
| 1780 | 1973 | openSpecModel_pt: function(e) { |
| 1974 | + | |
| 1975 | + | |
| 1976 | + this.setData({ open_ind_store: 4});//拼团直接给4 | |
| 1977 | + | |
| 1978 | + | |
| 1781 | 1979 | //--先判断会员状态-- |
| 1782 | - var user_info=getApp().globalData.userInfo; | |
| 1783 | - if(user_info==null || user_info.mobile==undefined || user_info.mobile=="" || user_info.mobile==null){ | |
| 1784 | - wx.navigateTo({ url: '/pages/getphone/getphone', }) | |
| 1980 | + var user_info = getApp().globalData.userInfo; | |
| 1981 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
| 1982 | + wx.navigateTo({ | |
| 1983 | + url: '/pages/getphone/getphone', | |
| 1984 | + }) | |
| 1785 | 1985 | return false; |
| 1786 | 1986 | } |
| 1787 | 1987 | |
| ... | ... | @@ -1814,7 +2014,7 @@ Page({ |
| 1814 | 2014 | pageSize: 1, |
| 1815 | 2015 | page: 1 |
| 1816 | 2016 | }, |
| 1817 | - success: function (e) { | |
| 2017 | + success: function(e) { | |
| 1818 | 2018 | //--跳转到已经购买的情况-- |
| 1819 | 2019 | if (e.data.data.pageData.length > 0) { |
| 1820 | 2020 | var odr = e.data.data.pageData[0]; |
| ... | ... | @@ -1823,12 +2023,12 @@ Page({ |
| 1823 | 2023 | wx.showModal({ |
| 1824 | 2024 | title: "您已经购买了该商品待支付中", |
| 1825 | 2025 | success: function(a) { |
| 1826 | - if(a.confirm){ | |
| 1827 | - wx.navigateTo({ | |
| 1828 | - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | |
| 1829 | - }); | |
| 1830 | - } | |
| 1831 | - } | |
| 2026 | + if (a.confirm) { | |
| 2027 | + wx.navigateTo({ | |
| 2028 | + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | |
| 2029 | + }); | |
| 2030 | + } | |
| 2031 | + } | |
| 1832 | 2032 | }); |
| 1833 | 2033 | } else if (odr.pt_status == 1 && odr.order_status == 1) { |
| 1834 | 2034 | wx.navigateTo({ |
| ... | ... | @@ -1841,8 +2041,7 @@ Page({ |
| 1841 | 2041 | }); |
| 1842 | 2042 | } |
| 1843 | 2043 | |
| 1844 | - } | |
| 1845 | - else{ | |
| 2044 | + } else { | |
| 1846 | 2045 | th.setData({ |
| 1847 | 2046 | is_normal: ind, |
| 1848 | 2047 | openSpecModal_pt: 1 |
| ... | ... | @@ -1855,30 +2054,33 @@ Page({ |
| 1855 | 2054 | |
| 1856 | 2055 | //-----------------拼单生成方法--------------------- |
| 1857 | 2056 | addCart_pt: function() { |
| 1858 | - var th=this; | |
| 1859 | - if(this.data.is_normal==0){ | |
| 1860 | - //看一下有没有起购数,如果有起购数,要计算起购数 | |
| 1861 | - var qnum=parseFloat(th.data.prom_act.minbuynum); | |
| 1862 | - if(qnum>0 && th.data.goodsInputNum<qnum ){ | |
| 1863 | - getApp().confirmBox("拼团商品至少要买"+qnum+"件!"); | |
| 1864 | - return false; | |
| 1865 | - } | |
| 2057 | + var th = this; | |
| 2058 | + if (this.data.is_normal == 0) { | |
| 2059 | + //看一下有没有起购数,如果有起购数,要计算起购数 | |
| 2060 | + var qnum = parseFloat(th.data.prom_act.minbuynum); | |
| 2061 | + if (qnum > 0 && th.data.goodsInputNum < qnum) { | |
| 2062 | + getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); | |
| 2063 | + return false; | |
| 2064 | + } | |
| 1866 | 2065 | |
| 1867 | - th.addcart_pt_func(); | |
| 1868 | - }else{ | |
| 2066 | + th.addcart_pt_func(); | |
| 2067 | + } else { | |
| 1869 | 2068 | th.addcart_pt_func(); |
| 1870 | 2069 | } |
| 1871 | 2070 | }, |
| 1872 | 2071 | |
| 1873 | - addcart_pt_func:function(){ | |
| 2072 | + addcart_pt_func: function() { | |
| 1874 | 2073 | if (oo.user_id == null) { |
| 1875 | - s.my_warnning("还未登录!",0,this);return; | |
| 2074 | + s.my_warnning("还未登录!", 0, this); | |
| 2075 | + return; | |
| 1876 | 2076 | } |
| 1877 | - var e = this, th = e,o = this.data.sele_g; | |
| 1878 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!",0,th); | |
| 2077 | + var e = this, | |
| 2078 | + th = e, | |
| 2079 | + o = this.data.sele_g; | |
| 2080 | + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | |
| 1879 | 2081 | |
| 1880 | 2082 | //----------添加到购物车时,要判断限购数量,-------- |
| 1881 | - e.get_buy_num(o,async function(ee) { | |
| 2083 | + e.get_buy_num(o, async function(ee) { | |
| 1882 | 2084 | |
| 1883 | 2085 | //---判断商品是否超出限购--- |
| 1884 | 2086 | if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
| ... | ... | @@ -1901,28 +2103,29 @@ Page({ |
| 1901 | 2103 | } |
| 1902 | 2104 | } |
| 1903 | 2105 | |
| 1904 | - var redis_num=0 | |
| 1905 | - //-------判断活动是否抢光--------- | |
| 1906 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/"+th.data.sele_g.prom_id , { | |
| 1907 | - 1: 1 | |
| 1908 | - }).then(res => { | |
| 1909 | - redis_num=res.data.data; | |
| 1910 | - }) | |
| 2106 | + var redis_num = 0 | |
| 2107 | + //-------判断活动是否抢光--------- | |
| 2108 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, { | |
| 2109 | + 1: 1 | |
| 2110 | + }).then(res => { | |
| 2111 | + redis_num = res.data.data; | |
| 2112 | + }) | |
| 1911 | 2113 | |
| 1912 | - if(th.data.goodsInputNum>redis_num){ | |
| 1913 | - wx.showModal({ | |
| 1914 | - title: '提示',content: '超出商品活动库存' | |
| 1915 | - }); | |
| 1916 | - return false; | |
| 1917 | - } | |
| 2114 | + if (th.data.goodsInputNum > redis_num) { | |
| 2115 | + wx.showModal({ | |
| 2116 | + title: '提示', | |
| 2117 | + content: '超出商品活动库存' | |
| 2118 | + }); | |
| 2119 | + return false; | |
| 2120 | + } | |
| 1918 | 2121 | |
| 1919 | - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0",0,th); | |
| 1920 | - if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存",0,th); | |
| 2122 | + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | |
| 2123 | + if (th.data.goodsInputNum > o.store_count) return s.my_warnning("超出商品库存", 0, th); | |
| 1921 | 2124 | if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) |
| 1922 | 2125 | this.setData({ |
| 1923 | 2126 | sto_sele_name: "" |
| 1924 | 2127 | }); |
| 1925 | - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店",0,th); | |
| 2128 | + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | |
| 1926 | 2129 | //--------------此时操作的数据------------ |
| 1927 | 2130 | var newd = { |
| 1928 | 2131 | goods_id: o.goods_id, |
| ... | ... | @@ -1947,8 +2150,8 @@ Page({ |
| 1947 | 2150 | if (newd.kt_type > 1) { |
| 1948 | 2151 | newd.is_pt_tz = 1; //开团类型 |
| 1949 | 2152 | } |
| 1950 | - if (newd.kt_type == 3 && th.data.is_normal!=1){ | |
| 1951 | - th.data.sto_sele_distr=1; | |
| 2153 | + if (newd.kt_type == 3 && th.data.is_normal != 1) { | |
| 2154 | + th.data.sto_sele_distr = 1; | |
| 1952 | 2155 | } |
| 1953 | 2156 | |
| 1954 | 2157 | } else if (th.data.prom_type == 3) { |
| ... | ... | @@ -1973,14 +2176,14 @@ Page({ |
| 1973 | 2176 | |
| 1974 | 2177 | //-------跳转pt商品------- |
| 1975 | 2178 | go_to_nopay: function() { |
| 1976 | - var th=this; | |
| 2179 | + var th = this; | |
| 1977 | 2180 | wx.navigateTo({ |
| 1978 | 2181 | url: "/pages/user/order_detail/order_detail?order_id=" + th.data.buy_order.order_id, |
| 1979 | 2182 | }); |
| 1980 | 2183 | }, |
| 1981 | 2184 | //-------跳转pt teamshow------- |
| 1982 | 2185 | go_to_team_show: function() { |
| 1983 | - var th=this; | |
| 2186 | + var th = this; | |
| 1984 | 2187 | wx.navigateTo({ |
| 1985 | 2188 | url: "/pages/team/team_success/team_success?ordersn=" + th.data.buy_order.order_sn, |
| 1986 | 2189 | }); |
| ... | ... | @@ -1988,7 +2191,7 @@ Page({ |
| 1988 | 2191 | |
| 1989 | 2192 | //---拼团倒计时--- |
| 1990 | 2193 | countDown2() { |
| 1991 | - if(!this.data.is_timer) return false; | |
| 2194 | + if (!this.data.is_timer) return false; | |
| 1992 | 2195 | var th = this; |
| 1993 | 2196 | // 获取当前时间,同时得到活动结束时间数组 |
| 1994 | 2197 | var newTime = ut.gettimestamp(); |
| ... | ... | @@ -2014,7 +2217,10 @@ Page({ |
| 2014 | 2217 | } else { |
| 2015 | 2218 | //活动已结束,全部设置为'00' |
| 2016 | 2219 | obj = { |
| 2017 | - day: '00',hou: '00',min: '00', sec: '00' | |
| 2220 | + day: '00', | |
| 2221 | + hou: '00', | |
| 2222 | + min: '00', | |
| 2223 | + sec: '00' | |
| 2018 | 2224 | } |
| 2019 | 2225 | } |
| 2020 | 2226 | var txt = "timer[" + j + "]"; |
| ... | ... | @@ -2025,11 +2231,11 @@ Page({ |
| 2025 | 2231 | setTimeout(th.countDown2, 1000); |
| 2026 | 2232 | }, |
| 2027 | 2233 | //跳转参加团 |
| 2028 | - go_cj_team:function (e) { | |
| 2029 | - var ind=e.currentTarget.dataset.ind; | |
| 2030 | - var item=this.data.teamgroup[ind]; | |
| 2031 | - var id=item.id; | |
| 2032 | - var th=this; | |
| 2234 | + go_cj_team: function(e) { | |
| 2235 | + var ind = e.currentTarget.dataset.ind; | |
| 2236 | + var item = this.data.teamgroup[ind]; | |
| 2237 | + var id = item.id; | |
| 2238 | + var th = this; | |
| 2033 | 2239 | |
| 2034 | 2240 | getApp().request.get("/api/weshop/order/page", { |
| 2035 | 2241 | data: { |
| ... | ... | @@ -2040,205 +2246,231 @@ Page({ |
| 2040 | 2246 | page: 1 |
| 2041 | 2247 | }, |
| 2042 | 2248 | success: function(e) { |
| 2043 | - if (e.data.code != 0) { | |
| 2044 | - getApp().my_warnning("读取订单失败",0,th); | |
| 2045 | - return fasle; | |
| 2046 | - } | |
| 2047 | - //--跳转到已经购买的情况-- | |
| 2048 | - if ( e.data.data.pageData.length > 0) { | |
| 2049 | - var odr = e.data.data.pageData[0]; | |
| 2050 | - //还未支付 | |
| 2051 | - if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0) ) { | |
| 2052 | - wx.showModal({ | |
| 2053 | - title: "您已经购买了该商品待支付中", | |
| 2054 | - success: function(a) { | |
| 2055 | - if(a.confirm){ | |
| 2056 | - wx.navigateTo({ | |
| 2057 | - url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | |
| 2058 | - }); | |
| 2059 | - } | |
| 2060 | - } | |
| 2061 | - }); | |
| 2062 | - }else if (odr.pt_status == 1 && odr.order_status == 1){ | |
| 2063 | - wx.navigateTo({ | |
| 2064 | - url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, | |
| 2065 | - }); | |
| 2066 | - }else{ | |
| 2067 | - wx.navigateTo({ | |
| 2068 | - url: "/pages/team/team_show/team_show?tg_id="+id, | |
| 2069 | - }); | |
| 2070 | - } | |
| 2071 | - } | |
| 2072 | - //--跳转到参团-- | |
| 2073 | - else{ | |
| 2249 | + if (e.data.code != 0) { | |
| 2250 | + getApp().my_warnning("读取订单失败", 0, th); | |
| 2251 | + return fasle; | |
| 2252 | + } | |
| 2253 | + //--跳转到已经购买的情况-- | |
| 2254 | + if (e.data.data.pageData.length > 0) { | |
| 2255 | + var odr = e.data.data.pageData[0]; | |
| 2256 | + //还未支付 | |
| 2257 | + if (odr.pt_status == 0 && (odr.order_status == 1 || odr.order_status == 0)) { | |
| 2258 | + wx.showModal({ | |
| 2259 | + title: "您已经购买了该商品待支付中", | |
| 2260 | + success: function(a) { | |
| 2261 | + if (a.confirm) { | |
| 2262 | + wx.navigateTo({ | |
| 2263 | + url: "/pages/user/order_detail/order_detail?order_id=" + odr.order_id, | |
| 2264 | + }); | |
| 2265 | + } | |
| 2266 | + } | |
| 2267 | + }); | |
| 2268 | + } else if (odr.pt_status == 1 && odr.order_status == 1) { | |
| 2074 | 2269 | wx.navigateTo({ |
| 2075 | - url: "/pages/team/team_show/team_show?tg_id="+id, | |
| 2270 | + url: "/pages/team/team_success/team_success?ordersn=" + odr.order_sn, | |
| 2271 | + }); | |
| 2272 | + } else { | |
| 2273 | + wx.navigateTo({ | |
| 2274 | + url: "/pages/team/team_show/team_show?tg_id=" + id, | |
| 2076 | 2275 | }); |
| 2077 | 2276 | } |
| 2277 | + } | |
| 2278 | + //--跳转到参团-- | |
| 2279 | + else { | |
| 2280 | + wx.navigateTo({ | |
| 2281 | + url: "/pages/team/team_show/team_show?tg_id=" + id, | |
| 2282 | + }); | |
| 2283 | + } | |
| 2078 | 2284 | } |
| 2079 | 2285 | }) |
| 2080 | 2286 | |
| 2081 | 2287 | }, |
| 2082 | 2288 | |
| 2083 | - //跳到团更多 | |
| 2084 | - go_t_more:function(){ | |
| 2085 | - var team_id=this.data.prom_id; | |
| 2086 | - wx.navigateTo({ | |
| 2087 | - url: "/pages/team/team_more/team_more?team_id="+team_id, | |
| 2088 | - }); | |
| 2089 | - }, | |
| 2289 | + //跳到团更多 | |
| 2290 | + go_t_more: function() { | |
| 2291 | + var team_id = this.data.prom_id; | |
| 2292 | + wx.navigateTo({ | |
| 2293 | + url: "/pages/team/team_more/team_more?team_id=" + team_id, | |
| 2294 | + }); | |
| 2295 | + }, | |
| 2090 | 2296 | |
| 2091 | - //--点赞功能-- | |
| 2092 | - click_zan:function (e) { | |
| 2093 | - var com_id=e.currentTarget.dataset.com_id; | |
| 2094 | - var item_id=e.currentTarget.dataset.item_id; | |
| 2095 | - var app=getApp(),th=this; | |
| 2297 | + //--点赞功能-- | |
| 2298 | + click_zan: function(e) { | |
| 2299 | + var com_id = e.currentTarget.dataset.com_id; | |
| 2300 | + var item_id = e.currentTarget.dataset.item_id; | |
| 2301 | + var app = getApp(), | |
| 2302 | + th = this; | |
| 2096 | 2303 | |
| 2097 | - if(app.globalData.userInfo==null || app.globalData.userInfo==undefined ){ | |
| 2098 | - app.confirmBox("您还未登录"); | |
| 2099 | - return false; | |
| 2100 | - } | |
| 2304 | + if (app.globalData.userInfo == null || app.globalData.userInfo == undefined) { | |
| 2305 | + app.confirmBox("您还未登录"); | |
| 2306 | + return false; | |
| 2307 | + } | |
| 2101 | 2308 | |
| 2102 | - var iszan=th.data.comments[item_id].userZanNum; | |
| 2103 | - if(this.data.iszaning) return false; | |
| 2104 | - this.data.iszaning=1; | |
| 2309 | + var iszan = th.data.comments[item_id].userZanNum; | |
| 2310 | + if (this.data.iszaning) return false; | |
| 2311 | + this.data.iszaning = 1; | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + app.request.post("/api/weshop/commentZan/save", { | |
| 2315 | + data: { | |
| 2316 | + store_id: o.stoid, | |
| 2317 | + user_id: app.globalData.user_id, | |
| 2318 | + goods_id: th.data.gid, | |
| 2319 | + comment_id: com_id | |
| 2320 | + }, | |
| 2321 | + success: function(ee) { | |
| 2105 | 2322 | |
| 2323 | + if (ee.data.code == "-1") { | |
| 2324 | + app.my_warnning("不能给自己点赞", 0, th); | |
| 2325 | + th.data.iszaning = 0; | |
| 2326 | + return; | |
| 2327 | + } | |
| 2106 | 2328 | |
| 2107 | - app.request.post("/api/weshop/commentZan/save",{ | |
| 2108 | - data:{store_id:o.stoid,user_id:app.globalData.user_id,goods_id:th.data.gid,comment_id:com_id}, | |
| 2109 | - success:function (ee) { | |
| 2329 | + if (ee.data.code == 0 && iszan != 1) { | |
| 2330 | + var num = th.data.comments[item_id].zan_num; | |
| 2331 | + num++; | |
| 2332 | + var text = "comments[" + item_id + "].zan_num"; | |
| 2333 | + var text1 = "comments[" + item_id + "].userZanNum"; | |
| 2334 | + var _errObj = {}; | |
| 2335 | + _errObj[text] = num; | |
| 2336 | + _errObj[text1] = 1; | |
| 2337 | + th.setData(_errObj); | |
| 2110 | 2338 | |
| 2111 | - if (ee.data.code == "-1") { | |
| 2112 | - app.my_warnning("不能给自己点赞", 0, th); | |
| 2113 | - th.data.iszaning=0; | |
| 2114 | - return; | |
| 2115 | - } | |
| 2339 | + } else { | |
| 2340 | + var num = th.data.comments[item_id].zan_num; | |
| 2341 | + num--; | |
| 2342 | + var text = "comments[" + item_id + "].zan_num"; | |
| 2343 | + var text1 = "comments[" + item_id + "].userZanNum"; | |
| 2344 | + var _errObj = {}; | |
| 2345 | + _errObj[text] = num; | |
| 2346 | + _errObj[text1] = 0; | |
| 2347 | + th.setData(_errObj); | |
| 2348 | + } | |
| 2116 | 2349 | |
| 2117 | - if(ee.data.code==0 && iszan!=1){ | |
| 2118 | - var num=th.data.comments[item_id].zan_num; num++; | |
| 2119 | - var text="comments["+item_id+"].zan_num"; | |
| 2120 | - var text1="comments["+item_id+"].userZanNum"; | |
| 2121 | - var _errObj = {}; | |
| 2122 | - _errObj[text]=num; | |
| 2123 | - _errObj[text1]=1; | |
| 2124 | - th.setData(_errObj); | |
| 2125 | - | |
| 2126 | - }else{ | |
| 2127 | - var num=th.data.comments[item_id].zan_num; num--; | |
| 2128 | - var text="comments["+item_id+"].zan_num"; | |
| 2129 | - var text1="comments["+item_id+"].userZanNum"; | |
| 2130 | - var _errObj = {}; | |
| 2131 | - _errObj[text]=num; | |
| 2132 | - _errObj[text1]=0; | |
| 2133 | - th.setData(_errObj); | |
| 2134 | - } | |
| 2350 | + setTimeout(function() { | |
| 2351 | + th.data.iszaning = 0; | |
| 2352 | + }, 500) | |
| 2135 | 2353 | |
| 2136 | - setTimeout(function(){ | |
| 2137 | - th.data.iszaning = 0; | |
| 2138 | - },500) | |
| 2139 | - | |
| 2140 | - } | |
| 2141 | - }) | |
| 2142 | - }, | |
| 2354 | + } | |
| 2355 | + }) | |
| 2356 | + }, | |
| 2143 | 2357 | |
| 2144 | 2358 | /*----券的开关---*/ |
| 2145 | - switchCoupon:async function(event){ | |
| 2359 | + switchCoupon: async function(event) { | |
| 2146 | 2360 | var coupon = event.currentTarget.dataset.coupon; |
| 2147 | - var app=getApp(); | |
| 2148 | - var url="/api/weshop/prom/coupon/pageCouponList"; | |
| 2149 | - var quan_list=this.data.quan_list; | |
| 2150 | - var th=this; | |
| 2361 | + var app = getApp(); | |
| 2362 | + var url = "/api/weshop/prom/coupon/pageCouponList"; | |
| 2363 | + var quan_list = this.data.quan_list; | |
| 2364 | + var th = this; | |
| 2151 | 2365 | |
| 2152 | 2366 | //当开启,且列表为空的情况下要 |
| 2153 | - if(!quan_list && coupon=="1") { | |
| 2154 | - wx.showLoading(); | |
| 2155 | - await app.request.promiseGet(url, { | |
| 2156 | - data: { | |
| 2157 | - store_id: os.stoid, | |
| 2158 | - type: 1, | |
| 2159 | - pageSize: 100, | |
| 2160 | - page: 1, | |
| 2161 | - user_id:app.globalData.user_id | |
| 2162 | - } | |
| 2163 | - }).then(res => { | |
| 2164 | - wx.hideLoading(); | |
| 2165 | - quan_list = res.data.data.pageData; | |
| 2166 | - }) | |
| 2367 | + if (!quan_list && coupon == "1") { | |
| 2368 | + wx.showLoading(); | |
| 2369 | + await app.request.promiseGet(url, { | |
| 2370 | + data: { | |
| 2371 | + store_id: os.stoid, | |
| 2372 | + type: 1, | |
| 2373 | + pageSize: 100, | |
| 2374 | + page: 1, | |
| 2375 | + user_id: app.globalData.user_id | |
| 2376 | + } | |
| 2377 | + }).then(res => { | |
| 2378 | + wx.hideLoading(); | |
| 2379 | + quan_list = res.data.data.pageData; | |
| 2380 | + }) | |
| 2167 | 2381 | |
| 2168 | - if(quan_list){ | |
| 2169 | - for(var ind in quan_list){ | |
| 2170 | - var ep=quan_list[ind]; | |
| 2171 | - var start=ut.formatTime(ep.use_start_time,"yyyy-MM-dd"); | |
| 2172 | - var end=ut.formatTime(ep.use_end_time,"yyyy-MM-dd"); | |
| 2173 | - start=start.replace("00:00:00",""); | |
| 2174 | - end=end.replace("00:00:00",""); | |
| 2175 | - quan_list[ind].start=start; | |
| 2176 | - quan_list[ind].end=end; | |
| 2177 | - } | |
| 2382 | + if (quan_list) { | |
| 2383 | + for (var ind in quan_list) { | |
| 2384 | + var ep = quan_list[ind]; | |
| 2385 | + var start = ut.formatTime(ep.use_start_time, "yyyy-MM-dd"); | |
| 2386 | + var end = ut.formatTime(ep.use_end_time, "yyyy-MM-dd"); | |
| 2387 | + start = start.replace("00:00:00", ""); | |
| 2388 | + end = end.replace("00:00:00", ""); | |
| 2389 | + quan_list[ind].start = start; | |
| 2390 | + quan_list[ind].end = end; | |
| 2178 | 2391 | } |
| 2392 | + } | |
| 2179 | 2393 | |
| 2180 | - th.setData({coupon: coupon, quan_list: quan_list}); | |
| 2181 | - }else{ | |
| 2182 | - th.setData({coupon: coupon}); | |
| 2394 | + th.setData({ | |
| 2395 | + coupon: coupon, | |
| 2396 | + quan_list: quan_list | |
| 2397 | + }); | |
| 2398 | + } else { | |
| 2399 | + th.setData({ | |
| 2400 | + coupon: coupon | |
| 2401 | + }); | |
| 2183 | 2402 | } |
| 2184 | 2403 | }, |
| 2185 | 2404 | |
| 2186 | 2405 | //--查看评价-- |
| 2187 | - look_pj:function () { | |
| 2188 | - this.tabComment(); this.doScrollTop(); | |
| 2406 | + look_pj: function() { | |
| 2407 | + this.tabComment(); | |
| 2408 | + this.doScrollTop(); | |
| 2189 | 2409 | }, |
| 2190 | 2410 | |
| 2191 | 2411 | //-----领取券----- |
| 2192 | - get_quan:function (e) { | |
| 2193 | - var cid=e.currentTarget.dataset.cid; | |
| 2194 | - var index=e.currentTarget.dataset.ind; | |
| 2195 | - var item=this.data.quan_list[index]; | |
| 2196 | - | |
| 2412 | + get_quan: function(e) { | |
| 2413 | + var cid = e.currentTarget.dataset.cid; | |
| 2414 | + var index = e.currentTarget.dataset.ind; | |
| 2415 | + var item = this.data.quan_list[index]; | |
| 2416 | + | |
| 2197 | 2417 | //如果券还在领取中,不能再点 |
| 2198 | - if (item.linging==1){ | |
| 2418 | + if (item.linging == 1) { | |
| 2199 | 2419 | getApp().my_warnning('领取中..', 0, this); |
| 2200 | 2420 | return false; |
| 2201 | 2421 | } |
| 2202 | 2422 | |
| 2203 | 2423 | //如果领取的次数到了 |
| 2204 | - if(item.everyone_num>0 && item.lqnum>=item.everyone_num){ | |
| 2205 | - getApp().my_warnning('领取失败,您已领完该券',0,this); | |
| 2424 | + if (item.everyone_num > 0 && item.lqnum >= item.everyone_num) { | |
| 2425 | + getApp().my_warnning('领取失败,您已领完该券', 0, this); | |
| 2206 | 2426 | return false; |
| 2207 | 2427 | } |
| 2208 | 2428 | |
| 2209 | - var lq_num=item.lqnum; | |
| 2210 | - | |
| 2211 | - var pdata={'uid':oo.user_id,'cid':cid,'store_id':os.stoid,'type':5}; | |
| 2212 | - var app=getApp(),th=this; | |
| 2213 | - app.request.post("/api/weshop/couponList/saveCouponList",{ | |
| 2214 | - data:pdata, | |
| 2215 | - success:function (res) { | |
| 2216 | - if(res.data.code==0){ | |
| 2217 | - app.my_warnning("领取成功",1,th); | |
| 2218 | - lq_num++; | |
| 2219 | - var text="quan_list["+index+"].lqnum"; | |
| 2220 | - var text2 = "quan_list[" + index + "].linging"; | |
| 2221 | - var obj = {}; obj[text] = lq_num; obj[text2] = 0; | |
| 2222 | - th.setData(obj); | |
| 2223 | - }else{ | |
| 2224 | - app.confirmBox(res.data.msg); | |
| 2225 | - var text2 = "quan_list[" + index + "].linging"; | |
| 2226 | - var obj = {}; obj[text2] = 0; | |
| 2227 | - th.setData(obj); | |
| 2228 | - } | |
| 2429 | + var lq_num = item.lqnum; | |
| 2430 | + | |
| 2431 | + var pdata = { | |
| 2432 | + 'uid': oo.user_id, | |
| 2433 | + 'cid': cid, | |
| 2434 | + 'store_id': os.stoid, | |
| 2435 | + 'type': 5 | |
| 2436 | + }; | |
| 2437 | + var app = getApp(), | |
| 2438 | + th = this; | |
| 2439 | + app.request.post("/api/weshop/couponList/saveCouponList", { | |
| 2440 | + data: pdata, | |
| 2441 | + success: function(res) { | |
| 2442 | + if (res.data.code == 0) { | |
| 2443 | + app.my_warnning("领取成功", 1, th); | |
| 2444 | + lq_num++; | |
| 2445 | + var text = "quan_list[" + index + "].lqnum"; | |
| 2446 | + var text2 = "quan_list[" + index + "].linging"; | |
| 2447 | + var obj = {}; | |
| 2448 | + obj[text] = lq_num; | |
| 2449 | + obj[text2] = 0; | |
| 2450 | + th.setData(obj); | |
| 2451 | + } else { | |
| 2452 | + app.confirmBox(res.data.msg); | |
| 2453 | + var text2 = "quan_list[" + index + "].linging"; | |
| 2454 | + var obj = {}; | |
| 2455 | + obj[text2] = 0; | |
| 2456 | + th.setData(obj); | |
| 2229 | 2457 | } |
| 2458 | + } | |
| 2230 | 2459 | }) |
| 2231 | 2460 | }, |
| 2232 | 2461 | |
| 2233 | 2462 | //--定义的保存图片方法,分享团--- |
| 2234 | - saveImageToPhotosAlbum: function () { | |
| 2463 | + saveImageToPhotosAlbum: function() { | |
| 2235 | 2464 | //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 |
| 2236 | 2465 | var type = this.data.prom_type; |
| 2237 | 2466 | if (type == 6) type = 2; |
| 2238 | 2467 | if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3; |
| 2239 | 2468 | |
| 2240 | - wx.showLoading({ title: '生成中...', }) | |
| 2241 | - var that = this, th = that; | |
| 2469 | + wx.showLoading({ | |
| 2470 | + title: '生成中...', | |
| 2471 | + }) | |
| 2472 | + var that = this, | |
| 2473 | + th = that; | |
| 2242 | 2474 | //设置画板显示,才能开始绘图 |
| 2243 | 2475 | that.setData({ |
| 2244 | 2476 | canvasHidden: false |
| ... | ... | @@ -2255,9 +2487,9 @@ Page({ |
| 2255 | 2487 | //读取文件成功则OK-- |
| 2256 | 2488 | wx.getImageInfo({ |
| 2257 | 2489 | src: path3, |
| 2258 | - success: function (res) { | |
| 2490 | + success: function(res) { | |
| 2259 | 2491 | //回调写法 |
| 2260 | - th.get_head_temp(th.get_goods_temp, function () { | |
| 2492 | + th.get_head_temp(th.get_goods_temp, function() { | |
| 2261 | 2493 | var vpath = res.path; |
| 2262 | 2494 | var context = wx.createCanvasContext('share'); |
| 2263 | 2495 | //先画背景 |
| ... | ... | @@ -2272,14 +2504,14 @@ Page({ |
| 2272 | 2504 | var tj_path = "../../../images/share/q_tj.png"; |
| 2273 | 2505 | context.drawImage(tj_path, 152 * unit + width, 54 * unit, 85 * unit, 30 * unit); |
| 2274 | 2506 | context.setFontSize(16 * unit) |
| 2275 | - context.setLineJoin('round'); //交点设置成圆角 | |
| 2507 | + context.setLineJoin('round'); //交点设置成圆角 | |
| 2276 | 2508 | context.setFillStyle("white") |
| 2277 | 2509 | context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit); |
| 2278 | 2510 | |
| 2279 | 2511 | //---产品名称--- |
| 2280 | 2512 | //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 |
| 2281 | 2513 | console.log("ssssssss", th.data.data.goods_name); |
| 2282 | - | |
| 2514 | + | |
| 2283 | 2515 | context.setFillStyle("black"); |
| 2284 | 2516 | context.setFontSize(21.3 * unit) |
| 2285 | 2517 | th.draw_Text(context, th.data.data.goods_name, |
| ... | ... | @@ -2308,7 +2540,7 @@ Page({ |
| 2308 | 2540 | context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit); |
| 2309 | 2541 | //-------大图后面就不一样了----------- |
| 2310 | 2542 | switch (type) { |
| 2311 | - case 0: //普通商品的展示 | |
| 2543 | + case 0: //普通商品的展示 | |
| 2312 | 2544 | //中间的几个字 |
| 2313 | 2545 | var g_path = "../../../images/share/s_gou.png"; |
| 2314 | 2546 | context.drawImage(g_path, 56 * unit, 670 * unit, 22 * unit, 22 * unit); |
| ... | ... | @@ -2338,7 +2570,7 @@ Page({ |
| 2338 | 2570 | //---二维吗图--- |
| 2339 | 2571 | context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); |
| 2340 | 2572 | break; |
| 2341 | - case 1: //秒杀商品的展示 | |
| 2573 | + case 1: //秒杀商品的展示 | |
| 2342 | 2574 | //---画线--- |
| 2343 | 2575 | context.setLineWidth(1 * unit) |
| 2344 | 2576 | context.moveTo(32 * unit, 670 * unit) |
| ... | ... | @@ -2346,7 +2578,7 @@ Page({ |
| 2346 | 2578 | context.stroke(); |
| 2347 | 2579 | |
| 2348 | 2580 | //画秒杀的图片 |
| 2349 | - var miaos_path='../../../images/share/miao_share.png'; | |
| 2581 | + var miaos_path = '../../../images/share/miao_share.png'; | |
| 2350 | 2582 | context.drawImage(miaos_path, 43 * unit, 700 * unit, 222 * unit, 40 * unit); |
| 2351 | 2583 | |
| 2352 | 2584 | //---文字--- |
| ... | ... | @@ -2358,7 +2590,7 @@ Page({ |
| 2358 | 2590 | context.drawImage(vpath, 380 * unit, 736 * unit, 120 * unit, 120 * unit); |
| 2359 | 2591 | break; |
| 2360 | 2592 | |
| 2361 | - case 2://会员团和商家团的展示 | |
| 2593 | + case 2: //会员团和商家团的展示 | |
| 2362 | 2594 | //---画线--- |
| 2363 | 2595 | context.setLineWidth(1 * unit) |
| 2364 | 2596 | context.moveTo(32 * unit, 670 * unit) |
| ... | ... | @@ -2393,7 +2625,7 @@ Page({ |
| 2393 | 2625 | //---二维吗图--- |
| 2394 | 2626 | context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit); |
| 2395 | 2627 | break |
| 2396 | - case 3://阶梯团的展示 | |
| 2628 | + case 3: //阶梯团的展示 | |
| 2397 | 2629 | //---画线--- |
| 2398 | 2630 | context.setLineWidth(1 * unit) |
| 2399 | 2631 | context.moveTo(32 * unit, 670 * unit) |
| ... | ... | @@ -2448,35 +2680,37 @@ Page({ |
| 2448 | 2680 | context.restore(); |
| 2449 | 2681 | |
| 2450 | 2682 | //把画板内容绘制成图片,并回调 画板图片路径 |
| 2451 | - context.draw(false, function () { | |
| 2452 | - setTimeout(function () { | |
| 2453 | - wx.canvasToTempFilePath({ | |
| 2454 | - x: 0, y: 0, | |
| 2455 | - width: 750, | |
| 2456 | - height: 1217, | |
| 2457 | - destWidth: 1.2 * 750 * 750 / that.data.screenWidth, | |
| 2458 | - destHeight: 1.2 * 1217 * 750 / that.data.screenWidth, | |
| 2459 | - canvasId: 'share', | |
| 2460 | - success: function (res) { | |
| 2461 | - that.setData({ | |
| 2462 | - shareImgPath: res.tempFilePath, canvasHidden: true | |
| 2463 | - }) | |
| 2464 | - if (!res.tempFilePath) { | |
| 2465 | - wx.showModal({ | |
| 2466 | - title: '提示', | |
| 2467 | - content: '图片绘制中,请稍后重试', | |
| 2468 | - showCancel: false | |
| 2469 | - }) | |
| 2470 | - return false; | |
| 2471 | - } | |
| 2472 | - wx.previewImage({ | |
| 2473 | - //将图片预览出来 | |
| 2474 | - urls: [that.data.shareImgPath] | |
| 2475 | - }); | |
| 2476 | - wx.hideLoading(); | |
| 2477 | - } | |
| 2478 | - }) | |
| 2479 | - },500) | |
| 2683 | + context.draw(false, function() { | |
| 2684 | + setTimeout(function() { | |
| 2685 | + wx.canvasToTempFilePath({ | |
| 2686 | + x: 0, | |
| 2687 | + y: 0, | |
| 2688 | + width: 750, | |
| 2689 | + height: 1217, | |
| 2690 | + destWidth: 1.2 * 750 * 750 / that.data.screenWidth, | |
| 2691 | + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth, | |
| 2692 | + canvasId: 'share', | |
| 2693 | + success: function(res) { | |
| 2694 | + that.setData({ | |
| 2695 | + shareImgPath: res.tempFilePath, | |
| 2696 | + canvasHidden: true | |
| 2697 | + }) | |
| 2698 | + if (!res.tempFilePath) { | |
| 2699 | + wx.showModal({ | |
| 2700 | + title: '提示', | |
| 2701 | + content: '图片绘制中,请稍后重试', | |
| 2702 | + showCancel: false | |
| 2703 | + }) | |
| 2704 | + return false; | |
| 2705 | + } | |
| 2706 | + wx.previewImage({ | |
| 2707 | + //将图片预览出来 | |
| 2708 | + urls: [that.data.shareImgPath] | |
| 2709 | + }); | |
| 2710 | + wx.hideLoading(); | |
| 2711 | + } | |
| 2712 | + }) | |
| 2713 | + }, 500) | |
| 2480 | 2714 | |
| 2481 | 2715 | }); |
| 2482 | 2716 | }); |
| ... | ... | @@ -2486,21 +2720,21 @@ Page({ |
| 2486 | 2720 | |
| 2487 | 2721 | |
| 2488 | 2722 | //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度 |
| 2489 | - draw_Text: function (ctx, str, leftWidth, initHeight, titleHeight, canvasWidth,unit) { | |
| 2723 | + draw_Text: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, unit) { | |
| 2490 | 2724 | var lineWidth = 0; |
| 2491 | 2725 | var lastSubStrIndex = 0; //每次开始截取的字符串的索引 |
| 2492 | - var han=0; | |
| 2726 | + var han = 0; | |
| 2493 | 2727 | for (let i = 0; i < str.length; i++) { |
| 2494 | - if(han==2) return; | |
| 2728 | + if (han == 2) return; | |
| 2495 | 2729 | //lineWidth += ctx.measureText(str[i]).width; |
| 2496 | 2730 | lineWidth += ut.measureText(str[i], 21.3 * unit); |
| 2497 | 2731 | if (lineWidth > canvasWidth) { |
| 2498 | 2732 | han++; |
| 2499 | - | |
| 2500 | - if (han==2) | |
| 2501 | - ctx.fillText(str.substring(lastSubStrIndex, i)+'...', leftWidth, initHeight); //绘制截取部分 | |
| 2733 | + | |
| 2734 | + if (han == 2) | |
| 2735 | + ctx.fillText(str.substring(lastSubStrIndex, i) + '...', leftWidth, initHeight); //绘制截取部分 | |
| 2502 | 2736 | else |
| 2503 | - ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | |
| 2737 | + ctx.fillText(str.substring(lastSubStrIndex, i), leftWidth, initHeight); | |
| 2504 | 2738 | |
| 2505 | 2739 | initHeight += 22; //22为字体的高度 |
| 2506 | 2740 | lineWidth = 0; |
| ... | ... | @@ -2515,15 +2749,17 @@ Page({ |
| 2515 | 2749 | |
| 2516 | 2750 | // ----视频图片---- |
| 2517 | 2751 | // 图片计数器 |
| 2518 | - swiperChange: function (e) { | |
| 2752 | + swiperChange: function(e) { | |
| 2519 | 2753 | var that = this; |
| 2520 | - if (e.detail.current>0){ | |
| 2754 | + if (e.detail.current > 0) { | |
| 2521 | 2755 | that.setData({ |
| 2522 | - hiddenn:1, videopicture:1, | |
| 2756 | + hiddenn: 1, | |
| 2757 | + videopicture: 1, | |
| 2523 | 2758 | }) |
| 2524 | - }else{ | |
| 2759 | + } else { | |
| 2525 | 2760 | that.setData({ |
| 2526 | - hiddenn:0,videopicture:0, | |
| 2761 | + hiddenn: 0, | |
| 2762 | + videopicture: 0, | |
| 2527 | 2763 | }) |
| 2528 | 2764 | } |
| 2529 | 2765 | if (e.detail.source == 'touch') { |
| ... | ... | @@ -2534,18 +2770,24 @@ Page({ |
| 2534 | 2770 | }, |
| 2535 | 2771 | |
| 2536 | 2772 | /*---视频相关--*/ |
| 2537 | - videopicture: function (e) { | |
| 2773 | + videopicture: function(e) { | |
| 2538 | 2774 | var vipi = e.currentTarget.dataset.vipi; |
| 2539 | - this.setData({ videopicture: vipi, swiperCurrent:vipi, noon: 0,current:1 }); | |
| 2775 | + this.setData({ | |
| 2776 | + videopicture: vipi, | |
| 2777 | + swiperCurrent: vipi, | |
| 2778 | + noon: 0, | |
| 2779 | + current: 1 | |
| 2780 | + }); | |
| 2540 | 2781 | }, |
| 2541 | 2782 | |
| 2542 | - videoPlay: function (e) { | |
| 2783 | + videoPlay: function(e) { | |
| 2543 | 2784 | var _index = e.currentTarget.id |
| 2544 | 2785 | this.setData({ |
| 2545 | - _index: _index, noon: 1 | |
| 2786 | + _index: _index, | |
| 2787 | + noon: 1 | |
| 2546 | 2788 | }) |
| 2547 | 2789 | |
| 2548 | - setTimeout(function () { | |
| 2790 | + setTimeout(function() { | |
| 2549 | 2791 | //将点击视频进行播放 |
| 2550 | 2792 | var videoContext = wx.createVideoContext(_index) |
| 2551 | 2793 | videoContext.play(); |
| ... | ... | @@ -2554,46 +2796,59 @@ Page({ |
| 2554 | 2796 | |
| 2555 | 2797 | |
| 2556 | 2798 | //--加载更多商品-- |
| 2557 | - requestRecommend: function () { | |
| 2558 | - var e = this, t = '/api/weshop/goods/page?page=1'; | |
| 2559 | - var th_recommend_list=e.data.recommend_list; | |
| 2560 | - getApp().request.get(t,{ | |
| 2561 | - data: { is_mainshow: 1, isonsale: 1, is_recommend:1, is_on_sale: 1, store_id: os.stoid, pageSize: 6 }, | |
| 2562 | - success:function (ee) { | |
| 2563 | - var recommend_list=ee.data.data.pageData; | |
| 2564 | - if(recommend_list && recommend_list.length>0){ | |
| 2565 | - var dd=[...th_recommend_list,...recommend_list]; | |
| 2566 | - e.setData({recommend_list,dd}); | |
| 2567 | - e.data.currentPage++; | |
| 2568 | - }else{ | |
| 2569 | - e.setData({nomore:1}); | |
| 2799 | + requestRecommend: function() { | |
| 2800 | + var e = this, | |
| 2801 | + t = '/api/weshop/goods/page?page=1'; | |
| 2802 | + var th_recommend_list = e.data.recommend_list; | |
| 2803 | + getApp().request.get(t, { | |
| 2804 | + data: { | |
| 2805 | + is_mainshow: 1, | |
| 2806 | + isonsale: 1, | |
| 2807 | + is_recommend: 1, | |
| 2808 | + is_on_sale: 1, | |
| 2809 | + store_id: os.stoid, | |
| 2810 | + pageSize: 6 | |
| 2811 | + }, | |
| 2812 | + success: function(ee) { | |
| 2813 | + var recommend_list = ee.data.data.pageData; | |
| 2814 | + if (recommend_list && recommend_list.length > 0) { | |
| 2815 | + var dd = [...th_recommend_list, ...recommend_list]; | |
| 2816 | + e.setData({ | |
| 2817 | + recommend_list, | |
| 2818 | + dd | |
| 2819 | + }); | |
| 2820 | + e.data.currentPage++; | |
| 2821 | + } else { | |
| 2822 | + e.setData({ | |
| 2823 | + nomore: 1 | |
| 2824 | + }); | |
| 2570 | 2825 | } |
| 2571 | 2826 | } |
| 2572 | 2827 | }) |
| 2573 | 2828 | }, |
| 2574 | 2829 | |
| 2575 | 2830 | //--获取头像的本地缓存,回调写法-- |
| 2576 | - get_head_temp:function (tt,func) { | |
| 2577 | - var ee=this; | |
| 2578 | - if(ee.data.share_head){ | |
| 2831 | + get_head_temp: function(tt, func) { | |
| 2832 | + var ee = this; | |
| 2833 | + if (ee.data.share_head) { | |
| 2579 | 2834 | tt(func); |
| 2580 | 2835 | return false; |
| 2581 | 2836 | } |
| 2582 | 2837 | //---获取分享图片的本地地址,头像和商品图片---- |
| 2583 | 2838 | var path2 = getApp().globalData.userInfo.head_pic; |
| 2584 | - if(path2==""){ | |
| 2585 | - ee.data.share_head ="../../../images/share/hui_hear_pic.png"; | |
| 2839 | + if (path2 == "") { | |
| 2840 | + ee.data.share_head = "../../../images/share/hui_hear_pic.png"; | |
| 2586 | 2841 | tt(func); |
| 2587 | - }else { | |
| 2588 | - path2=path2.replace("http://thirdwx.qlogo.cn","https://wx.qlogo.cn"); | |
| 2842 | + } else { | |
| 2843 | + path2 = path2.replace("http://thirdwx.qlogo.cn", "https://wx.qlogo.cn"); | |
| 2589 | 2844 | wx.getImageInfo({ |
| 2590 | 2845 | src: path2, |
| 2591 | - success: function (res) { | |
| 2846 | + success: function(res) { | |
| 2592 | 2847 | //res.path是网络图片的本地地址 |
| 2593 | 2848 | ee.data.share_head = res.path; |
| 2594 | - tt(func);; | |
| 2849 | + tt(func); | |
| 2595 | 2850 | }, |
| 2596 | - fail: function (res) { | |
| 2851 | + fail: function(res) { | |
| 2597 | 2852 | ee.data.share_head = "../../../images/share/hui_hear_pic.png"; //分享的图片不能用网络的 |
| 2598 | 2853 | tt(func); |
| 2599 | 2854 | } |
| ... | ... | @@ -2601,74 +2856,406 @@ Page({ |
| 2601 | 2856 | } |
| 2602 | 2857 | }, |
| 2603 | 2858 | //--获取商品图片的本地缓存,回调写法-- |
| 2604 | - get_goods_temp:function (tt) { | |
| 2605 | - var ee=this; | |
| 2606 | - if(ee.data.share_goods_img) { | |
| 2859 | + get_goods_temp: function(tt) { | |
| 2860 | + var ee = this; | |
| 2861 | + if (ee.data.share_goods_img) { | |
| 2607 | 2862 | tt(); |
| 2608 | 2863 | return false; |
| 2609 | 2864 | } |
| 2610 | 2865 | //获取商品是分享图信息 |
| 2611 | 2866 | wx.getImageInfo({ |
| 2612 | - src: ee.data.data.original_img, | |
| 2613 | - success: function (res) { | |
| 2867 | + src: ee.data.data.original_img, | |
| 2868 | + success: function(res) { | |
| 2614 | 2869 | //res.path是网络图片的本地地址 |
| 2615 | 2870 | ee.data.share_goods_img = res.path; |
| 2616 | 2871 | tt(); |
| 2617 | 2872 | }, |
| 2618 | - fail: function (res) { | |
| 2619 | - ee.data.share_goods_img= "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | |
| 2873 | + fail: function(res) { | |
| 2874 | + | |
| 2875 | + ee.data.share_goods_img = "../../../images/share/default_g_img.gif"; //分享的图片不能用网络的 | |
| 2620 | 2876 | tt(); |
| 2621 | 2877 | } |
| 2622 | 2878 | }); |
| 2623 | 2879 | }, |
| 2624 | 2880 | |
| 2625 | 2881 | //--外侧评价的点击效果--- |
| 2626 | - clik_evaluate:function(e){ | |
| 2627 | - var val=e.currentTarget.dataset.val; | |
| 2882 | + clik_evaluate: function(e) { | |
| 2883 | + var val = e.currentTarget.dataset.val; | |
| 2628 | 2884 | this.setData({ |
| 2629 | - activeCategoryId: 2, activeCategoryId3: val , comments: null | |
| 2885 | + activeCategoryId: 2, | |
| 2886 | + activeCategoryId3: val, | |
| 2887 | + comments: null | |
| 2630 | 2888 | }); |
| 2631 | - this.requestComments(); | |
| 2889 | + this.requestComments_new(); | |
| 2632 | 2890 | }, |
| 2633 | 2891 | |
| 2634 | 2892 | //--跳转到商品详情页面-- |
| 2635 | - go_goods: function (e) { | |
| 2893 | + go_goods: function(e) { | |
| 2636 | 2894 | var gid = e.currentTarget.dataset.gid; |
| 2637 | 2895 | var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + gid; |
| 2638 | 2896 | getApp().goto(url); |
| 2639 | 2897 | }, |
| 2640 | 2898 | |
| 2641 | 2899 | //--跳转到支付尾款界面-- |
| 2642 | - go_pay_wk:function () { | |
| 2643 | - var url = "/pages/cart/cart_wk/cart_wk?order_id="+ this.data.wk_order_id; | |
| 2900 | + go_pay_wk: function() { | |
| 2901 | + var url = "/pages/cart/cart_wk/cart_wk?order_id=" + this.data.wk_order_id; | |
| 2644 | 2902 | getApp().goto(url); |
| 2645 | 2903 | }, |
| 2646 | 2904 | |
| 2647 | - pop_err_img:function(e){ | |
| 2648 | - var txt = e.currentTarget.dataset.errorimg; | |
| 2649 | - var ob={}; | |
| 2650 | - ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; | |
| 2651 | - this.setData(ob); | |
| 2905 | + pop_err_img: function(e) { | |
| 2906 | + var txt = e.currentTarget.dataset.errorimg; | |
| 2907 | + var ob = {}; | |
| 2908 | + ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; | |
| 2909 | + this.setData(ob); | |
| 2652 | 2910 | }, |
| 2653 | 2911 | |
| 2654 | 2912 | //--调用更新阶梯团的接口-- |
| 2655 | - update_jiti:function(id){ | |
| 2656 | - var th=this; | |
| 2913 | + update_jiti: function(id) { | |
| 2914 | + var th = this; | |
| 2657 | 2915 | //--更新阶梯团-- |
| 2658 | - getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/"+os.stoid+"/"+id, { | |
| 2659 | - success: function (ee) { | |
| 2660 | - //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情-- | |
| 2661 | - if (ee.data.code==0) { | |
| 2662 | - th.setData({ | |
| 2663 | - user_order_pt_state: 3, | |
| 2664 | - }); | |
| 2665 | - }else if(ee.data.code==-1){ | |
| 2666 | - th.setData({ | |
| 2667 | - user_order_pt_state: 2, | |
| 2668 | - }); | |
| 2916 | + getApp().request.put("/api/weshop/teamgroup/updateTeamOrder/" + os.stoid + "/" + id, { | |
| 2917 | + success: function(ee) { | |
| 2918 | + //--等于0是要去支付尾款,接口调用失败,就要去查看参团详情-- | |
| 2919 | + if (ee.data.code == 0) { | |
| 2920 | + th.setData({ | |
| 2921 | + user_order_pt_state: 3, | |
| 2922 | + }); | |
| 2923 | + } else if (ee.data.code == -1) { | |
| 2924 | + th.setData({ | |
| 2925 | + user_order_pt_state: 2, | |
| 2926 | + }); | |
| 2927 | + } | |
| 2928 | + } | |
| 2929 | + }) | |
| 2930 | + }, | |
| 2931 | + // 选择门店 | |
| 2932 | + choice_store: function(ee) { | |
| 2933 | + var th = this; | |
| 2934 | + //var ind=ee.currentTarget.dataset.ind; | |
| 2935 | + var bconfig = th.data.bconfig; | |
| 2936 | + | |
| 2937 | + if (bconfig.is_sort_storage) { | |
| 2938 | + wx.getLocation({ | |
| 2939 | + type: 'wgs84', | |
| 2940 | + success: function(res) { | |
| 2941 | + | |
| 2942 | + th.data.lat = res.latitude; | |
| 2943 | + th.data.lon = res.longitude; | |
| 2944 | + th.data.is_get_local_ok = 1; | |
| 2945 | + th.setData({ | |
| 2946 | + is_gps: 1 | |
| 2947 | + }); | |
| 2948 | + //th.onShow(); | |
| 2949 | + th.get_sto(); | |
| 2950 | + }, | |
| 2951 | + fail: function(res) { | |
| 2952 | + //th.onShow(); | |
| 2953 | + th.get_sto(); | |
| 2954 | + if (res.errCode == 2) { | |
| 2955 | + th.setData({ | |
| 2956 | + is_gps: 0 | |
| 2957 | + }); | |
| 2958 | + if (th.data.is_gps == 0) { | |
| 2959 | + getApp().confirmBox("请开启GPS定位", null, 25000, !1); | |
| 2960 | + } | |
| 2961 | + } else { | |
| 2962 | + th.setData({ | |
| 2963 | + is_gps: "3" | |
| 2964 | + }); | |
| 2965 | + } | |
| 2966 | + | |
| 2967 | + th.data.is_get_local_ok = 1; | |
| 2968 | + } | |
| 2969 | + }) | |
| 2970 | + }else{ | |
| 2971 | + th.get_sto(); | |
| 2972 | + } | |
| 2973 | + | |
| 2974 | + this.setData({ | |
| 2975 | + //open_ind_store: ind, | |
| 2976 | + store: 1, | |
| 2977 | + openSpecModal: !1, | |
| 2978 | + openSpecModal_pt: !1 | |
| 2979 | + }) | |
| 2980 | + }, | |
| 2981 | + //关闭选择门店 | |
| 2982 | + close_popup: function(e) { | |
| 2983 | + | |
| 2984 | + this.setData({ | |
| 2985 | + store: 0, | |
| 2986 | + choice_sort_store: 0, | |
| 2987 | + sort_store: 0 | |
| 2988 | + }) | |
| 2989 | + }, | |
| 2990 | + //选择更多门店 | |
| 2991 | + more_store: function() { | |
| 2992 | + this.setData({ | |
| 2993 | + sort_store: 1 | |
| 2994 | + }); | |
| 2995 | + }, | |
| 2996 | + sort_store: function() { | |
| 2997 | + | |
| 2998 | + }, | |
| 2999 | + // 返回按钮 | |
| 3000 | + returns: function() { | |
| 3001 | + this.setData({ | |
| 3002 | + sort_store: 0, | |
| 3003 | + choice_sort_store: 0 | |
| 3004 | + }); | |
| 3005 | + }, | |
| 3006 | + //---选择分类门店--- | |
| 3007 | + choice_sort_store: function(e) { | |
| 3008 | + var index = e.currentTarget.dataset.index; | |
| 3009 | + var region_name = e.currentTarget.dataset.region; | |
| 3010 | + var item = this.data.all_sto[index]; | |
| 3011 | + this.setData({ | |
| 3012 | + region_name: region_name, | |
| 3013 | + sort_store: 0, | |
| 3014 | + choice_sort_store: 1, | |
| 3015 | + sec_sto: item, | |
| 3016 | + sec_pick_index: 0 | |
| 3017 | + }); | |
| 3018 | + }, | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + choose_for_store_fir: function(e) { | |
| 3023 | + var index_c = e.currentTarget.dataset.ind; | |
| 3024 | + | |
| 3025 | + this.setData({ | |
| 3026 | + fir_pick_index: index_c | |
| 3027 | + }) | |
| 3028 | + }, | |
| 3029 | + | |
| 3030 | + //确定def_pick为选择的门店 | |
| 3031 | + sure_pick: function(e) { | |
| 3032 | + var th = this; | |
| 3033 | + var item = null; | |
| 3034 | + var openindstore = th.data.open_ind_store; | |
| 3035 | + | |
| 3036 | + if (th.data.choice_sort_store == 0) { | |
| 3037 | + var index = th.data.fir_pick_index; | |
| 3038 | + if (th.data.is_show_sto_cat == 1) { | |
| 3039 | + item = th.data.def_pickpu_list[index]; | |
| 3040 | + } else { | |
| 3041 | + item = th.data.only_pk[index]; //当没有门店分类的时候 | |
| 3042 | + } | |
| 3043 | + | |
| 3044 | + } else { | |
| 3045 | + var index = th.data.sec_pick_index; | |
| 3046 | + item = th.data.sec_sto.s_arr[index]; | |
| 3047 | + } | |
| 3048 | + | |
| 3049 | + //th.setData({fir_pick_index:0}); | |
| 3050 | + console.log("选择门店刷新", "def_pick_store", item); | |
| 3051 | + th.setData({ | |
| 3052 | + def_pick_store: item, | |
| 3053 | + sto_sele_name: item.pickup_name, | |
| 3054 | + sto_sele_id: item.pickup_id, | |
| 3055 | + sto_sele_distr: item.distr_type, | |
| 3056 | + store: 0, | |
| 3057 | + choice_sort_store: 0, | |
| 3058 | + fir_pick_index: 0 | |
| 3059 | + }); | |
| 3060 | + | |
| 3061 | + if (openindstore == 1) { | |
| 3062 | + th.setData({ | |
| 3063 | + openSpecModal: !0, | |
| 3064 | + openSpecModal_ind: openindstore, | |
| 3065 | + }); | |
| 3066 | + } else if (openindstore == 2) { | |
| 3067 | + th.setData({ | |
| 3068 | + openSpecModal: !0, | |
| 3069 | + openSpecModal_ind: openindstore, | |
| 3070 | + }); | |
| 3071 | + } | |
| 3072 | + else if (openindstore == 4) { //4就是拼团 | |
| 3073 | + th.setData({ | |
| 3074 | + openSpecModal_pt: 1, //打开拼团购买界面 | |
| 3075 | + store: 0, //关闭门店 | |
| 3076 | + choice_sort_store: 0, //关闭门店2级 | |
| 3077 | + sort_store: 0, //关闭门店2级 | |
| 3078 | + }); | |
| 3079 | + } | |
| 3080 | + | |
| 3081 | + else { | |
| 3082 | + th.setData({ | |
| 3083 | + store: 0, | |
| 3084 | + choice_sort_store: 0, | |
| 3085 | + sort_store: 0 | |
| 3086 | + }) | |
| 3087 | + } | |
| 3088 | + | |
| 3089 | + }, | |
| 3090 | + //---点击二级之后的选择--- | |
| 3091 | + choose_for_store: function(e) { | |
| 3092 | + var index_c = e.currentTarget.dataset.ind; | |
| 3093 | + | |
| 3094 | + this.setData({ | |
| 3095 | + sec_pick_index: index_c, | |
| 3096 | + fir_pick_index: index_c | |
| 3097 | + }) | |
| 3098 | + }, | |
| 3099 | + //把选择的门店设置成默认的门店def_pick | |
| 3100 | + set_def_pick: function(e) { | |
| 3101 | + var th = this; | |
| 3102 | + var item = null; | |
| 3103 | + | |
| 3104 | + if (th.data.choice_sort_store == 0) { | |
| 3105 | + | |
| 3106 | + var index = th.data.fir_pick_index; | |
| 3107 | + | |
| 3108 | + if (th.data.is_show_sto_cat == 1) { | |
| 3109 | + item = th.data.def_pickpu_list[index]; | |
| 3110 | + } else { | |
| 3111 | + item = th.data.only_pk[index]; //当没有门店分类的时候 | |
| 3112 | + | |
| 3113 | + } | |
| 3114 | + } else { | |
| 3115 | + var index = th.data.sec_pick_index; | |
| 3116 | + item = th.data.sec_sto.s_arr[index]; | |
| 3117 | + } | |
| 3118 | + | |
| 3119 | + var store_id = o.stoid; | |
| 3120 | + var user_id = getApp().globalData.user_id; | |
| 3121 | + var def_pickup_id = item.pickup_id; | |
| 3122 | + | |
| 3123 | + getApp().request.put('/api/weshop/users/update', { | |
| 3124 | + data: { | |
| 3125 | + user_id, | |
| 3126 | + def_pickup_id | |
| 3127 | + }, | |
| 3128 | + success: function(res) { | |
| 3129 | + if (res.data.code == 0) { | |
| 3130 | + if (th.data.choice_sort_store == 0) th.setData({ | |
| 3131 | + fir_pick_index: 0 | |
| 3132 | + }); | |
| 3133 | + //s.showWarning("设置门店地址成功", null, 500, !1); | |
| 3134 | + getApp().globalData.pk_store = item; | |
| 3135 | + } else { | |
| 3136 | + console.log("门店地址失败"); | |
| 3137 | + //s.showWarning("设置默认门店地址失败", null, 500, !1); | |
| 3138 | + getApp().my_warnning("设置默认门店地址失败",0,th) | |
| 3139 | + } | |
| 3140 | + | |
| 3141 | + } | |
| 3142 | + }); | |
| 3143 | + | |
| 3144 | + th.setData({ | |
| 3145 | + def_pick_store: item, | |
| 3146 | + sto_sele_name: item.pickup_name, | |
| 3147 | + sto_sele_id: item.pickup_id, | |
| 3148 | + sto_sele_distr: item.distr_type, | |
| 3149 | + store: 0, | |
| 3150 | + choice_sort_store: 0 | |
| 3151 | + }); | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + var openindstore = th.data.open_ind_store; | |
| 3155 | + if (openindstore == 1) { | |
| 3156 | + th.setData({ | |
| 3157 | + openSpecModal: !0, | |
| 3158 | + openSpecModal_ind: openindstore, | |
| 3159 | + store: 0, | |
| 3160 | + choice_sort_store: 0, | |
| 3161 | + sort_store: 0, | |
| 3162 | + }); | |
| 3163 | + } else if (openindstore == 2) { | |
| 3164 | + th.setData({ | |
| 3165 | + openSpecModal: !0, | |
| 3166 | + openSpecModal_ind: openindstore, | |
| 3167 | + store: 0, | |
| 3168 | + choice_sort_store: 0, | |
| 3169 | + sort_store: 0, | |
| 3170 | + }); | |
| 3171 | + } | |
| 3172 | + else if (openindstore == 4) { //4就是拼团 | |
| 3173 | + th.setData({ | |
| 3174 | + openSpecModal_pt: 1, //打开拼团购买界面 | |
| 3175 | + store: 0, //关闭门店 | |
| 3176 | + choice_sort_store: 0, //关闭门店2级 | |
| 3177 | + sort_store: 0, //关闭门店2级 | |
| 3178 | + }); | |
| 3179 | + } | |
| 3180 | + | |
| 3181 | + else { | |
| 3182 | + th.setData({ | |
| 3183 | + store: 0, | |
| 3184 | + choice_sort_store: 0, | |
| 3185 | + sort_store: 0, | |
| 3186 | + }) | |
| 3187 | + } | |
| 3188 | + | |
| 3189 | + }, | |
| 3190 | + | |
| 3191 | + wait_for_store_config: function() { | |
| 3192 | + var th = this; | |
| 3193 | + var t_time = setInterval(function() { | |
| 3194 | + if (th.data.bconfig == null) false; | |
| 3195 | + var e = th.data.bconfig; | |
| 3196 | + if (e.is_sort_storage) { | |
| 3197 | + wx.getLocation({ | |
| 3198 | + type: 'wgs84', | |
| 3199 | + success: function(res) { | |
| 3200 | + th.data.lat = res.latitude; | |
| 3201 | + th.data.lon = res.longitude; | |
| 3202 | + th.data.is_get_local_ok = 1; | |
| 3203 | + }, | |
| 3204 | + fail: function(res) { | |
| 3205 | + if (res.errCode == 2) { | |
| 3206 | + th.setData({ | |
| 3207 | + is_gps: 0 | |
| 3208 | + }); | |
| 3209 | + if (th.data.is_gps == 0) { | |
| 3210 | + getApp().confirmBox("请开启GPS定位", null, 10000, !1); | |
| 3211 | + } | |
| 3212 | + | |
| 3213 | + } else { | |
| 3214 | + th.setData({ | |
| 3215 | + is_gps: "3" | |
| 3216 | + }); | |
| 2669 | 3217 | } |
| 2670 | - } | |
| 3218 | + | |
| 3219 | + th.data.is_get_local_ok = 1; | |
| 3220 | + } | |
| 3221 | + }) | |
| 3222 | + } else { | |
| 3223 | + th.data.is_get_local_ok = 1; | |
| 3224 | + } | |
| 3225 | + clearInterval(t_time); | |
| 3226 | + }, 500) | |
| 3227 | + }, | |
| 3228 | + //显示全部 | |
| 3229 | + toggleHandler: function(e) { | |
| 3230 | + var that = this, | |
| 3231 | + index = e.currentTarget.dataset.index; | |
| 3232 | + for (var i = 0; i < that.data.comments.length; i++) { | |
| 3233 | + if (index == i) { | |
| 3234 | + for (var i = 0; i < that.data.comments.length; i++) { | |
| 3235 | + that.data.comments[index].auto = true; | |
| 3236 | + that.data.comments[index].seeMore = false; | |
| 3237 | + } | |
| 3238 | + } | |
| 3239 | + } | |
| 3240 | + that.setData({ | |
| 3241 | + comments: that.data.comments | |
| 2671 | 3242 | }) |
| 2672 | - } | |
| 3243 | + }, | |
| 3244 | + | |
| 3245 | + //收起更多 | |
| 3246 | + toggleContent: function(e) { | |
| 3247 | + var that = this, | |
| 3248 | + index = e.currentTarget.dataset.index; | |
| 3249 | + for (var i = 0; i < that.data.comments.length; i++) { | |
| 3250 | + if (index == i) { | |
| 3251 | + that.data.comments[index].auto = true; | |
| 3252 | + that.data.comments[index].seeMore = true; | |
| 3253 | + } | |
| 3254 | + } | |
| 3255 | + that.setData({ | |
| 3256 | + comments: that.data.comments | |
| 3257 | + }) | |
| 3258 | + }, | |
| 3259 | + | |
| 2673 | 3260 | |
| 2674 | 3261 | }); |
| 2675 | 3262 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -2,13 +2,14 @@ |
| 2 | 2 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
| 3 | 3 | |
| 4 | 4 | <wxs module="" src="filter.wxs"></wxs> |
| 5 | +<!-- 商品内容区域,普通商品,秒杀,拼团 --> | |
| 5 | 6 | <block wx:if="{{isshow}}"> |
| 6 | 7 | <view class="container"> |
| 7 | 8 | <view class="type-navbar"> |
| 8 | 9 | <view class="type-box" wx:for="{{categories}}" wx:key="categories"> |
| 9 | 10 | <view bindtap="tabClick" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> |
| 10 | 11 | {{item.name}} |
| 11 | - </view> | |
| 12 | + </view> | |
| 12 | 13 | </view> |
| 13 | 14 | </view> |
| 14 | 15 | |
| ... | ... | @@ -43,7 +44,7 @@ |
| 43 | 44 | </view> |
| 44 | 45 | <view class="xc-video-picture abs"> |
| 45 | 46 | <view class="xc-video" data-vipi="0" bindtap="videopicture"> |
| 46 | - <view class=" {{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}"> | |
| 47 | + <view class="{{videopicture==0 ? 'xc-video-button':'xc-video-buttons'}} {{videopicture==0 ? 'xc-sn':''}}"> | |
| 47 | 48 | 视频 |
| 48 | 49 | </view> |
| 49 | 50 | </view> |
| ... | ... | @@ -253,7 +254,7 @@ |
| 253 | 254 | </view> |
| 254 | 255 | |
| 255 | 256 | <view class="goods-num" wx:if="{{prom_type!=1}}"> |
| 256 | - <view class="sales">销量:{{data.sales_sum}}件</view> | |
| 257 | + <view class="sales">销量:{{data.sales_sum}}件</view> | |
| 257 | 258 | <view class="stock">折扣:{{data.disc}}折</view> |
| 258 | 259 | <view class="stock">{{categories3[0].num}}人评价</view> |
| 259 | 260 | </view> |
| ... | ... | @@ -272,7 +273,7 @@ |
| 272 | 273 | </view> |
| 273 | 274 | </view> |
| 274 | 275 | </view> |
| 275 | - <view style='height:42rpx'></view> | |
| 276 | + | |
| 276 | 277 | <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0}}"> |
| 277 | 278 | {{data.goods_name}} |
| 278 | 279 | </view> |
| ... | ... | @@ -299,6 +300,37 @@ |
| 299 | 300 | |
| 300 | 301 | </view> |
| 301 | 302 | </block> |
| 303 | + | |
| 304 | + <!-- 门店收货地址 --> | |
| 305 | + <view class="xc-address_frame flex-vertical xc-ash {{def_pick_store!=null?'sn_height':'on_height'}}" > | |
| 306 | + <view class="address_frame" bindtap="choice_store" data-ind="0"> | |
| 307 | + <view class="flex-vertical-between "> | |
| 308 | + <view class="flex-vertical select_store_height"> | |
| 309 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 310 | + <view class="fs30 xc-ash-9f">选择门店</view> | |
| 311 | + </view> | |
| 312 | + <view class="red_bb fs32"> | |
| 313 | + 更多门店 | |
| 314 | + <text class="bg_jj"></text> | |
| 315 | + </view> | |
| 316 | + </view> | |
| 317 | + | |
| 318 | + <view wx:if="{{def_pick_store}}"> | |
| 319 | + <view class="flex-space-between address ai_end "> | |
| 320 | + <view> | |
| 321 | + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
| 322 | + </view> | |
| 323 | + <view class="distance fs24"wx:if="{{def_pick_store.distance!=null}}"> | |
| 324 | + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 325 | + | |
| 326 | + </view> | |
| 327 | + </view> | |
| 328 | + <view class="fs24 xc-ash-9f">地址:{{def_pick_store.fulladdress}}</view> | |
| 329 | + </view> | |
| 330 | + </view> | |
| 331 | + | |
| 332 | + </view> | |
| 333 | + | |
| 302 | 334 | <!--许程 7.24暂时注释 --> |
| 303 | 335 | <view wx:if="{{prom_type!=1&&prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1}}"> |
| 304 | 336 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> |
| ... | ... | @@ -340,16 +372,16 @@ |
| 340 | 372 | <view class="xc_comment-left"> |
| 341 | 373 | <view class="xc_comment-user"> |
| 342 | 374 | <view class="xc_user-img"> |
| 343 | - <image class="xc_imgs" src='{{item.head_pic}}' binderror="bind_bnerr2" data-errorimg="fir_comments[{{index}}].head_pic"></image> | |
| 375 | + <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> | |
| 344 | 376 | </view> |
| 345 | 377 | |
| 346 | 378 | <view class="xc_user"> |
| 347 | - <view class="xc_user-name five-level-word">{{item.username}}</view> | |
| 379 | + <view class="xc_user-name five-level-word">{{item.is_anonymous!=1?item.username:'匿名'}}</view> | |
| 348 | 380 | <image class="xc_comment-img" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> |
| 349 | 381 | </view> |
| 350 | 382 | </view> |
| 351 | - <view class="xc_comment-font pj_word_size ellipsis-3"> | |
| 352 | - {{item.content?item.content:''}} | |
| 383 | + <view class="xc_comment-font pj_word_size ellipsis-2"> | |
| 384 | + {{item.content?item.content:''}} | |
| 353 | 385 | </view> |
| 354 | 386 | <view class="xc_comment-val"> |
| 355 | 387 | <view class="xc_comment-time">{{item.add_time}}</view> |
| ... | ... | @@ -357,7 +389,8 @@ |
| 357 | 389 | </view> |
| 358 | 390 | </view> |
| 359 | 391 | <view class="xc_goods-img-frame"> |
| 360 | - <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> | |
| 392 | + <image wx:if="{{item.img[0]!=undefined && item.img[0]!=null}}" class="xc_goods-img" src='{{iurl+item.img[0]}}'></image> | |
| 393 | + <image wx:elif="{{item.weapp_img[0]!=undefined && item.weapp_img[0]!=null}}" class="xc_goods-img" src='{{item.weapp_img[0]}}'></image> | |
| 361 | 394 | <image wx:else class="xc_goods-img" src='{{gallery[0].image_url}}'></image> |
| 362 | 395 | </view> |
| 363 | 396 | </view> |
| ... | ... | @@ -480,7 +513,7 @@ |
| 480 | 513 | |
| 481 | 514 | </view> |
| 482 | 515 | |
| 483 | - <!------------商品详情图片页面--------------> | |
| 516 | + <!------------商品详情图片页面----------------> | |
| 484 | 517 | <view class="goods-norms" hidden="{{activeCategoryId==1?false:true}}"> |
| 485 | 518 | <view class="table_s"> |
| 486 | 519 | <view class="tb_item tb-l"> |
| ... | ... | @@ -553,7 +586,7 @@ |
| 553 | 586 | <template is="wxParse" data="{{wxParseData:content.nodes}}"></template> |
| 554 | 587 | </view> |
| 555 | 588 | </view> |
| 556 | - <!------------评价页面--------------> | |
| 589 | + <!---------------评价页面--------------> | |
| 557 | 590 | <view class="goods-comment" hidden="{{activeCategoryId==2?false:true}}"> |
| 558 | 591 | <view class="topframe"> |
| 559 | 592 | <view class="topframe-top"> |
| ... | ... | @@ -573,26 +606,33 @@ |
| 573 | 606 | <view style='border-bottom:4rpx solid #eee;'> |
| 574 | 607 | <view class="middle"> |
| 575 | 608 | <view class="middle-img-frame"> |
| 576 | - <image class="middle-img" src="{{item.head_pic}}" binderror="bind_bnerr2" data-errorimg="comments[{{cIdx}}].head_pic"></image> | |
| 609 | + <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> | |
| 577 | 610 | <view class="middle-user-frame"> |
| 578 | - <view class="middle-user">{{item.username==''?'匿名用户':item.username}}</view> | |
| 611 | + <view class="middle-user">{{item.username==''||item.is_anonymous==1 ?'匿名用户':item.username}}</view> | |
| 579 | 612 | <image class="star" src="{{iurl}}/miniapp/images/star-red.png" wx:for="{{item.sum_rank}}" wx:key="{{index}}"></image> |
| 580 | 613 | </view> |
| 581 | 614 | </view> |
| 582 | 615 | <view class="xc-pirces"> |
| 583 | - <text class="middle-font"> | |
| 616 | + <view class="middle-font {{item.seeMore==true?'ellipsis-3':''}}" > | |
| 584 | 617 | {{item.content?item.content:''}} |
| 585 | - </text> | |
| 618 | + </view> | |
| 586 | 619 | </view> |
| 620 | + <view wx:if='{{item.seeMore}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleHandler'>全部显示</view> | |
| 621 | + <view wx:if='{{!item.seeMore && item.auto}}' data-index='{{cIdx}}' class="s_btn fs30 red-co" catchtap='toggleContent'>收起</view> | |
| 587 | 622 | <view class="img-ul"> |
| 588 | - <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}"> | |
| 589 | - <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" | |
| 590 | - data-id="{{index}}" src="{{iurl}}{{item}}"></image> | |
| 591 | - </view> | |
| 592 | - </view> | |
| 593 | 623 | |
| 594 | - <view class="iddle-goods-img"> | |
| 595 | - <image bindtap="previewCommentImgs" class="goods-img" wx:for="{{item.img}}" wx:key="{{index}}" data-cidx="{{cIdx}}" data-id="{{index}}" src="{{iurl}}{{item}}"></image> | |
| 624 | + <block wx:if="{{item.source_type==0}}"> | |
| 625 | + <view class="img-li" wx:for="{{item.img}}" wx:key="{{index}}"> | |
| 626 | + <image bindtap="previewCommentImgs" class="wh100" data-cidx="{{cIdx}}" | |
| 627 | + data-id="{{index}}" src="{{iurl}}{{item}}"></image> | |
| 628 | + </view> | |
| 629 | + </block> | |
| 630 | + <block wx:if="{{item.source_type==1}}"> | |
| 631 | + <view class="img-li" wx:for="{{item.weapp_img}}" wx:if="{{aitem.length>10}}" wx:key="{{index}}" wx:for-item="aitem"> | |
| 632 | + <image bindtap="previewCommentImgs_w" class="wh100" data-cidx="{{cIdx}}" | |
| 633 | + data-id="{{index}}" src="{{aitem}}"></image> | |
| 634 | + </view> | |
| 635 | + </block> | |
| 596 | 636 | </view> |
| 597 | 637 | |
| 598 | 638 | <view class="z_parameter"> |
| ... | ... | @@ -614,8 +654,11 @@ |
| 614 | 654 | </view> |
| 615 | 655 | </view> |
| 616 | 656 | </block> |
| 617 | - <block wx:if="{{comments.length==0 && get_c}}"> | |
| 618 | - <text class="no_pj_list">暂无评价</text> | |
| 657 | + <block wx:if="{{(!comments || comments.length==0) && get_c }}"> | |
| 658 | + <text class="no_pj_list">暂无评价</text> | |
| 659 | + </block> | |
| 660 | + <block wx:if="{{comments.length>10 && comments_no_more}}"> | |
| 661 | + <text class="no_pj_list">已经加载到底部</text> | |
| 619 | 662 | </block> |
| 620 | 663 | </view> |
| 621 | 664 | </view> |
| ... | ... | @@ -624,6 +667,7 @@ |
| 624 | 667 | <view bindtap="doScrollTop" class="toTop" wx:if="{{supportPageScroll}}"> |
| 625 | 668 | <image class="wh100" src="{{iurl}}/miniapp/images/topup.png"></image> |
| 626 | 669 | </view> |
| 670 | + | |
| 627 | 671 | <!-------------------底部按钮--------------------> |
| 628 | 672 | <view class="join-cart"> |
| 629 | 673 | <view bindtap="contactService" class="custom-service cart-ico new_split"> |
| ... | ... | @@ -642,15 +686,19 @@ |
| 642 | 686 | <view>购物车</view> |
| 643 | 687 | </navigator> |
| 644 | 688 | </view> |
| 645 | - <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>--> | |
| 689 | + <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view> | |
| 690 | + | |
| 691 | + <!---- 普通商品购买 -----> | |
| 646 | 692 | <block wx:if="{{prom_type==0}}"> |
| 647 | 693 | |
| 648 | - <block wx:if="{{data.store_count>0}}"> | |
| 649 | - <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> | |
| 650 | - <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> | |
| 694 | + <block wx:if="{{sele_g.store_count>0}}"> | |
| 695 | + <view bindtap="openSpecModel" data-ind="1" class="join-btn cart-btn">加入购物车</view> | |
| 696 | + <view bindtap="openSpecModel" data-ind="2" class="buy-btn cart-btn">立即购买</view> | |
| 651 | 697 | </block> |
| 652 | - <block wx:else> | |
| 653 | - <view data-ind="1" class="join-btn cart-btn no_store">库存不足</view> | |
| 698 | + <block wx:else> | |
| 699 | + <view class="is_stock cart-btn is_stock xc-ash-b " style="width:55.5%"> | |
| 700 | + 库存不足 | |
| 701 | + </view> | |
| 654 | 702 | </block> |
| 655 | 703 | |
| 656 | 704 | </block> |
| ... | ... | @@ -722,51 +770,75 @@ |
| 722 | 770 | <nav_box></nav_box> |
| 723 | 771 | |
| 724 | 772 | </block> |
| 725 | - | |
| 726 | 773 | <!----弹起来,选择规格数量,普通商品购买和秒杀------> |
| 727 | 774 | <view hidden="{{!openSpecModal}}"> |
| 728 | 775 | <view bindtap="closeSpecModal" class="cover-layer"></view> |
| 729 | 776 | <view class="spec-model"> |
| 730 | - <view class="pding"> | |
| 731 | - <icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon> | |
| 777 | + <view class="pding"> | |
| 778 | + <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon> | |
| 732 | 779 | <view class="spec-goods"> |
| 733 | - <image class="wh100 spec-img" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | |
| 780 | + <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | |
| 734 | 781 | <view class="spec-goods-info"> |
| 735 | - <!--<view class="spec-goods-name">{{data.goods_name}}</view>--> | |
| 736 | - <view class="spec-goods-price" wx:if="{{prom_price==null}}">¥ {{sele_g.shop_price}}</view> | |
| 737 | - <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view> | |
| 782 | + <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view> | |
| 783 | + <view class="flex ai_end xc-val-money"> | |
| 784 | + <view class="spec-goods-price" wx:if="{{prom_price==null}}"><text class="fs20">¥</text>{{sele_g.shop_price}}</view> | |
| 785 | + <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view> | |
| 786 | + </view> | |
| 787 | + | |
| 738 | 788 | <block wx:if="{{prom_type==0}}"> |
| 789 | + <view class="flex"> | |
| 739 | 790 | <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> |
| 740 | 791 | <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> |
| 741 | - <view class="spec-goods-stock">已选:{{sele_g.gg}}</view> | |
| 792 | + | |
| 793 | + </view> | |
| 742 | 794 | </block> |
| 743 | 795 | <block wx:if="{{prom_type==1}}"> |
| 796 | + <view class="flex"> | |
| 744 | 797 | <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view> |
| 745 | 798 | <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view> |
| 746 | 799 | <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view> |
| 747 | - <view class="spec-goods-stock">已选:{{sele_g.gg}}</view> | |
| 800 | + | |
| 801 | + | |
| 802 | + </view> | |
| 748 | 803 | </block> |
| 749 | 804 | </view> |
| 750 | - </view> | |
| 805 | + | |
| 806 | + <!-- 选择门店模块 --> | |
| 807 | + <view class="flex-space-between address ai_end xc-width "> | |
| 808 | + | |
| 809 | + <view class="flex ai_end" wx:if="{{def_pick_store}}"> | |
| 810 | + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
| 811 | + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | |
| 812 | + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 813 | + | |
| 814 | + </view> | |
| 815 | + </view> | |
| 816 | + | |
| 817 | + <!-- 没有门店的时候 --> | |
| 818 | + <view class="flex" bindtap="choice_store"wx:else> | |
| 819 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 820 | + <view class="fs28 xc-ash-9f">选择门店</view> | |
| 821 | + </view> | |
| 822 | + | |
| 823 | + <view class="red-co fs28" bindtap="choice_store" > | |
| 824 | + 更多门店 | |
| 825 | + <text class="right-arrow"></text> | |
| 826 | + </view> | |
| 827 | + </view> | |
| 828 | + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view> | |
| 829 | + </view> | |
| 830 | + | |
| 751 | 831 | <!----商品的属性项目----> |
| 832 | + <view class="xc-goods-attribute"> | |
| 752 | 833 | <view hidden="{{ismend==1}}" class="spec-name">商品属性</view> |
| 753 | 834 | <view hidden="{{ismend==1}}" class="flex"> |
| 754 | 835 | <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"> |
| 755 | 836 | {{item.gg}} |
| 756 | 837 | </view> |
| 757 | 838 | </view> |
| 839 | +</view> | |
| 840 | + | |
| 758 | 841 | |
| 759 | - <!----点击选择门店的时候要隐藏----> | |
| 760 | - <view hidden="{{ismend==1}}"> | |
| 761 | - <view bindtap="getmendian" class="quhuo logistics-item"> | |
| 762 | - <view wx:if="{{sto_sele_name==''}}">取货门店 | |
| 763 | - <text class='small'>(选择门店)</text> | |
| 764 | - </view> | |
| 765 | - <view wx:else>取货门店({{sto_sele_name}})</view> | |
| 766 | - <view class="item-img"> | |
| 767 | - <image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image> | |
| 768 | - </view> | |
| 769 | - </view> | |
| 770 | 842 | <view class="b_num"> |
| 771 | 843 | <view>购买数量</view> |
| 772 | 844 | <view class="count"> |
| ... | ... | @@ -776,6 +848,14 @@ |
| 776 | 848 | </view> |
| 777 | 849 | </view> |
| 778 | 850 | </view> |
| 851 | + <view class="spec-cart-btns"> | |
| 852 | + | |
| 853 | + | |
| 854 | + <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn yellow fs32" data-action="add">加入购物车</view> | |
| 855 | + <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart"data-openSpecModal_ind="{{openSpecModal_ind}}" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | |
| 856 | + | |
| 857 | + </view> | |
| 858 | + | |
| 779 | 859 | <view class="clear"></view> |
| 780 | 860 | <!---选择门店的列表---> |
| 781 | 861 | <view hidden="{{ismend==0}}" class="sto_v"> |
| ... | ... | @@ -801,13 +881,7 @@ |
| 801 | 881 | </view> |
| 802 | 882 | </view> |
| 803 | 883 | </view> |
| 804 | - <view class="spec-cart-btns"> | |
| 805 | - <block> | |
| 806 | - <view wx:if="{{openSpecModal_ind==1}}" bindtap="addCart" class="spec-cart-btn spec-buy" data-action="add">加入购物车</view> | |
| 807 | - <view wx:if="{{openSpecModal_ind==2}}" bindtap="addCart" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | |
| 808 | - </block> | |
| 809 | - </view> | |
| 810 | - </view> | |
| 884 | + | |
| 811 | 885 | </view> |
| 812 | 886 | <!----弹起来,选择规格数量,拼单商品购买------> |
| 813 | 887 | <view hidden="{{!openSpecModal_pt}}"> |
| ... | ... | @@ -815,28 +889,64 @@ |
| 815 | 889 | <view class="spec-model"> |
| 816 | 890 | <view class="pding"> |
| 817 | 891 | <icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon> |
| 892 | + | |
| 893 | + <!-- 商品名称 --> | |
| 818 | 894 | <view class="spec-goods"> |
| 819 | - <image class="wh100 spec-img" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | |
| 895 | + <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image> | |
| 820 | 896 | <view class="spec-goods-info"> |
| 821 | - <!--<view class="spec-goods-name">{{data.goods_name}}</view>--> | |
| 822 | - <view class="spec-goods-price" wx:if="{{is_normal==1}}">¥ {{sele_g.shop_price}}</view> | |
| 823 | - <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view> | |
| 897 | + <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view> | |
| 898 | + <view class="flex ai_end xc-val-money"> | |
| 899 | + <view class="spec-goods-price" wx:if="{{is_normal==1}}">¥ {{sele_g.shop_price}}</view> | |
| 900 | + <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view> | |
| 901 | + </view> | |
| 824 | 902 | |
| 825 | - <block wx:if="{{is_normal==0}}"> | |
| 826 | - <view class="spec-goods-stock">已售:{{prom_act.buy_num}}</view> | |
| 827 | - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view> | |
| 828 | - <view class="spec-goods-stock">已选:{{sele_g.gg}}</view> | |
| 903 | + <block wx:if="{{is_normal==1}}"> | |
| 904 | + <view class="flex"> | |
| 905 | + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> | |
| 906 | + <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> | |
| 907 | + </view> | |
| 829 | 908 | </block> |
| 830 | - <block wx:else> | |
| 831 | - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view> | |
| 832 | - <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view> | |
| 833 | - <view class="spec-goods-stock">已选:{{sku_g_pt[0].gg}}</view> | |
| 909 | + <block wx:if="{{is_normal==0}}"> | |
| 910 | + <view class="flex"> | |
| 911 | + <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num}}</view> | |
| 912 | + <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view> | |
| 913 | + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view> | |
| 914 | + </view> | |
| 834 | 915 | </block> |
| 835 | 916 | </view> |
| 917 | + | |
| 918 | + </view> | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + <view style="clear: both"></view> | |
| 923 | + <view style="margin-top: 20rpx"> | |
| 924 | + <view class="flex-space-between address ai_end xc-width "> | |
| 925 | + | |
| 926 | + <view class="flex ai_end" wx:if="{{def_pick_store}}"> | |
| 927 | + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> | |
| 928 | + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> | |
| 929 | + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} | |
| 930 | + | |
| 931 | + </view> | |
| 932 | + </view> | |
| 933 | + | |
| 934 | + <!-- 没有门店的时候 --> | |
| 935 | + <view class="flex" bindtap="choice_store"wx:else> | |
| 936 | + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image> | |
| 937 | + <view class="fs28 xc-ash-9f">选择门店</view> | |
| 938 | + </view> | |
| 939 | + | |
| 940 | + <view class="red-co fs28" bindtap="choice_store" > | |
| 941 | + 更多门店 | |
| 942 | + <text class="right-arrow"></text> | |
| 943 | + </view> | |
| 944 | + </view> | |
| 945 | + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view> | |
| 836 | 946 | </view> |
| 837 | 947 | <!----商品的属性项目----> |
| 948 | + <view> | |
| 838 | 949 | <view hidden="{{ismend==1}}" class="spec-name">商品属性</view> |
| 839 | - | |
| 840 | 950 | <block wx:if="{{is_normal==0}}"> |
| 841 | 951 | <view hidden="{{ismend==1}}" class="flex"> |
| 842 | 952 | <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">{{item.gg}} |
| ... | ... | @@ -851,22 +961,26 @@ |
| 851 | 961 | </view> |
| 852 | 962 | </block> |
| 853 | 963 | <view class="clear"></view> |
| 964 | + </view> | |
| 854 | 965 | |
| 855 | - <view> | |
| 856 | - <view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}"> | |
| 857 | - <view wx:if="{{sto_sele_name==''}}">取货门店 | |
| 858 | - <text class='small'>(选择门店)</text> | |
| 859 | - </view> | |
| 860 | - <view wx:else>{{sto_sele_name}}</view> | |
| 861 | - <view class="item-img"> | |
| 862 | - <image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image> | |
| 863 | - </view> | |
| 864 | - </view> | |
| 865 | - <view class="b_num" hidden="{{ismend==1}}"> | |
| 966 | + | |
| 967 | + <view> | |
| 968 | + <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">--> | |
| 969 | + <!--<view wx:if="{{sto_sele_name==''}}">取货门店--> | |
| 970 | + <!--<text class='small'>(选择门店)</text>--> | |
| 971 | + <!--</view>--> | |
| 972 | + <!--<view wx:else>{{sto_sele_name}}</view>--> | |
| 973 | + <!--<view class="item-img">--> | |
| 974 | + <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>--> | |
| 975 | + <!--</view>--> | |
| 976 | + <!--</view>--> | |
| 977 | + | |
| 978 | + | |
| 979 | + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx"> | |
| 866 | 980 | <view>购买数量</view> |
| 867 | 981 | <view class="count"> |
| 868 | 982 | <view bindtap="subCartNum" class="sub">-</view> |
| 869 | - <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input> | |
| 983 | + <input bindblur="inputCartNum xc-val-fream" type="number" value="{{goodsInputNum}}"></input> | |
| 870 | 984 | <view bindtap="addCartNum" class="add">+</view> |
| 871 | 985 | </view> |
| 872 | 986 | </view> |
| ... | ... | @@ -896,12 +1010,13 @@ |
| 896 | 1010 | </view> |
| 897 | 1011 | </view> |
| 898 | 1012 | </view> |
| 899 | - </view> | |
| 1013 | + </view> | |
| 900 | 1014 | <view class="pt_qd"> |
| 901 | 1015 | <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view> |
| 902 | 1016 | </view> |
| 903 | 1017 | </view> |
| 904 | 1018 | </view> |
| 1019 | +<!----弹起来优惠信息------> | |
| 905 | 1020 | <view hidden="{{!openPromModal}}"> |
| 906 | 1021 | <view bindtap="closePromModal" class="cover-layer"></view> |
| 907 | 1022 | <view class="prom-model"> |
| ... | ... | @@ -991,9 +1106,151 @@ |
| 991 | 1106 | </view> |
| 992 | 1107 | </view> |
| 993 | 1108 | |
| 1109 | +<!-- 选择门店的弹框,1.1版最新的 --> | |
| 1110 | +<block wx:if="{{store==1}}"> | |
| 1111 | + <view class="mongolia-layer" bindtap="close_popup"></view> | |
| 1112 | + <view class="popup-frame"> | |
| 1113 | + <block wx:if="{{sort_store==0}}"> | |
| 1114 | + <!-- 头部 标题 --> | |
| 1115 | + <view class="popup-top flex-space-between"> | |
| 1116 | + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text> | |
| 1117 | + <view> | |
| 1118 | + <view> | |
| 1119 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 1120 | + </view> | |
| 1121 | + <view class="felx choose_more" bindtap="more_store"> | |
| 1122 | + <text class="fs26 red-co" wx:if="{{is_show_sto_cat}}">{{choice_sort_store==0?'更多门店':'返回'}}</text> | |
| 1123 | + <view class="bg_rights"></view> | |
| 1124 | + </view> | |
| 1125 | + </view> | |
| 1126 | + </view> | |
| 1127 | + <!-- 门店列表,最外层的门店列表,一开始 --> | |
| 1128 | + <view class="store-list"> | |
| 1129 | + <!--如果还没有点击更多门店的时候 --> | |
| 1130 | + <block wx:if="{{choice_sort_store==0}}"> | |
| 1131 | + <!-- 需要for循环 --> | |
| 1132 | + <block wx:if="is_show_sto_cat==1"> | |
| 1133 | + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 1134 | + <view class="store flex-vertical"> | |
| 1135 | + <!-- 需要点击事件 --> | |
| 1136 | + <block wx:if="{{index==fir_pick_index}}"> | |
| 1137 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 1138 | + </block> | |
| 1139 | + <block wx:else> | |
| 1140 | + <view class="circle xc-hooks"></view> | |
| 1141 | + </block> | |
| 1142 | + <view class="address-frame xc-ash"> | |
| 1143 | + <view class="flex-vertical-between butttem5"> | |
| 1144 | + <view class="flex xc-ash"> | |
| 1145 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 1146 | + </view> | |
| 1147 | + <view> | |
| 1148 | + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}"> | |
| 1149 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view> | |
| 1150 | + </view> | |
| 1151 | + </view> | |
| 1152 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 1153 | + </view> | |
| 1154 | + </view> | |
| 1155 | + </view> | |
| 1156 | + </block> | |
| 1157 | + <block wx:else> | |
| 1158 | + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
| 1159 | + <view class="store flex-vertical"> | |
| 1160 | + <!-- 需要点击事件 --> | |
| 1161 | + <block wx:if="{{index==fir_pick_index}}" > | |
| 1162 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 1163 | + </block> | |
| 1164 | + <block wx:else> | |
| 1165 | + <view class="circle xc-hooks"></view> | |
| 1166 | + </block> | |
| 1167 | + | |
| 1168 | + <view class="address-frame xc-ash"> | |
| 1169 | + <view class="flex-vertical-between "> | |
| 1170 | + <view class="flex xc-ash"> | |
| 1171 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 1172 | + </view> | |
| 1173 | + <view> | |
| 1174 | + <view class="distance fs24 address-val" | |
| 1175 | + wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
| 1176 | + </view> | |
| 1177 | + </view> | |
| 1178 | + </view> | |
| 1179 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 1180 | + </view> | |
| 1181 | + </view> | |
| 1182 | + </view> | |
| 1183 | + </block> | |
| 1184 | + </block> | |
| 1185 | + <block wx:else> <!-- 如果是点击选择门店分类后显示分类下的门店 --> | |
| 1186 | + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store"> | |
| 1187 | + <view class="store flex-vertical"> | |
| 1188 | + <!-- 需要点击事件 --> | |
| 1189 | + <block wx:if="{{index==sec_pick_index}}"> | |
| 1190 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
| 1191 | + </block> | |
| 1192 | + <block wx:else> | |
| 1193 | + <view class="circle xc-hooks"></view> | |
| 1194 | + </block> | |
| 1195 | + | |
| 1196 | + <view class="address-frame xc-ash"> | |
| 1197 | + <view class="flex-vertical-between "> | |
| 1198 | + <view class="flex xc-ash"> | |
| 1199 | + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 1200 | + </view> | |
| 1201 | + <view> | |
| 1202 | + <view class="distance fs24 address-val"wx:if="{{item.distance!=null}}"> 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view> | |
| 1203 | + </view> | |
| 1204 | + </view> | |
| 1205 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
| 1206 | + </view> | |
| 1207 | + </view> | |
| 1208 | + </view> | |
| 1209 | + </block> | |
| 1210 | + | |
| 1211 | + </view> | |
| 1212 | + | |
| 1213 | + <!-- 门店列表底部 --> | |
| 1214 | + <view class="store-bottom-frame"> | |
| 1215 | + <view class="store-bottom flex-vertical-between"> | |
| 1216 | + <view class="determine red-b fs28 white t-c" bindtap="sure_pick" | |
| 1217 | + data-openindstore="{{open_ind_store}}">确定</view> | |
| 1218 | + <view class="default t-c fs28" bindtap="set_def_pick"data-openindstore="{{open_ind_store}}">设为默认</view> | |
| 1219 | + </view> | |
| 1220 | + </view> | |
| 1221 | + | |
| 1222 | + </block> | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + <block wx:else> | |
| 1226 | + <view class="popup-top flex-space-between"> | |
| 1227 | + <text class="fs32 nearby_store">门店分类选择</text> | |
| 1228 | + <view> | |
| 1229 | + <view> | |
| 1230 | + <icon bindtap="close_popup" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
| 1231 | + </view> | |
| 1232 | + <view class="felx choose_mores" bindtap="returns"> | |
| 1233 | + <text class="fs26 red-co">返回</text> | |
| 1234 | + </view> | |
| 1235 | + </view> | |
| 1236 | + </view> | |
| 1237 | + <view class="sort_store_list"> | |
| 1238 | + | |
| 1239 | + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}"> | |
| 1240 | + <view class="sort-store flex-vertical-between" > | |
| 1241 | + <view class="fs30" di>{{item.name}}</view> | |
| 1242 | + <view class="black_rights-frame"> | |
| 1243 | + <view class="black_rights"></view> | |
| 1244 | + </view> | |
| 1245 | + </view> | |
| 1246 | + </view> | |
| 1247 | + | |
| 1248 | + </view> | |
| 1249 | + </block> | |
| 1250 | + </view> | |
| 1251 | +</block> | |
| 1252 | + | |
| 994 | 1253 | <!-- ---------------分享弹窗--------------- --> |
| 995 | 1254 | <!--二维码显示页面--> |
| 996 | 1255 | <canvas canvas-id='share' style='width:750rpx;height:1217rpx;' wx:if='{{!canvasHidden}}'></canvas> |
| 997 | - | |
| 998 | - | |
| 999 | 1256 | <warn id="warn"></warn> |
| 1000 | 1257 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxss
| ... | ... | @@ -26,6 +26,9 @@ image { |
| 26 | 26 | } |
| 27 | 27 | .type-navbar-item { |
| 28 | 28 | border-bottom: 4rpx solid #fff; |
| 29 | + display: flex; | |
| 30 | + justify-content: center; | |
| 31 | + width: 100%; | |
| 29 | 32 | } |
| 30 | 33 | .type-item-on { |
| 31 | 34 | border-bottom: 4rpx solid #333; |
| ... | ... | @@ -282,6 +285,7 @@ image { |
| 282 | 285 | width: 150rpx; |
| 283 | 286 | height: 150rpx; |
| 284 | 287 | margin-top: 8rpx; |
| 288 | + margin-right: 10rpx; | |
| 285 | 289 | } |
| 286 | 290 | |
| 287 | 291 | .comment-btn { |
| ... | ... | @@ -321,6 +325,9 @@ image { |
| 321 | 325 | height: 100rpx; |
| 322 | 326 | background-color: #fff; |
| 323 | 327 | text-align: center; |
| 328 | + z-index: 9; | |
| 329 | + border-top: 4rpx solid #eee; | |
| 330 | + | |
| 324 | 331 | } |
| 325 | 332 | |
| 326 | 333 | .join-cart>view { |
| ... | ... | @@ -355,7 +362,7 @@ image { |
| 355 | 362 | .cart-num { |
| 356 | 363 | position: absolute; |
| 357 | 364 | left: 50%; |
| 358 | - top: 0; | |
| 365 | + top: 1rpx; | |
| 359 | 366 | width: 40rpx; |
| 360 | 367 | height: 40rpx; |
| 361 | 368 | line-height: 40rpx; |
| ... | ... | @@ -368,11 +375,19 @@ image { |
| 368 | 375 | .cart-btn { |
| 369 | 376 | font-size: 28rpx; |
| 370 | 377 | color: #fff; |
| 371 | - line-height: 100rpx; | |
| 378 | + line-height: 70rpx; | |
| 379 | + margin-top: 16rpx; | |
| 380 | + | |
| 381 | + | |
| 372 | 382 | } |
| 373 | 383 | |
| 374 | 384 | .join-btn { |
| 375 | 385 | background-color: #ffb03f; |
| 386 | + height: 70rpx; | |
| 387 | +border-radius: 55rpx 0rpx 0rpx 55rpx; | |
| 388 | +margin-top: 16rpx; | |
| 389 | + | |
| 390 | + | |
| 376 | 391 | } |
| 377 | 392 | |
| 378 | 393 | view.cart-btn-lg { |
| ... | ... | @@ -381,6 +396,9 @@ view.cart-btn-lg { |
| 381 | 396 | |
| 382 | 397 | .buy-btn { |
| 383 | 398 | background-color: #f23030; |
| 399 | + height: 70rpx; | |
| 400 | +border-radius: 0 56rpx 55rpx 0; | |
| 401 | + | |
| 384 | 402 | } |
| 385 | 403 | |
| 386 | 404 | .toTop { |
| ... | ... | @@ -505,24 +523,23 @@ view.cart-btn-lg { |
| 505 | 523 | /* padding: 0 30rpx; */ |
| 506 | 524 | font-size: 32rpx; |
| 507 | 525 | box-sizing: border-box; |
| 508 | - | |
| 526 | + border-radius: 20rpx; | |
| 527 | + height: 72%; | |
| 509 | 528 | } |
| 510 | 529 | |
| 511 | 530 | .spec-model .pding{padding: 0 30rpx;} |
| 512 | 531 | |
| 513 | 532 | .spec-goods { |
| 514 | - padding: 15rpx 0 10rpx; | |
| 533 | + padding: 30rpx 0 20rpx; | |
| 515 | 534 | float: left; |
| 516 | 535 | width: 100%; |
| 517 | - border-bottom: 1px solid #f8f8f8; | |
| 536 | + border-bottom:2rpx solid #eee; | |
| 518 | 537 | } |
| 519 | 538 | |
| 520 | 539 | .spec-img { |
| 521 | 540 | float: left; |
| 522 | 541 | height: 186rpx; |
| 523 | 542 | width: 186rpx; |
| 524 | - position: relative; | |
| 525 | - top:-40rpx; | |
| 526 | 543 | border: 4rpx solid #eee |
| 527 | 544 | } |
| 528 | 545 | |
| ... | ... | @@ -542,7 +559,7 @@ view.cart-btn-lg { |
| 542 | 559 | } |
| 543 | 560 | |
| 544 | 561 | .spec-goods-price { |
| 545 | - color: #ec5151; | |
| 562 | + color: #d60021; | |
| 546 | 563 | font-size: 33rpx; |
| 547 | 564 | font-weight: bold; |
| 548 | 565 | } |
| ... | ... | @@ -551,6 +568,7 @@ view.cart-btn-lg { |
| 551 | 568 | margin-top: 3rpx; |
| 552 | 569 | font-size: 24rpx; |
| 553 | 570 | color: #999999; |
| 571 | + margin-right: 15rpx; | |
| 554 | 572 | } |
| 555 | 573 | |
| 556 | 574 | .spec-name { |
| ... | ... | @@ -568,7 +586,7 @@ view.cart-btn-lg { |
| 568 | 586 | position: fixed; |
| 569 | 587 | display: flex; |
| 570 | 588 | height: 50rpx; |
| 571 | - border: 1rpx solid #f8f8f8; | |
| 589 | + border: 1rpx solid #000; | |
| 572 | 590 | font-size: 28rpx; |
| 573 | 591 | right: 30rpx; |
| 574 | 592 | } |
| ... | ... | @@ -581,15 +599,15 @@ view.cart-btn-lg { |
| 581 | 599 | text-align: center; |
| 582 | 600 | } |
| 583 | 601 | .spec_bt{ |
| 584 | - background: fff;color: #333; margin-left: 10rpx;padding: 8rpx 12rpx; border-radius: 5px;font-size: 24rpx;border: 1rpx solid #ccc; | |
| 602 | + background: fff;color: #333; margin-left: 10rpx;padding: 4rpx 15rpx 4rpx; border-radius:30rpx;font-size: 24rpx;border: 1rpx solid #ccc; | |
| 585 | 603 | } |
| 586 | -.spec_bt.act{background: #C4182E;color: #fff;border: 1rpx solid #C4182E;} | |
| 604 | +.spec_bt.act{background: #d60021;color: #fff;border: 1rpx solid #d60021;} | |
| 587 | 605 | .sub { |
| 588 | - border-right: 1px solid #ddd; | |
| 606 | + border-right: 1px solid #000; | |
| 589 | 607 | } |
| 590 | 608 | |
| 591 | 609 | .add { |
| 592 | - border-left: 1px solid #ddd; | |
| 610 | + border-left: 1px solid #000; | |
| 593 | 611 | } |
| 594 | 612 | |
| 595 | 613 | .spec-btn { |
| ... | ... | @@ -611,22 +629,24 @@ view.cart-btn-lg { |
| 611 | 629 | } |
| 612 | 630 | |
| 613 | 631 | .spec-cart-btns { |
| 614 | - /* background-color: #f8f8f8; | |
| 615 | - margin: 40rpx -30rpx 0; | |
| 616 | - padding: 20rpx 34rpx; */ | |
| 617 | - float: left; | |
| 618 | - width: 100%; | |
| 619 | - line-height: 80rpx; | |
| 620 | - margin-top: 40rpx; | |
| 632 | + width: 92%; | |
| 633 | + line-height: 70rpx; | |
| 634 | + margin: 0rpx auto; | |
| 635 | + margin-top: 160rpx; | |
| 636 | + border-radius: 20rpx; | |
| 637 | +position: fixed; | |
| 638 | +bottom: 50rpx; | |
| 639 | +left: 4%; | |
| 640 | + | |
| 621 | 641 | } |
| 622 | 642 | |
| 623 | 643 | .spec-cart-btn { |
| 624 | - float: left; | |
| 625 | - width: 100%; | |
| 644 | + | |
| 645 | + width:100%; | |
| 626 | 646 | font-size: 30rpx; |
| 627 | 647 | text-align: center; |
| 628 | 648 | color: white; |
| 629 | - border-radius: 4rpx; | |
| 649 | + border-radius: 40rpx; | |
| 630 | 650 | } |
| 631 | 651 | |
| 632 | 652 | .spec-add-cart { |
| ... | ... | @@ -718,7 +738,8 @@ left:31rpx;} |
| 718 | 738 | |
| 719 | 739 | .pt_fir .pt_fir_title .js{padding: 0 15rpx;height: 40rpx;background:#e9030d; text-align: center; border-radius: 8rpx; color: #fff; margin-left: 10rpx;} |
| 720 | 740 | .pt_fir .pt_fir_title .tuannum{color: #e9030d; position: absolute; right: 20rpx; font-size: 26rpx;} |
| 721 | -.pding{padding-top: 20rpx;padding-left: 20rpx; padding-right: 20rpx;font-size: 26rpx;color: #ea120f} | |
| 741 | +.pding{padding-top: 20rpx;padding-left: 20rpx;height: 81%; | |
| 742 | + padding-right: 20rpx;font-size: 26rpx;color: #ea120f} | |
| 722 | 743 | .pdres{margin-left: 10rpx;color: #8f8f94} |
| 723 | 744 | .ptgz{position: relative;font-size: 30rpx;padding-left: 20rpx;margin-top: 10rpx; overflow: hidden } |
| 724 | 745 | .shuxian{width: 6rpx;height: 28rpx; background: #ea120f; display: inline-block;top: 5rpx;position: relative; margin-right: 5rpx} |
| ... | ... | @@ -741,7 +762,7 @@ left:31rpx;} |
| 741 | 762 | .wf .item .item_txy.hs{ background: #cbcbcb;} |
| 742 | 763 | .po{margin-bottom: 20rpx;} |
| 743 | 764 | |
| 744 | -.cart-btn.line-h{ line-height: 40rpx;} | |
| 765 | +.cart-btn.line-h{ line-height: 26rpx;} | |
| 745 | 766 | .cart-btn .fir-v{ margin-top: 10rpx;} |
| 746 | 767 | |
| 747 | 768 | .hyt{ padding: 0 20rpx; font-size: 30rpx; display: flex; align-items:center; margin-top: 10rpx;} |
| ... | ... | @@ -777,7 +798,7 @@ left:31rpx;} |
| 777 | 798 | .juzhong .xq .title .close{position: absolute;top: 0; right: 0; width: 45rpx; height: 45rpx;} |
| 778 | 799 | |
| 779 | 800 | .pt_qd{margin-top: 40rpx; height: auto;} |
| 780 | -.spec-cart-btn.w100{width: 100%; margin-left: 0; height: 80rpx; line-height: 80rpx;} | |
| 801 | +.spec-cart-btn.w100{width: 95%; margin-left: 0; height: 75rpx; line-height:75rpx;margin: auto; } | |
| 781 | 802 | |
| 782 | 803 | .sto_v{color: #333;} |
| 783 | 804 | .ellipsis{overflow: hidden; white-space: nowrap; text-overflow: ellipsis;} |
| ... | ... | @@ -927,14 +948,13 @@ left:31rpx;} |
| 927 | 948 | border-bottom: 3rpx solid #eee; border-top: 3rpx solid #eee; line-height: 100rpx } |
| 928 | 949 | |
| 929 | 950 | .bb_view{ display: flex;align-items: center;justify-content: space-between; padding: 0 34rpx; color: #333; |
| 930 | - font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:31rpx } | |
| 951 | + font-size: 32rpx; height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx } | |
| 931 | 952 | .red_bb{ color: #d70026; min-width:158rpx;width: auto;} |
| 932 | 953 | .bg_jj{ width: 18rpx; height:18rpx; |
| 933 | 954 | border-top: 2rpx solid #d70026; |
| 934 | 955 | border-right: 2rpx solid #d70026; |
| 935 | 956 | transform: rotate(45deg);display:inline-block; |
| 936 | 957 | margin-bottom:3rpx; |
| 937 | - | |
| 938 | 958 | } |
| 939 | 959 | /* 顶部边框 */ |
| 940 | 960 | .topframe{ |
| ... | ... | @@ -952,7 +972,7 @@ left:31rpx;} |
| 952 | 972 | margin-bottom: 36rpx; |
| 953 | 973 | color: #7d7d7d; |
| 954 | 974 | padding-left: 20rpx; |
| 955 | - font-size: 28rpx; | |
| 975 | + font-size: 32rpx; | |
| 956 | 976 | } |
| 957 | 977 | /*评价人数量*/ |
| 958 | 978 | .topframe .topframe-top .topframe-top-val{ |
| ... | ... | @@ -980,7 +1000,7 @@ left:31rpx;} |
| 980 | 1000 | |
| 981 | 1001 | .buttem-list .item{ |
| 982 | 1002 | min-width: 17%; |
| 983 | - font-size: 23rpx; | |
| 1003 | + font-size: 24rpx; | |
| 984 | 1004 | border-radius: 20rpx; |
| 985 | 1005 | background:#ffe3e2; |
| 986 | 1006 | height:38rpx; |
| ... | ... | @@ -996,16 +1016,11 @@ left:31rpx;} |
| 996 | 1016 | |
| 997 | 1017 | /* 用户评价 */ |
| 998 | 1018 | .middle{ |
| 999 | - | |
| 1000 | 1019 | width: 95%; |
| 1001 | - height:auto; | |
| 1002 | - | |
| 1003 | 1020 | margin:0 auto; |
| 1004 | - | |
| 1005 | - | |
| 1006 | 1021 | } |
| 1007 | 1022 | .middle-img-frame{ |
| 1008 | - height:65rp; | |
| 1023 | + height:65rpx; | |
| 1009 | 1024 | display: flex; |
| 1010 | 1025 | margin-top: 32rpx; |
| 1011 | 1026 | |
| ... | ... | @@ -1035,11 +1050,13 @@ left:31rpx;} |
| 1035 | 1050 | text-align: center; |
| 1036 | 1051 | margin-bottom:20rpx; |
| 1037 | 1052 | margin-left:5rpx; |
| 1038 | - | |
| 1053 | +} | |
| 1054 | +.xc-pirces{ | |
| 1055 | + margin-top: 14rpx; | |
| 1039 | 1056 | } |
| 1040 | 1057 | /* 评价文字 */ |
| 1041 | 1058 | .middle-font{ |
| 1042 | - font-size: 24rpx; | |
| 1059 | + font-size: 30rpx; | |
| 1043 | 1060 | |
| 1044 | 1061 | } |
| 1045 | 1062 | .iddle-goods-img{ |
| ... | ... | @@ -1065,11 +1082,12 @@ left:31rpx;} |
| 1065 | 1082 | height: 45rpx; |
| 1066 | 1083 | display:flex; |
| 1067 | 1084 | line-height: 45rpx; |
| 1085 | + margin-top: 20rpx; | |
| 1068 | 1086 | margin-bottom: 14rpx; |
| 1069 | 1087 | justify-content : space-between; |
| 1070 | 1088 | } |
| 1071 | 1089 | .parameter-font{ |
| 1072 | - font-size: 24rpx; | |
| 1090 | + font-size: 26rpx; | |
| 1073 | 1091 | |
| 1074 | 1092 | } |
| 1075 | 1093 | /* 规格 */ |
| ... | ... | @@ -1091,13 +1109,13 @@ left:31rpx;} |
| 1091 | 1109 | } |
| 1092 | 1110 | /* 点赞图片 */ |
| 1093 | 1111 | .parameter-img{ |
| 1094 | - width: 25rpx; | |
| 1095 | - height: 25rpx; | |
| 1112 | + width: 27rpx; | |
| 1113 | + height: 27rpx; | |
| 1096 | 1114 | margin-top: 3rpx; |
| 1097 | 1115 | } |
| 1098 | 1116 | .parameter-val{ |
| 1099 | 1117 | margin-left:25rpx; |
| 1100 | - font-size: 24rpx; | |
| 1118 | + font-size: 26rpx; | |
| 1101 | 1119 | color: #999; |
| 1102 | 1120 | } |
| 1103 | 1121 | /* 回复 */ |
| ... | ... | @@ -1170,7 +1188,7 @@ left:31rpx;} |
| 1170 | 1188 | width: 524rpx; |
| 1171 | 1189 | margin-left: 34rpx; |
| 1172 | 1190 | border-radius: 25rpx; |
| 1173 | - border: 1rpx solid #d6d4d5; | |
| 1191 | + border: 2rpx solid #d6d4d5; | |
| 1174 | 1192 | overflow: hidden; |
| 1175 | 1193 | } |
| 1176 | 1194 | |
| ... | ... | @@ -1197,19 +1215,20 @@ left:31rpx;} |
| 1197 | 1215 | margin-right: 5rpx |
| 1198 | 1216 | } |
| 1199 | 1217 | .xc_comment-font{ |
| 1200 | - height: 85rpx; | |
| 1218 | + height: 75rpx; | |
| 1201 | 1219 | margin-left: 22rpx; |
| 1202 | 1220 | white-space:normal; |
| 1203 | 1221 | overflow: hidden; |
| 1204 | 1222 | margin-top: 8rpx; |
| 1223 | + | |
| 1205 | 1224 | } |
| 1206 | 1225 | .xc_comment-val{ |
| 1207 | 1226 | width: 88%; |
| 1208 | 1227 | height: 30rpx; |
| 1209 | 1228 | margin-left: 22rpx; |
| 1210 | 1229 | display: flex; |
| 1211 | - margin-top: 28rpx; | |
| 1212 | - margin-bottom:8rpx; | |
| 1230 | + margin-top: 15rpx; | |
| 1231 | + margin-bottom:15rpx; | |
| 1213 | 1232 | } |
| 1214 | 1233 | |
| 1215 | 1234 | .xc_comment-time{ |
| ... | ... | @@ -1266,7 +1285,7 @@ left:31rpx;} |
| 1266 | 1285 | height: 100%; |
| 1267 | 1286 | line-height: 100rpx; |
| 1268 | 1287 | overflow: hidden; |
| 1269 | - margin-left: 7rpx; | |
| 1288 | + margin-left: 10rpx; | |
| 1270 | 1289 | } |
| 1271 | 1290 | .xc-coupon-fram{ |
| 1272 | 1291 | position: relative; |
| ... | ... | @@ -1306,7 +1325,7 @@ left:31rpx;} |
| 1306 | 1325 | padding-left:15rpx; |
| 1307 | 1326 | color: #d70025; |
| 1308 | 1327 | position: absolute; |
| 1309 | - right: 7rpx; | |
| 1328 | + right: 5rpx; | |
| 1310 | 1329 | } |
| 1311 | 1330 | |
| 1312 | 1331 | /* 自定义弹出窗口 */ |
| ... | ... | @@ -2221,9 +2240,247 @@ right:17rpx; top:55rpx; |
| 2221 | 2240 | .pd_top1{padding-top: 10rpx} |
| 2222 | 2241 | .s_ms_bth{margin-top: 85rpx} |
| 2223 | 2242 | |
| 2224 | -.xc-pirces{ | |
| 2225 | - height:40rpx; | |
| 2226 | - line-height:15rpx; | |
| 2243 | + | |
| 2244 | +.no_pj_list{text-align: center; width: 100%; color: #999; margin: 30rpx 0; display: inline-block; font-size: 28rpx} | |
| 2245 | +/* 门店地址 */ | |
| 2246 | +.xc-address_frame{ | |
| 2247 | + border-top:1rpx solid #eee; | |
| 2248 | + width: 100%; | |
| 2249 | + height: auto; | |
| 2250 | +} | |
| 2251 | +.on_height{ | |
| 2252 | +height: 90rpx; | |
| 2253 | +} | |
| 2254 | +.sn_height{ | |
| 2255 | + height: 170rpx; | |
| 2256 | +} | |
| 2257 | +.xc-address_frame .address_frame{ | |
| 2258 | + width: 92%; | |
| 2259 | +padding-left: 10rpx; | |
| 2260 | +margin: auto; | |
| 2261 | + | |
| 2262 | +} | |
| 2263 | +.shop_name{ | |
| 2264 | + | |
| 2265 | +} | |
| 2266 | +.stores-img{ | |
| 2267 | +width: 40rpx; | |
| 2268 | + height: 35rpx; | |
| 2269 | + margin-right: 10rpx; | |
| 2270 | +} | |
| 2271 | +.shop_name{ | |
| 2272 | + margin-right: 10rpx; | |
| 2273 | +} | |
| 2274 | +.address{ | |
| 2275 | + width: 87%; | |
| 2276 | + margin-top: 5rpx; | |
| 2277 | + margin-bottom: 5rpx; | |
| 2278 | +} | |
| 2279 | +.distance{ | |
| 2280 | + padding-left: 15rpx; | |
| 2281 | + padding-right: 15rpx; | |
| 2282 | + background: #eee; | |
| 2283 | + border-radius: 20rpx; | |
| 2284 | + margin-right: 5rpx; | |
| 2285 | + color: #999; | |
| 2286 | + height: 38rpx; | |
| 2287 | +line-height: 38rpx; | |
| 2288 | + | |
| 2289 | +} | |
| 2290 | +/* 选择门店的弹窗 */ | |
| 2291 | +.mongolia-layer{ | |
| 2292 | + position: fixed; | |
| 2293 | +left: 0; | |
| 2294 | +top: 0; | |
| 2295 | +right: 0; | |
| 2296 | +bottom: 0; | |
| 2297 | +z-index: 11; | |
| 2298 | +background: rgba(0,0,0,0.4); | |
| 2299 | +width: 100%; | |
| 2300 | +height: 91.9%; | |
| 2301 | + | |
| 2302 | +} | |
| 2303 | +.popup-frame{ | |
| 2304 | + position: fixed; | |
| 2305 | +bottom:99rpx; | |
| 2306 | +z-index: 20; | |
| 2307 | +background: white; | |
| 2308 | +width: 100%; | |
| 2309 | +border-radius: 20rpx 20rpx 0 0; | |
| 2310 | +height: 72%; | |
| 2311 | +} | |
| 2312 | +.popup-top{ | |
| 2313 | + border-bottom: 1rpx solid #eee; | |
| 2314 | + height: 155rpx; | |
| 2315 | + width: 95%; | |
| 2316 | + margin: auto; | |
| 2317 | + line-height: 155rpx; | |
| 2318 | + | |
| 2319 | +} | |
| 2320 | +.bg_rights{ | |
| 2321 | + border-top: 2rpx solid ; | |
| 2322 | + border-right: 2rpx solid ; | |
| 2323 | + transform: rotate(45deg); | |
| 2324 | + display:inline-block; | |
| 2325 | + width:15rpx;height:15rpx; | |
| 2326 | + border-color:#da0b31; | |
| 2327 | +} | |
| 2328 | +.modal-closes { | |
| 2329 | + position: absolute; | |
| 2330 | + right: 30rpx; | |
| 2331 | + top: -15rpx; | |
| 2332 | + height: 25rpx; | |
| 2333 | + | |
| 2334 | +} | |
| 2335 | +.choose_more{ | |
| 2336 | + margin-top: 40rpx; | |
| 2337 | + margin-right: 20rpx; | |
| 2338 | + | |
| 2339 | +} | |
| 2340 | +.choose_mores{ | |
| 2341 | + margin-top: 30rpx; | |
| 2342 | + margin-right: 15rpx; | |
| 2343 | + | |
| 2344 | +} | |
| 2345 | +.store-list{ | |
| 2346 | + width: 95%; | |
| 2347 | + height: 72%; | |
| 2348 | + overflow-y: scroll; | |
| 2349 | + margin: auto; | |
| 2350 | +} | |
| 2351 | +.store-list .store_choose{ | |
| 2352 | + width: 100%; | |
| 2353 | + height: 120rpx; | |
| 2354 | + line-height: 125rpx; | |
| 2355 | + border-bottom: 1rpx solid #eee; | |
| 2356 | + | |
| 2357 | +} | |
| 2358 | +.store-list .store_choose .store{ | |
| 2359 | +width: 100%; | |
| 2360 | +margin: auto; | |
| 2361 | +line-height: 37rpx; | |
| 2362 | +padding-left: 20rpx; | |
| 2363 | + | |
| 2364 | +} | |
| 2365 | +.xc-hook{ | |
| 2366 | + width: 35rpx; | |
| 2367 | + height: 35rpx; | |
| 2368 | + transform: rotate(-145deg); | |
| 2369 | +line-height: 37rpx; | |
| 2370 | +text-align: center; | |
| 2371 | +} | |
| 2372 | + .xc-hooks{ | |
| 2373 | + width: 30rpx; | |
| 2374 | + height: 30rpx; | |
| 2375 | + border: 1rpx solid #999; | |
| 2376 | + } | |
| 2377 | + .address-frame{ | |
| 2378 | + width: 93%; | |
| 2379 | +margin-left: 7rpx; | |
| 2380 | + | |
| 2381 | + } | |
| 2382 | + .nearby_store{ | |
| 2383 | +margin-left: 17rpx; | |
| 2384 | + } | |
| 2385 | + .address_name{ | |
| 2386 | + margin-right: 10rpx; | |
| 2387 | + | |
| 2388 | + } | |
| 2389 | + .address-val{ | |
| 2390 | + height: 38rpx; | |
| 2391 | +line-height: 38rpx; | |
| 2392 | + | |
| 2393 | + } | |
| 2394 | + .store-bottom{ | |
| 2395 | + width: 85%; | |
| 2396 | + margin: auto; | |
| 2397 | + height: 70rpx; | |
| 2398 | + } | |
| 2399 | + .determine{ | |
| 2400 | + width: 260rpx; | |
| 2401 | + height: 55rpx; | |
| 2402 | + border-radius: 50rpx; | |
| 2403 | + line-height: 55rpx; | |
| 2404 | + } | |
| 2405 | + .default{ | |
| 2406 | + width: 260rpx; | |
| 2407 | + height: 55rpx; | |
| 2408 | + border:3rpx solid #c8c8c8; | |
| 2409 | + border-radius: 50rpx; | |
| 2410 | + line-height: 55rpx; | |
| 2411 | + } | |
| 2412 | + .store-bottom-frame{ | |
| 2413 | + width: 95%; | |
| 2414 | + margin: auto; | |
| 2415 | + | |
| 2416 | + } | |
| 2417 | + /* 门店分类列表 */ | |
| 2418 | +.sort_store_list{ | |
| 2419 | + height: 82%; | |
| 2420 | + overflow: hidden; | |
| 2421 | + overflow-y: scroll; | |
| 2422 | + width: 95%; | |
| 2423 | + margin: auto; | |
| 2424 | +} | |
| 2425 | +.sort_store_list .sort-store-frame{ | |
| 2426 | + width: 100%; | |
| 2427 | +height: 100rpx; | |
| 2428 | +line-height:100rpx; | |
| 2429 | +border-bottom: 1rpx solid #eee; | |
| 2430 | + | |
| 2431 | +} | |
| 2432 | +.sort_store_list .sort-store-frame .sort-store{ | |
| 2433 | + width: 94.5%; | |
| 2434 | + margin: auto; | |
| 2435 | +} | |
| 2436 | +.black_rights-frame{ | |
| 2437 | +width: 50%; | |
| 2438 | +} | |
| 2439 | +.black_rights-frame .black_rights{ | |
| 2440 | + border-top: 3rpx solid; | |
| 2441 | +border-right: 3rpx solid; | |
| 2442 | +transform: rotate(45deg); | |
| 2443 | +display: inline-block; | |
| 2444 | +width: 20rpx; | |
| 2445 | +height: 20rpx; | |
| 2446 | +} | |
| 2447 | +.xc-val-money{ | |
| 2448 | + height:80rpx; | |
| 2449 | +} | |
| 2450 | + | |
| 2451 | +.xc-distance-bottom{ | |
| 2452 | + margin-bottom: 40rpx; | |
| 2453 | +} | |
| 2454 | +.xc-distance-top{ | |
| 2455 | +margin-top: 10rpx; | |
| 2456 | +} | |
| 2457 | +.xc-width{ | |
| 2458 | + width: 100%; | |
| 2459 | +} | |
| 2460 | +.right-arrow{ width: 15rpx; height:15rpx; | |
| 2461 | + border-top: 2rpx solid #d70026; | |
| 2462 | + border-right: 2rpx solid #d70026; | |
| 2463 | + transform: rotate(45deg);display:inline-block; | |
| 2464 | + margin-bottom:3rpx; | |
| 2465 | +} | |
| 2466 | +.xc-goods-attribute{ | |
| 2467 | + border-bottom: 1px solid #eee; | |
| 2468 | +padding-bottom: 15px; | |
| 2469 | +margin-bottom:40rpx; | |
| 2470 | +} | |
| 2471 | +.xc-val-fream{ | |
| 2472 | + width: 105rpx; | |
| 2473 | +} | |
| 2474 | +.is_stock{ | |
| 2475 | +width: 58%; | |
| 2476 | +height: 70rpx; | |
| 2477 | +border-radius: 55rpx; | |
| 2478 | +} | |
| 2479 | +.select_store_height{ | |
| 2480 | + height: 50rpx; | |
| 2481 | +} | |
| 2482 | +.butttem5{ | |
| 2483 | + margin-bottom: 5rpx; | |
| 2227 | 2484 | } |
| 2228 | 2485 | |
| 2229 | 2486 | .no_pj_list{text-align: center; width: 100%; color: #999; margin-top: 30rpx; display: inline-block; font-size: 28rpx} |
| ... | ... | @@ -2233,3 +2490,4 @@ right:17rpx; top:55rpx; |
| 2233 | 2490 | width: 58%; background-color: #adadad; |
| 2234 | 2491 | } |
| 2235 | 2492 | |
| 2493 | +.s_btn{ margin-top: 25rpx; } | ... | ... |
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -25,18 +25,16 @@ Page({ |
| 25 | 25 | var url = this.data.baseUrl; |
| 26 | 26 | this.data.is_new=t.is_new; |
| 27 | 27 | this.data.is_hot=t.is_hot; |
| 28 | - | |
| 29 | - console.log(t.cat_id); | |
| 30 | - console.log(t.pid); | |
| 31 | - | |
| 32 | - if (0 != t.cat_id && t.cat_id != undefined) { | |
| 33 | - url += "&cat_id=" + t.cat_id; | |
| 34 | - if (t.pid == undefined || t.pid == null){ | |
| 35 | - url += "&parent_id=0"; | |
| 36 | - }else{ | |
| 37 | - url += "&parent_id="+t.pid; | |
| 38 | - } | |
| 39 | - } | |
| 28 | + if (0 != t.cat_id && t.cat_id != undefined) { | |
| 29 | + url += "&cat_id=" + t.cat_id; | |
| 30 | + if (t.pid == undefined || t.pid == null){ | |
| 31 | + url += "&parent_id=0"; | |
| 32 | + }else{ | |
| 33 | + if(t.pid!="three"){ | |
| 34 | + url += "&parent_id="+t.pid; | |
| 35 | + } | |
| 36 | + } | |
| 37 | + } | |
| 40 | 38 | |
| 41 | 39 | if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } |
| 42 | 40 | if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; } | ... | ... |
pages/index/index/index.js
| 1 | 1 | var e = function (e) { |
| 2 | 2 | return e && e.__esModule ? e : { |
| 3 | - default: e | |
| 3 | + default: e | |
| 4 | 4 | }; |
| 5 | 5 | }(require("../../../utils/LoadMore.js")), t = getApp(), a = t.request, o = t.globalData.setting, os = o, |
| 6 | 6 | i = require("../../../utils/util.js"), ut = i, s = require("../../../utils/common.js"), n = new e.default(); |
| ... | ... | @@ -55,6 +55,8 @@ Page({ |
| 55 | 55 | is_boot:0, |
| 56 | 56 | gd_category:null, |
| 57 | 57 | is_no_more:0, |
| 58 | + | |
| 59 | + max_sw_height:0, //banner的最大高度 | |
| 58 | 60 | }, |
| 59 | 61 | |
| 60 | 62 | onLoad: function () { |
| ... | ... | @@ -64,22 +66,20 @@ Page({ |
| 64 | 66 | //看一下商家是否开通了权益 |
| 65 | 67 | //--初始化是否有打勾-- |
| 66 | 68 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { |
| 67 | - data: { storeId: os.stoid} | |
| 69 | + data: { storeId: os.stoid } | |
| 68 | 70 | }).then(res => { |
| 69 | - if(res.data.data){ | |
| 70 | - var is_init=res.data.data.isBool; | |
| 71 | - th.setData({is_boot:is_init}); | |
| 71 | + if (res.data.data) { | |
| 72 | + var is_init = res.data.data.isBool; | |
| 73 | + th.setData({ is_boot: is_init }); | |
| 72 | 74 | } |
| 73 | 75 | }) |
| 74 | 76 | |
| 75 | - | |
| 76 | - | |
| 77 | 77 | }, |
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | async onShow() { |
| 81 | - var th=this; | |
| 82 | - | |
| 81 | + var th = this; | |
| 82 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | |
| 83 | 83 | await this.init_load(); |
| 84 | 84 | //显示的时候要开启计时器 |
| 85 | 85 | this.data.is_timer = 1; |
| ... | ... | @@ -605,7 +605,16 @@ Page({ |
| 605 | 605 | return false; |
| 606 | 606 | } |
| 607 | 607 | getApp().goto("/pages/user/userqy/userqy"); |
| 608 | + }, | |
| 609 | + | |
| 610 | + imageLoad:function (e) { | |
| 611 | + var imgwidth = e.detail.width; | |
| 612 | + var imgheight = e.detail.height; | |
| 613 | + //宽高比 | |
| 614 | + var ratio = imgwidth / imgheight; | |
| 615 | + //计算的高度值 | |
| 616 | + var viewHeight = 715 / ratio; | |
| 617 | + if(this.data.max_sw_height<viewHeight) this.setData({ max_sw_height:viewHeight }); | |
| 608 | 618 | } |
| 609 | 619 | |
| 610 | - | |
| 611 | 620 | }); |
| 612 | 621 | \ No newline at end of file | ... | ... |
pages/index/index/index.wxml
| ... | ... | @@ -24,10 +24,11 @@ |
| 24 | 24 | </view> |
| 25 | 25 | <!--滚动广告--> |
| 26 | 26 | <view class="rel title-img" wx:if="{{banner}}" > |
| 27 | - <swiper autoplay="true" class="swiper_box" duration="1000" interval="3000" vertical=""bindchange="bannerSwiperChange"> | |
| 27 | + <swiper autoplay="true" class="swiper_box" duration="1000" interval="3000" vertical=""bindchange="bannerSwiperChange" style="height:{{max_sw_height}}rpx"> | |
| 28 | 28 | <swiper-item wx:for="{{banner}}" wx:key="banner"> |
| 29 | 29 | <view url="{{item.media_link}}" class="slide-image-frame"> |
| 30 | - <image class="slide-image"mode="widthFix" src="{{item.ad_code}}" lazy-load="true" binderror="bind_bnerr" data-errorimg="banner[{{index}}].ad_code"></image> | |
| 30 | + <image class="slide-image"mode="widthFix" src="{{item.ad_code}}" bindload="imageLoad" data-index="{{index}}" | |
| 31 | + lazy-load="true" binderror="bind_bnerr" data-errorimg="banner[{{index}}].ad_code"></image> | |
| 31 | 32 | </view> |
| 32 | 33 | </swiper-item> |
| 33 | 34 | </swiper> | ... | ... |
pages/index/index/index.wxss
| ... | ... | @@ -60,8 +60,8 @@ left: 10%; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | .swiper_box { |
| 63 | - width: 100%; | |
| 64 | - | |
| 63 | + width: 100%; | |
| 64 | + height: auto; | |
| 65 | 65 | } |
| 66 | 66 | .s_prom{ |
| 67 | 67 | width: 100%; |
| ... | ... | @@ -77,6 +77,7 @@ left: 10%; |
| 77 | 77 | display: inline-block; |
| 78 | 78 | overflow: hidden; |
| 79 | 79 | border-radius: 14rpx; |
| 80 | + height: auto; | |
| 80 | 81 | |
| 81 | 82 | } |
| 82 | 83 | |
| ... | ... | @@ -118,12 +119,14 @@ left: 10%; |
| 118 | 119 | |
| 119 | 120 | .choice_box .choice_list image { |
| 120 | 121 | width: 100%; |
| 121 | - height: 368rpx; | |
| 122 | + | |
| 123 | + height: auto; | |
| 122 | 124 | } |
| 123 | 125 | .title-img{ |
| 124 | 126 | margin-top: 110rpx; |
| 125 | 127 | |
| 126 | 128 | margin-bottom: 15rpx; |
| 129 | + height: auto; | |
| 127 | 130 | |
| 128 | 131 | } |
| 129 | 132 | ... | ... |
pages/payment/pay_success/pay_success.js
0 → 100644
| 1 | +var e = getApp(); | |
| 2 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | |
| 3 | +Page({ | |
| 4 | + /** | |
| 5 | + * 页面的初始数据 | |
| 6 | + */ | |
| 7 | + data: { | |
| 8 | + url: e.globalData.setting.imghost, | |
| 9 | + resourceUrl: e.globalData.setting.resourceUrl, | |
| 10 | + iurl: e.globalData.setting.imghost, | |
| 11 | + order:null, | |
| 12 | + type:1, | |
| 13 | + allmoney:0, | |
| 14 | + user_money:0, | |
| 15 | + order_sn:"", | |
| 16 | + pick:null, | |
| 17 | + }, | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 生命周期函数--监听页面加载 | |
| 21 | + */ | |
| 22 | + onLoad:async function(options) { | |
| 23 | + wx.setNavigationBarTitle({ | |
| 24 | + title: '支付成功', | |
| 25 | + }); | |
| 26 | + | |
| 27 | + var type=options.type,order_sn=options.order_sn; | |
| 28 | + var th=this,order=null; | |
| 29 | + //如果是等1,就是单个订单的订单号 | |
| 30 | + if(type==1){ | |
| 31 | + await getApp().request.promiseGet("/api/weshop/order/page", | |
| 32 | + {data:{store_id:e.globalData.setting.stoid,order_sn:order_sn}}).then(res=>{ | |
| 33 | + order=res.data.data.pageData[0]; | |
| 34 | + th.setData({order:order,order_sn:order_sn}) | |
| 35 | + }) | |
| 36 | + }else{ | |
| 37 | + await getApp().request.promiseGet("/api/weshop/order/page", | |
| 38 | + {data:{store_id:e.globalData.setting.stoid,parent_sn:order_sn}}).then(res=>{ | |
| 39 | + | |
| 40 | + var allmoney=0,user_money=0; | |
| 41 | + for(var i in res.data.data.pageData){ | |
| 42 | + var item=res.data.data.pageData[i]; | |
| 43 | + allmoney+=item.order_amount; | |
| 44 | + user_money += item.user_money?item.user_money:0; | |
| 45 | + } | |
| 46 | + order=res.data.data.pageData[0]; | |
| 47 | + th.setData({ order: order, type: 2, allmoney: allmoney, order_sn: order_sn, user_money: user_money}) | |
| 48 | + }) | |
| 49 | + } | |
| 50 | + //--获取门店-- | |
| 51 | + if(order.exp_type==1) { | |
| 52 | + await getApp().request.promiseGet("/api/weshop/pickup/get/"+ e.globalData.setting.stoid+"/"+order.pickup_id, | |
| 53 | + {1:1}).then(res => { | |
| 54 | + th.setData({pick:res.data.data}) | |
| 55 | + }); | |
| 56 | + } | |
| 57 | + }, | |
| 58 | + | |
| 59 | + goto: function() { | |
| 60 | + var url= '/pages/index/index/index'; | |
| 61 | + getApp().goto(url) | |
| 62 | + }, | |
| 63 | +}) | |
| 0 | 64 | \ No newline at end of file | ... | ... |
pages/payment/pay_success/pay_success.json
0 → 100644
pages/payment/pay_success/pay_success.wxml
0 → 100644
| 1 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | |
| 2 | +<view> | |
| 3 | + <!-- 支付成功提示 --> | |
| 4 | + <view class="payradio"> | |
| 5 | + <!-- 提示框 --> | |
| 6 | + <view class="Success_box flex-center"> | |
| 7 | + <view> | |
| 8 | + <view class="flex-center"> | |
| 9 | + <image src="{{url}}miniapp/images/pay/paysuccess.png"></image> | |
| 10 | + </view> | |
| 11 | + <view class="Success_box_title fs32">订单支付成功!</view> | |
| 12 | + </view> | |
| 13 | + </view> | |
| 14 | + | |
| 15 | + <!-- 支付信息 --> | |
| 16 | + <view class="payitem_max fs28"> | |
| 17 | + <!-- 订单编号 --> | |
| 18 | + <view class="payitem flex"> | |
| 19 | + <view>订单编号 :</view> | |
| 20 | + <text selectable="true">{{order_sn}}</text> | |
| 21 | + </view> | |
| 22 | + | |
| 23 | + <!-- 实付金额 --> | |
| 24 | + | |
| 25 | + <view class="payitem flex"> | |
| 26 | + <view>实付金额 :</view> | |
| 27 | + <!-- {{filters.toFix()}} --> | |
| 28 | + <view class="pay_money" wx:if="{{type==1}}">{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}元</view> | |
| 29 | + <view class="pay_money" wx:else>{{filters.toFix(allmoney+user_money,2) }}元</view> | |
| 30 | + </view> | |
| 31 | + | |
| 32 | + <!-- 支付方式 --> | |
| 33 | + <view class="payitem flex" wx:if="type==1"> | |
| 34 | + <view>支付方式 :</view> | |
| 35 | + <view wx:if="{{order.order_amount>0 && order.user_money>0 }}">微信支付,余额支付</view> | |
| 36 | + <view wx:elif="{{order.order_amount>0}}">微信支付</view> | |
| 37 | + <view wx:elif="{{order.user_money>0}}">余额支付</view> | |
| 38 | + <view wx:else>免单</view> | |
| 39 | + </view> | |
| 40 | + <view class="payitem flex" wx:else> | |
| 41 | + <view>支付方式 :</view> | |
| 42 | + <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view> | |
| 43 | + <view wx:elif="{{allmoney>0}}">微信支付</view> | |
| 44 | + <view wx:elif="{{user_money>0}}">余额支付</view> | |
| 45 | + <view wx:else>免单</view> | |
| 46 | + </view> | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + </view> | |
| 51 | + </view> | |
| 52 | + <view class="flex-level"> | |
| 53 | + <view class="line"></view> | |
| 54 | + </view> | |
| 55 | + | |
| 56 | + <!-- 跳转链接 --> | |
| 57 | + <view> | |
| 58 | + <!-- 个人收货信息 --> | |
| 59 | + <view class="pay_User fs28" wx:if="{{order.exp_type==0}}"> | |
| 60 | + <view class="payitem flex"> | |
| 61 | + <view class="pay_Receiving">收货人 :</view> | |
| 62 | + <view class="pay_name ellipsis-1">{{order.consignee}}</view> | |
| 63 | + <view>{{order.mobile}}</view> | |
| 64 | + </view> | |
| 65 | + <view class="payitem flex"> | |
| 66 | + <view class="pay_Receiving">收货地址 :</view> | |
| 67 | + <view class="address ellipsis-2">{{order.more_address+order.address}}</view> | |
| 68 | + </view> | |
| 69 | + </view> | |
| 70 | + | |
| 71 | + <!-- 收货门店信息 --> | |
| 72 | + <view class="pay_User fs28" wx:else> | |
| 73 | + <view class="payitem flex"> | |
| 74 | + <view class="pay_Receiving">门店 :</view> | |
| 75 | + <view class="pay_name ellipsis-1">{{pick.pickup_name}}</view> | |
| 76 | + </view> | |
| 77 | + <view class="payitem flex"> | |
| 78 | + <view class="pay_Receiving">门店地址 :</view> | |
| 79 | + <view class="address ellipsis-2">{{pick.fulladdress}}</view> | |
| 80 | + </view> | |
| 81 | + </view> | |
| 82 | + | |
| 83 | + <!-- 链接 --> | |
| 84 | + <view class="fs32"> | |
| 85 | + <view class="flex-center"> | |
| 86 | + <navigator class="pay_order flex-center" url="/pages/user/order_list/order_list"> | |
| 87 | + <view>查看订单</view> | |
| 88 | + </navigator> | |
| 89 | + </view> | |
| 90 | + <view class="flex-center"> | |
| 91 | + <navigator class="pay_home flex-center" bindtap="goto"> | |
| 92 | + <view>回到首页</view> | |
| 93 | + </navigator> | |
| 94 | + </view> | |
| 95 | + </view> | |
| 96 | + </view> | |
| 97 | +</view> | |
| 0 | 98 | \ No newline at end of file | ... | ... |
pages/payment/pay_success/pay_success.wxss
0 → 100644
| 1 | +page { | |
| 2 | + border-top: 2rpx solid rgb(245, 245, 245); | |
| 3 | +} | |
| 4 | +.line { | |
| 5 | + border-top: 2rpx solid rgb(245, 245, 245); | |
| 6 | + width: 700rpx; | |
| 7 | +} | |
| 8 | + | |
| 9 | +.payradio .Success_box { | |
| 10 | + padding-top: 45rpx; | |
| 11 | + padding-bottom: 45rpx; | |
| 12 | +} | |
| 13 | + | |
| 14 | +.payradio .Success_box .Success_box_title { | |
| 15 | + margin-top: 45rpx; | |
| 16 | + color: rgb(8, 8, 8); | |
| 17 | +} | |
| 18 | + | |
| 19 | +.payradio image { | |
| 20 | + width: 140rpx; | |
| 21 | + height: 140rpx; | |
| 22 | + display: flex; | |
| 23 | +} | |
| 24 | + | |
| 25 | +.payitem_max { | |
| 26 | + padding: 0rpx 55rpx; | |
| 27 | + color: rgb(104, 104, 104); | |
| 28 | + padding-bottom: 30rpx; | |
| 29 | +} | |
| 30 | + | |
| 31 | +.payitem_max .payitem { | |
| 32 | + margin-top: 30rpx; | |
| 33 | +} | |
| 34 | + | |
| 35 | +.payitem_max .payitem .pay_nam { | |
| 36 | + width: 200rpx; | |
| 37 | +} | |
| 38 | + | |
| 39 | +.payitem_max .payitem view { | |
| 40 | + margin-right: 50rpx; | |
| 41 | +} | |
| 42 | +.pay_money{ | |
| 43 | + color: rgb(219, 27, 52); | |
| 44 | +} | |
| 45 | + | |
| 46 | +.pay_User { | |
| 47 | + padding-left: 55rpx; | |
| 48 | + color: rgb(104, 104, 104); | |
| 49 | +} | |
| 50 | + | |
| 51 | +.pay_User .payitem { | |
| 52 | + margin-top: 30rpx; | |
| 53 | +} | |
| 54 | + | |
| 55 | +.pay_User .payitem .pay_Receiving { | |
| 56 | + width: 128rpx; | |
| 57 | + margin-right: 50rpx; | |
| 58 | +} | |
| 59 | + | |
| 60 | +.pay_User .payitem .pay_name { | |
| 61 | + margin-right: 38rpx; | |
| 62 | + max-width: 250rpx; | |
| 63 | +} | |
| 64 | + | |
| 65 | +.pay_order { | |
| 66 | + margin-top: 115rpx; | |
| 67 | + color: rgb(104, 104, 104); | |
| 68 | + width: 560rpx; | |
| 69 | + height: 62rpx; | |
| 70 | + border-radius: 30rpx; | |
| 71 | + border: 3rpx solid rgb(209, 209, 209); | |
| 72 | +} | |
| 73 | + | |
| 74 | +.pay_home { | |
| 75 | + margin-top: 35rpx; | |
| 76 | + color: rgb(255, 255, 255); | |
| 77 | + width: 566rpx; | |
| 78 | + height: 68rpx; | |
| 79 | + border-radius: 30rpx; | |
| 80 | + background-color: rgb(219, 27, 52); | |
| 81 | +} | |
| 82 | +.address{ | |
| 83 | + width: 470rpx; | |
| 84 | +} | |
| 0 | 85 | \ No newline at end of file | ... | ... |
pages/user/add_comment/add_comment.js
| 1 | -var t = getApp(),oo=t.globalData, a = t.globalData.setting,os=a, e = t.request, s = require("../../../utils/util.js"), | |
| 2 | - i = require("../../../utils/selectFiles.js"); | |
| 1 | +var t = getApp(), oo = t.globalData, a = t.globalData.setting, os = a, e = t.request, s = require("../../../utils/util.js"), | |
| 2 | + i = require("../../../utils/selectFiles.js"); | |
| 3 | 3 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 4 | 4 | |
| 5 | 5 | Page({ |
| 6 | - data: { | |
| 7 | - url: a.url, | |
| 8 | - resourceUrl: a.resourceUrl, | |
| 9 | - iurl: a.imghost, | |
| 10 | - defaultPhoto: a.resourceUrl + "/static/images/camera.png", | |
| 11 | - filePaths: [], | |
| 12 | - uploadPath: [], | |
| 13 | - maxWord: 0, | |
| 14 | - is_anonymous: !1, | |
| 15 | - goods_rank: 0, | |
| 16 | - service_rank: 0, | |
| 17 | - deliver_rank: 0, | |
| 18 | - content: "", | |
| 19 | - options: null, | |
| 20 | - isLongPress: !1, | |
| 21 | - userinfo:null, | |
| 22 | - }, | |
| 23 | - onLoad:async function(a) { | |
| 24 | - var th=this; | |
| 25 | - console.log('onLoad'); | |
| 26 | - console.log(a); | |
| 6 | + data: { | |
| 7 | + url: a.url, | |
| 8 | + resourceUrl: a.resourceUrl, | |
| 9 | + iurl: a.imghost, | |
| 10 | + defaultPhoto: a.resourceUrl + "/static/images/camera.png", | |
| 27 | 11 | |
| 28 | - await getApp().request.promiseGet("/api/weshop/goods/get/"+os.stoid+"/"+a.goods_id,{1:1}).then(res=>{ | |
| 29 | - a.img=th.data.iurl+res.data.data.original_img | |
| 30 | - }) | |
| 12 | + uploadPath: [], //上传后文件路径 | |
| 13 | + maxWord: 0, | |
| 14 | + is_anonymous: !1, | |
| 15 | + goods_rank: 0, | |
| 16 | + service_rank: 0, | |
| 17 | + deliver_rank: 0, | |
| 18 | + content: "", | |
| 19 | + options: null, | |
| 20 | + isLongPress: !1, | |
| 21 | + userinfo: null, | |
| 22 | + imgs: [], //本地文件再上传时的路径 | |
| 23 | + lenMore:0 | |
| 24 | + }, | |
| 25 | + onLoad: async function (a) { | |
| 26 | + var th = this; | |
| 27 | + await getApp().request.promiseGet("/api/weshop/ordergoods/pageGoods", { data:{store_id:os.stoid,goods_id:a.goods_id, order_id:a.order_id}}).then(res => { | |
| 31 | 28 | |
| 32 | - | |
| 33 | - this.setData({options: a}); | |
| 34 | - t.getUserInfo(function(e){ | |
| 35 | - console.log(e); | |
| 36 | - th.setData({ | |
| 37 | - userinfo:e | |
| 38 | - }) | |
| 39 | - }) | |
| 40 | - }, | |
| 41 | - keyUpChangeNum: function(t) { | |
| 42 | - this.setData({ | |
| 43 | - maxWord: t.detail.value.length | |
| 44 | - }), this.data.content = t.detail.value; | |
| 45 | - }, | |
| 46 | - checkAnonymous: function() { | |
| 47 | - this.setData({ | |
| 48 | - is_anonymous: !this.data.is_anonymous | |
| 49 | - }); | |
| 50 | - }, | |
| 51 | - checkGoodsRank: function(t) { | |
| 52 | - this.setData({ | |
| 53 | - goods_rank: parseInt(t.currentTarget.dataset.i) + 1 | |
| 54 | - }); | |
| 55 | - }, | |
| 56 | - checkServiceRank: function(t) { | |
| 57 | - this.setData({ | |
| 58 | - service_rank: parseInt(t.currentTarget.dataset.i) + 1 | |
| 29 | + a.img = th.data.iurl + res.data.data.pageData[0].original_img; | |
| 30 | + a.goods_name=res.data.data.pageData[0].goods_name; | |
| 31 | + a.goods_num=res.data.data.pageData[0].goods_num; | |
| 32 | + }) | |
| 33 | + this.setData({ options: a }); | |
| 34 | + t.getUserInfo(function (e) { | |
| 35 | + console.log(e); | |
| 36 | + th.setData({userinfo: e}) | |
| 37 | + }) | |
| 38 | + }, | |
| 39 | + keyUpChangeNum: function (t) { | |
| 40 | + this.setData({ | |
| 41 | + maxWord: t.detail.value.length | |
| 42 | + }), this.data.content = t.detail.value; | |
| 43 | + }, | |
| 44 | + checkAnonymous: function () { | |
| 45 | + this.setData({ | |
| 46 | + is_anonymous: !this.data.is_anonymous | |
| 47 | + }); | |
| 48 | + }, | |
| 49 | + checkGoodsRank: function (t) { | |
| 50 | + this.setData({ | |
| 51 | + goods_rank: parseInt(t.currentTarget.dataset.i) + 1 | |
| 52 | + }); | |
| 53 | + }, | |
| 54 | + checkServiceRank: function (t) { | |
| 55 | + this.setData({ | |
| 56 | + service_rank: parseInt(t.currentTarget.dataset.i) + 1 | |
| 57 | + }); | |
| 58 | + }, | |
| 59 | + checkDeliverRank: function (t) { | |
| 60 | + this.setData({ | |
| 61 | + deliver_rank: parseInt(t.currentTarget.dataset.i) + 1 | |
| 62 | + }); | |
| 63 | + }, | |
| 64 | + selectPhotos: function (t) { | |
| 65 | + if (this.data.isLongPress) this.data.isLongPress = !1; else { | |
| 66 | + var a = this; | |
| 67 | + i.selectPhotos(this.data.filePaths, t.currentTarget.dataset.idx, function (t) { | |
| 68 | + a.setData({ | |
| 69 | + filePaths: t | |
| 59 | 70 | }); |
| 60 | - }, | |
| 61 | - checkDeliverRank: function(t) { | |
| 62 | - this.setData({ | |
| 63 | - deliver_rank: parseInt(t.currentTarget.dataset.i) + 1 | |
| 64 | - }); | |
| 65 | - }, | |
| 66 | - selectPhotos: function(t) { | |
| 67 | - if (this.data.isLongPress) this.data.isLongPress = !1; else { | |
| 68 | - var a = this; | |
| 69 | - i.selectPhotos(this.data.filePaths, t.currentTarget.dataset.idx, function(t) { | |
| 70 | - a.setData({ | |
| 71 | - filePaths: t | |
| 72 | - }); | |
| 73 | - }); | |
| 71 | + }); | |
| 72 | + } | |
| 73 | + }, | |
| 74 | + removePhoto: function (t) { | |
| 75 | + var a = this; | |
| 76 | + this.data.isLongPress = !0, i.removePhoto(this.data.filePaths, t.currentTarget.dataset.idx, function (t) { | |
| 77 | + a.setData({ | |
| 78 | + filePaths: t | |
| 79 | + }); | |
| 80 | + }); | |
| 81 | + }, | |
| 82 | + submitComment: function () { | |
| 83 | + var a = this; | |
| 84 | + if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank) | |
| 85 | + return getApp().my_warnning("请先打分",0,a); | |
| 86 | + if(a.data.content=="") | |
| 87 | + return getApp().my_warnning("请填写评价内容",0,a); | |
| 88 | + | |
| 89 | + //this.uploadPhotos(function () { | |
| 90 | + var p_data= { | |
| 91 | + email: ' ', | |
| 92 | + is_show: 1, | |
| 93 | + goods_rank: a.data.goods_rank, | |
| 94 | + service_rank: a.data.service_rank, | |
| 95 | + deliver_rank: a.data.deliver_rank, | |
| 96 | + content: a.data.content, | |
| 97 | + goods_id: a.data.options.goods_id, | |
| 98 | + order_id: a.data.options.order_id, | |
| 99 | + user_id: oo.user_id, | |
| 100 | + store_id: os.stoid, | |
| 101 | + username: a.data.userinfo.nickname, | |
| 102 | + source_type:1 | |
| 103 | + } | |
| 104 | + if(a.data.uploadPath){ | |
| 105 | + p_data['weapp_img']=JSON.stringify(a.data.uploadPath); | |
| 106 | + } | |
| 107 | + if(a.data.is_anonymous){ | |
| 108 | + p_data['is_anonymous']=1; | |
| 109 | + } | |
| 110 | + | |
| 111 | + e.post("/api/weshop/comment/savecomment", { | |
| 112 | + data:p_data, | |
| 113 | + success: function (a) { | |
| 114 | + wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function () { | |
| 115 | + wx.navigateBack(); | |
| 116 | + }); | |
| 74 | 117 | } |
| 75 | - }, | |
| 76 | - removePhoto: function(t) { | |
| 77 | - var a = this; | |
| 78 | - this.data.isLongPress = !0, i.removePhoto(this.data.filePaths, t.currentTarget.dataset.idx, function(t) { | |
| 79 | - a.setData({ | |
| 80 | - filePaths: t | |
| 81 | - }); | |
| 82 | - }); | |
| 83 | - }, | |
| 84 | - submitComment: function() { | |
| 85 | - var a = this; | |
| 86 | - if (!a.data.service_rank || !a.data.goods_rank || !a.data.deliver_rank) return t.showWarning("请先打完分~"); | |
| 87 | - this.uploadPhotos(function() { | |
| 88 | - e.post("/api/weshop/comment/savecomment", { | |
| 89 | - data: { | |
| 90 | - email:' ', | |
| 91 | - is_show:1, | |
| 92 | - goods_rank: a.data.goods_rank, | |
| 93 | - service_rank: a.data.service_rank, | |
| 94 | - deliver_rank: a.data.deliver_rank, | |
| 95 | - content: a.data.content, | |
| 96 | - goods_id: a.data.options.goods_id, | |
| 97 | - order_id: a.data.options.order_id, | |
| 98 | - user_id: oo.user_id, | |
| 99 | - store_id:os.stoid, | |
| 100 | - username: a.data.userinfo.nickname | |
| 101 | - }, | |
| 102 | - success: function(a) { | |
| 103 | - wx.setStorageSync("user:comment:update", !0), t.showSuccess("评论成功", function() { | |
| 104 | - wx.navigateBack(); | |
| 105 | - }); | |
| 106 | - } | |
| 107 | - }); | |
| 108 | - }); | |
| 109 | - }, | |
| 110 | - uploadPhotos: function(t, a) { | |
| 111 | - if (0 == this.data.filePaths.length) return t(); | |
| 112 | - if ("number" != typeof a) a = 0; else if (a >= this.data.filePaths.length) return t(); | |
| 113 | - var s = this; | |
| 114 | - e.uploadFile("/api/user/upload_comment_img", { | |
| 115 | - filePath: s.data.filePaths[a], | |
| 116 | - name: "img_file", | |
| 117 | - success: function(e) { | |
| 118 | - s.data.uploadPath[a] = e.data.result, s.uploadPhotos(t, a + 1); | |
| 119 | - } | |
| 120 | - }); | |
| 121 | - }, | |
| 118 | + }); | |
| 119 | + //}); | |
| 120 | + }, | |
| 121 | + | |
| 122 | 122 | |
| 123 | - //图片失败,默认图片 | |
| 124 | - bind_bnerr2: function (e) { | |
| 123 | + uploadPhotos: function (t, a) { | |
| 124 | + if (0 == this.data.imgs.length) return t(); | |
| 125 | + if ("number" != typeof a) a = 0; else if (a >= this.data.imgs.length) return t(); | |
| 126 | + var s = this; | |
| 127 | + e.uploadFile("/api/weshop/comment/uploadCommentImg", { | |
| 128 | + filePath: s.data.imgs[a], | |
| 129 | + name: "file", | |
| 130 | + success: function (e) { | |
| 131 | + console.log("uploadPhotos"); | |
| 132 | + console.log(e.data); | |
| 133 | + if(e.data.code==0) | |
| 134 | + s.data.uploadPath[a] = e.data.data, s.uploadPhotos(t, a + 1); | |
| 135 | + } | |
| 136 | + }); | |
| 137 | + }, | |
| 138 | + | |
| 139 | + //图片失败,默认图片 | |
| 140 | + bind_bnerr2: function (e) { | |
| 125 | 141 | var _errImg = e.target.dataset.errorimg; |
| 126 | 142 | var _errObj = {}; |
| 127 | - _errObj[_errImg] = a.imghost+"/public/images/default_goods_image_240.gif"; | |
| 143 | + _errObj[_errImg] = a.imghost + "/public/images/default_goods_image_240.gif"; | |
| 128 | 144 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 129 | - } | |
| 145 | + }, | |
| 146 | + // 上传图片 | |
| 147 | + chooseImg: function (e) { | |
| 148 | + var that = this; | |
| 149 | + var imgs = this.data.imgs; | |
| 150 | + if (imgs.length >= 3){ | |
| 151 | + if(this.data.lenMore==0){ | |
| 152 | + this.setData({ lenMore: 1 }); | |
| 153 | + } | |
| 154 | + return false; | |
| 155 | + } | |
| 156 | + | |
| 157 | + var imgs = this.data.imgs; | |
| 158 | + | |
| 159 | + wx.chooseImage({ | |
| 160 | + count: 1, // 默认9 | |
| 161 | + sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 | |
| 162 | + sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 | |
| 163 | + success: function (res) { | |
| 164 | + // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片 | |
| 165 | + var tempFilePaths = res.tempFilePaths; | |
| 166 | + | |
| 167 | + getApp().request.uploadFile("/api/weshop/comment/uploadCommentImg", { | |
| 168 | + filePath: tempFilePaths[0], | |
| 169 | + name: "file", | |
| 170 | + success: function (e) { | |
| 171 | + if(e.data.code==0) { | |
| 172 | + that.data.uploadPath.push(e.data.data); | |
| 173 | + imgs.push(tempFilePaths[0]); | |
| 174 | + that.setData({ | |
| 175 | + imgs: imgs | |
| 176 | + }); | |
| 177 | + } | |
| 178 | + } | |
| 179 | + }); | |
| 180 | + } | |
| 181 | + }); | |
| 182 | + }, | |
| 183 | + // 删除图片 | |
| 184 | + deleteImg: function (e) { | |
| 185 | + var imgs = this.data.imgs; | |
| 186 | + var index = e.currentTarget.dataset.index; | |
| 187 | + imgs.splice(index, 1); | |
| 188 | + this.setData({ | |
| 189 | + imgs: imgs | |
| 190 | + }); | |
| 191 | + }, | |
| 192 | + // 预览图片 | |
| 193 | + previewImg: function (e) { | |
| 194 | + //获取当前图片的下标 | |
| 195 | + var index = e.currentTarget.dataset.index; | |
| 196 | + //所有图片 | |
| 197 | + var imgs = this.data.imgs; | |
| 198 | + wx.previewImage({ | |
| 199 | + //当前显示图片 | |
| 200 | + current: imgs[index], | |
| 201 | + //所有图片 | |
| 202 | + urls: imgs | |
| 203 | + }) | |
| 204 | + }, | |
| 205 | + | |
| 206 | + txtInpt:function (e) { | |
| 207 | + this.setData({ | |
| 208 | + content: e.detail.value | |
| 209 | + }) | |
| 210 | + }, | |
| 211 | + | |
| 212 | + onUnload: function () { | |
| 213 | + wx.navigateBack({ delta:1 }) | |
| 214 | + }, | |
| 215 | + | |
| 216 | + | |
| 130 | 217 | }); |
| 131 | 218 | \ No newline at end of file | ... | ... |
pages/user/add_comment/add_comment.json
pages/user/add_comment/add_comment.wxml
| 1 | -<view class="goods-mes pd-bg-fff"> | |
| 2 | - <view class="goods-img"> | |
| 3 | - <image class="wh100" src="{{options.img}}" binderror="bind_bnerr2" data-errorimg="options.img"></image> | |
| 4 | - </view> | |
| 5 | - <view class="goods-des"> | |
| 6 | - <view class="goods-name ellipsis-1">{{options.goods_name}}</view> | |
| 7 | - <view class="goods-package ellipsis-1">¥{{options.price}}</view> | |
| 8 | - </view> | |
| 9 | -</view> | |
| 10 | -<view class="evaluation"> | |
| 11 | - <textarea bindinput="keyUpChangeNum" class="word-box" maxlength="500" placeholder="写下购买体会和使用感受来帮助其他小伙伴吧~"></textarea> | |
| 12 | - <view class="words-num">{{maxWord}}/500</view> | |
| 13 | -</view> | |
| 1 | +<view class="commoditymax"> | |
| 2 | + <!-- 商品评价 --> | |
| 3 | + <view class='commodity'> | |
| 4 | + <!-- 商品信息 --> | |
| 5 | + <navigator class='information flex-vertical' url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+options.goods_id}}"> | |
| 6 | + <image src="{{options.img}}" binderror="bind_bnerr2" data-errorimg="options.img"></image> | |
| 7 | + <view class="goods_name xc-black"> | |
| 8 | + <!-- 商品名称 --> | |
| 9 | + <view class='ellipsis-2 fs32'>{{options.goods_name}}</view> | |
| 10 | + <!-- 商品价格,数量 --> | |
| 11 | + <view class='flex jc_sb balin'> | |
| 12 | + <!-- 价格 --> | |
| 13 | + <view class='flex-vertical balin'> | |
| 14 | + <view class="fs24">¥</view> | |
| 15 | + <view class="fs35">{{options.price}}</view> | |
| 16 | + </view> | |
| 17 | + | |
| 18 | + <!-- 商品数量 --> | |
| 19 | + <view class='sum flex-vertical balin xc-black'> | |
| 20 | + <view class="fs24">x</view> | |
| 21 | + <view class="fs28">{{options.goods_num}}</view> | |
| 22 | + </view> | |
| 23 | + | |
| 24 | + </view> | |
| 25 | + | |
| 26 | + </view> | |
| 27 | + | |
| 28 | + </navigator> | |
| 29 | + | |
| 30 | + | |
| 31 | + <!-- 商品评价信息 --> | |
| 32 | + <view class="addComment"> | |
| 33 | + <textarea class="fs24" placeholder="已经收到商品,快跟大家分享一下宝贝吧!" bindinput="txtInpt" placeholder-class="fs24" maxlength="500" value="{{content}}"></textarea> | |
| 34 | + <view class="flex addimages"> | |
| 35 | + <!-- 评论图片集合 --> | |
| 36 | + <view class="images"> | |
| 37 | + <image class="rel" catchtap="previewImg" data-index="{{index}}" src="{{item}}" wx:for="{{imgs}}"> | |
| 38 | + <image class="abs" src="{{iurl}}miniapp/images/cancel.png" data-index="{{index}}" bindtap="deleteImg"></image> | |
| 39 | + </image> | |
| 40 | + | |
| 41 | + </view> | |
| 42 | + | |
| 43 | + <!-- 添加图片按钮框架 --> | |
| 44 | + <view class="addimage flex-center xc-ash" bindtap="chooseImg"> | |
| 45 | + <view> | |
| 46 | + <view class="flex-center"> | |
| 47 | + <image src="{{iurl}}miniapp/images/camera.png"></image> | |
| 48 | + </view> | |
| 49 | + <view class="flex-center fs20">添加图片</view> | |
| 50 | + <view class="flex-center fs20">{{imgs.length>0?imgs.length:0}}/3</view> | |
| 51 | + </view> | |
| 52 | + </view> | |
| 53 | + | |
| 54 | + </view> | |
| 14 | 55 | |
| 15 | -<!------ | |
| 16 | -<view class="pic-list pd-bg-fff"> | |
| 17 | - <view class="share-pic" wx:for="{{5}}" wx:key="{{index}}"> | |
| 18 | - <image bindlongtap="removePhoto" bindtap="selectPhotos" class="wh100" data-idx="{{index}}" src="{{filePaths[index]?filePaths[index]:defaultPhoto}}"></image> | |
| 19 | 56 | </view> |
| 20 | -</view>-------> | |
| 21 | - | |
| 22 | -<!-- <view class="anonymous"> | |
| 23 | - <icon bindtap="checkAnonymous" color="{{is_anonymous?'red':'gray'}}" size="20" type="success"></icon> 匿名评价 | |
| 24 | -</view> --> | |
| 25 | -<view class="score-list pd-bg-fff"> | |
| 26 | - <view class="score-title"> | |
| 27 | - <view>评分</view> | |
| 28 | - <view>满意请给5分哦</view> | |
| 57 | + </view> | |
| 58 | + | |
| 59 | + <!-- 评价等级 --> | |
| 60 | + <view class="Grade"> | |
| 61 | + <!-- 宝贝评分 --> | |
| 62 | + <view class="title flex-vertical"> | |
| 63 | + <view class="column"></view> | |
| 64 | + <view class="fs28">宝贝评分</view> | |
| 29 | 65 | </view> |
| 30 | - <view class="score-item"> | |
| 31 | - <view>商品符合度</view> | |
| 32 | - <view class="stars"> | |
| 33 | - <image bindtap="checkGoodsRank" data-i="{{index}}" src="{{index<goods_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image> | |
| 66 | + | |
| 67 | + <!-- 服务评级 --> | |
| 68 | + <view class="score-items"> | |
| 69 | + <view class="score-item flex-vertical"> | |
| 70 | + <view class="fs24">描述相符</view> | |
| 71 | + <view class="stars flex-vertical"> | |
| 72 | + <view class="flex-vertical" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}" bindtap="checkGoodsRank"> | |
| 73 | + <image src="{{index<goods_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image> | |
| 74 | + </view> | |
| 34 | 75 | </view> |
| 35 | - </view> | |
| 36 | - <view class="score-item"> | |
| 37 | - <view>店家服务态度</view> | |
| 38 | - <view class="stars"> | |
| 39 | - <image bindtap="checkServiceRank" data-i="{{index}}" src="{{index<service_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image> | |
| 76 | + </view> | |
| 77 | + | |
| 78 | + <view class="score-item flex-vertical"> | |
| 79 | + <view class="fs24">物流服务</view> | |
| 80 | + <view class="stars flex-vertical"> | |
| 81 | + <view class="flex-vertical" bindtap="checkDeliverRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}"> | |
| 82 | + <image src="{{index<deliver_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image> | |
| 83 | + </view> | |
| 40 | 84 | </view> |
| 41 | - </view> | |
| 42 | - <view class="score-item"> | |
| 43 | - <view>物流发货速度</view> | |
| 44 | - <view class="stars"> | |
| 45 | - <image bindtap="checkDeliverRank" data-i="{{index}}" src="{{index<deliver_rank?iurl+'/miniapp/images/star-red.png':iurl+'/miniapp/images/star-gray.png'}}" wx:for="{{5}}" wx:key="{{index}}"></image> | |
| 85 | + </view> | |
| 86 | + <view class="score-item flex-vertical"> | |
| 87 | + <view class="fs24">服务态度</view> | |
| 88 | + <view class="stars flex-vertical"> | |
| 89 | + <view class="flex-vertical" bindtap="checkServiceRank" data-i="{{index}}" wx:for="{{5}}" wx:key="{{index}}"> | |
| 90 | + <image src="{{index<service_rank?iurl+'/miniapp/images/StarsredCk.png':iurl+'/miniapp/images/StarswhiteUnCk.png'}}"></image> | |
| 91 | + </view> | |
| 46 | 92 | </view> |
| 93 | + | |
| 94 | + </view> | |
| 95 | + | |
| 47 | 96 | </view> |
| 97 | + | |
| 98 | + </view> | |
| 48 | 99 | </view> |
| 49 | -<view class="btn-wrap"> | |
| 50 | - <view bindtap="submitComment" class="submit-btn">提 交</view> | |
| 100 | +<!-- 是否匿名评价 --> | |
| 101 | +<view class=" Whether "> | |
| 102 | + <!-- 选择是否匿名 --> | |
| 103 | + <view class="allClick flex-right-vertical" bindtap="checkAnonymous"> | |
| 104 | + <icon class="radio" size="15" type="success" color="{{is_anonymous?'red':'gainsboro'}}"></icon> | |
| 105 | + <view class="fs24 ">匿名评价</view> | |
| 106 | + </view> | |
| 107 | + | |
| 108 | + <view class="Submission flex-level "> | |
| 109 | + <view class="fs30 flex-level white " bindtap="submitComment">提交评价</view> | |
| 110 | + </view> | |
| 51 | 111 | </view> |
| 112 | + | |
| 113 | + | |
| 114 | +<warn id="warn"></warn> | |
| 52 | 115 | \ No newline at end of file | ... | ... |
pages/user/add_comment/add_comment.wxss
| 1 | -.goods-mes { | |
| 2 | - height: 100rpx; | |
| 3 | - display: flex; | |
| 4 | - padding: 30rpx; | |
| 5 | - justify-content: space-between; | |
| 1 | +page{ | |
| 2 | + overflow-x: hidden; | |
| 3 | +} | |
| 4 | +/* 商品详情和评价 */ | |
| 5 | +.commoditymax{ | |
| 6 | + overflow-x: hidden; | |
| 7 | +} | |
| 8 | +.commodity { | |
| 9 | + height: 715rpx; | |
| 10 | + border-top: 6rpx solid rgb(245, 245, 245); | |
| 11 | + border-bottom: 6rpx solid rgb(245, 245, 245); | |
| 12 | + padding: 0rpx 30rpx; | |
| 13 | +} | |
| 14 | + | |
| 15 | +.commodity .information { | |
| 16 | + height: 286rpx; | |
| 17 | +} | |
| 18 | + | |
| 19 | +.commodity .information image { | |
| 20 | + width: 186rpx; | |
| 21 | + height: 186rpx; | |
| 22 | +} | |
| 23 | + | |
| 24 | +.information .goods_name { | |
| 25 | + width: 480rpx; | |
| 26 | + margin-left: 25rpx; | |
| 27 | + height: 186rpx; | |
| 28 | +} | |
| 29 | + | |
| 30 | +.information .goods_name .ellipsis-2 { | |
| 31 | + line-height: 40rpx; | |
| 32 | + height: 80rpx; | |
| 6 | 33 | } |
| 7 | 34 | |
| 8 | -.goods-img { | |
| 9 | - width: 100rpx; | |
| 10 | - height: 100rpx; | |
| 11 | - overflow: hidden; | |
| 35 | +.information .goods_name .jc_sb { | |
| 36 | + margin-top: 60rpx; | |
| 37 | + color: rgb(212, 28, 52); | |
| 38 | + margin-right: 7rpx; | |
| 12 | 39 | } |
| 13 | 40 | |
| 14 | -.goods-des { | |
| 15 | - width: 560rpx; | |
| 41 | +.information .goods_name .jc_sb .fs32 { | |
| 42 | + line-height: 40rpx; | |
| 16 | 43 | } |
| 17 | 44 | |
| 18 | -.goods-des>view { | |
| 19 | - width: 100%; | |
| 20 | - height: 32rpx; | |
| 21 | - line-height: 1; | |
| 22 | - font-size: 32rpx; | |
| 23 | - color: #444; | |
| 45 | +.information .goods_name .jc_sb .sum { | |
| 46 | + margin-right: 5rpx; | |
| 24 | 47 | } |
| 25 | 48 | |
| 26 | -.goods-package { | |
| 27 | - margin-top: 36rpx; | |
| 49 | +.balin { | |
| 50 | + align-items: baseline; | |
| 28 | 51 | } |
| 29 | 52 | |
| 30 | -.evaluation { | |
| 31 | - padding: 30rpx 30rpx; | |
| 32 | - position: relative; | |
| 33 | - font-size: 28rpx; | |
| 53 | +.addComment { | |
| 54 | + height: 345rpx; | |
| 55 | + width: 690rpx; | |
| 56 | + background-color: rgb(248, 248, 248); | |
| 57 | + padding: 32rpx 0rpx 21rpx 0rpx; | |
| 34 | 58 | } |
| 35 | 59 | |
| 36 | -.word-box { | |
| 37 | - color: #444; | |
| 38 | - line-height: 40rpx; | |
| 39 | - width: 100%; | |
| 40 | - height: 200rpx; | |
| 60 | +.addComment textarea { | |
| 61 | + padding: 0rpx 18rpx; | |
| 62 | + height: 175rpx; | |
| 63 | + width: 654rpx; | |
| 41 | 64 | } |
| 42 | 65 | |
| 43 | -.words-num { | |
| 44 | - position: absolute; | |
| 45 | - right: 30rpx; | |
| 46 | - bottom: 30rpx; | |
| 47 | - color: #777; | |
| 66 | +.addComment .addimages { | |
| 67 | + padding: 0rpx 18rpx; | |
| 68 | + margin-top: 20rpx; | |
| 69 | + align-items: flex-end; | |
| 70 | + width: 652rpx; | |
| 48 | 71 | } |
| 49 | 72 | |
| 50 | -.pic-list { | |
| 51 | - padding: 40rpx 20rpx 20rpx; | |
| 52 | - display: flex; | |
| 53 | - justify-content: space-around; | |
| 73 | +.addComment .addimages .images { | |
| 74 | + height: 140rpx; | |
| 54 | 75 | } |
| 55 | 76 | |
| 56 | -.share-pic { | |
| 57 | - width: 126rpx; | |
| 58 | - height: 126rpx; | |
| 59 | - border: 1px solid #ddd; | |
| 60 | - overflow: hidden; | |
| 77 | +.addComment .addimages .images .rel { | |
| 78 | + width: 140rpx; | |
| 79 | + height: 100%; | |
| 80 | + overflow: visible; | |
| 81 | + margin-right: 15rpx; | |
| 61 | 82 | } |
| 62 | 83 | |
| 63 | -.anonymous { | |
| 64 | - height: 60rpx; | |
| 65 | - padding: 0 20rpx 20rpx; | |
| 66 | - background-color: #fff; | |
| 67 | - display: flex; | |
| 68 | - align-items: center; | |
| 69 | - font-size: 30rpx; | |
| 70 | - color: #777; | |
| 84 | +.addComment .addimages .images image .abs { | |
| 85 | + width: 30rpx; | |
| 86 | + height: 30rpx; | |
| 87 | + top: -7rpx; | |
| 88 | + right: -7rpx; | |
| 71 | 89 | } |
| 72 | 90 | |
| 73 | -.anonymous>icon { | |
| 74 | - margin-right: 20rpx; | |
| 91 | +.addComment .addimage { | |
| 92 | + width: 139rpx; | |
| 93 | + height: 139rpx; | |
| 94 | + border: 2rpx dashed rgb(196, 196, 196); | |
| 95 | + font-size: 16rpx; | |
| 96 | + margin-left: 6rpx; | |
| 75 | 97 | } |
| 76 | 98 | |
| 77 | -.score-list { | |
| 78 | - margin-top: 20rpx; | |
| 99 | +.addComment .addimage image { | |
| 100 | + width: 60rpx; | |
| 101 | + height: 58rpx; | |
| 79 | 102 | } |
| 80 | 103 | |
| 81 | -.score-list>view { | |
| 82 | - display: flex; | |
| 83 | - justify-content: space-between; | |
| 84 | - font-size: 30rpx; | |
| 85 | - color: #444; | |
| 104 | +.Grade { | |
| 105 | + width: 100%; | |
| 106 | + height: 310rpx; | |
| 107 | + border-bottom: 6rpx solid rgb(245, 245, 245); | |
| 108 | + padding-left: 45rpx; | |
| 86 | 109 | } |
| 87 | 110 | |
| 88 | -.score-title { | |
| 89 | - height: 90rpx; | |
| 90 | - line-height: 90rpx; | |
| 91 | - border-bottom: 1px solid #eee; | |
| 111 | +.Grade .title { | |
| 112 | + width: 100%; | |
| 113 | + height: 105rpx; | |
| 92 | 114 | } |
| 93 | 115 | |
| 94 | -.score-item { | |
| 95 | - align-items: center; | |
| 96 | - height: 80rpx; | |
| 116 | +.Grade .title .column { | |
| 117 | + height: 30rpx; | |
| 118 | + border-left: 6rpx solid rgb(211, 27, 58); | |
| 119 | + margin-right: 12rpx; | |
| 97 | 120 | } |
| 98 | 121 | |
| 99 | -.stars { | |
| 100 | - display: flex; | |
| 122 | +.Grade .score-item { | |
| 123 | + height: 55rpx; | |
| 124 | + line-height: 55rpx; | |
| 101 | 125 | } |
| 102 | 126 | |
| 103 | -.stars image { | |
| 104 | - width: 44rpx; | |
| 105 | - height: 40rpx; | |
| 127 | +.Grade .score-item .stars { | |
| 128 | + margin-left: 83rpx; | |
| 129 | +} | |
| 130 | +.Grade .score-item .stars view{ | |
| 131 | + width: 60rpx; | |
| 132 | + height: 55rpx; | |
| 133 | +} | |
| 134 | + | |
| 135 | +.Grade .score-item .stars image { | |
| 136 | + width: 35rpx; | |
| 137 | + height: 35rpx; | |
| 138 | +} | |
| 139 | +.Whether { | |
| 140 | + padding:0rpx 31rpx; | |
| 141 | +} | |
| 142 | +.Whether .flex-right-vertical { | |
| 143 | + height: 67rpx; | |
| 106 | 144 | } |
| 107 | 145 | |
| 108 | -.btn-wrap { | |
| 109 | - padding: 20rpx 0; | |
| 110 | - background-color: #fff; | |
| 111 | - border-top: 1px solid #eee; | |
| 146 | +.Whether .flex-right-vertical .radio { | |
| 147 | + margin-right: 15rpx; | |
| 112 | 148 | } |
| 113 | 149 | |
| 114 | -.submit-btn { | |
| 115 | - width: 320rpx; | |
| 116 | - height: 80rpx; | |
| 117 | - line-height: 80rpx; | |
| 118 | - text-align: center; | |
| 119 | - background-color: #f15353; | |
| 120 | - color: #fff; | |
| 121 | - margin: auto; | |
| 122 | -} | |
| 123 | 150 | \ No newline at end of file |
| 151 | +.Whether .Submission { | |
| 152 | + margin: 40rpx 0 40rpx 0; | |
| 153 | +} | |
| 154 | + | |
| 155 | +.Whether .white { | |
| 156 | + width: 364rpx; | |
| 157 | + height: 58rpx; | |
| 158 | + background-color: rgb(212, 28, 52); | |
| 159 | + border-radius: 40rpx; | |
| 160 | + line-height: 58rpx; | |
| 161 | +} | |
| 162 | + | |
| 163 | + | ... | ... |
pages/user/address_list/address_list.js
| ... | ... | @@ -24,10 +24,11 @@ Page({ |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | 26 | this.data.operate = e.operate; |
| 27 | - var is_back=e.is_back; | |
| 28 | - if (is_back) this.setData({ is_back: is_back}) | |
| 29 | 27 | }, |
| 30 | 28 | onShow: function () { |
| 29 | + var is_back=getApp().globalData.is_cart_old; | |
| 30 | + if (is_back) this.setData({ is_back: is_back}) | |
| 31 | + | |
| 31 | 32 | this.data.curpage = 1; |
| 32 | 33 | this.data.addresses = []; |
| 33 | 34 | this.requestAddressList(); | ... | ... |
pages/user/collect_list/collect_list.js
| 1 | 1 | var t = function(t) { |
| 2 | 2 | return t && t.__esModule ? t : { |
| 3 | - default: t | |
| 3 | + default: t | |
| 4 | 4 | }; |
| 5 | -}(require("../../../utils/LoadMore.js")), e = getApp(), a = e.request, o = new t.default(); | |
| 6 | -var oo = e.globalData.setting, app_d = e.globalData; | |
| 5 | + }(require("../../../utils/LoadMore.js")), | |
| 6 | + e = getApp(), | |
| 7 | + a = e.request, | |
| 8 | + o = new t.default(); | |
| 9 | +var oo = e.globalData.setting, | |
| 10 | + app_d = e.globalData; | |
| 7 | 11 | |
| 8 | 12 | Page({ |
| 9 | - data: { | |
| 10 | - url: e.globalData.setting.imghost, | |
| 11 | - resourceUrl: e.globalData.setting.resourceUrl, | |
| 12 | - iurl: e.globalData.setting.imghost, | |
| 13 | - collects: null, | |
| 14 | - currentPage: 1 | |
| 15 | - }, | |
| 16 | - onLoad: function() { | |
| 17 | - o.init(this, "", "collects"), this.requestCollectList(); | |
| 18 | - }, | |
| 19 | - requestCollectList: function() { | |
| 20 | - var t = this, e = "/api/weshop/goodscollect/list?pageSize=10&user_id=" | |
| 21 | - +app_d.user_id+"&store_id=" + oo.stoid+"&page=" + t.data.currentPage; | |
| 22 | - o.request(e, function(e) { | |
| 23 | - console.log("requestCollectList"); | |
| 24 | - console.log(e); | |
| 25 | - t.data.currentPage++; | |
| 26 | - }); | |
| 27 | - }, | |
| 28 | - onReachBottom: function() { | |
| 29 | - o.canloadMore() && this.requestCollectList(); | |
| 30 | - }, | |
| 31 | - cancelCollect: function(t) { | |
| 32 | - var e = t.currentTarget.dataset.id, o = this; | |
| 33 | - a.delete("/api/weshop/goodscollect/del/" + oo.stoid+"/"+e, { | |
| 34 | - success: function(t) { | |
| 35 | - o.deleteItemData(e); | |
| 36 | - } | |
| 13 | + data: { | |
| 14 | + url: e.globalData.setting.imghost, | |
| 15 | + resourceUrl: e.globalData.setting.resourceUrl, | |
| 16 | + iurl: e.globalData.setting.imghost, | |
| 17 | + collects: null, | |
| 18 | + currentPage: 1, | |
| 19 | + curpage: 1, | |
| 20 | + ismore: 0, | |
| 21 | + iscollects: 0, | |
| 22 | + editEd: 0, //商品编辑按钮是否点击 | |
| 23 | + isall: false, //是否全选 | |
| 24 | + sum: 0, | |
| 25 | + total_collects: 0, | |
| 26 | + is_goods: 0, | |
| 27 | + pageSize: 8, //分页数量 | |
| 28 | + isdelete: 0 | |
| 29 | + }, | |
| 30 | + onLoad: function() { | |
| 31 | + o.init(this, "", "collects"), | |
| 32 | + this.requestCollectList(); | |
| 33 | + }, | |
| 34 | + requestCollectList: function() { | |
| 35 | + var th = this; | |
| 36 | + e = "/api/weshop/goodscollect/list?" + "pageSize=" + th.data.pageSize + "&user_id=" + | |
| 37 | + app_d.user_id + "&store_id=" + oo.stoid + "&page=" + th.data.currentPage; | |
| 38 | + o.request(e, function(e) { | |
| 39 | + th.data.currentPage++; | |
| 40 | + if (th.data.total_collects == 0) { | |
| 41 | + th.setData({ | |
| 42 | + iscollects: 1, | |
| 43 | + total_collects: e.data.data.total | |
| 44 | + }) | |
| 45 | + } | |
| 46 | + if (th.data.total_collects < th.data.pageSize) { | |
| 47 | + | |
| 48 | + th.setData({ | |
| 49 | + is_goods: 1 | |
| 50 | + }) | |
| 51 | + var goods_list = th.selectComponent("#goods_recommend"); //组件的id | |
| 52 | + goods_list.get_list(); | |
| 53 | + | |
| 54 | + | |
| 55 | + } | |
| 56 | + }); | |
| 57 | + }, | |
| 58 | + | |
| 59 | + //--到底部刷新--- | |
| 60 | + onReachBottom: function() { | |
| 61 | + if ((this.data.currentPage - 1) * this.data.pageSize < this.data.total_collects) { | |
| 62 | + this.requestCollectList(); | |
| 63 | + } else { | |
| 64 | + if (this.data.is_goods == 0) this.setData({ | |
| 65 | + is_goods: 1 | |
| 66 | + }); | |
| 67 | + var goods_list = this.selectComponent("#goods_recommend"); //组件的id | |
| 68 | + goods_list.get_list(); | |
| 69 | + } | |
| 70 | + | |
| 71 | + }, | |
| 72 | + | |
| 73 | + //--取消收藏--- | |
| 74 | + cancelCollect: function(t) { | |
| 75 | + var e = t.currentTarget.dataset.id, | |
| 76 | + o = this; | |
| 77 | + a.delete("/api/weshop/goodscollect/del/" + oo.stoid + "/" + e, { | |
| 78 | + success: function(t) { | |
| 79 | + o.deleteItemData(e); | |
| 80 | + } | |
| 81 | + }); | |
| 82 | + }, | |
| 83 | + deleteItemData: function(t) { | |
| 84 | + for (var e = 0; e < this.data.collects.length; e++) | |
| 85 | + if (this.data.collects[e].collect_id == t) { | |
| 86 | + this.data.collects.splice(e, 1), this.setData({ | |
| 87 | + collects: this.data.collects | |
| 37 | 88 | }); |
| 38 | - }, | |
| 39 | - deleteItemData: function(t) { | |
| 40 | - for (var e = 0; e < this.data.collects.length; e++) if (this.data.collects[e].collect_id== t) { | |
| 41 | - this.data.collects.splice(e, 1), this.setData({ | |
| 42 | - collects: this.data.collects | |
| 43 | - }); | |
| 44 | - break; | |
| 89 | + break; | |
| 90 | + } | |
| 91 | + }, | |
| 92 | + //图片失败,默认图片 | |
| 93 | + bind_bnerr: function(e) { | |
| 94 | + var _errImg = e.currentTarget.dataset.errimg; | |
| 95 | + var _errObj = {}; | |
| 96 | + _errObj[_errImg] = this.data.iurl + "/miniapp/images/default_g_img.gif"; | |
| 97 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 98 | + | |
| 99 | + }, | |
| 100 | + | |
| 101 | + requestList: function() { | |
| 102 | + | |
| 103 | + var e = this; | |
| 104 | + a.get("/api/weshop/goods/page", { | |
| 105 | + isShowLoading: 0, | |
| 106 | + data: { | |
| 107 | + store_id: 1, | |
| 108 | + user_id: oo.user_id, | |
| 109 | + page: e.data.curpage, | |
| 110 | + pageSize: 10 | |
| 111 | + }, | |
| 112 | + success: function(t) { | |
| 113 | + e.data.curpage++; | |
| 114 | + var arr1 = e.data.collects_Recommend; | |
| 115 | + var arr2 = t.data.data.pageData; | |
| 116 | + var arr3 = [...arr1, ...arr2]; | |
| 117 | + | |
| 118 | + var ismore = 0; | |
| 119 | + if (arr3.length == t.data.data.total) ismore = 1 | |
| 120 | + | |
| 121 | + e.setData({ | |
| 122 | + collects_Recommend: arr3, | |
| 123 | + total_goods: t.data.data.total, | |
| 124 | + ismore_goods: ismore, | |
| 125 | + loadName: null | |
| 126 | + }), wx.stopPullDownRefresh(); | |
| 127 | + } | |
| 128 | + }); | |
| 129 | + }, | |
| 130 | + | |
| 131 | + | |
| 132 | + goto: function(ee) { | |
| 133 | + wx.switchTab({ | |
| 134 | + url: '/pages/index/index/index', | |
| 135 | + }) | |
| 136 | + }, | |
| 137 | + //编辑商品显示 | |
| 138 | + editcollects: function() { | |
| 139 | + var th = this.data; | |
| 140 | + var t = this; | |
| 141 | + if (th.editEd == 0) { | |
| 142 | + t.select_checked(false, null) | |
| 143 | + t.setData({ | |
| 144 | + editEd: 1, | |
| 145 | + isall:0 | |
| 146 | + }) | |
| 147 | + } else { | |
| 148 | + t.select_checked(false, null) | |
| 149 | + t.setData({ | |
| 150 | + editEd: 0 | |
| 151 | + }) | |
| 152 | + } | |
| 153 | + }, | |
| 154 | + iconClick: function(e) { | |
| 155 | + var th = this.data; | |
| 156 | + var index = e.currentTarget.dataset.index; | |
| 157 | + var collect = "collects[" + index + "].checked"; | |
| 158 | + if (this.data.collects[index].checked == true) { | |
| 159 | + this.setData({ | |
| 160 | + [collect]: false, | |
| 161 | + isall: 0, | |
| 162 | + sum: --th.sum | |
| 163 | + }) | |
| 164 | + } else { | |
| 165 | + var id = th.collects[index].collect_id; | |
| 166 | + this.setData({ | |
| 167 | + [collect]: true, | |
| 168 | + sum: ++th.sum | |
| 169 | + }) | |
| 170 | + if (th.sum == th.collects.length) { | |
| 171 | + this.setData({ | |
| 172 | + isall: 1 | |
| 173 | + }) | |
| 174 | + } | |
| 175 | + } | |
| 176 | + }, | |
| 177 | + //全选为收藏商品checked为true | |
| 178 | + allClick: function() { | |
| 179 | + var th = this; | |
| 180 | + var list = th.data.collects; | |
| 181 | + //判断是否全选 | |
| 182 | + if (th.data.isall) { | |
| 183 | + for (var i = 0; i < list.length; i++) { | |
| 184 | + list[i].checked = false; | |
| 185 | + } | |
| 186 | + this.setData({ | |
| 187 | + sum: 0, | |
| 188 | + isall: 0, | |
| 189 | + collects: list | |
| 190 | + }) | |
| 191 | + } else { | |
| 192 | + for (var i = 0; i < list.length; i++) { | |
| 193 | + list[i].checked = true; | |
| 194 | + } | |
| 195 | + this.setData({ | |
| 196 | + sum: th.data.collects.length, | |
| 197 | + collects: list, | |
| 198 | + isall: 1 | |
| 199 | + }) | |
| 200 | + } | |
| 201 | + }, | |
| 202 | + | |
| 203 | + //分页删除 | |
| 204 | + alldelete: function(e) { | |
| 205 | + | |
| 206 | + var th = this; | |
| 207 | + if (th.data.isdelete) return false; | |
| 208 | + // 全选的话直接删除 | |
| 209 | + if (th.data.isall) { | |
| 210 | + a.delete("/api/weshop/goodscollect/removeUser/" + oo.stoid + "/" + app_d.user_id, { | |
| 211 | + isShowLoading: 0, | |
| 212 | + success: function(e) { | |
| 213 | + th.setData({ | |
| 214 | + collects: [], | |
| 215 | + total_collects: 0, | |
| 216 | + isdelete:0 | |
| 217 | + }) | |
| 218 | + getApp().my_warnning("取消成功", 1, th); | |
| 219 | + | |
| 45 | 220 | } |
| 46 | - }, | |
| 47 | - | |
| 48 | - //图片失败,默认图片 | |
| 49 | - bind_bnerr2: function (e) { | |
| 50 | - var _errImg = e.target.dataset.errorimg; | |
| 51 | - var th=this; | |
| 52 | - this.setData({ | |
| 53 | - [_errImg]: th.data.iurl+"/miniapp/images/default_g_img.gif", | |
| 221 | + }) | |
| 222 | + } else { //按照多个id删除收藏商品 | |
| 223 | + | |
| 224 | + var new_colls = []; | |
| 225 | + var collectId = th.data.collects; | |
| 226 | + | |
| 227 | + var str = ""; | |
| 228 | + for (var i = 0; i < th.data.collects.length; i++) { | |
| 229 | + if (collectId[i].checked) { | |
| 230 | + str += collectId[i].collect_id + ","; | |
| 231 | + } else { | |
| 232 | + new_colls.push(collectId[i]); | |
| 233 | + } | |
| 234 | + } | |
| 235 | + if(str.length==""){ | |
| 236 | + getApp().my_warnning("请选择商品", 0, th); | |
| 237 | + return false; | |
| 238 | + } | |
| 239 | + th.setData({ | |
| 240 | + isdelete: 1 | |
| 241 | + }) | |
| 242 | + str = str.substr(0, str.length - 1); | |
| 243 | + var url = "/api/weshop/goodscollect/removeByIds/" + oo.stoid + "/" + app_d.user_id + "/" + str; | |
| 244 | + | |
| 245 | + a.delete(url, { | |
| 246 | + isShowLoading: 0, | |
| 247 | + success: function(e) { | |
| 248 | + th.setData({ | |
| 249 | + collects: new_colls, | |
| 250 | + sum: 0, | |
| 251 | + total_collects: new_colls.length, | |
| 252 | + isdelete: 0 | |
| 54 | 253 | }) |
| 254 | + // th.select_checked(false,null); | |
| 255 | + getApp().my_warnning("取消收藏成功", 1, th); | |
| 256 | + } | |
| 257 | + | |
| 258 | + }) | |
| 259 | + | |
| 260 | + } | |
| 261 | + }, | |
| 262 | + select_checked: function(check, sum) { | |
| 263 | + var th = this; | |
| 264 | + if (sum == null) { | |
| 265 | + for (var i = 0; i < this.data.collects.length; i++) { | |
| 266 | + var collect = "collects[" + i + "].checked"; | |
| 267 | + th.setData({ | |
| 268 | + [collect]: check, | |
| 269 | + sum:0 | |
| 270 | + }) | |
| 271 | + } | |
| 272 | + } else { | |
| 273 | + var collect = "collects[" + sum + "].checked"; | |
| 274 | + th.setData({ | |
| 275 | + [collect]: check | |
| 276 | + }) | |
| 55 | 277 | } |
| 278 | + }, | |
| 279 | + | |
| 280 | + go_to: function(e) { | |
| 281 | + var th = this; | |
| 282 | + var url = e.currentTarget.dataset.url; | |
| 283 | + getApp().goto(url); | |
| 284 | + } | |
| 56 | 285 | }); |
| 57 | 286 | \ No newline at end of file | ... | ... |
pages/user/collect_list/collect_list.json
pages/user/collect_list/collect_list.wxml
| 1 | -<view class="container"> | |
| 2 | - <view class="collect-ul"> | |
| 3 | - <view class="collect-li" wx:for="{{collects}}" wx:key="{{index}}"> | |
| 4 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 5 | - <image class="collect-img" src="{{item.original_img}}" lazy-load="true" | |
| 6 | - binderror="bind_bnerr2" data-errorimg="collects[{{index}}].original_img"></image> | |
| 7 | - </navigator> | |
| 8 | - <view class="collect-name ellipsis-2">{{item.goods_name}}</view> | |
| 9 | - <view class="collect-footer"> | |
| 10 | - <view class="collect-price">¥{{item.shop_price}}</view> | |
| 11 | - <view bindtap="cancelCollect" class="collect-btn" data-id="{{item.collect_id}}">删除</view> | |
| 12 | - <navigator class="collect-btn" url="/pages/goods/goodsList/goodsList?cat_id={{item.cat_id}}">看相似</navigator> | |
| 1 | +<!-- 无收藏时显示 --> | |
| 2 | +<view class="noCollection" wx:if="{{iscollects==0?false:true && collects.length<1}}"> | |
| 3 | + <view class="flex-level"> | |
| 4 | + <image src="{{url}}miniapp/images/Nocollection.png"></image> | |
| 5 | + </view> | |
| 6 | + <view class="flex-level fs30 xc-ash">当前暂无收藏</view> | |
| 7 | + <view class="flex-level"> | |
| 8 | + <navigator url="/pages/index/index/index" bindtap="goto"> | |
| 9 | + <view class="flex-center fs28 white">去首页逛逛</view> | |
| 10 | + </navigator> | |
| 11 | + </view> | |
| 12 | +</view> | |
| 13 | + | |
| 14 | +<view class="Collection" wx:if="{{collects.length>0}}"> | |
| 15 | + <!-- 收藏商品 --> | |
| 16 | + <view class="commodity"> | |
| 17 | + <!-- 商品数量 --> | |
| 18 | + <view class="sum flex-vertical-between fs24"> | |
| 19 | + <view class="flex-center ">共{{total_collects}}件商品</view> | |
| 20 | + <view class="flex-right-vertical editEd" bindtap="editcollects">{{editEd==1?'完成':'编辑'}}</view> | |
| 21 | + </view> | |
| 22 | + <!-- 商品集合 --> | |
| 23 | + <view class="{{editEd?'collects_max colls_max':'collects_max'}}"> | |
| 24 | + <navigator class="collect flex-vertical" bindtap="iconClick" data-index="{{index}}" wx:for="{{collects}}" wx:key="{{index}}" url="{{editEd==0?'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id:''}}"> | |
| 25 | + | |
| 26 | + <view class="radioCheck iconClick" wx:if="{{editEd}}"> | |
| 27 | + <radio color="rgb(214,1,33)" class="scale" checked="{{item.checked==true?true:false}}"></radio> | |
| 28 | + </view> | |
| 29 | + <!-- 商品图片 --> | |
| 30 | + <view class="flex"> | |
| 31 | + <view class="{{editEd?'collect_image iconrp':'collect_image'}}"> | |
| 32 | + <image src="{{item.original_img}}" binderror="bind_bnerr" data-errimg="collects[{{index}}].original_img"></image> | |
| 33 | + </view> | |
| 34 | + | |
| 35 | + <!-- 商品属性 --> | |
| 36 | + <view class="attribute"> | |
| 37 | + | |
| 38 | + <view class="attribute_name ellipsis-2"> | |
| 39 | + <view class="name fs32">{{item.goods_name}}</view> | |
| 40 | + </view> | |
| 41 | + | |
| 42 | + <!-- 商品价格 --> | |
| 43 | + <view class="attribute_money flex-vertical line"> | |
| 44 | + <view class="money_left flex-vertical line"> | |
| 45 | + <!-- 优惠价 --> | |
| 46 | + <view class="price flex xc-wc"> | |
| 47 | + <view class="fs24">¥</view> | |
| 48 | + <view class="fs40">{{item.shop_price}}</view> | |
| 49 | + </view> | |
| 50 | + <!-- 原价 --> | |
| 51 | + <view class="flex fs24 line through xc-ash"> | |
| 52 | + <view>零售价:</view> | |
| 53 | + <view>¥{{item.market_price}}</view> | |
| 54 | + </view> | |
| 55 | + </view> | |
| 56 | + | |
| 57 | + <view class="money_right flex line" wx:if="{{!editEd}}"> | |
| 58 | + <view class="similar flex-level fs22" catchtap="go_to" data-url="/pages/goods/goodsList/goodsList?cat_id={{item.cat_id}}"> | |
| 59 | + <view>找相似</view> | |
| 60 | + </view> | |
| 61 | + <image src="{{url}}miniapp/images/trash.png" catchtap="cancelCollect" data-id="{{item.collect_id}}"></image> | |
| 62 | + </view> | |
| 63 | + | |
| 13 | 64 | </view> |
| 65 | + | |
| 66 | + </view> | |
| 67 | + | |
| 14 | 68 | </view> |
| 69 | + | |
| 70 | + </navigator> | |
| 71 | + | |
| 72 | + </view> | |
| 73 | +</view> | |
| 74 | + | |
| 75 | +<!--- 好物推荐 ---> | |
| 76 | +<view class="title" wx:if="{{collects.length>0 && is_goods}}"> | |
| 77 | + <view class="Recommend flex-center"> | |
| 78 | + <view class="lin"></view> | |
| 79 | + <view class="flex-center"> | |
| 80 | + <image src="{{url}}miniapp/images/Diamonds.png"></image> | |
| 81 | + <view class="fs28">好物推荐</view> | |
| 82 | + </view> | |
| 83 | + <view class="lin"></view> | |
| 84 | + </view> | |
| 85 | + <!-- 好物推荐 --> | |
| 86 | + <goods_recommend id="goods_recommend"></goods_recommend> | |
| 87 | +</view> | |
| 88 | +</view> | |
| 89 | + | |
| 90 | +<!-- 全选收藏 --> | |
| 91 | +<view class="abs flex-vertical" wx:if="{{editEd && collects.length>0}}"> | |
| 92 | + <view class="left"> | |
| 93 | + <!-- 全选收藏按钮 --> | |
| 94 | + <view class="flex-vertical fs32" bindtap="allClick"> | |
| 95 | + <radio class="iconUn" color="rgb(214,1,33)" checked="{{isall}}"></radio> | |
| 96 | + <view>全选</view> | |
| 15 | 97 | </view> |
| 16 | - <view class="no-data" wx:if="{{!collects||collects.length==0}}"> | |
| 17 | - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | |
| 18 | - <view class="no-data-title">没有相关的数据</view> | |
| 19 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 98 | + | |
| 99 | + <view class="Number flex-vertical"> | |
| 100 | + 已选 | |
| 101 | + <view class="co-red goods_num">{{sum>0?sum:'0'}}</view> 件 | |
| 20 | 102 | </view> |
| 103 | + </view> | |
| 104 | + <view class="delete fs30 flex-center white {{isdelete==1?'Deleting':''}}" bindtap="alldelete"> | |
| 105 | + {{isdelete==0?'删除':'删除中'}} | |
| 106 | + </view> | |
| 21 | 107 | </view> |
| 108 | + | |
| 109 | +<warn id="warn"></warn> | |
| 22 | 110 | \ No newline at end of file | ... | ... |
pages/user/collect_list/collect_list.wxss
| 1 | -.collect-ul { | |
| 1 | +/* .collect-ul { | |
| 2 | 2 | width: 100%; |
| 3 | 3 | background-color: #f0f2f5; |
| 4 | 4 | } |
| ... | ... | @@ -46,4 +46,475 @@ |
| 46 | 46 | border-radius: 5rpx; |
| 47 | 47 | color: #686868; |
| 48 | 48 | font-size: 30rpx; |
| 49 | +} */ | |
| 50 | + | |
| 51 | +page { | |
| 52 | + width: 100%; | |
| 53 | + background-color: rgb(245, 245, 245); | |
| 54 | + overflow-x: hidden; | |
| 55 | +} | |
| 56 | + | |
| 57 | +.Collection { | |
| 58 | + overflow-x: hidden; | |
| 59 | +} | |
| 60 | + | |
| 61 | +/* vip开卡框架 */ | |
| 62 | + | |
| 63 | +.vip { | |
| 64 | + width: 100%; | |
| 65 | + height: 70rpx; | |
| 66 | + background-color: rgb(250, 242, 219); | |
| 67 | + font-size: 25rpx; | |
| 68 | + padding: 0rpx 31rpx; | |
| 69 | +} | |
| 70 | + | |
| 71 | +.vip .vip_image { | |
| 72 | + width: 40rpx; | |
| 73 | + height: 40rpx; | |
| 74 | + background-color: rgb(55, 45, 13); | |
| 75 | + border-radius: 50%; | |
| 76 | + line-height: 70rpx; | |
| 77 | +} | |
| 78 | + | |
| 79 | +.vip .vip_image image { | |
| 80 | + width: 25rpx; | |
| 81 | + height: 25rpx; | |
| 82 | + line-height: 70rpx; | |
| 83 | +} | |
| 84 | + | |
| 85 | +.vip .vip_describe { | |
| 86 | + width: 502prx; | |
| 87 | + margin-left: 20rpx; | |
| 88 | + padding-right: 172rpx; | |
| 89 | + line-height: 70rpx; | |
| 90 | + border-right: 4rpx solid #000; | |
| 91 | + height: 25rpx; | |
| 92 | +} | |
| 93 | + | |
| 94 | +.vip .vip_describe .vip_province_money { | |
| 95 | + color: rgb(254, 0, 0); | |
| 96 | +} | |
| 97 | + | |
| 98 | +.vip .vip_card { | |
| 99 | + margin-left: 17rpx; | |
| 100 | + line-height: 70rpx; | |
| 101 | +} | |
| 102 | + | |
| 103 | +.vip .vip_card .vip_go_image { | |
| 104 | + margin-left: 10rpx; | |
| 105 | +} | |
| 106 | + | |
| 107 | +.vip .vip_card .vip_immediately { | |
| 108 | + color: rgb(56, 47, 14); | |
| 109 | +} | |
| 110 | + | |
| 111 | +.vip .vip_card .vip_go_image image { | |
| 112 | + width: 35rpx; | |
| 113 | + height: 35rpx; | |
| 114 | +} | |
| 115 | + | |
| 116 | +.commodity { | |
| 117 | + width: 100%; | |
| 118 | +} | |
| 119 | + | |
| 120 | +/* 无收藏样式 */ | |
| 121 | + | |
| 122 | +.noCollection image { | |
| 123 | + width: 329rpx; | |
| 124 | + height: 229rpx; | |
| 125 | + margin-top: 202rpx; | |
| 126 | +} | |
| 127 | + | |
| 128 | +.noCollection .xc-ash { | |
| 129 | + margin-top: 41rpx; | |
| 130 | + font-weight: 600px; | |
| 131 | +} | |
| 132 | + | |
| 133 | +.noCollection navigator { | |
| 134 | + margin-top: 73rpx; | |
| 135 | + border-radius: 40rpx; | |
| 136 | +} | |
| 137 | + | |
| 138 | +.noCollection navigator view { | |
| 139 | + width: 247rpx; | |
| 140 | + height: 56rpx; | |
| 141 | + background-color: rgb(255, 72, 72); | |
| 142 | + border-radius: 40rpx; | |
| 143 | +} | |
| 144 | + | |
| 145 | +/* 商品详情 */ | |
| 146 | + | |
| 147 | +.commodity .sum { | |
| 148 | + font-size: 28rpx; | |
| 149 | + height: 70rpx; | |
| 150 | + background-color: rgb(245, 245, 245); | |
| 151 | + padding-left: 31rpx; | |
| 152 | + color: rgb(131, 131, 131); | |
| 153 | +} | |
| 154 | + | |
| 155 | +.commodity .sum view { | |
| 156 | + height: 100%; | |
| 157 | + letter-spacing: 1rpx; | |
| 158 | +} | |
| 159 | + | |
| 160 | +.commodity .sum .editEd { | |
| 161 | + width: 100rpx; | |
| 162 | + padding-right: 31rpx; | |
| 163 | +} | |
| 164 | + | |
| 165 | +.colls_max { | |
| 166 | + padding-left: 30rpx; | |
| 167 | +} | |
| 168 | + | |
| 169 | +.commodity .collects_max .collect { | |
| 170 | + width: 100%; | |
| 171 | + height: 244rpx; | |
| 172 | + border-bottom: 4rpx solid rgb(245, 245, 245); | |
| 173 | + background-color: rgb(255, 255, 255); | |
| 174 | + padding-right: 31rpx; | |
| 175 | +} | |
| 176 | + | |
| 177 | +.commodity .collects_max .collect .collect_image { | |
| 178 | + height: 183rpx; | |
| 179 | + width: 183rpx; | |
| 180 | + margin-left: 31rpx; | |
| 181 | +} | |
| 182 | + | |
| 183 | +.commodity .collects_max .collect .iconrp { | |
| 184 | + margin-left: 0rpx; | |
| 185 | +} | |
| 186 | + | |
| 187 | +.commodity .collects_max .collect .collect_image image { | |
| 188 | + width: 100%; | |
| 189 | + height: 100%; | |
| 190 | +} | |
| 191 | + | |
| 192 | +.commodity .collects_max .collect .attribute { | |
| 193 | + line-height: 68rpx; | |
| 194 | + height: 183rpx; | |
| 195 | + margin-left: 21rpx; | |
| 196 | +} | |
| 197 | + | |
| 198 | +.commodity .collects_max .collect .attribute .attribute_name { | |
| 199 | + height: 68rpx; | |
| 200 | + align-items: center; | |
| 201 | + width: 474rpx; | |
| 202 | +} | |
| 203 | + | |
| 204 | +.commodity .collects_max .collect .attribute .attribute_name .name { | |
| 205 | + line-height: 35rpx; | |
| 206 | +} | |
| 207 | + | |
| 208 | +.commodity .collects_max .collect .attribute .attribute_money { | |
| 209 | + margin-top: 60rpx; | |
| 210 | + display: flex; | |
| 211 | + justify-content: space-between; | |
| 212 | + height: 50rpx; | |
| 213 | + align-items: flex-end; | |
| 214 | +} | |
| 215 | + | |
| 216 | +.commodity .collects_max .money_left { | |
| 217 | + height: 54rpx; | |
| 218 | +} | |
| 219 | + | |
| 220 | +.commodity .collects_max .collect .attribute .attribute_money .money_left .price { | |
| 221 | + font-weight: 1000rpx; | |
| 222 | + color: rgb(212, 28, 52); | |
| 223 | + margin-right: 10rpx; | |
| 224 | + align-items: baseline; | |
| 225 | +} | |
| 226 | + | |
| 227 | +.commodity .collects_max .collect .attribute .attribute_money .money_right { | |
| 228 | + align-items: flex-end; | |
| 229 | + padding-bottom: 1rpx; | |
| 230 | +} | |
| 231 | + | |
| 232 | +.commodity .collects_max .collect .attribute .attribute_money .money_right .similar { | |
| 233 | + width: 97rpx; | |
| 234 | + height: 35rpx; | |
| 235 | + border-radius: 21rpx; | |
| 236 | + border: 1rpx solid rgb(162, 162, 162); | |
| 237 | + margin-right: 22rpx; | |
| 238 | + color: rgb(110,110, 110); | |
| 239 | + align-items: center; | |
| 240 | +} | |
| 241 | + | |
| 242 | +.commodity .collects_max .collect .attribute .attribute_money .money_right view { | |
| 243 | + height: 30rpx; | |
| 244 | + line-height: 30rpx; | |
| 245 | +} | |
| 246 | + | |
| 247 | +.commodity .collects_max .collect .attribute .attribute_money .money_right image { | |
| 248 | + width: 35rpx; | |
| 249 | + height: 35rpx; | |
| 250 | + margin-right: 10rpx; | |
| 251 | + margin-bottom: 1rpx; | |
| 252 | +} | |
| 253 | + | |
| 254 | +.line { | |
| 255 | + align-items: baseline; | |
| 256 | +} | |
| 257 | + | |
| 258 | +.title .collect { | |
| 259 | + background-color: rgb(255, 255, 255); | |
| 260 | +} | |
| 261 | + | |
| 262 | +/* 热门好物 */ | |
| 263 | + | |
| 264 | +/* .title .China { | |
| 265 | + width: 100%; | |
| 266 | + margin-top: 50rpx; | |
| 267 | + margin-bottom: 10rpx; | |
| 268 | + line-height: 0rpx; | |
| 269 | +} | |
| 270 | + | |
| 271 | +.title .China .lin view { | |
| 272 | + width: 2rpx; | |
| 273 | +} | |
| 274 | + | |
| 275 | +.title .China .le { | |
| 276 | + height: 40rpx; | |
| 277 | + color: rgb(51,51, 51); | |
| 278 | +} | |
| 279 | + | |
| 280 | +.title .China .line .one { | |
| 281 | + height: 23rpx; | |
| 282 | + background-color: #000; | |
| 283 | + margin-left: 5rpx; | |
| 284 | +} | |
| 285 | + | |
| 286 | +.title .China .line .two { | |
| 287 | + height: 15rpx; | |
| 288 | + background-color: #000; | |
| 289 | + margin-left: 5rpx; | |
| 290 | +} | |
| 291 | + | |
| 292 | +.title .China .line .three { | |
| 293 | + height: 18rpx; | |
| 294 | + background-color: #000; | |
| 295 | + margin-left: 5rpx; | |
| 296 | +} | |
| 297 | + | |
| 298 | +.title .China .Recommend { | |
| 299 | + margin: 0rpx 20rpx; | |
| 300 | + font-size: 28rpx; | |
| 301 | + line-height: 39rpx; | |
| 302 | + font-weight: bold; | |
| 303 | +} | |
| 304 | + | |
| 305 | +.title .english .silk { | |
| 306 | + width: 214rpx; | |
| 307 | + height: 2rpx; | |
| 308 | + background-color: #000; | |
| 309 | +} | |
| 310 | + | |
| 311 | +.title .english .esh { | |
| 312 | + margin: 0rpx 15rpx; | |
| 313 | +} */ | |
| 314 | + | |
| 315 | +/* .collects { | |
| 316 | + margin-top: 40rpx; | |
| 317 | +} */ | |
| 318 | + | |
| 319 | +.Recommend { | |
| 320 | + height: 80rpx; | |
| 321 | + padding-top: 7rpx; | |
| 322 | +} | |
| 323 | + | |
| 324 | +.Recommend .lin { | |
| 325 | + width: 210rpx; | |
| 326 | + height: 2rpx; | |
| 327 | + background-color: rgb(167, 167, 167); | |
| 328 | +} | |
| 329 | + | |
| 330 | +.Recommend .flex-center { | |
| 331 | + margin: 0 20rpx; | |
| 332 | + color: rgb(51, 51, 51); | |
| 333 | + font-weight: bold; | |
| 334 | +} | |
| 335 | + | |
| 336 | +.Recommend .flex-center image { | |
| 337 | + margin-right: 5rpx; | |
| 338 | + width: 32rpx; | |
| 339 | + height: 29rpx; | |
| 340 | +} | |
| 341 | + | |
| 342 | +.hang { | |
| 343 | + width: 100%; | |
| 344 | + margin: auto; | |
| 345 | + padding-left: 31rpx; | |
| 346 | +} | |
| 347 | + | |
| 348 | +.hang .collect { | |
| 349 | + width: 335rpx; | |
| 350 | + height: 503rpx; | |
| 351 | + border-radius: 23rpx; | |
| 352 | + border: 1rpx solid rgb(214, 214, 214); | |
| 353 | + overflow: hidden; | |
| 354 | + margin-right: 14rpx; | |
| 355 | + margin-bottom: 10rpx; | |
| 356 | +} | |
| 357 | + | |
| 358 | +.collect .bottom { | |
| 359 | + padding: 0rpx 16rpx; | |
| 360 | +} | |
| 361 | + | |
| 362 | +.collect .bottom .goods_name { | |
| 363 | + height: 68rpx; | |
| 364 | +} | |
| 365 | + | |
| 366 | +.collect .sp { | |
| 367 | + width: 100%; | |
| 368 | + height: 315rpx; | |
| 369 | +} | |
| 370 | + | |
| 371 | +.collect .money { | |
| 372 | + margin-top: 40rpx; | |
| 373 | + line-height: 28rpx; | |
| 374 | + align-items: baseline; | |
| 375 | +} | |
| 376 | + | |
| 377 | +.collect .money view { | |
| 378 | + display: flex; | |
| 379 | + align-items: baseline; | |
| 380 | + font-weight: 1000rpx; | |
| 381 | +} | |
| 382 | + | |
| 383 | +.collect .Discount { | |
| 384 | + width: 156rpx; | |
| 385 | + height: 28rpx; | |
| 386 | + border-radius: 20rpx; | |
| 387 | + background-color: rgb(56, 56, 56); | |
| 388 | + font-size: 18rpx; | |
| 389 | + color: rgb(255, 255, 255); | |
| 390 | +} | |
| 391 | + | |
| 392 | +.collect .Discount image { | |
| 393 | + height: 18rpx; | |
| 394 | + width: 18rpx; | |
| 395 | + line-height: 28rpx; | |
| 396 | + margin-right: 3rpx; | |
| 397 | +} | |
| 398 | + | |
| 399 | +.collect.ml20 { | |
| 400 | + margin-left: 13rpx; | |
| 401 | +} | |
| 402 | + | |
| 403 | +.fs24.dollar { | |
| 404 | + padding: 0rpx; | |
| 405 | +} | |
| 406 | + | |
| 407 | +.through { | |
| 408 | + text-decoration: line-through; | |
| 409 | + color: rgb(155, 155, 155); | |
| 410 | + margin-left: 7rpx; | |
| 411 | +} | |
| 412 | + | |
| 413 | +.money .price { | |
| 414 | + margin-left: 12rpx; | |
| 415 | + text-decoration: line-through; | |
| 416 | +} | |
| 417 | + | |
| 418 | +.money .price view { | |
| 419 | + display: flex; | |
| 420 | + align-items: flex-end; | |
| 421 | +} | |
| 422 | + | |
| 423 | +.province { | |
| 424 | + line-height: 28rpx; | |
| 425 | +} | |
| 426 | + | |
| 427 | +.nothing { | |
| 428 | + height: 75rpx; | |
| 429 | + width: 100%; | |
| 430 | +} | |
| 431 | + | |
| 432 | +.nothing .no_content { | |
| 433 | + margin: 0rpx 11rpx; | |
| 434 | + color: rgb(138, 138, 138); | |
| 435 | +} | |
| 436 | + | |
| 437 | +.nothing .Foil { | |
| 438 | + width: 80rpx; | |
| 439 | + height: 2rpx; | |
| 440 | + background-color: rgb(138, 138, 138); | |
| 441 | +} | |
| 442 | + | |
| 443 | +.iconUn { | |
| 444 | + margin-left: 15rpx; | |
| 445 | + margin-right: 21rpx; | |
| 446 | + transform: scale(1.0); | |
| 447 | +} | |
| 448 | + | |
| 449 | +.Un { | |
| 450 | + margin-left: 0rpx; | |
| 451 | +} | |
| 452 | + | |
| 453 | +.iconClick { | |
| 454 | + margin-left: 21rpx; | |
| 455 | + margin-right: 16rpx; | |
| 456 | +} | |
| 457 | + | |
| 458 | +.radioCheck { | |
| 459 | + height: 100%; | |
| 460 | + display: flex; | |
| 461 | + align-items: center; | |
| 462 | + width: 65rpx; | |
| 463 | + justify-content: center; | |
| 464 | +} | |
| 465 | + | |
| 466 | +.scale { | |
| 467 | + transform: scale(0.8); | |
| 468 | +} | |
| 469 | + | |
| 470 | +.load { | |
| 471 | + width: 100%; | |
| 472 | + height: 80rpx; | |
| 473 | + padding: 0rpx 31rpx; | |
| 474 | +} | |
| 475 | + | |
| 476 | +.abs { | |
| 477 | + position: fixed; | |
| 478 | + left: 0rpx; | |
| 479 | + bottom: 0rpx; | |
| 480 | + height: 100rpx; | |
| 481 | + background-color: rgb(255, 255, 255); | |
| 482 | + width: 100%; | |
| 483 | + border-top: 1rpx solid #eee; | |
| 484 | +} | |
| 485 | + | |
| 486 | +.abs .left { | |
| 487 | + display: flex; | |
| 488 | + justify-content: space-between; | |
| 489 | + width: 515rpx; | |
| 490 | + padding-left: 31rpx; | |
| 491 | +} | |
| 492 | + | |
| 493 | +.abs .allClick { | |
| 494 | + margin-left: 31rpx; | |
| 495 | +} | |
| 496 | + | |
| 497 | +.abs icon { | |
| 498 | + margin-right: 31rpx; | |
| 499 | +} | |
| 500 | + | |
| 501 | +.abs .delete { | |
| 502 | + width: 235rpx; | |
| 503 | + height: 100%; | |
| 504 | + background-color: rgb(219, 27, 52); | |
| 505 | +} | |
| 506 | +.abs .Deleting{ | |
| 507 | + background-color: rgb(131, 131, 131); | |
| 508 | +} | |
| 509 | +.abs .Number { | |
| 510 | + margin-right: 18rpx; | |
| 511 | + letter-spacing: 0rpx; | |
| 512 | + font-size: 32rpx; | |
| 513 | + height: 55rpx; | |
| 514 | + | |
| 515 | +} | |
| 516 | +.goods_num{ | |
| 517 | + height: 55rpx; | |
| 518 | +line-height: 55rpx; | |
| 519 | + | |
| 49 | 520 | } |
| 50 | 521 | \ No newline at end of file | ... | ... |
pages/user/comment/comment.js
| 1 | +var ut = require("../../../utils/util.js"); | |
| 1 | 2 | var t = function(t) { |
| 2 | 3 | return t && t.__esModule ? t : { |
| 3 | - default: t | |
| 4 | + default: t | |
| 4 | 5 | }; |
| 5 | -}(require("../../../utils/LoadMore.js")), e = getApp(), rq = e.request, a = new t.default(), | |
| 6 | - s = require("../../../utils/util.js"), oo = e.globalData, os = e.globalData.setting; | |
| 6 | + }(require("../../../utils/LoadMore.js")), | |
| 7 | + e = getApp(), | |
| 8 | + rq = e.request, | |
| 9 | + a = new t.default(), | |
| 10 | + s = require("../../../utils/util.js"), | |
| 11 | + oo = e.globalData, | |
| 12 | + os = e.globalData.setting; | |
| 13 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | |
| 7 | 14 | |
| 8 | 15 | Page({ |
| 9 | - data: { | |
| 10 | - url: e.globalData.setting.url, | |
| 11 | - resourceUrl: e.globalData.setting.imghost, | |
| 12 | - iurl: e.globalData.setting.imghost, | |
| 13 | - categories: [ { | |
| 14 | - name: "全部评价", | |
| 15 | - status: 2 | |
| 16 | - }, { | |
| 17 | - name: "待评价", | |
| 18 | - status: 0 | |
| 19 | - }, { | |
| 20 | - name: "已评价", | |
| 21 | - status: 1 | |
| 22 | - } ], | |
| 23 | - activeStatus: 0, | |
| 24 | - comments: null, | |
| 25 | - currentPage: 1 | |
| 26 | - }, | |
| 27 | - onLoad: function(t) { | |
| 28 | - var e = void 0 === t.status ? this.data.activeStatus : t.status; | |
| 29 | - a.init(this, "", "comments"), this.requestComments(e); | |
| 30 | - }, | |
| 31 | - onShow: function() { | |
| 32 | - wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1), | |
| 33 | - this.resetData(), this.requestComments(this.data.activeStatus)); | |
| 34 | - }, | |
| 35 | - changeTab: function(t) { | |
| 36 | - this.resetData(), this.requestComments(t.currentTarget.dataset.status); | |
| 37 | - }, | |
| 38 | - requestComments: function(t) { | |
| 39 | - var e = this, th=e,n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage; | |
| 40 | - console.log('requestComments'); | |
| 41 | - console.log(n); | |
| 42 | - console.log(t); | |
| 16 | + data: { | |
| 17 | + url: e.globalData.setting.url, | |
| 18 | + resourceUrl: e.globalData.setting.imghost, | |
| 19 | + iurl: e.globalData.setting.imghost, | |
| 20 | + categories: [{ | |
| 21 | + name: "全部评价", | |
| 22 | + status: 2 | |
| 23 | + }, { | |
| 24 | + name: "待评价", | |
| 25 | + status: 0 | |
| 26 | + }, { | |
| 27 | + name: "已评价", | |
| 28 | + status: 1 | |
| 29 | + }], | |
| 30 | + activeStatus: 0, | |
| 31 | + comments: null, | |
| 32 | + currentPage: 1, | |
| 33 | + isloaded: 0, | |
| 34 | + order_id:0, | |
| 35 | + is_no_more:0, | |
| 36 | + }, | |
| 37 | + onLoad: function(t) { | |
| 38 | + var e = void 0 === t.status ? this.data.activeStatus : t.status; | |
| 39 | + this.data.order_id=t.order_id; | |
| 40 | + | |
| 41 | + //a.init(this, "", "comments"), | |
| 42 | + //this.requestComments(e); | |
| 43 | + this.requestComments_new(e); | |
| 44 | + }, | |
| 45 | + onShow: function() { | |
| 46 | + wx.getStorageSync("user:comment:update") && (wx.setStorageSync("user:comment:update", !1), | |
| 47 | + this.resetData(), this.requestComments_new(this.data.activeStatus)); | |
| 48 | + }, | |
| 49 | + changeTab: function(t) { | |
| 50 | + var e = this; | |
| 51 | + if (this.data.activeStatus == t.currentTarget.dataset.status) | |
| 52 | + return false; | |
| 53 | + this.resetData(), this.requestComments_new(t.currentTarget.dataset.status); | |
| 54 | + }, | |
| 55 | + | |
| 56 | + requestComments_new:async function(t){ | |
| 57 | + var e = this, th = e, n = os.url + "/api/weshop/comment/list?page=" + e.data.currentPage; | |
| 43 | 58 | this.setData({ |
| 44 | 59 | activeStatus: t |
| 45 | 60 | }); |
| 46 | - if(t==2){ | |
| 47 | - a.request(n, function (t) { | |
| 48 | - e.data.currentPage++; | |
| 49 | - var da = th.data.comments; | |
| 50 | - /*-- | |
| 51 | - da.forEach(function(em,ind){ | |
| 52 | - rq.get("/api/weshop/goods/get/" + os.stoid + "/" + em.goods_id, { | |
| 53 | - success: function (tt) { | |
| 54 | - var gd = tt.data.data.original_img; | |
| 55 | - da[ind]['original_img'] = gd; | |
| 56 | - th.setData({ comments: da, }) | |
| 57 | - }, | |
| 58 | - }); | |
| 59 | - })---*/ | |
| 60 | - | |
| 61 | - | |
| 62 | - }, null, { store_id: os.stoid, user_id: oo.user_id }), | |
| 63 | - wx.stopPullDownRefresh(); | |
| 64 | - }else{ | |
| 65 | - a.request(n, function(t) { | |
| 66 | - e.data.currentPage++; | |
| 67 | - var da = th.data.comments; | |
| 68 | 61 | |
| 69 | - /*-- | |
| 70 | - da.forEach(function (em, ind) { | |
| 71 | - rq.get("/api/weshop/goods/get/" + os.stoid + "/" + em.goods_id, { | |
| 72 | - success: function (tt) { | |
| 73 | - var gd = tt.data.data.original_img; | |
| 74 | - da[ind]['original_img'] = gd; | |
| 75 | - th.setData({ comments: da, }) | |
| 76 | - }, | |
| 77 | - }); | |
| 78 | - });--*/ | |
| 79 | - | |
| 80 | - }, null, {is_comment:t, store_id: os.stoid,user_id: oo.user_id }), | |
| 81 | - wx.stopPullDownRefresh(); | |
| 82 | - } | |
| 83 | - | |
| 84 | - }, | |
| 85 | - onReachBottom: function() { | |
| 86 | - a.canloadMore() && this.requestComments(this.data.activeStatus); | |
| 87 | - }, | |
| 88 | - onPullDownRefresh: function(t) { | |
| 89 | - this.resetData(), this.requestComments(this.data.activeStatus); | |
| 90 | - }, | |
| 91 | - resetData: function() { | |
| 92 | - this.data.comments = null, this.data.currentPage = 1, a.resetConfig(); | |
| 93 | - }, | |
| 94 | - /*-----评论-----*/ | |
| 95 | - comment: function(t) { | |
| 96 | - for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++) ; | |
| 97 | - if (!(s >= a.length)) { | |
| 62 | + if(e.data.order_id) n+="&order_id="+e.data.order_id; | |
| 63 | + var rq_data={store_id: os.stoid, user_id: oo.user_id}; | |
| 64 | + if (t!= 2) {rq_data['is_comment']=t;} | |
| 65 | + | |
| 66 | + var rs_data=null,com_data=this.data.comments; | |
| 67 | + await getApp().request.promiseGet(n,{data:rq_data}).then(res=>{ | |
| 68 | + e.data.currentPage++ | |
| 69 | + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ | |
| 70 | + rs_data=res.data.data.pageData; | |
| 71 | + }else{ | |
| 72 | + th.setData({ is_no_more: 1, }) | |
| 73 | + } | |
| 74 | + }) | |
| 98 | 75 | |
| 99 | - console.log("comment"); | |
| 100 | - console.log(a[s]); | |
| 76 | + if(rs_data){ | |
| 77 | + for(var ind in rs_data ){ | |
| 78 | + var em=rs_data[ind] | |
| 79 | + await getApp().request.promiseGet("/api/weshop/comment/pageComment", { | |
| 80 | + data:{ store_id: os.stoid, goods_id: em.goods_id, | |
| 81 | + pageSize: 3, parent_id: em.comment_id, page:1} | |
| 82 | + }).then(res=>{ | |
| 83 | + if(res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) | |
| 84 | + rs_data[ind].replay_list=res.data.data.pageData; | |
| 85 | + }) | |
| 86 | + if (em.img != undefined && em.img != null && ut.isString(em.img)) rs_data[ind].img = ut.unserialize(em.img); | |
| 87 | + var str = em.weapp_img; | |
| 88 | + if (str != "" && ut.isString(str)) rs_data[ind].weapp_img = JSON.parse(str); | |
| 89 | + rs_data[ind].original_img=this.data.iurl+rs_data[ind].original_img; | |
| 90 | + } | |
| 101 | 91 | |
| 102 | - var n = "?order_id=" + a[s].order_id; | |
| 103 | - n += "&goods_id=" + a[s].goods_id, n += "&goods_name=" + a[s].goods_name, n += "&price=" + a[s].goods_price, | |
| 104 | - n += "&img=" + a[s].original_img, | |
| 105 | - wx.navigateTo({ | |
| 106 | - url: "/pages/user/add_comment/add_comment" + n | |
| 107 | - }); | |
| 92 | + if(!com_data) com_data=rs_data; | |
| 93 | + else com_data= com_data.concat(rs_data); | |
| 94 | + th.setData({ comments: com_data, isloaded: 1, }) | |
| 108 | 95 | } |
| 109 | 96 | }, |
| 110 | 97 | |
| 111 | - //图片失败,默认图片 | |
| 112 | - bind_bnerr2: function (e) { | |
| 113 | - var _errImg = e.target.dataset.errorimg; | |
| 114 | - var _errObj = {}; | |
| 115 | - _errObj[_errImg] = this.data.iurl+"/public/images/default_goods_image_240.gif"; | |
| 116 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 117 | - } | |
| 98 | + onReachBottom: function() { | |
| 99 | + if(this.data.is_no_more) return false; | |
| 100 | + //a.canloadMore() && this.requestComments(this.data.activeStatus); | |
| 101 | + this.requestComments_new(this.data.activeStatus); | |
| 102 | + }, | |
| 103 | + | |
| 104 | + | |
| 105 | + onPullDownRefresh: function(t) { | |
| 106 | + this.resetData(), this.requestComments_new(this.data.activeStatus); | |
| 107 | + }, | |
| 108 | + resetData: function() { | |
| 109 | + this.data.comments = null, this.data.currentPage = 1, this.data.is_no_more=0, a.resetConfig(); | |
| 110 | + }, | |
| 111 | + /*-----评论-----*/ | |
| 112 | + comment: function(t) { | |
| 113 | + for (var e = t.currentTarget.dataset.recid, a = this.data.comments, s = 0; s < a.length && a[s].rec_id != e; s++); | |
| 114 | + if (!(s >= a.length)) { | |
| 115 | + var n = "?order_id=" + a[s].order_id; | |
| 116 | + n += "&goods_id=" + a[s].goods_id, n += "&price=" + a[s].goods_price; | |
| 117 | + wx.navigateTo({ | |
| 118 | + url: "/pages/user/add_comment/add_comment" + n | |
| 119 | + }); | |
| 120 | + } | |
| 121 | + }, | |
| 122 | + | |
| 123 | + //图片失败,默认图片 | |
| 124 | + bind_bnerr2: function(e) { | |
| 125 | + var _errImg = e.currentTarget.dataset.errorimg; | |
| 126 | + var _errObj = {}; | |
| 127 | + _errObj[_errImg] = os.imghost + "/public/images/default_goods_image_240.gif"; | |
| 128 | + //this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 129 | + }, | |
| 130 | + //预览图片 | |
| 131 | + previewImg: function(e) { | |
| 132 | + var index = e.currentTarget.dataset.index; | |
| 133 | + var sindex = e.currentTarget.dataset.sindex; | |
| 134 | + var name = e.currentTarget.dataset.name; | |
| 135 | + var imgArr = this.data.comments; | |
| 136 | + var image = null; | |
| 137 | + if (name == "img") { | |
| 138 | + image = imgArr[index].img[sindex]; | |
| 139 | + } else { | |
| 140 | + image = imgArr[index].weapp_img[sindex]; | |
| 141 | + } | |
| 142 | + wx.previewImage({ | |
| 143 | + current: image, | |
| 144 | + //当前图片地址 | |
| 145 | + urls: imgArr[index].weapp_img, //所有要预览的图片的地址集合 数组形式 | |
| 146 | + }) | |
| 147 | + }, | |
| 148 | + //跳到首页 | |
| 149 | + goto: function(ee) { | |
| 150 | + wx.switchTab({ | |
| 151 | + url: '/pages/index/index/index', | |
| 152 | + }) | |
| 153 | + }, | |
| 118 | 154 | |
| 119 | 155 | }); |
| 120 | 156 | \ No newline at end of file | ... | ... |
pages/user/comment/comment.wxml
| 1 | +<wxs module="filter" src="../../../utils/filter.wxs"></wxs> | |
| 1 | 2 | <view class="container"> |
| 2 | - <view class="type-navbar"> | |
| 3 | - <view class="type-box" wx:for="{{categories}}" wx:key="{{index}}"> | |
| 4 | - <view bindtap="changeTab" class="type-navbar-item {{activeStatus==item.status?'type-item-on':''}}" data-status="{{item.status}}"> | |
| 5 | - {{item.name}} | |
| 6 | - </view> | |
| 7 | - </view> | |
| 3 | + <view class="type-navbar padding"> | |
| 4 | + <view class="type-box fs28 type-navbar-item {{activeStatus==item.status?'type-item-on':''}}" data-status="{{item.status}}" wx:for="{{categories}}" wx:key="{{index}}"> | |
| 5 | + <view class="title_width" bindtap="changeTab" data-status="{{item.status}}">{{item.name}}</view> | |
| 8 | 6 | </view> |
| 9 | - | |
| 10 | - <view class="goods-container" wx:for="{{comments}}" wx:key="{{index}}"> | |
| 11 | - <view class="goods-box"> | |
| 12 | - <navigator class="goods-img" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 13 | - <image class="wh100" src="{{item.original_img}}" binderror="bind_bnerr2" lazy-load="true" | |
| 14 | - data-url="{{item.original_img}}" data-errorimg="comments[{{index}}].original_img"></image> | |
| 15 | - </navigator> | |
| 16 | - <navigator class="goods-desc" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
| 17 | - <view class="goods-name ellipsis-1">{{item.goods_name}}</view> | |
| 18 | - <view class="goods-name ellipsis-1">{{item.spec_key_name}}</view> | |
| 19 | - <view class="buy-time">购买时间:{{item.order_add_time}}</view> | |
| 20 | - </navigator> | |
| 21 | - <navigator class="comment-button change-order" hidden="{{!item.comment_id}}" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | |
| 22 | - <image class="button-icon" src="{{iurl}}/miniapp/images/c23.png"></image> 查看订单 | |
| 23 | - </navigator> | |
| 24 | - <view bindtap="comment" class="comment-button" data-recid="{{item.rec_id}}" hidden="{{item.comment_id}}"> | |
| 25 | - <image class="button-icon" src="{{iurl}}/miniapp/images/co.png"></image> 评价商品 | |
| 7 | + | |
| 8 | + </view> | |
| 9 | + | |
| 10 | +<!-- 无评价 --> | |
| 11 | +<view class="noCollection" wx:if="{{(!comments||comments.length==0) && isloaded}}"> | |
| 12 | + <view class="flex-level"> | |
| 13 | + <image src="{{iurl}}/miniapp/images/comment.png"></image> | |
| 14 | + </view> | |
| 15 | + <view class="flex-level fs30 xc-ash">当前暂无评价</view> | |
| 16 | + <view class="flex-level"> | |
| 17 | + <navigator url="/pages/index/index/index" bindtap="goto"> | |
| 18 | + <view class="flex-center fs28 white">去首页逛逛</view> | |
| 19 | + </navigator> | |
| 20 | + </view> | |
| 21 | +</view> | |
| 22 | + | |
| 23 | + <!-- 待评价栏 --> | |
| 24 | + <view class="stay_evaluate" wx:if="{{comments.length>0}}" wx:for="{{comments}}"> | |
| 25 | + | |
| 26 | + <!-- 商品编号和状态 --> | |
| 27 | + <view class="Commodity_number flex-vertical-between fs26 padding border_bottom"> | |
| 28 | + <!--商品编号 --> | |
| 29 | + <view>订单编号:{{item.order_sn}}</view> | |
| 30 | + <!-- 商品评价状态 --> | |
| 31 | + <view class="xc-wc">{{item.comment_id>0?'已评价':'待评价'}}</view> | |
| 32 | + </view> | |
| 33 | + | |
| 34 | + <!-- 商品详情集合 --> | |
| 35 | + <view class="detail_commoditys"> | |
| 36 | + <!-- 单个商品 --> | |
| 37 | + <view> | |
| 38 | + <navigator class="detail_commodity flex-vertical padding border_bottom" url="{{'/pages/goods/goodsInfo/goodsInfo?goods_id='+item.goods_id}}"> | |
| 39 | + <!-- 商品图片 --> | |
| 40 | + <image src="{{item.original_img}}" binderror="bind_bnerr2" data-errorimg="comments[{{index}}].original_img"></image> | |
| 41 | + <!-- 商品内容 --> | |
| 42 | + <view class="Commodity_content"> | |
| 43 | + <view class="Commodity_goods"> | |
| 44 | + <!-- 商品名称 --> | |
| 45 | + <view class="goods_name ellipsis-2 fs26">{{item.goods_name}}</view> | |
| 46 | + <!-- 商品规格 --> | |
| 47 | + <view class="Commodity_spec fs20"> | |
| 48 | + <view class="flex-center">{{item.goods_color+item.goods_spec.length>-1?item.goods_color+item.goods_spec:'规格1'}}</view> | |
| 49 | + </view> | |
| 50 | + </view> | |
| 51 | + <!-- 商品价格数量 --> | |
| 52 | + <view class="Commodity_money flex-vertical-between baseline"> | |
| 53 | + <!-- 商品价格 --> | |
| 54 | + <view class="flex-vertical xc-wc baseline"> | |
| 55 | + <view class="fs20">¥</view> | |
| 56 | + <view class="fs30">{{filter.toFix(item.goods_price,2)}}</view> | |
| 57 | + </view> | |
| 58 | + <view class="fs26">x{{item.goods_num}}</view> | |
| 59 | + | |
| 26 | 60 | </view> |
| 61 | + </view> | |
| 62 | + </navigator> | |
| 63 | + <!-- 评论信息 --> | |
| 64 | + <view class="Commodity_evaluation padding border_bottom" wx:if="{{item.comment_id>0}}"> | |
| 65 | + <!-- 评价星级 --> | |
| 66 | + <view class="starss flex fs26"> | |
| 67 | + <view class="commen">评价:</view> | |
| 68 | + <view class="stars"> | |
| 69 | + <image | |
| 70 | + src="{{imaitem>=item.deliver_rank?iurl+'/miniapp/images/StarswhiteUnCk.png':iurl+'/miniapp/images/StarsredCk.png'}}" data-ind="{{imaitem}}" data-oo="{{item.deliver_rank}}" wx:for="{{5}}" wx:for-index="imaitem" wx:for-item="{{item_start}}"></image> | |
| 71 | + </view> | |
| 72 | + </view> | |
| 73 | + <!-- 评价内容 --> | |
| 74 | + <view class="Comment_content ellipsis-2 fs24">{{item.content.length>0?item.content:'此用户没有填写评论'}}</view> | |
| 75 | + <view class="Comment_images flex"> | |
| 76 | + <image bindtap="previewImg" wx:if="{{item.source_type==0 && aitem.length>10}}" data-index="{{index}}" src="{{aitem}}" wx:for="{{item.img}}" wx:for-item="aitem" wx:for-index="i" data-sindex="{{i}}" data-name="img"></image> | |
| 77 | + <image bindtap="previewImg" wx:if="{{item.source_type==1 && aitem.length>10}}" src="{{aitem}}" wx:for-index="i" data-index="{{index}}" wx:for="{{item.weapp_img}}" wx:for-item="aitem" data-sindex="{{i}}" data-name="weapp_img"></image> | |
| 78 | + | |
| 79 | + </view> | |
| 80 | + | |
| 81 | + <!-- 商家回复 --> | |
| 82 | + <view class="reply rel" wx:if="{{item.replay_list}}"> | |
| 83 | + <view class="line_bulge"></view> | |
| 84 | + <view class="shop-reply fs26">店家回复: </view> | |
| 85 | + <view class="shop-font fs24" wx:for="{{item.replay_list}}" wx:for-item="r_item" wx:key="{{index}}"> | |
| 86 | + {{r_item.content}} | |
| 87 | + </view> | |
| 88 | + </view> | |
| 89 | + | |
| 90 | + | |
| 91 | + <!-- 评价时间 --> | |
| 92 | + <view class="fs24 xc-ash comment_addtime flex-vertical">{{item.comment_addtime}}</view> | |
| 27 | 93 | </view> |
| 28 | - <view class="clear" hidden="{{!item.comment_id}}"> | |
| 29 | - <view class="fview" >评价:<image class='start_c' src="{{iurl}}/miniapp/images/stars{{(item.deliver_rank+item.goods_rank+item.service_rank)/3}}.png"></image></view> | |
| 30 | - <view>{{item.content}}</view> | |
| 94 | + </view> | |
| 95 | + <!-- 去评价 --> | |
| 96 | + <view class="commodity_evaluate flex jc_sb padding baseline fs26"> | |
| 97 | + <!-- 商品数量 --> | |
| 98 | + <view class="commodity_smy flex"> | |
| 99 | + <view>共{{item.goods_num}}件商品</view> | |
| 100 | + <!-- 商品总价格 --> | |
| 101 | + <view class="flex commodity_money"> | |
| 102 | + <view>合计:</view> | |
| 103 | + <view class="flex baseline xc-wc"> | |
| 104 | + <view class="fs24">¥</view> | |
| 105 | + <view>{{filter.toFix(item.goods_price,2)}}</view> | |
| 106 | + </view> | |
| 107 | + </view> | |
| 31 | 108 | </view> |
| 109 | + <navigator wx:if="{{item.comment_id}}" class="commodity_To_evaluate flex-level View_evaluation fs24" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | |
| 110 | + <view>查看订单</view> | |
| 111 | + </navigator> | |
| 112 | + <navigator wx:if="{{!item.comment_id}}" bindtap="comment" data-recid="{{item.rec_id}}" class="commodity_To_evaluate flex-level comment_go" url="item.comment_id>0?'/pages/user/add_comment/add_comment':'' "> | |
| 113 | + <view class="fs24">去评价</view> | |
| 114 | + </navigator> | |
| 115 | + </view> | |
| 32 | 116 | </view> |
| 33 | - | |
| 34 | - <view class="no-data" wx:if="{{!comments||comments.length==0}}"> | |
| 35 | - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | |
| 36 | - <view class="no-data-title">没有找到相关的记录</view> | |
| 37 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 38 | - </view> | |
| 39 | -</view> | |
| 117 | + </view> | |
| 118 | + | |
| 119 | + <view class="get_bottom fs26" wx:if="{{comments.length>0 && is_no_more}}">已经加载到底部</view> | |
| 120 | + | |
| 121 | +</view> | |
| 40 | 122 | \ No newline at end of file | ... | ... |
pages/user/comment/comment.wxss
| 1 | +.padding { | |
| 2 | + padding: 0rpx 27rpx; | |
| 3 | +} | |
| 4 | + | |
| 5 | +.container { | |
| 6 | + background-color: rgb(255, 255, 255); | |
| 7 | +} | |
| 8 | + | |
| 1 | 9 | .type-navbar { |
| 2 | - white-space: nowrap; | |
| 3 | - display: flex; | |
| 4 | - width: 100%; | |
| 5 | - height: 80rpx; | |
| 6 | - background-color: #fff; | |
| 10 | + white-space: nowrap; | |
| 11 | + display: flex; | |
| 12 | + height: 80rpx; | |
| 13 | + background-color: #fff; | |
| 14 | + border-top: 2rpx solid rgb(221, 221, 221); | |
| 15 | + justify-content: space-between; | |
| 16 | + color: rgb(51, 51, 51); | |
| 7 | 17 | } |
| 8 | 18 | |
| 9 | 19 | .type-box { |
| 10 | - width: 33.3333333333%; | |
| 11 | - box-sizing: border-box; | |
| 12 | - font-size: 32rpx; | |
| 13 | - line-height: 76rpx; | |
| 14 | - padding: 0 20rpx; | |
| 15 | - text-align: center; | |
| 16 | - display: inline-block; | |
| 17 | - overflow: hidden; | |
| 20 | + box-sizing: border-box; | |
| 21 | + line-height: 76rpx; | |
| 22 | + text-align: center; | |
| 23 | + display: inline-block; | |
| 24 | + overflow: hidden; | |
| 18 | 25 | } |
| 19 | 26 | |
| 20 | 27 | .type-navbar-item { |
| 21 | - border-bottom: 4rpx solid #fff; | |
| 28 | + border-bottom: 4rpx solid #fff; | |
| 22 | 29 | } |
| 23 | 30 | |
| 24 | 31 | .type-item-on { |
| 25 | - border-bottom: 4rpx solid #e64340; | |
| 32 | + /* width: 146rpx; */ | |
| 33 | + border-bottom: 7rpx solid #e64340; | |
| 34 | +} | |
| 35 | + | |
| 36 | +.border_bottom { | |
| 37 | + border-bottom: 3rpx solid rgb(245, 245, 245); | |
| 38 | +} | |
| 39 | +/* 无评价 */ | |
| 40 | + | |
| 41 | +.noCollection image { | |
| 42 | + width: 329rpx; | |
| 43 | + height: 229rpx; | |
| 44 | + margin-top: 202rpx; | |
| 45 | +} | |
| 46 | + | |
| 47 | +.noCollection .xc-ash { | |
| 48 | + margin-top: 10rpx; | |
| 49 | + font-weight: 600px; | |
| 50 | +} | |
| 51 | + | |
| 52 | +.noCollection navigator { | |
| 53 | + margin-top: 60rpx; | |
| 54 | + border-radius: 40rpx; | |
| 55 | +} | |
| 56 | + | |
| 57 | +.noCollection navigator view { | |
| 58 | + width: 247rpx; | |
| 59 | + height: 56rpx; | |
| 60 | + background-color: rgb(255, 72, 72); | |
| 61 | + border-radius: 40rpx; | |
| 62 | +} | |
| 63 | + | |
| 64 | +/* 待评价栏 */ | |
| 65 | + | |
| 66 | +.Commodity_number { | |
| 67 | + height: 70rpx; | |
| 68 | + border-top: 13rpx solid rgb(245, 245, 245); | |
| 69 | +} | |
| 70 | + | |
| 71 | +/* 文字基线对齐 */ | |
| 72 | + | |
| 73 | +.baseline { | |
| 74 | + display: flex; | |
| 75 | + align-items: baseline; | |
| 76 | +} | |
| 77 | + | |
| 78 | +/* 单个商品框架 */ | |
| 79 | + | |
| 80 | +.detail_commodity { | |
| 81 | + height: 231rpx; | |
| 82 | +} | |
| 83 | + | |
| 84 | +.detail_commodity image { | |
| 85 | + width: 185rpx; | |
| 86 | + height: 185rpx; | |
| 26 | 87 | } |
| 27 | 88 | |
| 28 | -.goods-container { | |
| 29 | - /*--margin: 20rpx 0;--*/ | |
| 30 | - margin-top: 20rpx; | |
| 31 | - background-color: #fff; | |
| 89 | +.detail_commodity .goods_name { | |
| 90 | + width: 485rpx; | |
| 91 | + /* height: 75rpx; */ | |
| 92 | + line-height: 37rpx; | |
| 32 | 93 | } |
| 33 | 94 | |
| 34 | -.goods-box { | |
| 35 | - | |
| 36 | - position: relative; | |
| 37 | - padding: 20rpx 30rpx 0; | |
| 38 | - font-size: 28rpx; | |
| 39 | - clear: both; | |
| 95 | +.Commodity_content { | |
| 96 | + height: 185rpx; | |
| 97 | + margin-left: 21rpx; | |
| 40 | 98 | } |
| 41 | 99 | |
| 42 | -.goods-img { | |
| 43 | - float: left; | |
| 44 | - height: 100rpx; | |
| 45 | - width: 100rpx; | |
| 100 | +.Commodity_content .Commodity_goods { | |
| 101 | + height: 150rpx; | |
| 46 | 102 | } |
| 47 | 103 | |
| 48 | -.goods-desc { | |
| 49 | - float: left; | |
| 50 | - width: 570rpx; | |
| 51 | - margin-left: 20rpx; | |
| 104 | +.Commodity_content .Commodity_money { | |
| 105 | + font-size: 16rpx; | |
| 52 | 106 | } |
| 53 | 107 | |
| 54 | -.goods-name { | |
| 55 | - height: 44rpx; | |
| 56 | - line-height: 44rpx; | |
| 57 | - overflow: hidden; | |
| 108 | +/* 商品评价按钮框架 */ | |
| 109 | + | |
| 110 | +.commodity_evaluate { | |
| 111 | + height: 110rpx; | |
| 112 | + padding-top: 15rpx; | |
| 58 | 113 | } |
| 59 | 114 | |
| 60 | -.buy-time { | |
| 61 | - margin-top: 20rpx; | |
| 62 | - font-size: 26rpx; | |
| 63 | - color: #b3b3b3; | |
| 115 | +.commodity_evaluate .commodity_smy .commodity_money { | |
| 116 | + margin-left: 29rpx; | |
| 117 | + letter-spacing: 1rpx; | |
| 64 | 118 | } |
| 65 | 119 | |
| 66 | -.comment-button { | |
| 67 | - font-size: 30rpx; | |
| 68 | - color: #f23030; | |
| 69 | - float: right; | |
| 70 | - padding: 8rpx 10rpx; | |
| 71 | - border: 1rpx #f23030 solid; | |
| 72 | - margin-bottom: 20rpx; | |
| 120 | +.commodity_evaluate .commodity_To_evaluate { | |
| 121 | + width: 128rpx; | |
| 122 | + height: 39rpx; | |
| 123 | + border-radius: 9rpx; | |
| 124 | +} | |
| 125 | +.commodity_evaluate .commodity_To_evaluate view{ | |
| 126 | + height: 39rpx; | |
| 127 | + line-height: 39rpx; | |
| 128 | +} | |
| 129 | +.commodity_evaluate .comment_go{ | |
| 130 | + margin-top: 10rpx; | |
| 131 | + background-color: rgb(211, 28, 52); | |
| 132 | + color: rgb(255, 255, 255); | |
| 73 | 133 | } |
| 74 | 134 | |
| 75 | -.change-order { | |
| 76 | - color: #c2c2c2; | |
| 77 | - border: 1rpx #c2c2c2 solid; | |
| 135 | +.Commodity_spec { | |
| 136 | + width: 106rpx; | |
| 137 | + background-color: rgb(236, 236, 236); | |
| 138 | + border-radius: 7rpx; | |
| 139 | + font-size: 18rpx; | |
| 140 | + margin-top: 10rpx; | |
| 78 | 141 | } |
| 79 | 142 | |
| 80 | -.button-icon { height: 26rpx; width: 26rpx;} | |
| 81 | -.start_c{ | |
| 82 | - height: 42rpx; width: 230rpx; | |
| 83 | - top: 6rpx; position: relative; | |
| 143 | +.Commodity_spec view { | |
| 144 | + height: 28rpx; | |
| 145 | + align-items: center; | |
| 146 | +} | |
| 147 | + | |
| 148 | +.Commodity_evaluation .Comment_content { | |
| 149 | + color: rgb(153, 153, 153); | |
| 150 | + letter-spacing: 1rpx; | |
| 151 | +} | |
| 152 | +.Commodity_evaluation .starss{ | |
| 153 | + height: 58rpx; | |
| 154 | + /* // line-height: 58rpx; */ | |
| 155 | + align-items: center; | |
| 156 | +} | |
| 157 | +.Commodity_evaluation .commen{ | |
| 158 | + height: 58rpx; | |
| 159 | + line-height: 58rpx; | |
| 160 | +} | |
| 161 | +.Commodity_evaluation .starss .stars{ | |
| 162 | + line-height: 58rpx; | |
| 163 | +} | |
| 164 | +.Commodity_evaluation .starss .stars image { | |
| 165 | + width: 29rpx; | |
| 166 | + height: 26rpx; | |
| 167 | + margin-right: 5rpx; | |
| 168 | +} | |
| 169 | + | |
| 170 | +.Commodity_evaluation .Comment_images image { | |
| 171 | + width: 100rpx; | |
| 172 | + height: 100rpx; | |
| 173 | + margin-right: 8rpx; | |
| 174 | + margin-top: 18rpx; | |
| 175 | + border-radius: 6rpx; | |
| 176 | + border: 3rpx solid rgb(245, 245, 245); | |
| 177 | +} | |
| 178 | +.commodity_evaluate .View_evaluation{ | |
| 179 | + border:2rpx solid rgb(179, 179, 179); | |
| 180 | + color:rgb(0, 0, 0); | |
| 181 | + background-color: rgb(255, 255, 255); | |
| 182 | +} | |
| 183 | +.comment_addtime{ | |
| 184 | + height: 50rpx; | |
| 84 | 185 | } |
| 85 | -.clear{clear: both; border-top: 1rpx solid #eee; font-size: 30rpx; padding-left: 30rpx} | |
| 86 | -.clear view{margin-bottom: 10rpx;} | |
| 87 | -.clear .fview{margin-top: 10rpx;} | |
| 88 | 186 | \ No newline at end of file |
| 187 | +.title_width{ width: 146rpx; text-align:center } | |
| 188 | +.shop-font{ color: rgb(153, 153, 153);} | |
| 189 | +.reply{ margin-top: 10rpx} | |
| 190 | +.get_bottom{ text-align: center; color: #999; margin-bottom: 20rpx} | |
| 89 | 191 | \ No newline at end of file | ... | ... |
pages/user/index/index.js
| ... | ... | @@ -44,6 +44,7 @@ Page({ |
| 44 | 44 | var stoid = app_d.setting.stoid; |
| 45 | 45 | var s = this,th=s,need_money=0,cur_g_num=0; |
| 46 | 46 | getApp().get_isbuy(th.setappdata); |
| 47 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | |
| 47 | 48 | |
| 48 | 49 | /*------会员登录------*/ |
| 49 | 50 | app.getUserFir(async function(e){ | ... | ... |
pages/user/order_detail/order_detail.wxml
| ... | ... | @@ -125,6 +125,7 @@ |
| 125 | 125 | <view wx:if="{{order.tail_pay_type==1}}">¥ {{filters.toFix(order.user_money+order.pt_tail_money,2)}}元</view> |
| 126 | 126 | <view wx:else>¥ {{filters.toFix(order.user_money,2)}}元</view> |
| 127 | 127 | </view> |
| 128 | + <view style="height:10rpx"></view> | |
| 128 | 129 | </view> |
| 129 | 130 | |
| 130 | 131 | <view class="btn-wrap"> |
| ... | ... | @@ -149,6 +150,13 @@ |
| 149 | 150 | <navigator class="tips-btn" wx:if="{{order.is_all_return_status==0 || order.is_all_return_status==1}}" |
| 150 | 151 | url="/pages/user/return_goods_info/return_goods_info?order_id={{order.order_id}}">退款详情</navigator> |
| 151 | 152 | </block> |
| 153 | + | |
| 154 | + <block wx:if="{{order.order_status==2 && order.is_zsorder!=4}}"> | |
| 155 | + <navigator wx:if="{{order.order_goods.length>1}}" class="tips-btn" | |
| 156 | + url="/pages/user/comment/comment?status=0&order_id={{order.order_id}}">评价{{order.order_goods.length}}</navigator> | |
| 157 | + <navigator wx:else class="tips-btn" | |
| 158 | + url="/pages/user/add_comment/add_comment?goods_id={{order.order_goods[0].goods_id}}&order_id={{order.order_id}}}">去评价</navigator> | |
| 159 | + </block> | |
| 152 | 160 | </view> |
| 153 | 161 | </view> |
| 154 | 162 | ... | ... |
pages/user/order_detail/order_detail.wxss
pages/user/order_list/order_list.js
| 1 | 1 | var t = function(t) { |
| 2 | 2 | return t && t.__esModule ? t : { |
| 3 | - default: t | |
| 3 | + default: t | |
| 4 | 4 | }; |
| 5 | -}(require("../../../utils/LoadMore.js")), e = getApp(),os=e.globalData.setting,oo=e.globalData, | |
| 6 | - r = e.request,rq=r, a = require("../../../utils/common.js"), s = new t.default(); | |
| 5 | + }(require("../../../utils/LoadMore.js")), | |
| 6 | + e = getApp(), | |
| 7 | + os = e.globalData.setting, | |
| 8 | + oo = e.globalData, | |
| 9 | + r = e.request, | |
| 10 | + rq = r, | |
| 11 | + a = require("../../../utils/common.js"), | |
| 12 | + s = new t.default(); | |
| 7 | 13 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 8 | 14 | |
| 9 | 15 | Page({ |
| 10 | - data: { | |
| 11 | - url: e.globalData.setting.url, | |
| 12 | - resourceUrl: e.globalData.setting.imghost, | |
| 13 | - iurl: e.globalData.setting.imghost, | |
| 14 | - categories: [ { | |
| 15 | - name: "全部订单",id: 0 | |
| 16 | - }, { | |
| 17 | - name: "待付款",id: 1 | |
| 18 | - }, { | |
| 19 | - name: "待发货",id: 2 | |
| 20 | - }, { | |
| 21 | - name: "待收货",id: 3 | |
| 22 | - }, { | |
| 23 | - name: "待评价",id: 4 | |
| 24 | - } ], | |
| 25 | - activeCategoryId: 0, | |
| 26 | - orderList: null, | |
| 27 | - currentPage: 1, | |
| 28 | - | |
| 29 | - //已经读取过接口 | |
| 30 | - is_get:0, | |
| 31 | - conf:null, | |
| 32 | - }, | |
| 33 | - onLoad: function(t) { | |
| 34 | - var th=this; | |
| 35 | - //var e = void 0 === t.type ? this.data.activeCategoryId : t.type; | |
| 36 | - if(t.type!=undefined) this.setData({activeCategoryId:t.type}) | |
| 37 | - s.init(this, "", "orderList"); | |
| 38 | - //this.requestOrderList(e), wx.removeStorageSync("order:order_list:update"); | |
| 39 | - getApp().getConfig2(function (e) { | |
| 40 | - th.setData({conf:e}); | |
| 41 | - }) | |
| 42 | - }, | |
| 43 | - onShow: function() { | |
| 44 | - //wx.getStorageSync("order:order_list:update") && (wx.setStorageSync("order:order_list:update", !1), | |
| 45 | - this.resetData(), this.requestOrderList(this.data.activeCategoryId); | |
| 46 | - }, | |
| 47 | - changeTab: function(t) { | |
| 48 | - this.resetData(), this.requestOrderList(t.currentTarget.id); | |
| 49 | - }, | |
| 50 | - resetData: function() { | |
| 51 | - s.resetConfig(), this.data.orderList = null, this.data.currentPage = 1; | |
| 52 | - }, | |
| 53 | - | |
| 54 | - /*---------获取订单列表--------*/ | |
| 55 | - requestOrderList: function(t) { | |
| 56 | - var rd=Math.random()*100; | |
| 57 | - var e = this,th=e, r = e.data.url + "/api/weshop/order/page?rd="+rd, a = ""; | |
| 58 | - switch(t){ | |
| 59 | - case "1": | |
| 60 | - r += "&wait_status=0"; break; | |
| 61 | - case "2": | |
| 62 | - r += "&wait_status=1"; break; | |
| 63 | - case "3": | |
| 64 | - r += "&wait_status=2";break; | |
| 65 | - case "4": | |
| 66 | - r +="&order_status=2"; break; | |
| 67 | - } | |
| 16 | + data: { | |
| 17 | + url: e.globalData.setting.url, | |
| 18 | + resourceUrl: e.globalData.setting.imghost, | |
| 19 | + iurl: e.globalData.setting.imghost, | |
| 20 | + categories: [{ | |
| 21 | + name: "全部订单", | |
| 22 | + id: 0 | |
| 23 | + }, { | |
| 24 | + name: "待付款", | |
| 25 | + id: 1 | |
| 26 | + }, { | |
| 27 | + name: "待发货", | |
| 28 | + id: 2 | |
| 29 | + }, { | |
| 30 | + name: "待收货", | |
| 31 | + id: 3 | |
| 32 | + }, { | |
| 33 | + name: "待评价", | |
| 34 | + id: 4 | |
| 35 | + }], | |
| 36 | + activeCategoryId: 0, | |
| 37 | + orderList: null, | |
| 38 | + currentPage: 1, | |
| 39 | + //已经读取过接口 | |
| 40 | + is_get: 0, | |
| 41 | + conf: null, | |
| 42 | + iscodeall: null | |
| 43 | + }, | |
| 44 | + onLoad: function(t) { | |
| 45 | + var th = this; | |
| 46 | + if (t.type != undefined) this.setData({ | |
| 47 | + activeCategoryId: t.type | |
| 48 | + }) | |
| 49 | + s.init(this, "", "orderList"); | |
| 50 | + getApp().getConfig2(function(e) { | |
| 51 | + th.setData({ | |
| 52 | + conf: e | |
| 53 | + }); | |
| 54 | + }) | |
| 55 | + }, | |
| 56 | + onShow: function() { | |
| 57 | + this.resetData(), this.requestOrderList(this.data.activeCategoryId); | |
| 58 | + }, | |
| 59 | + changeTab: function(t) { | |
| 60 | + if (this.data.activeCategoryId == t.currentTarget.id) return false; | |
| 61 | + this.resetData(), this.requestOrderList(t.currentTarget.id); | |
| 62 | + }, | |
| 63 | + resetData: function() { | |
| 64 | + s.resetConfig(), this.data.orderList = null, this.data.currentPage = 1; | |
| 65 | + }, | |
| 68 | 66 | |
| 69 | - this.setData({ activeCategoryId: t }); r = r + "&page=" + e.data.currentPage; | |
| 70 | - s.request(r, function(t) { | |
| 71 | 67 | |
| 72 | - th.setData({is_get:1}); | |
| 73 | - var data=e.data.orderList; | |
| 74 | - data.forEach(async function (item,ind){ | |
| 75 | - var tt =null; | |
| 76 | - await getApp().request.promiseGet('/api/weshop/ordergoods/list',{ | |
| 77 | - data: {order_id: item.order_id, store_id:os.stoid,pageSize:600}, | |
| 78 | - }).then(res=>{ | |
| 79 | - tt=res; | |
| 80 | - }) | |
| 68 | + /*---------获取订单列表--------*/ | |
| 69 | + requestOrderList: function (t) { | |
| 70 | + var rd = Math.random() * 100; | |
| 71 | + var e = this, th = e, r = e.data.url + "/api/weshop/order/page?rd=" + rd, a = ""; | |
| 72 | + switch (t) { | |
| 73 | + case "1": | |
| 74 | + r += "&wait_status=0"; break; | |
| 75 | + case "2": | |
| 76 | + r += "&wait_status=1"; break; | |
| 77 | + case "3": | |
| 78 | + r += "&wait_status=2"; break; | |
| 79 | + case "4": | |
| 80 | + r += "&order_status=2"; break; | |
| 81 | + } | |
| 82 | + this.setData({ activeCategoryId: t }); r = r + "&page=" + e.data.currentPage; | |
| 83 | + s.request(r, function (t) { | |
| 81 | 84 | |
| 82 | - //------------对比一下有没有退款记录------------ | |
| 83 | - await getApp().request.promiseGet("/api/weshop/order/returngoods/page",{ | |
| 84 | - data: { order_id: item.order_id, store_id: os.stoid, | |
| 85 | - user_id:oo.user_id, pageSize: 20 } | |
| 86 | - }).then(rs=>{ | |
| 87 | - var ttd=rs; | |
| 88 | - //--看一下订单的总数量-- | |
| 89 | - var gtype_num = tt.data.data.total; | |
| 90 | - if(ttd.data.data.pageData == undefined) return false; | |
| 91 | - var goodslist = tt.data.data.pageData; | |
| 85 | + th.setData({ is_get: 1 }); | |
| 86 | + var data = e.data.orderList; | |
| 87 | + data.forEach(async function (item, ind) { | |
| 88 | + var tt = null; | |
| 89 | + await getApp().request.promiseGet('/api/weshop/ordergoods/list', { | |
| 90 | + data: { order_id: item.order_id, store_id: os.stoid, pageSize: 600 }, | |
| 91 | + }).then(res => { | |
| 92 | + tt = res; | |
| 93 | + }) | |
| 92 | 94 | |
| 93 | - //----没有相关的退款记录---- | |
| 94 | - if (ttd.data.data.total==0){ | |
| 95 | - data[ind]['is_all_return'] = 0; | |
| 96 | - goodslist.forEach(function (ee, ii) { | |
| 97 | - if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1 && gtype_num>1){ | |
| 95 | + //------------对比一下有没有退款记录------------ | |
| 96 | + await getApp().request.promiseGet("/api/weshop/order/returngoods/page", { | |
| 97 | + data: { | |
| 98 | + order_id: item.order_id, store_id: os.stoid, | |
| 99 | + user_id: oo.user_id, pageSize: 20 | |
| 100 | + } | |
| 101 | + }).then(rs => { | |
| 102 | + var ttd = rs; | |
| 103 | + //--看一下订单的总数量-- | |
| 104 | + var gtype_num = tt.data.data.total; | |
| 105 | + if (ttd.data.data.pageData == undefined) return false; | |
| 106 | + var goodslist = tt.data.data.pageData; | |
| 98 | 107 | |
| 99 | - //empty($list.coupon_no) && empty($list.order_prom_id) && $list.order_status lt 2 && empty($list.is_prom) | |
| 100 | - //&& ($tpshop_config['refund_type'] eq 0 || ($tpshop_config['refund_type'] eq 1 && ($list['order_amount'] eq 0 | |
| 101 | - // || $list['user_money'] eq 0))) | |
| 102 | - item.goodslist=goodslist; | |
| 103 | - if(th.check_for_return_btn(item) ) { | |
| 104 | - goodslist[ii]['return_btn'] = 1; | |
| 105 | - } | |
| 106 | - } | |
| 108 | + //----没有相关的退款记录---- | |
| 109 | + if (ttd.data.data.total == 0) { | |
| 110 | + data[ind]['is_all_return'] = 0; | |
| 111 | + goodslist.forEach(function (ee, ii) { | |
| 112 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1 && gtype_num > 1) { | |
| 113 | + item.goodslist = goodslist; | |
| 114 | + if (th.check_for_return_btn(item)) { | |
| 115 | + goodslist[ii]['return_btn'] = 1; | |
| 116 | + } | |
| 117 | + } | |
| 107 | 118 | |
| 108 | - }); | |
| 109 | - }else{ | |
| 110 | - //--------整单退-------- | |
| 111 | - if (ttd.data.data.pageData[0]['goods_id_list'] != null | |
| 112 | - && ttd.data.data.pageData[0]['goods_id_list'] != ''){ | |
| 113 | - var eea = ttd.data.data.pageData[0]; | |
| 114 | - //1.退款正在进行中, | |
| 115 | - //2.退款被拒绝就要显示可以退款 | |
| 116 | - //3.退款已经完成 | |
| 117 | - data[ind]['is_all_return']=1; | |
| 118 | - data[ind]['is_all_return_status'] = ttd.data.data.pageData[0].status; | |
| 119 | + }); | |
| 120 | + } else { | |
| 121 | + //--------整单退-------- | |
| 122 | + if (ttd.data.data.pageData[0]['goods_id_list'] != null | |
| 123 | + && ttd.data.data.pageData[0]['goods_id_list'] != '') { | |
| 124 | + var eea = ttd.data.data.pageData[0]; | |
| 125 | + //1.退款正在进行中, | |
| 126 | + //2.退款被拒绝就要显示可以退款 | |
| 127 | + //3.退款已经完成 | |
| 128 | + data[ind]['is_all_return'] = 1; | |
| 129 | + data[ind]['is_all_return_status'] = ttd.data.data.pageData[0].status; | |
| 119 | 130 | |
| 120 | - if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { | |
| 121 | - switch (eea.status) { | |
| 122 | - case 0: | |
| 123 | - case 1: | |
| 124 | - data[ind]['return_btn'] = 2; break; | |
| 125 | - case 2: | |
| 126 | - data[ind]['return_btn'] = 4; break; | |
| 127 | - case 3: | |
| 128 | - data[ind]['return_btn'] = 3; break; | |
| 129 | - default: | |
| 130 | - data[ind]['return_btn'] = 0; | |
| 131 | - } | |
| 132 | - } | |
| 133 | - }else{ | |
| 134 | - //1.退款正在进行中, | |
| 135 | - //2.退款被拒绝就要显示可以退款 | |
| 136 | - //3.退款已经完成 | |
| 137 | - data[ind]['is_all_return'] = 0; | |
| 138 | - var rt_ok_num=0; | |
| 131 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { | |
| 132 | + switch (eea.status) { | |
| 133 | + case 0: | |
| 134 | + case 1: | |
| 135 | + data[ind]['return_btn'] = 2; break; | |
| 136 | + case 2: | |
| 137 | + data[ind]['return_btn'] = 4; break; | |
| 138 | + case 3: | |
| 139 | + data[ind]['return_btn'] = 3; break; | |
| 140 | + default: | |
| 141 | + data[ind]['return_btn'] = 0; | |
| 142 | + } | |
| 143 | + } | |
| 144 | + } else { | |
| 145 | + //1.退款正在进行中, | |
| 146 | + //2.退款被拒绝就要显示可以退款 | |
| 147 | + //3.退款已经完成 | |
| 148 | + data[ind]['is_all_return'] = 0; | |
| 149 | + var rt_ok_num = 0; | |
| 150 | + //if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { | |
| 151 | + goodslist.forEach(function (eeb, iii) { | |
| 152 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | |
| 153 | + goodslist[iii]['return_btn'] = 1; //申请退款 | |
| 154 | + ttd.data.data.pageData.forEach(function (eea, ii) { | |
| 155 | + var st = eea.status; | |
| 156 | + if (eea.goods_id == eeb.goods_id) { | |
| 157 | + switch (eea.status) { | |
| 158 | + case 0: | |
| 159 | + case 1://退款处理中 | |
| 160 | + data[ind]['has_rt'] = 1; //有部分退 | |
| 161 | + goodslist[iii]['return_btn'] = 2; break; | |
| 162 | + case 2://退款完成 | |
| 163 | + goodslist[iii]['return_btn'] = 4; rt_ok_num++; break; | |
| 164 | + case 3://已拒绝,重新退款 | |
| 165 | + goodslist[iii]['return_btn'] = 3; break; | |
| 166 | + default: | |
| 167 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | |
| 168 | + goodslist[iii]['return_btn'] = 1; //申请退款 | |
| 169 | + } | |
| 170 | + return; | |
| 171 | + } | |
| 172 | + }); | |
| 173 | + }); | |
| 174 | + //} | |
| 175 | + } | |
| 176 | + } | |
| 139 | 177 | |
| 140 | - //if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { | |
| 141 | - goodslist.forEach(function (eeb, iii) { | |
| 142 | - if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | |
| 143 | - goodslist[iii]['return_btn'] = 1; //申请退款 | |
| 144 | - ttd.data.data.pageData.forEach(function (eea, ii) { | |
| 145 | - var st = eea.status; | |
| 146 | - if (eea.goods_id == eeb.goods_id){ | |
| 147 | - switch (eea.status){ | |
| 148 | - case 0: | |
| 149 | - case 1://退款处理中 | |
| 150 | - data[ind]['has_rt'] = 1; //有部分退 | |
| 151 | - goodslist[iii]['return_btn'] = 2; break; | |
| 152 | - case 2://退款完成 | |
| 153 | - goodslist[iii]['return_btn'] = 4; rt_ok_num++; break; | |
| 154 | - case 3://已拒绝,重新退款 | |
| 155 | - goodslist[iii]['return_btn'] = 3; break; | |
| 156 | - default: | |
| 157 | - if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | |
| 158 | - goodslist[iii]['return_btn'] = 1; //申请退款 | |
| 159 | - } | |
| 160 | - return; | |
| 161 | - } | |
| 162 | - }); | |
| 163 | - }); | |
| 164 | - //} | |
| 165 | - } | |
| 166 | - } | |
| 178 | + //--如果是全部退款,也就可以删除-- | |
| 179 | + if (rt_ok_num == goodslist.length) { | |
| 180 | + data[ind]['is_all_return_status'] = 2; | |
| 181 | + } | |
| 167 | 182 | |
| 168 | - //--如果是全部退款,也就可以删除-- | |
| 169 | - if(rt_ok_num==goodslist.length){ | |
| 170 | - data[ind]['is_all_return_status']=2; | |
| 171 | - } | |
| 172 | - | |
| 173 | - data[ind]['order_goods'] = goodslist; | |
| 174 | - var g_num = 0; | |
| 175 | - goodslist.forEach(function (ee, ii) { | |
| 176 | - if(ee.return_btn!=4) | |
| 177 | - g_num += ee.goods_num; | |
| 178 | - }); | |
| 179 | - data[ind]['g_num'] = g_num; | |
| 180 | - }) | |
| 181 | - th.setData({ orderList: data, }); | |
| 182 | 183 | |
| 183 | - }); | |
| 184 | - e.data.currentPage++, | |
| 185 | - /*--- | |
| 186 | - t.data.result.forEach(function(t, e, r) { | |
| 187 | - t.goods_sum = t.order_goods.reduce(function(t, e) { | |
| 188 | - return t + e.goods_num; | |
| 189 | - }, 0); | |
| 190 | - }),---*/ | |
| 191 | - wx.stopPullDownRefresh(); | |
| 192 | - },null,{store_id:os.stoid,user_id:oo.user_id}); | |
| 193 | - }, | |
| 194 | - onReachBottom: function() { | |
| 195 | - s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); | |
| 196 | - }, | |
| 197 | - onPullDownRefresh: function(t) { | |
| 198 | - this.resetData(), this.requestOrderList(this.data.activeCategoryId); | |
| 199 | - }, | |
| 184 | + data[ind]['order_goods'] = goodslist; | |
| 185 | + var g_num = 0; | |
| 186 | + goodslist.forEach(function (ee, ii) { | |
| 187 | + if (ee.return_btn != 4) | |
| 188 | + g_num += ee.goods_num; | |
| 189 | + }); | |
| 190 | + data[ind]['g_num'] = g_num; | |
| 191 | + }) | |
| 192 | + th.setData({ orderList: data, }); | |
| 200 | 193 | |
| 201 | - /*-----------取消订单-----------*/ | |
| 202 | - cancelOrder: function(t) { | |
| 203 | - var e = this, a = t.currentTarget.dataset.id,th=this; | |
| 204 | - var is_zsorder= parseFloat(t.currentTarget.dataset.zsorder); | |
| 205 | - var index=t.currentTarget.dataset.orderindex; | |
| 206 | - var order=th.data.orderList[index]; | |
| 207 | - var is_skill=0; | |
| 208 | - var order_goods=order.order_goods; | |
| 209 | - //--判断是不是秒杀-- | |
| 210 | - order_goods.forEach(function (val,ind) { | |
| 211 | - if(val.prom_type==1){ | |
| 212 | - is_skill=1; return false; | |
| 213 | - } | |
| 194 | + }); | |
| 195 | + e.data.currentPage++ , | |
| 196 | + wx.stopPullDownRefresh(); | |
| 197 | + }, null, { store_id: os.stoid, user_id: oo.user_id }); | |
| 198 | + }, | |
| 199 | + //滑倒底部 | |
| 200 | + onReachBottom: function() { | |
| 201 | + if (s.data.goodsLoadFinishFlag) { | |
| 202 | + this.setData({ | |
| 203 | + iscodeall: 1 | |
| 214 | 204 | }) |
| 205 | + } | |
| 206 | + s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); | |
| 207 | + }, | |
| 208 | + onPullDownRefresh: function(t) { | |
| 209 | + this.resetData(), this.requestOrderList(this.data.activeCategoryId); | |
| 210 | + }, | |
| 211 | + | |
| 212 | + /*-----------取消订单-----------*/ | |
| 213 | + cancelOrder: function(t) { | |
| 214 | + var e = this, | |
| 215 | + a = t.currentTarget.dataset.id, | |
| 216 | + th = this; | |
| 217 | + var is_zsorder = parseFloat(t.currentTarget.dataset.zsorder); | |
| 218 | + var index = t.currentTarget.dataset.orderindex; | |
| 219 | + var order = th.data.orderList[index]; | |
| 220 | + var is_skill = 0; | |
| 221 | + var order_goods = order.order_goods; | |
| 222 | + //--判断是不是秒杀-- | |
| 223 | + order_goods.forEach(function(val, ind) { | |
| 224 | + if (val.prom_type == 1) { | |
| 225 | + is_skill = 1; | |
| 226 | + return false; | |
| 227 | + } | |
| 228 | + }) | |
| 215 | 229 | |
| 216 | - wx.showModal({ | |
| 217 | - title: "是否取消订单?", | |
| 230 | + wx.showModal({ | |
| 231 | + title: "是否取消订单?", | |
| 232 | + success: function(t) { | |
| 233 | + //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 | |
| 234 | + if (t.confirm) { | |
| 235 | + //if(is_skill==1 || is_zsorder>=2){ | |
| 236 | + getApp().request.delete("/api/weshop/order/cancelTeamOrder/" + os.stoid + "/" + a, { | |
| 237 | + data: {}, | |
| 218 | 238 | success: function(t) { |
| 219 | - //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 | |
| 220 | - if(t.confirm){ | |
| 221 | - //if(is_skill==1 || is_zsorder>=2){ | |
| 222 | - getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+a,{ | |
| 223 | - data:{}, | |
| 224 | - success: function(t) { | |
| 225 | - if(t.data.code==0) | |
| 226 | - { | |
| 227 | - 0 == e.data.activeCategoryId ? | |
| 228 | - (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData2(a); | |
| 229 | - } | |
| 230 | - else | |
| 231 | - { | |
| 232 | - getApp().confirmBox(e.data.msg); | |
| 233 | - } | |
| 234 | - }, | |
| 235 | - }) | |
| 236 | - } | |
| 239 | + if (t.data.code == 0) { | |
| 240 | + 0 == e.data.activeCategoryId ? | |
| 241 | + (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData2(a); | |
| 242 | + } else { | |
| 243 | + getApp().confirmBox(e.data.msg); | |
| 244 | + } | |
| 245 | + }, | |
| 246 | + }) | |
| 247 | + } | |
| 248 | + } | |
| 249 | + }); | |
| 250 | + }, | |
| 251 | + | |
| 252 | + /*-----------确认收货-----------*/ | |
| 253 | + confirmOrder: function(t) { | |
| 254 | + var e = this, | |
| 255 | + a = t.currentTarget.dataset.id; | |
| 256 | + var is_zsorder = t.currentTarget.dataset.zsorder; | |
| 257 | + var th = this; | |
| 258 | + | |
| 259 | + wx.showModal({ | |
| 260 | + title: "是否确认收货?", | |
| 261 | + success: function(t) { | |
| 262 | + t.confirm && rq.put("/api/weshop/order/updatebyId", { | |
| 263 | + data: { | |
| 264 | + order_id: a, | |
| 265 | + order_status: 2 | |
| 266 | + }, | |
| 267 | + success: function(t) { | |
| 268 | + e.deleteOrderData2(a); | |
| 269 | + //如果是会员团订单 | |
| 270 | + if (is_zsorder == 3) { | |
| 271 | + getApp().request.post("/api/weshop/order/vipTuanTebate/" + os.stoid + "/" + a, { | |
| 272 | + data: {}, | |
| 273 | + success: function() {} | |
| 274 | + }) | |
| 237 | 275 | } |
| 276 | + } | |
| 238 | 277 | }); |
| 239 | - }, | |
| 240 | - | |
| 241 | - /*-----------确认收货-----------*/ | |
| 242 | - confirmOrder: function(t) { | |
| 243 | - var e = this, a = t.currentTarget.dataset.id; | |
| 244 | - var is_zsorder=t.currentTarget.dataset.zsorder; | |
| 245 | - var th=this; | |
| 278 | + } | |
| 279 | + }); | |
| 280 | + }, | |
| 246 | 281 | |
| 247 | - wx.showModal({ | |
| 248 | - title: "是否确认收货?", | |
| 249 | - success: function(t) { | |
| 250 | - t.confirm && rq.put("/api/weshop/order/updatebyId", { | |
| 251 | - data: { | |
| 252 | - order_id: a,order_status:2 | |
| 253 | - }, | |
| 254 | - success: function(t) { | |
| 255 | - e.deleteOrderData2(a); | |
| 256 | - //如果是会员团订单 | |
| 257 | - if(is_zsorder==3){ | |
| 258 | - getApp().request.post("/api/weshop/order/vipTuanTebate/"+os.stoid+"/"+a,{ | |
| 259 | - data:{}, success:function () { }}) | |
| 260 | - } | |
| 261 | - } | |
| 282 | + //-----删除订单----- | |
| 283 | + deleteOrderData: function(t) { | |
| 284 | + var th = this; | |
| 285 | + var order_id = t.currentTarget.dataset.order_id; | |
| 286 | + wx.showModal({ | |
| 287 | + title: "是否删除订单?", | |
| 288 | + success: function(tt) { | |
| 289 | + tt.confirm && rq.put("/api/weshop/order/updatebyId", { | |
| 290 | + data: { | |
| 291 | + order_id: order_id, | |
| 292 | + order_status: 5 | |
| 293 | + }, | |
| 294 | + success: function(t) { | |
| 295 | + for (var e = 0; e < th.data.orderList.length; e++) | |
| 296 | + if (th.data.orderList[e].order_id == order_id) { | |
| 297 | + th.data.orderList.splice(e, 1), th.setData({ | |
| 298 | + orderList: th.data.orderList | |
| 262 | 299 | }); |
| 263 | - } | |
| 264 | - }); | |
| 265 | - }, | |
| 300 | + break; | |
| 301 | + } | |
| 302 | + } | |
| 303 | + }) | |
| 304 | + } | |
| 305 | + }); | |
| 306 | + }, | |
| 266 | 307 | |
| 267 | - //-----删除订单----- | |
| 268 | - deleteOrderData: function(t) { | |
| 269 | - var th=this; | |
| 270 | - var order_id=t.currentTarget.dataset.order_id; | |
| 271 | - wx.showModal({ | |
| 272 | - title: "是否删除订单?", | |
| 273 | - success: function(tt) { | |
| 274 | - tt.confirm && rq.put("/api/weshop/order/updatebyId", { | |
| 275 | - data: { | |
| 276 | - order_id: order_id, order_status: 5 | |
| 277 | - }, | |
| 278 | - success: function (t) { | |
| 279 | - for (var e = 0; e < th.data.orderList.length; e++) if (th.data.orderList[e].order_id == order_id) { | |
| 280 | - th.data.orderList.splice(e, 1), th.setData({ | |
| 281 | - orderList: this.data.orderList | |
| 282 | - }); | |
| 283 | - break; | |
| 284 | - } | |
| 285 | - } | |
| 286 | - }) | |
| 287 | - } | |
| 308 | + deleteOrderData2: function(order_id) { | |
| 309 | + var th = this; | |
| 310 | + for (var e = 0; e < th.data.orderList.length; e++) | |
| 311 | + if (th.data.orderList[e].order_id == order_id) { | |
| 312 | + th.data.orderList.splice(e, 1), th.setData({ | |
| 313 | + orderList: this.data.orderList | |
| 288 | 314 | }); |
| 289 | - }, | |
| 315 | + break; | |
| 316 | + } | |
| 317 | + }, | |
| 290 | 318 | |
| 291 | - deleteOrderData2:function(order_id){ | |
| 292 | - var th=this; | |
| 293 | - for (var e = 0; e < th.data.orderList.length; e++) if (th.data.orderList[e].order_id == order_id) { | |
| 294 | - th.data.orderList.splice(e, 1), th.setData({ | |
| 295 | - orderList: this.data.orderList | |
| 319 | + //---判断是不是有退款----- | |
| 320 | + checkReturnGoodsStatus: function(t) { | |
| 321 | + var e = t.currentTarget.dataset.recid; | |
| 322 | + var oid = t.currentTarget.dataset.oid; | |
| 323 | + r.get("/api/weshop/order/returngoods/page", { | |
| 324 | + data: { | |
| 325 | + goods_id: e, | |
| 326 | + order_id: oid, | |
| 327 | + store_id: os.stoid | |
| 328 | + }, | |
| 329 | + success: function(t) { | |
| 330 | + if (t.data.code == 0) { | |
| 331 | + var r = t.data.data.total; | |
| 332 | + if (0 == r) return wx.navigateTo({ | |
| 333 | + url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | |
| 334 | + }); | |
| 335 | + //--如果拒绝,就重新申请退款-- | |
| 336 | + if (t.data.data.pageData[0].status == 3) { | |
| 337 | + return wx.navigateTo({ | |
| 338 | + url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | |
| 296 | 339 | }); |
| 297 | - break; | |
| 298 | - } | |
| 299 | - }, | |
| 300 | - | |
| 301 | - //---判断是不是有退款----- | |
| 302 | - checkReturnGoodsStatus: function(t) { | |
| 303 | - var e = t.currentTarget.dataset.recid; | |
| 304 | - var oid = t.currentTarget.dataset.oid; | |
| 305 | - r.get("/api/weshop/order/returngoods/page", { | |
| 306 | - data: { | |
| 307 | - goods_id: e, | |
| 308 | - order_id:oid, | |
| 309 | - store_id:os.stoid | |
| 310 | - }, | |
| 311 | - success: function(t) { | |
| 312 | - if(t.data.code==0){ | |
| 313 | - var r = t.data.data.total; | |
| 314 | - if (0 == r) return wx.navigateTo({ | |
| 315 | - url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | |
| 316 | - }); | |
| 317 | - //--如果拒绝,就重新申请退款-- | |
| 318 | - if (t.data.data.pageData[0].status==3){ | |
| 319 | - return wx.navigateTo({ | |
| 320 | - url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | |
| 321 | - }); | |
| 322 | - } | |
| 340 | + } | |
| 323 | 341 | |
| 324 | - wx.navigateTo({ | |
| 325 | - url: "/pages/user/return_goods_info/return_goods_info?id=" + r | |
| 326 | - }); | |
| 327 | - } | |
| 328 | - } | |
| 329 | - }); | |
| 330 | - }, | |
| 342 | + wx.navigateTo({ | |
| 343 | + url: "/pages/user/return_goods_info/return_goods_info?id=" + r | |
| 344 | + }); | |
| 345 | + } | |
| 346 | + } | |
| 347 | + }); | |
| 348 | + }, | |
| 331 | 349 | |
| 332 | - /*----------跳转支付-----------*/ | |
| 333 | - jumpToCart4: function(t) { | |
| 334 | - var o_index=t.currentTarget.dataset.idx; | |
| 335 | - var e = this.data.orderList[t.currentTarget.dataset.idx]; | |
| 336 | - var th=this; | |
| 350 | + /*----------跳转支付-----------*/ | |
| 351 | + jumpToCart4: function(t) { | |
| 352 | + var o_index = t.currentTarget.dataset.idx; | |
| 353 | + var e = this.data.orderList[t.currentTarget.dataset.idx]; | |
| 354 | + var th = this; | |
| 337 | 355 | |
| 338 | - console.log("jumpToCart4"); | |
| 339 | - console.log(e); | |
| 356 | + console.log("jumpToCart4"); | |
| 357 | + console.log(e); | |
| 340 | 358 | |
| 341 | - if(e.order_amount==0){ | |
| 342 | - var dd = { | |
| 343 | - parent_sn: e.order_sn, | |
| 344 | - store_id: e.store_id, | |
| 345 | - type: 1, | |
| 346 | - }; | |
| 347 | - getApp().request.post("/api/weshop/order/pay/createOrder", { | |
| 348 | - data: dd, | |
| 349 | - success: function (t) { | |
| 350 | - if(t.data.code==0){ | |
| 351 | - th.onload(); | |
| 352 | - }else{ | |
| 353 | - getApp().confirmBox(t.data.msg+"请您取消该订单"); | |
| 354 | - } | |
| 355 | - } | |
| 356 | - }) | |
| 357 | - return false; | |
| 359 | + if (e.order_amount == 0) { | |
| 360 | + var dd = { | |
| 361 | + parent_sn: e.order_sn, | |
| 362 | + store_id: e.store_id, | |
| 363 | + type: 1, | |
| 364 | + }; | |
| 365 | + getApp().request.post("/api/weshop/order/pay/createOrder", { | |
| 366 | + data: dd, | |
| 367 | + success: function(t) { | |
| 368 | + if (t.data.code == 0) { | |
| 369 | + th.onload(); | |
| 370 | + } else { | |
| 371 | + getApp().confirmBox(t.data.msg + "请您取消该订单"); | |
| 372 | + } | |
| 358 | 373 | } |
| 374 | + }) | |
| 375 | + return false; | |
| 376 | + } | |
| 359 | 377 | |
| 360 | - a.jumpToCart4({ | |
| 361 | - order_sn: e.order_sn, | |
| 362 | - order_amount: e.order_amount, | |
| 363 | - type:1//正常单 | |
| 364 | - }); | |
| 365 | - }, | |
| 366 | - | |
| 367 | - //------图片失败,默认图片--------- | |
| 368 | - bind_bnerr: function (e) { | |
| 369 | - var _errImg = e.target.dataset.errorimg; | |
| 370 | - var _errObj = {}; | |
| 371 | - _errObj[_errImg] = "public/images/default_goods_image_240.gif"; | |
| 372 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 373 | - }, | |
| 378 | + a.jumpToCart4({ | |
| 379 | + order_sn: e.order_sn, | |
| 380 | + order_amount: e.order_amount, | |
| 381 | + type: 1 //正常单 | |
| 382 | + }); | |
| 383 | + }, | |
| 374 | 384 | |
| 375 | - //--------跳转到退款详情----------- | |
| 376 | - gotoreturn:function(t){ | |
| 377 | - var e = t.currentTarget.dataset.recid; | |
| 378 | - var oid = t.currentTarget.dataset.oid; | |
| 379 | - var wh=""; | |
| 380 | - if(e!=undefined && e!=null && e!=""){ | |
| 381 | - wh="&goods_id="+e; | |
| 382 | - } | |
| 383 | - wx.navigateTo({ | |
| 384 | - url: "/pages/user/return_goods_info/return_goods_info?order_id=" + oid+wh, | |
| 385 | - }); | |
| 386 | - }, | |
| 385 | + //------图片失败,默认图片--------- | |
| 386 | + bind_bnerr: function(e) { | |
| 387 | + var _errImg = e.currentTarget.dataset.errorimg; | |
| 388 | + var _errObj = {}; | |
| 389 | + _errObj[_errImg] = "public/images/default_goods_image_240.gif"; | |
| 390 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
| 391 | + }, | |
| 387 | 392 | |
| 388 | - //-----支付尾款------ | |
| 389 | - pay_wk:function (ee) { | |
| 390 | - console.log("pay_wk"); | |
| 391 | - var order_id=ee.currentTarget.dataset.order_id; | |
| 392 | - wx.navigateTo({ | |
| 393 | - url: "/pages/cart/cart_wk/cart_wk?order_id=" + order_id, | |
| 394 | - }); | |
| 393 | + //--------跳转到退款详情----------- | |
| 394 | + gotoreturn: function(t) { | |
| 395 | + var e = t.currentTarget.dataset.recid; | |
| 396 | + var oid = t.currentTarget.dataset.oid; | |
| 397 | + var wh = ""; | |
| 398 | + if (e != undefined && e != null && e != "") { | |
| 399 | + wh = "&goods_id=" + e; | |
| 400 | + } | |
| 401 | + wx.navigateTo({ | |
| 402 | + url: "/pages/user/return_goods_info/return_goods_info?order_id=" + oid + wh, | |
| 403 | + }); | |
| 404 | + }, | |
| 395 | 405 | |
| 396 | - }, | |
| 397 | - | |
| 398 | - //--判断是不是可以单个商品退-- | |
| 399 | - check_for_return_btn:function (item) { | |
| 400 | - if(item.coupon_no) return false; //有用优惠券 | |
| 401 | - if(item.order_prom_id) return false; //有订单优惠 | |
| 402 | - if(item.order_status>=2) return false; //订单状态>2 | |
| 403 | - var istrue=true; | |
| 404 | - //----判断是不是有优惠活动和赠送商品---- | |
| 405 | - for (var g in item.goodslist) { | |
| 406 | - var g_item=item.goodslist[g]; | |
| 407 | - if ((g_item.prom_type == 3 && g_item.discount_amount> 0) | |
| 408 | - || (g_item.prom_type== 3 && g_item.goods_price <= 0) | |
| 409 | - ) { | |
| 410 | - istrue=false; break | |
| 411 | - } | |
| 412 | - if (g_item.prom_type== 5) { | |
| 413 | - istrue=false; break | |
| 414 | - } | |
| 415 | - } | |
| 416 | - if(!istrue) return false; | |
| 417 | - var conf=this.data.conf; | |
| 418 | - //判断是不是原路退回 | |
| 419 | - if(conf.refund_type==1) return true; | |
| 420 | - else{ | |
| 421 | - if(item.order_amount==0 || item.user_money==0) return true; | |
| 422 | - } | |
| 423 | - return false; | |
| 424 | - } | |
| 406 | + //-----支付尾款------ | |
| 407 | + pay_wk: function(ee) { | |
| 408 | + console.log("pay_wk"); | |
| 409 | + var order_id = ee.currentTarget.dataset.order_id; | |
| 410 | + wx.navigateTo({ | |
| 411 | + url: "/pages/cart/cart_wk/cart_wk?order_id=" + order_id, | |
| 412 | + }); | |
| 425 | 413 | |
| 414 | + }, | |
| 426 | 415 | |
| 416 | + //--判断是不是可以单个商品退-- | |
| 417 | + check_for_return_btn: function(item) { | |
| 418 | + if (item.coupon_no) return false; //有用优惠券 | |
| 419 | + if (item.order_prom_id) return false; //有订单优惠 | |
| 420 | + if (item.order_status >= 2) return false; //订单状态>2 | |
| 421 | + var istrue = true; | |
| 422 | + //----判断是不是有优惠活动和赠送商品---- | |
| 423 | + for (var g in item.goodslist) { | |
| 424 | + var g_item = item.goodslist[g]; | |
| 425 | + if ((g_item.prom_type == 3 && g_item.discount_amount > 0) || | |
| 426 | + (g_item.prom_type == 3 && g_item.goods_price <= 0) | |
| 427 | + ) { | |
| 428 | + istrue = false; | |
| 429 | + break | |
| 430 | + } | |
| 431 | + if (g_item.prom_type == 5) { | |
| 432 | + istrue = false; | |
| 433 | + break | |
| 434 | + } | |
| 435 | + } | |
| 436 | + if (!istrue) return false; | |
| 437 | + var conf = this.data.conf; | |
| 438 | + //判断是不是原路退回 | |
| 439 | + if (conf.refund_type == 1) return true; | |
| 440 | + else { | |
| 441 | + if (item.order_amount == 0 || item.user_money == 0) return true; | |
| 442 | + } | |
| 443 | + return false; | |
| 444 | + }, | |
| 445 | + //跳到首页 | |
| 446 | + goto: function(e) { | |
| 447 | + wx.switchTab({ | |
| 448 | + url: '/pages/index/index/index', | |
| 449 | + }) | |
| 450 | + }, | |
| 427 | 451 | |
| 452 | + //显示核销码 | |
| 453 | + code_show: function(e) { | |
| 454 | + var th = this; | |
| 455 | + //--获取成功的时候-- | |
| 456 | + var no = e.currentTarget.dataset.order_sn; | |
| 457 | + var qc_com = th.selectComponent("#qc_com"); //组件的id | |
| 458 | + var obj = { | |
| 459 | + val: no, | |
| 460 | + content: "请将二维码展示给核销员,收货更快捷" | |
| 461 | + }; | |
| 462 | + qc_com.open(obj) | |
| 463 | + } | |
| 428 | 464 | }); |
| 429 | 465 | \ No newline at end of file | ... | ... |
pages/user/order_list/order_list.json
pages/user/order_list/order_list.wxml
| 1 | 1 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
| 2 | 2 | <view class="container"> |
| 3 | - <view class="type-navbar"> | |
| 4 | - <view class="type-box" wx:for="{{categories}}" wx:key="{{index}}"> | |
| 5 | - <view bindtap="changeTab" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> | |
| 6 | - {{item.name}} | |
| 7 | - </view> | |
| 8 | - </view> | |
| 3 | + <view class="type-navbar padding fs30"> | |
| 4 | + <view class="type-box flex-center" wx:for="{{categories}}" wx:key="{{index}}"> | |
| 5 | + <view id="{{item.id}}" bindtap="changeTab" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}"> | |
| 6 | + {{item.name}} | |
| 7 | + </view> | |
| 9 | 8 | </view> |
| 10 | - <view class="goods-container"> | |
| 11 | - <view class="goods-box" data-id="{{item.order_id}}" wx:for="{{orderList}}" wx:key="{{index}}"> | |
| 12 | - <navigator url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | |
| 13 | - <view class="goods-title"> | |
| 14 | - <view class="order-number">订单编号:{{item.order_sn}}</view> | |
| 15 | - <view class="pay-status">{{item.order_status_detail}}</view> | |
| 16 | - </view> | |
| 17 | - </navigator> | |
| 9 | + </view> | |
| 10 | +</view> | |
| 11 | +<view class="stay_evaluate" data-id="{{item.order_id}}" wx:for="{{orderList}}" wx:key="{{index}}"> | |
| 18 | 12 | |
| 19 | - <view class="goods-cont" wx:for="{{item.order_goods}}" wx:for-item="goods" | |
| 20 | - wx:if="{{goods.return_btn!=4}}" | |
| 21 | - wx:for-index="pinx" | |
| 22 | - wx:key="{{index}}"> | |
| 23 | - <navigator class="img-box" url="/pages/user/order_detail/order_detail?order_id={{goods.order_id}}"> | |
| 24 | - <image class="wh100" src="{{resourceUrl+goods.original_img}}" binderror="bind_bnerr" lazy-load="true" | |
| 25 | - data-errorimg="orderList[{{index}}].order_goods[{{pinx}}].original_img"></image> | |
| 26 | - </navigator> | |
| 27 | - <navigator class="goods-mes" url="/pages/user/order_detail/order_detail?order_id={{goods.order_id}}"> | |
| 28 | - <view class="goods-name" >{{goods.goods_name}}</view> | |
| 29 | - <view class="goods-name" style="color:#999">{{goods.goods_color}} {{goods.goods_spec}}</view> | |
| 30 | - <view class="goods-price">¥ {{goods.member_goods_price}}</view> | |
| 31 | - <view class="goods-num">数量 {{goods.goods_num}}</view> | |
| 32 | - </navigator> | |
| 13 | + <!-- 商品编号和状态 --> | |
| 14 | + <view class="Commodity_number flex-vertical-between fs30 padding border_bottom"> | |
| 15 | + <!--商品编号 --> | |
| 16 | + <text selectable='true'>订单编号:{{item.order_sn}}</text> | |
| 17 | + <!-- 商品评价状态 --> | |
| 18 | + <view class="flex-center xc-wc"> | |
| 19 | + <!-- 订单状态 --> | |
| 20 | + <view wx:if="{{item.pt_status==1}}">组团中</view> | |
| 21 | + <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view> | |
| 22 | + <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}"> | |
| 23 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view> | |
| 24 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view> | |
| 25 | + <view wx:if="{{(item.order_status==2)}}">待评价</view> | |
| 26 | + <view wx:if="{{item.order_status==4}}">已评价</view> | |
| 27 | + <view wx:if="{{item.order_status==3}}">已取消</view> | |
| 28 | + <view wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</view> | |
| 29 | + <view wx:if="{{item.order_status==6}}">退款成功</view> | |
| 30 | + <view wx:if="{{item.pt_status==6}}">支付尾款失败</view> | |
| 31 | + </block> | |
| 32 | + <block wx:else>退款中</block> | |
| 33 | + <view class="flex" wx:if="{{(item.order_status==0&&item.pay_status==0)}}"> | |
| 34 | + <view class="lin"></view> | |
| 35 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-order_id="{{item.order_id}}"></image> | |
| 36 | + </view> | |
| 37 | + </view> | |
| 38 | + </view> | |
| 33 | 39 | |
| 40 | + <!-- 商品详情集合 --> | |
| 41 | + <view class="detail_commoditys"> | |
| 42 | + <!-- 单个商品 --> | |
| 43 | + <view> | |
| 44 | + <navigator class="detail_commodity flex-vertical padding border_bottom" wx:for="{{item.order_goods}}" wx:for-item="goods" wx:if="{{goods.return_btn!=4}}" wx:for-index="pinx" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | |
| 45 | + <!-- 商品图片 --> | |
| 46 | + <navigator class="rel"> | |
| 47 | + <image src="{{resourceUrl+goods.original_img}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="orderList[{{index}}].order_goods[{{pinx}}].original_img"></image> | |
| 48 | + <view class="abs flex-center fs26" wx:if="{{goods.prom_type==1}}">秒杀</view> | |
| 49 | + <view class="abs flex-center fs26" wx:if="{{goods.prom_type==6}}">团购</view> | |
| 50 | + </navigator> | |
| 51 | + <!-- 商品内容 --> | |
| 52 | + <view class="Commodity_content"> | |
| 53 | + <view class="Commodity_goods"> | |
| 54 | + <!-- 商品名称 --> | |
| 55 | + <view class="goods_name ellipsis-2 fs30">{{goods.goods_name}}</view> | |
| 56 | + <view class="flex-space-between"> | |
| 57 | + <!-- 商品规格 --> | |
| 58 | + <view class="Commodity_spec fs28 flex-center"> | |
| 59 | + <text class="ellipsis-1" wx:if="{{goods.goods_color.length>1 && goods.goods_spec.length>1}}">{{goods.goods_color+"/"+goods.goods_spec}}</text> | |
| 60 | + <text class="ellipsis-1" wx:elif="{{goods.goods_color.length>1 || goods.goods_spec.length>1}}">{{goods.goods_color==undefined?"":goods.goods_color}}{{goods.goods_spec==undefined?"":goods.goods_spec}}</text> | |
| 61 | + <text class="ellipsis-1" wx:else>规格1</text> | |
| 62 | + </view> | |
| 63 | + <view class="flex-level-right fs26 refund"> | |
| 34 | 64 | <!-- 不是整单退的时候 --> |
| 35 | 65 | <block wx:if="{{item.is_all_return!=1}}"> |
| 36 | - <view bindtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" | |
| 37 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==1}}">申请退款</view> | |
| 38 | - <view bindtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" | |
| 39 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==2}}">退款中</view> | |
| 40 | - <view bindtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" | |
| 41 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==3}}">重新退款</view> | |
| 42 | - <view bindtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" | |
| 43 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==4}}">退款完成</view> | |
| 44 | - </block> | |
| 45 | - | |
| 46 | - <block wx:if="{{item.pt_status==1}}"> | |
| 47 | - <view class="return-btn co-red">组团中</view> | |
| 48 | - </block> | |
| 49 | - <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}"> | |
| 50 | - <view class="return-btn co-red">待支付尾款</view> | |
| 66 | + <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==1}}">申请退款</view> | |
| 67 | + <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==2}}">退款中</view> | |
| 68 | + <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==3}}">重新退款</view> | |
| 69 | + <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==4}}">退款完成</view> | |
| 51 | 70 | </block> |
| 71 | + </view> | |
| 72 | + </view> | |
| 73 | + </view> | |
| 74 | + <!-- 商品价格数量 --> | |
| 75 | + <view class="Commodity_money flex-vertical-between baseline"> | |
| 76 | + <!-- 商品价格 --> | |
| 77 | + <view class="flex-vertical xc-wc baseline"> | |
| 78 | + <view class="fs24">¥</view> | |
| 79 | + <view class="fs30">{{filters.toFix(goods.member_goods_price,2)}}</view> | |
| 80 | + </view> | |
| 81 | + <view class="fs30">x{{goods.goods_num}}</view> | |
| 82 | + </view> | |
| 83 | + </view> | |
| 84 | + </navigator> | |
| 85 | + <!-- 去评价 --> | |
| 86 | + <view class="commodity_evaluate jc_sb padding baseline fs26"> | |
| 87 | + <!-- 商品数量 --> | |
| 88 | + <view class="commodity_smy flex fs30"> | |
| 89 | + <view class="order-total"> | |
| 90 | + <view> | |
| 91 | + 共{{item.g_num}}件商品 | |
| 52 | 92 | </view> |
| 93 | + <view class="goods-total flex"> | |
| 94 | + <block wx:if="{{item.pt_status==4 || item.pt_status==5}}"> | |
| 95 | + <view class="commodity_money flex baseline"> | |
| 96 | + <view>合计:</view> | |
| 97 | + <view class="fs24 xc-wc">¥</view> | |
| 98 | + <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}} | |
| 99 | + </view> | |
| 53 | 100 | |
| 54 | - <view class="goods-tips"> | |
| 55 | - <view class="order-total"> | |
| 56 | - 共{{item.g_num}}件,<view class="goods-total"> | |
| 57 | - <block wx:if="{{item.pt_status==4 || item.pt_status==5 }}"> | |
| 58 | - <view>金额:¥{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}}</view> | |
| 59 | - </block> | |
| 60 | - <block wx:else> | |
| 61 | - <view wx:if="{{item.is_zsorder==4}}">定金:¥{{filters.toFix(item.order_amount+item.user_money,2)}}</view> | |
| 62 | - <view wx:else>金额:¥{{filters.toFix(item.order_amount+item.user_money,2)}}</view> | |
| 63 | - <view wx:if="{{item.pt_tail_money>0}}">尾款:¥{{filters.toFix(item.pt_tail_money-item.shipping_price,2)}}</view> | |
| 64 | - </block> | |
| 65 | - | |
| 66 | - </view> | |
| 67 | 101 | </view> |
| 68 | - | |
| 102 | + </block> | |
| 103 | + <block wx:else> | |
| 104 | + <view wx:if="{{item.is_zsorder==4}}" class="commodity_money flex baseline"> | |
| 105 | + <view>定金:</view> | |
| 106 | + <view class="fs24 xc-wc">¥</view> | |
| 107 | + <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money,2)}} | |
| 108 | + </view> | |
| 109 | + </view> | |
| 110 | + <view class="commodity_money flex baseline" wx:else> | |
| 111 | + <view>合计:</view> | |
| 112 | + <view class="fs24 xc-wc">¥</view> | |
| 113 | + <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money,2)}} | |
| 114 | + </view> | |
| 115 | + </view> | |
| 116 | + <view wx:if="{{item.pt_tail_money>0}}" class="commodity_money flex baseline"> | |
| 117 | + <view>待支付尾款:</view> | |
| 118 | + <view class="fs24 xc-wc">¥</view> | |
| 119 | + <view class="xc-wc">{{filters.toFix(item.pt_tail_money-item.shipping_price,2)}} | |
| 120 | + </view> | |
| 121 | + </view> | |
| 122 | + </block> | |
| 69 | 123 | </view> |
| 124 | + </view> | |
| 125 | + </view> | |
| 126 | + <view class="links flex-right-vertical fs30"> | |
| 127 | + <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1)}}" class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image> | |
| 70 | 128 | |
| 71 | - <view class="check-btn"> | |
| 72 | - <navigator url="/pages/cart/cart_wk/cart_wk?order_id={{item.order_id}}" | |
| 73 | - class="order-btn order-btn-pay" data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> | |
| 74 | - <navigator bindtap="jumpToCart4" class="order-btn order-btn-pay " data-idx="{{index}}" hidden="{{!(item.order_status==0&&item.pay_status==0)}}">立即付款</navigator> | |
| 75 | - <view class="order-btn" data-id="{{item.order_id}}" wx:if="{{item.order_status==3 && item.pt_status!=3 }}">已取消</view> | |
| 76 | - <view bindtap="cancelOrder" class="order-btn" data-id="{{item.order_id}}" data-zsorder="{{item.is_zsorder}}" data-orderindex="{{index}}" | |
| 77 | - hidden="{{!(item.order_status==0 &&item.pay_status==0)}}">取消订单</view> | |
| 78 | - <view class="order-btn" wx:if="{{item.pt_status==3}}">拼团失败</view> | |
| 129 | + <view class="commodity_To_evaluate flex-level View_evaluation" data-id="{{item.order_id}}" wx:if="{{item.order_status==3 && item.pt_status!=3}}">已取消</view> | |
| 130 | + <view bindtap="cancelOrder" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{item.order_id}}" data-zsorder="{{item.is_zsorder}}" data-orderindex="{{index}}" wx:if="{{(item.order_status==0 &&item.pay_status==0)}}">取消订单</view> | |
| 131 | + <view class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.pt_status==3}}">拼团失败</view> | |
| 132 | + <!---has_rt部分退----> | |
| 133 | + <block wx:if="{{item.return_btn==undefined && item.is_all_return!=1 && item.has_rt!=1}}"> | |
| 134 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.order_status==0&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | |
| 135 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.order_status==1&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | |
| 136 | + </block> | |
| 137 | + <block wx:else> | |
| 138 | + <view class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==2}}" bindtap="deleteOrderData" data-order_id="{{item.order_id}}">删除订单</view> | |
| 139 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">重新退款</navigator> | |
| 140 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==0 || item.is_all_return_status==1}}" url="/pages/user/return_goods_info/return_goods_info?order_id={{item.order_id}}">退款详情</navigator> | |
| 141 | + </block> | |
| 142 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==1)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | |
| 143 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==2)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | |
| 144 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">订单详情</navigator> | |
| 79 | 145 | |
| 80 | - <!---has_rt部分退----> | |
| 81 | - <block wx:if="{{item.return_btn==undefined && item.is_all_return!=1 && item.has_rt!=1}}"> | |
| 82 | - <navigator class="order-btn" hidden="{{!(item.order_status==0&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | |
| 83 | - <navigator class="order-btn" hidden="{{!(item.order_status==1&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | |
| 84 | - </block> | |
| 85 | - <block wx:else> | |
| 86 | - <view class="order-btn" wx:if="{{item.is_all_return_status==2}}" bindtap="deleteOrderData" data-order_id="{{item.order_id}}" >删除订单</view> | |
| 87 | - <navigator class="order-btn" wx:if="{{item.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">重新退款</navigator> | |
| 88 | - <navigator class="order-btn" wx:if="{{item.is_all_return_status==0 || item.is_all_return_status==1}}" | |
| 89 | - url="/pages/user/return_goods_info/return_goods_info?order_id={{item.order_id}}">退款详情</navigator> | |
| 90 | - </block> | |
| 146 | + <block wx:if="{{!(item.has_rt || item.return_btn==2 || item.return_btn==4)}}"> | |
| 147 | + <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="commodity_To_evaluate flex-level comment_go" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">确认收货</view> | |
| 148 | + <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="commodity_To_evaluate flex-level comment_go" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==2)}}">确认收货</view> | |
| 149 | + </block> | |
| 91 | 150 | |
| 92 | - <block wx:if="{{!(item.has_rt || item.return_btn==2 || item.return_btn==4)}}"> | |
| 93 | - <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="order-btn white red-b" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">确认收货</view> | |
| 94 | - <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="order-btn white red-b" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==2)}}">确认收货</view> | |
| 95 | - </block> | |
| 151 | + <block wx:if="{{item.order_status==2 && item.is_zsorder!=4}}"> | |
| 152 | + <navigator wx:if="{{item.order_goods.length>1}}" class="order-btn white red-b" | |
| 153 | + url="/pages/user/comment/comment?status=0&order_id={{item.order_id}}">评价</navigator> | |
| 154 | + <navigator wx:else class="order-btn white red-b" | |
| 155 | + url="/pages/user/add_comment/add_comment?goods_id={{item.order_goods[0].goods_id}}&order_id={{item.order_id}}&price={{item.order_goods[0].member_goods_price}}">评价</navigator> | |
| 156 | + </block> | |
| 96 | 157 | |
| 97 | - <navigator redirect class="order-btn white red-b" hidden="{{!(item.order_status==2)}}" url="/pages/user/comment/comment?status=0">评价</navigator> | |
| 98 | - <navigator class="order-btn" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==1)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | |
| 99 | - <navigator class="order-btn" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==2)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | |
| 100 | - <navigator class="order-btn" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">订单详情</navigator> | |
| 101 | - </view> | |
| 102 | 158 | |
| 159 | + <navigator class="commodity_To_evaluate flex-level comment_go" url="/pages/cart/cart_wk/cart_wk?order_id={{item.order_id}}" data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> | |
| 160 | + <navigator class="commodity_To_evaluate flex-level comment_go" bindtap="jumpToCart4" data-idx="{{index}}" wx:if="{{(item.order_status==0&&item.pay_status==0)}}">立即支付</navigator> | |
| 103 | 161 | </view> |
| 104 | - <view class="no-data" wx:if="{{ (!orderList||orderList.length==0) && is_get}}"> | |
| 105 | - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | |
| 106 | - <view class="no-data-title">暂无订单列表</view> | |
| 107 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | |
| 108 | - </view> | |
| 162 | + </view> | |
| 109 | 163 | </view> |
| 164 | + </view> | |
| 165 | +</view> | |
| 166 | + | |
| 167 | +<!-- 没有数据 --> | |
| 168 | +<view class="After_all flex-center" wx:if="{{iscodeall==1 && orderList.length>1}}"> | |
| 169 | + <view class="Line"></view> | |
| 170 | + <view class="end fs26 xc-black">到底了</view> | |
| 171 | + <view class="Line"></view> | |
| 172 | +</view> | |
| 173 | + | |
| 174 | +<!-- 无订单 --> | |
| 175 | +<view class="empty_order" wx:if="{{(!orderList||orderList.length==0) && is_get}}"> | |
| 176 | + <view class="flex-level"> | |
| 177 | + <image src="{{iurl}}miniapp/images/order/empty_order.png"></image> | |
| 178 | + </view> | |
| 179 | + <view class="flex-level fs30 xc-ash">当前暂无订单</view> | |
| 180 | + <view class="flex-level"> | |
| 181 | + <navigator url="/pages/index/index/index" bindtap="goto"> | |
| 182 | + <view class="flex-center fs28 white">去首页逛逛</view> | |
| 183 | + </navigator> | |
| 184 | + </view> | |
| 110 | 185 | </view> |
| 186 | +<!-- 弹出框扫描 --> | |
| 187 | +<qr_code id="qc_com"></qr_code> | |
| 111 | 188 | \ No newline at end of file | ... | ... |
pages/user/order_list/order_list.wxss
| 1 | +page { | |
| 2 | + font-family: microsoft yahei; | |
| 3 | +} | |
| 4 | + | |
| 1 | 5 | .type-navbar { |
| 2 | - white-space: nowrap; | |
| 3 | - display: flex; | |
| 4 | - width: 100%; | |
| 5 | - height: 80rpx; | |
| 6 | - background-color: #fff; | |
| 6 | + white-space: nowrap; | |
| 7 | + display: flex; | |
| 8 | + height: 88rpx; | |
| 9 | + background-color: #fff; | |
| 10 | + justify-content: space-between; | |
| 11 | + border-top: 1rpx solid rgb(211, 211, 211); | |
| 7 | 12 | } |
| 8 | 13 | |
| 9 | 14 | .type-box { |
| 10 | - width: 25%; | |
| 11 | - box-sizing: border-box; | |
| 12 | - font-size: 32rpx; | |
| 13 | - line-height: 76rpx; | |
| 14 | - padding: 0 20rpx; | |
| 15 | - text-align: center; | |
| 16 | - display: inline-block; | |
| 17 | - overflow: hidden; | |
| 15 | + box-sizing: border-box; | |
| 16 | + line-height: 84rpx; | |
| 17 | + text-align: center; | |
| 18 | + display: inline-block; | |
| 19 | + overflow: hidden; | |
| 18 | 20 | } |
| 19 | 21 | |
| 20 | 22 | .type-navbar-item { |
| 21 | - border-bottom: 4rpx solid #fff; | |
| 23 | + border-bottom: 4rpx solid #fff; | |
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | .type-item-on { |
| 25 | - border-bottom: 4rpx solid #e64340; | |
| 27 | + border-bottom: 4rpx solid #e64340; | |
| 26 | 28 | } |
| 27 | 29 | |
| 30 | +/* 原 */ | |
| 31 | + | |
| 28 | 32 | .goods-container { |
| 29 | - display: flex; | |
| 30 | - justify-content: space-between; | |
| 31 | - flex-wrap: wrap; | |
| 32 | - box-sizing: content-box; | |
| 33 | - padding: 20rpx 0; | |
| 33 | + display: flex; | |
| 34 | + justify-content: space-between; | |
| 35 | + flex-wrap: wrap; | |
| 36 | + box-sizing: content-box; | |
| 37 | + padding: 20rpx 0; | |
| 34 | 38 | } |
| 35 | 39 | |
| 36 | 40 | .goods-box { |
| 37 | - width: 100%; | |
| 38 | - background-color: #fff; | |
| 39 | - padding: 0 25rpx; | |
| 40 | - margin-bottom: 20rpx; | |
| 41 | - font-size: 28rpx; | |
| 42 | - border-bottom: 1rpx solid #eee; | |
| 43 | - padding-bottom: 25rpx; | |
| 44 | - | |
| 41 | + width: 100%; | |
| 42 | + background-color: #fff; | |
| 43 | + padding: 0 25rpx; | |
| 44 | + margin-bottom: 20rpx; | |
| 45 | + font-size: 28rpx; | |
| 46 | + border-bottom: 1rpx solid #eee; | |
| 47 | + padding-bottom: 25rpx; | |
| 45 | 48 | } |
| 46 | 49 | |
| 47 | 50 | .goods-title { |
| 48 | - display: flex; | |
| 49 | - justify-content: space-between; | |
| 50 | - align-items: center; | |
| 51 | - height: 100rpx; | |
| 51 | + display: flex; | |
| 52 | + justify-content: space-between; | |
| 53 | + align-items: center; | |
| 54 | + height: 100rpx; | |
| 52 | 55 | } |
| 53 | 56 | |
| 54 | 57 | .order-number { |
| 55 | - font-size: 32rpx; | |
| 56 | - color: #666; | |
| 58 | + font-size: 32rpx; | |
| 59 | + color: #666; | |
| 57 | 60 | } |
| 58 | 61 | |
| 59 | 62 | .pay-status { |
| 60 | - color: #f23030; | |
| 63 | + color: #f23030; | |
| 61 | 64 | } |
| 62 | 65 | |
| 63 | 66 | .goods-cont { |
| 64 | - padding: 20rpx 0; | |
| 65 | - display: flex; | |
| 66 | - justify-content: space-between; | |
| 67 | - position: relative; | |
| 67 | + padding: 20rpx 0; | |
| 68 | + display: flex; | |
| 69 | + justify-content: space-between; | |
| 70 | + position: relative; | |
| 68 | 71 | } |
| 69 | 72 | |
| 70 | 73 | .img-box { |
| 71 | - width: 180rpx; | |
| 72 | - height: 180rpx; | |
| 74 | + width: 180rpx; | |
| 75 | + height: 180rpx; | |
| 73 | 76 | } |
| 74 | 77 | |
| 75 | 78 | .goods-mes { |
| 76 | - width: 490rpx; | |
| 79 | + width: 490rpx; | |
| 77 | 80 | } |
| 78 | 81 | |
| 79 | 82 | .goods-name { |
| 80 | - height: 30rpx; | |
| 81 | - margin-bottom: 16rpx; | |
| 82 | - overflow: hidden; | |
| 83 | - line-height: 30rpx; | |
| 84 | - color: #333; | |
| 85 | - word-break: keep-all; | |
| 86 | - white-space: nowrap; | |
| 87 | - text-overflow: ellipsis; | |
| 88 | - font-size: 30rpx; | |
| 83 | + height: 30rpx; | |
| 84 | + margin-bottom: 16rpx; | |
| 85 | + overflow: hidden; | |
| 86 | + line-height: 30rpx; | |
| 87 | + color: #333; | |
| 88 | + word-break: keep-all; | |
| 89 | + white-space: nowrap; | |
| 90 | + text-overflow: ellipsis; | |
| 91 | + font-size: 30rpx; | |
| 89 | 92 | } |
| 90 | 93 | |
| 91 | 94 | .goods-price { |
| 92 | - color: #f23030; | |
| 93 | - padding-bottom: 20rpx; | |
| 94 | - font-size: 30rpx; | |
| 95 | + color: #f23030; | |
| 96 | + padding-bottom: 20rpx; | |
| 97 | + font-size: 30rpx; | |
| 95 | 98 | } |
| 96 | 99 | |
| 97 | 100 | .goods-num { |
| 98 | - color: #999999; | |
| 99 | - font-size: 30rpx; | |
| 100 | -} | |
| 101 | - | |
| 102 | -.return-btn { | |
| 103 | - color: #999999; | |
| 104 | - position: absolute; | |
| 105 | - right: 0; | |
| 106 | - bottom: 0rpx; | |
| 107 | - height: 80rpx; | |
| 108 | - line-height: 80rpx; | |
| 101 | + color: #999; | |
| 102 | + font-size: 30rpx; | |
| 109 | 103 | } |
| 110 | 104 | |
| 111 | 105 | .goods-tips { |
| 112 | - height: 60rpx; | |
| 113 | - padding: 10rpx 0; | |
| 114 | - display: flex; | |
| 115 | - justify-content: space-between; | |
| 116 | - align-items: center; | |
| 106 | + height: 60rpx; | |
| 107 | + padding: 10rpx 0; | |
| 108 | + display: flex; | |
| 109 | + justify-content: space-between; | |
| 110 | + align-items: center; | |
| 117 | 111 | } |
| 118 | 112 | |
| 119 | 113 | .order-total { |
| 120 | - display: flex; | |
| 121 | - justify-content: flex-start; | |
| 122 | - font-size: 31rpx; | |
| 123 | - color: #333; | |
| 114 | + display: flex; | |
| 115 | + justify-content: flex-start; | |
| 124 | 116 | } |
| 125 | 117 | |
| 126 | 118 | .goods-total { |
| 127 | - margin-right: 20rpx; | |
| 128 | - color: #f23030; | |
| 119 | + margin-right: 20rpx; | |
| 129 | 120 | } |
| 130 | 121 | |
| 131 | 122 | .order-btn { |
| 132 | - width: 150rpx; | |
| 133 | - height: 50rpx; | |
| 134 | - line-height: 50rpx; | |
| 135 | - text-align: center; | |
| 136 | - border: 1px solid #eee; | |
| 137 | - margin-left: 10rpx; | |
| 138 | - float: right; | |
| 139 | - border-radius: 15rpx; | |
| 123 | + width: 150rpx; | |
| 124 | + height: 50rpx; | |
| 125 | + line-height: 50rpx; | |
| 126 | + text-align: center; | |
| 127 | + border: 1px solid #eee; | |
| 128 | + margin-left: 10rpx; | |
| 129 | + float: right; | |
| 130 | + border-radius: 15rpx; | |
| 140 | 131 | } |
| 141 | 132 | |
| 142 | 133 | .order-btn-pay { |
| 143 | - color: #fff; | |
| 144 | - background-color: #f23030; | |
| 145 | - border-color: #f23030; | |
| 134 | + color: #fff; | |
| 135 | + background-color: #f23030; | |
| 136 | + border-color: #f23030; | |
| 137 | +} | |
| 138 | + | |
| 139 | +.return-btn.co-red { | |
| 140 | + color: #e02e24; | |
| 146 | 141 | } |
| 147 | -.return-btn.co-red{color: #e02e24} | |
| 148 | -.check-btn{ | |
| 142 | + | |
| 143 | +.check-btn { | |
| 149 | 144 | margin-bottom: 20rpx; |
| 145 | +} | |
| 146 | + | |
| 147 | +/* 新 */ | |
| 148 | + | |
| 149 | +.Commodity_number { | |
| 150 | + height: 80rpx; | |
| 151 | + border-top: 13rpx solid rgb(245, 245, 245); | |
| 152 | +} | |
| 153 | + | |
| 154 | +.Commodity_number .lin { | |
| 155 | + border-left: 2rpx solid rgb(129, 65, 81); | |
| 156 | + margin: 0rpx 15rpx; | |
| 157 | + height: 31rpx; | |
| 158 | +} | |
| 159 | + | |
| 160 | +.Commodity_number image { | |
| 161 | + width: 30rpx; | |
| 162 | + height: 32rpx; | |
| 163 | +} | |
| 164 | + | |
| 165 | +.padding { | |
| 166 | + padding: 0rpx 27rpx; | |
| 167 | +} | |
| 168 | + | |
| 169 | +/* 文字基线对齐 */ | |
| 170 | + | |
| 171 | +.baseline { | |
| 172 | + align-items: baseline; | |
| 173 | +} | |
| 174 | + | |
| 175 | +.border_bottom { | |
| 176 | + border-bottom: 4rpx solid rgb(245, 245, 245); | |
| 177 | +} | |
| 178 | + | |
| 179 | +/* 单个商品框架 */ | |
| 180 | + | |
| 181 | +.detail_commodity { | |
| 182 | + height: 231rpx; | |
| 183 | +} | |
| 184 | + | |
| 185 | +.detail_commodity image { | |
| 186 | + width: 185rpx; | |
| 187 | + height: 185rpx; | |
| 188 | +} | |
| 189 | + | |
| 190 | +.detail_commodity .goods_name { | |
| 191 | + width: 485rpx; | |
| 192 | + /* height: 75rpx; */ | |
| 193 | + line-height: 37rpx; | |
| 194 | +} | |
| 195 | + | |
| 196 | +.Commodity_content { | |
| 197 | + height: 185rpx; | |
| 198 | + margin-left: 21rpx; | |
| 199 | +} | |
| 200 | + | |
| 201 | +.Commodity_content .Commodity_goods { | |
| 202 | + height: 150rpx; | |
| 203 | +} | |
| 204 | + | |
| 205 | +.Commodity_content .Commodity_money { | |
| 206 | + font-size: 16rpx; | |
| 207 | + letter-spacing: 1rpx; | |
| 208 | +} | |
| 209 | + | |
| 210 | +/* 商品评价按钮框架 */ | |
| 211 | + | |
| 212 | +.commodity_evaluate { | |
| 213 | + padding-top: 15rpx; | |
| 214 | + padding-bottom: 15rpx; | |
| 215 | + border-bottom: 4rpx solid rgb(245, 245, 245); | |
| 216 | +} | |
| 217 | + | |
| 218 | +.commodity_evaluate .commodity_smy .commodity_money { | |
| 219 | + margin-left: 29rpx; | |
| 220 | + letter-spacing: 1rpx; | |
| 221 | +} | |
| 222 | + | |
| 223 | +.commodity_evaluate .links { | |
| 224 | + height: 92rpx; | |
| 225 | +} | |
| 226 | + | |
| 227 | +.commodity_evaluate .commodity_To_evaluate { | |
| 228 | + width: 155rpx; | |
| 229 | + height: 48rpx; | |
| 230 | + border-radius: 10rpx; | |
| 231 | + line-height: 48rpx; | |
| 232 | +} | |
| 233 | + | |
| 234 | +.commodity_evaluate .commodity_To_evaluate view { | |
| 235 | + height: 39rpx; | |
| 236 | + line-height: 39rpx; | |
| 237 | +} | |
| 238 | + | |
| 239 | +.commodity_evaluate .comment_go { | |
| 240 | + background-color: rgb(211, 28, 52); | |
| 241 | + color: rgb(255, 255, 255); | |
| 242 | + margin-left: 18rpx; | |
| 243 | + width: 155rpx; | |
| 244 | + height: 48rpx; | |
| 245 | + line-height: 48rpx; | |
| 246 | +} | |
| 247 | + | |
| 248 | +.Commodity_spec { | |
| 249 | + height: 37rpx; | |
| 250 | + line-height: 37rpx; | |
| 251 | + max-width: 160rpx; | |
| 252 | + background-color: rgb(236, 236, 236); | |
| 253 | + border-radius: 6rpx; | |
| 254 | + font-size: 22rpx; | |
| 255 | + margin-top: 10rpx; | |
| 256 | + padding:0rpx 10rpx; | |
| 257 | +} | |
| 258 | + | |
| 259 | +.Commodity_evaluation .Comment_content { | |
| 260 | + color: rgb(153, 153, 153); | |
| 261 | + letter-spacing: 1rpx; | |
| 262 | +} | |
| 263 | + | |
| 264 | +.Commodity_evaluation .starss { | |
| 265 | + height: 58rpx; | |
| 266 | + /* // line-height: 58rpx; */ | |
| 267 | + align-items: center; | |
| 268 | +} | |
| 269 | + | |
| 270 | +.Commodity_evaluation .commen { | |
| 271 | + height: 58rpx; | |
| 272 | + line-height: 58rpx; | |
| 273 | +} | |
| 274 | + | |
| 275 | +.Commodity_evaluation .starss .stars { | |
| 276 | + line-height: 58rpx; | |
| 277 | +} | |
| 278 | + | |
| 279 | +.Commodity_evaluation .starss .stars image { | |
| 280 | + width: 29rpx; | |
| 281 | + height: 26rpx; | |
| 282 | + margin-right: 5rpx; | |
| 283 | +} | |
| 284 | + | |
| 285 | +.Commodity_evaluation .Comment_images image { | |
| 286 | + width: 100rpx; | |
| 287 | + height: 100rpx; | |
| 288 | + margin-right: 8rpx; | |
| 289 | + margin-top: 18rpx; | |
| 290 | + border-radius: 6rpx; | |
| 291 | + border: 3rpx solid rgb(245, 245, 245); | |
| 292 | +} | |
| 293 | + | |
| 294 | +.commodity_evaluate .View_evaluation { | |
| 295 | + border: 1px solid #ddd; | |
| 296 | + color: rgb(0, 0, 0); | |
| 297 | + background-color: rgb(255, 255, 255); | |
| 298 | + margin-left: 18rpx; | |
| 299 | +} | |
| 300 | + | |
| 301 | +.comment_addtime { | |
| 302 | + height: 50rpx; | |
| 303 | +} | |
| 304 | + | |
| 305 | +.title_width { | |
| 306 | + width: 146rpx; | |
| 307 | + text-align: center; | |
| 308 | +} | |
| 309 | + | |
| 310 | +.After_all { | |
| 311 | + height: 80rpx; | |
| 312 | + background-color: rgb(245, 245, 245); | |
| 313 | +} | |
| 314 | + | |
| 315 | +.After_all .Line { | |
| 316 | + border-top: 1rpx solid rgb(0, 0, 0); | |
| 317 | + width: 130rpx; | |
| 318 | +} | |
| 319 | + | |
| 320 | +.After_all .end { | |
| 321 | + margin: 0rpx 15rpx; | |
| 322 | +} | |
| 323 | + | |
| 324 | +/* 无订单 */ | |
| 325 | + | |
| 326 | +.empty_order image { | |
| 327 | + width: 329rpx; | |
| 328 | + height: 229rpx; | |
| 329 | + margin-top: 202rpx; | |
| 330 | +} | |
| 331 | + | |
| 332 | +.empty_order .xc-ash { | |
| 333 | + margin-top: 10rpx; | |
| 334 | + font-weight: 600px; | |
| 335 | +} | |
| 336 | + | |
| 337 | +.empty_order navigator { | |
| 338 | + margin-top: 60rpx; | |
| 339 | + border-radius: 40rpx; | |
| 340 | +} | |
| 341 | + | |
| 342 | +.empty_order navigator view { | |
| 343 | + width: 247rpx; | |
| 344 | + height: 56rpx; | |
| 345 | + background-color: rgb(255, 72, 72); | |
| 346 | + border-radius: 40rpx; | |
| 347 | +} | |
| 348 | + | |
| 349 | +.rel { | |
| 350 | + width: 185rpx; | |
| 351 | + height: 185rpx; | |
| 352 | + overflow: hidden; | |
| 353 | + border: 2rpx solid rgb(236, 236, 236); | |
| 354 | +} | |
| 355 | + | |
| 356 | +.abs { | |
| 357 | + top: 15rpx; | |
| 358 | + left: -39rpx; | |
| 359 | + width: 154rpx; | |
| 360 | + height: 40rpx; | |
| 361 | + background-color: rgb(214, 1, 33); | |
| 362 | + transform: rotate(320deg); | |
| 363 | + color: rgb(255, 255, 255); | |
| 364 | + line-height: 40rpx; | |
| 365 | +} | |
| 366 | +.code{ | |
| 367 | + width: 55rpx; | |
| 368 | + height: 55rpx; | |
| 369 | +} | |
| 370 | +.refund{ | |
| 371 | + margin-top: 20rpx; | |
| 150 | 372 | } |
| 151 | 373 | \ No newline at end of file | ... | ... |
pages/user/user_coupon/user_coupon.wxml
| ... | ... | @@ -99,7 +99,9 @@ |
| 99 | 99 | |
| 100 | 100 | </view> |
| 101 | 101 | <view class="xc-buttom "wx:if="{{item.is_open==1}}"> |
| 102 | - <text class="five-level-word explain-coupon">{{util.format(item.Remark)}}</text> | |
| 102 | + <view style="padding: 10rpx"> | |
| 103 | + <text class="five-level-word explain-coupon">{{util.format(item.Remark)}}</text> | |
| 104 | + </view> | |
| 103 | 105 | </view> |
| 104 | 106 | </view> |
| 105 | 107 | </view> | ... | ... |
utils/LoadMore.js
| ... | ... | @@ -79,7 +79,7 @@ var e = function() { |
| 79 | 79 | |
| 80 | 80 | for (var ii = 0; ii < g.length; ii++) { |
| 81 | 81 | //if(g[i].prom_type == 1 || g[i].prom_type == 2 || g[i].prom_type == 6) { |
| 82 | - if (g[ii].prom_type == 1) { | |
| 82 | + if (g[ii].prom_type && g[ii].prom_type == 1) { | |
| 83 | 83 | glist += g[ii].goods_id+","; |
| 84 | 84 | } |
| 85 | 85 | if (g[ii].original_img!=undefined){ | ... | ... |
utils/request.js
| ... | ... | @@ -43,7 +43,10 @@ module.exports = { |
| 43 | 43 | filePath: e.filePath, |
| 44 | 44 | name: e.name, |
| 45 | 45 | success: function(t) { |
| 46 | - i.hideLoading(), console.log("app.request", t), t.data = JSON.parse(i.filterJsonData(t.data)), | |
| 46 | + i.hideLoading(); | |
| 47 | + if(t.statusCode==200) | |
| 48 | + t.data = JSON.parse(i.filterJsonData(t.data)); | |
| 49 | + else { t={code:-1,msg:'调用接口失败'};} | |
| 47 | 50 | i.doSuccess(e, t); |
| 48 | 51 | }, |
| 49 | 52 | fail: function(t) { | ... | ... |
utils/util.js
| ... | ... | @@ -258,6 +258,17 @@ function get_rand_item(arr){ |
| 258 | 258 | return arr[ind]; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | +function getDistance(lat1, lng1, lat2, lng2){ | |
| 262 | + var radLat1 = lat1*Math.PI / 180.0; | |
| 263 | + var radLat2 = lat2*Math.PI / 180.0; | |
| 264 | + var a = radLat1 - radLat2; | |
| 265 | + var b = lng1*Math.PI / 180.0 - lng2*Math.PI / 180.0; | |
| 266 | + var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) + | |
| 267 | + Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2))); | |
| 268 | + s = s *6378.137 ;// EARTH_RADIUS; | |
| 269 | + return s; | |
| 270 | +} | |
| 271 | + | |
| 261 | 272 | module.exports = { |
| 262 | 273 | formatTime: function(e, r) { |
| 263 | 274 | var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) { |
| ... | ... | @@ -347,6 +358,6 @@ module.exports = { |
| 347 | 358 | sub_last: sub_last,//去掉末尾一个字符 |
| 348 | 359 | measureText: measureText,//画布需要的函数 |
| 349 | 360 | check_mobile: check_mobile,//验证手机 |
| 350 | - get_rand_item:get_rand_item, //随机获取元素 | |
| 351 | - | |
| 361 | + get_rand_item:get_rand_item, //随机获取元素 | |
| 362 | + getDistance:getDistance //获取俩个经纬网度之间的距离 | |
| 352 | 363 | }; | ... | ... |