Commit 7ce31762 authored by Facius's avatar Facius

文件页面

parent 27e28742
...@@ -257,6 +257,7 @@ export default { ...@@ -257,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"属性 */
......
@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";
}
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
return this.textarea ? 'transparent' : '#F4F5F7' return this.textarea ? 'transparent' : '#F4F5F7'
}, },
isDisabled() { isDisabled() {
return this.item.function ? true : false return this.item.fieldsId === 254 || this.disabled ? true : false
} }
}, },
watch: {}, watch: {},
......
...@@ -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;
......
...@@ -408,7 +408,7 @@ export default { ...@@ -408,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: [
{ {
...@@ -477,7 +477,7 @@ export default { ...@@ -477,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,
...@@ -497,13 +497,13 @@ export default { ...@@ -497,13 +497,13 @@ export default {
}, },
computed: { computed: {
bannerImage() { bannerImage() {
return process.uniEnv.qn_base_url + "xuexibanner.png"; return process.uniEnv.qn_base_url + "xuexibanner-p.png";
}, },
jianbianImage() { jianbianImage() {
return process.uniEnv.qn_base_url + "jianbian.png"; return process.uniEnv.qn_base_url + "jianbian-p.png";
}, },
anzhuangwenjianImage() { anzhuangwenjianImage() {
return process.uniEnv.qn_base_url + "anzhuangwenjian.png"; return process.uniEnv.qn_base_url + "wenjian-d.png";
}, },
}, },
onShow: function (param) { onShow: function (param) {
......
...@@ -301,6 +301,7 @@ ...@@ -301,6 +301,7 @@
+ "&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) {
......
...@@ -19,15 +19,14 @@ ...@@ -19,15 +19,14 @@
</view> </view>
<template v-if="item.fieldsType"> <template v-if="item.fieldsType">
<xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType" <xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType"
:itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :slotContent="item.fieldsInfo" @value-change="fieldValueChange"> :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :disabled="item.disabled || false" :slotContent="item.fieldsInfo" @value-change="fieldValueChange">
</xh-input> </xh-input>
<xh-multi-input v-else-if="item.formType==='multiinput'" <xh-multi-input v-else-if="item.formType==='multiinput'"
: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-multi-input>
<xh-radio v-else-if="item.formType==='radio'" <xh-radio v-else-if="item.formType==='radio'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :disabled="item.disabled || false" @value-change="fieldValueChange">
@value-change="fieldValueChange">
</xh-radio> </xh-radio>
<xh-checkbox v-else-if="item.formType==='checkbox'" <xh-checkbox v-else-if="item.formType==='checkbox'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
......
...@@ -21,7 +21,20 @@ ...@@ -21,7 +21,20 @@
</template> </template>
<view class="file-title">文件列表</view> <view class="file-title">文件列表</view>
<view class="file-list"> <view class="file-list">
<view class="file-row" v-for="(item, index) in list" :key="index"> <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 class="file-left"> <view class="file-left">
<view class="file-name"> <view class="file-name">
<image class="file-image" :src="wenjianImage"></image> <image class="file-image" :src="wenjianImage"></image>
...@@ -31,9 +44,10 @@ ...@@ -31,9 +44,10 @@
<text>{{item.name}}</text> <text>{{item.name}}</text>
</view> </view>
<view class="file-right"> <view class="file-right">
<u-button :custom-style="shareStyle" shape='circle' size="mini" @click="handleShare">分享</u-button> <u-button :custom-style="shareStyle" shape='circle' size="mini" @click="handleShare(item)">分享
</u-button>
<u-button :custom-style="previewStyle" shape='circle' size="mini" class="button-class" <u-button :custom-style="previewStyle" shape='circle' size="mini" class="button-class"
@click="handlePreview">查看 @click="handlePreview(item)">查看
</u-button> </u-button>
</view> </view>
</view> </view>
...@@ -74,23 +88,28 @@ ...@@ -74,23 +88,28 @@
'2': '品牌' '2': '品牌'
} }
}, },
shareStyle() { shareStyle() {
return { return {
'background-color': '#FFFFFF', marginRight: '10rpx',
'heigth': '52rpx', width: '100rpx',
'width': '100rpx', height: '52rpx',
'color': '#2272FF', background: '#FFFFFF',
'font-size': '24rpx', color: '#2272FF',
} fontSize: '24rpx',
}, fontWeight: '400',
previewStyle() { lineHeight: '52rpx'
return { }
'background-color': '#2272FF', },
'heigth': '52rpx', previewStyle() {
'width': '100rpx', return {
'color': '#FFFFFF', width: '100rpx',
'font-size': '24rpx', height: '52rpx',
} background: '#2272FF',
color: '#FFFFFF',
fontSize: '24rpx',
fontWeight: '400',
lineHeight: '52rpx'
}
}, },
wenjianImage() { wenjianImage() {
return process.uniEnv.qn_base_url + 'wenjian-bk.png' return process.uniEnv.qn_base_url + 'wenjian-bk.png'
...@@ -100,7 +119,7 @@ ...@@ -100,7 +119,7 @@
} }
}, },
onLoad(e) { onLoad(e) {
if (e.partnerCompanyId && e.brandId) { if (e && e.partnerCompanyId && e.brandId) {
this.orderFile = true this.orderFile = true
this.loadFileList(e.partnerCompanyId, e.brandId) this.loadFileList(e.partnerCompanyId, e.brandId)
} else { } else {
...@@ -119,10 +138,49 @@ ...@@ -119,10 +138,49 @@
this.loadFileList(this.selected['1'].id, this.selected['2'].id) this.loadFileList(this.selected['1'].id, this.selected['2'].id)
} }
}, },
handleShare() { handleShare(item) {
uni.showLoading({
}, title: '加载中'
handlePreview() { })
// 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) {
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) { async loadFileLabel(type, partnerCompanyId) {
let param = { let param = {
...@@ -133,7 +191,8 @@ ...@@ -133,7 +191,8 @@
} }
let res = await this.$u.api.fileLabel(param) let res = await this.$u.api.fileLabel(param)
if (res && res.code == 200) { if (res && res.code == 200) {
this.labels[type] = res.data || [] this.labels[type] = res.data || []
this.labels[type] = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data]
console.log(this.labels) console.log(this.labels)
if (this.firstLoad && type == '1') { // 第一次额外加载第一个合作商的品牌标签 if (this.firstLoad && type == '1') { // 第一次额外加载第一个合作商的品牌标签
this.firstLoad = false this.firstLoad = false
...@@ -151,9 +210,10 @@ ...@@ -151,9 +210,10 @@
brandId: brandId // 品牌标签 brandId: brandId // 品牌标签
}) })
this.loading = false this.loading = false
if (res && res.code == 200) { if (res && res.code == 200) {
console.log(res.data) console.log(res.data)
this.list = res.data || [] this.list = res.data || []
this.list = [...res.data,...res.data,...res.data,...res.data,...res.data,...res.data,...res.data]
} }
}, },
formatText(name) { formatText(name) {
...@@ -262,25 +322,20 @@ ...@@ -262,25 +322,20 @@
color: #333333; color: #333333;
font-size: 26rpx; font-size: 26rpx;
.file-name { .file-name {
position: relative; margin-right: 20rpx;
position: relative;
.file-image {
width: 52rpx; .file-format-text {
height: 52rpx; position: absolute;
position: absolute; width: 52rpx;
} height: 52rpx;
text-align: center;
.file-format-text { font-size: 32rpx;
color: #FFFFFF; font-weight: bold;
font-weight: bold; color: #FFFFFF;
font-size: 32rpx; line-height: 52rpx;
width: 52rpx; }
height: 52rpx;
position: relative;
text-align: center;
margin-right: 20rpx;
}
} }
} }
...@@ -310,5 +365,5 @@ ...@@ -310,5 +365,5 @@
justify-content: center; justify-content: center;
margin-top: 200rpx; margin-top: 200rpx;
} }
} }
</style> </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 {
......
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