Commit da86b864 authored by 郭晓清's avatar 郭晓清

Merge branch 'master' of https://git.banshouhui.com/lijundan/self-support

# Conflicts:
#	src/common/api/order.js
parents 5c376c83 4448314e
...@@ -5,8 +5,8 @@ const UNI_APP = { ...@@ -5,8 +5,8 @@ const UNI_APP = {
// banshou: 'https://m.banshou.com', //扳手app // banshou: 'https://m.banshou.com', //扳手app
}, },
systemUrl: { systemUrl: {
// apiUrl: 'http://192.168.1.22', //java端域名请求头 apiUrl: 'http://192.168.1.22', //java端域名请求头
apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头 // apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
}, },
qn_base_url: 'https://qn-static.banshouhui.com/self-support/' qn_base_url: 'https://qn-static.banshouhui.com/self-support/'
} }
......
# self-support # self-support
## Project setup ### 项目设置
``` ```
npm install -g mirror-config-china --registry=http://registry.npm.taobao.org npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install npm install
``` ```
### Compiles and hot-reloads for development
```
### 开发环境编译和热重装
```bash
npm run dev:mp-weixin // 运行dev环境 npm run dev:mp-weixin // 运行dev环境
``` ```
### Compiles and minifies for production
```
### 生产环境编译和压缩
```bash
npm run build:mp-weixin // 运行生产环境 npm run build:mp-weixin // 运行生产环境
``` ```
### 公共组件: ### 公共组件:
[图片上传参考](https://ext.dcloud.net.cn/plugin?id=822) [图片上传参考](https://ext.dcloud.net.cn/plugin?id=822)
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
### 自定义配置
查看 [配置参考](https://cli.vuejs.org/config/)
### Easycom [组件模式](https://uniapp.dcloud.io/collocation/pages?id=easycom)
只要组件安装在项目的components目录下,并符合components/组件名称/组件名称.vue目录结构。就可以不用引用、注册,直接在页面中使用
### Mock接口使用
1. 项目根目录下找到 *.env.js* 文件,查看参数:NODE_ENV值
2. 找到对应NODE_ENV值的 .env文件,如:.env.dev.js
3. 添加mock请求头,注释真实请求头,参考下面例子:
```js
const UNI_APP = {
ucenterUrl: {
apiUrl: 'http://192.168.1.46', //php端域名请求头
xueUrl: 'http://192.168.1.46:8088', //学院
// banshou: 'https://m.banshou.com', //扳手app
},
systemUrl: {
// apiUrl: 'http://192.168.1.22', //java端域名请求头
apiUrl: 'http://apidoc.banshouhui.com:3000/mock/31', // mock端域名请求头
},
qn_base_url: 'https://qn-static.banshouhui.com/self-support/'
}
module.exports = UNI_APP;
```
...@@ -157,9 +157,9 @@ export default { ...@@ -157,9 +157,9 @@ export default {
}) })
}, },
setUserData(userInfo) { setUserData(userInfo) {
if (userInfo && userInfo.token) { if (userInfo && userInfo.token) {
// 如果已经登录则直接获取相关信息 // 如果已经登录则直接获取相关信息
this.$u.vuex('vuex_token', userInfo.token); this.$u.vuex('vuex_token',"RTOKENf22df8e7b9db396f560e8f61bebceea2000cb05c" ); // userInfo.token
this.$u.vuex('vuex_user', userInfo); this.$u.vuex('vuex_user', userInfo);
this.$u.vuex('vuex_wx_uid', userInfo.wxopenid); this.$u.vuex('vuex_wx_uid', userInfo.wxopenid);
} else { } else {
......
...@@ -35,6 +35,10 @@ let orderApiFun = function(vm){ ...@@ -35,6 +35,10 @@ let orderApiFun = function(vm){
/* 过程反馈查询接口 */ /* 过程反馈查询接口 */
let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params) let feedbackConfig = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rst/order/v2/getFeedBack/' + vm.vuex_token, params)
/* 预约+过程反馈 接口 */
let traceAndAppointment = async (params = {}, orderId) => await vm.$u.post(`/wxh-worker-rest/rest/order/traceAndAppointment/trace/V2/`+vm.vuex_token+`/`+orderId, params)
/** /**
* 查询工单操作记录列表接口 * 查询工单操作记录列表接口
*/ */
...@@ -78,6 +82,7 @@ let orderApiFun = function(vm){ ...@@ -78,6 +82,7 @@ let orderApiFun = function(vm){
orderGan, orderGan,
maintainWorkerCheckin, maintainWorkerCheckin,
feedbackConfig, feedbackConfig,
traceAndAppointment,
orderStandard, orderStandard,
saveImage, saveImage,
getWatermark getWatermark
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="select-date"> <view class="select-date">
<view class="u-flex u-row-between "> <view class="u-flex u-row-between ">
<view class="txt">选择日期</view> <view class="txt">选择日期</view>
<view class="txt active">2021.04.21</view> <view class="txt active">{{ dateList[currentDay].day }}</view>
</view> </view>
<view class="u-m-t-30 u-flex u-row-between date-list"> <view class="u-m-t-30 u-flex u-row-between date-list">
<view :class="{'date-item':true,'active':index===currentDay}" <view :class="{'date-item':true,'active':index===currentDay}"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<view class="select-time u-p-t-50"> <view class="select-time u-p-t-50">
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<view class="txt">选择时间</view> <view class="txt">选择时间</view>
<view class="txt active">14:00-16:00</view> <view class="txt active">{{ timeList[currentTime] }}</view>
</view> </view>
<view class="u-p-t-30 u-flex u-flex-wrap time-list"> <view class="u-p-t-30 u-flex u-flex-wrap time-list">
<view @click="timeChange(item,index,timeList)" <view @click="timeChange(item,index,timeList)"
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
weekDay: '周三', weekDay: '周三',
day: '21' day: '21'
}, ], }, ],
timeList: ['06:00-08:00', '06:00-08:00', '06:00-08:00', '06:00-08:00', '06:00-08:00', '06:00-08:00', timeList: ['06:00-08:00', '08:00-10:00', '10:00-12:00', '12:00-14:00', '14:00-16:00', '16:00-18:00',
'06:00-08:00', '06:00-08:00', '06:00-08:00' '18:00-20:00', '20:00-22:00', '22:00-24:00'
] ]
} }
}, },
......
<template>
<view class="no-order-view">
<image class="no-order-image" :src="wudingdanImage"></image>
<text>当前暂无订单</text>
</view>
</template>
<script>
export default {
computed: {
wudingdanImage() {
return process.uniEnv.qn_base_url + 'wudingdan.png'
}
}
}
</script>
<style lang="scss" scoped>
.no-order-view {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666666;
font-size: 28rpx;
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
min-height: 460rpx;
.no-order-image {
width: 374rpx;
height: 218rpx;
margin-top: 60rpx;
margin-bottom: 20rpx;
}
}
</style>
<template>
<u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx"
:mask-close-able="false">
<view class="order-pop-view">
<view class="order-pop-title">
<text>{{title}}</text>
</view>
<view class="line-view" />
<view class="order-pop-text">
<text>{{message}}</text>
</view>
<view class="order-pop-btn-view">
<u-button :custom-style="customStyleCancel" hover-class="none" shape="circle" type="primary"
@click="handleClickCancel">
取消
</u-button>
<u-button :custom-style="customStyleSave" shape="circle" type="primary" @click="handleClickSure">
确定
</u-button>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
visible: Boolean,
title: String,
message: String,
},
data() {
return {}
},
computed: {
customStyleCancel() {
return {
'background-color': '#D1D4D4',
'width': '300rpx',
'height': '104rpx',
'background-color': 'transparent',
'border': '1px solid #2272FF',
'color': '#2272FF',
'font-weight': 'bold',
'font-size': '32rpx',
}
},
customStyleSave() {
return {
'background-color': '#2272FF',
'width': '300rpx',
'height': '104rpx',
'font-weight': 'bold',
'font-size': '32rpx',
'margin-left': '30rpx'
}
}
},
methods: {
changeVisibleValue(val) {
this.$emit('update:visible', val)
},
handleClickCancel() {
this.changeVisibleValue(false)
this.$emit('cancel')
},
handleClickSure() {
this.$emit('click')
}
}
}
</script>
<style lang="scss" scoped>
.order-pop-view {
padding: 30rpx;
.order-pop-title {
font-size: 40rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
text-align: center;
color: #333333;
}
.order-pop-text {
color: #999999;
text-align: center;
margin-top: 40rpx;
font-size: 28rpx;
margin-bottom: 260rpx;
}
.line-view {
background-color: #F4F5F7;
height: 2rpx;
width: 100%;
}
.order-pop-btn-view {
display: flex;
position: absolute;
bottom: 50rpx;
align-items: center;
justify-content: center;
}
}
</style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
src="/static/photo/icon-switch.png"></cover-image> src="/static/photo/icon-switch.png"></cover-image>
<cover-image @click="setCameraInfo('flash')" class="icon" mode="aspectFit" <cover-image @click="setCameraInfo('flash')" class="icon" mode="aspectFit"
:src="'/static/photo/icon-light-' + cameraInfo.flash +'.png'"></cover-image> :src="'/static/photo/icon-light-' + cameraInfo.flash +'.png'"></cover-image>
<cover-image @click="changeType(3)" class="icon" mode="aspectFit" <cover-image v-if="currentItem.system_id" @click="changeType(3)" class="icon" mode="aspectFit"
src="/static/photo/icon-setting.png"></cover-image> src="/static/photo/icon-setting.png"></cover-image>
</cover-view> </cover-view>
</cover-view> </cover-view>
...@@ -58,18 +58,13 @@ ...@@ -58,18 +58,13 @@
export default { export default {
props: { props: {
currentItem: { // 对应的规范item currentItem: { // 对应的规范item
type: Object,
default () { default () {
return { return {
_id: '', // 规格ID _id: '', // 规格ID
system_id: '', // 系统ID system_id: '', // 系统ID
brand_id: '', // 品牌ID brand_id: '', // 品牌ID
classify_id: '', // 分类ID classify_id: '', // 分类ID
images: [ // 拍照要求示意图 images: [], // 拍照要求示意图
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png'
],
main_point: [] // 要点 main_point: [] // 要点
} }
} }
...@@ -115,7 +110,8 @@ ...@@ -115,7 +110,8 @@
}, },
created(e) { created(e) {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
getApp().trackPage('拍照页') getApp().trackPage('拍照页')
photo.allImages = []
// this.ctx = uni.createCameraContext(); // this.ctx = uni.createCameraContext();
this.updateTime() this.updateTime()
this.getLocation() this.getLocation()
......
## 相机组件使用说明
```
该组件仅用于拍照后返回图片,与业务不关联,目前最多一次可以拍10张图片
```
### 因为相机组件需要全屏展示,所以加载该组件需要在当前页面隐藏顶部导航栏和底部的TabBar
```
uni.hideTabBar()
```
### 然后加上自定义导航栏,通过切换状态takeStatus来显示和隐藏
```
<u-navbar v-if="!takeStatus" :is-back="false" :title-size="26" title-color="#000" title="我的"></u-navbar>
```
## API
### Props
| 属性名 | 类型 | 默认值 | 可选值 | 说明 |
| :-: | :-: | :-: | :-: | :-: |
| currentItem | Object | - | - | 对应的规范数据,用于获取示意图和水印,以及保存图片所需的ID **格式见下文** |
### currentItem 格式
```json
{
_id: '', // 保存图片时需要
system_id: '', // 获取水印列表需要
images: [ // 拍照示意图
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png',
'https://qn-static.banshouhui.com/live_mark.png'
],
main_point: [] // 拍照要求
... // 列表其他字段也可传进来,可能会用到
}
```
### Events
|事件称名 |说明 | 返回值 |
|:-: |:-: | :-: |
|@close | 关闭相机或完成拍照的时候触发 | 已拍照完成的图片数组|
## 组件用法
### 基础用法
```html
<u-navbar v-if="!takeStatus" :is-back="false" :title-size="26" title-color="#000" title="我的"></u-navbar>
<view @click="take">打开相机</view>
<take-photo v-if="takeStatus" :currentItem="testData" @close="closeTake"></take-photo>
```
```javascript
import takePhoto from '@/components/take/index.vue'
export default {
components: {
'take-photo': takePhoto
},
data() {
return {
takeStatus: false,
testData: {}
}
},
methods:{
// 打开相机
take() {
uni.hideTabBar() // 打开时隐藏TabBar
this.takeStatus = true
},
// 拍照完成或关闭相机
closeTake(images) {
console.log(images)
this.takeStatus = false
}
}
}
```
\ No newline at end of file
...@@ -257,6 +257,16 @@ ...@@ -257,6 +257,16 @@
} }
} }
,{
"path" : "pages/order/search",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#F4F5F7"
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
...@@ -315,8 +325,8 @@ ...@@ -315,8 +325,8 @@
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
}, },
{ {
"name": "入驻首页", "name": "工单搜索",
"path": "pages/settle/index", "path": "pages/order/search",
"query": "" "query": ""
}, },
{ {
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
<view class="order-list-view" v-if="loaded"> <view class="order-list-view" v-if="loaded">
<!-- 入驻前--> <!-- 入驻前-->
<view v-if="needSettled" class="tip-view"> <view v-if="needSettled" class="tip-view">
<view class="tip-title">当前订单(笔)</view> <image :src="weiruzhuImage" class="tip-view-image"></image>
<view class="tip-count">{{ count }}</view>
<view class="tip-other">入驻通过后平台将向您推荐订单</view> <view class="tip-other">入驻通过后平台将向您推荐订单</view>
<u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn" <u-button class="settle-button" type="primary" shape="circle" @click="immediatelyIn"
:custom-style="buttonStyle"> :custom-style="buttonStyle">
...@@ -45,8 +44,7 @@ ...@@ -45,8 +44,7 @@
</view> </view>
<!-- 入驻成功之后无推荐订单 --> <!-- 入驻成功之后无推荐订单 -->
<view v-else-if="!needSettled && orderList.length <= 0" class="no-order-view"> <view v-else-if="!needSettled && orderList.length <= 0" class="no-order-view">
<image class="no-order-image" :src="wudingdanImage"></image> <NoOrder/>
<text>当前暂无订单</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -62,14 +60,16 @@ ...@@ -62,14 +60,16 @@
<script> <script>
import util from "@/utils/util.js"; import util from "@/utils/util.js";
import TabBarPage from "@/components/tabBarList/index.vue" import TabBarPage from "@/components/tabBarList/index.vue"
import NoOrder from "@/components/order/noOrder.vue"
const app = getApp(); const app = getApp();
import OrderCell from "@/components/order/index.vue"; import OrderCell from "@/components/order/index.vue";
export default { export default {
components: { components: {
OrderCell, OrderCell,
TabBarPage TabBarPage,
NoOrder
}, },
data() { data() {
return { return {
...@@ -120,10 +120,10 @@ ...@@ -120,10 +120,10 @@
}, },
shouyeyouImage() { shouyeyouImage() {
return process.uniEnv.qn_base_url + 'shouyeyou.png' return process.uniEnv.qn_base_url + 'shouyeyou.png'
},
weiruzhuImage() {
return process.uniEnv.qn_base_url + 'weiruzhu.png'
}, },
wudingdanImage() {
return process.uniEnv.qn_base_url + 'wudingdan.png'
}
}, },
onLoad() {}, onLoad() {},
onShow() { onShow() {
...@@ -380,26 +380,19 @@ ...@@ -380,26 +380,19 @@
padding: 30rpx; padding: 30rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
min-height: 460rpx;
.tip-title { .tip-view-image {
font-size: 32rpx; width: 328rpx;
font-weight: bold; height: 200rpx;
color: #333333; margin-top: 30rpx;
margin-top: 30rpx;
}
.tip-count {
color: #2272ff;
font-size: 70rpx;
font-weight: bold;
margin-top: 50rpx;
margin-bottom: 20rpx;
} }
.tip-other { .tip-other {
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
margin-bottom: 56rpx; margin-bottom: 20rpx;
}
.settle-button {
} }
} }
...@@ -407,28 +400,6 @@ ...@@ -407,28 +400,6 @@
background-color: #F4F5F7; background-color: #F4F5F7;
border-radius: 12rpx; border-radius: 12rpx;
} }
.no-order-view {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #666666;
font-size: 28rpx;
padding: 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
min-height: 460rpx;
.no-order-image {
width: 374rpx;
height: 218rpx;
margin-top: 70rpx;
margin-bottom: 20rpx;
}
}
} }
} }
......
...@@ -6,8 +6,12 @@ ...@@ -6,8 +6,12 @@
class="course-video" class="course-video"
id="courseVideo" id="courseVideo"
:src="courseSrc" :src="courseSrc"
:options="playerOptions"
:playsinline="true"
@play="playCourse" @play="playCourse"
@error="videoErrorCallback" @error="videoErrorCallback"
@ready="playerReadied"
@timeupdate = "onPlayerTimeupdate($event)"
controls controls
></video ></video
></view> ></view>
...@@ -64,6 +68,34 @@ export default { ...@@ -64,6 +68,34 @@ export default {
section_id:0, section_id:0,
isShowVideo: false, isShowVideo: false,
CourseSectionlist: {},//节信息 CourseSectionlist: {},//节信息
playerOptions : {
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
autoplay: false, //如果true,浏览器准备好时开始回放。
muted: false, // 默认情况下将会消除任何音频。
loop: false, // 导致视频一结束就重新开始。
preload: 'auto',
language: 'zh-CN',
aspectRatio: '16:9',
fluid: true,
// sources: [{
// type: "",
// src: "" //url地址
// }],
// poster: "../../static/images/test.jpg", //你的封面地址
// width: document.documentElement.clientWidth,
notSupportedMessage: '此视频暂无法播放,请稍后再试',
controlBar: {
timeDivider: true,
durationDisplay: true,
remainingTimeDisplay: false,
fullscreenToggle: true //全屏按钮
}
},
gklog: '',
videoTotalTime: 0,
howTimeToUpdateLearnedStatus: 5,//设置几秒提交一次状态
status: 1,//是否已学习默认1已学习
howLongIsLearned: this.videoTotalTime/2,//默认设置观看1/2就是已学
}; };
}, },
computed: { computed: {
...@@ -97,10 +129,6 @@ export default { ...@@ -97,10 +129,6 @@ export default {
}, },
}, },
onLoad(e) { onLoad(e) {
this.courseSrc = 'https://qn-static.banshouhui.com/self-support/videoen.mp4';
this.courseTitle = '大吉大利';
this.courseDesc = '今晚吃鸡';
this.section_id = e.section_id
this.getCourseSection({section_id:e.section_id}) this.getCourseSection({section_id:e.section_id})
}, },
onReady: function (res) { onReady: function (res) {
...@@ -109,6 +137,14 @@ export default { ...@@ -109,6 +137,14 @@ export default {
// #endif // #endif
}, },
methods: { methods: {
onPlayerTimeupdate (player) {
console.log('-----onplay----');
console.log(player);
let intCurrentTime = parseInt(player.detail.currentTime);
this.updateLearnedStatus(intCurrentTime);
this.gklog = intCurrentTime;
console.log(' onPlayerTimeupdate!', this.gklog)
},
videoErrorCallback: function (e) { videoErrorCallback: function (e) {
uni.showModal({ uni.showModal({
content: e.target.errMsg, content: e.target.errMsg,
...@@ -130,6 +166,10 @@ export default { ...@@ -130,6 +166,10 @@ export default {
} }
this.changeCourseStatus(); this.changeCourseStatus();
}, },
playerReadied (player) {
console.log('i go to playerReadied gklog:' + this.gklog)
player.currentTime(this.gklog)
},
changeCourseStatus() { changeCourseStatus() {
let that = this; let that = this;
if (that.courseId) { if (that.courseId) {
...@@ -162,22 +202,49 @@ export default { ...@@ -162,22 +202,49 @@ export default {
console.log(this.CourseSectionlist) console.log(this.CourseSectionlist)
let wareVal = this.CourseSectionlist.ware; let wareVal = this.CourseSectionlist.ware;
this.isShowVideo = wareVal == "0"; this.isShowVideo = wareVal == "0";
if(this.isShowVideo){
let coureWareList = res.data.courseware;
this.courseSrc = coureWareList[0].src;
this.videoTotalTime = parseInt(JSON.parse(coureWareList[0].info).time);
console.log('视频时长信息:' + this.videoTotalTime);
this.courseTitle = res.data.name;
this.courseDesc = res.data.content;
this.section_id = res.data.id;
}
} }
} }
}) })
.catch((err) => { .catch((err) => {
console.log('--------settttt---------');
console.log(err);
uni.showToast({ uni.showToast({
title: err, title: err,
icon: "none", icon: "none",
}); });
this.isLoadMore = false;
if (this.params.start > 0) {
this.page -= 5;
}
}); });
},
updateLearnedStatus(nowLength) {
if(this.gklog != nowLength && nowLength%this.howTimeToUpdateLearnedStatus == 0){
if(nowLength < this.howLongIsLearned){
this.status = 0;
}else{
this.status = 1;
console.log('--已学习--');
}
//大于
let param = {
section_id: this.section_id,
video_time: nowLength,
status: this.status,
};
this.$u.api.updateLearnCourses(param).then((res) => {
console.log('--'+this.howTimeToUpdateLearnedStatus+'更新一次观看状态--time:' + nowLength);
});
}
} }
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -203,6 +270,19 @@ export default { ...@@ -203,6 +270,19 @@ export default {
padding: 80rpx 60rpx 40rpx 60rpx; padding: 80rpx 60rpx 40rpx 60rpx;
} }
.title {
font-weight: 700;
font-family: Medium,Helvetica Neue,Helvetica,Arial,sans-serif;
font-size: 77rpx;
color: #333;
padding: 80rpx 60rpx 40rpx 60rpx;
}
.content {
padding: 40rpx 30rpx;
margin-bottom: 20rpx;
}
.course-desc { .course-desc {
margin-left: 60rpx; margin-left: 60rpx;
} }
......
...@@ -181,9 +181,10 @@ export default { ...@@ -181,9 +181,10 @@ export default {
}, },
setUserData(userInfo) { setUserData(userInfo) {
if (userInfo && userInfo.token) { if (userInfo && userInfo.token) {
debugger
// 如果已经登录则直接获取相关信息 // 如果已经登录则直接获取相关信息
util.setOpenid(userInfo.wxopenid); util.setOpenid(userInfo.wxopenid);
this.$u.vuex('vuex_token', userInfo.token); this.$u.vuex('vuex_token',"RTOKENf22df8e7b9db396f560e8f61bebceea2000cb05c" ); // userInfo.token
uni.setStorageSync("user-info", userInfo); uni.setStorageSync("user-info", userInfo);
} else { } else {
this.$u.vuex('vuex_token', ''); this.$u.vuex('vuex_token', '');
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</u-cell-group> </u-cell-group>
</view> </view>
</view> </view>
<take-photo type="test" v-if="takeStatus" :currentItem="testData" @close="closeTake"></take-photo> <take-photo v-if="takeStatus" :currentItem="testData" @close="closeTake"></take-photo>
</view> </view>
</template> </template>
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time> <appoint-time @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view> </view>
<view class="u-m-60"> <view class="u-m-60">
<button class="btn" @click="submitFrom" :loading="submiting" :disabled="disabledSubmitBtn">确定</button> <button class="btn" @click="submitFrom" :loading="submiting" :disabled="disabledSubmit">确定</button>
</view> </view>
</view> </view>
</template> </template>
...@@ -114,19 +114,19 @@ ...@@ -114,19 +114,19 @@
} }
}, },
computed: { computed: {
disabledSubmitBtn() {
debugger disabledSubmit() {
let self = this let self = this
if(self.trace.reasonType == '预约' debugger
&& (self.trace.appointmentDatetime == null || self.trace.appointmentDatetimeRange == '' if(self.trace.reasonType
|| self.trace.nextTraceDatetime == '')) { && (self.trace.reasonType == '报备' || self.trace.reasonType == '改约')){
return true if(self.trace.reasonRelegation && self.trace.reason
} else if(self.trace.reasonType != '预约' && self.trace.appointmentDatetimeRange) {
&& (!self.trace.reasonType || !self.trace.reasonRelegation || !self.trace.reason)) { return false
return true }
} }
return false return true
}, },
}, },
async onLoad(e) { async onLoad(e) {
...@@ -323,8 +323,13 @@ ...@@ -323,8 +323,13 @@
&::after{ &::after{
content:''; content:'';
height:0; height:0;
border: none;
} }
} }
button[disabled]:not([type]) {
background: #D1D4D4;
color: #FFFFFF;
}
.btn{ .btn{
padding:30rpx; padding:30rpx;
border-radius: 52rpx; border-radius: 52rpx;
......
...@@ -4,47 +4,48 @@ ...@@ -4,47 +4,48 @@
<view class="tools-box"> <view class="tools-box">
<view class="search-sub"> <view class="search-sub">
<u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white" <u-subsection :current="curNow" :list="subList" active-color="white" bg-color="white"
inactive-color="#666" button-color="#2272FF" border-radius="36" @change="sectionChange"> inactive-color="#666" button-color="#2272FF" border-radius="36" @change="sectionChange" height="72"
bold>
</u-subsection> </u-subsection>
</view> </view>
<view class="search-btn"> <view class="search-btn" @click="handleClickSearch">
<u-icon name="search" color="#666" size="32"></u-icon> <image class="search-image" mode="widthFix" :src="sousuoImage"></image>
<text class="search-btn-text">搜订单</text> <text class="search-btn-text">搜订单</text>
</view> </view>
</view> </view>
<view class="u-tabs-box" v-show="curNow == 0"> <view class="u-tabs-box" v-show="curNow == 0">
<u-tabs activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" bar-width="44" <u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4" bar-width="44"
:offset="[-1,10]" :list="list" count="total" :current="current" @change="change" :offset="[0,0]" :list="list" count="total" :current="current" @change="change"
:is-scroll="false"></u-tabs> :is-scroll="false" font-size="28" bold></u-tabs>
</view> </view>
<!-- <swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> --> <view class="tab-view">
<!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> --> <!-- <swiper-item class="swiper-item" v-for="(res, ind) in orderList" :key="ind"> -->
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring> <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring>
<view class="page-box">
<view v-for="(item, index) in orderList" :key="item.orderId"> <view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :orderType="orderType" :location="dataValue" <OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
@click="handleClick(item)" @action="handleAction(item)"> </OrderCell> @click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
</view> </view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore> <u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
</scroll-view> </scroll-view>
<!-- </swiper-item> <!-- </swiper-item> -->
</swiper> --> </view>
<!-- </view> --> <!-- </view> -->
<PopView title="aaaa" message="bbbb" :visible="visibale"/>
</TabBarPage> </TabBarPage>
</template> </template>
<script> <script>
import TabBarPage from "@/components/tabBarList/index.vue" import TabBarPage from "@/components/tabBarList/index.vue"
import OrderCell from "@/components/order/index.vue"; import OrderCell from "@/components/order/index.vue"
export default { export default {
components: { components: {
TabBarPage, TabBarPage,
OrderCell OrderCell
}, },
data() { data() {
return { return {
visibale: false,
showSview: true, showSview: true,
curNow: 0, curNow: 0,
pageNumber: 0, pageNumber: 0,
...@@ -99,6 +100,9 @@ ...@@ -99,6 +100,9 @@
}, },
currentIndex() { currentIndex() {
return this.curNow == 0 ? this.current : 5 return this.curNow == 0 ? this.current : 5
},
sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png'
} }
}, },
methods: { methods: {
...@@ -189,7 +193,9 @@ ...@@ -189,7 +193,9 @@
// 后台需要返回orderType,防止数据返回延迟期间点击了其他的tab // 后台需要返回orderType,防止数据返回延迟期间点击了其他的tab
if (res.data) { if (res.data) {
self.orderList.push(...res.data.list) self.orderList.push(...res.data.list)
self.list[res.data.orderType].total = res.data.total if (self.list[res.data.orderType]) {
self.list[res.data.orderType].total = res.data.total
}
self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore' self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
} }
} else { } else {
...@@ -237,6 +243,11 @@ ...@@ -237,6 +243,11 @@
handleAction(item) { handleAction(item) {
console.log('click button') console.log('click button')
this.viewOderItem(item.orderId) this.viewOderItem(item.orderId)
},
handleClickSearch() {
uni.navigateTo({
url: 'pages/order/search'
})
} }
} }
}; };
...@@ -422,24 +433,30 @@ ...@@ -422,24 +433,30 @@
flex-direction: column; flex-direction: column;
height: calc(100vh - var(--window-top)); height: calc(100vh - var(--window-top));
width: 100%; width: 100%;
}
.tab-view {
height: 100%;
overflow: auto;
padding-bottom: 20rpx;
} }
.swiper-box { // .swiper-box {
flex: 1; // flex: 1;
} // }
.swiper-item { // .swiper-item {
height: 100%; // height: 100%;
.page-box { // .page-box {
padding-bottom: 20rpx; // padding-bottom: 20rpx;
} // }
} // }
.tools-box { .tools-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
padding: 20rpx 0rpx 18rpx 0rpx; padding-bottom: 20rpx;
.search-sub { .search-sub {
height: 72rpx; height: 72rpx;
...@@ -451,12 +468,16 @@ ...@@ -451,12 +468,16 @@
width: 220rpx; width: 220rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 36rpx; border-radius: 36rpx;
color: #666666; color: #999999;
display: flex; display: flex;
flex-direction: row; justify-content: center;
justify-content: space-around;
align-items: center; align-items: center;
.search-image {
width: 36rpx;
height: 32rpx;
flex-shrink: 0;
margin-right: 24rpx;
}
.search-btn-text { .search-btn-text {
line-height: 36rpx; line-height: 36rpx;
font-weight: 400; font-weight: 400;
......
<!-- 工单-搜索页 -->
<template>
<view class="search-wrap">
<view class="top-item">
<u-search
v-model="search.keyword"
bg-color="#FFFFFF"
placeholder="搜订单"
search-icon-color="#999999"
color="#333333"
placeholder-color="#999999"
height="72"
margin="0 30rpx"
:animation="true"
:action-style="{
'font-size': '32rpx',
'font-weight': 500,
'color': '#2272FF'
}"
@search="searchOrder"
@custorm="searchOrder"
></u-search>
</view>
<view class="content-item">
<view v-if="orderList && orderList.length > 0" class="order-row">
<view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :orderType="orderType" :location="dataValue"
@click="handleClick(item)" @action="handleAction(item)"> </OrderCell>
</view>
<u-loadmore :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</view>
<view v-else="search.keyword" class="empty-result">
<u-image width="374" height="256" :src="searchEmpty">
<u-loading slot="loading"></u-loading>
</u-image>
<text class="empty-message">
当前暂无搜索结果
</text>
</view>
</view>
</view>
</template>
<script>
import OrderCell from "@/components/order/index.vue";
export default {
components: {
OrderCell
},
data() {
return {
search: {
type: '',
keyword: '',
pageSize: 10,
pageNumber: 0,
orderStatusRangeType: '',
},
orderList: [],
};
},
onLoad() {
// this.searchOrder()
},
computed: {
searchEmpty() {
return process.uniEnv.qn_base_url + 'SearchEmpty.png'
},
},
methods: {
searchOrder(index) {
this.search.pageNumber = 0
this.getOrderList()
},
// 页面数据
getOrderList() {
// 状态处理
var self = this;
self.search.pageNumber += 1
self.$u.api.listOrder(self.search).then((res) => {
if (res.code == 200) {
console.log("getOrderList", res.data)
var res = {
data: {
total: 15,
orderType: this.currentIndex,
list: [{
orderServiceType: '安装', // 服务类型:安装、维修
categoryName: '充电桩', // 品类:充电桩
orderBusinessTypeText: '分配单', // 业务类型:分配单、订单池
orderNumber: 'OR2021041809827', // 工单编号
contactName: '郭小清', // 客户信息
contactPhone: '13631612077', // 联系方式
contactAddress: '湾街道荔枝花园D座125号', // 详细地址
contactAddressLatitud: '116.3896', // 联系人地址经度
contactAddressLongitud: '39.91917', // 联系人地址纬度
orderStatus: 0, // 工单状态
appointmentDatetime: '', // 预约时间
currentWillOverTime: 10000, // 剩余时间
currentOverTime: 0, // 超过时间
auditDatetime: '2021.04.19 12:45:09', // 审核时间
submissionTime: '2021.04.19 16:24:48', // 提交时间
auditResults: {}, // 审核结果
orderBusinessType: 'R', // 业务类型 R 为抢单
}]
}
}
res.data.list = [...res.data.list, ...res.data.list, ...res.data.list, ...res.data.list,
...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list,...res.data.list]
// 后台需要返回order_type,防止数据返回延迟期间点击了其他的tab
if (res.data) {
self.orderList.push(...res.data.list)
self.loadStatus = res.data.total > self.orderList.length ? 'loadmore' : 'nomore'
}
} else {
console.log(res.message, "获取订单数量失败!");
}
});
},
viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({
url: 'pages/order/detail?id=' + orderId
})
},
handleClick(item) {
console.log('click cell')
this.viewOderItem(item.orderId)
},
handleAction(item) {
console.log('click button')
this.viewOderItem(item.orderId)
},
},
}
</script>
<style lang="scss">
.search-wrap {
.top-item {
position: sticky;
padding: 20rpx 0;
top: 0rpx;
background-color: #F4F5F7;
z-index: 2;
/deep/ .u-search .u-content {
padding: 0 20rpx 0 40rpx;
}
/deep/ .u-search .u-input {
margin: 0 24rpx;
}
/deep/ .u-search .u-icon--right .u-iconfont {
font-size: 36rpx !important;
}
/deep/ .u-search .u-close-wrap .u-iconfont {
color: #CCCCCC;
}
}
.content-item {
padding: 10rpx 30rpx 20rpx 30rpx;
.empty-result {
padding-top: 354rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.empty-message {
padding-top: 28rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 28rpx;
}
}
}
}
</style>
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