配送时段,找回密码等
This commit is contained in:
parent
f90ed54775
commit
96b79dccaf
@ -33,7 +33,7 @@ export default {
|
||||
},
|
||||
activities:{
|
||||
detail:(activity_id)=>request.get(`/api/coupon-activities/${activity_id}`),
|
||||
receive:(activity_id)=>request.post(`/api/coupon-activities/${activity_id}/receive`)
|
||||
receive:(activity_id)=>request.post(`/api/coupon-activities/${activity_id}/receive`,{},{noTips:true})
|
||||
},
|
||||
uploadImg(file,progress){
|
||||
if(!app)app = getApp();
|
||||
|
||||
11
api/user.js
11
api/user.js
@ -13,11 +13,14 @@ export default {
|
||||
})
|
||||
},
|
||||
loginWithCode(wxCode,phoneCode,rCode){
|
||||
return request.post('/api/wechat/phone-login',{
|
||||
let params = {
|
||||
login_code:wxCode,
|
||||
phone_code:phoneCode,
|
||||
referral_code:rCode||''
|
||||
});
|
||||
phone_code:phoneCode
|
||||
}
|
||||
if(rCode){
|
||||
params.referral_code = rCode;
|
||||
}
|
||||
return request.post('/api/wechat/phone-login',params);
|
||||
},
|
||||
info(){
|
||||
return request.get('/api/user/info');
|
||||
|
||||
11
app.js
11
app.js
@ -3,9 +3,6 @@ import commonApi from './api/common';
|
||||
let token = wx.getStorageSync('accessToken');
|
||||
App({
|
||||
async onLaunch(options){
|
||||
// await this.aaa();
|
||||
console.log(wx.router);
|
||||
console.log('app onlaunch',new Date().getTime());
|
||||
wx.getStorage({
|
||||
key:'accessToken',
|
||||
success:(res)=>{
|
||||
@ -33,15 +30,7 @@ App({
|
||||
}
|
||||
})
|
||||
},
|
||||
aaa(){
|
||||
return new Promise((rs,rj)=>{
|
||||
setTimeout(()=>{
|
||||
rs();
|
||||
},2000)
|
||||
})
|
||||
},
|
||||
onShow(options){
|
||||
console.log('app onShow',new Date().getTime());
|
||||
/**
|
||||
* shared_user_code 通过分享进来的 分享者 的user_code
|
||||
* 这里必须放到onshow 里 才能实时获取 code 先保存在这里,再跳转登录的时候通过 url 带过去,防止刷新丢失 code
|
||||
|
||||
2
app.json
2
app.json
@ -1,8 +1,8 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/help/index/index",
|
||||
"pages/login/login",
|
||||
"pages/my/promation/activities/index",
|
||||
"pages/login/login",
|
||||
"pages/help/success/index",
|
||||
"pages/shop/index/index",
|
||||
"pages/order/index/index",
|
||||
|
||||
6
app.wxss
6
app.wxss
@ -27,7 +27,7 @@ button .icon,button label{
|
||||
vertical-align: middle;
|
||||
}
|
||||
button:not([size=mini]){
|
||||
width:auto;
|
||||
width:auto!important;
|
||||
padding:30rpx 25rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
@ -36,8 +36,8 @@ button:not([size=mini]) .icon{
|
||||
}
|
||||
|
||||
button[type=primary]{
|
||||
background-color:var(--main-color);
|
||||
color:var(--main-font-color);
|
||||
background-color:var(--main-color)!important;
|
||||
color:var(--main-font-color)!important;
|
||||
}
|
||||
button[disabled]{
|
||||
opacity: .7;
|
||||
|
||||
@ -5,14 +5,14 @@ Component({
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
"bindrefresherrefresh":{
|
||||
type:Function
|
||||
},
|
||||
"refresherTriggered":{
|
||||
refresherTriggered:{
|
||||
type:Boolean,
|
||||
value:false
|
||||
},
|
||||
height:0,
|
||||
height:{
|
||||
type:Number,
|
||||
value:0
|
||||
},
|
||||
loadMoreText:{
|
||||
type:String,
|
||||
value:'已经到底了'
|
||||
|
||||
@ -110,6 +110,7 @@
|
||||
}
|
||||
.order-button{
|
||||
margin:40rpx 20rpx!important;
|
||||
box-shadow: 0px 6rpx 10rpx 4rpx rgba(255, 195, 0, 0.2);
|
||||
}
|
||||
.action-bar{
|
||||
display: flex;
|
||||
|
||||
@ -85,7 +85,7 @@ Page({
|
||||
data:{
|
||||
price_request:priceRequest,
|
||||
delivery_method:this.data.sendType,
|
||||
timePeriodId:this.data.timePeriods[this.data.timePeriodsIndex].time_period_id
|
||||
community_time_period_id:this.data.timePeriods[this.data.timePeriodsIndex].communtiy_time_period_id
|
||||
},
|
||||
success(){
|
||||
wx.navigateBack();
|
||||
@ -142,7 +142,22 @@ Page({
|
||||
const packageIndex = event.currentTarget.dataset.p_index;
|
||||
this.data.stationList[itemIndex].package[packageIndex] = event.detail.value;
|
||||
},
|
||||
|
||||
checkInput(event){
|
||||
const itemIndex = event.currentTarget.dataset.index;
|
||||
const packageIndex = event.currentTarget.dataset.p_index;
|
||||
let packages = this.data.stationList[itemIndex].package;
|
||||
if(packages.length>1){
|
||||
if(packages.filter((item)=>item==packages[packages.length-1]).length>1){
|
||||
wx.showToast({
|
||||
icon:'none',
|
||||
title: '取件码重复'
|
||||
})
|
||||
this.setData({
|
||||
[`stationList[${itemIndex}].package[${packageIndex}]`]:''
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
@ -159,7 +174,7 @@ Page({
|
||||
wx.getStorage({
|
||||
key:'pre-order',
|
||||
success:(res)=>{
|
||||
this.savedTimePeriodId = res.data.timePeriodId;
|
||||
this.savedTimePeriodId = res.data.community_time_period_id;
|
||||
this.findTimePeriodId();
|
||||
data.items.map((item,index)=>{
|
||||
const __item = res.data.price_request.packages.find((_item)=>_item.station_id==item.id);
|
||||
@ -201,8 +216,7 @@ Page({
|
||||
},
|
||||
findTimePeriodId(){
|
||||
const timePeriodsIndex = this.data.timePeriods.findIndex((item)=>{
|
||||
console.log(item.time_period_id,this.savedTimePeriodId);
|
||||
return item.time_period_id==this.savedTimePeriodId;
|
||||
return item.communtiy_time_period_id==this.savedTimePeriodId;
|
||||
});
|
||||
if(timePeriodsIndex>-1){
|
||||
this.setData({
|
||||
@ -299,9 +313,13 @@ Page({
|
||||
})
|
||||
},
|
||||
chooseTime(event){
|
||||
const index = event.currentTarget.dataset.index;
|
||||
const item = this.data.timePeriods[index];
|
||||
if(!item.order_full){
|
||||
this.setData({
|
||||
timePeriodsIndex:event.currentTarget.dataset.index
|
||||
timePeriodsIndex:index
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"bottomBar":"/components/bottomBar"
|
||||
},
|
||||
"navigationStyle": "default",
|
||||
"navigationBarTitleText": "添加快递信息"
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<view class="package-list">
|
||||
<view class="item" wx:for="{{item.package}}" wx:for-item="pItem" wx:for-index="pIndex" wx:key="pIndex">
|
||||
<label class="label">取件码{{pIndex+1}}</label>
|
||||
<input value="{{pItem}}" class="input" bindinput="setPackageCode" cursor-spacing="136rpx"
|
||||
<input value="{{pItem}}" class="input" bindinput="setPackageCode" cursor-spacing="136rpx" bindblur="checkInput"
|
||||
data-index="{{index}}" data-p_index="{{pIndex}}" focus="{{item.focus&&pItem==''}}"/>
|
||||
<button class="button" bind:tap="deletePackage" data-index="{{index}}" data-p_index="{{pIndex}}">
|
||||
<image class="icon" src="/assets/icon/help/delete.png"/>
|
||||
@ -104,7 +104,7 @@
|
||||
<view class="title">配送时段</view>
|
||||
<view class="time-list">
|
||||
<view wx:for="{{timePeriods}}" wx:key="index" bind:tap="chooseTime" data-index="{{index}}"
|
||||
class="item {{timePeriodsIndex==index?'current':''}}">
|
||||
class="item {{timePeriodsIndex==index?'current':''}} {{item.order_full?'disabled':''}}">
|
||||
{{item.time_period_name}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -240,9 +240,27 @@
|
||||
border: 1rpx solid rgba(136, 136, 136, 0.5);
|
||||
border-radius: 18rpx;
|
||||
padding:30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.deliver-type-content .time-list .item.current{
|
||||
border: 2rpx solid #FFC300;
|
||||
background-color: rgba(255, 195, 0, 0.05);
|
||||
color: var(--main-color);
|
||||
}
|
||||
.deliver-type-content .time-list .item.disabled{
|
||||
border: 1rpx solid rgba(136, 136, 136, 0.5);
|
||||
background-color: rgba(153, 153, 153, 0.1);
|
||||
color: #999999;
|
||||
}
|
||||
.deliver-type-content .time-list .item.disabled::after{
|
||||
content:'运力不足';
|
||||
}
|
||||
.deliver-type-content .time-list .item .time{
|
||||
flex:1;
|
||||
}
|
||||
.deliver-type-content .time-list .item .status{
|
||||
|
||||
}
|
||||
.deliver-type-content .button{
|
||||
margin-top:40rpx;
|
||||
|
||||
@ -7,7 +7,6 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
userInfo:{},
|
||||
scrollViewHeight:0,
|
||||
refresherTriggered:true,
|
||||
bgHeight:'100%',
|
||||
appConfig:{}
|
||||
@ -27,10 +26,6 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
this.setData({
|
||||
scrollViewHeight:windowInfo.windowHeight
|
||||
});
|
||||
},
|
||||
scrollViewPulling(event){
|
||||
// this.setData({
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<scroll-view scroll-y style="height:{{scrollViewHeight*2}}rpx" refresher-enabled
|
||||
<scroll-view scroll-y refresher-enabled class="user-info-scroll-view"
|
||||
bindrefresherrefresh="getUserInfo" refresher-triggered="{{refresherTriggered}}"
|
||||
bindrefresherpulling="scrollViewPulling" bindrefresherrestore="scrollViewPullingOver"
|
||||
refresher-background="var(--main-color)">
|
||||
@ -88,4 +88,5 @@
|
||||
<view class="cell-ft"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll-view-dispatch"></view>
|
||||
</scroll-view>
|
||||
@ -1,3 +1,6 @@
|
||||
.user-info-scroll-view{
|
||||
height:100vh;
|
||||
}
|
||||
.user-info{
|
||||
height:460rpx;
|
||||
position: relative;
|
||||
|
||||
@ -45,6 +45,10 @@ Page({
|
||||
this.setData({
|
||||
detail:data
|
||||
})
|
||||
}).catch(()=>{
|
||||
this.setData({
|
||||
detailLoading:false
|
||||
})
|
||||
})
|
||||
},
|
||||
getActivity(){
|
||||
@ -55,15 +59,15 @@ Page({
|
||||
wx.showToast({
|
||||
title: '领取成功',
|
||||
});
|
||||
const pages = getCurrentPages();
|
||||
if(pages.length>1){
|
||||
wx.navigateBack();
|
||||
}else{
|
||||
wx.reLaunch({
|
||||
url: '/pages/help/index/index',
|
||||
this.setData({
|
||||
isShowModal:true,
|
||||
errorMsg:'恭喜您已领取成功!'
|
||||
})
|
||||
}
|
||||
}).catch((e)=>{
|
||||
this.setData({
|
||||
isShowModal:true,
|
||||
errorMsg:e.message||'领取错误'
|
||||
})
|
||||
this.setData({
|
||||
getting:false
|
||||
})
|
||||
|
||||
@ -14,19 +14,18 @@
|
||||
<view class="tips">先领券,再下单,免费配送</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="button diabled" disabled type="primary"
|
||||
<!-- <button class="button diabled" disabled type="primary"
|
||||
wx:if="{{detail.is_end||!detail.is_active||!detail.can_receive}}">
|
||||
{{
|
||||
detail.is_end?'活动已结束':
|
||||
!detail.is_active?'活动已关闭':
|
||||
!detail.can_receive?'无法领取':''
|
||||
}}
|
||||
</button>
|
||||
<button disabled="{{getting}}"
|
||||
loading="{{getting}}" type="primary"
|
||||
class="button" bind:tap="getActivity" wx:else>一键领取</button>
|
||||
</button> -->
|
||||
<button disabled="{{getting}}" loading="{{getting}}" type="primary"
|
||||
class="button" bind:tap="getActivity">一键领取</button>
|
||||
</view>
|
||||
<image src="/assets/imgs/login/main.png" class="bottom-img"/>
|
||||
|
||||
<modal-view titleText="{{errorMsg}}" okButtonText="回首页" bind:ok="navToIndex"
|
||||
model:show="{{isShowModal}}"/>
|
||||
<modal-view titleText="{{errorMsg}}" okButtonText="回到首页" cancelButtonText="再想想"
|
||||
bind:ok="navToIndex" model:show="{{isShowModal}}"/>
|
||||
@ -34,9 +34,8 @@
|
||||
<view class="page-container package-info">
|
||||
<view class="title">
|
||||
<view class="left">取件信息</view>
|
||||
<view class="right">
|
||||
<label>{{orderDetail.delivery_time}}</label>
|
||||
<!-- <label class="time">18:00~21:00</label> -->
|
||||
<view class="right" wx:if="{{orderDetail.time_period_name}}">
|
||||
送达时间<label class="time">{{orderDetail.time_period_name}}</label>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:if="{{orderDetail.pickup_images&&orderDetail.pickup_images.length>0}}">
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.page-container .title .right .time{
|
||||
color:#EB0000;
|
||||
color:#ff0000;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
margin-left: 10rpx;
|
||||
|
||||
@ -44,5 +44,6 @@
|
||||
"tabIndent": "auto",
|
||||
"tabSize": 2
|
||||
},
|
||||
"appid": "wx3cc5b7dcb28f2756"
|
||||
"appid": "wx3cc5b7dcb28f2756",
|
||||
"simulatorPluginLibVersion": {}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user