order.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. <template>
  2. <app-layout>
  3. <view v-if="!toSearch" style="z-index: 50">
  4. <view class='status' v-if="is_mall">
  5. <view class='status-list main-between'>
  6. <view @click='tab(1)' :class="[`${status==1?'active':''}`,`left-status`]">订单</view>
  7. <view @click='tab(2)' :class="[`${status==2?'active':''}`,``]">卡券</view>
  8. <view @click='tab(3)' :class="[`${status==3?'active':''}`,`right-status`]">碎屏险</view>
  9. </view>
  10. </view>
  11. <view :class="[`search`, `${is_mall?'':'no-mall'}`]">
  12. <view @click='beSearch' class="main-center search-content cross-center">
  13. <image src="/static/image/icon/icon-search.png"></image>
  14. <text>搜索</text>
  15. </view>
  16. </view>
  17. <app-tab-nav :setTop="setTop" :placeHeight="placeHeight" setHeight="96" :tabList="tabList" padding="0"
  18. :activeItem="activeTab" @click="tabStatus"></app-tab-nav>
  19. <view v-if="_num == 2" @click="scan" class='scan'>
  20. <image src='./../image/scan.png'></image>
  21. </view>
  22. </view>
  23. <view v-if="toSearch" class="search-item main-between cross-center">
  24. <view class="search-input">
  25. <image src='/static/image/icon/icon-search.png'></image>
  26. <input v-if="status == 1 && toSearch" focus @confirm='search' confirm-type='search' v-model='keyword'
  27. placeholder-style='color:#999999;font-size:13px;' placeholder='输入订单号/商品名称/店铺名称搜索'/>
  28. <input v-if="status == 2 && toSearch" focus @confirm='search' confirm-type='search' v-model='keyword'
  29. placeholder-style='color:#999999;font-size:13px;' placeholder='输入卡券名称/用户昵称搜索'/>
  30. </view>
  31. <view @click="cancelSeacrch">取消</view>
  32. </view>
  33. <view v-if="!searchResult && toSearch" :class="[`search-history`,`${list.length == 0 ? '' : 'go-out'}`]">
  34. <view v-if="candidate.length != 0" class='main-between search-title'>
  35. <view>历史搜索</view>
  36. <view @click="clear">
  37. <image class="history-img" src="/static/image/icon/delete.png"></image>
  38. </view>
  39. </view>
  40. <view class='flex-wrap history-list'>
  41. <view @click="keywordSearch(item)" class="keyword-item box-grow-0" v-for="item in candidate"
  42. :key="item">
  43. <text class="t-omit">{{item}}</text>
  44. </view>
  45. </view>
  46. </view>
  47. <view v-if="toSearch" class="search-place"></view>
  48. <template v-if="status == 1">
  49. <view v-for="item in list" :key="item.id" class="item">
  50. <view class='main-between item-top'>
  51. <view class='shop t-omit'>
  52. <image src='./../image/shop.png'></image>
  53. <text>{{item.store.name}}</text>
  54. </view>
  55. <view class="item-status" v-if="item.clerk_id > 0">已核销</view>
  56. <view class="item-status" v-else-if="item.cancel_status == 1">已退款</view>
  57. <view class="item-status" v-else>未核销</view>
  58. </view>
  59. <view @click="toDetail(item.id)">
  60. <view class="goods" :style="{'margin-top':`${index == 0 ?'0':'12'}px`}" v-for="goods in item.detail"
  61. :key="goods.id">
  62. <image :src='goods.goods.goodsWarehouse.cover_pic'></image>
  63. <view class='goods-info'>
  64. <view class='goods-name t-omit-two'>{{goods.goods.goodsWarehouse.name}}</view>
  65. <view class="goods-attr">
  66. <text v-for="attr in goods.attr_list" :key="attr.id">
  67. {{attr.attr_group_name}}:{{attr.attr_name}}
  68. </text>
  69. </view>
  70. <view>x{{goods.num}}</view>
  71. </view>
  72. <view class='goods-price'>¥ {{goods.total_price}}</view>
  73. </view>
  74. </view>
  75. <view class='total'>合计
  76. <text>¥{{item.total_pay_price}}</text>
  77. (含运费¥{{item.express_price}})
  78. </view>
  79. <view class='dir-right-nowrap' v-if="item.clerk_id == 0 && item.cancel_status != 1">
  80. <view class="refund-text" v-if="item.refund">{{item.refund}}</view>
  81. <view v-else class="clerk-btn dir-right-nowrap" >
  82. <button @click="toClerk(item.id)">核销</button>
  83. <button v-if="item.sign=='booking'&&item.tellnum==0" @click="toTell(item.id)" style="width: 180upx;">
  84. {{"完成维修"}}
  85. </button>
  86. <button v-if="item.sign=='booking'&&item.tellnum>0" @click="toTell(item.id)" style="width: 224upx;">
  87. {{'已发送短信'+item.tellnum+'次'}}
  88. </button>
  89. </view>
  90. </view>
  91. <view class='dir-right-nowrap' v-else-if="item.sign=='booking'">
  92. <view class="clerk-btn dir-right-nowrap" >
  93. <button v-if="item.tellnum==0" @click="toTell(item.id)" style="width: 180upx;">
  94. {{"完成维修"}}
  95. </button>
  96. <button v-else-if="item.tellnum>0" @click="toTell(item.id)" style="width: 224upx;">
  97. {{'已发送短信'+item.tellnum+'次'}}
  98. </button>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <template v-if="status == 2||status==3">
  104. <view v-for="item in list" :key="item.id" class="item card-item">
  105. <image class='card-img' :src='item.pic_url'></image>
  106. <view @click="toCardDetail(item.id)">
  107. <view class='t-omit-two card-name'>{{item.name}}</view>
  108. <view class="surplus-number" v-if="status == 2" >剩余{{item.number - item.use_number}}次</view>
  109. <view class='dir-left-nowrap platform cross-center'>
  110. <image class='platform-img' v-if="item.platform == 'wxapp'" src='./../image/wx.png'></image>
  111. <image class='platform-img' v-if="item.platform == 'aliapp'" src='./../image/ali.png'></image>
  112. <view>{{item.nickname}}</view>
  113. </view>
  114. </view>
  115. <view class='cross-center card-clerk'>
  116. <view v-if="item.is_use == 0 && item.receive_id == 0" class="clerk-btn dir-right-nowrap" @click="toClerkCard(item.id)">
  117. <button>核销</button>
  118. </view>
  119. <view v-else-if="item.is_use == 0 && item.receive_id > 0" class="clerk-btn-1">
  120. 已转赠
  121. </view>
  122. <image v-else class='clerked-img' src='./../image/clerked.png'></image>
  123. </view>
  124. </view>
  125. </template>
  126. <view class='no-tip' v-if="list.length == 0 && status == 1">
  127. <image :src='clerkImg.order'></image>
  128. <view>没有任何订单哦~</view>
  129. </view>
  130. <view class='no-tip' v-if="list.length == 0 && status == 2">
  131. <image :src='clerkImg.card'></image>
  132. <view>没有任何卡券哦~</view>
  133. </view>
  134. </app-layout>
  135. </template>
  136. <script>
  137. import appTabNav from "@/components/basic-component/app-tab-nav/app-tab-nav.vue";
  138. import {mapState} from "vuex";
  139. export default {
  140. name: "about",
  141. components: {
  142. "app-tab-nav": appTabNav,
  143. },
  144. data() {
  145. return {
  146. activeTab: 3,
  147. order_list: [
  148. {id: 2, name: '未核销'},
  149. {id: 1, name: '已核销'},
  150. {id: 5, name: '已退款'},
  151. {id: 3, name: '我的'},
  152. ],
  153. card_list: [
  154. {id: 2, name: '未核销'},
  155. {id: 1, name: '已核销'},
  156. {id: 3, name: '我的'},
  157. ],
  158. tabList: [],
  159. candidate: [],
  160. status: 1,
  161. placeHeight: 312,
  162. setTop: 190,
  163. more_list: false,
  164. is_mall: false,
  165. toSearch: false,
  166. searchResult: false,
  167. first: false,
  168. keyword: '',
  169. list: [],
  170. send:false
  171. };
  172. },
  173. computed: {
  174. ...mapState({
  175. clerkImg: state => state.mallConfig.__wxapp_img.clerk,
  176. mall: state => state.mallConfig.mall
  177. }),
  178. },
  179. onLoad(options) {
  180. this.status = options.status||3
  181. if (options.type > 0) {
  182. this.activeTab = options.type
  183. }
  184. this.$showLoading({
  185. type: 'global',
  186. text: '加载中...'
  187. });
  188. this.$request({
  189. url: this.$api.clerk.info
  190. }).then(response => {
  191. if (response.code == 0) {
  192. this.is_mall = response.data.is_mall;
  193. if (!response.data.is_mall) {
  194. this.placeHeight = 210;
  195. this.setTop = 88;
  196. }
  197. this.list = [];
  198. if (this.status == 1) {
  199. this.tabList = this.order_list;
  200. this.getList();
  201. uni.setNavigationBarTitle({
  202. title: "订单",
  203. })
  204. } else if (this.status == 2) {
  205. this.tabList = this.card_list;
  206. this.getCard();
  207. uni.setNavigationBarTitle({
  208. title: "卡券",
  209. })
  210. }else if(this.status == 3){
  211. this.tabList = this.card_list;
  212. this.getSp();
  213. uni.setNavigationBarTitle({
  214. title: "碎屏险",
  215. })
  216. }
  217. } else {
  218. uni.redirectTo({
  219. url: '/pages/user-center/user-center'
  220. })
  221. }
  222. })
  223. },
  224. onReachBottom: function () {
  225. if (this.more_list) {
  226. this.getMore();
  227. }
  228. },
  229. onShow(options) {
  230. let that = this;
  231. if (that.first) {
  232. that.$request({
  233. url: that.$api.clerk.info
  234. }).then(response => {
  235. if (response.code == 0) {
  236. that.is_mall = response.data.is_mall;
  237. if (!response.data.is_mall) {
  238. this.placeHeight = 112
  239. }
  240. if (that.status == 1) {
  241. that.getList();
  242. uni.setNavigationBarTitle({
  243. title: "订单",
  244. })
  245. } else if (Sp) {
  246. that.getCard();
  247. uni.setNavigationBarTitle({
  248. title: "卡券",
  249. })
  250. }else if (that.status == 3) {
  251. that.getSp();
  252. uni.setNavigationBarTitle({
  253. title: "碎屏险",
  254. })
  255. }
  256. } else {
  257. uni.redirectTo({
  258. url: '/pages/user-center/user-center'
  259. })
  260. }
  261. })
  262. }
  263. if (!that.first) {
  264. if (that.status == 1) {
  265. that.getList();
  266. } else if (that.status == 2) {
  267. that.getCard();
  268. }else if (that.status == 3) {
  269. that.getSp();
  270. }
  271. }
  272. },
  273. methods: {
  274. getMore() {
  275. let that = this;
  276. let url;
  277. let para;
  278. if (that.load) {
  279. return false
  280. }
  281. that.load = true;
  282. if (that.status == 1) {
  283. if (that.activeTab == 3) {
  284. url = that.$api.clerk.my;
  285. para = {
  286. page: that.page,
  287. }
  288. } else if (that.activeTab == 5) {
  289. url = that.$api.clerk.order;
  290. para = {
  291. status: that.activeTab,
  292. keyword_1: 8,
  293. keyword: that.keyword
  294. }
  295. } else {
  296. url = that.$api.clerk.order;
  297. para = {
  298. page: that.page,
  299. is_clerk: that.activeTab,
  300. }
  301. }
  302. } else {
  303. if (that.activeTab == 3) {
  304. url = that.$api.clerk.my_card;
  305. para = {
  306. page: that.page,
  307. }
  308. } else {
  309. url = that.$api.clerk.card;
  310. para = {
  311. page: that.page,
  312. is_clerk: that.activeTab,
  313. }
  314. }
  315. }
  316. that.$request({
  317. url: url,
  318. data: para,
  319. }).then(response => {
  320. that.$hideLoading();
  321. that.load = false;
  322. if (response.code == 0) {
  323. that.list = that.list.concat(response.data.list);
  324. that.page++;
  325. that.more_list = false;
  326. if (response.data.list.length == response.data.pagination.pageSize) {
  327. that.more_list = true;
  328. }
  329. that.list.forEach(function (row) {
  330. row.refund = null;
  331. if (row.cancel_status == 2) {
  332. row.refund = '申请取消中'
  333. } else if (row.is_pay == 0) {
  334. row.refund = '订单未支付'
  335. }
  336. })
  337. } else {
  338. uni.showToast({
  339. title: response.msg,
  340. icon: 'none',
  341. duration: 1000
  342. });
  343. }
  344. }).catch(response => {
  345. that.load = false;
  346. that.$hideLoading();
  347. });
  348. },
  349. toClerk(id) {
  350. uni.navigateTo({
  351. url: '/pages/order/clerk/clerk?id=' + id
  352. });
  353. },
  354. toClerkCard(id) {
  355. if(this.status==3){
  356. uni.navigateTo({
  357. url: '/pages/sp/clerk/clerk?cardId=' + id
  358. });
  359. return;
  360. }
  361. uni.navigateTo({
  362. url: '/pages/card/clerk/clerk?cardId=' + id
  363. });
  364. },
  365. toDetail(id) {
  366. if(this.status==3){
  367. uni.navigateTo({
  368. url: '/pages/sp/clerk/clerk?cardId=' + id
  369. });
  370. return;
  371. }
  372. uni.navigateTo({
  373. url: '/plugins/clerk/detail/detail?id=' + id
  374. });
  375. },
  376. toCardDetail(id) {
  377. if(this.status==3){
  378. uni.navigateTo({
  379. url: '/plugins/clerk/spdetail/spdetail?card_id=' + id
  380. });
  381. return;
  382. }
  383. uni.navigateTo({
  384. url: '/plugins/clerk/detail/detail?card_id=' + id
  385. });
  386. },
  387. keywordSearch(e) {
  388. this.keyword = e;
  389. this.searchResult = true;
  390. if (this.status == 1) {
  391. this.getList();
  392. } else {
  393. this.getCard();
  394. }
  395. },
  396. beSearch() {
  397. this.candidate = uni.getStorageSync('clerk_keyword');
  398. if (this.status == 2) {
  399. this.candidate = uni.getStorageSync('clerk_card_keyword');
  400. }else if(this.status==3){
  401. this.candidate = uni.getStorageSync('clerk_sp_keyword');
  402. }
  403. this.toSearch = !this.toSearch;
  404. this.list = [];
  405. this.searchResult = false;
  406. uni.setNavigationBarTitle({
  407. title: "搜索",
  408. })
  409. },
  410. cancelSeacrch() {
  411. this.toSearch = !this.toSearch;
  412. this.keyword = '';
  413. if (this.status == 1) {
  414. this.getList();
  415. uni.setNavigationBarTitle({
  416. title: "订单",
  417. })
  418. } else if(this.status == 2){
  419. this.getCard();
  420. uni.setNavigationBarTitle({
  421. title: "卡券",
  422. })
  423. }else {
  424. this.getSp();
  425. uni.setNavigationBarTitle({
  426. title: "碎屏险",
  427. })
  428. }
  429. },
  430. search() {
  431. var value = uni.getStorageSync('clerk_keyword');
  432. if (this.status == 2) {
  433. this.candidate = uni.getStorageSync('clerk_card_keyword');
  434. }else if(this.status==3){
  435. this.candidate = uni.getStorageSync('clerk_sp_keyword');
  436. }
  437. if (this.keyword.length == 0 || this.keyword.trim().length == 0) {
  438. this.keyword = ''
  439. return
  440. } else if (value.length > 0) {
  441. value.unshift(this.keyword)
  442. } else {
  443. value = [this.keyword]
  444. }
  445. value.forEach(function (row, index) {
  446. if (value[0] == value[index] && index > 0) {
  447. value.splice(index, 1)
  448. }
  449. })
  450. if (this.status == 1) {
  451. uni.setStorage({
  452. key: "clerk_keyword",
  453. data: value
  454. })
  455. this.getList();
  456. } else if(this.status == 2){
  457. uni.setStorage({
  458. key: "clerk_card_keyword",
  459. data: value
  460. })
  461. this.getCard();
  462. }else{
  463. uni.setStorage({
  464. key: "clerk_sp_keyword",
  465. data: value
  466. })
  467. this.getCard();
  468. }
  469. },
  470. // 清除搜索记录
  471. clear() {
  472. let that = this;
  473. if(this.status==1){
  474. uni.removeStorage({
  475. key: 'clerk_keyword',
  476. success(res) {
  477. that.candidate = [];
  478. uni.showToast({
  479. title: '清理成功',
  480. duration: 1000,
  481. type: 'success',
  482. mask: false
  483. });
  484. }
  485. });
  486. }
  487. else if(this.status==2){
  488. uni.removeStorage({
  489. key: 'clerk_card_keyword',
  490. success(res) {
  491. that.candidate = [];
  492. uni.showToast({
  493. title: '清理成功',
  494. duration: 1000,
  495. type: 'success',
  496. mask: false
  497. });
  498. }
  499. });
  500. }else {
  501. uni.removeStorage({
  502. key: 'clerk_sp_keyword',
  503. success(res) {
  504. that.candidate = [];
  505. uni.showToast({
  506. title: '清理成功',
  507. duration: 1000,
  508. type: 'success',
  509. mask: false
  510. });
  511. }
  512. });
  513. }
  514. },
  515. tabStatus(e) {
  516. let that = this;
  517. if (that.load) {
  518. return false
  519. }
  520. uni.showLoading({
  521. title: '加载中...'
  522. });
  523. that.list = [];
  524. that.page = 2;
  525. that.activeTab = e.currentTarget.dataset.id;
  526. if (this.status == 1) {
  527. this.getList();
  528. } else if(this.status==2){
  529. this.getCard();
  530. }else if(this.status==3){
  531. this.getSp();
  532. }
  533. },
  534. tab(e) {
  535. let that = this;
  536. if (that.load) {
  537. return false
  538. }
  539. uni.showLoading({
  540. title: '加载中...'
  541. });
  542. that.list = [];
  543. that.page = 2;
  544. that.activeTab = 2;
  545. that.status = e;
  546. if (e == 1) {
  547. this.tabList = this.order_list;
  548. this.getList();
  549. } else if(e==2){
  550. this.tabList = this.card_list;
  551. this.getCard();
  552. }else {
  553. this.tabList = this.card_list;
  554. this.getSp();
  555. }
  556. },
  557. toTell(id){
  558. let that=this;
  559. if(that.send)
  560. return;
  561. that.send=true;
  562. setTimeout(()=>{
  563. that.send=false;
  564. },2000);
  565. that.$request({
  566. url: that.$api.order.order_tell,
  567. data:{
  568. id:id
  569. },
  570. }).then(response => {
  571. uni.hideLoading();
  572. that.$hideLoading();
  573. that.load = false;
  574. if (response.code == 0) {
  575. that.getList()
  576. } else {
  577. uni.showToast({
  578. title: response.msg,
  579. icon: 'none',
  580. duration: 1000
  581. });
  582. }
  583. }).catch(response => {
  584. that.load = false;
  585. uni.hideLoading();
  586. that.$hideLoading();
  587. });
  588. },
  589. getList() {
  590. let that = this;
  591. let url;
  592. let para;
  593. if (that.load) {
  594. return false
  595. }
  596. that.load = true;
  597. if (this.activeTab == 3) {
  598. url = that.$api.clerk.my;
  599. para = {
  600. keyword_1: 8,
  601. keyword: this.keyword
  602. }
  603. } else if (this.activeTab == 5) {
  604. url = that.$api.clerk.order;
  605. para = {
  606. status: this.activeTab,
  607. keyword_1: 8,
  608. keyword: this.keyword
  609. }
  610. } else {
  611. url = that.$api.clerk.order;
  612. para = {
  613. is_clerk: this.activeTab,
  614. keyword_1: 8,
  615. keyword: this.keyword
  616. }
  617. }
  618. that.$request({
  619. url: url,
  620. data: para,
  621. }).then(response => {
  622. uni.hideLoading();
  623. that.$hideLoading();
  624. that.load = false;
  625. if (response.code == 0) {
  626. that.first = true;
  627. that.list = response.data.list;
  628. that.page = 2;
  629. that.searchResult = true;
  630. that.more_list = false;
  631. if (response.data.list.length == response.data.pagination.pageSize) {
  632. that.more_list = true;
  633. }
  634. that.list.forEach(function (row) {
  635. row.refund = null;
  636. if (row.cancel_status == 2) {
  637. row.refund = '申请退款中'
  638. } else if (row.is_pay == 0) {
  639. row.refund = '订单未支付'
  640. }
  641. })
  642. } else {
  643. uni.showToast({
  644. title: response.msg,
  645. icon: 'none',
  646. duration: 1000
  647. });
  648. }
  649. }).catch(response => {
  650. that.load = false;
  651. uni.hideLoading();
  652. that.$hideLoading();
  653. });
  654. },
  655. getCard() {
  656. let that = this;
  657. let url;
  658. let para;
  659. if (that.load) {
  660. return false
  661. }
  662. that.load = true;
  663. if (this.activeTab == 3) {
  664. url = that.$api.clerk.my_card;
  665. para = {
  666. keyword: this.keyword
  667. }
  668. } else {
  669. url = that.$api.clerk.card;
  670. para = {
  671. is_clerk: this.activeTab,
  672. keyword: this.keyword
  673. }
  674. }
  675. that.$request({
  676. url: url,
  677. data: para,
  678. }).then(response => {
  679. that.load = false;
  680. uni.hideLoading();
  681. that.$hideLoading();
  682. if (response.code == 0) {
  683. that.list = response.data.list;
  684. that.page = 2;
  685. that.searchResult = true;
  686. that.more_list = false;
  687. if (response.data.list.length == response.data.pagination.pageSize) {
  688. that.more_list = true;
  689. }
  690. } else {
  691. uni.showToast({
  692. title: response.msg,
  693. icon: 'none',
  694. duration: 1000
  695. });
  696. }
  697. }).catch(response => {
  698. that.load = false;
  699. uni.hideLoading();
  700. that.$hideLoading();
  701. });
  702. },
  703. getSp() {
  704. let that = this;
  705. let url;
  706. let para;
  707. if (that.load) {
  708. return false
  709. }
  710. that.load = true;
  711. if (this.activeTab == 3) {
  712. url = that.$api.clerk.my_sp;
  713. para = {
  714. keyword: this.keyword
  715. }
  716. } else {
  717. url = that.$api.clerk.sp;
  718. para = {
  719. is_clerk: this.activeTab,
  720. keyword: this.keyword
  721. }
  722. }
  723. that.$request({
  724. url: url,
  725. data: para,
  726. }).then(response => {
  727. that.load = false;
  728. uni.hideLoading();
  729. that.$hideLoading();
  730. if (response.code == 0) {
  731. that.list = response.data.list;
  732. that.page = 2;
  733. that.searchResult = true;
  734. that.more_list = false;
  735. if (response.data.list.length == response.data.pagination.pageSize) {
  736. that.more_list = true;
  737. }
  738. } else {
  739. uni.showToast({
  740. title: response.msg,
  741. icon: 'none',
  742. duration: 1000
  743. });
  744. }
  745. }).catch(response => {
  746. that.load = false;
  747. uni.hideLoading();
  748. that.$hideLoading();
  749. });
  750. },
  751. }
  752. }
  753. </script>
  754. <style scoped lang="scss">
  755. .search {
  756. height: #{88rpx};
  757. padding: #{16rpx} #{26rpx};
  758. background-color: #efeff4;
  759. position: fixed;
  760. top: #{104rpx};
  761. left: 0;
  762. right: 0;
  763. z-index: 10;
  764. }
  765. .search-place {
  766. height: #{120rpx};
  767. width: 100%;
  768. }
  769. .search.no-mall {
  770. top: 0;
  771. }
  772. .search-content {
  773. background-color: #fff;
  774. height: #{56rpx};
  775. border-radius: #{28rpx};
  776. }
  777. .search-content image {
  778. height: #{24rpx};
  779. width: #{24rpx};
  780. }
  781. .search-content text {
  782. color: #b2b2b2;
  783. font-size: #{24rpx};
  784. margin: 0 #{5rpx};
  785. }
  786. .tab-list {
  787. height: #{96rpx};
  788. position: fixed;
  789. top: #{192rpx};
  790. left: 0;
  791. right: 0;
  792. z-index: 10;
  793. width: 100%;
  794. background-color: #fff;
  795. border-bottom: #{1rpx} solid #e2e2e2;
  796. }
  797. .tab-list.no-mall {
  798. top: #{88rpx};
  799. }
  800. .tab-item {
  801. text-align: center;
  802. font-size: #{28rpx};
  803. color: #666;
  804. }
  805. .tab-item text {
  806. height: #{92rpx};
  807. line-height: #{92rpx};
  808. display: inline-block;
  809. }
  810. .tab-item text.active {
  811. border-bottom: #{4rpx} solid #ff4544;
  812. color: #ff4544;
  813. }
  814. .status {
  815. width: 100%;
  816. height: #{104rpx};
  817. background-color: #fff;
  818. position: fixed;
  819. top: 0;
  820. left: 0;
  821. right: 0;
  822. z-index: 10;
  823. }
  824. .status-list {
  825. width: #{368rpx};
  826. height: #{56rpx};
  827. margin: #{24rpx} auto;
  828. border-radius: #{28rpx};
  829. line-height: #{54rpx};
  830. font-size: #{24rpx};
  831. color: #666666;
  832. background-color: #fff;
  833. }
  834. .status-list view {
  835. width: 50%;
  836. text-align: center;
  837. border: #{2rpx} solid #ff4544;
  838. }
  839. .status-list .active {
  840. background-color: #ff4544;
  841. height: #{56rpx};
  842. color: #ffffff;
  843. }
  844. .item {
  845. width: #{702rpx};
  846. margin: 0 #{24rpx} #{24rpx};
  847. background-color: #fff;
  848. border-radius: #{16rpx};
  849. padding: #{24rpx};
  850. position: relative;
  851. }
  852. .item.card-item {
  853. padding: #{40rpx} #{160rpx} #{40rpx} #{132rpx};
  854. }
  855. .shop {
  856. font-size: #{24rpx};
  857. color: #353535;
  858. max-width: #{500rpx};
  859. }
  860. .shop image {
  861. height: #{24rpx};
  862. width: #{24rpx};
  863. margin-right: #{12rpx};
  864. }
  865. .goods {
  866. height: #{160rpx};
  867. position: relative;
  868. }
  869. .goods image {
  870. height: #{160rpx};
  871. width: #{160rpx};
  872. border-radius: #{10rpx};
  873. float: left;
  874. margin-right: #{20rpx};
  875. }
  876. .goods-info {
  877. font-size: #{24rpx};
  878. color: #999999;
  879. }
  880. .goods-name {
  881. color: #353535;
  882. height: #{72rpx};
  883. }
  884. .goods-price {
  885. color: #353535;
  886. font-size: #{24rpx};
  887. position: absolute;
  888. bottom: 0;
  889. right: 0;
  890. }
  891. .total {
  892. font-size: #{24rpx};
  893. margin-top: #{28rpx};
  894. color: #999999;
  895. text-align: right;
  896. }
  897. .total text {
  898. color: #353535;
  899. font-size: #{28rpx};
  900. }
  901. .clerk-btn button {
  902. width: #{138rpx};
  903. text-align: center;
  904. height: #{48rpx} !important;
  905. border-radius: #{24rpx};
  906. border: #{1rpx} solid #ff4544;
  907. line-height: #{46rpx};
  908. margin-top: #{28rpx};
  909. font-size: #{24rpx};
  910. color: #ff4544;
  911. background-color: #fff;
  912. }
  913. .card-clerk .clerk-btn button {
  914. margin-top: 0;
  915. }
  916. .clerk-btn button::after {
  917. border: 0;
  918. }
  919. .clerk-btn-1 {
  920. width: #{138rpx};
  921. padding: #{8rpx 0};
  922. text-align: center;
  923. color: #ff4544;
  924. background-color: #ffecec;
  925. font-size: $uni-font-size-weak-one;
  926. }
  927. .search-item {
  928. height: #{96rpx};
  929. background-color: #efeff4;
  930. padding: 0 #{24rpx};
  931. font-size: #{28rpx};
  932. color: #00c203;
  933. width: 100%;
  934. position: fixed;
  935. top: 0;
  936. left: 0;
  937. z-index: 22;
  938. }
  939. .search-input {
  940. height: #{64rpx};
  941. position: relative;
  942. width: #{620rpx};
  943. }
  944. .search-input image {
  945. height: #{22rpx};
  946. width: #{22rpx};
  947. position: absolute;
  948. top: #{21rpx};
  949. left: #{28rpx};
  950. z-index: 10;
  951. }
  952. .search-input input {
  953. padding-left: #{62rpx};
  954. background-color: #fff;
  955. border-radius: #{32rpx};
  956. height: #{64rpx};
  957. font-size: #{26rpx};
  958. color: #353535;
  959. }
  960. .search-history {
  961. position: fixed;
  962. top: 0;
  963. left: 0;
  964. right: 0;
  965. height: 100%;
  966. background-color: #fff;
  967. padding: #{120rpx} #{4rpx} #{24rpx};
  968. font-size: #{28rpx};
  969. color: #666;
  970. z-index: 20;
  971. }
  972. .search-title {
  973. padding: 0 #{20rpx};
  974. margin-bottom: #{24rpx};
  975. }
  976. .keyword-item {
  977. height: #{64rpx};
  978. line-height: #{64rpx};
  979. padding: 0 #{20rpx};
  980. background-color: #f7f7f7;
  981. color: #333;
  982. border-radius: #{32rpx};
  983. font-size: #{28rpx};
  984. margin-left: #{20rpx};
  985. margin-bottom: #{20rpx};
  986. max-width: 90%;
  987. }
  988. .scan {
  989. position: fixed;
  990. bottom: #{80rpx};
  991. right: 0;
  992. z-index: 30;
  993. height: #{116rpx};
  994. width: #{112rpx};
  995. }
  996. .scan button {
  997. height: #{116rpx} !important;
  998. width: #{112rpx};
  999. border-top-left-radius: #{58rpx};
  1000. border-bottom-left-radius: #{58rpx};
  1001. border: #{1rpx} solid #cdcdcd;
  1002. border-right: 0;
  1003. background-color: rgba(255, 255, 255, 0.8);
  1004. box-shadow: 0 0 #{10rpx} rgb(239, 239, 239);
  1005. text-align: center;
  1006. }
  1007. .scan button image {
  1008. height: #{64rpx};
  1009. width: #{64rpx};
  1010. margin-top: #{26rpx};
  1011. }
  1012. .item .card-img {
  1013. position: absolute;
  1014. top: #{40rpx};
  1015. left: #{24rpx};
  1016. width: #{88rpx};
  1017. height: #{88rpx};
  1018. border-radius: 50%;
  1019. }
  1020. .platform {
  1021. font-size: #{24rpx};
  1022. color: #999999;
  1023. height: #{24rpx};
  1024. margin-top: #{20rpx};
  1025. }
  1026. .platform-img {
  1027. height: #{24rpx};
  1028. width: #{24rpx};
  1029. margin-right: #{12rpx};
  1030. }
  1031. .card-name {
  1032. width: #{370rpx};
  1033. font-size: #{28rpx};
  1034. color: #353535;
  1035. }
  1036. .card-clerk {
  1037. position: absolute;
  1038. right: #{24rpx};
  1039. top: 0;
  1040. height: #{168rpx};
  1041. }
  1042. .card-clerk .clerked-img {
  1043. width: #{120rpx};
  1044. height: #{120rpx};
  1045. }
  1046. .no-tip {
  1047. position: fixed;
  1048. top: #{400rpx};
  1049. left: 0;
  1050. right: 0;
  1051. margin: 0 auto;
  1052. color: #666666;
  1053. font-size: #{24rpx};
  1054. width: #{240rpx};
  1055. text-align: center;
  1056. }
  1057. .no-tip image {
  1058. height: #{240rpx};
  1059. width: #{240rpx};
  1060. margin-bottom: #{20rpx};
  1061. }
  1062. .left-status {
  1063. border-top-left-radius: #{28rpx};
  1064. border-bottom-left-radius: #{28rpx};
  1065. }
  1066. .right-status {
  1067. border-top-right-radius: #{28rpx};
  1068. border-bottom-right-radius: #{28rpx};
  1069. }
  1070. .history-img {
  1071. height: #{34rpx};
  1072. width: #{28rpx};
  1073. }
  1074. .history-list {
  1075. max-height: #{420rpx};
  1076. overflow: hidden;
  1077. }
  1078. .item-top {
  1079. margin-bottom: #{28rpx};
  1080. }
  1081. .item-top .item-status {
  1082. font-size: #{24rpx};
  1083. color: #ff4544;
  1084. }
  1085. .goods-attr {
  1086. margin-bottom: #{16rpx};
  1087. }
  1088. .goods-attr text {
  1089. margin-right: #{18rpx};
  1090. }
  1091. .refund-text {
  1092. font-size: #{24rpx};
  1093. color: #ff4544;
  1094. margin-top: #{24rpx};
  1095. text-align: right;
  1096. }
  1097. .surplus-number {
  1098. font-size: 24#{rpx};
  1099. color: #999999;
  1100. margin: 12#{rpx} 0;
  1101. }
  1102. </style>