修改订单列表,详情
This commit is contained in:
parent
8b321d8d44
commit
1a3311b6aa
@ -35,6 +35,7 @@ export default {
|
|||||||
detail:(activity_id)=>request.get(`/api/coupon-activities/${activity_id}`),
|
detail:(activity_id)=>request.get(`/api/coupon-activities/${activity_id}`),
|
||||||
receive:(activity_id)=>request.post(`/api/coupon-activities/${activity_id}/receive`,{},{noTips:true})
|
receive:(activity_id)=>request.post(`/api/coupon-activities/${activity_id}/receive`,{},{noTips:true})
|
||||||
},
|
},
|
||||||
|
getPickupCodeWidthImgUrl:(url)=>request.post('/api/ai/recognition/pickup_code_with_url',{url}),
|
||||||
uploadImg(file,progress){
|
uploadImg(file,progress){
|
||||||
if(!app)app = getApp();
|
if(!app)app = getApp();
|
||||||
return new Promise((rs,rj)=>{
|
return new Promise((rs,rj)=>{
|
||||||
|
|||||||
@ -81,7 +81,7 @@ export default {
|
|||||||
list:()=>request.get('/api/user/referrals')
|
list:()=>request.get('/api/user/referrals')
|
||||||
},
|
},
|
||||||
updateUser:(data)=>request.put('/api/user/update',data),
|
updateUser:(data)=>request.put('/api/user/update',data),
|
||||||
createPayment(order_id,order_type){
|
createPayment(order_id){
|
||||||
return request.post('/api/wechat/create-payment',{order_id,order_type});
|
return request.post('/api/wechat/create-payment',{order_id});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2
app.js
2
app.js
@ -1,7 +1,6 @@
|
|||||||
import userApi from './api/user';
|
import userApi from './api/user';
|
||||||
import commonApi from './api/common';
|
import commonApi from './api/common';
|
||||||
let token = wx.getStorageSync('accessToken');
|
let token = wx.getStorageSync('accessToken');
|
||||||
console.log(1);
|
|
||||||
App({
|
App({
|
||||||
async onLaunch(options){
|
async onLaunch(options){
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
@ -15,7 +14,6 @@ App({
|
|||||||
const currentPage = page[page.length-1];
|
const currentPage = page[page.length-1];
|
||||||
if(currentPage){
|
if(currentPage){
|
||||||
currentPage.onShareAppMessage = async()=>{
|
currentPage.onShareAppMessage = async()=>{
|
||||||
console.log(this.globalData.userInfo.user_code);
|
|
||||||
if(!(this.globalData.appConfig&&this.globalData.appConfig.share_card_title)){
|
if(!(this.globalData.appConfig&&this.globalData.appConfig.share_card_title)){
|
||||||
await this.getAppConfig();
|
await this.getAppConfig();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ Component({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
createPayment(orderId,needStay){
|
createPayment(orderId,needStay){
|
||||||
userApi.createPayment(orderId,'PRODUCT').then((data)=>{
|
userApi.createPayment(orderId).then((data)=>{
|
||||||
wx.requestPayment({
|
wx.requestPayment({
|
||||||
timeStamp:data.payment_params.timeStamp,
|
timeStamp:data.payment_params.timeStamp,
|
||||||
nonceStr:data.payment_params.nonceStr,
|
nonceStr:data.payment_params.nonceStr,
|
||||||
|
|||||||
@ -39,7 +39,6 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
console.log('onLoad',new Date().getTime());
|
|
||||||
let height = this.selectComponent("#navBar").getHeight();
|
let height = this.selectComponent("#navBar").getHeight();
|
||||||
this.setData({
|
this.setData({
|
||||||
navBarHeight:height
|
navBarHeight:height
|
||||||
@ -65,17 +64,14 @@ Page({
|
|||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
onReady() {
|
onReady() {
|
||||||
console.log('onReady',new Date().getTime());
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
console.log('onShow',new Date().getTime());
|
|
||||||
wx.getStorage({
|
wx.getStorage({
|
||||||
key:'pre-order',
|
key:'pre-order',
|
||||||
success:(res)=>{
|
success:(res)=>{
|
||||||
console.log(res);
|
|
||||||
const name = [];
|
const name = [];
|
||||||
let count = 0;
|
let count = 0;
|
||||||
if(res.data.price_request.pickup_images){
|
if(res.data.price_request.pickup_images){
|
||||||
@ -135,7 +131,6 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
changeCommunity(community){
|
changeCommunity(community){
|
||||||
console.log('changeCommunity',community);
|
|
||||||
//手动设置社区之后 做个标记
|
//手动设置社区之后 做个标记
|
||||||
this.setData({
|
this.setData({
|
||||||
currentCommunity:{
|
currentCommunity:{
|
||||||
@ -250,11 +245,9 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
enterPageContainer(){
|
enterPageContainer(){
|
||||||
console.log('enterPageContainer');
|
|
||||||
// wx.hideTabBar();
|
// wx.hideTabBar();
|
||||||
},
|
},
|
||||||
leavePageContainer(){
|
leavePageContainer(){
|
||||||
console.log('leavePageContainer');
|
|
||||||
wx.showTabBar();
|
wx.showTabBar();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -123,6 +123,12 @@
|
|||||||
</label>
|
</label>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="kv" wx:if="{{orderDetail.additional_fee_amount}}">
|
||||||
|
<view class="key">加价金额</view>
|
||||||
|
<view class="value">
|
||||||
|
<label class="money money-normal">{{orderDetail.additional_fee_amount}}</label>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="kv">
|
<view class="kv">
|
||||||
<view class="key">支付金额</view>
|
<view class="key">支付金额</view>
|
||||||
<view class="value">
|
<view class="value">
|
||||||
|
|||||||
@ -212,7 +212,10 @@ Page({
|
|||||||
pay(event){
|
pay(event){
|
||||||
const item = event.currentTarget.dataset.item;
|
const item = event.currentTarget.dataset.item;
|
||||||
const orderConfirm = this.selectComponent("#merchantOrderConfirm");
|
const orderConfirm = this.selectComponent("#merchantOrderConfirm");
|
||||||
orderConfirm.createPayment(item.order_id);
|
orderConfirm.createPayment(item.orderid||item.order_id,true);
|
||||||
|
},
|
||||||
|
paySuccess(){
|
||||||
|
this.refreshList();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
|||||||
@ -26,21 +26,24 @@
|
|||||||
<view class="icon-con">
|
<view class="icon-con">
|
||||||
<image class="icon" src="/assets/icon/order/package@2x.png"/>
|
<image class="icon" src="/assets/icon/order/package@2x.png"/>
|
||||||
</view>
|
</view>
|
||||||
<view class="center">代取快递</view>
|
<view class="center">订单号 {{item.orderid}}</view>
|
||||||
<view class="status {{item.status}}">
|
<view class="status {{item.status}}">
|
||||||
{{orderStatusKV[item.status]}}
|
{{orderStatusKV[item.status]}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="spliter"></view>
|
<view class="spliter"></view>
|
||||||
<view class="address">{{item.address.community_name}}{{item.address.address_detail}}</view>
|
<view class="kv">
|
||||||
<view class="time">下单时间:{{item.create_time}}</view>
|
<view>快递数量:10 件</view>
|
||||||
<view class="pay" wx:if="{{item.status==orderStatus.UNPAID}}">
|
<view>送达地址:{{item.address.community_name}}{{item.address.address_detail}}</view>
|
||||||
|
<view>下单时间:{{item.create_time}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="pay" wx:if="{{item.status==orderStatus.unpaid}}">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<label>跑腿费用</label>
|
<label>跑腿费用</label>
|
||||||
<label class="money">{{item.final_amount}}</label>
|
<label class="money">{{item.final_amount}}</label>
|
||||||
</view>
|
</view>
|
||||||
<button class="button" type="primary" plain size="mini">立即支付</button>
|
<button class="button" type="primary" size="mini" capture-catch:tap="pay" data-item="{{item}}">立即支付</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -134,4 +137,4 @@
|
|||||||
</list-view>
|
</list-view>
|
||||||
<!-- </swiper-item>
|
<!-- </swiper-item>
|
||||||
</swiper> -->
|
</swiper> -->
|
||||||
<merchant-order id="merchantOrderConfirm" bind:orderCreated="orderCreated"/>
|
<merchant-order id="merchantOrderConfirm" bind:orderCreated="orderCreated" bind:paySuccess="paySuccess"/>
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 18rpx;
|
border-radius: 18rpx;
|
||||||
margin:24rpx 0;
|
margin:24rpx 0;
|
||||||
padding:30rpx;
|
padding:30rpx 30rpx 50rpx 30rpx;
|
||||||
}
|
}
|
||||||
.order-list .head{
|
.order-list .head{
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -17,7 +17,7 @@
|
|||||||
.order-list .head .center{
|
.order-list .head .center{
|
||||||
margin-left:24rpx;
|
margin-left:24rpx;
|
||||||
flex:1;
|
flex:1;
|
||||||
font-size:34rpx;
|
font-size:32rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
.order-list .head .status{
|
.order-list .head .status{
|
||||||
@ -42,25 +42,22 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.order-list .content{
|
.order-list .content{
|
||||||
margin-top:24rpx;
|
|
||||||
margin-left:80rpx;
|
margin-left:80rpx;
|
||||||
}
|
}
|
||||||
.order-list .content .address{
|
.order-list .content .kv{
|
||||||
margin-top:30rpx;
|
display: flex;
|
||||||
font-size: 34rpx;
|
flex-direction: column;
|
||||||
font-weight: 500;
|
gap: 24rpx;
|
||||||
|
color: #222222;
|
||||||
}
|
}
|
||||||
.order-list .content .time{
|
.order-list .content .spliter{
|
||||||
font-size: 26rpx;
|
margin:24rpx 0 30rpx 0;
|
||||||
color:#888888;
|
|
||||||
margin-top:24rpx;
|
|
||||||
padding-bottom:48rpx;
|
|
||||||
}
|
}
|
||||||
.order-list .content .pay{
|
.order-list .content .pay{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top:12rpx;
|
margin-top:60rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #888888;
|
color: #888888;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Page({
|
|||||||
},
|
},
|
||||||
merchantPay(){
|
merchantPay(){
|
||||||
shopApi.merchantPay(this.data.shopId,this.data.amount).then((data)=>{
|
shopApi.merchantPay(this.data.shopId,this.data.amount).then((data)=>{
|
||||||
userApi.createPayment(data.order_id,'ONLINE_PAY').then((data)=>{
|
userApi.createPayment(data.order_id).then((data)=>{
|
||||||
wx.requestPayment({
|
wx.requestPayment({
|
||||||
timeStamp:data.payment_params.timeStamp,
|
timeStamp:data.payment_params.timeStamp,
|
||||||
nonceStr:data.payment_params.nonceStr,
|
nonceStr:data.payment_params.nonceStr,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user