123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <template>
- <view>
- <view class="head">
- 请选择门店
- </view>
- <My_listbox ref="List" @getlist="getList" bottomHeight="70">
- <view class="item" v-for="item in list" hover-class="navigator-hover" @click="selectItem(item)"
- :key="item.sa_storeid">
- <checkbox :checked="selectList.some(v => v == item.sa_storeid)" color="#3874F6"
- style="transform:scale(0.7)" />
- <view style="flex:1">
- <view class="title u-line-1">{{ item.storename || '' }}</view>
- <view class="content">
- <view class="left">
- <view class="tag-box">
- <view class="storetype">
- {{ item.storetype }}
- </view>
- <view class="markettype">
- {{ item.markettype }}
- </view>
- </view>
- <view class="row">
- <text class="iconfont icon-renyuan-hui" />
- <text>
- {{ item.name }}
- </text>
- <text style="margin-left: 5px;">
- {{ item.phonenumber }}
- </text>
- </view>
- <view class="row">
- <text class="iconfont icon-dizhi-hui1" />
- {{ getCity(item) }}
- </view>
- <view class="row">
- 状态:<text :style="{ color: item.color }">{{ item.status }}</text>
- </view>
- </view>
- <view class="right">
- <u--image :src="item.cover" :width="tovw(100)" :height="tovw(100)" radius="5">
- <template v-slot:loading>
- <u-loading-icon color="red"></u-loading-icon>
- </template>
- </u--image>
- </view>
- </view>
- </view>
- </view>
- </My_listbox>
- <view class="footer">
- <view class="total">
- 已选:{{ selectList.length }}
- </view>
- <view class="confirm" :class="selectList.length ? '' : 'forbidden'" @click="selectList.length ? submit() : ''">
- 确定
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [],
- "content": {
- "where": {
- "condition": "",
- "storetype": "",
- "status": "审核"
- }
- },
- selectList: [],
- results: [],
- }
- },
- onLoad(options) {
- uni.setNavigationBarTitle({
- title: options.title || '选择门店'
- });
- if (options.alreadySelecteds) {
- const alreadySelecteds = JSON.parse(options.alreadySelecteds);
- this.selectList = alreadySelecteds.value;
- this.results = alreadySelecteds.value.map((v, i) => {
- return {
- sa_storeid: v,
- storename: alreadySelecteds.showValue[i]
- }
- });
- }
- this.getList()
- },
- methods: {
- getList(init = false) {
- if (this.paging(this.content, init)) return;
- this.$Http.basic({
- "id": 20240410095602,
- content: this.content
- }).then(res => {
- this.$refs.List.RefreshToComplete()
- console.log("获取门店列表", res)
- if (this.cutoff(res.msg)) return;
- res.data = res.data.map(v => {
- v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos[0], 'compressed') || uni.getStorageSync("site").logo : uni.getStorageSync("site").logo
- switch (v.status) {
- case '提交':
- v.color = '#009270'
- break;
- case '审核':
- v.color = '#095DE0'
- break;
- default:
- v.color = '#333333'
- break;
- }
- return v
- })
- this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
- this.content = this.$refs.List.paging(this.content, res)
- })
- },
- selectItem(item) {
- let index = this.selectList.findIndex(v => v == item.sa_storeid);
- if (index == -1) {
- this.selectList.push(item.sa_storeid)
- this.results.push(item)
- } else {
- this.selectList.splice(index, 1);
- this.results.splice(index, 1);
- }
- },
- submit() {
- this.$Http.routeSelected({
- value: this.selectList,
- showValue: this.results.map(v => v.storename)
- })
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- .head {
- line-height: 17px;
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-size: 12px;
- color: #666666;
- padding: 10px;
- }
- .item {
- width: 100vw;
- background: #FFFFFF;
- padding: 10px;
- box-sizing: border-box;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- .title {
- line-height: 24px;
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-weight: bold;
- font-size: 16px;
- color: #333333;
- }
- .content {
- position: relative;
- width: 100%;
- .left {
- width: 220px;
- .tag-box {
- display: flex;
- .storetype,
- .markettype {
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-size: 12px;
- color: #FFFFFF;
- height: 24px;
- line-height: 24px;
- padding: 0 4px;
- border-radius: 2px;
- margin-top: 5px;
- }
- .storetype {
- background: #095DE0;
- }
- .markettype {
- background: #FC9228;
- margin-left: 5px;
- }
- }
- .row {
- line-height: 17px;
- font-family: Source Han Sans SC, Source Han Sans SC;
- font-size: 12px;
- color: #888888;
- margin-top: 5px;
- .iconfont {
- margin-right: 5px;
- font-size: 12px;
- }
- }
- }
- .right {
- position: absolute;
- right: 0;
- bottom: 0;
- }
- }
- }
- .footer {
- position: fixed;
- bottom: 0;
- width: 100vw;
- height: 65px;
- background: #FFFFFF;
- box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
- box-sizing: border-box;
- padding: 5px 10px;
- display: flex;
- justify-content: space-between;
- .total {
- line-height: 45px;
- font-family: PingFang SC, PingFang SC;
- font-size: 14px;
- color: #333333;
- }
- .confirm {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 112px;
- height: 45px;
- background: #C30D23;
- border-radius: 5px;
- font-family: PingFang SC, PingFang SC;
- font-size: 14px;
- color: #FFFFFF;
- }
- .forbidden {
- opacity: .6;
- }
- }
- </style>
|