Commit 9c5cd8be authored by Mac's avatar Mac

修改

parent 38e2ca79
...@@ -238,12 +238,12 @@ ...@@ -238,12 +238,12 @@
</view> </view>
</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">
<view class="box_conent_basic_img_t">评比结果</view> <view class="box_conent_basic_img_t">评比结果</view>
</view> </view>
<view class="box_conent_basic_c" style="padding: 0 5px;" v-if="detailsData"> <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 class="cbc_item_l">
<view v-if="detailsData.EnableRank==1" 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> <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 @@ ...@@ -319,6 +319,12 @@
<view class="cans_c_l">{{item.CompData.Name}}:</view> <view class="cans_c_l">{{item.CompData.Name}}:</view>
<view class="cans_c_r">{{getDorpDownData(item.CompData.OptionValue,item.CompData.OptionList)}}</view> <view class="cans_c_r">{{getDorpDownData(item.CompData.OptionValue,item.CompData.OptionList)}}</view>
</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>
<view class="btn_bm" v-if="detailsData.ListState==1" @click="goeditsignUp(x)">编辑</view> <view class="btn_bm" v-if="detailsData.ListState==1" @click="goeditsignUp(x)">编辑</view>
...@@ -404,6 +410,7 @@ ...@@ -404,6 +410,7 @@
if(this.detailsData.EnrollList && this.detailsData.EnrollList.length>0){ if(this.detailsData.EnrollList && this.detailsData.EnrollList.length>0){
this.detailsData.EnrollList.forEach(x=>{ this.detailsData.EnrollList.forEach(x=>{
x.Content = JSON.parse(x.Content) x.Content = JSON.parse(x.Content)
}) })
} }
...@@ -446,7 +453,7 @@ ...@@ -446,7 +453,7 @@
}); });
}, },
getDorpDownData(value,list){ getDorpDownData(value,list){
console.log(data,'split')
let data = value.toString().split(',') let data = value.toString().split(',')
let text = '' let text = ''
...@@ -465,6 +472,19 @@ ...@@ -465,6 +472,19 @@
}) })
return text 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 @@ ...@@ -62,8 +62,10 @@
@success="datasuccess()"></selectChoice> @success="datasuccess()"></selectChoice>
<pictureUpload v-if="item.CompKey=='ImageUploadComp'" :CompData="item.CompData" :index='index' <pictureUpload v-if="item.CompKey=='ImageUploadComp'" :CompData="item.CompData" :index='index'
@success="datasuccess()"></pictureUpload> @success="datasuccess()"></pictureUpload>
<videoUpload v-if="item.CompKey=='VideoUploadComp'" :CompData="item.CompData" :index='index' @enlarge='enlarge()' <videoUpload v-if="item.CompKey=='VideoUploadComp'" :CompData="item.CompData" :index='index'
@success="datasuccess()"></videoUpload> @success="datasuccess()"></videoUpload>
<fileType v-if="item.CompKey=='CommonUploadComp'" :CompData="item.CompData" :index='index'
@success="datasuccess()"></fileType>
</template> </template>
<view class="btn" @click="setapply()"> <view class="btn" @click="setapply()">
提交申请 提交申请
...@@ -86,6 +88,7 @@ ...@@ -86,6 +88,7 @@
import selectChoice from "./plugin/selectChoice" import selectChoice from "./plugin/selectChoice"
import pictureUpload from "./plugin/pictureUpload" import pictureUpload from "./plugin/pictureUpload"
import videoUpload from "./plugin/videoUpload" import videoUpload from "./plugin/videoUpload"
import fileType from "./plugin/fileType"
export default { export default {
components: { components: {
...@@ -94,6 +97,7 @@ ...@@ -94,6 +97,7 @@
selectChoice, selectChoice,
pictureUpload, pictureUpload,
videoUpload, videoUpload,
fileType
}, },
data() { data() {
...@@ -271,10 +275,10 @@ ...@@ -271,10 +275,10 @@
}, },
datasuccess(data, index) { datasuccess(data, index) {
this.dataList[index].CompData = data this.dataList[index].CompData = data
console.log(data)
}, },
setapply() { setapply() {
console.log('提交', this.dataList)
let show = false let show = false
//验证必填 //验证必填
if(this.addMsg.ObjectId==0 || this.addMsg.ObjectId==null || this.addMsg.ObjectId==''){ 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 @@ ...@@ -3,33 +3,33 @@
<view class="single_Phone"> <view class="single_Phone">
<span style="color:red;margin-right:5rpx;" v-show="CompData.IsRequire">*</span>{{CompData.Name}} <span style="color:red;margin-right:5rpx;" v-show="CompData.IsRequire">*</span>{{CompData.Name}}
</view> </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-oversize="onversize"
@on-exceed="onexceed" @on-exceed="onexceed"
:max-size="CompData.FileSizeLimit==0?99999* 1024 * 1024:CompData.FileSizeLimit * 1024 * 1024" :max-size="CompData.FileSizeLimit==0?99999* 1024 * 1024:CompData.FileSizeLimit * 1024 * 1024"
:max-count="CompData.FileCount==0?'999999':CompData.FileCount" :max-count="CompData.FileCount==0?'999999':CompData.FileCount"
:file-list="fileList" :file-list="fileList"
@on-success="uploadSuccessHandler" @on-success="uploadSuccessHandler"
></u-upload> ></imgupload>
<view style="width: 100%;height: 1px;background: #e2e2e2;"></view> <view style="width: 100%;height: 1px;background: #e2e2e2;"></view>
<view class="single_Remark" v-if="CompData.Remark">{{CompData.Remark}}</view> <view class="single_Remark" v-if="CompData.Remark">{{CompData.Remark}}</view>
</view> </view>
</template> </template>
<script> <script>
import imgupload from '../components/img-upload.vue'
export default { export default {
props: ["CompData",'index'], props: ["CompData",'index'],
components: { imgupload},
data(){ data(){
return{ return{
action: this.host2 + "/api/File/UploadTencent", action: '',
fileList:[], fileList:[],
} }
}, },
created() { created() {
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1; let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1;
// this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId var newPath = "/korea/Test/Upload/";
var newPath = "/EduSystem/Test/Upload/";
this.action = this.UploadConfig().UploadUrl + "?fileSavePath=" + newPath; this.action = this.UploadConfig().UploadUrl + "?fileSavePath=" + newPath;
if(this.CompData.FileList.length>0){ if(this.CompData.FileList.length>0){
this.fileList=[] this.fileList=[]
...@@ -46,11 +46,9 @@ ...@@ -46,11 +46,9 @@
methods:{ methods:{
uploadSuccessHandler(data, index, lists) { uploadSuccessHandler(data, index, lists) {
let r = JSON.parse(data); let r = JSON.parse(data);
console.log(r,index,lists,'listslistslistslists')
var url= this.UploadConfig().ImageUrl+ r.FilePath; var url= this.UploadConfig().ImageUrl+ r.FilePath;
console.log(url) console.log(url)
this.CompData.FileList.push(url);
this.CompData.FileList.push(r.data);
this.$emit('success', this.CompData, this.index) this.$emit('success', this.CompData, this.index)
}, },
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: 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> <u-icon class="u-icon" name="cross" size="30" color="#ffffff"></u-icon>
</view> </view>
...@@ -60,6 +60,11 @@ ...@@ -60,6 +60,11 @@
this.FileList = JSON.parse((JSON.stringify(this.CompData.FileList))) 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) { enlarge(file) {
// 全屏 // 全屏
...@@ -106,7 +111,7 @@ ...@@ -106,7 +111,7 @@
}); });
}, },
upFile(filePath, type) { upFile(filePath, type) {
var newPath = "/EduSystem/Test/Upload/"; var newPath = "/korea/Test/Upload/";
let action = this.UploadConfig().UploadUrl + "?fileSavePath=" + newPath; let action = this.UploadConfig().UploadUrl + "?fileSavePath=" + newPath;
......
...@@ -8,10 +8,10 @@ export default { ...@@ -8,10 +8,10 @@ export default {
// Vue.prototype.host2 = "http://192.168.20.17:8014" // Vue.prototype.host2 = "http://192.168.20.17:8014"
// 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.host2 = "http://testmall.oytour.com/"
Vue.prototype.UploadConfig = function() { Vue.prototype.UploadConfig = function() {//本地上传配置
return { return {
UploadUrl: "http://192.168.20.214:8120/Upload/AppUpload", UploadUrl:this.host2.indexOf('mallApi')!=-1 ? "https://upload.oytour.com/Upload/AppUpload":"http://192.168.20.214:8120/Upload/AppUpload",
ImageUrl: "http://192.168.20.214:8130" ImageUrl:this.host2.indexOf('mallApi')!=-1? "https://imgfile.oytour.com":"http://192.168.20.214:8130",
} }
} }
Vue.prototype.request = function(param, success, failed) { 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