index.vue 26 KB

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