confirmYuyue.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view class="box">
  3. <!-- <view class="yuyuCheckTis" :style="{background:'#'+themeColor}">
  4. 温馨提示:该报价仅为参考价格,实际以门店为准(不同品牌和车型费用不同)
  5. </view> -->
  6. <view class="cont">
  7. <view class="contkk">
  8. <view class="kkline">
  9. <view class="kklineLeft">
  10. <span class="stars">*</span> <span>预约门店</span>
  11. </view>
  12. <view class="kklineRight">{{yyshopInfo.shopName}}</view>
  13. </view>
  14. <!-- <view class="kkline">
  15. <view class="kklineLeft">
  16. <span class="stars">*</span> <span>预约车辆</span>
  17. </view>
  18. <view class="kklineRight" @click="goCarlist">
  19. <span>{{carInfo.plateNumber?carInfo.plateNumber:'请选择'}}</span>
  20. <img src="../../static/img/big_rightArrow.png" alt="" class="rightJt">
  21. </view>
  22. </view> -->
  23. <view class="kkline ">
  24. <view class="kklineLeft">
  25. <span class="stars">*</span> <span>预约时间</span>
  26. </view>
  27. <view class="kklineRight" @click="cktime">
  28. <span>{{billDate?billDate:'请选择'}}</span>
  29. <img src="../../static/img/big_rightArrow.png" alt="" class="rightJt">
  30. </view>
  31. </view>
  32. <view class=" lineborderNo" >
  33. <view class="bzline">
  34. <view class="beiz"><span class="stars">*</span>手机号</view>
  35. <input type="number" v-model="mobilePhone" placeholder="请输入手机号" class="beizInput" placeholder-style="color:#cccccc;">
  36. </view>
  37. </view>
  38. </view>
  39. <view class="contkk" style="margin-top: 20rpx;">
  40. <view class="kkline2">
  41. <view class="kklineLeft1">预约项目</view>
  42. <view class="kklineRight1">(以实际门店价格为准)</view>
  43. </view>
  44. <view class="kkline2" v-for="(item,index) in yuyueData">
  45. <view class="kklineLeft3">{{item.ItemName}}</view>
  46. <view class="kklineRight3" v-if="item.Price">¥{{item.Price}}</view>
  47. </view>
  48. </view>
  49. <view class="contkk" style="margin-top: 20rpx;">
  50. <view class="bzline">
  51. <view class="beiz">备注</view>
  52. <input type="text" v-model="comment" placeholder="请输入备注(选填)" class="beizInput" placeholder-style="color:#cccccc;">
  53. </view>
  54. </view>
  55. </view>
  56. <view style="height: 120rpx;"></view>
  57. <view class="bottom-container">
  58. <view>
  59. <view class="bottom-container-price"><span class="qianhaospan" v-if="totalPrice" >¥</span> {{totalPrice}} <span></span></view>
  60. <view class="ckj">参考价格(到店支付)</view>
  61. </view>
  62. <view class="newyyBotbutton" :style="{background:'#'+themeColor}" @click="yuyue">立即预约</view>
  63. </view>
  64. <timeSelect ref="timeSelect" :stationID="stationID" :timedata="timedata" :themeColor="themeColor" @changeTime="changeTime"></timeSelect>
  65. </view>
  66. </template>
  67. <script>
  68. import timeSelect from '@/components/timeSelect/timeSelect.vue'
  69. export default {
  70. components: {
  71. timeSelect
  72. },
  73. data() {
  74. return {
  75. comment:'',
  76. totalPrice:'',
  77. userInfo:'',
  78. timedata:'',
  79. billDate:'',
  80. yuyueData:'',
  81. carInfo:'',
  82. yyshopInfo:'',
  83. themeColor:'',
  84. isgo:true,
  85. stationID:'',
  86. mobilePhone:'',
  87. ext:'',
  88. }
  89. },
  90. onLoad(opt) {
  91. this.themeColor = uni.getStorageSync("themeColor");
  92. console.log(this.$store.state.yuyueData)
  93. this.yuyueData=this.$store.state.yuyueData;
  94. this.stationID=this.yuyueData[0].StationID
  95. this.totalPrice=opt.totalPrice
  96. //this.carInfo=this.$store.state.carInfo
  97. //this.userInfo = uni.getStorageSync("userInfo");
  98. this.userInfo = this.$store.state.userInfo;
  99. this.yyshopInfo=uni.getStorageSync("yyshopInfo")
  100. this.ext=this.$common.getExtStoreId();
  101. //this.getOrderTimes()
  102. if(this.userInfo){
  103. console.log(this.userInfo)
  104. //var customerInfo=uni.getStorageSync("wxOpenData").loginInfo.customerInfo;
  105. this.mobilePhone=this.userInfo.mobilePhone;
  106. }
  107. },
  108. onShow() {
  109. this.carInfo=this.$store.state.carInfo;
  110. console.log(this.carInfo)
  111. },
  112. methods: {
  113. goCarlist(){
  114. uni.navigateTo({
  115. url:'../user/addCar/cailist'
  116. })
  117. },
  118. yuyue(){
  119. /* if(!this.carInfo){
  120. uni.showToast({
  121. title: '请选择车辆',
  122. icon: 'none',
  123. duration: 3000
  124. });
  125. return false;
  126. }
  127. if(!this.carInfo.id){
  128. uni.showToast({
  129. title: '请选择车辆',
  130. icon: 'none',
  131. duration: 3000
  132. });
  133. return false;
  134. } */
  135. var reg = /^1[3|4|5|7|8][0-9]\d{8}$/;
  136. if(reg.test(this.mobilePhone) == false ){
  137. console.log("手机号码格式不正确");
  138. uni.showToast({
  139. title: '请输入正确的手机号',
  140. icon: 'none',
  141. duration: 3000
  142. });
  143. return false;
  144. }
  145. if(!this.billDate){
  146. uni.showToast({
  147. title: '请选择预约时间',
  148. icon: 'none',
  149. duration: 3000
  150. });
  151. return false;
  152. }
  153. if(!this.mobilePhone){
  154. uni.showToast({
  155. title: '请填写手机号',
  156. icon: 'none',
  157. duration: 3000
  158. });
  159. return false;
  160. }
  161. if(!this.isgo){
  162. return false
  163. }
  164. this.isgo=false;
  165. uni.showLoading({
  166. title: '加载中'
  167. });
  168. this.$http('openreservation/saveOrderSheet', {
  169. billDate: this.billDate,
  170. comment: this.comment,
  171. // carID: this.carInfo?.id || '',
  172. carID: '',
  173. orderItem: this.yuyueData.map(item => item.ID).join(),
  174. shopId: this.yyshopInfo.id,
  175. unionId: this.ext.unionId,
  176. stationID:this.stationID,
  177. mobilePhone:this.mobilePhone
  178. },'POST').then(res => {
  179. uni.hideLoading();
  180. this.isgo=true;
  181. var id=res.data
  182. if(res.code==0){
  183. if(this.userInfo){
  184. uni.showModal({
  185. title: '提示',
  186. content: '预约订单提交成功',
  187. confirmText:'返回首页',
  188. cancelText:'查看订单',
  189. success: function (res) {
  190. if (res.confirm) {
  191. // console.log('用户点击确定');
  192. uni.switchTab({
  193. url:'index'
  194. })
  195. } else if (res.cancel) {
  196. // console.log('用户点击取消');
  197. // uni.reLaunch({
  198. // url:'../user/bespeakDetail?id='+id
  199. // })
  200. uni.redirectTo({
  201. url:'../user/bespeakDetail?id='+id
  202. })
  203. }
  204. }
  205. });
  206. }else{
  207. uni.showModal({
  208. title: '提示',
  209. content: '预约订单提交成功',
  210. confirmText:'返回首页',
  211. showCancel:false,
  212. success: function (res) {
  213. if (res.confirm) {
  214. // console.log('用户点击确定');
  215. uni.switchTab({
  216. url:'index'
  217. })
  218. }
  219. }
  220. });
  221. }
  222. }else{
  223. uni.showToast({
  224. title: res.msg,
  225. icon: 'none',
  226. duration: 3000
  227. });
  228. }
  229. })
  230. },
  231. changeTime(data){
  232. console.log(data)
  233. this.billDate=data
  234. },
  235. cktime(){
  236. this.$refs.timeSelect.open();
  237. },
  238. }
  239. }
  240. </script>
  241. <style scoped lang="less">
  242. .box{
  243. background: #F4F5F7;
  244. min-height: 100vh;
  245. }
  246. .yuyuCheckTis{
  247. color: #C8841C;
  248. line-height: 37rpx;
  249. font-size: 28rpx;
  250. background: #FFF7EB;
  251. padding: 18rpx 24rpx;
  252. font-weight: 400;
  253. }
  254. .cont{
  255. padding: 24rpx;
  256. }
  257. .contkk{
  258. background: #ffffff;
  259. border-radius: 10rpx;
  260. padding: 0 20rpx;
  261. }
  262. .kkline{
  263. display: flex;
  264. padding: 30rpx 0;
  265. border-bottom: 1px solid #EEEEEE;
  266. color: #666666;
  267. font-size: 28rpx;
  268. }
  269. .kkline2{
  270. display: flex;
  271. justify-content: space-between;
  272. padding: 30rpx 0;
  273. border-bottom: 1px solid #EEEEEE;
  274. color: #666666;
  275. font-size: 28rpx;
  276. }
  277. .stars{
  278. color: #FF2400;
  279. }
  280. .kklineRight{
  281. color: #3c3c3c;
  282. font-size: 28rpx;
  283. display: flex;
  284. justify-content: space-between;
  285. width: 450rpx;
  286. }
  287. .kklineLeft {
  288. width: 200rpx;
  289. }
  290. .rightJt{
  291. width: 30rpx;
  292. height: 30rpx;
  293. margin-top: 4rpx;
  294. }
  295. .lineborderNo{
  296. border-bottom: none;
  297. }
  298. .kklineLeft1{
  299. font-weight: 500;
  300. color: #3C3C3C;
  301. font-size: 28rpx;
  302. }
  303. .kklineRight1{
  304. font-weight: 400;
  305. color: #999999;
  306. font-size: 26rpx;
  307. }
  308. .kklineLeft3{
  309. font-weight: 400;
  310. color: #666666;
  311. font-size: 28rpx;
  312. width: 480rpx;
  313. overflow: hidden;
  314. white-space: nowrap;
  315. text-overflow: ellipsis;
  316. }
  317. .kklineRight3{
  318. font-weight: 400;
  319. color: #3C3C3C;
  320. font-size: 28rpx;
  321. }
  322. .bzline{
  323. display: flex;padding: 30rpx 0;
  324. }
  325. .beizInput{
  326. width: 450rpx;font-size: 28rpx;
  327. }
  328. .beiz{
  329. color: #666666;font-size: 28rpx;
  330. width: 200rpx;
  331. }
  332. .bottom-container{
  333. width: 750rpx;
  334. height: 120rpx;
  335. background: #FFFFFF;
  336. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.1000);
  337. position: fixed;
  338. left: 0;
  339. bottom: 0;
  340. display: flex;
  341. justify-content: space-between;
  342. }
  343. .newyyBotbutton{
  344. width: 204rpx;
  345. height: 74rpx;
  346. background: #D53533;
  347. border-radius: 37rpx;
  348. font-weight: 500;
  349. color: #FFFFFF;
  350. line-height: 74rpx;
  351. text-align: center;
  352. margin-right: 30rpx;
  353. margin-top: 23rpx;
  354. }
  355. .bottom-container-price{
  356. color: #FF0000;
  357. padding-top: 30rpx;
  358. padding-left: 30rpx;
  359. font-size: 32rpx;
  360. }
  361. .qianhaospan{
  362. font-size: 22rpx;
  363. }
  364. .ckj{
  365. color: #999999;font-size: 24rpx;
  366. padding-left: 30rpx;
  367. }
  368. </style>