初步稳定版本
@ -40,7 +40,7 @@ export default {
|
||||
filePath: file.tempFilePath,
|
||||
name: 'file',
|
||||
header:{
|
||||
Authorization: `Bearer ${token}`
|
||||
Authorization: `Bearer ${token||app.globalData.accessToken}`
|
||||
},
|
||||
url: request.baseUrl+'/api/upload/image',
|
||||
success:(res)=>{
|
||||
|
||||
@ -7,10 +7,20 @@ const sendRequest = (options)=>{
|
||||
wx.request({
|
||||
url: `${baseUrl}${options.url}`,
|
||||
success:(result)=>{
|
||||
if(result.data.code==200){
|
||||
rs(result.data.data);
|
||||
}else{
|
||||
rj(result.data)
|
||||
if(result.statusCode==200){
|
||||
if(result.data.code==200){
|
||||
rs(result.data.data);
|
||||
}else{
|
||||
wx.showToast({
|
||||
icon:'error',
|
||||
title: result.data.message,
|
||||
});
|
||||
rj(result.data);
|
||||
}
|
||||
}else if(result.statusCode==401){
|
||||
wx.navigateTo({
|
||||
url: '/pages/login/login',
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ export default {
|
||||
merchantPay:(merchant_id,amount)=>request.post('/api/merchant-pay',{merchant_id,amount}),
|
||||
|
||||
merchantOrderStatusKV:{
|
||||
CREATED:'已下单',UNVERIFIED:'未核销',VERIFIED:'已核销',REFUNDING:'退款中',REFUNDED:'已退款'
|
||||
CREATED:'待支付',UNVERIFIED:'待核销',VERIFIED:'已核销',REFUNDING:'退款中',REFUNDED:'已退款'
|
||||
},
|
||||
merchantOrderStatus:{
|
||||
created:'CREATED',unverified:'UNVERIFIED',verified:'VERIFIED',refunding:'REFUNDING',refunded:'REFUNDED'
|
||||
|
||||
12
api/user.js
@ -1,6 +1,9 @@
|
||||
import request from './request';
|
||||
|
||||
export default {
|
||||
genderKV:{
|
||||
MALE:'先生',FEMALE:'女士'
|
||||
},
|
||||
getPhoneByCode(code){
|
||||
return request.post('/api/user/send-code',{})
|
||||
},
|
||||
@ -21,13 +24,17 @@ export default {
|
||||
},
|
||||
order:{
|
||||
statusKV:{
|
||||
CREATED:'已创建',CANCELLED:'已取消',RECEIVED:'已接单',
|
||||
CREATED:'待接单',CANCELLED:'已取消',RECEIVED:'已接单',
|
||||
DELIVERING:'配送中',UNPAID:'未支付',COMPLETED:'已完成'
|
||||
},
|
||||
status:{
|
||||
created:'CREATED',cancelled:'CANCELLED',received:'RECEIVED',
|
||||
delivering:'DELIVERING',unpaid:'UNPAID',completed:'COMPLETED'
|
||||
},
|
||||
orderDeliverStatusKV:{
|
||||
DELIVERY_AT_DOORSTEP:"放在门口",
|
||||
DELIVERY_TO_ROOM:"敲门递件"
|
||||
},
|
||||
pre:(data)=>request.post('/api/order/pre-order',data),
|
||||
real:(data)=>request.post('/api/order',data),
|
||||
list:(data)=>request.get('/api/order/user/list',data),
|
||||
@ -42,7 +49,8 @@ export default {
|
||||
return request.get(`/api/merchant/order/${order_id}`,data);
|
||||
},
|
||||
orderQRCode:(order_id)=>request.get(`/api/merchant/order/${order_id}/verify-qrcode`),
|
||||
detail:(orderid)=>request.get(`/api/order/${orderid}`)
|
||||
detail:(orderid)=>request.get(`/api/order/${orderid}`),
|
||||
merchantRefund:(order_id)=>request.post(`/api/merchant/order/${order_id}/refund/apply`)
|
||||
},
|
||||
coupon:{
|
||||
status:{
|
||||
|
||||
1
app.js
@ -1,6 +1,7 @@
|
||||
import userApi from './api/user';
|
||||
import commonApi from './api/common';
|
||||
let token = wx.getStorageSync('accessToken');
|
||||
console.log(12);
|
||||
App({
|
||||
onLaunch() {
|
||||
wx.getStorage({
|
||||
|
||||
16
app.json
@ -38,26 +38,26 @@
|
||||
{
|
||||
"pagePath": "pages/help/index/index",
|
||||
"text": "帮忙",
|
||||
"iconPath": "assets/icon/tabs/tab1@2x.png",
|
||||
"selectedIconPath": "assets/icon/tabs/tab1-active@2x.png"
|
||||
"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@2x.png",
|
||||
"selectedIconPath": "assets/icon/tabs/tab2-active@2x.png"
|
||||
"iconPath": "assets/icon/tabs/tab2@3x.png",
|
||||
"selectedIconPath": "assets/icon/tabs/tab2-active@3x.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/order/index/index",
|
||||
"text": "订单",
|
||||
"iconPath": "assets/icon/tabs/tab3@2x.png",
|
||||
"selectedIconPath": "assets/icon/tabs/tab3-active@2x.png"
|
||||
"iconPath": "assets/icon/tabs/tab3@3x.png",
|
||||
"selectedIconPath": "assets/icon/tabs/tab3-active@3x.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/my/index/index",
|
||||
"text": "我的",
|
||||
"iconPath": "assets/icon/tabs/tab4@2x.png",
|
||||
"selectedIconPath": "assets/icon/tabs/tab4-active@2x.png"
|
||||
"iconPath": "assets/icon/tabs/tab4@3x.png",
|
||||
"selectedIconPath": "assets/icon/tabs/tab4-active@3x.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
21
app.wxss
@ -193,13 +193,27 @@ page-container .content{
|
||||
|
||||
.bottom-bar{
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding:24rpx 24rpx 84rpx;
|
||||
padding:34rpx 40rpx;
|
||||
position:fixed;
|
||||
bottom:0;
|
||||
left:0;right:0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.custom-scroll-view{
|
||||
height:100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.custom-scroll-view .main{
|
||||
flex:1;
|
||||
overflow: auto;
|
||||
}
|
||||
.bottom-bar-v2{
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding:34rpx 40rpx;
|
||||
background-color: #fff;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.cells{
|
||||
margin:20rpx;
|
||||
@ -316,4 +330,7 @@ navigator button{
|
||||
|
||||
.scroll-view-dispatch{
|
||||
height:100rpx;
|
||||
}
|
||||
.page-dispatch{
|
||||
height:40rpx;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.1 KiB |
BIN
assets/icon/tabs/tab1-active@3x.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/icon/tabs/tab1@3x.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/icon/tabs/tab2-active@3x.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/icon/tabs/tab2@3x.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/icon/tabs/tab3-active@3x.png
Normal file
|
After Width: | Height: | Size: 906 B |
BIN
assets/icon/tabs/tab3@3x.png
Normal file
|
After Width: | Height: | Size: 909 B |
BIN
assets/icon/tabs/tab4-active@3x.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/icon/tabs/tab4@3x.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
BIN
assets/imgs/login/main.jpg
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
assets/imgs/login/text1.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
assets/imgs/login/text2.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
@ -33,35 +33,38 @@ Component({
|
||||
},
|
||||
getOrder(){
|
||||
shopApi.order(this.data.product.id).then((data)=>{
|
||||
userApi.createPayment(data.order_id,'PRODUCT').then((data)=>{
|
||||
this.triggerEvent('orderCreated');
|
||||
wx.requestPayment({
|
||||
timeStamp:data.payment_params.timeStamp,
|
||||
nonceStr:data.payment_params.nonceStr,
|
||||
package:data.payment_params.package,
|
||||
signType:data.payment_params.signType,
|
||||
paySign:data.payment_params.paySign,
|
||||
success:(res)=>{
|
||||
wx.navigateTo({
|
||||
url: '/pages/shop/success/index',
|
||||
})
|
||||
},
|
||||
fail:(res)=>{
|
||||
console.log(res);
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
isShowConfirm:false
|
||||
});
|
||||
this.triggerEvent('orderCreated');
|
||||
this.createPayment(data.order_id);
|
||||
}).catch((error)=>{
|
||||
this.setData({
|
||||
isShowConfirm:false
|
||||
})
|
||||
wx.showModal({
|
||||
title: error.message,
|
||||
showCancel:false,
|
||||
complete: (res) => {
|
||||
});
|
||||
},
|
||||
createPayment(orderId,needStay){
|
||||
userApi.createPayment(orderId,'PRODUCT').then((data)=>{
|
||||
wx.requestPayment({
|
||||
timeStamp:data.payment_params.timeStamp,
|
||||
nonceStr:data.payment_params.nonceStr,
|
||||
package:data.payment_params.package,
|
||||
signType:data.payment_params.signType,
|
||||
paySign:data.payment_params.paySign,
|
||||
success:(res)=>{
|
||||
this.triggerEvent('paySuccess');
|
||||
if(!needStay){
|
||||
wx.navigateTo({
|
||||
url: '/pages/shop/success/index',
|
||||
})
|
||||
}
|
||||
},
|
||||
fail:(res)=>{
|
||||
console.log(res);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -9,7 +9,7 @@
|
||||
<view class="promation buy">
|
||||
<view class="coupon">
|
||||
<label class="tag">[在线买单]</label>
|
||||
<label class="detail">赠送蜂蜜{{shop.pay_gift_points_rate}}%</label>
|
||||
<label class="detail">{{shop.gift_points_rate_text}}</label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="promation">
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
}
|
||||
.shop-item .logo{
|
||||
width:180rpx;height:180rpx;
|
||||
border-radius: 18rpx;
|
||||
}
|
||||
.shop-item .content{
|
||||
flex:1;
|
||||
|
||||
@ -16,7 +16,7 @@ Page({
|
||||
addressDetail:{},
|
||||
|
||||
name:'',
|
||||
gender:'',
|
||||
gender:'MALE',
|
||||
phone:'',
|
||||
community_building_id:'',
|
||||
address_detail:''
|
||||
@ -28,6 +28,7 @@ Page({
|
||||
complete: (res) => {
|
||||
if (res.confirm) {
|
||||
commonApi.address.delete(this.data.addressDetail.id).then(()=>{
|
||||
this.updateAddressIndex();
|
||||
wx.navigateBack({
|
||||
success(){
|
||||
wx.showToast({
|
||||
@ -91,6 +92,7 @@ Page({
|
||||
//编辑
|
||||
data.id = this.data.addressDetail.id;
|
||||
commonApi.address.update(data).then((data)=>{
|
||||
this.updateAddressIndex();
|
||||
wx.navigateBack({
|
||||
success(){
|
||||
wx.showToast({
|
||||
@ -102,12 +104,8 @@ Page({
|
||||
});
|
||||
}else if(this.data.editType=='add'){
|
||||
//新增
|
||||
data.is_default = true;
|
||||
|
||||
commonApi.address.add(data).then((data)=>{
|
||||
// const pages = getCurrentPages();
|
||||
// const prePage = pages[pages.length-2];
|
||||
// prePage.changeAddress(data);
|
||||
this.updateAddressIndex();
|
||||
wx.navigateBack({
|
||||
delta:2,
|
||||
success(){
|
||||
@ -120,6 +118,11 @@ Page({
|
||||
});
|
||||
}
|
||||
},
|
||||
updateAddressIndex(){
|
||||
const pages = getCurrentPages();
|
||||
const prePage = pages[pages.length-3];
|
||||
prePage.data.manuallyChangedCommunity = false;
|
||||
},
|
||||
getBuildingList(){
|
||||
commonApi.building.list(this.data.communityId).then((data)=>{
|
||||
let buildingIndex = 0;
|
||||
|
||||
@ -9,7 +9,9 @@
|
||||
<!-- </picker> -->
|
||||
<view class="item">
|
||||
<label class="key">用户姓名</label>
|
||||
<input class="value" placeholder="请输入用户名" model:value="{{name}}"/>
|
||||
<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>
|
||||
@ -26,11 +28,11 @@
|
||||
<input class="value" placeholder="请输入手机号码" model:value="{{phone}}"/>
|
||||
</view>
|
||||
|
||||
<picker range="{{buildingList}}" range-key="displayText" bindchange="buildingChange"
|
||||
<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].displayText}}" />
|
||||
<input class="value" placeholder="请选择" disabled value="{{buildingList[buildingIndex].building_name}}" />
|
||||
<image class="right-icon" src="/assets/icon/help/arrow-right@2x.png"/>
|
||||
</view>
|
||||
</picker>
|
||||
|
||||
@ -27,9 +27,11 @@
|
||||
flex:1;
|
||||
margin-left: 30rpx;
|
||||
height: 100%;
|
||||
padding:15rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.editor .item .value .input{
|
||||
padding:15rpx 0;
|
||||
}
|
||||
.editor .item .right-icon{
|
||||
width:34rpx;height:34rpx;
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import commonApi from '../../../../api/common';
|
||||
import userApi from '../../../../api/user';
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
@ -8,7 +9,8 @@ Page({
|
||||
data: {
|
||||
addressList:[],
|
||||
communityId:null,
|
||||
communityName:''
|
||||
communityName:'',
|
||||
genderKV:userApi.genderKV
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<block wx:if="{{addressList.length>0}}">
|
||||
<view class="item" wx:for="{{addressList}}" data-item="{{item}}" wx:key="index" bind:tap="setCurrentAddress">
|
||||
<view class="text">
|
||||
<view class="title">{{item.address_detail}}</view>
|
||||
<view class="sub-title">{{item.name}} {{item.phone}}</view>
|
||||
<view class="title">{{item.community_name}} {{item.community_building_name}} {{item.address_detail}}</view>
|
||||
<view class="sub-title">{{item.name}} {{genderKV[item.gender]}} {{item.phone}}</view>
|
||||
</view>
|
||||
<image class="icon" src="/assets/icon/help/edit@2x.png"
|
||||
capture-catch:tap="goToAddressEditor" data-item="{{item}}"/>
|
||||
@ -17,4 +17,4 @@
|
||||
<view class="sub-title">使用过的地址会在这里显示</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" class="add-button" bind:tap="goToAddAddress">添加</button>
|
||||
<button type="primary" class="add-button" bind:tap="goToAddAddress">添加地址</button>
|
||||
@ -2,15 +2,21 @@
|
||||
|
||||
|
||||
.address-list{
|
||||
padding-top:36rpx
|
||||
padding-top:36rpx;
|
||||
padding-bottom:20rpx;
|
||||
}
|
||||
.address-list .head{
|
||||
font-size:34rpx;
|
||||
font-weight:500;
|
||||
padding-bottom:20rpx;
|
||||
}
|
||||
.address-list .item{
|
||||
display: flex;
|
||||
margin-top:60rpx;
|
||||
padding:40rpx 0;
|
||||
border-bottom: 1.2rpx solid rgba(153, 153, 153, 0.2);
|
||||
}
|
||||
.address-list .item:last-child{
|
||||
border-bottom:0;
|
||||
}
|
||||
.address-list .item .text{
|
||||
flex:1;
|
||||
|
||||
@ -43,6 +43,14 @@ Page({
|
||||
this.loadList();
|
||||
})
|
||||
},
|
||||
refreshList(){
|
||||
this.data.pager.loadAll = false;
|
||||
this.data.pager.pageIndex = 0;
|
||||
this.setData({
|
||||
pager:this.data.pager
|
||||
});
|
||||
this.loadList();
|
||||
},
|
||||
loadList(){
|
||||
if(this.data.pager.loading||this.data.pager.loadAll){
|
||||
return;
|
||||
|
||||
@ -22,7 +22,12 @@ Page({
|
||||
isShowOrderConfirm:false,
|
||||
preOrder:{},
|
||||
|
||||
manuallyChangedCommunity:false
|
||||
manuallyChangedCommunity:false,
|
||||
|
||||
preOrdering:false,
|
||||
ordering:false,
|
||||
|
||||
genderKV:userApi.genderKV
|
||||
},
|
||||
|
||||
/**
|
||||
@ -70,6 +75,7 @@ Page({
|
||||
})
|
||||
}
|
||||
});
|
||||
console.log('manuallyChangedCommunity',this.data.manuallyChangedCommunity);
|
||||
if(!this.data.manuallyChangedCommunity){
|
||||
app.forceGetUserInfo().then((data)=>{
|
||||
if(data.default_address){
|
||||
@ -80,6 +86,10 @@ Page({
|
||||
},
|
||||
currentAddress:data.default_address
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
currentAddress:null
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -108,6 +118,9 @@ Page({
|
||||
manuallyChangedCommunity:true
|
||||
});
|
||||
this.getAddress(community.id);
|
||||
wx.removeStorage({
|
||||
key: 'pre-order',
|
||||
})
|
||||
},
|
||||
changeAddress(address){
|
||||
//手动设置地址之后,由于同时设置了默认地址,所以标记改为 false 便于找当前显示的地址
|
||||
@ -116,41 +129,64 @@ Page({
|
||||
manuallyChangedCommunity:false
|
||||
})
|
||||
},
|
||||
preOrder(){
|
||||
preOrder(event){
|
||||
if(this.data.preOrdering)return;
|
||||
wx.getStorage({
|
||||
key:'pre-order',
|
||||
success:(res)=>{
|
||||
this.setData({preOrdering:true});
|
||||
userApi.order.pre({
|
||||
packages:res.data.price_request.packages
|
||||
}).then((data)=>{
|
||||
this.setData({
|
||||
isShowOrderConfirm:true,
|
||||
preOrdering:false,
|
||||
preOrder:data
|
||||
});
|
||||
})
|
||||
},
|
||||
fail(){
|
||||
wx.showToast({
|
||||
icon:'error',
|
||||
title: '请选择驿站'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getOrder(){
|
||||
if(this.data.ordering)return;
|
||||
this.setData({ordering:true});
|
||||
wx.getStorage({
|
||||
key:'pre-order',
|
||||
success:(res)=>{
|
||||
res.data.addressid = this.data.currentAddress.id;
|
||||
userApi.order.real(res.data).then((data)=>{
|
||||
this.setData({
|
||||
isShowOrderConfirm:false
|
||||
isShowOrderConfirm:false,
|
||||
ordering:false
|
||||
});
|
||||
wx.removeStorage({
|
||||
key: 'pre-order',
|
||||
});
|
||||
wx.navigateTo({
|
||||
url: `/pages/help/success/index?id=${data.order.orderid}&success_text=${data.success_text}`,
|
||||
})
|
||||
wx.showTabBar({
|
||||
success(){
|
||||
wx.navigateTo({
|
||||
url: `/pages/help/success/index?id=${data.order.orderid}&success_text=${data.success_text}`,
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
enterPageContainer(){
|
||||
console.log('enterPageContainer');
|
||||
wx.hideTabBar();
|
||||
},
|
||||
leavePageContainer(){
|
||||
console.log('leavePageContainer');
|
||||
wx.showTabBar();
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
@ -186,9 +222,16 @@ Page({
|
||||
|
||||
},
|
||||
goToAddPackage(){
|
||||
wx.navigateTo({
|
||||
url: `/pages/help/package/index?communityId=${this.data.currentCommunity.id}`,
|
||||
})
|
||||
if(this.data.currentCommunity&&this.data.currentCommunity.id){
|
||||
wx.navigateTo({
|
||||
url: `/pages/help/package/index?communityId=${this.data.currentCommunity.id}`,
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
icon:'error',
|
||||
title: '请先选择小区',
|
||||
})
|
||||
}
|
||||
},
|
||||
goToCommunity(){
|
||||
wx.navigateTo({
|
||||
|
||||
@ -16,16 +16,17 @@
|
||||
<image class="icon" src="/assets/icon/help/send@2x.png"/>
|
||||
<view class="text">
|
||||
<block wx:if="{{currentAddress&¤tAddress.id}}">
|
||||
<view class="title">
|
||||
<view class="title {{currentAddress.community_name?'bold':''}}">
|
||||
{{currentAddress.community_name}}
|
||||
{{currentAddress.address_detail}}
|
||||
</view>
|
||||
<view class="sub-title">
|
||||
{{currentAddress.name}} {{currentAddress.phone}}
|
||||
{{currentAddress.name}} {{genderKV[currentAddress.gender]}} {{currentAddress.phone}}
|
||||
</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="title">请录入配送地址</view>
|
||||
<view class="title">送达地址</view>
|
||||
<view class="sub-title"></view>
|
||||
</block>
|
||||
</view>
|
||||
<image class="arrow" src="/assets/icon/help/arrow-right@2x.png"/>
|
||||
@ -33,15 +34,15 @@
|
||||
<view class="ap-item take" bind:tap="goToAddPackage">
|
||||
<image class="icon" src="/assets/icon/help/take@2x.png"/>
|
||||
<view class="text" wx:if="{{package.name}}">
|
||||
<view class="title">{{package.name}}</view>
|
||||
<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"/>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="bottom">
|
||||
<view class="item">
|
||||
<image class="icon" src="/assets/icon/help/icon1.png"/>
|
||||
@ -49,22 +50,22 @@
|
||||
</view>
|
||||
<view class="item">
|
||||
<image class="icon" src="/assets/icon/help/icon2.png"/>
|
||||
<view class="text">方便快捷</view>
|
||||
<view class="text">先享后付</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<image class="icon" src="/assets/icon/help/icon3.png"/>
|
||||
<view class="text">方便快捷</view>
|
||||
<view class="text">蜂蜜抵扣</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" class="order-button" bind:tap="preOrder">立即下单</button>
|
||||
<view class="login-panel" wx:if="{{!isLogin}}">
|
||||
<button type="primary" class="order-button" bind:tap="preOrder" loading="{{preOrdering}}">立即下单</button>
|
||||
<!-- <view class="login-panel" wx:if="{{!isLogin}}">
|
||||
<image class="icon" src="/assets/icon/help/redpacket@2x.png"/>
|
||||
<view class="text">登录后享跑腿服务</view>
|
||||
<navigator url="/pages/login/login">
|
||||
<button class="button" size="mini">一键登录</button>
|
||||
</navigator>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="promotion-panel" wx:if="{{false}}">
|
||||
<view class="text">
|
||||
<view class="title">您有<label class="spec">2张</label>免费跑腿券待领取</view>
|
||||
@ -74,7 +75,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<page-container show="{{isShowOrderConfirm}}" round close-on-slide-down>
|
||||
<page-container show="{{isShowOrderConfirm}}" round close-on-slide-down bind:enter="enterPageContainer" bind:leave="leavePageContainer">
|
||||
<view class="content pc-content">
|
||||
<view class="head">
|
||||
<view class="kv-item">
|
||||
@ -112,6 +113,6 @@
|
||||
</view>
|
||||
<view class="tips">{{preOrder.price_detail_text}}</view>
|
||||
|
||||
<button class="button" type="primary" bind:tap="getOrder">立即购买</button>
|
||||
<button class="button" type="primary" bind:tap="getOrder" loading="{{ordering}}">立即购买</button>
|
||||
</view>
|
||||
</page-container>
|
||||
@ -31,20 +31,18 @@
|
||||
box-shadow: 0px 4px 8px 2px rgba(0, 0, 0, 0.05);
|
||||
border-radius: 20rpx;
|
||||
margin:0 20rpx;
|
||||
padding:0 30rpx 0 48rpx;
|
||||
padding:25rpx 30rpx 0 48rpx;
|
||||
}
|
||||
|
||||
.address-panel .ap-item{
|
||||
display:flex;
|
||||
align-items: center;
|
||||
color:#222222;
|
||||
line-height: 1.7;
|
||||
padding:34rpx 0;
|
||||
padding:35rpx 0;
|
||||
}
|
||||
.address-panel .ap-item .icon{
|
||||
width:40rpx;height:40rpx;
|
||||
align-self: flex-start;
|
||||
margin-top:3px
|
||||
margin-top:4rpx
|
||||
}
|
||||
.address-panel .ap-item .text{
|
||||
flex:1;
|
||||
@ -54,18 +52,18 @@
|
||||
.address-panel .ap-item .text .title{
|
||||
line-height: 48rpx;
|
||||
}
|
||||
.address-panel .ap-item .text .title.bold{
|
||||
font-weight: 500;
|
||||
}
|
||||
.address-panel .ap-item .text .sub-title{
|
||||
color:#7C8695;
|
||||
font-size: 14px;
|
||||
font-size: 28rpx;
|
||||
margin-top:22rpx;
|
||||
min-height: 28rpx;
|
||||
}
|
||||
.address-panel .arrow{
|
||||
width: 30rpx;height:30rpx;
|
||||
}
|
||||
.address-panel .line{
|
||||
border-bottom: 0.5px dashed rgba(124, 134, 149, 0.3);
|
||||
margin-top:26rpx;
|
||||
margin-right:10rpx;
|
||||
margin-top:9rpx;
|
||||
}
|
||||
|
||||
.address-panel .bottom{
|
||||
|
||||
@ -8,30 +8,43 @@ Page({
|
||||
*/
|
||||
data: {
|
||||
stationList:[],
|
||||
sendType:''
|
||||
sendType:'DELIVERY_AT_DOORSTEP'
|
||||
},
|
||||
|
||||
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(',')
|
||||
});
|
||||
})
|
||||
wx.setStorage({
|
||||
key:'pre-order',
|
||||
data:{
|
||||
price_request:{
|
||||
packages:data
|
||||
if(hasPackage){
|
||||
wx.setStorage({
|
||||
key:'pre-order',
|
||||
data:{
|
||||
price_request:{
|
||||
packages:data
|
||||
},
|
||||
delivery_method:this.data.sendType
|
||||
},
|
||||
delivery_method:this.data.sendType
|
||||
},
|
||||
success(){
|
||||
wx.navigateBack();
|
||||
}
|
||||
})
|
||||
success(){
|
||||
wx.navigateBack();
|
||||
}
|
||||
})
|
||||
}else{
|
||||
wx.removeStorage({
|
||||
key: 'pre-order',
|
||||
success(){
|
||||
wx.navigateBack();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
addPackage(event){
|
||||
@ -68,14 +81,17 @@ Page({
|
||||
success:(res)=>{
|
||||
data.items.map((item)=>{
|
||||
const __item = res.data.price_request.packages.find((_item)=>_item.station_id==item.id);
|
||||
item.package = __item.pickup_codes.split(',');
|
||||
item.package = __item.pickup_codes.split(',')||[''];
|
||||
});
|
||||
this.setData({
|
||||
sendType:res.data.delivery_method,
|
||||
stationList:data.items
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
data.items.map((item)=>{
|
||||
item.package = [''];
|
||||
});
|
||||
this.setData({
|
||||
stationList:data.items
|
||||
})
|
||||
|
||||
@ -1,53 +1,42 @@
|
||||
<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>
|
||||
</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}}"/>
|
||||
<button class="button" bind:tap="deletePackage" data-index="{{index}}" data-p_index="{{pIndex}}">
|
||||
<image class="icon" src="/assets/icon/help/delete@2x.png"/>
|
||||
<view class="custom-scroll-view">
|
||||
<view class="main">
|
||||
<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>
|
||||
</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}}"/>
|
||||
<button class="button" bind:tap="deletePackage" data-index="{{index}}" data-p_index="{{pIndex}}">
|
||||
<image class="icon" src="/assets/icon/help/delete@2x.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"/>
|
||||
<label>添加取件码</label>
|
||||
</button>
|
||||
</view>
|
||||
<view class="page-container">
|
||||
<radio-group class="radio" model:value="{{sendType}}">
|
||||
<label>
|
||||
<radio value="DELIVERY_AT_DOORSTEP" checked="{{sendType=='DELIVERY_AT_DOORSTEP'}}"/>
|
||||
<label>放在门口</label>
|
||||
</label>
|
||||
<label>
|
||||
<radio value="DELIVERY_TO_ROOM" checked="{{sendType=='DELIVERY_TO_ROOM'}}"/>
|
||||
<label>敲门递件</label>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<button type="default" class="button" bind:tap="addPackage" data-index="{{index}}">
|
||||
<image src="/assets/icon/help/plus@2x.png" class="icon"/>
|
||||
<label>添加取件码</label>
|
||||
</button>
|
||||
</view>
|
||||
<view class="page-container">
|
||||
<radio-group class="radio" model:value="{{sendType}}">
|
||||
<label>
|
||||
<radio value="DELIVERY_AT_DOORSTEP" checked/>
|
||||
<label>敲门递件</label>
|
||||
</label>
|
||||
<label>
|
||||
<radio value="DELIVERY_TO_ROOM"/>
|
||||
<label>放在门口</label>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
|
||||
<!-- <view class="page-container">
|
||||
<view class="kv-item">
|
||||
<view class="key">取件量</view>
|
||||
<view class="value">{{preOrder.price_info.package_count}}</view>
|
||||
<view class="bottom-bar-v2">
|
||||
<button class="button" type="primary" bind:tap="bottomBarButtonTap">保存并使用</button>
|
||||
</view>
|
||||
<view class="kv-item">
|
||||
<view class="key">跑腿券</view>
|
||||
<view class="value yellow">0张</view>
|
||||
</view>
|
||||
<view class="kv-item">
|
||||
<view class="key">跑腿费</view>
|
||||
<view class="value red">¥3.5</view>
|
||||
</view>
|
||||
<view class="tips">*基础费3元 (含5件包裹) 超出部分0.5元/件</view>
|
||||
</view> -->
|
||||
|
||||
<bottomBar bind:buttonTap="bottomBarButtonTap"/>
|
||||
</view>
|
||||
@ -24,6 +24,11 @@ Page({
|
||||
|
||||
},
|
||||
getPhoneNumber(event){
|
||||
console.log(event);
|
||||
if(!event.detail.code){
|
||||
//未接受
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
loging:true
|
||||
});
|
||||
@ -31,6 +36,11 @@ Page({
|
||||
success: (res) => {
|
||||
// 实现登录逻辑
|
||||
this.sendLogin(res.code,event.detail.code);
|
||||
},
|
||||
fail:()=>{
|
||||
this.setData({
|
||||
loging:false
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#4555FF"
|
||||
"backgroundColor": "#4555FF",
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
@ -1,14 +1,17 @@
|
||||
<view class="head">
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<radio-group bindchange="handleAgreeChange">
|
||||
<label class="policy">
|
||||
<radio class="radio" value="agree" checked="{{isAgree}}"></radio>
|
||||
<label>我已阅读并同意</label>
|
||||
<label class="yellow">《用户协议》</label>与
|
||||
<label class="yellow">《隐私政策》</label>
|
||||
</label>
|
||||
</radio-group>
|
||||
<button class="button" type="primary" disabled="{{!isAgree||loging}}" loading="{{loging}}"
|
||||
open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快捷登录</button>
|
||||
<view class="login">
|
||||
<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}}"
|
||||
open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">手机号快捷登录</button>
|
||||
<view class="agree">
|
||||
<radio-group bindchange="handleAgreeChange" modal:value="{{isAgree}}">
|
||||
<label class="policy">
|
||||
<radio class="radio" value="agree" checked="{{false}}"></radio>
|
||||
<label>我已阅读并同意</label>
|
||||
<label class="yellow">《用户协议》</label>与
|
||||
<label class="yellow">《隐私政策》</label>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
@ -1,28 +1,39 @@
|
||||
.head{
|
||||
height:554rpx;
|
||||
background-color: #F4BD00;
|
||||
}
|
||||
.bottom{
|
||||
.login{
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top:530rpx;
|
||||
left:0;right:0;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding:60rpx 40rpx;
|
||||
padding-top:120rpx;
|
||||
height:100vh;
|
||||
}
|
||||
.bottom .yellow{
|
||||
.text1{
|
||||
width:590rpx;
|
||||
height:56rpx;
|
||||
}
|
||||
.text2{
|
||||
width:348rpx;
|
||||
height:40rpx;
|
||||
margin-top:40rpx;
|
||||
}
|
||||
.main{
|
||||
width:678rpx;
|
||||
height:500rpx;
|
||||
margin-top:70rpx;
|
||||
}
|
||||
.agree .yellow{
|
||||
color:#FEC400;
|
||||
margin-left:0;
|
||||
}
|
||||
.policy{
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
.policy .radio{
|
||||
margin-right:10rpx;
|
||||
}
|
||||
.button{
|
||||
margin-top:40rpx;
|
||||
margin:30rpx 64rpx 60rpx 64rpx!important;
|
||||
}
|
||||
.button[disabled]{
|
||||
background-color:#e4e4e4!important;
|
||||
color: #fff!important;
|
||||
}
|
||||
@ -6,7 +6,10 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
userInfo:{}
|
||||
userInfo:{},
|
||||
scrollViewHeight:0,
|
||||
refresherTriggered:true,
|
||||
bgHeight:'100%'
|
||||
},
|
||||
|
||||
goToCouponList(){
|
||||
@ -24,8 +27,21 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
this.setData({
|
||||
scrollViewHeight:windowInfo.windowHeight
|
||||
});
|
||||
},
|
||||
scrollViewPulling(event){
|
||||
// this.setData({
|
||||
// bgHeight:`calc(100% + ${event.detail.dy*1.5}px)`
|
||||
// });
|
||||
},
|
||||
scrollViewPullingOver(){
|
||||
// this.setData({
|
||||
// bgHeight:'100%'
|
||||
// });
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
@ -37,9 +53,13 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
app.getUserInfo().then((data)=>{
|
||||
this.getUserInfo();
|
||||
},
|
||||
getUserInfo(){
|
||||
app.forceGetUserInfo().then((data)=>{
|
||||
this.setData({
|
||||
userInfo:data
|
||||
userInfo:data,
|
||||
refresherTriggered:false
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
@ -1,51 +1,56 @@
|
||||
<view class="user-info">
|
||||
<view class="content">
|
||||
<image class="avatar" src="{{userInfo.avatar}}"/>
|
||||
<view class="name">{{userInfo.nickname}}</view>
|
||||
<navigator class="setting" url="/pages/my/setting/index">
|
||||
<image src="/assets/icon/my/setting@2x.png" class="icon"/>
|
||||
<scroll-view scroll-y style="height:{{scrollViewHeight*2}}rpx" refresher-enabled
|
||||
bindrefresherrefresh="getUserInfo" refresher-triggered="{{refresherTriggered}}"
|
||||
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="name">{{userInfo.nickname}}</view>
|
||||
<view class="setting">
|
||||
<image src="/assets/icon/my/setting@2x.png" class="icon"/>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-container property">
|
||||
<view class="item" bind:tap="goToCouponList">
|
||||
<view class="value">{{userInfo.coupon_count}}</view>
|
||||
<view class="key">跑腿券(张)</view>
|
||||
<view class="page-container property">
|
||||
<view class="item" bind:tap="goToCouponList">
|
||||
<view class="value">{{userInfo.coupon_count}}</view>
|
||||
<view class="key">跑腿券(张)</view>
|
||||
</view>
|
||||
<view class="item" bind:tap="goToMoney">
|
||||
<view class="value">{{userInfo.points}}</view>
|
||||
<view class="key">蜂蜜(克)</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" bind:tap="goToMoney">
|
||||
<view class="value">{{userInfo.points}}</view>
|
||||
<view class="key">蜂蜜(克)</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="cells">
|
||||
<navigator url="" class="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>
|
||||
<view class="cell-ft"></view>
|
||||
</navigator>
|
||||
<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>
|
||||
<view class="cell-bd">
|
||||
<view>我的邻友</view>
|
||||
</view>
|
||||
<view class="cell-ft"></view>
|
||||
</navigator>
|
||||
<button class="cell is-button" hover-class="cell-active" open-type="contact">
|
||||
<view class="cell-hd">
|
||||
<image class="icon" src="/assets/icon/my/cs@2x.png"></image>
|
||||
</view>
|
||||
<view class="cell-bd">
|
||||
<view>在线客服</view>
|
||||
</view>
|
||||
<view class="cell-ft"></view>
|
||||
</button>
|
||||
</view>
|
||||
<view class="cells">
|
||||
<navigator url="" class="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>
|
||||
<view class="cell-ft"></view>
|
||||
</navigator>
|
||||
<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>
|
||||
<view class="cell-bd">
|
||||
<view>我的邻友</view>
|
||||
</view>
|
||||
<view class="cell-ft"></view>
|
||||
</navigator>
|
||||
<button class="cell is-button" hover-class="cell-active" open-type="contact">
|
||||
<view class="cell-hd">
|
||||
<image class="icon" src="/assets/icon/my/cs@2x.png"></image>
|
||||
</view>
|
||||
<view class="cell-bd">
|
||||
<view>在线客服</view>
|
||||
</view>
|
||||
<view class="cell-ft"></view>
|
||||
</button>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@ -1,8 +1,10 @@
|
||||
.user-info{
|
||||
height:460rpx;
|
||||
background: linear-gradient(298deg, #FFC300 9%, #FFD95D 97%);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
background-color: var(--main-color);
|
||||
border-radius: 0 0 20rpx 20rpx;
|
||||
border-radius: 0 0 20rpx 20rpx;
|
||||
}
|
||||
.user-info .content{
|
||||
@ -10,6 +12,7 @@
|
||||
align-items: center;
|
||||
margin:218rpx 40rpx 0 46rpx;
|
||||
position: relative;
|
||||
|
||||
z-index: 1;
|
||||
}
|
||||
.user-info .content .avatar{
|
||||
@ -55,6 +58,7 @@
|
||||
}
|
||||
.property .item .value{
|
||||
font-size:56rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.invite-cell{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<view class="consume">
|
||||
<view class="title">蜂蜜 (克)</view>
|
||||
<view class="point">{{userInfo.points}}</view>
|
||||
<view class="tips">取包裹自动抵扣</view>
|
||||
<view class="tips">取快递自动抵扣</view>
|
||||
</view>
|
||||
|
||||
<list-view class="money-list" bind:refresh="refreshList"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
.consume{
|
||||
border-radius: 18rpx;
|
||||
background: linear-gradient(270deg, #FFDB00 0%, #FFC300 60%);
|
||||
box-shadow: 0 10rpx 10rpx 0 rgba(54, 98, 236, 0.2);
|
||||
box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.06);
|
||||
margin:20rpx;
|
||||
padding:40rpx 30rpx;
|
||||
position:relative;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import userApi from '../../../api/user';
|
||||
import shopApi from '../../../api/shop';
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
@ -7,13 +8,22 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
orderId:'',
|
||||
orderDetail:{},
|
||||
qrcodeUrl:''
|
||||
qrcodeUrl:'',
|
||||
lng:0,
|
||||
lat:0,
|
||||
merchantOrderStatus:shopApi.merchantOrderStatus,
|
||||
merchantOrderStatusKV:shopApi.merchantOrderStatusKV,
|
||||
refunding:false,
|
||||
|
||||
scrollViewHeight:0,
|
||||
refresherTriggered:true
|
||||
},
|
||||
|
||||
goToSuccess(){
|
||||
wx.navigateTo({
|
||||
url: '/pages/order/success/index',
|
||||
url: `/pages/order/success/index?name=${this.data.orderDetail.product_name}&price=${this.data.orderDetail.order_amount}`,
|
||||
})
|
||||
},
|
||||
makePhoneCall(){
|
||||
@ -31,19 +41,44 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.data.orderId = options.id;
|
||||
this.setScrollViewHieght();
|
||||
app.getLocation().then((data)=>{
|
||||
this.getOrderDetail(options.id,data.longitude,data.latitude);
|
||||
this.setData({
|
||||
lng:data.longitude,
|
||||
lat:data.latitude,
|
||||
});
|
||||
this.getOrderDetail();
|
||||
}).catch(()=>{
|
||||
this.getOrderDetail(options.id);
|
||||
this.getOrderDetail();
|
||||
});
|
||||
userApi.order.orderQRCode(options.id).then((data)=>{
|
||||
},
|
||||
setScrollViewHieght(){
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
let height = windowInfo.windowHeight;
|
||||
console.log(this.data.orderDetail.status==this.data.merchantOrderStatus.created,
|
||||
this.data.orderDetail.status==this.data.merchantOrderStatus.unverified);
|
||||
if(this.data.orderDetail&&this.data.orderDetail.id){
|
||||
if(this.data.orderDetail.status==this.data.merchantOrderStatus.created||
|
||||
this.data.orderDetail.status==this.data.merchantOrderStatus.unverified){
|
||||
height = height - 94;
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
scrollViewHeight:height
|
||||
});
|
||||
},
|
||||
getQRCode(){
|
||||
userApi.order.orderQRCode(this.data.orderId).then((data)=>{
|
||||
this.setData({
|
||||
qrcodeUrl:data.qrcode_url
|
||||
})
|
||||
});
|
||||
},
|
||||
getOrderDetail(id,lng,lat){
|
||||
userApi.order.merchantDetail(id,lng,lat).then((data)=>{
|
||||
getOrderDetail(){
|
||||
wx.showNavigationBarLoading();
|
||||
userApi.order.merchantDetail(this.data.orderId,this.data.lng,this.data.lat).then((data)=>{
|
||||
wx.hideNavigationBarLoading();
|
||||
if(data.distance){
|
||||
if(data.distance>=1000){
|
||||
data.distance = parseFloat(data.distance/1000).toFixed(1)+'km';
|
||||
@ -55,10 +90,61 @@ Page({
|
||||
data.product_tags = data.product_tags.split(',');
|
||||
}
|
||||
this.setData({
|
||||
orderDetail:data
|
||||
})
|
||||
orderDetail:data,
|
||||
refresherTriggered:false
|
||||
});
|
||||
if(data.status==this.data.merchantOrderStatus.unverified){
|
||||
this.getQRCode();
|
||||
}else{
|
||||
this.setData({
|
||||
qrcodeUrl:''
|
||||
})
|
||||
}
|
||||
this.setScrollViewHieght();
|
||||
});
|
||||
},
|
||||
refund(){
|
||||
if(this.data.refunding)return;
|
||||
this.setData({
|
||||
refunding:true
|
||||
});
|
||||
wx.showModal({
|
||||
title: '是否确认申请退款',
|
||||
content: '',
|
||||
complete: (res) => {
|
||||
if (res.confirm) {
|
||||
userApi.order.merchantRefund(this.data.orderDetail.order_id).then(()=>{
|
||||
this.getOrderDetail();
|
||||
this.setData({
|
||||
refunding:false
|
||||
});
|
||||
wx.showToast({
|
||||
icon:'success',
|
||||
title: '申请成功',
|
||||
});
|
||||
this.refreshOrderList();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//状态更改后上一个页面如果是订单列表,就刷新
|
||||
refreshOrderList(){
|
||||
const pages = getCurrentPages();
|
||||
const prePage = pages[pages.length-2];
|
||||
console.log(prePage,prePage.refreshList);
|
||||
if(prePage&&prePage.refreshList){
|
||||
prePage.refreshList();
|
||||
}
|
||||
},
|
||||
pay(){
|
||||
const merchantPay = this.selectComponent('#merchantOrderComponent');
|
||||
merchantPay.createPayment(this.data.orderDetail.order_id,true);
|
||||
},
|
||||
paySuccess(){
|
||||
this.getOrderDetail();
|
||||
this.refreshOrderList();
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"usingComponents": {
|
||||
"merchant-order":"/components/merchantOrder"
|
||||
},
|
||||
"navigationBarTitleText": "到店出示二维码"
|
||||
}
|
||||
@ -1,65 +1,75 @@
|
||||
<view class="page-container prd-info">
|
||||
<view class="head">
|
||||
<view class="center">
|
||||
<view class="name">{{orderDetail.product_name}}</view>
|
||||
<view class="tags">
|
||||
<view class="tag" wx:for="{{orderDetail.product_tags}}" wx:key="index">{{item}}</view>
|
||||
<scroll-view scroll-y style="height:{{scrollViewHeight*2}}rpx" refresher-enabled
|
||||
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}">
|
||||
<view class="page-container prd-info">
|
||||
<view class="head">
|
||||
<view class="center">
|
||||
<view class="name">{{orderDetail.product_name}}</view>
|
||||
<view class="tags">
|
||||
<view class="tag" wx:for="{{orderDetail.product_tags}}" wx:key="index">{{item}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money money-normal">{{orderDetail.order_amount}}</view>
|
||||
</view>
|
||||
<block wx:if="{{qrcodeUrl}}">
|
||||
<view class="qrcode" bind:tap="goToSuccess">
|
||||
<image src="{{qrcodeUrl}}" class="image"/>
|
||||
</view>
|
||||
<view class="code-tips">到店请出示二维码核销</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<view class="page-container address">
|
||||
<view class="left">
|
||||
<view class="text1">{{orderDetail.merchant_name}}</view>
|
||||
<view class="text2">距离{{orderDetail.distance}}</view>
|
||||
</view>
|
||||
<view class="right location">
|
||||
<view class="icon-con">
|
||||
<image class="icon" src="/assets/icon/shop/location@2x.png"/>
|
||||
</view>
|
||||
<view class="text">导航</view>
|
||||
</view>
|
||||
<view class="right phone" bind:tap="makePhoneCall">
|
||||
<view class="icon-con">
|
||||
<image class="icon" src="/assets/icon/shop/phone@2x.png"/>
|
||||
</view>
|
||||
<view class="text">电话</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_id}}</view>
|
||||
<view class="copy-area" bind:tap="copyOrderId">
|
||||
<view class="copy">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money money-normal">{{orderDetail.order_amount}}</view>
|
||||
</view>
|
||||
<view class="spliter dashed"></view>
|
||||
<view class="qrcode" bind:tap="goToSuccess">
|
||||
<image src="{{qrcodeUrl}}" class="image"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-container address">
|
||||
<view class="left">
|
||||
<view class="text1">{{orderDetail.merchant_name}}</view>
|
||||
<view class="text2">距离{{orderDetail.distance}}</view>
|
||||
</view>
|
||||
<view class="right location">
|
||||
<view class="icon-con">
|
||||
<image class="icon" src="/assets/icon/shop/location@2x.png"/>
|
||||
<view class="kv">
|
||||
<view class="key">订单状态</view>
|
||||
<view class="value">{{merchantOrderStatusKV[orderDetail.status]}}</view>
|
||||
</view>
|
||||
<view class="text">导航</view>
|
||||
</view>
|
||||
<view class="right phone" bind:tap="makePhoneCall">
|
||||
<view class="icon-con">
|
||||
<image class="icon" src="/assets/icon/shop/phone@2x.png"/>
|
||||
<view class="kv">
|
||||
<view class="key">交易方式</view>
|
||||
<view class="value">微信支付</view>
|
||||
</view>
|
||||
<view class="text">电话</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_id}}</view>
|
||||
<view class="copy-area" bind:tap="copyOrderId">
|
||||
<view class="copy">复制</view>
|
||||
<view class="kv">
|
||||
<view class="key">下单时间</view>
|
||||
<view class="value">{{orderDetail.create_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="kv">
|
||||
<view class="key">订单状态</view>
|
||||
<view class="value">{{orderDetail.status}}</view>
|
||||
</view>
|
||||
<view class="kv">
|
||||
<view class="key">交易方式</view>
|
||||
<view class="value">微信支付</view>
|
||||
</view>
|
||||
<view class="kv">
|
||||
<view class="key">下单时间</view>
|
||||
<view class="value">{{orderDetail.create_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
<view class="bottom-bar">
|
||||
<view class="bottom-bar"
|
||||
wx:if="{{orderDetail.status==merchantOrderStatus.created||orderDetail.status==merchantOrderStatus.unverified}}">
|
||||
<!-- <button class="button button1" plain size="mini">取消订单</button> -->
|
||||
<button class="button button2" plain size="mini">申请退款</button>
|
||||
<button type="primary" wx:if="{{orderDetail.status==merchantOrderStatus.created}}"
|
||||
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>
|
||||
<view class="patch"></view>
|
||||
|
||||
<merchant-order id="merchantOrderComponent" bind:paySuccess="paySuccess"/>
|
||||
@ -4,7 +4,9 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.prd-info{
|
||||
padding:46rpx 40rpx;
|
||||
}
|
||||
.prd-info .head{
|
||||
display: flex;
|
||||
}
|
||||
@ -13,7 +15,6 @@
|
||||
}
|
||||
.prd-info .head .center{
|
||||
flex: 1;
|
||||
margin-top:10rpx;
|
||||
}
|
||||
.prd-info .head .money{
|
||||
margin-top:10rpx;
|
||||
@ -26,13 +27,19 @@
|
||||
}
|
||||
.prd-info .qrcode{
|
||||
width:400rpx;height:400rpx;
|
||||
margin: 0 auto;
|
||||
margin: 54rpx auto 0;
|
||||
background-color: #999;
|
||||
}
|
||||
.prd-info .qrcode .image{
|
||||
width:100%;height:100%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.prd-info .code-tips{
|
||||
font-size: 30rpx;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
margin-top:30rpx;
|
||||
}
|
||||
|
||||
.address{
|
||||
display: flex;
|
||||
@ -92,11 +99,11 @@
|
||||
padding:10rpx;
|
||||
}
|
||||
.order-info .kv .copy{
|
||||
font-size: 20rpx;
|
||||
border-radius: 60rpx;
|
||||
border: 0.5px solid rgba(153, 153, 153, 0.5);
|
||||
color: #888888;
|
||||
line-height: 32rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 0.3px solid rgba(153, 153, 153, 0.5);
|
||||
color: #222222;
|
||||
line-height: 36rpx;
|
||||
padding:0 14rpx;
|
||||
}
|
||||
.order-info .kv .tag{
|
||||
@ -112,7 +119,6 @@
|
||||
|
||||
|
||||
.bottom-bar{
|
||||
padding:34rpx 34rpx 94rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.bottom-bar .button{
|
||||
@ -129,7 +135,4 @@
|
||||
.bottom-bar .button2{
|
||||
font-size: 32rpx;
|
||||
margin-left:30rpx;
|
||||
}
|
||||
.patch{
|
||||
padding-bottom:200rpx;
|
||||
}
|
||||
@ -5,19 +5,33 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
orderId:'',
|
||||
orderDetail:{},
|
||||
orderStatusKV:userApi.order.statusKV,
|
||||
orderStatus:userApi.order.status
|
||||
orderStatus:userApi.order.status,
|
||||
|
||||
orderDeliverStatusKV:userApi.order.orderDeliverStatusKV,
|
||||
|
||||
scrollViewHeight:0,
|
||||
|
||||
refresherTriggered:true
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.getOrderDetail(options.id);
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
this.setData({
|
||||
orderId:options.id,
|
||||
scrollViewHeight:windowInfo.windowHeight - 94
|
||||
});
|
||||
this.getOrderDetail();
|
||||
},
|
||||
getOrderDetail(id){
|
||||
userApi.order.detail(id).then((data)=>{
|
||||
getOrderDetail(){
|
||||
wx.showNavigationBarLoading();
|
||||
userApi.order.detail(this.data.orderId).then((data)=>{
|
||||
wx.hideNavigationBarLoading();
|
||||
let totalPackage = 0;
|
||||
data.packages.map((item)=>{
|
||||
item.pickup_codes = item.pickup_codes.split(',');
|
||||
@ -25,7 +39,8 @@ Page({
|
||||
});
|
||||
data.totalPackage = totalPackage;
|
||||
this.setData({
|
||||
orderDetail:data
|
||||
orderDetail:data,
|
||||
refresherTriggered:false
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@ -1,83 +1,86 @@
|
||||
<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:00~21:00</label>
|
||||
</view>
|
||||
</view>
|
||||
<block wx:for="{{orderDetail.packages}}" wx:key="index">
|
||||
<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="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.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:00~21:00</label>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="page-container send-way">
|
||||
<view class="title">
|
||||
<view class="left">送达方式</view>
|
||||
<view class="right">{{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.order.delivery_method]}}</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>
|
||||
</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.order.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.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>
|
||||
<view class="tag">先享后付</view>
|
||||
</view>
|
||||
<view class="tag">先享后付</view>
|
||||
</view>
|
||||
</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>
|
||||
<view class="patch"></view>
|
||||
<view class="page-dispatch"></view>
|
||||
</view>
|
||||
@ -96,6 +96,7 @@
|
||||
row-gap: 30rpx;
|
||||
column-gap: 84rpx;
|
||||
margin-top: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.package-info .package .item{
|
||||
|
||||
@ -103,7 +104,7 @@
|
||||
.order-info .kv{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height:64rpx;
|
||||
height:32px;
|
||||
}
|
||||
.order-info .kv .key{
|
||||
font-size: 30rpx;
|
||||
@ -117,12 +118,11 @@
|
||||
align-items: center;
|
||||
}
|
||||
.order-info .kv .copy{
|
||||
font-size: 22rpx;
|
||||
border-radius: 60rpx;
|
||||
background: rgba(255, 195, 0, 0.1);
|
||||
color: #FEC400;
|
||||
line-height: 32rpx;
|
||||
padding:0rpx 14rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
padding:6rpx 12rpx;
|
||||
line-height: 1;
|
||||
border: 0.3px solid rgba(153, 153, 153, 0.5);
|
||||
}
|
||||
.order-info .kv .copy-area{
|
||||
padding:10rpx;
|
||||
@ -137,7 +137,6 @@
|
||||
margin-left: 32rpx;
|
||||
}
|
||||
.bottom-bar{
|
||||
padding:34rpx 34rpx 94rpx;
|
||||
text-align: right;
|
||||
}
|
||||
.bottom-bar .button{
|
||||
|
||||
@ -63,7 +63,7 @@ Page({
|
||||
},
|
||||
orderCreated(){
|
||||
//创建成功之后刷新 order 列表,成功之后会跳转,不用刷新
|
||||
this.loadMerchantOrderList();
|
||||
this.refreshList();
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
@ -213,7 +213,11 @@ Page({
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
pay(event){
|
||||
const item = event.currentTarget.dataset.item;
|
||||
const orderConfirm = this.selectComponent("#merchantOrderConfirm");
|
||||
orderConfirm.createPayment(item.order_id);
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
||||
@ -2,15 +2,19 @@
|
||||
|
||||
<view class="tab-bar">
|
||||
<view class="item-container {{tabIndex==0?'current':''}}" bind:tap="changeTab" data-index="0">
|
||||
<view class="item">跑腿服务</view>
|
||||
<view class="item">配送订单</view>
|
||||
</view>
|
||||
<view class="item-container {{tabIndex==1?'current':''}}" bind:tap="changeTab" data-index="1">
|
||||
<view class="item">消费买单</view>
|
||||
</view>
|
||||
<view class="item-container {{tabIndex==2?'current':''}}" bind:tap="changeTab" data-index="2">
|
||||
<view class="item">代金券</view>
|
||||
<view class="item">商品订单</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}}"
|
||||
refresher-triggered="{{refreshTriggered.tab1}}"
|
||||
@ -46,8 +50,10 @@
|
||||
<view class="text">暂无相关订单</view>
|
||||
</view>
|
||||
</list-view>
|
||||
|
||||
<list-view class="bill-list" wx:if="{{tabIndex==1}}"
|
||||
<!-- </swiper-item>
|
||||
<swiper-item> -->
|
||||
<!-- 消费买单列表 -->
|
||||
<list-view class="bill-list" wx:if="{{tabIndex==1}}"
|
||||
bind:refresh="refreshList" bind:loadMore="loadMore" height="{{scrollViewHeight}}"
|
||||
refresher-triggered="{{refreshTriggered.tab2}}" load-more-text="仅展示最近一年的订单"
|
||||
show-load-more="{{!(merchantOrderList.length==0&&pager.tab2.loadAll)}}"
|
||||
@ -87,7 +93,9 @@
|
||||
<view class="text">暂无相关订单</view>
|
||||
</view>
|
||||
</list-view>
|
||||
|
||||
<!-- </swiper-item>
|
||||
<swiper-item> -->
|
||||
<!-- 代金券列表 -->
|
||||
<list-view class="group-list" wx:if="{{tabIndex==2}}"
|
||||
bind:refresh="refreshList" bind:loadMore="loadMore" height="{{scrollViewHeight}}"
|
||||
refresher-triggered="{{refreshTriggered.tab3}}" load-more-text="仅展示最近一年的订单"
|
||||
@ -101,6 +109,7 @@
|
||||
</view>
|
||||
<view class="status {{item.status}}">{{merchantOrderStatusKV[item.status]}}</view>
|
||||
</view>
|
||||
<view class="spliter"></view>
|
||||
<view class="content">
|
||||
<view class="center">
|
||||
<view>{{item.product_name}}</view>
|
||||
@ -111,8 +120,9 @@
|
||||
<view class="money money-normal">{{item.order_amount}}</view>
|
||||
</view>
|
||||
<view class="btns">
|
||||
<button class="button button1" plain size="mini" capture-catch:tap="orderAgain" data-item="{{item}}">再来一单</button>
|
||||
<button class="button button2" plain size="mini" wx:if="{{item.status==merchantOrderStatus.unverified}}">查看券码</button>
|
||||
<view class="time">下单时间:{{item.create_time}}</view>
|
||||
<button class="button button1" plain size="mini" capture-catch:tap="orderAgain" data-item="{{item}}" wx:if="{{item.status==merchantOrderStatus.verified}}">再来一单</button>
|
||||
<button class="button button2" plain size="mini" capture-catch:tap="pay" wx:if="{{item.status==merchantOrderStatus.created}}" data-item="{{item}}">立即支付</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -121,5 +131,6 @@
|
||||
<view class="text">暂无相关订单</view>
|
||||
</view>
|
||||
</list-view>
|
||||
|
||||
<!-- </swiper-item>
|
||||
</swiper> -->
|
||||
<merchant-order id="merchantOrderConfirm" bind:orderCreated="orderCreated"/>
|
||||
@ -91,7 +91,7 @@
|
||||
.group-list .item{
|
||||
background-color: #fff;
|
||||
border-radius: 18rpx;
|
||||
padding: 20rpx 40rpx;
|
||||
padding:40rpx 30rpx 20rpx 40rpx;
|
||||
margin:24rpx 0;
|
||||
}
|
||||
.group-list .item .status{
|
||||
@ -109,16 +109,17 @@
|
||||
flex:1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding:10rpx 0;
|
||||
}
|
||||
.group-list .head .name .icon{
|
||||
width:28rpx;height:28rpx;
|
||||
margin-left:4rpx;
|
||||
}
|
||||
.group-list .item .spliter{
|
||||
margin:32rpx 0;
|
||||
}
|
||||
|
||||
.group-list .content{
|
||||
display: flex;
|
||||
margin-top:20rpx;
|
||||
}
|
||||
.group-list .content .image{
|
||||
width:160rpx;height:160rpx;
|
||||
@ -130,7 +131,14 @@
|
||||
margin-top:22rpx;
|
||||
}
|
||||
.group-list .btns{
|
||||
text-align: right;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top:50rpx;
|
||||
}
|
||||
.group-list .btns .time{
|
||||
flex:1;
|
||||
font-size: 26rpx;
|
||||
color: #888888;
|
||||
}
|
||||
.group-list .btns .button{
|
||||
font-size: 27rpx;
|
||||
|
||||
@ -5,14 +5,18 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
name:'',
|
||||
price:''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
this.setData({
|
||||
name:options.name,
|
||||
price:options.price
|
||||
})
|
||||
},
|
||||
back(){
|
||||
wx.navigateBack();
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
<icon class="icon" type="success" size="120rpx" color="#FEC400"/>
|
||||
<view class="msg">扫码核销成功</view>
|
||||
<view class="prd-indo">
|
||||
<label class="name">【洗吹】精致造型</label>
|
||||
<label class="money">9.9</label>
|
||||
<label class="name">{{name}}</label>
|
||||
<label class="money">{{price}}</label>
|
||||
</view>
|
||||
<button class="button" size="mini" bind:tap="back">完成</button>
|
||||
</view>
|
||||
@ -44,11 +44,13 @@ Page({
|
||||
});
|
||||
const cid = this.data.categories.length>0?this.data.categories[this.data.tabIndex].id:0;
|
||||
const params = {
|
||||
longitude:this.data.lng,
|
||||
latitude:this.data.lat,
|
||||
skip:this.data.pager.pageIndex*this.data.pager.limit,
|
||||
limit:this.data.pager.limit
|
||||
}
|
||||
if(this.data.lng&&this.data.lat){
|
||||
params.longitude = this.data.lng;
|
||||
params.latitude = this.data.lat;
|
||||
}
|
||||
if(cid){
|
||||
params.category_id = cid;
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<nav-bar/>
|
||||
<view class="consume">
|
||||
<navigator class="consume" url="/pages/my/money/index">
|
||||
<view class="title">蜂蜜 (克)</view>
|
||||
<view class="point">{{userInfo.points}}</view>
|
||||
<view class="tips">买券自动抵扣</view>
|
||||
</view>
|
||||
<view class="tips">取快递自动抵扣</view>
|
||||
</navigator>
|
||||
<view class="btns">
|
||||
<button wx:for="{{categories}}" wx:key="index" class="item" size="mini"
|
||||
bind:tap="changeTab" data-index="{{index}}" data-cid="{{item.id}}"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
.consume{
|
||||
border-radius: 18rpx;
|
||||
background: linear-gradient(270deg, #FFDB00 0%, #FFC300 60%);
|
||||
box-shadow: 0 10rpx 10rpx 0 rgba(54, 98, 236, 0.2);
|
||||
box-shadow: 0px 6px 6px 0px rgba(0, 0, 0, 0.06);
|
||||
margin:20rpx;
|
||||
padding:40rpx 30rpx;
|
||||
position:relative;
|
||||
|
||||