Commit 9c5cd8be authored by Mac's avatar Mac

修改

parent 38e2ca79
......@@ -238,12 +238,12 @@
</view>
</view>
<view class="box_conent_basic" v-if="detailsData && detailsData.ListState==3">
<view class="box_conent_basic" v-if="detailsData && detailsData.ListState==3 && detailsData.RankList.length>0">
<view class="box_conent_basic_img">
<view class="box_conent_basic_img_t">评比结果</view>
</view>
<view class="box_conent_basic_c" style="padding: 0 5px;" v-if="detailsData">
<view v-for="(x,y) in RankList" :key='y' class="box_c_b_c_item">
<view v-for="(x,y) in detailsData.RankList" :key='y' class="box_c_b_c_item" @click="goxiangqin(x)">
<view class="cbc_item_l">
<view v-if="detailsData.EnableRank==1" class="cbc_item_l">
<image v-if="y==0" src='https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/bdbando.png' style="width: 100%;height: 100%;"></image>
......@@ -319,6 +319,12 @@
<view class="cans_c_l">{{item.CompData.Name}}:</view>
<view class="cans_c_r">{{getDorpDownData(item.CompData.OptionValue,item.CompData.OptionList)}}</view>
</view>
<view class="cans_c" style="display: flex;align-items: flex-start;width: 100%;" v-if="item.CompKey=='CommonUploadComp' && item.CompData.FileList && item.CompData.FileList.length>0">
<view class="cans_c_l">{{item.CompData.Name}}:</view>
<view class="cans_c_r">
<view v-for="(src, sindex) in item.CompData.FileListName">{{src}}</view>
</view>
</view>
</view>
<view class="btn_bm" v-if="detailsData.ListState==1" @click="goeditsignUp(x)">编辑</view>
......@@ -404,6 +410,7 @@
if(this.detailsData.EnrollList && this.detailsData.EnrollList.length>0){
this.detailsData.EnrollList.forEach(x=>{
x.Content = JSON.parse(x.Content)
})
}
......@@ -446,7 +453,7 @@
});
},
getDorpDownData(value,list){
console.log(data,'split')
let data = value.toString().split(',')
let text = ''
......@@ -465,6 +472,19 @@
})
return text
},
goxiangqin(item){//点击放榜列表 进入详情
if(item.ObjectType==1){//品牌
uni.navigateTo({
url:"/pages/kotra/brand/detail?id="+item.ObjectId
})
}else if(item.ObjectType==2){//载体
uni.navigateTo({
url:"/pages/kotra/carrier/detail?id="+item.ObjectId
})
}
}
}
}
......
This diff is collapsed.
......@@ -62,8 +62,10 @@
@success="datasuccess()"></selectChoice>
<pictureUpload v-if="item.CompKey=='ImageUploadComp'" :CompData="item.CompData" :index='index'
@success="datasuccess()"></pictureUpload>
<videoUpload v-if="item.CompKey=='VideoUploadComp'" :CompData="item.CompData" :index='index' @enlarge='enlarge()'
@success="datasuccess()"></videoUpload>
<videoUpload v-if="item.CompKey=='VideoUploadComp'" :CompData="item.CompData" :index='index'
@success="datasuccess()"></videoUpload>
<fileType v-if="item.CompKey=='CommonUploadComp'" :CompData="item.CompData" :index='index'
@success="datasuccess()"></fileType>
</template>
<view class="btn" @click="setapply()">
提交申请
......@@ -86,6 +88,7 @@
import selectChoice from "./plugin/selectChoice"
import pictureUpload from "./plugin/pictureUpload"
import videoUpload from "./plugin/videoUpload"
import fileType from "./plugin/fileType"
export default {
components: {
......@@ -93,7 +96,8 @@
multipleText,
selectChoice,
pictureUpload,
videoUpload,
videoUpload,
fileType
},
data() {
......@@ -271,10 +275,10 @@
},
datasuccess(data, index) {
this.dataList[index].CompData = data
console.log(data)
},
setapply() {
console.log('提交', this.dataList)
let show = false
//验证必填
if(this.addMsg.ObjectId==0 || this.addMsg.ObjectId==null || this.addMsg.ObjectId==''){
......
<template>
<view>
<view class="single_Phone">
<span style="color:red;margin-right:5rpx;" v-show="CompData.IsRequire">*</span>{{CompData.Name}}
</view>
<view class="fliebox" v-for="(x,y) in CompData.FileListName" :key='y'>
<view class="fliebox_l">{{x}}</view>
<view class="fliebox_r">
<u-icon name="cross" color="#909399" size="36" @click='getdelete(y)'></u-icon>
</view>
</view>
<u-button type="primary" size='mini' @click="xzfile">上传文件</u-button>
<view class="single_Remark" v-if="CompData.Remark">{{CompData.Remark}}</view>
</view>
</template>
<script>
export default {
props: ["CompData",'index'],
data() {
return {
action: '',
FileList:'',
}
},
created() {
this.FileList = JSON.parse((JSON.stringify(this.CompData.FileList)))
var newPath = "/korea/Test/Upload/";
this.action = this.UploadConfig().UploadUrl + "?fileSavePath=" + newPath;
if(this.CompData.FileListName==undefined){
this.CompData.FileListName = []
}
},
methods: {
getdelete(index){
this.CompData.FileList.splice(index,1)
this.CompData.FileListName.splice(index,1)
this.$emit('success', this.CompData, this.index)
},
xzfile(){
let that = this
wx.chooseMessageFile({
count: this.CompData.FileCount==0?9999999:this.CompData.FileCount,
type: 'file',
success (res) {
const tempFilePaths = res.tempFiles
let show = false
tempFilePaths.map((x,index)=>{//判断是否是文件
if(show == true){return}
if(x.type!='file'){
uni.showToast({
title:'请选择正确文件',
icon:'none'
})
show = true
}else{
if(that.CompData.FileType.indexOf(that.gethou(x.path))==-1){
uni.showToast({
title:'请选择正确文件',
icon:'none'
})
show = true
}else{
if(that.CompData.FileSizeLimit>0){//大于0 进入判断
let size = res.size
if(x.size>(that.CompData.FileSizeLimit*1024*1024)){
uni.showToast({
title:'文件超出指定大小',
icon:'none'
})
show = true
}else{
that.upFile(x.path,x.name)
}
}else{
that.upFile(x.path,x.name)
}
}
}
})
}
})
},
upFile(filePath,name) {
let action = this.action
let that = this
uni.uploadFile({
url: action,
filePath: filePath,
name: 'file',
formData: {
user: 'tesdt'
},
success: (uploadFileRes) => {
uni.hideLoading()
var jsonData=JSON.parse(uploadFileRes.data);
if (jsonData.StatusCode == 1) {
var url= that.UploadConfig().ImageUrl+ jsonData.FilePath;
that.CompData.FileList.push(url)
that.CompData.FileListName.push(name)
that.$emit('success', that.CompData, that.index)
}
},
fail: function(res) {
wx.showToast({
title: '上传失败!',
icon: 'none',
duration: 1000
})
}
});
},
gethou(filename){//获取后缀名
var index = filename.lastIndexOf(".");
var suffix = filename.substring(index+1);
return suffix
}
}
}
</script>
<style>
.slot-btn {
width: 220rpx;
height: 220rpx;
background: #F5F5F5;
border-radius: 17rpx;
display: flex;
align-items: center;
justify-content: center;
}
.slot-btn .image {
width: 54rpx;
height: auto;
}
.mmyVideo {
width: 100%;
height: 100%;
}
.fliebox{
width: 100%;
height: 30px;
padding: 0 10px;
border:1px solid #e2e2e2;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 4px;
font-size: 12px;
margin-bottom: 5px;
}
.fliebox_l{
width: 1px;
flex:1;
overflow: hidden;display: inline-block;white-space: nowrap; text-overflow:ellipsis;
}
.fliebox_r{
width: 36rpx;
}
</style>
......@@ -3,33 +3,33 @@
<view class="single_Phone">
<span style="color:red;margin-right:5rpx;" v-show="CompData.IsRequire">*</span>{{CompData.Name}}
</view>
<u-upload ref="uUpload" :action="action" :show-tips="false" @on-remove="onRemove"
<imgupload ref="uUpload" :action="action" :show-tips="false" @on-remove="onRemove"
@on-oversize="onversize"
@on-exceed="onexceed"
:max-size="CompData.FileSizeLimit==0?99999* 1024 * 1024:CompData.FileSizeLimit * 1024 * 1024"
:max-count="CompData.FileCount==0?'999999':CompData.FileCount"
:file-list="fileList"
@on-success="uploadSuccessHandler"
></u-upload>
></imgupload>
<view style="width: 100%;height: 1px;background: #e2e2e2;"></view>
<view class="single_Remark" v-if="CompData.Remark">{{CompData.Remark}}</view>
</view>
</template>
<script>
import imgupload from '../components/img-upload.vue'
export default {
props: ["CompData",'index'],
components: { imgupload},
data(){
return{
action: this.host2 + "/api/File/UploadTencent",
action: '',
fileList:[],
}
},
created() {
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1;
// this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
var newPath = "/EduSystem/Test/Upload/";
var newPath = "/korea/Test/Upload/";
this.action = this.UploadConfig().UploadUrl + "?fileSavePath=" + newPath;
if(this.CompData.FileList.length>0){
this.fileList=[]
......@@ -46,11 +46,9 @@
methods:{
uploadSuccessHandler(data, index, lists) {
let r = JSON.parse(data);
console.log(r,index,lists,'listslistslistslists')
var url= this.UploadConfig().ImageUrl+ r.FilePath;
console.log(url)
this.CompData.FileList.push(r.data);
this.CompData.FileList.push(url);
this.$emit('success', this.CompData, this.index)
},
......
......@@ -19,7 +19,7 @@
display: flex;
align-items: center;
justify-content: center;
" @tap.stop="CompData.FileList.splice(y,1),FileList.splice(y,1)">
" @tap.stop="getdelete(y)">
<u-icon class="u-icon" name="cross" size="30" color="#ffffff"></u-icon>
</view>
......@@ -59,7 +59,12 @@
created() {
this.FileList = JSON.parse((JSON.stringify(this.CompData.FileList)))
},
methods: {
methods: {
getdelete(index){
this.CompData.FileList.splice(index,1)
this.FileList.splice(index,1)
this.$emit('success', this.CompData, this.index)
},
enlarge(file) {
// 全屏
......@@ -106,7 +111,7 @@
});
},
upFile(filePath, type) {
var newPath = "/EduSystem/Test/Upload/";
var newPath = "/korea/Test/Upload/";
let action = this.UploadConfig().UploadUrl + "?fileSavePath=" + newPath;
......
......@@ -8,11 +8,11 @@ export default {
// Vue.prototype.host2 = "http://192.168.20.17:8014"
// Vue.prototype.host2 = "http://192.168.20.17:8014"
// Vue.prototype.host2 = "http://testmall.oytour.com/"
Vue.prototype.UploadConfig = function() {
return {
UploadUrl: "http://192.168.20.214:8120/Upload/AppUpload",
ImageUrl: "http://192.168.20.214:8130"
}
Vue.prototype.UploadConfig = function() {//本地上传配置
return {
UploadUrl:this.host2.indexOf('mallApi')!=-1 ? "https://upload.oytour.com/Upload/AppUpload":"http://192.168.20.214:8120/Upload/AppUpload",
ImageUrl:this.host2.indexOf('mallApi')!=-1? "https://imgfile.oytour.com":"http://192.168.20.214:8130",
}
}
Vue.prototype.request = function(param, success, failed) {
//网络请求
......
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