Commit 95f720ea authored by Facius's avatar Facius

安装文件

parent 2ff3594f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
(function () { (function () {
let NODE_ENV = 'test'; // 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.2';//版本号
//小程序是否审核通过,参数配置在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') {
......
...@@ -172,6 +172,10 @@ let orderApiFun = function(vm){ ...@@ -172,6 +172,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 +216,9 @@ let orderApiFun = function(vm){ ...@@ -212,7 +216,9 @@ let orderApiFun = function(vm){
workerApplyPay, workerApplyPay,
allowLogin, allowLogin,
otherUser, otherUser,
checkAddCustomer checkAddCustomer,
fileLabel,
fileList
} }
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
}; };
......
...@@ -326,10 +326,10 @@ ...@@ -326,10 +326,10 @@
{ {
"path": "document", "path": "document",
"style": { "style": {
"navigationBarTitleText": "资料文件", "navigationBarTitleText": "安装文件",
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
// "disableScroll": true "disableScroll": true
} }
} }
] ]
......
...@@ -949,7 +949,7 @@ export default { ...@@ -949,7 +949,7 @@ export default {
/* position: absolute; */ /* position: absolute; */
position: relative; position: relative;
border-radius: 12rpx; border-radius: 12rpx;
margin-top: 60rpx; margin-top: 80rpx;
} }
.title { .title {
......
...@@ -682,7 +682,7 @@ ...@@ -682,7 +682,7 @@
}, },
// 去业务材料页面 // 去业务材料页面
handleClickFile() { handleClickFile() {
this.$u.route({url: 'pages/order/document'}) this.$u.route({url: 'pages/order/document' + '?partnerCompanyId=' + this.order.partnerCompanyId + '&brandId=' + this.order.lianbaoBrandId})
}, },
trackOrder() { trackOrder() {
// 接单成功事件,签到成功事件 // 接单成功事件,签到成功事件
......
<template> <template>
<view class="doc-wrap"> <view :class="['doc-wrap', {'order-file': orderFile}]">
<u-navbar title="资料文件" :border-bottom="false"/> <u-navbar back-icon-color="#333333" background="#FFFFFF" title="安装文件" titleColor="#333333"
<view class="filter"> :border-bottom="false" title-bold></u-navbar>
<u-icon class="filter-icon" name="bag" label="品牌" label-size="24"/> <template v-if="!orderFile">
<u-icon class="filter-icon" name="tags" label="品类" label-size="24"/> <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">
<text class="label-right-text">更多</text>
<u-icon name="arrow-right"></u-icon>
</view> </view>
<view class="content">
<view class="row" v-for="(item, index) in list" :key="index">
<view class="icon">
<u-icon name="file-text"></u-icon>
</view> </view>
<view class="item"> <view class="label-content">
<view class="title"> <view v-for="(label, ind) in item" :key="ind" class="label-item">
<view class="name">{{item.name}}</view> <view :class="['label-normal', {'selected': label.id == selected[key].id}]"
<view class="desc"> @click="handleClick(key, label)">{{label.name}}</view>
<text>{{item.time | datefmt('YYYY-MM-DD')}}</text>
<text class="u-p-l-30">{{'来源:' + (item.from.join('、'))}}</text>
</view> </view>
</view> </view>
<view class="right">
<u-icon
class="opt-icon" name="share"
label="分享" label-pos="bottom"
label-color="#999999" label-size="24">
</u-icon>
<u-icon
class="opt-icon" name="order"
label="查看" label-pos="bottom"
label-color="#999999" label-size="24">
</u-icon>
</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">
<image class="file-image" :src="wenjianImage"></image>
<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' size="mini" @click="handleShare">分享</u-button>
<u-button :custom-style="previewStyle" shape='circle' size="mini" class="button-class"
@click="handlePreview">查看
</u-button>
</view> </view>
</view> </view>
<u-loadmore :status="status" margin-top="30"/>
<u-gap height="316"/> <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>
</view> </view>
</template> </template>
<script> <script>
let now = Date.now() let now = Date.now()
export default { export default {
data() { data() {
return { return {
list: [], list: [],
status: 'loadmore', status: 'loadmore',
total: 0, total: 0,
firstLoad: true,
labels: {
'1': [], // 合作商标签列表
'2': [] // 品牌标签列表
},
selected: {
'1': {}, // 选中的合作商
'2': {} // 选中的品牌
},
loading: false,
orderFile: false
}; };
}, },
onLoad() { computed: {
console.log("onLoad==========="); items() {
this.loadDocuments() return {
'1': '合作商',
'2': '品牌'
}
},
shareStyle() {
return {
'background-color': '#FFFFFF',
'heigth': '52rpx',
'width': '100rpx',
'color': '#2272FF',
'font-size': '24rpx',
}
},
previewStyle() {
return {
'background-color': '#2272FF',
'heigth': '52rpx',
'width': '100rpx',
'color': '#FFFFFF',
'font-size': '24rpx',
}
},
wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian-bk.png'
},
tipText() {
return (this.selected['2'].name || this.orderFile) ? '暂无文件' : '请选择品牌'
}
}, },
onReachBottom() { onLoad(e) {
if(this.list.length >= this.total) return; if (e.partnerCompanyId && e.brandId) {
console.log("onReachBottom==========="); this.orderFile = true
this.status = 'loading'; this.loadFileList(e.partnerCompanyId, e.brandId)
this.loadDocuments() } else {
this.loadFileLabel('1')
}
}, },
methods: { methods: {
loadDocuments() { handleClick(key, label) {
let data = [ this.selected[key] = label
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']}, if (key == '1') {
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']}, this.selected['2'] = {}
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']}, this.list = []
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']}, this.loadFileLabel('2', label.id)
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']}, } else {
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']}, this.loadFileList(this.selected['1'].id, this.selected['2'].id)
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']}, }
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']},
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']},
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-勘察报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-增项收费标准表', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-安装报告', url: '', time: now, from: ['挚达','充电桩']},
{name: '挚达-广汽-自营平台系统相关的免责协议', url: '', time: now, from: ['挚达','充电桩', '空调', '自营平台']},
{name: '挚达-广汽-报装声明', url: '', time: now, from: ['挚达','充电桩']},
]
this.total = 100
let newList = this.$u.deepMerge(this.list, data);
this.list = newList
console.log("loadDocuments===========");
if(newList.length >= this.total) this.status = 'nomore';
else this.status = 'loadmore';
}, },
handleShare() {
},
handlePreview() {
},
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 || []
console.log(this.labels)
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 || []
}
},
formatText(name) {
let arr = name.split('.')
let item = arr.pop()
return item.substr(0, 1)
}
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.doc-wrap { .doc-wrap {
background-color: #F4F5F7;
height: 100vh;
display: flex;
flex-direction: column;
&.order-file {
background-color: #FFFFFF; background-color: #FFFFFF;
.filter {
padding-left: 30rpx;
height: 60rpx;
line-height: 60rpx;
z-index: 2;
.filter-icon {
margin-right: 60rpx;
}
} }
.content {
// height: 100vh; .label-list {
// overflow: auto; padding: 0 0 40rpx 30rpx;
.row {
.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; display: flex;
align-items: center; align-items: center;
.icon { justify-content: flex-end;
margin-left: 30rpx;
font-size: 56rpx;
color: #2272FF; color: #2272FF;
font-size: 26rpx;
padding-right: 30rpx;
.label-right-text {
font-weight: 400;
} }
.item { }
margin-left: 20rpx; }
flex-basis: calc(100%);
.label-content {
width: 100%;
display: flex;
align-items: center; align-items: center;
min-height: 108rpx; overflow-x: auto;
.label-item {
padding-right: 20rpx;
flex-shrink: 0;
.label-normal {
height: 60rpx;
font-size: 26rpx;
color: #666666;
background-color: #FFFFFF;
border-radius: 8rpx;
padding-left: 30rpx;
padding-right: 30rpx;
text-align: center;
line-height: 60rpx;
&.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; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
border-bottom: 2rpx solid #F4F5F7; margin-top: 10rpx;
.title { margin-bottom: 50rpx;
word-break: break-all;
max-width: 460rpx; .file-left {
.name { display: flex;
align-items: center;
color: #333333; color: #333333;
font-size: 28rpx; font-size: 26rpx;
.file-name {
position: relative;
.file-image {
width: 52rpx;
height: 52rpx;
position: absolute;
}
.file-format-text {
color: #FFFFFF;
font-weight: bold; font-weight: bold;
font-size: 32rpx;
width: 52rpx;
height: 52rpx;
position: relative;
text-align: center;
margin-right: 20rpx;
} }
.desc {
color: #666666;
font-size: 24rpx;
} }
} }
.right {
margin-right: 30rpx; .file-right {
.opt-icon { display: flex;
margin-left: 20rpx; align-items: center;
color: #999999; 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> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment