Commit 129ecc57 authored by 黄媛媛's avatar 黄媛媛
parents 3de32eb5 a0ef0422
This diff is collapsed.
...@@ -167,8 +167,8 @@ ...@@ -167,8 +167,8 @@
text-align: center; text-align: center;
} }
.hotelmanagement .hotelBtn { .hotelmanagement .hotelBtnMan {
width: 80px; width: 50px;
height: 28px; height: 28px;
border-radius: 14px; border-radius: 14px;
color: #fff; color: #fff;
...@@ -176,10 +176,6 @@ ...@@ -176,10 +176,6 @@
background-color: #f76f6f; background-color: #f76f6f;
} }
.hotelmanagement .hotelBtn:first-child {
margin-right: 19px;
}
.hotelmanagement .w150 .el-input { .hotelmanagement .w150 .el-input {
width: 150px; width: 150px;
} }
...@@ -335,8 +331,9 @@ ...@@ -335,8 +331,9 @@
</div> </div>
</div> </div>
<div class="btnList"> <div class="btnList">
<button @click="goSubInfo('HotelInfo',item.ID)" class="hotelBtn">{{$t('pub.updateMsg')}}</button> <button @click="goSubInfo('HotelInfo',item.ID)" class="hotelBtnMan">{{$t('pub.updateMsg')}}</button>
<button v-if="IsHotelPriceStock==1" @click="goUrl('HotelProductManage2',item)" class="hotelBtn">{{$t('ground.baojiayukucun')}}</button> <button @click="CopyHotel(item.ID)" class="hotelBtnMan">复制</button>
<button v-if="IsHotelPriceStock==1" style="width:80px;" @click="goUrl('HotelProductManage2',item)" class="hotelBtnMan">{{$t('ground.baojiayukucun')}}</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -387,6 +384,29 @@ ...@@ -387,6 +384,29 @@
}; };
}, },
methods: { methods: {
CopyHotel(Id)
{
var that = this;
that.Confirm('是否要复制此酒店?', function () {
var msg = {
Id: Id
};
that.apipost(
"hotel_post_CopyHotelService",
msg,
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.selectResource();
}
else {
that.Error(res.data.message);
}
},
null
);
});
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.selectResource(); this.selectResource();
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
</td> </td>
<td>{{item.Address}}</td> <td>{{item.Address}}</td>
<td>{{item.AllianceName}}</td> <td>{{item.AllianceName}}</td>
<td>{{item.EmName}}</td> <td>{{item.EmName}}{{item.IsSys==1?"(导入)":""}}</td>
<td>{{valueToWord(item.CustomerStatus)}}</td> <td>{{valueToWord(item.CustomerStatus)}}</td>
<td>{{item.TotalPrice}}</td> <td>{{item.TotalPrice}}</td>
<td>{{item.TotalGuestNum}}</td> <td>{{item.TotalGuestNum}}</td>
......
This diff is collapsed.
...@@ -5007,7 +5007,6 @@ ...@@ -5007,7 +5007,6 @@
res => { res => {
this.loading = false; this.loading = false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
console.log(res,'resssssssss');
this.OrderDataList = res.data.data; this.OrderDataList = res.data.data;
this.IsUpdateOrderMoney = res.data.data.IsUpdateOrderMoney this.IsUpdateOrderMoney = res.data.data.IsUpdateOrderMoney
} }
......
...@@ -655,13 +655,11 @@ export default { ...@@ -655,13 +655,11 @@ export default {
}else if(this.index1 + 1==3){ }else if(this.index1 + 1==3){
period=this.yearVal period=this.yearVal
} }
console.log(this.yearVal,this.weekVal,this.monthVal)
let msg = { let msg = {
timeRange: this.index1 + 1, timeRange: this.index1 + 1,
userRange: this.index2 + 1, userRange: this.index2 + 1,
period period
}; };
console.log(msg)
this.apipost("user_get_usedsixSatistics", msg, r => { this.apipost("user_get_usedsixSatistics", msg, r => {
if(r.data.data && r.data.data.length>0){ if(r.data.data && r.data.data.length>0){
this.tableData = this.orderBy( this.tableData = this.orderBy(
......
<style> <style>
.leftDayList{ .ComTripList .leftDayList {
display:inline-block; display: inline-block;
width: 30px;
height: 100%;
vertical-align: top;
} }
.dayNum{
.ComTripList .dayNum {
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
margin-left: -42px; margin-left: -42px;
...@@ -11,26 +15,172 @@ ...@@ -11,26 +15,172 @@
margin-bottom: 5px; margin-bottom: 5px;
display: block; display: block;
} }
.siteList{
.ComTripList .siteList {
display: inline-block; display: inline-block;
position: relative; position: relative;
border-left: 2px solid #ebebec; border-left: 2px solid #ebebec;
position: relative; position: relative;
padding: 0 0 20px; padding: 0 0 50px 50px;
margin-left: 10px; margin-left: 10px;
} }
.ComTripList .Trip_Content {
margin-left: 100px;
}
.ComTripList .Trip_Content:first-child {
margin-top: 20px;
}
.ComTripList .Trip_Content:last-child {
margin-bottom: 20px;
}
.ComTripList .TC_circles {
width: 18px;
height: 18px;
background: #fff;
border-radius: 100%;
border: 2px solid #90b7ec;
position: absolute;
left: -11px;
top: 0;
}
.ComTripList .TripControl {
display: inline-block;
vertical-align: middle;
position: relative;
top: -170px;
margin-left: 30px;
}
.ComTripList .TripControl i {
display: inline-block;
width: 30px;
height: 30px;
line-height: 30px;
cursor: pointer;
border-radius: 50%;
text-align: center;
}
.ComTripList .TripControl i:hover {
background-color: #90b7ec;
color: #fff;
}
.ComTripList .addTrip {
width: 30px;
height: 30px;
color: #fff;
text-align: center;
font-size: 25px;
line-height: 28px;
background-color: #f60;
border-radius: 100%;
cursor: pointer;
margin: -2px 0 20px 130px;
}
</style> </style>
<template> <template>
<div> <div class="ComTripList">
<div v-if="TripType==0">
<quill-editor v-model="TripListArr[0].TravelContent" style="height:400px;"></quill-editor>
</div>
<div v-else class="Trip_Content" v-for="(item,index) in TripListArr" :key="index">
<div class="leftDayList"> <div class="leftDayList">
<span class="dayNum">第1</span> <span class="dayNum">{{index+1}}</span>
</div> </div>
<div class="siteList"> <div class="siteList">
<el-form-item label="前往地" label-width='100px'> <el-form-item label="前往地" label-width='100px' style="display:inline-block;">
<el-input type="text" class="w300"></el-input <el-input type="text" class="w150" v-model="item.Go"></el-input>
>&nbsp;仲裁委员会仲裁; </el-form-item>
<el-form-item label="前往省份/国家地区" label-width='160px' style="display:inline-block;">
<el-input type="text" class="w150" v-model="item.GoProvice"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否过境" label-width='100px' style="display:inline-block;">
<el-checkbox v-model="item.IsOut" :true-label="CheckedVaule" :false-label="UnCheckedVaule"></el-checkbox>
</el-form-item>
<quill-editor v-model="item.TravelContent" style="height:300px;"></quill-editor>
<div class="TC_circles"></div>
</div>
<div class="TripControl">
<i class="iconfont icon-img_delete_small" style="margin-left:10px;" @click="delTrip(index)"></i>
</div>
<div class="addTrip" @click="addTrip()">+</div>
</div> </div>
</div> </div>
</template> </template>
<script>
export default {
props: ["ContractTripList", "TripType"],
data() {
return {
checked: false,
TripListArr: [],
//选中过境
CheckedVaule: 1,
//不过境
UnCheckedVaule: 0,
};
},
mounted() {
},
created() {
if (this.ContractTripList) {
if (this.ContractTripList.length > 0) {
this.TripListArr = JSON.parse(JSON.stringify(this.ContractTripList));
} else {
var tripObj = {
DayNum: 1, //天数
Go: '', // 前往地
GoProvice: '', //前往国家地区
IsOut: 0, // 是否过境(0-不过,1-过)
TravelContent: '', //行程内容
}
this.TripListArr.push(tripObj);
}
}
},
methods: {
//添加行程
addTrip() {
let obj = {
DayNum: '', //天数
Go: '', // 前往地
GoProvice: '', //前往国家地区
IsOut: 0, // 是否过境(0-不过,1-过)
TravelContent: '', //行程内容
}
this.TripListArr.push(obj);
this.getSavedData();
},
//删除行程
delTrip(index) {
this.TripListArr.splice(index, 1);
this.getSavedData();
},
//遍历已经保存数据
getSavedData() {
this.TripListArr.forEach((x, index) => {
x.DayNum = index + 1;
})
}
},
watch: {
//监听参数
TripListArr: {
handler: function (val, oldVal) {
this.$emit('tripData', this.TripListArr);
},
deep: true
},
}
};
</script>
...@@ -67,8 +67,6 @@ ...@@ -67,8 +67,6 @@
<div v-if="FeatureData.FeatureType==FeatureTypeState.userDefined"> <div v-if="FeatureData.FeatureType==FeatureTypeState.userDefined">
<span class="userDeSpan">{{$t('sm.xiaoguoyldzxg')}}</span> <span class="userDeSpan">{{$t('sm.xiaoguoyldzxg')}}</span>
<div class="userDefined"> <div class="userDefined">
<!-- <quill-editor @change="onEditorChange($event)" v-model="FeatureData.FeatureContent">
</quill-editor>-->
<my-edit v-on:edit-value="FeatureData.FeatureContent = arguments[0]" <my-edit v-on:edit-value="FeatureData.FeatureContent = arguments[0]"
v-bind:editValue="FeatureData.FeatureContent" v-bind:toolbarShow="toolbar" v-bind:editValue="FeatureData.FeatureContent" v-bind:toolbarShow="toolbar"
v-bind:referenceList="DefaultList" v-bind:placeholder="placeholder"></my-edit> v-bind:referenceList="DefaultList" v-bind:placeholder="placeholder"></my-edit>
......
<template> <template>
<div :class="isHorizontal === true?'vToolBar vToolBar_horizontal':'vToolBar vToolBar_vertical'"> <div
:class="
isHorizontal === true
? 'vToolBar vToolBar_horizontal'
: 'vToolBar vToolBar_vertical'
"
>
<div v-if="preShow()"> <div v-if="preShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.leftZ:'iconfont ' + icon.topZ" @click="toPreZ"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.leftZ
: 'iconfont ' + icon.topZ
"
@click="toPreZ"
></i>
</div> </div>
<div v-if="preShow()"> <div v-if="preShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.leftY:'iconfont ' + icon.topY" @click="toPreY"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.leftY
: 'iconfont ' + icon.topY
"
@click="toPreY"
></i>
</div> </div>
<div v-if="isHuan === true"> <div v-if="isHuan === true">
<i :class="'iconfont ' + icon.huan" @click="toHuan"></i> <i :class="'iconfont ' + icon.huan" @click="toHuan"></i>
...@@ -12,26 +32,44 @@ ...@@ -12,26 +32,44 @@
<div v-if="isXuan === true"> <div v-if="isXuan === true">
<i :class="'iconfont ' + icon.xuan" @click="toXuan"></i> <i :class="'iconfont ' + icon.xuan" @click="toXuan"></i>
</div> </div>
<div v-if="isAdd === true" style="display:none;"> <div v-if="isAdd === true">
<i :class="'' + icon.add" @click="toAdd"></i> <i :class="'' + icon.add" @click="toAdd"></i>
</div> </div>
<div v-if="isDelete === true"> <div v-if="isDelete === true">
<i :class="'iconfont ' + icon.delete" @click="toDelete"></i> <i :class="'iconfont ' + icon.delete" @click="toDelete"></i>
</div> </div>
<div v-if="nextShow()"> <div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightY:'iconfont ' + icon.bottomY" @click="toNextY"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightY
: 'iconfont ' + icon.bottomY
"
@click="toNextY"
></i>
</div> </div>
<div v-if="nextShow()"> <div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightZ:'iconfont ' + icon.bottomZ" @click="toNextZ"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightZ
: 'iconfont ' + icon.bottomZ
"
@click="toNextZ"
></i>
</div> </div>
<div v-if="isReset === true"> <div v-if="isReset === true">
<i title="重置图片位置" :class="'iconfont ' + icon.reset" @click="toReset"></i> <i
title="重置图片位置"
:class="'iconfont ' + icon.reset"
@click="toReset"
></i>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
// 是否横向 // 是否横向
isHorizontal: { isHorizontal: {
...@@ -46,7 +84,7 @@ ...@@ -46,7 +84,7 @@
// 标识 // 标识
name: { name: {
type: String, type: String,
default: '' default: ""
}, },
// 当前版块下标 // 当前版块下标
index1: { index1: {
...@@ -94,120 +132,132 @@ ...@@ -94,120 +132,132 @@
default: false default: false
} }
}, },
data () { data() {
return { return {
icon: { icon: {
topZ: 'icon-zhiding', topZ: "icon-zhiding",
topY: 'icon-arrow-up', topY: "icon-arrow-up",
leftZ: 'icon-left1', leftZ: "icon-left1",
leftY: 'icon-left', leftY: "icon-left",
huan: 'icon-img_bdsc', huan: "icon-img_bdsc",
xuan: 'icon-img_cz', xuan: "icon-img_cz",
delete: 'icon-remove', delete: "icon-remove",
rightY: 'icon-right1', rightY: "icon-right1",
rightZ: 'icon-right', rightZ: "icon-right",
bottomY: 'icon-arrowdown', bottomY: "icon-arrowdown",
bottomZ: 'icon-zhidi', bottomZ: "icon-zhidi",
reset: 'icon-zhongzhi', reset: "icon-zhongzhi",
add: 'el-icon-plus' add: "el-icon-plus"
}
} }
};
}, },
methods: { methods: {
preShow: function () { preShow: function() {
if (this.type === 1) { if (this.type === 1) {
if (this.length1!==0&&this.index1>0&&this.index1<this.length1) { if (
return true this.length1 !== 0 &&
this.index1 > 0 &&
this.index1 < this.length1
) {
return true;
} else { } else {
return false return false;
} }
} else { } else {
if (this.length2!==0&&this.index2>0&&this.index2<this.length2) { if (
return true this.length2 !== 0 &&
this.index2 > 0 &&
this.index2 < this.length2
) {
return true;
} else { } else {
return false return false;
} }
} }
}, },
nextShow: function () { nextShow: function() {
if (this.type === 1) { if (this.type === 1) {
if (this.length1!==0&&this.index1<this.length1-1) { if (this.length1 !== 0 && this.index1 < this.length1 - 1) {
return true return true;
} else { } else {
return false return false;
} }
} else { } else {
if (this.length2!==0&&this.index2<this.length2-1) { if (this.length2 !== 0 && this.index2 < this.length2 - 1) {
return true return true;
} else { } else {
return false return false;
} }
} }
}, },
toPreZ: function () { toPreZ: function() {
this.$emit('toPreZ', this.name, this.index1, this.index2) this.$emit("toPreZ", this.name, this.index1, this.index2);
}, },
toPreY: function () { toPreY: function() {
this.$emit('toPreY', this.name, this.index1, this.index2) this.$emit("toPreY", this.name, this.index1, this.index2);
}, },
toNextY: function () { toNextY: function() {
this.$emit('toNextY', this.name, this.index1, this.index2) this.$emit("toNextY", this.name, this.index1, this.index2);
}, },
toNextZ: function () { toNextZ: function() {
this.$emit('toNextZ', this.name, this.index1, this.index2) this.$emit("toNextZ", this.name, this.index1, this.index2);
}, },
toHuan: function () { toHuan: function() {
this.$emit('toHuan', this.name, this.index1, this.index2) this.$emit("toHuan", this.name, this.index1, this.index2);
}, },
toXuan: function () { toXuan: function() {
this.$emit('toXuan', this.name, this.index1, this.index2) this.$emit("toXuan", this.name, this.index1, this.index2);
}, },
toDelete: function () { toDelete: function() {
this.$emit('toDelete', this.name, this.index1, this.index2) this.$emit("toDelete", this.name, this.index1, this.index2);
}, },
toReset: function () { toReset: function() {
this.$emit('toReset', this.name, this.index1, this.index2) this.$emit("toReset", this.name, this.index1, this.index2);
}, },
//添加 //添加
toAdd:function() toAdd: function() {
{ this.$emit("toAdd", this.name, this.index1, this.index2);
this.$emit('toAdd', this.name, this.index1, this.index2)
}
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.vToolBar{ .vToolBar {
display: inline-block; display: inline-block;
font-size: 0px; font-size: 0px;
background-color: rgba(0, 0, 0, .7); background-color: rgba(0, 0, 0, 0.7);
border-radius: 2px; border-radius: 2px;
} }
.vToolBar_horizontal{
.vToolBar_horizontal {
height: 30px; height: 30px;
white-space: nowrap; white-space: nowrap;
} }
.vToolBar_vertical{
.vToolBar_vertical {
width: 30px; width: 30px;
} }
.vToolBar>div{
.vToolBar > div {
display: inline-block; display: inline-block;
width: 30px; width: 30px;
height: 30px; height: 30px;
vertical-align: top; vertical-align: top;
cursor: pointer; cursor: pointer;
} }
.vToolBar>div>i{
.vToolBar > div > i {
display: inline-block; display: inline-block;
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
color: #FFFFFF; color: #ffffff;
} }
.vToolBar>div>i:hover{
.vToolBar > div > i:hover {
background-color: #666666; background-color: #666666;
} }
</style> </style>
...@@ -303,9 +303,6 @@ ...@@ -303,9 +303,6 @@
methods: { methods: {
//非直采切换 //非直采切换
NoDirectScenicCheck(number) { NoDirectScenicCheck(number) {
// this.dayObj.ScenicArray.forEach(x=>{
// x.ScenicJson = x.ScenicJsonStr ? JSON.parse(x.ScenicJsonStr) : { x:0, y:0 };
// })
if (this.dayObj.ScenicArray == null) { if (this.dayObj.ScenicArray == null) {
this.dayObj.ScenicArray = []; this.dayObj.ScenicArray = [];
} }
......
This diff is collapsed.
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
} }
.scenicSpotList .hotelBtn { .scenicSpotList .hotelBtn {
width: 80px; width: 60px;
height: 28px; height: 28px;
background: #f76f6f; background: #f76f6f;
border-radius: 14px; border-radius: 14px;
...@@ -163,10 +163,6 @@ ...@@ -163,10 +163,6 @@
cursor: pointer; cursor: pointer;
} }
.scenicSpotList .hotelBtn:first-child {
margin-right: 19px;
}
.scenicSpotList .w150 .el-input { .scenicSpotList .w150 .el-input {
width: 150px !important; width: 150px !important;
} }
...@@ -319,6 +315,7 @@ ...@@ -319,6 +315,7 @@
</el-tooltip> </el-tooltip>
<div class="btnList"> <div class="btnList">
<button @click="goUrl('scenicSpotInfoManage',item.ID)" class="hotelBtn">{{$t('pub.updateMsg')}}</button> <button @click="goUrl('scenicSpotInfoManage',item.ID)" class="hotelBtn">{{$t('pub.updateMsg')}}</button>
<button @click="CopyScenic(item.ID)" class="hotelBtn">复制</button>
<button @click="goUrlT('ticketManagement',item.ID)" class="hotelBtn">{{$t('scen.sc_piao')}}</button> <button @click="goUrlT('ticketManagement',item.ID)" class="hotelBtn">{{$t('scen.sc_piao')}}</button>
</div> </div>
</div> </div>
...@@ -380,6 +377,29 @@ ...@@ -380,6 +377,29 @@
}; };
}, },
methods: { methods: {
CopyScenic(Id)
{
var that = this;
that.Confirm('是否要复制此景点?', function () {
var msg = {
ID: Id
};
that.apipost(
"ticketcoupons_post_CopyTicketCouponsService",
msg,
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.selectResource();
}
else {
that.Error(res.data.message);
}
},
null
);
});
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.selectResource(); this.selectResource();
......
...@@ -2,7 +2,7 @@ import store from '../' ...@@ -2,7 +2,7 @@ import store from '../'
import config from '../../configs' import config from '../../configs'
import util from '../../utils' import util from '../../utils'
export function formatMsg (msg) { export function formatMsg(msg) {
const nim = store.state.nim const nim = store.state.nim
if (msg.type === 'robot') { if (msg.type === 'robot') {
if (msg.content && msg.content.flag === 'bot') { if (msg.content && msg.content.flag === 'bot') {
...@@ -25,21 +25,21 @@ export function formatMsg (msg) { ...@@ -25,21 +25,21 @@ export function formatMsg (msg) {
return msg return msg
} }
export function onRoamingMsgs (obj) { export function onRoamingMsgs(obj) {
let msgs = obj.msgs.map(msg => { let msgs = obj.msgs.map(msg => {
return formatMsg(msg) return formatMsg(msg)
}) })
store.commit('updateMsgs', msgs) store.commit('updateMsgs', msgs)
} }
export function onOfflineMsgs (obj) { export function onOfflineMsgs(obj) {
let msgs = obj.msgs.map(msg => { let msgs = obj.msgs.map(msg => {
return formatMsg(msg) return formatMsg(msg)
}) })
store.commit('updateMsgs', msgs) store.commit('updateMsgs', msgs)
} }
export function onMsg (msg) { export function onMsg(msg) {
msg = formatMsg(msg) msg = formatMsg(msg)
store.commit('putMsg', msg) store.commit('putMsg', msg)
if (msg.sessionId === store.state.currSessionId) { if (msg.sessionId === store.state.currSessionId) {
...@@ -52,7 +52,7 @@ export function onMsg (msg) { ...@@ -52,7 +52,7 @@ export function onMsg (msg) {
} }
} }
function onSendMsgDone (error, msg) { function onSendMsgDone(error, msg) {
store.dispatch('hideLoading') store.dispatch('hideLoading')
if (error) { if (error) {
// 被拉黑 // 被拉黑
...@@ -67,7 +67,7 @@ function onSendMsgDone (error, msg) { ...@@ -67,7 +67,7 @@ function onSendMsgDone (error, msg) {
} }
// 消息撤回 // 消息撤回
export function onRevocateMsg (error, msg) { export function onRevocateMsg(error, msg) {
const nim = store.state.nim const nim = store.state.nim
if (error) { if (error) {
if (error.code === 508) { if (error.code === 508) {
...@@ -94,7 +94,7 @@ export function onRevocateMsg (error, msg) { ...@@ -94,7 +94,7 @@ export function onRevocateMsg (error, msg) {
to: msg.to, to: msg.to,
tip, tip,
time: msg.time, time: msg.time,
done: function sendTipMsgDone (error, tipMsg) { done: function sendTipMsgDone(error, tipMsg) {
let idClient = msg.deletedIdClient || msg.idClient let idClient = msg.deletedIdClient || msg.idClient
store.commit('replaceMsg', { store.commit('replaceMsg', {
sessionId: msg.sessionId, sessionId: msg.sessionId,
...@@ -112,20 +112,28 @@ export function onRevocateMsg (error, msg) { ...@@ -112,20 +112,28 @@ export function onRevocateMsg (error, msg) {
}) })
} }
export function revocateMsg ({state, commit}, msg) { export function revocateMsg({
state,
commit
}, msg) {
const nim = state.nim const nim = state.nim
let {idClient} = msg let {
idClient
} = msg
msg = Object.assign(msg, state.msgsMap[idClient]) msg = Object.assign(msg, state.msgsMap[idClient])
nim.deleteMsg({ nim.deleteMsg({
msg, msg,
done: function deleteMsgDone (error) { done: function deleteMsgDone(error) {
onRevocateMsg(error, msg) onRevocateMsg(error, msg)
} }
}) })
} }
// 发送普通消息 // 发送普通消息
export function sendMsg ({state, commit}, obj) { export function sendMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
obj = obj || {} obj = obj || {}
let type = obj.type || '' let type = obj.type || ''
...@@ -152,13 +160,16 @@ export function sendMsg ({state, commit}, obj) { ...@@ -152,13 +160,16 @@ export function sendMsg ({state, commit}, obj) {
} }
} }
export function sendTip ({state, commit}, obj) { export function sendTip({
state,
commit
}, obj) {
const nim = store.state.nim const nim = store.state.nim
nim.sendTipMsg({ nim.sendTipMsg({
scene: obj.scene, scene: obj.scene,
to: obj.to, to: obj.to,
tip: obj.tip, tip: obj.tip,
done: function sendTipMsgDone (error, msg) { done: function sendTipMsgDone(error, msg) {
// 超哥 do something // 超哥 do something
onSendMsgDone(error, msg) onSendMsgDone(error, msg)
} }
...@@ -166,9 +177,16 @@ export function sendTip ({state, commit}, obj) { ...@@ -166,9 +177,16 @@ export function sendTip ({state, commit}, obj) {
} }
// 发送文件消息 // 发送文件消息
export function sendFileMsg ({state, commit}, obj) { export function sendFileMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
let {scene, to, fileInput} = obj let {
scene,
to,
fileInput
} = obj
let type = 'file' let type = 'file'
if (/\.(png|jpg|bmp|jpeg|gif)$/i.test(fileInput.value)) { if (/\.(png|jpg|bmp|jpeg|gif)$/i.test(fileInput.value)) {
type = 'image' type = 'image'
...@@ -199,16 +217,26 @@ export function sendFileMsg ({state, commit}, obj) { ...@@ -199,16 +217,26 @@ export function sendFileMsg ({state, commit}, obj) {
}) })
} }
export function sendDataUrlMsg ({state, commit}, obj) { export function sendDataUrlMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
let {scene, to, dataURL, name} = obj let {
scene,
to,
dataURL,
name
} = obj
let type = 'file' let type = 'file'
if (/(png|jpg|bmp|jpeg|gif)$/i.test(name)) { if (/(png|jpg|bmp|jpeg|gif)$/i.test(name)) {
type = 'image' type = 'image'
} else if (/(mov|mp4|ogg|webm)$/i.test(name)) { } else if (/(mov|mp4|ogg|webm)$/i.test(name)) {
type = 'video' type = 'video'
} }
let otherMsg = {'fileName': name} let otherMsg = {
'fileName': name
}
store.dispatch('showLoading') store.dispatch('showLoading')
nim.sendFile({ nim.sendFile({
scene: scene, scene: scene,
...@@ -235,9 +263,21 @@ export function sendDataUrlMsg ({state, commit}, obj) { ...@@ -235,9 +263,21 @@ export function sendDataUrlMsg ({state, commit}, obj) {
} }
// 发送机器人消息 // 发送机器人消息
export function sendRobotMsg ({state, commit}, obj) { export function sendRobotMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
let {type, scene, to, robotAccid, content, params, target, body} = obj let {
type,
scene,
to,
robotAccid,
content,
params,
target,
body
} = obj
scene = scene || 'p2p' scene = scene || 'p2p'
if (type === 'text') { if (type === 'text') {
nim.sendRobotMsg({ nim.sendRobotMsg({
...@@ -279,7 +319,10 @@ export function sendRobotMsg ({state, commit}, obj) { ...@@ -279,7 +319,10 @@ export function sendRobotMsg ({state, commit}, obj) {
} }
// 发送消息已读回执 // 发送消息已读回执
export function sendMsgReceipt ({state, commit}) { export function sendMsgReceipt({
state,
commit
}) {
// 如果有当前会话 // 如果有当前会话
let currSessionId = store.state.currSessionId let currSessionId = store.state.currSessionId
if (currSessionId) { if (currSessionId) {
...@@ -290,7 +333,7 @@ export function sendMsgReceipt ({state, commit}) { ...@@ -290,7 +333,7 @@ export function sendMsgReceipt ({state, commit}) {
if (state.sessionMap[currSessionId]) { if (state.sessionMap[currSessionId]) {
nim.sendMsgReceipt({ nim.sendMsgReceipt({
msg: state.sessionMap[currSessionId].lastMsg, msg: state.sessionMap[currSessionId].lastMsg,
done: function sendMsgReceiptDone (error, obj) { done: function sendMsgReceiptDone(error, obj) {
// do something // do something
} }
}) })
...@@ -299,21 +342,27 @@ export function sendMsgReceipt ({state, commit}) { ...@@ -299,21 +342,27 @@ export function sendMsgReceipt ({state, commit}) {
} }
} }
function sendMsgReceiptDone (error, obj) { function sendMsgReceiptDone(error, obj) {
console.log('发送消息已读回执' + (!error ? '成功' : '失败'), error, obj) console.log('发送消息已读回执' + (!error ? '成功' : '失败'), error, obj)
} }
export function getHistoryMsgs ({state, commit}, obj) { export function getHistoryMsgs({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
if (nim) { if (nim) {
let {scene, to} = obj let {
scene,
to
} = obj
let options = { let options = {
scene, scene,
to, to,
reverse: false, reverse: false,
asc: true, asc: true,
limit: config.localMsglimit || 20, limit: config.localMsglimit || 20,
done: function getHistoryMsgsDone (error, obj) { done: function getHistoryMsgsDone(error, obj) {
if (obj.msgs) { if (obj.msgs) {
if (obj.msgs.length === 0) { if (obj.msgs.length === 0) {
commit('setNoMoreHistoryMsgs') commit('setNoMoreHistoryMsgs')
...@@ -341,11 +390,15 @@ export function getHistoryMsgs ({state, commit}, obj) { ...@@ -341,11 +390,15 @@ export function getHistoryMsgs ({state, commit}, obj) {
} }
} }
export function resetNoMoreHistoryMsgs ({commit}) { export function resetNoMoreHistoryMsgs({
commit
}) {
commit('resetNoMoreHistoryMsgs') commit('resetNoMoreHistoryMsgs')
} }
// 继续与机器人会话交互 // 继续与机器人会话交互
export function continueRobotMsg ({commit}, robotAccid) { export function continueRobotMsg({
commit
}, robotAccid) {
commit('continueRobotMsg', robotAccid) commit('continueRobotMsg', robotAccid)
} }
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