From f90ed54775ebf59635cf9a515cc2b02244bbf467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87?= Date: Tue, 4 Mar 2025 20:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E9=80=81=E6=97=B6=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=90=84=E7=A7=8D=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/common.js | 3 +- api/user.js | 3 +- app.wxss | 4 ++ assets/icon/my/partner-city.png | Bin 0 -> 1084 bytes assets/icon/my/partner-community.png | Bin 0 -> 1538 bytes assets/imgs/test.html | 11 ++++ pages/help/package/index.js | 67 +++++++++++++++++-- pages/help/package/index.wxml | 42 ++++++++++-- pages/help/package/index.wxss | 80 +++++++++++++++++++---- pages/my/index/index.js | 7 +- pages/my/index/index.wxml | 24 +++++-- pages/my/index/index.wxss | 31 --------- pages/my/promation/activities/index.js | 19 +++++- pages/my/promation/activities/index.json | 3 +- pages/my/promation/activities/index.wxml | 5 +- 15 files changed, 230 insertions(+), 69 deletions(-) create mode 100644 assets/icon/my/partner-city.png create mode 100644 assets/icon/my/partner-community.png create mode 100644 assets/imgs/test.html diff --git a/api/common.js b/api/common.js index 922d165..1e4ac7f 100644 --- a/api/common.js +++ b/api/common.js @@ -9,7 +9,8 @@ export default { /** *data:{community_id,latitude,longitude} * */ - wxGroup:(community_id,data)=>request.get(`/api/community/${community_id}/qrcode`,data) + wxGroup:(community_id,data)=>request.get(`/api/community/${community_id}/qrcode`,data), + timePeriods:(community_id)=>request.get(`/api/community-time-periods/community/${community_id}`) }, address:{ list(commityId){ diff --git a/api/user.js b/api/user.js index ec02622..7c0d29c 100644 --- a/api/user.js +++ b/api/user.js @@ -60,7 +60,8 @@ export default { unused:'UNUSED',used:'USED',expired:'EXPIRED' }, list:(data)=>request.get('/api/coupon/user/list',data), - use:(coupon_id)=>request.put(`/api/coupon/${coupon_id}/use`) + use:(coupon_id)=>request.put(`/api/coupon/${coupon_id}/use`), + check:(activity_id)=>request.get(`/api/coupon-activities/${activity_id}/check_receive`) }, point:{ list:(data)=>request.get('/api/point/records',data) diff --git a/app.wxss b/app.wxss index 7dfe54a..82a96d3 100644 --- a/app.wxss +++ b/app.wxss @@ -5,6 +5,9 @@ page{ --main-bgclolor:#F5F5F5; --main-color:#FEC400; --main-hover-color:#fcce39; + + --safe-bottom:constant(safe-area-inset-bottom); + --safe-bottom:env(safe-area-inset-bottom); color:var(--main-font-color); background-color:var(--main-bgclolor); overflow: hidden; @@ -281,6 +284,7 @@ page-container .content{ height:100rpx; width:100%; } +.cells picker{flex:1} .cells .cell-ft{ display: flex; align-items: center; diff --git a/assets/icon/my/partner-city.png b/assets/icon/my/partner-city.png new file mode 100644 index 0000000000000000000000000000000000000000..11b8d3b7a85b4ab4e586c4819c9b9ffe1adc7fc2 GIT binary patch literal 1084 zcmV-C1jGA@P)Px#1am@3R0s$N2z&@+hyVZs=1D|BRA_i6$Dq{a|Q4~kDp-&vIPDG>V44h1nBPRnduRO+;jY~tC*_k>h9{Qfj5Sf zQPu~Vk?hEYd|*;oH;=FmIVIsEN(!`#J~RSTV2m(Exs_uEp^8BcYo7)ObWu7*Evyvb ziYG4RglV>D26|75a)WLse1j1t)Huls_ayU&7W{bi&H^Y+=Jd0~ybkLf-+(llQB|Wf zb;N~F#2M0hPs)Oy(T#cu>KwX4yY5t)lR96A&_lV-vpdE_N3?-1u9M=4Hqf&TxgAb; zk6K3ta>RKa17l-e^gu`Su{oXa-lgka!|Hf@%5^^TD#T@ry7wKQ!wu{I54ID=R$R7t zP8D}Z7eF6qGFyAtjB!Xp04Bkyugy*l{Scx!tPeDq(`Ck)0qeqSJuAS3la^Fx+ zVJ)%(^z)FNc!V(H47E7Bq=C{gJExsG9iwksMoaxU-O_dv!C~#w0KNn~$!Bo3ex%Dv zX@}*6DH5>8)EkcDlKR2K3F!r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}LM&ZTMnjPbnZwT*E5|pDN z6LdLbT*_|zIV75hKwKD8qf>O!Z9#reIBQJvm`B{IRWzybF~V1Q(vstT)7-=>@0l0D zL!aB54aI_h0y9~kJae>Gok~oj>)d+n98!?D!-#?dZ3mAq-780Rd zn$CI_Mx{rBYy2GXPN^2Z>~ZaEsmfu@cDmRje5LcU-T@?VsniSpU_Y$3uojx#YeTZ?$pZ>6>PZA|ihl21g% zGYHb+42dY72-lVhb!uaw*^PW6-1GjZxLNZ^4?^MXSGbm4j;wkh;}r|GTjsG3~278?ufcy!NLI3~&07*qoM6N<$f@-DM_5c6? literal 0 HcmV?d00001 diff --git a/assets/imgs/test.html b/assets/imgs/test.html new file mode 100644 index 0000000..d47a675 --- /dev/null +++ b/assets/imgs/test.html @@ -0,0 +1,11 @@ + + + + + + Vite + Vue + TS + + +
123
+ + diff --git a/pages/help/package/index.js b/pages/help/package/index.js index c99d283..62998bc 100644 --- a/pages/help/package/index.js +++ b/pages/help/package/index.js @@ -4,16 +4,22 @@ const app = getApp(); Page({ + savedTimePeriodId:'', /** * 页面的初始数据 */ data: { stationList:[], - sendType:'DELIVERY_AT_DOORSTEP', + sendType:'DELIVERY_AT_DOORSTEP',//默认方式 tempImgs:[], imgUploading:false, imgOrderCount:0, - maxChooseImgCount:10 + maxChooseImgCount:10, + sendTypeKV:userApi.order.orderDeliverStatusKV, + + timePeriods:[], + timePeriodsIndex:0, + isShowDeliverType:false }, validator:{ imgOrderCount:{min:1,shake:true} @@ -64,11 +70,22 @@ Page({ priceRequest.pickup_images_count = this.data.imgOrderCount; priceRequest.pickup_images = imgs.join(',') } + if(this.data.timePeriodsIndex==-1){ + wx.showToast({ + icon:'none', + title:'请选择配送时段' + }); + this.setData({ + scrollToViewId:'scrollViewDispatch' + }) + return; + } wx.setStorage({ key:'pre-order', data:{ price_request:priceRequest, - delivery_method:this.data.sendType + delivery_method:this.data.sendType, + timePeriodId:this.data.timePeriods[this.data.timePeriodsIndex].time_period_id }, success(){ wx.navigateBack(); @@ -130,10 +147,20 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { + + //获取配送时段 + commonApi.community.timePeriods(options.communityId).then((data)=>{ + this.setData({ + timePeriods:data + }); + this.findTimePeriodId(); + }); commonApi.station.list(options.communityId).then((data)=>{ wx.getStorage({ key:'pre-order', success:(res)=>{ + this.savedTimePeriodId = res.data.timePeriodId; + this.findTimePeriodId(); data.items.map((item,index)=>{ const __item = res.data.price_request.packages.find((_item)=>_item.station_id==item.id); if(__item){ @@ -151,7 +178,6 @@ Page({ }); imgOrderCount = res.data.price_request.pickup_images_count||0; } - console.log(tempImgs); this.setData({ sendType:res.data.delivery_method, stationList:data.items, @@ -173,10 +199,17 @@ Page({ }); }); }, - sendTypeChange(event){ - this.setData({ - sendType:event.detail.value + findTimePeriodId(){ + const timePeriodsIndex = this.data.timePeriods.findIndex((item)=>{ + console.log(item.time_period_id,this.savedTimePeriodId); + return item.time_period_id==this.savedTimePeriodId; }); + if(timePeriodsIndex>-1){ + this.setData({ + timePeriodsIndex + }) + } + console.log(timePeriodsIndex); }, chooseImage(){ wx.chooseMedia({ @@ -250,6 +283,26 @@ Page({ imgOrderCount:this.data.imgOrderCount+1 }) }, + showSendType(){ + this.setData({ + isShowDeliverType:true + }) + }, + confirmDeliverType(){ + this.setData({ + isShowDeliverType:false + }) + }, + chooseDeliverType(event){ + this.setData({ + sendType:event.currentTarget.dataset.index + }) + }, + chooseTime(event){ + this.setData({ + timePeriodsIndex:event.currentTarget.dataset.index + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/help/package/index.wxml b/pages/help/package/index.wxml index 14e09c3..8a1f2ec 100644 --- a/pages/help/package/index.wxml +++ b/pages/help/package/index.wxml @@ -1,5 +1,5 @@ - + @@ -61,7 +61,20 @@ - + + + 配送 + + + {{sendTypeKV[sendType]}} + + 配送时段:{{timePeriods[timePeriodsIndex].time_period_name}} + + + + + + + - \ No newline at end of file + + + + + 投递方式 + + + {{item}} + + + 配送时段 + + + {{item.time_period_name}} + + + + + \ No newline at end of file diff --git a/pages/help/package/index.wxss b/pages/help/package/index.wxss index b031340..47645be 100644 --- a/pages/help/package/index.wxss +++ b/pages/help/package/index.wxss @@ -26,19 +26,6 @@ background: rgba(124, 134, 149, 0.08); } -.send-way .radio{ - display: flex; - justify-content: space-between; - padding-top:30rpx; -} - -.send-way .title{ - font-size: 34prx; - font-weight: 500; -} -.send-way .radio .item{ - padding:14rpx 30rpx; -} .page-container .tips{ @@ -192,4 +179,71 @@ height:50%; left:22rpx;top:25%; z-index: 100; +} + +.cells .cell{ + position: relative; +} +.cells .cell .cell-hd{ + font-size: 34rpx; +} +.cells .cell .cell-bd{ + display: block; + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: center; + gap: 26rpx; + min-height: auto; + padding:36rpx 40rpx 36rpx 0; +} +.cells .cell .cell-ft{ + padding: 0; +} +.cells .cell .line1{ + font-size: 32rpx; +} + +.deliver-type-content{ + padding:0 30rpx calc(var(--safe-bottom) + 24rpx) 30rpx; + background-color: #fff!important; +} +.deliver-type-content .title{ + padding-top:50rpx; + font-size: 36rpx; + font-weight: 500; +} +.deliver-type-content .deliver-list{ + display: flex; + gap: 30rpx; + margin-top:40rpx; +} +.deliver-type-content .deliver-list .item{ + border: 1rpx solid rgba(136, 136, 136, 0.5); + background: rgba(153, 153, 153, 0.05); + border-radius:12rpx; + padding:18rpx 24rpx; +} +.deliver-type-content .deliver-list .item.current{ + border: 0.5px solid #FFC300; + background: rgba(255, 195, 0, 0.05); + color: #FFC300; +} + +.deliver-type-content .time-list{ + margin-top:40rpx; + display: flex; + flex-direction: column; + gap: 24rpx; +} +.deliver-type-content .time-list .item{ + border: 1rpx solid rgba(136, 136, 136, 0.5); + border-radius: 18rpx; + padding:30rpx; +} +.deliver-type-content .time-list .item.current{ + border: 2rpx solid #FFC300; +} +.deliver-type-content .button{ + margin-top:40rpx; } \ No newline at end of file diff --git a/pages/my/index/index.js b/pages/my/index/index.js index b7f35c5..cab736c 100644 --- a/pages/my/index/index.js +++ b/pages/my/index/index.js @@ -42,12 +42,13 @@ Page({ // bgHeight:'100%' // }); }, - applyPartnert(){ + applyPartnert(event){ + let type = event.currentTarget.dataset.type; let url = this.data.appConfig.url_partner_apply; if(url.indexOf('?')>-1){ - url = `${url}&userid=${this.data.userInfo.userid}` + url = `${url}&userid=${this.data.userInfo.userid}&type=${type}` }else{ - url = `${url}?userid=${this.data.userInfo.userid}` + url = `${url}?userid=${this.data.userInfo.userid}&type=${type}` } wx.navigateTo({ url: `/pages/browser/index?url=${encodeURIComponent(url)}`, diff --git a/pages/my/index/index.wxml b/pages/my/index/index.wxml index 5915535..408f6cf 100644 --- a/pages/my/index/index.wxml +++ b/pages/my/index/index.wxml @@ -67,11 +67,25 @@ - - - 招募城市合伙人 - + + + + + + + + 小区服务商 + + + + + + + + + 城市运营商 + + - 人人都有金饭碗, 钱多事好离家近 \ No newline at end of file diff --git a/pages/my/index/index.wxss b/pages/my/index/index.wxss index e3b55ee..59dc51e 100644 --- a/pages/my/index/index.wxss +++ b/pages/my/index/index.wxss @@ -96,34 +96,3 @@ .cell.is-button:hover{ background-color: #fff; } - -.recruit-view{ - box-shadow: 0px 3px 6px 2px rgba(0, 0, 0, 0.04); - background: linear-gradient(270deg, #FCF7E8 34%, #FCF1CE 76%); - margin:30rpx 20rpx; - border-radius: 20rpx; - color: #DFAB00; - padding:30rpx 30rpx 30rpx 40rpx; -} -.recruit-view .title{ - display: flex; - align-items: center; -} -.recruit-view .title .button{ - font-size: 26rpx; - font-weight: normal; - background: linear-gradient(180deg, #FFE285 0%, #FFC91B 100%); - box-shadow: 0px 3px 4px 0px rgba(196, 149, 0, 0.2); - padding:14rpx 26rpx; - line-height: 1; - color: #664E00; -} -.recruit-view .title .text{ - font-size: 42rpx; - flex:1 -} -.recruit-view .sub-title{ - font-size: 29rpx; - margin-top:26rpx; - font-style: italic; -} \ No newline at end of file diff --git a/pages/my/promation/activities/index.js b/pages/my/promation/activities/index.js index 078f1f2..95942ee 100644 --- a/pages/my/promation/activities/index.js +++ b/pages/my/promation/activities/index.js @@ -1,4 +1,5 @@ import commonApi from '../../../../api/common'; +import userApi from '../../../../api/user'; Page({ @@ -9,7 +10,10 @@ Page({ detail:{}, activityId:'', detailLoading:false, - getting:true + getting:true, + + isShowModal:false, + errorMsg:'' }, /** @@ -20,6 +24,14 @@ Page({ activityId:options.id||2 }); this.getActivityDetail(); + userApi.coupon.check(options.id||2).then((data)=>{ + if(!data.can_receive){ + this.setData({ + isShowModal:true, + errorMsg:data.message + }) + } + }) }, getActivityDetail(){ this.setData({ @@ -57,6 +69,11 @@ Page({ }) }) }, + navToIndex(){ + wx.reLaunch({ + url: '/pages/help/index/index', + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/my/promation/activities/index.json b/pages/my/promation/activities/index.json index e5c8349..69b888c 100644 --- a/pages/my/promation/activities/index.json +++ b/pages/my/promation/activities/index.json @@ -1,6 +1,7 @@ { "usingComponents": { - "nav-bar":"/components/navbar" + "nav-bar":"/components/navbar", + "modal-view":"/components/modalView" }, "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/my/promation/activities/index.wxml b/pages/my/promation/activities/index.wxml index dd0ff03..e4c6f86 100644 --- a/pages/my/promation/activities/index.wxml +++ b/pages/my/promation/activities/index.wxml @@ -26,4 +26,7 @@ loading="{{getting}}" type="primary" class="button" bind:tap="getActivity" wx:else>一键领取 - \ No newline at end of file + + + \ No newline at end of file