index.vue 27 KB

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