You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

896 lines
27 KiB

1 week ago
  1. <template>
  2. <view class="service-info container">
  3. <view style="margin: 15px 15px 10px;">
  4. <uni-steps :options="serviceStep" active-icon="checkbox" :active="active" active-color='#ffbf60' activeTextColor='#ffbf60' />
  5. </view>
  6. <view v-if="active == 0" class="">
  7. <view class="service-card">
  8. <view class="service-card-title">
  9. <text class="service-card-title-flag"></text>
  10. 本次喂养过程中您需要喂养的食品包括
  11. </view>
  12. <view v-for="(item, index) in foods" :key="index" class="service-item">
  13. <view class="service-item-title">
  14. <view class="service-item-title-name">
  15. {{ item.name }}
  16. </view>
  17. <view class="service-item-title-switch">
  18. <view :style="{'color':item.status?'#333333':'#aaaaaa', 'margin-right': '10px'}">{{ item.status ? '是' : '否' }}</view>
  19. <view>
  20. <u-switch v-model="item.status" inactiveColor="#dddddd" :activeValue="true"></u-switch>
  21. </view>
  22. </view>
  23. </view>
  24. <view v-if="item.status" class="service-item-content">
  25. <view style="color: #333;">{{item.nameSort}}摆放位置</view>
  26. <view style="margin: 10px 0;">
  27. <UploadComponent :imageUrl.sync="item.locationImage"></UploadComponent>
  28. </view>
  29. <view class="service-item-image-tip">
  30. <text style="color:#ff3d3d;line-height: 2;">* </text>请在图片中, 红圈圈出{{item.nameSort}}摆放位置
  31. </view>
  32. <view v-if="item.needInput" class="service-item-input">
  33. <view>{{ item.nameSort }}喂养重量</view>
  34. <view style="width: 100px; display: flex;">
  35. <u-input v-model="item.foodWeight" border="bottom" :customStyle="{'padding':'0 0 0 5px'}">
  36. </u-input>
  37. <u--text :text="item.unit" margin="0 3px 0 0" type="tips"></u--text>
  38. </view>
  39. </view>
  40. <view v-if="item.needInput" class="service-item-input">
  41. <view>{{ item.nameSort }}喂养频率</view>
  42. <view style="width: 100px; display: flex;">
  43. <u-input v-model="item.frequency" border="bottom" type="number" :customStyle="{'padding':'0 0 0 5px'}">
  44. </u-input>
  45. <u--text text="次/天" margin="0 3px 0 0" type="tips"></u--text>
  46. </view>
  47. </view>
  48. <view>
  49. <view style="margin: 10px 0;">{{item.remarkTip?item.remarkTip:'备注信息'}}</view>
  50. <u-input placeholder="请输入备注信息" v-model="item.remark"></u-input>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view>
  56. <view v-for="(item, index) in otherTool" :key="item.name" class="service-card">
  57. <view class="service-card-title">
  58. <text class="service-card-title-flag"></text>
  59. <view class="service-card-title-name">
  60. {{ item.name }}
  61. </view>
  62. </view>
  63. <view class="service-item-content">
  64. <view style="color: #333; margin-top: 10px;">{{item.nameSort}}摆放位置</view>
  65. <view style="margin: 10px 0;" v-if="item.locationImage">
  66. <UploadComponent :imageUrl.sync="item.locationImage"></UploadComponent>
  67. </view>
  68. <view style="margin: 10px 0;" v-else>
  69. <UploadComponent :imageUrl.sync="item.locationImage"></UploadComponent>
  70. </view>
  71. <view class="service-item-image-tip">
  72. <text style="color:#ff3d3d;line-height: 2;">* </text>请在图片中, 红圈圈出{{item.nameSort}}摆放位置
  73. </view>
  74. <view>
  75. <view style="margin: 10px 0;">{{item.remarkTip?item.remarkTip:'备注信息'}}</view>
  76. <u-input placeholder="请输入备注信息" v-model="item.remark"></u-input>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="service-card">
  82. <view class="service-card-title">
  83. <text class="service-card-title-flag"></text>
  84. 其他补充信息(非必填)
  85. </view>
  86. <view>
  87. <view style="margin: 10px 0;">备注信息</view>
  88. <u-input placeholder="请输入备注信息" v-model="otherRemark"></u-input>
  89. </view>
  90. </view>
  91. </view>
  92. <view v-if="active == 1">
  93. <view class="service-card">
  94. <view class="service-card-title">
  95. <text class="service-card-title-flag"></text>
  96. 本次喂养过程中您需要清洁的内容包括
  97. </view>
  98. <view v-for="(item, index) in cleans" :key="index" class="service-item">
  99. <view class="service-item-title">
  100. <view class="service-item-title-name">
  101. {{ item.name }}
  102. </view>
  103. <view class="service-item-title-switch">
  104. <view :style="{'color':item.status?'#333333':'#aaaaaa', 'margin-right': '10px'}">{{ item.status ? '是' : '否' }}</view>
  105. <view>
  106. <u-switch v-model="item.status" inactiveColor="#dddddd" :activeValue="true"></u-switch>
  107. </view>
  108. </view>
  109. </view>
  110. <view v-if="item.status" class="service-item-content">
  111. <view style="color: #333;">{{item.nameSort}}摆放位置</view>
  112. <view style="margin: 10px 0;">
  113. <UploadComponent :imageUrl.sync="item.locationImage"></UploadComponent>
  114. </view>
  115. <view class="service-item-image-tip">
  116. <text style="color:#ff3d3d;line-height: 2;">* </text>请在图片中, 红圈圈出{{item.nameSort}}摆放位置
  117. </view>
  118. <view v-if="item.needInput" class="service-item-input">
  119. <view>{{ item.nameSort }}更换频率</view>
  120. <view style="width: 100px; display: flex;">
  121. <u-input v-model="item.frequency" border="bottom" type="number" :customStyle="{'padding':'0 0 0 5px'}">
  122. </u-input>
  123. <u--text text="次/天" margin="0 3px 0 0" type="tips"></u--text>
  124. </view>
  125. </view>
  126. <view>
  127. <view style="margin: 10px 0;">{{item.remarkTip?item.remarkTip:'备注信息'}}</view>
  128. <u-input placeholder="请输入备注信息" v-model="item.remark"></u-input>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. <view v-if="active == (serviceStep.length-1)">
  135. <view class="service-card">
  136. <view class="service-card-title">
  137. <text class="service-card-title-flag"></text>
  138. 请选择您需要的附加服务类型
  139. </view>
  140. <view v-for="(item, index) in addpends" :key="index" class="service-item">
  141. <view class="service-item-title">
  142. <view class="service-item-title-name">
  143. {{ item.name }}
  144. </view>
  145. <view class="service-item-title-switch">
  146. <view :style="{'color':item.status?'#333333':'#aaaaaa', 'margin-right': '10px'}">{{ item.status ? '是' : '否' }}</view>
  147. <view>
  148. <u-switch v-model="item.status" inactiveColor="#dddddd" :activeValue="true"></u-switch>
  149. </view>
  150. </view>
  151. </view>
  152. <view v-if="item.status" class="service-item-content">
  153. <view style="color: #333;">{{item.nameSort}}摆放位置</view>
  154. <view style="margin: 10px 0;">
  155. <UploadComponent :imageUrl.sync="item.locationImage"></UploadComponent>
  156. </view>
  157. <view class="service-item-image-tip">
  158. <text style="color:#ff3d3d;line-height: 2;">* </text>请在图片中, 红圈圈出{{item.nameSort}}摆放位置
  159. </view>
  160. <view>
  161. <view style="margin: 10px 0;">{{item.remarkTip?item.remarkTip:'备注信息'}}</view>
  162. <u-input placeholder="请输入备注信息" v-model="item.remark"></u-input>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. <view v-if="active == 2 && petType == 'dog'">
  169. <view class="service-card">
  170. <view class="service-card-title">
  171. <text class="service-card-title-flag"></text>
  172. 遛狗用品
  173. </view>
  174. <view class="service-item">
  175. <view class="service-item-content">
  176. <view style="color: #333;">遛狗用品摆放位置</view>
  177. <view style="margin: 10px 0;">
  178. <UploadComponent :imageUrl.sync="walkDogLocationImage"></UploadComponent>
  179. </view>
  180. <view class="service-item-image-tip">
  181. <text style="color:#ff3d3d;line-height: 2;">* </text>请在图片中, 红圈圈出遛狗用品摆放位置
  182. </view>
  183. </view>
  184. </view>
  185. <view v-for="(item, index) in walk" :key="index" class="service-item">
  186. <view class="service-item-title">
  187. <view class="service-item-title-name" style="color: #333;">
  188. {{ item.name }}
  189. </view>
  190. <view class="service-item-title-switch">
  191. <view :style="{'color':item.status?'#333333':'#aaaaaa', 'margin-right': '10px'}">{{ item.status ? '是' : '否' }}</view>
  192. <view>
  193. <u-switch v-model="item.status" inactiveColor="#dddddd" :activeValue="true"></u-switch>
  194. </view>
  195. </view>
  196. </view>
  197. <view v-if="item.status" class="service-item-content">
  198. <view style="color: #333;">{{item.nameSort}}摆放位置</view>
  199. <view style="margin: 10px 0;">
  200. <UploadComponent :imageUrl.sync="item.locationImage"></UploadComponent>
  201. </view>
  202. <view class="service-item-image-tip">
  203. <text style="color:#ff3d3d;line-height: 2;">* </text>请在图片中, 红圈圈出{{item.nameSort}}摆放位置
  204. </view>
  205. <view>
  206. <view style="margin: 10px 0;">{{item.remarkTip?item.remarkTip:'备注信息'}}</view>
  207. <u-input placeholder="请输入备注信息" v-model="item.remark"></u-input>
  208. </view>
  209. </view>
  210. </view>
  211. </view>
  212. <view class="service-card">
  213. <view class="service-card-title">
  214. <text class="service-card-title-flag"></text>
  215. 注意事项(非必填)
  216. </view>
  217. <view v-for="(item, index) in needDos" :key="index" class="service-item">
  218. <view class="service-item-title">
  219. <view class="service-item-title-name">
  220. {{ item.name }}
  221. </view>
  222. <view class="service-item-title-switch">
  223. <view :style="{'color':item.status?'#333333':'#aaaaaa', 'margin-right': '10px'}">{{ item.status ? '是' : '否' }}</view>
  224. <view>
  225. <u-switch v-model="item.status" inactiveColor="#dddddd" :activeValue="true"></u-switch>
  226. </view>
  227. </view>
  228. </view>
  229. <view v-if="item.status">
  230. <view>
  231. <view style="margin: 10px 0;">备注信息</view>
  232. <u-input :placeholder="item.remarkTip?item.remarkTip:'请输入备注信息'" v-model="item.remark"></u-input>
  233. </view>
  234. </view>
  235. </view>
  236. </view>
  237. </view>
  238. <view class="service-info-btns">
  239. <view class="personal-service-btns">
  240. <view class="personal-service-btn">
  241. <u-button color="#FFF4E4" :disabled="active==0" @click="previousStep">
  242. <view style="color: #FFBF60;">
  243. 上一步
  244. </view>
  245. </u-button>
  246. </view>
  247. <view class="personal-service-btn" >
  248. <u-button v-if="active<(serviceStep.length-1)" color="#FFBF60" @click="nextStep">
  249. <view style="color: #fff;">
  250. 下一步
  251. </view>
  252. </u-button>
  253. <u-button v-else color="#FFBF60" @click="submit" :loading="loading">
  254. <view style="color: #fff;">
  255. 提交
  256. </view>
  257. </u-button>
  258. </view>
  259. </view>
  260. </view>
  261. </view>
  262. </template>
  263. <script>
  264. import { getServiceInfo,addServiceInfo,updateServiceInfo} from '@/api/system/service.js'
  265. import UploadComponent from './components/uploadComponent.vue';
  266. export default {
  267. data() {
  268. return {
  269. loading:false,
  270. id:'',
  271. petId:'',
  272. petType: 'dog',
  273. serviceStep: [],
  274. active: 0,
  275. foods: [
  276. {
  277. name: '干粮(主粮、冻干等)',
  278. nameSort: '干粮',
  279. status: false,
  280. locationImage: '',
  281. foodWeight: '',
  282. frequency: '',
  283. unit: '/次',
  284. needInput:true,
  285. remarkTip:'',
  286. remark: ''
  287. },
  288. {
  289. name: '湿粮(罐头等)',
  290. nameSort: '湿粮',
  291. status: false,
  292. locationImage: '',
  293. foodWeight: '',
  294. frequency: '',
  295. unit: '罐/次',
  296. needInput:true,
  297. remarkTip:'',
  298. remark: ''
  299. }, {
  300. name: '自制食品',
  301. nameSort: '自制食品',
  302. status: false,
  303. locationImage: '',
  304. foodWeight: '',
  305. frequency: '',
  306. needInput:false,
  307. remarkTip:'自制饭制作和喂食说明',
  308. remark: ''
  309. }, {
  310. name: '生骨肉',
  311. nameSort: '生骨肉',
  312. status: false,
  313. locationImage: '',
  314. foodWeight: '',
  315. frequency: '',
  316. needInput:false,
  317. remarkTip:'生骨肉喂食说明',
  318. remark: ''
  319. }, {
  320. name: '保健品',
  321. nameSort: '保健品',
  322. status: false,
  323. locationImage: '',
  324. foodWeight: '',
  325. frequency: '',
  326. needInput:false,
  327. remarkTip:'保健品喂养方式',
  328. remark: ''
  329. },
  330. {
  331. name: '零食',
  332. nameSort: '零食',
  333. status: false,
  334. locationImage: '',
  335. foodWeight: '',
  336. frequency: '',
  337. needInput:false,
  338. remarkTip:'零食喂养方式',
  339. remark: ''
  340. }
  341. ],
  342. otherTool:[
  343. {
  344. name: '食盆/自动喂食器',
  345. nameSort: '喂食器',
  346. locationImage: '',
  347. remarkTip:'',
  348. remark: ''
  349. },
  350. {
  351. name: '饮用水',
  352. nameSort: '饮用水',
  353. locationImage: '',
  354. remarkTip:'饮用水添加要求',
  355. remark: ''
  356. },
  357. ],
  358. cleans:[
  359. {
  360. name: '猫砂',
  361. nameSort: '猫砂',
  362. status: false,
  363. locationImage: '',
  364. frequency: '',
  365. needInput:true,
  366. remark: ''
  367. },
  368. {
  369. name: '尿垫',
  370. nameSort: '尿垫',
  371. status: false,
  372. locationImage: '',
  373. frequency: '',
  374. needInput:true,
  375. remark: ''
  376. }
  377. ],
  378. addpends:[
  379. {
  380. name: '陪玩',
  381. nameSort: '陪玩用品',
  382. status:false,
  383. locationImage: '',
  384. remarkTip:'您希望的互动方式和要求',
  385. remark: ''
  386. },
  387. {
  388. name: '活动区吸毛',
  389. nameSort: '吸毛用品',
  390. status:false,
  391. locationImage: '',
  392. remarkTip:'请说明吸毛区域及要求',
  393. remark: ''
  394. },
  395. {
  396. name: '毛发梳理',
  397. nameSort: '毛发梳理用品',
  398. status:false,
  399. locationImage: '',
  400. remarkTip:'请说明毛发梳理要求(如: 天数, 次数等)',
  401. remark: ''
  402. },
  403. {
  404. name: '食具深度清洁',
  405. nameSort: '需深度清洁的用具及消毒剂',
  406. status:false,
  407. locationImage: '',
  408. remarkTip:'请说明食具/饮水机深度清洁要求(如清洁方式、消毒剂使用方式、频率等)',
  409. remark: ''
  410. },
  411. {
  412. name: '喂药上药',
  413. nameSort: '药品',
  414. status:false,
  415. locationImage: '',
  416. remarkTip:'备注信息',
  417. remark: ''
  418. },
  419. ],
  420. walkDogLocationImage:'',
  421. walk:[
  422. {
  423. name: '下雨天是否遛狗',
  424. status:false,
  425. nameSort: '狗狗雨具',
  426. locationImage: '',
  427. remarkTip:'雨天遛狗要求',
  428. remark: ''
  429. }
  430. ],
  431. needDos:[
  432. {
  433. name: '遛狗时长',
  434. status:false,
  435. remarkTip:'',
  436. remark: ''
  437. },
  438. {
  439. name: '狗狗行为',
  440. status:false,
  441. remarkTip:'请输入备注信息(是否爆冲、避开其他狗等)',
  442. remark: ''
  443. },
  444. {
  445. name: '偏好区域',
  446. status:false,
  447. remarkTip:'请输入备注信息(如禁止狗狗进入的区域)',
  448. remark: ''
  449. },
  450. {
  451. name: '偏好路线',
  452. status:false,
  453. remarkTip:'请输入备注信息(如建议遛狗路线)',
  454. remark: ''
  455. },
  456. ],
  457. otherRemark:''
  458. };
  459. },
  460. components:{
  461. UploadComponent
  462. },
  463. onLoad: function (option) {
  464. this.petType = option.petType || 'dog';
  465. this.petId= option.petId
  466. // this.petId= 123 //option.petId
  467. },
  468. mounted() {
  469. this.getServiceStep()
  470. this.getServiceInfo()
  471. },
  472. methods: {
  473. getServiceStep() {
  474. if (this.petType == 'dog') {
  475. this.serviceStep = [{
  476. title: '喂养要求'
  477. }, {
  478. title: '清洁要求'
  479. }, {
  480. title: '遛狗要求'
  481. }, {
  482. title: '附加服务'
  483. },]
  484. } else {
  485. this.serviceStep = [{
  486. title: '喂养要求'
  487. }, {
  488. title: '清洁要求'
  489. }, {
  490. title: '附加服务'
  491. },]
  492. }
  493. },
  494. getServiceInfo(){
  495. getServiceInfo(this.petId).then(res=>{
  496. if(res.code==200&&res.data){
  497. let data= res.data
  498. this.id = data.id
  499. this.petId= data.petId
  500. this.foods[0].status= data.includeDryFood
  501. this.foods[0].frequency= data.dryFoodFeedFrequencyTimes
  502. this.foods[0].foodWeight= data.dryFoodFeedWeight
  503. this.foods[0].locationImage= data.dryFoodLocation
  504. this.foods[0].remark= data.dryFoodRemarks
  505. this.foods[1].status= data.includeWetFood
  506. this.foods[1].frequency= data.wetFoodFeedFrequencyTimes
  507. this.foods[1].foodWeight= data.wetFoodFeedWeight
  508. this.foods[1].locationImage= data.wetFoodLocation
  509. this.foods[1].remark= data.wetFoodRemarks
  510. this.foods[2].status= data.includeHomemadeFood
  511. this.foods[2].remark= data.homemadeFoodInstructions
  512. this.foods[2].locationImage= data.homemadeFoodLocation
  513. this.foods[3].status= data.includeRawMeat
  514. this.foods[3].remark= data.rawMeatFeedingInstructions
  515. this.foods[3].locationImage= data.rawMeatLocation
  516. this.foods[4].status= data.includeHealthSupplements
  517. this.foods[4].remark= data.healthSupplementsFeedingInstructions
  518. this.foods[4].locationImage= data.healthSupplementsLocation
  519. this.foods[5].status= data.includeSnacks
  520. this.foods[5].remark= data.snacksFeedingMethod
  521. this.foods[5].locationImage= data.snacksLocation
  522. this.otherRemark= data.otherRemark
  523. this.otherTool[0].locationImage= data.feedingTrayAutomaticFeederLocation
  524. this.otherTool[0].remark= data.feedingTrayAutomaticFeederRemarks
  525. this.otherTool[1].locationImage= data.waterBowlLocation
  526. this.otherTool[1].remark= data.waterBowlRemarks
  527. this.cleans[0].status= data.changeLitterBox
  528. this.cleans[0].frequency= data.litterBoxChangeFrequencyTimes
  529. this.cleans[0].locationImage= data.litterBoxLocation
  530. this.cleans[0].remark= data.litterBoxRemarks
  531. this.cleans[1].status= data.changePeePad
  532. this.cleans[1].frequency=data.peePadFrequencyTimes
  533. this.cleans[1].locationImage= data.peePadLocation
  534. this.cleans[1].remark= data.peePadRemarks
  535. this.addpends[0].remark= data.playtimeRequirements
  536. this.addpends[0].status= data.playtimeService
  537. this.addpends[0].locationImage= data.playtimeToolsLocation
  538. this.addpends[1].remark= data.furCleaningRequirements
  539. this.addpends[1].status= data.furCleaningService
  540. this.addpends[1].locationImage= data.furCleaningToolsLocation
  541. this.addpends[2].remark= data.groomingRequirements
  542. this.addpends[2].status= data.groomingService
  543. this.addpends[2].locationImage= data.groomingToolsLocation
  544. this.addpends[3].remark= data.deepCleaningRemarks
  545. this.addpends[3].status= data.deepCleaningService
  546. this.addpends[3].locationImage= data.deepCleaningToolsLocation
  547. this.addpends[4].status= data.administerMedication
  548. this.addpends[4].locationImage= data.administerMedicationLocation
  549. this.addpends[4].remark= data.administerMedicationRemarks
  550. this.needDos[0].status= data.isWalkDogDuration
  551. this.needDos[1].status= data.isDogBehavior
  552. this.needDos[2].status= data.isFavoriteRegion
  553. this.needDos[3].status= data.isFavoriteRoute
  554. this.needDos[0].remark= data.walkDogDuration
  555. this.needDos[1].remark= data.dogBehavior
  556. this.needDos[2].remark= data.favoriteRegion
  557. this.needDos[3].remark= data.favoriteRoute
  558. this.needDos[0].status= data.walkDog
  559. this.walk[0].status= data.walkDogRainyDay
  560. this.walkDogLocationImage= data.walkDogToolsLocation
  561. this.walk[0].locationImage= data.dogRainGearLocation
  562. this.walk[0].remark= data.walkDogRainRemark
  563. }
  564. })
  565. },
  566. previousStep(){
  567. this.active = this.active - 1
  568. },
  569. nextStep(){
  570. let isVaild = true;
  571. let errorTip = ''
  572. if(this.active==0){
  573. if(!this.otherTool[0].locationImage){
  574. isVaild = false;
  575. errorTip='请上传喂食器具摆放位置'
  576. }
  577. if(!this.otherTool[1].locationImage){
  578. isVaild = false;
  579. errorTip='请上传饮用水摆放位置'
  580. }
  581. this.foods.map(item=>{
  582. if(item.status && !item.locationImage){
  583. isVaild = false;
  584. errorTip=`请上传${item.nameSort}摆放位置`
  585. }
  586. })
  587. }
  588. if(this.active==1){
  589. this.cleans.map(item=>{
  590. if(item.status && !item.locationImage){
  591. isVaild = false;
  592. errorTip=`请上传${item.nameSort}摆放位置`
  593. }
  594. })
  595. }
  596. if(this.active == 2 && this.petType == 'dog'){
  597. this.walk.map(item=>{
  598. if(item.status && !item.locationImage){
  599. isVaild = false;
  600. errorTip=`请上传${item.nameSort}摆放位置`
  601. }
  602. })
  603. }
  604. if(isVaild == false){
  605. this.$modal.showToast(errorTip);
  606. return;
  607. }
  608. this.active = this.active + 1
  609. },
  610. submit(){
  611. let isVaild = true;
  612. let errorTip = ''
  613. if(this.active == (this.serviceStep.length-1)){
  614. this.addpends.map(item=>{
  615. if(item.status && !item.locationImage){
  616. isVaild = false;
  617. errorTip=`请上传${item.nameSort}摆放位置`
  618. }
  619. })
  620. }
  621. if(isVaild == false){
  622. this.$modal.showToast(errorTip);
  623. return;
  624. }
  625. let params = {
  626. "id": this.id?this.id:0,
  627. "petId": this.petId,
  628. "includeDryFood": this.foods[0].status,
  629. "dryFoodFeedFrequencyDays": 1,
  630. "dryFoodFeedFrequencyTimes": this.foods[0].frequency,
  631. "dryFoodFeedWeight": this.foods[0].foodWeight,
  632. "dryFoodLocation": this.foods[0].locationImage,
  633. "dryFoodRemarks": this.foods[0].remark,
  634. "includeWetFood": this.foods[1].status,
  635. "wetFoodFeedFrequencyDays": 1,
  636. "wetFoodFeedFrequencyTimes": this.foods[1].frequency,
  637. "wetFoodFeedWeight": this.foods[1].foodWeight,
  638. "wetFoodLocation": this.foods[1].locationImage,
  639. "wetFoodRemarks": this.foods[1].remark,
  640. "includeHomemadeFood": this.foods[2].status,
  641. "homemadeFoodInstructions": this.foods[2].remark,
  642. "homemadeFoodLocation": this.foods[2].locationImage,
  643. "includeRawMeat": this.foods[3].status,
  644. "rawMeatFeedingInstructions": this.foods[3].remark,
  645. "rawMeatLocation": this.foods[3].locationImage,
  646. "includeHealthSupplements": this.foods[4].status,
  647. "healthSupplementsFeedingInstructions": this.foods[4].remark,
  648. "healthSupplementsLocation":this.foods[4].locationImage,
  649. "includeSnacks": this.foods[5].status,
  650. "snacksFeedingMethod": this.foods[5].remark,
  651. "snacksLocation": this.foods[5].locationImage,
  652. // 其他补充信息?
  653. // "snacksRemarks": this.otherRemark,
  654. "otherRemark": this.otherRemark,
  655. "feedingTrayAutomaticFeederLocation": this.otherTool[0].locationImage,
  656. "feedingTrayAutomaticFeederRemarks": this.otherTool[0].remark,
  657. "waterBowlLocation": this.otherTool[1].locationImage,
  658. "waterBowlRemarks": this.otherTool[1].remark,
  659. // 是否需要猫砂?
  660. "changeLitterBox":this.cleans[0].status,
  661. "litterBoxChangeFrequencyDays": 1,
  662. "litterBoxChangeFrequencyTimes": this.cleans[0].frequency,
  663. "litterBoxLocation": this.cleans[0].locationImage,
  664. "litterBoxRemarks": this.cleans[0].remark,
  665. // 尿垫更换频率?
  666. "changePeePad": this.cleans[1].status,
  667. "peePadFrequencyDays": 1,
  668. "peePadFrequencyTimes": this.cleans[1].frequency,
  669. "peePadLocation": this.cleans[1].locationImage,
  670. "peePadRemarks": this.cleans[1].remark,
  671. "playtimeRequirements": this.addpends[0].remark,
  672. "playtimeService": this.addpends[0].status,
  673. "playtimeToolsLocation":this.addpends[0].locationImage,
  674. "furCleaningRequirements": this.addpends[1].remark,
  675. "furCleaningService": this.addpends[1].status,
  676. "furCleaningToolsLocation": this.addpends[1].locationImage,
  677. "groomingRequirements": this.addpends[2].remark,
  678. "groomingService": this.addpends[2].status,
  679. "groomingToolsLocation": this.addpends[2].locationImage,
  680. "deepCleaningRemarks": this.addpends[3].remark,
  681. "deepCleaningService": this.addpends[3].status,
  682. "deepCleaningToolsLocation": this.addpends[3].locationImage,
  683. "administerMedication": this.addpends[4].status,
  684. "administerMedicationLocation": this.addpends[4].locationImage,
  685. "administerMedicationRemarks": this.addpends[4].remark,
  686. // 遛狗注意事项状态?
  687. "isWalkDogDuration":this.needDos[0].status,
  688. "isDogBehavior":this.needDos[1].status,
  689. "isFavoriteRegion":this.needDos[2].status,
  690. "isFavoriteRoute":this.needDos[3].status,
  691. "walkDogDuration": this.needDos[0].remark,
  692. "dogBehavior": this.needDos[1].remark,
  693. "favoriteRegion": this.needDos[2].remark,
  694. "favoriteRoute": this.needDos[3].remark,
  695. //遛狗?
  696. "walkDog": this.needDos[0].status,
  697. "walkDogRainyDay": this.walk[0].status,
  698. // 遛狗用品?雨具?
  699. "walkDogToolsLocation": this.walkDogLocationImage,
  700. "dogRainGearLocation": this.walk[0].locationImage,
  701. "walkDogRainRemark":this.walk[0].remark,
  702. // "additionalService": true,
  703. // "additionalServicesPlacement": "string",
  704. // "additionalServicesPlacementRemark": "string",
  705. // "additionalServicesRemarks": "string",
  706. // "cleaningRequirements": true,
  707. }
  708. console.log('提交')
  709. console.log(params)
  710. this.loading=true;
  711. try {
  712. if(this.id){
  713. updateServiceInfo(params).then(res=>{
  714. console.log(res)
  715. if(res.code==200){
  716. uni.showToast({
  717. title: '保存成功!',
  718. duration: 3000,
  719. icon:"none"
  720. })
  721. setTimeout(() => {
  722. let len = getCurrentPages().length;
  723. this.loading=false;
  724. if(len >= 2) {
  725. uni.navigateBack();
  726. }else {
  727. uni.redirectTo({url:'/pages/personalCenter/service'});
  728. }
  729. }, 2000);
  730. }else {
  731. this.loading=false
  732. uni.showToast({
  733. title: '保存失败!',
  734. duration: 3000,
  735. icon:"none"
  736. })
  737. }
  738. })
  739. }else{
  740. addServiceInfo(params).then(res=>{
  741. if(res.code==200){
  742. uni.showToast({
  743. title: '保存成功!',
  744. duration: 3000,
  745. icon:"none"
  746. })
  747. setTimeout(() => {
  748. let len = getCurrentPages().length;
  749. this.loading=false;
  750. if(len >= 2) {
  751. uni.navigateBack();
  752. }else {
  753. uni.redirectTo({url:'/pages/personalCenter/service'});
  754. }
  755. }, 2000);
  756. }else {
  757. this.loading=false
  758. uni.showToast({
  759. title: '保存失败!',
  760. duration: 3000,
  761. icon:"none"
  762. })
  763. }
  764. })
  765. }
  766. } catch (error) {
  767. this.loading=false;
  768. uni.showToast({
  769. title: '保存失败!',
  770. duration: 3000,
  771. icon:"none"
  772. })
  773. } finally {
  774. this.loading=false;
  775. }
  776. }
  777. }
  778. }
  779. </script>
  780. <style lang="scss">
  781. .container {
  782. position: relative;
  783. height: 100%;
  784. padding-bottom: 90px;
  785. .service-info-btns {
  786. background-color: #FFFFFF;
  787. padding: 10px 20px 40px;
  788. width: 100%;
  789. height: 90px;
  790. position: fixed;
  791. bottom: 0;
  792. z-index: 100;
  793. .personal-service-btns{
  794. display: flex;
  795. justify-content: space-around;
  796. align-items: center;
  797. flex-wrap: nowrap;
  798. flex-direction: row;
  799. .personal-service-btn{
  800. width: 40%;
  801. }
  802. }
  803. }
  804. }
  805. .service-info{
  806. .service-card{
  807. margin: 10px;
  808. background: #fff;
  809. padding: 10px;
  810. border-radius: 5px;
  811. .service-card-title{
  812. display: flex;
  813. align-items: center;
  814. padding-bottom: 10px;
  815. border-bottom: solid 1px #efefef;
  816. font-size: 14px;
  817. font-weight: 500;
  818. color: #333;
  819. .service-card-title-flag{
  820. width: 4px;
  821. height: 16px;
  822. flex-shrink: 0;
  823. border-radius: 15px;
  824. background: #FFBF60;
  825. display: inline-block;
  826. margin-right: 5px;
  827. }
  828. }
  829. .service-item{
  830. .service-item-title{
  831. display: flex;
  832. align-items: center;
  833. justify-content: space-between;
  834. height: 50px;
  835. border-bottom: solid 1px #efefef;
  836. .service-item-title-name{
  837. display: flex;
  838. align-items: center;
  839. color: #a94f20;
  840. height: 30px;
  841. }
  842. .service-item-title-switch{
  843. display: flex;
  844. align-items: center;
  845. justify-content: flex-end;
  846. }
  847. }
  848. .service-item-content{
  849. padding: 10px 0;
  850. .service-item-image-tip{
  851. font-size: 12px;
  852. color: #aaa;
  853. display: flex;
  854. padding-bottom: 10px;
  855. border-bottom: solid 1px #efefef;
  856. }
  857. .service-item-input{
  858. display: flex;
  859. align-items: center;
  860. justify-content: space-between;
  861. padding: 10px 0;
  862. border-bottom: solid 1px #efefef;
  863. }
  864. }
  865. }
  866. }
  867. }
  868. </style>