更新
This commit is contained in:
parent
28d9667b4e
commit
1fbd070b6d
74
App.vue
74
App.vue
@ -8,6 +8,10 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// #ifdef APP-PLUS
|
||||
import { initEvent } from "@/utils/uniMPevent.js";
|
||||
let jpushModule = uni.requireNativePlugin("JG-JPush");
|
||||
// #endif
|
||||
import {
|
||||
checkLogin
|
||||
} from "./libs/login";
|
||||
@ -69,7 +73,75 @@
|
||||
onLaunch: function(option) {
|
||||
uni.hideTabBar();
|
||||
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||
this.globalData.uid = this.$store.state.app.uid
|
||||
this.globalData.uid = this.$store.state.app.uid;
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
//初始化uniMP小程序发送的事件以及其他操作
|
||||
initEvent();
|
||||
// #endif
|
||||
|
||||
//#ifdef APP-PLUS
|
||||
this.checknetwork()
|
||||
|
||||
jpushModule.setLoggerEnable(true);
|
||||
jpushModule.initJPushService()
|
||||
jpushModule.addConnectEventListener(result => {
|
||||
let connectEnable = result.connectEnable
|
||||
// console.log("jpush连接", connectEnable)
|
||||
})
|
||||
|
||||
|
||||
// 设置别名
|
||||
// jpushModule.setAlias({
|
||||
// 'alias': uni.getStorageSync('userId'),
|
||||
// 'sequence': 1
|
||||
// })
|
||||
//
|
||||
// jpushModule.addTagAliasListener(result => {
|
||||
// let code = result.code
|
||||
// let sequence = result.sequence
|
||||
// let tags = result.tags
|
||||
// let tag = result.tag
|
||||
// let tagEnable = result.tagEnable
|
||||
// let alias = result.alias
|
||||
// console.log(alias, '别名')
|
||||
// })
|
||||
// 通知事件回调
|
||||
jpushModule.addNotificationListener(result => {
|
||||
let notificationEventType = result.notificationEventType
|
||||
let messageID = result.messageID
|
||||
let title = result.title
|
||||
let content = result.content
|
||||
let extras = result.extras
|
||||
|
||||
console.log("通知", result)
|
||||
|
||||
if (result.extras.type == 'ORDER_CREATE') {
|
||||
if (this.audioTeam.length > 0) {
|
||||
this.audioTeam.push(result.extras.type);
|
||||
} else {
|
||||
this.audio()
|
||||
this.audioTeam.push(result.extras.type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// 点击事件
|
||||
if (notificationEventType == 'notificationOpened') {
|
||||
uni.navigateTo({
|
||||
url: result.extras.route
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// jpushModule.addCustomMessageListener(result => {
|
||||
// let messageID = result.messageID
|
||||
// let content = result.content
|
||||
// let extras = result.extras
|
||||
// console.log("自定义消息", result)
|
||||
// })
|
||||
//#endif
|
||||
|
||||
let that = this;
|
||||
// #ifdef MP
|
||||
if (HTTP_REQUEST_URL == '') {
|
||||
|
@ -314,9 +314,9 @@ export function qrcode(data) {
|
||||
}
|
||||
|
||||
|
||||
// 生成二维码
|
||||
// 邀请记录
|
||||
export function merchantRecord(data) {
|
||||
return request.get(`merchantRecord`, data);
|
||||
return request.get(`user/merchantRecord`, data);
|
||||
}
|
||||
|
||||
|
||||
|
95
components/Loading.vue
Normal file
95
components/Loading.vue
Normal file
@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div class="popup" v-if="isShow">
|
||||
<div class="box">
|
||||
<div class="loading"></div>
|
||||
<p>{{str}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Loading',
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
str: '初始化中',
|
||||
timer: null
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
uni.$on('showLoading', (type, str) => {
|
||||
if (type == true) {
|
||||
this.isShow = true;
|
||||
this.str = str;
|
||||
} else {
|
||||
this.isShow = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
clickTow(){
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.popup-enter-active,
|
||||
.popup-leave-active {
|
||||
transition: opacity 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.popup-enter,
|
||||
.popup-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.popup {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 99999999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
.box{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
color: #eee;
|
||||
height: 300rpx;
|
||||
width: 300rpx;
|
||||
border-radius: 20rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border: 6rpx solid #eee;
|
||||
border-top-color: transparent;
|
||||
border-radius: 100%;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
animation: circle infinite 0.75s linear;
|
||||
}
|
||||
|
||||
@keyframes circle {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
@ -38,7 +38,7 @@
|
||||
<!-- tab导航 -->
|
||||
<view class="tabs" v-if="showTab">
|
||||
<block v-for="(item,indx) in tabsArr" :key="indx">
|
||||
<view v-if="indx>0" style="width: 2rpx;height: 36rpx;background-color: #ECECEC;"></view>
|
||||
<view v-if="indx>0" style="width: 3rpx;height: 36rpx;background-color: #ccc;"></view>
|
||||
<view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item" @click="changeTab(item.val)">
|
||||
<view class="tabs-item-main">{{item.name}}</view>
|
||||
<view class="tabs-item-sub">{{item.desc}}</view>
|
||||
|
@ -13,9 +13,14 @@ let VUE_APP_WS_URL = `ws://${location.hostname}?type=user`
|
||||
|
||||
let openPlantGrass = '-openPlantGrass-'
|
||||
|
||||
let httpSix, httpApi;
|
||||
|
||||
// 网络接口修改此字符 小程序域名要求https
|
||||
// let httpApi = 'http://192.168.31.106:8324' //测试
|
||||
let httpApi = 'https://test.shop.lihaink.cn' //生产
|
||||
// httpApi = 'http://192.168.31.106:8324' //测试
|
||||
httpApi = 'https://test.shop.lihaink.cn' //生产
|
||||
|
||||
httpSix = 'https://ceshi-new-wokr.lihaink.cn'
|
||||
// httpSix = 'https://new-worker.lihaink.cn'
|
||||
|
||||
// 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
|
||||
// let wsApi = 'ws://192.168.3.20:8324'
|
||||
@ -35,6 +40,7 @@ module.exports = {
|
||||
// 聊天长连接地址
|
||||
VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
|
||||
// #endif
|
||||
HTTP_REQUEST_URL_SIX: httpSix,
|
||||
openPlantGrass: openPlantGrass,
|
||||
HEADER: {
|
||||
'content-type': 'application/json',
|
||||
|
2
main.js
2
main.js
@ -18,9 +18,11 @@ import {
|
||||
import skeleton from './components/skeleton/index.vue'
|
||||
import BaseMoney from './components/BaseMoney.vue';
|
||||
import loadmore from './components/loadmore';
|
||||
import Loading from './components/Loading.vue';
|
||||
Vue.component('skeleton', skeleton)
|
||||
Vue.component('BaseMoney', BaseMoney)
|
||||
Vue.component('loadmore', loadmore)
|
||||
Vue.component('Loading', Loading)
|
||||
Vue.prototype.$util = util;
|
||||
Vue.prototype.$Cache = Cache;
|
||||
Vue.prototype.$eventHub = new Vue();
|
||||
|
@ -303,8 +303,9 @@
|
||||
"path" : "specialty/specialty",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "",
|
||||
"enablePullDownRefresh" : false
|
||||
"navigationBarTitleText" : "名优特产",
|
||||
"enablePullDownRefresh" : false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
|
@ -60,7 +60,7 @@
|
||||
height: 70rpx;
|
||||
padding: 2px 2px 2px 21.05rpx;
|
||||
border-radius: 80rpx;
|
||||
pic: #EDEFF2;
|
||||
background: #EDEFF2;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
|
||||
@ -215,12 +215,11 @@
|
||||
<view class="wholeSale-nav">
|
||||
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
|
||||
<!-- 搜索 -->
|
||||
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none"
|
||||
class="search_content flex_a_c_j_sb">
|
||||
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none" class="search_content flex_a_c_j_sb">
|
||||
<view class="flex_a_c search_content_wrap">
|
||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
||||
<input type="text" placeholder="搜索您需要批发进货的产品名称" placeholder-style="font-size: 30rpx;color:#999;"
|
||||
disabled style="pointer-events: none;">
|
||||
<input type="text" placeholder="搜索您需要批发进货的产品名称" placeholder-style="font-size: 30rpx;color:#999;" disabled
|
||||
style="pointer-events: none;">
|
||||
</view>
|
||||
<!-- <button class="search_btn">搜索</button> -->
|
||||
</navigator>
|
||||
|
@ -223,6 +223,7 @@
|
||||
</u-transition>
|
||||
</view>
|
||||
</view>
|
||||
<Loading></Loading>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -320,52 +321,11 @@
|
||||
uni.$emit('showLoading', false);
|
||||
},
|
||||
methods: {
|
||||
scrolling() {
|
||||
// 滚动条距文档顶部的距离
|
||||
let scrollTop =
|
||||
window.pageYOffset ||
|
||||
document.documentElement.scrollTop ||
|
||||
document.body.scrollTop;
|
||||
// 滚动条滚动的距离
|
||||
let scrollStep = scrollTop - this.oldScrollTop;
|
||||
// console.log("header 滚动距离 ", scrollTop);
|
||||
// 更新——滚动前,滚动条距文档顶部的距离
|
||||
this.oldScrollTop = scrollTop;
|
||||
|
||||
//变量windowHeight是可视区的高度
|
||||
let windowHeight =
|
||||
document.documentElement.clientHeight || document.body.clientHeight;
|
||||
//变量scrollHeight是滚动条的总高度
|
||||
let scrollHeight =
|
||||
document.documentElement.scrollHeight || document.body.scrollHeight;
|
||||
|
||||
//滚动条到底部的条件
|
||||
if (scrollTop + windowHeight == scrollHeight) {
|
||||
//你想做的事情
|
||||
// console.log("header 你已经到底部了");
|
||||
}
|
||||
|
||||
|
||||
if (scrollTop <= 20) {
|
||||
this.backColor = 'rgba(252, 252, 252, 0)'
|
||||
this.isFshow = false
|
||||
} else if (20 < scrollTop && scrollTop <= 100) {
|
||||
this.backColor = 'rgba(252, 252, 252, .5)'
|
||||
this.isFshow = true
|
||||
} else if (scrollTop > 100) {
|
||||
this.backColor = 'rgba(252, 252, 252, 1)'
|
||||
this.isFshow = true
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
initAllAppLet() {
|
||||
applet().then(res => {
|
||||
this.AllMenuList = res.data;
|
||||
this.initMenu();
|
||||
// this.showControllerAllLet();
|
||||
this.showControllerAllLet();
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
})
|
||||
@ -376,16 +336,8 @@
|
||||
if (typeof this.$store.state.app.userInfo == 'string') {
|
||||
user = JSON.parse(this.$store.state.app.userInfo)
|
||||
} else user = JSON.parse(JSON.stringify(this.$store.state.app.userInfo))
|
||||
if (user?.show_controller_applet) {
|
||||
this.AllMenuList.push({
|
||||
name: '大屏控制',
|
||||
icon: '/static/applet/dp.png',
|
||||
data: {
|
||||
id: '__UNI__83ABA97',
|
||||
url: 'https://ceshi-worker-task.lihaink.cn/uploads/files/20231016/20231016112144fac6d9128.wgt',
|
||||
},
|
||||
type: 4,
|
||||
})
|
||||
if (!user?.show_controller_applet) {
|
||||
this.AllMenuList = this.AllMenuList.filter(item=>item.app_id!="__UNI__83ABA97"); //隐藏大屏控制
|
||||
}
|
||||
},
|
||||
// 初始化菜单
|
||||
@ -403,7 +355,6 @@
|
||||
this.nowMenuList = now;
|
||||
} catch (e) {
|
||||
this.nowMenuList = [];
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
clickMenu(data) {
|
||||
|
@ -351,7 +351,7 @@
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="sharePacket.max&&sharePacket.max>0">
|
||||
<block v-if="sharePacket.max&&sharePacket.max>0 && false">
|
||||
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"
|
||||
:showAnimate="showAnimate" @boxStatus="boxStatus"></shareRedPackets>
|
||||
</block>
|
||||
|
@ -24,23 +24,35 @@
|
||||
|
||||
<view class="table" v-if="list.length > 0">
|
||||
<view class="table-title">
|
||||
<view class="table-title-cell" style="width: 100rpx;">序号</view>
|
||||
<view class="table-title-cell">用户名称</view>
|
||||
<view class="table-title-cell">用户ID</view>
|
||||
<view class="table-title-cell">采购金额</view>
|
||||
<view class="table-title-cell">销售金额</view>
|
||||
<view class="table-title-cell">状态</view>
|
||||
<view class="table-title-cell" style="width:32%;">采购金额</view>
|
||||
<view class="table-title-cell" style="width:32%;">销售金额</view>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y id="scrollView" @scrolltolower="scrolltolower">
|
||||
<view class="scrollView-wrap">
|
||||
<block v-for="(item,index) in list" :key="index">
|
||||
<view class="table-con">
|
||||
<view class="table-con-cell">{{item.real_name}}</view>
|
||||
<view class="table-con-cell" style="width: 100rpx;">{{index+1}}</view>
|
||||
<view class="table-con-cell">{{item.real_name || '-'}}</view>
|
||||
<view class="table-con-cell">{{item.uid}}</view>
|
||||
<view class="table-con-cell red">¥{{item.buy_amount}}</view>
|
||||
<view class="table-con-cell green">¥{{item.sale_amount}}</view>
|
||||
<view class="table-con-cell">{{item.status == 0?'未入驻':'已入驻'}}</view>
|
||||
<view class="table-con-cell red" style="width:32%;">¥{{item.buy_amount}}</view>
|
||||
<view class="table-con-cell green" style="width:32%;">¥{{item.sale_amount}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class='loadings' @click="getList">
|
||||
<text class="iconfont icon-jiazai" v-if="!loadend"></text>{{loadTitle}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<view v-if="list.length == 0">
|
||||
<emptyPage title="暂无邀请好友记录哦~" mt="60rpx" />
|
||||
<emptyPage title="暂无邀请好友记录哦~" mt="60rpx"></emptyPage>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -51,6 +63,9 @@
|
||||
qrcode,
|
||||
merchantRecord
|
||||
} from "@/api/activity.js";
|
||||
import {
|
||||
Toast
|
||||
} from '../../../libs/uniApi';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -73,41 +88,46 @@
|
||||
onLoad() {
|
||||
this.getQrcode();
|
||||
this.getList();
|
||||
this.getUserInfo()
|
||||
},
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
this.getList();
|
||||
this.getUserInfo();
|
||||
},
|
||||
|
||||
methods: {
|
||||
scrolltolower(e) {
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 获取二维码
|
||||
getQrcode() {
|
||||
qrcode().then(res => {
|
||||
this.qrcodeUrl = res.data.url;
|
||||
}).catch(err => {
|
||||
uni.showModal({
|
||||
content: '暂未开通邀请码,需开通邀请码请联系管理员',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
uni.navigateBack();
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 获取好友列表
|
||||
getList() {
|
||||
let that = this;
|
||||
if (that.loading) return;
|
||||
if (that.loadend) return;
|
||||
that.loading = true;
|
||||
that.loadTitle = '';
|
||||
merchantRecord({
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
}).then(res => {
|
||||
let list = res.data.list,
|
||||
loadend = list.length < that.limit;
|
||||
that.list = that.$util.SplitArray(list, that.list);
|
||||
that.$set(that, 'list', that.list);
|
||||
that.list = that.list.concat(list);
|
||||
that.page = that.page + 1;
|
||||
that.loading = false;
|
||||
that.loadend = loadend;
|
||||
that.loadTitle = loadend ? '哼~😕我也是有底线的~' : "加载更多";
|
||||
that.loadTitle = loadend ? '我也是有底线的~' : "加载更多";
|
||||
}, function(res) {
|
||||
this.loading = false;
|
||||
that.loadTitle = '加载更多';
|
||||
@ -169,7 +189,7 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
background-color: #FFF3EF;
|
||||
}
|
||||
|
||||
.invite {
|
||||
@ -231,7 +251,6 @@
|
||||
}
|
||||
|
||||
.con {
|
||||
height: calc(100vh - 544rpx);
|
||||
background-color: #FFF3EF;
|
||||
padding: 192rpx 30rpx 0;
|
||||
|
||||
@ -242,6 +261,36 @@
|
||||
}
|
||||
|
||||
.table {
|
||||
#scrollView {
|
||||
height: calc(100vh - 544rpx - 350rpx);
|
||||
overflow: auto;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
@keyframes rotateAnimation {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.loadings {
|
||||
display: block;
|
||||
margin-top: 30rpx;
|
||||
color: #bdbdbd;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
|
||||
.iconfont {
|
||||
margin-right: 4rpx;
|
||||
display: inline-block;
|
||||
animation: rotateAnimation 2s linear infinite;
|
||||
}
|
||||
}
|
||||
|
||||
.table-title {
|
||||
display: flex;
|
||||
margin-bottom: 24rpx;
|
||||
@ -276,6 +325,7 @@
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.red {
|
||||
|
Loading…
x
Reference in New Issue
Block a user