patrol_detail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="page-container">
  3. <view class="details-card">
  4. <view class="detail-item">
  5. <text class="detail-label">店铺名称</text>
  6. <text class="detail-value">{{ patrolDetails.storeName }}</text>
  7. </view>
  8. <view class="detail-item">
  9. <text class="detail-label">店主名称</text>
  10. <text class="detail-value">{{ patrolDetails.ownerName }}</text>
  11. </view>
  12. <view class="detail-item">
  13. <text class="detail-label">联系方式</text>
  14. <text class="detail-value">{{ patrolDetails.contact }}</text>
  15. </view>
  16. <view class="detail-item">
  17. <text class="detail-label">店铺地址</text>
  18. <text class="detail-value">{{ patrolDetails.address }}</text>
  19. </view>
  20. <view class="detail-item">
  21. <text class="detail-label">巡店时间</text>
  22. <text class="detail-value">{{ patrolDetails.patrolTime }}</text>
  23. </view>
  24. <view class="detail-item">
  25. <text class="detail-label">巡店人</text>
  26. <text class="detail-value">{{ patrolDetails.patrolPersonName }}</text>
  27. </view>
  28. <view class="detail-item">
  29. <text class="detail-label">巡店人账号</text>
  30. <text class="detail-value">{{ patrolDetails.patrolPersonAccount }}</text>
  31. </view>
  32. <view class="detail-item">
  33. <text class="detail-label">巡店奖励</text>
  34. <text class="detail-value reward">{{ patrolDetails.reward }}</text>
  35. </view>
  36. <view class="detail-item">
  37. <text class="detail-label">定位地址</text>
  38. <text class="detail-value">{{ patrolDetails.storeLocation }}</text>
  39. </view>
  40. <view class="detail-item">
  41. <text class="detail-label">备注</text>
  42. <text class="detail-value">{{ patrolDetails.remarks }}</text>
  43. </view>
  44. <view class="detail-item">
  45. <text class="detail-label">门头照片</text>
  46. <image
  47. class="detail-image"
  48. :src="patrolDetails.storefrontPhoto"
  49. mode="aspectFill"
  50. @click="previewImage([patrolDetails.storefrontPhoto], patrolDetails.storefrontPhoto)"
  51. ></image>
  52. </view>
  53. <view class="detail-item no-border">
  54. <text class="detail-label">陈列照片</text>
  55. <image v-for="item in patrolDetails.displayPhoto"
  56. :key="item"
  57. class="detail-image"
  58. :src="item"
  59. mode="aspectFill"
  60. @click="previewImage(patrolDetails.displayPhoto, item)"
  61. ></image>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import {getXundianDetail} from "@/api/hexiao";
  68. export default {
  69. data() {
  70. return {
  71. // 巡店详情数据
  72. patrolDetails: {
  73. storeName: '',
  74. ownerName: '',
  75. contact: '',
  76. address: '',
  77. patrolTime: '',
  78. patrolPersonName: '',
  79. patrolPersonAccount: '',
  80. reward: '',
  81. remarks: '',
  82. storefrontPhoto: '',
  83. displayPhoto: '',
  84. storeLocation:""
  85. }
  86. };
  87. },
  88. onLoad(options) {
  89. // 页面加载时,会传入一个记录的ID
  90. console.log('加载的巡店记录ID:', options.id);
  91. // 根据ID从服务器获取详情
  92. this.fetchPatrolDetails(options.id);
  93. },
  94. methods: {
  95. // 模拟从API获取数据
  96. fetchPatrolDetails(recordId) {
  97. uni.showLoading({ title: '加载中...' });
  98. getXundianDetail(recordId).then(res=>{
  99. let data = res.data;
  100. this.patrolDetails = {
  101. storeName: data.storeName,
  102. ownerName: data.storeOwnerName,
  103. contact: data.salesmanAccount,
  104. address: data.storeAddress,
  105. patrolTime: data.getTime,
  106. patrolPersonName: data.salesmanName,
  107. patrolPersonAccount: data.salesmanAccount,
  108. reward: data.point == null?"0":data.point,
  109. remarks: data.remark,
  110. // 请替换为您真实的图片URL
  111. storefrontPhoto: data.storeImg,
  112. displayPhoto: data.displayImg,
  113. storeLocation:data.storeLocation
  114. };
  115. uni.hideLoading();
  116. })
  117. // 模拟网络请求
  118. // setTimeout(() => {
  119. // this.patrolDetails = {
  120. // storeName: '超吉炫长沙旗舰店',
  121. // ownerName: '张家辉',
  122. // contact: '15975236548',
  123. // address: '湖南省长沙市洪山区珞喻路195号',
  124. // patrolTime: '2025-08-01',
  125. // patrolPersonName: '李达康',
  126. // patrolPersonAccount: '15264587523',
  127. // reward: '10积分',
  128. // remarks: '暂无',
  129. // // 请替换为您真实的图片URL
  130. // storefrontPhoto: 'https://img.js.design/assets/img/661643632cd9549b6b7f9191.jpg',
  131. // displayPhoto: 'https://img.js.design/assets/img/66164394c295b2d18361110a.jpg',
  132. // };
  133. //
  134. // }, 500);
  135. },
  136. // 图片预览
  137. previewImage(urls, currentUrl) {
  138. const previewUrls = Array.isArray(urls) ? urls.filter(url => url) : [urls].filter(url => url);
  139. uni.previewImage({
  140. urls: previewUrls,
  141. current: currentUrl
  142. });
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .page-container {
  149. min-height: 100vh;
  150. background: linear-gradient(to bottom, #e4efff, #f5f6fa 40%);
  151. padding: 30rpx;
  152. box-sizing: border-box;
  153. }
  154. .details-card {
  155. background-color: #ffffff;
  156. border-radius: 20rpx;
  157. padding: 0 40rpx;
  158. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
  159. }
  160. .detail-item {
  161. padding: 30rpx 0;
  162. border-bottom: 1rpx solid #f0f0f0;
  163. &.no-border {
  164. border-bottom: none;
  165. }
  166. }
  167. .detail-label {
  168. display: block;
  169. font-size: 28rpx;
  170. color: #666;
  171. }
  172. .detail-value {
  173. display: block;
  174. margin-top: 15rpx;
  175. font-size: 30rpx;
  176. color: #333;
  177. font-weight: 500;
  178. &.reward {
  179. color: #ff9900;
  180. }
  181. }
  182. .detail-image {
  183. width: 200rpx;
  184. height: 200rpx;
  185. border-radius: 12rpx;
  186. margin-top: 15rpx;
  187. }
  188. </style>