瑶都万能墙
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.

301 lines
6.1 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="发布" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="form">
  5. <view class="form-sheet-cell">
  6. <view class="label">
  7. 师傅头像
  8. </view>
  9. <view class="images box">
  10. <uv-upload
  11. :fileList="imageTitle"
  12. :maxCount="1"
  13. multiple
  14. width="150rpx"
  15. height="150rpx"
  16. name="imageTitle"
  17. @delete="deleteImage"
  18. @afterRead="afterRead"
  19. :previewFullImage="true"></uv-upload>
  20. </view>
  21. </view>
  22. <view class="form-sheet-cell">
  23. <view class="label">
  24. 师傅名称
  25. </view>
  26. <input placeholder="请输入师傅名称" v-model="form.title" />
  27. </view>
  28. <view class="form-sheet-cell">
  29. <view class="label">
  30. 起点
  31. </view>
  32. <input placeholder="请输入起点" v-model="form.startAddress" />
  33. </view>
  34. <view class="form-sheet-cell">
  35. <view class="label">
  36. 终点
  37. </view>
  38. <input placeholder="请输入终点" v-model="form.endAddress" />
  39. </view>
  40. <view class="form-sheet-cell"
  41. @click="$refs.datetimePicker.open()">
  42. <view class="label">
  43. 出发时间
  44. </view>
  45. <input placeholder="请选择出发时间"
  46. disabled
  47. v-model="form.startTime" />
  48. </view>
  49. <view class="form-sheet-cell">
  50. <view class="label">
  51. 车辆座位
  52. </view>
  53. <!-- <input placeholder="请输入车辆座位" v-model="form.num" /> -->
  54. <uv-number-box v-model="form.num"></uv-number-box>
  55. </view>
  56. <view class="form-sheet-cell">
  57. <view class="label">
  58. 师傅电话
  59. </view>
  60. <input placeholder="请输入师傅电话" v-model="form.phone" />
  61. </view>
  62. <!-- <view class="form-sheet-cell">
  63. <view class="label">
  64. 网约证书
  65. </view>
  66. <view class="images box">
  67. <uv-upload
  68. :fileList="titleDetails"
  69. :maxCount="1"
  70. multiple
  71. width="150rpx"
  72. height="150rpx"
  73. name="titleDetails"
  74. @delete="deleteImage"
  75. @afterRead="afterRead"
  76. :previewFullImage="true"></uv-upload>
  77. </view>
  78. </view> -->
  79. <view class="form-sheet-cell">
  80. <view class="label">
  81. 车型
  82. </view>
  83. <input placeholder="请输入车型" v-model="form.catType" />
  84. </view>
  85. <view class="form-sheet-cell">
  86. <view class="label">
  87. 车牌号
  88. </view>
  89. <input placeholder="请输入车牌号" v-model="form.catNo" />
  90. </view>
  91. <view class="form-sheet-cell">
  92. <view class="label">
  93. 车辆照片与网约证书
  94. </view>
  95. <view class="images box">
  96. <uv-upload
  97. :fileList="catImage"
  98. :maxCount="2"
  99. multiple
  100. width="150rpx"
  101. height="150rpx"
  102. name="catImage"
  103. @delete="deleteImage"
  104. @afterRead="afterRead"
  105. :previewFullImage="true"></uv-upload>
  106. </view>
  107. </view>
  108. <view class="content-input">
  109. <uv-textarea
  110. v-model="form.titleDetails"
  111. :maxlength="200"
  112. autoHeight
  113. count
  114. style="min-height: 400rpx;"
  115. placeholder="途径地点说明"></uv-textarea>
  116. </view>
  117. <view class="uni-color-btn"
  118. @click="submit">
  119. 发布
  120. </view>
  121. </view>
  122. <uv-datetime-picker
  123. ref="datetimePicker"
  124. v-model="dateTime"
  125. mode="datetime"
  126. @confirm="confirmTime">
  127. </uv-datetime-picker>
  128. </view>
  129. </template>
  130. <script>
  131. import Position from '@/utils/position.js'
  132. import { mapState } from 'vuex'
  133. export default {
  134. data() {
  135. return {
  136. imageTitle : [],//师傅头像
  137. titleDetails : [],//网约证书
  138. catImage : [],//车辆照片
  139. form : {
  140. num : 2,
  141. startTime : '',
  142. },
  143. dateTime : new Date().getTime(),
  144. }
  145. },
  146. onLoad() {
  147. },
  148. computed : {
  149. ...mapState(['cityList', 'category']),
  150. },
  151. methods: {
  152. deleteImage(e){
  153. this[e.name].splice(e.index, 1)
  154. },
  155. afterRead(e){
  156. let self = this
  157. e.file.forEach(file => {
  158. self.$Oss.ossUpload(file.url).then(url => {
  159. self[e.name].push({
  160. url
  161. })
  162. })
  163. })
  164. },
  165. // 提交
  166. submit(){
  167. this.form.imageTitle = this.imageTitle.map(n => n.url).join(',')
  168. this.form.catImage = this.catImage.map(n => n.url).join(',')
  169. if (this.$utils.verificationAll(this.form, {
  170. imageTitle: '请上传师傅头像',
  171. title : '请输入师傅名称',
  172. startAddress : '请输入起点',
  173. endAddress : '请输入终点',
  174. startTime : '请选择出发时间',
  175. num : '请选择车辆座位',
  176. phone : '请输入师傅电话',
  177. catType : '请输入车型',
  178. catNo : '请输入车牌号',
  179. catImage : '请上传车辆照片与网约证书',
  180. titleDetails : '请输入途径地点说明',
  181. })) {
  182. return
  183. }
  184. this.$api('publishCar', this.form, res => {
  185. if(res.code == 200){
  186. uni.showToast({
  187. title: '发布成功!',
  188. icon: 'none'
  189. })
  190. setTimeout(uni.navigateBack, 1000, -1)
  191. }
  192. })
  193. },
  194. confirmTime(e){
  195. this.form.startTime = this.$dayjs(e.value).format('YYYY-MM-DD HH:mm:ss')
  196. },
  197. }
  198. }
  199. </script>
  200. <style scoped lang="scss">
  201. .page{
  202. background-color: #fff;
  203. min-height: 100vh;
  204. box-sizing: border-box;
  205. color: #333333;
  206. font-size: 28rpx;
  207. /deep/ text{
  208. font-size: 28rpx !important;
  209. }
  210. input{
  211. width: 450rpx;
  212. }
  213. .form{
  214. padding: 30rpx;
  215. .help-issue {
  216. margin: 20rpx;
  217. }
  218. .title-input{
  219. border: 1px solid $uni-color;
  220. width: 100%;
  221. border-radius: 10rpx;
  222. padding: 10rpx 20rpx;
  223. box-sizing: border-box;
  224. height: 65rpx;
  225. }
  226. .form-sheet-cell{
  227. display: flex;
  228. background-color: #fff;
  229. padding: 20rpx 30rpx;
  230. align-items: center;
  231. .label{
  232. width: 160rpx;
  233. }
  234. .price{
  235. display: flex;
  236. text-align: center;
  237. input{
  238. width: 150rpx;
  239. border: 1px solid $uni-color;
  240. margin: 0 10rpx;
  241. }
  242. }
  243. .right-icon{
  244. margin-left: auto;
  245. }
  246. }
  247. }
  248. .category{
  249. padding: 20rpx;
  250. .title{
  251. // font-weight: 900;
  252. // font-size: 30rpx;
  253. }
  254. .tagList{
  255. display: flex;
  256. flex-wrap: wrap;
  257. padding: 10rpx 0;
  258. view{
  259. background: rgba($uni-color, 0.1);
  260. padding: 10rpx 20rpx;
  261. margin: 10rpx;
  262. border-radius: 10rpx;
  263. font-size: 26rpx;
  264. }
  265. .act{
  266. color: #fff;
  267. background: $uni-color;
  268. }
  269. }
  270. }
  271. }
  272. </style>