Browse Source

- (2020/04/12) [+] 小程序首页 热门榜单 首发新品 标题有遮挡

- (2020/04/12) [+] 首页榜单进去提示登陆,页面空白:,还有这种总数操作也会就跳转到授权页面,应该是又问题的这快
- (2020/04/12) [+] 全部商品,右边有错误截图如下
- (2020/04/12) [+] 秒杀列表数据不显示;公众号15点的就有数据,但是小程序没有
- (2020/04/12) [+] 7、砍价可以改下,看下最新H5代码,首次进来不自动砍价,自己点击才砍价一次,而且里面详情是乱的
- (2020/04/12) [+] 为啥我也没退出,就取截个图,再进来,点击商品详情,又让登陆,登陆失效怎么这么快,mpvue小程序就没这个问题,这个问题非常严重,一会让让跳转到授权页面登陆!!
- (2020/04/12) [+] 1、商品购买选择规格,这个开始进去点可以,点到后面花色的规格点不动了
- (2020/04/12) [+] 2、拼团客服隐藏掉,下面按钮太那个了,把商品详情那个收藏功能放进来,他们收藏功能都是一样的
- (2020/04/12) [+] 商品详情海报一直海报生成中
- (2020/04/12) [+] 砍价弹窗修改
- (2020/04/11) [+] 1、购买选择规格属性点不了
- (2020/04/11) [+] 12、拼团详情客服功能隐藏去掉,其他地方有客服功能的都去掉
- (2020/04/11) [+] 11、分类点击 会分类Tab页分类一级比一级低
- (2020/04/11) [+] 10、我的推广,里面样式有问题,点击海报里面空白
- (2020/04/11) [+] 9、小程序订单核销没上 你那边先根据路径判断隐藏下
- (2020/04/11) [+] 8、订单点击评价没反应
- (2020/04/11) [+] 6、个人中心我的余额点进去点击账单记录一直正在加载中,点击下全部就出来了,应该你没带默认参数
- (2020/04/11) [+] 5、添加地址选择地区无效
- (2020/04/11) [+] 4、待收货 列表查看物流点击没反应,详情查看物流可以点
- (2020/04/11) [+] 3、下单点击积分抵扣没反应
- (2020/04/11) [+] 2、购物车列表点击管理 点击收藏功能去掉
master
Gao xiaosong 5 years ago
parent
commit
09941a8236
  1. 2
      api/store.js
  2. 2
      assets/css/style.css
  3. 2
      assets/css/style.css.map
  4. 21
      assets/css/style.less
  5. 58
      components/StorePoster.vue
  6. 10
      main.js
  7. 4
      pages/activity/DargainDetails/index.vue
  8. 463
      pages/activity/GoodsSeckill/index.vue
  9. 37
      pages/activity/GroupDetails/index.vue
  10. 8
      pages/home/index.vue
  11. 5
      pages/shop/GoodsCon/index.vue
  12. 2
      pages/shop/HotNewGoods/index.vue
  13. 40
      utils/index.js

2
api/store.js

@ -69,7 +69,7 @@ export function getHostProducts(page, limit) {
* */ * */
export function getGroomList(type) { export function getGroomList(type) {
return request.get("/groom/list/" + type, {}, { return request.get("/groom/list/" + type, {}, {
login: false login: true
}); });
} }

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

21
assets/css/style.less

@ -1739,18 +1739,21 @@ flex: 0 2.4*100rpx;
width: 100%; width: 100%;
height: 0.86*100rpx; height: 0.86*100rpx;
padding-left: 0.23*100rpx; padding-left: 0.23*100rpx;
padding-right: 0.23*100rpx;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
z-index: 5; z-index: 5;
box-sizing: border-box;
} }
.productList .search .input { .productList .search .input {
width: 6.4*100rpx; flex:1;
height: 0.6*100rpx; height: 0.6*100rpx;
background-color: #fff; background-color: #fff;
border-radius: 0.5*100rpx; border-radius: 0.5*100rpx;
padding: 0 0.2*100rpx; padding: 0 0.2*100rpx;
margin-right: 0.23*100rpx;
} }
.productList .search .input input { .productList .search .input input {
@ -2548,7 +2551,7 @@ flex: 0 2.4*100rpx;
width: 100%; width: 100%;
} }
.product-con .product-intro .conter image{ .product-con .product-intro .conter *{
width: 100% !important; width: 100% !important;
display: block !important; display: block !important;
} }
@ -8425,3 +8428,17 @@ flex: 0 2.4*100rpx;
} }
.swiper-wrapper {} .swiper-wrapper {}
.posterCanvasWarp{
position: relative;
width:0;
height:0;
overflow: hidden;
.posterCanvas{
position: absolute;
left:0;
top:0;
width:747px !important;
height:1326px !important;
}
}

58
components/StorePoster.vue

@ -1,6 +1,8 @@
<template> <template>
<view v-if="posterImageStatus" class="poster-first"> <view v-if="posterImageStatus" class="poster-first">
<canvas style="width:747px;height:1326px" canvas-id="myCanvas"></canvas> <div class="posterCanvasWarp">
<canvas class="posterCanvas" canvas-id="myCanvas"></canvas>
</div>
<!-- <view class="poster-pop" v-show="!canvasStatus"> <!-- <view class="poster-pop" v-show="!canvasStatus">
<image <image
src="@/static/images/poster-close.png" src="@/static/images/poster-close.png"
@ -25,7 +27,7 @@
</view> </view>
</view> </view>
<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" src="@/static/images/poster-close.png"
@ -33,7 +35,13 @@
@click="posterImageClose" @click="posterImageClose"
mode="widthFix" mode="widthFix"
/> />
<image :src="posterImage" alt="tp" class="poster-image" show-menu-by-longpress 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>
@ -44,78 +52,78 @@
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;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
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;
text-align: center; text-align: center;
height: 0.76*100rpx; height: 0.76 * 100rpx;
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;

10
main.js

@ -31,12 +31,12 @@ Vue.prototype.$validator = function(rule) {
return new schema(rule); return new schema(rule);
}; };
const CACHE_KEY = "clear_0.0.1"; // const CACHE_KEY = "clear_0.0.1";
if (!cookie.has(CACHE_KEY)) { // if (!cookie.has(CACHE_KEY)) {
cookie.clearAll(); // cookie.clearAll();
cookie.set(CACHE_KEY, 1); // cookie.set(CACHE_KEY, 1);
} // }
Vue.config.productionTip = false Vue.config.productionTip = false

4
pages/activity/DargainDetails/index.vue

@ -142,10 +142,10 @@
<view class="conter" v-html="bargain.rule"></view> <view class="conter" v-html="bargain.rule"></view>
</view> </view>
<view class="bargainTip" :class="active === true ? 'on' : ''"> <view class="bargainTip" :class="active === true ? 'on' : ''">
<view class="pictrue"> <!-- <view class="pictrue">
<image src="@/static/images/bargainBg.jpg" /> <image src="@/static/images/bargainBg.jpg" />
<view class="iconfont icon-guanbi" @click="close"></view> <view class="iconfont icon-guanbi" @click="close"></view>
</view> </view> -->
<view class="cutOff" v-if="bargainPartake === userInfo.uid"> <view class="cutOff" v-if="bargainPartake === userInfo.uid">
您已砍掉 您已砍掉
<text class="font-color-red" v-text="bargainHelpPrice"></text>听说分享次数越多砍价成功的机会越大哦 <text class="font-color-red" v-text="bargainHelpPrice"></text>听说分享次数越多砍价成功的机会越大哦

463
pages/activity/GoodsSeckill/index.vue

@ -1,238 +1,263 @@
<template> <template>
<view class="flash-sale" ref="container"> <view class="flash-sale" ref="container">
<view class="header" v-if="headerImg"> <view class="header" v-if="headerImg">
<image :src="headerImg" /> <image :src="headerImg" />
</view> </view>
<scroll-view scroll-y="false" scroll-x="true"> <scroll-view scroll-y="false" scroll-x="true">
<view class="timeScroll"> <view class="timeScroll">
<view class="" v-for="(item, index) in timeList" :key="index"> <view class v-for="(item, index) in timeList" :key="index">
<view :class="{'timeItem':true,'active':active==index}" @click="changeTime(index)"> <view :class="{'timeItem':true,'active':active==index}" @click="setTime(index)">
<view class="time">{{ item.time }}</view> <view class="time">{{ item.time }}</view>
<view class="state">{{ item.state }}</view> <view class="state">{{ item.state }}</view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="" v-for="(item, index) in timeList" :key="index"> <view class 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 :is-day="false" :tip-text="'距结束仅剩 '" :day-text="''" :hour-text="' : '" :minute-text="' : '" <count-down
:second-text="''" :datatime="datatime" v-if="item.status === 1"></count-down> :is-day="false"
<view v-if="item.status === 2" class="activity">活动即将开始</view> :tip-text="'距结束仅剩 '"
</view> :day-text="''"
<view class="list"> :hour-text="' : '"
<view class="item acea-row row-between-wrapper" v-for="(itemSeckill, indexSeckill) in seckillList" :key="indexSeckill"> :minute-text="' : '"
<view class="pictrue"> :second-text="''"
<image :src="itemSeckill.image" /> :datatime="datatime"
</view> v-if="item.status === 1"
<view class="text acea-row row-column-around"> ></count-down>
<view class="line1" v-text="itemSeckill.title"></view> <view v-if="item.status === 2" class="activity">活动即将开始</view>
<view class="money"> </view>
限时价 <view class="list">
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text> <view
</view> class="item acea-row row-between-wrapper"
<view class="progress cart-color"> v-for="(itemSeckill, indexSeckill) in seckillList"
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view> :key="indexSeckill"
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view> >
</view> <view class="pictrue">
</view> <image :src="itemSeckill.image" />
<view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0" @click="goDetail(itemSeckill.id)">马上抢</view> </view>
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view> <view class="text acea-row row-column-around">
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view> <view class="line1" v-text="itemSeckill.title"></view>
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view> <view class="money">
</view> 限时价
</view> <text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text>
<view class="noCommodity" style="background-color: #fff;" v-if="seckillList.length === 0 && page > 1"> </view>
<view class="noPictrue"> <view class="progress cart-color">
<image src="@/static/images/noGood.png" class="image" /> <view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view>
</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"
@click="goDetail(itemSeckill.id)"
>马上抢</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" v-if="item.status === 0">已结束</view>
</view>
</view>
<view
class="noCommodity"
style="background-color: #fff;"
v-if="seckillList.length === 0 && page > 1"
>
<view class="noPictrue">
<image src="@/static/images/noGood.png" class="image" />
</view>
</view>
</view>
</view>
<!--
<vant-tabs :active="active" @change="setTime" :sticky="sticky" animated line-height="2" :ellipsis="false"> <vant-tabs :active="active" @change="setTime" :sticky="sticky" animated line-height="2" :ellipsis="false">
<vant-tab :ellipsis="false" :title="[title[index]]"> <vant-tab :ellipsis="false" :title="[title[index]]">
</vant-tab> </vant-tab>
</vant-tabs> --> </vant-tabs>-->
</view> </view>
</template> </template>
<script> <script>
import { import { getSeckillConfig, getSeckillList } from "@/api/activity";
getSeckillConfig, import CountDown from "@/components/CountDown";
getSeckillList // import { Tab, Tabs } from "vant-weapp";
} from '@/api/activity'; import Loading from "@/components/Loading";
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: [],
sticky: false, sticky: false,
loading: false, loading: false,
datatime: 0, datatime: 0,
active: 0, active: 0,
seckillList: [], seckillList: [],
status: false, // false true status: false, // false true
loadingList: false, // false true loadingList: false, // false true
page: 1, // page: 1, //
limit: 5, // limit: 5, //
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 console.log(index);
}, this.active = index;
mountedStart: function() { this.getSeckillList();
var that = this; },
uni.showLoading(); mountedStart: function() {
getSeckillConfig().then(res => { var that = this;
that.$set(that, 'headerImg', res.data.lovely); uni.showLoading();
that.$set(that, 'timeList', res.data.seckillTime); getSeckillConfig().then(res => {
that.$set(that, 'active', res.data.seckillTimeIndex); that.$set(that, "headerImg", res.data.lovely);
that.$set(that, "timeList", res.data.seckillTime);
that.$set(that, "active", res.data.seckillTimeIndex);
let title = []; let title = [];
title = res.data.seckillTime.map((item, index) => { title = res.data.seckillTime.map((item, index) => {
return { return {
name: 'div', name: "div",
attrs: { attrs: {
class: 'timeItem' class: "timeItem"
}, },
children: [{ children: [
name: 'div', {
attrs: { name: "div",
class: 'time' attrs: {
}, class: "time"
children: [{ },
type: 'text', children: [
text: item.time {
}] type: "text",
}, text: item.time
{ }
name: 'div', ]
attrs: { },
class: 'state' {
}, name: "div",
children: [{ attrs: {
type: 'text', class: "state"
text: item.state },
}] children: [
} {
] type: "text",
}; text: item.state
}); }
that.$set(that, 'title', title); ]
that.datatime = that.timeList[that.active].stop; }
that.getSeckillList(); ]
that.$nextTick(function() { };
that.sticky = true; });
uni.hideLoading(); that.$set(that, "title", title);
}); that.datatime = that.timeList[that.active].stop;
}); that.getSeckillList();
}, that.$nextTick(function() {
setTime: function(event) { that.sticky = true;
var that = this; uni.hideLoading();
that.active = event.mp.detail.index; });
that.datatime = that.timeList[that.active].stop; });
that.getSeckillList(); },
}, setTime: function(index) {
getSeckillList: function() { var that = this;
var that = this; that.page = 1;
if (that.loadingList) return; that.loadingList = false;
if (that.status) return; that.status = false;
var time = that.timeList[that.active].id; that.active = index;
getSeckillList(time, { that.datatime = that.timeList[that.active].stop;
page: that.page, that.getSeckillList();
limit: that.limit },
}).then(res => { getSeckillList: function() {
that.status = res.data.length < that.limit; var that = this;
that.seckillList.push.apply(that.seckillList, res.data); if (that.loadingList) return;
that.page++; if (that.status) return;
uni.hideLoading(); var time = that.timeList[that.active].id;
}); getSeckillList(time, {
}, page: that.page,
goDetail: function(id) { limit: that.limit
var that = this; }).then(res => {
var time = that.timeList[that.active].stop; that.status = res.data.length < that.limit;
this.$yrouter.push({ that.seckillList.push.apply(that.seckillList, res.data);
path: '/pages/activity/SeckillDetails/index', that.page++;
query: { uni.hideLoading();
id, });
time },
} goDetail: function(id) {
}); var that = this;
} var time = that.timeList[that.active].stop;
} this.$yrouter.push({
}; path: "/pages/activity/SeckillDetails/index",
query: {
id,
time
}
});
}
}
};
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.timeScroll { .timeScroll {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row; flex-direction: row;
} }
.timeItem { .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: 0.11 * 100rpx 0;
background-color: none; background-color: none;
&.active { &.active {
.time {
color: #00c17b;
}
.time { .state {
color: #00c17b background-color: #00c17b;
} color: #fff;
opacity: 1;
border-radius: 30rpx;
padding: 0 0.2 * 100rpx;
font-weight: 800;
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
}
}
.state { .timeItem .time {
background-color: #00c17b; font-size: 0.32 * 100rpx;
color: #fff; font-weight: bold;
opacity: 1; height: 0.37 * 100rpx;
border-radius: 30rpx; line-height: 0.37 * 100rpx;
padding: 0 .2*100rpx; }
font-weight: 800;
height: .3*100rpx;
line-height: .3*100rpx;
}
} .timeItem .state {
} height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.timeItem .time { .activity {
font-size: 0.32 * 100rpx; color: #333;
font-weight: bold; }
height: 0.37 * 100rpx;
line-height: 0.37 * 100rpx;
}
.timeItem .state { .flash-sale .list .item .grab {
height: 0.37 * 100rpx; background-color: #999;
line-height: 0.37 * 100rpx; }
}
.activity {
color: #333;
}
.flash-sale .list .item .grab {
background-color: #999;
}
</style> </style>

37
pages/activity/GroupDetails/index.vue

@ -104,13 +104,18 @@
<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> </view>
<view style="height:100rpx;"></view> <view style="height:100rpx;"></view>
<view class="footer-group acea-row row-between-wrapper"> <view class="footer-group acea-row row-between-wrapper">
<!-- <view class="customerSer acea-row row-center-wrapper row-column"> <!-- <view class="customerSer acea-row row-center-wrapper row-column">
<view class="iconfont icon-kefu"></view> <view class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</view> --> </view>-->
<view class="customerSer acea-row row-center-wrapper row-column" @click="setCollect">
<view class="iconfont" :class="userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
<text>收藏</text>
</view>
<view class="bnt bg-color-violet" @click="openAlone">单独购买</view> <view class="bnt bg-color-violet" @click="openAlone">单独购买</view>
<view class="bnt bg-color-red" @click="openTeam">立即开团</view> <view class="bnt bg-color-red" @click="openTeam">立即开团</view>
</view> </view>
@ -134,6 +139,12 @@ import StorePoster from "@/components/StorePoster";
import { getCombinationDetail } from "@/api/activity"; import { getCombinationDetail } from "@/api/activity";
import { postCartAdd } from "@/api/store"; import { postCartAdd } from "@/api/store";
import { imageBase64 } from "@/api/public"; import { imageBase64 } from "@/api/public";
import {
getCoupon,
getCollectAdd,
getCollectDel,
getUserInfo
} from "@/api/user";
const NAME = "GroupDetails"; const NAME = "GroupDetails";
export default { export default {
@ -188,7 +199,8 @@ export default {
cart_num: 1 cart_num: 1
} }
}, },
cartNum: 1 cartNum: 1,
userCollect: false
}; };
}, },
watch: { watch: {
@ -206,11 +218,27 @@ export default {
openAlone: function() { openAlone: function() {
this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId }); this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
}, },
//
setCollect: function() {
let that = this,
id = that.storeInfo.id,
category = "product";
if (that.userCollect) {
getCollectDel(id, category).then(function() {
that.userCollect = !that.userCollect;
});
} else {
getCollectAdd(id, category).then(function() {
that.userCollect = !that.userCollect;
});
}
},
mountedStart: function() { mountedStart: function() {
var that = this; var that = this;
console.log(that) console.log(that);
let id = that.$yroute.query.id; let id = that.$yroute.query.id;
getCombinationDetail(id).then(res => { getCombinationDetail(id).then(res => {
that.userCollect = res.data.userCollect;
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);
@ -323,13 +351,14 @@ export default {
</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;
width: 43%; width: 43%;
} }
.product-con .footer-group .bnt.bg-color-violet { .product-con .footer-group .bnt.bg-color-violet {

8
pages/home/index.vue

@ -43,7 +43,7 @@
<image class="bg" src="../../static/images/index-bg.png" mode="widthFix"></image> <image class="bg" src="../../static/images/index-bg.png" mode="widthFix"></image>
<view class="title acea-row row-between-wrapper"> <view class="title acea-row row-between-wrapper">
<view class="text"><view class="name line1">热门榜单</view></view> <view class="text"><view class="name line1">热门榜单</view></view>
<view @click="goHotNewGoods()" class="more"> <view @click="goHotNewGoods(2)" class="more">
更多 更多
<text class="iconfont icon-jiantou"></text> <text class="iconfont icon-jiantou"></text>
</view> </view>
@ -53,8 +53,8 @@
<view class="newProductsScroll"> <view class="newProductsScroll">
<view @click="goGoodsCon(item)" class="newProductsItem" v-for="(item, likeInfoIndex) in likeInfo" :key="likeInfoIndex"> <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="img-box"><image :src="item.image" /></view>
<view class="pro-info line1">{{ item.storeName }}</view> <view class="pro-info line1"><text>{{ item.storeName }}</text></view>
<view class="money font-color-red">{{ item.price }}</view> <view class="money font-color-red"><text>{{ item.price }}</text></view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -99,7 +99,7 @@
<view class="wrapper" v-if="benefit.length > 0"> <view class="wrapper" v-if="benefit.length > 0">
<view class="title acea-row row-between-wrapper"> <view class="title acea-row row-between-wrapper">
<view class="text"><view class="name line1">促销单品</view></view> <view class="text"><view class="name line1">促销单品</view></view>
<view @click="goGoodsPromotion()" class="more"> <view @click="goGoodsPromotion(4)" class="more">
更多 更多
<text class="iconfont icon-jiantou"></text> <text class="iconfont icon-jiantou"></text>
</view> </view>

5
pages/shop/GoodsCon/index.vue

@ -157,6 +157,9 @@
:src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey" :src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey"
></iframe> ></iframe>
</view> </view>
<div class="posterCanvasWarp">
<canvas class="posterCanvas" canvas-id="myCanvas"></canvas>
</div>
</view> </view>
</template> </template>
@ -510,7 +513,7 @@ export default {
this.$set(this.attr.productSelect, "stock", productSelect.stock); this.$set(this.attr.productSelect, "stock", productSelect.stock);
this.$set(this.attr.productSelect, "unique", productSelect.unique); this.$set(this.attr.productSelect, "unique", productSelect.unique);
this.$set(this.attr.productSelect, "cart_num", 1); this.$set(this.attr.productSelect, "cart_num", 1);
this.$set(this, "attrValue", res.value); this.$set(this, "attrValue", res.value);
this.$set(this, "attrTxt", "已选择"); this.$set(this, "attrTxt", "已选择");
} else { } else {
this.$set(this.attr.productSelect, "image", this.storeInfo.image); this.$set(this.attr.productSelect, "image", this.storeInfo.image);

2
pages/shop/HotNewGoods/index.vue

@ -56,7 +56,7 @@ export default {
} else if (type === "2") { } else if (type === "2") {
this.name = "热门榜单"; this.name = "热门榜单";
this.icon = "icon-remen"; this.icon = "icon-remen";
document.title = "热门榜单"; // document.title = "";
} else if (type === "3") { } else if (type === "3") {
this.name = "首发新品"; this.name = "首发新品";
this.icon = "icon-xinpin"; this.icon = "icon-xinpin";

40
utils/index.js

@ -122,13 +122,18 @@ export const replaceLogin = (msg) => {
console.log(uni, 989) console.log(uni, 989)
if (Vue.prototype.$deviceType == 'weixin') { if (Vue.prototype.$deviceType == 'weixin') {
// 如果是微信小程序,跳转到授权页 // 如果是微信小程序,跳转到授权页
replace({ login({
path: '/pages/authorization/index', fail: () => {
query: { replace({
redirect: `/${getCurrentPageUrl()}`, path: '/pages/authorization/index',
...parseQuery() query: {
redirect: `/${getCurrentPageUrl()}`,
...parseQuery()
}
})
} }
}) })
} else { } else {
// 如果不是小程序跳转到登录页 // 如果不是小程序跳转到登录页
push({ push({
@ -297,10 +302,17 @@ export const handleGetUserInfo = () => {
path: url, path: url,
query query
}) })
switchTab({ if (url == '/pages/home/index' || url == '/pages/shop/GoodsClass/index' || url == '/pages/shop/ShoppingCart/index' || url == '/pages/user/User/index') {
path: `${url}`, switchTab({
query path: `${url}`,
}); query
});
} else {
push({
path: `${url}`,
query
})
}
}) })
} }
@ -550,15 +562,16 @@ export const PosterCanvas = (store, successCallBack) => {
mask: true mask: true
}); });
getImageInfo([store.image, store.code]).then(res => { getImageInfo([store.image, store.code]).then(res => {
console.log(res)
let contentHh = 48 * 1.3 let contentHh = 48 * 1.3
const ctx = uni.createCanvasContext('myCanvas'); const ctx = uni.createCanvasContext('myCanvas')
ctx.clearRect(0, 0, 0, 0); ctx.clearRect(0, 0, 0, 0);
const WIDTH = 747 const WIDTH = 747
const HEIGHT = 1326; const HEIGHT = 1326;
ctx.fillStyle = "#FFFFFF"; ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, WIDTH, HEIGHT); ctx.fillRect(0, 0, WIDTH, HEIGHT);
ctx.drawImage(res[1].path, 40, 1064, 200, 200);
ctx.drawImage(res[0].path, 0, 0, WIDTH, WIDTH); ctx.drawImage(res[0].path, 0, 0, WIDTH, WIDTH);
ctx.drawImage(res[1].path, 40, 1064, 200, 200);
ctx.save(); ctx.save();
let r = 90; let r = 90;
let d = r * 2; let d = r * 2;
@ -578,10 +591,10 @@ export const PosterCanvas = (store, successCallBack) => {
ctx.setTextAlign('center') ctx.setTextAlign('center')
ctx.setFontSize(22); ctx.setFontSize(22);
ctx.setFillStyle('#333333'); ctx.setFillStyle('#333333');
console.log('长按识别二维码立即购买')
ctx.fillText('长按识别二维码立即购买', WIDTH / 2, 1167); ctx.fillText('长按识别二维码立即购买', WIDTH / 2, 1167);
// ctx.drawImage(store.code, 199, 1064, 200, 200);
ctx.save(); ctx.save();
ctx.draw(true, function (oi) { ctx.draw(true, () => {
uni.canvasToTempFilePath({ uni.canvasToTempFilePath({
canvasId: 'myCanvas', canvasId: 'myCanvas',
fileType: 'png', fileType: 'png',
@ -597,6 +610,7 @@ export const PosterCanvas = (store, successCallBack) => {
}) })
}); });
}) })
// uni.getImageInfo({ // uni.getImageInfo({

Loading…
Cancel
Save