Commit ce7c3bc6 authored by wanglongchao's avatar wanglongchao

feat:小程序开发

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