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