Merge branch 'dev' into pre-release

This commit is contained in:
luofei 2024-05-14 15:46:27 +08:00
commit a6c5bde685
37 changed files with 11129 additions and 9361 deletions

46
App.vue
View File

@ -30,6 +30,7 @@
data() { data() {
return { return {
audioTeam: [], audioTeam: [],
timer: null
} }
}, },
globalData: { globalData: {
@ -108,22 +109,6 @@
// console.log("jpush", connectEnable) // console.log("jpush", connectEnable)
}) })
//
// jpushModule.setAlias({
// 'alias': uni.getStorageSync('userId'),
// 'sequence': 1
// })
//
// jpushModule.addTagAliasListener(result => {
// let code = result.code
// let sequence = result.sequence
// let tags = result.tags
// let tag = result.tag
// let tagEnable = result.tagEnable
// let alias = result.alias
// console.log(alias, '')
// })
// //
jpushModule.addNotificationListener(result => { jpushModule.addNotificationListener(result => {
let notificationEventType = result.notificationEventType let notificationEventType = result.notificationEventType
@ -132,8 +117,6 @@
let content = result.content let content = result.content
let extras = result.extras let extras = result.extras
console.log("通知", result)
if (result.extras.type == 'ORDER_CREATE' && result.extras.mp3.length > 0) { if (result.extras.type == 'ORDER_CREATE' && result.extras.mp3.length > 0) {
if (result.extras.mp3[0] == '微信') this.audioTeam.push('/static/audio/wechat.MP3') if (result.extras.mp3[0] == '微信') this.audioTeam.push('/static/audio/wechat.MP3')
if (result.extras.mp3[0] == '支付宝') this.audioTeam.push('/static/audio/pay.MP3') if (result.extras.mp3[0] == '支付宝') this.audioTeam.push('/static/audio/pay.MP3')
@ -287,37 +270,24 @@
methods: { methods: {
// //
checknetwork() { checknetwork() {
uni.onNetworkStatusChange(function(res) { uni.onNetworkStatusChange(function(res) {
if (res.isConnected) { if (res.isConnected) {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}) })
} else { } else {
let that = this;
uni.showModal({ uni.showModal({
title: '系统提示', title: '系统提示',
content: '当前设备无网络或网络较差', content: '当前设备无网络或网络较差',
cancelText: '取消', cancelText: '取消',
confirmText: '确定', confirmText: '确定',
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
that.timer = null;
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/index/index'
}) })
} else { } else {
// #ifdef H5 // #ifdef H5
@ -325,25 +295,17 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/login/login_copy' url: '/pages/users/login/login_copy'
}) })
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
that.timer = null;
plus.runtime.quit() plus.runtime.quit()
// #endif // #endif
} }
} }
}) })
} }
}) })
}, },
/** /**
* 语音播报 * 语音播报

View File

@ -9,6 +9,14 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import request from "@/utils/request.js"; import request from "@/utils/request.js";
/**
* 退款订单
* @param numType
*/
export function refundListNew(data) {
return request.get("refund/list", data);
}
/** /**
* 校验支付密码是否正确 * 校验支付密码是否正确
* @param numType * @param numType

View File

@ -300,6 +300,19 @@ export function getStoreCategory(id, data) {
noAuth: true noAuth: true
}); });
} }
/**
* 新获取商品分类
* @param {Object} id 商铺 id
* @param {Object} data
*/
export function getProductCategoryList(data) {
return request.get("store/product/category/index", data, {
noAuth: true
});
}
/** /**
* 关注商铺 * 关注商铺
* @param {Object} type_id 商铺 id * @param {Object} type_id 商铺 id

View File

@ -1,9 +1,11 @@
<template> <template>
<view :style="viewColor"> <view :style="viewColor">
<view class="product-window" :class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'product-window')"> <view class="product-window"
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'product-window')">
<view class="textpic acea-row row-between-wrapper"> <view class="textpic acea-row row-between-wrapper">
<view class="pictrue"> <view class="pictrue">
<image :src="(attr.productSelect&&attr.productSelect.image) ? attr.productSelect.image : ''" @click="loookImg"></image> <image :src="(attr.productSelect&&attr.productSelect.image) ? attr.productSelect.image : ''"
@click="loookImg"></image>
</view> </view>
<view class="text"> <view class="text">
<view class="line1"> <view class="line1">
@ -13,7 +15,8 @@
<view> <view>
预售价 预售价
<text class="num">{{ attr.productSelect.price }}</text> <text class="num">{{ attr.productSelect.price }}</text>
<text v-if="presell_type === 2">定金¥<text class="num">{{ attr.productSelect.down_price }}</text></text> <text v-if="presell_type === 2">定金<text
class="num">{{ attr.productSelect.down_price }}</text></text>
</view> </view>
<text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text> <text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text> <text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
@ -22,11 +25,12 @@
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<text></text><text class="num">{{ attr.productSelect.price }}</text> <text></text><text class="num">{{ attr.productSelect.price }}</text>
<view v-if="attr.productSelect && attr.productSelect.svip_price" class="acea-row row-middle"> <view v-if="attr.productSelect && attr.productSelect.svip_price"
<text class='vip-money'>{{attr.productSelect.svip_price}}</text> class="acea-row row-middle">
<!-- <text class='vip-money'>{{attr.productSelect.svip_price}}</text>
<view class="vipImg"> <view class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image> <image :src="`${domain}/static/images/svip.png`"></image>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
@ -42,8 +46,8 @@
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw"> <view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
<view class="title">{{ item.attr_name }}</view> <view class="title">{{ item.attr_name }}</view>
<view class="listn acea-row row-middle"> <view class="listn acea-row row-middle">
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''" v-for="(itemn, indexn) in item.attr_value" <view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
@click="tapAttr(indexw, indexn)" :key="indexn"> v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)" :key="indexn">
{{ itemn.attr }} {{ itemn.attr }}
</view> </view>
</view> </view>
@ -67,8 +71,12 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { mapGetters } from "vuex"; import {
import { HTTP_REQUEST_URL } from '@/config/app'; mapGetters
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default { export default {
computed: mapGetters(['viewColor']), computed: mapGetters(['viewColor']),
props: { props: {
@ -114,11 +122,10 @@
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
} }
}, },
mounted(){ mounted() {},
},
methods: { methods: {
// //
loookImg(){ loookImg() {
let self = this let self = this
let arr = [self.attr.productSelect.image ? self.attr.productSelect.image : self.image] let arr = [self.attr.productSelect.image ? self.attr.productSelect.image : self.image]
uni.previewImage({ uni.previewImage({
@ -172,72 +179,89 @@
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); /// IOS>11.2/ padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0);
transition: all .3s cubic-bezier(.25, .5, .5, .9); transition: all .3s cubic-bezier(.25, .5, .5, .9);
&.presell-window { &.presell-window {
padding-bottom: 200rpx; padding-bottom: 200rpx;
} }
} }
.product-window.on { .product-window.on {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
.product-window.join { .product-window.join {
padding-bottom: 30rpx; padding-bottom: 30rpx;
} }
.product-window .textpic { .product-window .textpic {
padding: 0 80rpx 0 30rpx; padding: 0 80rpx 0 30rpx;
margin-top: 29rpx; margin-top: 29rpx;
position: relative; position: relative;
} }
.product-window .textpic .pictrue { .product-window .textpic .pictrue {
width: 150rpx; width: 150rpx;
height: 150rpx; height: 150rpx;
} }
.product-window .textpic .pictrue image { .product-window .textpic .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10rpx; border-radius: 10rpx;
} }
.product-window .textpic .text { .product-window .textpic .text {
width: 460rpx; width: 460rpx;
font-size: 32rpx; font-size: 32rpx;
color: #202020; color: #202020;
} }
.product-window .textpic .text .money { .product-window .textpic .text .money {
font-size: 24rpx; font-size: 24rpx;
margin-top: 40rpx; margin-top: 40rpx;
color: var(--view-priceColor); color: var(--view-priceColor);
} }
.product-window .textpic .text .money .num { .product-window .textpic .text .money .num {
font-size: 36rpx; font-size: 36rpx;
} }
.product-window .textpic .text .money .stock { .product-window .textpic .text .money .stock {
color: #999; color: #999;
margin-left: 18rpx; margin-left: 18rpx;
} }
.vip-money { .vip-money {
color: #282828; color: #282828;
font-size: 22rpx; font-size: 22rpx;
margin-left: 6rpx; margin-left: 6rpx;
} }
.vipImg { .vipImg {
width: 65rpx; width: 65rpx;
height: 28rpx; height: 28rpx;
margin-left: 4rpx; margin-left: 4rpx;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
} }
} }
.product-window .textpic .text .presell_price { .product-window .textpic .text .presell_price {
color: #FF7F00; color: #FF7F00;
.num { .num {
display: inline-block; display: inline-block;
margin-right: 20rpx; margin-right: 20rpx;
} }
.stock { .stock {
margin-left: 0; margin-left: 0;
} }
} }
.product-window .textpic .iconfont { .product-window .textpic .iconfont {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
@ -245,22 +269,27 @@
font-size: 35rpx; font-size: 35rpx;
color: #8a8a8a; color: #8a8a8a;
} }
.product-window .productWinList { .product-window .productWinList {
max-height: 395rpx; max-height: 395rpx;
overflow: auto; overflow: auto;
margin-top: 36rpx; margin-top: 36rpx;
} }
.product-window .productWinList .item~.item { .product-window .productWinList .item~.item {
margin-top: 36rpx; margin-top: 36rpx;
} }
.product-window .productWinList .item .title { .product-window .productWinList .item .title {
font-size: 30rpx; font-size: 30rpx;
color: #999; color: #999;
padding: 0 30rpx; padding: 0 30rpx;
} }
.product-window .productWinList .item .listn { .product-window .productWinList .item .listn {
padding: 0 30rpx 0 16rpx; padding: 0 30rpx 0 16rpx;
} }
.product-window .productWinList .item .listn .itemn { .product-window .productWinList .item .listn .itemn {
border: 1px solid #bbb; border: 1px solid #bbb;
font-size: 26rpx; font-size: 26rpx;
@ -269,11 +298,13 @@
border-radius: 6rpx; border-radius: 6rpx;
margin: 14rpx 0 0 14rpx; margin: 14rpx 0 0 14rpx;
} }
.product-window .productWinList .item .listn .itemn.on { .product-window .productWinList .item .listn .itemn.on {
color: #fff; color: #fff;
background-color: var(--view-theme); background-color: var(--view-theme);
border-color: var(--view-theme); border-color: var(--view-theme);
} }
.product-window .cart { .product-window .cart {
margin-top: 36rpx; margin-top: 36rpx;
padding: 0 30rpx; padding: 0 30rpx;
@ -286,14 +317,17 @@
-ms-flex-pack: justify; -ms-flex-pack: justify;
justify-content: space-between; justify-content: space-between;
} }
.product-window .cart .title { .product-window .cart .title {
font-size: 30rpx; font-size: 30rpx;
color: #999; color: #999;
line-height: 54rpx; line-height: 54rpx;
} }
.product-window .cart .carnum { .product-window .cart .carnum {
height: 54rpx; height: 54rpx;
} }
.product-window .cart .carnum view { .product-window .cart .carnum view {
border: 1px solid #a4a4a4; border: 1px solid #a4a4a4;
width: 84rpx; width: 84rpx;
@ -303,28 +337,34 @@
color: #a4a4a4; color: #a4a4a4;
font-size: 45rpx; font-size: 45rpx;
} }
.product-window .cart .carnum .reduce { .product-window .cart .carnum .reduce {
border-right: 0; border-right: 0;
border-radius: 6rpx 0 0 6rpx; border-radius: 6rpx 0 0 6rpx;
line-height: 48rpx; line-height: 48rpx;
} }
.product-window .cart .carnum .reduce.on { .product-window .cart .carnum .reduce.on {
border-color: #e3e3e3; border-color: #e3e3e3;
color: #dedede; color: #dedede;
} }
.product-window .cart .carnum .plus { .product-window .cart .carnum .plus {
border-left: 0; border-left: 0;
border-radius: 0 6rpx 6rpx 0; border-radius: 0 6rpx 6rpx 0;
line-height: 46rpx; line-height: 46rpx;
} }
.product-window .cart .carnum .plus.on { .product-window .cart .carnum .plus.on {
border-color: #e3e3e3; border-color: #e3e3e3;
color: #dedede; color: #dedede;
} }
.product-window .cart .carnum .num { .product-window .cart .carnum .num {
color: #282828; color: #282828;
font-size: 28rpx; font-size: 28rpx;
} }
.product-window .joinBnt { .product-window .joinBnt {
font-size: 30rpx; font-size: 30rpx;
width: 620rpx; width: 620rpx;
@ -334,10 +374,12 @@
line-height: 86rpx; line-height: 86rpx;
color: #fff; color: #fff;
margin: 100rpx auto 0 auto; margin: 100rpx auto 0 auto;
&.b-color{
&.b-color {
background-color: var(--view-theme); background-color: var(--view-theme);
} }
} }
.product-window .joinBnt.on { .product-window .joinBnt.on {
background-color: #bbb; background-color: #bbb;
color: #fff; color: #fff;

View File

@ -3,12 +3,15 @@
<view class="address-window" :class="address.address==true?'on':''"> <view class="address-window" :class="address.address==true?'on':''">
<view class='title'>选择地址<text class='iconfont icon-guanbi' @tap='close'></text></view> <view class='title'>选择地址<text class='iconfont icon-guanbi' @tap='close'></text></view>
<scroll-view scroll-y="true" class='list'> <scroll-view scroll-y="true" class='list'>
<view class='item acea-row row-between-wrapper' :class='active==index?"t-color":""' v-for="(item,index) in addressList" <view class='item acea-row row-between-wrapper' :class='active==index?"t-color":""'
@tap='tapAddress(index,item.address_id)' :key='index'> v-for="(item,index) in addressList" @tap='tapAddress(index,item.address_id)' :key='index'>
<text class='iconfont icon-ditu' :class='active==index?"t-color":""'></text> <text class='iconfont icon-ditu' :class='active==index?"t-color":""'></text>
<view class='address'> <view class='address'>
<view class='name' :class='active==index?"t-color":""'>{{item.real_name}}<text class='phone'>{{item.phone}}</text></view> <view class='name' :class='active==index?"t-color":""'>{{item.real_name}}<text
<view class='line1'>{{item.province}}{{item.city}}{{item.district}}{{item.street || ''}}{{item.detail}}</view> class='phone'>{{item.phone}}</text></view>
<view class='line1'>
{{item.province}}{{item.city}}{{item.district}}{{item.street || ''}}{{item.detail}}
</view>
</view> </view>
<text class='iconfont icon-complete' :class='active==index?"t-color":""'></text> <text class='iconfont icon-complete' :class='active==index?"t-color":""'></text>
</view> </view>
@ -34,9 +37,15 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { getAddressList } from '@/api/user.js'; import {
import { mapGetters } from "vuex"; getAddressList
import { HTTP_REQUEST_URL } from '@/config/app'; } from '@/api/user.js';
import {
mapGetters
} from "vuex";
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default { export default {
props: { props: {
pagesUrl: { pagesUrl: {
@ -87,7 +96,7 @@
let that = this; let that = this;
getAddressList({ getAddressList({
page: 1, page: 1,
limit: 5 limit: 100
}).then(res => { }).then(res => {
let addressList = res.data.list; let addressList = res.data.list;
// //
@ -114,9 +123,11 @@
transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0);
transition: all .3s cubic-bezier(.25, .5, .5, .9); transition: all .3s cubic-bezier(.25, .5, .5, .9);
} }
.address-window.on { .address-window.on {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
.address-window .title { .address-window .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
@ -125,15 +136,18 @@
line-height: 123rpx; line-height: 123rpx;
position: relative; position: relative;
} }
.address-window .title .iconfont { .address-window .title .iconfont {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
color: #8a8a8a; color: #8a8a8a;
font-size: 35rpx; font-size: 35rpx;
} }
.address-window .list{
.address-window .list {
max-height: 650rpx; max-height: 650rpx;
} }
.address-window .list .item { .address-window .list .item {
margin-left: 30rpx; margin-left: 30rpx;
padding-right: 30rpx; padding-right: 30rpx;
@ -142,26 +156,32 @@
font-size: 25rpx; font-size: 25rpx;
color: #333; color: #333;
} }
.address-window .list .item .iconfont { .address-window .list .item .iconfont {
font-size: 37rpx; font-size: 37rpx;
color: #2c2c2c; color: #2c2c2c;
} }
.address-window .list .item .iconfont.icon-complete { .address-window .list .item .iconfont.icon-complete {
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
} }
.address-window .list .item .address { .address-window .list .item .address {
width: 560rpx; width: 560rpx;
} }
.address-window .list .item .address .name { .address-window .list .item .address .name {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
color: #282828; color: #282828;
margin-bottom: 4rpx; margin-bottom: 4rpx;
} }
.address-window .list .item .address .name .phone { .address-window .list .item .address .name .phone {
margin-left: 18rpx; margin-left: 18rpx;
} }
.address-window .addressBnt { .address-window .addressBnt {
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
@ -174,17 +194,22 @@
margin: 85rpx auto; margin: 85rpx auto;
background-color: var(--view-theme); background-color: var(--view-theme);
} }
.address-window .pictrue { .address-window .pictrue {
text-align: center; text-align: center;
} }
.address-window .pictrue image,.address-window .pictrue uni-image {
.address-window .pictrue image,
.address-window .pictrue uni-image {
width: 414rpx; width: 414rpx;
height: 305rpx; height: 305rpx;
} }
.address-window .pictrue view{
.address-window .pictrue view {
color: #999; color: #999;
} }
.t-color { .t-color {
color: var(--view-theme)!important; color: var(--view-theme) !important;
} }
</style> </style>

View File

@ -3,8 +3,7 @@
<view v-if="newData.status && newData.status.status" style="height: 100rpx;"></view> <view v-if="newData.status && newData.status.status" style="height: 100rpx;"></view>
<view class="foot" v-if="newData.status && newData.status.status"> <view class="foot" v-if="newData.status && newData.status.status">
<view class="page-footer" id="target" :style="{'background-color':newData.bgColor.color[0].item}"> <view class="page-footer" id="target" :style="{'background-color':newData.bgColor.color[0].item}">
<view class="foot-item" v-for="(item,index) in newData.menuList" :key="index" <view class="foot-item" v-for="(item,index) in newData.menuList" :key="index" @click="goRouter(item)">
@click="goRouter(item)">
<block v-if="item.link == activeRouter"> <block v-if="item.link == activeRouter">
<image :src="item.imgList[0]"></image> <image :src="item.imgList[0]"></image>
<view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">{{item.name}} <view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">{{item.name}}
@ -30,7 +29,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
export default{ export default {
props: { props: {
newData: { newData: {
type: Object, type: Object,
@ -41,7 +40,7 @@
default: '', default: '',
} }
}, },
data(){ data() {
return { return {
} }
@ -49,7 +48,7 @@
mounted() { mounted() {
}, },
methods:{ methods: {
goRouter(item) { goRouter(item) {
var pages = getCurrentPages(); var pages = getCurrentPages();
var page = (pages[pages.length - 1]).$page.fullPath; var page = (pages[pages.length - 1]).$page.fullPath;
@ -65,7 +64,6 @@
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -85,9 +83,11 @@
box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32); box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
padding-bottom: constant(safe-area-inset-bottom); /// IOS<11.2/ padding-bottom: constant(safe-area-inset-bottom); /// IOS<11.2/
padding-bottom: env(safe-area-inset-bottom); /// IOS>11.2/ padding-bottom: env(safe-area-inset-bottom); /// IOS>11.2/
&.filter{
&.filter {
filter: blur(2rpx); filter: blur(2rpx);
} }
.foot-item { .foot-item {
display: flex; display: flex;
width: max-content; width: max-content;
@ -95,6 +95,7 @@
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
.count-num { .count-num {
position: absolute; position: absolute;
display: flex; display: flex;
@ -111,12 +112,14 @@
padding: 4rpx; padding: 4rpx;
} }
} }
.foot-item image { .foot-item image {
height: 50rpx; height: 50rpx;
width: 50rpx; width: 50rpx;
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
} }
.foot-item .txt { .foot-item .txt {
font-size: 24rpx; font-size: 24rpx;
} }

View File

@ -1,56 +1,63 @@
<template> <template>
<view class="easy-loadimage" :id="uid"> <view class="easy-loadimage" :id="uid">
<image class="origin-img" :src="imageSrc" mode="aspectFill" v-if="loadImg&&!isLoadError" v-show="showImg" <image class="origin-img" :src="imageSrc" mode="aspectFill" v-if="loadImg&&!isLoadError" v-show="showImg"
:class="{'no-transition':!openTransition,'show-transition':showTransition&&openTransition}" :class="{'no-transition':!openTransition,'show-transition':showTransition&&openTransition}"
@load="handleImgLoad" @error="handleImgError"> @load="handleImgLoad" @error="handleImgError">
</image> </image>
<view class="loadfail-img" v-else-if="isLoadError" :style="{ 'background-image': `url(${domain}/static/images/loadfail.png)`}"></view> <view class="loadfail-img" v-else-if="isLoadError"
<view :class="['loading-img','spin-circle',loadingMode]" v-show="!showImg&&!isLoadError" :style="{ 'background-image': `url(${domain}/static/images/loading.gif)`}"></view> :style="{ 'background-image': `url(${domain}/static/easy-loadimage/loadfail.png)`}"></view>
</view> <view :class="['loading-img','spin-circle',loadingMode]" v-show="!showImg&&!isLoadError"
:style="{ 'background-image': `url(${domain}/static/easy-loadimage/loading.gif)`}"></view>
</view>
</template> </template>
<script> <script>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB // | Licensed CRMEBCRMEB
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { throttle } from '@/libs/uniApi'; import {
import { HTTP_REQUEST_URL } from '@/config/app'; throttle
// id } from '@/libs/uniApi';
function generateUUID() { import {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { HTTP_REQUEST_URL
        let r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); } from '@/config/app';
        return v.toString(16); // id
    }) function generateUUID() {
} return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
export default{ let r = Math.random() * 16 | 0,
props:{ v = c == 'x' ? r : (r & 0x3 | 0x8);
imageSrc:{ return v.toString(16);
})
}
export default {
props: {
imageSrc: {
type: String, type: String,
}, },
mode:{ mode: {
type: String, type: String,
}, },
loadingMode:{ loadingMode: {
type: String, type: String,
default:'looming-gray' default: 'looming-gray'
}, },
openTransition:{ openTransition: {
type: Boolean, type: Boolean,
default:true, default: true,
}, },
viewHeight:{ viewHeight: {
type:Number, type: Number,
default() { default () {
return uni.getSystemInfoSync().windowHeight; return uni.getSystemInfoSync().windowHeight;
} }
} }
}, },
data(){ data() {
const that = this; const that = this;
return { return {
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
@ -65,7 +72,7 @@ export default{
if (that.loadImg || that.isLoadError) return; if (that.loadImg || that.isLoadError) return;
const id = that.uid const id = that.uid
const query = uni.createSelectorQuery().in(that); const query = uni.createSelectorQuery().in(that);
let t = 0; let t = 0;
query.select('#' + id).boundingClientRect(data => { query.select('#' + id).boundingClientRect(data => {
if (!data) return; if (!data) return;
if (data.top - that.viewHeight < 0) { if (data.top - that.viewHeight < 0) {
@ -75,15 +82,15 @@ export default{
}).exec() }).exec()
}, 200) }, 200)
} }
}, },
methods:{ methods: {
init() { init() {
this.$nextTick(this.onScroll) this.$nextTick(this.onScroll)
}, },
handleBorderLoad(){ handleBorderLoad() {
this.borderLoaded = 1; this.borderLoaded = 1;
}, },
handleBorderError(){ handleBorderError() {
this.borderLoaded = 2; this.borderLoaded = 2;
}, },
handleImgLoad(e) { handleImgLoad(e) {
@ -98,88 +105,107 @@ export default{
onScroll() { onScroll() {
this.scrollFn(); this.scrollFn();
}, },
}, },
mounted() { mounted() {
this.init() this.init()
uni.$on('scroll', this.scrollFn); uni.$on('scroll', this.scrollFn);
this.onScroll(); this.onScroll();
}, },
beforeDestroy() { beforeDestroy() {
uni.$off('scroll', this.scrollFn); uni.$off('scroll', this.scrollFn);
} }
} }
</script> </script>
<style scoped> <style scoped>
/* 官方优化图片tips */ /* 官方优化图片tips */
image{ image {
will-change: transform will-change: transform
} }
/* 渐变过渡效果处理 */
image.origin-img{
width: 100%;
height: 100%;
opacity: 0.3;
max-height: 360rpx;
}
image.origin-img.show-transition{
transition: opacity .5s;
opacity: 1;
}
image.origin-img.no-transition{
opacity: 1;
}
/* 加载失败、加载中的占位图样式控制 */
.loadfail-img{
height: 100%;
background-repeat: no-repeat;
background-size: 50%;
background-position: center;
}
.loading-img{
height: 100%;
background-position: center;
}
/* 转圈 */
.spin-circle{
background-repeat: no-repeat;
background-size: 60%;
}
/* 动态灰色若隐若现 */
.looming-gray{
animation: looming-gray 1s infinite linear;
background-color: #e3e3e3;
}
@keyframes looming-gray{
0% {background-color:#e3e3e3aa;}
50% {background-color:#e3e3e3;}
100% {background-color:#e3e3e3aa;}
}
/* 骨架屏1 */
.skeleton-1{
background-color: #e3e3e3;
background-image: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 80%);
background-size: 100rpx 100%;
background-repeat: repeat-y;
background-position:0 0;
animation: skeleton-1 .6s infinite;
}
@keyframes skeleton-1 {
to {
background-position: 200% 0;
}
}
/* 骨架屏2 */
.skeleton-2{
background-image: linear-gradient(-90deg, #fefefe 0%, #e6e6e6 50%,#fefefe 100%);
background-size: 400% 400%;
background-position:0 0;
animation: skeleton-2 1.2s ease-in-out infinite;
}
@keyframes skeleton-2{
to {
background-position: -135% 0;
}
}
</style>
/* 渐变过渡效果处理 */
image.origin-img {
width: 100%;
height: 100%;
opacity: 0.3;
max-height: 360rpx;
}
image.origin-img.show-transition {
transition: opacity .5s;
opacity: 1;
}
image.origin-img.no-transition {
opacity: 1;
}
/* 加载失败、加载中的占位图样式控制 */
.loadfail-img {
height: 100%;
background-repeat: no-repeat;
background-size: 50%;
background-position: center;
}
.loading-img {
height: 100%;
background-position: center;
}
/* 转圈 */
.spin-circle {
background-repeat: no-repeat;
background-size: 60%;
}
/* 动态灰色若隐若现 */
.looming-gray {
animation: looming-gray 1s infinite linear;
background-color: #e3e3e3;
}
@keyframes looming-gray {
0% {
background-color: #e3e3e3aa;
}
50% {
background-color: #e3e3e3;
}
100% {
background-color: #e3e3e3aa;
}
}
/* 骨架屏1 */
.skeleton-1 {
background-color: #e3e3e3;
background-image: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 80%);
background-size: 100rpx 100%;
background-repeat: repeat-y;
background-position: 0 0;
animation: skeleton-1 .6s infinite;
}
@keyframes skeleton-1 {
to {
background-position: 200% 0;
}
}
/* 骨架屏2 */
.skeleton-2 {
background-image: linear-gradient(-90deg, #fefefe 0%, #e6e6e6 50%, #fefefe 100%);
background-size: 400% 400%;
background-position: 0 0;
animation: skeleton-2 1.2s ease-in-out infinite;
}
@keyframes skeleton-2 {
to {
background-position: -135% 0;
}
}
</style>

View File

@ -1,45 +1,43 @@
<template> <template>
<view class='product-bg'> <view class='product-bg'>
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay" :circular="circular" <swiper :indicator-dots="indicatorDots" :current='current' indicator-active-color="#e93323" :autoplay="autoplay"
:interval="interval" :duration="duration" @change="change" v-if="isPlay"> :circular="circular" :interval="interval" :duration="duration" @change="change" v-if="isPlay">
<!-- #ifndef APP-PLUS --> <!-- #ifndef APP-PLUS -->
<swiper-item v-if="videoline && videoline != '' && videoline != 'https:'">
<view class="item">
<video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : ("http:" + videoline)'
objectFit="cover" controls style="width:100%;height:100% " show-mute-btn="true"
auto-pause-if-navigate @ended="endedFun()"></video>
<view class="poster" v-if="controls">
<image class="image" :src="videoCoverImg"></image>
</view>
<view class="stop" v-if="controls" @tap="bindPause">
<image class="image" src="../../static/images/stop.png"></image>
</view>
</view>
</swiper-item>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<swiper-item v-if="videoline">
<view class="item">
<view class="poster" v-show="controls">
<image class="image" :src="videoCoverImg"></image>
</view>
<view class="stop" v-show="controls" @tap="bindPause">
<image class="image" src="../../static/images/stop.png"></image>
</view>
</view>
</swiper-item>
<!-- #endif -->
<block v-for="(item,index) in imgUrls" :key='index'> <block v-for="(item,index) in imgUrls" :key='index'>
<swiper-item> <swiper-item v-if="isVideoUrl(item)">
<image :src="item" class="slide-image" @click='getpreviewImage(item)' mode="widthFix" /> <video :src="isVideoUrl(item,true)" objectFit="cover" controls style="width:100%;height:100% "
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate
:enable-progress-gesture="false" :poster="item+coverUrl"></video>
</swiper-item>
<swiper-item v-else>
<image :src="item" class="slide-image" @click='getpreviewImage(item)' />
</swiper-item> </swiper-item>
</block> </block>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<block v-for="(item,index) in imgUrls" :key='index'>
<swiper-item v-if="isVideoUrl(item)">
<view>
<image :src="item+coverUrl" class="slide-image" />
<image class="image-play-icon" src="../../static/images/stop.png"
@click='videoPlay(item,index)'>
</image>
</view>
</swiper-item>
<swiper-item v-else>
<image :src="item" class="slide-image" @click='getpreviewImage(item)' />
</swiper-item>
</block>
<!-- #endif -->
</swiper> </swiper>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<view v-if="!isPlay" style="width: 100%; height: 750rpx;"> <view v-if="!isPlay" style="width: 100%; height: 750rpx;">
<video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : "http:" + videoline' <video id="myVideo" :src='playingUrl' objectFit="cover" controls style="width:100%;height:100% "
objectFit="cover" controls style="width:100%;height:100% " show-center-play-btn show-mute-btn="true" show-center-play-btn show-mute-btn="true" auto-pause-if-navigate :enable-progress-gesture="false"
auto-pause-if-navigate :enable-progress-gesture="false" :poster="videoCoverImg" @pause="videoPause" @ended="endedFun()"></video> :poster="playingUrl+coverUrl" @pause="videoPause" @ended="endedFun()"></video>
</view> </view>
<!-- #endif --> <!-- #endif -->
@ -50,7 +48,7 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB // | Licensed CRMEBCRMEB
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -74,6 +72,10 @@
}, },
data() { data() {
return { return {
coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
current: '0',
videoTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
playingUrl: '',
indicatorDots: true, indicatorDots: true,
circular: true, circular: true,
autoplay: true, autoplay: true,
@ -97,6 +99,25 @@
// #endif // #endif
}, },
methods: { methods: {
isVideoUrl(url, getRightUrl) {
const str = url;
const lastIndex = str.lastIndexOf(".");
let extension;
if (lastIndex !== -1) {
extension = str.substring(lastIndex + 1);
} else {
extension = 'jpg'
}
if (getRightUrl) return url.replace(/\\/g, "")
return this.videoTypeList.includes(extension)
},
videoPlay(url, index) {
this.playingUrl = url
this.current = index
console.log(this.current)
this.bindPause()
},
getpreviewImage: function(item) { getpreviewImage: function(item) {
uni.previewImage({ uni.previewImage({
urls: this.imgUrls, urls: this.imgUrls,
@ -109,6 +130,7 @@
this.autoplay = true this.autoplay = true
// #endif // #endif
}, },
bindPause: function() { bindPause: function() {
// #ifndef APP-PLUS // #ifndef APP-PLUS
this.videoContext.play(); this.videoContext.play();
@ -119,7 +141,7 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.isPlay = false this.isPlay = false
this.videoContext = uni.createVideoContext('myVideo', this); this.videoContext = uni.createVideoContext('myVideo', this);
this.$nextTick(()=>{ this.$nextTick(() => {
this.videoContext.play(); this.videoContext.play();
}) })
// #endif // #endif
@ -140,15 +162,18 @@
height: 750rpx; height: 750rpx;
position: relative; position: relative;
} }
.product-bg swiper { .product-bg swiper {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
} }
.product-bg .slide-image { .product-bg .slide-image {
width: 100%; width: 750rpx;
height: 100%; height: 750rpx;
} }
.product-bg .pages { .product-bg .pages {
position: absolute; position: absolute;
background-color: #fff; background-color: #fff;
@ -161,15 +186,18 @@
font-size: 24rpx; font-size: 24rpx;
color: #050505; color: #050505;
} }
#myVideo { #myVideo {
width: 100%; width: 100%;
height: 100% height: 100%
} }
.product-bg .item { .product-bg .item {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.product-bg .item .poster { .product-bg .item .poster {
position: absolute; position: absolute;
top: 0; top: 0;
@ -178,10 +206,12 @@
width: 100%; width: 100%;
z-index: 9; z-index: 9;
} }
.product-bg .item .poster .image { .product-bg .item .poster .image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.product-bg .item .stop { .product-bg .item .stop {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -192,8 +222,18 @@
margin-left: -68rpx; margin-left: -68rpx;
z-index: 9; z-index: 9;
} }
.product-bg .item .stop .image { .product-bg .item .stop .image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.image-play-icon {
position: absolute;
width: 100rpx;
height: 100rpx;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style> </style>

View File

@ -63,7 +63,7 @@
</view> </view>
<!-- tab导航 --> <!-- tab导航 -->
<view class="tabs" v-if="showTab"> <view class="tabs" v-if="showTab" :style="{top:'calc(98rpx + var(--status-bar-height))'}">
<block v-for="(item,indx) in tabsArr" :key="indx"> <block v-for="(item,indx) in tabsArr" :key="indx">
<view v-if="indx>0" style="width: 3rpx;height: 36rpx;background-color: #ccc;"></view> <view v-if="indx>0" style="width: 3rpx;height: 36rpx;background-color: #ccc;"></view>
<view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item" @click="changeTab(item.val)"> <view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item" @click="changeTab(item.val)">
@ -280,6 +280,11 @@
} }
.tabs { .tabs {
position: sticky;
top: 0;
z-index: 900;
background: #fff;
padding-bottom: 20rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -323,6 +328,7 @@
.recommend .recommendList { .recommend .recommendList {
padding: 0 20rpx; padding: 0 20rpx;
min-height: 100rpx; min-height: 100rpx;
min-height: calc(100vh - 82rpx - var(--status-bar-height));
} }
.recommend .recommendList.on { .recommend .recommendList.on {

View File

@ -1,352 +1,352 @@
{ {
"name": "惠农生活", "name" : "惠农生活",
"appid": "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"description": "", "description" : "",
"versionName": "2.0.37", "versionName" : "2.0.52",
"versionCode": 2037, "versionCode" : 2052,
"transformPx": false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus": { "app-plus" : {
"titleNView": true, "titleNView" : true,
"usingComponents": true, "usingComponents" : true,
"nvueCompiler": "uni-app", "nvueCompiler" : "uni-app",
"nvueStyleCompiler": "uni-app", "nvueStyleCompiler" : "uni-app",
"compilerVersion": 3, "compilerVersion" : 3,
"compatible": { "compatible" : {
"ignoreVersion": true //trueHBuilderX1.9.0 "ignoreVersion" : true //trueHBuilderX1.9.0
}, },
"splashscreen": { "splashscreen" : {
"alwaysShowBeforeRender": false, "alwaysShowBeforeRender" : false,
"waiting": false, "waiting" : false,
"autoclose": true, "autoclose" : true,
"delay": 0 "delay" : 0
}, },
/* */ /* */
"modules": { "modules" : {
"VideoPlayer": {}, "VideoPlayer" : {},
"OAuth": {}, "OAuth" : {},
"Payment": {}, "Payment" : {},
"Share": {}, "Share" : {},
"iBeacon": {}, "iBeacon" : {},
"Maps": {}, "Maps" : {},
"Geolocation": {}, "Geolocation" : {},
"UniMP": { "UniMP" : {
"description": "uni小程序" "description" : "uni小程序"
}, },
"Push": {}, "Push" : {},
"Barcode": {}, "Barcode" : {},
"Camera": {} "Camera" : {}
}, },
"safearea": { "safearea" : {
"bottom": { "bottom" : {
"offset": "none" "offset" : "none"
} }
}, },
/* */ /* */
"distribute": { "distribute" : {
/* android */ /* android */
"android": { "android" : {
"permissions": [ "permissions" : [
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>", "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>", "<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>", "<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>", "<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>", "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>" "<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
], ],
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"], "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"permissionExternalStorage": { "permissionExternalStorage" : {
"request": "none", "request" : "none",
"prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
}, },
"permissionPhoneState": { "permissionPhoneState" : {
"request": "none" // "request" : "none" //
}, },
"minSdkVersion": 23, "minSdkVersion" : 23,
"targetSdkVersion": 30 "targetSdkVersion" : 30
}, },
/* ios */ /* ios */
"ios": { "ios" : {
"privacyDescription": { "privacyDescription" : {
"NSPhotoLibraryUsageDescription": "上传用户头像保存分享海报", "NSPhotoLibraryUsageDescription" : "上传用户头像保存分享海报",
"NSPhotoLibraryAddUsageDescription": "上传用户头像保存分享海报", "NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报",
"NSCameraUsageDescription": "上传用户头像保存分享海报", "NSCameraUsageDescription" : "上传用户头像保存分享海报",
"NSLocationWhenInUseUsageDescription": "根据客户地理位置推荐最近门店", "NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店",
"NSLocationAlwaysUsageDescription": "根据客户地理位置推荐最近门店" "NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店"
}, },
"idfa": false, "idfa" : false,
"dSYMs": false "dSYMs" : false
}, },
/* SDK */ /* SDK */
"sdkConfigs": { "sdkConfigs" : {
"maps": { "maps" : {
"amap": { "amap" : {
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d", "appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945", "appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945",
"name": "amapIvoVHpJR" "name" : "amapIvoVHpJR"
} }
}, },
"payment": { "payment" : {
"weixin": { "weixin" : {
"__platform__": ["ios", "android"], "__platform__" : [ "ios", "android" ],
"appid": "wx2e8f79ff281284f5", "appid" : "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/" "UniversalLinks" : "https://shop.lihaink.cn/"
} }
}, },
"share": { "share" : {
"weixin": { "weixin" : {
"appid": "wx2e8f79ff281284f5", "appid" : "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/" "UniversalLinks" : "https://shop.lihaink.cn/"
} }
}, },
"geolocation": { "geolocation" : {
"amap": { "amap" : {
"name": "amapIvoVHpJR", "name" : "amapIvoVHpJR",
"__platform__": ["ios", "android"], "__platform__" : [ "ios", "android" ],
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d", "appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945" "appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945"
} }
}, },
"push": {}, "push" : {},
"oauth": { "oauth" : {
"weixin": { "weixin" : {
"appid": "wx2e8f79ff281284f5", "appid" : "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/" "UniversalLinks" : "https://shop.lihaink.cn/"
} }
}, },
"ad": {} "ad" : {}
}, },
"icons": { "icons" : {
"android": { "android" : {
"hdpi": "unpackage/res/icons/72x72.png", "hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png", "xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png", "xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png" "xxxhdpi" : "unpackage/res/icons/192x192.png"
}, },
"ios": { "ios" : {
"appstore": "unpackage/res/icons/1024x1024.png", "appstore" : "unpackage/res/icons/1024x1024.png",
"ipad": { "ipad" : {
"app": "unpackage/res/icons/76x76.png", "app" : "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png", "app@2x" : "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png", "notification" : "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png", "notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png", "proapp@2x" : "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png", "settings" : "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png", "settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png", "spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png" "spotlight@2x" : "unpackage/res/icons/80x80.png"
}, },
"iphone": { "iphone" : {
"app@2x": "unpackage/res/icons/120x120.png", "app@2x" : "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png", "app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png", "notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png", "notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png", "settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png", "settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png", "spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png" "spotlight@3x" : "unpackage/res/icons/120x120.png"
} }
} }
}, },
"splashscreen": { "splashscreen" : {
"useOriginalMsgbox": true, "useOriginalMsgbox" : true,
"androidStyle": "common" "androidStyle" : "common"
} }
}, },
"nativePlugins": { "nativePlugins" : {
"JG-JCore": { "JG-JCore" : {
"JPUSH_APPKEY_IOS": "8a5efd65cda14fafa6e64ad3", "JPUSH_APPKEY_IOS" : "8a5efd65cda14fafa6e64ad3",
"JPUSH_CHANNEL_IOS": "8a5efd65cda14fafa6e64ad3", "JPUSH_CHANNEL_IOS" : "8a5efd65cda14fafa6e64ad3",
"JPUSH_APPKEY_ANDROID": "b5f679f4357018605ea6fd2e", "JPUSH_APPKEY_ANDROID" : "b5f679f4357018605ea6fd2e",
"JPUSH_CHANNEL_ANDROID": "", "JPUSH_CHANNEL_ANDROID" : "",
"__plugin_info__": { "__plugin_info__" : {
"name": "JG-JCore", "name" : "JG-JCore",
"description": "极光推送JCore插件", "description" : "极光推送JCore插件",
"platforms": "Android,iOS", "platforms" : "Android,iOS",
"url": "", "url" : "",
"android_package_name": "uni.UNI3A527D1", "android_package_name" : "uni.UNI3A527D1",
"ios_bundle_id": "", "ios_bundle_id" : "",
"isCloud": false, "isCloud" : false,
"bought": -1, "bought" : -1,
"pid": "", "pid" : "",
"parameters": { "parameters" : {
"JPUSH_APPKEY_IOS": { "JPUSH_APPKEY_IOS" : {
"des": "[iOS]极光portal配置应用信息时分配的AppKey", "des" : "[iOS]极光portal配置应用信息时分配的AppKey",
"key": "JCore:APP_KEY", "key" : "JCore:APP_KEY",
"value": "daebe19b547c43128796a078" "value" : "daebe19b547c43128796a078"
}, },
"JPUSH_CHANNEL_IOS": { "JPUSH_CHANNEL_IOS" : {
"des": "[iOS]用于统计分发渠道不需要可填默认值developer-default", "des" : "[iOS]用于统计分发渠道不需要可填默认值developer-default",
"key": "JCore:CHANNEL", "key" : "JCore:CHANNEL",
"value": "" "value" : ""
}, },
"JPUSH_APPKEY_ANDROID": { "JPUSH_APPKEY_ANDROID" : {
"des": "[Android]极光portal配置应用信息时分配的AppKey", "des" : "[Android]极光portal配置应用信息时分配的AppKey",
"key": "JPUSH_APPKEY", "key" : "JPUSH_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_CHANNEL_ANDROID": { "JPUSH_CHANNEL_ANDROID" : {
"des": "[Android]用于统计分发渠道不需要可填默认值developer-default", "des" : "[Android]用于统计分发渠道不需要可填默认值developer-default",
"key": "JPUSH_CHANNEL", "key" : "JPUSH_CHANNEL",
"value": "" "value" : ""
} }
} }
} }
}, },
"JG-JPush": { "JG-JPush" : {
"JPUSH_ISPRODUCTION_IOS": "true", "JPUSH_ISPRODUCTION_IOS" : "true",
"JPUSH_ADVERTISINGID_IOS": "", "JPUSH_ADVERTISINGID_IOS" : "",
"JPUSH_DEFAULTINITJPUSH_IOS": "true", "JPUSH_DEFAULTINITJPUSH_IOS" : "true",
"JPUSH_OPPO_APPKEY": "", "JPUSH_OPPO_APPKEY" : "",
"JPUSH_OPPO_APPID": "", "JPUSH_OPPO_APPID" : "",
"JPUSH_OPPO_APPSECRET": "", "JPUSH_OPPO_APPSECRET" : "",
"JPUSH_VIVO_APPKEY": "", "JPUSH_VIVO_APPKEY" : "",
"JPUSH_VIVO_APPID": "", "JPUSH_VIVO_APPID" : "",
"JPUSH_MEIZU_APPKEY": "", "JPUSH_MEIZU_APPKEY" : "",
"JPUSH_MEIZU_APPID": "", "JPUSH_MEIZU_APPID" : "",
"JPUSH_XIAOMI_APPKEY": "", "JPUSH_XIAOMI_APPKEY" : "",
"JPUSH_XIAOMI_APPID": "", "JPUSH_XIAOMI_APPID" : "",
"__plugin_info__": { "__plugin_info__" : {
"name": "JG-JPush", "name" : "JG-JPush",
"description": "极光推送Hbuilder插件", "description" : "极光推送Hbuilder插件",
"platforms": "Android,iOS", "platforms" : "Android,iOS",
"url": "", "url" : "",
"android_package_name": "uni.UNI3A527D1", "android_package_name" : "uni.UNI3A527D1",
"ios_bundle_id": "", "ios_bundle_id" : "",
"isCloud": false, "isCloud" : false,
"bought": -1, "bought" : -1,
"pid": "", "pid" : "",
"parameters": { "parameters" : {
"JPUSH_ISPRODUCTION_IOS": { "JPUSH_ISPRODUCTION_IOS" : {
"des": "[iOS]是否是生产环境是填true不是填false或者不填", "des" : "[iOS]是否是生产环境是填true不是填false或者不填",
"key": "JPush:ISPRODUCTION", "key" : "JPush:ISPRODUCTION",
"value": "" "value" : ""
}, },
"JPUSH_ADVERTISINGID_IOS": { "JPUSH_ADVERTISINGID_IOS" : {
"des": "[iOS]广告标识符IDFA如果不需要使用IDFA可不填", "des" : "[iOS]广告标识符IDFA如果不需要使用IDFA可不填",
"key": "JPush:ADVERTISINGID", "key" : "JPush:ADVERTISINGID",
"value": "" "value" : ""
}, },
"JPUSH_DEFAULTINITJPUSH_IOS": { "JPUSH_DEFAULTINITJPUSH_IOS" : {
"des": "[iOS]是否默认初始化是填true不是填false或者不填", "des" : "[iOS]是否默认初始化是填true不是填false或者不填",
"key": "JPush:DEFAULTINITJPUSH", "key" : "JPush:DEFAULTINITJPUSH",
"value": "" "value" : ""
}, },
"JPUSH_OPPO_APPKEY": { "JPUSH_OPPO_APPKEY" : {
"des": "厂商OPPO-appkey,示例OP-12345678", "des" : "厂商OPPO-appkey,示例OP-12345678",
"key": "OPPO_APPKEY", "key" : "OPPO_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_OPPO_APPID": { "JPUSH_OPPO_APPID" : {
"des": "厂商OPPO-appId,示例OP-12345678", "des" : "厂商OPPO-appId,示例OP-12345678",
"key": "OPPO_APPID", "key" : "OPPO_APPID",
"value": "" "value" : ""
}, },
"JPUSH_OPPO_APPSECRET": { "JPUSH_OPPO_APPSECRET" : {
"des": "厂商OPPO-appSecret,示例OP-12345678", "des" : "厂商OPPO-appSecret,示例OP-12345678",
"key": "OPPO_APPSECRET", "key" : "OPPO_APPSECRET",
"value": "" "value" : ""
}, },
"JPUSH_VIVO_APPKEY": { "JPUSH_VIVO_APPKEY" : {
"des": "厂商VIVO-appkey,示例12345678", "des" : "厂商VIVO-appkey,示例12345678",
"key": "com.vivo.push.api_key", "key" : "com.vivo.push.api_key",
"value": "" "value" : ""
}, },
"JPUSH_VIVO_APPID": { "JPUSH_VIVO_APPID" : {
"des": "厂商VIVO-appId,示例12345678", "des" : "厂商VIVO-appId,示例12345678",
"key": "com.vivo.push.app_id", "key" : "com.vivo.push.app_id",
"value": "" "value" : ""
}, },
"JPUSH_MEIZU_APPKEY": { "JPUSH_MEIZU_APPKEY" : {
"des": "厂商MEIZU-appKey,示例MZ-12345678", "des" : "厂商MEIZU-appKey,示例MZ-12345678",
"key": "MEIZU_APPKEY", "key" : "MEIZU_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_MEIZU_APPID": { "JPUSH_MEIZU_APPID" : {
"des": "厂商MEIZU-appId,示例MZ-12345678", "des" : "厂商MEIZU-appId,示例MZ-12345678",
"key": "MEIZU_APPID", "key" : "MEIZU_APPID",
"value": "" "value" : ""
}, },
"JPUSH_XIAOMI_APPKEY": { "JPUSH_XIAOMI_APPKEY" : {
"des": "厂商XIAOMI-appKey,示例MI-12345678", "des" : "厂商XIAOMI-appKey,示例MI-12345678",
"key": "XIAOMI_APPKEY", "key" : "XIAOMI_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_XIAOMI_APPID": { "JPUSH_XIAOMI_APPID" : {
"des": "厂商XIAOMI-appId,示例MI-12345678", "des" : "厂商XIAOMI-appId,示例MI-12345678",
"key": "XIAOMI_APPID", "key" : "XIAOMI_APPID",
"value": "" "value" : ""
} }
} }
} }
} }
} }
}, },
/* */ /* */
"quickapp": {}, "quickapp" : {},
/* */ /* */
"mp-weixin": { "mp-weixin" : {
"appid": "wx5fb1cc8edb3f8baa", "appid" : "wx5fb1cc8edb3f8baa",
"setting": { "setting" : {
"urlCheck": false, "urlCheck" : false,
"minified": true, "minified" : true,
"postcss": true, "postcss" : true,
"es6": true "es6" : true
}, },
"permission": { "permission" : {
"scope.userLocation": { "scope.userLocation" : {
"desc": "获取您的位置" "desc" : "获取您的位置"
} }
}, },
"requiredPrivateInfos": ["getLocation", "chooseAddress"], "requiredPrivateInfos" : [ "getLocation", "chooseAddress" ],
"usingComponents": true, "usingComponents" : true,
"__usePrivacyCheck__": true "__usePrivacyCheck__" : true
}, },
"mp-alipay": { "mp-alipay" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-baidu": { "mp-baidu" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-toutiao": { "mp-toutiao" : {
"usingComponents": true "usingComponents" : true
}, },
"h5": { "h5" : {
"devServer": { "devServer" : {
"https": false "https" : false
}, },
"router": { "router" : {
"mode": "history", "mode" : "history",
"base": "" "base" : ""
}, },
"domain": "", "domain" : "",
"sdkConfigs": { "sdkConfigs" : {
"maps": { "maps" : {
"qqmap": { "qqmap" : {
"key": "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7" "key" : "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
} }
} }
}, },
"title": "加载中...", "title" : "加载中...",
"template": "template.h5.html", "template" : "template.h5.html",
"optimization": { "optimization" : {
"treeShaking": { "treeShaking" : {
"enable": true "enable" : true
} }
} }
} }
} }

View File

@ -25,7 +25,7 @@
}, { }, {
"path": "pages/whole_sale/index", "path": "pages/whole_sale/index",
"style": { "style": {
"enablePullDownRefresh": true, "enablePullDownRefresh": false,
"navigationBarTitleText": "批发", "navigationBarTitleText": "批发",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
@ -34,7 +34,9 @@
"style": { "style": {
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"navigationBarTitleText": "工作台", "navigationBarTitleText": "工作台",
"navigationStyle": "custom" "navigationStyle": "custom",
"backgroundColorTop": "#40AE36",
"backgroundTextStyle": "light"
} }
}, { }, {
"path": "pages/order_addcart/order_addcart", "path": "pages/order_addcart/order_addcart",
@ -105,6 +107,13 @@
// #endif // #endif
} }
}, },
{
"path": "pages/goods_details/videoPlay",
"style": {
"navigationBarTitleText": "视屏详情"
}
},
{ {
"path": "pages/goods_cate/goods_cate", "path": "pages/goods_cate/goods_cate",
"style": { "style": {
@ -578,7 +587,8 @@
"path": "order_list/index", "path": "order_list/index",
"style": { "style": {
"navigationBarTitleText": "我的订单", "navigationBarTitleText": "我的订单",
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
{ {
@ -1515,7 +1525,9 @@
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
//#ifndef H5 //#ifndef H5
, ,
"titleNView": true "titleNView": true,
"backgroundColorTop": "#40AE36",
"backgroundTextStyle": "light"
//#endif //#endif
//#ifdef H5 //#ifdef H5
, ,

File diff suppressed because it is too large Load Diff

View File

@ -12,10 +12,11 @@
<view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 4">[商品]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 4">[商品]</view>
<view class="con line1" v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view> <view class="con line1"
v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view>
</view> </view>
<view class="right-box"> <view class="right-box">
<view class="time">{{item.last && item.last.create_time.split(' ')[1] || ''}}</view> <view class="time">{{item.display_time}}</view>
<view class="num" v-if="item.num>0">{{item.num}}</view> <view class="num" v-if="item.num>0">{{item.num}}</view>
</view> </view>
</div> </div>
@ -23,18 +24,21 @@
<block v-if="type == 1 && list.length>0" v-for="(item,index) in list" :key="index"> <block v-if="type == 1 && list.length>0" v-for="(item,index) in list" :key="index">
<div class="item acea-row" @click="goPage(item)"> <div class="item acea-row" @click="goPage(item)">
<view class="logo"> <view class="logo">
<image :src="(item.user && item.user.avatar) ? item.user.avatar : '/static/images/f.png'" mode=""></image> <image :src="(item.user && item.user.avatar) ? item.user.avatar : '/static/images/f.png'"
mode=""></image>
</view> </view>
<view class="info"> <view class="info">
<view class="name">{{item.user && item.user.nickname}}</view> <view class="name">{{item.user && item.user.nickname}}</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 1">{{item.last.msn}}</view> <view class="con line1" v-if="item.last && item.last.msn_type == 1">{{item.last.msn}}</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 2">[表情]</view>
<view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view> <view class="con line1" v-if="item.last && item.last.msn_type == 3">[图片]</view>
<view class="con line1" v-if="item.last && (item.last.msn_type == 4 || item.last.msn_type == 7)">[商品]</view> <view class="con line1"
<view class="con line1" v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view> v-if="item.last && (item.last.msn_type == 4 || item.last.msn_type == 7)">[商品]</view>
<view class="con line1"
v-if="item.last && (item.last.msn_type == 5 || item.last.msn_type == 6)">[订单]</view>
</view> </view>
<view class="right-box"> <view class="right-box">
<view class="time">{{item.last && item.last.create_time.split(' ')[1]}}</view> <view class="time">{{item.display_time}}</view>
<view class="num" v-if="item.num>0">{{item.num}}</view> <view class="num" v-if="item.num>0">{{item.num}}</view>
</view> </view>
</div> </div>
@ -57,12 +61,19 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import emptyPage from '@/components/emptyPage.vue' import emptyPage from '@/components/emptyPage.vue'
import { serviceList, serviceUserList } from "@/api/user"; import {
import { toLogin } from '@/libs/login.js'; serviceList,
import { mapGetters } from "vuex"; serviceUserList
} from "@/api/user";
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
export default { export default {
name: "CustomerList", name: "CustomerList",
components:{ components: {
emptyPage, emptyPage,
}, },
data() { data() {
@ -70,41 +81,41 @@
list: [], list: [],
productId: 0, productId: 0,
orderId: "", orderId: "",
type: 0 ,// 0 1 type: 0, // 0 1
timer: null, timer: null,
page:1, page: 1,
limit:9999, limit: 9999,
mer_id: '', mer_id: '',
loading: false, loading: false,
clear: false, clear: false,
}; };
}, },
computed: mapGetters(['isLogin','viewColor']), computed: mapGetters(['isLogin', 'viewColor']),
onLoad(optios) { onLoad(optios) {
this.type = optios.type; this.type = optios.type;
this.mer_id = optios.mer_id; this.mer_id = optios.mer_id;
if(this.isLogin){ if (this.isLogin) {
this.getList(this.mer_id) this.getList(this.mer_id)
} else { } else {
toLogin() toLogin()
} }
}, },
onShow(option) { onShow(option) {
if(this.isLogin){ if (this.isLogin) {
this.liveUpdate(); this.liveUpdate();
} else { } else {
toLogin() toLogin()
} }
}, },
onHide(){ onHide() {
if(this.timer) { if (this.timer) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} }
this.clear = true; this.clear = true;
}, },
onUnload() { onUnload() {
if(this.timer) { if (this.timer) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
} }
@ -113,20 +124,20 @@
methods: { methods: {
getList(mer_id) { getList(mer_id) {
this.loading = true; this.loading = true;
if(this.type == 0){ if (this.type == 0) {
serviceList({ serviceList({
page:this.page, page: this.page,
limit:this.limit limit: this.limit
}).then(res => { }).then(res => {
this.list = res.data.list; this.list = res.data.list;
if(res.status == 400){ if (res.status == 400) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
return this.$util.Tips({ return this.$util.Tips({
title: res.message title: res.message
}) })
} }
}).finally(v=>{ }).finally(v => {
this.loading = false; this.loading = false;
return this.$util.Tips({ return this.$util.Tips({
title: v title: v
@ -136,20 +147,20 @@
title: err title: err
}) })
}); });
}else{ } else {
serviceUserList(mer_id,{ serviceUserList(mer_id, {
page:this.page, page: this.page,
limit:this.limit limit: this.limit
}).then(res =>{ }).then(res => {
this.list = res.data.list; this.list = res.data.list;
if(res.status == 400){ if (res.status == 400) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
return this.$util.Tips({ return this.$util.Tips({
title: res.message title: res.message
}) })
} }
}).finally(v=>{ }).finally(v => {
this.loading = false; this.loading = false;
clearInterval(this.timer); clearInterval(this.timer);
this.timer = null; this.timer = null;
@ -166,29 +177,29 @@
} }
}, },
// //
liveUpdate(){ liveUpdate() {
let that = this; let that = this;
this.clear = false; this.clear = false;
if(that.timer) { if (that.timer) {
clearInterval(that.timer); clearInterval(that.timer);
that.timer = null; that.timer = null;
} }
that.timer = setInterval(function(){ that.timer = setInterval(function() {
if(that.clear){ if (that.clear) {
clearInterval(that.timer); clearInterval(that.timer);
return ; return;
} }
// //
(!that.loading) && that.getList(that.mer_id); (!that.loading) && that.getList(that.mer_id);
},5000); }, 5000);
}, },
goPage(item) { goPage(item) {
item.num = 0; item.num = 0;
if(this.type == 0){ if (this.type == 0) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/chat/customer_list/chat?mer_id=${item.mer_id}` url: `/pages/chat/customer_list/chat?mer_id=${item.mer_id}`
}) })
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/chat/customer_list/chat?userId=${item.user.uid}&mer_id=${item.mer_id}` url: `/pages/chat/customer_list/chat?userId=${item.user.uid}&mer_id=${item.mer_id}`
}) })
@ -207,7 +218,8 @@
transform: rotate(180deg); transform: rotate(180deg);
font-size: 36rpx; font-size: 36rpx;
} }
.popupn{
.popupn {
position: fixed; position: fixed;
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -217,65 +229,78 @@
height: 90rpx; height: 90rpx;
line-height: 90rpx; line-height: 90rpx;
z-index: 100; z-index: 100;
.title{
.title {
max-width: 560rpx; max-width: 560rpx;
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
} }
.iconfont{
.iconfont {
display: inline-block; display: inline-block;
position: relative; position: relative;
top: 4rpx; top: 4rpx;
right: 0; right: 0;
} }
.mer_logo{
.mer_logo {
width: 34rpx; width: 34rpx;
height: 34rpx; height: 34rpx;
position: relative; position: relative;
top: 6rpx; top: 6rpx;
right: 10px; right: 10px;
} }
.mer_name{
.mer_name {
display: inline-block; display: inline-block;
max-width: 650rpx; max-width: 650rpx;
} }
.invoice-content{
.invoice-content {
background-color: #ffffff; background-color: #ffffff;
} }
} }
.list_count{
.list_count {
margin-top: 104rpx; margin-top: 104rpx;
} }
.item { .item {
align-items: center; align-items: center;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
background-color: #fff; background-color: #fff;
.logo image{
.logo image {
width: 88rpx; width: 88rpx;
height: 88rpx; height: 88rpx;
border-radius: 50%; border-radius: 50%;
} }
.info{
.info {
width: 334rpx; width: 334rpx;
margin-left: 20rpx; margin-left: 20rpx;
.con{
.con {
margin-top: 10rpx; margin-top: 10rpx;
color: #999999; color: #999999;
font-size: 24rpx; font-size: 24rpx;
} }
} }
.right-box{
.right-box {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
font-size: 20rpx; font-size: 20rpx;
color: #BBBBBB; color: #BBBBBB;
.time{
.time {
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.num{
.num {
min-width: 6px; min-width: 6px;
background-color: var(--view-theme); background-color: var(--view-theme);
border-radius: 15px; border-radius: 15px;

View File

@ -7,99 +7,77 @@
background-color: #f8fafb !important; background-color: #f8fafb !important;
.wholeSale-header { .wholeSale-header {
position: sticky;
top: 0;
z-index: 9;
margin-bottom: 20rpx; margin-bottom: 20rpx;
// background-color: #40AE36; background-color: #40AE36;
.scrollview {
display: flex;
align-items: center;
height: 98rpx;
padding-left: 32rpx;
.scrollview-item {
margin-right: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
}
.scrollview-active {
position: relative;
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
&::after {
content: "";
display: inline-block;
position: absolute;
bottom: -6rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 6rpx;
background-color: #FFFFFF;
}
}
}
} }
.wholeSale-con { .wholeSale-section {
margin: 0 20rpx; position: sticky;
top: calc(82rpx + var(--status-bar-height));
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .5s;
overflow: hidden;
margin-bottom: 20rpx;
.wholeSale-nav { .wholeSale-nav {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 40rpx; padding-bottom: 20rpx;
.icon { .icon {
margin-right: 20rpx; margin-right: 20rpx;
} }
}
.search_content { .search_content {
// margin-bottom: 40rpx; flex: 1;
flex: 1; height: 70rpx;
height: 70rpx; padding: 2px 2px 2px 21.05rpx;
padding: 2px 2px 2px 21.05rpx; border-radius: 80rpx;
border-radius: 80rpx; background: #EDEFF2;
background: #EDEFF2; position: relative;
position: relative; box-sizing: border-box;
box-sizing: border-box;
.search_content_wrap { .search_content_wrap {
width: 100%; width: 100%;
.icon-sousuo { .icon-sousuo {
font-size: 26.32rpx; font-size: 26.32rpx;
font-weight: bold; font-weight: bold;
color: #c8c7c6; color: #c8c7c6;
margin-right: 17.54rpx; margin-right: 17.54rpx;
}
input {
width: 80%;
}
} }
input { .search_btn {
width: 80%; width: 106rpx;
height: 60rpx;
line-height: 60rpx;
background: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
} }
} }
.search_btn {
width: 106rpx;
height: 60rpx;
line-height: 60rpx;
background: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
}
} }
.category { .category {
position: relative;
width: 100%; width: 100%;
overflow: auto; overflow: auto;
margin-bottom: 20rpx; margin-bottom: 20rpx;
padding-right: 70rpx;
.category-wrap { .category-wrap {
display: flex; display: flex;
padding-bottom: 20rpx; padding-bottom: 10rpx;
.category-item { .category-item {
display: flex; display: flex;
@ -140,6 +118,24 @@
} }
} }
} }
.category-all {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
height: 100%;
background-color: #f3f3f3;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: 24rpx;
border-radius: 4rpx;
width: 70rpx;
color: #919191;
}
} }
.cate { .cate {
@ -169,42 +165,83 @@
} }
} }
} }
}
.comprehensive { .popup-wrap {
display: flex; background-color: #fff;
justify-content: space-between; padding: 20rpx;
align-items: center;
padding: 0 50rpx;
[class^=comprehensive-] { .popup-wrap-title {
font-size: 36rpx;
color: #333;
font-weight: bold;
margin-bottom: 20rpx;
}
.popup-wrap-category {
width: 100%;
.popup-wrap-category-wrap {
display: flex; display: flex;
align-items: center; flex-wrap: wrap;
text { .popup-wrap-category-item {
margin-right: 12rpx; display: flex;
font-size: 26rpx; flex-direction: column;
color: #666666; justify-content: center;
align-items: center;
margin: 0 20rpx 20rpx 0;
&:nth-child(5n) {
margin-right: 0;
}
text {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
white-space: nowrap;
}
.popup-wrap-category-item-text {
width: 120rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
image { .popup-wrap-category-item-active {
width: 28rpx; position: relative;
height: 28rpx;
}
.loudou { .popup-wrap-category-item-img {
width: 24rpx; border: 2px solid #40AE36;
height: 24rpx; border-radius: 50%;
}
text {
background-color: #40AE36;
color: #fff;
padding: 2rpx 10rpx 6rpx 10rpx;
border-radius: 50rpx;
}
} }
} }
} }
} }
.wholeSale-con {
height: 100vh;
margin: 0 20rpx;
padding-bottom: 30rpx;
}
} }
</style> </style>
<template> <template>
<view class="wholeSale"> <view class="wholeSale">
<!-- 顶部 --> <!-- 顶部 -->
<view class="wholeSale-header" style="position: fixed;top: 0;left: 0;width: 100%;z-index: 999;"> <view class="wholeSale-header">
<!-- 适配不同机 --> <!-- 适配不同机 -->
<view style="height: var(--status-bar-height);background-color: #40af37;"></view> <view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;"> <view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
@ -213,11 +250,9 @@
</view> </view>
</view> </view>
<!-- 内容 --> <!-- 分类区域 -->
<view class="wholeSale-con" style="padding-top: calc(var(--status-bar-height) + 100rpx);"> <view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav"> <view class="wholeSale-nav">
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> -->
<!-- 搜索 -->
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)" <view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)"
hover-class="none" class="search_content flex_a_c_j_sb"> hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap"> <view class="flex_a_c search_content_wrap">
@ -225,7 +260,6 @@
<input type="text" placeholder="搜索商品名称" :value="where.keyword" <input type="text" placeholder="搜索商品名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;"> placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view> </view>
<!-- <button class="search_btn">搜索</button> -->
</view> </view>
</view> </view>
@ -247,6 +281,11 @@
</block> </block>
</view> </view>
</scroll-view> </scroll-view>
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
<view style="margin-bottom: 20rpx;">全部</view>
<u-icon name="list"></u-icon>
</view>
</view> </view>
<!-- 商品小分类 --> <!-- 商品小分类 -->
@ -262,26 +301,44 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- 综合查询 -->
<!-- <view class="comprehensive">
<view class="comprehensive-price">
<text>价格</text>
<image src="@/static/new_define/priceChange.png"></image>
</view>
<view class="comprehensive-sales_num">
<text>销量</text>
</view>
<view class="comprehensive-discount">
<text>抵扣</text>
<image class="loudou" src="@/static/new_define/loudou.png"></image>
</view>
</view> -->
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading"></loadmore>
</view> </view>
<!-- 内容 -->
<view class="wholeSale-con"
:style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx '+(isShowSmall?' - 48rpx':'')+')'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
@scrolltoupper="scrolltoupper" :refresher-threshold="0">
<view>
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading" style="margin-bottom:20rpx ;"></loadmore>
</view>
</scroll-view>
</view>
<!-- 弹框大分类 -->
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
<view class="popup-wrap">
<view style="height: var(--status-bar-height);"></view>
<view class="popup-wrap-title">分类</view>
<view class="popup-wrap-category">
<view class="popup-wrap-category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="popup-wrap-category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="popup-wrap-category-item-img" width="108rpx" :src="item.pic"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="popup-wrap-category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -310,27 +367,60 @@
page: 1, page: 1,
limit: 20, limit: 20,
mer_type: 1, //1-, 2-, 3- mer_type: 1, //1-, 2-, 3-
mer_cate_id: '', cate_pid: '',
keyword: '', keyword: '',
deduction_rate: '', // deduction_rate: '', //
rand: 1 rand: 1
} },
wrapHeight: 300,
isShowSmall: false,
scrollTop: 0,
} }
}, },
onLoad(option) { onLoad(option) {
this.getStoreCategory(); this.getStoreCategory();
this.getProductslist(true); this.getProductslist(true);
}, },
onReachBottom() {
this.getProductslist(); onPageScroll(e) {
},
onPageScroll() {
uni.$emit('scroll'); uni.$emit('scroll');
}, },
onPullDownRefresh() {
this.getProductslist(true); watch: {
'where.cate_pid'(newVal, oldVal) {
if (newVal && !oldVal) {
this.wrapHeight = 300 + 48;
this.isShowSmall = true;
}
if (!newVal && oldVal) {
this.wrapHeight = 300;
this.isShowSmall = false;
}
}
}, },
methods: { methods: {
onAllCategory() {
this.$refs.popup.open();
},
scrolltoupper() {
this.getProductslist(true);
},
onScrollBottom(e) {
this.getProductslist();
},
onScroll(e) {
if (this.scrollTop >= e.target.scrollTop) { //
this.wrapHeight = 300;
if (this.where.cate_pid) this.wrapHeight = this.wrapHeight + 48;
} else {
this.wrapHeight = 0;
}
this.scrollTop = e.target.scrollTop;
},
navTo(url) { navTo(url) {
uni.navigateTo({ uni.navigateTo({
url: url, url: url,
@ -344,12 +434,11 @@
} }
}) })
}, },
navBack() { navBack() {
uni.navigateBack(); uni.navigateBack();
}, },
tabsChange(e) {
this.tabsCurr = e;
},
changeCate(e) { changeCate(e) {
this.cate_change = e; this.cate_change = e;
this.store_category_children = []; this.store_category_children = [];
@ -359,13 +448,15 @@
store_category_id: '' store_category_id: ''
}) })
this.cate_change_children = 0; this.cate_change_children = 0;
this.where.mer_cate_id = this.store_category[e].store_category_id; this.where.cate_pid = this.store_category[e].store_category_id;
this.getProductslist(true); this.getProductslist(true);
this.$refs.popup && this.$refs.popup.close();
}, },
changeChildrenCate(e) { changeChildrenCate(e) {
this.cate_change_children = e; this.cate_change_children = e;
this.where.mer_cate_id = this.store_category_children[e].store_category_id; this.where.cate_pid = this.store_category_children[e].store_category_id;
if (e == 0) this.where.mer_cate_id = this.store_category[this.cate_change] if (e == 0) this.where.cate_pid = this.store_category[this.cate_change]
.store_category_id; // , id .store_category_id; // , id
this.getProductslist(true); this.getProductslist(true);
}, },
@ -391,6 +482,7 @@
} }
if (this.isLoading == -1) return; if (this.isLoading == -1) return;
this.isLoading = 1; this.isLoading = 1;
getProductslist(this.where).then(res => { getProductslist(this.where).then(res => {
this.where.limit = res.data.limit this.where.limit = res.data.limit
this.where.page = res.data.page this.where.page = res.data.page

File diff suppressed because it is too large Load Diff

View File

@ -1,238 +1,36 @@
<style lang="scss" scoped>
page {
background-color: #f8fafb !important;
}
.wholeSale {
background-color: #f8fafb !important;
.wholeSale-header {
margin-bottom: 20rpx;
// background-color: #40AE36;
.scrollview {
display: flex;
align-items: center;
height: 98rpx;
padding-left: 32rpx;
.scrollview-item {
margin-right: 30rpx;
font-size: 28rpx;
color: #FFFFFF;
}
.scrollview-active {
position: relative;
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
&::after {
content: "";
display: inline-block;
position: absolute;
bottom: -6rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 6rpx;
background-color: #FFFFFF;
}
}
}
}
.wholeSale-con {
margin: 0 20rpx;
.wholeSale-nav{
display: flex;
align-items: center;
margin-bottom: 40rpx;
.icon{
margin-right: 20rpx;
}
}
.search_content {
// margin-bottom: 40rpx;
flex: 1;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 80rpx;
background: #EDEFF2;
position: relative;
box-sizing: border-box;
.search_content_wrap {
width: 100%;
.icon-sousuo {
font-size: 26.32rpx;
font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
}
input {
width: 80%;
}
}
.search_btn {
width: 106rpx;
height: 60rpx;
line-height: 60rpx;
pic: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
}
}
.category {
width: 100%;
overflow: auto;
margin-bottom: 20rpx;
.category-wrap {
display: flex;
padding-bottom: 20rpx;
.category-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 38rpx;
text {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
white-space: nowrap;
}
.category-item-text {
width: 120rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.category-item-active {
position: relative;
.category-item-img {
border: 2px solid #40AE36;
border-radius: 50%;
}
text {
background-color: #40AE36;
color: #fff;
padding: 2rpx 10rpx 6rpx 10rpx;
border-radius: 50rpx;
}
}
}
}
.cate {
width: 100%;
overflow: auto;
margin-bottom: 30rpx;
.cate-wrap {
display: flex;
padding-bottom: 8rpx;
.cate-item {
text {
padding: 4rpx 16rpx;
white-space: nowrap;
font-size: 30rpx;
color: #333;
}
}
.cate-item-active {
text {
color: #40AE36;
font-weight: bold;
}
}
}
}
.comprehensive {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50rpx;
[class^=comprehensive-] {
display: flex;
align-items: center;
text {
margin-right: 12rpx;
font-size: 26rpx;
color: #666666;
}
image {
width: 28rpx;
height: 28rpx;
}
.loudou {
width: 24rpx;
height: 24rpx;
}
}
}
}
}
</style>
<template> <template>
<view class="wholeSale"> <view class="wholeSale">
<!-- 适配不同机 -->
<!-- 顶部 --> <view class="wholeSale-header">
<view class="wholeSale-header" style="position: fixed;top: 0;left: 0;width: 100%;z-index: 999;">
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);background-color: #40af37;"></view> <view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;"> <view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
<view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;" name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>名优特产</view> <view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;"
</view> name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>名优特产</view>
</view>
</view> </view>
<!-- 内容 --> <view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-con" style="padding-top: calc(var(--status-bar-height) + 100rpx);"> <view class="wholeSale-nav">
<view class="wholeSale-nav"> <!-- 搜索 -->
<!-- <u-icon class="icon" name="arrow-left" size="20" @click="navBack"></u-icon> --> <view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)"
<!-- 搜索 --> hover-class="none" class="search_content flex_a_c_j_sb">
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)" hover-class="none" <view class="flex_a_c search_content_wrap">
class="search_content flex_a_c_j_sb"> <view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<view class="flex_a_c search_content_wrap"> <input type="text" placeholder="搜索商品名称" :value="where.keyword"
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view> placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
<input type="text" placeholder="搜索商品名称" :value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" </view>
disabled style="pointer-events: none;"> </view>
</view> </view>
<!-- <button class="search_btn">搜索</button> -->
</view>
</view>
<!-- 商品大分类 --> <!-- 商品大分类 -->
<view class="category"> <view class="category">
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="category-wrap"> <view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index"> <block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}" @click="changeCate(index)"> <view class="category-item" :class="{'category-item-active': index==cate_change}"
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx" shape="circle"> @click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
shape="circle">
<template v-slot:loading> <template v-slot:loading>
<u-loading-icon color="#999" size="15" /> <u-loading-icon color="#999" size="15" />
</template> </template>
@ -242,6 +40,11 @@
</block> </block>
</view> </view>
</scroll-view> </scroll-view>
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
<view style="margin-bottom: 20rpx;">全部</view>
<u-icon name="list"></u-icon>
</view>
</view> </view>
<!-- 商品小分类 --> <!-- 商品小分类 -->
@ -249,33 +52,52 @@
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="cate-wrap"> <view class="cate-wrap">
<block v-for="(item,index) in store_category_children" :key="index"> <block v-for="(item,index) in store_category_children" :key="index">
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}" @click="changeChildrenCate(index)"> <view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
@click="changeChildrenCate(index)">
<text>{{item.cate_name}}</text> <text>{{item.cate_name}}</text>
</view> </view>
</block> </block>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<!-- 综合查询 -->
<!-- <view class="comprehensive">
<view class="comprehensive-price">
<text>价格</text>
<image src="@/static/new_define/priceChange.png"></image>
</view>
<view class="comprehensive-sales_num">
<text>销量</text>
</view>
<view class="comprehensive-discount">
<text>抵扣</text>
<image class="loudou" src="@/static/new_define/loudou.png"></image>
</view>
</view> -->
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading"></loadmore>
</view> </view>
<!-- 内容 -->
<view class="wholeSale-con" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx )'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
@scrolltoupper="scrolltoupper" :refresher-threshold="0">
<view>
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading"></loadmore>
</view>
</scroll-view>
</view>
<!-- 弹框大分类 -->
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
<view class="popup-wrap">
<view style="height: var(--status-bar-height);"></view>
<view class="popup-wrap-title">分类</view>
<view class="popup-wrap-category">
<view class="popup-wrap-category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="popup-wrap-category-item"
:class="{'popup-wrap-category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="popup-wrap-category-item-img" width="108rpx" :src="item.pic"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="popup-wrap-category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -284,108 +106,145 @@
goShopDetail goShopDetail
} from '@/libs/order.js' } from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue' import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import { import {
getCategoryIndexList, getCategoryIndexList,
getProductslist getProductslist
} from "@/api/store.js" } from "@/api/store.js"
export default { export default {
components: { components: {
WaterfallsFlow WaterfallsFlow
}, },
data() { data() {
return { return {
hostProduct: [], hostProduct: [],
store_category: [], // store_category: [], //
store_category_children: [], // store_category_children: [], //
cate_change: 0, cate_change: 0,
cate_change_children: 0, cate_change_children: 0,
isLoading: 0, isLoading: 0,
where: { where: {
page: 1, page: 1,
limit: 20, limit: 20,
cate_pid: '', cate_pid: '',
keyword: '', keyword: '',
mer_type: 3, //1-, 2-, 3- mer_type: 3, //1-, 2-, 3-
sale_type: 1, //1-, 2- sale_type: 1, //1-, 2-
} },
wrapHeight: 300,
scrollTop: 0,
} }
}, },
onLoad(option){ onLoad(option) {
this.getCategoryIndexList(); this.getCategoryIndexList();
this.getProductslist(true); this.getProductslist(true);
}, },
onReachBottom() { onReachBottom() {
this.getProductslist(); // this.getProductslist();
}, },
onPageScroll() { onPageScroll() {
uni.$emit('scroll'); uni.$emit('scroll');
}, },
onPullDownRefresh() {
// this.getProductslist(true);
},
methods: { methods: {
navTo(url){ onAllCategory() {
uni.navigateTo({ this.$refs.popup.open();
url:url, },
success: () => {
uni.$once('searchValue', (e)=>{ scrolltoupper() {
this.$nextTick(()=>{ this.getProductslist(true);
this.where.keyword = e; },
this.getProductslist(true);
}) onScrollBottom(e) {
}) this.getProductslist();
} },
})
}, onScroll(e) {
navBack(){ if (this.scrollTop >= e.target.scrollTop) { //
uni.navigateBack(); this.wrapHeight = 300;
}, } else {
tabsChange(e) { this.wrapHeight = 0;
this.tabsCurr = e; }
this.scrollTop = e.target.scrollTop;
},
navTo(url) {
uni.navigateTo({
url: url,
success: () => {
uni.$once('searchValue', (e) => {
this.$nextTick(() => {
this.where.keyword = e;
this.getProductslist(true);
})
})
}
})
},
navBack() {
uni.navigateBack();
},
changeCate(e) {
this.cate_change = e;
this.store_category_children = [{
cate_name: '全部',
store_category_id: ''
}];
if (this.store_category[e].children) this.store_category_children = [...this.store_category_children, ...
this.store_category[e].children
];
this.cate_change_children = 0;
this.where.cate_pid = this.store_category[e].store_category_id;
this.getProductslist(true);
this.$refs.popup && this.$refs.popup.close();
this.$forceUpdate();
},
changeChildrenCate(e) {
this.cate_change_children = e;
this.where.cate_pid = this.store_category_children[e].store_category_id;
if (e == 0) this.where.cate_pid = this.store_category[this.cate_change]
.store_category_id; // , id
this.getProductslist(true);
},
getCategoryIndexList() {
getCategoryIndexList({
mer_type: this.where.mer_type,
sale_type: this.where.sale_type
}).then(res => {
this.store_category = [{
cate_name: '全部',
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png',
store_category_id: ''
}, ...res.data];
this.store_category_children = this.store_category[0].children || [];
this.store_category_children.unshift({
cate_name: '全部',
store_category_id: ''
})
})
},
getProductslist(reLoad = false) {
if (reLoad) {
this.where.page = 1;
this.hostProduct = [];
this.isLoading = 0;
}
if (this.isLoading == -1) return;
this.isLoading = 1;
getProductslist(this.where).then(res => {
uni.stopPullDownRefresh();
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.where.page++;
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
}).catch(() => {
uni.stopPullDownRefresh();
})
}, },
changeCate(e){
this.cate_change = e;
this.store_category_children = [{
cate_name: '全部',
store_category_id: ''
}];
if(this.store_category[e].children) this.store_category_children = [...this.store_category_children, ...this.store_category[e].children];
this.cate_change_children = 0;
this.where.cate_pid = this.store_category[e].store_category_id;
this.getProductslist(true);
},
changeChildrenCate(e){
this.cate_change_children = e;
this.where.cate_pid = this.store_category_children[e].store_category_id;
if(e==0) this.where.cate_pid = this.store_category[this.cate_change].store_category_id; // , id
this.getProductslist(true);
},
getCategoryIndexList(){
getCategoryIndexList({mer_type: this.where.mer_type, sale_type: this.where.sale_type}).then(res=>{
this.store_category = [{
cate_name: '全部',
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png',
store_category_id: ''
}, ...res.data];
this.store_category_children = this.store_category[0].children || [];
this.store_category_children.unshift({
cate_name: '全部',
store_category_id: ''
})
})
},
getProductslist(reLoad=false){
if(reLoad){
this.where.page = 1;
this.hostProduct = [];
this.isLoading = 0;
}
if(this.isLoading==-1)return;
this.isLoading = 1;
getProductslist(this.where).then(res=>{
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.where.page++;
this.isLoading = 0;
if(res.data.list.length<this.where.limit) this.isLoading = -1;
})
},
goDetail(item) { goDetail(item) {
goShopDetail(item, this.uid).then(res => { goShopDetail(item, this.uid).then(res => {
if (this.isLogin) { if (this.isLogin) {
@ -409,3 +268,215 @@
} }
} }
</script> </script>
<style lang="scss" scoped>
page {
background-color: #f8fafb !important;
}
.wholeSale {
.wholeSale-header {
position: sticky;
top: 0;
z-index: 90;
background-color: #40AE36;
}
.wholeSale-section {
position: sticky;
top: calc(82rpx + var(--status-bar-height));
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .5s;
overflow: hidden;
margin-bottom: 20rpx;
padding-top: 20rpx;
z-index: 20;
.wholeSale-nav {
display: flex;
align-items: center;
margin-bottom: 40rpx;
.icon {
margin-right: 20rpx;
}
.search_content {
flex: 1;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 80rpx;
background: #EDEFF2;
position: relative;
box-sizing: border-box;
.search_content_wrap {
width: 100%;
.icon-sousuo {
font-size: 26.32rpx;
font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
}
input {
width: 80%;
}
}
.search_btn {
width: 106rpx;
height: 60rpx;
line-height: 60rpx;
pic: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
}
}
}
.category {
position: relative;
width: 100%;
overflow: auto;
margin-bottom: 20rpx;
padding-right: 70rpx;
.category-wrap {
display: flex;
padding-bottom: 20rpx;
.category-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-right: 38rpx;
text {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
white-space: nowrap;
}
.category-item-text {
width: 120rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.category-item-active {
position: relative;
.category-item-img {
border: 2px solid #40AE36;
border-radius: 50%;
}
text {
background-color: #40AE36;
color: #fff;
padding: 2rpx 10rpx 6rpx 10rpx;
border-radius: 50rpx;
}
}
}
.category-all {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
height: 100%;
background-color: #f3f3f3;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: 24rpx;
border-radius: 4rpx;
width: 70rpx;
color: #919191;
}
}
}
.popup-wrap {
background-color: #fff;
padding: 20rpx;
.popup-wrap-title {
font-size: 36rpx;
color: #333;
font-weight: bold;
margin-bottom: 20rpx;
}
.popup-wrap-category {
width: 100%;
.popup-wrap-category-wrap {
display: flex;
flex-wrap: wrap;
.popup-wrap-category-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin: 0 20rpx 20rpx 0;
&:nth-child(5n) {
margin-right: 0;
}
text {
margin-top: 16rpx;
font-size: 24rpx;
color: #666666;
white-space: nowrap;
}
.popup-wrap-category-item-text {
width: 120rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.popup-wrap-category-item-active {
position: relative;
.popup-wrap-category-item-img {
border: 2px solid #40AE36;
border-radius: 50%;
}
text {
background-color: #40AE36;
color: #fff;
padding: 2rpx 10rpx 6rpx 10rpx;
border-radius: 50rpx;
}
}
}
}
}
.wholeSale-con {
padding-bottom: 30rpx;
margin: 0 20rpx;
}
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
<template>
<view class="">
<video :src="url" style="width: 750rpx;height: 1400rpx;" :autoplay='true' id="myvideo" controls></video>
</view>
</template>
<script>
export default {
data() {
return {
url: ""
}
},
methods: {
videoPlay() {
console.log("开始播放了")
},
videoShow() {
this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 必传
this.videoUrl = this.url;
this.videoContext.requestFullScreen({
// direction: 90
});
this.videoContext.play();
this.videoPlay = true; // 显示播放盒子
}
},
onLoad(option) {
this.url = option.url
setTimeout(() => {
this.videoShow()
})
}
}
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

View File

@ -29,11 +29,6 @@
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
<!-- <view class="dots" :class="'dot'+txtStyle">
<block v-for="(item,index) in imgUrls" :key="index">
<view class="dot" :class="[docConfig == 1 ? 'square' : docConfig == 0 ? 'circular' : 'nodoc',index == swiperCur ? ' active' : '']"></view>
</block>
</view> -->
</view> </view>
</block> </block>
</view> </view>

View File

@ -3,19 +3,27 @@
<!-- #ifdef MP || APP-PLUS --> <!-- #ifdef MP || APP-PLUS -->
<view style="visibility: hidden;" :style="{ height: navHeight + 'rpx' }" v-if="isFixed"></view> <view style="visibility: hidden;" :style="{ height: navHeight + 'rpx' }" v-if="isFixed"></view>
<!-- #endif --> <!-- #endif -->
<view class="navTabBox tabNav" :class="{isFixed:isFixed}" :style="'background:'+bgColor+';margin-top:'+mbConfig+'rpx;color:'+txtColor+';top:'+isTop"> <view class="navTabBox tabNav" :class="{isFixed:isFixed}"
:style="'background:'+bgColor+';margin-top:'+mbConfig+'rpx;color:'+txtColor+';top:'+isTop">
<view class="longTab" :style='"width:"+mainWidth+"px"'> <view class="longTab" :style='"width:"+mainWidth+"px"'>
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation :scroll-left="tabLeft" show-scrollbar="true"> <scroll-view scroll-x="true" style="white-space: nowrap; display: flex;" scroll-with-animation
<view class="longItem" :style="'width:'+isWidth+'px;color:'+(index===tabClick ? activeColor : txtColor)" :data-index="index" :class="index===tabClick?'click':''" v-for="(item,index) in tabTitle" :key="index" :id="'id'+index" @click="longClick(index,item.store_category_id,item.pid)">{{item.cate_name}}</view> :scroll-left="tabLeft" show-scrollbar="true">
<view class="longItem"
:style="'width:'+isWidth+'px;color:'+(index===tabClick ? activeColor : txtColor)"
:data-index="index" :class="index===tabClick?'click':''" v-for="(item,index) in tabTitle"
:key="index" :id="'id'+index" @click="longClick(index,item.store_category_id,item.pid)">
{{item.cate_name}}</view>
<view class="underlineBox" :style='"transform:translateX("+isLeft+"px);width:"+isWidth+"px"'> <view class="underlineBox" :style='"transform:translateX("+isLeft+"px);width:"+isWidth+"px"'>
<view class="underline" :style="'background-color:'+activeColor"></view> <view class="underline" :style="'background-color:'+activeColor"></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<navigator v-if="merId" :url="'/pages/store/home/index?id='+merId+'&type=2'" class="category" hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor"> <navigator v-if="merId" :url="'/pages/store/home/index?id='+merId+'&type=2'" class="category"
hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
<text class="iconfont icon-fenlei3"></text>分类 <text class="iconfont icon-fenlei3"></text>分类
</navigator> </navigator>
<navigator v-else open-type='switchTab' url="/pages/goods_cate/goods_cate" class="category" hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor"> <navigator v-else open-type='switchTab' url="/pages/goods_cate/goods_cate" class="category"
hover-class="none" :style="'background-color:'+bgColor+';color:'+txtColor">
<text class="iconfont icon-fenlei3"></text>分类 <text class="iconfont icon-fenlei3"></text>分类
</navigator> </navigator>
</view> </view>
@ -32,7 +40,9 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { getCateData } from '@/api/api.js'; import {
getCateData
} from '@/api/api.js';
let app = getApp(); let app = getApp();
export default { export default {
name: 'navTab', name: 'navTab',
@ -61,13 +71,13 @@
isLeft: 0, //线 isLeft: 0, //线
isWidth: 0, // isWidth: 0, //
mainWidth: 0, mainWidth: 0,
tabLeft:0, tabLeft: 0,
swiperIndex:0, swiperIndex: 0,
childIndex:0, childIndex: 0,
childID:0, childID: 0,
bgColor:this.dataConfig.bgColor.color[0].item, bgColor: this.dataConfig.bgColor.color[0].item,
mbConfig:this.dataConfig.mbConfig.val * 2, mbConfig: this.dataConfig.mbConfig.val * 2,
txtColor:this.dataConfig.txtColor.color[0].item, txtColor: this.dataConfig.txtColor.color[0].item,
activeColor: this.dataConfig.activeColor.color[0].item, activeColor: this.dataConfig.activeColor.color[0].item,
fixedTop: 0, fixedTop: 0,
isTop: 0, isTop: 0,
@ -76,12 +86,12 @@
unique: this.dataConfig.timestamp, unique: this.dataConfig.timestamp,
}; };
}, },
watch:{ watch: {
// #ifdef MP || APP-PLUS // #ifdef MP || APP-PLUS
isFixed(nVal,oVal){ isFixed(nVal, oVal) {
if(nVal){ if (nVal) {
this.isTop = (uni.getSystemInfoSync().statusBarHeight + 43) + 'px' this.isTop = (uni.getSystemInfoSync().statusBarHeight + 43) + 'px'
}else{ } else {
this.isTop = 0 this.isTop = 0
} }
} }
@ -94,7 +104,7 @@
uni.getSystemInfo({ uni.getSystemInfo({
success(e) { success(e) {
that.mainWidth = e.windowWidth that.mainWidth = e.windowWidth
that.isWidth = (e.windowWidth-65) / 4 that.isWidth = (e.windowWidth - 65) / 4
} }
}) })
setTimeout((e) => { setTimeout((e) => {
@ -120,7 +130,7 @@
}, },
methods: { methods: {
getCateData(){ getCateData() {
getCateData({ getCateData({
diy_id: this.diy_id, diy_id: this.diy_id,
unique: this.unique, unique: this.unique,
@ -132,36 +142,36 @@
}); });
}, },
// //
longClick(index,id,fid){ longClick(index, id, fid) {
app.globalData.fid = fid; app.globalData.fid = fid;
this.childIndex = 0; this.childIndex = 0;
if(this.tabTitle.length>3){ if (this.tabTitle.length > 3) {
var tempIndex = index - 2; var tempIndex = index - 2;
tempIndex = tempIndex<=0 ? 0 : tempIndex; tempIndex = tempIndex <= 0 ? 0 : tempIndex;
this.tabLeft = (index-2) * this.isWidth //线 this.tabLeft = (index - 2) * this.isWidth //线
} }
this.tabClick = index // this.tabClick = index //
this.isLeft = index * this.isWidth //线 this.isLeft = index * this.isWidth //线
let obj = { let obj = {
index:index, index: index,
pid:id//id pid: id //id
} }
if(!this.merId){ if (!this.merId) {
this.parentEmit(obj); this.parentEmit(obj);
}else{ } else {
if(id){ if (id) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/store/list/index?id='+id+'&mer_id='+this.merId url: '/pages/store/list/index?id=' + id + '&mer_id=' + this.merId
}); });
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/store/home/index?id='+this.merId url: '/pages/store/home/index?id=' + this.merId
}); });
} }
} }
}, },
parentEmit(obj){ parentEmit(obj) {
this.$emit('changeTab', obj); this.$emit('changeTab', obj);
} }
} }
@ -172,11 +182,13 @@
.tabNav { .tabNav {
padding-top: 10rpx; padding-top: 10rpx;
} }
.navTabBox { .navTabBox {
width: 100%; width: 100%;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
position: relative; position: relative;
padding-bottom: 10rpx; padding-bottom: 10rpx;
&.isFixed { &.isFixed {
z-index: 10; z-index: 10;
position: fixed; position: fixed;
@ -186,17 +198,20 @@
top: 0; top: 0;
/* #endif */ /* #endif */
} }
.click { .click {
color: white; color: white;
} }
.longTab { .longTab {
/* #ifdef H5 */ /* #ifdef H5 */
padding-right: 106rpx; padding-right: 106rpx;
/* #endif */ /* #endif */
/* #ifdef MP || APP-PLUS */ /* #ifdef MP || APP-PLUS */
padding-right: 116rpx; padding-right: 116rpx;
/* #endif */ /* #endif */
.longItem{ .longItem {
height: 50upx; height: 50upx;
display: inline-block; display: inline-block;
line-height: 50upx; line-height: 50upx;
@ -207,12 +222,14 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
&.click{
&.click {
font-weight: bold; font-weight: bold;
font-size: 30rpx; font-size: 30rpx;
color: #E93323; color: #E93323;
} }
} }
.underlineBox { .underlineBox {
height: 3px; height: 3px;
width: 20%; width: 20%;
@ -220,13 +237,20 @@
align-content: center; align-content: center;
justify-content: center; justify-content: center;
transition: .5s; transition: .5s;
.underline { .underline {
width: 33rpx; width: 33rpx;
height: 4rpx; height: 4rpx;
} }
} }
} }
.category{
.category_wrap {
transition: height .4s;
overflow: hidden;
}
.category {
position: absolute; position: absolute;
right: 0; right: 0;
top: 10rpx; top: 10rpx;
@ -243,13 +267,15 @@
line-height: 50upx; line-height: 50upx;
z-index: 3; z-index: 3;
padding: 0 15rpx 0 25rpx; padding: 0 15rpx 0 25rpx;
.iconfont{
.iconfont {
font-size: 30rpx; font-size: 30rpx;
margin-right:6rpx; margin-right: 6rpx;
} }
} }
} }
.child-box{
.child-box {
width: 100%; width: 100%;
position: relative; position: relative;
background-color: #fff; background-color: #fff;
@ -258,37 +284,43 @@
/* #endif */ /* #endif */
/* #ifdef MP */ /* #ifdef MP */
box-shadow: 0 2rpx 3rpx 1rpx #f9f9f9; box-shadow: 0 2rpx 3rpx 1rpx #f9f9f9;
/* #endif */ /* #endif */
.wrapper{ .wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 20rpx 0; padding: 20rpx 0;
background: #fff; background: #fff;
} }
.child-item{
.child-item {
flex-shrink: 0; flex-shrink: 0;
width:140rpx; width: 140rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-left: 10rpx; margin-left: 10rpx;
image{
image {
width: 90rpx; width: 90rpx;
height: 90rpx; height: 90rpx;
border-radius: 50%; border-radius: 50%;
} }
.txt{
.txt {
font-size: 24rpx; font-size: 24rpx;
color: #282828; color: #282828;
text-align: center; text-align: center;
margin-top: 10rpx; margin-top: 10rpx;
} }
&.on{
image{ &.on {
image {
border: 1px solid $theme-color-opacity; border: 1px solid $theme-color-opacity;
} }
.txt{
.txt {
color: $theme-color; color: $theme-color;
} }
} }

View File

@ -12,7 +12,6 @@
<homeComb v-if="smallPage" class="home-comb" :isScale="isScale" :isMenu="isMenu" <homeComb v-if="smallPage" class="home-comb" :isScale="isScale" :isMenu="isMenu"
:dataConfig="homeCombData" :userInfo="userInfo" :isFixed="isFixed" :isScrolled="isScrolled" :dataConfig="homeCombData" :userInfo="userInfo" :isFixed="isFixed" :isScrolled="isScrolled"
@changeDiy="changeDiy"></homeComb> @changeDiy="changeDiy"></homeComb>
<!-- <card></card> -->
<view v-for="(item, index) in styleConfig" :key="index"> <view v-for="(item, index) in styleConfig" :key="index">
<block <block
v-if="item.name != 'headerSerch' && item.name != 'tabNav' && item.name != 'shopList' && item.name != 'homeComb' && item.name != 'hotRanking' && item.name != 'pageFoot'"> v-if="item.name != 'headerSerch' && item.name != 'tabNav' && item.name != 'shopList' && item.name != 'homeComb' && item.name != 'hotRanking' && item.name != 'pageFoot'">
@ -39,12 +38,33 @@
<hotRanking :dataConfig="item"></hotRanking> <hotRanking :dataConfig="item"></hotRanking>
</block> </block>
</view> </view>
<view class="main" v-show="navIndex == 0">
<!-- 首页推荐 -->
<view v-if="recommend_switch == 1" class="index-product-wrapper">
<!-- 首发新品 -->
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
:loading="loading">
</recommend>
<view class="loadingicon acea-row row-center-wrapper"
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
<text class="loading iconfont icon-jiazai"
:hidden="hotLoading[hostIndex] == false"></text>
{{ hotTitle }}
</view>
</view>
</view>
<view v-show="navIndex == 0" class="loadingicon acea-row row-center-wrapper"
v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
{{ loadTitle }}
</view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP || APP-PLUS --> <!-- #ifdef MP || APP-PLUS -->
<homeComb class="home-comb" v-if="smallPage" :isScale="isScale" :isMenu="isMenu" <homeComb class="home-comb" v-if="smallPage" :isScale="isScale" :isMenu="isMenu"
:dataConfig="homeCombData" :isFixed="isFixed" :isScrolled="isScrolled" :userInfo="userInfo" :dataConfig="homeCombData" :isFixed="isFixed" :isScrolled="isScrolled" :userInfo="userInfo"
@changeDiy="changeDiy" @bindHeight="bindHeighta"></homeComb> @changeDiy="changeDiy" @bindHeight="bindHeighta"></homeComb>
<!-- <card></card> -->
<block v-for="(item, index) in styleConfig" :key="index"> <block v-for="(item, index) in styleConfig" :key="index">
<view v-show="navIndex == 0"> <view v-show="navIndex == 0">
<homeComb v-if="item.name == 'homeComb' && !smallPage" :isMenu="isMenu" :dataConfig="item" <homeComb v-if="item.name == 'homeComb' && !smallPage" :isMenu="isMenu" :dataConfig="item"
@ -82,11 +102,10 @@
<tabNav v-if="item.name == 'tabNav'" :dataConfig="item" class="tabNav" :tabTitle="navTop" <tabNav v-if="item.name == 'tabNav'" :dataConfig="item" class="tabNav" :tabTitle="navTop"
@bindHeight="bindHeighta" @changeTab="changeTab" :isFixed="isFixed"></tabNav> @bindHeight="bindHeighta" @changeTab="changeTab" :isFixed="isFixed"></tabNav>
</block> </block>
<!-- #endif -->
<view class="main" v-show="navIndex == 0"> <!-- 首页推荐 -->
<!-- 首页推荐 --> <view class="main">
<view v-if="recommend_switch == 1" class="index-product-wrapper"> <view class="index-product-wrapper">
<!-- 首发新品 --> <!-- 首发新品 -->
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]" <recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin" @changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
@ -100,11 +119,12 @@
</view> </view>
</view> </view>
</view> </view>
<view v-show="navIndex == 0" class="loadingicon acea-row row-center-wrapper" <view class="loadingicon acea-row row-center-wrapper"
v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'"> v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text> <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
{{ loadTitle }} {{ loadTitle }}
</view> </view>
<!-- #endif -->
</block> </block>
<!-- 分类页 --> <!-- 分类页 -->
<view class="productList" v-if="navIndex > 0"> <view class="productList" v-if="navIndex > 0">
@ -654,13 +674,17 @@
}, },
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.overflow = true; // this.overflow = true;
this.reconnect(); // this.reconnect();
// that.overflow = true;
// #ifdef APP-PLUS // #ifdef APP-PLUS
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ this.hotPage = 1;
url: "/pages/index/index" this.hotScroll = true;
}); let hostList = this.hostProduct;
hostList[this.hostIndex] = [];
this.$set(this, 'hostProduct', hostList);
this.loadGoods(this.hostIndex + 1);
}, 50) }, 50)
// #endif // #endif
}, },
@ -1043,21 +1067,19 @@
if (that.loading || that.loadend) return; if (that.loading || that.loadend) return;
that.loading = true; that.loading = true;
that.loadTitle = ''; that.loadTitle = '';
getProductslist(that.where) getProductslist(that.where).then(res => {
.then(res => { let list = res.data.list;
let list = res.data.list; let productList = that.$util.SplitArray(list, that.sortProduct);
let productList = that.$util.SplitArray(list, that.sortProduct); let loadend = list.length < that.where.limit;
let loadend = list.length < that.where.limit; that.loadend = loadend;
that.loadend = loadend; that.loading = false;
that.loading = false; that.loadTitle = loadend ? '已全部加载' : '加载更多';
that.loadTitle = loadend ? '已全部加载' : '加载更多'; that.$set(that, 'sortProduct', productList);
that.$set(that, 'sortProduct', productList); that.$set(that.where, 'page', that.where.page + 1);
that.$set(that.where, 'page', that.where.page + 1); }).catch(err => {
}) that.loading = false;
.catch(err => { that.loadTitle = '加载更多';
that.loading = false; });
that.loadTitle = '加载更多';
});
}, },
/** /**
* 点击组件选项卡 * 点击组件选项卡
@ -1072,16 +1094,21 @@
this.loadGoods(e); this.loadGoods(e);
}, },
loadGoods(e = 1) { loadGoods(e = 1) {
if (e == 1) return this.get_host_product(0);
if (e == 2) return this.get_host_home({ console.log(e);
mer_type: 1
}, 1); this.$nextTick(() => {
if (e == 3) return this.get_host_home({ if (e == 1) return this.get_host_product(0);
mer_type: 2 if (e == 2) return this.get_host_home({
}, 2); mer_type: 1
if (e == 4) return this.get_host_home({ }, 1);
mer_type: 3 if (e == 3) return this.get_host_home({
}, 3); mer_type: 2
}, 2);
if (e == 4) return this.get_host_home({
mer_type: 3
}, 3);
})
}, },
/** /**
* 获取我的推荐 * 获取我的推荐
@ -1091,9 +1118,11 @@
let num = that.hotLimit; let num = that.hotLimit;
if (!that.hotScroll) return; if (!that.hotScroll) return;
if (that.hotLoading[e]) return; if (that.hotLoading[e]) return;
that.hotLoading[e] = true; that.hotLoading[e] = true;
that.hotTitle = '加载中'; that.hotTitle = '加载中';
getProductHot(that.hotPage, that.hotLimit, 1, 1).then(res => { getProductHot(that.hotPage, that.hotLimit, 1, 1).then(res => {
uni.stopPullDownRefresh();
res.data.list = this.shuffleArray(res.data.list); res.data.list = this.shuffleArray(res.data.list);
let list = res.data.list; let list = res.data.list;
let productList = that.hostProduct; let productList = that.hostProduct;
@ -1128,6 +1157,7 @@
getProductslist({ getProductslist({
...query ...query
}).then(res => { }).then(res => {
uni.stopPullDownRefresh();
res.data.list = this.shuffleArray(res.data.list); res.data.list = this.shuffleArray(res.data.list);
let list = res.data.list; let list = res.data.list;
let productList = that.hostProduct; let productList = that.hostProduct;

View File

@ -44,7 +44,7 @@
<navigator <navigator
:url="hide_mer_status == 0 ? `/pages/store/home/index?id=${item.mer_id}&sale_type=${tabsCurr}` : '#'" :url="hide_mer_status == 0 ? `/pages/store/home/index?id=${item.mer_id}&sale_type=${tabsCurr}` : '#'"
class="info"> class="info">
<view class="name">{{item.mer_name}}</view> <view class="name line1" style="max-width: 450rpx;">{{item.mer_name}}</view>
<text class="iconfont icon-xiangyou" style="font-weight: bold;"></text> <text class="iconfont icon-xiangyou" style="font-weight: bold;"></text>
</navigator> </navigator>
</view> </view>
@ -88,13 +88,11 @@
</view> </view>
<view class='money acea-row row-middle'> <view class='money acea-row row-middle'>
<view> <view class="line1" style="max-width: 260rpx;">
<text class="money-price">{{goods.productAttr.price}}</text> <text class="money-price">{{goods.productAttr.price}}</text>
<text class="money-unit">/</text> <text
class="money-unit">/{{goods.productAttr.sku || goods.product.unit_name}}</text>
</view> </view>
<!-- <view v-if="goods.productAttr.show_svip_price" class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image>
</view> -->
</view> </view>
</view> </view>
<view class='carnum acea-row row-center-wrapper'> <view class='carnum acea-row row-center-wrapper'>
@ -180,8 +178,8 @@
@ChangCouponsUseState="ChangCouponsUseState"></couponListWindow> @ChangCouponsUseState="ChangCouponsUseState"></couponListWindow>
</block> </block>
<!-- 组件 --> <!-- 组件 -->
<addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" <addcartWindow :key="addcartKey" :attr="attr" :isShow='1' :iSplus='1' :destri='1' @myevent="onMyEvent"
@goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow> @ChangeAttr="ChangeAttr" @goCat="goCat" @attrVal="attrVal" id='product-window'></addcartWindow>
<Authorize :isShowAuth="isShowAuth"></Authorize> <Authorize :isShowAuth="isShowAuth"></Authorize>
<!--自定义底部tab栏--> <!--自定义底部tab栏-->
<customTab :newData="newData" :activeRouter="activeRouter"></customTab> <customTab :newData="newData" :activeRouter="activeRouter"></customTab>
@ -260,7 +258,7 @@
}], }],
tabsCurr: 1, tabsCurr: 1,
subsecCurr: 0, subsecCurr: 0,
addcartKey: 0, addcartKey: 0,
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
loading: false, // loading: false, //
loadend: false, // loadend: false, //
@ -306,7 +304,7 @@
currSku: '', currSku: '',
newData: {}, newData: {},
activeRouter: '', activeRouter: '',
attrTxt: '', attrTxt: '',
userInfo: {}, userInfo: {},
mer_info: { mer_info: {
mer_settlement_agree_status: 0 mer_settlement_agree_status: 0
@ -512,12 +510,12 @@
// // // //
// that.DefaultSelect(goods) // that.DefaultSelect(goods)
cartProductAttr(id).then(res => { cartProductAttr(id).then(res => {
if(res.data.attr.length==0)return Toast('此商品为单规格商品'); if (res.data.attr.length == 0) return Toast('此商品为单规格商品');
const sku = {}; const sku = {};
res.data.attrValue.forEach((itemn) => { res.data.attrValue.forEach((itemn) => {
if(this.tabsCurr==2) itemn.price = itemn.wholesale_price; // if (this.tabsCurr == 2) itemn.price = itemn.wholesale_price; //
sku[itemn.sku] = itemn; sku[itemn.sku] = itemn;
}) })
goods.attr = res.data.attr; goods.attr = res.data.attr;
goods.attrValue = res.data.attrValue goods.attrValue = res.data.attrValue
that.attrValue = goods.productAttr.sku that.attrValue = goods.productAttr.sku
@ -528,7 +526,7 @@
that.$set(that, 'productValue', sku); that.$set(that, 'productValue', sku);
let productSelect = sku[that.attrValue]; let productSelect = sku[that.attrValue];
that.isOpen = that.attr.cartAttr = true; that.isOpen = that.attr.cartAttr = true;
this.newVal = sku[goods.productAttr.sku] || Object.keys(sku)[0]; this.newVal = sku[goods.productAttr.sku] || Object.keys(sku)[0];
that.DefaultSelect(goods) that.DefaultSelect(goods)
}).catch(err => { }).catch(err => {
return that.$util.Tips({ return that.$util.Tips({

View File

@ -128,17 +128,19 @@
</view> </view>
<view class="merchant" v-if="orderInfo.merchant && orderInfo.order_type != 1" <view class="merchant" v-if="orderInfo.merchant && orderInfo.order_type != 1"
@click="goStore(orderInfo.mer_id)"> @click="goStore(orderInfo.mer_id)">
{{orderInfo.merchant.mer_name}} <text class="merchant_name line1">{{orderInfo.merchant.mer_name}}</text>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
<block v-if="cartInfo.length>0"> <block v-if="cartInfo.length>0">
<orderGoods :orderData='orderInfo' :pay_type="orderInfo.pay_type" :status="orderInfo.status" :evaluate='orderInfo.status' <orderGoods :orderData='orderInfo' :pay_type="orderInfo.pay_type" :status="orderInfo.status"
:activityType='orderInfo.activity_type' :sale_type="sale_type" :orderId="order_id" :cartInfo="cartInfo" :jump="true"> :evaluate='orderInfo.status' :activityType='orderInfo.activity_type' :sale_type="sale_type"
:orderId="order_id" :cartInfo="cartInfo" :jump="true">
</orderGoods> </orderGoods>
<block <block
v-if="orderInfo.order_type == 1 && orderInfo.takeOrderList && orderInfo.takeOrderList.length > 0" v-if="orderInfo.order_type == 1 && orderInfo.takeOrderList && orderInfo.takeOrderList.length > 0"
v-for="(item,index) in orderInfo.takeOrderList" :key="index"> v-for="(item,index) in orderInfo.takeOrderList" :key="index">
<orderGoods :orderData='item' :pay_type="orderInfo.pay_type" :status="orderInfo.status" :evaluate='item.status' :activityType='item.activity_type' :sale_type="sale_type" <orderGoods :orderData='item' :pay_type="orderInfo.pay_type" :status="orderInfo.status"
:evaluate='item.status' :activityType='item.activity_type' :sale_type="sale_type"
:orderId="item.order_id" :cartInfo="item.orderProduct" :jump="true"></orderGoods> :orderId="item.order_id" :cartInfo="item.orderProduct" :jump="true"></orderGoods>
</block> </block>
</block> </block>
@ -244,9 +246,9 @@
<view class='conter' v-if="orderInfo.pay_type==4 || orderInfo.pay_type==5">支付宝支付</view> <view class='conter' v-if="orderInfo.pay_type==4 || orderInfo.pay_type==5">支付宝支付</view>
<view class='conter' <view class='conter'
v-if="orderInfo.pay_type==1 || orderInfo.pay_type==2 || orderInfo.pay_type==3">微信支付</view> v-if="orderInfo.pay_type==1 || orderInfo.pay_type==2 || orderInfo.pay_type==3">微信支付</view>
<view class='conter' v-if="orderInfo.pay_type==11">微信收款</view> <view class='conter' v-if="orderInfo.pay_type==11">微信收款</view>
<view class='conter' v-if="orderInfo.pay_type==12">现金收款</view> <view class='conter' v-if="orderInfo.pay_type==12">现金收款</view>
<view class='conter' v-if="orderInfo.pay_type==13">支付宝收款</view> <view class='conter' v-if="orderInfo.pay_type==13">支付宝收款</view>
</view> </view>
<view class='item acea-row row-between' v-if="orderInfo.mark"> <view class='item acea-row row-between' v-if="orderInfo.mark">
<view>买家留言</view> <view>买家留言</view>
@ -286,10 +288,11 @@
<view>优惠券抵扣</view> <view>优惠券抵扣</view>
<view class='conter' style="color: #F55726;">-{{orderInfo.coupon_price}}</view> <view class='conter' style="color: #F55726;">-{{orderInfo.coupon_price}}</view>
</view> </view>
<view class='item acea-row row-between' v-if='orderInfo.platform_coupon_price > 0'> <view class='item acea-row row-between' v-if='orderInfo.platform_coupon_price > 0'>
<view>平台优惠抵扣</view> <view>平台优惠抵扣</view>
<view class='conter' style="width: auto;color: #F55726;">-{{orderInfo.platform_coupon_price}}</view> <view class='conter' style="width: auto;color: #F55726;">-{{orderInfo.platform_coupon_price}}
</view> </view>
</view>
<view class='item acea-row row-between' v-if='orderInfo.integral'> <view class='item acea-row row-between' v-if='orderInfo.integral'>
<view>积分抵扣</view> <view>积分抵扣</view>
<view class='conter'>-{{orderInfo.integral_price}}</view> <view class='conter'>-{{orderInfo.integral_price}}</view>
@ -511,7 +514,7 @@
invoice: false, invoice: false,
add: false, add: false,
}, },
sale_type: 1 sale_type: 1
}; };
}, },
computed: { computed: {
@ -534,7 +537,7 @@
onLoad: function(options) { onLoad: function(options) {
if (options.order_id) { if (options.order_id) {
this.$set(this, 'order_id', options.order_id); this.$set(this, 'order_id', options.order_id);
options.sale_type ? this.sale_type = options.sale_type : null; options.sale_type ? this.sale_type = options.sale_type : null;
} }
}, },
onShow() { onShow() {
@ -613,7 +616,7 @@
goStore(mer_id) { goStore(mer_id) {
if (this.hide_mer_status != 1) { if (this.hide_mer_status != 1) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/store/home/index?id=' + mer_id + '&sale_type=' + this.sale_type url: '/pages/store/home/index?id=' + mer_id + '&sale_type=' + this.sale_type
}) })
} }
}, },
@ -938,11 +941,12 @@
}) })
orderAgain({ orderAgain({
data: data, data: data,
sale_type: this.sale_type sale_type: this.sale_type
}).then(res => { }).then(res => {
let cart_id = res.data.cart_id.join(',') let cart_id = res.data.cart_id.join(',')
return uni.navigateTo({ return uni.navigateTo({
url: '/pages/users/order_confirm/index?cartId=' + cart_id + '&sale_type=' + this.sale_type url: '/pages/users/order_confirm/index?cartId=' + cart_id + '&sale_type=' +
this.sale_type
}); });
}).catch(err => { }).catch(err => {
that.$util.Tips({ that.$util.Tips({
@ -1054,6 +1058,7 @@
} }
.merchant { .merchant {
display: flex;
width: 100%; width: 100%;
height: 86rpx; height: 86rpx;
padding: 0 30rpx; padding: 0 30rpx;
@ -1065,6 +1070,12 @@
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
.merchant_name {
display: inline-block;
overflow: hidden;
max-width: 700rpx;
}
.iconfont { .iconfont {
margin-top: 6rpx; margin-top: 6rpx;
font-size: 22rpx; font-size: 22rpx;

View File

@ -57,7 +57,7 @@
</view> </view>
<!-- 店铺商品列表 --> <!-- 店铺商品列表 -->
<view class="order-wrapper" v-for="(item,index) in orderInfo.orderList" :key="index"> <view class="order-wrapper" v-for="(item,index) in orderInfo.orderList" :key="index">
<view class="title" @click="goStore(item)">{{item.merchant.mer_name}}<text <view class="title line1" @click="goStore(item)">{{item.merchant.mer_name}}<text
class="iconfont icon-xiangyou"></text> class="iconfont icon-xiangyou"></text>
</view> </view>
<view class="goods-box" v-if="item.orderProduct"> <view class="goods-box" v-if="item.orderProduct">

View File

@ -100,19 +100,19 @@
</view> </view>
<view>补贴余额 ()</view> <view>补贴余额 ()</view>
</view> --> </view> -->
<view class="p_d_item" @click="authTo('/pages/users/user_money/index')"> <view class="p_d_item" @click="authTo('/pages/users/user_money/index')">
<view class="p_d_count"> <view class="p_d_count">
<image <image
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e41f4202401201745498894.png"> src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e41f4202401201745498894.png">
</image> </image>
<view style="font-size: 30rpx;">我的余额 ()</view> <view style="font-size: 30rpx;">我的余额 ()</view>
</view> </view>
</view> </view>
<view class="p_d_item" @click="authTo('/pages/users/user_money/index')"> <view class="p_d_item" @click="authTo('/pages/users/user_money/index')">
<view class="p_d_count"> <view class="p_d_count">
<view>{{userInfo.now_money||"0.00"}}</view> <view>{{userInfo.now_money||"0.00"}}</view>
</view> </view>
</view> </view>
</view> </view>
<view @click="goSvip" class="cardVipA acea-row row-between-wrapper" v-if="svip_switch_status == 1"> <view @click="goSvip" class="cardVipA acea-row row-between-wrapper" v-if="svip_switch_status == 1">
@ -238,7 +238,7 @@
<view class="">备案号:蜀ICP备2022030133号-2A</view> <view class="">备案号:蜀ICP备2022030133号-2A</view>
<view class="">增值电信营业许可证号:川B2-20221250</view> <view class="">增值电信营业许可证号:川B2-20221250</view>
<view class="">联系我们08302669767</view> <view class="">联系我们08302669767</view>
<view style="padding-top: 50rpx;">{{appVersion}}</view> <view style="padding-top: 50rpx;">{{appVersion}}</view>
</view> </view>
<!-- <view v-else class="copy-right"> <!-- <view v-else class="copy-right">
<view class="iconfont icon-crmeb"></view> <view class="iconfont icon-crmeb"></view>
@ -300,12 +300,14 @@
import Auth from '../../libs/wechat'; import Auth from '../../libs/wechat';
import { import {
HTTP_REQUEST_URL, HTTP_REQUEST_URL,
ENV ENV
} from '@/config/app'; } from '@/config/app';
import { import {
toLogin toLogin
} from '@/libs/login.js'; } from '@/libs/login.js';
import {showTab} from "@/utils/showTab.js"; import {
showTab
} from "@/utils/showTab.js";
const app = getApp(); const app = getApp();
export default { export default {
components: { components: {
@ -453,17 +455,17 @@
newData: {}, newData: {},
activeRouter: '', activeRouter: '',
sysHeight: sysHeight, sysHeight: sysHeight,
appVersion: '' appVersion: ''
} }
}, },
onLoad() { onLoad() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
this.appVersion = 'V ' + uni.getSystemInfoSync().appWgtVersion; this.appVersion = 'V ' + uni.getSystemInfoSync().appWgtVersion;
// #endif // #endif
// #ifdef H5 // #ifdef H5
this.appVersion = 'V ' + uni.getSystemInfoSync().appVersion; this.appVersion = 'V ' + uni.getSystemInfoSync().appVersion;
// #endif // #endif
if (ENV != 'prod') this.appVersion += " Beta" if (ENV != 'prod') this.appVersion += " Beta"
}, },
onReady() { onReady() {
this.isNodes++; this.isNodes++;
@ -479,7 +481,7 @@
this.getNav(); this.getNav();
if (that.isLogin) { if (that.isLogin) {
this.getUserInfo(); this.getUserInfo();
this.orderNum();
} else { } else {
// this.userInfo = { // this.userInfo = {
// is_svip: 0 // is_svip: 0
@ -524,7 +526,6 @@
} else { } else {
this.openAuto() this.openAuto()
} }
}, },
goRouter(item) { goRouter(item) {
var pages = getCurrentPages(); var pages = getCurrentPages();
@ -636,31 +637,59 @@
getUserInfo: function() { getUserInfo: function() {
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
showTab(res.data); showTab(res.data);
that.userInfo = res.data; that.userInfo = res.data;
that.is_promoter = res.data.is_promoter; that.is_promoter = res.data.is_promoter;
that.extension_status = res.data.extension_status; that.extension_status = res.data.extension_status;
that.getMyMenus(); that.getMyMenus();
this.orderNum();
}); });
}, },
// //
orderNum() { orderNum() {
let openType = '';
orderData().then(({ orderData().then(({
data data
}) => { }) => {
this.orderMenu.forEach((item, index) => { this.orderMenu.forEach((item, index) => {
switch (item.title) { switch (item.title) {
case '待付款': case '待付款':
item.num = data.noPay item.num = Number(data.noPay) + Number(data.mer_noPay);
if ((data.noPay >= data.mer_noPay) || data.noPay) {
openType = 1;
} else {
openType = 2;
}
item.url = '/pages/users/order_list/index?status=0&openType=' + openType
break break
case '待发货': case '待发货':
item.num = data.noPostage item.num = Number(data.noPostage) + Number(data.mer_noPostage);
if ((data.noPostage >= data.mer_noPostage) || data.noPostage) {
openType = 1;
} else {
openType = 2;
}
item.url = '/pages/users/order_list/index?status=1&openType=' + openType
break break
case '待收货': case '待收货':
item.num = data.noDeliver item.num = Number(data.noDeliver) + Number(data.mer_noDeliver);
if ((data.noDeliver >= data.mer_noDeliver) || data.noDeliver) {
openType = 1;
} else {
openType = 2;
}
item.url = '/pages/users/order_list/index?status=2&openType=' + openType
break break
case '待评价': case '待评价':
item.num = data.noComment item.num = Number(data.noComment) + Number(data.mer_noComment);
if ((data.noComment >= data.mer_noComment) || data.noComment) {
openType = 1;
} else {
openType = 2;
}
item.url = '/pages/users/order_list/index?status=3&openType=' + openType
break break
case '售后/退款': case '售后/退款':
item.num = data.refund item.num = data.refund
@ -1263,11 +1292,11 @@
.iconnum { .iconnum {
min-width: 6px; min-width: 6px;
background-color: #fff; background-color: red;
color: var(--view-theme); color: #fff;
border-radius: 15rpx; border-radius: 15rpx;
position: absolute; position: absolute;
right: -10rpx; left: 50rpx;
top: -10rpx; top: -10rpx;
font-size: 10px; font-size: 10px;
padding: 0 4px; padding: 0 4px;

View File

@ -3,25 +3,26 @@
<div class="register absolute" v-if="!auth_token"> <div class="register absolute" v-if="!auth_token">
<div class="login" style="background-size: 100% 100%;background-repeat: no-repeat;"> <div class="login" style="background-size: 100% 100%;background-repeat: no-repeat;">
<div class="shading" > <div class="shading">
<div class="pictrue acea-row row-center-wrapper" style="background-color: transparent !important;"> <div class="pictrue acea-row row-center-wrapper" style="background-color: transparent !important;">
<image src="@/static/images/logo1.png" /> <image src="@/static/images/logo1.png" />
</div> </div>
</div> </div>
<div class="whiteBg" v-if="formItem == 0"> <div class="whiteBg" v-if="formItem == 0">
<div class="logon" style="display: flex;align-items: center;justify-content: center;" @click="wxLogin"> <div class="logon" style="display: flex;align-items: center;justify-content: center;"
<u-icon name="weixin-fill" color="#fff" size="30"></u-icon> 微信一键登录 @click="wxLogin">
</div> <u-icon name="weixin-fill" color="#fff" size="30"></u-icon> 微信一键登录
</div>
<div class="protocol acea-row row-between-wrapper"> <div class="protocol acea-row row-between-wrapper">
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'> <checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
<checkbox class="checkbox" :checked="isAgree ? true : false" /> <checkbox class="checkbox" :checked="isAgree ? true : false" />
<text class="protocol_text">我已同意<text @click="userAgree" <text class="protocol_text">我已同意<text @click="userAgree"
class="font_pro">用户协议</text><text @click="userPrivacyAgree" class="font_pro">用户协议</text><text @click="userPrivacyAgree"
class="font_pro">隐私政策</text></text> class="font_pro">隐私政策</text></text>
</checkbox-group> </checkbox-group>
</div> </div>
</div> </div>
<div class="whiteBg" v-else-if="formItem === 1" style="po"> <div class="whiteBg" v-else-if="formItem === 1" style="po">
<div class="title acea-row row-center-wrapper"> <div class="title acea-row row-center-wrapper">
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" <div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
@ -48,7 +49,7 @@
</form> </form>
<div class="tip"> <div class="tip">
<!-- <span @click="formItem = 2" class="font-color-red">立即注册</span> --> <!-- <span @click="formItem = 2" class="font-color-red">立即注册</span> -->
<span> </span> <span> </span>
<navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index"> <navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
忘记密码 忘记密码
</navigator> </navigator>
@ -68,8 +69,8 @@
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image> <image src="/static/images/code_2.png"></image>
<input type="number" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" <input type="number" placeholder="填写验证码" placeholder-class="placeholder"
v-model="captcha" maxlength="4" /> class="codeIput" v-model="captcha" maxlength="4" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
@click="handleVerify"> @click="handleVerify">
{{ text }} {{ text }}
@ -79,8 +80,8 @@
<div class="item" v-if="isShowCode"> <div class="item" v-if="isShowCode">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image> <image src="/static/images/code_2.png"></image>
<input type="number" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" <input type="number" placeholder="填写验证码" placeholder-class="placeholder"
v-model="codeVal" maxlength="4" /> class="codeIput" v-model="codeVal" maxlength="4" />
<div class="code" @click="getcaptcha"> <div class="code" @click="getcaptcha">
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" /> <image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
</div> </div>
@ -112,8 +113,8 @@
<div class="item"> <div class="item">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image> <image src="/static/images/code_2.png"></image>
<input type="number" placeholder="填写验证码" maxLength='4' placeholder-class="placeholder" class="codeIput" <input type="number" placeholder="填写验证码" maxLength='4' placeholder-class="placeholder"
v-model="captcha" /> class="codeIput" v-model="captcha" />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
@click="handleVerify"> @click="handleVerify">
@ -132,8 +133,8 @@
<div class="item" v-if="isShowCode"> <div class="item" v-if="isShowCode">
<div class="acea-row row-middle"> <div class="acea-row row-middle">
<image src="/static/images/code_2.png"></image> <image src="/static/images/code_2.png"></image>
<input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder" class="codeIput" <input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder"
v-model="codeVal" /> class="codeIput" v-model="codeVal" />
<div class="code" @click="getcaptcha"> <div class="code" @click="getcaptcha">
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" /> <image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
</div> </div>
@ -168,19 +169,20 @@
</view> </view>
</view> </view>
<!-- #ifdef APP-PLUS --> <!-- #ifdef APP-PLUS -->
<div class="protocol acea-row row-between-wrapper" style="position: fixed; bottom: 160rpx;left: 50%;transform: translate(-50%);"> <div class="protocol acea-row row-between-wrapper"
<text class="protocol_text" v-if="formItem==0" @click="formItem = 1 ">其他方式登录</text> style="position: fixed; bottom: 160rpx;left: 50%;transform: translate(-50%);">
<text class="protocol_text" v-else @click="formItem = 0 ">微信快捷登录</text> <text class="protocol_text" v-if="formItem==0" @click="formItem = 1 ">其他方式登录</text>
</div> <text class="protocol_text" v-else @click="formItem = 0 ">微信快捷登录</text>
<!-- #endif --> </div>
<!-- #endif -->
</div> </div>
<form report-submit='true' v-if="auth_token"> <form report-submit='true' v-if="auth_token">
<view class="ChangePassword"> <view class="ChangePassword">
<view class="title"> <view class="title">
<view>首次登录</view> <view>首次登录</view>
<view style="font-size: 36rpx;">需要绑定手机号码</view> <view style="font-size: 36rpx;">需要绑定手机号码</view>
</view> </view>
<view class="list"> <view class="list">
<view class="item"> <view class="item">
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' <input type='number' placeholder='填写手机号码' placeholder-class='placeholder'
@ -188,8 +190,8 @@
</view> </view>
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
<input type='number' placeholder='填写验证码' maxlength="4" placeholder-class='placeholder' class="codeIput" <input type='number' placeholder='填写验证码' maxlength="4" placeholder-class='placeholder'
v-model="captcha"></input> class="codeIput" v-model="captcha"></input>
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' <button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled'
@click="handleVerify"> @click="handleVerify">
@ -197,7 +199,7 @@
</button> </button>
</view> </view>
<view class="item"> <view class="item">
<input type='password' placeholder='填写登录密码' placeholder-class='placeholder' <input type='password' placeholder='填写登录密码' placeholder-class='placeholder'
v-model="password"></input> v-model="password"></input>
</view> </view>
<view class="protocol acea-row row-between-wrapper"> <view class="protocol acea-row row-between-wrapper">
@ -275,13 +277,15 @@
import parser from "@/components/jyf-parser/jyf-parser"; import parser from "@/components/jyf-parser/jyf-parser";
import { import {
commonAuth, commonAuth,
userMerge userMerge
} from '../../../api/public'; } from '../../../api/public';
import { import {
mapGetters mapGetters
} from "vuex"; } from "vuex";
import Verify from '@/components/verify/verify.vue'; import Verify from '@/components/verify/verify.vue';
import { Toast } from "../../../libs/uniApi"; import {
Toast
} from "../../../libs/uniApi";
const BACK_URL = "login_back_url"; const BACK_URL = "login_back_url";
// #ifdef APP-PLUS // #ifdef APP-PLUS
var jpushModule = uni.requireNativePlugin("JG-JPush"); var jpushModule = uni.requireNativePlugin("JG-JPush");
@ -295,7 +299,7 @@
}, },
data: function() { data: function() {
return { return {
navList: ["快速登录","账号登录"], navList: ["快速登录", "账号登录"],
current: 0, current: 0,
account: "", account: "",
password: "", password: "",
@ -303,9 +307,9 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
formItem: 0, formItem: 0,
// #endif // #endif
// #ifndef APP-PLUS // #ifndef APP-PLUS
formItem: 1, formItem: 1,
// #endif // #endif
type: "login", type: "login",
keyCode: "", keyCode: "",
codeUrl: "", codeUrl: "",
@ -379,7 +383,8 @@
}).then(({ }).then(({
data data
}) => { }) => {
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
"/pages/index/index";
that.$Cache.clear(BACK_URL); that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin'); that.$Cache.clear('login_back_url_weixin');
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
@ -498,7 +503,8 @@
}).then(res => { }).then(res => {
const data = res.data; const data = res.data;
if (res.data.status == 200) { if (res.data.status == 200) {
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
"/pages/index/index";
that.$Cache.clear(BACK_URL); that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin'); that.$Cache.clear('login_back_url_weixin');
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
@ -555,13 +561,13 @@
provider: 'weixin', provider: 'weixin',
onlyAuthorize: true, onlyAuthorize: true,
success: function(loginRes) { success: function(loginRes) {
console.log(loginRes); console.log(loginRes);
uni.hideLoading() uni.hideLoading()
self.appUserInfo = loginRes; self.appUserInfo = loginRes;
self.weixinLoginApi() self.weixinLoginApi()
}, },
fail(error) { fail(error) {
console.log(error); console.log(error);
uni.showToast({ uni.showToast({
title: '登录失败', title: '登录失败',
icon: 'none', icon: 'none',
@ -582,16 +588,17 @@
commonAuth({ commonAuth({
auth: { auth: {
type: 'app_wechat', type: 'app_wechat',
auth: { auth: {
code: that.appUserInfo.authResult.access_token, code: that.appUserInfo.authResult.access_token,
openid: that.appUserInfo.authResult.openid, openid: that.appUserInfo.authResult.openid,
phone: this.account, phone: this.account,
} }
} }
}).then(res => { }).then(res => {
const data = res.data; const data = res.data;
if (res.data.status == 200) { if (res.data.status == 200) {
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
"/pages/index/index";
that.$Cache.clear(BACK_URL); that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin'); that.$Cache.clear('login_back_url_weixin');
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
@ -620,13 +627,71 @@
url: backUrl url: backUrl
}); });
} else { } else {
that.isAgree = false; that.isAgree = false;
that.auth_token = res.data.result.key; that.auth_token = res.data.result.key;
that.bindStatus = true; that.bindStatus = true;
} }
uni.hideLoading(); uni.hideLoading();
}).catch(res => { }).catch(res => {
console.log(res); console.log(res);
uni.hideLoading();
uni.showToast({
title: res.message || res,
icon: 'none',
duration: 2000
});
});
},
weixinLoginApi() {
const that = this
commonAuth({
auth: {
type: 'app_wechat',
auth: {
code: that.appUserInfo.code
}
}
}).then(res => {
console.log('--', res);
const data = res.data;
if (res.data.status == 200) {
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
"/pages/index/index";
that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin');
that.$store.commit("LOGIN", {
'token': data.result.token,
'time': data.result.exp
});
that.$store.commit("SETUID", data.result.user.uid);
that.$store.commit('UPDATE_USERINFO', data.result.user);
let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
'/pages/goods_cate/goods_cate',
'/pages/user/index', '/pages/plant_grass/index'
]
if (indexPat.includes(this.getPath(backUrl))) {
method = 'switchTab'
} else {
method = 'navigateTo'
}
if (this.getPath(backUrl) === '/pages/users/login/index') {
uni.switchTab({
url: '/pages/index/index'
});
return
}
uni[method]({
url: backUrl
});
} else {
that.isAgree = false;
that.auth_token = res.data.result.key;
that.bindStatus = true;
}
uni.hideLoading();
}).catch(res => {
console.log('错误--', res);
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: res.message || res, title: res.message || res,
@ -635,63 +700,6 @@
}); });
}); });
}, },
weixinLoginApi() {
const that = this
commonAuth({
auth: {
type: 'app_wechat',
auth: {
code: that.appUserInfo.code
}
}
}).then(res => {
console.log('--', res);
const data = res.data;
if (res.data.status == 200) {
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index";
that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin');
that.$store.commit("LOGIN", {
'token': data.result.token,
'time': data.result.exp
});
that.$store.commit("SETUID", data.result.user.uid);
that.$store.commit('UPDATE_USERINFO', data.result.user);
let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
'/pages/goods_cate/goods_cate',
'/pages/user/index', '/pages/plant_grass/index'
]
if (indexPat.includes(this.getPath(backUrl))) {
method = 'switchTab'
} else {
method = 'navigateTo'
}
if (this.getPath(backUrl) === '/pages/users/login/index') {
uni.switchTab({
url: '/pages/index/index'
});
return
}
uni[method]({
url: backUrl
});
} else {
that.isAgree = false;
that.auth_token = res.data.result.key;
that.bindStatus = true;
}
uni.hideLoading();
}).catch(res => {
console.log('错误--', res);
uni.hideLoading();
uni.showToast({
title: res.message || res,
icon: 'none',
duration: 2000
});
});
},
getAgreement() { getAgreement() {
let that = this let that = this
getAgreementApi('sys_user_agree').then(res => { getAgreementApi('sys_user_agree').then(res => {
@ -745,7 +753,8 @@
data data
}) => { }) => {
this.checkOpenId(data.user) this.checkOpenId(data.user)
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
"/pages/index/index";
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
'token': data.token, 'token': data.token,
'time': data.exp 'time': data.exp
@ -753,14 +762,14 @@
that.$store.commit("SETUID", data.user.uid); that.$store.commit("SETUID", data.user.uid);
that.$store.commit('UPDATE_USERINFO', data.user); that.$store.commit('UPDATE_USERINFO', data.user);
if(data.is_new_user && !that.$Cache.get('login_back_url_weixin')){ if (data.is_new_user && !that.$Cache.get('login_back_url_weixin')) {
return uni.navigateTo({ return uni.navigateTo({
url: '/pages/helpPeople/helpPeople' url: '/pages/helpPeople/helpPeople'
}) })
} }
that.$Cache.clear(BACK_URL); that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin'); that.$Cache.clear('login_back_url_weixin');
let method let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
@ -831,25 +840,26 @@
}); });
that.$store.commit("SETUID", res.data.user.uid); that.$store.commit("SETUID", res.data.user.uid);
that.$store.commit('UPDATE_USERINFO', res.data.user); that.$store.commit('UPDATE_USERINFO', res.data.user);
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
"/pages/index/index";
that.$Cache.clear(BACK_URL); that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin'); that.$Cache.clear('login_back_url_weixin');
let method let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
'/pages/goods_cate/goods_cate', '/pages/goods_cate/goods_cate',
'/pages/user/index' '/pages/user/index'
] ]
if (indexPat.includes(this.getPath(backUrl))) { if (indexPat.includes(this.getPath(backUrl))) {
method = 'switchTab' method = 'switchTab'
} else { } else {
method = 'navigateTo' method = 'navigateTo'
} }
uni[method]({ uni[method]({
url: backUrl, url: backUrl,
success:()=>{ success: () => {
this.auth_token = '' this.auth_token = ''
} }
}); });
}) })
.catch(res => { .catch(res => {
that.$util.Tips({ that.$util.Tips({
@ -857,90 +867,91 @@
}); });
}); });
}, },
async weixinMerge() { async weixinMerge() {
let that = this; let that = this;
if (!that.account) return that.$util.Tips({ if (!that.account) return that.$util.Tips({
title: '请输入手机号码' title: '请输入手机号码'
}); });
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({ if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
title: '请输入正确的手机号码' title: '请输入正确的手机号码'
}); });
if (!that.captcha) return that.$util.Tips({ if (!that.captcha) return that.$util.Tips({
title: '请输入验证码' title: '请输入验证码'
}); });
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({ if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
title: '请输入正确的验证码' title: '请输入正确的验证码'
}); });
if (!that.password) return that.$util.Tips({ if (!that.password) return that.$util.Tips({
title: '请输入密码' title: '请输入密码'
}); });
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({ if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
title: '请输入6-16位字母加数字组合' title: '请输入6-16位字母加数字组合'
}); });
if (!that.isAgree) return that.$util.Tips({ if (!that.isAgree) return that.$util.Tips({
title: '请勾选用户协议与隐私政策' title: '请勾选用户协议与隐私政策'
}); });
console.log('绑定前', { console.log('绑定前', {
auth_token: this.auth_token || uni.getStorageSync('auth_token'), auth_token: this.auth_token || uni.getStorageSync('auth_token'),
phone: that.account, phone: that.account,
sms_code: that.captcha, sms_code: that.captcha,
pwd: that.password, pwd: that.password,
spread: that.$Cache.get("spread"), spread: that.$Cache.get("spread"),
// #ifdef APP-PLUS // #ifdef APP-PLUS
user_type: 'app', user_type: 'app',
// #endif // #endif
// #ifdef H5 // #ifdef H5
user_type: 'h5', user_type: 'h5',
// #endif // #endif
}); });
userMerge({ userMerge({
auth_token: this.auth_token || uni.getStorageSync('auth_token'), auth_token: this.auth_token || uni.getStorageSync('auth_token'),
phone: that.account, phone: that.account,
sms_code: that.captcha, sms_code: that.captcha,
pwd: that.password, pwd: that.password,
spread: that.$Cache.get("spread"), spread: that.$Cache.get("spread"),
// #ifdef APP-PLUS // #ifdef APP-PLUS
user_type: 'app', user_type: 'app',
// #endif // #endif
// #ifdef H5 // #ifdef H5
user_type: 'h5', user_type: 'h5',
// #endif // #endif
}) })
.then(res => { .then(res => {
console.log(res); console.log(res);
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
'token': res.data.token, 'token': res.data.token,
'time': res.data.exp 'time': res.data.exp
}); });
that.$store.commit("SETUID", res.data.user.uid); that.$store.commit("SETUID", res.data.user.uid);
that.$store.commit('UPDATE_USERINFO', res.data.user); that.$store.commit('UPDATE_USERINFO', res.data.user);
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
that.$Cache.clear(BACK_URL); "/pages/index/index";
that.$Cache.clear('login_back_url_weixin'); that.$Cache.clear(BACK_URL);
let method that.$Cache.clear('login_back_url_weixin');
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', let method
'/pages/goods_cate/goods_cate', let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
'/pages/user/index' '/pages/goods_cate/goods_cate',
] '/pages/user/index'
if (indexPat.includes(this.getPath(backUrl))) { ]
method = 'switchTab' if (indexPat.includes(this.getPath(backUrl))) {
} else { method = 'switchTab'
method = 'navigateTo' } else {
} method = 'navigateTo'
uni[method]({ }
url: backUrl, uni[method]({
success:()=>{ url: backUrl,
this.auth_token = '' success: () => {
} this.auth_token = ''
}); }
}) });
.catch(res => { })
console.log('error', err); .catch(res => {
that.$util.Tips({ console.log('error', err);
title: res that.$util.Tips({
}); title: res
}); });
}, });
},
async code(data) { async code(data) {
let that = this; let that = this;
if (!that.account) return that.$util.Tips({ if (!that.account) return that.$util.Tips({
@ -1003,17 +1014,21 @@
if (!that.isAgree) return that.$util.Tips({ if (!that.isAgree) return that.$util.Tips({
title: '请勾选用户协议与隐私政策' title: '请勾选用户协议与隐私政策'
}); });
console.log(11)
loginH5({ loginH5({
auth_token: uni.getStorageSync('auth_token'), auth_token: uni.getStorageSync('auth_token'),
account: that.account, account: that.account,
password: that.password, password: that.password,
spread: that.$Cache.get("spread") spread: that.$Cache.get("spread")
}) }).then(({
.then(({
data data
}) => { }) => {
console.log(data)
this.checkOpenId(data.user) this.checkOpenId(data.user)
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) || "/pages/index/index"; const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
"/pages/index/index";
that.$store.commit("LOGIN", { that.$store.commit("LOGIN", {
'token': data.token, 'token': data.token,
'time': data.exp 'time': data.exp
@ -1021,14 +1036,14 @@
that.$store.commit("SETUID", data.user.uid); that.$store.commit("SETUID", data.user.uid);
that.$store.commit('UPDATE_USERINFO', data.user); that.$store.commit('UPDATE_USERINFO', data.user);
if(data.is_new_user && !that.$Cache.get('login_back_url_weixin')){ if (data.is_new_user && !that.$Cache.get('login_back_url_weixin')) {
return uni.navigateTo({ return uni.navigateTo({
url: '/pages/helpPeople/helpPeople' url: '/pages/helpPeople/helpPeople'
}) })
} }
that.$Cache.clear(BACK_URL); that.$Cache.clear(BACK_URL);
that.$Cache.clear('login_back_url_weixin'); that.$Cache.clear('login_back_url_weixin');
let method let method
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
@ -1052,6 +1067,7 @@
}); });
}) })
.catch(e => { .catch(e => {
console.log(e)
that.$util.Tips({ that.$util.Tips({
title: e title: e
}); });
@ -1082,34 +1098,34 @@
checkOpenId(user) { checkOpenId(user) {
if (user.wechat_user_id === 0) { if (user.wechat_user_id === 0) {
let that = this let that = this
try{ try {
wx.getUserInfo({ wx.getUserInfo({
success: function(res) { success: function(res) {
const encryptedData = res.encryptedData const encryptedData = res.encryptedData
const iv = res.iv const iv = res.iv
wx.login({ wx.login({
success(res) { success(res) {
if (res.code) { if (res.code) {
bindMp({ bindMp({
code: res.code, code: res.code,
iv: iv, iv: iv,
encryptedData: encryptedData, encryptedData: encryptedData,
phone: that.account phone: that.account
}).then(res => { }).then(res => {
// console.log(res); // console.log(res);
}) })
} else { } else {
// console.log('' + res.errMsg) // console.log('' + res.errMsg)
} }
} }
}) })
}, },
fail(e) { fail(e) {
// console.log('' + res.errMsg) // console.log('' + res.errMsg)
} }
}) })
}catch(e){ } catch (e) {
console.log(e); console.log(e);
} }
} }
// #ifdef APP-PLUS // #ifdef APP-PLUS
@ -1119,11 +1135,11 @@
bindJG({ bindJG({
phone: this.account, phone: this.account,
jg_register_id: result.registerID jg_register_id: result.registerID
}).then(res=>{ }).then(res => {
console.log("绑定成功", res); console.log("绑定成功", res);
}).catch(err=>{ }).catch(err => {
console.log("绑定失败", err); console.log("绑定失败", err);
}) })
} }
}) })
// #endif // #endif
@ -1141,14 +1157,14 @@
border-radius: 100%; border-radius: 100%;
} }
.ChangePassword{ .ChangePassword {
.title{ .title {
width: 580rpx; width: 580rpx;
margin: 180rpx auto 0 auto; margin: 180rpx auto 0 auto;
font-size: 46rpx; font-size: 46rpx;
color: #7f7f7f; color: #7f7f7f;
} }
} }
.ChangePassword .phone { .ChangePassword .phone {
font-size: 32rpx; font-size: 32rpx;
@ -1450,7 +1466,7 @@
.whiteBg { .whiteBg {
margin-top: 100rpx; margin-top: 100rpx;
transition: 300ms; transition: 300ms;
.list { .list {
border-radius: 16rpx; border-radius: 16rpx;

View File

@ -9,8 +9,9 @@
<view class="btn_tab"> <view class="btn_tab">
<view class="tab_item" :class="{'tab_item_active': sale_type==1}" @click="changeSaleType(1)"> <view class="tab_item" :class="{'tab_item_active': sale_type==1}" @click="changeSaleType(1)">
用户订单</view> 用户订单</view>
<view v-if="mer_info.mer_settlement_agree_status||sale_type==2" class="tab_item" <view v-if="(mer_info && mer_info.mer_settlement_agree_status==1)||sale_type==2"
:class="{'tab_item_active': sale_type==2}" @click="changeSaleType(2)">商户订单</view> class="tab_item" :class="{'tab_item_active': sale_type==2}" @click="changeSaleType(2)">商户订单
</view>
</view> </view>
<view class="btn_car" @click="toGwc"> <view class="btn_car" @click="toGwc">
<text class="iconfont icon-gouwuche" style="font-size: 36rpx;"></text> <text class="iconfont icon-gouwuche" style="font-size: 36rpx;"></text>
@ -19,23 +20,28 @@
<view class='nav acea-row row-around new-nav-tab'> <view class='nav acea-row row-around new-nav-tab'>
<view class='item' :class='orderStatus==-1 ? "on": ""' @click="statusClick(-1)"> <view class='item' :class='orderStatus==-1 ? "on": ""' @click="statusClick(-1)">
<view>全部</view> <view>全部</view>
<view class='num'>{{orderData.all || 0}}</view> <view class='num'>{{(sale_type==1?orderData.all:orderData.mer_all) || 0}}</view>
</view> </view>
<view class='item' :class='orderStatus==0 ? "on": ""' @click="statusClick(0)"> <view class='item' :class='orderStatus==0 ? "on": ""' @click="statusClick(0)">
<view>待付款</view> <view>待付款</view>
<view class='num'>{{orderData.noPay || 0}}</view> <view class='num'>{{(sale_type==1?orderData.noPay:orderData.mer_noPay) || 0}}</view>
</view> </view>
<view class='item' :class='orderStatus==1 ? "on": ""' @click="statusClick(1)"> <view class='item' :class='orderStatus==1 ? "on": ""' @click="statusClick(1)">
<view>待发货</view> <view>待发货</view>
<view class='num'>{{orderData.noPostage || 0}}</view> <view class='num'>{{(sale_type==1?orderData.noPostage:orderData.mer_noPostage) || 0}}</view>
</view> </view>
<view class='item' :class='orderStatus==2 ? "on": ""' @click="statusClick(2)"> <view class='item' :class='orderStatus==2 ? "on": ""' @click="statusClick(2)">
<view>待收货</view> <view>待收货</view>
<view class='num '>{{orderData.noDeliver || 0}}</view> <view class='num' v-if="sale_type == 1">{{(Number(orderData.noDeliver)) || 0}} </view>
<view class='num' v-else>{{( Number(orderData.mer_noDeliver)) || 0}} </view>
</view> </view>
<view class='item' :class='orderStatus==3 ? "on": ""' @click="statusClick(3)"> <view class='item' :class='orderStatus==3 ? "on": ""' @click="statusClick(3)">
<view>待评价</view> <view>待评价</view>
<view class='num'>{{orderData.noComment || 0}}</view> <view class='num'>{{(sale_type==1?orderData.noComment:orderData.mer_noComment) || 0}}</view>
</view>
<view class='item' :class='orderStatus==4 ? "on": ""' @click="statusClick(4)">
<view>退款/售后</view>
<view class='num'>{{(sale_type==1?orderData.elseRefund:orderData.mer_elseRefund) || 0}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -73,11 +79,12 @@
<view class='num'>{{orderData.noComment || 0}}</view> <view class='num'>{{orderData.noComment || 0}}</view>
</view> </view>
</view> --> </view> -->
<navigator class="search acea-row row-middle" :url="`/pages/users/order_list/search?sale_type=${sale_type}`" <navigator class="search acea-row row-middle"
hover-class="none"> :url="`/pages/users/order_list/search?sale_type=${sale_type}&status=${orderStatus}`" hover-class="none">
<text class="iconfont icon-sousuo"></text> <text class="iconfont icon-sousuo"></text>
搜索我的订单 搜索我的订单
</navigator> </navigator>
<!--定金预售订单--> <!--定金预售订单-->
<view v-if="presellProList.length > 0" class="event_container" <view v-if="presellProList.length > 0" class="event_container"
:style="{ 'background-image': `url(${domain}/static/images/presell_orderBg.png)`}"> :style="{ 'background-image': `url(${domain}/static/images/presell_orderBg.png)`}">
@ -103,19 +110,19 @@
<block v-if="orderStatus == 0"> <block v-if="orderStatus == 0">
<view class='item' v-for="(item,index) in orderList" :key="index"> <view class='item' v-for="(item,index) in orderList" :key="index">
<view @click='goOrderDetails(item.group_order_id)'> <view @click='goOrderDetails(item.group_order_id)'>
<view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper">
<text class="iconfont icon-shangjiadingdan"></text>
<view class="store-name">
<view>{{item.orderList[0].merchant.mer_name}}</view>
</view>
<text class="iconfont icon-xiangyou"></text>
</view>
<view class='t-color'>
{{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}
</view>
</view>
<view v-for="(order,j) in item.orderList" :key="order.order_id+j"> <view v-for="(order,j) in item.orderList" :key="order.order_id+j">
<view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper">
<text class="iconfont icon-shangjiadingdan"></text>
<view class="store-name line1">{{order.merchant.mer_name}}
</view>
<text class="iconfont icon-xiangyou"></text>
</view>
<view class='t-color'>
{{ order.activity_type === 2 && order.orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}
</view>
</view>
<!--预售--> <!--预售-->
<view v-if="order.activity_type === 2"> <view v-if="order.activity_type === 2">
<block v-for="(goods,g) in order.orderProduct"> <block v-for="(goods,g) in order.orderProduct">
@ -208,6 +215,73 @@
</view> </view>
</view> </view>
</block> </block>
<!-- 退款 -->
<block v-else-if="orderStatus == 4">
<view class="goods-wrapper">
<view>
<view class="info-box" v-for="(item,index) in orderList" :key="index">
<view class="title" @click="goMall(item)">
<text class="iconfont icon-shangjiadingdan"></text>
<text v-if="item.merchant" class="txt line1"
style="max-width: 500rpx;">{{item.merchant.mer_name}}</text>
<text class="iconfont icon-xiangyou"></text>
</view>
<view class="product-box">
<view class="product-item" v-for="goods in item.refundProduct"
:key="goods.order_product_id">
<image class="img-box" :src="goods.product.cart_info.product.image" mode="">
</image>
<view class="msg">
<view class="name line1"><text
v-if="goods.product.cart_info.product_type === 2"
class="event_name event_bg">预售</text>{{goods.product.cart_info.product.store_name}}
</view>
<view class="des">{{goods.product.cart_info.productAttr.sku}}</view>
<view class="price">退款{{goods.refund_price}}</view>
<view class="num">x {{goods.refund_num}}</view>
</view>
</view>
</view>
<view class="btn-box" v-if="item.status == 1">
<view class="btn gray" @click="goDetail(item)">查看详情</view>
<view class="btn" @click="goPage(item.refund_order_id)">退回商品</view>
</view>
<view class="btn-box" v-else-if="item.status == -1">
<view class="btn" @click="goDetail(item)">查看详情</view>
<!-- <view class="btn" @click="applyAgain(item)">再次申请</view> -->
</view>
<view class="btn-box" v-else>
<view class="btn gray" v-if="item.status == 3" @click="bindDetele(item,index)">
删除订单</view>
<view class="btn" @click="goDetail(item)">查看详情</view>
</view>
<view class="status">
<!-- 0审核中 1待发货 2待收货 3已退款 -1已拒绝 -->
<block v-if="item.status == 0">
<text class="iconfont icon-shenhezhong1 p-color"></text>
</block>
<block v-if="item.status == 1">
<text class="iconfont icon-daituihuo"></text>
</block>
<block v-if="item.status == 2">
<text class="iconfont icon-tuihuozhong"></text>
</block>
<block v-if="item.status == 3">
<text class="iconfont icon-yituikuan"></text>
</block>
<block v-if="item.status == -1">
<text class="iconfont icon-yijujue1"></text>
</block>
<block v-if="item.status == -2">
<text class="iconfont icon-yiquxiao"></text>
</block>
</view>
</view>
</view>
</view>
</block>
<!-- 待发货 待收货 待评价 已完成 --> <!-- 待发货 待收货 待评价 已完成 -->
<block v-else> <block v-else>
<view class='item' v-for="(item,index) in orderList" :key="index"> <view class='item' v-for="(item,index) in orderList" :key="index">
@ -215,8 +289,8 @@
<view class='title acea-row row-between-wrapper'> <view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper" @click.stop="goMall(item)"> <view class="acea-row row-middle left-wrapper" @click.stop="goMall(item)">
<text class="iconfont icon-shangjiadingdan"></text> <text class="iconfont icon-shangjiadingdan"></text>
<view class="store-name"> <view class="store-name line1">
<view>{{item.merchant.mer_name}}</view> {{item.merchant.mer_name}}
</view> </view>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
@ -404,7 +478,9 @@
groupOrderList, groupOrderList,
orderTake, orderTake,
applyInvoiceApi, applyInvoiceApi,
uploadEnvidenceApi uploadEnvidenceApi,
refundListNew,
refundDel
} from '@/api/order.js'; } from '@/api/order.js';
import { import {
getUserInfo getUserInfo
@ -500,6 +576,12 @@
add: false, add: false,
}, },
mer_info: {}, mer_info: {},
refundParam: {
page: 1,
limit: 15,
type: 0,
identity: ''
}
}; };
}, },
computed: { computed: {
@ -510,15 +592,13 @@
onLoad(options) { onLoad(options) {
if (options.sale_type) this.sale_type = options.sale_type; if (options.sale_type) this.sale_type = options.sale_type;
if (options.status) this.orderStatus = options.status; if (options.status) this.orderStatus = options.status;
let user = this.$store.state.app.userInfo;
if (user.mer_info) this.initMerInfo(user);
if (this.isLogin) { if (this.isLogin) {
this.page = 1; this.page = 1;
this.loadend = false; this.loadend = false;
this.loading = false; this.loading = false;
this.getOrderData(); this.getOrderData();
this.getOrderList(); this.getOrderList();
this.getUserInfo(); this.getUserInfo(options);
this.getpreSellOrderList(); this.getpreSellOrderList();
} else { } else {
toLogin() toLogin()
@ -539,8 +619,25 @@
}); });
// #endif // #endif
}, },
//
onPullDownRefresh() {
this.loadend = false;
this.loading = false;
this.$set(this, 'orderList', []);
if (this.orderStatus == 4) {
this.refundParam.page = 1;
this.getRefundList();
} else {
this.page = 1;
this.getOrderList();
this.getOrderData();
}
},
methods: { methods: {
// //
handleCopy() { handleCopy() {
let that = this; let that = this;
uni.setClipboardData({ uni.setClipboardData({
@ -568,29 +665,8 @@
navBack() { navBack() {
uni.navigateBack(); uni.navigateBack();
}, },
initMerInfo(user) {
this.mer_info = user;
if (this.mer_info.mer_settlement_agree_status) {
this.payMode.forEach(item => {
if (item.value == 'merBalance') {
item.payStatus = 1;
item.number = this.mer_info.mer_money;
}
})
}
},
changeSaleType(type = 1) {
if (type != this.sale_type) {
this.sale_type = type;
this.page = 1;
this.loadend = false;
this.loading = false;
this.getOrderData();
this.getOrderList();
this.getUserInfo();
this.getpreSellOrderList();
}
},
// //
goMall(item) { goMall(item) {
if (this.hide_mer_status == 0) { if (this.hide_mer_status == 0) {
@ -613,24 +689,34 @@
* 获取用户信息 * 获取用户信息
* *
*/ */
getUserInfo: function() { getUserInfo: function(options) {
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
that.payMode[2].number = res.data.now_money; that.payMode[2].number = res.data.now_money;
if (res.data.mer_info) that.initMerInfo(res.data.mer_info); if (res.data.mer_info) that.initMerInfo(res.data.mer_info, options);
}); });
}, },
/**
* 关闭支付组件 initMerInfo(user, options) {
* this.mer_info = user;
*/ if (user && user.mer_settlement_agree_status) {
this.payMode.forEach(item => {
if (item.value == 'merBalance') {
item.payStatus = 1;
item.number = this.mer_info.mer_money;
}
});
//opentype=2
if (options && options.openType && options.openType == 2) this.changeSaleType(2);
}
},
//
payClose: function() { payClose: function() {
this.pay_close = false; this.pay_close = false;
}, },
/**
* 获取订单统计数据 //
*
*/
getOrderData: function() { getOrderData: function() {
let that = this; let that = this;
orderData({ orderData({
@ -639,10 +725,8 @@
that.$set(that, 'orderData', res.data); that.$set(that, 'orderData', res.data);
}) })
}, },
/**
* 取消订单 //
*
*/
cancelOrder: function(index, order_id) { cancelOrder: function(index, order_id) {
let that = this; let that = this;
if (!order_id) return that.$util.Tips({ if (!order_id) return that.$util.Tips({
@ -664,10 +748,8 @@
}); });
}); });
}, },
/**
* 打开支付组件 //
*
*/
goPay: function(pay_price, order_id) { goPay: function(pay_price, order_id) {
this.$set(this, 'pay_close', true); this.$set(this, 'pay_close', true);
this.order_id = order_id; this.order_id = order_id;
@ -693,10 +775,7 @@
}); });
}, },
/** //
* 支付成功回调
*
*/
pay_complete: function() { pay_complete: function() {
this.loadend = false; this.loadend = false;
this.page = 1; this.page = 1;
@ -706,17 +785,14 @@
this.getOrderData(); this.getOrderData();
this.getOrderList(); this.getOrderList();
}, },
/**
* 支付失败回调 //
*
*/
pay_fail: function() { pay_fail: function() {
this.pay_close = false; this.pay_close = false;
this.pay_order_id = ''; this.pay_order_id = '';
}, },
/**
* 去订单详情 //
*/
goOrderDetails: function(order_id) { goOrderDetails: function(order_id) {
let self = this let self = this
if (!order_id) return that.$util.Tips({ if (!order_id) return that.$util.Tips({
@ -755,9 +831,8 @@
} }
// #endif // #endif
}, },
/**
* 点击去评价 //
*/
goOrderDetails_Evaluation: function(order_id) { goOrderDetails_Evaluation: function(order_id) {
let self = this let self = this
if (!order_id) return that.$util.Tips({ if (!order_id) return that.$util.Tips({
@ -786,21 +861,105 @@
} }
// #endif // #endif
}, },
/**
* 切换类型 //
*/
statusClick: function(status) { statusClick: function(status) {
if (status == this.orderStatus) return;
this.orderStatus = status;
this.loadend = false; this.loadend = false;
this.loading = false; this.loading = false;
this.page = 1;
this.$set(this, 'orderList', []); this.$set(this, 'orderList', []);
this.getOrderList();
if (status == 4) { //1 2
if (status == this.orderStatus) return;
this.orderStatus = status;
this.refundParam.identity = this.sale_type;
this.refundParam.page = 1;
this.getRefundList();
} else {
if (status == this.orderStatus) return;
this.orderStatus = status;
this.page = 1;
this.getOrderList();
}
}, },
/**
* 获取订单列表 changeSaleType(type = 1) {
*/ if (this.sale_type == type) return;
this.loadend = false;
this.loading = false;
this.$set(this, 'orderList', []);
if (this.orderStatus == 4) {
this.refundParam.identity = type;
this.refundParam.page = 1;
this.getRefundList();
} else {
this.page = 1;
this.getOrderData();
this.getOrderList();
this.getUserInfo();
this.getpreSellOrderList();
}
this.sale_type = type;
},
// 退
getRefundList() {
let that = this;
if (that.loadend) return;
if (that.loading) return;
that.loading = true;
that.loadTitle = "加载更多";
refundListNew(this.refundParam).then(res => {
let list = res.data.list || [];
let loadend = list.length < that.refundParam.limit;
that.orderList = that.refundParam.page == 1 ? list : that.$util.SplitArray(list, that
.orderList);
that.$set(that, 'orderList', that.orderList);
that.getProductCount();
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
that.refundParam.page = that.refundParam.page + 1;
that.isReady = true;
uni.stopPullDownRefresh();
}).catch(err => {
that.loading = false;
that.loadTitle = "加载更多";
})
},
//
goDetail(item) {
uni.navigateTo({
url: '/pages/users/refund/detail?id=' + item.refund_order_id
})
},
//
bindDetele(item, index) {
let self = this
uni.showModal({
title: '提示',
content: '确定删除该记录吗?',
success: function(res) {
if (res.confirm) {
refundDel(item.refund_order_id).then(res => {
self.orderList.splice(index, 1)
})
uni.showToast({
title: '删除成功',
icon: 'none'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
getOrderList: function() { getOrderList: function() {
let that = this; let that = this;
if (that.loadend) return; if (that.loadend) return;
@ -826,7 +985,8 @@
that.loadend = loadend; that.loadend = loadend;
that.loading = false; that.loading = false;
that.loadTitle = loadend ? "我也是有底线的" : '加载更多'; that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
that.page = that.page + 1 that.page = that.page + 1;
uni.stopPullDownRefresh();
}) })
} else { } else {
getOrderList({ getOrderList({
@ -846,6 +1006,7 @@
that.loadTitle = loadend ? "我也是有底线的" : '加载更多'; that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
that.page = that.page + 1; that.page = that.page + 1;
that.isReady = true; that.isReady = true;
uni.stopPullDownRefresh();
}).catch(err => { }).catch(err => {
that.loading = false; that.loading = false;
that.loadTitle = "加载更多"; that.loadTitle = "加载更多";
@ -853,9 +1014,8 @@
} }
} }
}, },
/**
* 获取定金预售订单列表 //
*/
getpreSellOrderList: function() { getpreSellOrderList: function() {
let that = this; let that = this;
getOrderList({ getOrderList({
@ -869,9 +1029,8 @@
that.$set(that, 'presellProList', list); that.$set(that, 'presellProList', list);
}) })
}, },
/**
* 获取单个订单商品数量 //
*/
getProductCount: function() { getProductCount: function() {
if (this.orderStatus !== 0) { if (this.orderStatus !== 0) {
this.orderList.forEach((item, i) => { this.orderList.forEach((item, i) => {
@ -885,9 +1044,8 @@
}) })
} }
}, },
/**
* 删除订单 //
*/
delOrder: function(order_id, index) { delOrder: function(order_id, index) {
let that = this; let that = this;
orderDel(order_id).then(res => { orderDel(order_id).then(res => {
@ -905,6 +1063,7 @@
}); });
}) })
}, },
// //
confirmOrder: function(item, index) { confirmOrder: function(item, index) {
let that = this; let that = this;
@ -930,6 +1089,7 @@
} }
}) })
}, },
/*申请开票*/ /*申请开票*/
applyInvoice(order_id) { applyInvoice(order_id) {
let that = this; let that = this;
@ -939,11 +1099,13 @@
that.$refs.addInvoicing.getInvoiceDefault(); that.$refs.addInvoicing.getInvoiceDefault();
that.$refs.addInvoicing.getInvoiceList(); that.$refs.addInvoicing.getInvoiceList();
}, },
// //
changeInvoiceClose: function(data) { changeInvoiceClose: function(data) {
if (data) this.getInvoiceData(data); if (data) this.getInvoiceData(data);
this.$set(this.invoice, 'invoice', false); this.$set(this.invoice, 'invoice', false);
}, },
// //
getInvoiceData(data) { getInvoiceData(data) {
let that = this let that = this
@ -959,12 +1121,138 @@
} }
}, },
onReachBottom: function() { onReachBottom: function() {
this.getOrderList(); if (this.orderStatus == 4)
this.getRefundList()
else
this.getOrderList();
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.info-box {
position: relative;
margin-top: 12rpx;
background-color: #fff;
.title {
display: flex;
align-items: center;
padding: 0 32rpx;
height: 86rpx;
border-bottom: 1px solid #F0F0F0;
color: #282828;
.icon-shangjiadingdan {
font-size: 32rpx;
}
.txt {
margin: 0 5rpx;
}
.icon-xiangyou {
color: #999;
font-size: 20rpx;
margin-top: 6rpx;
}
}
.product-box {
.product-item {
display: flex;
padding: 25rpx 30rpx;
.img-box {
width: 130rpx;
height: 130rpx;
border-radius: 16rpx;
}
.msg {
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 440rpx;
margin-left: 26rpx;
.name {
font-size: 28rpx;
color: #282828;
}
.des {
font-size: 20rpx;
color: #868686;
}
.price {
font-size: 26rpx;
}
.num {
position: absolute;
right: -50rpx;
top: 4rpx;
color: #868686;
font-size: 26rpx;
}
}
}
.event_name {
display: inline-block;
margin-right: 9rpx;
color: #fff;
font-size: 20rpx;
padding: 0 8rpx;
line-height: 30rpx;
text-align: center;
border-radius: 6rpx;
}
}
.btn-box {
display: flex;
justify-content: flex-end;
padding: 0 20rpx 20rpx;
.btn {
width: 176rpx;
height: 60rpx;
line-height: 60rpx;
margin-left: 18rpx;
text-align: center;
background: var(--view-theme);
border-radius: 30rpx;
color: #fff;
font-size: 27rpx;
&.gray {
border: 1px solid #ddd;
background: transparent;
color: #aaa;
}
}
}
.status {
position: absolute;
right: 30rpx;
top: 0;
.iconfont {
font-size: 120rpx;
opacity: .3;
}
.p-color {
color: var(--view-theme);
}
}
}
.popups { .popups {
width: 640rpx; width: 640rpx;
background-color: #fff; background-color: #fff;
@ -1093,6 +1381,7 @@
} }
.store-name { .store-name {
max-width: 400rpx;
margin: 0 10rpx; margin: 0 10rpx;
} }

View File

@ -4,7 +4,8 @@
<view class='header'> <view class='header'>
<view class="search acea-row row-middle"> <view class="search acea-row row-middle">
<text class="iconfont icon-sousuo"></text> <text class="iconfont icon-sousuo"></text>
<input v-model="store_name" :focus="focus" confirm-type="search" placeholder="搜索我的订单" class="input" inputmode="search" @confirm="handleSearch" /> <input v-model="store_name" :focus="focus" confirm-type="search" placeholder="搜索我的订单" class="input"
inputmode="search" @confirm="handleSearch" />
</view> </view>
</view> </view>
<view class='list'> <view class='list'>
@ -17,74 +18,155 @@
<view class="acea-row row-middle left-wrapper"> <view class="acea-row row-middle left-wrapper">
{{item.group_order_sn}} {{item.group_order_sn}}
</view> </view>
<view class='t-color'>{{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}</view> <view class='t-color'>
{{ item.orderList[0].activity_type === 2 && item.orderList[0].orderProduct[0].cart_info.productPresell.presell_type ==2 ? "待付定金" : "待付款" }}
</view>
</view> </view>
<view v-for="(order,j) in item.orderList" :key="order.order_id+j"> <view v-for="(order,j) in item.orderList" :key="order.order_id+j">
<!--预售--> <!--预售-->
<view v-if="order.activity_type === 2"> <view v-if="order.activity_type === 2">
<block v-for="(goods,g) in order.orderProduct"> <block v-for="(goods,g) in order.orderProduct">
<view class='item-info acea-row row-between row-top'> <view class='item-info acea-row row-between row-top'>
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name line1'> <view class='name line1'>
<text class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text> <text
class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text>
<view class="event_ship event_color">发货时间 <view class="event_ship event_color">发货时间
<!--全款预售--> <!--全款预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 1"> <text
v-if="goods.cart_info.productPresell.presell_type === 1">
{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内 {{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内
</text> </text>
<!--定金预售--> <!--定金预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text> <text
v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text>
</view> </view>
</view> </view>
<view class='money'> <view class='money'>
<view>{{goods.cart_info.productPresellAttr.presell_price}}</view> <view>{{goods.cart_info.productPresellAttr.presell_price}}
</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</view> </view>
</view> </view>
<view v-if="goods.cart_info.productPresell.presell_type === 2" class="event_price"> <view v-if="goods.cart_info.productPresell.presell_type === 2"
定金待支付 <text class="t-color">{{ order.pay_price }}</text> class="event_price">
尾款待支付 <text class="t-color">{{ order.presellOrder.pay_price }}</text> 定金待支付 <text class="t-color">{{ order.pay_price }}</text>
尾款待支付 <text
class="t-color">{{ order.presellOrder.pay_price }}</text>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<view v-else> <view v-else>
<block v-for="(goods,g) in order.orderProduct"> <block v-for="(goods,g) in order.orderProduct">
<view class='item-info acea-row row-between row-top'> <view class='item-info acea-row row-between row-top'>
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view>
<view class='text acea-row row-between'>
<view class='name line2'>{{goods.cart_info.product.store_name}}
</view> </view>
<view class='text acea-row row-between'>
<view class='name line2'>{{goods.cart_info.product.store_name}}</view> <view class='money' v-if="item.orderList[0].activity_type == 4">
<view v-if="goods.cart_info.activeSku">
<view class='money' v-if="item.orderList[0].activity_type == 4"> {{goods.cart_info.activeSku.active_price}}</view>
<view v-if="goods.cart_info.activeSku">{{goods.cart_info.activeSku.active_price}}</view> <view>x{{goods.product_num}}</view>
<view>x{{goods.product_num}}</view> </view>
</view> <view v-else class='money'>
<view v-else class='money'> <view>{{goods.cart_info.productAttr.price}}</view>
<view>{{goods.cart_info.productAttr.price}}</view> <view>x{{goods.product_num}}</view>
<view>x{{goods.product_num}}</view>
</view>
</view> </view>
</view> </view>
</block> </view>
</view> </block>
</view>
</view> </view>
<view class='totalPrice' v-if="item.orderList[0].activity_type !== 2">{{item.total_num || 0}}件商品总金额 <view class='totalPrice' v-if="item.orderList[0].activity_type !== 2">
{{item.total_num || 0}}件商品总金额
<text class='money p-color'>{{item.pay_price}}</text> <text class='money p-color'>{{item.pay_price}}</text>
</view> </view>
<view class='bottom acea-row row-right row-middle'> <view class='bottom acea-row row-right row-middle'>
<!-- <view class='bnt cancelBnt' @click.stop='cancelOrder(index,item.group_order_id)'>取消订单</view> --> <!-- <view class='bnt cancelBnt' @click.stop='cancelOrder(index,item.group_order_id)'>取消订单</view> -->
<view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>立即付款</view> <view class='bnt b-color' @click.stop='goPay(item.pay_price,item.group_order_id)'>
立即付款</view>
</view> </view>
</view> </view>
</view> </view>
</block> </block>
<block v-else-if="orderStatus == 4">
<view class="goods-wrapper">
<view>
<view class="info-box" v-for="(item,index) in orderList" :key="index">
<view class="title" @click="goStore(item)">
<text class="iconfont icon-shangjiadingdan"></text>
<text v-if="item.merchant" class="txt">{{item.merchant.mer_name}}</text>
<text class="iconfont icon-xiangyou"></text>
</view>
<view class="product-box">
<view class="product-item" v-for="goods in item.refundProduct"
:key="goods.order_product_id">
<image class="img-box" :src="goods.product.cart_info.product.image" mode="">
</image>
<view class="msg">
<view class="name line1"><text
v-if="goods.product.cart_info.product_type === 2"
class="event_name event_bg">预售</text>{{goods.product.cart_info.product.store_name}}
</view>
<view class="des">{{goods.product.cart_info.productAttr.sku}}</view>
<view class="price">退款{{goods.refund_price}}</view>
<view class="num">x {{goods.refund_num}}</view>
</view>
</view>
</view>
<view class="btn-box" v-if="item.status == 1">
<view class="btn gray" @click="goDetail(item)">查看详情</view>
<view class="btn" @click="goPage(item.refund_order_id)">退回商品</view>
</view>
<view class="btn-box" v-else-if="item.status == -1">
<view class="btn" @click="goDetail(item)">查看详情</view>
<!-- <view class="btn" @click="applyAgain(item)">再次申请</view> -->
</view>
<view class="btn-box" v-else>
<view class="btn gray" v-if="item.status == 3" @click="bindDetele(item,index)">
删除订单</view>
<view class="btn" @click="goDetail(item)">查看详情</view>
</view>
<view class="status">
<!-- 0审核中 1待发货 2待收货 3已退款 -1已拒绝 -->
<block v-if="item.status == 0">
<text class="iconfont icon-shenhezhong1 p-color"></text>
</block>
<block v-if="item.status == 1">
<text class="iconfont icon-daituihuo"></text>
</block>
<block v-if="item.status == 2">
<text class="iconfont icon-tuihuozhong"></text>
</block>
<block v-if="item.status == 3">
<text class="iconfont icon-yituikuan"></text>
</block>
<block v-if="item.status == -1">
<text class="iconfont icon-yijujue1"></text>
</block>
<block v-if="item.status == -2">
<text class="iconfont icon-yiquxiao"></text>
</block>
</view>
</view>
</view>
</view>
</block>
<!-- 待发货 待收货 待评价 已完成 --> <!-- 待发货 待收货 待评价 已完成 -->
<block v-else> <block v-else>
<view class='item' v-for="(item,index) in orderList" :key="index"> <view class='item' v-for="(item,index) in orderList" :key="index">
@ -92,7 +174,9 @@
<view class='title acea-row row-between-wrapper'> <view class='title acea-row row-between-wrapper'>
<view class="acea-row row-middle left-wrapper" @click.stop="goMall(item)"> <view class="acea-row row-middle left-wrapper" @click.stop="goMall(item)">
<text class="iconfont icon-shangjiadingdan"></text> <text class="iconfont icon-shangjiadingdan"></text>
<view class="store-name">{{item.merchant.mer_name}}</view> <view class="store-name line1" style="max-width: 500rpx;">
{{item.merchant.mer_name}}
</view>
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
<view v-if="item.status == 0" class='t-color'>待发货</view> <view v-if="item.status == 0" class='t-color'>待发货</view>
@ -102,22 +186,30 @@
<view v-if="item.status == -1" class='t-color'>已退款</view> <view v-if="item.status == -1" class='t-color'>已退款</view>
</view> </view>
<view v-if="item.activity_type === 2"> <view v-if="item.activity_type === 2">
<view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct" :key="index"> <view class='item-info acea-row row-between row-top'
v-for="(goods,index) in item.orderProduct" :key="index">
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name '> <view class='name '>
<view class='name' :class="item.status === 0 ? 'line1' : 'line2'"> <view class='name' :class="item.status === 0 ? 'line1' : 'line2'">
<text class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text> <text
class="event_name event_bg">预售</text><text>{{goods.cart_info.product.store_name}}</text>
<view v-if="item.status == 0" class="event_ship event_color">发货时间 <view v-if="item.status == 0" class="event_ship event_color">发货时间
<!--全款预售--> <!--全款预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 1">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text> <text
v-if="goods.cart_info.productPresell.presell_type === 1">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text>
<!--定金预售--> <!--定金预售-->
<text v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text> <text
v-if="goods.cart_info.productPresell.presell_type === 2">{{ goods.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ goods.cart_info.productPresell.delivery_day }}天内</text>
</view> </view>
</view> </view>
<view style="margin-top: 10rpx;" class="t-color">{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}</view> <view style="margin-top: 10rpx;" class="t-color">
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
</view>
</view> </view>
<view class='money'> <view class='money'>
<view>{{goods.cart_info.productPresellAttr.presell_price}}</view> <view>{{goods.cart_info.productPresellAttr.presell_price}}</view>
@ -127,23 +219,30 @@
</view> </view>
</view> </view>
<view v-else> <view v-else>
<view class='item-info acea-row row-between row-top' v-for="(goods,index) in item.orderProduct" :key="index"> <view class='item-info acea-row row-between row-top'
v-for="(goods,index) in item.orderProduct" :key="index">
<view class='pictrue'> <view class='pictrue'>
<image :src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'></image> <image
:src='(goods.cart_info.productAttr && goods.cart_info.productAttr.image) || goods.cart_info.product.image'>
</image>
</view> </view>
<view class='text acea-row row-between'> <view class='text acea-row row-between'>
<view class='name '> <view class='name '>
<view class='name line2'> <view class='name line2'>
<text>{{goods.cart_info.product.store_name}}</text> <text>{{goods.cart_info.product.store_name}}</text>
</view> </view>
<view style="margin-top: 10rpx;" class="t-color">{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}</view> <view style="margin-top: 10rpx;" class="t-color">
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
</view>
</view> </view>
<view class='money' v-if="item.activity_type == 3"> <view class='money' v-if="item.activity_type == 3">
<view v-if="goods.cart_info.productAssistAttr">{{goods.cart_info.productAssistAttr.assist_price}}</view> <view v-if="goods.cart_info.productAssistAttr">
{{goods.cart_info.productAssistAttr.assist_price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</view> </view>
<view class='money' v-else-if="item.activity_type == 4"> <view class='money' v-else-if="item.activity_type == 4">
<view v-if="goods.cart_info.activeSku">{{goods.cart_info.activeSku.active_price}}</view> <view v-if="goods.cart_info.activeSku">
{{goods.cart_info.activeSku.active_price}}</view>
<view>x{{goods.product_num}}</view> <view>x{{goods.product_num}}</view>
</view> </view>
<view class='money' v-else> <view class='money' v-else>
@ -162,23 +261,32 @@
</view> </view>
<view class='bottom acea-row row-right row-middle'> <view class='bottom acea-row row-right row-middle'>
<block v-if="item.status == 0 || item.status == 9 || item.status == -1"> <block v-if="item.status == 0 || item.status == 9 || item.status == -1">
<!-- <view class='bnt cancelBnt' @click='goOrderDetails(item.order_id)'>申请退款</view> --> <!-- <view class='bnt cancelBnt' @click='goOrderDetails(item.order_id)'>申请退款</view> -->
<view class='bnt b-color' @click='goOrderDetails(item.order_id)'>查看详情</view> <view class='bnt b-color' @click='goOrderDetails(item.order_id)'>查看详情</view>
</block> </block>
<block v-if="item.status == 1"> <block v-if="item.status == 1">
<view class='bnt cancelBnt' v-if="item.delivery_type == 1 || item.delivery_type == 2" @click='goOrderDetails(item.order_id)'>查看物流</view> <view class='bnt cancelBnt'
v-if="item.delivery_type == 1 || item.delivery_type == 2"
@click='goOrderDetails(item.order_id)'>查看物流</view>
<view class='bnt b-color' @tap='confirmOrder(item,index)'>确认收货</view> <view class='bnt b-color' @tap='confirmOrder(item,index)'>确认收货</view>
</block> </block>
<block v-if="item.status == 2"> <block v-if="item.status == 2">
<navigator v-if="community_status == 1 && !item.community_id" :url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id" class='bnt colorBnt' hover-class="none"> <navigator v-if="community_status == 1 && !item.community_id"
:url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id"
class='bnt colorBnt' hover-class="none">
<text class="iconfont icon-fabu"></text> <text class="iconfont icon-fabu"></text>
发布种草 发布种草
</navigator> </navigator>
<view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价</view> <view class='bnt b-color' @click='goOrderDetails_Evaluation(item.order_id)'>去评价
</view>
</block> </block>
<block v-if="item.status == 3"> <block v-if="item.status == 3">
<view class='bnt b-color' @click='goOrderDetails(item.order_id)' v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10">查看详情</view> <view class='bnt b-color' @click='goOrderDetails(item.order_id)'
<navigator v-if="community_status == 1 && !item.community_id" :url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id" class='bnt colorBnt' hover-class="none"> v-if="item.activity_type == 2 || item.activity_type == 3 || item.activity_type == 10">
查看详情</view>
<navigator v-if="community_status == 1 && !item.community_id"
:url="'/pages/plantGrass/plant_release/index?order_id='+item.order_id"
class='bnt colorBnt' hover-class="none">
<text class="iconfont icon-fabu"></text> <text class="iconfont icon-fabu"></text>
发布种草 发布种草
</navigator> </navigator>
@ -197,7 +305,8 @@
</view> </view>
</view> </view>
<home></home> <home></home>
<payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id" :totalPrice='totalPrice'></payment> <payment :payMode='payMode' :pay_close="pay_close" @onChangeFun='onChangeFun' :order_id="pay_order_id"
:totalPrice='totalPrice'></payment>
</view> </view>
</template> </template>
@ -219,16 +328,27 @@
orderDel, orderDel,
orderPay, orderPay,
groupOrderList, groupOrderList,
orderTake orderTake,
refundListNew
} from '@/api/order.js'; } from '@/api/order.js';
import { getUserInfo } from '@/api/user.js'; import {
import { openOrderSubscribe } from '@/utils/SubscribeMessage.js'; getUserInfo
} from '@/api/user.js';
import {
openOrderSubscribe
} from '@/utils/SubscribeMessage.js';
import payment from '@/components/payment'; import payment from '@/components/payment';
import home from '@/components/home/index.vue'; import home from '@/components/home/index.vue';
import { mapGetters } from "vuex"; import {
mapGetters
} from "vuex";
import emptyPage from '@/components/emptyPage.vue' import emptyPage from '@/components/emptyPage.vue'
import { configMap } from '@/utils' import {
import { toLogin } from '@/libs/login.js'; configMap
} from '@/utils'
import {
toLogin
} from '@/libs/login.js';
export default { export default {
components: { components: {
payment, payment,
@ -240,7 +360,7 @@
loading: false, // loading: false, //
loadend: false, // loadend: false, //
loadTitle: '加载更多', // loadTitle: '加载更多', //
sale_type: 1, sale_type: 1,
orderList: [], // orderList: [], //
presellProList: [], // presellProList: [], //
presellOrderCount: 0, presellOrderCount: 0,
@ -276,25 +396,34 @@
pay_order_id: '', pay_order_id: '',
totalPrice: '0', totalPrice: '0',
isReady: true, isReady: true,
store_name: '' store_name: '',
orderStatus: '',
refundParams: {
page: 1,
limit: 15,
type: 0,
identity: '',
search_info: ''
}
}; };
}, },
computed: { computed: {
...mapGetters(['isLogin','viewColor']), ...mapGetters(['isLogin', 'viewColor']),
...configMap(['hide_mer_status', 'community_status', 'alipay_open', 'yue_pay_status']), ...configMap(['hide_mer_status', 'community_status', 'alipay_open', 'yue_pay_status']),
}, },
watch: { watch: {
alipay_open(n){ alipay_open(n) {
this.payMode[1].payStatus = n this.payMode[1].payStatus = n
}, },
yue_pay_status(n){ yue_pay_status(n) {
this.payMode[2].payStatus = n this.payMode[2].payStatus = n
} }
}, },
onLoad(options) { onLoad(options) {
if (options.status) this.orderStatus = options.status; if (options.status) this.orderStatus = options.status;
if (options.sale_type) this.sale_type = options.sale_type; if (options.sale_type) this.sale_type = options.sale_type;
}, this.refundParams.identity = options.sale_type;
},
onShow() { onShow() {
if (this.isLogin) { if (this.isLogin) {
this.page = 1; this.page = 1;
@ -304,16 +433,12 @@
toLogin() toLogin()
} }
}, },
onReady(){
},
mounted: function() {
},
methods: { methods: {
// //
goMall(item){ goMall(item) {
if(this.hide_mer_status == 0){ if (this.hide_mer_status == 0) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/store/home/index?id='+item.mer_id url: '/pages/store/home/index?id=' + item.mer_id
}) })
} }
}, },
@ -462,15 +587,15 @@
title: '缺少订单号无法查看订单详情和评价' title: '缺少订单号无法查看订单详情和评价'
}); });
// #ifdef MP // #ifdef MP
if (self.orderStatus == 0) { if (self.orderStatus == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/stay?order_id=' + order_id url: '/pages/order_details/stay?order_id=' + order_id
}) })
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/order_details/index?order_id=' + order_id url: '/pages/order_details/index?order_id=' + order_id
}) })
} }
// #endif // #endif
// #ifndef MP // #ifndef MP
if (self.orderStatus == 0) { if (self.orderStatus == 0) {
@ -484,18 +609,62 @@
} }
// #endif // #endif
}, },
/**
* 切换类型 // 退
*/ getRefundList() {
statusClick: function(status) { let that = this;
if (status == this.orderStatus) return; if (that.loadend) return;
this.orderStatus = status; if (that.loading) return;
this.loadend = false; that.loading = true;
this.loading = false; that.loadTitle = "加载更多";
this.page = 1; refundListNew(this.refundParams).then(res => {
this.$set(this, 'orderList', []); let list = res.data.list || [];
this.getOrderList(); let loadend = list.length < that.limit;
that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
.orderList);
that.$set(that, 'orderList', that.orderList);
that.getProductCount();
that.loadend = loadend;
that.loading = false;
that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
that.page = that.page + 1;
that.isReady = true;
uni.stopPullDownRefresh();
}).catch(err => {
that.loading = false;
that.loadTitle = "加载更多";
})
}, },
//
goDetail(item) {
uni.navigateTo({
url: '/pages/users/refund/detail?id=' + item.refund_order_id
})
},
//
bindDetele(item, index) {
let self = this
uni.showModal({
title: '提示',
content: '确定删除该记录吗?',
success: function(res) {
if (res.confirm) {
refundDel(item.refund_order_id).then(res => {
self.goodsList.splice(index, 1)
})
uni.showToast({
title: '删除成功',
icon: 'none'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
/** /**
* 获取订单列表 * 获取订单列表
*/ */
@ -510,7 +679,7 @@
page: that.page, page: that.page,
limit: that.limit, limit: that.limit,
store_name: that.store_name, store_name: that.store_name,
sale_type: that.sale_type sale_type: that.sale_type
}).then(res => { }).then(res => {
let list = res.data.list || []; let list = res.data.list || [];
let loadend = list.length < that.limit; let loadend = list.length < that.limit;
@ -527,58 +696,24 @@
that.loadTitle = "加载更多"; that.loadTitle = "加载更多";
}) })
}, },
/**
* 获取定金预售订单列表
*/
getpreSellOrderList: function() {
let that = this;
getOrderList({
status: 10,
page: 1,
limit: 1,
}).then(res => {
let list = res.data.list || [];
that.presellOrderCount = res.data.count;
that.$set(that, 'presellProList', list);
})
},
/** /**
* 获取单个订单商品数量 * 获取单个订单商品数量
*/ */
getProductCount: function(){ getProductCount: function() {
if(this.orderStatus !== 0){ if (this.orderStatus !== 0) {
this.orderList.forEach((item,i) => { this.orderList.forEach((item, i) => {
let orderNum = 0 let orderNum = 0
if(item.orderProduct){ if (item.orderProduct) {
item.orderProduct.forEach((val) => { item.orderProduct.forEach((val) => {
orderNum += val.product_num orderNum += val.product_num
}) })
this.orderList[i]['orderNum']=orderNum; this.orderList[i]['orderNum'] = orderNum;
} }
}) })
} }
}, },
/**
* 删除订单
*/
delOrder: function(order_id, index) {
let that = this;
orderDel(order_id).then(res => {
that.orderList.splice(index, 1);
that.$set(that, 'orderList', that.orderList);
that.$set(that.orderData, 'unpaid_count', that.orderData.unpaid_count - 1);
that.getOrderData();
return that.$util.Tips({
title: '删除成功',
icon: 'success'
});
}).catch(err => {
return that.$util.Tips({
title: err
});
})
},
// //
confirmOrder: function(item, index) { confirmOrder: function(item, index) {
let that = this; let that = this;
@ -606,7 +741,7 @@
}, },
handleSearch() { handleSearch() {
this.loadend = false; this.loadend = false;
this.page = 1; this.loading = false;
this.orderList = []; this.orderList = [];
if (!this.store_name) { if (!this.store_name) {
return this.$util.Tips({ return this.$util.Tips({
@ -614,45 +749,196 @@
}); });
return; return;
} }
this.getOrderList();
if (this.orderStatus == 4) {
this.refundParams.search_info = this.store_name;
this.refundParams.page = 1;
this.refundParams.search_info = this.store_name;
this.getRefundList();
} else {
this.page = 1;
this.getOrderList();
}
} }
}, },
onReachBottom: function() { onReachBottom: function() {
this.getOrderList(); if (this.orderStatus == 4)
this.getRefundList()
else
this.getOrderList();
}, },
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.info-box {
position: relative;
margin-top: 12rpx;
background-color: #fff;
.title {
display: flex;
align-items: center;
padding: 0 32rpx;
height: 86rpx;
border-bottom: 1px solid #F0F0F0;
color: #282828;
.icon-shangjiadingdan {
font-size: 32rpx;
}
.txt {
margin: 0 5rpx;
}
.icon-xiangyou {
color: #999;
font-size: 20rpx;
margin-top: 6rpx;
}
}
.product-box {
.product-item {
display: flex;
padding: 25rpx 30rpx;
.img-box {
width: 130rpx;
height: 130rpx;
border-radius: 16rpx;
}
.msg {
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 440rpx;
margin-left: 26rpx;
.name {
font-size: 28rpx;
color: #282828;
}
.des {
font-size: 20rpx;
color: #868686;
}
.price {
font-size: 26rpx;
}
.num {
position: absolute;
right: -50rpx;
top: 4rpx;
color: #868686;
font-size: 26rpx;
}
}
}
.event_name {
display: inline-block;
margin-right: 9rpx;
color: #fff;
font-size: 20rpx;
padding: 0 8rpx;
line-height: 30rpx;
text-align: center;
border-radius: 6rpx;
}
}
.btn-box {
display: flex;
justify-content: flex-end;
padding: 0 20rpx 20rpx;
.btn {
width: 176rpx;
height: 60rpx;
line-height: 60rpx;
margin-left: 18rpx;
text-align: center;
background: var(--view-theme);
border-radius: 30rpx;
color: #fff;
font-size: 27rpx;
&.gray {
border: 1px solid #ddd;
background: transparent;
color: #aaa;
}
}
}
.status {
position: absolute;
right: 30rpx;
top: 0;
.iconfont {
font-size: 120rpx;
opacity: .3;
}
.p-color {
color: var(--view-theme);
}
}
}
.my-order .header { .my-order .header {
padding: 17rpx 30rpx; padding: 17rpx 30rpx;
background-color: var(--view-theme); background-color: var(--view-theme);
} }
.t-color{color: var(--view-theme);}
.p-color{color: var(--view-priceColor);} .t-color {
.b-color{background-color:var(--view-theme);} color: var(--view-theme);
}
.p-color {
color: var(--view-priceColor);
}
.b-color {
background-color: var(--view-theme);
}
.my-order .header .picTxt { .my-order .header .picTxt {
height: 190rpx; height: 190rpx;
} }
.my-order .header .picTxt .text { .my-order .header .picTxt .text {
color: rgba(255, 255, 255, 0.8); color: rgba(255, 255, 255, 0.8);
font-size: 26rpx; font-size: 26rpx;
} }
.my-order .header .picTxt .text .name { .my-order .header .picTxt .text .name {
font-size: 34rpx; font-size: 34rpx;
font-weight: bold; font-weight: bold;
color: #fff; color: #fff;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.my-order .header .picTxt .pictrue { .my-order .header .picTxt .pictrue {
width: 122rpx; width: 122rpx;
height: 109rpx; height: 109rpx;
} }
.my-order .header .picTxt .pictrue image { .my-order .header .picTxt .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.my-order .nav { .my-order .nav {
background-color: #fff; background-color: #fff;
width: 690rpx; width: 690rpx;
@ -660,28 +946,34 @@
border-radius: 16rpx; border-radius: 16rpx;
margin: -73rpx auto 0 auto; margin: -73rpx auto 0 auto;
} }
.my-order .nav .item { .my-order .nav .item {
text-align: center; text-align: center;
font-size: 26rpx; font-size: 26rpx;
color: #282828; color: #282828;
padding: 29rpx 0; padding: 29rpx 0;
} }
.my-order .nav .item.on { .my-order .nav .item.on {
font-weight: bold; font-weight: bold;
border-bottom: 5rpx solid var(--view-theme); border-bottom: 5rpx solid var(--view-theme);
} }
.my-order .nav .item .num { .my-order .nav .item .num {
margin-top: 18rpx; margin-top: 18rpx;
} }
.my-order .list { .my-order .list {
width: 690rpx; width: 690rpx;
margin: 14rpx auto 0 auto; margin: 14rpx auto 0 auto;
} }
.my-order .list .item { .my-order .list .item {
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
margin-bottom: 14rpx; margin-bottom: 14rpx;
} }
.my-order .list .item .title { .my-order .list .item .title {
height: 84rpx; height: 84rpx;
padding: 0 30rpx; padding: 0 30rpx;
@ -693,50 +985,61 @@
.iconfont { .iconfont {
margin-top: 5rpx; margin-top: 5rpx;
} }
.store-name { .store-name {
margin: 0 10rpx; margin: 0 10rpx;
} }
.icon-xiangyou { .icon-xiangyou {
font-size: 20rpx; font-size: 20rpx;
} }
} }
} }
.my-order .list .item .title .sign { .my-order .list .item .title .sign {
font-size: 24rpx; font-size: 24rpx;
padding: 0 7rpx; padding: 0 7rpx;
height: 36rpx; height: 36rpx;
margin-right: 15rpx; margin-right: 15rpx;
} }
.my-order .list .item .item-info { .my-order .list .item .item-info {
padding: 0 30rpx; padding: 0 30rpx;
margin-top: 22rpx; margin-top: 22rpx;
} }
.my-order .list .item .item-info .pictrue { .my-order .list .item .item-info .pictrue {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
} }
.my-order .list .item .item-info .pictrue image { .my-order .list .item .item-info .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 6rpx; border-radius: 6rpx;
} }
.my-order .list .item .item-info .text { .my-order .list .item .item-info .text {
width: 486rpx; width: 486rpx;
font-size: 28rpx; font-size: 28rpx;
color: #999; color: #999;
margin-top: 6rpx; margin-top: 6rpx;
} }
.my-order .list .item .item-info .text .name { .my-order .list .item .item-info .text .name {
width: 320rpx; width: 320rpx;
color: #282828; color: #282828;
} }
.event_bg{
.event_bg {
background: #FF7F00; background: #FF7F00;
} }
.event_color{
.event_color {
color: #FF7F00; color: #FF7F00;
} }
.my-order .list .item .event_name{
.my-order .list .item .event_name {
display: inline-block; display: inline-block;
margin-right: 9rpx; margin-right: 9rpx;
color: #fff; color: #fff;
@ -746,16 +1049,20 @@
text-align: center; text-align: center;
border-radius: 6rpx; border-radius: 6rpx;
} }
.my-order .list .item .event_ship{
.my-order .list .item .event_ship {
font-size: 20rpx; font-size: 20rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
.my-order .list .event_price{
.my-order .list .event_price {
margin: 0 0 50rpx 120rpx; margin: 0 0 50rpx 120rpx;
} }
.my-order .list .item .item-info .text .money { .my-order .list .item .item-info .text .money {
text-align: right; text-align: right;
} }
.my-order .list .item .totalPrice { .my-order .list .item .totalPrice {
font-size: 26rpx; font-size: 26rpx;
color: #282828; color: #282828;
@ -763,10 +1070,12 @@
margin: 27rpx 0 0 30rpx; margin: 27rpx 0 0 30rpx;
padding: 0 30rpx 30rpx 0; padding: 0 30rpx 30rpx 0;
} }
.my-order .list .item .totalPrice .money { .my-order .list .item .totalPrice .money {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
} }
.my-order .list .item .bottom { .my-order .list .item .bottom {
height: 107rpx; height: 107rpx;
padding: 0 30rpx; padding: 0 30rpx;
@ -787,32 +1096,39 @@
border: 1px solid #ddd; border: 1px solid #ddd;
color: #aaa; color: #aaa;
} }
.my-order .list .item .bottom .bnt.colorBnt { .my-order .list .item .bottom .bnt.colorBnt {
border: 1px solid var(--view-theme); border: 1px solid var(--view-theme);
color: var(--view-theme); color: var(--view-theme);
} }
.my-order .list .item .bottom .bnt .icon-fabu{
.my-order .list .item .bottom .bnt .icon-fabu {
font-size: 26rpx; font-size: 26rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.my-order .list .item .bottom .bnt~.bnt { .my-order .list .item .bottom .bnt~.bnt {
margin-left: 17rpx; margin-left: 17rpx;
} }
.search { .search {
height: 60rpx; height: 60rpx;
padding: 0 30rpx; padding: 0 30rpx;
border-radius: 30rpx; border-radius: 30rpx;
background-color: #FFFFFF; background-color: #FFFFFF;
font-size: 26rpx; font-size: 26rpx;
.iconfont { .iconfont {
margin-right: 10rpx; margin-right: 10rpx;
font-size: 26rpx; font-size: 26rpx;
color: #999999; color: #999999;
} }
.input-placeholder { .input-placeholder {
font-size: 26rpx; font-size: 26rpx;
color: #999999; color: #999999;
} }
.input { .input {
flex: 1; flex: 1;
} }

View File

@ -61,7 +61,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="btn-box" @click="bindComfirm">申请退款</view> <view class="btn-box" @click="$u.throttle(bindComfirm, 1000)">申请退款</view>
<alertBox :msg="msg" v-if="isShowBox" @bindClose="bindClose"></alertBox> <alertBox :msg="msg" v-if="isShowBox" @bindClose="bindClose"></alertBox>
</view> </view>
</template> </template>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
static/images/loading.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

29
utils/mixin.js Normal file
View File

@ -0,0 +1,29 @@
const mixins = {
data() {
return {
wrapHeight: 'auto',
clientY: 0,
maxHeight: 0,
}
},
methods: {
// 移动
onTouchMove(e) {
console.log(e);
const moveDistance = e.changedTouches[0].clientY - this.clientY;
if (moveDistance > 5) {
this.wrapHeight = '352rpx';
} else {
this.wrapHeight = 0;
}
},
// 开始触摸屏幕
onTouchStart(e) {
this.clientY = e.changedTouches[0].clientY;
},
}
}
export default mixins;

View File

@ -24,6 +24,15 @@ import permision from "./permission.js"
// #endif // #endif
export default { export default {
getDom: (that, selector, fn) => {
that.$nextTick(() => {
const query = uni.createSelectorQuery().in(that);
query.select(selector).boundingClientRect((data) => {
fn && fn(data);
}).exec();
})
},
//复制 //复制
uniCopy: ({ uniCopy: ({
content, content,

View File

@ -8,6 +8,7 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
module.exports = { module.exports = {
publicPath: '/h5',
productionSourceMap: false, // 生产打包时不输出map文件增加打包速度 productionSourceMap: false, // 生产打包时不输出map文件增加打包速度
configureWebpack: config => { configureWebpack: config => {
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {