confirmYuyue.vue 7.3 KB

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