登录问题以及若干 bug

This commit is contained in:
2025-03-06 19:40:48 +08:00
parent 96b79dccaf
commit c9b691ea7e
21 changed files with 115 additions and 95 deletions

1
app.js
View File

@ -1,6 +1,7 @@
import userApi from './api/user';
import commonApi from './api/common';
let token = wx.getStorageSync('accessToken');
console.log(1);
App({
async onLaunch(options){
wx.getStorage({

View File

@ -14,7 +14,9 @@ page{
min-height: 100vh;
box-sizing: border-box;
}
view::-webkit-scrollbar{
display: none;
}
button{
border-radius: 24rpx;
box-sizing: border-box;
@ -36,8 +38,8 @@ button:not([size=mini]) .icon{
}
button[type=primary]{
background-color:var(--main-color)!important;
color:var(--main-font-color)!important;
background-color:var(--main-color);
color:var(--main-font-color);
}
button[disabled]{
opacity: .7;
@ -178,7 +180,7 @@ page-container .content{
content: '- ¥';
}
.money{
color:#EB0000;
color:#ff0000;
}
.money-promation{
color:#FF8400;
@ -219,7 +221,7 @@ page-container .content{
}
.custom-scroll-view .main{
flex:1;
overflow: auto;
overflow: hidden;
}
.bottom-bar-v2{
padding:24rpx;
@ -261,7 +263,7 @@ page-container .content{
}
.cells .cell-hd.not-empty::before{
content: '*';
color: #EB0000
color: #ff0000;
}
.cells .cell-hd .icon{
width:40rpx;height:40rpx;

View File

@ -1,4 +1,6 @@
<scroll-view scroll-y refresher-enabled bindrefresherrefresh="refreshList" refresher-triggered="{{refresherTriggered}}" style="{{heightStyle}}" bindscroll="scrolling" class="scroll-view" id="scrollView">
<scroll-view scroll-y refresher-enabled bindrefresherrefresh="refreshList"
refresher-triggered="{{refresherTriggered}}" style="{{heightStyle}}" enhanced
bindscroll="scrolling" class="scroll-view" id="scrollView" show-scrollbar="{{false}}">
<view class="scroll-view-content">
<slot/>
</view>

View File

@ -27,7 +27,7 @@
.modal-view-main .btns{
margin-top:32rpx;
display: flex;
gap: 18rpx;
gap: 20rpx;
}
.modal-view-main .btns .button{
flex:1;

View File

@ -1,9 +1,9 @@
/* components/navBar.wxss */
.nav-bar{}
.nav-bar .title{
font-size: 32rpx;
font-weight: 500;
color: var(--main-font-color);
font-size: 36rpx;
font-weight: 600;
color:#222222;
}
.nav-bar-content{
display: flex;

View File

@ -38,7 +38,7 @@
}
.shop-item .promation.buy .coupon::before{
content: '买';
background-color:#EB0000;
background-color:#ff0000;
}
.shop-item .promation .coupon::before{
content: '券';

View File

@ -39,6 +39,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('onLoad',new Date().getTime());
let height = this.selectComponent("#navBar").getHeight();
this.setData({
navBarHeight:height
@ -64,11 +65,13 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
console.log('onReady',new Date().getTime());
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('onShow',new Date().getTime());
wx.getStorage({
key:'pre-order',
success:(res)=>{

View File

@ -218,7 +218,7 @@
color: #FF8400;
}
.pc-content .kv-item .red{
color: #EB0000;
color: #ff0000;
}
.pc-content .kv-item .key{
flex:1

View File

@ -18,7 +18,7 @@ Page({
sendTypeKV:userApi.order.orderDeliverStatusKV,
timePeriods:[],
timePeriodsIndex:0,
timePeriodsIndex:-1,
isShowDeliverType:false
},
validator:{
@ -85,7 +85,8 @@ Page({
data:{
price_request:priceRequest,
delivery_method:this.data.sendType,
community_time_period_id:this.data.timePeriods[this.data.timePeriodsIndex].communtiy_time_period_id
community_time_period_id:this.data.timePeriods[this.data.timePeriodsIndex].communtiy_time_period_id,
delivery_date:this.data.timePeriods[this.data.timePeriodsIndex].time_period_date
},
success(){
wx.navigateBack();
@ -162,68 +163,65 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取配送时段
commonApi.community.timePeriods(options.communityId).then((data)=>{
this.setData({
timePeriods:data
});
this.findTimePeriodId();
});
let preOrder = wx.getStorageSync('pre-order');
this.savedTimePeriodId = preOrder.community_time_period_id;
commonApi.station.list(options.communityId).then((data)=>{
wx.getStorage({
key:'pre-order',
success:(res)=>{
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);
if(__item){
item.package = __item.pickup_codes.split(',')||[];
}
});
let tempImgs = [],imgOrderCount = 0;
if(res.data.price_request.pickup_images){
const imgs = res.data.price_request.pickup_images.split(',');
imgs.map((item)=>{
tempImgs.push({
serverUrl:item,
uploaded:true
})
});
imgOrderCount = res.data.price_request.pickup_images_count||0;
data.items.map((item,index)=>{
if(preOrder){
const __item = preOrder.price_request.packages.find((_item)=>_item.station_id==item.id);
if(__item){
item.package = __item.pickup_codes.split(',')||[];
return;
}
this.setData({
sendType:res.data.delivery_method,
stationList:data.items,
tempImgs,
imgOrderCount
});
}
});
data.items.map((item)=>{
item.package = [];
});
let tempImgs = [],imgOrderCount = 0;
if(preOrder?.price_request?.pickup_images){
const imgs = preOrder.price_request.pickup_images.split(',');
imgs.map((item)=>{
tempImgs.push({
serverUrl:item,
uploaded:true
})
});
imgOrderCount = preOrder.price_request.pickup_images_count||0;
}
this.setData({
stationList:data.items
sendType:preOrder.delivery_method,
stationList:data.items,
tempImgs,
imgOrderCount
});
wx.nextTick(()=>{
this.setData({
[`stationList[0].focus`]:true
})
//获取配送时段
return commonApi.community.timePeriods(options.communityId);
}).then((data)=>{
let timePeriodsIndex = data.findIndex((item)=>{
//找到之前选择的时段
if(item.communtiy_time_period_id==this.savedTimePeriodId){
//如果没满
if(!item.order_full){
return true;
}
}
});
});
},
findTimePeriodId(){
const timePeriodsIndex = this.data.timePeriods.findIndex((item)=>{
return item.communtiy_time_period_id==this.savedTimePeriodId;
});
if(timePeriodsIndex>-1){
this.setData({
timePeriodsIndex
//如果还是没找到就去找is_default 还是没有就让用户去选择,这里应该是没有可选的了
if(timePeriodsIndex==-1){
timePeriodsIndex = data.findIndex((item)=>item.is_default);
}
data.map((item)=>{
// item.order_full = true;
})
}
console.log(timePeriodsIndex);
this.setData({
timePeriods:data,
timePeriodsIndex
});
})
},
chooseImage(){
wx.chooseMedia({
@ -325,7 +323,6 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**

View File

@ -1,5 +1,5 @@
<view class="custom-scroll-view">
<scroll-view class="main" scroll-y scroll-with-animation scroll-into-view="{{scrollToViewId}}">
<scroll-view class="main" scroll-y scroll-with-animation scroll-into-view="{{scrollToViewId}}" enhanced show-scrollbar="{{false}}">
<view class="page-container img-area">
<view class="head">
<view class="title">
@ -68,7 +68,10 @@
<view class="line1">
{{sendTypeKV[sendType]}}
</view>
<view>配送时段:{{timePeriods[timePeriodsIndex].time_period_name}}</view>
<view wx:if="{{timePeriodsIndex>-1}}">
配送时段:{{timePeriods[timePeriodsIndex].time_period_name}}
</view>
<view wx:else>配送时段:请选择</view>
</view>
<view class="cell-ft"></view>
</view>
@ -103,8 +106,8 @@
</view>
<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':''}} {{item.order_full?'disabled':''}}">
<view wx:for="{{timePeriods}}" wx:key="index" bind:tap="chooseTime"
data-index="{{index}}" class="item {{timePeriodsIndex==index?'current':''}} {{item.order_full?'order_full':''}}">
{{item.time_period_name}}
</view>
</view>

View File

@ -248,14 +248,17 @@
background-color: rgba(255, 195, 0, 0.05);
color: var(--main-color);
}
.deliver-type-content .time-list .item.disabled{
.deliver-type-content .time-list .item.order_full,.deliver-type-content .time-list .item.expired{
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{
.deliver-type-content .time-list .item.order_full::after{
content:'运力不足';
}
.deliver-type-content .time-list .item.expired::after{
content:'不可用'
}
.deliver-type-content .time-list .item .time{
flex:1;
}

View File

@ -1,7 +1,7 @@
<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)">
refresher-background="var(--main-color)" enhanced show-scrollbar="{{false}}">
<view class="user-info">
<view class="content">
<navigator url="/pages/my/setting/index/index">

View File

@ -21,10 +21,10 @@ Page({
*/
onLoad(options) {
this.setData({
activityId:options.id||2
activityId:options.id
});
this.getActivityDetail();
userApi.coupon.check(options.id||2).then((data)=>{
userApi.coupon.check(options.id).then((data)=>{
if(!data.can_receive){
this.setData({
isShowModal:true,

View File

@ -1,10 +1,11 @@
<nav-bar back/>
<nav-bar back>
<label class="title">活动福利</label>
</nav-bar>
<view class="loadings">
<view class="weui-loading" wx:if="{{detailLoading}}"></view>
</view>
<view class="promation-coupon">
<view class="time">领取时间:{{detail.daily_start_time}}-{{detail.daily_end_time}}</view>
<view class="coupon-list">
<view class="item" wx:for="{{detail.coupons}}" wx:key="index">
<view class="name">

View File

@ -9,17 +9,11 @@ page{
height:80rpx;
text-align: center;
}
.time{
background: linear-gradient(90deg, #FFC300 8%, #DFAB01 93%);
border-radius: 0px 60rpx 60rpx 0px;
display: inline-block;
padding:20rpx;
}
.coupon-list .item{
background-color: #fff;
border-radius: 24rpx;
padding:32rpx 40rpx 40rpx;
margin-top:50rpx;
margin-bottom:50rpx;
box-shadow: 0px 4px 10px 2px rgba(222, 169, 0, 0.5);
position: relative;
z-index: 1;

View File

@ -1,5 +1,6 @@
<scroll-view scroll-y style="height:{{scrollViewHeight*2}}rpx" refresher-enabled
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}">
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}"
enhanced show-scrollbar="{{false}}">
<view class="page-container prd-info">
<view class="head">
<view class="center">

View File

@ -107,8 +107,8 @@
padding:0 14rpx;
}
.order-info .kv .tag{
border: 1rpx solid #EB0000;
color: #EB0000;
border: 1rpx solid #ff0000;
color: #ff0000;
font-size: 24rpx;
border-radius: 8rpx;
line-height: 40rpx;

View File

@ -1,7 +1,10 @@
<view class="custom-scroll-view" wx:if="{{orderDetail.orderid}}">
<scroll-view scroll-y refresher-enabled class="main"
<scroll-view scroll-y refresher-enabled class="main" enhanced show-scrollbar="{{false}}"
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}">
<view class="order-status {{orderDetail.status}}">{{orderStatusKV[orderDetail.status]}}</view>
<view class="cancel-reason" wx:if="{{orderDetail.status==orderStatus.cancelled}}">
原因:<label class="reason">{{orderDetail.cancel_reason}}</label>
</view>
<view class="page-container sender" wx:if="{{orderDetail.deliveryman_user_id}}">
<view class="title">配送员</view>
<view class="spliter"></view>
@ -34,8 +37,8 @@
<view class="page-container package-info">
<view class="title">
<view class="left">取件信息</view>
<view class="right" wx:if="{{orderDetail.time_period_name}}">
送达时间<label class="time">{{orderDetail.time_period_name}}</label>
<view class="right">
期望送达<label class="time">{{orderDetail.delivery_time}}</label>
</view>
</view>
<block wx:if="{{orderDetail.pickup_images&&orderDetail.pickup_images.length>0}}">

View File

@ -39,6 +39,15 @@
.order-status.COMPLETED::before,.order-status.CANCELLED::before{
background-color:var(--main-font-color);
}
.cancel-reason{
background: rgba(255, 195, 0, 0.15);
border-radius: 18rpx;
padding:36rpx;
margin:20rpx;
}
.cancel-reason .reason{
font-weight: 500;
}
.page-container .spliter{
margin:24rpx 0 40rpx 0;
}

View File

@ -42,7 +42,8 @@
</navigator>
</view>
</view>
<scroll-view style="height:{{scrollViewHeight*2}}rpx;" scroll-y class="scroll-view">
<scroll-view style="height:{{scrollViewHeight*2}}rpx;" scroll-y class="scroll-view"
enhanced show-scrollbar="{{false}}">
<view class="page-container item ticket" wx:for="{{productList}}" wx:key="index">
<view class="left">
<view class="promation">

View File

@ -152,7 +152,7 @@
margin-top:40rpx;
}
.group-buy .item .money{
color:#EB0000;
color:#ff0000;
font-size: 48rpx;
}
.group-buy .item .money-disable{