代码提交

main
123456 4 weeks ago
parent 0959890a5f
commit fcebd33047
  1. 138
      App.vue
  2. 212
      main.js
  3. 48
      pages/dongtai/index.vue
  4. 209
      pages/index/index.vue
  5. 45
      pages/peiwan/index.vue
  6. 237
      pages/pipei/shipin/detail.nvue
  7. 6
      pages/pipei/shipin/index.vue
  8. 8
      pages/pipei/yuyin/index.vue
  9. 74
      pages/user/index.vue
  10. 48
      pages/users/chat/index.vue
  11. 25
      pages/users/wallet/index.vue
  12. 1
      unpackage/debug/.roid.ins
  13. 5079
      unpackage/dist/dev/app-plus/app-service.js
  14. 8522
      unpackage/dist/dev/app-plus/app-view.js
  15. 1102
      unpackage/dist/dev/app-plus/pages/pipei/shipin/detail.js

@ -1,144 +1,6 @@
<script> <script>
export default { export default {
onLaunch: function() { onLaunch: function() {
let timer = null;
//socket
uni.$on("openSocket",function(res){
uni.connectSocket({
url: 'wss://api.lyiyuan.cn/websocket?userId='+uni.getStorageSync('userInfo').id
});
uni.onSocketOpen(function (res) {
xintiao()
uni.sendSocketMessage({data:JSON.stringify({"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"})});
console.log('WebSocket连接已打开!');
uni.setStorageSync("isOpen",true)
});
uni.onSocketMessage(function (res) {
const obj = res.data?JSON.parse(res.data):{};
console.log(obj)
if(obj.topic == 'message'){
if(obj.type>=8){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.type == 12){
uni.$emit("watchEvent",obj)
}
if(obj.type == 9){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: '温馨提示',
content: '来自'+obj.userNickname+"发起的视频匹配,是否同意",
cancelText: '拒绝',
confirmText: '同意',
success: res => {
if(res.confirm){
console.log(obj, uni.getStorageSync("userInfo"))
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 10,
"topic":"message"
})})
if(uni.getStorageSync("userInfo").id == obj.sellerId){
console.log("toChat",uni.getStorageSync("userInfo").id , obj.userId)
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=2&id="+obj.userId
})
}
}else{
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 11,
"topic":"message"
})})
}
},
fail: () => {},
complete: () => {}
});
}
if(obj.type == 8){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: '温馨提示',
content: '来自'+obj.userNickname+"发起的语音匹配,是否同意",
cancelText: '拒绝',
confirmText: '同意',
success: res => {
if(res.confirm){
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: data.id,
type: 10,
"topic":"message"
})})
}else{
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: data.id,
type: 11,
"topic":"message"
})})
}
},
fail: () => {},
complete: () => {}
});
}
}
}
}
});
uni.onSocketClose(function (res) {
clearInterval(timer)
uni.closeSocket();
uni.removeStorageSync("isOpen")
console.log('WebSocket 已关闭!');
setTimeout(()=>{
if(uni.getStorageSync("userInfo").id){
uni.$emit("openSocket")
}
},1000)
});
})
function xintiao() {
timer = setInterval(()=>{
uni.setStorageSync("isOpen",true)
uni.sendSocketMessage({data:JSON.stringify({"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"})});
}, 30000)
}
setTimeout(()=>{
if(uni.getStorageSync("userInfo").id){
uni.$emit("openSocket")
}
},1000)
const bgAudioManager = uni.getBackgroundAudioManager();
uni.$on("playAudio",res=>{
bgAudioManager.src = 'https://api.lyiyuan.cn/profile/upload/static/tishiyin.mp3';
bgAudioManager.play();
})
}, },
onShow: function() { onShow: function() {

@ -15,18 +15,216 @@ Vue.component('insufficient', insufficient)
Vue.component('share', share) Vue.component('share', share)
Vue.component('dashan', dashan) Vue.component('dashan', dashan)
Vue.config.productionTip = false Vue.config.productionTip = false
const bgAudioManager = uni.getBackgroundAudioManager();
uni.$on("playAudio",res=>{
bgAudioManager.src = 'https://api.lyiyuan.cn/profile/upload/static/tishiyin.mp3';
bgAudioManager.play();
})
import api from '@/api/index.js' import api from '@/api/index.js'
Vue.prototype.$api = api Vue.prototype.$api = api
Vue.prototype.$articleShareUrl = "https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/dongtai/detail?type=web&id=" Vue.prototype.$articleShareUrl = "https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/dongtai/detail?type=web&id="
Vue.prototype.$userShareUrl = "https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/login/reg?id=" Vue.prototype.$userShareUrl = "https://api.lyiyuan.cn/profile/upload/web/index.html#/pages/login/reg?id="
let bgAudioManager = uni.getBackgroundAudioManager();
uni.$on("playAudio",res=>{
bgAudioManager.src = 'https://api.lyiyuan.cn/profile/upload/static/tishiyin.mp3';
bgAudioManager.play();
bgAudioManager = null
})
//socket
let timer = null;
uni.$on("openSocket",function(res){
uni.connectSocket({
url: 'wss://api.lyiyuan.cn/websocket?userId='+uni.getStorageSync('userInfo').id
});
uni.onSocketOpen(function (res) {
xintiao()
uni.sendSocketMessage({data:JSON.stringify({"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"})});
console.log('WebSocket连接已打开!');
uni.setStorageSync("isOpen",true)
uni.$emit("watchSocket")
});
uni.$on("watchSocket",res=>{
uni.onSocketMessage(function (res) {
const obj = res.data?JSON.parse(res.data):{};
console.log(obj)
if(obj.topic == 'message'){
if(obj.type>=8){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.type == 12){
uni.$emit("watchEvent",obj)
}
if(obj.type == 20){
uni.$emit("toJieshouYinship",obj)
}
if(obj.type == 18){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=3&id="+obj.userId+'&fid='+obj.sellerId
})
}
if(obj.type == 19){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=4&id="+obj.userId+'&fid='+obj.sellerId
})
}
if(obj.type == 9){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: '温馨提示',
content: '来自'+obj.userNickname+"发起的视频匹配,是否同意",
cancelText: '拒绝',
confirmText: '同意',
success: res => {
if(res.confirm){
console.log(obj, uni.getStorageSync("userInfo"))
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 10,
"topic":"message"
})})
if(uni.getStorageSync("userInfo").id == obj.sellerId){
console.log("toChat",uni.getStorageSync("userInfo").id , obj.userId)
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=2&id="+obj.userId
})
}
}else{
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 11,
"topic":"message"
})})
}
},
fail: () => {},
complete: () => {}
});
}
if(obj.type == 8){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: '温馨提示',
content: '来自'+obj.userNickname+"发起的语音匹配,是否同意",
cancelText: '拒绝',
confirmText: '同意',
success: res => {
if(res.confirm){
console.log(obj, uni.getStorageSync("userInfo"))
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 10,
"topic":"message"
})})
if(uni.getStorageSync("userInfo").id == obj.sellerId){
console.log("toChat",uni.getStorageSync("userInfo").id , obj.userId)
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=1&id="+obj.userId
})
}
}else{
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 11,
"topic":"message"
})})
}
},
fail: () => {},
complete: () => {}
});
}
if(obj.type == 10 || obj.type==11){
uni.$emit("jiantingTiaozhuan",obj)
}
}
}
}
});
})
uni.$on("duanYinship",obj=>{
uni.sendSocketMessage({data:JSON.stringify({
"userId": obj.userId,
"sellerId": obj.sellerId,
type: 12,
"topic":"message"
})})
})
uni.$on("jieshouYinship",obj=>{
uni.sendSocketMessage({data:JSON.stringify({
"userId": obj.userId,
"sellerId": obj.sellerId,
type: 20,
"topic":"message"
})})
})
uni.onSocketClose(function (res) {
clearInterval(timer)
uni.closeSocket();
uni.removeStorageSync("isOpen")
console.log('WebSocket 已关闭!');
setTimeout(()=>{
if(uni.getStorageSync("userInfo").id){
uni.$emit("openSocket")
}
},1000)
});
})
function xintiao() {
timer = setInterval(()=>{
uni.setStorageSync("isOpen",true)
uni.sendSocketMessage({data:JSON.stringify({"userId": uni.getStorageSync("userInfo").id,"topic":"heart_beat"})});
}, 30000)
}
setTimeout(()=>{
if(uni.getStorageSync("userInfo").id){
uni.$emit("openSocket")
}
},1000)
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({

@ -80,10 +80,6 @@
uni.$on("closeSharePopup",res=>{ uni.$on("closeSharePopup",res=>{
that.isPopup = false; that.isPopup = false;
}) })
if( uni.getStorageSync("isOpen") && uni.getStorageSync("userInfo").id){
this.watchSocket();
}
}, },
onShow() { onShow() {
this.getUserInfo(); this.getUserInfo();
@ -101,48 +97,7 @@
} }
}, },
methods: { methods: {
watchSocket() {
uni.onSocketMessage(function (res) {
const obj = res.data?JSON.parse(res.data):{}
if(obj.topic == 'message'){
if(obj.type <=7){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.userMsgVoice == 1){
console.log(222)
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
console.log(2233)
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: "温馨提示",
content: "来自"+obj.userNickname+(obj.type==1?"语音":obj.type==2?"视频":obj.type==3?"文字":obj.type==4?"图片":obj.type==5?"礼物":"搭讪")+"消息,请立即处理!",
confirmText: "立即查看",
success(data) {
if(data.confirm){
uni.switchTab({
url: "/pages/xiaoxi/index"
})
}else{
// uni.sendSocketMessage({
// data: JSON.stringify({event: 3, "room_id": obj.room_id, "to_id": obj.from_user_data.fromUserId,'from_id':0})
// });
}
}
})
}
}else{
console.log("挂断了")
}
}
});
},
previewImage(index,i){ previewImage(index,i){
uni.previewImage({ uni.previewImage({
urls: this.dongtaiList[index].imgurl, urls: this.dongtaiList[index].imgurl,
@ -171,7 +126,6 @@
if(type == 1){ if(type == 1){
uni.hideLoading(); uni.hideLoading();
} }
console.log(data.total)
if(data.totalCount > 0){ if(data.totalCount > 0){
data.list.map(a=>{ data.list.map(a=>{
if(a.imgurl){ if(a.imgurl){

@ -109,7 +109,6 @@
const that = this; const that = this;
if(uni.getStorageSync("userInfo").id){ if(uni.getStorageSync("userInfo").id){
uni.$emit("openSocket"); uni.$emit("openSocket");
that.watchSocket();
} }
setTimeout(()=>{ setTimeout(()=>{
if(that.current == 0){ if(that.current == 0){
@ -187,17 +186,7 @@
that.show=false that.show=false
} }
}) })
uni.$on("duanYinship",obj=>{ uni.$emit("watchSocket")
uni.sendSocketMessage({data:JSON.stringify({
"userId": obj.userId,
"sellerId": obj.sellerId,
type: 12,
"topic":"message"
})})
})
if(uni.getStorageSync("userInfo").id){
this.watchSocket();
}
}, },
onShow() { onShow() {
if(this.city){ if(this.city){
@ -228,129 +217,7 @@
} }
} }
}, },
methods: { methods: {
watchSocket() {
uni.onSocketMessage(function (res) {
const obj = res.data?JSON.parse(res.data):{}
if(obj.topic == 'message'){
if(obj.type <=7){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: "温馨提示",
content: "来自"+obj.userNickname+(obj.type==1?"语音":obj.type==2?"视频":obj.type==3?"文字":obj.type==4?"图片":obj.type==5?"礼物":"搭讪")+"消息,请立即处理!",
confirmText: "立即查看",
success(data) {
if(data.confirm){
uni.switchTab({
url: "/pages/xiaoxi/index"
})
}
}
})
}
}
if(obj.type>=8){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.type == 12){
uni.$emit("watchEvent",obj)
}
if(obj.type == 9){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: '温馨提示',
content: '来自'+obj.userNickname+"发起的视频匹配,是否同意",
cancelText: '拒绝',
confirmText: '同意',
success: res => {
if(res.confirm){
console.log(obj, uni.getStorageSync("userInfo"))
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 10,
"topic":"message"
})})
if(uni.getStorageSync("userInfo").id == obj.sellerId){
console.log("toChat",uni.getStorageSync("userInfo").id , obj.userId)
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=2&id="+obj.userId
})
}
}else{
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: obj.userId,
type: 11,
"topic":"message"
})})
}
},
fail: () => {},
complete: () => {}
});
}
if(obj.type == 8){
if(obj.userMsgVoice == 1){
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: '温馨提示',
content: '来自'+obj.userNickname+"发起的语音匹配,是否同意",
cancelText: '拒绝',
confirmText: '同意',
success: res => {
if(res.confirm){
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: data.id,
type: 10,
"topic":"message"
})})
}else{
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: data.id,
type: 11,
"topic":"message"
})})
}
},
fail: () => {},
complete: () => {}
});
}
}
}
}
});
},
// //
trackUpload(res){ trackUpload(res){
this.$api.trackUpload({ this.$api.trackUpload({
@ -484,77 +351,7 @@
} }
}, },
getLocation() { getLocation() {
const that = this; const that = this;
const res1={
"type": "gcj02",
"altitude": 0,
"latitude": 32.04097,
"longitude": 118.637902,
"speed": 0,
"accuracy": 38,
"errMsg": "getLocation:ok"
}
const res={
data: {
"status": "1",
"regeocode": {
"addressComponent": {
"city": "南京市",
"province": "江苏省",
"adcode": "320111",
"district": "浦口区",
"towncode": "320111004000",
"streetNumber": {
"number": "77号",
"location": "118.637348,32.040819",
"direction": "西",
"distance": "54.838",
"street": "团结路"
},
"country": "中国",
"township": "江浦街道",
"businessAreas": [
{
"location": "118.630698,32.063288",
"name": "江浦",
"id": "320111"
}
],
"building": {
"name": [],
"type": []
},
"neighborhood": {
"name": [],
"type": []
},
"citycode": "025"
},
"formatted_address": "江苏省南京市浦口区江浦街道星河时代5栋"
},
"info": "OK",
"infocode": "10000"
}
}
that.trackUpload(res1)
if(res.data.regeocode.addressComponent){
let city = res.data.regeocode.addressComponent.city.length==0?res.data.regeocode.addressComponent.province:res.data.regeocode.addressComponent.city
that.city = res.data.regeocode.formatted_address.split(res.data.regeocode.addressComponent.township)[1]
uni.setStorageSync("jingweiInfo",{...res1,...res.data.regeocode.addressComponent,formatted: that.city});
that.show = false
if(that.current == 0){
that.page1 = 1;
that.commentList1 = [];
that.customerRecommendList();
}else{
that.page2 = 1;
that.commentList2 = [];
that.nearbyCustomerList();
}
}
return ;
uni.getLocation({ uni.getLocation({
type: 'gcj02', type: 'gcj02',
isHighAccuracy: true, isHighAccuracy: true,

@ -123,9 +123,6 @@
that.show=false that.show=false
} }
}) })
if( uni.getStorageSync("isOpen") && uni.getStorageSync("userInfo").id){
this.watchSocket();
}
}, },
onReachBottom() { onReachBottom() {
const that = this; const that = this;
@ -138,48 +135,6 @@
}, 1000); }, 1000);
}, },
methods: { methods: {
watchSocket() {
uni.onSocketMessage(function (res) {
const obj = res.data?JSON.parse(res.data):{}
if(obj.topic == 'message'){
if(obj.type!=7){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.userMsgVoice == 1){
console.log(222)
uni.$emit("playAudio")
}
if(obj.userMsgShock == 1){
console.log(2233)
uni.vibrateLong({
complete: function (res) {
console.log('success',res);
}
});
}
uni.showModal({
title: "温馨提示",
content: "来自"+obj.userNickname+(obj.type==1?"语音":obj.type==2?"视频":obj.type==3?"文字":obj.type==4?"图片":obj.type==5?"礼物":"搭讪")+"消息,请立即处理!",
confirmText: "立即查看",
success(data) {
if(data.confirm){
uni.navigateTo({
url: "/pages/xiaoxi/index"
})
}else{
// uni.sendSocketMessage({
// data: JSON.stringify({event: 3, "room_id": obj.room_id, "to_id": obj.from_user_data.fromUserId,'from_id':0})
// });
}
}
})
}
}else{
console.log("挂断了")
}
}
});
},
// //
trackUpload(res){ trackUpload(res){
this.$api.trackUpload({ this.$api.trackUpload({

@ -23,13 +23,13 @@
<view class="dian-on" > <view class="dian-on" >
<view class="info"> <view class="info">
<image class="avatar" :src="userOtherInfo.faceImage?userOtherInfo.faceImage:userOtherInfo.img"></image> <image class="avatar" :src="userOtherInfo.faceImage?userOtherInfo.faceImage:userOtherInfo.img"></image>
<view class="name">{{userOtherInfo.nickname}}</view> <view class="name"><text class="t">{{userOtherInfo.nickname}}</text></view>
<view class="txt">{{userOtherInfo.age}}/{{userOtherInfo.height}}</view> <view class="txt"><text class="t">{{userOtherInfo.age}}/{{userOtherInfo.height}}</text></view>
</view> </view>
<view class="tag"> <view class="tag">
<view class="titles">个性签名:</view> <view class="titles"><text class="t">个性签名:</text></view>
<view class="descs"> <view class="descs">
<text>{{userOtherInfo.declaration}}</text> <text class="t">{{userOtherInfo.declaration}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -39,50 +39,111 @@
<view class="pic" @click="toggleYuyin()" v-if="isJieshou==true"> <view class="pic" @click="toggleYuyin()" v-if="isJieshou==true">
<image v-if="isYuyin" class="pimg" src="@/static/yuyin-01.png"></image> <image v-if="isYuyin" class="pimg" src="@/static/yuyin-01.png"></image>
<image v-else class="pimg" src="@/static/yuyin-01-on.png"></image> <image v-else class="pimg" src="@/static/yuyin-01-on.png"></image>
</view>
<view class="txt" v-if="isJieshou==true">
<text class="t">{{isYuyin?'开启':'关闭'}}</text>
</view> </view>
</view> </view>
<view class="item"> <view class="item" v-if="isJieshou">
<view class="pic"> <view class="pic">
<image v-if="isJieshou" @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> <image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image>
<image v-else class="pimg" @click="toJieshou()" src="@/static/yuyin-05.png"></image> </view>
<view class="txt">
<text class="t">挂断</text>
</view> </view>
</view> </view>
<template v-if="isJieshou == false">
<view class="item">
<view class="pic">
<image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image>
</view>
<view class="txt">
<text class="t">挂断</text>
</view>
</view>
<view class="item"></view>
<view class="item">
<view class="pic" v-if="isStart">
<image class="pimg" src="@/static/yuyin-05.png"></image>
</view>
<view class="pic" v-else>
<image class="pimg" @click="toJieshou1()" src="@/static/yuyin-05.png"></image>
</view>
<view class="txt">
<text class="t">{{isStart?'等待':'接受'}}</text>
</view>
</view>
</template>
<view class="item"> <view class="item">
<view class="pic" @click="toggleYangsheng()" v-if="isJieshou==true"> <view class="pic" @click="toggleYangsheng()" v-if="isJieshou==true">
<image class="pimg" v-if="isYangshengqi" src="@/static/yuyin-03.png"></image> <image class="pimg" v-if="isYangshengqi" src="@/static/yuyin-03.png"></image>
<image class="pimg" v-else src="@/static/yuyin-03-on.png"></image> <image class="pimg" v-else src="@/static/yuyin-03-on.png"></image>
</view>
<view class="txt" v-if="isJieshou==true">
<text class="t">{{isYangshengqi?'开启':'关闭'}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="room-fd" v-if="type==2 || type==4" :style="{'width': winWidth+'px'}" > <view class="room-fd" v-if="type==2 || type==4" :style="{'width': winWidth+'px'}" >
<view class="item"> <view class="item" v-if="isJieshou">
<view class="pic" @click="toggleYuyin()" v-if="isJieshou==true"> <view class="pic" @click="toggleYuyin()" v-if="isJieshou==true">
<image v-if="isYuyin" class="pimg" src="@/static/yuyin-01.png"></image> <image v-if="isYuyin" class="pimg" src="@/static/yuyin-01.png"></image>
<image v-else class="pimg" src="@/static/yuyin-01-on.png"></image> <image v-else class="pimg" src="@/static/yuyin-01-on.png"></image>
</view>
<view class="txt">
<text class="t">{{isYuyin?'开启':'关闭'}}</text>
</view> </view>
</view> </view>
<view class="item"> <view class="item" v-if="isJieshou">
<view class="pic" @click="toggleYangsheng()"> <view class="pic" @click="toggleYangsheng()">
<image class="pimg" v-if="isYangshengqi" src="@/static/yuyin-03.png"></image> <image class="pimg" v-if="isYangshengqi" src="@/static/yuyin-03.png"></image>
<image class="pimg" v-else src="@/static/yuyin-03-on.png"></image> <image class="pimg" v-else src="@/static/yuyin-03-on.png"></image>
</view>
<view class="txt">
<text class="t">{{isYangshengqi?'开启':'关闭'}}</text>
</view> </view>
</view> </view>
<view class="item"> <view class="item" v-if="isJieshou">
<view class="pic" @click="toggleShexiang()" v-if="isJieshou==true"> <view class="pic" @click="toggleShexiang()" v-if="isJieshou==true">
<image class="pimg" v-if="isShexiang" src="@/static/yuyin-04.png"></image> <image class="pimg" v-if="isShexiang" src="@/static/yuyin-04.png"></image>
<image class="pimg" v-else src="@/static/yuyin-04-on.png"></image> <image class="pimg" v-else src="@/static/yuyin-04-on.png"></image>
</view>
<view class="txt">
<text class="t">{{isShexiang?'开启':'关闭'}}</text>
</view> </view>
</view> </view>
</view> <template v-if="isJieshou == false">
<view class="room-fd1" v-if="type==2 || type==4" :style="{'width': winWidth+'px'}" > <view class="item">
<view class="items"> <view class="pic">
<view class="pic"> <image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image>
<image v-if="isJieshou" @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> </view>
<image v-else class="pimg" @click="toJieshou()" src="@/static/yuyin-05.png"></image> <view class="txt">
</view> <text class="t">挂断</text>
<image class="off" @click="toggleHuamian()" src="@/static/yuyin-off.png"></image> </view>
</view> </view>
</view> <view class="item">
<view class="pic" v-if="isStart">
<image class="pimg" src="@/static/yuyin-05.png"></image>
</view>
<view class="pic" v-else>
<image class="pimg" @click="toJieshou1()" src="@/static/yuyin-05.png"></image>
</view>
<view class="txt">
<text class="t">{{isStart?'等待':'接受'}}</text>
</view>
</view>
</template>
</view>
<template v-if="isJieshou">
<view class="room-fd1" v-if="type==2 || type==4" :style="{'width': winWidth+'px'}" >
<view class="items">
<view class="pic">
<image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image>
</view>
<image class="off" @click="toggleHuamian()" src="@/static/yuyin-off.png"></image>
</view>
</view>
</template>
</view> </view>
</template> </template>
@ -134,13 +195,16 @@
statusBarHeight: 0, statusBarHeight: 0,
sellerStreamId: "", sellerStreamId: "",
viewModeIndex: 0, viewModeIndex: 0,
isCamera: true isCamera: true,
isStart: true,
} }
}, },
onLoad(o) { onLoad(o) {
console.log(o)
this.id = o.id; this.id = o.id;
this.type=o.type; this.type=o.type;
this.title = (this.type == 1||this.type == 3)?"语音通话":"视频通话", this.title = (this.type == 1||this.type == 3)?"语音通话":"视频通话";
this.isStart = (this.type == 3||this.type == 4)?(o.fid?false:true):true
this.isShexiang = (this.type == 2 || this.type == 4)?true:false this.isShexiang = (this.type == 2 || this.type == 4)?true:false
this.isJieshou = o.type<=2?true:false; this.isJieshou = o.type<=2?true:false;
this.winWidth = uni.getSystemInfoSync().windowWidth; this.winWidth = uni.getSystemInfoSync().windowWidth;
@ -149,16 +213,25 @@
}, },
async onReady() { async onReady() {
const that = this; const that = this;
uni.onSocketMessage(function (res) { uni.$on("watchEvent",function (obj) {
const obj = res.data?JSON.parse(res.data):{};
console.log(obj)
if(obj.topic == 'message'){ if(obj.topic == 'message'){
if(obj.type == 12){ if(obj.type == 12){
if(uni.getStorageSync("userInfo").id == obj.sellerId){ if(uni.getStorageSync("userInfo").id == obj.sellerId){
that.toGuaduan(1) that.toGuaduan(1)
} }
} }
} }
})
uni.$on("toJieshouYinship",(obj)=>{
console.log("toJieshouYinship",obj)
if(obj.topic == 'message'){
if(obj.type == 20){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
that.toJieshou();
}
}
}
}) })
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform === "android") { if (uni.getSystemInfoSync().platform === "android") {
@ -167,20 +240,40 @@
); );
const res1 = await permision.requestAndroidPermission( const res1 = await permision.requestAndroidPermission(
"android.permission.CAMERA" "android.permission.CAMERA"
); );
if(res == 1 && res1 == 1){
if(this.type <= 2){
this.toPermission();
this.getOtherUserInfo()
}else{
this.getOtherUserInfo()
this.getUserInfo(1);
}
}
return ; return ;
} }
// #endif // #endif
if(this.type==3){
this.getOtherUserInfo();
}
if(this.type <= 2){ if(this.type <= 2){
this.toPermission(); this.toPermission();
this.getOtherUserInfo();
}else{ }else{
// this.getUserInfo(1); this.getOtherUserInfo();
this.getUserInfo(1);
} }
}, },
methods: { methods: {
toJieshou1() {
uni.$emit("jieshouYinship",{
"userId": uni.getStorageSync("userInfo").id,
sellerId: this.id,
type: 20,
"topic":"message",
})
if(this.isStart == false){
this.toJieshou();
}
},
onBack() { onBack() {
const that = this; const that = this;
uni.showModal({ uni.showModal({
@ -205,7 +298,8 @@
}) })
} }
this.socialConsumption(); this.socialConsumption();
clearInterval(timer) clearInterval(timer)
uni.$emit("watchSocket")
this.isGuaduan = false this.isGuaduan = false
/** 停止推流 */ /** 停止推流 */
this.engine?.stopPublishingStream(); this.engine?.stopPublishingStream();
@ -222,7 +316,8 @@
}) })
}, },
toJieshou() { toJieshou() {
this.toPermission(); this.toPermission();
this.$forceUpdate();
}, },
toggleYuyin() { toggleYuyin() {
this.isYuyin = !this.isYuyin; this.isYuyin = !this.isYuyin;
@ -233,14 +328,17 @@
this.engine.enableCamera(this.isShexiang) this.engine.enableCamera(this.isShexiang)
}, },
toggleHuamian() { toggleHuamian() {
this.isCamera = ! this.isCamera this.isCamera = !this.isCamera
this.engine.useFrontCamera(this.isCamera) this.engine.useFrontCamera(this.isCamera)
}, },
toggleYangsheng() { toggleYangsheng() {
this.isYangshengqi = ! this.isYangshengqi this.isYangshengqi = ! this.isYangshengqi
this.engine.setAudioRouteToSpeaker(this.isCamera) this.engine.setAudioRouteToSpeaker(this.isCamera)
}, },
async toPermission() { async toPermission() {
if(this.type ==3 || this.type==1){
this.getOtherUserInfo();
}
this.getUserInfo(); this.getUserInfo();
}, },
//查询个人信息 //查询个人信息
@ -263,8 +361,9 @@
}, },
//查询taren个人信息 //查询taren个人信息
async getOtherUserInfo(type) { async getOtherUserInfo(type) {
const { code, data , msg } = await this.$api.findOtherUserInfo({userId: uni.getStorageSync("userInfo").id,sellerId: this.id,}); const { code, data , msg } = await api.findOtherUserInfo({userId: uni.getStorageSync("userInfo").id,sellerId: this.id,});
if(code == 200){ if(code == 200){
console.log("getOtherUserInfo",data)
this.userOtherInfo = data; this.userOtherInfo = data;
}else{ }else{
uni.showToast({ uni.showToast({
@ -475,11 +574,10 @@
display: block; display: block;
} }
.dian-on{ .dian-on{
width: 648rpx; width: 650rpx;
min-height: 648rpx; min-height: 648rpx;
position: absolute; position: absolute;
left: 50%; margin-left: 50rpx;
margin-left: -324rpx;
top: 250rpx; top: 250rpx;
z-index: 1; z-index: 1;
.tag{ .tag{
@ -493,21 +591,29 @@
text-align: left; text-align: left;
margin-top: 30rpx; margin-top: 30rpx;
.titles{ .titles{
font-weight: bold; .t{
font-size: 30rpx; font-weight: bold;
color: #FFFFFF; font-size: 30rpx;
color: #FFFFFF;
}
} }
.descs{ .descs{
line-height: 45rpx;
font-weight: 400;
font-size: 24rpx;
color: #B8B7BC;
margin-top: 20rpx; margin-top: 20rpx;
.t{
font-size: 24rpx;
color: #B8B7BC;
line-height: 45rpx;
font-weight: 400;
}
} }
} }
.info{ .info{
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.avatar{ .avatar{
width: 180rpx; width: 180rpx;
height: 180rpx; height: 180rpx;
@ -517,33 +623,42 @@
} }
.name{ .name{
font-weight: 500; font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
margin-top: 10rpx; margin-top: 10rpx;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
text-align: center; text-align: center;
text-align: center;
margin-top: 10rpx; margin-top: 10rpx;
.t{
font-size: 28rpx;
color: #FFFFFF;
}
} }
.btn{ .btn{
width: 170rpx; width: 170rpx;
line-height: 56rpx; line-height: 56rpx;
background: linear-gradient(0deg, #FF9124, #BD4700); background: linear-gradient(0deg, #FF9124, #BD4700);
border-radius: 56rpx; border-radius: 56rpx;
font-weight: bold;
font-size: 30rpx;
color: #FFFFFF;
margin: 0 auto; margin: 0 auto;
margin-top: 20rpx; margin-top: 20rpx;
.t{
font-weight: bold;
font-size: 30rpx;
color: #FFFFFF;
}
} }
.txt{ .txt{
font-weight: 500;
font-size: 26rpx;
color: #FFFFFF;
margin-top: 20rpx; margin-top: 20rpx;
opacity: 0.3; opacity: 0.3;
.t{
font-weight: 500;
font-size: 26rpx;
color: #FFFFFF;
}
} }
} }
} }
@ -552,7 +667,7 @@
height: 220rpx; height: 220rpx;
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 180rpx; bottom: 200rpx;
z-index: 44; z-index: 44;
flex-direction: row; flex-direction: row;
.item{ .item{
@ -565,7 +680,7 @@
align-items: center; align-items: center;
.txt{ .txt{
margin-top: 20rpx; margin-top: 20rpx;
text{ .t{
font-size: 30rpx; font-size: 30rpx;
color: #ffffff; color: #ffffff;
} }

@ -109,8 +109,7 @@
methods: { methods: {
watchSocket() { watchSocket() {
const that = this; const that = this;
uni.onSocketMessage(function (res) { uni.$on("jiantingTiaozhuan",function (obj) {
const obj = res.data?JSON.parse(res.data):{}
console.log("watchSocket",obj) console.log("watchSocket",obj)
if(obj.topic == 'message'){ if(obj.topic == 'message'){
if(obj.type>= 8){ if(obj.type>= 8){
@ -123,6 +122,7 @@
} }
} }
} }
} }
}); });
}, },
@ -156,7 +156,7 @@
// //
async toChat(id) { async toChat(id) {
console.log("toChat",uni.getStorageSync("userInfo").id , id) console.log("toChat",uni.getStorageSync("userInfo").id , id)
uni.redirectTo({ uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=2&id="+id url: "/pages/pipei/shipin/detail?type=2&id="+id
}) })
}, },

@ -109,8 +109,7 @@
methods: { methods: {
watchSocket() { watchSocket() {
const that = this; const that = this;
uni.onSocketMessage(function (res) { uni.$on("jiantingTiaozhuan",function (obj) {
const obj = res.data?JSON.parse(res.data):{}
console.log("watchSocket",obj) console.log("watchSocket",obj)
if(obj.topic == 'message'){ if(obj.topic == 'message'){
if(obj.type>= 8){ if(obj.type>= 8){
@ -123,6 +122,7 @@
} }
} }
} }
} }
}); });
}, },
@ -156,7 +156,7 @@
// //
async toChat(id) { async toChat(id) {
console.log("toChat",uni.getStorageSync("userInfo").id , id) console.log("toChat",uni.getStorageSync("userInfo").id , id)
uni.redirectTo({ uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=1&id="+id url: "/pages/pipei/shipin/detail?type=1&id="+id
}) })
}, },
@ -174,7 +174,7 @@
uni.sendSocketMessage({data:JSON.stringify({ uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id, "userId": uni.getStorageSync("userInfo").id,
sellerId: data.id, sellerId: data.id,
type: 9, type: 8,
"topic":"message" "topic":"message"
})}) })})
}else{ }else{

@ -219,44 +219,44 @@
}, },
methods: { methods: {
watchSocket() { watchSocket() {
uni.onSocketMessage(function (res) { // uni.onSocketMessage(function (res) {
const obj = res.data?JSON.parse(res.data):{} // const obj = res.data?JSON.parse(res.data):{}
if(obj.topic == 'message'){ // if(obj.topic == 'message'){
if(obj.type <= 7){ // if(obj.type <= 7){
if(uni.getStorageSync("userInfo").id == obj.sellerId){ // if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.userMsgVoice == 1){ // if(obj.userMsgVoice == 1){
console.log(222) // console.log(222)
uni.$emit("playAudio") // uni.$emit("playAudio")
} // }
if(obj.userMsgShock == 1){ // if(obj.userMsgShock == 1){
console.log(2233) // console.log(2233)
uni.vibrateLong({ // uni.vibrateLong({
complete: function (res) { // complete: function (res) {
console.log('success',res); // console.log('success',res);
} // }
}); // });
} // }
uni.showModal({ // uni.showModal({
title: "温馨提示", // title: "",
content: "来自"+obj.userNickname+(obj.type==1?"语音":obj.type==2?"视频":obj.type==3?"文字":obj.type==4?"图片":obj.type==5?"礼物":"搭讪")+"消息,请立即处理!", // content: ""+obj.userNickname+(obj.type==1?"":obj.type==2?"":obj.type==3?"":obj.type==4?"":obj.type==5?"":"")+"",
confirmText: "立即查看", // confirmText: "",
success(data) { // success(data) {
if(data.confirm){ // if(data.confirm){
uni.navigateTo({ // uni.navigateTo({
url: "/pages/xiaoxi/index" // url: "/pages/xiaoxi/index"
}) // })
}else{ // }else{
// uni.sendSocketMessage({ // // uni.sendSocketMessage({
// data: JSON.stringify({event: 3, "room_id": obj.room_id, "to_id": obj.from_user_data.fromUserId,'from_id':0}) // // data: JSON.stringify({event: 3, "room_id": obj.room_id, "to_id": obj.from_user_data.fromUserId,'from_id':0})
// }); // // });
} // }
} // }
}) // })
} // }
} // }
} // }
}); // });
}, },
toCancle() { toCancle() {
this.show = false; this.show = false;

@ -192,7 +192,13 @@
uni.onSocketMessage(function (res) { uni.onSocketMessage(function (res) {
const obj = res.data?JSON.parse(res.data):{} const obj = res.data?JSON.parse(res.data):{}
if(obj.topic == 'message'){ if(obj.topic == 'message'){
console.log(obj) console.log(obj)
if(obj.type == 12){
uni.$emit("watchEvent",obj)
}
if(obj.type == 20){
uni.$emit("toJieshouYinship",obj)
}
if(obj.type<=7){ if(obj.type<=7){
if(uni.getStorageSync("userInfo").id == obj.sellerId){ if(uni.getStorageSync("userInfo").id == obj.sellerId){
that.page = 1; that.page = 1;
@ -693,7 +699,15 @@
title: "语音/视频通话", title: "语音/视频通话",
itemList: ["语音通话("+data.voiceCoins+"金币/1分钟)","视频通话("+data.videoCoins+"金币/1分钟)"], itemList: ["语音通话("+data.voiceCoins+"金币/1分钟)","视频通话("+data.videoCoins+"金币/1分钟)"],
success(res){ success(res){
if(res.tapIndex == 0){ if(res.tapIndex == 0){
if(that.userInfo.isOnline == 0){
uni.showToast({
title: "当前用户已离线",
position: "bottom",
icon: "none",
})
return ;
}
if(that.userInfo.isBlack == 1){ if(that.userInfo.isBlack == 1){
uni.showToast({ uni.showToast({
title: "当前用户是黑名单,已限制", title: "当前用户是黑名单,已限制",
@ -708,10 +722,25 @@
return ; return ;
} }
} }
uni.redirectTo({ that.isToggle = false;
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: that.id,
type: 18,
"topic":"message"
})})
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=3&id="+that.id url: "/pages/pipei/shipin/detail?type=3&id="+that.id
}) })
}else if(res.tapIndex == 1){ }else if(res.tapIndex == 1){
if(that.userInfo.isOnline == 0){
uni.showToast({
title: "当前用户已离线",
position: "bottom",
icon: "none",
})
return ;
}
if(that.userInfo.isBlack == 1){ if(that.userInfo.isBlack == 1){
uni.showToast({ uni.showToast({
title: "当前用户是黑名单,已限制", title: "当前用户是黑名单,已限制",
@ -725,8 +754,15 @@
that.isCoins=true; that.isCoins=true;
return ; return ;
} }
} }
uni.redirectTo({ that.isToggle = false;
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: that.id,
type: 19,
"topic":"message"
})})
uni.navigateTo({
url: "/pages/pipei/shipin/detail?type=4&id="+that.id url: "/pages/pipei/shipin/detail?type=4&id="+that.id
}) })
} }

@ -47,16 +47,20 @@
<view class="list"> <view class="list">
<view class="item" v-for="(a,i) in recordList" :key="i"> <view class="item" v-for="(a,i) in recordList" :key="i">
<view class="a"> <view class="a">
<view class="fl">{{a.title}} <view class="fl">
<view class="status">审核中</view> <view class="names">
<view class="status-01">已拒绝</view> {{a.title}}
<view class="status-02">已打款</view> <template v-if="a.type == 5">
<view class="txt">{{a.status==1?'-':'+'}}<text>{{a.coins}}</text>{{a.danwei==1?'金币':'元'}}</view> <view class="status" v-if="a.withdrawalStatus == 1">审核中</view>
<view class="status-01" v-if="a.withdrawalStatus == 3">已拒绝</view>
<view class="status-02" v-if="a.withdrawalStatus == 2">已打款</view></template>
</view>
<view class="txt">{{a.status==2?'-':'+'}}<text>{{a.type != 5?a.coins:a.totalmoney}}</text>{{a.danwei==1?'金币':'元'}}</view>
</view> </view>
<view class="fr" > <view class="fr" >
{{a.createTime}}<text>退款</text><view class="tui" v-if="a.type==5">{{a.remark}}</view> {{a.createTime}}<!-- <text v-if="a.type==5">退款</text> --><view class="tui" v-if="a.type==5">{{a.remark}}</view>
</view> </view>
<view class="err" v-if="a.refuseReason">拒绝原因{{a.refuseReason}}</view> <view class="err" v-if="a.withdrawalStatus == 3">拒绝原因{{a.refuseReason}}</view>
</view> </view>
</view> </view>
<view class="empty" v-if="total == 0 "> <view class="empty" v-if="total == 0 ">
@ -144,7 +148,7 @@
uni.hideLoading(); uni.hideLoading();
} }
if(code == 200){ if(code == 200){
this.total = data.total; this.total = data.totalCount;
this.recordList = this.arrayUnique([...this.recordList,...data.list],'id'); this.recordList = this.arrayUnique([...this.recordList,...data.list],'id');
} }
}, },
@ -345,6 +349,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
flex: 1;
.names{
display: flex;
align-items: center;
}
.status{ .status{
width: 80rpx; width: 80rpx;
line-height: 36rpx; line-height: 36rpx;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save