getOrder.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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">
  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. read (e) {
  132. this.isRead = e.msg
  133. },
  134. intoAgreement () {
  135. uni.navigateTo({
  136. url: '/pages/agreement/agreement'
  137. })
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. page{
  144. height: 100%;
  145. }
  146. .content{
  147. width: 100%;
  148. height: 100%;
  149. display: flex;
  150. flex-direction: column;
  151. .step{
  152. padding: 40rpx 0;
  153. }
  154. .step-content{
  155. flex: 1;
  156. width: 100%;
  157. display: flex;
  158. flex-direction: column;
  159. .step-item{
  160. width: 100%;
  161. display: flex;
  162. flex-direction: column;
  163. align-items: center;
  164. flex: 1;
  165. }
  166. .step-one{
  167. text{
  168. color: #999;
  169. margin-top: 40rpx;
  170. margin-bottom: 15%;
  171. }
  172. image{
  173. width: 40%;
  174. height: 60%;
  175. }
  176. }
  177. .step-two{
  178. background-color: #F8F8F8;
  179. .item{
  180. background-color: #fff;
  181. width: 80%;
  182. height: 40%;
  183. display: flex;
  184. flex-direction: column;
  185. align-items: center;
  186. margin-top: 20rpx;
  187. padding-top: 20rpx;
  188. image{
  189. width: 80%;
  190. flex: 1;
  191. }
  192. }
  193. .top{
  194. text{
  195. color: #df928e;
  196. font-size: 24rpx;
  197. margin-bottom: 20rpx;
  198. }
  199. .care{
  200. padding: 10rpx 20rpx;
  201. background-color: #ff805b;
  202. border-radius: 30rpx;
  203. color: #fff;
  204. font-size: 24rpx;
  205. margin-bottom: 10rpx;
  206. }
  207. }
  208. .bottom{
  209. text{
  210. font-size: 24rpx;
  211. color: #333;
  212. }
  213. }
  214. }
  215. .step-three{
  216. .choose{
  217. width: 100%;
  218. height: auto;
  219. padding-bottom: 80rpx;
  220. display: flex;
  221. flex-direction: column;
  222. align-items: center;
  223. border-bottom: 1px solid #eee;
  224. .title{
  225. color: #666;
  226. }
  227. .list{
  228. width: 100%;
  229. display: flex;
  230. justify-content: space-around;
  231. .item{
  232. width: 28%;
  233. height: 180rpx;
  234. display: flex;
  235. flex-direction: column;
  236. align-items: center;
  237. justify-content: center;
  238. border: 1px solid #eee;
  239. border-radius: 30rpx;
  240. margin-top: 30rpx;
  241. color: #999;
  242. }
  243. .avtive{
  244. color: #333;
  245. border-color: rgb(255,0,0);
  246. .price{
  247. color: rgb(255,0,0);
  248. }
  249. }
  250. }
  251. }
  252. .choose-content{
  253. flex: 1;
  254. width: 100%;
  255. .choose-item{
  256. padding-left: 20rpx;
  257. width: 100%;
  258. }
  259. .item{
  260. width: 100%;
  261. height: 100rpx;
  262. display: flex;
  263. align-items: center;
  264. justify-content: space-between;
  265. border-bottom: 1px solid #eee;
  266. .coopon{
  267. color: rgb(255,0,0);
  268. }
  269. }
  270. .phone{
  271. border-bottom: none;
  272. }
  273. .read{
  274. width: 100%;
  275. border-top: 1px solid #eee;
  276. padding-top: 40rpx;
  277. display: flex;
  278. justify-content: center;
  279. text{
  280. color: #999;
  281. }
  282. text:last-child{
  283. color: #ff9ba5;
  284. }
  285. }
  286. }
  287. }
  288. .step-footer{
  289. width: 100%;
  290. height: 100rpx;
  291. background-color: #fff;
  292. .pay{
  293. padding-top: 20rpx;
  294. width: 100%;
  295. height: 100%;
  296. border-top: 1px solid #eee;
  297. display: flex;
  298. align-items: center;
  299. justify-content: flex-end;
  300. .amount{
  301. color: rgb(255,0,0);
  302. font-size: 36rpx;
  303. margin-right: 40rpx;
  304. }
  305. button{
  306. width: 200rpx;
  307. }
  308. }
  309. }
  310. }
  311. }
  312. </style>