index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="page">
  3. <view class="flex-row tuni">
  4. <image class="profile" :src="userInfo.avatar"></image>
  5. <view class="tuniMsg flex-col">
  6. <text class="name">{{userInfo.nickName}}</text>
  7. <view class="flex-row dizi">
  8. <u-icon name="/static/index/dizi.png" size="18"></u-icon>
  9. <text>{{storeName}}</text>
  10. </view>
  11. </view>
  12. <view class="flex-col " @click="userScanCode">
  13. <view class="flex-row justify-center dakaIcon">
  14. <u-icon name="/static/index/saoma.png" size="25"></u-icon>
  15. </view>
  16. <view class="flex-row justify-center dakaText">
  17. <text>报道打卡</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="flex-row justify-center">
  22. <view class="tab flex-row">
  23. <view class="tabs" :class="{selectTabs: tabIndex === 0}" @click="clickTab(0)">
  24. <text>服务中</text>
  25. </view>
  26. <view class="tabs" :class="{selectTabs: tabIndex === 1}" @click="clickTab(1)">
  27. <text>待服务</text>
  28. </view>
  29. </view>
  30. </view>
  31. <view v-if="tabIndex === 0" class="flex-row justify-center">
  32. <view class="serviceMsg " v-if="currService">
  33. <view class="flex-row serviceInfo ">
  34. <image class="serviceProfile" :src="currService.avatar"></image>
  35. <view class="flex-col justify-end">
  36. <view class="flex-row" >
  37. <text class="servicename">{{currService.serviceObjectName}}</text>
  38. <view class="flex-row justify-center tag">
  39. <text>切换</text>
  40. <u-icon name="/static/index/qiehuan.png" size="18"></u-icon>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view :style="{'height':'110rpx'}"></view>
  46. <view class="flex-row justify-center ">
  47. <view class="flex-row hintView">
  48. <view class="hint">
  49. <text>!</text>
  50. </view>
  51. <view class="hintCentent" v-if="currService.balanceFlag">
  52. <text>娇宝的余额已不足,请提醒充值~</text>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="flex-row justify-center ">
  57. <view class="flex-col itemView">
  58. <view class="flex-row item">
  59. <u-icon name="/static/index/jiandao.png" size="20"></u-icon>
  60. <text class="key">服务项目:</text>
  61. <text class="value">{{currService.serviceProject}}</text>
  62. </view>
  63. <view class="flex-row item">
  64. <u-icon name="/static/index/riqi.png" size="20"></u-icon>
  65. <text class="key">服务日期:</text>
  66. <text class="value">{{currService.date}}</text>
  67. </view>
  68. <view class="flex-row item">
  69. <view class="flex-row">
  70. <u-icon name="/static/index/aixin.png" size="20"></u-icon>
  71. <text class="key">服务人员:</text>
  72. <text class="value">{{currService.serviceUserName}}</text>
  73. </view>
  74. <view class="flex-row leftBord">
  75. <text class="key">预约费用:</text>
  76. <text class="value2">¥{{currService.bookingFee}}</text>
  77. </view>
  78. </view>
  79. <view class="flex-row item">
  80. <view class="flex-row">
  81. <u-icon name="/static/index/shiduan.png" size="20"></u-icon>
  82. <text class="key">服务时段:</text>
  83. <text class="value">{{currService.time}}</text>
  84. </view>
  85. <view class="flex-row leftBord">
  86. <text class="key">服务费用:</text>
  87. <text class="value2">¥{{currService.serviceFee}}</text>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="flex-row justify-center">
  93. <view class="flex-col itemView">
  94. <view class="flex-row justify-between">
  95. <view class="flex-col justify-center">
  96. <view class="flex-row">
  97. <text class="key1">服务总金额:</text>
  98. <text class="value1">¥{{currService.serviceFee + currService.bookingFee}}</text>
  99. </view>
  100. </view>
  101. <view class="flex-row justify-center tag1" v-if="currService.isSettle == 0" @click="settle">
  102. <u-icon name="/static/index/qianbao.png" size="18"></u-icon>
  103. <text>去结算</text>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="flex-row justify-center">
  109. <view class="flex-row justify-around grid">
  110. <view>
  111. <u-icon name="/static/index/jiaojieban.png" size="40"></u-icon>
  112. <text class="grid-text">服务交接</text>
  113. </view>
  114. <view>
  115. <u-icon name="/static/index/jiandao.png" size="40"></u-icon>
  116. <text class="grid-text">添加服务</text>
  117. </view>
  118. <view @click="next">
  119. <u-icon name="/static/index/xiayige.png" size="40"></u-icon>
  120. <text class="grid-text">下一位</text>
  121. </view>
  122. <view @click="takePlace">
  123. <u-icon name="/static/index/yijiuwei.png" size="40"></u-icon>
  124. <text class="grid-text">已就位</text>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="flex-row justify-center start" @click="start" v-if="currService.status == 1">
  129. <text>开始服务</text>
  130. </view>
  131. <view class="flex-row justify-center start" @click="end" v-if="currService.status == 6">
  132. <text>开始结束</text>
  133. </view>
  134. </view>
  135. <view class="flex-col" :style="{'height':sysHeight}" v-else>
  136. <view class="flex-row justify-center">
  137. <image class="dataNull" src="/static/index/dataNull.png"></image>
  138. </view>
  139. <view class="flex-row justify-center dataNullText">
  140. <text>暂无服务项目</text>
  141. </view>
  142. </view>
  143. </view>
  144. <view v-if="tabIndex === 1" :style="{'height':sysHeight}">
  145. <mescroll-item :i="0" :index="0" :height="sysHeight">
  146. </mescroll-item>
  147. </view>
  148. </view>
  149. </template>
  150. <script>
  151. import MescrollItem from "./module/mescrollUni-item.vue";
  152. export default {
  153. components: {
  154. MescrollItem
  155. },
  156. data() {
  157. return {
  158. tabIndex:0,
  159. sysHeight:'',
  160. group1: [
  161. {thumb: '/static/my/idcard.png', title: '个人信息', rightText: '', to: '/myPages/aboutOur/index'}
  162. ],
  163. readerHeight:'',
  164. readerWidth:'',
  165. userInfo:{},
  166. storeId:'1710635498257108993',
  167. storeName:'娇骄儿白云店',
  168. currService:{},
  169. }
  170. },
  171. onLoad(){
  172. let sysInfo = uni.getSystemInfoSync()
  173. this.sysHeight = sysInfo.windowHeight - (sysInfo.windowWidth/750) * 354 + 'px'
  174. this.readerHeight=sysInfo.windowHeight + 'px'
  175. this.readerWidth=sysInfo.windowWidth + 'px'
  176. console.log(this.sysHeight)
  177. uni.getLocation({
  178. success:(e)=>{
  179. console.log(e)
  180. }
  181. })
  182. uni.setStorageSync('storeId',this.storeId)
  183. },
  184. onShow(){
  185. //退款成功后,刷新列表监听事件
  186. uni.$off('scancode')
  187. uni.$on('scancode',this.scancode)
  188. this.getUserInfo()
  189. this.currServiceInfo()
  190. },
  191. methods: {
  192. takePlace(){
  193. this.$api.service.takePlace({
  194. orderServiceId:this.currService.orderServiceId
  195. }).then(res=>{
  196. this.currServiceInfo()
  197. })
  198. },
  199. settle(){
  200. this.$api.service.settle({
  201. orderServiceId:this.currService.orderServiceId
  202. }).then(res=>{
  203. this.currServiceInfo()
  204. })
  205. },
  206. start(){
  207. this.$api.service.start({
  208. orderServiceId:this.currService.orderServiceId
  209. }).then(res=>{
  210. this.currServiceInfo()
  211. })
  212. },
  213. end(){
  214. this.$api.service.end({
  215. orderServiceId:this.currService.orderServiceId
  216. }).then(res=>{
  217. this.currServiceInfo()
  218. })
  219. },
  220. next(){
  221. this.$api.service.next({
  222. orderServiceId:this.currService.orderServiceId
  223. }).then(res=>{
  224. this.currServiceInfo()
  225. })
  226. },
  227. currServiceInfo(){
  228. this.$api.service.currServiceInfo({storeId:this.storeId}).then(res=>{
  229. console.log(res.data.data)
  230. this.currService = res.data.data
  231. })
  232. },
  233. getUserInfo(){
  234. this.$api.user.getUserInfo().then(res=>{
  235. this.userInfo = res.data.data.user
  236. })
  237. },
  238. userScanCode(){
  239. uni.navigateTo({
  240. url:'/pages/scanCode/scanCode'
  241. })
  242. },
  243. scancode(e){
  244. console.log(e)
  245. this.$u.toast(e)
  246. },
  247. clickTab(e){
  248. this.tabIndex = e
  249. if (e===0){
  250. this.currServiceInfo()
  251. }
  252. },
  253. }
  254. }
  255. </script>
  256. <style lang="scss" scoped>
  257. @import './index.rpx.css';
  258. </style>