Browse Source

yshop3.1正式发布

master
xuwenbo 5 years ago
parent
commit
8a85f44ff6
  1. 109
      App.vue
  2. 17
      api/live.js
  3. 4
      api/store.js
  4. 5
      api/user.js
  5. 2
      assets/css/base.css
  6. 4
      assets/css/base.less
  7. 2
      assets/css/reset.css
  8. 2
      assets/css/reset.less
  9. 2
      assets/css/style.css
  10. 2
      assets/css/style.css.map
  11. 939
      assets/css/style.less
  12. 207
      components/Adv.vue
  13. 26
      components/Loading.vue
  14. 155
      components/Menu.vue
  15. 230
      components/PromotionGood.vue
  16. 327
      components/ShopLiveCard.vue
  17. 343
      components/StorePoster.vue
  18. 78
      components/UserEvaluation.vue
  19. 40
      components/sh-activity-goods.vue
  20. 256
      components/sh-adv.vue
  21. 197
      components/sh-groupon.vue
  22. 8
      config/index.js
  23. 164
      libs/order.js
  24. 25
      libs/wechat.js
  25. 2
      main.js
  26. 11
      manifest.json
  27. 34
      package-lock.json
  28. 5
      package.json
  29. 28
      pages.json
  30. 15
      pages/Loading/index.vue
  31. 928
      pages/activity/DargainDetails/index.vue
  32. 101
      pages/activity/GoodsGroup/children/activity-card.vue
  33. 298
      pages/activity/GoodsGroup/index.vue
  34. 384
      pages/activity/GoodsSeckill/index.vue
  35. 657
      pages/activity/GroupDetails/index.vue
  36. 4
      pages/activity/GroupRule/index.vue
  37. 128
      pages/activity/Poster/index.vue
  38. 536
      pages/activity/SeckillDetails/index.vue
  39. 339
      pages/authorization/index.vue
  40. 173
      pages/home/components/Banner.vue
  41. 216
      pages/home/components/FirstNewProduct.vue
  42. 219
      pages/home/components/HotCommodity.vue
  43. 249
      pages/home/components/Live.vue
  44. 215
      pages/home/components/ProductsRecommended.vue
  45. 216
      pages/home/components/PromoteProduct.vue
  46. 332
      pages/home/index.vue
  47. 13
      pages/order/OrderDetails/index.vue
  48. 735
      pages/order/OrderSubmission/index.vue
  49. 7
      pages/orderAdmin/AdminOrder/index.vue
  50. 9
      pages/orderAdmin/AdminOrderList/index.vue
  51. 3
      pages/shop/GoodsCollection/index.vue
  52. 1581
      pages/shop/GoodsCon/index.vue
  53. 102
      pages/shop/GoodsFoot/index.vue
  54. 182
      pages/shop/Live/LiveList/index.vue
  55. 735
      pages/shop/ShoppingCart/index.vue
  56. 19
      pages/shop/StoreList/index.vue
  57. 443
      pages/user/Login/index.vue
  58. 17
      pages/user/PersonalData/index.vue
  59. 609
      pages/user/Recharge/index.vue
  60. 520
      pages/user/User/index.vue
  61. 8
      pages/user/UserAccount/index.vue
  62. 25
      pages/user/address/AddAddress/index.vue
  63. 253
      pages/user/promotion/Poster/index.vue
  64. 339
      pages/user/promotion/UserCash/index.vue
  65. 1
      pages/user/promotion/UserPromotion/index.vue
  66. BIN
      static/images/logo_bg.png
  67. BIN
      static/images/title1.png
  68. 12
      store/index.js
  69. 510
      uni.css
  70. 9
      uni.css.map
  71. 1
      uni.min.css
  72. 56
      uni.scss
  73. 155
      utils/index.js
  74. 8
      utils/request.js

109
App.vue

@ -1,24 +1,91 @@
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
import Vue from 'vue'
export default {
onLaunch: function() {
// debugger
const updateManager = uni.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
//
console.log(res.hasUpdate)
})
//
updateManager.onUpdateReady(function () {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
//
updateManager.applyUpdate()
}
}
})
})
//
updateManager.onUpdateFailed(function (res) {
//
uni.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
})
})
},
onShow: function () {
console.log("App Show");
},
onHide: function () {
console.log("App Hide");
},
mounted() {
this.setAppInfo()
},
methods: {
//
async setAppInfo() {
let that = this;
return new Promise((resolve, reject) => {
uni.getSystemInfo({
success: function (e) {
Vue.prototype.StatusBar = e.statusBarHeight;
// #ifdef H5
Vue.prototype.CustomBar = e.statusBarHeight + 45;
// #endif
// #ifdef APP-PLUS
if (e.platform == "android") {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
}
// #endif
// #ifdef MP-WEIXIN
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar =
custom.bottom + custom.top - e.statusBarHeight;
// #endif
},
});
});
},
//
async autoLogin(data) {
},
},
};
</script>
<style lang="less">
/*每个页面公共css */
@import "animate.css";
@import "./assets/iconfont/iconfont.css";
@import "./assets/css/base.less";
@import "./assets/css/reset.less";
@import "./assets/css/style.less";
</style>
/*每个页面公共css */
@import "animate.css";
@import "./assets/iconfont/iconfont.css";
@import "./assets/css/base.less";
@import "./assets/css/reset.less";
@import "./assets/css/style.less";
</style>

17
api/live.js

@ -0,0 +1,17 @@
import request from "@/utils/request";
/**
* 查询所有直播间
*/
export function yxWechatLive(data) {
return request.get("/yxWechatLive", data, { login: true });
}
/**
* 获取直播回放
*/
export function getLiveReplay(id, data) {
return request.get("/yxWechatLive/getLiveReplay/" + id, data, { login: false });
}

4
api/store.js

@ -75,8 +75,8 @@ export function getGroomList(type) {
/*
* 获取商品海报
* */
export function getProductPoster(id) {
return request.get("/product/poster/" + id, {}, {
export function getProductPoster(id, data) {
return request.get("/product/poster/" + id, data, {
login: true
});
}

5
api/user.js

@ -186,10 +186,11 @@ export function postAddress(data) {
/*
* 获取收藏产品
* */
export function getCollectUser(page, limit) {
export function getCollectUser(page, limit, type) {
return request.get("/collect/user", {
page: page,
limit: limit
limit: limit,
type
});
}

2
assets/css/base.css

@ -1,2 +1,2 @@
@charset "UTF-8";.font-color-red{color:#eb3729 !important}.bg-color-red{background-color:#eb3729 !important}.icon-color{color:#eb3729}.cart-color{color:#eb3729 !important;border:1px solid #eb3729 !important}.padding20{padding:20rpx}.pad20{padding:0 20rpx}.padding30{padding:30rpx}.pad30{padding:0 30rpx}.acea-row{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.acea-row.row-middle{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.acea-row.row-top{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}.acea-row.row-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end}.acea-row.row-center{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.acea-row.row-right{-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end}.acea-row.row-left{-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start}.acea-row.row-between{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.acea-row.row-around{-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.acea-row.row-column-around{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.acea-row.row-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.acea-row.row-column-between{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.acea-row.row-center-wrapper{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.acea-row.row-between-wrapper{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.slider-banner{position:relative;width:100%;overflow:hidden}.slider-banner .swiper-container{height:100%}.slider-banner image{display:block;width:100%;height:100%}.start{width:122rpx;height:30rpx;background-image:url("https://h5.yixiang.co/static/images/start.png");background-repeat:no-repeat;-webkit-background-size:122rpx auto;background-size:122rpx auto}.start.star5{background-position:0 3rpx}.start.star4{background-position:0 -30rpx}.start.star3{background-position:0 -70rpx}.start.star2{background-position:0 -105rpx}.start.star1{background-position:0 -140rpx}.start.star0{background-position:0 -175rpx}.checkbox-wrapper{position:relative}.checkbox-wrapper input{display:none}.checkbox-wrapper .icon{position:absolute;left:0;top:50%;display:inline-block;width:18px;height:18px;border:1px solid #cccccc;-webkit-border-radius:50%;border-radius:50%;-webkit-transform:translate(0, -50%);-ms-transform:translate(0, -50%);transform:translate(0, -50%)}.checkbox-wrapper input:checked+.icon{background-color:#e93323;border-color:#e93323;background-image:url("https://h5.yixiang.co/static/images/enter.png");-webkit-background-size:21rpx 15rpx;background-size:21rpx 15rpx;background-repeat:no-repeat;background-position:center center}.Loads{height:80rpx;font-size:25rpx;color:#000}.Loads .iconfont{font-size:30rpx;margin-right:10rpx;height:32rpx;line-height:32rpx}@-webkit-keyframes load{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.loadingpic{-webkit-animation:load 3s linear 1s infinite;animation:load 3s linear 1s infinite}.loading{-webkit-animation:load linear 1s infinite;animation:load linear 1s infinite}
@charset "UTF-8";.font-color-red{color:#eb3729 !important}.bg-color-red{background-color:#eb3729 !important}.icon-color{color:#eb3729}.cart-color{color:#eb3729 !important;border:1px solid #eb3729 !important}.padding20{padding:20rpx}.pad20{padding:0 20rpx}.padding30{padding:30rpx}.pad30{padding:0 30rpx}.acea-row{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.acea-row.row-middle{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.acea-row.row-top{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}.acea-row.row-bottom{-webkit-box-align:end;-webkit-align-items:flex-end;-ms-flex-align:end;align-items:flex-end}.acea-row.row-center{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.acea-row.row-right{-webkit-box-pack:end;-webkit-justify-content:flex-end;-ms-flex-pack:end;justify-content:flex-end}.acea-row.row-left{-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start}.acea-row.row-between{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.acea-row.row-around{-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.acea-row.row-column-around{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-justify-content:space-around;-ms-flex-pack:distribute;justify-content:space-around}.acea-row.row-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.acea-row.row-column-between{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.acea-row.row-center-wrapper{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.acea-row.row-between-wrapper{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.slider-banner{position:relative;width:100%;overflow:hidden}.slider-banner .swiper-container{height:100%}.slider-banner image{display:block;width:100%;height:100%}.start{width:122rpx;height:30rpx;background-image:url("https://wx.yixiang.co/static/images/start.png");background-repeat:no-repeat;-webkit-background-size:122rpx auto;background-size:122rpx auto}.start.star5{background-position:0 3rpx}.start.star4{background-position:0 -30rpx}.start.star3{background-position:0 -70rpx}.start.star2{background-position:0 -105rpx}.start.star1{background-position:0 -140rpx}.start.star0{background-position:0 -175rpx}.checkbox-wrapper{position:relative}.checkbox-wrapper input{display:none}.checkbox-wrapper .icon{position:absolute;left:0;top:50%;display:inline-block;width:18px;height:18px;border:1px solid #cccccc;-webkit-border-radius:50%;border-radius:50%;-webkit-transform:translate(0, -50%);-ms-transform:translate(0, -50%);transform:translate(0, -50%)}.checkbox-wrapper input:checked+.icon{background-color:#e93323;border-color:#e93323;background-image:url("https://wx.yixiang.co/static/images/enter.png");-webkit-background-size:21rpx 15rpx;background-size:21rpx 15rpx;background-repeat:no-repeat;background-position:center center}.Loads{height:80rpx;font-size:25rpx;color:#000}.Loads .iconfont{font-size:30rpx;margin-right:10rpx;height:32rpx;line-height:32rpx}@-webkit-keyframes load{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.loadingpic{-webkit-animation:load 3s linear 1s infinite;animation:load 3s linear 1s infinite}.loading{-webkit-animation:load linear 1s infinite;animation:load linear 1s infinite}
/*# sourceMappingURL=./base.css.map */

4
assets/css/base.less

@ -104,7 +104,7 @@
.start {
width: 1.22*100rpx;
height: 0.3*100rpx;
background-image: url("https://h5.yixiang.co/static/images/start.png");
background-image: url("https://wx.yixiang.co/static/images/start.png");
background-repeat: no-repeat;
background-size: 1.22*100rpx auto;
}
@ -147,7 +147,7 @@
.checkbox-wrapper input:checked + .icon {
background-color: #e93323;
border-color: #e93323;
background-image: url("https://h5.yixiang.co/static/images/enter.png");
background-image: url("https://wx.yixiang.co/static/images/enter.png");
background-size: 0.21*100rpx 0.15*100rpx;
background-repeat: no-repeat;
background-position: center center;

2
assets/css/reset.css

@ -1,2 +1,2 @@
input{line-height:normal;-webkit-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'GuildfordProBook 5';src:url('https://h5.yixiang.co/static/iconfont/GuildfordProBook5.otf')}[v-cloak]{display:none}.iconfont{font-size:36rpx}@media (-webkit-min-device-pixel-ratio:1.5),(min-device-pixel-ratio:1.5){.border-1px::after{-webkit-transform:scaleY(.7);-ms-transform:scaleY(.7);transform:scaleY(.7)}.border-1px::before{-webkit-transform:scaleY(.7);-ms-transform:scaleY(.7);transform:scaleY(.7)}}@media (-webkit-min-device-pixel-ratio:2),(min-device-pixel-ratio:2){.border-1px::after{-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.border-1px::before{-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}}@media (-webkit-min-device-pixel-ratio:3),(min-device-pixel-ratio:3){.border-1px::after{-webkit-transform:scaleY(.33);-ms-transform:scaleY(.33);transform:scaleY(.33)}.border-1px::before{-webkit-transform:scaleY(.33);-ms-transform:scaleY(.33);transform:scaleY(.33)}}.line1{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;width:100%}.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:55;background-color:rgba(0,0,0,0.5)}
input{line-height:normal;-webkit-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'GuildfordProBook 5';src:url('https://wx.yixiang.co/static/iconfont/GuildfordProBook5.otf')}[v-cloak]{display:none}.iconfont{font-size:36rpx}@media (-webkit-min-device-pixel-ratio:1.5),(min-device-pixel-ratio:1.5){.border-1px::after{-webkit-transform:scaleY(.7);-ms-transform:scaleY(.7);transform:scaleY(.7)}.border-1px::before{-webkit-transform:scaleY(.7);-ms-transform:scaleY(.7);transform:scaleY(.7)}}@media (-webkit-min-device-pixel-ratio:2),(min-device-pixel-ratio:2){.border-1px::after{-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}.border-1px::before{-webkit-transform:scaleY(.5);-ms-transform:scaleY(.5);transform:scaleY(.5)}}@media (-webkit-min-device-pixel-ratio:3),(min-device-pixel-ratio:3){.border-1px::after{-webkit-transform:scaleY(.33);-ms-transform:scaleY(.33);transform:scaleY(.33)}.border-1px::before{-webkit-transform:scaleY(.33);-ms-transform:scaleY(.33);transform:scaleY(.33)}}.line1{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;width:100%}.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:55;background-color:rgba(0,0,0,0.5)}
/*# sourceMappingURL=./reset.css.map */

2
assets/css/reset.less

@ -1,7 +1,7 @@
input{line-height: normal; box-sizing:border-box;}
@font-face {
font-family: 'GuildfordProBook 5';
src: url('https://h5.yixiang.co/static/iconfont/GuildfordProBook5.otf');
src: url('https://wx.yixiang.co/static/iconfont/GuildfordProBook5.otf');
}
[v-cloak] {
display: none;

2
assets/css/style.css

File diff suppressed because one or more lines are too long

2
assets/css/style.css.map

File diff suppressed because one or more lines are too long

939
assets/css/style.less

File diff suppressed because it is too large Load Diff

207
components/Adv.vue

@ -0,0 +1,207 @@
<template>
<view class="adv-box mx20 mb10">
<!-- 模板1-->
<view class="x-f" v-if="detail.style == 1">
<image style="width:710rpx;height: 220rpx;" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
</view>
<!-- 模板2-->
<view class="type1 x-f" v-if="detail.style == 2">
<image class="type1-img" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
<image class="type1-img" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
</view>
<!-- 模板3-->
<view class="type2 x-bc" v-if="detail.style == 3">
<image class="type2-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
<view class="y-f type2-box">
<image class="type2-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
<image class="type2-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
</view>
</view>
<!-- 模板4-->
<view class="type3 x-bc" v-if="detail.style == 4">
<view class="type3-box y-f">
<image class="type3-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
<image class="type3-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
</view>
<image class="type3-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
</view>
<!-- 模板5-->
<view class="type4 y-f" v-if="detail.style == 5">
<view class="type4-box x-f">
<image class="type4-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
<image class="type4-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
</view>
<image class="type4-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
</view>
<!-- 模板6-->
<view class="type5 y-f" v-if="detail.style == 6">
<image class="type5-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
<view class="type5-box x-bc">
<image class="type5-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill" style="border-bottom:1rpx solid #f6f6f6"></image>
<image class="type5-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
</view>
</view>
<!-- 模板7-->
<view class="type6 y-f" v-if="detail.style == 7">
<view class="x-f type6-box1">
<image class="type6-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill"></image>
<image class="type6-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"></image>
</view>
<view class="x-f type6-box2">
<image class="type6-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill"></image>
<image class="type6-img2" @tap="jump(detail.list[3].path)" :src="detail.list[3].image" mode="aspectFill"></image>
<image class="type6-img2" @tap="jump(detail.list[4].path)" :src="detail.list[4].image" mode="aspectFill"></image>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {};
},
props: {
detail: {}
},
computed: {},
created() {},
methods: {
//
jump(path) {
this.$tools.routerTo(path);
}
}
};
</script>
<style lang="scss">
.adv-box {
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
.type1 {
.type1-img {
flex: 1;
height: 220rpx;
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
.type2 {
.type2-img1 {
width: (710rpx/2);
height: 340rpx;
border-right: 1rpx solid #f6f6f6;
}
.type2-box {
flex: 1;
height: 340rpx;
width: (710rpx/2);
.type2-img2 {
height: (340rpx/2);
}
}
}
.type3 {
.type3-box {
width: (710rpx/2);
border-right: 1rpx solid #f6f6f6;
.type3-img1 {
flex: 1;
height: (340rpx/2);
&:first-child {
border-bottom: 1rpx solid #f6f6f6;
}
}
}
.type3-img2 {
flex: 1;
height: 340rpx;
width: (710rpx/2);
}
}
.type4 {
.type4-box {
border-bottom: 1rpx solid #f6f6f6;
.type4-img1 {
flex: 1;
height: (340rpx/2);
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
.type4-img2 {
flex: 1;
height: (340rpx/2);
width: 710rpx;
}
}
.type5 {
.type5-img1 {
width: 710rpx;
height: (340rpx/2);
border-bottom: 1rpx solid #f6f6f6;
}
.type5-box {
flex: 1;
height: (340rpx/2);
width: 710rpx;
.type5-img2 {
height: (340rpx/2);
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
}
.type6 {
.type6-box1 {
.type6-img1 {
width: (710rpx/2);
height: (340rpx/2);
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
.type6-box2 {
border-top: 1rpx solid #f6f6f6;
.type6-img2 {
width: (710rpx/3);
height: (340rpx/2);
border-right: 1rpx solid #f6f6f6;
&:last-child {
border-right: 0;
}
}
}
}
image {
// background-color: #ccc;
}
}
</style>

26
components/Loading.vue

@ -1,27 +1,21 @@
<template>
<view
class="Loads acea-row row-center-wrapper"
v-if="loading || !loaded"
style="margin-top: 20rpx;"
>
<view class="Loads acea-row row-center-wrapper" v-if="loading || !loaded" style="margin-top: 20rpx;">
<template v-if="loading">
<view
class="iconfont icon-jiazai loading acea-row row-center-wrapper"
></view>
<view class="iconfont icon-jiazai loading acea-row row-center-wrapper"></view>
正在加载中
</template>
<template v-else>
<template v-if="!loading">
上拉加载更多
</template>
</view>
</template>
<script>
export default {
name: "Loading",
props: {
loaded: Boolean,
loading: Boolean
}
};
export default {
name: "Loading",
props: {
loaded: Boolean,
loading: Boolean
}
};
</script>

155
components/Menu.vue

@ -0,0 +1,155 @@
<template>
<!-- 产品分类导航 -->
<view class="menu-category-box mb10" v-if="carousel" :style="list.length <= menu ? `height:200rpx` : `height:360rpx`">
<swiper
class="menu-swiper-box"
:style="list.length <= menu ? `height:160rpx` : `height:320rpx`"
@change="onSwiper"
circular
:autoplay="false"
:interval="3000"
:duration="1000"
>
<swiper-item class="menu-swiper-item" v-for="(itemList, index) in carousel" :key="index" :style="list.length <= menu ? `height:200rpx` : `height:340rpx`">
<view class="menu-tab-box">
<view class="tab-list y-f" :style="{ width: 690 / menu + 'rpx' }" v-for="item in itemList" :key="item.name" @tap="routerTo(item)">
<image class="tab-img Shop-selector-circular" :style="{ width: imgW + 'rpx', height: imgW + 'rpx' }" :src="item.pic"></image>
<text class="Shop-selector-rect">{{ item.name }}</text>
</view>
</view>
</swiper-item>
</swiper>
<view class="menu-category-dots" v-if="carousel.length > 1">
<text :class="categoryCurrent === index ? 'category-dot-active' : 'category-dot'" v-for="(dot, index) in carousel.length" :key="index"></text>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
categoryCurrent: 0 //
};
},
props: {
list: {
type: Array,
default: []
},
menu: {
default: 4
},
imgW: {
type: Number,
default: 88
}
},
computed: {
carousel() {
if (this.list) {
let list = this.sortData(this.list, this.menu * 2);
return list;
}
}
},
created() {},
methods: {
//
sortData(oArr, length) {
let arr = [];
let minArr = [];
oArr.forEach(c => {
if (minArr.length === length) {
minArr = [];
}
if (minArr.length === 0) {
arr.push(minArr);
}
minArr.push(c);
});
return arr;
},
//
onSwiper(e) {
this.categoryCurrent = e.detail.current;
},
//
routerTo(item) {
this.$yrouter.push(item.uniapp_url);
}
}
};
</script>
<style lang="scss">
//
.y-f {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
}
.menu-category-box {
padding: 30rpx 30rpx 0 30rpx;
background: #fff;
box-sizing: border-box;
}
.menu-category-box,
.menu-swiper-box {
position: relative;
background: #fff;
.menu-swiper-item {
background: #fff;
height: 100%;
width: 100%;
}
.menu-tab-box {
display: flex;
flex-wrap: wrap;
.tab-list {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
padding-bottom: 30rpx;
.tab-img {
border-radius: 25rpx;
margin-bottom: 10rpx;
}
}
}
.menu-category-dots {
display: flex;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 20rpx;
.category-dot {
width: 40rpx;
height: 3rpx;
background: #eeeeee;
margin-right: 10rpx;
}
.category-dot-active {
width: 40rpx;
height: 3rpx;
background: #a8700d;
margin-right: 10rpx;
}
}
}
</style>

230
components/PromotionGood.vue

@ -1,36 +1,214 @@
<template>
<view class="promotionGood" v-if="benefit.length > 0">
<view class="item acea-row row-between-wrapper" v-for="(item, promotionGoodIndex) in benefit" :key="promotionGoodIndex" @click="routerGo(item)">
<view class="pictrue"><image :src="item.image" class="image" /></view>
<view class="text">
<view class="name line1">{{ item.storeName }}</view>
<view class="sp-money acea-row">
<view class="moneyCon">
促销价:
<text class="num">{{ item.price }}</text>
<view>
<view class="sh-title-card mb10">
<view class="title-box">
<image class="title-bg" src="@/static/images/title1.png" mode="aspectFill"></image>
<view class="title-text">为你推荐</view>
<!-- <view class="title-text" :style="{ color: detail.color }">为你推荐</view> -->
</view>
</view>
<view class="hot-goods mx20 mb10" v-if="benefit.length">
<view class="goods-list x-f">
<view class="goods-item" v-for="(item, promotionGoodIndex) in benefit" :key="promotionGoodIndex">
<view class="goods-box" @tap="routerGo(item)">
<view class="img-box">
<!-- <image class="tag-img" :src="item.image" mode=""></image> -->
<image class="img" :src="item.image" lazy-load mode="aspectFill"></image>
</view>
<view class="tip one-t">{{ item.storeName }}</view>
<view class="title more-t">{{ item.storeName }}</view>
<view class="price-box">
<view class="flex x-bc align-end">
<view class="current">{{ item.activity_type === 'groupon' ? item.price : item.otPrice }}
</view>
<view class="sales miso-font">仅剩{{ item.stock }}{{ item.unitName }}</view>
</view>
<view class="x-f tag-box">
<!-- <view class="discount">新人礼</view>
<view class="discount">满100减60</view> -->
</view>
</view>
</view>
</view>
<view class="acea-row row-between-wrapper">
<view class="money">日常价{{ item.otPrice }}</view>
<view>仅剩{{ item.stock }}{{ item.unitName }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'PromotionGood',
props: ['benefit'],
data: function() {
return {};
},
methods: {
routerGo(item) {
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } });
export default {
name: 'PromotionGood',
props: ['benefit'],
data: function () {
return {};
},
methods: {
routerGo(item) {
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.id
}
});
}
},
mounted() {}
};
</script>
<style lang="scss">
.sh-title-card {
width: 750rpx;
}
.title-box {
width: 710rpx;
height: 88rpx;
margin: 0 auto;
position: relative;
border-radius: 30rpx;
.title-bg {
width: 100%;
height: 100%;
}
.title-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-weight: bold;
}
},
mounted() {
}
};
</script>
.goods-box {
width: 345rpx;
background: #fff;
padding-bottom: 20rpx;
border-radius: 20rpx;
overflow: hidden;
.img-box {
width: 345rpx;
height: 345rpx;
overflow: hidden;
position: relative;
.tag-img {
position: absolute;
left: 0;
top: 0;
z-index: 2;
width: 80rpx;
height: 40rpx;
}
.img {
width: 345rpx;
height: 345rpx;
background-color: #ccc;
}
}
.tip {
width: 346rpx;
line-height: 56rpx;
background: rgba(246, 242, 234, 1);
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(168, 112, 13, 1);
padding: 0 20rpx;
}
.title {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
line-height: 36rpx;
height: 72rpx;
margin: 20rpx 20rpx 10rpx;
}
.price-box {
padding: 10rpx 20rpx 0;
width: 344rpx;
box-sizing: border-box;
.sales {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
line-height: 20rpx;
margin-bottom: 20rpx;
}
.current {
font-size: 30rpx;
font-weight: 500;
color: rgba(225, 33, 43, 1);
line-height: 30rpx;
margin-bottom: 20rpx;
&:before {
content: '¥';
font-size: 26rpx;
}
}
.original {
font-size: 22rpx;
font-weight: 400;
text-decoration: line-through;
color: rgba(153, 153, 153, 1);
margin-left: 14rpx;
line-height: 22rpx;
margin-bottom: 10rpx;
&:before {
content: '¥';
font-size: 20rpx;
}
}
.tag-box {
.discount {
line-height: 28rpx;
border: 1rpx solid rgba(225, 33, 43, 1);
border-radius: 8rpx;
font-size: 18rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(225, 33, 43, 1);
padding: 0 8rpx;
margin-right: 10rpx;
}
}
}
}
//
.hot-goods {
// background: linear-gradient(#fff 200rpx, #f6f6f6 500rpx, #f6f6f6);
// border-radius: 20rpx;
.goods-list {
flex-wrap: wrap;
width: 710rpx;
.goods-item {
margin-right: 20rpx;
margin-bottom: 20rpx;
width: 345rpx;
box-shadow: 0px 0px 10rpx 4rpx rgba(199, 199, 199, 0.22);
border-radius: 20rpx;
&:nth-child(2n) {
margin-right: 0;
}
}
}
}
</style>

327
components/ShopLiveCard.vue

@ -0,0 +1,327 @@
<template>
<view class="sp-live-card" :style="{ width: wh + 'rpx' }">
<view class="live-content" @tap="goRoom" :style="{ width: wh + 'rpx' }">
<image class="item-cover" :src="detail.shareImge" mode="aspectFill"></image>
<view class="item-status">
<image class="status-img" :src="liveStatus[detail.liveStatus].img" mode=""></image>
<text class="status-text">{{ liveStatus[detail.liveStatus].title }}</text>
</view>
<view class="item-title" :style="{ width: wh + 'rpx' }">{{ detail.name }}</view>
<!-- <image v-if="detail.liveStatus == 101" class="like-img" src="http://Shop.7wpp.com/imgs/live/zan.gif" mode=""></image> -->
</view>
<view class="live-bottom" :style="{ width: wh + 'rpx' }">
<view class="live-info">
<view class="info-box">
<!-- <image class="info-avatar" :src="detail.anchor_img" mode=""></image> -->
<view class="info-name">{{ detail.anchorName }}</view>
</view>
<!-- <text class="views">15W观看</text> -->
</view>
<slot name="liveGoods">
<view class="live-goods" v-if="detail.product.length">
<view class="live-goods__item" v-for="(goods, index) in detail.product" :key="goods.goodsId"
v-if="index < 3">
<image class="live-goods__img" :src="goods.coverImgeUrl" mode=""></image>
<view class="live-goods__price" v-if="index < 2">{{ goods.price }}</view>
<view class="live-goods__mark" v-else>
<text>{{ detail.product.length }}+</text>
</view>
</view>
</view>
</slot>
</view>
</view>
</template>
<script>
import {
dataFormatL
} from "@/utils";
let HAS_LIVE = false
// #ifdef MP-WEIXIN
HAS_LIVE = true
let livePlayer = null;
if (HAS_LIVE) {
livePlayer = requirePlugin('live-player-plugin');
}
// #endif
let timer = null;
export default {
name: 'shopLiveCard',
components: {},
data() {
return {
liveStatus: {
'101': {
img: 'https://wx.yixiang.co/static/images/live.png',
title: '直播中'
},
'102': {
img: 'https://wx.yixiang.co/static/images/prevue.png',
title: '未开始'
},
'103': {
img: 'https://wx.yixiang.co/static/images/playback.png',
title: '已结束'
},
'104': {
img: 'https://wx.yixiang.co/static/images/104.png',
title: '禁播'
},
'105': {
img: 'https://wx.yixiang.co/static/images/105.png',
title: '暂停中'
},
'106': {
img: 'https://wx.yixiang.co/static/images/106.png',
title: '异常'
},
'107': {
img: 'https://wx.yixiang.co/static/images/past.png',
title: '已过期'
}
}
};
},
props: {
detail: {
type: Object,
default: null
},
wh: {
type: Number,
default: 345
}
},
computed: {},
created() {
this.getLiveStatus();
},
mounted() {
let that = this;
timer = setInterval(() => {
that.getLiveStatus();
}, 60000);
},
beforeDestroy() {
timer = null;
},
methods: {
goRoom() {
let that = this;
wx.navigateTo({
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${that.detail.roomId}`
});
},
dateFormat(fmt, date) {
let ret;
const opt = {
"Y+": date.getFullYear().toString(), //
"m+": (date.getMonth() + 1).toString(), //
"d+": date.getDate().toString(), //
"H+": date.getHours().toString(), //
"M+": date.getMinutes().toString(), //
"S+": date.getSeconds().toString() //
//
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
},
// liveStatus
getLiveStatus() {
if (HAS_LIVE) {
let that = this;
let date = '';
if (that.detail.liveStatus == 102) {
date = this.dateFormat('mm-dd HH:MM', new Date(that.detail.startTime * 1000)).replace('-','/');
that.liveStatus['102'].title = '预告 ' + date;
}
// livePlayer
// .getLiveStatus({
// room_id: that.detail.roomId
// })
// .then(res => {
// // 101: , 102: , 103: , 104: , 105: , 106: 107
// that.detail.liveStatus = res.liveStatus;
// })
// .catch(err => {
// console.log('get live status', err);
// });
}
}
}
};
</script>
<style lang="scss">
.sp-live-card {
width: 344rpx;
box-shadow: 0px 0px 10rpx 4rpx rgba(199, 199, 199, 0.22);
border-radius: 20rpx;
height: 100%;
overflow: auto;
margin-bottom: 20rpx;
}
.live-content {
position: relative;
width: 344rpx;
height: 344rpx;
overflow: hidden;
.item-cover {
background-color: #eee;
width: 100%;
height: 100%;
border-radius: 20rpx 20rpx 0 0;
}
.item-status {
position: absolute;
top: 20rpx;
left: 10rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.4);
border-radius: 20rpx;
display: flex;
justify-content: center;
align-items: center;
.status-img {
width: 40rpx;
height: 40rpx;
}
.status-text {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
padding: 0 10rpx;
}
}
.item-title {
width: 345rpx;
position: absolute;
bottom: 0;
line-height: 60rpx;
padding: 0 20rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
background: linear-gradient(transparent, rgba(#000, 0.5));
padding-right: 60rpx;
}
.like-img {
position: absolute;
bottom: 20rpx;
right: 10rpx;
width: 60rpx;
height: 130rpx;
}
}
.live-bottom {
background-color: #fff;
padding: 20rpx;
width: 345rpx;
.live-info {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.info-box {
display: flex;
align-items: center;
}
.info-avatar {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: 10rpx;
background: #eee;
}
.info-name {
width: 150rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
.views {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
}
.live-goods {
display: flex;
align-items: center;
margin-top: 20rpx;
&__item {
position: relative;
width: 96rpx;
height: 96rpx;
border: 1rpx solid rgba(238, 238, 238, 1);
border-radius: 10rpx;
overflow: hidden;
margin-right: 8rpx;
&:nth-child(3n) {
margin-right: 0;
}
}
&__img {
background: #eee;
width: 100%;
height: 100%;
}
&__price {
position: absolute;
bottom: 0;
line-height: 40rpx;
width: 100%;
background: linear-gradient(transparent, rgba(#000, 0.5));
font-size: 20rpx;
color: #fff;
}
&__mark {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
background: rgba(#000, 0.3);
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
}
}
</style>

343
components/StorePoster.vue

@ -29,19 +29,8 @@
<view class="save-poster" @click="savePosterPath">生成图片</view>
</view>-->
<view class="poster-pop" v-show="canvasStatus">
<img
src="@/static/images/poster-close.png"
class="close"
@click="posterImageClose"
mode="widthFix"
/>
<image
:src="posterImage"
alt="tp"
class="poster-image"
show-menu-by-longpress
mode="widthFix"
/>
<img src="@/static/images/poster-close.png" class="close" @click="posterImageClose" mode="widthFix" />
<image :src="posterImage" alt="tp" class="poster-image" show-menu-by-longpress mode="widthFix" />
<view class="keep">长按图片可以保存到手机</view>
</view>
<view class="mask"></view>
@ -49,163 +38,187 @@
</template>
<script>
// import html2canvas from "html2canvas";
import { PosterCanvas } from "@/utils";
import { getProductPoster } from "@/api/store";
export default {
name: "StorePoster",
props: {
posterImageStatus: Boolean,
posterData: Object,
goodId: String
},
data: function() {
return {
canvasStatus: false,
posterImage: ""
};
},
watch: {
posterImageStatus: function() {
var that = this;
if (that.posterImageStatus === true) {
that.$nextTick(function() {
that.savePosterPath();
});
// import html2canvas from "html2canvas";
import {
PosterCanvas
} from "@/utils";
import {
getProductPoster
} from "@/api/store";
export default {
name: "StorePoster",
props: {
posterImageStatus: Boolean,
posterData: Object,
goodId: String
},
data: function () {
return {
canvasStatus: false,
posterImage: ""
};
},
watch: {
posterImageStatus: function () {
var that = this;
if (that.posterImageStatus === true) {
that.$nextTick(function () {
that.savePosterPath();
});
}
}
}
},
mounted: function() {},
methods: {
posterImageClose: function() {
this.posterImageStatus = false;
this.canvasStatus = false;
this.$emit("setPosterImageStatus");
},
savePosterPath: function() {
const that = this;
uni.showLoading({ title: "海报生成中", mask: true });
getProductPoster(this.goodId)
.then(res => {
this.canvasStatus = true;
this.posterImage = res.data;
})
.finally(() => {
uni.hideLoading();
mounted: function () {},
methods: {
posterImageClose: function () {
this.posterImageStatus = false;
this.canvasStatus = false;
this.$emit("setPosterImageStatus");
},
savePosterPath: function () {
const that = this;
uni.showLoading({
title: "海报生成中",
mask: true
});
// return;
// //
// that.posterImage = "";
// uni.showLoading({ title: "", mask: true });
// console.log(this);
// var prodId = that.$yrouter.currentRoute.query.id;
// uni.downloadFile({
// url:
// this.$VUE_APP_API_URL +
// "/shareImg/" +
// prodId +
// "?shareImgName=" +
// this.posterData.code,
// fail: function(res) {},
// success: function(res) {
// console.log(res);
// that.canvasStatus = true;
// that.posterImage = res.tempFilePath;
// uni.hideLoading();
// }
// });
getProductPoster(this.goodId, {
from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType
})
.then(res => {
this.canvasStatus = true;
this.posterImage = res.data;
})
.finally(() => {
uni.hideLoading();
});
// return;
// //
// that.posterImage = "";
// uni.showLoading({ title: "", mask: true });
// console.log(this);
// var prodId = that.$yrouter.currentRoute.query.id;
// uni.downloadFile({
// url:
// this.$VUE_APP_API_URL +
// "/shareImg/" +
// prodId +
// "?shareImgName=" +
// this.posterData.code,
// fail: function(res) {},
// success: function(res) {
// console.log(res);
// that.canvasStatus = true;
// that.posterImage = res.tempFilePath;
// uni.hideLoading();
// }
// });
}
}
}
};
};
</script>
<style scoped lang="less" lang="less">
.poster-first {
overscroll-behavior: contain;
}
.poster-pop {
width: 4.5 * 100rpx;
height: 8 * 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
z-index: 99;
top: 50%;
margin-top: -4.6 * 100rpx;
}
.poster-pop .canvas {
background-color: #ffffff;
height: 8 * 100rpx;
}
.poster-pop .poster-image {
width: 100%;
height: auto;
}
.poster-pop .canvas .image {
width: 4.5 * 100rpx;
height: 4.5 * 100rpx;
display: block;
}
.poster-pop .canvas .text {
text-align: center;
color: #000000;
margin-top: 0.32 * 100rpx;
}
.poster-pop .canvas .text.black {
height: 0.68 * 100rpx;
}
.poster-pop .canvas .text.rad {
color: #ff0000;
}
.poster-pop .canvas .code {
height: 1.4 * 100rpx;
display: flex;
}
.poster-pop .canvas .code .code-img {
width: 33%;
padding: 0.06 * 100rpx;
}
.poster-pop .canvas .code .code-img image {
width: 100%;
}
.poster-pop .canvas .code .code-text {
width: 60%;
font-size: 0.12 * 100rpx;
line-height: 1.64 * 100rpx;
}
.poster-pop .close {
width: 0.46 * 100rpx;
height: 0.75 * 100rpx;
position: fixed;
right: 0;
top: -0.73 * 100rpx;
display: block;
}
.poster-pop .save-poster {
background-color: #df2d0a;
font-size: 0.22 * 100rpx;
color: #fff;
text-align: center;
height: 0.76 * 100rpx;
line-height: 0.76 * 100rpx;
width: 100%;
margin-top: -0.04 * 100rpx;
}
.poster-pop .keep {
color: #fff;
text-align: center;
font-size: 0.25 * 100rpx;
margin-top: 0.1 * 100rpx;
}
.mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.6);
z-index: 9;
}
.poster-first {
overscroll-behavior: contain;
}
.poster-pop {
width: 4.5 * 100rpx;
height: 8 * 100rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
z-index: 99;
top: 50%;
margin-top: -4.6 * 100rpx;
}
.poster-pop .canvas {
background-color: #ffffff;
height: 8 * 100rpx;
}
.poster-pop .poster-image {
width: 100%;
height: auto;
}
.poster-pop .canvas .image {
width: 4.5 * 100rpx;
height: 4.5 * 100rpx;
display: block;
}
.poster-pop .canvas .text {
text-align: center;
color: #000000;
margin-top: 0.32 * 100rpx;
}
.poster-pop .canvas .text.black {
height: 0.68 * 100rpx;
}
.poster-pop .canvas .text.rad {
color: #ff0000;
}
.poster-pop .canvas .code {
height: 1.4 * 100rpx;
display: flex;
}
.poster-pop .canvas .code .code-img {
width: 33%;
padding: 0.06 * 100rpx;
}
.poster-pop .canvas .code .code-img image {
width: 100%;
}
.poster-pop .canvas .code .code-text {
width: 60%;
font-size: 0.12 * 100rpx;
line-height: 1.64 * 100rpx;
}
.poster-pop .close {
width: 0.46 * 100rpx;
height: 0.75 * 100rpx;
position: fixed;
right: 0;
top: -0.73 * 100rpx;
display: block;
}
.poster-pop .save-poster {
background-color: #df2d0a;
font-size: 0.22 * 100rpx;
color: #fff;
text-align: center;
height: 0.76 * 100rpx;
line-height: 0.76 * 100rpx;
width: 100%;
margin-top: -0.04 * 100rpx;
}
.poster-pop .keep {
color: #fff;
text-align: center;
font-size: 0.25 * 100rpx;
margin-top: 0.1 * 100rpx;
}
.mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.6);
z-index: 9;
}
</style>

78
components/UserEvaluation.vue

@ -1,50 +1,52 @@
<template>
<view class="evaluateWtapper">
<view
class="evaluateItem"
v-for="(item, evaluateWtapperIndex) in reply"
:key="evaluateWtapperIndex"
>
<view class="pic-text acea-row row-middle">
<view class="pictrue">
<image :src="item.avatar" class="image" />
<view class="evaluateWtapper" v-if="reply&&reply.length>0">
<view v-for="(item, evaluateWtapperIndex) in reply" :key="evaluateWtapperIndex">
<view class="evaluateItem" v-if="item">
<view class="pic-text acea-row row-middle">
<view class="pictrue">
<image :src="item.avatar" class="image" />
</view>
<view class="acea-row row-middle">
<view class="name line1">{{ item.nickname }}</view>
<view class="start" :class="'star' + item.star"></view>
</view>
</view>
<view class="acea-row row-middle">
<view class="name line1">{{ item.nickname }}</view>
<view class="start" :class="'star' + item.star"></view>
<view class="time">{{ item.createTime }} {{ item.sku||'' }}</view>
<view class="evaluate-infor">{{ item.comment }}</view>
<view class="imgList acea-row">
<view class="pictrue" v-for="(itemn, eq) in item.picturesArr" :key="eq">
<image :src="itemn" class="image" />
</view>
</view>
</view>
<view class="time">{{ item.createTime }} {{ item.sku||'' }}</view>
<view class="evaluate-infor">{{ item.comment }}</view>
<view class="imgList acea-row">
<view class="pictrue" v-for="(itemn, eq) in item.picturesArr" :key="eq">
<image :src="itemn" class="image" />
<view class="reply" v-if="item.merchantReplyContent">
<span class="font-color-red">yshop店员</span>
{{item.merchantReplyContent}}
</view>
</view>
<view class="reply" v-if="item.merchantReplyContent">
<span class="font-color-red">yshop店员</span>
{{item.merchantReplyContent}}
</view>
</view>
</view>
</template>
<script>
import { dataFormat } from "@/utils";
import {
dataFormat
} from "@/utils";
export default {
name: "UserEvaluation",
props: {
reply: {
type: Array,
default: () => []
export default {
name: "UserEvaluation",
props: {
reply: {
type: Array,
default: () => []
}
},
data: function () {
return {};
},
mounted: function () {
console.log(this)
},
methods: {
dataFormat
}
},
data: function() {
return {};
},
mounted: function() {},
methods: {
dataFormat
}
};
};
</script>

40
components/sh-activity-goods.vue

@ -0,0 +1,40 @@
<template>
<view class="min-goods" @tap="jump('/pages/activity/GroupDetails/index', { id: detail.id })">
<view class="img-box">
<view class="tag" >{{ detail.people}}人团</view>
<image class="img" :src="detail.image" mode="widthFix"></image>
</view>
<view class="price-box">
<view class="y-f">
<text class="seckill-current">{{ detail.price }}</text>
<text class="original">销量{{ detail.sales }}{{detail.unitName}}</text>
</view>
</view>
<view class="title"><slot name="titleText"></slot></view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {};
},
props: {
detail: Object
},
computed: {},
methods: {
//
jump(path, query) {
this.$yrouter.push({
path,
query
});
}
}
};
</script>
<style lang="scss">
</style>

256
components/sh-adv.vue

@ -0,0 +1,256 @@
<template>
<view class="adv-box mx20 mb10">
<!-- 模板1-->
<view class="x-f" v-if="detail.style == 1">
<image style="width:710rpx;height: 220rpx;" @tap="jump(detail.list[0].path)" :src="detail.list[0].image"
mode="aspectFill"></image>
</view>
<!-- 模板2-->
<view class="type1 x-f" v-if="detail.style == 2">
<image class="type1-img" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill">
</image>
<image class="type1-img" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill">
</image>
</view>
<!-- 模板3-->
<view class="type2 x-bc" v-if="detail.style == 3">
<image class="type2-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill">
</image>
<view class="y-f type2-box">
<image class="type2-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"
style="border-bottom:1rpx solid #f6f6f6"></image>
<image class="type2-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image"
mode="aspectFill"></image>
</view>
</view>
<!-- 模板4-->
<view class="type3 x-bc" v-if="detail.style == 4">
<view class="type3-box y-f">
<image class="type3-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image"
mode="aspectFill"></image>
<image class="type3-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image"
mode="aspectFill"></image>
</view>
<image class="type3-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill">
</image>
</view>
<!-- 模板5-->
<view class="type4 y-f" v-if="detail.style == 5">
<view class="type4-box x-f">
<image class="type4-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image"
mode="aspectFill"></image>
<image class="type4-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image"
mode="aspectFill"></image>
</view>
<image class="type4-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image" mode="aspectFill">
</image>
</view>
<!-- 模板6-->
<view class="type5 y-f" v-if="detail.style == 6">
<image class="type5-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image" mode="aspectFill">
</image>
<view class="type5-box x-bc">
<image class="type5-img2" @tap="jump(detail.list[1].path)" :src="detail.list[1].image" mode="aspectFill"
style="border-bottom:1rpx solid #f6f6f6"></image>
<image class="type5-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image"
mode="aspectFill"></image>
</view>
</view>
<!-- 模板7-->
<view class="type6 y-f" v-if="detail.style == 7">
<view class="x-f type6-box1">
<image class="type6-img1" @tap="jump(detail.list[0].path)" :src="detail.list[0].image"
mode="aspectFill"></image>
<image class="type6-img1" @tap="jump(detail.list[1].path)" :src="detail.list[1].image"
mode="aspectFill"></image>
</view>
<view class="x-f type6-box2">
<image class="type6-img2" @tap="jump(detail.list[2].path)" :src="detail.list[2].image"
mode="aspectFill"></image>
<image class="type6-img2" @tap="jump(detail.list[3].path)" :src="detail.list[3].image"
mode="aspectFill"></image>
<image class="type6-img2" @tap="jump(detail.list[4].path)" :src="detail.list[4].image"
mode="aspectFill"></image>
</view>
</view>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
detail: {
"list": [{
"image": "https:\/\/wx.yixiang.co\/static\/images\/index001.png",
"name": "",
"path": "/pages/user/coupon/GetCoupon/index",
"path_name": "优惠券",
"path_type": 1
}, {
"image": "https:\/\/wx.yixiang.co\/static\/images\/index002.png",
"name": "",
"path": "/pages/shop/GoodsList/index",
"path_name": "商品",
"path_type": 1
}, {
"image": "https:\/\/wx.yixiang.co\/static\/images\/index003.png",
"name": "",
"path": "/pages/user/signIn/Integral/index",
"path_name": "积分",
"path_type": 1
}],
"name": "",
"style": 3
}
};
},
props: {},
computed: {},
created() {},
methods: {
//
jump(path) {
this.$yrouter.push({
path
});
}
}
};
</script>
<style lang="scss">
.adv-box {
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
image{
width: 100%;
}
.type1 {
.type1-img {
flex: 1;
height: 220rpx;
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
.type2 {
.type2-img1 {
width: (710rpx/2);
height: 340rpx;
border-right: 1rpx solid #f6f6f6;
}
.type2-box {
flex: 1;
height: 340rpx;
width: (710rpx/2);
.type2-img2 {
height: (340rpx/2);
}
}
}
.type3 {
.type3-box {
width: (710rpx/2);
border-right: 1rpx solid #f6f6f6;
.type3-img1 {
flex: 1;
height: (340rpx/2);
&:first-child {
border-bottom: 1rpx solid #f6f6f6;
}
}
}
.type3-img2 {
flex: 1;
height: 340rpx;
width: (710rpx/2);
}
}
.type4 {
.type4-box {
border-bottom: 1rpx solid #f6f6f6;
.type4-img1 {
flex: 1;
height: (340rpx/2);
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
.type4-img2 {
flex: 1;
height: (340rpx/2);
width: 710rpx;
}
}
.type5 {
.type5-img1 {
width: 710rpx;
height: (340rpx/2);
border-bottom: 1rpx solid #f6f6f6;
}
.type5-box {
flex: 1;
height: (340rpx/2);
width: 710rpx;
.type5-img2 {
height: (340rpx/2);
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
}
.type6 {
.type6-box1 {
.type6-img1 {
width: (710rpx/2);
height: (340rpx/2);
&:first-child {
border-right: 1rpx solid #f6f6f6;
}
}
}
.type6-box2 {
border-top: 1rpx solid #f6f6f6;
.type6-img2 {
width: (710rpx/3);
height: (340rpx/2);
border-right: 1rpx solid #f6f6f6;
&:last-child {
border-right: 0;
}
}
}
}
image {
// background-color: #ccc;
}
}
</style>

197
components/sh-groupon.vue

@ -0,0 +1,197 @@
<template>
<!-- 今日必拼 -->
<view class="group-goods pa20 mx20 mb10">
<view class="title-box x-bc" @tap="jump('/pages/activity/GoodsGroup/index')">
<text class="title">超值拼团</text>
<view class="group-people x-f">
<text class="tip">更多</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="goods-box swiper-box x-f">
<swiper class="carousel" circular @change="swiperChange" :autoplay="true" duration="2000">
<swiper-item v-for="(goods, index) in goodsList" :key="index" class="carousel-item">
<view class="goods-list-box x-f">
<block v-for="mgoods in goods" :key="mgoods.id">
<sh-activity-goods :detail="mgoods" class="goods-item">
<!-- <block slot="titleText">立减8.5</block> -->
</sh-activity-goods>
</block>
</view>
</swiper-item>
</swiper>
<view class="swiper-dots" v-if="goodsList.length > 1">
<text :class="swiperCurrent === index ? 'dot-active' : 'dot'" v-for="(dot, index) in goodsList.length"
:key="index"></text>
</view>
</view>
</view>
</template>
<script>
import shActivityGoods from './sh-activity-goods.vue';
export default {
name: 'shGroupon',
components: {
shActivityGoods
},
data() {
return {
goodsList: [],
swiperCurrent: 0
};
},
props: {
detail: Array
},
computed: {},
created() {},
watch: {
detail(next) {
this.goodsList = this.sortData(next, 4);
}
},
methods: {
swiperChange(e) {
this.swiperCurrent = e.detail.current;
},
//
sortData(oArr, length) {
let arr = [];
let minArr = [];
oArr.forEach(c => {
if (minArr.length === length) {
minArr = [];
}
if (minArr.length === 0) {
arr.push(minArr);
}
minArr.push(c);
});
return arr;
},
jump(path, query) {
this.$yrouter.push({
path,
query,
});
},
}
};
</script>
<style lang="scss">
.swiper-box,
.carousel {
width: 700rpx;
height: 240upx;
position: relative;
border-radius: 20rpx;
.carousel-item {
width: 100%;
height: 100%;
// padding: 0 28upx;
overflow: hidden;
}
.swiper-image {
width: 100%;
height: 100%;
// border-radius: 10upx;
background: #ccc;
}
}
.swiper-dots {
display: flex;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0rpx;
z-index: 66;
.dot {
width: 45rpx;
height: 3rpx;
background: #eee;
border-radius: 50%;
margin-right: 10rpx;
}
.dot-active {
width: 45rpx;
height: 3rpx;
background: #a8700d;
border-radius: 50%;
margin-right: 10rpx;
}
}
// +
.group-goods {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
.title-box {
padding-bottom: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
}
.group-people {
.time-box {
font-size: 26rpx;
color: #edbf62;
.count-text-box {
width: 30rpx;
height: 34rpx;
background: #edbf62;
text-align: center;
line-height: 34rpx;
font-size: 24rpx;
border-radius: 6rpx;
color: rgba(#fff, 0.9);
margin: 0 8rpx;
}
}
.head-box {
.head-img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #ccc;
}
}
.tip {
font-size: 28rpx;
padding-left: 30rpx;
color: #666;
}
.cuIcon-right {
font-size: 30rpx;
line-height: 28rpx;
color: #666;
}
}
}
.goods-box {
.goods-item {
margin-right: 22rpx;
&:nth-child(4n) {
margin-right: 0;
}
}
}
}
</style>

8
config/index.js

@ -1,5 +1,5 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
// export const VUE_APP_API_URL = 'https://h5api.dayouqiantu.cn/api';
export const VUE_APP_RESOURCES_URL = 'https://h5.yixiang.co/static';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api';
export const VUE_APP_API_URL = 'http://127.0.0.1:8008/api';
export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static';

164
libs/order.js

@ -73,80 +73,120 @@ export function delOrderHandle(orderId) {
}
// 使用订单号进行支付
export function payOrderHandle(orderId, type, from) {
export async function payOrderHandle(orderId, type, from) {
return new Promise((resolve, reject) => {
// dialog.loading.open("");
uni.showLoading({
title: "支付中",
mask: true
});
payOrder(orderId, type, from)
.then(res => {
handleOrderPayResults(res.data)
.then(async res => {
await handleOrderPayResults(res.data, type)
resolve()
})
.catch(err => {
dialog.loading.close();
dialog.toast({ mes: err.msg || "订单支付失败" });
reject()
uni.hideLoading()
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message || '订单支付失败',
icon: "none",
duration: 2000,
});
});
});
}
// 处理调用支付接口的逻辑
// @type create(创建订单)||pay(支付订单)
export function handleOrderPayResults(data, type) {
switch (data.status) {
// 订单号已存在
case "ORDER_EXIST":
// 取消支付
case "EXTEND_ORDER":
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000,
});
goOrderDetails(data.result.orderId, type)
break;
case "PAY_DEFICIENCY":
break;
// 支付出错
case "PAY_ERROR":
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000,
});
goOrderDetails(data.result.orderId, type)
break;
// 未传递支付环境
case "SUCCESS":
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000,
});
goOrderDetails(data.result.orderId, type)
break;
// H5支付
case "WECHAT_H5_PAY":
goOrderDetails(data.result.orderId, type)
console.log(data)
setTimeout(() => {
// #ifdef H5
// "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx15171343713577e9f3a418b0865ef90000&package=2547890641"
// location.href = data.result.jsConfig.mweb_url;
// #endif
}, 100);
break;
// 小程序支付
case "WECHAT_PAY":
weappPay(data.result.jsConfig).finally(() => {
export function handleOrderPayResults(data, type, payType) {
console.log(data, type, payType)
console.log(data, type)
return new Promise((resolve, reject) => {
uni.hideLoading()
switch (data.status) {
// 订单号已存在
case "ORDER_EXIST":
resolve()
break;
// 取消支付
case "EXTEND_ORDER":
uni.showToast({
title: data.msg,
icon: "none",
duration: 2000,
});
resolve()
goOrderDetails(data.result.orderId, type)
});
break;
// APP支付
case "WECHAT_APP_PAY":
weappPay(data.result.jsConfig).finally(() => {
break;
case "PAY_DEFICIENCY":
break;
// 支付出错
case "PAY_ERROR":
uni.showToast({
title: data.msg,
icon: "none",
duration: 2000,
});
reject()
goOrderDetails(data.result.orderId, type)
});
break;
}
break;
// 未传递支付环境
case "SUCCESS":
uni.showToast({
title: data.msg || data.payMsg,
icon: "none",
duration: 2000,
});
resolve()
goOrderDetails(data.result.orderId, type)
break;
// H5支付
case "WECHAT_H5_PAY":
goOrderDetails(data.result.orderId, type)
console.log(data)
setTimeout(() => {
resolve()
// #ifdef H5
// "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx15171343713577e9f3a418b0865ef90000&package=2547890641"
// location.href = data.result.jsConfig.mweb_url;
// #endif
}, 100);
break;
// 小程序支付
case "WECHAT_PAY":
weappPay(data.result.jsConfig).finally(() => {
resolve()
goOrderDetails(data.result.orderId, type)
}).then(res => {
// #ifdef MP-WEIXIN
subscribeMessage()
// #endif
})
break;
// APP支付
case "WECHAT_APP_PAY":
weappPay(data.result.jsConfig).finally(() => {
resolve()
goOrderDetails(data.result.orderId, type)
})
break;
}
})
}
export function subscribeMessage() {
// 调用订阅
console.log('调用订阅')
uni.requestSubscribeMessage({
tmplIds: ['W5r2c2kzhbq8uxStkPAVx_sk-5aapMFCqe7b7KU5jXI', '2CB_1UyQrbnlyjJa5syraqJ3cfztPPDOAHe3DEXpMjg', 'vuztugw9VbKbKJDAAVePkjqPpT5mdoREpd4Aq7EGPRU'],
success(res) {
console.log(res)
},
fail(error){
console.log(error)
}
})
}

25
libs/wechat.js

@ -1,3 +1,4 @@
import { subscribeMessage } from "@/libs/order";
import { getProvider } from "@/utils";
import WechatJSSDK from "wechat-jssdk/dist/client.umd";
import { getWechatConfig, wechatAuth } from "@/api/public";
@ -9,7 +10,6 @@ import dayjs from "dayjs";
// 支付模块
export const weappPay = (option) => {
return new Promise((resolve, reject) => {
console.log(option)
if (store.state.$deviceType == 'weixinh5') {
setTimeout(() => {
location.href = option.mweb_url;
@ -59,11 +59,16 @@ export const weappPay = (option) => {
clearTimeout(time)
resolve(success)
}, 3000)
// #ifdef MP-WEIXIN
subscribeMessage()
// #endif
},
fail: (error) => {
console.log(error)
if (error.errMsg == 'requestPayment:fail cancel') {
uni.showToast({ title: '已取消支付', icon: 'none', duration: 5000 });
} else {
uni.showToast({ title: error || error.msg, icon: 'none', duration: 5000 });
}
reject(error)
}
@ -119,6 +124,7 @@ export function clearAuthStatus() {
export function oAuth() {
console.log('处理微信授权')
console.log('处理微信授权cookie',cookie.get("spread"))
console.log(store)
console.log(store.state)
return new Promise((resolve, reject) => {
@ -142,8 +148,7 @@ export function auth(code) {
console.log('获取微信授权')
return new Promise((resolve, reject) => {
let loginType = cookie.get(LOGINTYPE);
debugger
wechatAuth(code, parseInt(cookie.get("spread")), loginType)
wechatAuth(code, cookie.get("spread"), loginType)
.then(({ data }) => {
console.log(data)
const expires_time = dayjs(data.expires_time);
@ -152,12 +157,10 @@ export function auth(code) {
cookie.set(WX_AUTH, code, expires_time);
cookie.remove(STATE_KEY);
loginType && cookie.remove(LOGINTYPE);
debugger
resolve();
})
.catch(reject);
}).catch(error => {
debugger
console.log(error)
})
}
@ -347,12 +350,20 @@ export function wxShowLocation() {
cancel() {
cookie.remove(LATITUDE);
cookie.remove(LONGITUDE);
this.$dialog.error("取消获取位置");
uni.showToast({
title: "取消获取位置",
icon: "none",
duration: 2000,
});
},
fail() {
cookie.remove(LATITUDE);
cookie.remove(LONGITUDE);
this.$dialog.error("授权失败");
uni.showToast({
title: "授权失败",
icon: "none",
duration: 2000,
});
}
});
}

2
main.js

@ -99,7 +99,9 @@ import {
ready,
wxShowLocation,
} from '@/libs/wechat'
import { isWeixin } from '@/utils'
// 判断是否是微信浏览器
if (isWeixin()) {
Vue.prototype.$deviceType = 'weixin'

11
manifest.json

@ -139,6 +139,14 @@
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
},
"plugins" : {
"live-player-plugin" : {
//
"version" : "1.1.10",
// appidappid
"provider" : "wx2b03c6e691cd7370"
}
}
},
"mp-alipay" : {
@ -164,6 +172,7 @@
"key" : ""
}
}
}
},
"domain" : "h5.yixiang.co"
}
}

34
package-lock.json generated

@ -17,6 +17,21 @@
"defer-to-connect": "^1.0.1"
}
},
"@types/html5plus": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/@types/html5plus/download/@types/html5plus-1.0.1.tgz",
"integrity": "sha1-EjFll+Qvb4fLJbnJOGD1fNObOQY=",
"dev": true
},
"@types/uni-app": {
"version": "1.4.3",
"resolved": "https://registry.npm.taobao.org/@types/uni-app/download/@types/uni-app-1.4.3.tgz",
"integrity": "sha1-JRwBK9JAi2m/UB/g3I92rbOwV2w=",
"dev": true,
"requires": {
"vue": "^2.6.8"
}
},
"animate.css": {
"version": "3.7.2",
"resolved": "https://registry.npm.taobao.org/animate.css/download/animate.css-3.7.2.tgz",
@ -193,6 +208,14 @@
"resolved": "https://registry.npm.taobao.org/mimic-response/download/mimic-response-1.0.1.tgz?cache=0&sync_timestamp=1589481629775&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmimic-response%2Fdownload%2Fmimic-response-1.0.1.tgz",
"integrity": "sha1-SSNTiHju9CBjy4o+OweYeBSHqxs="
},
"miniapp-color-thief": {
"version": "1.0.5",
"resolved": "https://registry.npm.taobao.org/miniapp-color-thief/download/miniapp-color-thief-1.0.5.tgz",
"integrity": "sha1-CdeHKwTUHIERDK9FbfVAOuOZ7iw=",
"requires": {
"quantize": "^1.0.2"
}
},
"mongodb": {
"version": "3.4.1",
"resolved": "https://registry.npm.taobao.org/mongodb/download/mongodb-3.4.1.tgz",
@ -296,6 +319,11 @@
"once": "^1.3.1"
}
},
"quantize": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/quantize/download/quantize-1.0.2.tgz",
"integrity": "sha1-0lrCAKd7bXD0ASfKFxoQ4zyFRt4="
},
"regexp-clone": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/regexp-clone/download/regexp-clone-1.0.0.tgz",
@ -379,6 +407,12 @@
"prepend-http": "^2.0.0"
}
},
"vue": {
"version": "2.6.12",
"resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz",
"integrity": "sha1-9evU+mvShpQD4pqJau1JBEVskSM=",
"dev": true
},
"vue-ydui": {
"version": "1.2.6",
"resolved": "https://registry.npm.taobao.org/vue-ydui/download/vue-ydui-1.2.6.tgz",

5
package.json

@ -14,7 +14,12 @@
"async-validator": "^3.2.4",
"dayjs": "^1.8.22",
"jweixin-module": "^1.6.0",
"miniapp-color-thief": "^1.0.5",
"vue-ydui": "^1.2.6",
"wechat-jssdk": "^5.0.4"
},
"devDependencies": {
"@types/html5plus": "^1.0.1",
"@types/uni-app": "^1.4.3"
}
}

28
pages.json

@ -39,7 +39,10 @@
{
"path": "pages/home/index",
"style": {
"navigationBarTitleText": "yshop商城"
"navigationBarTitleText": "yshop商城",
"navigationBarTextStyle": "white",
// "enablePullDownRefresh": true,
"navigationStyle": "custom"
}
},
{
@ -90,6 +93,12 @@
"navigationBarTitleText": "商品收藏"
}
},
{
"path": "pages/shop/GoodsFoot/index",
"style": {
"navigationBarTitleText": "我的足迹"
}
},
{
"path": "pages/shop/news/NewsDetail/index",
"style": {
@ -401,13 +410,20 @@
"style": {
"navigationBarTitleText": "地图"
}
},
{
"path": "pages/shop/Live/LiveList/index",
"style": {
"navigationBarTitleText": "直播列表"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarTitleText": "Yshop",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
"backgroundColor": "#F8F8F8",
"navigationStyle": "default"
},
"tabBar": {
"color": "#282828",
@ -415,9 +431,9 @@
"borderStyle": "black",
"backgroundColor": "#ffffff",
"height": "50px",
"fontSize": "10px",
"iconWidth": "24px",
"spacing": "3px",
"fontSize": "8px",
"iconWidth": "16px",
"spacing": "-3px",
"list": [{
"pagePath": "pages/home/index",
"iconPath": "static/icon-home.png",

15
pages/Loading/index.vue

@ -18,7 +18,7 @@ import { mapState, mapMutations, mapActions } from "vuex";
import { wxappAuth, getUser } from "@/api/user";
import dayjs from "dayjs";
import cookie from "@/utils/store/cookie";
import { parseQuery, login, handleQrCode } from "@/utils";
import { parseQuery, login, handleQrCode ,getCurrentPageUrl,handleUrlParam} from "@/utils";
export default {
name: "Loading",
@ -26,8 +26,11 @@ export default {
return {};
},
onShow() {
var url = handleQrCode();
if(!url){
url = handleUrlParam(getCurrentPageUrl())
}
//
if (url) {
var spread = cookie.get("spread");
@ -44,7 +47,7 @@ export default {
}
cookie.get("spread");
// this.toLaunch();
if (this.$deviceType == "app") {
if (this.$deviceType == "app"||this.$deviceType == "h5") {
// this.toLaunch();
this.$yrouter.switchTab({
path: "/pages/home/index"
@ -52,9 +55,9 @@ export default {
return;
}
login().finally(() => {
// this.$yrouter.switchTab({
// path: "/pages/home/index"
// });
this.$yrouter.switchTab({
path: "/pages/home/index"
});
});
},
methods: {

928
pages/activity/DargainDetails/index.vue

File diff suppressed because it is too large Load Diff

101
pages/activity/GoodsGroup/children/activity-card.vue

@ -0,0 +1,101 @@
<template>
<view class="activity-goods-box x-bc" @tap="jump('/pages/activity/GroupDetails/index', { id: id })">
<view class="img-box">
<slot name="tag"></slot>
<image class="img" :src="img" mode="aspectFill"></image>
</view>
<view class="goods-right y-bc">
<view class="title one-t">{{ title }}</view>
<view class="tip one-t">{{ info }}</view>
<view class="slod-end"><slot name="sell"></slot></view>
<view class=" price-box">
<view class="x-f">
<view class="current">{{ price }}</view>
<view class="original">{{ productPrice }}</view>
</view>
</view>
<slot name="btn"></slot>
</view>
</view>
</template>
<script>
export default {
name: 'activityCard',
components: {},
data() {
return {};
},
props: {
cId: 0,
img: '',
title: '',
info: '',
price: '',
productPrice: ''
},
computed: {},
created() {},
methods: {
//
jump(path, parmas) {
this.$yrouter.push({ path: path, query: parmas });
}
}
};
</script>
<style lang="scss">
.activity-goods-box {
padding: 40rpx 20rpx;
background: #fff;
.img-box {
margin-right: 20rpx;
width: 200rpx;
height: 200rpx;
overflow: hidden;
position: relative;
.img {
width: 200rpx;
height: 200rpx;
background-color: #ccc;
}
}
.goods-right {
width: 450rpx;
min-height: 200rpx;
align-items: flex-start;
position: relative;
.title {
font-size: 28rpx;
line-height: 28rpx;
width: 450rpx;
}
.tip {
font-size: 22rpx;
color: #a8700d;
width: 500rpx;
}
.price-box {
.current {
font-size: 28rpx;
font-weight: 500;
color: rgba(225, 33, 43, 1);
}
.original {
font-size: 22rpx;
font-weight: 400;
text-decoration: line-through;
color: rgba(153, 153, 153, 1);
margin-left: 14rpx;
}
}
}
}
</style>

298
pages/activity/GoodsGroup/index.vue

@ -1,90 +1,232 @@
<template>
<view class="group-list" ref="container">
<view class="list" v-if="combinationList.length>0">
<view
class="item acea-row row-between-wrapper"
v-for="(item, combinationListIndex) in combinationList"
:key="combinationListIndex"
@click="link(item.id)"
>
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text">
<view class="line1" v-text="item.title"></view>
<view class="acea-row">
<view class="team acea-row row-middle cart-color">
<view class="iconfont icon-pintuan"></view>
<view class="num" v-text="item.people + '人团'"></view>
</view>
<view class="page_box">
<view class="content_box">
<scroll-view class="scroll-box" scroll-y enable-back-to-top scroll-with-animation @scrolltolower="loadMore">
<view class="group-wrap">
<view class="group-head x-bc">
<text class="group-head__title">爆款拼团</text>
<text class="group-head__notice">省钱省心限时拼</text>
</view>
<view class="bottom acea-row row-between-wrapper">
<view class="money">
<text class="num" v-text="item.price"></text>
<text class="y-money" v-text="'¥' + item.productPrice"></text>
</view>
<view class="groupBnt bg-color-red">
去拼团
<text class="iconfont icon-jiantou"></text>
<view class="group-box">
<view class="goods-item" v-for="(groupon, index) in grouponList" :key="groupon.id">
<activity-card :cId="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image"
:price="groupon.price" :productPrice="groupon.productPrice">
<block slot="tag">
<view class="tag" v-if="index < 3">TOP{{ index + 1 }}</view>
</block>
<block slot="sell">
<view class="x-f">
<view class="sell-box">
<text class="cuIcon-hotfill"></text>
<text class="sell-num">已拼{{ groupon.sales }}</text>
</view>
<text class="group-num">{{ groupon.people || 0 }}人团</text>
</view>
</block>
<block slot="btn"><button class="cu-btn buy-btn"
@tap.stop="jump('/pages/activity/GroupDetails/index', { id: groupon.id })">马上拼</button></block>
</activity-card>
</view>
</view>
</view>
</view>
<Loading :loaded="status" :loading="loadingList"></Loading>
</view>
<view class="noCommodity" style="background-color: #fff;" v-if="combinationList.length === 0">
<view class="noPictrue">
<image src="@/static/images/noGood.png" class="image" />
</view>
</scroll-view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import { getCombinationList } from "@/api/activity";
import Loading from "@/components/Loading";
export default {
name: "GoodsGroup",
components: {
Loading
},
props: {},
data: function() {
return {
combinationList: [],
status: false, // false true
loading: false, // false true
page: 1, //
limit: 20, //
loadingList: false
};
},
mounted: function() {
// document.querySelector('body').setAttribute('style', 'background-color:#eb3729');
this.getCombinationList();
},
onReachBottom() {
!this.loadingList && this.getCombinationList();
},
methods: {
getCombinationList: function() {
var that = this;
if (that.loading) return;
if (that.status) return;
getCombinationList({ page: that.page, limit: that.limit }).then(res => {
that.status = res.data.length < that.limit;
that.combinationList.push.apply(that.combinationList, res.data);
that.page++;
that.loading = false;
});
import activityCard from './children/activity-card.vue';
import Loading from "@/components/Loading";
import {
getCombinationList
} from "@/api/activity";
export default {
components: {
activityCard,
Loading
},
data() {
return {
emptyData: {
img: '/static/imgs/empty/empty_goods.png',
tip: '还没有拼团商品噢,去首页看看吧~',
path: '/pages/index/index',
pathText: '去首页逛逛'
},
loaded: false,
loading: false,
lastPage: 0,
currentPage: 1,
limit: 10,
grouponList: []
};
},
onLoad() {
this.getGrouponList();
},
link: function(id) {
this.$yrouter.push({
path: "/pages/activity/GroupDetails/index",
query: { id }
});
onPullDownRefresh() {},
computed: {},
methods: {
//
jump(path, parmas) {
this.$yrouter.push({
path: path,
query: parmas
});
},
//
loadMore() {
},
//
getGrouponList() {
let that = this;
if (this.loading || this.loaded) return;
this.loading = true;
getCombinationList({
page: that.currentPage,
limit: this.limit
}).then(res => {
that.grouponList = that.grouponList.concat(res.data.storeCombinationQueryVos)
this.currentPage++;
this.loaded = res.data.storeCombinationQueryVos.length < this.limit;
this.loading = false;
});
// that.$api('goods.grouponList', {
// page: that.currentPage
// }).then(res => {
// if (res.code === 1) {
// that.isLoading = false;
// that.grouponList = [...that.grouponList, ...res.data.data];
// // that.grouponList=[];
// that.lastPage = res.data.last_page;
// if (that.currentPage < res.data.last_page) {
// that.loadStatus = '';
// } else {
// that.loadStatus = 'over';
// }
// }
// });
}
},
onReachBottom() {
!this.loading && this.getGrouponList();
}
}
};
};
</script>
<style lang="scss">
.group-wrap {
background: url('~@/static/images/index-bg.png') no-repeat;
background-size: 100% 374rpx;
}
.group-head {
padding: 0 25rpx;
height: 100rpx;
.group-head__title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
.group-head__notice {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
}
.group-box {
width: 710rpx;
background: linear-gradient(#fff, #f5f5f5);
border-radius: 20rpx;
margin: 0 auto;
min-height: 1000rpx;
.goods-item {
border-radius: 20rpx;
overflow: hidden;
position: relative;
margin-bottom: 20rpx;
.tag {
position: absolute;
left: 0;
top: 10rpx;
z-index: 2;
line-height: 35rpx;
background: linear-gradient(132deg, rgba(255, 153, 93, 1), rgba(255, 99, 97, 1));
border-radius: 0px 18rpx 18rpx 0px;
padding: 0 10rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(255, 255, 255, 0.8);
}
/deep/.goods-right {
width: 460rpx;
.title {
width: 460rpx;
}
.tip {
width: 460rpx;
}
}
.buy-btn {
position: absolute;
right: 0;
bottom: -10rpx;
width: 160rpx;
height: 60rpx;
background: linear-gradient(90deg, rgba(254, 131, 42, 1), rgba(255, 102, 0, 1));
box-shadow: 0px 7rpx 6rpx 0px rgba(255, 104, 4, 0.22);
border-radius: 30rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #fff;
padding: 0;
}
.group-num {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
margin-left: 20rpx;
}
.sell-box {
background: rgba(255, 224, 226, 0.3);
border-radius: 16rpx;
line-height: 32rpx;
padding: 0 10rpx;
.sell-num {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(247, 151, 156, 1);
}
.cuIcon-hotfill {
font-size: 26rpx;
color: #e1212b;
margin-right: 8rpx;
}
}
}
}
</style>

384
pages/activity/GoodsSeckill/index.vue

@ -5,6 +5,9 @@
</view>
<scroll-view scroll-y="false" scroll-x="true">
<view class="timeScroll">
<div class="logoPic">
<image src="https://wx.yixiang.co/h5/img/baokuan.6313c8c8.png"></image>
</div>
<view v-for="(item, index) in timeList" :key="index">
<view v-if="active==index" class="timeItem active" @click="setTime(index)">
<view class="time">{{ item.time }}</view>
@ -19,26 +22,15 @@
</scroll-view>
<view v-for="(item, index) in timeList" :key="index">
<view v-if="active == index">
<view class="countDown font-color-red acea-row row-center-wrapper">
<!-- <view class="countDown font-color-red acea-row row-center-wrapper">
<view v-if="item.status === 0" class="activity">活动已结束</view>
<count-down
:isDay="false"
:tipText="'距结束仅剩 '"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="datatime"
v-if="item.status === 1"
></count-down>
<count-down :isDay="false" :tipText="'距结束仅剩 '" :dayText="false" :hourText="' : '" :minuteText="' : '"
:secondText="false" :datatime="datatime" v-if="item.status === 1"></count-down>
<view v-if="item.status === 2" class="activity">活动即将开始</view>
</view>
</view> -->
<view class="list">
<view
class="item acea-row row-between-wrapper"
v-for="(itemSeckill, indexSeckill) in seckillList"
:key="indexSeckill"
>
<view class="item acea-row row-between-wrapper" v-for="(itemSeckill, indexSeckill) in seckillList"
:key="indexSeckill">
<view class="pictrue">
<image :src="itemSeckill.image" />
</view>
@ -46,28 +38,22 @@
<view class="line1" v-text="itemSeckill.title"></view>
<view class="money">
限时价
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text>
<text class="num font-color-red">{{itemSeckill.price||''}}</text>
</view>
<view class="progress cart-color">
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view>
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
</view>
</view>
<view
class="grab bg-color-red"
v-if="item.status === 1 && itemSeckill.stock > 0"
@click="goDetail(itemSeckill.id)"
>马上抢</view>
<view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0"
@click="goDetail(itemSeckill.id,item.status)">马上抢</view>
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view>
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view>
<view class="grab bg-color-red" @click="goDetail(itemSeckill.id,item.status)" v-if="item.status === 2">即将开始
</view>
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view>
</view>
</view>
<view
class="noCommodity"
style="background-color: #fff;"
v-if="seckillList.length === 0 && page > 1"
>
<view class="noCommodity" style="background-color: #f5f5f5;" v-if="seckillList.length === 0 && page > 1">
<view class="noPictrue">
<image src="@/static/images/noGood.png" class="image" />
</view>
@ -77,185 +63,215 @@
</view>
</template>
<script>
import { getSeckillConfig, getSeckillList } from "@/api/activity";
import CountDown from "@/components/CountDown";
// import { Tab, Tabs } from "vant-weapp";
import Loading from "@/components/Loading";
import {
getSeckillConfig,
getSeckillList
} from "@/api/activity";
import CountDown from "@/components/CountDown";
// import { Tab, Tabs } from "vant-weapp";
import Loading from "@/components/Loading";
export default {
name: "GoodsSeckill",
components: {
CountDown
},
props: {},
data: function() {
return {
headerImg: "",
timeList: [],
sticky: false,
loading: false,
datatime: 0,
active: 0,
seckillList: [],
status: false, // false true
loadingList: false, // false true
page: 1, //
limit: 5, //
title: []
};
},
mounted: function() {
this.mountedStart();
},
onReachBottom() {
!this.loadingList && this.getSeckillList();
},
methods: {
changeTime: function(index) {
this.active = index;
this.getSeckillList();
export default {
name: "GoodsSeckill",
components: {
CountDown
},
props: {},
data: function () {
return {
headerImg: "",
timeList: [],
sticky: false,
loading: false,
datatime: 0,
active: 0,
seckillList: [],
status: false, // false true
loadingList: false, // false true
page: 1, //
limit: 5, //
title: []
};
},
mounted: function () {
this.mountedStart();
},
mountedStart: function() {
var that = this;
uni.showLoading();
getSeckillConfig().then(res => {
that.$set(that, "headerImg", res.data.lovely);
that.$set(that, "timeList", res.data.seckillTime);
that.$set(that, "active", res.data.seckillTimeIndex);
onReachBottom() {
!this.loadingList && this.getSeckillList();
},
methods: {
changeTime: function (index) {
this.active = index;
this.getSeckillList();
},
mountedStart: function () {
var that = this;
uni.showLoading();
getSeckillConfig().then(res => {
that.$set(that, "headerImg", res.data.lovely);
that.$set(that, "timeList", res.data.seckillTime);
that.$set(that, "active", res.data.seckillTimeIndex);
let title = [];
title = res.data.seckillTime.map((item, index) => {
return {
name: "div",
attrs: {
class: "timeItem"
},
children: [
{
name: "div",
attrs: {
class: "time"
},
children: [
{
let title = [];
title = res.data.seckillTime.map((item, index) => {
return {
name: "div",
attrs: {
class: "timeItem"
},
children: [{
name: "div",
attrs: {
class: "time"
},
children: [{
type: "text",
text: item.time
}
]
},
{
name: "div",
attrs: {
class: "state"
}]
},
children: [
{
{
name: "div",
attrs: {
class: "state"
},
children: [{
type: "text",
text: item.state
}
]
}
]
};
}]
}
]
};
});
that.$set(that, "title", title);
that.datatime = that.timeList[that.active].stop;
that.getSeckillList();
that.$nextTick(function () {
that.sticky = true;
uni.hideLoading();
});
});
that.$set(that, "title", title);
},
setTime: function (index) {
var that = this;
that.page = 1;
that.loadingList = false;
that.status = false;
that.active = index;
that.datatime = that.timeList[that.active].stop;
this.seckillList = [];
that.getSeckillList();
that.$nextTick(function() {
that.sticky = true;
},
getSeckillList: function () {
var that = this;
if (that.loadingList) return;
if (that.status) return;
var time = that.timeList[that.active].id;
getSeckillList(time, {
page: that.page,
limit: that.limit
}).then(res => {
that.status = res.data.length < that.limit;
that.seckillList.push.apply(that.seckillList, res.data);
that.page++;
uni.hideLoading();
});
});
},
setTime: function(index) {
var that = this;
that.page = 1;
that.loadingList = false;
that.status = false;
that.active = index;
that.datatime = that.timeList[that.active].stop;
this.seckillList = [];
that.getSeckillList();
},
getSeckillList: function() {
var that = this;
if (that.loadingList) return;
if (that.status) return;
var time = that.timeList[that.active].id;
getSeckillList(time, {
page: that.page,
limit: that.limit
}).then(res => {
that.status = res.data.length < that.limit;
that.seckillList.push.apply(that.seckillList, res.data);
that.page++;
uni.hideLoading();
});
},
goDetail: function(id) {
var that = this;
var time = that.timeList[that.active].stop;
this.$yrouter.push({
path: "/pages/activity/SeckillDetails/index",
query: {
id,
time
}
});
},
goDetail: function (id, status) {
var that = this;
var time = that.timeList[that.active].stop;
this.$yrouter.push({
path: "/pages/activity/SeckillDetails/index",
query: {
id,
time,
status
}
});
}
}
}
};
};
</script>
<style scoped lang="less">
.timeScroll {
display: flex;
align-items: center;
flex-direction: row;
}
.flash-sale {
background: #f5f5f5 !important;
height: 100%;
}
.timeItem {
font-size: 0.22 * 100rpx;
color: #282828;
width: 150rpx;
text-align: center;
padding: 0.11 * 100rpx 0;
background-color: none;
.timeScroll {
display: flex;
align-items: center;
flex-direction: row;
}
.list {
padding: 0 20rpx;
&.active {
.time {
color: #eb3729;
.item {
padding: .25*100rpx;
border-bottom: 1px solid #f0f0f0;
height: auto;
position: relative;
background: #fff;
margin-bottom: .2*100rpx;
border-radius: .2*100rpx;
}
}
.logoPic {
width: 75rpx;
height: 70rpx;
margin-left: 20rpx;
margin-right: 20rpx;
.state {
background-color: #eb3729;
color: #fff;
opacity: 1;
border-radius: 30rpx;
padding: 0 0.2 * 100rpx;
font-weight: 800;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
image {
width: 75rpx;
height: 70rpx;
}
}
}
.timeItem .time {
font-size: 0.32 * 100rpx;
font-weight: bold;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.timeItem {
font-size: 0.22 * 100rpx;
color: #282828;
width: 150rpx;
text-align: center;
padding: 20rpx 0;
background-color: none;
.timeItem .state {
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
&.active {
.time {
color: #eb3729;
}
.activity {
color: #333;
}
.state {
background: linear-gradient(90deg, #00c17b, #00c17b);
color: #fff;
opacity: 1;
border-radius: 30rpx;
padding: 0 0.2 * 100rpx;
font-weight: 800;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
}
}
.flash-sale .list .item .grab {
background-color: #999;
}
.timeItem .time {
font-size: 0.32 * 100rpx;
font-weight: bold;
height: .5 * 100rpx;
line-height: .5 * 100rpx;
}
.timeItem .state {
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.activity {
color: #333;
}
.flash-sale .list .item .grab {
background-color: #999;
}
</style>

657
pages/activity/GroupDetails/index.vue

@ -1,12 +1,15 @@
<template>
<view :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']" v-show="domStatus">
<!-- 商品轮播 -->
<product-con-swiper :imgUrls="imgUrls"></product-con-swiper>
<!-- 商品信息描述 -->
<view class="wrapper">
<view class="share acea-row row-between row-bottom">
<view class="money font-color-red">
<text class="num" v-text="storeInfo.price"></text>
<text class="y-money" v-text="'¥' + storeInfo.productPrice"></text>
<!-- <text class="y-money" v-text="'¥' + storeInfo.productPrice"></text> -->
</view>
</view>
<view class="introduce" v-text="storeInfo.title"></view>
@ -16,11 +19,22 @@
<view v-text="'已拼:' + storeInfo.sales + storeInfo.unitName"></view>
</view>
</view>
<!-- 规格 -->
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view>
<text>{{ attrTxt }}</text>
<text class="atterTxt">{{ attrValue }}</text>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
<!-- 拼团信息 -->
<view class="notice acea-row row-middle">
<view class="num font-color-red">
<text class="iconfont icon-laba"></text>
已拼{{ storeInfo.sales
}}{{ storeInfo.unitName }}
已拼{{ storeInfo.sales }}{{ storeInfo.unitName }}
<text class="line">|</text>
</view>
<view class="swiper-no-swiping swiper">
@ -33,6 +47,8 @@
</swiper>
</view>
</view>
<!-- 拼团人数头像 -->
<view class="assemble">
<view v-for="(item, groupListindex) in groupList" :key="groupListindex">
<view class="item acea-row row-between-wrapper" v-if="groupListindex < groupListCount">
@ -49,15 +65,8 @@
<text class="font-color-red" v-text="item.count"></text>
<text>人成团</text>
</view>
<count-down
:isDay="false"
:tipText="'剩余 '"
:dayText="false"
:hourText="':'"
:minuteText="':'"
:secondText="false"
:datatime="item.stopTime/1000"
></count-down>
<count-down :isDay="false" :tipText="'剩余 '" :dayText="false" :hourText="':'" :minuteText="':'"
:secondText="false" :datatime="item.stopTime/1000"></count-down>
</view>
<view class="spellBnt" @click="groupRule(item.id)">
去拼单
@ -71,6 +80,8 @@
<text class="iconfont icon-xiangxia"></text>
</view>
</view>
<!-- 拼团规则 -->
<view class="playWay">
<view class="title acea-row row-between-wrapper">
<view>拼团玩法</view>
@ -91,6 +102,8 @@
</view>
</view>
</view>
<!-- 用户评价 -->
<view class="userEvaluation">
<view class="title acea-row row-between-wrapper">
<view v-text="'用户评价(' + replyCount + ')'"></view>
@ -101,278 +114,408 @@
</view>
<UserEvaluation :reply="reply"></UserEvaluation>
</view>
<!-- 产品介绍 -->
<view class="product-intro">
<view class="title">产品介绍</view>
<view class="conter" v-html="storeInfo.description"></view>
<!-- <view class="conter" v-html=""></view> -->
</view>
<!-- 操作栏 -->
<view style="height:100rpx;"></view>
<view class="footer-group acea-row row-between-wrapper">
<!-- <view class="customerSer acea-row row-center-wrapper row-column">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view>-->
<view class="customerSer acea-row row-center-wrapper row-column" @click="setCollect">
<view class="iconfont" :class="userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
<view class="footer acea-row row-between-wrapper">
<!-- #ifdef MP-WEIXIN -->
<view class="item">
<button open-type="contact" class='contacButton'>
<view style="padding-bottom: 8rpx;" class="item">
<view class="iconfont icon-kefu"></view>
<text>客服</text>
</view>
</button>
</view>
<!-- #endif -->
<view class="item" @click="setCollect" v-if="userCollect">
<view class="iconfont icon-shoucang1"></view>
<text>收藏</text>
</view>
<view class="item" @click="setCollect" v-if="!userCollect">
<view class="iconfont icon-shoucang"></view>
<text>收藏</text>
</view>
<view class="bnt bg-color-violet" @click="openAlone">单独购买</view>
<view class="bnt bg-color-red" @click="openTeam">立即开团</view>
<view class="bnt acea-row">
<view class="joinCart" @click="openAlone">
<text>单独购买</text>
</view>
<view class="buy" @click="openTeam">
<text>立即开团</text>
</view>
</view>
</view>
<!-- 商品信息弹窗 -->
<ProductWindow v-if="cartNum" v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
<StorePoster
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus"
:posterData="posterData"></StorePoster>
</view>
</template>
<script>
// import { swiper, swiperSlide } from "vue-awesome-swiper";
// import { swiper, swiperSlide } from "vue-awesome-swiper";
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import UserEvaluation from "@/components/UserEvaluation";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import { getCombinationDetail } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { imageBase64 } from "@/api/public";
import {
getCoupon,
getCollectAdd,
getCollectDel,
getUserInfo
} from "@/api/user";
const NAME = "GroupDetails";
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import UserEvaluation from "@/components/UserEvaluation";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import {
getCombinationDetail
} from "@/api/activity";
import {
postCartAdd
} from "@/api/store";
import {
imageBase64
} from "@/api/public";
import {
getCoupon,
getCollectAdd,
getCollectDel,
getUserInfo
} from "@/api/user";
const NAME = "GroupDetails";
export default {
name: "GroupDetails",
components: {
ProductConSwiper,
CountDown,
UserEvaluation,
// swiper,
// swiperSlide,
ProductWindow,
StorePoster
},
props: {},
data: function() {
return {
domStatus: false,
posterData: {
image: "",
title: "",
price: "",
code: ""
},
posterImageStatus: false,
reply: [],
replyCount: 0,
replyChance: 0,
imgUrls: [],
storeInfo: {},
itemNew: {},
groupListCount: 2,
groupList: {},
swiperTip: {
direction: "vertical",
autoplay: {
disableOnInteraction: false,
delay: 2000
},
loop: true,
speed: 1000,
observer: true,
observeParents: true
},
attr: {
cartAttr: false,
productSelect: {
export default {
name: "GroupDetails",
components: {
ProductConSwiper,
CountDown,
UserEvaluation,
// swiper,
// swiperSlide,
ProductWindow,
StorePoster
},
props: {},
data: function () {
return {
domStatus: false,
posterData: {
image: "",
store_name: "",
title: "",
price: "",
stock: "",
unique: "",
cart_num: 1
code: ""
},
posterImageStatus: false,
reply: [],
replyCount: 0,
replyChance: 0,
imgUrls: [],
storeInfo: {},
itemNew: {},
groupListCount: 2,
groupList: {},
attrTxt: "请选择",
productValue: [],
attrValue: "",
swiperTip: {
direction: "vertical",
autoplay: {
disableOnInteraction: false,
delay: 2000
},
loop: true,
speed: 1000,
observer: true,
observeParents: true
},
attr: {
cartAttr: false,
productAttr: [],
productSelect: {},
},
cartNum: 1,
userCollect: false
};
},
watch: {
$yroute: function (n) {
var that = this;
if (n.name === NAME) {
that.mountedStart();
}
},
cartNum: 1,
userCollect: false
};
},
watch: {
$yroute: function(n) {
var that = this;
if (n.name === NAME) {
that.mountedStart();
}
}
},
onShow: function() {
this.mountedStart();
},
methods: {
openAlone: function() {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: { id: this.storeInfo.productId }
});
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
},
//
setCollect: function() {
let that = this,
id = that.storeInfo.id,
category = "product";
if (that.userCollect) {
getCollectDel(id, category).then(function() {
that.userCollect = !that.userCollect;
onShow: function () {
this.mountedStart();
},
methods: {
onShareAppMessage: function() {
return {
title: this.storeInfo.title,
imageUrl: this.storeInfo.image,
path: "pages/activity/GroupDetails/index?id="+this.storeInfo.id+"&spread=" + uni.getStorageSync("uid")+"&pageType=good&codeType=routine",
success(res) {
uni.showToast({
title: '分享成功'
})
},
fail(res) {
uni.showToast({
title: '分享失败',
icon: 'none'
})
}
}
},
openAlone: function () {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: {
id: this.storeInfo.productId
}
});
} else {
getCollectAdd(id, category).then(function() {
that.userCollect = !that.userCollect;
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
},
//
setCollect: function () {
let that = this,
id = that.storeInfo.id,
category = "product";
if (that.userCollect) {
getCollectDel(id, category).then(function () {
that.userCollect = !that.userCollect;
});
} else {
getCollectAdd(id, category).then(function () {
that.userCollect = !that.userCollect;
});
}
},
mountedStart: function () {
var that = this;
let id = that.$yroute.query.id;
getCombinationDetail(id).then(res => {
that.userCollect = res.data.userCollect;
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that.attr, "productAttr", res.data.productAttr);
that.$set(that, "productValue", res.data.productValue);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "itemNew", res.data.pinkOkList);
that.$set(that, "groupList", res.data.pink);
that.$set(that, "reply", [res.data.reply]);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "replyChance", res.data.replyChance);
that.posterData.image = that.storeInfo.image;
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
} else {
that.posterData.title = that.storeInfo.title;
}
that.posterData.price = that.storeInfo.pinkPrice;
that.posterData.code = that.storeInfo.code_base;
that.domStatus = true;
console.log(this.storeInfo)
that.DefaultSelect();
});
}
},
mountedStart: function() {
var that = this;
let id = that.$yroute.query.id;
getCombinationDetail(id).then(res => {
that.userCollect = res.data.userCollect;
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "itemNew", res.data.pinkOkList);
that.$set(that, "groupList", res.data.pink);
that.$set(that, "reply", [res.data.reply]);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "replyChance", res.data.replyChance);
that.setProductSelect();
that.posterData.image = that.storeInfo.image;
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
},
DefaultSelect: function () {
let productAttr = this.attr.productAttr;
let value = [];
for (let i = 0; i < productAttr.length; i++) {
this.$set(productAttr[i], "index", 0);
value.push(productAttr[i].attrValueArr[0]);
}
//sort();:--
let productSelect = this.productValue[value.sort().join(",")];
console.log(productSelect)
if (productSelect && productAttr.length) {
this.$set(
this.attr.productSelect,
"store_name",
this.storeInfo.title
);
this.$set(this.attr.productSelect, "image", productSelect.image);
this.$set(this.attr.productSelect, "price", productSelect.pinkPrice);
this.$set(this.attr.productSelect, "stock", productSelect.pinkStock);
this.$set(this.attr.productSelect, "unique", productSelect.unique);
this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", value.sort().join(","));
this.$set(this, "attrTxt", "已选择");
} else if (!productSelect && productAttr.length) {
this.$set(
this.attr.productSelect,
"store_name",
this.storeInfo.title
);
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
this.$set(this.attr.productSelect, "price", this.storeInfo.pinkPrice);
this.$set(this.attr.productSelect, "stock", 0);
this.$set(this.attr.productSelect, "unique", "");
this.$set(this.attr.productSelect, "cart_num", 0);
this.$set(this, "attrValue", "");
this.$set(this, "attrTxt", "请选择");
} else if (!productSelect && !productAttr.length) {
this.$set(
this.attr.productSelect,
"store_name",
this.storeInfo.title
);
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
this.$set(this.attr.productSelect, "price", this.storeInfo.pinkPrice);
this.$set(this.attr.productSelect, "stock", this.storeInfo.pinkStock);
this.$set(
this.attr.productSelect,
"unique",
this.storeInfo.unique || ""
);
this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", "");
this.$set(this, "attrTxt", "请选择");
}
},
getImageBase64: function () {
let that = this;
imageBase64(this.posterData.image, that.posterData.code).then(res => {
that.posterData.image = res.data.image;
that.posterData.code = res.data.code;
});
},
setPosterImageStatus: function () {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
groupRule: function (id) {
var that = this;
that.$yrouter.push({
path: "/pages/activity/GroupRule/index",
query: {
id
}
});
},
goReply: function () {
var that = this;
that.$yrouter.push({
path: "/pages/shop/EvaluateList/index",
query: {
id: that.storeInfo.product_id
}
});
},
setGroupListCount: function () {
this.groupListCount = this.groupListCount + 2;
},
//
changeFun: function (opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function (res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function (res) {
var that = this;
that.attr.productSelect.cart_num = 1;
that.cartNum = 1;
uni.showToast({
title: "每人每次限购1" + that.storeInfo.unitName,
icon: "none",
duration: 2000
});
},
//
ChangeAttr: function (res) {
//
let productSelect = this.productValue[res.value];
if (productSelect) {
this.attr.productAttr[res.indexw].index = res.indexn;
this.$set(this.attr.productSelect, "image", productSelect.image);
this.$set(this.attr.productSelect, "price", productSelect.pinkPrice);
this.$set(this.attr.productSelect, "stock", productSelect.pinkStock);
this.$set(this.attr.productSelect, "unique", productSelect.unique);
this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", res.value);
this.$set(this, "attrTxt", "已选择");
} else {
that.posterData.title = that.storeInfo.title;
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
this.$set(this.attr.productSelect, "price", this.storeInfo.pinkPrice);
this.$set(this.attr.productSelect, "stock", 0);
this.$set(this.attr.productSelect, "unique", "");
this.$set(this.attr.productSelect, "cart_num", 0);
this.$set(this, "attrValue", "");
this.$set(this, "attrTxt", "请选择");
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base;
that.domStatus = true;
console.log(this.storeInfo)
//that.getImageBase64();
});
},
getImageBase64: function() {
let that = this;
imageBase64(this.posterData.image, that.posterData.code).then(res => {
that.posterData.image = res.data.image;
that.posterData.code = res.data.code;
});
},
setPosterImageStatus: function() {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
groupRule: function(id) {
var that = this;
that.$yrouter.push({
path: "/pages/activity/GroupRule/index",
query: { id }
});
},
goReply: function() {
var that = this;
that.$yrouter.push({
path: "/pages/shop/EvaluateList/index",
query: { id: that.storeInfo.product_id }
});
},
setGroupListCount: function() {
this.groupListCount = this.groupListCount + 2;
},
//
changeFun: function(opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function(res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function(res) {
var that = this;
that.attr.productSelect.cart_num = 1;
that.cartNum = 1;
uni.showToast({
title: "每人每次限购1" + that.storeInfo.unitName,
icon: "none",
duration: 2000
});
},
setProductSelect: function() {
var that = this;
var attr = that.attr;
attr.productSelect.image = that.storeInfo.image;
attr.productSelect.store_name = that.storeInfo.title;
attr.productSelect.price = that.storeInfo.price+'';
attr.productSelect.stock = that.storeInfo.stock;
attr.cartAttr = false;
console.log(that.storeInfo)
that.$set(that, "attr", attr);
console.log(this)
},
openTeam: function() {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.cartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.combinationId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title:
err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
},
openTeam: function () {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.cartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.combinationId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: {
id: res.data.cartId
}
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none",
duration: 2000
});
});
});
}
}
},
//
selecAttrTap: function () {
this.attr.cartAttr = true;
this.isOpen = true;
},
}
}
};
};
</script>
<style scoped lang="less">
.product-con .wrapper {
padding-bottom: 0.26 * 100rpx;
}
.noscroll {
height: 100%;
overflow: hidden;
}
.product-con .footer-group .bnt {
// flex:1;
width: 43%;
}
.product-con .footer-group .bnt.bg-color-violet {
background-color: #fa8013;
}
.product-con .wrapper {
padding-bottom: 0.26 * 100rpx;
}
.noscroll {
height: 100%;
overflow: hidden;
}
.product-con .footer-group .bnt {
// flex:1;
width: 43%;
}
.footer-group {
button {
border: 0;
background: none;
}
}
.product-con .footer-group .bnt.bg-color-violet {
background-color: #fa8013;
}
</style>

4
pages/activity/GroupRule/index.vue

@ -111,6 +111,7 @@ export default {
pinkT: [], //
storeCombination: [], //
pinkId: 0,
uniqueId: "",
count: 0, //
iShidden: false
};
@ -140,7 +141,7 @@ export default {
var data = {};
data.productId = that.storeCombination.productId;
data.cartNum = that.pinkT.totalNum;
data.uniqueId = "";
data.uniqueId = that.uniqueId;
data.combinationId = that.storeCombination.id;
data.new = 1;
postCartAdd(data)
@ -208,6 +209,7 @@ export default {
that.$set(that, "pinkBool", res.data.pinkBool);
that.$set(that, "isOk", res.data.isOk);
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder);
that.$set(that, "uniqueId", res.data.uniqueId);
});
},
//

128
pages/activity/Poster/index.vue

@ -9,71 +9,81 @@
</view>
</template>
<script>
import { getBargainPoster, getCombinationPoster } from "@/api/activity";
import {
getBargainPoster,
getCombinationPoster
} from "@/api/activity";
export default {
name: "Poster",
components: {},
props: {},
data: function() {
return {
status: true,
id: 0,
image: ""
};
},
mounted: function() {
var that = this;
var id = that.$yroute.query.id;
var type = that.$yroute.query.type;
that.id = id;
if (type == 2) {
that.getBargainPoster();
} else {
that.getCombinationPoster();
}
},
methods: {
getBargainPoster: function() {
var that = this;
getBargainPoster({ bargainId: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
export default {
name: "Poster",
components: {},
props: {},
data: function () {
return {
status: true,
id: 0,
image: ""
};
},
//
getCombinationPoster: function() {
mounted: function () {
var that = this;
getCombinationPoster({ id: that.id, from: "wechat" })
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
var id = that.$yroute.query.id;
var type = that.$yroute.query.type;
that.id = id;
if (type == 2) {
that.getBargainPoster();
} else {
that.getCombinationPoster();
}
},
methods: {
getBargainPoster: function () {
var that = this;
getBargainPoster({
bargainId: that.id,
from: "wechat"
})
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
},
//
getCombinationPoster: function () {
var that = this;
getCombinationPoster({
id: that.id,
from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType
})
.then(res => {
that.image = res.data.url;
that.status = false;
})
.catch(res => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
});
});
}
}
}
};
};
</script>
<style scoped lang="less">
page {
background-color: #eb3729;
}
.poster-poster {
height: unset !important;
}
page {
background-color: #eb3729;
}
.poster-poster {
height: unset !important;
}
</style>

536
pages/activity/SeckillDetails/index.vue

@ -10,15 +10,8 @@
<view class="acea-row row-middle">
<view class="times">
<view>距秒杀结束仅剩</view>
<count-down
:isDay="false"
:tipText="false"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="datatime"
></count-down>
<count-down :isDay="false" :tipText="false" :dayText="false" :hourText="' : '" :minuteText="' : '"
:secondText="false" :datatime="datatime"></count-down>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
@ -33,203 +26,382 @@
<view v-text="'销量:' + storeInfo.sales + '件'"></view>
</view>
</view>
<!-- 规格 -->
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view>
<text>{{ attrTxt }}</text>
<text class="atterTxt">{{ attrValue }}</text>
</view>
<view class="iconfont icon-jiantou"></view>
</view>
<view class="product-intro">
<view class="title">产品介绍</view>
<view class="conter" v-html="storeInfo.description"></view>
</view>
<!-- 操作栏 -->
<view style="height:100rpx;"></view>
<view class="footerRush acea-row row-between-wrapper">
<!-- <view
class="customerSer acea-row row-center-wrapper row-column"
@click="routerGo()"
>
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</view> -->
<view class="bnt bg-color-red" @click="tapBuy">立即购买</view>
<view class="footer acea-row row-between-wrapper">
<!-- #ifdef MP-WEIXIN -->
<view class="item">
<button open-type="contact" class='contacButton'>
<view style="padding-bottom: 8rpx;" class="item">
<view class="iconfont icon-kefu"></view>
<text>客服</text>
</view>
</button>
</view>
<!-- #endif -->
<view class="item" @click="setCollect" v-if="userCollect">
<view class="iconfont icon-shoucang1"></view>
<text>收藏</text>
</view>
<view class="item" @click="setCollect" v-if="!userCollect">
<view class="iconfont icon-shoucang"></view>
<text>收藏</text>
</view>
<view class="bnt acea-row" v-if="
seckillStatus == 1 &&
storeInfo.num > 0 &&
storeInfo.stock > 0
">
<view class="joinCart" @click="openAlone">
<text>单独购买</text>
</view>
<view class="buy" @click="tapBuy">
<text>立即购买</text>
</view>
</view>
<div class="bnt acea-row" v-if="
seckillStatus == 1 &&
storeInfo.num <= 0 &&
storeInfo.stock <= 0
">
<div class="joinCart" @click="openAlone">原价购买</div>
<div class="buy bg-color-hui">已售罄</div>
</div>
<div class="bnt acea-row" v-if="seckillStatus == 2">
<div class="joinCart" @click="openAlone">原价购买</div>
<div class="buy bg-color-hui">即将开始</div>
</div>
<div class="bnt acea-row" v-if="seckillStatus == 0">
<div class="joinCart" @click="openAlone">原价购买</div>
<div class="buy bg-color-hui">已结束</div>
</div>
</view>
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
<StorePoster
v-on:setPosterImageStatus="setPosterImageStatus"
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
<StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus"
:posterData="posterData"></StorePoster>
</view>
</template>
<style scoped lang="less">
.noscroll {
height: 100%;
overflow: hidden;
}
.noscroll {
height: 100%;
overflow: hidden;
}
</style>
<script>
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import { getSeckillDetail } from "@/api/activity";
import { postCartAdd } from "@/api/store";
import { imageBase64 } from "@/api/public";
const NAME = "SeckillDetails";
import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown";
import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster";
import {
getSeckillDetail
} from "@/api/activity";
import {
postCartAdd
} from "@/api/store";
import {
imageBase64
} from "@/api/public";
import {
getCoupon,
getCollectAdd,
getCollectDel,
getUserInfo
} from "@/api/user";
const NAME = "SeckillDetails";
export default {
name: "SeckillDetails",
components: {
ProductConSwiper,
CountDown,
ProductWindow,
StorePoster
},
props: {},
data: function() {
return {
domStatus: false,
posterData: {
image: "",
title: "",
price: "",
code: ""
},
posterImageStatus: false,
action: "",
imgUrls: [],
storeInfo: [],
replyCount: 0,
reply: [],
cartNum: 1,
attr: {
cartAttr: false,
productSelect: {
export default {
name: "SeckillDetails",
components: {
ProductConSwiper,
CountDown,
ProductWindow,
StorePoster
},
props: {},
data: function () {
return {
seckillStatus: '',
domStatus: false,
posterData: {
image: "",
store_name: "",
title: "",
price: "",
stock: "",
unique: "",
cart_num: 1
code: ""
},
posterImageStatus: false,
action: "",
imgUrls: [],
storeInfo: [],
replyCount: 0,
reply: [],
cartNum: 1,
attrTxt: "请选择",
productValue: [],
attrValue: "",
attr: {
cartAttr: false,
productAttr: [],
productSelect: {},
},
datatime: 0,
userCollect: false
};
},
onShow: function () {
this.mountedStart();
},
methods: {
onShareAppMessage: function () {
return {
title: this.storeInfo.title,
imageUrl: this.storeInfo.image,
path: "pages/activity/GoodsSeckill/index?id=" + this.storeInfo.id + "&spread=" + uni.getStorageSync("uid") +
"&pageType=good&codeType=routine",
success(res) {
uni.showToast({
title: '分享成功'
})
},
fail(res) {
uni.showToast({
title: '分享失败',
icon: 'none'
})
}
}
},
datatime: 0
};
},
watch: {
$yroute: function(n) {
var that = this;
if (n.name === NAME) {
that.mountedStart();
}
}
},
mounted: function() {
this.mountedStart();
},
methods: {
routerGo(item) {
this.$yrouter.push({ path: '/pages/user/CustomerList/index' })
},
mountedStart: function() {
var that = this;
let id = that.$yroute.query.id;
that.datatime = parseInt(that.$yroute.query.time);
getSeckillDetail(id).then(res => {
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "reply", res.data.reply);
that.posterData.image = that.storeInfo.image_base;
that.updateTitle();
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
openAlone: function () {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: {
id: this.storeInfo.productId
}
});
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
},
routerGo(item) {
this.$yrouter.push({
path: '/pages/user/CustomerList/index'
})
},
//
setCollect: function () {
let that = this,
id = that.storeInfo.id,
category = "product";
if (that.userCollect) {
getCollectDel(id, category).then(function () {
that.userCollect = !that.userCollect;
});
} else {
that.posterData.title = that.storeInfo.title;
getCollectAdd(id, category).then(function () {
that.userCollect = !that.userCollect;
});
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base;
that.setProductSelect();
that.domStatus = true;
});
},
updateTitle() {
// document.title = this.storeInfo.title || this.$yroute.meta.title;
},
setPosterImageStatus: function() {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
//
changeFun: function(opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function(res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function(res) {
var that = this;
if (res) {
if (that.attr.productSelect.cart_num < that.storeInfo.stock) {
that.attr.productSelect.cart_num++;
this.cartNum++;
},
mountedStart: function () {
var that = this;
console.log(this)
let id = that.$yroute.query.id;
this.seckillStatus = that.$yroute.query.status;
that.datatime = parseInt(that.$yroute.query.time);
getSeckillDetail(id).then(res => {
that.userCollect = res.data.userCollect;
res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.$set(that.attr, "productAttr", res.data.productAttr);
that.$set(that, "productValue", res.data.productValue);
that.$set(that, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "replyCount", res.data.replyCount);
that.$set(that, "reply", res.data.reply);
that.posterData.image = that.storeInfo.image_base;
that.updateTitle();
if (that.storeInfo.title.length > 30) {
that.posterData.title = that.storeInfo.title.substring(0, 30) + "...";
} else {
that.posterData.title = that.storeInfo.title;
}
that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base;
// that.setProductSelect();
that.domStatus = true;
that.DefaultSelect();
});
},
updateTitle() {
// document.title = this.storeInfo.title || this.$yroute.meta.title;
},
setPosterImageStatus: function () {
// var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus;
},
DefaultSelect: function () {
let productAttr = this.attr.productAttr;
let value = [];
for (let i = 0; i < productAttr.length; i++) {
this.$set(productAttr[i], "index", 0);
value.push(productAttr[i].attrValueArr[0]);
}
} else {
if (that.attr.productSelect.cart_num > 1) {
that.attr.productSelect.cart_num--;
this.cartNum--;
//sort();:--
let productSelect = this.productValue[value.sort().join(",")];
console.log(productSelect)
if (productSelect && productAttr.length) {
this.$set(
this.attr.productSelect,
"store_name",
this.storeInfo.title
);
this.$set(this.attr.productSelect, "image", productSelect.image);
this.$set(this.attr.productSelect, "price", productSelect.seckillPrice);
this.$set(this.attr.productSelect, "stock", productSelect.seckillStock);
this.$set(this.attr.productSelect, "unique", productSelect.unique);
this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", value.sort().join(","));
this.$set(this, "attrTxt", "已选择");
} else if (!productSelect && productAttr.length) {
this.$set(
this.attr.productSelect,
"store_name",
this.storeInfo.title
);
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
this.$set(this.attr.productSelect, "price", this.storeInfo.seckillPrice);
this.$set(this.attr.productSelect, "stock", 0);
this.$set(this.attr.productSelect, "unique", "");
this.$set(this.attr.productSelect, "cart_num", 0);
this.$set(this, "attrValue", "");
this.$set(this, "attrTxt", "请选择");
} else if (!productSelect && !productAttr.length) {
this.$set(
this.attr.productSelect,
"store_name",
this.storeInfo.title
);
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
this.$set(this.attr.productSelect, "price", this.storeInfo.seckillPrice);
this.$set(this.attr.productSelect, "stock", this.storeInfo.seckillStock);
this.$set(
this.attr.productSelect,
"unique",
this.storeInfo.unique || ""
);
this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", "");
this.$set(this, "attrTxt", "请选择");
}
}
},
setProductSelect: function() {
var that = this;
var attr = that.attr;
attr.productSelect.image = that.storeInfo.image;
attr.productSelect.store_name = that.storeInfo.title;
attr.productSelect.price = that.storeInfo.price;
attr.productSelect.stock = that.storeInfo.stock;
attr.cartAttr = false;
that.$set(that, "attr", attr);
},
selecAttrTap: function() {
this.cartAttr = true;
},
tapBuy: function() {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.attrcartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.secKillId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId }
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message,
icon: 'none',
duration: 2000
},
//
changeFun: function (opt) {
if (typeof opt !== "object") opt = {};
let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value);
},
changeattr: function (res) {
var that = this;
that.attr.cartAttr = res;
},
ChangeCartNum: function (res) {
var that = this;
if (res) {
if (that.attr.productSelect.cart_num < that.storeInfo.seckillStock) {
that.attr.productSelect.cart_num++;
this.cartNum++;
}
} else {
if (that.attr.productSelect.cart_num > 1) {
that.attr.productSelect.cart_num--;
this.cartNum--;
}
}
},
//
ChangeAttr: function (res) {
//
let productSelect = this.productValue[res.value];
if (productSelect) {
this.attr.productAttr[res.indexw].index = res.indexn;
this.$set(this.attr.productSelect, "image", productSelect.image);
this.$set(this.attr.productSelect, "price", productSelect.seckillPrice);
this.$set(this.attr.productSelect, "stock", productSelect.seckillStock);
this.$set(this.attr.productSelect, "unique", productSelect.unique);
this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", res.value);
this.$set(this, "attrTxt", "已选择");
} else {
this.$set(this.attr.productSelect, "image", this.storeInfo.image);
this.$set(this.attr.productSelect, "price", this.storeInfo.seckillPrice);
this.$set(this.attr.productSelect, "stock", 0);
this.$set(this.attr.productSelect, "unique", "");
this.$set(this.attr.productSelect, "cart_num", 0);
this.$set(this, "attrValue", "");
this.$set(this, "attrTxt", "请选择");
}
},
selecAttrTap: function () {
this.attr.cartAttr = true;
this.isOpen = true;
},
tapBuy: function () {
var that = this;
if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.attrcartAttr;
} else {
var data = {};
data.productId = that.storeInfo.productId;
data.cartNum = that.attr.productSelect.cart_num;
data.uniqueId = that.attr.productSelect.unique;
data.secKillId = that.storeInfo.id;
data.new = 1;
postCartAdd(data)
.then(res => {
that.$yrouter.push({
path: "/pages/order/OrderSubmission/index",
query: {
id: res.data.cartId
}
});
})
.catch(err => {
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none',
duration: 2000
});
});
});
}
}
}
}
};
};
</script>
<style scoped lang="less">
.product-con .nav {
padding: 0 0.2*100rpx;
}
.product-con .nav {
padding: 0 0.2*100rpx;
}
.product-con .footer .bnt .buy.bg-color-hui {
background: #ccc;
}
</style>

339
pages/authorization/index.vue

@ -1,219 +1,192 @@
<template>
<view class="container">
<view v-if="!token">
<!-- #ifdef MP-WEIXIN -->
<view>
<view class="getUserInfo">
<text>您还未允许微信登录授权请点击下方按钮允许微信授权登录</text>
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button>
<view style="height:20rpx"></view>
<button @click="back">取消微信登录授权</button>
</view>
<!-- #ifdef MP-WEIXIN -->
<view v-if="!token" class="force-login-wrap">
<!-- <image class="logo-bg" src="@/static/images/logo_bg.png" mode="aspectFill"></image> -->
<view class="force-login__content y-f">
<open-data class="user-avatar" type="userAvatarUrl"></open-data>
<open-data class="user-name" type="userNickName"></open-data>
<view class="login-notice">为了提供更优质的服务需要获取您的头像昵称</view>
<button class="cu-btn author-btn" @getuserinfo="getUserInfo" open-type="getUserInfo">授权并查看</button>
<button class="cu-btn close-btn" @tap="back">暂不授权</button>
</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view>
<view class="getUserInfo">
<text>请先登录</text>
<button type="primary" @tap="toLogin">去登录</button>
</view>
</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="force-login-wrap">
<!-- <image class="logo-bg" src="@/static/images/logo_bg.png" mode="aspectFill"></image> -->
<view class="force-login__content y-f">
<view class="login-notice">为了提供更优质的服务请先登录</view>
<button class="cu-btn author-btn" @tap="toLogin">去登录</button>
</view>
<!-- #endif -->
</view>
<!-- #endif -->
</view>
</template>
<script>
import { mapState, mapMutations, mapActions } from "vuex";
import { wxappAuth, getUser } from "@/api/user";
import dayjs from "dayjs";
import cookie from "@/utils/store/cookie";
import { login, authorize } from "@/utils";
export default {
data() {
return {
authorize: false,
};
},
computed: {
...mapState(["isAuthorization", "$deviceType", "token"]),
},
onShow() {
// //
},
onHide() {
this.updateAuthorizationPage(false);
this.changeAuthorization(false);
},
onUnload() {
this.updateAuthorizationPage(false);
this.changeAuthorization(false);
},
methods: {
...mapActions(["changeAuthorization", "setUserInfo"]),
...mapMutations(["updateAuthorizationPage"]),
toLogin() {
this.$yrouter.push({
path: "/pages/user/Login/index",
query: {},
});
import {
mapState,
mapMutations,
mapActions
} from "vuex";
import {
wxappAuth,
getUser
} from "@/api/user";
import dayjs from "dayjs";
import cookie from "@/utils/store/cookie";
import {
login,
authorize
} from "@/utils";
export default {
data() {
return {
authorize: false,
};
},
computed: {
...mapState(["isAuthorization", "$deviceType", "token"]),
},
onShow() {
// //
},
onHide() {
this.updateAuthorizationPage(false);
this.changeAuthorization(false);
},
back() {
this.$yrouter.switchTab({
path: "/pages/home/index",
query: {},
});
onUnload() {
this.updateAuthorizationPage(false);
this.changeAuthorization(false);
},
getUserInfo(data) {
if (data.detail.errMsg == "getUserInfo:fail auth deny") {
uni.showToast({
title: "取消授权",
icon: "none",
duration: 2000,
methods: {
...mapActions(["changeAuthorization", "setUserInfo"]),
...mapMutations(["updateAuthorizationPage"]),
toLogin() {
this.$yrouter.push({
path: "/pages/user/Login/index",
query: {},
});
return;
}
uni.showLoading({
title: "登录中",
});
login()
.then((res) => {
this.$yrouter.replace({ path: cookie.get("redirect") });
})
.catch((error) => {
console.log(error);
},
back() {
this.$yrouter.switchTab({
path: "/pages/home/index",
query: {},
});
},
getUserInfo(data) {
if (data.detail.errMsg == "getUserInfo:fail auth deny") {
uni.showToast({
title: error,
title: "取消授权",
icon: "none",
duration: 2000,
});
return;
}
uni.showLoading({
title: "登录中",
});
login()
.then((res) => {
this.$yrouter.replace({
path: cookie.get("redirect")
});
})
.catch((error) => {
console.log(error);
uni.showToast({
title: error,
icon: "none",
duration: 2000,
});
});
},
},
},
mounted() {},
};
mounted() {},
};
</script>
<style lang="less">
.sp-cell {
height: 20rpx;
}
.getUserInfo {
display: flex;
align-items: center;
flex-direction: column;
padding: 30px;
text {
font-size: 30rpx;
text-align: center;
margin-bottom: 20px;
}
}
.container {
flex: 1;
display: flex;
flex-direction: column;
justify-content: flex-start;
position: relative;
}
.tab-bar {
font-size: 0;
display: flex;
align-items: center;
background: rgba(255, 255, 255, 0.9);
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
border-top: 1px solid rgba(248, 248, 248, 1);
.tab-bar-item {
.container {
flex: 1;
height: 49px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
justify-content: flex-start;
position: relative;
}
&.active {
text {
color: #ee7559;
}
.force-login-wrap {
width: 100%;
height: 100%;
overflow: hidden;
z-index: 11111;
top: 0;
.tab-bar-pic {
display: none;
background: #f9f9f9;
.logo-bg {
width: 640rpx;
height: 300rpx;
}
&.active {
display: block;
}
.force-login__content {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
.user-avatar {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
overflow: hidden;
margin-bottom: 40rpx;
}
}
.tab-bar-pic {
display: block;
background: #f9f9f9;
.user-name {
font-size: 35rpx;
font-family: PingFang SC;
font-weight: bold;
color: #000;
margin-bottom: 30rpx;
}
&.active {
display: none;
.login-notice {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000;
line-height: 44rpx;
width: 500rpx;
text-align: center;
margin-bottom: 80rpx;
}
}
}
.tab-bar-pic {
width: 25px;
height: 25px;
background: #f9f9f9;
.author-btn {
width: 630rpx;
height: 80rpx;
background: linear-gradient(to right, #f35447 0%, #ff8e3c 100%);
background: -moz-linear-gradient(to right, #f35447 0%, #ff8e3c 100%);
// box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
border-radius: 40rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
image {
width: 25px;
height: 25px;
.close-btn {
width: 630rpx;
height: 80rpx;
margin-top: 30rpx;
border-radius: 40rpx;
border: 2rpx solid #eb3729;
background: none;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: #eb3729;
}
}
}
.tab-bar-pic-active {
}
text {
font-size: 10px;
color: rgb(160, 160, 160);
line-height: 10px;
margin-top: 5px;
}
}
.tab-bar-bg {
padding-top: 46px;
width: 100%;
}
.view-item {
display: none;
width: 100%;
}
.view-item-active {
display: block;
}
.getUserInfo {
display: flex;
align-items: center;
flex-direction: column;
padding: 30px;
p {
margin-bottom: 20px;
}
}
._van-dialog {
z-index: 99999999999;
}
</style>

173
pages/home/components/Banner.vue

@ -0,0 +1,173 @@
<template>
<view class="banner-swiper-box">
<canvas canvas-id="colorThief" class="hide-canvas"></canvas>
<swiper class="banner-carousel Shop-selector-rect" circular @change="swiperChange" :autoplay="true">
<swiper-item v-for="(item, index) in list" :key="index" class="carousel-item" @tap="routerTo(item.path)">
<image class="swiper-image " :src="item.pic" @click="goRoll(item)" mode="widthFix" lazy-load>
</image>
</swiper-item>
</swiper>
<view class="banner-swiper-dots">
<text :class="swiperCurrent === index ? 'banner-dot-active' : 'banner-dot'"
v-for="(dot, index) in list.length" :key="index"></text>
</view>
</view>
</template>
<script>
import colorThief from 'miniapp-color-thief';
export default {
data() {
return {
swiperCurrent: 0, //
webviewId: 0,
bgcolorAry: [],
list: []
};
},
props: {
banner: {
type: Array,
default: []
}
},
created: async function () {
await this.doColorThief();
},
async mounted() {
},
computed: {},
watch: {
banner(next) {
this.list = next;
this.doColorThief()
}
},
methods: {
async doColorThief() {
let that = this;
//
let item = this.list[this.swiperCurrent];
if(!item){
return
}
//
let bgcolor = this.bgcolorAry[this.swiperCurrent];
//
if (!bgcolor) {
let ctx = uni.createCanvasContext('colorThief', that.$scope);
if (0 === that.webviewId || ctx.webviewId === that.webviewId) {
that.webviewId = ctx.webviewId;
uni.getImageInfo({
src: item.pic,
success: function (image) {
ctx.drawImage(image.path, 0, 0, image.width, image.height);
ctx.draw(true, function (e) {
uni.canvasGetImageData({
canvasId: 'colorThief',
x: 0,
y: 0,
width: parseInt(image.width),
height: parseInt(image.height),
success(res) {
let newBgcolor = colorThief(res.data)
.color()
.getHex();
that.$set(that.bgcolorAry, that
.swiperCurrent,
newBgcolor);
that.$emit('getbgcolor', newBgcolor);
},
fail: function (error) {
}
}, that.$scope);
});
},
fail: function (error) {
}
});
}
} else {
that.$set(item, 'bgcolor', bgcolor);
that.$emit('getbgcolor', bgcolor);
}
},
swiperChange(e) {
this.swiperCurrent = e.detail.current;
this.doColorThief();
},
//
goRoll(item) {
if (item.uniapp_url) {
this.$yrouter.push(item.uniapp_url)
}
},
}
}
</script>
<style lang="less">
//
.banner-swiper-box {
background: #fff;
}
.banner-swiper-box,
.banner-carousel {
width: 750rpx;
height: 350upx;
position: relative;
.carousel-item {
width: 100%;
height: 100%;
// padding: 0 28upx;
overflow: hidden;
}
.swiper-image {
width: 100%;
height: 100%;
// border-radius: 10upx;
// background: #ccc;
}
}
.banner-swiper-dots {
display: flex;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 20rpx;
z-index: 5;
.banner-dot {
width: 14rpx;
height: 14rpx;
background: rgba(255, 255, 255, 1);
border-radius: 50%;
margin-right: 10rpx;
}
.banner-dot-active {
width: 14rpx;
height: 14rpx;
background: #a8700d;
border-radius: 50%;
margin-right: 10rpx;
}
}
.hide-canvas {
position: fixed !important;
top: -99999upx;
left: -99999upx;
z-index: -99999;
}
</style>

216
pages/home/components/FirstNewProduct.vue

@ -0,0 +1,216 @@
<template>
<view class="group-goods pa20 mx20 mb10" v-if="detail.length>0">
<view class="title-box x-bc" @tap="$yrouter.push({ path: '/pages/shop/HotNewGoods/index',query:{type:3} })">
<text class="title">首发新品</text>
<view class="group-people x-f">
<text class="tip">更多</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="goods-box swiper-box x-f">
<swiper class="carousel" circular @change="swiperChange" :autoplay="true" duration="2000">
<swiper-item v-for="(goods, index) in goodsList" :key="index" class="carousel-item">
<view class="goods-list-box x-f">
<block v-for="mgoods in goods" :key="mgoods.id">
<view class="min-goods"
@tap="$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:mgoods.id} })">
<view class="img-box">
<view class="tag">new</view>
<image class="img" :src="mgoods.image" mode="widthFix"></image>
</view>
<view class="price-box">
<view class="y-f">
<text class="seckill-current">{{ mgoods.price }}</text>
<text class="original">销量{{ mgoods.sales }}{{mgoods.unitName}}</text>
</view>
</view>
<view class="title">
<slot name="titleText"></slot>
</view>
</view>
</block>
</view>
</swiper-item>
</swiper>
<view class="swiper-dots" v-if="goodsList.length > 1">
<text :class="swiperCurrent === index ? 'dot-active' : 'dot'" v-for="(dot, index) in goodsList.length"
:key="index"></text>
</view>
</view>
</view>
</template>
<script>
import shActivityGoods from '@/components/sh-activity-goods.vue';
export default {
name: "FirstNewProduct",
components: {
shActivityGoods
},
data() {
return {
goodsList: [],
swiperCurrent: 0
};
},
props: {
detail: Array
},
computed: {},
created() {},
watch: {
detail(next) {
this.goodsList = this.sortData(next, 4);
}
},
methods: {
swiperChange(e) {
this.swiperCurrent = e.detail.current;
},
//
sortData(oArr, length) {
let arr = [];
let minArr = [];
oArr.forEach(c => {
if (minArr.length === length) {
minArr = [];
}
if (minArr.length === 0) {
arr.push(minArr);
}
minArr.push(c);
});
return arr;
},
jump(path, query) {
this.$yrouter.push({
path,
query,
});
},
}
}
</script>
<style lang="scss" scoped>
.group-goods {
position: relative;
z-index: 9;
}
.swiper-box,
.carousel {
width: 700rpx;
height: 240upx;
position: relative;
border-radius: 20rpx;
.carousel-item {
width: 100%;
height: 100%;
// padding: 0 28upx;
overflow: hidden;
}
.swiper-image {
width: 100%;
height: 100%;
// border-radius: 10upx;
background: #ccc;
}
}
.swiper-dots {
display: flex;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0rpx;
z-index: 66;
.dot {
width: 45rpx;
height: 3rpx;
background: #eee;
border-radius: 50%;
margin-right: 10rpx;
}
.dot-active {
width: 45rpx;
height: 3rpx;
background: #a8700d;
border-radius: 50%;
margin-right: 10rpx;
}
}
// +
.group-goods {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
.title-box {
padding-bottom: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
}
.group-people {
.time-box {
font-size: 26rpx;
color: #edbf62;
.count-text-box {
width: 30rpx;
height: 34rpx;
background: #edbf62;
text-align: center;
line-height: 34rpx;
font-size: 24rpx;
border-radius: 6rpx;
color: rgba(#fff, 0.9);
margin: 0 8rpx;
}
}
.head-box {
.head-img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #ccc;
}
}
.tip {
font-size: 28rpx;
padding-left: 30rpx;
color: #666;
}
.cuIcon-right {
font-size: 30rpx;
line-height: 28rpx;
color: #666;
}
}
}
.goods-box {
.goods-item {
margin-right: 22rpx;
&:nth-child(4n) {
margin-right: 0;
}
}
}
}
</style>

219
pages/home/components/HotCommodity.vue

@ -0,0 +1,219 @@
<template>
<view class="group-goods pa20 mx20 mb10" v-if="detail.length>0">
<view class="title-box x-bc" @tap="$yrouter.push({ path: '/pages/shop/HotNewGoods/index',query:{type:2} })">
<text class="title">热门榜单</text>
<view class="group-people x-f">
<text class="tip">更多</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="goods-box swiper-box x-f">
<swiper class="carousel" circular @change="swiperChange" :autoplay="true" duration="2000">
<swiper-item v-for="(goods, index) in goodsList" :key="index" class="carousel-item">
<view class="goods-list-box x-f">
<block v-for="mgoods in goods" :key="mgoods.id">
<view class="min-goods" @tap="jump('/pages/shop/GoodsCon/index',{id:mgoods.id})">
<view class="img-box">
<view class="tag">hot</view>
<image class="img" :src="mgoods.image" mode="widthFix"></image>
</view>
<view class="price-box">
<view class="y-f">
<text class="seckill-current">{{ mgoods.price }}</text>
<text class="original">销量{{ mgoods.sales }}{{mgoods.unitName}}</text>
</view>
</view>
<view class="title">
<slot name="titleText"></slot>
</view>
</view>
</block>
</view>
</swiper-item>
</swiper>
<view class="swiper-dots" v-if="goodsList.length > 1">
<text :class="swiperCurrent === index ? 'dot-active' : 'dot'" v-for="(dot, index) in goodsList.length"
:key="index"></text>
</view>
</view>
</view>
</template>
<script>
import shActivityGoods from '@/components/sh-activity-goods.vue';
export default {
name: "HotCommodity",
components: {
shActivityGoods
},
data() {
return {
goodsList: [],
swiperCurrent: 0
};
},
props: {
detail: Array
},
computed: {},
created() {},
watch: {
detail(next) {
this.goodsList = this.sortData(next, 4);
}
},
methods: {
swiperChange(e) {
this.swiperCurrent = e.detail.current;
},
//
sortData(oArr, length) {
let arr = [];
let minArr = [];
oArr.forEach(c => {
if (minArr.length === length) {
minArr = [];
}
if (minArr.length === 0) {
arr.push(minArr);
}
minArr.push(c);
});
return arr;
},
jump(path, query) {
this.$yrouter.push({
path,
query,
});
},
}
}
</script>
<style lang="scss" scoped>
.group-goods {
position: relative;
z-index: 9;
}
.swiper-box,
.carousel {
width: 700rpx;
height: 240upx;
position: relative;
border-radius: 20rpx;
.carousel-item {
width: 100%;
height: 100%;
// padding: 0 28upx;
overflow: hidden;
}
.swiper-image {
width: 100%;
height: 100%;
// border-radius: 10upx;
background: #ccc;
}
}
.swiper-dots {
display: flex;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0rpx;
z-index: 66;
.dot {
width: 45rpx;
height: 3rpx;
background: #eee;
border-radius: 50%;
margin-right: 10rpx;
}
.dot-active {
width: 45rpx;
height: 3rpx;
background: #a8700d;
border-radius: 50%;
margin-right: 10rpx;
}
}
// +
.group-goods {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
.title-box {
padding-bottom: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
}
.group-people {
.time-box {
font-size: 26rpx;
color: #edbf62;
.count-text-box {
width: 30rpx;
height: 34rpx;
background: #edbf62;
text-align: center;
line-height: 34rpx;
font-size: 24rpx;
border-radius: 6rpx;
color: rgba(#fff, 0.9);
margin: 0 8rpx;
}
}
.head-box {
.head-img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #ccc;
}
}
.tip {
font-size: 28rpx;
padding-left: 30rpx;
color: #666;
}
.cuIcon-right {
font-size: 30rpx;
line-height: 28rpx;
color: #666;
}
}
}
.goods-box {
.goods-item {
margin-right: 22rpx;
&:nth-child(4n) {
margin-right: 0;
}
}
}
.min-goods{
margin-right: 22rpx;
}
}
</style>

249
pages/home/components/Live.vue

@ -0,0 +1,249 @@
<template>
<view class="live-el mx20 mb10">
<view class="head">
<text class="head-title">热门直播</text>
<view class="head-more" @tap="$yrouter.push('/pages/shop/Live/LiveList/index')">
<text>更多</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="content-one">
<view class="content-one__item" v-for="live in detail" :key="live.roomId" @tap="goRoom(live)">
<image class="item-cover" :src="live.shareImge" mode="widthFix"></image>
<view class="item-status">
<image class="status-img" :src="liveStatus[live.liveStatus].img" mode=""></image>
<text class="status-text">{{ liveStatus[live.liveStatus].title }}</text>
</view>
<view class="item-title">{{ live.name }}</view>
<image v-if="live.liveStatus == 101" class="like-img" src="http://Shop.7wpp.com/imgs/live/zan.gif"
mode=""></image>
</view>
</view>
</view>
</template>
<script>
import ShopLiveCard from '@/components/ShopLiveCard.vue'
let HAS_LIVE = false
// #ifdef MP-WEIXIN
HAS_LIVE = true
let livePlayer = null;
if (HAS_LIVE) {
livePlayer = requirePlugin('live-player-plugin');
}
// #endif
import {
yxWechatLive,
getLiveReplay
} from '@/api/live';
let timer = null;
export default {
components: {
ShopLiveCard
},
data() {
return {
liveList: [],
liveStatus: {
'101': {
img: 'https://wx.yixiang.co/static/images/live.png',
title: '直播中'
},
'102': {
img: 'https://wx.yixiang.co/static/images/prevue.png',
title: '未开始'
},
'103': {
img: 'https://wx.yixiang.co/static/images/playback.png',
title: '已结束'
},
'104': {
img: 'https://wx.yixiang.co/static/images/104.png',
title: '禁播'
},
'105': {
img: 'https://wx.yixiang.co/static/images/105.png',
title: '暂停中'
},
'106': {
img: 'https://wx.yixiang.co/static/images/106.png',
title: '异常'
},
'107': {
img: 'https://wx.yixiang.co/static/images/past.png',
title: '已过期'
}
}
};
},
props: {
detail: Array
},
created() {
},
mounted() {
let that = this;
timer = setInterval(() => {
that.getLiveStatus();
}, 60000);
},
beforeDestroy() {
timer = null;
},
computed: {},
methods: {
//
getLiveList() {
// let that = this;
// yxWechatLive({
// page: 1,
// size: 10,
// }).then(res => {
// console.log(res)
// })
},
// liveStatus
getLiveStatus() {
// if (HAS_LIVE) {
// let that = this;
// let date = '';
// if (that.detail.liveStatus == 102) {
// date = that.$tools.dateFormat('mm-dd HH:MM', new Date(that.detail.starttime * 1000)).replace('-',
// '/');
// that.liveStatus['102'].title = ' ' + date;
// }
// livePlayer
// .getLiveStatus({
// room_id: that.detail.roomId
// })
// .then(res => {
// // 101: , 102: , 103: , 104: , 105: , 106: 107
// that.detail.liveStatus = res.liveStatus;
// })
// .catch(err => {
// console.log('get live status', err);
// });
// }
},
goRoom(live) {
console.log(live.roomId,9999)
wx.navigateTo({
url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${live.roomId}`
});
}
}
};
</script>
<style lang="scss">
.live-el {
background: #fff;
border-radius: 20rpx;
padding: 30rpx 20rpx 25rpx;
.head {
display: flex;
justify-content: space-between;
align-items: center;
&-title {
font-size: 32rpx;
font-weight: bold;
font-family: PingFang SC;
color: rgba(51, 51, 51, 1);
}
&-more {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
}
}
//
.content-one {
.content-one__item {
position: relative;
height: 280rpx;
border-radius: 20rpx;
margin-top: 25rpx;
overflow: hidden;
.item-cover {
background-color: #eee;
width: 100%;
height: 100%;
}
.item-status {
position: absolute;
top: 20rpx;
left: 10rpx;
height: 40rpx;
background: rgba(0, 0, 0, 0.4);
border-radius: 20rpx;
display: flex;
justify-content: center;
align-items: center;
.status-img {
width: 38rpx;
height: 38rpx;
}
.status-text {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
padding: 0 10rpx;
}
}
.item-title {
width: 680rpx;
position: absolute;
bottom: 0;
line-height: 60rpx;
padding: 0 20rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
background: linear-gradient(transparent, rgba(#000, 0.5));
}
.like-img {
position: absolute;
bottom: 20rpx;
right: 10rpx;
width: 60rpx;
height: 130rpx;
}
}
}
//
.content-two {
width: 100%;
// -moz-column-count: 2;
// -webkit-column-count: 2;
// column-count: 2;
// padding-top: 20rpx;
display: flex;
flex-wrap: wrap;
&__item {
margin-right: 30rpx;
margin-top: 20rpx;
&:nth-child(2n) {
margin-right: 0;
}
}
}
}
</style>

215
pages/home/components/ProductsRecommended.vue

@ -0,0 +1,215 @@
<template>
<view class="group-goods pa20 mx20 mb10" v-if="detail.length>0">
<view class="title-box x-bc" @tap="$yrouter.push({ path: '/pages/shop/HotNewGoods/index',query:{type:1} })">
<text class="title">精品推荐</text>
<view class="group-people x-f">
<text class="tip">更多</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="goods-box swiper-box x-f">
<swiper class="carousel" circular @change="swiperChange" :autoplay="true" duration="2000">
<swiper-item v-for="(goods, index) in goodsList" :key="index" class="carousel-item">
<view class="goods-list-box x-f">
<block v-for="mgoods in goods" :key="mgoods.id">
<view class="min-goods" @tap="$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:mgoods.id} })">
<view class="img-box">
<!-- <view class="tag">{{ mgoods.people}}人团</view> -->
<image class="img" :src="mgoods.image" mode="widthFix"></image>
</view>
<view class="price-box">
<view class="y-f">
<text class="seckill-current">{{ mgoods.price }}</text>
<text class="original">销量{{ mgoods.sales }}{{mgoods.unitName}}</text>
</view>
</view>
<view class="title">
<slot name="titleText"></slot>
</view>
</view>
</block>
</view>
</swiper-item>
</swiper>
<view class="swiper-dots" v-if="goodsList.length > 1">
<text :class="swiperCurrent === index ? 'dot-active' : 'dot'" v-for="(dot, index) in goodsList.length"
:key="index"></text>
</view>
</view>
</view>
</template>
<script>
import shActivityGoods from '@/components/sh-activity-goods.vue';
export default {
name: "ProductsRecommended",
components: {
shActivityGoods
},
data() {
return {
goodsList: [],
swiperCurrent: 0
};
},
props: {
detail: Array
},
computed: {},
created() {},
watch: {
detail(next) {
this.goodsList = this.sortData(next, 4);
}
},
methods: {
swiperChange(e) {
this.swiperCurrent = e.detail.current;
},
//
sortData(oArr, length) {
let arr = [];
let minArr = [];
oArr.forEach(c => {
if (minArr.length === length) {
minArr = [];
}
if (minArr.length === 0) {
arr.push(minArr);
}
minArr.push(c);
});
return arr;
},
jump(path, query) {
this.$yrouter.push({
path,
query,
});
},
}
}
</script>
<style lang="scss" scoped>
.group-goods {
position: relative;
z-index: 9;
}
.swiper-box,
.carousel {
width: 700rpx;
height: 240upx;
position: relative;
border-radius: 20rpx;
.carousel-item {
width: 100%;
height: 100%;
// padding: 0 28upx;
overflow: hidden;
}
.swiper-image {
width: 100%;
height: 100%;
// border-radius: 10upx;
background: #ccc;
}
}
.swiper-dots {
display: flex;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0rpx;
z-index: 66;
.dot {
width: 45rpx;
height: 3rpx;
background: #eee;
border-radius: 50%;
margin-right: 10rpx;
}
.dot-active {
width: 45rpx;
height: 3rpx;
background: #a8700d;
border-radius: 50%;
margin-right: 10rpx;
}
}
// +
.group-goods {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
.title-box {
padding-bottom: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
}
.group-people {
.time-box {
font-size: 26rpx;
color: #edbf62;
.count-text-box {
width: 30rpx;
height: 34rpx;
background: #edbf62;
text-align: center;
line-height: 34rpx;
font-size: 24rpx;
border-radius: 6rpx;
color: rgba(#fff, 0.9);
margin: 0 8rpx;
}
}
.head-box {
.head-img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #ccc;
}
}
.tip {
font-size: 28rpx;
padding-left: 30rpx;
color: #666;
}
.cuIcon-right {
font-size: 30rpx;
line-height: 28rpx;
color: #666;
}
}
}
.goods-box {
.goods-item {
margin-right: 22rpx;
&:nth-child(4n) {
margin-right: 0;
}
}
}
}
</style>

216
pages/home/components/PromoteProduct.vue

@ -0,0 +1,216 @@
<template>
<view class="group-goods pa20 mx20 mb10" v-if="detail.length>0">
<view class="title-box x-bc" @tap="$yrouter.push('/pages/shop/GoodsPromotion/index')">
<text class="title">促销单品</text>
<view class="group-people x-f">
<text class="tip">更多</text>
<text class="cuIcon-right"></text>
</view>
</view>
<view class="goods-box swiper-box x-f">
<swiper class="carousel" circular @change="swiperChange" :autoplay="true" duration="2000">
<swiper-item v-for="(goods, index) in goodsList" :key="index" class="carousel-item">
<view class="goods-list-box x-f">
<block v-for="mgoods in goods" :key="mgoods.id">
<view class="min-goods"
@tap="$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } })">
<view class="img-box">
<view class="tag">促销</view>
<image class="img" :src="mgoods.image" mode="widthFix"></image>
</view>
<view class="price-box">
<view class="y-f">
<text class="seckill-current">日常价{{ mgoods.price }}</text>
<text class="original">仅剩{{ mgoods.stock }}{{ mgoods.unitName }}</text>
</view>
</view>
<view class="title">
<slot name="titleText"></slot>
</view>
</view>
</block>
</view>
</swiper-item>
</swiper>
<view class="swiper-dots" v-if="goodsList.length > 1">
<text :class="swiperCurrent === index ? 'dot-active' : 'dot'" v-for="(dot, index) in goodsList.length"
:key="index"></text>
</view>
</view>
</view>
</template>
<script>
import shActivityGoods from '@/components/sh-activity-goods.vue';
export default {
name: "ProductsRecommended",
components: {
shActivityGoods
},
data() {
return {
goodsList: [],
swiperCurrent: 0
};
},
props: {
detail: Array
},
computed: {},
created() {},
watch: {
detail(next) {
this.goodsList = this.sortData(next, 4);
}
},
methods: {
swiperChange(e) {
this.swiperCurrent = e.detail.current;
},
//
sortData(oArr, length) {
let arr = [];
let minArr = [];
oArr.forEach(c => {
if (minArr.length === length) {
minArr = [];
}
if (minArr.length === 0) {
arr.push(minArr);
}
minArr.push(c);
});
return arr;
},
jump(path, query) {
this.$yrouter.push({
path,
query,
});
},
}
}
</script>
<style lang="scss" scoped>
.group-goods {
position: relative;
z-index: 9;
}
.swiper-box,
.carousel {
width: 700rpx;
height: 240upx;
position: relative;
border-radius: 20rpx;
.carousel-item {
width: 100%;
height: 100%;
// padding: 0 28upx;
overflow: hidden;
}
.swiper-image {
width: 100%;
height: 100%;
// border-radius: 10upx;
background: #ccc;
}
}
.swiper-dots {
display: flex;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0rpx;
z-index: 66;
.dot {
width: 45rpx;
height: 3rpx;
background: #eee;
border-radius: 50%;
margin-right: 10rpx;
}
.dot-active {
width: 45rpx;
height: 3rpx;
background: #a8700d;
border-radius: 50%;
margin-right: 10rpx;
}
}
// +
.group-goods {
background: #fff;
border-radius: 20rpx;
overflow: hidden;
.title-box {
padding-bottom: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
}
.group-people {
.time-box {
font-size: 26rpx;
color: #edbf62;
.count-text-box {
width: 30rpx;
height: 34rpx;
background: #edbf62;
text-align: center;
line-height: 34rpx;
font-size: 24rpx;
border-radius: 6rpx;
color: rgba(#fff, 0.9);
margin: 0 8rpx;
}
}
.head-box {
.head-img {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #ccc;
}
}
.tip {
font-size: 28rpx;
padding-left: 30rpx;
color: #666;
}
.cuIcon-right {
font-size: 30rpx;
line-height: 28rpx;
color: #666;
}
}
}
.goods-box {
.goods-item {
margin-right: 22rpx;
&:nth-child(4n) {
margin-right: 0;
}
}
}
}
</style>

332
pages/home/index.vue

@ -1,6 +1,19 @@
<template>
<view class="index">
<view class="header fixed-header acea-row row-center-wrapper">
<!-- 导航栏 -->
<view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">
<view class="cu-custom" :style="[{height:CustomBar+ 'px',}]">
<view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">
<view class="action">
<text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>
</view>
<view class="content" :style="[{top:StatusBar + 'px'}]">
</view>
</view>
</view>
</view>
<view class="header header-search acea-row row-center-wrapper" :style="{ background: bgcolor }">
<view @click="goGoodSearch()" class="search acea-row row-middle">
<text class="iconfont icon-xiazai5"></text>
搜索商品
@ -9,138 +22,38 @@
<image src="@/static/images/qr.png" />
</view>
</view>
<view class="fixed-header-box"></view>
<view class="slider-banner banner">
<swiper indicatorDots="true" v-if="banner.length > 0" autoplay circular>
<block v-for="(item, bannerIndex) in banner" :key="bannerIndex">
<swiper-item>
<view @click="goRoll(item)" class="swiper-item">
<image :src="item.pic" />
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class="nav acea-row">
<view @click="goWxappUrl(item)" class="item" v-for="(item, menusIndex) in menus" :key="menusIndex">
<view class="pictrue">
<image :src="item.pic" />
</view>
<view>{{ item.name }}</view>
</view>
</view>
<!-- <view class="news acea-row ">
<view class="pictrue" v-if="$VUE_APP_RESOURCES_URL">
<image src="@/static/images/news.png" />
</view>
<view class="swiper-no-swiping new-banner">
<swiper class="swiper-wrapper" v-if="roll.length > 0" :indicator-dots="false" autoplay circular vertical>
<block v-for="(item, rollIndex) in roll" :key="rollIndex">
<swiper-item class="swiper-slide">
<view @click="goRoll(item)" class="swiper-item acea-row row-between-wrapper">
<view class="text acea-row row-between-wrapper">
<view class="label" v-if="item.show === '是'">最新</view>
<view class="newsTitle line1">{{ item.info }}</view>
</view>
<view class="iconfont icon-xiangyou"></view>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view> -->
<!-- <view class="wrapper hot" v-if="likeInfo.length > 0"> -->
<uni-notice-bar scrollable="true" @click="goRoll(singNew)" single="true" :speed="10" showIcon="true" :text="singNew.info"></uni-notice-bar>
<view class="wrapper hot" v-if="bastList.length > 0">
<image class="bg" src="../../static/images/index-bg.png" mode="widthFix"></image>
<view class="title no-border acea-row row-between-wrapper">
<div class="text line1">
<span class="iconfont icon-remen"></span>
<span class="label">热门榜单</span>
</div>
<view @click="goHotNewGoods(2)" class="more">
更多
<text class="iconfont icon-jiantou"></text>
</view>
</view>
<view class="newProducts">
<scroll-view :show-scrollbar="false" scroll-y="false" scroll-x="true">
<view class="newProductsScroll">
<view @click="goGoodsCon(item)" class="newProductsItem" v-for="(item, likeInfoIndex) in likeInfo" :key="likeInfoIndex">
<view class="img-box">
<image :src="item.image" />
</view>
<view class="pro-info line1"><text>{{ item.storeName }}</text></view>