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 0000000..11b8d3b Binary files /dev/null and b/assets/icon/my/partner-city.png differ diff --git a/assets/icon/my/partner-community.png b/assets/icon/my/partner-community.png new file mode 100644 index 0000000..34d6b0d Binary files /dev/null and b/assets/icon/my/partner-community.png differ 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