Commit 95f720ea authored by Facius's avatar Facius

安装文件

parent 2ff3594f
......@@ -2,7 +2,7 @@
(function () {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null;
let VERSION_NUMBER = '1.3.1';//版本号
let VERSION_NUMBER = '1.3.2';//版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === "development") {
if (NODE_ENV === 'dev') {
......
......@@ -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 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 = {
listByRecommendOrder,
......@@ -212,7 +216,9 @@ let orderApiFun = function(vm){
workerApplyPay,
allowLogin,
otherUser,
checkAddCustomer
checkAddCustomer,
fileLabel,
fileList
}
return orderApi
}
......
......@@ -88,7 +88,8 @@ const install = (Vue, vm) => {
// return result;
case 200:
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,
message:msg
};
......
......@@ -326,10 +326,10 @@
{
"path": "document",
"style": {
"navigationBarTitleText": "资料文件",
"navigationBarTitleText": "安装文件",
"navigationStyle": "custom",
"enablePullDownRefresh": false
// "disableScroll": true
"enablePullDownRefresh": false,
"disableScroll": true
}
}
]
......
......@@ -949,7 +949,7 @@ export default {
/* position: absolute; */
position: relative;
border-radius: 12rpx;
margin-top: 60rpx;
margin-top: 80rpx;
}
.title {
......
......@@ -682,7 +682,7 @@
},
// 去业务材料页面
handleClickFile() {
this.$u.route({url: 'pages/order/document'})
this.$u.route({url: 'pages/order/document' + '?partnerCompanyId=' + this.order.partnerCompanyId + '&brandId=' + this.order.lianbaoBrandId})
},
trackOrder() {
// 接单成功事件,签到成功事件
......
<template>
<view class="doc-wrap">
<u-navbar title="资料文件" :border-bottom="false"/>
<view class="filter">
<u-icon class="filter-icon" name="bag" label="品牌" label-size="24"/>
<u-icon class="filter-icon" name="tags" label="品类" label-size="24"/>
</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 class="item">
<view class="title">
<view class="name">{{item.name}}</view>
<view class="desc">
<text>{{item.time | datefmt('YYYY-MM-DD')}}</text>
<text class="u-p-l-30">{{'来源:' + (item.from.join('、'))}}</text>
</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>
</view>
<u-loadmore :status="status" margin-top="30"/>
<u-gap height="316"/>
</view>
</view>
</template>
<script>
let now = Date.now()
export default {
data() {
return {
list: [],
status: 'loadmore',
total: 0,
};
},
onLoad() {
console.log("onLoad===========");
this.loadDocuments()
},
onReachBottom() {
if(this.list.length >= this.total) return;
console.log("onReachBottom===========");
this.status = 'loading';
this.loadDocuments()
},
methods: {
loadDocuments() {
let data = [
{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: ['挚达','充电桩', '空调', '自营平台']},
{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';
},
}
};
</script>
<style lang="scss" scoped>
.doc-wrap {
background-color: #FFFFFF;
.filter {
padding-left: 30rpx;
height: 60rpx;
line-height: 60rpx;
z-index: 2;
.filter-icon {
margin-right: 60rpx;
}
}
.content {
// height: 100vh;
// overflow: auto;
.row {
display: flex;
align-items: center;
.icon {
margin-left: 30rpx;
font-size: 56rpx;
color: #2272FF;
}
.item {
margin-left: 20rpx;
flex-basis: calc(100%);
align-items: center;
min-height: 108rpx;
display: flex;
justify-content: space-between;
border-bottom: 2rpx solid #F4F5F7;
.title {
word-break: break-all;
max-width: 460rpx;
.name {
color: #333333;
font-size: 28rpx;
font-weight: bold;
}
.desc {
color: #666666;
font-size: 24rpx;
}
}
.right {
margin-right: 30rpx;
.opt-icon {
margin-left: 20rpx;
color: #999999;
}
}
}
}
}
}
<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">
<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)">{{label.name}}</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">
<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 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>
let now = Date.now()
export default {
data() {
return {
list: [],
status: 'loadmore',
total: 0,
firstLoad: true,
labels: {
'1': [], // 合作商标签列表
'2': [] // 品牌标签列表
},
selected: {
'1': {}, // 选中的合作商
'2': {} // 选中的品牌
},
loading: false,
orderFile: false
};
},
computed: {
items() {
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) ? '暂无文件' : '请选择品牌'
}
},
onLoad(e) {
if (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)
}
},
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>
<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;
.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;
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 {
position: relative;
.file-image {
width: 52rpx;
height: 52rpx;
position: absolute;
}
.file-format-text {
color: #FFFFFF;
font-weight: bold;
font-size: 32rpx;
width: 52rpx;
height: 52rpx;
position: relative;
text-align: center;
margin-right: 20rpx;
}
}
}
.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>
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