| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <!--
- * @Author: liuzhenlin 461480418@qq.ocm
- * @Date: 2023-01-12 11:57:48
- * @LastEditors: liuzhenlin
- * @LastEditTime: 2023-02-27 17:46:12
- * @Description: file content
- * @FilePath: \oms\pages\distributor\index.vue
- -->
- <template>
- <view class="home">
- <view class="nav">
- <view :style="{ paddingTop }">
- <view class="title" :style="[{ height }, { lineHeight: height }]">
- <view class="back" @click="goBack()">
- <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
- </view>
- <text>合作伙伴</text>
- </view>
- </view>
- </view>
- <view class="main">
- <view class="query-wrap">
- <view class="search-container">
- <view class="search-input">
- <u-input
- clearable
- placeholderStyle="font-size:26rpx"
- :customStyle="{ height: '66rpx' }"
- v-model="distName"
- prefixIcon="search"
- prefixIconStyle="font-size: 22px;color: #909399"
- placeholder="请输入经销商名称"
- shape="circle"
- border="surround"></u-input>
- </view>
- <view class="search-btn" @click="searchList">搜索</view>
- </view>
- </view>
- <u-empty v-if="customerData.length == 0" mode="list" text="暂无数据"></u-empty>
- <scroll-view :scroll-y="true" class="data-list" @scrolltolower="lower" v-else>
- <view>
- <view class="data-item" v-for="(v, i) in customerData" :key="i" @click="toDetails(v)">
- <view class="customer-name flex">
- <text class="name">{{ v.distName }}</text>
- </view>
- <view class="customer-info flex">
- <view class="info-left flex_1">
- <view class="info-row flex_l">
- <text class="info-label">所在省份:</text>
- <u-text color="#323232" size="24rpx" :text="v.provinceDesc || '-'"></u-text>
- </view>
- <view class="info-row flex_l">
- <text class="info-label">业务范围:</text>
- <u-text color="#323232" size="24rpx" :text="v.businessScope || '-'"></u-text>
- </view>
- <view class="info-row flex_l">
- <text class="info-label">归属销售:</text>
- <u-text color="#323232" size="24rpx" :text="v.belongSale || '-'"></u-text>
- </view>
- </view>
- </view>
- </view>
- <u-loadmore :status="loadStatus" />
- </view>
- </scroll-view>
- </view>
- <!-- 消息提示 -->
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- import distrApi from '../../api/base/distr'
- import to from 'await-to-js'
- export default {
- name: 'omsIndex',
- components: {},
- data() {
- return {
- height: '',
- paddingTop: '',
- pageNum: 0,
- pageSize: 10,
- customerData: [], //客户列表
- customerDataTotal: 0, //列表元素数量
- loadStatus: '', //加载状态
- distName: '', //经销商名称
- }
- },
- created() {
- const navData = uni.getMenuButtonBoundingClientRect()
- this.height = navData.height + 'px'
- this.paddingTop = navData.top + 'px'
- },
- onShow() {
- this.getOptions()
- this.searchList()
- },
- methods: {
- getOptions() {
- Promise.all([this.getDicts('cust_idy')])
- .then(([industry]) => {
- // this.levelOptions = level.data.values || []
- this.industryOptions = industry.data.values || []
- })
- .catch((err) => console.log(err))
- },
- // 确认
- confirmFilter() {
- this.searchList()
- },
- // 上拉滚动
- lower() {
- if (this.customerData.length < this.customerDataTotal && this.loadStatus != 'loading') {
- this.$u.throttle(this.getCustomerData(), 2000, false)
- }
- },
- // 查询列表
- searchList() {
- this.pageNum = 0
- this.getCustomerData(true)
- },
- async getCustomerData(reset) {
- this.loadStatus = 'loading'
- this.pageNum++
- let params = {
- distName: this.distName,
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- }
- const [err, res] = await to(distrApi.getList(params))
- if (err) {
- this.loadStatus = 'nomore'
- return
- }
- if (res && res.code == 200) {
- if (reset) {
- this.customerData = res.data.list || []
- } else {
- this.customerData = [...this.customerData, ...(res.data.list || [])]
- }
- this.customerDataTotal = res.data.total
- this.loadStatus = this.customerData.length == this.customerDataTotal ? 'nomore' : 'loadmore'
- console.log(this.loadStatus)
- } else {
- this.loadStatus = 'nomore'
- }
- },
- goBack() {
- uni.navigateBack({
- //关闭当前页面,返回上一页面或多级页面。
- delta: 1,
- })
- },
- toDetails(v) {
- uni.navigateTo({
- //保留当前页面,跳转到应用内的某个页面
- url: '/pages/distributor/details?id=' + v.id,
- })
- },
- },
- }
- </script>
- <style>
- page {
- background: #f2f3f5;
- }
- </style>
- <style lang="scss" scoped>
- .home {
- padding-top: 188rpx;
- .nav {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 284rpx;
- background: #3e7ef8;
- .title {
- position: relative;
- text-align: center;
- font-size: 32rpx;
- font-weight: bold;
- color: #ffffff;
- .back {
- position: absolute;
- top: 0;
- bottom: 0;
- margin: auto;
- left: 70rpx;
- display: flex;
- }
- }
- }
- .main {
- position: absolute;
- width: 100%;
- height: calc(100vh - 188rpx);
- background: #ffffff;
- box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
- border-radius: 31rpx 31rpx 0 0;
- padding: 0 32rpx;
- overflow: auto;
- padding-bottom: 64rpx;
- .query-wrap {
- padding-top: 20rpx;
- .search-container {
- display: flex;
- align-items: center;
- .search-input {
- flex: 1;
- }
- .search-btn {
- text-align: center;
- line-height: 60rpx;
- border-radius: 12rpx;
- width: 100rpx;
- height: 60rpx;
- font-size: 26rpx;
- margin: 0 0 0 12rpx;
- background: $u-primary;
- color: #ffffff;
- }
- }
- }
- .data-list {
- width: 100%;
- height: calc(100vh - 372rpx);
- overflow: auto;
- .data-item {
- background: rgba(242, 243, 245, 0.5);
- border-radius: 15rpx;
- padding: 28rpx 40rpx 28rpx 38rpx;
- margin-top: 32rpx;
- .customer-name {
- .name {
- flex: 1;
- color: #323232;
- font-weight: bold;
- font-size: 28rpx;
- margin-right: 12rpx;
- }
- .user-code {
- width: 180rpx;
- height: 32rpx;
- font-size: 24rpx;
- color: #323232;
- line-height: 32rpx;
- }
- }
- .customer-info {
- .info-left {
- .transfer-btn {
- margin-top: 20rpx;
- width: 150rpx;
- }
- .info-row {
- margin-top: 12rpx;
- .info-label {
- color: #646464;
- font-size: 24rpx;
- }
- }
- }
- .info-right {
- padding-top: 30rpx;
- .user-img {
- border-radius: 50%;
- width: 46rpx;
- height: 46rpx;
- }
- }
- }
- }
- }
- }
- .filter-popup {
- background: rgba(0, 0, 0, 0.8);
- position: fixed;
- width: 100%;
- height: 100%;
- left: 0;
- z-index: 1;
- .filter-wrap {
- width: 100%;
- padding: 20rpx;
- background: #ffffff;
- .filter-item {
- padding-bottom: 30rpx;
- .tit {
- font-size: 26rpx;
- color: #323232;
- font-weight: bold;
- padding-bottom: 20rpx;
- }
- .menu-list {
- display: flex;
- flex-wrap: wrap;
- .menu-item {
- margin-right: 40rpx;
- margin-bottom: 20rpx;
- }
- }
- }
- }
- .btn-box {
- width: 698rpx;
- height: 75px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- > view {
- width: 320rpx;
- height: 40px;
- border-radius: 40px;
- border: solid 1rpx #ec652b;
- align-items: center;
- justify-content: center;
- text-align: center;
- line-height: 40px;
- }
- .reset {
- color: #ec652b;
- }
- .submit {
- color: #fff;
- background-color: #ec652b;
- }
- }
- }
- }
- </style>
|