index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <tabs :tabs="tabs" @tabsChange="tabsChange">
  6. <view class="tabsList">
  7. <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
  8. <view class="list-scroll-view">
  9. <view class="one_1">
  10. <button size="mini" @tap="toDislog">查询条件</button>
  11. </view>
  12. <view class="one_2">
  13. <view class="list" v-for="(item, index) in list" :key="index">
  14. <view class="list_1" v-if="tabs.active=='0'">
  15. <view class="list_1_1">
  16. <view class="shopname">
  17. <text class="iconfont icon-shangdian"></text>
  18. <text>{{item.shop.name}}</text>
  19. </view>
  20. <view class="status">
  21. {{item.zhStatus||'暂无'}}
  22. </view>
  23. </view>
  24. <view class="list_1_2">
  25. <view class="goods">
  26. <view class="goods_1">
  27. <image class="image"
  28. v-if="item.spec.file&&item.spec.file.length>0"
  29. :src="item.spec.file&&item.spec.file.length>0?item.spec.file[0].url:''"
  30. mode=""></image>
  31. <image class="image" v-else
  32. :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''"
  33. mode=""></image>
  34. </view>
  35. <view class="goods_2">
  36. <view class="goodsname textOver">
  37. {{item.goods.name}}
  38. </view>
  39. <view class="specs">
  40. {{item.spec.name}}
  41. </view>
  42. </view>
  43. <view class="goods_3">
  44. <view class="price">
  45. ¥{{item.spec.price||0}}
  46. </view>
  47. <view class="num">
  48. ×{{item.num||0}}
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="other">
  54. <text>共{{item.num||0}}件商品</text>
  55. <text>实付款¥{{item.pay}}</text>
  56. </view>
  57. <view class="btn">
  58. <button type="default" size="mini"
  59. @tap.stop="toView(item,'order')">详细信息</button>
  60. <button v-if="item.status=='0'||item.status=='1'" size="mini"
  61. @tap.stop="toCancel(item)">取消订单</button>
  62. <button v-if="item.status=='0'" size="mini"
  63. @tap.stop="toPay(item)">支付</button>
  64. <button v-if="item.status=='2'||item.status=='3'||item.status=='2-'"
  65. size="mini" @tap.stop="toLogi(item,'order')">查看物流</button>
  66. <button v-if="item.status=='2'&&item.is_afterSale!=true" size="mini"
  67. @tap.stop="toConfirm(item,'order')">确认收货</button>
  68. <button
  69. v-if="item.status=='2'||item.status=='2-'&&item.is_afterSale!=true"
  70. size="mini" @tap.stop="toReject(item)">拒收</button>
  71. <button v-if="item.status=='3'" size="mini"
  72. @tap.stop="toAfter(item)">申请售后</button>
  73. <!-- <button v-if="item.status=='3'" type="default" size="mini"
  74. @tap.stop="toAppraise(item)">{{item.rate?'追加评价':'立即评价'}}</button> -->
  75. </view>
  76. </view>
  77. <view class="list_2" v-else-if="tabs.active=='-1'">
  78. <view class="list_2_1">
  79. <view class="shopname">
  80. <text class="iconfont icon-shangdian"></text>
  81. <text>{{item.shop.name}}</text>
  82. </view>
  83. <view class="type">
  84. {{item.zhType||'暂无'}}
  85. </view>
  86. </view>
  87. <view class="list_2_2">
  88. <image class="image" v-if="item.spec.file&&item.spec.file.length>0"
  89. :src="item.spec.file&&item.spec.file.length>0?item.spec.file[0].url:''"
  90. mode=""></image>
  91. <image class="image" v-else
  92. :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''"
  93. mode=""></image>
  94. <view class="other">
  95. <view class="name textOver">
  96. {{item.goods.name||'暂无'}}
  97. </view>
  98. <view class="other_1">
  99. 商品规格:<text>{{item.goodsSpec.name||'暂无'}}</text>
  100. </view>
  101. <view class="other_1" v-if="item.type!='3'">
  102. 退款:<text>¥{{item.money||0}}</text>
  103. </view>
  104. <view class="other_1">
  105. 申请时间:<text>{{item.apply_time||'暂无'}}</text>
  106. </view>
  107. <view class="other_1">
  108. 售后类型:<text>{{item.zhStatus||'暂无'}}</text>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="btn">
  113. <button type="default" size="mini"
  114. @tap.stop="toView(item,'after')">详细信息</button>
  115. <button v-if="item.status=='0'" type="default" size="mini"
  116. @tap.stop="toCancels(item)">取消售后</button>
  117. <button
  118. v-if="item.type!='1'&&item.status=='2'||item.status=='3'&&!item.transport.shop_receive"
  119. type="default" size="mini"
  120. @tap.stop="toMaintain(item)">维护单号</button>
  121. <button
  122. v-if="item.type=='3'&&item.status=='3'||item.status=='-3'&&item.transport.customer_receive==true"
  123. type="default" size="mini"
  124. @tap.stop="toLogi(item,'after')">查看物流</button>
  125. <button
  126. v-if="item.type=='3'&&item.status=='3'&&item.transport.customer_receive==true"
  127. type="default" size="mini"
  128. @tap.stop="toConfirm(item,'after')">确认收货</button>
  129. </view>
  130. </view>
  131. <view class="list_2" v-else>
  132. <view class="list_2_1">
  133. <view class="shopname">
  134. <text class="iconfont icon-shangdian"></text>
  135. <text>{{item.shop.name||'暂无'}}</text>
  136. </view>
  137. <view class="type">
  138. {{item.zhStatus||'暂无'}}
  139. </view>
  140. </view>
  141. <view class="list_2_2">
  142. <image class="image"
  143. :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''"
  144. mode="">
  145. </image>
  146. <view class="other">
  147. <view class="name textOver">
  148. {{item.goods.name||'暂无'}}
  149. </view>
  150. <view class="other_1">
  151. 开始时间:<text>{{item.start_time||'暂无'}}</text>
  152. </view>
  153. <view class="other_1">
  154. 结束时间:<text>{{item.end_time||'暂无'}}</text>
  155. </view>
  156. <view class="other_1">
  157. 人数限制:<text>{{item.person_limit||'暂无'}}人</text>
  158. </view>
  159. </view>
  160. </view>
  161. <view class="btn">
  162. <button type="default" v-if="item.status=='0'" size="mini"
  163. @tap.stop="toShare(item)">分享</button>
  164. <button type="default" v-if="item.status=='0'||item.status=='1'"
  165. size="mini" @tap.stop="toHandle(item)">团处理</button>
  166. <button type="default" size="mini" @tap.stop="toSet(item)">设置状态</button>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. </scroll-view>
  173. </view>
  174. </tabs>
  175. </view>
  176. <view class="dialog" v-if="dialog.show==true">
  177. <view class="dialog_1" v-if="dialog.type=='1'">
  178. <uni-forms ref="form" :modelValue="searchInfo" :rules="rules" label-width="auto">
  179. <uni-forms-item v-if="tabs.active!='-1'" label="商品名称查询" name="goods">
  180. <uni-easyinput type="text" v-model="searchInfo.goods" placeholder="请输入商品名称" />
  181. </uni-forms-item>
  182. <uni-forms-item label="状态" name="status">
  183. <picker v-if="tabs.active=='0'" class="picker" mode="selector" :range="ostatusList"
  184. @change="statusChange" range-key="label">
  185. <view>{{status_name||'请选择状态'}}</view>
  186. </picker>
  187. <picker v-else-if="tabs.active=='-1'" class="picker" mode="selector" :range="astatusList"
  188. @change="statusChange" range-key="label">
  189. <view>{{status_name||'请选择状态'}}</view>
  190. </picker>
  191. <picker v-else-if="tabs.active=='1'" class="picker" mode="selector" :range="gstatusList"
  192. @change="statusChange" range-key="label">
  193. <view>{{status_name||'请选择状态'}}</view>
  194. </picker>
  195. </uni-forms-item>
  196. </uni-forms>
  197. <view class="btn">
  198. <button type="primary" @click="onSubmit" size="mini">确定</button>
  199. <button type="primary" @click="dialogClose" size="mini">取消</button>
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </mobile-frame>
  205. </template>
  206. <script>
  207. import moment from 'moment';
  208. import tabs from '@/components/tabs/index.vue';
  209. export default {
  210. components: {
  211. tabs
  212. },
  213. data() {
  214. return {
  215. // 设备平台信息
  216. system: {},
  217. user: {},
  218. searchInfo: {},
  219. list: [],
  220. total: 0,
  221. skip: 0,
  222. limit: 10,
  223. page: 0,
  224. statusList: [],
  225. tabs: {
  226. active: '0',
  227. menu: [{
  228. title: '团购订单',
  229. active: '0'
  230. },
  231. {
  232. title: '团购售后',
  233. active: '-1'
  234. }
  235. ]
  236. },
  237. // 订单状态
  238. ostatusList: [],
  239. // 售后状态
  240. astatusList: [],
  241. // 团状态
  242. gstatusList: [],
  243. // 售后类型
  244. typeList: [],
  245. // 条件弹出框
  246. dialog: {
  247. show: false,
  248. type: '1'
  249. },
  250. // 状态名称
  251. status_name: '',
  252. };
  253. },
  254. onShow: async function() {
  255. const that = this;
  256. await that.searchOther();
  257. await that.watchLogin();
  258. },
  259. onPullDownRefresh: async function() {
  260. const that = this;
  261. that.clearPage();
  262. await that.search()
  263. uni.stopPullDownRefresh();
  264. },
  265. methods: {
  266. // 监听用户是否登录
  267. watchLogin() {
  268. const that = this;
  269. uni.getStorage({
  270. key: 'token',
  271. success: async function(res) {
  272. let user = that.$jwt(res.data);
  273. that.$set(that, `user`, user);
  274. if (user.is_leader == '0' && that.tabs.menu.length <= 2) {
  275. that.tabs.menu.push({
  276. title: '团长处理',
  277. active: '1'
  278. })
  279. }
  280. // 设备平台信息
  281. let config = that.$config;
  282. that.$set(that, `system`, config.system);
  283. that.search()
  284. },
  285. fail: function(err) {
  286. uni.navigateTo({
  287. url: `/pages/login/index`
  288. })
  289. }
  290. })
  291. },
  292. // 查询列表
  293. async search() {
  294. const that = this;
  295. let user = that.user;
  296. if (user._id) {
  297. let info = {
  298. skip: that.skip,
  299. limit: that.limit,
  300. }
  301. let res;
  302. if (that.tabs.active == '0') {
  303. info.customer = user._id;
  304. res = await that.$api(`/groupOrder/userView`, 'GET', {
  305. ...info,
  306. ...that.searchInfo
  307. }, 'group')
  308. if (res.errcode == '0') {
  309. let list = [...that.list, ...res.data];
  310. for (let val of list) {
  311. let status = that.ostatusList.find(i => i.value == val.status)
  312. if (status) val.zhStatus = status.label;
  313. }
  314. that.$set(that, `list`, list);
  315. that.$set(that, `total`, res.total)
  316. }
  317. } else if (that.tabs.active == '-1') {
  318. info.customer = user._id;
  319. res = await that.$api(`/groupAfterSale/userView`, 'GET', {
  320. ...info,
  321. ...that.searchInfo
  322. }, 'group')
  323. if (res.errcode == '0') {
  324. let list = [...that.list, ...res.data];
  325. for (let val of list) {
  326. let type = that.typeList.find(i => i.value == val.type)
  327. if (type) val.zhType = type.label;
  328. let status = that.astatusList.find(i => i.value == val.status)
  329. if (status) val.zhStatus = status.label;
  330. }
  331. that.$set(that, `list`, list);
  332. that.$set(that, `total`, res.total)
  333. }
  334. } else {
  335. info.leader = user._id;
  336. res = await that.$api(`/group/userView`, 'GET', {
  337. ...info,
  338. ...that.searchInfo
  339. }, 'group')
  340. if (res.errcode == '0') {
  341. let list = [...that.list, ...res.data];
  342. for (let val of list) {
  343. let status = that.gstatusList.find(i => i.value == val.status)
  344. if (status) val.zhStatus = status.label;
  345. }
  346. that.$set(that, `list`, list);
  347. that.$set(that, `total`, res.total)
  348. }
  349. }
  350. }
  351. },
  352. // 查询条件
  353. toDislog() {
  354. const that = this;
  355. that.$set(that, `searchInfo`, {})
  356. that.$set(that, `status_name`, '')
  357. that.$set(that, `dialog`, {
  358. show: true,
  359. type: '1'
  360. })
  361. },
  362. // 状态选择
  363. statusChange(e) {
  364. const that = this;
  365. let data;
  366. if (that.tabs.active == '0') data = that.ostatusList[e.detail.value];
  367. if (that.tabs.active == '-1') data = that.astatusList[e.detail.value];
  368. if (that.tabs.active == '1') data = that.gstatusList[e.detail.value];
  369. if (data) {
  370. that.$set(that.searchInfo, `status`, data.value);
  371. that.$set(that, `status_name`, data.label);
  372. }
  373. },
  374. // 关闭弹框
  375. dialogClose() {
  376. const that = this;
  377. that.clearPage();
  378. that.search();
  379. that.$set(that, `dialog`, {
  380. show: false,
  381. type: '1'
  382. })
  383. },
  384. // 查询
  385. onSubmit() {
  386. const that = this;
  387. that.clearPage();
  388. that.search();
  389. that.$set(that, `dialog`, {
  390. show: false,
  391. type: '1'
  392. })
  393. },
  394. // 订单详细信息
  395. toView(item, type) {
  396. const that = this;
  397. that.clearPage();
  398. if (type == 'order') {
  399. uni.navigateTo({
  400. url: `/pagesMy/dough/info?id=${item._id}`
  401. })
  402. } else {
  403. uni.navigateTo({
  404. url: `/pagesMy/order/afterInfo?id=${item._id}&status=${'1'}`
  405. })
  406. }
  407. },
  408. // 取消订单-未支付||取消订单-已支付
  409. toCancel(e) {
  410. const that = this;
  411. uni.showModal({
  412. title: '提示',
  413. content: '确定取消订单吗?',
  414. success: async function(res) {
  415. if (res.confirm) {
  416. if (e.status == '0') {
  417. const arr = await that.$api(`/orderDeal/cancel`, 'POST', {
  418. order_id: e._id
  419. }, 'group');
  420. if (arr.errcode == '0') {
  421. uni.showToast({
  422. title: '申请取消订单完成',
  423. icon: 'none'
  424. })
  425. that.clearPage();
  426. that.search();
  427. } else {
  428. uni.showToast({
  429. title: arr.errmsg,
  430. icon: 'none'
  431. })
  432. }
  433. } else {
  434. if (e.is_afterSale != true) {
  435. let arr = await that.$api(`/groupAfterSale`, 'POST', {
  436. order: e._id,
  437. type: '4'
  438. }, 'group')
  439. if (arr.errcode == '0') {
  440. uni.showToast({
  441. title: '申请取消订单完成',
  442. icon: 'none'
  443. })
  444. that.clearPage();
  445. that.search();
  446. } else {
  447. uni.showToast({
  448. title: arr.errmsg,
  449. icon: 'none'
  450. })
  451. }
  452. } else {
  453. uni.showToast({
  454. title: `该订单有售后处理中`,
  455. icon: 'none'
  456. })
  457. }
  458. }
  459. }
  460. }
  461. });
  462. },
  463. // 支付
  464. async toPay(e) {
  465. const that = this;
  466. let system = that.system;
  467. if (system.uniPlatform == "mp-weixin") {
  468. uni.showLoading({
  469. title: '加载中'
  470. })
  471. // 支付信息
  472. let p2 = await that.$api('/orderDeal/pay', 'POST', {
  473. order_id: e._id,
  474. }, 'group')
  475. if (p2.errcode == '0' && p2.data.paySign) {
  476. uni.requestPayment({
  477. "provider": "wxpay",
  478. ...p2.data,
  479. success: function(res) {
  480. uni.showToast({
  481. title: '支付成功',
  482. icon: 'none'
  483. })
  484. },
  485. fail: function(err) {
  486. uni.showToast({
  487. title: `支付失败`,
  488. icon: 'none'
  489. })
  490. },
  491. complete: function() {
  492. uni.hideLoading();
  493. that.clearPage();
  494. that.search()
  495. }
  496. })
  497. } else {
  498. uni.showToast({
  499. title: p2.errmsg || '错误信息',
  500. icon: 'none'
  501. })
  502. }
  503. } else if (res.data.uniPlatform == "app") {
  504. // app支付
  505. uni.requestPayment({
  506. provider: 'alipay',
  507. orderInfo: 'orderInfo',
  508. success: function(res) {
  509. console.log('success:' + JSON.stringify(res));
  510. },
  511. fail: function(err) {
  512. console.log('fail:' + JSON.stringify(err));
  513. }
  514. });
  515. } else {
  516. uni.showToast({
  517. title: `平台不支持支付`,
  518. icon: 'none'
  519. })
  520. }
  521. },
  522. // 查看物流
  523. toLogi(e, type) {
  524. const that = this;
  525. that.clearPage();
  526. if (type == 'order') {
  527. uni.navigateTo({
  528. url: `/pagesMy/logistics/index?id=${e._id}&type=${'groupOrder'}`
  529. })
  530. } else {
  531. uni.navigateTo({
  532. url: `/pagesMy/logistics/index?id=${e._id}&type=${'groupAfterSale'}`
  533. })
  534. }
  535. },
  536. // 确认收货
  537. async toConfirm(e, type) {
  538. const that = this;
  539. uni.showModal({
  540. title: '提示',
  541. content: '确定确认收货吗?',
  542. success: async function(res) {
  543. if (res.confirm) {
  544. let arr;
  545. if (type == 'order') {
  546. arr = await that.$api(`/groupOrder/${e._id}`, 'POST', {
  547. status: '3'
  548. }, 'group');
  549. } else {
  550. e.transport.customer_receive = true;
  551. arr = await that.$api(`/groupAfterSale/${e._id}`, 'POST', {
  552. transport: e.transport
  553. }, 'group');
  554. }
  555. if (arr.errcode == '0') {
  556. uni.showToast({
  557. title: '确认收货成功',
  558. icon: 'none'
  559. })
  560. that.clearPage();
  561. that.search();
  562. } else {
  563. uni.showToast({
  564. title: arr.errmsg,
  565. icon: 'none'
  566. })
  567. }
  568. }
  569. }
  570. });
  571. },
  572. // 拒收
  573. async toReject(e) {
  574. const that = this;
  575. uni.showModal({
  576. title: '提示',
  577. content: '确定拒收快递吗?',
  578. success: async function(res) {
  579. if (res.confirm) {
  580. let arr = await that.$api(`/groupAfterSale`, 'POST', {
  581. order: e._id,
  582. type: '5'
  583. }, 'group')
  584. if (arr.errcode == '0') {
  585. uni.showToast({
  586. title: '拒收申请完成',
  587. icon: 'none'
  588. })
  589. that.clearPage();
  590. that.search();
  591. } else {
  592. uni.showToast({
  593. title: arr.errmsg,
  594. icon: 'none'
  595. })
  596. }
  597. }
  598. }
  599. });
  600. },
  601. // 立即评价
  602. toAppraise(e) {
  603. const that = this;
  604. that.clearPage();
  605. uni.navigateTo({
  606. url: `/pagesMy/order/appraise?id=${e._id}`
  607. })
  608. },
  609. // 申请售后
  610. toAfter(e) {
  611. const that = this;
  612. if (e.is_afterSale != true) {
  613. that.clearPage();
  614. uni.navigateTo({
  615. url: `/pagesMy/order/service?id=${e._id}&status=${'-3'}`
  616. })
  617. } else {
  618. uni.showToast({
  619. title: `该订单有售后处理中`,
  620. icon: 'none'
  621. })
  622. }
  623. },
  624. // 维护单号
  625. toMaintain(e) {
  626. uni.navigateTo({
  627. url: `/pagesMy/order/detail?id=${e._id}&status=${'1'}`
  628. })
  629. },
  630. // 取消售后
  631. toCancels(e) {
  632. const that = this;
  633. uni.showModal({
  634. title: '提示',
  635. content: '确定取消售后申请吗?',
  636. success: async function(res) {
  637. if (res.confirm) {
  638. const arr = await that.$api(`/groupAfterSale/${e._id}`, 'DELETE', {}, 'group');
  639. if (arr.errcode == '0') {
  640. uni.showToast({
  641. title: '取消售后成功',
  642. icon: 'none'
  643. })
  644. that.clearPage();
  645. that.search();
  646. } else {
  647. uni.showToast({
  648. title: arr.errmsg,
  649. icon: 'none'
  650. })
  651. }
  652. }
  653. }
  654. });
  655. },
  656. // 团处理
  657. toHandle(e) {
  658. const that = this;
  659. that.clearPage();
  660. uni.navigateTo({
  661. url: `/pagesMy/dough/handle?id=${e._id}`
  662. })
  663. },
  664. // 设置状态
  665. toSet(e){
  666. const that = this;
  667. uni.showModal({
  668. title: '提示',
  669. content: e.status != '2'?'确定将该团改为准备中吗?':'确定解散该团吗?',
  670. success: async function(res) {
  671. if (res.confirm) {
  672. let status='';
  673. if(e.status=='2')status='-1'
  674. else status='2'
  675. let arr = await that.$api(`/group/${e._id}`, 'POST', {
  676. status: status
  677. }, 'group')
  678. if (arr.errcode == '0') {
  679. uni.showToast({
  680. title: '修改状态成功',
  681. icon: 'none'
  682. })
  683. that.clearPage();
  684. that.search();
  685. } else {
  686. uni.showToast({
  687. title: arr.errmsg,
  688. icon: 'none'
  689. })
  690. }
  691. }
  692. }
  693. });
  694. },
  695. // 分页
  696. toPage(e) {
  697. const that = this;
  698. let list = that.list;
  699. let limit = that.limit;
  700. if (that.total > list.length) {
  701. uni.showLoading({
  702. title: '加载中',
  703. mask: true
  704. })
  705. let page = that.page + 1;
  706. that.$set(that, `page`, page)
  707. let skip = page * limit;
  708. that.$set(that, `skip`, skip)
  709. that.search();
  710. uni.hideLoading();
  711. } else {}
  712. },
  713. // 选择选项卡
  714. tabsChange(e) {
  715. const that = this;
  716. that.$set(that.tabs, `active`, e.active)
  717. that.$set(that, `searchInfo`, {})
  718. that.$set(that, `status_name`, '')
  719. that.clearPage();
  720. that.search()
  721. },
  722. // 查询其他信息
  723. async searchOther() {
  724. const that = this;
  725. let res;
  726. // 查询状态
  727. res = await that.$api(`/dictData`, 'GET', {
  728. code: 'order_process'
  729. })
  730. if (res.errcode == '0') that.$set(that, `ostatusList`, res.data);
  731. res = await that.$api(`/dictData`, 'GET', {
  732. code: "afterSale_type"
  733. });
  734. if (res.errcode == '0') that.$set(that, `typeList`, res.data)
  735. res = await that.$api(`/dictData`, 'GET', {
  736. code: "afterSale_status"
  737. });
  738. if (res.errcode == '0') that.$set(that, `astatusList`, res.data)
  739. res = await that.$api(`/dictData`, 'GET', {
  740. code: "group_status"
  741. });
  742. if (res.errcode == '0') that.$set(that, `gstatusList`, res.data)
  743. },
  744. // 分享
  745. toShare(e) {
  746. const that = this;
  747. that.clearPage();
  748. uni.navigateTo({
  749. url: `/pagesHome/group/share?id=${e.goods._id}&group=${e._id}`
  750. })
  751. },
  752. // 清空列表
  753. clearPage() {
  754. const that = this;
  755. that.$set(that, `list`, [])
  756. that.$set(that, `skip`, 0)
  757. that.$set(that, `limit`, 6)
  758. that.$set(that, `page`, 0)
  759. }
  760. }
  761. }
  762. </script>
  763. <style lang="scss">
  764. .main {
  765. display: flex;
  766. flex-direction: column;
  767. width: 100vw;
  768. height: 100vh;
  769. .one {
  770. position: relative;
  771. flex-grow: 1;
  772. padding: 2vw 0 0 0;
  773. .tabsList {
  774. position: relative;
  775. width: 100vw;
  776. height: 90vh;
  777. .one_1 {
  778. padding: 2vw;
  779. text-align: center;
  780. button {
  781. background-color: #23B67A;
  782. color: #ffffff;
  783. }
  784. }
  785. .one_2 {
  786. .list {
  787. background-color: #fff;
  788. border: 1px solid var(--f5Color);
  789. padding: 2vw;
  790. margin: 0 2vw 2vw 2vw;
  791. border-radius: 5px;
  792. .list_1 {
  793. .list_1_1 {
  794. display: flex;
  795. justify-content: space-between;
  796. margin: 0 0 2vw 0;
  797. .shopname {
  798. text:last-child {
  799. padding: 0 0 0 2vw;
  800. }
  801. }
  802. .status {
  803. color: var(--ff0Color);
  804. }
  805. }
  806. .list_1_2 {
  807. border-bottom: 1px solid #f1f1f1;
  808. .goods {
  809. display: flex;
  810. padding: 0 0 2vw 0;
  811. .goods_1 {
  812. width: 20vw;
  813. height: 20vw;
  814. .image {
  815. width: 100%;
  816. height: 100%;
  817. border-radius: 5px;
  818. }
  819. }
  820. .goods_2 {
  821. width: 55vw;
  822. padding: 0 0 0 2vw;
  823. .goodsname {
  824. font-size: 16px;
  825. margin: 0 0 1vw 0;
  826. }
  827. .specs {
  828. font-size: 14px;
  829. color: #858585;
  830. }
  831. }
  832. .goods_3 {
  833. width: 15vw;
  834. text-align: right;
  835. .price {
  836. color: #ff0000;
  837. }
  838. }
  839. }
  840. }
  841. .other {
  842. padding: 0 0 2vw 0;
  843. margin: 2vw 0;
  844. text-align: right;
  845. border-bottom: 1px solid #f1f1f1;
  846. text {
  847. font-size: 14px;
  848. padding: 0 0 0 2vw;
  849. }
  850. }
  851. .btn {
  852. text-align: right;
  853. button {
  854. margin: 0 1vw 0 0;
  855. }
  856. }
  857. }
  858. .list_2 {
  859. .list_2_1 {
  860. display: flex;
  861. justify-content: space-between;
  862. font-size: var(--font16Size);
  863. margin: 0 0 2vw 0;
  864. .shopname {
  865. text {
  866. margin: 0 0 0 1vw;
  867. }
  868. }
  869. .type {
  870. color: var(--ff0Color);
  871. }
  872. }
  873. .list_2_2 {
  874. display: flex;
  875. justify-content: space-between;
  876. .image {
  877. width: 25vw;
  878. height: 25vw;
  879. margin: 0 2vw 1vw 0;
  880. border: 1px solid var(--f85Color);
  881. }
  882. .other {
  883. width: 65vw;
  884. flex-grow: 1;
  885. .name {
  886. font-size: var(--font16Size);
  887. margin: 0 0 1vw 0;
  888. }
  889. .other_1 {
  890. font-size: var(--font14Size);
  891. text {
  892. color: var(--f85Color);
  893. }
  894. }
  895. }
  896. }
  897. .btn {
  898. text-align: right;
  899. button {
  900. margin: 2vw 0 0 2vw;
  901. }
  902. }
  903. }
  904. }
  905. }
  906. }
  907. }
  908. }
  909. .dialog {
  910. position: fixed;
  911. width: 96vw;
  912. height: 100vh;
  913. background-color: #ffffff;
  914. z-index: 99999;
  915. display: flex;
  916. flex-direction: column;
  917. padding: 2vw;
  918. .uni-input {
  919. border: #f1f1ff 1px solid;
  920. padding: 2vw 2vw;
  921. border-radius: 1vw;
  922. }
  923. .picker {
  924. border: 1px solid #3333;
  925. border-radius: 5px;
  926. padding: 2vw;
  927. }
  928. .btn {
  929. text-align: center;
  930. button {
  931. margin: 0 2vw 2vw 2vw;
  932. background-color: #23B67A;
  933. color: #ffffff;
  934. }
  935. .name {
  936. color: var(--f85Color);
  937. font-size: var(--font14Size);
  938. }
  939. }
  940. }
  941. .scroll-view {
  942. position: absolute;
  943. top: 0;
  944. left: 0;
  945. right: 0;
  946. bottom: 0;
  947. .list-scroll-view {
  948. display: flex;
  949. flex-direction: column;
  950. }
  951. }
  952. </style>