createOrderT.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. <template>
  2. <view class="content">
  3. <view class="" style="background-color: #4076d6;height: 100rpx;">
  4. </view>
  5. <view class="good-info-wrap">
  6. <view class="good-list">
  7. <!-- <view class="empty" v-if="xmlist.length == 0" @click="chooseGoods">
  8. 选择项目
  9. </view> -->
  10. <!-- 商品详情 -->
  11. <view class="good-wrap">
  12. <view class="good">
  13. <image :src="item_detail.image" mode="" class="good-img"></image>
  14. <view class="good-info">
  15. <view class="good-name clamp2">
  16. {{item_detail.name}}
  17. </view>
  18. <view class="good-price">
  19. {{item_detail.price}}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="mjly">
  26. <view class="ly-left">
  27. 买家留言
  28. </view>
  29. <input type="text" placeholder="请输入留言内容" class="ly-right" v-model="mjly">
  30. </view>
  31. </view>
  32. <!-- <view class="mj-info" @click="goPage('/pagesT/customer/selCustomer')">
  33. <view class="mjly" style="border-bottom: 1rpx solid #f7f8fa;">
  34. <view class="ly-left">
  35. 客户姓名
  36. </view>
  37. <input type="text" placeholder="请输入留言内容" class="ly-right" v-model="customerData.name" v-if="customerData.name" disabled>
  38. <image src="../../static/img/downright.png" mode="" v-else></image>
  39. </view>
  40. <view class="mjly" >
  41. <view class="ly-left">
  42. 联系方式
  43. </view>
  44. <input type="number" placeholder="请填写联系方式" class="ly-right" v-model="customerData.mobile" @click.stop="">
  45. </view>
  46. </view> -->
  47. <!-- 选择门店 -->
  48. <view class="sc-md">
  49. <view class="sc-tip">
  50. 选择门店
  51. </view>
  52. <view class="store-info" @click="openStoreChoose">
  53. <image :src="choose_store.logo" mode="" class="store-logo"></image>
  54. <view class="info">
  55. <view class="store-name">
  56. {{choose_store.name}}
  57. </view>
  58. <view class="store-address">
  59. {{choose_store.area.provinceName + choose_store.area.cityName + choose_store.area.districtName + choose_store.area.address}}
  60. </view>
  61. </view>
  62. <view class="float_right"><text class="ibonfont ibonjinru"></text></view>
  63. </view>
  64. </view>
  65. <!-- 门店列表弹出层 -->
  66. <u-popup v-model="store_choose_show" mode="bottom" @close="close" @open="open" border-radius="14">
  67. <view>
  68. <scroll-view scroll-y="true" class="store-list" @scrolltolower="getStoreList()">
  69. <view class="store-info " :class="{'choose-stroe': storeitem.id == choose_store.id}"
  70. v-for="(storeitem,storeindex) in store.list" @click="chooseStore(storeitem)">
  71. <image :src="storeitem.logo" mode="" class="store-logo"></image>
  72. <view class="info">
  73. <view class="store-name">
  74. {{storeitem.name}}
  75. </view>
  76. <view class="store-address">
  77. {{storeitem.area.provinceName + storeitem.area.cityName + storeitem.area.districtName + storeitem.area.address}}
  78. </view>
  79. </view>
  80. <view class="float_right"></text></view>
  81. </view>
  82. <u-loadmore :status="store.loadingType" />
  83. </scroll-view>
  84. </view>
  85. </u-popup>
  86. <!-- 预约 -->
  87. <its-calendar :sta_num="start_time" :end_num="end_time" :int_num="30" @getTime="getTime"></its-calendar>
  88. <!-- 指派 -->
  89. <scroll-view scroll-x="true" class="zp-wrap" v-if="timed">
  90. <view class="zp-item" v-for="ygitem in yg.list" @click="choosYg(ygitem)">
  91. <image src="" mode="" class="zp-logo"></image>
  92. <view class="zp-name">随机指派</view>
  93. </view>
  94. </scroll-view>
  95. <!-- 结算 -->
  96. <!-- 填充 -->
  97. <view class="" style="height: 110rpx;"></view>
  98. <view class="tj-dd">
  99. <view class="">
  100. <text style="font-size: 26rpx;color: #999;">提交</text>
  101. <text style="color: #CE372E;font-size: 44rpx;font-weight: bold;padding-left: 10rpx;"
  102. class="rmb">1000</text>
  103. <text style="font-size: 22rpx;color: #333333;font-weight: bold;">(包含预约费¥3元)</text>
  104. </view>
  105. <view class="tj-btn">
  106. 提交
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import its from '@/components/its-calendar/its-calendar.vue'
  113. export default {
  114. components: {
  115. its
  116. },
  117. data() {
  118. return {
  119. good_id: '',
  120. item_detail: {},
  121. mjly: '',
  122. customerData: {},
  123. store: {
  124. page: 1,
  125. page_size: 10,
  126. list: [],
  127. loadingType: 'loadmore',
  128. loaded: false,
  129. },
  130. yg: {
  131. page: 1,
  132. page_size: 10,
  133. list: [],
  134. loadingType: 'loadmore',
  135. loaded: false,
  136. },
  137. choose_yg: {},
  138. choose_store: {},
  139. choose_time: {},
  140. count_detail: {}, //计算结果
  141. timed: false, //是否选择完时间
  142. store_choose_show: false, //门店选择弹出层开关
  143. start_time: 0,
  144. end_time: 24,
  145. yyshow: true
  146. }
  147. },
  148. computed: {
  149. // start_time() {
  150. // let start = this.store.state
  151. // },
  152. // end_time() {
  153. // }
  154. },
  155. watch: {
  156. choose_store(newval, oldval) {
  157. if (newval.openTime.isAllDay != 1) {
  158. let start = newval.openTime.start.split(':')
  159. let end = newval.openTime.end.split(':')
  160. if(start[1]>30) {
  161. this.start_time = start[0]*1 + 1
  162. }else {
  163. this.start_time = start[0]*1
  164. }
  165. this.end_time = end[0]*1
  166. console.log(this.start_time)
  167. return;
  168. }else {
  169. this.start_time = 0
  170. this.end_time = 24
  171. console.log(this.start_time)
  172. return;
  173. }
  174. },
  175. choose_time(newval, oldval) {
  176. this.getYgList('reload')
  177. },
  178. choose_yg(newval, oldval) {
  179. this.getYgYyTimeArea()
  180. }
  181. },
  182. onLoad(opt) {
  183. this.good_id = opt.id
  184. this.getItemDetail()
  185. this.calculation()
  186. console.log(this.$store.state.locationObj, 'this.$store.state.locationObj')
  187. this.getStoreList()
  188. },
  189. onShow() {
  190. console.log(this.customerData)
  191. },
  192. onReachBottom() {
  193. },
  194. onReady() {
  195. },
  196. methods: {
  197. close() {
  198. this.store_choose_show = false
  199. },
  200. open() {
  201. },
  202. // 打开门店选择
  203. openStoreChoose() {
  204. console.log('打开门店选择')
  205. this.store_choose_show = true
  206. },
  207. //选择门店
  208. chooseStore(item) {
  209. this.choose_store = item
  210. this.close()
  211. },
  212. getTime(e) {
  213. console.log(e);
  214. this.timed = true
  215. this.choose_time = e.time.split(' ')[0]
  216. },
  217. //计算价格
  218. calculation() {
  219. let that = this
  220. that.$u.api.calculation({
  221. id: that.good_id
  222. }).then(({
  223. data
  224. }) => {
  225. console.log(data, 'price')
  226. }).catch(err => {
  227. })
  228. },
  229. getItemDetail() {
  230. this.$u.api.getItemDetail({
  231. id: this.good_id
  232. }).then(({
  233. data
  234. }) => {
  235. this.item_detail = data
  236. }).catch(err => {
  237. })
  238. },
  239. // 获取门店列表
  240. getStoreList() {
  241. console.log('获取门店列表')
  242. let item = this.store
  243. if (item.loadingType == 'loading' || item.loadingType == 'nomore') {
  244. return
  245. }
  246. item.loadingType = 'loading'
  247. this.$u.api.getStoreList({
  248. page: item.page,
  249. pageSize: item.page_size,
  250. longitude: this.$store.state.locationObj.longitude,
  251. latitude: this.$store.state.locationObj.latitude
  252. }).then(({
  253. data
  254. }) => {
  255. console.log(data, '门店列表')
  256. item.list = item.list.concat(data)
  257. if (item.page == 1) {
  258. this.choose_store = item.list[0]
  259. }
  260. item.page++
  261. if (item.page_size == data.length) {
  262. item.loadingType = 'loadmore'
  263. } else {
  264. item.loadingType = 'nomore'
  265. }
  266. })
  267. },
  268. //获取员工列表
  269. getYgList(type) {
  270. let item = this.yg
  271. if(type == 'reload') {
  272. item.list = []
  273. item.loadingType = 'loadmore'
  274. }
  275. if (item.loadingType == 'loading' || item.loadingType == 'nomore') {
  276. return
  277. }
  278. item.loadingType = 'loading'
  279. this.$u.api.getTimeYgList({
  280. time: this.choose_time
  281. }).then(({data}) => {
  282. if(data != '当天未找到员工') {
  283. item.list = data
  284. }
  285. item.loadingType = 'nomore'
  286. })
  287. },
  288. //判断是否能预约员工
  289. getYgYyTimeArea() {
  290. this.$u.api.getYgYyTimeArea({
  291. time: this.choose_time,
  292. uid: this.choose_yg.id
  293. }).then(({data}) => {
  294. })
  295. }
  296. }
  297. }
  298. </script>
  299. <style lang="scss">
  300. .good-info-wrap {
  301. margin: -50rpx auto 20rpx;
  302. width: 712rpx;
  303. min-height: 285rpx;
  304. background: #FFFFFF;
  305. border-radius: 10rpx;
  306. padding: 10rpx 20rpx;
  307. .good-list {
  308. min-height: 177rpx;
  309. width: 100%;
  310. .good-wrap {
  311. min-height: 177rpx;
  312. .good {
  313. height: 177rpx;
  314. border-bottom: 1px solid #f7f8fa;
  315. display: flex;
  316. justify-content: flex-start;
  317. align-items: center;
  318. .good-info {
  319. height: 177rpx;
  320. width: 365rpx;
  321. padding: 25rpx 0 25rpx 20rpx;
  322. display: flex;
  323. flex-direction: column;
  324. justify-content: space-between;
  325. align-items: flex-start;
  326. .good-name {
  327. font-size: 26rpx;
  328. font-weight: 500;
  329. color: #333333;
  330. }
  331. .good-price {
  332. margin-top: 20rpx;
  333. font-size: 34rpx;
  334. font-weight: bold;
  335. color: #CE372E;
  336. &::before {
  337. content: '¥';
  338. font-size: 24rpx;
  339. color: #CE372E;
  340. }
  341. }
  342. }
  343. .good-img {
  344. width: 133rpx;
  345. height: 133rpx;
  346. border-radius: 10rpx;
  347. background-color: #eee;
  348. }
  349. }
  350. }
  351. .empty {
  352. // display: ;
  353. font-size: 28rpx;
  354. height: 177rpx;
  355. background-color: #ecf1f7;
  356. text-align: center;
  357. line-height: 177rpx;
  358. color: #4472bd;
  359. border-radius: 10rpx;
  360. }
  361. }
  362. }
  363. .mj-info {
  364. width: 712rpx;
  365. height: 200rpx;
  366. background: #FFFFFF;
  367. border-radius: 10px;
  368. margin: 20rpx auto;
  369. padding: 0 20rpx;
  370. }
  371. .mjly {
  372. height: 100rpx;
  373. display: flex;
  374. justify-content: space-between;
  375. align-items: center;
  376. font-size: 26rpx;
  377. .ly-left {
  378. font-weight: 500;
  379. color: #000;
  380. }
  381. .ly-right {
  382. width: 400rpx;
  383. text-align: right;
  384. }
  385. image {
  386. width: 15rpx;
  387. height: 28rpx;
  388. }
  389. }
  390. //指派
  391. .zp-wrap {
  392. margin-top: 20rpx;
  393. width: 750rpx;
  394. height: 216rpx;
  395. white-space: nowrap;
  396. .zp-item {
  397. display: inline-block;
  398. margin-right: 15rpx;
  399. padding-top: 34rpx;
  400. width: 172rpx;
  401. height: 216rpx;
  402. // background: #E02020;
  403. background-color: #fff;
  404. border-radius: 10rpx;
  405. .zp-logo {
  406. display: block;
  407. width: 106rpx;
  408. height: 106rpx;
  409. margin: auto;
  410. border-radius: 50%;
  411. background-color: #999999;
  412. }
  413. .zp-name {
  414. width: 100%;
  415. text-align: center;
  416. font-size: 30rpx;
  417. font-weight: bold;
  418. color: #333333;
  419. }
  420. }
  421. }
  422. .tj-dd {
  423. width: 750rpx;
  424. height: 100rpx;
  425. position: fixed;
  426. bottom: 0;
  427. display: flex;
  428. justify-content: space-between;
  429. align-items: center;
  430. background-color: #fff;
  431. padding: 0 20rpx;
  432. .tj-btn {
  433. width: 200rpx;
  434. height: 75rpx;
  435. line-height: 75rpx;
  436. color: #fff;
  437. background-color: #d84840;
  438. border-radius: 10rpx;
  439. text-align: center;
  440. font-size: 28rpx;
  441. font-weight: 500;
  442. }
  443. }
  444. .rmb {
  445. &::before {
  446. content: '¥';
  447. color: #CE372E;
  448. font-size: 30rpx;
  449. }
  450. }
  451. // 门店
  452. .sc-md {
  453. margin: 20rpx auto;
  454. width: 712rpx;
  455. height: 210rpx;
  456. background: #FFFFFF;
  457. border-radius: 10rpx;
  458. .sc-tip {
  459. padding-left: 20rpx;
  460. line-height: 70rpx;
  461. width: 712rpx;
  462. height: 70rpx;
  463. background: #e9e8ef;
  464. border-radius: 10rpx 10rpx 0px 0px;
  465. font-size: 26rpx;
  466. font-weight: 500;
  467. color: #262261;
  468. }
  469. }
  470. .store-info {
  471. display: flex;
  472. justify-content: flex-start;
  473. align-items: center;
  474. height: 140rpx;
  475. padding: 0 30rpx 0 20rpx;
  476. .store-logo {
  477. width: 61rpx;
  478. height: 61rpx;
  479. background-color: #eee;
  480. border-radius: 50%;
  481. }
  482. .info {
  483. flex-grow: 1;
  484. display: flex;
  485. flex-direction: column;
  486. justify-content: center;
  487. padding: 0 40rpx 0 20rpx;
  488. .store-name {
  489. font-size: 25rpx;
  490. font-weight: 500;
  491. color: #333333;
  492. }
  493. .store-address {
  494. margin-top: 15rpx;
  495. font-size: 22rpx;
  496. font-weight: 500;
  497. color: #999999;
  498. }
  499. }
  500. }
  501. .store-list {
  502. min-height: 280rpx;
  503. max-height: 450rpx;
  504. width: 750upx;
  505. padding-top: 1rpx;
  506. background-color: #fff;
  507. .store-info {
  508. width: 712rpx;
  509. margin: 20rpx auto;
  510. border: 1px solid #aaa;
  511. border-radius: 20rpx;
  512. }
  513. .choose-stroe {
  514. border: 1px solid #262261;
  515. }
  516. }
  517. </style>