pageTwo.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  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 :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. }
  482. };
  483. </script>
  484. <style scoped lang="scss">
  485. // 导入公共样式
  486. @import './common.scss';
  487. // 主样式
  488. .page-container {
  489. box-sizing: border-box;
  490. padding: 0;
  491. background-color: map-get($colors, bg);
  492. font-family: map-get($font, family);
  493. -webkit-font-smoothing: map-get($font, smoothing);
  494. font-smoothing: map-get($font, smoothing);
  495. }
  496. .card_wrap {
  497. @include card;
  498. margin-bottom: 20rpx;
  499. &:hover {
  500. @include shadow(2);
  501. }
  502. &.checklist-card,
  503. &.price-card,
  504. &.detail-image-card {
  505. margin-top: 20rpx;
  506. }
  507. }
  508. .address-section {
  509. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  510. }
  511. .address-header {
  512. @include flex-center;
  513. margin-bottom: map-get($sizes, margin-sm);
  514. padding-bottom: map-get($sizes, margin-sm);
  515. border-bottom: 1rpx solid map-get($colors, border);
  516. .location-icon {
  517. margin-right: map-get($sizes, margin-xs);
  518. background-color: map-get($colors, primary-light);
  519. padding: map-get($sizes, icon-padding);
  520. border-radius: 50%;
  521. flex-shrink: 0;
  522. }
  523. .address-title {
  524. margin-left: 16rpx;
  525. }
  526. }
  527. .address-content {
  528. .address-text {
  529. @include font-styles;
  530. }
  531. }
  532. // 复选框卡片样式
  533. .checklist-card {
  534. margin-top: 20rpx;
  535. }
  536. .checklist-section {
  537. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  538. display: block;
  539. /* 明确设置为块级元素,避免任何flex影响 */
  540. }
  541. .checklist-item {
  542. display: block;
  543. /* 明确设置为块级元素,确保垂直排列 */
  544. width: 100%;
  545. /* 确保占满整个宽度 */
  546. padding: 16rpx 0;
  547. border-bottom: 1rpx solid map-get($colors, border);
  548. margin-bottom: 0;
  549. /* 移除任何可能的margin影响 */
  550. &:first-child {
  551. padding-top: 0;
  552. }
  553. &:last-child {
  554. padding-bottom: 0;
  555. border-bottom: none;
  556. }
  557. // 复选框和文本的容器
  558. .checkbox-text-container {
  559. @include flex-center;
  560. display: flex;
  561. align-items: center;
  562. }
  563. }
  564. // u-checkbox样式调整
  565. u-checkbox {
  566. margin-right: 16rpx;
  567. flex-shrink: 0;
  568. vertical-align: middle;
  569. }
  570. // 隐藏原生checkbox样式
  571. .checkbox {
  572. display: none;
  573. }
  574. .checklist-text {
  575. @include font-styles;
  576. vertical-align: middle;
  577. }
  578. // 输入框样式
  579. .checklist-input,
  580. .checklist-textarea {
  581. margin-top: 12rpx;
  582. margin-left: 56rpx; // 与复选框对齐
  583. width: calc(100% - 72rpx); // 减去左边距和额外的16rpx边距,确保不超出边界
  584. max-width: calc(100% - 72rpx); // 确保最大宽度也不超出
  585. box-sizing: border-box; // 确保padding和border不影响总宽度
  586. border-radius: 8rpx;
  587. border: 1rpx solid #e5e7eb;
  588. padding: 12rpx 16rpx;
  589. font-size: 28rpx;
  590. background-color: #f9fafb;
  591. transition: all 0.2s ease;
  592. &:focus {
  593. border-color: map-get($colors, primary);
  594. background-color: #ffffff;
  595. box-shadow: 0 0 0 2rpx rgba(16, 140, 255, 0.1);
  596. }
  597. }
  598. .checklist-textarea {
  599. min-height: 160rpx;
  600. resize: vertical;
  601. vertical-align: top;
  602. padding-top: 16rpx;
  603. padding-bottom: 16rpx;
  604. }
  605. // 解决textarea文本和placeholder居中问题
  606. // 直接穿透u-input组件的所有层级
  607. :deep(.checklist-textarea) {
  608. & .u-input__textarea {
  609. display: block !important;
  610. height: auto !important;
  611. min-height: 160rpx !important;
  612. padding: 16rpx !important;
  613. text-align: left !important;
  614. }
  615. & .u-input__textarea textarea {
  616. display: block !important;
  617. width: 100% !important;
  618. height: auto !important;
  619. min-height: 128rpx !important;
  620. padding: 0 !important;
  621. margin: 0 !important;
  622. text-align: left !important;
  623. vertical-align: top !important;
  624. line-height: 1.5 !important;
  625. resize: vertical !important;
  626. }
  627. // 确保输入的文本顶部对齐
  628. & .u-input__textarea textarea:focus {
  629. text-align: left !important;
  630. vertical-align: top !important;
  631. }
  632. // 针对不同浏览器的placeholder样式
  633. & .u-input__textarea textarea::-webkit-input-placeholder {
  634. text-align: left !important;
  635. vertical-align: top !important;
  636. line-height: 1.5 !important;
  637. }
  638. & .u-input__textarea textarea::-moz-placeholder {
  639. text-align: left !important;
  640. vertical-align: top !important;
  641. line-height: 1.5 !important;
  642. }
  643. & .u-input__textarea textarea:-ms-input-placeholder {
  644. text-align: left !important;
  645. vertical-align: top !important;
  646. line-height: 1.5 !important;
  647. }
  648. & .u-input__textarea textarea::placeholder {
  649. text-align: left !important;
  650. vertical-align: top !important;
  651. line-height: 1.5 !important;
  652. }
  653. }
  654. // 上传按钮容器样式
  655. .upload-btn-container {
  656. margin-top: 16rpx;
  657. margin-left: 56rpx;
  658. display: inline-block;
  659. }
  660. // 上传按钮样式
  661. .upload-btn {
  662. display: flex;
  663. align-items: center;
  664. justify-content: center;
  665. gap: 12rpx;
  666. font-size: 30rpx;
  667. padding: 20rpx 40rpx;
  668. border-radius: 8rpx;
  669. background-color: map-get($colors, bg);
  670. border: 2rpx dashed map-get($colors, primary);
  671. color: map-get($colors, primary);
  672. transition: all 0.3s ease;
  673. cursor: pointer;
  674. min-width: 200rpx;
  675. box-sizing: border-box;
  676. &:hover {
  677. background-color: map-get($colors, primary-light);
  678. border-color: darken(map-get($colors, primary), 10%);
  679. transform: translateY(-2rpx);
  680. box-shadow: 0 4rpx 16rpx rgba(16, 140, 255, 0.15);
  681. }
  682. &:active {
  683. transform: translateY(0);
  684. }
  685. }
  686. .upload-btn-text {
  687. color: map-get($colors, primary);
  688. @include font-styles($size: small, $weight: medium);
  689. }
  690. // 图片列表样式
  691. .image-list {
  692. margin-top: 16rpx;
  693. margin-left: 56rpx;
  694. display: flex;
  695. flex-wrap: wrap;
  696. gap: 16rpx;
  697. padding-bottom: 8rpx;
  698. }
  699. // 图片项样式
  700. .image-item {
  701. width: 120rpx;
  702. height: 120rpx;
  703. border-radius: 8rpx;
  704. overflow: hidden;
  705. background-color: map-get($colors, bg);
  706. @include shadow(1);
  707. transition: all 0.3s ease;
  708. cursor: pointer;
  709. position: relative;
  710. &:hover {
  711. @include shadow(2);
  712. transform: translateY(-2rpx);
  713. }
  714. }
  715. // 图片缩略图样式
  716. .image-thumb {
  717. width: 100%;
  718. height: 100%;
  719. object-fit: cover;
  720. }
  721. // 价格卡片样式
  722. .price-card {
  723. margin-top: 20rpx;
  724. }
  725. .price-section {
  726. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  727. }
  728. .detail-image-card {
  729. margin-top: 20rpx;
  730. }
  731. .detail-image-section {
  732. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  733. }
  734. .detail-image-header {
  735. display: flex;
  736. justify-content: space-between;
  737. align-items: center;
  738. margin-bottom: map-get($sizes, margin-sm);
  739. padding-bottom: map-get($sizes, margin-sm);
  740. border-bottom: 1rpx solid map-get($colors, border);
  741. }
  742. .detail-image-title {
  743. @include font-styles($size: content, $weight: bold, $color: primary);
  744. }
  745. .copy-btn {
  746. border-radius: 20rpx;
  747. border: 1rpx solid #007AFF;
  748. background-color: transparent;
  749. color: #007AFF;
  750. @include font-styles($size: small, $weight: regular);
  751. padding: 0 24rpx;
  752. height: 64rpx;
  753. line-height: 64rpx;
  754. display: flex;
  755. align-items: center;
  756. gap: 8rpx;
  757. cursor: pointer;
  758. user-select: none;
  759. transition: all 0.3s ease;
  760. &:hover {
  761. background-color: rgba(0, 122, 255, 0.05);
  762. }
  763. &:active {
  764. transform: scale(0.98);
  765. }
  766. }
  767. .detail-image-upload-container {
  768. margin-top: 20rpx;
  769. }
  770. .detail-image-list {
  771. display: flex;
  772. flex-wrap: wrap;
  773. gap: 20rpx;
  774. }
  775. .detail-image-item {
  776. position: relative;
  777. width: 200rpx;
  778. height: 200rpx;
  779. box-sizing: border-box;
  780. }
  781. .detail-delete-btn {
  782. position: absolute;
  783. top: -10rpx;
  784. right: -10rpx;
  785. width: 40rpx;
  786. height: 40rpx;
  787. background-color: #ff4d4f;
  788. color: #fff;
  789. border-radius: 50%;
  790. display: flex;
  791. align-items: center;
  792. justify-content: center;
  793. @include font-styles($size: small, $weight: bold);
  794. z-index: 10;
  795. }
  796. .detail-upload-btn {
  797. width: 200rpx;
  798. height: 200rpx;
  799. border: 8rpx dashed #ddd;
  800. border-radius: 30rpx;
  801. display: flex;
  802. align-items: center;
  803. justify-content: center;
  804. background-color: #f9f9f9;
  805. box-sizing: border-box;
  806. }
  807. .price-picker-container {
  808. display: flex;
  809. flex-direction: column;
  810. align-items: center;
  811. padding: 20rpx 0;
  812. }
  813. // 快速操作按钮样式
  814. .quick-actions {
  815. display: flex;
  816. justify-content: center;
  817. gap: 16rpx;
  818. margin: 16rpx 0;
  819. width: 100%;
  820. max-width: 800rpx;
  821. }
  822. .quick-btn {
  823. flex: 1;
  824. border-radius: 12rpx;
  825. font-size: 36rpx;
  826. padding: 20rpx 0;
  827. min-width: 0;
  828. text-align: center;
  829. color: #ffffff;
  830. font-weight: 600;
  831. transition: all 0.3s ease;
  832. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  833. cursor: pointer;
  834. }
  835. .quick-btn.increase {
  836. background-color: #e6f7ed;
  837. color: #00b42a;
  838. }
  839. .quick-btn.decrease {
  840. background-color: #fff1f0;
  841. color: #f53f3f;
  842. }
  843. .quick-btn:hover {
  844. opacity: 0.9;
  845. transform: translateY(-2rpx);
  846. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.15);
  847. }
  848. // 数字选择器容器
  849. .number-box-container {
  850. display: flex;
  851. align-items: center;
  852. gap: 16rpx;
  853. margin: 20rpx 0;
  854. width: 100%;
  855. justify-content: center;
  856. white-space: nowrap;
  857. }
  858. // 价格输入框盒子
  859. .price-input-box {
  860. flex: 1;
  861. max-width: 800rpx;
  862. background-color: #f5f7fa;
  863. border: 2rpx solid #e5e7eb;
  864. border-radius: 12rpx;
  865. padding: 20rpx 24rpx;
  866. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  867. display: flex;
  868. align-items: center;
  869. justify-content: space-between;
  870. white-space: nowrap;
  871. min-width: 300rpx;
  872. }
  873. // 价格标签样式
  874. .price-label {
  875. font-size: 36rpx;
  876. color: map-get($colors, text-primary);
  877. font-weight: 700;
  878. min-width: 120rpx;
  879. flex-shrink: 0;
  880. margin-right: 16rpx;
  881. letter-spacing: 1rpx;
  882. font-family: map-get($font, family);
  883. }
  884. // 价格输入框样式
  885. .price-input {
  886. width: 100%;
  887. height: auto;
  888. border: none;
  889. outline: none;
  890. background-color: transparent;
  891. text-align: right;
  892. font-size: 48rpx;
  893. font-weight: 600;
  894. color: map-get($colors, text-primary);
  895. padding: 0 10rpx;
  896. box-sizing: border-box;
  897. -webkit-appearance: none;
  898. -moz-appearance: textfield;
  899. /* 使用等宽字体显示带斜线的0 */
  900. font-family: Consolas, 'Courier New', monospace, -apple-system, BlinkMacSystemFont;
  901. }
  902. // 移除数字输入框的上下箭头
  903. .price-input::-webkit-inner-spin-button,
  904. .price-input::-webkit-outer-spin-button {
  905. -webkit-appearance: none;
  906. margin: 0;
  907. }
  908. .price-input:focus {
  909. background-color: transparent;
  910. }
  911. </style>