pageTwo.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  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="handleUpload('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. <image :src="image" mode="aspectFill" class="image-thumb"></image>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="checklist-item">
  48. <view class="checkbox-text-container">
  49. <u-checkbox name="face2face" size="40rpx" color="#108cff" />
  50. <text class="checklist-text">到达客户面对面</text>
  51. </view>
  52. <u-input v-if="selectedCheckbox.includes('face2face')" v-model="formData.face2faceNotes"
  53. type="textarea" placeholder="请输入备注信息" rows="3" class="checklist-textarea" />
  54. <!-- 上传图片按钮 -->
  55. <view v-if="selectedCheckbox.includes('face2face')" class="upload-btn-container">
  56. <div class="upload-btn" @click="handleUpload('face2faceNotes')">
  57. <u-icon name="camera" size="32rpx" color="#108cff"></u-icon>
  58. <text class="upload-btn-text">上传图片</text>
  59. </div>
  60. </view>
  61. <!-- 图片显示区域 -->
  62. <view v-if="selectedCheckbox.includes('face2face') && face2faceImages.length > 0"
  63. class="image-list">
  64. <view v-for="(image, index) in face2faceImages" :key="index" class="image-item">
  65. <image :src="image" mode="aspectFill" class="image-thumb"></image>
  66. </view>
  67. </view>
  68. </view>
  69. </u-checkbox-group>
  70. </view>
  71. </view>
  72. <!-- 新添加的数字选择器卡片 -->
  73. <view class="card_wrap price-card">
  74. <view class="price-section">
  75. <view class="price-picker-container">
  76. <!-- 上方快速操作按钮 -->
  77. <view class="quick-actions top-actions">
  78. <div class="quick-btn increase" @click="quickChangePrice(100)">+100</div>
  79. <div class="quick-btn increase" @click="quickChangePrice(1000)">+1000</div>
  80. </view>
  81. <!-- 数字选择器 -->
  82. <view class="number-box-container">
  83. <view class="price-input-box">
  84. <text class="price-label">核准价¥</text>
  85. <input type="number" v-model="approvedPrice" class="price-input" placeholder="0" min="0"
  86. @input="onPriceInput" />
  87. </view>
  88. </view>
  89. <!-- 下方快速操作按钮 -->
  90. <view class="quick-actions bottom-actions">
  91. <div class="quick-btn decrease" @click="quickChangePrice(-100)">-100</div>
  92. <div class="quick-btn decrease" @click="quickChangePrice(-1000)">-1000</div>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <!-- 新添加的高清细节图上传卡片 -->
  98. <view class="card_wrap detail-image-card">
  99. <view class="detail-image-section">
  100. <div class="detail-image-header">
  101. <div class="detail-image-title">上传高清细节图(支持多选)</div>
  102. <div class="copy-btn" @click="copyAllDetailImages">
  103. <text>一键复制</text>
  104. </div>
  105. </div>
  106. <div class="detail-image-upload-container">
  107. <view class="detail-image-list">
  108. <view class="detail-image-item" v-for="(item, index) in detailImages" :key="'detail-' + index">
  109. <pic-comp @needPreviewPic='previewImageDetail' :src="item.fileUrl"></pic-comp>
  110. <view class="detail-delete-btn" @click="deleteImage(item)">×</view>
  111. </view>
  112. <view class="detail-upload-btn" @click="uploadImage('detailImages', currentReceipt.id)">
  113. <u-icon name="plus" size="40rpx" color="#999"></u-icon>
  114. </view>
  115. </view>
  116. </div>
  117. </view>
  118. </view>
  119. <u-button @click="handleNextClick" type="primary" size="middle" style="border-radius: 20rpx;">下一步</u-button>
  120. </view>
  121. </template>
  122. <script>
  123. import picComp from './picComp.vue'
  124. import imgUploadAndDownLoad from '../mixin/imgUploadAndDownLoad'
  125. export default {
  126. mixins: [imgUploadAndDownLoad],
  127. props: {
  128. orderDetail: {
  129. type: Object,
  130. default: () => { },
  131. },
  132. orderId: {
  133. type: String,
  134. default: '',
  135. },
  136. followUpList: {
  137. type: Array,
  138. default: () => [],
  139. },
  140. currentReceipt: {
  141. type: Object,
  142. default: () => { },
  143. },
  144. },
  145. watch: {
  146. orderDetail: {
  147. handler(newVal) {
  148. if (newVal) {
  149. }
  150. },
  151. deep: true,
  152. },
  153. followUpList: {
  154. handler(newVal) {
  155. if (newVal) {
  156. this.followUpListInner = newVal.map(item => (item.content || ''));
  157. //判断内容是否含有上面的三个选择
  158. this.checkFollowUpContent();
  159. }
  160. },
  161. deep: true,
  162. },
  163. currentReceipt: {
  164. handler(newVal) {
  165. if (newVal) {
  166. this.approvedPrice = Number(newVal.sellingPrice) || 0;
  167. setTimeout(() => {
  168. this.getList('2', '3', newVal.id, this.orderDetail.itemBrand);
  169. }, 100)
  170. }
  171. },
  172. deep: true,
  173. },
  174. },
  175. components: {
  176. picComp
  177. },
  178. data() {
  179. return {
  180. selectedCheckbox: [],
  181. formData: {
  182. contactPhone: '',
  183. photoTips: '',
  184. face2faceNotes: ''
  185. },
  186. // 图片相关数据
  187. photoTipsImages: [], // 师傅技巧图片数组
  188. face2faceImages: [], // 到达客户面对面图片数组
  189. // 全屏预览相关
  190. previewImage: '', // 当前预览的图片
  191. showPreview: false, // 是否显示全屏预览
  192. // 核准价格相关
  193. approvedPrice: 0, // 核准价格初始值
  194. // 高清细节图相关
  195. detailImages: [],// 高清细节图数组
  196. // 绑定订单相关
  197. bindList: [],// 待绑定的图片列表,
  198. followUpListInner: [],// 跟进记录数组
  199. };
  200. },
  201. methods: {
  202. // 价格输入回调
  203. onPriceInput(e) {
  204. // 确保价格是数字且不小于0
  205. let value = Number(e.detail.value);
  206. if (isNaN(value)) value = 0;
  207. value = Math.max(0, value);
  208. this.approvedPrice = value;
  209. },
  210. // 快速调整价格
  211. quickChangePrice(amount) {
  212. let newPrice = this.approvedPrice + amount;
  213. // 确保价格不小于0
  214. newPrice = Math.max(0, newPrice);
  215. this.approvedPrice = newPrice;
  216. },
  217. // 复制所有高清细节图链接
  218. copyAllDetailImages() {
  219. // 合并所有图片
  220. const allImages = [...this.detailImages];
  221. //取出所有图的url
  222. const allUrls = allImages.map(item => item.fileUrl);
  223. if (allUrls.length > 0) {
  224. // 显示保存图片确认弹窗
  225. uni.showModal({
  226. title: '保存图片',
  227. content: `是否将 ${allUrls.length} 张图片保存到本地相册?`,
  228. confirmText: '保存',
  229. success: (res) => {
  230. if (res.confirm) {
  231. // 用户选择保存图片
  232. this.saveImagesToLocal(allUrls);
  233. }
  234. }
  235. })
  236. } else {
  237. uni.showToast({
  238. title: '没有图片可复制',
  239. icon: 'none'
  240. })
  241. }
  242. },
  243. // 保存图片到本地相册
  244. async saveImagesToLocal(imageUrls) {
  245. try {
  246. uni.showLoading({
  247. title: '正在保存图片...',
  248. mask: true
  249. });
  250. const savedImages = [];
  251. const failedImages = [];
  252. // 逐个保存图片
  253. for (let i = 0; i < imageUrls.length; i++) {
  254. const url = imageUrls[i];
  255. try {
  256. await this.saveSingleImage(url);
  257. savedImages.push(url);
  258. } catch (error) {
  259. console.error(`保存图片失败: ${url}`, error);
  260. failedImages.push(url);
  261. }
  262. // 更新进度
  263. uni.showLoading({
  264. title: `正在保存图片... (${i + 1}/${imageUrls.length})`,
  265. mask: true
  266. });
  267. }
  268. uni.hideLoading();
  269. // 显示结果
  270. let message = `成功保存 ${savedImages.length} 张图片`;
  271. if (failedImages.length > 0) {
  272. message += `,${failedImages.length} 张保存失败`;
  273. }
  274. uni.showToast({
  275. title: message,
  276. icon: 'none',
  277. duration: 3000
  278. });
  279. // 如果有失败的图片,也复制链接作为备选
  280. if (failedImages.length > 0) {
  281. const allUrls = [...savedImages, ...failedImages];
  282. this.copyImageUrls(allUrls);
  283. }
  284. } catch (error) {
  285. uni.hideLoading();
  286. console.error('保存图片过程中发生错误:', error);
  287. uni.showToast({
  288. title: '保存图片失败',
  289. icon: 'error'
  290. });
  291. }
  292. },
  293. // 保存单张图片
  294. saveSingleImage(url) {
  295. return new Promise((resolve, reject) => {
  296. // 先下载图片
  297. uni.downloadFile({
  298. url: url,
  299. success: (res) => {
  300. if (res.statusCode === 200) {
  301. // 保存到相册
  302. uni.saveImageToPhotosAlbum({
  303. filePath: res.tempFilePath,
  304. success: () => {
  305. console.log('图片保存成功:', url);
  306. resolve();
  307. },
  308. fail: (err) => {
  309. console.error('保存到相册失败:', err);
  310. // 如果是权限问题,尝试请求权限
  311. if (err.errMsg.includes('auth denied')) {
  312. uni.showModal({
  313. title: '权限不足',
  314. content: '需要访问相册权限来保存图片,是否去设置?',
  315. success: (modalRes) => {
  316. if (modalRes.confirm) {
  317. // 打开设置页面
  318. uni.openSetting({
  319. success: (settingRes) => {
  320. console.log('设置页面结果:', settingRes);
  321. }
  322. });
  323. }
  324. }
  325. });
  326. }
  327. reject(err);
  328. }
  329. });
  330. } else {
  331. reject(new Error('下载失败'));
  332. }
  333. },
  334. fail: (err) => {
  335. console.error('下载图片失败:', err);
  336. reject(err);
  337. }
  338. });
  339. });
  340. },
  341. // 下一步按钮点击事件
  342. async handleNextClick() {
  343. //调接口保存当前的核准价
  344. await uni.$u.api.updateReceiptForm({
  345. id: this.currentReceipt.id,
  346. sellingPrice: this.approvedPrice,
  347. });
  348. // 创建一个只包含被勾选checkbox对应数据的对象
  349. const result = {};
  350. // 检查联系师傅
  351. if (this.selectedCheckbox.includes('contact师傅')) {
  352. result.contactPhone = this.formData.contactPhone;
  353. }
  354. // 检查师傅拍图技巧
  355. if (this.selectedCheckbox.includes('photo技巧')) {
  356. result.photoTips = this.formData.photoTips;
  357. result.photoTipsImages = this.photoTipsImages;
  358. }
  359. // 检查到达客户面对面
  360. if (this.selectedCheckbox.includes('face2face')) {
  361. result.face2faceNotes = this.formData.face2faceNotes;
  362. result.face2faceImages = this.face2faceImages;
  363. }
  364. // 添加其他非checkbox控制的字段
  365. result.approvedPrice = this.approvedPrice;
  366. result.detailImages = this.detailImages;
  367. // result.selectedCheckbox = this.selectedCheckbox;
  368. // 打印结果对象
  369. // console.log('当前界面的选中值:', result);
  370. this.$emit('handleNextClick', {
  371. nowPage: 'formTwo',
  372. form: result,
  373. })
  374. // 下一步的时候要通过判断是否有联系师傅,师傅拍图技巧,到达客户面对面,如果有的话调uni.$u.api.addOrderFollow(orderFormData);接口按照 联系师傅;内容;url1,url2,url3,的格式上传
  375. //先判断有没有联系师傅
  376. if (this.selectedCheckbox.includes('contact师傅')) {
  377. console.log('触发联系师傅')
  378. // 联系师傅的手机号,已:为分割,取后面的内容
  379. const phone = this.formData.contactPhone || '';
  380. const data = `联系师傅;${phone}`;
  381. // 调用接口上传
  382. await uni.$u.api.addOrderFollow({
  383. orderId: this.orderId,
  384. content: data,
  385. })
  386. }
  387. if (this.selectedCheckbox.includes('photo技巧')) {
  388. console.log('触发师傅拍图技巧')
  389. // 师傅拍图技巧的内容,已:为分割,取后面的内容
  390. const photoTips = this.formData.photoTips || '';
  391. const urls = this.photoTipsImages.join(',');
  392. const data = `师傅拍图技巧;${photoTips};${urls}`;
  393. console.log('urls9999999', data)
  394. await uni.$u.api.addOrderFollow({
  395. orderId: this.orderId,
  396. content: data,
  397. })
  398. }
  399. if (this.selectedCheckbox.includes('face2face')) {
  400. // 到达客户面对面的内容,已:为分割,取后面的内容
  401. const face2faceNotes = this.formData.face2faceNotes || '';
  402. const urls = this.face2faceImages.join(',');
  403. const data = `到达客户面对面;${face2faceNotes};${urls}`;
  404. await uni.$u.api.addOrderFollow({
  405. orderId: this.orderId,
  406. content: data,
  407. })
  408. }
  409. },
  410. checkFollowUpContent() {
  411. // 检查跟进记录是否包含上面的三个选择
  412. //每个检查到一个就不继续检查了
  413. let hasContactMaster = false;
  414. let hasPhotoTips = false;
  415. let hasFace2face = false;
  416. this.followUpListInner.forEach(item => {
  417. console.log('这里是跟进记录', item)
  418. // 判断内容是否含有联系师傅,师傅拍图技巧,到达客户面对面,如果包含的话就上面对应的box就打上对勾
  419. if (item.includes('联系师傅') && !hasContactMaster) {
  420. this.selectedCheckbox.push('contact师傅');
  421. // 联系师傅的手机号,已:为分割,取后面的内容
  422. const phone = item.split(';')[1] || '';
  423. console.log('联系师傅的手机号111111', phone)
  424. this.formData.contactPhone = phone;
  425. hasContactMaster = true;
  426. }
  427. if (item.includes('师傅拍图技巧') && !hasPhotoTips) {
  428. this.selectedCheckbox.push('photo技巧');
  429. // 师傅拍图技巧的内容,已:为分割,取后面的内容
  430. const photoTips = item.split(';')[1] || '';
  431. this.formData.photoTips = photoTips;
  432. const urls = item.split(';')[2] || ''
  433. //把url转为数组
  434. const urlArray = urls.split(',').map(url => url.trim());
  435. this.photoTipsImages = [...this.photoTipsImages, ...urlArray];
  436. hasPhotoTips = true;
  437. }
  438. if (item.includes('到达客户面对面') && !hasFace2face) {
  439. this.selectedCheckbox.push('face2face');
  440. // 到达客户面对面的内容,已:为分割,取后面的内容
  441. const face2faceNotes = item.split(';')[1] || '';
  442. this.formData.face2faceNotes = face2faceNotes;
  443. const urls = item.split(';')[2] || ''
  444. //把url转为数组
  445. const urlArray = urls.split(',').map(url => url.trim());
  446. this.face2faceImages = [...this.face2faceImages, ...urlArray];
  447. hasFace2face = true;
  448. }
  449. })
  450. },
  451. // 处理上传图片,上传图片的话就赋值给对应的数组
  452. async handleUpload(field) {
  453. uni.chooseImage({
  454. count: 9, // 最多选择1张
  455. sizeType: ['compressed'], // 压缩图片
  456. sourceType: ['album', 'camera'], // 从相册选择或拍照
  457. success: async (res) => {
  458. const tempFilePath = res.tempFilePaths
  459. console.log('上传的图片路径:', tempFilePath)
  460. // 把blob数组上传到服务器,然后返回路径
  461. try {
  462. const res = await Promise.all(tempFilePath.map(filePath => uni.$u.api.uploadFile(filePath)));
  463. console.log('上传的图片路径数组是:', res.forEach(item => console.log(item.data.url)))
  464. // 把返回的路径赋值给对应的数组
  465. if (field == 'photoTips') {
  466. this.photoTipsImages = [...this.photoTipsImages, ...res.map(item => item.data.url)];
  467. } else if (field == 'face2faceNotes') {
  468. console.log('1111')
  469. this.face2faceImages = [...this.face2faceImages, ...res.map(item => item.data.url)];
  470. }
  471. } catch (error) {
  472. console.error('上传失败:', error);
  473. uni.$u.toast('上传失败');
  474. }
  475. },
  476. fail: (err) => {
  477. console.error('选择图片失败:', err)
  478. }
  479. })
  480. },
  481. previewImageDetail(src) {
  482. const urlList = this.detailImages.map(item => item.fileUrl);
  483. uni.previewImage({
  484. urls: urlList,
  485. current: src
  486. })
  487. }
  488. }
  489. };
  490. </script>
  491. <style scoped lang="scss">
  492. // 导入公共样式
  493. @import './common.scss';
  494. // 主样式
  495. .page-container {
  496. box-sizing: border-box;
  497. padding: 0;
  498. background-color: map-get($colors, bg);
  499. font-family: map-get($font, family);
  500. -webkit-font-smoothing: map-get($font, smoothing);
  501. font-smoothing: map-get($font, smoothing);
  502. }
  503. .card_wrap {
  504. @include card;
  505. margin-bottom: 20rpx;
  506. &:hover {
  507. @include shadow(2);
  508. }
  509. &.checklist-card,
  510. &.price-card,
  511. &.detail-image-card {
  512. margin-top: 20rpx;
  513. }
  514. }
  515. .address-section {
  516. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  517. }
  518. .address-header {
  519. @include flex-center;
  520. margin-bottom: map-get($sizes, margin-sm);
  521. padding-bottom: map-get($sizes, margin-sm);
  522. border-bottom: 1rpx solid map-get($colors, border);
  523. .location-icon {
  524. margin-right: map-get($sizes, margin-xs);
  525. background-color: map-get($colors, primary-light);
  526. padding: map-get($sizes, icon-padding);
  527. border-radius: 50%;
  528. flex-shrink: 0;
  529. }
  530. .address-title {
  531. margin-left: 16rpx;
  532. }
  533. }
  534. .address-content {
  535. .address-text {
  536. @include font-styles;
  537. }
  538. }
  539. // 复选框卡片样式
  540. .checklist-card {
  541. margin-top: 20rpx;
  542. }
  543. .checklist-section {
  544. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  545. display: block;
  546. /* 明确设置为块级元素,避免任何flex影响 */
  547. }
  548. .checklist-item {
  549. display: block;
  550. /* 明确设置为块级元素,确保垂直排列 */
  551. width: 100%;
  552. /* 确保占满整个宽度 */
  553. padding: 16rpx 0;
  554. border-bottom: 1rpx solid map-get($colors, border);
  555. margin-bottom: 0;
  556. /* 移除任何可能的margin影响 */
  557. &:first-child {
  558. padding-top: 0;
  559. }
  560. &:last-child {
  561. padding-bottom: 0;
  562. border-bottom: none;
  563. }
  564. // 复选框和文本的容器
  565. .checkbox-text-container {
  566. @include flex-center;
  567. display: flex;
  568. align-items: center;
  569. }
  570. }
  571. // u-checkbox样式调整
  572. u-checkbox {
  573. margin-right: 16rpx;
  574. flex-shrink: 0;
  575. vertical-align: middle;
  576. }
  577. // 隐藏原生checkbox样式
  578. .checkbox {
  579. display: none;
  580. }
  581. .checklist-text {
  582. @include font-styles;
  583. vertical-align: middle;
  584. }
  585. // 输入框样式
  586. .checklist-input,
  587. .checklist-textarea {
  588. margin-top: 12rpx;
  589. margin-left: 56rpx; // 与复选框对齐
  590. width: calc(100% - 72rpx); // 减去左边距和额外的16rpx边距,确保不超出边界
  591. max-width: calc(100% - 72rpx); // 确保最大宽度也不超出
  592. box-sizing: border-box; // 确保padding和border不影响总宽度
  593. border-radius: 8rpx;
  594. border: 1rpx solid #e5e7eb;
  595. padding: 12rpx 16rpx;
  596. font-size: 28rpx;
  597. background-color: #f9fafb;
  598. transition: all 0.2s ease;
  599. &:focus {
  600. border-color: map-get($colors, primary);
  601. background-color: #ffffff;
  602. box-shadow: 0 0 0 2rpx rgba(16, 140, 255, 0.1);
  603. }
  604. }
  605. .checklist-textarea {
  606. min-height: 160rpx;
  607. resize: vertical;
  608. vertical-align: top;
  609. padding-top: 16rpx;
  610. padding-bottom: 16rpx;
  611. }
  612. // 解决textarea文本和placeholder居中问题
  613. // 直接穿透u-input组件的所有层级
  614. :deep(.checklist-textarea) {
  615. & .u-input__textarea {
  616. display: block !important;
  617. height: auto !important;
  618. min-height: 160rpx !important;
  619. padding: 16rpx !important;
  620. text-align: left !important;
  621. }
  622. & .u-input__textarea textarea {
  623. display: block !important;
  624. width: 100% !important;
  625. height: auto !important;
  626. min-height: 128rpx !important;
  627. padding: 0 !important;
  628. margin: 0 !important;
  629. text-align: left !important;
  630. vertical-align: top !important;
  631. line-height: 1.5 !important;
  632. resize: vertical !important;
  633. }
  634. // 确保输入的文本顶部对齐
  635. & .u-input__textarea textarea:focus {
  636. text-align: left !important;
  637. vertical-align: top !important;
  638. }
  639. // 针对不同浏览器的placeholder样式
  640. & .u-input__textarea textarea::-webkit-input-placeholder {
  641. text-align: left !important;
  642. vertical-align: top !important;
  643. line-height: 1.5 !important;
  644. }
  645. & .u-input__textarea textarea::-moz-placeholder {
  646. text-align: left !important;
  647. vertical-align: top !important;
  648. line-height: 1.5 !important;
  649. }
  650. & .u-input__textarea textarea:-ms-input-placeholder {
  651. text-align: left !important;
  652. vertical-align: top !important;
  653. line-height: 1.5 !important;
  654. }
  655. & .u-input__textarea textarea::placeholder {
  656. text-align: left !important;
  657. vertical-align: top !important;
  658. line-height: 1.5 !important;
  659. }
  660. }
  661. // 上传按钮容器样式
  662. .upload-btn-container {
  663. margin-top: 16rpx;
  664. margin-left: 56rpx;
  665. display: inline-block;
  666. }
  667. // 上传按钮样式
  668. .upload-btn {
  669. display: flex;
  670. align-items: center;
  671. justify-content: center;
  672. gap: 12rpx;
  673. font-size: 30rpx;
  674. padding: 20rpx 40rpx;
  675. border-radius: 8rpx;
  676. background-color: map-get($colors, bg);
  677. border: 2rpx dashed map-get($colors, primary);
  678. color: map-get($colors, primary);
  679. transition: all 0.3s ease;
  680. cursor: pointer;
  681. min-width: 200rpx;
  682. box-sizing: border-box;
  683. &:hover {
  684. background-color: map-get($colors, primary-light);
  685. border-color: darken(map-get($colors, primary), 10%);
  686. transform: translateY(-2rpx);
  687. box-shadow: 0 4rpx 16rpx rgba(16, 140, 255, 0.15);
  688. }
  689. &:active {
  690. transform: translateY(0);
  691. }
  692. }
  693. .upload-btn-text {
  694. color: map-get($colors, primary);
  695. @include font-styles($size: small, $weight: medium);
  696. }
  697. // 图片列表样式
  698. .image-list {
  699. margin-top: 16rpx;
  700. margin-left: 56rpx;
  701. display: flex;
  702. flex-wrap: wrap;
  703. gap: 16rpx;
  704. padding-bottom: 8rpx;
  705. }
  706. // 图片项样式
  707. .image-item {
  708. width: 120rpx;
  709. height: 120rpx;
  710. border-radius: 8rpx;
  711. overflow: hidden;
  712. background-color: map-get($colors, bg);
  713. @include shadow(1);
  714. transition: all 0.3s ease;
  715. cursor: pointer;
  716. position: relative;
  717. &:hover {
  718. @include shadow(2);
  719. transform: translateY(-2rpx);
  720. }
  721. }
  722. // 图片缩略图样式
  723. .image-thumb {
  724. width: 100%;
  725. height: 100%;
  726. object-fit: cover;
  727. }
  728. // 价格卡片样式
  729. .price-card {
  730. margin-top: 20rpx;
  731. }
  732. .price-section {
  733. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  734. }
  735. .detail-image-card {
  736. margin-top: 20rpx;
  737. }
  738. .detail-image-section {
  739. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  740. }
  741. .detail-image-header {
  742. display: flex;
  743. justify-content: space-between;
  744. align-items: center;
  745. margin-bottom: map-get($sizes, margin-sm);
  746. padding-bottom: map-get($sizes, margin-sm);
  747. border-bottom: 1rpx solid map-get($colors, border);
  748. }
  749. .detail-image-title {
  750. @include font-styles($size: content, $weight: bold, $color: primary);
  751. }
  752. .copy-btn {
  753. border-radius: 20rpx;
  754. border: 1rpx solid #007AFF;
  755. background-color: transparent;
  756. color: #007AFF;
  757. @include font-styles($size: small, $weight: regular);
  758. padding: 0 24rpx;
  759. height: 64rpx;
  760. line-height: 64rpx;
  761. display: flex;
  762. align-items: center;
  763. gap: 8rpx;
  764. cursor: pointer;
  765. user-select: none;
  766. transition: all 0.3s ease;
  767. &:hover {
  768. background-color: rgba(0, 122, 255, 0.05);
  769. }
  770. &:active {
  771. transform: scale(0.98);
  772. }
  773. }
  774. .detail-image-upload-container {
  775. margin-top: 20rpx;
  776. }
  777. .detail-image-list {
  778. display: flex;
  779. flex-wrap: wrap;
  780. gap: 20rpx;
  781. }
  782. .detail-image-item {
  783. position: relative;
  784. width: 200rpx;
  785. height: 200rpx;
  786. box-sizing: border-box;
  787. }
  788. .detail-delete-btn {
  789. position: absolute;
  790. top: -10rpx;
  791. right: -10rpx;
  792. width: 40rpx;
  793. height: 40rpx;
  794. background-color: #ff4d4f;
  795. color: #fff;
  796. border-radius: 50%;
  797. display: flex;
  798. align-items: center;
  799. justify-content: center;
  800. @include font-styles($size: small, $weight: bold);
  801. z-index: 10;
  802. }
  803. .detail-upload-btn {
  804. width: 200rpx;
  805. height: 200rpx;
  806. border: 8rpx dashed #ddd;
  807. border-radius: 30rpx;
  808. display: flex;
  809. align-items: center;
  810. justify-content: center;
  811. background-color: #f9f9f9;
  812. box-sizing: border-box;
  813. }
  814. .price-picker-container {
  815. display: flex;
  816. flex-direction: column;
  817. align-items: center;
  818. padding: 20rpx 0;
  819. }
  820. // 快速操作按钮样式
  821. .quick-actions {
  822. display: flex;
  823. justify-content: center;
  824. gap: 16rpx;
  825. margin: 16rpx 0;
  826. width: 100%;
  827. max-width: 800rpx;
  828. }
  829. .quick-btn {
  830. flex: 1;
  831. border-radius: 12rpx;
  832. font-size: 36rpx;
  833. padding: 20rpx 0;
  834. min-width: 0;
  835. text-align: center;
  836. color: #ffffff;
  837. font-weight: 600;
  838. transition: all 0.3s ease;
  839. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  840. cursor: pointer;
  841. }
  842. .quick-btn.increase {
  843. background-color: #e6f7ed;
  844. color: #00b42a;
  845. }
  846. .quick-btn.decrease {
  847. background-color: #fff1f0;
  848. color: #f53f3f;
  849. }
  850. .quick-btn:hover {
  851. opacity: 0.9;
  852. transform: translateY(-2rpx);
  853. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.15);
  854. }
  855. // 数字选择器容器
  856. .number-box-container {
  857. display: flex;
  858. align-items: center;
  859. gap: 16rpx;
  860. margin: 20rpx 0;
  861. width: 100%;
  862. justify-content: center;
  863. white-space: nowrap;
  864. }
  865. // 价格输入框盒子
  866. .price-input-box {
  867. flex: 1;
  868. max-width: 800rpx;
  869. background-color: #f5f7fa;
  870. border: 2rpx solid #e5e7eb;
  871. border-radius: 12rpx;
  872. padding: 20rpx 24rpx;
  873. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  874. display: flex;
  875. align-items: center;
  876. justify-content: space-between;
  877. white-space: nowrap;
  878. min-width: 300rpx;
  879. }
  880. // 价格标签样式
  881. .price-label {
  882. font-size: 36rpx;
  883. color: map-get($colors, text-primary);
  884. font-weight: 700;
  885. min-width: 120rpx;
  886. flex-shrink: 0;
  887. margin-right: 16rpx;
  888. letter-spacing: 1rpx;
  889. font-family: map-get($font, family);
  890. }
  891. // 价格输入框样式
  892. .price-input {
  893. width: 100%;
  894. height: auto;
  895. border: none;
  896. outline: none;
  897. background-color: transparent;
  898. text-align: right;
  899. font-size: 48rpx;
  900. font-weight: 600;
  901. color: map-get($colors, text-primary);
  902. padding: 0 10rpx;
  903. box-sizing: border-box;
  904. -webkit-appearance: none;
  905. -moz-appearance: textfield;
  906. /* 使用等宽字体显示带斜线的0 */
  907. font-family: Consolas, 'Courier New', monospace, -apple-system, BlinkMacSystemFont;
  908. }
  909. // 移除数字输入框的上下箭头
  910. .price-input::-webkit-inner-spin-button,
  911. .price-input::-webkit-outer-spin-button {
  912. -webkit-appearance: none;
  913. margin: 0;
  914. }
  915. .price-input:focus {
  916. background-color: transparent;
  917. }
  918. </style>