pageTwo.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  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. // 创建一个只包含被勾选checkbox对应数据的对象
  344. const result = {};
  345. // 检查联系师傅
  346. if (this.selectedCheckbox.includes('contact师傅')) {
  347. result.contactPhone = this.formData.contactPhone;
  348. }
  349. // 检查师傅拍图技巧
  350. if (this.selectedCheckbox.includes('photo技巧')) {
  351. result.photoTips = this.formData.photoTips;
  352. result.photoTipsImages = this.photoTipsImages;
  353. }
  354. // 检查到达客户面对面
  355. if (this.selectedCheckbox.includes('face2face')) {
  356. result.face2faceNotes = this.formData.face2faceNotes;
  357. result.face2faceImages = this.face2faceImages;
  358. }
  359. // 添加其他非checkbox控制的字段
  360. result.approvedPrice = this.approvedPrice;
  361. result.detailImages = this.detailImages;
  362. // result.selectedCheckbox = this.selectedCheckbox;
  363. // 打印结果对象
  364. // console.log('当前界面的选中值:', result);
  365. this.$emit('handleNextClick', {
  366. nowPage: 'formTwo',
  367. form: result,
  368. })
  369. // 下一步的时候要通过判断是否有联系师傅,师傅拍图技巧,到达客户面对面,如果有的话调uni.$u.api.addOrderFollow(orderFormData);接口按照 联系师傅;内容;url1,url2,url3,的格式上传
  370. //先判断有没有联系师傅
  371. if (this.selectedCheckbox.includes('contact师傅')) {
  372. console.log('触发联系师傅')
  373. // 联系师傅的手机号,已:为分割,取后面的内容
  374. const phone = this.formData.contactPhone || '';
  375. const data = `联系师傅;${phone}`;
  376. // 调用接口上传
  377. await uni.$u.api.addOrderFollow({
  378. orderId: this.orderId,
  379. content: data,
  380. })
  381. }
  382. if (this.selectedCheckbox.includes('photo技巧')) {
  383. console.log('触发师傅拍图技巧')
  384. // 师傅拍图技巧的内容,已:为分割,取后面的内容
  385. const photoTips = this.formData.photoTips || '';
  386. const urls = this.photoTipsImages.join(',');
  387. const data = `师傅拍图技巧;${photoTips};${urls}`;
  388. console.log('urls9999999', data)
  389. await uni.$u.api.addOrderFollow({
  390. orderId: this.orderId,
  391. content: data,
  392. })
  393. }
  394. if (this.selectedCheckbox.includes('face2face')) {
  395. // 到达客户面对面的内容,已:为分割,取后面的内容
  396. const face2faceNotes = this.formData.face2faceNotes || '';
  397. const urls = this.face2faceImages.join(',');
  398. const data = `到达客户面对面;${face2faceNotes};${urls}`;
  399. await uni.$u.api.addOrderFollow({
  400. orderId: this.orderId,
  401. content: data,
  402. })
  403. }
  404. },
  405. checkFollowUpContent() {
  406. // 检查跟进记录是否包含上面的三个选择
  407. //每个检查到一个就不继续检查了
  408. let hasContactMaster = false;
  409. let hasPhotoTips = false;
  410. let hasFace2face = false;
  411. this.followUpListInner.forEach(item => {
  412. console.log('这里是跟进记录', item)
  413. // 判断内容是否含有联系师傅,师傅拍图技巧,到达客户面对面,如果包含的话就上面对应的box就打上对勾
  414. if (item.includes('联系师傅') && !hasContactMaster) {
  415. this.selectedCheckbox.push('contact师傅');
  416. // 联系师傅的手机号,已:为分割,取后面的内容
  417. const phone = item.split(';')[1] || '';
  418. console.log('联系师傅的手机号111111', phone)
  419. this.formData.contactPhone = phone;
  420. hasContactMaster = true;
  421. }
  422. if (item.includes('师傅拍图技巧') && !hasPhotoTips) {
  423. this.selectedCheckbox.push('photo技巧');
  424. // 师傅拍图技巧的内容,已:为分割,取后面的内容
  425. const photoTips = item.split(';')[1] || '';
  426. this.formData.photoTips = photoTips;
  427. const urls = item.split(';')[2] || ''
  428. //把url转为数组
  429. const urlArray = urls.split(',').map(url => url.trim());
  430. this.photoTipsImages = [...this.photoTipsImages, ...urlArray];
  431. hasPhotoTips = true;
  432. }
  433. if (item.includes('到达客户面对面') && !hasFace2face) {
  434. this.selectedCheckbox.push('face2face');
  435. // 到达客户面对面的内容,已:为分割,取后面的内容
  436. const face2faceNotes = item.split(';')[1] || '';
  437. this.formData.face2faceNotes = face2faceNotes;
  438. const urls = item.split(';')[2] || ''
  439. //把url转为数组
  440. const urlArray = urls.split(',').map(url => url.trim());
  441. this.face2faceImages = [...this.face2faceImages, ...urlArray];
  442. hasFace2face = true;
  443. }
  444. })
  445. },
  446. // 处理上传图片,上传图片的话就赋值给对应的数组
  447. async handleUpload(field) {
  448. uni.chooseImage({
  449. count: 9, // 最多选择1张
  450. sizeType: ['compressed'], // 压缩图片
  451. sourceType: ['album', 'camera'], // 从相册选择或拍照
  452. success: async (res) => {
  453. const tempFilePath = res.tempFilePaths
  454. console.log('上传的图片路径:', tempFilePath)
  455. // 把blob数组上传到服务器,然后返回路径
  456. try {
  457. const res = await Promise.all(tempFilePath.map(filePath => uni.$u.api.uploadFile(filePath)));
  458. console.log('上传的图片路径数组是:', res.forEach(item => console.log(item.data.url)))
  459. // 把返回的路径赋值给对应的数组
  460. if (field == 'photoTips') {
  461. this.photoTipsImages = [...this.photoTipsImages, ...res.map(item => item.data.url)];
  462. } else if (field == 'face2faceNotes') {
  463. console.log('1111')
  464. this.face2faceImages = [...this.face2faceImages, ...res.map(item => item.data.url)];
  465. }
  466. } catch (error) {
  467. console.error('上传失败:', error);
  468. uni.$u.toast('上传失败');
  469. }
  470. },
  471. fail: (err) => {
  472. console.error('选择图片失败:', err)
  473. }
  474. })
  475. },
  476. }
  477. };
  478. </script>
  479. <style scoped lang="scss">
  480. // 导入公共样式
  481. @import './common.scss';
  482. // 主样式
  483. .page-container {
  484. box-sizing: border-box;
  485. padding: 0;
  486. background-color: map-get($colors, bg);
  487. font-family: map-get($font, family);
  488. -webkit-font-smoothing: map-get($font, smoothing);
  489. font-smoothing: map-get($font, smoothing);
  490. }
  491. .card_wrap {
  492. @include card;
  493. margin-bottom: 20rpx;
  494. &:hover {
  495. @include shadow(2);
  496. }
  497. &.checklist-card,
  498. &.price-card,
  499. &.detail-image-card {
  500. margin-top: 20rpx;
  501. }
  502. }
  503. .address-section {
  504. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  505. }
  506. .address-header {
  507. @include flex-center;
  508. margin-bottom: map-get($sizes, margin-sm);
  509. padding-bottom: map-get($sizes, margin-sm);
  510. border-bottom: 1rpx solid map-get($colors, border);
  511. .location-icon {
  512. margin-right: map-get($sizes, margin-xs);
  513. background-color: map-get($colors, primary-light);
  514. padding: map-get($sizes, icon-padding);
  515. border-radius: 50%;
  516. flex-shrink: 0;
  517. }
  518. .address-title {
  519. margin-left: 16rpx;
  520. }
  521. }
  522. .address-content {
  523. .address-text {
  524. @include font-styles;
  525. }
  526. }
  527. // 复选框卡片样式
  528. .checklist-card {
  529. margin-top: 20rpx;
  530. }
  531. .checklist-section {
  532. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  533. display: block;
  534. /* 明确设置为块级元素,避免任何flex影响 */
  535. }
  536. .checklist-item {
  537. display: block;
  538. /* 明确设置为块级元素,确保垂直排列 */
  539. width: 100%;
  540. /* 确保占满整个宽度 */
  541. padding: 16rpx 0;
  542. border-bottom: 1rpx solid map-get($colors, border);
  543. margin-bottom: 0;
  544. /* 移除任何可能的margin影响 */
  545. &:first-child {
  546. padding-top: 0;
  547. }
  548. &:last-child {
  549. padding-bottom: 0;
  550. border-bottom: none;
  551. }
  552. // 复选框和文本的容器
  553. .checkbox-text-container {
  554. @include flex-center;
  555. display: flex;
  556. align-items: center;
  557. }
  558. }
  559. // u-checkbox样式调整
  560. u-checkbox {
  561. margin-right: 16rpx;
  562. flex-shrink: 0;
  563. vertical-align: middle;
  564. }
  565. // 隐藏原生checkbox样式
  566. .checkbox {
  567. display: none;
  568. }
  569. .checklist-text {
  570. @include font-styles;
  571. vertical-align: middle;
  572. }
  573. // 输入框样式
  574. .checklist-input,
  575. .checklist-textarea {
  576. margin-top: 12rpx;
  577. margin-left: 56rpx; // 与复选框对齐
  578. width: calc(100% - 72rpx); // 减去左边距和额外的16rpx边距,确保不超出边界
  579. max-width: calc(100% - 72rpx); // 确保最大宽度也不超出
  580. box-sizing: border-box; // 确保padding和border不影响总宽度
  581. border-radius: 8rpx;
  582. border: 1rpx solid #e5e7eb;
  583. padding: 12rpx 16rpx;
  584. font-size: 28rpx;
  585. background-color: #f9fafb;
  586. transition: all 0.2s ease;
  587. &:focus {
  588. border-color: map-get($colors, primary);
  589. background-color: #ffffff;
  590. box-shadow: 0 0 0 2rpx rgba(16, 140, 255, 0.1);
  591. }
  592. }
  593. .checklist-textarea {
  594. min-height: 160rpx;
  595. resize: vertical;
  596. vertical-align: top;
  597. padding-top: 16rpx;
  598. padding-bottom: 16rpx;
  599. }
  600. // 解决textarea文本和placeholder居中问题
  601. // 直接穿透u-input组件的所有层级
  602. :deep(.checklist-textarea) {
  603. & .u-input__textarea {
  604. display: block !important;
  605. height: auto !important;
  606. min-height: 160rpx !important;
  607. padding: 16rpx !important;
  608. text-align: left !important;
  609. }
  610. & .u-input__textarea textarea {
  611. display: block !important;
  612. width: 100% !important;
  613. height: auto !important;
  614. min-height: 128rpx !important;
  615. padding: 0 !important;
  616. margin: 0 !important;
  617. text-align: left !important;
  618. vertical-align: top !important;
  619. line-height: 1.5 !important;
  620. resize: vertical !important;
  621. }
  622. // 确保输入的文本顶部对齐
  623. & .u-input__textarea textarea:focus {
  624. text-align: left !important;
  625. vertical-align: top !important;
  626. }
  627. // 针对不同浏览器的placeholder样式
  628. & .u-input__textarea textarea::-webkit-input-placeholder {
  629. text-align: left !important;
  630. vertical-align: top !important;
  631. line-height: 1.5 !important;
  632. }
  633. & .u-input__textarea textarea::-moz-placeholder {
  634. text-align: left !important;
  635. vertical-align: top !important;
  636. line-height: 1.5 !important;
  637. }
  638. & .u-input__textarea textarea:-ms-input-placeholder {
  639. text-align: left !important;
  640. vertical-align: top !important;
  641. line-height: 1.5 !important;
  642. }
  643. & .u-input__textarea textarea::placeholder {
  644. text-align: left !important;
  645. vertical-align: top !important;
  646. line-height: 1.5 !important;
  647. }
  648. }
  649. // 上传按钮容器样式
  650. .upload-btn-container {
  651. margin-top: 16rpx;
  652. margin-left: 56rpx;
  653. display: inline-block;
  654. }
  655. // 上传按钮样式
  656. .upload-btn {
  657. display: flex;
  658. align-items: center;
  659. justify-content: center;
  660. gap: 12rpx;
  661. font-size: 30rpx;
  662. padding: 20rpx 40rpx;
  663. border-radius: 8rpx;
  664. background-color: map-get($colors, bg);
  665. border: 2rpx dashed map-get($colors, primary);
  666. color: map-get($colors, primary);
  667. transition: all 0.3s ease;
  668. cursor: pointer;
  669. min-width: 200rpx;
  670. box-sizing: border-box;
  671. &:hover {
  672. background-color: map-get($colors, primary-light);
  673. border-color: darken(map-get($colors, primary), 10%);
  674. transform: translateY(-2rpx);
  675. box-shadow: 0 4rpx 16rpx rgba(16, 140, 255, 0.15);
  676. }
  677. &:active {
  678. transform: translateY(0);
  679. }
  680. }
  681. .upload-btn-text {
  682. color: map-get($colors, primary);
  683. @include font-styles($size: small, $weight: medium);
  684. }
  685. // 图片列表样式
  686. .image-list {
  687. margin-top: 16rpx;
  688. margin-left: 56rpx;
  689. display: flex;
  690. flex-wrap: wrap;
  691. gap: 16rpx;
  692. padding-bottom: 8rpx;
  693. }
  694. // 图片项样式
  695. .image-item {
  696. width: 120rpx;
  697. height: 120rpx;
  698. border-radius: 8rpx;
  699. overflow: hidden;
  700. background-color: map-get($colors, bg);
  701. @include shadow(1);
  702. transition: all 0.3s ease;
  703. cursor: pointer;
  704. position: relative;
  705. &:hover {
  706. @include shadow(2);
  707. transform: translateY(-2rpx);
  708. }
  709. }
  710. // 图片缩略图样式
  711. .image-thumb {
  712. width: 100%;
  713. height: 100%;
  714. object-fit: cover;
  715. }
  716. // 价格卡片样式
  717. .price-card {
  718. margin-top: 20rpx;
  719. }
  720. .price-section {
  721. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  722. }
  723. .detail-image-card {
  724. margin-top: 20rpx;
  725. }
  726. .detail-image-section {
  727. padding: map-get($sizes, padding-sm) map-get($sizes, padding);
  728. }
  729. .detail-image-header {
  730. display: flex;
  731. justify-content: space-between;
  732. align-items: center;
  733. margin-bottom: map-get($sizes, margin-sm);
  734. padding-bottom: map-get($sizes, margin-sm);
  735. border-bottom: 1rpx solid map-get($colors, border);
  736. }
  737. .detail-image-title {
  738. @include font-styles($size: content, $weight: bold, $color: primary);
  739. }
  740. .copy-btn {
  741. border-radius: 20rpx;
  742. border: 1rpx solid #007AFF;
  743. background-color: transparent;
  744. color: #007AFF;
  745. @include font-styles($size: small, $weight: regular);
  746. padding: 0 24rpx;
  747. height: 64rpx;
  748. line-height: 64rpx;
  749. display: flex;
  750. align-items: center;
  751. gap: 8rpx;
  752. cursor: pointer;
  753. user-select: none;
  754. transition: all 0.3s ease;
  755. &:hover {
  756. background-color: rgba(0, 122, 255, 0.05);
  757. }
  758. &:active {
  759. transform: scale(0.98);
  760. }
  761. }
  762. .detail-image-upload-container {
  763. margin-top: 20rpx;
  764. }
  765. .detail-image-list {
  766. display: flex;
  767. flex-wrap: wrap;
  768. gap: 20rpx;
  769. }
  770. .detail-image-item {
  771. position: relative;
  772. width: 200rpx;
  773. height: 200rpx;
  774. box-sizing: border-box;
  775. }
  776. .detail-delete-btn {
  777. position: absolute;
  778. top: -10rpx;
  779. right: -10rpx;
  780. width: 40rpx;
  781. height: 40rpx;
  782. background-color: #ff4d4f;
  783. color: #fff;
  784. border-radius: 50%;
  785. display: flex;
  786. align-items: center;
  787. justify-content: center;
  788. @include font-styles($size: small, $weight: bold);
  789. z-index: 10;
  790. }
  791. .detail-upload-btn {
  792. width: 200rpx;
  793. height: 200rpx;
  794. border: 8rpx dashed #ddd;
  795. border-radius: 30rpx;
  796. display: flex;
  797. align-items: center;
  798. justify-content: center;
  799. background-color: #f9f9f9;
  800. box-sizing: border-box;
  801. }
  802. .price-picker-container {
  803. display: flex;
  804. flex-direction: column;
  805. align-items: center;
  806. padding: 20rpx 0;
  807. }
  808. // 快速操作按钮样式
  809. .quick-actions {
  810. display: flex;
  811. justify-content: center;
  812. gap: 16rpx;
  813. margin: 16rpx 0;
  814. width: 100%;
  815. max-width: 800rpx;
  816. }
  817. .quick-btn {
  818. flex: 1;
  819. border-radius: 12rpx;
  820. font-size: 36rpx;
  821. padding: 20rpx 0;
  822. min-width: 0;
  823. text-align: center;
  824. color: #ffffff;
  825. font-weight: 600;
  826. transition: all 0.3s ease;
  827. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  828. cursor: pointer;
  829. }
  830. .quick-btn.increase {
  831. background-color: #e6f7ed;
  832. color: #00b42a;
  833. }
  834. .quick-btn.decrease {
  835. background-color: #fff1f0;
  836. color: #f53f3f;
  837. }
  838. .quick-btn:hover {
  839. opacity: 0.9;
  840. transform: translateY(-2rpx);
  841. box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.15);
  842. }
  843. // 数字选择器容器
  844. .number-box-container {
  845. display: flex;
  846. align-items: center;
  847. gap: 16rpx;
  848. margin: 20rpx 0;
  849. width: 100%;
  850. justify-content: center;
  851. white-space: nowrap;
  852. }
  853. // 价格输入框盒子
  854. .price-input-box {
  855. flex: 1;
  856. max-width: 800rpx;
  857. background-color: #f5f7fa;
  858. border: 2rpx solid #e5e7eb;
  859. border-radius: 12rpx;
  860. padding: 20rpx 24rpx;
  861. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  862. display: flex;
  863. align-items: center;
  864. justify-content: space-between;
  865. white-space: nowrap;
  866. min-width: 300rpx;
  867. }
  868. // 价格标签样式
  869. .price-label {
  870. font-size: 36rpx;
  871. color: map-get($colors, text-primary);
  872. font-weight: 700;
  873. min-width: 120rpx;
  874. flex-shrink: 0;
  875. margin-right: 16rpx;
  876. letter-spacing: 1rpx;
  877. font-family: map-get($font, family);
  878. }
  879. // 价格输入框样式
  880. .price-input {
  881. width: 100%;
  882. height: auto;
  883. border: none;
  884. outline: none;
  885. background-color: transparent;
  886. text-align: right;
  887. font-size: 48rpx;
  888. font-weight: 600;
  889. color: map-get($colors, text-primary);
  890. padding: 0 10rpx;
  891. box-sizing: border-box;
  892. -webkit-appearance: none;
  893. -moz-appearance: textfield;
  894. /* 使用等宽字体显示带斜线的0 */
  895. font-family: Consolas, 'Courier New', monospace, -apple-system, BlinkMacSystemFont;
  896. }
  897. // 移除数字输入框的上下箭头
  898. .price-input::-webkit-inner-spin-button,
  899. .price-input::-webkit-outer-spin-button {
  900. -webkit-appearance: none;
  901. margin: 0;
  902. }
  903. .price-input:focus {
  904. background-color: transparent;
  905. }
  906. </style>