Commit f72f302c7a1e081041fbebcbfc6184624089581e
Exists in
master
合并冲突
Showing
10 changed files
Show diff stats
src/components/CommodityCard/CommodityCard.vue
| 1 | -<template> | |
| 2 | - <view class="card" @tap="toGoods(goods.goods_id,goods.goodType)"> | |
| 3 | - <image mode="widthFix" :src="goods.img" ></image> | |
| 4 | - <view class="name">{{goods.name}}</view> | |
| 5 | - <view class="info"> | |
| 6 | - <view class="priceBox"> | |
| 7 | - <view class="price">{{goods.price}}</view> | |
| 8 | - <view class="originCost"> | |
| 9 | - {{goods.originCost}} | |
| 10 | - </view> | |
| 11 | - </view> | |
| 12 | - <view class="slogan">{{goods.slogan}}</view> | |
| 13 | - </view> | |
| 14 | - </view> | |
| 15 | -</template> | |
| 16 | - | |
| 17 | -<script> | |
| 18 | - export default { | |
| 19 | - props: { | |
| 20 | - /** | |
| 21 | - * 商品数据 | |
| 22 | - */ | |
| 23 | - goods: { | |
| 24 | - goods_id: Number, | |
| 25 | - img: String, | |
| 26 | - name: String, | |
| 27 | - originCost:String, | |
| 28 | - price: String, | |
| 29 | - slogan:String, | |
| 30 | - goodType:String, | |
| 31 | - } | |
| 32 | - | |
| 33 | - }, | |
| 34 | - created() { | |
| 35 | - console.log(this.goods) | |
| 36 | - }, | |
| 37 | - data() { | |
| 38 | - return { | |
| 39 | - | |
| 40 | - }; | |
| 41 | - }, | |
| 42 | - methods:{ | |
| 43 | - toGoods(id,type){ | |
| 44 | - // console.log('toGoods =====> id======>', id) | |
| 45 | - // console.log(type) | |
| 46 | - switch(type){ | |
| 47 | - case 1: | |
| 48 | - uni.navigateTo({ | |
| 49 | - url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 50 | - success: res => {}, | |
| 51 | - fail: () => {}, | |
| 52 | - complete: () => {} | |
| 53 | - }); | |
| 54 | - break; | |
| 55 | - case 2: | |
| 56 | - uni.navigateTo({ | |
| 57 | - url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 58 | - success: res => {}, | |
| 59 | - fail: () => {}, | |
| 60 | - complete: () => {} | |
| 61 | - }); | |
| 62 | - break; | |
| 63 | - case 3: | |
| 64 | - uni.navigateTo({ | |
| 65 | - url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 66 | - success: res => {}, | |
| 67 | - fail: () => {}, | |
| 68 | - complete: () => {} | |
| 69 | - }); | |
| 70 | - break; | |
| 71 | - case 4: | |
| 72 | - uni.navigateTo({ | |
| 73 | - url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 74 | - success: res => {}, | |
| 75 | - fail: () => {}, | |
| 76 | - complete: () => {} | |
| 77 | - }); | |
| 78 | - break; | |
| 79 | - default : | |
| 80 | - break | |
| 81 | - } | |
| 82 | - } | |
| 83 | - } | |
| 84 | - } | |
| 85 | -</script> | |
| 86 | - | |
| 87 | -<style lang="scss"> | |
| 88 | - image{ | |
| 89 | - width: 100%; | |
| 90 | - height: 120rpx; | |
| 91 | - } | |
| 92 | - .name{ | |
| 93 | - width: 92%; | |
| 94 | - height: 54rpx; | |
| 95 | - padding: 5px 4%; | |
| 96 | - display: -webkit-box; | |
| 97 | - -webkit-box-orient: vertical; | |
| 98 | - -webkit-line-clamp: 2; | |
| 99 | - text-align: justify; | |
| 100 | - overflow: hidden; | |
| 101 | - font-size: 24rpx; | |
| 102 | - color: #333333; | |
| 103 | - } | |
| 104 | - .info{ | |
| 105 | - display: flex; | |
| 106 | - justify-content: space-between; | |
| 107 | - align-items: center; | |
| 108 | - width: 92%; | |
| 109 | - padding: 5px 4% 5px 4%; | |
| 110 | - .priceBox{ | |
| 111 | - display: flex; | |
| 112 | - justify-content: space-between; | |
| 113 | - align-items: center; | |
| 114 | - .price{ | |
| 115 | - color: #EB5D3B; | |
| 116 | - font-size: 28rpx; | |
| 117 | - font-weight: 600; | |
| 118 | - margin-right: 10rpx; | |
| 119 | - } | |
| 120 | - .originCost{ | |
| 121 | - text-decoration:line-through; | |
| 122 | - color: #999999; | |
| 123 | - font-size: 20rpx; | |
| 124 | - } | |
| 125 | - | |
| 126 | - } | |
| 127 | - .slogan{ | |
| 128 | - color: #999999; | |
| 129 | - font-size: 20rpx; | |
| 130 | - } | |
| 131 | - } | |
| 132 | -</style> | |
| 1 | +<template> | |
| 2 | + <view class="card" @tap="toGoods(goods.goods_id,goods.goodType)"> | |
| 3 | + <image mode="widthFix" :src="goods.img" ></image> | |
| 4 | + <view class="name">{{goods.name}}</view> | |
| 5 | + <view class="info"> | |
| 6 | + <view class="priceBox"> | |
| 7 | + <view class="price">{{goods.price}}</view> | |
| 8 | + <view class="originCost"> | |
| 9 | + {{goods.originCost}} | |
| 10 | + </view> | |
| 11 | + </view> | |
| 12 | + <view class="slogan">{{goods.slogan}}</view> | |
| 13 | + </view> | |
| 14 | + </view> | |
| 15 | +</template> | |
| 16 | + | |
| 17 | +<script> | |
| 18 | + export default { | |
| 19 | + props: { | |
| 20 | + /** | |
| 21 | + * 商品数据 | |
| 22 | + */ | |
| 23 | + goods: { | |
| 24 | + goods_id: Number, | |
| 25 | + img: String, | |
| 26 | + name: String, | |
| 27 | + originCost:String, | |
| 28 | + price: String, | |
| 29 | + slogan:String, | |
| 30 | + goodType:String, | |
| 31 | + } | |
| 32 | + | |
| 33 | + }, | |
| 34 | + created() { | |
| 35 | + console.log(this.goods) | |
| 36 | + }, | |
| 37 | + data() { | |
| 38 | + return { | |
| 39 | + | |
| 40 | + }; | |
| 41 | + }, | |
| 42 | + methods:{ | |
| 43 | + toGoods(id,type){ | |
| 44 | + // console.log('toGoods =====> id======>', id) | |
| 45 | + // console.log(type) | |
| 46 | + switch(type){ | |
| 47 | + case 1: | |
| 48 | + uni.navigateTo({ | |
| 49 | + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 50 | + success: res => {}, | |
| 51 | + fail: () => {}, | |
| 52 | + complete: () => {} | |
| 53 | + }); | |
| 54 | + break; | |
| 55 | + case 2: | |
| 56 | + uni.navigateTo({ | |
| 57 | + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 58 | + success: res => {}, | |
| 59 | + fail: () => {}, | |
| 60 | + complete: () => {} | |
| 61 | + }); | |
| 62 | + break; | |
| 63 | + case 3: | |
| 64 | + uni.navigateTo({ | |
| 65 | + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 66 | + success: res => {}, | |
| 67 | + fail: () => {}, | |
| 68 | + complete: () => {} | |
| 69 | + }); | |
| 70 | + break; | |
| 71 | + case 4: | |
| 72 | + uni.navigateTo({ | |
| 73 | + url: `../frameDetail/frameDetail?oderId=`+id+`&goodType=`+type, | |
| 74 | + success: res => {}, | |
| 75 | + fail: () => {}, | |
| 76 | + complete: () => {} | |
| 77 | + }); | |
| 78 | + break; | |
| 79 | + default : | |
| 80 | + break | |
| 81 | + } | |
| 82 | + } | |
| 83 | + } | |
| 84 | + } | |
| 85 | +</script> | |
| 86 | + | |
| 87 | +<style lang="scss"> | |
| 88 | + image{ | |
| 89 | + width: 100%; | |
| 90 | + height: 120rpx; | |
| 91 | + } | |
| 92 | + .name{ | |
| 93 | + width: 92%; | |
| 94 | + height: 54rpx; | |
| 95 | + padding: 5px 4%; | |
| 96 | + display: -webkit-box; | |
| 97 | + -webkit-box-orient: vertical; | |
| 98 | + -webkit-line-clamp: 2; | |
| 99 | + text-align: justify; | |
| 100 | + overflow: hidden; | |
| 101 | + font-size: 24rpx; | |
| 102 | + color: #333333; | |
| 103 | + } | |
| 104 | + .info{ | |
| 105 | + display: flex; | |
| 106 | + justify-content: space-between; | |
| 107 | + align-items: center; | |
| 108 | + width: 92%; | |
| 109 | + padding: 5px 4% 5px 4%; | |
| 110 | + .priceBox{ | |
| 111 | + display: flex; | |
| 112 | + justify-content: space-between; | |
| 113 | + align-items: center; | |
| 114 | + .price{ | |
| 115 | + color: #EB5D3B; | |
| 116 | + font-size: 28rpx; | |
| 117 | + font-weight: 600; | |
| 118 | + margin-right: 10rpx; | |
| 119 | + } | |
| 120 | + .originCost{ | |
| 121 | + text-decoration:line-through; | |
| 122 | + color: #999999; | |
| 123 | + font-size: 20rpx; | |
| 124 | + } | |
| 125 | + | |
| 126 | + } | |
| 127 | + .slogan{ | |
| 128 | + color: #999999; | |
| 129 | + font-size: 20rpx; | |
| 130 | + } | |
| 131 | + } | |
| 132 | +</style> | |
| 133 | 133 | \ No newline at end of file |
| ... | ... |
src/pages.json
| 1 | -{ | |
| 2 | - "pages": [ | |
| 3 | - { | |
| 4 | - "path": "pages/index/index", | |
| 5 | - "style": { | |
| 6 | - "navigationBarTitleText": "商城一览" | |
| 7 | - } | |
| 8 | - }, | |
| 9 | - { | |
| 10 | - "path" : "pages/myOrder/myOrder", | |
| 11 | - "style" : { | |
| 12 | - "navigationBarTitleText": "我的订单"} | |
| 13 | - }, | |
| 14 | - { | |
| 15 | - "path": "pages/frameDetail/frameDetail", | |
| 16 | - "style": { | |
| 17 | - "navigationBarTitleText": "产品详情" | |
| 18 | - } | |
| 19 | - }, | |
| 20 | - { | |
| 21 | - "path": "pages/lensDetails/lensDetails", | |
| 22 | - "style": { | |
| 23 | - "navigationBarTitleText": "产品详情" | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - { | |
| 27 | - "path": "pages/cart/cart", | |
| 28 | - "style": { | |
| 29 | - "navigationBarTitleText": "购物车" | |
| 30 | - } | |
| 31 | - }, | |
| 32 | - { | |
| 33 | - "path" : "pages/purchaseLenses/purchaseLenses", | |
| 34 | - "style" : { | |
| 35 | - "navigationBarTitleText": "产品选购" | |
| 36 | - } | |
| 37 | - }, | |
| 38 | - { | |
| 39 | - "path" : "pages/refundProgress/refundProgress", | |
| 40 | - "style": { | |
| 41 | - "navigationBarTitleText": "申请退款" | |
| 42 | - } | |
| 43 | - }, | |
| 44 | - { | |
| 45 | - "path": "pages/addAddress/addAddress", | |
| 46 | - "style": { | |
| 47 | - "navigationBarTitleText": "新增地址" | |
| 48 | - } | |
| 49 | - }, | |
| 50 | - { | |
| 51 | - "path" : "pages/confirmOrder/confirmOrder", | |
| 52 | - "style" : { | |
| 53 | - "navigationBarTitleText": "确认订单" | |
| 54 | - } | |
| 55 | - }, | |
| 56 | - { | |
| 57 | - "path": "pages/user/user", | |
| 58 | - "style": { | |
| 59 | - "navigationBarTitleText": "我的" | |
| 60 | - } | |
| 61 | - }, | |
| 62 | - { | |
| 63 | - "path": "pages/refundment/refundWays" | |
| 64 | - }, | |
| 65 | - { | |
| 66 | - "path": "pages/refundment/refundment" | |
| 67 | - }, | |
| 68 | - { | |
| 69 | - "path": "pages/predelivery/predelivery" | |
| 70 | - }, | |
| 71 | - { | |
| 72 | - "path": "pages/customerService/customerService", | |
| 73 | - "style":{ | |
| 74 | - "navigationBarTitleText" : "在线客服" | |
| 75 | - } | |
| 76 | - }, | |
| 77 | - { | |
| 78 | - "path": "pages/myOrderPaying/myOrderPaying", | |
| 79 | - "style":{ | |
| 80 | - "navigationBarTitleText" : "我的订单" | |
| 81 | - } | |
| 82 | - }, | |
| 83 | - { | |
| 84 | - "path": "pages/detailsChoiceArgs/detailsChoiceArgs", | |
| 85 | - "style":{ | |
| 86 | - "navigationBarTitleText" : "镜片名称名称" | |
| 87 | - } | |
| 88 | - }, | |
| 89 | - { | |
| 90 | - "path" : "pages/detailStandard/detailStandard_sun", | |
| 91 | - "style": { | |
| 92 | - "navigationBarTitleText": "太阳镜选购页" | |
| 93 | - } | |
| 94 | - }, | |
| 95 | - { | |
| 96 | - "path" : "pages/detailStandard/detailStandard_k", | |
| 97 | - "style": { | |
| 98 | - "navigationBarTitleText": "镜框选购页" | |
| 99 | - } | |
| 100 | - } | |
| 101 | - | |
| 102 | - ], | |
| 103 | - "globalStyle": { | |
| 104 | - "navigationBarTextStyle": "black", | |
| 105 | - "navigationBarTitleText": "uni-app", | |
| 106 | - "navigationBarBackgroundColor": "#F8F8F8", | |
| 107 | - "backgroundColor": "#F8F8F8" | |
| 108 | - }, | |
| 109 | - "tabBar": { | |
| 110 | - "color": "#C0C4CC", | |
| 111 | - "selectedColor": "#fa436a", | |
| 112 | - "borderStyle": "black", | |
| 113 | - "backgroundColor": "#ffffff", | |
| 114 | - "list": [{ | |
| 115 | - "pagePath": "pages/index/index", | |
| 116 | - "iconPath": "static/tab-home.png", | |
| 117 | - "selectedIconPath": "static/tab-home-current.png", | |
| 118 | - "text": "首页" | |
| 119 | - }, | |
| 120 | - { | |
| 121 | - "pagePath": "pages/cart/cart", | |
| 122 | - "iconPath": "static/tab-cart.png", | |
| 123 | - "selectedIconPath": "static/tab-cart-current.png", | |
| 124 | - "text": "购物车" | |
| 125 | - }, | |
| 126 | - { | |
| 127 | - "pagePath": "pages/user/user", | |
| 128 | - "iconPath": "static/tab-my.png", | |
| 129 | - "selectedIconPath": "static/tab-my-current.png", | |
| 130 | - "text": "我的" | |
| 131 | - } | |
| 132 | - ] | |
| 133 | - }, | |
| 134 | - "condition" : { //模式配置,仅开发期间生效 | |
| 135 | - "current": 0, //当前激活的模式(list 的索引项) | |
| 136 | - "list": [ | |
| 137 | - { | |
| 138 | - "name": "", //模式名称 | |
| 139 | - "path": "", //启动页面,必选 | |
| 140 | - "query": "" //启动参数,在页面的onLoad函数里面得到 | |
| 141 | - } | |
| 142 | - ] | |
| 143 | - } | |
| 144 | -} | |
| 145 | 1 | \ No newline at end of file |
| 2 | +{ | |
| 3 | + "pages" : [ | |
| 4 | + { | |
| 5 | + "path" : "pages/myOrder/myOrder", | |
| 6 | + "style" : { | |
| 7 | + "navigationBarTitleText" : "我的订单" | |
| 8 | + } | |
| 9 | + }, | |
| 10 | + { | |
| 11 | + "path" : "pages/cart/cart", | |
| 12 | + "style" : { | |
| 13 | + "navigationBarTitleText" : "购物车" | |
| 14 | + } | |
| 15 | + }, | |
| 16 | + { | |
| 17 | + "path" : "pages/index/index", | |
| 18 | + "style" : { | |
| 19 | + "navigationBarTitleText" : "商城一览" | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + { | |
| 23 | + "path" : "pages/frameDetail/frameDetail", | |
| 24 | + "style" : { | |
| 25 | + "navigationBarTitleText" : "产品详情" | |
| 26 | + } | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "path" : "pages/lensDetails/lensDetails", | |
| 30 | + "style" : { | |
| 31 | + "navigationBarTitleText" : "产品详情" | |
| 32 | + } | |
| 33 | + }, | |
| 34 | + { | |
| 35 | + "path" : "pages/purchaseLenses/purchaseLenses", | |
| 36 | + "style" : { | |
| 37 | + "navigationBarTitleText" : "产品选购" | |
| 38 | + } | |
| 39 | + }, | |
| 40 | + { | |
| 41 | + "path" : "pages/refundProgress/refundProgress", | |
| 42 | + "style" : { | |
| 43 | + "navigationBarTitleText" : "申请退款" | |
| 44 | + } | |
| 45 | + }, | |
| 46 | + { | |
| 47 | + "path" : "pages/addAddress/addAddress", | |
| 48 | + "style" : { | |
| 49 | + "navigationBarTitleText" : "新增地址" | |
| 50 | + } | |
| 51 | + }, | |
| 52 | + { | |
| 53 | + "path" : "pages/confirmOrder/confirmOrder", | |
| 54 | + "style" : { | |
| 55 | + "navigationBarTitleText" : "确认订单" | |
| 56 | + } | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + "path" : "pages/user/user", | |
| 60 | + "style" : { | |
| 61 | + "navigationBarTitleText" : "我的" | |
| 62 | + } | |
| 63 | + }, | |
| 64 | + { | |
| 65 | + "path" : "pages/refundment/refundWays" | |
| 66 | + }, | |
| 67 | + { | |
| 68 | + "path" : "pages/refundment/refundment" | |
| 69 | + }, | |
| 70 | + { | |
| 71 | + "path" : "pages/predelivery/predelivery" | |
| 72 | + }, | |
| 73 | + { | |
| 74 | + "path" : "pages/customerService/customerService", | |
| 75 | + "style" : { | |
| 76 | + "navigationBarTitleText" : "在线客服" | |
| 77 | + } | |
| 78 | + }, | |
| 79 | + { | |
| 80 | + "path" : "pages/myOrderPaying/myOrderPaying", | |
| 81 | + "style" : { | |
| 82 | + "navigationBarTitleText" : "我的订单" | |
| 83 | + } | |
| 84 | + }, | |
| 85 | + { | |
| 86 | + "path" : "pages/detailsChoiceArgs/detailsChoiceArgs", | |
| 87 | + "style" : { | |
| 88 | + "navigationBarTitleText" : "镜片名称名称" | |
| 89 | + } | |
| 90 | + }, | |
| 91 | + { | |
| 92 | + "path" : "pages/detailStandard/detailStandard_sun", | |
| 93 | + "style" : { | |
| 94 | + "navigationBarTitleText" : "太阳镜选购页" | |
| 95 | + } | |
| 96 | + }, | |
| 97 | + { | |
| 98 | + "path" : "pages/detailStandard/detailStandard_k", | |
| 99 | + "style" : { | |
| 100 | + "navigationBarTitleText" : "镜框选购页" | |
| 101 | + } | |
| 102 | + } | |
| 103 | + ], | |
| 104 | + "globalStyle" : { | |
| 105 | + "navigationBarTextStyle" : "black", | |
| 106 | + "navigationBarTitleText" : "uni-app", | |
| 107 | + "navigationBarBackgroundColor" : "#F8F8F8", | |
| 108 | + "backgroundColor" : "#F8F8F8" | |
| 109 | + }, | |
| 110 | + "tabBar" : { | |
| 111 | + "color" : "#C0C4CC", | |
| 112 | + "selectedColor" : "#fa436a", | |
| 113 | + "borderStyle" : "black", | |
| 114 | + "backgroundColor" : "#ffffff", | |
| 115 | + "list" : [ | |
| 116 | + { | |
| 117 | + "pagePath" : "pages/index/index", | |
| 118 | + "iconPath" : "static/tab-home.png", | |
| 119 | + "selectedIconPath" : "static/tab-home-current.png", | |
| 120 | + "text" : "首页" | |
| 121 | + }, | |
| 122 | + { | |
| 123 | + "pagePath" : "pages/cart/cart", | |
| 124 | + "iconPath" : "static/tab-cart.png", | |
| 125 | + "selectedIconPath" : "static/tab-cart-current.png", | |
| 126 | + "text" : "购物车" | |
| 127 | + }, | |
| 128 | + { | |
| 129 | + "pagePath" : "pages/user/user", | |
| 130 | + "iconPath" : "static/tab-my.png", | |
| 131 | + "selectedIconPath" : "static/tab-my-current.png", | |
| 132 | + "text" : "我的" | |
| 133 | + } | |
| 134 | + ] | |
| 135 | + }, | |
| 136 | + "condition" : { | |
| 137 | + //模式配置,仅开发期间生效 | |
| 138 | + "current" : 0, //当前激活的模式(list 的索引项) | |
| 139 | + "list" : [ | |
| 140 | + { | |
| 141 | + "name" : "", //模式名称 | |
| 142 | + "path" : "", //启动页面,必选 | |
| 143 | + "query" : "" //启动参数,在页面的onLoad函数里面得到 | |
| 144 | + } | |
| 145 | + ] | |
| 146 | + } | |
| 147 | +} | |
| ... | ... |
src/pages/cart/cart.vue
| ... | ... | @@ -3,7 +3,6 @@ |
| 3 | 3 | |
| 4 | 4 | <view class="card"> |
| 5 | 5 | <view class="cardHeader"> |
| 6 | - <!-- <MyCheckbox :isOpenProp="controlCheck.partent" ></MyCheckbox> --> | |
| 7 | 6 | <block v-if="pIsoPen"> |
| 8 | 7 | <view class="partentChecked" @click="pChange(pIsoPen)"> |
| 9 | 8 | <span class="status correct"></span> |
| ... | ... | @@ -17,7 +16,6 @@ |
| 17 | 16 | </view> |
| 18 | 17 | |
| 19 | 18 | <view class="cardBody"> |
| 20 | - <!-- <MyCheckbox :isOpenProp="controlCheck.child1"></MyCheckbox> --> | |
| 21 | 19 | <template v-if="childIsOpen.child1"> |
| 22 | 20 | <view class="partentChecked" @click="cChange(childIsOpen.child1,'child1')"> |
| 23 | 21 | <span class="status correct"></span> |
| ... | ... | @@ -33,7 +31,7 @@ |
| 33 | 31 | <view class="infoRight"> |
| 34 | 32 | <text class="goodName">眼镜名称眼镜名称眼镜名称眼镜名称</text> |
| 35 | 33 | <view class="describ"><text>颜色 玫瑰金 /材质 钛合金 / 功能 防日光 / 配件 免费送 /折射 … </text> |
| 36 | - <!-- <text class="icon">></text> --> | |
| 34 | + <view class="icon"></view> | |
| 37 | 35 | </view> |
| 38 | 36 | <view class="priceBox"> |
| 39 | 37 | <view class="price">¥{{198}}</view> |
| ... | ... | @@ -64,7 +62,7 @@ |
| 64 | 62 | <view class="infoRight"> |
| 65 | 63 | <text class="goodName">眼镜名称眼镜名称眼镜名称眼镜名称</text> |
| 66 | 64 | <view class="describ"><text>颜色 玫瑰金 /材质 钛合金 / 功能 防日光 / 配件 免费送 /折射 … </text> |
| 67 | - <!-- <text class="icon">></text> --> | |
| 65 | + <view class="icon"></view> | |
| 68 | 66 | </view> |
| 69 | 67 | <view class="priceBox"> |
| 70 | 68 | <view class="price">¥198</view> |
| ... | ... | @@ -93,6 +91,8 @@ |
| 93 | 91 | </template> |
| 94 | 92 | |
| 95 | 93 | <script> |
| 94 | + import store from '@/store'; | |
| 95 | + | |
| 96 | 96 | export default { |
| 97 | 97 | |
| 98 | 98 | data() { |
| ... | ... | @@ -107,10 +107,18 @@ |
| 107 | 107 | }, |
| 108 | 108 | } |
| 109 | 109 | }, |
| 110 | - onLoad() { | |
| 111 | - | |
| 112 | - } | |
| 113 | - , | |
| 110 | + computed:{ | |
| 111 | + cartList() { | |
| 112 | + // 也可以从 getters 获取 | |
| 113 | + console.log('cart-list', this.$store.state.cart.cartList); | |
| 114 | + return this.$store.state.cart.cartList; | |
| 115 | + } | |
| 116 | + }, | |
| 117 | + onLoad: function() { | |
| 118 | + store.dispatch('cart/getCartList',{ | |
| 119 | + uid: 1, //用户id | |
| 120 | + }); | |
| 121 | + }, | |
| 114 | 122 | methods: { |
| 115 | 123 | counter(isadd){ |
| 116 | 124 | if(isadd){ |
| ... | ... | @@ -251,6 +259,9 @@ |
| 251 | 259 | font-size: 20rpx; |
| 252 | 260 | color: #999999; |
| 253 | 261 | background: #F2F2F2; |
| 262 | + display: flex; | |
| 263 | + justify-content: center; | |
| 264 | + align-items: center; | |
| 254 | 265 | text{ |
| 255 | 266 | text-overflow: -o-ellipsis-lastline; |
| 256 | 267 | overflow: hidden; |
| ... | ... | @@ -262,7 +273,33 @@ |
| 262 | 273 | } |
| 263 | 274 | // .icon{ |
| 264 | 275 | // transform: rotate(90deg); |
| 276 | + // height: 13px; | |
| 277 | + // width: 20px; | |
| 278 | + | |
| 265 | 279 | // } |
| 280 | + .icon{ | |
| 281 | + width: 0; | |
| 282 | + height: 0; | |
| 283 | + border-left: 5px transparent; | |
| 284 | + border-right: 5px transparent; | |
| 285 | + border-top: 5px #979797; | |
| 286 | + border-bottom: 0 transparent; | |
| 287 | + border-style: solid; | |
| 288 | + position: relative; | |
| 289 | + margin-left: 10px; | |
| 290 | + // transform: scaleY(-1); | |
| 291 | + } | |
| 292 | + .icon::after{ | |
| 293 | + content: ''; | |
| 294 | + position: absolute; | |
| 295 | + top: -6.5px; | |
| 296 | + left: -5px; | |
| 297 | + border-left: 5px transparent; | |
| 298 | + border-right: 5px transparent; | |
| 299 | + border-top: 5px #FFFFFF; | |
| 300 | + border-bottom: 0 transparent; | |
| 301 | + border-style: solid; | |
| 302 | + } | |
| 266 | 303 | } |
| 267 | 304 | .priceBox{ |
| 268 | 305 | display: flex; |
| ... | ... |
src/pages/detailsChoiceArgs/compoents/MyCollapse.vue
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <view class="noRange"> |
| 23 | 23 | <block v-for="(item,index) in funList2" :key="item.key"> |
| 24 | 24 | <view v-bind:class="item.isChioce?'boxChoiced-C':'boxChoice-C'" |
| 25 | - :style="colorList[index]" @click="choice2(index,item.key-1,item.isChioce)"></view> | |
| 25 | + :style="colorList[index]" @click="choice2(index,item.isChioce)"></view> | |
| 26 | 26 | </block> |
| 27 | 27 | </view> |
| 28 | 28 | </block> |
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | <view class="noRange" style="max-width: 624rpx"> |
| 40 | 40 | <block v-for="(item,index) in funList2" :key="item.key"> |
| 41 | 41 | <view v-bind:class="item.isChioce?'boxChoiced':'boxChoice'" |
| 42 | - @click="choice2(index,item.key-1,item.isChioce)">{{item.name}}</view> | |
| 42 | + @click="choice2(index,item.isChioce)">{{item.name}}</view> | |
| 43 | 43 | </block> |
| 44 | 44 | </view> |
| 45 | 45 | </block> |
| ... | ... | @@ -103,21 +103,49 @@ |
| 103 | 103 | this.isOpen = !isopen |
| 104 | 104 | }, |
| 105 | 105 | choice(index,isChoice){ |
| 106 | - this.funList[index].isChioce = !isChoice | |
| 107 | - if(!isChoice){ | |
| 108 | - this.funContent[index] = this.funList[index].name | |
| 106 | + if(this.funList[index].type==="fun"){ | |
| 107 | + this.funList[index].isChioce = !isChoice | |
| 108 | + if(!isChoice){ | |
| 109 | + this.funContent[index] = this.funList[index].name | |
| 110 | + } | |
| 111 | + else{ | |
| 112 | + this.funContent[index] = '' | |
| 113 | + } | |
| 109 | 114 | } |
| 110 | - else{ | |
| 111 | - this.funContent[index] = '' | |
| 115 | + else if(this.funList[index].type==="kind"){ | |
| 116 | + for(let i=0;i<this.funList.length;i++){ | |
| 117 | + this.funList[i].isChioce = false | |
| 118 | + } | |
| 119 | + this.funList[index].isChioce = !isChoice | |
| 120 | + this.funContent[0]=this.funList[index].name | |
| 121 | + }else { | |
| 122 | + for(let i=0;i<this.funList.length;i++){ | |
| 123 | + this.funList[i].isChioce = false | |
| 124 | + } | |
| 125 | + for(let i=0;i<this.funList2.length;i++){ | |
| 126 | + this.funList2[i].isChioce = false | |
| 127 | + } | |
| 128 | + this.funList[index].isChioce = !isChoice | |
| 129 | + this.funContent[0]=this.funList[index].name | |
| 112 | 130 | } |
| 113 | 131 | }, |
| 114 | - choice2(index,conIndex,isChoice){ | |
| 115 | - this.funList2[index].isChioce = !isChoice | |
| 116 | - if(!isChoice){ | |
| 117 | - this.funContent[conIndex] = this.funList2[index].name | |
| 132 | + choice2(index,isChoice){ | |
| 133 | + if(this.funList2[index].type==="kind"){ | |
| 134 | + for(let i=0;i<this.funList2.length;i++){ | |
| 135 | + this.funList2[i].isChioce = false | |
| 136 | + } | |
| 137 | + this.funList2[index].isChioce = !isChoice | |
| 138 | + this.funContent[1] = this.funList2[index].name | |
| 118 | 139 | } |
| 119 | 140 | else{ |
| 120 | - this.funContent[conIndex] = '' | |
| 141 | + for(let i=0;i<this.funList.length;i++){ | |
| 142 | + this.funList[i].isChioce = false | |
| 143 | + } | |
| 144 | + for(let i=0;i<this.funList2.length;i++){ | |
| 145 | + this.funList2[i].isChioce = false | |
| 146 | + } | |
| 147 | + this.funList2[index].isChioce = !isChoice | |
| 148 | + this.funContent[0]=this.funList2[index].name | |
| 121 | 149 | } |
| 122 | 150 | } |
| 123 | 151 | } |
| ... | ... |
src/pages/detailsChoiceArgs/detailsChoiceArgs.vue
| ... | ... | @@ -177,27 +177,27 @@ |
| 177 | 177 | // 实用功能参数 |
| 178 | 178 | funIsOpen:true, // 默认myCollapse开启 |
| 179 | 179 | funList: [ |
| 180 | - {"name":"防紫外线","isChioce": false,"key":1}, | |
| 181 | - {"name":"防蓝光","isChioce": false,"key":2}, | |
| 182 | - {"name":"智能变色","isChioce": false,"key":3}, | |
| 183 | - {"name":"易清洁","isChioce": false,"key":4}, | |
| 184 | - {"name":"防辐射","isChioce": false,"key":5}, | |
| 185 | - {"name":"抗疲劳","isChioce": false,"key":6}, | |
| 180 | + {"name":"防紫外线","isChioce": false,"key":1,"type": "fun"}, | |
| 181 | + {"name":"防蓝光","isChioce": false,"key":2,"type": "fun"}, | |
| 182 | + {"name":"智能变色","isChioce": false,"key":3,"type": "fun"}, | |
| 183 | + {"name":"易清洁","isChioce": false,"key":4,"type": "fun"}, | |
| 184 | + {"name":"防辐射","isChioce": false,"key":5,"type": "fun"}, | |
| 185 | + {"name":"抗疲劳","isChioce": false,"key":6,"type": "fun"}, | |
| 186 | 186 | ], |
| 187 | 187 | funContent:[], |
| 188 | 188 | |
| 189 | 189 | // 镜片种类参数 |
| 190 | 190 | kindIsOpen:true, |
| 191 | 191 | kindList1: [ |
| 192 | - {"name":"染色","isChioce":false,key:1}, | |
| 193 | - {"name":"渐变","isChioce":false,key:2}, | |
| 192 | + {"name":"染色","isChioce":false,key:1,"type": "kind"}, | |
| 193 | + {"name":"渐变","isChioce":false,key:2,"type": "kind"}, | |
| 194 | 194 | ], |
| 195 | 195 | kindList2: [ |
| 196 | - {"name":"JB234759","isChioce":false,key:3}, | |
| 197 | - {"name":"JB234759","isChioce":false,key:4}, | |
| 198 | - {"name":"JB234759","isChioce":false,key:5}, | |
| 199 | - {"name":"JB234759","isChioce":false,key:6}, | |
| 200 | - {"name":"JB234759","isChioce":false,key:7}, | |
| 196 | + {"name":"JB234759","isChioce":false,key:3,"type": "kind"}, | |
| 197 | + {"name":"JB234759","isChioce":false,key:4,"type": "kind"}, | |
| 198 | + {"name":"JB234759","isChioce":false,key:5,"type": "kind"}, | |
| 199 | + {"name":"JB234759","isChioce":false,key:6,"type": "kind"}, | |
| 200 | + {"name":"JB234759","isChioce":false,key:7,"type": "kind"}, | |
| 201 | 201 | ], |
| 202 | 202 | kindContent:[], |
| 203 | 203 | // 材质选择 |
| ... | ... |
src/pages/myOrderPaying/myOrderPaying.vue
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | </view> |
| 18 | 18 | <view class="order-user-body"> |
| 19 | 19 | <image src="../../static/myorder-paying-location.png"></image> |
| 20 | - <text class="p3">四川省 德阳市 旌阳区</br>黄河西路碧桂园3期 4单元 202</text> | |
| 20 | + <text class="p3">四川省 德阳市 旌阳区\n黄河西路碧桂园3期 4单元 202</text> | |
| 21 | 21 | </view> |
| 22 | 22 | </view> |
| 23 | 23 | <view class="order-info"> |
| ... | ... |
src/pages/user/user.vue
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <text>待付款</text> |
| 28 | 28 | </view> |
| 29 | 29 | <view class="item waitDeliver" @click="toPredelivery" > |
| 30 | - <image src="../../static/waitDeliver.png" mode="aspectFill"></image> | |
| 30 | + <image src="../../static/waitPay.png" mode="aspectFill"></image> | |
| 31 | 31 | <text>待发货</text> |
| 32 | 32 | </view> |
| 33 | 33 | <view class="item waitReceive" @click="torefunProgress"> |
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | <!-- 商品列表 --> |
| 50 | 50 | <view class="goods-list"> |
| 51 | 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 | 53 | <Card :goods = "goods"></Card> |
| 54 | 54 | </view> |
| 55 | 55 | </view> |
| ... | ... | @@ -62,7 +62,8 @@ |
| 62 | 62 | </template> |
| 63 | 63 | |
| 64 | 64 | <script> |
| 65 | - import Card from "@/components/CommodityCard/CommodityCard.vue" | |
| 65 | + import Card from "@/components/CommodityCard/CommodityCard.vue"; | |
| 66 | + import store from '@/store'; | |
| 66 | 67 | export default { |
| 67 | 68 | components: { |
| 68 | 69 | 'Card':Card |
| ... | ... | @@ -71,24 +72,32 @@ |
| 71 | 72 | return { |
| 72 | 73 | |
| 73 | 74 | //商品数据 |
| 74 | - goodsList:[ | |
| 75 | - { goods_id: 0, img: "/static/img/goods/p1.jpg", name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 76 | - { goods_id: 1, img: '/static/img/goods/p2.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 77 | - { goods_id: 2, img: '/static/img/goods/p3.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 78 | - { goods_id: 3, img: '/static/img/goods/p4.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 79 | - { goods_id: 4, img: '/static/img/goods/p5.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 80 | - { goods_id: 5, img: '/static/img/goods/p6.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 81 | - { goods_id: 6, img: '/static/img/goods/p7.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 82 | - { goods_id: 7, img: '/static/img/goods/p8.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 83 | - { goods_id: 8, img: '/static/img/goods/p9.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' }, | |
| 84 | - { goods_id: 9, img: '/static/img/goods/p10.jpg', name: '商品名称',originCost:'¥198',price: '¥168', slogan:'1235人浏览' } | |
| 85 | - ], | |
| 75 | + goodsList:[ | |
| 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人浏览',goodType:2 }, | |
| 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人浏览',goodType:4 }, | |
| 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人浏览',goodType:2 }, | |
| 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人浏览',goodType:4 }, | |
| 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人浏览',goodType:2 } | |
| 86 | + ], | |
| 86 | 87 | headerphoto:'', |
| 87 | 88 | userName:'Adam' |
| 88 | 89 | } |
| 89 | 90 | }, |
| 90 | - onLoad() { | |
| 91 | - | |
| 91 | + onLoad: function() { | |
| 92 | + store.dispatch('userRecommand/getRecommandList', { | |
| 93 | + uid: 2, | |
| 94 | + }); | |
| 95 | + }, | |
| 96 | + computed: { | |
| 97 | + userRecommandList() { | |
| 98 | + console.log('recommandList', this.$store.state.userRecommand.recommandList); | |
| 99 | + return this.$store.state.userRecommand.recommandList; | |
| 100 | + } | |
| 92 | 101 | }, |
| 93 | 102 | methods: { |
| 94 | 103 | toMyOrder(){ |
| ... | ... |
src/store/modules/cart.js
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +import urlAlias from '../url'; | |
| 2 | +import request from '../request'; | |
| 3 | + | |
| 4 | +const { cartList } = urlAlias; | |
| 5 | + | |
| 6 | +const state = { | |
| 7 | + cartList: [], | |
| 8 | +}; | |
| 9 | + | |
| 10 | +const mutations = { | |
| 11 | + INIT: (state, cartList) => { | |
| 12 | + state.cartList = cartList; | |
| 13 | + }, | |
| 14 | +}; | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | +const actions = { | |
| 19 | + | |
| 20 | + getCartList({ commit }, param) { | |
| 21 | + request({ | |
| 22 | + url: cartList, | |
| 23 | + success: (res) => { | |
| 24 | + | |
| 25 | + commit('INIT', res.data.data) | |
| 26 | + }, | |
| 27 | + fail: (res) => { | |
| 28 | + console.log("fail status === > ", res); | |
| 29 | + }, | |
| 30 | + complete: (res) => { | |
| 31 | + console.log("complete status === > ", res); | |
| 32 | + }, | |
| 33 | + }) | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | |
| 37 | + | |
| 38 | +export default { | |
| 39 | + namespaced: true, | |
| 40 | + state, | |
| 41 | + mutations, | |
| 42 | + actions, | |
| 43 | +}; | |
| 0 | 44 | \ No newline at end of file |
| ... | ... |
src/store/modules/userRecommand.js
| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | + import urlAlias from '../url'; | |
| 2 | + import request from '../request'; | |
| 3 | + | |
| 4 | + const { | |
| 5 | + recommandList | |
| 6 | + } = urlAlias; | |
| 7 | + | |
| 8 | +const state = { | |
| 9 | + recommandList: [], | |
| 10 | +}; | |
| 11 | + | |
| 12 | +const mutations = { | |
| 13 | + INIT: (state, list) => { | |
| 14 | + state.recommandList = list; | |
| 15 | + }, | |
| 16 | +}; | |
| 17 | + | |
| 18 | +const actions = { | |
| 19 | + getRecommandList({ commit }, param) { | |
| 20 | + request({ | |
| 21 | + url: recommandList, | |
| 22 | + success: (res) => { | |
| 23 | + console.log(res.data) | |
| 24 | + commit('INIT', res.data.data) | |
| 25 | + }, | |
| 26 | + fail: (res) => { | |
| 27 | + console.log("fail status === > ", res); | |
| 28 | + }, | |
| 29 | + complete: (res) => { | |
| 30 | + console.log("complete status === > ", res); | |
| 31 | + }, | |
| 32 | + }) | |
| 33 | + }, | |
| 34 | +}; | |
| 35 | + | |
| 36 | +export default { | |
| 37 | + namespaced: true, | |
| 38 | + state, | |
| 39 | + mutations, | |
| 40 | + actions, | |
| 41 | +}; | |
| 0 | 42 | \ No newline at end of file |
| ... | ... |
src/store/url.js
| 1 | 1 | const urlAlias = { |
| 2 | +// <<<<<<< HEAD | |
| 3 | + // 首页 | |
| 4 | + shopList: '/app/prod/list', // 获取首页商品列表 | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + // 我的订单 | |
| 9 | + orderList: '/app/order/list', // 获取订单列表 | |
| 10 | + | |
| 11 | + | |
| 12 | + // 购物车 | |
| 13 | + cartList: '/app/cart/list', // 获取购物车列表 | |
| 14 | + | |
| 15 | + // 我的 | |
| 16 | + recommandList:'/app/prod/recommand', // 获取用户个性化推荐商品 | |
| 17 | +// ======= | |
| 18 | + // 获取首页商品列表 | |
| 19 | + shopList: '/app/prod/list', | |
| 20 | + | |
| 2 | 21 | // 获取首页商品列表 |
| 3 | - shopList: '/app/prod/list', | |
| 4 | - | |
| 5 | - // 获取首页商品列表 | |
| 6 | 22 | category: '/app/prod/category', |
| 23 | +// >>>>>>> 09a4a9a0aa68e86f0c0a8b5b85adc0cca5b04c66 | |
| 7 | 24 | } |
| 8 | 25 | |
| 9 | 26 | export default urlAlias; |
| ... | ... |