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

354 lines
6.9 KiB

9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 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
  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
  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. }
  220. })
  221. },
  222. // 选择日期
  223. confirmDate(e){
  224. this.selectDate = e.fulldate
  225. },
  226. // 选择时间
  227. confirmTime(e){
  228. this.form.orderTime = []
  229. e.value.forEach((n, i) => {
  230. this.form.orderTime.push(n && n.timeDot)
  231. })
  232. },
  233. submit(){
  234. let data = {
  235. itemId : this.detail.id,
  236. orderPhone : this.form.phone,
  237. orderTitle : this.detailTitle,
  238. orderDate : this.selectDate,
  239. orderPrice : this.price,
  240. orderTime : this.form.orderTime.join('-'),
  241. orderType : this.dict.payType,
  242. orderName : this.form.name
  243. }
  244. if(this.$utils.verificationAll(data, {
  245. orderName : '请填写姓名',
  246. orderPhone : '请填写联系方式',
  247. orderTime : '请选择预约时间',
  248. })){
  249. return
  250. }
  251. this.$api('createOrder', data, res => {
  252. if(res.code == 200){
  253. uni.showToast({
  254. title: res.message,
  255. icon : 'none'
  256. })
  257. uni.navigateTo({
  258. url: '/pages_order/mine/subscribe'
  259. })
  260. }
  261. })
  262. },
  263. }
  264. }
  265. </script>
  266. <style scoped lang="scss">
  267. .page{
  268. .box{
  269. border-radius: 20rpx;
  270. margin: 20rpx;
  271. background-color: #fff;
  272. box-shadow: 0 0 16rpx 6rpx #00000011;
  273. .info{
  274. padding: 40rpx;
  275. border-bottom: 1rpx dashed #000;
  276. .title{
  277. font-size: 34rpx;
  278. font-weight: 900;
  279. padding-bottom: 20rpx;
  280. }
  281. .tips{
  282. font-size: 26rpx;
  283. color: #666666;
  284. padding: 10rpx 0;
  285. }
  286. }
  287. .form-time{
  288. padding: 40rpx;
  289. .title{
  290. font-weight: 900;
  291. padding-bottom: 20rpx;
  292. margin-top: 10rpx;
  293. }
  294. .line{
  295. display: flex;
  296. align-items: center;
  297. >view{
  298. border: 1rpx solid #333;
  299. padding: 6rpx 20rpx;
  300. margin: 10rpx;
  301. border-radius: 10rpx;
  302. font-size: 26rpx;
  303. display: flex;
  304. align-items: center;
  305. justify-content: center;
  306. .icon{
  307. padding: 0 10rpx;
  308. }
  309. }
  310. }
  311. }
  312. .form-input{
  313. padding: 40rpx;
  314. .input{
  315. display: flex;
  316. padding-top: 30rpx;
  317. .label{
  318. width: 200rpx;
  319. }
  320. input{
  321. font-size: 26rpx;
  322. }
  323. }
  324. }
  325. }
  326. }
  327. .btn{
  328. margin: 0 auto;
  329. padding: 20rpx 0;
  330. display: flex;
  331. justify-content: center;
  332. align-items: center;
  333. width: 80%;
  334. background-color: $uni-color;
  335. color: #fff;
  336. border-radius: 30rpx;
  337. }
  338. </style>