Forráskód Böngészése

门店列表优化、轮胎保按钮增加浮动,门店电话增加拨号

liyuan 1 hónapja
szülő
commit
2a2c1717ac
3 módosított fájl, 184 hozzáadás és 256 törlés
  1. 3 3
      pages/home/insurance/details.vue
  2. 15 6
      pages/home/insurance/index.vue
  3. 166 247
      pages/me/storeInfo.vue

+ 3 - 3
pages/home/insurance/details.vue

@@ -125,10 +125,10 @@
 					</view>
 				</view>
 			</view>
-			<debounce-button style="margin: 30rpx;"
+			<debounce-button class="goods-nav-bottom" style="margin: 30rpx;"
 				v-if="form.status==1&&form.tireInsuranceFilesList.slice(activeTab*3,activeTab*3+3).filter(item=>item.claimStatus==0).length"
 				bgColor='#03803B' @click="claim">生成保单</debounce-button>
-			<debounce-button style="margin: 30rpx;"
+			<debounce-button class="goods-nav-bottom" style="margin: 30rpx;"
 				v-if="form.status==1&&form.tireInsuranceFilesList.slice(activeTab*3,activeTab*3+3).filter(item=>item.claimStatus==0).length==0"
 				bgColor='#03803B' :readOnly="true">已生成保单</debounce-button>
 		</uni-section>
@@ -169,7 +169,7 @@
 		data() {
 			return {
 				buttonGroup: [{
-					text: '提交',
+					text: '确认信息',
 					backgroundColor: '#e64340',
 					color: '#fff'
 				}],

+ 15 - 6
pages/home/insurance/index.vue

@@ -42,7 +42,7 @@
 								<view  style="display: flex;">
 									联系人: <uni-icons type="person" size="20" color="#03803B"></uni-icons>{{item.storeContact||'暂无数据'}}
 									<uni-icons style="margin-left: 20rpx;" type="phone" size="20" color="#03803B"></uni-icons>
-									<view class="">
+									<view class="" @click.stop="clickCall(item.storePhone)" style="color: blue">
 										{{item.storePhone||'暂无数据'}}
 									</view>
 								</view>
@@ -117,11 +117,20 @@
 			}
 		},
 		methods: {
-			makeTel(tel) {
-				uni.makePhoneCall({
-					phoneNumber: tel //仅为示例
-				});
-			},
+      clickCall(tel) {
+        if (!tel) {
+          return
+        }
+        uni.makePhoneCall({
+          phoneNumber: tel,
+          success: function() {
+            console.log('拨打电话成功');
+          },
+          fail() {
+            console.log('打电话失败了');
+          }
+        })
+      },
 			onClick(row) {
 				if (row.status != 0) {
 					uni.showToast({

+ 166 - 247
pages/me/storeInfo.vue

@@ -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>