|
|
@@ -0,0 +1,262 @@
|
|
|
+<template>
|
|
|
+ <div class="app-main app-content">
|
|
|
+ <view class="input-wrap_box">
|
|
|
+ <view>
|
|
|
+ <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <block v-if="!$util.isEmpty(list.data)">
|
|
|
+ <block v-for="(item, index) in list.data" :key="index">
|
|
|
+ <tui-list-cell :arrow="true" @click="selectCurrent(item)">
|
|
|
+ <div class="tui-msg-box">
|
|
|
+ <img :src="`${constant.imgUrl}/default-img.png`" class="tui-msg-pic" mode="widthFix" />
|
|
|
+ <div class="tui-msg-item">
|
|
|
+ <div class="tui-msg-name">
|
|
|
+ <div class="tui-user-name">{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </tui-list-cell>
|
|
|
+ </block>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <app-wrapper-empty :is-empty="$util.isEmpty(list.data)" />
|
|
|
+ </block>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+import BadgeModule from "@/components/plugin/badge";
|
|
|
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
+import appVipModule from "@/components/module/app-vip";
|
|
|
+import AppTag from "@/components/module/app-tag.vue";
|
|
|
+import AppSearchModule from "@/components/module/app-search";
|
|
|
+import { list } from "@/mixins";
|
|
|
+import { getKindList } from "@/api/kind";
|
|
|
+export default {
|
|
|
+ name: "selectKind",
|
|
|
+ components: {
|
|
|
+ TuiListCell,
|
|
|
+ BadgeModule,
|
|
|
+ AppWrapperEmpty,
|
|
|
+ appVipModule,
|
|
|
+ AppTag,
|
|
|
+ AppSearchModule
|
|
|
+ },
|
|
|
+ mixins: [list],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tabIndex: 0,
|
|
|
+ selectStyle:1
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onPullDownRefresh() {
|
|
|
+ this.resetList();
|
|
|
+ this.getKindData().then((res) => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this.getKindData().then((res) => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ selectCurrent(item){
|
|
|
+ let style = this.option.style ? this.option.style : 1
|
|
|
+ this.selectStyle = style
|
|
|
+ if(style == 1){
|
|
|
+ this.$util.pageTo({url: '/admin/goods/cgNewPlant',type:2,query: {kindId: item.id,kindName:item.name}})
|
|
|
+ }else if(style == 2){
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let prevPage = pages[ pages.length - 2 ];
|
|
|
+ prevPage.$vm.form.customId = item.id;
|
|
|
+ prevPage.$vm.form.customName = item.name;
|
|
|
+ uni.navigateBack({})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ init() {
|
|
|
+ if(!this.no_shop_show_model) {
|
|
|
+ this.getKindData();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ searchFn(e) {
|
|
|
+ this.resetList();
|
|
|
+ this.seekVal = e;
|
|
|
+ this.getKindData();
|
|
|
+ },
|
|
|
+ getKindData() {
|
|
|
+ return getKindList({ search: "", type:this.tabIndex, page: this.list.page, name: this.seekVal, }).then((res) => {
|
|
|
+ this.completes(res)
|
|
|
+ if (this.$util.isEmpty(res.data)){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ change(e) {
|
|
|
+ if (this.tabIndex == e.index) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.tabIndex = e.index
|
|
|
+ this.resetList()
|
|
|
+ this.getKindData()
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.app-content {
|
|
|
+ padding-top: 100upx;
|
|
|
+ padding-bottom: 20upx;
|
|
|
+}
|
|
|
+.tabs-wrap {
|
|
|
+ position: fixed;
|
|
|
+ .tabs-left {
|
|
|
+ width: 80%;
|
|
|
+ }
|
|
|
+ .tabs-right {
|
|
|
+ width: 19%;
|
|
|
+ border-left: $borderColor;
|
|
|
+ @include disFlex(center, center);
|
|
|
+ }
|
|
|
+}
|
|
|
+.input-wrap_box {
|
|
|
+ background-color: #fff;
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ z-index: 10;
|
|
|
+ /* 手机mobile屏幕小于1000px */
|
|
|
+ @media screen and (max-width: 1100px) {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ /* 收银台cashier屏幕大于1000px */
|
|
|
+ @media screen and (min-width:1100px) {
|
|
|
+ width: 40%;
|
|
|
+ }
|
|
|
+ height: 100upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 30upx;
|
|
|
+ & > view:nth-child(1) {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
+.tui-msg-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .tui-msg-pic {
|
|
|
+ width: 80upx;
|
|
|
+ height: 80upx;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-right: 20upx;
|
|
|
+ }
|
|
|
+ .tui-msg-item {
|
|
|
+ max-width: 500upx;
|
|
|
+ min-height: 80upx;
|
|
|
+ overflow: hidden;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ & > div {
|
|
|
+ @include disFlex(center, flex-start);
|
|
|
+ & > div:first-child {
|
|
|
+ margin-right: 8upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .level-img {
|
|
|
+ /deep/.vip-text {
|
|
|
+ left: 70upx;
|
|
|
+ top: 8upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .normal-img {
|
|
|
+ width: 70upx;
|
|
|
+ padding: 2upx 6upx;
|
|
|
+ color: #999;
|
|
|
+ background-color: #f0f2f6;
|
|
|
+ border-radius: 20upx;
|
|
|
+ .vip-text {
|
|
|
+ font-size: 24upx;
|
|
|
+ transform: scale(0.6);
|
|
|
+ position: relative;
|
|
|
+ top: -2upx;
|
|
|
+ left: -8upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .member-img {
|
|
|
+ width: 70upx;
|
|
|
+ padding: 2upx 6upx;
|
|
|
+ color: green;
|
|
|
+ background-color: #f0f2f6;
|
|
|
+ border-radius: 20upx;
|
|
|
+ .vip-text {
|
|
|
+ font-size: 24upx;
|
|
|
+ transform: scale(0.6);
|
|
|
+ position: relative;
|
|
|
+ top: -2upx;
|
|
|
+ left: -8upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .iconfont {
|
|
|
+ color: #00aaed;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tui-msg-name {
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ font-size: 30upx;
|
|
|
+ line-height: 1;
|
|
|
+ color: #262b3a;
|
|
|
+ .tui-user-name {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ width: 290upx;
|
|
|
+ font-size: 32upx;
|
|
|
+ margin-top:23upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tui-msg-content {
|
|
|
+ width:500upx;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ font-size: 24upx;
|
|
|
+ line-height: 1;
|
|
|
+ color: #9397a4;
|
|
|
+ .debt-amount{
|
|
|
+ margin-left:20upx;
|
|
|
+ .amount_num{
|
|
|
+ color:red;
|
|
|
+ margin-left:5upx;
|
|
|
+ font-weight:bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.tui-msg-right {
|
|
|
+ max-width: 120upx;
|
|
|
+ height: 80upx;
|
|
|
+ margin-left: auto;
|
|
|
+ margin-right: 24upx;
|
|
|
+ text-align: right;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.user_tag {
|
|
|
+ border: 1upx solid #cccccc;
|
|
|
+ padding: 5upx 12upx 5upx 12upx;
|
|
|
+ border-radius: 25upx;
|
|
|
+ color: #bbbbbb;
|
|
|
+ margin-right: 10upx;
|
|
|
+ margin-bottom: 12upx;
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 30upx;
|
|
|
+}
|
|
|
+</style>
|