|
|
@@ -1,254 +1,173 @@
|
|
|
<template>
|
|
|
- <view class="container">
|
|
|
- <z-paging ref="paging" v-model="dataList" @query="getList" :fixed="false" :auto-show-back-to-top="true"
|
|
|
- :empty-view-text="searchValue ? '未找到相关结果' : '暂无数据'" :hide-empty-view="false"
|
|
|
- :auto-show-system-loading="true" class="z-paging-container">
|
|
|
- <view class="list">
|
|
|
- <view style="margin-top: 30rpx;" v-for="(item, index) in dataList" :key="index" @click="inEdit(item)">
|
|
|
- <view class="tab-bar-item">
|
|
|
- <view class="text">
|
|
|
- <view class="text_content">
|
|
|
- <text style="color: #03803B;width: 140rpx;">店铺名称:</text>
|
|
|
- <text style="color: #6A6A6A">{{item.storeName||'暂无门店'}}</text>
|
|
|
- </view>
|
|
|
- <view class="text_content">
|
|
|
- <text style="color: #03803B;width: 140rpx;">联系人:</text>
|
|
|
- <text style="color: #6A6A6A">{{item.storeContact||'暂无联系人'}}</text>
|
|
|
- </view>
|
|
|
- <view class="text_content">
|
|
|
-
|
|
|
- <text style="color: #03803B;width: 140rpx;">地址:</text>
|
|
|
- <text style="color: #6A6A6A;text-align: right;">{{item.storeAddress||'暂无地址'}}</text>
|
|
|
-
|
|
|
- </view>
|
|
|
- <view class="text_content">
|
|
|
- <text style="color: #03803B;width: 140rpx;">电话:</text>
|
|
|
- <text style="color: #6A6A6A">{{item.storePhone||'暂无电话'}}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </z-paging>
|
|
|
- <uni-popup ref="popup">
|
|
|
- <image style="width: 400rpx;height: 400rpx;background-color: #fff;" :src="imgPopup" />
|
|
|
- </uni-popup>
|
|
|
- </view>
|
|
|
+ <view class="container">
|
|
|
+ <z-paging
|
|
|
+ ref="paging"
|
|
|
+ v-model="dataList"
|
|
|
+ @query="getList"
|
|
|
+ :fixed="false"
|
|
|
+ :auto-show-back-to-top="true"
|
|
|
+ :empty-view-text="searchValue ? '未找到相关结果' : '暂无门店'"
|
|
|
+ :hide-empty-view="false"
|
|
|
+ :auto-show-system-loading="true"
|
|
|
+ class="z-paging-container"
|
|
|
+ >
|
|
|
+ <view class="list">
|
|
|
+ <view
|
|
|
+ v-for="(item, index) in dataList"
|
|
|
+ :key="index"
|
|
|
+ class="card"
|
|
|
+ @click="inEdit(item)"
|
|
|
+ >
|
|
|
+ <view class="title">{{ item.storeName || '—' }}</view>
|
|
|
+ <view class="field-item">
|
|
|
+ <text class="label">联系人:</text>
|
|
|
+ <text class="value">{{ item.storeContact || '—' }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="field-item">
|
|
|
+ <text class="label">电话:</text>
|
|
|
+ <text class="value phone" @click.stop="clickCall(item.storePhone)">
|
|
|
+ {{ item.storePhone || '—' }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="field-item">
|
|
|
+ <text class="label">地区:</text>
|
|
|
+ <text class="value">{{ item.storeAddress || '—' }}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="field-item">
|
|
|
+ <text class="label">详细地址:</text>
|
|
|
+ <text class="value detail">{{ item.storeAddressItem || '—' }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </z-paging>
|
|
|
+
|
|
|
+ <uni-popup ref="popup" type="center">
|
|
|
+ <image
|
|
|
+ :src="imgPopup"
|
|
|
+ style="width: 400rpx; height: 400rpx; background-color: #fff; border-radius: 16rpx;"
|
|
|
+ />
|
|
|
+ </uni-popup>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- getList,
|
|
|
- } from '@/api/me/storeInfo.js'
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- searchValue: null,
|
|
|
- dataList: [],
|
|
|
- imgPopup: null,
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
-
|
|
|
- },
|
|
|
- onShow() {
|
|
|
- if (uni.getStorageSync('isUpdate')) {
|
|
|
- this.$nextTick(() => {
|
|
|
- if (this.$refs.paging) {
|
|
|
- this.$refs.paging.reload();
|
|
|
- }
|
|
|
- });
|
|
|
- uni.removeStorageSync('isUpdate')
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- onClick(row) {
|
|
|
- let _this = this
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '是否确认删除?',
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- remove(row.id).then(res => {
|
|
|
- uni.showToast({
|
|
|
- title: '操作成功',
|
|
|
- icon: 'none',
|
|
|
- duration: 2000
|
|
|
- });
|
|
|
- _this.searchChange()
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- uni.hideLoading()
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- addDetails() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/home/store/details'
|
|
|
- });
|
|
|
- },
|
|
|
- inEdit(row) {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/home/store/details?id=' + row.id,
|
|
|
- });
|
|
|
- },
|
|
|
- inQR(row) {
|
|
|
- this.imgPopup = null
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中',
|
|
|
- mask: true
|
|
|
- });
|
|
|
- generateQrCode({
|
|
|
- corpId: row.id
|
|
|
- }).then(res => {
|
|
|
- // uni.previewImage({
|
|
|
- // urls: [res.data.filePath],
|
|
|
- // });
|
|
|
- this.$refs.popup.open()
|
|
|
- this.imgPopup = res.data.filePath
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- uni.hideLoading()
|
|
|
- });
|
|
|
- // uni.showToast({
|
|
|
- // title: '暂无二维码',
|
|
|
- // icon: 'none'
|
|
|
- // });
|
|
|
- },
|
|
|
- searchChange() {
|
|
|
- this.$refs.paging.reload()
|
|
|
- },
|
|
|
- async getList(pageNo, pageSize) {
|
|
|
- try {
|
|
|
- const res = await getList()
|
|
|
- this.$refs.paging.complete(res.data)
|
|
|
- } catch (e) {
|
|
|
- this.$refs.paging.complete(false)
|
|
|
- uni.showToast({
|
|
|
- title: '加载失败',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- goBack() {
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1,
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+import {getList} from '@/api/me/storeInfo.js'
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchValue: null,
|
|
|
+ dataList: [],
|
|
|
+ imgPopup: null,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ if (uni.getStorageSync('isUpdate')) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.paging?.reload();
|
|
|
+ });
|
|
|
+ uni.removeStorageSync('isUpdate');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ clickCall(phone) {
|
|
|
+ if (!phone) return;
|
|
|
+ uni.makePhoneCall({phoneNumber: phone});
|
|
|
+ },
|
|
|
+ inEdit(row) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/home/store/details?id=${row.id}`
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async getList(pageNo, pageSize) {
|
|
|
+ try {
|
|
|
+ const res = await getList({current: pageNo, size: pageSize});
|
|
|
+ const list = Array.isArray(res.data) ? res.data : res.data.records || [];
|
|
|
+ this.$refs.paging.complete(list);
|
|
|
+ } catch (e) {
|
|
|
+ this.$refs.paging.complete(false);
|
|
|
+ uni.showToast({title: '加载失败', icon: 'none'});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .scroll-view {
|
|
|
- flex: 1;
|
|
|
- height: 100%;
|
|
|
- /* 关键样式:防止内容被裁剪 */
|
|
|
- overflow-anchor: none;
|
|
|
- }
|
|
|
-
|
|
|
- .z-paging-container {
|
|
|
- width: 100%;
|
|
|
- height: 100vh;
|
|
|
- background: transparent;
|
|
|
- }
|
|
|
-
|
|
|
- .container {
|
|
|
- height: 100vh;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- }
|
|
|
-
|
|
|
- .loading,
|
|
|
- .no-more {
|
|
|
- text-align: center;
|
|
|
- padding: 20px;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
-
|
|
|
- .uni-lastmsg {
|
|
|
- width: 260rpx;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: block;
|
|
|
- /* 需明确设置display */
|
|
|
- }
|
|
|
-
|
|
|
- .uni-lastmsg2 {
|
|
|
- width: 140rpx;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- display: block;
|
|
|
- /* 需明确设置display */
|
|
|
- }
|
|
|
-
|
|
|
- .nav-right {
|
|
|
- width: 54rpx;
|
|
|
- height: 54rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .list {
|
|
|
- width: 100%;
|
|
|
-
|
|
|
- .tab-bar-item {
|
|
|
- background-color: #fff;
|
|
|
- padding: 30rpx 62rpx;
|
|
|
- display: flex;
|
|
|
-
|
|
|
- .text {
|
|
|
- padding: 0rpx 17rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
- // height: 140rpx;
|
|
|
- width: 100%;
|
|
|
- .text_title {
|
|
|
- display: flex;
|
|
|
- height: 44rpx;
|
|
|
- font-weight: 500;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #6A6A6A;
|
|
|
- justify-content: space-between;
|
|
|
- }
|
|
|
-
|
|
|
- .text_content {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- font-size: 28rpx;
|
|
|
- font-weight: 500;
|
|
|
- }
|
|
|
-
|
|
|
- .text_foot {
|
|
|
- font-size: 28rpx;
|
|
|
- justify-content: space-between;
|
|
|
- font-weight: 500;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .menu {
|
|
|
- position: absolute;
|
|
|
- right: 62rpx;
|
|
|
-
|
|
|
- .edit {
|
|
|
- margin-top: 10rpx;
|
|
|
- width: 30rpx;
|
|
|
- height: 33rpx;
|
|
|
- }
|
|
|
-
|
|
|
- .QR {
|
|
|
- margin-top: 54rpx;
|
|
|
- width: 30rpx;
|
|
|
- height: 31rpx;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-</style>
|
|
|
+.container {
|
|
|
+ height: 100vh;
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ padding: 24rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.z-paging-container {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.list {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.card {
|
|
|
+ background: #ffffff;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 24rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.08);
|
|
|
+ border: 1rpx solid #e9ecef;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #222;
|
|
|
+ line-height: 1.3;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ word-break: break-word;
|
|
|
+ }
|
|
|
+
|
|
|
+ .field-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ margin-bottom: 12rpx;
|
|
|
+ line-height: 1.4;
|
|
|
+ }
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #888;
|
|
|
+ width: 140rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ text-align: left;
|
|
|
+ letter-spacing: 0.5rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333;
|
|
|
+ flex: 1;
|
|
|
+ word-break: break-word;
|
|
|
+ overflow-wrap: break-word;
|
|
|
+ min-width: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .phone {
|
|
|
+ color: #03803b;
|
|
|
+ text-decoration: underline;
|
|
|
+ font-weight: 500;
|
|
|
+ display: inline-block;
|
|
|
+ padding: 4rpx 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .detail {
|
|
|
+ color: #555;
|
|
|
+ font-size: 26rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|