猫妈狗爸伴宠师小程序前端代码
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.

174 lines
4.1 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <view class="tips color-ffb size-22">
  4. 注意:这段内容将会在您的喂养员个人主页做为"服务案例展示并开放给其他铲屎官查看请认真编辑哟
  5. </view>
  6. <view class="li bg-fff">
  7. <view class="title">
  8. 服务类型
  9. <text class="size-22 color-999 ml10">可多选</text>
  10. </view>
  11. <up-checkbox-group v-model="state.petType" @change="checkboxChange">
  12. <view class="flex-between mt40" style="width: 100%;">
  13. <up-checkbox shape="circle" class="mr10" :customStyle="{marginBottom: '8px'}"
  14. v-for="(item, index) in petTypeOptions" :key="index" :label="item.name" :name="item.name">
  15. </up-checkbox>
  16. </view>
  17. </up-checkbox-group>
  18. </view>
  19. <view class="li bg-fff">
  20. <view class="title">
  21. 服务时间
  22. </view>
  23. <view class="flex-between mt16">
  24. <text class="size-28 color-999">选择服务时间</text>
  25. <view class="flex-rowr" @click="openTimePicker">
  26. <view class="t-r size-28 mr10" :class="[state.serveTime ? 'highlight' : '']">{{ serveTimeDesc }}</view>
  27. <up-icon name="arrow-right" color="#999999" size="27rpx"></up-icon>
  28. </view>
  29. </view>
  30. <up-datetime-picker
  31. v-model="state.serveTime"
  32. :show="showTimePicker"
  33. mode="date"
  34. :closeOnClickOverlay="true"
  35. @close="closeTimePicker"
  36. @cancel="closeTimePicker"
  37. @confirm="closeTimePicker"
  38. ></up-datetime-picker>
  39. </view>
  40. <view class="li bg-fff">
  41. <view class="title">
  42. 服务地点
  43. </view>
  44. <view class="flex-between mt16">
  45. <text class="size-28 color-999">选择服务地点</text>
  46. <view class="flex-rowr" @click="jumpToSeletAddress">
  47. <view class="t-r size-28 mr10" :class="[selectedAddress.address ? 'highlight' : '']">{{ selectedAddress.address || '请选择' }}</view>
  48. <up-icon name="arrow-right" color="#999999" size="27rpx"></up-icon>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="li bg-fff">
  53. <view class="title">
  54. 文字记录
  55. </view>
  56. <textarea class="text" placeholder="请输入文字记录,可简单描述服务过程中发生的趣事,或夸奖一下服务宠物吧,10-100字"></textarea>
  57. </view>
  58. <view class="li bg-fff">
  59. <view class="title">
  60. 图片记录
  61. </view>
  62. <view class="size-28 color-999 mt16">
  63. 请选择具有代表性的2-3张服务宠物图片服务过程图片或视频截图让铲屎官感受到您对毛孩子的爱吧
  64. </view>
  65. </view>
  66. <view class="footer-btn">
  67. <view class="btn">
  68. 立即上传
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script setup>
  74. import { ref, reactive, computed } from 'vue';
  75. import { onShow } from '@dcloudio/uni-app'
  76. import dayjs from 'dayjs'
  77. const state = reactive({
  78. petType: [],
  79. serveTime: null,
  80. })
  81. const petTypeOptions = [{
  82. name: '猫咪喂养',
  83. },
  84. {
  85. name: '狗狗喂养',
  86. },
  87. {
  88. name: '异宠喂养',
  89. },
  90. ]
  91. const checkboxChange = () => {}
  92. const showTimePicker = ref(false)
  93. const openTimePicker = () => {
  94. showTimePicker.value = true
  95. }
  96. const closeTimePicker = () => {
  97. showTimePicker.value = false
  98. }
  99. const serveTimeDesc = computed(() => {
  100. if (!state.serveTime) {
  101. return '请选择'
  102. }
  103. return dayjs(state.serveTime).format('YYYY/MM/DD')
  104. })
  105. const selectedAddress = ref({})
  106. const jumpToSeletAddress = () => {
  107. // todo: check select from map or address book ?
  108. uni.navigateTo({
  109. url: "/otherPages/authentication/connectAddress/index"
  110. })
  111. }
  112. onShow(() => {
  113. selectedAddress.value = uni.getStorageSync('serveAddress')
  114. })
  115. </script>
  116. <style lang="scss" scoped>
  117. .page {
  118. min-height: 100vh;
  119. padding-bottom: 144rpx;
  120. }
  121. .text {
  122. padding: 16rpx;
  123. background-color: #F3F3F3;
  124. font-size: 28rpx;
  125. margin-top: 16rpx;
  126. border-radius: 20rpx;
  127. }
  128. .tips {
  129. padding: 8rpx 16rpx;
  130. background-color: rgb(255, 250, 242);
  131. }
  132. .li {
  133. margin: 20rpx;
  134. border-radius: 20rpx;
  135. padding: 24rpx 36rpx;
  136. }
  137. .title {
  138. font-size: 30rpx;
  139. font-weight: 700;
  140. display: flex;
  141. align-items: center;
  142. &:before {
  143. display: block;
  144. content: "";
  145. width: 10rpx;
  146. border-radius: 10rpx;
  147. height: 34rpx;
  148. background-color: #FFBF60;
  149. margin-right: 15rpx;
  150. }
  151. }
  152. .highlight {
  153. color: #FFBF60;
  154. }
  155. </style>