一大波细节

This commit is contained in:
2025-02-22 03:14:42 +08:00
parent 964d983ccb
commit 5cbf44429a
99 changed files with 971 additions and 830 deletions

View File

@ -0,0 +1 @@
{"containers":[],"config":{}}

View File

@ -20,21 +20,13 @@ export default {
delete:(address_id)=>request.delete(`/api/address/${address_id}`)
},
building:{
list(community_id){
if(!app){
app = getApp();
}
const data = {
community_id,
user_id:app.globalData.userInfo.userid
}
return request.get('/api/community/building/list',{community_id})
}
list:(community_id)=>request.get('/api/community/building/list',{community_id})
},
station:{
list:(community_id)=>request.get('/api/station',{community_id})
},
uploadImg(file){
if(!app)app = getApp();
return new Promise((rs,rj)=>{
wx.uploadFile({
filePath: file.tempFilePath,

View File

@ -7,20 +7,26 @@ const sendRequest = (options)=>{
wx.request({
url: `${baseUrl}${options.url}`,
success:(result)=>{
//Http Request的状态
if(result.statusCode==200){
//后端的自定义状态
if(result.data.code==200){
rs(result.data.data);
}else{
wx.showToast({
icon:'error',
title: result.data.message,
});
if(!options.options.noTips){
wx.showToast({
icon:'error',
title: result.data.message,
});
}
rj(result.data);
}
}else if(result.statusCode==401){
wx.navigateTo({
url: '/pages/login/login',
})
}else{
rj(result.data);
}
},
@ -42,16 +48,16 @@ const sendRequest = (options)=>{
export default {
baseUrl:baseUrl,
get(url,data){
return sendRequest({url,method:'get',data});
get(url,data,options){
return sendRequest({url,method:'get',data,options:options||{}});
},
post(url,data){
return sendRequest({url,method:'post',data});
post(url,data,options){
return sendRequest({url,method:'post',data,options:options||{}});
},
put(url,data){
return sendRequest({url,method:'put',data});
put(url,data,options){
return sendRequest({url,method:'put',data,options:options||{}});
},
delete(url,data){
return sendRequest({url,method:'delete',data});
delete(url,data,options){
return sendRequest({url,method:'delete',data,options:options||{}});
}
}

View File

@ -35,7 +35,10 @@ export default {
DELIVERY_AT_DOORSTEP:"放在门口",
DELIVERY_TO_ROOM:"敲门递件"
},
pre:(data)=>request.post('/api/order/pre-order',data),
/**
* noTips:存在未支付的订单不需要 toast然后弹窗跳转订单详情
* */
pre:(data)=>request.post('/api/order/pre-order',data,{noTips:true}),
real:(data)=>request.post('/api/order',data),
list:(data)=>request.get('/api/order/user/list',data),
cancel:(orderid)=>request.post(`/api/order/${orderid}/user/cancel`),

70
app.js
View File

@ -3,7 +3,8 @@ import commonApi from './api/common';
let token = wx.getStorageSync('accessToken');
console.log(12);
App({
onLaunch() {
onLaunch(options) {
console.log(options);
wx.getStorage({
key:'accessToken',
success:(res)=>{
@ -12,7 +13,7 @@ App({
})
},
navToLogin(){
wx.navigateTo({
wx.reLaunch({
url: '/pages/login/login',
})
},
@ -98,6 +99,71 @@ App({
},
}
},
validateForm(rules,page){
const result = [];
for(var key in rules){
((rules[key] instanceof Array)?rules[key]:[rules[key]]).map((item)=>{
let valid = true;
let value = (page.data[key]+'').trim();
//非空
if(item.required){
if(value==''){
valid = false;
}
}else if(item.length){
//绝对长度
if(value.length!=item.length){
valid = false;
}
}else if(item.type=='phone'){
if(value.length!=11){
valid = false;
}
}else if(item.maxLength||item.minLength){
if(value.length>(item.maxLength||Infinity)||value.length<item.minLength||0){
valid = false
}
}
if(valid){
page.setData({
[`${key}Message`]:''
});
}else{
page.setData({
[`${key}Message`]:item.message
});
result.push({
[key]:item.message,autoFocus:item.autoFocus,key:key,shake:item.shake
})
}
})
}
const focusInput = result.find((item)=>item.autoFocus);
if(focusInput){
page.setData({
[`${focusInput.key}Focus`]:true
})
}
const shakeInput = result.find((item)=>item.shake);
if(shakeInput){
if(!shakeInput.animation){
shakeInput.animation = wx.createAnimation({
duration: 20,
})
}
shakeInput.animation.translateX(10).step();
shakeInput.animation.translateX(-10).step();
shakeInput.animation.translateX(10).step();
shakeInput.animation.translateX(-10).step();
shakeInput.animation.translateX(5).step();
shakeInput.animation.translateX(0).step();
// needSetData[`${key}Animation`] = item.animation.export();
page.setData({
[`${shakeInput.key}Animation`]:shakeInput.animation.export()
})
}
return result;
},
getAddressList(){
}

View File

@ -4,7 +4,6 @@
"pages/shop/index/index",
"pages/order/index/index",
"pages/my/index/index",
"pages/index/index",
"pages/login/login",
"pages/logs/logs",
"pages/help/package/index",
@ -20,9 +19,10 @@
"pages/my/coupon/index",
"pages/my/money/index",
"pages/my/firend/index",
"pages/my/setting/index",
"pages/my/setting/index/index",
"pages/shop/bill/index",
"pages/shop/bill_success/index"
"pages/shop/bill_success/index",
"pages/my/setting/name/index"
],
"window": {
"navigationBarTextStyle": "black",
@ -33,31 +33,25 @@
"color": "#222222",
"selectedColor": "#FFC300",
"backgroundColor": "#ffffff",
"borderStyle": "white",
"borderStyle": "black",
"list": [
{
"pagePath": "pages/help/index/index",
"text": "帮忙",
"iconPath": "assets/icon/tabs/tab1@3x.png",
"selectedIconPath": "assets/icon/tabs/tab1-active@3x.png"
},
{
"pagePath": "pages/shop/index/index",
"text": "省钱",
"iconPath": "assets/icon/tabs/tab2@3x.png",
"selectedIconPath": "assets/icon/tabs/tab2-active@3x.png"
"text": "蜂快",
"iconPath": "assets/icon/tabs/tab1.png",
"selectedIconPath": "assets/icon/tabs/tab1-active.png"
},
{
"pagePath": "pages/order/index/index",
"text": "订单",
"iconPath": "assets/icon/tabs/tab3@3x.png",
"selectedIconPath": "assets/icon/tabs/tab3-active@3x.png"
"iconPath": "assets/icon/tabs/tab3.png",
"selectedIconPath": "assets/icon/tabs/tab3-active.png"
},
{
"pagePath": "pages/my/index/index",
"text": "我的",
"iconPath": "assets/icon/tabs/tab4@3x.png",
"selectedIconPath": "assets/icon/tabs/tab4-active@3x.png"
"iconPath": "assets/icon/tabs/tab4.png",
"selectedIconPath": "assets/icon/tabs/tab4-active.png"
}
]
},
@ -67,8 +61,10 @@
"lazyCodeLoading": "requiredComponents",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
"desc": "将获取你的位置,用于为你提供配送服务"
}
},
"requiredPrivateInfos": ["getLocation"]
"requiredPrivateInfos": [
"getLocation"
]
}

View File

@ -1,14 +1,15 @@
@import '/assets/style/weui.wxss';
page{
font-size:32rpx;
line-height: 1;
--main-font-color:#222222;
--main-font-color:#000000;
--main-bgclolor:#F5F5F5;
--main-color:#FEC400;
--main-hover-color:#fcce39;
color:var(--main-font-color);
background-color:var(--main-bgclolor);
overflow: hidden;
min-height: 100vh;
box-sizing: border-box;
}
button{
@ -34,30 +35,40 @@ button:not([size=mini]) .icon{
button[type=primary]{
background-color:var(--main-color);
color:#222222;
color:var(--main-font-color);
}
button[type=primary]:not([disabled]).button-hover{
background-color: var(--main-hover-color);
color:var(--main-font-color);
}
button[plain]{
border: 1rpx solid rgba(255, 195, 0, 0.5);
color: #FFC300;
}
button:not([plain])[type=primary]:hover{
/* button:not([plain])[type=primary]:hover{
background-color:var(--main-hover-color);
}
color:var(--main-font-color);
} */
button[type=default]{
color: #333333;
color:var(--main-font-color);
font-size:32rpx;
line-height: 1;
}
button[type=default].button-hover{
color:#666;
}
button[type=primary][plain]{
border-color: var(--main-color);
color:var(--main-color);
padding:28rpx 25rpx;
}
button[type=primary][plain]:hover{
/* 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);
@ -84,8 +95,8 @@ radio-group label+label{
}
radio{
width: 34rpx;
height: 34rpx;
width: 17px;
height: 17px;
position: relative;
}
radio .wx-radio-input{
@ -94,7 +105,6 @@ radio .wx-radio-input{
box-sizing: border-box;
width: 100%;
height: 100%;
line-height: 20px;
position: absolute;
top: 0;left:0;
}
@ -102,16 +112,16 @@ radio .wx-radio-input.wx-radio-input-checked{
background-color:transparent;
border-color: var(--main-color);
}
radio .wx-radio-input.wx-radio-input-checked::before{
radio .wx-radio-input.wx-radio-input-checked::after{
content: '';
position: absolute;
width: 22rpx;
height:22rpx;
left:4rpx;top:4rpx;
width: 11px;
height:11px;
left:2px;top:2px;
border-radius: 50%;
background: var(--main-color);
transform: none;
-webkit-transform:none
-webkit-transform:none;
}
checkbox .wx-checkbox-input{
width: 40rpx;
@ -132,7 +142,7 @@ page-container .content{
padding:30rpx;
margin:20rpx;
}
.page-container.shadow{
.page-container.shadow,.cells.shadow{
box-shadow: 0px 6px 6px 1px rgba(0, 0, 0, 0.05);
}
@ -153,10 +163,10 @@ page-container .content{
border-color:#FFC300;
}
.spliter{
border-bottom: 1px solid rgba(153, 153, 153, 0.2);
border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
}
.spliter.dashed{
border-bottom: 1px dashed rgba(153, 153, 153, 0.2);
border-bottom: 1rpx dashed rgba(153, 153, 153, 0.2);
}
.money,.money-promation,.money-normal,.money-disable{
font-size: 36rpx;
@ -192,12 +202,14 @@ page-container .content{
}
.bottom-bar{
border-radius: 24rpx 24rpx 0 0;
padding:34rpx 40rpx;
padding:24rpx;
position:fixed;
bottom:0;
left:0;right:0;
background-color: #fff;
border-top: 0.5px solid rgba(153, 153, 153, 0.2);
padding-bottom:calc(constant(safe-area-inset-bottom) + 24rpx);
padding-bottom:calc(env(safe-area-inset-bottom) + 24rpx);
}
.custom-scroll-view{
height:100vh;
@ -209,10 +221,11 @@ page-container .content{
overflow: auto;
}
.bottom-bar-v2{
border-radius: 24rpx 24rpx 0 0;
padding:34rpx 40rpx;
padding:24rpx;
background-color: #fff;
text-align: right;
border-top: 0.5px solid rgba(153, 153, 153, 0.2);
padding-bottom:calc(constant(safe-area-inset-bottom) + 24rpx);
padding-bottom:calc(env(safe-area-inset-bottom) + 24rpx);
}
.cells{
@ -225,7 +238,6 @@ page-container .content{
display: flex;
align-items: center;
padding:0 40rpx;
min-height: 116rpx;
font-size: 30rpx;
position: relative;
}
@ -234,30 +246,50 @@ page-container .content{
}
.cells .cell::after{
content: '';
border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
border-bottom: 1.2rpx solid rgba(153, 153, 153, 0.1);
position: absolute;
bottom:0;
left:40rpx;
right:40rpx;
}
.cells .cell:last-child::after{
.cells .cell:last-child::after,.cells .cell.no-border::after{
border:0;
}
.cells .cell-hd{
margin-right:20rpx;
}
.cells .cell-hd.not-empty::before{
content: '*';
color: #EB0000
}
.cells .cell-hd .icon{
width:40rpx;height:40rpx;
vertical-align: middle;
}
.cells .cell-bd{
flex:1;
display: flex;
align-items: center;
position:relative;
min-height: 116rpx;
}
.cells .cell-ft{
.cells .cell-bd .error{
color:red;
position: absolute;
left:0;bottom:10rpx;
font-size: 24rpx;
}
.cells .cell-bd input{
height:100rpx;
}
.cells .cell-ft,.right-arrow{
position: relative;
padding-right:40rpx;
color:#999;
}
.cells .cell-ft::after{
.cells.cells-access .cell-ft,.right-arrow{
padding-right: 40rpx;
}
.cells.cells-access .cell-ft::after,.cells .cell.cell-access .cell-ft::after,.right-arrow::after{
content:" ";
width:24rpx;height:48rpx;
-webkit-mask-position:0 0;
@ -333,4 +365,10 @@ navigator button{
}
.page-dispatch{
height:40rpx;
width:100%;
}
.navigator-hover{
background-color: transparent;
opacity: 1;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

BIN
assets/icon/help/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

BIN
assets/icon/help/house.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 981 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/icon/help/images.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/icon/help/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

BIN
assets/icon/my/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
assets/icon/my/login-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 B

BIN
assets/icon/tabs/tab1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 906 B

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

View File

Before

Width:  |  Height:  |  Size: 909 B

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1019 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,148 +0,0 @@
import commonApi from '../../api/common';
const app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
saveText:{
type:String,
value:"保存"
},
deleteText:{
type:String,
value:''
},
communityId:{
type:Number,
value:null
}
},
/**
* 组件的初始数据
*/
data: {
buildingList:[],
buildingIndex:0,
communityList:[],
communityIndex:0,
currentEditAddress:{},
name:'',
gender:'',
phone:'',
community_building_id:'',
address_detail:''
},
lifetimes:{
attached(){
if(app.globalData.tempAddress){
this.setData({
currentEditAddress:app.globalData.tempAddress,
name:app.globalData.tempAddress.name,
gender:app.globalData.tempAddress.gender,
phone:app.globalData.tempAddress.phone,
community_building_id:app.globalData.tempAddress.community_building_id,
address_detail:app.globalData.tempAddress.address_detail
})
}
commonApi.community.list().then((data)=>{
let communityIndex;
this.setData({
communityList:data.items
});
data.items.map((item,index)=>{
if(item.id==this.data.currentEditAddress.id){
communityIndex = index;
}
})
//没有找到 id 就是新增,就去找默认的社区进行填充
if(communityIndex){
this.getBuildingList();
}else{
for(let [index,item] of data.items.entries()){
if(item.id==this.properties.communityId){
this.setData({
communityIndex:index
});
}
}
this.getBuildingList();
}
});
// console.log(app.globalData.tempAddress);
}
},
/**
* 组件的方法列表
*/
methods: {
save(){
this.triggerEvent('save');
let data = {
community_id:this.data.communityList[this.data.communityIndex].id,
community_building_id:this.data.buildingList[this.data.buildingIndex].id,
address_detail:this.data.address_detail,
name:this.data.name,
gender:this.data.gender,
phone:this.data.phone
}
console.log(data);
if(this.data.currentEditAddress&&this.data.currentEditAddress.id){
//编辑
data.id = this.data.currentEditAddress.id;
commonApi.address.update(data);
}else{
//新增
data.is_default = true;
commonApi.address.add(data).then((data)=>{
const pages = getCurrentPages();
const prePage = pages[pages.length-2];
prePage.changeAddress(data);
wx.navigateBack({
success(){
wx.showToast({
title: '新增成功',
icon:'success'
});
}
});
});
}
},
getBuildingList(){
const current = this.data.communityList[this.data.communityIndex];
commonApi.building.list(current.id).then((data)=>{
let buildingIndex = 0;
data.items.map((item,index)=>{
item.displayText = `${item.community_name} ${item.building_name}`;
if(item.id==this.data.currentEditAddress.id){
buildingIndex = index;
}
});
this.setData({
buildingList:data.items,
buildingIndex
})
});
},
del(){
this.triggerEvent('delete')
},
chooseCommonity(event){
this.setData({
communityIndex:event.detail.value
})
},
buildingChange(event){
const buildingIndex = event.detail.value;
this.setData({buildingIndex});
}
}
})

View File

@ -1,5 +0,0 @@
{
"component": true,
"usingComponents": {},
"styleIsolation": "shared"
}

View File

@ -1,43 +0,0 @@
<view class="page-container shadow editor">
<picker range="{{communityList}}" range-key="name" value="{{communityIndex}}" bindchange="chooseCommonity">
<view class="item">
<label class="key">绑定小区</label>
<label class="value">
{{communityList&&communityList.length>0?communityList[communityIndex].name:''}}
</label>
</view>
</picker>
<view class="item">
<label class="key">用户姓名</label>
<input class="value" placeholder="请输入用户名" model:value="{{name}}"/>
<radio-group class="radio-group" model:value="{{gender}}">
<label>
<radio value="MALE" class="radio" checked></radio>
<label>先生</label>
</label>
<label>
<radio value="FEMALE" class="radio"></radio>
<label>女士</label>
</label>
</radio-group>
</view>
<view class="item">
<label class="key">手机号码</label>
<input class="value" placeholder="请输入手机号码" model:value="{{phone}}"/>
</view>
<picker range="{{buildingList}}" range-key="displayText" bindchange="buildingChange"
value="{{buildingIndex}}">
<view class="item">
<label class="key">选择楼栋</label>
<input class="value" placeholder="请选择" disabled value="{{buildingList[buildingIndex].displayText}}" />
<image class="right-icon" src="/assets/icon/help/arrow-right@2x.png"/>
</view>
</picker>
<view class="item no-border">
<label class="key">详细地址</label>
<input class="value" placeholder="例1 单元1301" model:value="{{address_detail}}"/>
</view>
<button type="primary" bind:tap="save">{{saveText}}</button>
<button wx:if="{{deleteText}}" type="primary" plain bind:tap="del">{{deleteText}}</button>
</view>

View File

@ -1,42 +0,0 @@
.page-container.editor{
padding-top:0;
font-size: 30rpx;
}
.editor .item{
display: flex;
align-items: center;
border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
min-height: 130rpx;
}
.editor .item.no-border{
border:none;
}
.editor .item .key{
}
.editor .item .key::before{
content: '*';
color: #EB0000;
}
.editor .item label.value{
line-height: 1.5;
height: auto;
align-self: center;
}
.editor .item .value{
flex:1;
margin-left: 30rpx;
height: 100%;
padding:15rpx 0;
box-sizing: border-box;
}
.editor .item .right-icon{
width:34rpx;height:34rpx;
}
.editor .radio-group{
font-size: 24rpx;
}
.editor button+button{
margin-top:30rpx;
}

View File

@ -12,9 +12,7 @@ Component({
type:Boolean,
value:false
},
"height":{
type:Number
},
height:0,
loadMoreText:{
type:String,
value:'已经到底了'
@ -26,6 +24,10 @@ Component({
loadAll:{
type:Boolean,
value:false
},
class:{
type:String,
value:''
}
},
@ -33,14 +35,15 @@ Component({
* 组件的初始数据
*/
data: {
defaultHeight:''
heightStyle:'',
scrollHeight:0
},
lifetimes:{
attached(){
this.createSelectorQuery().select('#scrollView').boundingClientRect((res)=>{
this.data.scrollHeight = res.height;
}).exec();
const windowInfo = wx.getWindowInfo();
this.setData({
defaultHeight:`calc(100vh)`
})
}
},
/**
@ -52,10 +55,25 @@ Component({
},
scrolling(event){
//scrollTop scrollHeight
const bottomHeight = event.detail.scrollHeight-event.detail.scrollTop-this.properties.height;
const bottomHeight = event.detail.scrollHeight-event.detail.scrollTop-this.data.scrollHeight;
if(bottomHeight<100){
this.triggerEvent('loadMore');
}
}
},
observers:{
height(h){
let heightStyle = '';
if(h){
if(typeof h == 'string'){
heightStyle = `height:${h}`
}else{
heightStyle = `height:${this.properties.height*2}rpx`
}
this.setData({
heightStyle:heightStyle
})
}
}
}
})

View File

@ -1,4 +1,5 @@
{
"component": true,
"usingComponents": {}
"usingComponents": {},
"styleIsolation": "apply-shared"
}

View File

@ -1,4 +1,4 @@
<scroll-view scroll-y refresher-enabled="true" bindrefresherrefresh="refreshList" refresher-triggered="{{refresherTriggered}}" style="height:{{height*2}}rpx;" bindscroll="scrolling">
<scroll-view scroll-y refresher-enabled bindrefresherrefresh="refreshList" refresher-triggered="{{refresherTriggered}}" style="{{heightStyle}}" bindscroll="scrolling" class="scroll-view" id="scrollView">
<slot/>
<view class="load-more" wx:if="{{showLoadMore}}">
<label class="text" wx:if="{{loadAll}}">{{loadMoreText}}</label>

View File

@ -1,5 +1,8 @@
.scroll-view{
height:100%;
}
.load-more{
padding:100rpx 0;
padding:56rpx 0 80rpx 0;
text-align: center;
color: #888888;
font-size:24rpx;
@ -14,8 +17,8 @@
.load-more::before{
content: '';
position: absolute;
left:0;top:112rpx;
width:100%;height:1.5rpx;
left:0;top:68rpx;
width:100%;height:1rpx;
background-color: rgba(136, 136, 136, 0.25);
z-index: -1;
}

View File

@ -49,5 +49,8 @@ Component({
},
share(){
},
getHeight(){
return this.data.statusBarHeight + this.data.navBarHeight;
}
}
})

View File

@ -1,5 +1,5 @@
import commonApi from '../../../../api/common';
const app = getApp();
Page({
@ -21,6 +21,12 @@ Page({
community_building_id:'',
address_detail:''
},
validator:{
name:{required:true,message:'请输入姓名',shake:true,autoFocus:true},
phone:{type:'phone',message:'请输入正确的手机号',shake:true,autoFocus:true},
buildingIndex:{required:true,message:'请选择楼栋',shake:true,autoFocus:true},
address_detail:{required:true,message:'请输入详细地址',shake:true,autoFocus:true}
},
deleteAddress(){
wx.showModal({
title: '确定删除此地址吗',
@ -80,6 +86,11 @@ Page({
}
},
save(){
const valid = app.validateForm(this.validator,this);
console.log(valid);
if(valid.length!=0){
return;
}
let data = {
community_id:this.data.communityId,
community_building_id:this.data.buildingList[this.data.buildingIndex].id,

View File

@ -1,6 +1,5 @@
{
"usingComponents": {
"address-editor":"/components/address"
},
"navigationBarTitleText": "编辑地址"
}

View File

@ -1,45 +1,64 @@
<view class="page-container shadow editor">
<!-- <picker range="{{communityList}}" range-key="name" value="{{communityIndex}}" bindchange="chooseCommonity"> -->
<view class="item">
<label class="key">绑定小区</label>
<label class="value">
<view class="cells shadow editor">
<view class="cell">
<view class="cell-hd not-empty">绑定小区</view>
<view class="cell-bd">
{{communityName}}
</label>
</view>
<!-- </picker> -->
<view class="item">
<label class="key">用户姓名</label>
<view class="value">
<input class="input" placeholder="请输入用户名" model:value="{{name}}"/>
</view>
<radio-group class="radio-group" model:value="{{gender}}">
<label>
<radio value="MALE" class="radio" checked="{{gender=='MALE'}}"></radio>
<label>先生</label>
</label>
<label>
<radio value="FEMALE" class="radio" checked="{{gender=='FEMALE'}}"></radio>
<label>女士</label>
</label>
</radio-group>
</view>
<view class="item">
<label class="key">手机号码</label>
<input class="value" placeholder="请输入手机号码" model:value="{{phone}}"/>
</view>
<picker range="{{buildingList}}" range-key="building_name" bindchange="buildingChange"
model:value="{{buildingIndex}}">
<view class="item">
<label class="key">选择楼栋</label>
<input class="value" placeholder="请选择" disabled value="{{buildingList[buildingIndex].building_name}}" />
<image class="right-icon" src="/assets/icon/help/arrow-right@2x.png"/>
<view class="cell">
<view class="cell-hd not-empty">用户姓名</view>
<view class="cell-bd">
<input class="input" placeholder="请输入用户名" model:value="{{name}}"
animation="{{nameAnimation}}" focus="{{nameFocus}}"/>
<view class="error">{{nameMessage}}</view>
</view>
<view class="cell-ft">
<radio-group class="radio-group" model:value="{{gender}}">
<label class="item">
<radio value="MALE" class="radio" checked="{{gender=='MALE'}}"></radio>
<label>先生</label>
</label>
<label class="item">
<radio value="FEMALE" class="radio" checked="{{gender=='FEMALE'}}"></radio>
<label>女士</label>
</label>
</radio-group>
</view>
</picker>
<view class="item no-border">
<label class="key">详细地址</label>
<input class="value" placeholder="例1 单元1301" model:value="{{address_detail}}"/>
</view>
<button type="primary" bind:tap="save">{{editType=='add'?'保存并使用':'保存'}}</button>
<button wx:if="{{editType=='edit'}}" type="primary" plain bind:tap="deleteAddress">删除</button>
<view class="cell">
<view class="cell-hd not-empty">手机号码</view>
<view class="cell-bd">
<input class="value" placeholder="请输入手机号码" model:value="{{phone}}"
animation="{{phoneAnimation}}" focus="{{phoneFocus}}"/>
<view class="error">{{phoneMessage}}</view>
</view>
</view>
<view class="cell cell-access">
<view class="cell-hd not-empty">选择楼栋</view>
<picker class="cell-bd picker" range="{{buildingList}}" range-key="building_name" bindchange="buildingChange" model:value="{{buildingIndex}}">
<input class="value" placeholder="请选择" disabled value="{{buildingList[buildingIndex].building_name}}" animation="{{buildingIndexAnimation}}" focus="{{buildingIndexFocus}}"/>
<view class="error">{{buildingIndexMessage}}</view>
</picker>
<view class="cell-ft"></view>
</view>
<view class="cell no-border">
<view class="cell-hd not-empty">详细地址</view>
<view class="cell-bd">
<input class="value" placeholder="例1 单元1301" model:value="{{address_detail}}"
animation="{{address_detailAnimation}}" focus="{{address_detailFocus}}"/>
<view class="error">{{address_detailMessage}}</view>
</view>
</view>
<button class="button" type="primary" bind:tap="save">
{{editType=='add'?'保存并使用':'保存'}}
</button>
<button wx:if="{{editType=='edit'}}" type="primary" plain bind:tap="deleteAddress"
class="button">删除</button>
</view>

View File

@ -2,43 +2,19 @@
padding-top:0;
font-size: 30rpx;
}
.editor .item{
display: flex;
align-items: center;
border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
min-height: 130rpx;
}
.editor .item.no-border{
border:none;
}
.editor .item .key{
}
.editor .item .key::before{
content: '*';
color: #EB0000;
}
.editor .item label.value{
line-height: 1.5;
height: auto;
align-self: center;
}
.editor .item .value{
flex:1;
margin-left: 30rpx;
height: 100%;
box-sizing: border-box;
}
.editor .item .value .input{
padding:15rpx 0;
}
.editor .item .right-icon{
width:34rpx;height:34rpx;
}
.editor .radio-group{
font-size: 24rpx;
}
.editor button+button{
margin-top:30rpx;
.radio-group{
color:var(--main-font-color);
}
.radio-group .item{
padding:20rpx 0;
}
.button{
margin:30rpx!important;
}
.picker input{
width:100%;
flex: 1;
}

View File

@ -10,7 +10,8 @@ Page({
addressList:[],
communityId:null,
communityName:'',
genderKV:userApi.genderKV
genderKV:userApi.genderKV,
loading:true
},
/**
@ -34,9 +35,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
wx.showNavigationBarLoading();
commonApi.address.list(this.data.communityId).then((data)=>{
wx.hideNavigationBarLoading();
this.setData({
addressList:data
addressList:data,
loading:false
})
});
},

View File

@ -1,6 +1,5 @@
{
"usingComponents": {
"address-editor":"/components/address"
},
"navigationBarTitleText": "收件人信息"
}

View File

@ -1,8 +1,6 @@
<!-- <address-editor saveText="保存并使用" communityId="{{communityId}}"/> -->
<view class="page-container address-list">
<view class="head">常用地址</view>
<block wx:if="{{addressList.length>0}}">
<block>
<view class="item" wx:for="{{addressList}}" data-item="{{item}}" wx:key="index" bind:tap="setCurrentAddress">
<view class="text">
<view class="title">{{item.community_name}} {{item.community_building_name}} {{item.address_detail}}</view>
@ -12,7 +10,8 @@
capture-catch:tap="goToAddressEditor" data-item="{{item}}"/>
</view>
</block>
<view class="list-empty" wx:else>
<view wx:if="{{loading}}" class="loading">加载中...</view>
<view class="list-empty" wx:if="{{addressList.length==0&&!loading}}">
<view class="title">该小区暂无常用地址</view>
<view class="sub-title">使用过的地址会在这里显示</view>
</view>

View File

@ -36,3 +36,8 @@
.add-button{
margin: 40rpx 20rpx!important;
}
.loading{
padding:50rpx;
text-align: center;
color: #999999;
}

View File

@ -61,7 +61,8 @@ Page({
});
const data = {
skip:this.data.pager.limit*this.data.pager.pageIndex,
limit:this.data.pager.limit
limit:this.data.pager.limit,
status:'OPENING'
}
if(this.data.lng&&this.data.lat){
data.longitude = this.data.lng;

View File

@ -1,12 +1,11 @@
<list-view class="community-list" bind:refresh="refreshList"
bind:loadMore="loadList" height="{{scrollViewHeight}}"
refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{communityList.length!=0}}"
bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(communityList.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<view class="item {{item.id==currentCommunity.id?'current':''}}" wx:for="{{communityList}}" wx:key="index"
bind:tap="onSelectItem" data-item="{{item}}">
<view class="title">
<image class="icon" src="/assets/icon/help/house@2x.png"/>
<image class="icon" src="/assets/icon/help/house.png"/>
<label class="label">{{item.name}}</label>
</view>
<view class="sub-title">

View File

@ -1,4 +1,9 @@
.community-list{}
.community-list{
position:absolute;
left:0;top:0;
width: 100%;
height:100vh;
}
.community-list .item{
border-radius: 18rpx;
background-color: #fff;

View File

@ -27,13 +27,18 @@ Page({
preOrdering:false,
ordering:false,
genderKV:userApi.genderKV
genderKV:userApi.genderKV,
navBarHeight:0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let height = this.selectComponent("#navBar").getHeight();
this.setData({
navBarHeight:height
})
this.setData({
isLogin:!!app.globalData.accessToken
})
@ -130,6 +135,21 @@ Page({
})
},
preOrder(event){
let msg = '';
if(!(this.data.currentCommunity&&this.data.currentCommunity.id)){
msg = '选择小区';
}
if(!(this.data.currentAddress&&this.data.currentAddress.id)){
msg = '选择送达地址';
}
if(msg){
wx.showToast({
title:msg,
duration:1000,
icon:'none'
});
return;
}
if(this.data.preOrdering)return;
wx.getStorage({
key:'pre-order',
@ -143,12 +163,31 @@ Page({
preOrdering:false,
preOrder:data
});
}).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({
preOrdering:false
});
})
},
fail(){
wx.showToast({
icon:'error',
title: '请选择驿站'
icon:'none',
duration:1000,
title: '选择取件驿站'
})
}
})

View File

@ -1,6 +1,8 @@
<view>
<view class="bg"></view>
<nav-bar class="nav-bar">
<view class="bg">
<image class="image" src="/assets/icon/my/login-bg.png" style="top:{{navBarHeight}}px"/>
</view>
<nav-bar class="nav-bar" id="navBar">
<image class="logo" src="/assets/icon/navbar/lanfeng@2x.png"/>
</nav-bar>
<view class="choose-community" bind:tap="goToCommunity">
@ -9,15 +11,17 @@
currentCommunity.id?currentCommunity.name:'请选择小区'
}}
</view>
<image class="arrow" src="/assets/icon/help/arrow-down@2x.png"/>
<image class="arrow" src="/assets/icon/help/arrow-down.png"/>
</view>
<view class="address-panel">
<view class="ap-item send" bind:tap="goToAddress">
<image class="icon" src="/assets/icon/help/send@2x.png"/>
<view class="icon send">送</view>
<!-- <image class="icon" src="/assets/icon/help/send@2x.png"/> -->
<view class="text">
<block wx:if="{{currentAddress&&currentAddress.id}}">
<view class="title {{currentAddress.community_name?'bold':''}}">
{{currentAddress.community_name}}
{{currentAddress.community_building_name}}
{{currentAddress.address_detail}}
</view>
<view class="sub-title">
@ -32,13 +36,14 @@
<image class="arrow" src="/assets/icon/help/arrow-right@2x.png"/>
</view>
<view class="ap-item take" bind:tap="goToAddPackage">
<image class="icon" src="/assets/icon/help/take@2x.png"/>
<!-- <image class="icon" src="/assets/icon/help/take@2x.png"/> -->
<view class="icon get">取</view>
<view class="text" wx:if="{{package.name}}">
<view class="title {{package.name?'bold':''}}">{{package.name}}</view>
<view class="sub-title">共计 {{package.count}} 个包裹</view>
</view>
<view class="text" wx:else>
<view class="title">选择驿站</view>
<view class="title">选择取件驿站</view>
<view class="sub-title"></view>
</view>
<image class="arrow" src="/assets/icon/help/arrow-right@2x.png"/>
@ -54,7 +59,7 @@
</view>
<view class="item">
<image class="icon" src="/assets/icon/help/icon3.png"/>
<view class="text">蜂蜜抵扣</view>
<view class="text">安全保障</view>
</view>
</view>
</view>
@ -113,6 +118,6 @@
</view>
<view class="tips">{{preOrder.price_detail_text}}</view>
<button class="button" type="primary" bind:tap="getOrder" loading="{{ordering}}">立即购买</button>
<button class="button" type="primary" bind:tap="getOrder" loading="{{ordering}}">确认下单</button>
</view>
</page-container>

View File

@ -5,6 +5,14 @@
position:absolute;
z-index:-1;
}
.bg .image{
width: 396rpx;
height:140rpx;
position: absolute;
right:20rpx;
top:260rpx;
padding-top:90rpx;
}
.nav-bar .logo{
width:168rpx;
height:42rpx;
@ -42,7 +50,19 @@
}
.address-panel .ap-item .icon{
width:40rpx;height:40rpx;
margin-top:4rpx
margin-top:4rpx;
color:#fff;
border-radius: 50%;
font-size: 24rpx;
font-weight: 500;
text-align: center;
line-height: 40rpx;
}
.address-panel .ap-item .icon.send{
background-color: #000000;
}
.address-panel .ap-item .icon.get{
background-color: var(--main-color);
}
.address-panel .ap-item .text{
flex:1;
@ -56,7 +76,7 @@
font-weight: 500;
}
.address-panel .ap-item .text .sub-title{
color:#7C8695;
color: #999999;
font-size: 28rpx;
margin-top:22rpx;
min-height: 28rpx;
@ -82,7 +102,7 @@
vertical-align: middle;
}
.address-panel .bottom .text{
color: #7C8695;
color: #999999;
font-size: 24rpx;
margin-left: 8rpx;
display: inline-block;
@ -114,7 +134,7 @@
.promotion-panel .text .sub-title{
font-size: 28rpx;
color: #7C8695;
color: #999999;
margin-top:26rpx;
}
.promotion-panel .button{

View File

@ -13,18 +13,16 @@ Page({
bottomBarButtonTap(){
const data = [];
let hasPackage = false;
this.data.stationList.map((item)=>{
if(item.package.length>0&&item.package[0]!=''){
hasPackage = true;
data.push({
station_id:item.id,
station_name:item.name,
pickup_codes:item.package.filter((item)=>item!='').join(',')
});
}
data.push({
station_id:item.id,
station_name:item.name,
pickup_codes:item.package.filter((item)=>item!='').join(',')
});
})
if(hasPackage){
if(data.length>0){
wx.setStorage({
key:'pre-order',
data:{
@ -52,9 +50,13 @@ Page({
if(!this.data.stationList[index].package){
this.data.stationList[index].package = [];
}
this.data.stationList[index].package.push('');
let hasEmptyInput = this.data.stationList[index].package.find((item)=>item=='')==undefined;
if(hasEmptyInput){
this.data.stationList[index].package.push('');
}
this.data.stationList[index].focus = true;
this.setData({
stationList:this.data.stationList
[`stationList[${index}]`]:this.data.stationList[index]
});
},
deletePackage(event){
@ -62,7 +64,7 @@ Page({
const packageIndex = event.currentTarget.dataset.p_index;
this.data.stationList[itemIndex].package.splice(packageIndex,1);
this.setData({
stationList:this.data.stationList
[`stationList[${itemIndex}].package`]:this.data.stationList[itemIndex].package
})
},
setPackageCode(event){
@ -79,22 +81,29 @@ Page({
wx.getStorage({
key:'pre-order',
success:(res)=>{
data.items.map((item)=>{
data.items.map((item,index)=>{
const __item = res.data.price_request.packages.find((_item)=>_item.station_id==item.id);
item.package = __item.pickup_codes.split(',')||[''];
if(__item){
item.package = __item.pickup_codes.split(',')||[];
}
});
this.setData({
sendType:res.data.delivery_method,
stationList:data.items
})
});
}
});
data.items.map((item)=>{
item.package = [''];
item.package = [];
});
this.setData({
stationList:data.items
})
});
wx.nextTick(()=>{
this.setData({
[`stationList[0].focus`]:true
})
});
});
},

View File

@ -1,42 +1,58 @@
<view class="custom-scroll-view">
<view class="main">
<view class="page-container img-area">
<view class="head">
<view class="title">
<image class="icon" src="/assets/icon/help/images.png"/>
<view>快捷下单</view>
</view>
<view class="sub-title">
上传取件信息图片时,图片需清晰显示取件位置信息
</view>
</view>
<button class="button" type="default">点击上传取件图片</button>
</view>
<view class="page-container" wx:for="{{stationList}}" wx:key="index">
<view class="head">
<image class="icon" src="/assets/icon/help/house@2x.png"/>
<view class="text">
<view class="title">{{item.name}}</view>
<view class="sub-title">{{item.service_text}}</view>
<view class="title">
<image class="icon" src="/assets/icon/help/house.png"/>
<view>{{item.name}}</view>
</view>
<view class="sub-title">
{{item.service_text}}
</view>
</view>
<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"
data-index="{{index}}" data-p_index="{{pIndex}}"/>
<input value="{{pItem}}" class="input" bindinput="setPackageCode" cursor-spacing="136rpx"
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@2x.png"/>
<image class="icon" src="/assets/icon/help/delete.png"/>
</button>
</view>
</view>
<button type="default" class="button" bind:tap="addPackage" data-index="{{index}}">
<image src="/assets/icon/help/plus@2x.png" class="icon"/>
<image src="/assets/icon/help/plus.png" class="icon"/>
<label>添加取件码</label>
</button>
</view>
<view class="page-container">
<view class="page-container send-way">
<view class="title">投递方式</view>
<radio-group class="radio" model:value="{{sendType}}">
<label>
<radio value="DELIVERY_AT_DOORSTEP" checked="{{sendType=='DELIVERY_AT_DOORSTEP'}}"/>
<label>放在门口</label>
</label>
<label>
<label class="item">
<radio value="DELIVERY_TO_ROOM" checked="{{sendType=='DELIVERY_TO_ROOM'}}"/>
<label>敲门递件</label>
</label>
<label class="item">
<radio value="DELIVERY_AT_DOORSTEP" checked="{{sendType=='DELIVERY_AT_DOORSTEP'}}"/>
<label>放在门口</label>
</label>
</radio-group>
</view>
</view>
<view class="bottom-bar-v2">
<button class="button" type="primary" bind:tap="bottomBarButtonTap">保存并使用</button>
<view class="page-dispatch"></view>
</view>
</view>

View File

@ -2,32 +2,42 @@
}
.page-container .head{
display: flex;
padding-bottom:14rpx;
}
.page-container .head .icon{
width:40rpx;height:40rpx;
}
.page-container .head .text{
flex:1;
padding-left:10rpx;
margin-right: 20rpx;
}
.page-container .head .title{
font-size: 34rpx;
font-size: 36rpx;
font-weight: 500;
display: flex;
align-items: center;
}
.page-container .head .sub-title{
font-size:26rpx;
color: #888888;
margin-top:24rpx;
padding-left:60rpx;
}
.page-container>.button{
margin-top:20rpx;
border-radius: 12rpx;
background: rgba(124, 134, 149, 0.08);
}
.page-container .radio{
.send-way .radio{
display: flex;
justify-content: space-around;
justify-content: space-between;
padding-top:30rpx;
}
.send-way .title{
font-size: 34prx;
font-weight: 500;
}
.send-way .radio .item{
padding:14rpx 30rpx;
}
@ -66,3 +76,7 @@
.package-list .item .icon{
width:36rpx;height:36rpx;
}
.img-area.page-container .head .sub-title{
padding-left:0;
}

View File

@ -2,5 +2,5 @@
<image class="icon" src="/assets/icon/help/success@2x.png"/>
<view class="title">恭喜下单成功</view>
<view class="sub-title">{{successText}}</view>
<button class="button" type="primary" plain="true" bind:tap="navToOrderDetail">前往查看订单</button>
<button class="button" type="primary" plain bind:tap="navToOrderDetail">查看订单</button>
</view>

View File

@ -10,9 +10,9 @@ page{
margin-top:320rpx;
}
.title{
font-size: 40rpx;
font-size: 44rpx;
font-weight: 500;
color:#222222;
color:var(--main-color);
margin-top:50rpx;
}
.sub-title{
@ -21,7 +21,11 @@ page{
margin-top:40rpx;
}
.button{
border: 1.2rpx solid #999999!important;
color:var(--main-font-color)!important;
font-weight: normal;
border-radius: 60rpx;
padding:19rpx!important;
margin:90rpx!important;
margin:90rpx auto!important;
width:438rpx!important;
}

View File

@ -1,49 +0,0 @@
// index.js
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
Page({
data: {
motto: 'Hello World',
userInfo: {
avatarUrl: defaultAvatarUrl,
nickName: '',
},
hasUserInfo: false,
canIUseGetUserProfile: wx.canIUse('getUserProfile'),
canIUseNicknameComp: wx.canIUse('input.type.nickname'),
},
bindViewTap() {
wx.navigateTo({
url: '../logs/logs'
})
},
onChooseAvatar(e) {
const { avatarUrl } = e.detail
const { nickName } = this.data.userInfo
this.setData({
"userInfo.avatarUrl": avatarUrl,
hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl,
})
},
onInputChange(e) {
const nickName = e.detail.value
const { avatarUrl } = this.data.userInfo
this.setData({
"userInfo.nickName": nickName,
hasUserInfo: nickName && avatarUrl && avatarUrl !== defaultAvatarUrl,
})
},
getUserProfile(e) {
// 推荐使用wx.getUserProfile获取用户信息开发者每次通过该接口获取用户个人信息均需用户确认开发者妥善保管用户快速填写的头像昵称避免重复弹窗
wx.getUserProfile({
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserInfo: true
})
}
})
},
})

View File

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

View File

@ -1,33 +0,0 @@
<!--index.wxml-->
<scroll-view class="scrollarea" scroll-y type="list">
<view class="container">
<view class="userinfo">
<block wx:if="{{canIUseNicknameComp && !hasUserInfo}}">
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
<image class="avatar" src="{{userInfo.avatarUrl}}"></image>
</button>
<view class="nickname-wrapper">
<text class="nickname-label">昵称1</text>
<input type="nickname" class="nickname-input" placeholder="请输入昵称" bind:change="onInputChange" />
</view>
</block>
<block wx:elif="{{!hasUserInfo}}">
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
<view wx:else> 请使用2.10.4及以上版本基础库 </view>
</block>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
</view>
<view class="usermotto">
<text class="user-motto">{{motto}}</text>
</view>
</view>
<view>
<navigator>123</navigator>
<navigator>123</navigator>
<navigator>123</navigator>
</view>
</scroll-view>

View File

@ -1,62 +0,0 @@
/**index.wxss**/
page {
height: 100vh;
display: flex;
flex-direction: column;
}
.scrollarea {
flex: 1;
overflow-y: hidden;
}
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
color: #aaa;
width: 80%;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.usermotto {
margin-top: 200px;
}
.avatar-wrapper {
padding: 0;
width: 56px !important;
border-radius: 8px;
margin-top: 40px;
margin-bottom: 40px;
}
.avatar {
display: block;
width: 56px;
height: 56px;
}
.nickname-wrapper {
display: flex;
width: 100%;
padding: 16px;
box-sizing: border-box;
border-top: .5px solid rgba(0, 0, 0, 0.1);
border-bottom: .5px solid rgba(0, 0, 0, 0.1);
color: black;
}
.nickname-label {
width: 105px;
}
.nickname-input {
flex: 1;
}

View File

@ -4,27 +4,18 @@ const app = getApp();
Page({
data: {
isAgree: false,
loging:false
loging:false,
animation:null
},
handleAgreeChange(e) {
radioChange(event){
this.setData({
isAgree: e.detail.value.length > 0
isAgree:event.detail.value!=''
})
},
onLogin() {
if (!this.data.isAgree) {
wx.showToast({
title: '请先同意用户协议和隐私政策',
icon: 'none'
})
return
}
preLogin(){
this.shake();
},
getPhoneNumber(event){
console.log(event);
if(!event.detail.code){
//未接受
return;
@ -61,5 +52,22 @@ Page({
}
})
})
},
shake(){
if(!this.animation){
this.animation = wx.createAnimation({
duration: 20,
})
}
this.animation.translateX(10).step();
this.animation.translateX(-10).step();
this.animation.translateX(10).step();
this.animation.translateX(-10).step();
this.animation.translateX(5).step();
this.animation.translateX(0).step();
// needSetData[`${key}Animation`] = item.animation.export();
this.setData({
animation:this.animation.export()
})
}
})

View File

@ -2,12 +2,15 @@
<image src="/assets/imgs/login/text1.png" class="text1"/>
<image src="/assets/imgs/login/text2.png" class="text2"/>
<image src="/assets/imgs/login/main.jpg" class="main"/>
<button class="button" type="primary" loading="{{loging}}" disabled="{{!isAgree}}"
<button class="button" type="primary" wx:if="{{isAgree}}" loading="{{loging}}" disabled="{{loging}}"
open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快捷登录</button>
<button class="button" type="primary" bindtap="preLogin" wx:else>
手机号快捷登录
</button>
<view class="agree">
<radio-group bindchange="handleAgreeChange" modal:value="{{isAgree}}">
<label class="policy">
<radio class="radio" value="agree" checked="{{false}}"></radio>
<radio-group bindchange="radioChange">
<label class="policy" animation="{{animation}}">
<radio class="radio" value="agree"></radio>
<label>我已阅读并同意</label>
<label class="yellow">《用户协议》</label>与
<label class="yellow">《隐私政策》</label>

View File

@ -61,6 +61,8 @@ Page({
skip:this.data.pager[tabName].limit*this.data.pager[tabName].pageIndex,
limit:this.data.pager[tabName].limit
}).then((data)=>{
data = data.concat(data).concat(data)
if(this.data.pager[tabName].pageIndex==0){
this.data[tabName+'List'] = data;
}else{

View File

@ -10,8 +10,7 @@
</view>
</view>
<list-view class="coupon-list" wx:if="{{tabIndex==0}}"
height="{{listViewHeight}}" bind:refresh="refreshList"
<list-view class="coupon-list" wx:if="{{tabIndex==0}}" bind:refresh="refreshList"
bind:loadMore="loadMore" refresher-triggered="{{pager.tab1.refreshTrigger}}"
show-load-more="{{!(tab1List.length==0&&pager.tab1.loadAll)}}"
loading="{{pager.tab1.loading}}" load-all="{{pager.tab1.loadAll}}">
@ -20,7 +19,7 @@
<view class="name">{{item.coupon_name}}</view>
<view class="desc">有效期至 {{item.expire_time}}</view>
</view>
<view class="right money money-yellow">{{item.coupon_amount}}</view>
<view class="right money money-normal">{{item.coupon_amount}}</view>
</view>
<view class="list-empty" wx:if="{{tab1List.length==0&&pager.tab1.loadAll}}">
<image class="icon" src="/assets/icon/shop/coupon-empty@2x.png"/>
@ -29,8 +28,7 @@
</list-view>
<list-view class="coupon-list" wx:if="{{tabIndex==1}}"
height="{{listViewHeight}}" bind:refresh="refreshList"
<list-view class="coupon-list" wx:if="{{tabIndex==1}}" bind:refresh="refreshList"
bind:loadMore="loadMore" refresher-triggered="{{pager.tab2.refreshTrigger}}"
show-load-more="{{!(tab2List.length==0&&pager.tab2.loadAll)}}"
loading="{{pager.tab2.loading}}" load-all="{{pager.tab2.loadAll}}">
@ -39,7 +37,7 @@
<view class="name">{{item.coupon_name}}</view>
<view class="desc">有效期至 {{item.expire_time}}</view>
</view>
<view class="right money money-yellow">{{item.coupon_amount}}</view>
<view class="right money money-normal">{{item.coupon_amount}}</view>
</view>
<view class="list-empty" wx:if="{{tab2List.length==0&&pager.tab2.loadAll}}">
<image class="icon" src="/assets/icon/shop/coupon-empty@2x.png"/>
@ -48,8 +46,7 @@
</list-view>
<list-view class="coupon-list" wx:if="{{tabIndex==2}}"
height="{{listViewHeight}}" bind:refresh="refreshList"
<list-view class="coupon-list" wx:if="{{tabIndex==2}}" bind:refresh="refreshList"
bind:loadMore="loadMore" refresher-triggered="{{pager.tab3.refreshTrigger}}"
show-load-more="{{!(tab3List.length==0&&pager.tab3.loadAll)}}"
loading="{{pager.tab3.loading}}" load-all="{{pager.tab3.loadAll}}">
@ -58,7 +55,7 @@
<view class="name">{{item.coupon_name}}</view>
<view class="desc">有效期至 {{item.expire_time}}</view>
</view>
<view class="right money money-yellow">{{item.coupon_amount}}</view>
<view class="right money">{{item.coupon_amount}}</view>
</view>
<view class="list-empty" wx:if="{{tab3List.length==0&&pager.tab3.loadAll}}">
<image class="icon" src="/assets/icon/shop/coupon-empty@2x.png"/>

View File

@ -1,3 +1,9 @@
.coupon-list{
position: absolute;
top:114rpx;
left:0;height:calc(100vh - 114rpx);
width:100%;
}
.coupon-list .item{
display: flex;
margin:20rpx;
@ -12,13 +18,11 @@
flex:1;
}
.coupon-list .item .name{
font-size: 34rpx;
font-weight: 500;
font-size: 36rpx;
}
.coupon-list .item .desc{
font-weight: 26rpx;
color: #888888;
margin-top:40rpx;
margin-top:44rpx;
}
.coupon-list .item .money{
font-size:54rpx;

View File

@ -1,5 +1,4 @@
<list-view class="firend-list" height="{{scrollViewHeight}}"
bind:refresh="refreshList" bind:loadMore="loadList"
<list-view class="firend-list" bind:refresh="refreshList" bind:loadMore="loadList"
refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
@ -14,6 +13,7 @@
</view>
</view>
<view class="list-empty" wx:if="{{list.length==0&&pager.loadAll}}">
<image src="/assets/icon/my/friend-empty.png" class="icon"/>
<view class="sub-title">暂无邻友</view>
</view>
</list-view>

View File

@ -1,4 +1,9 @@
.firend-list{
position:absolute;
top:0;left:0;
width:100%;height:100vh;
}
.firend-list .item{
display: flex;
margin:20rpx;
@ -27,3 +32,11 @@
.firend-list .item .status{
color:var(--main-color)
}
.list-empty{
padding-top:480rpx;
}
.list-empty .sub-title{
margin-top:30rpx;
font-size: 30rpx;
}

View File

@ -3,13 +3,15 @@
bindrefresherpulling="scrollViewPulling" bindrefresherrestore="scrollViewPullingOver"
refresher-background="var(--main-color)">
<view class="user-info">
<navigator class="content" url="/pages/my/setting/index">
<image class="avatar" src="{{userInfo.optimized_avatar}}"/>
<view class="content">
<navigator url="/pages/my/setting/index/index">
<image class="avatar" src="{{userInfo.optimized_avatar||'/assets/icon/my/avatar.png'}}"/>
</navigator>
<view class="name">{{userInfo.nickname}}</view>
<view class="setting">
<navigator class="setting" url="/pages/my/setting/index/index">
<image src="/assets/icon/my/setting@2x.png" class="icon"/>
</view>
</navigator>
</navigator>
</view>
</view>
<view class="page-container property">
@ -23,17 +25,29 @@
</view>
</view>
<view class="cells">
<navigator url="" class="cell" hover-class="cell-active">
<!-- <view class="cells cells-access">
<navigator url="" class="cell invite-cell" hover-class="cell-active">
<view class="cell-hd">
<image class="icon" src="/assets/icon/my/share@2x.png"></image>
</view>
<view class="cell-bd invite-cell">
<view>邀请邻友</view>
<view class="spec">邻友下单赠送 1 张跑腿券</view>
<view class="cell-bd">
<view>
<view>邀请好友下单</view>
<view class="spec">邀请好友领券下单自己再得1张跑腿券</view>
</view>
</view>
<view class="cell-ft"></view>
</navigator>
</view> -->
<view class="invite-cell">
<view class="title">
<image class="icon" src="/assets/icon/my/share@2x.png"></image>
<view class="text">邀请好友下单</view>
<view class="right-arrow"></view>
</view>
<view class="sub-title">邀请邻友领券下单自己再得1张跑腿券</view>
</view>
<view class="cells cells-access">
<navigator url="/pages/my/firend/index" class="cell" hover-class="cell-active">
<view class="cell-hd">
<image class="icon" src="/assets/icon/my/firend@2x.png"></image>

View File

@ -10,13 +10,13 @@
.user-info .content{
display: flex;
align-items: center;
margin:218rpx 40rpx 0 46rpx;
margin:218rpx 40rpx 0 40rpx;
position: relative;
z-index: 1;
}
.user-info .content .avatar{
width:112rpx;height:112rpx;
width:120rpx;height:120rpx;
border: 2px solid #FFFFFF;
border-radius: 50%;
}
@ -27,7 +27,7 @@
margin-left:30rpx;
}
.user-info .content .setting{
background-color: #fff;
background: rgba(255, 255, 255, 0.9);
width:66rpx;height:66rpx;
border-radius: 50%;
display: flex;
@ -58,30 +58,35 @@
}
.property .item .value{
font-size:56rpx;
font-weight: bold;
font-weight: 600;
}
.invite-cell{
display:flex;
justify-content: space-between;
padding:40rpx 40rpx 36rpx 40rpx;
background-color: #fff;
margin:20rpx;
border-radius: 20rpx;
}
.invite-cell .spec{
.invite-cell .title{
display: flex;
align-items: center;
}
.invite-cell .title .text{
margin-left:20rpx;
flex:1;
}
.invite-cell .icon{
width:40rpx;height:40rpx;
}
.invite-cell .sub-title{
font-size: 26rpx;
position: relative;
color:var(--main-color);
}
.invite-cell .spec::before{
content:'';
position: absolute;
bottom: -16rpx;
background: rgba(153, 153, 153, 0.2);
width:100%;
height: 8rpx;
color: #888888;
margin-top:30rpx;
padding-left:60rpx;
}
.cell.is-button{
background-color: #fff;
font-weight: normal;
text-align: left;
}
.cell.is-button:hover{
background-color: #fff;

View File

@ -1,24 +1,25 @@
<view class="consume">
<view class="title">蜂蜜 (克)</view>
<view class="point">{{userInfo.points}}</view>
<view class="tips">取快递自动抵扣</view>
</view>
<view class="custom-scroll-view">
<view class="consume">
<view class="title">蜂蜜 (克)</view>
<view class="point">{{userInfo.points}}</view>
<view class="tips">取快递自动抵扣</view>
</view>
<list-view class="money-list" bind:refresh="refreshList"
bind:loadMore="loadList" height="{{scrollViewHeight}}"
refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<view class="item" wx:for="{{list}}" wx:key="index">
<view class="left">
<view class="name">{{item.description}}</view>
<view class="desc">{{item.create_time}}</view>
<list-view class="money-list main" bind:refresh="refreshList"
bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}"
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
<view class="item" wx:for="{{list}}" wx:key="index">
<view class="left">
<view class="name">{{item.description}}</view>
<view class="desc">{{item.create_time}}</view>
</view>
<view class="points">{{item.points}}</view>
</view>
<view class="points">{{item.points}}</view>
</view>
<view class="list-empty" wx:if="{{list.length==0&&pager.loadAll}}">
<image class="icon" src="/assets/icon/shop/point-empty@2x.png"/>
<view class="sub-title">暂无蜂蜜</view>
</view>
</list-view>
<view class="list-empty" wx:if="{{list.length==0&&pager.loadAll}}">
<image class="icon" src="/assets/icon/shop/point-empty@2x.png"/>
<view class="sub-title">暂无蜂蜜</view>
</view>
</list-view>
</view>

View File

@ -13,6 +13,7 @@
.consume .point{
font-size: 70rpx;
margin-top:40rpx;
font-weight: 600;
}
.consume .tips{
position:absolute;
@ -24,9 +25,6 @@
padding:0 16rpx;
}
.money-list{
margin-top:46rpx;
}
.money-list .item{
display: flex;
margin:20rpx;

View File

@ -1,6 +1,6 @@
const app = getApp();
import userApi from '../../../api/user';
import commonApi from '../../../api/common';
import userApi from '../../../../api/user';
import commonApi from '../../../../api/common';
Page({
@ -18,12 +18,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData({
isShowPopup:false,
name:app.globalData.userInfo.nickname,
inputName:app.globalData.userInfo.nickname,
avatar:app.globalData.userInfo.avatar
})
},
saveName(){
this.saveUser();
@ -54,9 +48,17 @@ Page({
count:1,
mediaType:'image',
success:(res)=>{
commonApi.uploadImg(res.tempFiles[0]).then((data)=>{
this.saveUser(data.url);
});
console.log(res);
wx.cropImage({
cropScale: '1:1',
src: res.tempFiles[0].tempFilePath,
success:(_res)=>{
commonApi.uploadImg(_res).then((data)=>{
this.saveUser(data.url);
});
}
})
return;
}
});
},
@ -65,6 +67,16 @@ Page({
isShowPopup:true
});
},
logout(){
wx.removeStorage({
key: 'accessToken',
success(){
wx.reLaunch({
url: '/pages/login/login',
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
@ -76,7 +88,12 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
isShowPopup:false,
name:app.globalData.userInfo.nickname,
inputName:app.globalData.userInfo.nickname,
avatar:app.globalData.userInfo.avatar
})
},
/**

View File

@ -1,17 +1,19 @@
<view class="cells">
<view class="cells cells-access">
<view class="cell" bind:tap="chooseImage">
<view class="cell-bd">修改头像</view>
<view class="cell-ft">
<image src="{{avatar}}" class="avatar"/>
</view>
</view>
<view class="cell" bind:tap="modifyName">
<navigator url="/pages/my/setting/name/index" class="cell">
<view class="cell-bd">修改昵称</view>
<view class="cell-ft">{{name}}</view>
</view>
<view class="cell-ft">
<view class="text">{{name}}</view>
</view>
</navigator>
</view>
<view class="cells">
<view class="cells cells-access">
<view class="cell">
<view class="cell-bd">隐私政策</view>
<view class="cell-ft"></view>
@ -21,6 +23,7 @@
<view class="cell-ft"></view>
</view>
</view>
<button type="default" class="logout-btn" bind:tap="logout">退出登录</button>
<page-container show="{{isShowPopup}}" close-on-slide-down>
<view class="content">

View File

@ -18,3 +18,16 @@
line-height: 88rpx;
flex: 1;
}
.cells .cell-ft .text{
color:var(--main-font-color);
}
.logout-btn{
margin:40rpx 20rpx 20rpx!important;
padding:38rpx 0!important;
line-height: 1;
background-color: rgba(153, 153, 153, 0.15)!important;
font-size: 32rpx;
font-weight: normal;
color: #666666!important;
}

View File

@ -0,0 +1,95 @@
import userApi from '../../../../api/user';
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
name:'',
userInfo:{},
loading:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
app.getUserInfo().then((data)=>{
this.setData({
userInfo:data,
name:data.nickname
})
})
},
save(){
if(this.data.name==this.data.userInfo.nickname||this.data.name==''){
return;
}
if(this.data.loading)return;
this.setData({
loading:true
})
userApi.updateUser({nickname:this.data.name}).then((data)=>{
return app.forceGetUserInfo();
}).then((data)=>{
console.log(app.globalData.userInfo);
wx.navigateBack({
success(){
wx.showToast({
title: '更新成功',
});
}
});
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "修改昵称"
}

View File

@ -0,0 +1,5 @@
<view class="page-container">
<input class="input" placeholder="请输入昵称" model:value="{{name}}"/>
</view>
<button loading="{{loading}}" type="primary" bind:tap="save" class="save-btn" disabled="{{name==userInfo.nickname||name==''}}">保存并使用</button>

View File

@ -0,0 +1,14 @@
.page-container{
height:160rpx;
display: flex;
align-items: center;
padding:0 40rpx;
}
.page-container .input{
height:100rpx;
flex: 1;
font-size: 36rpx;
}
.save-btn{
margin:40rpx 20rpx!important;
}

View File

@ -14,7 +14,8 @@ Page({
scrollViewHeight:0,
refresherTriggered:true
refresherTriggered:true,
genderKV:userApi.genderKV
},
/**
@ -49,19 +50,38 @@ Page({
title: '你确定取消此订单吗?',
complete: (res) => {
if (res.confirm) {
userApi.order.cancel(this.data.orderDetail.order.orderid).then(()=>{
this.getOrderDetail(this.data.orderDetail.order.orderid);
userApi.order.cancel(this.data.orderDetail.orderid).then(()=>{
wx.showToast({
title: '取消成功',
})
this.getOrderDetail();
const pages = getCurrentPages();
const prePage = pages[pages.length-2];
prePage.loadOrderList();
prePage.refreshList();
});
}
}
})
},
//订单更改后上一个页面如果是订单列表,就刷新
refreshOrderList(){
const pages = getCurrentPages();
const prePage = pages[pages.length-2];
if(prePage&&prePage.refreshList){
prePage.refreshList();
}
},
pay(){
const merchantPay = this.selectComponent('#merchantOrderComponent');
merchantPay.createPayment(this.data.orderDetail.orderid,true);
},
paySuccess(){
this.refreshOrderList();
this.getOrderDetail();
},
copyOrderId(){
wx.setClipboardData({
data: this.data.orderDetail.order.orderid,
data: this.data.orderDetail.orderid,
})
},
handleContact(e){
@ -71,7 +91,19 @@ Page({
},
makePhoneCall(){
wx.makePhoneCall({
phoneNumber: this.data.orderDetail.order.deliveryman_phone,
phoneNumber: this.data.orderDetail.deliveryman_phone,
})
},
preview(event){
const current = event.currentTarget.dataset.url;
wx.previewImage({
current:current,
urls: this.data.orderDetail.complete_images,
})
},
orderAgain(){
wx.switchTab({
url: '/pages/help/index/index',
})
},
/**

View File

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

View File

@ -1,86 +1,115 @@
<scroll-view scroll-y style="height:{{scrollViewHeight*2}}rpx" refresher-enabled
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}">
<view class="order-status {{orderDetail.order.status}}">{{orderStatusKV[orderDetail.order.status]}}</view>
<view class="page-container sender" wx:if="{{orderDetail.order.deliveryman_user_id}}">
<view class="title">跑腿员</view>
<view class="spliter"></view>
<view class="info">
<image class="avatar" src="{{orderDetail.order.deliveryman_avatar}}"/>
<view class="center">
<view class="name">{{orderDetail.order.deliveryman_nickname}}</view>
<view class="desc">已安全送达{{orderDetail.order.delivery_count}}件</view>
</view>
<button class="button" plain size="mini" bind:tap="makePhoneCall">
<image class="icon" src="/assets/icon/shop/phone@2x.png"/>
<label>联系他</label>
</button>
</view>
</view>
<view class="page-container address">
<view class="title">送货地址</view>
<view class="spliter"></view>
<view class="text">{{orderDetail.order.community_name}}{{orderDetail.order.address_detail}}</view>
<view class="user">{{orderDetail.order.address_name}} {{orderDetail.order.address_phone}}</view>
</view>
<view class="page-container package-info">
<view class="title">
<view class="left">取件信息</view>
<view class="right" wx:if="{{orderDetail.order.deliveryman_user_id}}">
<label>送达时间</label>
<label class="time">18:0021:00</label>
</view>
</view>
<block wx:for="{{orderDetail.packages}}" wx:key="index">
<view class="custom-scroll-view" wx:if="{{orderDetail.orderid}}">
<scroll-view scroll-y refresher-enabled class="main"
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}">
<view class="order-status {{orderDetail.status}}">{{orderStatusKV[orderDetail.status]}}</view>
<view class="page-container sender" wx:if="{{orderDetail.deliveryman_user_id}}">
<view class="title">配送员</view>
<view class="spliter"></view>
<view class="package">
<view class="p-title">{{item.station_name}} 共{{item.pickup_codes.length}}件包裹</view>
<view class="code-list">
<view class="item" wx:for="{{item.pickup_codes}}"
wx:for-item="package" wx:for-index="pIndex" wx:key="pIndex">{{package}}</view>
<view class="info">
<image class="avatar" src="{{orderDetail.deliveryman_avatar}}"/>
<view class="center">
<view class="name">{{orderDetail.deliveryman_nickname}}</view>
<view class="desc">已安全送达{{orderDetail.delivery_count}}件</view>
</view>
<button class="button" plain size="mini" bind:tap="makePhoneCall">
<image class="icon" src="/assets/icon/shop/phone@2x.png"/>
<label>联系他</label>
</button>
</view>
</view>
<view class="page-container address">
<view class="title">送货地址</view>
<view class="spliter"></view>
<view class="text">
{{orderDetail.community_name}}
{{orderDetail.building_name}}
{{orderDetail.address_detail}}
</view>
<view class="user">
{{orderDetail.address_name}}
{{genderKV[orderDetail.address_gender]}}
{{orderDetail.address_phone}}
</view>
</view>
<view class="page-container package-info">
<view class="title">
<view class="left">取件信息</view>
<view class="right" wx:if="{{orderDetail.deliveryman_user_id}}">
<label>送达时间</label>
<label class="time">18:0021:00</label>
</view>
</view>
</block>
</view>
<view class="page-container send-way">
<view class="title">
<view class="left">送达方式</view>
<view class="right">{{orderDeliverStatusKV[orderDetail.order.delivery_method]}}</view>
<block wx:for="{{orderDetail.packages}}" wx:key="index">
<view class="spliter"></view>
<view class="package">
<view class="p-title">{{item.station_name}} 共{{item.pickup_codes.length}}件包裹</view>
<view class="code-list">
<view class="item" wx:for="{{item.pickup_codes}}"
wx:for-item="package" wx:for-index="pIndex" wx:key="pIndex">{{package}}</view>
</view>
</view>
</block>
</view>
<view class="page-container send-way">
<view class="title">
<view class="left">送达方式</view>
<view class="right">{{orderDeliverStatusKV[orderDetail.delivery_method]}}</view>
</view>
</view>
</view>
<view class="page-container order-info">
<view class="title">订单信息</view>
<view class="spliter"></view>
<view class="kv">
<view class="key">订单编号</view>
<view class="value">{{orderDetail.order.orderid}}</view>
<view class="copy-area" bind:tap="copyOrderId">
<view class="copy">复制</view>
<view class="page-container photos" wx:if="{{orderDetail.complete_images&&orderDetail.complete_images.length>0}}">
<view class="title">
<view class="left">送达图片</view>
</view>
<view class="spliter"></view>
<view class="imgs">
<image class="image" src="{{item}}" wx:for="{{orderDetail.complete_images}}" wx:key="index" bind:tap="preview" data-url="{{item}}"/>
</view>
</view>
<view class="kv">
<view class="key">提交时间</view>
<view class="value">{{orderDetail.order.create_time}}</view>
</view>
<view class="kv">
<view class="key">取件数量</view>
<view class="value">{{orderDetail.totalPackage}}</view>
</view>
<view class="kv">
<view class="key">跑腿费用</view>
<view class="value">
<view class="money">
{{orderDetail.order.original_amount-orderDetail.order.coupon_discount_amount}}
<view class="page-container order-info">
<view class="title">订单信息</view>
<view class="spliter"></view>
<view class="kv">
<view class="key">订单编号</view>
<view class="value">{{orderDetail.orderid}}</view>
<view class="copy-area" bind:tap="copyOrderId">
<view class="copy">复制</view>
</view>
</view>
<view class="kv">
<view class="key">提交时间</view>
<view class="value">{{orderDetail.create_time}}</view>
</view>
<view class="kv">
<view class="key">取件数量</view>
<view class="value">{{orderDetail.totalPackage}}</view>
</view>
<view class="kv">
<view class="key">跑腿费用</view>
<view class="value">
<view class="money">
{{orderDetail.original_amount-orderDetail.coupon_discount_amount}}
</view>
<view class="tag">先享后付</view>
</view>
<view class="tag">先享后付</view>
</view>
</view>
<view class="scroll-view-dispatch"></view>
</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="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
size="mini" wx:else>联系客服</button>
</view>
</view>
</scroll-view>
<view class="bottom-bar">
<button class="button button1" plain size="mini" bind:tap="cancelOrder"
wx:if="{{orderDetail.order.status==orderStatus.created}}">取消订单</button>
<!-- <button class="button button2" plain size="mini">联系客服</button> -->
<button class="button button2" open-type="contact" bindcontact="handleContact" plain size="mini">联系客服</button>
<view class="page-dispatch"></view>
</view>
<merchant-order id="merchantOrderComponent" bind:paySuccess="paySuccess"/>

View File

@ -48,6 +48,7 @@
}
.sender .info .avatar{
width:100rpx;height:100rpx;
border-radius: 50%;
}
.sender .info .center{
margin-left:24rpx;
@ -136,28 +137,45 @@
padding:0 10rpx;
margin-left: 32rpx;
}
.bottom-bar{
text-align: right;
.bottom-bar-v2{
}
.bottom-bar .button{
.bottom-bar-v2 .btns{
display: flex;
gap: 30rpx;
align-items: center;
justify-content:flex-end;
}
.bottom-bar-v2 .pay{
flex:1
}
.bottom-bar-v2 .button{
line-height: 72rpx;
padding:0 36rpx;
font-weight: normal;
border-radius: 18rpx;
margin:0;
}
.bottom-bar .button1{
.bottom-bar-v2 .button1{
color: #555555;
border: 1rpx solid rgba(153, 153, 153, 0.5);
font-size: 32rpx;
}
.bottom-bar .button2{
.bottom-bar-v2 .button2{
font-size: 32rpx;
margin-left:30rpx;
}
.patch{
padding-bottom:200rpx;
}
.send-way .left{
padding:10rpx 0;
}
.photos .spliter{
margin:24rpx 0;
}
.photos .imgs{
display: flex;
gap: 16rpx;
}
.photos .imgs .image{
width:140rpx;height:140rpx;
border-radius: 10rpx;
}

View File

@ -72,12 +72,6 @@ Page({
this.loadOrderList();
this.loadMerchantOrderList();
this.loadMerchantPayOrderList();
const windowInfo = wx.getWindowInfo();
this.setData({
scrollViewHeight:windowInfo.windowHeight-windowInfo.statusBarHeight-44-57
})
},
refreshList(){
if(this.data.tabIndex==0){
@ -229,7 +223,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**

View File

@ -4,5 +4,5 @@
"merchant-order":"/components/merchantOrder",
"list-view":"/components/listView"
},
"navigationStyle": "custom"
"navigationBarTitleText": "我的订单"
}

View File

@ -1,6 +1,6 @@
<nav-bar class="nav-bar"/>
<!-- <nav-bar class="nav-bar"/> -->
<view class="tab-bar">
<!-- <view class="tab-bar">
<view class="item-container {{tabIndex==0?'current':''}}" bind:tap="changeTab" data-index="0">
<view class="item">配送订单</view>
</view>
@ -10,15 +10,16 @@
<view class="item-container {{tabIndex==2?'current':''}}" bind:tap="changeTab" data-index="2">
<view class="item">商品订单</view>
</view>
</view>
</view> -->
<!-- <swiper style="height:{{scrollViewHeight*2}}rpx"> -->
<!-- 跑腿列表 -->
<!-- <swiper-item> -->
<list-view class="order-list" wx:if="{{tabIndex==0}}"
bind:refresh="refreshList" bind:loadMore="loadMore" height="{{scrollViewHeight}}"
bind:refresh="refreshList" bind:loadMore="loadMore"
refresher-triggered="{{refreshTriggered.tab1}}"
load-more-text="仅展示最近一年的订单" show-load-more="{{!(orderList.length==0&&pager.tab1.loadAll)}}"
show-load-more="{{!(orderList.length==0&&pager.tab1.loadAll)}}"
loading="{{pager.tab1.loading}}" load-all="{{pager.tab1.loadAll}}">
<view class="item" wx:for="{{orderList}}" wx:key="index" bind:tap="goToDetail" data-id="{{item.orderid}}">
<view class="head">

View File

@ -1,6 +1,11 @@
.nav-bar{
background-color: #fff;
}
.order-list{
position:absolute;
top:0;height:100vh;
width:100%;
}
.order-list .item{
background-color: #fff;
border-radius: 18rpx;