feat:v1.4前端更新

This commit is contained in:
超凡
2025-06-24 14:43:09 +08:00
parent 0268aa5033
commit 35fec82e4a
1026 changed files with 118424 additions and 56490 deletions

View File

@@ -1,338 +1,352 @@
<template>
<view>
<block v-if="bargain.length>0">
<div class="bargain-record pad30" ref="container">
<div class="item borRadius14" v-for="(item, index) in bargain" :key="index">
<div class="picTxt acea-row row-between-wrapper">
<div class="pictrue">
<image :src="item.image" />
</div>
<div class="text acea-row row-column-around">
<div class="line1" style="width: 100%;">{{ item.title }}</div>
<count-down :justify-left="'justify-content:left'" :bgColor="bgColor" :is-day="true" :tip-text="'倒计时 '" :day-text="'天'"
:hour-text="' '" :minute-text="' '"
:second-text="' '" :datatime="item.stopTime/1000" v-if="item.status === 1"></count-down>
<div class="successTxt font-color-red" v-else-if="item.status === 3">砍价成功</div>
<div class="endTxt" v-else>活动已结束</div>
<div class="money">
已砍至<span class="symbol font-color-red"></span><span class="num font-color-red">{{ item.surplusPrice }}</span>
</div>
</div>
</div>
<div class="bottom acea-row row-between-wrapper">
<div class="purple" v-if="item.status === 1">活动进行中</div>
<div class="success" v-else-if="item.status === 3">砍价成功</div>
<div class="end" v-else>活动已结束</div>
<div class="acea-row row-middle row-right">
<div class="bnt bg-color-red" v-if="item.status === 3 && !item.isOrder" @click="goConfirm(item)">
去付款
</div>
<div class="bnt bg-color-red" v-if="item.status === 3 && !item.isDel && item.isOrder && !item.isPay" @click="goPay(item.surplusPrice,item.orderNo)">
立即付款
</div>
<div class="bnt bg-color-red" v-if="item.status === 1" @click="goDetail(item.id)">
继续砍价
</div>
<div class="bnt bg-color-red" v-if="item.status === 2" @click="goList">重开一个</div>
</div>
</div>
</div>
<Loading :loaded="status" :loading="loadingList"></Loading>
</div>
</block>
<block v-if="bargain.length == 0">
<emptyPage title="暂无砍价记录~"></emptyPage>
</block>
<home></home>
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
</view>
</template>
<script>
import CountDown from "@/components/countDown";
import emptyPage from '@/components/emptyPage.vue'
import {
getBargainUserList,
getBargainUserCancel
} from "@/api/activity";
import Loading from "@/components/Loading";
import home from '@/components/home';
import payment from '@/components/payment';
import {
mapGetters
} from "vuex";
export default {
name: "BargainRecord",
components: {
CountDown,
Loading,
emptyPage,
home,
payment
},
props: {},
computed: mapGetters(['isLogin', 'userInfo', 'uid']),
data: function() {
return {
bgColor:{
'bgColor': '',
'Color': '#E93323',
'width': '40rpx',
'timeTxtwidth': '28rpx',
'isDay': false
},
bargain: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20, //数量
payMode: [{
name: "微信支付",
icon: "icon-weixinzhifu",
value: 'weixin',
title: '微信快捷支付'
},
{
name: "余额支付",
icon: "icon-yuezhifu",
value: 'yue',
title: '可用余额:',
number: 0
}
],
pay_close: false,
pay_order_id: '',
totalPrice: '0'
};
},
onLoad: function() {
this.getBargainUserList();
// this.$scroll(this.$refs.container, () => {
// !this.loadingList && this.getBargainUserList();
// });
},
onShow() {
if (this.isLogin) {
this.payMode[1].number = this.userInfo.nowMoney;
this.$set(this, 'payMode', this.payMode);
} else {
toLogin();
}
},
methods: {
/**
* 打开支付组件
*
*/
goPay(pay_price, order_id) {
this.$set(this, 'pay_close', true);
this.$set(this, 'pay_order_id', order_id);
this.$set(this, 'totalPrice', pay_price);
},
/**
* 事件回调
*
*/
onChangeFun: function(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
/**
* 关闭支付组件
*
*/
payClose: function() {
this.pay_close = false;
},
/**
* 支付成功回调
*
*/
pay_complete: function() {
this.status = false;
this.page = 1;
this.$set(this, 'bargain', []);
this.$set(this, 'pay_close', false);
this.getBargainUserList();
},
/**
* 支付失败回调
*
*/
pay_fail: function() {
this.pay_close = false;
},
goConfirm: function(item) { //立即支付
if (this.isLogin === false) {
toLogin();
} else {
uni.navigateTo({
url: `/pages/activity/goods_bargain_details/index?id=${item.id}&startBargainUid=${this.uid}&storeBargainId=${item.bargainUserId}`
})
}
},
goDetail: function(id) {
uni.navigateTo({
url: `/pages/activity/goods_bargain_details/index?id=${id}&startBargainUid=${this.uid}`
})
},
// 砍价列表
goList: function() {
uni.navigateTo({
url: '/pages/activity/goods_bargain/index'
})
},
getBargainUserList: function() {
var that = this;
if (that.loadingList) return;
if (that.status) return;
getBargainUserList({
page: that.page,
limit: that.limit
})
.then(res => {
that.status = res.data.list.length < that.limit;
that.bargain.push.apply(that.bargain, res.data.list);
that.page++;
that.loadingList = false;
})
.catch(res => {
that.$dialog.error(res);
});
},
getBargainUserCancel: function(bargainId) {
var that = this;
getBargainUserCancel({
bargainId: bargainId
})
.then(res => {
that.status = false;
that.loadingList = false;
that.page = 1;
that.bargain = [];
that.getBargainUserList();
that.$util.Tips({
title: res
})
})
.catch(res => {
that.$util.Tips({
title: res
})
});
}
},
onReachBottom() {
this.getBargainUserList();
}
};
</script>
<style lang="scss" scoped>
/*砍价记录*/
.bargain-record .item .picTxt .text .time {
height: 36rpx;
line-height: 36rpx;
.styleAll {
color: #fc4141;
font-size:24rpx;
}
}
.bargain-record .item .picTxt .text .time .red {
color: #999;
font-size:24rpx;
}
.bargain-record .item {
background-color: #fff;
margin-top: 15rpx;
padding: 30rpx 24rpx 0 24rpx;
}
.bargain-record .item .picTxt {
border-bottom: 1px solid #f0f0f0;
padding-bottom: 30rpx;
}
.bargain-record .item .picTxt .pictrue {
width: 150upx;
height: 150upx;
}
.bargain-record .item .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 6upx;
}
.bargain-record .item .picTxt .text {
width: 470rpx;
font-size: 30upx;
color: #333333;
height: 160rpx;
}
.bargain-record .item .picTxt .text .time {
font-size: 24upx;
color: #868686;
justify-content: left !important;
}
.bargain-record .item .picTxt .text .successTxt{
font-size:24rpx;
}
.bargain-record .item .picTxt .text .endTxt{
font-size:24rpx;
color: #999;
}
.bargain-record .item .picTxt .text .money {
font-size: 24upx;
color: #999999;
}
.bargain-record .item .picTxt .text .money .num {
font-size: 32upx;
font-weight: bold;
}
.bargain-record .item .picTxt .text .money .symbol {
font-weight: bold;
}
.bargain-record .item .bottom {
height: 100upx;
font-size: 27upx;
}
.bargain-record .item .bottom .purple {
color: #f78513;
}
.bargain-record .item .bottom .end {
color: #999;
}
.bargain-record .item .bottom .success {
color: $theme-color;
}
.bargain-record .item .bottom .bnt {
font-size: 27upx;
color: #fff;
width: 176upx;
height: 60upx;
border-radius: 32upx;
text-align: center;
line-height: 60upx;
}
.bargain-record .item .bottom .bnt.cancel {
color: #aaa;
border: 1px solid #ddd;
}
.bargain-record .item .bottom .bnt~.bnt {
margin-left: 18upx;
}
</style>
<template>
<view :data-theme="theme">
<block v-if="bargain.length>0">
<div class="bargain-record" ref="container">
<div class="item borRadius14" v-for="(item, index) in bargain" :key="index">
<div class="picTxt acea-row row-between-wrapper">
<div class="pictrue">
<image :src="item.image" />
</div>
<div class="text acea-row row-column-around">
<div class="line1" style="width: 100%;">{{ item.title }}</div>
<count-down :justify-left="'justify-content:left'" :bgColor="bgColor" :is-day="true" :tip-text="'倒计时 '" :day-text="'天'"
:hour-text="' '" :minute-text="' '"
:second-text="' '" :datatime="item.stopTime/1000" v-if="item.status === 1"></count-down>
<div class="successTxt font_color" v-else-if="item.status === 3 && item.isDel === false">砍价成功</div>
<div class="successTxt " v-else-if="item.status === 3 && item.isDel === true && item.isPay === false">砍价失败</div>
<div class="endTxt" v-else>活动已结束</div>
<div class="money">
已砍至<span class="symbol font_color"></span><span class="num font_color">{{ item.surplusPrice }}</span>
</div>
</div>
</div>
<div class="bottom acea-row row-between-wrapper">
<div class="purple" v-if="item.status === 1">活动进行中</div>
<div class="success" v-else-if="item.status === 3 && item.isDel === false">砍价成功</div>
<div class="end" v-else-if="item.status === 3 && item.isDel === true && item.isPay === false">砍价失败</div>
<div class="end" v-else>活动已结束</div>
<div class="acea-row row-middle row-right">
<div class="bnt bg_color" v-if="item.status === 3 && !item.isOrder" @click="goConfirm(item)">
去付款
</div>
<div class="bnt bg_color" v-if="item.status === 3 && !item.isDel && item.isOrder && !item.isPay" @click="goPay(item.surplusPrice,item.orderNo)">
立即付款
</div>
<div class="bnt bg_color" v-if="item.status === 1" @click="goDetail(item.id)">
继续砍价
</div>
<div class="bnt bg_color" v-if="item.status === 2" @click="goList">重开一个</div>
</div>
</div>
</div>
<Loading :loaded="status" :loading="loadingList"></Loading>
</div>
</block>
<block v-if="bargain.length == 0">
<emptyPage title="暂无砍价记录~"></emptyPage>
</block>
<payment :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment>
</view>
</template>
<script>
import CountDown from "@/components/countDown";
import emptyPage from '@/components/emptyPage.vue'
import {
getBargainUserList,
getBargainUserCancel
} from "@/api/activity";
import Loading from "@/components/Loading";
import payment from '@/components/payment';
import {mapGetters} from "vuex";
import {setThemeColor} from '@/utils/setTheme.js'
import animationType from '@/utils/animationType.js'
let app = getApp();
export default {
name: "BargainRecord",
components: {
CountDown,
Loading,
emptyPage,
payment
},
props: {},
computed: mapGetters(['isLogin', 'userInfo', 'uid']),
data: function() {
return {
bgColor:{
'bgColor': '',
'Color': '#E93323',
'width': '40rpx',
'timeTxtwidth': '28rpx',
'isDay': false
},
bargain: [],
status: false, //砍价列表是否获取完成 false 未完成 true 完成
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
page: 1, //页码
limit: 20, //数量
payMode: [{
name: "微信支付",
icon: "icon-weixinzhifu",
value: 'weixin',
title: '微信快捷支付'
},
{
name: "余额支付",
icon: "icon-yuezhifu",
value: 'yue',
title: '可用余额:',
number: 0
}
],
pay_close: false,
pay_order_id: '',
totalPrice: '0',
theme:app.globalData.theme
};
},
onShow() {
if (this.isLogin) {
this.payMode[1].number = this.userInfo.nowMoney;
this.$set(this, 'payMode', this.payMode);
this.getBargainUserList();
this.bgColor.Color = setThemeColor();
} else {
toLogin();
}
},
methods: {
/**
* 打开支付组件
*
*/
goPay(pay_price, order_id) {
this.$set(this, 'pay_close', true);
this.$set(this, 'pay_order_id', order_id);
this.$set(this, 'totalPrice', pay_price);
},
/**
* 事件回调
*
*/
onChangeFun: function(e) {
let opt = e;
let action = opt.action || null;
let value = opt.value != undefined ? opt.value : null;
(action && this[action]) && this[action](value);
},
/**
* 关闭支付组件
*
*/
payClose: function() {
this.pay_close = false;
},
/**
* 支付成功回调
*
*/
pay_complete: function() {
this.status = false;
this.page = 1;
this.$set(this, 'bargain', []);
this.$set(this, 'pay_close', false);
this.getBargainUserList();
},
/**
* 支付失败回调
*
*/
pay_fail: function() {
this.pay_close = false;
},
goConfirm: function(item) { //立即支付
if (this.isLogin === false) {
toLogin();
} else {
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url: `/pages/activity/goods_bargain_details/index?id=${item.id}&startBargainUid=${this.uid}&storeBargainId=${item.bargainUserId}`
})
}
},
goDetail: function(id) {
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url: `/pages/activity/goods_bargain_details/index?id=${id}&startBargainUid=${this.uid}`
})
},
// 砍价列表
goList: function() {
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url: '/pages/activity/goods_bargain/index'
})
},
getBargainUserList: function() {
var that = this;
if (that.loadingList) return;
if (that.status) return;
getBargainUserList({
page: that.page,
limit: that.limit
})
.then(res => {
that.status = res.data.list.length < that.limit;
that.bargain.push.apply(that.bargain, res.data.list);
that.page++;
that.loadingList = false;
})
.catch(res => {
that.$dialog.error(res);
});
},
getBargainUserCancel: function(bargainId) {
var that = this;
getBargainUserCancel({
bargainId: bargainId
})
.then(res => {
that.status = false;
that.loadingList = false;
that.page = 1;
that.bargain = [];
that.getBargainUserList();
that.$util.Tips({
title: res
})
})
.catch(res => {
that.$util.Tips({
title: res
})
});
}
},
onReachBottom() {
this.getBargainUserList();
}
};
</script>
<style lang="scss">
page {
@include main_bg_color(theme);
height: 100vh;
overflow: auto;
}
</style>
<style lang="scss" scoped>
/*砍价记录*/
.bargain-record{
padding: 0 30rpx 15rpx;
}
.bargain-record .item .picTxt .text .time {
height: 36rpx;
line-height: 36rpx;
.styleAll {
color: #fc4141;
font-size:24rpx;
}
}
.bargain-record .item .picTxt .text .time .red {
color: #999;
font-size:24rpx;
}
.bargain-record .item {
background-color: #fff;
margin-top: 15rpx;
padding: 30rpx 24rpx 0 24rpx;
}
.bargain-record .item .picTxt {
border-bottom: 1px solid #f0f0f0;
padding-bottom: 30rpx;
}
.bargain-record .item .picTxt .pictrue {
width: 150upx;
height: 150upx;
}
.bargain-record .item .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 6upx;
}
.bargain-record .item .picTxt .text {
width: 470rpx;
font-size: 30upx;
color: #333333;
height: 160rpx;
}
.bargain-record .item .picTxt .text .time {
font-size: 24upx;
color: #868686;
justify-content: left !important;
}
.bargain-record .item .picTxt .text .successTxt{
font-size:24rpx;
}
.bargain-record .item .picTxt .text .endTxt{
font-size:24rpx;
color: #999;
}
.bargain-record .item .picTxt .text .money {
font-size: 24upx;
color: #999999;
}
.bargain-record .item .picTxt .text .money .num {
font-size: 32upx;
font-weight: bold;
}
.bargain-record .item .picTxt .text .money .symbol {
font-weight: bold;
}
.bargain-record .item .bottom {
height: 100upx;
font-size: 27upx;
}
.bargain-record .item .bottom .purple {
color: #f78513;
}
.bargain-record .item .bottom .end {
color: #999;
}
.bargain-record .item .bottom .success {
color: $theme-color;
}
.bargain-record .item .bottom .bnt {
font-size: 27upx;
color: #fff;
width: 176upx;
height: 60upx;
border-radius: 32upx;
text-align: center;
line-height: 60upx;
}
.bg_color{
@include main_bg_color(theme);
}
.font_color{
@include price_color(theme);
}
.bargain-record .item .bottom .bnt.cancel {
color: #aaa;
border: 1px solid #ddd;
}
.bargain-record .item .bottom .bnt~.bnt {

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,14 @@
<template>
<div :data-theme="theme">
<div class="group-con">
<div class="header acea-row row-between-wrapper">
<div class="pictrue"><img :src="storeCombination.image" /></div>
<div class="pictrue"><image :src="storeCombination.image" /></div>
<div class="text">
<div class="line1" v-text="storeCombination.title"></div>
<div class="money">
<div class="money font_price">
<span class="num" v-text="storeCombination.price || 0"></span>
<span class="team cart-color">{{storeCombination.people +'人拼'}}</span>
<span class="team cart-color">{{storeCombination.people?storeCombination.people:0 }}人拼</span>
</div>
</div>
<div v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></div>
@@ -30,14 +31,15 @@
<div class="list acea-row row-middle"
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '', iShidden ? 'on' : '']">
<div class="pinkT">
<div class="pictrue"><img :src="pinkT.avatar" /></div>
<div class="pictrue"><image :src="pinkT.avatar" /></div>
<div class="chief">团长</div>
</div>
<block v-if="pinkAll.length > 0">
<div class="pictrue" v-for="(item, index) in pinkAll" :key="index"><img :src="item.avatar" /></div>
<div class="pictrue" v-for="(item, index) in pinkAll" :key="index"><image :src="item.avatar" /></div>
</block>
<div class="pictrue" v-for="index in count" :key="index"><img class="img-none"
src="/static/images/vacancy.png" /></div>
<div class="pictrue" v-for="index in count" :key="index">
<image class="img-none" :src="urlDomain+'crmebimage/perset/activityImg/vacancy.png'" />
</div>
</div>
<div v-if="(pinkBool === 1 || pinkBool === -1) && count > 9" class="lookAll acea-row row-center-wrapper"
@click="lookAll">
@@ -80,20 +82,33 @@
<div class="list acea-row row-middle">
<div class="item" v-for="(item, index) in storeCombinationHost" :key="index" @click="goDetail(item.id)">
<div class="pictrue">
<img :src="item.image" />
<image :src="item.image" />
<div class="team" v-text="item.people + '人团'"></div>
</div>
<div class="name line1" v-text="item.title"></div>
<div class="money font-color-red" v-text="'' + item.price"></div>
<div class="money font_price" v-text="'' + item.price"></div>
</div>
</div>
</div>
<product-window :attr="attr" :limitNum="1" :iSbnt="1" @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
<product-window :attr="attr" :onceNum="onceNum" :limitNum="1" :iSbnt="1" @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
@ChangeCartNum="ChangeCartNum" @iptCartNum="iptCartNum" @attrVal="attrVal" @goCat="goPay"></product-window>
<!-- 分享按钮 -->
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<!-- #ifdef APP-PLUS -->
<view class="item" @click="appShare('WXSceneSession')">
<view class="iconfont icon-weixin3"></view>
<view class="">微信好友</view>
</view>
<view class="item" @click="appShare('WXSenceTimeline')">
<view class="iconfont icon-pengyouquan"></view>
<view class="">微信朋友圈</view>
</view>
<!-- #endif -->
</view>
<view class="mask" v-if="posters || canvasStatus" @click="listenerActionClose"></view>
<!-- 发送给朋友图片 -->
<view class="share-box" v-if="H5ShareBox">
<image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/share-info.png'" @click="H5ShareBox = false"></image>
</view>
<!-- 海报展示 -->
<view class='poster-pop' v-if="canvasStatus">
@@ -111,17 +126,16 @@
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"
style="opacity: 0;" />
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</div>
</div>
</template>
<script>
import CountDown from '@/components/countDown';
import ProductWindow from '@/components/productWindow';
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js';
import {
tokenIsExistApi
} from '@/api/api.js';
import {
imageBase64
} from "@/api/public";
@@ -139,25 +153,26 @@
import {
postCartAdd
} from '@/api/store';
// #ifdef MP
import authorize from '@/components/Authorize';
// #ifdef APP-PLUS
import {
HTTP_H5_URL
} from '@/config/app.js';
// #endif
import home from '@/components/home';
const NAME = 'GroupRule';
import {
silenceBindingSpread
} from "@/utils";
const app = getApp();
export default {
name: NAME,
components: {
CountDown,
ProductWindow,
home,
// #ifdef MP
authorize
// #endif
ProductWindow
},
props: {},
data: function() {
return {
urlDomain: this.$Cache.get("imgHost"),
bgColor: {
'bgColor': '#333333',
'Color': '#fff',
@@ -171,7 +186,7 @@
userBool: 0, //判断当前用户是否在团内|0=未在,1=在
pinkAll: [], //团员
pinkT: [], //团长信息
storeCombination: {}, //拼团产品
storeCombination: null, //拼团产品
storeCombinationHost: [], //拼团推荐
pinkId: 0,
count: 0, //拼团剩余人数
@@ -210,20 +225,23 @@
PromotionCode: '', //二维码
canvasStatus: false,
imgTop: '', //商品图base64位
imagePath: '' // 海报图片
imagePath: '', // 海报图片
theme:app.globalData.theme,
vacancyPic: require('../static/vacancy.png'),
tokenIsExist: app.globalData.tokenIsExist ,//登录是否失效
openPages: '' //分享链接
};
},
watch: {
userData: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.userInfo = newV;
app.globalData.openPages = '/pages/activity/goods_combination_status/index?id=' + this.pinkId +
"&spread=" + this.uid;
this.getCombinationPink();
if(parseInt(app.globalData.spread)>0)silenceBindingSpread()
}
},
deep: true
}
},
},
computed: mapGetters({
'isLogin': 'isLogin',
@@ -231,21 +249,40 @@
'uid': 'uid'
}),
onLoad(options) {
var that = this;
that.pinkId = options.id;
if (that.isLogin == false) {
toLogin();
} else {
this.loadend = false;
this.loading = false;
this.combinationMore();
this.$set(this,'theme',this.$Cache.get('theme'));
this.pinkId = options.id;
if(options.spread) app.globalData.spread = options.spread;
switch (this.theme) {
case 'theme1':
this.posterbackgd = require('../images/bargain_post1.png') // 因为跨域不能使用网络图片,
break;
case 'theme2':
this.posterbackgd = require('../images/bargain_post2.png')
break;
case 'theme3':
this.posterbackgd = require('../images/bargain_post3.png')
break;
case 'theme4':
this.posterbackgd = require('../images/bargain_post4.png')
break;
case 'theme5':
this.posterbackgd = require('../images/bargain_post5.png')
break;
}
if (this.isLogin) {
this.timestamp = (new Date()).getTime();
this.getCombinationPink();
if(parseInt(app.globalData.spread)>0)silenceBindingSpread()
}else{
this.$Cache.set('login_back_url',
`/pages/activity/goods_combination_status/index?id=${options.id}&spread=${app.globalData.spread?app.globalData.spread:0}`
);
toLogin();
}
},
onShow() {},
mounted: function() {
this.combinationMore();
},
// link: window.location.protocol + '//' + window.location.host +
// '/pages/activity/goods_combination_status/index?id=' + that.pinkId + "&spread=" + this.uid,
//#ifdef MP
/**
* 用户点击右上角分享
@@ -254,12 +291,53 @@
let that = this;
return {
title: '您的好友' + that.userInfo.nickname + '邀请您参团' + that.storeCombination.title,
path: app.globalData.openPages,
path: that.openPages,
imageUrl: that.storeCombination.image
};
},
//#endif
methods: {
//校验token是否有效,true为有效false为无效
getTokenIsExist() {
//校验token是否有效,true为有效false为无效
this.$LoginAuth.getTokenIsExist().then(data => {
this.combinationMore();
if (data) {
this.timestamp = (new Date()).getTime();
this.getCombinationPink();
silenceBindingSpread()
}else{
toLogin();
}
});
},
// app分享
// #ifdef APP-PLUS
appShare(scene) {
let that = this
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
let curRoute = routes[routes.length - 1].$page.fullPath // 获取当前页面路由,也就是最后一个打开的页面路由
uni.share({
provider: "weixin",
scene: scene,
type: 0,
href: `${HTTP_H5_URL}${curRoute}`,
title: '您的好友' + that.userInfo.nickname + '邀请您参团' + that.storeCombination.title,
imageUrl: that.storeCombination.image,
success: function(res) {
that.posters = false;
},
fail: function(err) {
uni.showToast({
title: '分享失败',
icon: 'none',
duration: 2000
})
that.posters = false;
}
});
},
// #endif
// 分享关闭
listenerActionClose: function() {
this.posters = false;
@@ -293,16 +371,6 @@
});
});
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e;
},
// 授权后回调
onLoadFun: function(e) {
this.userInfo = e;
app.globalData.openPages = '/pages/activity/goods_combination_status/index?id=' + this.pinkId;
this.getCombinationPink();
},
/**
* 购物车手动填写
*
@@ -364,9 +432,13 @@
}
},
ChangeCartNum: function(res) {
//changeValue:是否 加|减
//获取当前变动属性
let productSelect = this.productValue[this.attrValue];
if (this.onceNum === productSelect.cart_num) {
return this.$util.Tips({
title: `该商品每次限购${this.onceNum}${this.storeCombination.unitName}`
});
}
if (this.cart_num) {
productSelect.cart_num = this.cart_num;
this.attr.productSelect.cart_num = this.cart_num;
@@ -534,11 +606,15 @@
});
}
//#endif
//#ifdef APP-PLUS
this.posters = true;
//#endif
},
goOrder: function() {
var that = this;
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + that.currentPinkOrder
url: '/pages/order/order_details/index?order_id=' + that.currentPinkOrder
});
},
//拼团列表
@@ -588,6 +664,8 @@
var that = this;
getCombinationPink(that.pinkId)
.then(res => {
that.openPages = '/pages/activity/goods_combination_status/index?id=' + that.pinkId +
"&spread=" + that.uid;
let storeCombination = res.data.storeCombination;
res.data.pinkT.stop_time = parseInt(res.data.pinkT.stopTime);
that.$set(that, 'storeCombination', storeCombination);
@@ -639,7 +717,7 @@
'onMenuShareTimeline'
], configTimeline)
.then(res => {
console.log(res);
})
.catch(res => {
if (res.is_ready) {
@@ -679,6 +757,37 @@
};
</script>
<style lang="scss" scoped>
.generate-posters {
width: 100%;
height: 170rpx;
background-color: #fff;
position: fixed;
left: 0;
bottom: 0;
z-index: 300;
transform: translate3d(0, 100%, 0);
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
border-top: 1rpx solid #eee;
}
.generate-posters.on {
transform: translate3d(0, 0, 0);
}
.generate-posters .item {
flex: 1;
text-align: center;
font-size: 30rpx;
}
.generate-posters .item .iconfont {
font-size: 80rpx;
color: #5eae72;
}
.generate-posters .item .iconfont.icon-haibao {
color: #5391f1;
}
.pinkT {
position: relative;
@@ -686,7 +795,7 @@
position: absolute;
width: 72rpx;
height: 30rpx;
background-color: #E93323;
@include main_bg_color(theme);
border-radius: 15rpx;
font-size: 20rpx;
line-height: 30rpx;
@@ -696,7 +805,9 @@
color: #fff;
}
}
.bg-color-red{
@include main_bg_color(theme);
}
.canvas {
position: fixed;
opacity: 0;
@@ -745,11 +856,11 @@
/*开团*/
.group-con .header {
width: 100%;
height: 186rpx;
background-color: #fff;
border-top: 1px solid #f5f5f5;
padding: 0 30rpx;
margin: 20rpx 30rpx 0;
border-radius: 14rpx;
position: relative;
}
@@ -766,7 +877,7 @@
height: 140rpx;
}
.group-con .header .pictrue img {
.group-con .header .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
@@ -795,16 +906,20 @@
font-size: 20rpx;
vertical-align: 4rpx;
margin-left: 15rpx;
@include main_color(theme);
@include coupons_border_color(theme);
}
.group-con .wrapper {
background-color: #fff;
margin-top: 20rpx;
padding: 2rpx 0 35rpx 0;
margin: 20rpx 30rpx 0;
border-radius: 14rpx;
padding-bottom: 20rpx;
}
.group-con .wrapper .title {
margin-top: 30rpx;
padding-top: 30rpx;
}
.group-con .wrapper .title .line {
@@ -866,14 +981,14 @@
margin: 0 0 29rpx 35rpx;
}
.group-con .wrapper .list .pictrue img {
.group-con .wrapper .list .pictrue image {
width: 100%;
height: 100%;
border-radius: 50%;
border: 2rpx solid #e93323;
@include coupons_border_color(theme);
}
.group-con .wrapper .list .pictrue img.img-none {
.group-con .wrapper .list .pictrue image.img-none {
border: none;
}
@@ -897,6 +1012,7 @@
line-height: 86rpx;
color: #fff;
margin: 21rpx auto 0 auto;
}
.group-con .wrapper .cancel,
@@ -905,6 +1021,7 @@
font-size: 24rpx;
color: #282828;
padding-top: 30rpx;
padding-bottom:30rpx;
}
.group-con .wrapper .cancel .iconfont {
@@ -922,7 +1039,8 @@
.group-con .group-recommend {
background-color: #fff;
margin-top: 25rpx;
margin: 20rpx 30rpx 0;
border-radius: 14rpx;
}
.group-con .group-recommend .title {
@@ -948,17 +1066,17 @@
}
.group-con .group-recommend .list .item {
width: 210rpx;
width: 190rpx;
margin: 0 0 25rpx 30rpx;
}
.group-con .group-recommend .list .item .pictrue {
width: 100%;
height: 210rpx;
height: 190rpx;
position: relative;
}
.group-con .group-recommend .list .item .pictrue img {
.group-con .group-recommend .list .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 10rpx;
@@ -975,9 +1093,7 @@
border-radius: 0 18rpx 18rpx 0;
font-size: 20rpx;
color: #fff;
background-image: linear-gradient(to right, #fb5445 0%, #e93323 100%);
background-image: -webkit-linear-gradient(to right, #fb5445 0%, #e93323 100%);
background-image: -moz-linear-gradient(to right, #fb5445 0%, #e93323 100%);
@include main_bg_color(theme);
}
.group-con .group-recommend .list .item .name {
@@ -1004,4 +1120,7 @@
height: 100%;
}
}
.font_price{
@include price_color(theme);
}
</style>

View File

@@ -1,70 +1,74 @@
<template>
<div>
<view class='flash-sale'>
<!-- #ifdef H5 -->
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (navH/2) +'rpx'" v-if="returnShow"></view>
<!-- #endif -->
<view class="saleBox"></view>
<view class="header" v-if="dataList.length">
<swiper indicator-dots="true" autoplay="true" :circular="circular" interval="3000" duration="1500"
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(items,index) in dataList[active].slide" :key="index">
<swiper-item class="borRadius14">
<image :src="items.sattDir" class="slide-image borRadius14" lazy-load></image>
</swiper-item>
</block>
</swiper>
</view>
<view class="seckillList acea-row row-between-wrapper">
<view class="priceTag">
<image src="/static/images/priceTag.png"></image>
</view>
<view class='timeLsit'>
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft"
style="width:auto;overflow:hidden;">
<block v-for="(item,index) in dataList" :key='index'>
<view @tap='settimeList(item,index)' class='item' :class="active == index?'on':''">
<view class='time'>{{item.time.split(',')[0]}}</view>
<view class="state">{{item.statusName}}</view>
</view>
<view :data-theme="theme">
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
bgcolor="#FFF"></skeleton>
<view class="skeleton" :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
<view class="combinationBj"></view>
<view class='flash-sale'>
<!-- #ifdef H5 -->
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (navH/2) +'rpx'" v-if="returnShow"></view>
<!-- #endif -->
<view class="saleBox"></view>
<view class="header skeleton-rect" v-if="dataList.length">
<swiper indicator-dots="true" autoplay="true" :circular="circular" interval="3000" duration="1500"
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(items,index) in dataList[active].slide" :key="index">
<swiper-item class="borRadius14">
<image :src="items.sattDir" class="slide-image borRadius14" lazy-load></image>
</swiper-item>
</block>
</scroll-view>
</swiper>
</view>
<view class="seckillList acea-row row-between-wrapper">
<view class="priceTag skeleton-rect">
<image :src="urlDomain+'crmebimage/perset/staticImg/priceTag.png'"></image>
</view>
<view class='timeLsit'>
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft"
style="width:auto;overflow:hidden;">
<block v-for="(item,index) in dataList" :key='index'>
<view @tap='settimeList(item,index)' class='item' :class="active == index?'on':''">
<view class='time'>{{item.time.split(',')[0]}}</view>
<view class="state">{{item.statusName}}</view>
</view>
</block>
</scroll-view>
</view>
</view>
<view class='list pad30' v-if='seckillList.length>0'>
<block v-for="(item,index) in seckillList" :key='index'>
<view class='item acea-row row-between-wrapper' @tap='goDetails(item)'>
<view class='pictrue skeleton-rect'>
<image :src='item.image'></image>
</view>
<view class='text acea-row row-column-around'>
<view class='name line1 skeleton-rect'>{{item.title}}</view>
<view class='money skeleton-rect'><text class="font_color">¥</text>
<text class='num font_color'>{{item.price}}</text>
<text class="y_money">¥{{item.otPrice}}</text>
</view>
<view class="limit skeleton-rect">限量 <text class="limitPrice">{{item.quota}} {{item.unitName}}</text>
</view>
<view class="progress skeleton-rect">
<view class='bg-reds' :style="'width:'+item.percent+'%;'"></view>
<view class='piece'>已抢{{item.percent}}%</view>
</view>
</view>
<view class='grab bg_color' v-if="status == 2">马上抢</view>
<view class='grab bg_color' v-else-if="status == 1">未开始</view>
<view class='grab bg-color-hui' v-else>已结束</view>
</view>
</block>
</view>
</view>
<view class='list pad30' v-if='seckillList.length>0'>
<block v-for="(item,index) in seckillList" :key='index'>
<view class='item acea-row row-between-wrapper' @tap='goDetails(item)'>
<view class='pictrue'>
<image :src='item.image'></image>
</view>
<view class='text acea-row row-column-around'>
<view class='name line1'>{{item.title}}</view>
<view class='money'><text class="font-color">¥</text>
<text class='num font-color'>{{item.price}}</text>
<text class="y_money">¥{{item.otPrice}}</text>
</view>
<view class="limit">限量 <text class="limitPrice">{{item.quota}} {{item.unitName}}</text>
</view>
<view class="progress">
<view class='bg-reds' :style="'width:'+item.percent+'%;'"></view>
<view class='piece'>已抢{{item.percent}}%</view>
</view>
</view>
<view class='grab bg-color' v-if="status == 2">马上抢</view>
<view class='grab bg-color' v-else-if="status == 1">未开始</view>
<view class='grab bg-color-hui' v-else>已结束</view>
</view>
</block>
<view class='noCommodity' v-if="seckillList.length == 0 && (page != 1 || active== 0)">
<view class='pictrue'>
<image :src="urlDomain+'crmebimage/perset/staticImg/noShopper.png'"></image>
</view>
</view>
</view>
<view class='noCommodity' v-if="seckillList.length == 0 && (page != 1 || active== 0)">
<view class='pictrue'>
<image src='../../../static/images/noShopper.png'></image>
</view>
</view>
<home></home>
</div>
</view>
</view>
</template>
<script>
@@ -72,14 +76,14 @@
getSeckillHeaderApi,
getSeckillList
} from '../../../api/activity.js';
import home from '@/components/home/index.vue';
import animationType from '@/utils/animationType.js'
let app = getApp();
export default {
components: {
home
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
showSkeleton: true, //骨架屏显示隐藏
isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
circular: true,
autoplay: true,
interval: 500,
@@ -94,16 +98,21 @@
countDownMinute: "00",
countDownSecond: "00",
page: 1,
limit: 4,
limit: 10,
loading: false,
loadend: false,
pageloading: false,
dataList: [],
returnShow: true,
navH: ''
navH: '',
theme:app.globalData.theme
}
},
onLoad() {
let that = this;
setTimeout(() => {
this.isNodes++;
}, 500);
var pages = getCurrentPages();
this.returnShow = pages.length===1?false:true;
// #ifdef H5
@@ -117,13 +126,22 @@
},
getSeckillConfig: function() {
let that = this;
//if(that.showSkeleton) that.dataList = [{slide:''}]
that.seckillList = [{image:'',otPrice:'',percent:'',price:'',title:''}];
getSeckillHeaderApi().then(res => {
if(res.data == ''){
this.$util.Tips({
title: '暂无秒杀活动'
}, {
url: '/pages/index/index'
});
return;
}
that.seckillList = [];
res.data.map(item => {
item.slide = JSON.parse(item.slide)
})
that.dataList = res.data;
that.getSeckillList();
that.seckillList = [];
that.page = 1;
that.status = that.dataList[that.active].status;
that.getSeckillList();
@@ -138,48 +156,76 @@
};
if (that.loadend) return;
if (that.pageloading) return;
this.pageloading = true
that.pageloading = true
getSeckillList(that.dataList[that.active].id, data).then(res => {
// that.seckillList = [];
var seckillList = res.data.list;
var loadend = seckillList.length < that.limit;
that.seckillList = that.seckillList.concat(seckillList);
that.page++;
that.seckillList = that.seckillList.concat(seckillList),
that.page = that.page;
that.page = that.page;
that.pageloading = false;
that.loadend = loadend;
// #ifdef H5
that.setShare();
// #endif
setTimeout(() => {
that.showSkeleton = false
}, 1000)
}).catch(err => {
that.pageloading = false
});
},
settimeList: function(item, index) {
var that = this;
this.active = index
if (that.interval) {
clearInterval(that.interval);
that.interval = null
if(index !== this.active){
var that = this;
this.active = index
if (that.interval) {
clearInterval(that.interval);
that.interval = null
}
that.interval = 0,
that.countDownHour = "00";
that.countDownMinute = "00";
that.countDownSecond = "00";
that.status = that.dataList[that.active].status;
that.loadend = false;
that.page = 1;
that.seckillList = [];
// wxh.time(e.currentTarget.dataset.stop, that);
that.getSeckillList();
}
that.interval = 0,
that.countDownHour = "00";
that.countDownMinute = "00";
that.countDownSecond = "00";
that.status = that.dataList[that.active].status;
that.loadend = false;
that.page = 1;
that.seckillList = [];
// wxh.time(e.currentTarget.dataset.stop, that);
that.getSeckillList();
},
goDetails(item) {
uni.navigateTo({
animationType: animationType.type, animationDuration: animationType.duration,
url: '/pages/activity/goods_seckill_details/index?id=' + item.id
})
}
},
setShare: function() {
this.$wechat.isWeixin() &&
this.$wechat.wechatEvevt([
"updateAppMessageShareData",
"updateTimelineShareData",
"onMenuShareAppMessage",
"onMenuShareTimeline"
], {
desc: this.seckillList[0].title,
title: this.seckillList[0].title,
link: location.href,
imgUrl:this.seckillList[0].image
}).then(res => {
}).catch(err => {
console.log(err);
});
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
this.getSeckillList();
var that = this;
that.getSeckillList();
}
}
</script>
@@ -258,7 +304,7 @@
}
.flash-sale .timeLsit .item.on .time {
color: $theme-color;
@include main_color(theme);
}
.flash-sale .timeLsit .item.on .state {
@@ -266,8 +312,7 @@
line-height: 30rpx;
border-radius: 15rpx;
width: 128rpx;
/* padding: 0 12rpx; */
background: linear-gradient(90deg, rgba(252, 25, 75, 1) 0%, rgba(252, 60, 32, 1) 100%);
@include main_bg_color(theme);
color: #fff;
}
@@ -329,7 +374,7 @@
.flash-sale .list .item .text .money {
font-size: 30rpx;
color: $theme-color;
@include price_color(theme);
}
.flash-sale .list .item .text .money .num {
@@ -368,7 +413,7 @@
width: 0;
height: 100%;
transition: width 0.6s ease;
background: linear-gradient(90deg, rgba(233, 51, 35, 1) 0%, rgba(255, 137, 51, 1) 100%);
@include second-gradient(theme);
}
.flash-sale .list .item .text .progress .piece {
@@ -393,14 +438,16 @@
bottom: 30rpx;
background: #bbbbbb;
}
.bg_color{
@include main_bg_color(theme);
}
.flash-sale .saleBox {
width: 100%;
height: 298rpx;
/* #ifdef MP */
height: 300rpx;
/* #endif */
background: rgba(233, 51, 35, 1);
@include main_bg_color(theme);
border-radius: 0 0 50rpx 50rpx;
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -33,7 +33,7 @@
from:'',
storeCombination: {},
qrcodeSize: 600,
posterbackgd: '/static/images/canbj.png',
posterbackgd: `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/canbj.png`,
PromotionCode: '',//二维码
canvasStatus: false,
imgTop: '' //商品图base64位

View File

@@ -0,0 +1,264 @@
<template>
<div class="quality-recommend" :data-theme="theme">
<view class="saleBox" v-if="typeInfo.pic"></view>
<view class="header skeleton-rect" v-if="typeInfo.pic">
<view class="borRadius14">
<image :src="typeInfo.pic" class="slide-image borRadius14" lazy-load></image>
</view>
</view>
<div class="title acea-row row-center-wrapper">
<div class="line"></div>
<div class="name">
<span class="iconfont icon-jingpintuijian" ></span> {{typeInfo.name}}
</div>
<div class="line"></div>
</div>
<view class="wrapper">
<view class="list">
<view class="item acea-row row-middle" v-for="(item,index) in tempArr" :key="index" @click="toDetail(item.id)">
<view class="img_box">
<image class="pictrue" :src="item.image"></image>
<view :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
</view>
<view class="ml_11 flex-column justify-between">
<view class="goods_name">{{item.storeName}}</view>
<view class="price flex justify-between">
<view>
<text class="price_bdg"></text>{{item.price}}
<text class="otPrice">{{item.otPrice}}</text>
</view>
</view>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="goodScroll">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
</view>
<view class="txt-bar" v-if="tempArr.length > 0">我也是有底线的~</view>
<emptyPage title="暂无数据~" v-if="tempArr.length == 0"></emptyPage>
</view>
</div>
</template>
<script>
import emptyPage from '@/components/emptyPage.vue';
import GoodList from '@/components/goodList/index';
import {getGroomList} from '@/api/store';
import {goPage} from '@/libs/order.js';
import {productRank} from '@/api/api.js'
import Loading from '@/components/Loading/index.vue';
import animationType from '@/utils/animationType.js'
let app = getApp()
export default {
name: 'HotNewGoods',
components: {
GoodList,
emptyPage,
Loading
},
data: function() {
return {
circular:true,
theme:app.globalData.theme,
typeInfo:{},
loading:false,
params: { //精品推荐分页
page: 1,
limit: 10,
},
loading: false,
goodScroll: true, //精品推荐开关
tempArr:[],
};
},
onLoad: function(e) {
this.typeInfo = e;
uni.setNavigationBarTitle({
title: this.typeInfo.name
});
if(this.typeInfo.name == '商品排行'){
this.getProductRank();
}else{
this.getGroomList();
}
},
methods: {
getGroomList() {
this.loading = true
if (!this.goodScroll) return
getGroomList(this.typeInfo.type, this.params).then(({data}) => {
this.goodScroll = data.list.length >= this.params.limit
this.loading = false
this.params.page++
this.tempArr = this.tempArr.concat(data.list)
})
},
getProductRank(){
productRank().then(res=>{
this.tempArr = res.data;
})
},
toDetail(id){
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url:'/pages/goods/goods_details/index?id=' + id
})
}
},
onReachBottom() {
if (this.params.page != 1) {
this.getGroomList();
}
},
}
</script>
<style lang="scss">
/deep/ .quality-recommend {
background-color: #f5f5f5;
}
.saleBox{
width: 100%;
height: 298rpx;
/* #ifdef MP */
height: 300rpx;
/* #endif */
@include main_bg_color(theme);
border-radius: 0 0 50rpx 50rpx;
}
.quality-recommend .header {
width: 710rpx;
height: 330rpx;
margin: -276rpx auto 0 auto;
border-radius: 14rpx;
overflow: hidden;
.slide-image{
height: 330rpx !important;
border-radius: 14rpx;
overflow: hidden;
}
}
.quality-recommend .header image {
width: 100%;
height: 100%;
border-radius: 14rpx;
overflow: hidden;
img{
border-radius: 14rpx;
}
}
.quality-recommend {
.wrapper {
// background: #fff;
.list {
width: 690rpx;
border-radius: 20rpx;
background-color: #fff;
margin: 0rpx auto 0 auto;
padding: 20rpx 20rpx 30rpx;
box-sizing: border-box;
.item {
background: #fff;
margin-top: 26rpx;
.img_box{
width: 180rpx;
height: 180rpx;
background: #F3F3F3;
position: relative;
.pictrue{
width:100%;
height:100%;
border-radius: 10rpx;
}
.rank_bdg{
width: 100%;
height: 46rpx;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: auto;
text-align: center;
color: #fff;
font-size: 24rpx;
line-height: 46rpx;
}
}
.ml_11{
margin-left: 22rpx;
border-bottom: 1px solid #eee;
padding-bottom: 20rpx;
}
.goods_name{
width: 420rpx;
height: 80rpx;
font-size: 30rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
overflow: hidden;
text-overflow:ellipsis;
white-space: wrap;
}
}
}
}
.title {
height: 120rpx;
font-size: 32rpx;
color: #282828;
background-color: #f5f5f5;
.name {
margin: 0 20rpx;
.iconfont {
margin-right: 10rpx;
}
}
.line {
width: 230rpx;
height: 2rpx;
background-color: #e9e9e9;
}
}
}
.price{
margin-top: 60rpx;
font-size: 34rpx;
font-weight: 600;
@include price_color(theme);
.price_bdg{
font-size: 26rpx;
}
.otPrice{
font-size: 24rpx;
color: #999999;
font-weight: 400;
padding-left: 12rpx;
text-decoration: line-through;
}
.cart_icon{
width: 48rpx;
height: 48rpx;
border-radius: 50%;
@include main_bg_color(theme);
text-align: center;
line-height: 40rpx;
.iconfont{
font-size: 28rpx;
font-weight: 400;
color: #fff;
}
}
}
.txt-bar {
padding: 20rpx 0;
text-align: center;
font-size: 26rpx;
color: #666;
background-color: #f5f5f5;
}
</style>

View File

@@ -0,0 +1,403 @@
<template>
<view id="home" :style="[pageStyle]" class="smallBox" :data-theme="theme">
<!-- 组合组件 -->
<homeComb v-if="showHomeComb" :bgInfo="bgInfo" :dataConfig="homeCombData" @changeTab="changeTab" :isScrolled="isScrolled" :isSmallPage="isSmallPage"
:navIndex="navIndex"></homeComb>
<!-- 顶部搜索框 -->
<headerSearch :isSmallPage="isSmallPage" v-if="showHeaderSerch" :dataConfig="headerSerchCombData"></headerSearch>
<!-- 分类导航 -->
<cateNav v-if="showCateNav" :dataConfig="cateNavData" @changeTab="changeTab"></cateNav>
<view v-if="navIndex === 0">
<block v-for="(item, index) in styleConfig" :key="index">
<!-- 新闻简报 -->
<news v-if="item.name == 'news'&&!item.isHide" :dataConfig="item"></news>
<!-- menu -->
<menus v-if="item.name == 'menus'&&!item.isHide" :dataConfig="item"></menus>
<!-- 文章列表 -->
<articleList v-if="item.name == 'homeArticle'&&!item.isHide" :dataConfig="item"></articleList>
<!-- 秒杀 -->
<seckill-data v-if="item.name == 'seckill'&&!item.isHide" :dataConfig="item"></seckill-data>
<!-- 优惠券 -->
<coupon v-if="item.name == 'homeCoupons'&&!item.isHide" :dataConfig="item"></coupon>
<!-- 图片魔方 -->
<pictureCube v-if="item.name == 'pictureCube'&&!item.isHide" :dataConfig="item"></pictureCube>
<!-- 热区 -->
<hotSpot v-if="item.name == 'homeHotspot'&&!item.isHide" :dataConfig="item"></hotSpot>
<!-- 轮播图 -->
<swiperBg v-if="item.name == 'swiperBg'&&!item.isHide" :dataConfig="item"></swiperBg>
<!-- 视频 -->
<shortVideo v-if="item.name == 'video'&&!item.isHide" :dataConfig="item"></shortVideo>
<!-- 辅助线 -->
<guide v-if="item.name == 'guide'&&!item.isHide" :dataConfig="item"></guide>
<!-- 富文本-->
<rich-text-editor v-if="item.name == 'richTextEditor'&&!item.isHide" :dataConfig="item"></rich-text-editor>
<!-- 辅助空白-->
<blank-page v-if="item.name == 'blankPage'&&!item.isHide" :dataConfig="item"></blank-page>
<!-- 标题 -->
<home-title v-if="item.name == 'titles'&&!item.isHide" :dataConfig="item"></home-title>
<!-- 拼团 -->
<group v-if="item.name == 'group'&&!item.isHide" :dataConfig="item"></group>
<!-- 砍价 -->
<bargain v-if="item.name == 'bargain'&&!item.isHide" :dataConfig="item"></bargain>
<!-- 商品列表 -->
<goodList v-if="item.name == 'goodList'&&!item.isHide" :dataConfig="item" @detail="goDetail"></goodList>
<!-- 选项卡商品列表-->
<homeTab v-if="item.name == 'homeTab'&&!item.isHide" :dataConfig="item" @detail="goDetail"></homeTab>
<!-- 底部导航-->
<page-footer v-if="item.name == 'footer'&&!item.isHide" :dataConfig="item" :isSmallPage="isSmallPage"></page-footer>
</block>
</view>
<!-- 分类页-->
<view class="productList" v-if="navIndex > 0 && sortList.length>0">
<view class="sort acea-row" :class="sortList.length ? '' : 'no_pad'"
:style="{ marginTop: sortMarTop + 'px' }">
<navigator hover-class="none"
:url="'/pages/goods/goods_list/index?cid=' + item.id + '&title=' + item.name" class="item"
v-for="(item, index) in sortList" :key="index" v-if="index<9">
<view class="pictrue">
<!-- <easy-loadimage :image-src="item.icon" class='slide-image skeleton-rect'>
</easy-loadimage> -->
<image :src="item.extra" class='slide-image tui-skeleton-rect'></image>
</view>
<view class="text">{{ item.name }}</view>
</navigator>
<view class="item" @click="bindMore()" v-if="sortList.length >= 9">
<view class="pictrues acea-row row-center-wrapper">
<text class="iconfont icon-gengduo2"></text>
</view>
<view class="text">更多</view>
</view>
</view>
</view>
<!-- 推荐商品分类商品列表-->
<recommend v-if="categoryId>0" ref="recommendIndex" :categoryId='categoryId' :isShowTitle="isShowTitle"
@getRecommendLength="getRecommendLength"></recommend>
<view class='noCommodity' v-if="isNoCommodity&& navIndex > 0">
<view class='pictrue'>
<image :src="urlDomain+'crmebimage/presets/noShopper.png'"></image>
</view>
<text class="text-ccc">暂无商品</text>
</view>
<!-- <view v-if="bottomNavigationIsCustom" class="footerBottom"></view> -->
</view>
</template>
<script>
import {
pagediyInfoApi,
getCategoryTwo
} from '@/api/api.js';
import {
mapGetters
} from "vuex";
import tuiSkeleton from '@/components/base/tui-skeleton.vue';
import homeComb from '@/components/homeIndex/homeComb';
import seckillData from "@/components/homeIndex/seckill.vue";
import coupon from "@/components/homeIndex/coupon.vue";
import menus from "@/components/homeIndex/menus.vue";
import pictureCube from '@/components/homeIndex/pictureCube'
import news from '@/components/homeIndex/news'
import goodList from '@/components/homeIndex/goodList'
import guide from '@/components/homeIndex/guide';
import articleList from '@/components/homeIndex/articleList'
import swiperBg from '@/components/homeIndex/swiperBg'
import headerSearch from '@/components/homeIndex/headerSearch';
import cateNav from '@/components/homeIndex/cateNav';
import richTextEditor from '@/components/homeIndex/richTextEditor';
import shortVideo from '@/components/homeIndex/video';
import homeTab from '@/components/homeIndex/homeTab';
import blankPage from '@/components/homeIndex/blankPage';
import homeTitle from '@/components/homeIndex/title';
import pageFooter from '@/components/homeIndex/pageFoot';
import recommend from "@/components/base/recommend.vue";
import group from "@/components/homeIndex/group.vue";
import hotSpot from '@/components/homeIndex/hotSpot.vue';
import bargain from "@/components/homeIndex/bargain.vue";
import {
goProductDetail
} from "../../../libs/order";
let app = getApp();
export default {
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
theme: app.globalData.theme,
isSmallPage: true, //是否是微页面true是false不是
styleConfig: [],
bgColor: '',
bgPic: '',
bgTabVal: '',
isFixed: true,
storeHeight: 0,
smallPage: false,
homeCombData: {},
headerSerchCombData: {},
sortList: [],
sortMarTop: 0,
showCateNav: false, //是否显示分类导航组件
cateNavData: {}, //分类导航组件数据
navIndex: 0,
pageStyle: null,
cateNavActive: 0,
categoryId: 0, //分类id
diyId: 0, //diyid
isNoCommodity: false,
showHomeComb: false,
showHeaderSerch: false,
domOffsetTop: 50,
isScrolled: false,
bgInfo:{
colorPicker:'#f5f5f5',
isBgColor:1,
},
}
},
components: {
homeComb,
tuiSkeleton,
seckillData,
coupon,
menus,
pictureCube,
news,
goodList,
articleList,
swiperBg,
headerSearch,
cateNav,
guide,
richTextEditor,
shortVideo,
homeTab,
blankPage,
homeTitle,
pageFooter,
recommend,
group,
hotSpot,
bargain
},
computed: mapGetters(['bottomNavigationIsCustom']),
onLoad(options) {
if (options.scene) {
let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
if (value.id) this.diyId = Number(value.id);
}
if (options.id) {
this.diyId = Number(options.id);
}
this.diyData(this.diyId)
},
// 滚动监听
onPageScroll(e) {
// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
uni.$emit('scroll');
if (e.scrollTop > this.domOffsetTop) {
this.isScrolled = true;
}
if (e.scrollTop < this.domOffsetTop) {
this.$nextTick(() => {
this.isScrolled = false;
});
}
},
methods: {
diyData(id) {
let that = this;
that.styleConfig = [];
uni.showLoading({
title: '加载中...'
});
pagediyInfoApi(id).then(res => {
uni.setNavigationBarTitle({
title: res.data.title
});
uni.setNavigationBarColor({
//必须要16进制小写
frontColor: res.data.titleColor,
backgroundColor: res.data.titleBgColor.toString().toLowerCase(),
})
let data = res.data;
this.bgInfo.isBgColor=data.isBgColor
this.bgInfo.colorPicker=data.colorPicker
that.styleConfig = that.$util.objToArr(res.data.value);
uni.hideLoading();
that.styleConfig.forEach((item) => {
if (item.name == 'tabNav'&&!item.isHide) {
this.showCateNav = true;
this.cateNavData = item;
}
if (item.name === 'homeComb'&&!item.isHide) {
that.showHomeComb = true
that.homeCombData = item;
}
if (item.name === 'headerSerch'&&!item.isHide) {
that.showHeaderSerch = true
that.headerSerchCombData = item;
}
});
this.pageStyle = {
'background-color': data.isBgColor === 1 ? res.data.colorPicker : '',
'background-image': data.isBgPic === 1 ? `url(${res.data.bgPic})` : '',
'background-repeat': res.data.bgTabVal === 1 ? 'repeat-y' : 'no-repeat',
'background-size': res.data.bgTabVal === 2 ? 'cover' : 'contain'
};
setTimeout(() => {
this.isNodes++;
}, 100);
}).catch(err => {
return that.$util.Tips({
title: err
});
uni.hideLoading();
})
},
getRecommendLength(e) {
this.isNoCommodity = e == 0 ? true : false;
},
// 分类切换点击
changeTab(index, item) {
//type=0微页面1分类2首页
this.cateNavActive = index;
if (item.type == 1) {
this.navIndex = 1;
if (!item.val) {
this.sortList = [];
this.categoryId = 0;
this.$util.Tips({
title: "请在平台端选择商品分类!确保加载商品分类数据。"
});
return;
} else {
getCategoryTwo(item.val).then(res => {
this.sortList = res.data;
// #ifdef H5
self.sortMarTop = 10;
// #endif
});
this.categoryId = item.val;
this.isShowTitle = false;
}
} else if (item.type == 0) {
this.navIndex = 0;
this.isShowTitle = true;
this.categoryId = 0;
if (!item.val) {
return this.$util.Tips({
title: "请在平台端选择微页面链接!确保加载微页面数据。"
});
} else {
this.styleConfig = [];
this.diyData(item.val, true);
}
} else {
this.categoryId = 0;
this.navIndex = 0;
this.styleConfig = [];
this.diyData(this.diyId, false);
}
},
// 去商品详情页
goDetail(item) {
goProductDetail(item.id, 0, '')
},
bindMore(){
uni.switchTab({
url: `/pages/goods_cate/goods_cate`
})
}
},
}
</script>
<style lang="scss" scoped>
.smallBox {
padding-bottom: calc(130rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
padding-bottom: calc(130rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
}
.productList {
background-color: #F5F5F5;
margin-top: 20rpx;
.sort {
width: 710rpx;
max-height: 380rpx;
background: rgba(255, 255, 255, 1);
border-radius: 16rpx;
padding: 0rpx 0rpx 20rpx 0rpx !important;
flex-wrap: wrap;
margin: 25rpx auto 0 auto;
&.no_pad {
padding: 0;
}
.item {
width: 20%;
margin-top: 20rpx;
text-align: center;
.pictrues {
width: 90rpx;
height: 90rpx;
background: #F5F5F5;
border-radius: 50%;
margin: 0 auto;
}
.pictrue {
width: 90rpx;
height: 90rpx;
background: #F5F5F5;
border-radius: 50%;
margin: 0 auto;
}
.slide-image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
overflow: hidden;
}
/deep/ .easy-loadimage,
uni-image,
.easy-loadimage {
width: 90rpx;
height: 90rpx;
display: inline-block;
}
.text {
color: #272727;
font-size: 24rpx;
margin-top: 10rpx;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
}
.productList .list.on {
background-color: #fff;
border-top: 1px solid #f6f6f6;
}
.productList .list .item {
width: 345rpx;
margin-top: 20rpx;
background-color: #fff;
border-radius: 10rpx;
.name {
display: flex;
align-items: center;
.name_text {
display: inline-block;
max-width: 200rpx;
}
}
}
</style>

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 929 B

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

View File

@@ -1,7 +1,7 @@
<template>
<view class="lottie-bg">
<view id="lottie">
<image src="/static/img/live-logo.gif" rel="preload" />
<image :src="urlDomain+'crmebimage/perset/staticImg/live-logo.gif'" rel="preload" />
</view>
</view>
</template>
@@ -13,6 +13,11 @@
} from "@/api/user";
export default {
name: "Auth",
data(){
return{
urlDomain: this.$Cache.get("imgHost"),
}
},
mounted() {
},

View File

@@ -1,143 +0,0 @@
<template>
<div class="quality-recommend">
<div class="slider-banner swiper">
<view class="swiper">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(item,index) in imgUrls" :key="index">
<swiper-item>
<image :src="item.pic" class="slide-image"></image>
</swiper-item>
</block>
</swiper>
</view>
</div>
<div class="title acea-row row-center-wrapper">
<div class="line"></div>
<div class="name">
<span class="iconfont" :class="icon"></span>{{ name }}
</div>
<div class="line"></div>
</div>
<view class="wrapper">
<GoodList :bastList="goodsList" :is-sort="false"></GoodList>
<view class="txt-bar" v-if="goodsList.length>0 && !isScroll">我是有底线的~</view>
<emptyPage v-if="goodsList.length==0 && !isScroll" title="暂无数据~"></emptyPage>
</view>
</div>
</template>
<script>
import emptyPage from '@/components/emptyPage.vue'
import GoodList from "@/components/goodList";
import { getGroomList } from "@/api/store";
export default {
name: "HotNewGoods",
components: {
GoodList,
emptyPage,
},
props: {},
data: function() {
return {
imgUrls: [],
goodsList: [],
name: "",
icon: "",
type:0,
autoplay:true,
circular:true,
interval: 3000,
duration: 500,
page:1,
limit:8,
isScroll:true
};
},
onLoad: function(option) {
this.type = option.type
this.titleInfo();
this.getIndexGroomList();
},
methods: {
titleInfo: function() {
if (this.type === "1") {
this.name = "精品推荐";
this.icon = "icon-jingpintuijian";
uni.setNavigationBarTitle({
title:"精品推荐"
})
} else if (this.type === "2") {
this.name = "热门榜单";
this.icon = "icon-remen";
uni.setNavigationBarTitle({
title:"热门榜单"
})
} else if (this.type === "3") {
this.name = "首发新品";
this.icon = "icon-xinpin";
uni.setNavigationBarTitle({
title:"首发新品"
})
}else if (this.type === "4") {
this.name = "促销单品";
this.icon = "icon-xinpin";
uni.setNavigationBarTitle({
title:"促销单品"
})
}
},
getIndexGroomList: function() {
if(!this.isScroll) return
let that = this;
let type = this.type;
getGroomList(type,{
page:this.page,
limit:this.limit
}).then(res => {
that.imgUrls = res.data.banner;
that.goodsList = that.goodsList.concat(res.data.list);
that.isScroll = res.data.list.length>=that.limit
that.page++
})
.catch(function(res) {
that.$util.Tips({ title: res });
});
}
},
onReachBottom() {
this.getIndexGroomList()
}
};
</script>
<style lang="scss">
/deep/ .empty-box{
background-color: #f5f5f5;
}
.swiper,swiper,swiper-item,.slide-image{
width: 100%;
height: 280rpx;
}
.quality-recommend {
.wrapper{
background: #fff;
}
.title {
height: 120rpx;
font-size:32rpx;
color: #282828;
background-color: #f5f5f5;
.line{
width: 230rpx;
height: 2rpx;
background-color: #e9e9e9;
}
}
}
.txt-bar{
padding: 20rpx 0;
text-align: center;
font-size: 26rpx;
color: #666;
background-color: #f5f5f5;
}
</style>

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,999 +0,0 @@
<template>
<div class="broadcast-details" :style="'height:'+windowH+'px'">
<view class="hd-wrapper" :class="active === true ? 'on' : ''">
<scroll-view scroll-y="true" style="height: 100%; overflow: hidden;" :scroll-top="scrollTop" scroll-with-animation="true">
<div class="broadcast-details_order">
<div class="broadcast-details_box" v-if="productId && productInfo.id">
<div class="broadcast_details_img">
<img :src="productInfo.image" />
</div>
<div class="broadcast_details_picBox">
<div class="broadcast_details_tit" v-text="productInfo.storeName"></div>
<div class="acea-row row-between">
<div class="broadcast_details_pic">
{{ productInfo.price
}}<span class="broadcast_details_pic_num">{{ productInfo.otPrice }}</span>
</div>
<div class="broadcast_details_btn" @click="sendProduct">
发送客服
</div>
</div>
</div>
</div>
<div class="broadcast_box" v-if="orderId && orderInfo.id">
<div class="broadcast-details_num broadcast_num">
<span>订单号{{ orderInfo.order_id }}</span>
<span>{{ orderInfo.add_time_y }} {{ orderInfo.add_time_h }}</span>
</div>
<div class="broadcast-details_box">
<div class="broadcast_details_img">
<img :src="cartInfo.productInfo.image" />
<div class="broadcast_details_model">
{{ orderInfo.cartInfo ? orderInfo.cartInfo.length : 0 }}件商品
</div>
</div>
<div class="broadcast_details_picBox">
<div class="broadcast_details_tit">
{{ cartInfo.productInfo.store_name }}
</div>
<div class="acea-row row-between">
<div class="broadcast_details_pic">
{{ cartInfo.productInfo.price
}}<span class="broadcast_details_pic_num">{{ cartInfo.productInfo.ot_price }}</span>
</div>
<div class="broadcast_details_btn" @click="sendOrder">
发送客服
</div>
</div>
</div>
</div>
</div>
</div>
<div class="chat" ref="chat" >
<template v-for="item in history">
<div class="item acea-row row-top" v-if="item.uid === toUid" :key="item.id">
<div class="pictrue"><img :src="item.avatar" /></div>
<div class="text">
<div class="name">{{ item.nickname }}</div>
<div class="acea-row">
<!--商品链接-->
<div v-if="item.msn_type === 6 && item.orderInfo.id">
<router-link class="broadcast-details_num" :to="{
path: '/pages/admin/orderDetail/index?id=' + item.orderInfo.order_id
}">
<span>订单号{{ item.orderInfo.order_id }}</span>
</router-link>
<div class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.cartInfo" :key="val.id">
<router-link class="broadcast-details_box noPad" :to="{ path: '/pages/goods_details/index?id=' + val.product_id }" v-if="inx == 0">
<div class="broadcast_details_img">
<img :src="val.productInfo.image" />
<div class="broadcast_details_model">
{{
item.orderInfo.cartInfo
? item.orderInfo.cartInfo.length
: 0
}}件商品
</div>
</div>
<div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit" v-text="val.productInfo.store_name"></div>
<div class="broadcast_details_pic">
{{ val.productInfo.price }}
</div>
</div>
</router-link>
</div>
</div>
</div>
<!--商品链接-->
<div class="conter acea-row row-middle" v-if="item.msn_type === 5">
<div class=" noPad">
<router-link class="acea-row row-column-around noPad" v-if="item.productInfo.id" :to="{ path: '/pages/goods_details/index?id=' + item.productInfo.id }">
<div class="broadcast_details_img_no">
<img :src="item.productInfo.image" />
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.productInfo.price }}
</div>
<div class="broadcast_details_tit_no" v-text="item.productInfo.store_name"></div>
</div>
</router-link>
</div>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 4">
<img src="/static/images/signal2.gif" class="signal" style="margin-right: 0.27rem;" />12
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
<img :src="item.msn" />
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn"></i>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{ item.msn }}
</div>
</div>
</div>
</div>
<div class="item acea-row row-top row-right" v-else :key="item.id">
<div class="text textR">
<div class="name">{{ item.nickname }}</div>
<div class="acea-row ">
<!--商品链接-->
<router-link v-if="item.msn_type === 6 && item.orderInfo.id" :to="{
path: '/pages/admin/orderDetail/index?id=' + item.orderInfo.order_id
}">
<div class="broadcast-details_num">
<span>订单号{{ item.orderInfo.order_id }}</span>
</div>
<div class="conter acea-row row-middle">
<div class="broadcast-details_order noPad" v-for="(val, inx) in item.orderInfo.cartInfo" :key="val.id">
<div class="broadcast-details_box noPad" v-if="inx == 0">
<div class="broadcast_details_img">
<img :src="val.productInfo.image" />
<div class="broadcast_details_model">
{{
item.orderInfo.cartInfo
? item.orderInfo.cartInfo.length
: 0
}}件商品
</div>
</div>
<div class="broadcast_details_picBox noPad">
<div class="broadcast_details_tit" v-text="val.productInfo.store_name"></div>
<div class="broadcast_details_pic">
{{ val.productInfo.price }}
</div>
</div>
</div>
</div>
</div>
</router-link>
<!--商品链接-->
<div class="conter acea-row row-middle" v-if="item.msn_type === 5">
<div class=" noPad">
<router-link class="acea-row row-column-around noPad" v-if="item.productInfo.id" :to="{ path: '/pages/goods_details/index?id=' + item.productInfo.id }">
<div class="broadcast_details_img_no">
<img :src="item.productInfo.image" />
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.productInfo.price }}
</div>
<div class="broadcast_details_tit_no" v-text="item.productInfo.store_name"></div>
</div>
</router-link>
</div>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 3">
<img :src="item.msn" />
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 2">
<i class="em" :class="item.msn"></i>
</div>
<div class="conter acea-row row-middle" v-if="item.msn_type === 1">
{{ item.msn }}
</div>
</div>
</div>
<div class="pictrue"><img :src="item.avatar" /></div>
</div>
</template>
</div>
<div :style=" active === true
? 'height:' + footerConH + 'rem;'
: 'height:' + footerH + 'rem;'
"></div>
</scroll-view>
</view>
<div class="footerCon" :class="active === true ? 'on' : ''" :style="'transform: translate3d(0,' + percent + '%,0);'" ref="footerCon">
<form>
<div class="footer acea-row row-between row-bottom" ref="footer">
<!--<img-->
<!--:src="-->
<!--voice === true-->
<!--? require('@assets/images/keyboard.png')-->
<!--: require('@assets/images/voice.png')-->
<!--"-->
<!--@click="voiceBnt"-->
<!--/>-->
<img @click="uploadImg" src="/static/images/plus.png" />
<img :src="
active === true
? '/static/images/keyboard.png'
: '/static/images/face.png'
"
@click="emoticon" />
<div class="voice acea-row row-center-wrapper" v-if="voice" @touchstart.prevent="start" @touchmove.prevent="move"
@touchend.prevent="end">
{{ speak }}
</div>
<!-- <p contenteditable="true" class="input" ref="input" v-show="!voice" @keydown="keydown($event)" @keyup="keyup" @focus="focus"></p> -->
<input type="text" placeholder="请输入内容" class="input" ref="input" v-show="!voice" @input="bindInput" @keyup="keyup"
@focus="focus" cursor-spacing="20" v-model="textCon">
<div class="send" :class="sendColor === true ? 'font-color-red' : ''" @click="sendTest">
发送
</div>
</div>
</form>
<div class="banner slider-banner">
<swiper class="swiper-wrapper" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
v-if="emojiGroup.length > 0">
<block v-for="(emojiList, index) in emojiGroup" :key="index">
<swiper-item>
<i class="em" :class="emoji" v-for="emoji in emojiList" :key="emoji" @click="addEmoji(emoji)"></i>
<img src="/static/images/del.png" class="emoji-outer" />
</swiper-item>
</block>
<!-- <swiper-slide class="swiper-slide acea-row" v-for="(emojiList, index) in emojiGroup" :key="index">
<i class="em" :class="emoji" v-for="emoji in emojiList" :key="emoji" @click="addEmoji(emoji)"></i>
<img src="/static/images/del.png" class="emoji-outer" />
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div> -->
</swiper>
</div>
</div>
<div class="recording" v-if="recording">
<img src="/static/images/recording.png" />
</div>
<home></home>
</div>
</template>
<script>
import emojiList from "@/utils/emoji";
import Socket from "@/libs/chat";
import {
getChatRecord
} from "@/api/user";
import {
getProductDetail
} from "@/api/store";
import {
getOrderDetail
} from "@/api/order";
import easyUpload from '@/components/easy-upload/easy-upload.vue'
import {
TOKENNAME,
HTTP_REQUEST_URL
} from '@/config/app.js';
import home from '@/components/home';
const chunk = function(arr, num) {
num = num * 1 || 1;
var ret = [];
arr.forEach(function(item, i) {
if (i % num === 0) {
ret.push([]);
}
ret[ret.length - 1].push(item);
});
return ret;
};
const NAME = "CustomerService";
export default {
name: NAME,
components: {
easyUpload,
home
},
props: {
couponList: {
type: Array,
default: () => []
}
},
data: function() {
return {
url: `${HTTP_REQUEST_URL}/api/upload/image`,
headers: {
"Authori-zation": "Bearer " + this.$store.state.app.token
},
emojiGroup: chunk(emojiList, 20),
active: false,
voice: false,
speak: "按住 说话",
recording: false,
swiperOption: {
pagination: {
el: ".swiper-pagination",
clickable: true
},
speed: 1000,
observer: true,
observeParents: true
},
percent: 0,
footerConH: 0,
footerH: 1.08,
socket: null,
toUid: 0,
page: 1,
limit: 30,
loading: false,
loaded: false,
history: [],
sendColor: false,
sendtxt: "",
productId: 0,
productInfo: {},
orderId: "",
orderInfo: {},
cartInfo: {},
autoplay: false,
circular: true,
interval: 3000,
duration: 500,
upload_max: 2, //图片大小
//上传的图片地址
uploadImages: [],
//展示的图片地址
uploads: [],
// 超出限制数组
exceeded_list: [],
windowH: 0,
isBQ: false,
scrollTop:0 ,//滚动距离
textCon:'' //文字
};
},
watch: {
$route(n) {
if (n.name === NAME) {
if (n.params.productId) this.productId = n.params.productId;
else this.productId = 0;
if (n.query.orderId) this.orderId = n.query.orderId;
else this.orderId = "";
}
}
},
beforeDestroy() {
this.socket && this.socket.close();
},
onLoad(option) {
let self = this
this.toUid = option.uid || 0;
this.productId = parseInt(option.productId) || 0;
this.orderId = option.orderId || ""
uni.getSystemInfo({
success: function(res) {
self.windowH = res.windowHeight
}
})
},
onReady: function() {
this.height();
this.getHistory();
this.getproductInfo();
this.getOrderInfo();
this.socket = new Socket();
this.socket.vm(this);
this.$on(["reply", "chat"], data => {
this.history.push(data);
this.$nextTick(function() {
window.scrollTo(0, document.documentElement.scrollHeight + 999);
});
});
this.$on("socket_error", () => {
this.$dialog.error("连接失败");
});
this.$on("err_tip", data => {
this.$dialog.error(data);
});
this.$on("socket_open", () => {
this.socket.send({
data: {
id: this.toUid
},
type: "to_chat"
});
});
document.addEventListener("scroll", this.scroll, false);
},
destroyed() {
document.removeEventListener("scroll", this.scroll);
},
methods: {
uploadImg() {
let self = this
uni.chooseImage({
count: 1, //默认1
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
for (let i = 0; i < res.tempFiles.length; i++) {
if (Math.ceil(res.tempFiles[i].size / 1024) < this.upload_max * 1024) {
this.uploads.push(res.tempFiles[i].path)
this.uploadImages.push(res.tempFiles[i].path)
} else {
this.exceeded_list.push(i === 0 ? 1 : i + 1);
uni.showModal({
title: '提示',
content: `${[...new Set(this.exceeded_list)].join(',')}张图片超出限制${this.upload_max}MB,已过滤`
});
}
}
uni.uploadFile({
url: self.url, //仅为示例,非真实的接口地址
filePath: self.uploadImages[0],
name: 'file',
header: {
"Authori-zation": "Bearer " + self.$store.state.app.token
},
//请求参数
success: (uploadFileRes) => {
let data = JSON.parse(uploadFileRes.data)
self.sendMsg(data.data.url, 3)
}
});
},
fail: (err) => {
uni.showModal({
content: JSON.stringify(err)
});
}
});
},
getOrderInfo() {
if (!this.orderId) return;
getOrderDetail(this.orderId).then(res => {
this.orderInfo = res.data;
if (this.orderInfo.add_time_h) {
this.orderInfo.add_time_h = this.orderInfo.add_time_h.substring(
0,
this.orderInfo.add_time_h.lastIndexOf(":")
);
}
if (this.orderInfo.cartInfo.length) {
this.cartInfo = this.orderInfo.cartInfo[0];
}
});
},
getproductInfo() {
let that = this;
if (!this.productId) return;
getProductDetail(this.productId).then(res => {
that.productInfo = res.data.storeInfo;
});
},
scroll() {
if (window.scrollY < 300 && !this.loaded && !this.loading)
this.getHistory();
},
imageuploaded(res) {
if (res.status !== 200) return this.$dialog.error(res || "上传图片失败");
this.sendMsg(res.data.url, 3);
},
getHistory() {
if (this.loading || this.loaded) return;
this.loading = true;
getChatRecord(this.toUid, {
page: this.page,
limit: this.limit
})
.then(({
data
}) => {
this.history = data.list.concat(this.history);
if (this.page === 1) {
this.$nextTick(function() {
window.scrollTo(0, document.documentElement.scrollHeight + 999);
this.height();
});
}
this.page++;
this.loading = false;
this.loaded = data.length < this.limit;
})
.catch(err => {
this.$dialog.error(err || "加载失败");
});
},
focus: function() {
this.active = false;
},
keyup: function() {
if (this.$refs.input.innerHTML.length > 0) {
this.sendColor = true;
} else {
this.sendColor = false;
}
},
addEmoji(name) {
this.sendMsg(name, 2);
},
sendMsg(msn, type) {
this.height();
this.socket.send({
data: {
msn,
type,
to_uid: this.toUid
},
type: "chat"
});
},
sendTest() {
this.sendMsg(this.textCon, 1);
this.textCon = ''
this.height();
},
sendProduct() {
this.sendMsg(this.productId, 5);
this.productId = 0;
this.productInfo = {};
},
sendOrder() {
this.sendMsg(this.orderId, 6);
this.orderId = 0;
this.orderInfo = {};
},
bindInput: function(e) {
if(e.detail.value){
this.sendColor = true
}else{
this.sendColor = false
}
this.height();
},
start() {
var that = this;
this.longClick = 0;
this.timeOutEvent = setTimeout(function() {
that.longClick = 1;
}, 500);
that.speak = "松开 结束";
that.recording = true;
},
move() {
clearTimeout(this.timeOutEvent);
this.timeOutEvent = 0;
},
end() {
clearTimeout(this.timeOutEvent);
if (this.timeOutEvent !== 0 && this.longClick === 0) {
//点击
//此处为点击事件----在此处添加跳转详情页
}
this.speak = "按住 说话";
this.recording = false;
return false;
},
voiceBnt: function() {
this.active = false;
if (this.voice === true) {
this.voice = false;
this.$nextTick(function() {
this.$refs.input.focus();
});
} else {
this.voice = true;
}
window.scrollTo(0, document.documentElement.scrollHeight);
this.percent = 0;
this.footerConH = 0;
this.footerH = 0;
this.$nextTick(function() {
this.height();
});
},
emoticon: function() {
this.voice = false;
if (this.active === true) {
this.active = false;
this.isBQ = false
// this.$nextTick(function() {
// this.$refs.input.focus();
// });
} else {
this.active = true;
this.isBQ = true
// this.$nextTick(function() {
// this.$refs.input.blur();
// });
}
this.height();
},
height() {
let scrollTop = 0
let footerConH = this.$refs.footerCon.offsetHeight;
let footerH = this.$refs.footer.offsetHeight;
let scale = 750 / window.screen.availWidth;
this.footerConH = (footerConH * scale) / 100;
this.footerH = (footerH * scale) / 100;
this.percent = ((this.footerConH - this.footerH) / this.footerConH) * 100;
setTimeout(res=>{
let info = uni.createSelectorQuery().select(".chat");
info.boundingClientRect(function(data) { //data - 各种参数
// 获取元素宽度
scrollTop = data.height
}).exec()
if(this.active){
this.scrollTop = scrollTop+500
}else{
this.scrollTop = scrollTop+100
}
},600)
},
}
};
</script>
<style lang="scss">
page {
width: 100%;
height: 100%;
}
/* #ifdef H5 */
@import url("@/plugin/emoji-awesome/css/google.min.css");
/* #endif */
.broadcast_num {
padding: 0 10rpx !important;
}
.noPad {
padding: 0 !important;
margin-bottom: 0 !important;
height: auto !important;
}
.broadcast-details_num {
width: 100%;
height: 80rpx;
line-height: 80rpx;
color: #000000;
font-size: 26rpx;
display: flex;
justify-content: space-between;
background: #fff;
border-bottom: 1px dashed rgba(0, 0, 0, 0.2);
padding: 0 24rpx;
}
.broadcast-details_order {
padding: 15rpx;
}
.broadcast-details_box {
padding: 24rpx;
display: flex;
background: #fff;
border-radius: 6px;
margin-bottom: 24rpx;
}
.broadcast_details_model {
width: 100%;
height: 43rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 0px 0px 8px 8px;
position: absolute;
z-index: 2;
bottom: 0;
font-size: 22rpx;
color: #fff;
text-align: center;
line-height: 43rpx;
}
.broadcast_details_img {
width: 140rpx;
height: 140rpx;
border-radius: 8px;
overflow: hidden;
position: relative;
}
.broadcast_details_img img {
width: 100%;
height: 100%;
}
.broadcast_details_img_no {
width: 100%;
height: auto;
border-radius: 8px 8px 0px 0px;
overflow: hidden;
margin-bottom: 10rpx;
}
.broadcast_details_picBox_no {
width: 100%;
}
.broadcast_details_img_no img {
width: 100%;
height: 100%;
}
.broadcast_details_tit {
font-size: 28rpx;
color: #333333;
height: 85rpx;
font-weight: 800;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-align: left !important;
}
.broadcast_details_tit_no {
font-size: 28rpx;
color: #333333;
font-weight: 800;
text-align: left;
margin-top: 5rpx;
}
.broadcast_details_picBox {
width: 75%;
margin-left: 24rpx;
}
.broadcast_details_pic {
font-size: 36rpx;
color: $theme-color;
text-align: left;
}
.broadcast_details_pic_num {
text-decoration: line-through;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.5);
margin-left: 0.1rem;
}
.broadcast_details_btn {
width: 160rpx;
height: 50rpx;
background: #e83323;
opacity: 1;
border-radius: 125rpx;
color: #fff;
font-size: 24rpx;
text-align: center;
line-height: 50rpx;
}
.broadcast-details .chat {
padding: 1rpx 23rpx 0 3rpx;
margin-bottom: 3rpx;
}
.broadcast-details .chat .item {
margin-top: 37rpx;
}
.broadcast-details .chat .item .pictrue {
width: 80rpx;
height: 80rpx;
margin-top: 10rpx;
}
.broadcast-details .chat .item .pictrue img {
width: 100%;
height: 100%;
border-radius: 50%;
}
.broadcast-details .chat .item .text {
margin-left: 20rpx;
}
.broadcast-details .chat .item .text.textR {
text-align: right;
margin: 0 20rpx 0 0;
}
.broadcast-details .chat .item .text .name {
font-size: 24rpx;
color: #999;
}
.broadcast-details .chat .item .text .name .return {
color: #509efb;
margin-left: 17rpx;
}
.broadcast-details .chat .item .text.textR .name .return {
margin: 0 0.17rem 0 0;
}
.broadcast-details .chat .item .text .conter {
background-color: #fff;
border-radius: 8rpx;
padding: 16rpx 20rpx;
font-size: 30rpx;
color: #333;
position: relative;
max-width: 496rpx;
margin-top: 2rpx;
}
.broadcast-details .chat .item .text .spot {
width: 15rpx;
height: 15rpx;
background-color: #c00000;
border-radius: 50%;
margin-left: 20rpx;
}
.broadcast-details .chat .item .text .conter:before {
position: absolute;
content: "";
width: 0;
height: 0;
border-bottom: 9rpx solid transparent;
border-right: 14rpx solid #fff;
border-top: 9rpx solid transparent;
left: -14rpx;
top: 25rpx;
}
.broadcast-details .chat .item .text.textR .conter:before {
left: unset;
right: -14rpx;
transform: rotateY(180deg);
}
.broadcast-details .chat .item .text .conter img {
width: 100%;
display: block;
}
.broadcast-details .chat .item .text .conter .signal {
width: 48rpx;
height: 48rpx;
}
.broadcast-details .chat .item .text .conter .signal.signalR {
transform: rotate(180deg);
-ms-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
}
.broadcast-details .footerCon {
height: 100rpx;
width: 100%;
transition: all 0.005s cubic-bezier(0.25, 0.5, 0.5, 0.9);
background-color: #fff;
}
.broadcast-details .footerCon.on {
position: relative;
top: -300rpx;
transform: translate3d(0, 0, 0) !important;
}
.broadcast-details .footerCon .banner .swiper-slide {
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
background-color: #fff;
padding-bottom: 50rpx;
border-top: 1px solid #f5f5f5;
}
.broadcast-details .footerCon .banner .swiper-slide .emoji-outer,
.swiper-slide .em {
display: block;
width: 50rpx;
height: 50rpx;
margin: 40rpx 0 0 50rpx;
}
.broadcast-details .footerCon .banner .swiper-container-horizontal>.swiper-pagination-bullets {
bottom: 10rpx;
}
.broadcast-details .footerCon .slider-banner .swiper-pagination-bullet-active {
background-color: #999;
}
.broadcast-details .recording {
width: 300rpx;
height: 300rpx;
position: fixed;
top: 40%;
left: 50%;
margin-left: -150rpx;
}
.broadcast-details .recording img {
width: 100%;
height: 100%;
}
.broadcast-details .footer {
width: 100%;
background-color: #fff;
padding: 17rpx 26rpx;
}
.broadcast-details .footer img {
width: 61rpx;
height: 60rpx;
display: block;
}
.broadcast-details .footer .input,
.broadcast-details .footer .voice {
width: 440rpx;
border-radius: 10rpx;
background-color: #e5e5e5;
/* padding: 17rpx 30rpx; */
height: 60rpx;
padding-left: 20rpx;
}
.input {}
.broadcast-details .footer .input {
max-height: 150rpx;
overflow-y: auto;
overflow-x: hidden;
}
.broadcast-details .footer .send {
width: 70rpx;
text-align: center;
height: 60rpx;
line-height: 60rpx;
font-weight: bold;
}
.em {
display: inline-block;
width: 50rpx;
height: 50rpx;
margin: 40rpx 0 0 50rpx;
}
.emoji-outer {
position: absolute;
right: 50rpx;
bottom: 30rpx;
width: 50rpx;
height: 50rpx;
}
.broadcast-details {
display: flex;
flex-direction: column;
width: 100%;
overflow: hidden;
.hd-wrapper {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
&.on{
padding-bottom: 300rpx;
}
}
}
</style>

View File

@@ -1,80 +0,0 @@
<template>
<div class="CustomerList">
<div
class="item acea-row row-between-wrapper"
v-for="item in list"
:key="item.id"
@click="goPage(item)"
>
<div class="pictrue"><img :src="item.avatar" /></div>
<div class="text line1">{{ item.nickname }}</div>
</div>
<home></home>
</div>
</template>
<script>
import { serviceList } from "@/api/user";
import home from '@/components/home';
export default {
name: "CustomerList",
components:{
home
},
data() {
return {
list: [],
productId: 0,
orderId: ""
};
},
methods: {
getList() {
serviceList().then(res => {
this.list = res.data;
});
},
goPage(item){
uni.navigateTo({
url:'/pages/customer_list/chat?uid='+item.uid+'&productId='+ this.productId+'&orderId='+this.orderId
})
}
},
onLoad(option) {
this.getList();
if (option.productId)
this.productId = option.productId;
if (option.orderId) {
this.orderId = option.orderId
}
}
};
</script>
<style scoped>
.CustomerList {
margin-top:13rpx;
}
.CustomerList .item {
height: 138rpx;
border-bottom: 1px solid #eee;
padding: 0 24rpx;
background-color: #fff;
}
.CustomerList .item .pictrue {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
border: 3rpx solid #fff;
box-shadow: 0 0 1rpx 5rpx #f3f3f3;
}
.CustomerList .item .pictrue img {
width: 100%;
height: 100%;
border-radius: 50%;
}
.CustomerList .item .text {
width: 582rpx;
font-size: 32rpx;
color: #000;
}
</style>

View File

@@ -1,94 +0,0 @@
<template>
<view>
<view class='quality-recommend'>
<swipers :imgUrls="imgUrls"></swipers>
<view class='title acea-row row-center-wrapper'>
<view class='line'></view>
<view class='name'><text class='iconfont' :class="icon"></text>{{name}}</view>
<view class='line'></view>
</view>
<goodList :bastList="bastList" :status="status"></goodList>
</view>
<home></home>
</view>
</template>
<script>
import goodList from '@/components/goodList';
import home from '@/components/home';
import swipers from '@/components/swipers';
import { getGroomList } from '@/api/store.js';
export default {
components: {
goodList,
swipers,
home
},
data() {
return {
imgUrls: [],
bastList:[],
name:'',
icon:'',
type:0,
status:0
};
},
onLoad: function (options) {
this.type = options.type;
},
onShow: function () {
let type = this.type;
if (type == 1){
uni.setNavigationBarTitle({
title:"精品推荐"
});
this.name = '精品推荐';
this.icon = 'icon-jingpintuijian';
} else if (type == 2) {
uni.setNavigationBarTitle({
title:"热门榜单"
});
this.name = '热门榜单';
this.icon = 'icon-remen';
this.status = 1;
} else if (type == 3) {
uni.setNavigationBarTitle({
title:"首发新品"
});
this.name = '首发新品';
this.icon = 'icon-xinpin';
} else if (type == 4) {
uni.setNavigationBarTitle({
title:"促销单品"
});
this.name = '促销单品';
this.icon = 'icon-cuxiaoguanli';
}else{
uni.setNavigationBarTitle({
title:"首发新品"
});
this.name = '首发新品';
this.icon = 'icon-xinpin';
}
this.getIndexGroomList();
},
methods: {
getIndexGroomList: function () {
let that = this;
getGroomList(that.type).then(res=>{
that.imgUrls = res.data.banner;
that.$set(that,'bastList',res.data.list)
});
}
}
}
</script>
<style lang="scss">
page{background-color:#fff;}
.quality-recommend .title{height:120rpx;font-size:32rpx;color:#282828;background-color:#f5f5f5;}
.quality-recommend .title .line{width:230rpx;height:2rpx;background-color:#e9e9e9;}
.quality-recommend .title .name{margin:0 20rpx;}
.quality-recommend .title .name .iconfont{margin-right:13rpx;font-size:38rpx;vertical-align:-4rpx;color:#343434;}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view :data-theme="theme">
<form @submit="formSubmit" report-submit='true'>
<view class='evaluate-con pad30'>
<view class='goodsStyle acea-row row-between borRadius14'>
@@ -9,7 +9,7 @@
<view class='text acea-row row-between'>
<view>
<view class='name line2'>{{productInfo.storeName}}</view>
<view class='attr line1' v-if="productInfo.sku">{{productInfo.sku}}</view>
<view class='attr line1 font_sm' v-if="productInfo.sku">{{productInfo.sku}}</view>
</view>
<view class='money'>
<view>{{productInfo.truePrice}}</view>
@@ -38,13 +38,10 @@
</view>
</view>
</view>
<button class='evaluateBnt bg-color' formType="submit">立即评价</button>
<button class='evaluateBnt bg_color' formType="submit">立即评价</button>
</view>
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -53,21 +50,10 @@
orderProduct,
orderComment
} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
let app = getApp();
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
pics: [],
@@ -87,11 +73,10 @@
productId: 0, //id
evaluateId: 0, //id
unique: '',
productInfo: {},
productInfo: {storeName:'',sku:'',truePrice:'',cartNum:'',image:''},
cart_num: 0,
isAuto: false, //
isShowAuth: false, //
id: 0//id
id: 0 ,//id
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
@@ -122,13 +107,6 @@
}
},
methods: {
onLoadFun() {
this.getOrderProduct();
},
//
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取某个产品详情
*
@@ -165,7 +143,7 @@
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({
url: 'user/upload/image',
url: 'upload/image',
name: 'multipart',
model: "product",
pid: 1
@@ -204,7 +182,7 @@
return that.$util.Tips({
title: '感谢您的评价!',
icon: 'success'
}, '/pages/order_details/index?order_id=' + that.orderId);
}, '/pages/order/order_details/index?order_id=' + that.orderId);
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
@@ -220,6 +198,12 @@
.goodsStyle .text .name, .attr{
//width: 496rpx;
}
.font_sm{
width: 360rpx;
font-size: 24rpx;
color: #999;
padding-top: 10rpx;
}
.icon-shitixing{
color: #FFBB00 !important;
}
@@ -322,4 +306,7 @@
line-height: 86rpx;
margin-top: 45rpx;
}
.bg_color{
@include main_bg_color(theme);
}
</style>

View File

@@ -1,33 +1,35 @@
<template>
<view style="height: 100%;">
<view class='evaluate-list'>
<view class='generalComment acea-row row-between-wrapper'>
<view class='acea-row row-middle font-color'>
<view class='evaluate'>评分</view>
<view class='start'
:class="'star'+ (replyData.sumCount===0?'3':Math.round(replyData.replyStar/replyData.sumCount))">
<view :data-theme="theme">
<view style="height: 100%;">
<view class='evaluate-list'>
<view class='generalComment acea-row row-between-wrapper'>
<view class='acea-row row-middle font_color'>
<view class='evaluate'>评分</view>
<view class='start'
:class="'star'+ (replyData.sumCount===0?'3':Math.round(replyData.replyStar/replyData.sumCount))">
</view>
</view>
<view><text class='font_color'>{{(replyData.replyChance)*100}}%</text>好评率</view>
</view>
<view class='nav acea-row row-middle'>
<view class='item' :class='type==0 ? "bg-color":""' @click='changeType(0)'>全部({{replyData.sumCount}})
</view>
<view class='item' :class='type==1 ? "bg-color":""' @click='changeType(1)'>好评({{replyData.goodCount}})
</view>
<view class='item' :class='type==2 ? "bg-color":""' @click='changeType(2)'>中评({{replyData.inCount}})
</view>
<view class='item' :class='type==3 ? "bg-color":""' @click='changeType(3)'>差评({{replyData.poorCount}})
</view>
</view>
<view><text class='font-color'>{{(replyData.replyChance)*100}}%</text>好评率</view>
<userEvaluation :reply="reply"></userEvaluation>
</view>
<view class='nav acea-row row-middle'>
<view class='item' :class='type==0 ? "bg-color":""' @click='changeType(0)'>全部({{replyData.sumCount}})
</view>
<view class='item' :class='type==1 ? "bg-color":""' @click='changeType(1)'>好评({{replyData.goodCount}})
</view>
<view class='item' :class='type==2 ? "bg-color":""' @click='changeType(2)'>中评({{replyData.inCount}})
</view>
<view class='item' :class='type==3 ? "bg-color":""' @click='changeType(3)'>差评({{replyData.poorCount}})
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<userEvaluation :reply="reply"></userEvaluation>
</view>
<view class='loadingicon acea-row row-center-wrapper'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<view class='noCommodity' v-if="!replyData.sumCount && page > 1">
<view class='pictrue'>
<image src='../static/noEvaluate.png'></image>
<view class='noCommodity' v-if="!(type==0&&replyData.sumCount||type==1&&replyData.goodCount||type==2&&replyData.inCount||type==3&&replyData.poorCount) && page > 1">
<view class='pictrue'>
<image :src="urlDomain+'crmebimage/perset/usersImg/noEvaluate.png'"></image>
</view>
</view>
</view>
</view>
@@ -39,12 +41,14 @@
getReplyConfig
} from '@/api/store.js';
import userEvaluation from '@/components/userEvaluation';
let app = getApp();
export default {
components: {
userEvaluation
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
replyData: {},
product_id: 0,
reply: [],
@@ -53,7 +57,8 @@
loadend: false,
loadTitle: '加载更多',
page: 1,
limit: 20
limit: 20,
theme:app.globalData.theme,
};
},
/**
@@ -105,7 +110,7 @@
that.loading = false;
that.loadend = loadend;
if (that.reply.length) {
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
that.loadTitle = loadend ? "我也是有底线的~" : "加载更多";
}
that.page = that.page + 1;
}).catch(err => {
@@ -140,6 +145,9 @@
background-color: #fff;
height: 100%;
}
.font_color{
@include main_color(theme);
}
.evaluate-list{
padding: 30rpx 0 0 0;
background-color: #fff;
@@ -179,5 +187,6 @@
.evaluate-list .nav .item.bg-color {
color: #fff;
@include main_bg_color(theme);
}
</style>

View File

@@ -0,0 +1,92 @@
<template>
<view :style="{ backgroundImage: `url(${productInfo.activityStyle})` }" class='nav acea-row row-between-wrapper '>
<view class='money skeleton-rect'>
<view class="price-box">
<view class="price">
<span class="price-icon"></span>{{productInfo.price}}
</view>
<view class="vip-price" v-if="productInfo.vipPrice">
<image :src="urlDomain+'crmebimage/perset/staticImg/vip_badge.png'" class="vip_icon"></image>
<view
class='vip_money skeleton-rect'>{{productInfo.vipPrice}}</view>
</view>
</view>
</view>
<view class='acea-row row-middle skeleton-rect'>
</view>
</view>
</template>
<script>
export default {
props: {
productInfo: {
type: Object,
default: () => {},
}
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
}
}
}
</script>
<style lang="scss" scoped>
.nav {
background-repeat: no-repeat;
background-size: 100% 100%;
width: 100%;
height: 100rpx;
padding: 0 24px;
box-sizing: border-box;
.money {
font-size: 14px;
color: #fff;
}
.num {
font-size: 24px;
}
.y-money {
font-size: 26rpx;
margin-left: 10rpx;
text-decoration: line-through;
}
}
.price-box{
display: flex;
font-size: 48rpx;
font-weight: 700;
@include price_color(theme);
.price-icon{
font-size: 28rpx;
}
.vip-price{
display: flex;
align-items: center;
padding-left: 20rpx;
margin-top: 8rpx;
.vip_icon {
width: 44rpx;
height: 28rpx;
vertical-align: middle;
}
.vip_money {
background: #FFE7B9;
border-radius: 4px;
font-size: 22rpx;
color: #333;
text-align: center;
padding: 0 4rpx;
box-sizing: border-box;
margin-left: -7rpx;
height: 14px;
}
}
}
</style>

View File

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
<a class="store-phone" :href="'tel:' + item.phone"><span
class="iconfont icon-dadianhua01"></span></a>
<!-- #endif -->
<!-- #ifdef MP -->
<!-- #ifdef MP || APP-PLUS -->
<view class="store-phone" @click="call(item.phone)"><text
class="iconfont icon-dadianhua01"></text></view>
<!-- #endif -->

View File

@@ -1,33 +1,33 @@
<template>
<view>
<view :data-theme="theme">
<view class='productList'>
<view class='search bg-color acea-row row-between-wrapper'>
<view class='search bg_color acea-row row-between-wrapper'>
<!-- #ifdef H5 -->
<view class="iconfont icon-xiangzuo" @click="goback()"></view>
<!-- #endif -->
<view class='input acea-row row-between-wrapper'><text class='iconfont icon-sousuo'></text>
<input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search"
:value='where.keyword' @confirm="searchSubmit"></input>
:value='where.keyword' @confirm="searchSubmit" maxlength="20"></input>
</view>
<view class='iconfont' :class='is_switch==true?"icon-pailie":"icon-tupianpailie"' @click='Changswitch'>
</view>
</view>
<view class='nav acea-row row-middle'>
<view class='item' :class='title ? "font-color":""' @click='set_where(1)'>{{title ? title:'默认'}}</view>
<view class='item' :class='title ? "font_color":""' @click='set_where(1)'>{{title ? title:'默认'}}</view>
<view class='item' @click='set_where(2)'>
价格
<image v-if="price==1" src='../../static/images/up.png'></image>
<image v-else-if="price==2" src='../../static/images/down.png'></image>
<image v-else src='../../static/images/horn.png'></image>
<image v-if="price==1" :src="urlDomain+'crmebimage/perset/staticImg/up.png'"></image>
<image v-else-if="price==2" :src="urlDomain+'crmebimage/perset/staticImg/down.png'"></image>
<image v-else :src="urlDomain+'crmebimage/perset/staticImg/horn.png'"></image>
</view>
<view class='item' @click='set_where(3)'>
销量
<image v-if="stock==1" src='../../static/images/up.png'></image>
<image v-else-if="stock==2" src='../../static/images/down.png'></image>
<image v-else src='../../static/images/horn.png'></image>
<image v-if="stock==1" :src="urlDomain+'crmebimage/perset/staticImg/up.png'"></image>
<image v-else-if="stock==2" :src="urlDomain+'crmebimage/perset/staticImg/down.png'"></image>
<image v-else :src="urlDomain+'crmebimage/perset/staticImg/horn.png'"></image>
</view>
<!-- down -->
<view class='item' :class='nows ? "font-color":""' @click='set_where(4)'>新品</view>
<view class='item' :class='nows ? "font_color":""' @click='set_where(4)'>新品</view>
</view>
<view :class='is_switch==true?"":"listBox"' v-if="productList.length>0">
<view class='list acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
@@ -35,6 +35,7 @@
v-for="(item,index) in productList" :key="index" @click="godDetail(item)">
<view class='pictrue' :class='is_switch==true?"":"on"'>
<image :src='item.image' :class='is_switch==true?"":"on"'></image>
<view :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
<span class="pictrue_log_class"
:class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'"
v-if="item.activityH5 && item.activityH5.type === '1'">秒杀</span>
@@ -47,13 +48,13 @@
</view>
<view class='text' :class='is_switch==true?"":"on"'>
<view class='name line1'>{{item.storeName}}</view>
<view class='money font-color' :class='is_switch==true?"":"on"'><text
<view class='x-money' :class='is_switch==true?"":"on"'><text
class='num'>{{item.price}}</text></view>
<view class='vip acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
<view class='vip-money' v-if="item.vip_price && item.vip_price > 0">{{item.vip_price}}
<image src='../../static/images/vip.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/vip.png'"></image>
</view>
<view>已售{{Number(item.sales) + Number(item.ficti) || 0}}{{item.unitName}}</view>
<view>已售{{Number(item.sales)}}{{item.unitName}}</view>
</view>
</view>
</view>
@@ -65,25 +66,20 @@
</view>
<view class='noCommodity' v-if="productList.length==0 && where.page > 1">
<view class='pictrue'>
<image src='../../static/images/noShopper.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/noShopper.png'"></image>
</view>
<recommend :hostProduct="hostProduct"></recommend>
<recommend ref="recommendIndex"></recommend>
</view>
</view>
</template>
<script>
import {
getProductslist,
getProductHot
} from '@/api/store.js';
import {getProductslist,getProductHot} from '@/api/store.js';
import recommend from '@/components/recommend';
import {
mapGetters
} from "vuex";
import {
goShopDetail
} from '@/libs/order.js'
import {mapGetters} from "vuex";
import {goShopDetail} from '@/libs/order.js'
import animationType from '@/utils/animationType.js'
let app = getApp();
export default {
computed: mapGetters(['uid']),
components: {
@@ -91,6 +87,7 @@
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
productList: [],
is_switch: true,
where: {
@@ -100,7 +97,7 @@
news: 0,
page: 1,
limit: 20,
cid: 0,
cid: '',
},
price: 0,
stock: 0,
@@ -109,14 +106,11 @@
loading: false,
loadTitle: '加载更多',
title: '',
hostProduct: [],
hotPage: 1,
hotLimit: 10,
hotScroll: false
theme:app.globalData.theme
};
},
onLoad: function(options) {
this.$set(this.where, 'cid', options.cid || 0);
this.$set(this.where, 'cid', options.cid || '');
this.title = options.title || '';
this.$set(this.where, 'keyword', options.searchValue || '');
this.get_product_list();
@@ -136,7 +130,8 @@
godDetail(item) {
goShopDetail(item, this.uid).then(res => {
uni.navigateTo({
url: `/pages/goods_details/index?id=${item.id}`
animationType: animationType.type, animationDuration: animationType.duration,
url: `/pages/goods/goods_details/index?id=${item.id}`
})
})
},
@@ -151,22 +146,6 @@
that.$set(that.where, 'page', 1)
this.get_product_list(true);
},
/**
* 获取我的推荐
*/
get_host_product: function() {
let that = this;
if (that.hotScroll) return
getProductHot(
that.hotPage,
that.hotLimit,
).then(res => {
that.hotPage++
that.hotScroll = res.data.list.length < that.hotLimit
that.hostProduct = that.hostProduct.concat(res.data.list)
// that.$set(that, 'hostProduct', res.data)
});
},
//
set_where: function(e) {
switch (e) {
@@ -229,22 +208,27 @@
that.loadTitle = '加载更多';
});
},
},
onPullDownRefresh() {
},
onReachBottom() {
if (this.productList.length > 0) {
this.get_product_list();
} else {
this.get_host_product();
this.$refs.recommendIndex.get_host_product();
}
}
}
</script>
<style scoped lang="scss">
.bg_color{
@include main_bg_color(theme);
}
.font_color{
@include main_color(theme);
}
.x-money{
@include price_color(theme);
}
.iconfont {
color: #fff;
}

View File

@@ -37,11 +37,8 @@
</view>
</view>
</view>
<recommend :hostProduct='hostProduct' v-if="hostProduct.length"></recommend>
<recommend ref="recommendIndex" v-if="expressList.length== 0 && isloading"></recommend>
</view>
<!-- #ifdef MP -->
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -49,9 +46,6 @@
import {
express
} from '@/api/order.js';
import {
getProductHot
} from '@/api/store.js';
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import {
toLogin
@@ -60,15 +54,9 @@
mapGetters
} from "vuex";
import recommend from '@/components/recommend';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
recommend,
// #ifdef MP
authorize
// #endif
recommend
},
data() {
return {
@@ -78,13 +66,8 @@
},
orderInfo: {},
expressList: [],
hostProduct: [],
loading: false,
goodScroll: true,
params: { //
page: 1,
limit: 10,
},
isloading: false, //
};
},
computed: mapGetters(['isLogin']),
@@ -93,7 +76,6 @@
handler:function(newV,oldV){
if(newV){
this.getExpress();
this.get_host_product();
}
},
deep:true
@@ -104,7 +86,6 @@
this.orderId = options.orderId;
if (this.isLogin) {
this.getExpress();
this.get_host_product();
} else {
toLogin();
}
@@ -122,43 +103,31 @@
// #endif
},
methods: {
/**
* 授权回调
*/
onLoadFun: function() {
this.getExpress();
this.get_host_product();
},
copyOrderId:function(){
uni.setClipboardData({ data: this.orderInfo.deliveryId });
},
getExpress:function(){
let that=this;
that.isloading = false;
express(that.orderId).then(function(res){
let result = res.data.express|| {};
that.$set(that,'product',res.data.order.info[0] || {});
that.$set(that,'orderInfo',res.data.order);
that.$set(that,'expressList',result.list || []);
});
},
get_host_product: function () {
this.loading = true
if (!this.goodScroll) return
let that = this;
getProductHot(that.params.page,that.params.limit).then(function (res) {
//this.iSshowH = false
that.loading = false
that.goodScroll = res.data.list.length >= that.params.limit
that.params.page++
that.hostProduct = that.hostProduct.concat(res.data.list)
});
},
that.isloading = true;
}).catch(e => {
that.isloading = false;
return this.$util.Tips({
title: e
});
});
}
},
//
onReachBottom() {
if (this.params.page != 1) {
this.get_host_product();
this.$refs.recommendIndex.get_host_product();
}
},
}

View File

@@ -0,0 +1,322 @@
<template>
<view :data-theme="theme">
<form @submit="subRefund" report-submit='true'>
<view class='apply-return'>
<view class='goodsStyle acea-row row-between borRadius14'
v-for="(item,index) in orderInfo.orderInfoList" :key="index">
<view class='pictrue'>
<image :src='item.image'></image>
</view>
<view class='text acea-row row-between'>
<view>
<view class='name line2'>{{item.storeName}}</view>
<view class='attr line1' v-if="item.sku">{{item.sku}}</view>
</view>
<view class='money'>
<view>{{item.price}}</view>
<view class='num'>x{{item.cartNum}}</view>
</view>
</view>
</view>
<view class='list borRadius14'>
<view class='item acea-row row-between-wrapper'>
<view>退货件数</view>
<view class='num'>{{orderInfo.totalNum}}</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>退款金额</view>
<view class='num'>{{orderInfo.payPrice}}</view>
</view>
<view class='item acea-row row-between-wrapper' @tap="toggleTab('region')">
<view>退款原因</view>
<picker class='num' @change="bindPickerChange" :value="index" :range="RefundArray">
<view class="picker acea-row row-between-wrapper">
<view class='reason'>{{RefundArray[index]}}</view>
<text class='iconfont icon-jiantou'></text>
</view>
</picker>
</view>
<view class='item textarea acea-row row-between'>
<view>备注说明</view>
<textarea placeholder='填写备注信息100字以内' class='num' name="refund_reason_wap_explain"
placeholder-class='填写备注信息100字以内'></textarea>
</view>
<view class='item acea-row row-between' style="border: none;">
<view class='title acea-row row-between-wrapper'>
<view>上传凭证</view>
<view class='tip'>( 最多可上传3张 )</view>
</view>
<view class='upload acea-row row-middle'>
<view class='pictrue' v-for="(item,index) in refund_reason_wap_imgPath" :key="index">
<image :src='item'></image>
<view class='iconfont icon-guanbi1 font-color' @tap='DelPic(index)'></view>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic'
v-if="refund_reason_wap_imgPath.length < 3">
<text class='iconfont icon-icon25201'></text>
<view>上传凭证</view>
</view>
</view>
</view>
<button class='returnBnt bg_color' form-type="submit">申请退款</button>
</view>
</view>
</form>
</view>
</template>
<script>
import {
ordeRefundReason,
orderRefundVerify,
applyRefund
} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import {
Debounce
} from '@/utils/validate.js'
let app = getApp();
export default {
data() {
return {
refund_reason_wap_img: [],
refund_reason_wap_imgPath: [],
orderInfo: {},
RefundArray: [],
index: 0,
orderId: 0,
theme: app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getOrderInfo();
this.getRefundReason();
}
},
deep: true
}
},
onLoad: function(options) {
if (!options.orderId) return this.$util.Tips({
title: '缺少订单id,无法退款'
}, {
tab: 3,
url: 1
});
this.orderId = options.orderId;
if (this.isLogin) {
this.getOrderInfo();
this.getRefundReason();
} else {
toLogin();
}
},
methods: {
onLoadFun: function() {
this.getOrderInfo();
this.getRefundReason();
},
/**
* 获取订单详情
*
*/
getOrderInfo: function() {
let that = this;
applyRefund(that.orderId).then(res => {
that.$set(that, 'orderInfo', res.data);
});
},
/**
* 获取退款理由
*/
getRefundReason: function() {
let that = this;
ordeRefundReason().then(res => {
that.$set(that, 'RefundArray', res.data);
})
},
/**
* 删除图片
*
*/
DelPic: function(e) {
let index = e,
that = this;
that.refund_reason_wap_imgPath.splice(index, 1);
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({
url: 'upload/image',
name: 'multipart',
model: "product",
pid: 1
}, function(res) {
that.refund_reason_wap_imgPath.push(res.data.url);
});
},
/**
* 申请退货
*/
subRefund: Debounce(function(e) {
let that = this,
value = e.detail.value;
//收集form表单
// if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
orderRefundVerify({
text: that.RefundArray[that.index] || '',
refund_reason_wap_explain: value.refund_reason_wap_explain,
refund_reason_wap_img: that.refund_reason_wap_imgPath.join(','),
uni: that.orderId
}).then(res => {
return this.$util.Tips({
title: '申请成功',
icon: 'success'
}, {
tab: 5,
url: '/pages/users/user_return_list/index?isT=1'
});
}).catch(err => {
return this.$util.Tips({
title: err
});
})
}),
bindPickerChange: function(e) {
this.$set(this, 'index', e.detail.value);
}
}
}
</script>
<style scoped lang="scss">
.goodsStyle .text .name, {
height: 84rpx !important;
line-height: 40rpx !important;
}
.apply-return {
padding: 20rpx 30rpx 70rpx 30rpx;
}
.apply-return .list {
background-color: #fff;
margin-top: 18rpx;
padding: 0 24rpx 70rpx 24rpx;
}
.apply-return .list .item {
min-height: 90rpx;
border-bottom: 1rpx solid #eee;
font-size: 30rpx;
color: #333;
}
.apply-return .list .item .num {
color: #282828;
width: 427rpx;
text-align: right;
}
.apply-return .list .item .num .picker .reason {
width: 385rpx;
}
.apply-return .list .item .num .picker .iconfont {
color: #666;
font-size: 30rpx;
margin-top: 2rpx;
}
.apply-return .list .item.textarea {
padding: 24rpx 0;
}
.apply-return .list .item textarea {
height: 100rpx;
font-size: 30rpx;
}
.apply-return .list .item .placeholder {
color: #bbb;
}
.apply-return .list .item .title {
height: 95rpx;
width: 100%;
}
.apply-return .list .item .title .tip {
font-size: 30rpx;
color: #bbb;
}
.apply-return .list .item .upload {
padding-bottom: 36rpx;
}
.apply-return .list .item .upload .pictrue {
border-radius: 14rpx;
margin: 22rpx 23rpx 0 0;
width: 156rpx;
height: 156rpx;
position: relative;
font-size: 24rpx;
color: #bbb;
}
.apply-return .list .item .upload .pictrue:nth-of-type(4n) {
margin-right: 0;
}
.apply-return .list .item .upload .pictrue image {
width: 100%;
height: 100%;
border-radius: 14rpx;
}
.apply-return .list .item .upload .pictrue .icon-guanbi1 {
position: absolute;
font-size: 45rpx;
top: -10rpx;
right: -10rpx;
}
.apply-return .list .item .upload .pictrue .icon-icon25201 {
color: #bfbfbf;
font-size: 50rpx;
}
.apply-return .list .item .upload .pictrue:nth-last-child(1) {
border: 1rpx solid #ddd;
box-sizing: border-box;
}
.apply-return .returnBnt {
font-size: 32rpx;
color: #fff;
width: 100%;
height: 86rpx;
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
margin: 43rpx auto;
}
.bg_color {
@include main_bg_color(theme);
}
</style>

View File

@@ -1,14 +1,28 @@
<template>
<view>
<view :data-theme="theme">
<view class='searchGood'>
<view class='search acea-row row-between-wrapper'>
<!-- #ifndef MP -->
<view class='input acea-row row-between-wrapper'>
<text class='iconfont icon-sousuo2'></text>
<input type='text' :value='searchValue' :focus="focus" placeholder='点击搜索商品' placeholder-class='placeholder' @input="setValue"></input>
<input type='text' :value='searchValue'
:focus="focus" placeholder='点击搜索商品'
confirm-type='search' @confirm="searchBut"
placeholder-class='placeholder' @input="setValue"
maxlength="20"></input>
</view>
<view class='bnt' @tap='searchBut'>搜索</view>
<!-- #endif -->
<!-- #ifdef MP -->
<searchBox :searchValue="searchValue" class="searchBox" @searchChange="searchBut"></searchBox>
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<view class='title' :style="{'margin-top':searchTop+60+'px'}">热门搜索</view>
<!-- #endif -->
<!-- #ifndef MP -->
<view class='title'>热门搜索</view>
<!-- #endif -->
<view class='list acea-row'>
<block v-for="(item,index) in hotSearchList" :key="index">
<view class='item' @tap='setHotSearchValue(item.title)'>{{item.title}}</view>
@@ -22,9 +36,9 @@
</view>
<view class='noCommodity'>
<view class='pictrue' v-if="bastList.length == 0 && isbastList">
<image src='../../static/images/noSearch.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/noSearch.png'"></image>
</view>
<recommend :hostProduct='hostProduct' v-if="bastList.length == 0"></recommend>
<recommend ref="recommendIndex" v-if="bastList.length == 0"></recommend>
</view>
</view>
</template>
@@ -32,19 +46,25 @@
<script>
import {
getSearchKeyword,
getProductslist,
getProductHot
getProductslist
} from '@/api/store.js';
import goodList from '@/components/goodList';
import recommend from '@/components/recommend';
// #ifdef MP
import searchBox from "@/components/searchBox.vue";
// #endif
let app = getApp();
export default {
components: {
goodList,
recommend
recommend,
// #ifdef MP
searchBox
// #endif
},
data() {
return {
hostProduct: [],
urlDomain: this.$Cache.get("imgHost"),
searchValue: '',
focus: true,
bastList: [],
@@ -55,20 +75,24 @@
loading: false,
loadend: false,
loadTitle: '加载更多',
hotPage:1,
isScroll:true,
isbastList: false
isbastList: false,
theme:app.globalData.theme,
searchTop:''
};
},
onLoad(e){
// #ifdef MP
this.searchTop=uni.getMenuButtonBoundingClientRect().top
// #endif
},
onShow: function() {
this.getRoutineHotSearch();
this.getHostProduct();
},
onReachBottom: function() {
if(this.bastList.length>0){
this.getProductList();
}else{
this.getHostProduct();
this.$refs.recommendIndex.get_host_product();
}
},
@@ -96,7 +120,7 @@
that.$set(that,'bastList',that.bastList);
that.loading = false;
that.loadend = loadend;
that.loadTitle = loadend ? "😕人家是有底线的~~" : "加载更多";
that.loadTitle = loadend ? "我也是有底线的~" : "加载更多";
that.page = that.page + 1;
that.isbastList = true;
}).catch(err => {
@@ -104,15 +128,6 @@
that.loadTitle = '加载更多'
});
},
getHostProduct: function() {
let that = this;
if(!this.isScroll) return
getProductHot(that.hotPage,that.limit).then(res => {
that.isScroll = res.data.list.length>=that.limit
that.hostProduct = that.hostProduct.concat(res.data.list)
that.hotPage += 1;
});
},
setHotSearchValue: function(event) {
this.$set(this, 'searchValue', event);
this.page = 1;
@@ -123,10 +138,13 @@
setValue: function(event) {
this.$set(this, 'searchValue', event.detail.value);
},
searchBut: function() {
searchBut: function(e) {
let that = this;
that.focus = false;
if (that.searchValue.length > 0) {
if(e.detail.value){
this.searchValue =e.detail.value
}
if (that.searchValue.length > 0||val) {
that.page = 1;
that.loadend = false;
that.$set(that, 'bastList', []);
@@ -150,7 +168,6 @@
<style lang="scss">
page {
margin-top: var(--status-bar-height);
background-color: #fff !important;
}
@@ -160,7 +177,16 @@
}
.searchGood .search {
/* #ifndef MP */
padding-top: 20rpx;
padding-bottom: 20rpx;
/* #endif */
/* #ifdef MP */
position: fixed;
width: 100%;
z-index: 9999;
top: 0;
/* #endif */
}
.searchGood .search .input {
@@ -196,8 +222,10 @@
}
.searchGood .title {
font-weight: 500;
font-family: PingFang SC, PingFang SC;
font-size: 28rpx;
color: #999;
color: #333;
margin: 50rpx 30rpx 25rpx 30rpx;
}
@@ -220,4 +248,7 @@
border-bottom: 1rpx solid #eee;
margin: 20rpx 30rpx 0 30rpx;
}
.searchBox{
width: 100%;
}
</style>

View File

@@ -0,0 +1,296 @@
<template>
<view :data-theme="theme">
<view class='productSort'>
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
bgcolor="#FFF"></skeleton>
<view class="skeleton" :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
<view class='header acea-row row-center-wrapper'>
<view class='acea-row row-between-wrapper input'>
<text class='iconfont icon-sousuo'></text>
<input type='text' placeholder='点击搜索商品信息' @confirm="searchSubmitValue" confirm-type='search' name="search"
placeholder-class='placeholder' maxlength="20"></input>
</view>
</view>
<view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
<scroll-view scroll-y="true" scroll-with-animation='true' style="height: 100%;">
<view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""' v-for="(item,index) in productList"
:key="index" @click='tap(index,"b"+index)'><text class="skeleton-rect">{{item.name}}</text></view>
</scroll-view>
</view>
<view class='conter'>
<scroll-view scroll-y="true" :scroll-into-view="toView" :style='"height:"+height+"rpx;margin-top: 96rpx;"' @scroll="scroll"
scroll-with-animation='true'>
<block v-for="(item,index) in productList" :key="index">
<view class='listw' :id="'b'+index">
<view class='title acea-row row-center-wrapper'>
<view class='line'></view>
<view class='name'>{{item.name}}</view>
<view class='line'></view>
</view>
<view class='list acea-row'>
<block v-for="(itemn,indexn) in item.child" :key="indexn">
<navigator hover-class='none' :url='"/pages/goods/goods_list/index?cid="+itemn.id+"&title="+itemn.name' class='item acea-row row-column row-middle'>
<view class='picture skeleton-rect' :style="{'background-color':itemn.extra?'none':'#f7f7f7'}">
<image :src='itemn.extra'></image>
</view>
<view class='name line1'>{{itemn.name}}</view>
</navigator>
</block>
</view>
</view>
</block>
<view :style='"height:"+(height-300)+"rpx;"' v-if="number<15"></view>
</scroll-view>
</view>
</view>
</view>
</view>
</template>
<script>
import {getCategoryList} from '@/api/store.js';
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import animationType from '@/utils/animationType.js'
export default {
data() {
return {
showSkeleton: true, //骨架屏显示隐藏
isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
navlist: [],
productList: [{name:'占位占位',child:[{extra:''},{extra:''}]},{name:'占位占位',child:[{extra:''},{extra:''}]},{name:'占位占位',child:[{extra:''},{extra:''}]},{name:'占位占位'}],
navActive: 0,
number: "",
height: 0,
hightArr: [],
toView: "",
tabbarH: 0,
theme:'theme1'
}
},
created() {
let _self = this;
uni.getStorage({
key: 'theme',
success: function (res) {
_self.theme = res.data;
}
});
setTimeout(() => {
this.isNodes++;
}, 500);
this.getAllCategory();
},
onShow() {
this.getAllCategory();
},
methods: {
infoScroll: function() {
let that = this;
let len = that.productList.length;
let child = that.productList[len - 1]&&that.productList[len - 1].child?that.productList[len - 1].child:[];
this.number = child?child.length:0;
//设置商品列表高度
uni.getSystemInfo({
success: function(res) {
that.height = (res.windowHeight) * (750 / res.windowWidth) - 98;
},
});
let height = 0;
let hightArr = [];
for (let i = 0; i < len; i++) {
//获取元素所在位置
let query = uni.createSelectorQuery().in(this);
let idView = "#b" + i;
query.select(idView).boundingClientRect();
query.exec(function(res) {
let top = res[0].top;
hightArr.push(top);
that.hightArr = hightArr
});
};
},
tap: function(index, id) {
this.toView = id;
this.navActive = index;
},
getAllCategory: function() {
let that = this;
getCategoryList().then(res => {
that.productList = res.data;
let pid= uni.getStorageSync('categoryId');
if(pid){
let indexNow = that.productList.findIndex(item=>item.id==pid)
this.tap(indexNow,'b'+indexNow)
}
setTimeout(function(){
that.infoScroll();
},500)
setTimeout(() => {
this.showSkeleton = false
}, 1000)
})
},
scroll: function(e) {
let scrollTop = e.detail.scrollTop + 10;
let scrollArr = this.hightArr;
for (let i = 0; i < scrollArr.length; i++) {
if (scrollTop >= 0 && scrollTop < scrollArr[1] - scrollArr[0]) {
this.navActive = 0
} else if (scrollTop >= scrollArr[i] - scrollArr[0] && scrollTop < scrollArr[i + 1] - scrollArr[0]) {
this.navActive = i
} else if (scrollTop >= scrollArr[scrollArr.length - 1] - scrollArr[0]) {
this.navActive = scrollArr.length - 1
}
}
},
searchSubmitValue: function(e) {
if (this.$util.trim(e.detail.value).length > 0)
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url: '/pages/goods/goods_list/index?searchValue=' + e.detail.value
})
else
return this.$util.Tips({
title: '请填写要搜索的产品信息'
});
},
}
}
</script>
<style scoped lang="scss">
.productSort .header {
width: 100%;
height: 96rpx;
background-color: #fff;
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 9;
border-bottom: 1rpx solid #f5f5f5;
}
.productSort .header .input {
width: 700rpx;
height: 60rpx;
background-color: #f5f5f5;
border-radius: 50rpx;
box-sizing: border-box;
padding: 0 25rpx;
}
.productSort .header .input .iconfont {
font-size: 26rpx;
color: #555;
}
.productSort .header .input .placeholder {
color: #999;
}
.productSort .header .input input {
font-size: 26rpx;
height: 100%;
width: 597rpx;
}
.productSort .aside {
position: fixed;
width: 180rpx;
left: 0;
top:0;
background-color: #f7f7f7;
overflow-y: scroll;
overflow-x: hidden;
height: auto;
margin-top: 96rpx;
}
.productSort .aside .item {
height: 100rpx;
width: 100%;
font-size: 26rpx;
color: #424242;
position: relative;
}
.productSort .aside .item.on {
background-color: #fff;
width: 100%;
text-align: center;
@include main_color(theme);
font-weight: bold;
}
.productSort .aside .item.on ::before{
content: '';
width: 4rpx;
height: 100rpx;
position: absolute;
left: 0;
top: 0;
@include main_bg_color(theme);
}
.productSort .conter {
margin: 96rpx 0 0 180rpx;
padding: 0 14rpx;
background-color: #fff;
}
.productSort .conter .listw {
padding-top: 20rpx;
}
.productSort .conter .listw .title {
height: 90rpx;
}
.productSort .conter .listw .title .line {
width: 100rpx;
height: 2rpx;
background-color: #f0f0f0;
}
.productSort .conter .listw .title .name {
font-size: 28rpx;
color: #333;
margin: 0 30rpx;
font-weight: bold;
}
.productSort .conter .list {
flex-wrap: wrap;
}
.productSort .conter .list .item {
width: 177rpx;
margin-top: 26rpx;
}
.productSort .conter .list .item .picture {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.productSort .conter .list .item .picture image {
width: 100%;
height: 100%;
border-radius: 50%;
div{
background-color: #f7f7f7;
}
}
.productSort .conter .list .item .name {
font-size: 24rpx;
color: #333;
height: 56rpx;
line-height: 56rpx;
width: 120rpx;
text-align: center;
}

View File

@@ -1,261 +1,130 @@
<template>
<view class='productSort'>
<view class='header acea-row row-center-wrapper'>
<view class='acea-row row-between-wrapper input'>
<text class='iconfont icon-sousuo'></text>
<input type='text' placeholder='点击搜索商品信息' @confirm="searchSubmitValue" confirm-type='search' name="search"
placeholder-class='placeholder'></input>
</view>
</view>
<view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
<scroll-view scroll-y="true" scroll-with-animation='true' style="height: 100%;">
<view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""' v-for="(item,index) in productList"
:key="index" @click='tap(index,"b"+index)'><text>{{item.name}}</text></view>
</scroll-view>
</view>
<view class='conter'>
<scroll-view scroll-y="true" :scroll-into-view="toView" :style='"height:"+height+"rpx;margin-top: 96rpx;"' @scroll="scroll"
scroll-with-animation='true'>
<block v-for="(item,index) in productList" :key="index">
<view class='listw' :id="'b'+index">
<view class='title acea-row row-center-wrapper'>
<view class='line'></view>
<view class='name'>{{item.name}}</view>
<view class='line'></view>
</view>
<view class='list acea-row'>
<block v-for="(itemn,indexn) in item.child" :key="indexn">
<navigator hover-class='none' :url='"/pages/goods_list/index?cid="+itemn.id+"&title="+itemn.name' class='item acea-row row-column row-middle'>
<view class='picture' :style="{'background-color':itemn.extra?'none':'#f7f7f7'}">
<image :src='itemn.extra'></image>
</view>
<view class='name line1'>{{itemn.name}}</view>
</navigator>
</block>
</view>
</view>
</block>
<view :style='"height:"+(height-300)+"rpx;"' v-if="number<15"></view>
</scroll-view>
</view>
<view class="page" :data-theme="theme" :style="{height:winHeight + 'px'}">
<cate v-show="currentPage == 'one'"></cate>
<pageFooter v-if="footerShow"></pageFooter>
</view>
</template>
<script>
import {
getCategoryList
} from '@/api/store.js';
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import pageFooter from '@/components/pageFooter/index.vue'
import cate from './components/default_cate';
import {getShare} from '@/api/public.js';
import {mapGetters} from 'vuex';
const app = getApp();
export default {
data() {
return {
navlist: [],
productList: [],
navActive: 0,
number: "",
height: 0,
hightArr: [],
toView: "",
tabbarH: 0
footerShow:true,
currentPage:'one',
theme:app.globalData.theme,
showSlide:true,
winHeight:'',
configApi: {}, //分享类容配置
}
},
onLoad(options) {
this.getAllCategory();
computed: mapGetters(['isLogin', 'uid']),
onLoad(){
let that = this;
let config = that.$Cache.getItem('categoryConfig');
that.showSlide = config.isShowCategory == 'true'? true : false;
switch (config.categoryConfig) {
case '1':
that.$set(that,'currentPage','one');
break;
case '2':
that.$set(that,'currentPage','two');
break;
case '3':
that.$set(that,'currentPage','three');
uni.hideTabBar()
this.footerShow=false
break;
case '4':
that.$set(that,'currentPage','four');
uni.hideTabBar()
this.footerShow=false
break;
}
uni.getSystemInfo({
success: function (res) {
that.winHeight = res.windowHeight;
}
});
// #ifdef H5
that.shareApi();
// #endif
},
onShow(){
},
methods: {
infoScroll: function() {
let that = this;
let len = that.productList.length;
let child = that.productList[len - 1]&&that.productList[len - 1].child?that.productList[len - 1].child:[];
this.number = child?child.length:0;
//设置商品列表高度
uni.getSystemInfo({
success: function(res) {
that.height = (res.windowHeight) * (750 / res.windowWidth) - 98;
},
});
let height = 0;
let hightArr = [];
for (let i = 0; i < len; i++) {
//获取元素所在位置
let query = uni.createSelectorQuery().in(this);
let idView = "#b" + i;
query.select(idView).boundingClientRect();
query.exec(function(res) {
let top = res[0].top;
hightArr.push(top);
that.hightArr = hightArr
});
};
},
tap: function(index, id) {
this.toView = id;
this.navActive = index;
},
getAllCategory: function() {
let that = this;
getCategoryList().then(res => {
that.productList = res.data;
setTimeout(function(){
that.infoScroll();
switch (this.currentPage){
case 'one':
break;
case 'two':
break;
case 'three':
uni.hideTabBar()
this.footerShow=false
setTimeout(()=>{
if(this.isLogin){
//登录的情况下获取模板3,4的购物车商品数量和列表
this.$refs.classThree.getCartNum();
this.$refs.classThree.getCartLists(1);
}
},500)
break;
case 'four':
uni.hideTabBar()
this.footerShow=false
setTimeout(()=>{
if(this.isLogin){
this.$refs.classFour.getCartNum();
this.$refs.classFour.getCartLists(1);
}
},500)
break;
}
},
components:{
cate,pageFooter
},
methods:{
shareApi: function() {
getShare().then(res => {
this.$set(this, 'configApi', res.data);
// #ifdef H5
this.setOpenShare(res.data);
// #endif
})
},
scroll: function(e) {
let scrollTop = e.detail.scrollTop;
let scrollArr = this.hightArr;
for (let i = 0; i < scrollArr.length; i++) {
if (scrollTop >= 0 && scrollTop < scrollArr[1] - scrollArr[0]) {
this.navActive = 0
} else if (scrollTop >= scrollArr[i] - scrollArr[0] && scrollTop < scrollArr[i + 1] - scrollArr[0]) {
this.navActive = i
} else if (scrollTop >= scrollArr[scrollArr.length - 1] - scrollArr[0]) {
this.navActive = scrollArr.length - 1
}
// 微信分享;
setOpenShare: function(data) {
let that = this;
if (that.$wechat.isWeixin()) {
let configAppMessage = {
desc: data.synopsis,
title: data.title,
link: location.href,
imgUrl: data.img
};
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
configAppMessage);
}
},
searchSubmitValue: function(e) {
if (this.$util.trim(e.detail.value).length > 0)
uni.navigateTo({
url: '/pages/goods_list/index?searchValue=' + e.detail.value
})
else
return this.$util.Tips({
title: '请填写要搜索的产品信息'
});
},
},
onReachBottom(){
if(this.currentPage=='two'){
this.$refs.classTwo.getProductList();
}
if(this.currentPage=='three'){
this.$refs.classThree.productslist();
}
if(this.currentPage=='four'){
this.$refs.classFour.productslist();
}
}
}
</script>
<style scoped lang="scss">
.productSort .header {
margin-top:var(--status-bar-height);
height: 78rpx;
background-color: #fff;
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 9;
border-bottom: 1rpx solid #f5f5f5;
<style lang="scss">
.page{
background: #fff;
height: 100% !important;
}
.productSort .header .input {
width: 700rpx;
height: 60rpx;
background-color: #f5f5f5;
border-radius: 50rpx;
box-sizing: border-box;
padding: 0 25rpx;
}
.productSort .header .input .iconfont {
font-size: 26rpx;
color: #555;
}
.productSort .header .input .placeholder {
color: #999;
}
.productSort .header .input input {
font-size: 26rpx;
height: 100%;
width: 597rpx;
}
.productSort .aside {
position: fixed;
width: 180rpx;
left: 0;
top:0;
background-color: #f7f7f7;
overflow-y: scroll;
overflow-x: hidden;
height: auto;
margin-top: 96rpx;
}
.productSort .aside .item {
height: 100rpx;
width: 100%;
font-size: 26rpx;
color: #424242;
}
.productSort .aside .item.on {
background-color: #fff;
border-left: 4rpx solid #fc4141;
width: 100%;
text-align: center;
color: #fc4141;
font-weight: bold;
}
.productSort .conter {
margin: 96rpx 0 0 180rpx;
padding: 0 14rpx;
background-color: #fff;
}
.productSort .conter .listw {
padding-top: 20rpx;
}
.productSort .conter .listw .title {
height: 90rpx;
}
.productSort .conter .listw .title .line {
width: 100rpx;
height: 2rpx;
background-color: #f0f0f0;
}
.productSort .conter .listw .title .name {
font-size: 28rpx;
color: #333;
margin: 0 30rpx;
font-weight: bold;
}
.productSort .conter .list {
flex-wrap: wrap;
}
.productSort .conter .list .item {
width: 177rpx;
margin-top: 26rpx;
}
.productSort .conter .list .item .picture {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.productSort .conter .list .item .picture image {
width: 100%;
height: 100%;
border-radius: 50%;
div{
background-color: #f7f7f7;
}
}
.productSort .conter .list .item .name {
font-size: 24rpx;
color: #333;
height: 56rpx;
line-height: 56rpx;
width: 120rpx;
text-align: center;
}
</style>
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,177 @@
<template>
<!-- 小程序顶部提示 -->
<view>
<view class="tip_box" :class="{ anScale: isAm }" v-if="showTip"
:style="{ top: isCustom ? boxTop + 'px' : '0px' }">
<view class="arrow" :style="{ 'margin-right': arrowMargin + 'px', borderBottomColor: bgColor }"></view>
<view class="container" :style="{'margin-right': cotainerMargin + 'px',backgroundColor: bgColor,borderRadius: borderR + 'px',}">
<!-- 提示文字 -->
<view class="tips" :style="{ color: fontObj.color, fontSize: fontObj.fontSize, fontWeight: fontObj.fontWeight }">
{{ text }}</view>
<view class="close" @tap="tipHidden">
<text class="iconfont icon-cha3" v-if="closeColor"></text>
<text class="iconfont icon-cha3" style="color:#fff;" v-else></text>
</view>
</view>
</view>
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
export default {
data() {
return {
showTip: false,
boxTop: 0,
arrowMargin: 0,
cotainerMargin: 0,
screenWidth: 0,
};
},
props: {
/* 是否是自定义头部 */
isCustom: {
type: Boolean,
default: false,
},
/* 背景颜色 */
bgColor: {
type: String,
default: "#ffffff",
},
/* 提示文字 */
text: {
type: String,
default: "添加到我的小程序",
},
/* 提示文字样式 */
fontObj: {
type: Object,
default: function() {
return {
color: "#202020",
fontSize: "12px",
fontWeight: "0",
};
},
},
/* 圆角大小 px*/
borderR: {
type: Number,
default: 5,
},
/* 延时出现 */
delay: {
type: Number,
default: 2000,
},
/* 关闭btn黑白两色 或者自行添加 */
closeColor: {
type: Boolean,
default: true,
},
/* 动画效果 */
isAm: {
type: Boolean,
default: true,
},
},
methods: {
tipHidden: function() {
uni.setStorageSync("my_tips_2020", "true");
this.showTip = false;
},
timeOut() {
this.tipHidden();
this.showTip = true;
},
init() {
if (uni.getStorageSync("my_tips_2020")) return;
let rect = uni.getMenuButtonBoundingClientRect();
let screenWidth = uni.getSystemInfoSync().screenWidth;
this.boxTop = rect.bottom;
this.arrowMargin = rect.width * 0.75 + 4;
this.cotainerMargin = screenWidth - rect.right;
this.timeOut();
},
},
onReady() {
this.init();
},
};
</script>
<style lang="scss" scoped>
@keyframes anScale {
from {
-webkit-transform: scale3d(0.96, 0.96, 0.96);
transform: scale3d(0.96, 0.96, 0.96);
}
50% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
to {
-webkit-transform: scale3d(0.96, 0.96, 0.96);
transform: scale3d(0.96, 0.96, 0.96);
}
}
.anScale {
animation: anScale 1s linear infinite;
}
.tip_box {
width: 70%;
position: fixed;
top: 0;
right: 0;
z-index: 100;
display: flex;
justify-content: flex-end;
align-items: flex-end;
flex-direction: column;
.arrow {
width: 0;
height: 0;
border: 10rpx solid;
border-color: transparent;
}
.container {
display: flex;
align-items: center;
justify-content: center;
padding: 16rpx 24rpx;
.tips {
flex: 1;
padding-right: 12rpx;
}
.close {
height: 30rpx;
width: 30rpx;
font-size: 20rpx;
line-height: 30rpx;
color: #999;
.closeImg {
height: 100%;
width: 100%;
}
}
}
}
</style>

View File

@@ -1,266 +0,0 @@
<template>
<view :class="{borderShow:isBorader}">
<view class="combination" v-if="combinationList.length">
<view class="title acea-row row-between">
<view class="spike-bd">
<view v-if="assistUserList.length > 0" class="activity_pic">
<view v-for="(item,index) in assistUserList" :key="index" class="picture"
:style='index===2?"position: relative":"position: static"'>
<span class="avatar" :style='"background-image: url("+item+")"'></span>
<span v-if="index===2 && Number(assistUserCount) > 3" class="mengceng">
<i>···</i>
</span>
</view>
<text class="pic_count">{{assistUserCount}}人参与</text>
</view>
</view>
<navigator url="/pages/activity/goods_combination/index" hover-class="none"
class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
</view>
<view class="conter acea-row">
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;"
show-scrollbar="false">
<view class="itemCon" v-for="(item, index) in combinationList" :key="index" @click="goDetail(item)">
<view class="item">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="text lines1">
<view class="name line1">{{item.title}}</view>
<view class="money">¥<text class="num">{{item.price}}</text></view>
<view class="y_money">¥{{item.otPrice}}</view>
</view>
</view>
</view>
<!-- <navigator :url="`/pages/activity/goods_combination_details/index?id=${item.id}`" hover-class="none" class="item" v-for="(item, index) in combinationList" :key="index">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="text lines1">
<text class="money">¥<text class="num">{{item.price}}</text></text>
<text class="y_money">¥{{item.otPrice}}</text>
</view>
</navigator> -->
</scroll-view>
</view>
</view>
</view>
</template>
<script>
let app = getApp();
import {
getCombinationIndexApi
} from '@/api/activity.js';
export default {
name: 'b_combination',
data() {
return {
combinationList: [],
isBorader: false,
assistUserList: [],
assistUserCount: 0
};
},
created() {
this.getCombinationList();
},
mounted() {},
methods: {
// 拼团列表
getCombinationList: function() {
let that = this;
getCombinationIndexApi().then(function(res) {
that.combinationList = res.data.productList;
that.assistUserList = res.data.avatarList;
that.assistUserCount = res.data.totalPeople;
}).catch((res) => {
return that.$util.Tips({
title: res
});
})
},
goDetail(item) {
uni.navigateTo({
url: `/pages/activity/goods_combination_details/index?id=${item.id}`
})
}
}
}
</script>
<style lang="scss" scoped>
.mengceng {
width: 38rpx;
height: 38rpx;
line-height: 36rpx;
background: rgba(51, 51, 51, 0.6);
text-align: center;
border-radius: 50%;
opacity: 1;
position: absolute;
left: 0px;
top: 2rpx;
color: #FFF;
i{
font-style: normal;
font-size: 20rpx;
}
}
.activity_pic {
margin-left: 28rpx;
padding-left: 20rpx;
.picture {
display: inline-block;
}
.avatar {
width: 38rpx;
height: 38rpx;
display: inline-table;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border-radius: 50%;
background-repeat: no-repeat;
background-size: cover;
background-position: 0 0;
margin-right: -10rpx;
box-shadow: 0 0 0 1px #fff;
}
.pic_count {
margin-left: 30rpx;
color: $theme-color;
font-size: 22rpx;
font-weight: 500;
}
}
.default {
width: 690rpx;
height: 300rpx;
border-radius: 14rpx;
margin: 26rpx auto 0 auto;
background-color: #ccc;
text-align: center;
line-height: 300rpx;
.iconfont {
font-size: 80rpx;
}
}
.combination {
width: auto;
background-color: #fff;
border-radius: 14rpx;
margin: 0 auto 30rpx auto;
padding: 16rpx 24rpx 24rpx 24rpx;
background-image: url(../../../static/images/pth.png);
background-repeat: no-repeat;
background-size: 100%;
.title {
width: 80%;
margin-left: 128rpx;
.sign {
width: 40rpx;
height: 40rpx;
image {
width: 100%;
height: 100%;
}
}
.name {
font-size: 32rpx;
color: #282828;
margin-left: 12rpx;
font-weight: bold;
text {
color: #797979;
font-size: 24rpx;
font-weight: 400;
margin-left: 14rpx;
}
}
.more {
width: 86rpx;
height: 40rpx;
background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
opacity: 1;
border-radius: 18px;
font-size: 22rpx;
color: #FE960F;
padding-left: 8rpx;
font-weight: 800;
.iconfont {
font-size: 21rpx;
}
}
}
.conter {
margin-top: 24rpx;
.itemCon {
display: inline-block;
width: 220rpx;
margin-right: 24rpx;
}
.item {
width: 100%;
.pictrue {
width: 100%;
height: 220rpx;
border-radius: 6rpx;
image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
.text {
margin-top: 4rpx;
.y_money {
font-size: 24rpx;
color: #999999;
text-decoration: line-through;
}
.name {
font-size: 24rpx;
color: #000;
margin-top: 14rpx;
}
.money {
color: #FD502F;
font-size: 28rpx;
height: 100%;
font-weight: bold;
margin: 10rpx 0 0rpx 0;
.num {
font-size: 28rpx;
}
}
}
}
}
}
</style>

View File

@@ -1,189 +0,0 @@
<template>
<view :class="{borderShow:isBorader}">
<view class="combination" v-if="bargList.length">
<view class="title acea-row row-between">
<view class="acea-row row-column">
<image src="../../../static/images/kanjia.png" class="pic"></image>
</view>
<navigator url="/pages/activity/goods_bargain/index" hover-class="none" class="more acea-row row-center-wrapper">GO<text class="iconfont icon-xiangyou"></text></navigator>
</view>
<view class="conter acea-row">
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
<view class="itemCon" v-for="(item, index) in bargList" :key="index" @click="bargDetail(item)">
<view class="item">
<view class="pictrue">
<image :src="item.image"></image>
</view>
<view class="text lines1">
<view class="name line1">{{item.title}}</view>
<view class="money">¥<text class="num">{{item.minPrice}}</text></view>
<view class="btn">参与砍价</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
let app = getApp();
import {
toLogin
} from '@/libs/login.js';
import {
getBargainIndexApi
} from '@/api/activity.js';
import { mapGetters } from 'vuex';
export default {
name: 'c_bargain',
computed: mapGetters({
'userData': 'userInfo',
'uid': 'uid'
}),
data() {
return {
bargList: [],
isBorader:false
};
},
created() {
this.getBargainList();
},
mounted() {
},
methods: {
// 砍价列表
getBargainList() {
getBargainIndexApi().then(res => {
this.bargList = res.data ? res.data.productList : [];
})
},
bargDetail(item){
uni.navigateTo({
url: `/pages/activity/goods_bargain_details/index?id=${item.id}&startBargainUid=${this.uid}`
});
}
}
}
</script>
<style lang="scss" scoped>
.pic{
width: 130rpx;
height: 30rpx;
}
.default{
width: 690rpx;
height: 300rpx;
border-radius: 14rpx;
margin: 26rpx auto 0 auto;
background-color: #ccc;
text-align: center;
line-height: 300rpx;
.iconfont{
font-size: 80rpx;
}
}
.combination{
width: auto;
background-image: url(../../../static/images/kjbj.png);
background-repeat: no-repeat;
background-size: 100%;
background-color: #fff;
border-radius: 14rpx;
margin: 30rpx auto 0 auto;
padding: 25rpx 20rpx 25rpx 20rpx;
.title {
.sign {
font-size: 32rpx;
color: $theme-color;
margin-bottom: 2rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.name {
text {
color: #333333;
font-size: 26rpx;
font-weight: 400;
}
}
.more {
width: 86rpx;
height: 40rpx;
background: linear-gradient(142deg, #FFE9CE 0%, #FFD6A7 100%);
opacity: 1;
border-radius: 18px;
font-size: 22rpx;
color: #FE960F;
padding-left: 8rpx;
font-weight: 800;
.iconfont {
font-size: 21rpx;
}
}
}
.conter{
margin-top: 28rpx;
.itemCon {
display: inline-block;
width: 220rpx;
margin-right: 24rpx;
}
.item{
width:100%;
.pictrue{
width: 100%;
height: 220rpx;
border-radius: 6rpx;
image{
width: 100%;
height: 100%;
border-radius: 6rpx;
}
}
.text{
margin-top: 4rpx;
.y_money {
font-size: 24rpx;
color: #999999;
text-decoration: line-through;
}
.name {
font-size: 24rpx;
color: #000;
margin-top: 14rpx;
}
.money {
color: #FD502F;
font-size: 28rpx;
height: 100%;
font-weight: bold;
margin: 10rpx 0;
.num {
font-size: 28rpx;
}
}
.btn{
width: 220rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
background: linear-gradient(129deg, #FF5555 0%, #FF0000 100%);
opacity: 1;
border-radius: 0px 0px 14rpx 14rpx;
color: #FFFFFF;
font-size: 26rpx;
margin-top: 6rpx;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,48 @@
<template>
<view class="copyRight-box" v-if="copyRightInfo">
<view>
<text @click="toIcp">{{copyRightInfo.copyrightIcpNumber}}</text>
</view>
<view class="bottom mt10" @click="toInternet">
<text>{{copyRightInfo.copyrightInternetRecord}}</text>
</view>
</view>
</template>
<script>
import {getConfigCopyright} from '@/api/api.js'
export default{
data(){
return{
copyRightInfo:null
}
},
mounted() {
this.getCopyright()
},
methods:{
getCopyright(){
getConfigCopyright().then(res=>{
this.copyRightInfo=res.data
})
},
toIcp(){
window.open(this.copyRightInfo.copyrightIcpNumberUrl)
},
toInternet(){
window.open(this.copyRightInfo.copyrightInternetRecordUrl)
},
}
}
</script>
<style lang="scss" scoped>
.copyRight-box{
padding: 40rpx 0;
text-align: center;
text{
color: #666;
font-size: 24rpx;
}
}
</style>

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,35 @@
<template>
<view>
<view :data-theme="theme">
<form @submit="formSubmit" report-submit='true'>
<view class='personal-data pad30'>
<view class='list borRadius14'>
<view class="item acea-row row-between-wrapper">
<view>头像</view>
<!-- #ifndef MP -->
<view class="pictrue" @click.stop='uploadpic'>
<image :src='newAvatar ? newAvatar : userInfo.avatar'></image>
<image src='../../../static/images/alter.png' class="alter"></image>
<image :src='newAvatar'></image>
<image :src='editPng' class="alter"></image>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="pictrue">
<button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image class="avatar" :src="newAvatar"></image>
</button>
<image :src='editPng' class="alter"></image>
</view>
<!-- #endif -->
</view>
<view class='item acea-row row-between-wrapper'>
<view>昵称</view>
<view class='input'><input type='text' name='nickname' :value='userInfo.nickname'></input>
<view class='input'>
<!-- #ifndef MP -->
<input type='text' name='nickname' :value='userInfo.nickname' maxlength="20"></input>
<!-- #endif -->
<!-- #ifdef MP -->
<input type="nickname" name='nickname' :value='nickname' class="weui-input"
placeholder="请输入昵称" />
<!-- #endif -->
</view>
</view>
<view class='item acea-row row-between-wrapper'>
@@ -21,20 +38,13 @@
v-if="!userInfo.phone">
点击绑定手机号<text class="iconfont icon-xiangyou"></text>
</navigator>
<navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-else>
<navigator url="/pages/infos/user_phone/index" hover-class="none" class="input" v-else>
<view class='input acea-row row-between-wrapper'>
<input type='text' disabled='true' name='phone' :value='userInfo.phone'
<input disabled='true' name='phone' :value='userInfo.phone'
class='id'></input>
<text class='iconfont icon-xiangyou'></text>
</view>
</navigator>
<!-- <navigator url="/pages/users/user_phone/index" hover-class="none" class="input" v-if="!memberInfo.phone">
点击绑定手机号<text class="iconfont icon-xiangyou"></text>
</navigator>
<view class='input acea-row row-between-wrapper' v-else>
<input type='text' disabled='true' name='phone' :value='memberInfo.phone' class='id'></input>
<text class='iconfont icon-suozi'></text>
</view> -->
</view>
<view class='item acea-row row-between-wrapper'>
<view>ID号</view>
@@ -51,23 +61,39 @@
</view>
</view>
<!-- #endif -->
<view class="item acea-row row-between-wrapper" v-if="userInfo.phone">
<!-- #ifdef H5 -->
<view class="item acea-row row-between-wrapper" v-if="userInfo.phone && wechat">
<view>密码</view>
<navigator url="/pages/users/user_pwd_edit/index" hover-class="none" class="input">
<navigator url="/pages/infos/user_pwd_edit/index" hover-class="none" class="input">
点击修改密码<text class="iconfont icon-xiangyou"></text>
</navigator>
</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="item acea-row row-between-wrapper" v-if="userInfo.phone">
<view>密码</view>
<navigator url="/pages/infos/user_pwd_edit/index" hover-class="none" class="input">
点击修改密码<text class="iconfont icon-xiangyou"></text>
</navigator>
</view>
<!-- #endif -->
<view class='item acea-row row-between-wrapper'>
<view>地址管理</view>
<view class="input" @click="toAddress">
立即设置<text class="iconfont icon-xiangyou"></text>
</view>
</view>
</view>
<button class='modifyBnt bg-color' formType="submit">保存修改</button>
<button class='modifyBnt bg_color' formType="submit">保存修改</button>
<!-- #ifdef H5 -->
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin"
v-if="!this.$wechat.isWeixin()">退出登录</view>
v-if="!this.$wechat.isWeixin() || (this.$wechat.isWeixin() && publicLoginType ==2)">退出登录</view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="logOut cart-color acea-row row-center-wrapper" @click="outLogin">退出登录</view>
<!-- #endif -->
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
@@ -85,24 +111,24 @@
import {
mapGetters
} from "vuex";
import {
Debounce
} from '@/utils/validate.js'
import dayjs from "@/plugin/dayjs/dayjs.min.js";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
let app = getApp();
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
memberInfo: {},
loginType: 'h5', //app.globalData.loginType
userIndex: 0,
newAvatar: '',
isAuto: false, //
isShowAuth: false //
nickname: '',
wechat: false,
theme: app.globalData.theme,
editPng: `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/alert1.png`,
publicLoginType: app.globalData.publicLoginType //(),12
};
},
computed: mapGetters(['isLogin', 'uid', 'userInfo']),
@@ -110,11 +136,63 @@
if (!this.isLogin) {
toLogin();
}
this.newAvatar = this.userInfo.avatar ? this.userInfo.avatar : `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/f.png`;
this.nickname = this.userInfo.nickname ? this.userInfo.nickname : '-';
// #ifdef H5
let ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {
this.$set(this, 'wechat', false);
} else {
this.$set(this, 'wechat', true);
}
// #endif
switch (this.theme) {
case 'theme2':
this.editPng = `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/alert2.png`
break;
case 'theme3':
this.editPng = `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/alert3.png`
break;
case 'theme4':
this.editPng = `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/alert4.png`
break;
case 'theme5':
this.editPng = `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/alert5.png`
break;
default:
this.editPng = `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/alert1.png`
break;
}
},
methods: {
//
authColse: function(e) {
this.isShowAuth = e
//to
toAddress(){
uni.navigateTo({
url:'/pages/users/user_address_list/index'
})
},
/**
* 小程序端上传头像
*
*/
onChooseAvatar(e) {
const {
avatarUrl
} = e.detail
uni.showLoading({
title: '加载中...'
});
this.$util.uploadImgs(avatarUrl, {
url: 'upload/image',
name: 'multipart',
model: "user",
pid: 7
}, (res) => {
this.newAvatar = res.data.url;
uni.hideLoading();
}, (err) => {
uni.hideLoading();
})
},
/**
* 小程序设置
@@ -138,15 +216,19 @@
content: '确认退出登录?',
success: function(res) {
if (res.confirm) {
uni.showLoading({
title: '加载中...'
})
getLogout()
.then(res => {
that.$store.commit("LOGOUT");
uni.hideLoading();
uni.reLaunch({
url: '/pages/index/index'
});
})
.catch(err => {
console.log(err);
uni.hideLoading();
});
} else if (res.cancel) {
console.log('用户点击取消');
@@ -162,10 +244,10 @@
uploadpic: function() {
let that = this;
that.$util.uploadImageOne({
url: 'user/upload/image',
url: 'upload/image',
name: 'multipart',
model: "maintain",
pid: 0
model: "user",
pid: 7
}, function(res) {
that.newAvatar = res.data.url;
});
@@ -174,20 +256,20 @@
/**
* 提交修改
*/
formSubmit: function(e) {
formSubmit: Debounce(function(e) {
let that = this,
value = e.detail.value
if (!value.nickname) return that.$util.Tips({
title: '用户姓名不能为空'
});
value.avatar = that.newAvatar?that.newAvatar:that.userInfo.avatar;
value.avatar = that.newAvatar ? that.newAvatar : that.userInfo.avatar;
userEdit(value).then(res => {
that.$store.commit("changInfo", {
amount1: 'avatar',
amount2: that.newAvatar
});
return that.$util.Tips({
title: '更换头像已成功',
title: '保存成功',
icon: 'success'
}, {
tab: 3,
@@ -202,7 +284,7 @@
url: 1
});
});
}
})
}
}
</script>
@@ -251,7 +333,8 @@
position: relative;
}
.personal-data .wrapper .wrapList .item .picTxt .pictrue image {
.personal-data .wrapper .wrapList .item .picTxt .pictrue image,
.pictrue button {
width: 100%;
height: 100%;
border-radius: 50%;
@@ -369,6 +452,10 @@
margin: 76rpx auto 0 auto;
}
.bg_color {
@include main_bg_color(theme);
}
.personal-data .logOut {
font-size: 32rpx;
text-align: center;

View File

@@ -1,53 +1,41 @@
<template>
<view>
<view :data-theme="theme">
<view class="ChangePassword">
<view class="list">
<view class="item" v-if="isNew">
<input type='number' disabled='true' placeholder='填写手机号码1' placeholder-class='placeholder' v-model="userInfo.phone"></input>
<input disabled='true' placeholder='填写手机号码' placeholder-class='placeholder' v-model="userInfo.phone"></input>
</view>
<view class="item" v-if="!isNew">
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' v-model="phone"></input>
<view class="item" v-else>
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' v-model="phone" maxlength="11"></input>
</view>
<view class="item acea-row row-between-wrapper">
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input>
<button class="code font-color" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha" maxlength="6"></input>
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
{{ text }}
</button>
</view>
</view>
<button form-type="submit" v-if="isNew" class="confirmBnt bg-color" @click="next">下一步</button>
<button form-type="submit" v-if="!isNew" class="confirmBnt bg-color" @click="editPwd">保存</button>
<button form-type="submit" v-if="isNew" class="confirmBnt bg_color" @click="next">下一步</button>
<button form-type="submit" v-else class="confirmBnt bg_color" @click="editPwd">保存</button>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import {
registerVerify,
bindingPhone,
verifyCode,
bindingVerify
} from '@/api/api.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
import {setThemeColor} from '@/utils/setTheme.js'
const app = getApp();
export default {
mixins: [sendVerifyCode],
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
phone:'',
@@ -58,7 +46,9 @@
isNew: true,
timer: '',
text: '获取验证码',
nums: 60
nums: 60,
theme:app.globalData.theme,
bgColor:''
};
},
mounted() {
@@ -66,6 +56,12 @@
},
computed: mapGetters(['isLogin','userInfo']),
onLoad() {
let that = this;
that.bgColor = setThemeColor();
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
if (this.isLogin) {
// verifyCode().then(res=>{
// this.$set(this, 'key', res.data.key)
@@ -93,16 +89,16 @@
this.isShowAuth = e
},
next() {
uni.hideLoading();
this.isNew = false;
this.captcha = '';
clearInterval(this.timer);
this.disabled = false;
this.text = "获取验证码";
uni.showLoading({
title: '加载中',
mask: true
});
// uni.hideLoading();
// this.isNew = false;
// this.captcha = '';
// clearInterval(this.timer);
// this.disabled = false;
// this.text = "";
// uni.showLoading({
// title: '',
// mask: true
// });
if (!this.captcha) return this.$util.Tips({
title: '请填写验证码'
});
@@ -110,7 +106,7 @@
phone: this.userInfo.phone,
captcha: this.captcha
}).then(res => {
uni.hideLoading();
// uni.hideLoading();
this.isNew = false;
this.captcha = '';
clearInterval(this.timer);
@@ -228,7 +224,7 @@
page {
background-color: #fff !important;
}
.ChangePassword{padding-top:100rpx;}
.ChangePassword .phone {
font-size: 32rpx;
font-weight: bold;
@@ -238,7 +234,7 @@
.ChangePassword .list {
width: 580rpx;
margin: 53rpx auto 0 auto;
margin: 0 auto;
}
.ChangePassword .list .item {
@@ -263,7 +259,8 @@
.ChangePassword .list .item .code {
font-size: 32rpx;
// background-color: #fff;
@include main_color(theme);
background-color: #f5f5f5;
}
.ChangePassword .list .item .code.on {
@@ -280,4 +277,7 @@
text-align: center;
line-height: 90rpx;
}
.bg_color{
@include main_bg_color(theme);
}
</style>

View File

@@ -1,33 +1,33 @@
<template>
<view>
<view :data-theme="theme" class="upda_pasd">
<view class="ChangePassword">
<form @submit="editPwd" report-submit='true'>
<view class="phone">当前手机号{{phone}}</view>
<view class="list">
<view class="item">
<input type='password' placeholder='以字母开头长度在6~18之间只能包含字符、数字和下划线' placeholder-class='placeholder' name="password" :value="password"></input>
<input type='password' placeholder='6-8位字母加数字' placeholder-class='placeholder' name="password" v-model="password" maxlength="18"></input>
</view>
<view class="item">
<input type='password' placeholder='确认新密码' placeholder-class='placeholder' name="qr_password" :value="qr_password"></input>
<input type='password' placeholder='确认新密码' placeholder-class='placeholder' name="qr_password" v-model="qr_password" maxlength="18"></input>
</view>
<view class="item acea-row row-between-wrapper">
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" name="captcha" :value="captcha"></input>
<button class="code font-color" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="code">
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" name="captcha" :value="captcha" maxlength="6"></input>
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="clickCode">
{{ text }}
</button>
</view>
</view>
<button form-type="submit" class="confirmBnt bg-color">确认修改</button>
<button form-type="submit" class="confirmBnt">确认修改</button>
</form>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<Verify @success="handlerOnVerSuccess" :captchaType="'clickWord'" :imgSize="{ width: '330px', height: '155px' }"
ref="verify"></Verify>
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import Verify from '@/pages/users/components/verifition/verify.vue';
import {
phoneRegisterReset,
registerVerify
@@ -38,18 +38,13 @@
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import {mapGetters} from "vuex";
import {setThemeColor} from '@/utils/setTheme.js'
const app = getApp();
export default {
mixins: [sendVerifyCode],
components: {
// #ifdef MP
authorize
// #endif
Verify,
},
data() {
return {
@@ -59,7 +54,9 @@
captcha: '',
qr_password: '',
isAuto: false, //
isShowAuth: false //
isShowAuth: false, //
theme:app.globalData.theme,
bgColor:''
};
},
computed: mapGetters(['isLogin']),
@@ -79,8 +76,29 @@
} else {
toLogin();
}
let that = this;
that.bgColor = setThemeColor();
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
},
methods: {
clickCode(){
let that = this;
if (that.qr_password != that.password) return that.$util.Tips({
title: '两次输入的密码不一致!'
});
if (!/^[a-zA-Z]\w{5,17}$/i.test(that.password)) return that.$util.Tips({
title: '密码格式错误密码必须以字母开头长度在618之间只能包含字符、数字和下划线'
});
this.$refs.verify.show();
},
//
handlerOnVerSuccess(data) {
this.$refs.verify.hide();
this.code();
},
/**
* 授权回调
*/
@@ -128,6 +146,21 @@
* H5登录 修改密码
*
*/
checkPasd(e){
let that = this,password = e.detail.value;
that.password = password;
// if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,8}$/i.test(password)) return that.$util.Tips({
if (!/^[a-zA-Z]\w{5,17}$/i.test(password)) return that.$util.Tips({
title: '密码格式错误密码必须以字母开头长度在618之间只能包含字符、数字和下划线'
});
},
//2
checkPassword(e){
let that = this,qr_password = e.detail.value;
if (qr_password != that.password) return that.$util.Tips({
title: '两次输入的密码不一致!'
});
},
editPwd: function(e) {
let that = this,
password = e.detail.value.password,
@@ -136,15 +169,15 @@
if (!password) return that.$util.Tips({
title: '请输入新密码'
});
if (!/^[a-zA-Z]\w{5,17}$/i.test(password)) return that.$util.Tips({
title: '以字母开头长度在6~18之间只能包含字符、数字和下划线'
});
if (qr_password != password) return that.$util.Tips({
title: '两次输入的密码不一致!'
if (!qr_password) return that.$util.Tips({
title: '请确认新密码'
});
if (!captcha) return that.$util.Tips({
title: '请输入验证码'
});
if (qr_password != that.password) return that.$util.Tips({
title: '两次输入的密码不一致!'
});
phoneRegisterReset({
account: that.userInfo.phone,
captcha: captcha,
@@ -170,12 +203,15 @@
page {
background-color: #fff !important;
}
.upda_pasd{
background: #FFFFFF;
height: 100vh;
}
.ChangePassword .phone {
font-size: 32rpx;
font-weight: bold;
text-align: center;
margin-top: 55rpx;
padding-top: 100rpx;
}
.ChangePassword .list {
@@ -205,7 +241,8 @@
.ChangePassword .list .item .code {
font-size: 32rpx;
background-color: #fff;
// background-color: #fff;
@include main_color(theme);
}
.ChangePassword .list .item .code.on {
@@ -221,5 +258,6 @@
margin: 92rpx auto 0 auto;
text-align: center;
line-height: 90rpx;
@include main_bg_color(theme);
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<view class="memberVip">
<template >
<view class="memberVip" :data-theme="theme">
<view class="bg">
<view class="header">
<view class="picTxt acea-row row-middle">
@@ -38,31 +38,31 @@
<view class="vipList acea-row">
<view class="item">
<view class="pictrue">
<image src="./../static/vip01.png"></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/vip01.png'"></image>
</view>
<view class="name">会员折扣</view>
</view>
<view class="item">
<view class="pictrue">
<image src="./../static/vip02.png"></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/vip02.png'"></image>
</view>
<view class="name">专属徽章</view>
</view>
<view class="item">
<view class="pictrue">
<image src="./../static/vip03.png"></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/vip03.png'"></image>
</view>
<view class="name">会员升级</view>
</view>
<view class="item">
<view class="pictrue">
<image src="./../static/vip04.png"></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/vip04.png'"></image>
</view>
<view class="name">经验积累</view>
</view>
<view class="item">
<view class="pictrue">
<image src="./../static/vip05.png"></image>
<image :src="urlDomain+'crmebimage/perset/usersImg/vip05.png'"></image>
</view>
<view class="name">更多特权</view>
</view>
@@ -115,22 +115,20 @@
<view class="item acea-row row-between-wrapper" v-for="(item,index) in expList" :key="index">
<view class="text">
<view class="name">{{item.title}}</view>
<view class="data">{{item.add_time}}</view>
<view class="data">{{item.createTime}}</view>
</view>
<view class="num" v-if="item.pm">+{{item.number}}</view>
<view class="num on" v-else>-{{item.number}}</view>
<view class="num" v-if="item.type == 1">+{{item.experience}}</view>
<view class="num on" v-else>-{{item.experience}}</view>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="expList.length">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view>
<home></home>
</view>
</template>
<script>
import home from '@/components/home';
import {
mapGetters
} from "vuex";
@@ -138,13 +136,12 @@
getlevelInfo,
getlevelExpList
} from '@/api/user.js';
let app = getApp();
export default {
components: {
home
},
computed: mapGetters(['userInfo']),
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
//userInfo: '',
levelInfo: '',
levelList: [],
@@ -155,7 +152,8 @@
loadTitle: '加载更多', //
page: 1,
limit: 20,
expList: []
expList: [],
theme:app.globalData.theme,
};
},
onLoad() {
@@ -206,7 +204,7 @@
let expList = that.$util.SplitArray(list, that.expList);
that.$set(that, 'expList', expList);
that.loadend = loadend;
that.loadTitle = loadend ? '我也是有底线的' : '加载更多';
that.loadTitle = loadend ? '我也是有底线的~' : '加载更多';
that.page = that.page + 1;
that.loading = false;
}).catch(err => {

View File

@@ -1,13 +1,13 @@
<template>
<view>
<view class='newsDetail'>
<view :data-theme="theme">
<view class='newsDetail' :style="{backgroundColor:bgColor}">
<view class='title'>{{articleInfo.title}}</view>
<view class='list acea-row row-middle'>
<view class='label'>{{articleInfo.author}}</view>
<view class='item'></text>{{articleInfo.createTime}}</view>
<view class='item'><text class='iconfont icon-liulan'></text>{{articleInfo.visit}}</view>
</view>
<view class='conters'>
<view class='conter'>
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
</view>
<view class="picTxt acea-row row-between-wrapper" v-if="store_info.id">
@@ -16,22 +16,26 @@
</view>
<view class="text">
<view class="name line1">{{store_info.storeName}}</view>
<view class="money font-color">
<view class="money price_color">
<text class="num">{{store_info.price}}</text>
</view>
<view class="y_money">{{store_info.otPrice}}</view>
</view>
<navigator :url="'/pages/goods_details/index?id='+store_info.id" hover-class="none" class="label"><text class="span">查看商品</text></navigator>
<navigator :url="'/pages/goods/goods_details/index?id='+store_info.id" hover-class="none" class="label"><text
class="span">查看商品</text></navigator>
</view>
<!-- #ifdef H5 -->
<button class="bnt bg-color" hover-class='none' @click="listenerActionSheet" v-if="this.$wechat.isWeixin()">和好友一起分享</button>
<button class="bnt bg_color" hover-class='none' @click="listenerActionSheet"
v-if="this.$wechat.isWeixin()">和好友一起分享</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="bnt bg-color" open-type="share" hover-class='none'>和好友一起分享</button>
<button class="bnt bg_color" open-type="share" hover-class='none'>和好友一起分享</button>
<!-- #endif -->
</view>
<shareInfo @setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></shareInfo>
<home></home>
<view class="article_theme">
</view>
</view>
</template>
@@ -43,12 +47,11 @@
getProductDetail
} from '@/api/store.js';
import shareInfo from '@/components/shareInfo';
import home from '@/components/home';
import parser from "@/components/jyf-parser/jyf-parser";
let app = getApp();
export default {
components: {
shareInfo,
home,
"jyf-parser": parser
},
data() {
@@ -56,97 +59,115 @@
id: 0,
articleInfo: [],
store_info: {},
content:'',
shareInfoStatus:false,
content: '',
shareInfoStatus: false,
tagStyle: {
img: 'width:100%;'
img: 'width:100%;display:block;',
table: 'width:100%',
video: 'width:100%'
},
productId: 0
productId: 0,
theme: app.globalData.theme,
bgColor:'#ffffff'
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.hasOwnProperty('id')){
this.id = options.id;
}else{
// #ifndef H5
uni.navigateBack({delta: 1 });
// #endif
// #ifdef H5
history.back();
// #endif
}
},
onShow: function () {
this.getArticleOne();
},
/**
* 用户点击右上角分享
*/
// #ifdef MP
onShareAppMessage: function() {
return {
title: this.articleInfo.title,
imageUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : "",
desc: this.articleInfo.synopsis,
path: '/pages/news_details/index?id=' + this.id
};
},
// #endif
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
if (options.hasOwnProperty('id')) {
this.id = options.id;
} else {
// #ifndef H5
uni.navigateBack({
delta: 1
});
// #endif
// #ifdef H5
history.back();
// #endif
}
},
onShow: function() {
this.getArticleOne();
},
/**
* 用户点击右上角分享
*/
// #ifdef MP
onShareAppMessage: function() {
return {
title: this.articleInfo.title,
imageUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput : "",
desc: this.articleInfo.synopsis,
path: '/pages/news/news_details/index?id=' + this.id
};
},
// #endif
methods: {
getArticleOne:function(){
let that = this;
getArticleDetails({id:that.id}).then(res=>{
getArticleOne: function() {
let that = this;
getArticleDetails({
id: that.id
}).then(res => {
uni.setNavigationBarTitle({
title:res.data.title.substring(0,7) + "..."
title: res.data.title.substring(0, 7) + "..."
});
that.$set(that,'articleInfo',res.data);
that.$set(that,'productId',res.data.productId);
if(res.data.productId){
that.$set(that, 'articleInfo', res.data);
that.$set(that, 'productId', res.data.productId);
if (res.data.productId) {
that.goodInfo(res.data.productId);
}
that.content = res.data.content;
// #ifdef H5
if(this.$wechat.isWeixin()){
if (this.$wechat.isWeixin()) {
this.setShareInfo();
}
// #endif
});
},
goodInfo(id){
getProductDetail(id).then(res=>{
this.$set(this,'store_info',res.data.storeInfo?res.data.storeInfo:{});
})
},
listenerActionSheet(){
this.shareInfoStatus = true
},
setShareInfoStatus(){
this.shareInfoStatus = false
},
setShareInfo: function() {
let href = location.href;
let configAppMessage = {
desc: this.articleInfo.synopsis,
title: this.articleInfo.title,
link: href,
imgUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : ""
};
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
}
});
},
goodInfo(id) {
getProductDetail(id).then(res => {
this.$set(this, 'store_info', res.data.storeInfo ? res.data.storeInfo : {});
})
},
listenerActionSheet() {
this.shareInfoStatus = true
},
setShareInfoStatus() {
this.shareInfoStatus = false
},
setShareInfo: function() {
let href = location.href;
let configAppMessage = {
desc: this.articleInfo.synopsis,
title: this.articleInfo.title,
link: href,
imgUrl: this.articleInfo.imageInput.length ? this.articleInfo.imageInput[0] : ""
};
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
},
bgTheme(value){
this.bgColor = value;
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #fff !important;
}
.newsDetail{
// page {
// background-color: #fff !important;
// }
.newsDetail {
// background-color: #fff;
// background-color: #D8EFD2;
// background-color: #F9F2E2;
// background-color: #D9EBED;
// background-color: #131313;
// color: #fff !important;
padding: 30rpx 0;
}
.newsDetail .title {
padding: 0 30rpx;
font-size: 34rpx;
@@ -180,13 +201,6 @@
font-size: 26rpx;
}
.newsDetail .conters {
padding: 0 30rpx;
font-size: 32rpx;
color: #8A8B8C;
line-height: 1.7;
}
.newsDetail .picTxt {
width: 690rpx;
height: 200rpx;
@@ -223,6 +237,10 @@
font-weight: bold;
}
.price_color {
@include price_color(theme);
}
.newsDetail .picTxt .text .money .num {
font-size: 36rpx;
}
@@ -272,4 +290,8 @@
text-align: center;
line-height: 90rpx;
}
.bg_color {
@include main-bg_color(theme);
}
</style>

View File

@@ -1,48 +1,49 @@
<template>
<view>
<view class='newsList'>
<view class='swiper' v-if="imgUrls.length > 0">
<view :data-theme="theme">
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
bgcolor="#FFF"></skeleton>
<view class='newsList skeleton' :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
<view class='swiper skeleton-rect' v-if="imgUrls.length > 0">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
indicator-color="rgba(102,102,102,0.3)" indicator-active-color="#666">
<block v-for="(item,index) in imgUrls" :key="index">
<swiper-item>
<navigator :url="'/pages/news_details/index?id='+item.id">
<image :src="item.imageInput" class="slide-image" />
<navigator :url="'/pages/news/news_details/index?id='+item.id">
<image :src="item.imageInput" class="slide-image" mode="aspectFill" />
</navigator>
</swiper-item>
</block>
</swiper>
</view>
<view class='nav' v-if="navList.length > 0">
<view class='nav'>
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
<block v-for="(item,index) in navList" :key="index">
<view class='item borRadius14' :class='active==item.id?"on":""' @click='tabSelect(item.id, index)'>
<view class='item borRadius14 skeleton-rect' :class='active==item.id?"on":""' @click='tabSelect(item.id, index)'>
<view>{{item.name}}</view>
<view class='line bg-color' v-if="active==item.id"></view>
<view class='line bg_color' v-if="active==item.id"></view>
</view>
</block>
</scroll-view>
</view>
<view class='list'>
<block v-for="(item,index) in articleList" :key="index">
<navigator :url='"/pages/news_details/index?id="+item.id' hover-class='none' class='item acea-row row-between-wrapper'>
<view class='item acea-row row-between-wrapper' @click="toNewDetail(item.id)">
<view class='text acea-row row-column-between'>
<view class='name line2'>{{item.title}}</view>
<view>{{item.createTime}}</view>
<view class='name line2 skeleton-rect'>{{item.title}}</view>
<view class="skeleton-rect">{{item.createTime}}</view>
</view>
<view class='pictrue'>
<view class='pictrue skeleton-rect'>
<image :src='item.imageInput'></image>
</view>
</navigator>
</view>
</block>
</view>
</view>
<view class='noCommodity' v-if="articleList.length == 0 && (page != 1 || active== 0)">
<view class='noCommodity' v-if="articleList.length == 0 && (page != 1 || active== 0) && isShow">
<view class='pictrue'>
<image src='../../static/images/noNews.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/noNews.png'"></image>
</view>
</view>
<home></home>
</view>
</template>
@@ -51,48 +52,67 @@
getArticleCategoryList,
getArticleList,
getArticleHotList,
getArticleBannerList
getArticleBannerList,
} from '@/api/api.js';
import home from '@/components/home';
import animationType from '@/utils/animationType.js'
let app = getApp();
export default {
components: {
home
},
data() {
return {
imgUrls: [],
articleList: [],
urlDomain: this.$Cache.get("imgHost"),
showSkeleton: true, //
isNodes: 0, //,
imgUrls: [{imageInput:''}],
articleList: [{imageInput:'',title: '占位占位',createTime:'占位'}],
indicatorDots: false,
circular: true,
autoplay: true,
interval: 3000,
duration: 500,
navList: [],
navList: [{id:0,name:'占位'},{id:0,name:'占位'},{id:0,name:'占位'}],
active: 0,
page: 1,
limit: 8,
status: false,
scrollLeft: 0
scrollLeft: 0,
isShow: false,
theme:app.globalData.theme,
};
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onLoad(){
setTimeout(() => {
//this.couponsList = [{name:''}]
this.isNodes++;
// #ifdef H5
this.setShare();
// #endif
}, 500);
this.getArticleHot();
this.getArticleBanner();
this.getArticleCate();
this.status = false;
this.page = 1;
this.articleList = [];
//this.articleList = [];
this.getCidArticle();
},
/**
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
// this.getArticleHot();
// this.getArticleBanner();
// this.getArticleCate();
// this.status = false;
// this.page = 1;
// //this.articleList = [];
// this.getCidArticle();
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
*/
onReachBottom: function () {
this.getCidArticle();
},
},
methods: {
getArticleHot: function() {
let that = this;
@@ -104,6 +124,9 @@
let that = this;
getArticleBannerList().then(res => {
that.imgUrls = res.data.list;
setTimeout(() => {
this.showSkeleton = false
}, 1000)
});
},
getCidArticle: function() {
@@ -124,6 +147,7 @@
that.$set(that, 'articleList', articleListNew);
that.status = limit > len;
that.page = that.page;
that.isShow = true;
});
},
getArticleCate: function() {
@@ -132,6 +156,9 @@
let list = res.data.list;
list.unshift({id:0,name:'热门'});
that.$set(that, 'navList', list);
setTimeout(() => {
this.showSkeleton = false
}, 1000)
});
},
tabSelect(active,e) {
@@ -145,7 +172,31 @@
this.status = false;
this.getCidArticle();
}
}
},
// '"/pages/news_details/index?id="+item.id'
toNewDetail(id){
uni.navigateTo({
animationType: animationType.type, animationDuration: animationType.duration,
url:"/pages/news/news_details/index?id="+id
})
},
setShare: function() {
this.$wechat.isWeixin() &&
this.$wechat.wechatEvevt([
"updateAppMessageShareData",
"updateTimelineShareData",
"onMenuShareAppMessage",
"onMenuShareTimeline"
], {
desc: this.articleList[0].title,
title: this.articleList[0].title,
link: location.href,
imgUrl:this.articleList[0].imageInput
}).then(res => {
}).catch(err => {
console.log(err);
});
},
}
}
</script>
@@ -190,6 +241,7 @@
margin-bottom: -15rpx;
}
// #endif
// #ifdef APP-PLUS || H5
.newsList .swiper .uni-swiper-dot {
width: 12rpx !important;
height: 12rpx !important;
@@ -205,6 +257,7 @@
.newsList .swiper .uni-swiper-dots.uni-swiper-dots-horizontal {
margin-bottom: -15rpx;
}
// #endif
.newsList .nav {
padding: 0 24rpx;
width: 100%;
@@ -232,6 +285,7 @@
height: 4rpx;
border-radius: 2rpx;
margin: 10rpx auto 0 auto;
@include main_bg_color(theme);
}
.newsList .list .item {

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,12 @@
<template>
<view>
<view :data-theme="theme">
<view class='payment-status'>
<!--失败时 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
<view class='iconfont icons icon-duihao2 bg-color' v-if="order_pay_info.paid || order_pay_info.payType == 'offline'"></view>
<view class='iconfont icons icon-iconfontguanbi' v-else></view>
<view class='iconfont icons icon-duihao2 bg_color'
v-if="order_pay_info.paid === 1"></view>
<view v-if="order_pay_info.paid === 2" class='iconfont icons icon-iconfontguanbi'></view>
<!-- 失败时订单支付失败 -->
<view class='status' v-if="order_pay_info.payType != 'offline'">{{order_pay_info.paid ? '订单支付成功':'订单支付失败'}}</view>
<view class='status' v-if="order_pay_info.payType != 'offline'">{{status==2 ? '订单取消支付' : errMsg ? '订单支付异常':payResult }}</view>
<view class='status' v-else>订单创建成功</view>
<view class='wrapper'>
<view class='item acea-row row-between-wrapper'>
@@ -21,40 +22,35 @@
<view class='itemCom' v-if="order_pay_info.payType=='weixin'">微信支付</view>
<view class='itemCom' v-else-if="order_pay_info.payType=='yue'">余额支付</view>
<view class='itemCom' v-else-if="order_pay_info.payType=='offline'">线下支付</view>
<view class='itemCom' v-else-if="order_pay_info.payType=='alipay'">支付宝支付</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>支付金额</view>
<view class='itemCom'>{{order_pay_info.payPrice}}</view>
</view>
<!--失败时加上这个 -->
<view class='item acea-row row-between-wrapper' v-if="order_pay_info.paid==0 && order_pay_info.payType != 'offline'">
<view class='item acea-row row-between-wrapper'
v-if="!order_pay_info.paid && order_pay_info.payType != 'offline'">
<view>失败原因</view>
<view class='itemCom'>{{status==2 ? '取消支付':msg}}</view>
</view>
</view>
<!--失败时 重新购买 -->
<view @tap="goOrderDetails">
<button formType="submit" class='returnBnt bg-color' hover-class='none'>查看订单</button>
<button formType="submit" class='returnBnt bg_color' hover-class='none'>查看订单</button>
</view>
<!-- <view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==1">
<button class='returnBnt bg-color' hover-class='none'>重新购买</button>
</view>
<view @tap="goOrderDetails" v-if="order_pay_info.paid==0 && status==2">
<button class='returnBnt bg-color' hover-class='none'>重新支付</button>
</view> -->
<button @click="goPink(order_pay_info.pinkId)" class='returnBnt cart-color' formType="submit" hover-class='none' v-if="order_pay_info.pinkId && order_pay_info.paid!=0 && status!=2 && status!=1">邀请好友参团</button>
<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none' v-else>返回首页</button>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<button @click="goPink(order_pay_info.pinkId)" class='returnBnt cart_color' formType="submit"
hover-class='none'
v-if="order_pay_info.pinkId && order_pay_info.paid!=0 && status!=2 && status!=1">邀请好友参团</button>
<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none'
v-else>返回首页</button>
</view>
</view>
</template>
<script>
import {
getOrderDetail
getOrderDetail,
wechatQueryPayResult
} from '@/api/order.js';
import {
openOrderSubscribe
@@ -65,37 +61,31 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
let app = getApp();
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
orderId: '',
order_pay_info: {
paid: 1,
paid: 0,
_status: {}
},
isAuto: false, //
isShowAuth: false ,//
status:0,
msg:''
status: 0,
msg: '',
errMsg: false,
payResult: '订单查询中...',
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getOrderPayInfo();
}
},
deep:true
deep: true
}
},
onLoad: function(options) {
@@ -107,7 +97,6 @@
});
this.orderId = options.order_id;
this.status = options.status || 0;
this.msg = options.msg || '';
if (this.isLogin) {
this.getOrderPayInfo();
} else {
@@ -115,6 +104,25 @@
}
},
methods: {
wechatQueryPay() {
wechatQueryPayResult(this.orderId).then(res => {
this.payResult = '支付成功';
uni.setNavigationBarTitle({
title: '支付成功'
});
this.order_pay_info.paid = 1;
uni.hideLoading();
})
.catch(err => {
this.order_pay_info.paid = 2;
this.errMsg = true;
this.msg = err;
uni.hideLoading();
this.$util.Tips({
title: err
});
});
},
onLoadFun: function() {
this.getOrderPayInfo();
},
@@ -129,11 +137,25 @@
title: '正在加载中'
});
getOrderDetail(that.orderId).then(res => {
uni.hideLoading();
that.$set(that, 'order_pay_info', res.data);
uni.setNavigationBarTitle({
title: res.data.paid ? '支付成功' : '支付失败'
});
if (res.data.payType === 'weixin') {
setTimeout(()=>{
that.wechatQueryPay();
},2000);
}else {
uni.setNavigationBarTitle({
title: res.data.paid ? '支付成功' : '未支付'
});
if(res.data.paid){
this.payResult = '支付成功';
this.order_pay_info.paid = 1;
}else{
this.payResult = '支付失败';
this.order_pay_info.paid = 2;
}
uni.hideLoading();
}
}).catch(err => {
uni.hideLoading();
});
@@ -147,9 +169,9 @@
});
},
//
goPink:function(id){
goPink: function(id) {
uni.navigateTo({
url: '/pages/activity/goods_combination_status/index?id='+id
url: '/pages/activity/goods_combination_status/index?id=' + id
});
},
/**
@@ -165,15 +187,15 @@
openOrderSubscribe().then(res => {
uni.hideLoading();
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + that.orderId
url: '/pages/order/order_details/index?order_id=' + that.orderId
});
}).catch(() => {
nui.hideLoading();
uni.hideLoading();
});
// #endif
// #ifndef MP
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + that.orderId
url: '/pages/order/order_details/index?order_id=' + that.orderId
})
// #endif
}
@@ -182,17 +204,25 @@
}
</script>
<style>
.icon-iconfontguanbi{
<style lang="scss">
.icon-iconfontguanbi {
background-color: #999 !important;
text-shadow: none !important;
}
.bg_color{
@include main_bg_color(theme);
}
.cart_color{
@include main_color(theme);
@include coupons_border_color(theme);
}
.payment-status {
background-color: #fff;
margin: 195rpx 30rpx 0 30rpx;
border-radius: 10rpx;
padding: 1rpx 0 28rpx 0;
}
.payment-status .icons {
font-size: 70rpx;
width: 140rpx;
@@ -201,7 +231,7 @@
color: #fff;
text-align: center;
line-height: 140rpx;
text-shadow: 0px 4px 0px #df1e14;
text-shadow: 0px 4px 0px rgba(0,0,0,.1);
border: 6rpx solid #f5f5f5;
margin: -76rpx auto 0 auto;
background-color: #999;
@@ -215,7 +245,7 @@
color: #fff;
text-align: center;
line-height: 140rpx;
text-shadow: 0px 4px 0px #df1e14;
text-shadow: 0px 4px 0px rgba(0,0,0,.1);
border: 6rpx solid #f5f5f5;
margin: -76rpx auto 0 auto;
background-color: #999;
@@ -262,5 +292,10 @@
text-align: center;
line-height: 86rpx;
margin: 0 auto 20rpx auto;
}
.cart-color {
@include main_color(theme);
@include coupons_border_color(theme);
}
</style>

View File

@@ -0,0 +1,518 @@
<template>
<view :data-theme="theme">
<view class='wrapper'>
<view class='item borRadius14'>
<view class="title"><text>{{payPrice}}</text></view>
<view class='list'>
<block v-for="(item,index) in cartArr" :key='index'>
<view v-if="item.payStatus === 1" class='payItem acea-row row-middle'
:class='active==index ?"on":""' @tap='payItem(index,item)'>
<view class='name acea-row row-center-wrapper'>
<view class='iconfont animated'
:class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'>
</view>
{{item.name}}
</view>
<view class="acea-row">
<view class='tip'>
{{item.title}}
<block v-if="item.value === 'yue'">
{{item.userBalance}}
</block>
</view>
<view class="radio">
<block v-if="active==index">
<view class="iconfont icon-xuanzhong1 font-color"></view>
</block>
<block v-else>
<view class="iconfont icon-weixuanzhong"></view>
</block>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<view v-if="isShow" class="titleNo">暂无支付方式</view>
<view class="btn-box">
<button class='Bnt bg-color' @tap='toOrderPay' :disabled="isBuy">立即支付</button>
</view>
<view class="alipaysubmit" v-html="formContent"></view>
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {openOrderSubscribe} from '@/utils/SubscribeMessage.js';
import {
orderPay,
wechatQueryPayResult
} from '@/api/order.js';
import {
Debounce
} from '@/utils/validate.js'
import {
mapGetters
} from "vuex";
import store from '@/store'
let app = getApp();
export default {
data() {
return {
active: null, //支付方式切换
theme: app.globalData.theme,
//支付方式
//支付方式
cartArr: [],
payPrice: '',
orderNo: '',
animated: false,
payType: '', //支付方式
payChannel: '',
formContent: '',
isShow: false,
userBalance: '', //余额
isBuy: false //是否可以点击购买
}
},
computed: {
...mapGetters(['productType', 'systemPlatform'])
},
onLoad(options) {
this.payPrice = options.payPrice;
this.orderNo = options.orderNo;
},
mounted() {
this.payConfig();
},
methods: {
// 支付配置
payConfig() {
uni.hideLoading();
// 支付方式
store.dispatch('getPayConfig').then((res) => {
console.log(res.payConfig);
this.cartArr = res.payConfig;
// #ifdef APP
res.payConfig.forEach(val=>{
if(val.value==='weixin'){
val.payStatus=0
}
})
// #endif
this.userBalance = res.userBalance;
if (this.cartArr.length) {
this.active = 0;
this.payType = this.cartArr[0].value;
this.isShow = false;
} else {
this.isShow = true;
return this.$util.Tips({
title: '暂无支付方式!'
})
}
});
},
payItem: Debounce(function(e, item) {
let that = this;
if (item.userBalance) that.userBalance = item.userBalance
let active = e;
that.active = active;
that.animated = true;
that.payType = that.cartArr[active].value;
setTimeout(function() {
that.car();
}, 500);
}),
car: function() {
let that = this;
that.animated = false;
},
//选择支付方式的判断,传参
getPayCheck() {
if (!this.payType) return this.$util.Tips({
title: '请选择支付方式'
});
if (this.payType === 'yue') {
this.payChannel = 'yue'
} else if (this.payType == 'alipay') {
// #ifdef H5
this.payChannel = 'alipay';
// #endif
// #ifdef APP-PLUS
this.payChannel = 'appAliPay';
// #endif
} else {
// #ifdef H5
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5';
// #endif
// #ifdef APP-PLUS
this.payChannel = this.systemPlatform === 'ios' ? 'weixinAppIos' : 'weixinAppAndroid';
// #endif
// #ifdef MP
this.payChannel = "routine";
if (this.productType == 'video') {
this.payChannel = "video";
} else {
this.payChannel = "routine";
}
// #endif
}
},
getOrderPay: function(orderNo, message) {
let that = this;
let goPages = '/pages/order/order_pay_status/index?order_id=' + orderNo;
orderPay({
orderNo: orderNo,
payChannel: that.payChannel,
payType: that.payType,
scene: that.productType === 'normal' ? 0 : 1177 //下单时小程序的场景值
}).then(res => {
let jsConfig = res.data.jsConfig;
switch (res.data.payType) {
case 'weixin':
that.weixinPay(jsConfig, orderNo, goPages);
break;
case 'yue':
return that.$util.Tips({
title: message
}, {
tab: 5,
url: goPages + '&status=1'
});
uni.hideLoading();
break;
case 'weixinh5':
setTimeout(() => {
location.href = jsConfig.mwebUrl + '&redirect_url=' +
window.location
.protocol + '//' + window.location.host + goPages +
'&status=1';
}, 100)
uni.hideLoading();
break;
}
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
});
},
weixinPay(jsConfig, orderNo, goPages) {
let that = this;
// #ifdef MP
if (that.productType === 'video') {
uni.requestOrderPayment({
timeStamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
ticket: jsConfig.ticket,
success: function(ress) {
uni.hideLoading();
openOrderSubscribe().then(() => {
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: goPages
}, );
})
},
fail: function(e) {
console.log(e)
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
},
complete: function(e) {
uni.hideLoading();
//关闭当前页面跳转至订单状态
if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
},
})
} else {
uni.requestPayment({
timeStamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign,
//ticket: jsConfig.ticket,
success: function(ress) {
uni.hideLoading();
openOrderSubscribe().then(() => {
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: goPages
}, );
})
},
fail: function(e) {
console.log(e)
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
},
complete: function(e) {
uni.hideLoading();
//关闭当前页面跳转至订单状态
if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
},
})
}
// #endif
// #ifdef H5
let data = {
timestamp: jsConfig.timeStamp,
nonceStr: jsConfig.nonceStr,
package: jsConfig.packages,
signType: jsConfig.signType,
paySign: jsConfig.paySign
};
that.$wechat.pay(data).then(res => {
if (res.errMsg == 'chooseWXPay:cancel') {
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
} else {
wechatQueryPayResult(orderNo).then(res => {
uni.hideLoading();
return that.$util.Tips({
title: '支付成功',
icon: 'success'
}, {
tab: 5,
url: goPages
});
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
})
}
}).catch(res => {
uni.hideLoading();
return that.$util.Tips({
title: '取消支付'
}, {
tab: 5,
url: goPages + '&status=2'
});
});
// #endif
// #ifdef APP-PLUS
uni.requestPayment({
provider: 'wxpay',
orderInfo: {
"appid": jsConfig.appId, // 微信开放平台 - 应用 - AppId注意和微信小程序、公众号 AppId 可能不一致
"noncestr": jsConfig.nonceStr, // 随机字符串
"package": "Sign=WXPay", // 固定值
"partnerid": jsConfig.partnerid, // 微信支付商户号
"prepayid": jsConfig.packages, // 统一下单订单号
"timestamp": Number(jsConfig.timeStamp), // 时间戳(单位:秒)
"sign": this.systemPlatform === 'ios' ? 'MD5' : jsConfig
.paySign // 签名,这里用的 MD5 签名
}, //订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
success: function(res) {
wechatQueryPayResult(orderNo).then(res => {
uni.hideLoading();
let url = '/pages/order/order_pay_status/index?order_id=' + orderNo +
'&msg=支付成功';
uni.showToast({
title: "支付成功"
})
setTimeout(res => {
uni.redirectTo({
url: url
})
}, 2000)
}).catch(err => {
uni.hideLoading();
return that.$util.Tips({
title: err
});
})
},
fail: function(err) {
uni.hideLoading();
let url = '/pages/order/order_pay_status/index?order_id=' + orderNo +
'&msg=支付失败';
uni.showModal({
content: "支付失败",
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: url
})
}
}
})
},
complete: (err) => {
uni.hideLoading();
}
});
// #endif
},
//立即支付
toOrderPay: Debounce(function() {
this.getPayCheck();
if (Number(this.payPrice) > Number(this.userBalance) && this.payType === 'yue') return this.$util
.Tips({
title: '余额的金额不够,请切换支付方式'
});
uni.showLoading({
title: '加载中...'
});
this.isBuy = true;
this.getOrderPay(this.orderNo, '支付成功')
})
},
}
</script>
<style lang="scss" scoped>
.titleNo {
width: 100%;
font-size: 28rpx;
text-align: center;
}
.btn-box {
padding: 0 30rpx;
position: fixed;
bottom: 43rpx;
}
.Bnt {
font-size: 30rpx;
font-weight: bold;
color: #fff;
width: 690rpx;
height: 86rpx;
border-radius: 43rpx;
text-align: center;
line-height: 86rpx;
}
.wrapper {
padding: 30rpx;
.list {
margin-top: 50rpx;
}
.item {
padding: 50rpx 30rpx;
font-size: 30rpx;
color: #333333;
background-color: #fff;
.title {
text-align: center;
@include main_color(theme);
font-size: 34rpx;
text {
font-weight: 800;
font-size: 50rpx;
}
}
}
.payItem {
border-bottom: 1px solid #eee;
justify-content: space-between;
height: 138rpx;
line-height: 138rpx;
width: 100%;
box-sizing: border-box;
font-size: 32pxrpx;
color: #333333;
.on {
// border-color: #fc5445;
@include coupons_border_color(theme);
color: $theme-color;
}
.name {
.iconfont {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
text-align: center;
line-height: 48rpx;
background-color: #fe960f;
color: #fff;
font-size: 30rpx;
margin-right: 28rpx;
}
}
.iconfont.icon-weixinzhifu1 {
background-color: #41b035;
}
.iconfont.icon-zhifubao {
background-color: #00AAEA;
}
.tip {
text-align: center;
font-size: 26rpx;
color: #aaa;
margin-right: 20rpx;
}
.radio {
.iconfont {
font-size: 46rpx;
}
}
}
}
</style>

View File

@@ -1,6 +1,36 @@
<template>
<view>
<view class='shoppingCart copy-data'>
<view :data-theme="theme">
<view class="cart_nav" :style='"height:"+navH+"rpx;"'>
<view class='navbarCon acea-row'>
<!-- #ifdef MP -->
<view class="select_nav flex justify-center align-center" id="home" :style="{ top: homeTop + 'rpx' }">
<text class="iconfont icon-fanhui2 px-20" @tap="returns"></text>
<text class="iconfont icon-gengduo5 px-20" @tap.stop="showNav"></text>
<text class="nav_line"></text>
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view id="home" class="home acea-row row-center-wrapper iconfont icon-shouye4 h5_back"
:style="{ top: homeTop + 'rpx' }" @tap="returns">
</view>
<!-- #endif -->
<!-- #ifndef APP-PLUS -->
<view class="nav_title" :style="{ top: homeTop + 'rpx' }">购物车</view>
<!-- #endif -->
<!-- #ifdef H5 || APP-PLUS -->
<view class="right_select" :style="{ top: homeTop + 'rpx' }" @tap="showNav">
<text class="iconfont icon-gengduo2"></text>
</view>
<!-- #endif -->
</view>
</view>
<view class="dialog_nav" :style='"top:"+navH+"rpx;"' v-show="currentPage">
<view class="dialog_nav_item" v-for="(item,index) in selectNavList" :key="index" @click="linkPage(item.url)">
<text class="iconfont" :class="item.icon"></text>
<text class="pl-20">{{item.name}}</text>
</view>
</view>
<view class='shoppingCart copy-data' :style='"top:"+navH+"rpx;"' @touchstart="touchStart">
<view class='labelNav acea-row row-around'>
<view class='item'><text class='iconfont icon-xuanzhong'></text>100%正品保证</view>
<view class='item'><text class='iconfont icon-xuanzhong'></text>所有商品精挑细选</view>
@@ -9,13 +39,13 @@
<view class="borRadius14 cartBox">
<view
v-if="(cartList.valid.length === 0 && cartList.invalid.length === 0) || (cartList.valid.length > 0)"
class='nav acea-row row-between-wrapper my_nav'>
<view>购物数量 <text class='num font-color'>{{cartCount}}</text></view>
class='nav acea-row row-between-wrapper'>
<view>购物数量 <text class='num font_color'>{{cartCount}}</text></view>
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0"
class='administrate acea-row row-center-wrapper' @click='manage'>{{ footerswitch ? '管理' : '取消'}}
</view>
</view>
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0" class="pad30 my_nav_top">
<view v-if="cartList.valid.length > 0 || cartList.invalid.length > 0" class="pad30">
<view class='list'>
<checkbox-group @change="checkboxChange">
<block v-for="(item,index) in cartList.valid" :key="index">
@@ -28,7 +58,7 @@
<checkbox :value="item.id" :checked="item.checked"
:disabled="!item.attrStatus && footerswitch" />
<!-- #endif -->
<navigator :url='"/pages/goods_details/index?id="+item.productId' hover-class='none'
<navigator :url='"/pages/goods/goods_details/index?id="+item.productId' hover-class='none'
class='picTxt acea-row row-between-wrapper'>
<view class='pictrue'>
<image :src='item.image'></image>
@@ -37,8 +67,7 @@
<view class='line1' :class="item.attrStatus?'':'reColor'">{{item.storeName}}
</view>
<view class='infor line1' v-if="item.suk">属性{{item.suk}}</view>
<view class='money' v-if="item.attrStatus">{{item.price}}</view>
<!-- <view class='money' v-if="item.attrStatus">{{item.truePrice}}</view> -->
<view class='money mt-28' v-if="item.attrStatus">{{item.vipPrice ? item.vipPrice :item.price}}</view>
<view class="reElection acea-row row-between-wrapper" v-else>
<view class="title">请重新选择商品规格</view>
<view class="reBnt cart-color acea-row row-center-wrapper"
@@ -57,7 +86,6 @@
</block>
</checkbox-group>
</view>
<!-- cartList.valid.length===0 && cartList.invalid.length > 0 -->
<view v-if="cartList.invalid.length > 0" class='invalidGoods borRadius14'
:style="cartList.valid.length===0 && cartList.invalid.length > 0 ? 'position: relative;z-index: 111;top: -120rpx;':'position: static;'">
<view class='goodsNav acea-row row-between-wrapper'>
@@ -90,23 +118,31 @@
</block>
</view>
</view>
<!-- <view class='loadingicon acea-row row-center-wrapper' v-if="cartList.valid.length&&!loadend">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view> -->
<!-- #ifdef H5 -->
<view style="height:240rpx;"></view>
<!-- #endif -->
<!-- #ifdef MP || APP-PLUS -->
<view style="height:120rpx;"></view>
<!-- #endif -->
<view class='loadingicon acea-row row-center-wrapper' v-if="cartList.invalid.length&&loadend">
<text class='loading iconfont icon-jiazai'
:hidden='loadingInvalid==false'></text>{{loadTitleInvalid}}
</view>
</view>
<view class='noCart' v-if="cartList.valid.length == 0 && cartList.invalid.length == 0 && canShow">
<view class='noCart' v-if="(cartList.valid.length == 0 && cartList.invalid.length == 0 && canShow) || !isLogin">
<view class='pictrue'>
<image src='../../static/images/noCart.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/noCart.png'"></image>
</view>
<recommend :hostProduct='hostProduct'></recommend>
<!-- 推荐商品 -->
<recommend ref="recommendIndex"></recommend>
<!-- #ifdef H5 -->
<view style="height:120rpx;"></view>
<!-- #endif -->
</view>
</view>
</view>
<view class='footer acea-row row-between-wrapper' v-if="cartList.valid.length > 0">
<!-- <view style="height:260rpx;"></view> -->
<view class='footer acea-row row-between-wrapper' v-if="cartList.valid.length > 0" :class="bottomNavigationIsCustom?'bottom-custom':''">
<view>
<checkbox-group @change="checkboxAllChange">
<checkbox value="all" :checked="!!isAllSelect" />
@@ -114,14 +150,14 @@
</checkbox-group>
</view>
<view class='money acea-row row-middle' v-if="footerswitch==true">
<text class='font-color'>{{selectCountPrice}}</text>
<text class='price-color'>{{selectCountPrice}}</text>
<form @submit="subOrder" report-submit='true'>
<button class='placeOrder bg-color' formType="submit">立即下单</button>
<button class='placeOrder bg_color' formType="submit">立即下单</button>
</form>
</view>
<view class='button acea-row row-middle' v-else>
<form @submit="subCollect" report-submit='true'>
<button class='bnt cart-color' formType="submit">收藏</button>
<button class='btn_cart_color' formType="submit">收藏</button>
</form>
<form @submit="subDel" report-submit='true'>
<button class='bnt' formType="submit">删除</button>
@@ -133,15 +169,18 @@
id='product-window'></productWindow>
<view class="uni-p-b-96"></view>
<view class="uni-p-b-98"></view>
<!-- #ifdef MP -->
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<pageFooter></pageFooter>
</view>
</template>
<script>
import pageFooter from '@/components/pageFooter/index.vue'
// #ifdef APP-PLUS
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
// #endif
// #ifndef APP-PLUS
let sysHeight = 0
// #endif
import {
getCartList,
getCartCounts,
@@ -150,31 +189,30 @@
getResetCart
} from '@/api/order.js';
import {
getProductHot,
tokenIsExistApi
} from '@/api/api.js';
import {
collectAll,
getProductDetail
} from '@/api/store.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import {getShare} from '@/api/public.js';
import {mapGetters} from "vuex";
import recommend from '@/components/recommend';
import productWindow from '@/components/productWindow';
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import animationType from '@/utils/animationType.js'
import {
Debounce
} from '@/utils/validate.js'
let app = getApp();
export default {
components: {
recommend,
productWindow,
// #ifdef MP
authorize
// #endif
pageFooter
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
cartCount: 0,
goodsHidden: false,
footerswitch: true,
@@ -213,19 +251,69 @@
cartId: 0,
product_id: 0,
sysHeight: sysHeight,
canShow: false
canShow: false,
configApi: {}, //分享类容配置
theme:app.globalData.theme,
navH:"",
homeTop: 20,
currentPage:false,
selectNavList:[
{name:'首页',icon:'icon-shouye8',url:'/pages/index/index'},
{name:'搜索',icon:'icon-sousuo6',url:'/pages/goods/goods_search/index'},
{name:'我的收藏',icon:'icon-shoucang3',url:'/pages/users/user_goods_collection/index'},
{name:'个人中心',icon:'icon-gerenzhongxin1',url:'/pages/user/index'},
],
tokenIsExist: false, //校验token是否有效
};
},
computed: mapGetters(['isLogin']),
computed: mapGetters(['isLogin','bottomNavigationIsCustom']),
onLoad: function(options) {
let that = this;
if (that.isLogin == false) {
toLogin();
}
//检查token是否有效
this.getTokenIsExist();
// #ifdef MP
this.navH = app.globalData.navHeight;
// #endif
// #ifndef MP
this.navH = 96;
// #endif
// #ifdef H5
this.shareApi();
// #endif
},
onReady() {
this.$nextTick(function() {
// #ifdef MP
const menuButton = uni.getMenuButtonBoundingClientRect();
const query = uni.createSelectorQuery().in(this);
query
.select('#home')
.boundingClientRect(data => {
this.homeTop = menuButton.top * 2 + menuButton.height - data.height;
})
.exec();
// #endif
});
},
onShow: function() {
this.canShow = false
if (this.isLogin == true) {
if (this.isLogin && this.tokenIsExist) {
this.getIndex();
};
},
methods: {
//校验token是否有效,true为有效false为无效
getTokenIsExist() {
tokenIsExistApi().then(res => {
this.tokenIsExist = res.data;
this.canShow = true;
if (this.isLogin && this.tokenIsExist) {
this.getIndex();
}
})
},
//首次进入加载的接口
getIndex(){
this.hotPage = 1;
this.hostProduct = [],
this.hotScroll = false,
@@ -237,7 +325,6 @@
this.pageInvalid = 1;
this.cartList.invalid = [];
this.getInvalidList();
//this.getCartNum();
this.footerswitch = true;
this.hotScroll = false;
this.hotPage = 1;
@@ -246,17 +333,11 @@
valid: [],
invalid: []
},
this.isAllSelect = false; //全选
this.isAllSelect = false; //全选
this.selectValue = []; //选中的数据
this.selectCountPrice = 0.00;
this.cartCount = 0;
this.isShowAuth = false;
};
},
methods: {
// 授权关闭
authColse: function(e) {
this.isShowAuth = e;
},
// 修改购物车
reGoCat: function() {
@@ -321,8 +402,19 @@
that.attr.cartAttr = true;
let productInfo = res.data.productInfo;
that.$set(that, 'productInfo', productInfo);
that.$set(that.attr, 'productAttr', res.data.productAttr);
// that.$set(that.attr, 'productAttr', res.data.productAttr);
that.$set(that, 'productValue', res.data.productValue);
let productAttr = res.data.productAttr.map(item => {
return {
attrName : item.attrName,
attrValues: item.attrValues.split(','),
id:item.id,
isDel:item.isDel,
productId:item.productId,
type:item.type
}
});
this.$set(that.attr,'productAttr',productAttr);
that.DefaultSelect();
}).catch(err => {
uni.hideLoading();
@@ -507,7 +599,7 @@
}
},
// 立即下单
subOrder: function(event) {
subOrder: Debounce(function(event) {
let that = this,
selectValue = that.selectValue;
@@ -518,7 +610,7 @@
title: '请选择产品'
});
}
},
}),
/**
* 预下单
*/
@@ -622,8 +714,7 @@
for (let index in validList) {
if (that.inArray(validList[index].id, selectValue)) {
selectCountPrice = that.$util.$h.Add(selectCountPrice, that.$util.$h.Mul(validList[index]
.cartNum, validList[
index].price))
.cartNum, validList[index].vipPrice ? validList[index].vipPrice : validList[index].price))
}
}
that.selectCountPrice = selectCountPrice;
@@ -647,7 +738,7 @@
this.$set(this.cartList, 'valid', this.cartList.valid)
}
},
subCart: function(index) {
subCart: Debounce(function(index) {
let that = this;
let status = false;
let item = that.cartList.valid[index];
@@ -667,26 +758,34 @@
that.getCartNum();
});
}
},
addCart: function(index) {
}),
addCart: Debounce(function(index) {
let that = this;
let item = that.cartList.valid[index];
item.cartNum = Number(item.cartNum) + 1;
let productInfo = item;
if (item.cartNum >= item.stock) {
if (item.cartNum < item.stock) {
item.numAdd = false;
item.numSub = false;
that.setCartNum(item.id, item.cartNum, function(data) {
that.cartList.valid[index] = item;
that.switchSelect();
that.getCartNum();
});
} else if (item.cartNum === item.stock) {
item.numAdd = true;
item.numSub = false;
that.setCartNum(item.id, item.cartNum, function(data) {
that.cartList.valid[index] = item;
that.switchSelect();
that.getCartNum();
});
} else {
item.cartNum = item.stock;
item.numAdd = true;
item.numSub = false;
} else {
item.numAdd = false;
item.numSub = false;
}
that.setCartNum(item.id, item.cartNum, function(data) {
that.cartList.valid[index] = item;
that.switchSelect();
that.getCartNum();
});
},
}),
//购物车数量变化
setCartNum(cartId, cartNum, successCallback) {
let that = this;
changeCartNum(cartId, cartNum).then(res => {
@@ -695,7 +794,7 @@
},
getCartNum: function() {
let that = this;
getCartCounts(true, 'sum').then(res => {
getCartCounts(true, 'total').then(res => {
that.cartCount = res.data.count;
});
},
@@ -723,9 +822,8 @@
limit: that.limit,
isValid: true
}
getCartCounts(true, 'sum').then(async c => {
getCartCounts(true, 'total').then(async c => {
that.cartCount = c.data.count;
if (c.data.count === 0) that.getHostProduct();
for (let i = 0; i < Math.ceil(that.cartCount / that.limit); i++) {
let cartList = await this.getCartData(data);
let valid = cartList.list;
@@ -766,7 +864,7 @@
}
}
that.$set(that.cartList, 'valid', validList);
data.page += 1;
data.page +=1;
that.selectValue = selectValue;
let newArr = validList.filter(item => item.attrStatus);
that.isAllSelect = newArr.length == selectValue.length && newArr.length;
@@ -793,7 +891,7 @@
let invalidList = that.$util.SplitArray(invalid, that.cartList.invalid);
that.$set(that.cartList, 'invalid', invalidList);
that.loadendInvalid = loadendInvalid;
that.loadTitleInvalid = loadendInvalid ? '我也是有底线的' : '加载更多';
that.loadTitleInvalid = loadendInvalid ? '我也是有底线的~' : '加载更多';
that.pageInvalid = that.pageInvalid + 1;
that.loadingInvalid = false;
//if(invalid.length===0) that.getHostProduct();
@@ -803,18 +901,6 @@
})
},
getHostProduct: function() {
let that = this;
if (that.hotScroll) return
getProductHot(
that.hotPage,
that.hotLimit,
).then(res => {
that.hotPage++
that.hotScroll = res.data.list.length < that.hotLimit
that.hostProduct = that.hostProduct.concat(res.data.list)
});
},
goodsOpen: function() {
let that = this;
that.goodsHidden = !that.goodsHidden;
@@ -865,6 +951,53 @@
}).catch(res => {
});
},
shareApi: function() {
getShare().then(res => {
this.$set(this, 'configApi', res.data);
// #ifdef H5
this.setOpenShare(res.data);
// #endif
})
},
// 微信分享;
setOpenShare: function(data) {
let that = this;
if (that.$wechat.isWeixin()) {
let configAppMessage = {
desc: data.synopsis,
title: data.title,
link: location.href,
imgUrl: data.img
};
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
configAppMessage);
}
},
returns: function() {
uni.switchTab({
url:'/pages/index/index'
})
},
showNav(){
this.currentPage = !this.currentPage;
},
//下拉导航页面跳转
linkPage(url){
if(url == '/pages/index/index' || url == '/pages/user/index'){
uni.switchTab({
url
})
}else{
uni.navigateTo({
animationType: animationType.type, animationDuration: animationType.duration,
url
})
}
this.currentPage = false
},
touchStart(){
this.currentPage = false;
}
},
onReachBottom() {
@@ -872,8 +1005,8 @@
if (that.loadend) {
that.getInvalidList();
}
if (that.cartList.valid.length == 0 && that.cartList.invalid.length == 0 && this.hotPage != 1) {
that.getHostProduct();
if (that.cartList.valid.length == 0 && that.cartList.invalid.length == 0) {
that.$refs.recommendIndex.get_host_product();
}
}
}
@@ -894,35 +1027,169 @@
.cartBox {
// background-color: #fff;
}
.cart_nav{
position: fixed;
@include main_bg_color(theme);
top: 0;
left: 0;
z-index: 99;
width: 100%;
}
.navbarCon {
position: absolute;
bottom: 0;
height: 100rpx;
width: 100%;
}
.h5_back {
color: #fff;
position: fixed;
left:20rpx;
font-size: 32rpx;
text-align: center;
line-height: 58rpx;
}
.select_nav{
width: 170rpx !important;
height: 60rpx !important;
border-radius: 33rpx;
background: rgba(255, 255, 255, 0.6);
color: #000;
position: fixed;
font-size: 18px;
line-height: 58rpx;
z-index: 1000;
left: 14rpx;
}
.px-20{
padding: 0 20rpx 0;
}
.nav_line{
content: '';
display: inline-block;
width: 1px;
height: 34rpx;
background: #fff;
position: absolute;
left: 0;
right: 0;
margin: auto;
}
.container_detail{
/* #ifdef MP */
margin-top:32rpx;
/* #endif */
}
.tab_nav{
width: 100%;
height: 48px;
padding:0 30rpx 0;
}
.nav_title{
width: 200rpx;
height: 58rpx;
line-height: 58rpx;
color: #fff;
font-size: 36rpx;
position: fixed;
text-align: center;
left: 0;
right: 0;
margin: auto;
}
.right_select{
position: fixed;
right: 20rpx;
color: #fff;
text-align: center;
line-height: 58rpx;
}
.dialog_nav{
position: fixed;
/* #ifdef MP */
left: 14rpx;
/* #endif */
/* #ifdef H5 || APP-PLUS*/
right: 14rpx;
/* #endif */
width: 240rpx;
background: #FFFFFF;
box-shadow: 0px 0px 16rpx rgba(0, 0, 0, 0.08);
z-index: 999;
border-radius: 14rpx;
&::before{
content: '';
width: 0;
height: 0;
position: absolute;
/* #ifdef MP */
left: 0;
right: 0;
margin:auto;
/* #endif */
/* #ifdef H5 || APP-PLUS */
right: 8px;
/* #endif */
top:-9px;
border-bottom: 10px solid #fff;
border-left: 10px solid transparent; /*transparent 表示透明*/
border-right: 10px solid transparent;
}
}
.dialog_nav_item{
width: 100%;
height: 84rpx;
line-height: 84rpx;
padding: 0 20rpx 0;
box-sizing: border-box;
border-bottom: #eee;
font-size: 28rpx;
color: #333;
position: relative;
.iconfont{
font-size: 32rpx;
}
&::after{
content: '';
position: absolute;
width:86px;
height: 1px;
background-color: #EEEEEE;
bottom: 0;
right: 0;
}
}
.pl-20{
padding-left: 20rpx;
}
.px-20{
padding: 0 20rpx 0;
}
.justify-center{
justify-content: center;
}
.align-center {
align-items: center;
}
.shoppingCart {
/* #ifdef H5 */
// padding-bottom: 0;
// padding-bottom: constant(safe-area-inset-bottom);
// padding-bottom: env(safe-area-inset-bottom);
/* #endif */
position: absolute;
width: 100%;
}
.shoppingCart .labelNav {
position: sticky;
height: 178rpx;
padding: 30rpx 30rpx 0 30rpx;
padding: 30rpx 30rpx 0 ;
font-size: 22rpx;
color: #fff;
position: fixed;
left: 0;
width: 100%;
box-sizing: border-box;
background-color: $theme-color;
@include main_bg_color(theme);
z-index: 5;
top: 0;
/* #ifdef MP-WEIXIN */
// top: calc(44px + 88rpx);
height: calc(178rpx + 44px + 45rpx);
padding-top: calc(44px + 50rpx);
// background-color: #282828;
/* #endif */
}
.shoppingCart .labelNav .item .iconfont {
@@ -939,10 +1206,8 @@
box-sizing: border-box;
font-size: 28rpx;
color: #282828;
position: fixed;
left: 30rpx;
margin: -90rpx auto 0 ;
z-index: 6;
top: 94rpx;
border-top-left-radius: 14rpx;
border-top-right-radius: 14rpx;
}
@@ -957,7 +1222,7 @@
}
.shoppingCart .noCart {
margin-top: 171rpx;
// margin-top: 171rpx;
background-color: #fff;
padding-top: 0.1rpx;
}
@@ -975,11 +1240,18 @@
.shoppingCart .list {
width: 100%;
margin-top: 178rpx;
// margin-top: 178rpx;
/* #ifdef MP */
// margin-bottom:120rpx;
/* #endif */
/* #ifndef MP */
// margin-bottom:240rpx;
/* #endif */
overflow: hidden;
border-bottom-left-radius: 14rpx;
border-bottom-right-radius: 14rpx;
}
.shoppingCart .list .item {
padding: 24rpx;
@@ -1033,13 +1305,23 @@
margin-top: 16rpx;
}
.shoppingCart .list .item .picTxt .text .money {
.money {
font-size: 32rpx;
color: #E93323;
margin-top: 28rpx;
font-weight: 600;
@include price_color(theme);
.price-color{
@include price_color(theme);
}
}
.mt-28{
margin-top: 28rpx;
}
.bg_color{
@include main_bg_color(theme);
}
.font_color{
@include main_color(theme);
}
.shoppingCart .list .item .picTxt .carnum {
height: 47rpx;
position: absolute;
@@ -1065,9 +1347,9 @@
line-height: 40rpx;
}
.shoppingCart .list .item .picTxt .carnum .reduce.on {
border-color: #e3e3e3;
color: #dedede;
.on {
border-color: #e3e3e3 !important;
color: #dedede !important;
}
.shoppingCart .list .item .picTxt .carnum .plus {
@@ -1085,10 +1367,6 @@
.shoppingCart .invalidGoods {
background-color: #fff;
margin-top: 30rpx;
/* #ifdef MP */
margin-top: 140rpx;
/* #endif */
}
.shoppingCart .invalidGoods .goodsNav {
@@ -1167,7 +1445,7 @@
}
.footer {
z-index: 9;
z-index: 999;
width: 100%;
height: 100rpx;
background-color: #fff;
@@ -1175,18 +1453,8 @@
padding: 0 24rpx;
box-sizing: border-box;
border-top: 1rpx solid #eee;
// border-bottom: 1px solid #EEEEEE;
/* #ifdef H5 */
bottom: 98rpx;
/* #endif */
/* #ifdef MP */
bottom: 0;
/* #endif */
/* #ifndef MP */
// bottom: 98rpx;
// bottom: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
// bottom: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
/* #endif */
bottom: var(--window-bottom);
}
.footer .checkAll {
@@ -1224,7 +1492,16 @@
text-align: center;
line-height: 60rpx;
}
.btn_cart_color{
font-size: 14px;
border-radius: 25px;
width: 80px;
height: 30px;
text-align: center;
line-height: 30px;
@include coupons_border_color(theme);
@include main_color(theme);
}
.footer .button form~form {
margin-left: 17rpx;
}
@@ -1232,17 +1509,20 @@
.uni-p-b-96 {
height: 96rpx;
}
.my_nav {
/* #ifdef MP-WEIXIN */
top: calc(44px + 88rpx + 50rpx) !important;
// background-color: #00aaff;
/* #endif */
/deep/ checkbox .uni-checkbox-input.uni-checkbox-input-checked {
@include main_bg_color(theme);
border: none !important;
color: #fff!important
}
.my_nav_top{
/* #ifdef MP-WEIXIN */
margin-top: calc(44px + 88rpx + 30rpx + 105rpx) !important;
// background-color: #00aaff;
/* #endif */
/deep/ checkbox .wx-checkbox-input.wx-checkbox-input-checked {
@include main_bg_color(theme);
border: none !important;
color: #fff!important;
margin-right: 0 !important;
}
.bottom-custom{
bottom: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
bottom: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
<template>
<view>
<view :data-theme="theme">
<view class="promoter-list">
<view class='promoterHeader bg-color'>
<view class='promoterHeader'>
<view class='headerCon acea-row row-between'>
<view>
<view class='name'>推广人数</view>
@@ -17,39 +17,41 @@
</view>
</view>
<view class='search acea-row row-between-wrapper'>
<view class='input'><input placeholder='点击搜索会员名称' placeholder-class='placeholder' v-model="keyword"
@confirm="submitForm" confirm-type='search' name="search"></input></view>
<view class='input'>
<input placeholder='点击搜索会员名称' placeholder-class='placeholder' v-model="keyword"
@confirm="submitForm" confirm-type='search' name="search" maxlength="10"></input>
</view>
<button class='iconfont icon-sousuo2' @click="submitForm"></button>
</view>
<view class='list'>
<view class="sortNav acea-row row-middle">
<view class="sortItem" @click='setSort("childCount","ASC")' v-if="sort == 'childCountDESC'">团队排序
<image src='/static/images/sort1.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort1.png'"></image>
</view>
<view class="sortItem" @click='setSort("childCount")' v-else-if="sort == 'childCountASC'">团队排序
<image src='/static/images/sort3.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort3.png'"></image>
</view>
<view class="sortItem" @click='setSort("childCount","DESC")' v-else>团队排序
<image src='/static/images/sort2.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort2.png'"></image>
</view>
<view class="sortItem" @click='setSort("numberCount","ASC")' v-if="sort == 'numberCountDESC'">
金额排序
<image src='/static/images/sort1.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort1.png'"></image>
</view>
<view class="sortItem" @click='setSort("numberCount")' v-else-if="sort == 'numberCountASC'">金额排序
<image src='/static/images/sort3.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort3.png'"></image>
</view>
<view class="sortItem" @click='setSort("numberCount","DESC")' v-else>金额排序
<image src='/static/images/sort2.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort2.png'"></image>
</view>
<view class="sortItem" @click='setSort("orderCount","ASC")' v-if="sort == 'orderCountDESC'">订单排序
<image src='/static/images/sort1.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort1.png'"></image>
</view>
<view class="sortItem" @click='setSort("orderCount")' v-else-if="sort == 'orderCountASC'">订单排序
<image src='/static/images/sort3.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort3.png'"></image>
</view>
<view class="sortItem" @click='setSort("orderCount","DESC")' v-else>订单排序
<image src='/static/images/sort2.png'></image>
<image :src="urlDomain+'crmebimage/perset/staticImg/sort2.png'"></image>
</view>
</view>
<block v-for="(item,index) in recordList" :key="index">
@@ -60,7 +62,7 @@
</view>
<view class='text'>
<view class='name line1'>{{item.nickname}}</view>
<view>加入时间: {{item.time.split(' ')[0]}}</view>
<view>加入时间: {{item.time ? item.time.split(' ')[0] : ''}}</view>
</view>
</view>
<view class="right">
@@ -78,10 +80,6 @@
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
@@ -90,29 +88,20 @@
spreadPeople,
spreadPeoCount
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue'
import Loading from "@/components/Loading";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import home from '@/components/home';
import {setThemeColor} from '@/utils/setTheme.js'
const app = getApp();
export default {
components: {
Loading,
emptyPage,
// #ifdef MP
authorize,
// #endif
home
emptyPage
},
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
page: 1,
limit: 20,
keyword: '',
@@ -125,8 +114,8 @@
recordList: [],
peopleData: {},
isShow: false,
isAuto: false, //
isShowAuth: false //
theme:app.globalData.theme,
bgColor:'#e93323'
};
},
computed: mapGetters(['isLogin']),
@@ -137,6 +126,12 @@
} else {
toLogin();
}
let that = this;
that.bgColor = setThemeColor();
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
},
onShow: function() {
if (this.is_show) this.userSpreadNewList();
@@ -145,13 +140,6 @@
this.is_show = true;
},
methods: {
onLoadFun: function(e) {
this.userSpreadNewList();
},
//
authColse: function(e) {
this.isShowAuth = e
},
setSort: function(sortKey, isAsc) {
let that = this;
that.isAsc = isAsc;
@@ -240,12 +228,13 @@
border-top-right-radius: 14rpx;
margin-top: -30rpx;
}
.promoter-list .nav .item.on {
border-bottom: 5rpx solid $theme-color;
color: $theme-color;
.promoterHeader{
@include main_bg_color(theme);
}
.promoter-list .nav .item.on {
@include main_color(theme);
@include tab_border_bottom(theme);
}
.promoter-list .search {
width: 100%;
background-color: #fff;

View File

@@ -1,7 +1,7 @@
<template>
<view>
<view :data-theme="theme">
<view class="promoter-order">
<view class='promoterHeader bg-color'>
<view class='promoterHeader'>
<view class='headerCon acea-row row-between-wrapper'>
<view>
<view class='name'>累积推广订单</view>
@@ -45,46 +45,30 @@
<emptyPage title="暂无推广订单~"></emptyPage>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
<script>
import {
spreadOrder
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import {spreadOrder} from '@/api/user.js';
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue'
import home from '@/components/home';
import {setThemeColor} from '@/utils/setTheme.js'
const app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
emptyPage,
home
emptyPage
},
data() {
return {
page: 1,
limit: 10,
limit: 20,
status: false,
recordList: [],
recordCount: 0,
isAuto: false, //
isShowAuth: false,//
time: 0
time: 0,
theme:app.globalData.theme,
bgColor:'#e93323'
};
},
computed: mapGetters(['isLogin']),
@@ -94,6 +78,12 @@
} else {
toLogin();
}
let that = this;
that.bgColor = setThemeColor();
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
},
methods: {
stringToDate : function(data){
@@ -101,13 +91,6 @@
let date = new Date(str);
return data;
},
onLoadFun() {
this.getRecordOrderList();
},
//
authColse: function(e) {
this.isShowAuth = e
},
getRecordOrderList: function() {
let that = this;
let page = that.page;
@@ -157,7 +140,9 @@
font-size: 26rpx;
color: #999;
}
.promoterHeader{
@include main_bg_color(theme);
}
.promoter-order .list .item .title .data {
font-size: 28rpx;
color: #282828;

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
<template>
<view style="height: 100%;">
<view class="page">
<view class='distribution-posters'>
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :circular="circular" :interval="interval"
:duration="duration" @change="bindchange" previous-margin="40px" next-margin="40px">
@@ -10,10 +10,10 @@
</swiper-item>
</block>
</swiper>
<!-- #ifdef MP -->
<view class='keep bg-color' @click='savePosterPath'>保存海报</view>
<!-- #ifdef APP-PLUS || MP-->
<view class='keep' :style="{backgroundColor:bgColor}" @click='savePhoto(spreadList[swiperIndex].pic)'>保存海报</view>
<!-- #endif -->
<!-- #ifndef MP -->
<!-- #ifndef MP || APP-PLUS -->
<div class="preserve acea-row row-center-wrapper">
<div class="line"></div>
<div class="tip">长按保存图片</div>
@@ -21,9 +21,6 @@
</div>
<!-- #endif -->
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<view class="canvas" v-if="canvasStatus">
<canvas style="width:750px;height:1190px;" canvas-id="canvasOne"></canvas>
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
@@ -32,9 +29,14 @@
</template>
<script>
// #ifdef H5
// #ifdef H5 || APP-PLUS
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
// #endif
// #ifdef APP-PLUS
import {
HTTP_H5_URL
} from '@/config/app.js';
// #endif
import {
getUserInfo,
spreadBanner
@@ -49,22 +51,15 @@
import {
base64src
} from '@/utils/base64src.js'
import authorize from '@/components/Authorize';
import {
getQrcode
} from '@/api/api.js';
// #endif
import home from '@/components/home';
import {setThemeColor} from '@/utils/setTheme.js'
import {
imageBase64
} from "@/api/public";
export default {
components: {
// #ifdef MP
authorize,
// #endif
home
},
data() {
return {
imgUrls: [],
@@ -76,12 +71,11 @@
swiperIndex: 0,
spreadList: [],
poster: '',
isAuto: false, //
isShowAuth: false, //
qrcodeSize: 1000,
PromotionCode: '',
base64List: [],
canvasStatus: true //
canvasStatus: true, //
bgColor:'#e93323'
};
},
computed: mapGetters(['isLogin', 'uid', 'userInfo']),
@@ -96,6 +90,7 @@
}
},
onLoad() {
this.bgColor = setThemeColor();
if (this.isLogin) {
this.userSpreadBannerList();
} else {
@@ -110,7 +105,7 @@
return {
title: this.userInfo.nickname + '-分销海报',
imageUrl: this.spreadList[0].pic,
path: '/pages/index/index?spid=' + this.uid,
path: '/pages/index/index?spread=' + this.uid,
};
},
// #endif
@@ -157,7 +152,7 @@
})
// #endif
// #ifdef MP
// #ifdef MP || APP-PLUS
that.base64List = images.map(item => {
return item.pic
});
@@ -166,6 +161,9 @@
// #ifdef MP
that.getQrcode();
// #endif
// #ifdef APP-PLUS
that.make();
// #endif
},
//
getQrcode() {
@@ -182,12 +180,12 @@
}
});
getQrcode(data).then(res => {
base64src(res.data.code, res => {
base64src(res.data.code,Date.now(), res => {
that.PromotionCode = res;
setTimeout(() => {
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
}, 1000);
});
setTimeout(() => {
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
}, 300);
}).catch(err => {
uni.hideLoading();
that.$util.Tips({
@@ -203,6 +201,12 @@
// #ifdef H5
href = window.location.href.split('/pages')[0];
// #endif
// #ifdef APP-PLUS
href = HTTP_H5_URL;
let routes = getCurrentPages(); //
let curRoute = routes[routes.length - 1].route //
let curParam = routes[routes.length - 1].options; //
// #endif
uQRCode.make({
canvasId: 'qrcode',
text: href + '/pages/index/index?spread=' + that.uid,
@@ -211,9 +215,8 @@
success: res => {
that.PromotionCode = res;
setTimeout(() => {
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo
.nickname, 0);
}, 300);
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo.nickname, 0);
}, 1000);
},
complete: (res) => {},
fail: res => {
@@ -248,14 +251,13 @@
success: function(res) {
// H5tempFilePath base64
uni.hideLoading();
that.spreadList[index].pic = res
.tempFilePath;
that.$set(that, 'poster', res
.tempFilePath);
that.spreadList[index].pic = res.tempFilePath;
that.$set(that, 'poster', res.tempFilePath);
that.$set(that, 'canvasStatus', false);
}
})
})
}, 100);
},
fail: function(err) {
@@ -266,16 +268,6 @@
}
});
},
onLoadFun: function(e) {
this.$set(this, 'userInfo', e);
this.userSpreadBannerList();
},
//
authColse: function(e) {
this.isShowAuth = e
},
bindchange(e) {
let base64List = this.base64List;
let index = e.detail.current;
@@ -287,55 +279,28 @@
arrImagesUrl = res.tempFilePath;
setTimeout(() => {
this.$set(this, 'canvasStatus', true);
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname,
index);
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname,index);
}, 300);
}
});
},
//
savePosterPath: function() {
savePhoto:function(url){
let that = this;
uni.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
uni.authorize({
scope: 'scope.writePhotosAlbum',
success() {
uni.saveImageToPhotosAlbum({
filePath: that.poster,
success: function(res) {
that.$util.Tips({
title: '保存成功',
icon: 'success'
});
},
fail: function(res) {
that.$util.Tips({
title: '保存失败'
});
}
});
}
});
} else {
uni.saveImageToPhotosAlbum({
filePath: that.poster,
success: function(res) {
that.$util.Tips({
title: '保存成功',
icon: 'success'
});
},
fail: function(res) {
that.$util.Tips({
title: '保存失败'
});
}
});
}
uni.saveImageToPhotosAlbum({
filePath: url,
success: function(res) {
that.$util.Tips({
title: '保存成功',
icon: 'success'
});
},
fail: function(res) {
that.$util.Tips({
title: '保存失败'
});
}
});
});
},
setShareInfoStatus: function() {
if (this.$wechat.isWeixin()) {
@@ -354,11 +319,16 @@
</script>
<style lang="scss" scoped>
page {
background-color: #a3a3a3 !important;
height: 100% !important;
// page {
// background-color: #A2A2A2 !important;
// height: 100vh;
// overflow: auto;
// }
.page{
height: 100vh;
overflow: auto;
background-color: #A2A2A2 !important;
}
.canvas {
position: relative;
}
@@ -405,6 +375,7 @@
text-align: center;
line-height: 80rpx;
margin: 38rpx auto;
}
.distribution-posters .preserve {

View File

@@ -1,7 +1,7 @@
<template>
<view>
<view :data-theme="theme">
<view class='commission-details'>
<view class='promoterHeader bg-color'>
<view class='promoterHeader'>
<view class='headerCon acea-row row-between-wrapper'>
<view>
<view class='name'>{{name}}</view>
@@ -23,7 +23,7 @@
<view class='name line1'>{{child.status | statusFilter}}</view>
<view>{{child.createTime}}</view>
</view>
<view class='num font-color' v-if="child.status == 1">+{{child.extractPrice}}
<view class='num font_color' v-if="child.status == -1">+{{child.extractPrice}}
</view>
<view class='num' v-else>-{{child.extractPrice}}</view>
<!-- <view>
@@ -58,7 +58,7 @@
<view class='name line1'>{{child.title}}</view>
<view>{{child.updateTime}}</view>
</view>
<view class='num font-color' v-if="child.type == 1">+{{child.price}}
<view class='num font_color' v-if="child.type == 1">+{{child.price}}
</view>
<view class='num' v-else>-{{child.price}}</view>
</view>
@@ -72,10 +72,6 @@
</view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home>
</view>
</template>
@@ -90,18 +86,12 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue'
import home from '@/components/home';
import {setThemeColor} from '@/utils/setTheme.js'
const app = getApp();
export default {
components: {
// #ifdef MP
authorize,
// #endif
emptyPage,
home
emptyPage
},
filters: {
statusFilter(status) {
@@ -122,9 +112,10 @@
recordList: [],
recordType: 0,
statuss: false,
isAuto: false, //
isShowAuth: false, //
extractCount: 0
extractCount: 0,
theme:app.globalData.theme,
commissionCount:0,
bgColor:'#e93323'
};
},
computed: mapGetters(['isLogin']),
@@ -136,6 +127,12 @@
} else {
toLogin();
}
let that = this;
that.bgColor = setThemeColor();
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
},
onShow: function() {
let type = this.type;
@@ -177,13 +174,6 @@
},
methods: {
onLoadFun() {
this.getRecordList();
},
//
authColse: function(e) {
this.isShowAuth = e
},
getList: function() {
let that = this;
let recordList = that.recordList;
@@ -235,8 +225,13 @@
.commission-details .promoterHeader .headerCon .money {
font-size: 36rpx;
}
.promoterHeader{
@include main_bg_color(theme);
}
.commission-details .promoterHeader .headerCon .money .num {
font-family: 'Guildford Pro';
}
.font_color{
color: #E93323 !important;
}
</style>

View File

@@ -0,0 +1,232 @@
<template>
<view :data-theme="theme">
<view class='my-promotion'>
<view class="header">
<image class="head_img" :src="urlDomain+'crmebimage/maintain/2021/07/13/48e81e3e2e374d48820b7a9a56905365k2qa9yj8n5.png'"></image>
<navigator :url="'/pages/promoter/user_spread_money/index?type=1&extractCount='+spreadInfo.extractCount" hover-class="none" class='record'>提现记录<text class='iconfont icon-xiangyou'></text></navigator>
<view class="head_box">
<view class='name acea-row row-center-wrapper'>
<view>当前佣金</view>
</view>
<view class='num'>{{spreadInfo.commissionCount}}</view>
<view class='profit acea-row row-between-wrapper'>
<view class='item'>
<view>昨日收益</view>
<view class='money'>{{spreadInfo.lastDayCount ? Number(spreadInfo.lastDayCount).toFixed(2) : 0}}</view>
</view>
<view class='item'>
<view>累积已提</view>
<view class='money'>{{spreadInfo.extractCount ? Number(spreadInfo.extractCount).toFixed(2) : 0}}</view>
</view>
</view>
</view>
</view>
<!-- #ifdef APP-PLUS || H5 -->
<navigator url="/pages/users/user_cash/index" hover-class="none" class='bnt bg_color'>立即提现</navigator>
<!-- #endif -->
<!-- #ifdef MP -->
<view @click="openSubscribe('/pages/users/user_cash/index')" class='bnt bg_color'>立即提现</view>
<!-- #endif -->
<view class='list acea-row row-between-wrapper'>
<navigator url='/pages/promoter/user_spread_code/index' hover-class="none" class='item acea-row row-center-wrapper row-column'>
<text class='iconfont icon-erweima'></text>
<view>推广名片</view>
</navigator>
<navigator url='/pages/promoter/promoter-list/index' hover-class="none" class='item acea-row row-center-wrapper row-column'>
<text class='iconfont icon-tongji'></text>
<view>推广人统计</view>
</navigator>
<navigator :url="'/pages/promoter/user_spread_money/index?type=2&commissionCount='+spreadInfo.commissionCount" hover-class="none" class='item acea-row row-center-wrapper row-column'>
<text class='iconfont icon-qiandai'></text>
<view>佣金明细</view>
</navigator>
<navigator url='/pages/promoter/promoter-order/index' hover-class="none" class='item acea-row row-center-wrapper row-column'>
<text class='iconfont icon-dingdan'></text>
<view>推广人订单</view>
</navigator>
<navigator url='/pages/promoter/promoter_rank/index' hover-class="none" class='item acea-row row-center-wrapper row-column'>
<text class='iconfont icon-paihang1'></text>
<view>推广人排行</view>
</navigator>
<navigator url='/pages/promoter/commission_rank/index' hover-class="none" class='item acea-row row-center-wrapper row-column'>
<text class='iconfont icon-paihang'></text>
<view>佣金排行</view>
</navigator>
</view>
</view>
</view>
</template>
<script>
import { getSpreadInfo } from '@/api/user.js';
import { openExtrctSubscribe } from '@/utils/SubscribeMessage.js';
import {toLogin} from '@/libs/login.js';
import {mapGetters} from "vuex";
import {setThemeColor} from '@/utils/setTheme.js'
const app = getApp();
export default {
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
spreadInfo: {},
theme:app.globalData.theme,
bgColor:'#e93323'
};
},
computed: mapGetters(['isLogin']),
watch: {
isLogin: {
handler: function(newV, oldV) {
if (newV) {
this.getSpreadInfo();
}
},
deep: true
}
},
onShow() {
let that = this;
that.bgColor = setThemeColor();
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
if (this.isLogin) {
this.getSpreadInfo();
} else {
toLogin();
}
},
methods: {
openSubscribe: function(page) {
uni.navigateTo({
url: page,
});
},
/**
* 获取个人用户信息
*/
getSpreadInfo: function() {
let that = this;
getSpreadInfo().then(res => {
that.$set(that,'spreadInfo',res.data);
});
}
}
}
</script>
<style scoped lang="scss">
.my-promotion .header {
width: 100%;
height: 375rpx;
position: relative;
}
.head_img{
width: 100%;
height: 375rpx;
position: absolute;
top: 0;
z-index: 2;
}
.head_box{
width: 100%;
height: 375rpx;
position: absolute;
top: 0;
z-index: 0;
@include main_bg_color(theme);
}
.my-promotion .header .name {
font-size: 30rpx;
color: #fff;
padding-top: 57rpx;
position: relative;
}
.my-promotion .header .record {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.8);
position: absolute;
right: 20rpx;
top:60rpx;
z-index:10;
}
.my-promotion .header .record .iconfont {
font-size: 25rpx;
margin-left: 10rpx;
vertical-align: 2rpx;
}
.my-promotion .header .num {
text-align: center;
color: #fff;
margin-top: 28rpx;
font-size: 90rpx;
font-family: 'Guildford Pro';
}
.my-promotion .header .profit {
padding: 0 20rpx;
margin-top: 35rpx;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.my-promotion .header .profit .item {
min-width: 200rpx;
text-align: center;
}
.my-promotion .header .profit .item .money {
font-size: 34rpx;
color: #fff;
margin-top: 5rpx;
}
.my-promotion .bnt {
font-size: 28rpx;
color: #fff;
width: 278rpx;
height: 108rpx;
box-sizing: border-box;
border: 20rpx solid #f5f5f5;
border-radius: 50rpx;
text-align: center;
line-height: 68rpx;
margin: -52rpx auto 0 auto;
box-sizing: border-box;
position: absolute;
left: 0;
right: 0;
z-index: 3;
}
.bg_color{
@include main_bg_color(theme);
}
.my-promotion .list {
padding: 0 30rpx 50rpx 30rpx;
margin-top: 60rpx;
}
.my-promotion .list .item {
width: 335rpx;
height: 240rpx;
border-radius: 14rpx;
background-color: #fff;
margin-top: 20rpx;
font-size: 30rpx;
color: #666;
}
.my-promotion .list .item .iconfont {
font-size: 70rpx;
// background: linear-gradient(to right, #fc4d3d 0%, #e93323 100%);
@include main_bg_color(theme);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 20rpx;
}
</style>

View File

@@ -1,8 +0,0 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@@ -1,122 +0,0 @@
<template>
<view class="register absolute">
<view class="shading">
<view class="pictrue acea-row row-center-wrapper">
<image src="../../static/images/logo2.png"></image>
</view>
</view>
<view class="whiteBg">
<view class="title">找回密码</view>
<view class="list">
<view class="item">
<view class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image>
<input type="text" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" class="input"/>
</view>
</view>
<view class="item">
<view class="align-left acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" placeholder-class="placeholder"/>
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<image src="/static/images/code_1.png"></image>
<input type="password" placeholder="填写您的登录密码" v-model="password" placeholder-class="placeholder" class="input"/>
</view>
</view>
</view>
<view class="logon" @click="registerReset">确认</view>
<navigator url="/pages/users/login/index" class="tip">
<text class="font-color">立即登录</text>
</navigator>
</view>
<view class="bottom"></view>
</view>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import { registerVerify, registerReset } from "@/api/user";
export default {
data() {
return {
account: "",
password: "",
captcha: ""
};
},
mixins: [sendVerifyCode],
methods: {
registerReset() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码'
});
if (!that.password) return that.$util.Tips({
title: '请填写密码'
});
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
title: '您输入的密码过于简单'
});
registerReset({
account: that.account,
captcha: that.captcha,
password: that.password
})
.then(res => {
that.$util.Tips({
title: res,
success: () => {
uni.navigateTo({
url: '/pages/login/index'
});
}
});
})
.catch(res => {
that.$util.Tips({
title: res
});
});
},
async code() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
registerVerify({ phone: that.account })
.then(res => {
that.$util.Tips({
title: res
});
that.sendCode();
})
.catch(res => {
that.$util.Tips({
title: res
});
});
}
}
};
</script>
<style>
</style>

View File

@@ -1,182 +1,168 @@
<template>
<view class="new-users copy-data" ><!-- 去掉了 :style="{height:pageHeight}" -->
<view class="mid" style="flex:1;overflow: hidden;">
<scroll-view scroll-y="true" style="height: 100%;">
<view class="bg"></view>
<view class="head pad30">
<view class="user-card">
<view class="user-info">
<image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar && uid"
@click="goEdit()"></image>
<image v-else class="avatar" src="/static/images/f.png" mode="" @click="goEdit()"></image>
<view class="info">
<view class="name" v-if="!uid" @tap="openAuto">
请点击登录
</view>
<view class="name" v-if="uid">
{{userInfo.nickname}}
<view class="vip" v-if="userInfo.vip">
<image :src="userInfo.vipIcon" alt="">
<view style="margin-left: 10rpx;" class="vip-txt">{{userInfo.vipName || ''}}
</view>
<view :data-theme="theme">
<view class="new-users copy-data">
<view class="mid" style="flex:1;overflow: hidden;">
<scroll-view scroll-y="true">
<view class="bg"></view>
<view class="head pad30">
<view class="user-card">
<view class="user-info" @click="goEdit()">
<image class="avatar" :src='userInfo.avatar' v-if="userInfo.avatar && uid"></image>
<image v-else class="avatar" :src="urlDomain+'crmebimage/perset/staticImg/f.png'" mode=""></image>
<view class="info">
<view class="name" v-if="!isLogin" @tap="openAuto">
请点击登录
</view>
</view>
<view class="num" v-if="userInfo.phone && uid" @click="goEdit()">
<view class="num-txt">{{userInfo.phone}}</view>
<view class="icon">
<image src="/static/images/edit.png" mode=""></image>
<view class="name" v-if="userInfo && uid">
{{userInfo && userInfo.nickname && uid ? userInfo.nickname : ''}}
<view class="vip" v-if="userInfo.vip">
<image :src="userInfo.vipIcon" alt="">
<view style="margin-left: 10rpx;" class="vip-txt">{{userInfo.vipName|| ''}}
</view>
</view>
</view>
</view>
<view class="phone" v-if="!userInfo.phone && isLogin" @tap="bindPhone">绑定手机号</view>
</view>
</view>
<view class="num-wrapper">
<view class="num-item" @click="goMenuPage('/pages/users/user_money/index')">
<text
class="num">{{userInfo.nowMoney && uid ?Number(userInfo.nowMoney).toFixed(2):0}}</text>
<view class="txt">余额</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')">
<text class="num">{{userInfo.integral && uid ? userInfo.integral: 0}}</text>
<view class="txt">积分</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
<text class="num">{{userInfo.couponCount && uid ? userInfo.couponCount : 0}}</text>
<view class="txt">优惠券</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index')">
<text class="num">{{userInfo.collectCount && uid ? userInfo.collectCount : 0}}</text>
<view class="txt">收藏</view>
</view>
</view>
<!-- <view class="sign" @click="goSignIn">签到</view> -->
</view>
<view class="order-wrapper">
<view class="order-hd flex">
<view class="left">订单中心</view>
<navigator class="right flex" hover-class="none" url="/pages/users/order_list/index"
open-type="navigate">
查看全部
<text class="iconfont icon-xiangyou"></text>
</navigator>
</view>
<view class="order-bd">
<block v-for="(item,index) in orderMenu" :key="index">
<navigator class="order-item" hover-class="none" :url="item.url">
<view class="pic">
<image :src="item.img" mode=""></image>
<text class="order-status-num" v-if="item.num > 0">{{ item.num }}</text>
<view class="num" v-if="userInfo && userInfo.phone && uid">
<view class="num-txt">{{userInfo.phone}}</view>
<view class="icon">
<image :src="urlDomain+'crmebimage/perset/staticImg/edit.png'" mode=""></image>
</view>
</view>
<view class="txt">{{item.title}}</view>
</navigator>
</block>
</view>
</view>
</view>
<view class="contenBox">
<!-- 轮播 -->
<view class="slider-wrapper" v-if="imgUrls.length>0">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
:duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(item,index) in imgUrls" :key="index">
<swiper-item class="borRadius14">
<image :src="item.pic" class="slide-image" @click="navito(item.url)"></image>
</swiper-item>
</block>
</swiper>
</view>
<!-- 会员菜单 -->
<view class="user-menus" style="margin-top: 20rpx;">
<view class="menu-title">我的服务</view>
<view class="list-box">
<block v-for="(item,index) in MyMenus" :key="index">
<navigator class="item" :url="item.url" hover-class="none"
v-if="!(item.url =='/pages/service/index' || (item.url =='/pages/users/user_spread_user/index' && !userInfo.isPromoter))">
<image :src="item.pic"></image>
<text>{{item.name}}</text>
</navigator>
</block>
<!-- #ifndef MP -->
<view class="item" @click="kefuClick">
<image :src="servicePic"></image>
<text>联系客服</text>
<view class="phone" v-if="!userInfo.phone && isLogin" @tap.stop="bindPhone">绑定手机号</view>
<!-- #ifdef APP-PLUS -->
<text class="iconfont icon-shezhi app_set" @click.stop="appUpdate()"></text>
<!-- #endif -->
</view>
</view>
<view class="num-wrapper">
<view class="num-item" @click="goMenuPage('/pages/users/user_money/index')">
<text class="num">{{userInfo.nowMoney && uid ? userInfo.nowMoney:0}}</text>
<view class="txt">余额</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_integral/index')">
<text class="num">{{userInfo.integral && uid ? userInfo.integral: 0}}</text>
<view class="txt">积分</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_coupon/index')">
<text class="num">{{userInfo.couponCount && uid ? userInfo.couponCount : 0}}</text>
<view class="txt">优惠券</view>
</view>
<view class="num-item" @click="goMenuPage('/pages/users/user_goods_collection/index')">
<text class="num">{{userInfo.collectCount && uid ? userInfo.collectCount : 0}}</text>
<view class="txt">收藏</view>
</view>
</view>
</view>
<view class="order-wrapper">
<view class="order-hd flex">
<view class="left">订单中心</view>
<view class="right flex" @click="menusTap('/pages/users/order_list/index')">查看全部
<text class="iconfont icon-xiangyou"></text>
</view>
</view>
<view class="order-bd">
<block v-for="(item,index) in orderMenu" :key="index">
<view class="order-item" @click="menusTap(item.url)">
<view class="pic">
<text class="iconfont pic_status" :class="item.img"></text>
<text class="order-status-num" v-if="item.num > 0">{{ item.num }}</text>
</view>
<view class="txt">{{item.title}}</view>
</view>
</block>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="item" open-type='contact' hover-class='none'>
<image :src="servicePic"></image>
<text>联系客服</text>
</button>
<!-- #endif -->
</view>
</view>
<image src="/static/images/support.png" alt="" class='support'>
<view class="uni-p-b-98"></view>
</view>
</scroll-view>
<view class="contenBox" id="pageIndex">
<!-- 轮播 -->
<view class="slider-wrapper" @click.native="bindEdit('userBanner')" v-if="imgUrls != null && imgUrls.length > 0">
<swiper v-if="imgUrls.length>0" indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
:duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(item,index) in imgUrls" :key="index">
<swiper-item class="borRadius14">
<image :src="item.pic" class="slide-image" @click="navito(item.url)"></image>
</swiper-item>
</block>
</swiper>
</view>
<!-- 会员菜单 -->
<view class="user-menus" style="margin-top: 20rpx;" @click.native="bindEdit('userMenus')">
<view class="menu-title">我的服务</view>
<view class="list-box">
<block v-for="(item,index) in MyMenus" :key="index">
<view class="item" @click="menusTap(item.url)"
v-if="!(item.url =='/pages/service/index' || (item.url =='/pages/promoter/user_spread_user/index' && !userInfo.isPromoter))">
<image :src="item.pic"></image>
<text>{{item.name}}</text>
</view>
</block>
<!-- #ifndef MP -->
<view class="item" @click="onClickService">
<image :src="servicePic"></image>
<text>联系客服</text>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<!-- v-if="chatConfig.telephone_service_switch" -->
<button class="item" hover-class='none' @click="onClickService" v-if="chatConfig.telephone_service_switch === 'open'">
<image :src="servicePic"></image>
<text>联系客服</text>
</button>
<template v-else>
<button class="item" open-type='contact' hover-class='none' v-if="chatConfig.wx_chant_independent==='open'">
<image :src="servicePic"></image>
<text>联系客服</text>
</button>
<button class="item" hover-class='none' @click="wxChatService" v-else>
<image :src="servicePic"></image>
<text>联系客服</text>
</button>
</template>
<!-- #endif -->
</view>
</view>
<image :src="copyImage" alt="" class='support'>
</view>
</scroll-view>
</view>
</view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<pageFooter></pageFooter>
</view>
</template>
<script>
let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import pageFooter from '@/components/pageFooter/index.vue'
import Cache from '@/utils/cache';
import {goPage} from '@/libs/iframe.js'
import {BACK_URL} from '@/config/cache';
import {getMenuList} from '@/api/user.js';
import {getMenuList, copyrightApi} from '@/api/user.js';
import {orderData} from '@/api/order.js';
import {getCity, tokenIsExistApi} from '@/api/api.js';
import {toLogin} from '@/libs/login.js';
import {getCity} from '@/api/api.js';
import {mapGetters} from "vuex";
import {
getCityList
} from "@/utils";
// #ifdef H5
import Auth from '@/libs/wechat';
// #endif
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import {getShare} from '@/api/public.js';
import {setThemeColor} from '@/utils/setTheme.js'
import animationType from '@/utils/animationType.js'
const app = getApp();
export default {
components: {
// #ifdef MP
authorize
// #endif
components:{
pageFooter
},
computed: mapGetters(['isLogin', 'chatUrl', 'userInfo', 'uid']),
computed: mapGetters(['isLogin', 'chatUrl', 'uid','bottomNavigationIsCustom']),
data() {
return {
orderMenu: [{
img: '/static/images/order1.png',
title: '待付款',
url: '/pages/users/order_list/index?status=0',
num: 0
},
{
img: '/static/images/order2.png',
title: '待发货',
url: '/pages/users/order_list/index?status=1',
num: 0
},
{
img: '/static/images/order3.png',
title: '待收货',
url: '/pages/users/order_list/index?status=2',
num: 0
},
{
img: '/static/images/order4.png',
title: '待评价',
url: '/pages/users/order_list/index?status=3',
num: 0
},
{
img: '/static/images/order5.png',
title: '售后/退款',
url: '/pages/users/user_return_list/index',
num: 0
},
urlDomain: this.$Cache.get("imgHost"),
orderMenu: [
{img: 'icon-daifukuan',title: '待付款',url: '/pages/users/order_list/index?status=0',num: 0},
{img: 'icon-daifahuo',title: '待发货',url: '/pages/users/order_list/index?status=1',num: 0},
{img: 'icon-daishouhuo',title: '待收货',url: '/pages/users/order_list/index?status=2',num: 0},
{img: 'icon-daipingjia',title: '待评价',url: '/pages/users/order_list/index?status=3',num: 0},
{img: 'icon-a-shouhoutuikuan',title: '售后/退款',url: '/pages/users/user_return_list/index',num: 0},
],
imgUrls: [],
userMenu: [],
@@ -189,62 +175,196 @@
orderStatusNum: {},
MyMenus: [],
wechatUrl: [],
servicePic: '/static/images/customer.png',
servicePic: `${this.$Cache.get("imgHost")}crmebimage/perset/staticImg/customer.png`,
sysHeight: sysHeight,
// #ifdef MP
pageHeight: '100%',
// #endif
// #ifdef H5
// #ifdef H5 || APP-PLUS
pageHeight: app.globalData.windowHeight,
// #endif
// #ifdef H5
isWeixin: Auth.isWeixin()
isWeixin: Auth.isWeixin(),
//#endif
configApi: {}, //分享类容配置
theme: '',
bgColor:'#e93323',
chatConfig:{
consumer_hotline:'',
telephone_service_switch:'close',
wx_chant_independent:'open'
} ,//客服配置
userInfo: {},
copyImage: '',//版权图片
}
},
onLoad() {
app.globalData.theme = this.$Cache.get('theme')
if(app.globalData.isIframe){
setTimeout(()=>{
let active;
document.getElementById('pageIndex').children.forEach(dom=>{
dom.addEventListener('click', (e)=>{
e.stopPropagation();
e.preventDefault();
if(dom === active) return;
dom.classList.add('borderShow');
active && active.classList.remove('borderShow');
active = dom;
})
})
});
}
let that = this;
// #ifdef H5
// #ifdef H5 || APP-PLUS
that.$set(that, 'pageHeight', app.globalData.windowHeight);
// #endif
that.$set(that, 'MyMenus', app.globalData.MyMenus);
if (!this.$Cache.has('cityList')) this.getCityList();
if (that.isLogin == false) {
// #ifdef H5
toLogin()
// #endif
}
that.$set(that,'chatConfig',Cache.getItem('chatConfig'));
// #ifdef H5
that.shareApi();
// #endif
that.bgColor = setThemeColor();
// #ifdef APP-PLUS
setTimeout(()=>{
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
},500)
// #endif
// #ifdef MP
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor:that.bgColor,
});
// #endif
},
onShow: function() {
let that = this;
this.getMyMenus();
this.getTokenIsExist();
this.copyrightImage();
this.theme = this.$Cache.get('theme')
app.globalData.theme = this.$Cache.get('theme')
if (!this.$Cache.getItem('cityList')) getCityList();
!this.$store.state.app.bottomNavigationIsCustom&&uni.showTabBar();
// #ifdef H5
let that = this;
uni.getSystemInfo({
success: function(res) {
that.pageHeight = res.windowHeight + 'px'
}
});
// #endif
if (that.isLogin) {
this.getMyMenus();
// this.setVisit();
this.getOrderData();
this.$store.dispatch('USERINFO');
} else {
toLogin();
}
// #ifdef MP
let query = uni.createSelectorQuery();
let dom = query.select('.new-users');
// #endif
},
methods: {
// 记录会员访问
// setVisit(){
// setVisit({
// url:'/pages/user/index'
// }).then(res=>{})
// },
navito(e) {
window.location.href = 'https://' + e;
//校验token是否有效,true为有效false为无效
getTokenIsExist() {
tokenIsExistApi().then(res => {
let tokenIsExist = res.data;
if (this.isLogin && tokenIsExist) {
this.getOrderData();
this.$store.dispatch('USERINFO').then(res => {
this.userInfo = res;
});
}else{
this.$store.commit("LOGOUT");
this.$store.commit('UPDATE_LOGIN', '');
this.$store.commit('UPDATE_USERINFO', {});
}
})
},
kefuClick() {
location.href = this.chatUrl;
//获取授权图片
copyrightImage() {
copyrightApi().then(res => {
if (res.data) {
this.copyImage = res.data.companyImage;
} else {
this.copyImage = `${this.urlDomain}crmebimage/perset/staticImg/support.png`;
}
}).catch(err => {
return this.$util.Tips({
title: err
})
});
},
bindEdit(name) {
if (app.globalData.isIframe) {
window.parent.postMessage(
{
name: name
},
'*'
);
return;
}
},
menusTap(url) {
if (!this.isLogin) {
this.openAuto();
}else{
goPage().then(res => {
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url: url
})
})
}
},
navito(url) {
if(url.indexOf("http") !== -1){
// #ifdef H5
location.href = url
// #endif
// #ifdef APP-PLUS || MP
uni.navigateTo({
url: '/pages/users/web_page/index?webUel=' + url
})
// #endif
}else{
if(['/pages/goods_cate/goods_cate','/pages/order_addcart/order_addcart','/pages/user/index'].indexOf(url) == -1){
uni.navigateTo({
url:url
})
}else{
uni.switchTab({
url:url
})
}
}
},
onClickService() {
if(this.chatConfig.telephone_service_switch === 'open'){
uni.makePhoneCall({
phoneNumber: this.chatConfig.consumer_hotline //仅为示例
});
}else{
// #ifdef APP-PLUS
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url: '/pages/users/web_page/index?webUel=' + this.chatUrl + '&title=客服'
})
// #endif
// #ifndef APP-PLUS
if (!app.globalData.isIframe) {
location.href = this.chatUrl;
}else{
return false
}
// #endif
}
},
wxChatService(){
let chatUrlArr = this.chatUrl.split('?')
uni.navigateTo({
url:`/pages/users/web_page/index?webUel=${chatUrlArr[0]}&title=客服&${chatUrlArr[1]}`
})
},
getOrderData() {
let that = this;
@@ -276,26 +396,11 @@
Cache.set(BACK_URL, '')
toLogin();
},
// 授权回调
onLoadFun() {
this.getMyMenus();
// this.setVisit();
this.getOrderData();
},
Setting: function() {
uni.openSetting({
success: function(res) {
console.log(res.authSetting)
}
});
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
// 绑定手机
bindPhone() {
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url: '/pages/users/app_login/index'
})
},
@@ -305,7 +410,7 @@
*/
getMyMenus: function() {
let that = this;
if (this.MyMenus.length) return;
// if (this.MyMenus.length) return;
getMenuList().then(res => {
that.$set(that, 'MyMenus', res.data.routine_my_menus);
that.wechatUrl = res.data.routine_my_menus.filter((item) => {
@@ -314,50 +419,65 @@
res.data.routine_my_menus.map((item) => {
if (item.url.indexOf('service') !== -1) that.servicePic = item.pic
})
// that.imgUrls = res.data.routine_my_banner
if(res.data.routine_my_banner){
that.imgUrls = res.data.routine_my_banner
}
}).catch(err=>{
console.log(err);
});
},
// 编辑页面
goEdit() {
if (this.isLogin == false) {
toLogin();
this.openAuto();
} else {
uni.navigateTo({
url: '/pages/users/user_info/index'
animationType: animationType.type,
animationDuration: animationType.duration,
url: '/pages/infos/user_info/index'
})
}
},
// 签到
goSignIn() {
uni.navigateTo({
url: '/pages/users/user_sgin/index'
})
},
// goMenuPage
goMenuPage(url) {
if (this.isLogin) {
uni.navigateTo({
animationType: animationType.type,
animationDuration: animationType.duration,
url
})
} else {
// #ifdef MP
this.openAuto()
// #endif
}
},
// 获取地址数据
getCityList: function() {
let that = this;
getCity().then(res => {
let oneDay = 24 * 3600 * 1000;
this.$Cache.setItem({
name: 'cityList',
value: res.data,
expires: oneDay * 7
}); //设置七天过期时间
appUpdate(){
uni.navigateTo({
url:'/pages/users/app_update/app_update',
animationType: animationType.type,
animationDuration: animationType.duration,
})
},
shareApi: function() {
getShare().then(res => {
this.$set(this, 'configApi', res.data);
// #ifdef H5
this.setOpenShare(res.data);
// #endif
})
},
// 微信分享;
setOpenShare: function(data) {
let that = this;
if (that.$wechat.isWeixin()) {
let configAppMessage = {
desc: data.synopsis,
title: data.title,
link: location.href,
imgUrl: data.img
};
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
configAppMessage);
}
}
}
}
@@ -368,19 +488,21 @@
body {
height: 100%;
}
.mp-header{
@include main_bg_color(theme);
}
.bg {
position: absolute;
left: 0;
top: 0;
width:100%;
height: 420rpx;
background-image: url('~@/static/images/user_bg.png');
background-image: url('../../static/images/user_bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
}
.contenBox {
padding: 0 30rpx;
padding: 0 30rpx 100rpx 30rpx;
}
.support {
@@ -391,7 +513,6 @@
}
.new-users {
//margin-top: var(--status-bar-height);
display: flex;
flex-direction: column;
height: 100%;
@@ -413,9 +534,7 @@
}
.head {
background: linear-gradient(360deg, rgba(255, 121, 49, 0) 0%, rgba(248, 74, 29, 0.82) 39%, #E93323 100%);
// padding: 0 30rpx;
@include index-gradient(theme);
.user-card {
position: relative;
width: 100%;
@@ -439,6 +558,7 @@
justify-content: space-between;
margin-left: 20rpx;
padding: 15rpx 0;
position: relative;
.name {
display: flex;
@@ -461,6 +581,13 @@
}
}
}
.app_set{
position: absolute;
font-size: 36rpx;
color: #fff;
top: 40rpx;
right: 20rpx;
}
.num {
display: flex;
@@ -647,19 +774,33 @@
.phone {
color: #fff;
}
.pic_status{
font-size: 43rpx;
@include main_color(theme);
}
.order-status-num {
min-width: 12rpx;
min-width: 13rpx;
background-color: #fff;
color: #ee5a52;
@include main_color(theme);
border-radius: 15px;
position: absolute;
right: -14rpx;
top: -15rpx;
font-size: 20rpx;
padding: 0 8rpx;
border: 1px solid #ee5a52;
@include coupons_border_color(theme);
}
}
</style>
.sub_btn{
width: 690rpx;
height: 86rpx;
line-height: 86rpx;
margin-top: 60rpx;
background: $theme-color;
border-radius: 43rpx;
color: #fff;
font-size: 28rpx;
text-align: center;
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,24 +1,37 @@
<template>
<view class="appBox">
<div class="shading">
<image :src="logoUrl" v-if="logoUrl" />
<image src="/static/images/logo2.png" v-else />
</div>
<mobileLogin :isUp="isUp" :isShow="isShow" :platform="platform" :isPos="isPos" :appleShow="appleShow" :authKey="authKey" @wechatPhone="wechatPhone"></mobileLogin>
<view class="wrapper" :data-theme="theme">
<view class="bag"></view>
<view class="system-height" :style="{height:statusBarHeight}"></view>
<!-- #ifdef MP -->
<view class="title-bar" style="height: 43px;">
<view class="icon" @click="back" v-if="!isHome">
<image class="img" :src="urlDomain+'crmebimage/perset/usersImg/left.png'"></image>
</view>
<view class="icon" @click="home" v-else>
<image class="img" :src="urlDomain+'crmebimage/perset/usersImg/home.png'"></image>
</view>
账户登录
</view>
<!-- #endif -->
<view class="appBox">
<view class="phone_name">绑定手机号</view>
<view class="phone_tips">登录注册需绑定手机号</view>
<mobileLogin :isUp="isUp" :isShow="isShow" :platform="platform" :isPos="isPos" :appleShow="appleShow"
:authKey="authKey" @wechatPhone="wechatPhone" :wxCode="wxCode"></mobileLogin>
</view>
</view>
</template>
<script>
const app = getApp();
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import sendVerifyCode from "@/mixins/SendVerifyCode";
import Routine from '@/libs/routine';
import {
loginMobile,
registerVerify,
getCodeApi,
getUserInfo,
phoneSilenceAuth,
phoneWxSilenceAuth
getUserInfo
} from "@/api/user";
import {
bindingPhone
@@ -27,10 +40,13 @@
getUserPhone
} from '@/api/public';
import mobileLogin from '@/components/login_mobile/index.vue'
export default {
name: 'login_mobile',
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
theme: app.globalData.theme,
options: '',
keyCode: '',
account: '',
@@ -41,8 +57,9 @@
isShow: false,
isPos: false,
platform: '', // 手机平台
appleShow: '' //是否是苹果登录
appleShow: '', //是否是苹果登录
statusBarHeight: statusBarHeight,
wxCode: '' //小程序code值
}
},
components: {
@@ -70,10 +87,21 @@
that.options = options
if (options.authKey) that.authKey = options.authKey
if (options.appleShow) that.appleShow = options.appleShow
if (options.code) that.wxCode = options.code
},
methods: {
// 返回
back() {
uni.navigateBack();
},
// 跳入首页
home() {
uni.switchTab({
url: '/pages/index/index'
})
},
wechatPhone() {
this.$Cache.clear('snsapiKey');
this.$Cache.clear('snsapiKey');
if (this.options.back_url) {
let url = uni.getStorageSync('snRouter');
url = url.indexOf('/pages/index/index') != -1 ? '/' : url;
@@ -129,28 +157,6 @@
close() {
this.$emit('close', false)
},
// #ifdef MP
phoneSilenceAuth(code) {
let self = this
phoneSilenceAuth({
code: code,
spid: app.globalData.spid,
spread: app.globalData.code,
phone: this.account,
captcha: this.codeNum
}).then(res => {
this.$store.commit('LOGIN', {
token: res.data.token
});
this.$store.commit("SETUID", res.data.uid);
this.getUserInfo();
}).catch(error => {
self.$util.Tips({
title: error
})
})
},
// #endif
/**
* 获取个人用户信息
*/
@@ -180,17 +186,76 @@
<style>
page {
background: #fff;
height: 100%;
}
</style>
<style lang="scss" scoped>
.wrapper {
background: #fff;
height: 100%;
position: relative;
.bag {
position: absolute;
top: 0;
left: 0;
width: 750rpx;
height: 460rpx;
@include logn-gradient(theme);
}
}
.title-bar {
position: relative;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
}
.icon {
position: absolute;
left: 30rpx;
top: 0;
display: flex;
align-items: center;
justify-content: center;
width: 86rpx;
height: 86rpx;
.img {
width: 50rpx;
height: 50rpx;
}
}
.phone {
&_name {
padding: 0 72rpx;
font-size: 48rpx;
font-weight: 500;
color: #333333;
line-height: 68rpx;
margin-bottom: 16rpx;
}
&_tips {
font-size: 28rpx;
font-weight: 400;
color: #333333;
line-height: 40rpx;
padding: 0 72rpx;
}
}
.appBox {
background-color: #fff;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
margin-top: 146rpx;
}
.shading {
@@ -263,4 +328,4 @@
text-align: center;
line-height: 90rpx;
}
</style>
</style>

View File

@@ -0,0 +1,126 @@
<template>
<view class="app_update">
<view class="logo_box">
<image :src="urlDomain+'crmebimage/perset/staticImg/crmeb_java.png'"></image>
<view class="title">crmeb</view>
<view class="version">Version {{appUpdate.versionCode}}</view>
</view>
<view class="jiancha" @click="appVersionConfig()">
<text>检查新版本</text>
<text class="iconfont icon-you"></text>
</view>
</view>
</template>
<script>
import {getAppVersion} from '@/api/api.js';
export default {
data() {
return {
urlDomain: this.$Cache.get("imgHost"),
appUpdate:{}
}
},
onLoad() {
let that = this;
plus.runtime.getProperty(plus.runtime.appid,function(inf){
that.$set(that.appUpdate,'versionCode',inf.version);
})
},
methods: {
appVersionConfig(){
var that = this;
//app升级
// 获取本地应用资源版本号
getAppVersion().then(res=>{
that.$set(that.appUpdate,'androidAddress',res.data.androidAddress);
that.$set(that.appUpdate,'appVersion',res.data.appVersion);
that.$set(that.appUpdate,'iosAddress',res.data.iosAddress);
that.$set(that.appUpdate,'openUpgrade',res.data.openUpgrade);
plus.runtime.getProperty(plus.runtime.appid,function(inf){
let nowVersion = (inf.version).split('.').join('');
let appVersion = (res.data.appVersion).split('.').join('');
uni.getSystemInfo({
success:(res) => {
if(appVersion > nowVersion){
uni.showModal({
title: '更新提示',
content: '发现新版本,是否前去下载?',
showCancel:that.appUpdate.openUpgrade == 'false' ? true : false,
cancelColor: '#eeeeee',
confirmColor: '#FF0000',
success(response) {
if (response.confirm) {
switch (res.platform){
case "android":
plus.runtime.openURL(that.appUpdate.androidAddress);
break;
case "ios":
plus.runtime.openURL(encodeURI(that.appUpdate.iosAddress));
break;
}
}
}
});
}else if(appVersion <= nowVersion){
uni.showToast({
title:'已是最新版本',
icon:'none'
})
}
}
})
});
})
},
}
}
</script>
<style>
.app_update{
background-color: #fff;
height: 100vh;
}
.logo_box{
height: 500rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.logo_box image{
display: block;
margin-top:80rpx;
width: 120rpx;
height: 120rpx;
border-radius: 50%;
}
.title{
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 600;
color: #333333;
margin: 20rpx auto 20rpx;
}
.version{
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.jiancha{
width: 690rpx;
margin: 20rpx auto 0;
padding: 0 20rpx 0;
height: 100rpx;
line-height: 100rpx;
color: #333333;
font-size: 30rpx;
border-top:1px solid #f5f5f5;
border-bottom:1px solid #f5f5f5;
display: flex;
justify-content: space-between;
}
</style>

View File

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
/**
* 此处可直接引用自己项目封装好的 axios 配合后端联调
*/
import request from '../utils/axios'; // 组件内部封装的axios
//import request from "@/api/axios.js" //调用项目封装的axios
/**
* 滑块验证
* @param {Object} data
*/
export function ajcaptchaCheck(data) {
return request.post("safety/check", data, {
noAuth: true
});
}
/**
* 滑块信息
* @param {Object} data
*/
export function getAjcaptcha(data) {
return request.post("safety/get", data, {
noAuth: true
});
}

View File

@@ -0,0 +1,70 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
HTTP_REQUEST_URL,
HEADER,
TOKENNAME,
HEADERPARAMS
} from '@/config/app';
import {
toLogin,
checkLogin
} from '@/libs/login';
import store from '@/store';
/**
* 发送请求
*/
function baseRequest(url, method, data, {
noAuth = false,
noVerify = false
}, params) {
let Url = HTTP_REQUEST_URL,
header = HEADER
// if (params != undefined) {
// header = HEADERPARAMS;
// }
if (!noAuth) {
//登录过期自动登录
if (!store.state.app.token && !checkLogin()) {
toLogin();
return Promise.reject({
msg: '未登录'
});
}
}
if (store.state.app.token) header[TOKENNAME] = store.state.app.token;
return new Promise((reslove, reject) => {
uni.request({
url: Url + '/api/public/' + url,
method: method || 'GET',
header: header,
data: data || {},
success: (res) => {
reslove(res.data, res);
},
fail: (msg) => {
reject('请求失败');
}
})
});
}
const request = {};
['options', 'get', 'post', 'put', 'head', 'delete', 'trace', 'connect'].forEach((method) => {
request[method] = (api, data, opt, params) => baseRequest(api, method, data, opt || {}, params)
});
export default request;

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -1,204 +0,0 @@
<template>
<view>
<form @submit="subRefund" report-submit='true'>
<view class='apply-return'>
<view class='goodsStyle acea-row row-between borRadius14' v-for="(item,index) in orderInfo.orderInfoList" :key="index">
<view class='pictrue'><image :src='item.image'></image></view>
<view class='text acea-row row-between'>
<view class='name line2'>{{item.storeName}}</view>
<view class='money'>
<view>{{item.price}}</view>
<view class='num'>x{{item.cartNum}}</view>
</view>
</view>
</view>
<view class='list borRadius14'>
<view class='item acea-row row-between-wrapper'>
<view>退货件数</view>
<view class='num'>{{orderInfo.totalNum}}</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view>退款金额</view>
<view class='num'>{{orderInfo.payPrice}}</view>
</view>
<view class='item acea-row row-between-wrapper' @tap="toggleTab('region')">
<view>退款原因</view>
<picker class='num' @change="bindPickerChange" :value="index" :range="RefundArray">
<view class="picker acea-row row-between-wrapper">
<view class='reason'>{{RefundArray[index]}}</view>
<text class='iconfont icon-jiantou'></text>
</view>
</picker>
</view>
<view class='item textarea acea-row row-between'>
<view>备注说明</view>
<textarea placeholder='填写备注信息100字以内' class='num' name="refund_reason_wap_explain" placeholder-class='填写备注信息100字以内'></textarea>
</view>
<view class='item acea-row row-between' style="border: none;">
<view class='title acea-row row-between-wrapper'>
<view>上传凭证</view>
<view class='tip'>( 最多可上传3张 )</view>
</view>
<view class='upload acea-row row-middle'>
<view class='pictrue' v-for="(item,index) in refund_reason_wap_imgPath" :key="index">
<image :src='item'></image>
<view class='iconfont icon-guanbi1 font-color' @tap='DelPic(index)'></view>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic' v-if="refund_reason_wap_imgPath.length < 3">
<text class='iconfont icon-icon25201'></text>
<view>上传凭证</view>
</view>
</view>
</view>
<button class='returnBnt bg-color' form-type="submit">申请退款</button>
</view>
</view>
</form>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view>
</template>
<script>
import { ordeRefundReason, orderRefundVerify, applyRefund} from '@/api/order.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
export default {
components: {
// #ifdef MP
authorize
// #endif
},
data() {
return {
refund_reason_wap_img:[],
refund_reason_wap_imgPath:[],
orderInfo:{},
RefundArray: [],
index: 0,
orderId:0,
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
};
},
computed: mapGetters(['isLogin']),
watch:{
isLogin:{
handler:function(newV,oldV){
if(newV){
this.getOrderInfo();
this.getRefundReason();
}
},
deep:true
}
},
onLoad: function (options) {
if (!options.orderId) return this.$util.Tips({title:'缺少订单id,无法退款'},{tab:3,url:1});
this.orderId = options.orderId;
if (this.isLogin) {
this.getOrderInfo();
this.getRefundReason();
} else {
toLogin();
}
},
methods: {
onLoadFun:function(){
this.getOrderInfo();
this.getRefundReason();
},
/**
* 获取订单详情
*
*/
getOrderInfo:function(){
let that=this;
applyRefund(that.orderId).then(res=>{
that.$set(that,'orderInfo',res.data);
});
},
/**
* 获取退款理由
*/
getRefundReason:function(){
let that=this;
ordeRefundReason().then(res=>{
that.$set(that,'RefundArray',res.data);
})
},
/**
* 删除图片
*
*/
DelPic:function(e){
let index = e, that = this;
that.refund_reason_wap_imgPath.splice(index, 1);
},
/**
* 上传文件
*
*/
uploadpic:function(){
let that=this;
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){
that.refund_reason_wap_imgPath.push(res.data.url);
});
},
/**
* 申请退货
*/
subRefund:function(e){
let that = this, value = e.detail.value;
//收集form表单
// if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
orderRefundVerify({
text: that.RefundArray[that.index] || '',
refund_reason_wap_explain: value.refund_reason_wap_explain,
refund_reason_wap_img: that.refund_reason_wap_imgPath.join(','),
uni: that.orderId
}).then(res=>{
return this.$util.Tips({ title: '申请成功', icon: 'success' }, { tab: 5, url: '/pages/users/user_return_list/index?isT=1' });
}).catch(err=>{
return this.$util.Tips({ title: err });
})
},
bindPickerChange: function (e) {
this.$set(this,'index',e.detail.value);
}
}
}
</script>
<style scoped lang="scss">
.apply-return{
padding: 20rpx 30rpx 70rpx 30rpx;
}
.apply-return .list{background-color:#fff;margin-top:18rpx;padding:0 24rpx 70rpx 24rpx;}
.apply-return .list .item{min-height:90rpx;border-bottom:1rpx solid #eee;font-size:30rpx;color:#333;}
.apply-return .list .item .num{color:#282828;width:427rpx;text-align:right;}
.apply-return .list .item .num .picker .reason{width:385rpx;}
.apply-return .list .item .num .picker .iconfont{color:#666;font-size:30rpx;margin-top:2rpx;}
.apply-return .list .item.textarea{padding:24rpx 0;}
.apply-return .list .item textarea{height:100rpx;font-size:30rpx;}
.apply-return .list .item .placeholder{color:#bbb;}
.apply-return .list .item .title{height:95rpx;width:100%;}
.apply-return .list .item .title .tip{font-size:30rpx;color:#bbb;}
.apply-return .list .item .upload{padding-bottom:36rpx;}
.apply-return .list .item .upload .pictrue{border-radius: 14rpx; margin:22rpx 23rpx 0 0;width:156rpx;height:156rpx;position:relative;font-size:24rpx;color:#bbb;}
.apply-return .list .item .upload .pictrue:nth-of-type(4n){margin-right:0;}
.apply-return .list .item .upload .pictrue image{width:100%;height:100%;border-radius:14rpx;}
.apply-return .list .item .upload .pictrue .icon-guanbi1{position:absolute;font-size:45rpx;top:-10rpx;right:-10rpx;}
.apply-return .list .item .upload .pictrue .icon-icon25201{color:#bfbfbf;font-size:50rpx;}
.apply-return .list .item .upload .pictrue:nth-last-child(1){border:1rpx solid #ddd;box-sizing:border-box;}
.apply-return .returnBnt{font-size:32rpx;color:#fff;width:100%;height:86rpx;border-radius:50rpx;text-align:center;line-height:86rpx;margin:43rpx auto;}
</style>

View File

@@ -1,23 +1,21 @@
<template>
<div class="login-wrapper">
<div class="login-wrapper" :data-theme="theme">
<div class="shading">
<!-- <image :src="logoUrl"/> -->
<image :src="logoUrl"/>
<!-- <image src="/static/images/logo2.png" v-if="!logoUrl" /> -->
<image :src="mobileLoginLogo"/>
</div>
<div class="whiteBg" v-if="formItem === 1">
<div class="list" v-if="current !== 1">
<form @submit.prevent="submit">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
<input type="text" class="texts" placeholder="输入手机号码" v-model="account" required/>
<image :src="urlDomain+'crmebimage/perset/staticImg/phone_1.png'" style="width: 24rpx; height: 34rpx;"></image>
<input type="number" class="texts" placeholder="输入手机号码" v-model="account" maxlength="11" required/>
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<input type="password" class="texts" placeholder="填写登录密码" v-model="password" required />
<image :src="urlDomain+'crmebimage/perset/staticImg/code_2.png'" style="width: 28rpx; height: 32rpx;"></image>
<input type="password" class="texts" placeholder="填写登录密码" maxlength="18" v-model="password" required />
</div>
</div>
</form>
@@ -25,40 +23,68 @@
<div class="list" v-if="current !== 0 || appLoginStatus || appleLoginStatus">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png" style="width: 24rpx; height: 34rpx;"></image>
<input type="text" class="texts" placeholder="输入手机号码" v-model="account" />
<image :src="urlDomain+'crmebimage/perset/staticImg/phone_1.png'" style="width: 24rpx; height: 34rpx;"></image>
<input type="number" class="texts" placeholder="输入手机号码" v-model="account" maxlength="11"/>
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
<image :src="urlDomain+'crmebimage/perset/staticImg/code_2.png'" style="width: 28rpx; height: 32rpx;"></image>
<input type="number" placeholder="填写验证码" class="codeIput" v-model="captcha" maxlength="6" />
<button class="code main_color" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
<div class="item" v-if="isShowCode">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png" style="width: 28rpx; height: 32rpx;"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
<image :src="urlDomain+'crmebimage/perset/staticImg/code_2.png'" style="width: 28rpx; height: 32rpx;"></image>
<input type="number" placeholder="填写验证码" class="codeIput" v-model="codeVal" maxlength="6"/>
<div class="code" @click="again"><img :src="codeUrl" /></div>
</div>
</div>
</div>
<div class="logon" @click="loginMobile" v-if="current !== 0">登录</div>
<div class="logon" @click="submit" v-if="current === 0">登录</div>
<div class="logon bg_color" @click="loginMobile" v-if="current !== 0">登录</div>
<div class="logon bg_color" @click="submit" v-if="current === 0">登录</div>
<!-- #ifndef APP-PLUS -->
<div class="tips">
<div v-if="current==0" @click="current = 1">快速登录</div>
<div v-if="current==1" @click="current = 0">账号登录</div>
</div>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<view class="appLogin" v-if="!appLoginStatus && !appleLoginStatus">
<view class="hds">
<span class="line"></span>
<p>其他方式登录</p>
<span class="line"></span>
</view>
<view class="btn-wrapper">
<view class="btn wx" @click="wxLogin">
<span class="iconfont icon-s-weixindenglu1"></span>
</view>
<view class="btn mima" v-if="current == 1" @click="current =0">
<span class="iconfont icon-s-mimadenglu1"></span>
</view>
<view class="btn yanzheng" v-if="current == 0" @click="current =1">
<span class="iconfont icon-s-yanzhengmadenglu1"></span>
</view>
<!-- <view class="btn apple-btn" @click="appleLogin" v-if="appleShow">
<view class="iconfont icon-s-pingguo"></view>
</view> -->
</view>
</view>
<!-- #endif -->
</div>
<div class="bottom"></div>
<Verify @success="handlerOnVerSuccess" :captchaType="'clickWord'" :imgSize="{ width: '330px', height: '155px' }"
ref="verify"></Verify>
</div>
</template>
<script>
import dayjs from "@/plugin/dayjs/dayjs.min.js";
import sendVerifyCode from "@/mixins/SendVerifyCode";
import Verify from '../components/verifition/verify.vue';
import {
loginH5,
loginMobile,
@@ -67,28 +93,27 @@
// getCodeApi,
getUserInfo
} from "@/api/user";
import attrs, {
required,
alpha_num,
chs_phone
} from "@/utils/validate";
let app = getApp();
import attrs, {required,alpha_num,chs_phone} from "@/utils/validate";
import {validatorDefaultCatch} from "@/utils/dialog";
import {appAuth} from "@/api/public";
import {VUE_APP_API_URL} from "@/utils";
import Routine from '@/libs/routine';
import {Debounce} from '@/utils/validate.js'
import {
validatorDefaultCatch
} from "@/utils/dialog";
import {
getLogo, appAuth, appleLogin
} from "@/api/public";
import {
VUE_APP_API_URL
} from "@/utils";
goToAgreement
} from "@/libs/order";
const BACK_URL = "login_back_url";
export default {
name: "Login",
mixins: [sendVerifyCode],
components: {
Verify,
},
data: function() {
return {
urlDomain: this.$Cache.get("imgHost"),
navList: ["快速登录", "账号登录"],
current: 1,
account: "",
@@ -96,7 +121,6 @@
captcha: "",
formItem: 1,
type: "login",
logoUrl: "",
keyCode: "",
codeUrl: "",
codeVal: "",
@@ -106,7 +130,9 @@
appUserInfo: null, // 微信登录保存的用户信息
appleLoginStatus: false, // 苹果登录强制绑定手机号码状态
appleUserInfo: null,
appleShow: false // 苹果登录版本必须要求ios13以上的
appleShow: false ,// 苹果登录版本必须要求ios13以上的
theme:app.globalData.theme,
mobileLoginLogo: app.globalData.mobileLoginLogo // 登录页logo
};
},
watch:{
@@ -119,92 +145,120 @@
}
},
mounted: function() {
this.getCode();
this.getLogoImage();
},
onLoad() {
let self = this
uni.getSystemInfo({
success: function(res) {
if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= 13) {
if (res.platform.toLowerCase() == 'ios' && res.system.split(' ')[1] >= '13') {
self.appleShow = true
}
}
});
},
methods: {
// 苹果登录
appleLogin() {
let self = this
this.account = ''
this.captcha = ''
uni.showLoading({
title: '登录中'
})
uni.login({
provider: 'apple',
timeout: 10000,
success(loginRes) {
uni.getUserInfo({
provider: 'apple',
success: function(infoRes) {
self.appleUserInfo = infoRes.userInfo
self.appleLoginApi()
},
fail() {
uni.hideLoading()
uni.showToast({
title: '获取用户信息失败',
icon: 'none',
duration: 2000
})
},
complete() {
uni.hideLoading()
}
//滑块验证成功后
handlerOnVerSuccess(data) {
this.$refs.verify.hide();
this.codeSend();
},
//发送验证码
codeSend() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
registerVerify(that.account)
.then(res => {
that.$util.Tips({
title: res.message
});
},
fail(error) {
uni.hideLoading()
console.log(error)
}
})
that.sendCode();
})
.catch(err => {
return that.$util.Tips({
title: err
});
});
},
userAgree(type) {
goToAgreement(type)
},
// 苹果登录
// appleLogin() {
// let self = this
// this.account = ''
// this.captcha = ''
// uni.showLoading({
// title: '登录中'
// })
// uni.login({
// provider: 'apple',
// timeout: 10000,
// success(loginRes) {
// uni.getUserInfo({
// provider: 'apple',
// success: function(infoRes) {
// self.appleUserInfo = infoRes.userInfo
// self.appleLoginApi()
// },
// fail() {
// uni.hideLoading()
// uni.showToast({
// title: '获取用户信息失败',
// icon: 'none',
// duration: 2000
// })
// },
// complete() {
// uni.hideLoading()
// }
// });
// },
// fail(error) {
// uni.hideLoading()
// console.log(error)
// }
// })
// },
// 苹果登录Api
appleLoginApi() {
let self = this
appleLogin({
openId: self.appleUserInfo.openId,
email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email,
identityToken: self.appleUserInfo.identityToken || ''
}).then((res) => {
this.$store.commit("LOGIN", {
'token': res.data.token
});
this.getUserInfo(res.data);
}).catch(error => {
uni.hideLoading();
uni.showModal({
title: '提示',
content: `错误信息${error}`,
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
})
},
// appleLoginApi() {
// let self = this
// appleLogin({
// openId: self.appleUserInfo.openId,
// email: self.appleUserInfo.email == undefined ? '' :self.appleUserInfo.email,
// identityToken: self.appleUserInfo.identityToken || ''
// }).then((res) => {
// this.$store.commit("LOGIN", {
// 'token': res.data.token
// });
// this.getUserInfo(res.data);
// }).catch(error => {
// uni.hideLoading();
// uni.showModal({
// title: '提示',
// content: `错误信息${error}`,
// success: function(res) {
// if (res.confirm) {
// console.log('用户点击确定');
// } else if (res.cancel) {
// console.log('用户点击取消');
// }
// }
// });
// })
// },
// App微信登录
wxLogin() {
wxLogin:Debounce(function() {
let self = this
this.account = ''
this.captcha = ''
uni.showLoading({
title: '登录中'
})
})
uni.login({
provider: 'weixin',
success: function(loginRes) {
@@ -216,7 +270,7 @@
self.appUserInfo = infoRes.userInfo
self.appUserInfo.type = self.platform === 'ios' ? 'iosWx' : 'androidWx'
self.wxLoginGo(self.appUserInfo)
},
},
fail() {
uni.hideLoading();
uni.showToast({
@@ -239,7 +293,7 @@
})
}
});
},
}),
wxLoginGo(userInfo) {
appAuth(userInfo).then(res => {
if (res.data.type === 'register') {
@@ -254,9 +308,9 @@
this.getUserInfo(res.data);
}
}).catch(res => {
that.$util.Tips({
title: res
});
this.$util.Tips({
title: res
});
});
},
again() {
@@ -267,16 +321,8 @@
this.keyCode +
Date.parse(new Date());
},
getCode() {
let that = this
},
async getLogoImage() {
let that = this;
getLogo().then(res => {
that.logoUrl = res.data.logoUrl?res.data.logoUrl:'/static/images/logo2.png';
});
},
async loginMobile() {
//手机号验证码登录
loginMobile:Debounce(function() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
@@ -290,10 +336,14 @@
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码'
});
uni.showLoading({
title: '登录中'
})
loginMobile({
phone: that.account,
captcha: that.captcha,
spread_spid: that.$Cache.get("spread")
// spread_spid: uni.getStorageSync('spid')
})
.then(res => {
let data = res.data;
@@ -301,14 +351,16 @@
this.$store.commit("LOGIN", {
'token': res.data.token
});
uni.hideLoading();
that.getUserInfo(data);
})
.catch(res => {
uni.hideLoading();
that.$util.Tips({
title: res
});
});
},
}),
async register() {
let that = this;
if (!that.account) return that.$util.Tips({
@@ -333,7 +385,8 @@
account: that.account,
captcha: that.captcha,
password: that.password,
spread: that.$Cache.get("spread")
spread_spid: that.$Cache.get("spread")
// spread_spid: uni.getStorageSync('spid') || 0
})
.then(res => {
that.$util.Tips({
@@ -356,21 +409,13 @@
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = "register";
await registerVerify(that.account)
.then(res => {
that.$util.Tips({title:res.message});
that.sendCode();
})
.catch(err => {
return that.$util.Tips({
title: err
});
});
that.$refs.verify.show();
},
navTap: function(index) {
this.current = index;
},
async submit() {
//账号密码登录
submit:Debounce(function() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写账号'
@@ -381,48 +426,40 @@
if (!that.password) return that.$util.Tips({
title: '请填写密码'
});
uni.showLoading({
title: '登录中'
})
loginH5({
account: that.account,
password: that.password,
spread: that.$Cache.get("spread")
})
.then(({
data
}) => {
spread_spid: that.$Cache.get("spread")
}).then(({data}) => {
this.$store.commit("LOGIN", {
'token': data.token
});
uni.hideLoading();
that.getUserInfo(data);
})
.catch(e => {
uni.hideLoading();
that.$util.Tips({
title: e
});
});
},
}),
getUserInfo(data){
this.$store.commit("SETUID", data.uid);
this.$store.commit("SETUID", data.uid);
getUserInfo().then(res => {
this.$store.commit("UPDATE_USERINFO", res.data);
let backUrl = this.$Cache.get(BACK_URL) || "/pages/index/index";
if (backUrl.indexOf('/pages/users/login/index') !== -1) {
if (backUrl.indexOf('/pages/users/login/index') !== -1) {
backUrl = '/pages/index/index';
}
// #ifdef APP
uni.reLaunch({
url: "/pages/index/index"
});
return
// #endif
console.log(69999);
console.log(backUrl);
uni.reLaunch({
url: backUrl
});
})
}
},
}
};
</script>
@@ -502,6 +539,12 @@
}
}
.main_color{
@include main_color(theme);
}
.bg_color{
@include main_bg_color(theme);
}
.code img {
width: 100%;
height: 100%;
@@ -605,4 +648,13 @@
}
}
}
.protocol {
margin: 30rpx 0;
padding-left: 44rpx;
.protocol_text {
.font_pro {
@include main_color(theme);
}
}
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<view>
<view :data-theme="theme">
<view class='my-order'>
<view class='header bg-color'>
<view class='picTxt acea-row row-between-wrapper'>
@@ -40,18 +40,9 @@
<view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle">
<text class="sign cart-color acea-row row-center-wrapper" v-if="item.activityType !== '普通' && item.activityType !== '核销'">{{item.activityType}}</text>
<!-- <text class="sign cart-color acea-row row-center-wrapper" v-if="item.bargainId != 0">砍价</text>
<text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.combinationId != 0">拼团</text>
<text class="sign cart-color acea-row row-center-wrapper" v-else-if="item.storeOrder.seckillId != 0">秒杀</text> -->
<view>{{item.createTime}}</view>
</view>
<view class='font-color'>{{item.orderStatus}}</view>
<!-- <view v-if="item.status?item.status.type == 0:0" class='font-color'>待付款</view>
<view v-else-if="item.status?item.status.type == 1:0 && item.storeOrder.shippingType==1" class='font-color'>待发货</view>
<view v-else-if="item.status?item.status.type == 2:0 && item.storeOrder.shippingType==1" class='font-color'>待收货</view>
<view v-else-if="item.status?item.status.type == 3:0 && item.storeOrder.shippingType==1" class='font-color'>待评价</view>
<view v-else-if="item.status?item.status.type == 4:0 && item.storeOrder.shippingType==1" class='font-color'>已完成</view>
<view v-else-if="item.storeOrder.shippingType==2" class='font-color'>待核销</view> -->
</view>
<view class='item-info acea-row row-between row-top' v-for="(items,index) in item.orderInfoList" :key="index">
<view class='pictrue'>
@@ -76,16 +67,6 @@
<view class='bnt bg-color' v-else-if="item.status==2" @click='goOrderDetails(item.orderId)'>去评价</view>
<view class='bnt cancelBnt' v-if="item.status == 3" @click='delOrder(item.id,index)'>删除订单</view>
</view>
<!-- <view class='bottom acea-row row-right row-middle'>
<view class='bnt cancelBnt' v-if="item.status?item.status.type==0:0 || item.status?item.status.type == 9:0" @click='cancelOrder(index,item.id)'>取消订单</view>
<view class='bnt bg-color' v-if="item.status?item.status.type == 0:0" @click='goPay(item.payPrice,item.orderId)'>立即付款</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 1:0 || item.status?item.status.type == 9:0" @click='goOrderDetails(item.orderId)'>查看详情</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 2:0 && item.status.deliveryType" @click='goOrderDetails(item.orderId)'>查看详情</view>
<view class='bnt bg-color' v-else-if="item.status?item.status.type == 3:0" @click='goOrderDetails(item.orderId)'>去评价</view>
<view class='bnt bg-color' v-else-if="item.storeOrder.seckillId < 1 && item.storeOrder.bargainId < 1 && item.storeOrder.combinationId < 1 && item.status?item.status.type == 4:0"
@click='goOrderDetails(item.orderId)'>再次购买</view>
<view class='bnt cancelBnt' v-if="item.status?item.status.type == 4:0" @click='delOrder(item.id,index)'>删除订单</view>
</view> -->
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="orderList.length>0">
@@ -126,18 +107,13 @@
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue'
let app = getApp();
export default {
components: {
payment,
home,
emptyPage,
// #ifdef MP
authorize
// #endif
},
data() {
return {
@@ -162,12 +138,13 @@
title: '可用余额:',
number: 0
}
],
],
pay_close: false,
pay_order_id: '',
totalPrice: '0',
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
isShowAuth: false ,//是否隐藏授权
theme:app.globalData.theme,
};
},
computed: mapGetters(['isLogin', 'userInfo']),
@@ -297,7 +274,7 @@
openOrderSubscribe().then(() => {
uni.hideLoading();
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id
url: '/pages/order/order_details/index?order_id=' + order_id
})
}).catch(() => {
uni.hideLoading();
@@ -305,7 +282,7 @@
// #endif
// #ifndef MP
uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id
url: '/pages/order/order_details/index?order_id=' + order_id
})
// #endif
},
@@ -458,9 +435,11 @@
.my-order .list .item .title .sign {
font-size: 24rpx;
padding: 0 13rpx;
height: 36rpx;
height: 40rpx;
margin-right: 15rpx;
border-radius: 18rpx;
@include coupons_border_color(theme);
@include main_color(theme);
}
.my-order .list .item .item-info {
@@ -547,4 +526,7 @@
width: 100%;
height: 100%;
}
// .bg-color {
// @include main_bg_color(theme);
// }
</style>

View File

@@ -1,43 +0,0 @@
<template>
<view class="content">
<jyf-parser :html="content" ref="article" :tag-style="tagStyle"></jyf-parser>
</view>
</template>
<script>
import parser from "@/components/jyf-parser/jyf-parser";
import {
getUserAgreement,
} from '@/api/user.js';
export default {
components: {
"jyf-parser": parser
},
data() {
return {
tagStyle: {
img: 'width:100%;display:block;',
table: 'width:100%',
video: 'width:100%'
},
content: ``
}
},
mounted() {
getUserAgreement().then(res => {
this.content = res.data.content
}).catch(err => {
that.$util.Tips({
title: err.msg
});
})
}
}
</script>
<style scoped>
.content {
padding: 40rpx 30rpx;
line-height: 2;
}
</style>

View File

@@ -1,161 +0,0 @@
<template>
<div class="register absolute">
<div class="shading">
<div class="pictrue acea-row row-center-wrapper">
<image src="../../../static/images/logo2.png" />
</div>
</div>
<div class="whiteBg">
<div class="title">找回密码</div>
<div class="list">
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/phone_1.png"></image>
<input type="text" placeholder="输入手机号码" v-model="account" />
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
{{ text }}
</button>
</div>
</div>
<div class="item">
<div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image>
<input type="password" placeholder="填写您的新密码" v-model="password" />
</div>
</div>
<div class="item" v-if="isShowCode">
<div class="align-left">
<input type="text" placeholder="填写验证码" class="codeIput" v-model="codeVal" />
<div class="code" @click="again"><img :src="codeUrl" /></div>
</div>
</div>
</div>
<div class="logon" @click="registerReset">确认</div>
<div class="tip">
<span class="font-color-red" @click="back">立即登录</span>
</div>
</div>
<div class="bottom"></div>
</div>
</template>
<script>
import sendVerifyCode from "@/mixins/SendVerifyCode";
import {
registerVerify,
registerReset,
getCodeApi
} from "@/api/user";
// import { validatorDefaultCatch } from "@/utils/dialog";
// import attrs, { required, alpha_num, chs_phone } from "@utils/validate";
// import { VUE_APP_API_URL } from "@utils";
export default {
name: "RetrievePassword",
data: function() {
return {
account: "",
password: "",
captcha: "",
keyCode: "",
codeUrl: "",
codeVal: "",
isShowCode: false
};
},
mixins: [sendVerifyCode],
mounted: function() {
this.getCode();
},
methods: {
back() {
uni.navigateBack();
},
again() {
this.codeUrl =
VUE_APP_API_URL + "/captcha?" + this.keyCode + Date.parse(new Date());
},
getCode() {
getCodeApi()
.then(res => {
this.keyCode = res.data.key;
})
.catch(res => {
this.$dialog.error(res.msg);
});
},
async registerReset() {
var that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!that.captcha) return that.$util.Tips({
title: '请填写验证码'
});
registerReset({
account: that.account,
captcha: that.captcha,
password: that.password,
code: that.codeVal
})
.then(res => {
that.$util.Tips({
title: res.message
}, {
tab: 3
})
})
.catch(res => {
that.$util.Tips({
title: res
})
});
},
async code() {
let that = this;
if (!that.account) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (that.formItem == 2) that.type = "register";
await registerVerify({
phone: that.account,
type: that.type,
key: that.keyCode,
code: that.codeVal
})
.then(res => {
that.$dialog.success(res.message);
that.sendCode();
})
.catch(res => {
// if (res.data.status === 402) {
// that.codeUrl = `${VUE_APP_API_URL}/sms_captcha?key=${that.keyCode}`;
// that.isShowCode = true;
// }
that.$util.Tips({
title: res
});
});
},
}
};
</script>
<style scoped>
.code img {
width: 100%;
height: 100%;
}
</style>

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

Some files were not shown because too many files have changed in this diff Show More