代码提交

main
123456 4 weeks ago
parent 0959890a5f
commit fcebd33047
  1. 138
      App.vue
  2. 208
      main.js
  3. 46
      pages/dongtai/index.vue
  4. 205
      pages/index/index.vue
  5. 45
      pages/peiwan/index.vue
  6. 187
      pages/pipei/shipin/detail.nvue
  7. 6
      pages/pipei/shipin/index.vue
  8. 8
      pages/pipei/yuyin/index.vue
  9. 72
      pages/user/index.vue
  10. 40
      pages/users/chat/index.vue
  11. 25
      pages/users/wallet/index.vue
  12. 1
      unpackage/debug/.roid.ins
  13. 5049
      unpackage/dist/dev/app-plus/app-service.js
  14. 8504
      unpackage/dist/dev/app-plus/app-view.js
  15. 880
      unpackage/dist/dev/app-plus/pages/pipei/shipin/detail.js

@ -1,144 +1,6 @@
<script>
export default {
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() {

@ -16,17 +16,215 @@ Vue.component('share', share)
Vue.component('dashan', dashan)
Vue.config.productionTip = false
import api from '@/api/index.js'
Vue.prototype.$api = api
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="
const bgAudioManager = uni.getBackgroundAudioManager();
let bgAudioManager = uni.getBackgroundAudioManager();
uni.$on("playAudio",res=>{
bgAudioManager.src = 'https://api.lyiyuan.cn/profile/upload/static/tishiyin.mp3';
bgAudioManager.play();
bgAudioManager = null
})
import api from '@/api/index.js'
Vue.prototype.$api = api
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="
//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'
const app = new Vue({

@ -80,10 +80,6 @@
uni.$on("closeSharePopup",res=>{
that.isPopup = false;
})
if( uni.getStorageSync("isOpen") && uni.getStorageSync("userInfo").id){
this.watchSocket();
}
},
onShow() {
this.getUserInfo();
@ -101,48 +97,7 @@
}
},
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){
uni.previewImage({
urls: this.dongtaiList[index].imgurl,
@ -171,7 +126,6 @@
if(type == 1){
uni.hideLoading();
}
console.log(data.total)
if(data.totalCount > 0){
data.list.map(a=>{
if(a.imgurl){

@ -109,7 +109,6 @@
const that = this;
if(uni.getStorageSync("userInfo").id){
uni.$emit("openSocket");
that.watchSocket();
}
setTimeout(()=>{
if(that.current == 0){
@ -187,17 +186,7 @@
that.show=false
}
})
uni.$on("duanYinship",obj=>{
uni.sendSocketMessage({data:JSON.stringify({
"userId": obj.userId,
"sellerId": obj.sellerId,
type: 12,
"topic":"message"
})})
})
if(uni.getStorageSync("userInfo").id){
this.watchSocket();
}
uni.$emit("watchSocket")
},
onShow() {
if(this.city){
@ -229,128 +218,6 @@
}
},
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){
this.$api.trackUpload({
@ -485,76 +352,6 @@
},
getLocation() {
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({
type: 'gcj02',
isHighAccuracy: true,

@ -123,9 +123,6 @@
that.show=false
}
})
if( uni.getStorageSync("isOpen") && uni.getStorageSync("userInfo").id){
this.watchSocket();
}
},
onReachBottom() {
const that = this;
@ -138,48 +135,6 @@
}, 1000);
},
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){
this.$api.trackUpload({

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

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

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

@ -219,44 +219,44 @@
},
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})
// 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})
// // });
// }
// }
// })
}
}
}
});
// }
// }
// }
// });
},
toCancle() {
this.show = false;

@ -193,6 +193,12 @@
const obj = res.data?JSON.parse(res.data):{}
if(obj.topic == 'message'){
console.log(obj)
if(obj.type == 12){
uni.$emit("watchEvent",obj)
}
if(obj.type == 20){
uni.$emit("toJieshouYinship",obj)
}
if(obj.type<=7){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
that.page = 1;
@ -694,6 +700,14 @@
itemList: ["语音通话("+data.voiceCoins+"金币/1分钟)","视频通话("+data.videoCoins+"金币/1分钟)"],
success(res){
if(res.tapIndex == 0){
if(that.userInfo.isOnline == 0){
uni.showToast({
title: "当前用户已离线",
position: "bottom",
icon: "none",
})
return ;
}
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
@ -708,10 +722,25 @@
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
})
}else if(res.tapIndex == 1){
if(that.userInfo.isOnline == 0){
uni.showToast({
title: "当前用户已离线",
position: "bottom",
icon: "none",
})
return ;
}
if(that.userInfo.isBlack == 1){
uni.showToast({
title: "当前用户是黑名单,已限制",
@ -726,7 +755,14 @@
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
})
}

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