confirmYuyue.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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">手机号</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. },
  103. onShow() {
  104. this.carInfo=this.$store.state.carInfo;
  105. console.log(this.carInfo)
  106. },
  107. methods: {
  108. goCarlist(){
  109. uni.navigateTo({
  110. url:'../user/addCar/cailist'
  111. })
  112. },
  113. yuyue(){
  114. /* if(!this.carInfo){
  115. uni.showToast({
  116. title: '请选择车辆',
  117. icon: 'none',
  118. duration: 3000
  119. });
  120. return false;
  121. }
  122. if(!this.carInfo.id){
  123. uni.showToast({
  124. title: '请选择车辆',
  125. icon: 'none',
  126. duration: 3000
  127. });
  128. return false;
  129. } */
  130. if(!this.billDate){
  131. uni.showToast({
  132. title: '请选择预约时间',
  133. icon: 'none',
  134. duration: 3000
  135. });
  136. return false;
  137. }
  138. if(!this.isgo){
  139. return false
  140. }
  141. this.isgo=false;
  142. this.$http('openreservation/saveOrderSheet', {
  143. billDate: this.billDate,
  144. comment: this.comment,
  145. carID: this.carInfo.id || '',
  146. orderItem: this.yuyueData.map(item => item.ID).join(),
  147. shopId: this.yyshopInfo.id,
  148. unionId: this.ext.unionId,
  149. stationID:this.stationID,
  150. mobilePhone:this.mobilePhone
  151. },'POST').then(res => {
  152. this.isgo=true;
  153. var id=res.data
  154. if(res.code==0){
  155. if(this.userInfo){
  156. uni.showModal({
  157. title: '提示',
  158. content: '预约订单提交成功',
  159. confirmText:'返回首页',
  160. cancelText:'查看订单',
  161. success: function (res) {
  162. if (res.confirm) {
  163. // console.log('用户点击确定');
  164. uni.switchTab({
  165. url:'index'
  166. })
  167. } else if (res.cancel) {
  168. // console.log('用户点击取消');
  169. // uni.reLaunch({
  170. // url:'../user/bespeakDetail?id='+id
  171. // })
  172. uni.redirectTo({
  173. url:'../user/bespeakDetail?id='+id
  174. })
  175. }
  176. }
  177. });
  178. }else{
  179. uni.showModal({
  180. title: '提示',
  181. content: '预约订单提交成功',
  182. confirmText:'返回首页',
  183. showCancel:false,
  184. success: function (res) {
  185. if (res.confirm) {
  186. // console.log('用户点击确定');
  187. uni.switchTab({
  188. url:'index'
  189. })
  190. }
  191. }
  192. });
  193. }
  194. }else{
  195. uni.showToast({
  196. title: res.msg,
  197. icon: 'none',
  198. duration: 3000
  199. });
  200. }
  201. })
  202. },
  203. changeTime(data){
  204. console.log(data)
  205. this.billDate=data
  206. },
  207. cktime(){
  208. this.$refs.timeSelect.open();
  209. },
  210. }
  211. }
  212. </script>
  213. <style scoped lang="less">
  214. .box{
  215. background: #F4F5F7;
  216. min-height: 100vh;
  217. }
  218. .yuyuCheckTis{
  219. color: #C8841C;
  220. line-height: 37rpx;
  221. font-size: 28rpx;
  222. background: #FFF7EB;
  223. padding: 18rpx 24rpx;
  224. font-weight: 400;
  225. }
  226. .cont{
  227. padding: 24rpx;
  228. }
  229. .contkk{
  230. background: #ffffff;
  231. border-radius: 10rpx;
  232. padding: 0 20rpx;
  233. }
  234. .kkline{
  235. display: flex;
  236. padding: 30rpx 0;
  237. border-bottom: 1px solid #EEEEEE;
  238. color: #666666;
  239. font-size: 28rpx;
  240. }
  241. .kkline2{
  242. display: flex;
  243. justify-content: space-between;
  244. padding: 30rpx 0;
  245. border-bottom: 1px solid #EEEEEE;
  246. color: #666666;
  247. font-size: 28rpx;
  248. }
  249. .stars{
  250. color: #FF2400;
  251. }
  252. .kklineRight{
  253. color: #3c3c3c;
  254. font-size: 28rpx;
  255. display: flex;
  256. justify-content: space-between;
  257. width: 450rpx;
  258. }
  259. .kklineLeft {
  260. width: 200rpx;
  261. }
  262. .rightJt{
  263. width: 30rpx;
  264. height: 30rpx;
  265. margin-top: 4rpx;
  266. }
  267. .lineborderNo{
  268. border-bottom: none;
  269. }
  270. .kklineLeft1{
  271. font-weight: 500;
  272. color: #3C3C3C;
  273. font-size: 28rpx;
  274. }
  275. .kklineRight1{
  276. font-weight: 400;
  277. color: #999999;
  278. font-size: 26rpx;
  279. }
  280. .kklineLeft3{
  281. font-weight: 400;
  282. color: #666666;
  283. font-size: 28rpx;
  284. width: 480rpx;
  285. overflow: hidden;
  286. white-space: nowrap;
  287. text-overflow: ellipsis;
  288. }
  289. .kklineRight3{
  290. font-weight: 400;
  291. color: #3C3C3C;
  292. font-size: 28rpx;
  293. }
  294. .bzline{
  295. display: flex;padding: 30rpx 0;
  296. }
  297. .beizInput{
  298. width: 450rpx;font-size: 28rpx;
  299. }
  300. .beiz{
  301. color: #666666;font-size: 28rpx;
  302. width: 200rpx;
  303. }
  304. .bottom-container{
  305. width: 750rpx;
  306. height: 120rpx;
  307. background: #FFFFFF;
  308. box-shadow: 0px -2px 10px 0px rgba(153,153,153,0.1000);
  309. position: fixed;
  310. left: 0;
  311. bottom: 0;
  312. display: flex;
  313. justify-content: space-between;
  314. }
  315. .newyyBotbutton{
  316. width: 204rpx;
  317. height: 74rpx;
  318. background: #D53533;
  319. border-radius: 37rpx;
  320. font-weight: 500;
  321. color: #FFFFFF;
  322. line-height: 74rpx;
  323. text-align: center;
  324. margin-right: 30rpx;
  325. margin-top: 23rpx;
  326. }
  327. .bottom-container-price{
  328. color: #FF0000;
  329. padding-top: 30rpx;
  330. padding-left: 30rpx;
  331. font-size: 32rpx;
  332. }
  333. .qianhaospan{
  334. font-size: 22rpx;
  335. }
  336. .ckj{
  337. color: #999999;font-size: 24rpx;
  338. padding-left: 30rpx;
  339. }
  340. </style>