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

358 lines
7.1 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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. ref="calendars" @confirm="confirmDate" />
  119. <!-- 选择时间 -->
  120. <uv-picker ref="picker"
  121. :columns="timeColumns"
  122. confirmColor="#B12026"
  123. keyName="timeDot"
  124. @confirm="confirmTime"></uv-picker>
  125. </view>
  126. </template>
  127. <script>
  128. export default {
  129. data() {
  130. return {
  131. tabs: [{
  132. name: '路径定制'
  133. },
  134. {
  135. name: '遗产讲述'
  136. },
  137. {
  138. name: '达人同游'
  139. },
  140. {
  141. name: '我要跟拍'
  142. },
  143. {
  144. name: '非遗体验'
  145. },
  146. // {
  147. // name: '遗产路径'
  148. // },
  149. {
  150. name: '我要研学'
  151. },
  152. ],
  153. type: '',
  154. dict : {},
  155. form : {
  156. name : '',
  157. phone : '',
  158. orderTime : [],
  159. },
  160. selectDate : this.$dayjs().format('YYYY-MM-DD'),
  161. timeColumns : [],
  162. id : 0,
  163. detail : {},
  164. //订单类型(0-路径定制 1-遗产讲述 2-达人同游 3-我要跟拍 4-非遗体验 5-我要研学)
  165. // 5-遗产路径待定
  166. api : {
  167. 0 : 'queryAmusementById',//路径定制
  168. 1 : 'queryRoleInfoById',//遗产讲述
  169. 2 : 'queryRoleInfoById',//达人同游
  170. 3 : 'queryRoleInfoById',//我要跟拍
  171. 4 : 'queryExperienceById',//非遗体验
  172. 5 : 'queryAmusementById',//我要研学
  173. // 6 : 'queryAmusementById',
  174. },
  175. }
  176. },
  177. computed : {
  178. detailTitle(){
  179. return this.detail.roleName ||
  180. this.detail.amusementTitle ||
  181. this.detail.experienceTitle || ''
  182. },
  183. price(){
  184. return this.detail.price ||
  185. this.detail.amusementPrice || 0
  186. }
  187. },
  188. onLoad(args) {
  189. this.id = args.id
  190. this.type = args.type
  191. this.dict = this.$config.dict[args.type]
  192. },
  193. onShow() {
  194. this.getData()
  195. this.getDataTime(0)
  196. this.getDataTime(1)
  197. },
  198. methods: {
  199. // 获取预约信息
  200. getData(){
  201. this.$api(this.api[this.dict.payType], {
  202. roleInfoId : this.id,
  203. amusementId : this.id,
  204. experienceId : this.id,
  205. }, res => {
  206. uni.stopPullDownRefresh()
  207. if(res.code == 200){
  208. this.detail = res.result.travelRoleInfo || res.result.travelExperience || res.result.travelAmusement
  209. }
  210. })
  211. },
  212. // 获取预约信息
  213. getDataTime(timeType){
  214. this.$api('queryOrderTime', {
  215. timeType
  216. }, res => {
  217. if(res.code == 200){
  218. this.timeColumns.splice(timeType, 0, res.result)
  219. // this.form.orderTime.splice(timeType, 0, res.result[0].timeDot)
  220. }
  221. })
  222. },
  223. // 选择日期
  224. confirmDate(e){
  225. this.selectDate = e.fulldate
  226. },
  227. // 选择时间
  228. confirmTime(e){
  229. this.form.orderTime = []
  230. e.value.forEach((n, i) => {
  231. this.form.orderTime.push(n && n.timeDot)
  232. if(!this.form.orderTime[i]){
  233. this.form.orderTime[i] = this.timeColumns[i][0].timeDot
  234. }
  235. })
  236. },
  237. submit(){
  238. let data = {
  239. itemId : this.detail.id,
  240. orderPhone : this.form.phone,
  241. orderTitle : this.detailTitle,
  242. orderDate : this.selectDate,
  243. orderPrice : this.price,
  244. orderTime : this.form.orderTime.join('-'),
  245. orderType : this.dict.payType,
  246. orderName : this.form.name
  247. }
  248. if(this.$utils.verificationAll(data, {
  249. orderName : '请填写姓名',
  250. orderPhone : '请填写联系方式',
  251. orderTime : '请选择预约时间',
  252. })){
  253. return
  254. }
  255. this.$api('createOrder', data, res => {
  256. if(res.code == 200){
  257. uni.showToast({
  258. title: res.message,
  259. icon : 'none'
  260. })
  261. uni.redirectTo({
  262. url: '/pages_order/mine/subscribe'
  263. })
  264. }
  265. })
  266. },
  267. }
  268. }
  269. </script>
  270. <style scoped lang="scss">
  271. .page{
  272. .box{
  273. border-radius: 20rpx;
  274. margin: 20rpx;
  275. background-color: #fff;
  276. box-shadow: 0 0 16rpx 6rpx #00000011;
  277. .info{
  278. padding: 40rpx;
  279. border-bottom: 1rpx dashed #000;
  280. .title{
  281. font-size: 34rpx;
  282. font-weight: 900;
  283. padding-bottom: 20rpx;
  284. }
  285. .tips{
  286. font-size: 26rpx;
  287. color: #666666;
  288. padding: 10rpx 0;
  289. }
  290. }
  291. .form-time{
  292. padding: 40rpx;
  293. .title{
  294. font-weight: 900;
  295. padding-bottom: 20rpx;
  296. margin-top: 10rpx;
  297. }
  298. .line{
  299. display: flex;
  300. align-items: center;
  301. >view{
  302. border: 1rpx solid #333;
  303. padding: 6rpx 20rpx;
  304. margin: 10rpx;
  305. border-radius: 10rpx;
  306. font-size: 26rpx;
  307. display: flex;
  308. align-items: center;
  309. justify-content: center;
  310. .icon{
  311. padding: 0 10rpx;
  312. }
  313. }
  314. }
  315. }
  316. .form-input{
  317. padding: 40rpx;
  318. .input{
  319. display: flex;
  320. padding-top: 30rpx;
  321. .label{
  322. width: 200rpx;
  323. }
  324. input{
  325. font-size: 26rpx;
  326. }
  327. }
  328. }
  329. }
  330. }
  331. .btn{
  332. margin: 0 auto;
  333. padding: 20rpx 0;
  334. display: flex;
  335. justify-content: center;
  336. align-items: center;
  337. width: 80%;
  338. background-color: $uni-color;
  339. color: #fff;
  340. border-radius: 30rpx;
  341. }
  342. </style>