Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp
commit
071599074c
10
api/login.js
10
api/login.js
|
@ -14,6 +14,16 @@ export function resetByMobile(params) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取自动发券
|
||||||
|
export function getAutoCoup(){
|
||||||
|
return http.request({
|
||||||
|
url:`/promotion/coupon/activity`,
|
||||||
|
method:"GET",
|
||||||
|
needToken: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号密码登陆
|
* 账号密码登陆
|
||||||
* @params password
|
* @params password
|
||||||
|
|
|
@ -22,4 +22,5 @@ export default {
|
||||||
mainColor: "#ff3c2a", // 主题色
|
mainColor: "#ff3c2a", // 主题色
|
||||||
lightColor: "#ff6b35", // 高亮主题色
|
lightColor: "#ff6b35", // 高亮主题色
|
||||||
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
aiderLightColor: "#ff9f28", // 辅助高亮颜色
|
||||||
|
defaultUserPhoto:"/static/missing-face.png" // 默认用户头像
|
||||||
};
|
};
|
||||||
|
|
4
main.js
4
main.js
|
@ -5,13 +5,14 @@ import uView from "uview-ui";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
import config from '@/config/config';
|
import config from '@/config/config';
|
||||||
import airBtn from "@/components/m-airbtn/index.vue";
|
import airBtn from "@/components/m-airbtn/index.vue";
|
||||||
|
import socketIO from './pages/mine/im/socket';
|
||||||
/**
|
/**
|
||||||
* 仅在h5中显示唤醒app功能
|
* 仅在h5中显示唤醒app功能
|
||||||
* 在h5页面手动挂载
|
* 在h5页面手动挂载
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if(config.enableMiniBarStartUpApp){
|
if (config.enableMiniBarStartUpApp) {
|
||||||
let btn = Vue.component("airBtn", airBtn); //全局注册
|
let btn = Vue.component("airBtn", airBtn); //全局注册
|
||||||
document.body.appendChild(new btn().$mount().$el);
|
document.body.appendChild(new btn().$mount().$el);
|
||||||
}
|
}
|
||||||
|
@ -31,6 +32,7 @@ Object.keys(filters).forEach((key) => {
|
||||||
|
|
||||||
// 引入Vuex
|
// 引入Vuex
|
||||||
Vue.prototype.$store = store;
|
Vue.prototype.$store = store;
|
||||||
|
// Vue.prototype.socketIo = new socketIO();
|
||||||
Vue.use(uView);
|
Vue.use(uView);
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"name" : "lili商城",
|
"name" : "lili商城",
|
||||||
"appid" : "__UNI__EC9FD60",
|
"appid" : "__UNI__ED807EA",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "4.2.7",
|
"versionName" : "4.2.8",
|
||||||
"versionCode" : 4000270,
|
"versionCode" : 4000280,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"compatible" : {
|
"compatible" : {
|
||||||
|
|
|
@ -2,28 +2,63 @@
|
||||||
<view class="b-content">
|
<view class="b-content">
|
||||||
<view class="navbar">
|
<view class="navbar">
|
||||||
<!-- 循环出头部tab栏 -->
|
<!-- 循环出头部tab栏 -->
|
||||||
<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="handleTabClick(index)"><text
|
<view
|
||||||
:class="{ current: tabCurrentIndex === index }">{{
|
v-for="(item, index) in navList"
|
||||||
|
:key="index"
|
||||||
|
class="nav-item"
|
||||||
|
@click="handleTabClick(index)"
|
||||||
|
><text :class="{ current: tabCurrentIndex === index }">{{
|
||||||
item.text
|
item.text
|
||||||
}}</text></view>
|
}}</text></view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
|
<swiper
|
||||||
<swiper-item class="tab-content" v-for="(navItem, navIndex) in navList" :key="navIndex">
|
:current="tabCurrentIndex"
|
||||||
<scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
|
class="swiper-box"
|
||||||
|
duration="300"
|
||||||
|
@change="changeTab"
|
||||||
|
>
|
||||||
|
<swiper-item
|
||||||
|
class="tab-content"
|
||||||
|
v-for="(navItem, navIndex) in navList"
|
||||||
|
:key="navIndex"
|
||||||
|
>
|
||||||
|
<scroll-view
|
||||||
|
class="list-scroll-content"
|
||||||
|
scroll-y
|
||||||
|
@scrolltolower="loadData"
|
||||||
|
>
|
||||||
<!-- 空白页 -->
|
<!-- 空白页 -->
|
||||||
<u-empty mode="coupon" text="暂无优惠券了" v-if="navItem.wheterEmpty"></u-empty>
|
<u-empty
|
||||||
|
mode="coupon"
|
||||||
|
text="暂无优惠券了"
|
||||||
|
v-if="navItem.wheterEmpty"
|
||||||
|
></u-empty>
|
||||||
|
|
||||||
<!-- 数据 -->
|
<!-- 数据 -->
|
||||||
<view v-if="navItem.dataList && coupon" class="coupon-item" :class="{ 'coupon-used': navIndex != 0 }"
|
<view
|
||||||
v-for="(coupon, index) in navItem.dataList" :key="index">
|
v-if="navItem.dataList && coupon"
|
||||||
|
class="coupon-item"
|
||||||
|
:class="{ 'coupon-used': navIndex != 0 }"
|
||||||
|
v-for="(coupon, index) in navItem.dataList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="wave-line">
|
<view class="wave-line">
|
||||||
<view class="wave" v-for="(item, index) in 12" :key="index"></view>
|
<view
|
||||||
|
class="wave"
|
||||||
|
v-for="(item, index) in 12"
|
||||||
|
:key="index"
|
||||||
|
></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="message">
|
<view class="message">
|
||||||
<view class="price" v-if="coupon.couponType == 'DISCOUNT'">{{ coupon.discount }}折</view>
|
<view class="price" v-if="coupon.couponType == 'DISCOUNT'"
|
||||||
|
>{{ coupon.discount }}折</view
|
||||||
|
>
|
||||||
<view class="price" v-else>{{ coupon.price }}元</view>
|
<view class="price" v-else>{{ coupon.price }}元</view>
|
||||||
<view class="sub-price">满{{ coupon.consumeThreshold | unitPrice }}可用</view>
|
<view class="sub-price"
|
||||||
|
>满{{ coupon.consumeThreshold | unitPrice }}可用</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="circle circle-top"></view>
|
<view class="circle circle-top"></view>
|
||||||
<view class="circle circle-bottom"></view>
|
<view class="circle circle-bottom"></view>
|
||||||
|
@ -31,27 +66,47 @@
|
||||||
<view class="right" v-if="coupon">
|
<view class="right" v-if="coupon">
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="title-1">{{ coupon.title }}</view>
|
<view class="title-1">{{ coupon.title }}</view>
|
||||||
<view class="title-2">使用平台:{{
|
<view class="title-2"
|
||||||
coupon.scopeType == 'ALL' && coupon.storeId == '0'
|
>使用平台:{{
|
||||||
|
coupon.scopeType == "ALL" && coupon.storeId == "0"
|
||||||
? "全平台"
|
? "全平台"
|
||||||
: coupon.scopeType == "PORTION_CATEGORY"
|
: coupon.scopeType == "PORTION_CATEGORY"
|
||||||
? "仅限品类"
|
? "仅限品类"
|
||||||
: coupon.storeName == 'platform' ? '全平台' :coupon.storeName+''
|
: coupon.storeName == "platform"
|
||||||
}}使用</view>
|
? "全平台"
|
||||||
<view v-if="coupon.endTime">{{
|
: coupon.storeName + ""
|
||||||
coupon.endTime
|
}}使用</view
|
||||||
}}</view>
|
>
|
||||||
<view @click="couponDetail(coupon)">详细说明
|
<view v-if="coupon.endTime">{{ coupon.endTime }}</view>
|
||||||
<u-icon style="float: right; margin-top: 10rpx" name="arrow-right"></u-icon>
|
<view @click="couponDetail(coupon)"
|
||||||
|
>详细说明
|
||||||
|
<u-icon
|
||||||
|
style="float: right; margin-top: 10rpx"
|
||||||
|
name="arrow-right"
|
||||||
|
></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="jiao-1" v-if="navIndex == 0">
|
<view class="jiao-1" v-if="navIndex == 0">
|
||||||
<text class="text-1">新到</text>
|
<text class="text-1">新到</text>
|
||||||
<text class="text-2" v-if="coupon.used_status == 1">将过期</text>
|
<text class="text-2" v-if="coupon.used_status == 1"
|
||||||
|
>将过期</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<image class="no-icon" v-if="navIndex == 1" src="@/static/img/used.png"></image>
|
<image
|
||||||
<image class="no-icon" v-if="navIndex == 2" src="@/static/img/overdue.png"></image>
|
class="no-icon"
|
||||||
<view class="receive" v-if="navIndex == 0" @click="useItNow(coupon)">
|
v-if="navIndex == 1"
|
||||||
|
src="@/static/img/used.png"
|
||||||
|
></image>
|
||||||
|
<image
|
||||||
|
class="no-icon"
|
||||||
|
v-if="navIndex == 2"
|
||||||
|
src="@/static/img/overdue.png"
|
||||||
|
></image>
|
||||||
|
<view
|
||||||
|
class="receive"
|
||||||
|
v-if="navIndex == 0"
|
||||||
|
@click="useItNow(coupon)"
|
||||||
|
>
|
||||||
<text>立即</text><br />
|
<text>立即</text><br />
|
||||||
<text>使用</text>
|
<text>使用</text>
|
||||||
</view>
|
</view>
|
||||||
|
@ -116,7 +171,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.navList[this.tabCurrentIndex].params.pageNumber = 1
|
this.navList[this.tabCurrentIndex].params.pageNumber = 1;
|
||||||
this.navList[this.tabCurrentIndex].dataList = [];
|
this.navList[this.tabCurrentIndex].dataList = [];
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
|
@ -188,15 +243,9 @@ export default {
|
||||||
* 立即使用优惠券
|
* 立即使用优惠券
|
||||||
*/
|
*/
|
||||||
useItNow(item) {
|
useItNow(item) {
|
||||||
if (item.storeId && item.storeId!='0') {
|
uni.navigateTo({
|
||||||
uni.navigateTo({
|
url: `/pages/navigation/search/searchPage?promotionsId=${item.couponId}&promotionType=COUPON`,
|
||||||
url: `/pages/product/shopPage?id=${item.storeId}`,
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/navigation/search/searchPage",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<u-navbar class="my-title" title-size="32" :title="toUser.name"></u-navbar>
|
<u-navbar class="my-title" title-size="32" :title="toUser.name"></u-navbar>
|
||||||
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
|
<!-- 空盒子用来防止消息过少时 拉起键盘会遮盖消息 -->
|
||||||
<view :animation="anData" style="height:0;">
|
<view :animation="anData" style="height:0;">
|
||||||
</view>
|
</view>
|
||||||
|
@ -8,10 +8,9 @@
|
||||||
<!-- 用来获取消息体高度 -->
|
<!-- 用来获取消息体高度 -->
|
||||||
<view id="msgList">
|
<view id="msgList">
|
||||||
<!-- 消息 -->
|
<!-- 消息 -->
|
||||||
<view class="flex-column-start" v-if="msgList.length" v-for="(item, index) in msgList" :key="index">
|
<view class="flex-column-start" v-if="msgList.length" v-for="(item, index) in msgList" :key="index">
|
||||||
<view class="flex-row-start column-time">
|
<view class="flex-row-start column-time">
|
||||||
<view v-show="compareTime(index, item.createTime)" class="flex-row-start date-text"
|
<view v-show="compareTime(index, item.createTime)" class="flex-row-start date-text">
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 用户消息 头像可选加入-->
|
<!-- 用户消息 头像可选加入-->
|
||||||
|
@ -20,97 +19,103 @@
|
||||||
<view>
|
<view>
|
||||||
<view class="user-name">{{ user.nickName }}</view>
|
<view class="user-name">{{ user.nickName }}</view>
|
||||||
<view class="margin-left padding-chat bg-user-orang" style="border-radius: 35rpx; ">
|
<view class="margin-left padding-chat bg-user-orang" style="border-radius: 35rpx; ">
|
||||||
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
<text style="word-break: break-all;"
|
||||||
<!-- <view v-if="item.messageType == 'GOODS'">
|
v-if="item.messageType === 'MESSAGE' && !emojistwo.includes(item.text)">{{ item.text }}</text>
|
||||||
|
<view v-if="item.messageType === 'MESSAGE' && emojistwo.includes(item.text)"
|
||||||
|
v-html="textReplaceEmoji(item.text)"></view>
|
||||||
|
<view v-if="item.messageType == 'GOODS'">
|
||||||
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
<view class="imagebox" @click="jumpGoodDelic">
|
<view class="imagebox" @click="jumpGoodDelic(item)">
|
||||||
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc" @click="jumpGoodDelic">
|
<view class="goodsdesc" @click="jumpGoodDelic(item)">
|
||||||
<view class="goodsdesc-name">
|
<view class="goodsdesc-name">
|
||||||
<text class="goodsCard_goodNmae">{{
|
<text class="goodsCard_goodNmae">{{
|
||||||
JSON.parse(item.text)['goodsName']
|
JSON.parse(item.text)['goodsName']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
||||||
style="font-size:20rpx;">¥{{
|
style="font-size:20rpx;">¥{{
|
||||||
JSON.parse(item.text)['price']
|
JSON.parse(item.text)['price']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
<!-- <view v-if="item.messageType === 'ORDER'">
|
<view v-if="item.messageType == 'ORDER'">
|
||||||
<view class="orderSn">
|
<view class="orderSn">
|
||||||
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||||
<view class="oederList">
|
<view class="oederList">
|
||||||
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
||||||
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
||||||
<view class="groupNameOrTime">
|
<view class="groupNameOrTime">
|
||||||
<text @click="linkTosOrders(JSON.parse(item.text)['sn'])">{{ JSON.parse(item.text)['groupName']
|
<text @click="linkTosOrders(item.text)">{{
|
||||||
}}</text>
|
JSON.parse(item.text)['groupName']
|
||||||
<view class="orderTime"> <text>{{ JSON.parse(item.text)['paymentTime'] }}</text></view>
|
}}</text>
|
||||||
|
<view class="orderTime">
|
||||||
|
<text>{{ JSON.parse(item.text)['paymentTime'] }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<u-avatar :src="user.face" :text="user.face ? '' : user.name" bg-color="#DDDDDD"></u-avatar>
|
<u-avatar :src="user.face" :text="user.face ? '' : user.name" bg-color="#DDDDDD"></u-avatar>
|
||||||
<!-- <u-image class="chat-img margin-left" style="height: 100rpx;width: 100rpx;" shape="circle"
|
|
||||||
:src="user.face || 'https://avatars.dicebear.com/api/initials/' + user.nickName + '.svg?fontSize=38'"
|
|
||||||
mode="aspectFill"></u-image> -->
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 接收人消息 -->
|
<!-- 接收人消息 -->
|
||||||
<view v-else class="flex-row-start margin-left margin-top one-show">
|
<view v-else class="flex-row-start margin-left margin-top one-show">
|
||||||
<view class="chat-img flex-row-center">
|
<view class="chat-img flex-row-center">
|
||||||
<u-avatar :src="toUser.face" :text="toUser.face ? '' : toUser.name" bg-color="#DDDDDD"></u-avatar>
|
<u-avatar :src="toUser.face" :text="toUser.face ? '' : toUser.name" bg-color="#DDDDDD">
|
||||||
<!-- <u-image style="height: 100rpx;width: 100rpx;" shape="circle"
|
</u-avatar>
|
||||||
:src="toUser.face || 'https://avatars.dicebear.com/api/initials/' + toUser.name + '.svg?fontSize=38'"
|
|
||||||
mode="aspectFit"></u-image> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex" style="width: 500rpx;">
|
<view class="flex" style="width: 500rpx;">
|
||||||
<view>
|
<view>
|
||||||
<view class="other-name">{{ toUser.name }}</view>
|
<view class="other-name">{{ toUser.name }}</view>
|
||||||
<view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
|
<view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
|
||||||
<text style="word-break: break-all;" v-if="item.messageType === 'MESSAGE'">{{ item.text }}</text>
|
<text style="word-break: break-all;"
|
||||||
|
v-if="item.messageType === 'MESSAGE' && !emojistwo.includes(item.text)">{{ item.text }}</text>
|
||||||
|
<view v-if="item.messageType === 'MESSAGE' && emojistwo.includes(item.text)"
|
||||||
|
v-html="textReplaceEmoji(item.text)"></view>
|
||||||
<view v-if="item.messageType === 'GOODS'">
|
<view v-if="item.messageType === 'GOODS'">
|
||||||
<!-- <view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
<view class="goodsCard u-flex u-row-between u-p-b-0" style="width:100%;margin: 0 0; ">
|
||||||
<view class="imagebox" @click="jumpGoodDelic">
|
<view class="imagebox" @click="jumpGoodDelic(item)">
|
||||||
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
<image class="image" :src="JSON.parse(item.text)['thumbnail']" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc" @click="jumpGoodDelic">
|
<view class="goodsdesc" @click="jumpGoodDelic(item)">
|
||||||
<view class="goodsdesc-name">
|
<view class="goodsdesc-name">
|
||||||
<text class="goodsCard_goodNmae">{{
|
<text class="goodsCard_goodNmae">{{
|
||||||
JSON.parse(item.text)['goodsName']
|
JSON.parse(item.text)['goodsName']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text
|
||||||
style="font-size:20rpx;">¥{{
|
style="font-size:20rpx;">¥{{
|
||||||
JSON.parse(item.text)['price']
|
JSON.parse(item.text)['price']
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view v-if="item.messageType === 'ORDER'">
|
<view v-if="item.messageType === 'ORDER'">
|
||||||
<view class="orderSn">
|
<view class="orderSn">
|
||||||
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
<text>订单号:{{ JSON.parse(item.text)['sn'] }}</text>
|
||||||
<view class="oederList">
|
<view class="oederList">
|
||||||
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
<img style="height: 120rpx; width: 120rpx; margin-top: 15rpx;"
|
||||||
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
:src="JSON.parse(item.text)['groupImages']" mode="widthFix" />
|
||||||
<view class="groupNameOrTime">
|
<view class="groupNameOrTime">
|
||||||
<text @click="linkTosOrders(JSON.parse(item.text)['sn'])">{{ JSON.parse(item.text)['groupName']
|
<text @click="linkTosOrders(item.text)">{{
|
||||||
}}</text>
|
JSON.parse(item.text)['groupName']
|
||||||
<view class="orderTime"> <text>{{ JSON.parse(item.text)['paymentTime'] }}</text></view>
|
}}</text>
|
||||||
|
<view class="orderTime">
|
||||||
|
<text>{{ JSON.parse(item.text)['paymentTime'] }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -122,18 +127,18 @@
|
||||||
:style="{ position: msgList.length == 0 ? 'fixed' : '', bottom: msgList.length == 0 ? '50px' : '', width: msgList.length == 0 ? '100%' : '' }">
|
:style="{ position: msgList.length == 0 ? 'fixed' : '', bottom: msgList.length == 0 ? '50px' : '', width: msgList.length == 0 ? '100%' : '' }">
|
||||||
<view class="cartMessage" v-if="showHide && !localImGoodsId && showHideModel">
|
<view class="cartMessage" v-if="showHide && !localImGoodsId && showHideModel">
|
||||||
<view class="goodsCard u-flex u-row-between u-p-b-0">
|
<view class="goodsCard u-flex u-row-between u-p-b-0">
|
||||||
<view class="imagebox" @click="jumpGoodDelic">
|
<view class="imagebox" @click="jumpGoodDelic(item)">
|
||||||
<image class="image" :src="goodListData.thumbnail" mode="widthFix"></image>
|
<image class="image" :src="goodListData.thumbnail" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc" @click="jumpGoodDelic">
|
<view class="goodsdesc" @click="jumpGoodDelic(item)">
|
||||||
<view class="goodsdesc-name">
|
<view class="goodsdesc-name">
|
||||||
<text class="goodsCard_goodNmae">{{
|
<text class="goodsCard_goodNmae">{{
|
||||||
goodListData.goodsName
|
goodListData.goodsName
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text style="font-size:20rpx;">¥{{
|
<view class="goodsdesc-rice" style="margin-top:10rpx; color: orange;"><text style="font-size:20rpx;">¥{{
|
||||||
goodListData.price
|
goodListData.price
|
||||||
}}</text>
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cancel" @click="cancelModel">X</view>
|
<view class="cancel" @click="cancelModel">X</view>
|
||||||
|
@ -151,9 +156,9 @@
|
||||||
<view class="flex" style="width: 500rpx;">
|
<view class="flex" style="width: 500rpx;">
|
||||||
<view class="margin-left padding-chat flex-column-start"
|
<view class="margin-left padding-chat flex-column-start"
|
||||||
style="border-radius: 35rpx;background-color: #f9f9f9;">
|
style="border-radius: 35rpx;background-color: #f9f9f9;">
|
||||||
<view class="cuIcon-loading turn-load" style="font-size: 35rpx;color: #3e9982;">
|
<!-- <view class="cuIcon-loading turn-load" style="font-size: 35rpx;color: #3e9982;">
|
||||||
|
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -194,20 +199,38 @@ var l
|
||||||
var wh
|
var wh
|
||||||
// 顶部空盒子的高度
|
// 顶部空盒子的高度
|
||||||
var mgUpHeight
|
var mgUpHeight
|
||||||
import { getTalkMessage, getTalkByUser, jumpObtain } from "@/api/im.js";
|
import {
|
||||||
|
getTalkMessage,
|
||||||
|
getTalkByUser,
|
||||||
|
jumpObtain
|
||||||
|
} from "@/api/im.js";
|
||||||
import SocketService from "@/utils/socket_service.js";
|
import SocketService from "@/utils/socket_service.js";
|
||||||
import storage from "@/utils/storage.js";
|
import storage from "@/utils/storage.js";
|
||||||
import { beautifyTime } from "@/utils/filters.js"
|
import {
|
||||||
|
beautifyTime
|
||||||
|
} from "@/utils/filters.js"
|
||||||
|
import config from '@/config/config.js'
|
||||||
|
import { textReplaceEmoji, emojistwo } from '@/utils/emojis.js';
|
||||||
export default {
|
export default {
|
||||||
// 页面卸载后清除imGoodId
|
// 页面卸载后清除imGoodId
|
||||||
onUnload () {
|
onUnload () {
|
||||||
storage.setImGoodsLink('')
|
// #ifdef H5
|
||||||
|
uni.setStorageSync("imGoodId", '');
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
if (this.socketOpen == true) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onLoad (options) {
|
onLoad (options) {
|
||||||
|
console.log(5555555555555555);
|
||||||
|
console.log(emojistwo);
|
||||||
// 没有goodsid则不显示 发送商品弹窗
|
// 没有goodsid则不显示 发送商品弹窗
|
||||||
this.showHideModel = options.goodsid
|
this.showHideModel = options.goodsid
|
||||||
// 发送后刷新页面不显示 发送商品弹窗 local里面imGoodId不为空显示
|
// 发送后刷新页面不显示 发送商品弹窗 local里面imGoodId不为空显示
|
||||||
this.localImGoodsId = storage.getImGoodsLink()
|
// #ifdef H5
|
||||||
|
this.localImGoodsId = uni.getStorageSync("imGoodId");
|
||||||
|
// #endif
|
||||||
this.resolve = options
|
this.resolve = options
|
||||||
// 请求商品信息
|
// 请求商品信息
|
||||||
if (this.resolve.goodsid) {
|
if (this.resolve.goodsid) {
|
||||||
|
@ -249,8 +272,10 @@ export default {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ws.connect();
|
// this.ws.connect();
|
||||||
|
this.sokcet();
|
||||||
},
|
},
|
||||||
|
|
||||||
onPullDownRefresh () {
|
onPullDownRefresh () {
|
||||||
this.params.pageNumber = this.params.pageNumber + 1
|
this.params.pageNumber = this.params.pageNumber + 1
|
||||||
this.getTalkMessage()
|
this.getTalkMessage()
|
||||||
|
@ -261,6 +286,9 @@ export default {
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
textReplaceEmoji,
|
||||||
|
emojistwo,
|
||||||
|
socketOpen: false, //是否连接
|
||||||
storage,
|
storage,
|
||||||
fixed: 'fixed',
|
fixed: 'fixed',
|
||||||
bottom: '50px',
|
bottom: '50px',
|
||||||
|
@ -273,7 +301,7 @@ export default {
|
||||||
animationData: {},
|
animationData: {},
|
||||||
msgList: [],
|
msgList: [],
|
||||||
oldHeight: 0,
|
oldHeight: 0,
|
||||||
params: { //搜索条件
|
params: { //搜索条件
|
||||||
talkId: '',
|
talkId: '',
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
|
@ -290,38 +318,54 @@ export default {
|
||||||
goodListData: {}
|
goodListData: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
// watch: {
|
||||||
'ws.callBackMapping': {
|
// 'ws.callBackMapping': {
|
||||||
handler: function (val) {
|
// handler: function (val) {
|
||||||
val = JSON.parse(val)
|
// val = JSON.parse(val)
|
||||||
if (val.messageResultType == 'MESSAGE') {
|
// if (val.messageResultType == 'MESSAGE') {
|
||||||
this.msgList.push(val.result)
|
// this.msgList.push(val.result)
|
||||||
}
|
// }
|
||||||
this.newMessageNum++;
|
// this.newMessageNum++;
|
||||||
//接收到消息后发送已读
|
// //接收到消息后发送已读
|
||||||
let msg = val
|
// let msg = val
|
||||||
msg.operation_type = 'READ'
|
// msg.operation_type = 'READ'
|
||||||
this.ws.send(JSON.stringify(msg))
|
// this.ws.send(JSON.stringify(msg))
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
beautifyTime,
|
sendMessage () {
|
||||||
//订单详情
|
if (this.msg == "") {
|
||||||
linkTosOrders (val) {
|
return 0;
|
||||||
console.log(val);
|
}
|
||||||
uni.navigateTo({
|
if (this.socketOpen == false) {
|
||||||
url: '/pages/order/orderDetail?sn=' + val,
|
return
|
||||||
});
|
}
|
||||||
|
let msg = {
|
||||||
|
operation_type: "MESSAGE",
|
||||||
|
to: this.toUser.userId,
|
||||||
|
from: this.user.id,
|
||||||
|
message_type: "MESSAGE",
|
||||||
|
context: this.msg,
|
||||||
|
talk_id: this.params.talkId,
|
||||||
|
}
|
||||||
|
let data = JSON.stringify(msg);
|
||||||
|
try {
|
||||||
|
uni.sendSocketMessage({
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
this.msgList.push({
|
||||||
|
"text": this.msg,
|
||||||
|
"my": true,
|
||||||
|
"messageType": 'MESSAGE'
|
||||||
|
})
|
||||||
|
let type = 'down';
|
||||||
|
this.msgGo(type)
|
||||||
|
this.msg = ""
|
||||||
|
} catch (e) {
|
||||||
|
uni.closeSocket();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 跳转商品详情页
|
|
||||||
jumpGoodDelic () {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/product/goods?id=${this.resolve.skuid}&goodsId=${this.resolve.goodsid}`,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//发送商品
|
|
||||||
sendGoodsMessage () {
|
sendGoodsMessage () {
|
||||||
let msg = {
|
let msg = {
|
||||||
operation_type: "MESSAGE",
|
operation_type: "MESSAGE",
|
||||||
|
@ -331,19 +375,101 @@ export default {
|
||||||
context: this.goodListData,
|
context: this.goodListData,
|
||||||
talk_id: this.params.talkId,
|
talk_id: this.params.talkId,
|
||||||
}
|
}
|
||||||
this.ws.send(JSON.stringify(msg))
|
let data = JSON.stringify(msg);
|
||||||
this.msgList.push({ "text": JSON.stringify(this.goodListData), "my": true, "messageType": 'GOODS' })
|
uni.sendSocketMessage({
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
this.msgList.push({
|
||||||
|
"text": JSON.stringify(this.goodListData),
|
||||||
|
"my": true,
|
||||||
|
"messageType": 'GOODS'
|
||||||
|
})
|
||||||
this.showHide = false
|
this.showHide = false
|
||||||
storage.setImGoodsLink(this.params.talkId)
|
// #ifdef H5
|
||||||
//成功发送商品连接后,滚动到底部
|
uni.setStorageSync("imGoodId", 1111111);
|
||||||
|
// #endif
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
uni.pageScrollTo({
|
uni.pageScrollTo({
|
||||||
scrollTop: 2000000,
|
scrollTop: 2000000,
|
||||||
duration: 0
|
duration: 300
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
sokcet () {
|
||||||
|
var _this = this;
|
||||||
|
uni.closeSocket();
|
||||||
|
this.socketOpen = false;
|
||||||
|
try {
|
||||||
|
//WebSocket的地址
|
||||||
|
var url = config.baseWsUrl + '/' + storage.getAccessToken();
|
||||||
|
// 连接
|
||||||
|
uni.connectSocket({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
// 监听WebSocket连接已打开
|
||||||
|
uni.onSocketOpen(function (res) {
|
||||||
|
_this.socketOpen = true;
|
||||||
|
});
|
||||||
|
if (!this.socketOpen) {
|
||||||
|
// 监听连接失败
|
||||||
|
uni.onSocketError(function (err) {
|
||||||
|
let count = 0;
|
||||||
|
if (count < 3) {
|
||||||
|
if (err && err.code !== 1000) {
|
||||||
|
_this.socketOpen = true;
|
||||||
|
uni.connectSocket({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
count = count + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 监听连接关闭
|
||||||
|
uni.onSocketClose(function (err) {
|
||||||
|
if (err && err.code !== 1000) {
|
||||||
|
setTimeout(function () {
|
||||||
|
_this.socketOpen = true;
|
||||||
|
uni.connectSocket({
|
||||||
|
url: url,
|
||||||
|
});
|
||||||
|
}, 5 * 1000)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 监听收到信息
|
||||||
|
uni.onSocketMessage(function (res) {
|
||||||
|
console.log(res.data);
|
||||||
|
res.data = JSON.parse(res.data)
|
||||||
|
console.log(res.data.result);
|
||||||
|
if (res.data.messageResultType == 'MESSAGE') {
|
||||||
|
_this.msgList.push(res.data.result)
|
||||||
|
console.log(_this.msgList)
|
||||||
|
}
|
||||||
|
console.log(res.data)
|
||||||
|
_this.msgGo()
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
beautifyTime,
|
||||||
|
//订单详情
|
||||||
|
linkTosOrders (val) {
|
||||||
|
let order = JSON.parse(val)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/order/orderDetail?sn=' + order.sn,
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
// 跳转商品详情页
|
||||||
|
jumpGoodDelic (item) {
|
||||||
|
let info = JSON.parse(item.text)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/product/goods?id=${info.id}&goodsId=${info.goodsId}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
//取消发送
|
//取消发送
|
||||||
cancelModel () {
|
cancelModel () {
|
||||||
this.showHide = false
|
this.showHide = false
|
||||||
|
@ -354,7 +480,7 @@ export default {
|
||||||
this.goodListData = res.data.result.data
|
this.goodListData = res.data.result.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 切换输入法时移动输入框(按照官方的上推页面的原理应该会自动适应不同的键盘高度-->官方bug)
|
// 切换输入法时移动输入框(按照官方的上推页面的原理应该会自动适应不同的键盘高度-->官方bug)
|
||||||
goPag (kh) {
|
goPag (kh) {
|
||||||
this.retractBox(0, 250)
|
this.retractBox(0, 250)
|
||||||
|
@ -423,30 +549,35 @@ export default {
|
||||||
// 这里应该传入问题的id,模拟就用index代替了
|
// 这里应该传入问题的id,模拟就用index代替了
|
||||||
|
|
||||||
},
|
},
|
||||||
sendMessage () {
|
// sendMessage() {
|
||||||
// 消息为空不做任何操作
|
// // 消息为空不做任何操作
|
||||||
if (this.msg == "") {
|
// if (this.msg == "") {
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
// }
|
||||||
// 显示消息 msg消息文本,my鉴别是谁发的消息(不能用俩个消息数组循环,否则消息不会穿插)
|
// // 显示消息 msg消息文本,my鉴别是谁发的消息(不能用俩个消息数组循环,否则消息不会穿插)
|
||||||
let msg = {
|
// let msg = {
|
||||||
operation_type: "MESSAGE",
|
// operation_type: "MESSAGE",
|
||||||
to: this.toUser.userId,
|
// to: this.toUser.userId,
|
||||||
from: this.user.id,
|
// from: this.user.id,
|
||||||
message_type: "MESSAGE",
|
// message_type: "MESSAGE",
|
||||||
context: this.msg,
|
// context: this.msg,
|
||||||
talk_id: this.params.talkId,
|
// talk_id: this.params.talkId,
|
||||||
}
|
// }
|
||||||
this.ws.send(JSON.stringify(msg))
|
// this.ws.send(JSON.stringify(msg))
|
||||||
this.msgList.push({ "text": this.msg, "my": true, "messageType": 'MESSAGE' })
|
// this.msgList.push({
|
||||||
// 保证消息可见
|
// "text": this.msg,
|
||||||
let type = 'down';
|
// "my": true,
|
||||||
this.msgGo(type)
|
// "messageType": 'MESSAGE'
|
||||||
// 回答问题
|
// })
|
||||||
// this.msgKf(this.msg)
|
// console.log(this.msgList, 'this.msgListthis.msgListthis.msgListthis.msgListthis.msgList')
|
||||||
// 清除消息
|
// // 保证消息可见
|
||||||
this.msg = ""
|
// let type = 'down';
|
||||||
},
|
// this.msgGo(type)
|
||||||
|
// // 回答问题
|
||||||
|
// // this.msgKf(this.msg)
|
||||||
|
// // 清除消息
|
||||||
|
// this.msg = ""
|
||||||
|
// },
|
||||||
// msgKf(x) {
|
// msgKf(x) {
|
||||||
// // loading
|
// // loading
|
||||||
// // this.msgLoad = true
|
// // this.msgLoad = true
|
||||||
|
@ -503,7 +634,7 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(this.msgList);
|
||||||
this.msgGo(type)
|
this.msgGo(type)
|
||||||
},
|
},
|
||||||
touchMoreMessage (e) {
|
touchMoreMessage (e) {
|
||||||
|
@ -534,8 +665,10 @@ export default {
|
||||||
if (this.msgList[index].is_revoke == 1) {
|
if (this.msgList[index].is_revoke == 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (datetime) {
|
||||||
|
datetime = datetime.replace(/-/g, "/");
|
||||||
|
}
|
||||||
|
|
||||||
datetime = datetime.replace(/-/g, "/");
|
|
||||||
let time = Math.floor(Date.parse(datetime) / 1000);
|
let time = Math.floor(Date.parse(datetime) / 1000);
|
||||||
let currTime = Math.floor(new Date().getTime() / 1000);
|
let currTime = Math.floor(new Date().getTime() / 1000);
|
||||||
|
|
||||||
|
@ -546,7 +679,7 @@ export default {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
let nextDate
|
let nextDate
|
||||||
if (this.msgList[index + 1]) {
|
if (this.msgList[index + 1] && this.msgList[index + 1].createTime) {
|
||||||
nextDate = this.msgList[index + 1].createTime.replace(/-/g, "/");
|
nextDate = this.msgList[index + 1].createTime.replace(/-/g, "/");
|
||||||
if (nextDate - datetime < 300) return false;
|
if (nextDate - datetime < 300) return false;
|
||||||
}
|
}
|
||||||
|
@ -585,9 +718,9 @@ export default {
|
||||||
if (new RegExp("(" + k + ")").test(_format))
|
if (new RegExp("(" + k + ")").test(_format))
|
||||||
_format = _format.replace(
|
_format = _format.replace(
|
||||||
RegExp.$1,
|
RegExp.$1,
|
||||||
RegExp.$1.length === 1
|
RegExp.$1.length === 1 ?
|
||||||
? o[k]
|
o[k] :
|
||||||
: ("00" + o[k]).substr(("" + o[k]).length)
|
("00" + o[k]).substr(("" + o[k]).length)
|
||||||
);
|
);
|
||||||
return _format;
|
return _format;
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,166 @@
|
||||||
|
import config from '@/config/config.js'
|
||||||
|
import storage from '@/utils/storage';
|
||||||
|
class socketIO {
|
||||||
|
constructor(data, time, url) {
|
||||||
|
this.socketTask = null
|
||||||
|
this.is_open_socket = false //避免重复连接
|
||||||
|
this.url = config.baseWsUrl + '/' + storage.getAccessToken() //连接地址
|
||||||
|
this.data = data ? data : null
|
||||||
|
this.connectNum = 1 // 重连次数
|
||||||
|
this.traderDetailIndex = 100 // traderDetailIndex ==2 重连
|
||||||
|
this.accountStateIndex = 100 // traderDetailIndex ==1 重连
|
||||||
|
this.followFlake = false // traderDetailIndex == true 重连
|
||||||
|
//心跳检测
|
||||||
|
this.timeout = time ? time : 15000 //多少秒执行检测
|
||||||
|
this.heartbeatInterval = null //检测服务器端是否还活着
|
||||||
|
this.reconnectTimeOut = null //重连之后多久再次重连
|
||||||
|
}
|
||||||
|
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||||
|
connectSocketInit (data) {
|
||||||
|
this.data = data
|
||||||
|
this.socketTask = uni.connectSocket({
|
||||||
|
url: this.url,
|
||||||
|
success: () => {
|
||||||
|
console.log("正准备建立websocket中...");
|
||||||
|
// 返回实例
|
||||||
|
return this.socketTask
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.socketTask.onOpen((res) => {
|
||||||
|
this.connectNum = 1
|
||||||
|
console.log("WebSocket连接正常!");
|
||||||
|
this.send(data)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
this.is_open_socket = true;
|
||||||
|
this.start();
|
||||||
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||||
|
this.socketTask.onMessage((e) => {
|
||||||
|
// 字符串转json
|
||||||
|
let res = JSON.parse(e.data);
|
||||||
|
console.log("res---------->", res) // 这里 查看 推送过来的消息
|
||||||
|
if (res.data) {
|
||||||
|
uni.$emit('getPositonsOrder', res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
// 监听连接失败,这里代码我注释掉的原因是因为如果服务器关闭后,和下面的onclose方法一起发起重连操作,这样会导致重复连接
|
||||||
|
uni.onSocketError((res) => {
|
||||||
|
console.log('WebSocket连接打开失败,请检查!');
|
||||||
|
this.socketTask = null
|
||||||
|
this.is_open_socket = false;
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
uni.$off('getPositonsOrder')
|
||||||
|
if (this.connectNum < 6) {
|
||||||
|
uni.showToast({
|
||||||
|
title: `WebSocket连接失败,正尝试第${this.connectNum}次连接`,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
this.reconnect();
|
||||||
|
this.connectNum += 1
|
||||||
|
} else {
|
||||||
|
uni.$emit('connectError');
|
||||||
|
this.connectNum = 1
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 这里仅是事件监听【如果socket关闭了会执行】
|
||||||
|
this.socketTask.onClose(() => {
|
||||||
|
console.log("已经被关闭了-------")
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
clearInterval(this.reconnectTimeOut)
|
||||||
|
this.is_open_socket = false;
|
||||||
|
this.socketTask = null
|
||||||
|
uni.$off('getPositonsOrder')
|
||||||
|
if (this.connectNum < 6) {
|
||||||
|
this.reconnect();
|
||||||
|
} else {
|
||||||
|
uni.$emit('connectError');
|
||||||
|
this.connectNum = 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 主动关闭socket连接
|
||||||
|
Close () {
|
||||||
|
if (!this.is_open_socket) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.socketTask.close({
|
||||||
|
success () {
|
||||||
|
uni.showToast({
|
||||||
|
title: 'SocketTask 关闭成功',
|
||||||
|
icon: "none"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//发送消息
|
||||||
|
send (data) {
|
||||||
|
console.log("data---------->", data);
|
||||||
|
// 注:只有连接正常打开中 ,才能正常成功发送消息
|
||||||
|
if (this.socketTask) {
|
||||||
|
this.socketTask.send({
|
||||||
|
data: JSON.stringify(data),
|
||||||
|
async success () {
|
||||||
|
console.log("消息发送成功");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//开启心跳检测
|
||||||
|
start () {
|
||||||
|
this.heartbeatInterval = setInterval(() => {
|
||||||
|
this.send({
|
||||||
|
"traderid": 10260,
|
||||||
|
"type": "Ping"
|
||||||
|
});
|
||||||
|
}, this.timeout)
|
||||||
|
}
|
||||||
|
//重新连接
|
||||||
|
reconnect () {
|
||||||
|
//停止发送心跳
|
||||||
|
clearInterval(this.heartbeatInterval)
|
||||||
|
//如果不是人为关闭的话,进行重连
|
||||||
|
if (!this.is_open_socket && (this.traderDetailIndex == 2 || this.accountStateIndex == 0 || this
|
||||||
|
.followFlake)) {
|
||||||
|
this.reconnectTimeOut = setInterval(() => {
|
||||||
|
this.connectSocketInit(this.data);
|
||||||
|
}, 5000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description 将 scoket 数据进行过滤
|
||||||
|
* @param {array} array
|
||||||
|
* @param {string} type 区分 弹窗 openposition 分为跟随和我的
|
||||||
|
*/
|
||||||
|
arrayFilter (array, type = 'normal', signalId = 0) {
|
||||||
|
let arr1 = []
|
||||||
|
let arr2 = []
|
||||||
|
let obj = {
|
||||||
|
arr1: [],
|
||||||
|
arr2: []
|
||||||
|
}
|
||||||
|
arr1 = array.filter(v => v.flwsig == true)
|
||||||
|
arr2 = array.filter(v => v.flwsig == false)
|
||||||
|
if (type == 'normal') {
|
||||||
|
if (signalId) {
|
||||||
|
arr1 = array.filter(v => v.flwsig == true && v.sigtraderid == signalId)
|
||||||
|
return arr1
|
||||||
|
} else {
|
||||||
|
return arr1.concat(arr2)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (signalId > 0) {
|
||||||
|
arr1 = array.filter(v => v.flwsig == true && v.sigtraderid == signalId)
|
||||||
|
obj.arr1 = arr1
|
||||||
|
} else {
|
||||||
|
obj.arr1 = arr1
|
||||||
|
}
|
||||||
|
obj.arr2 = arr2
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export {
|
||||||
|
socketIO
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="person" @click="checkUserInfo()">
|
<view class="person" @click="checkUserInfo()">
|
||||||
<u-image width=140 height="140" shape="circle" :src="userInfo.face || '/static/missing-face.png'" mode="">
|
<u-image width=140 height="140" shape="circle" :src="userInfo.face || userImage" mode="">
|
||||||
</u-image>
|
</u-image>
|
||||||
<view class="user-name">
|
<view class="user-name">
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
config,
|
config,
|
||||||
|
userImage:config.defaultUserPhoto,
|
||||||
lightColor: this.$lightColor,
|
lightColor: this.$lightColor,
|
||||||
quitShow: false,
|
quitShow: false,
|
||||||
isCertificate: false,
|
isCertificate: false,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@
|
||||||
<view class="exaluate-member-view">
|
<view class="exaluate-member-view">
|
||||||
<view class="member-view">
|
<view class="member-view">
|
||||||
<view class="member-img">
|
<view class="member-img">
|
||||||
<u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || '/static/missing-face.png'"></u-image>
|
<u-image width="82rpx" style="border: 1px solid #ededed" height="82rpx" shape="circle" :src="comment.memberProfile || userImage"></u-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="member-info">
|
<view class="member-info">
|
||||||
<view class="memName">{{ comment.memberName }}</view>
|
<view class="memName">{{ comment.memberName }}</view>
|
||||||
|
@ -41,9 +41,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
|
|
||||||
comment: {}, //评论信息
|
comment: {}, //评论信息
|
||||||
gradeList: {
|
gradeList: {
|
||||||
//评价grade
|
//评价grade
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
<view class="group">
|
<view class="group">
|
||||||
<view>
|
<view>
|
||||||
<u-image borderRadius="50%" shape="square" class="head-img" width="81rpx" height="81rpx"
|
<u-image borderRadius="50%" shape="square" class="head-img" width="81rpx" height="81rpx"
|
||||||
:src="masterWay.face || '/static/missing-face.png'"></u-image>
|
:src="masterWay.face || userImage"></u-image>
|
||||||
<view class="btn-one">团长</view>
|
<view class="btn-one">团长</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"> </view>
|
<view class="line"> </view>
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
<view slot="loading"></view>
|
<view slot="loading"></view>
|
||||||
</u-image>
|
</u-image>
|
||||||
<u-image class="head-img" borderRadius="50%" shape="square" v-else width="81rpx" height="81rpx"
|
<u-image class="head-img" borderRadius="50%" shape="square" v-else width="81rpx" height="81rpx"
|
||||||
:src="endWay.face || '/static/missing-face.png'"></u-image>
|
:src="endWay.face || userImage"></u-image>
|
||||||
|
|
||||||
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
<view class="wait">{{ endWay.nickname || "等待参团" }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -265,7 +265,7 @@ import * as API_Order from "@/api/order";
|
||||||
import invoices from "@/pages/order/invoice/setInvoice";
|
import invoices from "@/pages/order/invoice/setInvoice";
|
||||||
|
|
||||||
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
import LiLiWXPay from "@/js_sdk/lili-pay/wx-pay.js";
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
onLoad: function (val) {
|
onLoad: function (val) {
|
||||||
this.routerVal = val;
|
this.routerVal = val;
|
||||||
|
@ -277,6 +277,8 @@ export default {
|
||||||
watch: {},
|
watch: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
invoiceFlag: false, //开票开关
|
invoiceFlag: false, //开票开关
|
||||||
shippingText: "LOGISTICS",
|
shippingText: "LOGISTICS",
|
||||||
shippingFlag: false,
|
shippingFlag: false,
|
||||||
|
|
|
@ -343,7 +343,7 @@ export default {
|
||||||
this.orderGoodsList = order.orderItems;
|
this.orderGoodsList = order.orderItems;
|
||||||
this.orderDetail = res.data.result;
|
this.orderDetail = res.data.result;
|
||||||
if (this.order.deliveryMethod === 'LOGISTICS') {
|
if (this.order.deliveryMethod === 'LOGISTICS') {
|
||||||
this.loadLogistics()
|
this.loadLogistics(sn)
|
||||||
}
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
});
|
});
|
||||||
|
|
|
@ -564,6 +564,7 @@
|
||||||
*/
|
*/
|
||||||
storage.setUserInfo(user.data.result);
|
storage.setUserInfo(user.data.result);
|
||||||
storage.setHasLogin(true);
|
storage.setHasLogin(true);
|
||||||
|
storage.setAutoCp(0)
|
||||||
// 登录成功
|
// 登录成功
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "登录成功!",
|
title: "登录成功!",
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
</div>
|
</div>
|
||||||
<view class="eva-box" v-for="(item, index) in commDetail" :key="index">
|
<view class="eva-box" v-for="(item, index) in commDetail" :key="index">
|
||||||
<view class="section-info">
|
<view class="section-info">
|
||||||
<image class="portrait" :src="item.memberProfile || '/static/missing-face.png'" mode="aspectFill"></image>
|
<image class="portrait" :src="item.memberProfile || userImage" mode="aspectFill"></image>
|
||||||
<view class="star-content">
|
<view class="star-content">
|
||||||
<text class="name">{{ item.memberName | noPassByName }}</text>
|
<text class="name">{{ item.memberName | noPassByName }}</text>
|
||||||
<text class="time">{{ item.createTime }}</text>
|
<text class="time">{{ item.createTime }}</text>
|
||||||
|
@ -65,11 +65,13 @@
|
||||||
<script>
|
<script>
|
||||||
// import { getGoodsDetail } from '@/api/goods.js';
|
// import { getGoodsDetail } from '@/api/goods.js';
|
||||||
import * as membersApi from "@/api/members.js";
|
import * as membersApi from "@/api/members.js";
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
status: "loadmore", //底部刷新状态
|
status: "loadmore", //底部刷新状态
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
commentDetail: "", //评价详情
|
commentDetail: "", //评价详情
|
||||||
selectIndex: "0", //检索条件
|
selectIndex: "0", //检索条件
|
||||||
params: { // 评论分页提交数据
|
params: { // 评论分页提交数据
|
||||||
|
|
|
@ -601,10 +601,10 @@ export default {
|
||||||
|
|
||||||
linkMsgDetail () {
|
linkMsgDetail () {
|
||||||
// lili 基础客服
|
// lili 基础客服
|
||||||
this.$options.filters.talkIm(this.storeDetail.storeId)
|
// this.$options.filters.talkIm(this.storeDetail.storeId)
|
||||||
// uni.navigateTo({
|
uni.navigateTo({
|
||||||
// url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}`
|
url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}`
|
||||||
// });
|
});
|
||||||
|
|
||||||
// udesk 代码
|
// udesk 代码
|
||||||
// if (this.storeDetail.merchantEuid) {
|
// if (this.storeDetail.merchantEuid) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<view v-if="assembleOrder.length != 0">
|
<view v-if="assembleOrder.length != 0">
|
||||||
<view class="group-item" v-for="(order, index) in assembleOrder" :key="index">
|
<view class="group-item" v-for="(order, index) in assembleOrder" :key="index">
|
||||||
<view class="group-item-user">
|
<view class="group-item-user">
|
||||||
<u-image shape="circle" width="40px" height="40px" :src="order.face"></u-image>
|
<u-image shape="circle" width="40px" height="40px" :src="order.face || userImage"></u-image>
|
||||||
<span class="group-item-name">{{ order.nickName | noPassByName }}</span>
|
<span class="group-item-name">{{ order.nickName | noPassByName }}</span>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
|
@ -25,9 +25,13 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Promotions from "@/api/promotions";
|
import * as API_Promotions from "@/api/promotions";
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
|
|
||||||
customStyle: {
|
customStyle: {
|
||||||
background: this.$lightColor,
|
background: this.$lightColor,
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
|
|
|
@ -14,6 +14,14 @@ export default {
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
onShow(){
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.$refs.tpl.firstGetAuto();
|
||||||
|
},1000)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
},
|
},
|
||||||
onReachBottom(){
|
onReachBottom(){
|
||||||
// 给子级监听触底加载
|
// 给子级监听触底加载
|
||||||
|
|
|
@ -187,7 +187,6 @@ $w_94: 94%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
transition: 0.35s;
|
transition: 0.35s;
|
||||||
display: flex;
|
display: flex;
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
> .goods-item-title {
|
> .goods-item-title {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
|
@ -1,5 +1,37 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
<u-popup v-model="showCp" mode="center" width="550rpx" height="400px">
|
||||||
|
<view style="height:130rpx;">
|
||||||
|
<view style="width:200rpx;height:120rpx;float:left;line-height:120rpx;font-size:35rpx;color:#28A4F2;font-weight:600;margin-left:20rpx;">优惠券活动</view>
|
||||||
|
<view style="width:120rpx;height:120rpx;float:right;">
|
||||||
|
<image @click="showCp = false" src="/static/cpauto1.png" style="width:100%;height:100%;"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y="true" style="height: 620rpx;">
|
||||||
|
<!-- {{coupList}} -->
|
||||||
|
<view v-for="(item,index) in coupList" :key="index" >
|
||||||
|
<view class="grad1">
|
||||||
|
<view style="float:right;">
|
||||||
|
<view v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}折</view>
|
||||||
|
<view v-else>优惠金额:<span style="color:red;font-size:32rpx;">{{ item.price | unitPrice}}</span>元</view>
|
||||||
|
<view>满<span style="color:red;font-size:32rpx;">{{ item.consumeThreshold | unitPrice }}元</span>可用</view>
|
||||||
|
<view v-if="item.scopeType == 'ALL' && item.storeId == '0'">全平台</view>
|
||||||
|
<view v-if="item.scopeType == 'PORTION_GOODS_CATEGORY'">仅限品类</view>
|
||||||
|
<view v-else>{{ item.storeName == 'platform' ? '全平台' :item.storeName+'店铺' }}使用
|
||||||
|
</view>
|
||||||
|
<view v-if="item.endTime">有效期至:{{ item.endTime.split(" ")[0] }}</view>
|
||||||
|
</view>
|
||||||
|
<view style="color:white;font-size:28rpx;font-weight:500;float:left;writing-mode:vertical-rl;flex: auto;height:100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;" @click="showCp = false">
|
||||||
|
立即使用
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</u-popup>
|
||||||
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
<!-- uni 中不能使用 vue component 所以用if判断每个组件 -->
|
||||||
<div v-for="(item, index) in pageData.list" :key="index">
|
<div v-for="(item, index) in pageData.list" :key="index">
|
||||||
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
<!-- 搜索栏,如果在楼层装修顶部则会自动浮动,否则不浮动 -->
|
||||||
|
@ -59,13 +91,19 @@ import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //商品分类
|
||||||
import { getFloorData } from "@/api/home"; //获取楼层装修接口
|
import { getFloorData } from "@/api/home"; //获取楼层装修接口
|
||||||
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
import permision from "@/js_sdk/wa-permission/permission.js"; //权限工具类
|
||||||
import config from "@/config/config";
|
import config from "@/config/config";
|
||||||
|
import {getAutoCoup} from "@/api/login"
|
||||||
import tpl_notice from "@/pages/tabbar/home/template/tpl_notice"; //标题栏模块
|
import tpl_notice from "@/pages/tabbar/home/template/tpl_notice"; //标题栏模块
|
||||||
import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //标题栏模块
|
import tpl_promotions from "@/pages/tabbar/home/template/tpl_promotions_detail"; //标题栏模块
|
||||||
|
import storage from "@/utils/storage.js";
|
||||||
|
// import {receiveCoupons} from "@/api/members"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
config,
|
config,
|
||||||
|
storage,
|
||||||
|
coupList:[],
|
||||||
|
showCp:false,
|
||||||
pageData: "", //楼层页面数据
|
pageData: "", //楼层页面数据
|
||||||
isIos: "",
|
isIos: "",
|
||||||
enableLoad: false, //触底加载 针对于商品模块
|
enableLoad: false, //触底加载 针对于商品模块
|
||||||
|
@ -98,9 +136,58 @@ export default {
|
||||||
// 小程序默认分享
|
// 小程序默认分享
|
||||||
uni.showShareMenu({ withShareTicket: true });
|
uni.showShareMenu({ withShareTicket: true });
|
||||||
// #endif
|
// #endif
|
||||||
|
this.firstGetAuto()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
firstGetAuto(){
|
||||||
|
// console.log(123123213)
|
||||||
|
let data = new Date()
|
||||||
|
let datas = data.getDate()
|
||||||
|
let huors = data.getHours()
|
||||||
|
let flagCoup = storage.getAutoCp()
|
||||||
|
console.log(flagCoup)
|
||||||
|
console.log(datas)
|
||||||
|
if(storage.getAutoCp() && storage.getAutoCp() != '' && storage.getAutoCp() != undefined && storage.getAutoCp() != null){
|
||||||
|
if(Number(datas) > Number(flagCoup)){
|
||||||
|
if(Number(huors) >= 6){
|
||||||
|
storage.setAutoCp(datas)
|
||||||
|
this.getAutoCp()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.getAutoCp()
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
getAutoCp(){
|
||||||
|
let data = new Date()
|
||||||
|
let datas = data.getDate()
|
||||||
|
getAutoCoup().then(res=>{
|
||||||
|
console.log(res)
|
||||||
|
if(res.data.success){
|
||||||
|
this.coupList.push(...res.data.result)
|
||||||
|
if(this.coupList != ''){
|
||||||
|
this.showCp = true
|
||||||
|
}else{
|
||||||
|
this.showCp = false
|
||||||
|
}
|
||||||
|
storage.setAutoCp(datas)
|
||||||
|
let objs = {};
|
||||||
|
this.coupList = this.coupList.reduce((cur, next) => {
|
||||||
|
//对象去重
|
||||||
|
if (next.id != undefined) {
|
||||||
|
objs[next.id]
|
||||||
|
? ""
|
||||||
|
: (objs[next.id] = true && cur.push(next));
|
||||||
|
}
|
||||||
|
return cur;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// receiveCoupons(v){
|
||||||
|
|
||||||
|
// },
|
||||||
/**
|
/**
|
||||||
* 实例化首页数据楼层
|
* 实例化首页数据楼层
|
||||||
*/
|
*/
|
||||||
|
@ -234,4 +321,30 @@ export default {
|
||||||
.navbar-right {
|
.navbar-right {
|
||||||
padding: 0 16rpx 0 0;
|
padding: 0 16rpx 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.grad1 {
|
||||||
|
width: 500rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
background: radial-gradient(circle at right top, transparent 20rpx, #ff6b35 0) top left / 120rpx 51% no-repeat,
|
||||||
|
radial-gradient(circle at right bottom, transparent 20rpx, #ff6b35 0) bottom left /120rpx 51% no-repeat,
|
||||||
|
radial-gradient(circle at left top, transparent 20rpx, #ffffff 0) top right /380rpx 51% no-repeat,
|
||||||
|
radial-gradient(circle at left bottom, transparent 20rpx, #ffffff 0) bottom right /380rpx 51% no-repeat;
|
||||||
|
filter: drop-shadow(6rpx 6rpx 6rpx rgba(0,0,0,.3));
|
||||||
|
margin: 30rpx auto;
|
||||||
|
padding-top: 2rpx;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
padding-left: 38rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
}
|
||||||
|
// .grad2 {
|
||||||
|
// width: 100px;
|
||||||
|
// height: 120px;
|
||||||
|
// background:
|
||||||
|
// radial-gradient(circle at left bottom, transparent 10px, #28A4F2 0) top left /60px 30px no-repeat,
|
||||||
|
// radial-gradient(circle at right bottom, transparent 10px, #28A4F2 0) top right /60px 30px no-repeat,
|
||||||
|
// radial-gradient(circle at left top, transparent 10px, #EFEFF4 0) bottom left /60px 90px no-repeat,
|
||||||
|
// radial-gradient(circle at right top, transparent 10px, #EFEFF4 0) bottom right /60px 90px no-repeat;
|
||||||
|
// filter: drop-shadow(3rpx 3rpx 3rpx rgba(0,0,0,.3));
|
||||||
|
// }
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
<view class="status_bar">
|
<view class="status_bar">
|
||||||
<!-- 这里是状态栏 -->
|
<!-- 这里是状态栏 -->
|
||||||
</view>
|
</view>
|
||||||
<view class="header" @click="userDetail">
|
<view class="header" @click="userDetail">
|
||||||
<view class="head-1">
|
<view class="head-1">
|
||||||
<image :src="userInfo.face || '/static/missing-face.png'"></image>
|
<image :src="userInfo.face || userImage"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="head-2" v-if="userInfo.id">
|
<view class="head-2" v-if="userInfo.id">
|
||||||
<view class="user-name">{{ userInfo.nickName }}</view>
|
<view class="user-name">{{ userInfo.nickName }}</view>
|
||||||
|
@ -78,12 +78,15 @@
|
||||||
import tool from "@/pages/tabbar/user/utils/tool.vue";
|
import tool from "@/pages/tabbar/user/utils/tool.vue";
|
||||||
import { getCouponsNum, getFootprintNum } from "@/api/members.js";
|
import { getCouponsNum, getFootprintNum } from "@/api/members.js";
|
||||||
import { getUserWallet } from "@/api/members";
|
import { getUserWallet } from "@/api/members";
|
||||||
|
import configs from '@/config/config'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
tool,
|
tool,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
configs,
|
||||||
|
userImage:configs.defaultUserPhoto,
|
||||||
coverTransform: "translateY(0px)",
|
coverTransform: "translateY(0px)",
|
||||||
coverTransition: "0s",
|
coverTransition: "0s",
|
||||||
moving: false,
|
moving: false,
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 129 KiB |
|
@ -0,0 +1,145 @@
|
||||||
|
/**
|
||||||
|
* 动态表情
|
||||||
|
*/
|
||||||
|
const emojis = {
|
||||||
|
"[微笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/0.gif'>",
|
||||||
|
"[撇嘴]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/1.gif'>",
|
||||||
|
"[色]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/2.gif'>",
|
||||||
|
"[发呆]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/3.gif'>",
|
||||||
|
"[得意]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/4.gif'>",
|
||||||
|
"[流泪]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/5.gif'>",
|
||||||
|
"[害羞]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/6.gif'>",
|
||||||
|
"[闭嘴]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/7.gif'>",
|
||||||
|
"[睡]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/8.gif'>",
|
||||||
|
"[大哭]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/9.gif'>",
|
||||||
|
"[尴尬]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/10.gif'>",
|
||||||
|
"[发怒]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/11.gif'>",
|
||||||
|
"[调皮]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/12.gif'>",
|
||||||
|
"[呲牙]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/13.gif'>",
|
||||||
|
"[惊讶]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/14.gif'>",
|
||||||
|
"[难过]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/15.gif'>",
|
||||||
|
"[酷]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/16.gif'>",
|
||||||
|
"[冷汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/17.gif'>",
|
||||||
|
"[抓狂]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/18.gif'>",
|
||||||
|
"[吐]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/19.gif'>",
|
||||||
|
"[偷笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/20.gif'>",
|
||||||
|
"[可爱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/21.gif'>",
|
||||||
|
"[白眼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/22.gif'>",
|
||||||
|
"[傲慢]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/23.gif'>",
|
||||||
|
"[饥饿]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/24.gif'>",
|
||||||
|
"[困]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/25.gif'>",
|
||||||
|
"[惊恐]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/26.gif'>",
|
||||||
|
"[流汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/27.gif'>",
|
||||||
|
"[憨笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/28.gif'>",
|
||||||
|
"[大兵]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/29.gif'>",
|
||||||
|
"[奋斗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/30.gif'>",
|
||||||
|
"[咒骂]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/31.gif'>",
|
||||||
|
"[疑问]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/32.gif'>",
|
||||||
|
"[嘘]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/33.gif'>",
|
||||||
|
"[晕]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/34.gif'>",
|
||||||
|
"[折磨]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/35.gif'>",
|
||||||
|
"[衰]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/36.gif'>",
|
||||||
|
"[骷髅]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/37.gif'>",
|
||||||
|
"[敲打]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/38.gif'>",
|
||||||
|
"[再见]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/39.gif'>",
|
||||||
|
"[擦汗]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/40.gif'>",
|
||||||
|
"[抠鼻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/41.gif'>",
|
||||||
|
"[鼓掌]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/42.gif'>",
|
||||||
|
"[糗大了]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/43.gif'>",
|
||||||
|
"[坏笑]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/44.gif'>",
|
||||||
|
"[左哼哼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/45.gif'>",
|
||||||
|
"[右哼哼]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/46.gif'>",
|
||||||
|
"[哈欠]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/47.gif'>",
|
||||||
|
"[鄙视]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/48.gif'>",
|
||||||
|
"[委屈]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/49.gif'>",
|
||||||
|
"[快哭了]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/50.gif'>",
|
||||||
|
"[阴险]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/51.gif'>",
|
||||||
|
"[亲亲]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/52.gif'>",
|
||||||
|
"[吓]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/53.gif'>",
|
||||||
|
"[可怜]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/54.gif'>",
|
||||||
|
"[菜刀]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/55.gif'>",
|
||||||
|
"[西瓜]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/56.gif'>",
|
||||||
|
"[啤酒]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/57.gif'>",
|
||||||
|
"[篮球]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/58.gif'>",
|
||||||
|
"[乒乓]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/59.gif'>",
|
||||||
|
"[咖啡]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/60.gif'>",
|
||||||
|
"[饭]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/61.gif'>",
|
||||||
|
"[猪头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/62.gif'>",
|
||||||
|
"[玫瑰]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/63.gif'>",
|
||||||
|
"[凋谢]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/64.gif'>",
|
||||||
|
"[示爱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/65.gif'>",
|
||||||
|
"[爱心]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/66.gif'>",
|
||||||
|
"[心碎]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/67.gif'>",
|
||||||
|
"[蛋糕]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/68.gif'>",
|
||||||
|
"[闪电]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/69.gif'>",
|
||||||
|
"[炸弹]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/70.gif'>",
|
||||||
|
"[刀]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/71.gif'>",
|
||||||
|
"[足球]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/72.gif'>",
|
||||||
|
"[瓢虫]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/73.gif'>",
|
||||||
|
"[便便]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/74.gif'>",
|
||||||
|
"[月亮]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/75.gif'>",
|
||||||
|
"[太阳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/76.gif'>",
|
||||||
|
"[礼物]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/77.gif'>",
|
||||||
|
"[拥抱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/78.gif'>",
|
||||||
|
"[强]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/79.gif'>",
|
||||||
|
"[弱]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/80.gif'>",
|
||||||
|
"[握手]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/81.gif'>",
|
||||||
|
"[胜利]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/82.gif'>",
|
||||||
|
"[抱拳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/83.gif'>",
|
||||||
|
"[勾引]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/84.gif'>",
|
||||||
|
"[拳头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/85.gif'>",
|
||||||
|
"[差劲]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/86.gif'>",
|
||||||
|
"[爱你]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/87.gif'>",
|
||||||
|
"[NO]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/88.gif'>",
|
||||||
|
"[OK]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/89.gif'>",
|
||||||
|
"[爱情]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/90.gif'>",
|
||||||
|
"[飞吻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/91.gif'>",
|
||||||
|
"[跳跳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/92.gif'>",
|
||||||
|
"[发抖]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/93.gif'>",
|
||||||
|
"[怄火]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/94.gif'>",
|
||||||
|
"[转圈]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/95.gif'>",
|
||||||
|
"[磕头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/96.gif'>",
|
||||||
|
"[回头]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/97.gif'>",
|
||||||
|
"[跳绳]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/98.gif'>",
|
||||||
|
"[挥手]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/99.gif'>",
|
||||||
|
"[激动]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/100.gif'>",
|
||||||
|
"[街舞]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/101.gif'>",
|
||||||
|
"[献吻]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/102.gif'>",
|
||||||
|
"[左太极]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/103.gif'>",
|
||||||
|
"[右太极]": "<img src='https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/104.gif'>",
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 符号表情
|
||||||
|
*/
|
||||||
|
const symbol = [
|
||||||
|
"😠", "😩", "😲", "😞", "😵", "😰", "😒", "😍", "😤", "😜", "😝", "😋", "😘", "😚", "😷",
|
||||||
|
"😳", "😃", "😅", "😆", "😁", "😂", "😊", "☺", "😄", "😢",
|
||||||
|
"😭", "😨", "😣", "😡", "😌", "😖", "😔", "😱", "😪", "😏", "😓", "😥", "😫", "😉",
|
||||||
|
"✊", "✋", "✌", "👊", "👍", "☝", "👆", "👇", "👈", "👉",
|
||||||
|
"👋", "👏", "👌", "👎"
|
||||||
|
];
|
||||||
|
|
||||||
|
const emojisKeys = Object.keys(emojis);
|
||||||
|
|
||||||
|
export const emojiList = {
|
||||||
|
symbol,
|
||||||
|
emojis
|
||||||
|
}
|
||||||
|
|
||||||
|
const regEmoji = emojisKeys.map((value) => '|\\' + value).join('').replace('|', '')
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 替换表情文字
|
||||||
|
*
|
||||||
|
* @param {String} content 需要替换的字符串
|
||||||
|
*/
|
||||||
|
export function textReplaceEmoji (content) {
|
||||||
|
if (!content) {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => {
|
||||||
|
return emojis[$1];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export const emojistwo = Object.keys(emojis)
|
|
@ -6,7 +6,7 @@ export default class SocketService {
|
||||||
* 单例
|
* 单例
|
||||||
*/
|
*/
|
||||||
static instance = null;
|
static instance = null;
|
||||||
static get Instance() {
|
static get Instance () {
|
||||||
if (!this.instance) {
|
if (!this.instance) {
|
||||||
this.instance = new SocketService();
|
this.instance = new SocketService();
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,12 @@ export default class SocketService {
|
||||||
connectRetryCount = 0;
|
connectRetryCount = 0;
|
||||||
|
|
||||||
// 定义连接服务器的方法
|
// 定义连接服务器的方法
|
||||||
connect() {
|
connect () {
|
||||||
// 连接服务器
|
// 连接服务器
|
||||||
if (!window.WebSocket) {
|
if (!window.WebSocket) {
|
||||||
return console.log("您的浏览器不支持WebSocket");
|
return console.log("您的浏览器不支持WebSocket");
|
||||||
}
|
}
|
||||||
this.ws = new WebSocket(config.baseWsUrl+'/'+storage.getAccessToken());
|
this.ws = new WebSocket(config.baseWsUrl + '/' + storage.getAccessToken());
|
||||||
// 连接成功的事件
|
// 连接成功的事件
|
||||||
this.ws.onopen = () => {
|
this.ws.onopen = () => {
|
||||||
console.log("连接服务端成功");
|
console.log("连接服务端成功");
|
||||||
|
@ -54,24 +54,23 @@ export default class SocketService {
|
||||||
};
|
};
|
||||||
// 得到服务端发送过来的数据
|
// 得到服务端发送过来的数据
|
||||||
this.ws.onmessage = (msg) => {
|
this.ws.onmessage = (msg) => {
|
||||||
// console.log(msg.data)
|
|
||||||
this.registerCallBack(msg.data);
|
this.registerCallBack(msg.data);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// 回调函数的注册
|
// 回调函数的注册
|
||||||
registerCallBack(callBack) {
|
registerCallBack (callBack) {
|
||||||
// console.log("回调函数的注册", callBack);
|
// console.log("回调函数的注册", callBack);
|
||||||
this.callBackMapping = callBack;
|
this.callBackMapping = callBack;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消某一个回调函数
|
// 取消某一个回调函数
|
||||||
unRegisterCallBack(callBack) {
|
unRegisterCallBack (callBack) {
|
||||||
console.log("取消某一个回调函数", callBack);
|
console.log("取消某一个回调函数", callBack);
|
||||||
this.callBackMapping = null;
|
this.callBackMapping = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送数据的方法
|
// 发送数据的方法
|
||||||
send(data) {
|
send (data) {
|
||||||
// 判断此时此刻有没有连接成功
|
// 判断此时此刻有没有连接成功
|
||||||
if (this.connected) {
|
if (this.connected) {
|
||||||
this.sendRetryCount = 0;
|
this.sendRetryCount = 0;
|
||||||
|
|
|
@ -10,6 +10,14 @@ const FINGER_LOGIN = isDev ? "finger_login_dev" : "finger_login";
|
||||||
const CART_BACKBTN = isDev ? "cart_backbtn_dev" : "cart_backbtn";
|
const CART_BACKBTN = isDev ? "cart_backbtn_dev" : "cart_backbtn";
|
||||||
const AFTERSALE_DATA = isDev ? "aftersale_data_dev" : "aftersale_data";
|
const AFTERSALE_DATA = isDev ? "aftersale_data_dev" : "aftersale_data";
|
||||||
export default {
|
export default {
|
||||||
|
//写入自动发券
|
||||||
|
setAutoCp(val){
|
||||||
|
uni.setStorageSync('autoCp', val)
|
||||||
|
},
|
||||||
|
//获取自动发券时间
|
||||||
|
getAutoCp(){
|
||||||
|
return uni.getStorageSync('autoCp');
|
||||||
|
},
|
||||||
// 写入热门搜索时间戳
|
// 写入热门搜索时间戳
|
||||||
setHotWords(val) {
|
setHotWords(val) {
|
||||||
uni.setStorageSync("hotWords", val);
|
uni.setStorageSync("hotWords", val);
|
||||||
|
|
Loading…
Reference in New Issue