confirmYuyue.vue 7.1 KB

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