pageTwo.vue 21 KB

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