index.vue 26 KB

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