diff --git a/config/app.js b/config/app.js index 5d52a61..8d45329 100644 --- a/config/app.js +++ b/config/app.js @@ -23,7 +23,7 @@ switch (env) { httpApiThree = 'http://ceshi-oa.lihaink.cn' httpApiFour = 'https://worker-task.lihaink.cn' httpApiSix = 'https://new-worker.lihaink.cn' - wsApi = 'wss://shop.lihaink.cn' + wsApi = 'wss://shop.lihaink.cn' break; case 'prew': httpApi = 'https://test.shop.lihaink.cn' //预发布环境 @@ -31,7 +31,7 @@ switch (env) { httpApiThree = 'http://ceshi-oa.lihaink.cn' httpApiFour = 'https://preview-worker-task.lihaink.cn' httpApiSix = 'https://ceshi-new-wokr.lihaink.cn' - wsApi = 'wss://test.shop.lihaink.cn' + wsApi = 'wss://test.shop.lihaink.cn' break; default: httpApi = "https://crmeb-test.shop.lihaink.cn" // 测试 @@ -40,7 +40,7 @@ switch (env) { httpApiFour = 'https://ceshi-worker-task.lihaink.cn' httpApiFive = 'https://ceshi-zhibo.lihaink.cn' httpApiSix = 'https://ceshi-new-wokr.lihaink.cn' - wsApi = 'wss://crmeb-test.shop.lihaink.cn' + wsApi = 'wss://crmeb-test.shop.lihaink.cn' } const ossUrl = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public' @@ -59,26 +59,29 @@ module.exports = { HTTP_REQUEST_URL_THREE: httpApiThree, HTTP_REQUEST_URL_FOUR: httpApiFour, HTTP_REQUEST_URL_FIVE: httpApiFive, - HTTP_REQUEST_URL_SIX: httpApiSix, + HTTP_REQUEST_URL_SIX: httpApiSix, VUE_APP_WS_URL: `${wsApi}?type=user`, - VUE_APP_WS_URL_ONE:wsApi_one, + VUE_APP_WS_URL_ONE: wsApi_one, // #endif // #ifdef H5 //H5接口是浏览器地址 - HTTP_REQUEST_URL: process.env.NODE_ENV == 'development'? httpApi : window.location.protocol + "//" + window.location.host, + HTTP_REQUEST_URL: process.env.NODE_ENV == 'development' ? httpApi : window.location.protocol + "//" + window + .location.host, HTTP_REQUEST_URL_TWO: httpApiTwo, HTTP_REQUEST_URL_FIVE: httpApiFive, - HTTP_REQUEST_URL_SIX: httpApiSix, - HTTP_REQUEST_URL_FOUR: window.location.host == 'shop.lihaink.cn' ?'https://worker-task.lihaink.cn':window.location.host == 'test.shop.lihaink.cn'?'https://preview-worker-task.lihaink.cn':'https://ceshi-worker-task.lihaink.cn', + HTTP_REQUEST_URL_SIX: httpApiSix, + HTTP_REQUEST_URL_FOUR: window.location.host == 'shop.lihaink.cn' ? 'https://worker-task.lihaink.cn' : window + .location.host == 'test.shop.lihaink.cn' ? 'https://preview-worker-task.lihaink.cn' : + 'https://ceshi-worker-task.lihaink.cn', // 聊天长连接地址 VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL, // #endif openPlantGrass: openPlantGrass, - ENV: env, - OSS_URL: ossUrl, - + ENV: env, + OSS_URL: ossUrl, + HEADER: { 'content-type': 'application/json', //#ifdef H5 diff --git a/pages/users/invite_code/index.vue b/pages/users/invite_code/index.vue index 9b7ffe4..f63f585 100644 --- a/pages/users/invite_code/index.vue +++ b/pages/users/invite_code/index.vue @@ -29,14 +29,22 @@ <view class="table-title-cell">采购金额</view> <view class="table-title-cell">销售金额</view> </view> - <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">{{item.uid}}</view> - <view class="table-con-cell red">¥{{item.buy_amount}}</view> - <view class="table-con-cell green">¥{{item.sale_amount}}</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">{{item.uid}}</view> + <view class="table-con-cell red">¥{{item.buy_amount}}</view> + <view class="table-con-cell green">¥{{item.sale_amount}}</view> + </view> + </block> + <view class='loadings' @click="getList"> + <text class="iconfont icon-jiazai" v-if="!loadend"></text>{{loadTitle}} + </view> </view> - </block> + </scroll-view> </view> <view v-if="list.length == 0"> @@ -51,7 +59,9 @@ qrcode, merchantRecord } from "@/api/activity.js"; -import { Toast } from '../../../libs/uniApi'; + import { + Toast + } from '../../../libs/uniApi'; export default { components: { @@ -76,47 +86,44 @@ import { Toast } from '../../../libs/uniApi'; this.getList(); this.getUserInfo(); }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - this.getList(); - }, 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(); - } - }) - }) + }).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 = '加载更多'; @@ -178,7 +185,7 @@ import { Toast } from '../../../libs/uniApi'; <style lang="scss" scoped> page { - background-color: #F5F5F5; + background-color: #FFF3EF; } .invite { @@ -240,7 +247,6 @@ import { Toast } from '../../../libs/uniApi'; } .con { - height: calc(100vh - 544rpx); background-color: #FFF3EF; padding: 192rpx 30rpx 0; @@ -251,6 +257,36 @@ import { Toast } from '../../../libs/uniApi'; } .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; @@ -285,6 +321,7 @@ import { Toast } from '../../../libs/uniApi'; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + padding: 0 10rpx; } .red {