|
|
@@ -33,7 +33,7 @@
|
|
|
|
|
|
<view class="footer-box">
|
|
|
<!-- <button type="primary" class="submit-bth" style="background-color: #aaaaaa;" @click="goStep()">清空</button> -->
|
|
|
- <button type="primary" class="submit-bth" style="background-color: #169bd5;" @click="goStep()">提交</button>
|
|
|
+ <button type="primary" class="submit-bth" style="background-color: #169bd5;" @click="goComment()">提交</button>
|
|
|
</view>
|
|
|
<!-- <view class="mask-share-box" v-if="isShowShare">
|
|
|
<image src="/static/share-arrow.png" mode="aspectFit"></image>
|
|
|
@@ -85,8 +85,8 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- goStep(){
|
|
|
- this.addOrEditActiveRecord();
|
|
|
+ goComment(){
|
|
|
+ this.addOrEditActiveComment();
|
|
|
},
|
|
|
closeShare(e){
|
|
|
this.isShowShareModal = false;
|
|
|
@@ -118,7 +118,7 @@
|
|
|
if (res.data.code === 200) {
|
|
|
let obj = res.data.data;
|
|
|
// this.recordId = obj.id;
|
|
|
- // this.contentDesc = obj.content;
|
|
|
+ this.contentDesc = obj.content;
|
|
|
// this.contentLink = obj.web_url;
|
|
|
// this.uploadList = obj.pic_list.map((item)=>{return this.globalUrl + item.pic_url});
|
|
|
// this.imgIdList = obj.pic_list.map((item)=>{return item.pic_id})
|
|
|
@@ -129,24 +129,23 @@
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- addOrEditActiveFiles(){
|
|
|
+ addOrEditActiveComment(){
|
|
|
let url,data;
|
|
|
let md5Sign = md5(
|
|
|
"method=" +"activity" + "×tamp=" + getApp().globalData.globalTimestamp +
|
|
|
"&secret=" + getApp().globalData.secret
|
|
|
);
|
|
|
if(this.type === 'add'){
|
|
|
- url = getApp().globalData.shareUrl +"api/api.php" +"?method=activity&action=files_add×tamp=" +
|
|
|
+ url = getApp().globalData.shareUrl +"api/api.php" +"?method=activity&action=comment_add×tamp=" +
|
|
|
getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
|
|
|
data = {
|
|
|
openid:getApp().globalData.open_id,
|
|
|
branch_id:this.branchId,
|
|
|
activity_id:this.activeId,
|
|
|
content:this.contentDesc,
|
|
|
- attach_ids:this.imgIdList.join()
|
|
|
}
|
|
|
}else {
|
|
|
- url = getApp().globalData.shareUrl +"api/api.php" +"?method=activity&action=files_update×tamp=" +
|
|
|
+ url = getApp().globalData.shareUrl +"api/api.php" +"?method=activity&action=comment_update×tamp=" +
|
|
|
getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
|
|
|
data = {
|
|
|
openid:getApp().globalData.open_id,
|
|
|
@@ -154,7 +153,6 @@
|
|
|
branch_id:this.branchId,
|
|
|
activity_id:this.activeId,
|
|
|
content:this.contentDesc,
|
|
|
- attach_ids:this.imgIdList.join()
|
|
|
}
|
|
|
}
|
|
|
uni.request({
|
|
|
@@ -178,7 +176,7 @@
|
|
|
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
|
|
|
let nowPage = pages[pages.length - 1]; //当前页页面实例
|
|
|
let prevPage = pages[pages.length - 2]; //上一页页面实例
|
|
|
- prevPage.$vm.pageShowShare(types)
|
|
|
+ prevPage.$vm.pageShowShare(types,'comment')
|
|
|
uni.showToast({
|
|
|
title: "上传成功",
|
|
|
icon: "none",
|
|
|
@@ -194,59 +192,6 @@
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- chooseFile(){
|
|
|
- //chooseMessageFile
|
|
|
- let that = this;
|
|
|
- uni.chooseMessageFile({
|
|
|
- count: 3,
|
|
|
- type: 'file',
|
|
|
- success (res) {
|
|
|
- for(let i=0;i<res.tempFiles.length;i++){
|
|
|
- res.tempFiles[i].size = (res.tempFiles[i].size/1024) ;
|
|
|
- res.tempFiles[i].size = Math.trunc(res.tempFiles[i].size);
|
|
|
- let msg = {name:res.tempFiles[i].name,textValue:res.tempFiles[i].path,size:res.tempFiles[i].size};
|
|
|
- that.uploadFileRequest(msg)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- console.log('文件上传')
|
|
|
- },
|
|
|
- uploadFileRequest(fileVal){
|
|
|
- let that = this;
|
|
|
- let md5Sign = md5(
|
|
|
- "method=" +"activity_file_upload" +"×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +"&secret=" +getApp().globalData.secret
|
|
|
- );
|
|
|
- let url = getApp().globalData.shareUrl + "api/api.php" +"?method=activity_file_upload×tamp=" +
|
|
|
- getApp().globalData.globalTimestamp +"&sign=" + md5Sign;
|
|
|
- uni.uploadFile({
|
|
|
- url:url, //需要设置为全局
|
|
|
- filePath:fileVal.textValue,
|
|
|
- name:'file',
|
|
|
- formData: {
|
|
|
- openid: getApp().globalData.open_id,
|
|
|
- file:fileVal.textValue,
|
|
|
- branch_id:this.branchId,
|
|
|
- file_name:fileVal.name
|
|
|
- },
|
|
|
- success: res => {
|
|
|
- this.fileObj = JSON.parse(res.data);
|
|
|
- console.log(this.fileObj.data)
|
|
|
- this.fileObj.data.url = getApp().globalData.shareUrl + this.fileObj.data.url;
|
|
|
- // let url = 'https://gdoctor.tcmlives.com'
|
|
|
- //let msg = msgType === 4 ? {textValue:url+ tmpres.msg.file_path} : {name:fileVal.name,size:fileVal.size,textValue: url+tmpres.msg.file_path};
|
|
|
- // that.sendMsg(msg,msgType);
|
|
|
- },
|
|
|
- fail:res=>{
|
|
|
- console.log("上传请求失败");
|
|
|
- console.log(res);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- delPhoto(idx) {
|
|
|
- this.uploadList.splice(idx, 1);
|
|
|
- this.imgIdList.splice(idx, 1);
|
|
|
- },
|
|
|
}
|
|
|
}
|
|
|
</script>
|