Commit 7d2bdf29ee81628d1b9f40eff269bf99d983075e

Authored by 喻鹏
Exists in master

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

src/components/CommodityCard/CommodityCard.vue
1 <template> 1 <template>
2 <view class="card" @tap="toGoods(goods.goods_id)"> 2 <view class="card" @tap="toGoods(goods.goods_id,goods.goodType)">
3 <image mode="widthFix" :src="goods.img" ></image> 3 <image mode="widthFix" :src="goods.img" ></image>
4 <view class="name">{{goods.name}}</view> 4 <view class="name">{{goods.name}}</view>
5 <view class="info"> 5 <view class="info">
6 <view class="priceBox"> 6 <view class="priceBox">
7 <view class="price">{{goods.price}}</view> 7 <view class="price">{{goods.price}}</view>
8 <view class="originCost"> 8 <view class="originCost">
9 {{goods.originCost}} 9 {{goods.originCost}}
10 </view> 10 </view>
11 </view> 11 </view>
12 <view class="slogan">{{goods.slogan}}</view> 12 <view class="slogan">{{goods.slogan}}</view>
13 </view> 13 </view>
14 </view> 14 </view>
15 </template> 15 </template>
16 16
17 <script> 17 <script>
18 export default { 18 export default {
19 props: { 19 props: {
20 /** 20 /**
21 * 商品数据 21 * 商品数据
22 */ 22 */
23 goods: { 23 goods: {
24 goods_id: Number, 24 goods_id: Number,
25 img: String, 25 img: String,
26 name: String, 26 name: String,
27 originCost:String, 27 originCost:String,
28 price: String, 28 price: String,
29 slogan:String 29 slogan:String,
30 goodType:String,
30 } 31 }
31 32
32 }, 33 },
33 created() { 34 created() {
34 console.log(this.goods) 35 console.log(this.goods)
35 }, 36 },
36 data() { 37 data() {
37 return { 38 return {
38 39
39 }; 40 };
40 }, 41 },
41 methods:{ 42 methods:{
42 toGoods(id){ 43 toGoods(id,type){
43 console.log('toGoods =====> id======>', id) 44 // console.log('toGoods =====> id======>', id)
44 uni.navigateTo({ 45 // console.log(type)
45 url: `../detail/detail?oderId=1`, 46 switch(type){
46 success: res => {}, 47 case 1:
47 fail: () => {}, 48 uni.navigateTo({
48 complete: () => {} 49 url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type,
49 }); 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 }
53 </script> 85 </script>
54 86
55 <style lang="scss"> 87 <style lang="scss">
56 image{ 88 image{
57 width: 100%; 89 width: 100%;
58 height: 120rpx; 90 height: 120rpx;
59 } 91 }
60 .name{ 92 .name{
61 width: 92%; 93 width: 92%;
62 height: 54rpx; 94 height: 54rpx;
63 padding: 5px 4%; 95 padding: 5px 4%;
64 display: -webkit-box; 96 display: -webkit-box;
65 -webkit-box-orient: vertical; 97 -webkit-box-orient: vertical;
66 -webkit-line-clamp: 2; 98 -webkit-line-clamp: 2;
67 text-align: justify; 99 text-align: justify;
68 overflow: hidden; 100 overflow: hidden;
69 font-size: 24rpx; 101 font-size: 24rpx;
70 color: #333333; 102 color: #333333;
71 } 103 }
72 .info{ 104 .info{
73 display: flex; 105 display: flex;
74 justify-content: space-between; 106 justify-content: space-between;
75 align-items: center; 107 align-items: center;
76 width: 92%; 108 width: 92%;
77 padding: 5px 4% 5px 4%; 109 padding: 5px 4% 5px 4%;
78 .priceBox{ 110 .priceBox{
79 display: flex; 111 display: flex;
80 justify-content: space-between; 112 justify-content: space-between;
81 align-items: center; 113 align-items: center;
82 .price{ 114 .price{
83 color: #EB5D3B; 115 color: #EB5D3B;
84 font-size: 28rpx; 116 font-size: 28rpx;
85 font-weight: 600; 117 font-weight: 600;
86 margin-right: 10rpx; 118 margin-right: 10rpx;
87 } 119 }
88 .originCost{ 120 .originCost{
89 text-decoration:line-through; 121 text-decoration:line-through;
90 color: #999999; 122 color: #999999;
91 font-size: 20rpx; 123 font-size: 20rpx;
92 } 124 }
93 125
94 } 126 }
95 .slogan{ 127 .slogan{
96 color: #999999; 128 color: #999999;
97 font-size: 20rpx; 129 font-size: 20rpx;
98 } 130 }
99 } 131 }
100 </style> 132 </style>
src/components/UniCollapseItem/UniCollapseItem.vue
1 <template> 1 <template>
2 <view :class="{ 'uni-collapse-cell--disabled': disabled,'uni-collapse-cell--notdisabled': !disabled, 'uni-collapse-cell--open': isOpen,'uni-collapse-cell--hide':!isOpen }" 2 <view :class="{ 'uni-collapse-cell--disabled': disabled,'uni-collapse-cell--notdisabled': !disabled, 'uni-collapse-cell--open': isOpen,'uni-collapse-cell--hide':!isOpen }"
3 class="uni-collapse-cell"> 3 class="uni-collapse-cell">
4 <view class="uni-collapse-cell__title" @click="onClick"> 4 <view class="uni-collapse-cell__title" @click="onClick">
5 <image v-if="thumb" :src="thumb" class="uni-collapse-cell__title-img" /> 5 <image v-if="thumb" :src="thumb" class="uni-collapse-cell__title-img" />
6 <text class="uni-collapse-cell__title-text">{{ title }}</text> 6 <text class="uni-collapse-cell__title-text">{{ title }}</text>
7 <!-- #ifdef MP-ALIPAY --> 7 <!-- #ifdef MP-ALIPAY -->
8 <view :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }" 8 <view :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }"
9 class="uni-collapse-cell__title-arrow"> 9 class="uni-collapse-cell__title-arrow">
10 <uni-icons color="#bbb" size="20" type="arrowdown" /> 10 <uni-icons color="#bbb" size="20" type="arrowdown" />
11 </view> 11 </view>
12 <!-- #endif --> 12 <!-- #endif -->
13 <!-- #ifndef MP-ALIPAY --> 13 <!-- #ifndef MP-ALIPAY -->
14 <uni-icons :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }" 14 <uni-icons :class="{ 'uni-collapse-cell__title-arrow-active': isOpen, 'uni-collapse-cell--animation': showAnimation === true }"
15 class="uni-collapse-cell__title-arrow" color="#bbb" size="20" type="arrowdown" /> 15 class="uni-collapse-cell__title-arrow" color="#bbb" size="20" type="arrowdown" />
16 <!-- #endif --> 16 <!-- #endif -->
17 </view> 17 </view>
18 <view :class="{'uni-collapse-cell__content--hide':!isOpen}" class="uni-collapse-cell__content"> 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 <slot /> 22 <slot />
21 </view> 23 </view>
22 </view> 24 </view>
23 </view> 25 </view>
24 </template> 26 </template>
25 27
26 <script> 28 <script>
27 import UniIcons from '../UniIcons/UniIcons.vue' 29 import UniIcons from '../UniIcons/UniIcons.vue'
28 export default { 30 export default {
29 name: 'UniCollapseItem', 31 name: 'UniCollapseItem',
30 components: { 32 components: {
31 UniIcons 33 UniIcons
32 }, 34 },
33 props: { 35 props: {
34 title: { 36 title: {
35 // 列表标题 37 // 列表标题
36 type: String, 38 type: String,
37 default: '' 39 default: ''
38 }, 40 },
39 name: { 41 name: {
40 // 唯一标识符 42 // 唯一标识符
41 type: [Number, String], 43 type: [Number, String],
42 default: 0 44 default: 0
43 }, 45 },
44 disabled: { 46 disabled: {
45 // 是否禁用 47 // 是否禁用
46 type: Boolean, 48 type: Boolean,
47 default: false 49 default: false
48 }, 50 },
49 showAnimation: { 51 showAnimation: {
50 // 是否显示动画 52 // 是否显示动画
51 type: Boolean, 53 type: Boolean,
52 default: false 54 default: false
53 }, 55 },
54 open: { 56 open: {
55 // 是否展开 57 // 是否展开
56 type: Boolean, 58 type: Boolean,
57 default: false 59 default: false
58 }, 60 },
59 thumb: { 61 thumb: {
60 // 缩略图 62 // 缩略图
61 type: String, 63 type: String,
62 default: '' 64 default: ''
63 } 65 }
64 }, 66 },
65 data() { 67 data() {
66 return { 68 return {
67 isOpen: false 69 isOpen: false
68 } 70 }
69 }, 71 },
70 watch: { 72 watch: {
71 open(val) { 73 open(val) {
72 this.isOpen = val 74 this.isOpen = val
73 } 75 }
74 }, 76 },
75 inject: ['collapse'], 77 inject: ['collapse'],
76 created() { 78 created() {
77 this.isOpen = this.open 79 this.isOpen = this.open
78 this.nameSync = this.name ? this.name : this.collapse.childrens.length 80 this.nameSync = this.name ? this.name : this.collapse.childrens.length
79 this.collapse.childrens.push(this) 81 this.collapse.childrens.push(this)
80 if (String(this.collapse.accordion) === 'true') { 82 if (String(this.collapse.accordion) === 'true') {
81 if (this.isOpen) { 83 if (this.isOpen) {
82 let lastEl = this.collapse.childrens[this.collapse.childrens.length - 2] 84 let lastEl = this.collapse.childrens[this.collapse.childrens.length - 2]
83 if (lastEl) { 85 if (lastEl) {
84 this.collapse.childrens[this.collapse.childrens.length - 2].isOpen = false 86 this.collapse.childrens[this.collapse.childrens.length - 2].isOpen = false
85 } 87 }
86 } 88 }
87 } 89 }
88 }, 90 },
89 methods: { 91 methods: {
90 onClick() { 92 onClick() {
91 if (this.disabled) { 93 if (this.disabled) {
92 return 94 return
93 } 95 }
94 if (String(this.collapse.accordion) === 'true') { 96 if (String(this.collapse.accordion) === 'true') {
95 this.collapse.childrens.forEach(vm => { 97 this.collapse.childrens.forEach(vm => {
96 if (vm === this) { 98 if (vm === this) {
97 return 99 return
98 } 100 }
99 vm.isOpen = false 101 vm.isOpen = false
100 }) 102 })
101 } 103 }
102 this.isOpen = !this.isOpen 104 this.isOpen = !this.isOpen
103 this.collapse.onChange && this.collapse.onChange() 105 this.collapse.onChange && this.collapse.onChange()
104 this.$forceUpdate() 106 this.$forceUpdate()
105 console.log(this.isOpen) 107 console.log(this.isOpen)
106 } 108 }
107 } 109 }
108 } 110 }
109 </script> 111 </script>
110 112
111 <style lang="scss" scoped> 113 <style lang="scss" scoped>
112 @import '@/uni.scss'; 114 @import '@/uni.scss';
113 115
114 .uni-collapse-cell { 116 .uni-collapse-cell {
115 flex-direction: column; 117 flex-direction: column;
116 border-color: #FFFFFF; 118 border-color: #FFFFFF;
117 border-bottom-width: 1px; 119 border-bottom-width: 1px;
118 border-bottom-style: solid; 120 border-bottom-style: solid;
119 } 121 }
120 122
121 123
122 .uni-collapse-cell--hover { 124 .uni-collapse-cell--hover {
123 background-color: #FFFFFF; 125 background-color: #FFFFFF;
124 } 126 }
125 127
126 .uni-collapse-cell--open { 128 .uni-collapse-cell--open {
127 background-color: #FFFFFF; 129 background-color: #FFFFFF;
128 } 130 }
129 131
130 .uni-collapse-cell--disabled { 132 .uni-collapse-cell--disabled {
131 background-color: #FFFFFF; 133 background-color: #FFFFFF;
132 // opacity: 0.3; 134 // opacity: 0.3;
133 } 135 }
134 136
135 137
136 .uni-collapse-cell--hide { 138 .uni-collapse-cell--hide {
137 height: 48px; 139 height: 48px;
138 } 140 }
139 141
140 .uni-collapse-cell--animation { 142 .uni-collapse-cell--animation {
141 transition: transform 0.5s ease; 143 transition: transform 0s ease;
142 transition-property: transform; 144 transition-property: transform;
143 transition-duration: 0.5s; 145 transition-duration: 0s;
144 transition-timing-function: ease; 146 transition-timing-function: ease;
145 } 147 }
146 148
147 .uni-collapse-cell__title { 149 .uni-collapse-cell__title {
148 // padding: 12px 12px; 150 // padding: 12px 12px;
149 font-size: 16px; 151 font-size: 16px;
150 color: #333333; 152 color: #333333;
151 position: relative; 153 position: relative;
152 /* #ifndef APP-NVUE */ 154 /* #ifndef APP-NVUE */
153 display: flex; 155 display: flex;
154 width: 100%; 156 width: 100%;
155 box-sizing: border-box; 157 box-sizing: border-box;
156 /* #endif */ 158 /* #endif */
157 height: 48px; 159 height: 48px;
158 line-height: 24px; 160 line-height: 24px;
159 flex-direction: row; 161 flex-direction: row;
160 justify-content: space-between; 162 justify-content: space-between;
161 align-items: center; 163 align-items: center;
162 } 164 }
163 165
164 .uni-collapse-cell__title:active { 166 .uni-collapse-cell__title:active {
165 background-color: #FFFFFF; 167 background-color: #FFFFFF;
166 } 168 }
167 169
168 .uni-collapse-cell__title-img { 170 .uni-collapse-cell__title-img {
169 height: $uni-img-size-base; 171 height: $uni-img-size-base;
170 width: $uni-img-size-base; 172 width: $uni-img-size-base;
171 margin-right: 10px; 173 margin-right: 10px;
172 } 174 }
173 175
174 .uni-collapse-cell__title-arrow { 176 .uni-collapse-cell__title-arrow {
175 width: 20px; 177 width: 20px;
176 height: 20px; 178 height: 20px;
177 transform: rotate(0deg); 179 transform: rotate(0deg);
178 transform-origin: center center; 180 transform-origin: center center;
179 181
180 } 182 }
181 183
182 .uni-collapse-cell__title-arrow-active { 184 .uni-collapse-cell__title-arrow-active {
183 transform: rotate(180deg); 185 transform: rotate(180deg);
184 } 186 }
185 187
186 .uni-collapse-cell__title-text { 188 .uni-collapse-cell__title-text {
187 flex: 1; 189 flex: 1;
188 font-size: $uni-font-size-base; 190 font-size: $uni-font-size-base;
189 /* #ifndef APP-NVUE */ 191 /* #ifndef APP-NVUE */
190 white-space: nowrap; 192 white-space: nowrap;
191 color: inherit; 193 color: inherit;
192 /* #endif */ 194 /* #endif */
193 /* #ifdef APP-NVUE */ 195 /* #ifdef APP-NVUE */
194 lines: 1; 196 lines: 1;
195 /* #endif */ 197 /* #endif */
196 overflow: hidden; 198 overflow: hidden;
197 text-overflow: ellipsis; 199 text-overflow: ellipsis;
198 } 200 }
199 201
200 .uni-collapse-cell__content { 202 .uni-collapse-cell__content {
201 overflow: hidden; 203 overflow: hidden;
202 } 204 }
203 205
204 .uni-collapse-cell__wrapper { 206 .uni-collapse-cell__wrapper {
205 /* #ifndef APP-NVUE */ 207 /* #ifndef APP-NVUE */
206 display: flex; 208 display: flex;
207 /* #endif */ 209 /* #endif */
208 flex-direction: column; 210 flex-direction: column;
209 } 211 }
210 212
211 .uni-collapse-cell__content--hide { 213 .uni-collapse-cell__content--hide {
212 // height: 0px; 214 // height: 0px;
213 // line-height: 0px; 215 // line-height: 0px;
214 } 216 }
215 </style> 217 </style>
216 218
1 { 1 {
2 "pages" : [ 2 "pages" : [
3 { 3 {
4 "path" : "pages/myOrder/myOrder", 4 "path" : "pages/myOrder/myOrder",
5 "style" : { 5 "style" : {
6 "navigationBarTitleText" : "我的订单" 6 "navigationBarTitleText" : "我的订单"
7 } 7 }
8 }, 8 },
9 { 9 {
10 "path" : "pages/cart/cart", 10 "path" : "pages/cart/cart",
11 "style" : { 11 "style" : {
12 "navigationBarTitleText" : "购物车" 12 "navigationBarTitleText" : "购物车"
13 } 13 }
14 }, 14 },
15 { 15 {
16 "path" : "pages/index/index", 16 "path" : "pages/index/index",
17 "style" : { 17 "style" : {
18 "navigationBarTitleText" : "商城一览" 18 "navigationBarTitleText" : "商城一览"
19 } 19 }
20 }, 20 },
21 { 21 {
22 "path" : "pages/frameDetail/frameDetail", 22 "path" : "pages/frameDetail/frameDetail",
23 "style" : { 23 "style" : {
24 "navigationBarTitleText" : "产品详情" 24 "navigationBarTitleText" : "产品详情"
25 } 25 }
26 }, 26 },
27 { 27 {
28 "path" : "pages/lensDetails/lensDetails", 28 "path" : "pages/lensDetails/lensDetails",
29 "style" : { 29 "style" : {
30 "navigationBarTitleText" : "产品详情" 30 "navigationBarTitleText" : "产品详情"
31 } 31 }
32 }, 32 },
33 { 33 {
34 "path" : "pages/purchaseLenses/purchaseLenses", 34 "path" : "pages/purchaseLenses/purchaseLenses",
35 "style" : { 35 "style" : {
36 "navigationBarTitleText" : "产品选购" 36 "navigationBarTitleText" : "产品选购"
37 } 37 }
38 }, 38 },
39 { 39 {
40 "path" : "pages/refundProgress/refundProgress", 40 "path" : "pages/refundProgress/refundProgress",
41 "style" : { 41 "style" : {
42 "navigationBarTitleText" : "申请退款" 42 "navigationBarTitleText" : "申请退款"
43 } 43 }
44 }, 44 },
45 { 45 {
46 "path" : "pages/addAddress/addAddress", 46 "path" : "pages/addAddress/addAddress",
47 "style" : { 47 "style" : {
48 "navigationBarTitleText" : "新增地址" 48 "navigationBarTitleText" : "新增地址"
49 } 49 }
50 }, 50 },
51 { 51 {
52 "path" : "pages/confirmOrder/confirmOrder", 52 "path" : "pages/confirmOrder/confirmOrder",
53 "style" : { 53 "style" : {
54 "navigationBarTitleText" : "确认订单" 54 "navigationBarTitleText" : "确认订单"
55 } 55 }
56 }, 56 },
57 { 57 {
58 "path" : "pages/user/user", 58 "path" : "pages/user/user",
59 "style" : { 59 "style" : {
60 "navigationBarTitleText" : "我的" 60 "navigationBarTitleText" : "我的"
61 } 61 }
62 }, 62 },
63 { 63 {
64 "path" : "pages/refundment/refundWays" 64 "path" : "pages/refundment/refundWays"
65 }, 65 },
66 { 66 {
67 "path" : "pages/refundment/refundment" 67 "path" : "pages/refundment/refundment"
68 }, 68 },
69 { 69 {
70 "path" : "pages/predelivery/predelivery" 70 "path" : "pages/predelivery/predelivery"
71 }, 71 },
72 { 72 {
73 "path" : "pages/customerService/customerService", 73 "path" : "pages/customerService/customerService",
74 "style" : { 74 "style" : {
75 "navigationBarTitleText" : "在线客服" 75 "navigationBarTitleText" : "在线客服"
76 } 76 }
77 }, 77 },
78 { 78 {
79 "path" : "pages/myOrderPaying/myOrderPaying", 79 "path" : "pages/myOrderPaying/myOrderPaying",
80 "style" : { 80 "style" : {
81 "navigationBarTitleText" : "我的订单" 81 "navigationBarTitleText" : "我的订单"
82 } 82 }
83 }, 83 },
84 { 84 {
85 "path" : "pages/detailsChoiceArgs/detailsChoiceArgs", 85 "path" : "pages/detailsChoiceArgs/detailsChoiceArgs",
86 "style" : { 86 "style" : {
87 "navigationBarTitleText" : "镜片名称名称" 87 "navigationBarTitleText" : "镜片名称名称"
88 } 88 }
89 }, 89 },
90 { 90 {
91 "path" : "pages/detailStandard/detailStandard_sun", 91 "path" : "pages/detailStandard/detailStandard_sun",
92 "style" : { 92 "style" : {
93 "navigationBarTitleText" : "太阳镜选购页" 93 "navigationBarTitleText" : "太阳镜选购页"
94 } 94 }
95 }, 95 },
96 { 96 {
97 "path" : "pages/detailStandard/detailStandard_k", 97 "path" : "pages/detailStandard/detailStandard_k",
98 "style" : { 98 "style" : {
99 "navigationBarTitleText" : "镜框选购页" 99 "navigationBarTitleText" : "镜框选购页"
100 } 100 }
101 }, 101 }
102 { 102 ],
103 "path" : "pages/detailsChoiceArgs/compoents/MyCollapse", 103 "globalStyle" : {
104 "style" : {} 104 "navigationBarTextStyle" : "black",
105 } 105 "navigationBarTitleText" : "uni-app",
106 ], 106 "navigationBarBackgroundColor" : "#F8F8F8",
107 "globalStyle" : { 107 "backgroundColor" : "#F8F8F8"
108 "navigationBarTextStyle" : "black", 108 },
109 "navigationBarTitleText" : "uni-app", 109 "tabBar" : {
110 "navigationBarBackgroundColor" : "#F8F8F8", 110 "color" : "#C0C4CC",
111 "backgroundColor" : "#F8F8F8" 111 "selectedColor" : "#fa436a",
112 }, 112 "borderStyle" : "black",
113 "tabBar" : { 113 "backgroundColor" : "#ffffff",
114 "color" : "#C0C4CC", 114 "list" : [
115 "selectedColor" : "#fa436a", 115 {
116 "borderStyle" : "black", 116 "pagePath" : "pages/index/index",
117 "backgroundColor" : "#ffffff", 117 "iconPath" : "static/tab-home.png",
118 "list" : [ 118 "selectedIconPath" : "static/tab-home-current.png",
119 { 119 "text" : "首页"
120 "pagePath" : "pages/index/index", 120 },
121 "iconPath" : "static/tab-home.png", 121 {
122 "selectedIconPath" : "static/tab-home-current.png", 122 "pagePath" : "pages/cart/cart",
123 "text" : "首页" 123 "iconPath" : "static/tab-cart.png",
124 }, 124 "selectedIconPath" : "static/tab-cart-current.png",
125 { 125 "text" : "购物车"
126 "pagePath" : "pages/cart/cart", 126 },
127 "iconPath" : "static/tab-cart.png", 127 {
128 "selectedIconPath" : "static/tab-cart-current.png", 128 "pagePath" : "pages/user/user",
129 "text" : "购物车" 129 "iconPath" : "static/tab-my.png",
130 }, 130 "selectedIconPath" : "static/tab-my-current.png",
131 { 131 "text" : "我的"
132 "pagePath" : "pages/user/user", 132 }
133 "iconPath" : "static/tab-my.png", 133 ]
134 "selectedIconPath" : "static/tab-my-current.png", 134 },
135 "text" : "我的" 135 "condition" : {
136 } 136 //模式配置,仅开发期间生效
137 ] 137 "current" : 0, //当前激活的模式(list 的索引项)
138 }, 138 "list" : [
139 "condition" : { 139 {
140 //模式配置,仅开发期间生效 140 "name" : "", //模式名称
141 "current" : 0, //当前激活的模式(list 的索引项) 141 "path" : "", //启动页面,必选
142 "list" : [ 142 "query" : "" //启动参数,在页面的onLoad函数里面得到
143 { 143 }
144 "name" : "", //模式名称 144 ]
145 "path" : "", //启动页面,必选
146 "query" : "" //启动参数,在页面的onLoad函数里面得到
147 }
148 ]
149 }
150 }
151 145 }
src/pages/frameDetail/frameDetail.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 <view class="D1"> 3 <view class="D1">
4 <!-- 轮播图 --> 4 <!-- 轮播图 -->
5 <swiper class="swiperImage" :indicator-dots="true" :autoplay="true" :interval="4000" :duration="500" > 5 <swiper class="swiperImage" :indicator-dots="true" :autoplay="true" :interval="4000" :duration="500" >
6 <swiper-item v-for="(item) in infos" :key="item.goods_id"> 6 <swiper-item v-for="(item) in infos" :key="item.goods_id">
7 <image :src="item.img" mode="scaleToFill"></image> 7 <image :src="item.img" mode="scaleToFill"></image>
8 </swiper-item> 8 </swiper-item>
9 </swiper> 9 </swiper>
10 <view class="D1_price">¥{{price}}</view> 10 <view class="D1_price">¥{{price}}</view>
11 <view class="D1_name"><span class="D1_name1">{{name}}</span><span class="D1_number">{{number}}购买过</span></view> 11 <view class="D1_name"><span class="D1_name1">{{name}}</span><span class="D1_number">{{number}}购买过</span></view>
12 <view class="D1_spans"><span>支持7天无理由退货</span><span>顺丰发货</span><span>30天质量保证</span></view> 12 <view class="D1_spans"><span>支持7天无理由退货</span><span>顺丰发货</span><span>30天质量保证</span></view>
13 </view> 13 </view>
14 <view class="D2" v-if="goodType === 0 || goodType === 3"> 14 <view class="D2" v-if="updateGoodType == 2 || updateGoodType == 4">
15 <view><span class="D2_span1">框架材质:</span><span class="D2_span2">{{introduction.material}}</span></view> 15 <view><span class="D2_span1">框架材质:</span><span class="D2_span2">{{introduction.material}}</span></view>
16 <view><span class="D2_span1">风格:</span><span class="D2_span2">{{introduction.func}}</span></view> 16 <view><span class="D2_span1">风格:</span><span class="D2_span2">{{introduction.func}}</span></view>
17 <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view> 17 <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view>
18 </view> 18 </view>
19 <view class="D2" v-if="goodType === 1"> 19 <view class="D2" v-if="updateGoodType == 1">
20 <view><span class="D2_span1">镜片材质:</span><span class="D2_span2">{{introduction.material}}</span></view> 20 <view><span class="D2_span1">镜片材质:</span><span class="D2_span2">{{introduction.material}}</span></view>
21 <view><span class="D2_span1">功能:</span><span class="D2_span2">{{introduction.func}}</span></view> 21 <view><span class="D2_span1">功能:</span><span class="D2_span2">{{introduction.func}}</span></view>
22 <view><span class="D2_span1">使用场景:</span><span class="D2_span2">{{introduction.rate}}</span></view> 22 <view><span class="D2_span1">使用场景:</span><span class="D2_span2">{{introduction.rate}}</span></view>
23 </view> 23 </view>
24 <view class="D2" v-if="goodType === 2"> 24 <view class="D2" v-if="updateGoodType == 3">
25 <view><span class="D2_span1">材质:</span><span class="D2_span2">{{introduction.material}}</span></view> 25 <view><span class="D2_span1">材质:</span><span class="D2_span2">{{introduction.material}}</span></view>
26 <view><span class="D2_span1">直径/基弧:</span><span class="D2_span2">{{introduction.func}}</span></view> 26 <view><span class="D2_span1">直径/基弧:</span><span class="D2_span2">{{introduction.func}}</span></view>
27 <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view> 27 <view><span class="D2_span1">适用性别:</span><span class="D2_span2">{{introduction.rate}}</span></view>
28 </view> 28 </view>
29 29
30 <view class="D3"> 30 <view class="D3">
31 <view class="screenBar"> 31 <view class="screenBar">
32 <view v-for="item in screenItems" :key="item.current" @click="tabChange(item.current)" > 32 <view v-for="item in screenItems" :key="item.current" @click="tabChange(item.current)" >
33 <view class="screenItem" v-bind:class="{ active: current === item.current }">{{ item.text }}</view> 33 <view class="screenItem" v-bind:class="{ active: current === item.current }">{{ item.text }}</view>
34 </view> 34 </view>
35 </view> 35 </view>
36 <view class="screen-item " v-if="current ===0"> 36 <view class="screen-item " v-if="current ===0">
37 <view class="D3_list"> 37 <view class="D3_list">
38 <view v-for="(item) in parameter" :key="item.key"> 38 <view v-for="(item) in parameter" :key="item.key">
39 <image class="D3_image" v-bind:src = "item.img"></image> 39 <image class="D3_image" v-bind:src = "item.img"></image>
40 <span>{{item.standard}}</span> 40 <span>{{item.standard}}</span>
41 <span>{{item.slength}}</span> 41 <span>{{item.slength}}</span>
42 </view> 42 </view>
43 </view> 43 </view>
44 </view > 44 </view >
45 <view class="screen-item " v-if="current ===1"> 45 <view class="screen-item " v-if="current ===1">
46 <view class="D3_list"> 46 <view class="D3_list">
47 <view>主体</view> 47 <view>主体</view>
48 <view>商品产地:韩国</view> 48 <view>商品产地:韩国</view>
49 <view>包装清单:彩色隐形 * 1</view> 49 <view>包装清单:彩色隐形 * 1</view>
50 </view> 50 </view>
51 </view > 51 </view >
52 <view class="screen-item " v-if="current ===2"> 52 <view class="screen-item " v-if="current ===2">
53 <view class="customerService"> 53 <view class="customerService">
54 <view class="serviceItem" > 54 <view class="serviceItem" >
55 <view class="title"> 55 <view class="title">
56 <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> 56 <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view>
57 <text class="titleText">卖家服务</text> 57 <text class="titleText">卖家服务</text>
58 </view> 58 </view>
59 <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验</view> 59 <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验</view>
60 </view> 60 </view>
61 <view class="serviceItem" > 61 <view class="serviceItem" >
62 <view class="title"> 62 <view class="title">
63 <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> 63 <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view>
64 <text class="titleText">平台承诺</text> 64 <text class="titleText">平台承诺</text>
65 </view> 65 </view>
66 <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验阿斯蒂芬的发射点发射点发生的房贷首付的发护法国会国家和国际会更加和</view> 66 <view class="itemContent">平台卖家服务,为您在平台获得最优的购买体验阿斯蒂芬的发射点发射点发生的房贷首付的发护法国会国家和国际会更加和</view>
67 </view> 67 </view>
68 <view class="serviceItem"> 68 <view class="serviceItem">
69 <view class="title"> 69 <view class="title">
70 <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view> 70 <view style="width: 6rpx;height: 6rpx;border-radius: 3rpx;background-color: #FF6B4A;margin-right: 12rpx;"></view>
71 <text class="titleText">正品保证</text> 71 <text class="titleText">正品保证</text>
72 </view> 72 </view>
73 <view class="itemContent">向您保证所售商品均为正品行货</view> 73 <view class="itemContent">向您保证所售商品均为正品行货</view>
74 </view> 74 </view>
75 <view class="serviceItem2"> 75 <view class="serviceItem2">
76 <view class="title"> 76 <view class="title">
77 <text class="titleText">权利申明</text> 77 <text class="titleText">权利申明</text>
78 </view> 78 </view>
79 <view class="itemContent">任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知。</view> 79 <view class="itemContent">任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知。</view>
80 </view> 80 </view>
81 <view class="serviceItem2"> 81 <view class="serviceItem2">
82 <view class="title"> 82 <view class="title">
83 <text class="titleText">价格保证</text> 83 <text class="titleText">价格保证</text>
84 </view> 84 </view>
85 <view class="itemContent"> 85 <view class="itemContent">
86 <view class="itemContent-child"> 86 <view class="itemContent-child">
87 <text class="contentTitle">平台价:</text> 87 <text class="contentTitle">平台价:</text>
88 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> 88 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text>
89 </view> 89 </view>
90 <view class="itemContent-child"> 90 <view class="itemContent-child">
91 <text class="contentTitle">划线价:</text> 91 <text class="contentTitle">划线价:</text>
92 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> 92 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text>
93 </view> 93 </view>
94 <view class="itemContent-child"> 94 <view class="itemContent-child">
95 <text class="contentTitle">平折扣:</text> 95 <text class="contentTitle">平折扣:</text>
96 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> 96 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text>
97 </view> 97 </view>
98 <view class="itemContent-child"> 98 <view class="itemContent-child">
99 <text class="contentTitle">异常问题:</text> 99 <text class="contentTitle">异常问题:</text>
100 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text> 100 <text>任何个人或单位如果同时符合以下两个条件:1. 权利人发现网络用户利用网络服务侵害其合法权益;2. 百度的搜索引擎系统以自动检索方式而链接到第三方网站的内容侵犯了上述权利人的合法权益。请上述个人或单位务必以书面的通讯方式向百度提交权利通知</text>
101 </view> 101 </view>
102 102
103 </view> 103 </view>
104 </view> 104 </view>
105 </view> 105 </view>
106 </view > 106 </view >
107 </view> 107 </view>
108 <view class="D4" v-if="current !==2"> 108 <view class="D4" v-if="current !==2">
109 <view class="D4_esvalue"> 109 <view class="D4_esvalue">
110 <view>{{esvalue}}</view> 110 <view>{{esvalue}}</view>
111 <view class="D4_2"> 111 <view class="D4_2">
112 <view class="star" v-for="o in starCount" :key="o"> 112 <view class="star" v-for="o in starCount" :key="o">
113 <image src="../../static/img/detail/d_star.png" mode="aspectFill" style="height: 26rpx; width: 28rpx;"></image> 113 <image src="../../static/img/detail/d_star.png" mode="aspectFill" style="height: 26rpx; width: 28rpx;"></image>
114 </view> 114 </view>
115 </view> 115 </view>
116 </view> 116 </view>
117 <view class="D4_list"> 117 <view class="D4_list">
118 <view v-for="(assess) in assess" :key="assess.key">{{assess.Iassess}}</view> 118 <view v-for="(assess) in assess" :key="assess.key">{{assess.Iassess}}</view>
119 </view> 119 </view>
120 </view> 120 </view>
121 <view class="D5" v-if="current !==2"> 121 <view class="D5" v-if="current !==2">
122 <view class="D5_fixed1"> 122 <view class="D5_fixed1">
123 <image src="/static/img/detail/hr.png"></image> 123 <image src="/static/img/detail/hr.png"></image>
124 <view>商品详细</view> 124 <view>商品详细</view>
125 <image src="/static/img/detail/hr.png"></image> 125 <image src="/static/img/detail/hr.png"></image>
126 </view> 126 </view>
127 <view class="D5_all"> 127 <view class="D5_all">
128 <image v-bind:src="imgAll"></image> 128 <image v-bind:src="imgAll"></image>
129 </view> 129 </view>
130 <view class="D5_photoes"> 130 <view class="D5_photoes">
131 <view class="D5_photoes1"> 131 <view class="D5_photoes1">
132 <view v-for="(photoes) in photoes" :key="photoes.value"> 132 <view v-for="(photoes) in photoes" :key="photoes.value">
133 <image v-bind:src = "photoes.img"></image> 133 <image v-bind:src = "photoes.img"></image>
134 <view>{{photoes.value}}</view> 134 <view>{{photoes.value}}</view>
135 </view> 135 </view>
136 </view> 136 </view>
137 <view class="D5_logo1">帕森防蓝光镜片</view> 137 <view class="D5_logo1">帕森防蓝光镜片</view>
138 <view class="D5_logo2">健康护眼,我们是认真的!</view> 138 <view class="D5_logo2">健康护眼,我们是认真的!</view>
139 <view class="D5_logo3"><image src='/static/img/detail/logo.png'></image></view> 139 <view class="D5_logo3"><image src='/static/img/detail/logo.png'></image></view>
140 </view> 140 </view>
141 </view> 141 </view>
142 <view class="D6" v-if="current !==2"> 142 <view class="D6" v-if="current !==2">
143 <view class="D6_v1">CHARM DETAIL</view> 143 <view class="D6_v1">CHARM DETAIL</view>
144 <view class="D6_v2">细节展示</view> 144 <view class="D6_v2">细节展示</view>
145 <view ><image v-bind:src="imgDetail"></image></view> 145 <view ><image v-bind:src="imgDetail"></image></view>
146 <view>........................................................................</view> 146 <view>........................................................................</view>
147 <view class="D6_v5"><span class="D6_v5_s1">优质选材 </span><span class="D6_v5_s2"> / 金属材质 光泽饱满</span></view> 147 <view class="D6_v5"><span class="D6_v5_s1">优质选材 </span><span class="D6_v5_s2"> / 金属材质 光泽饱满</span></view>
148 </view> 148 </view>
149 149
150 <!-- 底部菜单 --> 150 <!-- 底部菜单 -->
151 <view class="botton"> 151 <view class="botton">
152 <view class="botton_1"><image v-bind:src="imgShop.img"></image><view class="botton_image">购物车</view></view> 152 <view class="botton_1"><image v-bind:src="imgShop.img"></image><view class="botton_image">购物车</view></view>
153 <view class="botton_2"> 153 <view class="botton_2">
154 <view class="botton_input">加入购物车</view> 154 <view class="botton_input">加入购物车</view>
155 <view class="botton_now" @click="goPerchase">立即购买</view> 155 <view class="botton_now" @click="goPerchase">立即购买</view>
156 </view> 156 </view>
157 </view> 157 </view>
158 </view> 158 </view>
159 </template> 159 </template>
160 160
161 <script> 161 <script>
162 export default { 162 export default {
163 data(){ 163 data(){
164 return { 164 return {
165 name:'商品名称', 165 name:'商品名称',
166 goodType:1, 166 goodType:2,
167 price: 120, 167 price: 120,
168 number: 391, 168 number: 391,
169 screenItems: [ 169 screenItems: [
170 {current:0,text:'商品保障'}, 170 {current:0,text:'商品保障'},
171 {current:1,text:'规格参数'}, 171 {current:1,text:'规格参数'},
172 {current:2,text:'售后保障'}, 172 {current:2,text:'售后保障'},
173 ], 173 ],
174 current: 0, 174 current: 0,
175 starCount:5, 175 starCount:5,
176 infos: [ 176 infos: [
177 { goods_id: 0, img: '/static/img/goods/p11.png', name: '商品名称', price: '¥168', slogan:'1235人付款' }, 177 { goods_id: 0, img: '/static/img/goods/p11.png', name: '商品名称', price: '¥168', slogan:'1235人付款' },
178 { goods_id: 1, img: '/static/img/goods/p12.png', name: '商品名称', price: '¥168', slogan:'1235人付款' }, 178 { goods_id: 1, img: '/static/img/goods/p12.png', name: '商品名称', price: '¥168', slogan:'1235人付款' },
179 { goods_id: 2, img: '/static/img/goods/p12.png', name: '商品名称', price: '¥168', slogan:'1235人付款' }, 179 { goods_id: 2, img: '/static/img/goods/p12.png', name: '商品名称', price: '¥168', slogan:'1235人付款' },
180 { goods_id: 3, img: '/static/img/goods/p11.png', name: '商品名称', price: '¥168', slogan:'1235人付款' }, 180 { goods_id: 3, img: '/static/img/goods/p11.png', name: '商品名称', price: '¥168', slogan:'1235人付款' },
181 ], 181 ],
182 parameter:[ 182 parameter:[
183 {key: 0,img:'/static/img/detail/d2.png', standard:'框架宽', slength:'139mm'}, 183 {key: 0,img:'/static/img/detail/d2.png', standard:'框架宽', slength:'139mm'},
184 {key: 1,img:'/static/img/detail/d3.png', standard:'镜片宽', slength:'51mm'}, 184 {key: 1,img:'/static/img/detail/d3.png', standard:'镜片宽', slength:'51mm'},
185 {key: 2,img:'/static/img/detail/d4.png', standard:'镜片高', slength:'45mm'}, 185 {key: 2,img:'/static/img/detail/d4.png', standard:'镜片高', slength:'45mm'},
186 {key: 3,img:'/static/img/detail/d5.png', standard:'鼻架宽', slength:'19mm'}, 186 {key: 3,img:'/static/img/detail/d5.png', standard:'鼻架宽', slength:'19mm'},
187 {key: 4,img:'/static/img/detail/d6.png', standard:'框架耳长', slength:'138mm'}, 187 {key: 4,img:'/static/img/detail/d6.png', standard:'框架耳长', slength:'138mm'},
188 {key: 5,img:'/static/img/detail/d7.png', standard:'框架重', slength:'19mm'} 188 {key: 5,img:'/static/img/detail/d7.png', standard:'框架重', slength:'19mm'}
189 ], 189 ],
190 assess:[ 190 assess:[
191 {key: 0, Iassess: '价格实惠'}, 191 {key: 0, Iassess: '价格实惠'},
192 {key: 1, Iassess: '美观大方'}, 192 {key: 1, Iassess: '美观大方'},
193 {key: 2, Iassess: '易搭配'} 193 {key: 2, Iassess: '易搭配'}
194 ], 194 ],
195 esvalue:'宝贝好评率 100%', 195 esvalue:'宝贝好评率 100%',
196 introduction:{ 196 introduction:{
197 material:'钛合金', 197 material:'钛合金',
198 func:'抗疲劳/防辐射', 198 func:'抗疲劳/防辐射',
199 rate: 1.6 199 rate: 1.6
200 }, 200 },
201 imgAll:'/static/img/detail/d8.png' , 201 imgAll:'/static/img/detail/d8.png' ,
202 photoes:[ 202 photoes:[
203 {value:'日常办公', img:'/static/img/detail/d9.png'}, 203 {value:'日常办公', img:'/static/img/detail/d9.png'},
204 {value:'上网', img:'/static/img/detail/d10.png'}, 204 {value:'上网', img:'/static/img/detail/d10.png'},
205 {value:'追剧', img:'/static/img/detail/d11.png'}, 205 {value:'追剧', img:'/static/img/detail/d11.png'},
206 {value:'玩游戏', img:'/static/img/detail/d12.png'}, 206 {value:'玩游戏', img:'/static/img/detail/d12.png'},
207 ], 207 ],
208 imgDetail:'/static/img/detail/d13.png', 208 imgDetail:'/static/img/detail/d13.png',
209 imgShop:{ 209 imgShop:{
210 img:'/static/tab-cart.png', 210 img:'/static/tab-cart.png',
211 IsShown: false 211 IsShown: false
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 methods:{ 224 methods:{
216 goPerchase(){ 225 goPerchase(){
217 uni.navigateTo({ 226 switch(this.updateGoodType){
218 url: '../purchaseLenses/purchaseLenses', 227 case '1':
219 success: res => {}, 228 uni.navigateTo({
220 fail: () => {}, 229 url: '../detailsChoiceArgs/detailsChoiceArgs',
221 complete: () => {} 230 success: res => {},
222 }); 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 tabChange(e) { 263 tabChange(e) {
225 if (this.current !== e) { 264 if (this.current !== e) {
226 this.current = e; 265 this.current = e;
227 } 266 }
228 } 267 }
229 } 268 }
230 } 269 }
231 </script> 270 </script>
232 <style lang='scss'> 271 <style lang='scss'>
233 .container{ 272 .container{
234 background-color:#f8f8f8 ; 273 background-color:#f8f8f8 ;
235 } 274 }
236 .D1,.D2,.D3,.D4,.D6{ 275 .D1,.D2,.D3,.D4,.D6{
237 background: #ffffff; 276 background: #ffffff;
238 margin-bottom: 10px; 277 margin-bottom: 10px;
239 padding:8px 20px 8px 20px; 278 padding:8px 20px 8px 20px;
240 box-sizing: border-box; 279 box-sizing: border-box;
241 .swiperImage { 280 .swiperImage {
242 width: 684rpx; 281 width: 684rpx;
243 height: 512rpx; 282 height: 512rpx;
244 image { 283 image {
245 width: 100%; 284 width: 100%;
246 height: 100%; 285 height: 100%;
247 border-radius: 16rpx; 286 border-radius: 16rpx;
248 } 287 }
249 } 288 }
250 } 289 }
251 .D5{ 290 .D5{
252 background: #ffffff; 291 background: #ffffff;
253 padding:8px 20px 8px 20px; 292 padding:8px 20px 8px 20px;
254 box-sizing: border-box; 293 box-sizing: border-box;
255 } 294 }
256 .swiperImage{ 295 .swiperImage{
257 width: 100%; 296 width: 100%;
258 height: 560rpx; 297 height: 560rpx;
259 .swiper-item{ 298 .swiper-item{
260 width: 100%; 299 width: 100%;
261 image{ 300 image{
262 width: 100%; 301 width: 100%;
263 } 302 }
264 } 303 }
265 } 304 }
266 .D1{ 305 .D1{
267 .D1_price{ 306 .D1_price{
268 color: #EB5D3B; 307 color: #EB5D3B;
269 font-size: 18px; 308 font-size: 18px;
270 margin-top: 5px; 309 margin-top: 5px;
271 font-family: 'PingFangSC-Semibold'; 310 font-family: 'PingFangSC-Semibold';
272 } 311 }
273 .D1_name{ 312 .D1_name{
274 font-size: 16px; 313 font-size: 16px;
275 font-family: 'PingFangSC-Semibold'; 314 font-family: 'PingFangSC-Semibold';
276 margin-top: 5px; 315 margin-top: 5px;
277 display: flex; 316 display: flex;
278 justify-content: space-between; 317 justify-content: space-between;
279 .D1_name1{ 318 .D1_name1{
280 font-weight: bold; 319 font-weight: bold;
281 font-size: 16px; 320 font-size: 16px;
282 color: #333333; 321 color: #333333;
283 } 322 }
284 .D1_number{ 323 .D1_number{
285 color: #999999 ; 324 color: #999999 ;
286 font-size: 14px; 325 font-size: 14px;
287 font-family: 'PingFangSC-Regular'; 326 font-family: 'PingFangSC-Regular';
288 } 327 }
289 } 328 }
290 .D1_spans{ 329 .D1_spans{
291 font-size: 10px; 330 font-size: 10px;
292 color:#999999; 331 color:#999999;
293 margin-top: 5px; 332 margin-top: 5px;
294 span{ 333 span{
295 height: 14px; 334 height: 14px;
296 margin-right: 10px; 335 margin-right: 10px;
297 } 336 }
298 } 337 }
299 338
300 } 339 }
301 .D2{ 340 .D2{
302 font-size: 14px; 341 font-size: 14px;
303 font-family: 'PingFangSC-Regular'; 342 font-family: 'PingFangSC-Regular';
304 view{ 343 view{
305 height: 24px; 344 height: 24px;
306 } 345 }
307 .D2_span1{ 346 .D2_span1{
308 color: #999999; 347 color: #999999;
309 } 348 }
310 .D2_span2{ 349 .D2_span2{
311 color: #333333; 350 color: #333333;
312 } 351 }
313 } 352 }
314 .D3{ 353 .D3{
315 .screenBar{ 354 .screenBar{
316 width: 670rpx; 355 width: 670rpx;
317 margin-top: 20rpx; 356 margin-top: 20rpx;
318 margin-bottom: 24rpx; 357 margin-bottom: 24rpx;
319 display: flex; 358 display: flex;
320 flex-direction: row; 359 flex-direction: row;
321 justify-content: space-between; 360 justify-content: space-between;
322 align-items: center; 361 align-items: center;
323 font-size: 14px; 362 font-size: 14px;
324 color: #333333; 363 color: #333333;
325 transition:all 0.2s; 364 transition:all 0.2s;
326 } 365 }
327 .screen-item{ 366 .screen-item{
328 font-size: 32rpx; 367 font-size: 32rpx;
329 color: #333333; 368 color: #333333;
330 display: flex; 369 display: flex;
331 transition:all 0.2s; 370 transition:all 0.2s;
332 .D3_list{ 371 .D3_list{
333 margin-bottom: 4px; 372 margin-bottom: 4px;
334 } 373 }
335 .D3_list view{ 374 .D3_list view{
336 display: flex; 375 display: flex;
337 align-content: center; 376 align-content: center;
338 font-size: 14px; 377 font-size: 14px;
339 color: #333333; 378 color: #333333;
340 } 379 }
341 .D3_list image{ 380 .D3_list image{
342 width: 50px; 381 width: 50px;
343 height: 25px; 382 height: 25px;
344 margin-right: 6px; 383 margin-right: 6px;
345 } 384 }
346 .D3_list span{ 385 .D3_list span{
347 margin-left: 6px; 386 margin-left: 6px;
348 margin-right: 5px; 387 margin-right: 5px;
349 font-family: 'PingFangSC-Regular'; 388 font-family: 'PingFangSC-Regular';
350 } 389 }
351 } 390 }
352 .active{ 391 .active{
353 border-bottom: 4rpx solid #FF6B4A; 392 border-bottom: 4rpx solid #FF6B4A;
354 } 393 }
355 .customerService{ 394 .customerService{
356 margin-bottom: 90rpx; 395 margin-bottom: 90rpx;
357 .serviceItem{ 396 .serviceItem{
358 margin-bottom: 32rpx; 397 margin-bottom: 32rpx;
359 .title{ 398 .title{
360 display: flex;flex-direction: row; 399 display: flex;flex-direction: row;
361 align-items: center; 400 align-items: center;
362 .titleText{ 401 .titleText{
363 font-size: 14px; 402 font-size: 14px;
364 color: #333333; 403 color: #333333;
365 margin-bottom: 12rpx; 404 margin-bottom: 12rpx;
366 } 405 }
367 } 406 }
368 .itemContent{ 407 .itemContent{
369 font-size: 14px; 408 font-size: 14px;
370 color: #999999; 409 color: #999999;
371 margin-left: 18rpx; 410 margin-left: 18rpx;
372 } 411 }
373 } 412 }
374 .serviceItem2{ 413 .serviceItem2{
375 margin-left: 18rpx; 414 margin-left: 18rpx;
376 margin-bottom: 32rpx; 415 margin-bottom: 32rpx;
377 .titleText{ 416 .titleText{
378 font-size: 14px; 417 font-size: 14px;
379 color: #FF6B4A; 418 color: #FF6B4A;
380 } 419 }
381 .itemContent{ 420 .itemContent{
382 font-size: 14px; 421 font-size: 14px;
383 color: #999999; 422 color: #999999;
384 .itemContent-child{ 423 .itemContent-child{
385 margin-bottom: 40rpx; 424 margin-bottom: 40rpx;
386 .contentTitle{ 425 .contentTitle{
387 border-bottom: 1px solid #FF6B4A; 426 border-bottom: 1px solid #FF6B4A;
388 } 427 }
389 } 428 }
390 } 429 }
391 } 430 }
392 } 431 }
393 } 432 }
394 .D4{ 433 .D4{
395 .D4_esvalue{ 434 .D4_esvalue{
396 font-size: 14px; 435 font-size: 14px;
397 color: #333333; 436 color: #333333;
398 display: flex; 437 display: flex;
399 justify-content: space-between; 438 justify-content: space-between;
400 margin-bottom: 10px; 439 margin-bottom: 10px;
401 .D4_2{ 440 .D4_2{
402 width: 90px; 441 width: 90px;
403 display: flex; 442 display: flex;
404 align-items: center; 443 align-items: center;
405 justify-content: space-between; 444 justify-content: space-between;
406 } 445 }
407 } 446 }
408 .D4_esvalue view{ 447 .D4_esvalue view{
409 font-size: 14px; 448 font-size: 14px;
410 color: #333333; 449 color: #333333;
411 font-weight: bold; 450 font-weight: bold;
412 } 451 }
413 .D4_list view{ 452 .D4_list view{
414 display: inline-block; 453 display: inline-block;
415 font-size: 12px; 454 font-size: 12px;
416 text-align: center; 455 text-align: center;
417 margin-right: 12px; 456 margin-right: 12px;
418 width: 90px; 457 width: 90px;
419 height: 24px; 458 height: 24px;
420 line-height: 24px; 459 line-height: 24px;
421 background: #F2F2F2; 460 background: #F2F2F2;
422 color: #666666 ; 461 color: #666666 ;
423 } 462 }
424 } 463 }
425 .D5{ 464 .D5{
426 .D5_fixed1{ 465 .D5_fixed1{
427 display: flex; 466 display: flex;
428 justify-content: space-between; 467 justify-content: space-between;
429 align-content: center; 468 align-content: center;
430 margin-bottom: 12px; 469 margin-bottom: 12px;
431 view{ 470 view{
432 font-size: 14px; 471 font-size: 14px;
433 color: #333333; 472 color: #333333;
434 font-weight: bold; 473 font-weight: bold;
435 font-family: 'PingFangSC-Medium'; 474 font-family: 'PingFangSC-Medium';
436 line-height: 24px; 475 line-height: 24px;
437 } 476 }
438 image{ 477 image{
439 width: 240rpx; 478 width: 240rpx;
440 height: 3px; 479 height: 3px;
441 margin-top: 10px; 480 margin-top: 10px;
442 } 481 }
443 } 482 }
444 .D5_all { 483 .D5_all {
445 width: 100%; 484 width: 100%;
446 height: 380px; 485 height: 380px;
447 margin-bottom: 30px; 486 margin-bottom: 30px;
448 font-family: 'PingFangSC-Regular'; 487 font-family: 'PingFangSC-Regular';
449 border: #999999 solid 1.5px; 488 border: #999999 solid 1.5px;
450 image{ 489 image{
451 width: 100%; 490 width: 100%;
452 height: 380px; 491 height: 380px;
453 }} 492 }}
454 .D5_photoes1{ 493 .D5_photoes1{
455 display: grid; 494 display: grid;
456 grid-template-columns: 48% 48%; 495 grid-template-columns: 48% 48%;
457 grid-row-gap: 10px; 496 grid-row-gap: 10px;
458 grid-column-gap: 4%; 497 grid-column-gap: 4%;
459 image{ 498 image{
460 width: 100%; 499 width: 100%;
461 height: 70px; 500 height: 70px;
462 } 501 }
463 view{ 502 view{
464 width: 100%; 503 width: 100%;
465 font-size: 14px; 504 font-size: 14px;
466 text-align: center; 505 text-align: center;
467 background: #949494; 506 background: #949494;
468 font-family: 'PingFangSC-Regular'; 507 font-family: 'PingFangSC-Regular';
469 color: #ffffff; 508 color: #ffffff;
470 view{ 509 view{
471 height: 24px; 510 height: 24px;
472 line-height: 24px; 511 line-height: 24px;
473 } 512 }
474 } 513 }
475 } 514 }
476 .D5_logo1,.D5_logo2{ 515 .D5_logo1,.D5_logo2{
477 text-align: center; 516 text-align: center;
478 } 517 }
479 .D5_logo1{ 518 .D5_logo1{
480 margin-top: 40px; 519 margin-top: 40px;
481 font-size: 24px; 520 font-size: 24px;
482 font-weight: bold; 521 font-weight: bold;
483 font-family: 'PingFangSC-Semibold'; 522 font-family: 'PingFangSC-Semibold';
484 } 523 }
485 .D5_logo2{ 524 .D5_logo2{
486 font-size: 12px; 525 font-size: 12px;
487 } 526 }
488 .D5_logo3{ 527 .D5_logo3{
489 width: 100%; 528 width: 100%;
490 text-align: center; 529 text-align: center;
491 image{ 530 image{
492 width: 50px; 531 width: 50px;
493 height: 24px; 532 height: 24px;
494 } 533 }
495 } 534 }
496 } 535 }
497 .D6{ 536 .D6{
498 width: 100%; 537 width: 100%;
499 height: 430px; 538 height: 430px;
500 background: #F9F6ED; 539 background: #F9F6ED;
501 margin-bottom: 74px; 540 margin-bottom: 74px;
502 view{ 541 view{
503 text-align: center; 542 text-align: center;
504 } 543 }
505 .D6_v1{ 544 .D6_v1{
506 font-weight: bold; 545 font-weight: bold;
507 } 546 }
508 .D6_v2{ 547 .D6_v2{
509 font-size: 14px; 548 font-size: 14px;
510 margin-bottom: 30px; 549 margin-bottom: 30px;
511 } 550 }
512 .D6_v5{ 551 .D6_v5{
513 .D6_v5_s1{ 552 .D6_v5_s1{
514 font-weight: bold; 553 font-weight: bold;
515 } 554 }
516 .D6_v5_s2{ 555 .D6_v5_s2{
517 font-size: 14px; 556 font-size: 14px;
518 } 557 }
519 } 558 }
520 } 559 }
521 .botton{ 560 .botton{
522 position: fixed; 561 position: fixed;
523 bottom: 0; 562 bottom: 0;
524 height: 74px; 563 height: 74px;
525 width: 100%; 564 width: 100%;
526 background: #FFFFFF; 565 background: #FFFFFF;
527 padding: 20px 20px 8px 20px; 566 padding: 20px 20px 8px 20px;
528 font-family: 'PingFangSC-Regular'; 567 font-family: 'PingFangSC-Regular';
529 box-sizing: border-box; 568 box-sizing: border-box;
530 display: flex; 569 display: flex;
531 justify-content: space-between; 570 justify-content: space-between;
532 align-content: center; 571 align-content: center;
533 .botton_1{ 572 .botton_1{
534 width: 20%; 573 width: 20%;
535 height: 100%; 574 height: 100%;
536 text-align: center; 575 text-align: center;
537 color: #989898; 576 color: #989898;
538 } 577 }
539 image{ 578 image{
540 width: 60%; 579 width: 60%;
541 height: 30px; 580 height: 30px;
542 } 581 }
543 .botton_image{ 582 .botton_image{
544 font-size: 12px; 583 font-size: 12px;
545 text-align: center; 584 text-align: center;
546 } 585 }
547 .botton_2{ 586 .botton_2{
548 width: 74%; 587 width: 74%;
549 height: 86%; 588 height: 86%;
550 display: grid; 589 display: grid;
551 grid-template-columns: 50% 50%; 590 grid-template-columns: 50% 50%;
552 } 591 }
553 .botton_input{ 592 .botton_input{
554 display: inline-flex; 593 display: inline-flex;
555 align-items: center; 594 align-items: center;
556 justify-content: space-around; 595 justify-content: space-around;
557 background: #FFF0EC; 596 background: #FFF0EC;
558 font-size: 16px; 597 font-size: 16px;
559 color: #FF6B4A; 598 color: #FF6B4A;
560 border-radius: 20px 0 0 20px; 599 border-radius: 20px 0 0 20px;
561 } 600 }
562 .botton_now{ 601 .botton_now{
563 display: inline-flex; 602 display: inline-flex;
564 align-items: center; 603 align-items: center;
565 justify-content: space-around; 604 justify-content: space-around;
566 background: #FF6B4A; 605 background: #FF6B4A;
567 font-size: 16px; 606 font-size: 16px;
568 color: #FFFFFF; 607 color: #FFFFFF;
569 border-radius:0 20px 20px 0; 608 border-radius:0 20px 20px 0;
570 } 609 }
571 } 610 }
572 </style> 611 </style>
src/pages/index/index.vue
1 <template> 1 <template>
2 <view class="content"> 2 <view class="content">
3 <view class="header"> 3 <view class="header">
4 <!-- 搜索--> 4 <!-- 搜索-->
5 <view class="searchBar"> 5 <view class="searchBar">
6 <icon class="searchIcon" type="search" size="14"></icon> 6 <icon class="searchIcon" type="search" size="14"></icon>
7 <input class="searchIpt" placeholder="老花镜" confirm-type="search" /> 7 <input class="searchIpt" placeholder="老花镜" confirm-type="search" />
8 </view> 8 </view>
9 9
10 <!-- 筛选栏--> 10 <!-- 筛选栏-->
11 <view class="screenBar"> 11 <view class="screenBar">
12 <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)"> 12 <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)">
13 <view 13 <view
14 class="screenItem" 14 class="screenItem"
15 v-bind:class="{ active: current === item.current }" 15 v-bind:class="{ active: current === item.current }"
16 v-if="item.current === 2" 16 v-if="item.current === 2"
17 @click="dropDown" 17 @click="dropDown"
18 > 18 >
19 {{ item.text }} 19 {{ item.text }}
20 <icon type="info" size="14"></icon> 20 <icon type="info" size="14"></icon>
21 </view> 21 </view>
22 <view 22 <view
23 class="screenItem" 23 class="screenItem"
24 v-bind:class="{ active: current === item.current }" 24 v-bind:class="{ active: current === item.current }"
25 v-if="item.current === 4" 25 v-if="item.current === 4"
26 @click="showDrawer('showRight')" 26 @click="showDrawer('showRight')"
27 > 27 >
28 {{ item.text }} 28 {{ item.text }}
29 <icon type="info" size="14"></icon> 29 <icon type="info" size="14"></icon>
30 </view> 30 </view>
31 <view v-if="item.current !== 2&&item.current!==4"> 31 <view v-if="item.current !== 2&&item.current!==4">
32 <view 32 <view
33 class="screenItem" 33 class="screenItem"
34 v-bind:class="{ active: current === item.current }" 34 v-bind:class="{ active: current === item.current }"
35 >{{ item.text }}</view> 35 >{{ item.text }}</view>
36 </view> 36 </view>
37 </view> 37 </view>
38 </view> 38 </view>
39 </view> 39 </view>
40 <Uni-drawer 40 <Uni-drawer
41 ref="showRight" 41 ref="showRight"
42 mask="true" 42 mask="true"
43 maskClick="true" 43 maskClick="true"
44 mode="right" 44 mode="right"
45 :width="320" 45 :width="320"
46 @change="change($event,'showRight')" 46 @change="change($event,'showRight')"
47 > 47 >
48 <view class="close"> 48 <view class="close">
49 <view @click="closeDrawer('showRight')"> 49 <view @click="closeDrawer('showRight')">
50 <text class="word-btn-white">关闭</text> 50 <text class="word-btn-white">关闭</text>
51 </view> 51 </view>
52 </view> 52 </view>
53 </Uni-drawer> 53 </Uni-drawer>
54 54
55 <!-- 筛选菜单--> 55 <!-- 筛选菜单-->
56 <view class="content-wrap"> 56 <view class="content-wrap">
57 <view> 57 <view>
58 <HMfilterDropdown 58 <HMfilterDropdown
59 :filterData="filterData" 59 :filterData="filterData"
60 :defaultSelected="filterDropdownValue" 60 :defaultSelected="filterDropdownValue"
61 :updateMenuName="true" 61 :updateMenuName="true"
62 @confirm="confirm" 62 @confirm="confirm"
63 data-format="Object" 63 data-format="Object"
64 ></HMfilterDropdown> 64 ></HMfilterDropdown>
65 <!-- 商品列表 --> 65 <!-- 商品列表 -->
66 <view class="goods-list"> 66 <view class="goods-list">
67 <view class="product-list"> 67 <view class="product-list">
68 <view class="product" v-for="(goods) in goodsList" :key="goods.id"> 68 <view class="product" v-for="(goods) in goodsList" :key="goods.id">
69 <Card :goods="goods"></Card> 69 <Card :goods="goods"></Card>
70 </view> 70 </view>
71 </view> 71 </view>
72 <view class="loading-text">{{loadingText}}</view> 72 <view class="loading-text">{{loadingText}}</view>
73 </view> 73 </view>
74 </view> 74 </view>
75 </view> 75 </view>
76 </view> 76 </view>
77 </template> 77 </template>
78 78
79 <script> 79 <script>
80 import UniDrawer from "@/components/UniDrawer/UniDrawer.vue"; 80 import UniDrawer from "@/components/UniDrawer/UniDrawer.vue";
81 import Card from "@/components/CommodityCard/CommodityCard.vue"; 81 import Card from "@/components/CommodityCard/CommodityCard.vue";
82 import HMfilterDropdown from "@/components/HMFilterDropdown/HMFilterDropdown.vue"; 82 import HMfilterDropdown from "@/components/HMFilterDropdown/HMFilterDropdown.vue";
83 import data from "@/common/data.js"; //筛选菜单数据 83 import data from "@/common/data.js"; //筛选菜单数据
84 import store from '@/store'; 84 import store from '@/store';
85 85
86 export default { 86 export default {
87 components: { 87 components: {
88 UniDrawer: UniDrawer, 88 UniDrawer: UniDrawer,
89 HMfilterDropdown: HMfilterDropdown, 89 HMfilterDropdown: HMfilterDropdown,
90 Card: Card 90 Card: Card
91 }, 91 },
92 data() { 92 data() {
93 return { 93 return {
94 screenItems: [ 94 screenItems: [
95 { current: 0, text: "全部", hasIcon: false }, 95 { current: 0, text: "全部", hasIcon: false },
96 { current: 1, text: "销量", hasIcon: false }, 96 { current: 1, text: "销量", hasIcon: false },
97 { current: 2, text: "价格", hasIcon: true }, 97 { current: 2, text: "价格", hasIcon: true },
98 { current: 3, text: "折扣", hasIcon: false }, 98 { current: 3, text: "折扣", hasIcon: false },
99 { current: 4, text: "筛选", hasIcon: true } 99 { current: 4, text: "筛选", hasIcon: true }
100 ], 100 ],
101 current: 0, 101 current: 0,
102 showRight: false, 102 showRight: false,
103 indexArr: "", 103 indexArr: "",
104 valueArr: "", 104 valueArr: "",
105 // //商品数据 105 loadingText: "~~到底了~~",
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: "正在加载...",
117 filterDropdownValue: [], 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 computed: { 122 computed: {
122 goodsList() { 123 // goodsList() {
123 // 也可以从 getters 获取 124 // // 也可以从 getters 获取
124 console.log('list', this.$store.state.test.list); 125 // console.log('list', this.$store.state.test.list);
125 return this.$store.state.test.list; 126 // return this.$store.state.test.list;
126 } 127 // },
128 // categoryList(){
129 // console.log(this.$store.state.categoryOrder.categoryList);
130 // this.filterData = this.$store.state.categoryOrder.categoryList
131 // }
132
127 }, 133 },
128 filters: { 134 filters: {
129 outData(value) { 135 outData(value) {
130 return JSON.stringify(value); 136 return JSON.stringify(value);
131 } 137 }
132 }, 138 },
133 onLoad: function() { 139 onLoad: function() {
134 store.dispatch('test/fetch'); 140 store.dispatch('test/fetch');
135 // uni.request({ 141 store.dispatch('categoryOrder/fetch')
136 // url: "https://api.glass.xiuyetang.com/app/prod/list", 142
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 // });
165 //定时器模拟ajax异步请求数据 143 //定时器模拟ajax异步请求数据
166 // setTimeout(()=>{ 144 setTimeout(()=>{
167 // //传入defaultSelected的结构不能错,错了就报错运行异常。 不选中的项目传入null 145 //传入defaultSelected的结构不能错,错了就报错运行异常。 不选中的项目传入null
168 // this.filterDropdownValue = [ 146 // this.filterDropdownValue = [
169 // [1,1,0], //第0个菜单选中 一级菜单的第1项,二级菜单的第1项,三级菜单的第3项 147 // [1,1,0], //第0个菜单选中 一级菜单的第1项,二级菜单的第1项,三级菜单的第3项
170 // [null,null], //第1个菜单选中 都不选中 148 // [null,null], //第1个菜单选中 都不选中
171 // [1], //第2个菜单选中 一级菜单的第1项 149 // [1], //第2个菜单选中 一级菜单的第1项
172 // [[0],[1,2,7],[1,0]], //筛选菜单选中 第一个筛选的第0项,第二个筛选的第1,2,7项,第三个筛选的第1,0项 150 // [[0],[1,2,7],[1,0]], //筛选菜单选中 第一个筛选的第0项,第二个筛选的第1,2,7项,第三个筛选的第1,0项
173 // [[0],[1],[1]], //单选菜单选中 第一个筛选的第0项,第二个筛选的第1项,第三个筛选的第1项 151 // [[0],[1],[1]], //单选菜单选中 第一个筛选的第0项,第二个筛选的第1项,第三个筛选的第1项
174 // ]; 152 // ];
175 // this.filterData = data; 153 // this.filterData = data;
176 // },100); 154 },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);
182 }, 155 },
183 methods: { 156 methods: {
184 showDrawer(e) { 157 showDrawer(e) {
185 this.$refs[e].open(); 158 this.$refs[e].open();
186 }, 159 },
187 closeDrawer(e) { 160 closeDrawer(e) {
188 this.$refs[e].close(); 161 this.$refs[e].close();
189 }, 162 },
190 change(e, type) { 163 change(e, type) {
191 this[type] = e; 164 this[type] = e;
192 }, 165 },
193 onClickItem(e) { 166 onClickItem(e) {
194 if (this.current !== e) { 167 if (this.current !== e) {
195 this.current = e; 168 this.current = e;
196 } 169 }
197 }, 170 },
198 dropDown() { 171 dropDown() {
199 console.log("下拉"); 172 console.log("下拉");
200 }, 173 },
201 //接收菜单结果 174 //接收菜单结果
202 confirm(e) { 175 confirm(e) {
203 this.indexArr = e.index; 176 this.indexArr = e.index;
204 this.valueArr = e.value; 177 this.valueArr = e.value;
205 return; 178 return;
206 console.log("修改菜单"); 179 console.log("修改菜单");
207 this.filterData[4].submenu[1] = { 180 this.filterData[4].submenu[1] = {
208 name: "项目2", 181 name: "项目2",
209 submenu: [] 182 submenu: []
210 }; 183 };
211 } 184 }
212 }, 185 },
213 onNavigationBarButtonTap(e) { 186
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 }
243 }; 187 };
244 </script> 188 </script>
245 189
246 <style lang="scss"> 190 <style lang="scss">
247 .content { 191 .content {
248 display: flex; 192 display: flex;
249 flex-direction: column; 193 flex-direction: column;
250 align-items: center; 194 align-items: center;
251 justify-content: center; 195 justify-content: center;
252 background-color: #f7f6f6; 196 background-color: #f7f6f6;
253 } 197 }
254 .header { 198 .header {
255 display: flex; 199 display: flex;
256 flex-direction: column; 200 flex-direction: column;
257 align-items: center; 201 align-items: center;
258 justify-content: center; 202 justify-content: center;
259 background-color: #f7f6f6; 203 background-color: #f7f6f6;
260 height: 178rpx; 204 height: 178rpx;
261 width: 100%; 205 width: 100%;
262 z-index: 999; 206 z-index: 999;
263 position: fixed; 207 position: fixed;
264 top: 0; 208 top: 0;
265 left: 0; 209 left: 0;
266 } 210 }
267 .searchBar { 211 .searchBar {
268 width: 670rpx; 212 width: 670rpx;
269 display: flex; 213 display: flex;
270 justify-content: center; 214 justify-content: center;
271 align-items: center; 215 align-items: center;
272 box-sizing: border-box; 216 box-sizing: border-box;
273 padding: 0rpx 16rpx; 217 padding: 0rpx 16rpx;
274 border: 1px solid #ff6b4a; 218 border: 1px solid #ff6b4a;
275 border-radius: 8rpx; 219 border-radius: 8rpx;
276 background-color: #ffffff; 220 background-color: #ffffff;
277 } 221 }
278 222
279 .searchIpt { 223 .searchIpt {
280 height: 68rpx; 224 height: 68rpx;
281 width: 670rpx; 225 width: 670rpx;
282 padding: 16rpx; 226 padding: 16rpx;
283 font-size: 28rpx; 227 font-size: 28rpx;
284 box-sizing: border-box; 228 box-sizing: border-box;
285 } 229 }
286 .screenBar { 230 .screenBar {
287 width: 670rpx; 231 width: 670rpx;
288 height: 110rpx; 232 height: 110rpx;
289 display: flex; 233 display: flex;
290 flex-direction: row; 234 flex-direction: row;
291 justify-content: space-between; 235 justify-content: space-between;
292 align-items: center; 236 align-items: center;
293 color: #333333; 237 color: #333333;
294 font-size: 32rpx; 238 font-size: 32rpx;
295 } 239 }
296 .active { 240 .active {
297 color: #ff6b4a; 241 color: #ff6b4a;
298 } 242 }
299 .screenItem { 243 .screenItem {
300 display: flex; 244 display: flex;
301 justify-content: center; 245 justify-content: center;
302 align-items: center; 246 align-items: center;
303 } 247 }
304 .content-wrap { 248 .content-wrap {
305 width: 100%; 249 width: 100%;
306 background-color: #ffffff; 250 background-color: #ffffff;
307 } 251 }
308 252
309 .HMfilterDropdown { 253 .HMfilterDropdown {
310 top: 178rpx !important; 254 top: 178rpx !important;
311 } 255 }
312 256
313 .goods-list { 257 .goods-list {
314 padding-top: 286rpx; 258 padding-top: 286rpx;
315 .loading-text { 259 .loading-text {
316 width: 100%; 260 width: 100%;
317 display: flex; 261 display: flex;
318 justify-content: center; 262 justify-content: center;
319 align-items: center; 263 align-items: center;
320 height: 30px; 264 height: 30px;
321 color: #979797; 265 color: #979797;
322 font-size: 12px; 266 font-size: 12px;
src/pages/myOrder/myOrder.vue
1 <template> 1 <template>
2 <view class="content"> 2 <view class="content">
3 <view class="header"> 3 <view class="header">
4 <!-- 搜索--> 4 <!-- 搜索-->
5 <view class="searchBar"> 5 <view class="searchBar">
6 <icon class="searchIcon" type="search" size="14"></icon> 6 <icon class="searchIcon" type="search" size="14"></icon>
7 <input class="searchIpt" placeholder="搜索订单关键字..." confirm-type="search"/> 7 <input class="searchIpt" placeholder="搜索订单关键字..." confirm-type="search"/>
8 </view> 8 </view>
9 <view class="screenBar"> 9 <view class="screenBar">
10 <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)" > 10 <view v-for="item in screenItems" :key="item.current" @click="onClickItem(item.current)" >
11 <view class="screenItem" v-bind:class="{ active: current === item.current }">{{ item.text }}</view> 11 <view class="screenItem" v-bind:class="{ active: current === item.current }">{{ item.text }}</view>
12 </view> 12 </view>
13 </view> 13 </view>
14 </view> 14 </view>
15 <view class="orderList" > 15 <view class="orderList" >
16 <view 16 <view
17 v-for="(order) in orderList" 17 v-for="(order) in orderList"
18 :key="order.orderId" 18 :key="order.orderId"
19 > 19 >
20 <OrderCard :order = "order" :current="current"></OrderCard> 20 <OrderCard :order = "order" :current="current"></OrderCard>
21 </view> 21 </view>
22 </view> 22 </view>
23 <view class="footer">已显示全部</view> 23 <view class="footer">已显示全部</view>
24 </view> 24 </view>
25 </template> 25 </template>
26 <script> 26 <script>
27 import OrderCard from './components/OrderCard.vue'; 27 import OrderCard from './components/OrderCard.vue';
28 import store from '@/store'; 28 import store from '@/store';
29 29
30 export default { 30 export default {
31 components:{ 31 components:{
32 'OrderCard': OrderCard 32 'OrderCard': OrderCard
33 }, 33 },
34 data() { 34 data() {
35 return { 35 return {
36 screenItems: [ 36 screenItems: [
37 {current:0,text:'全部'}, 37 {current:0,text:'全部'},
38 {current:1,text:'待付款'}, 38 {current:1,text:'待付款'},
39 {current:2,text:'待发货'}, 39 {current:2,text:'待发货'},
40 {current:3,text:'待收货'}, 40 {current:3,text:'待收货'},
41 {current:4,text:'退款售后'}, 41 {current:4,text:'退款售后'},
42 ], 42 ],
43 current: 0, 43 current: 0,
44 //订单数据 44 //订单数据
45 // orderList:[ 45 // orderList:[
46 // { orderId: 0, img: '/static/img/goods/p1.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:1 ,buyNum:1}, 46 // { orderId: 0, img: '/static/img/goods/p1.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:1 ,buyNum:1},
47 // { orderId: 2, img: '/static/img/goods/p3.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:1 ,buyNum:1}, 47 // { orderId: 2, img: '/static/img/goods/p3.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:1 ,buyNum:1},
48 // { orderId: 3, img: '/static/img/goods/p4.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:2 ,buyNum:1}, 48 // { orderId: 3, img: '/static/img/goods/p4.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:2 ,buyNum:1},
49 // { orderId: 4, img: '/static/img/goods/p5.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:3 ,buyNum:1}, 49 // { orderId: 4, img: '/static/img/goods/p5.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:3 ,buyNum:1},
50 // { orderId: 5, img: '/static/img/goods/p6.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:3 ,buyNum:1}, 50 // { orderId: 5, img: '/static/img/goods/p6.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:3 ,buyNum:1},
51 // { orderId: 6, img: '/static/img/goods/p7.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:4 ,buyNum:1}, 51 // { orderId: 6, img: '/static/img/goods/p7.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:4 ,buyNum:1},
52 // { orderId: 7, img: '/static/img/goods/p8.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:4 ,buyNum:1}, 52 // { orderId: 7, img: '/static/img/goods/p8.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:4 ,buyNum:1},
53 // { orderId: 8, img: '/static/img/goods/p9.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:5 ,buyNum:1}, 53 // { orderId: 8, img: '/static/img/goods/p9.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:5 ,buyNum:1},
54 // { orderId: 9, img: '/static/img/goods/p10.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:5 ,buyNum:1} 54 // { orderId: 9, img: '/static/img/goods/p10.jpg', name: '商品名称',originCost:'¥198',price: '¥168', orderType:5 ,buyNum:1}
55 // ], 55 // ],
56 }; 56 };
57 }, 57 },
58
58 onLoad: function() { 59 onLoad: function() {
59 store.dispatch('myOrder/getList', { 60 store.dispatch('myOrder/getList', {
60 uid: "1", 61 uid: "1",
61 way: "0", 62 way: "0",
62 }); 63 });
63 }, 64 },
64 computed: { 65 computed: {
65 orderList() { 66 orderList() {
66 console.log('orderList', this.$store.state.myOrder.orderlist); 67 console.log('orderList', this.$store.state.myOrder.orderlist);
67 return this.$store.state.myOrder.orderlist; 68 return this.$store.state.myOrder.orderlist;
68 } 69 }
69 }, 70 },
70 methods:{ 71 methods:{
71 onClickItem(e) { 72 onClickItem(e) {
72 if (this.current !== e) { 73 if (this.current !== e) {
73 this.current = e; 74 this.current = e;
74 } 75 }
75 } 76 }
76 } 77 }
77 } 78 }
78 </script> 79 </script>
79 80
80 <style lang="scss"> 81 <style lang="scss">
81 .content { 82 .content {
82 display: flex; 83 display: flex;
83 flex-direction: column; 84 flex-direction: column;
84 align-items: center; 85 align-items: center;
85 background-color: #F7F6F6; 86 background-color: #F7F6F6;
86 min-height: 100vh; 87 min-height: 100vh;
87 .header{ 88 .header{
88 background-color: #ffffff; 89 background-color: #ffffff;
89 width: 100%; 90 width: 100%;
90 height: 232rpx; 91 height: 232rpx;
91 padding: 40rpx 40rpx 36rpx 40rpx; 92 padding: 40rpx 40rpx 36rpx 40rpx;
92 box-sizing: border-box; 93 box-sizing: border-box;
93 position: fixed; 94 position: fixed;
94 top: 0; 95 top: 0;
95 left: 0; 96 left: 0;
96 .searchBar { 97 .searchBar {
97 width: 670rpx; 98 width: 670rpx;
98 display: flex; 99 display: flex;
99 justify-content: center; 100 justify-content: center;
100 align-items: center; 101 align-items: center;
101 box-sizing: border-box; 102 box-sizing: border-box;
102 padding: 0rpx 16rpx; 103 padding: 0rpx 16rpx;
103 border: 1px solid #FF6B4A; 104 border: 1px solid #FF6B4A;
104 border-radius: 8rpx; 105 border-radius: 8rpx;
105 background-color: #ffffff; 106 background-color: #ffffff;
106 } 107 }
107 108
108 .screenBar{ 109 .screenBar{
109 width: 670rpx; 110 width: 670rpx;
110 height: 110rpx; 111 height: 110rpx;
111 display: flex; 112 display: flex;
112 flex-direction: row; 113 flex-direction: row;
113 justify-content: space-between; 114 justify-content: space-between;
114 align-items: center; 115 align-items: center;
115 color: #333333; 116 color: #333333;
116 font-size: 32rpx; 117 font-size: 32rpx;
117 } 118 }
118 .screenItem{ 119 .screenItem{
119 height: 50rpx; 120 height: 50rpx;
120 font-size: 32rpx; 121 font-size: 32rpx;
121 color: #333333; 122 color: #333333;
122 display: flex; 123 display: flex;
123 justify-content: center; 124 justify-content: center;
124 align-items: center; 125 align-items: center;
125 transition:all 0.2s; 126 transition:all 0.2s;
126 } 127 }
127 .active{ 128 .active{
128 // font-size: 34rpx; 129 // font-size: 34rpx;
129 color: #EC5D3B; 130 color: #EC5D3B;
130 } 131 }
131 .searchIpt { 132 .searchIpt {
132 height: 68rpx; 133 height: 68rpx;
133 width: 670rpx; 134 width: 670rpx;
134 padding: 16rpx; 135 padding: 16rpx;
135 font-size: 28rpx; 136 font-size: 28rpx;
136 box-sizing: border-box; 137 box-sizing: border-box;
137 } 138 }
138 } 139 }
139 .orderList{ 140 .orderList{
140 margin-top: 232rpx; 141 margin-top: 232rpx;
141 } 142 }
142 .footer{ 143 .footer{
143 font-size: 14px; 144 font-size: 14px;
144 color: #B8B8B8; 145 color: #B8B8B8;
145 margin: 40rpx 0; 146 margin: 40rpx 0;
146 } 147 }
147 } 148 }
148 </style> 149 </style>
149 150
src/pages/myOrderPaying/myOrderPaying.vue
1 <template> 1 <template>
2
2 <view class="content"> 3 <view class="content">
3 <view class="order-hr"></view> 4 <view class="order-hr"></view>
4 <view class="order-time"> 5 <view class="order-time">
5 <text>请在</text> 6 <text>请在</text>
6 <!-- <text class="p2"></text> --> 7 <!-- <text class="p2"></text> -->
7 <uni-countdown color="#EC5D3B" splitor-color="#EC5D3B" :show-day="false" 8 <uni-countdown color="#EC5D3B" splitor-color="#EC5D3B" :show-day="false"
8 :hour="0" :minute="59" :second="58" style="margin: 36rpx 20rpx 0 20rpx"></uni-countdown> 9 :hour="0" :minute="59" :second="58" style="margin: 36rpx 20rpx 0 20rpx"></uni-countdown>
9 <text>内完成付款</text> 10 <text>内完成付款</text>
10 </view> 11 </view>
11 <view class="order"> 12 <view class="order">
12 <view class="order-user"> 13 <view class="order-user">
13 <view class="order-user-head"> 14 <view class="order-user-head">
14 <text class="p1">钱大大</text> 15 <text class="p1">钱大大</text>
15 <text class="p2">18823749843</text> 16 <text class="p2">18823749843</text>
16 </view> 17 </view>
17 <view class="order-user-body"> 18 <view class="order-user-body">
18 <image src="../../static/myorder-paying-location.png"></image> 19 <image src="../../static/myorder-paying-location.png"></image>
19 <text class="p3">四川省 德阳市 旌阳区\n黄河西路碧桂园3期 4单元 202</text> 20 <text class="p3">四川省 德阳市 旌阳区\n黄河西路碧桂园3期 4单元 202</text>
20 </view> 21 </view>
21 </view> 22 </view>
22 <view class="order-info"> 23 <view class="order-info">
23 <view class="order-info-head"> 24 <view class="order-info-head">
24 <image src="../../static/myorder-paying-pic.png"></image> 25 <image src="../../static/myorder-paying-pic.png"></image>
25 <view class="order-info-head-r"> 26 <view class="order-info-head-r">
26 <text class="p1">眼镜名称眼镜名称眼镜名称眼镜名称…</text> 27 <text class="p1">眼镜名称眼镜名称眼镜名称眼镜名称…</text>
27 <view class="p2" style="margin: 0;"> 28 <view class="p2" style="margin: 0;">
28 规格:玫瑰金 / 钛合金 / 防日光防紫外线 / 超薄超轻 29 规格:玫瑰金 / 钛合金 / 防日光防紫外线 / 超薄超轻
29 <!-- <view class="arrow"></view> --> 30 <!-- <view class="arrow"></view> -->
30 </view> 31 </view>
31 <text class="p3"><span>¥180</span><span class="p4">X1</span></text> 32 <text class="p3"><span>¥180</span><span class="p4">X1</span></text>
32 </view> 33 </view>
33 </view> 34 </view>
34 <!-- <view class="order-info-goodsnum"> 35 <!-- <view class="order-info-goodsnum">
35 <text>X1</text> 36 <text>X1</text>
36 </view> --> 37 </view> -->
37 <text class="order-info-freight"> 38 <text class="order-info-freight">
38 <text class="p1">运费</text> 39 <text class="p1">运费</text>
39 <text class="p2">0.00</text> 40 <text class="p2">0.00</text>
40 </text> 41 </text>
41 <text class="order-info-discount"> 42 <text class="order-info-discount">
42 <text class="p1">优惠</text> 43 <text class="p1">优惠</text>
43 <text class="p2">-¥70.00</text> 44 <text class="p2">-¥70.00</text>
44 </text> 45 </text>
45 <text class="order-info-price"> 46 <text class="order-info-price">
46 <text class="p1">实付</text> 47 <text class="p1">实付</text>
47 <text class="p2">¥110</text> 48 <text class="p2">¥110</text>
48 </text> 49 </text>
49 <text class="order-info-num"> 50 <text class="order-info-num">
50 <text>订单号:203486795859605849</text> 51 <text>订单号:203486795859605849</text>
51 </text> 52 </text>
52 <text class="order-info-time"> 53 <text class="order-info-time">
53 <text>下单时间:2020-10-22 14:32:42</text> 54 <text>下单时间:2020-10-22 14:32:42</text>
54 </text> 55 </text>
55 <view class="order-info-hr"></view> 56 <view class="order-info-hr"></view>
56 <view class="order-info-contact"> 57 <view class="order-info-contact">
57 <image src="../../static/myorder-paying-contact.png"></image> 58 <image src="../../static/myorder-paying-contact.png"></image>
58 <text>联系客服</text> 59 <text>联系客服</text>
59 </view> 60 </view>
60 </view> 61 </view>
61 </view> 62 </view>
62 <view class="order-confim"> 63 <view class="order-confim">
63 <button class="b1">取消订单</button> 64 <button class="b1">取消订单</button>
64 <button class="b2">立即支付</button> 65 <button class="b2">立即支付</button>
65 </view> 66 </view>
66 </view> 67 </view>
67 </template> 68 </template>
68 69
69 <script> 70 <script>
70 import UniCountdown from '../../components/UniCountdown/UniCountdown.vue' 71 import UniCountdown from '../../components/UniCountdown/UniCountdown.vue'
71 export default { 72 export default {
72 components: { 73 components: {
73 UniCountdown 74 UniCountdown
74 }, 75 },
75 data() { 76 data() {
76 return { 77 return {
77 scrollHeight: false, 78 scrollHeight: false,
78 } 79 }
79 }, 80 },
80 methods: { 81 methods: {
81 82
82 } 83 }
83 } 84 }
84 </script> 85 </script>
85 86
86 <style lang="scss" scoped> 87 <style lang="scss" scoped>
87 .content{ 88 .content{
88 display: flex; 89 display: flex;
89 flex-direction: column; 90 flex-direction: column;
90 justify-content: center; 91 justify-content: center;
91 align-items: center; 92 align-items: center;
92 background-color: #f2f2f2; 93 background-color: #f2f2f2;
93 } 94 }
94 95
95 96
96 .order { 97 .order {
97 min-height: 1196rpx; 98 min-height: 1196rpx;
98 margin-bottom: 112rpx; 99 margin-bottom: 112rpx;
99 background: #F2F2F2; 100 background: #F2F2F2;
100 } 101 }
101 .order-hr { 102 .order-hr {
102 width: 100%; 103 width: 100%;
103 height: 1px; 104 height: 1px;
104 background-color: #E9E9E9; 105 background-color: #E9E9E9;
105 } 106 }
106 .order-time { 107 .order-time {
107 width: 100%; 108 width: 100%;
108 height: 140rpx; 109 height: 140rpx;
109 background-color: #fff; 110 background-color: #fff;
110 display: flex; 111 display: flex;
111 justify-content: center; 112 justify-content: center;
112 text { 113 text {
113 // font-family: PingFangSC-Regular; 114 // font-family: PingFangSC-Regular;
114 margin-top: 48rpx; 115 margin-top: 48rpx;
115 font-size: 14px; 116 font-size: 14px;
116 color: #333333; 117 color: #333333;
117 letter-spacing: -0.26px; 118 letter-spacing: -0.26px;
118 } 119 }
119 .p2 { 120 .p2 {
120 // font-family: DINAlternate-Bold; 121 // font-family: DINAlternate-Bold;
121 margin: 42rpx 20rpx 0 20rpx; 122 margin: 42rpx 20rpx 0 20rpx;
122 font-size: 18px; 123 font-size: 18px;
123 color: #EC5D3B; 124 color: #EC5D3B;
124 letter-spacing: -0.34px; 125 letter-spacing: -0.34px;
125 } 126 }
126 } 127 }
127 128
128 .order-user { 129 .order-user {
129 width: 670rpx; 130 width: 670rpx;
130 height: 228rpx; 131 height: 228rpx;
131 background: #FFFFFF; 132 background: #FFFFFF;
132 border-radius: 14rpx; 133 border-radius: 14rpx;
133 margin: 0 auto; 134 margin: 0 auto;
134 margin-top: 20rpx; 135 margin-top: 20rpx;
135 margin-bottom: 20rpx; 136 margin-bottom: 20rpx;
136 .order-user-head { 137 .order-user-head {
137 display: flex; 138 display: flex;
138 height: 108rpx; 139 height: 108rpx;
139 width: 100%; 140 width: 100%;
140 align-items: center; 141 align-items: center;
141 margin-left: 126rpx; 142 margin-left: 126rpx;
142 .p1 { 143 .p1 {
143 // font-family: PingFangSC-Regular; 144 // font-family: PingFangSC-Regular;
144 font-size: 14px; 145 font-size: 14px;
145 color: #333333; 146 color: #333333;
146 letter-spacing: -0.26px; 147 letter-spacing: -0.26px;
147 margin-right: 20rpx; 148 margin-right: 20rpx;
148 } 149 }
149 .p2 { 150 .p2 {
150 // font-family: PingFangSC-Regular; 151 // font-family: PingFangSC-Regular;
151 font-size: 14px; 152 font-size: 14px;
152 color: #999999; 153 color: #999999;
153 letter-spacing: -0.26px; 154 letter-spacing: -0.26px;
154 } 155 }
155 } 156 }
156 .order-user-body { 157 .order-user-body {
157 display: flex; 158 display: flex;
158 width: 100%; 159 width: 100%;
159 image{ 160 image{
160 width: 24px; 161 width: 24px;
161 height: 26px; 162 height: 26px;
162 margin: 12rpx 32rpx 0 40rpx; 163 margin: 12rpx 32rpx 0 40rpx;
163 } 164 }
164 .p3 { 165 .p3 {
165 // font-family: PingFangSC-Semibold; 166 // font-family: PingFangSC-Semibold;
166 font-size: 14px; 167 font-size: 14px;
167 color: #333333; 168 color: #333333;
168 letter-spacing: -0.26px; 169 letter-spacing: -0.26px;
169 } 170 }
170 } 171 }
171 } 172 }
172 173
173 .order-info { 174 .order-info {
174 width: 670rpx; 175 width: 670rpx;
175 background-color: #fff; 176 background-color: #fff;
176 box-shadow: 0 0 20rpx 0 rgba(177,128,128,0.06); 177 box-shadow: 0 0 20rpx 0 rgba(177,128,128,0.06);
177 border-radius: 16rpx; 178 border-radius: 16rpx;
178 margin: 0 auto; 179 margin: 0 auto;
179 view{ 180 view{
180 margin-left: 40rpx; 181 margin-left: 40rpx;
181 } 182 }
182 text{ 183 text{
183 font-size: 14px; 184 font-size: 14px;
184 } 185 }
185 .order-info-head { 186 .order-info-head {
186 display: flex; 187 display: flex;
187 padding-top: 40rpx; 188 padding-top: 40rpx;
188 image{ 189 image{
189 height: 188rpx; 190 height: 188rpx;
190 width: 188rpx; 191 width: 188rpx;
191 } 192 }
192 .order-info-head-r{ 193 .order-info-head-r{
193 margin: 0; 194 margin: 0;
194 width: 368rpx; 195 width: 368rpx;
195 margin-left: 24rpx; 196 margin-left: 24rpx;
196 // margin-top: 40rpx; 197 // margin-top: 40rpx;
197 text{ 198 text{
198 display: block; 199 display: block;
199 } 200 }
200 // .arrow{ 201 // .arrow{
201 // width: 0; 202 // width: 0;
202 // height: 0; 203 // height: 0;
203 // border-left: 5px transparent; 204 // border-left: 5px transparent;
204 // border-right: 5px transparent; 205 // border-right: 5px transparent;
205 // border-top: 5px #979797; 206 // border-top: 5px #979797;
206 // border-bottom: 0 transparent; 207 // border-bottom: 0 transparent;
207 // border-style: solid; 208 // border-style: solid;
208 // position: relative; 209 // position: relative;
209 // // transform: scaleY(-1); 210 // // transform: scaleY(-1);
210 // } 211 // }
211 // .arrow::after{ 212 // .arrow::after{
212 // content: ''; 213 // content: '';
213 // position: absolute; 214 // position: absolute;
214 // top: -6.5px; 215 // top: -6.5px;
215 // left: -5px; 216 // left: -5px;
216 // border-left: 5px transparent; 217 // border-left: 5px transparent;
217 // border-right: 5px transparent; 218 // border-right: 5px transparent;
218 // border-top: 5px #FFFFFF; 219 // border-top: 5px #FFFFFF;
219 // border-bottom: 0 transparent; 220 // border-bottom: 0 transparent;
220 // border-style: solid; 221 // border-style: solid;
221 // } 222 // }
222 .p1 { 223 .p1 {
223 min-height: 40px; 224 min-height: 40px;
224 // font-family: PingFangSC-Regular; 225 // font-family: PingFangSC-Regular;
225 font-size: 14px; 226 font-size: 14px;
226 color: #333333; 227 color: #333333;
227 letter-spacing: -0.26px; 228 letter-spacing: -0.26px;
228 line-height: 18px; 229 line-height: 18px;
229 // line-height: 20px; 230 // line-height: 20px;
230 } 231 }
231 .p2 { 232 .p2 {
232 height: 34px; 233 height: 34px;
233 padding: 1px 0 3px 0; 234 padding: 1px 0 3px 0;
234 // font-family: PingFangSC-Regular; 235 // font-family: PingFangSC-Regular;
235 font-size: 12px; 236 font-size: 12px;
236 color: #999999; 237 color: #999999;
237 letter-spacing: -0.23px; 238 letter-spacing: -0.23px;
238 } 239 }
239 .p3 { 240 .p3 {
240 height: 20px; 241 height: 20px;
241 // font-family: PingFangSC-Regular; 242 // font-family: PingFangSC-Regular;
242 font-size: 14px; 243 font-size: 14px;
243 color: #FF6B4A; 244 color: #FF6B4A;
244 letter-spacing: -0.26px; 245 letter-spacing: -0.26px;
245 } 246 }
246 .p4{ 247 .p4{
247 font-size: 12px; 248 font-size: 12px;
248 color: #999999; 249 color: #999999;
249 letter-spacing: -0.23px; 250 letter-spacing: -0.23px;
250 margin-left: 10px; 251 margin-left: 10px;
251 } 252 }
252 } 253 }
253 254
254 } 255 }
255 // .order-info-goodsnum { 256 // .order-info-goodsnum {
256 // display: flex; 257 // display: flex;
257 // align-items: center; 258 // align-items: center;
258 // justify-content: flex-end; 259 // justify-content: flex-end;
259 // text { 260 // text {
260 // margin-right: 44rpx; 261 // margin-right: 44rpx;
261 // // ont-family: PingFangSC-Regular; 262 // // ont-family: PingFangSC-Regular;
262 // font-size: 12px; 263 // font-size: 12px;
263 // color: #999999; 264 // color: #999999;
264 // letter-spacing: -0.23px; 265 // letter-spacing: -0.23px;
265 // } 266 // }
266 // } 267 // }
267 .order-info-freight { 268 .order-info-freight {
268 display: block; 269 display: block;
269 margin-left: 40rpx; 270 margin-left: 40rpx;
270 margin-top: 22rpx; 271 margin-top: 22rpx;
271 .p1{ 272 .p1{
272 // font-family: PingFangSC-Regular; 273 // font-family: PingFangSC-Regular;
273 font-size: 14px; 274 font-size: 14px;
274 color: #333333; 275 color: #333333;
275 letter-spacing: -0.26px; 276 letter-spacing: -0.26px;
276 line-height: 18px; 277 line-height: 18px;
277 margin-right: 24px; 278 margin-right: 24px;
278 } 279 }
279 .p2 { 280 .p2 {
280 // font-family: PingFangSC-Regular; 281 // font-family: PingFangSC-Regular;
281 font-size: 14px; 282 font-size: 14px;
282 color: #FF6B4A; 283 color: #FF6B4A;
283 letter-spacing: -0.26px; 284 letter-spacing: -0.26px;
284 } 285 }
285 } 286 }
286 .order-info-discount { 287 .order-info-discount {
287 display: block; 288 display: block;
288 margin-left: 40rpx; 289 margin-left: 40rpx;
289 margin-top: 24rpx; 290 margin-top: 24rpx;
290 .p1 { 291 .p1 {
291 // font-family: PingFangSC-Regular; 292 // font-family: PingFangSC-Regular;
292 font-size: 14px; 293 font-size: 14px;
293 color: #333333; 294 color: #333333;
294 letter-spacing: -0.26px; 295 letter-spacing: -0.26px;
295 line-height: 18px; 296 line-height: 18px;
296 margin-right: 24px; 297 margin-right: 24px;
297 } 298 }
298 .p2 { 299 .p2 {
299 // font-family: PingFangSC-Regular; 300 // font-family: PingFangSC-Regular;
300 font-size: 14px; 301 font-size: 14px;
301 color: #FF6B4A; 302 color: #FF6B4A;
302 letter-spacing: -0.26px; 303 letter-spacing: -0.26px;
303 } 304 }
304 } 305 }
305 .order-info-price { 306 .order-info-price {
306 display: block; 307 display: block;
307 margin-left: 40rpx; 308 margin-left: 40rpx;
308 margin-top: 24rpx; 309 margin-top: 24rpx;
309 .p1 { 310 .p1 {
310 // font-family: PingFangSC-Semibold; 311 // font-family: PingFangSC-Semibold;
311 font-size: 14px; 312 font-size: 14px;
312 color: #333333; 313 color: #333333;
313 letter-spacing: -0.26px; 314 letter-spacing: -0.26px;
314 line-height: 18px; 315 line-height: 18px;
315 margin-right: 24px; 316 margin-right: 24px;
316 } 317 }
317 .p2 { 318 .p2 {
318 // font-family: PingFangSC-Semibold; 319 // font-family: PingFangSC-Semibold;
319 font-size: 14px; 320 font-size: 14px;
320 color: #FF6B4A; 321 color: #FF6B4A;
321 letter-spacing: -0.26px; 322 letter-spacing: -0.26px;
322 } 323 }
323 } 324 }
324 .order-info-num{ 325 .order-info-num{
325 display: block; 326 display: block;
326 margin-left: 40rpx; 327 margin-left: 40rpx;
327 margin-top: 44rpx; 328 margin-top: 44rpx;
328 text{ 329 text{
329 // font-family: PingFangSC-Regular; 330 // font-family: PingFangSC-Regular;
330 font-size: 12px; 331 font-size: 12px;
331 color: #999999; 332 color: #999999;
332 letter-spacing: -0.23px; 333 letter-spacing: -0.23px;
333 } 334 }
334 } 335 }
335 .order-info-time { 336 .order-info-time {
336 display: block; 337 display: block;
337 margin: 8rpx 0 48rpx 40rpx; 338 margin: 8rpx 0 48rpx 40rpx;
338 text{ 339 text{
339 // font-family: PingFangSC-Regular; 340 // font-family: PingFangSC-Regular;
340 font-size: 12px; 341 font-size: 12px;
341 color: #999999; 342 color: #999999;
342 letter-spacing: -0.23px; 343 letter-spacing: -0.23px;
343 } 344 }
344 } 345 }
345 .order-info-hr{ 346 .order-info-hr{
346 width: 520rpx; 347 width: 520rpx;
347 height: 1px; 348 height: 1px;
348 background-color: #E9E9E9; 349 background-color: #E9E9E9;
349 margin-bottom: 20rpx; 350 margin-bottom: 20rpx;
350 } 351 }
351 .order-info-contact { 352 .order-info-contact {
352 display: flex; 353 display: flex;
353 padding-bottom: 28rpx; 354 padding-bottom: 28rpx;
354 image{ 355 image{
355 width: 19px; 356 width: 19px;
356 height: 16px; 357 height: 16px;
357 } 358 }
358 text { 359 text {
359 // font-family: PingFangSC-Regular; 360 // font-family: PingFangSC-Regular;
360 margin-left: 20rpx; 361 margin-left: 20rpx;
361 font-size: 14px; 362 font-size: 14px;
362 color: #333333; 363 color: #333333;
363 letter-spacing: -0.26px; 364 letter-spacing: -0.26px;
364 line-height: 18px; 365 line-height: 18px;
365 } 366 }
366 } 367 }
367 } 368 }
368 369
369 .order-confim { 370 .order-confim {
370 display: flex; 371 display: flex;
371 align-items: center; 372 align-items: center;
372 z-index: 999; 373 z-index: 999;
373 width: 100%; 374 width: 100%;
374 height: 112rpx; 375 height: 112rpx;
375 position: fixed; 376 position: fixed;
376 bottom: 0; 377 bottom: 0;
377 background: #FFFFFF; 378 background: #FFFFFF;
378 button { 379 button {
379 width: 204rpx; 380 width: 204rpx;
380 height: 80rpx; 381 height: 80rpx;
381 border: 1px solid #FF6B4A; 382 border: 1px solid #FF6B4A;
382 border-radius: 40rpx; 383 border-radius: 40rpx;
383 font-size: 32rpx; 384 font-size: 32rpx;
384 letter-spacing: -0.3px; 385 letter-spacing: -0.3px;
385 margin-right: 0; 386 margin-right: 0;
386 } 387 }
387 .b1 { 388 .b1 {
388 // font-family: PingFangSC-Regular; 389 // font-family: PingFangSC-Regular;
389 color: #FF6B4A; 390 color: #FF6B4A;
390 391
391 } 392 }
392 .b2 { 393 .b2 {
393 // font-family: PingFangSC-Regular; 394 // font-family: PingFangSC-Regular;
394 background-color: #FF6B4A; 395 background-color: #FF6B4A;
395 color: #FFFFFF; 396 color: #FFFFFF;
396 margin: 0 26rpx 0 20rpx; 397 margin: 0 26rpx 0 20rpx;
397 } 398 }
398 } 399 }
399 400
400 </style> 401 </style>
401 402
src/pages/user/user.vue
1 <template> 1 <template>
2 <view class="wrap"> 2 <view class="wrap">
3 <view class="content"> 3 <view class="content">
4 <view class="userInfo"> 4 <view class="userInfo">
5 <view class="info"> 5 <view class="info">
6 <image src="../../static/img/detail/d10.png" mode="aspectFill"></image> 6 <image src="../../static/img/detail/d10.png" mode="aspectFill"></image>
7 <view class="infoText"> 7 <view class="infoText">
8 <text class="userName">{{userName}}</text> 8 <text class="userName">{{userName}}</text>
9 <text class="nickName">用户名:骆驼不死的祥子</text> 9 <text class="nickName">用户名:骆驼不死的祥子</text>
10 </view> 10 </view>
11 </view> 11 </view>
12 <view class="service"> 12 <view class="service">
13 <image src="../../static/serviceLogo.png" mode="aspectFill"></image> 13 <image src="../../static/serviceLogo.png" mode="aspectFill"></image>
14 </view> 14 </view>
15 </view> 15 </view>
16 <view class="myOrder"> 16 <view class="myOrder">
17 <view class="orderHeader"> 17 <view class="orderHeader">
18 <text>全部订单</text> 18 <text>全部订单</text>
19 <view class="btn" @click="toMyOrder"> 19 <view class="btn" @click="toMyOrder">
20 全部 20 全部
21 <image src="../../static/right.png" mode="aspectFill"></image> 21 <image src="../../static/right.png" mode="aspectFill"></image>
22 </view> 22 </view>
23 </view> 23 </view>
24 <view class="orderBody"> 24 <view class="orderBody">
25 <view class="item waitPay" @click="toMyOrderPaying"> 25 <view class="item waitPay" @click="toMyOrderPaying">
26 <image src="../../static/waitDeliver.png" mode="aspectFill"></image> 26 <image src="../../static/waitDeliver.png" mode="aspectFill"></image>
27 <text>待付款</text> 27 <text>待付款</text>
28 </view> 28 </view>
29 <view class="item waitDeliver" @click="toPredelivery" > 29 <view class="item waitDeliver" @click="toPredelivery" >
30 <image src="../../static/waitPay.png" mode="aspectFill"></image> 30 <image src="../../static/waitPay.png" mode="aspectFill"></image>
31 <text>待发货</text> 31 <text>待发货</text>
32 </view> 32 </view>
33 <view class="item waitReceive" @click="torefunProgress"> 33 <view class="item waitReceive" @click="torefunProgress">
34 <image src="../../static/waitReceive.png" mode="aspectFill"></image> 34 <image src="../../static/waitReceive.png" mode="aspectFill"></image>
35 <text>待收货</text> 35 <text>待收货</text>
36 </view> 36 </view>
37 <view class="item service" @click="torefundment"> 37 <view class="item service" @click="torefundment">
38 <image src="../../static/service.png" mode="aspectFill"></image> 38 <image src="../../static/service.png" mode="aspectFill"></image>
39 <text>退换/售后</text> 39 <text>退换/售后</text>
40 </view> 40 </view>
41 </view> 41 </view>
42 </view> 42 </view>
43 <view class="recommend"> 43 <view class="recommend">
44 <view class="title"> 44 <view class="title">
45 <view class="line"></view> 45 <view class="line"></view>
46 <view class="text">精选推荐</view> 46 <view class="text">精选推荐</view>
47 <view class="line"></view> 47 <view class="line"></view>
48 </view> 48 </view>
49 <!-- 商品列表 --> 49 <!-- 商品列表 -->
50 <view class="goods-list"> 50 <view class="goods-list">
51 <view class="product-list"> 51 <view class="product-list">
52 <view class="product" v-for="(goods) in goodsList" :key="goods.goods_id" @tap="toGoods(goods.goods_id)"> 52 <view class="product" v-for="(goods) in goodsList" :key="goods.goods_id" >
53 <Card :goods = "goods"></Card> 53 <Card :goods = "goods"></Card>
54 </view> 54 </view>
55 </view> 55 </view>
56 <view class="loading-text">{{loadingText}}</view> 56 <view class="loading-text">{{loadingText}}</view>
57 </view> 57 </view>
58 </view> 58 </view>
59 </view> 59 </view>
60 60
61 </view> 61 </view>
62 </template> 62 </template>
63 63
64 <script> 64 <script>
65 import Card from "@/components/CommodityCard/CommodityCard.vue"; 65 import Card from "@/components/CommodityCard/CommodityCard.vue";
66 import store from '@/store'; 66 import store from '@/store';
67 export default { 67 export default {
68 components: { 68 components: {
69 'Card':Card 69 'Card':Card
70 }, 70 },
71 data() { 71 data() {
72 return { 72 return {
73 73
74 //商品数据 74 //商品数据
75 goodsList:[ 75 goodsList:[
76 { goods_id: 0, img: "/static/img/goods/p1.jpg", name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 76 { goods_id: 0, img: "/static/img/goods/p2.jpg", name: '1.56非球面防蓝光_黑01-8701志平防蓝光-防辐射电脑网课眼镜,TR90弹性漆,近视镜,青春潮流',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:1 },
77 { goods_id: 1, img: '/static/img/goods/p2.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 77 { goods_id: 1, img: '/static/img/goods/p2.jpg', name: '镜框',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:2 },
78 { goods_id: 2, img: '/static/img/goods/p3.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 78 { goods_id: 2, img: '/static/img/goods/p3.jpg', name: '美瞳',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:3 },
79 { goods_id: 3, img: '/static/img/goods/p4.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 79 { goods_id: 3, img: '/static/img/goods/p4.jpg', name: '太阳镜',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:4 },
80 { goods_id: 4, img: '/static/img/goods/p5.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 80 { goods_id: 4, img: '/static/img/goods/p5.jpg', name: '镜片',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:1 },
81 { goods_id: 5, img: '/static/img/goods/p6.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 81 { goods_id: 5, img: '/static/img/goods/p6.jpg', name: '镜框',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:2 },
82 { goods_id: 6, img: '/static/img/goods/p7.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 82 { goods_id: 6, img: '/static/img/goods/p7.jpg', name: '美瞳',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:3 },
83 { goods_id: 7, img: '/static/img/goods/p8.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 83 { goods_id: 7, img: '/static/img/goods/p8.jpg', name: '太阳镜',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:4 },
84 { goods_id: 8, img: '/static/img/goods/p9.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, 84 { goods_id: 8, img: '/static/img/goods/p9.jpg', name: '镜片',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:1 },
85 { goods_id: 9, img: '/static/img/goods/p10.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' } 85 { goods_id: 9, img: '/static/img/goods/p10.jpg', name: '镜框',originCost:'¥198',price: '¥168', slogan:'1235人浏览',goodType:2 }
86 ], 86 ],
87 headerphoto:'', 87 headerphoto:'',
88 userName:'Adam' 88 userName:'Adam'
89 } 89 }
90 }, 90 },
91 onLoad: function() { 91 onLoad: function() {
92 store.dispatch('userRecommand/getRecommandList', { 92 store.dispatch('userRecommand/getRecommandList', {
93 uid: 2, 93 uid: 2,
94 }); 94 });
95 }, 95 },
96 computed: { 96 computed: {
97 userRecommandList() { 97 userRecommandList() {
98 console.log('recommandList', this.$store.state.userRecommand.recommandList); 98 console.log('recommandList', this.$store.state.userRecommand.recommandList);
99 return this.$store.state.userRecommand.recommandList; 99 return this.$store.state.userRecommand.recommandList;
100 } 100 }
101 }, 101 },
102 methods: { 102 methods: {
103 toMyOrder(){ 103 toMyOrder(){
104 uni.navigateTo({ 104 uni.navigateTo({
105 url: '../myOrder/myOrder', 105 url: '../myOrder/myOrder?current=0',
106 success: res => {}, 106 success: res => {},
107 fail: () => {}, 107 fail: () => {},
108 complete: () => {} 108 complete: () => {}
109 }); 109 });
110 }, 110 },
111 toPredelivery(){ 111 toPredelivery(){
112 uni.navigateTo({ 112 uni.navigateTo({
113 url: '../predelivery/predelivery', 113 url: '../myOrder/myOrder?current=2',
114 success: res => {}, 114 success: res => {},
115 fail: () => {}, 115 fail: () => {},
116 complete: () => {} 116 complete: () => {}
117 }); 117 });
118 }, 118 },
119 toMyOrderPaying(){ 119 toMyOrderPaying(){
120 uni.navigateTo({ 120 uni.navigateTo({
121 url: '../myorderPaying/myorderPaying', 121 url: '../myOrder/myOrder?current=1',
122 success: res => {}, 122 success: res => {},
123 fail: () => {}, 123 fail: () => {},
124 complete: () => {} 124 complete: () => {}
125 }); 125 });
126 }, 126 },
127 torefundment(){ 127 torefundment(){
128 uni.navigateTo({ 128 uni.navigateTo({
129 url:'../refundment/refundment', 129 url:'../refundment/refundment',
130 }) 130 })
131 }, 131 },
132 torefunProgress(){ 132 torefunProgress(){
133 uni.navigateTo({ 133 uni.navigateTo({
134 url:'../refundProgress/refundProgress' 134 url:'../refundProgress/refundProgress'
135 }) 135 })
136 } 136 }
137 } 137 }
138 } 138 }
139 </script> 139 </script>
140 140
141 <style lang="scss"> 141 <style lang="scss">
142 .warp{ 142 .warp{
143 font-size: 24rpx; 143 font-size: 24rpx;
144 background-color: #f2f2f2; 144 background-color: #f2f2f2;
145 height: 100vh; 145 height: 100vh;
146 } 146 }
147 .content { 147 .content {
148 display: flex; 148 display: flex;
149 flex-direction: column; 149 flex-direction: column;
150 align-items: center; 150 align-items: center;
151 justify-content: center; 151 justify-content: center;
152 background-color: #F2F2F2; 152 background-color: #F2F2F2;
153 } 153 }
154 .userInfo{ 154 .userInfo{
155 background-image: linear-gradient(270deg, #FFA481 0%, #FF6B4A 66%); 155 background-image: linear-gradient(270deg, #FFA481 0%, #FF6B4A 66%);
156 width: 100%; 156 width: 100%;
157 height: 240rpx; 157 height: 240rpx;
158 color: #FFFFFF; 158 color: #FFFFFF;
159 padding: 60rpx 82rpx 80rpx 44rpx; 159 padding: 60rpx 82rpx 80rpx 44rpx;
160 box-sizing: border-box; 160 box-sizing: border-box;
161 display: flex; 161 display: flex;
162 flex-direction: row; 162 flex-direction: row;
163 justify-content: space-between; 163 justify-content: space-between;
164 align-items: flex-start; 164 align-items: flex-start;
165 .info{ 165 .info{
166 display: flex; 166 display: flex;
167 flex-direction: row; 167 flex-direction: row;
168 justify-content: space-between; 168 justify-content: space-between;
169 align-items: center; 169 align-items: center;
170 image{ 170 image{
171 border-radius: 50rpx; 171 border-radius: 50rpx;
172 height: 100rpx ; 172 height: 100rpx ;
173 width: 100rpx; 173 width: 100rpx;
174 margin-right: 40rpx; 174 margin-right: 40rpx;
175 } 175 }
176 .infoText{ 176 .infoText{
177 display: flex; 177 display: flex;
178 flex-direction: column; 178 flex-direction: column;
179 justify-content: space-between; 179 justify-content: space-between;
180 align-items: flex-scetart; 180 align-items: flex-scetart;
181 .userName{ 181 .userName{
182 font-size: 18px; 182 font-size: 18px;
183 color: #FFFFFF; 183 color: #FFFFFF;
184 margin-bottom: 8rpx; 184 margin-bottom: 8rpx;
185 } 185 }
186 .nickName{ 186 .nickName{
187 font-size: 12px; 187 font-size: 12px;
188 color: #FFFFFF; 188 color: #FFFFFF;
189 } 189 }
190 } 190 }
191 } 191 }
192 .service{ 192 .service{
193 image{ 193 image{
194 height: 36rpx; 194 height: 36rpx;
195 width: 36rpx; 195 width: 36rpx;
196 } 196 }
197 } 197 }
198 } 198 }
199 .myOrder{ 199 .myOrder{
200 width: 100%; 200 width: 100%;
201 height: 296rpx; 201 height: 296rpx;
202 margin-top: 20rpx; 202 margin-top: 20rpx;
203 margin-bottom: 20rpx; 203 margin-bottom: 20rpx;
204 padding: 0 40rpx; 204 padding: 0 40rpx;
205 box-sizing: border-box; 205 box-sizing: border-box;
206 background: #FFFFFF; 206 background: #FFFFFF;
207 box-shadow: 0 0 4px 0 rgba(133,107,107,0.10); 207 box-shadow: 0 0 4px 0 rgba(133,107,107,0.10);
208 border-radius: 6px; 208 border-radius: 6px;
209 border-radius: 6px; 209 border-radius: 6px;
210 display: flex; 210 display: flex;
211 flex-direction: column; 211 flex-direction: column;
212 justify-content: space-around; 212 justify-content: space-around;
213 align-items: center; 213 align-items: center;
214 .orderHeader{ 214 .orderHeader{
215 width: 100%; 215 width: 100%;
216 height: 100rpx; 216 height: 100rpx;
217 display: flex; 217 display: flex;
218 flex-direction: row; 218 flex-direction: row;
219 justify-content: space-between; 219 justify-content: space-between;
220 align-items: center; 220 align-items: center;
221 border-bottom: 1px solid #E9E9E9;; 221 border-bottom: 1px solid #E9E9E9;;
222 font-weight: bold; 222 font-weight: bold;
223 font-size: 18px; 223 font-size: 18px;
224 color: #333333; 224 color: #333333;
225 .btn{ 225 .btn{
226 font-size: 12px; 226 font-size: 12px;
227 color: #999999; 227 color: #999999;
228 image{ 228 image{
229 margin-left: 20rpx; 229 margin-left: 20rpx;
230 height: 16rpx; 230 height: 16rpx;
231 width: 8rpx; 231 width: 8rpx;
232 } 232 }
233 } 233 }
234 } 234 }
235 .orderBody{ 235 .orderBody{
236 width: 100%; 236 width: 100%;
237 display: flex; 237 display: flex;
238 flex-direction: row; 238 flex-direction: row;
239 justify-content: space-between; 239 justify-content: space-between;
240 align-items: center; 240 align-items: center;
241 .item{ 241 .item{
242 display: flex; 242 display: flex;
243 flex-direction: column; 243 flex-direction: column;
244 align-items: center; 244 align-items: center;
245 image{ 245 image{
246 width: 46rpx; 246 width: 46rpx;
247 height: 46rpx; 247 height: 46rpx;
248 } 248 }
249 text{ 249 text{
250 margin-top: 24rpx; 250 margin-top: 24rpx;
251 font-size: 12px; 251 font-size: 12px;
252 color: #333333; 252 color: #333333;
253 } 253 }
254 } 254 }
255 } 255 }
256 } 256 }
257 .recommend{ 257 .recommend{
258 background: #FFFFFF; 258 background: #FFFFFF;
259 box-shadow: 0 0 4px 0 rgba(133,107,107,0.10); 259 box-shadow: 0 0 4px 0 rgba(133,107,107,0.10);
260 border-radius: 6px; 260 border-radius: 6px;
261 border-radius: 6px; 261 border-radius: 6px;
262 width: 100%; 262 width: 100%;
263 .title{ 263 .title{
264 display: flex; 264 display: flex;
265 flex-direction: row; 265 flex-direction: row;
266 align-items: center; 266 align-items: center;
267 justify-content: space-between; 267 justify-content: space-between;
268 padding: 20rpx 40rpx; 268 padding: 20rpx 40rpx;
269 .line{ 269 .line{
270 width: 264rpx; 270 width: 264rpx;
271 height: 1rpx; 271 height: 1rpx;
272 border-bottom: 1px solid #EAEAEA; 272 border-bottom: 1px solid #EAEAEA;
273 } 273 }
274 .text{ 274 .text{
275 font-family: PingFangSC-Medium; 275 font-family: PingFangSC-Medium;
276 font-size: 14px; 276 font-size: 14px;
277 color: #333333; 277 color: #333333;
278 letter-spacing: -0.26px; 278 letter-spacing: -0.26px;
279 text-align: justify; 279 text-align: justify;
280 line-height: 24px; 280 line-height: 24px;
281 } 281 }
282 } 282 }
283 .goods-list{ 283 .goods-list{
284 .loading-text{ 284 .loading-text{
285 width: 100%; 285 width: 100%;
286 display: flex; 286 display: flex;
287 justify-content: center; 287 justify-content: center;
288 align-items: center; 288 align-items: center;
289 height: 30px; 289 height: 30px;
290 color: #979797; 290 color: #979797;
291 font-size: 12px; 291 font-size: 12px;
292 } 292 }
293 .product-list{ 293 .product-list{
294 width: 92%; 294 width: 92%;
295 padding: 0 4% 3vw 4%; 295 padding: 0 4% 3vw 4%;
296 display: flex; 296 display: flex;
297 justify-content: space-between; 297 justify-content: space-between;
298 flex-wrap: wrap; 298 flex-wrap: wrap;
299 .product{ 299 .product{
300 width: 48%; 300 width: 48%;
301 margin: 0 0 20rpx 0; 301 margin: 0 0 20rpx 0;
302 background: #FFFFFF; 302 background: #FFFFFF;
303 border: 1px solid #F2F2F2; 303 border: 1px solid #F2F2F2;
304 } 304 }
305 } 305 }
306 } 306 }
307 } 307 }
308 308
309 </style> 309 </style>
310 310
src/store/modules/categoryOrder.js
File was created 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 };
41
1 const urlAlias = { 1 const urlAlias = {
2 // 首页 2 // <<<<<<< HEAD
3 shopList: '/app/prod/list', // 获取首页商品列表 3 // 首页
4 4 shopList: '/app/prod/list', // 获取首页商品列表
5 5
6 6
7 // 我的订单
8 orderList: '/app/order/list', // 获取订单列表
9 7
10 8 // 我的订单
11 // 购物车 9 orderList: '/app/order/list', // 获取订单列表
12 cartList: '/app/cart/list', // 获取购物车列表 10
13 11
14 // 我的 12 // 购物车
15 recommandList:'/app/prod/recommand', // 获取用户个性化推荐商品 13 cartList: '/app/cart/list', // 获取购物车列表
16 } 14
17 15 // 我的
18 export default urlAlias; 16 recommandList:'/app/prod/recommand', // 获取用户个性化推荐商品
19 17 // =======
18 // 获取首页商品列表
19 shopList: '/app/prod/list',
20
21 // 获取首页商品列表
22 category: '/app/prod/category',
23 // >>>>>>> 09a4a9a0aa68e86f0c0a8b5b85adc0cca5b04c66
24 }
25