sort.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. <template>
  2. <view>
  3. <view class="search-box">
  4. <view class="search ddflex" @click="search()">
  5. <image src="../../static/images/ssico.png"></image>
  6. <view>搜索商品</view>
  7. </view>
  8. </view>
  9. <block v-if="sort">
  10. <!-- #ifndef H5 -->
  11. <scroll-view scroll-y="true" class="sort-left" :style="'bottom:' + (bottomBlankHeignt + 115) + 'rpx;'">
  12. <block v-for="(item, index) in sortCategorys" :key="index">
  13. <view :class="'li ' + (selectTab == index ? 'active' : '')" :data-index="index" @tap="toScrollView"
  14. :data-id="item.id">{{item.title}}</view>
  15. </block>
  16. </scroll-view>
  17. <!-- #endif -->
  18. <!-- #ifdef H5 -->
  19. <scroll-view scroll-y="true" class="sort-left"
  20. :style="'bottom:' + (bottomBlankHeignt + 115) + 'rpx;' +'top: 43px'">
  21. <block v-for="(item, index) in sortCategorys" :key="index">
  22. <view :class="'li ' + (selectTab == index ? 'active' : '')" :data-index="index" @tap="toScrollView"
  23. :data-id="item.id">{{item.title}}</view>
  24. </block>
  25. </scroll-view>
  26. <!-- #endif -->
  27. <scroll-view scroll-y="true" class="sort-right" :style="'height:' + scrollHeight + 'px;'"
  28. :scroll-into-view="toView" scroll-top="0" @scroll="scrollTo" scroll-with-animation="true">
  29. <view class="rcon">
  30. <view v-for="(cats, idx) in sortCategorys" :key="idx" :id="'position' + idx">
  31. <view class="tit" @tap="goUrl" :data-id="cats.id" :data-title="cats.title">{{cats.title}}</view>
  32. <view class="list dflex">
  33. <view v-for="(item, index) in cats.nodes" :key="index" class="li" @tap="goUrl"
  34. :data-id="item.id" :data-title="item.title">
  35. <image :src="item.icon" v-if="item.icon" lazy-load="true"></image>
  36. <view class="litext" :data-key="key" :style="'background-color:' + item.colors" v-else>
  37. {{item.first}}
  38. </view>
  39. {{item.title}}
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </scroll-view>
  45. </block>
  46. <block v-else>
  47. <!-- #ifndef H5 -->
  48. <scroll-view scroll-y="true" class="left savepadding">
  49. <block v-for="(item, index) in categorys" :key="index">
  50. <view :class="'li ' + (current == index ? 'active' : '')" :data-current="index" :data-id="item.id"
  51. @tap="cateTab">{{item.title}}</view>
  52. </block>
  53. </scroll-view>
  54. <!-- #endif -->
  55. <!-- #ifdef H5 -->
  56. <scroll-view scroll-y="true" class="left"
  57. :style="'bottom:' + (bottomBlankHeignt + 115) + 'rpx;'+'top: 43px;'">
  58. <block v-for="(item, index) in categorys" :key="index">
  59. <view :class="'li ' + (current == index ? 'active' : '')" :data-current="index" :data-id="item.id"
  60. @tap="cateTab">{{item.title}}</view>
  61. </block>
  62. </scroll-view>
  63. <!-- #endif -->
  64. <view class="right" :style="'padding-top:' +heightEle+'rpx'">
  65. <view class="savepadding">
  66. <view class="right-top">
  67. <view class="coupons" @click="jumpUrl('/product/couponList/index?categoryId='+categorys[current].id)" v-if="couponList.length>0 && is_show_coupons == 1">
  68. <view class="ddflex" style="justify-content: space-between;">
  69. <view class="coupon-num">{{couponList.length}}个优惠</view>
  70. <image src="../../static/pages/images/rico_red.png" class="rico"></image>
  71. </view>
  72. <view class="coupons-list fflex">
  73. <scroll-view scroll-x="true" class="coupons-s">
  74. <view class="li" v-for="(item,index) in couponList" :key="index" @click.stop="recieveCoupon(item,index)">
  75. <view class="ddflex">
  76. <view class="coupons-tit">{{item.couponTitle}}</view>
  77. <text>{{item.userCount >= item.userReceive&&item.userCount!=0&&item.userReceive!=-1 ? '已领' : '领'}}</text>
  78. </view>
  79. </view>
  80. </scroll-view>
  81. </view>
  82. </view>
  83. <scroll-view scroll-X="true" class="tab">
  84. <view :class="'li ' + (currents == -1 ? 'active' : '')" @tap="all">全部</view>
  85. <block v-for="(item, index) in cates" :key="index" v-if="!merchantId">
  86. <view :class="'li ' + (currents == index ? 'active' : '')" @tap="cateTabs"
  87. :data-currents="index" :data-id="item.id">{{item.title}}{{merchantId}}</view>
  88. </block>
  89. </scroll-view>
  90. </view>
  91. <view class="sort">
  92. <block v-for="(item, index) in pageList" :key="index">
  93. <view class="li dflex">
  94. <view class="proimgs" @tap="toDetail" :data-id="item.id">
  95. <image :src="item.pic + '?x-oss-process=style/w160'" mode="aspectFit" class="proimg" lazy-load="true"></image>
  96. <image src="../../static/pages/images/shouqing.png" class="shouqing" v-if="item.stock < 1"></image>
  97. </view>
  98. <view class="flex">
  99. <view class="proname" @tap="toDetail" :data-id="item.id">{{item.title}}</view>
  100. <view :class="[item.brandName?'':'nopronames','pronames']">
  101. {{item.brandName?item.brandName:''}}
  102. </view>
  103. <view class="operate dflex">
  104. <view class="price">
  105. ¥<text>{{item.salePrice}}</text>
  106. <view class="vip-news ddflex" v-if="show_membership_price==1&&item.actualPrice < item.salePrice"><text class="vip-sale">会员价</text><text class="vip-members">¥{{item.actualPrice}}</text></view>
  107. <view class="vip-news ddflex" v-if="show_membership_price==1&&item.membersPrice<item.salePrice"><text class="vip-sale">会员价</text><text class="vip-members">¥{{item.membersPrice}}</text></view>
  108. <!-- <text class="vip" v-if="show_membership_price==1&&item.actualPrice < item.salePrice"><text class="sale">VIP</text><text class="members">{{item.actualPrice}}</text></text>
  109. <text class="vip"
  110. v-if="show_membership_price==1&&item.membersPrice<item.salePrice"><text
  111. class="sale">VIP</text><text
  112. class="members">{{item.membersPrice}}</text></text> -->
  113. <text class="del" v-if="show_membership_price!=1">
  114. <block v-if="item.marketPrice!=0&&item.marketPrice>item.salePrice">
  115. ¥{{item.marketPrice}}
  116. </block>
  117. </text>
  118. </view>
  119. <view class="add-cart"><!-- addShopCart -->
  120. <image src="/static/pages/images/jia.png" @tap="toDetail" :data-id="item.id"
  121. :data-skuid="item.skuId" :data-index="index" :data-state="item.state">
  122. </image>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </block>
  128. <view class="nodata nosp bgfff" v-if="show">
  129. <image :src="picUrlss+'empty_sp.png'"></image>
  130. <text>暂无商品</text>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. </block>
  136. <foot channel="sort" :isUpdate="isUpdate"></foot>
  137. </view>
  138. </template>
  139. <script>
  140. // pages/sort/sort.js
  141. //获取应用实例
  142. const app = getApp();
  143. const req = require("../../utils/request.js");
  144. let scrollDdirection = 0; // 用来计算滚动的方向
  145. import foot from "../../components/nav-bar/index";
  146. export default {
  147. data() {
  148. return {
  149. picUrlss: req.public.picUrls,
  150. bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
  151. categorys: [],
  152. //产品一级分类列表
  153. cates: [],
  154. //产品二级分类列表
  155. current: 0,
  156. currents: -1,
  157. page: 1,
  158. sort: false,
  159. sortCategorys: [],
  160. //产品一级分类列表
  161. selectTab: 0,
  162. scrollTop: 0,
  163. scrollHeight: 0,
  164. // 滚动视图的高度
  165. toView: 'position0',
  166. // 滚动视图跳转的位置
  167. scrollInfo: [],
  168. isload: false,
  169. // 自定义自己喜欢的颜色
  170. colorArr: ["#e83fa0", "#0cd4c5", "#b146f4", "#18c88b", "#227bfe", "#e8a52f", "#f78d58"],
  171. // 存储随机颜色
  172. randomColorArr: [],
  173. isUpdate: false // 是否更新消息
  174. ,
  175. merchantId: "",
  176. id: "",
  177. show_membership_price: 0,
  178. Is_Store_Price_Stock: 0,
  179. is_show_coupons: 0,
  180. pageList: [],
  181. _key: "",
  182. show: Boolean,
  183. cateid:'',
  184. couponList: [],
  185. heightEle: ''
  186. };
  187. },
  188. components: {
  189. foot
  190. },
  191. props: {},
  192. onLoad: async function(options) {
  193. // console.log(options);
  194. this.setData({
  195. current: options.current ? options.current : 0,
  196. merchantId: options.merchantId,
  197. id: options.id
  198. });
  199. await this.getConfig();
  200. uni.getSystemInfo({
  201. success: res => {
  202. this.setData({
  203. scrollHeight: res.windowHeight - 136 * res.windowWidth / 750
  204. });
  205. }
  206. });
  207. if (this.sort) this.sortCategory();
  208. else this.category('0', 'categorys', options.id);
  209. },
  210. onShow() {
  211. this.setData({
  212. isUpdate: !this.isUpdate
  213. });
  214. },
  215. onReachBottom() {
  216. this.page++;
  217. if(this.currents>-1){
  218. this.getList(this.cateid);
  219. }else{
  220. this.getList(this.id);
  221. }
  222. },
  223. methods: {
  224. loadCoupon(id) {
  225. let form = {
  226. page: 1,
  227. limit: 4,
  228. categoryId: id,
  229. bindType: 'use'
  230. };
  231. return new Promise((resolve,reject)=>{
  232. req.getRequest('/api/coupon/list', form, data => {
  233. if(data&&data.length>0){
  234. this.couponList = data;
  235. }else{
  236. this.couponList = [];
  237. }
  238. resolve()
  239. });
  240. })
  241. },
  242. getConfig() {
  243. var _this = this;
  244. return new Promise((resolve, reject) => {
  245. req.getRequest('/api/config', {}, function(res) {
  246. if (res && res.Product_Sort_ico == 1) _this.setData({
  247. sort: true
  248. });
  249. if (res && res.show_membership_price == 1) {
  250. _this.setData({
  251. show_membership_price: 1
  252. });
  253. }
  254. if (res && res.Is_Store_Price_Stock == 1) {
  255. _this.setData({
  256. Is_Store_Price_Stock: 1
  257. });
  258. }
  259. if (res && res.is_show_coupons == 1) {
  260. _this.is_show_coupons = 1
  261. }
  262. resolve();
  263. });
  264. });
  265. },
  266. category(id, dataName, listId) {
  267. //产品分类
  268. let that = this;
  269. // console.log(id, dataName, listId);
  270. let from = {
  271. page: 1,
  272. size: 1000,
  273. pid: id
  274. };
  275. if (this.Is_Store_Price_Stock == 1) {
  276. if (req.getStorage('smallShop')) {
  277. from.merchantId = req.getStorage('smallShop').merchantDTO.id;
  278. } else if (req.getStorage('MERCHANT')) {
  279. from.merchantId = req.getStorage('MERCHANT').id;
  280. }
  281. }
  282. req.getRequest('/api/category/list', from, async res => {
  283. // console.log(res);
  284. let data = {};
  285. data[dataName] = res;
  286. if (id == 0) {
  287. if (listId) {
  288. this.getList(listId); // this.initCate(listId, 'cates');
  289. } else {
  290. if(this.is_show_coupons == 1){
  291. await this.loadCoupon(res[0].id);
  292. }
  293. await this.initCate(res[0].id, 'cates');
  294. await this.getList(res[0].id);
  295. that.setData({
  296. id: res[0].id
  297. });
  298. }
  299. }
  300. that.setData(data);
  301. // console.log(data);
  302. });
  303. },
  304. async initCate(id, dataName) {
  305. await this.category(id, dataName); // if(this.data.merchantId){
  306. // return false
  307. // }
  308. this.getList(id);
  309. },
  310. async cateTab(e) {
  311. let current = e.currentTarget.dataset.current;
  312. let id = e.currentTarget.dataset.id;
  313. this.categoryId = id; // this.category(id, 'cates')
  314. // this.getList(id)
  315. this.setData({
  316. current: current,
  317. currents: -1,
  318. id: id,
  319. page: 1,
  320. pageList: []
  321. });
  322. this.couponList = [];
  323. this.heightEle = '';
  324. if(this.is_show_coupons == 1){
  325. await this.loadCoupon(id);
  326. }
  327. await this.initCate(id, 'cates');
  328. },
  329. getList(id) {
  330. // console.log("====================")
  331. //产品列表
  332. let that = this;
  333. var startTime = new Date().getTime();
  334. // console.log(id);
  335. let from = {
  336. page: that.page,
  337. limit: 6,
  338. categoryId: id
  339. };
  340. if (this.Is_Store_Price_Stock == 1) {
  341. if (req.getStorage('MERCHANT')) {
  342. if (req.getStorage('MERCHANT').isDefault != 1) {
  343. from.merchantId = req.getStorage('MERCHANT').id;
  344. } else {
  345. delete from.merchantId;
  346. }
  347. }
  348. } // if (!that.data.isLoad) return false;
  349. // that.data.isLoad = false;
  350. const systemInfo = uni.getSystemInfoSync();
  351. // px转换到rpx的比例
  352. if(!this.heightEle){
  353. let pxToRpxScale = 750 / systemInfo.windowWidth;
  354. uni.createSelectorQuery().in(this).select(".right-top").boundingClientRect(data => {
  355. this.heightEle = data.height*pxToRpxScale
  356. console.log('this.heightEle==',this.heightEle)
  357. this.$forceUpdate();
  358. }).exec()
  359. }
  360. req.getRequest('/api/product/list', from, res => {
  361. // console.log(new Date().getTime() - startTime);
  362. if (res && res.length >= 10) that.isLoad = true;
  363. if (that.page > 1) res = that.pageList.concat(res);
  364. if (res.length <= 0) {
  365. that.setData({
  366. show: true
  367. })
  368. } else {
  369. that.setData({
  370. show: false
  371. })
  372. }
  373. that.setData({
  374. pageList: res
  375. });
  376. });
  377. },
  378. cateTabs(e) {
  379. let current = e.currentTarget.dataset.currents;
  380. let id = e.currentTarget.dataset.id;
  381. this.setData({
  382. currents: current,
  383. page: 1,
  384. pageList: [],
  385. cateid: id
  386. });
  387. this.getList(id);
  388. },
  389. all() {
  390. // console.log(this.id); // this.getList(this.data.id)
  391. this.setData({
  392. currents: -1
  393. });
  394. this.initCate(this.id, 'cates');
  395. },
  396. toDetail(e) {
  397. let id = e.currentTarget.dataset.id; // let merchant = e.currentTarget.dataset.merchant
  398. // let shopId = e.currentTarget.dataset.shopid
  399. if (this.Is_Store_Price_Stock == 1) {
  400. if (req.getStorage('smallShop')) {
  401. var merchantId = req.getStorage('smallShop').merchantDTO.id;
  402. var shopId = req.getStorage('smallShop').id;
  403. app.globalData.openPage("product/detail/detail?id=" + id + "&merchantId=" + merchantId +
  404. "&shopId=" + shopId);
  405. } else if (req.getStorage('MERCHANT')) {
  406. if (req.getStorage('MERCHANT').isDefault != 1) {
  407. merchantId = req.getStorage('MERCHANT').id;
  408. app.globalData.openPage("product/detail/detail?id=" + id + "&merchantId=" + merchantId);
  409. } else {
  410. app.globalData.openPage("product/detail/detail?id=" + id);
  411. }
  412. }
  413. } else {
  414. app.globalData.openPage("product/detail/detail?id=" + id);
  415. } // if (!shopId) {
  416. // app.openPage("product/detail/detail?id=" + id + "&merchantId=" + merchantId)
  417. // } else {
  418. // app.openPage("product/detail/detail?id=" + id + "&merchantId=" + merchantId + "&shopId=" + shopId)
  419. // }
  420. // app.openPage("product/detail/detail?id=" + id)
  421. },
  422. addShopCart(e) {
  423. let that = this;
  424. let skuId = e.currentTarget.dataset.skuid;
  425. let id = e.currentTarget.dataset.id;
  426. let index = e.currentTarget.dataset.index;
  427. let pageList = that.pageList;
  428. let state = e.currentTarget.dataset.state; // let merchant = req.getStorage('MERCHANT');
  429. req.isLogin().then(success => {
  430. if (success) {
  431. let params = {
  432. skuId: skuId,
  433. quantity: 1,
  434. productId: id
  435. };
  436. if (req.getStorage('smallShop')) {
  437. params.merchantId = req.getStorage('smallShop').merchantDTO.id;
  438. params.shopId = req.getStorage('smallShop').id;
  439. } else if (req.getStorage('MERCHANT')) {
  440. params.merchantId = req.getStorage('MERCHANT').id;
  441. } // if(state!=1){
  442. // return req.msg('您来晚了,商品已经下架')
  443. // }
  444. req.postRequest('/api/purchase/cart', params, res => {
  445. that.setData({
  446. isUpdate: !that.isUpdate
  447. });
  448. req.msg('加入购物车成功');
  449. });
  450. }
  451. });
  452. },
  453. sortCategory() {
  454. //产品分类
  455. let that = this;
  456. let params = {
  457. page: 1,
  458. size: 1000
  459. };
  460. if (this.Is_Store_Price_Stock == 1) {
  461. if (req.getStorage('smallShop')) {
  462. params.merchantId = req.getStorage('smallShop').merchantDTO
  463. .id; // params.shopId= req.getStorage('smallShop').id
  464. } else if (req.getStorage('MERCHANT')) {
  465. if (req.getStorage('MERCHANT').isDefault != 1) {
  466. params.merchantId = req.getStorage('MERCHANT').id;
  467. }
  468. }
  469. }
  470. req.getRequest('/api/category/list', params, res => {
  471. if (res) {
  472. let array = res.filter(it => it.pid == 0).map(item => {
  473. item.nodes = res.filter(ite => ite.pid == item.id).map(mp => {
  474. mp.first = mp.title.substr(0, 1);
  475. let random = that.colorArr[Math.floor(Math.random() * that.colorArr
  476. .length)];
  477. mp.colors = random;
  478. return mp;
  479. });
  480. return item;
  481. });
  482. that.setData({
  483. sortCategorys: array
  484. });
  485. setTimeout(() => {
  486. that.lisenerScroll();
  487. }, 100);
  488. }
  489. });
  490. },
  491. goUrl(e) {
  492. let id = e.currentTarget.dataset.id;
  493. let title = e.currentTarget.dataset.title;
  494. if (this.Is_Store_Price_Stock == 1) {
  495. if (req.getStorage('smallShop')) {
  496. var merchantId = req.getStorage('smallShop').merchantDTO.id;
  497. app.globalData.openPage("product/list/list?id=" + id + '&smallShop=true' + '&title=' + title);
  498. } else if (req.getStorage('MERCHANT')) {
  499. if (req.getStorage('MERCHANT').isDefault != 1) {
  500. merchantId = req.getStorage('MERCHANT').id;
  501. app.globalData.openPage("product/list/list?id=" + id + "&merchantId=" + merchantId +
  502. '&title=' + title);
  503. } else {
  504. app.globalData.openPage("product/list/list?id=" + id + '&title=' + title);
  505. }
  506. }
  507. } else {
  508. app.globalData.openPage("product/list/list?id=" + id + '&title=' + title);
  509. } // app.openPage(e.currentTarget.dataset.url)
  510. },
  511. toScrollView(e) {
  512. const {
  513. index
  514. } = e.currentTarget.dataset;
  515. this.setData({
  516. selectTab: index,
  517. toView: `position${index}`
  518. });
  519. },
  520. /**
  521. * 获取右边每个分类的头部偏移量
  522. */
  523. lisenerScroll() {
  524. // var _ts=this;
  525. /* setTimeout(() => {
  526. _ts.setHeight(0);
  527. }, 10000);*/
  528. // 获取各分类容器距离顶部的距离
  529. new Promise(resolve => {
  530. let query = uni.createSelectorQuery();
  531. var clength = this.sortCategorys.length;
  532. for (var k = 0; k < clength; k++) {
  533. query.select(`#position${k}`).boundingClientRect();
  534. }
  535. query.exec(function(res) {
  536. resolve(res);
  537. });
  538. }).then(res => {
  539. var categorys = this.sortCategorys;
  540. if (res.length == categorys.length) {
  541. categorys.forEach((item, index) => {
  542. item.offsetTop = res[index].top;
  543. });
  544. this.setData({
  545. scrollInfo: res,
  546. sortCategorys: categorys
  547. });
  548. }
  549. });
  550. },
  551. setHeight(k) {
  552. var _ts = this;
  553. if (_ts.isload) {
  554. return;
  555. }
  556. _ts.isload = false;
  557. let query = uni.createSelectorQuery();
  558. query.select(`#position${k}`).boundingClientRect();
  559. query.exec(function(res) {
  560. var _key = "categorys[" + k + "].offsetTop";
  561. _ts.setData({
  562. [_key]: res[0].top
  563. });
  564. _ts.isload = true;
  565. });
  566. },
  567. /**
  568. * 监听滚动条滚动事件
  569. */
  570. scrollTo(e) {
  571. const scrollTop = e.detail.scrollTop; //滚动的Y轴
  572. const {
  573. selectTab,
  574. sortCategorys
  575. } = this;
  576. if (scrollDdirection < scrollTop) {
  577. // 向上滑动
  578. scrollDdirection = scrollTop; // 计算偏移位置
  579. // console.log(current, scrollTop,categorys[current + 1].offsetTop);
  580. if (selectTab < sortCategorys.length - 1 && scrollTop >= sortCategorys[selectTab + 1].offsetTop) {
  581. // console.log("chua");
  582. this.setData({
  583. selectTab: selectTab + 1
  584. });
  585. }
  586. } else {
  587. // 向下滑动
  588. scrollDdirection = scrollTop; // 计算偏移位置
  589. if (selectTab > 0 && scrollTop < sortCategorys[selectTab].offsetTop && scrollTop > 0) {
  590. this.setData({
  591. selectTab: selectTab - 1
  592. });
  593. }
  594. }
  595. },
  596. search() {
  597. // app.openPage('pages/search/search')
  598. app.globalData.openPage('pages/search/search')
  599. },
  600. recieveCoupon(item,index) {
  601. let _ts = this;
  602. const coupon = item;
  603. if (coupon.userReceive > -1 && coupon.userCount >= coupon.userReceive) {
  604. return req.msg('超出优惠券领取限制,无法领取');
  605. }
  606. req.postRequest('/api/coupon/receive', {
  607. id: coupon.id
  608. }, res => {
  609. // console.log(res);
  610. req.msg('领取成功', () => {
  611. // console.log("11111111111111");
  612. let isLoading = true;
  613. this.loadCoupon(this.categorys[this.current].id);
  614. // _ts.loadCoupon(isLoading);
  615. });
  616. });
  617. },
  618. jumpUrl(url){
  619. uni.navigateTo({
  620. url: url
  621. })
  622. }
  623. }
  624. };
  625. </script>
  626. <style>
  627. @import "./sort.css";
  628. </style>