pageTwo.vue 34 KB

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