appointList.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view class="appointList">
  3. <!-- <view v-for="item in appointList" :key="item.id" class="appoint">
  4. <view class="fl-flex fl-justify-between">
  5. <view>
  6. {{ item.mobile }}
  7. <text class="f-s-22" style="color: #999999"> (预留手机) </text>
  8. </view>
  9. <u-icon name="phone" color="#2979ff" size="24" @click="handlerMakePhone(item.mobile)" />
  10. </view>
  11. <view class="line"></view>
  12. <view class="fl-flex fl-align-center">
  13. <image
  14. :src="item.simpleMerchantVO.logo"
  15. mode="scaleToFill"
  16. style="width: 200rpx; height: 200rpx"
  17. v-if="item.simpleMerchantVO.logo"
  18. />
  19. <image
  20. src="/static/QR57a.jpg"
  21. v-else
  22. mode="scaleToFill"
  23. style="width: 200rpx; height: 200rpx"
  24. />
  25. <view class="u-p-l-10">
  26. <view class="f-s-32" style="font-weight: bold">服务名称服务</view>
  27. <view style="margin: 10rpx 0">{{ $u.timeFormat(item.appointTime) || '--' }}</view>
  28. <view>{{ item.simpleMerchantVO.address || '--' }}</view>
  29. </view>
  30. </view>
  31. </view> -->
  32. <view class="content">
  33. <ren-calendar ref='ren' :markDays='markDays' :headerBar='true' :open="false"
  34. @onDayClick='onDayClick'></ren-calendar>
  35. </view>
  36. <!-- 订单 -->
  37. <view class="order">
  38. <view class="order-box">
  39. <view class="order-item" v-for="(item, index) of appointList" :key="index">
  40. <view class="item-allnumb-box">
  41. <view class="allnumb-left">
  42. <image class="img" :src="item.avatar "
  43. style="width: 50rpx; height: 50rpx" />
  44. <span style="margin-left:20rpx">{{item.memberUsername}}</span>
  45. </view>
  46. <view class="allnumb-right" :style="{color: getStatusColor(item.status)}">
  47. {{ getStatusText(item.status) }}
  48. </view>
  49. </view>
  50. <u-line margin="20rpx 0"></u-line>
  51. <view class="item-center" :key="idx" v-for="(itm, idx) of item.goodsInfo">
  52. <view class="center-left">
  53. <image :src="itm.goodsPic" class="img"></image>
  54. </view>
  55. <view class="center-right">
  56. <view class="r-l">
  57. <view class="right-name"> {{ itm.goodsName }} </view>
  58. <!-- <view class="right-descript"> 测试商品描述111 </view> -->
  59. <view class="l-box">
  60. <view class="right-price"> ¥{{ itm.goodsPrice }} </view>
  61. <view class="right-numb"> ×{{ itm.goodsQuantity }} </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="item-allnumb-box">
  67. <view class="allnumb-left"></view>
  68. <view class="allnumb-right">
  69. <span class="r-text">实付款</span>¥{{ item.payAmount }}
  70. </view>
  71. </view>
  72. <u-line margin="20rpx 0" dashed="true"></u-line>
  73. <view class="item-top">
  74. <view class="top-left gray-color">订单编号 : {{ item.id }}</view>
  75. <view class="top-right">{{ type_name }}</view>
  76. </view>
  77. <view class="item-top">
  78. <view class="top-left gray-color">下单时间 : {{formatTime1(item.createTime) }}</view>
  79. <view class="top-right"></view>
  80. </view>
  81. <view class="item-top">
  82. <view class="top-left gray-color">预约时间: {{ formatTime1(item.appointTime) }}</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view style="margin-top: 40rpx" v-if="appointList.length === 0">
  87. <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script>
  93. import {
  94. // getAppointListApi,
  95. getMerchantListApi
  96. } from '@/api/merchant/order';
  97. export default {
  98. data() {
  99. return {
  100. // params: {
  101. // offset: 1,
  102. // size: 10,
  103. // },
  104. appointList: [],
  105. list: {},
  106. curDate: '',
  107. markDays: [],
  108. params: {
  109. pageNum: 1,
  110. pageSize: 10,
  111. },
  112. };
  113. },
  114. // created() {
  115. // let {
  116. // merchant
  117. // } = this.$store.state.data.merchantInfo;
  118. // this.list = merchant;
  119. // let today = this.$refs.ren.getToday().date;
  120. // this.curDate = today;
  121. // this.markDays.push(today);
  122. // console.log(this.curDate)
  123. // },
  124. // mounted() {
  125. // this.getMerchantList();
  126. // },
  127. onReady() {
  128. },
  129. onShow() {
  130. let {
  131. merchant
  132. } = this.$store.state.data.merchantInfo;
  133. this.list = merchant;
  134. let today = this.$refs.ren.getToday().date;
  135. this.curDate = today;
  136. this.markDays.push(today);
  137. console.log(this.curDate)
  138. this.getMerchantList();
  139. },
  140. methods: {
  141. onDayClick(data) {
  142. console.log(data.date)
  143. this.curDate = data.date;
  144. },
  145. async getMerchantList() {
  146. let result = Object.assign({}, {
  147. paging: `${this.params.pageNum},${this.params.pageSize}`
  148. }, {
  149. merchantId: this.list.id,
  150. status: 'PENDING',
  151. date: this.curDate
  152. });
  153. let res = await getMerchantListApi({
  154. ...result
  155. });
  156. console.log(res, "sdaasdsas")
  157. },
  158. getStatusColor(status) {
  159. switch (status) {
  160. case 1:
  161. return 'blue';
  162. case 2:
  163. return 'red';
  164. case 3:
  165. return 'orange';
  166. default:
  167. return 'black';
  168. }
  169. },
  170. getStatusText(status) {
  171. switch (status) {
  172. case 1:
  173. return '待处理';
  174. case 2:
  175. return '已取消';
  176. case 3:
  177. return '已完成';
  178. default:
  179. return '';
  180. }
  181. },
  182. formatTime1(timestamp) {
  183. const date = new Date(timestamp ); // 转换为毫秒
  184. const year = date.getFullYear();
  185. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  186. const day = ('0' + date.getDate()).slice(-2);
  187. const hour = ('0' + date.getHours()).slice(-2);
  188. const minute = ('0' + date.getMinutes()).slice(-2);
  189. const second = ('0' + date.getSeconds()).slice(-2);
  190. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  191. }
  192. // async getAppointList() {
  193. // let result = Object.assign({}, { ...this.params }, { merchantId: this.list.id });
  194. // let res = await getAppointListApi({ ...result });
  195. // if (res.code === 'OK') {
  196. // this.appointList = res.data;
  197. // }
  198. // },
  199. },
  200. };
  201. </script>
  202. <style lang="scss" scoped>
  203. .order {
  204. margin-top: 10px;
  205. padding: 10rpx 20rpx 20rpx;
  206. box-sizing: border-box;
  207. .order-box {
  208. .order-item {
  209. margin-bottom: 20rpx;
  210. background-color: #fff;
  211. border-radius: 20rpx;
  212. padding: 20rpx;
  213. box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
  214. .item-top {
  215. display: flex;
  216. justify-content: space-between;
  217. margin-bottom: 10rpx;
  218. }
  219. .item-center {
  220. display: flex;
  221. align-items: center;
  222. margin-bottom: 10rpx;
  223. .center-left {
  224. height: 160rpx;
  225. .img {
  226. width: 160rpx;
  227. height: 160rpx;
  228. }
  229. }
  230. .center-right {
  231. width: 100%;
  232. height: 160rpx;
  233. display: flex;
  234. justify-content: space-between;
  235. margin-left: 20rpx;
  236. .r-l {
  237. display: flex;
  238. flex-direction: column;
  239. justify-content: space-around;
  240. .right-name {
  241. color: #4d5671;
  242. font-size: 32rpx;
  243. font-weight: bold;
  244. }
  245. .right-descript {
  246. font-size: 28rpx;
  247. color: #858797;
  248. }
  249. .l-box {
  250. display: flex;
  251. font-size: 24rpx;
  252. align-items: center;
  253. font-style: italic;
  254. .right-price {
  255. margin-right: 20rpx;
  256. font-weight: bold;
  257. font-size: 28rpx;
  258. color: #f57f32;
  259. }
  260. .right-numb {
  261. font-size: 24rpx;
  262. color: #858797;
  263. }
  264. }
  265. }
  266. .r-r {
  267. .r-item {
  268. align-items: center;
  269. }
  270. }
  271. }
  272. }
  273. .item-allnumb-box {
  274. display: flex;
  275. justify-content: space-between;
  276. align-items: center;
  277. font-weight: bold;
  278. .allnumb-left {
  279. display: flex;
  280. justify-content: start;
  281. align-items: center;
  282. font-size: 32rpx;
  283. .img {
  284. display: block;
  285. }
  286. }
  287. .allnumb-right {
  288. font-size: 26rpx;
  289. color: #f57f32;
  290. .r-text {
  291. color: #000;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. }
  298. </style>