Browse Source

yshop3.1正式发布

master
xuwenbo 5 years ago
parent
commit
8a85f44ff6
  1. 93
      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. 16
      components/Loading.vue
  14. 155
      components/Menu.vue
  15. 214
      components/PromotionGood.vue
  16. 327
      components/ShopLiveCard.vue
  17. 129
      components/StorePoster.vue
  18. 24
      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. 66
      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. 13
      pages/Loading/index.vue
  31. 266
      pages/activity/DargainDetails/index.vue
  32. 101
      pages/activity/GoodsGroup/children/activity-card.vue
  33. 270
      pages/activity/GoodsGroup/index.vue
  34. 156
      pages/activity/GoodsSeckill/index.vue
  35. 329
      pages/activity/GroupDetails/index.vue
  36. 4
      pages/activity/GroupRule/index.vue
  37. 36
      pages/activity/Poster/index.vue
  38. 328
      pages/activity/SeckillDetails/index.vue
  39. 219
      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. 330
      pages/home/index.vue
  47. 13
      pages/order/OrderDetails/index.vue
  48. 181
      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. 319
      pages/shop/GoodsCon/index.vue
  53. 102
      pages/shop/GoodsFoot/index.vue
  54. 182
      pages/shop/Live/LiveList/index.vue
  55. 141
      pages/shop/ShoppingCart/index.vue
  56. 19
      pages/shop/StoreList/index.vue
  57. 109
      pages/user/Login/index.vue
  58. 9
      pages/user/PersonalData/index.vue
  59. 195
      pages/user/Recharge/index.vue
  60. 134
      pages/user/User/index.vue
  61. 8
      pages/user/UserAccount/index.vue
  62. 19
      pages/user/address/AddAddress/index.vue
  63. 65
      pages/user/promotion/Poster/index.vue
  64. 103
      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. 54
      uni.scss
  73. 143
      utils/index.js
  74. 8
      utils/request.js

93
App.vue

@ -1,24 +1,91 @@
<script> <script>
export default { import Vue from 'vue'
export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch') // 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");
}, },
onShow: function() { onHide: function () {
console.log('App Show') console.log("App Hide");
}, },
onHide: function() { 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
console.log('App Hide') // #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> </script>
<style lang="less"> <style lang="less">
/*每个页面公共css */ /*每个页面公共css */
@import "animate.css"; @import "animate.css";
@import "./assets/iconfont/iconfont.css"; @import "./assets/iconfont/iconfont.css";
@import "./assets/css/base.less"; @import "./assets/css/base.less";
@import "./assets/css/reset.less"; @import "./assets/css/reset.less";
@import "./assets/css/style.less"; @import "./assets/css/style.less";
</style> </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) { export function getProductPoster(id, data) {
return request.get("/product/poster/" + id, {}, { return request.get("/product/poster/" + id, data, {
login: true 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", { return request.get("/collect/user", {
page: page, 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 */ /*# sourceMappingURL=./base.css.map */

4
assets/css/base.less

@ -104,7 +104,7 @@
.start { .start {
width: 1.22*100rpx; width: 1.22*100rpx;
height: 0.3*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-repeat: no-repeat;
background-size: 1.22*100rpx auto; background-size: 1.22*100rpx auto;
} }
@ -147,7 +147,7 @@
.checkbox-wrapper input:checked + .icon { .checkbox-wrapper input:checked + .icon {
background-color: #e93323; background-color: #e93323;
border-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-size: 0.21*100rpx 0.15*100rpx;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; 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 */ /*# sourceMappingURL=./reset.css.map */

2
assets/css/reset.less

@ -1,7 +1,7 @@
input{line-height: normal; box-sizing:border-box;} input{line-height: normal; box-sizing:border-box;}
@font-face { @font-face {
font-family: 'GuildfordProBook 5'; 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] { [v-cloak] {
display: none; 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>

16
components/Loading.vue

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

214
components/PromotionGood.vue

@ -1,36 +1,214 @@
<template> <template>
<view class="promotionGood" v-if="benefit.length > 0"> <view>
<view class="item acea-row row-between-wrapper" v-for="(item, promotionGoodIndex) in benefit" :key="promotionGoodIndex" @click="routerGo(item)"> <view class="sh-title-card mb10">
<view class="pictrue"><image :src="item.image" class="image" /></view> <view class="title-box">
<view class="text"> <image class="title-bg" src="@/static/images/title1.png" mode="aspectFill"></image>
<view class="name line1">{{ item.storeName }}</view> <view class="title-text">为你推荐</view>
<view class="sp-money acea-row"> <!-- <view class="title-text" :style="{ color: detail.color }">为你推荐</view> -->
<view class="moneyCon">
促销价:
<text class="num">{{ item.price }}</text>
</view> </view>
</view> </view>
<view class="acea-row row-between-wrapper"> <view class="hot-goods mx20 mb10" v-if="benefit.length">
<view class="money">日常价{{ item.otPrice }}</view> <view class="goods-list x-f">
<view>仅剩{{ item.stock }}{{ item.unitName }}</view> <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>
<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>
<view class="sales miso-font">仅剩{{ item.stock }}{{ item.unitName }}</view>
</view> </view>
<view class="x-f tag-box">
<!-- <view class="discount">新人礼</view>
<view class="discount">满100减60</view> -->
</view> </view>
</view>
</view>
</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
export default { export default {
name: 'PromotionGood', name: 'PromotionGood',
props: ['benefit'], props: ['benefit'],
data: function() { data: function () {
return {}; return {};
}, },
methods: { methods: {
routerGo(item) { routerGo(item) {
this.$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } }); this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: item.id
} }
}, });
mounted() {
} }
}; },
mounted() {}
};
</script> </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;
}
}
.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>

129
components/StorePoster.vue

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

24
components/UserEvaluation.vue

@ -1,10 +1,7 @@
<template> <template>
<view class="evaluateWtapper"> <view class="evaluateWtapper" v-if="reply&&reply.length>0">
<view <view v-for="(item, evaluateWtapperIndex) in reply" :key="evaluateWtapperIndex">
class="evaluateItem" <view class="evaluateItem" v-if="item">
v-for="(item, evaluateWtapperIndex) in reply"
:key="evaluateWtapperIndex"
>
<view class="pic-text acea-row row-middle"> <view class="pic-text acea-row row-middle">
<view class="pictrue"> <view class="pictrue">
<image :src="item.avatar" class="image" /> <image :src="item.avatar" class="image" />
@ -27,11 +24,14 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
import { dataFormat } from "@/utils"; import {
dataFormat
} from "@/utils";
export default { export default {
name: "UserEvaluation", name: "UserEvaluation",
props: { props: {
reply: { reply: {
@ -39,12 +39,14 @@ export default {
default: () => [] default: () => []
} }
}, },
data: function() { data: function () {
return {}; return {};
}, },
mounted: function() {}, mounted: function () {
console.log(this)
},
methods: { methods: {
dataFormat dataFormat
} }
}; };
</script> </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://wxapi.yixiang.co/api'; export const VUE_APP_API_URL = 'http://127.0.0.1:8008/api';
// export const VUE_APP_API_URL = 'https://h5api.dayouqiantu.cn/api'; export const VUE_APP_RESOURCES_URL = 'https://wx.yixiang.co/static';
export const VUE_APP_RESOURCES_URL = 'https://h5.yixiang.co/static';

66
libs/order.js

@ -73,33 +73,50 @@ export function delOrderHandle(orderId) {
} }
// 使用订单号进行支付 // 使用订单号进行支付
export function payOrderHandle(orderId, type, from) { export async function payOrderHandle(orderId, type, from) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// dialog.loading.open(""); uni.showLoading({
title: "支付中",
mask: true
});
payOrder(orderId, type, from) payOrder(orderId, type, from)
.then(res => { .then(async res => {
handleOrderPayResults(res.data) await handleOrderPayResults(res.data, type)
resolve()
}) })
.catch(err => { .catch(err => {
dialog.loading.close(); reject()
dialog.toast({ mes: err.msg || "订单支付失败" }); uni.hideLoading()
uni.showToast({
title: err.msg || err.response.data.msg || err.response.data.message || '订单支付失败',
icon: "none",
duration: 2000,
});
}); });
}); });
} }
// 处理调用支付接口的逻辑 // 处理调用支付接口的逻辑
// @type create(创建订单)||pay(支付订单) // @type create(创建订单)||pay(支付订单)
export function handleOrderPayResults(data, type) { 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) { switch (data.status) {
// 订单号已存在 // 订单号已存在
case "ORDER_EXIST": case "ORDER_EXIST":
resolve()
break;
// 取消支付 // 取消支付
case "EXTEND_ORDER": case "EXTEND_ORDER":
uni.showToast({ uni.showToast({
title: res.msg, title: data.msg,
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
resolve()
goOrderDetails(data.result.orderId, type) goOrderDetails(data.result.orderId, type)
break; break;
case "PAY_DEFICIENCY": case "PAY_DEFICIENCY":
@ -107,19 +124,21 @@ export function handleOrderPayResults(data, type) {
// 支付出错 // 支付出错
case "PAY_ERROR": case "PAY_ERROR":
uni.showToast({ uni.showToast({
title: res.msg, title: data.msg,
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
reject()
goOrderDetails(data.result.orderId, type) goOrderDetails(data.result.orderId, type)
break; break;
// 未传递支付环境 // 未传递支付环境
case "SUCCESS": case "SUCCESS":
uni.showToast({ uni.showToast({
title: res.msg, title: data.msg || data.payMsg,
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
resolve()
goOrderDetails(data.result.orderId, type) goOrderDetails(data.result.orderId, type)
break; break;
// H5支付 // H5支付
@ -127,6 +146,7 @@ export function handleOrderPayResults(data, type) {
goOrderDetails(data.result.orderId, type) goOrderDetails(data.result.orderId, type)
console.log(data) console.log(data)
setTimeout(() => { setTimeout(() => {
resolve()
// #ifdef H5 // #ifdef H5
// "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx15171343713577e9f3a418b0865ef90000&package=2547890641" // "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx15171343713577e9f3a418b0865ef90000&package=2547890641"
// location.href = data.result.jsConfig.mweb_url; // location.href = data.result.jsConfig.mweb_url;
@ -136,17 +156,37 @@ export function handleOrderPayResults(data, type) {
// 小程序支付 // 小程序支付
case "WECHAT_PAY": case "WECHAT_PAY":
weappPay(data.result.jsConfig).finally(() => { weappPay(data.result.jsConfig).finally(() => {
resolve()
goOrderDetails(data.result.orderId, type) goOrderDetails(data.result.orderId, type)
}); }).then(res => {
// #ifdef MP-WEIXIN
subscribeMessage()
// #endif
})
break; break;
// APP支付 // APP支付
case "WECHAT_APP_PAY": case "WECHAT_APP_PAY":
weappPay(data.result.jsConfig).finally(() => { weappPay(data.result.jsConfig).finally(() => {
resolve()
goOrderDetails(data.result.orderId, type) goOrderDetails(data.result.orderId, type)
}); })
break; 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 { getProvider } from "@/utils";
import WechatJSSDK from "wechat-jssdk/dist/client.umd"; import WechatJSSDK from "wechat-jssdk/dist/client.umd";
import { getWechatConfig, wechatAuth } from "@/api/public"; import { getWechatConfig, wechatAuth } from "@/api/public";
@ -9,7 +10,6 @@ import dayjs from "dayjs";
// 支付模块 // 支付模块
export const weappPay = (option) => { export const weappPay = (option) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(option)
if (store.state.$deviceType == 'weixinh5') { if (store.state.$deviceType == 'weixinh5') {
setTimeout(() => { setTimeout(() => {
location.href = option.mweb_url; location.href = option.mweb_url;
@ -59,11 +59,16 @@ export const weappPay = (option) => {
clearTimeout(time) clearTimeout(time)
resolve(success) resolve(success)
}, 3000) }, 3000)
// #ifdef MP-WEIXIN
subscribeMessage()
// #endif
}, },
fail: (error) => { fail: (error) => {
console.log(error) console.log(error)
if (error.errMsg == 'requestPayment:fail cancel') { if (error.errMsg == 'requestPayment:fail cancel') {
uni.showToast({ title: '已取消支付', icon: 'none', duration: 5000 }); uni.showToast({ title: '已取消支付', icon: 'none', duration: 5000 });
} else {
uni.showToast({ title: error || error.msg, icon: 'none', duration: 5000 });
} }
reject(error) reject(error)
} }
@ -119,6 +124,7 @@ export function clearAuthStatus() {
export function oAuth() { export function oAuth() {
console.log('处理微信授权') console.log('处理微信授权')
console.log('处理微信授权cookie',cookie.get("spread"))
console.log(store) console.log(store)
console.log(store.state) console.log(store.state)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -142,8 +148,7 @@ export function auth(code) {
console.log('获取微信授权') console.log('获取微信授权')
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let loginType = cookie.get(LOGINTYPE); let loginType = cookie.get(LOGINTYPE);
debugger wechatAuth(code, cookie.get("spread"), loginType)
wechatAuth(code, parseInt(cookie.get("spread")), loginType)
.then(({ data }) => { .then(({ data }) => {
console.log(data) console.log(data)
const expires_time = dayjs(data.expires_time); const expires_time = dayjs(data.expires_time);
@ -152,12 +157,10 @@ export function auth(code) {
cookie.set(WX_AUTH, code, expires_time); cookie.set(WX_AUTH, code, expires_time);
cookie.remove(STATE_KEY); cookie.remove(STATE_KEY);
loginType && cookie.remove(LOGINTYPE); loginType && cookie.remove(LOGINTYPE);
debugger
resolve(); resolve();
}) })
.catch(reject); .catch(reject);
}).catch(error => { }).catch(error => {
debugger
console.log(error) console.log(error)
}) })
} }
@ -347,12 +350,20 @@ export function wxShowLocation() {
cancel() { cancel() {
cookie.remove(LATITUDE); cookie.remove(LATITUDE);
cookie.remove(LONGITUDE); cookie.remove(LONGITUDE);
this.$dialog.error("取消获取位置"); uni.showToast({
title: "取消获取位置",
icon: "none",
duration: 2000,
});
}, },
fail() { fail() {
cookie.remove(LATITUDE); cookie.remove(LATITUDE);
cookie.remove(LONGITUDE); cookie.remove(LONGITUDE);
this.$dialog.error("授权失败"); uni.showToast({
title: "授权失败",
icon: "none",
duration: 2000,
});
} }
}); });
} }

2
main.js

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

11
manifest.json

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

34
package-lock.json generated

@ -17,6 +17,21 @@
"defer-to-connect": "^1.0.1" "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": { "animate.css": {
"version": "3.7.2", "version": "3.7.2",
"resolved": "https://registry.npm.taobao.org/animate.css/download/animate.css-3.7.2.tgz", "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", "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=" "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": { "mongodb": {
"version": "3.4.1", "version": "3.4.1",
"resolved": "https://registry.npm.taobao.org/mongodb/download/mongodb-3.4.1.tgz", "resolved": "https://registry.npm.taobao.org/mongodb/download/mongodb-3.4.1.tgz",
@ -296,6 +319,11 @@
"once": "^1.3.1" "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": { "regexp-clone": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/regexp-clone/download/regexp-clone-1.0.0.tgz", "resolved": "https://registry.npm.taobao.org/regexp-clone/download/regexp-clone-1.0.0.tgz",
@ -379,6 +407,12 @@
"prepend-http": "^2.0.0" "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": { "vue-ydui": {
"version": "1.2.6", "version": "1.2.6",
"resolved": "https://registry.npm.taobao.org/vue-ydui/download/vue-ydui-1.2.6.tgz", "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", "async-validator": "^3.2.4",
"dayjs": "^1.8.22", "dayjs": "^1.8.22",
"jweixin-module": "^1.6.0", "jweixin-module": "^1.6.0",
"miniapp-color-thief": "^1.0.5",
"vue-ydui": "^1.2.6", "vue-ydui": "^1.2.6",
"wechat-jssdk": "^5.0.4" "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", "path": "pages/home/index",
"style": { "style": {
"navigationBarTitleText": "yshop商城" "navigationBarTitleText": "yshop商城",
"navigationBarTextStyle": "white",
// "enablePullDownRefresh": true,
"navigationStyle": "custom"
} }
}, },
{ {
@ -90,6 +93,12 @@
"navigationBarTitleText": "商品收藏" "navigationBarTitleText": "商品收藏"
} }
}, },
{
"path": "pages/shop/GoodsFoot/index",
"style": {
"navigationBarTitleText": "我的足迹"
}
},
{ {
"path": "pages/shop/news/NewsDetail/index", "path": "pages/shop/news/NewsDetail/index",
"style": { "style": {
@ -401,13 +410,20 @@
"style": { "style": {
"navigationBarTitleText": "地图" "navigationBarTitleText": "地图"
} }
},
{
"path": "pages/shop/Live/LiveList/index",
"style": {
"navigationBarTitleText": "直播列表"
}
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "Yshop",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8",
"navigationStyle": "default"
}, },
"tabBar": { "tabBar": {
"color": "#282828", "color": "#282828",
@ -415,9 +431,9 @@
"borderStyle": "black", "borderStyle": "black",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"height": "50px", "height": "50px",
"fontSize": "10px", "fontSize": "8px",
"iconWidth": "24px", "iconWidth": "16px",
"spacing": "3px", "spacing": "-3px",
"list": [{ "list": [{
"pagePath": "pages/home/index", "pagePath": "pages/home/index",
"iconPath": "static/icon-home.png", "iconPath": "static/icon-home.png",

13
pages/Loading/index.vue

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

266
pages/activity/DargainDetails/index.vue

@ -1,8 +1,8 @@
<template> <template>
<view class="bargain"> <view class="bargain on">
<!-- 在header上加 on 为请求支援 --> <!-- 在header上加 on 为请求支援 -->
<view :class="[bargainPartake != userInfo.uid ? 'header on' : 'header']"> <view :class="[bargainPartake != userInfo.uid ? 'header bargain-box on' : 'header bargain-box']">
<view class="people">{{ lookCount }}人查看 {{ shareCount }}人分享 {{ userCount }}人参与</view> <!-- <view class="people">{{ lookCount }}人查看 {{ shareCount }}人分享 {{ userCount }}人参与</view> -->
<!-- 帮助砍价帮砍成功--> <!-- 帮助砍价帮砍成功-->
<view class="pictxt acea-row row-center-wrapper" v-if="bargainPartake != userInfo.uid"> <view class="pictxt acea-row row-center-wrapper" v-if="bargainPartake != userInfo.uid">
<view class="pictrue"> <view class="pictrue">
@ -13,17 +13,10 @@
<text>邀请您帮忙砍价</text> <text>邀请您帮忙砍价</text>
</view> </view>
</view> </view>
<count-down <count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '"
:isDay="true" :secondText="' 秒'" :datatime="datatime"></count-down>
:tipText="'倒计时 '"
:dayText="' 天 '"
:hourText="' 时 '"
:minuteText="' 分 '"
:secondText="' 秒'"
:datatime="datatime"
></count-down>
</view> </view>
<view class="wrapper"> <view class="wrapper bargain-box">
<view class="pictxt acea-row row-between-wrapper" @click="openAlone"> <view class="pictxt acea-row row-between-wrapper" @click="openAlone">
<view class="pictrue"> <view class="pictrue">
<image :src="bargain.image" /> <image :src="bargain.image" />
@ -45,10 +38,7 @@
</view> </view>
</view> </view>
<view class="cu-progress acea-row row-middle round margin-top"> <view class="cu-progress acea-row row-middle round margin-top">
<view <view class="acea-row row-middle bg-red" :style="{ width: loading ? pricePercent + '%' : '' }"></view>
class="acea-row row-middle bg-red"
:style="{ width: loading ? pricePercent + '%' : '' }"
></view>
</view> </view>
<view class="balance acea-row row-between-wrapper"> <view class="balance acea-row row-between-wrapper">
<view v-text="'已砍' + alreadyPrice + '元'"></view> <view v-text="'已砍' + alreadyPrice + '元'"></view>
@ -56,63 +46,40 @@
<view v-else v-text="'还剩' + surplusPrice + '元'"></view> <view v-else v-text="'还剩' + surplusPrice + '元'"></view>
</view> </view>
<!-- 帮助砍价帮砍成功--> <!-- 帮助砍价帮砍成功-->
<view <view class="bargainSuccess" v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading">
class="bargainSuccess"
v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading"
>
<span class="iconfont icon-xiaolian"></span>已成功帮助好友砍价 <span class="iconfont icon-xiaolian"></span>已成功帮助好友砍价
</view> </view>
<!-- 砍价成功--> <!-- 砍价成功-->
<view <view class="bargainSuccess" v-if="
class="bargainSuccess"
v-if="
surplusPrice === 0 && surplusPrice === 0 &&
bargainPartake === userInfo.uid && bargainPartake === userInfo.uid &&
userBargainStatus === 1 && userBargainStatus === 1 &&
!helpListLoading !helpListLoading
" ">
>
<span class="iconfont icon-xiaolian"></span>恭喜您砍价成功快去支付吧~ <span class="iconfont icon-xiaolian"></span>恭喜您砍价成功快去支付吧~
</view> </view>
<view
v-if="userBargainStatus == 0 && bargainPartake === userInfo.uid" <view v-if="userBargainStatus == 0 && bargainPartake === userInfo.uid" class="bargainBnt" @click="goParticipate">
class="bargainBnt" 立即参与砍价</view>
@click="goParticipate" <view class="bargainBnt" @click="goPoster" v-if="
>立即参与砍价</view>
<view
class="bargainBnt"
@click="goPoster"
v-if="
surplusPrice > 0 && surplusPrice > 0 &&
bargainPartake === userInfo.uid && bargainPartake === userInfo.uid &&
userBargainStatus === 1 && userBargainStatus === 1 &&
!helpListLoading !helpListLoading
" ">邀请好友帮砍价</view>
>邀请好友帮砍价</view> <view class="bargainBnt" @click="getBargainHelp" v-else-if="
<view
class="bargainBnt"
@click="getBargainHelp"
v-else-if="
bargainPartake != userInfo.uid && bargainPartake != userInfo.uid &&
userBargainStatus == 1 && userBargainStatus == 1 &&
statusUser && statusUser &&
!helpListLoading !helpListLoading
" ">帮好友砍一刀</view>
>帮好友砍一刀</view> <view class="bargainBnt" @click="getBargainStart"
<view v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading">我也要参与</view>
class="bargainBnt" <view class="bargainBnt" @click="goPay" v-if="
@click="getBargainStart"
v-if="bargainPartake != userInfo.uid && !statusUser && !helpListLoading"
>我也要参与</view>
<view
class="bargainBnt"
@click="goPay"
v-if="
surplusPrice === 0 && surplusPrice === 0 &&
bargainPartake === userInfo.uid && bargainPartake === userInfo.uid &&
userBargainStatus === 1 userBargainStatus === 1
" ">立即支付</view>
>立即支付</view>
<view class="bargainBnt on" @click="goList">抢更多商品</view> <view class="bargainBnt on" @click="goList">抢更多商品</view>
<view class="tip"> <view class="tip">
已有 已有
@ -121,7 +88,7 @@
</view> </view>
<view class="lock"></view> <view class="lock"></view>
</view> </view>
<view class="bargainGang"> <view class="bargainGang bargain-box">
<view class="title font-color-red acea-row row-center-wrapper"> <view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/left.png" /> <image src="@/static/images/left.png" />
@ -132,11 +99,8 @@
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view <view class="item acea-row row-between-wrapper" v-for="(item, bargainHelpListIndex) in bargainHelpList"
class="item acea-row row-between-wrapper" :key="bargainHelpListIndex">
v-for="(item, bargainHelpListIndex) in bargainHelpList"
:key="bargainHelpListIndex"
>
<view class="pictxt acea-row row-between-wrapper"> <view class="pictxt acea-row row-between-wrapper">
<view class="pictrue"> <view class="pictrue">
<image :src="item.avatar" /> <image :src="item.avatar" />
@ -152,14 +116,11 @@
</view> </view>
</view> </view>
</view> </view>
<view <view class="load font-color-red" v-if="!helpListStatus && !helpListLoading" @click="getBargainHelpList">点击加载更多
class="load font-color-red" </view>
v-if="!helpListStatus && !helpListLoading"
@click="getBargainHelpList"
>点击加载更多</view>
<view class="lock"></view> <view class="lock"></view>
</view> </view>
<view class="goodsDetails"> <view class="goodsDetails bargain-box">
<view class="title font-color-red acea-row row-center-wrapper"> <view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/left.png" /> <image src="@/static/images/left.png" />
@ -172,7 +133,7 @@
<view class="conter" v-html="bargain.description"></view> <view class="conter" v-html="bargain.description"></view>
<view class="lock"></view> <view class="lock"></view>
</view> </view>
<view class="goodsDetails"> <view class="goodsDetails bargain-box">
<view class="title font-color-red acea-row row-center-wrapper"> <view class="title font-color-red acea-row row-center-wrapper">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/left.png" /> <image src="@/static/images/left.png" />
@ -203,8 +164,8 @@
</view> </view>
</template> </template>
<script> <script>
import CountDown from "@/components/CountDown"; import CountDown from "@/components/CountDown";
import { import {
getBargainDetail, getBargainDetail,
getBargainShare, getBargainShare,
getBargainStart, getBargainStart,
@ -213,21 +174,29 @@ import {
getBargainHelpList, getBargainHelpList,
getBargainHelpCount, getBargainHelpCount,
getBargainStartUser getBargainStartUser
} from "@/api/activity"; } from "@/api/activity";
import { postCartAdd } from "@/api/store"; import {
import { mapGetters } from "vuex"; postCartAdd
import {} from "@/libs/wechat"; } from "@/api/store";
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index"; import {
mapGetters
} from "vuex";
import {} from "@/libs/wechat";
import {
isWeixin,
parseQuery,
handleQrCode
} from "@/utils/index";
const NAME = "DargainDetails"; const NAME = "DargainDetails";
export default { export default {
name: "DargainDetails", name: "DargainDetails",
components: { components: {
CountDown CountDown
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
price: 0, price: 0,
bargainId: 0, // bargainId: 0, //
@ -236,6 +205,7 @@ export default {
partake: null, partake: null,
bargainSumCount: 0, // bargainSumCount: 0, //
activeMsg: "", activeMsg: "",
// ssssss
active: false, active: false,
loading: false, loading: false,
datatime: 0, datatime: 0,
@ -266,24 +236,45 @@ export default {
// } // }
// } // }
// }, // },
mounted: function() { mounted: function () {
var that = this; var that = this;
that.mountedStart(); that.mountedStart();
setTimeout(function() { setTimeout(function () {
that.loading = true; that.loading = true;
}, 500); }, 500);
}, },
methods: { methods: {
onShareAppMessage: function () {
return {
title: this.storeInfo.title,
imageUrl: this.storeInfo.image,
path: "pages/activity/DargainDetails/index?id=" + this.storeInfo.id + "&spread=" + uni.getStorageSync(
"uid"),
success(res) {
uni.showToast({
title: '分享成功'
})
},
fail(res) {
uni.showToast({
title: '分享失败',
icon: 'none'
})
}
}
},
// //
goParticipate() { goParticipate() {
if (this.bargainPartake === this.userInfo.uid) this.getBargainStart(); if (this.bargainPartake === this.userInfo.uid) this.getBargainStart();
else this.getBargainStartUser(); else this.getBargainStartUser();
this.getBargainHelpCount(); this.getBargainHelpCount();
}, },
openAlone: function() { openAlone: function () {
this.$yrouter.push({ path: "/detail/" + this.bargain.productId }); this.$yrouter.push({
path: "/detail/" + this.bargain.productId
});
}, },
mountedStart: function() { mountedStart: function () {
var that = this; var that = this;
let url = handleQrCode(); let url = handleQrCode();
if (url) { if (url) {
@ -316,7 +307,7 @@ export default {
that.getBargainStartUser(); that.getBargainStartUser();
} }
}, },
goPay: function() { goPay: function () {
var data = {}; var data = {};
var that = this; var that = this;
data.productId = that.bargain.productId; data.productId = that.bargain.productId;
@ -328,27 +319,31 @@ export default {
.then(res => { .then(res => {
that.$yrouter.push({ that.$yrouter.push({
path: "/pages/order/OrderSubmission/index", path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId } query: {
id: res.data.cartId
}
}); });
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title: title: err.msg || err.response.data.msg || err.response.data.message,
err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
}); });
}, },
goPoster: function() { goPoster: function () {
var that = this; var that = this;
that.getBargainShare(that.bargainId); that.getBargainShare(that.bargainId);
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/activity/Poster/index", path: "/pages/activity/Poster/index",
query: { id: that.bargainId, type: 2 } query: {
id: that.bargainId,
type: 2
}
}); });
}, },
goList: function() { goList: function () {
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/activity/GoodsBargain/index" path: "/pages/activity/GoodsBargain/index"
}); });
@ -356,24 +351,30 @@ export default {
// //
//bargainId 0 //bargainId 0
//bargainId //bargainId
getBargainShare: function(bargainId) { getBargainShare: function (bargainId) {
var that = this; var that = this;
getBargainShare({ bargainId: bargainId }).then(res => { getBargainShare({
bargainId: bargainId
}).then(res => {
that.lookCount = res.data.lookCount; that.lookCount = res.data.lookCount;
that.shareCount = res.data.shareCount; that.shareCount = res.data.shareCount;
that.userCount = res.data.userCount; that.userCount = res.data.userCount;
}); });
}, },
// //
getBargainDetail: function() { getBargainDetail: function () {
var that = this; var that = this;
getBargainDetail(that.bargainId) getBargainDetail(that.bargainId)
.then(res => { .then(res => {
res.data.bargain.description = res.data.bargain.description.replace( that.bargain = res.data.bargain;
that.bargain.description = that.bargain.description.replace(
/\<img/gi,
'<img style="max-width:100%;height:auto;"'
);
that.bargain.rule = that.bargain.rule.replace(
/\<img/gi, /\<img/gi,
'<img style="max-width:100%;height:auto;"' '<img style="max-width:100%;height:auto;"'
); );
that.bargain = res.data.bargain;
that.datatime = that.bargain.stopTime / 1000; that.datatime = that.bargain.stopTime / 1000;
that.getBargainHelpCount(); that.getBargainHelpCount();
}) })
@ -386,9 +387,11 @@ export default {
}); });
}, },
// //
getBargainStart: function() { getBargainStart: function () {
var that = this; var that = this;
getBargainStart({ bargainId: that.bargainId }) getBargainStart({
bargainId: that.bargainId
})
.then(() => { .then(() => {
that.bargainPartake = that.userInfo.uid; that.bargainPartake = that.userInfo.uid;
that.getBargainHelp(); that.getBargainHelp();
@ -402,7 +405,7 @@ export default {
}); });
}, },
// //
getBargainHelp: function() { getBargainHelp: function () {
var that = this; var that = this;
if ( if (
that.surplusPrice === 0 && that.surplusPrice === 0 &&
@ -446,7 +449,7 @@ export default {
}); });
}, },
// //
getBargainHelpPrice: function() { getBargainHelpPrice: function () {
var that = this; var that = this;
getBargainHelpPrice({ getBargainHelpPrice({
bargainId: that.bargainId, bargainId: that.bargainId,
@ -473,7 +476,7 @@ export default {
}); });
}, },
// //
getBargainHelpList: function() { getBargainHelpList: function () {
var that = this; var that = this;
if (that.helpListLoading === true) return; if (that.helpListLoading === true) return;
if (that.helpListStatus === true) return; if (that.helpListStatus === true) return;
@ -498,7 +501,7 @@ export default {
}); });
}); });
}, },
getBargainHelpCountStart: function() { getBargainHelpCountStart: function () {
var that = this; var that = this;
getBargainHelpCount({ getBargainHelpCount({
bargainId: that.bargainId, bargainId: that.bargainId,
@ -510,7 +513,10 @@ export default {
.catch(() => { .catch(() => {
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/activity/DargainDetails/index", path: "/pages/activity/DargainDetails/index",
query: { id: that.bargainId, partake: that.userInfo.uid } query: {
id: that.bargainId,
partake: that.userInfo.uid
}
}); });
// that.$router.push({ // that.$router.push({
// path: // path:
@ -521,7 +527,7 @@ export default {
// }); // });
}); });
}, },
getBargainHelpCount: function() { getBargainHelpCount: function () {
var that = this; var that = this;
getBargainHelpCount({ getBargainHelpCount({
bargainId: that.bargainId, bargainId: that.bargainId,
@ -544,7 +550,7 @@ export default {
// }); // });
}); });
}, },
getBargainStartUser: function() { getBargainStartUser: function () {
var that = this; var that = this;
getBargainStartUser({ getBargainStartUser({
bargainId: that.bargainId, bargainId: that.bargainId,
@ -562,7 +568,7 @@ export default {
}); });
}); });
}, },
close: function() { close: function () {
this.active = false; this.active = false;
} }
}, },
@ -571,14 +577,44 @@ export default {
path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}` path: `/pages/activity/DargainDetails/index/?id=${this.$yroute.query.id}&partake=${this.userInfo.uid}`
}; };
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
page { .bargain {
background-color: #eb3729; &.on {
} .bargain-box {
.bargainBnt_hui { background: #fff;
width: auto;
margin: 0 20rpx;
border: 0;
}
.header {
height: auto;
text-align: left;
.time {
text-align: left;
font-size: 24rpx;
margin: 0;
padding: 0;
padding: 20rpx;
width: auto;
height: auto;
}
}
}
}
page {
background-color: #f5f5f5 !important;
}
.bargainBnt_hui {
font-size: 0.3 * 100rpx; font-size: 0.3 * 100rpx;
font-weight: bold; font-weight: bold;
color: #fff; color: #fff;
@ -589,8 +625,9 @@ page {
text-align: center; text-align: center;
line-height: 0.8 * 100rpx; line-height: 0.8 * 100rpx;
margin-top: 0.32 * 100rpx; margin-top: 0.32 * 100rpx;
} }
.bargain_view {
.bargain_view {
left: 0; left: 0;
right: 0; right: 0;
height: 0.48 * 100rpx; height: 0.48 * 100rpx;
@ -603,8 +640,9 @@ page {
color: #fff; color: #fff;
text-align: center; text-align: center;
line-height: 0.48 * 100rpx; line-height: 0.48 * 100rpx;
} }
.iconfonts {
.iconfonts {
font-size: 0.22 * 100rpx; font-size: 0.22 * 100rpx;
} }
</style> </style>

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>

270
pages/activity/GoodsGroup/index.vue

@ -1,90 +1,232 @@
<template> <template>
<view class="group-list" ref="container"> <view class="page_box">
<view class="list" v-if="combinationList.length>0"> <view class="content_box">
<view <scroll-view class="scroll-box" scroll-y enable-back-to-top scroll-with-animation @scrolltolower="loadMore">
class="item acea-row row-between-wrapper" <view class="group-wrap">
v-for="(item, combinationListIndex) in combinationList" <view class="group-head x-bc">
:key="combinationListIndex" <text class="group-head__title">爆款拼团</text>
@click="link(item.id)" <text class="group-head__notice">省钱省心限时拼</text>
>
<view class="pictrue">
<image :src="item.image" />
</view> </view>
<view class="text"> <view class="group-box">
<view class="line1" v-text="item.title"></view> <view class="goods-item" v-for="(groupon, index) in grouponList" :key="groupon.id">
<view class="acea-row"> <activity-card :cId="groupon.id" :title="groupon.title" :info="groupon.info" :img="groupon.image"
<view class="team acea-row row-middle cart-color"> :price="groupon.price" :productPrice="groupon.productPrice">
<view class="iconfont icon-pintuan"></view> <block slot="tag">
<view class="num" v-text="item.people + '人团'"></view> <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> </view>
<text class="group-num">{{ groupon.people || 0 }}人团</text>
</view> </view>
<view class="bottom acea-row row-between-wrapper"> </block>
<view class="money"> <block slot="btn"><button class="cu-btn buy-btn"
@tap.stop="jump('/pages/activity/GroupDetails/index', { id: groupon.id })">马上拼</button></block>
<text class="num" v-text="item.price"></text> </activity-card>
<text class="y-money" v-text="'¥' + item.productPrice"></text>
</view> </view>
<view class="groupBnt bg-color-red">
去拼团
<text class="iconfont icon-jiantou"></text>
</view> </view>
</view> </view>
</scroll-view>
</view> </view>
</view> <Loading :loaded="loaded" :loading="loading"></Loading>
<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>
</view>
</view> </view>
</template> </template>
<script> <script>
import { getCombinationList } from "@/api/activity"; import activityCard from './children/activity-card.vue';
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
export default { import {
name: "GoodsGroup", getCombinationList
} from "@/api/activity";
export default {
components: { components: {
activityCard,
Loading Loading
}, },
props: {}, data() {
data: function() {
return { return {
combinationList: [], emptyData: {
status: false, // false true img: '/static/imgs/empty/empty_goods.png',
loading: false, // false true tip: '还没有拼团商品噢,去首页看看吧~',
page: 1, // path: '/pages/index/index',
limit: 20, // pathText: '去首页逛逛'
loadingList: false
};
}, },
mounted: function() { loaded: false,
// document.querySelector('body').setAttribute('style', 'background-color:#eb3729'); loading: false,
this.getCombinationList(); lastPage: 0,
currentPage: 1,
limit: 10,
grouponList: []
};
}, },
onReachBottom() { onLoad() {
!this.loadingList && this.getCombinationList(); this.getGrouponList();
}, },
onPullDownRefresh() {},
computed: {},
methods: { methods: {
getCombinationList: function() { //
var that = this; jump(path, parmas) {
if (that.loading) return; this.$yrouter.push({
if (that.status) return; path: path,
getCombinationList({ page: that.page, limit: that.limit }).then(res => { query: parmas
that.status = res.data.length < that.limit;
that.combinationList.push.apply(that.combinationList, res.data);
that.page++;
that.loading = false;
}); });
}, },
link: function(id) { //
this.$yrouter.push({ loadMore() {
path: "/pages/activity/GroupDetails/index",
query: { id } },
//
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> </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>

156
pages/activity/GoodsSeckill/index.vue

@ -5,6 +5,9 @@
</view> </view>
<scroll-view scroll-y="false" scroll-x="true"> <scroll-view scroll-y="false" scroll-x="true">
<view class="timeScroll"> <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-for="(item, index) in timeList" :key="index">
<view v-if="active==index" class="timeItem active" @click="setTime(index)"> <view v-if="active==index" class="timeItem active" @click="setTime(index)">
<view class="time">{{ item.time }}</view> <view class="time">{{ item.time }}</view>
@ -19,26 +22,15 @@
</scroll-view> </scroll-view>
<view v-for="(item, index) in timeList" :key="index"> <view v-for="(item, index) in timeList" :key="index">
<view v-if="active == 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> <view v-if="item.status === 0" class="activity">活动已结束</view>
<count-down <count-down :isDay="false" :tipText="'距结束仅剩 '" :dayText="false" :hourText="' : '" :minuteText="' : '"
:isDay="false" :secondText="false" :datatime="datatime" v-if="item.status === 1"></count-down>
: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 v-if="item.status === 2" class="activity">活动即将开始</view>
</view> </view> -->
<view class="list"> <view class="list">
<view <view class="item acea-row row-between-wrapper" v-for="(itemSeckill, indexSeckill) in seckillList"
class="item acea-row row-between-wrapper" :key="indexSeckill">
v-for="(itemSeckill, indexSeckill) in seckillList"
:key="indexSeckill"
>
<view class="pictrue"> <view class="pictrue">
<image :src="itemSeckill.image" /> <image :src="itemSeckill.image" />
</view> </view>
@ -46,28 +38,22 @@
<view class="line1" v-text="itemSeckill.title"></view> <view class="line1" v-text="itemSeckill.title"></view>
<view class="money"> <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>
<view class="progress cart-color"> <view class="progress cart-color">
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view> <view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view>
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view> <view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
</view> </view>
</view> </view>
<view <view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0"
class="grab bg-color-red" @click="goDetail(itemSeckill.id,item.status)">马上抢</view>
v-if="item.status === 1 && itemSeckill.stock > 0"
@click="goDetail(itemSeckill.id)"
>马上抢</view>
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</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 class="grab bg-color-red" v-if="item.status === 0">已结束</view>
</view> </view>
</view> </view>
<view <view class="noCommodity" style="background-color: #f5f5f5;" v-if="seckillList.length === 0 && page > 1">
class="noCommodity"
style="background-color: #fff;"
v-if="seckillList.length === 0 && page > 1"
>
<view class="noPictrue"> <view class="noPictrue">
<image src="@/static/images/noGood.png" class="image" /> <image src="@/static/images/noGood.png" class="image" />
</view> </view>
@ -77,18 +63,21 @@
</view> </view>
</template> </template>
<script> <script>
import { getSeckillConfig, getSeckillList } from "@/api/activity"; import {
import CountDown from "@/components/CountDown"; getSeckillConfig,
// import { Tab, Tabs } from "vant-weapp"; getSeckillList
import Loading from "@/components/Loading"; } from "@/api/activity";
import CountDown from "@/components/CountDown";
// import { Tab, Tabs } from "vant-weapp";
import Loading from "@/components/Loading";
export default { export default {
name: "GoodsSeckill", name: "GoodsSeckill",
components: { components: {
CountDown CountDown
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
headerImg: "", headerImg: "",
timeList: [], timeList: [],
@ -104,18 +93,18 @@ export default {
title: [] title: []
}; };
}, },
mounted: function() { mounted: function () {
this.mountedStart(); this.mountedStart();
}, },
onReachBottom() { onReachBottom() {
!this.loadingList && this.getSeckillList(); !this.loadingList && this.getSeckillList();
}, },
methods: { methods: {
changeTime: function(index) { changeTime: function (index) {
this.active = index; this.active = index;
this.getSeckillList(); this.getSeckillList();
}, },
mountedStart: function() { mountedStart: function () {
var that = this; var that = this;
uni.showLoading(); uni.showLoading();
getSeckillConfig().then(res => { getSeckillConfig().then(res => {
@ -130,30 +119,25 @@ export default {
attrs: { attrs: {
class: "timeItem" class: "timeItem"
}, },
children: [ children: [{
{
name: "div", name: "div",
attrs: { attrs: {
class: "time" class: "time"
}, },
children: [ children: [{
{
type: "text", type: "text",
text: item.time text: item.time
} }]
]
}, },
{ {
name: "div", name: "div",
attrs: { attrs: {
class: "state" class: "state"
}, },
children: [ children: [{
{
type: "text", type: "text",
text: item.state text: item.state
} }]
]
} }
] ]
}; };
@ -161,13 +145,13 @@ export default {
that.$set(that, "title", title); that.$set(that, "title", title);
that.datatime = that.timeList[that.active].stop; that.datatime = that.timeList[that.active].stop;
that.getSeckillList(); that.getSeckillList();
that.$nextTick(function() { that.$nextTick(function () {
that.sticky = true; that.sticky = true;
uni.hideLoading(); uni.hideLoading();
}); });
}); });
}, },
setTime: function(index) { setTime: function (index) {
var that = this; var that = this;
that.page = 1; that.page = 1;
that.loadingList = false; that.loadingList = false;
@ -177,7 +161,7 @@ export default {
this.seckillList = []; this.seckillList = [];
that.getSeckillList(); that.getSeckillList();
}, },
getSeckillList: function() { getSeckillList: function () {
var that = this; var that = this;
if (that.loadingList) return; if (that.loadingList) return;
if (that.status) return; if (that.status) return;
@ -192,33 +176,65 @@ export default {
uni.hideLoading(); uni.hideLoading();
}); });
}, },
goDetail: function(id) { goDetail: function (id, status) {
var that = this; var that = this;
var time = that.timeList[that.active].stop; var time = that.timeList[that.active].stop;
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/activity/SeckillDetails/index", path: "/pages/activity/SeckillDetails/index",
query: { query: {
id, id,
time time,
status
} }
}); });
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.timeScroll { .flash-sale {
background: #f5f5f5 !important;
height: 100%;
}
.timeScroll {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
} }
.list {
padding: 0 20rpx;
.timeItem { .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;
image {
width: 75rpx;
height: 70rpx;
}
}
.timeItem {
font-size: 0.22 * 100rpx; font-size: 0.22 * 100rpx;
color: #282828; color: #282828;
width: 150rpx; width: 150rpx;
text-align: center; text-align: center;
padding: 0.11 * 100rpx 0; padding: 20rpx 0;
background-color: none; background-color: none;
&.active { &.active {
@ -227,7 +243,7 @@ export default {
} }
.state { .state {
background-color: #eb3729; background: linear-gradient(90deg, #00c17b, #00c17b);
color: #fff; color: #fff;
opacity: 1; opacity: 1;
border-radius: 30rpx; border-radius: 30rpx;
@ -237,25 +253,25 @@ export default {
line-height: 0.37 * 100rpx; line-height: 0.37 * 100rpx;
} }
} }
} }
.timeItem .time { .timeItem .time {
font-size: 0.32 * 100rpx; font-size: 0.32 * 100rpx;
font-weight: bold; font-weight: bold;
height: 0.37 * 100rpx; height: .5 * 100rpx;
line-height: 0.37 * 100rpx; line-height: .5 * 100rpx;
} }
.timeItem .state { .timeItem .state {
height: 0.37 * 100rpx; height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx; line-height: 0.37 * 100rpx;
} }
.activity { .activity {
color: #333; color: #333;
} }
.flash-sale .list .item .grab { .flash-sale .list .item .grab {
background-color: #999; background-color: #999;
} }
</style> </style>

329
pages/activity/GroupDetails/index.vue

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

4
pages/activity/GroupRule/index.vue

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

36
pages/activity/Poster/index.vue

@ -9,20 +9,23 @@
</view> </view>
</template> </template>
<script> <script>
import { getBargainPoster, getCombinationPoster } from "@/api/activity"; import {
getBargainPoster,
getCombinationPoster
} from "@/api/activity";
export default { export default {
name: "Poster", name: "Poster",
components: {}, components: {},
props: {}, props: {},
data: function() { data: function () {
return { return {
status: true, status: true,
id: 0, id: 0,
image: "" image: ""
}; };
}, },
mounted: function() { mounted: function () {
var that = this; var that = this;
var id = that.$yroute.query.id; var id = that.$yroute.query.id;
var type = that.$yroute.query.type; var type = that.$yroute.query.type;
@ -34,9 +37,12 @@ export default {
} }
}, },
methods: { methods: {
getBargainPoster: function() { getBargainPoster: function () {
var that = this; var that = this;
getBargainPoster({ bargainId: that.id, from: "wechat" }) getBargainPoster({
bargainId: that.id,
from: "wechat"
})
.then(res => { .then(res => {
that.image = res.data.url; that.image = res.data.url;
that.status = false; that.status = false;
@ -50,9 +56,12 @@ export default {
}); });
}, },
// //
getCombinationPoster: function() { getCombinationPoster: function () {
var that = this; var that = this;
getCombinationPoster({ id: that.id, from: "wechat" }) getCombinationPoster({
id: that.id,
from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType
})
.then(res => { .then(res => {
that.image = res.data.url; that.image = res.data.url;
that.status = false; that.status = false;
@ -66,14 +75,15 @@ export default {
}); });
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
page { page {
background-color: #eb3729; background-color: #eb3729;
} }
.poster-poster {
.poster-poster {
height: unset !important; height: unset !important;
} }
</style> </style>

328
pages/activity/SeckillDetails/index.vue

@ -10,15 +10,8 @@
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view class="times"> <view class="times">
<view>距秒杀结束仅剩</view> <view>距秒杀结束仅剩</view>
<count-down <count-down :isDay="false" :tipText="false" :dayText="false" :hourText="' : '" :minuteText="' : '"
:isDay="false" :secondText="false" :datatime="datatime"></count-down>
:tipText="false"
:dayText="false"
:hourText="' : '"
:minuteText="' : '"
:secondText="false"
:datatime="datatime"
></count-down>
</view> </view>
<view class="iconfont icon-jiantou"></view> <view class="iconfont icon-jiantou"></view>
</view> </view>
@ -33,46 +26,106 @@
<view v-text="'销量:' + storeInfo.sales + '件'"></view> <view v-text="'销量:' + storeInfo.sales + '件'"></view>
</view> </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="product-intro">
<view class="title">产品介绍</view> <view class="title">产品介绍</view>
<view class="conter" v-html="storeInfo.description"></view> <view class="conter" v-html="storeInfo.description"></view>
</view> </view>
<!-- 操作栏 -->
<view style="height:100rpx;"></view> <view style="height:100rpx;"></view>
<view class="footerRush acea-row row-between-wrapper"> <view class="footer acea-row row-between-wrapper">
<!-- <view <!-- #ifdef MP-WEIXIN -->
class="customerSer acea-row row-center-wrapper row-column" <view class="item">
@click="routerGo()" <button open-type="contact" class='contacButton'>
> <view style="padding-bottom: 8rpx;" class="item">
<view class="iconfont icon-kefu"></view> <view class="iconfont icon-kefu"></view>
<view>客服</view> <text>客服</text>
</view> --> </view>
<view class="bnt bg-color-red" @click="tapBuy">立即购买</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>
<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> <ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
<StorePoster <StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus"
v-on:setPosterImageStatus="setPosterImageStatus" :posterData="posterData"></StorePoster>
:posterImageStatus="posterImageStatus"
:posterData="posterData"
></StorePoster>
</view> </view>
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.noscroll { .noscroll {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
</style> </style>
<script> <script>
import ProductConSwiper from "@/components/ProductConSwiper"; import ProductConSwiper from "@/components/ProductConSwiper";
import CountDown from "@/components/CountDown"; import CountDown from "@/components/CountDown";
import ProductWindow from "@/components/ProductWindow"; import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster"; import StorePoster from "@/components/StorePoster";
import { getSeckillDetail } from "@/api/activity"; import {
import { postCartAdd } from "@/api/store"; getSeckillDetail
import { imageBase64 } from "@/api/public"; } from "@/api/activity";
const NAME = "SeckillDetails"; import {
postCartAdd
} from "@/api/store";
import {
imageBase64
} from "@/api/public";
import {
getCoupon,
getCollectAdd,
getCollectDel,
getUserInfo
} from "@/api/user";
const NAME = "SeckillDetails";
export default { export default {
name: "SeckillDetails", name: "SeckillDetails",
components: { components: {
ProductConSwiper, ProductConSwiper,
@ -81,8 +134,9 @@ export default {
StorePoster StorePoster
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
seckillStatus: '',
domStatus: false, domStatus: false,
posterData: { posterData: {
image: "", image: "",
@ -97,44 +151,84 @@ export default {
replyCount: 0, replyCount: 0,
reply: [], reply: [],
cartNum: 1, cartNum: 1,
attrTxt: "请选择",
productValue: [],
attrValue: "",
attr: { attr: {
cartAttr: false, cartAttr: false,
productSelect: { productAttr: [],
image: "", productSelect: {},
store_name: "",
price: "",
stock: "",
unique: "",
cart_num: 1
}
}, },
datatime: 0 datatime: 0,
userCollect: false
}; };
}, },
watch: { onShow: function () {
$yroute: function(n) { this.mountedStart();
var that = this; },
if (n.name === NAME) { methods: {
that.mountedStart(); 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'
})
} }
} }
}, },
mounted: function() { openAlone: function () {
this.mountedStart(); this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: {
id: this.storeInfo.productId
}
});
// this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
}, },
methods: {
routerGo(item) { routerGo(item) {
this.$yrouter.push({ path: '/pages/user/CustomerList/index' }) 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 {
getCollectAdd(id, category).then(function () {
that.userCollect = !that.userCollect;
});
}
}, },
mountedStart: function() { mountedStart: function () {
var that = this; var that = this;
console.log(this)
let id = that.$yroute.query.id; let id = that.$yroute.query.id;
this.seckillStatus = that.$yroute.query.status;
that.datatime = parseInt(that.$yroute.query.time); that.datatime = parseInt(that.$yroute.query.time);
getSeckillDetail(id).then(res => { getSeckillDetail(id).then(res => {
that.userCollect = res.data.userCollect;
res.data.storeInfo.description = res.data.storeInfo.description.replace( res.data.storeInfo.description = res.data.storeInfo.description.replace(
/\<img/gi, /\<img/gi,
'<img style="max-width:100%;height:auto;"' '<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, "storeInfo", res.data.storeInfo);
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr); that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
that.$set(that, "replyCount", res.data.replyCount); that.$set(that, "replyCount", res.data.replyCount);
@ -148,33 +242,90 @@ export default {
} }
that.posterData.price = that.storeInfo.price; that.posterData.price = that.storeInfo.price;
that.posterData.code = that.storeInfo.code_base; that.posterData.code = that.storeInfo.code_base;
that.setProductSelect(); // that.setProductSelect();
that.domStatus = true; that.domStatus = true;
that.DefaultSelect();
}); });
}, },
updateTitle() { updateTitle() {
// document.title = this.storeInfo.title || this.$yroute.meta.title; // document.title = this.storeInfo.title || this.$yroute.meta.title;
}, },
setPosterImageStatus: function() { setPosterImageStatus: function () {
// var sTop = document.body || document.documentElement; // var sTop = document.body || document.documentElement;
// sTop.scrollTop = 0; // sTop.scrollTop = 0;
this.posterImageStatus = !this.posterImageStatus; 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]);
}
//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", "请选择");
}
},
// //
changeFun: function(opt) { changeFun: function (opt) {
if (typeof opt !== "object") opt = {}; if (typeof opt !== "object") opt = {};
let action = opt.action || ""; let action = opt.action || "";
let value = opt.value === undefined ? "" : opt.value; let value = opt.value === undefined ? "" : opt.value;
this[action] && this[action](value); this[action] && this[action](value);
}, },
changeattr: function(res) { changeattr: function (res) {
var that = this; var that = this;
that.attr.cartAttr = res; that.attr.cartAttr = res;
}, },
ChangeCartNum: function(res) { ChangeCartNum: function (res) {
var that = this; var that = this;
if (res) { if (res) {
if (that.attr.productSelect.cart_num < that.storeInfo.stock) { if (that.attr.productSelect.cart_num < that.storeInfo.seckillStock) {
that.attr.productSelect.cart_num++; that.attr.productSelect.cart_num++;
this.cartNum++; this.cartNum++;
} }
@ -185,20 +336,34 @@ export default {
} }
} }
}, },
setProductSelect: function() { //
var that = this; ChangeAttr: function (res) {
var attr = that.attr; //
attr.productSelect.image = that.storeInfo.image; let productSelect = this.productValue[res.value];
attr.productSelect.store_name = that.storeInfo.title; if (productSelect) {
attr.productSelect.price = that.storeInfo.price; this.attr.productAttr[res.indexw].index = res.indexn;
attr.productSelect.stock = that.storeInfo.stock; this.$set(this.attr.productSelect, "image", productSelect.image);
attr.cartAttr = false; this.$set(this.attr.productSelect, "price", productSelect.seckillPrice);
that.$set(that, "attr", attr); this.$set(this.attr.productSelect, "stock", productSelect.seckillStock);
}, this.$set(this.attr.productSelect, "unique", productSelect.unique);
selecAttrTap: function() { this.$set(this.attr.productSelect, "cart_num", 1);
this.cartAttr = true; this.$set(this, "attrValue", res.value);
}, this.$set(this, "attrTxt", "已选择");
tapBuy: function() { } 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; var that = this;
if (that.attr.cartAttr == false) { if (that.attr.cartAttr == false) {
that.attr.cartAttr = !this.attr.attrcartAttr; that.attr.cartAttr = !this.attr.attrcartAttr;
@ -213,12 +378,14 @@ export default {
.then(res => { .then(res => {
that.$yrouter.push({ that.$yrouter.push({
path: "/pages/order/OrderSubmission/index", path: "/pages/order/OrderSubmission/index",
query: { id: res.data.cartId } query: {
id: res.data.cartId
}
}); });
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}); });
@ -226,10 +393,15 @@ export default {
} }
} }
} }
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.product-con .nav { .product-con .nav {
padding: 0 0.2*100rpx; padding: 0 0.2*100rpx;
} }
.product-con .footer .bnt .buy.bg-color-hui {
background: #ccc;
}
</style> </style>

219
pages/authorization/index.vue

@ -1,36 +1,47 @@
<template> <template>
<view class="container"> <view class="container">
<view v-if="!token">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view> <view v-if="!token" class="force-login-wrap">
<view class="getUserInfo"> <!-- <image class="logo-bg" src="@/static/images/logo_bg.png" mode="aspectFill"></image> -->
<text>您还未允许微信登录授权请点击下方按钮允许微信授权登录</text> <view class="force-login__content y-f">
<button type="primary" open-type="getUserInfo" @getuserinfo="getUserInfo">允许微信登录授权</button> <open-data class="user-avatar" type="userAvatarUrl"></open-data>
<view style="height:20rpx"></view> <open-data class="user-name" type="userNickName"></open-data>
<button @click="back">取消微信登录授权</button> <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> </view>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP-WEIXIN --> <!-- #ifndef MP-WEIXIN -->
<view> <view class="force-login-wrap">
<view class="getUserInfo"> <!-- <image class="logo-bg" src="@/static/images/logo_bg.png" mode="aspectFill"></image> -->
<text>请先登录</text> <view class="force-login__content y-f">
<button type="primary" @tap="toLogin">去登录</button> <view class="login-notice">为了提供更优质的服务请先登录</view>
<button class="cu-btn author-btn" @tap="toLogin">去登录</button>
</view> </view>
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
</view>
</template> </template>
<script> <script>
import { mapState, mapMutations, mapActions } from "vuex"; import {
import { wxappAuth, getUser } from "@/api/user"; mapState,
import dayjs from "dayjs"; mapMutations,
import cookie from "@/utils/store/cookie"; mapActions
import { login, authorize } from "@/utils"; } from "vuex";
import {
export default { wxappAuth,
getUser
} from "@/api/user";
import dayjs from "dayjs";
import cookie from "@/utils/store/cookie";
import {
login,
authorize
} from "@/utils";
export default {
data() { data() {
return { return {
authorize: false, authorize: false,
@ -79,7 +90,9 @@ export default {
}); });
login() login()
.then((res) => { .then((res) => {
this.$yrouter.replace({ path: cookie.get("redirect") }); this.$yrouter.replace({
path: cookie.get("redirect")
});
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
@ -92,128 +105,88 @@ export default {
}, },
}, },
mounted() {}, mounted() {},
}; };
</script> </script>
<style lang="less"> <style lang="less">
.sp-cell { .container {
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; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
position: relative; 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 {
flex: 1;
height: 49px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
&.active {
text {
color: #ee7559;
} }
.tab-bar-pic { .force-login-wrap {
display: none; width: 100%;
background: #f9f9f9; height: 100%;
overflow: hidden;
&.active { z-index: 11111;
display: block; top: 0;
}
} .logo-bg {
width: 640rpx;
height: 300rpx;
} }
.tab-bar-pic { .force-login__content {
display: block; position: absolute;
background: #f9f9f9; left: 50%;
top: 50%;
&.active { transform: translate(-50%, -50%);
display: none;
.user-avatar {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
overflow: hidden;
margin-bottom: 40rpx;
} }
}
}
.tab-bar-pic {
width: 25px;
height: 25px;
background: #f9f9f9;
image { .user-name {
width: 25px; font-size: 35rpx;
height: 25px; font-family: PingFang SC;
} font-weight: bold;
color: #000;
margin-bottom: 30rpx;
} }
.tab-bar-pic-active { .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;
} }
text { .author-btn {
font-size: 10px; width: 630rpx;
color: rgb(160, 160, 160); height: 80rpx;
line-height: 10px; background: linear-gradient(to right, #f35447 0%, #ff8e3c 100%);
margin-top: 5px; 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);
} }
}
.tab-bar-bg {
padding-top: 46px;
width: 100%;
}
.view-item { .close-btn {
display: none; width: 630rpx;
width: 100%; height: 80rpx;
} margin-top: 30rpx;
border-radius: 40rpx;
.view-item-active { border: 2rpx solid #eb3729;
display: block; background: none;
} font-size: 30rpx;
font-family: PingFang SC;
.getUserInfo { font-weight: 500;
display: flex; color: #eb3729;
align-items: center; }
flex-direction: column; }
padding: 30px;
p {
margin-bottom: 20px;
} }
}
._van-dialog {
z-index: 99999999999;
}
</style> </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>

330
pages/home/index.vue

@ -1,146 +1,59 @@
<template> <template>
<view class="index"> <view class="index">
<view class="header fixed-header acea-row row-center-wrapper"> <!-- 导航栏 -->
<view @click="goGoodSearch()" class="search acea-row row-middle"> <view class="head_box " :style="{ background: bgcolor }" :class="{ active: bgcolor }">
<text class="iconfont icon-xiazai5"></text> <view class="cu-custom" :style="[{height:CustomBar+ 'px',}]">
搜索商品 <view class="cu-bar fixed" :style="customStyle" :class="[bgcolor]">
</view> <view class="action">
<view class="qr" @click="startQr()"> <text class="nav-title Shop-selector-rect">{{ 'yshop商城' }}</text>
<image src="@/static/images/qr.png" /> </view>
</view> <view class="content" :style="[{top:StatusBar + 'px'}]">
</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>
<!-- <view class="news acea-row ">
<view class="pictrue" v-if="$VUE_APP_RESOURCES_URL">
<image src="@/static/images/news.png" />
</view> </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>
<view class="iconfont icon-xiangyou"></view>
</view> </view>
</swiper-item> <view class="header header-search acea-row row-center-wrapper" :style="{ background: bgcolor }">
</block> <view @click="goGoodSearch()" class="search acea-row row-middle">
</swiper> <text class="iconfont icon-xiazai5"></text>
</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>
<view class="money font-color-red"><text>{{ item.price }}</text></view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="wrapper" v-if="bastList.length > 0">
<view class="title no-border acea-row row-between-wrapper">
<view class="text">
<div class="name line1">
<span class="iconfont icon-jingpintuijian"></span>
<span class="label">精品推荐</span>
</div>
</view>
<view @click="goHotNewGoods(1)" class="more">
更多
<text class="iconfont icon-jiantou"></text>
</view> </view>
<view class="qr" @click="startQr()">
<image src="@/static/images/qr.png" />
</view> </view>
<Good-list :good-list="bastList" :is-sort="false"></Good-list>
</view> </view>
<Banner :banner="banner" @getbgcolor="getbgcolor"></Banner>
<uni-notice-bar scrollable="true" @click="goRoll(singNew)" single="true" :speed="10" showIcon="true"
:text="singNew.info"></uni-notice-bar>
<view class="content_box home_content_box">
<!-- 菜单 -->
<Menu :list="menus"></Menu>
<!-- 滚动新闻 -->
<!-- 广告 -->
<Adv />
<!-- 热门榜单 -->
<HotCommodity :detail="likeInfo"></HotCommodity>
<!-- 超值拼团 -->
<Groupon :detail="combinationList" />
<!-- 首发新品->秒杀 -->
<!-- <FirstNewProduct :detail="firstList"></FirstNewProduct> -->
<!-- 精品推荐 -->
<!-- <ProductsRecommended :detail="bastList"></ProductsRecommended> -->
<!-- 促销单品
<PromoteProduct :detail="benefit"></PromoteProduct> -->
<!-- 直播 -->
<!-- #ifdef MP-WEIXIN -->
<Live :detail="live"></Live>
<!-- #endif -->
<view class="wrapper" v-if="firstList.length > 0"> <!-- 为您推荐 -->
<view class="title acea-row row-between-wrapper">
<view class="text">
<view class="name line1">
<span class="iconfont icon-xinpin"></span>
<span class="label">首发新品</span>
</view>
</view>
<view @click="goHotNewGoods(3)" 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, firstListIndex) in firstList" :key="firstListIndex">
<view class="img-box">
<image :src="item.image" />
</view>
<view class="pro-info line1">{{ item.storeName }}</view>
<view class="money font-color-red">{{ item.price }}</view>
</view>
</view>
</scroll-view>
</view>
</view>
<view class="wrapper" v-if="benefit.length > 0">
<view class="title acea-row row-center">
<view class="text text-center">
<div class="name line1 new-name">
<span class="iconfont icon-shoucang"></span>
<span class="txt">猜你喜欢</span>
</div>
</view>
<!-- <view @click="goGoodsPromotion(4)" class="more">
更多
<text class="iconfont icon-jiantou"></text>
</view> -->
</view>
</view>
<PromotionGood :benefit="benefit"></PromotionGood> <PromotionGood :benefit="benefit"></PromotionGood>
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose"></Coupon-window> </view>
<Coupon-window :coupon-list="couponList" v-if="showCoupon" @checked="couponClose" @close="couponClose">
</Coupon-window>
</view> </view>
</template> </template>
<script> <script>
// import { swiper, swiperSlide } from "vue-awesome-swiper";
import { import {
mapState, mapState,
mapMutations, mapMutations,
@ -149,7 +62,17 @@
import GoodList from '@/components/GoodList'; import GoodList from '@/components/GoodList';
import PromotionGood from '@/components/PromotionGood'; import PromotionGood from '@/components/PromotionGood';
import CouponWindow from '@/components/CouponWindow'; import CouponWindow from '@/components/CouponWindow';
import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue' import Menu from '@/components/Menu';
import UniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar'
import Adv from '@/components/sh-adv'
import Groupon from '@/components/sh-groupon.vue'
import Banner from './components/Banner';
import HotCommodity from './components/HotCommodity';
import FirstNewProduct from './components/FirstNewProduct';
import ProductsRecommended from './components/ProductsRecommended';
import Live from './components/Live';
import { import {
getHomeData, getHomeData,
getShare getShare
@ -167,18 +90,36 @@
components: { components: {
// swiper, // swiper,
// swiperSlide, // swiperSlide,
uniNoticeBar, UniNoticeBar,
GoodList, GoodList,
PromotionGood, PromotionGood,
CouponWindow CouponWindow,
Menu,
Adv,
Groupon,
Banner,
HotCommodity,
FirstNewProduct,
ProductsRecommended,
Live
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
CustomBar: this.CustomBar,
StatusBar: this.StatusBar,
formatMenus: [],
categoryCurrent: 0,
menuNum: 4,
bgcolor: '',
bgColor: '',
swiperCurrent: 0, //
webviewId: 0,
showCoupon: false, showCoupon: false,
logoUrl: '', logoUrl: '',
banner: [], banner: [],
menus: [], menus: [],
combinationList: [],
roll: [], roll: [],
activity: [], activity: [],
activityOne: {}, activityOne: {},
@ -191,6 +132,7 @@
bastList: [] bastList: []
}, },
likeInfo: [], likeInfo: [],
live: [],
lovely: [], lovely: [],
benefit: [], benefit: [],
couponList: [], couponList: [],
@ -246,15 +188,26 @@
slidesPerView: 'auto', slidesPerView: 'auto',
observer: true, observer: true,
observeParents: true observeParents: true
} },
bgImage: ''
}; };
}, },
computed: { computed: {
singNew() { singNew() {
return this.roll.length > 0 ? this.roll[0] : "你还没添加通知哦!"; return this.roll.length > 0 ? this.roll[0] : "你还没添加通知哦!";
},
customStyle() {
var bgImage = this.bgImage;
// var style = `height:${this.CustomBar}px;padding-top:${0}px;background: ${this.bgcolor}`;
var style = `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;background: ${this.bgcolor}`;
if (this.bgImage) {
style = `${style}background-image:url(${bgImage});`;
} }
return style
}, },
onShow: function() {
},
onShow: function () {
this.getLocation() this.getLocation()
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
@ -269,15 +222,32 @@
that.$set(that, 'firstList', res.data.firstList); that.$set(that, 'firstList', res.data.firstList);
that.$set(that, 'bastList', res.data.bastList); that.$set(that, 'bastList', res.data.bastList);
that.$set(that, 'likeInfo', res.data.likeInfo); that.$set(that, 'likeInfo', res.data.likeInfo);
that.$set(that, 'live', res.data.liveList);
that.$set(that, 'lovely', res.data.lovely); that.$set(that, 'lovely', res.data.lovely);
that.$set(that, 'benefit', res.data.benefit); that.$set(that, 'benefit', res.data.benefit);
that.$set(that, 'couponList', res.data.couponList); that.$set(that, 'couponList', res.data.couponList);
that.$set(that, 'combinationList', res.data.combinationList);
uni.hideLoading(); uni.hideLoading();
that.setOpenShare(); that.setOpenShare();
// that.doColorThief()
}); });
}, },
methods: { methods: {
...mapActions(["getLocation"]), ...mapActions(["getLocation"]),
onShareTimeline: function () {
return {
title: this.miniHomeRemark,
imageUrl: this.miniHomeImg,
path: "pages/home/index?spread=" + uni.getStorageSync("uid")
}
},
onShareAppMessage: function () {
return {
title: this.miniHomeRemark,
imageUrl: this.miniHomeImg,
path: "pages/home/index?spread=" + uni.getStorageSync("uid")
}
},
goRoll(item) { goRoll(item) {
if (item.uniapp_url) { if (item.uniapp_url) {
this.$yrouter.push(item.uniapp_url) this.$yrouter.push(item.uniapp_url)
@ -309,7 +279,7 @@
goGoodsPromotion() { goGoodsPromotion() {
this.$yrouter.push('/pages/shop/GoodsPromotion/index'); this.$yrouter.push('/pages/shop/GoodsPromotion/index');
}, },
setOpenShare: function() { setOpenShare: function () {
if (this.$deviceType == 'weixin') { if (this.$deviceType == 'weixin') {
getShare().then(res => { getShare().then(res => {
var data = res.data.data; var data = res.data.data;
@ -323,15 +293,10 @@
}) })
} }
}, },
startQr: function() { startQr: function () {
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
let option = handleUrlParam(res.result) let option = handleUrlParam(res.result)
console.log(option)
// {productId: "19", spread: "21", codeType: "routine"}
// {productId: "19", spread: "21", pageType: "good", codeType: "routine"}
switch (option.pageType) { switch (option.pageType) {
case 'good': case 'good':
// //
@ -370,15 +335,23 @@
}); });
break; break;
} }
} }
}); });
} },
} getbgcolor(e) {
this.bgcolor = e;
},
},
created: async function () {
// await this.doColorThief();
},
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.content_box {
background: #f6f6f6;
}
.index { .index {
background-color: #fff; background-color: #fff;
} }
@ -390,7 +363,13 @@
.fixed-header { .fixed-header {
position: fixed; position: fixed;
z-index: 99; z-index: 99;
// #ifdef H5
top: 88rpx;
// #endif
// #ifndef H5
top: 0; top: 0;
// #endif
left: 0; left: 0;
right: 0; right: 0;
background: #fff; background: #fff;
@ -400,4 +379,65 @@
height: 98rpx height: 98rpx
} }
} }
.head_box {
position: relative;
z-index: 10;
width: 100%;
// background: #fff;
transition: all linear 0.3s;
/deep/.cuIcon-back {
display: none;
}
.nav-title {
font-size: 38rpx;
font-family: PingFang SC;
font-weight: 500;
color: #fff;
}
}
.cu-bar.fixed {
position: fixed;
width: 100%;
top: 0;
z-index: 1024;
// box-shadow: 0 1upx 6upx rgba(0, 0, 0, 0.1);
}
.cu-bar {
box-sizing: border-box;
.index .header {
height: 64rpx;
// width: 100%;
// padding: 0 30rpx;
// box-sizing: border-box;
}
}
.header-search {
transition: all linear 0.3s;
}
.cu-bar .action {
display: -webkit-box;
display: -webkit-flex;
display: flex;
align-items: center;
height: 100%;
max-height: 100%;
&:first-child {
margin-left: 15px;
font-size: 15px;
}
}
.home_content_box {
margin-top: -10rpx;
}
</style> </style>

13
pages/order/OrderDetails/index.vue

@ -126,7 +126,7 @@
<view class="name"> <view class="name">
{{ orderInfo.realName }} {{ orderInfo.realName }}
<text class="phone">{{ orderInfo.userPhone }}</text> <text class="phone">{{ orderInfo.userPhone }}</text>
<text class="iconfont icon-tonghua font-color-red"></text> <text @click="telPhone(orderInfo.userPhone)" class="iconfont icon-tonghua font-color-red"></text>
</view> </view>
<view>{{ orderInfo.userAddress }}</view> <view>{{ orderInfo.userAddress }}</view>
</view> </view>
@ -134,7 +134,7 @@
<div class="name"> <div class="name">
{{ system_store.name}} {{ system_store.name}}
<span class="phone">{{ system_store.phone }}</span> <span class="phone">{{ system_store.phone }}</span>
<span class="iconfont icon-tonghua font-color-red" :href="'tel:' + system_store.phone"></span> <span @click="telPhone(system_store.phone)" class="iconfont icon-tonghua font-color-red" :href="'tel:' + system_store.phone"></span>
</div> </div>
<div>{{ system_store.address }}</div> <div>{{ system_store.address }}</div>
</div> </div>
@ -366,6 +366,15 @@ export default {
}, },
}); });
}, },
//
telPhone(phoneNumber) {
uni.makePhoneCall({
phoneNumber: phoneNumber,
fail() {
console.log("取消拨打");
}
});
},
showChang: function (data) { showChang: function (data) {
// //
this.$yrouter.push({ this.$yrouter.push({

181
pages/order/OrderSubmission/index.vue

@ -2,24 +2,12 @@
<view class="order-submission"> <view class="order-submission">
<view class="allAddress" :style="systemStore ? '' : 'padding-top: 0.2*100rpx'"> <view class="allAddress" :style="systemStore ? '' : 'padding-top: 0.2*100rpx'">
<view class="nav acea-row"> <view class="nav acea-row">
<view <view class="item font-color-red" :class="shipping_type === 0 ? 'on' : 'on2'" @click="addressType(0)"
class="item font-color-red" v-if="systemStore"></view>
:class="shipping_type === 0 ? 'on' : 'on2'" <view class="item font-color-red" :class="shipping_type === 1 ? 'on' : 'on2'" @click="addressType(1)"
@click="addressType(0)" v-if="systemStore"></view>
v-if="systemStore" </view>
></view> <view class="address acea-row row-between-wrapper" v-if="shipping_type === 0" @click="addressTap">
<view
class="item font-color-red"
:class="shipping_type === 1 ? 'on' : 'on2'"
@click="addressType(1)"
v-if="systemStore"
></view>
</view>
<view
class="address acea-row row-between-wrapper"
v-if="shipping_type === 0"
@click="addressTap"
>
<view class="addressCon" v-if="addressInfo.realName"> <view class="addressCon" v-if="addressInfo.realName">
<view class="name"> <view class="name">
{{ addressInfo.realName }} {{ addressInfo.realName }}
@ -35,11 +23,7 @@
</view> </view>
<view class="iconfont icon-jiantou"></view> <view class="iconfont icon-jiantou"></view>
</view> </view>
<div <div class="address acea-row row-between-wrapper" v-if="shipping_type === 1" @click="showStoreList">
class="address acea-row row-between-wrapper"
v-if="shipping_type === 1"
@click="showStoreList"
>
<div class="addressCon" v-if="storeItems"> <div class="addressCon" v-if="storeItems">
<div class="name"> <div class="name">
{{ storeItems.name }} {{ storeItems.name }}
@ -69,10 +53,7 @@
<text class="iconfont icon-jiantou"></text> <text class="iconfont icon-jiantou"></text>
</view> </view>
</view> </view>
<view <view class="item acea-row row-between-wrapper" v-if="deduction === false && enableIntegral === true">
class="item acea-row row-between-wrapper"
v-if="deduction === false && enableIntegral === true"
>
<view>积分抵扣</view> <view>积分抵扣</view>
<view class="discount"> <view class="discount">
<view class="select-btn"> <view class="select-btn">
@ -124,33 +105,21 @@
<view class="item"> <view class="item">
<view>支付方式</view> <view>支付方式</view>
<view class="list"> <view class="list">
<view <view class="payItem acea-row row-middle" :class="active === 'weixin' ? 'on' : ''" @click="payItem('weixin')"
class="payItem acea-row row-middle" v-show="isWeixin">
:class="active === 'weixin' ? 'on' : ''"
@click="payItem('weixin')"
v-show="isWeixin"
>
<view class="name acea-row row-center-wrapper"> <view class="name acea-row row-center-wrapper">
<view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付 <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付
</view> </view>
<view class="tip">微信快捷支付</view> <view class="tip">微信快捷支付</view>
</view> </view>
<view <view class="payItem acea-row row-middle" :class="active === 'weixin' ? 'on' : ''" @click="payItem('weixin')"
class="payItem acea-row row-middle" v-show="!isWeixin">
:class="active === 'weixin' ? 'on' : ''"
@click="payItem('weixin')"
v-show="!isWeixin"
>
<view class="name acea-row row-center-wrapper"> <view class="name acea-row row-center-wrapper">
<view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付 <view class="iconfont icon-weixin2" :class="active === 'weixin' ? 'bounceIn' : ''"></view>微信支付
</view> </view>
<view class="tip">微信快捷支付</view> <view class="tip">微信快捷支付</view>
</view> </view>
<view <view class="payItem acea-row row-middle" :class="active === 'yue' ? 'on' : ''" @click="payItem('yue')">
class="payItem acea-row row-middle"
:class="active === 'yue' ? 'on' : ''"
@click="payItem('yue')"
>
<view class="name acea-row row-center-wrapper"> <view class="name acea-row row-center-wrapper">
<view class="iconfont icon-icon-test" :class="active === 'yue' ? 'bounceIn' : ''"></view>余额支付 <view class="iconfont icon-icon-test" :class="active === 'yue' ? 'bounceIn' : ''"></view>余额支付
</view> </view>
@ -185,63 +154,50 @@
</view> </view>
<view class="settlement" @click="createOrder">立即结算</view> <view class="settlement" @click="createOrder">立即结算</view>
</view> </view>
<CouponListWindow <CouponListWindow v-on:couponchange="changecoupon($event)" v-model="showCoupon" :price="orderPrice.totalPrice"
v-on:couponchange="changecoupon($event)" :checked="usableCoupon.id" @checked="changeCoupon" :cartid="cartid"></CouponListWindow>
v-model="showCoupon" <AddressWindow @checked="changeAddress" @redirect="addressRedirect" v-model="showAddress" :checked="addressInfo.id"
:price="orderPrice.totalPrice" ref="mychild"></AddressWindow>
:checked="usableCoupon.id"
@checked="changeCoupon"
:cartid="cartid"
></CouponListWindow>
<AddressWindow
@checked="changeAddress"
@redirect="addressRedirect"
v-model="showAddress"
:checked="addressInfo.id"
ref="mychild"
></AddressWindow>
</view> </view>
</template> </template>
<style scoped lang="less"> <style scoped lang="less">
.order-submission .wrapper .shipping select { .order-submission .wrapper .shipping select {
color: #999; color: #999;
padding-right: 0.15 * 100rpx; padding-right: 0.15 * 100rpx;
} }
.order-submission .wrapper .shipping .iconfont { .order-submission .wrapper .shipping .iconfont {
font-size: 0.3 * 100rpx; font-size: 0.3 * 100rpx;
color: #515151; color: #515151;
} }
.order-submission .allAddress { .order-submission .allAddress {
width: 100%; width: 100%;
background-image: linear-gradient(to bottom, #eb3729 0%, #eb3729 100%); background-image: linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
background-image: -webkit-linear-gradient( background-image: -webkit-linear-gradient(to bottom,
to bottom,
#eb3729 0%, #eb3729 0%,
#eb3729 100% #eb3729 100%);
);
background-image: -moz-linear-gradient(to bottom, #eb3729 0%, #eb3729 100%); background-image: -moz-linear-gradient(to bottom, #eb3729 0%, #eb3729 100%);
padding-top: 1 * 100rpx; padding-top: 1 * 100rpx;
} }
.order-submission .allAddress .nav { .order-submission .allAddress .nav {
margin: 0 auto; margin: 0 auto;
padding: 0 30rpx; padding: 0 30rpx;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.order-submission .allAddress .nav .item { .order-submission .allAddress .nav .item {
flex: 1; flex: 1;
position: relative; position: relative;
} }
.order-submission .allAddress .nav .item.on { .order-submission .allAddress .nav .item.on {
position: relative; position: relative;
} }
.order-submission .allAddress .nav .item.on:before { .order-submission .allAddress .nav .item.on:before {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
content: "快递配送"; content: "快递配送";
@ -256,18 +212,18 @@
z-index: 9; z-index: 9;
text-align: center; text-align: center;
line-height: 0.14 * 100rpx; line-height: 0.14 * 100rpx;
} }
.order-submission .allAddress .nav .item:nth-of-type(2).on:before { .order-submission .allAddress .nav .item:nth-of-type(2).on:before {
content: "到店自提"; content: "到店自提";
border-width: 0.4 * 100rpx; border-width: 0.4 * 100rpx;
} }
.order-submission .allAddress .nav .item.on2 { .order-submission .allAddress .nav .item.on2 {
position: relative; position: relative;
} }
.order-submission .allAddress .nav .item.on2:before { .order-submission .allAddress .nav .item.on2:before {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
content: "到店自提"; content: "到店自提";
@ -281,42 +237,56 @@
border-color: #d5e6e6; border-color: #d5e6e6;
text-align: center; text-align: center;
line-height: 0.14 * 100rpx; line-height: 0.14 * 100rpx;
} }
.order-submission .allAddress .nav .item:nth-of-type(1).on2:before { .order-submission .allAddress .nav .item:nth-of-type(1).on2:before {
content: "快递配送"; content: "快递配送";
border-width: 0.4 * 100rpx; border-width: 0.4 * 100rpx;
} }
.order-submission .allAddress .address { .order-submission .allAddress .address {
width: 6.91 * 100rpx; width: 6.91 * 100rpx;
height: 1.5 * 100rpx; height: 1.5 * 100rpx;
margin: 0 auto; margin: 0 auto;
box-sizing: border-box; box-sizing: border-box;
} }
.order-submission .allAddress .line { .order-submission .allAddress .line {
width: 7.1 * 100rpx; width: 7.1 * 100rpx;
margin: 0 auto; margin: 0 auto;
} }
.order-submission .wrapper .item .discount input::placeholder { .order-submission .wrapper .item .discount input::placeholder {
color: #ccc; color: #ccc;
} }
</style> </style>
<script> <script>
import OrderGoods from "@/components/OrderGoods"; import OrderGoods from "@/components/OrderGoods";
import CouponListWindow from "@/components/CouponListWindow"; import CouponListWindow from "@/components/CouponListWindow";
import AddressWindow from "@/components/AddressWindow"; import AddressWindow from "@/components/AddressWindow";
import { postOrderConfirm, postOrderComputed, createOrder } from "@/api/order"; import {
import { mapGetters } from "vuex"; postOrderConfirm,
import { handleOrderPayResults } from "@/libs/order"; postOrderComputed,
import { weappPay } from "@/libs/wechat"; createOrder
import { isWeixin, handleErrorMessage } from "@/utils"; } from "@/api/order";
import {
mapGetters
} from "vuex";
import {
handleOrderPayResults,
subscribeMessage
} from "@/libs/order";
import {
weappPay
} from "@/libs/wechat";
import {
isWeixin,
handleErrorMessage
} from "@/utils";
const NAME = "OrderSubmission", const NAME = "OrderSubmission",
_isWeixin = isWeixin(); _isWeixin = isWeixin();
export default { export default {
name: NAME, name: NAME,
components: { components: {
OrderGoods, OrderGoods,
@ -368,7 +338,7 @@ export default {
this.computedPrice(); this.computedPrice();
}, },
}, },
mounted: function () { onShow: function () {
let that = this; let that = this;
this.$store.dispatch("getUser", true); this.$store.dispatch("getUser", true);
that.getCartInfo(); that.getCartInfo();
@ -546,6 +516,9 @@ export default {
if (this.$deviceType == "app") { if (this.$deviceType == "app") {
from.from = "app"; from.from = "app";
} }
// #ifdef MP-WEIXIN
subscribeMessage()
// #endif
createOrder(this.orderGroupInfo.orderKey, { createOrder(this.orderGroupInfo.orderKey, {
realName: this.contacts, realName: this.contacts,
phone: this.contactsTel, phone: this.contactsTel,
@ -565,12 +538,12 @@ export default {
}) })
.then((res) => { .then((res) => {
uni.hideLoading(); uni.hideLoading();
handleOrderPayResults.call(this, res.data, "create"); handleOrderPayResults.call(this, res.data, "create", this.active);
}) })
.catch((err) => { .catch((err) => {
handleErrorMessage(err, "创建订单失败"); handleErrorMessage(err, "创建订单失败");
}); });
}, },
}, },
}; };
</script> </script>

7
pages/orderAdmin/AdminOrder/index.vue

@ -66,9 +66,10 @@
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>下单时间</view> <view>下单时间</view>
<view class="conter"> <!-- <view class="conter"> -->
<data-format :date="orderInfo.addTime"></data-format> <view class="conter">{{ orderInfo.createTime }}</view>
</view> <!-- <data-format :date="orderInfo.addTime"></data-format> -->
<!-- </view> -->
</view> </view>
<view class="item acea-row row-between"> <view class="item acea-row row-between">
<view>支付状态</view> <view>支付状态</view>

9
pages/orderAdmin/AdminOrderList/index.vue

@ -12,9 +12,9 @@
<view class="item" v-for="(item, listIndex) in list" :key="listIndex"> <view class="item" v-for="(item, listIndex) in list" :key="listIndex">
<view class="order-num acea-row row-middle" @click="toDetail(item)"> <view class="order-num acea-row row-middle" @click="toDetail(item)">
<text>订单号{{ item.orderId }}</text> <text>订单号{{ item.orderId }}</text>
<text class="time"> <text class="time acea-row row-between">
<text>下单时间</text> <text>下单时间</text>
<data-format :date="item.addTime"></data-format> <text class="conter">{{ item.createTime }}</text>
</text> </text>
</view> </view>
<view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key"> <view class="pos-order-goods" v-for="(val, key) in item.cartInfo" :key="key">
@ -38,10 +38,7 @@
<view class="public-total"> <view class="public-total">
{{ item.totalNum }}件商品应支付 {{ item.totalNum }}件商品应支付
<text class="money">{{ item.payPrice }}</text> <text class="money">{{ item.payPrice }}</text>
( 邮费 ¥{{ ( 邮费 ¥{{item.totalPostage}})
item.totalPostage
}}
)
</view> </view>
<view class="operation acea-row row-between-wrapper"> <view class="operation acea-row row-between-wrapper">
<view class="more"> <view class="more">

3
pages/shop/GoodsCollection/index.vue

@ -47,6 +47,7 @@ export default {
return { return {
page: 1, page: 1,
limit: 20, limit: 20,
type:'collect',
collectProductList: [], collectProductList: [],
loadTitle: "", loadTitle: "",
loading: false, loading: false,
@ -71,7 +72,7 @@ export default {
if (that.loading) return; //false if (that.loading) return; //false
if (that.loadend) return; //false if (that.loadend) return; //false
that.loading = true; that.loading = true;
getCollectUser(that.page, that.limit).then(res => { getCollectUser(that.page, that.limit,that.type).then(res => {
that.loading = false; that.loading = false;
//apply();js; //apply();js;
that.collectProductList.push.apply(that.collectProductList, res.data); that.collectProductList.push.apply(that.collectProductList, res.data);

319
pages/shop/GoodsCon/index.vue

@ -1,21 +1,17 @@
<template> <template>
<view :class="productConClass"> <view :class="productConClass">
<view v-if="storeInfo.id"> <view v-if="storeInfo.id">
<!-- 轮播图 -->
<product-con-swiper :img-urls="storeInfo.sliderImageArr"></product-con-swiper> <product-con-swiper :img-urls="storeInfo.sliderImageArr"></product-con-swiper>
<!-- 商品信息描述 -->
<view class="wrapper"> <view class="wrapper">
<view class="share acea-row row-between row-bottom"> <view class="share acea-row row-between row-bottom">
<view class="money font-color-red"> <view class="money font-color-red">
<text></text> <text></text>
<text class="num">{{ storeInfo.price }}</text> <text class="num">{{ storeInfo.price }}</text>
<text <text class="vip-money" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0">{{ storeInfo.vipPrice }}</text>
class="vip-money" <image src="@/static/images/vip.png" class="image" v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0" />
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
>{{ storeInfo.vipPrice }}</text>
<image
src="@/static/images/vip.png"
class="image"
v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
/>
</view> </view>
<view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view> <view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view>
</view> </view>
@ -25,22 +21,17 @@
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text> <text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text>
<text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text> <text>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text>
</view> </view>
<view <view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
class="coupon acea-row row-between-wrapper"
@click="couponTap"
v-if="couponList.length"
>
<text class="hide line1 acea-row"> <text class="hide line1 acea-row">
<text>优惠券</text> <text>优惠券</text>
<text <text class="activity" v-for="(item, couponListEq) in couponList"
class="activity" :key="couponListEq">{{ item.use_min_price }}{{ item.coupon_price }}</text>
v-for="(item, couponListEq) in couponList"
:key="couponListEq"
>{{ item.use_min_price }}{{ item.coupon_price }}</text>
</text> </text>
<view class="iconfont icon-jiantou"></view> <view class="iconfont icon-jiantou"></view>
</view> </view>
</view> </view>
<!-- 运费 -->
<div class="attribute acea-row row-between-wrapper"> <div class="attribute acea-row row-between-wrapper">
<div> <div>
运费 运费
@ -48,6 +39,7 @@
</div> </div>
</div> </div>
<!-- 规格 -->
<view class="attribute acea-row row-between-wrapper" @click="selecAttrTap"> <view class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
<view> <view>
<text>{{ attrTxt }}</text> <text>{{ attrTxt }}</text>
@ -55,6 +47,8 @@
</view> </view>
<view class="iconfont icon-jiantou"></view> <view class="iconfont icon-jiantou"></view>
</view> </view>
<!-- 门店信息 -->
<view class="store-info"> <view class="store-info">
<view class="title acea-row row-between-wrapper"> <view class="title acea-row row-between-wrapper">
<view>门店信息</view> <view>门店信息</view>
@ -76,15 +70,14 @@
</view> </view>
</view> </view>
<view class="addressBox"> <view class="addressBox">
<a <a class="iconfont icon-dadianhua01 font-color-red phone" @click="telPhone(systemStore.phone)"></a>
:href="'tel:'+systemStore.phone"
class="iconfont icon-dadianhua01 font-color-red phone"
></a>
<view class="addressTxt corlor-yshop">距离{{systemStore.distance}}千米</view> <view class="addressTxt corlor-yshop">距离{{systemStore.distance}}千米</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 用户评价 -->
<view class="userEvaluation" v-if="replyCount"> <view class="userEvaluation" v-if="replyCount">
<view class="title acea-row row-between-wrapper"> <view class="title acea-row row-between-wrapper">
<view>用户评价({{ replyCount }})</view> <view>用户评价({{ replyCount }})</view>
@ -95,6 +88,8 @@
</view> </view>
<user-evaluation :reply="reply"></user-evaluation> <user-evaluation :reply="reply"></user-evaluation>
</view> </view>
<!-- 商品推荐 -->
<view class="superior"> <view class="superior">
<view class="title acea-row row-center-wrapper"> <view class="title acea-row row-center-wrapper">
<image src="@/static/images/ling.png" /> <image src="@/static/images/ling.png" />
@ -120,12 +115,27 @@
</view> </view>
</template> </template>
</view> </view>
<!-- 商品详情 -->
<view class="product-intro"> <view class="product-intro">
<text class="title">产品介绍</text> <text class="title">产品介绍</text>
<view class="conter" v-html="storeInfo.description"></view> <view class="conter" v-html="storeInfo.description"></view>
</view> </view>
<view style="height:100rpx;"></view> <view style="height:100rpx;"></view>
<!-- 操作栏 -->
<view class="footer acea-row row-between-wrapper"> <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="storeInfo.userCollect"> <view class="item" @click="setCollect" v-if="storeInfo.userCollect">
<view class="iconfont icon-shoucang1"></view> <view class="iconfont icon-shoucang1"></view>
<text>收藏</text> <text>收藏</text>
@ -155,15 +165,17 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 优惠券 -->
<CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop> <CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
<!-- 商品规格弹窗 -->
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow> <ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
<StorePoster <!-- 分享海报 -->
v-on:setPosterImageStatus="setPosterImageStatus" <StorePoster v-on:setPosterImageStatus="setPosterImageStatus" :posterImageStatus="posterImageStatus"
:posterImageStatus="posterImageStatus" :posterData="posterData" :goodId="id"></StorePoster>
:posterData="posterData" <!-- 分享弹窗 -->
:goodId="id"
></StorePoster>
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo> <ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
<view class="generate-posters acea-row row-middle on" v-if="posters"> <view class="generate-posters acea-row row-middle on" v-if="posters">
<view class="item" @click="setPosterImageStatus"> <view class="item" @click="setPosterImageStatus">
<view class="iconfont icon-haibao"></view> <view class="iconfont icon-haibao"></view>
@ -185,32 +197,42 @@
</template> </template>
<script> <script>
// import { swiper, swiperSlide } from "vue-awesome-swiper"; // import { swiper, swiperSlide } from "vue-awesome-swiper";
import ProductConSwiper from "@/components/ProductConSwiper"; import ProductConSwiper from "@/components/ProductConSwiper";
import UserEvaluation from "@/components/UserEvaluation"; import UserEvaluation from "@/components/UserEvaluation";
import CouponPop from "@/components/CouponPop"; import CouponPop from "@/components/CouponPop";
import ProductWindow from "@/components/ProductWindow"; import ProductWindow from "@/components/ProductWindow";
import StorePoster from "@/components/StorePoster"; import StorePoster from "@/components/StorePoster";
import ShareInfo from "@/components/ShareInfo"; import ShareInfo from "@/components/ShareInfo";
import { import {
getProductDetail, getProductDetail,
postCartAdd, postCartAdd,
getCartCount, getCartCount,
getProductCode, getProductCode,
} from "@/api/store"; } from "@/api/store";
import { import {
getCoupon, getCoupon,
getCollectAdd, getCollectAdd,
getCollectDel, getCollectDel,
getUserInfo, getUserInfo,
} from "@/api/user"; } from "@/api/user";
import { isWeixin, PosterCanvas, handleQrCode } from "@/utils"; import {
import { wechatEvevt } from "@/libs/wechat"; isWeixin,
import { imageBase64 } from "@/api/public"; PosterCanvas,
import { mapGetters } from "vuex"; handleQrCode
} from "@/utils";
export default { import {
wechatEvevt
} from "@/libs/wechat";
import {
imageBase64
} from "@/api/public";
import {
mapGetters
} from "vuex";
export default {
name: "GoodsCon", name: "GoodsCon",
components: { components: {
// swiper, // swiper,
@ -300,6 +322,24 @@ export default {
}, },
}, },
methods: { methods: {
onShareAppMessage: function () {
return {
title: this.storeInfo.storeName,
imageUrl: this.storeInfo.image,
path: "pages/shop/GoodsCon/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'
})
}
}
},
goShoppingCart() { goShoppingCart() {
this.$yrouter.switchTab("/pages/shop/ShoppingCart/index"); this.$yrouter.switchTab("/pages/shop/ShoppingCart/index");
}, },
@ -321,6 +361,14 @@ export default {
}, },
}); });
}, },
telPhone(phoneNumber) {
uni.makePhoneCall({
phoneNumber: phoneNumber,
fail() {
console.log("取消拨打");
}
});
},
showChang: function (data) { showChang: function (data) {
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/map/index", path: "/pages/map/index",
@ -352,7 +400,10 @@ export default {
if (this.$deviceType == "app") { if (this.$deviceType == "app") {
from.from = "app"; from.from = "app";
} }
uni.showLoading({ title: "加载中", mask: true }); uni.showLoading({
title: "加载中",
mask: true
});
getProductDetail(that.id, from) getProductDetail(that.id, from)
.then((res) => { .then((res) => {
res.data.storeInfo.description = res.data.storeInfo.description.replace( res.data.storeInfo.description = res.data.storeInfo.description.replace(
@ -397,8 +448,7 @@ export default {
}) })
.catch((err) => { .catch((err) => {
uni.showToast({ uni.showToast({
title: title: err.msg || err.response.data.msg || err.response.data.message,
err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
@ -616,10 +666,8 @@ export default {
productId: that.id, productId: that.id,
cartNum: that.attr.productSelect.cart_num, cartNum: that.attr.productSelect.cart_num,
new: news, new: news,
uniqueId: uniqueId: that.attr.productSelect !== undefined ?
that.attr.productSelect !== undefined that.attr.productSelect.unique : "",
? that.attr.productSelect.unique
: "",
}; };
postCartAdd(q) postCartAdd(q)
.then(function (res) { .then(function (res) {
@ -692,9 +740,9 @@ export default {
if (this.isLogin) { if (this.isLogin) {
getUserInfo().then((res) => { getUserInfo().then((res) => {
href = href =
href.indexOf("?") === -1 href.indexOf("?") === -1 ?
? href + "?spread=" + res.data.uid href + "?spread=" + res.data.uid :
: href + "&spread=" + res.data.uid; href + "&spread=" + res.data.uid;
var configAppMessage = { var configAppMessage = {
desc: data.storeInfo, desc: data.storeInfo,
title: data.storeName, title: data.storeName,
@ -741,113 +789,116 @@ export default {
} }
}, },
}, },
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.geoPage { .geoPage {
position: fixed; position: fixed;
width: 100%; width: 100%;
height: 100%; height: 100%;
top: 0; top: 0;
z-index: 10000; z-index: 10000;
} }
.product-con .store-info { .product-con .store-info {
margin-top: 0.2 * 100rpx; margin-top: 0.2 * 100rpx;
background-color: #fff; background-color: #fff;
} }
.product-con .store-info .title { .product-con .store-info .title {
padding: 0 0.3 * 100rpx; padding: 0 0.3 * 100rpx;
font-size: 0.28 * 100rpx; font-size: 0.28 * 100rpx;
color: #282828; color: #282828;
height: 0.8 * 100rpx; height: 0.8 * 100rpx;
line-height: 0.8 * 100rpx; line-height: 0.8 * 100rpx;
border-bottom: 0.01 * 100rpx solid #f5f5f5; border-bottom: 0.01 * 100rpx solid #f5f5f5;
} }
.product-con .store-info .info { .product-con .store-info .info {
padding: 0 0.3 * 100rpx; padding: 0 0.3 * 100rpx;
height: 1.26 * 100rpx; height: 1.26 * 100rpx;
} }
.product-con .store-info .info .picTxt { .product-con .store-info .info .picTxt {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.product-con .store-info .info .picTxt .pictrue { .product-con .store-info .info .picTxt .pictrue {
width: 0.76 * 100rpx; width: 0.76 * 100rpx;
height: 0.76 * 100rpx; height: 0.76 * 100rpx;
margin-right: 0.2 * 100rpx; margin-right: 0.2 * 100rpx;
} }
.product-con .store-info .info .picTxt .pictrue image { .product-con .store-info .info .picTxt .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.06 * 100rpx; border-radius: 0.06 * 100rpx;
} }
.product-con .store-info .info .picTxt .text { .product-con .store-info .info .picTxt .text {
flex: 1; flex: 1;
} }
.product-con .store-info .info .picTxt .text .name { .product-con .store-info .info .picTxt .text .name {
font-size: 0.3 * 100rpx; font-size: 0.3 * 100rpx;
color: #282828; color: #282828;
} }
.product-con .store-info .info .picTxt .text .address { .product-con .store-info .info .picTxt .text .address {
font-size: 0.24 * 100rpx; font-size: 0.24 * 100rpx;
color: #666; color: #666;
margin-top: 0.03 * 100rpx; margin-top: 0.03 * 100rpx;
} }
.product-con .store-info .info .picTxt .text .address .iconfont { .product-con .store-info .info .picTxt .text .address .iconfont {
color: #707070; color: #707070;
font-size: 0.18 * 100rpx; font-size: 0.18 * 100rpx;
margin-left: 0.1 * 100rpx; margin-left: 0.1 * 100rpx;
} }
.product-con .store-info .info .picTxt .addressBox { .product-con .store-info .info .picTxt .addressBox {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
} }
.product-con .store-info .info .picTxt .addressBox .iconfont {
.product-con .store-info .info .picTxt .addressBox .iconfont {
font-size: 0.4 * 100rpx; font-size: 0.4 * 100rpx;
} }
.product-con .store-info .info .picTxt .addressBox .addressTxt {
.product-con .store-info .info .picTxt .addressBox .addressTxt {
font-size: 0.24 * 100rpx; font-size: 0.24 * 100rpx;
color: #eb3729; color: #eb3729;
} }
.product-con .store-info .praise { .product-con .store-info .praise {
font-size: 0.28 * 100rpx; font-size: 0.28 * 100rpx;
color: #808080; color: #808080;
} }
.product-con .store-info .praise .iconfont {
.product-con .store-info .praise .iconfont {
font-size: 0.28 * 100rpx; font-size: 0.28 * 100rpx;
} }
.product-con .superior { .product-con .superior {
background-color: #fff; background-color: #fff;
margin-top: 0.2 * 100rpx; margin-top: 0.2 * 100rpx;
} }
.product-con .superior .title { .product-con .superior .title {
height: 0.98 * 100rpx; height: 0.98 * 100rpx;
} }
.product-con .superior .title image { .product-con .superior .title image {
width: 0.3 * 100rpx; width: 0.3 * 100rpx;
height: 0.3 * 100rpx; height: 0.3 * 100rpx;
} }
.product-con .superior .title .titleTxt { .product-con .superior .title .titleTxt {
margin: 0 0.2 * 100rpx; margin: 0 0.2 * 100rpx;
font-size: 0.3 * 100rpx; font-size: 0.3 * 100rpx;
background-image: linear-gradient(to right, #f57a37 0%, #f21b07 100%); background-image: linear-gradient(to right, #f57a37 0%, #f21b07 100%);
@ -855,69 +906,67 @@ export default {
background-image: -moz-linear-gradient(to right, #f57a37 0%, #f21b07 100%); background-image: -moz-linear-gradient(to right, #f57a37 0%, #f21b07 100%);
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
} }
.product-con .superior .slider-banner { .product-con .superior .slider-banner {
width: 6.9 * 100rpx; width: 6.9 * 100rpx;
margin: 0 auto; margin: 0 auto;
padding-bottom: 0.2 * 100rpx; padding-bottom: 0.2 * 100rpx;
} }
.product-con .superior .slider-banner .list { .product-con .superior .slider-banner .list {
width: 100%; width: 100%;
padding-bottom: 0.2 * 100rpx; padding-bottom: 0.2 * 100rpx;
} }
.product-con .superior .slider-banner .list .item { .product-con .superior .slider-banner .list .item {
width: 2.15 * 100rpx; width: 2.15 * 100rpx;
margin: 0 0.22 * 100rpx 0.3 * 100rpx 0; margin: 0 0.22 * 100rpx 0.3 * 100rpx 0;
font-size: 0.26 * 100rpx; font-size: 0.26 * 100rpx;
} }
.product-con .superior .slider-banner .list .item:nth-of-type(3n) { .product-con .superior .slider-banner .list .item:nth-of-type(3n) {
margin-right: 0; margin-right: 0;
} }
.product-con .superior .slider-banner .list .item .pictrue { .product-con .superior .slider-banner .list .item .pictrue {
width: 100%; width: 100%;
height: 2.15 * 100rpx; height: 2.15 * 100rpx;
} }
.product-con .superior .slider-banner .list .item .pictrue image { .product-con .superior .slider-banner .list .item .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 0.06 * 100rpx; border-radius: 0.06 * 100rpx;
} }
.product-con .superior .slider-banner .list .item .name { .product-con .superior .slider-banner .list .item .name {
color: #282828; color: #282828;
margin-top: 0.12 * 100rpx; margin-top: 0.12 * 100rpx;
} }
.product-con .superior .slider-banner .swiper-pagination-bullet { .product-con .superior .slider-banner .swiper-pagination-bullet {
background-color: #999; background-color: #999;
} }
.product-con .superior .slider-banner .swiper-pagination-bullet-active { .product-con .superior .slider-banner .swiper-pagination-bullet-active {
background-color: #e93323; background-color: #e93323;
} }
.mask { .mask {
-webkit-filter: blur(2px); -webkit-filter: blur(2px);
-moz-filter: blur(2px); -moz-filter: blur(2px);
-ms-filter: blur(2px); -ms-filter: blur(2px);
filter: blur(2px); filter: blur(2px);
} }
.footer .icon-shoucang1 {
color: #eb3729;
}
.product-con .product-intro .conter view {
.product-con .product-intro .conter view {
width: 100% !important; width: 100% !important;
} }
.generate-posters { .generate-posters {
width: 100%; width: 100%;
height: 1.7 * 100rpx; height: 1.7 * 100rpx;
background-color: #fff; background-color: #fff;
@ -934,34 +983,34 @@ export default {
-webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); -webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
-moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); -moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
-o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); -o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
} }
.generate-posters.on { .generate-posters.on {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0);
} }
.generate-posters .item { .generate-posters .item {
flex: 50%; flex: 50%;
-webkit-flex: 50%; -webkit-flex: 50%;
-ms-flex: 50%; -ms-flex: 50%;
text-align: center; text-align: center;
} }
.generate-posters .item .iconfont { .generate-posters .item .iconfont {
font-size: 0.8 * 100rpx; font-size: 0.8 * 100rpx;
color: #5eae72; color: #5eae72;
} }
.generate-posters .item .iconfont.icon-haibao { .generate-posters .item .iconfont.icon-haibao {
color: #5391f1; color: #5391f1;
} }
.noscroll { .noscroll {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
</style> </style>

102
pages/shop/GoodsFoot/index.vue

@ -0,0 +1,102 @@
<template>
<view ref="container">
<view class="collectionGoods" v-if="collectProductList.length > 0">
<view
class="item acea-row row-between-wrapper"
v-for="(item, collectProductListIndex) in collectProductList"
:key="collectProductListIndex"
@click="goGoodsCon(item)"
>
<view class="pictrue">
<image :src="item.image" />
</view>
<view class="text acea-row row-column-between">
<view class="infor line1">{{ item.storeName }}</view>
<view class="acea-row row-between-wrapper">
<view class="money font-color-red">{{ item.price }}</view>
<view class="delete" @tap.stop="delCollection(collectProductListIndex)">删除</view>
</view>
</view>
</view>
</view>
<Loading :loaded="loadend" :loading="loading"></Loading>
<view
class="noCommodity"
style="background-color:#fff;"
v-if="collectProductList.length < 1 && page > 1"
>
<view class="noPictrue">
<image src="@/static/images/noCollection.png" class="image" />
</view>
<Recommend></Recommend>
</view>
</view>
</template>
<script>
import Recommend from "@/components/Recommend";
import { getCollectUser, getCollectDel } from "@/api/user";
import Loading from "@/components/Loading";
export default {
name: "GoodsFoot",
components: {
Recommend,
Loading
},
props: {},
data: function() {
return {
page: 1,
limit: 20,
type:'foot',
collectProductList: [],
loadTitle: "",
loading: false,
loadend: false
};
},
mounted: function() {
this.get_user_collect_product();
},
onReachBottom() {
!this.loading && this.get_user_collect_product();
},
methods: {
goGoodsCon(item) {
this.$yrouter.push({
path: "/pages/shop/GoodsCon/index",
query: { id: item.pid }
});
},
get_user_collect_product: function() {
let that = this;
if (that.loading) return; //false
if (that.loadend) return; //false
that.loading = true;
getCollectUser(that.page, that.limit,that.type).then(res => {
that.loading = false;
//apply();js;
that.collectProductList.push.apply(that.collectProductList, res.data);
that.loadend = res.data.length < that.limit; //
that.page = that.page + 1;
});
},
//
delCollection: function(index) {
let that = this,
id = that.collectProductList[index].pid,
category = that.collectProductList[index].category;
getCollectDel(id, category).then(function() {
uni.showToast({
title: "删除成功",
icon: "success",
duration: 2000,
complete: () => {
that.collectProductList.splice(index, 1);
that.$set(that, "collectProductList", that.collectProductList);
}
});
});
}
}
};
</script>

182
pages/shop/Live/LiveList/index.vue

@ -0,0 +1,182 @@
<template>
<view class="page_box">
<view class="head_box">
<view class="live-tab">
<view class="live-tab__item" v-for="tab in liveTab" :key="tab.title" @tap="selTab(tab)">
<view class="live-tab__item-name">{{ tab.name }}</view>
<text class="live-tab__item--link" :class="{ 'live-tab__item--active': tabCur == tab.title }"></text>
</view>
</view>
</view>
<view class="content_box">
<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-box">
<view class="list-box">
<block v-for="live in liveList" :key="live.roomId">
<shop-live-card :detail="live"></shop-live-card>
</block>
</view>
<view v-if="liveList.length" class="cu-load text-gray" :class="loadStatus"></view>
</scroll-view>
</view>
<Loading :loaded="loaded" :loading="loading"></Loading>
</view>
</template>
<script>
import {
yxWechatLive
} from "@/api/live";
import ShopLiveCard from '@/components/ShopLiveCard.vue'
import Loading from "@/components/Loading";
export default {
components: {
ShopLiveCard,
Loading
},
data() {
return {
tabCur: 'all',
liveStatus: '',
loaded: false,
loading: false,
liveTab: [{
title: 'all',
name: '全部',
code: ''
},
{
title: 'prevue',
name: '预告',
code: '102'
},
{
title: 'living',
name: '直播中',
code: '101'
},
{
title: 'lived',
name: '已结束',
code: '103'
}
],
liveList: [],
loadStatus: '', //loading,over
currentPage: 0,
size: 10,
lastPage: 0
};
},
computed: {},
onLoad() {
this.getLiveList();
},
onHide() {},
methods: {
// tab
selTab(tab) {
console.log(tab)
this.tabCur = tab.title;
this.liveStatus = tab.code;
this.liveList = [];
this.loaded=false;
this.loading=false;
this.getLiveListTab();
},
//
getLiveListTab() {
let that = this;
yxWechatLive({
liveStatus: that.liveStatus,
page: 0,
size: that.size
}).then(res => {
that.liveList = [...that.liveList, ...res.data.content];
that.lastPage = res.data.lastPage;
this.loaded = res.data.content.length < that.size;
this.loading = false;
});
},
//
getLiveList() {
let that = this;
if (this.loading || this.loaded) return;
this.loading = true;
yxWechatLive({
liveStatus: this.liveStatus,
page: this.currentPage,
size: this.size
}).then(res => {
that.liveList = that.liveList.concat(res.data.content)
this.currentPage++;
this.loaded = res.data.content.length < that.size;
this.loading = false;
});
}
},
onReachBottom() {
!this.loading && this.getLiveList();
}
};
</script>
<style lang="scss">
// tab
.live-tab {
width: 100%;
height: 96rpx;
background: #fff;
display: flex;
align-items: center;
&__item {
flex: 1;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
&__item-name {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(51, 51, 51, 1);
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
&__item--link {
width: 68rpx;
height: 4rpx;
background: transparent;
border-radius: 2rpx;
}
&__item--active {
width: 68rpx;
height: 4rpx;
background: rgba(213, 166, 90, 1);
border-radius: 2rpx;
}
}
// list
.scroll-box {
.list-box {
width: 100%;
-moz-column-count: 2;
-webkit-column-count: 2;
column-count: 2;
padding: 25rpx;
}
}
</style>

141
pages/shop/ShoppingCart/index.vue

@ -17,19 +17,13 @@
购物数量 购物数量
<text class="num font-color-red">{{ count }}</text> <text class="num font-color-red">{{ count }}</text>
</view> </view>
<view <view v-if="cartList.valid.length > 0" class="administrate acea-row row-center-wrapper" @click="manage">
v-if="cartList.valid.length > 0" {{ footerswitch ? '取消' : '管理' }}</view>
class="administrate acea-row row-center-wrapper"
@click="manage"
>{{ footerswitch ? '取消' : '管理' }}</view>
</view> </view>
<view v-if="validList.length > 0 || cartList.invalid.length > 0"> <view v-if="validList.length > 0 || cartList.invalid.length > 0">
<view class="list"> <view class="list">
<view <view class="item acea-row row-between-wrapper" v-for="(item, cartListValidIndex) in validList"
class="item acea-row row-between-wrapper" :key="cartListValidIndex">
v-for="(item, cartListValidIndex) in validList"
:key="cartListValidIndex"
>
<view class="select-btn"> <view class="select-btn">
<view class="checkbox-wrapper"> <view class="checkbox-wrapper">
<checkbox-group @change="switchSelect(cartListValidIndex)"> <checkbox-group @change="switchSelect(cartListValidIndex)">
@ -46,31 +40,19 @@
</view> </view>
<view class="text"> <view class="text">
<view class="line1">{{ item.productInfo.storeName }}</view> <view class="line1">{{ item.productInfo.storeName }}</view>
<view <view class="infor line1" v-if="item.productInfo.attrInfo">属性{{ item.productInfo.attrInfo.sku }}</view>
class="infor line1"
v-if="item.productInfo.attrInfo"
>属性{{ item.productInfo.attrInfo.sku }}</view>
<view class="money">{{ item.truePrice }}</view> <view class="money">{{ item.truePrice }}</view>
</view> </view>
<view class="carnum acea-row row-center-wrapper"> <view class="carnum acea-row row-center-wrapper">
<view <view class="reduce" :class="validList[cartListValidIndex].cartNum <= 1 ? 'on' : ''"
class="reduce" @click.prevent="reduce(cartListValidIndex)">-</view>
:class="validList[cartListValidIndex].cartNum <= 1 ? 'on' : ''"
@click.prevent="reduce(cartListValidIndex)"
>-</view>
<view class="num">{{ item.cartNum }}</view> <view class="num">{{ item.cartNum }}</view>
<view <view class="plus" v-if="validList[cartListValidIndex].attrInfo"
class="plus"
v-if="validList[cartListValidIndex].attrInfo"
:class="validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].attrInfo.stock ? 'on' : ''" :class="validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].attrInfo.stock ? 'on' : ''"
@click.prevent="plus(cartListValidIndex)" @click.prevent="plus(cartListValidIndex)">+</view>
>+</view> <view class="plus" v-else
<view
class="plus"
v-else
:class="validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].stock ? 'on' : ''" :class="validList[cartListValidIndex].cartNum >= validList[cartListValidIndex].stock ? 'on' : ''"
@click.prevent="plus(cartListValidIndex)" @click.prevent="plus(cartListValidIndex)">+</view>
>+</view>
</view> </view>
</view> </view>
</view> </view>
@ -78,25 +60,15 @@
<view class="invalidGoods" v-if="cartList.invalid.length > 0"> <view class="invalidGoods" v-if="cartList.invalid.length > 0">
<view class="goodsNav acea-row row-between-wrapper"> <view class="goodsNav acea-row row-between-wrapper">
<view @click="goodsOpen"> <view @click="goodsOpen">
<text <text class="iconfont" :class="goodsHidden === true ? 'icon-xiangyou' : 'icon-xiangxia'"></text>失效商品
class="iconfont"
:class="goodsHidden === true ? 'icon-xiangyou' : 'icon-xiangxia'"
></text>失效商品
</view> </view>
<view class="del" @click="delInvalidGoods"> <view class="del" @click="delInvalidGoods">
<text class="iconfont icon-shanchu1"></text>清空 <text class="iconfont icon-shanchu1"></text>清空
</view> </view>
</view> </view>
<view class="goodsList" :hidden="goodsHidden"> <view class="goodsList" :hidden="goodsHidden">
<view <view v-for="(item, cartListinvalidIndex) in cartList.invalid" :key="cartListinvalidIndex">
v-for="(item, cartListinvalidIndex) in cartList.invalid" <view @click="goGoodsCon(item)" class="item acea-row row-between-wrapper" v-if="item.productInfo">
:key="cartListinvalidIndex"
>
<view
@click="goGoodsCon(item)"
class="item acea-row row-between-wrapper"
v-if="item.productInfo"
>
<view class="invalid acea-row row-center-wrapper">失效</view> <view class="invalid acea-row row-center-wrapper">失效</view>
<view class="pictrue"> <view class="pictrue">
<image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo" /> <image :src="item.productInfo.attrInfo.image" v-if="item.productInfo.attrInfo" />
@ -104,10 +76,8 @@
</view> </view>
<view class="text acea-row row-column-between"> <view class="text acea-row row-column-between">
<view class="line1">{{ item.productInfo.storeName }}</view> <view class="line1">{{ item.productInfo.storeName }}</view>
<view <view class="infor line1" v-if="item.productInfo.attrInfo">属性{{ item.productInfo.attrInfo.sku }}
class="infor line1" </view>
v-if="item.productInfo.attrInfo"
>属性{{ item.productInfo.attrInfo.sku }}</view>
<view class="acea-row row-between-wrapper"> <view class="acea-row row-between-wrapper">
<view class="end">该商品已下架</view> <view class="end">该商品已下架</view>
</view> </view>
@ -160,34 +130,41 @@
</view> </view>
</view> </view>
</view> </view>
<Authorization v-if="!$store.getters.token" /> <Authorization v-else />
</view> </view>
</template> </template>
<script> <script>
import Recommend from "@/components/Recommend"; import Recommend from "@/components/Recommend";
import Authorization from "@/pages/authorization/index"; import Authorization from "@/pages/authorization/index";
import { mapGetters } from "vuex"; import {
mapGetters
} from "vuex";
import { import {
getCartList, getCartList,
postCartDel, postCartDel,
changeCartNum, changeCartNum,
getCartCount getCartCount
} from "@/api/store"; } from "@/api/store";
import { postCollectAll } from "@/api/user"; import {
import { mul, add } from "@/utils/bc"; postCollectAll
import cookie from "@/utils/store/cookie"; } from "@/api/user";
import {
mul,
add
} from "@/utils/bc";
import cookie from "@/utils/store/cookie";
const CHECKED_IDS = "cart_checked"; const CHECKED_IDS = "cart_checked";
export default { export default {
name: "ShoppingCart", name: "ShoppingCart",
components: { components: {
Recommend, Recommend,
Authorization Authorization
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
cartList: { cartList: {
invalid: [], invalid: [],
@ -242,7 +219,7 @@ export default {
this.validList = list.valid; this.validList = list.valid;
} }
}, },
onShow: function() { onShow: function () {
if (this.userInfo.uid) { if (this.userInfo.uid) {
this.carnum(); this.carnum();
this.countMoney(); this.countMoney();
@ -259,7 +236,7 @@ export default {
} }
}); });
}, },
getCartList: function() { getCartList: function () {
let that = this; let that = this;
getCartList().then(res => { getCartList().then(res => {
that.cartList = res.data; that.cartList = res.data;
@ -278,12 +255,12 @@ export default {
}); });
}, },
// //
delgoods: function() { delgoods: function () {
let that = this, let that = this,
id = [], id = [],
valid = [], valid = [],
list = that.cartList.valid; list = that.cartList.valid;
list.forEach(function(val) { list.forEach(function (val) {
if (val.checked === true) { if (val.checked === true) {
id.push(val.id); id.push(val.id);
} }
@ -296,8 +273,8 @@ export default {
}); });
return; return;
} }
postCartDel(id).then(function() { postCartDel(id).then(function () {
list.forEach(function(val, i) { list.forEach(function (val, i) {
if (val.checked === false || val.checked === undefined) if (val.checked === false || val.checked === undefined)
valid.push(list[i]); valid.push(list[i]);
}); });
@ -309,35 +286,35 @@ export default {
}); });
}, },
// // // //
gainCount: function() { gainCount: function () {
let that = this; let that = this;
getCartCount().then(res => { getCartCount().then(res => {
that.count = res.data.count; that.count = res.data.count;
}); });
}, },
// //
delInvalidGoods: function() { delInvalidGoods: function () {
let that = this, let that = this,
id = [], id = [],
list = that.cartList.invalid; list = that.cartList.invalid;
list.forEach(function(val) { list.forEach(function (val) {
id.push(val.id); id.push(val.id);
}); });
postCartDel(id).then(function() { postCartDel(id).then(function () {
list.splice(0, list.length); list.splice(0, list.length);
that.gainCount(); that.gainCount();
that.getCartList(); that.getCartList();
}); });
}, },
//; //;
collectAll: function() { collectAll: function () {
let that = this, let that = this,
data = { data = {
id: [], id: [],
category: "" category: ""
}, },
list = that.cartList.valid; list = that.cartList.valid;
list.forEach(function(val) { list.forEach(function (val) {
if (val.checked === true) { if (val.checked === true) {
data.id.push(val.product_id); data.id.push(val.product_id);
data.category = val.type; data.category = val.type;
@ -351,7 +328,7 @@ export default {
}); });
return; return;
} }
postCollectAll(data).then(function() { postCollectAll(data).then(function () {
uni.showToast({ uni.showToast({
title: "收藏成功!", title: "收藏成功!",
icon: "none", icon: "none",
@ -360,11 +337,11 @@ export default {
}); });
}, },
// //
placeOrder: function() { placeOrder: function () {
let that = this, let that = this,
list = that.cartList.valid, list = that.cartList.valid,
id = []; id = [];
list.forEach(function(val) { list.forEach(function (val) {
if (val.checked === true) { if (val.checked === true) {
id.push(val.id); id.push(val.id);
} }
@ -384,16 +361,16 @@ export default {
} }
}); });
}, },
manage: function() { manage: function () {
let that = this; let that = this;
that.footerswitch = !that.footerswitch; that.footerswitch = !that.footerswitch;
}, },
goodsOpen: function() { goodsOpen: function () {
let that = this; let that = this;
that.goodsHidden = !that.goodsHidden; that.goodsHidden = !that.goodsHidden;
}, },
// //
plus: function(index) { plus: function (index) {
let that = this; let that = this;
let list = that.cartList.valid[index]; let list = that.cartList.valid[index];
list.cartNum++; list.cartNum++;
@ -411,7 +388,7 @@ export default {
that.syncCartNum(list); that.syncCartNum(list);
}, },
// //
reduce: function(index) { reduce: function (index) {
let that = this; let that = this;
let list = that.cartList.valid[index]; let list = that.cartList.valid[index];
if (list.cartNum <= 1) { if (list.cartNum <= 1) {
@ -448,7 +425,7 @@ export default {
} }
}, },
// //
switchSelect: function(index) { switchSelect: function (index) {
let that = this, let that = this,
cart = that.cartList.valid[index], cart = that.cartList.valid[index],
i = this.checkedIds.indexOf(cart.id); i = this.checkedIds.indexOf(cart.id);
@ -474,7 +451,7 @@ export default {
that.countMoney(); that.countMoney();
}, },
// //
allChecked: function(e) { allChecked: function (e) {
console.log(e); console.log(e);
let that = this; let that = this;
let selectAllStatus = e.mp.detail.value[0] == "allSelect" ? true : false; let selectAllStatus = e.mp.detail.value[0] == "allSelect" ? true : false;
@ -506,7 +483,7 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
// //
carnum: function() { carnum: function () {
let that = this; let that = this;
var carnum = 0; var carnum = 0;
var array = that.cartList.valid; var array = that.cartList.valid;
@ -518,7 +495,7 @@ export default {
that.$set(that, "cartCount", carnum); that.$set(that, "cartCount", carnum);
}, },
// //
countMoney: function() { countMoney: function () {
let that = this; let that = this;
let carmoney = 0; let carmoney = 0;
let array = that.cartList.valid; let array = that.cartList.valid;
@ -530,5 +507,5 @@ export default {
that.countmoney = carmoney; that.countmoney = carmoney;
} }
} }
}; };
</script> </script>

19
pages/shop/StoreList/index.vue

@ -16,7 +16,7 @@
</view> </view>
<view class="row-right"> <view class="row-right">
<view> <view>
<a class="store-phone" :href="'tel:' + item.phone"> <a class="store-phone" @click="telPhone(item.phone)">
<text class="iconfont icon-dadianhua01"></text> <text class="iconfont icon-dadianhua01"></text>
</a> </a>
</view> </view>
@ -35,7 +35,7 @@
<script> <script>
import Loading from "@/components/Loading"; import Loading from "@/components/Loading";
import { storeListApi } from "@/api/store"; import { storeListApi } from "@/api/store";
import { isWeixin } from "@/utils/index"; import { isWeixin,tel } from "@/utils/index";
import { wechatEvevt, wxShowLocation } from "@/libs/wechat"; import { wechatEvevt, wxShowLocation } from "@/libs/wechat";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import cookie from "@/utils/store/cookie"; import cookie from "@/utils/store/cookie";
@ -79,6 +79,15 @@ export default {
this.$yrouter.back(); this.$yrouter.back();
} }
}, },
//
telPhone(phoneNumber) {
uni.makePhoneCall({
phoneNumber: phoneNumber,
fail() {
console.log("取消拨打");
}
});
},
// //
getList: function() { getList: function() {
if (this.loading || this.loaded) return; if (this.loading || this.loaded) return;
@ -98,7 +107,11 @@ export default {
this.mapKey = res.data.mapKey; this.mapKey = res.data.mapKey;
}) })
.catch(err => { .catch(err => {
this.$dialog.error(err.msg); uni.showToast({
title: err.msg,
icon: "none",
duration: 2000,
});
}); });
} }
} }

109
pages/user/Login/index.vue

@ -1,19 +1,9 @@
<template> <template>
<view class="register absolute"> <view class="register absolute">
<view class="shading">
<view class="pictrue acea-row row-center-wrapper">
<image src="@/static/images/logo.png" />
</view>
</view>
<view class="whiteBg" v-if="formItem === 1"> <view class="whiteBg" v-if="formItem === 1">
<view class="title acea-row row-center-wrapper"> <view class="title acea-row row-between-wrapper">
<view <view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
class="item" @click="navTap(index)" :key="index">{{ item }}</view>
:class="current === index ? 'on' : ''"
v-for="(item, index) in navList"
@click="navTap(index)"
:key="index"
>{{ item }}</view>
</view> </view>
<view class="list" :hidden="current !== 0"> <view class="list" :hidden="current !== 0">
<form @submit.prevent="submit"> <form @submit.prevent="submit">
@ -50,12 +40,8 @@
<use xlink:href="#icon-code_1" /> <use xlink:href="#icon-code_1" />
</svg>--> </svg>-->
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" /> <input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
class="code" @click="code">{{ text }}</button>
:disabled="disabled"
:class="disabled === true ? 'on' : ''"
@click="code"
>{{ text }}</button>
</view> </view>
</view> </view>
</view> </view>
@ -67,7 +53,9 @@
</view> </view>
</view> </view>
<view class="whiteBg" v-else> <view class="whiteBg" v-else>
<view class="title">注册账号</view> <view class="title acea-row row-between-wrapper">
<view class="item on">注册账号</view>
</view>
<view class="list"> <view class="list">
<view class="item"> <view class="item">
<view> <view>
@ -83,12 +71,8 @@
<use xlink:href="#icon-code_1" /> <use xlink:href="#icon-code_1" />
</svg>--> </svg>-->
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" /> <input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
class="code" @click="code">{{ text }}</button>
:disabled="disabled"
:class="disabled === true ? 'on' : ''"
@click="code"
>{{ text }}</button>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
@ -99,6 +83,7 @@
<input type="password" placeholder="填写您的登录密码" v-model="password" /> <input type="password" placeholder="填写您的登录密码" v-model="password" />
</view> </view>
</view> </view>
<!-- #ifndef H5 -->
<view class="item"> <view class="item">
<view> <view>
<!-- <svg class="icon" aria-hidden="true"> <!-- <svg class="icon" aria-hidden="true">
@ -107,6 +92,8 @@
<input type="text" placeholder="输入邀请码" v-model="inviteCode" /> <input type="text" placeholder="输入邀请码" v-model="inviteCode" />
</view> </view>
</view> </view>
<!-- #endif -->
</view> </view>
<view class="logon" @click="register">注册</view> <view class="logon" @click="register">注册</view>
<view class="tip"> <view class="tip">
@ -114,25 +101,37 @@
<text @click="formItem = 1" class="font-color-red">立即登录</text> <text @click="formItem = 1" class="font-color-red">立即登录</text>
</view> </view>
</view> </view>
<view class="bottom"></view>
</view> </view>
</template> </template>
<script> <script>
import sendVerifyCode from "@/mixins/SendVerifyCode"; import sendVerifyCode from "@/mixins/SendVerifyCode";
import { login, loginMobile, registerVerify, register } from "@/api/user"; import {
import attrs, { required, alpha_num, chs_phone } from "@/utils/validate"; login,
import { validatorDefaultCatch } from "@/utils/dialog"; loginMobile,
import dayjs from "dayjs"; registerVerify,
import cookie from "@/utils/store/cookie"; register
} from "@/api/user";
import attrs, {
required,
alpha_num,
chs_phone
} from "@/utils/validate";
import {
validatorDefaultCatch
} from "@/utils/dialog";
import dayjs from "dayjs";
import cookie from "@/utils/store/cookie";
import { handleGetUserInfo } from "@/utils"; import {
handleGetUserInfo
} from "@/utils";
const BACK_URL = "login_back_url"; const BACK_URL = "login_back_url";
export default { export default {
name: "Login", name: "Login",
mixins: [sendVerifyCode], mixins: [sendVerifyCode],
data: function() { data: function () {
return { return {
navList: ["账号登录"], navList: ["账号登录"],
current: 0, current: 0,
@ -147,7 +146,10 @@ export default {
methods: { methods: {
async loginMobile() { async loginMobile() {
var that = this; var that = this;
const { account, captcha } = that; const {
account,
captcha
} = that;
try { try {
await that await that
.$validator({ .$validator({
@ -179,7 +181,7 @@ export default {
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
@ -187,7 +189,11 @@ export default {
}, },
async register() { async register() {
var that = this; var that = this;
const { account, captcha, password } = that; const {
account,
captcha,
password
} = that;
try { try {
await that await that
.$validator({ .$validator({
@ -230,7 +236,7 @@ export default {
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
@ -238,7 +244,9 @@ export default {
}, },
async code() { async code() {
var that = this; var that = this;
const { account } = that; const {
account
} = that;
try { try {
await that await that
.$validator({ .$validator({
@ -268,17 +276,20 @@ export default {
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
}); });
}, },
navTap: function(index) { navTap: function (index) {
this.current = index; this.current = index;
}, },
async submit() { async submit() {
const { account, password } = this; const {
account,
password
} = this;
try { try {
await this.$validator({ await this.$validator({
account: [ account: [
@ -304,7 +315,9 @@ export default {
password, password,
spread: cookie.get("spread") spread: cookie.get("spread")
}) })
.then(({ data }) => { .then(({
data
}) => {
this.$store.commit("login", data.token, dayjs(data.expires_time)); this.$store.commit("login", data.token, dayjs(data.expires_time));
handleGetUserInfo(); handleGetUserInfo();
// let replace=this.$yroute.query.replace // let replace=this.$yroute.query.replace
@ -318,12 +331,12 @@ export default {
.catch(err => { .catch(err => {
console.log(err); console.log(err);
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
}); });
} }
} }
}; };
</script> </script>

9
pages/user/PersonalData/index.vue

@ -43,20 +43,23 @@
<input type="text" v-else value="未绑定" disabled class="id" /> <input type="text" v-else value="未绑定" disabled class="id" />
</view> </view>
</view> </view>
<!-- <view class="item acea-row row-between-wrapper" @click="goChangePassword()"> <!--
<view class="item acea-row row-between-wrapper" @click="goChangePassword()">
<view>密码</view> <view>密码</view>
<view class="input acea-row row-between-wrapper"> <view class="input acea-row row-between-wrapper">
<text>点击修改密码</text> <text>点击修改密码</text>
<text class="iconfont icon-suozi"></text> <text class="iconfont icon-suozi"></text>
</view> </view>
</view>--> </view>
-->
</view> </view>
<view class="modifyBnt bg-color-red" @click="submit">保存修改</view> <view class="modifyBnt bg-color-red" @click="submit">保存修改</view>
<!-- #ifndef MP-WEIXIN -->
<view <view
class="logOut cart-color acea-row row-center-wrapper" class="logOut cart-color acea-row row-center-wrapper"
@click="logout" @click="logout"
v-if="$deviceType!='routine'"
>退出登录</view> >退出登录</view>
<!-- #endif -->
</view> </view>
</template> </template>
<script> <script>

195
pages/user/Recharge/index.vue

@ -15,23 +15,16 @@
</view> </view>
<view class="info-wrapper"> <view class="info-wrapper">
<view class="picList acea-row row-between mt-20"> <view class="picList acea-row row-between mt-20">
<view <view class="pic-box pic-box-color acea-row row-center-wrapper row-column"
class="pic-box pic-box-color acea-row row-center-wrapper row-column" :class="activePic === index ? 'pic-box-color-active' : ''" v-for="(item, index) in picList" :key="index"
:class="activePic === index ? 'pic-box-color-active' : ''" @click="picCharge(index, item)">
v-for="(item, index) in picList"
:key="index"
@click="picCharge(index, item)"
>
<view class="pic-number-pic"> <view class="pic-number-pic">
<text> <text>
{{ item.value.price }} {{ item.value.price }}
<text class="pic-number"></text> <text class="pic-number"></text>
</text> </text>
</view> </view>
<view <view class="pic-number" v-if="item.value.give_price > 0">赠送{{ item.value.give_price }} </view>
class="pic-number"
v-if="item.value.give_price > 0"
>赠送{{ item.value.give_price }} </view>
</view> </view>
<!-- <view <!-- <view
class="pic-box pic-box-color acea-row row-center-wrapper" class="pic-box pic-box-color acea-row row-center-wrapper"
@ -52,12 +45,26 @@
</view> </view>
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import {
import { weappPay } from "@/libs/wechat"; mapGetters
import { rechargeWechat, getRechargeApi } from "@/api/user"; } from "vuex";
import { add, sub } from "@/utils/bc"; import {
weappPay
} from "@/libs/wechat";
import {
rechargeWechat,
getRechargeApi
} from "@/api/user";
import {
add,
sub
} from "@/utils/bc";
import {
subscribeMessage
} from "@/libs/order";
export default { export default {
name: "Recharge", name: "Recharge",
components: {}, components: {},
props: {}, props: {},
@ -95,8 +102,7 @@ export default {
}) })
.catch((res) => { .catch((res) => {
uni.showToast({ uni.showToast({
title: title: err.msg || err.response.data.msg || err.response.data.message,
err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
@ -154,7 +160,7 @@ export default {
} }
rechargeWechat({ rechargeWechat({
price: prices, price: prices,
from: that.from, from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType,
paid_price: paid_price, paid_price: paid_price,
rechar_id: that.rechar_id, rechar_id: that.rechar_id,
}) })
@ -170,6 +176,9 @@ export default {
icon: "success", icon: "success",
duration: 2000, duration: 2000,
}); });
// #ifdef MP-WEIXIN
subscribeMessage()
// #endif
this.$yrouter.back(); this.$yrouter.back();
}) })
.finally((res) => { .finally((res) => {
@ -191,33 +200,36 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
uni.showToast({ uni.showToast({
title: title: err.msg || err.response.data.msg || err.response.data.message,
err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
}); });
}, },
}, },
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
#iframe { #iframe {
display: none; display: none;
} }
.pic-box-color-active {
.pic-box-color-active {
background-color: #eb3729 !important; background-color: #eb3729 !important;
color: #fff !important; color: #fff !important;
} }
.picList {
.picList {
margin-bottom: 0.3 * 100rpx; margin-bottom: 0.3 * 100rpx;
margin-top: 0.3 * 100rpx; margin-top: 0.3 * 100rpx;
} }
.font-color {
.font-color {
color: #e83323; color: #e83323;
} }
.recharge {
.recharge {
border-radius: 0.1 * 100rpx; border-radius: 0.1 * 100rpx;
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
@ -227,34 +239,40 @@ export default {
border-top-left-radius: 0.39 * 100rpx; border-top-left-radius: 0.39 * 100rpx;
margin-top: -0.45 * 100rpx; margin-top: -0.45 * 100rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.recharge .nav {
.recharge .nav {
height: 0.75 * 100rpx; height: 0.75 * 100rpx;
line-height: 0.75 * 100rpx; line-height: 0.75 * 100rpx;
padding: 0 1 * 100rpx; padding: 0 1 * 100rpx;
} }
.recharge .nav .item {
.recharge .nav .item {
font-size: 0.3 * 100rpx; font-size: 0.3 * 100rpx;
color: #333; color: #333;
} }
.recharge .nav .item.on {
.recharge .nav .item.on {
font-weight: bold; font-weight: bold;
border-bottom: 0.04 * 100rpx solid #e83323; border-bottom: 0.04 * 100rpx solid #e83323;
} }
.recharge .info-wrapper {
} .recharge .info-wrapper {}
.recharge .info-wrapper .money {
.recharge .info-wrapper .money {
margin-top: 0.6 * 100rpx; margin-top: 0.6 * 100rpx;
padding-bottom: 0.2 * 100rpx; padding-bottom: 0.2 * 100rpx;
border-bottom: 1px dashed #ddd; border-bottom: 1px dashed #ddd;
text-align: center; text-align: center;
} }
.recharge .info-wrapper .money span {
.recharge .info-wrapper .money span {
font-size: 0.56 * 100rpx; font-size: 0.56 * 100rpx;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
.recharge .info-wrapper .money input {
.recharge .info-wrapper .money input {
display: inline-block; display: inline-block;
width: 3 * 100rpx; width: 3 * 100rpx;
font-size: 0.84 * 100rpx; font-size: 0.84 * 100rpx;
@ -262,32 +280,40 @@ export default {
color: #282828; color: #282828;
font-weight: bold; font-weight: bold;
padding-right: 0.7 * 100rpx; padding-right: 0.7 * 100rpx;
} }
.recharge .info-wrapper .money input::placeholder {
.recharge .info-wrapper .money input::placeholder {
color: #ddd; color: #ddd;
} }
.recharge .info-wrapper .money input::-webkit-input-placeholder {
.recharge .info-wrapper .money input::-webkit-input-placeholder {
color: #ddd; color: #ddd;
} }
.recharge .info-wrapper .money input:-moz-placeholder {
.recharge .info-wrapper .money input:-moz-placeholder {
color: #ddd; color: #ddd;
} }
.recharge .info-wrapper .money input::-moz-placeholder {
.recharge .info-wrapper .money input::-moz-placeholder {
color: #ddd; color: #ddd;
} }
.recharge .info-wrapper .money input:-ms-input-placeholder {
.recharge .info-wrapper .money input:-ms-input-placeholder {
color: #ddd; color: #ddd;
} }
.tip {
.tip {
font-size: 0.28 * 100rpx; font-size: 0.28 * 100rpx;
color: #333333; color: #333333;
font-weight: 800; font-weight: 800;
margin-bottom: 0.14 * 100rpx; margin-bottom: 0.14 * 100rpx;
} }
.recharge .info-wrapper .tips span {
.recharge .info-wrapper .tips span {
color: #ef4a49; color: #ef4a49;
} }
.recharge .info-wrapper .pay-btn {
.recharge .info-wrapper .pay-btn {
display: block; display: block;
width: 100%; width: 100%;
height: 0.86 * 100rpx; height: 0.86 * 100rpx;
@ -298,47 +324,56 @@ export default {
border-radius: 0.5 * 100rpx; border-radius: 0.5 * 100rpx;
font-size: 0.3 * 100rpx; font-size: 0.3 * 100rpx;
font-weight: bold; font-weight: bold;
} }
.payment-top {
.payment-top {
width: 100%; width: 100%;
height: 3.5 * 100rpx; height: 3.5 * 100rpx;
background-color: #eb3729; background-color: #eb3729;
} }
.payment-top .name {
.payment-top .name {
font-size: 0.26 * 100rpx; font-size: 0.26 * 100rpx;
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
margin-top: -0.38 * 100rpx; margin-top: -0.38 * 100rpx;
margin-bottom: 0.3 * 100rpx; margin-bottom: 0.3 * 100rpx;
} }
.payment-top .pic {
.payment-top .pic {
font-size: 0.32 * 100rpx; font-size: 0.32 * 100rpx;
color: #fff; color: #fff;
} }
.payment-top .pic-font {
.payment-top .pic-font {
font-size: 0.78 * 100rpx; font-size: 0.78 * 100rpx;
color: #fff; color: #fff;
} }
.picList .pic-box {
.picList .pic-box {
width: 32%; width: 32%;
height: auto; height: auto;
border-radius: 0.2 * 100rpx; border-radius: 0.2 * 100rpx;
margin-top: 0.21 * 100rpx; margin-top: 0.21 * 100rpx;
padding: 0.2 * 100rpx 0; padding: 0.2 * 100rpx 0;
} }
.pic-box-color {
.pic-box-color {
background-color: #f4f4f4; background-color: #f4f4f4;
color: #656565; color: #656565;
} }
.pic-number {
.pic-number {
font-size: 0.22 * 100rpx; font-size: 0.22 * 100rpx;
} }
.pic-number-pic {
.pic-number-pic {
font-size: 0.38 * 100rpx; font-size: 0.38 * 100rpx;
margin-right: 0.1 * 100rpx; margin-right: 0.1 * 100rpx;
text-align: center; text-align: center;
} }
.pic-box-money {
.pic-box-money {
width: 100%; width: 100%;
display: block; display: block;
} }
</style> </style>

134
pages/user/User/index.vue

@ -18,14 +18,17 @@
<text>ID{{ userInfo.uid || 0}}</text> <text>ID{{ userInfo.uid || 0}}</text>
<text class="iconfont icon-bianji1"></text> <text class="iconfont icon-bianji1"></text>
</view> </view>
<button <!-- #ifdef MP-WEIXIN -->
open-type="getPhoneNumber" <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else>
@getphonenumber="getPhoneNumber"
class="binding"
v-else
>
<text>绑定手机号</text> <text>绑定手机号</text>
</button> </button>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<button class="binding" @click="goBindPhone()" v-else>
<text>绑定手机号</text>
</button>
<!-- #endif -->
</view> </view>
</view> </view>
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text> <text class="iconfont icon-shezhi" @click="goPersonalData()"></text>
@ -36,11 +39,7 @@
<text>我的余额</text> <text>我的余额</text>
<text class="num">{{ userInfo.nowMoney || 0 }}</text> <text class="num">{{ userInfo.nowMoney || 0 }}</text>
</view> </view>
<view <view @click="goUserPromotion()" class="item" v-if="userInfo.isPromoter === 1 || userInfo.statu === 2">
@click="goUserPromotion()"
class="item"
v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"
>
<text>当前佣金</text> <text>当前佣金</text>
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text> <text class="num">{{ userInfo.brokeragePrice || 0 }}</text>
</view> </view>
@ -65,50 +64,40 @@
<view @click="goMyOrder(0)" class="item"> <view @click="goMyOrder(0)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dfk.png" /> <image src="@/static/images/dfk.png" />
<text <text class="order-status-num"
class="order-status-num" v-if="userInfo.orderStatusNum.unpaidCount > 0">{{ userInfo.orderStatusNum.unpaidCount }}</text>
v-if="userInfo.orderStatusNum.unpaidCount > 0"
>{{ userInfo.orderStatusNum.unpaidCount }}</text>
</view> </view>
<view>待付款</view> <view>待付款</view>
</view> </view>
<view @click="goMyOrder(1)" class="item"> <view @click="goMyOrder(1)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dfh.png" /> <image src="@/static/images/dfh.png" />
<text <text class="order-status-num"
class="order-status-num" v-if="userInfo.orderStatusNum.unshippedCount > 0">{{ userInfo.orderStatusNum.unshippedCount }}</text>
v-if="userInfo.orderStatusNum.unshippedCount > 0"
>{{ userInfo.orderStatusNum.unshippedCount }}</text>
</view> </view>
<view>待发货</view> <view>待发货</view>
</view> </view>
<view @click="goMyOrder(2)" class="item"> <view @click="goMyOrder(2)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dsh.png" /> <image src="@/static/images/dsh.png" />
<text <text class="order-status-num"
class="order-status-num" v-if="userInfo.orderStatusNum.receivedCount > 0">{{ userInfo.orderStatusNum.receivedCount }}</text>
v-if="userInfo.orderStatusNum.receivedCount > 0"
>{{ userInfo.orderStatusNum.receivedCount }}</text>
</view> </view>
<text>待收货</text> <text>待收货</text>
</view> </view>
<view @click="goMyOrder(3)" class="item"> <view @click="goMyOrder(3)" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/dpj.png" /> <image src="@/static/images/dpj.png" />
<text <text class="order-status-num"
class="order-status-num" v-if="userInfo.orderStatusNum.evaluatedCount > 0">{{ userInfo.orderStatusNum.evaluatedCount }}</text>
v-if="userInfo.orderStatusNum.evaluatedCount > 0"
>{{ userInfo.orderStatusNum.evaluatedCount }}</text>
</view> </view>
<text>待评价</text> <text>待评价</text>
</view> </view>
<view @click="goReturnList()" class="item"> <view @click="goReturnList()" class="item">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/sh.png" /> <image src="@/static/images/sh.png" />
<text <text class="order-status-num"
class="order-status-num" v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text>
v-if="userInfo.orderStatusNum.refundCount > 0"
>{{ userInfo.orderStatusNum.refundCount }}</text>
</view> </view>
<text>售后/退款</text> <text>售后/退款</text>
</view> </view>
@ -144,26 +133,38 @@
:login_type="userInfo.login_type" :login_type="userInfo.login_type"
></SwitchWindow>--> ></SwitchWindow>-->
</view> </view>
<Authorization v-if="!$store.getters.token" /> <Authorization v-else />
</view> </view>
</template> </template>
<script> <script>
import { mapState, mapGetters, mapMutations, mapActions } from "vuex"; import {
import { getUserInfo, getMenuUser, bindingPhone } from "@/api/user"; mapState,
import { isWeixin, VUE_APP_RESOURCES_URL } from "@/utils"; mapGetters,
import SwitchWindow from "@/components/SwitchWindow"; mapMutations,
import Authorization from "@/pages/authorization/index"; mapActions
} from "vuex";
import {
getUserInfo,
getMenuUser,
bindingPhone
} from "@/api/user";
import {
isWeixin,
VUE_APP_RESOURCES_URL
} from "@/utils";
import SwitchWindow from "@/components/SwitchWindow";
import Authorization from "@/pages/authorization/index";
const NAME = "User"; const NAME = "User";
export default { export default {
name: NAME, name: NAME,
components: { components: {
SwitchWindow, SwitchWindow,
Authorization Authorization
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
MyMenus: [], MyMenus: [],
switchActive: false, switchActive: false,
@ -184,6 +185,11 @@ export default {
} }
}); });
}, },
goBindPhone() {
this.$yrouter.push({
path: "/pages/user/BindingPhone/index",
});
},
goUserCoupon() { goUserCoupon() {
this.$yrouter.push("/pages/user/coupon/UserCoupon/index"); this.$yrouter.push("/pages/user/coupon/UserCoupon/index");
}, },
@ -201,7 +207,7 @@ export default {
goPersonalData() { goPersonalData() {
this.$yrouter.push("/pages/user/PersonalData/index"); this.$yrouter.push("/pages/user/PersonalData/index");
}, },
getPhoneNumber: function(e) { getPhoneNumber: function (e) {
let thit = this; let thit = this;
// //
if (e.mp.detail.errMsg == "getPhoneNumber:ok") { if (e.mp.detail.errMsg == "getPhoneNumber:ok") {
@ -211,7 +217,7 @@ export default {
// //
uni.getProvider({ uni.getProvider({
service: "oauth", service: "oauth",
success: function(res) { success: function (res) {
// h5 // h5
if (res.provider) { if (res.provider) {
uni.login({ uni.login({
@ -237,8 +243,7 @@ export default {
thit.$store.dispatch("userInfo", true); thit.$store.dispatch("userInfo", true);
console.log(error); console.log(error);
uni.showToast({ uni.showToast({
title: title: error.msg ||
error.msg ||
error.response.data.msg || error.response.data.msg ||
error.response.data.message, error.response.data.message,
icon: "none", icon: "none",
@ -264,17 +269,17 @@ export default {
}); });
} }
}, },
changeswitch: function(data) { changeswitch: function (data) {
this.switchActive = data; this.switchActive = data;
}, },
User: function() { User: function () {
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
that.user = res.data; that.user = res.data;
that.orderStatusNum = res.data.orderStatusNum; that.orderStatusNum = res.data.orderStatusNum;
}); });
}, },
MenuUser: function() { MenuUser: function () {
let that = this; let that = this;
getMenuUser() getMenuUser()
.then(res => { .then(res => {
@ -286,7 +291,7 @@ export default {
console.log(error); console.log(error);
}); });
}, },
goPages: function(index) { goPages: function (index) {
let url = this.MyMenus[index].uniapp_url; let url = this.MyMenus[index].uniapp_url;
if ( if (
url === "/pages/user/promotion/UserPromotion/index" && url === "/pages/user/promotion/UserPromotion/index" &&
@ -327,7 +332,7 @@ export default {
path: this.MyMenus[index].uniapp_url path: this.MyMenus[index].uniapp_url
}); });
}, },
goPages2: function() { goPages2: function () {
this.$yrouter.push({ this.$yrouter.push({
path: "/pages/orderAdmin/OrderCancellation/index" path: "/pages/orderAdmin/OrderCancellation/index"
}); });
@ -353,15 +358,15 @@ export default {
console.log("离开用户中心"); console.log("离开用户中心");
this.updateAuthorizationPage(false); this.updateAuthorizationPage(false);
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
.footer-line-height { .footer-line-height {
height: 1 * 100rpx; height: 1 * 100rpx;
} }
.order-status-num { .order-status-num {
min-width: 0.33 * 100rpx; min-width: 0.33 * 100rpx;
background-color: #fff; background-color: #fff;
color: #eb3729; color: #eb3729;
@ -372,17 +377,17 @@ export default {
font-size: 0.2 * 100rpx; font-size: 0.2 * 100rpx;
padding: 0 0.08 * 100rpx; padding: 0 0.08 * 100rpx;
border: 1px solid #eb3729; border: 1px solid #eb3729;
} }
.pictrue { .pictrue {
position: relative; position: relative;
} }
.switch-h5 { .switch-h5 {
margin-left: 0.2 * 100rpx; margin-left: 0.2 * 100rpx;
} }
.binding { .binding {
margin-top: 0.1 * 100rpx; margin-top: 0.1 * 100rpx;
display: inline-block; display: inline-block;
padding: 0.05 * 100rpx 0.2 * 100rpx; padding: 0.05 * 100rpx 0.2 * 100rpx;
@ -392,14 +397,15 @@ export default {
line-height: 1.5; line-height: 1.5;
border: 1px solid #e8695e; border: 1px solid #e8695e;
color: #ffffff; color: #ffffff;
} }
.by { .by {
text-align: center; text-align: center;
padding: 30rpx 0; padding: 30rpx 0;
} }
.by-text {
.by-text {
text-align: center; text-align: center;
font-size: 24rpx; font-size: 24rpx;
} }
</style> </style>

8
pages/user/UserAccount/index.vue

@ -8,7 +8,7 @@
<view>总资产()</view> <view>总资产()</view>
<view class="money">{{ now_money }}</view> <view class="money">{{ now_money }}</view>
</view> </view>
<!-- <navigator url="/pages/user/Recharge/index" class="recharge font-color-red">充值</navigator> --> <navigator url="/pages/user/Recharge/index" class="recharge font-color-red" v-if="is_hide=='0'">充值</navigator>
</view> </view>
<view class="cumulative acea-row row-top"> <view class="cumulative acea-row row-top">
<view class="item"> <view class="item">
@ -31,12 +31,12 @@
</view> </view>
<view>消费记录</view> <view>消费记录</view>
</view> </view>
<!-- <view class="item" @click="goUserBill(2)"> <view class="item" @click="goUserBill(2)" v-if="is_hide=='0'">
<view class="pictrue"> <view class="pictrue">
<image src="@/static/images/record3.png" /> <image src="@/static/images/record3.png" />
</view> </view>
<view>充值记录</view> <view>充值记录</view>
</view> --> </view>
</view> </view>
<view class="advert acea-row row-between-wrapper"></view> <view class="advert acea-row row-between-wrapper"></view>
</view> </view>
@ -54,6 +54,7 @@ export default {
props: {}, props: {},
data: function() { data: function() {
return { return {
is_hide: "1",
now_money: 0, now_money: 0,
orderStatusSum: 0, orderStatusSum: 0,
recharge: 0, recharge: 0,
@ -82,6 +83,7 @@ export default {
that.now_money = res.data.now_money; that.now_money = res.data.now_money;
that.orderStatusSum = res.data.orderStatusSum; that.orderStatusSum = res.data.orderStatusSum;
that.recharge = res.data.recharge; that.recharge = res.data.recharge;
this.is_hide = res.data.is_hide;
}, },
err => { err => {
uni.showToast({ uni.showToast({

19
pages/user/address/AddAddress/index.vue

@ -13,12 +13,7 @@
<view class="name">所在地区</view> <view class="name">所在地区</view>
<view class="picker acea-row row-between-wrapper select-value form-control"> <view class="picker acea-row row-between-wrapper select-value form-control">
<view class="address"> <view class="address">
<CitySelect <CitySelect ref="cityselect" :defaultValue="addressText" @callback="result" :items="district"></CitySelect>
ref="cityselect"
:defaultValue="addressText"
@callback="result"
:items="district"
></CitySelect>
</view> </view>
<view class="iconfont icon-dizhi font-color-red"></view> <view class="iconfont icon-dizhi font-color-red"></view>
</view> </view>
@ -47,7 +42,7 @@
</template> </template>
<script type="text/babel"> <script type="text/babel">
import CitySelect from "@/components/CitySelect"; import CitySelect from "@/components/CitySelect";
import { getAddress, postAddress, getCity } from "@/api/user"; import { getAddress, postAddress, getCity } from "@/api/user";
import attrs, { required, chs_phone } from "@/utils/validate"; import attrs, { required, chs_phone } from "@/utils/validate";
import { validatorDefaultCatch } from "@/utils/dialog"; import { validatorDefaultCatch } from "@/utils/dialog";
@ -89,7 +84,11 @@ export default {
that.ready = true; that.ready = true;
}) })
.catch(err => { .catch(err => {
that.$dialog.error(err.msg); uni.showToast({
title: err.msg,
icon: "none",
duration: 2000,
});
}); });
}, },
getUserAddress: function() { getUserAddress: function() {
@ -194,10 +193,10 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.address { .address {
text { text {
width: 100%; width: 100%;
display: block; display: block;
} }
} }
</style> </style>

65
pages/user/promotion/Poster/index.vue

@ -4,12 +4,7 @@
<swiper indicatorDots="true"> <swiper indicatorDots="true">
<block v-for="(item, infoIndex) in info" :key="infoIndex"> <block v-for="(item, infoIndex) in info" :key="infoIndex">
<swiper-item> <swiper-item>
<image <image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress />
class="slide-image"
:src="item.wap_poster"
mode="widthFix"
show-menu-by-longpress
/>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
@ -18,17 +13,19 @@
</view> </view>
</template> </template>
<script> <script>
// import { swiper, swiperSlide } from "vue-awesome-swiper"; // import { swiper, swiperSlide } from "vue-awesome-swiper";
import { getSpreadImg } from "@/api/user"; import {
getSpreadImg
} from "@/api/user";
export default { export default {
name: "Poster", name: "Poster",
components: { components: {
// swiper, // swiper,
// swiperSlide // swiperSlide
}, },
props: {}, props: {},
data: function() { data: function () {
return { return {
swiperPosters: { swiperPosters: {
speed: 1000, speed: 1000,
@ -49,7 +46,7 @@ export default {
activeIndex: 0 activeIndex: 0
}; };
}, },
mounted: function() { mounted: function () {
this.getIndex(); this.getIndex();
let that = this; let that = this;
// this.swiper.on("slideChange", function() { // this.swiper.on("slideChange", function() {
@ -62,26 +59,24 @@ export default {
} }
}, },
methods: { methods: {
getIndex: function() { getIndex: function () {
let that = this; let that = this;
let from = {}; getSpreadImg({
if (this.$deviceType == "app") { from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType
from.from = "app"; }).then(
}
getSpreadImg(from).then(
res => { res => {
that.info = res.data; that.info = res.data;
}, },
err => { err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
} }
); );
}, },
downloadIamge: function(imgsrc, name) { downloadIamge: function (imgsrc, name) {
var that = this; var that = this;
this.isDown = true; this.isDown = true;
var downloadUrl = imgsrc; var downloadUrl = imgsrc;
@ -89,8 +84,7 @@ export default {
if (!wx.saveImageToPhotosAlbum) { if (!wx.saveImageToPhotosAlbum) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
}); });
that.openDialogVisible = true; that.openDialogVisible = true;
@ -113,8 +107,8 @@ export default {
// //
// //
wx.openSetting({ wx.openSetting({
success: function(data) {}, success: function (data) {},
fail: function(data) {} fail: function (data) {}
}); });
} }
}); });
@ -127,34 +121,35 @@ export default {
} }
}); });
}, },
saveImg: function() { saveImg: function () {
this.downloadIamge( this.downloadIamge(
this.info[this.activeIndex].wap_poster, this.info[this.activeIndex].wap_poster,
"poster" + this.activeIndex "poster" + this.activeIndex
); );
} }
} }
}; };
</script> </script>
<style lang="less"> <style lang="less">
page { page {
height: 100%; height: 100%;
} }
.distribution-posters {
.distribution-posters {
height: 100%; height: 100%;
} }
.banenr { .banenr {
height: 100%; height: 100%;
} }
.banner swiper { .banner swiper {
height: 100%; height: 100%;
} }
.banner .slide-image { .banner .slide-image {
width: 100%; width: 100%;
height: auto; height: auto;
} }
</style> </style>

103
pages/user/promotion/UserCash/index.vue

@ -1,17 +1,20 @@
<template> <template>
<view class="cash-withdrawal"> <view class="cash-withdrawal">
<view class="nav acea-row"> <!-- <view class="nav acea-row">
<view <view v-for="(item, navListIndex) in navList" class="item font-color-red" @click="swichNav(navListIndex, item)"
v-for="(item, navListIndex) in navList" :key="navListIndex">
class="item font-color-red"
@click="swichNav(navListIndex, item)"
:key="navListIndex"
>
<view class="line bg-color-red" :class="currentTab === navListIndex ? 'on' : ''"></view> <view class="line bg-color-red" :class="currentTab === navListIndex ? 'on' : ''"></view>
<view class="iconfont" :class="item.icon + ' ' + (currentTab === navListIndex ? 'on' : '')"></view> <view class="iconfont" :class="item.icon + ' ' + (currentTab === navListIndex ? 'on' : '')"></view>
<view>{{ item.name }}</view> <view>{{ item.name }}</view>
</view> </view>
</view> -->
<div class="pos-order-list">
<view class="nav acea-row row-around row-middle">
<view v-for="(item, navListIndex) in navList" class="item" :class="currentTab === navListIndex ? 'on' : ''"
@click="swichNav(navListIndex, item)" :key="navListIndex">{{item.name}}</view>
</view> </view>
</div>
<view class="wrapper"> <view class="wrapper">
<view :hidden="currentTab !== 0" class="list"> <view :hidden="currentTab !== 0" class="list">
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
@ -55,19 +58,33 @@
</view> </view>
</template> </template>
<script> <script>
import { getBank, postCashInfo } from "@/api/user"; import {
import { required } from "@/utils/validate"; getBank,
import { validatorDefaultCatch } from "@/utils/dialog"; postCashInfo
} from "@/api/user";
import {
required
} from "@/utils/validate";
import {
validatorDefaultCatch
} from "@/utils/dialog";
export default { export default {
name: "UserCash", name: "UserCash",
components: {}, components: {},
props: {}, props: {},
data: function() { data: function () {
return { return {
navList: [ navList: [{
{ name: "微信", type: "weixin", icon: "icon-weixin2" }, name: "微信",
{ name: "支付宝", type: "alipay", icon: "icon-icon34" } type: "weixin",
icon: "icon-weixin2"
},
{
name: "支付宝",
type: "alipay",
icon: "icon-icon34"
}
], ],
post: { post: {
extract_type: "weixin", extract_type: "weixin",
@ -84,16 +101,16 @@ export default {
commissionCount: 0 commissionCount: 0
}; };
}, },
mounted: function() { mounted: function () {
this.getBank(); this.getBank();
}, },
methods: { methods: {
swichNav: function(index, item) { swichNav: function (index, item) {
console.log(item); console.log(item);
this.currentTab = index; this.currentTab = index;
this.post.extract_type = item.type; this.post.extract_type = item.type;
}, },
getBank: function() { getBank: function () {
let that = this; let that = this;
getBank().then( getBank().then(
res => { res => {
@ -101,9 +118,9 @@ export default {
that.minPrice = res.data.minPrice; that.minPrice = res.data.minPrice;
that.commissionCount = res.data.commissionCount; that.commissionCount = res.data.commissionCount;
}, },
function(err) { function (err) {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
@ -122,10 +139,22 @@ export default {
if ( if (
parseFloat(money) > parseFloat(that.commissionCount) || parseFloat(money) > parseFloat(that.commissionCount) ||
parseFloat(that.commissionCount) == 0 parseFloat(that.commissionCount) == 0
) ) {
return that.$dialog.message("余额不足"); uni.showToast({
if (parseFloat(money) < parseFloat(that.minPrice)) title: "余额不足",
return that.$dialog.message("最低提现金额" + that.minPrice); icon: "none",
duration: 2000
});
return
}
if (parseFloat(money) < parseFloat(that.minPrice)) {
uni.showToast({
title: "最低提现金额" + that.minPrice,
icon: "none",
duration: 2000
});
return
}
//console.log(that.post.extract_type) //console.log(that.post.extract_type)
switch (that.post.extract_type) { switch (that.post.extract_type) {
case "alipay": case "alipay":
@ -158,7 +187,11 @@ export default {
name: [required(required.message("支付宝用户名"))], name: [required(required.message("支付宝用户名"))],
alipay_code: [required(required.message("支付宝账号"))], alipay_code: [required(required.message("支付宝账号"))],
money: [required(required.message("提现金额"))] money: [required(required.message("提现金额"))]
}).validate({ name, alipay_code, money }); }).validate({
name,
alipay_code,
money
});
let save = { let save = {
extractType: that.post.extract_type, extractType: that.post.extract_type,
alipayCode: alipay_code, alipayCode: alipay_code,
@ -175,7 +208,10 @@ export default {
await this.$validator({ await this.$validator({
weixin: [required(required.message("提现微信号"))], weixin: [required(required.message("提现微信号"))],
money: [required(required.message("提现金额"))] money: [required(required.message("提现金额"))]
}).validate({ weixin, money }); }).validate({
weixin,
money
});
let save = { let save = {
extractType: that.post.extract_type, extractType: that.post.extract_type,
weixin: weixin, weixin: weixin,
@ -188,7 +224,7 @@ export default {
break; break;
} }
}, },
save: function(info) { save: function (info) {
postCashInfo(info).then( postCashInfo(info).then(
res => { res => {
uni.showToast({ uni.showToast({
@ -196,11 +232,13 @@ export default {
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
this.router.push({ path: "/user/audit" }); this.$yrouter.push({
path: "/pages/user/promotion/CashAudit/index"
});
}, },
err => { err => {
uni.showToast({ uni.showToast({
title: err.msg || err.response.data.msg|| err.response.data.message, title: err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
@ -208,5 +246,10 @@ export default {
); );
} }
} }
}; };
</script> </script>
<style lang="less">
.cash-withdrawal .pos-order-list .nav .item.on {
color: #eb3729
}
</style>

1
pages/user/promotion/UserPromotion/index.vue

@ -20,7 +20,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="bnt bg-color-red" @click="toCash">立即提现</view> -->
<view class="list acea-row row-between-wrapper"> <view class="list acea-row row-between-wrapper">
<view class="item acea-row row-center-wrapper row-column" @click="goPoster()"> <view class="item acea-row row-center-wrapper row-column" @click="goPoster()">
<text class="iconfont icon-erweima"></text> <text class="iconfont icon-erweima"></text>

BIN
static/images/logo_bg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
static/images/title1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

12
store/index.js

@ -100,7 +100,11 @@ const vuexStore = new Vuex.Store({
reslove(res.data); reslove(res.data);
}); });
}).catch(() => { }).catch(() => {
dialog.error("获取信息失败!"); uni.showToast({
title: "获取信息失败!",
icon: "none",
duration: 2000,
});
}); });
} }
}, },
@ -113,7 +117,11 @@ const vuexStore = new Vuex.Store({
}); });
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
dialog.error("获取信息失败!"); uni.showToast({
title: "获取信息失败!",
icon: "none",
duration: 2000,
});
}); });
}, },
changeLogin({ changeLogin({

510
uni.css

@ -0,0 +1,510 @@
@charset "UTF-8";
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
/* ==================
自定义变量
==================== */
/*盒子模型*/
.mt2 {
margin-top: 2rpx;
}
.mr2 {
margin-right: 2rpx;
}
.mb2 {
margin-bottom: 2rpx;
}
.ml2 {
margin-left: 2rpx;
}
.mx2 {
margin-left: 2rpx;
margin-right: 2rpx;
}
.my2 {
margin-top: 2rpx;
margin-bottom: 2rpx;
}
.ma2 {
margin: 2rpx;
}
.mt4 {
margin-top: 4rpx;
}
.mr4 {
margin-right: 4rpx;
}
.mb4 {
margin-bottom: 4rpx;
}
.ml4 {
margin-left: 4rpx;
}
.mx4 {
margin-left: 4rpx;
margin-right: 4rpx;
}
.my4 {
margin-top: 4rpx;
margin-bottom: 4rpx;
}
.ma4 {
margin: 4rpx;
}
.mt8 {
margin-top: 8rpx;
}
.mr8 {
margin-right: 8rpx;
}
.mb8 {
margin-bottom: 8rpx;
}
.ml8 {
margin-left: 8rpx;
}
.mx8 {
margin-left: 8rpx;
margin-right: 8rpx;
}
.my8 {
margin-top: 8rpx;
margin-bottom: 8rpx;
}
.ma8 {
margin: 8rpx;
}
.mt10 {
margin-top: 10rpx;
}
.mr10 {
margin-right: 10rpx;
}
.mb10 {
margin-bottom: 10rpx;
}
.ml10 {
margin-left: 10rpx;
}
.mx10 {
margin-left: 10rpx;
margin-right: 10rpx;
}
.my10 {
margin-top: 10rpx;
margin-bottom: 10rpx;
}
.ma10 {
margin: 10rpx;
}
.mt15 {
margin-top: 15rpx;
}
.mr15 {
margin-right: 15rpx;
}
.mb15 {
margin-bottom: 15rpx;
}
.ml15 {
margin-left: 15rpx;
}
.mx15 {
margin-left: 15rpx;
margin-right: 15rpx;
}
.my15 {
margin-top: 15rpx;
margin-bottom: 15rpx;
}
.ma15 {
margin: 15rpx;
}
.mt20 {
margin-top: 20rpx;
}
.mr20 {
margin-right: 20rpx;
}
.mb20 {
margin-bottom: 20rpx;
}
.ml20 {
margin-left: 20rpx;
}
.mx20 {
margin-left: 20rpx;
margin-right: 20rpx;
}
.my20 {
margin-top: 20rpx;
margin-bottom: 20rpx;
}
.ma20 {
margin: 20rpx;
}
.mt24 {
margin-top: 24rpx;
}
.mr24 {
margin-right: 24rpx;
}
.mb24 {
margin-bottom: 24rpx;
}
.ml24 {
margin-left: 24rpx;
}
.mx24 {
margin-left: 24rpx;
margin-right: 24rpx;
}
.my24 {
margin-top: 24rpx;
margin-bottom: 24rpx;
}
.ma24 {
margin: 24rpx;
}
.mt30 {
margin-top: 30rpx;
}
.mr30 {
margin-right: 30rpx;
}
.mb30 {
margin-bottom: 30rpx;
}
.ml30 {
margin-left: 30rpx;
}
.mx30 {
margin-left: 30rpx;
margin-right: 30rpx;
}
.my30 {
margin-top: 30rpx;
margin-bottom: 30rpx;
}
.ma30 {
margin: 30rpx;
}
.pt2 {
padding-top: 2rpx;
}
.pr2 {
padding-right: 2rpx;
}
.pb2 {
padding-bottom: 2rpx;
}
.pl2 {
padding-left: 2rpx;
}
.px2 {
padding-left: 2rpx;
padding-right: 2rpx;
}
.py2 {
padding-top: 2rpx;
padding-bottom: 2rpx;
}
.pa2 {
padding: 2rpx;
}
.pt4 {
padding-top: 4rpx;
}
.pr4 {
padding-right: 4rpx;
}
.pb4 {
padding-bottom: 4rpx;
}
.pl4 {
padding-left: 4rpx;
}
.px4 {
padding-left: 4rpx;
padding-right: 4rpx;
}
.py4 {
padding-top: 4rpx;
padding-bottom: 4rpx;
}
.pa4 {
padding: 4rpx;
}
.pt8 {
padding-top: 8rpx;
}
.pr8 {
padding-right: 8rpx;
}
.pb8 {
padding-bottom: 8rpx;
}
.pl8 {
padding-left: 8rpx;
}
.px8 {
padding-left: 8rpx;
padding-right: 8rpx;
}
.py8 {
padding-top: 8rpx;
padding-bottom: 8rpx;
}
.pa8 {
padding: 8rpx;
}
.pt10 {
padding-top: 10rpx;
}
.pr10 {
padding-right: 10rpx;
}
.pb10 {
padding-bottom: 10rpx;
}
.pl10 {
padding-left: 10rpx;
}
.px10 {
padding-left: 10rpx;
padding-right: 10rpx;
}
.py10 {
padding-top: 10rpx;
padding-bottom: 10rpx;
}
.pa10 {
padding: 10rpx;
}
.pt15 {
padding-top: 15rpx;
}
.pr15 {
padding-right: 15rpx;
}
.pb15 {
padding-bottom: 15rpx;
}
.pl15 {
padding-left: 15rpx;
}
.px15 {
padding-left: 15rpx;
padding-right: 15rpx;
}
.py15 {
padding-top: 15rpx;
padding-bottom: 15rpx;
}
.pa15 {
padding: 15rpx;
}
.pt20 {
padding-top: 20rpx;
}
.pr20 {
padding-right: 20rpx;
}
.pb20 {
padding-bottom: 20rpx;
}
.pl20 {
padding-left: 20rpx;
}
.px20 {
padding-left: 20rpx;
padding-right: 20rpx;
}
.py20 {
padding-top: 20rpx;
padding-bottom: 20rpx;
}
.pa20 {
padding: 20rpx;
}
.pt24 {
padding-top: 24rpx;
}
.pr24 {
padding-right: 24rpx;
}
.pb24 {
padding-bottom: 24rpx;
}
.pl24 {
padding-left: 24rpx;
}
.px24 {
padding-left: 24rpx;
padding-right: 24rpx;
}
.py24 {
padding-top: 24rpx;
padding-bottom: 24rpx;
}
.pa24 {
padding: 24rpx;
}
.pt30 {
padding-top: 30rpx;
}
.pr30 {
padding-right: 30rpx;
}
.pb30 {
padding-bottom: 30rpx;
}
.pl30 {
padding-left: 30rpx;
}
.px30 {
padding-left: 30rpx;
padding-right: 30rpx;
}
.py30 {
padding-top: 30rpx;
padding-bottom: 30rpx;
}
.pa30 {
padding: 30rpx;
}
/*# sourceMappingURL=uni.css.map */

9
uni.css.map

File diff suppressed because one or more lines are too long

1
uni.min.css vendored

@ -0,0 +1 @@
.mt2{margin-top:2rpx}.mr2{margin-right:2rpx}.mb2{margin-bottom:2rpx}.ml2{margin-left:2rpx}.mx2{margin-left:2rpx;margin-right:2rpx}.my2{margin-top:2rpx;margin-bottom:2rpx}.ma2{margin:2rpx}.mt4{margin-top:4rpx}.mr4{margin-right:4rpx}.mb4{margin-bottom:4rpx}.ml4{margin-left:4rpx}.mx4{margin-left:4rpx;margin-right:4rpx}.my4{margin-top:4rpx;margin-bottom:4rpx}.ma4{margin:4rpx}.mt8{margin-top:8rpx}.mr8{margin-right:8rpx}.mb8{margin-bottom:8rpx}.ml8{margin-left:8rpx}.mx8{margin-left:8rpx;margin-right:8rpx}.my8{margin-top:8rpx;margin-bottom:8rpx}.ma8{margin:8rpx}.mt10{margin-top:10rpx}.mr10{margin-right:10rpx}.mb10{margin-bottom:10rpx}.ml10{margin-left:10rpx}.mx10{margin-left:10rpx;margin-right:10rpx}.my10{margin-top:10rpx;margin-bottom:10rpx}.ma10{margin:10rpx}.mt15{margin-top:15rpx}.mr15{margin-right:15rpx}.mb15{margin-bottom:15rpx}.ml15{margin-left:15rpx}.mx15{margin-left:15rpx;margin-right:15rpx}.my15{margin-top:15rpx;margin-bottom:15rpx}.ma15{margin:15rpx}.mt20{margin-top:20rpx}.mr20{margin-right:20rpx}.mb20{margin-bottom:20rpx}.ml20{margin-left:20rpx}.mx20{margin-left:20rpx;margin-right:20rpx}.my20{margin-top:20rpx;margin-bottom:20rpx}.ma20{margin:20rpx}.mt24{margin-top:24rpx}.mr24{margin-right:24rpx}.mb24{margin-bottom:24rpx}.ml24{margin-left:24rpx}.mx24{margin-left:24rpx;margin-right:24rpx}.my24{margin-top:24rpx;margin-bottom:24rpx}.ma24{margin:24rpx}.mt30{margin-top:30rpx}.mr30{margin-right:30rpx}.mb30{margin-bottom:30rpx}.ml30{margin-left:30rpx}.mx30{margin-left:30rpx;margin-right:30rpx}.my30{margin-top:30rpx;margin-bottom:30rpx}.ma30{margin:30rpx}.pt2{padding-top:2rpx}.pr2{padding-right:2rpx}.pb2{padding-bottom:2rpx}.pl2{padding-left:2rpx}.px2{padding-left:2rpx;padding-right:2rpx}.py2{padding-top:2rpx;padding-bottom:2rpx}.pa2{padding:2rpx}.pt4{padding-top:4rpx}.pr4{padding-right:4rpx}.pb4{padding-bottom:4rpx}.pl4{padding-left:4rpx}.px4{padding-left:4rpx;padding-right:4rpx}.py4{padding-top:4rpx;padding-bottom:4rpx}.pa4{padding:4rpx}.pt8{padding-top:8rpx}.pr8{padding-right:8rpx}.pb8{padding-bottom:8rpx}.pl8{padding-left:8rpx}.px8{padding-left:8rpx;padding-right:8rpx}.py8{padding-top:8rpx;padding-bottom:8rpx}.pa8{padding:8rpx}.pt10{padding-top:10rpx}.pr10{padding-right:10rpx}.pb10{padding-bottom:10rpx}.pl10{padding-left:10rpx}.px10{padding-left:10rpx;padding-right:10rpx}.py10{padding-top:10rpx;padding-bottom:10rpx}.pa10{padding:10rpx}.pt15{padding-top:15rpx}.pr15{padding-right:15rpx}.pb15{padding-bottom:15rpx}.pl15{padding-left:15rpx}.px15{padding-left:15rpx;padding-right:15rpx}.py15{padding-top:15rpx;padding-bottom:15rpx}.pa15{padding:15rpx}.pt20{padding-top:20rpx}.pr20{padding-right:20rpx}.pb20{padding-bottom:20rpx}.pl20{padding-left:20rpx}.px20{padding-left:20rpx;padding-right:20rpx}.py20{padding-top:20rpx;padding-bottom:20rpx}.pa20{padding:20rpx}.pt24{padding-top:24rpx}.pr24{padding-right:24rpx}.pb24{padding-bottom:24rpx}.pl24{padding-left:24rpx}.px24{padding-left:24rpx;padding-right:24rpx}.py24{padding-top:24rpx;padding-bottom:24rpx}.pa24{padding:24rpx}.pt30{padding-top:30rpx}.pr30{padding-right:30rpx}.pb30{padding-bottom:30rpx}.pl30{padding-left:30rpx}.px30{padding-left:30rpx;padding-right:30rpx}.py30{padding-top:30rpx;padding-bottom:30rpx}.pa30{padding:30rpx}

54
uni.scss

@ -74,3 +74,57 @@ $uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:36upx; $uni-font-size-subtitle:36upx;
$uni-color-paragraph: #3F536E; // 文章段落颜色 $uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:30upx; $uni-font-size-paragraph:30upx;
/* ==================
自定义变量
==================== */
$spaceTypes: (
m: margin,
p: padding
);
$spaceDirections: (
t: top,
r: right,
b: bottom,
l: left
);
$spaceSizes: (
2: 2rpx,
4: 4rpx,
8: 8rpx,
10: 10rpx,
15: 15rpx,
20: 20rpx,
24: 24rpx,
30: 30rpx
);
/*盒子模型*/
@each $typeKey, $type in $spaceTypes {
@each $sizeKey, $size in $spaceSizes {
// margin-top:10rpx
@each $directionKey, $direction in $spaceDirections {
.#{$typeKey}#{$directionKey}#{$sizeKey} {
#{$type}-#{$direction}: $size;
}
}
// margin: 10rpx 0;
.#{$typeKey}x#{$sizeKey} {
#{$type}-left: $size;
#{$type}-right: $size;
}
.#{$typeKey}y#{$sizeKey} {
#{$type}-top: $size;
#{$type}-bottom: $size;
}
// margin: 10rpx ;
.#{$typeKey}a#{$sizeKey} {
#{$type}: $size;
}
}
}

143
utils/index.js

@ -38,7 +38,27 @@ export function dataFormat(time, option) {
return timeStr return timeStr
} }
} }
// 年月日,时分秒
// "YYYY-mm-dd HH:MM"
export function dateFormatL(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;
}
export function dateFormatT(time) { export function dateFormatT(time) {
time = +time * 1000; time = +time * 1000;
const d = new Date(time); const d = new Date(time);
@ -62,7 +82,10 @@ export function isType(arg, type) {
} }
export function isWeixin() { export function isWeixin() {
return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1; if(navigator&&navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1){
return true
}
return false
} }
export function parseQuery() { export function parseQuery() {
@ -182,13 +205,11 @@ export const login = () => {
// } else { // } else {
// // wechat().then(() => oAuth().then((code) => { // // wechat().then(() => oAuth().then((code) => {
// // // const { code } = parseQuery() // // // const { code } = parseQuery()
// // debugger
// // auth(code) // // auth(code)
// // .then(() => { // // .then(() => {
// // // location.replace( // // // location.replace(
// // // decodeURIComponent(decodeURIComponent(this.$route.params.url)) // // // decodeURIComponent(decodeURIComponent(this.$route.params.url))
// // // ); // // // );
// // debugger
// // location.href = decodeURIComponent( // // location.href = decodeURIComponent(
// // decodeURIComponent(this.$route.params.url) // // decodeURIComponent(this.$route.params.url)
// // ); // // );
@ -250,6 +271,7 @@ export const login = () => {
store.dispatch('userInfo', true) store.dispatch('userInfo', true)
getUserInfo().then(user => { getUserInfo().then(user => {
console.log('获取用户信息成功') console.log('获取用户信息成功')
uni.setStorageSync('uid', user.data.uid);
store.dispatch('setUserInfo', user.data) store.dispatch('setUserInfo', user.data)
resolve(user) resolve(user)
}).catch(error => { }).catch(error => {
@ -659,14 +681,15 @@ export function handleQrCode() {
export function handleUrlParam(path) { export function handleUrlParam(path) {
console.log(path) console.log(path)
var theRequest = new Object();
if(path.includes("?")){
var url = path.split("?")[1]; //获取url中"?"符后的字串 var url = path.split("?")[1]; //获取url中"?"符后的字串
console.log(url) console.log(url)
var theRequest = new Object();
let strs = url.split("&"); let strs = url.split("&");
for (var i = 0; i < strs.length; i++) { for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]); theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
} }
}
return theRequest; return theRequest;
} }
@ -796,16 +819,115 @@ export const handleLoginFailure = () => {
console.log(store.getters) console.log(store.getters)
console.log('————————') console.log('————————')
store.commit("updateAuthorizationPage", true); store.commit("updateAuthorizationPage", true);
let path = '/' + getCurrentPageUrlWithArgs() let path = '/' + getCurrentPageUrlWithArgs()
console.log("getCurrentPageUrl",getCurrentPageUrl());
//判断小程序转发分享商品详情进来的
if (getCurrentPageUrl() == 'pages/shop/GoodsCon/index' && handleUrlParam(path) ) {
debugger;
console.log('————————')
console.log('判断小程序转发分享商品详情进来的')
console.log(' handleUrlParam()', handleUrlParam(path))
let url = handleUrlParam(path);
console.log(url)
if (url) {
path = parseUrl({
path: `/${getCurrentPageUrl()}`,
query: {
id: url.id,
}
})
cookie.set("spread", url.spread || 0);
} else {
handleNoParameters()
console.log('————————')
console.log('是扫描的商品详情进来的,但是没有获取到参数')
console.log('————————')
}
}
// 是分享转发拼团进来的
if (getCurrentPageUrl() == 'pages/activity/GroupDetails/index' && handleUrlParam(path)) {
console.log('————————')
console.log('是分享转发拼团进来的')
console.log('————————')
let url = handleUrlParam(path);
console.log(url)
if (url) {
path = parseUrl({
path: `/${getCurrentPageUrl()}`,
query: {
id: url.id,
}
})
cookie.set("spread", url.spread || 0);
} else {
console.log('————————')
console.log('是拼团进来的,但是没有获取到参数')
console.log('————————')
handleNoParameters()
}
}
// 是分享转发秒杀进来的
if (getCurrentPageUrl() == 'pages/activity/SeckillDetails/index' && handleUrlParam(path)) {
console.log('————————')
console.log('是分享转发秒杀进来的')
console.log('————————')
let url = handleUrlParam(path);
console.log(url)
if (url) {
path = parseUrl({
path: `/${getCurrentPageUrl()}`,
query: {
id: url.id,
}
})
cookie.set("spread", url.spread || 0);
} else {
console.log('————————')
console.log('是秒杀进来的,但是没有获取到参数')
console.log('————————')
handleNoParameters()
}
}
// 判断是不是转发分享的砍价海报进来的
if (getCurrentPageUrl() == 'pages/activity/DargainDetails/index' && handleUrlParam(path)) {
console.log('————————')
console.log('判断是不是转发分享的砍价海报进来的')
console.log('————————')
let url = handleUrlParam(path);
if (url) {
path = parseUrl({
path: `/${getCurrentPageUrl()}`,
query: {
id: url.bargainId,
partake: url.uid
}
})
cookie.set("spread", url.spread || 0);
} else {
handleNoParameters()
console.log('————————')
console.log('是扫描的砍价海报进来的,但是没有获取到参数')
console.log('————————')
}
}
// 判断是不是拼团进来的 // 判断是不是拼团进来的
if (getCurrentPageUrl() == 'pages/activity/GroupRule/index' && handleQrCode()) { if (getCurrentPageUrl() == 'pages/activity/GroupRule/index' ) {
console.log('————————') console.log('————————')
console.log('是拼团进来的') console.log('是拼团进来的')
console.log('————————') console.log('————————')
let url = handleQrCode(); let url = handleQrCode();
if(!url){
url = handleUrlParam(path);
}
console.log(url) console.log(url)
if (url) { if (url) {
path = parseUrl({ path = parseUrl({
@ -814,7 +936,7 @@ export const handleLoginFailure = () => {
id: url.pinkId, id: url.pinkId,
} }
}) })
// cookie.set("spread", url.spread || 0); cookie.set("spread", url.spread || 0);
} else { } else {
console.log('————————') console.log('————————')
console.log('是拼团进来的,但是没有获取到参数') console.log('是拼团进来的,但是没有获取到参数')
@ -837,7 +959,7 @@ export const handleLoginFailure = () => {
partake: url.uid partake: url.uid
} }
}) })
// cookie.set("spread", url.spread || 0); cookie.set("spread", url.spread || 0);
} else { } else {
handleNoParameters() handleNoParameters()
console.log('————————') console.log('————————')
@ -849,6 +971,7 @@ export const handleLoginFailure = () => {
} }
if (getCurrentPageUrl() == 'pages/shop/GoodsCon/index' && handleQrCode()) { if (getCurrentPageUrl() == 'pages/shop/GoodsCon/index' && handleQrCode()) {
debugger;
console.log('————————') console.log('————————')
console.log('是扫描的商品详情') console.log('是扫描的商品详情')
console.log('————————') console.log('————————')

8
utils/request.js

@ -1,7 +1,13 @@
// #ifndef MP-WEIXIN // #ifdef H5
// h5端
import Fly from "flyio/dist/npm/fly"; import Fly from "flyio/dist/npm/fly";
// #endif // #endif
// #ifdef APP-PLUS
// app端
import Fly from "flyio/dist/npm/wx";
// #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
import Fly from "flyio/dist/npm/wx"; import Fly from "flyio/dist/npm/wx";
// #endif // #endif

Loading…
Cancel
Save