Commit ce7c3bc6 authored by wanglongchao's avatar wanglongchao

feat:小程序开发

parent 924930ca
......@@ -21,7 +21,8 @@
"pages/search/index",
"pages/mine/about-us",
"pages/service/service-agreement",
"pages/mine/official-account"
"pages/mine/official-account",
"pages/web/web-page"
],
"usingComponents": {
"t-popup": "tdesign-miniprogram/popup/popup"
......
assets/mine/tp-about.png

1.8 KB | W: | H:

assets/mine/tp-about.png

1.49 KB | W: | H:

assets/mine/tp-about.png
assets/mine/tp-about.png
assets/mine/tp-about.png
assets/mine/tp-about.png
  • 2-up
  • Swipe
  • Onion skin
assets/mine/tp-address.png

2 KB | W: | H:

assets/mine/tp-address.png

1.39 KB | W: | H:

assets/mine/tp-address.png
assets/mine/tp-address.png
assets/mine/tp-address.png
assets/mine/tp-address.png
  • 2-up
  • Swipe
  • Onion skin
assets/mine/tp-customer.png

1.35 KB | W: | H:

assets/mine/tp-customer.png

1.36 KB | W: | H:

assets/mine/tp-customer.png
assets/mine/tp-customer.png
assets/mine/tp-customer.png
assets/mine/tp-customer.png
  • 2-up
  • Swipe
  • Onion skin
assets/mine/tp-push.png

932 Bytes | W: | H:

assets/mine/tp-push.png

1.23 KB | W: | H:

assets/mine/tp-push.png
assets/mine/tp-push.png
assets/mine/tp-push.png
assets/mine/tp-push.png
  • 2-up
  • Swipe
  • Onion skin
assets/mine/workbench.png

1.47 KB | W: | H:

assets/mine/workbench.png

721 Bytes | W: | H:

assets/mine/workbench.png
assets/mine/workbench.png
assets/mine/workbench.png
assets/mine/workbench.png
  • 2-up
  • Swipe
  • Onion skin
assets/order/upload-del.png

1 KB | W: | H:

assets/order/upload-del.png

967 Bytes | W: | H:

assets/order/upload-del.png
assets/order/upload-del.png
assets/order/upload-del.png
assets/order/upload-del.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -17,7 +17,7 @@ Component({
},
end_time: { //结束时间,设为整点
type: Number,
value: 22
value: 24
}
},
......@@ -31,21 +31,21 @@ Component({
//日期列表和时间列表
date_list: [],
time_list: [],
value: []
value: [],
isHref: false
},
lifetimes:{
attached(){
let minute = new Date().getMinutes()
let startTime = 8
let startTime = new Date().getHours() + 1
let href = false
if(minute > 20){
startTime = new Date().getHours() + 2
}else{
startTime = new Date().getHours() + 1
href = true
}
this.setData({
start_time: startTime
start_time: startTime,
isHref: href
})
console.log("---" + this.properties.start_time)
let start_day = this.ts_string(new Date().getTime())
let end_day = this.ts_string(new Date().setDate(new Date().getDate() + this.properties.range))
//获取日期列表
......@@ -97,7 +97,7 @@ Component({
getTimeList(start, end, step) {
let start_time = new Date()
//设置起始时间
start_time.setHours(start, 0, 0)
start_time.setHours(start, this.data.isHref ? 40 : 0, 0)
//设置结束时间
let end_time = new Date()
end_time.setHours(end, 0, 0)
......@@ -131,6 +131,34 @@ Component({
},
change: function (e) {
const val = e.detail.value
if(val[0] == 0){
let minute = new Date().getMinutes()
let startTime = new Date().getHours() + 1
let href = false
if(minute > 20){
href = true
}
this.setData({
start_time: startTime,
isHref: href
})
//获取时间列表
let time_list = this.getTimeList(this.properties.start_time, this.properties.end_time, this.properties.step)
this.setData({
time_list
})
}else{
this.setData({
start_time: 8,
isHref: false
})
//获取时间列表
let time_list = this.getTimeList(this.properties.start_time, this.properties.end_time, this.properties.step)
this.setData({
time_list
})
}
//val[0]表示选择的第一列序号,val[1]表示选择的第二列序号
let select = this.data.date_list[val[0]] + this.data.time_list[val[1]]
console.log(select)
......
......@@ -5,7 +5,7 @@
<view class="top-text top-left-color" hover-class="top-left-color-hover" catchtap="cancel">取消</view>
<view class="top-text top-right-color" hover-class="top-right-color-hover" catchtap="confirm">确定</view>
</view>
<picker-view style="width: 100%; height: 80%;" value="{{value}}" bindchange="change" catchtap="no">
<picker-view style="width: 100%; height: 80%;background: white;" value="{{value}}" bindchange="change" catchtap="no" immediate-change="{{true}}">
<picker-view-column>
<view wx:for="{{date_list}}" wx:key="date_list" class="item">{{item}}</view>
</picker-view-column>
......
......@@ -18,9 +18,20 @@ Component({
* 组件的初始数据
*/
data: {
canFixDisPatch: true
},
observers:{
'item': function(newItem){
var start_date = new Date(newItem.expectArrivalTime.replace(/-/g, "/"))
var end_date = new Date()
var ms = end_date.getTime() - start_date.getTime()
if(ms > 0){
this.setData({
canFixDisPatch: false
})
}
}
},
/**
* 组件的方法列表
*/
......@@ -36,6 +47,9 @@ Component({
},
dispatchAction(){
this.triggerEvent("dispatchAction",{id: this.data.item.id})
},
fixDispatchAction(){
this.triggerEvent("fixDispatchAction",{id: this.data.item.id})
}
}
})
......@@ -8,7 +8,7 @@
<view class="order-no">订单编号:{{item.orderNo}}</view>
<view class="line1" />
<view class="group-2">
<image class="group-image" src="{{item.subclassImg}}"/>
<image class="group-image" src="{{item.subclassImg}}" mode="aspectFill"/>
<view class="group-2-column">
<view class="c1">{{item.serviceName}}</view>
<view class="c2">x{{item.num}}</view>
......@@ -28,10 +28,11 @@
<image class="mini-icon" src="/assets/order/order-user.png" />
<view class="time-text">{{item.name}}</view>
</view>
<view class="group-3" wx:if="{{item.orderStatus == 1 || item.orderStatus == 3 || item.orderStatus == 4|| item.orderStatus == 5 || roleType == 1}}">
<view class="group-3" wx:if="{{(item.orderStatus == 1 || item.orderStatus == 3 || item.orderStatus == 4|| item.orderStatus == 5) && (roleType == 1 || roleType == 2)}}">
<view style="flex: 1;" />
<view class="cp-1" wx:if="{{item.orderStatus == 1 || item.orderStatus == 2}}" catchtap="dealAction">处理</view>
<view class="cp-2" wx:if="{{item.orderStatus == 1 || item.orderStatus == 3}}" catchtap="cancelAction">取消订单</view>
<view class="cp-3" wx:if="{{item.orderStatus == 5 && canFixDisPatch}}" catchtap="fixDispatchAction">重新派单</view>
<view class="cp-1" wx:if="{{item.orderStatus == 4}}" catchtap="dispatchAction">派单</view>
<view class="cp-1" wx:if="{{item.orderStatus == 5}}" catchtap="finishAction">完成</view>
</view>
......
......@@ -92,13 +92,14 @@
}
.time-text {
height: 56rpx;
min-height: 36rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #3E3E3E;
line-height: 56rpx;
line-height: 36rpx;
margin-left: 10rpx;
padding: 10rpx 0;
}
.group-3 {
......@@ -128,6 +129,7 @@
font-weight: 400;
color: #FFFFFF;
line-height: 60rpx;
border: 1px solid #437CFD;
text-align: center;
margin-left: 20rpx;
}
......@@ -155,13 +157,28 @@
text-align: center;
}
.flex-row{
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
}
.mini-icon{
.mini-icon {
width: 34rpx;
height: 34rpx;
flex-shrink: 0;
}
.cp-3 {
width: 164rpx;
height: 60rpx;
background: #FFFFFF;
border-radius: 37rpx;
border: 1px solid #437CFD;
line-height: 60rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #437CFD;
text-align: center;
}
\ No newline at end of file
......@@ -3,6 +3,7 @@
const ApiAuth = '/weixin/login'
//服务列表
const ApiService = '/category/list'
const ApiServiceFind = '/category/find'
//首页
const ApiHome = '/common/home'
//服务详情
......@@ -61,6 +62,8 @@ const ApiRevaluator = '/order/revaluation'
const ApiWorker = '/worker/get'
//派单
const ApiDispatch = '/order/dispatch'
//修改派单
const ApiReDispatch = '/order/redispatch'
//搜索服务
const ApiSearch = '/category/list'
//关于我们
......@@ -71,7 +74,10 @@ const ApiMpInfo = '/common/mp-info'
const ApiWXCode = '/weixin/qr-code'
//获取用户身份
const ApiGetRoleType = '/user/role-type'
//管理端订单数量
const ApiOrderNum = '/order/todo-detail'
//获取联系方式
const ApiContact = '/common/contact'
module.exports = {
ApiAuth,
......@@ -109,5 +115,9 @@ module.exports = {
ApiAboutUs,
ApiMpInfo,
ApiWXCode,
ApiGetRoleType
ApiGetRoleType,
ApiOrderNum,
ApiReDispatch,
ApiServiceFind,
ApiContact
}
\ No newline at end of file
......@@ -10,9 +10,9 @@ const BASE_TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NTg5MDY2NjE
const app = getApp()
const HOST = 'http://172.16.1.55:9261'
// const HOST = 'http://172.16.1.55:9261'
// const HOST = 'https://chengshijiangren.antaikeji.top'
const HOST = 'https://mini-api.chengshijiangren.com'
......
......@@ -34,13 +34,13 @@
<view bindtap="changeCounty" class="pop-tab {{countyName.length > 0 ? 'pop-tab-selected' : ''}}">{{countyName.length > 0 ? countyName : '区/县'}}</view>
<view bindtap="changeStreet" class="pop-tab {{streetName.length > 0 ? 'pop-tab-selected' : ''}}">{{streetName.length > 0 ? streetName : '街道/镇'}}</view>
</view>
<scroll-view class="pop-sc" wx:if="{{currentPos == 0}}">
<scroll-view class="pop-sc" wx:if="{{currentPos == 0}}" scroll-y>
<view class="pop-sc-item" wx:for="{{cityList}}" wx:key="*this" data-index="{{index}}" bindtap="chooseCity">{{item.name}}</view>
</scroll-view>
<scroll-view class="pop-sc" wx:if="{{currentPos == 1}}">
<scroll-view class="pop-sc" wx:if="{{currentPos == 1}}" scroll-y>
<view class="pop-sc-item" wx:for="{{countyList}}" wx:key="*this" data-index="{{index}}" bindtap="chooseCounty">{{item.name}}</view>
</scroll-view>
<scroll-view class="pop-sc" wx:if="{{currentPos == 2}}">
<scroll-view class="pop-sc" wx:if="{{currentPos == 2}}" scroll-y>
<view class="pop-sc-item" wx:for="{{streetList}}" wx:key="*this" data-index="{{index}}" bindtap="chooseStreet">{{item.name}}</view>
</scroll-view>
</view>
......
......@@ -27,6 +27,7 @@ Page({
showPoster: false,
base64Data: null,
canvas: null,
visible: false
},
/**
......@@ -78,6 +79,16 @@ Page({
noticeIndex: e.detail.current + 1
})
},
linkAction(e){
let index = e.currentTarget.dataset.index
let type = this.data.data.bannerList[index].type
let mpArticle = this.data.data.bannerList[index].mpArticle
if(type == 2 && mpArticle.length > 0){
wx.navigateTo({
url: '/pages/web/web-page?url=' + encodeURIComponent(mpArticle),
})
}
},
serviceItemClick(e) {
let index = e.currentTarget.dataset.index
let p1 = index.split("-")[0]
......@@ -231,4 +242,9 @@ Page({
showPoster: false
})
},
showConcat(){
this.setData({
visible: true
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"usingComponents": {
},
"navigationStyle": "custom"
}
\ No newline at end of file
<!--pages/home/home.wxml-->
<view class="flex-column">
<view class="header-wrapper">
<swiper class="swiper-class" autoplay>
<swiper class="swiper-class" autoplay circular>
<swiper-item class="swiper-item" wx:for="{{data.bannerList}}" wx:key="*this">
<image class="swiper-item" src="{{item.url}}" mode="aspectFill" />
<image class="swiper-item" src="{{item.url}}" mode="aspectFill" data-index="{{index}}" bindtap="linkAction"/>
</swiper-item>
</swiper>
<view class="search-wrapper" style="top:{{headTop}}px" bindtap="searchAction">
......@@ -38,7 +38,7 @@
</view>
<view class="item-content-wrapper">
<view class="item-content" wx:for="{{item.children}}" wx:for-index="idx" wx:for-item="child" wx:key="*this" data-index="{{index}}-{{idx}}" bindtap="serviceItemClick">
<image class="item-thumb" src="{{child.detailImg}}" mode="aspectFill"/>
<image class="item-thumb" src="{{child.detailImg}}" />
<view class="item-name">{{child.serviceName}}</view>
<view class="name-subtitle">{{child.description}}</view>
</view>
......@@ -47,6 +47,8 @@
</view>
</view>
<image class="bottomImage" src="{{data.bottomImage}}" wx:if="{{data.bottomImage}}"/>
<image bindtap="getQrcode" class="poster" src="/assets/main/create-poster.png" wx:if="{{roleType == 3}}"/>
<button open-type="contact" wx:if="{{roleType == 0}}">
......
......@@ -399,3 +399,10 @@ page {
border-radius: 80rpx;
}
.bottomImage{
width: 690rpx;
margin: 0 auto;
display: flex;
margin-bottom: 20rpx;
}
\ No newline at end of file
// pages/mine/mine.js
import { ApiUserInfo } from '../../http/api'
import { ApiUserInfo, ApiContact } from '../../http/api'
import { wxGet } from '../../http/network'
import {jumpPage} from '../../utils/common'
......@@ -12,7 +12,8 @@ Page({
*/
data: {
isLogin: app.globalData.token.length > 0,
data: null
data: null,
phone: ""
},
/**
......@@ -28,6 +29,11 @@ Page({
if(this.data.isLogin){
this.getUserInfo()
}
wxGet(ApiContact).then(res=>{
this.setData({
phone: res.data
})
})
},
getUserInfo(){
wxGet(ApiUserInfo).then(res=>{
......@@ -75,5 +81,10 @@ Page({
wx.navigateTo({
url: '../workbench/order-list',
})
},
callPhone(){
wx.makePhoneCall({
phoneNumber: this.data.phone,
})
}
})
\ No newline at end of file
......@@ -58,6 +58,11 @@
<view class="tp-text">客服中心</view>
<image class="arrow" style="margin-right:0rpx" src="/assets/mine/urban-arrow-gray.png"/>
</button>
<view class="tp-item" bindtap="callPhone">
<image class="tp-icon" src="/assets/mine/tp-phone.png"/>
<view class="tp-text">联系电话</view>
<image class="arrow" style="margin-right:0rpx" src="/assets/mine/urban-arrow-gray.png"/>
</view>
<view class="tp-item" bindtap="addressPage">
<image class="tp-icon" src="/assets/mine/tp-address.png"/>
<view class="tp-text">地址信息</view>
......
......@@ -27,7 +27,8 @@ Page({
admin: false,
overlayVisible: false,
price: null,
roleType: app.globalData.roleType
roleType: app.globalData.roleType,
canFixDisPatch: true
},
/**
......@@ -38,7 +39,8 @@ Page({
let admin = options.admin
if (admin) {
this.setData({
admin: true
admin: true,
roleType: app.globalData.roleType
})
}
this.setData({
......@@ -48,6 +50,15 @@ Page({
},
getData() {
wxGet(ApiOrderDetail + this.data.id).then(res => {
var start_date = new Date(res.data.expectArrivalTime.replace(/-/g, "/"))
var end_date = new Date()
var ms = end_date.getTime() - start_date.getTime()
if(ms > 0){
this.setData({
canFixDisPatch: false
})
}
this.setData({
data: res.data
})
......@@ -188,13 +199,25 @@ Page({
}
})
},
fixDispatchAction(){
let that = this
wx.navigateTo({
url: '../process/dispatch?fix=1&id=' + this.data.id,
events: {
updateData: function (e) {
let eventChannel = that.getOpenerEventChannel()
eventChannel.emit("updateData")
that.getData()
}
}
})
},
serviceAction(){
wx.switchTab({
url: '/pages/service/service',
})
},
finishAction(e){
let id = e.detail.orderId
let that = this
wx.showModal({
title: "温馨提示",
......@@ -203,15 +226,18 @@ Page({
confirmColor: "#437CFD",
success(e) {
if (e.confirm) {
that.finishWork(id)
that.finishWork()
}
}
})
},
finishWork(id){
wxPost(ApiFinishOrder,{"id":id}).then(res=>{
finishWork(){
let that = this
wxPost(ApiFinishOrder,{"id":this.data.id}).then(res=>{
showToast("操作成功")
this.getData(true)
let eventChannel = that.getOpenerEventChannel()
eventChannel.emit("updateData")
that.getData()
})
}
})
\ No newline at end of file
......@@ -127,6 +127,7 @@
<view class="gujia" wx:if="{{data.orderStatus == 1 && roleType == 1}}" bindtap="choosegujia">现场估价</view>
<view class="gujia" wx:if="{{data.orderStatus == 2 && roleType == 1}}" bindtap="fixgujia">修改估价员</view>
<view class="gujia" wx:if="{{(data.orderStatus == 1 || data.orderStatus == 3) && roleType == 1}}" bindtap="cancelAction">取消订单</view>
<view class="gujia" wx:if="{{data.orderStatus == 5 && roleType == 1 && canFixDisPatch}}" bindtap="fixDispatchAction">重新派单</view>
<view class="cp-1" wx:if="{{data.orderStatus == 5 && roleType == 1}}" bindtap="finishAction">完成服务</view>
</view>
</view>
......
......@@ -176,9 +176,16 @@ Page({
showToast("请勾选我已阅读协议")
return
}
let that = this
wx.requestSubscribeMessage({
tmplIds: ["ygS2cgt5SrFQ8yKe6VzF3tMYTTkbGDSHwXiJRPlExJE","AFA-i9A_MrzxQzogJJot3EXY4j5bfOe4WFpl9VvA8Jg"],
complete(e){
that.orderRequest()
}
})
},
orderRequest(){
let date = this.data.expectArrivalTime
let param = {
addressId: this.data.addressId,
demandDesc: this.data.demandDesc,
......@@ -202,7 +209,7 @@ Page({
serviceName: that.data.serviceInfo.serviceName,
num: that.data.num
}
wx.navigateTo({
wx.redirectTo({
url: './order-result?data=' + encodeURIComponent(JSON.stringify(data)),
})
}
......
const { ApiDispatch } = require("../../http/api")
const { ApiDispatch, ApiReDispatch } = require("../../http/api")
const { wxPost } = require("../../http/network")
// pages/process/dispatch.js
......@@ -17,6 +17,7 @@ Page({
*/
onLoad(options) {
this.id = options.id
this.fix = options.fix
},
chooseAction(){
let that = this
......@@ -42,8 +43,11 @@ Page({
return
}
let that = this
wxPost(ApiDispatch,{
let url = ApiDispatch
if(this.fix){
url = ApiReDispatch
}
wxPost(url,{
hostId: this.data.valuator.id,
id: this.id,
remark: this.data.remark
......
......@@ -5,7 +5,7 @@
<input class="search-input" placeholder="请输入关键字搜索人员" placeholder-style="color:#9B9B9B" model:value="{{name}}" bindinput="nameInputChange"/>
</view>
</view>
<scroll-view class="sc-list">
<scroll-view class="sc-list" scroll-y>
<view class="user-item" wx:for="{{list}}" wx:key="*this" bindtap="chooseAction" data-index="{{index}}">
<view class="user-info-wrapper">
<view class="flex-column flex-1">
......@@ -16,7 +16,7 @@
</view>
<view class="time-wrapper" wx:if="{{item.assignTime.length > 0}}">
<view class="time-content">
<view class="time-item">已派时间:2021.07.30 09:00</view>
<view class="time-item" wx:for="{{item.assignTime}}" wx:key="*this">已派时间:{{item}}</view>
</view>
</view>
</view>
......
// pages/search/index.js
import api, { ApiSearch } from '../../http/api'
import api, { ApiServiceFind } from '../../http/api'
import {
wxGet
} from '../../http/network'
......@@ -55,7 +55,7 @@ Page({
})
wx.setStorageSync('keywordList', keywordList)
wxGet(ApiSearch,{"keyWord":keyword}).then((res)=>{
wxGet(ApiServiceFind,{"keyWord":keyword}).then((res)=>{
that.setData({
list: res.data
})
......@@ -77,10 +77,11 @@ Page({
this.bindconfirm()
},
itemClick(e){
let id = e.currentTarget.dataset.id
app.globalData.cateId = id
wx.switchTab({
url: '/pages/service/service',
let index = e.currentTarget.dataset.index
let id = this.data.list[index].id
let serviceName = this.data.list[index].serviceName
wx.navigateTo({
url: `../service/service-detail?id=${id}&serviceName=${serviceName}`
})
}
})
\ No newline at end of file
......@@ -18,7 +18,7 @@
</view>
<view class="search-result">
<view class="cate-item" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="itemClick">{{item.serviceName}}</view>
<view class="cate-item" wx:for="{{list}}" wx:key="index" data-index="{{index}}" bindtap="itemClick">{{item.serviceName}}</view>
</view>
<image class="empty" src="/assets/project/empty.png" wx:if="{{list.length == 0}}"/>
</view>
\ No newline at end of file
<!--pages/service/service-detail.wxml-->
<view class="content-wrapper">
<image class="thumb-img" src="{{data.detailImg}}" mode="aspectFill"/>
<image class="thumb-img" src="{{data.detailImg}}" />
<view class="name-info">
<view class="name">{{data.serviceName}}</view>
<view class="subtitle">{{data.description}}</view>
......@@ -13,7 +13,7 @@
<image class="kf-icon" src="/assets/service/urban-kf.png"/>
<view class="kf-text">客服</view>
</button>
<view class="sub" bindtap="orderAction">立即预约</view>
<view class="sub" bindtap="orderAction">预约估价</view>
</view>
</view>
......@@ -37,7 +37,7 @@
.thumb-img {
width: 750rpx;
height: 360rpx;
height: 500rpx;
}
......
......@@ -70,15 +70,27 @@ page {
}
.cate-right-item {
width: 152rpx;
width: 154rpx;
height: 192rpx;
background: #FFFFFF;
border: 1px solid #ECECEC;
display: inline-block;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 0 14rpx 60rpx 20rpx;
position: relative;
}
.cate-right-item::after{
position: absolute;
content: '';
border:1px solid #ECECEC;
width: 200%;
height: 200%;
top: 0;
left: 0;
transform: scale(0.5);
transform-origin: 0 0;
}
.cate-image {
......
// pages/web/web-page.js
Page({
/**
* 页面的初始数据
*/
data: {
url: ""
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let url = decodeURIComponent(options.url)
this.setData({
url
})
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/web/web-page.wxml-->
<web-view src="{{url}}"></web-view>
/* pages/web/web-page.wxss */
\ No newline at end of file
const {
ApiManagerOrderList, ApiOrderCancel, ApiFinishOrder
ApiManagerOrderList, ApiOrderCancel, ApiFinishOrder, ApiOrderNum
} = require("../../http/api")
const {
wxPost
wxPost, wxGet
} = require("../../http/network")
const { showToast } = require("../../utils/common")
......@@ -20,7 +20,10 @@ Page({
triggered: false,
date: null,
keyWord: '',
roleType: app.globalData.roleType
roleType: 0,
orderNum1:0,
orderNum3:0,
orderNum4:0
},
/**
......@@ -28,6 +31,9 @@ Page({
*/
onLoad(options) {
page = 1
this.setData({
roleType: app.globalData.roleType
})
this.getData(true)
},
bindscrolltolower(e) {
......@@ -47,6 +53,7 @@ Page({
getData(refresh) {
if (refresh) {
page = 1
this.getOrderNum()
}else{
page += 1
}
......@@ -176,6 +183,7 @@ Page({
},
dispatchAction(e){
let id = e.detail.id
let that = this
wx.navigateTo({
url: '/pages/process/dispatch?id=' + id,
events: {
......@@ -184,5 +192,26 @@ Page({
}
}
})
},
getOrderNum(){
wxGet(ApiOrderNum).then(res=>{
this.setData({
orderNum1: res.data["1"],
orderNum3: res.data["3"],
orderNum4: res.data["4"]
})
})
},
fixDispatchAction(e){
let id = e.detail.id
let that = this
wx.navigateTo({
url: '/pages/process/dispatch?fix=1&id=' + id,
events: {
updateData: function (e) {
that.getData(true)
}
}
})
}
})
\ No newline at end of file
......@@ -18,14 +18,17 @@
</view>
<view class="tab-item" bindtap="statusChange" data-index="1">
<view class="tab-text">待受理</view>
<view class="num-badge" wx:if="{{orderNum1 > 0}}">{{orderNum1}}</view>
<view class="bottom-line" wx:if="{{orderStatus == 1}}" />
</view>
<view class="tab-item" bindtap="statusChange" data-index="3">
<view class="tab-text">待支付</view>
<view class="num-badge" wx:if="{{orderNum3 > 0}}">{{orderNum3}}</view>
<view class="bottom-line" wx:if="{{orderStatus == 3}}" />
</view>
<view class="tab-item" bindtap="statusChange" data-index="4">
<view class="tab-text">待派单</view>
<view class="num-badge" wx:if="{{orderNum4 > 0}}">{{orderNum4}}</view>
<view class="bottom-line" wx:if="{{orderStatus == 4}}" />
</view>
<view class="tab-item" bindtap="statusChange" data-index="5">
......@@ -40,5 +43,5 @@
<empty-view imageName="/assets/order/order-empty.png" wx:if="{{list.length == 0}}">
</empty-view>
<scroll-view wx:else scroll-y class="sc-list" refresher-enabled="{{true}}" refresher-threshold="{{100}}" refresher-default-style="black" refresher-triggered="{{triggered}}" bindrefresherpulling="onPulling" bindrefresherrefresh="onRefresh" bindrefresherrestore="onRestore" bindrefresherabort="onAbort" bindscrolltolower="bindscrolltolower">
<manager-order-item wx:for="{{list}}" wx:key="index" item="{{item}}" roleType="{{roleType}}" bindtap="itemClickAction" data-id="{{item.id}}" bind:dealAction="dealAction" bind:cancelAction="cancelAction" bind:finishAction="finishAction" bind:dispatchAction="dispatchAction"></manager-order-item>
<manager-order-item wx:for="{{list}}" wx:key="index" item="{{item}}" roleType="{{roleType}}" bindtap="itemClickAction" data-id="{{item.id}}" bind:dealAction="dealAction" bind:cancelAction="cancelAction" bind:finishAction="finishAction" bind:dispatchAction="dispatchAction" bind:fixDispatchAction="fixDispatchAction"></manager-order-item>
</scroll-view>
\ No newline at end of file
......@@ -13,6 +13,23 @@
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.num-badge {
width: 32rpx;
height: 32rpx;
font-size: 20rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: #ED474A;
line-height: 32rpx;
text-align: center;
position: absolute;
right: 0;
top: 20rpx;
border-radius: 16rpx;
}
.tab-text {
......@@ -31,7 +48,7 @@
border-radius: 2rpx;
}
.sc-list{
.sc-list {
width: 100%;
height: calc(100vh - 120rpx - 96rpx);
padding-top: 10rpx;
......@@ -72,7 +89,7 @@
margin-left: 20rpx;
}
.picker{
.picker {
flex: 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment