confirmYuyue.vue 7.0 KB

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