界面细节

This commit is contained in:
2025-02-23 02:09:33 +08:00
parent 5cbf44429a
commit db674e4cbf
22 changed files with 232 additions and 83 deletions

View File

@ -61,7 +61,7 @@
"lazyCodeLoading": "requiredComponents",
"permission": {
"scope.userLocation": {
"desc": "将获取你的位置,用于为你提供配送服务"
"desc": "将获取你的位置,用于为你计算配送服务距离"
}
},
"requiredPrivateInfos": [

View File

@ -25,7 +25,6 @@ button .icon,button label{
}
button:not([size=mini]){
width:auto;
/* height: 108rpx; */
padding:30rpx 25rpx;
font-size: 36rpx;
}
@ -47,10 +46,7 @@ button[plain]{
border: 1rpx solid rgba(255, 195, 0, 0.5);
color: #FFC300;
}
/* button:not([plain])[type=primary]:hover{
background-color:var(--main-hover-color);
color:var(--main-font-color);
} */
button[type=default]{
color:var(--main-font-color);
font-size:32rpx;
@ -65,10 +61,7 @@ button[type=primary][plain]{
color:var(--main-color);
padding:28rpx 25rpx;
}
/* button[type=primary][plain]:hover{
border-color:var(--main-color);
color:var(--main-color);
} */
button[loading][type=primary] {
background-color:var(--main-color);
color: hsla(0,0%,100%,.6);
@ -371,4 +364,8 @@ navigator button{
.navigator-hover{
background-color: transparent;
opacity: 1;
}
list-view{
display: block;
}

View File

@ -24,10 +24,6 @@ Component({
loadAll:{
type:Boolean,
value:false
},
class:{
type:String,
value:''
}
},

View File

@ -1,5 +1,7 @@
<scroll-view scroll-y refresher-enabled bindrefresherrefresh="refreshList" refresher-triggered="{{refresherTriggered}}" style="{{heightStyle}}" bindscroll="scrolling" class="scroll-view" id="scrollView">
<slot/>
<view class="scroll-view-content">
<slot/>
</view>
<view class="load-more" wx:if="{{showLoadMore}}">
<label class="text" wx:if="{{loadAll}}">{{loadMoreText}}</label>
<label class="text" wx:else>加载中...</label>

View File

@ -0,0 +1,78 @@
// components/modalView/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
titleText:{
type:String,
value:''
},
titleTextCenter:{
type:Boolean,
value:true
},
editable:{
type:Boolean,
value:false
},
content:{
type:String,
value:''
},
contentPlaceholder:{
type:String,
value:'请输入内容'
},
isShowCancel:true,
cancelButtonText:{
type:String,
value:'取消'
},
okButtonText:{
type:String,
value:'确定'
},
show:{
type:Boolean,
value:false
}
},
/**
* 组件的初始数据
*/
data: {
dynamicsStyle:''
},
/**
* 组件的方法列表
*/
methods: {
cancelButtonTap(){
this.setData({
show:false
});
this.triggerEvent('cancel');
},
okButtonTap(){
this.setData({
show:false
});
this.triggerEvent('ok');
}
},
lifetimes:{
attached(){
const windowInfo = wx.getWindowInfo();
const viewHeight = 50+96+32+48;
this.setData({
dynamicsStyle:`top:${(windowInfo.windowHeight-viewHeight)/2}px;height:${viewHeight}px;`
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,15 @@
<page-container show="{{show}}" position="center" class="custom-modal-view"
custom-style="background-color:transparent;left:27px;width:calc(100vw - 54px);height:200px;{{dynamicsStyle}}">
<view class="modal-view-main">
<view class="title {{titleTextCenter?'center':''}}">{{titleText}}</view>
<view class="content">
<textarea class="textarea" row="3" wx:if="{{editable}}">{{content}}</textarea>
<view class="text" wx:else>{{content}}</view>
</view>
<view class="btns">
<button class="button" plain vx:if="{{isShowCancel}}" bind:tap="cancelButtonTap">{{cancelButtonText}}</button>
<button class="button" type="primary" bind:tap="okButtonTap">{{okButtonText}}</button>
</view>
</view>
</page-container>

View File

@ -0,0 +1,32 @@
.custom-modal-view{
border-radius: 20px;
}
.custom-modal-view .title{
font-size: 34rpx;
font-weight: 500;
line-height: 50rpx;
}
.custom-modal-view .title.center{
text-align: center;
}
.modal-view-main{
border-radius: 24rpx;
background-color: #fff;
padding:32rpx;
}
.custom-modal-view .textarea{
}
.modal-view-main .btns{
margin-top:32rpx;
display: flex;
gap: 18rpx;
}
.modal-view-main .btns .button{
flex:1;
font-size: 32rpx;
padding:32rpx;
line-height: 1;
font-weight: 500;
}

View File

@ -19,7 +19,9 @@ Page({
gender:'MALE',
phone:'',
community_building_id:'',
address_detail:''
address_detail:'',
isShowConfirm:false
},
validator:{
name:{required:true,message:'请输入姓名',shake:true,autoFocus:true},
@ -27,26 +29,23 @@ Page({
buildingIndex:{required:true,message:'请选择楼栋',shake:true,autoFocus:true},
address_detail:{required:true,message:'请输入详细地址',shake:true,autoFocus:true}
},
showModal(){
this.setData({
isShowConfirm:true
})
},
deleteAddress(){
wx.showModal({
title: '确定删除此地址吗',
content: '',
complete: (res) => {
if (res.confirm) {
commonApi.address.delete(this.data.addressDetail.id).then(()=>{
this.updateAddressIndex();
wx.navigateBack({
success(){
wx.showToast({
title: '删除成功',
icon:'success'
});
}
});
commonApi.address.delete(this.data.addressDetail.id).then(()=>{
this.updateAddressIndex();
wx.navigateBack({
success(){
wx.showToast({
title: '删除成功',
icon:'success'
});
}
}
})
});
});
},
/**
* 生命周期函数--监听页面加载
@ -152,6 +151,11 @@ Page({
buildingChange(event){
console.log(this.data.buildingIndex);
},
genderChange(event){
this.setData({
gender:event.detail.value
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -1,5 +1,6 @@
{
"usingComponents": {
"modal-view":"/components/modalView"
},
"navigationBarTitleText": "编辑地址"
}

View File

@ -14,7 +14,7 @@
<view class="error">{{nameMessage}}</view>
</view>
<view class="cell-ft">
<radio-group class="radio-group" model:value="{{gender}}">
<radio-group bindchange="genderChange" class="radio-group">
<label class="item">
<radio value="MALE" class="radio" checked="{{gender=='MALE'}}"></radio>
<label>先生</label>
@ -59,6 +59,9 @@
<button class="button" type="primary" bind:tap="save">
{{editType=='add'?'保存并使用':'保存'}}
</button>
<button wx:if="{{editType=='edit'}}" type="primary" plain bind:tap="deleteAddress"
<button wx:if="{{editType=='edit'}}" type="primary" plain bind:tap="showModal"
class="button">删除</button>
</view>
</view>
<modal-view titleText="确定删除此地址吗" show="{{isShowConfirm}}" bind:cancel="deleteAddress"
cancelButtonText="删除" okButtonText="再想想"></modal-view>

View File

@ -21,6 +21,7 @@ Page({
isShowOrderConfirm:false,
preOrder:{},
preOrderUnPayId:'',
manuallyChangedCommunity:false,
@ -28,7 +29,8 @@ Page({
ordering:false,
genderKV:userApi.genderKV,
navBarHeight:0
navBarHeight:0,
isShowPayModal:false
},
/**
@ -165,17 +167,9 @@ Page({
});
}).catch((data)=>{
if(data.code==400&&data.data&&data.data.orderid){
wx.showModal({
title: '你有订单未支付',
content: '',
confirmText:'去支付',
complete: (res) => {
if (res.confirm) {
wx.navigateTo({
url: `/pages/order/detail/index?id=${data.data.orderid}`,
})
}
}
this.setData({
isShowPayModal:true,
preOrderUnPayId:data.data.orderid
})
}
this.setData({
@ -192,6 +186,11 @@ Page({
}
})
},
navToUnPayOrder(){
wx.navigateTo({
url: `/pages/order/detail/index?id=${this.data.preOrderUnPayId}`,
})
},
getOrder(){
if(this.data.ordering)return;
this.setData({ordering:true});

View File

@ -1,6 +1,7 @@
{
"usingComponents": {
"nav-bar":"/components/navbar"
"nav-bar":"/components/navbar",
"modal-view":"/components/modalView"
},
"navigationStyle": "custom"
}

View File

@ -80,7 +80,7 @@
</view>
</view>
<page-container show="{{isShowOrderConfirm}}" round close-on-slide-down bind:enter="enterPageContainer" bind:leave="leavePageContainer">
<page-container show="{{isShowOrderConfirm}}" round close-on-slide-down bind:enter="enterPageContainer" bind:leave="leavePageContainer" wx:if="{{isShowOrderConfirm}}">
<view class="content pc-content">
<view class="head">
<view class="kv-item">
@ -120,4 +120,6 @@
<button class="button" type="primary" bind:tap="getOrder" loading="{{ordering}}">确认下单</button>
</view>
</page-container>
</page-container>
<modal-view titleText="你有订单未支付" okButtonText="去支付" show="{{isShowPayModal}}" wx:if="{{isShowPayModal}}" bind:ok="navToUnPayOrder"/>

View File

@ -106,7 +106,11 @@ Page({
});
});
},
sendTypeChange(event){
this.setData({
sendType:event.detail.value
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@ -39,7 +39,7 @@
</view>
<view class="page-container send-way">
<view class="title">投递方式</view>
<radio-group class="radio" model:value="{{sendType}}">
<radio-group bindchange="sendTypeChange" class="radio">
<label class="item">
<radio value="DELIVERY_TO_ROOM" checked="{{sendType=='DELIVERY_TO_ROOM'}}"/>
<label>敲门递件</label>
@ -53,6 +53,5 @@
</view>
<view class="bottom-bar-v2">
<button class="button" type="primary" bind:tap="bottomBarButtonTap">保存并使用</button>
<view class="page-dispatch"></view>
</view>
</view>

View File

@ -53,7 +53,7 @@
<image class="icon" src="/assets/icon/my/firend@2x.png"></image>
</view>
<view class="cell-bd">
<view>我的友</view>
<view>我的友</view>
</view>
<view class="cell-ft"></view>
</navigator>

View File

@ -3,9 +3,10 @@
border-radius: 18rpx;
background: linear-gradient(270deg, #FFDB00 0%, #FFC300 60%);
box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.06);
margin:20rpx;
margin:20rpx 20rpx 0 20rpx;
padding:40rpx 30rpx;
position:relative;
z-index: 11;
}
.consume .title{
font-size: 32rpx;
@ -24,7 +25,7 @@
font-size: 22rpx;
padding:0 16rpx;
}
.money-list .scroll-view-content{padding-top:20rpx;}
.money-list .item{
display: flex;
margin:20rpx;

View File

@ -69,7 +69,6 @@
bind:tap="pay">去支付</button>
<button class="button button2" plain size="mini" bind:tap="refund" loading="{{refunding}}"
wx:if="{{orderDetail.status==merchantOrderStatus.unverified}}">申请退款</button>
<view class="page-dispatch"></view>
</view>
<merchant-order id="merchantOrderComponent" bind:paySuccess="paySuccess"/>

View File

@ -15,7 +15,9 @@ Page({
scrollViewHeight:0,
refresherTriggered:true,
genderKV:userApi.genderKV
genderKV:userApi.genderKV,
cancelling:false,
isShowCancelView:false
},
/**
@ -45,24 +47,28 @@ Page({
})
})
},
cancelOrder(){
wx.showModal({
title: '你确定取消此订单吗?',
complete: (res) => {
if (res.confirm) {
userApi.order.cancel(this.data.orderDetail.orderid).then(()=>{
wx.showToast({
title: '取消成功',
})
this.getOrderDetail();
const pages = getCurrentPages();
const prePage = pages[pages.length-2];
prePage.refreshList();
});
}
}
showCancelModal(){
this.setData({
isShowCancelView:true
})
},
cancelOrder(){
this.setData({
cancelling:true
})
userApi.order.cancel(this.data.orderDetail.orderid).then(()=>{
wx.showToast({
title: '取消成功',
})
this.setData({
cancelling:false
});
this.getOrderDetail();
const pages = getCurrentPages();
const prePage = pages[pages.length-2];
prePage.refreshList();
});
},
//订单更改后上一个页面如果是订单列表,就刷新
refreshOrderList(){
const pages = getCurrentPages();

View File

@ -1,6 +1,7 @@
{
"usingComponents": {
"merchant-order":"/components/merchantOrder"
"merchant-order":"/components/merchantOrder",
"modal-view":"/components/modalView"
},
"navigationBarTitleText": "订单详情"
}

View File

@ -99,17 +99,22 @@
</scroll-view>
<view class="bottom-bar-v2">
<view class="btns">
<button class="button button1" plain size="mini" bind:tap="cancelOrder"
wx:if="{{orderDetail.status==orderStatus.created}}">取消订单</button>
<button class="button button1" plain size="mini" bind:tap="showCancelModal"
wx:if="{{orderDetail.status==orderStatus.created}}" loading="{{cancelling}}"
disabled="{{cancelling}}">取消订单</button>
<button class="pay" type="primary" wx:if="{{orderDetail.status==orderStatus.unpaid}}"
bind:tap="pay">去支付</button>
<button class="button button1" plain size="mini" bind:tap="orderAgain"
wx:if="{{orderDetail.status==orderStatus.cancelled||orderDetail.status==orderStatus.completed}}">再来一单</button>
<button class="button button2" open-type="contact" bindcontact="handleContact" plain
bind:tap="pay">去支付</button>
<block wx:else>
<button class="button button1" plain size="mini" bind:tap="orderAgain"
wx:if="{{orderDetail.status==orderStatus.cancelled||orderDetail.status==orderStatus.completed}}">再来一单</button>
<button class="button button2" open-type="contact" bindcontact="handleContact" plain
size="mini" wx:else>联系客服</button>
</block>
</view>
</view>
</view>
<merchant-order id="merchantOrderComponent" bind:paySuccess="paySuccess"/>
<merchant-order id="merchantOrderComponent" bind:paySuccess="paySuccess" wx:if="{{orderDetail.status==orderStatus.unpaid}}"/>
<modal-view titleText="你确定取消此订单吗?" show="{{isShowCancelView}}"
bind:ok="cancelOrder" wx:if="{{orderDetail.status==orderStatus.created}}"></modal-view>