日常提交
This commit is contained in:
parent
3257d586e0
commit
83e3bc95b7
@ -17,7 +17,8 @@ export default {
|
|||||||
product:{
|
product:{
|
||||||
typeKV:{
|
typeKV:{
|
||||||
'SELF_OPERATED':'自营','MERCHANT':'商家'
|
'SELF_OPERATED':'自营','MERCHANT':'商家'
|
||||||
}
|
},
|
||||||
|
list:(params)=>request.get(`/api/merchant/product/list`,params)
|
||||||
},
|
},
|
||||||
|
|
||||||
list:(params)=>request.get('/api/merchant/order/merchant',params),
|
list:(params)=>request.get('/api/merchant/order/merchant',params),
|
||||||
@ -25,6 +26,9 @@ export default {
|
|||||||
accept:(order_id)=>request.put(`/api/merchant/order/${order_id}/accept`),
|
accept:(order_id)=>request.put(`/api/merchant/order/${order_id}/accept`),
|
||||||
complete:(order_id)=>request.put(`/api/merchant/order/${order_id}/complete`),
|
complete:(order_id)=>request.put(`/api/merchant/order/${order_id}/complete`),
|
||||||
|
|
||||||
summary:()=>request.get('/api/merchant/order/merchant/summary')
|
queryVerifyCode:(verify_code)=>request.get(`/api/merchant/order/merchant/scan_query_order/${verify_code}`),
|
||||||
|
|
||||||
|
verify:(verify_code)=>request.post('/api/merchant/order/merchant/verify_order',{verify_code}),
|
||||||
|
|
||||||
|
cancel:(order_id)=>request.put(`/api/merchant/order/${order_id}/user/cancel`)
|
||||||
}
|
}
|
||||||
@ -5,5 +5,12 @@ export default {
|
|||||||
MALE:'先生',FEMALE:'女士'
|
MALE:'先生',FEMALE:'女士'
|
||||||
},
|
},
|
||||||
login:(phone,password)=>request.post('/api/user/password-login',{phone,password,role:'deliveryman'}),
|
login:(phone,password)=>request.post('/api/user/password-login',{phone,password,role:'deliveryman'}),
|
||||||
|
|
||||||
|
info:()=>request.get('/api/user/info'),
|
||||||
|
|
||||||
verifyCode:(phone)=>request.post('/api/user/send-code',{phone}),
|
verifyCode:(phone)=>request.post('/api/user/send-code',{phone}),
|
||||||
|
summary:()=>request.get('/api/merchant/order/merchant/summary'),
|
||||||
|
incomeList:(data)=>request.get('/api/account/details',data),
|
||||||
|
|
||||||
|
modifyPassword:(phone,new_password,verify_code)=>request.post('/api/user/change-password',{phone,new_password,verify_code}),
|
||||||
}
|
}
|
||||||
17
app.js
17
app.js
@ -1,7 +1,9 @@
|
|||||||
import commonApi from './api/common';
|
import commonApi from './api/common';
|
||||||
|
import userApi from './api/user';
|
||||||
const token = wx.getStorageSync('accessToken');
|
const token = wx.getStorageSync('accessToken');
|
||||||
|
|
||||||
App({
|
App({
|
||||||
|
verifyCodeWaitingTime:60,
|
||||||
onLaunch() {
|
onLaunch() {
|
||||||
// 展示本地存储能力
|
// 展示本地存储能力
|
||||||
const logs = wx.getStorageSync('logs') || []
|
const logs = wx.getStorageSync('logs') || []
|
||||||
@ -25,6 +27,21 @@ App({
|
|||||||
}
|
}
|
||||||
return this.globalData.appConfig;
|
return this.globalData.appConfig;
|
||||||
},
|
},
|
||||||
|
forceGetUserInfo(){
|
||||||
|
this.globalData.userInfoGetTime = null;
|
||||||
|
return this.getUserInfo();
|
||||||
|
},
|
||||||
|
async getUserInfo(){
|
||||||
|
if(this.globalData.userInfoGetTime&&
|
||||||
|
this.globalData.userInfo&&
|
||||||
|
new Date()-this.globalData.userInfoGetTime<1000*60*5){
|
||||||
|
return this.globalData.userInfo;
|
||||||
|
}
|
||||||
|
const data = await userApi.info();
|
||||||
|
this.globalData.userInfo = data;
|
||||||
|
this.globalData.userInfoGetTime = new Date();
|
||||||
|
return data;
|
||||||
|
},
|
||||||
globalData: {
|
globalData: {
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
accessToken:token
|
accessToken:token
|
||||||
|
|||||||
8
app.json
8
app.json
@ -1,11 +1,15 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
"pages/order/list/index",
|
|
||||||
"pages/index/index/index",
|
"pages/index/index/index",
|
||||||
|
"pages/order/list/index",
|
||||||
"pages/user/index/index",
|
"pages/user/index/index",
|
||||||
"pages/user/login/index",
|
"pages/user/login/index",
|
||||||
"pages/user/password/index",
|
"pages/user/password/index",
|
||||||
"pages/product/list/index"
|
"pages/product/list/index",
|
||||||
|
"pages/user/income/list/index",
|
||||||
|
"pages/index/verification/index",
|
||||||
|
"pages/user/income/detail/index",
|
||||||
|
"pages/browser/index"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
|
|||||||
7
app.wxss
7
app.wxss
@ -42,12 +42,17 @@ button[type=primary]{
|
|||||||
background-color:var(--main-color);
|
background-color:var(--main-color);
|
||||||
color:var(--main-font-color);
|
color:var(--main-font-color);
|
||||||
}
|
}
|
||||||
|
/* button[type=primary]:active{
|
||||||
|
background-color:var(--main-color);
|
||||||
|
color:var(--main-font-color);
|
||||||
|
} */
|
||||||
button[disabled]{
|
button[disabled]{
|
||||||
opacity: .7;
|
opacity: .7;
|
||||||
}
|
}
|
||||||
button[type=primary]:not([disabled]).button-hover{
|
button[type=primary]:not([disabled]).button-hover{
|
||||||
background-color: var(--main-hover-color);
|
background-color:var(--main-color);
|
||||||
color:var(--main-font-color);
|
color:var(--main-font-color);
|
||||||
|
opacity: .8;
|
||||||
}
|
}
|
||||||
|
|
||||||
button[plain]{
|
button[plain]{
|
||||||
|
|||||||
7
package-lock.json
generated
7
package-lock.json
generated
@ -10,6 +10,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@beefast-wxmp/list-view": "^0.0.1",
|
"@beefast-wxmp/list-view": "^0.0.1",
|
||||||
|
"@beefast-wxmp/modal-view": "^0.1.7",
|
||||||
"@beefast-wxmp/nav-bar": "^0.0.1",
|
"@beefast-wxmp/nav-bar": "^0.0.1",
|
||||||
"@beefast-wxmp/swipe-button": "^0.0.3"
|
"@beefast-wxmp/swipe-button": "^0.0.3"
|
||||||
}
|
}
|
||||||
@ -20,6 +21,12 @@
|
|||||||
"integrity": "sha512-XoTaXRqy8EuuHECGS2zFzAeDKoGDtC56VdahnVYTAcDLNo3fceQuXI2KhOSvjnn4Jbkt1UDch7IEuF9Eekf9eg==",
|
"integrity": "sha512-XoTaXRqy8EuuHECGS2zFzAeDKoGDtC56VdahnVYTAcDLNo3fceQuXI2KhOSvjnn4Jbkt1UDch7IEuF9Eekf9eg==",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/@beefast-wxmp/modal-view": {
|
||||||
|
"version": "0.1.7",
|
||||||
|
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/modal-view/-/@beefast-wxmp/modal-view-0.1.7.tgz",
|
||||||
|
"integrity": "sha512-lw7gdhxSfCdNW7sD9FuFgaFUih8+yf8TSJ2gX7ZUnnMEK6RIL6QxAEEj6LUJ+SHE6QuBegPb4ucrfAFVAd8s8A==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/@beefast-wxmp/nav-bar": {
|
"node_modules/@beefast-wxmp/nav-bar": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/nav-bar/-/@beefast-wxmp/nav-bar-0.0.1.tgz",
|
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/nav-bar/-/@beefast-wxmp/nav-bar-0.0.1.tgz",
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@beefast-wxmp/list-view": "^0.0.1",
|
"@beefast-wxmp/list-view": "^0.0.1",
|
||||||
|
"@beefast-wxmp/modal-view": "^0.1.7",
|
||||||
"@beefast-wxmp/nav-bar": "^0.0.1",
|
"@beefast-wxmp/nav-bar": "^0.0.1",
|
||||||
"@beefast-wxmp/swipe-button": "^0.0.3"
|
"@beefast-wxmp/swipe-button": "^0.0.3"
|
||||||
}
|
}
|
||||||
|
|||||||
75
pages/browser/index.js
Normal file
75
pages/browser/index.js
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
// pages/browser/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
webUrl:''
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
let url = decodeURIComponent(options.url);
|
||||||
|
if(url.indexOf('?')>-1){
|
||||||
|
url = `${url}&random=${Math.random()}`
|
||||||
|
}else{
|
||||||
|
url = `${url}?random=${Math.random()}`
|
||||||
|
}
|
||||||
|
console.log(url);
|
||||||
|
this.setData({
|
||||||
|
webUrl:decodeURIComponent(options.url)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
3
pages/browser/index.json
Normal file
3
pages/browser/index.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
1
pages/browser/index.wxml
Normal file
1
pages/browser/index.wxml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<web-view src="{{webUrl}}"></web-view>
|
||||||
1
pages/browser/index.wxss
Normal file
1
pages/browser/index.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/browser/index.wxss */
|
||||||
@ -1,4 +1,7 @@
|
|||||||
// pages/index/index/index.js
|
import userApi from '../../../api/user';
|
||||||
|
import orderApi from '../../../api/order';
|
||||||
|
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -12,7 +15,36 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
userApi.summary()
|
||||||
|
},
|
||||||
|
|
||||||
|
scanQRCode(){
|
||||||
|
wx.scanCode({
|
||||||
|
onlyFromCamera:true,
|
||||||
|
scanType:'qrCode',
|
||||||
|
success:(res)=>{
|
||||||
|
if(res.scanType=='QR_CODE'){
|
||||||
|
orderApi.queryVerifyCode(res.result).then((data)=>{
|
||||||
|
if(data.order){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/index/verification/index?code=${res.result}`,
|
||||||
|
success(){
|
||||||
|
//传 code 供测试用,因为热更新下面的数据就没有了
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const currentPage = pages[pages.length-1];
|
||||||
|
currentPage.setOrder(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
wx.showToast({
|
||||||
|
icon:'none',
|
||||||
|
title: '核销码错误'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -3,17 +3,17 @@
|
|||||||
<image class="icon" src="/assets/icon/index/cash.png"/>
|
<image class="icon" src="/assets/icon/index/cash.png"/>
|
||||||
<view class="text">商品管理</view>
|
<view class="text">商品管理</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<view class="items">
|
<view class="items" bind:tap="scanQRCode">
|
||||||
<image class="icon" src="/assets/icon/index/scan.png"/>
|
<image class="icon" src="/assets/icon/index/scan.png"/>
|
||||||
<view class="text">扫一扫</view>
|
<view class="text">扫一扫</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<view class="row1">
|
<view class="row1">
|
||||||
<view class="cell row1-1">
|
<navigator url="/pages/user/income/list/index" class="cell row1-1">
|
||||||
<view class="title right-arrow">累计收益 (元)</view>
|
<view class="title right-arrow">累计收益 (元)</view>
|
||||||
<view class="number">88</view>
|
<view class="number">88</view>
|
||||||
</view>
|
</navigator>
|
||||||
<view class="cell row1-2">
|
<view class="cell row1-2">
|
||||||
<view class="title">订单笔数</view>
|
<view class="title">订单笔数</view>
|
||||||
<view class="number">12</view>
|
<view class="number">12</view>
|
||||||
|
|||||||
127
pages/index/verification/index.js
Normal file
127
pages/index/verification/index.js
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
import orderApi from '../../../api/order';
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
verifyCode:'',
|
||||||
|
orderDetail:{},
|
||||||
|
refresherTriggered:true,
|
||||||
|
|
||||||
|
orderStatus:orderApi.status,
|
||||||
|
orderStatusKV:orderApi.statusKV,
|
||||||
|
|
||||||
|
isShowVerify:false,
|
||||||
|
isShowRefund:false
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.setData({
|
||||||
|
verifyCode:options.code
|
||||||
|
})
|
||||||
|
const { miniProgram } = wx.getAccountInfoSync();
|
||||||
|
const envVersion = miniProgram.envVersion;
|
||||||
|
if(envVersion=='develop'){
|
||||||
|
this.getOrderDetail();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getOrderDetail(){
|
||||||
|
orderApi.queryVerifyCode(this.data.verifyCode).then((data)=>{
|
||||||
|
this.setData({
|
||||||
|
orderDetail:data,
|
||||||
|
refresherTriggered:false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
setOrder(order){
|
||||||
|
this.setData({
|
||||||
|
orderDetail:order
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
},
|
||||||
|
showVerifdy(){
|
||||||
|
this.setData({
|
||||||
|
isShowVerify:true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
verify(){
|
||||||
|
orderApi.verify(this.data.verifyCode).then((data)=>{
|
||||||
|
wx.navigateBack({
|
||||||
|
success(){
|
||||||
|
wx.showToast({
|
||||||
|
title: '核销成功'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
showRefund(){
|
||||||
|
this.setData({
|
||||||
|
isShowRefund:true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
refund(){
|
||||||
|
orderApi.cancel(this.data.orderDetail.order.order_id).then(()=>{
|
||||||
|
wx.navigateBack({
|
||||||
|
success(){
|
||||||
|
wx.showToast({
|
||||||
|
title: '退单成功'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
5
pages/index/verification/index.json
Normal file
5
pages/index/verification/index.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"modal-view":"/miniprogram_npm/@beefast-wxmp/modal-view"
|
||||||
|
}
|
||||||
|
}
|
||||||
91
pages/index/verification/index.wxml
Normal file
91
pages/index/verification/index.wxml
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
<view class="custom-scroll-view">
|
||||||
|
<scroll-view scroll-y refresher-enabled class="main"
|
||||||
|
bindrefresherrefresh="getOrderDetail" refresher-triggered="{{refresherTriggered}}"
|
||||||
|
enhanced show-scrollbar="{{false}}">
|
||||||
|
<view class="order-status {{orderDetail.order.status}}">{{orderStatusKV[orderDetail.order.status]}}</view>
|
||||||
|
<view class="page-container address-self" wx:if="{{orderDetail.product.delivery_time_type=='SCHEDULED'}}">
|
||||||
|
<view class="title">
|
||||||
|
<view>自提点</view>
|
||||||
|
<view class="time">
|
||||||
|
<label>返回自提日期</label>
|
||||||
|
<label class="yellow">
|
||||||
|
{{orderDetail.order.product_pickup_time_from}}~{{orderDetail.order.product_pickup_time_to}}
|
||||||
|
</label>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="spliter"></view>
|
||||||
|
<view class="address">{{orderDetail.merchant.address}}</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="page-container address" wx:else>
|
||||||
|
<view class="title">送货地址</view>
|
||||||
|
<view class="spliter"></view>
|
||||||
|
<view class="text1">
|
||||||
|
{{orderDetail.address.community_name}}
|
||||||
|
{{orderDetail.address.address_detail}}
|
||||||
|
</view>
|
||||||
|
<view class="text2">
|
||||||
|
{{orderDetail.address.name}} {{genderKV[orderDetail.address.gender]}} {{orderDetail.address.phone}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="page-container merchant">
|
||||||
|
<view class="title">供货方</view>
|
||||||
|
<view class="spliter"></view>
|
||||||
|
<view class="info">
|
||||||
|
<image class="avatar" src="{{orderDetail.merchant.optimized_brand_image_url}}"/>
|
||||||
|
<view class="center">
|
||||||
|
<view class="name">{{orderDetail.merchant.name}}</view>
|
||||||
|
<view class="address">{{orderDetail.merchant.address}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="page-container product">
|
||||||
|
<view class="title">商品信息</view>
|
||||||
|
<view class="spliter"></view>
|
||||||
|
<view class="info">
|
||||||
|
<image class="avatar" src="{{orderDetail.product.optimized_image_url}}"/>
|
||||||
|
<view class="center">
|
||||||
|
<view class="c-top">
|
||||||
|
<view class="name">{{orderDetail.product.name}}</view>
|
||||||
|
<view class="qty">x {{orderDetail.order.qty}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="money money-normal">{{orderDetail.product.product_price}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="page-container order-info">
|
||||||
|
<view class="title">订单信息</view>
|
||||||
|
<view class="spliter"></view>
|
||||||
|
<view class="kv">
|
||||||
|
<view class="key">订单编号</view>
|
||||||
|
<view class="value">{{orderDetail.order.order_id}}</view>
|
||||||
|
<view class="copy-area" bind:tap="copyOrderId">
|
||||||
|
<view class="copy">复制</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="kv">
|
||||||
|
<view class="key">下单时间</view>
|
||||||
|
<view class="value">{{orderDetail.order.create_time}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="kv">
|
||||||
|
<view class="key">订单金额</view>
|
||||||
|
<view class="value money">{{orderDetail.order.order_amount}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="scroll-view-dispatch"></view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="bottom-bar-v2"
|
||||||
|
wx:if="{{orderDetail.order.status==orderStatus.pickupReady}}">
|
||||||
|
<button class="btn btn-refund" plain bind:tap="showRefund">退单</button>
|
||||||
|
<button class="btn btn-verify" type="primary" wx:if="{{orderDetail.status==merchantOrderStatus.created}}"
|
||||||
|
bind:tap="showVerifdy">核销</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<modal-view ok-button-text="立即核销" show="{{isShowVerify}}" title-text="核销确认"
|
||||||
|
bind:ok="verify"/>
|
||||||
|
<modal-view ok-button-text="立即退单" show="{{isShowRefund}}" title-text="退单确认"
|
||||||
|
bind:ok="refund"/>
|
||||||
171
pages/index/verification/index.wxss
Normal file
171
pages/index/verification/index.wxss
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
|
||||||
|
.order-status{
|
||||||
|
margin:50rpx 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
color:var(--main-color);
|
||||||
|
}
|
||||||
|
.order-status.COMPLETED,.order-status.CANCELLED{
|
||||||
|
color:var(--main-font-color);
|
||||||
|
}
|
||||||
|
.order-status::before{
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
width:10rpx;height:44rpx;
|
||||||
|
margin-right:24rpx;
|
||||||
|
border-radius: 6rpx;
|
||||||
|
background-color:var(--main-color);
|
||||||
|
}
|
||||||
|
.order-status.COMPLETED::before,.order-status.CANCELLED::before{
|
||||||
|
background-color:var(--main-font-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-container .title{
|
||||||
|
font-weight: 600;
|
||||||
|
font-size:32rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.page-container .title .time{
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
.page-container .title .yellow{
|
||||||
|
color:#FF8C12;
|
||||||
|
}
|
||||||
|
.page-container .spliter{
|
||||||
|
margin:24rpx 0;
|
||||||
|
}
|
||||||
|
.address-self{
|
||||||
|
padding:46rpx 40rpx;
|
||||||
|
}
|
||||||
|
.address-self .address{
|
||||||
|
color:#555;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address .text1{
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
padding-top:16rpx;
|
||||||
|
}
|
||||||
|
.address .text2{
|
||||||
|
font-size:32rpx;
|
||||||
|
color:#888888;
|
||||||
|
margin-top:28rpx;
|
||||||
|
}
|
||||||
|
/* 商家 */
|
||||||
|
.merchant .info{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-top:16rpx;
|
||||||
|
}
|
||||||
|
.merchant .avatar{
|
||||||
|
width:84rpx;height:84rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.merchant .center{
|
||||||
|
margin-left:20rpx;
|
||||||
|
flex:1;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.merchant .name{
|
||||||
|
font-weight: 500;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.merchant .address{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #555;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-top:20rpx;
|
||||||
|
}
|
||||||
|
.merchant .icon-phone{
|
||||||
|
width:36rpx;height:36rpx;
|
||||||
|
align-self: flex-start;
|
||||||
|
padding:4rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product .info{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.product .avatar{
|
||||||
|
width:150rpx;height:150rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
.product .center{
|
||||||
|
flex:1;
|
||||||
|
margin-left:20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 130rpx;
|
||||||
|
padding:10rpx 0;
|
||||||
|
}
|
||||||
|
.product .c-top{
|
||||||
|
display:flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.product .c-top .qty{
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.order-info .kv{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height:58rpx;
|
||||||
|
}
|
||||||
|
.order-info .kv .key{
|
||||||
|
color: #888888;
|
||||||
|
}
|
||||||
|
.order-info .kv .value{
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-left:30rpx;
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
.order-info .kv .copy-area{
|
||||||
|
padding:10rpx;
|
||||||
|
}
|
||||||
|
.order-info .kv .copy{
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 0.3px solid rgba(153, 153, 153, 0.5);
|
||||||
|
color: #222222;
|
||||||
|
line-height: 36rpx;
|
||||||
|
padding:0 14rpx;
|
||||||
|
}
|
||||||
|
.order-info .money{
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.bottom-bar-v2{
|
||||||
|
text-align: right;
|
||||||
|
display: flex;
|
||||||
|
gap: 30rpx;
|
||||||
|
}
|
||||||
|
.bottom-bar-v2 .btn-verify{
|
||||||
|
flex:1;
|
||||||
|
}
|
||||||
|
.bottom-bar-v2 .btn{
|
||||||
|
/* line-height: 72rpx; */
|
||||||
|
font-weight: normal;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
padding:20rpx 40rpx;
|
||||||
|
}
|
||||||
|
.bottom-bar-v2 .button1{
|
||||||
|
color: #555555;
|
||||||
|
border: 1rpx solid rgba(153, 153, 153, 0.5);
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
.bottom-bar-v2 .button2{
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-left:30rpx;
|
||||||
|
}
|
||||||
@ -150,13 +150,23 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
[`list[${index}].receiving`]:true
|
[`list[${index}].receiving`]:true
|
||||||
})
|
})
|
||||||
orderApi.accept(item.order.order_id).then((data)=>{
|
if(item.product.delivery_time_type==this.data.deliveryTimeType.scheduled){
|
||||||
wx.showToast({
|
orderApi.complete(item.order.order_id).then((data)=>{
|
||||||
icon:'success',
|
wx.showToast({
|
||||||
title: '接单成功',
|
icon:'success',
|
||||||
|
title: '自提成功',
|
||||||
|
})
|
||||||
|
this.refreshList();
|
||||||
})
|
})
|
||||||
this.refreshList();
|
}else{
|
||||||
})
|
orderApi.accept(item.order.order_id).then((data)=>{
|
||||||
|
wx.showToast({
|
||||||
|
icon:'success',
|
||||||
|
title: '接单成功',
|
||||||
|
})
|
||||||
|
this.refreshList();
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//我已送达
|
//我已送达
|
||||||
|
|||||||
@ -1,28 +1,29 @@
|
|||||||
<view class="custom-scroll-view">
|
<view class="custom-scroll-view">
|
||||||
<nav-bar>
|
<view>
|
||||||
<view class="order-category {{currentDeliveryTimeType}}" slot="left">
|
<nav-bar>
|
||||||
<view class="item {{deliveryTimeType==index?'current':''}}" data-key="{{index}}"
|
<view class="order-category {{currentDeliveryTimeType}}" slot="left">
|
||||||
bind:tap="changeDeliveryTimeType" wx:for="{{deliveryTimeTypeKV}}" wx:key="index">{{item}}</view>
|
<view class="item {{deliveryTimeType==index?'current':''}}" data-key="{{index}}"
|
||||||
|
bind:tap="changeDeliveryTimeType" wx:for="{{deliveryTimeTypeKV}}" wx:key="index">{{item}}</view>
|
||||||
|
</view>
|
||||||
|
</nav-bar>
|
||||||
|
<view class="top-bar">
|
||||||
|
<view class="item {{orderStatusIndex==index?'current':''}}" bind:tap="changeStatus"
|
||||||
|
wx:for="{{statusDic[currentDeliveryTimeType]}}" wx:key="index" data-index="{{index}}">
|
||||||
|
{{item.value}}(0)
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</nav-bar>
|
<view wx:if="{{statusDic[currentDeliveryTimeType][orderStatusIndex].key!=orderStatus.completed}}" class="search">
|
||||||
<view class="top-bar">
|
<input class="input" placeholder="手机尾号查询" bindinput="filterOrder"
|
||||||
<view class="item {{orderStatusIndex==index?'current':''}}" bind:tap="changeStatus"
|
model:value="{{filterKey}}"/>
|
||||||
wx:for="{{statusDic[currentDeliveryTimeType]}}" wx:key="index" data-index="{{index}}">
|
<button class="button">搜索</button>
|
||||||
{{item.value}}(0)
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view wx:if="{{statusDic[currentDeliveryTimeType][orderStatusIndex].key!=orderStatus.completed}}" class="search">
|
|
||||||
<input class="input" placeholder="手机尾号查询" bindinput="filterOrder"
|
|
||||||
model:value="{{filterKey}}"/>
|
|
||||||
<button class="button">搜索</button>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<list-view class="package-list main" bind:refresh="refreshList"
|
<list-view class="package-list main" bind:refresh="refreshList"
|
||||||
bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}"
|
bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}"
|
||||||
loadMoreText="{{loadMoreText}}"
|
loadMoreText="{{loadMoreText}}"
|
||||||
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
|
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
|
||||||
<view wx:for="{{filterKey?filtedList:list}}" wx:key="index"
|
<view wx:for="{{filterKey?filtedList:list}}" wx:key="index"
|
||||||
class="item {{item.order.status==orderStatus.completed?'no-btns':''}}">
|
class="item item{{index}} {{item.order.status==orderStatus.completed?'no-btns':''}}">
|
||||||
<view bind:tap="navToOrderDetail" data-id="{{item.orderid}}" >
|
<view bind:tap="navToOrderDetail" data-id="{{item.orderid}}" >
|
||||||
<view class="item-head">
|
<view class="item-head">
|
||||||
<view class="tag">{{productTypeKV[item.product.operation_type]}}</view>
|
<view class="tag">{{productTypeKV[item.product.operation_type]}}</view>
|
||||||
|
|||||||
@ -36,7 +36,8 @@
|
|||||||
.top-bar{
|
.top-bar{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
padding:40rpx 0;
|
padding:24rpx 0;
|
||||||
|
margin:16rpx;
|
||||||
}
|
}
|
||||||
.top-bar .item{
|
.top-bar .item{
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
@ -48,7 +49,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search{
|
.search{
|
||||||
margin:0 16rpx;
|
margin:16rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding:10rpx 10rpx 10rpx 40rpx;
|
padding:10rpx 10rpx 10rpx 40rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -78,9 +79,8 @@
|
|||||||
padding:20rpx;
|
padding:20rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.package-list .item:first-child{
|
.package-list .item0{
|
||||||
margin-top:0;
|
margin-top:0;
|
||||||
background-color: red;
|
|
||||||
}
|
}
|
||||||
.package-list .item .item-head{
|
.package-list .item .item-head{
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -111,7 +111,7 @@
|
|||||||
bottom:250rpx;
|
bottom:250rpx;
|
||||||
}
|
}
|
||||||
.package-list .item.no-btns::before{
|
.package-list .item.no-btns::before{
|
||||||
bottom:100rpx;
|
bottom:145rpx;
|
||||||
}
|
}
|
||||||
.package-list .item .name{
|
.package-list .item .name{
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
|
|||||||
@ -1,17 +1,60 @@
|
|||||||
// pages/product/list/index.js
|
import orderApi from '../../../api/order';
|
||||||
|
const app = getApp();
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
list:[],
|
||||||
|
pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false},
|
||||||
|
deliveryTimeType:orderApi.deliveryTimeType,
|
||||||
|
deliveryTimeTypeKV:orderApi.deliveryTimeTypeKV
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
app.getUserInfo().then((data)=>{
|
||||||
|
this.userInfo = data;
|
||||||
|
this.loadList();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
loadList(){
|
||||||
|
if(this.data.pager.loading||this.data.pager.loadAll){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
"pager.loading":true
|
||||||
|
});
|
||||||
|
let params = {
|
||||||
|
skip:this.data.pager.pageIndex*this.data.pager.limit,
|
||||||
|
limit:this.data.pager.limit,
|
||||||
|
user_id:this.userInfo.userid
|
||||||
|
}
|
||||||
|
orderApi.product.list(params).then((data)=>{
|
||||||
|
if(this.data.pager.pageIndex==0){
|
||||||
|
this.data.list = data.items;
|
||||||
|
}else{
|
||||||
|
this.data.list = this.data.list.concat(data.items);
|
||||||
|
}
|
||||||
|
this.data.pager.loading = false;
|
||||||
|
this.data.pager.pageIndex++;
|
||||||
|
this.data.pager.refreshTrigger = false;
|
||||||
|
if(data.items.length<this.data.pager.limit){
|
||||||
|
this.data.pager.loadAll = true;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list:this.data.list,
|
||||||
|
pager:this.data.pager
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
refreshList(){
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
<list-view class="product-list">
|
<list-view class="product-list" bind:refresh="refreshList"
|
||||||
<view class="item off">
|
bind:loadMore="loadList" refresher-triggered="{{pager.refreshTrigger}}"
|
||||||
|
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
|
||||||
|
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
|
||||||
|
<view class="item {{true?'':'off'}}" wx:for="{{list}}" wx:for-index="index">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<image class="avatar" src="https://dman-1311994147.cos.ap-chengdu.myqcloud.com/uploads/1/u=1903565391,3902265682&fm=253&fmt=auto&app=138&f=JPEG_27e027fc-fa01-42a8-821d-d2ba31706f86.webp?imageMogr2/thumbnail/800x800/format/webp"/>
|
<image class="avatar" src="{{item.optimized_image_url}}"/>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view class="name">家庭私厨烤串【鲜货】</view>
|
<view class="name">{{item.name}}</view>
|
||||||
<view class="tags">及时达丨配送</view>
|
<view class="tags">
|
||||||
<view class="money">9.9</view>
|
{{item.delivery_time_type_name}}丨{{item.delivery_type_name}}
|
||||||
|
</view>
|
||||||
|
<view class="money">{{item.product_price}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="stat">
|
<view class="stat">
|
||||||
@ -18,7 +23,7 @@
|
|||||||
<view class="key">累计收益(元)</view>
|
<view class="key">累计收益(元)</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="s-item">
|
<view class="s-item">
|
||||||
<view class="value">1/4</view>
|
<view class="value">{{item.sold_total}}/{{item.qty}}</view>
|
||||||
<view class="key">已售出/库存量</view>
|
<view class="key">已售出/库存量</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -26,28 +31,4 @@
|
|||||||
<button size="mini" type="primary" class="button">操作</button>
|
<button size="mini" type="primary" class="button">操作</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
|
||||||
<view class="info">
|
|
||||||
<image class="avatar" src="https://dman-1311994147.cos.ap-chengdu.myqcloud.com/uploads/1/u=1903565391,3902265682&fm=253&fmt=auto&app=138&f=JPEG_27e027fc-fa01-42a8-821d-d2ba31706f86.webp?imageMogr2/thumbnail/800x800/format/webp"/>
|
|
||||||
<view class="right">
|
|
||||||
<view class="name">家庭私厨烤串【鲜货】</view>
|
|
||||||
<view class="tags">及时达丨配送</view>
|
|
||||||
<view class="money">9.9</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="stat">
|
|
||||||
<view class="s-item">
|
|
||||||
<view class="value">0.0</view>
|
|
||||||
<view class="key">累计销售额 (元)</view>
|
|
||||||
</view>
|
|
||||||
<view class="s-item">
|
|
||||||
<view class="value">0.0</view>
|
|
||||||
<view class="key">累计收益(元)</view>
|
|
||||||
</view>
|
|
||||||
<view class="s-item">
|
|
||||||
<view class="value">1/4</view>
|
|
||||||
<view class="key">已售出/库存量</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</list-view>
|
</list-view>
|
||||||
@ -1,3 +1,6 @@
|
|||||||
|
.product-list{
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
.product-list .item{
|
.product-list .item{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin:20rpx;
|
margin:20rpx;
|
||||||
@ -29,11 +32,13 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: 140rpx;
|
gap: 18rpx;
|
||||||
|
min-height: 140rpx;
|
||||||
}
|
}
|
||||||
.product-list .item .name{
|
.product-list .item .name{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
}
|
}
|
||||||
.product-list .item .tags{
|
.product-list .item .tags{
|
||||||
color:#555;
|
color:#555;
|
||||||
@ -70,4 +75,8 @@
|
|||||||
padding:18rpx 52rpx;
|
padding:18rpx 52rpx;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
margin:0;
|
margin:0;
|
||||||
|
}
|
||||||
|
.actions .button.button-hover{
|
||||||
|
background-color: #000!important;
|
||||||
|
color:#fff!important;
|
||||||
}
|
}
|
||||||
77
pages/user/income/detail/index.js
Normal file
77
pages/user/income/detail/index.js
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
// pages/user/income/detail/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
detail:{}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
setDetail(detail){
|
||||||
|
this.setData({detail})
|
||||||
|
},
|
||||||
|
copyOrderId(){
|
||||||
|
wx.setClipboardData({
|
||||||
|
data:this.data.detail.transaction_id,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
back(){
|
||||||
|
wx.navigateBack();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
4
pages/user/income/detail/index.json
Normal file
4
pages/user/income/detail/index.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "收益详情"
|
||||||
|
}
|
||||||
22
pages/user/income/detail/index.wxml
Normal file
22
pages/user/income/detail/index.wxml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<view class="order-detail">
|
||||||
|
<view class="head">
|
||||||
|
<view class="name">{{detail.description}}</view>
|
||||||
|
<view class="money money-normal">{{detail.amount}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="spliter"></view>
|
||||||
|
<view class="info">
|
||||||
|
<view class="item">
|
||||||
|
<view class="key">交易单号</view>
|
||||||
|
<view class="value">{{detail.transaction_id}}</view>
|
||||||
|
<view class="tags" bind:tap="copyOrderId">
|
||||||
|
<view class="tag">复制</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="key">入账时间</view>
|
||||||
|
<view class="value">{{detail.create_time}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<button class="btn-back" type="primary" bind:tap="back">返回</button>
|
||||||
45
pages/user/income/detail/index.wxss
Normal file
45
pages/user/income/detail/index.wxss
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
.order-detail{
|
||||||
|
background-color: #fff;
|
||||||
|
margin:20rpx 0;
|
||||||
|
}
|
||||||
|
.order-detail .head{
|
||||||
|
text-align: center;
|
||||||
|
padding:70rpx 0;
|
||||||
|
}
|
||||||
|
.order-detail .name{
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
.order-detail .money{
|
||||||
|
font-size: 70rpx;
|
||||||
|
margin-top:32rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.order-detail .tags{
|
||||||
|
padding:20rpx;
|
||||||
|
}
|
||||||
|
.order-detail .tag{
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
.order-detail .spliter{
|
||||||
|
margin:0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-detail .info{
|
||||||
|
padding:4rpx 10rpx 36rpx 30rpx;
|
||||||
|
}
|
||||||
|
.order-detail .info .item{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top:12rpx;
|
||||||
|
}
|
||||||
|
.order-detail .info .item .key{
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.order-detail .info .item .value{
|
||||||
|
flex: 1;
|
||||||
|
margin-left:30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-back{
|
||||||
|
margin:30rpx!important;
|
||||||
|
}
|
||||||
113
pages/user/income/list/index.js
Normal file
113
pages/user/income/list/index.js
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
import userApi from '../../../../api/user';
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
list:[],
|
||||||
|
scrollViewHeight:0,
|
||||||
|
pager:{limit:10,loading:false,loadAll:false,pageIndex:0,refreshTrigger:false}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
const windowInfo = wx.getWindowInfo();
|
||||||
|
this.setData({
|
||||||
|
scrollViewHeight:windowInfo.windowHeight
|
||||||
|
});
|
||||||
|
this.loadList();
|
||||||
|
},
|
||||||
|
refreshList(){
|
||||||
|
this.data.pager.pageIndex = 0;
|
||||||
|
this.data.pager.loadAll = false;
|
||||||
|
this.setData({
|
||||||
|
pager:this.data.pager
|
||||||
|
});
|
||||||
|
this.loadList();
|
||||||
|
},
|
||||||
|
loadList(){
|
||||||
|
if(this.data.pager.loading||this.data.pager.loadAll){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.data.pager.loading = true;
|
||||||
|
this.setData({
|
||||||
|
pager:this.data.pager
|
||||||
|
});
|
||||||
|
userApi.incomeList({
|
||||||
|
skip:this.data.pager.pageIndex*this.data.pager.limit,
|
||||||
|
limit:this.data.pager.limit
|
||||||
|
}).then((data)=>{
|
||||||
|
this.data.pager.loading = false;
|
||||||
|
this.data.pager.loadAll = true;
|
||||||
|
this.data.pager.refreshTrigger = false;
|
||||||
|
this.setData({
|
||||||
|
list:data.items,
|
||||||
|
pager:this.data.pager
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
navToDetail(event){
|
||||||
|
const item = event.currentTarget.dataset.item;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/user/income/detail/index',
|
||||||
|
success:()=>{
|
||||||
|
const pages = getCurrentPages();
|
||||||
|
const currentPage = pages[pages.length-1];
|
||||||
|
currentPage.setDetail(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
6
pages/user/income/list/index.json
Normal file
6
pages/user/income/list/index.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"list-view":"/miniprogram_npm/@beefast-wxmp/list-view"
|
||||||
|
},
|
||||||
|
"navigationBarTitleText": "交易明细"
|
||||||
|
}
|
||||||
17
pages/user/income/list/index.wxml
Normal file
17
pages/user/income/list/index.wxml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<list-view bind:refresh="refreshList" bind:loadMore="loadList"
|
||||||
|
refresher-triggered="{{pager.refreshTrigger}}" class="income-list main"
|
||||||
|
show-load-more="{{!(list.length==0&&pager.loadAll)}}"
|
||||||
|
loading="{{pager.loading}}" load-all="{{pager.loadAll}}">
|
||||||
|
<view class="item" wx:for="{{list}}" wx:key="index" bind:tap="navToDetail"
|
||||||
|
data-item="{{item}}">
|
||||||
|
<view class="content">
|
||||||
|
<view class="title">{{item.description}}</view>
|
||||||
|
<view class="sub-title">{{item.create_time}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="money money-normal">{{item.amount}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="list-empty" wx:if="{{list.length==0&&pager.loadAll}}">
|
||||||
|
<image src="/assets/icon/list-empty.png" class="icon"/>
|
||||||
|
<view class="title">暂无记录</view>
|
||||||
|
</view>
|
||||||
|
</list-view>
|
||||||
25
pages/user/income/list/index.wxss
Normal file
25
pages/user/income/list/index.wxss
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
.income-list{
|
||||||
|
margin: 0 20rpx;
|
||||||
|
height:100vh;
|
||||||
|
}
|
||||||
|
.income-list .item{
|
||||||
|
background-color: #ffffff;
|
||||||
|
display: flex;
|
||||||
|
padding:40rpx 30rpx;
|
||||||
|
margin:20rpx 0;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
}
|
||||||
|
.income-list .item:first-child{
|
||||||
|
margin-top:0;
|
||||||
|
}
|
||||||
|
.income-list .item .content{
|
||||||
|
flex:1;
|
||||||
|
|
||||||
|
}
|
||||||
|
.income-list .item .title{
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
.income-list .item .sub-title{
|
||||||
|
margin-top:32rpx;
|
||||||
|
color: #888888;
|
||||||
|
}
|
||||||
@ -1,20 +1,47 @@
|
|||||||
// pages/user/index/index.js
|
const app = getApp();
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
userInfo:{},
|
||||||
|
appConfig:{}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
app.getUserInfo().then((data)=>{
|
||||||
|
this.setData({
|
||||||
|
userInfo:data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
app.getAppConfig().then((data)=>{
|
||||||
|
this.setData({
|
||||||
|
appConfig:data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navToAgreement(){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_user_agreement)}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
logout(){
|
||||||
|
wx.removeStorage({
|
||||||
|
key: 'accessToken',
|
||||||
|
success(){
|
||||||
|
app.globalData.accessToken = '';
|
||||||
|
app.globalData.userInfo = {};
|
||||||
|
wx.reLaunch({
|
||||||
|
url: '/pages/user/login/index',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
<view class="head">
|
<view class="head">
|
||||||
<view class="user">
|
<view class="user">
|
||||||
<image src="/assets/icon/logo.png" class="avatar"/>
|
<image src="{{userInfo.optimized_avatar||'/assets/icon/logo.png'}}" class="avatar"/>
|
||||||
<view class="name">仙人模斗</view>
|
<view class="name">{{userInfo.nickname||userInfo.auth_name}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="page-container actions">
|
<view class="page-container actions">
|
||||||
<view class="item">
|
<button class="item" open-type="contact">
|
||||||
<image class="icon" src="/assets/icon/user/service.png"/>
|
<image class="_icon" src="/assets/icon/user/service.png"/>
|
||||||
<view class="text">在线客服</view>
|
<view class="text">在线客服</view>
|
||||||
</view>
|
</button>
|
||||||
<navigator url="/pages/user/password/index" class="item">
|
<navigator url="/pages/user/password/index" class="item">
|
||||||
<image class="icon" src="/assets/icon/user/password.png"/>
|
<image class="_icon" src="/assets/icon/user/password.png"/>
|
||||||
<view class="text">修改密码</view>
|
<view class="text">修改密码</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<view class="item">
|
<view class="item" bind:tap="navToAgreement">
|
||||||
<image class="icon" src="/assets/icon/user/agreement.png"/>
|
<image class="_icon" src="/assets/icon/user/agreement.png"/>
|
||||||
<view class="text">用户协议</view>
|
<view class="text">用户协议</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -22,4 +22,4 @@
|
|||||||
<view class="">语音播报</view>
|
<view class="">语音播报</view>
|
||||||
<switch/>
|
<switch/>
|
||||||
</view>
|
</view>
|
||||||
<button class="btn-logout" type="primary">退出登录</button>
|
<button class="btn-logout" type="primary" bind:tap="logout">退出登录</button>
|
||||||
@ -30,8 +30,12 @@
|
|||||||
.actions .item{
|
.actions .item{
|
||||||
padding:0 50rpx;
|
padding:0 50rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
background-color: transparent;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin:0;
|
||||||
}
|
}
|
||||||
.actions .icon{
|
.actions ._icon{
|
||||||
width:56rpx;height:56rpx;
|
width:56rpx;height:56rpx;
|
||||||
}
|
}
|
||||||
.actions .text{
|
.actions .text{
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
const app = getApp();
|
const app = getApp();
|
||||||
import userApi from '../../../api/user';
|
import userApi from '../../../api/user';
|
||||||
|
import {validateForm} from '../../../utils/util';
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
verifyCodeTimer:null,
|
verifyCodeTimer:null,
|
||||||
@ -83,7 +84,7 @@ Page({
|
|||||||
},
|
},
|
||||||
save(){
|
save(){
|
||||||
if(this.data.modifyLoading)return;
|
if(this.data.modifyLoading)return;
|
||||||
const valid = app.validateForm(this.validator,this);
|
const valid = validateForm(this.validator,this);
|
||||||
if(valid.length==0){
|
if(valid.length==0){
|
||||||
if(this.data.password==this.data.rePassword){
|
if(this.data.password==this.data.rePassword){
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|||||||
@ -13,7 +13,13 @@
|
|||||||
"minified": true,
|
"minified": true,
|
||||||
"enhance": true,
|
"enhance": true,
|
||||||
"showShadowRootInWxmlPanel": true,
|
"showShadowRootInWxmlPanel": true,
|
||||||
"packNpmRelationList": [],
|
"packNpmManually": true,
|
||||||
|
"packNpmRelationList": [
|
||||||
|
{
|
||||||
|
"packageJsonPath": "./package.json",
|
||||||
|
"miniprogramNpmDistDir": "./"
|
||||||
|
}
|
||||||
|
],
|
||||||
"babelSetting": {
|
"babelSetting": {
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"disablePlugins": [],
|
"disablePlugins": [],
|
||||||
@ -22,7 +28,6 @@
|
|||||||
"compileWorklet": false,
|
"compileWorklet": false,
|
||||||
"uglifyFileName": false,
|
"uglifyFileName": false,
|
||||||
"uploadWithSourceMap": true,
|
"uploadWithSourceMap": true,
|
||||||
"packNpmManually": true,
|
|
||||||
"minifyWXSS": true,
|
"minifyWXSS": true,
|
||||||
"minifyWXML": true,
|
"minifyWXML": true,
|
||||||
"localPlugins": false,
|
"localPlugins": false,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user