景徳镇旅游微信小程序
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.

359 lines
7.2 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
9 months ago
10 months ago
8 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
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="提交预约" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="box">
  5. <view class="info">
  6. <view class="title">
  7. {{ dict.title }}
  8. </view>
  9. <view class="tips">
  10. 项目/负责人{{ detailTitle }}
  11. </view>
  12. <view class="tips">
  13. 开放时间{{ detail.openTime }}
  14. </view>
  15. <view class="tips">
  16. 联系电话{{ detail.phone }}
  17. </view>
  18. <view class="tips"
  19. v-if="price">
  20. 价格 {{ price }}
  21. </view>
  22. </view>
  23. <view class="form-time">
  24. <!-- 预约日期 -->
  25. <view class="title">
  26. 预约日期
  27. </view>
  28. <view class="line"
  29. @click="$refs.calendars.open()">
  30. <view class="">
  31. {{ selectDate.split('-')[0] }}
  32. <view class="icon">
  33. <uv-icon
  34. name="arrow-down"
  35. size="26rpx">
  36. </uv-icon>
  37. </view>
  38. </view>
  39. <view class="">
  40. {{ selectDate.split('-')[1] }}
  41. <view class="icon">
  42. <uv-icon
  43. name="arrow-down"
  44. size="26rpx">
  45. </uv-icon>
  46. </view>
  47. </view>
  48. <view class="">
  49. {{ selectDate.split('-')[2] }}
  50. <view class="icon">
  51. <uv-icon
  52. name="arrow-down"
  53. size="26rpx">
  54. </uv-icon>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 预约时间 -->
  59. <view class="title">
  60. 预约时间
  61. </view>
  62. <view class="line"
  63. @click="$refs.picker.open()">
  64. <view class="">
  65. {{ form.orderTime[0] || '请选择' }}
  66. <view class="icon">
  67. <uv-icon
  68. name="arrow-down"
  69. size="26rpx">
  70. </uv-icon>
  71. </view>
  72. </view>
  73. <view class="">
  74. {{ form.orderTime[1] || '请选择' }}
  75. <view class="icon">
  76. <uv-icon
  77. name="arrow-down"
  78. size="26rpx">
  79. </uv-icon>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="box">
  86. <view class="form-input">
  87. <view class="title">
  88. 游客信息
  89. </view>
  90. <view class="input">
  91. <view class="label">
  92. 姓名
  93. </view>
  94. <input type="text"
  95. placeholder="请输入姓名"
  96. v-model="form.name"/>
  97. </view>
  98. <view class="input">
  99. <view class="label">
  100. 联系方式
  101. </view>
  102. <input type="text"
  103. placeholder="请输入联系方式"
  104. v-model="form.phone"/>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="btn"
  109. @click="submit">
  110. 提交预约
  111. </view>
  112. <!-- 选择日期 -->
  113. <uv-calendars
  114. color="#B12026"
  115. :date="selectDate"
  116. confirmColor="#B12026"
  117. :clearDate="false"
  118. :startDate="$dayjs().format('YYYY-MM-DD') "
  119. ref="calendars" @confirm="confirmDate" />
  120. <!-- 选择时间 -->
  121. <uv-picker ref="picker"
  122. :columns="timeColumns"
  123. confirmColor="#B12026"
  124. keyName="timeDot"
  125. @confirm="confirmTime"></uv-picker>
  126. </view>
  127. </template>
  128. <script>
  129. export default {
  130. data() {
  131. return {
  132. tabs: [{
  133. name: '路径定制'
  134. },
  135. {
  136. name: '遗产讲述'
  137. },
  138. {
  139. name: '达人同游'
  140. },
  141. {
  142. name: '我要跟拍'
  143. },
  144. {
  145. name: '非遗体验'
  146. },
  147. // {
  148. // name: '遗产路径'
  149. // },
  150. {
  151. name: '我要研学'
  152. },
  153. ],
  154. type: '',
  155. dict : {},
  156. form : {
  157. name : '',
  158. phone : '',
  159. orderTime : [],
  160. },
  161. selectDate : this.$dayjs().format('YYYY-MM-DD'),
  162. timeColumns : [],
  163. id : 0,
  164. detail : {},
  165. //订单类型(0-路径定制 1-遗产讲述 2-达人同游 3-我要跟拍 4-非遗体验 5-我要研学)
  166. // 5-遗产路径待定
  167. api : {
  168. 0 : 'queryAmusementById',//路径定制
  169. 1 : 'queryRoleInfoById',//遗产讲述
  170. 2 : 'queryRoleInfoById',//达人同游
  171. 3 : 'queryRoleInfoById',//我要跟拍
  172. 4 : 'queryExperienceById',//非遗体验
  173. 5 : 'queryAmusementById',//我要研学
  174. // 6 : 'queryAmusementById',
  175. },
  176. }
  177. },
  178. computed : {
  179. detailTitle(){
  180. return this.detail.roleName ||
  181. this.detail.amusementTitle ||
  182. this.detail.experienceTitle || ''
  183. },
  184. price(){
  185. return this.detail.price ||
  186. this.detail.amusementPrice || 0
  187. }
  188. },
  189. onLoad(args) {
  190. this.id = args.id
  191. this.type = args.type
  192. this.dict = this.$config.dict[args.type]
  193. },
  194. onShow() {
  195. this.getData()
  196. this.getDataTime(0)
  197. this.getDataTime(1)
  198. },
  199. methods: {
  200. // 获取预约信息
  201. getData(){
  202. this.$api(this.api[this.dict.payType], {
  203. roleInfoId : this.id,
  204. amusementId : this.id,
  205. experienceId : this.id,
  206. }, res => {
  207. uni.stopPullDownRefresh()
  208. if(res.code == 200){
  209. this.detail = res.result.travelRoleInfo || res.result.travelExperience || res.result.travelAmusement
  210. }
  211. })
  212. },
  213. // 获取预约信息
  214. getDataTime(timeType){
  215. this.$api('queryOrderTime', {
  216. timeType
  217. }, res => {
  218. if(res.code == 200){
  219. this.timeColumns.splice(timeType, 0, res.result)
  220. // this.form.orderTime.splice(timeType, 0, res.result[0].timeDot)
  221. }
  222. })
  223. },
  224. // 选择日期
  225. confirmDate(e){
  226. this.selectDate = e.fulldate
  227. },
  228. // 选择时间
  229. confirmTime(e){
  230. this.form.orderTime = []
  231. e.value.forEach((n, i) => {
  232. this.form.orderTime.push(n && n.timeDot)
  233. if(!this.form.orderTime[i]){
  234. this.form.orderTime[i] = this.timeColumns[i][0].timeDot
  235. }
  236. })
  237. },
  238. submit(){
  239. let data = {
  240. itemId : this.detail.id,
  241. orderPhone : this.form.phone,
  242. orderTitle : this.detailTitle,
  243. orderDate : this.selectDate,
  244. orderPrice : this.price,
  245. orderTime : this.form.orderTime.join('-'),
  246. orderType : this.dict.payType,
  247. orderName : this.form.name
  248. }
  249. if(this.$utils.verificationAll(data, {
  250. orderName : '请填写姓名',
  251. orderPhone : '请填写联系方式',
  252. orderTime : '请选择预约时间',
  253. })){
  254. return
  255. }
  256. this.$api('createOrder', data, res => {
  257. if(res.code == 200){
  258. uni.showToast({
  259. title: res.message,
  260. icon : 'none'
  261. })
  262. uni.redirectTo({
  263. url: '/pages_order/mine/subscribe'
  264. })
  265. }
  266. })
  267. },
  268. }
  269. }
  270. </script>
  271. <style scoped lang="scss">
  272. .page{
  273. .box{
  274. border-radius: 20rpx;
  275. margin: 20rpx;
  276. background-color: #fff;
  277. box-shadow: 0 0 16rpx 6rpx #00000011;
  278. .info{
  279. padding: 40rpx;
  280. border-bottom: 1rpx dashed #000;
  281. .title{
  282. font-size: 34rpx;
  283. font-weight: 900;
  284. padding-bottom: 20rpx;
  285. }
  286. .tips{
  287. font-size: 26rpx;
  288. color: #666666;
  289. padding: 10rpx 0;
  290. }
  291. }
  292. .form-time{
  293. padding: 40rpx;
  294. .title{
  295. font-weight: 900;
  296. padding-bottom: 20rpx;
  297. margin-top: 10rpx;
  298. }
  299. .line{
  300. display: flex;
  301. align-items: center;
  302. >view{
  303. border: 1rpx solid #333;
  304. padding: 6rpx 20rpx;
  305. margin: 10rpx;
  306. border-radius: 10rpx;
  307. font-size: 26rpx;
  308. display: flex;
  309. align-items: center;
  310. justify-content: center;
  311. .icon{
  312. padding: 0 10rpx;
  313. }
  314. }
  315. }
  316. }
  317. .form-input{
  318. padding: 40rpx;
  319. .input{
  320. display: flex;
  321. padding-top: 30rpx;
  322. .label{
  323. width: 200rpx;
  324. }
  325. input{
  326. font-size: 26rpx;
  327. }
  328. }
  329. }
  330. }
  331. }
  332. .btn{
  333. margin: 0 auto;
  334. padding: 20rpx 0;
  335. display: flex;
  336. justify-content: center;
  337. align-items: center;
  338. width: 80%;
  339. background-color: $uni-color;
  340. color: #fff;
  341. border-radius: 30rpx;
  342. }
  343. </style>