Commit 9d70db6e29ff24c1e013d03dc8ce91cbc0f185b4
1 parent
814d6edf
老达人页面样式改版
Showing
1 changed file
with
451 additions
and
403 deletions
src/pages/newDaren/newDaren.vue
| @@ -2,17 +2,37 @@ | @@ -2,17 +2,37 @@ | ||
| 2 | <div class="daren-list"> | 2 | <div class="daren-list"> |
| 3 | 3 | ||
| 4 | <!--轮播--> | 4 | <!--轮播--> |
| 5 | - <swiper v-if="banner" | 5 | + <!-- <swiper v-if="banner" |
| 6 | :swipers="banner" | 6 | :swipers="banner" |
| 7 | :options="{ | 7 | :options="{ |
| 8 | showIndicators: false | 8 | showIndicators: false |
| 9 | }" | 9 | }" |
| 10 | > | 10 | > |
| 11 | - </swiper> | 11 | + </swiper> --> |
| 12 | 12 | ||
| 13 | <!--达人信息--> | 13 | <!--达人信息--> |
| 14 | - <shop-daten-top v-if="shopDatenTop" @userJump="userJump" :shopDatenTop="shopDatenTop"></shop-daten-top> | ||
| 15 | - | 14 | + <!-- <shop-daten-top v-if="shopDatenTop" @userJump="userJump" :shopDatenTop="shopDatenTop"></shop-daten-top> --> |
| 15 | + | ||
| 16 | + <!-- 已关注达人列表(4条) --> | ||
| 17 | + <!-- 已关注达人 --> | ||
| 18 | + <div v-if="dresserList&&dresserList.length"> | ||
| 19 | + | ||
| 20 | + <!-- 标题 --> | ||
| 21 | + <text-title-box @more="h5More" | ||
| 22 | + :titles="{ | ||
| 23 | + title: '已关注达人动态', | ||
| 24 | + more: true | ||
| 25 | + }"> | ||
| 26 | + </text-title-box> | ||
| 27 | + | ||
| 28 | + <!-- 已关注达人列表(4条) --> | ||
| 29 | + <div> | ||
| 30 | + <!-- 达人列表组件 --> | ||
| 31 | + <dresserList @toDetail="toDetail" | ||
| 32 | + :dresserList="dresserList"> | ||
| 33 | + </dresserList> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 16 | <!--推荐达人--> | 36 | <!--推荐达人--> |
| 17 | 37 | ||
| 18 | <!-- 最新动态标题 --> | 38 | <!-- 最新动态标题 --> |
| @@ -70,411 +90,439 @@ | @@ -70,411 +90,439 @@ | ||
| 70 | 90 | ||
| 71 | <script> | 91 | <script> |
| 72 | 92 | ||
| 73 | - // 引入组件 | ||
| 74 | - import { Toast, Indicator } from "mint-ui"; | ||
| 75 | - import swiper from "@/components/swiper/swiper"; | ||
| 76 | - import darenListBox from "@/components/darenListBox/darenListBox"; | ||
| 77 | - import textTitleBox from "@/components/textTitleBox/textTitleBox"; | ||
| 78 | - import shopDatenTop from "@/components/shopDatenTop/shopDatenTop"; | ||
| 79 | - import horizList from "@/components/horizList/horizList"; | ||
| 80 | - | ||
| 81 | - export default { | ||
| 82 | - name: "darenList", | ||
| 83 | - data() { | ||
| 84 | - return { | ||
| 85 | - title: "", // 标题 | ||
| 86 | - isLoading: false, // 下拉刷新中 | ||
| 87 | - shopDatenTop: null, // 置顶达人信息 | ||
| 88 | - banner:[], // 轮播 | ||
| 89 | - shopDarenHot: null, // 达人推荐列表 | ||
| 90 | - fansDaren: null, // 已关注达人动态 | ||
| 91 | - shopFnsDynamic: null, // 达人动态 | ||
| 92 | - loading: false, // 加载 | ||
| 93 | - pages:0 // 分页 | ||
| 94 | - } | ||
| 95 | - }, | ||
| 96 | - components:{ | ||
| 97 | - darenListBox, | ||
| 98 | - textTitleBox, | ||
| 99 | - swiper, | ||
| 100 | - shopDatenTop, | ||
| 101 | - horizList | ||
| 102 | - }, | ||
| 103 | - created() { | ||
| 104 | - | ||
| 105 | - // 设置标题 | ||
| 106 | - this.$set(this, "title", "达人"); | ||
| 107 | - | ||
| 108 | - // 获取优选库精选活动 | ||
| 109 | - this.newDarenIndex(); | ||
| 110 | - | ||
| 111 | - // 达人最新动态 | ||
| 112 | - this.getNewDynamicList(); | ||
| 113 | - }, | ||
| 114 | - methods: { | ||
| 115 | - /** | ||
| 116 | - * 达人最新动态 | ||
| 117 | - */ | ||
| 118 | - getNewDynamicList() { | ||
| 119 | - this.loading = true; | ||
| 120 | - this.pages++ | ||
| 121 | - // 加载中提示 | ||
| 122 | - Indicator.open("加载中..."); | ||
| 123 | - | ||
| 124 | - // 获取证书请求接口 | ||
| 125 | - this.http("/Api/" + this.getApiVersion().dynamic + "/getNewDynamicList", { | ||
| 126 | - uid: this.$route.query.uid, | ||
| 127 | - page: this.pages, | ||
| 128 | - type: 1 | ||
| 129 | - }, this.getNewDynamicListCallback, { | ||
| 130 | - method: "post" | ||
| 131 | - } | ||
| 132 | - ); | ||
| 133 | - }, | ||
| 134 | - | ||
| 135 | - /** | ||
| 136 | - * 达人最新动态回调 | ||
| 137 | - * @param {object} res [服务器返回数据] | ||
| 138 | - * @param {object} ext [扩展参数] | ||
| 139 | - */ | ||
| 140 | - getNewDynamicListCallback(res, ext) { | ||
| 141 | - | ||
| 142 | - // 加载完成 | ||
| 143 | - Indicator.close(); | ||
| 144 | - | ||
| 145 | - // 返回处理 | ||
| 146 | - if (res.code == 200) { | ||
| 147 | - // 解构数据 | ||
| 148 | - let { data: datas } = res; | ||
| 149 | - // 设置shopFnsDynamic达人动态数据 | ||
| 150 | - | ||
| 151 | - if (datas.list && datas.list.length) { | ||
| 152 | - // 隐藏加载圈 | ||
| 153 | - this.loading = false; | ||
| 154 | - if(this.pages>1){ | ||
| 155 | - this.$set(this, "shopFnsDynamic",[...this.shopFnsDynamic,...datas.list]); | ||
| 156 | - }else { | ||
| 157 | - this.$set(this, "shopFnsDynamic",datas.list); | ||
| 158 | - } | ||
| 159 | - // 将视频地址加入到图片数组中 | ||
| 160 | - if(this.shopFnsDynamic&&this.shopFnsDynamic.length>0) { | ||
| 161 | - for (let item of this.shopFnsDynamic) { | ||
| 162 | - // 将视频图片加入图片数组,方便循环输出 | ||
| 163 | - if (item.video_img) { | ||
| 164 | - this.$set(item, "img", [...[item.video_img], ...item.img]); | ||
| 165 | - } | ||
| 166 | - } | ||
| 167 | - } | ||
| 168 | - } | ||
| 169 | - /* 获取达人动态数据 结束 */ | ||
| 170 | - | ||
| 171 | - } else if (res.code == 400) { | ||
| 172 | - | ||
| 173 | - // 获取达人动态失败 | ||
| 174 | - Toast(res.message); | ||
| 175 | - } else { | ||
| 176 | - | ||
| 177 | - // 获取优选库精选活动失败 | ||
| 178 | - Toast("获取达人动态失败"); | ||
| 179 | - } | ||
| 180 | - }, | ||
| 181 | - // 下拉刷新 | ||
| 182 | - // onRefresh() { | ||
| 183 | - | ||
| 184 | - // // 下拉刷新中 | ||
| 185 | - // this.$set(this, "isLoading", true); | ||
| 186 | - | ||
| 187 | - // // 获取优选库精选活动 | ||
| 188 | - // this.activityAd(); | ||
| 189 | - // }, | ||
| 190 | - | ||
| 191 | - /** | ||
| 192 | - * 获取优选库精选活动 | ||
| 193 | - */ | ||
| 194 | - newDarenIndex() { | ||
| 195 | - // 加载中提示 | ||
| 196 | - Indicator.open("加载中..."); | ||
| 197 | - | ||
| 198 | - // 获取证书请求接口 | ||
| 199 | - this.http("/Api/" + this.getApiVersion().index + "/newDarenIndex", { | ||
| 200 | - uid: this.$route.query.uid | ||
| 201 | - }, this.newDarenIndexCallback, { | ||
| 202 | - method: "post" | ||
| 203 | - } | ||
| 204 | - ); | ||
| 205 | - }, | ||
| 206 | - | ||
| 207 | - /** | ||
| 208 | - * 获取优选库精选活动回调 | ||
| 209 | - * @param {object} res [服务器返回数据] | ||
| 210 | - * @param {object} ext [扩展参数] | ||
| 211 | - */ | ||
| 212 | - newDarenIndexCallback(res, ext) { | ||
| 213 | - | ||
| 214 | - // 加载完成 | ||
| 215 | - Indicator.close(); | ||
| 216 | - | ||
| 217 | - // 下拉刷新结束 | ||
| 218 | - this.$set(this, "isLoading", false); | ||
| 219 | - | ||
| 220 | - // 返回处理 | ||
| 221 | - if (res.code == 200) { | ||
| 222 | - | ||
| 223 | - // 解构数据 | ||
| 224 | - let { data: datas } = res; | ||
| 225 | - | ||
| 226 | - /* 获取优选库精选活动数据 开始 */ | ||
| 227 | - if(datas.title){ | ||
| 228 | - // 设置标题 | ||
| 229 | - this.$set(this, "title", datas.title); | ||
| 230 | - } | ||
| 231 | - | ||
| 232 | - | ||
| 233 | - // 设置banner数据 | ||
| 234 | - | ||
| 235 | - this.banner.push(datas.shop_daten_ads) | ||
| 236 | - // 设置shopDatenTop置顶达人数据 | ||
| 237 | - | ||
| 238 | - if (datas.shop_daten_top) { | ||
| 239 | - this.$set(this, "shopDatenTop", datas.shop_daten_top); | ||
| 240 | - } | ||
| 241 | - // 设置shopDarenHot达人推荐数据 | ||
| 242 | - | ||
| 243 | - if (datas.shop_daren_hot && datas.shop_daren_hot.length) { | ||
| 244 | - this.$set(this, "shopDarenHot", datas.shop_daren_hot); | ||
| 245 | - } | ||
| 246 | - // 设置fansDaren已关注达人动态数据 | ||
| 247 | - | ||
| 248 | - if (datas.shop_fans_dynamic && datas.shop_fans_dynamic.length) { | ||
| 249 | - this.$set(this, "fansDaren", datas.shop_fans_dynamic); | ||
| 250 | - // 将视频地址加入到图片数组中 | ||
| 251 | - for (let item of this.fansDaren) { | ||
| 252 | - // 将视频图片加入图片数组,方便循环输出 | ||
| 253 | - if (item.video_img) { | ||
| 254 | - this.$set(item, "img", [...[item.video_img], ...item.img]); | ||
| 255 | - } | ||
| 256 | - } | ||
| 257 | - } | ||
| 258 | - | ||
| 259 | - /* 获取优选库精选活动数据 结束 */ | ||
| 260 | - | ||
| 261 | - } else if (res.code == 400) { | ||
| 262 | - | ||
| 263 | - // 获取优选库精选活动失败 | ||
| 264 | - Toast(res.message); | ||
| 265 | - } else { | ||
| 266 | - | ||
| 267 | - // 获取优选库精选活动失败 | ||
| 268 | - Toast("获取优选库精选活动失败"); | ||
| 269 | - } | ||
| 270 | - }, | ||
| 271 | - /** | ||
| 272 | - * 关注/取消关注达人 | ||
| 273 | - */ | ||
| 274 | - fansShop(item) { | ||
| 275 | - Indicator.open("加载中..."); | ||
| 276 | - // 判断必要参数 | ||
| 277 | - if (item.id && this.$route.query.uid) { | ||
| 278 | - // 请求接口 | ||
| 279 | - this.http("/Api/" + this.getApiVersion().dynamic + "/fansShop", { | ||
| 280 | - id: item.id || 0, | ||
| 281 | - uid: this.$route.query.uid || 0 | ||
| 282 | - }, this.fansShopCallback, { | ||
| 283 | - method: "post", | ||
| 284 | - item | ||
| 285 | - } | ||
| 286 | - ); | ||
| 287 | - } | ||
| 288 | - }, | ||
| 289 | - | ||
| 290 | - /** | ||
| 291 | - * 关注/取消关注达人回调 | ||
| 292 | - * @param {object} res [服务器返回数据] | ||
| 293 | - * @param {object} ext [扩展参数] | ||
| 294 | - */ | ||
| 295 | - fansShopCallback(res, ext) { | ||
| 296 | - | ||
| 297 | - // 加载完成 | ||
| 298 | - Indicator.close(); | ||
| 299 | - if (res.code) { | ||
| 300 | - // 设置已关注 | ||
| 301 | - if (ext.item.is_fans == "0") { | ||
| 302 | - // 关注达人 | ||
| 303 | - this.$set(ext.item, "is_fans", "1"); | ||
| 304 | - }else{ | ||
| 305 | - // 取消关注达人 | ||
| 306 | - this.$set(ext.item, "is_fans", "0"); | ||
| 307 | - } | ||
| 308 | - }else if (res.statusCode === 200 && res.data.code == 400) { | ||
| 309 | - | ||
| 310 | - // 关注失败 | ||
| 311 | - Toast(res.data.message); | ||
| 312 | - } else { | ||
| 313 | - | ||
| 314 | - // 关注失败 | ||
| 315 | - Toast("关注失败"); | ||
| 316 | - } | ||
| 317 | - }, | ||
| 318 | - /** | ||
| 319 | - * 调用通用跳转 | ||
| 320 | - * @param {object} item [通用跳转对象] | ||
| 321 | - */ | ||
| 322 | - /** | ||
| 323 | - * 已关注达人动态更多页跳转 | ||
| 324 | - */ | ||
| 325 | - moreDynamic(){ | ||
| 326 | - // 判断并调用通用跳转 | ||
| 327 | - if (typeof this.$parent.gotoDetail === "function") { | ||
| 328 | - | ||
| 329 | - // 设置跳转参数 | ||
| 330 | - let options = { | ||
| 331 | - type: "5", | ||
| 332 | - to: (window.location.href.split("#")[0] + "#/moreDynamic?uid=" + this.getStore("uid")), | ||
| 333 | - shop_type: "" | ||
| 334 | - } | ||
| 335 | - this.$parent.gotoDetail(options); | ||
| 336 | - } | ||
| 337 | - }, | ||
| 338 | - toDetail(item) { | ||
| 339 | - | ||
| 340 | - // 判断是否有通用跳转函数 | ||
| 341 | - if (typeof this.$parent.gotoDetail === "function") { | ||
| 342 | - | ||
| 343 | - // 调用通用跳转 | ||
| 344 | - this.$parent.gotoDetail(item); | ||
| 345 | - } | ||
| 346 | - }, | ||
| 347 | - | ||
| 348 | - /** | ||
| 349 | - * 推荐达人跳转到更多页 | ||
| 350 | - */ | ||
| 351 | - recommendedDaren() { | ||
| 352 | - | ||
| 353 | - // 判断并调用通用跳转 | ||
| 354 | - if (typeof this.$parent.gotoDetail === "function") { | ||
| 355 | - | ||
| 356 | - // 设置跳转参数 | ||
| 357 | - let options = { | ||
| 358 | - type: "5", | ||
| 359 | - to: (window.location.href.split("#")[0] + "#/recommendMore?uid=" + this.getStore("uid")), | ||
| 360 | - shop_type: "" | ||
| 361 | - } | ||
| 362 | - this.$parent.gotoDetail(options); | ||
| 363 | - } | ||
| 364 | - | ||
| 365 | - }, | ||
| 366 | - | ||
| 367 | - /** | ||
| 368 | - * 跳转达人动态详情 | ||
| 369 | - * @param {object} item [数据对象] | ||
| 370 | - */ | ||
| 371 | - jump(item) { | ||
| 372 | - // 判断并调用通用跳转 | ||
| 373 | - if (typeof this.$parent.gotoDetail === "function") { | ||
| 374 | - | ||
| 375 | - | ||
| 376 | - // 临时,设置跳转参数,跳转达人动态详情页面 | ||
| 377 | - Object.assign(item, { | ||
| 378 | - type: "5", | ||
| 379 | - to: (this.mode == "prod") ? | ||
| 380 | - "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfileDynamicDetail/darenProfileDynamicDetail?from=redirect" + "&id=" + item.id + "&uid=" + this.getStore("uid") | ||
| 381 | - : "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfileDynamicDetail/darenProfileDynamicDetail?from=redirect"+ "&id=" + item.id + "&uid=" + this.getStore("uid"), | ||
| 382 | - shop_type: "" | ||
| 383 | - }); | ||
| 384 | - | ||
| 385 | - // 调用通用跳转 | ||
| 386 | - this.$parent.gotoDetail(item); | ||
| 387 | - } | ||
| 388 | - }, | ||
| 389 | - | ||
| 390 | - /** | ||
| 391 | - * 用户头像/昵称,点击跳转 | ||
| 392 | - * @param {object} item [数据对象] | ||
| 393 | - * type等于2属于达人跳转传uid,type=1传id | ||
| 394 | - */ | ||
| 395 | - userJump(item) { | ||
| 396 | - | ||
| 397 | - // 判断并调用通用跳转 | ||
| 398 | - if (typeof this.$parent.gotoDetail === "function") { | ||
| 399 | - | ||
| 400 | - // 临时,设置跳转达人个人主页用户数据 | ||
| 401 | - Object.assign(item, { | ||
| 402 | - type: "5", | ||
| 403 | - to: (this.mode == "prod") ? | ||
| 404 | - "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect" + "&id=" + (item.type==2?item.uid:item.id) + "&uid=" + this.getStore("uid") : | ||
| 405 | - "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect"+ "&id=" + (item.type==2?item.uid:item.id) + "&uid=" + this.getStore("uid"), | ||
| 406 | - shop_type: "" | ||
| 407 | - }); | ||
| 408 | - | ||
| 409 | - // 调用通用跳转 | ||
| 410 | - this.$parent.gotoDetail(item); | ||
| 411 | - } | ||
| 412 | - }, | ||
| 413 | - | ||
| 414 | - /** | ||
| 415 | - * 点击跳转商品 | ||
| 416 | - * @param {object} item [数据对象] | ||
| 417 | - */ | ||
| 418 | - goodsJump(item) { | ||
| 419 | - | ||
| 420 | - // 判断并调用通用跳转 | ||
| 421 | - if (typeof this.$parent.gotoDetail === "function") { | ||
| 422 | - | ||
| 423 | - // 临时,设置跳转商品详情参数 | ||
| 424 | - Object.assign(item, { | ||
| 425 | - type: "2", | ||
| 426 | - to: item.id, | ||
| 427 | - shop_type: "1" | ||
| 428 | - }); | ||
| 429 | - | ||
| 430 | - // 调用通用跳转 | ||
| 431 | - this.$parent.gotoDetail(item); | ||
| 432 | - } | ||
| 433 | - }, | ||
| 434 | - | ||
| 435 | - /** | ||
| 436 | - * 点击跳转商品购买 | ||
| 437 | - * @param {object} item [数据对象] | ||
| 438 | - */ | ||
| 439 | - goodsPrimary(item) { | ||
| 440 | - | ||
| 441 | - // 判断并调用通用跳转 | ||
| 442 | - if (typeof this.$parent.gotoDetail === "function") { | ||
| 443 | - | ||
| 444 | - // 临时,设置跳转商品详情参数 | ||
| 445 | - Object.assign(item, { | ||
| 446 | - type: "2", | ||
| 447 | - to: item.id, | ||
| 448 | - shop_type: "1" | ||
| 449 | - }); | ||
| 450 | - | ||
| 451 | - // 调用通用跳转 | ||
| 452 | - this.$parent.gotoDetail(item); | ||
| 453 | - } | ||
| 454 | - } | ||
| 455 | - }, | ||
| 456 | - head: { | ||
| 457 | - title () { | ||
| 458 | - return { | ||
| 459 | - inner: this.title | ||
| 460 | - } | 93 | +// 引入组件 |
| 94 | +import { Toast, Indicator } from "mint-ui"; | ||
| 95 | +import swiper from "@/components/swiper/swiper"; | ||
| 96 | +import darenListBox from "@/components/darenListBox/darenListBox"; | ||
| 97 | +import textTitleBox from "@/components/textTitleBox/textTitleBox"; | ||
| 98 | +import shopDatenTop from "@/components/shopDatenTop/shopDatenTop"; | ||
| 99 | +import horizList from "@/components/horizList/horizList"; | ||
| 100 | +import dresserList from "@/components/dresserList/dresserList"; | ||
| 101 | + | ||
| 102 | +export default { | ||
| 103 | + name: "darenList", | ||
| 104 | + data () { | ||
| 105 | + return { | ||
| 106 | + title: "", // 标题 | ||
| 107 | + isLoading: false, // 下拉刷新中 | ||
| 108 | + shopDatenTop: null, // 置顶达人信息 | ||
| 109 | + banner: [], // 轮播 | ||
| 110 | + dresserList: null, // 已关注达人 | ||
| 111 | + shopDarenHot: null, // 达人推荐列表 | ||
| 112 | + fansDaren: null, // 已关注达人动态 | ||
| 113 | + shopFnsDynamic: null, // 达人动态 | ||
| 114 | + loading: false, // 加载 | ||
| 115 | + pages: 0 // 分页 | ||
| 116 | + } | ||
| 117 | + }, | ||
| 118 | + components: { | ||
| 119 | + darenListBox, | ||
| 120 | + textTitleBox, | ||
| 121 | + swiper, | ||
| 122 | + shopDatenTop, | ||
| 123 | + horizList, | ||
| 124 | + dresserList | ||
| 125 | + }, | ||
| 126 | + created () { | ||
| 127 | + | ||
| 128 | + // 设置标题 | ||
| 129 | + this.$set(this, "title", "达人"); | ||
| 130 | + | ||
| 131 | + // 获取优选库精选活动 | ||
| 132 | + this.newDarenIndex(); | ||
| 133 | + | ||
| 134 | + // 达人最新动态 | ||
| 135 | + this.getNewDynamicList(); | ||
| 136 | + }, | ||
| 137 | + methods: { | ||
| 138 | + /** | ||
| 139 | + * 达人最新动态 | ||
| 140 | + */ | ||
| 141 | + getNewDynamicList () { | ||
| 142 | + this.loading = true; | ||
| 143 | + this.pages++ | ||
| 144 | + // 加载中提示 | ||
| 145 | + Indicator.open("加载中..."); | ||
| 146 | + | ||
| 147 | + // 获取证书请求接口 | ||
| 148 | + this.http("/Api/" + this.getApiVersion().dynamic + "/getNewDynamicList", { | ||
| 149 | + uid: this.$route.query.uid, | ||
| 150 | + page: this.pages, | ||
| 151 | + type: 1 | ||
| 152 | + }, this.getNewDynamicListCallback, { | ||
| 153 | + method: "post" | ||
| 154 | + } | ||
| 155 | + ); | ||
| 156 | + }, | ||
| 157 | + | ||
| 158 | + /** | ||
| 159 | + * 达人最新动态回调 | ||
| 160 | + * @param {object} res [服务器返回数据] | ||
| 161 | + * @param {object} ext [扩展参数] | ||
| 162 | + */ | ||
| 163 | + getNewDynamicListCallback (res, ext) { | ||
| 164 | + | ||
| 165 | + // 加载完成 | ||
| 166 | + Indicator.close(); | ||
| 167 | + | ||
| 168 | + // 返回处理 | ||
| 169 | + if (res.code == 200) { | ||
| 170 | + // 解构数据 | ||
| 171 | + let { data: datas } = res; | ||
| 172 | + // 设置shopFnsDynamic达人动态数据 | ||
| 173 | + | ||
| 174 | + if (datas.list && datas.list.length) { | ||
| 175 | + // 隐藏加载圈 | ||
| 176 | + this.loading = false; | ||
| 177 | + if (this.pages > 1) { | ||
| 178 | + this.$set(this, "shopFnsDynamic", [...this.shopFnsDynamic, ...datas.list]); | ||
| 179 | + } else { | ||
| 180 | + this.$set(this, "shopFnsDynamic", datas.list); | ||
| 181 | + } | ||
| 182 | + // 将视频地址加入到图片数组中 | ||
| 183 | + if (this.shopFnsDynamic && this.shopFnsDynamic.length > 0) { | ||
| 184 | + for (let item of this.shopFnsDynamic) { | ||
| 185 | + // 将视频图片加入图片数组,方便循环输出 | ||
| 186 | + if (item.video_img) { | ||
| 187 | + this.$set(item, "img", [...[item.video_img], ...item.img]); | ||
| 188 | + } | ||
| 461 | } | 189 | } |
| 462 | - }, | ||
| 463 | - watch: { | ||
| 464 | - | ||
| 465 | - // 设置页面标题 | ||
| 466 | - title(newVal) { | ||
| 467 | - if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") { | ||
| 468 | - this.$iFrame.insertIFrame(newVal); | ||
| 469 | - } else { | ||
| 470 | - this.$emit("updateHead"); | ||
| 471 | - } | 190 | + } |
| 191 | + } | ||
| 192 | + /* 获取达人动态数据 结束 */ | ||
| 193 | + | ||
| 194 | + } else if (res.code == 400) { | ||
| 195 | + | ||
| 196 | + // 获取达人动态失败 | ||
| 197 | + Toast(res.message); | ||
| 198 | + } else { | ||
| 199 | + | ||
| 200 | + // 获取优选库精选活动失败 | ||
| 201 | + Toast("获取达人动态失败"); | ||
| 202 | + } | ||
| 203 | + }, | ||
| 204 | + // 下拉刷新 | ||
| 205 | + // onRefresh() { | ||
| 206 | + | ||
| 207 | + // // 下拉刷新中 | ||
| 208 | + // this.$set(this, "isLoading", true); | ||
| 209 | + | ||
| 210 | + // // 获取优选库精选活动 | ||
| 211 | + // this.activityAd(); | ||
| 212 | + // }, | ||
| 213 | + | ||
| 214 | + /** | ||
| 215 | + * 获取优选库精选活动 | ||
| 216 | + */ | ||
| 217 | + newDarenIndex () { | ||
| 218 | + // 加载中提示 | ||
| 219 | + Indicator.open("加载中..."); | ||
| 220 | + | ||
| 221 | + // 获取证书请求接口 | ||
| 222 | + this.http("/Api/" + this.getApiVersion().index + "/newDarenIndex", { | ||
| 223 | + uid: this.$route.query.uid | ||
| 224 | + }, this.newDarenIndexCallback, { | ||
| 225 | + method: "post" | ||
| 226 | + } | ||
| 227 | + ); | ||
| 228 | + }, | ||
| 229 | + | ||
| 230 | + /** | ||
| 231 | + * 获取优选库精选活动回调 | ||
| 232 | + * @param {object} res [服务器返回数据] | ||
| 233 | + * @param {object} ext [扩展参数] | ||
| 234 | + */ | ||
| 235 | + newDarenIndexCallback (res, ext) { | ||
| 236 | + | ||
| 237 | + // 加载完成 | ||
| 238 | + Indicator.close(); | ||
| 239 | + | ||
| 240 | + // 下拉刷新结束 | ||
| 241 | + this.$set(this, "isLoading", false); | ||
| 242 | + | ||
| 243 | + // 返回处理 | ||
| 244 | + if (res.code == 200) { | ||
| 245 | + | ||
| 246 | + // 解构数据 | ||
| 247 | + let { data: datas } = res; | ||
| 248 | + | ||
| 249 | + /* 获取优选库精选活动数据 开始 */ | ||
| 250 | + if (datas.title) { | ||
| 251 | + // 设置标题 | ||
| 252 | + this.$set(this, "title", datas.title); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + // 获取“达人列表数据” | ||
| 256 | + if (datas.list && datas.list.length) { | ||
| 257 | + // 设置“达人列表数据”数据 | ||
| 258 | + this.$set(this, "dresserList", datas.list.filter((item, index, arr) => { return index < 4 })); | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + // 设置banner数据 | ||
| 262 | + | ||
| 263 | + this.banner.push(datas.shop_daten_ads) | ||
| 264 | + // 设置shopDatenTop置顶达人数据 | ||
| 265 | + | ||
| 266 | + if (datas.shop_daten_top) { | ||
| 267 | + this.$set(this, "shopDatenTop", datas.shop_daten_top); | ||
| 268 | + } | ||
| 269 | + // 设置shopDarenHot达人推荐数据 | ||
| 270 | + | ||
| 271 | + if (datas.shop_daren_hot && datas.shop_daren_hot.length) { | ||
| 272 | + this.$set(this, "shopDarenHot", datas.shop_daren_hot); | ||
| 273 | + } | ||
| 274 | + // 设置fansDaren已关注达人动态数据 | ||
| 275 | + | ||
| 276 | + if (datas.shop_fans_dynamic && datas.shop_fans_dynamic.length) { | ||
| 277 | + this.$set(this, "fansDaren", datas.shop_fans_dynamic); | ||
| 278 | + // 将视频地址加入到图片数组中 | ||
| 279 | + for (let item of this.fansDaren) { | ||
| 280 | + // 将视频图片加入图片数组,方便循环输出 | ||
| 281 | + if (item.video_img) { | ||
| 282 | + this.$set(item, "img", [...[item.video_img], ...item.img]); | ||
| 472 | } | 283 | } |
| 284 | + } | ||
| 285 | + } | ||
| 286 | + | ||
| 287 | + /* 获取优选库精选活动数据 结束 */ | ||
| 288 | + | ||
| 289 | + } else if (res.code == 400) { | ||
| 290 | + | ||
| 291 | + // 获取优选库精选活动失败 | ||
| 292 | + Toast(res.message); | ||
| 293 | + } else { | ||
| 294 | + | ||
| 295 | + // 获取优选库精选活动失败 | ||
| 296 | + Toast("获取优选库精选活动失败"); | ||
| 297 | + } | ||
| 298 | + }, | ||
| 299 | + /** | ||
| 300 | + * 关注/取消关注达人 | ||
| 301 | + */ | ||
| 302 | + fansShop (item) { | ||
| 303 | + Indicator.open("加载中..."); | ||
| 304 | + // 判断必要参数 | ||
| 305 | + if (item.id && this.$route.query.uid) { | ||
| 306 | + // 请求接口 | ||
| 307 | + this.http("/Api/" + this.getApiVersion().dynamic + "/fansShop", { | ||
| 308 | + id: item.id || 0, | ||
| 309 | + uid: this.$route.query.uid || 0 | ||
| 310 | + }, this.fansShopCallback, { | ||
| 311 | + method: "post", | ||
| 312 | + item | ||
| 313 | + } | ||
| 314 | + ); | ||
| 315 | + } | ||
| 316 | + }, | ||
| 317 | + | ||
| 318 | + /** | ||
| 319 | + * 关注/取消关注达人回调 | ||
| 320 | + * @param {object} res [服务器返回数据] | ||
| 321 | + * @param {object} ext [扩展参数] | ||
| 322 | + */ | ||
| 323 | + fansShopCallback (res, ext) { | ||
| 324 | + | ||
| 325 | + // 加载完成 | ||
| 326 | + Indicator.close(); | ||
| 327 | + if (res.code) { | ||
| 328 | + // 设置已关注 | ||
| 329 | + if (ext.item.is_fans == "0") { | ||
| 330 | + // 关注达人 | ||
| 331 | + this.$set(ext.item, "is_fans", "1"); | ||
| 332 | + } else { | ||
| 333 | + // 取消关注达人 | ||
| 334 | + this.$set(ext.item, "is_fans", "0"); | ||
| 335 | + } | ||
| 336 | + } else if (res.statusCode === 200 && res.data.code == 400) { | ||
| 337 | + | ||
| 338 | + // 关注失败 | ||
| 339 | + Toast(res.data.message); | ||
| 340 | + } else { | ||
| 341 | + | ||
| 342 | + // 关注失败 | ||
| 343 | + Toast("关注失败"); | ||
| 344 | + } | ||
| 345 | + }, | ||
| 346 | + /** | ||
| 347 | + * 调用通用跳转 | ||
| 348 | + * @param {object} item [通用跳转对象] | ||
| 349 | + */ | ||
| 350 | + /** | ||
| 351 | + * 已关注达人动态更多页跳转 | ||
| 352 | + */ | ||
| 353 | + moreDynamic () { | ||
| 354 | + // 判断并调用通用跳转 | ||
| 355 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 356 | + | ||
| 357 | + // 设置跳转参数 | ||
| 358 | + let options = { | ||
| 359 | + type: "5", | ||
| 360 | + to: (window.location.href.split("#")[0] + "#/moreDynamic?uid=" + this.getStore("uid")), | ||
| 361 | + shop_type: "" | ||
| 473 | } | 362 | } |
| 363 | + this.$parent.gotoDetail(options); | ||
| 364 | + } | ||
| 365 | + }, | ||
| 366 | + toDetail (item) { | ||
| 367 | + | ||
| 368 | + // 判断是否有通用跳转函数 | ||
| 369 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 370 | + | ||
| 371 | + // 调用通用跳转 | ||
| 372 | + this.$parent.gotoDetail(item); | ||
| 373 | + } | ||
| 374 | + }, | ||
| 375 | + | ||
| 376 | + /** | ||
| 377 | + * 推荐达人跳转到更多页 | ||
| 378 | + */ | ||
| 379 | + recommendedDaren () { | ||
| 380 | + | ||
| 381 | + // 判断并调用通用跳转 | ||
| 382 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 383 | + | ||
| 384 | + // 设置跳转参数 | ||
| 385 | + let options = { | ||
| 386 | + type: "5", | ||
| 387 | + to: (window.location.href.split("#")[0] + "#/recommendMore?uid=" + this.getStore("uid")), | ||
| 388 | + shop_type: "" | ||
| 389 | + } | ||
| 390 | + this.$parent.gotoDetail(options); | ||
| 391 | + } | ||
| 392 | + | ||
| 393 | + }, | ||
| 394 | + | ||
| 395 | + /** | ||
| 396 | + * 跳转到关注人列表数据 | ||
| 397 | + */ | ||
| 398 | + h5More () { | ||
| 399 | + | ||
| 400 | + // 判断并调用通用跳转 | ||
| 401 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 402 | + | ||
| 403 | + // 设置跳转参数 | ||
| 404 | + let options = { | ||
| 405 | + type: "5", | ||
| 406 | + to: (window.location.href.split("#")[0] + "#/fansShopMessageList?uid=" + this.getStore("uid")), | ||
| 407 | + shop_type: "" | ||
| 408 | + } | ||
| 409 | + | ||
| 410 | + // 调用通用跳转 | ||
| 411 | + this.$parent.gotoDetail(options); | ||
| 412 | + } | ||
| 413 | + }, | ||
| 414 | + | ||
| 415 | + /** | ||
| 416 | + * 跳转达人动态详情 | ||
| 417 | + * @param {object} item [数据对象] | ||
| 418 | + */ | ||
| 419 | + jump (item) { | ||
| 420 | + // 判断并调用通用跳转 | ||
| 421 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 422 | + | ||
| 423 | + | ||
| 424 | + // 临时,设置跳转参数,跳转达人动态详情页面 | ||
| 425 | + Object.assign(item, { | ||
| 426 | + type: "5", | ||
| 427 | + to: (this.mode == "prod") ? | ||
| 428 | + "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfileDynamicDetail/darenProfileDynamicDetail?from=redirect" + "&id=" + item.id + "&uid=" + this.getStore("uid") | ||
| 429 | + : "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfileDynamicDetail/darenProfileDynamicDetail?from=redirect" + "&id=" + item.id + "&uid=" + this.getStore("uid"), | ||
| 430 | + shop_type: "" | ||
| 431 | + }); | ||
| 432 | + | ||
| 433 | + // 调用通用跳转 | ||
| 434 | + this.$parent.gotoDetail(item); | ||
| 435 | + } | ||
| 436 | + }, | ||
| 437 | + | ||
| 438 | + /** | ||
| 439 | + * 用户头像/昵称,点击跳转 | ||
| 440 | + * @param {object} item [数据对象] | ||
| 441 | + * type等于2属于达人跳转传uid,type=1传id | ||
| 442 | + */ | ||
| 443 | + userJump (item) { | ||
| 444 | + | ||
| 445 | + // 判断并调用通用跳转 | ||
| 446 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 447 | + | ||
| 448 | + // 临时,设置跳转达人个人主页用户数据 | ||
| 449 | + Object.assign(item, { | ||
| 450 | + type: "5", | ||
| 451 | + to: (this.mode == "prod") ? | ||
| 452 | + "https://managemall.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect" + "&id=" + (item.type == 2 ? item.uid : item.id) + "&uid=" + this.getStore("uid") : | ||
| 453 | + "https://wjjshop.cnlive.com/html/preferred-library/1/#/pages/darenProfile/darenProfile?from=redirect" + "&id=" + (item.type == 2 ? item.uid : item.id) + "&uid=" + this.getStore("uid"), | ||
| 454 | + shop_type: "" | ||
| 455 | + }); | ||
| 456 | + | ||
| 457 | + // 调用通用跳转 | ||
| 458 | + this.$parent.gotoDetail(item); | ||
| 459 | + } | ||
| 460 | + }, | ||
| 461 | + | ||
| 462 | + /** | ||
| 463 | + * 点击跳转商品 | ||
| 464 | + * @param {object} item [数据对象] | ||
| 465 | + */ | ||
| 466 | + goodsJump (item) { | ||
| 467 | + | ||
| 468 | + // 判断并调用通用跳转 | ||
| 469 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 470 | + | ||
| 471 | + // 临时,设置跳转商品详情参数 | ||
| 472 | + Object.assign(item, { | ||
| 473 | + type: "2", | ||
| 474 | + to: item.id, | ||
| 475 | + shop_type: "1" | ||
| 476 | + }); | ||
| 477 | + | ||
| 478 | + // 调用通用跳转 | ||
| 479 | + this.$parent.gotoDetail(item); | ||
| 480 | + } | ||
| 481 | + }, | ||
| 482 | + | ||
| 483 | + /** | ||
| 484 | + * 点击跳转商品购买 | ||
| 485 | + * @param {object} item [数据对象] | ||
| 486 | + */ | ||
| 487 | + goodsPrimary (item) { | ||
| 488 | + | ||
| 489 | + // 判断并调用通用跳转 | ||
| 490 | + if (typeof this.$parent.gotoDetail === "function") { | ||
| 491 | + | ||
| 492 | + // 临时,设置跳转商品详情参数 | ||
| 493 | + Object.assign(item, { | ||
| 494 | + type: "2", | ||
| 495 | + to: item.id, | ||
| 496 | + shop_type: "1" | ||
| 497 | + }); | ||
| 498 | + | ||
| 499 | + // 调用通用跳转 | ||
| 500 | + this.$parent.gotoDetail(item); | ||
| 501 | + } | ||
| 502 | + } | ||
| 503 | + }, | ||
| 504 | + head: { | ||
| 505 | + title () { | ||
| 506 | + return { | ||
| 507 | + inner: this.title | ||
| 508 | + } | ||
| 509 | + } | ||
| 510 | + }, | ||
| 511 | + watch: { | ||
| 512 | + | ||
| 513 | + // 设置页面标题 | ||
| 514 | + title (newVal) { | ||
| 515 | + if (this.$store.state.browser.toLowerCase() == "qq" && this.$store.state.deviceType.toLowerCase() == "iphone") { | ||
| 516 | + this.$iFrame.insertIFrame(newVal); | ||
| 517 | + } else { | ||
| 518 | + this.$emit("updateHead"); | ||
| 519 | + } | ||
| 474 | } | 520 | } |
| 521 | + } | ||
| 522 | +} | ||
| 475 | </script> | 523 | </script> |
| 476 | 524 | ||
| 477 | <!-- Add "scoped" attribute to limit CSS to this component only --> | 525 | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| 478 | <style rel="stylesheet/less" lang="less" scoped> | 526 | <style rel="stylesheet/less" lang="less" scoped> |
| 479 | - @import "newDaren"; | 527 | +@import 'newDaren'; |
| 480 | </style> | 528 | </style> |