Commit c48d8718f0073a658e95a60cb34172438bc2c58b
1 parent
38790f78
测试完成,可以放到首页了~
Showing
4 changed files
with
39 additions
and
69 deletions
src/components/style_7/style_7.less
src/components/style_7/style_7.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div class="style-1-com" v-if="styles"> | 2 | + <div class="style-7-com" v-if="styles"> |
| 3 | <div class="com"> | 3 | <div class="com"> |
| 4 | 4 | ||
| 5 | <!-- 引入标题 --> | 5 | <!-- 引入标题 --> |
| 6 | - <title-box v-if="styles.titles" @more="more" | ||
| 7 | - :titles="styles.titles"> | 6 | + <title-box v-if="styles.simg" @more="more" |
| 7 | + :titles="{ | ||
| 8 | + simg: styles.simg, | ||
| 9 | + is_more: '1', | ||
| 10 | + more_data: { | ||
| 11 | + type: '13', | ||
| 12 | + to: (this.$route.query.id || 0), | ||
| 13 | + shop_type: '' | ||
| 14 | + } | ||
| 15 | + }"> | ||
| 8 | </title-box> | 16 | </title-box> |
| 9 | 17 | ||
| 10 | <!-- Banner图 --> | 18 | <!-- Banner图 --> |
src/components/titleBox/titleBox.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div class="title-box" v-if="titles"> | 2 | + <!-- <div class="title-box" v-if="titles"> --> |
| 3 | + <div class="title-box"> | ||
| 3 | <div class="box"> | 4 | <div class="box"> |
| 4 | <div class="title-img-box"> | 5 | <div class="title-img-box"> |
| 5 | <img :src="titles.simg" class="title-img" mode="widthFix" /> | 6 | <img :src="titles.simg" class="title-img" mode="widthFix" /> |
src/pages/com/com.vue
| @@ -3,17 +3,10 @@ | @@ -3,17 +3,10 @@ | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | <!-- style_1组件 --> | 5 | <!-- style_1组件 --> |
| 6 | - <style-7 @more="moreA" @bannerJump="bannerJumpA" @jump=jumpA @addCart=addCartA | 6 | + <style-7 @more="more" @bannerJump="bannerJump" @jump=jump @addCart=addCart |
| 7 | :styles="styleA"> | 7 | :styles="styleA"> |
| 8 | </style-7> | 8 | </style-7> |
| 9 | 9 | ||
| 10 | - | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | ||
| 17 | 10 | ||
| 18 | </div> | 11 | </div> |
| 19 | </template> | 12 | </template> |
| @@ -23,10 +16,6 @@ | @@ -23,10 +16,6 @@ | ||
| 23 | // 引入组件 | 16 | // 引入组件 |
| 24 | import { Toast, Indicator } from "mint-ui"; | 17 | import { Toast, Indicator } from "mint-ui"; |
| 25 | import style7 from "@/components/style_7/style_7"; | 18 | import style7 from "@/components/style_7/style_7"; |
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | 19 | ||
| 31 | export default { | 20 | export default { |
| 32 | data () { | 21 | data () { |
| @@ -126,23 +115,10 @@ | @@ -126,23 +115,10 @@ | ||
| 126 | methods: { | 115 | methods: { |
| 127 | 116 | ||
| 128 | /** | 117 | /** |
| 129 | - * 更多A | ||
| 130 | - * @param {object} item [数据对象] | ||
| 131 | - */ | ||
| 132 | - moreA(item) { | ||
| 133 | - | ||
| 134 | - | ||
| 135 | - console.log("moreA", item); | ||
| 136 | - | ||
| 137 | - | ||
| 138 | - | ||
| 139 | - }, | ||
| 140 | - | ||
| 141 | - /** | ||
| 142 | - * Banner跳转A | 118 | + * 更多 |
| 143 | * @param {object} item [数据对象] | 119 | * @param {object} item [数据对象] |
| 144 | */ | 120 | */ |
| 145 | - bannerJumpA(item) { | 121 | + more(item) { |
| 146 | 122 | ||
| 147 | // 判断并调用通用跳转 | 123 | // 判断并调用通用跳转 |
| 148 | if (typeof this.$parent.gotoDetail === "function") { | 124 | if (typeof this.$parent.gotoDetail === "function") { |
| @@ -151,62 +127,48 @@ | @@ -151,62 +127,48 @@ | ||
| 151 | }, | 127 | }, |
| 152 | 128 | ||
| 153 | /** | 129 | /** |
| 154 | - * 跳转A | ||
| 155 | - * @param {object} item [数据对象] | ||
| 156 | - */ | ||
| 157 | - jumpA(item) { | ||
| 158 | - | ||
| 159 | - | ||
| 160 | - console.log("jumpA", item); | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - | ||
| 164 | - }, | ||
| 165 | - | ||
| 166 | - /** | ||
| 167 | - * 加入购物车A | 130 | + * Banner跳转 |
| 168 | * @param {object} item [数据对象] | 131 | * @param {object} item [数据对象] |
| 169 | */ | 132 | */ |
| 170 | - addCartA(item) { | ||
| 171 | - | ||
| 172 | - | ||
| 173 | - console.log("addCartA", item); | 133 | + bannerJump(item) { |
| 174 | 134 | ||
| 175 | - | ||
| 176 | - | 135 | + // 判断并调用通用跳转 |
| 136 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 137 | + this.$parent.gotoDetail(item); | ||
| 138 | + } | ||
| 177 | }, | 139 | }, |
| 178 | 140 | ||
| 179 | /** | 141 | /** |
| 180 | - * 更多B | 142 | + * 跳转 |
| 181 | * @param {object} item [数据对象] | 143 | * @param {object} item [数据对象] |
| 182 | */ | 144 | */ |
| 183 | - moreB(item) { | ||
| 184 | - | 145 | + jump(item) { |
| 185 | 146 | ||
| 186 | - console.log("moreB", item); | ||
| 187 | - | 147 | + // 判断并调用通用跳转 |
| 148 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 188 | 149 | ||
| 150 | + // 构造跳转详情页参数 | ||
| 151 | + let options = { | ||
| 152 | + type: "2", | ||
| 153 | + to: item.id, | ||
| 154 | + shop_type: item.shop_type | ||
| 155 | + } | ||
| 189 | 156 | ||
| 190 | - }, | ||
| 191 | 157 | ||
| 192 | - /** | ||
| 193 | - * 跳转A | ||
| 194 | - * @param {object} item [数据对象] | ||
| 195 | - */ | ||
| 196 | - jumpB(item) { | ||
| 197 | - | 158 | + console.log(options); |
| 159 | + | ||
| 198 | 160 | ||
| 199 | - console.log("jumpA", item); | ||
| 200 | - | ||
| 201 | 161 | ||
| 202 | 162 | ||
| 163 | + this.$parent.gotoDetail(options); | ||
| 164 | + } | ||
| 203 | }, | 165 | }, |
| 204 | 166 | ||
| 205 | /** | 167 | /** |
| 206 | - * 加入购物车A | 168 | + * 加入购物车 |
| 207 | * @param {object} item [数据对象] | 169 | * @param {object} item [数据对象] |
| 208 | */ | 170 | */ |
| 209 | - addCartB(item) { | 171 | + addCart(item) { |
| 210 | 172 | ||
| 211 | 173 | ||
| 212 | console.log("addCartA", item); | 174 | console.log("addCartA", item); |
| @@ -218,7 +180,6 @@ | @@ -218,7 +180,6 @@ | ||
| 218 | 180 | ||
| 219 | 181 | ||
| 220 | 182 | ||
| 221 | - | ||
| 222 | }, | 183 | }, |
| 223 | head: { | 184 | head: { |
| 224 | title () { | 185 | title () { |