index.vue 26 KB

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