index.vue 27 KB

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