getOrder.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <template>
  2. <view class="order-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 class="next-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. uni.removeStorageSync('stepIndex')
  112. // 注册全局监听事件
  113. uni.$once('read', this.read)
  114. },
  115. onUnload() {
  116. uni.removeStorageSync('stepIndex')
  117. },
  118. onShow() {
  119. const index = uni.getStorageSync('stepIndex')
  120. this.stepIndex = index ? index : 0
  121. console.log(this.stepIndex)
  122. },
  123. methods: {
  124. // 选择服务项目
  125. chooseItem(index) {
  126. this.serverIndex = index
  127. },
  128. // 下一步
  129. nextStep() {
  130. this.stepIndex = this.stepIndex===0 ? 1 : 2
  131. uni.setStorageSync('stepIndex', this.stepIndex)
  132. },
  133. // 已阅读
  134. read (e) {
  135. this.isRead = e.msg
  136. },
  137. // 选择优惠券
  138. intoChooseCoupon () {
  139. uni.navigateTo({
  140. url: '/pages/coupon/chooseCoupon/chooseCoupon'
  141. })
  142. },
  143. // 打开服务协议
  144. intoAgreement () {
  145. uni.navigateTo({
  146. url: '/pages/agreement/agreement'
  147. })
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss">
  153. page{
  154. height: 100%;
  155. }
  156. .order-content{
  157. width: 100%;
  158. height: 100%;
  159. display: flex;
  160. flex-direction: column;
  161. .step{
  162. padding: 40rpx 0;
  163. }
  164. .step-content{
  165. flex: 1;
  166. width: 100%;
  167. display: flex;
  168. flex-direction: column;
  169. .step-item{
  170. width: 100%;
  171. display: flex;
  172. flex-direction: column;
  173. align-items: center;
  174. flex: 1;
  175. }
  176. .step-one{
  177. text{
  178. color: #999;
  179. margin: 40rpx 0;
  180. }
  181. }
  182. .step-two{
  183. background-color: #F8F8F8;
  184. .item{
  185. background-color: #fff;
  186. width: 80%;
  187. height: 40%;
  188. display: flex;
  189. flex-direction: column;
  190. align-items: center;
  191. margin-top: 20rpx;
  192. padding-top: 20rpx;
  193. image{
  194. width: 80%;
  195. flex: 1;
  196. }
  197. }
  198. .top{
  199. text{
  200. color: #df928e;
  201. font-size: 24rpx;
  202. margin-bottom: 20rpx;
  203. }
  204. .care{
  205. padding: 10rpx 20rpx;
  206. background-color: #ff805b;
  207. border-radius: 30rpx;
  208. color: #fff;
  209. font-size: 24rpx;
  210. margin-bottom: 10rpx;
  211. }
  212. }
  213. .bottom{
  214. text{
  215. font-size: 24rpx;
  216. color: #333;
  217. }
  218. }
  219. }
  220. .step-three{
  221. .choose{
  222. width: 100%;
  223. height: auto;
  224. padding-bottom: 60rpx;
  225. display: flex;
  226. flex-direction: column;
  227. align-items: center;
  228. border-bottom: 1px solid #eee;
  229. .title{
  230. color: #666;
  231. }
  232. .list{
  233. width: 100%;
  234. display: flex;
  235. justify-content: space-around;
  236. padding: 0 20rpx;
  237. .item{
  238. width: 30%;
  239. height: 140rpx;
  240. display: flex;
  241. flex-direction: column;
  242. align-items: center;
  243. justify-content: center;
  244. border: 1px solid #eee;
  245. border-radius: 15rpx;
  246. margin-top: 30rpx;
  247. color: #999;
  248. .price{
  249. font-size: 34rpx;
  250. margin-top: 10rpx;
  251. }
  252. }
  253. .avtive{
  254. color: #333;
  255. border-color: rgb(255,0,0);
  256. .price{
  257. color: rgb(255,0,0);
  258. }
  259. }
  260. }
  261. }
  262. .choose-content{
  263. flex: 1;
  264. width: 100%;
  265. .choose-item{
  266. width: 100%;
  267. .item{
  268. padding: 0 30rpx;
  269. }
  270. }
  271. .item{
  272. width: 100%;
  273. height: 100rpx;
  274. display: flex;
  275. align-items: center;
  276. justify-content: space-between;
  277. border-bottom: 1px solid #eee;
  278. .coopon{
  279. color: rgb(255,0,0);
  280. }
  281. }
  282. .phone{
  283. border-bottom: none;
  284. }
  285. .read{
  286. width: 100%;
  287. border-top: 1px solid #eee;
  288. padding-top: 40rpx;
  289. display: flex;
  290. justify-content: center;
  291. text{
  292. color: #999;
  293. }
  294. text:last-child{
  295. color: #ff9ba5;
  296. }
  297. }
  298. }
  299. }
  300. .step-footer{
  301. width: 100%;
  302. background-color: #fff;
  303. .next-button{
  304. margin: 0;
  305. border-radius: 0;
  306. }
  307. .pay{
  308. width: 100%;
  309. height: 100%;
  310. padding: 10rpx;
  311. border-top: 1px solid #eee;
  312. display: flex;
  313. align-items: center;
  314. justify-content: flex-end;
  315. .amount{
  316. color: rgb(255,0,0);
  317. font-size: 36rpx;
  318. margin-right: 40rpx;
  319. }
  320. button{
  321. width: 200rpx;
  322. }
  323. }
  324. }
  325. }
  326. }
  327. </style>