index.vue 27 KB

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