Commit 7d2bdf29ee81628d1b9f40eff269bf99d983075e

Authored by 喻鹏
Exists in master

修改镜片选购逻辑 添加购物车和用户推荐产品请求

src/components/CommodityCard/CommodityCard.vue
1 1 <template>
2   - <view class="card" @tap="toGoods(goods.goods_id)">
  2 + <view class="card" @tap="toGoods(goods.goods_id,goods.goodType)">
3 3 <image mode="widthFix" :src="goods.img" ></image>
4 4 <view class="name">{{goods.name}}</view>
5 5 <view class="info">
... ... @@ -26,7 +26,8 @@
26 26 name: String,
27 27 originCost:String,
28 28 price: String,
29   - slogan:String
  29 + slogan:String,
  30 + goodType:String,
30 31 }
31 32  
32 33 },
... ... @@ -39,14 +40,45 @@
39 40 };
40 41 },
41 42 methods:{
42   - toGoods(id){
43   - console.log('toGoods =====> id======>', id)
44   - uni.navigateTo({
45   - url: `../detail/detail?oderId=1`,
46   - success: res => {},
47   - fail: () => {},
48   - complete: () => {}
49   - });
  43 + toGoods(id,type){
  44 + // console.log('toGoods =====> id======>', id)
  45 + // console.log(type)
  46 + switch(type){
  47 + case 1:
  48 + uni.navigateTo({
  49 + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type,
  50 + success: res => {},
  51 + fail: () => {},
  52 + complete: () => {}
  53 + });
  54 + break;
  55 + case 2:
  56 + uni.navigateTo({
  57 + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type,
  58 + success: res => {},
  59 + fail: () => {},
  60 + complete: () => {}
  61 + });
  62 + break;
  63 + case 3:
  64 + uni.navigateTo({
  65 + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type,
  66 + success: res => {},
  67 + fail: () => {},
  68 + complete: () => {}
  69 + });
  70 + break;
  71 + case 4:
  72 + uni.navigateTo({
  73 + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type,
  74 + success: res => {},
  75 + fail: () => {},
  76 + complete: () => {}
  77 + });
  78 + break;
  79 + default :
  80 + break
  81 + }
50 82 }
51 83 }
52 84 }
... ...
src/components/UniCollapseItem/UniCollapseItem.vue
... ... @@ -16,7 +16,9 @@
16 16 <!-- #endif -->
17 17 </view>
18 18 <view :class="{'uni-collapse-cell__content--hide':!isOpen}" class="uni-collapse-cell__content">
19   - <view :class="{ 'uni-collapse-cell--animation': showAnimation === true }" class="uni-collapse-cell__wrapper" :style="{'transform':isOpen?'translateY(0)':'translateY(-100%)','-webkit-transform':isOpen?'translateY(0)':'translateY(-100%)'}">
  19 + <view :class="{ 'uni-collapse-cell--animation': showAnimation === true }" class="uni-collapse-cell__wrapper"
  20 + :style="{'transform':isOpen?'translateY(0)':'translateY(-100%)','-webkit-transform':isOpen?'translateY(0)':'translateY(-100%)'}"
  21 + >
20 22 <slot />
21 23 </view>
22 24 </view>
... ... @@ -138,9 +140,9 @@
138 140 }
139 141  
140 142 .uni-collapse-cell--animation {
141   - transition: transform 0.5s ease;
  143 + transition: transform 0s ease;
142 144 transition-property: transform;
143   - transition-duration: 0.5s;
  145 + transition-duration: 0s;
144 146 transition-timing-function: ease;
145 147 }
146 148  
... ...
1   -{
2   - "pages" : [
3   - {
4   - "path" : "pages/myOrder/myOrder",
5   - "style" : {
6   - "navigationBarTitleText" : "我的订单"
7   - }
8   - },
9   - {
10   - "path" : "pages/cart/cart",
11   - "style" : {
12   - "navigationBarTitleText" : "购物车"
13   - }
14   - },
15   - {
16   - "path" : "pages/index/index",
17   - "style" : {
18   - "navigationBarTitleText" : "商城一览"
19   - }
20   - },
21   - {
22   - "path" : "pages/frameDetail/frameDetail",
23   - "style" : {
24   - "navigationBarTitleText" : "产品详情"
25   - }
26   - },
27   - {
28   - "path" : "pages/lensDetails/lensDetails",
29   - "style" : {
30   - "navigationBarTitleText" : "产品详情"
31   - }
32   - },
33   - {
34   - "path" : "pages/purchaseLenses/purchaseLenses",
35   - "style" : {
36   - "navigationBarTitleText" : "产品选购"
37   - }
38   - },
39   - {
40   - "path" : "pages/refundProgress/refundProgress",
41   - "style" : {
42   - "navigationBarTitleText" : "申请退款"
43   - }
44   - },
45   - {
46   - "path" : "pages/addAddress/addAddress",
47   - "style" : {
48   - "navigationBarTitleText" : "新增地址"
49   - }
50   - },
51   - {
52   - "path" : "pages/confirmOrder/confirmOrder",
53   - "style" : {
54   - "navigationBarTitleText" : "确认订单"
55   - }
56   - },
57   - {
58   - "path" : "pages/user/user",
59   - "style" : {
60   - "navigationBarTitleText" : "我的"
61   - }
62   - },
63   - {
64   - "path" : "pages/refundment/refundWays"
65   - },
66   - {
67   - "path" : "pages/refundment/refundment"
68   - },
69   - {
70   - "path" : "pages/predelivery/predelivery"
71   - },
72   - {
73   - "path" : "pages/customerService/customerService",
74   - "style" : {
75   - "navigationBarTitleText" : "在线客服"
76   - }
77   - },
78   - {
79   - "path" : "pages/myOrderPaying/myOrderPaying",
80   - "style" : {
81   - "navigationBarTitleText" : "我的订单"
82   - }
83   - },
84   - {
85   - "path" : "pages/detailsChoiceArgs/detailsChoiceArgs",
86   - "style" : {
87   - "navigationBarTitleText" : "镜片名称名称"
88   - }
89   - },
90   - {
91   - "path" : "pages/detailStandard/detailStandard_sun",
92   - "style" : {
93   - "navigationBarTitleText" : "太阳镜选购页"
94   - }
95   - },
96   - {
97   - "path" : "pages/detailStandard/detailStandard_k",
98   - "style" : {
99   - "navigationBarTitleText" : "镜框选购页"
100   - }
101   - },
102   - {
103   - "path" : "pages/detailsChoiceArgs/compoents/MyCollapse",
104   - "style" : {}
105   - }
106   - ],
107   - "globalStyle" : {
108   - "navigationBarTextStyle" : "black",
109   - "navigationBarTitleText" : "uni-app",
110   - "navigationBarBackgroundColor" : "#F8F8F8",
111   - "backgroundColor" : "#F8F8F8"
112   - },
113   - "tabBar" : {
114   - "color" : "#C0C4CC",
115   - "selectedColor" : "#fa436a",
116   - "borderStyle" : "black",
117   - "backgroundColor" : "#ffffff",
118   - "list" : [
119   - {
120   - "pagePath" : "pages/index/index",
121   - "iconPath" : "static/tab-home.png",
122   - "selectedIconPath" : "static/tab-home-current.png",
123   - "text" : "首页"
124   - },
125   - {
126   - "pagePath" : "pages/cart/cart",
127   - "iconPath" : "static/tab-cart.png",
128   - "selectedIconPath" : "static/tab-cart-current.png",
129   - "text" : "购物车"
130   - },
131   - {
132   - "pagePath" : "pages/user/user",
133   - "iconPath" : "static/tab-my.png",
134   - "selectedIconPath" : "static/tab-my-current.png",
135   - "text" : "我的"
136   - }
137   - ]
138   - },
139   - "condition" : {
140   - //模式配置,仅开发期间生效
141   - "current" : 0, //当前激活的模式(list 的索引项)
142   - "list" : [
143   - {
144   - "name" : "", //模式名称
145   - "path" : "", //启动页面,必选
146   - "query" : "" //启动参数,在页面的onLoad函数里面得到
147   - }
148   - ]
149   - }
150   -}
  1 +{
  2 + "pages": [
  3 + {
  4 + "path": "pages/index/index",
  5 + "style": {
  6 + "navigationBarTitleText": "商城一览"
  7 + }
  8 + },
  9 + {
  10 + "path" : "pages/myOrder/myOrder",
  11 + "style" : {
  12 + "navigationBarTitleText": "我的订单"}
  13 + },
  14 + {
  15 + "path": "pages/frameDetail/frameDetail",
  16 + "style": {
  17 + "navigationBarTitleText": "产品详情"
  18 + }
  19 + },
  20 + {
  21 + "path": "pages/lensDetails/lensDetails",
  22 + "style": {
  23 + "navigationBarTitleText": "产品详情"
  24 + }
  25 + },
  26 + {
  27 + "path": "pages/cart/cart",
  28 + "style": {
  29 + "navigationBarTitleText": "购物车"
  30 + }
  31 + },
  32 + {
  33 + "path" : "pages/purchaseLenses/purchaseLenses",
  34 + "style" : {
  35 + "navigationBarTitleText": "产品选购"
  36 + }
  37 + },
  38 + {
  39 + "path" : "pages/refundProgress/refundProgress",
  40 + "style": {
  41 + "navigationBarTitleText": "申请退款"
  42 + }
  43 + },
  44 + {
  45 + "path": "pages/addAddress/addAddress",
  46 + "style": {
  47 + "navigationBarTitleText": "新增地址"
  48 + }
  49 + },
  50 + {
  51 + "path" : "pages/confirmOrder/confirmOrder",
  52 + "style" : {
  53 + "navigationBarTitleText": "确认订单"
  54 + }
  55 + },
  56 + {
  57 + "path": "pages/user/user",
  58 + "style": {
  59 + "navigationBarTitleText": "我的"
  60 + }
  61 + },
  62 + {
  63 + "path": "pages/refundment/refundWays"
  64 + },
  65 + {
  66 + "path": "pages/refundment/refundment"
  67 + },
  68 + {
  69 + "path": "pages/predelivery/predelivery"
  70 + },
  71 + {
  72 + "path": "pages/customerService/customerService",
  73 + "style":{
  74 + "navigationBarTitleText" : "在线客服"
  75 + }
  76 + },
  77 + {
  78 + "path": "pages/myOrderPaying/myOrderPaying",
  79 + "style":{
  80 + "navigationBarTitleText" : "我的订单"
  81 + }
  82 + },
  83 + {
  84 + "path": "pages/detailsChoiceArgs/detailsChoiceArgs",
  85 + "style":{
  86 + "navigationBarTitleText" : "镜片名称名称"
  87 + }
  88 + },
  89 + {
  90 + "path" : "pages/detailStandard/detailStandard_sun",
  91 + "style": {
  92 + "navigationBarTitleText": "太阳镜选购页"
  93 + }
  94 + },
  95 + {
  96 + "path" : "pages/detailStandard/detailStandard_k",
  97 + "style": {
  98 + "navigationBarTitleText": "镜框选购页"
  99 + }
  100 + }
  101 +
  102 + ],
  103 + "globalStyle": {
  104 + "navigationBarTextStyle": "black",
  105 + "navigationBarTitleText": "uni-app",
  106 + "navigationBarBackgroundColor": "#F8F8F8",
  107 + "backgroundColor": "#F8F8F8"
  108 + },
  109 + "tabBar": {
  110 + "color": "#C0C4CC",
  111 + "selectedColor": "#fa436a",
  112 + "borderStyle": "black",
  113 + "backgroundColor": "#ffffff",
  114 + "list": [{
  115 + "pagePath": "pages/index/index",
  116 + "iconPath": "static/tab-home.png",
  117 + "selectedIconPath": "static/tab-home-current.png",
  118 + "text": "首页"
  119 + },
  120 + {
  121 + "pagePath": "pages/cart/cart",
  122 + "iconPath": "static/tab-cart.png",
  123 + "selectedIconPath": "static/tab-cart-current.png",
  124 + "text": "购物车"
  125 + },
  126 + {
  127 + "pagePath": "pages/user/user",
  128 + "iconPath": "static/tab-my.png",
  129 + "selectedIconPath": "static/tab-my-current.png",
  130 + "text": "我的"
  131 + }
  132 + ]
  133 + },
  134 + "condition" : { //模式配置,仅开发期间生效
  135 + "current": 0, //当前激活的模式(list 的索引项)
  136 + "list": [
  137 + {
  138 + "name": "", //模式名称
  139 + "path": "", //启动页面,必选
  140 + "query": "" //启动参数,在页面的onLoad函数里面得到
  141 + }
  142 + ]
  143 + }
  144 +}
151 145 \ No newline at end of file
... ...
src/pages/frameDetail/frameDetail.vue
... ... @@ -11,17 +11,17 @@
11 11 <view class="D1_name"><span class="D1_name1">{{name}}</span><span class="D1_number">{{number}}购买过</span></view>
12 12 <view class="D1_spans"><span>支持7天无理由退货</span><span>顺丰发货</span><span>30天质量保证</span></view>
13 13 </view>
14   - <view class="D2" v-if="goodType === 0 || goodType === 3">
  14 + <view class="D2" v-if="updateGoodType == 2 || updateGoodType == 4">
15 15 <view><span class="D2_span1">框架材质:</span><span class="D2_span2">{{introduction.material}}</span></view>
16 16 <view><span class="D2_span1">风格:</span><span class="D2_span2">{{introduction.func}}</span></view>
17 17 <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view>
18 18 </view>
19   - <view class="D2" v-if="goodType === 1">
  19 + <view class="D2" v-if="updateGoodType == 1">
20 20 <view><span class="D2_span1">镜片材质:</span><span class="D2_span2">{{introduction.material}}</span></view>
21 21 <view><span class="D2_span1">功能:</span><span class="D2_span2">{{introduction.func}}</span></view>
22 22 <view><span class="D2_span1">使用场景:</span><span class="D2_span2">{{introduction.rate}}</span></view>
23 23 </view>
24   - <view class="D2" v-if="goodType === 2">
  24 + <view class="D2" v-if="updateGoodType == 3">
25 25 <view><span class="D2_span1">材质:</span><span class="D2_span2">{{introduction.material}}</span></view>
26 26 <view><span class="D2_span1">直径/基弧:</span><span class="D2_span2">{{introduction.func}}</span></view>
27 27 <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view>
... ... @@ -163,7 +163,7 @@ export default {
163 163 data(){
164 164 return {
165 165 name:'商品名称',
166   - goodType:1,
  166 + goodType:2,
167 167 price: 120,
168 168 number: 391,
169 169 screenItems: [
... ... @@ -212,14 +212,53 @@ export default {
212 212 }
213 213 }
214 214 },
  215 + onLoad:function(option){
  216 + this.goodType = option.goodType
  217 + console.log(this.updateGoodType)
  218 + },
  219 + computed:{
  220 + updateGoodType(){
  221 + return this.goodType
  222 + }
  223 + },
215 224 methods:{
216 225 goPerchase(){
217   - uni.navigateTo({
218   - url: '../purchaseLenses/purchaseLenses',
219   - success: res => {},
220   - fail: () => {},
221   - complete: () => {}
222   - });
  226 + switch(this.updateGoodType){
  227 + case '1':
  228 + uni.navigateTo({
  229 + url: '../detailsChoiceArgs/detailsChoiceArgs',
  230 + success: res => {},
  231 + fail: () => {},
  232 + complete: () => {}
  233 + });
  234 + break;
  235 + case '2':
  236 + uni.navigateTo({
  237 + url: `../detailStandard/detailStandard_k`,
  238 + success: res => {},
  239 + fail: () => {},
  240 + complete: () => {}
  241 + });
  242 + break;
  243 + case '3':
  244 + uni.navigateTo({
  245 + url: `../purchaseLenses/purchaseLenses`,
  246 + success: res => {},
  247 + fail: () => {},
  248 + complete: () => {}
  249 + });
  250 + break;
  251 + case '4':
  252 + uni.navigateTo({
  253 + url: `../detailStandard/detailStandard_sun`,
  254 + success: res => {},
  255 + fail: () => {},
  256 + complete: () => {}
  257 + });
  258 + break;
  259 + default :
  260 + break
  261 + }
223 262 },
224 263 tabChange(e) {
225 264 if (this.current !== e) {
... ...
src/pages/index/index.vue
... ... @@ -102,28 +102,34 @@ export default {
102 102 showRight: false,
103 103 indexArr: "",
104 104 valueArr: "",
105   - // //商品数据
106   - // goodsList: [
107   - // {
108   - // // goods_id: 0,
109   - // // img: "/static/img/goods/p1.jpg",
110   - // // name: "商品名称",
111   - // // originCost: "¥198",
112   - // // price: "¥168",
113   - // // slogan: "1235人浏览"
114   - // }
115   - // ],
116   - loadingText: "正在加载...",
  105 + loadingText: "~~到底了~~",
117 106 filterDropdownValue: [],
118   - filterData: []
  107 + filterData: [],
  108 + goodsList:[
  109 + { goods_id: 0, img: "/static/img/goods/p1.jpg", name: '镜片',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:1 },
  110 + { goods_id: 1, img: '/static/img/goods/p2.jpg', name: '镜框',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:2 },
  111 + { goods_id: 2, img: '/static/img/goods/p3.jpg', name: '美瞳',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:3 },
  112 + { goods_id: 3, img: '/static/img/goods/p4.jpg', name: '太阳镜',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:4 },
  113 + { goods_id: 4, img: '/static/img/goods/p5.jpg', name: '镜片',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:1 },
  114 + { goods_id: 5, img: '/static/img/goods/p6.jpg', name: '镜框',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:2 },
  115 + { goods_id: 6, img: '/static/img/goods/p7.jpg', name: '美瞳',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:3 },
  116 + { goods_id: 7, img: '/static/img/goods/p8.jpg', name: '太阳镜',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:4 },
  117 + { goods_id: 8, img: '/static/img/goods/p9.jpg', name: '镜片',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:1 },
  118 + { goods_id: 9, img: '/static/img/goods/p10.jpg', name: '镜框',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:2 }
  119 + ],
119 120 };
120 121 },
121 122 computed: {
122   - goodsList() {
123   - // 也可以从 getters 获取
124   - console.log('list', this.$store.state.test.list);
125   - return this.$store.state.test.list;
126   - }
  123 + // goodsList() {
  124 + // // 也可以从 getters 获取
  125 + // console.log('list', this.$store.state.test.list);
  126 + // return this.$store.state.test.list;
  127 + // },
  128 + // categoryList(){
  129 + // console.log(this.$store.state.categoryOrder.categoryList);
  130 + // this.filterData = this.$store.state.categoryOrder.categoryList
  131 + // }
  132 +
127 133 },
128 134 filters: {
129 135 outData(value) {
... ... @@ -132,53 +138,20 @@ export default {
132 138 },
133 139 onLoad: function() {
134 140 store.dispatch('test/fetch');
135   - // uni.request({
136   - // url: "https://api.glass.xiuyetang.com/app/prod/list",
137   - // method: "post",
138   - // data: {
139   - // // text: 'uni.request'
140   - // },
141   - // header: {
142   - // // 'custom-header': 'hello', //自定义请求头信息
143   - // "Content-Type": "application/x-www-form-urlencoded"
144   - // // 'Content-Type':'multipart/form-data'
145   - // // 'Content-Type':'ext/plain'
146   - // },
147   - // timeout: 3000,
148   - // // dataType:'json'
149   - // // responseType:'text',
150   - // // sslVerify: true, //验证 ssl 证书
151   - // withCredentials: false, //跨域请求时是否携带凭证(cookies)
152   - // success: res => {
153   - // console.error("success status === > ", res);
154   - // this.goodsList = res.data.data;
155   - // // console.log('res.data', res.data);
156   - // // this.text = 'request success';
157   - // },
158   - // fail: res => {
159   - // console.log("fail status === > ", res);
160   - // },
161   - // complete: res => {
162   - // console.log("complete status === > ", res);
163   - // }
164   - // });
  141 + store.dispatch('categoryOrder/fetch')
  142 +
165 143 //定时器模拟ajax异步请求数据
166   - // setTimeout(()=>{
167   - // //传入defaultSelected的结构不能错,错了就报错运行异常。 不选中的项目传入null
168   - // this.filterDropdownValue = [
169   - // [1,1,0], //第0个菜单选中 一级菜单的第1项,二级菜单的第1项,三级菜单的第3项
170   - // [null,null], //第1个菜单选中 都不选中
171   - // [1], //第2个菜单选中 一级菜单的第1项
172   - // [[0],[1,2,7],[1,0]], //筛选菜单选中 第一个筛选的第0项,第二个筛选的第1,2,7项,第三个筛选的第1,0项
173   - // [[0],[1],[1]], //单选菜单选中 第一个筛选的第0项,第二个筛选的第1项,第三个筛选的第1项
174   - // ];
  144 + setTimeout(()=>{
  145 + //传入defaultSelected的结构不能错,错了就报错运行异常。 不选中的项目传入null
  146 + // this.filterDropdownValue = [
  147 + // [1,1,0], //第0个菜单选中 一级菜单的第1项,二级菜单的第1项,三级菜单的第3项
  148 + // [null,null], //第1个菜单选中 都不选中
  149 + // [1], //第2个菜单选中 一级菜单的第1项
  150 + // [[0],[1,2,7],[1,0]], //筛选菜单选中 第一个筛选的第0项,第二个筛选的第1,2,7项,第三个筛选的第1,0项
  151 + // [[0],[1],[1]], //单选菜单选中 第一个筛选的第0项,第二个筛选的第1项,第三个筛选的第1项
  152 + // ];
175 153 // this.filterData = data;
176   - // },100);
177   - // 模拟ajax请求子菜单数据。
178   - // setTimeout(()=>{
179   - // console.log('发起请求','ddddddd');
180   - // // this.filterData[1].submenu[0].submenu = [{"name": "附近","value": "附近"},{"name": "1km","value": "1km"},{"name": "2km","value": "2km"},{"name": "3km","value": "3km"},{"name": "4km","value": "4km"},{"name": "5km","value": "5km"}];
181   - // },3000);
  154 + },100);
182 155 },
183 156 methods: {
184 157 showDrawer(e) {
... ... @@ -210,36 +183,7 @@ export default {
210 183 };
211 184 }
212 185 },
213   - onNavigationBarButtonTap(e) {
214   - this.showRight = !this.showRight;
215   - },
216   - //上拉加载,
217   - onReachBottom() {
218   - console.log("到底加载");
219   - let len = this.goodsList.length;
220   - if (len >= 30) {
221   - this.loadingText = "~~到底了~~";
222   - return false;
223   - } else {
224   - this.loadingText = "正在加载...";
225   - }
226   - let end_goods_id = this.goodsList[len - 1].goods_id;
227   - for (let i = 1; i <= 10; i++) {
228   - let goods_id = end_goods_id + i;
229   - let p = {
230   - goods_id: goods_id,
231   - img:
232   - "/static/img/goods/p" +
233   - (goods_id % 10 == 0 ? 10 : goods_id % 10) +
234   - ".jpg",
235   - name: "商品名称",
236   - originCost: "¥198",
237   - price: "¥168",
238   - slogan: "1235人付款"
239   - };
240   - this.goodsList.push(p);
241   - }
242   - }
  186 +
243 187 };
244 188 </script>
245 189  
... ...
src/pages/myOrder/myOrder.vue
... ... @@ -55,6 +55,7 @@
55 55 // ],
56 56 };
57 57 },
  58 +
58 59 onLoad: function() {
59 60 store.dispatch('myOrder/getList', {
60 61 uid: "1",
... ...
src/pages/myOrderPaying/myOrderPaying.vue
1 1 <template>
  2 +
2 3 <view class="content">
3 4 <view class="order-hr"></view>
4 5 <view class="order-time">
... ...
src/pages/user/user.vue
... ... @@ -93,7 +93,7 @@
93 93 methods: {
94 94 toMyOrder(){
95 95 uni.navigateTo({
96   - url: '../myOrder/myOrder',
  96 + url: '../myOrder/myOrder?current=0',
97 97 success: res => {},
98 98 fail: () => {},
99 99 complete: () => {}
... ... @@ -101,7 +101,7 @@
101 101 },
102 102 toPredelivery(){
103 103 uni.navigateTo({
104   - url: '../predelivery/predelivery',
  104 + url: '../myOrder/myOrder?current=2',
105 105 success: res => {},
106 106 fail: () => {},
107 107 complete: () => {}
... ... @@ -109,7 +109,7 @@
109 109 },
110 110 toMyOrderPaying(){
111 111 uni.navigateTo({
112   - url: '../myorderPaying/myorderPaying',
  112 + url: '../myOrder/myOrder?current=1',
113 113 success: res => {},
114 114 fail: () => {},
115 115 complete: () => {}
... ...
src/store/modules/categoryOrder.js
... ... @@ -0,0 +1,40 @@
  1 + import urlAlias from '../url';
  2 + import request from '../request';
  3 +
  4 + const {
  5 + category
  6 + } = urlAlias;
  7 +
  8 +const state = {
  9 + categoryList: [],
  10 +};
  11 +
  12 +const mutations = {
  13 + INIT: (state, categoryList) => {
  14 + state.categoryList = categoryList;
  15 + },
  16 +};
  17 +
  18 +const actions = {
  19 + fetch({ commit }, param) {
  20 + request({
  21 + url: category,
  22 + success: (res) => {
  23 + commit('INIT', res.data.data)
  24 + },
  25 + fail: (res) => {
  26 + console.log("fail status === > ", res);
  27 + },
  28 + complete: (res) => {
  29 + console.log("complete status === > ", res);
  30 + },
  31 + })
  32 + },
  33 +};
  34 +
  35 +export default {
  36 + namespaced: true,
  37 + state,
  38 + mutations,
  39 + actions,
  40 +};
... ...
1 1 const urlAlias = {
2   - // 首页
3   - shopList: '/app/prod/list', // 获取首页商品列表
4   -
5   -
6   -
7   - // 我的订单
8   - orderList: '/app/order/list', // 获取订单列表
  2 + // 获取首页商品列表
  3 + shopList: '/app/prod/list',
  4 +
  5 + // 获取首页商品列表
  6 + category: '/app/prod/category',
9 7 }
10 8  
11 9 export default urlAlias;
... ...