pageTwo.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. <template>
  2. <view class="page-container">
  3. <view class="card_wrap">
  4. <view class="address-section">
  5. <view class="address-header">
  6. <u-icon name="map" size="36rpx" color="#108cff" class="location-icon"></u-icon>
  7. <text class="address-title">上门地址</text>
  8. </view>
  9. <view class="address-content">
  10. <text class="address-text">北京市朝阳区建国路88号SOHO现代城A座2301室</text>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="card_wrap checklist-card">
  15. <view class="checklist-section">
  16. <u-checkbox-group v-model="selectedCheckbox" placement="column">
  17. <view class="checklist-item">
  18. <view class="checkbox-text-container">
  19. <u-checkbox name="contact师傅" size="40rpx" color="#108cff" />
  20. <text class="checklist-text">联系师傅</text>
  21. </view>
  22. <u-input v-if="selectedCheckbox.includes('contact师傅')" v-model="formData.contactPhone"
  23. placeholder="请输入师傅手机号" size="default" class="checklist-input" />
  24. </view>
  25. <view class="checklist-item">
  26. <view class="checkbox-text-container">
  27. <u-checkbox name="photo技巧" size="40rpx" color="#108cff" />
  28. <text class="checklist-text">师傅拍图技巧</text>
  29. </view>
  30. <u-input v-if="selectedCheckbox.includes('photo技巧')" v-model="formData.photoTips"
  31. type="textarea" placeholder="请输入拍图技巧" rows="3" class="checklist-textarea" />
  32. <!-- 上传图片按钮 -->
  33. <view v-if="selectedCheckbox.includes('photo技巧')" class="upload-btn-container">
  34. <div class="upload-btn" @click="getImageUrl('')">
  35. <u-icon name="camera" size="32rpx" color="#108cff"></u-icon>
  36. <text class="upload-btn-text">上传图片</text>
  37. </div>
  38. </view>
  39. <!-- 图片显示区域 -->
  40. <view v-if="selectedCheckbox.includes('photo技巧') && photoTipsImages.length > 0"
  41. class="image-list">
  42. <view v-for="(image, index) in photoTipsImages" :key="index" class="image-item"
  43. @click="previewImageHandler(image, 'photoTips')">
  44. <image :src="image" mode="aspectFill" class="image-thumb"></image>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="checklist-item">
  49. <view class="checkbox-text-container">
  50. <u-checkbox name="face2face" size="40rpx" color="#108cff" />
  51. <text class="checklist-text">到达客户面对面</text>
  52. </view>
  53. <u-input v-if="selectedCheckbox.includes('face2face')" v-model="formData.face2faceNotes"
  54. type="textarea" placeholder="请输入备注信息" rows="3" class="checklist-textarea" />
  55. <!-- 上传图片按钮 -->
  56. <view v-if="selectedCheckbox.includes('face2face')" class="upload-btn-container">
  57. <div class="upload-btn" @click="getImageUrl('')">
  58. <u-icon name="camera" size="32rpx" color="#108cff"></u-icon>
  59. <text class="upload-btn-text">上传图片</text>
  60. </div>
  61. </view>
  62. <!-- 图片显示区域 -->
  63. <view v-if="selectedCheckbox.includes('face2face') && face2faceImages.length > 0"
  64. class="image-list">
  65. <view v-for="(image, index) in face2faceImages" :key="index" class="image-item"
  66. @click="previewImageHandler(image, 'face2face')">
  67. <image :src="image" mode="aspectFill" class="image-thumb"></image>
  68. </view>
  69. </view>
  70. </view>
  71. </u-checkbox-group>
  72. </view>
  73. </view>
  74. <!-- 新添加的数字选择器卡片 -->
  75. <view class="card_wrap price-card">
  76. <view class="price-section">
  77. <view class="price-picker-container">
  78. <!-- 上方快速操作按钮 -->
  79. <view class="quick-actions top-actions">
  80. <div class="quick-btn increase" @click="quickChangePrice(100)">+100</div>
  81. <div class="quick-btn increase" @click="quickChangePrice(1000)">+1000</div>
  82. </view>
  83. <!-- 数字选择器 -->
  84. <view class="number-box-container">
  85. <view class="price-input-box">
  86. <text class="price-label">核准价¥</text>
  87. <input type="number" v-model="approvedPrice" class="price-input" placeholder="0" min="0"
  88. @input="onPriceInput" />
  89. </view>
  90. </view>
  91. <!-- 下方快速操作按钮 -->
  92. <view class="quick-actions bottom-actions">
  93. <div class="quick-btn decrease" @click="quickChangePrice(-100)">-100</div>
  94. <div class="quick-btn decrease" @click="quickChangePrice(-1000)">-1000</div>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 新添加的高清细节图上传卡片 -->
  100. <view class="card_wrap detail-image-card">
  101. <view class="detail-image-section">
  102. <div class="detail-image-header">
  103. <div class="detail-image-title">上传高清细节图(支持多选)</div>
  104. <div class="copy-btn" @click="copyAllDetailImages">
  105. <text>一键复制</text>
  106. </div>
  107. </div>
  108. <div class="detail-image-upload-container">
  109. <view class="detail-image-list">
  110. <view class="detail-image-item" v-for="(item, index) in detailImages" :key="'detail-' + index">
  111. <pic-comp :src="item.fileUrl"></pic-comp>
  112. <view class="detail-delete-btn" @click="deleteImage(item)">×</view>
  113. </view>
  114. <view class="detail-upload-btn" @click="uploadImage('detailImages')">
  115. <u-icon name="plus" size="40rpx" color="#999"></u-icon>
  116. </view>
  117. </view>
  118. </div>
  119. </view>
  120. </view>
  121. <u-button @click="handleNextClick" type="primary" size="middle" style="border-radius: 20rpx;">下一步</u-button>
  122. </view>
  123. </template>
  124. <script>
  125. import picComp from './picComp.vue'
  126. import imgUploadAndDownLoad from '../mixin/imgUploadAndDownLoad'
  127. export default {
  128. mixins: [imgUploadAndDownLoad],
  129. props: {
  130. orderDetail: {
  131. type: Object,
  132. default: () => { },
  133. },
  134. orderId: {
  135. type: String,
  136. default: '',
  137. },
  138. followUpList: {
  139. type: Object,
  140. default: () => { },
  141. }
  142. },
  143. watch: {
  144. orderDetail: {
  145. handler(newVal) {
  146. if (newVal) {
  147. this.approvedPrice = newVal.itemPrice || 0;
  148. this.getList('2', '3');
  149. }
  150. },
  151. deep: true,
  152. },
  153. },
  154. components: {
  155. picComp
  156. },
  157. data() {
  158. return {
  159. selectedCheckbox: [],
  160. formData: {
  161. contactPhone: '',
  162. photoTips: '',
  163. face2faceNotes: ''
  164. },
  165. // 图片相关数据
  166. photoTipsImages: [], // 师傅技巧图片数组
  167. face2faceImages: [], // 到达客户面对面图片数组
  168. // 全屏预览相关
  169. previewImage: '', // 当前预览的图片
  170. showPreview: false, // 是否显示全屏预览
  171. // 核准价格相关
  172. approvedPrice: 0, // 核准价格初始值
  173. // 高清细节图相关
  174. detailImages: [],// 高清细节图数组
  175. // 绑定订单相关
  176. bindList: [],// 待绑定的图片列表,
  177. };
  178. },
  179. methods: {
  180. // 价格输入回调
  181. onPriceInput(e) {
  182. // 确保价格是数字且不小于0
  183. let value = Number(e.detail.value);
  184. if (isNaN(value)) value = 0;
  185. value = Math.max(0, value);
  186. this.approvedPrice = value;
  187. },
  188. // 快速调整价格
  189. quickChangePrice(amount) {
  190. let newPrice = this.approvedPrice + amount;
  191. // 确保价格不小于0
  192. newPrice = Math.max(0, newPrice);
  193. this.approvedPrice = newPrice;
  194. },
  195. // 复制所有高清细节图链接
  196. copyAllDetailImages() {
  197. },
  198. // 下一步按钮点击事件
  199. handleNextClick() {
  200. // 创建一个只包含被勾选checkbox对应数据的对象
  201. const result = {};
  202. // 检查联系师傅
  203. if (this.selectedCheckbox.includes('contact师傅')) {
  204. result.contactPhone = this.formData.contactPhone;
  205. }
  206. // 检查师傅拍图技巧
  207. if (this.selectedCheckbox.includes('photo技巧')) {
  208. result.photoTips = this.formData.photoTips;
  209. result.photoTipsImages = this.photoTipsImages;
  210. }
  211. // 检查到达客户面对面
  212. if (this.selectedCheckbox.includes('face2face')) {
  213. result.face2faceNotes = this.formData.face2faceNotes;
  214. result.face2faceImages = this.face2faceImages;
  215. }
  216. // 添加其他非checkbox控制的字段
  217. result.approvedPrice = this.approvedPrice;
  218. result.detailImages = this.detailImages;
  219. // result.selectedCheckbox = this.selectedCheckbox;
  220. // 打印结果对象
  221. // console.log('当前界面的选中值:', result);
  222. this.$emit('handleNextClick', {
  223. nowPage: 'formTwo',
  224. form: result,
  225. })
  226. },
  227. }
  228. };
  229. </script>
  230. <style scoped lang="scss">
  231. // 导入公共样式
  232. @import './common.scss';
  233. // 主样式
  234. .page-container {
  235. box-sizing: border-box;
  236. padding: 0;
  237. background-color: map-get($colors, bg);
  238. font-family: map-get($font, family);
  239. -webkit-font-smoothing: map-get($font, smoothing);
  240. font-smoothing: map-get($font, smoothing);
  241. }
  242. .card_wrap {
  243. @include card;
  244. margin-bottom: 20rpx;
  245. &:hover {
  246. @include shadow(2);
  247. }
  248. &.checklist-card,
  249. &.price-card,
  250. &.detail-image-card {
  251. margin-top: 20rpx;
  252. }
  253. }
  254. .address-section {
  255. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  256. }
  257. .address-header {
  258. @include flex-center;
  259. margin-bottom: map-get($sizes, margin-sm);
  260. padding-bottom: map-get($sizes, margin-sm);
  261. border-bottom: 1rpx solid map-get($colors, border);
  262. .location-icon {
  263. margin-right: map-get($sizes, margin-xs);
  264. background-color: map-get($colors, primary-light);
  265. padding: map-get($sizes, icon-padding);
  266. border-radius: 50%;
  267. flex-shrink: 0;
  268. }
  269. .address-title {
  270. margin-left: 16rpx;
  271. }
  272. }
  273. .address-content {
  274. .address-text {
  275. @include font-styles;
  276. }
  277. }
  278. // 复选框卡片样式
  279. .checklist-card {
  280. margin-top: 20rpx;
  281. }
  282. .checklist-section {
  283. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  284. display: block;
  285. /* 明确设置为块级元素,避免任何flex影响 */
  286. }
  287. .checklist-item {
  288. display: block;
  289. /* 明确设置为块级元素,确保垂直排列 */
  290. width: 100%;
  291. /* 确保占满整个宽度 */
  292. padding: 16rpx 0;
  293. border-bottom: 1rpx solid map-get($colors, border);
  294. margin-bottom: 0;
  295. /* 移除任何可能的margin影响 */
  296. &:first-child {
  297. padding-top: 0;
  298. }
  299. &:last-child {
  300. padding-bottom: 0;
  301. border-bottom: none;
  302. }
  303. // 复选框和文本的容器
  304. .checkbox-text-container {
  305. @include flex-center;
  306. display: flex;
  307. align-items: center;
  308. }
  309. }
  310. // u-checkbox样式调整
  311. u-checkbox {
  312. margin-right: 16rpx;
  313. flex-shrink: 0;
  314. vertical-align: middle;
  315. }
  316. // 隐藏原生checkbox样式
  317. .checkbox {
  318. display: none;
  319. }
  320. .checklist-text {
  321. @include font-styles;
  322. vertical-align: middle;
  323. }
  324. // 输入框样式
  325. .checklist-input,
  326. .checklist-textarea {
  327. margin-top: 12rpx;
  328. margin-left: 56rpx; // 与复选框对齐
  329. width: calc(100% - 72rpx); // 减去左边距和额外的16rpx边距,确保不超出边界
  330. max-width: calc(100% - 72rpx); // 确保最大宽度也不超出
  331. box-sizing: border-box; // 确保padding和border不影响总宽度
  332. border-radius: 8rpx;
  333. border: 1rpx solid #e5e7eb;
  334. padding: 12rpx 16rpx;
  335. font-size: 28rpx;
  336. background-color: #f9fafb;
  337. transition: all 0.2s ease;
  338. &:focus {
  339. border-color: map-get($colors, primary);
  340. background-color: #ffffff;
  341. box-shadow: 0 0 0 2rpx rgba(16, 140, 255, 0.1);
  342. }
  343. }
  344. .checklist-textarea {
  345. min-height: 160rpx;
  346. resize: vertical;
  347. vertical-align: top;
  348. padding-top: 16rpx;
  349. padding-bottom: 16rpx;
  350. }
  351. // 解决textarea文本和placeholder居中问题
  352. // 直接穿透u-input组件的所有层级
  353. :deep(.checklist-textarea) {
  354. & .u-input__textarea {
  355. display: block !important;
  356. height: auto !important;
  357. min-height: 160rpx !important;
  358. padding: 16rpx !important;
  359. text-align: left !important;
  360. }
  361. & .u-input__textarea textarea {
  362. display: block !important;
  363. width: 100% !important;
  364. height: auto !important;
  365. min-height: 128rpx !important;
  366. padding: 0 !important;
  367. margin: 0 !important;
  368. text-align: left !important;
  369. vertical-align: top !important;
  370. line-height: 1.5 !important;
  371. resize: vertical !important;
  372. }
  373. // 确保输入的文本顶部对齐
  374. & .u-input__textarea textarea:focus {
  375. text-align: left !important;
  376. vertical-align: top !important;
  377. }
  378. // 针对不同浏览器的placeholder样式
  379. & .u-input__textarea textarea::-webkit-input-placeholder {
  380. text-align: left !important;
  381. vertical-align: top !important;
  382. line-height: 1.5 !important;
  383. }
  384. & .u-input__textarea textarea::-moz-placeholder {
  385. text-align: left !important;
  386. vertical-align: top !important;
  387. line-height: 1.5 !important;
  388. }
  389. & .u-input__textarea textarea:-ms-input-placeholder {
  390. text-align: left !important;
  391. vertical-align: top !important;
  392. line-height: 1.5 !important;
  393. }
  394. & .u-input__textarea textarea::placeholder {
  395. text-align: left !important;
  396. vertical-align: top !important;
  397. line-height: 1.5 !important;
  398. }
  399. }
  400. // 上传按钮容器样式
  401. .upload-btn-container {
  402. margin-top: 16rpx;
  403. margin-left: 56rpx;
  404. display: inline-block;
  405. }
  406. // 上传按钮样式
  407. .upload-btn {
  408. display: flex;
  409. align-items: center;
  410. justify-content: center;
  411. gap: 12rpx;
  412. font-size: 30rpx;
  413. padding: 20rpx 40rpx;
  414. border-radius: 8rpx;
  415. background-color: map-get($colors, bg);
  416. border: 2rpx dashed map-get($colors, primary);
  417. color: map-get($colors, primary);
  418. transition: all 0.3s ease;
  419. cursor: pointer;
  420. min-width: 200rpx;
  421. box-sizing: border-box;
  422. &:hover {
  423. background-color: map-get($colors, primary-light);
  424. border-color: darken(map-get($colors, primary), 10%);
  425. transform: translateY(-2rpx);
  426. box-shadow: 0 4rpx 16rpx rgba(16, 140, 255, 0.15);
  427. }
  428. &:active {
  429. transform: translateY(0);
  430. }
  431. }
  432. .upload-btn-text {
  433. color: map-get($colors, primary);
  434. @include font-styles($size: small, $weight: medium);
  435. }
  436. // 图片列表样式
  437. .image-list {
  438. margin-top: 16rpx;
  439. margin-left: 56rpx;
  440. display: flex;
  441. flex-wrap: wrap;
  442. gap: 16rpx;
  443. padding-bottom: 8rpx;
  444. }
  445. // 图片项样式
  446. .image-item {
  447. width: 120rpx;
  448. height: 120rpx;
  449. border-radius: 8rpx;
  450. overflow: hidden;
  451. background-color: map-get($colors, bg);
  452. @include shadow(1);
  453. transition: all 0.3s ease;
  454. cursor: pointer;
  455. position: relative;
  456. &:hover {
  457. @include shadow(2);
  458. transform: translateY(-2rpx);
  459. }
  460. }
  461. // 图片缩略图样式
  462. .image-thumb {
  463. width: 100%;
  464. height: 100%;
  465. object-fit: cover;
  466. }
  467. // 价格卡片样式
  468. .price-card {
  469. margin-top: 20rpx;
  470. }
  471. .price-section {
  472. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  473. }
  474. .detail-image-card {
  475. margin-top: 20rpx;
  476. }
  477. .detail-image-section {
  478. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  479. }
  480. .detail-image-header {
  481. display: flex;
  482. justify-content: space-between;
  483. align-items: center;
  484. margin-bottom: map-get($sizes, margin-sm);
  485. padding-bottom: map-get($sizes, margin-sm);
  486. border-bottom: 1rpx solid map-get($colors, border);
  487. }
  488. .detail-image-title {
  489. @include font-styles($size: content, $weight: bold, $color: primary);
  490. }
  491. .copy-btn {
  492. border-radius: 20rpx;
  493. border: 1rpx solid #007AFF;
  494. background-color: transparent;
  495. color: #007AFF;
  496. @include font-styles($size: small, $weight: regular);
  497. padding: 0 24rpx;
  498. height: 64rpx;
  499. line-height: 64rpx;
  500. display: flex;
  501. align-items: center;
  502. gap: 8rpx;
  503. cursor: pointer;
  504. user-select: none;
  505. transition: all 0.3s ease;
  506. &:hover {
  507. background-color: rgba(0, 122, 255, 0.05);
  508. }
  509. &:active {
  510. transform: scale(0.98);
  511. }
  512. }
  513. .detail-image-upload-container {
  514. margin-top: 20rpx;
  515. }
  516. .detail-image-list {
  517. display: flex;
  518. flex-wrap: wrap;
  519. gap: 20rpx;
  520. }
  521. .detail-image-item {
  522. position: relative;
  523. width: 200rpx;
  524. height: 200rpx;
  525. box-sizing: border-box;
  526. }
  527. .detail-delete-btn {
  528. position: absolute;
  529. top: -10rpx;
  530. right: -10rpx;
  531. width: 40rpx;
  532. height: 40rpx;
  533. background-color: #ff4d4f;
  534. color: #fff;
  535. border-radius: 50%;
  536. display: flex;
  537. align-items: center;
  538. justify-content: center;
  539. @include font-styles($size: small, $weight: bold);
  540. z-index: 10;
  541. }
  542. .detail-upload-btn {
  543. width: 200rpx;
  544. height: 200rpx;
  545. border: 8rpx dashed #ddd;
  546. border-radius: 30rpx;
  547. display: flex;
  548. align-items: center;
  549. justify-content: center;
  550. background-color: #f9f9f9;
  551. box-sizing: border-box;
  552. }
  553. .price-picker-container {
  554. display: flex;
  555. flex-direction: column;
  556. align-items: center;
  557. padding: 20rpx 0;
  558. }
  559. // 快速操作按钮样式
  560. .quick-actions {
  561. display: flex;
  562. justify-content: center;
  563. gap: 16rpx;
  564. margin: 16rpx 0;
  565. width: 100%;
  566. max-width: 800rpx;
  567. }
  568. .quick-btn {
  569. flex: 1;
  570. border-radius: 12rpx;
  571. font-size: 36rpx;
  572. padding: 32rpx 0;
  573. min-width: 0;
  574. text-align: center;
  575. color: #ffffff;
  576. font-weight: 600;
  577. transition: all 0.3s ease;
  578. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  579. cursor: pointer;
  580. }
  581. .quick-btn.increase {
  582. background-color: #e6f7ed;
  583. color: #00b42a;
  584. }
  585. .quick-btn.decrease {
  586. background-color: #fff1f0;
  587. color: #f53f3f;
  588. }
  589. .quick-btn:hover {
  590. opacity: 0.9;
  591. transform: translateY(-2rpx);
  592. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.15);
  593. }
  594. // 数字选择器容器
  595. .number-box-container {
  596. display: flex;
  597. align-items: center;
  598. gap: 16rpx;
  599. margin: 20rpx 0;
  600. width: 100%;
  601. justify-content: center;
  602. white-space: nowrap;
  603. }
  604. // 价格输入框盒子
  605. .price-input-box {
  606. flex: 1;
  607. max-width: 800rpx;
  608. background-color: #f5f7fa;
  609. border: 2rpx solid #e5e7eb;
  610. border-radius: 12rpx;
  611. padding: 20rpx 24rpx;
  612. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  613. display: flex;
  614. align-items: center;
  615. justify-content: space-between;
  616. white-space: nowrap;
  617. min-width: 300rpx;
  618. }
  619. // 价格标签样式
  620. .price-label {
  621. font-size: 36rpx;
  622. color: map-get($colors, text-primary);
  623. font-weight: 700;
  624. min-width: 120rpx;
  625. flex-shrink: 0;
  626. margin-right: 16rpx;
  627. letter-spacing: 1rpx;
  628. font-family: map-get($font, family);
  629. }
  630. // 价格输入框样式
  631. .price-input {
  632. width: 100%;
  633. height: auto;
  634. border: none;
  635. outline: none;
  636. background-color: transparent;
  637. text-align: right;
  638. font-size: 48rpx;
  639. font-weight: 600;
  640. color: map-get($colors, text-primary);
  641. padding: 0 10rpx;
  642. box-sizing: border-box;
  643. -webkit-appearance: none;
  644. -moz-appearance: textfield;
  645. /* 使用等宽字体显示带斜线的0 */
  646. font-family: Consolas, 'Courier New', monospace, -apple-system, BlinkMacSystemFont;
  647. }
  648. // 移除数字输入框的上下箭头
  649. .price-input::-webkit-inner-spin-button,
  650. .price-input::-webkit-outer-spin-button {
  651. -webkit-appearance: none;
  652. margin: 0;
  653. }
  654. .price-input:focus {
  655. background-color: transparent;
  656. }
  657. </style>