Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into zmr

This commit is contained in:
zmr900709 2020-08-18 21:03:39 +08:00
commit 97c95c2024
33 changed files with 406 additions and 209 deletions

View File

@ -26,6 +26,12 @@
plus.navigator.closeSplashscreen();
},3000)
// #endif
},
onShow(){
},
onHide(){
},
methods: {
...mapMutations(['loginIn']),

View File

@ -353,6 +353,12 @@ export default {
code: code,
});
},
// 获取可送洗商品
getSendOrderList({ page }) {
return vm.$u.post('member/getSendOrderList', {
page: page,
});
},
// 送洗列表-平台订单 实体店订单
sendLaundryOrderList({ type, page }) {
return vm.$u.post('member/sendLaundryOrderList', {

View File

@ -2,7 +2,7 @@ var md5 = require("../static/js/md5.min.js")
const install = (Vue, vm) => {
// 此为自定义配置参数,具体参数见上方说明
Vue.prototype.$u.http.setConfig({
baseUrl: 'https://dmmall.sdbairui.com/api',
baseUrl: 'https://mall.dmygkeji.com/api',
loadingText: '努力加载中~',
loadingTime: 800,
originalData: true

View File

@ -1,9 +1,12 @@
<template>
<view class="video-item" v-if="item" @click="toDetailsPage(item.article_id,item.video_path)">
<image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
<view class="header_fist" v-else>
<view class="backes"></view>
<image class="head" :src="item.article_pic" ></image>
<view class="header_fist" v-else>
<view class="backes">
<u-icon name="play-circle-fill" color="#ffffff" size="20"></u-icon>
<text>视频</text>
</view>
<image class="head" :src="item.article_pic"></image>
</view>
<view class="title" v-if="">{{ item.article_title }}</view>
<view class="jianjie">{{ item.article_content }}</view>
@ -172,11 +175,22 @@
.header_fist{
position: relative;
.backes{
z-index: 99;
position: absolute;
top: 0;
width: 100%;
height: 100%;
color: #fff;
display: flex;
align-items: center;
justify-content: space-around;
top: 10rpx;
left: 10rpx;
width: 80rpx;
height: 30rpx;
padding: 0 10rpx;
border-radius: 30rpx;
background-color: rgba(0,0,0,0.5);
& > text {
color: #fff;
font-size: 18rpx;
}
}
}

View File

@ -63,7 +63,7 @@ export default {
.price{
display: flex;
// align-items: center;
align-content: flex-end;
// align-content: flex-end;
justify-content: space-between;
margin-top: 10rpx;
> view:first-child{
@ -75,6 +75,8 @@ export default {
font-size: 22rpx;
height: 22rpx;
color: #FDD360;
text-align: end;
margin-top:8rpx;
}
}
}

View File

@ -2,7 +2,6 @@
<view class="list">
<view class="top">商品推荐</view>
<view>
<!-- <u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="26" :show-bar="false" @change="tabsChange" height="60"></u-tabs-swiper> -->
<u-tabs :list="classifyList" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="60" font-size="24" inactive-color="#333333"></u-tabs>
</view>
<swiper class="swiper-box" :current="swiperCurrent" @animationfinish="animationfinish" :style="{height: swiperHeight}">
@ -49,7 +48,7 @@ export default {
this.getGoodsClassRecommend();
},
methods: {
loadMore(page) {
loadMore() {
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
@ -85,8 +84,6 @@ export default {
page: page,
gc_id: gc_id,
})
console.log(res)
// this.swiperCurrent = this.current;
if (res.errCode == 0) {
this.timer = true;

View File

@ -10,7 +10,7 @@
<view class="connect">
<view class="user">
<view class="avatar">
<image :src="info.member_avatar[0]"></image>
<image src="/static/image/common/32.png"></image>
<image src="/static/image/common/31.png"></image>
</view>
<view class="num">{{ info.pintuan_limit_number }}人团</view>

View File

@ -1,26 +1,26 @@
<template>
<view class="special">
<view v-if="type == 'spike'">
<image :src="item.groupbuy_image1" @click="spikeGoods"></image>
<view v-if="type == 'spike'" @click="spikeGoods">
<image :src="item.groupbuy_image1"></image>
<view class="right">
<view class="name u-line-1" @click="spikeGoods">{{ item.goods_name }}</view>
<view class="name u-line-1">{{ item.goods_name }}</view>
<view class="price">
<view class="groupbuy-price">{{ item.groupbuy_price }}</view>
<view class="goods-price">{{ item.goods_price }}</view>
</view>
<view class="buy">
<view class="num">剩余{{ item.inventory }}</view>
<view class="btn" @click="spikeGoods">立即购买</view>
<view class="btn">立即购买</view>
</view>
</view>
</view>
<view v-if="type == 'group'">
<image :src="item.pintuan_image" @click="toDetailsPage"></image>
<view v-if="type == 'group'" @click="toDetailsPage">
<image :src="item.pintuan_image"></image>
<view class="right">
<view class="name u-line-1" @click="toDetailsPage">{{ item.pintuan_goods_name }}</view>
<view class="name u-line-1">{{ item.pintuan_goods_name }}</view>
<view class="price group">
<view class="groupbuy-price">{{ item.pintuan_goods_price }}</view>
<view class="btn" @click="toDetailsPage">立即拼团</view>
<view class="btn">立即拼团</view>
</view>
</view>
</view>

View File

@ -61,6 +61,7 @@
</view>
</template>
<script>
import IMService from '@/static/imservice.js'
import identifying from '@/components/logininput/identifying'
import {
mapMutations
@ -107,6 +108,8 @@
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
this.temp_url = prePage.route;
console.log(this.imService.lianjie)
this.imService.disconnect()
// console.log(this.temp_url);
},
//
@ -181,6 +184,7 @@
me.loginIn(res.data.token); //
//
uni.setStorageSync('user_info',res.data);
this.imService.disconnect()
if (res.data.member.has_labels) {
uni.switchTab({
url: '/pages/index/index'
@ -233,11 +237,11 @@
console.log(res.data.member.member_mobilebind);
if(res.data.member.member_mobilebind) {
uni.switchTab({
url: "/pages/index/index"
url: "/pages/index/index"
});
} else {
uni.navigateTo({
url: '/pageA/bindinges/bindinges'
url: '/pageA/bindinges/bindinges'
});
}
}
@ -271,11 +275,11 @@
console.log(res.data.member.member_mobilebind);
if(res.data.member.member_mobilebind) {
uni.switchTab({
url: "/pages/index/index"
url: "/pages/index/index"
});
} else {
uni.navigateTo({
url: '/pageA/bindinges/bindinges'
url: '/pageA/bindinges/bindinges'
});
}
}

View File

@ -82,6 +82,7 @@
margin-top: 10rpx;
font-size: 28rpx;
color: #fff;
text-shadow: 0px 0px 4rpx #999999;
}
.operat-img {
@ -134,7 +135,7 @@
//
following(id) {
uni.request({
url: "https://dmmall.sdbairui.com/api/member/attentionMember",
url: "https://mall.dmygkeji.com/api/member/attentionMember",
method: "POST",
data: {
member_id: id
@ -163,7 +164,7 @@
likeType(id) {
// console.log(id);
uni.request({
url: "https://dmmall.sdbairui.com/api/article/articleLike",
url: "https://mall.dmygkeji.com/api/article/articleLike",
method: "POST",
data: {
article_id: id
@ -194,7 +195,7 @@
//
collecting(id) {
uni.request({
url: "https://dmmall.sdbairui.com/api/article/articleCollect",
url: "https://mall.dmygkeji.com/api/article/articleCollect",
method: "POST",
data: {
article_id: id

View File

@ -169,6 +169,7 @@
}
}
.userinfo{
z-index: 9999;
position: absolute;
right: 30rpx;
top: 50%;

View File

@ -29,6 +29,7 @@
</view>
<view class="pic" v-else-if="type == 1">
<text>{{ goodsInfo.goods_price || '0.00' }}</text>
<s>{{ goodsInfo.goods_marketprice || '0.00' }}</s>
</view>
<view class="collect" @click="switchCollect(goodsInfo.is_collect)">
<u-icon name="star-fill" color="#FF7807" size="28" v-if="goodsInfo.is_collect == 1"></u-icon>

View File

@ -133,7 +133,7 @@
<script>
import userinfo from "../components/userinfo/index" // 点赞组件
const temp_url = "https://dmmall.sdbairui.com/api/";
const temp_url = "https://mall.dmygkeji.com/api/";
export default {
components: {
userinfo

View File

@ -14,7 +14,7 @@
</view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view">
<goodsItem :info="goods"></goodsItem>
</view>
</view>
@ -128,12 +128,6 @@ export default {
this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * 90 + 'px';
// console.log(this.scrollHeight);
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
id: id,
type: 1 // 1 2 3 4
});
},
setTitle(title){
uni.setNavigationBarTitle({
title: title

View File

@ -23,7 +23,7 @@
</view>
</template>
<script>
import SpecialGoods from "../../components/shop/special-shop/index"
import SpecialGoods from "@/components/shop/special-shop/index"
export default {
data() {
return {

View File

@ -55,7 +55,7 @@
};
</script>
<style lang="scss" scoped>
<style lang="scss">
page {
background-color: #ECECEC;
}

View File

@ -1,24 +1,6 @@
<template>
<view>
<view class="header" v-if="type == 2">
<image src="../../pageD/images/file.png" class="tit-img" mode=""></image>
<view class="title">德铭阳光</view>
<view class="tit-info">版本:{{ version }} for {{ phone_type }}</view>
</view>
<rich-text :nodes="nodes" v-if="type != 2"></rich-text>
<view class="main" v-if="type == 2">
<view @click="show = true">
<text>产品介绍</text>
<u-icon name="arrow-right" color="#999"></u-icon>
</view>
<view>
<text>版本更新</text>
<text class="tips">已是最新版本</text>
</view>
</view>
<u-popup v-model="show" v-if="type == 2">
<view>出淤泥而不染濯清涟而不妖</view>
</u-popup>
<view class="article-details">
<rich-text :nodes="nodes"></rich-text>
</view>
</template>
<script>
@ -26,11 +8,7 @@ import common from '@/static/js/common.js'
export default {
data() {
return {
version: "",
phone_type: "",
type: 1,
nodes: "",
show: false,
}
},
onLoad(option) {
@ -39,9 +17,9 @@ export default {
if(option.id) this.getUseHelpInfo(option.id);
if(option.type == 1) this.certificateInfo();
if(option.type == 2) this.getAboutUsInfo();
this.type = option.type;
this.getVersion();
this.phone_type = this.$u.os();
},
onNavigationBarButtonTap(e) {
console.log(e);
},
methods: {
setTitle(title){
@ -75,58 +53,16 @@ export default {
}
})
},
//
getVersion() {
this.$u.post("Specialci/checkVersion",{app_version: 1}).then(res => {
console.log(res);
this.version = res.data.app_version;
})
}
},
}
</script>
<style lang="scss" scoped>
page {
background-color: #f2f2f2;
}
.header {
width: 500rpx;
margin: 0 auto;
padding: 30rpx;
text-align: center;
.tit-img {
width: 200rpx;
height: 200rpx;
}
.title {
margin: 18rpx 0;
font-weight: bold;
font-size: 26rpx;
letter-spacing: 2rpx;
}
.tit-info {
font-size: 22rpx;
color: #666;
}
}
.main {
margin: 20rpx 0;
& > view {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100rpx;
padding: 0 20rpx;
line-height: 100rpx;
color: #333;
font-size: 30rpx;
background-color: #fff;
border-bottom: 1px solid #f2f2f2;
}
.tips {
color: #999;
font-size: 22rpx;
}
// page {
// background-color: #ECECEC;
// }
.article-details {
min-height: calc(100vh - var(--window-top));
background: #ECECEC;
padding: 20rpx 35rpx 0;
}
</style>

View File

@ -128,6 +128,7 @@ export default {
overflow: hidden;
margin-left: 20rpx;
margin-bottom: 20rpx;
box-shadow: 0rpx 0rpx 6rpx 0rpx rgba(35,24,21,0.12);
.head{
width: 80rpx;
height: 80rpx;

View File

@ -46,7 +46,7 @@ export default {
})
},
previewImage(urls) {
console.log(urls);
// console.log(urls);
uni.previewImage({
urls: urls,
});

View File

@ -23,6 +23,7 @@
import {
mapMutations
} from 'vuex';
import IMService from '@/static/imservice.js'
export default {
data() {
return {
@ -63,7 +64,8 @@
},
{
title: '关于我们',
link: '../mine/ArticleDetails?type=2'
// link: '../mine/ArticleDetails?type=2'
link: '/pageE/setting/version'
},
{
title: '帮助与反馈',
@ -88,7 +90,8 @@
url: url
});
},
loginOut() {
async loginOut() {
let im = this.imService
this.logout();
uni.redirectTo({
url: "../../pageA/login/login",

View File

@ -14,7 +14,7 @@
export default {
data() {
return {
src: 'https://dmmall.sdbairui.com/uploads/home/avatar/avatar_19.jpg',
src: 'https://mall.dmygkeji.com/uploads/home/avatar/avatar_19.jpg',
userList: [],
}
},

View File

@ -0,0 +1,55 @@
<template>
<u-modal v-model="show" :show-cancel-button="true" confirm-text="升级" title="发现新版本" @cancel="cancel" @confirm="confirm">
<view class="u-update-content">
<rich-text :nodes="content"></rich-text>
</view>
</u-modal>
</template>
<script>
export default {
data() {
return {
show: true,
// uni-app"rich-text"使"<br>"
content: `
1. 新增几个bug<br>
2. 新增Modal模态框组件<br>
3. 新增压窗屏组件可以在APP上以弹窗的形式遮盖导航栏和底部tabbar<br>
`,
}
},
onReady() {
this.show = true;
},
methods: {
cancel() {
this.closeModal();
},
confirm() {
this.closeModal();
},
closeModal() {
uni.navigateBack();
}
}
}
</script>
<style scoped lang="scss">
page {
background-color: rgba(0, 0, 0, 0);
}
/deep/ .u-mode-center-box {
background-color: transparent;
}
// .u-full-content {
// background-color: #00C777;
// }
.u-update-content {
font-size: 26rpx;
color: $u-content-color;
line-height: 1.7;
padding: 30rpx;
}
</style>

108
pageE/setting/version.vue Normal file
View File

@ -0,0 +1,108 @@
<template>
<view class="version">
<view class="header">
<image src="../../pageD/images/file.png" class="tit-img" mode=""></image>
<view class="title">德铭阳光</view>
<view class="tit-info">版本:{{ version }} for {{ phone_type }}</view>
</view>
<view class="main">
<view @click="viewAboutUs">
<text class="title">产品介绍</text>
<u-icon name="arrow-right" color="#999"></u-icon>
</view>
<view class="version-view">
<text class="title">版本更新</text>
<text class="tips" v-if="0">已是最新版本</text>
<text class="tips" v-else @click="updateVersion">1.1.10</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
version: "",
phone_type: "",
}
},
onLoad() {
this.getVersion();
this.phone_type = this.$u.os();
},
methods: {
//
getVersion() {
this.$u.post("Specialci/checkVersion",{ app_version: 1 }).then(res => {
// console.log(res);
this.version = res.data.app_version;
})
},
viewAboutUs() {
this.$u.route('/pageE/mine/ArticleDetails', {
type: 2
});
},
updateVersion() {
this.$u.route('/pageE/setting/updateVersion');
}
}
};
</script>
<style lang="scss" scoped>
.header {
width: 500rpx;
margin: 0 auto;
padding: 30rpx;
text-align: center;
.tit-img {
width: 200rpx;
height: 200rpx;
}
.title {
margin: 18rpx 0;
font-weight: bold;
font-size: 26rpx;
letter-spacing: 2rpx;
}
.tit-info {
font-size: 22rpx;
color: #666;
}
}
.main {
margin: 20rpx 0;
& > view {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100rpx;
padding: 0 20rpx;
line-height: 100rpx;
color: #333;
font-size: 30rpx;
background-color: #fff;
border-bottom: 1px solid #f2f2f2;
.title {
width: 200rpx;
}
}
.tips {
color: #999;
font-size: 22rpx;
}
.version-view {
.tips {
flex: 1;
text-align: right;
}
}
}
.u-content {
padding: 20rpx;
font-size: 30rpx;
text-indent: 1rem;
line-height: 1.2;
}
</style>

View File

@ -21,7 +21,7 @@
<view class="order-status">{{ item.order_status | viewStatus }}</view>
</view>
<view class="order-info">
<image :src="type == 1 ? item.goods_image : item.images[0]"></image>
<image :src="type == 1 ? item.goods_image : item.images[0]" mode="aspectFit"></image>
<view v-if="item.deliver_goods_type == 2 && item.order_status == 20">
<view>骑手名字{{ item.takeawayer_name || '' }}</view>
<view>联系方式{{ item.takeawayer_mobile || '' }}</view>

View File

@ -85,7 +85,7 @@
</view>
</u-upload>
</view>
<view class="wash-btn" @click="submitImage">确认送洗</view>
<view class="wash-btn" @click="$u.throttle(submitImage, 2000)">确认送洗</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
@ -141,7 +141,7 @@
</view>
</u-upload>
</view>
<view class="wash-btn" @click="submitImage">确认送洗</view>
<view class="wash-btn" @click="$u.throttle(submitImage, 2000)">确认送洗</view>
</swiper-item>
</swiper>
<u-select v-model="showClothesType" :list="typeList" value-name="id" label-name="name" @confirm="confirmType" mode="single-column"></u-select>
@ -160,7 +160,7 @@
<text>选择订单</text>
<u-icon name="close" color="#A29FA3" size="32" @click="showPopup=false"></u-icon>
</view>
<scroll-view scroll-y class="order-list">
<scroll-view scroll-y class="order-list" @scrolltolower="onreachBottom">
<u-radio-group v-model="value" @change="radioChange">
<view v-for="(items, index) in orderList" :key="index" class="order-item">
<view class="store">
@ -195,6 +195,7 @@
</view>
</view>
</u-radio-group>
<u-loadmore :status="loadStatu" bgColor="#FFFFFF" font-size="14" margin-top="20" margin-bottom="20"></u-loadmore>
</scroll-view>
<view class="order-btn" @click="confirm">确认</view>
</view>
@ -222,7 +223,7 @@ export default {
}],
typeList: [], //
orderList: [], //
page: 0,
page: 1,
current: 0,
swiperCurrent: 0,
areaList: [], // 
@ -244,6 +245,8 @@ export default {
name: 'common', //
},
debounce: true,
timer: true,
loadStatu: 'loadmore'
}
},
onShow() {
@ -284,21 +287,42 @@ export default {
// console.log(e);
this.type = e[0];
},
onreachBottom() {
if(!this.timer) return false;
this.timer = false;
this.loadStatu = "loading";
this.page++;
this.getOrderList({ load: 'loadmore' }).then(length => {
this.loadStatu = "nomore";
if(length == 0) this.page--;
}).catch(() => {
this.loadStatu = "nomore";
this.page--;
})
},
async getOrderList({ load = 'reload' } = {}) {
// const res = await this.$u.api.getSendOrderList({
// page: this.page,
// })
const res = await this.$u.api.getOrderList({
page: this.page,
// type: '40',
})
this.timer = true;
// if(res.errCode == 0) {
// if(load == 'reload') this.orderList = res.data.order_list;
// else this.orderList.push(...res.data.order_list);
// }
// return res.data.order_list.length;
if(res.errCode == 0) {
if(load == 'reload') this.orderList = res.data;
else this.orderList.push(...res.data);
}
return res;
return res.data.length;
},
submitImage() {
console.log(this.debounce);
if(!this.debounce) return;
// console.log(222);
if(!this.debounce) return false;
// console.log(111);
this.debounce = false;
this.current == 0 ? this.$refs.platform.upload() : this.$refs.physical.upload();
},
@ -319,42 +343,42 @@ export default {
validationParams() {
if (this.current == 1) {
if(this.$u.test.isEmpty(this.goodsName)) {
this.showToast('商品名称不能为空', 'warning');
this.$u.toast('商品名称不能为空');
return false;
}
}
if(this.current == 0) {
if(JSON.stringify(this.checkedGoods) == '{}') {
this.showToast('订单不能为空', 'warning');
this.$u.toast('订单不能为空');
return false;
}
}
if(this.$u.test.isEmpty(this.goodsStatus)) {
this.showToast('衣服状况不能为空', 'warning');
this.$u.toast('衣服状况不能为空');
return false;
}
if(JSON.stringify(this.type) == '{}') {
this.showToast('商品类型不能为空', 'warning');
this.$u.toast('商品类型不能为空');
return false;
}
if(this.$u.test.isEmpty(this.name)) {
this.showToast('送洗人不能为空', 'warning');
this.$u.toast('送洗人不能为空');
return false;
}
if(this.$u.test.isEmpty(this.phone)) {
this.showToast('手机号不能为空', 'warning');
this.$u.toast('手机号不能为空');
return false;
}
if(!this.$u.test.mobile(this.phone)) {
this.showToast('手机号错误', 'warning');
this.$u.toast('手机号错误');
return false;
}
if(this.$u.test.isEmpty(this.area)) {
this.showToast('地址不能为空', 'warning');
this.$u.toast('地址不能为空');
return false;
}
if(this.$u.test.isEmpty(this.address)) {
this.showToast('详细地址不能为空', 'warning');
this.$u.toast('详细地址不能为空');
return false;
}
return true;
@ -452,12 +476,6 @@ export default {
this.choose = false;
}
},
showToast(message, type) {
this.$refs.uToast.show({
title: message,
type: type,
})
},
},
};
</script>

View File

@ -993,6 +993,31 @@
}
}
},
{
"path": "setting/version",
"style": {
"navigationBarTitleText": "关于我们",
"app-plus": {
"titleSize": "36px",
"titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF"
}
}
}
},
{
"path": "setting/updateVersion",
"style": {
"navigationStyle": "custom", //
"app-plus": {
"animationType": "fade-in", // fade-in
"background": "transparent", //
"backgroundColor": "rgba(0,0,0,0)", //
"popGesture": "none" // IOS
}
}
},
{
"path": "order/Index",
"style": {

View File

@ -271,7 +271,39 @@
onShow() {
this.page = 1;
if (this.page != 1) {
}
}
console.log(this.imService.status)
if(!this.imService.status && this.$store.state.hasLogin){
const user = uni.getStorageSync('user_info');
// console.log(user)
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
this.imService.connectIM()
}else if(!this.imService.status){
this.$u.api.getDefaultAvatar().then((res)=>{
console.log(res)
uni.setStorageSync("morenimg",res.data.avatar)
this.imService.login(new Date().getTime(),"123",res.data.avatar)
this.imService.connectIM()
console.log("用户信息")
})
console.log("链接")
}
// if(!this.imService.status && !this.imService.lianjie){
// console.log("1212")
// this.imService.lianjie = true
// let that = this
// setTimeout(function(){
// that.imService.disconnect()
// console.log("guanbi")
// },1000)
// setTimeout(function(){
// console.log("lianjie")
// that.imService.connectIM()
// },2000)
// }
// if (this.hasLogin) {
// this.isNewmembervoucher();
// }
@ -279,36 +311,37 @@
async onLoad(){
this.articleList = [];
this.getArticlelist();
this.getSwiper();
//
if(this.$store.state.hasLogin){
this.getSwiper();
this.isNewmembervoucher();
const user = uni.getStorageSync('user_info');
// console.log(user)
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
await this.imService.connectIM()
//
// if(this.$store.state.hasLogin){
// const user = uni.getStorageSync('user_info');
// // console.log(user)
// this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
// await this.imService.connectIM()
}else{
await this.$u.api.getDefaultAvatar().then((res)=>{
console.log(res)
uni.setStorageSync("morenimg",res.data.avatar)
this.imService.login(new Date().getTime(),"123",res.data.avatar)
console.log("用户信息")
})
console.log("链接")
await this.imService.connectIM()
// }else{
// await this.$u.api.getDefaultAvatar().then((res)=>{
// console.log(res)
// uni.setStorageSync("morenimg",res.data.avatar)
// this.imService.login(new Date().getTime(),"123",res.data.avatar)
// console.log("")
// })
// console.log("")
// await this.imService.connectIM()
}
console.log("1212")
let that = this
setTimeout(function(){
that.imService.disconnect()
console.log("guanbi")
},1000)
setTimeout(function(){
console.log("lianjie")
that.imService.connectIM()
},2000)
// }
// console.log("1212")
// let that = this
// setTimeout(function(){
// that.imService.disconnect()
// console.log("guanbi")
// },1000)
// setTimeout(function(){
// console.log("lianjie")
// that.imService.connectIM()
// },2000)
},
onPullDownRefresh() {
this.page = 1;

View File

@ -125,7 +125,7 @@
const token = uni.getStorageSync('token');
let that = this
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId: 1
},

View File

@ -257,11 +257,10 @@
</script>
<style lang="scss" scoped>
.shop {
height: calc(100% - var(--window-top));
height: calc(100vh - var(--window-top));
box-sizing: border-box;
background-color: #F0EDF1;
overflow-y: scroll;
.top {
padding: 0 30rpx;
background-color: #ffffff;

View File

@ -370,7 +370,7 @@ export default {
const token = uni.getStorageSync('token');
console.log(token,that.id)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/goodsShelves",
url:"https://mall.dmygkeji.com/api/Specialci/goodsShelves",
data:{
live_id:that.id
},
@ -385,7 +385,7 @@ export default {
})
setInterval(function(){
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/goodsShelves",
url:"https://mall.dmygkeji.com/api/Specialci/goodsShelves",
data:{
live_id:that.id
},
@ -403,7 +403,7 @@ export default {
},10 * 1000)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/livingUserInfo",
url:"https://mall.dmygkeji.com/api/Specialci/livingUserInfo",
data:{
live_id:that.id
},
@ -417,32 +417,13 @@ export default {
// that.list= res.data.data
}
})
//当前用户
var currentUser = {}
if(this.$store.state.hasLogin){
const user = uni.getStorageSync('user_info');
currentUser = {
id : user.member.member_id,
nickname : user.member.member_nickname,
avatar: user.member.member_avatar
};
}else{
const user = uni.getStorageSync('morenimg');
currentUser = {
id : new Date().getTime(),
nickname : "123",
avatar: user
};
}
var room = {
id : a.rid + "",
name : a.rid + ""
};
that.chatRoomService = getApp().globalData.im
console.log(room,currentUser)
//构造chatRoomService
that.chatRoomService.subscribeRoomMessage(room,currentUser)
that.chatRoomService.subscribeRoomMessage(room)
//获取当前聊天室数据
that.room = that.chatRoomService.room;
that.chatRoomService.initialWhenOnlineUserChange(that.newpeople)
@ -520,7 +501,7 @@ export default {
let that = this
console.log(token)
uni.request({
url:"https://dmmall.sdbairui.com/api/member/attentionMember",
url:"https://mall.dmygkeji.com/api/member/attentionMember",
data:{
member_id:that.info.user_id
},
@ -531,7 +512,7 @@ export default {
success(res){
console.log(res)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/livingUserInfo",
url:"https://mall.dmygkeji.com/api/Specialci/livingUserInfo",
data:{
live_id:that.id
},

File diff suppressed because one or more lines are too long

BIN
static/image/common/32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -6,6 +6,7 @@
*/
import GoEasyIM from './goeasy-im-1.0.9';
// import GoEasyIM from './goeasy-im-1.1.1';
import restApi from './restapi';
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
@ -38,6 +39,7 @@ function IMService() {
appkey:'BC-453aa755c4ea48148abefc55a86df283'
});
this.status = false
this.lianjie = false
//当前“我”
this.currentUser = null;
//我的好友
@ -84,6 +86,7 @@ function IMService() {
IMService.prototype.login = function (uuid, name, avatar) {
//初始化当前用户
this.currentUser = new CurrentUser(uuid, name, avatar);
//初始化联系人信息,包括群
this.initialContacts();
return true;
@ -105,7 +108,7 @@ IMService.prototype.initialContacts = function (friendList) {
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId:i[0],
markup:1
@ -120,7 +123,7 @@ IMService.prototype.initialContacts = function (friendList) {
console.log(that.friends)
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date){
if(a.date > b.date && b.unReadMessage == 0){
return 0;
}else{
return 1;
@ -203,6 +206,7 @@ IMService.prototype.resetFriendUnReadMessage = function (friend) {
//连接GoEasy
IMService.prototype.connectIM = function () {
//初始化IM相关的监听器
try {
this.initialIMListeners();
@ -210,6 +214,7 @@ IMService.prototype.connectIM = function () {
console.log(123)
}
try {
console.log(this.currentUser)
this.im.connect({
id: this.currentUser.uuid,
data: {
@ -226,7 +231,6 @@ IMService.prototype.connectIM = function () {
this.subscribeFriendsPresence();
}).catch(error => {
console.log('连接失败,请确保网络正常appkey和host正确code:' + error.code + " content:" + error.content);
this.connectIM()
});
} catch (error) {
console.log(12323)
@ -244,6 +248,7 @@ IMService.prototype.initialIMListeners = function () {
this.im.on(GoEasyIM.EVENT.DISCONNECTED, () => {
console.log('连接断开.')
this.status = false
this.lianjie = false
});
//监听好友上下线
@ -268,7 +273,7 @@ IMService.prototype.initialIMListeners = function () {
// return ;
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date){
if(a.date > b.date && b.unReadMessage == 0){
return 0;
}else{
return 1;
@ -284,7 +289,7 @@ IMService.prototype.initialIMListeners = function () {
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId:message.senderId,
markup:1
@ -511,7 +516,7 @@ IMService.prototype.sendMessagesSetStorage = function (friendId,message){
// return ;
let sorts = function (friends){
let paixu = function (a,b){
if(a.date > b.date){
if(a.date > b.date && b.unReadMessage == 0){
return 0;
}else{
return 1;
@ -527,7 +532,7 @@ IMService.prototype.sendMessagesSetStorage = function (friendId,message){
const token = uni.getStorageSync('token');
console.log(token)
uni.request({
url:"https://dmmall.sdbairui.com/api/Specialci/getAtwillUserInfo",
url:"https://mall.dmygkeji.com/api/Specialci/getAtwillUserInfo",
data:{
userId:friendId,
markup:1
@ -831,7 +836,7 @@ IMService.prototype.listenerGroupPresence = function () {
//查询和初始化在线用户列表和在线用户数
IMService.prototype.initialOnlineUsers = function (roomId) {
let self = this;
console.log(roomId)
//查询最新上线的用户列表
this.im.groupHereNow(roomId)
.then(result => {
@ -850,7 +855,7 @@ IMService.prototype.initialOnlineUsers = function (roomId) {
if (e.code == 401) {
console.log("您还没有开通用户在线状态提醒登录goeasy->我的应用->查看详情->高级功能,自助开通.");
} else {
console.log(e);
console.log(e,1212);
}
});
//获取聊天室在线用户数
@ -873,7 +878,12 @@ IMService.prototype.subscribePresence = function (roomId) {
}
//订阅聊天室消息
IMService.prototype.subscribeRoomMessage = function (room, user) {
IMService.prototype.subscribeRoomMessage = function (room) {
let user = {
id:this.currentUser.uuid,
nickname:this.currentUser.name,
avatar:this.currentUser.avatar
}
this.room = new Room(room.id, room.name, user);