Commit 48c237ad authored by Facius's avatar Facius

Merge branch 'dev' into test

parents 6b16f38e 29244ad3
...@@ -5,11 +5,11 @@ const UNI_APP = { ...@@ -5,11 +5,11 @@ 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.0.62:37080', //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/',
qn_asset_url: 'http://deudn.c.pp.cc/', qn_asset_url: 'http://deudn.c.pp.cc/',
argoDebugMode: 1 argoDebugMode: 1
} }
module.exports = UNI_APP; module.exports = UNI_APP;
(function() { (function () {
let NODE_ENV = 'prod'; // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null; let ENV_VAR = null;
let VERSION_NUMBER = '1.3.1';//版本号 let VERSION_NUMBER = '1.3.3';//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频 //小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
} }
if (ENV_VAR) { if (ENV_VAR) {
process.uniEnv = {}; process.uniEnv = {};
process.uniEnv['node_env'] = NODE_ENV; process.uniEnv['node_env'] = NODE_ENV;
process.uniEnv['version_number'] = VERSION_NUMBER; process.uniEnv['version_number'] = VERSION_NUMBER;
for (let key in ENV_VAR) { for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key]; process.uniEnv[key] = ENV_VAR[key];
} }
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
}, },
getSystemInfo() { getSystemInfo() {
try { try {
let a = wx.getSystemInfoSync(); let a = this.$u.sys();
this.globalData.navHeight = this.globalData.navHeight =
(a.statusBarHeight / a.screenWidth) * 750 + 90; (a.statusBarHeight / a.screenWidth) * 750 + 90;
this.globalData.rpxScreenHeight = this.globalData.rpxScreenHeight =
...@@ -116,9 +116,6 @@ export default { ...@@ -116,9 +116,6 @@ export default {
} catch (a) {} } catch (a) {}
}, },
async getBaseInfo(vm, callBack) { async getBaseInfo(vm, callBack) {
// uni.showLoading({
// title: "加载中……",
// });
const res = await vm.$u.api.getSettleBaseInfo(); const res = await vm.$u.api.getSettleBaseInfo();
if (res.code !== 200) { if (res.code !== 200) {
return false; return false;
...@@ -131,7 +128,6 @@ export default { ...@@ -131,7 +128,6 @@ export default {
if (typeof callBack == "function") { if (typeof callBack == "function") {
callBack(vm, res.data); callBack(vm, res.data);
} }
// uni.hideLoading();
return res.data; return res.data;
}, },
...@@ -261,6 +257,7 @@ export default { ...@@ -261,6 +257,7 @@ export default {
<style> <style>
/*每个页面公共css */ /*每个页面公共css */
@import "@/common/iconfont.css";
</style> </style>
<style lang="scss"> <style lang="scss">
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */ /* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
......
...@@ -119,6 +119,11 @@ let orderApiFun = function(vm){ ...@@ -119,6 +119,11 @@ let orderApiFun = function(vm){
*/ */
let getCompleteConfigAndData= async (orderId) => await vm.$u.get(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/info'); let getCompleteConfigAndData= async (orderId) => await vm.$u.get(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/info');
/**
* 完工项阶段下一步
*/
let completeNextStep= async (params = {}, orderId) => await vm.$u.post(prefix + vm.vuex_token+'/order/'+ orderId +'/maintain/nextStep', params);
/** /**
* 查询措施 * 查询措施
*/ */
...@@ -172,6 +177,10 @@ let orderApiFun = function(vm){ ...@@ -172,6 +177,10 @@ let orderApiFun = function(vm){
let otherUser = async (params = {}) => await vm.$u.get(prefix + 'other/auth/' + vm.vuex_token + '/other/user', params); let otherUser = async (params = {}) => await vm.$u.get(prefix + 'other/auth/' + vm.vuex_token + '/other/user', params);
// 是否添加客服 // 是否添加客服
let checkAddCustomer = async (params = {}) => await vm.$u.get(prefix + 'order/revision/' + vm.vuex_token + '/checkAddCustomer', params); let checkAddCustomer = async (params = {}) => await vm.$u.get(prefix + 'order/revision/' + vm.vuex_token + '/checkAddCustomer', params);
// 工单文件标签
let fileLabel = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file/lable/', params);
// 工单文件列表
let fileList = async (params = {}) => await vm.$u.get(prefix + 'config/' + vm.vuex_token + '/finish/file', params);
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
...@@ -212,7 +221,10 @@ let orderApiFun = function(vm){ ...@@ -212,7 +221,10 @@ let orderApiFun = function(vm){
workerApplyPay, workerApplyPay,
allowLogin, allowLogin,
otherUser, otherUser,
checkAddCustomer checkAddCustomer,
fileLabel,
fileList,
completeNextStep
} }
return orderApi return orderApi
} }
......
...@@ -88,7 +88,8 @@ const install = (Vue, vm) => { ...@@ -88,7 +88,8 @@ const install = (Vue, vm) => {
// return result; // return result;
case 200: case 200:
return { return {
data:result.data == null ? result : result.data, // result.data的值为0, false, ''的时候也要算有值 // data:result.data == null ? result : result.data, // result.data的值为0, false, ''的时候也要算有值
data:result.data,
code:code, code:code,
message:msg message:msg
}; };
......
@font-face {
font-family: "wxh"; /* Project id 2600874 */
/* Color fonts */
src:
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAHYAAwAAAAAA3wAAAGNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIhgjEgZgADwKYGwBNgIkAwwLCgAEIAWBVAcgG6sCyL5APLajkgSQKlA9xTEuxLtPw+avikE32OCp3+939u3+/1Gp7skkindRuVQ8k0iUaNNpRCLDdLF04f9/532v+ifKCgIKskACGvLAxrTW4SE+1iqP8/+6guhXXAM8hf9vEasvfKVwncDD1TkrNzR1E+lJXq2Jk7a1bQ3roijRNAvX4KcCSyxqd7YWLiJliUdasyQ5XAICJABpCMZgAkDSE0gAP2OGrgmRg5tgCnRTF5lSK4fYlCRE6qmni0ey3kWdd6AOt3OGAD8DWYQiKJCG+oE0jAWEMQIW696D9G/KUxg1AKI02plA7vAtAEFB+v7O7tkkdNLjvbjTF5h7OrYl920W6m8dFljELe5HnXjRVxjkRJ65+0r0u+pq6/XtP1pP8E4/1AFhLCAv7zVIoOnH2TR4MIAZYTWjM0p5KABhHoosGhHQgGmEmthvxABkBq2gMBm5GwxWbNsxY8CkaZsWjFpTTQVVKdtAj149uirJqit35ACW9XfEpDXrZi1bkqVWQeFDBQCPX3IBAA==') format('woff2');
}
.wxh {
font-family: "wxh" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.wxh-doc:before {
content: "\e601";
}
...@@ -9,38 +9,49 @@ ...@@ -9,38 +9,49 @@
mode="center" mode="center"
width="690rpx"> width="690rpx">
<view class="slot-content"> <view class="slot-content">
<view class="check-status"> <view v-if="confirmButtonText !== '确定'">
<u-image width="224rpx" height="224rpx" :src="statusImage"></u-image> <view class="check-status">
<text :class="['status-txt', { 'pass-color': pass }]">{{statusTxt}}</text> <u-image width="224rpx" height="224rpx" :src="statusImage"></u-image>
</view> <text :class="['status-txt', { 'pass-color': pass }]">{{statusTxt}}</text>
<view class="check-list">
<view class="u-flex u-row-between list-title">
<view class="left-txt">验证项</view>
<view>已提交/需提交</view>
<view class="right-txt">结果</view>
</view> </view>
<view class="u-flex u-row-between list-item" <view class="check-list">
v-for="(item, index) in listData" :key="index"> <view class="u-flex u-row-between list-title">
<view class="item-txt left-txt" style="width: 160rpx;text-align: left;"> <view class="left-txt">验证项</view>
<u-icon <view>已提交/需提交</view>
:name="item.pass ? passIcon : noPassIcon" <view class="right-txt">结果</view>
:label="item.label"
margin-left="12"
label-color="#333333"
label-size="28"
size="32"></u-icon>
</view> </view>
<view class="item-txt">{{item.submitted}}/{{item.required}}</view> <view class="u-flex u-row-between list-item"
<view v-for="(item, index) in listData" :key="index">
:class="['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']" <view class="item-txt left-txt" style="width: 200rpx;text-align: left;">
style="width: 160rpx;text-align: right;"> <u-icon
{{item.pass ? "通过" : "未通过"}} :name="item.pass ? passIcon : noPassIcon"
:label="item.label"
margin-left="12"
label-color="#333333"
label-size="28"
size="32"></u-icon>
</view>
<view class="item-txt">{{item.submitted}}/{{item.required}}</view>
<view
:class="['item-txt', 'right-txt', item.pass ? 'pass-color' : 'no-pass-color']"
style="width: 160rpx;text-align: right;">
{{item.pass ? "通过" : "未通过"}}
</view>
</view> </view>
</view> </view>
</view> </view>
<view v-else>
<view class="check-status">
<text class='status-txt' style="color: #333;">确认安装结果</text>
</view>
<view class="u-flex no-install">
<text class="tips">提交信息,确认安装结论为不安装</text>
</view>
</view>
<view class="check-bottom"> <view class="check-bottom">
<view class="button cancel" v-show="!pass" @tap="cancel">取消</view> <view class="button cancel" v-show="cancelButtonText !== ''" @tap="cancel">{{ cancelButtonText }}</view>
<view class="button confirm" @tap="confirm">{{confirmText}}</view> <view class="button confirm" @tap="confirm">{{ confirmButtonText }}</view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
...@@ -79,6 +90,14 @@ ...@@ -79,6 +90,14 @@
{label: '安装信息', submitted: 15, required: 20, pass: false} {label: '安装信息', submitted: 15, required: 20, pass: false}
] ]
} }
},
confirmButtonText: {
type: String,
default: '确定'
},
cancelButtonText: {
type: String,
default: ''
} }
}, },
data() { data() {
...@@ -104,9 +123,6 @@ ...@@ -104,9 +123,6 @@
statusTxt() { statusTxt() {
return this.pass ? "完工校验已通过" : "完工校验未通过" return this.pass ? "完工校验已通过" : "完工校验未通过"
}, },
confirmText() {
return this.pass ? "确定" : "去处理"
},
passIcon() { return process.uniEnv.qn_base_url + 'icon/pass.png'}, passIcon() { return process.uniEnv.qn_base_url + 'icon/pass.png'},
noPassIcon() { return process.uniEnv.qn_base_url + 'icon/no-pass.png'}, noPassIcon() { return process.uniEnv.qn_base_url + 'icon/no-pass.png'},
}, },
...@@ -115,14 +131,7 @@ ...@@ -115,14 +131,7 @@
this.$emit('close') this.$emit('close')
}, },
confirm() { confirm() {
if(this.pass) { this.$emit('confirm')
this.$emit('change')
} else {
let data = this.listData.find((item, index) => {
return item.pass == false;
})
this.$emit('handle', data)
}
} }
}, },
...@@ -161,6 +170,15 @@ ...@@ -161,6 +170,15 @@
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
} }
.no-install {
justify-content: center;
align-items: center;
height: 200rpx;
border-top: 2rpx solid #F4F5F7;
.tips {
font-size: 28rpx;
}
}
.check-bottom { .check-bottom {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -194,7 +212,7 @@ ...@@ -194,7 +212,7 @@
line-height: 32rpx; line-height: 32rpx;
} }
.left-txt { .left-txt {
width: 160rpx; width: 200rpx;
text-align: left; text-align: left;
} }
.right-txt { .right-txt {
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
line-height: 50rpx; line-height: 50rpx;
max-width: 46%; max-width: 46%;
align-items: center; align-items: center;
&.active{ &.active{
background-color: #2272FF; background-color: #2272FF;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="file-box"> <view class="file-box">
<view class="pics u-flex u-flex-wrap"> <view class="pics u-flex u-flex-wrap">
<view class="img-list" v-for="(item,index) in imgList" :key="index"> <view class="img-list" v-for="(item,index) in imgList" :key="index">
<u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item,index)"></u-image> <u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item,index)" fade lazy-load ></u-image>
<view class="icon-del-box" @click.stop="delFile(index)"> <view class="icon-del-box" @click.stop="delFile(index)">
<view class="icon-del"></view> <view class="icon-del"></view>
<view class="icon-del rotate"></view> <view class="icon-del rotate"></view>
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
<template> <template>
<view :style="{'width': fieldsWidth}"> <view :style="{'width': fieldsWidth}">
<u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle" <u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength" :cursor-spacing="10" hold-keyboard/> :custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength" :cursor-spacing="10" :disabled="isDisabled" hold-keyboard/>
<view class="content" v-if="slotContent">
<text class="txt">{{ slotContent }}</text>
</view>
</view> </view>
</template> </template>
...@@ -26,42 +29,18 @@ ...@@ -26,42 +29,18 @@
type: { type: {
type: String, type: String,
default: 'text' default: 'text'
},
slotContent: {
type: String,
default: ''
} }
// width: { // 例如:454rpx
// type: String,
// default: '100%'
// }
}, },
data() { data() {
return { return {
inputType: 'text', inputType: 'text'
// type: 'text'
} }
}, },
computed: { computed: {
// type() {
// if (this.item) {
// let ty = this.item.fieldsType.toLocaleLowerCase()
// switch (ty) {
// case 'text':
// return 'textarea'
// case 'password':
// return this.item.fieldsType
// case 'decimal':
// case 'number':
// case 'double':
// case 'integer':
// this.maxlength = 9
// return 'digit'
// case 'textarea':
// default:
// return 'text'
// }
// } else {
// return 'text'
// }
// },
maxlength() { maxlength() {
return this.type == 'digit' ? 9 : 140 return this.type == 'digit' ? 9 : 140
}, },
...@@ -89,6 +68,9 @@ ...@@ -89,6 +68,9 @@
}, },
backgroundColor() { backgroundColor() {
return this.textarea ? 'transparent' : '#F4F5F7' return this.textarea ? 'transparent' : '#F4F5F7'
},
isDisabled() {
return this.item.fieldsId === 254 || this.disabled ? true : false
} }
}, },
watch: {}, watch: {},
...@@ -97,8 +79,16 @@ ...@@ -97,8 +79,16 @@
} }
</script> </script>
<style scoped> <style lang="scss" scoped>
.input-item{ .input-item{
background: #F4F5F7; background: #F4F5F7;
} }
.content {
padding-top: 20rpx;
line-height: 45rpx;
.txt {
font-size: 24rpx;
color: #999;
}
}
</style> </style>
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
mounted() {}, mounted() {},
methods: { methods: {
setValue(txt){ setValue(txt){
if (this.disabled) return
this.dataValue = txt this.dataValue = txt
this.valueChange(txt) this.valueChange(txt)
} }
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
line-height: 50rpx; line-height: 50rpx;
max-width: 46%; max-width: 46%;
align-items: center; align-items: center;
&.active{ &.active{
background-color: #2272FF; background-color: #2272FF;
......
<template> <template>
<view class="cus-wrap-component"> <view class="cus-wrap-component">
<image class="top-image" mode="widthFix" v-if="!isPop" :src="minekefutuImage"></image> <image class="top-image" mode="widthFix" v-if="!isPop" :src="qnFile(imageName)"></image>
<view class="content-view"> <view class="content-view">
<view :class="['title-view', {'is-mine': isMine}]"> <view :class="['title-view', {'is-mine': isMine}]">
<text :class="['title-text', {'is-mine': isMine}]">{{titleText[typeIndex]}}</text> <text :class="['title-text', {'is-mine': isMine}]">{{titleText[typeIndex]}}</text>
<text>{{tipText[typeIndex]}}</text> <text>{{tipText[typeIndex]}}</text>
</view> </view>
<u-image :class="['qrcode', {'is-mine': isMine}]" :src="cusQrcode" mode="widthFix" :fade="true" <u-image :class="['qrcode', {'is-mine': isMine}]" :src="qnFile(cusQrcode)" mode="widthFix" :fade="false">
duration="450">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
<!-- 我的页面进来下载图片,其他页面进来open-type为客服,跳转到客服页面 -->
<button :class="['settle-button', {'is-mine': isMine}]" type="primary" :open-type="openTypes[typeIndex]" show-message-card <button :class="['settle-button', {'is-mine': isMine}]" type="primary" :open-type="openTypes[typeIndex]" show-message-card
send-message-title="点击下方客服会话添加订单助手" shape="circle" @click="download" :send-message-img="kefuzxiaoxiImage" send-message-title="点击下方客服会话添加订单助手" shape="circle" @click="download" :send-message-img="qnFile('kefuzxiaoxi.png')"
send-message-path="/pages/index/index"> send-message-path="/pages/index/index">
{{buttonText[typeIndex]}} {{buttonText[typeIndex]}}
</button> </button>
...@@ -45,14 +45,7 @@ ...@@ -45,14 +45,7 @@
}, },
computed: { computed: {
cusQrcode() { cusQrcode() {
let src = this.isMine ? 'erweima-rk.png' : 'dingdanzhushou-n.png'; return this.isMine ? 'erweima-rk.png' : 'dingdanzhushou-n.png';
return util.imageCache(this, src)
},
kefuzxiaoxiImage() {
return util.imageCache(this, 'kefuzxiaoxi.png')
},
minekefutuImage() {
return util.imageCache(this, this.imageName)
}, },
imageName() { imageName() {
return this.isMine ? 'kefufuwu-n.png' : 'kefutuzs.png' return this.isMine ? 'kefufuwu-n.png' : 'kefutuzs.png'
...@@ -92,12 +85,16 @@ ...@@ -92,12 +85,16 @@
} }
}, },
methods: { methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
phoneToCustomer() { // 联系客户 phoneToCustomer() { // 联系客户
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.phone, //仅为示例 phoneNumber: this.phone, //仅为示例
complete() {} complete() {}
}); });
}, },
// 我的页面下载图片,其他页面要跳到客服页面
download() { download() {
if (!this.isMine) { if (!this.isMine) {
this.$emit('click') this.$emit('click')
......
<template>
<view class="bottom-button">
<view v-for="(item, index) in list" :class="['button-view', item.type]">
<u-button :class="['list-button', item.type, {'one': list.length == 1}]" @click="handleClick(item)"
:hover-class="item.type == 'image' || item.disabled ? 'none' : ''"
:custom-style="{...buttonStyle[item.disabled ? 'disabled' : item.type], ...item.customStyle}" type="primary" shape="circle">
<view class="image-view" v-if="item.type == 'image'">
<image :src="baseImageUrl + item.image" class="image-content"></image>
</view>
<view :class="['text-content', item.type]">{{item.label}}</view>
</u-button>
</view>
</view>
</template>
<script>
export default {
props: {
// label: 按钮文字,
// type: 'text'普通按钮;'image'图文按钮
// image: type='image'的时候,按钮图片
// show: 是否显示,
// disabled: 是否禁用,true禁用;false 可以点击
// customStyle: 自定义button样式
buttons: {
type: Array,
default () {
return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: true,
disabled: false,
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: false,
disabled: false
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: true,
disabled: false,
},
{
label: '接单',
type: 'text',
show: true,
disabled: true,
customStyle: {
'background-color': '#2272FF'
}
}
]
}
}
},
computed: {
baseImageUrl() {
return process.uniEnv.qn_base_url
},
list() {
return this.buttons.filter((item) => {
return item.show == true
})
},
buttonStyle() {
return {
'image': {
'background-color': 'transparent',
'border-color': 'transparent',
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '82rpx',
},
'text': {
'background-color': '#2272FF',
'border-color': 'transparent',
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '100%',
},
'disabled': {
'background-color': '#D1D4D4',
'border-color': 'transparent',
'display': 'flex',
'flex-direction': 'column',
'height': '104rpx',
'width': '100%'
},
}
},
},
methods: {
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
handleClick(item) {
if (item.disabled) return
this.$emit('submit', item.id)
}
}
}
</script>
<style lang="scss" scoped>
.bottom-button {
display: flex;
justify-content: center;
align-items: center;
padding: 0 30rpx 44rpx 30rpx;
.button-view {
max-width: 600rpx;
display: flex;
&.image {}
&.text {
width: 100%;
display: flex;
justify-content: flex-end;
}
.list-button {
display: flex;
flex-direction: column;
width: 100%;
&.image {
margin-right: 40rpx;
}
&.text {
width: 400rpx;
margin-left: 40rpx;
&.one {
width: 600rpx;
margin-left: 0rpx;
}
}
.image-view {
flex-shrink: 0;
background-color: #FFFFFF;
border-radius: 38rpx;
width: 76rpx;
height: 76rpx;
.image-content {
width: 76rpx;
height: 76rpx;
}
}
.text-content {
&.text {
color: #FFFFFF;
font-size: 32rpx;
font-weight: bold;
}
&.image {
color: #333333;
font-size: 20rpx;
line-height: 20rpx;
height: 20rpx;
margin-top: 8rpx;
}
}
}
}
}
</style>
<template>
<view class="card base-item">
<view class="top-item">
<view class="left">
<view :class="['tag', {'active': order.orderServiceType == '安装'}]">{{ order.orderServiceType }}</view>
<text class="title">{{ order.categoryName }}</text>
</view>
<view class="right">{{ order.orderBusinessTypeText }}</view>
</view>
<view class="order-cell">
<text>工单编号:</text>
<text>{{ order.orderNumber }}</text>
</view>
<view class="order-cell">
<text>合作厂商:</text>
<text>{{ order.partnerCompanyName }}</text>
</view>
<view class="order-cell">
<text>厂商编号:</text>
<text>{{ order.partnerSerialNumber }}</text>
</view>
<view class="order-cell between-cell">
<view class="left">
<text>客户信息:</text>
<text>{{ order.contactName }}</text>
</view>
<image v-if="showOperate" style="width: 84rpx;height: 56rpx;" :src="phoneIcon"
@click="phoneToCustomer(order.contactPhone)">
</image>
</view>
<view class="order-cell">
<text>联系方式:</text>
<text>{{ order.contactPhone }}</text>
</view>
<view class="between-cell address-cell">
<view class="left-address">
<u-icon name="map" size="28"></u-icon>
<text class="address-txt">{{ formatAddress }}</text>
</view>
<image v-if="showOperate" style="width: 84rpx;height: 56rpx;" :src="navigationIcon"
@click="openLocation(order.contactAddress)"></image>
</view>
<view v-if="readMore" @click="handleClick(false)" class="read-more-toggle">
<u-icon name="arrow-down"></u-icon>
<text class="read-more-text">查看更多</text>
</view>
<view v-else class="order-item-more">
<view class="line-view"></view>
<view class="order-cell between-cell">
<text class="cell-title">品牌:</text>
<text>{{ order.brandName }}</text>
</view>
<view class="order-cell between-cell">
<text class="cell-title">数量:</text>
<text>x{{ order.orderProductCount }}</text>
</view>
<view class="order-cell between-cell">
<text class="cell-title">充电桩信息:</text>
<text>{{ order.serviceContent }}</text>
</view>
<view class="read-more-toggle" @click="handleClick(true)">
<u-icon name="arrow-up"></u-icon>
<text class="read-more-text">点击收起</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
// 履约记录
order: {
type: Object,
default () {
return {}
}
},
// true 显示「查看更多」按钮, false 显示「点击收起」按钮
readMore: {
type: Boolean,
default: true
},
// 可以点击电话和地址
operate: {
type: Boolean,
default: true
},
// 显示点击电话和地址
showOperate: {
type: Boolean,
default: true
}
},
data() {
return {}
},
computed: {
formatAddress() {
let self = this
let address = ""
if (self.order) {
address = self.order.contactProvinceText || ""
address += self.order.contactCityText || ""
address += self.order.contactCommunityText || ""
address += self.order.contactStreetText || ""
address += self.order.contactAddress || ""
}
return address
},
phoneIcon() {
//self-support/icon/dianhua-0@2x.png
if (this.operate) {
return process.uniEnv.qn_base_url + 'dianhua.png'
} else {
return process.uniEnv.qn_base_url + 'dianhua-d.png'
}
},
navigationIcon() {
//self-support/icon/daohang-0@2x.png
if (this.operate) {
return process.uniEnv.qn_base_url + 'daohang.png'
} else {
return process.uniEnv.qn_base_url + 'daohang-d.png'
}
},
},
methods: {
openLocation(address) {
if (this.operate) {
const latitude = this.order.contactAddressLatitud //res.latitude;
const longitude = this.order.contactAddressLongitud //res.longitude;
uni.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
success: function() {
console.log('success');
}
});
}
},
phoneToCustomer(phone) { // 联系客户
if (this.operate) {
uni.makePhoneCall({
phoneNumber: phone, //仅为示例
complete() {}
});
this.contactTime()
}
},
contactTime() {
let self = this
var data = {}
if (this.submitType === "workerAppointment") {
self.$u.api.contactTime(data, this.order.orderId)
}
},
handleClick(val) {
this.$emit('update:readMore', val)
}
}
}
</script>
<style lang="scss" scoped>
.base-item {
padding-bottom: 6rpx;
background-color: #FFFFFF;
margin-bottom: 20rpx;
// padding: 30rpx 30rpx 0 30rpx;
border-radius: 6px;
.top-item {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
.left {
display: flex;
align-items: center;
.tag {
text-align: center;
width: 84rpx;
height: 40rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
&.active {
background-image: linear-gradient(to right, #2272FF, #47ABFF);
}
}
.title {
margin-left: 20rpx;
height: 36rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
line-height: 36rpx;
}
}
.right {
text-align: center;
width: 100rpx;
height: 40rpx;
background: #F4F5F7;
border-radius: 22rpx;
font-size: 22rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
}
}
.address-cell {
font-size: 24rpx;
font-weight: 400;
color: #333333;
line-height: 24rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left-address {
display: flex;
align-items: flex-start;
.address-txt {
line-height: 30rpx;
margin-left: 8rpx;
margin-right: 30rpx;
}
}
}
}
.read-more-toggle {
text-align: center;
color: #2272FF;
font-size: 26rpx;
margin-top: 30rpx;
padding-bottom: 30rpx;
}
.read-more-text {
padding-left: 8rpx;
}
.order-item-more {
font-size: 26rpx;
color: #333333;
text-align: right;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin-bottom: 20rpx;
}
}
.order-cell {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 48rpx;
margin-bottom: 10rpx;
}
.between-cell {
display: flex;
justify-content: space-between;
align-items: center;
}
.display-cell {
display: flex;
}
.cell-title {
text-align: left;
flex-shrink: 0;
}
</style>
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
<view> <view>
<view v-if="showCountTime" class="bottom-left-view"> <view v-if="showCountTime" class="bottom-left-view">
<view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view> <view :class="['bottom-tag-view', {'timeout': timeout}]"><text>{{tagText}}</text></view>
<u-count-down :timestamp="timestamp" font-size="40" show-days separator="zh" <u-count-down :timestamp="timestamp" font-size="40" show-days separator="zh" hide-zero-day
:color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange"separator-color="#666666" ref="order-count-down"></u-count-down> :color="timeout ? '#FA5A49' : '#FF930D'" @change="handleChange" separator-color="#666666" ref="order-count-down"></u-count-down>
</view> </view>
<view v-else-if="showTime"> <view v-else-if="showTime">
<text>{{timeTitle}}</text> <text>{{timeTitle}}</text>
...@@ -196,6 +196,17 @@ ...@@ -196,6 +196,17 @@
showDistance() { showDistance() {
return this.orderType == 0 && this.location.length >= 2 && (this.orderData.contactAddressLatitud || this.orderData.contactAddressLongitud) return this.orderType == 0 && this.location.length >= 2 && (this.orderData.contactAddressLatitud || this.orderData.contactAddressLongitud)
}, },
titles() {
return {
'waitAccept': '待' + this.type0Text, // 待接单、
'waitAppointment': '待预约', // 待预约、
'waitCheckIn': '待签到', // 待签到、
'waitFinish': '待完工', // 待完工、
'audit': '审核中', // 审核中、
'exception': '异常单', // 异常单、
'finish': '已完工', //已完工
}
},
types() { types() {
return { return {
'waitAccept': 0, // 待接单、 'waitAccept': 0, // 待接单、
...@@ -207,6 +218,9 @@ ...@@ -207,6 +218,9 @@
'finish': 6, //已完工 'finish': 6, //已完工
} }
}, },
title() {
return this.titles[this.type]
},
orderDistance() { orderDistance() {
return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1]) return this.distance(this.orderData.contactAddressLatitud,this.orderData.contactAddressLongitud, this.location[0], this.location[1])
}, },
...@@ -243,7 +257,7 @@ ...@@ -243,7 +257,7 @@
return 3 return 3
} else if (this.orderData.orderStatus == 85 || this.orderData.orderStatus == 87) { } else if (this.orderData.orderStatus == 85 || this.orderData.orderStatus == 87) {
return 4 return 4
} else if (this.orderData.orderStatus == 86 ||this.orderData.orderStatus == 88) { } else if (this.orderData.orderStatus == 86 || this.orderData.orderStatus == 88) {
return 5 return 5
} else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) { } else if ([80, 81, 89, 110].indexOf(this.orderData.orderStatus) != -1) {
return 6 return 6
...@@ -267,14 +281,14 @@ ...@@ -267,14 +281,14 @@
methods: { methods: {
handleClick() { handleClick() {
// if (this.buttonDisabled) return // if (this.buttonDisabled) return
this.$emit('action') this.$emit('action', this.orderData, this.title)
}, },
handleClickCell() { handleClickCell() {
this.$emit('click') this.$emit('click', this.orderData, this.title)
}, },
handleChange(timestamp) { handleChange(timestamp) {
if (this.timeout) this.$refs['order-count-down'].seconds += 2 if (this.timeout) this.$refs['order-count-down'].seconds += 2
if (timestamp == 0 && !this.timeout) { if (timestamp == 0 && !this.timeout) { // 超时之后倒计时变为正计时
setTimeout(()=> { setTimeout(()=> {
this.timestamp = 1 this.timestamp = 1
this.timeout = true this.timeout = true
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<text>履约记录</text> <text>履约记录</text>
</view> </view>
<view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view> <view v-if="orderRecords.length == 0" class="no-record-view">当前暂无履约记录</view>
<view v-else class="record-list-view"> <view v-else :class="['record-list-view', {'short': orderRecords.length <= showLenght}]">
<view class="record-right-view"> <view class="record-right-view">
<view class="dashed-line-view"></view> <view class="dashed-line-view"></view>
<view class="order-list"> <view class="order-list">
<view v-for="(record,index) in shwoOrderRecords" :key="record.operationContent" :class="['order-cell', {'first': index == 0}]"> <view v-for="(record,index) in showOrderRecords" :key="record.operationContent" :class="['order-cell', {'first': index == 0}]">
<view class="node-view"> <view class="node-view">
<view class="node-border-view"> <view class="node-border-view">
<view class="node-middle-view"></view> <view class="node-middle-view"></view>
...@@ -18,18 +18,19 @@ ...@@ -18,18 +18,19 @@
<view class="line-view-top"> <view class="line-view-top">
<text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd hh:MM:ss')}} </text> <text>{{$u.timeFormat(record.operationDatetime, 'yyyy.mm.dd hh:MM:ss')}} </text>
<text style="color: red;">{{record.overTime?'超时':''}}{{record.exception?'异常':''}}</text> <text style="color: red;">{{record.overTime?'超时':''}}{{record.exception?'异常':''}}</text>
<text style="color: #2272FF;" <text style="color: #2272FF;" v-show="record.isTrace">跟进</text>
v-show="record.operationType==='报备' || record.operationType==='改约'">跟进</text>
</view> </view>
<view class="line-view-item"> <view class="line-view-item">
<view> <view>
<text>{{record.operationTypeText}}</text> <text>{{record.operationTypeText}}</text>
</view> </view>
<view class="item-operation-view" <view class="item-operation-view" v-show="record.isTrace">
v-show="record.operationType==='报备' || record.operationType==='预约'|| record.operationType==='改约'"> <text class="item-label" >{{record.traceLabel + ":"}}</text>
<text>{{record.operationType==='报备' ? '下次联系时间:' : record.operationType==='改约'?'改约时间:': ''}}</text> <text class="item-content">{{record.traceTime}}</text>
<text </view>
style="color: #2272FF;word-break: break-all;">{{record.orderRecordRemark}}</text> <view class="item-operation-view" v-show="record.operationContent">
<text class="item-label">备注:</text>
<text class="item-content">{{ record.operationContent }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -70,14 +71,14 @@ ...@@ -70,14 +71,14 @@
} }
}, },
computed: { computed: {
shwoOrderRecords() { showOrderRecords() {
if (this.readMoreRecord && this.orderRecords && this.orderRecords.length > 0) { if (this.readMoreRecord && this.orderRecords && this.orderRecords.length > 0) {
return this.orderRecords.slice(0, this.showLenght) return this.orderRecords.slice(0, this.showLenght)
} else { } else {
return this.orderRecords return this.orderRecords
} }
}, },
} },
} }
</script> </script>
...@@ -93,14 +94,15 @@ ...@@ -93,14 +94,15 @@
.no-record-view { .no-record-view {
font-size: 26rpx; font-size: 26rpx;
color: #333333; color: #333333;
margin-top: 30rpx; padding-bottom: 30rpx;
margin-bottom: 30rpx;
} }
.record-list-view { .record-list-view {
position: relative; position: relative;
&.short {
padding-bottom: 30rpx;
}
.record-right-view { .record-right-view {
position: relative; position: relative;
display: flex; display: flex;
...@@ -128,22 +130,25 @@ ...@@ -128,22 +130,25 @@
.node-view { .node-view {
margin-right: 18rpx; margin-right: 18rpx;
flex-shrink: 0; flex-shrink: 0;
margin-top: 8rpx; margin-top: 8rpx;
z-index: 1;
.node-border-view { .node-border-view {
border: 2rpx solid #2272FF; border: 2rpx solid #2272FF;
border-radius: 11rpx; border-radius: 11rpx;
width: 22rpx; width: 22rpx;
height: 22rpx; height: 22rpx;
display: flex; // display: flex;
align-items: center; // align-items: center;
justify-content: center; // justify-content: center;
padding: 5rpx;
background-color: #FFFFFF;
.node-middle-view { .node-middle-view {
width: 10rpx; width: 10rpx;
height: 10rpx; height: 10rpx;
background-color: #2272FF; background-color: #2272FF;
border-radius: 5rpx; border-radius: 6rpx;
} }
} }
} }
...@@ -156,6 +161,7 @@ ...@@ -156,6 +161,7 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
color: #333333; color: #333333;
font-weight: bold;
font-size: 28rpx; font-size: 28rpx;
} }
...@@ -166,6 +172,12 @@ ...@@ -166,6 +172,12 @@
.item-operation-view { .item-operation-view {
margin-top: 20rpx; margin-top: 20rpx;
.item-label {
color: #2272FF;
}
.item-content {
word-break: break-all;
}
} }
} }
} }
...@@ -179,7 +191,7 @@ ...@@ -179,7 +191,7 @@
text-align: center; text-align: center;
color: #2272FF; color: #2272FF;
font-size: 26rpx; font-size: 26rpx;
margin-top: 30rpx; padding-top: 30rpx;
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
......
import qiniuUploader from '@/include/libs/qiniuUploader.js';
const globalUrl = process.uniEnv || {}
export default {
name: 'qiniup',
components: {},
data() {
return {
domain: 'http://upload.qiniup.com', // 七牛上传域名地址
uptokenURL: globalUrl.ucenterUrl.apiUrl + '/v1/tokens', // 上传token地址
files:[], // 上传文件
fileMaps:[], // 上传文件返回对象
keys:[], // 七牛返回key
uploadToken: '', // 上传token
maximum:999, // 最大上传数量
qiniuOptions: {}, // 七牛上传配置
};
},
created() {
this.initQiniu()
},
methods: {
initQiniu: function() {
var defaulfs = {
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region: 'ECN',
bucket: 'fa-cms',
qiniuBucketURLPrefix: 'uploads',
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
uptoken: '',
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
uptokenURL: this.uptokenURL,
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
uptokenFunc: function() {
},
// bucket 外链域名,下载资源时用到。如果设置,会在 success callback 的 res 参数加上可以直接使用的 fileURL 字段。否则需要自己拼接
domain: this.domain,
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
shouldUseQiniuFileName: true
};
let options = {}
if(Object.keys(this.qiniuOptions).length) {
Object.assign(options, defaulfs, this.qiniuOptions);
} else {
options = defaulfs;
}
// 将七牛云相关配置初始化进本sdk
qiniuUploader.init(options);
},
getUrlKey(file) {
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
return name;
},
/**
* 确认上传
* @param {boolean} submit
*/
confirmUpload(submit = false) {
let self = this
const fileList = self.files
if (self.maximum - fileList.length <= 0) {
uni.showToast({
title: '图片数量不能大于' + self.maximum,
icon: 'none'
})
return
}
for (let file of fileList) {
let name = self.getUrlKey(file)
// 交给七牛上传
let item = {
src: '',
id: '',
key:'',
// filesize: '',
progress: 0
}
const params = {
name:name,
file:file,
}
qiniuUploader.upload(params, (res) => {
let inLen = self.maximum - fileList.length
if (inLen > 0) {
item.src = file
item.key = res.key || res.src
self.fileMaps.push(item);
self.keys.push(item.key)
if(submit) {
self.submitFile()
}
} else {
uni.showToast({
title: '图片数量不能大于9'
})
}
}, (error) => {
console.log('error: ' + error);
}, null, (res) => {
item.progress = res.progress
}, () => {
// 取消上传
}, () => {
// `before` 上传前执行的操作
}, (err) => {
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
}
import qiniuUploader from '@/include/libs/qiniuUploader.js';
const globalUrl = process.uniEnv || {}
export default {
name: 'upload-img',
components: {},
data() {
return {
domain: 'http://upload.qiniup.com',
uptokenURL: globalUrl.ucenterUrl.apiUrl + '/v1/tokens',
imgList: [],
imgs:[],
uploadToken: '',
selectNum:999,
};
},
computed: {
uploadBtnShow() {
let flag = this.imgList.length < this.selectNum
return flag && this.uploadVisible
}
},
created() {
this.initQiniu()
this.initImg();
},
methods: {
initQiniu: function() {
var options = {
// bucket所在区域,这里是华北区。ECN, SCN, NCN, NA, ASG,分别对应七牛云的:华东,华南,华北,北美,新加坡 5 个区域
region: 'ECN',
bucket: 'fa-cms',
qiniuBucketURLPrefix: 'uploads',
// 获取uptoken方法三选一即可,执行优先级为:uptoken > uptokenURL > uptokenFunc。三选一,剩下两个置空。推荐使用uptokenURL,详情请见 README.md
// 由其他程序生成七牛云uptoken,然后直接写入uptoken
uptoken: '',
// 从指定 url 通过 HTTP GET 获取 uptoken,返回的格式必须是 json 且包含 uptoken 字段,例如: {"uptoken": "0MLvWPnyy..."}
uptokenURL: this.uptokenURL,
// uptokenFunc 这个属性的值可以是一个用来生成uptoken的函数,详情请见 README.md
uptokenFunc: function() {
},
// bucket 外链域名,下载资源时用到。如果设置,会在 success callback 的 res 参数加上可以直接使用的 fileURL 字段。否则需要自己拼接
domain: this.domain,
// qiniuShouldUseQiniuFileName 如果是 true,则文件的 key 由 qiniu 服务器分配(全局去重)。如果是 false,则文件的 key 使用微信自动生成的 filename。出于初代sdk用户升级后兼容问题的考虑,默认是 false。
// 微信自动生成的 filename较长,导致fileURL较长。推荐使用{qiniuShouldUseQiniuFileName: true} + "通过fileURL下载文件时,自定义下载名" 的组合方式。
// 自定义上传key 需要两个条件:1. 此处shouldUseQiniuFileName值为false。 2. 通过修改qiniuUploader.upload方法传入的options参数,可以进行自定义key。(请不要直接在sdk中修改options参数,修改方法请见demo的index.js)
// 通过fileURL下载文件时,自定义下载名,请参考:七牛云“对象存储 > 产品手册 > 下载资源 > 下载设置 > 自定义资源下载名”(https://developer.qiniu.com/kodo/manual/1659/download-setting)。本sdk在README.md的"常见问题"板块中,有"通过fileURL下载文件时,自定义下载名"使用样例。
shouldUseQiniuFileName: true
};
// 将七牛云相关配置初始化进本sdk
qiniuUploader.init(options);
},
chooseImage() {
if (this.selectNum - this.imgList.length <= 0) {
uni.showToast({
title: '图片数量不能大于' + this.selectNum,
icon: 'none'
})
return
}
uni.chooseImage({
count: this.selectNum, //默认9 this.selectNum
success: (chooseImageRes) => {
for (var i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
let file = chooseImageRes.tempFilePaths[i];
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
// 交给七牛上传
let newLen = this.selectNum - this.imgList.length
let item = {
src: '',
id: '',
key:'',
// filesize: '',
progress: 0
}
const params = {
name:name,
file:file,
}
if (newLen > 0) {
qiniuUploader.upload(params, (res) => {
let inLen = this.selectNum - this.imgList.length
if (inLen > 0) {
item.src = file
item.key = res.key || res.src
this.imgList.push(item);
this.imgs.push(res.key)
// this.addRecord(item,res)
} else {
uni.showToast({
title: '图片数量不能大于9'
})
}
}, (error) => {
console.log('error: ' + error);
}, null, (res) => {
// item.filesize = res.totalBytesSent
item.progress = res.progress
}, () => {
// 取消上传
}, () => {
// `before` 上传前执行的操作
}, (err) => {
// `complete` 上传接受后执行的操作(无论成功还是失败都执行)
});
}
}
}
})
},
perviewImg(index) {
let urls = []
this.imgList.map(item => {
urls.push(item.src)
})
uni.previewImage({
current: index,
urls: urls
});
},
initImg() {
//传入图片,回显
this.imgList = this.initImgList.map(item=>{
let imgItem = {
src:'',
id:''
}
if(typeof item === 'string'){
imgItem.src = item
}else{
imgItem.src = item.src || item.pic || item.image
imgItem.id = item.id || '0'
}
return imgItem
})
},
// async addRecord(item, res) {
// let path = res.key;
// let hash = res.hash;
// let ext = path.substr(path.lastIndexOf('.') + 1);
// //推送到增加记录接口
// let params = {
// filename: hash + '.' + ext,
// full_url: res.fileURL,
// absolute_path: path,
// filesize: item.filesize,
// ext: ext
// };
// let recordRes = await this.$u.api.qiniuRecord(params);
// if (recordRes.code != 1) {
// uni.showToast({
// title: recordRs.msg,
// icon: 'none'
// })
// return
// }
// item.id = recordRes.data.id.id
// },
async removeImg(index) {
this.imgList.splice(index, 1)
// this.$emit('image-change', this.imgList) //将图片回传父页面
},
getUrlKey(file) {
let index = file.lastIndexOf('/');
let len = file.length
let name = file.substring(index + 1, len)
return name;
}
}
}
...@@ -5,13 +5,12 @@ ...@@ -5,13 +5,12 @@
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
} }
}, },
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
"navigationStyle": "custom", "navigationStyle": "custom",
// "enablePullDownRefresh": true,
"disableScroll": true "disableScroll": true
} }
}, },
...@@ -27,15 +26,15 @@ ...@@ -27,15 +26,15 @@
"path": "pages/index/learn", "path": "pages/index/learn",
"style": { "style": {
"navigationBarTitleText": "学习", "navigationBarTitleText": "学习",
"navigationStyle":"custom",//隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "pages/index/mine", "path": "pages/index/mine",
"style": { "style": {
"navigationBarTitleText": "我的", "navigationBarTitleText": "我的",
"navigationStyle": "custom" , "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
...@@ -47,8 +46,9 @@ ...@@ -47,8 +46,9 @@
"disableScroll": true "disableScroll": true
} }
} }
], ],
"subPackages": [{ "subPackages": [
{
"root": "pages/exam", "root": "pages/exam",
"pages": [ "pages": [
{ {
...@@ -74,42 +74,42 @@ ...@@ -74,42 +74,42 @@
"path": "assessment", "path": "assessment",
"style": { "style": {
"navigationBarTitleText": "认证介绍", "navigationBarTitleText": "认证介绍",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "answer", "path": "answer",
"style": { "style": {
"navigationBarTitleText": "考核认证", "navigationBarTitleText": "考核认证",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path":"result", "path": "result",
"style":{ "style": {
"navigationBarTitleText":"", "navigationBarTitleText": "",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "news-details", "path": "news-details",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path":"section", "path": "section",
"style" :{ "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "curriculum", "path": "curriculum",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "custom" // 隐藏系统导航栏 "navigationStyle": "custom"
} }
}, },
{ {
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
"style": { "style": {
"navigationBarTitleText": "在线考试", "navigationBarTitleText": "在线考试",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
...@@ -125,18 +125,18 @@ ...@@ -125,18 +125,18 @@
"path": "course-detail", "path": "course-detail",
"style": { "style": {
"navigationBarTitleText": "培训视频", "navigationBarTitleText": "培训视频",
"navigationBarBackgroundColor":"#F4F5F7", "navigationBarBackgroundColor": "#F4F5F7",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "exam-pass", "path": "exam-pass",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" // 隐藏系统导航栏 "navigationStyle": "custom"
} }
} }
] ]
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
"style": { "style": {
"navigationBarTitleText": "收获地址", "navigationBarTitleText": "收获地址",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
"style": { "style": {
"navigationBarTitleText": "修改地址", "navigationBarTitleText": "修改地址",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
...@@ -168,8 +168,8 @@ ...@@ -168,8 +168,8 @@
"navigationBarTitleText": "我的钱包", "navigationBarTitleText": "我的钱包",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true, "disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"navigationBarBackgroundColor":"#F4F5F7" "navigationBarBackgroundColor": "#F4F5F7"
} }
}, },
{ {
...@@ -178,8 +178,8 @@ ...@@ -178,8 +178,8 @@
"navigationBarTitleText": "提现", "navigationBarTitleText": "提现",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true, "disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"navigationBarBackgroundColor":"#F4F5F7" "navigationBarBackgroundColor": "#F4F5F7"
} }
}, },
{ {
...@@ -188,8 +188,8 @@ ...@@ -188,8 +188,8 @@
"navigationBarTitleText": "收入流水", "navigationBarTitleText": "收入流水",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true, "disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"navigationBarBackgroundColor":"#F4F5F7" "navigationBarBackgroundColor": "#F4F5F7"
} }
}, },
{ {
...@@ -198,80 +198,77 @@ ...@@ -198,80 +198,77 @@
"navigationBarTitleText": "结算账单", "navigationBarTitleText": "结算账单",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true, "disableScroll": true,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"navigationBarBackgroundColor":"#F4F5F7" "navigationBarBackgroundColor": "#F4F5F7"
} }
}, },
{ {
"path": "cert/index", "path": "cert/index",
"style": { "style": {
"navigationBarTitleText": "我的证件", "navigationBarTitleText": "我的证件",
"navigationStyle":"custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "cert/detail", "path": "cert/detail",
"style": { "style": {
"navigationBarTitleText": "",//证件详情 "navigationBarTitleText": "证件详情",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path": "cert/upload", "path": "cert/upload",
"style": { "style": {
"navigationBarTitleText": "",//证件上传 "navigationBarTitleText": "证件上传",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path":"contract/index", "path": "contract/index",
"style":{ "style": {
"navigationBarTitleText":"",//我的合同 "navigationBarTitleText": "我的合同",
"navigationStyle":"custom" "navigationStyle": "custom"
} }
}, },
{ {
"path":"contract/out", "path": "contract/out",
"style":{ "style": {
"navigationBarTitleText":"" "navigationBarTitleText": ""
}
} },
}, {
{ "path": "customer/index",
"path": "customer/index", "style": {
"style": { "navigationStyle": "custom",
"navigationStyle":"custom",
"navigationBarTitleText": "联系客服", "navigationBarTitleText": "联系客服",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "deposit/index", "path": "deposit/index",
"style": { "style": {
"navigationStyle":"custom", "navigationStyle": "custom",
"navigationBarTitleText": "配件押金", "navigationBarTitleText": "配件押金",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path": "warehouse/index", "path": "warehouse/index",
"style": { "style": {
"navigationStyle":"custom", "navigationStyle": "custom",
"navigationBarTitleText": "我的仓库", "navigationBarTitleText": "我的仓库",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
{ "path": "superLogin/index",
"path": "superLogin/index", "style": {
"style": { "navigationBarTitleText": ""
"navigationBarTitleText": "" }
}
} }
] ]
}, },
{ {
"root": "pages/order", "root": "pages/order",
...@@ -279,7 +276,7 @@ ...@@ -279,7 +276,7 @@
{ {
"path": "complete", "path": "complete",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "订单完工",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
...@@ -287,49 +284,62 @@ ...@@ -287,49 +284,62 @@
{ {
"path": "feedback", "path": "feedback",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "过程反馈",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "refuse", "path": "refuse",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "订单拒单",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path" : "detail", "path": "detail",
"style" : "style": {
{
"navigationBarTitleText": "订单详情", "navigationBarTitleText": "订单详情",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true
}
},
{
"path": "search",
"style": {
"navigationBarTitleText": "订单搜索",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#F4F5F7"
}
},
{
"path": "material",
"style": {
"navigationBarTitleText": "勘察材料",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF"
}
},
{
"path": "document",
"style": {
"navigationBarTitleText": "安装文件",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
},
}, {
{ "path": "document-tag",
"path" : "search", "style": {
"style" : "navigationBarTitleText": "", // 合作商或品牌标签列表
{ "navigationStyle": "custom",
"navigationBarTitleText": "订单搜索", "enablePullDownRefresh": false,
"enablePullDownRefresh": false, "disableScroll": true
"navigationBarBackgroundColor":"#F4F5F7" }
}
},
{
"path" : "material",
"style" :
{
"navigationBarTitleText": "勘察材料",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#FFFFFF"
}
} }
] ]
}, },
...@@ -340,22 +350,22 @@ ...@@ -340,22 +350,22 @@
"path": "index", "path": "index",
"style": { "style": {
"navigationBarTitleText": "拍照小工具", "navigationBarTitleText": "拍照小工具",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor":"#F4F5F7" "backgroundColor": "#F4F5F7"
} }
}, },
{ {
"path": "setting", "path": "setting",
"style": { "style": {
"navigationBarTitleText": "水印设置", "navigationBarTitleText": "水印设置",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor":"#F4F5F7" "backgroundColor": "#F4F5F7"
} }
}, },
{ {
"path": "take", "path": "take",
"style": { "style": {
"navigationStyle":"custom", "navigationStyle": "custom",
"navigationBarTitleText": "拍照", "navigationBarTitleText": "拍照",
"navigationBarBackgroundColor": "#333333", "navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "#FFFFFF", "navigationBarTextStyle": "#FFFFFF",
...@@ -366,18 +376,18 @@ ...@@ -366,18 +376,18 @@
"path": "preview", "path": "preview",
"style": { "style": {
"navigationBarTitleText": "照片预览", "navigationBarTitleText": "照片预览",
"navigationBarBackgroundColor":"#333333", "navigationBarBackgroundColor": "#333333",
"backgroundColor":"#FFFFFF", "backgroundColor": "#FFFFFF",
"navigationBarTextStyle":"white" "navigationBarTextStyle": "white"
} }
}, },
{ {
"path": "list", "path": "list",
"style": { "style": {
"navigationBarTitleText": "规范展示", "navigationBarTitleText": "规范展示",
"navigationBarBackgroundColor":"#FFFFFF", "navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor":"#F4F5F7", "backgroundColor": "#F4F5F7",
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
} }
...@@ -390,7 +400,7 @@ ...@@ -390,7 +400,7 @@
"path": "index", "path": "index",
"style": { "style": {
"navigationBarTitleText": "入驻", "navigationBarTitleText": "入驻",
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
...@@ -436,7 +446,7 @@ ...@@ -436,7 +446,7 @@
"path": "sign-contract", "path": "sign-contract",
"style": { "style": {
"navigationBarTitleText": "签约页面", "navigationBarTitleText": "签约页面",
"navigationStyle": "custom", // 隐藏系统导航栏 "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, },
...@@ -454,7 +464,11 @@ ...@@ -454,7 +464,11 @@
"preloadRule": { "preloadRule": {
"pages/index/index": { "pages/index/index": {
"network": "all", "network": "all",
"packages": ["pages/order", "pages/learn", "pages/mine"] "packages": [
"pages/order",
"pages/learn",
"pages/mine"
]
} }
}, },
"globalStyle": { "globalStyle": {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<scroll-view style="height: 100%;" scroll-y @scrolltolower="reachBottom" :scroll-top="scrollTop" @scroll="scroll" <scroll-view style="height: 100%;" scroll-y @scrolltolower="reachBottom" :scroll-top="scrollTop" @scroll="scroll"
scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" scroll-anchoring scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh" refresher-background="#F4F5F7" @refresherpulling="triggered = true" @refresherrefresh="onRefresh"
@refresherrestore="onRestore" enable-back-to-top> @refresherrestore="onRestore" enable-back-to-top>
<!-- <TabBarPage title="扳手会"> --> <!-- <TabBarPage title="扳手会"> -->
<image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image> <image class="banner-image" :src="bannerImage" @click="handleClickBanner"></image>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
scroll-anchoring> --> scroll-anchoring> -->
<view v-for="(item, index) in orderList" :key="index"> <view v-for="(item, index) in orderList" :key="index">
<OrderCell :orderData="item" type="waitAccept" :location="location" <OrderCell :orderData="item" type="waitAccept" :location="location"
@click="handleClick(item.orderId)" @action="handleAction(item.orderId)"> @click="handleClick" @action="handleClick">
</OrderCell> </OrderCell>
</view> </view>
<u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore> <u-loadmore v-show="(search.pageNumber == 1 && loadedOrder) || search.pageNumber > 2" :status="currentLoadStatus" bgColor="#F4F5F7"></u-loadmore>
...@@ -166,15 +166,9 @@ ...@@ -166,15 +166,9 @@
this.getOrderCount() this.getOrderCount()
this.initSettleInfo(); this.initSettleInfo();
}, },
handleClick(orderId) { // 点击了cell handleClick(item, title) { // 跳转工单详情页面
this.viewOderItem(orderId)
},
handleAction(orderId) { // 点击了按钮
this.viewOderItem(orderId)
},
viewOderItem(orderId) { // 跳转工单详情页面
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/detail?id=' + orderId url: 'pages/order/detail?id=' + item.orderId + '&title=' + title
}) })
}, },
async initSettleInfo() { async initSettleInfo() {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs" :current="current" @change="tabsChange" :is-scroll="false" :bar-width="52" swiperWidth="750"></u-tabs-swiper> <u-tabs-swiper bg-color="#F4F5F7" inactive-color="#999999" font-size="28" ref="uTabs" :list="tabs" :current="current" @change="tabsChange" :is-scroll="false" :bar-width="52" swiperWidth="750"></u-tabs-swiper>
<swiper class="swiper_group" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> <swiper class="swiper_group" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item @touchmove.stop.prevent="stopTouchMove"> <swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="height:100%;width:100%;"> <scroll-view scroll-y style="width:100%;">
<view class="jf-currency-class"> <view class="jf-currency-class">
<image :src="jianBianImg" mode="" class="current-img"></image> <image :src="jianBianImg" mode="" class="current-img"></image>
<view class="class1" style="position: relative;" @click="goToPrint"> <view class="class1" style="position: relative;" @click="goToPrint">
...@@ -19,21 +19,29 @@ ...@@ -19,21 +19,29 @@
<view class="jf-line u-margin-right-30 u-margin-top-60">去查看</view> <view class="jf-line u-margin-right-30 u-margin-top-60">去查看</view>
</view> </view>
</view> </view>
<view class="jf-currency-class">
<image :src="jianbianImage" mode="" class="current-img"></image>
<view class="class1" style="position: relative;" @click="goToDocument">
<image class="jf-img" :src="anzhuangwenjianImage" mode=""></image>
<view class="right u-padding-top-10 u-padding-bottom-14 jf-right">
<view class="u-font-32 font-bold u-margin-left-30 u-margin-top-30">充电桩安装文件</view>
<view class="u-font-24 u-margin-left-30 u-margin-top-30">请点击查看</view>
</view>
<view class="jf-line u-margin-right-30 u-margin-top-60 red-color">去查看</view>
</view>
</view>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove"> <swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" @refresherpulling="onPulling" @refresherrefresh="onRefresh" @refresherrestore="onRestore" @refresherabort="onAbort"> <scroll-view scroll-y style="height:100%;width:100%;" @scrolltolower="onreachBottom" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" @refresherpulling="onPulling" @refresherrefresh="onRefresh" @refresherrestore="onRestore" @refresherabort="onAbort">
<view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)"> <view v-for="item in list" :key="item.id" class="notice" @click="bbb(item)">
<view class="n-head"> <view class="notice-bottom-left">{{item.create_at}}</view>
{{item.title}} <view class="notice-content">
</view> <img :src="item.img" alt="" style="width:690rpx;height:260rpx;display:block">
<view class="news" v-html="item.body"> <view class="notice-content-bottom">
<u-parse :html="item.body"></u-parse> <view class="n-head">{{item.title}}</view>
</view> <view class="news">{{item.text}}</view>
<u-line color="#F4F5F7" /> </view>
<view class="notice-bottom">
<view class="notice-bottom-left">{{ item.create_at }}</view>
<view class="notice-bottom-right">查看详情</view>
</view> </view>
</view> </view>
<view v-shou="isLoadMore" class="load-more"> <view v-shou="isLoadMore" class="load-more">
...@@ -119,7 +127,7 @@ ...@@ -119,7 +127,7 @@
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
<swiper-item @touchmove.stop.prevent="stopTouchMove"> <swiper-item @touchmove.stop.prevent="stopTouchMove">
<scroll-view scroll-y style="height:100%;width:100%;"> <scroll-view scroll-y style="width:100%;">
<view class="title u-margin-top-10 u-margin-bottom-30">通用认证</view> <view class="title u-margin-top-10 u-margin-bottom-30">通用认证</view>
<view class="currency-class"> <view class="currency-class">
<view class="class1" @click="aaa(0)"> <view class="class1" @click="aaa(0)">
...@@ -287,7 +295,7 @@ var examJson = { ...@@ -287,7 +295,7 @@ var examJson = {
desc: "通过本认证,是接单的必要条件", desc: "通过本认证,是接单的必要条件",
condition: "随机20题,及格20题", condition: "随机20题,及格20题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png", pic: process.uniEnv.qn_base_url + "fuwuguifan-d.png",
id: 2, id: 2,
examId: "", examId: "",
examStatus: "", examStatus: "",
...@@ -299,7 +307,7 @@ var examJson = { ...@@ -299,7 +307,7 @@ var examJson = {
desc: "快速认证,是否具备接单操作能力", desc: "快速认证,是否具备接单操作能力",
condition: "随机20题,及格16题", condition: "随机20题,及格16题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png", pic: process.uniEnv.qn_base_url + "jiedanguifan-d.png",
id: 2, id: 2,
examId: "", examId: "",
examStatus: "", examStatus: "",
...@@ -313,7 +321,7 @@ var examJson = { ...@@ -313,7 +321,7 @@ var examJson = {
desc: "通过本认证,是接单的必要条件", desc: "通过本认证,是接单的必要条件",
condition: "随机4题,及格4题", condition: "随机4题,及格4题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png", pic: process.uniEnv.qn_base_url + "fuwuguifan-d.png",
id: 3, id: 3,
examId: "", examId: "",
examStatus: "", examStatus: "",
...@@ -325,7 +333,7 @@ var examJson = { ...@@ -325,7 +333,7 @@ var examJson = {
desc: "快速认证,是否具备接单操作能力", desc: "快速认证,是否具备接单操作能力",
condition: "随机5题,及格5题", condition: "随机5题,及格5题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png", pic: process.uniEnv.qn_base_url + "jiedanguifan-d.png",
id: 4, id: 4,
examId: "", examId: "",
examStatus: "", examStatus: "",
...@@ -339,7 +347,7 @@ var examJson = { ...@@ -339,7 +347,7 @@ var examJson = {
desc: "通过本认证,是接单的必要条件", desc: "通过本认证,是接单的必要条件",
condition: "随机4题,及格4题", condition: "随机4题,及格4题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "fwgf-e-3x.png", pic: process.uniEnv.qn_base_url + "fuwuguifan-d.png",
id: 3, id: 3,
examId: "", examId: "",
examStatus: "", examStatus: "",
...@@ -351,7 +359,7 @@ var examJson = { ...@@ -351,7 +359,7 @@ var examJson = {
desc: "快速认证,是否具备接单操作能力", desc: "快速认证,是否具备接单操作能力",
condition: "随机5题,及格5题", condition: "随机5题,及格5题",
status: "", status: "",
pic: process.uniEnv.qn_base_url + "jdgf-e-3x.png", pic: process.uniEnv.qn_base_url + "jiedanguifan-d.png",
id: 4, id: 4,
examId: "", examId: "",
examStatus: "", examStatus: "",
...@@ -400,7 +408,7 @@ export default { ...@@ -400,7 +408,7 @@ export default {
}, },
list: [], list: [],
rule: { rule: {
pic: process.uniEnv.qn_base_url + "guifan@3x.png", pic: process.uniEnv.qn_base_url + "guifan-d.png",
}, },
courselist: [ courselist: [
{ {
...@@ -429,8 +437,7 @@ export default { ...@@ -429,8 +437,7 @@ export default {
pic: courseListJson[2].pic, pic: courseListJson[2].pic,
id: courseListJson[2].id, id: courseListJson[2].id,
sectionId: courseListJson[2].sectionId, sectionId: courseListJson[2].sectionId,
} },
,
{ {
title: courseListJson[3].title, title: courseListJson[3].title,
desc: courseListJson[3].desc, desc: courseListJson[3].desc,
...@@ -470,7 +477,7 @@ export default { ...@@ -470,7 +477,7 @@ export default {
loadStatus: "loading", loadStatus: "loading",
isLoadMore: false, isLoadMore: false,
exam: null, exam: null,
jianBianImg: process.uniEnv.qn_base_url + "jianbian@3x_bak1.png", jianBianImg: process.uniEnv.qn_base_url + "jianbian-fp.png",
isReflesh: true, isReflesh: true,
triggered: false, triggered: false,
_freshing: false, _freshing: false,
...@@ -478,7 +485,7 @@ export default { ...@@ -478,7 +485,7 @@ export default {
}; };
}, },
onLoad(param) { onLoad(param) {
getApp().trackPage('学习首页') getApp().trackPage("学习首页");
var that = this; var that = this;
try { try {
if (param.tabs) { if (param.tabs) {
...@@ -490,8 +497,14 @@ export default { ...@@ -490,8 +497,14 @@ export default {
}, },
computed: { computed: {
bannerImage() { bannerImage() {
return process.uniEnv.qn_base_url + "banner-xx@3x.png"; return process.uniEnv.qn_base_url + "xuexibanner-p.png";
}, },
jianbianImage() {
return process.uniEnv.qn_base_url + "jianbian-p.png";
},
anzhuangwenjianImage() {
return process.uniEnv.qn_base_url + "wenjian-d.png";
},
}, },
onShow: function (param) { onShow: function (param) {
try { try {
...@@ -512,14 +525,12 @@ export default { ...@@ -512,14 +525,12 @@ export default {
.getVersionInfo(version) .getVersionInfo(version)
.then((res) => { .then((res) => {
let data = res.data; let data = res.data;
if(data.hasOwnProperty('is_audit') && data.is_audit == 0){ if (data.hasOwnProperty("is_audit") && data.is_audit == 0) {
that.tabs = that.tabs2; that.tabs = that.tabs2;
that.version = false that.version = false;
} }
}) })
.catch((err) => { .catch((err) => {});
});
}, },
stopPull() { stopPull() {
let that = this; let that = this;
...@@ -564,6 +575,24 @@ export default { ...@@ -564,6 +575,24 @@ export default {
stopTouchMove() { stopTouchMove() {
return false; return false;
}, },
//取文本第一张图片
imgUrlFun(str) {
var data = "";
str.replace(
/<img [^>]*src=['"]([^'"]+)[^>]*>/,
function (match, capture) {
data = capture;
}
);
return data;
},
//取文本信息
getText(str) {
return str
.replace(/<[^<>]+>/g, "")
.replace(/&nbsp;/gi, "")
.replace(/(\n)/g, "");
},
getNoticeList() { getNoticeList() {
let that = this; let that = this;
this.$u.api this.$u.api
...@@ -587,8 +616,11 @@ export default { ...@@ -587,8 +616,11 @@ export default {
res.data[i].create_at, res.data[i].create_at,
"yyyy.MM.dd hh:mm" "yyyy.MM.dd hh:mm"
); );
res.data[i].img = this.imgUrlFun(res.data[i].body);
res.data[i].text = this.getText(res.data[i].body);
} }
that.list = that.list.concat(res.data); that.list = that.list.concat(res.data);
console.log("消息列表", that.list);
} }
if (res.data.length >= 5) { if (res.data.length >= 5) {
that.isLoadMore = false; that.isLoadMore = false;
...@@ -715,72 +747,78 @@ export default { ...@@ -715,72 +747,78 @@ export default {
}, },
}); });
}, },
// 安装文件
goToDocument() {
this.$u.route({
url: 'pages/order/document',
})
},
//考核认证,通用认证,考试通过or未通过查询接口请求 //考核认证,通用认证,考试通过or未通过查询接口请求
getUserExamInfo() { getUserExamInfo() {
uni.hideLoading(); uni.hideLoading();
let that = this; let that = this;
let token = that.vuex_token; let token = that.vuex_token;
let length = this.examList.length; let length = this.examList.length;
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
let examId = this.examList[i].id; let examId = this.examList[i].id;
this.$u.api.getExamResult(examId) this.$u.api
.then((res) => { .getExamResult(examId)
if (res.code != 200) { .then((res) => {
console.log("getUserExamInfo 200 err"); if (res.code != 200) {
console.log("getUserExamInfo 200 err");
uni.showToast({
icon: "none",
title: "获取考试信息失败",
});
}
this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus; //i;//
this.examList[i].questionTime = res.data.questionTime;
let examResult = res.data.examLevelResult;
this.examList[i].status =
examResult != "" ? examResult : "未通过";
//动态获取条件
let ruleDisc = res.data.ruleDisc;
let targetIndex = ruleDisc.indexOf("(");
if (targetIndex) {
this.examList[i].condition = ruleDisc
.substr(targetIndex + 1)
.replace(")", "");
}
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data;
if (res.data.examStatus == 2) {
return;
}
if (res.data.examStatus == 1) {
that.examList[i].isComplete =
this.examList[i].status == "已通过";
that.examScore = res.data.examScore;
return;
}
if (res.data.examStatus == 0) {
that.userExamId = res.data.id;
}
})
.catch((err) => {
uni.hideLoading();
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "获取考试信息失败", title: "获取考试信息失败",
}); });
}
this.examList[i].examId = res.data.id;
this.examList[i].examStatus = res.data.examStatus; //i;//
this.examList[i].questionTime = res.data.questionTime;
let examResult = res.data.examLevelResult;
this.examList[i].status =
examResult != "" ? examResult : "未通过";
//动态获取条件
let ruleDisc = res.data.ruleDisc;
let targetIndex = ruleDisc.indexOf("(");
if (targetIndex) {
this.examList[i].condition = ruleDisc
.substr(targetIndex + 1)
.replace(")", "");
}
// examStatus 用户考试状态 0考试中 1考试完成 2未参与
that.exam = res.data;
if (res.data.examStatus == 2) {
return;
}
if (res.data.examStatus == 1) {
that.examList[i].isComplete =
this.examList[i].status == "已通过";
that.examScore = res.data.examScore;
return;
}
if (res.data.examStatus == 0) {
that.userExamId = res.data.id;
}
})
.catch((err) => {
uni.hideLoading();
uni.showToast({
icon: "none",
title: "获取考试信息失败",
}); });
});
} }
}, },
//跳转到assessment页面 //跳转到assessment页面
aaa(index) { aaa(index) {
//examStatus 用户考试状态 0考试中 1考试完成 2未参与 //examStatus 用户考试状态 0考试中 1考试完成 2未参与
//考试完成分成通过、未通过 //考试完成分成通过、未通过
getApp().globalData.questionTime = this.examList[ getApp().globalData.questionTime =
index this.examList[index].questionTime;
].questionTime;
var examInfo = this.examList[index]; var examInfo = this.examList[index];
wx.navigateTo({ wx.navigateTo({
url: "/pages/learn/assessment?examId=" + examInfo.id, url: "/pages/learn/assessment?examId=" + examInfo.id,
...@@ -801,6 +839,7 @@ export default { ...@@ -801,6 +839,7 @@ export default {
var news = { var news = {
body: e.body, body: e.body,
title: e.title, title: e.title,
create_at: e.create_at,
}; };
let that = this; let that = this;
wx.navigateTo({ wx.navigateTo({
...@@ -828,7 +867,7 @@ export default { ...@@ -828,7 +867,7 @@ export default {
.banner { .banner {
width: 690rpx; width: 690rpx;
height: 240rpx; height: 220rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
...@@ -854,26 +893,40 @@ export default { ...@@ -854,26 +893,40 @@ export default {
min-height: 370rpx; min-height: 370rpx;
margin-top: 36rpx; margin-top: 36rpx;
overflow: hidden; overflow: hidden;
background-color: #ffffff;
border-radius: 12rpx; border-radius: 12rpx;
padding: 30rpx;
} }
.notice-content {
background: #ffffff;
width: 100%;
border-radius: 12rpx;
overflow: hidden;
}
.notice-content-bottom {
height: 150rpx;
padding: 0 30rpx;
overflow: hidden;
}
.n-head { .n-head {
text-align: left; text-align: left;
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
margin-top: 30rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.news { .news {
height: 168rpx;
overflow: hidden; overflow: hidden;
margin-top: 30rpx; /* margin-top: 30rpx; */
white-space: nowrap;
text-overflow: ellipsis;
font-size: 24rpx; font-size: 24rpx;
color: #666666; color: #666666;
line-height: 34rpx; line-height: 34rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
margin-top: 16rpx;
} }
/* 在线学习 */ /* 在线学习 */
...@@ -893,9 +946,10 @@ export default { ...@@ -893,9 +946,10 @@ export default {
.jf-currency-class { .jf-currency-class {
width: 100%; width: 100%;
height: 180rpx; height: 180rpx;
position: absolute; /* position: absolute; */
position: relative;
border-radius: 12rpx; border-radius: 12rpx;
margin-top: 60rpx; margin-top: 80rpx;
} }
.title { .title {
...@@ -930,6 +984,7 @@ export default { ...@@ -930,6 +984,7 @@ export default {
.img { .img {
width: 160rpx; width: 160rpx;
height: 120rpx; height: 120rpx;
border-radius: 12rpx;
} }
.learn-img { .learn-img {
...@@ -943,6 +998,7 @@ export default { ...@@ -943,6 +998,7 @@ export default {
position: absolute; position: absolute;
bottom: 5rpx; bottom: 5rpx;
left: 30rpx; left: 30rpx;
border-radius: 10rpx;
} }
.right { .right {
...@@ -988,17 +1044,18 @@ swiper { ...@@ -988,17 +1044,18 @@ swiper {
} }
.jf-line { .jf-line {
display: flex;
justify-content: space-between;
width: 120rpx; width: 120rpx;
height: 52rpx; height: 52rpx;
border-radius: 26rpx; border-radius: 26rpx;
background-color: #ffffff; background-color: #ffffff;
color: #2272ff; color: #2272ff;
text-align: center; text-align: center;
padding-left: 20rpx; font-size: 24rpx;
padding-top: 6rpx; line-height: 52rpx;
margin-top: 20rpx; }
.red-color {
color: #FA5A49;
} }
.u-progress { .u-progress {
...@@ -1056,8 +1113,10 @@ swiper { ...@@ -1056,8 +1113,10 @@ swiper {
.notice-bottom-left { .notice-bottom-left {
font-size: 24rpx; font-size: 24rpx;
font-weight: 500;
color: #999999; color: #999999;
float: left; text-align: center;
margin-bottom: 20rpx;
} }
.notice-bottom-right { .notice-bottom-right {
...@@ -1094,7 +1153,7 @@ swiper { ...@@ -1094,7 +1153,7 @@ swiper {
.current-img { .current-img {
width: 100%; width: 100%;
height: 100%; height: 180rpx;
position: absolute; position: absolute;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<u-cell-group :border="false"> <u-cell-group :border="false">
<view v-for="(item, index) in items" :key="index"> <view v-for="(item, index) in items" :key="index">
<u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)"> <u-cell-item :value="item.value" :border-bottom="false" @click="handleClick(item.pathName)">
<image slot="icon" :src="qnPath + item.icon" :style="item.imageStyle"></image> <image slot="icon" :src="qnFile(item.icon)" :style="item.imageStyle"></image>
<view slot="title" class="item-title">{{item.title}}</view> <view slot="title" class="item-title">{{item.title}}</view>
<view slot="value" class="item-value">{{value}}</view> <view slot="value" class="item-value">{{value}}</view>
</u-cell-item> </u-cell-item>
...@@ -43,11 +43,12 @@ ...@@ -43,11 +43,12 @@
export default { export default {
data() { data() {
return { return {
qnPath: process.uniEnv.qn_base_url,
serviceTel: '18124099271', serviceTel: '18124099271',
showSuperButton: false, showSuperButton: false,
show: false, show: false,
content: '是否确认退出该账户?' content: '是否确认退出该账户?',
wodebeijingImage: '',
placeholderImage: ''
} }
}, },
computed: { computed: {
...@@ -122,12 +123,6 @@ ...@@ -122,12 +123,6 @@
headImageUrl() { headImageUrl() {
return this.avatar || this.placeholderImage return this.avatar || this.placeholderImage
}, },
wodebeijingImage() {
return util.imageCache(this, 'wodebeijing.png')
},
placeholderImage() {
return util.imageCache(this, 'touxiang.png')
},
headImageStyle() { headImageStyle() {
return this.avatar ? 'width:136rpx; height:136rpx;border-radius:68rpx' : 'width:144rpx; height:144rpx;border-radius:72rpx' return this.avatar ? 'width:136rpx; height:136rpx;border-radius:68rpx' : 'width:144rpx; height:144rpx;border-radius:72rpx'
}, },
...@@ -135,7 +130,7 @@ ...@@ -135,7 +130,7 @@
return this.avatar ? 136 : 144 return this.avatar ? 136 : 144
} }
}, },
onLoad() { async onLoad() {
app.trackPage('我的首页') app.trackPage('我的首页')
if(this.vuex_token ) { if(this.vuex_token ) {
if (!this.showSuperButton) { if (!this.showSuperButton) {
...@@ -146,9 +141,13 @@ ...@@ -146,9 +141,13 @@
this.getData() this.getData()
} }
} }
this.wodebeijingImage = this.qnFile('wodebeijing.png')
this.placeholderImage = this.qnFile('touxiang.png')
}, },
methods: { methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
getData() { getData() {
let self = this let self = this
app.getBaseInfo(self); app.getBaseInfo(self);
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
<NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" /> <NoOrder v-if="noMore" type="black" :customStyle="noOrderCustomStyle" />
<template v-else> <template v-else>
<view v-for="(item, index) in orderList" :key="item.orderId"> <view v-for="(item, index) in orderList" :key="item.orderId">
<OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick(item)" <OrderCell :orderData="item" :type="orderType" :location="dataValue" @click="handleClick"
@action="handleAction(item)"> </OrderCell> @action="handleClick"> </OrderCell>
</view> </view>
<u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" bgColor="#F4F5F7"></u-loadmore> <u-loadmore v-show="(pageNumber == 1 && loaded) || pageNumber > 2" :status="loadStatus" bgColor="#F4F5F7"></u-loadmore>
</template> </template>
...@@ -282,17 +282,15 @@ ...@@ -282,17 +282,15 @@
} }
}); });
}, },
viewOderItem(orderId) { // 跳转工单详情页面 handleClick(item, title) {
uni.navigateTo({ console.log(item, title)
url: 'pages/order/detail?id=' + orderId
})
},
handleClick(item) {
if(item.orderStatus===86 || item.orderStatus===88){ if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item) this.filish(item)
return return
} }
this.viewOderItem(item.orderId) uni.navigateTo({
url: 'pages/order/detail?id=' + item.orderId + '&title=' + title
})
}, },
filish(item){ filish(item){
// 去完工 // 去完工
...@@ -303,15 +301,16 @@ ...@@ -303,15 +301,16 @@
+ "&inGuaranteePeriod=" + item.inGuaranteePeriod + "&inGuaranteePeriod=" + item.inGuaranteePeriod
+ "&partnerCompanyId=" + item.partnerCompanyId + "&partnerCompanyId=" + item.partnerCompanyId
+ "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'') + "&auditResultsId=" + (item.auditResults?Object.keys(item.auditResults)[Object.keys(item.auditResults).length - 1]:'')
+ "&maintainStep=" + item.maintainStep
}) })
}, },
handleAction(item) { // handleAction(item) {
if(item.orderStatus===86 || item.orderStatus===88){ // if(item.orderStatus===86 || item.orderStatus===88){
this.filish(item) // this.filish(item)
return // return
} // }
this.viewOderItem(item.orderId) // this.viewOderItem(item.orderId)
}, // },
handleClickSearch() { handleClickSearch() {
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/search' url: 'pages/order/search'
......
<template> <template>
<view> <view>
<u-navbar <u-navbar back-icon-color="#000000" :background="background" title-color="#000000" :border-bottom="false">
back-icon-color="#000000" </u-navbar>
:background="background" <view class="title">
title-color="#000000" {{ title }}
:border-bottom="false"> </view>
</u-navbar> <view class="creat_at">
<view class="title"> {{create_at}}
{{ title }}
</view> </view>
<view class="u-content"> <view class="u-content">
<u-parse :html="body" :tag-style="style"></u-parse> <u-parse :html="body" :tag-style="style"></u-parse>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
title: '', title: "",
body: '' body: "",
} create_at: "",
}, };
onLoad() { },
getApp().trackPage('消息通知详情页') onLoad() {
var that = this; getApp().trackPage("消息通知详情页");
const eventChannel = this.getOpenerEventChannel() var that = this;
eventChannel.on('acceptDataFromLearn', function(data) { const eventChannel = this.getOpenerEventChannel();
that.title = data.title; eventChannel.on("acceptDataFromLearn", function (data) {
that.body = data.body; that.title = data.title;
}) that.body = data.body;
this.$u.mpShare.path = '' that.create_at = data.create_at;
}, console.log(data);
} });
</script> this.$u.mpShare.path = "";
},
<style> };
.title{ </script>
font-size: 32rpx;
font-weight: bold; <style>
margin-left: 30rpx; .title {
margin-top: 30rpx; font-size: 32rpx;
} font-weight: bold;
.u-content{ margin-left: 30rpx;
font-size: 24rpx; margin-top: 30rpx;
line-height: 36rpx; }
color: #666666; .u-content {
margin-left: 30rpx; font-size: 24rpx;
margin-top: 30rpx; line-height: 36rpx;
margin-right: 30rpx; color: #666666;
} margin-left: 30rpx;
</style> margin-right: 30rpx;
}
.creat_at {
font-size: 24rpx;
color: #999999;
margin-left: 30rpx;
margin-top: 20rpx;
}
rich-text {
margin-top: 40rpx;
display: block;
}
</style>
<template> <template>
<view class=""> <view class="">
<!-- <w-navbar></w-navbar> -->
<view class="backView"> <view class="backView">
<view class="login-block" v-if="needAuth"> <view class="login-block" v-if="needAuth">
<u-image class="u-flex u-row-center logo" :src="logo" width="200" height="200"> <u-image :fade="false" class="u-flex u-row-center logo" :src="logo" width="200" height="200">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
<u-image class="u-flex u-row-center logo2" :src="logo2" width="214" height="60"> <u-image :fade="false" class="u-flex u-row-center logo2" :src="logo2" width="214" height="60">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
</view> </view>
<view class="bind-block" v-else> <view class="bind-block" v-else>
<u-image class="u-flex u-row-between logo" :src="logo" width="148" height="148"> <u-image :fade="false" class="u-flex u-row-between logo" :src="logo" width="148" height="148">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
...@@ -38,7 +39,6 @@ const app = getApp() ...@@ -38,7 +39,6 @@ const app = getApp()
export default { export default {
data() { data() {
return { return {
qnPath: process.uniEnv.qn_base_url,
needAuth: true, needAuth: true,
TimeID: -1, TimeID: -1,
loginTitle: '用户登录', loginTitle: '用户登录',
...@@ -50,10 +50,10 @@ export default { ...@@ -50,10 +50,10 @@ export default {
}, },
computed: { computed: {
logo() { logo() {
return util.imageCache(this, 'logo.png') return this.qnFile('logo.png')
}, },
logo2() { logo2() {
return util.imageCache(this, 'logo-2.png') return this.qnFile('logo-2.png')
}, },
}, },
onLoad(e) { onLoad(e) {
...@@ -67,6 +67,9 @@ export default { ...@@ -67,6 +67,9 @@ export default {
this.getCode() this.getCode()
}, },
methods: { methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
async getCode() { async getCode() {
login.appLogin().then(res => { login.appLogin().then(res => {
this.code = res.code this.code = res.code
...@@ -184,7 +187,7 @@ export default { ...@@ -184,7 +187,7 @@ export default {
} }
}) })
} else { } else {
this.toLogin(params) that.toLogin(params)
} }
} else { } else {
uni.showModal({ uni.showModal({
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
:border-bottom="false" title-bold></u-navbar> :border-bottom="false" title-bold></u-navbar>
<view class="wallet-content-view"> <view class="wallet-content-view">
<view class="header-view"> <view class="header-view">
<image class="header-image" :src="qianbaobeijing"></image> <image class="header-image" :src="qnFile('qianbaobeijing.png')"></image>
</view> </view>
<view class="survey-view"> <view class="survey-view">
<view class="survey-top-view"> <view class="survey-top-view">
...@@ -109,9 +109,6 @@ ...@@ -109,9 +109,6 @@
imageUrl() { imageUrl() {
return process.uniEnv.qn_base_url return process.uniEnv.qn_base_url
}, },
qianbaobeijing() {
return util.imageCache(this, 'qianbaobeijing.png')
},
buttonStyle() { buttonStyle() {
return { return {
width: "200rpx", width: "200rpx",
...@@ -139,6 +136,9 @@ ...@@ -139,6 +136,9 @@
this.loadStatement() this.loadStatement()
}, },
methods: { methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
// 提现 // 提现
handleClickWithdraw() { handleClickWithdraw() {
this.$u.route({ this.$u.route({
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</view> </view>
</view> </view>
</view> </view>
<image :src="liushuibeijingImage" class="head-back-image" mode="widthFix"></image> <image :src="qnFile('liushuibeijing.png')" class="head-back-image" mode="widthFix"></image>
<view class="list-view" v-if="hasInfo"> <view class="list-view" v-if="hasInfo">
<view class="u-flex u-row-center" v-if="loading"> <view class="u-flex u-row-center" v-if="loading">
<u-gap height="20"></u-gap> <u-gap height="20"></u-gap>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</view> </view>
</view> </view>
<view class="list-view-empty" v-else> <view class="list-view-empty" v-else>
<u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="true" duration="450"> <u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="false">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
...@@ -64,9 +64,6 @@ ...@@ -64,9 +64,6 @@
} }
}, },
computed: { computed: {
liushuibeijingImage() {
return util.imageCache(this, 'liushuibeijing.png')
},
imageUrl() { imageUrl() {
return process.uniEnv.qn_base_url return process.uniEnv.qn_base_url
}, },
...@@ -74,7 +71,7 @@ ...@@ -74,7 +71,7 @@
return this.loading || this.info.payableRecordExtendDtos && this.info.payableRecordExtendDtos.length return this.loading || this.info.payableRecordExtendDtos && this.info.payableRecordExtendDtos.length
}, },
banner() { banner() {
return util.imageCache(this, 'receipt.png') return this.qnFile('receipt.png')
}, },
}, },
onLoad() { onLoad() {
...@@ -82,6 +79,9 @@ ...@@ -82,6 +79,9 @@
this.loadPayRecord() this.loadPayRecord()
}, },
methods: { methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
async loadPayRecord() { async loadPayRecord() {
let self = this let self = this
self.loading = true self.loading = true
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</view> </view>
</view> </view>
</view> </view>
<image :src="liushuibeijingImage" class="head-back-image" mode="widthFix"></image> <image :src="qnFile('liushuibeijing.png')" class="head-back-image" mode="widthFix"></image>
<view class="list-view" v-if="hasInfo"> <view class="list-view" v-if="hasInfo">
<view class="u-flex u-row-center" v-if="loading"> <view class="u-flex u-row-center" v-if="loading">
<u-gap height="20"></u-gap> <u-gap height="20"></u-gap>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</view> </view>
</view> </view>
<view class="list-view-empty" v-else> <view class="list-view-empty" v-else>
<u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="true" duration="450"> <u-image class="empty-image" :src="banner" width="374" height="246" mode="widthFix" :fade="false">
<u-loading slot="loading"></u-loading> <u-loading slot="loading"></u-loading>
<view slot="error" style="font-size: 24rpx;">加载失败</view> <view slot="error" style="font-size: 24rpx;">加载失败</view>
</u-image> </u-image>
...@@ -84,14 +84,11 @@ ...@@ -84,14 +84,11 @@
} }
}, },
liushuibeijingImage() {
return util.imageCache(this, 'liushuibeijing.png')
},
imageUrl() { imageUrl() {
return process.uniEnv.qn_base_url return process.uniEnv.qn_base_url
}, },
banner() { banner() {
return util.imageCache(this, 'receipt.png') return this.qnFile('receipt.png')
}, },
hasInfo() { hasInfo() {
return this.loading || this.data.statementList && this.data.statementList.length return this.loading || this.data.statementList && this.data.statementList.length
...@@ -101,7 +98,10 @@ ...@@ -101,7 +98,10 @@
getApp().trackPage('收入流水列表页') getApp().trackPage('收入流水列表页')
this.loadStatement() this.loadStatement()
}, },
methods: { methods: {
qnFile(src) {
return process.uniEnv.qn_base_url + src
},
bindDateChange: function(e) { bindDateChange: function(e) {
this.date = e.target.value this.date = e.target.value
this.loadStatement() this.loadStatement()
......
<template> <template>
<view class="com-content"> <view class="pg-complete">
<complete-check :show="completeCheckStatus" :list-data="completeCheckResult" :pass="pass" @close="closeCheckResult" @handle="handerProgrom" @change="confirm"></complete-check> <complete-check :show="completeCheck.status" :list-data="completeCheck.result" :pass="pass" @close="closeCheckResult" @confirm="confirm" :confirm-button-text="completeCheck.confirmText" :cancel-button-text="completeCheck.cancelText"></complete-check>
<view class="u-wrap"> <view class="com-content">
<u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" title="完工信息" title-bold></u-navbar> <u-navbar :background="{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" :title="list[tabIndex].panelName" title-bold></u-navbar>
<u-tabs v-show="showTab" class="order-tabs" ref="tabs" :current="tabIndex" name="panelName" :list="list" @change="tabsChange" :is-scroll="false" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs> <u-tabs class="order-tabs" ref="tabs" :current="current" name="panelName" :list="tabList" @change="swichMenu" bg-color="#2272FF" inactive-color="#a6c6ff" active-color="#fff" height="80" font-size="32"></u-tabs>
<view :class="['u-menu-wrap', {'one': !showTab}]"> <view class="u-menu-wrap">
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" v-if="list[tabIndex].items.length > 1 && showTab"> <scroll-view :scroll-top="scrollRightTop" style="height: 100%;" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll" :scroll-into-view="itemId">
<view v-for="(item,index) in list[tabIndex].items" :key="index" class="u-tab-item" <u-form :model="form" ref="uForm">
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)"> <template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])">
<text class="u-line-1">{{item.name}}</text> <view class="class-item" :id="'item' + groupIndex" :key="groupIndex">
</view> <view class="title">{{groupItem.name}}</view>
</scroll-view> <view class="class-bd">
<scroll-view :scroll-top="scrollRightTop" scroll-y scroll-with-animation class="right-box" @scroll="rightScroll" :scroll-into-view="itemId"> <u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
<u-form :model="form" ref="uForm"> :prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200" :id="`item${item.fieldsId}`">
<template v-for="(groupItem, groupIndex) in (list.length>0?list[tabIndex].items:[])"> <view class="label" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'">
<view class="class-item" :key="groupIndex"> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="title" v-if="groupItem.name !== '基本信息'">{{groupItem.name}}</view> {{item.fieldsTitle}}
<view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200" :id="`item${item.fieldsId}`">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="item.formType!=='location'&&item.formType!=='form'&&item.formType!=='label'">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}}
</view>
<template v-if="item.fieldsType">
<xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType"
:itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' @value-change="fieldValueChange">
</xh-input>
<xh-multi-input v-else-if="item.formType==='multiinput'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-multi-input>
<xh-radio v-else-if="item.formType==='radio'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-radio>
<xh-checkbox v-else-if="item.formType==='checkbox'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-checkbox>
<xh-select v-else-if="item.formType==='select'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-select>
<view v-else-if="item.formType==='file'">
<xh-files
:ref="`fileChild${groupIndex}${itemIndex}`"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :categoryId="categoryId" :value='form[item.fieldsName] || []'
@value-change="fieldValueChange">
<template v-slot>
<view class="img-list">
<u-image class="pic" width="160rpx" height="160rpx" :border-radius="10" @click="selectUpload(JSON.stringify(item), groupIndex, itemIndex)" :src="uploadImage"></u-image>
</view>
</template>
</xh-files>
</view> </view>
<template v-if="item.fieldsType">
<xh-location v-else-if="item.formType==='location'" <xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :disabled="item.disabled || false" :slotContent="item.fieldsInfo" @value-change="fieldValueChange">
@value-change="fieldValueChange"> </xh-input>
</xh-location> <xh-multi-input v-else-if="item.formType==='multiinput'"
<xh-scan v-else-if="item.formType==='scan'" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' @value-change="fieldValueChange">
@value-change="fieldValueChange"> </xh-multi-input>
</xh-scan> <xh-radio v-else-if="item.formType==='radio'"
<xh-picker v-else-if="item.formType==='picker'" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :disabled="item.disabled || false" @value-change="fieldValueChange">
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' </xh-radio>
@value-change="fieldValueChange"> <xh-checkbox v-else-if="item.formType==='checkbox'"
</xh-picker> :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
<xh-service-measure v-else-if="item.formType==='servicemeasure'" @value-change="fieldValueChange">
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :orderId="orderId" :categoryId="categoryId" </xh-checkbox>
:orderServiceType="orderServiceType" :specificationId="form['specificationId'] || 0" :value="form[item.fieldsName]" <xh-select v-else-if="item.formType==='select'"
@value-change="fieldValueChange"> :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
</xh-service-measure> @value-change="fieldValueChange">
<xh-time v-else-if="item.formType==='time'" </xh-select>
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' <view v-else-if="item.formType==='file'">
@value-change="fieldValueChange"> <xh-files
</xh-time> :ref="`fileChild${groupIndex}${itemIndex}`"
<xh-service-more v-else-if="item.formType==='form'" :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :categoryId="categoryId" :value='form[item.fieldsName] || []'
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :order-id="orderId" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange"> @value-change="fieldValueChange">
</xh-service-more> <template v-slot>
<xh-label v-else-if="item.formType==='label'" <view class="img-list">
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'> <u-image class="pic" width="160rpx" height="160rpx" :border-radius="10" @click="selectUpload(JSON.stringify(item), groupIndex, itemIndex)" :src="uploadImage"></u-image>
</xh-label> </view>
</template> </template>
</u-form-item> </xh-files>
</view> </view>
</view>
</template>
</u-form>
</scroll-view>
<xh-location v-else-if="item.formType==='location'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-location>
<xh-scan v-else-if="item.formType==='scan'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-scan>
<xh-service-measure v-else-if="item.formType==='servicemeasure'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :orderId="orderId" :categoryId="categoryId"
:orderServiceType="orderServiceType" :specificationId="form['specificationId'] || 0" :value="form[item.fieldsName]"
@value-change="fieldValueChange">
</xh-service-measure>
<xh-time v-else-if="item.formType==='time'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-time>
<xh-service-more v-else-if="item.formType==='form'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :order-id="orderId" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-service-more>
<xh-label v-else-if="item.formType==='label'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'>
</xh-label>
</template>
</u-form-item>
</view>
</view>
</template>
</u-form>
</scroll-view>
</view> </view>
<view :class="['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]"> <view :class="['btn-wrap', 'flex-xc', {'btn-bottom': tabIndex > 0}]">
<u-button class="btn-submit" @click="saveComplete" <u-button class="btn-submit" @click="saveComplete"
type="primary" shape="circle" :custom-style="customStyle" :hover-class="submitStatus ? '' : 'none'"> type="primary" shape="circle" :custom-style="customStyle" :hover-class="submitStatus ? '' : 'none'">
暂存 暂存
</u-button> </u-button>
<u-button class="btn-submit" @click="orderFinish" v-if="tabIndex===list.length - 1" <u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle"
type="primary" shape="circle" :custom-style="buttonStyle" :hover-class="submitStatus ? '' : 'none'">
完工
</u-button>
<u-button class="btn-submit" @click="nextStep" :custom-style="buttonStyle" v-else
type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'"> type="primary" shape="circle" :hover-class="submitStatus ? '' : 'none'">
下一步 {{ tabIndex === list.length - 1 ? '提交' : '下一步' }}
</u-button> </u-button>
</view> </view>
</view> </view>
...@@ -122,14 +106,105 @@ ...@@ -122,14 +106,105 @@
import XhFiles from '@/components/createCom/XhFiles.vue' import XhFiles from '@/components/createCom/XhFiles.vue'
import XhLocation from '@/components/createCom/XhLocation.vue' import XhLocation from '@/components/createCom/XhLocation.vue'
import XhScan from '@/components/createCom/XhScan.vue' import XhScan from '@/components/createCom/XhScan.vue'
import XhPicker from '@/components/createCom/XhPicker.vue'
import XhTime from '@/components/createCom/XhTime.vue' import XhTime from '@/components/createCom/XhTime.vue'
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue' import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue'
import XhServiceMore from "../../components/createCom/XhServiceMore"; import XhServiceMore from "../../components/createCom/XhServiceMore"
import XhLabel from "../../components/createCom/XhLabel"; import XhLabel from "../../components/createCom/XhLabel"
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index'; import baseFile from '@/components/upload/index'
// import XhRadio from '@/components/createCom/XhRadio.vue' import Detail from "@/components/order/detail.vue"
// 表单类型map
const formType = new Map([
['text', ['input','textarea']],
['password', ['password','input']],
['textarea', ['input','digit']],
['number', ['input','digit']],
['decimal', ['input','digit']],
['double', ['input','digit']],
['integer', ['input','digit']],
['string', ['input','text']],
['jscode', ['input','text']],
['multiinput', ['multiinput','text']],
['select', ['select','text']],
['specifications', ['select','text']],
['radio', ['radio','text']],
['checkbox', ['checkbox','text']],
['file', ['file','text']],
['photos', ['file','text']],
['location', ['location','text']],
['scan', ['scan','text']],
['machine_code', ['scan','text']],
['service_measures', ['servicemeasure','text']],
['time', ['time','text']],
['date', ['time','text']],
['form', ['form','text']],
['label', ['label','text']],
])
/**
* modal 弹窗校验
* @description 用于校验下一步的动作
* @property {String} name 当前的订单阶段
* @property {Boolean} pass 是否通过校验
* @property {String}} type 是否有二次勘测或二次安装
* @property {submit} submit 提交或下一步
*/
const actions = (name, pass, type, submit) => {
const handerProgrom = {
perfect: {
confirmText: '去完善',
action: 'handerProgrom'
},
appointment: {
confirmText: '好的,再次预约',
action: 'appointment'
},
next: {
confirmText: '下一步',
action: 'nextAction'
},
noPerfectSubmit: {
confirmText: '去完善',
action: 'handerProgrom',
cancelText: '部分提交',
cancelAction: 'appointment'
},
submit: {
confirmText: '提交',
action: 'orderFinish',
},
confirm: {
confirmText: '确定',
action: 'nextAction',
}
}
if (name === 'partnerInspectItem') { // 勘察
if (!pass) return handerProgrom.perfect
return type ? (type === '01' ? handerProgrom.next : handerProgrom.appointment) : handerProgrom.perfect
} else if (name === 'partnerInstallItem') { // 安装
let hander = ''
switch (type){
case '01': // 安装完成
hander = !pass ? handerProgrom.perfect : handerProgrom.next
break;
case '02': // 二次安装
hander = !pass ? handerProgrom.noPerfectSubmit : handerProgrom.appointment
break;
case '03': //不安装
hander = handerProgrom.confirm
break;
default:
hander = handerProgrom.perfect
break;
}
return hander
} else { // 基础信息
if (!pass) return handerProgrom.perfect
return submit ? handerProgrom.submit : handerProgrom.next
}
}
export default { export default {
data() { data() {
return { return {
...@@ -143,7 +218,7 @@ ...@@ -143,7 +218,7 @@
tabIndex: 0, tabIndex: 0,
scrollTop: 0, //tab标题的滚动条位置 scrollTop: 0, //tab标题的滚动条位置
oldScrollTop: 0, oldScrollTop: 0,
current: 0, // 预设当前项的值 current: null, // 预设当前项的值
menuHeight: 0, // 左边菜单的高度 menuHeight: 0, // 左边菜单的高度
menuItemHeight: 0, // 左边菜单item的高度 menuItemHeight: 0, // 左边菜单item的高度
itemId: '', // 栏目右边scroll-view用于滚动的id itemId: '', // 栏目右边scroll-view用于滚动的id
...@@ -155,8 +230,14 @@ ...@@ -155,8 +230,14 @@
form: { // 一维表单 form: { // 一维表单
}, },
submitBtnStatus: false, submitBtnStatus: false,
completeCheckStatus: false, completeCheck: {
completeCheckResult: [], status: false,
resulut: [],
confirmText: '去完善',
cancelText: '',
action: '',
cancelAction: ''
},
waitHandlerPanelIndex: 0, waitHandlerPanelIndex: 0,
waitHandlerGroupIndex: 0, waitHandlerGroupIndex: 0,
waitHandlerEleIndex: 0, waitHandlerEleIndex: 0,
...@@ -174,7 +255,8 @@ ...@@ -174,7 +255,8 @@
takeStatus: false, takeStatus: false,
currentItemDate:{}, currentItemDate:{},
photoItem: {}, photoItem: {},
showTab: true maintainStep: 'partnerInspectItem',
// showTab: true,
} }
}, },
components: { components: {
...@@ -186,11 +268,11 @@ ...@@ -186,11 +268,11 @@
XhFiles, XhFiles,
XhLocation, XhLocation,
XhScan, XhScan,
XhPicker,
XhTime, XhTime,
XhServiceMeasure, XhServiceMeasure,
XhServiceMore, XhServiceMore,
XhLabel, XhLabel,
Detail,
'take-photo': takePhoto 'take-photo': takePhoto
}, },
mixins: [baseFile], mixins: [baseFile],
...@@ -200,13 +282,15 @@ ...@@ -200,13 +282,15 @@
onLoad(option) { onLoad(option) {
getApp().trackPage('订单完工信息页') getApp().trackPage('订单完工信息页')
if (option) { if (option) {
this.maintainStep = option.maintainStep
this.orderId = option.orderId this.orderId = option.orderId
this.categoryId = option.categoryId this.categoryId = option.categoryId
this.orderServiceType = decodeURIComponent(option.orderServiceType) this.orderServiceType = decodeURIComponent(option.orderServiceType)
this.inGuaranteePeriod = option.inGuaranteePeriod this.inGuaranteePeriod = option.inGuaranteePeriod
this.partnerCompanyId = option.partnerCompanyId this.partnerCompanyId = option.partnerCompanyId
this.auditResultsId = option.auditResultsId this.auditResultsId = option.auditResultsId
this.showTab =option.partnerCompanyName == '挚达充电桩'
// this.showTab =item.partnerCompanyName == '挚达充电桩'
} else { } else {
this.orderId = 11880091 this.orderId = 11880091
this.categoryId = 1100000214 this.categoryId = 1100000214
...@@ -215,14 +299,13 @@ ...@@ -215,14 +299,13 @@
} }
this.getCompleteData() this.getCompleteData()
}, },
onReady() {
// 导航栏滚动切换
this.getMenuItemTop()
},
updated() { updated() {
//console.log(this.form.name, 'form.name') //console.log(this.form.name, 'form.name')
}, },
computed: { computed: {
tabList() { // 没有数据的时候tab要有占位数据,不然有页面有晃动
return this.list.length > 0 ? this.list[this.tabIndex].items : [{name:''}]
},
mixingImage() { mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png' return process.uniEnv.qn_base_url + 'mixing.png'
}, },
...@@ -258,11 +341,13 @@ ...@@ -258,11 +341,13 @@
}, },
methods: { methods: {
getCompleteData() {//获取工单配置的完工项目 getCompleteData() {//获取工单配置的完工项目
let self = this uni.showLoading({
if(self.orderId){ title: '加载中'
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => { })
if(this.orderId){
this.$u.api.getCompleteConfigAndData(this.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
self.initData(res) this.initData(res)
} else { } else {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: res.message, title: res.message,
...@@ -273,100 +358,33 @@ ...@@ -273,100 +358,33 @@
} }
}, },
initData(res) { initData(res) {
for (var item of res.data.config) { this.form = res.data.value || {}
for (var i of item.items) {
for (var d of i.items) { const list = res.data.config.sort((a, b) => a.order - b.order)
var inputType = 'text' list.forEach((item, index) => {
var formType = '' if (this.maintainStep === item.panelFieldsName) this.tabIndex = index
var type = d.fieldsType.toLocaleLowerCase() item.items.forEach(v => {
switch (type) { v.items.forEach(d => {
case 'text': const type = d.fieldsType.toLocaleLowerCase()
inputType = 'textarea' const formMap = formType.get(type) || formType.get('text')
formType = 'input' d.formType = formMap[0]
break d.inputType = formMap[1]
case 'password':
inputType = 'password'
formType = 'input'
break
case 'textarea':
case 'number':
case 'decimal':
case 'double':
case 'integer':
formType = 'input'
inputType = 'digit'
break
case 'string':
formType='input',
inputType = 'text'
break
case 'multiinput':
formType = 'multiinput'
inputType = 'text'
break;
case 'select':
case 'specifications':
formType = 'select'
inputType = 'text'
break
case 'radio':
formType = 'radio'
inputType = 'text'
break
case 'checkbox':
formType = 'checkbox'
inputType = 'text'
break
case 'file':
case 'photos':
formType = 'file'
inputType = 'text'
break
case 'location':
formType = 'location'
inputType = 'text'
break
case 'scan':
case 'machine_code':
formType = 'scan'
inputType = 'text'
break
case 'picker':
case 'mutipicker':
formType = 'picker'
inputType = 'text'
break
case 'service_measures':
formType = 'servicemeasure'
inputType = 'text'
break
case 'time':
case 'date':
formType = 'time'
inputType = 'text'
break
case 'form':
formType = 'form'
inputType = 'text'
break
case 'label':
formType = 'label'
inputType = 'text'
break
}
d.formType = formType
d.inputType = inputType
if (d.fieldsId == 200 && res.data.value) { if (d.fieldsId == 200 && res.data.value) {
d.required = res.data.value['paymentMethodsType'] !='03' d.required = res.data.value['paymentMethodsType'] != '03'
} }
} if (d.fieldsId === 252 || d.fieldsId === 253) { // 申请费用计算
} this.calcMoney()
} }
this.list = res.data.config })
this.showTab = this.list.length > 1 })
this.form = res.data.value || {} })
this.list = list
// this.showTab = this.list.length > 1
this.current = 0
// 异常单处理 // 异常单处理
if (this.auditResultsId) this.checkCompleteError() if (this.auditResultsId) this.checkCompleteError()
uni.hideLoading()
}, },
checkCompleteError() { // 异常单定位错误项 checkCompleteError() { // 异常单定位错误项
let self = this let self = this
...@@ -422,90 +440,173 @@ ...@@ -422,90 +440,173 @@
}) })
}, },
checkCompleteItem(){ checkCompleteItem(){
let self = this
let checkResult = [] let checkResult = []
let pass = true let pass = true
let first = true let first = true
self.list.forEach((panel, panelIndex)=>{ const lists = this.tabList
let panelResult = {label: panel.panelName, submitted: 0, required: 0, pass: true} lists.forEach((group, groupIndex) =>{
panel.items.forEach((group, groupIndex) =>{ const checkRequired = group.items.some(v => v.required)
if (checkRequired) {
let panelResult = {label: group.name, submitted: 0, required: 0, pass: true}
group.items.forEach((ele, eleIndex)=>{ group.items.forEach((ele, eleIndex)=>{
if(ele.required){ if(ele.required){
panelResult.required++ panelResult.required++
let value = self.form[ele.fieldsName] let value = this.form[ele.fieldsName]
if(value&&!Array.isArray(value)){ if(value&&!Array.isArray(value)){
panelResult.submitted++ panelResult.submitted++
}else if(value&&Array.isArray(value)&&value.length > 0){ }else if(value&&Array.isArray(value)&&value.length > 0){
panelResult.submitted++ panelResult.submitted++
}else if(first){// 记录第一个 为空 并且需要必填的项 用于定位 }else if(first){// 记录第一个 为空 并且需要必填的项 用于定位
first = false first = false
self.waitHandlerPanelIndex = panelIndex this.waitHandlerPanelIndex = this.tabIndex
self.waitHandlerGroupIndex = groupIndex this.waitHandlerGroupIndex = groupIndex
self.waitHandlerEleIndex = eleIndex this.waitHandlerEleIndex = eleIndex
self.oldItemId = `item${ele.fieldsId}` this.oldItemId = `item${ele.fieldsId}`
} }
} }
}) })
}) panelResult.pass = panelResult.required <= panelResult.submitted
panelResult.pass = panelResult.required <= panelResult.submitted pass = pass&&panelResult.pass
pass = pass&&panelResult.pass checkResult.push(panelResult)
checkResult.push(panelResult) }
}) })
console.log(checkResult) console.log(checkResult)
self.completeCheckResult = checkResult this.completeCheck.result = checkResult
return pass return pass
}, },
confirm(){// 检查结果窗口 确认回调 // 检查结果窗口取消回调
uni.reLaunch({ closeCheckResult(){
url: '/pages/index/order?type=3' this.completeCheck.status = false
}) this[this.completeCheck.cancelAction]()
}, },
closeCheckResult(){// 检查结果窗口取消回调 // 检查结果窗口 确认回调
this.completeCheckStatus = false confirm(){
this.completeCheck.status = false
this[this.completeCheck.action]()
}, },
handerProgrom(){// 检查结果窗口 去处理回调 定位到缺失的项 // 去完善
this.completeCheckStatus = false handerProgrom(){
this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex) this.locationCompleteItem(this.waitHandlerPanelIndex,this.waitHandlerGroupIndex,this.waitHandlerEleIndex)
}, },
// 去预约
async appointment() {
const save = await this.nextStepSaveData()
if (save) {
uni.reLaunch({
url: '/pages/index/order?type=0'
})
}
},
// 下一步动作
async nextAction() {
const save = await this.nextStepSaveData()
if (this.tabIndex < this.list.length - 1 && save) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.current = 0
const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
if (this.oldItemId) this.itemId = this.oldItemId
this.oldItemId = ''
})
}
},
// 下一步弹窗处理
nextStep() {
this.pass = this.checkCompleteItem()
const name = this.list[this.tabIndex].panelFieldsName
const type = name === 'partnerInspectItem' ? this.form.inspectConclusionType : this.form.constructionConclusionType
const submit = this.tabIndex === this.list.length - 1
const result = actions(name, this.pass, type, submit)
this.completeCheck.status = true
this.completeCheck.confirmText = result.confirmText
this.completeCheck.action = result.action
this.completeCheck.cancelText = result.cancelText || ''
this.completeCheck.cancelAction = result.cancelAction || ''
},
// 下一步数据保存
nextStepSaveData() {
const params = {
maintainFields: this.handleSaveData(),
currentStep: this.list[this.tabIndex].panelFieldsName,
nextStep: this.list[this.tabIndex + 1].panelFieldsName,
}
return this.$u.api.completeNextStep(params, this.orderId).then((res)=>{
if (res.code == 200) {
return Promise.resolve(true)
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
return Promise.resolve(false)
}
})
},
tabsChange(index){
this.tabIndex = index
this.arr = []
this.scrollRightTop = 0;
this.current = 0;
this.$nextTick(function() {
if (this.oldItemId)this.itemId = this.oldItemId
this.getMenuItemTop()
})
},
locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项 locationCompleteItem(panelIndex,groupIndex,eleIndex){ // 页面定位到某一项
this.tabIndex = panelIndex this.tabIndex = panelIndex
this.arr = [] this.current = groupIndex;
this.scrollRightTop = 0; this.itemId = ''
this.current = 0;
this.$nextTick(function() { this.$nextTick(function() {
this.swichMenu(groupIndex) if (this.oldItemId)this.itemId = this.oldItemId
}) })
}, },
// 提交订单
orderFinish(){ orderFinish(){
let self = this const param = this.handleSaveData()
let pass = this.checkCompleteItem() this.$u.api.saveCompleteData(param,this.orderId).then((res)=>{
if(!pass){ if (res.code == 200) {//完工项信息保存成功再次完工工单
self.completeCheckStatus = true if(this.inGuaranteePeriod === 'Y'){
}else{// 先保存完工项 this.$u.api.inOrderFinish(this.orderId).then((res)=>{
let param = self.handleSaveData() if (res.code == 200) {
self.$u.api.saveCompleteData(param,self.orderId).then((res)=>{ this.$refs.uToast.show({
if (res.code == 200) {//完工项信息保存成功再次完工工单 title: '提交成功',
console.log("完工"); type: 'success',
this.pass = pass callback: () => {
if(self.inGuaranteePeriod === 'Y'){ uni.reLaunch({
self.$u.api.inOrderFinish(self.orderId).then((res)=>{ url: '/pages/index/order?type=3'
console.log(res) })
self.completeCheckStatus = true }
}) })
}else{ }
self.$u.api.outOrderFinish({customerPayType:'CASH'}, self.orderId).then((res)=>{ })
console.log(res) }else{
self.completeCheckStatus = true this.$u.api.outOrderFinish({customerPayType:'CASH'}, this.orderId).then((res)=>{
}) if (res.code == 200) {
} this.$refs.uToast.show({
} else { title: '提交成功',
this.$refs.uToast.show({ type: 'success',
title: res.message, callback: () => {
type: 'error', uni.reLaunch({
}) url: '/pages/index/order?type=3'
} })
}) }
} })
}
})
}
} else {
this.$refs.uToast.show({
title: res.message,
type: 'error',
})
}
})
}, },
calMaterialCraftListAmount(arr){ calMaterialCraftListAmount(arr){
let amount = 0 let amount = 0
...@@ -539,49 +640,34 @@ ...@@ -539,49 +640,34 @@
innerItem = groupItem.items[data.itemIndex] innerItem = groupItem.items[data.itemIndex]
} }
if(innerItem.fieldsType ==='multiInput'){ if(innerItem.fieldsType === 'multiInput'){
// 多个输入框的值触发 // 多个输入框的值触发
let key = Object.keys(data.value)[0] let key = Object.keys(data.value)[0]
this.form[key] = data.value[key] this.form[key] = data.value[key]
}else{ }else{
this.$set(this.form,innerItem.fieldsName,data.value) this.$set(this.form,innerItem.fieldsName,data.value)
} }
if (innerItem.fieldsId == 199) { // 选不需要收款的时候,收款金额修改为非必选
for (var list of this.list) { // 同时修改基本信息和完工信息 if (innerItem.fieldsId === 199) { // 选不需要收款的时候,收款金额修改为非必选
for (var item of list.items) { const row = groupItem.items.find(v => v.fieldsId === 200)
for (var i of item.items) { row.required = data.value !='03'
if (i.fieldsId == 200) { }
i.required = data.value !='03'
} if (innerItem.fieldsId === 252 || innerItem.fieldsId === 253) { // 申请费用计算
} this.calcMoney()
}
}
}
},
nextStep() {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.current = 0
this.leftMenuStatus(0)
const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
this.oldItemId = `item${itemId}`
this.$nextTick(async () => {
if (this.oldItemId) this.itemId = this.oldItemId
})
} }
}, },
tabsChange(index){ // 申请费用计算
this.tabIndex = index calcMoney() {
this.arr = [] const price = parseInt(this.form.pipe) || 0
this.scrollRightTop = 0; const pipeUseLength = parseFloat(this.form.pipeUseLength) || 0
this.current = 0; if (price && pipeUseLength) {
this.leftMenuStatus(0) const money = (price * pipeUseLength).toFixed(2)
this.$nextTick(function() { this.$set(this.form, 'pipeAmount', money)
if (this.oldItemId)this.itemId = this.oldItemId } else {
this.getMenuItemTop() this.$set(this.form, 'pipeAmount', 0)
}) }
}, },
// ------------------------- 以下方法为上传组件相关 ------------------------- // ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项 // 弹出上传选项
...@@ -675,62 +761,16 @@ ...@@ -675,62 +761,16 @@
if (this.arr.length == 0) { if (this.arr.length == 0) {
await this.getMenuItemTop(); await this.getMenuItemTop();
} }
if (index == this.current) return; // if (index == this.current) return;
this.scrollRightTop = this.oldScrollTop; this.scrollRightTop = this.oldScrollTop;
this.$nextTick(function() { this.$nextTick(function() {
this.itemId = this.oldItemId setTimeout(() => {
if(!this.oldItemId) this.scrollRightTop = this.arr[index]; // 没有指定滚动到某一小项,就滚动到大的项
this.oldItemId = '' this.scrollRightTop = this.arr[index]
this.current = index; this.current = index
this.leftMenuStatus(index); }, 100)
})
},
// 获取一个目标元素的高度
getElRect(elClass, dataVal) {
new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this);
query.select('.' + elClass).fields({
size: true
}, res => {
// 如果节点尚未生成,res值为null,循环调用执行
if (!res) {
setTimeout(() => {
this.getElRect(elClass);
}, 10);
return;
}
this[dataVal] = res.height;
resolve();
}).exec();
})
},
// 观测元素相交状态
async observer() {
this.tabbar.map((val, index) => {
let observer = uni.createIntersectionObserver(this);
// 检测右边scroll-view的id为itemxx的元素与right-box的相交状态
// 如果跟.right-box底部相交,就动态设置左边栏目的活动状态
observer.relativeTo('.right-box', {
top: 0
}).observe('#item' + index, res => {
if (res.intersectionRatio > 0) {
let id = res.id.substring(4);
this.leftMenuStatus(id);
}
})
}) })
}, },
// 设置左边菜单的滚动状态
async leftMenuStatus(index) {
this.current = index;
// 如果为0,意味着尚未初始化
if (this.menuHeight == 0 || this.menuItemHeight == 0) {
await this.getElRect('menu-scroll-view', 'menuHeight');
await this.getElRect('u-tab-item', 'menuItemHeight');
}
// 将菜单活动item垂直居中
this.scrollTop = index * this.menuItemHeight + this.menuItemHeight / 2 - this.menuHeight / 2;
},
// 获取右边菜单每个item到顶部的距离 // 获取右边菜单每个item到顶部的距离
getMenuItemTop() { getMenuItemTop() {
new Promise(resolve => { new Promise(resolve => {
...@@ -751,7 +791,6 @@ ...@@ -751,7 +791,6 @@
}).exec() }).exec()
}) })
}, },
// 右边菜单滚动 // 右边菜单滚动
async rightScroll(e) { async rightScroll(e) {
this.oldScrollTop = e.detail.scrollTop; this.oldScrollTop = e.detail.scrollTop;
...@@ -759,19 +798,16 @@ ...@@ -759,19 +798,16 @@
await this.getMenuItemTop(); await this.getMenuItemTop();
} }
if (this.timer) return; if (this.timer) return;
if (!this.menuHeight) {
await this.getElRect('menu-scroll-view', 'menuHeight');
}
this.timer = setTimeout(() => { // 节流 this.timer = setTimeout(() => { // 节流
this.timer = null; this.timer = null;
// scrollHeight为右边菜单垂直中点位置 // scrollHeight为右边菜单垂直中点位置
let scrollHeight = e.detail.scrollTop + this.menuHeight / 2; let scrollHeight = e.detail.scrollTop
for (let i = 0; i < this.arr.length; i++) { for (let i = 0; i < this.arr.length; i++) {
let height1 = this.arr[i]; let height1 = this.arr[i];
let height2 = this.arr[i + 1]; let height2 = this.arr[i + 1];
// 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可 // 如果不存在height2,意味着数据循环已经到了最后一个,设置左边菜单为最后一项即可
if (!height2 || scrollHeight >= height1 && scrollHeight < height2) { if (!height2 || scrollHeight >= height1 && scrollHeight < height2) {
this.leftMenuStatus(i); this.current = i
return; return;
} }
} }
...@@ -833,7 +869,7 @@ ...@@ -833,7 +869,7 @@
// ---------------------------- 表单样式end ---------------------------- // ---------------------------- 表单样式end ----------------------------
.u-wrap { .com-content{
height: calc(100vh); height: calc(100vh);
/* #ifdef H5 */ /* #ifdef H5 */
height: calc(100vh - var(--window-top)); height: calc(100vh - var(--window-top));
...@@ -856,16 +892,17 @@ ...@@ -856,16 +892,17 @@
} }
.u-menu-wrap { .u-menu-wrap {
flex: 1; // flex: 1;
height: 100%; height: 100%;
display: flex; overflow: auto;
overflow: hidden; // overflow: hidden;
border-radius: 12rpx 12rpx 0 0; border-radius: 12rpx 12rpx 0 0;
&.one {
border-radius: 0;
}
} }
.detail-view {
border-radius: 12rpx;
margin: 30rpx;
}
.u-search-inner { .u-search-inner {
background-color: rgb(234, 234, 234); background-color: rgb(234, 234, 234);
......
<template> <template>
<view class="order-wrap"> <view class="order-wrap">
<u-navbar back-icon-color="#FFFFFF" :background="background" :border-bottom="false"></u-navbar> <u-navbar :title="title" title-color="#FFFFFF" title-size="32" back-icon-color="#FFFFFF" :background="background" :border-bottom="false"></u-navbar>
<view class="header"> <view class="header" v-if="order.currentOverTime && showTimeOut">
<view class="title">订单信息</view> <!-- 倒计时 -->
<view v-show="allowRejection" class="button" @click="rejectOrder">拒单</view> <view class="title">
<view class="bottom-tag-view"><text>{{timeout ? '超时' : '剩余'}}</text></view>
<u-count-down :timestamp="timestamp" font-size="28" show-days separator="zh" separator-size="32" height="40" hide-zero-day
color="#2272FF" separator-color="#FFFFFF" @change="timeOutChange" ref="order-count-down" bg-color="#FFFFFF"></u-count-down>
</view>
<view class="header-content">
<!-- 抓紧时间提示 -->
<view class="tip-text">{{tipText}}</view>
<!-- 拒单 -->
<view v-show="allowRejection" class="reject-button" @click="$u.throttle(rejectOrder, 500)">拒单</view>
</view>
</view> </view>
<view class="content"> <view class="content">
<!-- 订单详情 -->
<view class="card base-item"> <view class="card base-item">
<view class="top-item"> <Detail :order="order" :readMore.sync="readMore" :operate="isAllowDianhuaAndDaohang"></Detail>
<view class="left">
<view :class="['tag', {'active': order.orderServiceType == '安装'}]">{{ order.orderServiceType }}</view>
<text class="title">{{ order.categoryName }}</text>
</view>
<view class="right">{{ order.orderBusinessTypeText }}</view>
</view>
<view class="order-cell">
<text>工单编号:</text>
<text>{{ order.orderNumber }}</text>
</view>
<view class="order-cell">
<text>合作厂商:</text>
<text>{{ order.partnerCompanyName }}</text>
</view>
<view class="order-cell">
<text>厂商编号:</text>
<text>{{ order.partnerSerialNumber }}</text>
</view>
<view class="order-cell between-cell">
<view class="left">
<text>客户信息:</text>
<text>{{ order.contactName }}</text>
</view>
<image style="width: 84rpx;height: 56rpx;" :src="phoneIcon" @click="phoneToCustomer(order.contactPhone)" ></image>
</view>
<view class="order-cell">
<text>联系方式:</text>
<text>{{ order.contactPhone }}</text>
</view>
<view class="between-cell address-cell">
<view class="left-address">
<u-icon name="map" size="28"></u-icon>
<text class="address-txt">{{ formatAddress }}</text>
</view>
<image style="width: 84rpx;height: 56rpx;" :src="navigationIcon" @click="openLocation(order.contactAddress)"></image>
</view>
<!-- <u-read-more ref="uReadMore" :show-height="40" :shadowStyle="{paddingTop: '0rpx',marginTop: '0rpx'}" close-text="查看更多" open-text="点击收起" toggle color="#2272FF" font-size="26"> -->
<view v-if="readMore" @click="readMore = false" class="read-more-toggle">
<u-icon name="arrow-down"></u-icon>
<text class="read-more-text">查看更多</text>
</view>
<view v-else class="order-item-more">
<view class="line-view"></view>
<view class="order-cell between-cell">
<text class="cell-title">品牌:</text>
<text>{{ order.brandName }}</text>
</view>
<view class="order-cell between-cell">
<text class="cell-title">数量:</text>
<text>x{{ order.orderProductCount }}</text>
</view>
<view class="order-cell between-cell">
<text class="cell-title">充电桩信息:</text>
<text>{{ order.serviceContent }}</text>
</view>
<!-- <view class="order-cell between-cell">
<!-- <view class="order-cell between-cell">
<text>备注:</text>
<text>{{ order.serviceContent }}</text>
</view> -->
<view class="read-more-toggle">
<u-icon name="arrow-up"></u-icon>
<text class="read-more-text" @click="readMore = true">点击收起</text>
</view>
</view>
<!-- </u-read-more> -->
</view> </view>
<!-- 从我的页面进来显示计算信息 --> <!-- 从我的页面进来显示结算信息 -->
<view v-if="isFromMine" class="settlement-view"> <view v-if="isFromMine" class="settlement-view">
<view class="settlement-title">结算信息</view> <view class="settlement-title">结算信息</view>
<view class="settlement-content"> <view class="settlement-content">
...@@ -93,62 +37,32 @@ ...@@ -93,62 +37,32 @@
<text>{{settlementInfo.amount}}元</text> <text>{{settlementInfo.amount}}元</text>
</view> </view>
</view> </view>
<!-- 其他页面进来 --> <!-- 不是从我的页面,而是其他页面进来 -->
<view v-else> <view v-else>
<!-- 业务文件 -->
<view class="order-file" v-if="showFile" @click="$u.throttle(handleClickFile, 500)">
<view class="order-file-left">
<image :src="wenjianImage" class="file-image"></image>
<text>充电桩安装业务文件</text>
</view>
<view class="order-file-right">
<text>点击查看</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<!-- 时间选择 -->
<view class="card appoint-item" v-show="showTimeSelect"> <view class="card appoint-item" v-show="showTimeSelect">
<appoint-time :dateList="dateList" :timeList="timeList" @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time> <appoint-time :dateList="dateList" :timeList="timeList" @dateChange="dateChange" @timeChange="timeChange" @weekChange="weekChange"></appoint-time>
</view> </view>
<!-- 履约记录 -->
<view class="card record-item"> <view class="card record-item">
<Record :orderRecords="orderRecords"></Record> <Record :orderRecords="orderRecords"></Record>
</view> </view>
</view> </view>
</view> </view>
<!-- 不是从我的页面进来不用显示 --> <!-- 不是从我的页面进来才显示 -->
<template v-if="!isFromMine"> <template v-if="!isFromMine">
<view v-if="showCenterBtn" class="toolbar"> <BottomButtons v-if="showBottomBtn" :buttons="buttons" @submit="handleSubmit"></BottomButtons>
<!-- 背景,内容,请求接口 根据状态不同改变 {{operationDoing[order.orderStatus].background}} -->
<!-- 过程反馈 -->
<view class="left">
<view v-if="allowFeedback" @click="clickFeedback" class="button">
<text>反馈</text>
</view>
</view>
<!--接单,抢单,已被抢, 预约 ,签到 ,去完工 timestampDiff(order.currentOverTime)>0 -->
<view class="center">
<view>
<u-toast ref="uToast" />
</view>
<view v-if="showCenterBtn" @click="$u.throttle(handleClickSure, 500)" class="button" :class="['center-button-view', btnClass]">
<text>{{ centerButtonText }}</text>
<view v-if="order.currentOverTime && showTimeOut" class="time-view">
<text style="padding-right: 8rpx;">{{order.currentOverTime > new Date().getTime()?'剩':'超'}}</text>
<u-count-down
:timestamp="timestampDiff(order.currentOverTime)"
font-size="20"
color="#FFFFFF"
bg-color="transparent"
separator-color="#FFFFFF"
separator-size="20"
:ref="'uCountDown'"
show-days
height="20"
:show-days="threeDays()"
:show-minutes="!threeDays()"
:show-seconds="!threeDays()"
:separator="threeDays() ? 'zh' : 'colon'"
@change="timeOutChange(order.currentOverTime)" >
</u-count-down>
</view>
</view>
</view>
<!-- 异常预约 ,现场拍照 这里是调用拍照的两个组件-->
<view class="right">
<view v-if="errorSignIn || scenePhoto" @click="$u.throttle(handleClickRight, 500)" :class="['button', {'active': scenePhoto}]">
<text :style="errorSignIn ? 'font-size:24rpx' : ''">{{errorSignIn ? '异常\n签到' : '拍照'}}</text>
</view>
</view>
</view>
<take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo> <take-photo type="test" v-if="takeStatus" @close="closeTake" :upload="false" :num="1"></take-photo>
<!-- <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visible" @click="handleClick"/> --> <!-- <PopView title="查看交互规范" message="为完善交付质量,请查看对应的交付规范" :visible.sync="visible" @click="handleClick"/> -->
<u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx" <u-popup border-radius="12" v-model="visible" safe-area-inset-bottom mode="center" width="690rpx"
...@@ -168,6 +82,8 @@ ...@@ -168,6 +82,8 @@
import baseFile from '@/components/upload/index' import baseFile from '@/components/upload/index'
import Customer from "@/components/mine/customer.vue" import Customer from "@/components/mine/customer.vue"
import Record from "@/components/order/performanceRecord.vue" import Record from "@/components/order/performanceRecord.vue"
import Detail from "@/components/order/detail.vue"
import BottomButtons from "@/components/order/bottomButtons.vue"
let now = new Date(new Date().toLocaleDateString()).getTime(); let now = new Date(new Date().toLocaleDateString()).getTime();
export default { export default {
components: { components: {
...@@ -175,11 +91,14 @@ ...@@ -175,11 +91,14 @@
'take-photo': takePhoto, 'take-photo': takePhoto,
// PopView, // PopView,
Customer, Customer,
Record Record,
Detail,
BottomButtons
}, },
mixins: [baseFile], mixins: [baseFile],
data() { data() {
return { return {
title: ' ',
readMore: true, readMore: true,
dateList: [ dateList: [
{day: now, timeRange: []}, {day: now, timeRange: []},
...@@ -216,14 +135,13 @@ ...@@ -216,14 +135,13 @@
allowFeedback: false, // 允许过程反馈 allowFeedback: false, // 允许过程反馈
needPhotograph: true, // 需要现场拍摄 needPhotograph: true, // 需要现场拍摄
centerButton: '', // 是否显示按钮 centerButton: '', // 是否显示按钮
centerButtonText: '', bottomButtonText: '',
orderRecords: [], orderRecords: [],
method: null, method: null,
showCenterBtn: false, showBottomBtn: false,
showTimeSelect: false, showTimeSelect: false,
submitType: '', submitType: '',
nextUrl:'', nextUrl:'',
btnClass:'appoint-btn',
takeStatus:false, takeStatus:false,
errorSignIn:false, errorSignIn:false,
scenePhoto: false, scenePhoto: false,
...@@ -242,7 +160,10 @@ ...@@ -242,7 +160,10 @@
centerBtnDisabled:false, centerBtnDisabled:false,
isFromMine: false, isFromMine: false,
settlementInfo: {formatTime: '-', list: [], amount: ''}, settlementInfo: {formatTime: '-', list: [], amount: ''},
unloaded: false unloaded: false,
timeout: false,
timestamp: 0,
showFile: false, // 显示查看业务文件
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -251,6 +172,11 @@ ...@@ -251,6 +172,11 @@
if (option && option.id) { if (option && option.id) {
this.orderId = option.id this.orderId = option.id
} }
if (option && option.title) {
this.title = decodeURIComponent(option.title)
} else {
this.title = "订单信息"
}
this.loadOrderDetail() this.loadOrderDetail()
this.getLocation() this.getLocation()
if (option && option.isFromMine) { if (option && option.isFromMine) {
...@@ -272,54 +198,70 @@ ...@@ -272,54 +198,70 @@
this.closeLocationChange() this.closeLocationChange()
}, },
computed: { computed: {
customStyle() {
phoneIcon() { return {
//self-support/icon/dianhua-0@2x.png 'height': '48rpx',
if(this.isAllowDianhuaAndDaohang){ 'width': '100rpx',
return process.uniEnv.qn_base_url + 'dianhua.png' 'color': '#FFFFFF',
}else{ 'border-color': 'transparent',
return process.uniEnv.qn_base_url + 'dianhua-d.png' 'background-color': 'transparent'
} }
}, },
navigationIcon() { tipText() {
//self-support/icon/daohang-0@2x.png switch (this.bottomButtonText) {
if(this.isAllowDianhuaAndDaohang){ case '接单':
return process.uniEnv.qn_base_url + 'daohang.png' return this.timeout ? '您的订单已超时,请及时接单' : '请您注意剩余时间,及时接单'
}else{ case '预约':
return process.uniEnv.qn_base_url + 'daohang-d.png' return this.timeout ? '您的订单已超时,请及时预约' : '请您注意剩余时间,及时预约'
case '去完工':
return this.timeout ? '您的订单已超时,请及时完工' : '请您注意剩余时间,及时完工'
default:
return ''
} }
}, },
centerButtonClass() { buttons() {
let btnClass = "appoint-btn" //id: 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
return btnClass return [{
label: '过程反馈',
type: 'image',
image: 'guochengfankui.png',
show: this.allowFeedback,
disabled: false,
id: 1
},
{
label: '异常签到',
type: 'image',
image: 'yichangqiandao.png',
show: this.errorSignIn,
disabled: false,
id: 2
},
{
label: '现场拍照',
type: 'image',
image: 'xiancahngpaizhao.png',
show: this.scenePhoto,
disabled: false,
id: 3
},
{
label: this.bottomButtonText,
type: 'text',
image: '',
show: true,
disabled: this.centerBtnDisabled,
id: 0,
customStyle: {
'background-color': this.title == '待抢单' ? '#FF930D' : '#2272FF'
}
}]
},
wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian.png'
}, },
formatAddress() {
let self = this
let address = ""
if(self.order) {
address = self.order.contactProvinceText || ""
address += self.order.contactCityText || ""
address += self.order.contactCommunityText || ""
address += self.order.contactStreetText || ""
address += self.order.contactAddress || ""
}
return address
}
}, },
methods: { methods: {
openLocation(address){
if(this.isAllowDianhuaAndDaohang){
const latitude = this.order.contactAddressLatitud //res.latitude;
const longitude =this.order.contactAddressLongitud //res.longitude;
uni.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
success: function () {
console.log('success');
}
});
}
},
updateLocation(){ updateLocation(){
let self = this let self = this
wx.startLocationUpdate({ wx.startLocationUpdate({
...@@ -338,7 +280,6 @@ ...@@ -338,7 +280,6 @@
if(this.getDistance(res.latitude,res.longitude)>this.signDistance){ if(this.getDistance(res.latitude,res.longitude)>this.signDistance){
// 计算签到距离 // 计算签到距离
this.btnClass = "isGan-btn"
this.centerBtnDisabled = false this.centerBtnDisabled = false
}else{ }else{
this.centerBtnDisabled = true this.centerBtnDisabled = true
...@@ -352,23 +293,6 @@ ...@@ -352,23 +293,6 @@
console.log("closeLocationChange") console.log("closeLocationChange")
wx.offLocationChange(this._locationChangeFn); wx.offLocationChange(this._locationChangeFn);
}, },
phoneToCustomer(phone){ // 联系客户
if(this.isAllowDianhuaAndDaohang){
uni.makePhoneCall({
phoneNumber: phone ,//仅为示例
complete() {
}
});
this.contactTime()
}
},
contactTime() {
let self = this
var data={}
if(this.submitType === "workerAppointment"){
self.$u.api.contactTime(data,this.order.orderId)
}
},
handleClickRight(active) { handleClickRight(active) {
this.scenePhoto ? this.scenePhotoClick() : this.take() this.scenePhoto ? this.scenePhotoClick() : this.take()
}, },
...@@ -408,13 +332,9 @@ ...@@ -408,13 +332,9 @@
if (res.code == 200) { if (res.code == 200) {
self.order = res.data self.order = res.data
this.getCurrentBtn() this.getCurrentBtn()
var nowTime = new Date(); var nowTime = new Date().getTime();
if(this.showTimeOut && this.order.currentOverTime && nowTime.getTime() > this.order.currentOverTime){ this.timeout = this.order.currentOverTime && nowTime> this.order.currentOverTime
this.btnClass='timeOut-btn' this.timestamp = Math.round(Math.abs(this.order.currentOverTime - nowTime) / 1000)
}
// if(self.order.isFirstOrder){
// this.visible = true
// }
// 格式化时间 // 格式化时间
this.settlementInfo.formatTime = this.order.settleCenterSyncDatetime ? this.$u.timeFormat(this.order.settleCenterSyncDatetime, 'yyyy.mm.dd hh:MM:ss') : '-' this.settlementInfo.formatTime = this.order.settleCenterSyncDatetime ? this.$u.timeFormat(this.order.settleCenterSyncDatetime, 'yyyy.mm.dd hh:MM:ss') : '-'
} else { } else {
...@@ -457,16 +377,26 @@ ...@@ -457,16 +377,26 @@
self.$u.api.listOrderRecord(param).then((res) => { self.$u.api.listOrderRecord(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
res.data.forEach(item =>{ res.data.forEach(item =>{
if(item.operationType === '预约'){ item.isTrace = false
item.operationTypeText = '上门时间' item.traceTime = null
}else if (item.operationType === '报备' || item.operationType === '改约'){ item.traceLabel = item.operationType
if (item.operationType === '报备' || item.operationType === '改约'){
item.isTrace = true
item.traceLabel = item.operationType === '报备' ? '下次联系时间' : '改约时间'
item.operationTypeText = item.operationType
item.traceTime = item.orderRecordRemark
let arr = item.orderRecordRemark.split(',') let arr = item.orderRecordRemark.split(',')
item.operationTypeText = arr[0] if(arr && arr.length > 1) {
if(arr.length > 1){ let remark = arr[1].substring(arr[1].indexOf(':')+1,arr[1].length)
item.orderRecordRemark = arr[1].substring(arr[1].indexOf(':')+1,arr[1].length) item.traceTime = remark
item.operationTypeText = arr[0]
} }
}else{ } else if(item.operationType === '预约') {
item.operationTypeText = item.operationType + '时间' let remark = item.orderRecordRemark.substring(item.orderRecordRemark.lastIndexOf(",")+1);
item.traceTime = remark
item.operationTypeText = `上门 ${remark}`
} else {
item.operationTypeText = item.operationType
} }
}) })
self.orderRecords = res.data self.orderRecords = res.data
...@@ -552,54 +482,76 @@ ...@@ -552,54 +482,76 @@
var orderBusinessType = this.order.orderBusinessTypeText var orderBusinessType = this.order.orderBusinessTypeText
if (orderStatus < 31 && orderBusinessType === '指派单') { if (orderStatus < 31 && orderBusinessType === '指派单') {
// 接单 // 接单
this.showCenterBtn = true this.showBottomBtn = true
this.centerButtonText = "接单" this.bottomButtonText = "接单"
// 已派单的时显示拒单按钮 // 已派单的时显示拒单按钮
this.allowRejection = true this.allowRejection = true
this.submitType = "orderAccept" this.submitType = "orderAccept"
this.readMore = false this.readMore = false
this.isAllowDianhuaAndDaohang = false this.isAllowDianhuaAndDaohang = false
this.title = '待接单',
this.showFile = false
} else if (orderStatus < 31 && orderBusinessType === '订单池') { } else if (orderStatus < 31 && orderBusinessType === '订单池') {
// 抢单 // 抢单
this.centerButton = "appoint1" this.centerButton = "appoint1"
this.centerButtonText = "抢单" this.bottomButtonText = "抢单"
this.showCenterBtn = true this.showBottomBtn = true
this.submitType = "orderGan" this.submitType = "orderGan"
this.showTimeOut=false this.showTimeOut=false
this.readMore = false this.readMore = false
this.isAllowDianhuaAndDaohang = false this.isAllowDianhuaAndDaohang = false
this.title = '待抢单',
this.showFile = false
} else if (orderStatus === 31 && !this.order.appointmentDatetime) { } else if (orderStatus === 31 && !this.order.appointmentDatetime) {
// 预约 // 预约
this.centerButton = "appoint2" this.centerButton = "appoint2"
this.centerButtonText = "预约" this.bottomButtonText = "预约"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showBottomBtn = true
this.showTimeSelect = true this.showTimeSelect = true
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
this.readMore = true this.readMore = true
this.submitType = "workerAppointment" this.submitType = "workerAppointment"
this.title = '待预约',
this.showFile = true
this.loadCalendar() this.loadCalendar()
} else if (orderStatus === 31 && this.order.appointmentDatetime) { } else if (orderStatus === 31 && this.order.appointmentDatetime) {
// 签到 // 签到
this.centerButton = "appoint3" this.centerButton = "appoint3"
this.centerButtonText = "签到" this.bottomButtonText = "签到"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showBottomBtn = true
this.submitType = "maintainWorkerCheckin" this.submitType = "maintainWorkerCheckin"
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
this.errorSignIn = true this.errorSignIn = true
this.title = '待签到',
this.showFile = true
// this.addressToCoordinate() // this.addressToCoordinate()
this.updateLocation() this.updateLocation()
} else if (orderStatus > 31 && orderStatus < 80) { } else if (orderStatus > 31 && orderStatus < 80) {
// 完工 // 完工
this.centerButton = "filish" this.centerButton = "filish"
this.centerButtonText = "去完工" this.bottomButtonText = "去完工"
this.submitType = "toFilish" this.submitType = "toFilish"
this.allowFeedback = true this.allowFeedback = true
this.showCenterBtn = true this.showBottomBtn = true
this.scenePhoto = true this.scenePhoto = true
this.readMore = true this.readMore = true
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
this.title = '待完工',
this.showFile = true
}else if (orderStatus == 85 || orderStatus == 87) { // 审核中
this.isAllowDianhuaAndDaohang = true
this.title = '审核中',
this.showFile = true
} else if (orderStatus == 86 || orderStatus == 88) { // 异常单
this.isAllowDianhuaAndDaohang = true
this.title = '异常单',
this.showFile = true
} else if ([80, 81, 89, 110].indexOf(orderStatus) != -1) { // 已完工
this.isAllowDianhuaAndDaohang = true
this.title = '已完工',
this.showFile = true
} else { } else {
this.isAllowDianhuaAndDaohang = true this.isAllowDianhuaAndDaohang = true
} }
...@@ -619,6 +571,24 @@ ...@@ -619,6 +571,24 @@
this.handleBtn() this.handleBtn()
} }
}, },
handleSubmit(id) {
console.log(id)
// 0 主流程; 1 过程反馈;2 异常签到; 3 现场拍照
switch (id) {
case 0:
this.handleClickSure()
break
case 1:
this.clickFeedback()
break
case 2:
this.take()
break
case 3:
this.scenePhotoClick()
break
}
},
handleBtn() { handleBtn() {
console.log('click button') console.log('click button')
if(!this.submitType){ if(!this.submitType){
...@@ -684,7 +654,7 @@ ...@@ -684,7 +654,7 @@
|| (res.code!==undefined && res.code === 200) ) { || (res.code!==undefined && res.code === 200) ) {
this.trackOrder() this.trackOrder()
this.$refs.uToast.show({ this.$refs.uToast.show({
title: this.centerButtonText + '操作成功', title: this.bottomButtonText + '操作成功',
type: 'success', type: 'success',
duration: 1000, duration: 1000,
callback : function(){ callback : function(){
...@@ -710,6 +680,10 @@ ...@@ -710,6 +680,10 @@
} }
}) })
}, },
// 去业务材料页面
handleClickFile() {
this.$u.route({url: 'pages/order/document' + '?partnerCompanyId=' + this.order.partnerCompanyId + '&brandId=' + this.order.lianbaoBrandId})
},
trackOrder() { trackOrder() {
// 接单成功事件,签到成功事件 // 接单成功事件,签到成功事件
if(this.submitType == 'orderAccept' if(this.submitType == 'orderAccept'
...@@ -728,18 +702,19 @@ ...@@ -728,18 +702,19 @@
}) })
}, },
isGan(){ isGan(){
this.centerButtonText = "已被抢" this.bottomButtonText = "已被抢"
this.submitType = "" this.submitType = ""
this.btnClass='isGan-btn' this.centerBtnDisabled = true
}, },
clickFeedback(){ clickFeedback(){
// 过程反馈 // 过程反馈
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.centerButtonText != '预约' ? '1' : '0') url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.bottomButtonText != '预约' ? '1' : '0')
}) })
}, },
filish(){ filish(){
// 去完工 // 去完工
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/complete?orderId='+this.order.orderId url: 'pages/order/complete?orderId='+this.order.orderId
+ "&categoryId=" + this.order.categoryId + "&categoryId=" + this.order.categoryId
...@@ -747,6 +722,7 @@ ...@@ -747,6 +722,7 @@
+ "&inGuaranteePeriod=" + this.order.inGuaranteePeriod + "&inGuaranteePeriod=" + this.order.inGuaranteePeriod
+ "&partnerCompanyId=" + this.order.partnerCompanyId + "&partnerCompanyId=" + this.order.partnerCompanyId
+ '&partnerCompanyName=' + this.order.partnerCompanyName + '&partnerCompanyName=' + this.order.partnerCompanyName
+ '&maintainStep=' + this.order.maintainStep
}) })
}, },
rejectOrder() { // 拒单 rejectOrder() { // 拒单
...@@ -814,23 +790,14 @@ ...@@ -814,23 +790,14 @@
Rad(d){ Rad(d){
return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。 return d * Math.PI / 180.0;//经纬度转换成三角函数中度分表形式。
}, },
timestampDiff(currentOverTime){ // 计算超时时间 timeOutChange(timestamp){
if(!currentOverTime){ if (this.timeout) this.$refs['order-count-down'].seconds += 2
return 0 if (timestamp == 0 && !this.timeout) { // 超时之后倒计时变为正计时
} setTimeout(()=> {
return Math.round(Math.abs(this.order.currentOverTime - new Date().getTime()) / 1000); this.timestamp = 1
}, this.timeout = true
timeOutChange(currentOverTime){ }, 1000)
let self = this }
var nowTime = new Date(); // 当前时间
if(currentOverTime && nowTime.getTime() > currentOverTime){
if(this.centerBtnDisabled === false && this.submitType === 'maintainWorkerCheckin'){
this.btnClass = "isGan-btn"
}else{
this.btnClass='timeOut-btn'
}
this.$refs['uCountDown'].seconds += 2
}
}, },
// handleClick(){ // handleClick(){
// this.visible = false // this.visible = false
...@@ -843,9 +810,6 @@ ...@@ -843,9 +810,6 @@
this.visible = false this.visible = false
// 添加客服 // 添加客服
}, },
threeDays() {
return this.timestampDiff(this.order.currentOverTime) > 3600 * 24 * 3
}
} }
}; };
</script> </script>
...@@ -863,26 +827,37 @@ ...@@ -863,26 +827,37 @@
flex-direction: column; flex-direction: column;
.header { .header {
padding: 30rpx 30rpx 46rpx 30rpx; padding: 4rpx 32rpx 14rpx 32rpx;
display: flex;
justify-content: space-between; .header-content {
align-items: center; display: flex;
justify-content: space-between;
.title { align-items: center;
line-height: 40rpx; margin-top: 12rpx;
font-size:40rpx; .tip-text {
color:#fff; font-size: 26rpx;
color: #EFEFEF;
}
.reject-button {
text-align: center;
width: 106rpx;
height: 52rpx;
border-radius: 40rpx;
font-size: 24rpx;
font-weight: 400;
line-height: 52rpx;
color: #DEDEDE;
text-align: right;
}
} }
.title {
.button { display: flex;
text-align: center; align-items: center;
width: 106rpx; .bottom-tag-view {
height: 52rpx; color: #FFFFFF;
border-radius: 40rpx; font-size: 40rpx;
font-size: 24rpx; margin-right: 10rpx;
font-weight: 400; }
line-height: 52rpx;
color: #DEDEDE;
} }
} }
...@@ -890,9 +865,7 @@ ...@@ -890,9 +865,7 @@
height: 100%; height: 100%;
border-radius: 12rpx; border-radius: 12rpx;
overflow: auto; overflow: auto;
margin-right: 30rpx; margin: 6rpx 30rpx 30rpx 30rpx;
margin-left: 30rpx;
margin-bottom: 30rpx;
.card { .card {
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -901,124 +874,6 @@ ...@@ -901,124 +874,6 @@
border-radius: 6px; border-radius: 6px;
} }
.base-item {
padding-bottom: 6rpx;
.top-item {
display: flex;
justify-content: space-between;
margin-bottom: 30rpx;
.left {
display: flex;
align-items: center;
.tag {
text-align: center;
width: 84rpx;
height: 40rpx;
border-radius: 8rpx;
font-size: 22rpx;
font-weight: 500;
color: #FFFFFF;
line-height: 40rpx;
background-image: linear-gradient(to right, #FF930D, #FFC174);
&.active {
background-image: linear-gradient(to right, #2272FF, #47ABFF);
}
}
.title {
margin-left: 20rpx;
height: 36rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
line-height: 36rpx;
}
}
.right {
text-align: center;
width: 100rpx;
height: 40rpx;
background: #F4F5F7;
border-radius: 22rpx;
font-size: 22rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
}
}
.address-cell {
font-size: 24rpx;
font-weight: 400;
color: #333333;
line-height: 24rpx;
margin-top: 20rpx;
margin-bottom: 40rpx;
display: flex;
justify-content: space-between;
align-items: center;
.left-address {
display: flex;
align-items: flex-start;
.address-txt {
line-height: 30rpx;
margin-left: 8rpx;
margin-right: 30rpx;
}
}
}
}
.read-more-toggle {
text-align: center;
color: #2272FF;
font-size: 26rpx;
margin-top: 30rpx;
padding-bottom: 30rpx;
}
.read-more-text {
padding-left: 8rpx;
}
.order-item-more {
font-size: 26rpx;
color: #333333;
text-align: right;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin-bottom: 20rpx;
}
}
.order-item {
padding-bottom: 6rpx;
.top-item {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
.title {
height: 32rpx;
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 36rpx;
}
}
}
.record-item { .record-item {
margin-bottom: 0rpx; margin-bottom: 0rpx;
} }
...@@ -1119,28 +974,6 @@ ...@@ -1119,28 +974,6 @@
} }
} }
// 页面公用css
.order-cell {
font-size: 26rpx;
font-weight: 400;
color: #333333;
line-height: 48rpx;
margin-bottom: 10rpx;
}
.between-cell {
display: flex;
justify-content: space-between;
align-items: center;
}
.display-cell {
display: flex;
}
.cell-title {
text-align: left;
flex-shrink: 0;
}
.settlement-view { .settlement-view {
padding: 30rpx; padding: 30rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -1162,4 +995,30 @@ ...@@ -1162,4 +995,30 @@
} }
} }
} }
.order-file {
display: flex;
justify-content: space-between;
align-items: center;
margin: 20rpx 0;
border-radius: 12rpx;
background-color: #FFFFFF;
padding: 24rpx 30rpx;
.order-file-left {
color: #333333;
font-size: 26rpx;
display: flex;
align-items: center;
.file-image {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
margin-right: 16rpx;
}
}
.order-file-right {
color: #2272FF;
font-size: 26rpx;
}
}
</style> </style>
<template>
<view class="doc-tag">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="安装文件" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<!-- 合作商或品牌标签列表 -->
<view class="label-content">
<view v-for="(label, index) in labels" :key="index" class="label-item">
<!-- 选中为蓝底,非选中状态为灰底 -->
<view :class="['label-normal', {'selected': label.id == selectedId}]"
@click="handleClick(label)">
<text class="label-text">{{label.name}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
labels: [], // 标签列表
selectedId: ''
};
},
onLoad(e) {
if (e && e.partnerCompanyId) { // 合作商id
this.tagTitle = '品牌'
this.loadFileLabel('2', e.partnerCompanyId)
} else { // 获取所有文件资料
this.tagTitle = '合作商'
this.loadFileLabel('1')
}
},
methods: {
// 选中标签
handleClick(key, label) {
},
// 获取合作商列表
async loadFileLabel(type, partnerCompanyId) {
let param = {
type: type, // 1:合作商标签,2:品牌标签
}
if (type == '2') {
param.partnerCompanyId = partnerCompanyId // 合作商的标签id
}
let res = await this.$u.api.fileLabel(param)
if (res && res.code == 200) {
this.labels = res.data || []
// this.labels = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data] // 测试模拟多条数据
}
},
}
};
</script>
<style lang="scss" scoped>
.doc-tag {
background-color: #F4F5F7;
height: 100vh;
display: flex;
flex-direction: column;
.label-content {
width: 100%;
display: flex;
align-items: center;
overflow: auto;
padding: 0 10rpx 44rpx 30rpx;
.label-item {
padding-right: 20rpx;
flex-shrink: 0;
.label-normal {
height: 104rpx;
width: 200rpx;
font-size: 26rpx;
color: #666666;
background-color: #FFFFFF;
border-radius: 8rpx;
padding-left: 30rpx;
padding-right: 30rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
.label-text {
word-break: break-all;
}
&.selected {
color: #FFFFFF;
background-color: #2272FF;
}
}
}
}
}
</style>
<template>
<view :class="['doc-wrap', {'order-file': orderFile}]">
<u-navbar back-icon-color="#333333" background="#FFFFFF" title="安装文件" titleColor="#333333"
:border-bottom="false" title-bold></u-navbar>
<template v-if="!orderFile">
<!-- 合作商、品牌标签列表 -->
<view v-for="(item, key) in labels" :key="key" class="label-list">
<view class="label-title">
<!-- 合作商或品牌 -->
<view>{{items[key]}}</view>
<!-- 跳转到所有标签页面的更多按钮 -->
<view class="label-file-right" @click="handleMore(key)">
<text class="label-right-text">更多</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="label-content">
<view v-for="(label, ind) in item" :key="ind" class="label-item">
<!-- 选中为蓝底,非选中状态为灰底 -->
<view :class="['label-normal', {'selected': label.id == selected[key].id}]" @click="handleClick(key, label)">
<text class="label-text">{{label.name}}</text>
</view>
</view>
</view>
</view>
</template>
<view class="file-title">文件列表</view>
<view class="file-list">
<!-- 文件列表 -->
<view class="file-row" v-for="(item, index) in list" :key="index">
<view class="file-left">
<view class="file-name">
<u-icon class="item-icon" name="doc" custom-prefix="wxh" size="52"></u-icon>
<!-- 文件后缀的首字母,大写 -->
<view class="file-format-text">{{formatText(item.name)}}</view>
</view>
<text>{{item.name}}</text>
</view>
<!-- 文件操作按钮 -->
<view class="file-right">
<u-button :custom-style="shareStyle" shape="circle" @click="handleShare(item)">分享</u-button>
<u-button :custom-style="previewStyle" shape="circle" @click="handlePreview(item)">查看</u-button>
</view>
</view>
<!-- 如果是加载中,就显示转圈;如果加载完成 -->
<view class="loading-view" v-if="loading">
<u-loading mode="flower"></u-loading>
</view>
<!-- 加载完成之后,没有数据的提示:未选择品牌提示、无文件提示 -->
<view class="tip-view" v-else-if="list.length <= 0">{{tipText}}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [], // 文件列表
firstLoad: true, // 初次加载
labels: { // 标签列表
'1': [], // 合作商标签列表
'2': [] // 品牌标签列表
},
selected: { // 选中的标签
'1': {}, // 选中的合作商
'2': {} // 选中的品牌
},
loading: false, // 文件列表加载中
orderFile: false // 是否是订单详情进来
};
},
computed: {
// 合作商的key是'1',品牌的key是'2'
items() {
return {
'1': '合作商',
'2': '品牌'
}
},
// 分享按钮风格
shareStyle() {
return {
marginRight: '10rpx',
width: '100rpx',
height: '52rpx',
background: '#FFFFFF',
color: '#2272FF',
fontSize: '24rpx',
fontWeight: '400',
lineHeight: '52rpx'
}
},
// 查看按钮风格
previewStyle() {
return {
width: '100rpx',
height: '52rpx',
background: '#2272FF',
color: '#FFFFFF',
fontSize: '24rpx',
fontWeight: '400',
lineHeight: '52rpx'
}
},
// 文件列表文件图片
wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian-bk.png'
},
// 列表无数据的提示文字
tipText() {
return (this.selected['2'].name || this.orderFile) ? '暂无文件' : '请选择品牌'
}
},
onLoad(e) {
if (e && e.partnerCompanyId && e.brandId) { // 订单详情进来获取指定合作商和品牌的文件资料
this.orderFile = true
this.loadFileList(e.partnerCompanyId, e.brandId)
} else { // 获取所有文件资料
this.loadFileLabel('1')
}
},
methods: {
// 选中标签
handleClick(key, label) {
this.selected[key] = label
if (key == '1') { // 合作商
this.selected['2'] = {} // 清空选中品牌标签
this.list = [] // 清空文件列表
this.loadFileLabel('2', label.id) // 获取新合作商对应品牌
} else {// 品牌
this.loadFileList(this.selected['1'].id, this.selected['2'].id) // 获取文件列表
}
},
// 跳转到所有标签
handleMore(key) {
var partnerCompanyId = '' // 合作商id
if (key == '2') { // 点击品牌的更多,跳转要传合作商id
partnerCompanyId = this.selected['1'].id
}
this.$u.route({url: 'pages/order/document-tag' + '?partnerCompanyId=' + partnerCompanyId + '&selectedId=' + this.selected[key].id})
},
// 分享
handleShare(item) {
// 分享资料事件
getApp().track('share_document', {
id: self.vuex_user.id,
url: item.url
});
uni.showLoading({
title: '加载中'
})
// callback 写法
wx.downloadFile({
url: item.url, // 下载url
success(res) {
uni.hideLoading()
// 下载完成后转发
wx.shareFileMessage({
filePath: res.tempFilePath,
success() {},
fail: console.error,
})
},
fail: console.error,
})
},
// 查看
handlePreview(item) {
// 查看资料事件
getApp().track('preview_document', {
id: self.vuex_user.id,
url: item.url
});
uni.showLoading({
title: '加载中'
})
uni.downloadFile({
url: item.url,
success: function(res) {
uni.hideLoading()
var filePath = res.tempFilePath;
if (/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(filePath)) { // 查看图片
wx.previewImage({
current: filePath, // 当前显示图片的http链接
urls: [filePath] // 需要预览的图片http链接列表
})
} else { // 查看文件
uni.openDocument({
filePath: filePath,
success: function(res) {
console.log('打开文档成功');
}
});
}
}
});
},
// 获取合作商或品牌列表
async loadFileLabel(type, partnerCompanyId) {
let param = {
type: type, // 1:合作商标签,2:品牌标签
}
if (type == '2') {
param.partnerCompanyId = partnerCompanyId // 合作商的标签id
}
let res = await this.$u.api.fileLabel(param)
if (res && res.code == 200) {
this.labels[type] = res.data || []
// this.labels[type] = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data] // 测试模拟多条数据
// 初次进入页面,获取完合作商列表之后,接着获取第一个合作商的品牌列表
if (this.firstLoad && type == '1') {
this.firstLoad = false
if (this.labels[type].length > 0) {
this.selected[type] = this.labels[type][0]
this.loadFileLabel('2', this.selected[type].id)
}
}
}
},
// 获取品牌列表
async loadFileList(partnerCompanyId, brandId) {
this.loading = true
let res = await this.$u.api.fileList({
partnerCompanyId: partnerCompanyId, // 合作商标签
brandId: brandId // 品牌标签
})
this.loading = false
if (res && res.code == 200) {
console.log(res.data)
this.list = res.data || []
// this.list = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data] // 测试模拟多条数据
}
},
// 文件后缀的首字母,大写
formatText(name) {
let arr = name.split('.')
if (arr.length > 1) {
let item = arr.pop()
return item.substr(0, 1).toUpperCase()
} else {
return 'P'
}
}
}
};
</script>
<style lang="scss" scoped>
.doc-wrap {
background-color: #F4F5F7;
height: 100vh;
display: flex;
flex-direction: column;
&.order-file {
background-color: #FFFFFF;
}
.label-list {
padding: 0 0 40rpx 30rpx;
.label-title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin-bottom: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
.label-file-right {
display: flex;
align-items: center;
justify-content: flex-end;
color: #2272FF;
font-size: 26rpx;
padding-right: 30rpx;
.label-right-text {
font-weight: 400;
}
}
}
.label-content {
width: 100%;
display: flex;
align-items: center;
overflow-x: auto;
min-height: 104rpx;
.label-item {
padding-right: 20rpx;
flex-shrink: 0;
.label-normal {
height: 104rpx;
width: 200rpx;
font-size: 26rpx;
color: #666666;
background-color: #FFFFFF;
border-radius: 8rpx;
padding-left: 30rpx;
padding-right: 30rpx;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
.label-text {
word-break:break-all;
}
&.selected {
color: #FFFFFF;
background-color: #2272FF;
}
}
}
}
}
}
.file-title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
padding: 20rpx 30rpx;
border-radius: 32rpx;
background-color: #FFFFFF;
// margin-top: 10rpx;
}
.file-list {
padding: 0 30rpx;
height: 100%;
overflow: auto;
background-color: #FFFFFF;
.file-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 10rpx;
margin-bottom: 50rpx;
.file-left {
display: flex;
align-items: center;
color: #333333;
font-size: 26rpx;
.file-name {
margin-right: 20rpx;
position: relative;
.item-icon {
position: absolute;
}
.file-format-text {
position: relative;
width: 52rpx;
height: 52rpx;
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #FFFFFF;
line-height: 52rpx;
}
}
}
.file-right {
display: flex;
align-items: center;
justify-content: flex-end;
.button-class {
margin-left: 10rpx;
}
}
}
.tip-view {
color: #999999;
width: 100%;
margin-top: 200rpx;
text-align: center;
}
.loading-view {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 200rpx;
}
}
</style>
...@@ -246,16 +246,17 @@ ...@@ -246,16 +246,17 @@
}, },
async closeTake(img) { async closeTake(img) {
if(img !==undefined){ if(img !==undefined){
// 复制一份 用于保存
if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = []
let saveList = JSON.parse(JSON.stringify(this.currentItemDate.orderImages))
const files = img.map(v => v.path) const files = img.map(v => v.path)
const value = await this.saveToTask(files) const value = await this.saveToTask(files)
if (!this.currentItemDate.orderImages) this.currentItemDate.orderImages = []
// 复制一份 用于保存
let saveList = this.currentItemDate.orderImages.concat();
value.map(item =>{ value.map(item =>{
// step1 添加缓存图片 到显示
this.currentItemDate.orderImages.push(item.path)
// 文件key添加保存数组中 // 文件key添加保存数组中
saveList.push(item.key) saveList.push(item.key)
// step1 添加缓存图片 到显示
this.currentItemDate.orderImages.push(item.path)
}) })
// step2 保存图片 // step2 保存图片
var data={ var data={
...@@ -263,6 +264,7 @@ ...@@ -263,6 +264,7 @@
images : Array.from(saveList), images : Array.from(saveList),
fieldsName:this.currentItemDate.fieldName fieldsName:this.currentItemDate.fieldName
} }
console.log("data", data)
this.$u.api.saveImage(data,this.orderId).then((res) => { this.$u.api.saveImage(data,this.orderId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
} else { } else {
......
...@@ -35,15 +35,18 @@ const setOpenid = function (openid) { ...@@ -35,15 +35,18 @@ const setOpenid = function (openid) {
} }
} }
async function validImages(imgurl) { function validImages(imgurl) {
let exists = false return new Promise((resolve, reject) => {
await uni.getImageInfo({ uni.getImageInfo({
src: imgurl, src: imgurl,
success (res) { success(res) {
exists = true resolve(true)
} },
}) fail() {
return exists reject(false)
}
})
})
} }
/** /**
...@@ -52,14 +55,13 @@ async function validImages(imgurl) { ...@@ -52,14 +55,13 @@ async function validImages(imgurl) {
* @param {Object} src 图片地址 * @param {Object} src 图片地址
* @param {Object} host 图片前缀,默认使用qn_base_url * @param {Object} host 图片前缀,默认使用qn_base_url
*/ */
const imageCache = function (vm, src, host) { const imageCache = async function (vm, src, host) {
host = host || process.uniEnv.qn_base_url host = host || process.uniEnv.qn_base_url
let image_url = host + src let image_url = host + src
return image_url // 临时
let image_name = md5Libs.md5(image_url) let image_name = md5Libs.md5(image_url)
var arr = Object.keys(vm.vuex_cache); var arr = Object.keys(vm.vuex_cache);
if (vm.vuex_cache && arr.length && arr.includes(image_name) && const result = await validImages(vm.vuex_cache[image_name])
validImages(vm.vuex_cache[image_name])) { if (vm.vuex_cache && arr.length && arr.includes(image_name) && result) {
return vm.vuex_cache[image_name] return vm.vuex_cache[image_name]
} else { } else {
// 本地没有缓存 需要下载 // 本地没有缓存 需要下载
...@@ -67,7 +69,6 @@ const imageCache = function (vm, src, host) { ...@@ -67,7 +69,6 @@ const imageCache = function (vm, src, host) {
url: image_url, url: image_url,
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
// call_back(res.tempFilePath)
vm.$u.vuex(`vuex_cache.${image_name}`, res.tempFilePath) vm.$u.vuex(`vuex_cache.${image_name}`, res.tempFilePath)
} }
} }
......
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