getOrder.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <view class="content">
  3. <view class="step">
  4. <uni-steps :options="[{title: '停车'}, {title: '检查'}, {title: '下单'}]" :active="stepIndex" active-color="rgb(255,0,0)"></uni-steps>
  5. </view>
  6. <view class="step-content">
  7. <!-- 停车 -->
  8. <view v-if="stepIndex===0" class="step-item step-one">
  9. <text>请确认车辆是否停到指定位置</text>
  10. <image src="/static/img/step-one.png" mode="aspectFit"></image>
  11. </view>
  12. <!-- 检查 -->
  13. <view v-if="stepIndex===1" class="step-item step-two">
  14. <view class="item top">
  15. <text>-请完成以下操作-</text>
  16. <image src="/static/img/cztis.png" mode="aspectFit"></image>
  17. <view class="care">
  18. 注意:洗车过程中禁止移动车辆和上下车
  19. </view>
  20. </view>
  21. <view class="item bottom">
  22. <text>超高加装件不能清洗</text>
  23. <image src="/static/img/zyts.png" mode="aspectFit"></image>
  24. </view>
  25. </view>
  26. <!-- 下单 -->
  27. <view v-if="stepIndex===2" class="step-item step-three">
  28. <view class="choose">
  29. <view class="title">
  30. 请选择服务模式
  31. </view>
  32. <view class="list">
  33. <view :class="['item', serverIndex==index ?'avtive':'']" @click="chooseItem(index)" v-for="(item,index) in itemList" :key="index">
  34. <text>{{item.name}}</text>
  35. <text class="price">¥{{item.price}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="choose-content">
  40. <view class="choose-item">
  41. <view class="item" @click="intoChooseCoupon">
  42. <text>优惠卷</text>
  43. <view class="right">
  44. <u-icon name="gift" color="rgb(255,0,0)" size="32"></u-icon>
  45. <text class="coopon">9.8元洗车券(¥-9.8)</text>
  46. <u-icon name="arrow-right" color="rgb(255,0,0)" size="32"></u-icon>
  47. </view>
  48. </view>
  49. <view class="item phone">
  50. <text>手机号码</text>
  51. <view class="right">
  52. <text >18792703003</text>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="read">
  57. <u-radio-group v-model="isRead">
  58. <u-radio shape="square" :disabled="isRead!='read'" name="read" active-color="red" icon-size="28" label-size="28">
  59. 点击阅读并同意
  60. <text>无人洗车</text>
  61. <text @click="intoAgreement">《注意事项及服务协议》</text>
  62. </u-radio>
  63. </u-radio-group>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="step-footer">
  68. <button @click="nextStep" v-if="stepIndex!=2" type="warn">下一步</button>
  69. <view v-else class="pay">
  70. <text>合计:</text>
  71. <text class="amount">¥10:00</text>
  72. <view class="">
  73. <button type="warn">去付款</button>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import uniSteps from '@/components/uni-steps/uni-steps.vue'
  82. export default {
  83. components: {
  84. uniSteps
  85. },
  86. data() {
  87. return {
  88. stepIndex: 0, // 当前步奏下标
  89. serverIndex: 0, // 选择服务下标
  90. itemList: [ // 服务列表
  91. {
  92. id: 1,
  93. name: '极速快洗',
  94. price: 10
  95. },
  96. {
  97. id: 12,
  98. name: '精致洗',
  99. price: 20
  100. },
  101. {
  102. id: 13,
  103. name: '打蜡洗',
  104. price: 30
  105. }
  106. ],
  107. isRead: '', // 是否同意协议
  108. }
  109. },
  110. onLoad(option) {
  111. // 注册全局监听事件
  112. uni.$once('read', this.read)
  113. },
  114. onUnload() {
  115. uni.removeStorageSync('stepIndex')
  116. },
  117. onShow() {
  118. const index = uni.getStorageSync('stepIndex')
  119. this.stepIndex = index ? index : 0
  120. },
  121. methods: {
  122. // 选择服务项目
  123. chooseItem(index) {
  124. this.serverIndex = index
  125. },
  126. // 下一步
  127. nextStep() {
  128. this.stepIndex = this.stepIndex===0 ? 1 : 2
  129. uni.setStorageSync('stepIndex', this.stepIndex)
  130. },
  131. // 已阅读
  132. read (e) {
  133. this.isRead = e.msg
  134. },
  135. // 选择优惠券
  136. intoChooseCoupon () {
  137. uni.navigateTo({
  138. url: '/pages/coupon/chooseCoupon/chooseCoupon'
  139. })
  140. },
  141. // 打开服务协议
  142. intoAgreement () {
  143. uni.navigateTo({
  144. url: '/pages/agreement/agreement'
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. page{
  152. height: 100%;
  153. }
  154. .content{
  155. width: 100%;
  156. height: 100%;
  157. display: flex;
  158. flex-direction: column;
  159. .step{
  160. padding: 40rpx 0;
  161. }
  162. .step-content{
  163. flex: 1;
  164. width: 100%;
  165. display: flex;
  166. flex-direction: column;
  167. .step-item{
  168. width: 100%;
  169. display: flex;
  170. flex-direction: column;
  171. align-items: center;
  172. flex: 1;
  173. }
  174. .step-one{
  175. text{
  176. color: #999;
  177. margin-top: 40rpx;
  178. margin-bottom: 15%;
  179. }
  180. image{
  181. width: 40%;
  182. height: 60%;
  183. }
  184. }
  185. .step-two{
  186. background-color: #F8F8F8;
  187. .item{
  188. background-color: #fff;
  189. width: 80%;
  190. height: 40%;
  191. display: flex;
  192. flex-direction: column;
  193. align-items: center;
  194. margin-top: 20rpx;
  195. padding-top: 20rpx;
  196. image{
  197. width: 80%;
  198. flex: 1;
  199. }
  200. }
  201. .top{
  202. text{
  203. color: #df928e;
  204. font-size: 24rpx;
  205. margin-bottom: 20rpx;
  206. }
  207. .care{
  208. padding: 10rpx 20rpx;
  209. background-color: #ff805b;
  210. border-radius: 30rpx;
  211. color: #fff;
  212. font-size: 24rpx;
  213. margin-bottom: 10rpx;
  214. }
  215. }
  216. .bottom{
  217. text{
  218. font-size: 24rpx;
  219. color: #333;
  220. }
  221. }
  222. }
  223. .step-three{
  224. .choose{
  225. width: 100%;
  226. height: auto;
  227. padding-bottom: 80rpx;
  228. display: flex;
  229. flex-direction: column;
  230. align-items: center;
  231. border-bottom: 1px solid #eee;
  232. .title{
  233. color: #666;
  234. }
  235. .list{
  236. width: 100%;
  237. display: flex;
  238. justify-content: space-around;
  239. .item{
  240. width: 28%;
  241. height: 180rpx;
  242. display: flex;
  243. flex-direction: column;
  244. align-items: center;
  245. justify-content: center;
  246. border: 1px solid #eee;
  247. border-radius: 30rpx;
  248. margin-top: 30rpx;
  249. color: #999;
  250. }
  251. .avtive{
  252. color: #333;
  253. border-color: rgb(255,0,0);
  254. .price{
  255. color: rgb(255,0,0);
  256. }
  257. }
  258. }
  259. }
  260. .choose-content{
  261. flex: 1;
  262. width: 100%;
  263. .choose-item{
  264. padding-left: 20rpx;
  265. width: 100%;
  266. }
  267. .item{
  268. width: 100%;
  269. height: 100rpx;
  270. display: flex;
  271. align-items: center;
  272. justify-content: space-between;
  273. border-bottom: 1px solid #eee;
  274. .coopon{
  275. color: rgb(255,0,0);
  276. }
  277. }
  278. .phone{
  279. border-bottom: none;
  280. }
  281. .read{
  282. width: 100%;
  283. border-top: 1px solid #eee;
  284. padding-top: 40rpx;
  285. display: flex;
  286. justify-content: center;
  287. text{
  288. color: #999;
  289. }
  290. text:last-child{
  291. color: #ff9ba5;
  292. }
  293. }
  294. }
  295. }
  296. .step-footer{
  297. width: 100%;
  298. height: 100rpx;
  299. background-color: #fff;
  300. .pay{
  301. padding-top: 20rpx;
  302. width: 100%;
  303. height: 100%;
  304. border-top: 1px solid #eee;
  305. display: flex;
  306. align-items: center;
  307. justify-content: flex-end;
  308. .amount{
  309. color: rgb(255,0,0);
  310. font-size: 36rpx;
  311. margin-right: 40rpx;
  312. }
  313. button{
  314. width: 200rpx;
  315. }
  316. }
  317. }
  318. }
  319. }
  320. </style>